<!--
function validateForm(frm) {
  var allValid = true;
  var errMsg = "Input ERROR:\n";
  var errCnt = 0;

  if (isEmpty(frm.firstName)) {
    errMsg += (++errCnt) + ". Please input First Name.\n";
    allValid = false;		
  }

  if (isEmpty(frm.lastName)) {
    errMsg += (++errCnt) + ". Please input Last Name.\n";
    allValid = false;		
  }

  if (isEmpty(frm.company)) {
    errMsg += (++errCnt) + ". Please input Company.\n";
    allValid = false;		
  }

  if (isEmpty(frm.title)) {
    errMsg += (++errCnt) + ". Please input Title.\n";
    allValid = false;		
  }

  if ((frm.department.selectedIndex == 0) && (frm.department2.value.indexOf("others, please specify") >= 0)) {
    errMsg += (++errCnt) + ". Please input Department.\n";
    allValid = false;		
  }

  if (isEmpty(frm.address1)) {
    errMsg += (++errCnt) + ". Please input Address 1.\n";
    allValid = false;		
  }

  if (isEmpty(frm.city)) {
    errMsg += (++errCnt) + ". Please input City.\n";
    allValid = false;		
  }

  if ((frm.country.selectedIndex == 0) && (frm.country2.value.indexOf("others, please specify") >= 0)) {
    errMsg += (++errCnt) + ". Please input Country.\n";
    allValid = false;		
  }

  if (frm.country[frm.country.selectedIndex].value == "United States" && frm.stateProvince.selectedIndex == 0) {
    errMsg += (++errCnt) + ". Please select State.\n";
    allValid = false;		
  }

  if (frm.country[frm.country.selectedIndex].value == "Canada" && (frm.stateProvince2.value.indexOf("please specify") > 0 || isEmpty(frm.stateProvince2) )) {
    errMsg += (++errCnt) + ". Please input State in specification field.\n";
    allValid = false;		
  }

  if (frm.stateProvince.selectedIndex > 0 && frm.country[frm.country.selectedIndex].value != "United States" ) {
    errMsg += (++errCnt) + ". Confusion between State and Country selected.\n";
    allValid = false;		
  }

  if ((!isEmpty(frm.stateProvince2) && frm.stateProvince2.value.indexOf("please specify") < 0 ) && frm.country[frm.country.selectedIndex].value != "Canada" ) {
    errMsg += (++errCnt) + ". Confusion between State and Country selected.\n";
    allValid = false;		
  }

  if (isEmpty(frm.phone)) {
    errMsg += (++errCnt) + ". Please input Phone.\n";
    allValid = false;		
  }

  if (!isEmpty(frm.phone) && !isInteger(frm.phone)) {
    errMsg += (++errCnt) + ". Phone number should be a number.\n";
    allValid = false;		
  }

  if (isEmpty(frm.email)) {
    errMsg += (++errCnt) + ". Please input Email.\n";
    allValid = false;		
  }

  if (!isEmpty(frm.email) && !isValidEmail(frm.email)) {
    errMsg += (++errCnt) + ". Email address is not valid.\n";
    allValid = false;		
  }

  if (allValid) {
    return(true);
  } else {
    errMsg += "\n\n Error Here";
    alert(errMsg);
    return(false);
  }        
}
//-->
