/**
* Copyright Fluent2.com 2007
**/


var ValuationFORM = eval("document.Valuations");

function ProcessValuation(X){
	ValuationFORM.Title.style.backgroundColor="#FFF";
	ValuationFORM.Forename.style.backgroundColor="#FFF";
	ValuationFORM.Surname.style.backgroundColor="#FFF";
	ValuationFORM.eMail.style.backgroundColor="#FFF";
	ValuationFORM.Address.style.backgroundColor="#FFF";
	ValuationFORM.Postcode.style.backgroundColor="#FFF";
	ValuationFORM.MobilePhone.style.backgroundColor="#FFF";
	ValuationFORM.HomePhone.style.backgroundColor="#FFF";
	ValuationFORM.PropertyType.style.backgroundColor="#FFF";

	if(!ValuationFORM.Title.value.length){
		ValuationFORM.Title.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYou did not select your Title.");
		return false;
	}
	if(ValuationFORM.Forename.value.length < 2){
		ValuationFORM.Forename.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYour Forename is too short.");
		return false;
	}
	if(ValuationFORM.Surname.value.length < 2){
		ValuationFORM.Surname.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYour Surname is too short.");
		return false;
	}
	if(ValidateeMail(ValuationFORM.eMail.value) == false){
		ValuationFORM.eMail.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYour eMail address is incorrect.");
		return false;
	}

	if(ValuationFORM.Address.value.length < 10){
		ValuationFORM.Address.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYour Address is too short.");
		return false;
	}
	if(ValuationFORM.Postcode.value.length < 5){
		ValuationFORM.Postcode.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYour Last Name is too short.");
		return false;
	}
	if(ValuationFORM.MobilePhone.value.length < 10){
		ValuationFORM.MobilePhone.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYour Last Name is too short.");
		return false;
	}
	if(!ValuationFORM.PropertyType.value.length){
		ValuationFORM.PropertyType.style.backgroundColor="#FA9E9E";
		alert("ERROR\n\nYou did not select your Property Type.");
		return false;
	}
	ValuationFORM.target="iFrame";
	ValuationFORM.method="post";
	ValuationFORM.action="PROCESS_Valuation.php";
	ValuationFORM.Action.value=X;
	ValuationFORM.Button1.value="PLEASE WAIT";
	ValuationFORM.Button1.disabled=true;
	ValuationFORM.Button1.className="ButtonProcessing"
	setTimeout("document.Valuations.submit();", 1000);
}
