// Application Submission

function direct() {



	var state=document.mortgageApp.mail_stateprov.value;
	var homeOwn=document.mortgageApp.homeowner.value;
	var loanAmt=document.mortgageApp.property_value.value;
	var morType=document.mortgageApp.loan_type.value;
	var credit=document.mortgageApp.consumer_credit.value;
	var loanAsk=document.mortgageApp.PROPLOANAMT.value;
	var propType=document.mortgageApp.NCEN_PROP_TYPE.value;
	var mortBal=document.mortgageApp.mortgage_balance.value;



	if (state=='') { 
	alert('You must specify the state the property is located in before continuing.');
	return false;
	}
	if (credit=='') { 
	alert('You must specify your credit type before continuing.');
	return false;
	}
	if ( morType=='') { 
	alert('You must specify your loan type before continuing.');
	return false;
	}
	if ( mortBal=='' || mortBal=='NA' && morType=='Refinance') { 
	alert('You must specify your mortgage balance  before continuing.');
	return false;
	}
	if ( loanAmt=='') {
	alert('You must specify your property value before continuing.');
	return false;
	}	
	if ( loanAsk=='') {
	alert('You must specify your requested loan amount.');
	return false;
	}	
	if ( propType=='') {
	alert('You must specify your property type.');
	return false;
	}	

	if ( homeOwn=='') {
	alert('You must specify whether you own a home or not.');
	return false;
	}	


	return	localApp('https://www.credit.com/ufg/mortgage/mor'); 


}

function localApp(ufg) {





	var state=document.mortgageApp.mail_stateprov.value;

	var creditType=document.mortgageApp.consumer_credit.value;

	var mortType=document.mortgageApp.loan_type.value;
	var mortBal=document.mortgageApp.mortgage_balance.value;

	var propValue=document.mortgageApp.property_value.value;
	var loanAsk=document.mortgageApp.PROPLOANAMT.value;
	var propType=document.mortgageApp.NCEN_PROP_TYPE.value;
	var homeOwn=document.mortgageApp.homeowner.value;

	var affiliate=document.mortgageApp.affiliate.value;
	var agent=document.mortgageApp.agent.value;

	if (creditType=='Excellent') {
	creditType='excellent';
	}
	else if (creditType=='Good') {
	creditType='good';
	}
	else if (creditType=='Below Average') {
	creditType='poor';
	}
	var url=ufg;
        url+='?POST=Y&ERR=N&CURRENT_DETAIL=MAIN&NEXT_DETAIL=FINAL&CREDITTYPE='+creditType;
        url+='&OWNHOME='+homeOwn;
	url+='&MORTLOANTYPE='+mortType;
        url+='&PROPERTYVALUE='+propValue;
        url+='&PROPERTYSTATE='+state;
        url+='&PROPLOANAMT='+loanAsk;
        url+='&NCEN_PROP_TYPE='+propType;
        url+='&MORTGAGEBALANCE='+mortBal;
        url+='&affiliate='+affiliate;
        url+='&agent='+agent;
	window.location.href=url;
	return false;

}

// End -->
