
var Map1, MapImage1, MapObjectList1;
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
};

  function OnWindowLoad() 
  {
  
    var MapDb = new MapDatabase(DBName);

		MapDb.BindLayerListControl(GetElem("LayerListPanel"));

		MapObjectList1 = MapDb.BindObjectListControl(GetElem("ObjectListPanel"));
  
    this.MapImage1 = MapDb.BindImageControl(GetElem("MapImagePlaceholder"));

    this.MapImage1.Width = ((window.innerWidth)?window.innerWidth:((document.all)?document.body.offsetWidth:null))+0;//1024;
    this.MapImage1.Height = ((window.innerHeight)?window.innerHeight:((document.all)?document.body.offsetHeight:null))-0;//700;
    this.MapImage1.CenterX = 16000;
    this.MapImage1.CenterY = 10500;
    this.MapImage1.ZoomScale = 1/12000;	
	this.MapImage1.XAngle = 0;
    this.MapImage1.YMirror=false;
    this.MapImage1.ProjectionChanged();
	//MapImage1.Width = 2024;
	
	if (L != "") {
	MapImage1.ZoomScale = 1/(L*5);
	
	};
	
	
	if (selectedId != "") {
			
    	MapObjectList1.NavigateToObject(selectedId);
    }
    else { 
	    MapImage1.ProjectionChanged();
	  };
	
	  
  }
	function M(Zoom) 
	{
	MapImage1.ZoomScale = 1/Zoom;
	MapImage1.ProjectionChanged();	
	}
	function InSearch() 
	{
	M(2000); 
	DoSearch();
	}
	



  function DoSearch() 
  {
  	MapObjectList1.TextSearch(GetElem("SearchFilter").value);
 		GetElem("ObjectListPanel").style.pixelHeight = 
			GetElem("MapTable").offsetHeight +
			GetElem("LayerListPanel").offsetHeight;
  }
  function OnWindowResize()
  {
  this.MapImage1.Width = ((window.innerWidth)?window.innerWidth:((document.all)?document.body.offsetWidth:null))+0;//1024;
  this.MapImage1.Height = ((window.innerHeight)?window.innerHeight:((document.all)?document.body.offsetHeight:null))-0;//700;
  this.MapImage1.ProjectionChanged();
  }
