// JavaScript Document

function intpropload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.txt1.style.backgroundColor=dC;
	document.formdata.buyoverseas.style.backgroundColor=eComp;
	document.formdata.reason.style.backgroundColor=eComp;
	document.formdata.selname.style.backgroundColor=eComp;		
	document.formdata.txtsname.style.backgroundColor=eComp;						
	document.formdata.txtfname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;										
	document.formdata.txttel.style.backgroundColor=eComp;										
	document.formdata.txtaddress.style.backgroundColor=eComp;	
	document.formdata.txtpcode.style.backgroundColor=eComp;																							
	document.formdata.propsell.style.backgroundColor=eComp;
	document.formdata.proprent.style.backgroundColor=eComp;		
	document.formdata.comments.style.backgroundColor=eC;	
	document.formdata.chkmortgage.style.backgroundColor=eComp;										
	document.formdata.chklegal.style.backgroundColor=eComp;										
	document.formdata.chkcurrency.style.backgroundColor=eComp;	
	document.formdata.txtalttel.style.backgroundColor=eC;																							
	document.formdata.chknews.style.backgroundColor=eComp;
	document.formdata.chkproducts.style.backgroundColor=eComp;	
	document.formdata.chkvalued.style.backgroundColor=eComp;				
}
function intpropmm_clicked(selectbox) { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFF99';
	mysel=selectbox.selectedIndex;
	selecteditem=selectbox.options[mysel].text;
	if(selecteditem=='Other') {
		document.formdata.txt1.disabled = "";
		document.formdata.txt1.style.backgroundColor=eC;	
	}else {					
		document.formdata.txt1.disabled = "disabled";
		document.formdata.txt1.style.backgroundColor=dC;								
	}
}
function tt_clickedfname(txtbox) { //v4.0
	if(txtbox.value=='First Name') {
		document.formdata.txtfname.value = "";
	}
}	
function tt_clickedsname(txtbox) { //v4.0
	if(txtbox.value=='Last Name') {
		document.formdata.txtsname.value = "";
	}
}
function tt_clickedfname2(txtbox) { //v4.0
	if(txtbox.value=='First Name') {
		document.formdata.txtfname2.value = "";
	}
}	
function tt_clickedsname2(txtbox) { //v4.0
	if(txtbox.value=='Last Name') {
		document.formdata.txtsname2.value = "";
	}
}
function intpropval(){
	var errors;
	var vbuy=document.getElementById("buyoverseas").options[document.getElementById("buyoverseas").selectedIndex].text;
	var vreason=document.getElementById("reason").options[document.getElementById("reason").selectedIndex].text;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	var vpropsell=document.getElementById("propsell").options[document.getElementById("propsell").selectedIndex].text;
	var vproprent=document.getElementById("proprent").options[document.getElementById("proprent").selectedIndex].text;	
	errors='';

	if (vbuy=='' || vbuy=='Please select')	 {
	 errors += '- '+'When you plan to buy overseas is required.\n';}
	if (vreason=='' || vreason=='Please select')	 {
	 errors += '- '+'Your main reason for buying overseas is required.\n';}
	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	if (vpropsell=='' || vpropsell=='Please select')	 {
	 errors += '- '+'If you have a property to sell is required.\n';}
	if (vproprent=='' || vproprent=='Please select')	 {
	 errors += '- '+'If you have a property to let is required.\n';}
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function rvalpropload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.txtother.style.backgroundColor=dC;
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
	document.formdata.proptype.style.backgroundColor=eComp;				
	document.formdata.nobed.style.backgroundColor=eComp;					
	document.formdata.norec.style.backgroundColor=eComp;						
	document.formdata.nobath.style.backgroundColor=eComp;							
	document.formdata.selpropdate.style.backgroundColor=eComp;
	document.formdata.selagent.style.backgroundColor=eComp;
}

function rvalmm_clicked(selectbox) { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFF99';
	mysel=selectbox.selectedIndex;
	selecteditem=selectbox.options[mysel].text;
	if(selecteditem=='Other') {
		document.formdata.txtother.disabled = "";
		document.formdata.txtother.style.backgroundColor=eC;
	}else {					
		document.formdata.txtother.disabled = "disabled";
		document.formdata.txtother.style.backgroundColor=dC;
	}
	
	if (selecteditem=='Flat / Apartment' || selecteditem=='Maisonette'){	
		document.formdata.selfloor.disabled = "";
		document.formdata.selfloor.style.backgroundColor=eC;	
	}else {
		document.formdata.selfloor.disabled = "disabled";
		document.formdata.selfloor.style.backgroundColor=dC;	
	}
}

function ragentmm_clicked(selectbox) { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFF99';
	mysel=selectbox.selectedIndex;
	selecteditem=selectbox.options[mysel].text;
	if(selecteditem=='No') {
		document.formdata.selpropdate.disabled = "";
		document.formdata.selpropdate.style.backgroundColor=eC;
	}else {					
		document.formdata.selpropdate.disabled = "disabled";
		document.formdata.selpropdate.style.backgroundColor=dC;
	}
}

function rvallease_clicked(chkbox) { //v4.0
	if(chkbox.name=='chkfreehold'){
		document.formdata.chkleasehold.value="";
		document.formdata.chkleasehold.checked=false;}	
	if(chkbox.name=='chkleasehold'){
		document.formdata.chkfreehold.value="";
		document.formdata.chkfreehold.checked=false;}		
}

function rvalpropval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	var vpropdate=document.getElementById("selpropdate").options[document.getElementById("selpropdate").selectedIndex].text;
	var vselagent=document.getElementById("selagent").options[document.getElementById("selagent").selectedIndex].text;
	var vproptype=document.getElementById("proptype").options[document.getElementById("proptype").selectedIndex].text;			
	var vnobed=document.getElementById("nobed").options[document.getElementById("nobed").selectedIndex].text;			
	var vnorec=document.getElementById("norec").options[document.getElementById("norec").selectedIndex].text;			
	var vnobath=document.getElementById("nobath").options[document.getElementById("nobath").selectedIndex].text;				
	errors='';

	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	if (vselagent=='' || vselagent=='Please Select') {
	 errors += '- '+'If your property is on the market with another agent is required.\n';}
	if (vselagent=='No'){ 
		if(vpropdate=='' || vpropdate=='Please Select') {
			 errors += '- '+'When you are looking to put the property on the market is required.\n';}
	}
	if (vproptype=='' || vproptype=='Please Select') {
	 errors += '- '+'Your property type is required.\n';}
	if (vnobed=='' || vnobed=='Please Select') {
	 errors += '- '+'Your minimum number of bedrooms is required.\n';}
	if (vnorec=='' || vnorec=='Please Select') {
	 errors += '- '+'Your minimum number of reception rooms is required.\n';}
	if (vnobath=='' || vnobath=='Please Select') {
	 errors += '- '+'Your minimum number of bathrooms is required.\n';}	 
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function conveyenqload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
	document.formdata.propsell.style.backgroundColor=eComp;
	document.formdata.proppurch.style.backgroundColor=eComp;	
}

function conveyenqval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	var vpropsell=document.getElementById("propsell").options[document.getElementById("propsell").selectedIndex].text;			
	var vproppurch=document.getElementById("proppurch").options[document.getElementById("proppurch").selectedIndex].text;				
	errors='';

	if (vpropsell=='' || vpropsell=='Please select') {
	 errors += '- '+'Your property selling information is required.\n';}
	if (vproppurch=='' || vproppurch=='Please select') {
	 errors += '- '+'Your property purchasing information is required.\n';}
	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function mortenqload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
	document.formdata.propsell.style.backgroundColor=eComp;
	document.formdata.proppurch.style.backgroundColor=eComp;	
	document.formdata.chkmortgage.style.backgroundColor=eComp;		
}

function mortenqval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	var vpropsell=document.getElementById("propsell").options[document.getElementById("propsell").selectedIndex].text;			
	var vproppurch=document.getElementById("proppurch").options[document.getElementById("proppurch").selectedIndex].text;				
	errors='';

	if (vpropsell=='' || vpropsell=='Please select') {
	 errors += '- '+'Your property selling information is required.\n';}
	if (vproppurch=='' || vproppurch=='Please select') {
	 errors += '- '+'Your property purchasing information is required.\n';}
	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function surveypurchase(selectbox) { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFF99';
	mysel=selectbox.selectedIndex;
	selecteditem=selectbox.options[mysel].text;
	if(selecteditem=='Yes') {
		document.formdata.txtaddress2.disabled = "";
		document.formdata.txtaddress2.style.backgroundColor=eC;	
		document.formdata.txtpcode2.disabled = "";
		document.formdata.txtpcode2.style.backgroundColor=eC;			
		document.formdata.txtnoreasons.disabled = "disabled";
		document.formdata.txtnoreasons.style.backgroundColor=dC;		
	}else {					
		document.formdata.txtaddress2.disabled = "disabled";
		document.formdata.txtaddress2.style.backgroundColor=dC;	
		document.formdata.txtpcode2.disabled = "disabled";
		document.formdata.txtpcode2.style.backgroundColor=dC;			
		document.formdata.txtnoreasons.disabled = "";
		document.formdata.txtnoreasons.style.backgroundColor=eC;							
	}
}
function surveyenqload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
	document.formdata.proppurch.style.backgroundColor=eComp;
	document.formdata.txtaddress2.disabled = "disabled";
	document.formdata.txtaddress2.style.backgroundColor=dC;	
	document.formdata.txtpcode2.disabled = "disabled";
	document.formdata.txtpcode2.style.backgroundColor=dC;			
	document.formdata.txtnoreasons.disabled = "disabled";
	document.formdata.txtnoreasons.style.backgroundColor=dC;			
}

function surveyenqval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	var vproppurch=document.getElementById("proppurch").options[document.getElementById("proppurch").selectedIndex].text;				
	var vadd2=document.getElementById("txtaddress2").value;	
	var vpcode2=document.getElementById("txtpcode2").value;		
	var vnoreason=document.getElementById("txtnoreasons").value;	
	errors='';

	if (vproppurch=='' || vproppurch=='Please select') {
	 errors += '- '+'Your property purchasing information is required.\n';}
	if (vproppurch=='Yes') {
		 if(vadd2=='' || vpcode2=='') {
		 errors += '- '+'Your Surveying property address and postcode are required.\n';}
		 }
	if (vproppurch=='No') {
		 if (vnoreason=='') {
		 errors += '- '+'Your reason for requiring a survey is required.\n';}
		 }		 
	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function lettingsload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
	document.formdata.proptype.style.backgroundColor=eComp;				
	document.formdata.txtrent.style.backgroundColor=eComp;					
	document.formdata.nobed.style.backgroundColor=eComp;						
	document.formdata.parking.style.backgroundColor=eComp;							
	document.formdata.garage.style.backgroundColor=eComp;							
	document.formdata.furn.style.backgroundColor=eComp;							
	document.formdata.areas.style.backgroundColor=eComp;							
	document.formdata.children.style.backgroundColor=eComp;								
	document.formdata.smoker.style.backgroundColor=eComp;								
	document.formdata.pets.style.backgroundColor=eComp;								
	document.formdata.movein.style.backgroundColor=eComp;								
}

function lettingsval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;
	var vproptype=document.getElementById("proptype").options[document.getElementById("proptype").selectedIndex].text;
	var vrent=document.getElementById("txtrent").value;
	var vnobed=document.getElementById("nobed").options[document.getElementById("nobed").selectedIndex].text;
	var vparking=document.getElementById("parking").options[document.getElementById("parking").selectedIndex].text;
	var vgarage=document.getElementById("garage").options[document.getElementById("garage").selectedIndex].text;
	var vfurn=document.getElementById("furn").options[document.getElementById("furn").selectedIndex].text;
	var vareas=document.getElementById("areas").value;
	var vchildren=document.getElementById("children").options[document.getElementById("children").selectedIndex].text;
	var vsmoker=document.getElementById("smoker").options[document.getElementById("smoker").selectedIndex].text;
	var vpets=document.getElementById("pets").options[document.getElementById("pets").selectedIndex].text;
	var vmove=document.getElementById("movein").options[document.getElementById("movein").selectedIndex].text;		
	errors='';

	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	if (vproptype=='' || vproptype=='Please Select') {
	 errors += '- '+'Property type is required.\n';}
	if (vrent=='')	 {
	 errors += '- '+'Your maximum rent amount is required.\n';}	 	 
	if (vnobed=='' || vnobed=='Please Select') {
	 errors += '- '+'Minimum No. bedrooms required.\n';}	 
	if (vparking=='' || vparking=='Please Select') {
	 errors += '- '+'Your Parking needs are required.\n';}	 	 
	if (vgarage=='' || vgarage=='Please Select') {
	 errors += '- '+'Your Garage needs are required.\n';}	 	 	 
	if (vfurn=='' || vfurn=='Please Select') {
	 errors += '- '+'Your furnishing needs are required.\n';}	 	 	 	 
	if (vareas=='')	 {
	 errors += '- '+'Your preferred areas are required.\n';}	
	if (vchildren=='' || vchildren=='Please Select') {
	 errors += '- '+'We require information regarding any children you may have.\n';}	 	 
	if (vsmoker=='' || vsmoker=='Please Select') {
	 errors += '- '+'Please input smoking information.\n';}	 	 	 
	if (vpets=='' || vpets=='Please Select') {
	 errors += '- '+'We require information regarding any pets.\n';}	 		 
	if (vmove=='' || vmove=='Please Select') {
	 errors += '- '+'We require information regarding when you are looking to move.\n';}	

	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function nhenqload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
	document.formdata.propsell.style.backgroundColor=eComp;
	document.formdata.proplet.style.backgroundColor=eComp;	
}

function nhenqval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	var vpropsell=document.getElementById("propsell").options[document.getElementById("propsell").selectedIndex].text;			
	var vproppurch=document.getElementById("proplet").options[document.getElementById("proplet").selectedIndex].text;				
	errors='';

	if (vpropsell=='' || vpropsell=='Please select') {
	 errors += '- '+'Your property selling information is required.\n';}
	if (vproppurch=='' || vproppurch=='Please select') {
	 errors += '- '+'Your property to let information is required.\n';}
	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function pcregload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
	document.formdata.nobed.style.backgroundColor=eComp;					
	document.formdata.norec.style.backgroundColor=eComp;						
	document.formdata.nobath.style.backgroundColor=eComp;		
	document.formdata.txtareas.style.backgroundColor=eComp;			
	document.formdata.propsell.style.backgroundColor=eComp;			
	document.formdata.proplet.style.backgroundColor=eComp;				
}

function pcregval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	var vnobed=document.getElementById("nobed").options[document.getElementById("nobed").selectedIndex].text;			
	var vnorec=document.getElementById("norec").options[document.getElementById("norec").selectedIndex].text;			
	var vnobath=document.getElementById("nobath").options[document.getElementById("nobath").selectedIndex].text;				
	var vpareas=document.getElementById("txtareas").value;	
	var vpropsell=document.getElementById("propsell").options[document.getElementById("propsell").selectedIndex].text;			
	var vproplet=document.getElementById("proplet").options[document.getElementById("proplet").selectedIndex].text;		
	var vproph=document.getElementById("chkphouse").checked;	
	var vpropb=document.getElementById("chkpbung").checked;	
	var vpropa=document.getElementById("chkpflat").checked;	
	var vpropr=document.getElementById("chkpretire").checked;	
	var vpropm=document.getElementById("chkpmobile").checked;		
	var vpropany=document.getElementById("chkany").checked;			
	errors='';

	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}
	if (vpropany==false)	 {
		if (vproph==false && vpropb==false && vpropa==false && vpropr==false && vpropm==false)	 {	 
			errors += '- '+'Your property type is required.\n';}	
	}
	if (vnobed=='' || vnobed=='Please Select') {
	 errors += '- '+'Your minimum number of bedrooms is required.\n';}
	if (vnorec=='' || vnorec=='Please Select') {
	 errors += '- '+'Your minimum number of reception rooms is required.\n';}
	if (vnobath=='' || vnobath=='Please Select') {
	 errors += '- '+'Your minimum number of bathrooms is required.\n';}	 
	if (vpareas=='')	 {
	 errors += '- '+'Your areas are required.\n';}	 
	if (vpropsell=='' || vpropsell=='Please select') {
	 errors += '- '+'If you have a property to sell is required.\n';}	
	if (vproplet=='' || vproplet=='Please select') {
	 errors += '- '+'If you have a property to let is required.\n';}	
	 
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}

function genenqload() { //v4.0
	var dC='#CCCCCC';
	var eComp='FFFF99';	
	var eC='FFFFFF';
	document.formdata.selname.style.backgroundColor=eComp;
	document.formdata.txtfname.style.backgroundColor=eComp;
	document.formdata.txtsname.style.backgroundColor=eComp;	
	document.formdata.txtemail.style.backgroundColor=eComp;		
	document.formdata.txttel.style.backgroundColor=eComp;			
	document.formdata.txtaddress.style.backgroundColor=eComp;			
	document.formdata.txtpcode.style.backgroundColor=eComp;						
}

function genenqval(){
	var errors;
	var vfname=document.getElementById("txtfname").value;	
	var vsname=document.getElementById("txtsname").value;	
	var vemail=document.getElementById("txtemail").value.indexOf("@");	
	var vtel=document.getElementById("txttel").value;		
	var vadd=document.getElementById("txtaddress").value;	
	var vpcode=document.getElementById("txtpcode").value;		
	errors='';

	if (vfname=='' || vfname=='First Name')	 {
	 errors += '- '+'Your forename is required.\n';}
	if (vsname=='' || vsname=='Last Name')	 {
	 errors += '- '+'Your last name is required.\n';}
	if (vemail==-1)  {
	 errors += '- '+'A valid email address is required.\n';}		 
	if (vtel=='')	 {
	 errors += '- '+'Your telephone number is required.\n';}
	if (vadd=='')	 {
	 errors += '- '+'Your address is required.\n';}
	if (vpcode=='')	 {
	 errors += '- '+'Your postcode is required.\n';}	 
	 
	// Display information to the User or Continue.
	if (errors) alert('The following error(s) occurred:\n'+errors);
 		document.MM_returnValue = (errors == '');
}
