<!--
document.onkeydown=function(e){
	window.document.key_id=window.event ? event.keyCode : e.keyCode;
}
function autotab(obj,nxt){
	var f=document.forms[0];
	if(obj.value.length==obj.maxLength){
		if(window.document.key_id && window.document.key_id!=8 && window.document.key_id!=9 && window.document.key_id!=16){
			f[nxt].focus();
			return false;
		}
	}
}
function force_numeric(obj){
	filter=/[\D]/g;
	if(filter.test(obj.value)){
		obj.value=obj.value.replace(filter,"");
	}
}
function validate_email( strValue){
	var objRegExp	= /^[a-z0-9]([a-z0-9_\-\.]*)@([a-z0-9_\-\.]*)(\.[a-z]{2,3}(\.[a-z]{2}){0,2})$/i;
	return objRegExp.test(strValue);
}
function validate_zip( strValue){
	var objRegExp	= /(^\d{5}$)|(^\d{5}-\d{4}$)/;
	return objRegExp.test(strValue);
}
form_on="page1";
function form_check()
{
	/* PAGE1 VALIDATION */
	var f=document.LC;
	var first_nameID=f.first_name;
	var last_nameID=f.last_name;
	var phone1_p1ID=f['lc[phone1_p1]'].value;
	var phone1_p2ID=f['lc[phone1_p2]'].value;
	var phone1_p3ID=f['lc[phone1_p3]'].value;
	var phone2_p1ID=f['lc[phone2_p1]'].value;
	var phone2_p2ID=f['lc[phone2_p2]'].value;
	var phone2_p3ID=f['lc[phone2_p3]'].value;
	var emailID=f.email;
	var c_rate=f.creditrating;
	var hmi=f.household_monthly_income;

	if(first_nameID.value==null || first_nameID.value=="" || first_nameID.value.length < 2){
		alert("Please provide your first name.");
		first_nameID.focus();
		return false;
	}

	if(last_nameID.value==null || last_nameID.value=="" || last_nameID.value.length < 2){
		alert("Please provide your last name.");
		last_nameID.focus();
		return false;
	}
	var filter2=/[2-9]{1}[0-8]{1}[0-9]{1}/g;
	var res=filter2.test(phone1_p1ID).toString();
	void(filter2.test(phone1_p1ID)+'_'+res);
	if(res==='false'){
		alert("Sorry, your phone's area code appears to be invalid. Please check the number and try again.");
		f.phone1_p1.focus();
		return false;
	}
	var filter3=/[2-9]{1}[0-9]{2}/g;
	res=filter3.test(phone1_p2ID).toString();
	void(filter3.test(phone1_p2ID)+'_'+res);
	if(res==='false'){
		alert("Sorry, your phone's prefix appears to be invalid. Please check the number and try again.");
		f.phone1_p2.focus();
		return false;
	}
	var filter4=/[0-9]{4}/g;
	res=filter4.test(phone1_p3ID).toString();
	void(filter4.test(phone1_p3ID)+'_'+res);
	if(res==='false'){
		alert("Sorry, your phone's suffix appears to be invalid. Please check the number and try again.");
		f.phone1_p3.focus();
		return false;
	}
	var filter5=/^01[0-9]{2}/g;
	res=filter5.test(phone1_p3ID).toString();
	void(filter5.test(phone1_p3ID)+'_'+res);
	if(phone1_p2ID=='555' && res==='true'){
		alert("Sorry, that is an invalid 555 phone number. Please check the number and try again.");
		f.phone1_p3.focus();
		return false;
	}

	if(emailID.value==null || emailID.value=="" || validate_email(emailID.value) == false){
		alert("Please provide a valid email address.");
		emailID.focus();
		return false;
	}

	if(!c_rate.selectedIndex){
		alert("What is your credit rating?");
		c_rate.focus();
		return false;
	}

	if(!hmi.selectedIndex){
		alert("What is your annual household income?");
		hmi.focus();
		return false;
	}

	if(form_on=="page1"){
		hide('page1');
		show('page2,terms');
		document.getElementById('sub_b').src="/images/submit.gif";
		var bluey=document.getElementById('bluey');
		bluey.style.height="138px";
		bluey.style.background="#3074B0 url(/images/lp/family2.jpg) no-repeat 55px 18px";
		var h2s=document.getElementsByTagName('h2');
		h2s[0].style.background="url(/images/lp/hold-on.gif) no-repeat 0 -48px";
		h2s[0].style.height="62px";
		h2s[0].style.left="299px";
		h2s[0].style.top="34px";
		var h3s=document.getElementsByTagName('h3');
		h3s[0].style.display="none";
		h3s[1].style.background="transparent";
		h3s[1].style.paddingTop="0";
		h2s[1].style.backgroundPosition="0 -19px";
		h2s[1].style.height="22px";
		show('back_1');
		form_on="page2";
		return false;
	}
	/* END PAGE1 VALIDATION */

	/* PAGE2 VALIDATION */
	var zipID=f.zip.value;
	var addressID=f.address1;
	var cityID=f.city;
	var stateID=f.state;
	var propID=f.property_type;
	var hvID=f.home_value;
	var bhID=f.behind;
	var owID=f.owed;
	var fmlID=f.fmlender;
	var fmiID=f.intrate1;
	var fmpID=f.fmpayment;

	if(addressID.value==null || addressID.value=="" || addressID.value.length < 2){
		alert("Please provide your street address.");
		addressID.focus();
		return false;
	}

	if(cityID.value==null || cityID.value=="" || cityID.value.length < 2){
		alert("Please provide your city.");
		cityID.focus();
		return false;
	}

	if(!stateID.selectedIndex){
		alert("Please select your state.");
		stateID.focus();
		return false;
	}

	if(zipID==null || zipID=="" || validate_zip(zipID) == false || zipID.length < 5 || isNaN(zipID)){
		alert("Please provide your zip code.");
		f.zip.focus();
		return false;
	}

	if(!propID.selectedIndex){
		alert("What is the type of property?");
		propID.focus();
		return false;
	}

	if(!hvID.selectedIndex){
		alert("What is the estimated value of the home?");
		hvID.focus();
		return false;
	}

	if(hvID.selectedIndex<5){
		alert("Your house must have an estimated value over $180,000 to qualify for this offer.");
		hvID.focus();
		return false;
	}

	if(!bhID.selectedIndex){
		alert("How far behind are you on your mortgage payments?");
		bhID.focus();
		return false;
	}

	if(bhID.selectedIndex<3){
		alert("You must be at least 2 months behind on your Mortgage in order to qualify for this offer.");
		bhID.focus();
		return false;
	}

	if(f.default_yes.checked && f.foreclosureY.checked){
		var f_sels=document.getElementById('fc3').getElementsByTagName('select');
		for(j=0;j<3;j++){
			if(!f_sels[j].selectedIndex){
				alert("What is the date of the foreclosure?");
				f_sels[j].focus();
				return false;
			}
		}
	}

	if(!owID.selectedIndex){
		alert("What is your mortgage balance?");
		owID.focus();
		return false;
	}

	if(fmlID.value==null || fmlID.value=="" || fmlID.value.length < 2)
	{
		alert("Who is your mortgage lender?");
		fmlID.focus();
		return false;
	}

	if(!fmiID.selectedIndex){
		alert("What is your mortgage interest rate?");
		fmiID.focus();
		return false;
	}

	if(fmiID.selectedIndex<15){
		alert("Your interest rate must be 6.50% or higher to qualify for this offer.");
		fmiID.focus();
		return false;
	}

	if(!fmpID.selectedIndex){
		alert("What is your monthly mortgage payment?");
		fmpID.focus();
		return false;
	}

	/* END PAGE2 VALIDATION */
	if(window.fc_under){
		window.fc_under.close();
	}
	show('page1');
	if(typeof page_loading == "function")page_loading(1);
	return true;
}
function page_1(){
	hide('page2,back_1,terms');
	show('page1');
	document.getElementById('sub_b').src="/images/next.gif";
	var bluey=document.getElementById('bluey');
	bluey.style.height="181px";
	bluey.style.background="#3074B0 url(/images/lp/home-for-sale.jpg) no-repeat 487px 11px";
	var h2s=document.getElementsByTagName('h2');
	h2s[0].style.backgroundPosition="0 0";
	h2s[0].style.height="48px";
	h2s[0].style.left="68px";
	h2s[0].style.top="23px";
	var h3s=document.getElementsByTagName('h3');
	h3s[0].style.display="block";
	h3s[1].style.background="url(/images/lp/family.jpg) no-repeat";
	h3s[1].style.paddingTop="118px";
	h2s[1].style.backgroundPosition="0 0";
	h2s[1].style.height="19px";
	form_on="page1";
}
//-->
