function makePopUp(whereTo, winWidth, winHeight) 
{
  remote = window.open("","remotewin","width="+winWidth+",height="+winHeight+",menubar=0,toolbar=no,scrollbars=yes");
  remote.location.href = whereTo; 
  remote.focus();
}

function MortgageStepOne(form) {
     if (form.addressState.value==""){
      alert("Please select a State."); return false;
     }
     if (form.homeType.value==""){
      alert("Please describe your property type."); return false;
     }
     if (form.creditHistory.value==""){
      alert("Please put in your credit history."); return false;
     }
     return true;
}

function MortgagePortalStepOne(form){
	var url="";
	if (form.loanType.value=="REFINANCE"){ url="http://www.refinancelane.com/ppc/refinance2.jsp"; }
	if (form.loanType.value=="PURCHASE"){ url="http://www.refinancelane.com/ppc/purchase2.jsp"; }
	if (form.loanType.value=="HOME_EQUITY"){ url="http://www.refinancelane.com/ppc/equity2.jsp"; }
	if (form.loanType.value=="DEBT_CONSOLIDATION"){ url="http://www.refinancelane.com/ppc/debt2.jsp"; }

     if (form.addressState.value==""){
      alert("Please select a State."); return false;
     }
     if (form.homeType.value==""){
      alert("Please describe your property type."); return false;
     }
     if (form.creditHistory.value==""){
      alert("Please put in your credit history."); return false;
     }
     if (form.loanType.value==""){
      alert("Please select the type of loan you are seeking."); return false;
     }
     form.action=url;
     form.submit();
}

function checkSubmit(form) {

     if (form.loanType.value==""){
      alert("Please select the type of loan you are seeking.");
      return false;
     }

     if (form.addressState.value==""){
      alert("Please select a State.");
      return false;
     }

     if (form.homeType.value==""){
      alert("Please describe your property type.");
      return false;
     }
     
     if (form.creditHistory.value==""){
      alert("Please put in your credit history.");
      return false;
     }
     
     if (form.householdIncome.value==""){
      alert("Please enter you annual household income.");
      return false;
     }
     
     if (form.bankruptcy.value==""){
      alert("Please list your bankruptcy status.");
      return false;
     }
     return true;
}


function InsurancePortalStepOne(form){
	var url="";
	if (form.InsuranceType.value=="HEALTH"){ url="http://www.refinancelane.com/ppc/health.jsp"; }
	if (form.InsuranceType.value=="GROUP"){ url="http://www.refinancelane.com/ppc/group.jsp"; }
	if (form.InsuranceType.value=="AUTO"){ url="http://www.insurance.com/autolanding.aspx?cp=1419&zip="+form.address_1_zip.value; }
	if (form.InsuranceType.value=="LIFE"){ url="http://www.refinancelane.com/ppc/life.jsp"; }
	if (form.InsuranceType.value=="HOMEOWNER"){ url="http://www.refinancelane.com/ppc/homeowner.jsp"; }

     if (form.first_name.value==""){
      alert("Please enter your First Name."); return false;
     }
     if (form.InsuranceType.value==""){
      alert("Please select the type of insurance you are looking for."); return false;
     }
     if (form.address_1_zip.value==""){
      alert("Please enter your Zipcode."); return false;
     }
     form.action=url;
     form.submit();
}