function fun()
{
	if(document.form.txtccode.value.length==3)
	{
		document.form.txtscode.focus();	
	}
}
function fun1()
{
	if(document.form.txtscode.value.length==3)
	{
		document.form.txtphone.focus();	
	}
}
function mbl()
{
	if(document.form.txtmccode.value.length==3)
	{
		document.form.txtmscode.focus();	
	}
}
function mbl1()
{
	if(document.form.txtmscode.value.length==3)
	{
		document.form.txtmblno.focus();	
	}
}



function chkhomeowner()
{
	if (document.form.txtfname.value.length==0){
		alert("Please enter First Name.");
			document.form.txtfname.focus();
		return false;
	}
	if (document.form.txtlname.value.length==0){
		alert("Please enter Last Name.");
			document.form.txtlname.focus();
		return false;
	}
	/*if(document.form.sltcountrycode.value=="")
	{
		alert("Please Select Country Code.");
		document.form.sltcountrycode.focus();
		return false;
	}
	if(document.form.txtareacode.value.length==0 || isNaN(document.form.txtareacode.value))
	{
		alert("Please Enter Area Code.");
		document.form.txtareacode.value="";
		document.form.txtareacode.focus();
		return false;
	}*/
	/*else if(document.form.txtareacode.value.length<4)
	{
		alert("Please Enter Maximum 6 Nos Of Area Code.");
		document.form.txtareacode.value="";
		document.form.txtareacode.focus();
		return false;	
	}*/
	/*if(document.form.txtphone.value.length==0 || isNaN(document.form.txtphone.value))
	{
		alert("Please Enter Phone No.");
		document.form.txtphone.value="";
		document.form.txtphone.focus();
		return false;
	}*/
/*	if(document.form.sltmcountrycode.value=="")
	{
		alert("Please Select Country Code of Mobile.");
		document.form.sltmcountrycode.focus();
		return false;
	}
	if(document.form.txtmareacode.value.length==0 || isNaN(document.form.txtmareacode.value))
	{
		alert("Please Enter Area Code Of Mobile.");
		document.form.txtmareacode.value="";
		document.form.txtmareacode.focus();
		return false;
	}*/
	/*else if(document.form.txtmareacode.value.length<4)
	{
		alert("Please Enter Maximum 6 Nos Of Area Code.");
		document.form.txtmareacode.value="";
		document.form.txtmareacode.focus();
		return false;	
	}*/
	/*if(document.form.txtmblno.value.length==0 || isNaN(document.form.txtmblno.value))
	{
		alert("Please Enter Mobile No.");
		document.form.txtmblno.value="";
		document.form.txtmblno.focus();
		return false;
	}*/
	if (document.form.txtemailid.value.length==0){
		alert("Please enter Email Address.");
			document.form.txtemailid.focus();
		return false;
	}
	else if(!checkMail(document.form.txtemailid.value))
	{
		alert("Invalid Email Address.");
			document.form.txtemailid.value="";
			document.form.txtemailid.focus();
		return false;
	}
	if (document.form.password.value.length==0){
			alert("Please enter Password.");
			document.form.password.focus();
		return false;
	}
	if (document.form.password.value.length<=6){
			alert("Password must be of 7 characters or more.");
			document.form.password.focus();
		return false;
	}
	if (document.form.confirmpassword.value.length==0){
			alert("Please enter Confirm Password.");
			document.form.confirmpassword.focus();
		return false;
	}
	if (document.form.password.value!==document.form.confirmpassword.value){
		alert("Password and Confirm Password both should be same.");
		document.form.confirmpassword.value="";
		document.form.confirmpassword.focus();
		return false;
	}
	/*if (document.form.txtpromocode.value.length==0){
			alert("Please enter Promo Code.");
			document.form.txtpromocode.focus();
		return false;
	}*/
	
	
	
	
	if (document.form.txtfindfrom.value=="Select" && document.form.txtfindfrom1.value.length==0){
			alert("Please select how did you find us? or specify other.");
			document.form.txtfindfrom.focus();
		return false;
	}
	
	if (document.form.txtfindfrom.value=="Other" && document.form.txtfindfrom1.value.length==0){
			alert("Please specify how did you find us?");
			document.form.txtfindfrom1.focus();
		return false;
	}
	
	/*if (document.form.txtfindfrom.value!="Select" && document.form.txtfindfrom1.value.length!=0){
			alert("Please select how did you find us? or specify other, Any one.");
			document.form.txtfindfrom.focus();
		return false;
	}*/
	
	if (document.form.trno.value.length==0){
		alert("Please enter security code.");
		document.form.trno.focus();
		return false;
	}
	
/*	if (document.form.password.value.length==0){
		if(cond==true){
			alert("Please enter Password.");
			document.form.password.focus();
		}
		cond=false;
		return false;
	}
	if (document.form.password.value.length==0){
		if(cond==true){
			alert("Please enter Password.");
			document.form.password.focus();
		}
		cond=false;
		return false;
	}
	if (document.form.password.value.length==0){
		if(cond==true){
			alert("Please enter Password.");
			document.form.password.focus();
		}
		cond=false;
		return false;
	}*/

}
function checkMail(email){
var x = email;
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(x)){
	 return true;
	}
	else {
	  return false;
	}
}
function chk_homeownerlogin()
{
	if (document.form.txtownerid.value.length==0){
		alert("Please Enter Owner Id.");
		document.form.txtownerid.focus();
		return false;
	}
	else if(!checkMail(document.form.txtownerid.value))
	{
		alert("Invalid Email Address.");
			document.form.txtownerid.value="";
			document.form.txtownerid.focus();
		return false;
	}
	if (document.form.txtpwd.value.length==0){
		alert("Please Enter Password.");
		document.form.txtpwd.focus();
		return false;
	}
	if (document.form.trno.value.length==0){
		alert("Please Enter Security code.");
		document.form.trno.focus();
		return false;
	}
}
function vali()
{
	if (document.form.txtaddress.value.length==0){
			alert("Please enter Address.");
			document.form.txtaddress.focus();
		return false;
	}
	if (document.form.txtcity.value.length==0){
			alert("Please enter City.");
			document.form.txtcity.focus();
		return false;
	}
	if (document.form.txtstate.value.length==0){
			alert("Please enter Region.");
			document.form.txtstate.focus();
		return false;
	}
	if (document.form.txtzipcode.value.length==0){
			alert("Please enter Post Code.");
			document.form.txtzipcode.value="";
			document.form.txtzipcode.focus();
		return false;
	}
	if (document.form.txtcountry.value.length==0){
			alert("Please enter Country.");
			document.form.txtcountry.focus();
		return false;
	}
	var a=document.form.elements["chkspeaklang[]"];
	var cnt=0;
	for(i = 0;i < a.length;i++)
	{
		if (a[i].checked==true)
		{
			cnt=1;
	 		break;
		}
	}
	if(cnt==0)
	{
		alert("At least one must be checked");
		return false;
	}
	
	if (document.form.txtcntmethod.value.length==0){
			alert("Please enter Contact Method.");
			document.form.txtcntmethod.focus();
		return false;
	}
	if (document.form.trno.value.length==0){
		alert("Please Enter Security code.");
		document.form.trno.focus();
		return false;
	}
	if (document.form.chkrecievemsg.checked==true){
		
		if (document.form.txtsmsno.value.length==0 || isNaN(document.form.txtsmsno.value)){
			alert("Please enter  Proper SMS No.");
			document.form.txtsmsno.focus();
		return false;
	}
	}
return true;
}