
if(!CONFIG_PARAM['CONFIG_COPYRIGHT_IMAGE'])CONFIG_PARAM['CONFIG_COPYRIGHT_IMAGE']=CONFIG_PARAM['PROTOCOL']+'bap.mapion.co.jp/api_images/copyright3.gif';if(!CONFIG_PARAM['CONFIG_SCALE_IMAGE'])CONFIG_PARAM['CONFIG_SCALE_IMAGE']=CONFIG_PARAM['PROTOCOL']+'bap.mapion.co.jp/api_images/img/mcontrol/';if(!CONFIG_PARAM['CONFIG_BLANK_FILE'])CONFIG_PARAM['CONFIG_BLANK_FILE']='/mcms/image/blank.gif';if(!CONFIG_PARAM['copy_pos'])CONFIG_PARAM['copy_pos']='BOTTOM_LEFT';if(!CONFIG_PARAM['copy_margin_x'])CONFIG_PARAM['copy_margin_x']='5';if(!CONFIG_PARAM['copy_margin_y'])CONFIG_PARAM['copy_margin_y']='5';if(!CONFIG_PARAM['flg_sclimg'])CONFIG_PARAM['flg_sclimg']='0';if(!CONFIG_PARAM['sclimg_pos'])CONFIG_PARAM['sclimg_pos']='BOTTOM_RIGHT';if(!CONFIG_PARAM['sclimg_margin_x'])CONFIG_PARAM['sclimg_margin_x']='5';if(!CONFIG_PARAM['sclimg_margin_y'])CONFIG_PARAM['sclimg_margin_y']='5';if(!CONFIG_PARAM['flg_copyrightplus'])CONFIG_PARAM['flg_copyrightplus']='0';if(!CONFIG_PARAM['copyplus_pos'])CONFIG_PARAM['copyplus_pos']='BOTTOM_LEFT';if(!CONFIG_PARAM['copyplus_margin_x'])CONFIG_PARAM['copyplus_margin_x']='5';if(!CONFIG_PARAM['copyplus_margin_y'])CONFIG_PARAM['copyplus_margin_y']='5';if(!CONFIG_PARAM['flg_resize'])CONFIG_PARAM['flg_resize']='0';if(!CONFIG_PARAM['resize_width'])CONFIG_PARAM['resize_width']='';if(!CONFIG_PARAM['resize_height'])CONFIG_PARAM['resize_height']='';if(!CONFIG_PARAM['resize_min_width'])CONFIG_PARAM['resize_min_width']='300';if(!CONFIG_PARAM['resize_min_height'])CONFIG_PARAM['resize_min_height']='300';if(!CONFIG_PARAM['flg_clickmovement'])CONFIG_PARAM['flg_clickmovement']='0';if(!CONFIG_PARAM['flg_submap'])CONFIG_PARAM['flg_submap']='0';var putCmFlag=0;var extendFuncFlag=0;var _DECORATION_NUM=0
var copyrightscale=null;var copyright=null;MMap.extendFunc=function(){_submapdiv=document.getElementById("sub_map");if((!MBrowser.safari&&extendFuncFlag==0)||(MBrowser.safari&&CONFIG_PARAM['flg_submap']==1&&extendFuncFlag==1)||(MBrowser.safari&&CONFIG_PARAM['flg_submap']==0&&extendFuncFlag==0)||(MBrowser.safari&&CONFIG_PARAM['flg_submap']==1&&extendFuncFlag==0&&!_submapdiv)){if(CONFIG_PARAM['flg_resize']=="1"&&CONFIG_PARAM['resize_width']!=""&&CONFIG_PARAM['resize_height']!=""){onMapResize(this);}else{}
if(CONFIG_PARAM['flg_copyrightplus']==1){copyrightscale=new MCopyrightScale(this);this.addControl(copyrightscale,CONFIG_PARAM['copyplus_pos']);}else{copyright=new MCopyright(this);this.addControl(copyright,CONFIG_PARAM['copy_pos']);if(CONFIG_PARAM['flg_sclimg']==1){scaele=new MScale(this);this.addControl(scaele,CONFIG_PARAM['sclimg_pos']);}}}
if(CONFIG_PARAM['flg_clickmovement']==1){MEvent.addListener(this,"click",function(overlay,rpoint){this.smoveToRPoint(rpoint);});}
if(extendFuncFlag==0){extendFuncFlag=1;}else{if(CONFIG_PARAM['flg_resize']=="1"&&CONFIG_PARAM['resize_width']!=""&&CONFIG_PARAM['resize_height']!=""){setTimeout(mapResize,100);}}};function MCopyrightScale(mmap){this.id="deco"+_DECORATION_NUM;this.mdiv=mmap;_DECORATION_NUM++;};MCopyrightScale.prototype.show=function(){var cp=document.createElement("div");cp.id="copyright";var rulerimg=document.createElement("div");rulerimg.id="rulerimg";cp.appendChild(rulerimg);cp.rulerimg=rulerimg;var cpimg=document.createElement("img");cp.appendChild(cpimg);cp.cpimg=cpimg;rulerimg.innerHTML="<img src='"+CONFIG_PARAM['CONFIG_BLANK_FILE']+"'>";cpimg.src=CONFIG_PARAM['CONFIG_COPYRIGHT_IMAGE'];rulerimg.style.top="0px";cpimg.style.top="100px";cp.style.width="150px";cp.style.height="56px";cp.style.position='absolute';cp.style.left='5px';cp.style.bottom='5px';cp.style.zIndex=9999;var mapdiv=this.mdiv.mapdiv;var mdown=function(e){if(!e)e=window.evnet;mapdiv.onmousedown.call(mapdiv,e);cp.style.cursor="auto";}
var mup=function(e){if(!e)e=window.event;mapdiv.onmouseup.call(mapdiv,e);cp.style.cursor="auto";};var mclick=function(e){if(!e)e=window.event;mapdiv.onclick.call(mapdiv,e);};var mmove=function(e){if(mapdiv.oP.mdownpos){cp.style.cursor="move";}else{cp.style.cursor="auto";}}
var mwheel=function(e){if(!e)e=window.event;mapdiv.oP.mwheel.call(mapdiv,e);}
cp.onmousedown=mdown;cp.onmouseup=mup;cp.onclick=mclick;cp.onmousemove=mmove;if(cp.attachEvent||MBrowser.safari){cp.onmousewheel=mwheel;}else if(cp.addEventListener){cp.addEventListener("DOMMouseScroll",mwheel,false);}
this.mdiv.div.appendChild(cp);this.cpdiv=cp;this.setZoomLevel(this.mdiv.getZoomLevel());}
MCopyrightScale.prototype.setPosition=function(p){if(this.cpdiv==null)return;if(p=="TOP_LEFT"){this.cpdiv.style.bottom='';this.cpdiv.style.top=CONFIG_PARAM['copyplus_margin_y']+"px";this.cpdiv.style.right='';this.cpdiv.style.left=CONFIG_PARAM['copyplus_margin_x']+"px";}
else if(p=="TOP_RIGHT"){this.cpdiv.style.bottom='';this.cpdiv.style.top=CONFIG_PARAM['copyplus_margin_y']+"px";this.cpdiv.style.left='';this.cpdiv.style.right=CONFIG_PARAM['copyplus_margin_x']+"px";}
else if(p=="BOTTOM_LEFT"){this.cpdiv.style.top='';this.cpdiv.style.bottom=CONFIG_PARAM['copyplus_margin_y']+"px";this.cpdiv.style.right='';this.cpdiv.style.left=CONFIG_PARAM['copyplus_margin_x']+"px";}
else if(p=="BOTTOM_RIGHT"){this.cpdiv.style.top='';this.cpdiv.style.bottom=CONFIG_PARAM['copyplus_margin_y']+"px";this.cpdiv.style.left='';this.cpdiv.style.right=CONFIG_PARAM['copyplus_margin_x']+"px";}
else{this.cpdiv.style.top='';this.cpdiv.style.bottom=CONFIG_PARAM['copyplus_margin_y']+"px";this.cpdiv.style.right='';this.cpdiv.style.left=CONFIG_PARAM['copyplus_margin_x']+"px";}};var ScaleImageFlag=0;MCopyrightScale.prototype.setZoomLevel=function(value){scaleImg=["ruler_26000000.png","ruler_5000000.png","ruler_3000000.png","ruler_1000000.png","ruler_500000.png","ruler_250000.png","ruler_70000.png","ruler_25000.png","ruler_10000.png","ruler_5000.png"];var rulerimg=document.getElementById("rulerimg");if(ScaleImageFlag==0){rulerimg.innerHTML="<img src='"+CONFIG_PARAM['CONFIG_BLANK_FILE']+"'>";ScaleImageFlag=1;}else{rulerimg.innerHTML="<img src='"+CONFIG_PARAM['CONFIG_SCALE_IMAGE']+scaleImg[value]+"'>";}};MCopyrightScale.prototype.zoomUpdate=function(){this.setZoomLevel(this.mdiv.getZoomLevel());};function MCopyright(mmap){this.id="deco"+_DECORATION_NUM;this.mdiv=mmap;_DECORATION_NUM++;};MCopyright.prototype.zoomUpdate=function(){return false;};MCopyright.prototype.show=function(){var cp=document.createElement("div");cp.id="copyright";var cpimg=document.createElement("img");cp.appendChild(cpimg);cp.cpimg=cpimg;cpimg.src=CONFIG_PARAM['CONFIG_COPYRIGHT_IMAGE'];cpimg.style.top="100px";cp.style.width="150px";cp.style.height="23px";cp.style.position='absolute';cp.style.left='5px';cp.style.bottom='5px';cp.style.zIndex=9999;var mapdiv=this.mdiv.mapdiv;var mdown=function(e){if(!e)e=window.evnet;mapdiv.onmousedown.call(mapdiv,e);cp.style.cursor="auto";}
var mup=function(e){if(!e)e=window.event;mapdiv.onmouseup.call(mapdiv,e);cp.style.cursor="auto";};var mclick=function(e){if(!e)e=window.event;mapdiv.onclick.call(mapdiv,e);};var mmove=function(e){if(mapdiv.oP.mdownpos){cp.style.cursor="move";}else{cp.style.cursor="auto";}}
var mwheel=function(e){if(!e)e=window.event;mapdiv.oP.mwheel.call(mapdiv,e);}
cp.onmousedown=mdown;cp.onmouseup=mup;cp.onclick=mclick;cp.onmousemove=mmove;if(cp.attachEvent||MBrowser.safari){cp.onmousewheel=mwheel;}else if(cp.addEventListener){cp.addEventListener("DOMMouseScroll",mwheel,false);}
this.mdiv.div.appendChild(cp);this.cpdiv=cp;}
MCopyright.prototype.setPosition=function(p){if(this.cpdiv==null)return;if(p=="TOP_LEFT"){this.cpdiv.style.bottom='';this.cpdiv.style.top=CONFIG_PARAM['copy_margin_y']+"px";this.cpdiv.style.right='';this.cpdiv.style.left=CONFIG_PARAM['copy_margin_x']+"px";}
else if(p=="TOP_RIGHT"){this.cpdiv.style.bottom='';this.cpdiv.style.top=CONFIG_PARAM['copy_margin_y']+"px";this.cpdiv.style.left='';this.cpdiv.style.right=CONFIG_PARAM['copy_margin_x']+"px";}
else if(p=="BOTTOM_LEFT"){this.cpdiv.style.top='';this.cpdiv.style.bottom=CONFIG_PARAM['copy_margin_y']+"px";this.cpdiv.style.right='';this.cpdiv.style.left=CONFIG_PARAM['copy_margin_x']+"px";}
else if(p=="BOTTOM_RIGHT"){this.cpdiv.style.top='';this.cpdiv.style.bottom=CONFIG_PARAM['copy_margin_y']+"px";this.cpdiv.style.left='';this.cpdiv.style.right=CONFIG_PARAM['copy_margin_x']+"px";}
else{this.cpdiv.style.top='';this.cpdiv.style.bottom=CONFIG_PARAM['copy_margin_y']+"px";this.cpdiv.style.right='';this.cpdiv.style.left=CONFIG_PARAM['copy_margin_x']+"px";}};function MScale(mmap){this.id="deco"+_DECORATION_NUM;this.mdiv=mmap;_DECORATION_NUM++;};MScale.prototype.show=function(){var sc=document.createElement("div");sc.id="sclimgright";var rulerimg=document.createElement("div");rulerimg.id="rulerimg";sc.appendChild(rulerimg);sc.rulerimg=rulerimg;rulerimg.innerHTML="<img src='"+CONFIG_PARAM['CONFIG_BLANK_FILE']+"'>";rulerimg.style.top="0px";sc.style.width="150px";sc.style.height="33px";sc.style.position='absolute';sc.style.left='5px';sc.style.bottom='5px';sc.style.zIndex=9999;var mapdiv=this.mdiv.mapdiv;var mdown=function(e){if(!e)e=window.evnet;mapdiv.onmousedown.call(mapdiv,e);sc.style.cursor="auto";}
var mup=function(e){if(!e)e=window.event;mapdiv.onmouseup.call(mapdiv,e);sc.style.cursor="auto";};var mclick=function(e){if(!e)e=window.event;mapdiv.onclick.call(mapdiv,e);};var mmove=function(e){if(mapdiv.oP.mdownpos){sc.style.cursor="move";}else{sc.style.cursor="auto";}}
var mwheel=function(e){if(!e)e=window.event;mapdiv.oP.mwheel.call(mapdiv,e);}
sc.onmousedown=mdown;sc.onmouseup=mup;sc.onclick=mclick;sc.onmousemove=mmove;if(sc.attachEvent||MBrowser.safari){sc.onmousewheel=mwheel;}else if(sc.addEventListener){sc.addEventListener("DOMMouseScroll",mwheel,false);}
this.mdiv.div.appendChild(sc);this.scdiv=sc;this.setZoomLevel(this.mdiv.getZoomLevel());}
MScale.prototype.setPosition=function(p){if(this.scdiv==null)return;if(p=="TOP_LEFT"){this.scdiv.style.bottom='';this.scdiv.style.top=CONFIG_PARAM['sclimg_margin_y']+"px";this.scdiv.style.right='';this.scdiv.style.left=CONFIG_PARAM['sclimg_margin_x']+"px";}
else if(p=="TOP_RIGHT"){this.scdiv.style.bottom='';this.scdiv.style.top=CONFIG_PARAM['sclimg_margin_y']+"px";this.scdiv.style.left='';this.scdiv.style.right=CONFIG_PARAM['sclimg_margin_x']+"px";}
else if(p=="BOTTOM_LEFT"){this.scdiv.style.top='';this.scdiv.style.bottom=CONFIG_PARAM['sclimg_margin_y']+"px";this.scdiv.style.right='';this.scdiv.style.left=CONFIG_PARAM['sclimg_margin_x']+"px";}
else if(p=="BOTTOM_RIGHT"){this.scdiv.style.top='';this.scdiv.style.bottom=CONFIG_PARAM['sclimg_margin_y']+"px";this.scdiv.style.left='';this.scdiv.style.right=CONFIG_PARAM['sclimg_margin_x']+"px";}
else{this.scdiv.style.top='';this.scdiv.style.bottom=CONFIG_PARAM['sclimg_margin_y']+"px";this.scdiv.style.right='';this.scdiv.style.left=CONFIG_PARAM['sclimg_margin_x']+"px";}};var ScaleImageFlag=0;MScale.prototype.setZoomLevel=function(value){scaleImg=["ruler_26000000.png","ruler_5000000.png","ruler_3000000.png","ruler_1000000.png","ruler_500000.png","ruler_250000.png","ruler_70000.png","ruler_25000.png","ruler_10000.png","ruler_5000.png"];var rulerimg=document.getElementById("rulerimg");if(ScaleImageFlag==0){rulerimg.innerHTML="<img src='"+CONFIG_PARAM['CONFIG_BLANK_FILE']+"'>";ScaleImageFlag=1;}else{rulerimg.innerHTML="<img src='"+CONFIG_PARAM['CONFIG_SCALE_IMAGE']+scaleImg[value]+"'>";}};MScale.prototype.zoomUpdate=function(){this.setZoomLevel(this.mdiv.getZoomLevel());};var MAPRESIZE_END=false;var resizemap=null;function onMapResize(mmap){if(!mm){mm=mmap;}
resizemap=mmap;MEvent.clearListeners(resizemap,"move");MEvent.clearListeners(resizemap,"moveend");MEvent.clearListeners(resizemap,"zoom");mapResize();}
function mapResize()
{var targetBr=false;var agt=navigator.userAgent.toLowerCase();isSafari=false;isOpera=false;isSafari3=false;IE6up=false;if(agt.indexOf("msie")!=-1&&agt.indexOf("opera")==-1){agt.match(/msie (\d+\.\d+)/);if(Number(RegExp.$1)>=5.5)targetBr=true;if(Number(RegExp.$1)>=6)IE6up=true;}
if(agt.indexOf("gecko")!=-1){if(agt.indexOf("firefox")!=-1){agt.match(/firefox\/(\d+)\.(\d+)\.*(\d+)*/);if(Number(RegExp.$1)>1)targetBr=true;if(Number(RegExp.$1)==1&&Number(RegExp.$2)>0)targetBr=true;if(Number(RegExp.$1)==1&&Number(RegExp.$2)==0&&Number(RegExp.$3)>=2)targetBr=true;}else if(agt.indexOf("netscape")!=-1){agt.match(/netscape\/(\d+\.\d+)/);if(Number(RegExp.$1)>=7.1)targetBr=true;}else if(agt.indexOf("mozilla")!=-1){agt.match(/mozilla\/(\d+\.\d+)/);if(Number(RegExp.$1)>=5.0)targetBr=true;}else{agt.match(/rv:(\d+)\.(\d+)\.(\d+)/);if(Number(RegExp.$1)>1)targetBr=true;if(Number(RegExp.$1)==1&&Number(RegExp.$2)>7)targetBr=true;if(Number(RegExp.$1)==1&&Number(RegExp.$2)==7&&Number(RegExp.$3)>=3)targetBr=true;}}
if(agt.indexOf("opera")!=-1){agt.match(/opera[ \/](\d+\.\d+)/);if(Number(RegExp.$1)>=8.0)targetBr=true;isOpera=true;}
if(agt.indexOf("safari")!=-1){agt.match(/safari\/(\d+)/);if(Number(RegExp.$1)>='125')targetBr=true;if(agt.indexOf("version")!=-1){isSafari3=true;}else{isSafari=true;}}
var ClientH=0,ClientW=0,ScrollH=0,ScrollW=0;var d=document,w=window;if(CONFIG_PARAM['flg_resize']=="1"&&CONFIG_PARAM['resize_width']!=""&&CONFIG_PARAM['resize_height']!=""){if(w.innerHeight){ClientH=window.innerHeight;ClientW=window.innerWidth;}
else if(d.compatMode=='CSS1Compat'&&d.documentElement.clientHeight){ClientH=d.documentElement.clientHeight;ClientW=d.documentElement.clientWidth;}
else if(d.body.clientHeight){ClientH=d.body.clientHeight;ClientW=d.body.clientWidth;}
if(w.scrollMaxY){ScrollH=w.scrollMaxY;}
else if(d.documentElement.scrollHeight){ScrollH=d.documentElement.scrollHeight;}
else{ScrollH=d.body.scrollHeight;}
if(w.scrollMaxX){ScrollW=w.scrollMaxX;}
else if(d.documentElement.scrollWidth){ScrollW=d.documentElement.scrollWidth;}
else{ScrollW=d.body.scrollWidth;}
var styleWidth=ClientW-CONFIG_PARAM['resize_width'];var styleHeight=ClientH-CONFIG_PARAM['resize_height'];flgscroll=false;if(styleHeight<CONFIG_PARAM['resize_min_height']){styleHeight=CONFIG_PARAM['resize_min_height'];flgscroll=true;}
if(typeof(resizemap)!="undefined"&&resizemap!=null){dx=0;if(!MBrowser.ie5up&&!isSafari){}
if(styleWidth<CONFIG_PARAM['resize_min_width']){styleWidth=CONFIG_PARAM['resize_min_width'];if(!MBrowser.ie5up&&!isSafari)dx=15;}
styleWidth-=dx;resizemap.div.style.width=styleWidth+"px";resizemap.div.style.height=styleHeight+"px";resizemap.setMapBox();resizemap.refreshMapAll();if(ClientW<document.body.offsetWidth){ClientW=document.body.offsetWidth;}
styleWidth=ClientW-CONFIG_PARAM['resize_width'];if(styleWidth<CONFIG_PARAM['resize_min_width']){styleWidth=CONFIG_PARAM['resize_min_width'];}
resizemap.div.style.width=styleWidth+"px";resizemap.setMapBox();resizemap.refreshMapAll();}
if(typeof(mm)!="undefined"||typeof(smm)!="undefined"){if(typeof(mm)!="undefined"&&mm){MEvent.clearListeners(mm,"move");MEvent.clearListeners(mm,"moveend");MEvent.clearListeners(mm,"zoom");}
if(typeof(smm)!="undefined"&&smm){}
callMapEvent();if(typeof(mm)!="undefined"){if(putCmFlag==0){putCmFlag=1;}else{selectCenterMark2(mm);}}
if(typeof(smm)!="undefined"){selectCenterMark2(smm);smm.getMapOffset();}}
mapResizeEndWork();MAPRESIZE_END=true;mapResizeEnd();}}
function mapResizeEnd(){}
MScaleControl.prototype.setZoomLevel=function(value){this.s=document.getElementById("scale"+this.id);this.s.innerHTML="";}
