<!--

 function checkInvestor() {
        if (document.form.clientHearAboutEDCInvestorCB.checked != 1) {
		  document.form.clientHearAboutEDCInvestor.disabled = true;
		  document.form.clientHearAboutEDCInvestor.value = "Enter Investor Name";
		 } else {
		  document.form.clientHearAboutEDCInvestor.disabled = false;
		  document.form.clientHearAboutEDCInvestor.value = "";
		  document.form.clientHearAboutEDCInvestor.focus();
		  }
      }
 function checkInternet() {
        if (document.form.clientHearAboutEDCInternetCB.checked != 1) {
		  document.form.clientHearAboutEDCInternet.disabled = true;
		  document.form.clientHearAboutEDCInternet.value = "Enter Internet Site";
		 } else {
		  document.form.clientHearAboutEDCInternet.disabled = false;
		  document.form.clientHearAboutEDCInternet.value = "";
		  document.form.clientHearAboutEDCInternet.focus();
		  }
      }
 function checkTerritory() {
        if (document.form.clientHearAboutEDCTerritoryCB.checked != 1) {
		  document.form.clientHearAboutEDCTerritory.disabled = true;
		  document.form.clientHearAboutEDCTerritory.value = "Enter Territory Director's Name";
		 } else {
		  document.form.clientHearAboutEDCTerritory.disabled = false;
		  document.form.clientHearAboutEDCTerritory.value = "";
		  document.form.clientHearAboutEDCTerritory.focus();
		  }
      }
 function checkAgent() {
        if (document.form.clientHearAboutEDCAgentCB.checked != 1) {
		  document.form.clientHearAboutEDCAgent.disabled = true;
		  document.form.clientHearAboutEDCAgent.value = "Enter Agent's Name";
		 } else {
		  document.form.clientHearAboutEDCAgent.disabled = false;
		  document.form.clientHearAboutEDCAgent.value = "";
		  document.form.clientHearAboutEDCAgent.focus();
		  }
      }
 function checkOfficer() {
        if (document.form.clientHearAboutEDCOfficerCB.checked != 1) {
		  document.form.clientHearAboutEDCOfficer.disabled = true;
		  document.form.clientHearAboutEDCOfficer.value = "Enter Loan Officer's Name";
		 } else {
		  document.form.clientHearAboutEDCOfficer.disabled = false;
		  document.form.clientHearAboutEDCOfficer.value = "";
		  document.form.clientHearAboutEDCOfficer.focus();
		  }
      }
 function checkClub() {
        if (document.form.clientHearAboutEDCClubCB.checked != 1) {
		  document.form.clientHearAboutEDCClub.disabled = true;
		  document.form.clientHearAboutEDCClub.value = "Enter Investment Club's Name";
		 } else {
		  document.form.clientHearAboutEDCClub.disabled = false;
		  document.form.clientHearAboutEDCClub.value = "";
		  document.form.clientHearAboutEDCClub.focus();
		  }
      }
 function checkContractor() {
        if (document.form.clientHearAboutEDCContractorCB.checked != 1) {
		  document.form.clientHearAboutEDCContractor.disabled = true;
		  document.form.clientHearAboutEDCContractor.value = "Enter Contractor's Name";
		 } else {
		  document.form.clientHearAboutEDCContractor.disabled = false;
		  document.form.clientHearAboutEDCContractor.value = "";
		  document.form.clientHearAboutEDCContractor.focus();
		  }
      }
 function checkRelative() {
        if (document.form.clientHearAboutEDCRelativeCB.checked != 1) {
		  document.form.clientHearAboutEDCRelative.disabled = true;
		  document.form.clientHearAboutEDCRelative.value = "Enter Relative's Name";
		 } else {
		  document.form.clientHearAboutEDCRelative.disabled = false;
		  document.form.clientHearAboutEDCRelative.value = "";
		  document.form.clientHearAboutEDCRelative.focus();
		  }
      }
 function checkFriend() {
        if (document.form.clientHearAboutEDCFriendCB.checked != 1) {
		  document.form.clientHearAboutEDCFriend.disabled = true;
		  document.form.clientHearAboutEDCFriend.value = "Enter Friend's Name";
		 } else {
		  document.form.clientHearAboutEDCFriend.disabled = false;
		  document.form.clientHearAboutEDCFriend.value = "";
		  document.form.clientHearAboutEDCFriend.focus();
		  }
      }
 function checkOther() {
        if (document.form.clientHearAboutEDCOtherCB.checked != 1) {
		  document.form.clientHearAboutEDCOther.disabled = true;
		  document.form.clientHearAboutEDCOther.value = "Enter Other Information";
		 } else {
		  document.form.clientHearAboutEDCOther.disabled = false;
		  document.form.clientHearAboutEDCOther.value = "";
		  document.form.clientHearAboutEDCOther.focus();
		  }
      }

function isDate(dateStr) {

	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
	var matchArray = dateStr.match(datePat); // is the format ok?
	
	if (matchArray == null) {
		//alert("Please enter date as either mm/dd/yyyy or mm-dd-yyyy.");
		return false;
	}
	
	month = matchArray[1]; // p@rse date into variables
	day = matchArray[3];
	year = matchArray[5];
	
	if (month < 1 || month > 12) { // check month range
		//alert("Month must be between 1 and 12.");
		return false;
	}
	
	if (day < 1 || day > 31) {
		//alert("Day must be between 1 and 31.");
		return false;
	}
	
	if ((month==4 || month==6 || month==9 || month==11) && day==31) {
		//alert("Month "+month+" doesn`t have 31 days!")
		return false;
	}
	
	if (month == 2) { // check for february 29th
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day > 29 || (day==29 && !isleap)) {
			//alert("February " + year + " doesn`t have " + day + " days!");
			return false;
		}
	}
	return true; // date is valid
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function validate(form)  {
    // Checking Client Name on Apply For a Loan Form
	
	var comma="," 
	var valid="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ " 
	var numbers="1234567890" 
	var letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	var emailVar="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@"
	var emailFilter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(form.clientFName.value == "") {
	  alert("Please enter your First Name.")
      form.clientFName.focus()
      return false
    }

	if(form.clientLName.value == "") {
	  alert("Please enter your Last Name.")
      form.clientLName.focus()
      return false
    }

	if(form.clientLogin.value == "") {
	  alert("Please enter a login name that you will use to access your information on the web site.")
      form.clientLogin.focus()
      return false
    }
  
  	if(form.clientPassword.value == "") {
      alert("Please enter a password.")
      form.clientPassword.focus()
      return false
    }
  
    if(form.clientPassword.value != form.clientPassword2.value) {
      alert("Passwords do not match. Please try again.")
      form.clientPassword.focus()
      return false
    }
	
	if(form.clientAddress.value == "") {
	  alert("Please enter your Address.")
      form.clientAddress.focus()
      return false
    }
	
	if(form.clientCity.value == "") {
	  alert("Please enter your City.")
      form.clientCity.focus()
      return false
    }
   
  	if(form.clientState.value == "") {
	  alert("Please enter your State.")
      form.clientState.focus()
      return false
    }	
	
   	if(form.clientZip.value == "") {
	  alert("Please enter your Zip.")
      form.clientZip.focus()
      return false
    }

	if(!form.clientOwnRent[0].checked && !form.clientOwnRent[1].checked) {
      alert("Please select if you own or rent at this address.")
      form.clientOwnRent[0].focus()
      return false
    }
	
/*	if(form.clientSsn.value == "") {
	  alert("Please enter your Ssn.")
      form.clientSsn.focus()
      return false
    }
*/
	if(form.clientDOB.value == "") {
	  alert("Please enter your Date of Birth.")
      form.clientDOB.focus()
      return false
    } 
	
	if(!isDate(form.clientDOB.value)) {
	  alert("Please enter a valid date in the mm/dd/yyyy format for the Date of Birth.")
      form.clientDOB.focus()
      return false
    }

	if(form.clientEmail.value == "") {
	  alert("Please enter your Email.")
      form.clientEmail.focus()
      return false
    }

	if(!emailFilter.test(form.clientEmail.value)) {
	  alert("Please provide a valid email address.")
	  form.clientEmail.focus()
	  return false
	}
	
	if(form.clientOfficePhone.value == "") {
	  alert("Please enter your Office Phone.")
      form.clientOfficePhone.focus()
      return false
    }
	
	if(form.clientCellPhone.value == "") {
	  alert("Please enter your Cell Phone.")
      form.clientCellPhone.focus()
      return false
    }
		
	if(form.clientFax.value == "") {
	  alert("Please enter your Fax.")
      form.clientFax.focus()
      return false
    }

	if(form.clientHomePhone.value == "") {
	  alert("Please enter your Home Phone.")
      form.clientHomePhone.focus()
      return false
    }
	
	if(form.clientCreditScore.value == "") {
	  alert("Please enter your Credit Score.")
      form.clientCreditScore.focus()
      return false
    }

	if(form.clientAnnualIncome.value == "") {
	  alert("Please enter your Current Annual Income.")
      form.clientAnnualIncome.focus()
      return false
    }

	for (var i=0; i<form.clientAnnualIncome.value.length; i++) {
    if (numbers.indexOf(form.clientAnnualIncome.value.charAt(i)) < 0) {
      alert('Please do not use any special characters including commas in the Current Annual Income field.')
      return false
    }
  }

	if(!form.clientIncomeDocs[0].checked && !form.clientIncomeDocs[1].checked) {
      alert("Please select if your income can by verified by tax returns & other documentation.")
      form.clientIncomeDocs[0].focus()
      return false
    }
	
	if(form.clientEmployerName.value == "") {
	  alert("Please enter your Employer Name.")
      form.clientEmployerName.focus()
      return false
    }

	if(form.clientEmployerTitle.value == "") {
	  alert("Please enter your Position Title.")
      form.clientEmployerTitle.focus()
      return false
    }
	
	if(form.clientEmployerAddress.value == "") {
	  alert("Please enter your Employer Address.")
      form.clientEmployerAddress.focus()
      return false
    }

	if(form.clientEmployerCity.value == "") {
	  alert("Please enter your Employer City.")
      form.clientEmployerCity.focus()
      return false
    }

	if(form.clientEmployerState.value == "") {
	  alert("Please enter your Employer State.")
      form.clientEmployerState.focus()
      return false
    }

	if(form.clientEmployerZip.value == "") {
	  alert("Please enter your Employer Zip.")
      form.clientEmployerZip.focus()
      return false
    }
	
	if(form.clientEmployerPhone.value == "") {
	  alert("Please enter your Employer Phone.")
      form.clientEmployerPhone.focus()
      return false
    }
	if(form.clientEmployerYears.value < 0 || form.clientEmployerYears.value == "") {
	  alert("Please enter the number of years with your Employer.")
      form.clientEmployerYears.focus()
      return false
    }
	
	//testersss
	if(readCookie('cEDCLink')!="") {
		
		if(!form.clientHearAboutEDCNewsCB.checked && !form.clientHearAboutEDCMailCB.checked && !form.clientHearAboutEDCInvestorCB.checked && !form.clientHearAboutEDCTerritoryCB.checked && !form.clientHearAboutEDCAgentCB.checked && !form.clientHearAboutEDCOfficerCB.checked && !form.clientHearAboutEDCClubCB.checked && !form.clientHearAboutEDCContractorCB.checked && !form.clientHearAboutEDCRelativeCB.checked && !form.clientHearAboutEDCFriendCB.checked && !form.clientHearAboutEDCTvCB.checked && !form.clientHearAboutEDCInternetCB.checked && !form.clientHearAboutEDCOtherCB.checked) {
		  alert("Please select how you heard about EDC.")
	      //form.clientHearAboutEDC.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCInvestorCB.checked && form.clientHearAboutEDCInvestor.value == "") {
		  alert("Please enter the Investor's Name who recommended EDC.")
	      form.clientHearAboutEDCInvestor.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCInternetCB.checked && form.clientHearAboutEDCInternet.value == "") {
		  alert("Please enter the Internet Site that recommended EDC.")
	      form.clientHearAboutEDCInternet.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCTerritoryCB.checked && form.clientHearAboutEDCTerritory.value == "") {
		  alert("Please enter the Territory Manager's Name.")
	      form.clientHearAboutEDCTerritory.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCAgentCB.checked && form.clientHearAboutEDCAgent.value == "") {
		  alert("Please enter the Real Estate Agent's Name who recommended EDC.")
	      form.clientHearAboutEDCAgent.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCOfficerCB.checked && form.clientHearAboutEDCOfficer.value == "") {
		  alert("Please enter the Loan Officer's Name who recommended EDC.")
	      form.clientHearAboutEDCOfficer.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCClubCB.checked && form.clientHearAboutEDCClub.value == "") {
		  alert("Please enter the Investment Club Name who recommended EDC.")
	      form.clientHearAboutEDCClub.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCContractorCB.checked && form.clientHearAboutEDCContractor.value == "") {
		  alert("Please enter the Contractor's Name who recommended EDC.")
	      form.clientHearAboutEDCContractor.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCRelativeCB.checked && form.clientHearAboutEDCRelative.value == "") {
		  alert("Please enter your Relative's Name who recommended EDC.")
	      form.clientHearAboutEDCRelative.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCFriendCB.checked && form.clientHearAboutEDCFriend.value == "") {
		  alert("Please enter your Friend's Name who recommended EDC.")
	      form.clientHearAboutEDCFriend.focus()
	      return false
	    }
		
		if(form.clientHearAboutEDCOtherCB.checked && form.clientHearAboutEDCOther.value == "") {
		  alert("Please enter Other Information who recommended EDC.")
	      form.clientHearAboutEDCOther.focus()
	      return false
	    }
	}

	if(form.clientCurrentOwn.value == "") {
	  alert("Please select the number of properties you currently own.")
      form.clientCurrentOwn.focus()
      return false
    }
	
	if(form.clientAreasInvesting.value == "") {
	  alert("Please enter the cities/states you are interested in investing in.")
      form.clientAreasInvesting.focus()
      return false
    }
	
	if(form.clientExperiences.value == "") {
	  alert("Please enter your Real Estate Experience.")
      form.clientExperiences.focus()
      return false
    }
	
	if(form.clientGoals.value == "") {
	  alert("Please enter your Real Estate Goals.")
      form.clientGoals.focus()
      return false
    }

	if(form.termsOfUse.checked != 1) {
	  alert("You must agree to the Terms of Use policy to complete registration.")
      form.termsOfUse.focus()
      return false
    }
}

//-->
