var mFilter = [];

function mapGoTo(mLat, mLng, mId)
	{
        //removeSearch();
        searchLatLng = new GLatLng(mLat, mLng); searchObjId = mId;
        if (mFilter.length > 0){
        	$("ul.cats > li input[@type='checkbox']").each(function()
            	{
                	var check = this.checked == true;
                	if (check){
                    	this.checked = false
                    	//alert('fff');
                    }
                 });
        	mFilter = [];
        	forceMapReload = true
         }
         gMap.panTo(searchLatLng);
         
         var tileCoordinate = new GPoint();
		 var tilePoint = new GPoint();
		 var currentProjection = G_NORMAL_MAP.getProjection();
		 var responseText = '';
		 //alert(mId);
		 
		 //tilePoint = currentProjection.fromLatLngToPixel(searchLatLng, gMap.getZoom());
		 //tileCoordinate.x = Math.floor(tilePoint.x / 256);
		 //tileCoordinate.y = Math.floor(tilePoint.y / 256);
		 //var myHtml = "Координаты предприятия: " + mLat + "<br/>" + mLng + "<br/> ID предприятия:" + mId ;
		forceMapReload = true;
		new Ajax.Request('/index.php', {parameters:'l=catalog&a=view_info&id='+ mId, onSuccess: function(e) {
			gMap.openInfoWindow(searchLatLng, e.responseText,{maxWidth:180});
   }, onFailure: function(e) {
			gMap.openInfoWindow(searchLatLng, "Не удалось получить информацию о предприятии",{maxWidth:180});
   }});
			
			
		 //
		 
		 
		
		 
		 return false
     };
     
function reportError(request)
	{
		alert('Sorry. There was an error.');
	};
     
function removeSearch()
	{
    	$("#mapSearch").remove(); return false
    };
    
    
function divResOnOver(act2do, pid, did)
{
          if(act2do == "on")
          {     
          		document.getElementById(did).style.fontSize='11px';
          		document.getElementById(pid).style.width='60px'
                //document.getElementById(bid).style.backgroundColor="#FFFFFF";   
                //document.getElementById(bid).style.borderColor="#000000";  
                //document.getElementById(bid).style.fontSize="25pt"; 
          }
          
          
          if(act2do == "off")
          {
                document.getElementById(did).style.fontSize='9px';
          		document.getElementById(pid).style.width='50px'   
          }
}