<!--

function passToForm(form,sendTo,showTo) {
   thisForm = document.getElementById(form);
   thisForm.EmailTo.value = sendTo;

   if(showTo) {thisForm.ShowTo.value = showTo;}
   else {thisForm.ShowTo.value = sendTo;}

   thisForm.action = "contact_us.asp";
   thisForm.submit();
   return true;
}

var vals = ['http','www','<a','href'];
function isEmpty(str) {return (str.length>0?true:false);}
function isValidEmail(str) {return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);}
function containsVal(str) {for (i=0; i<vals.length; i++) {if (str.indexOf(vals[i]) >= 0) {return true;}}	return false;}
function textCounter(field,maxlimit) {if (field.value.length > maxlimit) {field.value = field.value.substring(0, maxlimit);}}

function resetLabels() {
   document.getElementById('e_from').style.color = '#2b4b86';
   document.getElementById('e_subject').style.color = '#2b4b86';
   document.getElementById('e_body').style.color = '#2b4b86';
}

function sendData(form) {
   var isError = false;
   var subjChk = containsVal(form.Subject.value.toLowerCase());
   var bodyChk = containsVal(form.Body.value.toLowerCase());
   resetLabels();
   
   if (!isValidEmail(form.From.value)) {
      document.getElementById('e_from').style.color = '#AC3224';
      isError = true;
   }

   if(!isEmpty(form.Subject.value) || subjChk) {
      document.getElementById('e_subject').style.color = '#AC3224';
      isError = true;
   }
   
   if(!isEmpty(form.Body.value) || bodyChk) {
      document.getElementById('e_body').style.color = '#AC3224';
      isError = true;
   }

   if (isError) {
      if (subjChk || bodyChk) {alert('Please note that HTML characters are not permitted (\'http\',\'www\',\'<a\',\'href\')');}
      else {alert('We require additional information in order to complete your request.\nPlease correct the highlighted fields and resubmit the form.');}
      return false;
   } else {
      form.action = "contact_us.asp";
      return true;
   }
}

//-->