/****************************************************************************************

>> FORM VALIDATION << 

*****************************************************************************************/



function validation() {

	missinginfo = "";



	if (document.function_enquiry._01_Name.value=="") {

	missinginfo += "\n     - Contact Name";

	}

	// validate an e-mail address

	if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.function_enquiry._03_Email_Address.value)){

	missinginfo += "\n     - Please enter a valid email address (e.g., user@domain.com)";

	}

	

	if (missinginfo != "") {

	missinginfo = "Please enter some details into the following required fields\n" +

	"_____________________________\n" +

	missinginfo + "\n_____________________________\n" +

	"\nand submit again!";

	alert(missinginfo);

	return false;

	}

	else return true;

	}

	$(function(){ 
		/* Random Image Selector */
		// Add a different class to all the images.
		$('.RandomImageCollection img').each(function(Counter){
			$(this).addClass('' + Counter + '');			
		});
		
		var TotalImages = ($('.RandomImageCollection img').length);
		var RandomImage = Math.floor(Math.random()*TotalImages)
		$('#banner').append($('.RandomImageCollection img:eq(' + RandomImage + ')'));
	});
