// RFI Form Validation Script


// RFI Form Validation Script
function checkForms(rfi)
{
	
	if(rfi.name.value=="")
	{
		alert("Please Enter Your Full Name!") ;
		rfi.name.focus() ;
		return false;
	}
	
		if(rfi.name.value=="")
		{
			alert("Please Enter Your Full Name!") ;
			rfi.name.focus() ;
			return false;
		}
	
		if(rfi.address.value=="")
	{
		alert("Please Enter Your Address!") ;
		rfi.address.focus() ;
		return false;
	}
	
		if(rfi.address.value=="")
		{
			alert("Please Enter Your Address!") ;
			rfi.address.focus() ;
			return false;
		}
	
		//Select box validation	
		if(rfi.country.value=="select")
	{
		alert ('Select your Country!');
		rfi.country.focus() ;
		return false;
	}
	
		if(rfi.phone.value=="")
	{
		alert("Please Enter Your Phone No!") ;
		rfi.phone.focus() ;
		return false;
	}
	
		
		if (!rfi.phone.value.match(/^[0-9]/))
		{
			alert("Please enter a valid Phone No!");
			rfi.phone.focus();
			rfi.phone.value="";
			return false;
		}
	
	if(rfi.email.value=="")
	{
		alert("Please Enter Your Email ID!") ;
		rfi.email.focus() ;
		return false;
	}
	
		if (!rfi.email.value.match(/^[\w\.\-]+@([\w\-]+\.)+[a-zA-Z]+$/))
		{
			alert("Please enter a valid E-mail ID!");
			rfi.email.focus();
			rfi.email.value="";
			return false;
		}
		
				myOption = -1;
	for (i=rfi.lotowner.length-1; i > -1; i--) 
	{
		if (rfi.lotowner[i].checked) {
			myOption = i; i = -1;
		}
	}
	if (myOption == -1) {
	alert("Please Select Lot Owner!");
	return false;
	}
		
	if(rfi.lotlocation.value=="")
	{
		alert("Please Enter Your Lot Location!") ;
		rfi.lotlocation.focus() ;
		return false;
	}
	
		if(rfi.lotlocation.value=="")
		{
			alert("Please Enter Your Lot Location!") ;
			rfi.lotlocation.focus() ;
			return false;
		}
		
	if(rfi.lotpotentiallocation.value=="")
	{
		alert("Please Enter Your Lot Potential Location!") ;
		rfi.lotpotentiallocation.focus() ;
		return false;
	}
	
		if(rfi.lotpotentiallocation.value=="")
		{
			alert("Please Enter Your Lot Potential Location!") ;
			rfi.lotpotentiallocation.focus() ;
			return false;
		}

	if(rfi.hometype.value=="")
	{
		alert("Please Enter Your Type of home") ;
		rfi.hometype.focus() ;
		return false;
	}
	
		if(rfi.hometype.value=="")
		{
			alert("Please Enter Your Type of home!") ;
			rfi.hometype.focus() ;
			return false;
		}
		
		if(rfi.comment.value=="")
	{
		alert("Please Enter Your Comments or Questions!") ;
		rfi.comment.focus() ;
		return false;
	}
	
		if(rfi.comment.value=="")
		{
			alert("Please Enter Your Comments or Questions!") ;
			rfi.comment.focus() ;
			return false;
		}

	//Select box validation	
		if(rfi.aboutus.value=="select")
	{
		alert ('Select a aboutus!');
		rfi.aboutus.focus() ;
		return false;
	}
	


		
SendEmailData(rfi); 
	return false ;
}

