// JavaScript Document

//-->

// check to see if it is in e-mail format

	function isemailAddr(email)
	{
	  var result = false
	  var theStr = new String(email)
	  var index = theStr.indexOf("@");
	  if (index > 0)
	  {
		var pindex = theStr.indexOf(".",index);
		if ((pindex > index+1) && (theStr.length > pindex+1))
		result = true;
	  }
	  return result;
	}

	function submitIt(){
	
	// fill in first and last name, telephone and e-mail
	
	if(document.subform.MortgageDate.value == ""){
     alert("Please enter the date you need to renew your mortgage.");
     document.subform.MortgageDate.focus();
     return false;
    }
	
	
	if (document.subform.Email.value == "")
  {
    alert("Please enter your E-mail.");
    document.subform.Email.focus();
    return (false);
  }

  if (!isemailAddr(document.subform.Email.value))
  {
    alert("Please enter a complete E-mail address in the form: yourname@yourdomain.com");
    document.subform.Email.focus();
    return (false);
  }
   
  if (document.subform.Email.value.length < 3)
  {
    alert("Please enter at least 3 characters in the E-mail field.");
    document.subform.Email.focus();
    return (false);
  }
  
	return true;
}
// end form validation
