function showfor(f,thissel)
{
	var xmlHttp;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch (e)
			{
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			document.getElementById('showfor').innerHTML=xmlHttp.responseText;
			document.getElementById('hidefor').style.display='none';
		}
	}
	xmlHttp.open('GET','get_for.php?sel='+thissel,true);
	xmlHttp.send(null);
}

function showcityname(thissel)
{					
	var xmlHttp;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch (e)
			{
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() 
	{
		if(xmlHttp.readyState==4)
		{ 
			document.getElementById("showcity").innerHTML=xmlHttp.responseText; 
			document.getElementById('hidecity').style.display='none';
		} 
	}
	xmlHttp.open('GET','get_city_name.php?sel='+thissel,true);
	xmlHttp.send(null);
}

function showlocname(thissel)
{
	//$display.="alert(thissel);\r\n";
	var xmlHttp;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch (e)
			{
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4) 
		{
			document.getElementById("showloc").innerHTML=xmlHttp.responseText;
			document.getElementById('hideloc').style.display='none';
		} 
	}
	//$display.="alert(thissel);\r\n";
	xmlHttp.open('GET','get_location_name.php?city='+thissel,true);
	xmlHttp.send(null);
}

function showprotype(thissel)
{
	//$display.="alert(thissel);\r\n";
	var xmlHttp;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			}
			catch (e)
			{
				alert('Your browser does not support AJAX!');
				return false;
			}
		}
	}
	
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			document.getElementById('showtype').innerHTML=xmlHttp.responseText;
			document.getElementById('hidetype').style.display='none';
		}
	}
	xmlHttp.open('GET','get_type.php?sel='+thissel,true);
	xmlHttp.send(null);
}				



function checkproid(f)
{
	if(document.getElementById('txtpropid').value == ''){
		alert('Please Give Property Id'); 
		document.getElementById('txtpropid').focus();
		return false; 
	}
}

function IsNumeric(val){return(parseFloat(val,10)==(val*1));}

function checkadvsrch(f)
{
	if(document.getElementById('or_state').value == '0'){
		alert('Please Select State'); 
		document.getElementById('or_state').focus();
		return false; 
}
	
	if((document.getElementById('txtcarea1').value != '') && (document.getElementById('txtcarea2').value == '')){
		alert('Please enter value in 2nd col. in the covered area field'); 
		document.getElementById('txtcarea2').focus();
		return false; 
	}
	if((document.getElementById('txtcarea1').value == '') && (document.getElementById('txtcarea2').value != '')){
		alert('Please enter value in 1st col. in the covered area field');
		document.getElementById('txtcarea1').focus();
		return false; 
}
	if(document.getElementById('txtcarea1').value != '') {
		if(!IsNumeric(document.getElementById('txtcarea1').value)){
			alert('Please enter only numbers in the covered area field');
			document.getElementById('txtcarea1').focus();
			return false; 
		}
	}
	if(document.getElementById('txtcarea2').value != '') {
		if(!IsNumeric(document.getElementById('txtcarea2').value)){
			alert('Please enter only numbers in the covered area field'); 
			document.getElementById('txtcarea2').focus();
			return false; 
		}
	}
	if((document.getElementById('txtcarea1').value) > (document.getElementById('txtcarea2').value)){
		alert('Value in 2nd col. should be greater then 1st col. in the covered area feild.'); 
		document.getElementById('txtcarea2').focus();
		return false; 
	}
	
	if((document.getElementById('txtlarea1').value != '') && (document.getElementById('txtlarea2').value == '')){
		alert('Please enter value in 2nd col. in the Plot/Land Area field'); 
		document.getElementById('txtlarea2').focus();
		return false; 
	}
	if((document.getElementById('txtlarea1').value == '') && (document.getElementById('txtlarea2').value != '')){
		alert('Please enter value in 1st col. in the Plot/Land Area field'); 
		document.getElementById('txtlarea1').focus();
		return false; 
	}
	if(document.getElementById('txtlarea1').value != '') {
		if(!IsNumeric(document.getElementById('txtlarea1').value)){
			alert('Please enter only numbers in the Plot/Land Area field'); 
			document.getElementById('txtlarea1').focus();
			return false;
		}
	}
	if(document.getElementById('txtlarea2').value != '') {
		if(!IsNumeric(document.getElementById('txtlarea2').value)){
			alert('Please enter only numbers in the Plot/Land Area field');
			document.getElementById('txtlarea2').focus();
			return false;
		}
	}
	if((document.getElementById('txtlarea1').value) > (document.getElementById('txtlarea2').value)){
		alert('Value in 2nd col. should be greater then 1st col. in the Plot/Land Area feild.'); 						document.getElementById('txtlarea2').focus();
		return false; 
	}
}				
///////////////////////////////////
