﻿// JScript File

function getXMLHttpObj()
	{
		if(typeof(XMLHttpRequest)!='undefined')
			return new XMLHttpRequest();

		var axO=['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.4.0',
			'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'], i;
		for(i=0;i<axO.length;i++)
			try{
				return new ActiveXObject(axO[i]);
			}catch(e){}
		return null;
	}

function loadScript(path,divID)
{

    var scriptpath=path;
	var oXML = getXMLHttpObj();
	oXML.open('GET', scriptpath, false);
	oXML.send('');
	document.getElementById(divID).innerHTML=oXML.responseText;
//alert(oXML.responseText)
 if(oXML.responseText.indexOf('(#%&#)')>0)
      {
          var st =oXML.responseText.indexOf('(#%&#)');
	      var en =oXML.responseText.indexOf('(#%*#!)');
	       //alert(responsetext.substring(Math.abs(st)+6,Math.abs(en)))
	      eval(oXML.responseText.substring(Math.abs(st)+6,Math.abs(en)));
	     
	  }




	return false;
}



	function CalltoMap(Latitude,Longitude,StreetNumber,StreetName,ActualCity,StateProvinceAbv,ZipCode,SaleslistingID,mlsid,FeaturedProperty)
	{
	//alert(Latitude)
	//alert(Longitude)
	//var JS_SearchValue=document.getElementById('ctl00_ContentPlaceHolder1_txtSearchValue').value;
	//var JS_ddlSearchBy=document.getElementById('ctl00_ContentPlaceHolder1_ddlSearchBy').value;
	var date=new Date();
	var querystring="../ShowMap/default.aspx?Latitude="+ Latitude +"&Longitude="+ Longitude +"&StreetNumber="+StreetNumber +"&StreetName="+ StreetName +"&ActualCity="+ ActualCity +"&StateProvinceAbv="+ StateProvinceAbv +"&ZipCode="+ ZipCode +"&SaleslistingID="+ SaleslistingID +"&mlsid="+ mlsid +"&FeaturedProperty="+ FeaturedProperty+"&d=" + date ;
	
	
		loadScript(querystring,'divMapSearch')
    return false;
	}
	
	
	function HideMapDiv()
	{
	
	document.getElementById('divMapSearch').style.display='none';
	}
