<!--


function sendEmail()
{  //var sendToEmail = decodeEmail(encodedEmail);
     if(document.form1.clientName.value==''){alert('Please add your name');return false;}
	//check for an address value
	if(document.form1.Telephone.value==''){alert('Please add your Telephone Number');return false;}
	if(document.form1.email.value==''){alert('Please add your email');return false;} 
	var re = /^\w+([\.]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
 	if(!(re.test(document.form1.email.value))){alert('Please enter a valid email');return false;}
    //check for notes
	if(document.form1.query.value==''){alert('Please enter a Message');return false;}
  
    document.form1.submit();
  //alert( decodeEmail(encodedEmail));
}
function sendReportEmail(encodedEmail)
{  var sendToEmail = decodeEmail(encodedEmail);
    
     if(document.form2.clientName.value==''){document.form2.clientName.focus();document.form2.clientNameError.value='*please add your name';return false;}else{document.form2.clientNameError.value='';} 
	//check for an address value
	if(document.form2.address.value==''){document.form2.address.focus();document.form2.addressError.value='*please add your address';return false;}else{document.form2.addressError.value='';} 
	//check for an email value
	if(document.form2.email.value==''){document.form2.email.focus();document.form2.emailError.value='*please add your email';return false;}else{document.form2.emailError.value='';} 
	var re = /^\w+([\.]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
 	if(!(re.test(document.form2.email.value))){document.form2.emailError.value='*enter a valid email';return false;}else{document.form2.emailError.value='';} 
    //check for notes
	if(document.form2.telephone.value==''){document.form2.telephone.focus();document.form2.telephoneError.value='*enter phone number';return false;}else{document.form2.telephoneError.value='';} 
	if(document.form2.fault.value==''){document.form2.fault.focus();document.form2.faultError.value='*enter description';return false;}else{document.form2.faultError.value='';} 
	
	
	
  document.form2.sendToEmail.value= sendToEmail;
   //alert(document.form2.sendToEmail.value);
  document.form2.submit();
  
  
  //alert( decodeEmail(encodedEmail));
}
function decodeEmail(encodedEmail)
{
  // holds the decoded email address
  var email = "";

  // go through and decode the email address
  for (i=0; i < encodedEmail.length;)
  {
    // holds each letter (2 digits)
    var letter = "";
    letter = encodedEmail.charAt(i) + encodedEmail.charAt(i+1)

    // build the real email address from ascii code
    email += String.fromCharCode(parseInt(letter,16));
    i += 2;
  }
  
  return email;
}


function doSubmit(f)

{    var sendToEmail = decodeEmail("6B616D407369776F72782E636F6D");
	if (f.location_name.value=="") {f.location_name.focus();alert("Please make sure you have added a number/name of property"); return false;}
	if (f.location_adr1.value=="") {f.location_adr1.focus();alert("Please make sure you have added a address line 1"); return false;}
	//if (f.location_adr2.value=="") {alert("Please make sure you have added a location address line 2"); return false;}
	if (f.location_town.value=="") {f.location_town.focus();alert("Please make sure you have added a   town/city"); return false;}
	if (f.location_region.value=="0") {f.location_region.focus();alert("Please make sure you have chosen a area"); return false;}
	if (f.location_postcode.value=="") {f.location_postcode.focus();alert("Please make sure you have added a postcode"); return false;}
	if (f.owner_name.value=="") {f.owner_name.focus();alert("Please make sure you have added the owners name"); return false;}
	if (f.owner_telephone.value=="" ) {f.owner_telephone.focus();alert("Please make sure you have added either a contact or owner telephone number."); return false;}
	var bIsChecked=false;
	for (i=0;i<f.elements.length;i++) {
		if (f.elements[i].type=="checkbox" && f.elements[i].name.indexOf("type_")!=-1) {
			if (f.elements[i].checked) {bIsChecked=true;}
		}
	}
	//if (bIsChecked==false) {alert("Please make sure you have checked at least one of the types that you property has"); return false;}
	if (f.use_sell.checked==false && f.use_rent.checked==false ) {alert("Please make sure you have checked at least one of the uses for your property"); return false;}
   //if (!Number(f.owner_telephone.value)) {alert("Please make sure the Telephone number s is a number"); return false;}
	//if (!Number(f.size.value)) {alert("Please make sure the size is a number"); return false;}
	if(f.email.value==''){f.email.focus(); alert("Please makesure you have added a contact email address");return false;} 
	var re = /^\w+([\.]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
	
	if (!(re.test(f.email.value))) {alert("Please make sure you have added a valid contact email address"); return false;}
	
	document.registerForm.sendToEmail.value= sendToEmail;
	//alert(sendToEmail);
}


function checkForm()
{  
     if(document.form1.clientName.value==''){document.form1.clientName.focus();document.form1.clientNameError.value='*please add your name';return false;}else{document.form1.clientNameError.value='';} 
	
	
	//check for an email value
	if(document.form1.email.value==''){document.form1.email.focus();document.form1.emailError.value='*please add your email';return false;}else{document.form1.emailError.value='';} 
	var re = /^\w+([\.]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
 	if(!(re.test(document.form1.email.value))){document.form1.emailError.value='*enter a valid email';return false;}else{document.form1.emailError.value='';} 
    //check for notes

  window.document.form1.submit();
  
  
  //alert( decodeEmail(encodedEmail));
}


//-->
 
<!--


function validateForm(obj){
	if(document.form1.clientName.value==''){document.form1.clientName.focus();document.form1.clientName.select();document.form1.clientNameError.value='add your name';return false}else{document.form1.clientNameError.value=''}
	if(document.form1.telephone.value==''){document.form1.telephone.focus();document.form1.telephone.select();document.form1.telephoneError.value='add your phone number';return false}else{document.form1.telephoneError.value=''}	
}
function openMap(obj){ 
  window.open(obj,'Map','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=780,height=400');
}

function fn_goToPage(pageNo){
	document.searchForm.Page.value = pageNo;
	document.searchForm.submit();
}

  function fn_changeSmallButton(imageID){
  
    var imageCat = ["bathroom","bedroom","diningRoom","exterior","garden","lounge","kitchen","parking"]
	
	
	for (i = 0 ;i<= 7;i++){
           for (j =1 ;j<=10 ;j++){
			  if (document.getElementById(imageCat[i]+j)){
		     	document.getElementById(imageCat[i]+j).src='../images/generic/smallButtonGray.gif'; 
                     }    
				//alert(imageCat[i]+j);
				}
			
		}
	
    
	document.getElementById(imageID).src='../images/generic/smallButtonGreen.gif';
	
 
  }  
function bedsSearch(imageID,no){
	
  var imageCat = ["bed","beds","bedlet","bedslet"]
	
	
	for (i = 0 ;i<= 3;i++){
           for (j =1 ;j<=4 ;j++){
			  if (document.getElementById(j+imageCat[i])){
		     	document.getElementById(j+imageCat[i]).src='../images/Frog88_bed_green.jpg'; 
                     }    
				//alert(imageCat[i]+j);
				}
			
		}
	
    
	document.getElementById(imageID).src='../images/Frog88_bed_pink.jpg';
	document.saleSearchForm.beds.value=no;
		document.letSearchForm.beds.value="";

	//document.saleSearchForm.submit();
	
	}
function lbedsSearch(imageID,no){
	
var imageCat = ["bed","beds","bedlet","bedslet"]
	
	
	for (i = 0 ;i<= 3;i++){
           for (j =1 ;j<=4 ;j++){
			  if (document.getElementById(j+imageCat[i])){
		     	document.getElementById(j+imageCat[i]).src='../images/Frog88_bed_green.jpg'; 
                     }    
				//alert(imageCat[i]+j);
				}
			
		}
	
    
	document.getElementById(imageID).src='../images/Frog88_bed_pink.jpg';
	document.letSearchForm.beds.value=no;
		document.saleSearchForm.beds.value="";

	//document.saleSearchForm.submit();
	
	}

//-->



