function validate_required(field,alerttxt)
{
   with (field)
  {
    if (document.contactform.Email.value != "")
    { email = document.contactform.Email.value;
      AtPos = email.indexOf("@");
      StopPos = email.lastIndexOf(".");
      if (AtPos == -1 || StopPos == -1 || StopPos < AtPos || StopPos - AtPos == 1) 
      {  alert("Invalid Email Address"); 
         document.contactform.Email.focus();
         return false; 
      }
    }


     if(value.replace(/\s/g,"") == "" || value=="--- Select ---" || value==null )
       { alert(alerttxt);return false;
       }
  else return true;
  }
}


function validate_form(thisform)
{
   with (thisform)
   {
    if (validate_required(Name,"Name must be filled out!")==false) {Name.focus();return false;}
    if (validate_required(Phone,"Phone must be filled out!")==false) {Phone.focus();return false;}
    if (validate_required(Email,"Email Address must be filled out!")==false) {Email.focus();return false;}
    }
}
 