function checkcontact() {
 
  csendto = document.contactusform.sendto.options[document.contactusform.sendto.selectedIndex].value;
  ccontact = document.contactusform.contact.value;
  ccompany = document.contactusform.company.value;
  ccity = document.contactusform.city.value;
  cphone = document.contactusform.phone.value;
  cmessage = document.contactusform.message.value;
  cemail = document.contactusform.email.value;
  filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  
 returnval = true;
 hideAllErrors();
if (csendto == "select") {
 returnval = false;
 document.getElementById("sendtoError").style.display = "inline";
}
if (ccontact == "") {
 returnval = false;
 document.getElementById("contactError").style.display = "inline";
}
if (ccompany == "") {
 returnval = false;
 document.getElementById("companyError").style.display = "inline";
}
if (ccity == "") {
 returnval = false;
 document.getElementById("cityError").style.display = "inline";
}
if (cphone == "") {
 returnval = false;
 document.getElementById("phoneError").style.display = "inline";
}
if (cmessage == "") {
 returnval = false;
 document.getElementById("messageError").style.display = "inline";
}
if (cemail == "") {
 returnval = false;
 document.getElementById("emailError").style.display = "inline";
}
if (cemail != "" && !(filter.test(cemail))) { 
 returnval = false;
 document.getElementById("emailError").style.display = "none";
 document.getElementById("email2Error").style.display = "inline";
}

 return returnval;
}
 
function hideAllErrors() {
document.getElementById("sendtoError").style.display = "none"
document.getElementById("contactError").style.display = "none"
document.getElementById("companyError").style.display = "none"
document.getElementById("cityError").style.display = "none"
document.getElementById("phoneError").style.display = "none"
document.getElementById("emailError").style.display = "none"
document.getElementById("email2Error").style.display = "none"
document.getElementById("messageError").style.display = "none"
}
