var _EyeIconLayer;  
 var cEntityPopControl; //Í¼²ãÅÝÅÝ
var _PopLayer;         
var vM =    null;   
var vMe =   null;     
var _isBeginSelectMark = false; 
var _isBeginScale = false;
function fnLoadInit(){
        if(typeof vEdushiMap =='undefined' || typeof veyeEdushiMap=='undefined' || typeof vEdushiMap.Body.NewMapLayer !='function' || typeof veyeEdushiMap.Body.NewMapLayer !='function' )
    {
        setTimeout("fnLoadInit()",50);
        return;
    }
    vM  = vEdushiMap;
    vMe = veyeEdushiMap;
     _PopLayer = vEdushiMap.NewMapLayer('Pop',269, 0);
  
    window.onresize=function(){
        var h = fnGetWindowHeight(),w = screen.width-20;
Autosize();
	
if (h<578) h=578;
        var iH = h - 120;
         var iW;
        if(iH <= 478){iH = 478;}
        if (document.getElementById("frmTitle").style.display=="none"){ 
         iW = w - 18;
        }
        else
        {
         iW = w - 318;
        }
        if(iW <= 688){iW = 688;} 
				
        vM.MapHeight(iH);
        vM.MapWidth(iW);
        $('MapBorder').style.height=iH +"px" ;
        $('MapBorder').style.width=iW +"px" ;
        $('EdushiMap').style.width=iW +"px" ;
        $('EdushiMap').style.height=iH +"px" ;
         $('divmapright').style.width=iW +"px" ;
         $('divmapright').style.height=iH+"px"
				
		$('Eye').style.bottom=0 +'px';
		$('Eye').style.display='block';
	    $('Ein').style.bottom=1 +'px';
	     $('Ein').style.right=1 +'px';
	     $('Eye').style.right=1 +'px';

    };
    setTimeout('window.onresize();', 100);
    _EyeIconLayer = vMe.NewMapLayer('Icon', 264, 0);
    
        var EyeZB = new fnZoomBar();
    EyeZB.Init();
    vM.onMapZoomChange = function(z){
      EyeZB.ZoomBarSignPos(vM.Zoom());
      vMe.FlatZoom(vM.Zoom());
    };
    vM.onPaneEnd = function (x1,y1,x2,y2,flg){
        if(flg==0){
           fnShowPaneSearch(x1,y1,x2,y2);
        }        
    };
    vM.onMapMouseUp = function(e){
        if (_isBeginSelectMark){
            _Mark.Mark(vM.PointerX(),vM.PointerY(),'');
        }
    };
    vM.onMapDblClick = function(e){
        if (!_isBeginScale){
            if (vM.Zoom() >0){
                vM.MoveTo(vM.PointerX(),vM.PointerY());
                vMe.MoveTo(vM.PointerX(),vM.PointerY());
                vM.FlatZoom(0);
            }
            else{
                vM.MoveTo(vM.PointerX(),vM.PointerY(),true);
                vMe.MoveTo(vM.PointerX(),vM.PointerY(),true);
            }
        }
        _isBeginScale = false; 
    };
    vMe.onMapMoveEnd = function(x,y,flg){
        if(flg==0){vM.MoveTo(x,y,true);}
    };
        vM.onMapMoveEnd = function(x,y,flg){
        if(flg==0){vMe.MoveTo(x,y,true);}
    };

  ENetwork.DownloadScript('http://www.google-analytics.com/urchin.js',function(){
      
    });
 
  vM.onSpotClick = function(spot){
           // alert(spot.ID);
            ShowOwnerInfoPop(spot);
              
            };  
           
}

        