///var site_url ='http://www.indiarealtors.com/irs/';
loc1 = location.href;
wwwloc=loc1.indexOf("www");
if(wwwloc>0)
	var site_url ='http://www.indiarealtors.com/';
else
	var site_url ='http://indiarealtors.com/';
/*if(wwwloc>0)
	var site_url ='http://sys4/irs/';
else
	var site_url ='http://sys4/irs/';
	*/
var xmlHttp;
var id;
//************* Xml object creation for ajax**********	
function GetXmlHttpObject(handler)
{
	var objXmlHttp=null
	if (navigator.userAgent.indexOf("Opera")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler
		return objXmlHttp
	}
	if (navigator.userAgent.indexOf("MSIE")>=0)
	{
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
		{
			strName="Microsoft.XMLHTTP"
		}
		try
		{
			objXmlHttp=new ActiveXObject(strName)
			objXmlHttp.onreadystatechange=handler
			return objXmlHttp
		}
		catch(e)
		{
			alert("Error. Scripting for ActiveX might be disabled")
			return
		}
	}
	if (navigator.userAgent.indexOf("Mozilla")>=0)
	{
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler
		return objXmlHttp
	}
} 
	
function Addsold(id2,qrystring){
	
	idcataSR = id2;
	var url=site_url+"forms/sold-ajax-report.php?"+qrystring;
	alert(url);
	xmlHttpm=GetXmlHttpObject(Addsoldchanged);
	xmlHttpm.open("GET", url , true);
	xmlHttpm.send(null);
}
function Addsoldchanged(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
} 
	function showDialect3(str,id2){
			idcata = id2;
			var url=site_url+"common/cat_list.php?cat=" + str;
			xmlHttp=GetXmlHttpObject(stateChanged3);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function stateChanged3(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	function showDialect5(str,id2,id3){
			idcata = id2;
			var url=site_url+"common/cat_list.php?cat=" + str+"&Selected=" + id3;
			xmlHttp=GetXmlHttpObject(stateChanged5);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}
	function showDialectadvanced(str,id2,id3){
			idcata = id2;
			var url=site_url+"common/cat_list.php?cat=" + str+"&Selected=" + id3;
			xmlHttp=GetXmlHttpObject(stateChanged5);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}
	function showDialect5new(str,id2,id3){
			idcata = id2;
			var url=site_url+"common/cat_list_multiple.php?cat=" + str+"&Selected=" + id3;
			xmlHttp=GetXmlHttpObject(stateChanged5);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}
	function stateChanged5(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	//////////
	function showDialectcrs(str,id2,id3){
			showirs();
			idcata = id2;
			var url=site_url+"common/crs_list.php?cat=" + str+"&Selected=" + id3;
			xmlHttp=GetXmlHttpObject(stateChangedcrs);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function stateChangedcrs(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	function showDialectirs(str,id2,id3){
			showcrs();
			idcata = id2;
			var url=site_url+"common/crs_list.php?cat=" + str+"&Selected=" + id3;
			xmlHttp=GetXmlHttpObject(stateChangedirs);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function stateChangedirs(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 


	function showuseravailChanged(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
				document.getElementById('TipName').style.display="";
				document.getElementById('load').style.display="none";
				document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	function showuseravail(name,id2){
			document.getElementById('TipName').style.display="none";
			document.getElementById('load').style.display="";	
			idcata = id2;
			var url=site_url+"common/useravail.php?name=" + name;
			xmlHttp=GetXmlHttpObject(showuseravailChanged);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}
	/////
	function showDialectnotifyp(pid,id2,uid,status,rec){
			idcata = id2;
			var url=site_url+"common/notifyp.php?pid=" + pid+"&uid=" + uid+"&status=" + status+"&rec=" + rec;
			xmlHttp=GetXmlHttpObject(stateChangedirs);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
		}
	
	function showFeatures(pid,tr_id,uid,feature){
			switch (tr_id)
			{
				case 'intf':
					document.all.intf.style.display = '';
					break;
				case 'landmks':
					document.all.landmks.style.display = '';
					break;
				case 'extf':
					document.all.extf.style.display = '';
					break;
				case 'visif':
					document.all.visif.style.display = '';
					break;
				case 'otherusesf':
					document.all.otherusesf.style.display = '';
					break;
				case 'otherdetf':
					document.all.otherdetf.style.display = '';
					break;
			}
			idfeature = tr_id;
			var url=site_url+"common/viewfeatures.php?pid="+pid+"&uid="+uid+"&feature="+feature;
			xmlHttp=GetXmlHttpObject(propertyfeatures);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function hideFeatures(pid,tr_id,uid,feature){
			switch (tr_id)
			{
				case 'intf':
					document.all.intf.style.display = 'none';
					break;
				case 'landmks':
					document.all.landmks.style.display = 'none';
					break;
				case 'extf':
					document.all.extf.style.display = 'none';
					break;
				case 'visif':
					document.all.visif.style.display = 'none';
					break;
				case 'otherusesf':
					document.all.otherusesf.style.display = 'none';
					break;
				case 'otherdetf':
					document.all.otherdetf.style.display = 'none';
					break;
				case 'locate':
					document.all.locate.style.display = 'none';
					break;
			}

	}

	function propertyfeatures(){ 	
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
				document.getElementById(idfeature).innerHTML=xmlHttp.responseText ;
			}
	} 
	
	

	function sendEnquiry(url,tr_id,id,list,total){
		var theArray = new Array(); 
		var theArray = list.split(",");
		for(var i=0;i<total;i++)
		{
			document.getElementById("sendenq"+theArray[i]).style.display = 'none';
		}
			idfeature = tr_id;
			var url=site_url+url+"&id="+id;
			xmlHttpenq=GetXmlHttpObject(sqry);
			xmlHttpenq.open("GET", url , true);
			xmlHttpenq.send(null);
	}
	function sqry(){ 	
			if (xmlHttpenq.readyState==4 || xmlHttpenq.readyState=="complete"){ 
				document.getElementById(idfeature).style.display = '';
				document.getElementById(idfeature).innerHTML=xmlHttpenq.responseText ;
			}
	} 
	function hideenq(tr_id){
		document.getElementById(tr_id).style.display = 'none';
	}
	
	function enqreport(url,tr_id){
			idfeature = tr_id;
			var url=site_url+url;
			xmlHttprep=GetXmlHttpObject(sqryrep);
			xmlHttprep.open("GET", url , true);
			xmlHttprep.send(null);
	}
	function sqryrep(){ 	
			if (xmlHttprep.readyState==4 || xmlHttprep.readyState=="complete"){ 
				document.getElementById(idfeature).innerHTML=xmlHttprep.responseText ;
			}
	} 
	//Pie chart and bar Chart
	function showstatimage(user,slimit,page,tr_id,fromdate){
			document.getElementById('stat').style.display="none";
			document.getElementById('load4').style.display="";	
			idfeature = tr_id;
			var url=site_url+"forms/piebyviews.php?user="+user+"&slimit="+slimit+"&page="+page+"&fromdate="+fromdate;
			xmlHttprep=GetXmlHttpObject(sstat);
			xmlHttprep.open("GET", url , true);
			xmlHttprep.send(null);
	}
	
	function sstat(){ 	
			if (xmlHttprep.readyState==4 || xmlHttprep.readyState=="complete"){ 
				document.getElementById('stat').style.display="";
				document.getElementById('load4').style.display="none";	
				document.getElementById(idfeature).innerHTML=xmlHttprep.responseText ;
			}
	} 
	function showPollresults(pid,tr_id,answer){
			idfeature = tr_id;
			var url=site_url+"common/pollresult.php?pollid="+pid+"&answer="+answer;
			xmlHttp=GetXmlHttpObject(propertyfeatures);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}
	function viewPollresults(pid,tr_id,res){
			idfeature = tr_id;
			var url=site_url+"common/pollresult.php?polid="+pid+"&res="+res;
			xmlHttp=GetXmlHttpObject(propertyfeatures);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}
	function showPoll(tr_id){
			idfeature = tr_id;
			var url=site_url+"forms/poll1.php?db=1";
			xmlHttp=GetXmlHttpObject(propertyfeatures);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}
	function Cat_noMan(str,id2){
			idcata = id2;
			var url=site_url+"common/cat_list_noMan.php?cat=" + str;
			xmlHttp=GetXmlHttpObject(Cat_noMan_Text);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function Cat_noMan_Text(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
	} 
	function showDialect4(str,id2){
			idCity = id2;
			var url=site_url+"common/city_list.php?getState=" + str;
			xmlHttp=GetXmlHttpObject(stateChanged4);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function stateChanged4(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idCity).innerHTML=xmlHttp.responseText;
			}
	} 
	
	/*function Quick_Search(str,id2){
			idCity = id2;
			var url=site_url+"common/city_list_noMan.php?getState=" + str;
			xmlHttp=GetXmlHttpObject(Quick_SearchText);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}*/

	

	function Quick_Search(str,id2,id3){
		if(id2=='City1')
		{
			document.getElementById('City1').style.display="none";
		}
		else
		{
			document.getElementById('Citybuyer').style.display="none";
		}
			document.getElementById('load').style.display="";		
			idCity = id2;
			var url=site_url+"common/city_list_noMan.php?getState=" + str+"&sesscity=" + id3;
			xmlHttp=GetXmlHttpObject(Quick_SearchText);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function Quick_SearchText(){ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
			if(idCity=='City1')
			{
				document.getElementById('City1').style.display="";
			}
			else
			{
				document.getElementById('Citybuyer').style.display="";
			}
			document.getElementById('load').style.display="none";
					document.getElementById(idCity).innerHTML=xmlHttp.responseText ;
			}
	}
	function loadsearcresults()
	{
		document.getElementById('searchresult').style.display="none";
		document.getElementById('load').style.display="";	
		document.getElementById('searchresulttop').style.display="none";
		document.getElementById('loadtop').style.display="";
		document.getElementById('searchresulttoploc').style.display="none";
		document.getElementById('loadtoploc').style.display="";
	}
	function unloadsearcresults()
	{
			document.getElementById('load').style.display="none";
			document.getElementById('searchresult').style.display="";	
			document.getElementById('loadtop').style.display="none";
			document.getElementById('searchresulttop').style.display="";
			document.getElementById('loadtoploc').style.display="none";
			document.getElementById('searchresulttoploc').style.display="";
	}
	function loadsearcresultsall()
	{
		document.getElementById('searchresultall').style.display="none";
		document.getElementById('loadall').style.display="";	
	}
	function unloadsearcresultsall()
	{
			document.getElementById('loadall').style.display="none";
			document.getElementById('searchresultall').style.display="";	
	}
	function showsearchresultsChanged(){ 
			if (xmlHttpSR.readyState==4 || xmlHttpSR.readyState=="complete")
			{ 
				document.getElementById('loadallnew').style.display="none";
				document.getElementById('searchresultallnew').style.display="";
				document.getElementById(idcataSR).innerHTML=xmlHttpSR.responseText ;
			}
	} 
	function showsearchresults(id2,qrystring){
			document.getElementById('loadallnew').style.display="";	
			document.getElementById('searchresultallnew').style.display="none";
			idcataSR = id2;
			var url=site_url+"forms/searchresults_propertiesajax.php?"+qrystring;
			xmlHttpSR=GetXmlHttpObject(showsearchresultsChanged);
			xmlHttpSR.open("GET", url , true);
			xmlHttpSR.send(null);
	}
	function showbrowseresultsChanged(){ 
			if (xmlHttpSR.readyState==4 || xmlHttpSR.readyState=="complete")
			{ 
				document.getElementById('loadbrowse').style.display="none";
				document.getElementById('browseresult').style.display="";
				document.getElementById(idcataSR).innerHTML=xmlHttpSR.responseText ;
				if(opr=="cat")
				{
					idtopnew="<a href='browsebycategory.php'>Browse Property</a> -> "+catval;
					document.getElementById('browse').innerHTML=idtopnew;
				}
				else if(opr=="typ")
				{
					idtopnew="<a href='browsebycategory.php'>Browse Property</a> -> <a href=javascript:showbrowseresults('browseresult','cat','"+catval+"','','"+catidval+"','','"+qry+"');>"+catval+"</a> ->  "+typeval;
					document.getElementById('browse').innerHTML=idtopnew;
				}
				else if(opr=="citi")
				{
					idtopnew="<a href='browsebycategory.php'>Browse Property</a> -> <a href=javascript:showbrowseresults('browseresult','cat','"+catval+"','','"+catidval+"','','"+qry+"');>"+catval+"</a> ->  <a href=javascript:showbrowseresults('browseresult','typ','"+catval+"','"+typeval+"','"+catidval+"','','"+qry+"');>"+typeval+"</a> -> "+citival;
					document.getElementById('browse').innerHTML=idtopnew;
				}
			}
	} 
	function showbrowseresults(id2,op,cat,type,catid,citi,qrystring){
			document.getElementById('loadbrowse').style.display="";	
			document.getElementById('browseresult').style.display="none";
			idcataSR = id2;
			catval = cat;
			typeval = type;
			opr=op;
			citival=citi;
			catidval=catid;
			catidvalue="&type="+typeval+"&CategoryName="+catval+"&catid="+catidval+"&opr="+opr;
			qry=qrystring+catidvalue;
			var url=site_url+"forms/browse_properties.php?"+qry;
			xmlHttpSR=GetXmlHttpObject(showbrowseresultsChanged);
			xmlHttpSR.open("GET", url , true);
			xmlHttpSR.send(null);
	}
	function showbrowsetopChanged(){ 
			if (xmlHttpTop.readyState==4 || xmlHttpTop.readyState=="complete")
			{ 
				document.getElementById(idcataTop).innerHTML=xmlHttpTop.responseText ;
			}
	} 
	function showbrowsetop(id2,qrystring){
			idcataTop = id2;
			var url=site_url+"forms/browsecategory-top.php?"+qrystring;
			xmlHttpTop=GetXmlHttpObject(showbrowsetopChanged);
			xmlHttpTop.open("GET", url , true);
			xmlHttpTop.send(null);
	}
	function showbrowsepropresultsChanged(){ 
			if (xmlHttpSR.readyState==4 || xmlHttpSR.readyState=="complete")
			{ 
				document.getElementById('loadbrowse').style.display="none";
				document.getElementById('browsepropresult').style.display="";
				document.getElementById(idcataSR).innerHTML=xmlHttpSR.responseText ;
			}
	} 
	function showbrowsepropresults(id2,qrystring){
			document.getElementById('loadbrowse').style.display="";	
			document.getElementById('browsepropresult').style.display="none";
			idcataSR = id2;
			var url=site_url+"forms/browseresults_properties.php?"+qrystring;
			xmlHttpSR=GetXmlHttpObject(showbrowsepropresultsChanged);
			xmlHttpSR.open("GET", url , true);
			xmlHttpSR.send(null);
	}
	function showbrowsepropresultsChanged1(){ 
			if (xmlHttpSR.readyState==4 || xmlHttpSR.readyState=="complete")
			{ 
				document.getElementById('loadbrowsenew').style.display="none";
				document.getElementById('browseresultnew').style.display="";
				document.getElementById(idcataSR).innerHTML=xmlHttpSR.responseText ;
			}
	} 
	function showbrowsepropresults1(id2,qrystring){
			document.getElementById('loadbrowsenew').style.display="";	
			document.getElementById('browseresultnew').style.display="none";
			idcataSR = id2;
			var url=site_url+"forms/browseresults_properties.php?"+qrystring;
			xmlHttpSR=GetXmlHttpObject(showbrowsepropresultsChanged1);
			xmlHttpSR.open("GET", url , true);
			xmlHttpSR.send(null);
	}
	function showbrowsepropresultsChanged2(){ 
			if (xmlHttpSR.readyState==4 || xmlHttpSR.readyState=="complete")
			{ 
				document.getElementById('loadbrowsenew').style.display="none";
				document.getElementById('browseresultnew').style.display="";
				document.getElementById(idcataSR).innerHTML=xmlHttpSR.responseText ;
			}
	} 
	// now working//
	function showbrowsepropresults2(id2,qrystring){
			document.getElementById('loadbrowsenew').style.display="";	
			document.getElementById('browseresultnew').style.display="none";
			idcataSR = id2;
			var url=site_url+"forms/browseresults_properties_new.php?"+qrystring;
			xmlHttpSR=GetXmlHttpObject(showbrowsepropresultsChanged2);
			xmlHttpSR.open("GET", url , true);
			xmlHttpSR.send(null);
	}
		//// Advanced Search
	function Quick_Searchadv(str,id2,id3){
			document.getElementById('City2').style.display="none";
			document.getElementById('load2').style.display="";			
			idCityadv = id2;
			var url=site_url+"common/city_list_noMan.php?getState=" + str+"&sesscity=" + id3;
			xmlHttpadv=GetXmlHttpObject(Quick_SearchnewTextadv);
			xmlHttpadv.open("GET", url , true);
			xmlHttpadv.send(null);
	}

	function Quick_SearchnewTextadv(){ 
			if (xmlHttpadv.readyState==4 || xmlHttpadv.readyState=="complete"){ 
				document.getElementById('City2').style.display="";
				document.getElementById('load2').style.display="none";
				document.getElementById(idCityadv).innerHTML=xmlHttpadv.responseText ;
			}
	} 
		//// Location Search
	function Quick_Searchloc(str,id2,id3){
			document.getElementById('City3').style.display="none";
			document.getElementById('load3').style.display="";	
			idCityloc = id2;
			var url=site_url+"common/city_list_noMan.php?getState=" + str+"&sesscity=" + id3;
			xmlHttploc=GetXmlHttpObject(Quick_SearchnewTextloc);
			xmlHttploc.open("GET", url , true);
			xmlHttploc.send(null);
	}

	function Quick_SearchnewTextloc(){ 
			if (xmlHttploc.readyState==4 || xmlHttploc.readyState=="complete"){ 
				document.getElementById('City3').style.display="";
				document.getElementById('load3').style.display="none";
				document.getElementById(idCityloc).innerHTML=xmlHttploc.responseText ;
			}
	} 
		//// City Search
	function Quick_Searchcity(str,id2,id3){
			document.getElementById('City4').style.display="none";
			document.getElementById('load4').style.display="";			
			idCitycity = id2;
			var url=site_url+"common/city_list_noMan.php?getState=" + str+"&sesscity=" + id3;
			xmlHttpcity=GetXmlHttpObject(Quick_SearchnewTextcity);
			xmlHttpcity.open("GET", url , true);
			xmlHttpcity.send(null);
	}

	function Quick_SearchnewTextcity(){ 
			if (xmlHttpcity.readyState==4 || xmlHttpcity.readyState=="complete"){ 
				document.getElementById('City4').style.display="";
				document.getElementById('load4').style.display="none";
				document.getElementById(idCitycity).innerHTML=xmlHttpcity.responseText ;
			}
	} 
			//// Feature Search
	function Quick_Searchfeature(str,id2,id3){
			document.getElementById('City5').style.display="none";
			document.getElementById('load5').style.display="";			
			idCityfeature = id2;
			var url=site_url+"common/city_list_noMan.php?getState=" + str+"&sesscity=" + id3;
			xmlHttpfeature=GetXmlHttpObject(Quick_SearchnewTextfeature);
			xmlHttpfeature.open("GET", url , true);
			xmlHttpfeature.send(null);
	}

	function Quick_SearchnewTextfeature(){ 
			if (xmlHttpfeature.readyState==4 || xmlHttpfeature.readyState=="complete"){ 
				document.getElementById('City5').style.display="";
				document.getElementById('load5').style.display="none";
				document.getElementById(idCityfeature).innerHTML=xmlHttpfeature.responseText ;
			}
	} 
		//// Realtor Search
	function Quick_Searchrealtor(str,id2,id3){
			document.getElementById('City6').style.display="none";
			document.getElementById('load6').style.display="";			
			idCityrealtor = id2;
			var url=site_url+"common/city_list_noMan.php?getState=" + str+"&sesscity=" + id3;
			xmlHttprealtor=GetXmlHttpObject(Quick_SearchnewTextrealtor);
			xmlHttprealtor.open("GET", url , true);
			xmlHttprealtor.send(null);
	}

	function Quick_SearchnewTextrealtor(){ 
			if (xmlHttprealtor.readyState==4 || xmlHttprealtor.readyState=="complete"){ 
				document.getElementById('City6').style.display="";
				document.getElementById('load6').style.display="none";
				document.getElementById(idCityrealtor).innerHTML=xmlHttprealtor.responseText ;
			}
	} 

//Ajax for getting state list
function showDialect(str){
	document.getElementById('txtResult').style.display="none";
	document.getElementById('loadc').style.display="";
	idstate = "txtResult";
	var url=site_url+"common/state_list.php?country=" + str;
	xmlHttp=GetXmlHttpObject(stateChanged);
	xmlHttp.open("GET", url , true);
	xmlHttp.send(null);
	document.getElementById("txtResult1").innerHTML = "<input type=\"text\" class=\"textboxCls\" name=\"City\"> <span color=red class=\"Bold11Orange\">&nbsp;*</span>";	
}
//Ajax for getting city list
function showDialect1(str){
	document.getElementById('txtResult1').style.display="none";
	document.getElementById('loadcity').style.display="";
idCity = "txtResult1";
var url=site_url+"common/city_list.php?getState=" + str;
xmlHttp=GetXmlHttpObject(stateChanged1);
xmlHttp.open("GET", url , true);
xmlHttp.send(null);
}
function stateChanged1() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
	document.getElementById('txtResult1').style.display="";
	document.getElementById('loadcity').style.display="none";
	document.getElementById(idCity).innerHTML=xmlHttp.responseText ;
}
} 
function showDialect2(str){
			idcata = "Cat1";
			var url=site_url+"common/cat_list.php?cat=" + str;
			xmlHttp=GetXmlHttpObject(stateChanged2);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
}
function showDialectprod(str){
		if(str == '2' || str == '33' || str == '36')
		{
			document.all.idsub.style.display = '';
		}
		else
		{
			document.all.idsub.style.display = 'none';
		}
			idcata = "Cat1";
			var url=site_url+"common/prodcat_list.php?cat=" + str;
			xmlHttp=GetXmlHttpObject(stateChanged2);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

function showDialectprod1(str,id2,id3){
			idcata = id2;
			var url=site_url+"common/prodcat_list.php?cat=" + str+"&Selected=" + id3;
			xmlHttp=GetXmlHttpObject(stateChanged5);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

function stateChanged2(){ 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
					document.getElementById(idcata).innerHTML=xmlHttp.responseText ;
			}
} 
	
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
	document.getElementById('txtResult').style.display="";
	document.getElementById('loadc').style.display="none";
	document.getElementById(idstate).innerHTML=xmlHttp.responseText ;
}
} 

function showState(str,SelectedState){
			document.getElementById('txtResult').style.display="none";
			document.getElementById('loadc').style.display="";
					idstate = "txtResult";
					if(isNaN(SelectedState)){
					return;
					}
					var url=site_url+"common/state_list_noMan.php?country=" + str+"&Selected="+SelectedState;
					xmlHttp=GetXmlHttpObject(showStateVal);
					xmlHttp.open("GET", url , true);
					xmlHttp.send(null);
			}
function showStateVal(){ 
					if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
						document.getElementById('txtResult').style.display="";
						document.getElementById('loadc').style.display="none";
								document.getElementById(idstate).innerHTML=xmlHttp.responseText ;
								
					}
} 
		
function showCity(str,SelectedCity){
	document.getElementById('txtResult1').style.display="none";
	document.getElementById('loadcity').style.display="";
					idCity = "txtResult1";
					if(isNaN(SelectedCity)){
					document.forms[0].City.value=SelectedCity;
					return;
					}
					var url=site_url+"common/city_list_noMan.php?getState="+ str+"&Selected="+SelectedCity;
					xmlHttp1=GetXmlHttpObject(showCityVal);
					xmlHttp1.open("GET", url , true);
					xmlHttp1.send(null);
}	
function showCityVal(){ 
					if (xmlHttp1.readyState==4 || xmlHttp1.readyState=="complete"){
						document.getElementById('txtResult1').style.display="";
						document.getElementById('loadcity').style.display="none";
								document.getElementById(idCity).innerHTML=xmlHttp1.responseText ;

								
					}
}
				
function showState_Mandatory(str,SelectedState){
					idstate = "txtResult";
					if(isNaN(SelectedState)){
					document.forms[0].State.value=SelectedState;
					return;
					}
					var url=site_url+"common/state_list.php?country=" + str+"&Selected="+SelectedState;
					xmlHttps=GetXmlHttpObject(showStateVal_Mandatory);
					xmlHttps.open("GET", url , true);
					xmlHttps.send(null);
					document.getElementById("txtResult1").innerHTML = "<input type=\"text\" name=\"City\">";
}
function showStateVal_Mandatory(){ 
					if (xmlHttps.readyState==4 || xmlHttps.readyState=="complete"){ 
								document.getElementById(idstate).innerHTML=xmlHttps.responseText ;
								showst();
					}
} 
		
function showCity_Mandatory(str,SelectedCity){
					idCity = "txtResult1";
					if(isNaN(SelectedCity)){
					document.forms[0].City.value=SelectedCity;
					return;
					}
					var url=site_url+"common/city_list.php?getState="+ str+"&Selected="+SelectedCity;
					xmlHttp=GetXmlHttpObject(showCityVal_Mandatory);
					xmlHttp.open("GET", url , true);
					xmlHttp.send(null);
}	
function showCityVal_Mandatory(){ 
					if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
								document.getElementById(idCity).innerHTML=xmlHttp.responseText ;
								//hidest();
					}
}
function showpagingresults(tr_id,locount){
	  		idfeature = tr_id;
			var url=site_url+"forms/searchpaging.php?total="+locount;
			xmlHttp=GetXmlHttpObject(locresults);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

function showlocresults(tr_id,locid,url,locname,max){
	document.getElementById('locid').style.display="none";
	document.getElementById('loadsresult').style.display="";
	idfeature = tr_id;
	idlocname = locid;
	//document.getElementById(idlocname).innerHTML=locname ;
	document.all.theLayer.style.visibility="hidden";
	if(max=="")
	{
		var urle=site_url+"forms/"+url+"&ajax=1";
	}
	else
	{
		var urle=site_url+"forms/"+url+"&ajax=1&minbed="+locname+"&maxbed="+max;
	}
		xmlHttp=GetXmlHttpObject(locresults);
		xmlHttp.open("GET", urle , true);
		xmlHttp.send(null);
}

function sortresults(tr_id,purl){
	  		idfeature = tr_id;
			var url=site_url+"forms/sorttt.php?"+purl;
			xmlHttp=GetXmlHttpObject(locresults);
			xmlHttp.open("GET", url , true);
			xmlHttp.send(null);
	}

	function locbrowseleftresults(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			document.getElementById('browseresultnew').style.display="";
			document.getElementById('loadbrowsenew').style.display="none";
			document.getElementById(idfeature).innerHTML=xmlHttp.responseText ;
	}
}
function showbrowseleftresults(tr_id,catid,url,catname,max,minmax,act){
	var urle;
	idfeature = tr_id;
	idcatname = catid;
	if(act=="")
	{
		document.getElementById('browseresultnew').style.display="none";
		document.getElementById('loadbrowsenew').style.display="";
	}
	if(minmax!="" && minmax!="-" && minmax.match("Min")!="Min" && minmax.match("Max")!="Max")
	{
		document.getElementById(idcatname).innerHTML=minmax ;
	}
	else
	{
		if(catname!="" && catname!="Min"){
		document.getElementById(idcatname).innerHTML=catname ;
		}
	}
	if(act=="")
	{
		if(catid=='bathname')
		{
			document.frmbaths.minbaths.value="Min";
			document.frmbaths.maxbaths.value="Max";
		}
		else if(catid=='sizename')
		{
			document.frmsizes.minsizes.value="Min";
			document.frmsizes.maxsizes.value="Max";
		}
		else if(catid=='bedname')
		{
			document.frmbeds.minbeds.value="Min";
			document.frmbeds.maxbeds.value="Max";
		}
		else if(catid=='pricename')
		{
			document.frmprices.minprices.value="Min";
			document.frmprices.maxprices.value="Max";
		}
		urle=site_url+"forms/browseresults_properties_new.php?"+url;
	}
	else
	{
		if(catid=='bathname')
		{
			if(document.frmbaths.minbaths.value=="Min" || document.frmbaths.minbaths.value=="" || document.frmbaths.maxbaths.value=="Max" || document.frmbaths.maxbaths.value=="")
			{
				alert("Please enter Minimum and Maximum value for bathrooms available");
				return false;
			}
			else
			{
				document.getElementById('browseresultnew').style.display="none";
				document.getElementById('loadbrowsenew').style.display="";
				urle=site_url+"forms/browseresults_properties_new.php?"+url+"&ajax=1&minbath="+catname+"&maxbath="+max;
			}
		}
		else if(catid=='sizename')
		{
			if(document.frmsizes.minsizes.value=="" || document.frmsizes.minsizes.value=="Min" || document.frmsizes.maxsizes.value=="" || document.frmsizes.maxsizes.value=="Max" || document.frmsizes.measure.value=="")
			{
				alert("Please enter Minimum and Maximum value for Sizes available");
				return false;
			}
			else
			{
				document.getElementById('browseresultnew').style.display="none";
				document.getElementById('loadbrowsenew').style.display="";
				urle=site_url+"forms/browseresults_properties_new.php?"+url+"&ajax=1&minsize="+catname+"&maxsize="+max;
			}
		}
		else if(catid=='bedname')
		{
			if(document.frmbeds.minbeds.value=="" || document.frmbeds.minbeds.value=="Min" || document.frmbeds.maxbeds.value=="" || document.frmbeds.maxbeds.value=="Max")
			{
				alert("Please enter Minimum and Maximum value for bedrooms available");
				return false;
			}
			else
			{
				document.getElementById('browseresultnew').style.display="none";
				document.getElementById('loadbrowsenew').style.display="";
				urle=site_url+"forms/browseresults_properties_new.php?"+url+"&ajax=1&minbed="+catname+"&maxbed="+max;
			}
		}
		else if(catid=='pricename')
		{
			if(document.frmprices.minprices.value=="Min" || document.frmprices.minprices.value=="" || document.frmprices.maxprices.value=="" || document.frmprices.maxprices.value=="Max")
			{
				alert("Please enter Minimum and Maximum value for Prices available");
				return false;
			}
			else
			{
				document.getElementById('browseresultnew').style.display="none";
				document.getElementById('loadbrowsenew').style.display="";
				urle=site_url+"forms/browseresults_properties_new.php?"+url+"&ajax=1&minprice="+catname+"&maxprice="+max;
			}
		}
	}
	xmlHttp=GetXmlHttpObject(locbrowseleftresults);
	xmlHttp.open("GET", urle , true);
	xmlHttp.send(null);
}

function locresults(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			document.getElementById('locid').style.display="";
			document.getElementById('loadsresult').style.display="none";
			document.getElementById(idfeature).innerHTML=xmlHttp.responseText ;
	}
}
function showbathresults(tr_id,catid,url,catname,max,minmax,act){
	var urle;
	idfeature = tr_id;
	idcatname = catid;
	if(act=="")
	{
		document.getElementById('locid').style.display="none";
		document.getElementById('loadsresult').style.display="";
	}
	/*if(minmax!="" && minmax!="- beds" &&  minmax!="- baths" && minmax.match("Min")!="Min" && minmax.match("Max")!="Max")
	{
		document.getElementById(idcatname).innerHTML=minmax ;
	}
	else
	{
		if(catname!="" && catname!="Min" && catname!="- beds" && catname!="- baths"){
		document.getElementById(idcatname).innerHTML=catname ;
		}
	}*/
	if(act=="")
	{
		/*if(catid=='bathname')
		{
			document.frmbaths.minbaths.value="Min";
			document.frmbaths.maxbaths.value="Max";
		}
		else if(catid=='sizename')
		{
			document.frmsizes.minsizes.value="Min";
			document.frmsizes.maxsizes.value="Max";
		}
		else if(catid=='bedname')
		{
			document.frmbeds.minbeds.value="Min";
			document.frmbeds.maxbeds.value="Max";
		}*/
		
		urle=site_url+"forms/"+url+"&ajax=1";
	}
	else
	{
		if(catid=='bathname')
		{
			/*if(document.frmbaths.minbaths.value=="Min" || document.frmbaths.minbaths.value=="" || document.frmbaths.maxbaths.value=="Max" || document.frmbaths.maxbaths.value=="")
			{
				alert("Please enter Minimum and Maximum value for bathrooms available");
				return false;
			}
			else
			{*/
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				//urle=site_url+"forms/"+url+"&ajax=1&minbath="+catname+"&maxbath="+max;
				urle=site_url+"forms/"+url+"&ajax=1";
			//}
		}
		else if(catid=='sizename')
		{
			alert(max);
			/*if(document.frmsizes.minsizes.value=="" || document.frmsizes.minsizes.value=="Min" || document.frmsizes.maxsizes.value=="" || document.frmsizes.maxsizes.value=="Max" || document.frmsizes.measure.value=="")
			{
				alert("Please enter Minimum and Maximum value for Sizes available");
				return false;
			}
			else
			{*/
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				urle=site_url+"forms/"+url+"&ajax=1&minsize="+catname+"&maxsize="+max;
				
		//	}
		}
		else if(catid=='bedname')
		{
			/*if(document.frmbeds.minbeds.value=="" || document.frmbeds.minbeds.value=="Min" || document.frmbeds.maxbeds.value=="" || document.frmbeds.maxbeds.value=="Max")
			{
				alert("Please enter Minimum and Maximum value for bedrooms available");
				return false;
			}
			else
			{*/
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				//urle=site_url+"forms/"+url+"&ajax=1&minbed="+catname+"&maxbed="+max;
				urle=site_url+"forms/"+url+"&ajax=1";
			//}
		}
		else if(catid=='pricename')
		{
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				//urle=site_url+"forms/"+url+"&ajax=1&minprice="+catname+"&maxprice="+max;
				urle=site_url+"forms/"+url+"&ajax=1";
		}

	}
	
	xmlHttp=GetXmlHttpObject(locresults);
	xmlHttp.open("GET", urle , true);
	xmlHttp.send(null);
}

/*  Function created for November 2008 */
function showsearchresultsnov2008Changed(){ 
			if (xmlHttpSR.readyState==4 || xmlHttpSR.readyState=="complete")
			{ 
				document.getElementById('loadallnew').style.display="none";
				document.getElementById('searchresultallnew').style.display="";
				document.getElementById(idcataSR).innerHTML=xmlHttpSR.responseText ;
			}
	} 
	function showsearchresultsnov2008(id2,qrystring){
			document.getElementById('loadallnew').style.display="";	
			document.getElementById('searchresultallnew').style.display="none";
			idcataSR = id2;
			var url=site_url+"forms/searchresults_propertiesajax_nov2008.php?"+qrystring;
			xmlHttpSR=GetXmlHttpObject(showsearchresultsnov2008Changed);
			xmlHttpSR.open("GET", url , true);
			xmlHttpSR.send(null);
	}
	function locresultsnew(){ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
			document.getElementById('locid').style.display="";
			document.getElementById('loadsresult').style.display="none";
			document.getElementById('login').innerHTML='<A class="menufont1" href="http://www.indiarealtors.com/loginclass.php?act=signout"  title="Logout">Logout</A>';
			document.getElementById(idfeature).innerHTML=xmlHttp.responseText ;
	}
}

function showbathresultsnew(tr_id,catid,url,catname,max,minmax,act){
	var urle;
	idfeature = tr_id;
	idcatname = catid;
	if(act=="")
	{
		document.getElementById('locid').style.display="none";
		document.getElementById('loadsresult').style.display="";
	}
	/*if(minmax!="" && minmax!="- beds" &&  minmax!="- baths" && minmax.match("Min")!="Min" && minmax.match("Max")!="Max")
	{
		document.getElementById(idcatname).innerHTML=minmax ;
	}
	else
	{
		if(catname!="" && catname!="Min" && catname!="- beds" && catname!="- baths"){
		document.getElementById(idcatname).innerHTML=catname ;
		}
	}*/
	if(act=="")
	{
		/*if(catid=='bathname')
		{
			document.frmbaths.minbaths.value="Min";
			document.frmbaths.maxbaths.value="Max";
		}
		else if(catid=='sizename')
		{
			document.frmsizes.minsizes.value="Min";
			document.frmsizes.maxsizes.value="Max";
		}
		else if(catid=='bedname')
		{
			document.frmbeds.minbeds.value="Min";
			document.frmbeds.maxbeds.value="Max";
		}*/
		
		urle=site_url+"forms/"+url+"&ajax=1";
	}
	else
	{
		if(catid=='bathname')
		{
			/*if(document.frmbaths.minbaths.value=="Min" || document.frmbaths.minbaths.value=="" || document.frmbaths.maxbaths.value=="Max" || document.frmbaths.maxbaths.value=="")
			{
				alert("Please enter Minimum and Maximum value for bathrooms available");
				return false;
			}
			else
			{*/
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				//urle=site_url+"forms/"+url+"&ajax=1&minbath="+catname+"&maxbath="+max;
				urle=site_url+"forms/"+url+"&ajax=1";
			//}
		}
		else if(catid=='sizename')
		{
			/*if(document.frmsizes.minsizes.value=="" || document.frmsizes.minsizes.value=="Min" || document.frmsizes.maxsizes.value=="" || document.frmsizes.maxsizes.value=="Max" || document.frmsizes.measure.value=="")
			{
				alert("Please enter Minimum and Maximum value for Sizes available");
				return false;
			}
			else
			{*/
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				urle=site_url+"forms/"+url+"&ajax=1&minsize="+catname+"&maxsize="+max;
				
		//	}
		}
		else if(catid=='bedname')
		{
			/*if(document.frmbeds.minbeds.value=="" || document.frmbeds.minbeds.value=="Min" || document.frmbeds.maxbeds.value=="" || document.frmbeds.maxbeds.value=="Max")
			{
				alert("Please enter Minimum and Maximum value for bedrooms available");
				return false;
			}
			else
			{*/
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				//urle=site_url+"forms/"+url+"&ajax=1&minbed="+catname+"&maxbed="+max;
				urle=site_url+"forms/"+url+"&ajax=1";
			//}
		}
		else if(catid=='pricename')
		{
				document.getElementById('locid').style.display="none";
				document.getElementById('loadsresult').style.display="";
				//urle=site_url+"forms/"+url+"&ajax=1&minprice="+catname+"&maxprice="+max;
				//http://www.emedicinehealth.com/jock_itch/article_em.htm
				urle=site_url+"forms/"+url+"&ajax=1";
		}

	}
	xmlHttp=GetXmlHttpObject(locresultsnew);
	xmlHttp.open("GET", urle , true);
	xmlHttp.send(null);
}
function makenoteschanged(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
} 
function makenotes(id2,qrystring){
	idcataSR = id2;
	var url=site_url+"fav-poss-reject.php?insert=1&"+qrystring;
	xmlHttpm=GetXmlHttpObject(makenoteschanged);
	xmlHttpm.open("GET", url , true);
	xmlHttpm.send(null);
}
function ForwardMailchanged(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
} 
function ForwardMail(id2,qrystring){
	idcataSR = id2;
	var url=site_url+"forms/forwardfriend-ajax.php?"+qrystring;
	xmlHttpm=GetXmlHttpObject(ForwardMailchanged);
	xmlHttpm.open("GET", url , true);
	xmlHttpm.send(null);
}
function Addratingchanged(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
} 
function Addrating(id2,qrystring){
	idcataSR = id2;
	var url=site_url+"forms/rateproperty-ajax.php?"+qrystring;
	xmlHttpm=GetXmlHttpObject(Addratingchanged);
	xmlHttpm.open("GET", url , true);
	xmlHttpm.send(null);
}
function homeloanchanged(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
} 
function homeloan(id2,qrystring){
	idcataSR = id2;
	var url=site_url+"homeloanenq_ajax.php?"+qrystring;
	xmlHttpm=GetXmlHttpObject(homeloanchanged);
	xmlHttpm.open("GET", url , true);
	xmlHttpm.send(null);
}
/*  End Function created for November 2008     */

function sendmailresult(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
} 
function sendmail(id2,qrystring){
	idcataSR = id2;
	var url=site_url+"forms/mail.php?insert=1&"+qrystring;
	xmlHttpm=GetXmlHttpObject(sendmailresult);
	xmlHttpm.open("GET", url , true);
	xmlHttpm.send(null);
}

function sendmaillresult(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
} 
function sendmaill(id2,qrystring){
	idcataSR = id2;
	var url=site_url+"forms/sendmultipleenq.php?insert=1&"+qrystring;
	xmlHttpm=GetXmlHttpObject(sendmailresult);
	xmlHttpm.open("GET", url , true);
	xmlHttpm.send(null);
}

function tabresult(){ 
	if (xmlHttpm.readyState==4 || xmlHttpm.readyState=="complete")
	{ 
		document.getElementById(idcataSR).innerHTML=xmlHttpm.responseText ;
	}
	else
	{
		document.getElementById(idcataSR).innerHTML="<div style='height:300px;text-align:center;'><img src=\"images/loading-icon.gif \"></div>";
	}
} 
function myhometab(qrystring,id2){
		idcataSR = id2;
		var url=site_url+"forms/"+qrystring;
		xmlHttpm=GetXmlHttpObject(tabresult);
		xmlHttpm.open("GET", url , true);
		xmlHttpm.send(null);
}

function loginformsearch(qrystring,id2)
{ 
   	 if(document.loginfrm.Username.value=="")
	 {
		alert("Plase Enter username")
		document.loginfrm.Username.focus();
		return false;
	 }
     else if(document.loginfrm.Password.value=="")
	 {
        alert("Plase Enter password")
		document.loginfrm.Password.focus();
		return false;
      }
	  else
	  {
			idcataSR = id2;
			var url=site_url+"forms/"+qrystring;
			xmlHttplogin=GetXmlHttpObject(loginR);
			xmlHttplogin.open("GET", url , true);
			xmlHttplogin.send(null);
	  }
 }
function loginR()
{ 
	if (xmlHttplogin.readyState==4 || xmlHttplogin.readyState=="complete")
	{ 
		if(xmlHttplogin.responseText=='Error=Invalied'){
			document.getElementById('errorid').style.display="block";
			
		}else{
			document.getElementById(idcataSR).innerHTML=xmlHttplogin.responseText ;
		}
	}	
} 
function displaymenu(qrystring,bid,id2)
{ 
	idcataSR = id2;
	var url=site_url+"project/dispmenu.php?type="+qrystring+"&bid="+bid;
	xmlHttplogin=GetXmlHttpObject(displaystate);
	xmlHttplogin.open("GET", url , true);
	xmlHttplogin.send(null);
}
function displaystate()
{ 
	if (xmlHttplogin.readyState==4 || xmlHttplogin.readyState=="complete")
	{ 
		var val = xmlHttplogin.responseText;
		if(IsNumeric(val.charAt(0))==true){
			document.getElementById("notavail").innerHTML=val.substring(1);
		}else{
		document.getElementById("dispnotavail").style.display="none";
		document.getElementById("dispid").innerHTML=xmlHttplogin.responseText ;
		}
		
	}	
} 
function displaydetails(qrystring,id2,pos)
{ 
	idcataSR = id2;
	position = pos;
	if(document.pform.pdisplay.value!=position){
	document.getElementById("loading").style.display="";
	document.getElementById("maintable").style.display="none";
	var url=site_url+"project/dispdetails.php?"+qrystring;
	xmlHttplogin=GetXmlHttpObject(displaystate1);
	xmlHttplogin.open("GET", url , true);
	xmlHttplogin.send(null);
}
}

function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

function displaystate1()
{ 
	if (xmlHttplogin.readyState==4 || xmlHttplogin.readyState=="complete")
	{ 		
		document.getElementById("loading").style.display="none";
		document.getElementById("maintable").style.display="";
		document.pform.pdisplay.value=position;
		document.getElementById(idcataSR).innerHTML=xmlHttplogin.responseText ;
	}	
} 
function hometab(id,qry)
{
	qrystring="hot_property.php?cat=5&"+qry;
	id2='msgtabs';
	document.getElementById('result').style.display="none";
	document.getElementById('load').style.display="";
	idCity = "result";
	var url=site_url+"forms/tabs-res.php?"+qry;
	xmlHttp=GetXmlHttpObject(hometabchanged);
	xmlHttp.open("GET", url , true);
	xmlHttp.send(null);
}
function hometabchanged() 
{ 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{ 
		idcataSR='msgtabs';
		idsel='1';
		document.getElementById('result').style.display="";
		document.getElementById('load').style.display="none";
		document.getElementById(idCity).innerHTML=xmlHttp.responseText ;
		myhometab(qrystring,id2,idsel);
	}
} 

// ADDED BY SHERMILIN
function submitform()
{
	var total=""
	for(var i=0; i < document.ResultCompare.list.length; i++)
	{
		if(document.ResultCompare.list[i].checked)
		total +=  ","+document.ResultCompare.list[i].value
	}
	var temp = new Array(); 
	var temp = total.split(",");
	var cnt = temp.length;
	if(cnt == 1)
	{
		alert("Please Select Atleast One Property");
		return false;
	}
	else
	{
		document.ResultCompare.p_id.value=total;		
		fade('register','fadediv','dispdiv','560','350','regForm','forms/sendmultipleenq.php?mul=1&pid='+total);
	}
}

var checkflag = "false";
function checkAll(field)
{
	if (checkflag == "false") 
	{
		for (i = 0; i < field.length; i++)
		{
			field[i].checked = true ;
		}
		checkflag = "true";
	}
	else
	{
		for (i = 0; i < field.length; i++)
		{
		  field[i].checked = false; 
		}
		checkflag = "false";
	}
}
