function FormValidation(theform){
	
	var total = theform.length;
	var div = document.getElementById("errorMessage");
	var errors = 0;
	var errorInclude = new Array();
	var errorMessage = new Array(9);
	errorMessage[0]="<li>You never submitted the form!</li>";
	errorMessage[1]="<li>You must complete the 'Your Name' field</li>";
	errorMessage[2]="<li>You must complete the 'Company Name' field</li>";
	errorMessage[3]="<li>You must complete the 'Location' field</li>";
	errorMessage[4]="<li>You must complete the 'Email' field</li>";
	errorMessage[5]="<li>You must complete the 'Tel No' field</li>";
	errorMessage[6]="";
	errorMessage[7]="<li>You must complete the 'Your Message' field</li>";
	errorMessage[8]="";
		
	//alert(total);
	for(i = 0; i < (total - 1); i++){
		theform[i].style.backgroundColor = "";
		theform[i].style.border = "1px solid #6d3c97";
		//alert(theform[i].name);
		if(theform[i].value == "" && i!=3){
			theform[i].style.backgroundColor = "#ff7777";
			theform[i].style.border = "1px solid #bd2424";
			theform[i].focus();
			errorInclude = errorInclude.concat(errorMessage[i]);
			errors = 1;
		}
	}
	
	if(errors == 1){
		var totalE = errorInclude.length;
		div.innerHTML = "<h3>Errors</h3><ul>" + errorInclude.join("") +"</ul>";
		div.style.backgroundColor = "#ff7777";
		div.style.border = "1px solid #bd2424";
		div.style.color = "#000";
		div.style.margin = "0px 0px 10px 30px";
		div.style.padding = "10px";
		div.style.width = "730px";
		div.style.cssFloat = "left";
		div.style.styleFloat = "left";
		div.style.display = "inline";
		return (false);
	}
	
}