function checkdata(){
   var coform = document.contact_form;
   
   coform.required.src="shared_images/blank.gif";
   if(coform.subject.value=="Choose A Subject Below"){
     coform.required.src="shared_images/invalid.gif";
     coform.subject.focus();
     return;
   }
   
   coform.first_name.src="shared_images/blank.gif";
   if(coform.firstname.value.length <= 2 || coform.firstname.value == ""){
      coform.first_name.src="shared_images/invalid.gif";
      coform.firstname.focus();
      return;
   }

   coform.last_name.src="shared_images/blank.gif";
   if(coform.lastname.value.length <= 2 || coform.lastname.value == ""){
      coform.last_name.src="shared_images/invalid.gif";
      coform.lastname.focus();
      return;
   }

   //check that email address field is not empty
   coform.email_address.src="shared_images/blank.gif";
   if (coform.emailaddress.value == "")
   {
    coform.email_address.src="shared_images/invalid.gif";
    coform.emailaddress.focus();
    return;
   }

   //check that the email includes the correct attributes
   var emailFilter=/^.+@.+\..{2,3}$/;
   if (!(emailFilter.test(coform.emailaddress.value))) 
   { 
    coform.email_address.src="shared_images/invalid.gif";
    coform.emailaddress.focus();
    return;
   }

   //check for illegal characters in the email address
   var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
   if (coform.emailaddress.value.match(illegalChars)) 
   {
    coform.email_address.src="shared_images/invalid.gif";
    coform.emailaddress.focus();
    return;
   }

   coform.phone_number.src="shared_images/blank.gif";
   if(coform.phone.value.length=0){
      coform.phone_number.src="shared_images/invalid.gif";
      coform.phone.focus();
      return;
   }
   
   coform.referral_img.src="shared_images/blank.gif";
   if(coform.referral.value=="Select One"){
     coform.referral_img.src="shared_images/invalid.gif";
     coform.referral.focus();
     return;
   }
   

   coform.submit();
}
