// main function
function BookAValuationProcess(yourName, yourBookingEmail, yourPhone, yourAddress, formType, propertyAddress, contact, contacttime) {
	var xmlHttp; 
	try {
// Firefox, Opera 8.0+, Safari
	xmlHttp=new XMLHttpRequest();
	} 
	catch (e) {
// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {
				//alert("Your browser does not support AJAX!");
				return false;
			}
		}
	} 
	xmlHttp.onreadystatechange=function() { 
		if(xmlHttp.readyState==4) { 
			var result = xmlHttp.responseText.split("||");
			if (result[0] == "ok"){
// all is ok; display thank you message.
        document.getElementById("BookAValuationDiv").style.display = "none";
	document.getElementById("BookAValuationConfirmDiv").style.display = "block";
	window.location = "http://www.romans.co.uk/renting_val_thanks.asp";
			}
			else {
// some error - display required message to alert user
        alert(result[0]);
				alert("There was an unknown problem and it is not possible to process your valuation request.");
			}	 
		} 
	} 

	xmlHttp.open("GET","/ajax/formProcess.asp?yourName="+yourName+"&yourBookingEmail="+yourBookingEmail+"&yourPhone="+yourPhone+"&yourAddress="+escape(yourAddress)+"&formType="+formType+"&propertyAddress="+escape(propertyAddress)+"&contact="+contact+"&contacttime="+contacttime,true); 
	xmlHttp.send(null);
}


