<!--
//validation of form field entries
function validateform() {   

   var valid = 1;

   if (document.form.Name.value == "") {
	  document.form.Name.focus();
	  document.getElementById("errorName").innerHTML = "Please enter your name!";
	  valid = 0;
   } else {
	  document.getElementById("errorName").innerHTML = "";			  
	}
	
  if (typeof document.form.Enquiry != "undefined") {
	  if (document.form.Enquiry[3].checked == true && document.form.otherEnquiry.value == "") {
		 document.form.otherEnquiry.focus();
		 document.getElementById("errorEnquiry").innerHTML = "Please specify your enquiry type!";
		 valid = 0;
	  } else {
		document.getElementById("errorEnquiry").innerHTML = "";
	  }
   }
   

  if (document.form.Contact_Type[0].checked == true && document.form.Telephone.value == "") {
	  document.getElementById("errorPhone").innerHTML = "Please enter your telephone number!";
	  document.form.Telephone.focus();	
	  valid = 0;
   } else {
	  document.getElementById("errorPhone").innerHTML = "";
   }


   if (document.form.Contact_Type[1].checked == true && document.form.Email.value == "") {
	  document.getElementById("errorEmail1").innerHTML = "Please enter your email address!";
	  document.form.Email.focus();
	  valid = 0;
   } else {
	  document.getElementById("errorEmail1").innerHTML = "";
   }

   if (document.form.Email.value != document.form.Email2.value) {
		  document.getElementById("errorEmail2").innerHTML = "The email addresses do not match!";
		  document.form.Email.focus();	
		  valid = 0;			 
   } else {
		  document.getElementById("errorEmail2").innerHTML = "";
   }
	
	
   if (valid == 1) { 
	return true;			
   } else {
	return false;
   }
		   
}

function checkControls() {
	
	//disable optional fields - we'll renable those that should be in the switch.
	document.form.otherEnquiry.disabled = true;
	document.form.buyPrice.disabled = true;
	document.form.sellPrice.disabled = true;
	document.form.remortPrice.disabled = true;
	document.form.buyLocation.disabled = true;
	document.form.sellLocation.disabled = true;
	document.form.mortgageLocation.disabled = true;
	
	document.form.Require_Mortgage.disabled = true;
	
	if (document.form.EnqBuying.checked == true) {
			document.form.buyPrice.disabled = false;
			document.form.buyLocation.disabled = false;
			document.form.Require_Mortgage.disabled = false;		
	}	
	
	if (document.form.EnqSelling.checked == true) {
			document.form.sellPrice.disabled = false;	
			document.form.sellLocation.disabled = false;
	}
	
  	if (document.form.EnqRemortgage.checked == true) {
			document.form.remortPrice.disabled = false;
			document.form.mortgageLocation.disabled = false;
	}
	
  	if (document.form.EnqOther.checked == true) {
			document.form.otherEnquiry.disabled = false;
	}
 
  //return true;
}
-->
