//****************
function checkfield(entry,message) {  // check if a field is blank and send a message if supplied 
//****************

var entryValue=entry
var entryValid=true

if (entryValue=="") {
   if (message!="") {
   alert(message);
   }
 entryValid=false 
 }
return entryValid
}

//****************
function checkselling(form) {  // validate the whole form when it is submitted and return false if errors are found 
//****************

var formValid=true

if (!checkfield(form.contactname.value,"Please enter your name.")) {
  formValid=false;
}
else
{
  if (!checkfield(form.emailaddress.value,"Please enter an E-mail address.")) {
    formValid=false;
  }  
  else
  {
    if (!checkfield(form.propertylocation.value,"Please enter a location.")) {
      formValid=false;
    }  
  }
}

return formValid
}

//****************
function checkbuying(form) {  // validate the whole form when it is submitted and return false if errors are found 
//****************

var formValid=true

if ((form.propertycounty.value=="Blank")) {
//if ((form.propertylocation.value=="") && (form.propertycounty.value=="Blank")) {
  alert("Please select a region.");
  formValid=false;
}
return formValid
}

//****************
function checkcontact(form) {  // validate the whole form when it is submitted and return false if errors are found 
//****************

var formValid=true

if (!checkfield(form.contactname.value,"Please enter your name.")) {
    formValid=false;
}
else
{
  if (!checkfield(form.emailaddress.value,"Please enter an E-mail address.")) {
    formValid=false;
  }    
} 
return formValid
}