function getHTTPObject()
{
	var xmlHttp;
	try
	{
		xmlHttp=new XMLHttpRequest(); 		// Firefox, Opera 8.0+, Safari
		return xmlHttp;
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
			return xmlHttp;
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				return xmlHttp;			
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}	 
}
httpObject = getHTTPObject();
function PropertyCatOnChange_code()
{	
 	if (httpObject!="") 
	{ 
		var params;		
		var continentList = document.getElementById("drppropcountry");	
		var selectedContinent = continentList.options[continentList.selectedIndex].value;
		params = "&countryid="+selectedContinent;

 		httpObject.open("POST", "LoadTypeCombo_country_code.php",true);
 		httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		httpObject.setRequestHeader("Content-length", params.length);
		httpObject.setRequestHeader("Connection", "close");
		httpObject.send(params);
		
		httpObject.onreadystatechange = function(){
			if(httpObject.readyState==4)
			{
				var results =  Trim(httpObject.responseText); 
				document.getElementById("contact_country_code").value = results;
 			}	
		}
 	}  
}
function Trim(s)
{
	while ((s.substring(0,1) == ' ') || (s.substring(0,1) == '\n') || (s.substring(0,1) == '\r'))
	{
		s = s.substring(1,s.length);
	}
	while ((s.substring(s.length-1,s.length) == ' ') || (s.substring(s.length-1,s.length) == '\n') || 	(s.substring(s.length-1,s.length) == '\r'))
	{
		s = s.substring(0,s.length-1);
	}
	return s;
}
function adv_check()
{
	if(document.addproperty.aname.value.length < 1)
	{
		alert('Please Enter Name');
		document.addproperty.aname.focus();
		return false;
	}
	
	if(document.addproperty.drpdowncountry.value == 0)
	{
		alert('Please Select Country');
		document.addproperty.drpdowncountry.focus();
		return false;
	}
	
	if((document.addproperty.contact_country_code.value).length < 1)
		{
		alert('Please Enter Country Code');
		document.addproperty.contact_country_code.focus();
		return false;
		}
	
	if((document.addproperty.contact_landline.value).length < 1 && (document.addproperty.contact_mobie.value).length < 1)
		{
		alert('Atlest one Phone Number is required');
		document.addproperty.contact_landline.focus();
		return false;
		}
		
		
		if(!IsNumeric(document.addproperty.contact_landline.value))
			{
			alert('Please Enter Land-line Number as Number');
			document.addproperty.contact_landline.value="";
			document.addproperty.contact_landline.focus();
			return false;
			}
		
		if(!IsNumeric(document.addproperty.contact_mobie.value))
			{
			alert('Please Enter Mobile Number as Number');
			document.addproperty.contact_mobie.value="";
			document.addproperty.contact_mobie.focus();
			return false;
			}
		
		
		if((document.addproperty.textemail.value).length < 1)		
		{
			alert('Please Enter Email ID');
			document.addproperty.textemail.value="";
			document.addproperty.textemail.focus();
			return false;
		}
		if(echeck(document.addproperty.textemail.value)==false)
		{
			document.addproperty.textemail.value="";
			document.addproperty.textemail.focus();
			return false;
		}
	/*if(document.addproperty.companyname.value.length<1)
		{
			alert('Please Enter Company name');
			
			document.addproperty.companyname.focus();
			return false;
		}
		
	if((document.addproperty.fax.value).length < 1)
		{
		alert('Please Enter Fax Number');
		document.addproperty.fax.focus();
		return false;
		}


		if(!IsNumeric(document.addproperty.fax.value))
			{
			alert('Please Enter Fax Number as Number');
			document.addproperty.fax.value="";
			document.addproperty.fax.focus();
			return false;
			}*/
	/*if(document.addproperty.password.value.length < 6)
	{
		alert('Please enter Password of Min 6 characters ');
		 document.addproperty.password.value="";
		document.addproperty.password.focus();
		return false;
	}
	
	if(document.addproperty.conf_password.value.length < 1)
	{
		alert('Please enter Confirm Password ');
		document.addproperty.conf_password.focus();
		return false;
	}
	
	if(document.addproperty.conf_password.value!=document.addproperty.password.value)
	{
		alert('Password and Confirm Password must be same !');
		document.addproperty.conf_password.focus();
		return false;
	}
	if(document.addproperty.country.value==0)
	{
		alert('Please enter Country');
		document.addproperty.country.focus();
		return false;
	}
	if(document.addproperty.ph_country_code.value.length < 1 )
	{
		alert('Please enter  Country Code ');
		document.addproperty.ph_country_code.focus();
		return false;
	}
	if( document.addproperty.ph_landline.value.length < 1 &&  document.addproperty.ph_mobile.value.length < 1)
	{
		alert('Please enter Atleast one phone number ');
		document.addproperty.ph_landline.focus();
		return false;
	}
	if(document.addproperty.ph_landline.value.length >= 1 && IsNumeric(document.addproperty.ph_landline.value)==false)
	{
		alert('Please enter Numeric Value for Landline number ');
		document.addproperty.ph_landline.focus();
		return false;
	}

	if(document.addproperty.ph_mobile.value.length >= 1 && IsNumeric(document.addproperty.ph_mobile.value)==false)
	{
		alert('Please enter Numeric Value for Mobile number ');
		document.addproperty.ph_mobile.focus();
		return false;
	}
	if(document.addproperty.user_email.value.length<1)
	{
		alert('Please enter Email');
		document.addproperty.user_email.focus();
		return false;
	}
	if (echeck(document.addproperty.user_email.value)==false)
	{
         document.addproperty.user_email.value="";
         document.addproperty.user_email.focus();
        
         return false;
    }*/
	//document.addproperty.submit();
	
}