<!--
/**************************************************************************************************\
* The following scripts have been written by Benjamin Dolar of NIGHTLIGHT Consulting.              *
*                      Copyright 2004, all rights reserved.                                        *
*                                                                                                  *
* Reproduction of this script may not be used in any way, private or public, without               *
* the written consent of the above author under penalty of law                                     *
*                                                                                                  *
\**************************************************************************************************/

function Verify(valid) {
var msg="The required fields are missing information:";
var errors=0;
  if (document.ContactForm.name.value=="") {
    msg=msg+"\n- Name field is empty";
    errors++;
    }
  if (document.ContactForm.email.value=="") {
    msg=msg+"\n- Email field is empty";
    errors++;
    }
  if (document.ContactForm.company.value=="") {
    msg=msg+"\n- Company field is empty";
    errors++;
    }
  if (document.ContactForm.cat.value=="No Value Selected") {
    msg=msg+"\n- Product Category/Area of Interest field is empty";
    errors++;
    }
  if (document.ContactForm.inquiry.value=="No Value Selected") {
    msg=msg+"\n- Nature of Inquiry field is empty";
    errors++;
    }
  if (errors != 0) {
    alert(msg);
    return false;
    }

  if (document.ContactForm.email.value!="") {
    if (!ValidEmail(document.ContactForm.email.value)) {
      alert("The email address you have provided is invalid.  Please correct it and resubmit.");
      return false;
      }
    }
}
function ValidEmail(EmailAddress) {
var symbol ="@";
var ecount;
var esymcount=0;
for (ecount=0;ecount<=EmailAddress.length-1;ecount++) {
  if (symbol.indexOf(EmailAddress.charAt(ecount))!=-1) {
    esymcount++;
    }
  }
  if (esymcount !=1) {
    return false;
    }
  return true;
}
//-->