var allmap={
    create:function(ctntb){
    	this.opt={rl:false,rn:false,ht:false};
        this.ctb=$(ctntb);
        
		this.tb=this.ctb.appendChild($('d_maptb'));
		this.tb.onmousedown=function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
		this.tb.ondblclick=function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
		this.tb.onmousemove=function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
		this.tb.style.display='';
		
		this.typebtn=[$('a_maptype1'),$('a_maptype2')];
		this.mark=this.ctb.appendChild($('loadmk'));
		this.ctb.appendChild($('lr'));
		this.ctb.appendChild($('lf'));
		this.ctb.appendChild($('ly'));
		this.ctb.appendChild($('qc'));
		this.ctb.appendChild($('gw'));
		this.ctb.appendChild($('yl'));
		this.ctb.appendChild($('fw'));

		this.mapnav=this.ctb.appendChild($('d_mapnavi'));
		this.mapnav.style.display='';
        this.mapnav.ondblclick = function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
        this.mapnav.onmousedown = function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
        this.mapnav.onmouseover = function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
        this.mapnav.onmouseout = function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
        this.mapnav.onmousemove = function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
        this.mapnav.onclick = function(evt){evt.cancelBubble=true;return false;}.bindAsEventListener(this);
    },
    
    fit:function(){
    	this.tb.style.width=this.ctb.offsetWidth+'px';
    },
    
   	ctypebtn:function(t){
		this.typebtn[0].className=(t=='1'?'maptb_active':'maptb_off');
		this.typebtn[1].className=(t=='2'?'maptb_active':'maptb_off');
	
	},
	
	init:function(){
	    this.ctypebtn('1');
	},
	
	ctype:function(t){
		this.ctypebtn(t);
        if(t=="1")
        {
            map.clearht();            
            $("d_map").style.display='none';
            $("a_roadname").style.display='none';   
            $("d_geo").style.display='block';
            var cx=(map.opt.x+27290834.207394682)/256748.16017256945;
            var cy=-(map.opt.y-7603959.7259281958)/255154.09685751426;  
            geomap.setCenter(new MLatLng(cx,cy));

        }
        else
        {
            geomap.removeAllGraphics();
            $("d_map").style.display='block';
            $("a_roadname").style.display='block';  
            $("d_geo").style.display='none';
            var centerPoint=geomap.getCenter();
            map.opt.x=256748.16017256945 * centerPoint[0] - 27290834.207394682;
            map.opt.y=-255154.09685751426 * centerPoint[1] + 7603959.7259281958;
            map.clearzm();
            map.sethtpos();
		
	        map.setsrhtpos();
        	
	        map.setinfohtpos();
        	
	        map.loadmap();
        }
	}
}
