function checkPage(){

var targetLoanMod="http://loanscompete.com/landing/loanmodifications.htm";
var allowRedirectToLoanMod = true;

var val= document.getElementById("proloc").value;
    if(val.length<1) {if(document.getElementById("prolocspan")) document.getElementById("prolocspan").style.display="block";return false;}
    else {
          if(document.getElementById("prolocspan")) document.getElementById("prolocspan").style.display="none";
          
         }
if(document.forma.loan.value=="Home Purchase"){
document.forma.action="http://www.loanscompete.com/lcompete/smart/mortgageLoans/homepurchase.jsp";
}
else if((document.forma.credit.value=="Poor") && allowRedirectToLoanMod){
var c;
var t;
if(document.forma.credit.value=="Poor") c=1;
else if(document.forma.credit.value=="Needs Improvement") c=2;
t="c="+c;
t+="&pl="+document.getElementById("proloc").value;
t+="&pt="+encodeURIComponent(document.getElementById("proType").value);
if(document.getElementById("rlid")){
t+="&rlid="+encodeURIComponent(document.getElementById("rlid").value);
}
window.location.href="http://www.loanscompete.com/landing/loanmodifications.htm?"+t;
return false;
}
else document.forma.action="http://www.loanscompete.com/lcompete/smart/mortgageLoans/mortgageform.jsp";
return true;
}
