function submitform() {
   document.eleadform.submit();
}



function Validate() {

  noHomePhone=0
  noCellPhone=0

  if (document.eleadform.communityname.value == "") {
  alert("Please select the community that interests you.");
  document.eleadform.communityname.focus();
  return (false);
  }

  if (document.eleadform.source.value == "") {
  alert("Please tell us how you heard about us.");
  document.eleadform.source.focus();
  return (false);
  }

  if (document.eleadform.homephone.value == "") {
    noHomePhone=1
  }
  if (document.eleadform.cellphone.value == "") {
    noCellPhone=1
  }
  showConfirm = noCellPhone + noHomePhone 

  if (showConfirm==2) {
    answer=confirm("You did not enter any phone numbers.\nEven though phone numbers are optional,\nit is important that we are able to contact you.\nClick 'Cancel' to enter a phone number\nor 'OK' to ignore this request.")
    if (answer !=0) { 
      submitform();
    } else {
      document.eleadform.homephone.focus();
    }
  } else {
      submitform();
  }
}

function allowKeys(obj, keys) {
  var bAllowKey = false;
  for (var i = 0; i < keys.length; i++) {
     if (keys.charAt(i)==String.fromCharCode(window.event.keyCode)) {
     bAllowKey = true;
     break;
     }
  }
    if (!bAllowKey) {
       window.event.cancelBubble = true;
       window.event.keyCode = 0;
    }
}
