﻿var smpu=new Array();var smpd=new Array();var smpu2=new Array();var smpd2=new Array();var smpdef=new Array();var smpe=new Array();smpe[0]=new Array();smpe[1]=new Array();smpe[2]=new Array();smpe[3]=new Array();var smp00;var smp01;var smpY;var smpZ;var smpE=new Array();var smpEX=new Array();var smpEY=new Array();var smpEZ=new Array();var iMsw;var iMsh;var iMsEw=new Array();var iMsEh=new Array();var iSMDL;var iSMDx;var iSMDlx;var iSMDex;var iSMDy;var iSMDly;var iSMDey;var iMFNum=0;var iFMx=0;var iFMy=0;var iFMr=9;var iFMEx=0;var iFMEy=0;var iFMEr=new Array();iFMEr[0]=7;iFMEr[1]=7;iFMEr[2]=7;iFMEr[3]=7;var iOTFunction=0;var iOv=new Array();var oTimerTmp1;var oTimerTmp2;var oPlcrd=new Array();var iPlcrd=new Array();var iPlcrdX=new Array();var iPlcrdY=new Array();var oSlabel=new Array();var oPlcrdIfno1;var oPlcrdIfno2;var iPlcrdIfno2x;var oCanvas;var oCtx;var oPolyLine=new Array();var iPolyLine=new Array();var sms_map_m_over;var iMapViewW=-1;var iMapViewH=-1;var iPLAY_POLY_LINE_SPEED=1;var iNeedDectIMG=0;var bMouseClickEvent=true;var bSwitchRCMenu=false;var oSwitchRCMenu;var iSetMapActionLinePnt=-1;var plSetMapActionObject;var smc00a;var smc00b;var smc01;var smc02;var smc03;var smc04;var smc05;var smc08;var smc09;var smc10=new Array();var smc11;var smc12=new Array();var smc13;var smc14=new Array();var CBClickEvent;var CBRClickEvent;var CBDBClickEvent;var CBPlacardClickEvent;var CBGetCursorXY;var CBFlashMap;var CBMapMove;var CBPlacardK3Open;var CBMapDragOver;var CBPLDragOver;var CBPLMouseOver;var CBPLMouseOut;var CBMapDragCreate;var CBMapActionCreate;var bInCBPLMouseOver=false;var arNGVersion=navigator.appVersion.split("MSIE");var iNGVersion=parseFloat(arNGVersion[1]);setInterval("OnTimer()",10);function GWMapViewInfo(){this.iLayer=0;this.iScale=0;this.iRTx=0;this.iRTy=0;this.iLBx=0;this.iLBy=0}function GWMapIcon(sUrl,iw,ih,ipx,ipy){this.soUrl=sUrl;this.iow=iw;this.ioh=ih;this.iopx=ipx;this.iopy=ipy}function GWMapIcons(){this.Icons=new Array();this.iCount=0;this.AddIcon=OAddIcon;function OAddIcon(oSICon){if(typeof(oSICon.soUrl)=='undefined')return-1;this.Icons[this.iCount++]=oSICon;return this.iCount}}function GWPolyLine(oStPoint,iLineWidth,sColor,iType){this.StPoint=oStPoint;this.LtPoint=oStPoint;this.iLineWidth=iLineWidth;this.sColor=sColor;this.AddPoint=OAddPoint;if(typeof(iType)=='undefined')this.iType=0;else this.iType=iType;function OAddPoint(oStPoint){oStPoint.oPrePoint=this.LtPoint;this.LtPoint.oNextPoint=oStPoint;this.LtPoint=oStPoint}}function GWPoint(ipx,ipy,iSize,sColor){this.iX=ipx;this.iY=ipy;this.iSize=iSize;this.sColor=sColor;this.oPrePoint;this.oNextPoint}var PLCRD_STATUS=new Array();var oGPlcrd=new Array();function GWPlcrd(iKind,sIcon01,sIcon02,bCanClick,ix,iy,sStr01,sStr02,sVid,sTag){this.iStatus=0;this.iKind=iKind;if(typeof(sIcon01.soUrl)=='undefined')this.oIcon01=sIcon01.Icons[0];else this.oIcon01=sIcon01;if(typeof(sIcon02.soUrl)=='undefined')this.oIcon02=sIcon02.Icons[0];else this.oIcon02=sIcon02;this.bCanClick=bCanClick;this.iLx=ix;this.iLy=iy;this.iLStr01=sStr01;this.iLStr02=sStr02;this.sVid=sVid;this.sTag=sTag;this.getCID=OgetCID;this.getXY=OgetXY;this.oNIcon01=sIcon01;this.oNIcon02=sIcon02;this.iDragMode=-1;function OgetCID(){return this.sVid}function OgetXY(){return Array(this.iLx,this.iLy)}}function GWMap(mp){var iLp1;var iLp2;this.AddPlacard=OAddPlacard;this.AddPolyLine=OAddPolyLine;this.ClosePlacardK3=OClosePlacardK3;this.CloseRCMenu=OCloseRCMenu;this.GetMapStatus=OGetMapStatus;this.GetMapViewInfo=OGetMapViewInfo;this.GetPlacardInfo=OGetPlacardInfo;this.MoveTo=OMoveTo;this.MoveToRXY=OMoveToRXY;this.OpenPlacard=OOpenPlacard;this.PlayPolyLine=OPlayPolyLine;this.ReflashPlacard=OReflashPlacard;this.ReflashPolyLine=OReflashPolyLine;this.RemoveAllPlacard=ORemoveAllPlacard;this.RemoveAllPolyLine=ORemoveAllPolyLine;this.RemovePlacard=ORemovePlacard;this.RemovePolyLine=ORemovePolyLine;this.ScaleTo=OScaleTo;this.SetCBFunction=OSetCBFunction;this.SetMapAction=OSetMapAction;this.SetMapDrag=OSetMapDrag;this.SetMapStartRXY=OSetMapStartRXY;this.SetMapStatus=OSetMapStatus;this.SetMapStyle=OSetMapStyle;this.SetPlacardDragDrog=OSetPlacardDragDrog;this.SetPlayPLSpeed=OSetPlayPLSpeed;this.SetRCMenuContent=OSetRCMenuContent;this.ShowCrossPoint=OShowCrossPoint;this.ShowDebugInfo=OShowDebugInfo;this.ShowEagleEyeMap=OShowEagleEyeMap;this.ShowLayerControl=OShowLayerControl;this.ShowScale=OShowScale;this.SwitchRCMenu=OSwitchRCMenu;this.SetLandScaleShow=OSetLandScaleShow;smp00=mp;mp.style.overflow='hidden';if(!mp.style.position)mp.style.position='relative';mp.style.MozUserSelect='none';mp.unselectable='on';mp.style.backgroundColor='#99B3CC';smp01=document.createElement('div');smp01.style.cssText='position:absolute; left:10px; top:10px;width:250px; height:20px;z-index:99;';smp01.unselectable='on';mp.appendChild(smp01);OShowDebugInfo(SHOW_DEBUG_FLAG);iMapViewW=smp00.clientWidth;iMapViewH=smp00.clientHeight;smc00a=document.createElement('img');smc00a.style.cssText='position:absolute; left:'+((Math.floor(smp00.clientWidth/2)+1)-32)+'px; top:'+(Math.floor(smp00.clientHeight/2)+1)+'px;z-index:88;cursor:pointer;';smc00a.style.visibility='hidden';smc00a.src=MG_IMG_BASEURL+'CrossPointA.png';mp.appendChild(smc00a);smc00b=document.createElement('img');smc00b.style.cssText='position:absolute; left:'+(Math.floor(smp00.clientWidth/2)+1)+'px; top:'+((Math.floor(smp00.clientHeight/2)+1)-32)+'px;z-index:88;cursor:pointer;';smc00b.style.visibility='hidden';smc00b.src=MG_IMG_BASEURL+'CrossPointB.png';mp.appendChild(smc00b);smc01=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_H,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IA[0],false);ObjAttachEvent(smc01,"click",sm01c);mp.appendChild(smc01);smc02=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_H,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IA[1],false);ObjAttachEvent(smc02,"click",sm02c);mp.appendChild(smc02);smc03=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_H,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IA[2],false);ObjAttachEvent(smc03,"click",sm03c);mp.appendChild(smc03);smc04=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_H,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IA[3],false);ObjAttachEvent(smc04,"click",sm04c);mp.appendChild(smc04);smc05=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_H,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IA[4],false);ObjAttachEvent(smc05,"click",sm05c);mp.appendChild(smc05);smc08=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_H,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IA[5],false);ObjAttachEvent(smc08,"click",sm08c);mp.appendChild(smc08);smc09=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_H,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IA[6],false);ObjAttachEvent(smc09,"click",sm09c);mp.appendChild(smc09);for(iLp1=MG_SMP_RLEVEL_MIN;iLp1<=MG_SMP_RLEVEL_MAX;iLp1++){smc10[iLp1]=CLoadImageTransform(-100,-100,95,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_M,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IB[iLp1],false);ObjAttachEvent(smc10[iLp1],"click",sm10c);mp.appendChild(smc10[iLp1])}smc11=document.createElement('div');ObjAttachEvent(smc11,"mousedown",sm11m);mp.appendChild(smc11);OShowScale(SHOW_SCALE_FLAG,SCL_DIR_ICON_X,SCL_DIR_ICON_Y);for(iLp1=0;iLp1<LCL_BTN_ICON_N;iLp1++){sms_map_m_over=-1;smc12[iLp1]=document.createElement('div');ObjAttachEvent(smc12[iLp1],"click",sm12c);ObjAttachEvent(smc12[iLp1],"mouseover",sm12mov);ObjAttachEvent(smc12[iLp1],"mouseout",sm12mot);mp.appendChild(smc12[iLp1])}OShowLayerControl(SHOW_LCTRL_FLAG,LCL_BTN_ICON_X,LCL_BTN_ICON_Y);smc13=CLoadImageTransform(LOGO_LCTN_X,LOGO_LCTN_Y,89,LOGO_LCTN_W,LOGO_LCTN_H,0,MG_IMG_BASEURL+LOGO_LOGO_URL,SHOW_LOGO_FLAG,true,true,true);mp.appendChild(smc13);smc14[0]=document.createElement('div');smc14[1]=document.createElement('div');smc14[2]=document.createElement('div');MG_UpdateLandScale(smc14,true);mp.appendChild(smc14[0]);smc14[0].appendChild(smc14[1]);smc14[0].appendChild(smc14[2]);iMsw=Math.floor(mp.clientWidth/MG_SMP_WIDTH)+2;iMsh=Math.floor(mp.clientHeight/MG_SMP_HEIGHT)+2;smpZ=document.createElement('div');smpZ.style.cssText='position:absolute; left:0px; top:0px;width:'+(iMsw*MG_SMP_WIDTH)+'px; height:'+(iMsh*MG_SMP_HEIGHT)+'px;z-index:0;';mp.appendChild(smpZ);smpX=document.createElement('div');smpX.style.cssText='position:absolute; left:0px; top:0px;width:100%; height:100%; cursor:pointer; z-index:85;';smpX.unselectable='on';smpX.onclick=smc;smpX.onmousedown=smd;smpX.onmouseover=smo;smpX.ondblclick=smdc;if(CTRL_MOUSE_SCROLL_FLAG)ObjAttachEvent2(smpX,'DOMMouseScroll',"mousewheel",smw);ObjAttachEvent(document,"mousemove",smm);ObjAttachEvent(document,"mouseup",smu);ObjAttachEvent(document,"contextmenu",smrc);smpX.style.background='url('+MG_IMG_BASEURL+'sapce.png)';mp.appendChild(smpX);smpY=document.createElement('div');smpY.style.cssText='position:absolute; left:0px; top:0px;width:100%; height:100%; cursor:pointer; z-index:98;';smpY.unselectable='on';smpY.onclick=smc2;smpY.style.visibility=CTRL_ALL_ENEVT_FLAG?'hidden':'';mp.appendChild(smpY);smpdef[0]=document.createElement('img');smpdef[0].src=MG_IMG_BASEURL+MG_DFLT_MAPU_URL;smpdef[1]=document.createElement('img');smpdef[1].src=MG_IMG_BASEURL+MG_DFLT_MAPD_URL;for(iLp1=0;iLp1<iMsh;iLp1++)for(iLp2=0;iLp2<iMsw;iLp2++){smpu[iLp1*iMsw+iLp2]=document.createElement('img');smpu[iLp1*iMsw+iLp2].style.cssText='position:absolute; left:'+(iLp2*MG_SMP_WIDTH)+'px; top:'+(iLp1*MG_SMP_HEIGHT)+'px; z-index:3;';smpZ.appendChild(smpu[iLp1*iMsw+iLp2]);smpd[iLp1*iMsw+iLp2]=document.createElement('img');smpd[iLp1*iMsw+iLp2].style.cssText='position:absolute; left:'+(iLp2*MG_SMP_WIDTH)+'px; top:'+(iLp1*MG_SMP_HEIGHT)+'px; z-index:2;';smpZ.appendChild(smpd[iLp1*iMsw+iLp2]);smpu2[iLp1*iMsw+iLp2]=document.createElement('img');smpd2[iLp1*iMsw+iLp2]=document.createElement('img')}ChangeMapProfile();for(iLp1=0;iLp1<MG_PlCRD_MAX;iLp1++)PLCRD_STATUS[iLp1]=-1;iPlcrdIfno2x=-1;for(iLp1=0;iLp1<MG_PlCRD_SHOW_MAX;iLp1++){iPlcrd[iLp1]=-2}oPlcrdIfno1=document.createElement('div');oPlcrdIfno1.style.cssText='position:absolute;z-index:35;cursor:pointer;';oPlcrdIfno1.style.fontSize = '15px'; oPlcrdIfno1.style.visibility='hidden';oPlcrdIfno1.unselectable='on';smpZ.appendChild(oPlcrdIfno1);oPlcrdIfno2=document.createElement('div');oPlcrdIfno2.style.cssText='position:absolute;z-index:86;';oPlcrdIfno2.style.visibility='hidden';oPlcrdIfno2.unselectable='on';mp.appendChild(oPlcrdIfno2);oCanvas=document.createElement('canvas');oCanvas.style.cssText='position:absolute; left:0px; top:0px;z-index:25;';oCanvas.width=smpZ.clientWidth;oCanvas.height=smpZ.clientHeight;oCanvas.style.visibility='hidden';smpZ.appendChild(oCanvas);if(typeof G_vmlCanvasManager!='undefined'){G_vmlCanvasManager.initElement(oCanvas);oCanvas=smpZ.lastChild}oCtx=oCanvas.getContext('2d');oCtx.clearRect(0,0,oCanvas.width,oCanvas.height);oCtx.lineJoin='round';ORemoveAllPolyLine();for(iLp1=0;iLp1<4;iLp1++){smpE[iLp1]=document.createElement('div');smpE[iLp1].style.visibility='hidden';smpE[iLp1].unselectable='on';mp.appendChild(smpE[iLp1]);smpEZ[iLp1]=document.createElement('div');smpE[iLp1].appendChild(smpEZ[iLp1]);smpEY[iLp1]=CLoadImageTransform(80,80,80,10,10,1,MG_IMG_BASEURL+'blue.png',false,false,false,true);smpEY[iLp1].unselectable=smp00.unselectable;smpEY[iLp1].style.position='absolute';smpEY[iLp1].style.overflow='hidden';smpEY[iLp1].style.border='1px solid gray';smpE[iLp1].appendChild(smpEY[iLp1]);smpEX[iLp1]=document.createElement('div');smpEX[iLp1].style.cssText='position:absolute; left:0px; top:0px;width:100%; height:100%; cursor:pointer; z-index:85;';smpEX[iLp1].unselectable='on';smpEX[iLp1].onmousedown=smed;smpEX[iLp1].ondblclick=smedc;if(CTRL_MOUSE_SCROLL_FLAG)ObjAttachEvent2(smpEX[iLp1],'DOMMouseScroll',"mousewheel",smw);smpEX[iLp1].style.background='url('+MG_IMG_BASEURL+'sapce.png)';smpE[iLp1].appendChild(smpEX[iLp1]);OShowEagleEyeMap(iLp1,MG_EGL_EYE_SH[iLp1],MG_EGL_EYE_MW[iLp1],MG_EGL_EYE_MH[iLp1],MG_EGL_EYE_DR[iLp1],MG_EGL_EYE_MS[iLp1])}OSetMapStartRXY(SMS_MAP_X,SMS_MAP_Y,SMS_MAP_R);function OShowDebugInfo(bTF){if(bTF==true){SHOW_DEBUG_FLAG=true;smp01.style.visibility=''}else{SHOW_DEBUG_FLAG=false;smp01.style.visibility='hidden'}}function OShowCrossPoint(bTF){smc00a.style.visibility=bTF?'':'hidden';smc00b.style.visibility=bTF?'':'hidden'}function ObjAttachEvent(oObj,sEType,fFunName){if(oObj.addEventListener)oObj.addEventListener(sEType,fFunName,false);else if(oObj.attachEvent)oObj.attachEvent('on'+sEType,fFunName);else oObj['on'+sEType]=fFunName}function ObjAttachEvent2(oObj,sEType,sEType2,fFunName){if(oObj.addEventListener)oObj.addEventListener(sEType,fFunName,false);else if(oObj.attachEvent)oObj.attachEvent('on'+sEType2,fFunName);else oObj['on'+sEType2]=fFunName}function OSetCBFunction(sCBName,fFunName){switch(sCBName){case'ClickEvent':CBClickEvent=fFunName;break;case'RClickEvent':CBRClickEvent=fFunName;break;case'DBClickEvent':CBDBClickEvent=fFunName;break;case'PlacardClickEvent':CBPlacardClickEvent=fFunName;break;case'GetCursorXY':CBGetCursorXY=fFunName;break;case'FlashMap':CBFlashMap=fFunName;break;case'MapMove':CBMapMove=fFunName;break;case'PlacardK3Open':CBPlacardK3Open=fFunName;break;case'MapDragOver':CBMapDragOver=fFunName;break;case'PLDragOver':CBPLDragOver=fFunName;break;case'PLMouseOver':CBPLMouseOver=fFunName;break;case'PLMouseOut':CBPLMouseOut=fFunName;break;case'MapDragCreate':CBMapDragCreate=fFunName;break;case'MapActionCreate':CBMapActionCreate=fFunName;break;default:}}function OGetMapStatus(sFlagStr){var sRStr;if(typeof(sFlagStr)!='string')sFlagStr='0000000000000000000000000';else sFlagStr=sFlagStr+'0000000000000000000000000';sRStr='MapX;'+GetCenterHX()+';';sRStr=sRStr+'MapY;'+GetCenterHY()+';';sRStr=sRStr+'MapR;'+iFMr+';';sRStr=sRStr+'MapL;'+SMS_MAP_L+';';if(sFlagStr.substr(0,1)=='1'){sRStr=sRStr+'SCLF;'+SHOW_SCALE_FLAG+';';sRStr=sRStr+'SCLX;'+SCL_DIR_ICON_X+';';sRStr=sRStr+'SCLY;'+SCL_DIR_ICON_Y+';'}return escape(sRStr)}function OSetMapStatus(sStatusStr){var aTmpStr;var aStStr=new Array();var iLp1;if(typeof(sStatusStr)!='string')return false;try{aTmpStr=unescape(sStatusStr).split(";")}catch(err){return false}for(iLp1=0;typeof(aTmpStr[iLp1])=='string'&&typeof(aTmpStr[iLp1+1])=='string';iLp1+=2)aStStr[aTmpStr[iLp1]]=aTmpStr[iLp1+1];if(typeof(aStStr['MapL'])=='string')OSetMapStyle(Math.floor(aStStr['MapL']));if(typeof(aStStr['MapX'])=='string'&&typeof(aStStr['MapY'])=='string'&&typeof(aStStr['MapR'])=='string')OMoveToRXY(aStStr['MapX']*1,aStStr['MapY']*1,Math.floor(aStStr['MapR']),false);if(typeof(aStStr['SCLF'])=='string'&&typeof(aStStr['SCLX'])=='string'&&typeof(aStStr['SCLY'])=='string')OShowScale(aStStr['SCLF']=='true',Math.floor(aStStr['SCLX']),Math.floor(aStStr['SCLY']))}function OGetMapViewInfo(oVInfo){try{oVInfo.iLayer=SMS_MAP_L;oVInfo.iScale=iFMr;oVInfo.iRTx=GetCenterHX(0);oVInfo.iRTy=GetCenterHY(0);oVInfo.iLBx=GetCenterHX(smp00.clientWidth+1);oVInfo.iLBy=GetCenterHY(smp00.clientHeight+1)}catch(err){return false}}function OSetPlayPLSpeed(iSpeed,iTimer){iPLAY_POLY_LINE_SPEED=iSpeed;if(typeof(iTimer)!='undefined')PLAY_POLY_LINE_TIMER=iTimer}function OClosePlacardK3(){if(iPlcrdIfno2x>=0){oGPlcrd[iPlcrdIfno2x].iStatus=0;oPlcrdIfno2.innerHTML='';oPlcrdIfno2.style.visibility='hidden'}}function OOpenPlacard(iPnt){if(iPnt>=0&&iPnt<MG_PlCRD_MAX)if(PLCRD_STATUS[iPnt]>=0)CheckPLCRDClick2(iPnt,null,false)}function OScaleTo(iLy){OMoveToRXY(GetCenterHX(),GetCenterHY(),iLy,false)}function OMoveTo(fx,fy,sm){OMoveToRXY(fx,fy,iFMr,sm)}function OSetPlacardDragDrog(iIndex,iDragDrog){if(typeof(iIndex)=='number'){if(iIndex>=0&&iIndex<MG_PlCRD_MAX&&typeof(iDragDrog)=='number')oGPlcrd[iIndex].iDragMode=iDragDrog}else if(typeof(iIndex)=='boolean')MG_PlCRD_DRAG_DROG=iIndex}function CreateRCMenu(){oSetRCMenuContent=document.createElement('div');oSetRCMenuContent.style.cssText='position:absolute;z-index:86;';oSetRCMenuContent.style.visibility='hidden';oSetRCMenuContent.unselectable='on';mp.appendChild(oSetRCMenuContent)}function OSwitchRCMenu(bSwitch){bSwitchRCMenu=bSwitch}function OSetRCMenuContent(sTmp){if(typeof(oSetRCMenuContent)!='object')CreateRCMenu();oSetRCMenuContent.innerHTML=sTmp}function OCloseRCMenu(){if(typeof(oSetRCMenuContent)=='object')oSetRCMenuContent.style.visibility='hidden'}function OSetMapDrag(iMode){if(iMode>-1&&iMode<3)MG_MAP_DRAG_MODE=Math.floor(iMode)}function OSetMapAction(iMode){if(iMode>-1&&iMode<3)MG_MAP_ACTION_MODE=Math.floor(iMode)}}function smc(evSrc){var iX,iY;if(!evSrc)evSrc=window.event;if(bMouseClickEvent){if(CheckPLCRDClick(evSrc,true)==false)if(typeof(CBClickEvent)=='function')CBClickEvent(GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft),GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop),evSrc);if(MG_MAP_ACTION_MODE>0){iX=GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft);iY=GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop);if(iSetMapActionLinePnt<0){plSetMapActionObject=new GWPolyLine(new GWPoint(iX,iY,MG_MAP_ACTION_PW,MG_MAP_ACTION_PC),MG_MAP_ACTION_LW,MG_MAP_ACTION_LC,MG_MAP_ACTION_MODE==1?0:2);iSetMapActionLinePnt=OAddPolyLine(plSetMapActionObject)}else if(iX!=plSetMapActionObject.LtPoint.iX||iY!=plSetMapActionObject.LtPoint.iY)plSetMapActionObject.AddPoint(new GWPoint(iX,iY,MG_MAP_ACTION_PW,MG_MAP_ACTION_PC));OReflashPolyLine()}}}function smc2(evSrc){if(CTRL_CLICK_STOP_PROGRESS)OnTimer(true);StopEvent(evSrc)}function smd(evSrc){if(!evSrc)evSrc=window.event;if(isNaN(evSrc.which)||evSrc.button==0){bMouseClickEvent=true;if(CheckPLCRDClick(evSrc,false)){if(iPLMouseIndex>=0){if((oGPlcrd[iPLMouseIndex].iDragMode<0&&MG_PlCRD_DRAG_DROG)||oGPlcrd[iPLMouseIndex].iDragMode>0){iSMDx=GetMouseX(evSrc);iSMDy=GetMouseY(evSrc);iSMDlx=iPLMouseIndex;iSMDly=-1;iSMDex=oGPlcrd[iPLMouseIndex].iLx;iSMDey=oGPlcrd[iPLMouseIndex].iLy;iMFNum=4}}}else{switch(MG_MAP_DRAG_MODE){case 0:iSMDx=GetMouseX(evSrc);iSMDy=GetMouseY(evSrc);iSMDlx=GetCenterHX();iSMDly=GetCenterHY();iSMDex=iSMDlx;iSMDey=iSMDly;iMFNum=1;break;case 1:case 2:iSMDx=-1;iSMDy=-1;iSMDlx=GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft);iSMDly=GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop);iSMDex=iSMDlx;iSMDey=iSMDly;iMFNum=4+MG_MAP_DRAG_MODE;break}}if(SHOW_DEBUG_FLAG)smp01.innerHTML='smd = '+Math.floor(GetCenterHX())+' , '+Math.floor(GetCenterHY())}}function smed(evSrc){var ix;var iy;var iLp1;if(!evSrc)evSrc=window.event;ix=GetMouseX(evSrc)-smp00.offsetLeft;iy=GetMouseY(evSrc)-smp00.offsetTop;for(iLp1=0;iLp1<4;iLp1++)if(MG_EGL_EYE_SH[iLp1]==true)if(ix>=smpE[iLp1].offsetLeft&&ix<smpE[iLp1].offsetLeft+smpE[iLp1].clientWidth&&iy>=smpE[iLp1].offsetTop&&iy<smpE[iLp1].offsetTop+smpE[iLp1].clientHeight){iSMDL=iLp1;break}iSMDx=GetMouseX(evSrc);iSMDy=GetMouseY(evSrc);iSMDlx=GetCenterHX();iSMDly=GetCenterHY();iSMDex=iSMDlx;iSMDey=iSMDly;iMFNum=3}function smu(evSrc){var iLp1;switch(iMFNum){case 1:if((iSMDex!=iSMDlx||iSMDey!=iSMDly)&&typeof(CBMapDragOver)=='function')CBMapDragOver(iFMr,GetCenterHX(0),GetCenterHY(0),GetCenterHX(smp00.clientWidth),GetCenterHY(smp00.clientHidth));break;case 3:if(iSMDex!=iSMDlx||iSMDey!=iSMDly)OMoveToRXY(iSMDex,iSMDey,iFMr,true);break;case 4:if(typeof(CBPLDragOver)=='function')CBPLDragOver(iSMDlx,oGPlcrd[iSMDlx].iLx, oGPlcrd[iSMDlx].iLy);break;case 5:if(iSMDx>=0)if(typeof(CBMapDragCreate)=='function')CBMapDragCreate(iSMDx,iSMDlx,iSMDly,iSMDex,iSMDey);break;case 6:if(iSMDx>=0){ORemovePolyLine(iSMDx);OReflashPolyLine();iSMDx=Math.abs(iSMDex-iSMDlx);iSMDy=Math.abs(iSMDey-iSMDly);for(iLp1=MG_SMP_RLEVEL_MIN;iLp1<MG_SMP_RLEVEL_MAX;iLp1++)if(Math.abs(smp00.clientWidth/MG_MAP_LOCACTION_W[iLp1]*MG_MAP_LOCACTION_SW[iLp1]*1.2)>iSMDx&&Math.abs(smp00.clientHeight/MG_MAP_LOCACTION_H[iLp1]*MG_MAP_LOCACTION_SH[iLp1]*1.2)>iSMDy)break;OMoveToRXY((iSMDlx+iSMDex)/2,(iSMDly+iSMDey)/2,iLp1,false)}break}iMFNum=0}var iNeedRClick=1;var lNeedRClickX=-1;var lNeedRClickY=-1;function smrc(evSrc){if(!evSrc)evSrc=window.event;if(GetMouseX(evSrc)>=smp00.offsetLeft&&GetMouseX(evSrc)<=smp00.offsetLeft+smp00.clientWidth&&GetMouseY(evSrc)>=smp00.offsetTop&&GetMouseY(evSrc)<=smp00.offsetTop+smp00.clientHeight){if(iNeedRClick==1||lNeedRClickX!=GetMouseX(evSrc)||lNeedRClickY!=GetMouseY(evSrc)){iNeedRClick=0;lNeedRClickX=GetMouseX(evSrc);lNeedRClickY=GetMouseY(evSrc);if(smpY.style.visibility=='')smc2(evSrc);else{if(typeof(CBRClickEvent)=='function')CBRClickEvent(GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft),GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop),evSrc);if(bSwitchRCMenu==true){if(typeof(oSetRCMenuContent)!='object')CreateRCMenu();oSetRCMenuContent.style.left=(GetMouseX(evSrc)-smp00.offsetLeft)+'px';oSetRCMenuContent.style.top=(GetMouseY(evSrc)-smp00.offsetTop)+'px';oSetRCMenuContent.style.visibility=''}}}StopEvent(evSrc);return false}}function smm(evSrc){var ix,iy;if(!evSrc)evSrc=window.event;bMouseClickEvent=false;ix=GetMouseX(evSrc);iy=GetMouseY(evSrc);switch(iMFNum){case 1:smm01(evSrc,ix,iy);break;case 2:sm10c(evSrc);if(isNaN(evSrc.which)&&evSrc.button!=MOUSE_BTN_LEFT)smu(evSrc);break;case 3:smm03(evSrc,ix,iy);break;case 4:smm04(evSrc,ix,iy);break;case 5:case 6:smm05(evSrc,ix,iy);break}if(SHOW_DEBUG_FLAG)smp01.innerHTML='smm = '+Math.floor(GetCenterHX())+' , '+Math.floor(GetCenterHY());if(GetMouseX(evSrc)>=smp00.offsetLeft&&GetMouseX(evSrc)<=smp00.offsetLeft+smp00.clientWidth&&GetMouseY(evSrc)>=smp00.offsetTop&&GetMouseY(evSrc)<=smp00.offsetTop+smp00.clientHeight)if(typeof(CBGetCursorXY)=='function')CBGetCursorXY(GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft),GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop),evSrc);CheckPLCRDClick(evSrc,false)}function smm01(evSrc,ix,iy){iSMDex=iSMDlx+GetCenterHX(iSMDx)-GetCenterHX(ix);iSMDey=iSMDly+GetCenterHY(iSMDy)-GetCenterHY(iy);OMoveToRXY(iSMDex,iSMDey,iFMr,false);if(typeof(CBMapMove)=='function')CBMapMove(iFMr,GetCenterHX(0),GetCenterHY(0),GetCenterHX(smp00.clientWidth),GetCenterHY(smp00.clientHidth));if(isNaN(evSrc.which)&&evSrc.button!=MOUSE_BTN_LEFT)smu(evSrc);StopEvent(evSrc)}function smm03(evSrc,ix,iy){var iLp1;iSMDex=iSMDlx+(GetCenterHX(iSMDx)-GetCenterHX(ix))/((MG_MAP_LOCACTION_SW[iFMr]/MG_MAP_LOCACTION_W[iFMr])/(MG_MAP_LOCACTION_SW[iFMEr[iSMDL]]/MG_MAP_LOCACTION_W[iFMEr[iSMDL]]));iSMDey=iSMDly+(GetCenterHY(iSMDy)-GetCenterHY(iy))/((MG_MAP_LOCACTION_SH[iFMr]/MG_MAP_LOCACTION_H[iFMr])/(MG_MAP_LOCACTION_SH[iFMEr[iSMDL]]/MG_MAP_LOCACTION_H[iFMEr[iSMDL]]));for(iLp1=0;iLp1<4;iLp1++)OMoveToRXYE(iLp1,iSMDex,iSMDey,iFMr,false);if(isNaN(evSrc.which)&&evSrc.button!=MOUSE_BTN_LEFT)smu(evSrc);StopEvent(evSrc)}function smm04(evSrc,ix,iy){var iLp1;oGPlcrd[iSMDlx].iLx=iSMDex-GetCenterHX(iSMDx)+GetCenterHX(ix);oGPlcrd[iSMDlx].iLy=iSMDey-GetCenterHY(iSMDy)+GetCenterHY(iy);OReflashPlacard();if(isNaN(evSrc.which)&&evSrc.button!=MOUSE_BTN_LEFT)smu(evSrc);StopEvent(evSrc)}function smm05(evSrc,ix,iy){var iLp1;var p1;iSMDex=GetCenterHX(ix-smp00.offsetLeft<0?0:(ix-smp00.offsetLeft>=smp00.clientWidth?smp00.clientWidth-1:ix-smp00.offsetLeft));iSMDey=GetCenterHY(iy-smp00.offsetTop<0?0:(iy-smp00.offsetTop>=smp00.clientHeight?smp00.clientHeight-1:iy-smp00.offsetTop));if(iSMDx>=0)ORemovePolyLine(iSMDx);p1=new GWPolyLine(new GWPoint(iSMDlx,iSMDly),MG_MAP_DRAG_MSK_LW,MG_MAP_DRAG_MSK_COLOR,MG_MAP_DRAG_MSK_MODE);p1.AddPoint(new GWPoint(iSMDlx,iSMDey));p1.AddPoint(new GWPoint(iSMDex,iSMDey));p1.AddPoint(new GWPoint(iSMDex,iSMDly));iSMDx=OAddPolyLine(p1);OReflashPolyLine();if(isNaN(evSrc.which)&&evSrc.button!=MOUSE_BTN_LEFT)smu(evSrc);StopEvent(evSrc)}function smo(){}function smw(evSrc){var delta=0;var iTmpFMr;if(!evSrc)evSrc=window.event;if(evSrc.wheelDelta){delta=evSrc.wheelDelta/120;if(window.opera)delta=-delta}else if(evSrc.detail)delta=-1*evSrc.detail/3;if(delta<0)iTmpFMr=iFMr+1;else if(delta>0)iTmpFMr=iFMr-1;else iTmpFMr=iFMr;if(iTmpFMr!=iFMr)OMoveToRXY(GetCenterHX(),GetCenterHY(),iTmpFMr,false);if(SHOW_DEBUG_FLAG)smp01.innerHTML='smw = '+iFMr+' , '+delta;StopEvent(evSrc);return false}function smdc(evSrc){if(!evSrc)evSrc=window.event;if(CheckPLCRDClick(evSrc,false)==false){switch(MG_MAP_ACTION_MODE){case 0:switch(MG_DBCLICK_TYPE){case 2:OMoveToRXY(GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft),GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop),iFMr-1,false);break;default:OMoveToRXY(GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft),GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop),iFMr,true)}if(typeof(CBDBClickEvent)=='function')CBDBClickEvent(GetCenterHX(GetMouseX(evSrc)-smp00.offsetLeft),GetCenterHY(GetMouseY(evSrc)-smp00.offsetTop),evSrc);break;case 1:case 2:if(iSetMapActionLinePnt>=0){if(typeof(CBMapActionCreate)=='function')CBMapActionCreate(iSetMapActionLinePnt,plSetMapActionObject);iSetMapActionLinePnt=-1}break}}}function smedc(evSrc){var ix;var iy;var iLp1;if(!evSrc)evSrc=window.event;ix=GetMouseX(evSrc)-smp00.offsetLeft;iy=GetMouseY(evSrc)-smp00.offsetTop;for(iLp1=0;iLp1<4;iLp1++)if(MG_EGL_EYE_SH[iLp1]==true)if(ix>=smpE[iLp1].offsetLeft&&ix<smpE[iLp1].offsetLeft+smpE[iLp1].clientWidth&&iy>=smpE[iLp1].offsetTop&&iy<smpE[iLp1].offsetTop+smpE[iLp1].clientHeight){ix=smp00.clientWidth/2-(smpE[iLp1].clientWidth/2-(ix-smpE[iLp1].offsetLeft))/((MG_MAP_LOCACTION_SW[iFMr]/MG_MAP_LOCACTION_W[iFMr])/(MG_MAP_LOCACTION_SW[iFMEr[iLp1]]/MG_MAP_LOCACTION_W[iFMEr[iLp1]]));iy=smp00.clientHeight/2-(smpE[iLp1].clientHeight/2-(iy-smpE[iLp1].offsetTop))/((MG_MAP_LOCACTION_SH[iFMr]/MG_MAP_LOCACTION_H[iFMr])/(MG_MAP_LOCACTION_SH[iFMEr[iLp1]]/MG_MAP_LOCACTION_H[iFMEr[iLp1]]));OMoveToRXY(GetCenterHX(ix),GetCenterHY(iy),iFMr,true);break}if(typeof(CBDBClickEvent)=='function')CBDBClickEvent(GetCenterHX(ix),GetCenterHY(iy),evSrc)}function sm01c(evSrc){if(!evSrc)evSrc=window.event;OMoveToRXY(GetCenterHX(),GetCenterHY(smp00.clientHeight/6),iFMr,true)}function sm02c(evSrc){if(!evSrc)evSrc=window.event;OMoveToRXY(GetCenterHX(),GetCenterHY(smp00.clientHeight*5/6),iFMr,true)}function sm03c(evSrc){if(!evSrc)evSrc=window.event;OMoveToRXY(GetCenterHX(smp00.clientWidth/6),GetCenterHY(),iFMr,true)}function sm04c(evSrc){if(!evSrc)evSrc=window.event;OMoveToRXY(GetCenterHX(smp00.clientWidth*5/6),GetCenterHY(),iFMr,true)}function sm05c(evSrc){if(!evSrc)evSrc=window.event;OMoveToRXY(SMS_MAP_X,SMS_MAP_Y,SMS_MAP_R,true)}function sm08c(evSrc){if(!evSrc)evSrc=window.event;OMoveToRXY(GetCenterHX(),GetCenterHY(),iFMr-1,false)}function sm09c(evSrc){if(!evSrc)evSrc=window.event;OMoveToRXY(GetCenterHX(),GetCenterHY(),iFMr+1,false)}function sm10c(evSrc){var isy;if(!evSrc)evSrc=window.event;isy=GetMapSCLLvl(evSrc);if(isy!=iFMr)OMoveToRXY(GetCenterHX(),GetCenterHY(),isy,false);if(SHOW_DEBUG_FLAG)smp01.innerHTML='sm10c = '+isy}function sm11m(evSrc){iMFNum=2}function sm12c(evSrc){var isy;var lbx;if(!evSrc)evSrc=window.event;lbx=LCL_BTN_ICON_X>=0?LCL_BTN_ICON_X:smp00.clientWidth+LCL_BTN_ICON_X-((LCL_BTN_ICON_W+LCL_BTN_ICON_B*2+LCL_BTN_ICON_S)*LCL_BTN_ICON_N-LCL_BTN_ICON_S);isy=GetMouseX(evSrc)-smp00.offsetLeft-lbx;isy=Math.floor(isy/(LCL_BTN_ICON_B*2+LCL_BTN_ICON_W+LCL_BTN_ICON_S));if(isy!=SMS_MAP_L)OSetMapStyle(isy);if(SHOW_DEBUG_FLAG)smp01.innerHTML='sm12c = '+isy}function sm12mov(evSrc){var isy;var lbx;if(!evSrc)evSrc=window.event;lbx=LCL_BTN_ICON_X>=0?LCL_BTN_ICON_X:smp00.clientWidth+LCL_BTN_ICON_X-((LCL_BTN_ICON_W+LCL_BTN_ICON_B*2+LCL_BTN_ICON_S)*LCL_BTN_ICON_N-LCL_BTN_ICON_S);isy=GetMouseX(evSrc)-smp00.offsetLeft-lbx;isy=Math.floor(isy/(LCL_BTN_ICON_B*2+LCL_BTN_ICON_W+LCL_BTN_ICON_S));if(isy!=SMS_MAP_L&&isy!=sms_map_m_over){LoadImageTransform(smc12[isy],LCL_BTN_ICON_X+(LCL_BTN_ICON_W+LCL_BTN_ICON_B*2+LCL_BTN_ICON_S)*(LCL_BTN_ICON_X>=0?isy:(isy+1-LCL_BTN_ICON_N)),LCL_BTN_ICON_Y,97,LCL_BTN_ICON_W,LCL_BTN_ICON_H,LCL_BTN_ICON_B,MG_IMG_BASEURL+'lcl'+isy+'1.png',true,LCL_BTN_ICON_X<0,true);sms_map_m_over=isy}if(SHOW_DEBUG_FLAG)smp01.innerHTML='sm12mov = '+isy}function sm12mot(evSrc){if(sms_map_m_over>=0){if(sms_map_m_over!=SMS_MAP_L)LoadImageTransform(smc12[sms_map_m_over],LCL_BTN_ICON_X+(LCL_BTN_ICON_W+LCL_BTN_ICON_B*2+LCL_BTN_ICON_S)*(LCL_BTN_ICON_X>=0?sms_map_m_over:(sms_map_m_over+1-LCL_BTN_ICON_N)),LCL_BTN_ICON_Y,97,LCL_BTN_ICON_W,LCL_BTN_ICON_H,LCL_BTN_ICON_B,MG_IMG_BASEURL+'lcl'+sms_map_m_over+'0.png',true,LCL_BTN_ICON_X<0,true);sms_map_m_over=-1}if(SHOW_DEBUG_FLAG)smp01.innerHTML='sm12mot'}var iPLMouseIndex=-1;function CheckPLCRDClick(evSrc,bActive){return CheckPLCRDClick2(-1,evSrc,bActive)}function CheckPLCRDClick2(iChkPLID,evSrc,bActive){var isx;var isy;var iLp1;var iLp2;var iRV;var inRB;var iCCkind;var iNeedClose;var iFirstChk;if(!evSrc)evSrc=window.event;isx=GetMouseX(evSrc)-smp00.offsetLeft-iFMx;isy=GetMouseY(evSrc)-smp00.offsetTop-iFMy;iRV=false;iNeedClose=false;inRB=-1;if(iChkPLID<0)iFirstChk=iPLMouseIndex;else iFirstChk=iChkPLID;if(iChkPLID<0&&oPlcrdIfno1.style.visibility==''&&isx>=oPlcrdIfno1.offsetLeft&&isx<oPlcrdIfno1.offsetLeft+oPlcrdIfno1.clientWidth&&isy>=oPlcrdIfno1.offsetTop&&isy<oPlcrdIfno1.offsetTop+oPlcrdIfno1.clientHeight)if(bActive){oPlcrdIfno1.style.visibility='hidden';inRB=99999999;iNeedClose=true;iRV=true}else{for(iLp1=MG_PlCRD_SHOW_MAX-1;iLp1>=0;iLp1--)if(iPlcrd[iLp1]>=0)switch(oGPlcrd[iPlcrd[iLp1]].iKind){case 0:case 3:case 4:if(oGPlcrd[iPlcrd[iLp1]].iStatus==1){inRB=iLp1;iLp1=0}}iRV=true}else for(iLp2=0;iLp2<2;iLp2++)for(iLp1=MG_PlCRD_SHOW_MAX-1;iLp1>=0;iLp1--)if(iPlcrd[iLp1]>=0&&((iLp2==0&&iPlcrd[iLp1]==iFirstChk)||iLp2==1)){if(iChkPLID>=0)bActive=true;switch(oGPlcrd[iPlcrd[iLp1]].iKind){case 0:case 1:case 3:case 4:if(iRV==false&&((iChkPLID<0&&isx>=iPlcrdX[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon01.iopx&&isx<iPlcrdX[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon01.iopx+oPlcrd[iLp1].clientWidth&&isy>=iPlcrdY[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon01.iopy&&isy<iPlcrdY[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon01.iopy+oPlcrd[iLp1].clientHeight)||(iChkPLID>=0&&iLp2==0&&iPlcrd[iLp1]==iFirstChk))){if(bActive&&oGPlcrd[iPlcrd[iLp1]].iStatus==0){if(oGPlcrd[iPlcrd[iLp1]].iKind==0||oGPlcrd[iPlcrd[iLp1]].iKind==3||oGPlcrd[iPlcrd[iLp1]].iKind==4){oGPlcrd[iPlcrd[iLp1]].iStatus=1;if(oGPlcrd[iPlcrd[iLp1]].iKind==0){oPlcrdIfno1.innerHTML=GetHTMLPlacard(300,150,oGPlcrd[iPlcrd[iLp1]].iLStr01);oPlcrdIfno1.style.left=(iPlcrdX[iLp1]+oGPlcrd[iPlcrd[iLp1]].oIcon01.iow/2)+'px';oPlcrdIfno1.style.bottom=(smpZ.clientHeight-iPlcrdY[iLp1]+oGPlcrd[iPlcrd[iLp1]].oIcon01.ioh)+'px';oPlcrdIfno1.style.visibility='';iPlcrdIfno2x=-1;oPlcrdIfno2.innerHTML='';oPlcrdIfno2.style.visibility='hidden'}else{iPlcrdIfno2x=iPlcrd[iLp1];if(typeof(CBPlacardK3Open)=='function')CBPlacardK3Open(oPlcrdIfno2,iPlcrdIfno2x);else oPlcrdIfno2.innerHTML=GetHTMLPlacard(300,150,oGPlcrd[iPlcrdIfno2x].iLStr01);oPlcrdIfno2.style.position='absolute';oPlcrdIfno2.style.zIndex=86;oPlcrdIfno2.style.left=(GetCenterLX(oGPlcrd[iPlcrdIfno2x].iLx)+iFMx+oGPlcrd[iPlcrdIfno2x].oIcon01.iow/2)+'px';oPlcrdIfno2.style.bottom=(smp00.clientHeight-GetCenterLY(oGPlcrd[iPlcrdIfno2x].iLy)-iFMy+oGPlcrd[iPlcrdIfno2x].oIcon01.ioh)+'px';oPlcrdIfno2.style.visibility='';oPlcrdIfno1.style.visibility='hidden'}iNeedClose=true}}if(oGPlcrd[iPlcrd[iLp1]].iStatus==0)iRV=true;inRB=iLp1;iLp2=2;iLp1=0}break}}if(iChkPLID>=0&&iRV==false){oGPlcrd[iChkPLID].iStatus=1;if(oGPlcrd[iChkPLID].iKind==0)iPlcrdIfno2x=-1;else iPlcrdIfno2x=iChkPLID;oPlcrdIfno1.style.visibility='hidden';oPlcrdIfno2.innerHTML='';oPlcrdIfno2.style.visibility='hidden';iRV=true;inRB=iChkPLID;iNeedClose=true}if(iNeedClose==true)for(iLp1=MG_PlCRD_SHOW_MAX-1;iLp1>=0;iLp1--)if(iPlcrd[iLp1]>=0){switch(oGPlcrd[iPlcrd[iLp1]].iKind){case 0:case 3:case 4:if(inRB>=0&&((iChkPLID<0&&inRB!=iLp1)||(iChkPLID>=0&&inRB!=iPlcrd[iLp1]))&&oGPlcrd[iPlcrd[iLp1]].iStatus==1){oGPlcrd[iPlcrd[iLp1]].iStatus=0;if(inRB==99999999)inRB=iLp1}}}if(bActive==true&&iRV==true)if(inRB>=0&&typeof(CBPlacardClickEvent)=='function')if(iChkPLID>=0)CBPlacardClickEvent(iChkPLID,oGPlcrd[iChkPLID].iStatus);else CBPlacardClickEvent(iPlcrd[inRB],oGPlcrd[iPlcrd[inRB]].iStatus);if(inRB<0||inRB==99999999)inRB=-1;else if(iChkPLID<0)inRB=iPlcrd[inRB];if(iPLMouseIndex!=inRB){var bPLNeedFlash;var iIndexTmp;bPLNeedFlash=false;if(iPLMouseIndex!=-1){if(typeof(CBPLMouseOut)=='function')CBPLMouseOut(iPLMouseIndex);iIndexTmp=iPLMouseIndex;if(typeof(oGPlcrd[iIndexTmp].oNIcon01.soUrl)=='undefined'){oGPlcrd[iIndexTmp].oIcon01=oGPlcrd[iIndexTmp].oNIcon01.Icons[0];bPLNeedFlash=true}if(typeof(oGPlcrd[iIndexTmp].oNIcon02.soUrl)=='undefined'){oGPlcrd[iIndexTmp].oIcon02=oGPlcrd[iIndexTmp].oNIcon02.Icons[0];bPLNeedFlash=true}}if(inRB!=-1){if(typeof(CBPLMouseOver)=='function'&&bInCBPLMouseOver==false){bInCBPLMouseOver=true;CBPLMouseOver(inRB);bInCBPLMouseOver=false}iIndexTmp=inRB;if(iChkPLID<0&&oGPlcrd[iIndexTmp].iKind==4&&bActive==false)CheckPLCRDClick(evSrc,true);if(typeof(oGPlcrd[iIndexTmp].oNIcon01.soUrl)=='undefined'){oGPlcrd[iIndexTmp].oIcon01=oGPlcrd[iIndexTmp].oNIcon01.Icons[1];bPLNeedFlash=true}if(typeof(oGPlcrd[iIndexTmp].oNIcon02.soUrl)=='undefined'){oGPlcrd[iIndexTmp].oIcon02=oGPlcrd[iIndexTmp].oNIcon02.Icons[1];bPLNeedFlash=true}}if(bPLNeedFlash==true)OReflashPlacard();for(iLp1=0;iLp1<MG_PlCRD_SHOW_MAX;iLp1++){if(iPlcrd[iLp1]==iPLMouseIndex&&iPLMouseIndex>=0)oPlcrd[iLp1].style.zIndex=31;if(iPlcrd[iLp1]==inRB&&inRB>=0)oPlcrd[iLp1].style.zIndex=32}iPLMouseIndex=inRB}return iRV}function GetMapSCLLvl(evSrc){var isy;isy=SCL_DIR_ICON_Y+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)*4;isy=GetMouseY(evSrc)-smp00.offsetTop-isy;if(SCL_DIR_ICON_B*2+SCL_DIR_ICON_M==0)isy=MG_SMP_LRL_MIN[SMS_MAP_L];else isy=Math.floor(isy/(SCL_DIR_ICON_B*2+SCL_DIR_ICON_M))+MG_SMP_LRL_MIN[SMS_MAP_L];return isy}var iStartX=3;var iStartY=1;var iStartR=-1;function ChangeMapPic(iMoveX,iMoveY){var iLp1;if(iMoveX==0&&iMoveY==0&&iStartR==iFMr)return;iStartX=iStartX+iMoveX;iStartY=iStartY+iMoveY;iStartR=iFMr;ChangeMapPicT();for(iLp1=0;iLp1<4;iLp1++)ChangeMapEArea(iLp1)}var iSMS_MAP_LST=-1;var iFMrST=-1;var iStartXST=-1;var iStartYST=-1;function ChangeMapPicT(){var iLp1;var iLp2;var ssu=new Array();var ssd=new Array();for(iLp1=0;iLp1<iMsh;iLp1++)for(iLp2=0;iLp2<iMsw;iLp2++){if(MG_MAP_LBDIR_U[SMS_MAP_L]!='')ssu[iLp1*iMsw+iLp2]=smpu[iLp1*iMsw+iLp2].src;if(MG_MAP_LBDIR_D[SMS_MAP_L]!='')ssd[iLp1*iMsw+iLp2]=smpd[iLp1*iMsw+iLp2].src}for(iLp1=0;iLp1<iMsh;iLp1++)for(iLp2=0;iLp2<iMsw;iLp2++){if(MG_MAP_LBDIR_U[SMS_MAP_L]!='')smpu2[iLp1*iMsw+iLp2].src=MG_MAP_BASEURL+MG_MAP_LBDIR_U[SMS_MAP_L]+iFMr+'/'+Math.floor((iStartY+iLp1)/4+1)+'/'+Math.floor((iStartX+iLp2)/5+1)+'/'+Math.floor((iStartY+iLp1)/4+1)+'_'+Math.floor((iStartX+iLp2)/5+1)+'_'+((iStartY+iLp1)%4+1)+'_'+((iStartX+iLp2)%5+1)+'.png';if(MG_MAP_LBDIR_D[SMS_MAP_L]!='')smpd2[iLp1*iMsw+iLp2].src=MG_MAP_BASEURL+MG_MAP_LBDIR_D[SMS_MAP_L]+iFMr+'/'+Math.floor((iStartY+iLp1)/4+1)+'/'+Math.floor((iStartX+iLp2)/5+1)+'/'+Math.floor((iStartY+iLp1)/4+1)+'_'+Math.floor((iStartX+iLp2)/5+1)+'_'+((iStartY+iLp1)%4+1)+'_'+((iStartX+iLp2)%5+1)+'.png'}for(iLp1=0;iLp1<iMsh;iLp1++)for(iLp2=0;iLp2<iMsw;iLp2++){if(MG_MAP_LBDIR_U[SMS_MAP_L]!=''){if(iSMS_MAP_LST==SMS_MAP_L&&iFMr==iFMrST&&iStartX+iLp2>=iStartXST&&iStartX+iLp2<iStartXST+iMsw&&iStartY+iLp1>=iStartYST&&iStartY+iLp1<iStartYST+iMsh)smpu[iLp1*iMsw+iLp2].src=ssu[(iLp1+iStartY-iStartYST)*iMsw+iLp2+iStartX-iStartXST];else smpu[iLp1*iMsw+iLp2].src=smpdef[0].src}if(MG_MAP_LBDIR_D[SMS_MAP_L]!=''){if(iSMS_MAP_LST==SMS_MAP_L&&iFMr==iFMrST&&iStartX+iLp2>=iStartXST&&iStartX+iLp2<iStartXST+iMsw&&iStartY+iLp1>=iStartYST&&iStartY+iLp1<iStartYST+iMsh)smpd[iLp1*iMsw+iLp2].src=ssd[(iLp1+iStartY-iStartYST)*iMsw+iLp2+iStartX-iStartXST];else smpd[iLp1*iMsw+iLp2].src=smpdef[1].src}}iSMS_MAP_LST=SMS_MAP_L;iFMrST=iFMr;iStartXST=iStartX;iStartYST=iStartY;iNeedDectIMG=1;OReflashPlacard();OReflashPolyLine();if(typeof(CBFlashMap)=='function')CBFlashMap(iFMr,GetCenterHX(iFMx),GetCenterHY(iFMy),GetCenterHX(iFMx+iMsw*MG_SMP_WIDTH),GetCenterHY(iFMy+iMsh*MG_SMP_HEIGHT))}var StartEX=new Array();var StartEY=new Array();var StartER=new Array();StartEX[0]=3;StartEY[0]=1;StartER[0]=-1;StartEX[1]=3;StartEY[1]=1;StartER[1]=-1;StartEX[2]=3;StartEY[2]=1;StartER[2]=-1;StartEX[3]=3;StartEY[3]=1;StartER[3]=-1;function ChangeMapPicE(iLcc,iMoveX,iMoveY){if(MG_EGL_EYE_SH[iLcc]==false)return;if(iMoveX==0&&iMoveY==0&&StartER[iLcc]==iFMEr[iLcc])return;StartEX[iLcc]=StartEX[iLcc]+iMoveX;StartEY[iLcc]=StartEY[iLcc]+iMoveY;StartER[iLcc]=iFMEr[iLcc];ChangeMapPicET(iLcc)}function ChangeMapPicET(iLcc){var iLp1;var iLp2;if(MG_EGL_EYE_SH[iLcc]==false)return;for(iLp1=0;iLp1<iMsEh[iLcc];iLp1++)for(iLp2=0;iLp2<iMsEw[iLcc];iLp2++)if(MG_MAP_LBDIR_E[iLcc][SMS_MAP_L]!='')smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2].src=MG_MAP_BASEURL+MG_MAP_LBDIR_E[SMS_MAP_L][iLcc]+iFMEr[iLcc]+'/'+Math.floor((StartEY[iLcc]+iLp1)/4+1)+'/'+Math.floor((StartEX[iLcc]+iLp2)/5+1)+'/'+Math.floor((StartEY[iLcc]+iLp1)/4+1)+'_'+Math.floor((StartEX[iLcc]+iLp2)/5+1)+'_'+((StartEY[iLcc]+iLp1)%4+1)+'_'+((StartEX[iLcc]+iLp2)%5+1)+'.png';ChangeMapEArea(iLcc)}function ChangeMapEArea(iLcc){var iLp1;var iLp2;if(MG_EGL_EYE_SH[iLcc]==false)return;iLp1=Math.floor((MG_MAP_LOCACTION_SW[iFMr]/MG_MAP_LOCACTION_W[iFMr])/(MG_MAP_LOCACTION_SW[iFMEr[iLcc]]/MG_MAP_LOCACTION_W[iFMEr[iLcc]])*smp00.clientWidth);iLp2=Math.floor((MG_MAP_LOCACTION_SH[iFMr]/MG_MAP_LOCACTION_H[iFMr])/(MG_MAP_LOCACTION_SH[iFMEr[iLcc]]/MG_MAP_LOCACTION_H[iFMEr[iLcc]])*smp00.clientHeight);smpEY[iLcc].style.left=Math.floor((smpE[iLcc].clientWidth-iLp1)/2)+'px';smpEY[iLcc].style.top=Math.floor((smpE[iLcc].clientHeight-iLp2)/2)+'px';smpEY[iLcc].style.width=iLp1+'px';smpEY[iLcc].style.height=iLp2+'px';smpEY[iLcc].style.visibility=MG_EGL_EYE_MS[iLcc]==true?'':'hidden'}function StopEvent(evSrc){if(window.event)window.event.cancelBubble=true;if(evSrc&&evSrc.stopPropagation)evSrc.stopPropagation()}function GetCenterHX(iCx){if(isNaN(iCx))iCx=Math.floor(smp00.clientWidth/2)+1;return(iStartX*MG_SMP_WIDTH+iCx-iFMx)/MG_MAP_LOCACTION_W[iFMr]*MG_MAP_LOCACTION_SW[iFMr]+MG_MAP_LOCACTION_SX[iFMr]}function GetCenterHY(iCy){if(isNaN(iCy))iCy=(Math.floor(smp00.clientHeight/2)+1);return(iStartY*MG_SMP_HEIGHT+iCy-iFMy)/MG_MAP_LOCACTION_H[iFMr]*MG_MAP_LOCACTION_SH[iFMr]+MG_MAP_LOCACTION_SY[iFMr]}function GetCenterLX(iCx){if(isNaN(iCx))iCx=0;return(iCx-MG_MAP_LOCACTION_SX[iFMr])/MG_MAP_LOCACTION_SW[iFMr]*MG_MAP_LOCACTION_W[iFMr]-iStartX*MG_SMP_WIDTH}function GetCenterLY(iCy){if(isNaN(iCy))iCy=0;return(iCy-MG_MAP_LOCACTION_SY[iFMr])/MG_MAP_LOCACTION_SH[iFMr]*MG_MAP_LOCACTION_H[iFMr]-iStartY*MG_SMP_HEIGHT}function GetMouseX(evSrc){if(!evSrc)evSrc=window.event;if(evSrc)return evSrc.clientX+GetDocScrollPosLeft()-GetRelDiffX();return 0}function GetRelDiffX(){var oTmp;var iRtn;for(iRtn=0,oTmp=smp00.offsetParent;oTmp!=null;oTmp=oTmp.offsetParent)iRtn+=oTmp.offsetLeft;return iRtn}function GetDocScrollPosLeft(){if(typeof window.pageYOffset!='undefined')return window.pageXOffset;else if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat')return document.documentElement.scrollLeft;else if(typeof document.body!='undefined')return document.body.scrollLeft}function GetMouseY(evSrc){if(!evSrc)evSrc=window.event;if(evSrc)return evSrc.clientY+GetDocScrollPosTop()-GetRelDiffY();return 0}function GetRelDiffY(){var oTmp;var iRtn;for(iRtn=0,oTmp=smp00.offsetParent;oTmp!=null;oTmp=oTmp.offsetParent)iRtn+=oTmp.offsetTop;return iRtn}function GetDocScrollPosTop(){if(typeof window.pageYOffset!='undefined')return window.pageYOffset;else if(typeof document.compatMode!='undefined'&&document.compatMode!='BackCompat')return document.documentElement.scrollTop;else if(typeof document.body!='undefined')return document.body.scrollTop}function OShowEagleEyeMap(iLC,iSH,iMW,iMH,iDR,iMS){var iLp1;var iLp2;var sTmp;var iLcc;if(isNaN(iLC)==false)iLcc=iLC;switch(iLcc){case 0:sTmp='left:0px; top:0px;';break;case 1:sTmp='right:0px; top:0px;';break;case 2:sTmp='left:0px; bottom:0px;';break;default:iLcc=3;sTmp='right:0px; bottom:0px;'}if(isNaN(iSH)==false)MG_EGL_EYE_SH[iLcc]=iSH;if(isNaN(iMW)==false)MG_EGL_EYE_MW[iLcc]=iMW;if(isNaN(iMH)==false)MG_EGL_EYE_MH[iLcc]=iMH;if(isNaN(iDR)==false)MG_EGL_EYE_DR[iLcc]=iDR;if(isNaN(iMS)==false)MG_EGL_EYE_MS[iLcc]=iMS;smpE[iLcc].style.cssText='position:absolute; '+sTmp+'width:'+MG_EGL_EYE_MW[iLcc]+'px; height:'+MG_EGL_EYE_MH[iLcc]+'px;z-index:94;border:1px solid gray;';smpE[iLcc].style.visibility=MG_EGL_EYE_SH[iLcc]?'':'hidden';smpE[iLcc].style.overflow='hidden';if(!smp00.style.position)smp00.style.position='relative';smp00.style.MozUserSelect='none';smpE[iLcc].unselectable=smp00.unselectable;smpE[iLcc].style.backgroundColor=smp00.style.backgroundColor;iMsEw[iLcc]=Math.floor(MG_EGL_EYE_MW[iLcc]/MG_SMP_WIDTH)+2;iMsEh[iLcc]=Math.floor(MG_EGL_EYE_MH[iLcc]/MG_SMP_HEIGHT)+2;smpEZ[iLcc].style.cssText='position:absolute; left:0px; top:0px;width:'+(iMsEw[iLcc]*MG_SMP_WIDTH)+'px; height:'+(iMsEh[iLcc]*MG_SMP_HEIGHT)+'px;z-index:0;';for(iLp1=0;iLp1<iMsEh[iLcc];iLp1++)for(iLp2=0;iLp2<iMsEw[iLcc];iLp2++){if(typeof(smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2])=='undefined'){smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2]=document.createElement('img');smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2].style.cssText='position:absolute; left:'+(iLp2*MG_SMP_WIDTH)+'px; top:'+(iLp1*MG_SMP_HEIGHT)+'px; z-index:3;';smpEZ[iLcc].appendChild(smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2])}else{smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2].style.left=(iLp2*MG_SMP_WIDTH)+'px';smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2].style.top=(iLp1*MG_SMP_HEIGHT)+'px';smpe[iLcc][iLp1*iMsEw[iLcc]+iLp2].style.visibility=''}}for(iLp1=iMsEw[iLcc]*iMsEh[iLcc];typeof(smpe[iLcc][iLp1])!='undefined';iLp1++)smpe[iLcc][iLp1].style.visibility='hidden';if(MG_EGL_EYE_SH[iLcc]==true){OMoveToRXYE(iLcc,GetCenterHX(),GetCenterHY(),iFMr,false);ChangeMapEArea(iLcc)}}function OMoveToRXY(fx,fy,ir,sm){var iTx;var iAx;var iTy;var iAy;var iRtl=new Array();if(ir>MG_SMP_LRL_MAX[SMS_MAP_L])ir=MG_SMP_LRL_MAX[SMS_MAP_L];if(ir<MG_SMP_LRL_MIN[SMS_MAP_L])ir=MG_SMP_LRL_MIN[SMS_MAP_L];if(sm==true){OnTimer(true);smpY.style.visibility='';iOTFunction=1;iOv[0]=fx;iOv[1]=fy;iOv[2]=ir;iOv[3]=20;iOv[4]=GetCenterHX();iOv[5]=GetCenterHY();iOv[6]=20/2}else{iTx=(fx-MG_MAP_LOCACTION_SX[ir])/MG_MAP_LOCACTION_SW[ir]*MG_MAP_LOCACTION_W[ir]-(Math.floor(smp00.clientWidth/2)+1);iAx=Math.floor(iTx/MG_SMP_WIDTH);iFMx=iAx*MG_SMP_WIDTH-iTx;smpZ.style.left=iFMx+'px';iTy=(fy-MG_MAP_LOCACTION_SY[ir])/MG_MAP_LOCACTION_SH[ir]*MG_MAP_LOCACTION_H[ir]-(Math.floor(smp00.clientHeight/2)+1);iAy=Math.floor(iTy/MG_SMP_HEIGHT);iFMy=iAy*MG_SMP_HEIGHT-iTy;smpZ.style.top=iFMy+'px';if(iFMr!=ir){iFMr=ir;OShowScale(SHOW_SCALE_FLAG)}ChangeMapPic(iAx-iStartX,iAy-iStartY);if(typeof(CBMapMove)=='function')CBMapMove(iFMr,GetCenterHX(0),GetCenterHY(0),GetCenterHX(smp00.clientWidth),GetCenterHY(smp00.clientHidth));if(oPlcrdIfno2.style.visibility==''){oPlcrdIfno2.style.position='absolute';oPlcrdIfno2.style.zIndex=86;oPlcrdIfno2.style.left=(GetCenterLX(oGPlcrd[iPlcrdIfno2x].iLx)+iFMx+oGPlcrd[iPlcrdIfno2x].oIcon01.iow/2)+'px';oPlcrdIfno2.style.bottom=(smp00.clientHeight-GetCenterLY(oGPlcrd[iPlcrdIfno2x].iLy)-iFMy+oGPlcrd[iPlcrdIfno2x].oIcon01.ioh)+'px'}for(iLp1=0;iLp1<4;iLp1++)OMoveToRXYE(iLp1,fx,fy,ir,sm);MG_UpdateLandScale(smc14,false)}}function OMoveToRXYE(iLcc,fx,fy,ir,sm){var iTx;var iAx;var iTy;var iAy;if(MG_EGL_EYE_SH[iLcc]&&iOTFunction!=1){ir+=MG_EGL_EYE_DR[iLcc];if(ir>MG_SMP_LRL_MAX[SMS_MAP_L])ir=MG_SMP_LRL_MAX[SMS_MAP_L];if(ir<MG_SMP_LRL_MIN[SMS_MAP_L])ir=MG_SMP_LRL_MIN[SMS_MAP_L];iTx=(fx-MG_MAP_LOCACTION_SX[ir])/MG_MAP_LOCACTION_SW[ir]*MG_MAP_LOCACTION_W[ir]-(Math.floor(MG_EGL_EYE_MW[iLcc]/2)+1);iAx=Math.floor(iTx/MG_SMP_WIDTH);smpEZ[iLcc].style.left=(iAx*MG_SMP_WIDTH-iTx)+'px';iTy=(fy-MG_MAP_LOCACTION_SY[ir])/MG_MAP_LOCACTION_SH[ir]*MG_MAP_LOCACTION_H[ir]-(Math.floor(MG_EGL_EYE_MH[iLcc]/2)+1);iAy=Math.floor(iTy/MG_SMP_HEIGHT);smpEZ[iLcc].style.top=(iAy*MG_SMP_HEIGHT-iTy)+'px';if(iFMEr[iLcc]!=ir)iFMEr[iLcc]=ir;ChangeMapPicE(iLcc,iAx-StartEX[iLcc],iAy-StartEY[iLcc])}}function OShowScale(bTF,ix,iy){SHOW_SCALE_FLAG=bTF;if(isNaN(ix)==false&&isNaN(iy)==false){SCL_DIR_ICON_X=ix;SCL_DIR_ICON_Y=iy}smc01.style.left=(SCL_DIR_ICON_X+SCL_DIR_ICON_B*2+SCL_DIR_ICON_W+SCL_DIR_ICON_S)+'px';smc01.style.top=SCL_DIR_ICON_Y+'px';smc02.style.left=(SCL_DIR_ICON_X+SCL_DIR_ICON_B*2+SCL_DIR_ICON_W+SCL_DIR_ICON_S)+'px';smc02.style.top=(SCL_DIR_ICON_Y+SCL_DIR_ICON_B*4+SCL_DIR_ICON_H*2+SCL_DIR_ICON_S*2)+'px';smc03.style.left=SCL_DIR_ICON_X+'px';smc03.style.top=(SCL_DIR_ICON_Y+SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)+'px';smc04.style.left=(SCL_DIR_ICON_X+SCL_DIR_ICON_B*4+SCL_DIR_ICON_W*2+SCL_DIR_ICON_S*2)+'px';smc04.style.top=(SCL_DIR_ICON_Y+SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)+'px';smc05.style.left=(SCL_DIR_ICON_X+SCL_DIR_ICON_B*2+SCL_DIR_ICON_W+SCL_DIR_ICON_S)+'px';smc05.style.top=(SCL_DIR_ICON_Y+SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)+'px';smc08.style.left=(SCL_DIR_ICON_X+SCL_DIR_ICON_B*2+SCL_DIR_ICON_W+SCL_DIR_ICON_S)+'px';smc08.style.top=(SCL_DIR_ICON_Y+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)*3)+'px';smc09.style.left=(SCL_DIR_ICON_X+SCL_DIR_ICON_B*2+SCL_DIR_ICON_W+SCL_DIR_ICON_S)+'px';smc09.style.top=(SCL_DIR_ICON_Y+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)*4+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_M)*(MG_SMP_LRL_MAX[SMS_MAP_L]-MG_SMP_LRL_MIN[SMS_MAP_L]+1))+'px';smc01.style.visibility=SHOW_SCALE_FLAG?'':'hidden';smc02.style.visibility=SHOW_SCALE_FLAG?'':'hidden';smc03.style.visibility=SHOW_SCALE_FLAG?'':'hidden';smc04.style.visibility=SHOW_SCALE_FLAG?'':'hidden';smc05.style.visibility=SHOW_SCALE_FLAG?'':'hidden';smc08.style.visibility=SHOW_SCALE_FLAG?'':'hidden';smc09.style.visibility=SHOW_SCALE_FLAG?'':'hidden';for(iLp1=MG_SMP_RLEVEL_MIN;iLp1<=MG_SMP_RLEVEL_MAX;iLp1++){smc10[iLp1].style.visibility=SHOW_SCALE_FLAG?'':'hidden';smc10[iLp1].style.left=(iLp1>=MG_SMP_LRL_MIN[SMS_MAP_L]&&iLp1<=MG_SMP_LRL_MAX[SMS_MAP_L]?(SCL_DIR_ICON_X+SCL_DIR_ICON_B*2+SCL_DIR_ICON_W+SCL_DIR_ICON_S):'-100')+'px';smc10[iLp1].style.top=(iLp1>=MG_SMP_LRL_MIN[SMS_MAP_L]&&iLp1<=MG_SMP_LRL_MAX[SMS_MAP_L]?(SCL_DIR_ICON_Y+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)*4+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_M)*(iLp1-MG_SMP_LRL_MIN[SMS_MAP_L])):'-100')+'px'}LoadImageTransform(smc11,SCL_DIR_ICON_X+SCL_DIR_ICON_B*2+SCL_DIR_ICON_W+SCL_DIR_ICON_S,SCL_DIR_ICON_Y+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_H+SCL_DIR_ICON_S)*4+(SCL_DIR_ICON_B*2+SCL_DIR_ICON_M)*(iFMr-MG_SMP_LRL_MIN[SMS_MAP_L]),96,SCL_DIR_ICON_B*2+SCL_DIR_ICON_W,SCL_DIR_ICON_B*2+SCL_DIR_ICON_M,SCL_DIR_ICON_B,MG_IMG_BASEURL+SCL_DIR_ICON_IC[iFMr],SHOW_SCALE_FLAG)}function OSetMapStyle(il){var iLp1;SMS_MAP_L=il<LCL_BTN_ICON_N?(il<0?0:il):LCL_BTN_ICON_N-1;OShowLayerControl(SHOW_LCTRL_FLAG);ChangeMapProfile();if(iFMr>MG_SMP_LRL_MAX[SMS_MAP_L])OMoveToRXY(GetCenterHX(),GetCenterHY(),MG_SMP_LRL_MAX[SMS_MAP_L],true);else if(iFMr<MG_SMP_LRL_MIN[SMS_MAP_L])OMoveToRXY(GetCenterHX(),GetCenterHY(),MG_SMP_LRL_MIN[SMS_MAP_L],true);else{ChangeMapPicT();for(iLp1=0;iLp1<4;iLp1++)ChangeMapPicET(iLp1)}OShowScale(SHOW_SCALE_FLAG)}function ChangeMapProfile(){var iLp1;var iLp2;for(iLp1=0;iLp1<iMsh;iLp1++)for(iLp2=0;iLp2<iMsw;iLp2++){if(MG_MAP_LBDIR_U[SMS_MAP_L]!=''){smpu[iLp1*iMsw+iLp2].style.visibility='';if(iNGVersion>5)smpu[iLp1*iMsw+iLp2].style.filter=MG_MAP_LBDIR_UAO[SMS_MAP_L]==100?'':'alpha(opacity='+MG_MAP_LBDIR_UAO[SMS_MAP_L]+');';else smpu[iLp1*iMsw+iLp2].style.MozOpacity=MG_MAP_LBDIR_UAO[SMS_MAP_L]/100}else smpu[iLp1*iMsw+iLp2].style.visibility='hidden';if(MG_MAP_LBDIR_D[SMS_MAP_L]!='')smpd[iLp1*iMsw+iLp2].style.visibility='';else smpd[iLp1*iMsw+iLp2].style.visibility='hidden'}}function OShowLayerControl(bTF,ix,iy){SHOW_LCTRL_FLAG=bTF;if(isNaN(ix)==false&&isNaN(iy)==false){LCL_BTN_ICON_X=ix;LCL_BTN_ICON_Y=iy}for(iLp1=0;iLp1<LCL_BTN_ICON_N;iLp1++)LoadImageTransform(smc12[iLp1],LCL_BTN_ICON_X+(LCL_BTN_ICON_W+LCL_BTN_ICON_B*2+LCL_BTN_ICON_S)*(LCL_BTN_ICON_X>=0?iLp1:(iLp1+1-LCL_BTN_ICON_N)),LCL_BTN_ICON_Y,97,LCL_BTN_ICON_W,LCL_BTN_ICON_H,LCL_BTN_ICON_B,MG_IMG_BASEURL+'lcl'+iLp1+(iLp1==SMS_MAP_L?'2':'0')+'.png',SHOW_LCTRL_FLAG,LCL_BTN_ICON_X<0,true)}function OnTimer(iStop){var iTmp;var iLp1;var iLp2;switch(iOTFunction){case 1:iOv[3]=iOv[3]-1;if(iOv[3]==0||isNaN(iStop)==false){iOTFunction=0;OMoveToRXY(iOv[0],iOv[1],iOv[2],false);smpY.style.visibility=CTRL_ALL_ENEVT_FLAG?'hidden':''}else if(iOv[3]%2==0){iTmp=iOv[3]/2;OMoveToRXY((iOv[0]*(iOv[6]-iTmp)+iOv[4]*iTmp)/iOv[6],(iOv[1]*(iOv[6]-iTmp)+iOv[5]*iTmp)/iOv[6],iOv[2],false)}break;case 2:if(isNaN(iStop)==false){iOv[2]=0;oTimerTmp1=oTimerTmp2}if((iPLAY_POLY_LINE_SPEED!=0||(iOv[2]==0&&oTimerTmp1==oTimerTmp2))&&iOv[3]++%PLAY_POLY_LINE_TIMER==0)if(iOv[2]==0){OMoveToRXY(oTimerTmp1.iX,oTimerTmp1.iY,iOv[4],false);if(oTimerTmp1==oTimerTmp2){smpY.style.visibility=CTRL_ALL_ENEVT_FLAG?'hidden':'';iOTFunction=0}else{if(iOv[0]==0)iOv[5]=(Math.sqrt(Math.pow(oTimerTmp1.iX-oTimerTmp1.oNextPoint.iX,2)+Math.pow(oTimerTmp1.iY-oTimerTmp1.oNextPoint.iY,2))/iOv[1])+1;else iOv[5]=(Math.sqrt(Math.pow(GetCenterLX(oTimerTmp1.iX)-GetCenterLX(oTimerTmp1.oNextPoint.iX),2)+Math.pow(GetCenterLY(oTimerTmp1.iY)-GetCenterLY(oTimerTmp1.oNextPoint.iY),2))/iOv[1])+1;iOv[2]=1}}else{if(iFMr!=iOv[4]){iOv[4]=iFMr;iOv[2]=(iOv[2]-1)/iOv[5];if(iOv[0]==0)iOv[5]=(Math.sqrt(Math.pow(oTimerTmp1.iX-oTimerTmp1.oNextPoint.iX,2)+Math.pow(oTimerTmp1.iY-oTimerTmp1.oNextPoint.iY,2))/iOv[1])+1;else iOv[5]=(Math.sqrt(Math.pow(GetCenterLX(oTimerTmp1.iX)-GetCenterLX(oTimerTmp1.oNextPoint.iX),2)+Math.pow(GetCenterLY(oTimerTmp1.iY)-GetCenterLY(oTimerTmp1.oNextPoint.iY),2))/iOv[1])+1;iOv[2]=iOv[5]*iOv[2]+1}iOv[2]+=iPLAY_POLY_LINE_SPEED;if(iOv[2]<=1&&iPLAY_POLY_LINE_SPEED<0){OMoveToRXY(oTimerTmp1.iX,oTimerTmp1.iY,iOv[4],false);if(typeof(oTimerTmp1.oPrePoint)=='undefined'){smpY.style.visibility=CTRL_ALL_ENEVT_FLAG?'hidden':'';iOTFunction=0}else{oTimerTmp1=oTimerTmp1.oPrePoint;if(iOv[0]==0)iOv[5]=(Math.sqrt(Math.pow(oTimerTmp1.iX-oTimerTmp1.oNextPoint.iX,2)+Math.pow(oTimerTmp1.iY-oTimerTmp1.oNextPoint.iY,2))/iOv[1])+1;else iOv[5]=(Math.sqrt(Math.pow(GetCenterLX(oTimerTmp1.iX)-GetCenterLX(oTimerTmp1.oNextPoint.iX),2)+Math.pow(GetCenterLY(oTimerTmp1.iY)-GetCenterLY(oTimerTmp1.oNextPoint.iY),2))/iOv[1])+1;iOv[2]=iOv[5]+1}}else{if(iOv[2]>=iOv[5]+1&&iPLAY_POLY_LINE_SPEED>=0){oTimerTmp1=oTimerTmp1.oNextPoint;iOv[2]=0}else{OMoveToRXY(oTimerTmp1.iX+(oTimerTmp1.oNextPoint.iX-oTimerTmp1.iX)*(iOv[2]-1)/iOv[5],oTimerTmp1.iY+(oTimerTmp1.oNextPoint.iY-oTimerTmp1.iY)*(iOv[2]-1)/iOv[5],iOv[4],false)}}}break}if((iMapViewW>=0&&iMapViewW!=smp00.clientWidth)||(iMapViewH>=0&&iMapViewH!=smp00.clientHeight)){iMapViewW=smp00.clientWidth;iMapViewH=smp00.clientHeight;smc00a.style.left=((Math.floor(smp00.clientWidth/2)+1)-32)+'px';smc00a.style.top=(Math.floor(smp00.clientHeight/2)+1)+'px';smc00b.style.left=(Math.floor(smp00.clientWidth/2)+1)+'px';smc00b.style.top=((Math.floor(smp00.clientHeight/2)+1)-32)+'px';iMsw=Math.floor(smp00.clientWidth/MG_SMP_WIDTH)+2;iMsh=Math.floor(smp00.clientHeight/MG_SMP_HEIGHT)+2;smpZ.style.width=(iMsw*MG_SMP_WIDTH)+'px';smpZ.style.height=(iMsh*MG_SMP_HEIGHT)+'px';for(iLp1=0;iLp1<iMsh;iLp1++)for(iLp2=0;iLp2<iMsw;iLp2++){if(typeof(smpu[iLp1*iMsw+iLp2])=='undefined'){smpu[iLp1*iMsw+iLp2]=document.createElement('img');smpu[iLp1*iMsw+iLp2].style.cssText='position:absolute; left:'+(iLp2*MG_SMP_WIDTH)+'px; top:'+(iLp1*MG_SMP_HEIGHT)+'px; z-index:3;';smpZ.appendChild(smpu[iLp1*iMsw+iLp2]);smpd[iLp1*iMsw+iLp2]=document.createElement('img');smpd[iLp1*iMsw+iLp2].style.cssText='position:absolute; left:'+(iLp2*MG_SMP_WIDTH)+'px; top:'+(iLp1*MG_SMP_HEIGHT)+'px; z-index:2;';smpZ.appendChild(smpd[iLp1*iMsw+iLp2]);smpu2[iLp1*iMsw+iLp2]=document.createElement('img');smpd2[iLp1*iMsw+iLp2]=document.createElement('img')}else{smpu[iLp1*iMsw+iLp2].style.left=(iLp2*MG_SMP_WIDTH)+'px';smpu[iLp1*iMsw+iLp2].style.top=(iLp1*MG_SMP_HEIGHT)+'px';smpu[iLp1*iMsw+iLp2].style.visibility='';smpd[iLp1*iMsw+iLp2].style.left=(iLp2*MG_SMP_WIDTH)+'px';smpd[iLp1*iMsw+iLp2].style.top=(iLp1*MG_SMP_HEIGHT)+'px';smpd[iLp1*iMsw+iLp2].style.visibility=''}}for(iLp1=iMsw*iMsh;typeof(smpu[iLp1])!='undefined';iLp1++){smpu[iLp1].style.visibility='hidden';smpd[iLp1].style.visibility='hidden'}ChangeMapProfile();if(typeof G_vmlCanvasManager!='undefined'){oCanvas.style.visibility='hidden';oCanvas=document.createElement('canvas');oCanvas.style.cssText='position:absolute; left:0px; top:0px;z-index:25;';oCanvas.width=smpZ.clientWidth;oCanvas.height=smpZ.clientHeight;oCanvas.style.visibility='hidden';smpZ.appendChild(oCanvas);G_vmlCanvasManager.initElement(oCanvas);oCanvas=smpZ.lastChild;oCtx=oCanvas.getContext('2d');oCtx.clearRect(0,0,oCanvas.width,oCanvas.height);oCtx.lineJoin='round'}else{oCanvas.width=smpZ.clientWidth;oCanvas.height=smpZ.clientHeight}iSMS_MAP_LST=-1;ChangeMapPicT()}if(iNeedDectIMG>0){iTmp=1;for(iLp1=0;iLp1<iMsh;iLp1++)for(iLp2=0;iLp2<iMsw;iLp2++){if(MG_MAP_LBDIR_U[SMS_MAP_L]!=''&&smpu[iLp1*iMsw+iLp2].src==smpdef[0].src){if(smpu2[iLp1*iMsw+iLp2].width==MG_SMP_WIDTH&&smpu2[iLp1*iMsw+iLp2].height==MG_SMP_HEIGHT)smpu[iLp1*iMsw+iLp2].src=smpu2[iLp1*iMsw+iLp2].src;else iTmp=0}if(MG_MAP_LBDIR_D[SMS_MAP_L]!=''&&smpd[iLp1*iMsw+iLp2].src==smpdef[1].src)if(smpd2[iLp1*iMsw+iLp2].width==MG_SMP_WIDTH&&smpd2[iLp1*iMsw+iLp2].height==MG_SMP_HEIGHT)smpd[iLp1*iMsw+iLp2].src=smpd2[iLp1*iMsw+iLp2].src;else iTmp=0}if(iTmp==1)iNeedDectIMG=0}iNeedRClick=1}function OSetMapStartRXY(fx,fy,ir){SMS_MAP_X=fx;SMS_MAP_Y=fy;SMS_MAP_R=ir;OMoveToRXY(fx,fy,ir,false)}function OGetPlacardInfo(iPnt){if(iPnt>=0&&iPnt<MG_PlCRD_MAX)return oGPlcrd[iPnt];else return null}function OAddPlacard(iKind,sIcon01,sIcon02,bCanClick,ix,iy,sStr01,sStr02,sVid,sTag){var iLp1;var iPnt;for(iPnt=0;iPnt<MG_PlCRD_MAX;iPnt++)if(PLCRD_STATUS[iPnt]==-1)break;if(iPnt==MG_PlCRD_MAX)return-1;PLCRD_STATUS[iPnt]=0;if(typeof(iKind)=='object')oGPlcrd[iPnt]=iKind;else oGPlcrd[iPnt]=new GWPlcrd(iKind,sIcon01,sIcon02,bCanClick,ix,iy,sStr01,sStr02,sVid,sTag);return iPnt}function ORemovePlacard(iPnt){if(iPnt>=0&&iPnt<MG_PlCRD_MAX)PLCRD_STATUS[iPnt]=-1}function ORemoveAllPlacard(){var iPnt;for(iPnt=0;iPnt<MG_PlCRD_MAX;iPnt++)ORemovePlacard(iPnt)}function OReflashPlacard(){var iLp1;var iLp2;var iXTmp;var iYTmp;for(iLp1=0,iLp2=0;iLp1<MG_PlCRD_MAX&&iLp2<MG_PlCRD_SHOW_MAX;iLp1++)if(PLCRD_STATUS[iLp1]>=0){iPlcrdX[iLp2]=GetCenterLX(oGPlcrd[iLp1].iLx);iPlcrdY[iLp2]=GetCenterLY(oGPlcrd[iLp1].iLy);if(iPlcrdX[iLp2]>-500&&iPlcrdX[iLp2]<smp00.clientWidth+500&&iPlcrdY[iLp2]>-500&&iPlcrdY[iLp2]<smp00.clientHeight+500){if(iPlcrd[iLp2]==-2){oPlcrd[iLp2]=document.createElement('div');oPlcrd[iLp2].style.cssText='position:absolute;z-index:31;cursor:pointer;';oPlcrd[iLp2].style.visibility='hidden';smpZ.appendChild(oPlcrd[iLp2]);oPlcrd[iLp2+MG_PlCRD_SHOW_MAX]=document.createElement('div');oPlcrd[iLp2+MG_PlCRD_SHOW_MAX].style.cssText='position:absolute;z-index:30;cursor:pointer;';oPlcrd[iLp2+MG_PlCRD_SHOW_MAX].style.visibility='hidden';smpZ.appendChild(oPlcrd[iLp2+MG_PlCRD_SHOW_MAX])}iPlcrd[iLp2++]=iLp1}}for(;iLp2<MG_PlCRD_SHOW_MAX&&iPlcrd[iLp2]>-2;iLp2++)iPlcrd[iLp2]=-1;oPlcrdIfno1.style.visibility='hidden';for(iLp1=0,iLp2=0;iLp1<MG_PlCRD_SHOW_MAX&&iPlcrd[iLp1]>-2;iLp1++)if(iPlcrd[iLp1]<0){oPlcrd[iLp1].style.visibility='hidden';oPlcrd[iLp1+MG_PlCRD_SHOW_MAX].style.visibility='hidden'}else{oPlcrd[iLp1].style.visibility='';oPlcrd[iLp1+MG_PlCRD_SHOW_MAX].style.visibility='';switch(oGPlcrd[iPlcrd[iLp1]].iKind){case 0:case 1:case 3:case 4:LoadImageTransform(oPlcrd[iLp1],iPlcrdX[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon01.iopx,(iPlcrdY[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon01.iopy),31,oGPlcrd[iPlcrd[iLp1]].oIcon01.iow,oGPlcrd[iPlcrd[iLp1]].oIcon01.ioh,0,oGPlcrd[iPlcrd[iLp1]].oIcon01.soUrl,true);LoadImageTransform(oPlcrd[iLp1+MG_PlCRD_SHOW_MAX],iPlcrdX[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon02.iopx,(iPlcrdY[iLp1]-oGPlcrd[iPlcrd[iLp1]].oIcon02.iopy),30,oGPlcrd[iPlcrd[iLp1]].oIcon02.iow,oGPlcrd[iPlcrd[iLp1]].oIcon02.ioh,0,oGPlcrd[iPlcrd[iLp1]].oIcon02.soUrl,true);if(oGPlcrd[iPlcrd[iLp1]].iStatus==1){if(oGPlcrd[iPlcrd[iLp1]].iKind==0||oGPlcrd[iPlcrd[iLp1]].iKind==1){oPlcrdIfno1.innerHTML=GetHTMLPlacard(300,150,oGPlcrd[iPlcrd[iLp1]].iLStr01);oPlcrdIfno1.style.left=(iPlcrdX[iLp1]+oGPlcrd[iPlcrd[iLp1]].oIcon01.iow/2)+'px';oPlcrdIfno1.style.bottom=(smpZ.clientHeight-iPlcrdY[iLp1]+oGPlcrd[iPlcrd[iLp1]].oIcon01.ioh)+'px';oPlcrdIfno1.style.visibility='';iPlcrdIfno2x=-1;oPlcrdIfno2.innerHTML='';oPlcrdIfno2.style.visibility='hidden'}else{var iOldIndex;iOldIndex=iPlcrdIfno2x;iPlcrdIfno2x=iPlcrd[iLp1];if(iOldIndex!=iPlcrdIfno2x){if(typeof(CBPlacardK3Open)=='function')CBPlacardK3Open(oPlcrdIfno2,iPlcrdIfno2x);else oPlcrdIfno2.innerHTML=GetHTMLPlacard(300,150,oGPlcrd[iPlcrdIfno2x].iLStr01)}oPlcrdIfno2.style.position='absolute';oPlcrdIfno2.style.zIndex=86;oPlcrdIfno2.style.left=(GetCenterLX(oGPlcrd[iPlcrdIfno2x].iLx)+iFMx+oGPlcrd[iPlcrdIfno2x].oIcon01.iow/2)+'px';oPlcrdIfno2.style.bottom=(smp00.clientHeight-GetCenterLY(oGPlcrd[iPlcrdIfno2x].iLy)-iFMy+oGPlcrd[iPlcrdIfno2x].oIcon01.ioh)+'px';oPlcrdIfno2.style.visibility='';oPlcrdIfno1.style.visibility='hidden'}}break;case 2:if(typeof(oSlabel[iLp2])=='undefined'){oSlabel[iLp2]=document.createElement('label');smpZ.appendChild(oSlabel[iLp2])}oSlabel[iLp2].innerHTML=oGPlcrd[iPlcrd[iLp1]].iLStr01;iXTmp=0;iYTmp=0;switch(oGPlcrd[iPlcrd[iLp1]].iLStr02){case 2:iXTmp=oSlabel[iLp2].clientWidth/2;break;case 3:iXTmp=oSlabel[iLp2].clientWidth;break;case 4:iYTmp=oSlabel[iLp2].clientHeight/2;break;case 5:iXTmp=oSlabel[iLp2].clientWidth/2;iYTmp=oSlabel[iLp2].clientHeight/2;break;case 6:iXTmp=oSlabel[iLp2].clientWidth;iYTmp=oSlabel[iLp2].clientHeight/2;break;case 7:iYTmp=oSlabel[iLp2].clientHeight;break;case 8:iXTmp=oSlabel[iLp2].clientWidth/2;iYTmp=oSlabel[iLp2].clientHeight;break;case 9:iXTmp=oSlabel[iLp2].clientWidth;iYTmp=oSlabel[iLp2].clientHeight}oSlabel[iLp2++].style.cssText='position:absolute; left:'+(iPlcrdX[iLp1]-iXTmp)+'px; top:'+(iPlcrdY[iLp1]-iYTmp)+'px;z-index:31;cursor:pointer;';oPlcrd[iLp1].style.visibility='hidden';oPlcrd[iLp1+MG_PlCRD_SHOW_MAX].style.visibility='hidden';break}}for(;typeof(oSlabel[iLp2])!='undefined';iLp2++)oSlabel[iLp2].style.visibility='hidden'}function OAddPolyLine(oPline){var iLp1;var iPnt;for(iPnt=0;iPnt<MG_PlCRD_MAX;iPnt++)if(iPolyLine[iPnt]==-1)break;if(iPnt==MG_PlCRD_MAX)return-1;iPolyLine[iPnt]=0;oPolyLine[iPnt]=oPline;return iPnt}function ORemovePolyLine(iPnt){iPolyLine[iPnt]=-1}function ORemoveAllPolyLine(){var iPnt;for(iPnt=0;iPnt<MG_PLINE_MAX;iPnt++)ORemovePolyLine(iPnt)}function OReflashPolyLine(){var iLp1;var iX;var iY;var oTmpPl;var iCount;iCount=0;oCtx.clearRect(0,0,oCanvas.width,oCanvas.height);for(iLp1=0;iLp1<MG_PLINE_MAX;iLp1++)if(iPolyLine[iLp1]>=0){iCount++;oCtx.lineWidth=oPolyLine[iLp1].iLineWidth;oCtx.strokeStyle=oPolyLine[iLp1].sColor;oCtx.beginPath();if(oPolyLine[iLp1].iType<3){oTmpPl=oPolyLine[iLp1].StPoint;iX=GetCenterLX(oTmpPl.iX);iY=GetCenterLY(oTmpPl.iY);oCtx.moveTo(iX,iY);while(oTmpPl!=oPolyLine[iLp1].LtPoint){oTmpPl=oTmpPl.oNextPoint;iX=GetCenterLX(oTmpPl.iX);iY=GetCenterLY(oTmpPl.iY);oCtx.lineTo(iX,iY)}switch(oPolyLine[iLp1].iType){case 1:oCtx.closePath();oCtx.strokeStyle=oPolyLine[iLp1].sColor;oCtx.stroke();break;case 2:oCtx.closePath();oCtx.fillStyle=oPolyLine[iLp1].sColor;oCtx.fill();break;default:oCtx.strokeStyle=oPolyLine[iLp1].sColor;oCtx.stroke()}}oTmpPl=oPolyLine[iLp1].StPoint;iX=GetCenterLX(oTmpPl.iX);iY=GetCenterLY(oTmpPl.iY);if(!isNaN(oTmpPl.iSize)){switch(oPolyLine[iLp1].iType){case 3:case 4:break;default:oCtx.beginPath();oCtx.lineWidth=oTmpPl.iSize;if(typeof(oTmpPl.sColor)!='undefined')oCtx.strokeStyle=oTmpPl.sColor;else oCtx.strokeStyle=oPolyLine[iLp1].sColor;oCtx.arc(iX,iY,oTmpPl.iSize/2,0,Math.PI*2,true);oCtx.closePath();oCtx.stroke()}}while(oTmpPl!=oPolyLine[iLp1].LtPoint){oTmpPl=oTmpPl.oNextPoint;switch(oPolyLine[iLp1].iType){case 3:case 4:oCtx.beginPath();if(!isNaN(oTmpPl.iSize))oCtx.lineWidth=oTmpPl.iSize;else oCtx.lineWidth=oPolyLine[iLp1].iLineWidth;if(oPolyLine[iLp1].iType==3){if(typeof(oTmpPl.sColor)!='undefined')oCtx.strokeStyle=oTmpPl.sColor;else oCtx.strokeStyle=oPolyLine[iLp1].sColor;oCtx.arc(iX,iY,Math.sqrt(Math.pow(GetCenterLX(oTmpPl.iX)-iX,2)+Math.pow(GetCenterLY(oTmpPl.iY)-iY,2)),0,Math.PI*2,true);oCtx.closePath();oCtx.stroke()}else{if(typeof(oTmpPl.sColor)!='undefined')oCtx.fillStyle=oTmpPl.sColor;else oCtx.fillStyle=oPolyLine[iLp1].sColor;oCtx.arc(iX,iY,Math.sqrt(Math.pow(GetCenterLX(oTmpPl.iX)-iX,2)+Math.pow(GetCenterLY(oTmpPl.iY)-iY,2)),0,Math.PI*2,true);oCtx.fill()}break;default:iX=GetCenterLX(oTmpPl.iX);iY=GetCenterLY(oTmpPl.iY);if(!isNaN(oTmpPl.iSize)){oCtx.beginPath();oCtx.lineWidth=oTmpPl.iSize;if(typeof(oTmpPl.sColor)!='undefined')oCtx.strokeStyle=oTmpPl.sColor;else oCtx.strokeStyle=oPolyLine[iLp1].sColor;oCtx.arc(iX,iY,oTmpPl.iSize/2,0,Math.PI*2,true);oCtx.closePath();oCtx.stroke()}}}}oCanvas.style.visibility=iCount>0?'':'hidden'}function OPlayPolyLine(oPline,iType,iSpeed){iPLAY_POLY_LINE_SPEED=1;OnTimer(true);smpY.style.visibility='';iOTFunction=2;iOv[0]=iType;iOv[1]=iSpeed;iOv[2]=0;iOv[3]=0;iOv[4]=iFMr;oTimerTmp1=oPline.StPoint;oTimerTmp2=oPline.LtPoint}function CLoadImageTransform(ix,iy,iz,iw,ih,ib,sImgurl,fShow,fSprtRight,fSprtBottom,fRepeat){var el001;el001=document.createElement('div');LoadImageTransform(el001,ix,iy,iz,iw,ih,ib,sImgurl,fShow,fSprtRight,fSprtBottom,fRepeat);return el001}function LoadImageTransform(oDec,ix,iy,iz,iw,ih,ib,sImgurl,fShow,fSprtRight,fSprtBottom,fRepeat){oDec.style.cssText=GetCSSPositionStr(ix,iy,fSprtRight,fSprtBottom)+(iw==0?'':'width:'+iw+'px; ')+(ih==0?'':'height:'+ih+'px; ')+'z-index:'+iz+';border:'+ib+'px solid black;cursor:pointer;'+(((iNGVersion>=5.5)&&(iNGVersion<7)&&(document.body.filters))?'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale src=\''+sImgurl+'\');':'');oDec.style.visibility=fShow?'':'hidden';oDec.style.fontSize='1px';oDec.style.background=((iNGVersion>=5.5)&&(iNGVersion<7)&&(document.body.filters))?'':('url('+sImgurl+(fRepeat==true?')':') no-repeat'))}function GetDistanceByLatLon(dLat1,dLng1,dLat2,dLng2){var dEARTH_RADIUS=6378.137;var dRadLat1=(dLat1*Math.PI/180.0);var dRadLat2=(dLat2*Math.PI/180.0);var dDa=dRadLat1-dRadLat2;var dDb=(dLng1*Math.PI/180.0)-(dLng2*Math.PI/180.0);var dDs=2*Math.asin(Math.sqrt(Math.pow(Math.sin(dDa/2),2)+Math.cos(dRadLat1)*Math.cos(dRadLat2)*Math.pow(Math.sin(dDb/2),2)));dDs=dDs*dEARTH_RADIUS;return dDs}function GetCSSPositionStr(ix,iy,fSprtRight,fSprtBottom){return'position:absolute; '+(ix<0&&fSprtRight==true?('right:'+(0-ix)):('left:'+ix))+'px; '+(iy<0&&fSprtBottom==true?('bottom:'+(0-iy)):('top:'+iy))+'px;'}function OSetLandScaleShow(bShow){MG_LAND_SCALE_SHOW=bShow;MG_UpdateLandScale(smc14,true)}function MG_UpdateLandScale(smc,bStyleChange){if(bStyleChange==true){smc[0].style.cssText=GetCSSPositionStr(MG_LAND_SCALE_LX,MG_LAND_SCALE_LY,true,true)+' width:101px; height:32; z-index:84;';smc[0].style.visibility=MG_LAND_SCALE_SHOW==true?'':'hidden'}try{if(MG_LAND_SCALE_SHOW==true){var dSx;var dEx;var dSy;dSx=GetCenterHX(0);dEx=GetCenterHX(100);dSy=GetCenterHY();if(MG_LAND_SCALE_COORDINATES_TYPE==2){dSx=dSx*360.0/40075020+120;dEx=dEx*360.0/40075020+120;dSy=dSy*360.0/40075020}dSx=GetDistanceByLatLon(dSx,dSy,dEx,dSy)*10;var iLp1;var iLp2;var iLp3;for(iLp1=0;iLp1<2;iLp1++){dSy=1;for(iLp2=0;iLp2<MG_LAND_SCALE_LAYER[iLp1]&&dSy>0;iLp2++){dEx=1;iLp3=1;while(1){if(dEx*MG_LAND_SCALE_SCALE[iLp1][iLp2]/100.0>dSx){if(dEx==1&&iLp2>0)iLp2--;dEx=dSy;dSy=-1;break}dSy=dEx;if(iLp3==1){dEx=dEx*2;iLp3=2}else{if(iLp3==2){dEx=dEx*2.5;iLp3=3}else{dEx=dEx*2;iLp3=1}}if(iLp2<MG_LAND_SCALE_LAYER[iLp1]-1&&dEx*MG_LAND_SCALE_SCALE[iLp1][iLp2]>=MG_LAND_SCALE_SCALE[iLp1][iLp2+1])break}if(dSy<0)break}smc[iLp1+1].style.cssText=GetCSSPositionStr(MG_LAND_SCALE_LX>0?1:-1,iLp1*15,true,true)+' width:'+ +Math.round(dEx*MG_LAND_SCALE_SCALE[iLp1][iLp2]/dSx)+'px; height:13; z-index:84; font-size:10px; border-left:1px solid #000000; border-'+(iLp1==0?'bottom':'top')+':1px solid #000000; border-right:1px solid #000000;';smc[iLp1+1].innerHTML='<center>'+dEx+' '+MG_LAND_SCALE_DESCRIPTION[iLp1][iLp2]+'</center>'}}}catch(err){}}function GetHTMLPlacard(iw,ih,sHtml){var sHCode;sHCode='<table width='+iw+' height='+ih+' border=0 cellpadding=0 cellspacing=0>';sHCode+='	<tr height=0>';sHCode+='		<td width=16></td>';sHCode+='		<td width=20></td>';sHCode+='		<td width=65535></td>';sHCode+='		<td width=16></td>';sHCode+='	</tr>';sHCode+='	<tr>';sHCode+='		<td width=16>';sHCode+='			<img src='+MG_IMG_BASEURL+'pup_01.png></td>';sHCode+='		<td colspan=3 background='+MG_IMG_BASEURL+'pup_02.png> </td>';sHCode+='		<td width=16>';sHCode+='			<img src='+MG_IMG_BASEURL+'pup_04.png></td>';sHCode+='	</tr>';sHCode+='	<tr height=100%>';sHCode+='		<td background='+MG_IMG_BASEURL+'pup_05.png></td>';sHCode+='		<td colspan=3 align=left valign=top bgcolor=#FFFFFF>'+sHtml+'</td>';sHCode+='		<td background='+MG_IMG_BASEURL+'pup_13.png></td>';sHCode+='	</tr>';sHCode+='	<tr>';sHCode+='		<td colspan=2 rowspan=3 height=36><img src='+MG_IMG_BASEURL+'pup_08.png></td>';sHCode+='		<td height=13 bgcolor=#FFFFFF></td>';sHCode+='		<td rowspan=2 height=23 bgcolor=#FFFFFF></td>';sHCode+='		<td height=13 background='+MG_IMG_BASEURL+'pup_13.png></td>';sHCode+='	</tr>';sHCode+='	<tr>';sHCode+='	  <td height=10 bgcolor=#FFFFFF></td>';sHCode+='		<td rowspan=2 height=23><img src='+MG_IMG_BASEURL+'pup_10.png></td>';sHCode+='	</tr>';sHCode+='	<tr>';sHCode+='		<td colspan=2 height=13 background='+MG_IMG_BASEURL+'pup_11.png></td>';sHCode+='	</tr>';sHCode+='</table>';return sHCode}