 	<!-- 

function validate_register()
{
	
	document.frm.cphone.value=document.frm.phone1.value + '-' + document.frm.phone2.value + '-' + document.frm.phone3.value;
	document.frm.ophone.value=document.frm.phone12.value + '-' + document.frm.phone22.value + '-' + document.frm.phone32.value;
	
	msg="Please fill out each blank, or write NA before submitting.";
	if(document.frm.fname.value=="")
	{	
		alert(msg);
		document.frm.fname.select;
		document.frm.fname.focus();
		return false;
	}
	if(document.frm.phone1.value=="")
	{	
		alert(msg);
		document.frm.phone1.select;
		document.frm.phone1.focus();
		return false;
	}
	if(trim(document.frm.phone1.value)!="")
	{
			if(!checkInt(document.frm.phone1.value))
			{
				alert("Please enter valid Phone Number.");
				document.frm.phone1.focus();
				return false;
			}
			else
			{
				fldlen=document.frm.phone1.value;
				if(fldlen.length<3)
				{
					alert("Please enter full Number.");
					document.frm.phone1.focus();
					return false;
				}
				
			}

			
			
	}	
	
	if(document.frm.phone2.value=="")
	{	
		alert(msg);
		document.frm.phone2.select;
		document.frm.phone2.focus();
		return false;
	}
	if(trim(document.frm.phone2.value)!="")
	{
			if(!checkInt(document.frm.phone2.value))
			{
				alert("Please enter valid Phone Number.");
				document.frm.phone2.focus();
				return false;
			}
			else
			{
				fldlen=document.frm.phone2.value;
				if(fldlen.length<3)
				{
					alert("Please enter full Number.");
					document.frm.phone2.focus();
					return false;
				}
				
			}

	}
	
	
	if(document.frm.phone3.value=="")
	{	
		alert(msg);
		document.frm.phone3.select;
		document.frm.phone3.focus();
		return false;
	}
	if(trim(document.frm.phone3.value)!="")
	{
			if(!checkInt(document.frm.phone3.value))
			{
				alert("Please enter valid Phone Number.");
				document.frm.phone3.focus();
				return false;
			}
			else
			{
				fldlen=document.frm.phone3.value;
				if(fldlen.length<4)
				{
					alert("Please enter full Number.");
					document.frm.phone3.focus();
					return false;
				}
				
			}
			
	}

	if(document.frm.phone12.value=="")
	{	
		alert(msg);
		document.frm.phone12.select;
		document.frm.phone12.focus();
		return false;
	}
	if(trim(document.frm.phone12.value)!="")
	{
			if(!checkInt(document.frm.phone12.value))
			{
				alert("Please enter valid Phone Number.");
				document.frm.phone12.focus();
				return false;
			}
			else
			{
				fldlen=document.frm.phone12.value;
				if(fldlen.length<3)
				{
					alert("Please enter full Number.");
					document.frm.phone12.focus();
					return false;
				}
				
			}
	}
	
	
	if(document.frm.phone22.value=="")
	{	
		alert(msg);
		document.frm.phone22.select;
		document.frm.phone22.focus();
		return false;
	}
	if(trim(document.frm.phone22.value)!="")
	{
			if(!checkInt(document.frm.phone22.value))
			{
				alert("Please enter valid Phone Number.");
				document.frm.phone22.focus();
				return false;
			}
			else
			{
				fldlen=document.frm.phone22.value;
				if(fldlen.length<3)
				{
					alert("Please enter full Number.");
					document.frm.phone22.focus();
					return false;
				}
				
			}
			
	}
	
	if(document.frm.phone32.value=="")
	{	
		alert(msg);
		document.frm.phone32.select;
		document.frm.phone32.focus();
		return false;
	}
	if(trim(document.frm.phone32.value)!="")
	{
			if(!checkInt(document.frm.phone32.value))
			{
				alert("Please enter valid Phone Number.");
				document.frm.phone32.focus();
				return false;
			}
			else
			{
				fldlen=document.frm.phone32.value;
				if(fldlen.length<4)
				{
					alert("Please enter full Number.");
					document.frm.phone32.focus();
					return false;
				}
				
			}
			
	}
	
	if(document.frm.school.value=="")
	{	
		alert(msg);
		document.frm.school.select;
		document.frm.school.focus();
		return false;
	}	
	if(document.frm.regemail.value=="")
	{	
		alert(msg);
		document.frm.regemail.select;
		document.frm.regemail.focus();
		return false;
	}
	if (!(isEmail(document.frm.regemail.value)))
	{

		alert("Invalid Email address.(check @ and .'s)");

		document.frm.regemail.select();

		document.frm.regemail.focus();

		return false;

	}		
	
	
	if(document.frm.cemail.value=="")
	{	
		alert(msg);
		document.frm.cemail.select;
		document.frm.cemail.focus();
		return false;
	}
	if (!(isEmail(document.frm.cemail.value)))

	{

		alert("Invalid Email address.(check @ and .'s)");

		document.frm.cemail.select();

		document.frm.cemail.focus();

		return false;

	}	
	if (document.frm.regemail.value != document.frm.cemail.value)

	{

		alert("Both email should be same");

		document.frm.cemail.select();

		document.frm.cemail.focus();

		return false;

	}	
	
	if(document.frm.calltime.value=="")
	{	
		alert(msg);
		document.frm.calltime.select;
		document.frm.calltime.focus();
		return false;
	}
	return true;
}

function gotfocus(len,no)

{	

	if (eval("document.frmlong.borssno"+no+".value.length=="+len))

	{	

		eval("document.frmlong.borssno"+Number(no+1)+".focus()");		

	}

}

function gotfocus1(len,no)

{	

	if (eval("document.frmlong.cossno"+no+".value.length=="+len))

	{	

		eval("document.frmlong.cossno"+Number(no+1)+".focus()");		

	}

}
//----------> Loan Apply----------->
function loanenquirylong()

{			

		

		if(document.frmlong.loantype[0].checked==false && document.frmlong.loantype[1].checked==false && document.frmlong.loantype[2].checked==false && document.frmlong.loantype[3].checked==false)

	{

		alert("Please select Loan Type.");		

		return false;

	}
	

		
	document.frmlong.hphone.value=document.frmlong.hphone1.value + '-' + document.frmlong.hphone2.value + '-' + document.frmlong.hphone3.value;
	document.frmlong.cphone.value=document.frmlong.c1.value + '-' + document.frmlong.c2.value + '-' + document.frmlong.c3.value;

	
	
	document.frmlong.cossno.value=document.frmlong.cossno1.value + '-' + document.frmlong.cossno2.value + '-' + document.frmlong.cossno3.value;

	

	document.frmlong.borssno.value=document.frmlong.borssno1.value + '-' + document.frmlong.borssno2.value + '-' + document.frmlong.borssno3.value;		

	

	document.frmlong.borbirthdate.value=document.frmlong.borbirthdate1.value + '/' + document.frmlong.borbirthdate2.value + '/' + document.frmlong.borbirthdate3.value;	

	

	document.frmlong.cobirthdate.value=document.frmlong.cobirthdate1.value + '/' + document.frmlong.cobirthdate2.value + '/' + document.frmlong.cobirthdate3.value;

	

	document.frmlong.homephone.value=document.frmlong.homephone1.value + '-' + document.frmlong.homephone2.value + '-' + document.frmlong.homephone3.value;

	

	document.frmlong.cellphone.value=document.frmlong.cell1.value + '-' + document.frmlong.cell2.value + '-' + document.frmlong.cell3.value;

			

	document.frmlong.borofficephone.value=document.frmlong.borofficephone1.value + '-' + document.frmlong.borofficephone2.value + '-' + document.frmlong.borofficephone3.value;

	

	document.frmlong.coofficephone.value=document.frmlong.coofficephone1.value + '-' + document.frmlong.coofficephone2.value + '-' + document.frmlong.coofficephone3.value;



	document.frmlong.landlordphone.value=document.frmlong.landlordphone1.value + '-' + document.frmlong.landlordphone2.value + '-' + document.frmlong.landlordphone3.value;



	document.frmlong.bordate.value=document.frmlong.bordate1.value + '/' + document.frmlong.bordate2.value + '/' + document.frmlong.bordate3.value;	

	

	document.frmlong.codate.value=document.frmlong.codate1.value + '/' + document.frmlong.codate2.value + '/' + document.frmlong.codate3.value;

if(document.frmlong.otherrelator[0].checked==true)
	{
		if(trim(document.frmlong.realtor.value)=="")
		{
			alert("Realtor can not be blank.");
	
			document.frmlong.realtor.select();
	
			document.frmlong.realtor.focus();
	
			return false;
		}
	}

	if(document.frmlong.otherlender[0].checked==true)
	{
			if(trim(document.frmlong.lender.value)=="")
			{
				alert("Lender can not be blank.");
		
				document.frmlong.lender.select();
		
				document.frmlong.lender.focus();
		
				return false;
			}
	}
	if(trim(document.frmlong.borrower.value)=="")
	{
		alert("Borrower name can not be blank.");

		document.frmlong.borrower.select();

		document.frmlong.borrower.focus();

		return false;
	}

	if(trim(document.frmlong.borrower.value)=="")

	{

		alert("Borrower name can not be blank.");

		document.frmlong.borrower.select();

		document.frmlong.borrower.focus();

		return false;

	}	
	if(trim(document.frmlong.borbirthdate1.value)=="")

	{

		alert("Birth date cannot be blank.");

		document.frmlong.borbirthdate1.select();

		document.frmlong.borbirthdate1.focus();

		return false;

	}	
	if(trim(document.frmlong.borbirthdate2.value)=="")

	{

		alert("Month cannot be blank.");

		document.frmlong.borbirthdate2.select();

		document.frmlong.borbirthdate2.focus();

		return false;

	}
	if(trim(document.frmlong.borbirthdate3.value)=="")

	{

		alert("Year cannot be blank.");

		document.frmlong.borbirthdate3.select();

		document.frmlong.borbirthdate3.focus();

		return false;

	}	


	if(trim(document.frmlong.borssno1.value)=="")

	{

		alert("this field cannot be blank.");

		document.frmlong.borssno1.select();

		document.frmlong.borssno1.focus();

		return false;


	}
	if(trim(document.frmlong.borssno2.value)=="")

	{

		alert("this field cannot be blank.");

		document.frmlong.borssno2.select();

		document.frmlong.borssno2.focus();

		return false;


	}
	if(trim(document.frmlong.borssno3.value)=="")

	{

		alert("this field cannot be blank.");

		document.frmlong.borssno3.select();

		document.frmlong.borssno3.focus();

		return false;


	}

		if(document.frmlong.chkcoapplicate[0].checked==true)
		{
			if(trim(document.frmlong.coborrower.value)=="")
		
			{
		
				alert("Co-Borrower Name cannot be blank.");
		
				document.frmlong.coborrower.select();
		
				document.frmlong.coborrower.focus();
		
				return false;
		
			}	
		
			if(trim(document.frmlong.cobirthdate1.value)=="")
		
			{
		
				alert("Birth date cannot be blank.");
		
				document.frmlong.cobirthdate1.select();
		
				document.frmlong.cobirthdate1.focus();
		
				return false;
		
			}	
			if(trim(document.frmlong.cobirthdate2.value)=="")
		
			{
		
				alert("Month cannot be blank.");
		
				document.frmlong.cobirthdate2.select();
		
				document.frmlong.cobirthdate2.focus();
		
				return false;
		
			}
			if(trim(document.frmlong.cobirthdate3.value)=="")
		
			{
		
				alert("Year cannot be blank.");
		
				document.frmlong.cobirthdate3.select();
		
				document.frmlong.cobirthdate3.focus();
		
				return false;
		
			}	
			
			if(trim(document.frmlong.cossno1.value)=="")
		
			{
		
				alert("this field cannot be blank.");
		
				document.frmlong.cossno1.select();
		
				document.frmlong.cossno1.focus();
		
				return false;
		
		
			}
			if(trim(document.frmlong.cossno2.value)=="")
		
			{
		
				alert("this field cannot be blank.");
		
				document.frmlong.cossno2.select();
		
				document.frmlong.cossno2.focus();
		
				return false;
		
		
			}
			if(trim(document.frmlong.cossno3.value)=="")
		
			{
		
				alert("this field cannot be blank.");
		
				document.frmlong.cossno3.select();
		
				document.frmlong.cossno3.focus();
		
				return false;
		
		
			}	
			if(trim(document.frmlong.coemployer.value)=="")
		    {
	
			alert("employee can not be blank.");
	
			document.frmlong.coemployer.select();
	
			document.frmlong.coemployer.focus();
	
			return false;
	
		}
		
		if(trim(document.frmlong.coworkingyrs.value)=="")
		{
	
			alert("working year can not be blank.");
	
			document.frmlong.coworkingyrs.select();
	
			document.frmlong.coworkingyrs.focus();
	
			return false;
	
		}
		
		if(trim(document.frmlong.coworkingmos.value)=="")
		{
	
			alert("working month can not be blank.");
	
			document.frmlong.coworkingmos.select();
	
			document.frmlong.coworkingmos.focus();
	
			return false;
	
		}
	
		if(trim(document.frmlong.coofficephone1.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.coofficephone1.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone1.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone1.focus();
	
					return false;
	
			
		}
		
	
		if(trim(document.frmlong.coofficephone2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.coofficephone2.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone2.focus();
	
					return false;
	
				}
	
		}
		else
		{
		
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone2.focus();
	
					return false;
		
		}
	
		
	
		if(trim(document.frmlong.coofficephone3.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.coofficephone3.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone3.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone3.focus();
	
					return false;
		}
	
		if(trim(document.frmlong.coposition.value)=="")
		{
	
			alert("position can not be blank.");
	
			document.frmlong.coposition.select();
	
			document.frmlong.coposition.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.coincome.value)=="")
		{
	
			alert("income can not be blank.");
	
			document.frmlong.coincome.select();
	
			document.frmlong.coincome.focus();
	
			return false;
	
		}
	
		if(document.frmlong.coper[0].checked==false && document.frmlong.coper[1].checked==false)
	
		{
	
			alert("Please select Per Month Or Per Year.");		
	
			return false;
	
		}
	
if(	document.frmlong.copreemployer.disabled=="")
{
		if(trim(document.frmlong.copreemployer.value)=="")
		{
	
			alert("employee can not be blank.");
	
			document.frmlong.copreemployer.select();
	
			document.frmlong.copreemployer.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.copreposition.value)=="")
		{
	
			alert("position can not be blank.");
	
			document.frmlong.copreposition.select();
	
			document.frmlong.copreposition.focus();
	
			return false;
	
		}

		
		if(trim(document.frmlong.copreworkingyrs.value)=="")
		{
	
			alert("working year can not be blank.");
	
			document.frmlong.copreworkingyrs.select();
	
			document.frmlong.copreworkingyrs.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.copreworkingmos.value)=="")
		{
	
			alert("working month can not be blank.");
	
			document.frmlong.copreworkingmos.select();
	
			document.frmlong.copreworkingmos.focus();
	
			return false;
	
		}
}
			if(trim(document.frmlong.coinitials.value)=="")
	
		{
	
			alert("initials field cannot be blank.");
	
			document.frmlong.coinitials.select();
	
			document.frmlong.coinitials.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.codate1.value)=="")
	
		{
	
			alert("Birth date cannot be blank.");
	
			document.frmlong.codate1.select();
	
			document.frmlong.codate1.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.codate2.value)=="")
	
		{
	
			alert("Month cannot be blank.");
	
			document.frmlong.codate2.select();
	
			document.frmlong.codate2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.codate3.value)=="")
	
		{
	
			alert("Year cannot be blank.");
	
			document.frmlong.codate3.select();
	
			document.frmlong.codate3.focus();
	
			return false;
	
		}	
		
	
		
		
		}
		if(trim(document.frmlong.email.value)=="")
	
		{
	
			alert("Email cannot be blank.");
	
			document.frmlong.email.select();
	
			document.frmlong.email.focus();
	
			return false;
	
		}	
	
		if (!(isEmail(document.frmlong.email.value)))
	
		{
	
			alert("Invalid Email address.(check @ and .'s)");
	
			document.frmlong.email.select();
	
			document.frmlong.email.focus();
	
			return false;
	
		}		
	
		if(trim(document.frmlong.confirmemail.value)=="")
	
		{
	
			alert("Please enter confirm email again.");
	
			document.frmlong.confirmemail.select();
	
			document.frmlong.confirmemail.focus();
	
			return false;
	
		}	
	
		if (document.frmlong.email.value != document.frmlong.confirmemail.value)
	
		{
	
			alert("Both email should be same");
	
			document.frmlong.confirmemail.select();
	
			document.frmlong.confirmemail.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.hphone1.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.hphone1.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.hphone1.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.hphone1.focus();
	
					return false;
	
			
		}
		
	
		if(trim(document.frmlong.hphone2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.hphone2.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.hphone2.focus();
	
					return false;
	
				}
	
		}
		else
		{
		
					alert("Please enter valid Phone Number.");
	
					document.frmlong.hphone2.focus();
	
					return false;
		
		}
	
		
	
		if(trim(document.frmlong.hphone3.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.hphone3.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.hphone3.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.hphone3.focus();
	
					return false;
		}
	
		
		
		if(trim(document.frmlong.c1.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.c1.value))
	
				{
	
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.c1.focus();
					document.frmlong.c1.select();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.c1.focus();
					document.frmlong.c1.select();
					return false;
	
			
		}
		
	
		if(trim(document.frmlong.c2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.c2.value))
	
				{
	
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.c2.focus();
					document.frmlong.c2.select();
	
					return false;
	
				}
	
		}
		else
		{
		
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.c2.focus();
					document.frmlong.c2.select();
	
					return false;
		
		}
	
		
	
		if(trim(document.frmlong.c3.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.c3.value))
	
				{
	
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.c3.focus();	
					document.frmlong.c3.select();	
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.c3.focus();
					document.frmlong.c3.select();
	
					return false;
		}
	
		if(trim(document.frmlong.calltime.value)=="")
	
		{
	
			alert("call time can not be blank.");
	
			document.frmlong.calltime.select();
	
			document.frmlong.calltime.focus();
	
			return false;
	
		}	
	
		if(trim(document.frmlong.street.value)=="")
	
		{
	
			alert("street can not be blank.");
	
			document.frmlong.street.select();
	
			document.frmlong.street.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.city.value)=="")
	
		{
	
			alert("city can not be blank.");
	
			document.frmlong.city.select();
	
			document.frmlong.city.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.state.value)=="")
	
		{
	
			alert("state can not be blank.");
	
			document.frmlong.state.select();
	
			document.frmlong.state.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.zip.value)=="")
	
		{
	
			alert("zipcode can not be blank.");
	
			document.frmlong.zip.select();
	
			document.frmlong.zip.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.noofyrs.value)=="")
	
		{
	
			alert("Number of year can not be blank.");
	
			document.frmlong.noofyrs.select();
	
			document.frmlong.noofyrs.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.noofmos.value)=="")
	
		{
	
			alert("Number of month can not be blank.");
	
			document.frmlong.noofmos.select();
	
			document.frmlong.noofmos.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.noofmos.value)>12)
	
		{
	
			alert("Number of month must be valid(0-11).");
	
			document.frmlong.noofmos.select();
	
			document.frmlong.noofmos.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.homephone1.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.homephone1.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.homephone1.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.homephone1.focus();
	
					return false;
	
			
		}
		
	
		if(trim(document.frmlong.homephone2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.homephone2.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.homephone2.focus();
	
					return false;
	
				}
	
		}
		else
		{
		
					alert("Please enter valid Phone Number.");
	
					document.frmlong.homephone2.focus();
	
					return false;
		
		}
	
		
	
		if(trim(document.frmlong.homephone3.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.homephone3.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.homephone3.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.homephone3.focus();
	
					return false;
		}
	
		
		
		if(trim(document.frmlong.cell1.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.cell1.value))
	
				{
	
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.cell1.focus();
					document.frmlong.cell1.select();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.cell1.focus();
					document.frmlong.cell1.select();
					return false;
	
			
		}
		
	
		if(trim(document.frmlong.cell2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.cell2.value))
	
				{
	
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.cell2.focus();
					document.frmlong.cell2.select();
	
					return false;
	
				}
	
		}
		else
		{
		
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.cell2.focus();
					document.frmlong.cell2.select();
	
					return false;
		
		}
	
		
	
		if(trim(document.frmlong.cell3.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.cell3.value))
	
				{
	
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.cell3.focus();	
					document.frmlong.cell3.select();	
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid cell Phone Number.");
	
					document.frmlong.cell3.focus();
					document.frmlong.cell3.select();
	
					return false;
		}
	
		if(trim(document.frmlong.noofchild.value)=="")
	
		{
	
			alert("No of child can not be blank.");
	
			document.frmlong.noofchild.select();
	
			document.frmlong.noofchild.focus();
	
			return false;
	
		}
	if(trim(document.frmlong.noofchild.value)!=0)
	{
		if(trim(document.frmlong.age.value)=="")
	
		{
	
			alert("Age can not be blank.");
	
			document.frmlong.age.select();
	
			document.frmlong.age.focus();
	
			return false;
	
		}
	}
		if(trim(document.frmlong.boremployer.value)=="")
			
				{
			
					alert("borrower can not be blank.");
			
					document.frmlong.boremployer.select();
			
					document.frmlong.boremployer.focus();
			
					return false;
			
				}	
				
				
				if(trim(document.frmlong.borworkingyrs.value)=="")
			
				{
			
					alert("borrowing year can not be blank.");
			
					document.frmlong.borworkingyrs.select();
			
					document.frmlong.borworkingyrs.focus();
			
					return false;
			
				}
				if(trim(document.frmlong.borworkingmos.value)=="")
			
				{
			
					alert("borrowing month can not be blank.");
			
					document.frmlong.borworkingmos.select();
			
					document.frmlong.borworkingmos.focus();
			
					return false;
			
				}	
			
				if(trim(document.frmlong.borworkingmos.value)>11)
				{
			
					alert("borrowing month must be in range 0-11.");
			
					document.frmlong.borworkingmos.select();
			
					document.frmlong.borworkingmos.focus();
			
					return false;
			
				}	
			
				if(trim(document.frmlong.borofficephone1.value)!="")
			
				{
			
						if(!checkInt(document.frmlong.borofficephone1.value))
			
						{
			
							alert("Please enter valid cell Phone Number.");
			
							document.frmlong.borofficephone1.focus();
							document.frmlong.borofficephone1.select();
			
							return false;
			
						}
			
				}
				else
				{
							alert("Please enter valid cell Phone Number.");
			
							document.frmlong.borofficephone1.focus();
							document.frmlong.borofficephone1.select();
							return false;
			
					
				}
				
			
				if(trim(document.frmlong.borofficephone2.value)!="")
			
				{
			
						if(!checkInt(document.frmlong.borofficephone2.value))
			
						{
			
							alert("Please enter valid cell Phone Number.");
			
							document.frmlong.borofficephone2.focus();
							document.frmlong.borofficephone2.select();
			
							return false;
			
						}
			
				}
				else
				{
				
							alert("Please enter valid cell Phone Number.");
			
							document.frmlong.borofficephone2.focus();
							document.frmlong.borofficephone2.select();
			
							return false;
				
				}
			
				
			
				if(trim(document.frmlong.borofficephone3.value)!="")
			
				{
			
						if(!checkInt(document.frmlong.borofficephone3.value))
			
						{
			
							alert("Please enter valid cell Phone Number.");
			
							document.frmlong.borofficephone3.focus();	
							document.frmlong.borofficephone3.select();	
			
							return false;
			
						}
			
				}
				else
				{
							alert("Please enter valid cell Phone Number.");
			
							document.frmlong.borofficephone3.focus();
							document.frmlong.borofficephone3.select();
			
							return false;
				}
			
			
			
				if(trim(document.frmlong.borposition.value)=="")
			
				{
			
					alert("position can not be blank.");
			
					document.frmlong.borposition.select();
			
					document.frmlong.borposition.focus();
			
					return false;
			
				}
			
				if(trim(document.frmlong.borincome.value)=="")
			
				{
			
					alert("income can not be blank.");
			
					document.frmlong.borincome.select();
			
					document.frmlong.borincome.focus();
			
					return false;
			
				}
			
				if(document.frmlong.borper[0].checked==false && document.frmlong.borper[1].checked==false)
			
				{
			
					alert("Please select Per Month Or Per Year.");		
			
					return false;
			
				}
			
			if(document.frmlong.borpreemployer.disabled=="")
			{
				   if(trim(document.frmlong.borpreemployer.value)=="")
				
					{
				
						alert("employer can not be blank.");
				
						document.frmlong.borpreemployer.select();
				
						document.frmlong.borpreemployer.focus();
				
						return false;
				
					}
					if(trim(document.frmlong.borpreposition.value)=="")
					{
				
						alert("position can not be blank.");
				
						document.frmlong.borpreposition.select();
				
						document.frmlong.borpreposition.focus();
				
						return false;
				
					}
			
				if(trim(document.frmlong.borpreworkingyrs.value)=="")
				{
			
					alert("working year can not be blank.");
			
					document.frmlong.borpreworkingyrs.select();
			
					document.frmlong.borpreworkingyrs.focus();
			
					return false;
			
				}
				if(trim(document.frmlong.borpreworkingmos.value)=="")
				{
			
					alert("working month can not be blank.");
			
					document.frmlong.borpreworkingmos.select();
			
					document.frmlong.borpreworkingmos.focus();
			
					return false;
			
				}
				
				
			}





		if(trim(document.frmlong.zip.value)!="")

	{

			if(!checkInt(document.frmlong.zip.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.zip.focus();

				return false;

			}

	}
	else
	{
				alert("Please enter valid Zip Code.");

				document.frmlong.zip.focus();

				return false;
	}

	

	if(document.frmlong.rentown[0].checked==false && document.frmlong.rentown[1].checked==false)

	{

		alert("Please select Rent Or Own.");		

		return false;

	}

	

	if(document.frmlong.childsupport[0].checked==false && document.frmlong.childsupport[1].checked==false)

	{

		alert("Please select Child Support.");		

		return false;

	}		

	

	if(trim(document.frmlong.prezip.value)!="")

	{

			if(!checkInt(document.frmlong.prezip.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.prezip.focus();

				return false;

			}

	}

	
if(document.frmlong.noofyrs.value<2)
{
	
	if(trim(document.frmlong.prestreet.value)=="")

	{

		alert("street can not be blank.");

		document.frmlong.prestreet.select();

		document.frmlong.prestreet.focus();

		return false;

	}	
	if(trim(document.frmlong.precity.value)=="")

	{

		alert("city can not be blank.");

		document.frmlong.precity.select();

		document.frmlong.precity.focus();

		return false;

	}
	if(trim(document.frmlong.prestate.value)=="")

	{

		alert("state can not be blank.");

		document.frmlong.prestate.select();

		document.frmlong.prestate.focus();

		return false;

	}
	if(trim(document.frmlong.prezip.value)=="")

	{

		alert("zipcode can not be blank.");

		document.frmlong.prezip.select();

		document.frmlong.prezip.focus();

		return false;

	}	
	
	if(trim(document.frmlong.prezip.value)!="")

	{

			if(!checkInt(document.frmlong.prezip.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.prezip.focus();

				return false;

			}

	}
}

	if(trim(document.frmlong.zip1.value)!="")

	{

			if(!checkInt(document.frmlong.zip1.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.zip1.focus();

				return false;

			}

	}
if(document.frmlong.noofyrs.value<2)
{	
	
	if(trim(document.frmlong.prenoofyrs.value)=="")

	{

		alert("year can not be blank.");

		document.frmlong.prenoofyrs.select();

		document.frmlong.prenoofyrs.focus();

		return false;

	}
	if(trim(document.frmlong.prenoofmos.value)=="")

	{

		alert("month can not be blank.");

		document.frmlong.prenoofmos.select();

		document.frmlong.prenoofmos.focus();

		return false;

	}	
}
	if(document.frmlong.chkmonthlyin[0].checked==true)
		{
		if(trim(document.frmlong.additionalincome.value)=="")
		{
	
			alert("additionalincome can not be blank.");
	
			document.frmlong.additionalincome.select();
	
			document.frmlong.additionalincome.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.source.value)=="")
		{
	
			alert("source can not be blank.");
	
			document.frmlong.source.select();
	
			document.frmlong.source.focus();
	
			return false;
	
		}
		}
	if(trim(document.frmlong.bank1.value)=="")
	{

		alert("bank can not be blank.");

		document.frmlong.bank1.select();

		document.frmlong.bank1.focus();

		return false;

	}

	if(trim(document.frmlong.street1.value)=="")

	{

		alert("street can not be blank.");

		document.frmlong.street1.select();

		document.frmlong.street1.focus();

		return false;

	}	
	if(trim(document.frmlong.city1.value)=="")

	{

		alert("city can not be blank.");

		document.frmlong.city1.select();

		document.frmlong.city1.focus();

		return false;

	}
	if(trim(document.frmlong.state1.value)=="")

	{

		alert("state can not be blank.");

		document.frmlong.state1.select();

		document.frmlong.state1.focus();

		return false;

	}
	if(trim(document.frmlong.zip1.value)=="")

	{

		alert("zipcode can not be blank.");

		document.frmlong.zip1.select();

		document.frmlong.zip1.focus();

		return false;

	}	
	
	if(trim(document.frmlong.zip1.value)!="")

	{

			if(!checkInt(document.frmlong.zip1.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.zip1.focus();

				return false;

			}

	}
	
	if( (document.frmlong.balance111.value)=="" && (document.frmlong.balance133.value)=="")
	{
	

		alert("Please select Checking Or Savings.");		

		return false;

	}

	if(trim(document.frmlong.balance1.value)=="")

	{

		alert("balance can not be blank.");

		document.frmlong.balance1.select();

		document.frmlong.balance1.focus();

		return false;

	}	
	if(document.frmlong.chkbank[0].checked==true)
	{
	
		if(trim(document.frmlong.bank2.value)=="")
		{
	
			alert("bank can not be blank.");
	
			document.frmlong.bank2.select();
	
			document.frmlong.bank2.focus();
	
			return false;
	
		}
	
		if(trim(document.frmlong.street2.value)=="")
	
		{
	
			alert("street can not be blank.");
	
			document.frmlong.street2.select();
	
			document.frmlong.street2.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.city2.value)=="")
	
		{
	
			alert("city can not be blank.");
	
			document.frmlong.city2.select();
	
			document.frmlong.city2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.state2.value)=="")
	
		{
	
			alert("state can not be blank.");
	
			document.frmlong.state2.select();
	
			document.frmlong.state2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.zip2.value)=="")
	
		{
	
			alert("zipcode can not be blank.");
	
			document.frmlong.zip2.select();
	
			document.frmlong.zip2.focus();
	
			return false;
	
		}	
		
		if(trim(document.frmlong.zip2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.zip2.value))
	
				{
	
					alert("Please enter valid Zip Code.");
	
					document.frmlong.zip2.focus();
	
					return false;
	
				}
	
		}
	
	
	
	
		if(document.frmlong.balance11.value==" "  && document.frmlong.balance13.value=="")
	
		{
	
	
	
			alert("Please select Checking Or Savings.");		
	
			return false;
	
		}
		
		if(trim(document.frmlong.balance2.value)=="")
	
		{
	
			alert("balance can not be blank.");
	
			document.frmlong.balance2.select();
	
			document.frmlong.balance2.focus();
	
			return false;
	
		}	
	
	}
		if(trim(document.frmlong.automobileyear1.value)=="")
	
		{
	
			alert("year can not be blank.");
	
			document.frmlong.automobileyear1.select();
	
			document.frmlong.automobileyear1.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.automobilebalance1.value)=="")
	
		{
	
			alert("balance can not be blank.");
	
			document.frmlong.automobilebalance1.select();
	
			document.frmlong.automobilebalance1.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.automobilepayment1.value)=="")
	
		{
	
			alert("payment can not be blank.");
	
			document.frmlong.automobilepayment1.select();
	
			document.frmlong.automobilepayment1.focus();
	
			return false;
	
		}	
		
		if(document.frmlong.chkautomobile[0].checked==true)
		{
		if(trim(document.frmlong.automobileyear2.value)=="")
	
		{
	
			alert("year can not be blank.");
	
			document.frmlong.automobileyear2.select();
	
			document.frmlong.automobileyear2.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.automobilebalance2.value)=="")
	
		{
	
			alert("balance can not be blank.");
	
			document.frmlong.automobilebalance2.select();
	
			document.frmlong.automobilebalance2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.automobilepayment2.value)=="")
	
		{
	
			alert("payment can not be blank.");
	
			document.frmlong.automobilepayment2.select();
	
			document.frmlong.automobilepayment2.focus();
	
			return false;
	
		}
		}
		if(document.frmlong.chkhome[0].checked==true)
		{
		if(trim(document.frmlong.mortgage.value)=="")
	
		{
	
			alert("mortaage can not be blank.");
	
			document.frmlong.mortgage.select();
	
			document.frmlong.mortgage.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.principle.value)=="")
	
		{
	
			alert("principle can not be blank.");
	
			document.frmlong.principle.select();
	
			document.frmlong.principle.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.payment.value)=="")
	
		{
	
			alert("payment can not be blank.");
	
			document.frmlong.payment.select();
	
			document.frmlong.payment.focus();
	
			return false;
	
		}
		}
		if(document.frmlong.chkrent[0].checked==true)
		{
		if(trim(document.frmlong.landlordname.value)=="")
	
		{
	
			alert("landloard can not be blank.");
	
			document.frmlong.landlordname.select();
	
			document.frmlong.landlordname.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.landlordphone1.value)=="")
	
		{
	
			alert("landloard can not be blank.");
	
			document.frmlong.landlordphone1.select();
	
			document.frmlong.landlordphone1.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.landlordphone2.value)=="")
	
		{
	
			alert("landloard can not be blank.");
	
			document.frmlong.landlordphone2.select();
	
			document.frmlong.landlordphone2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.landlordphone3.value)=="")
	
		{
	
			alert("landloard can not be blank.");
	
			document.frmlong.landlordphone3.select();
	
			document.frmlong.landlordphone3.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.landlordpaymnet.value)=="")
	
		{
	
			alert("payment can not be blank.");
	
			document.frmlong.landlordpaymnet.select();
	
			document.frmlong.landlordpaymnet.focus();
	
			return false;
	
		}
		}
		if(document.frmlong.downpayment[0].checked==false && document.frmlong.downpayment[1].checked==false)
	
		{
	
			alert("Please select Down payment.");		
	
			return false;
	
		}
		if(document.frmlong.downpayment[0].checked==true)
		{
			if(trim(document.frmlong.howmuch.value)=="")
		
			{
		
				alert("this can not be blank.");
		
				document.frmlong.howmuch.select();
		
				document.frmlong.howmuch.focus();
		
				return false;
		
			}
		
			if(trim(document.frmlong.sourcefund.value)=="")
		
			{
		
				alert("this can not be blank.");
		
				document.frmlong.sourcefund.select();
		
				document.frmlong.sourcefund.focus();
		
				return false;
		
			}
		
			if(trim(document.frmlong.total.value)=="")
		
			{
		
				alert("total can not be blank.");
		
				document.frmlong.total.select();
		
				document.frmlong.total.focus();
		
				return false;
		
			}
		}
		if(document.frmlong.bankruptcy[0].checked==false && document.frmlong.bankruptcy[1].checked==false)
	
		{
	
			alert("Please select Bankruptcy.");		
	
			return false;
	
		}
	
	
		if(document.frmlong.foreclosed[0].checked==false && document.frmlong.foreclosed[1].checked==false)
	
		{
	
			alert("Please select Foreclosed.");		
	
			return false;
	
		}
	
		if(document.frmlong.certify[0].checked==false && document.frmlong.certify[1].checked==false)
	
		{
	
			alert("Please select Certify.");		
	
			return false;
	
		}
	
		if(trim(document.frmlong.borinitials.value)=="")
	
		{
	
			alert("initials field cannot be blank.");
	
			document.frmlong.borinitials.select();
	
			document.frmlong.borinitials.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.bordate1.value)=="")
	
		{
	
			alert("Birth date cannot be blank.");
	
			document.frmlong.bordate1.select();
	
			document.frmlong.bordate1.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.bordate2.value)=="")
	
		{
	
			alert("Month cannot be blank.");
	
			document.frmlong.bordate2.select();
	
			document.frmlong.bordate2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.bordate3.value)=="")
	
		{
	
			alert("Year cannot be blank.");
	
			document.frmlong.bordate3.select();
	
			document.frmlong.bordate3.focus();
	
			return false;
	
		}	
		
	
if(document.frmlong.credit[2].checked==true || document.frmlong.credit[3].checked==true)
	{
			if(trim(document.frmlong.creditexplain.value)=="")
     		{
			alert("creditexplaination can not be blank.");
	
			document.frmlong.creditexplain.select();
	
			document.frmlong.creditexplain.focus();
	
			return false;
		}
	}
	document.frmlong.action = "apply_loan_db.php";

	document.frmlong.submit();



}

function loanenquiry()

{	



	if(document.frm.loantype[0].checked==false && document.frm.loantype[1].checked==false)

	{

		alert("Please select Loan Type.");		

		return false;

	}

//if(trim(document.frm.fname.value)=="")

//	{

//		alert("First name cannot be blank.");

//		document.frm.fname.select();

//		document.frm.fname.focus();

//		return false;

//	}	

//	if(trim(document.frm.lname.value)=="")

//	{

//		alert("Last name cannot be blank.");

//		document.frm.lname.select();

//		document.frm.lname.focus();

//		return false;

//	}



	if(trim(document.frm.email.value)=="")

	{

		alert("Email cannot be blank.");

		document.frm.email.select();

		document.frm.email.focus();

		return false;

	}	

	if (!(isEmail(document.frm.email.value)))

	{

		alert("Invalid Email address.(check @ and .'s)");

		document.frm.email.select();

		document.frm.email.focus();

		return false;

	}		

	if(trim(document.frm.confirmemail.value)=="")

	{

		alert("Please enter confirm email again.");

		document.frm.confirmemail.select();

		document.frm.confirmemail.focus();

		return false;

	}	

	if (document.frm.email.value != document.frm.confirmemail.value)

	{

		alert("Both email should be same");

		document.frm.confirmemail.select();

		document.frm.confirmemail.focus();

		return false;

	}

	if(trim(document.frm.homephone1.value)!="")

	{

			if(!checkInt(document.frm.homephone1.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.homephone1.focus();

				return false;

			}

	}

	

	if(trim(document.frm.homephone2.value)!="")

	{

			if(!checkInt(document.frm.homephone2.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.homephone2.focus();

				return false;

			}

	}

	

	if(trim(document.frm.homephone3.value)!="")

	{

			if(!checkInt(document.frm.homephone3.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.homephone3.focus();

				return false;

			}

	}

	

	if(trim(document.frm.cellphone1.value)!="")

	{

			if(!checkInt(document.frm.cellphone1.value))

			{

				alert("Please enter valid Cell Phone Number.");

				document.frm.cellphone1.focus();

				return false;

			}

	}

	

	if(trim(document.frm.cellphone2.value)!="")

	{

			if(!checkInt(document.frm.cellphonee2.value))

			{

				alert("Please enter valid Cell Phone Number.");

				document.frm.cellphone2.focus();

				return false;

			}

	}

	

	if(trim(document.frm.cellphone3.value)!="")

	{

			if(!checkInt(document.frm.cellphone3.value))

			{

				alert("Please enter valid Cell Phone Number.");

				document.frm.cellphone3.focus();

				return false;

			}

	}

	

	if(trim(document.frm.otherphone1.value)!="")

	{

			if(!checkInt(document.frm.otherphone1.value))

			{

				alert("Please enter valid Other Phone Number.");

				document.frm.otherphone1.focus();

				return false;

			}

	}

	

	if(trim(document.frm.otherphone2.value)!="")

	{

			if(!checkInt(document.frm.otherphone.value))

			{

				alert("Please enter valid Other Phone Number.");

				document.frm.otherphone2.focus();

				return false;

			}

	}

	

	if(trim(document.frm.otherphone3.value)!="")

	{

			if(!checkInt(document.frm.otherphone3.value))

			{

				alert("Please enter valid Other Phone Number.");

				document.frm.otherphone3.focus();

				return false;

			}

	}	

//		if(trim(document.frm.property_value.value)!="")

//	{

//		if(!checkInt(document.frm.property_value.value))

//	 	{

//	   		alert("Please enter valid Property Value.");

//			document.frm.property_value.focus();

//			return false;

//		}

//	}

//	if(trim(document.frm.loan_amount.value)!="")

//	{

//		if(!checkInt(document.frm.loan_amount.value))

//	 	{

//	   		alert("Please enter valid Loan Amount.");

//			document.frm.loan_amount.focus();

//			return false;

//		}

//	}

//	if(trim(document.frm.down_payment.value)!="")

//	{

//		if(!checkInt(document.frm.down_payment.value))

//	 	{

//	   		alert("Please enter valid Down Payment Amount.");

//			document.frm.down_payment.focus();

//			return false;

//		}

//	}

//	if(trim(document.frm.coborrower.value)=="")

//	{

//		alert("Please select Coborrower.");

//		/*document.frm.coborrower.select();

//		document.frm.coborrower.focus();*/

//		return false;

//	}

//	if(trim(document.frm.state.value)=="")

//	{

//		alert("Please select State.");

//		/*document.frm.state.select();

//		document.frm.state.focus();*/

//		return false;

//	}

//	if(trim(document.frm.real_estate.value)=="")

//	{

//		alert("Please select Real Estate.");

//		/*document.frm.real_estate.select();

//		document.frm.real_estate.focus();*/

//		return false;

//	}

//	if(trim(document.frm.credit.value)=="")

//	{

//		alert("Please select Credit.");

//		/*document.frm.credit.select();

//		document.frm.credit.focus();*/

//		return false;

//	}

//	if(trim(document.frm.employer.value)=="")

//	{

//		alert("Please select Employment.");

//		/*document.frm.employer.select();

//		document.frm.employer.focus();*/

//		return false;

//	}	

//	if(trim(document.frm.job_years.value)!="")

//	{

//		if(!checkInt(document.frm.job_years.value))

//	 	{

//	   		alert("Please enter valid Years On Job.");

//			document.frm.job_years.focus();

//			return false;

//		}

//	}

//	if(trim(document.frm.monthly_income.value)!="")

//	{

//		if(!checkInt(document.frm.monthly_income.value))

//	 	{

//	   		alert("Please enter valid Monthly Income.");

//			document.frm.monthly_income.focus();

//			return false;

//		}

//	}

//	if(trim(document.frm.monthly_expense.value)!="")

//	{

//		if(!checkInt(document.frm.monthly_expense.value))

//	 	{

//	   		alert("Please enter valid Monthly Expense.");

//			document.frm.monthly_expense.focus();

//			return false;

//		}

//	}

	document.frm.homephone.value=document.frm.homephone1.value + '-' + document.frm.homephone2.value + '-' + document.frm.homephone3.value;

	document.frm.cellphone.value=document.frm.cellphone1.value + '-' + document.frm.cellphone2.value + '-' + document.frm.cellphone3.value;

	document.frm.otherphone.value=document.frm.otherphone1.value + '-' + document.frm.otherphone2.value + '-' + document.frm.otherphone3.value;

	document.frm.action = "apply_loan_db.php";

	document.frm.submit();

}



function houseenquiry()

{	

	if(trim(document.frm.email.value)=="")

	{

			alert("Email cannot be blank.");

			document.frm.email.select();

			document.frm.email.focus();

			return false;

	}	

	if (!(isEmail(document.frm.email.value)))

	{

			alert("Invalid Email address.(check @ and .'s)");

			document.frm.email.select();

			document.frm.email.focus();

			return false;

	}

	if(trim(document.frm.phone1.value)!="")

	{

			if(!checkInt(document.frm.phone1.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.phone1.focus();

				return false;

			}

	}

	

	if(trim(document.frm.phone2.value)!="")

	{

			if(!checkInt(document.frm.phone2.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.phone2.focus();

				return false;

			}

	}

	

	if(trim(document.frm.phone3.value)!="")

	{

			if(!checkInt(document.frm.phone3.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.phone3.focus();

				return false;

			}

	}

	if(trim(document.frm.price_min.value)!="")

	{

		if(!checkInt(document.frm.price_min.value))

	 	{

	   		alert("Please enter valid Minimum Price.");

			document.frm.price_min.focus();

			return false;

		}

	}

	if(trim(document.frm.price_max.value)!="")

	{

		if(!checkInt(document.frm.price_max.value))

	 	{

	   		alert("Please enter valid Maximum Price.");

			document.frm.price_max.focus();

			return false;

		}

	}

	if(trim(document.frm.price_min.value)!="" && trim(document.frm.price_max.value)!="")

	{

		if(Number(document.frm.price_max.value)< Number(document.frm.price_min.value))

	 	{

	   		alert("Maximum Price should be greater than Minimum Price.");

			document.frm.price_max.focus();

			return false;

		}

	}

	if(trim(document.frm.bedroom.value)!="")

	{

		if(!checkInt(document.frm.bedroom.value))

	 	{

	   		alert("Please enter valid Bed rooms.");

			document.frm.bedroom.focus();

			return false;

		}

	}

	if(trim(document.frm.bath.value)!="")

	{

		if(!checkInt(document.frm.bath.value))

	 	{

	   		alert("Please enter valid Bath.");

			document.frm.bath.focus();

			return false;

		}

	}

	if(trim(document.frm.size.value)!="")

	{

		if(!checkInt(document.frm.size.value))

	 	{

	   		alert("Please enter valid Square Feets.");

			document.frm.size.focus();

			return false;

		}

	}

	document.frm.action = "find_house_db.php";

	document.frm.submit();

}



function signup()

{



	if(trim(document.frmtop.fname.value)=="")

	{

		alert("First name cannot be blank.");

		document.frmtop.fname.select();

		document.frmtop.fname.focus();

		return false;

	}	



	if(trim(document.frmtop.lname.value)=="")

	{

		alert("Last name cannot be blank.");

		document.frmtop.lname.select();

		document.frmtop.lname.focus();

		return false;

	}		

	if(trim(document.frmtop.email.value)=="")

	{

		alert("Email cannot be blank.");

		document.frmtop.email.select();

		document.frmtop.email.focus();

		return false;

	}

	

	if (!(isEmail(document.frmtop.email.value)))

	{

		alert("Invalid Email address.(check @ and .'s)");

		document.frmtop.email.select();

		document.frmtop.email.focus();

		return false;

	}			

	document.frmtop.action = "registration_db.php";

	document.frmtop.submit();

}

function checkfrm()

	{		

		if(trim(document.frm.email.value)=="")

		{

			alert("Email cannot be blank.");

			document.frm.email.select();

			document.frm.email.focus();

			return false;

		}	

		if (!(isEmail(document.frm.email.value)))

		{

			alert("Invalid Email address.(check @ and .'s)");

			document.frm.email.select();

			document.frm.email.focus();

			return false;

		}

		if(trim(document.frm.phone1.value)!="")

		{

			if(!checkInt(document.frm.phone1.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.phone1.focus();

				return false;

			}

		}

	

		if(trim(document.frm.phone2.value)!="")

		{

			if(!checkInt(document.frm.phone2.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.phone2.focus();

				return false;

			}

		}

	

		if(trim(document.frm.phone3.value)!="")

		{

			if(!checkInt(document.frm.phone3.value))

			{

				alert("Please enter valid Phone Number.");

				document.frm.phone3.focus();

				return false;

			}

		}

		if(trim(document.frm.zip.value)!="")

		{

			if(!checkInt(document.frm.zip.value))

			{

				alert("Please enter valid Zip Code.");

				document.frm.zip.focus();

				return false;

			}

		}		

		document.frm.action = "buy_house_db.php";

		document.frm.submit();

	}

	

function chkcomment()

{		

		if(trim(document.frm.comment.value)=="")

		{

			alert("Comment cannot be blank.");

			document.frm.comment.select();

			document.frm.comment.focus();

			return false;

		}

		document.frm.action = "teacher_resources_db.php";

		document.frm.submit();

}

function topsearch()

{	

	if((document.frmsearch.txtsearch.value.split(" ").join("").length == 0 )|| (document.frmsearch.txtsearch.value == "Search the site" ))

	{

		alert("Please enter value to search.");

		document.frmsearch.txtsearch.value = "";

		document.frmsearch.txtsearch.select();

		document.frmsearch.txtsearch.focus();

		return false;

   }

	document.frmsearch.action = "search.php";

	document.frmsearch.submit();

}



function trim(tmp)

{

	var temp;

	temp = tmp;

	//tmp = "      this is test     ";

	pat = /^\s+/;

	temp = temp.replace(pat, "");

	pat = /\s+$/;

	temp = temp.replace(pat, "");

	//alert(":" + tmp + ":");

	return temp;

}



function isEmail(str) 

{

  // are regular expressions supported?

  var supported = 0;

  if (window.RegExp) {

	var tempStr = "a";

	var tempReg = new RegExp(tempStr);

	if (tempReg.test(tempStr)) supported = 1;

  }

  if (!supported) 

	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);

	  var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");

	  var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");

	  return (!r1.test(str) && r2.test(str));

}



function isLoginName(str)

{

	var pat = /[a-z,A-Z,0-9,\-,\_]+/g;

	var vr = str;

	var vr = vr.replace(pat,"");

	if (vr) { return false; }

	

	return true;

}



function checkInt(a)

{

	if (a.split(" ").join("").length ==0)

	{

		return false;

	}

	var Anum = "0123456789";

	for (i=0;i<a.length;i++)

	{

		if (Anum.indexOf(a.substr(i,1)) == -1)

		{

			//alert(Anum.indexOf(a.substr(i,1)) + "," + a.substr(i,1));

			return false;

		}

		

	}

	return true;

}



function checkFloat(a)

{

	if (a.split(" ").join("").length ==0)

	{

		return false;

	}

	var Anum = "0123456789.";

	for (i=0;i<a.length;i++)

	{

		if (Anum.indexOf(a.substr(i,1)) == -1)

		{

			return false;

		}

		

	}

	if (isNaN(a))

	{

		return false;

	}

	return true;

}



function FormatNumber(N, D)

// To format a given number upto specified decimals

{

	var r, ro, ra, s, No;

	

	r = 0;

	ro = 1;

	

	r = parseFloat(N);

	

	ro = parseInt(D+1);

	

	ro = parseFloat(1*(Math.pow(10, ro)));

	

	ra = parseFloat(5/ro);



	r = parseFloat(r + ra);

			

	ro = parseFloat(ro/10);

	

	r = parseFloat(r*ro);

	

	r = parseInt(r);

	

	r = parseFloat(r/ro);

	

	s = new String(r);		

	

	if (s.indexOf(".") == -1)

	{

		r = r + ".00";

	}

	else

	{

		

		if ((s.substr(s.indexOf(".")+1)).length == 1)

		{

		r = r + "0";

		}

	}

	

	return r;

}			
function loanenquirycredit()
{			
	if(document.frmlong.loantype[0].checked==false && document.frmlong.loantype[1].checked==false && document.frmlong.loantype[2].checked==false && document.frmlong.loantype[3].checked==false)

	{

		alert("Please select Loan Type.");		

		return false;

	}
	

		
	document.frmlong.hphone.value=document.frmlong.hphone1.value + '-' + document.frmlong.hphone2.value + '-' + document.frmlong.hphone3.value;
	document.frmlong.cphone.value=document.frmlong.c1.value + '-' + document.frmlong.c2.value + '-' + document.frmlong.c3.value;

	
	
	document.frmlong.cossno.value=document.frmlong.cossno1.value + '-' + document.frmlong.cossno2.value + '-' + document.frmlong.cossno3.value;

	

	document.frmlong.borssno.value=document.frmlong.borssno1.value + '-' + document.frmlong.borssno2.value + '-' + document.frmlong.borssno3.value;		

	

	document.frmlong.borbirthdate.value=document.frmlong.borbirthdate1.value + '/' + document.frmlong.borbirthdate2.value + '/' + document.frmlong.borbirthdate3.value;	

	

	document.frmlong.cobirthdate.value=document.frmlong.cobirthdate1.value + '/' + document.frmlong.cobirthdate2.value + '/' + document.frmlong.cobirthdate3.value;

	

	document.frmlong.homephone.value=document.frmlong.homephone1.value + '-' + document.frmlong.homephone2.value + '-' + document.frmlong.homephone3.value;

	

	document.frmlong.cellphone.value=document.frmlong.cell1.value + '-' + document.frmlong.cell2.value + '-' + document.frmlong.cell3.value;

			

	document.frmlong.borofficephone.value=document.frmlong.borofficephone1.value + '-' + document.frmlong.borofficephone2.value + '-' + document.frmlong.borofficephone3.value;

	

	document.frmlong.coofficephone.value=document.frmlong.coofficephone1.value + '-' + document.frmlong.coofficephone2.value + '-' + document.frmlong.coofficephone3.value;



	document.frmlong.landlordphone.value=document.frmlong.landlordphone1.value + '-' + document.frmlong.landlordphone2.value + '-' + document.frmlong.landlordphone3.value;



	document.frmlong.bordate.value=document.frmlong.bordate1.value + '/' + document.frmlong.bordate2.value + '/' + document.frmlong.bordate3.value;	

	

	document.frmlong.codate.value=document.frmlong.codate1.value + '/' + document.frmlong.codate2.value + '/' + document.frmlong.codate3.value;

	if(document.frmlong.otherrelator[0].checked==true)
	{
		if(trim(document.frmlong.realtor.value)=="")
		{
			alert("Realtor can not be blank.");
	
			document.frmlong.realtor.select();
	
			document.frmlong.realtor.focus();
	
			return false;
		}
	}

	if(document.frmlong.otherlender[0].checked==true)
	{
			if(trim(document.frmlong.lender.value)=="")
			{
				alert("Lender can not be blank.");
		
				document.frmlong.lender.select();
		
				document.frmlong.lender.focus();
		
				return false;
			}
	}

	if(trim(document.frmlong.applicant.value)=="")

	{

		alert("Applicant's Full Name cannot be blank.");

		document.frmlong.applicant.select();

		document.frmlong.applicant.focus();

		return false;

	}	
	if(trim(document.frmlong.borbirthdate1.value)=="")

	{

		alert("Birth date cannot be blank.");

		document.frmlong.borbirthdate1.select();

		document.frmlong.borbirthdate1.focus();

		return false;

	}	
	if(trim(document.frmlong.borbirthdate2.value)=="")

	{

		alert("Month cannot be blank.");

		document.frmlong.borbirthdate2.select();

		document.frmlong.borbirthdate2.focus();

		return false;

	}
	if(trim(document.frmlong.borbirthdate3.value)=="")

	{

		alert("Year cannot be blank.");

		document.frmlong.borbirthdate3.select();

		document.frmlong.borbirthdate3.focus();

		return false;

	}	

	if(trim(document.frmlong.borssno1.value)=="")

	{

		alert("this field cannot be blank.");

		document.frmlong.borssno1.select();

		document.frmlong.borssno1.focus();

		return false;


	}
	if(trim(document.frmlong.borssno2.value)=="")

	{

		alert("this field cannot be blank.");

		document.frmlong.borssno2.select();

		document.frmlong.borssno2.focus();

		return false;


	}
	if(trim(document.frmlong.borssno3.value)=="")

	{

		alert("this field cannot be blank.");

		document.frmlong.borssno3.select();

		document.frmlong.borssno3.focus();

		return false;


	}
	

	if(document.frmlong.chkcoapplicate[0].checked==true)
	{
		if(trim(document.frmlong.coapplicant.value)=="")
	
		{
	
			alert("Last Name cannot be blank.");
	
			document.frmlong.coapplicant.select();
	
			document.frmlong.coapplicant.focus();
	
			return false;
	
		}	
	
		if(trim(document.frmlong.cobirthdate1.value)=="")
	
		{
	
			alert("Birth date cannot be blank.");
	
			document.frmlong.cobirthdate1.select();
	
			document.frmlong.cobirthdate1.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.cobirthdate2.value)=="")
	
		{
	
			alert("Month cannot be blank.");
	
			document.frmlong.cobirthdate2.select();
	
			document.frmlong.cobirthdate2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.cobirthdate3.value)=="")
	
		{
	
			alert("Year cannot be blank.");
	
			document.frmlong.cobirthdate3.select();
	
			document.frmlong.cobirthdate3.focus();
	
			return false;
	
		}	
		
		if(trim(document.frmlong.cossno1.value)=="")
	
		{
	
			alert("this field cannot be blank.");
	
			document.frmlong.cossno1.select();
	
			document.frmlong.cossno1.focus();
	
			return false;
	
	
		}
		if(trim(document.frmlong.cossno2.value)=="")
	
		{
	
			alert("this field cannot be blank.");
	
			document.frmlong.cossno2.select();
	
			document.frmlong.cossno2.focus();
	
			return false;
	
	
		}
		if(trim(document.frmlong.cossno3.value)=="")
	
		{
	
			alert("this field cannot be blank.");
	
			document.frmlong.cossno3.select();
	
			document.frmlong.cossno3.focus();
	
			return false;
	
	
		}	
		if(trim(document.frmlong.coemployer.value)=="")
		{
	
			alert("employee can not be blank.");
	
			document.frmlong.coemployer.select();
	
			document.frmlong.coemployer.focus();
	
			return false;
	
		}
		
	    	if(trim(document.frmlong.coworkingyrs.value)=="")
		{
	
			alert("working year can not be blank.");
	
			document.frmlong.coworkingyrs.select();
	
			document.frmlong.coworkingyrs.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.coworkingmos.value)=="")
		{
	
			alert("working month can not be blank.");
	
			document.frmlong.coworkingmos.select();
	
			document.frmlong.coworkingmos.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.coworkingmos.value)>=12)
		{
	
			alert("working month must be in range 0-11.");
	
			document.frmlong.coworkingmos.select();
	
			document.frmlong.coworkingmos.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.coofficephone1.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.coofficephone1.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone1.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone1.focus();
	
					return false;
	
			
		}
		
	
	    	if(trim(document.frmlong.coofficephone2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.coofficephone2.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone2.focus();
	
					return false;
	
				}
	
		}
		else
		{
		
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone2.focus();
	
					return false;
		
		}
	
		
	
		if(trim(document.frmlong.coofficephone3.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.coofficephone3.value))
	
				{
	
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone3.focus();
	
					return false;
	
				}
	
		}
		else
		{
					alert("Please enter valid Phone Number.");
	
					document.frmlong.coofficephone3.focus();
	
					return false;
		}
	
		if(trim(document.frmlong.coposition.value)=="")
		{
	
			alert("position can not be blank.");
	
			document.frmlong.coposition.select();
	
			document.frmlong.coposition.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.coincome.value)=="")
		{
	
			alert("income can not be blank.");
	
			document.frmlong.coincome.select();
	
			document.frmlong.coincome.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.coinitials.value)=="")

	{

		alert("initials field cannot be blank.");

		document.frmlong.coinitials.select();

		document.frmlong.coinitials.focus();

		return false;

	}	
	if(trim(document.frmlong.codate1.value)=="")

	{

		alert("Birth date cannot be blank.");

		document.frmlong.codate1.select();

		document.frmlong.codate1.focus();

		return false;

	}	
	if(trim(document.frmlong.codate2.value)=="")

	{

		alert("Month cannot be blank.");

		document.frmlong.codate2.select();

		document.frmlong.codate2.focus();

		return false;

	}
	if(trim(document.frmlong.codate3.value)=="")

	{

		alert("Year cannot be blank.");

		document.frmlong.codate3.select();

		document.frmlong.codate3.focus();

		return false;

	}	
	

	
		if(document.frmlong.coper[0].checked==false && document.frmlong.coper[1].checked==false)
	
		{
	
			alert("Please select Per Month Or Per Year.");		
	
			return false;
	
		}
		
		if(document.frmlong.copreemployer.disabled=="")
		{
			if(trim(document.frmlong.copreemployer.value)=="")
			{
	
				alert("employee can not be blank.2");
		
				document.frmlong.copreemployer.select();
		
				document.frmlong.copreemployer.focus();
		
				return false;
	
		     }
		    if(trim(document.frmlong.copreposition.value)=="")
		    {
	
				alert("position can not be blank.");
		
				document.frmlong.copreposition.select();
		
				document.frmlong.copreposition.focus();
		
				return false;
		
		     }
			 if(trim(document.frmlong.copreworkingyrs.value)=="")
			{
		
				alert("working year can not be blank.");
		
				document.frmlong.copreworkingyrs.select();
		
				document.frmlong.copreworkingyrs.focus();
		
				return false;
		
			}
			if(trim(document.frmlong.copreworkingmos.value)=="")
			{
		
				alert("working month can not be blank.");
		
				document.frmlong.copreworkingmos.select();
		
				document.frmlong.copreworkingmos.focus();
		
				return false;
		
			}
	
		}
	
	

	}
	if(trim(document.frmlong.email.value)=="")

	{

		alert("Email cannot be blank.");

		document.frmlong.email.select();

		document.frmlong.email.focus();

		return false;

	}	

	if (!(isEmail(document.frmlong.email.value)))

	{

		alert("Invalid Email address.(check @ and .'s)");

		document.frmlong.email.select();

		document.frmlong.email.focus();

		return false;

	}		

	if(trim(document.frmlong.confirmemail.value)=="")

	{

		alert("Please enter confirm email again.");

		document.frmlong.confirmemail.select();

		document.frmlong.confirmemail.focus();

		return false;

	}	

	if (document.frmlong.email.value != document.frmlong.confirmemail.value)

	{

		alert("Both email should be same");

		document.frmlong.confirmemail.select();

		document.frmlong.confirmemail.focus();

		return false;

	}
	if(trim(document.frmlong.hphone1.value)!="")

	{

			if(!checkInt(document.frmlong.hphone1.value))

			{

				alert("Please enter valid Phone Number.");

				document.frmlong.hphone1.focus();

				return false;

			}

	}
	else
	{
				alert("Please enter valid Phone Number.");

				document.frmlong.hphone1.focus();

				return false;

		
	}
	

	if(trim(document.frmlong.hphone2.value)!="")

	{

			if(!checkInt(document.frmlong.hphone2.value))

			{

				alert("Please enter valid Phone Number.");

				document.frmlong.hphone2.focus();

				return false;

			}

	}
	else
	{
	
				alert("Please enter valid Phone Number.");

				document.frmlong.hphone2.focus();

				return false;
	
	}

	

	if(trim(document.frmlong.hphone3.value)!="")

	{

			if(!checkInt(document.frmlong.hphone3.value))

			{

				alert("Please enter valid Phone Number.");

				document.frmlong.hphone3.focus();

				return false;

			}

	}
	else
	{
				alert("Please enter valid Phone Number.");

				document.frmlong.hphone3.focus();

				return false;
	}

	
	
	if(trim(document.frmlong.c1.value)!="")

	{

			if(!checkInt(document.frmlong.c1.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.c1.focus();
				document.frmlong.c1.select();

				return false;

			}

	}
	else
	{
				alert("Please enter valid cell Phone Number.");

				document.frmlong.c1.focus();
				document.frmlong.c1.select();
				return false;

		
	}
	

	if(trim(document.frmlong.c2.value)!="")

	{

			if(!checkInt(document.frmlong.c2.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.c2.focus();
				document.frmlong.c2.select();

				return false;

			}

	}
	else
	{
	
				alert("Please enter valid cell Phone Number.");

				document.frmlong.c2.focus();
				document.frmlong.c2.select();

				return false;
	
	}

	

	if(trim(document.frmlong.c3.value)!="")

	{

			if(!checkInt(document.frmlong.c3.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.c3.focus();	
				document.frmlong.c3.select();	

				return false;

			}

	}
	else
	{
				alert("Please enter valid cell Phone Number.");

				document.frmlong.c3.focus();
				document.frmlong.c3.select();

				return false;
	}

	if(trim(document.frmlong.calltime.value)=="")

	{

		alert("call time can not be blank.");

		document.frmlong.calltime.select();

		document.frmlong.calltime.focus();

		return false;

	}	

	if(trim(document.frmlong.street.value)=="")

	{

		alert("street can not be blank.");

		document.frmlong.street.select();

		document.frmlong.street.focus();

		return false;

	}	
	if(trim(document.frmlong.city.value)=="")

	{

		alert("city can not be blank.");

		document.frmlong.city.select();

		document.frmlong.city.focus();

		return false;

	}
	if(trim(document.frmlong.state.value)=="")

	{

		alert("state can not be blank.");

		document.frmlong.state.select();

		document.frmlong.state.focus();

		return false;

	}
	if(trim(document.frmlong.zip.value)=="")

	{

		alert("zipcode can not be blank.");

		document.frmlong.zip.select();

		document.frmlong.zip.focus();

		return false;

	}	
	if(trim(document.frmlong.noofyrs.value)=="")

	{

		alert("Number of year can not be blank.");

		document.frmlong.noofyrs.select();

		document.frmlong.noofyrs.focus();

		return false;

	}
	if(trim(document.frmlong.noofmos.value)=="")

	{

		alert("Number of month can not be blank.");

		document.frmlong.noofmos.select();

		document.frmlong.noofmos.focus();

		return false;

	}
	if(trim(document.frmlong.noofmos.value)>12)
	
		{
	
			alert("Number of month must be  valid(0-11).");
	
			document.frmlong.noofmos.select();
	
			document.frmlong.noofmos.focus();
	
			return false;
	
		}
	if(trim(document.frmlong.homephone1.value)!="")

	{

			if(!checkInt(document.frmlong.homephone1.value))

			{

				alert("Please enter valid Phone Number.");

				document.frmlong.homephone1.focus();

				return false;

			}

	}
	else
	{
				alert("Please enter valid Phone Number.");

				document.frmlong.homephone1.focus();

				return false;

		
	}
	

	if(trim(document.frmlong.homephone2.value)!="")

	{

			if(!checkInt(document.frmlong.homephone2.value))

			{

				alert("Please enter valid Phone Number.");

				document.frmlong.homephone2.focus();

				return false;

			}

	}
	else
	{
	
				alert("Please enter valid Phone Number.");

				document.frmlong.homephone2.focus();

				return false;
	
	}

	

	if(trim(document.frmlong.homephone3.value)!="")

	{

			if(!checkInt(document.frmlong.homephone3.value))

			{

				alert("Please enter valid Phone Number.");

				document.frmlong.homephone3.focus();

				return false;

			}

	}
	else
	{
				alert("Please enter valid Phone Number.");

				document.frmlong.homephone3.focus();

				return false;
	}

	
	
	if(trim(document.frmlong.cell1.value)!="")

	{

			if(!checkInt(document.frmlong.cell1.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.cell1.focus();
				document.frmlong.cell1.select();

				return false;

			}

	}
	else
	{
				alert("Please enter valid cell Phone Number.");

				document.frmlong.cell1.focus();
				document.frmlong.cell1.select();
				return false;

		
	}
	

	if(trim(document.frmlong.cell2.value)!="")

	{

			if(!checkInt(document.frmlong.cell2.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.cell2.focus();
				document.frmlong.cell2.select();

				return false;

			}

	}
	else
	{
	
				alert("Please enter valid cell Phone Number.");

				document.frmlong.cell2.focus();
				document.frmlong.cell2.select();

				return false;
	
	}

	

	if(trim(document.frmlong.cell3.value)!="")

	{

			if(!checkInt(document.frmlong.cell3.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.cell3.focus();	
				document.frmlong.cell3.select();	

				return false;

			}

	}
	else
	{
				alert("Please enter valid cell Phone Number.");

				document.frmlong.cell3.focus();
				document.frmlong.cell3.select();

				return false;
	}

	if(trim(document.frmlong.noofchild.value)=="")

	{

		alert("No of child can not be blank.");

		document.frmlong.noofchild.select();

		document.frmlong.noofchild.focus();

		return false;

	}
	if(trim(document.frmlong.noofchild.value)!=0)
	{
		if(trim(document.frmlong.age.value)=="")
	
		{
	
			alert("Age can not be blank.");
	
			document.frmlong.age.select();
	
			document.frmlong.age.focus();
	
			return false;
	
		}
	}






	if(trim(document.frmlong.zip.value)!="")

	{

			if(!checkInt(document.frmlong.zip.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.zip.focus();

				return false;

			}

	}
	else
	{
				alert("Please enter valid Zip Code.");

				document.frmlong.zip.focus();

				return false;
	}

	

	if(document.frmlong.rentown[0].checked==false && document.frmlong.rentown[1].checked==false)

	{

		alert("Please select Rent Or Own.");		

		return false;

	}

	

	if(document.frmlong.childsupport[0].checked==false && document.frmlong.childsupport[1].checked==false)

	{

		alert("Please select Child Support.");		

		return false;

	}		

	

	if(trim(document.frmlong.prezip.value)!="")

	{

			if(!checkInt(document.frmlong.prezip.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.prezip.focus();

				return false;

			}

	}

	
if(document.frmlong.noofyrs.value<2)
{
	
	if(trim(document.frmlong.prestreet.value)=="")

	{

		alert("street can not be blank.");

		document.frmlong.prestreet.select();

		document.frmlong.prestreet.focus();

		return false;

	}	
	if(trim(document.frmlong.precity.value)=="")

	{

		alert("city can not be blank.");

		document.frmlong.precity.select();

		document.frmlong.precity.focus();

		return false;

	}
	if(trim(document.frmlong.prestate.value)=="")

	{

		alert("state can not be blank.");

		document.frmlong.prestate.select();

		document.frmlong.prestate.focus();

		return false;

	}
	if(trim(document.frmlong.prezip.value)=="")

	{

		alert("zipcode can not be blank.");

		document.frmlong.prezip.select();

		document.frmlong.prezip.focus();

		return false;

	}	
	
	if(trim(document.frmlong.prezip.value)!="")

	{

			if(!checkInt(document.frmlong.prezip.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.prezip.focus();

				return false;

			}

	}

}
	if(trim(document.frmlong.zip1.value)!="")

	{

			if(!checkInt(document.frmlong.zip1.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.zip1.focus();

				return false;

			}

	}
	
if(document.frmlong.noofyrs.value<2)
{	
	if(trim(document.frmlong.prenoofyrs.value)=="")

	{

		alert("year can not be blank.");

		document.frmlong.prenoofyrs.select();

		document.frmlong.prenoofyrs.focus();

		return false;

	}
	if(trim(document.frmlong.prenoofmos.value)=="")

	{

		alert("month can not be blank.");

		document.frmlong.prenoofmos.select();

		document.frmlong.prenoofmos.focus();

		return false;

	}	
}
	if(trim(document.frmlong.boremployer.value)=="")

	{

		alert("borrower can not be blank.");

		document.frmlong.boremployer.select();

		document.frmlong.boremployer.focus();

		return false;

	}	
	
	
	if(trim(document.frmlong.borworkingyrs.value)=="")

	{

		alert("borrowing year can not be blank.");

		document.frmlong.borworkingyrs.select();

		document.frmlong.borworkingyrs.focus();

		return false;

	}
	if(trim(document.frmlong.borworkingmos.value)=="")

	{

		alert("borrowing month can not be blank.");

		document.frmlong.borworkingmos.select();

		document.frmlong.borworkingmos.focus();

		return false;

	}	
	if(trim(document.frmlong.borworkingmos.value)>11)
	{

		alert("borrowing month must be in range 0-11.");

		document.frmlong.borworkingmos.select();

		document.frmlong.borworkingmos.focus();

		return false;

	}	

	if(trim(document.frmlong.borofficephone1.value)!="")

	{

			if(!checkInt(document.frmlong.borofficephone1.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.borofficephone1.focus();
				document.frmlong.borofficephone1.select();

				return false;

			}

	}
	else
	{
				alert("Please enter valid cell Phone Number.");

				document.frmlong.borofficephone1.focus();
				document.frmlong.borofficephone1.select();
				return false;

		
	}
	

	if(trim(document.frmlong.borofficephone2.value)!="")

	{

			if(!checkInt(document.frmlong.borofficephone2.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.borofficephone2.focus();
				document.frmlong.borofficephone2.select();

				return false;

			}

	}
	else
	{
	
				alert("Please enter valid cell Phone Number.");

				document.frmlong.borofficephone2.focus();
				document.frmlong.borofficephone2.select();

				return false;
	
	}

	

	if(trim(document.frmlong.borofficephone3.value)!="")

	{

			if(!checkInt(document.frmlong.borofficephone3.value))

			{

				alert("Please enter valid cell Phone Number.");

				document.frmlong.borofficephone3.focus();	
				document.frmlong.borofficephone3.select();	

				return false;

			}

	}
	else
	{
				alert("Please enter valid cell Phone Number.");

				document.frmlong.borofficephone3.focus();
				document.frmlong.borofficephone3.select();

				return false;
	}



	if(trim(document.frmlong.borposition.value)=="")

	{

		alert("position can not be blank.");

		document.frmlong.borposition.select();

		document.frmlong.borposition.focus();

		return false;

	}

	if(trim(document.frmlong.borincome.value)=="")

	{

		alert("income can not be blank.");

		document.frmlong.borincome.select();

		document.frmlong.borincome.focus();

		return false;

	}

	if(document.frmlong.borper[0].checked==false && document.frmlong.borper[1].checked==false)

	{

		alert("Please select Per Month Or Per Year.");		

		return false;

	}
	
if(document.frmlong.borpreemployer.disabled == "")
{
    if(trim(document.frmlong.borpreemployer.value)=="")

	{

		alert("employer can not be blank.");

		document.frmlong.borpreemployer.select();

		document.frmlong.borpreemployer.focus();

		return false;

	}
		if(trim(document.frmlong.borpreposition.value)=="")
	{

		alert("position can not be blank.");

		document.frmlong.borpreposition.select();

		document.frmlong.borpreposition.focus();

		return false;

	}

	
	if(trim(document.frmlong.borpreworkingyrs.value)=="")
	{

		alert("working year can not be blank.");

		document.frmlong.borpreworkingyrs.select();

		document.frmlong.borpreworkingyrs.focus();

		return false;

	}
	if(trim(document.frmlong.borpreworkingmos.value)=="")
	{

		alert("working month can not be blank.");

		document.frmlong.borpreworkingmos.select();

		document.frmlong.borpreworkingmos.focus();

		return false;

	}
	
	
}
	

	if(document.frmlong.chkmonthlyin[0].checked==true)
	{
		if(trim(document.frmlong.additionalincome.value)=="")
		{
	
			alert("additionalincome can not be blank.");
	
			document.frmlong.additionalincome.select();
	
			document.frmlong.additionalincome.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.source.value)=="")
		{
	
			alert("source can not be blank.");
	
			document.frmlong.source.select();
	
			document.frmlong.source.focus();
	
			return false;
	
		}
	}
	if(trim(document.frmlong.bank1.value)=="")
	{

		alert("bank can not be blank.");

		document.frmlong.bank1.select();

		document.frmlong.bank1.focus();

		return false;

	}

	if(trim(document.frmlong.street1.value)=="")

	{

		alert("street can not be blank.");

		document.frmlong.street1.select();

		document.frmlong.street1.focus();

		return false;

	}	
	if(trim(document.frmlong.city1.value)=="")

	{

		alert("city can not be blank.");

		document.frmlong.city1.select();

		document.frmlong.city1.focus();

		return false;

	}
	if(trim(document.frmlong.state1.value)=="")

	{

		alert("state can not be blank.");

		document.frmlong.state1.select();

		document.frmlong.state1.focus();

		return false;

	}
	if(trim(document.frmlong.zip1.value)=="")

	{

		alert("zipcode can not be blank.");

		document.frmlong.zip1.select();

		document.frmlong.zip1.focus();

		return false;

	}	
	
	if(trim(document.frmlong.zip1.value)!="")

	{

			if(!checkInt(document.frmlong.zip1.value))

			{

				alert("Please enter valid Zip Code.");

				document.frmlong.zip1.focus();

				return false;

			}

	}
	
	
if( (document.frmlong.balance111.value)=="" && (document.frmlong.balance133.value)=="")

	{

		alert("Please select Checking Or Savings.");		

		return false;

	}

	if(trim(document.frmlong.balance1.value)=="")

	{

		alert("balance can not be blank.");

		document.frmlong.balance1.select();

		document.frmlong.balance1.focus();

		return false;

	}	
if(document.frmlong.chkbank[0].checked==true)
{
		if(trim(document.frmlong.bank2.value)=="")
		{
	
			alert("bank can not be blank.");
	
			document.frmlong.bank2.select();
	
			document.frmlong.bank2.focus();
	
			return false;
	
		}
	
		if(trim(document.frmlong.street2.value)=="")
	
		{
	
			alert("street can not be blank.");
	
			document.frmlong.street2.select();
	
			document.frmlong.street2.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.city2.value)=="")
	
		{
	
			alert("city can not be blank.");
	
			document.frmlong.city2.select();
	
			document.frmlong.city2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.state2.value)=="")
	
		{
	
			alert("state can not be blank.");
	
			document.frmlong.state2.select();
	
			document.frmlong.state2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.zip2.value)=="")
	
		{
	
			alert("zipcode can not be blank.");
	
			document.frmlong.zip2.select();
	
			document.frmlong.zip2.focus();
	
			return false;
	
		}	
		
		if(trim(document.frmlong.zip2.value)!="")
	
		{
	
				if(!checkInt(document.frmlong.zip2.value))
	
				{
	
					alert("Please enter valid Zip Code.");
	
					document.frmlong.zip2.focus();
	
					return false;
	
				}
	
		}
		if(document.frmlong.balance11.value==" "  && document.frmlong.balance13.value=="")
	
		{
	
			alert("Please select Checking Or Savings.");		
	
			return false;
	
		}
		
		if(trim(document.frmlong.balancel2.value)=="")
	
		{
	
			alert("balance can not be blank.");
	
			document.frmlong.balance2.select();
	
			document.frmlong.balance2.focus();
	
			return false;
	
		}	
}

	
	if(trim(document.frmlong.automobileyear1.value)=="")

	{

		alert("year can not be blank.");

		document.frmlong.automobileyear1.select();

		document.frmlong.automobileyear1.focus();

		return false;

	}	
	if(trim(document.frmlong.automobilebalance1.value)=="")

	{

		alert("balance can not be blank.");

		document.frmlong.automobilebalance1.select();

		document.frmlong.automobilebalance1.focus();

		return false;

	}
	if(trim(document.frmlong.automobilepayment1.value)=="")

	{

		alert("payment can not be blank.");

		document.frmlong.automobilepayment1.select();

		document.frmlong.automobilepayment1.focus();

		return false;

	}	
	if(document.frmlong.chkautomobile[0].checked==true)
	{
		if(trim(document.frmlong.automobileyear2.value)=="")
	
		{
	
			alert("year can not be blank.");
	
			document.frmlong.automobileyear2.select();
	
			document.frmlong.automobileyear2.focus();
	
			return false;
	
		}	
		if(trim(document.frmlong.automobilebalance2.value)=="")
	
		{
	
			alert("balance can not be blank.");
	
			document.frmlong.automobilebalance2.select();
	
			document.frmlong.automobilebalance2.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.automobilepayment2.value)=="")
	
		{
	
			alert("payment can not be blank.");
	
			document.frmlong.automobilepayment2.select();
	
			document.frmlong.automobilepayment2.focus();
	
			return false;
	
		}
	}
	if(document.frmlong.chkhome[0].checked==true)
	{
		if(trim(document.frmlong.mortgage.value)=="")
	
		{
	
			alert("mortaage can not be blank.");
	
			document.frmlong.mortgage.select();
	
			document.frmlong.mortgage.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.principle.value)=="")
	
		{
	
			alert("principle can not be blank.");
	
			document.frmlong.principle.select();
	
			document.frmlong.principle.focus();
	
			return false;
	
		}
		if(trim(document.frmlong.payment.value)=="")
	
		{
	
			alert("payment can not be blank.");
	
			document.frmlong.payment.select();
	
			document.frmlong.payment.focus();
	
			return false;
	
		}
	}
	
	if(document.frmlong.downpayment[0].checked==false && document.frmlong.downpayment[1].checked==false)

	{

		alert("Please select Down payment.");		

		return false;

	}
	if(document.frmlong.downpayment[0].checked==true)
	{
		if(trim(document.frmlong.howmuch.value)=="")
	
		{
	
			alert("this can not be blank.");
	
			document.frmlong.howmuch.select();
	
			document.frmlong.howmuch.focus();
	
			return false;
	
		}

		if(trim(document.frmlong.sourcefund.value)=="")
	
		{
	
			alert("this can not be blank.");
	
			document.frmlong.sourcefund.select();
	
			document.frmlong.sourcefund.focus();
	
			return false;
	
		}
	
		if(trim(document.frmlong.total.value)=="")
	
		{
	
			alert("total can not be blank.");
	
			document.frmlong.total.select();
	
			document.frmlong.total.focus();
	
			return false;
	
		}
	}

	if(document.frmlong.bankruptcy[0].checked==false && document.frmlong.bankruptcy[1].checked==false)

	{

		alert("Please select Bankruptcy.");		

		return false;

	}


	if(document.frmlong.foreclosed[0].checked==false && document.frmlong.foreclosed[1].checked==false)

	{

		alert("Please select Foreclosed.");		

		return false;

	}

	if(document.frmlong.certify[0].checked==false && document.frmlong.certify[1].checked==false)

	{

		alert("Please select Certify.");		

		return false;

	}

	if(trim(document.frmlong.borinitials.value)=="")

	{

		alert("initials field cannot be blank.");

		document.frmlong.borinitials.select();

		document.frmlong.borinitials.focus();

		return false;

	}	
	if(trim(document.frmlong.bordate1.value)=="")

	{

		alert("Birth date cannot be blank.");

		document.frmlong.bordate1.select();

		document.frmlong.bordate1.focus();

		return false;

	}	
	if(trim(document.frmlong.bordate2.value)=="")

	{

		alert("Month cannot be blank.");

		document.frmlong.bordate2.select();

		document.frmlong.bordate2.focus();

		return false;

	}
	if(trim(document.frmlong.bordate3.value)=="")

	{

		alert("Year cannot be blank.");

		document.frmlong.bordate3.select();

		document.frmlong.bordate3.focus();

		return false;

	}	
	if(document.frmlong.credit[2].checked==true || document.frmlong.credit[3].checked==true)
	{
			if(trim(document.frmlong.creditexplain.value)=="")
     		{
			alert("creditexplaination can not be blank.");
	
			document.frmlong.creditexplain.select();
	
			document.frmlong.creditexplain.focus();
	
			return false;
		}
	}
	
	
	

	document.frmlong.action = "apply_loan_db.php";

	document.frmlong.submit();



}
function change_age(val)
{
	if(val==0)
	document.frmlong.age.disabled="disabled";
	if(val>0)
	document.frmlong.age.disabled="";
}
function change_prev(val)
{
	if(val>=2)
	{
	document.frmlong.prestreet.disabled="disabled";
	document.frmlong.precity.disabled="disabled";
	document.frmlong.prestate.disabled="disabled";
	document.frmlong.prezip.disabled="disabled";
	document.frmlong.prenoofyrs.disabled="disabled";
	document.frmlong.prenoofmos.disabled="disabled";
	}
	if(val<2)
	{
	document.frmlong.prestreet.disabled="";
	document.frmlong.precity.disabled="";
	document.frmlong.prestate.disabled="";
	document.frmlong.prezip.disabled="";
	document.frmlong.prenoofyrs.disabled="";
	document.frmlong.prenoofmos.disabled="";
	}
}
function disprevemp(val)
{	
	
	if(val>=2)
	{
	document.frmlong.borpreemployer.disabled="disabled";
	document.frmlong.borpreworkingyrs.disabled="disabled";
	document.frmlong.borpreworkingmos.disabled="disabled";
	document.frmlong.borpreposition.disabled="disabled";
	}
	if(val<2)
	{
	document.frmlong.borpreemployer.disabled="";
	document.frmlong.borpreworkingyrs.disabled="";
	document.frmlong.borpreworkingmos.disabled="";
	document.frmlong.borpreposition.disabled="";
	}
}
function disprevemp_co(val)
{	
	
	if(val>=2)
	{
	document.frmlong.copreemployer.disabled="disabled";
	document.frmlong.copreworkingyrs.disabled="disabled";
	document.frmlong.copreworkingmos.disabled="disabled";
	document.frmlong.copreposition.disabled="disabled";
	}
	if(val<2)
	{
	document.frmlong.copreemployer.disabled="";
	document.frmlong.copreworkingyrs.disabled="";
	document.frmlong.copreworkingmos.disabled="";
	document.frmlong.copreposition.disabled="";
	}
}
function dis_pay(val)
{
	if(val==1)
	{
	document.frmlong.howmuch.disabled="disabled";
	document.frmlong.sourcefund.disabled="disabled";
	document.frmlong.total.disabled="disabled";
	}
	else
	{document.frmlong.howmuch.disabled="";
	document.frmlong.sourcefund.disabled="";
	document.frmlong.total.disabled="";
	}	
}
function mpn() { //v2.0
  MM_openBrWindow('register.php','','scrollbars=no,width=425,height=440')
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// -->
