MVMessages=new Array();
MVMessages["MAPVIEWER-05500"]="Oracle Maps client internal error.";
MVMessages["MAPVIEWER-05501"]="Map tile layer not found. Check map tile layer name and/or data source name.";
MVMessages["MAPVIEWER-05502"]="Cannot get map tile layer config information.";
MVMessages["MAPVIEWER-05503"]="FOI ID cannot be null.";
MVMessages["MAPVIEWER-05504"]="MapViewer server base URL is not defined.";
MVMessages["MAPVIEWER-05505"]="Wrong map center point specified. It should be an MVSdoGeometry point.";
MVMessages["MAPVIEWER-05506"]="Invalid zoom level.";
MVMessages["MAPVIEWER-05507"]="Map tile layer name cannot be null. ";
MVMessages["MAPVIEWER-05508"]="FOI Id is already used, please pick a new Id.";
MVMessages["MAPVIEWER-05509"]="Theme-based FOI layer name is used, please pick a new name.";
MVMessages["MAPVIEWER-05510"]="Cannot find theme-based FOI layer.";
MVMessages["MAPVIEWER-05511"]="Error occurred when sending request to MapViewer server.";
MVMessages["MAPVIEWER-05512"]="Not enough points have been drawn.";
MVMessages["MAPVIEWER-05513"]="Not a valid line or polygon type MVSdoGeometry.";
MVMessages["MAPVIEWER-05514"]="Must have a filtering geometry when in high-light only mode.";
MVMessages["MAPVIEWER-05515"]="Oracle Maps client notification.";
MVMessages["MAPVIEWER-05516"]="Synchronized remote call is not supported when using Oracle Maps' non-AJAX remoting.";
MVMessages["MAPVIEWER-05517"]="Request string is too long for Oracle Maps' non-AJAX remoting.";
MVMessages["MAPVIEWER-05518"]="Map tile layer hasn't been successfully added.";
MVMessages["MAPVIEWER-05519"]="One or more parameter is missing or invalid.";
MVMessages["MAPVIEWER-05520"]="Geometry SRID is null.";
MVMessages["MAPVIEWER-05521"]="Call back function cannot be null when browser's builtin XMLHttp/XMLHttpRequest is disabled.";
MVMessages["MAPVIEWER-05522"]="Client side coordinate system conversion not supported.";
MVMessages["MAPVIEWER-05523"]="Cannot process response from MapViewer server.";
MVMessages["MAPVIEWER-05524"]="Theme feature highlighting is disabled for this theme.";
MVMessages["MAPVIEWER-05525"]="Theme has not been added to a MVMapView instance.";
MVMessages["MAPVIEWER-05526"]="Map has not been initialized. Please try again later.";
MVMessages["MAPVIEWER-05527"]="Wrong parameter data type. ";
MVMessages["MAPVIEWER-05528"]="Map tile layers have different zoom level definitions. Only the map tile layer added later will be added to the map.";
MVMessages.marqueeZoomHint="Click on the rectangle to zoom in!";
MVMessages.panNWInfoTip="Pan NorthWest";
MVMessages.panNInfoTip="Pan North";
MVMessages.panNEInfoTip="Pan NorthEast";
MVMessages.panWInfoTip="Pan West";
MVMessages.panEInfoTip="Pan East";
MVMessages.panSWInfoTip="Pan SouthWest";
MVMessages.panSInfoTip="Pan South";
MVMessages.panSEInfoTip="Pan SouthEast";
MVMessages.panCenterInfoTip="Home";
MVMessages.sliderBarInfoTip="Click to change zoom level";
MVMessages.sliderInfoTip="Drag to change zoom level";
MVMessages.zoomInInfoTip="Zoom in";
MVMessages.zoomOutInfoTip="Zoom out";
MVMessages.scaleBarInfoTip="Scale at the center of the map";
MVMessages.kilometers="km";
MVMessages.miles="mi";
MVMessages.meters="m";
MVMessages.feet="ft";
MVMessages["delete"]="Delete";
MVMessages.addPoint="Add Point";
MVMessages.finish="Finish";
MVMessages.clear="Clear";
MVMessages.totalDistance="Total Distance:";
MVMessages.km="km";
MVMessages.m="m";
MVMessages.cm="cm";
MVMessages.mi="mi";
MVMessages.yd="yd";
MVMessages.ft="ft";
MVMessages.clearButton="Clear Button";
MVMessages.redlineTool="Redline Tool";
MVMessages.distanceTool="Distance Tool";
MVMessages.circleTool="Circle Tool";
MVMessages.retangleTool="Retangle Tool";
MVMessages.marqueeZoomTool="Marquee Zoom Tool";
MVMessages.number_format="1,000.1";
MVMessages.road="Road";
MVMessages.satellite="Satellite";
MVMessages.shaded="Shaded";
function MVXMLHttpRequest(){this.onreadystatechange=null;
this.reqId=0;
this.url=null;
this.status=0;
this.readyState=0;
this.jsNode=null;
this.responseText=null;
}MVXMLHttpRequest.requests=new Array();
MVXMLHttpRequest.reqCount=0;
MVXMLHttpRequest.instanceId=Math.round(Math.random()*10000);
MVXMLHttpRequest.callBack=function(g,d,f){while(MVXMLHttpRequest.requests.length>0){var b=MVXMLHttpRequest.requests[0];
if(!b.onreadystatechange){if(b.jsNode){document.body.removeChild(b.jsNode);
b.jsNode=null;
}MVXMLHttpRequest.requests.shift();
}else{break;
}}var a=0;
for(;
a<MVXMLHttpRequest.requests.length;
a++){if(MVXMLHttpRequest.requests[a].reqId==g){var b=MVXMLHttpRequest.requests[a];
document.body.removeChild(b.jsNode);
b.jsNode=null;
if(a==0){MVXMLHttpRequest.requests.shift();
}b.status=200;
b.readyState=4;
b.responseText=d;
if(b.onreadystatechange&&!f){b.onreadystatechange();
}b.onreadystatechange=null;
return;
}}};
MVXMLHttpRequest.prototype.abort=function(){MVXMLHttpRequest.callBack(this.reqId,null,true);
};
MVXMLHttpRequest.prototype.open=function(d,b,a){if(!a){throw"[MVXMLHttpRequest.open] "+MVi18n.getErrorMessage("MAPVIEWER-05516");
}else{this.url=b;
}};
MVXMLHttpRequest.prototype.send=function(b){if(!this.url){return;
}this.reqId=MVXMLHttpRequest.instanceId+"_"+MVXMLHttpRequest.reqCount++;
var d=this.url;
if(d.indexOf("?")>0){d+="&";
}else{d+="?";
}d+="callback_id="+this.reqId;
d+="&"+b;
if(d.length>MVGlobalVariables.urlMaxLength){throw"[MVXMLHttpRequest.send] "+MVi18n.getErrorMessage("MAPVIEWER-05517");
return;
}var a=document.createElement("script");
a.src=d;
a.type="text/javascript";
a.charset="utf-8";
this.jsNode=a;
MVXMLHttpRequest.requests.push(this);
document.body.appendChild(a);
if(MVMapView.debug){MVi18n.alert("MVXMLHttpRequest. URL:"+d);
}};
MVXMLHttpRequest.prototype.setRequestHeader=function(a){};
if(typeof(MVGlobal_mvCount)=="undefined"){MVGlobal_mvCount=0;
}if(typeof(MVGlobal_CacheConfig)=="undefined"){MVGlobal_CacheConfig={};
}if(typeof(MVGlobal_srsList)=="undefined"){MVGlobal_srsList={};
}if(typeof(MVGlobal_defaultDataSource)=="undefined"){MVGlobal_defaultDataSource=null;
}function MVGlobalVariables(){}MVGlobalVariables.browserClass=document.all?(document.getElementById?2:1):(document.layers?3:0);
MVGlobalVariables.nvAgent=navigator.userAgent.toLowerCase();
MVGlobalVariables.GBIdx=null;
MVGlobalVariables.GBString=null;
MVGlobalVariables.unitFactors={};
MVGlobalVariables.defaultInfoStyle="MVInfoWindowStyle1";
MVGlobalVariables.csTransformFunctions={};
MVGlobalVariables.enableSelfDestroy=true;
MVGlobalVariables.isSelfDestroy=function(){return MVGlobalVariables.enableSelfDestroy;
};
MVGlobalVariables.getDefaultDataSource=function(){return MVGlobal_defaultDataSource;
};
MVGlobalVariables.setDefaultDataSource=function(a){if(!MVGlobal_defaultDataSource){MVGlobal_defaultDataSource=a;
}};
MVGlobalVariables.checkBrowser=function(a){MVGlobalVariables.GBIdx=MVGlobalVariables.nvAgent.indexOf(a)+1;
MVGlobalVariables.GBString=a;
return MVGlobalVariables.GBIdx;
};
if(MVGlobalVariables.checkBrowser("safari")||MVGlobalVariables.checkBrowser("applewebkit")){MVGlobalVariables.browser="SF";
}else{if(MVGlobalVariables.checkBrowser("opera")){MVGlobalVariables.browser="OS";
}else{if(MVGlobalVariables.checkBrowser("msie")){MVGlobalVariables.browser="IF";
if(window.performance!==undefined){MVGlobalVariables.browserVersion="9.0";
}}else{if(!MVGlobalVariables.checkBrowser("compatible")){MVGlobalVariables.browser="NS";
MVGlobalVariables.browserVersion=MVGlobalVariables.nvAgent.substring(8,11);
}else{MVGlobalVariables.browser="unknown";
}}}}MVGlobalVariables.isIOS=MVGlobalVariables.nvAgent.indexOf("iphone")>0||MVGlobalVariables.nvAgent.indexOf("ipad")>0||MVGlobalVariables.nvAgent.indexOf("ipod")>0;
if(!MVGlobalVariables.browserVersion){MVGlobalVariables.browserVersion=MVGlobalVariables.nvAgent.substring(MVGlobalVariables.GBIdx+MVGlobalVariables.GBString.length,MVGlobalVariables.GBIdx+MVGlobalVariables.GBString.length+3);
}MVGlobalVariables.browserMajorVersion=0;
if(MVGlobalVariables.browserVersion){var idx=MVGlobalVariables.browserVersion.indexOf(".");
if(idx>=0){MVGlobalVariables.browserMajorVersion=parseInt(MVGlobalVariables.browserVersion.substring(0,idx));
}else{MVGlobalVariables.browserMajorVersion=parseInt(MVGlobalVariables.browserVersion);
}}MVGlobalVariables.shouldUseDivFilter=function(){return MVGlobalVariables.browser=="IF"&&MVGlobalVariables.browserMajorVersion<7;
};
MVGlobalVariables.unitFactors.SQ_MM=0.000001;
MVGlobalVariables.unitFactors.SQ_KILOMETER=1000000;
MVGlobalVariables.unitFactors.SQ_CENTIMETER=0.0001;
MVGlobalVariables.unitFactors.SQ_MILLIMETER=0.000001;
MVGlobalVariables.unitFactors.SQ_CH=404.6856;
MVGlobalVariables.unitFactors.SQ_FT=0.09290304;
MVGlobalVariables.unitFactors.SQ_IN=0.00064516;
MVGlobalVariables.unitFactors.SQ_LI=0.04046856;
MVGlobalVariables.unitFactors.SQ_CHAIN=404.6856;
MVGlobalVariables.unitFactors.SQ_FOOT=0.09290304;
MVGlobalVariables.unitFactors.SQ_INCH=0.00064516;
MVGlobalVariables.unitFactors.SQ_LINK=0.04046856;
MVGlobalVariables.unitFactors.SQ_MILE=2589988;
MVGlobalVariables.unitFactors.SQ_ROD=25.29285;
MVGlobalVariables.unitFactors.SQ_SURVEY_FOOT=0.09290341;
MVGlobalVariables.unitFactors.SQ_YARD=0.8361274;
MVGlobalVariables.unitFactors.ACRE=4046.856;
MVGlobalVariables.unitFactors.HECTARE=10000;
MVGlobalVariables.unitFactors.PERCH=25.29285;
MVGlobalVariables.unitFactors.ROOD=1011.714;
MVGlobalVariables.unitFactors.M=1;
MVGlobalVariables.unitFactors.METER=1;
MVGlobalVariables.unitFactors.KM=1000;
MVGlobalVariables.unitFactors.KILOMETER=1000;
MVGlobalVariables.unitFactors.CM=0.01;
MVGlobalVariables.unitFactors.CENTIMETER=0.01;
MVGlobalVariables.unitFactors.MM=0.001;
MVGlobalVariables.unitFactors.MILLIMETER=0.001;
MVGlobalVariables.unitFactors.MILE=1609.344;
MVGlobalVariables.unitFactors.NAUT_MILE=1852;
MVGlobalVariables.unitFactors.SURVEY_FOOT=0.3048006096012;
MVGlobalVariables.unitFactors.FOOT=0.3048;
MVGlobalVariables.unitFactors.INCH=0.0254;
MVGlobalVariables.unitFactors.YARD=0.9144;
MVGlobalVariables.unitFactors.CHAIN=20.1168;
MVGlobalVariables.unitFactors.ROD=5.0292;
MVGlobalVariables.unitFactors.LINK=0.201166195;
MVGlobalVariables.unitFactors.MOD_USFT=0.304812253;
MVGlobalVariables.unitFactors.CL_FT=0.304797265;
MVGlobalVariables.unitFactors.IND_FT=0.304799518;
MVGlobalVariables.unitFactors.LINK_BEN=0.201167651;
MVGlobalVariables.unitFactors.LINK_SRS=0.201167651;
MVGlobalVariables.unitFactors.CHN_BEN=20.1167825;
MVGlobalVariables.unitFactors.CHN_SRS=20.1167651;
MVGlobalVariables.unitFactors.IND_YARD=0.914398554;
MVGlobalVariables.unitFactors.SRS_YARD=0.914398415;
MVGlobalVariables.unitFactors.FATHOM=1.8288;
MVGlobalVariables.unitFactors.SQ_M=1;
MVGlobalVariables.unitFactors.SQ_METER=1;
MVGlobalVariables.unitFactors.SQ_KM=1000000;
MVGlobalVariables.unitFactors.SQ_CM=0.0001;
MVGlobalVariables.getUnitFactor=function(a){if(a){a=a.toUpperCase();
}else{return 0;
}if(MVGlobalVariables.unitFactors[a]){return MVGlobalVariables.unitFactors[a];
}else{return 0;
}};
MVGlobalVariables.addMapCacheConfig=function(b,a){b=b.toUpperCase();
MVGlobal_CacheConfig[b]=a;
if(a.coordSys.srid){MVGlobal_srsList[a.coordSys.srid.toString()]=a.coordSys;
}};
MVGlobalVariables.getSRS=function(a){if(a&&MVGlobal_srsList[a.toString()]){return MVGlobal_srsList[a.toString()];
}else{return null;
}};
MVGlobalVariables.getMapCacheConfig=function(basemap,callBack,errorHandler){if(basemap.mcsURL==null||basemap.mapSource==null||MVUtil.strTrim(basemap.mapSource)==""){basemap.mapSource="null";
MVGlobal_CacheConfig[basemap.mapSource]=null;
return null;
}basemap.mapSource=basemap.mapSource.toUpperCase();
if(MVGlobal_CacheConfig[basemap.mapSource]){if(MVGlobal_CacheConfig[basemap.mapSource].transparent){basemap.isTransparent=true;
}if(callBack){callBack(MVGlobal_CacheConfig[basemap.mapSource]);
}return MVGlobal_CacheConfig[basemap.mapSource];
}var configURL=basemap.mcscfgURL;
var requestStr="xml_request="+encodeURIComponent('<?xml version="1.0" standalone="yes"?><map_cache_admin_request><get_client_config map_cache_names="'+basemap.mapSource+'" format="JSON"/></map_cache_admin_request>');
var request=null;
var localDomain=MVUtil.isLocalDomain(basemap.mcsURL);
var xmlHttp=localDomain||MVMapView.XMLHTTPEnabled;
var configLoaded=function(){try{var resp=xmlHttp?request.responseText:this.responseText;
eval("var result="+resp);
if(result.length==0){MVi18n.reportError("MVGlobalVariables.getMapCacheConfig","MAPVIEWER-05501",basemap.mapSource,errorHandler);
MVGlobal_CacheConfig[basemap.mapSource]=null;
result=null;
return;
}if(result[0].transparent){basemap.isTransparent=true;
}MVGlobalVariables.addMapCacheConfig(basemap.mapSource,result[0]);
result=null;
}catch(e){MVi18n.reportError("MVGlobalVariables.getMapCacheConfig","MAPVIEWER-05523",basemap.mapSource+":"+request.responseText,errorHandler);
return;
}if(callBack){callBack(MVGlobal_CacheConfig[basemap.mapSource]);
}};
try{request=MVUtil.getXMLHttpRequest(xmlHttp);
if(!xmlHttp){request.onreadystatechange=configLoaded;
}request.open("POST",MVUtil.getXMLHttpUrl(configURL),!xmlHttp);
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
request.send(MVUtil.getXMLHttpReq(configURL,requestStr));
}catch(e){MVi18n.reportError("MVGlobalVariables.getMapCacheConfig","MAPVIEWER-05511",e,errorHandler);
return;
}if(xmlHttp){if(request.status==200){configLoaded();
}else{MVGlobal_CacheConfig[basemap.mapSource]=null;
MVi18n.reportError("MVGlobalVariables.getMapCacheConfig","MAPVIEWER-05511",basemap.mapSource+":"+request.responseText,errorHandler);
}}request=null;
};
MVGlobalVariables.infoWindowWidth=180;
MVGlobalVariables.infoWindowHeight=100;
MVGlobalVariables.infoWindowTabsWidth=240;
MVGlobalVariables.infoWindowTabsHeight=130;
MVGlobalVariables.sliderBarW=14;
MVGlobalVariables.sliderBarH=112;
MVGlobalVariables.sliderW=14;
MVGlobalVariables.sliderH=14;
MVGlobalVariables.panImgW=14;
MVGlobalVariables.panImgH=14;
MVGlobalVariables.zoomImgW=14;
MVGlobalVariables.zoomImgH=14;
MVGlobalVariables.zoomInOutW=14;
MVGlobalVariables.zoomInOutH=14;
MVGlobalVariables.iwcWidth=600;
MVGlobalVariables.iwcHeight=600;
MVGlobalVariables.iwarrowWidth=30;
MVGlobalVariables.iwarrowHeight=16;
MVGlobalVariables.iwhlWidth=600;
MVGlobalVariables.iwhlHeight=1;
MVGlobalVariables.iwvlWidth=1;
MVGlobalVariables.iwvlHeight=600;
MVGlobalVariables.iwwuWidth=1;
MVGlobalVariables.iwwuHeight=10;
MVGlobalVariables.enableMapEventListner=true;
MVGlobalVariables.imgFilePath="/fsmc/images/";
MVGlobalVariables.imgRelPath="/fsmc/images/";
MVGlobalVariables.redlineToolId=0;
MVGlobalVariables.redlineInstance=null;
MVGlobalVariables.redlinePinMarkerImage="bulls-eye.png";
MVGlobalVariables.redlinePinMarkerWidth=38;
MVGlobalVariables.redlinePinMarkerHeight=38;
MVGlobalVariables.redlineIgnoreMove=5;
MVGlobalVariables.redlineMarkerStyleName="-redline-point-marker";
MVGlobalVariables.redlineLineStyleName="-redline-line-style";
MVGlobalVariables.redlineAreaStyleName="-redline-area-style";
MVGlobalVariables.circleToolId=0;
MVGlobalVariables.rectangleToolId=0;
MVGlobalVariables.urlMaxLength=2000;
MVGlobalVariables.defaultFoiURL=null;
MVGlobalVariables.localbaseURL=null;
MVGlobalVariables.getDefaultFoiURL=function(){if(!MVGlobalVariables.defaultFoiURL){MVGlobalVariables.defaultFoiURL=document.location.protocol+"//"+document.location.host+"/mapviewer/foi";
}return MVGlobalVariables.defaultFoiURL;
};
MVGlobalVariables.getLocalBaseURL=function(){if(!MVGlobalVariables.localbaseURL){MVGlobalVariables.localbaseURL=document.location.protocol+"//"+document.location.host+"/mapviewer";
}return MVGlobalVariables.localbaseURL;
};
MVGlobalVariables.proxyPath="/mapviewer/proxy";
MVGlobalVariables.proxyURL=null;
MVGlobalVariables.getProxyURL=function(){if(!MVGlobalVariables.proxyURL){if(MVGlobalVariables.proxyPath.indexOf("/")==0){MVGlobalVariables.proxyURL=MVGlobalVariables.proxyPath;
}else{MVGlobalVariables.proxyURL="/"+MVGlobalVariables.proxyPath;
}}return MVGlobalVariables.proxyURL;
};
if(document.getElementsByTagName("html")[0].getAttribute("xmlns")=="http://www.w3.org/1999/xhtml"){MVGlobalVariables.isXHTML=true;
}else{MVGlobalVariables.isXHTML=false;
}MVGlobalVariables.addCSTransFunc=function(b,a,d){var f=MVGlobalVariables.csTransformFunctions[b.toString()];
if(!f){f=MVGlobalVariables.csTransformFunctions[b.toString()]={};
}f[a.toString()]=d;
};
MVGlobalVariables.getCSTransFunc=function(b,a){var d=MVGlobalVariables.csTransformFunctions[b.toString()];
if(d){return d[a.toString()];
}else{return null;
}};
MVGlobalVariables.mapTileLayerCount=0;
MVGlobalVariables.transImageLoaded=false;
MVGlobalVariables.getHost=function(a){if(!a||a.indexOf("/")==0){var d=window.location.protocol;
if(d.indexOf("//")<0){d+="//";
}return d+window.location.host;
}else{var b=a.substring(0,a.indexOf("//")+2);
a=a.substring(a.indexOf("//")+2);
return b+a.substring(0,a.indexOf("/"));
}};
var nodes=document.getElementsByTagName("script");
for(var i=0;
i<nodes.length;
i++){var node=nodes[i];
if(node.src&&node.src.indexOf("oraclemaps.js")>=0&&node.src.indexOf("/mapviewer/")>=0){MVGlobalVariables.imgFilePath=MVGlobalVariables.getHost(node.src)+"/mapviewer/fsmc/images/";
break;
}}MVGlobalVariables.touchSupported=false;
MVGlobalVariables.isIOS=false;
var agent=MVGlobalVariables.nvAgent;
if(agent.indexOf("iphone")>=0||agent.indexOf("ipad")>=0){MVGlobalVariables.touchSupported=true;
MVGlobalVariables.isIOS=true;
}if(!MVGlobalVariables.touchSupported){try{if("ontouchstart" in document.documentElement){MVGlobalVariables.touchSupported=true;
}else{MVGlobalVariables.touchSupported=false;
}}catch(e){MVGlobalVariables.touchSupported=false;
}}MVGlobalVariables.toolButtonW=16;
MVGlobalVariables.toolButtonH=16;
MVGlobalVariables.smallMobileDevice=false;
if(agent.indexOf("iphone")>=0||agent.indexOf("ipod")>=0){MVGlobalVariables.sliderBarW=30;
MVGlobalVariables.sliderBarH=200;
MVGlobalVariables.sliderW=30;
MVGlobalVariables.sliderH=30;
MVGlobalVariables.panImgW=30;
MVGlobalVariables.panImgH=30;
MVGlobalVariables.zoomImgW=30;
MVGlobalVariables.zoomImgH=30;
MVGlobalVariables.zoomInOutW=30;
MVGlobalVariables.zoomInOutH=30;
MVGlobalVariables.toolButtonW=26;
MVGlobalVariables.toolButtonH=26;
MVGlobalVariables.smallMobileDevice=true;
}else{if(agent.indexOf("ipad")>=0||MVGlobalVariables.touchSupported){MVGlobalVariables.sliderBarW=20;
MVGlobalVariables.sliderBarH=160;
MVGlobalVariables.sliderW=20;
MVGlobalVariables.sliderH=20;
MVGlobalVariables.panImgW=20;
MVGlobalVariables.panImgH=20;
MVGlobalVariables.zoomImgW=20;
MVGlobalVariables.zoomImgH=20;
MVGlobalVariables.zoomInOutW=20;
MVGlobalVariables.zoomInOutH=20;
MVGlobalVariables.toolButtonW=20;
MVGlobalVariables.toolButtonH=20;
}}MVGlobalVariables.touchHoldTimeOut=800;
MVGlobalVariables.bingTileLayerDefinition={mapTileLayer:"MV3785_0_18_bing",format:"PNG",coordSys:{srid:3785,type:"PROJECTED",distConvFactor:1,minX:-20037508,minY:-20037508,maxX:20037508,maxY:20037508},zoomLevels:[{zoomLevel:0,name:"",tileWidth:20037508,tileHeight:20037508,tileImageWidth:256,tileImageHeight:256},{zoomLevel:1,name:"",tileWidth:10018754,tileHeight:10018754,tileImageWidth:256,tileImageHeight:256},{zoomLevel:2,name:"",tileWidth:5009377,tileHeight:5009377,tileImageWidth:256,tileImageHeight:256},{zoomLevel:3,name:"",tileWidth:2504688.5,tileHeight:2504688.5,tileImageWidth:256,tileImageHeight:256},{zoomLevel:4,name:"",tileWidth:1252344.25,tileHeight:1252344.25,tileImageWidth:256,tileImageHeight:256},{zoomLevel:5,name:"",tileWidth:626172.125,tileHeight:626172.125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:6,name:"",tileWidth:313086.0625,tileHeight:313086.0625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:7,name:"",tileWidth:156543.03125,tileHeight:156543.03125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:8,name:"",tileWidth:78271.515625,tileHeight:78271.515625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:9,name:"",tileWidth:39135.7578125,tileHeight:39135.7578125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:10,name:"",tileWidth:19567.87890625,tileHeight:19567.87890625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:11,name:"",tileWidth:9783.939453125,tileHeight:9783.939453125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:12,name:"",tileWidth:4891.9697265625,tileHeight:4891.9697265625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:13,name:"",tileWidth:2445.98486328125,tileHeight:2445.98486328125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:14,name:"",tileWidth:1222.992431640625,tileHeight:1222.992431640625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:15,name:"",tileWidth:611.4962158203125,tileHeight:611.4962158203125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:16,name:"",tileWidth:305.74810791015625,tileHeight:305.74810791015625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:17,name:"",tileWidth:152.87405395507812,tileHeight:152.87405395507812,tileImageWidth:256,tileImageHeight:256},{zoomLevel:18,name:"",tileWidth:76.43702697753906,tileHeight:76.43702697753906,tileImageWidth:256,tileImageHeight:256}]};
MVGlobalVariables.googleTileLayerDefinition={mapTileLayer:"MV3785_1_19_google",format:"PNG",coordSys:{srid:3785,type:"PROJECTED",distConvFactor:1,minX:-20037508,minY:-20037508,maxX:20037508,maxY:20037508},zoomLevels:[{zoomLevel:1,name:"",tileWidth:20037508,tileHeight:20037508,tileImageWidth:256,tileImageHeight:256},{zoomLevel:2,name:"",tileWidth:10018754,tileHeight:10018754,tileImageWidth:256,tileImageHeight:256},{zoomLevel:3,name:"",tileWidth:5009377,tileHeight:5009377,tileImageWidth:256,tileImageHeight:256},{zoomLevel:4,name:"",tileWidth:2504688.5,tileHeight:2504688.5,tileImageWidth:256,tileImageHeight:256},{zoomLevel:5,name:"",tileWidth:1252344.25,tileHeight:1252344.25,tileImageWidth:256,tileImageHeight:256},{zoomLevel:6,name:"",tileWidth:626172.125,tileHeight:626172.125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:7,name:"",tileWidth:313086.0625,tileHeight:313086.0625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:8,name:"",tileWidth:156543.03125,tileHeight:156543.03125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:9,name:"",tileWidth:78271.515625,tileHeight:78271.515625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:10,name:"",tileWidth:39135.7578125,tileHeight:39135.7578125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:11,name:"",tileWidth:19567.87890625,tileHeight:19567.87890625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:12,name:"",tileWidth:9783.939453125,tileHeight:9783.939453125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:13,name:"",tileWidth:4891.9697265625,tileHeight:4891.9697265625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:14,name:"",tileWidth:2445.98486328125,tileHeight:2445.98486328125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:15,name:"",tileWidth:1222.992431640625,tileHeight:1222.992431640625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:16,name:"",tileWidth:611.4962158203125,tileHeight:611.4962158203125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:17,name:"",tileWidth:305.74810791015625,tileHeight:305.74810791015625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:18,name:"",tileWidth:152.87405395507812,tileHeight:152.87405395507812,tileImageWidth:256,tileImageHeight:256},{zoomLevel:19,name:"",tileWidth:76.43702697753906,tileHeight:76.43702697753906,tileImageWidth:256,tileImageHeight:256}]};
MVGlobalVariables.googleTileLayerDefinition21={mapTileLayer:"MV3785_1_21_google",format:"PNG",coordSys:{srid:3785,type:"PROJECTED",distConvFactor:1,minX:-20037508,minY:-20037508,maxX:20037508,maxY:20037508},zoomLevels:[{zoomLevel:1,name:"",tileWidth:20037508,tileHeight:20037508,tileImageWidth:256,tileImageHeight:256},{zoomLevel:2,name:"",tileWidth:10018754,tileHeight:10018754,tileImageWidth:256,tileImageHeight:256},{zoomLevel:3,name:"",tileWidth:5009377,tileHeight:5009377,tileImageWidth:256,tileImageHeight:256},{zoomLevel:4,name:"",tileWidth:2504688.5,tileHeight:2504688.5,tileImageWidth:256,tileImageHeight:256},{zoomLevel:5,name:"",tileWidth:1252344.25,tileHeight:1252344.25,tileImageWidth:256,tileImageHeight:256},{zoomLevel:6,name:"",tileWidth:626172.125,tileHeight:626172.125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:7,name:"",tileWidth:313086.0625,tileHeight:313086.0625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:8,name:"",tileWidth:156543.03125,tileHeight:156543.03125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:9,name:"",tileWidth:78271.515625,tileHeight:78271.515625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:10,name:"",tileWidth:39135.7578125,tileHeight:39135.7578125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:11,name:"",tileWidth:19567.87890625,tileHeight:19567.87890625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:12,name:"",tileWidth:9783.939453125,tileHeight:9783.939453125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:13,name:"",tileWidth:4891.9697265625,tileHeight:4891.9697265625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:14,name:"",tileWidth:2445.98486328125,tileHeight:2445.98486328125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:15,name:"",tileWidth:1222.992431640625,tileHeight:1222.992431640625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:16,name:"",tileWidth:611.4962158203125,tileHeight:611.4962158203125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:17,name:"",tileWidth:305.74810791015625,tileHeight:305.74810791015625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:18,name:"",tileWidth:152.87405395507812,tileHeight:152.87405395507812,tileImageWidth:256,tileImageHeight:256},{zoomLevel:19,name:"",tileWidth:76.43702697753906,tileHeight:76.43702697753906,tileImageWidth:256,tileImageHeight:256},{zoomLevel:20,name:"",tileWidth:38.21851348876953,tileHeight:38.21851348876953,tileImageWidth:256,tileImageHeight:256},{zoomLevel:21,name:"",tileWidth:19.109256744384766,tileHeight:19.109256744384766,tileImageWidth:256,tileImageHeight:256}]};
MVGlobalVariables.tomtomTileLayerDefinition={mapTileLayer:"MV3857_1_16_tomtom",format:"PNG",coordSys:{srid:3785,type:"PROJECTED",distConvFactor:1,minX:-20037508,minY:-20037508,maxX:20037508,maxY:20037508},zoomLevels:[{zoomLevel:1,name:"",tileWidth:5009377,tileHeight:5009377,tileImageWidth:256,tileImageHeight:256},{zoomLevel:2,name:"",tileWidth:2504688.5,tileHeight:2504688.5,tileImageWidth:256,tileImageHeight:256},{zoomLevel:3,name:"",tileWidth:1252344.25,tileHeight:1252344.25,tileImageWidth:256,tileImageHeight:256},{zoomLevel:4,name:"",tileWidth:626172.125,tileHeight:626172.125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:5,name:"",tileWidth:313086.0625,tileHeight:313086.0625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:6,name:"",tileWidth:156543.03125,tileHeight:156543.03125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:7,name:"",tileWidth:78271.515625,tileHeight:78271.515625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:8,name:"",tileWidth:39135.7578125,tileHeight:39135.7578125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:9,name:"",tileWidth:19567.87890625,tileHeight:19567.87890625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:10,name:"",tileWidth:9783.939453125,tileHeight:9783.939453125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:11,name:"",tileWidth:4891.9697265625,tileHeight:4891.9697265625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:12,name:"",tileWidth:2445.98486328125,tileHeight:2445.98486328125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:13,name:"",tileWidth:1222.992431640625,tileHeight:1222.992431640625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:14,name:"",tileWidth:611.4962158203125,tileHeight:611.4962158203125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:15,name:"",tileWidth:305.74810791015625,tileHeight:305.74810791015625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:16,name:"",tileWidth:152.87405395507812,tileHeight:152.87405395507812,tileImageWidth:256,tileImageHeight:256}]};
function MVUtil(){}MVUtil.getScreenCoordinates=function(k,h,g,d,b,f,r,n,l){var o=(n-h)*f/(d-h)-k.divLeft;
var m=(b-l)*r/(b-g)-k.divTop;
var a=MVSdoGeometry.createPoint(o,m);
return a.sdo_point;
};
MVUtil.getScreenXY=function(h,g,f,b,a,d,o,m,k){var n=(m-g)*d/(b-g)-h.divLeft;
var l=(a-k)*o/(a-f)-h.divTop;
return[n,l];
};
MVUtil.getNumber=function(a){a=a+"";
if(a.indexOf("px")>0){a=a.substring(0,a.length-2);
}return parseInt(""+a);
};
MVUtil.getLeft=function(b){var a=b.style.left+"";
if(a.indexOf("px")>0){a=a.substring(0,a.length-2);
}return parseInt(""+a);
};
MVUtil.getTop=function(b){var a=b.style.top+"";
if(a.indexOf("px")>0){a=a.substring(0,a.length-2);
}return parseInt(""+a);
};
MVUtil.getZIndex=function(b){var a=b.style.zIndex;
if(!a){return 0;
}return parseInt(""+a);
};
MVUtil.setLeftTop=function(d,b,a){if(MVGlobalVariables.browserClass==2){d.style.pixelLeft=b;
d.style.pixelTop=a;
}else{d.style.left=MVUtil.pixel(b);
d.style.top=MVUtil.pixel(a);
}};
MVUtil.setDIVStyle=function(k,h,g,b,a,f,d){k.style.left=MVUtil.pixel(h);
k.style.top=MVUtil.pixel(g);
k.style.width=MVUtil.pixel(b);
k.style.height=MVUtil.pixel(a);
if(f){k.style.zIndex=f;
}if(d){k.style.fontSize=MVUtil.pixel(d);
}};
MVUtil.setScaleDIVManner=function(a){a.style.position="absolute";
a.unselectable="on";
a.onselectstart=MVUtil.falseFunc;
a.style.fontFamily="Arial, sans serif";
a.style.MozUserSelect="none";
a.align="left";
};
MVUtil.falseFunc=function(){return false;
};
MVUtil.setCursor=function(a,b){if(!a){return;
}try{if(b.indexOf(".")>-1){b='url("'+b+'"),auto';
}a.style.cursor=b;
if(a.tagName=="AREA"&&MVGlobalVariables.browser=="IF"&&b=="pointer"){a.href="javascript:void(0)";
}}catch(d){if(b=="pointer"){MVUtil.setCursor(a,"hand");
}}};
MVUtil.offsetPositionAbsolute=function(d){var a={x:0,y:0};
try{var g=d;
while(d){a.x+=d.offsetLeft;
a.y+=d.offsetTop;
d=d.offsetParent;
}d=g;
while(d&&d.tagName!="BODY"){a.x-=d.scrollLeft;
a.y-=d.scrollTop;
d=d.parentNode;
}}catch(f){}return a;
};
function FigLayer(b,a,f,g,k,d,h){var l=null;
if(h&&MVGlobalVariables.shouldUseDivFilter()){l=document.createElement("div");
l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b+"', sizingMethod='scale');";
}else{l=document.createElement("img");
l.src=b;
}if(a&&f){l.style.width=MVUtil.pixel(a);
l.style.height=MVUtil.pixel(f);
l.width=a;
l.height=f;
}if(k||(g||(k==0||g==0))){l.style.position="absolute";
l.style.left=MVUtil.pixel(g);
l.style.top=MVUtil.pixel(k);
}if(d||d==0){l.style.zIndex=d;
}if(MVGlobalVariables.browser=="IF"){l.unselectable="on";
l.onselectstart=MVUtil.falseFunc;
}else{l.style.MozUserSelect="none";
}if(MVGlobalVariables.browser=="IF"){l.galleryImg="no";
}l.style.border="0";
l.style.padding="0";
l.style.margin="0";
l.oncontextmenu=MVUtil.falseFunc;
return l;
}MVUtil.getMouseLeftTop=function(b,d){if(d){var a=null;
if(d.type!=undefined){a=b.getEventCoords(d);
}else{a=d;
}var f=MVSdoGeometry.createPoint(a.left,a.top);
return f.sdo_point;
}else{var a=b.getEventCoords(window.event);
var f=MVSdoGeometry.createPoint(a.left,a.top);
return f.sdo_point;
}};
MVUtil.getMouseLocation=function(d,b){var g=MVUtil.getMouseLeftTop(d,b);
var f=g.x-d.getPaneWidth()/2;
var a=f/d.pixPerX+d.mapCenterX;
f=g.y-d.getPaneHeight()/2;
var k=((-1)*f)/d.pixPerY+d.mapCenterY;
var h=MVSdoGeometry.createPoint(a,k);
return h;
};
MVUtil.getMouseXY=function(d){d=(d)?d:((window.event)?event:null);
var b=0;
var g=0;
if(d.touches){var a=null;
if(d.touches.length==0){if(d.changedTouches&&d.changedTouches.length>0){a=d.changedTouches[0];
}else{return null;
}}else{a=d.touches[0];
}b=a.pageX;
g=a.pageY;
}if(d.pageX){b=d.pageX;
g=d.pageY;
}else{if(d.clientX){b=d.clientX+document.body.scrollLeft-document.body.clientLeft;
g=d.clientY+document.body.scrollTop-document.body.clientTop;
if(document.body.parentElement&&(document.body.parentElement.clientLeft||document.body.parentElement.clientTop)){var f=document.body.parentElement;
b+=f.scrollLeft-f.clientLeft;
g+=f.scrollTop-f.clientTop;
}}}return MVSdoGeometry.createPoint(b,g).sdo_point;
};
MVUtil.keepInCSBoundary=function(d,a){var b=d.msi.coverMaxX-d.msi.coverMinX;
while(a<d.msi.coverMinX){a=a+b;
}while(a>d.msi.coverMaxX){a-=b;
}return a;
};
MVUtil.keepOrdinatesInCSBoundary=function(b,f){var d=new Array();
for(var a=0;
a<f.length;
){d.push(MVUtil.keepInCSBoundary(b,parseFloat(f[a++])));
d.push(f[a++]);
}return d;
};
MVUtil.debugInfoNum=0;
MVUtil.showDebugInfo=function(b){var a=document.createElement("div");
a.style.zIndex=1000;
a.style.width=200;
a.style.backgroundColor="#ffffff";
a.style.position="absolute";
a.style.left=0;
a.style.top=((MVUtil.debugInfoNum++)*20)%550;
a.innerHTML=b;
document.body.appendChild(a);
};
MVUtil.getXMLHttpRequest=function(a){if(!a){return new MVXMLHttpRequest();
}else{if(window.ActiveXObject){var b=null;
try{b=new ActiveXObject("Microsoft.XMLHTTP");
}catch(d){b=new ActiveXObject("Msxml2.XMLHTTP");
}return b;
}else{return new XMLHttpRequest();
}}};
MVUtil.stopEvent=function(a){if(a){if(MVGlobalVariables.browser=="IF"){a.cancelBubble=true;
}else{if(a.stopPropagation){a.stopPropagation();
}}if(a.preventDefault){a.preventDefault();
}else{a.returnValue=false;
}}};
MVUtil.pixel=function(b){return Math.round(b)+"px";
};
MVUtil.countTimes=function(d,a){var f=0;
var b=-1;
while((b=d.indexOf(a,b+1))!=-1){f++;
}return f;
};
MVUtil.getCSSPostfix=function(d){var b=d.indexOf("<");
if(b==-1){return"";
}var a=d.indexOf(" ",b+1);
if(a==-1){return"";
}return"</"+MVUtil.strTrim(d.substring(b+1,a))+">";
};
MVUtil.strTrim=function(a){return a.replace(/(^[\s]*)|([\s]*$)/g,"");
};
MVUtil.strBeginWith=function(b,a){return b.substring(0,a.length)==a;
};
MVUtil.strEndWith=function(b,a){return b.substring(b.length-a.length,b.length)==a;
};
MVUtil.strAddStyle=function(b,a){return a+b+MVUtil.getCSSPostfix(a);
};
MVUtil.strReplaceAll=function(f,a,h){if(!f){return f;
}var g;
g=f.indexOf(a);
if(g>-1){var d=f.substring(0,g);
var b=f.substring(g+a.length,f.length);
f=d+h+MVUtil.strReplaceAll(b,a,h);
}return f;
};
MVUtil.strBeforeDot=function(a){if(a.indexOf(".")>=0){return a.substring(0,a.indexOf("."));
}else{return a;
}};
MVUtil.strAfterDot=function(a){if(a.indexOf(".")>=0){return a.substring(a.indexOf(".")+1,a.length);
}else{return a;
}};
MVUtil.objArray=new Array();
MVUtil.foiObj=new Array();
MVUtil.nodeIndexArray=new Array();
MVUtil.pushNode=function(a){return;
};
MVUtil.MVUnload=function(){if(typeof(MVUtil.foiObj)!="undefined"&&(MVUtil.foiObj!=null)){for(var a=0;
MVUtil.foiObj&&a<MVUtil.foiObj.length;
a++){if(MVUtil.foiObj[a]){MVUtil.clearNode(MVUtil.foiObj[a]);
MVUtil.foiObj[a]=null;
}}}while(MVUtil.objArray.length>0){var b=MVUtil.objArray.pop();
b.destroy();
}};
window.onunload=function(){MVUtil.MVUnload();
};
MVUtil.closureWrapper=function(b,a){return function(){return a.apply(b,arguments);
};
};
MVUtil.freeMemory=function(d){if(MVGlobalVariables.browser=="IF"){if(d.closureIndex){var b=(d.closureIndex);
for(var a=(MVUtil.closureFunc[b].length);
a>0;
--a){MVUtil.closureFunc[b][a-1]=null;
MVUtil.closureFunc[b].pop();
}MVUtil.closureFunc[b]=null;
d.closureIndex=null;
d=null;
MVUtil.closureObj[b]=null;
MVUtil.closureSlot.push(b);
}}};
MVUtil.gc=function(){if(MVGlobalVariables.browser=="IF"&&MVUtil.closureObjSpec){var b=0;
if(MVUtil.totalNum){b=(MVUtil.totalNum);
}if((MVUtil.closureObjSpec.length)<b){return;
}for(var a=0;
a<(MVUtil.closureObjSpec.length);
++a){if((MVUtil.closureObjSpec[a])&&(MVUtil.closureObjSpec[a].readyState)&&(MVUtil.closureObjSpec[a].readyState)==4){MVUtil.closureObjSpec[a]=null;
MVUtil.closureFuncSpec[a]=null;
MVUtil.closureSlotSpec.push(a);
}}}};
MVUtil.customizeGc=function(a,b){if(MVGlobalVariables.browser!="IF"){return;
}if(a=="time"){if(MVUtil.gcTimer){clearInterval(MVUtil.gcTimer);
MVUtil.gcTimer=setInterval(MVUtil.gc,b);
}else{MVUtil.gcTimer=setInterval(MVUtil.gc,b);
}}if(a=="totalNum"){MVUtil.totalNum=b;
}};
MVUtil.deleteImage=function(a){if(a!=null){if(a.parentNode){a.parentNode.removeChild(a);
}delete a;
}};
MVUtil.disableElementSelection=function(a){if(MVGlobalVariables.browser=="NS"){a.style.MozUserSelect="none";
}else{if(MVGlobalVariables.browser=="SF"){a.style.KhtmlUserSelect="none";
}else{if(MVGlobalVariables.browser=="IF"){a.unselectable="on";
}else{return false;
}}}return true;
};
MVUtil.enableElementSelection=function(a){if(MVGlobalVariables.browser=="NS"){a.style.MozUserSelect="";
}else{if(MVGlobalVariables.browser=="SF"){a.style.KhtmlUserSelect="";
}else{if(MVGlobalVariables.browser=="IF"){a.unselectable="off";
}else{return false;
}}}return true;
};
MVUtil.getDomain=function(a){if(!a){return null;
}var d=a.indexOf("://");
if(d>0){d+=3;
var b=a.indexOf("/",d);
if(b>0){return a.substring(d,b);
}else{return a.substring(d);
}}else{return null;
}};
MVUtil.removeAllChildren=function(d,a){if(!d){return;
}var b=d.childNodes;
if(b!=null){while(b.length>0){MVUtil.clearNode(b[0],a);
d.removeChild(b[0]);
}}};
MVUtil.discardNode=function(a){if(!a){return;
}if(MVGlobalVariables.browser==="IF"){var b=document.getElementById("IELeakGarbageBin4MV");
if(!b){b=document.createElement("DIV");
b.id="IELeakGarbageBin4MV";
b.style.display="none";
document.body.appendChild(b);
}b.appendChild(a);
b.innerHTML="";
}else{if(a.parentNode){a.parentNode.removeChild(a);
}}};
MVUtil.destroyNode=function(b,a){if(!b){return;
}MVUtil.clearNode(b,a);
MVUtil.discardNode(b);
};
MVUtil.clearNode=function(b,a){if(!b){return;
}while(b.hasChildNodes()){var d=b.firstChild;
MVUtil.clearNode(d,a);
MVUtil.discardNode(d);
}MVUtil.clearListeners(b,a);
};
MVUtil.clearListeners=function(d,a){if(!d){return;
}try{if(d.onload){d.onload=null;
}if(d.onmouseover){d.onmouseover=null;
}if(d.onmouseout){d.onmouseout=null;
}if(d.onmousedown){d.onmousedown=null;
}if(d.onmouseup){d.onmouseup=null;
}if(d.oncontextmenu){d.oncontextmenu=null;
}if(d.ondblclick){d.ondblclick=null;
}if(d.onclick){d.onclick=null;
}if(d.onkeyup){d.onkeyup=null;
}if(d.onkeydown){d.onkeydown=null;
}if(d.onmousemove){d.onmousemove=null;
}if(d.onfocus){d.onfocus=null;
}if(d.onblur){d.onblur=null;
}if(d.onkeypressed){d.onkeypressed=null;
}if(d.onmousewheel){d.onmousewheel=null;
}if(d.onselectstart){d.onselectstart=null;
}if(MVGlobalVariables.touchSupported){d.ontouchstart=null;
d.ontouchmove=null;
d.ontouchend=null;
}if(MVGlobalVariables.browser=="IF"){if(d.style&&d.style.filter){d.style.filter=null;
}if(d.closureIndex){MVUtil.nodeIndexArray.push(d.closureIndex);
MVUtil.foiObj[d.closureIndex]=null;
}}}catch(b){MVi18n.reportError("MVUtil.clearListeners","MAPVIEWER-05500",d.nodeName+","+d.nodeType+"\n"+b,a);
}};
MVUtil.deleteNode=MVUtil.clearNode;
MVUtil.createSingleCellTable=function(b){var a=document.createElement("table");
var d=document.createElement("tr");
var f=document.createElement("td");
f.innerHTML=b;
d.appendChild(f);
a.appendChild(d);
return a;
};
MVUtil.getEvent=function(a){return a?a:((window.event)?event:null);
};
MVUtil.isIE7=function(){if(navigator.userAgent&&navigator.userAgent.indexOf("MSIE 7")>=0){return true;
}else{return false;
}};
MVUtil.getNumber=function(a){var b=0;
if(typeof(a)=="string"){if(a.indexOf("px")>0){a=a.substring(0,a.length-2);
}if(a.indexOf(".")>0){b=parseFloat(a);
}else{b=parseInt(a);
}if(isNaN(b)){b=0;
}return b;
}else{if(typeof(a)=="number"){b=a;
}}return b;
};
MVUtil.trapEvent=function(a){a=(a)?a:((window.event)?event:null);
if(MVGlobalVariables.browser=="IF"){a.cancelBubble=true;
}else{if(a.stopPropagation){a.stopPropagation();
}}};
MVUtil.createImageNode=function(g,f,d){var b=(MVGlobalVariables.shouldUseDivFilter()&&f)?document.createElement("div"):document.createElement("img");
if(MVGlobalVariables.shouldUseDivFilter()&&f){var a=d?"scale":"image";
if(g){b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+g+"', sizingMethod='"+a+"');";
}}else{b.src=g;
}if(MVGlobalVariables.browser=="IF"&&!f){b.galleryImg="no";
}return b;
};
if(!MVGlobalVariables.touchSupported){MVUtil.attachEvent=function(f,b,d,a){if(!a){a=false;
}if(MVGlobalVariables.browser=="IF"){b="on"+b;
f.attachEvent(b,d);
}else{f.addEventListener(b,d,!a);
}};
MVUtil.detachEvent=function(f,b,d,a){if(!f){return;
}if(!a){a=false;
}if(MVGlobalVariables.browser=="IF"){b="on"+b;
f.detachEvent(b,d);
}else{f.removeEventListener(b,d,!a);
}};
MVUtil.setListener=function(d,a,b){a="on"+a;
d[a]=b;
};
MVUtil.getListener=function(b,a){a="on"+a;
return b[a];
};
}else{MVUtil.attachEvtLsnr=function(f,b,d,a){if(!a){a=false;
}if(MVGlobalVariables.browser=="IF"){b="on"+b;
f.attachEvent(b,d);
}else{f.addEventListener(b,d,!a);
}};
MVUtil.detachEvtLsnr=function(f,b,d,a){if(!a){a=false;
}if(MVGlobalVariables.browser=="IF"){b="on"+b;
f.detachEvent(b,d);
}else{f.removeEventListener(b,d,!a);
}};
MVUtil.attachEvent=function(f,b,d,a){if(!a){a=false;
}if(b=="mousedown"){MVUtil.attachEvtLsnr(f,b,d,a);
b="touchstart";
}else{if(b=="mouseup"){MVUtil.attachEvtLsnr(f,b,d,a);
b="touchend";
}else{if(b=="mousemove"){MVUtil.attachEvtLsnr(f,b,d,a);
b="touchmove";
}}}if(b=="click"){MVUtil.attachEvtLsnr(f,b,d,a);
d.MV_TOUCHSTART=function(g){g.preventDefault();
g=MVUtil.getEvent(g);
f.touchLoc=MVUtil.getMouseXY(g);
};
MVUtil.attachEvtLsnr(f,"touchstart",d.MV_TOUCHSTART,true);
d.MV_TOUCHEND=function(g){g=MVUtil.getEvent(g);
if(f.touchLoc){g.preventDefault();
var h=MVUtil.getMouseXY(g);
if(Math.abs(h.x-f.touchLoc.x)<=2&&Math.abs(h.y-f.touchLoc.y)<=2){d(g);
}f.touchLoc=null;
}};
MVUtil.attachEvtLsnr(f,"touchend",d.MV_TOUCHEND,true);
}else{MVUtil.attachEvtLsnr(f,b,d,a);
}};
MVUtil.detachEvent=function(f,b,d,a){if(!a){a=false;
}if(b=="mousedown"){MVUtil.detachEvtLsnr(f,b,d,a);
b="touchstart";
}else{if(b=="mouseup"){MVUtil.detachEvtLsnr(f,b,d,a);
b="touchend";
}else{if(b=="mousemove"){MVUtil.detachEvtLsnr(f,b,d,a);
b="touchmove";
}}}if(b=="click"){MVUtil.detachEvtLsnr(f,b,d,a);
if(d.MV_TOUCHSTART){MVUtil.detachEvtLsnr(f,"touchstart",d.MV_TOUCHSTART,a);
}if(d.MV_TOUCHEND){MVUtil.detachEvtLsnr(f,"touchend",d.MV_TOUCHEND,a);
}}else{MVUtil.detachEvtLsnr(f,b,d,a);
}};
MVUtil.setListener=function(d,a,b){if(a=="mousedown"){a="touchstart";
}else{if(a=="mouseup"){a="touchend";
}else{if(a=="mousemove"){a="touchmove";
}}}a="on"+a;
d[a]=b;
};
MVUtil.getListener=function(b,a){if(a=="mousedown"){a="touchstart";
}else{if(a=="mouseup"){a="touchend";
}else{if(a=="mousemove"){a="touchmove";
}}}a="on"+a;
return b[a];
};
}MVUtil.mouseLeftKeyPressed=function(a){if(a.touches){return true;
}else{if(MVGlobalVariables.browser=="IF"){return a.button==1;
}else{return a.which==1;
}}};
MVUtil.mouseRightKeyPressed=function(a){if(MVGlobalVariables.browser=="IF"){return a.button==2;
}else{return a.which==3;
}};
MVUtil.formatNum=function(m){if(m==null||m=="undefine"){return;
}if(Math.abs(m)>=1000){m=Math.round(m);
}else{if(Math.abs(m)>=100){m=Math.round(m*10)/10;
}else{if(Math.abs(m)>=10){m=Math.round(m*100)/100;
}else{if(Math.abs(m)>=1){m=Math.round(m*1000)/1000;
}else{if(Math.abs(m)>=0.1){m=Math.round(m*10000)/10000;
}else{if(Math.abs(m)>=0.01){m=Math.round(m*100000)/100000;
}else{if(Math.abs(m)>=0.001){m=Math.round(m*1000000)/1000000;
}else{m=Math.round(m*10000000)/10000000;
}}}}}}}var g=MVMessages.number_format.charAt(1);
var d=MVMessages.number_format.charAt(5);
m=new String(m);
if(m.indexOf(".00")>0){m=m.substring(0,m.indexOf(".00"));
}var o,a,f;
if(m.indexOf(".")>0){o=m.split(".");
a=o[0];
f=o[1];
}else{a=m;
f=null;
}var l=a.length-1-3-3;
var n;
if(a.length<=3){n=a;
}else{n=g.concat(a.slice(-3));
while(l>-1){var b=a.substr(l+1,3);
n=g.concat(b,n);
l=l-3;
}if(a.length%3!=0){n=a.substr(0,(a.length%3)).concat(n);
}else{n=a.substr(0,3).concat(n);
}}if(f!=null){var h=3;
var k;
if(f.length<=3){k=f;
}else{k=f.slice(0,3);
while(h<=f.length-1-3){var b=f.substr(h,3);
k=k.concat(g,b);
h=h+3;
}if(f.length%3!=0){k=k.concat(g,f.slice(-f.length%3));
}else{k=k.concat(g,f.slice(-3));
}}}if(f==null){return n;
}else{return n.concat(d,k);
}};
MVUtil.getEventSource=function(a){if(MVGlobalVariables.browser=="IF"){return a.srcElement;
}else{return a.target;
}};
MVUtil.unique_array=function(f){var g=f;
var a;
for(var d=0;
d<f.length;
d++){for(var b=0;
b<f.length;
b++){a=f[d];
if((d+b+1)<f.length&&a==f[d+b+1]){g.splice(d+b+1,1);
}}}return g;
};
MVUtil.runListeners=function(d,g,a){if(d){var f=d[g];
if(f!=null){for(var b=0;
b<f.length;
b++){if(a!=undefined){(f[b]).apply(f[b],a);
}else{(f[b]).apply(f[b]);
}}}}};
MVUtil.detachEventListener=function(b,f,g){var d=b[f];
if(d){for(var a=0;
a<d.length;
a++){if(g==d[a]){d.splice(a,1);
}}if(d.length==0){b[f]=null;
}}};
MVUtil.attachEventListener=function(a,b,d){a[b]?a[b].push(d):a[b]=[d];
a[b]=MVUtil.unique_array(a[b]);
};
MVUtil.getMVIndFOIsControlAndFOI=function(f){var b=f.ifctl;
while(!b&&f.parentNode){f=f.parentNode;
b=f.ifctl;
}var a;
if(b&&f.groupid>=0){var d=b.parent.getFOIGroup(f.groupid);
a=d.getFOIById(f.orgid?f.orgid:f.id);
}else{if(f.parentNode&&b){a=b.getIndFOI(f.orgid?f.orgid:f.id);
}}if(a&&a.origFOI){a=a.origFOI;
}return{ifctl:b,foi:a};
};
MVUtil.transOrdinatesOnWarpAroungMap=function(k,a){var d=k.msi.coverMaxX-k.msi.coverMinX;
var l=d/2;
var m=k.msi.coverMinX+l;
var h=new Array();
if(a.length<4){return a;
}var f=a[0];
var b;
h.push(f);
h.push(a[1]);
for(var g=2;
g<a.length;
g++){b=a[g];
if(Math.abs(b-f)>l){if((b-f)<0){b+=d;
}else{b-=d;
}}f=b;
h.push(b);
h.push(a[++g]);
}return h;
};
MVUtil.transLongitudeOnWarpAroungMap=function(g,d,a){var f=g.msi.coverMaxX-g.msi.coverMinX;
var h=f/2;
var b=g.msi.coverMinX+h;
while(Math.abs(a-d)>h){if((a-d)<0){a+=f;
}else{a-=f;
}}return a;
};
MVUtil.crossDateLine=function(h,l){var g=h.msi.coverMaxX-h.msi.coverMinX;
var k=g/2;
var d=h.msi.coverMinX+k;
if(l.length<4){return false;
}var b=l[0];
var a;
for(var f=2;
f<l.length;
f+=2){a=l[f];
if(Math.abs(a-b)>k){return true;
}else{if(b>h.msi.coverMinX&&b<h.msi.coverMaxX&&(a>h.msi.coverMaxX||a<h.msi.coverMinX)){return true;
}}b=a;
}return false;
};
MVUtil.duplicateCrossDateLineOrds=function(k,a,h){var d=k.msi.coverMaxX-k.msi.coverMinX;
var l=d/2;
var m=k.msi.coverMinX+l;
var g=new Array();
var b=false;
if(h[0]<k.msi.coverMaxX&&h[2]>k.msi.coverMaxX){b=true;
}for(var f=0;
f<a.length;
f++){x=a[f];
if(b){g.push(parseFloat(x)-d);
}else{g.push(parseFloat(x)+d);
}g.push(a[++f]);
}return g;
};
MVUtil.cloneObject=function(a){var b={};
for(property in a){b[property]=a[property];
}return b;
};
MVUtil.calAreaCodeFromCenter=function(o,m){var a=null;
if(o.wraparound){var d=o.msi.coverMaxX-o.msi.coverMinX;
var f=o.indFOIsControl.centerArea;
var l=o.indFOIsControl.maparea[f].n;
var g=MVUtil.keepInCSBoundary(o,o.getCenterLon())+d*l;
var k=o.msi.coverMinX+d*l;
var n=o.msi.coverMaxX+d*l;
var b=m-g;
var h=0;
while(Math.abs(b)>d/2){if(b<0){m=m+d;
h--;
}else{m=m-d;
h++;
}b=m-g;
}if(m<k){a=f-1+h;
}else{if(m>n){a=f+1+h;
}else{a=f+h;
}}}return a;
};
MVUtil.isNumber=function(a){if(a!=null&&typeof a=="number"){return true;
}else{return false;
}};
MVUtil.isNumberArray=function(a){if(!a){return true;
}if(typeof a=="object"){if(a.length==0||MVUtil.isNumber(a[0])){return true;
}}return false;
};
MVUtil.getImageSize=function(b,d){var a=new Image();
a.src=b;
if(a.width>0&&a.height>0){d(a.width,a.height);
}else{a.onload=function(){var f=this.width;
var g=this.height;
a.onload=null;
a=null;
d(f,g);
};
}};
MVUtil.canBeCombined=function(g,d){if(g.doNotCombine||d.doNotCombine){return false;
}if(g.getType()!="MVMapTileLayer"||d.getType()!="MVMapTileLayer"||!g.layerControl||!d.layerControl||!(g.layerControl instanceof MVMapTilesControl)||!(d.layerControl instanceof MVMapTilesControl)){return false;
}if(g.mcsURL!=d.mcsURL){return false;
}var f=g.config;
var b=d.config;
if(f.clientTileAccess||b.clientTileAccess){return false;
}if(f.dataSource!=f.dataSource){return false;
}if(f.format!="PNG"||b.format!="PNG"){return false;
}if(g.opacity!=d.opacity){return false;
}if(f.coordSys.srid!=b.coordSys.srid||f.coordSys.minX!=b.coordSys.minX||f.coordSys.minY!=b.coordSys.minY){return false;
}if(f.zoomLevels.length!=f.zoomLevels.length){return false;
}for(var a=0;
a<f.zoomLevels.length;
a++){if(f.zoomLevels[a].tileWidth!=b.zoomLevels[a].tileWidth||f.zoomLevels[a].tileHeight!=b.zoomLevels[a].tileHeight||f.zoomLevels[a].tileImageWidth!=b.zoomLevels[a].tileImageWidth||f.zoomLevels[a].tileImageHeight!=b.zoomLevels[a].tileImageHeight){return false;
}}return true;
};
MVUtil.getImageURL=function(a){if(a.indexOf("/")==0||a.indexOf("http://")==0||a.indexOf("https://")==0||a.indexOf("../")==0||a.indexOf("./")==0){return a;
}else{return MVGlobalVariables.imgFilePath+a;
}};
MVUtil.isLocalDomain=function(a){a=MVUtil.strTrim(a);
if(a.toLowerCase().indexOf("http://")==0||a.toLowerCase().indexOf("https://")==0){var b=MVGlobalVariables.getLocalBaseURL();
return(MVUtil.getDomain(b)==MVUtil.getDomain(a));
}else{return true;
}};
MVUtil.getRealOrdinates=function(f,b,a){var d=f.msi.coverMaxX-f.msi.coverMinX;
var g=0;
while(b<f.msi.coverMinX){g++;
b+=d;
}while(b>f.msi.coverMaxX){g--;
b-=d;
}return a-g*d;
};
MVUtil.checkRealSize=function(d,f){var a=f.style.visibility;
f.style.visibility="hidden";
d.info_div.appendChild(f);
var b=MVUtil.getRealSize(f);
d.info_div.removeChild(f);
f.style.visibility=a;
return b;
};
MVUtil.getRealSize=function(f){var a=f.offsetWidth;
var d=f.offsetHeight;
for(var b=0;
b<f.childNodes.length;
b++){a=Math.max(a,f.childNodes[b].offsetWidth);
d=Math.max(d,f.childNodes[b].offsetHeight);
}return{width:a,height:d};
};
MVUtil.getXMLHttpUrl=function(a){if(MVUtil.isLocalDomain(a)||!MVMapView.XMLHTTPEnabled){return a;
}else{return MVGlobalVariables.getProxyURL();
}};
MVUtil.getXMLHttpReq=function(a,b){if(MVUtil.isLocalDomain(a)||!MVMapView.XMLHTTPEnabled){return b;
}else{return"rtarget="+a+"&"+b;
}};
MVUtil.getAbsoluteURL=function(d){d=MVUtil.strTrim(d);
if(d.toLowerCase().indexOf("http://")==0||d.toLowerCase().indexOf("https://")==0){return d;
}else{if(d.charAt(0)=="/"){return document.location.protocol+"//"+document.location.host+d;
}else{var b=document.location+"";
var a=b.lastIndexOf("/");
return b.substring(0,a)+"/"+d;
}}};
MVUtil.loadScriptByUrl=function(b){var a=document.createElement("script");
a.setAttribute("type","text/javascript");
a.src=b;
document.body.appendChild(a);
};
MVUtil.isTouchEvent=function(a){if(MVGlobalVariables.touchSupported){return true;
}else{return false;
}};
MVUtil.clearInvalidMapIns=function(b){var a=MVUtil.objArray.length;
for(var d=0;
d<a;
d++){var g=MVUtil.objArray[d];
if(g&&g.real_base_div){var h=g.real_base_div;
if(h==b){g.destroy();
}else{var f=false;
while(h.parentNode){h=h.parentNode;
if(h==document.body){f=true;
break;
}}if(!f){g.destroy();
}}}}};
MVUtil.nukeNode=function(b,a){if(!b){return;
}while(b.hasChildNodes()){var d=b.firstChild;
MVUtil.nukeNode(d,a);
MVUtil.clearListeners(d,a);
MVUtil.removeAllAttributes(d);
MVUtil.discardNode(d);
}MVUtil.clearListeners(b,a);
};
MVUtil.nukeNode2=function(f){var b=[];
MVUtil.getChildNodes(f,b);
var a;
for(var d=0;
d<b.length;
d++){a=b[d];
MVUtil.removeAllAttributes(a);
MVUtil.clearListeners(a,null);
MVUtil.discardNode(a);
}};
MVUtil.getChildNodes=function(d,a){if(!d){return;
}if(!d.hasChildNodes()){return;
}var f=d.childNodes;
var g;
for(var b=0;
b<f.length;
b++){g=d.childNodes[b];
MVUtil.getChildNodes(g,a);
a.push(g);
}};
MVUtil.removeAllAttributes=function(b){if(!(b&&b.attributes)){return;
}for(var a=b.attributes.length-1;
b.attributes&&b.attributes.length>0&&a>=0;
a--){b.removeAttributeNode(b.attributes[a]);
}};
MVUtil.pointInPolygonTest=function(m,l,k,f,d,g){if(m<g.minX||m>g.maxX||l<g.minY||l>g.maxy){return false;
}var b,a,h=0;
for(b=0,a=k-1;
b<k;
a=b++){if(((d[b]>l)!=(d[a]>l))&&(m<(f[a]-f[b])*(l-d[b])/(d[a]-d[b])+f[b])){h=!h;
}}return h;
};
function MVGeomUtil(){}MVGeomUtil.earthRadius=6372795;
MVGeomUtil.getPointAtBearing=function(a,m,b){var a=MVGeomUtil.getRadiansFromLatLon(a);
var g=a.x;
var l=a.y;
var k=m/MVGeomUtil.earthRadius;
var h=Math.asin(Math.sin(l)*Math.cos(k)+Math.cos(l)*Math.sin(k)*Math.cos(b));
var f=g+Math.atan2(Math.sin(b)*Math.sin(k)*Math.cos(l),Math.cos(k)-Math.sin(l)*Math.sin(h));
return MVGeomUtil.getLatLonFromRadians(new MVSdoPointType(f,h,0));
};
MVGeomUtil.getRadiansFromLatLon=function(a){var d=a.x;
var b=a.y;
while(d<-180){d+=360;
}while(d>180){d-=360;
}d=d*Math.PI/180;
b=b*Math.PI/180;
return new MVSdoPointType(d,b,0);
};
MVGeomUtil.getLatLonFromRadians=function(a){var d=a.x;
var b=a.y;
b=b*180/Math.PI;
d=d*180/Math.PI;
return new MVSdoPointType(d,b,0);
};
MVGeomUtil.getGreatCircleDistance=function(h,f){h=MVGeomUtil.getRadiansFromLatLon(h);
f=MVGeomUtil.getRadiansFromLatLon(f);
var m=f.x-h.x;
var k=f.y-h.y;
var d=Math.sin(k/2);
var g=Math.sin(m/2);
var b=d*d+Math.cos(h.y)*Math.cos(f.y)*g*g;
var l=2*Math.atan2(Math.sqrt(b),Math.sqrt(1-b));
return l*MVGeomUtil.earthRadius;
};
MVGeomUtil.getGreatCircleLength=function(b){var a=0;
for(i=0;
i<b.length-2;
i+=2){a+=MVGeomUtil.getGreatCircleDistance(new MVSdoPointType(b[i],b[i+1]),new MVSdoPointType(b[i+2],b[i+3]));
}return a;
};
MVGeomUtil.getSphericalArea=function(a){var t=q.length/2;
var l,g,m;
var u;
var r,n,f;
var d;
var z;
var v=0;
var b;
var w=0;
for(n=0,r=t-1,f=1,dP=q+2;
n<t;
++n,++r,++f,dP+=3){r%=t;
f%=t;
var o=MVGeoUtil.get3DVector(q[2*n],q[2*n+1]);
var s=MVGeoUtil.get3DVector(q[2*r],q[2*r+1]);
var h=MVGeoUtil.get3DVector(q[2*f],q[2*f+1]);
w+=o.z;
l=MVGeoUtil.mdsphcp(o,o);
u=MVGeoUtil.MAGNITUDE(l);
g=MVGeoUtil.mdsphcp(o,h);
u*=MVGeoUtil.MAGNITUDE(g);
b=MVGeoUtil.DOTPRODUCT(l,g)/u;
if(b>1){b=1;
}if(b<-1){b=-1;
}d=Math.acos(b);
m=MVGeoUtil.mdsphcp(l,g);
if(Math.abs(m.x)<1e-9*u&&Math.abs(m.y)<1e-9*u&&Math.abs(m.z)<1e-9*u){if(b>0){v-=Math.PI;
}}else{if(MVGeoUtil.DOTPRODUCT(m,o)<0){v+=d-Math.PI;
}else{v+=Math.PI-d;
}}}w/=t*1;
if(v<0){v+=2*Math.PI;
}else{v-=2*Math.PI;
}};
MVGeomUtil.mdsphcp=function(f,d){var g={x:0,y:0,z:0};
if((f.x==d.x)&&(f.y==d.y)&&(f.z==d.z)){g.x=g.y=g.z=0;
}else{g.x=f.y*d.z-f.z*d.y;
g.y=f.z*d.x-f.x*d.z;
g.z=f.x*d.y-f.y*d.x;
}return g;
};
MVGeomUtil.get3DVector=function(a,f){var d={x:a,y:f};
var b=MVGeomUtil.getRadiansFromLatLon(d);
b.z=Math.sin(b.y);
return b;
};
MVGeomUtil.MAGNITUDE=function(b){return Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z);
};
MVGeomUtil.DOTPRODUCT=function(f,d){return f.x*d.x+f.y*d.y+f.z*d.z;
};
function MVMapProvider(a){this.mapSourceName=a;
this.mapConfig=MVGlobal_CacheConfig[a];
this.coverMinX=this.getMinX();
this.coverMinY=this.getMinY();
this.coverMaxX=this.getMaxX();
this.coverMaxY=this.getMaxY();
this.baseMeshWidth=this.getMaxX()-this.getMinX();
this.baseMeshHeight=this.getMaxY()-this.getMinY();
this.zoomCount=MVGlobal_CacheConfig[this.mapSourceName].zoomLevels.length;
}MVMapProvider.prototype.getMapSourceName=function(){return this.mapSourceName;
};
MVMapProvider.prototype.getTileFormat=function(a){return MVGlobal_CacheConfig[a].format;
};
MVMapProvider.prototype.getBaseMeshWidth=function(){return this.baseMeshWidth;
};
MVMapProvider.prototype.getBaseMeshHeight=function(){return this.baseMeshHeight;
};
MVMapProvider.prototype.getMinX=function(){return MVGlobal_CacheConfig[this.mapSourceName].coordSys.minX;
};
MVMapProvider.prototype.getMinY=function(){return MVGlobal_CacheConfig[this.mapSourceName].coordSys.minY;
};
MVMapProvider.prototype.getMaxX=function(){return MVGlobal_CacheConfig[this.mapSourceName].coordSys.maxX;
};
MVMapProvider.prototype.getMaxY=function(){return MVGlobal_CacheConfig[this.mapSourceName].coordSys.maxY;
};
MVMapProvider.prototype.getMapSource=function(){return MVGlobal_CacheConfig[this.mapSourceName].mapCache;
};
MVMapProvider.prototype.getSrid=function(){return MVGlobal_CacheConfig[this.mapSourceName].coordSys.srid;
};
MVMapProvider.prototype.getCSType=function(){return MVGlobal_CacheConfig[this.mapSourceName].coordSys.type;
};
MVMapProvider.prototype.getCSdistConvFactor=function(){return MVGlobal_CacheConfig[this.mapSourceName].coordSys.distConvFactor;
};
MVMapProvider.prototype.getMaxZoomLevel=function(){return MVGlobal_CacheConfig[this.mapSourceName].zoomLevels.length;
};
MVMapProvider.prototype.getTileWidth=function(a){return MVGlobal_CacheConfig[this.mapSourceName].zoomLevels[a].tileWidth;
};
MVMapProvider.prototype.getTileHeight=function(a){return MVGlobal_CacheConfig[this.mapSourceName].zoomLevels[a].tileHeight;
};
MVMapProvider.prototype.getTileImageWidth=function(a){return MVGlobal_CacheConfig[this.mapSourceName].zoomLevels[a].tileImageWidth;
};
MVMapProvider.prototype.getTileImageHeight=function(a){return MVGlobal_CacheConfig[this.mapSourceName].zoomLevels[a].tileImageHeight;
};
MVMapProvider.prototype.getZoomName=function(a){return MVGlobal_CacheConfig[this.mapSourceName].zoomLevels[a].zoomName;
};
MVMapProvider.prototype.setCoverArea=function(f,d,b,a){this.coverMinX=f;
this.coverMinY=d;
this.coverMaxX=b;
this.coverMaxY=a;
};
MVMapProvider.prototype.getAllScales=function(){var l=MVGlobal_CacheConfig[this.mapSourceName].zoomLevels;
var m="";
for(var b=0;
b<l.length;
b++){var f=l[b].tileWidth;
var g=l[b].tileImageWidth;
var k=g/f;
var d=l[b].tileHeight;
var a=l[b].tileImageHeight;
var h=a/d;
if(k==h){m+=k+";";
}else{m+=k+":"+h+";";
}}return m.length>0?m.substring(0,m.length-1):m;
};
function MVEvent(){}MVEvent.START="start";
MVEvent.FINISH="finish";
MVEvent.DRAG="drag";
MVEvent.NEW_SHAPE_POINT="new_shape_point";
MVEvent.MODIFY="modify";
MVEvent.MOUSE_CLICK="mouse_click";
MVEvent.MOUSE_RIGHT_CLICK="mouse_right_click";
MVEvent.MOUSE_OVER="mouse_over";
MVEvent.MOUSE_OUT="mouse_out";
MVEvent.COLLAPSE="collapse";
MVEvent.AFTER_COLLAPSE="after_collapse";
MVEvent.RESTORE="restore";
MVEvent.AFTER_RESTORE="after_restore";
MVEvent.DRAG_START="drag_start";
MVEvent.DRAG_END="drag_end";
MVEvent.RECENTER="recenter";
MVEvent.ZOOM_LEVEL_CHANGE="zoom_level_change";
MVEvent.BEFORE_ZOOM_LEVEL_CHANGE="before_zoom_level_change";
MVEvent.MOUSE_DOUBLE_CLICK="mouse_double_click";
MVEvent.INITIALIZE="initialize";
MVEvent.MOUSE_MOVE="mouse_move";
MVEvent.MOUSE_DOWN="mouse_down";
MVEvent.MOUSE_UP="mouse_up";
MVEvent.CLEAR="clear";
MVEvent.BEFORE_REFRESH="before_refresh";
MVEvent.AFTER_REFRESH="after_refresh";
MVEvent.BUTTON_DOWN="button_down";
MVEvent.BUTTON_UP="button_up";
MVEvent.INIT="init";
MVEvent.MARQUEEZOOM_FINISH="marqueezoom_finish";
function MVMesh(d,b,a,f){this.mw=d.zoomLevels[f].tileWidth;
this.mh=d.zoomLevels[f].tileHeight;
this.mX=Math.floor((b-d.coordSys.minX)/this.mw);
this.mY=Math.floor((a-d.coordSys.minY)/this.mh);
this.zoom=f;
this.minX=this.mX*this.mw+d.coordSys.minX;
this.minY=this.mY*this.mh+d.coordSys.minY;
}MVMesh.prototype.moveMeshCode=function(b,a){this.mX=this.mX+b;
this.mY=this.mY+a;
};
function MVMapTileLayer(a,b){this.mapSource=a;
this.mcsURL="";
this.mcscfgURL="";
if(b&&b!=""){this.mcsURL=b;
this.mcscfgURL=b;
if(MVUtil.strEndWith(b,"/")){this.mcsURL=b.substring(0,b.length-1);
this.mcscfgURL=b.substring(0,b.length-1);
}}this.parent="";
this.isTransparent=false;
this.visible=true;
this.tileImageFormat="PNG";
this.minVisibleLevel=null;
this.maxVisibleLevel=null;
this.reloadNumber=null;
this.layerControl=null;
this.parentLayer=null;
this.childrenLayers=null;
this.doNotCombine=true;
this.opacity=1;
this.mapType=0;
this.streetView=false;
this.streetViewPosition=null;
}MVMapTileLayer.prototype.getType=function(){return"MVMapTileLayer";
};
MVMapTileLayer.prototype.setCombinable=function(a){if(a){this.doNotCombine=false;
}else{this.doNotCombine=true;
}};
MVMapTileLayer.prototype.setTransparent=function(a){this.isTransparent=a;
};
MVMapTileLayer.prototype.setVisible=function(g){if(this.parent){if(this.layerControl){this.visible=g;
this.layerControl.setVisible(g);
}else{if(this.isExtAPITileLayer()){this.visible=g;
if(this.layerDiv){if(g){if(this instanceof MVBingTileLayerV6||this instanceof MVBingTileLayerV7){this.extPar.appendChild(this.layerDiv);
}else{this.layerDiv.style.visibility="visible";
}var a=this.parent.getCenter();
this.parent.setExternalAPITileLayerCenter(this,a.getPointX(),a.getPointY(),this.parent.zoomLevel);
}else{this.extPar=this.layerDiv.parentNode;
if(this instanceof MVBingTileLayerV6||this instanceof MVBingTileLayerV7){this.extPar.removeChild(this.layerDiv);
}else{this.layerDiv.style.visibility="hidden";
}}}}else{if(this.parentLayer){var d=this.parentLayer.isVisible();
this.visible=g;
var b=this.parentLayer.isVisible();
if(d!=b){this.parentLayer.setVisible(b);
}var f=this.parentLayer.getTransparent();
if(this.parentLayer.layerControl){this.parentLayer.layerControl.isTransparent=f;
}if(b){this.parentLayer.refresh(true);
}}}}this.parent.showEmbeddedCopyright();
}else{this.visible=g;
}};
MVMapTileLayer.prototype.isVisible=function(){if(!this.childrenLayers){return this.visible;
}else{for(var a=0;
a<this.childrenLayers.length;
a++){if(this.childrenLayers[a].visible){return true;
}}return false;
}};
MVMapTileLayer.prototype.setVisibleZoomLevelRange=function(b,a){this.minVisibleLevel=b;
this.maxVisibleLevel=a;
if(this.layerControl){this.layerControl.minVisibleLevel=this.minVisibleLevel;
this.layerControl.maxVisibleLevel=this.maxVisibleLevel;
}};
MVMapTileLayer.prototype.refresh=function(a){if(!a){this.reloadNumber=Math.round(Math.random()*10000000000);
}if(this.parent){if(this.layerControl&&!this.parentLayer){if(this.layerControl.zoomControl){this.layerControl.zoomControl.removeCloneTiles();
}this.layerControl.initTiles(this.parent.getPaneWidth(),this.parent.getPaneHeight(),this.parent.mapCenterX,this.parent.mapCenterY);
}}};
MVMapTileLayer.prototype.getName=function(){return this.getMapSource();
};
MVMapTileLayer.prototype.getMapSource=function(){if(this.childrenLayers){var a=null;
for(var b=0;
b<this.childrenLayers.length;
b++){if(this.childrenLayers[b].visible&&(this.childrenLayers[b].minVisibleLevel==null||this.childrenLayers[b].minVisibleLevel<=this.parent.zoomLevel)&&(this.childrenLayers[b].maxVisibleLevel==null||this.childrenLayers[b].maxVisibleLevel>=this.parent.zoomLevel)){if(a){a+=";"+this.childrenLayers[b].mapSource;
}else{a=this.childrenLayers[b].mapSource;
}}}return a;
}else{return this.mapSource;
}};
MVMapTileLayer.prototype.clone=function(){var a=new MVMapTileLayer(this.mapSource,this.mcsURL);
a.isTransparent=this.isTransparent;
a.tileImageFormat=this.tileImageFormat;
a.minVisibleLevel=this.minVisibleLevel;
a.maxVisibleLevel=this.maxVisibleLevel;
a.doNotCombine=this.doNotCombine;
a.zIndex=this.zIndex;
if(this.config){a.config=this.config;
}return a;
};
MVMapTileLayer.prototype.destroy=function(){if(this.layerControl){this.layerControl.destroy();
this.layerControl=null;
}else{if(this.layerDiv){MVUtil.destroyNode(this.layerDiv,this.parent.errorHandler);
this.layerDiv=null;
if(this.cleanUp){this.cleanUp();
}}}if(this.msi){this.msi=null;
}};
MVMapTileLayer.prototype.scrollTiles=function(){if(this.layerControl){this.layerControl.scrollTiles();
}};
MVMapTileLayer.prototype.isExtAPITileLayer=function(){return this.getType()=="MVExternalAPIMapTileLayer";
};
MVMapTileLayer.prototype.getTransparent=function(){if(this.childrenLayers){for(var a=0;
a<this.childrenLayers.length;
a++){if(!this.childrenLayers[a].isTransparent&&this.childrenLayers[a].isVisble){this.isTransparent=false;
return false;
}}this.isTransparent=true;
}return this.isTransparent;
};
MVMapTileLayer.prototype.setOpacity=function(b){if(isNaN(b)){return;
}if(b>1||b<0){return;
}if(this.opacity==b){return;
}this.opacity=b;
if(this.layerControl){this.layerControl.reload();
return;
}if(this.parentLayer&&this.parentLayer.childrenLayers.length>1){var a=this.parentLayer.layerControl.parent;
a.removeMapTileLayer(this);
a.addMapTileLayer(this);
}else{if(this.parentLayer&&this.parentLayer.layerControl){this.parentLayer.opacity=this.opacity;
this.parentLayer.layerControl.reload();
}}};
MVMapTileLayer.prototype.setMapType=function(a){this.mapType=a;
if(this.layerControl&&this.layerControl.setMapType){this.layerControl.setMapType(a);
}};
MVMapTileLayer.prototype.getMapType=function(){if(this.layerControl&&this.layerControl.getMapType){return this.layerControl.getMapType();
}else{return this.mapType;
}};
MVMapTileLayer.prototype.enableStreetView=function(a){this.streetView=a;
};
MVMapTileLayer.prototype.setStreetViewPosition=function(b,a){this.streetViewPosition={x:b,y:a};
};
MVBaseMap=MVMapTileLayer;
function MVCustomMapTileLayer(d,b){var a=d.dataSource?d.dataSource+"."+d.mapTileLayer:d.mapTileLayer;
MVMapView.addMapTileLayerDefinition(d);
this.layerDefinition=d;
this.baseClass=MVMapTileLayer;
this.baseClass(a);
this.tileURLProvider=b;
}MVCustomMapTileLayer.prototype=new MVMapTileLayer;
MVCustomMapTileLayer.prototype.getType=function(){return"MVCustomMapTileLayer";
};
MVCustomMapTileLayer.prototype.clone=function(){return new MVCustomMapTileLayer(this.layerDefinition,this.tileURLProvider);
};
function MVMapTilesControl(f,d){this.basemap=d;
this.mapConfig=d.config;
this.visible=true;
this.bufferX;
this.bufferY;
this.mcsURL="";
this.parent=f;
if(this.mapConfig.clientTileAccess){var a=this.mapConfig.clientTileAccess;
this.mcsURL=a.tileServerURL;
if(a.tile_layer_name){this.mapSource=a.tile_layer_name;
}else{this.mapSource=a.tileLayerName;
}}else{if(d.mcsURL){this.mcsURL=d.mcsURL;
this.mapSource=d.mapSource;
}else{MVi18n.reportError("MVMapTilesControl.constructor","MAPVIEWER-05504",null,f.errorHandler);
return;
}}var b=this.mcsURL;
if(b&&MVUtil.strEndWith(b,"/")){this.mcsURL=b.substr(0,b.length-1);
}if(d.getType()=="MVMapTileLayer"){this.tileImageFormat=this.mapConfig.format;
}else{if(d.getType()=="MVThemeTileLayer"){this.tileImageFormat=d.config.format;
}}this.isTransparent=d.isTransparent;
this.origCenterX;
this.origCenterY;
this.origLeft;
this.origTop;
this.tileNumX;
this.tileNumY;
this.tileWidth;
this.tileHeight;
this.justInitialized=true;
this.tileArray=[];
this.tileMinX=0;
this.tileMinY=0;
this.winWidth;
this.winHeight;
this.centerX;
this.centerY;
this.centerMesh=null;
this.zIndex=d.zIndex;
this.transImgURL=f.transImage.src;
this.visible=d.isVisible();
this.minVisibleLevel=d.minVisibleLevel;
this.maxVisibleLevel=d.maxVisibleLevel;
this.zoomControl=new MVZoomControl(f,this);
this.tileNumInCSBoun=null;
this.coverPixel=null;
}MVMapTilesControl.prototype.getMcsURL=function(){return this.mcsURL;
};
MVMapTilesControl.prototype.getMapSource=function(){return this.mapSource;
};
MVMapTilesControl.prototype.getDiv=function(){return this.mapLayer;
};
MVMapTilesControl.prototype.setVisible=function(a){this.visible=a;
if(!this.visible){if(this.mapLayer){this.mapLayer.style.visibility="hidden";
}}else{if(this.mapLayer){this.mapLayer.style.visibility="visible";
}if(this.parent.displayed){this.initTiles(this.parent.getPaneWidth(),this.parent.getPaneHeight(),this.parent.mapCenterX,this.parent.mapCenterY);
}}};
MVMapTilesControl.prototype.isVisible=function(){return this.visible;
};
MVMapTilesControl.prototype.meshimgpath=function(b,g){if(this.parent.wraparound){if(g<0||g>=(this.mapConfig.coordSys.maxY-this.mapConfig.coordSys.minY)/this.centerMesh.mh){return this.transImgURL;
}else{if(b<0){while(true){b=parseInt(Math.ceil((this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX)/this.centerMesh.mw))+b;
if(b>=0){break;
}}}else{if(b>=(this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX)/this.centerMesh.mw){while(true){b=b-parseInt(Math.ceil((this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX)/this.centerMesh.mw));
if(b<(this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX)/this.centerMesh.mw){break;
}}}}}}else{if(b<0||b>=(this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX)/this.centerMesh.mw||g<0||g>=(this.mapConfig.coordSys.maxY-this.mapConfig.coordSys.minY)/this.centerMesh.mh){return this.transImgURL;
}}var f=this.centerMesh.zoom;
if(this.basemap.tileURLProvider){var a=this.basemap.tileURLProvider(this.mapConfig.coordSys.minX+b*this.centerMesh.mw,this.mapConfig.coordSys.minY+g*this.centerMesh.mh,this.centerMesh.mw,this.centerMesh.mh,f);
if(!a){return this.transImgURL;
}else{return a;
}}else{var d=null;
if(this.mapConfig.clientTileAccess){d=this.mapSource;
}else{d=this.basemap.getMapSource();
}return String(this.mcsURL+"?request=gettile&format="+this.tileImageFormat+"&zoomlevel="+f+"&mapcache="+d+"&mx="+b+"&my="+g);
}};
MVMapTilesControl.prototype.initTiles=function(s,B,k,g){if(this.checkVisibility()){return;
}if(this.parent.zoomLevel>=this.mapConfig.zoomLevels.length){return;
}this.tileWidth=this.mapConfig.zoomLevels[this.parent.zoomLevel].tileImageWidth;
this.tileHeight=this.mapConfig.zoomLevels[this.parent.zoomLevel].tileImageHeight;
this.origCenterX=k;
this.origCenterY=g;
this.bufferX=Math.ceil(this.tileWidth/2);
this.bufferY=Math.ceil(this.tileHeight/2);
this.winWidth=s;
this.winHeight=B;
this.centerX=k;
this.centerY=g;
this.tileNumX=Math.ceil((s+this.bufferX*2)/this.tileWidth);
this.centerMesh=null;
this.centerMesh=new MVMesh(this.mapConfig,k,g,this.parent.zoomLevel);
this.tileNumInCSBoun=Math.ceil((this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX)/this.centerMesh.mw);
this.parent.pixPerX=this.tileWidth/this.centerMesh.mw;
this.parent.pixPerY=this.tileHeight/this.centerMesh.mh;
this.coverPixel=(this.centerMesh.mw*this.tileNumInCSBoun-(this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX))*this.parent.pixPerX;
if(this.parent.wraparound){var d=(this.tileNumX/this.tileNumInCSBoun)*this.coverPixel;
var t=(this.tileWidth/2);
this.tileNumX=this.tileNumX+Math.ceil(d/t)+1;
}this.tileNumY=Math.ceil((B+this.bufferY*2)/this.tileHeight);
this.tileMinX=0;
this.tileMinY=0;
this.origParLeft=this.parent.divLeft;
this.origParTop=this.parent.divTop;
this.initTileArray();
var a=Math.floor(this.tileNumX/2);
var v=Math.floor(this.tileNumY/2);
var r=this.winWidth/2-(k-this.centerMesh.minX)*this.parent.pixPerX;
var o=this.winHeight/2+(g-this.centerMesh.minY)*this.parent.pixPerY-this.tileHeight;
while(true){var l=r-a*this.tileWidth;
if(l>0){a++;
continue;
}var b=o-v*this.tileHeight;
if(b>0){v++;
continue;
}var f=r+(this.tileNumX-a)*this.tileWidth-this.winWidth;
if(f<0){a--;
continue;
}var n=o+(this.tileNumY-v)*this.tileHeight-this.winHeight;
if(n<0){v--;
continue;
}var u=f+l,m=n+b;
if(u>this.tileWidth){a++;
continue;
}else{if(u<(-1)*this.tileWidth){a--;
continue;
}}if(m>this.tileHeight){v++;
continue;
}if(m<(-1)*this.tileHeight){v--;
continue;
}break;
}this.origLeft=r-a*this.tileWidth-this.parent.divLeft;
this.origTop=o-v*this.tileHeight-this.parent.divTop;
MVUtil.setLeftTop(this.mapLayer,this.origLeft,this.origTop);
this.createImageNode(a,v,this.tileWidth,this.tileHeight,a*this.tileWidth,v*this.tileHeight);
this.centerMesh.moveMeshCode(-1,1);
var A=Math.max(a,this.tileNumX-a);
var z=Math.max(v,this.tileNumY-v);
for(radius=1;
radius<=Math.max(A,z);
radius++){for(xx=a-radius,yy=v-radius;
xx<=a+radius;
xx++){if(!(xx<0||xx>=this.tileNumX||yy<0||yy>=this.tileNumY)){this.createImageNode(xx,yy,this.tileWidth,this.tileHeight,xx*this.tileWidth,yy*this.tileHeight);
}this.centerMesh.moveMeshCode(1,0);
}this.centerMesh.moveMeshCode(-(radius*2+1),-1);
for(xx=a-radius,yy=v-radius+1;
yy<=v+radius-1;
yy++){if(!(xx<0||xx>=this.tileNumX||yy<0||yy>=this.tileNumY)){this.createImageNode(xx,yy,this.tileWidth,this.tileHeight,xx*this.tileWidth,yy*this.tileHeight);
}this.centerMesh.moveMeshCode(0,-1);
}for(xx=a-radius,yy=v+radius;
xx<=a+radius;
xx++){if(!(xx<0||xx>=this.tileNumX||yy<0||yy>=this.tileNumY)){this.createImageNode(xx,yy,this.tileWidth,this.tileHeight,xx*this.tileWidth,yy*this.tileHeight);
}this.centerMesh.moveMeshCode(1,0);
}this.centerMesh.moveMeshCode(-1,1);
for(xx=a+radius,yy=v+radius-1;
yy>=v-radius+1;
yy--){if(!(xx<0||xx>=this.tileNumX||yy<0||yy>=this.tileNumY)){this.createImageNode(xx,yy,this.tileWidth,this.tileHeight,xx*this.tileWidth,yy*this.tileHeight);
}this.centerMesh.moveMeshCode(0,1);
}this.centerMesh.moveMeshCode(-(radius*2+1),1);
}this.centerMesh.moveMeshCode(radius,-(radius));
this.centerMesh.moveMeshCode(-a+Math.floor(this.tileNumX/2),v-Math.floor(this.tileNumY/2));
this.zoomControl.tileInitialized();
};
MVMapTilesControl.prototype.scrollTiles=function(){if(this.checkVisibility()){return;
}var C=this.parent.divLeft+this.tileMinX+this.origLeft;
var B=this.parent.divTop+this.tileMinY+this.origTop;
var D=0,l=0;
while(true){var f=C-D*this.tileWidth;
if(f>0){D++;
continue;
}var b=B-l*this.tileHeight;
if(b>0){l++;
continue;
}var d=C+(this.tileNumX-D)*this.tileWidth-this.winWidth;
if(d<0){D--;
continue;
}var m=B+(this.tileNumY-l)*this.tileHeight-this.winHeight;
if(m<0){l--;
continue;
}var s=d+f,g=m+b;
if(s>this.tileWidth){D++;
continue;
}else{if(s<(-1)*this.tileWidth){D--;
continue;
}}if(g>this.tileHeight){l++;
continue;
}if(g<(-1)*this.tileHeight){l--;
continue;
}break;
}if(D==0&&l==0){return;
}var a=Math.floor(this.tileNumX/2);
var u=Math.floor(this.tileNumY/2);
var o=this.centerMesh.mX-a;
var n=this.centerMesh.mY+u;
var z;
if(D!=0){for(z=0;
(D>0?z<D:z>D);
(D>0?z++:z--)){var k;
var h;
var t;
if(D>0){h=this.tileMinX-(z+1)*this.tileWidth;
}else{h=this.tileMinX+(this.tileNumX-z)*this.tileWidth;
}if(D>0){this.leftNum--;
}else{this.leftNum++;
}if(D>0){k=this.tileArray[this.tileArray.length-1];
this.tileArray.pop();
for(var A=0;
A<k.length;
A++){this.setImageSrc(k[A],null);
if(l==0||(l>0&&A<k.length-l)||(l<0&&A>=-l)){this.setImageSrc(k[A],this.meshimgpath(o-z-1,n-A));
}if(this.parent.wraparound){k[A].style.zIndex=o-z-1;
t=this.tileArray[0][A].style.zIndex;
if(t%this.tileNumInCSBoun==0){k[A].style.left=MVUtil.pixel(parseInt(this.tileArray[0][A].style.left)-this.tileWidth+this.coverPixel);
}else{k[A].style.left=MVUtil.pixel(parseInt(this.tileArray[0][A].style.left)-this.tileWidth);
}}else{k[A].style.left=MVUtil.pixel(h);
}}this.tileArray.unshift(k);
}else{k=this.tileArray[0];
this.tileArray.shift();
for(var A=0;
A<k.length;
A++){this.setImageSrc(k[A],null);
if(l==0||(l>0&&A<k.length-l)||(l<0&&A>=-l)){this.setImageSrc(k[A],this.meshimgpath(o+this.tileNumX-z,n-A));
}if(this.parent.wraparound){k[A].style.zIndex=o+this.tileNumX-z;
t=this.tileArray[this.tileArray.length-1][A].style.zIndex;
if(t%this.tileNumInCSBoun==(this.tileNumInCSBoun-1)||t%this.tileNumInCSBoun==-1){k[A].style.left=MVUtil.pixel(parseInt(this.tileArray[this.tileArray.length-1][A].style.left)+this.tileWidth-this.coverPixel);
}else{k[A].style.left=MVUtil.pixel(parseInt(this.tileArray[this.tileArray.length-1][A].style.left)+this.tileWidth);
}}else{k[A].style.left=MVUtil.pixel(h);
}}this.tileArray.push(k);
}}}if(l!=0){var w;
for(w=0;
(l>0?w<l:w>l);
(l>0?w++:w--)){var r;
if(l>0){r=this.tileMinY-(w+1)*this.tileHeight;
this.topNum++;
}else{r=this.tileMinY+(this.tileNumY-w)*this.tileHeight;
this.topNum--;
}for(z=0;
z<this.tileArray.length;
z++){var k=this.tileArray[z];
var v;
if(l>0){v=k[k.length-1];
this.setImageSrc(v,null);
k.pop();
k.unshift(v);
v.style.top=MVUtil.pixel(r);
this.setImageSrc(v,this.meshimgpath(o-D+z,n+w+1));
}else{v=k[0];
this.setImageSrc(v,null);
k.shift();
k.push(v);
v.style.top=MVUtil.pixel(r);
this.setImageSrc(v,this.meshimgpath(o-D+z,n-this.tileNumY+w));
}}}}if(this.parent.wraparound){this.tileMinX=parseInt(this.tileArray[0][0].style.left);
}else{this.tileMinX=this.tileMinX-D*this.tileWidth;
}this.tileMinY=this.tileMinY-l*this.tileHeight;
this.centerMesh.moveMeshCode(-D,l);
};
MVMapTilesControl.prototype.createImageNode=function(k,f,l,d,a,g){if(k==0&&f==0){this.leftNum=this.centerMesh.mX;
this.topNum=this.centerMesh.mY;
}var n=this.meshimgpath(this.centerMesh.mX,this.centerMesh.mY);
var m=this.tileArray[k][f];
if(m==null){m=(MVGlobalVariables.shouldUseDivFilter()&&this.isTransparent)?document.createElement("div"):document.createElement("img");
this.mapLayer.appendChild(m);
this.tileArray[k][f]=m;
}MVGlobalVariables.c=0;
if(MVGlobalVariables.browser=="IF"&&!this.isTransparent){m.galleryImg="no";
}else{m.style.MozUserSelect="none";
if(MVGlobalVariables.touchSupported&&MVGlobalVariables.isIOS){m.style.webkitTransform="translate3d(0,0,0)";
}}MVUtil.disableElementSelection(m);
m.style.position="absolute";
if(this.parent.wraparound){m.style.zIndex=this.centerMesh.mX;
if(this.centerMesh.mX<0){m.style.left=MVUtil.pixel(a-this.coverPixel*Math.floor(m.style.zIndex/this.tileNumInCSBoun));
}else{if(this.centerMesh.mX>=(this.mapConfig.coordSys.maxX-this.mapConfig.coordSys.minX)/this.centerMesh.mw){m.style.left=MVUtil.pixel(a-this.coverPixel*Math.floor(m.style.zIndex/this.tileNumInCSBoun));
}else{m.style.left=MVUtil.pixel(a);
}}}else{m.style.left=MVUtil.pixel(a);
}m.style.top=MVUtil.pixel(g);
if(MVGlobalVariables.browser=="IF"){m.style.width=MVUtil.pixel(l);
m.style.height=MVUtil.pixel(d);
}if((this.zoomControl)&&(this.zoomControl.zooming)){m.style.display="none";
}var b=this;
m.imgLoadFinished=false;
m.onload=function(){m.imgLoadFinished=true;
m.onload=null;
m.style.display="";
};
this.setImageSrc(m,n);
return m;
};
MVMapTilesControl.prototype.initTileArray=function(){if(this.mapLayer&&!(this.mapLayer.zooming)){MVUtil.destroyNode(this.mapLayer);
}this.mapLayer=document.createElement("div");
this.mapLayer.style.position="absolute";
this.parent.div.appendChild(this.mapLayer);
this.mapLayer.style.zIndex=this.zIndex;
this.tileArray=new Array();
for(var b=0;
b<this.tileNumX;
b++){var f=new Array();
for(var a=0;
a<this.tileNumY;
a++){var d;
if(MVGlobalVariables.shouldUseDivFilter()){d=MVUtil.createImageNode(null,this.isTransparent);
}else{d=MVUtil.createImageNode(this.transImgURL,this.isTransparent);
}this.mapLayer.appendChild(d);
f.push(d);
if(MVGlobalVariables.touchSupported){MVUtil.setListener(d,"click",function(g){g.preventDefault();
return false;
},true);
MVUtil.setListener(d,"focus",function(g){g.preventDefault();
return false;
},true);
}}this.tileArray.push(f);
}};
MVMapTilesControl.prototype.destroy=function(){while(this.tileArray.length>0){var b=this.tileArray.pop();
while(b.length>0){if(MVGlobalVariables.shouldUseDivFilter()&&this.isTransparent){MVUtil.deleteNode(b.pop());
}else{var a=b.pop();
if(a!=null){if(a.parentNode!=null){MVUtil.discardNode(a);
}try{MVUtil.discardNode(a);
}catch(d){}delete a;
}}}}this.tileArray=null;
if(this.mapLayer){this.mapLayer.mapsource=null;
this.mapLayer.ttbfc=null;
if(this.mapLayer.parentNode){MVUtil.discardNode(this.mapLayer);
}this.mapLayer=null;
}this.zIndex=null;
};
MVMapTilesControl.prototype.getXMLForPrint=function(h){var f=null;
if(this.basemap.mcsURL!=""){f=this.basemap.mcsURL.substring(0,this.basemap.mcsURL.lastIndexOf("/"));
if(f!=this.parent.baseURL){f+="/";
}else{f=null;
}}var a=function(l,m){var k='<theme name="cached_basemap'+m+'">';
k+='<map_cache_theme map_cache_name="'+l+'" snap_to_cache_scale="true" ';
if(f){k+='mapviewer_url="'+f+'"';
}return k+"/></theme>";
};
if(this.basemap.childrenLayers){var d="";
for(var b=0;
b<this.basemap.childrenLayers.length;
b++){var g=this.basemap.childrenLayers[b];
if(g.visible&&(g.minVisibleLevel==null||g.minVisibleLevel<=this.parent.zoomLevel)&&(g.maxVisibleLevel==null||g.maxVisibleLevel>=this.parent.zoomLevel)){d+=a(g.mapSource,h+"_"+b);
}}return d;
}else{return a(this.basemap.mapSource,h);
}};
MVMapTilesControl.prototype.setImageSrc=function(b,d){if(d){b.imgSrc=d;
b.style.opacity=this.basemap.opacity;
if(this.basemap.opacity<1&&this.basemap.opacity>0){b.style.filter="alpha(opacity="+this.basemap.opacity*100+")";
}else{b.style.filter="";
}if(this.basemap.reloadNumber){d=d+"&reload="+this.basemap.reloadNumber;
}}if(MVGlobalVariables.shouldUseDivFilter()&&this.isTransparent){if(d){var a;
if(b.childNodes.length>0){a=b.childNodes[0];
}else{a=document.createElement("div");
}a.style.width=b.style.width;
a.style.height=b.style.height;
a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d+"', sizingMethod='image')";
b.appendChild(a);
}else{b.style.filter="";
}}else{if(d){b.src=d;
}else{b.src=this.transImgURL;
}}};
MVMapTilesControl.prototype.reload=function(){for(var b=0;
b<this.tileNumX;
b++){for(var a=0;
a<this.tileNumY;
a++){var d=this.tileArray[b][a];
this.setImageSrc(d,d.imgSrc);
}}};
MVMapTilesControl.prototype.checkVisibility=function(a){if(!this.basemap.childrenLayers){if(!this.visible){return true;
}if(this.minVisibleLevel!=null&&this.minVisibleLevel>this.parent.zoomLevel){if(this.mapLayer){this.mapLayer.style.visibility="hidden";
}return true;
}if(this.maxVisibleLevel!=null&&this.maxVisibleLevel<this.parent.zoomLevel){if(this.mapLayer){this.mapLayer.style.visibility="hidden";
}return true;
}}else{for(var b=0;
b<this.basemap.childrenLayers.length;
b++){if(this.basemap.childrenLayers[b].visible&&(this.basemap.childrenLayers[b].minVisibleLevel==null||this.basemap.childrenLayers[b].minVisibleLevel<=this.parent.zoomLevel)&&(this.basemap.childrenLayers[b].maxVisibleLevel==null||this.basemap.childrenLayers[b].maxVisibleLevel>=this.parent.zoomLevel)){return false;
}}if(this.mapLayer){this.mapLayer.style.visibility="hidden";
}return true;
}};
MVMapTilesControl.zIndexCount=1;
MVMapTilesControl.prototype.getLeftTopPoint=function(){return{x:this.leftNum*this.centerMesh.mw+this.mapConfig.coordSys.minX,y:(this.topNum+1)*this.centerMesh.mh+this.mapConfig.coordSys.minY};
};
MVMapTilesControl.prototype.getBoundingBox=function(){return{minX:this.leftNum*this.centerMesh.mw+this.mapConfig.coordSys.minX,minY:(this.topNum+1-this.tileNumY)*this.centerMesh.mh+this.mapConfig.coordSys.minY,maxX:(this.leftNum+this.tileNumX)*this.centerMesh.mw+this.mapConfig.coordSys.minX,maxY:(this.topNum+1)*this.centerMesh.mh+this.mapConfig.coordSys.minY};
};
function MVArrayParameter(d,a,b){this.array=d;
this.elementType=a;
if(b==undefined||!b){if(a==MVArrayParameter.STRING_ARRAY){b="MV_STRINGLIST";
}else{b="MV_NUMBERLIST";
}}this.sqlType=b;
}function ArrayParameter(d,a,b){this.array=d;
this.elementType=a;
this.sqlType=b;
}MVArrayParameter.STRING_ARRAY="sarray";
MVArrayParameter.NUMBER_ARRAY="narray";
function MVThemeBasedFOI(a,d,b){if(!d){MVi18n.reportError("MVThemeBasedFOI.constructor","MAPVIEWER-05519","theme");
return;
}this.name=a;
this.parent=null;
this.serverURL=b;
this.minZoomLevel=-1;
this.maxZoomLevel=100;
this.bringToTopOnMouseOver=false;
this.minX=0;
this.minY=0;
this.maxX=0;
this.maxY=0;
this.EventListeners=new Object();
this.onRefreshListener=null;
this.onRefreshedListener=null;
this.onClickListener=null;
this.onRightClickListener=null;
this.onMouseOverListener=null;
this.onMouseOutListener=null;
this.foiLayoutListener=null;
this.theme=null;
this.sizeXratio=2;
this.sizeYratio=2;
this.infoTip=true;
this.infoWindow=true;
this.clickable=true;
this.queryParameter=null;
this.customedMarker=null;
this.queryResult=null;
this.infoWindowStyle=null;
this.nsdpObj=null;
this.maxWholeImageLevel=-1;
this.minClickableLevel=-1;
this.isBoundingTheme=false;
this.recenterOnly=false;
this.styles=new Array();
this.renderStyle=null;
this.autoRefreshing=true;
this.visible=true;
this.enablePropagation=true;
this.cursorStyle="pointer";
this.highlightOnly=false;
this.filteringGeom=null;
this.renderFOIImages=true;
this.renderLabels=false;
this.infoWindowMO=false;
this.imageCaching=true;
this.nameAsInfoWindowTitle=true;
this.infoWindowTitle=null;
this.infoWindowStyleParameters=null;
this.isJDBCTheme=false;
this.isCustomTheme=false;
if(d!=null){this.theme=d;
if(typeof d=="string"&&d.indexOf("</jdbc_query>")>=0){this.isJDBCTheme=true;
}else{if(typeof d=="object"){this.isCustomTheme=true;
}}}this.layerMBR=null;
this.themeLayerControl=null;
this.xOffset=0;
this.yOffset=0;
this.enableHighlightMode=false;
this.mouseClickHighlight=true;
this.highlightMode=0;
this.highlightFoiList=new Array();
this.highlightStyle=null;
this.highlightMarkerImage=null;
this.queryParameterArray=null;
this.imageFormat=null;
this.bgColor=null;
this.autoWholeImage=false;
this.wholeImageThreshold=-1;
this.clickableThreshold=-1;
this.sequence=false;
this.sequenceType="N";
this.reuseIENode=false;
this.langCode=null;
this.opacity=1;
this.htmlmapIdSuffix=0;
this.bringToTopOnHighlight=true;
}MVThemeBasedFOI.prototype.setLayoutCustomizer=function(a){this.foiLayoutListener=a;
this.reuseIENode=false;
};
MVThemeBasedFOI.prototype.enableHighlight=function(b,a){if(!b){this.deHighlight();
}this.enableHighlightMode=b;
if(a!=undefined){this.mouseClickHighlight=a;
}};
MVThemeBasedFOI.prototype.setHighlightMode=function(a){switch(a){case"single":this.highlightMode=-1;
break;
case"multiple":this.highlightMode=0;
break;
default:MVi18n.reportError("MVThemeBasedFOI.setHighlightMode","MAPVIEWER-05519","mode",this.parent?this.parent.errorHandler:null);
}};
MVThemeBasedFOI.prototype.setHighlightStyle=function(b){var a=false;
if(b!=null){if(typeof(b)=="object"&&b.getXMLString!=null){this.highlightStyle=encodeURIComponent(b.getXMLString());
}else{if(typeof(b)=="string"){this.highlightStyle=encodeURIComponent(b);
}else{a=true;
}}}else{a=true;
}if(a){MVi18n.reportError("MVThemeBasedFOI.setHighlightStyle","MAPVIEWER-05519","highliteStyle",this.parent?this.parent.errorHandler:null);
}this.reuseIENode=false;
};
MVThemeBasedFOI.prototype.setHighlightMarkerImage=function(b,d,a){this.highlightMarkerImage=null;
var f=true;
if(!b||typeof(b)!="string"){f=false;
}if(f){this.highlightMarkerImage=new foiMarker(b,d,a);
}else{MVi18n.reportError("MVThemeBasedFOI.setHighlightMarkerImage","MAPVIEWER-05519",null,this.parent?this.parent.errorHandler:null);
}this.reuseIENode=false;
};
MVThemeBasedFOI.prototype.highlight=function(h){if(!this.enableHighlightMode){MVi18n.reportError("MVThemeBasedFOI.highlight","MAPVIEWER-05524",null,this.parent?this.parent.errorHandler:null);
return;
}var f=false;
if(h==null){f=true;
}else{if(typeof(h)!="object"||(g=h.length)==null||h.length<1){MVi18n.reportError("MVThemeBasedFOI.highlight","MAPVIEWER-05519","foiIdArray",this.parent?this.parent.errorHandler:null);
return;
}}var a=this.highlightFoiList;
var k=this.queryResult.foiarray;
var g=k.length;
for(var d=0;
d<g;
++d){var m=k[d];
var l=f;
if(m.mouseDown){continue;
}else{for(var b=0;
b<a.length;
b++){if(m==a[b]){m.mouseDown=true;
m=null;
break;
}}}if(m!=null&&m.id!=null){if(!l){for(var b=0;
b<h.length;
b++){if(m.id==h[b]){l=true;
break;
}}}if(m.nodeId!=null&&l){a.push(m);
m.mouseDown=true;
this.themeLayerControl.highlightFOI(this.themeLayerControl,m);
}}}};
MVThemeBasedFOI.prototype.deHighlight=function(k){if(!this.enableHighlightMode){MVi18n.reportError("MVThemeBasedFOI.deHighlight","MAPVIEWER-05524",null,this.parent?this.parent.errorHandler:null);
return;
}var a=this.highlightFoiList;
var h=a.length;
if(h<1){return;
}var d=null;
if(k!=null&&(typeof(k)!="object"||(d=k.length)==null)){MVi18n.reportError("MVThemeBasedFOI.deHighlight","MAPVIEWER-05519","foiIdArray",this.parent?this.parent.errorHandler:null);
return;
}if(k!=null&&d<1){return;
}var f=false;
if(k==null){f=true;
}for(var g=a.length;
g>=0;
g--){var m=a[g];
var l=f;
if(m!=null&&m.id!=null){if(!l){for(var b=0;
b<k.length;
b++){if(m.id==k[b]){l=true;
break;
}}}if(l){a[g]=null;
a.splice(g,1);
m.mouseDown=false;
if(m!=null&&m.node!=null&&m.imgurl!=null){this.themeLayerControl.deHighlightFOI(this.themeLayerControl,m);
}}}}};
MVThemeBasedFOI.prototype.getHighlightedFOIData=function(){var a=new Array();
if(this.highlightFoiList!=null){for(var b=0;
b<this.highlightFoiList.length;
b++){if(this.highlightFoiList[b]!=null){a.push(this.highlightFoiList[b]);
}}}return a;
};
MVThemeBasedFOI.prototype.setQueryParameters=function(){if(arguments.length<=0){return;
}this.queryParameter="&paramnum="+arguments.length;
this.queryParameterArray=new Array(arguments.length);
for(var a=0;
a<arguments.length;
a++){if(arguments[a]==null){this.queryParameter+="&param"+(a+1)+"="+null;
continue;
}if(typeof arguments[a]=="object"){this.queryParameter+=this.setObjectQueryParameters(arguments[a],a+1);
if(arguments[a].gtype!=undefined){this.queryParameterArray[a]={type:"geometry",value:arguments[a]};
}else{var b=arguments[a].elementType==MVArrayParameter.STRING_ARRAY?"String":"double";
this.queryParameterArray[a]={elemtype:b,value:arguments[a].array,type:arguments[a].sqlType};
}}else{this.queryParameter+="&param"+(a+1)+"="+encodeURIComponent(arguments[a]);
this.queryParameterArray[a]={value:arguments[a]};
}}return this.queryParameter;
};
MVThemeBasedFOI.prototype.setObjectQueryParameters=function(d,b){if(!d){return"";
}if(d.gtype!=undefined){d=d.densify();
return"&param"+b+"="+encodeURI(d)+"&paramtype"+b+"=geometry";
}else{var f="";
if(d.array){if(d.array.substring!=undefined){f=d.array;
}else{this.escapeQuote(d.array);
for(var a=0;
a<d.array.length;
a++){if(a>0){f+=",";
}f+='"'+d.array[a]+'"';
}}}return"&param"+b+"="+encodeURIComponent(f)+"&paramtype"+b+"="+d.elementType+"&sqltype"+b+"="+d.sqlType;
}};
MVThemeBasedFOI.prototype.getQueryParameters=function(){return this.queryParameter;
};
MVThemeBasedFOI.prototype.setMinVisibleZoomLevel=function(a){this.minZoomLevel=a;
};
MVThemeBasedFOI.prototype.setMaxVisibleZoomLevel=function(a){this.maxZoomLevel=a;
};
MVThemeBasedFOI.prototype.setBringToTopOnMouseOver=function(a){this.bringToTopOnMouseOver=a;
};
MVThemeBasedFOI.prototype.setMaxWholeImageLevel=function(a){this.maxWholeImageLevel=a;
this.autoWholeImage=false;
};
MVThemeBasedFOI.prototype.setMinClickableZoomLevel=function(a){this.minClickableLevel=a;
};
MVThemeBasedFOI.prototype.enableInfoTip=function(a){this.infoTip=a;
};
MVThemeBasedFOI.prototype.enableInfoWindow=function(a){this.infoWindow=a;
};
MVThemeBasedFOI.prototype.enableInfoWindowForMouseOver=function(a){this.infoWindowMO=a;
};
MVThemeBasedFOI.prototype.setClickable=function(a){this.clickable=a;
if(this.themeLayerControl){this.themeLayerControl.setMouseCursor();
if(this.themeLayerControl.transImageLayer){if(a&&this.isVisible()){this.themeLayerControl.transImageLayer.style.visibility="visible";
}else{if(!a){this.themeLayerControl.transImageLayer.style.visibility="hidden";
}}}}};
MVThemeBasedFOI.prototype.addEventListener=function(a,b){this.setEventListener(a,b);
};
MVThemeBasedFOI.prototype.setEventListener=function(a,b){if(a==MVEvent.BEFORE_REFRESH){this.onRefreshListener=b;
}else{if(a==MVEvent.AFTER_REFRESH){this.onRefreshedListener=b;
}else{if(a==MVEvent.MOUSE_CLICK){this.onClickListener=b;
}else{if(a==MVEvent.MOUSE_RIGHT_CLICK){this.onRightClickListener=b;
}else{if(a==MVEvent.MOUSE_OVER){this.onMouseOverListener=b;
}else{if(a==MVEvent.MOUSE_OUT){this.onMouseOutListener=b;
}}}}}}};
MVThemeBasedFOI.prototype.attachEventListener=function(a,b){MVUtil.attachEventListener(this.EventListeners,a,b);
};
MVThemeBasedFOI.prototype.detachEventListener=function(a,b){MVUtil.detachEventListener(this.EventListeners,a,b);
};
MVThemeBasedFOI.prototype.setQueryWindowMultiplier=function(a){this.sizeXratio=a;
this.sizeYratio=a;
};
MVThemeBasedFOI.prototype.getQueryWindow=function(){if(!this.parent){MVi18n.reportError("MVThemeBasedFOI.getQueryWindow","MAPVIEWER-05525",this.name,this.parent?this.parent.errorHandler:null);
return;
}var a=MVSdoGeometry.createRectangle(this.minX,this.minY,this.maxX,this.maxY,this.parent.srid);
return a;
};
MVThemeBasedFOI.prototype.getLayerMBR=MVThemeBasedFOI.prototype.getQueryWindow;
MVThemeBasedFOI.prototype.getMBR=function(){if(this.layerMBR){return MVSdoGeometry.createRectangle(this.layerMBR[0],this.layerMBR[1],this.layerMBR[2],this.layerMBR[3],this.parent.srid);
}else{return null;
}};
MVThemeBasedFOI.prototype.setMarkerImage=function(b,d,a){if(b){this.customedMarker=new foiMarker(b,d,a);
}else{this.customedMarker=null;
}this.reuseIENode=false;
};
MVThemeBasedFOI.prototype.getThemeName=function(){return this.theme;
};
function foiMarker(f,g,a){this.imgURL=f;
var d=this;
if((!g||isNaN(g))||(!a||isNaN(a))){var b=function(k,l){if(!g||isNaN(g)){g=k;
}if(!a||isNaN(a)){a=l;
}d.width=g;
d.height=a;
d=null;
};
MVUtil.getImageSize(f,b);
}else{this.width=g;
this.height=a;
}}MVThemeBasedFOI.prototype.getFOIMarker=function(){return this.customedMarker;
};
MVThemeBasedFOI.prototype.setVisible=function(a){this.visible=a;
if(this.parent&&this.parent.infoLayer){this.parent.infoLayer.hideTopNode();
}if(this.themeLayerControl){this.themeLayerControl.setVisible(this.parent,a);
}};
MVThemeBasedFOI.prototype.setInfoWindowStyle=function(a,b){this.infoWindowStyle=a;
this.infoWindowStyleParameters=b;
};
MVThemeBasedFOI.prototype.isVisible=function(){if(this.themeLayerControl){return this.themeLayerControl.isVisible();
}else{return this.visible;
}};
MVThemeBasedFOI.prototype.refresh=function(b){if(!this.parent){MVi18n.reportError("MVThemeBasedFOI.refresh","MAPVIEWER-05525",this.name,this.parent?this.parent.errorHandler:null);
return;
}if(!this.parent.displayed){this.parent.delayOperation(this,"refresh",true);
return;
}this.parent.do_GetMinMaxLonLat();
if(this.themeLayerControl){var a=this.themeLayerControl;
var d=this.parent.getThemeBBoxAndSetThemeWindowSize(a);
if(b){b=true;
}else{b=false;
}a.refreshFOIs(this.parent,d[0],d[1],d[2],d[3],true,b,!b);
}};
MVThemeBasedFOI.prototype.getFOIData=function(){if(this.queryResult==null||this.queryResult.foiarray==null){return null;
}else{return this.queryResult.foiarray;
}};
MVThemeBasedFOI.prototype.setNSDP=function(a){this.nsdpObj=a;
};
MVThemeBasedFOI.prototype.setBoundingTheme=function(a,b,d){this.isBoundingTheme=a;
if(b){this.recenterOnly=true;
}else{this.recenterOnly=false;
this.respectVisibleZoomLevels=d;
}};
MVThemeBasedFOI.prototype.zoomToTheme=function(a){this.respectVisibleZoomLevels=a;
if(!this.parent){MVi18n.reportError("MVThemeBasedFOI.zoomToTheme","MAPVIEWER-05525",this.name,this.parent?this.parent.errorHandler:null);
return;
}this.refresh(true);
};
MVThemeBasedFOI.prototype.centerToTheme=function(){if(!this.parent){MVi18n.reportError("MVThemeBasedFOI.centerToTheme","MAPVIEWER-05525",this.name,this.parent?this.parent.errorHandler:null);
return;
}this.parent.do_GetMinMaxLonLat();
if(this.themeLayerControl){var a=this.themeLayerControl;
var b=this.parent.getThemeBBoxAndSetThemeWindowSize(a);
a.refreshFOIs(this.parent,b[0],b[1],b[2],b[3],true,true,false,false,true);
}};
MVThemeBasedFOI.prototype.addStyle=function(b){var a=this.styles.concat(b);
this.styles=null;
this.styles=a;
};
MVThemeBasedFOI.prototype.deleteStyle=function(h){var a=-1;
for(var f=0;
f<this.styles.length;
f++){var d=this.styles[f];
if(d!=null&&d==h){a=f;
break;
}}if(a<0){return;
}var b=0;
var g=new Array(this.styles.length-1);
for(var f=0;
f<this.styles.length;
f++){if(f!=a){g[b]=this.styles[f];
b++;
}}this.styles=null;
this.styles=g;
};
MVThemeBasedFOI.prototype.deleteAllStyles=function(){for(var a=0;
a<this.styles.length;
a++){this.styles[a]=null;
}this.styles=new Array();
};
MVThemeBasedFOI.prototype.setRenderingStyle=function(a){this.renderStyle=a;
this.reuseIENode=false;
};
MVThemeBasedFOI.prototype.setAutoRefresh=function(a){this.autoRefreshing=a;
};
MVThemeBasedFOI.prototype.enableEventPropagation=function(a){this.enablePropagation=a;
};
MVThemeBasedFOI.prototype.setMouseCursorStyle=function(a){this.cursorStyle=a;
if(this.themeLayerControl){MVUtil.setCursor(this.themeLayerControl.div,a);
if(this.queryResult&&this.queryResult.foiarray&&this.themeLayerControl.hasAreaNodes){for(var f=0;
f<this.queryResult.foiarray.length;
f++){if(this.queryResult.foiarray[f]&&this.queryResult.foiarray[f].areaNode){var b=this.queryResult.foiarray[f].areaNode;
if(b instanceof Array){for(var d=0;
d<b.length;
d++){MVUtil.setCursor(this.queryResult.foiarray[f].areaNode[d],a);
}}else{MVUtil.setCursor(this.queryResult.foiarray[f].areaNode,a);
}}}}}};
MVThemeBasedFOI.prototype.setHighlightOnly=function(a){this.highlightOnly=a;
};
MVThemeBasedFOI.prototype.setFilteringGeom=function(a){this.filteringGeom=a;
};
MVThemeBasedFOI.prototype.getFilteringGeom=function(){return this.filteringGeom;
};
MVThemeBasedFOI.prototype.enableImageRendering=function(a){this.renderFOIImages=a;
};
MVThemeBasedFOI.prototype.enableLabels=function(a){this.renderLabels=a;
};
MVThemeBasedFOI.prototype.enableImageCaching=function(a){this.imageCaching=a;
};
MVThemeBasedFOI.prototype.getLayerName=function(){return this.name;
};
MVThemeBasedFOI.prototype.getName=function(){return this.getLayerName();
};
MVThemeBasedFOI.prototype.setInfoWindowTitle=function(a){this.infoWindowTitle=a;
};
MVThemeBasedFOI.prototype.setScreenOffset=function(a,b){if(a==undefined||isNaN(a)){a=0;
}if(b==undefined||isNaN(b)){b=0;
}this.xOffset=parseInt(a);
this.yOffset=parseInt(b);
};
MVThemeBasedFOI.prototype.setNameAsInfoWindowTitle=function(a){this.nameAsInfoWindowTitle=a;
};
MVThemeBasedFOI.prototype.setImageFormat=function(b,a){if(b){this.imageFormat=b.toUpperCase();
if(this.imageFormat=="PNG8"&&a){this.bgColor=a;
}}this.reuseIENode=false;
};
MVThemeBasedFOI.prototype.enableAutoWholeImage=function(a,d,b){if(d!=undefined){this.wholeImageThreshold=d;
}if(b!=undefined){this.clickableThreshold=b;
}this.autoWholeImage=a;
};
MVThemeBasedFOI.prototype.abort=function(){if(this.themeLayerControl){this.themeLayerControl.abort();
}};
MVThemeBasedFOI.prototype.enableMarkerSequence=function(a,b){this.sequence=a;
if(a){if(b){this.sequenceType=b;
}}};
MVThemeBasedFOI.prototype.escapeQuote=function(b){if(b&&b.length>0&&b.indexOf==undefined){for(var a=0;
a<b.length;
a++){if(b[a]&&b[a].length!=undefined){b[a]=MVUtil.strReplaceAll(b[a],'"','\\"');
}}}};
MVThemeBasedFOI.prototype.getAllStyles=function(){return this.styles;
};
MVThemeBasedFOI.prototype.getStyleByName=function(b){if(b==null||b==""){return;
}for(var d=0;
d<this.styles.length;
d++){var a=this.styles[d];
if(a!=null&&a.name==b){return a;
break;
}}};
MVThemeBasedFOI.prototype.isWholeImage=function(){if(this.themeLayerControl){return this.themeLayerControl.isWholeImage();
}else{return false;
}};
MVThemeBasedFOI.prototype.setLabelLanguageCode=function(a){this.langCode=a;
};
MVThemeBasedFOI.prototype.zoomToFeatures=function(k){if(!k||!k.length||!this.parent){return;
}var f=null,d=null,b=null,a=null;
for(var g=0;
g<k.length;
g++){var r=k[g].rw?k[g].rw:k[g].width;
var l=k[g].rh?k[g].rh:k[g].height;
var s=k[g].x;
var o=k[g].y-l/this.parent.getPixelsPerYUnit();
var n=k[g].x+r/this.parent.getPixelsPerXUnit();
var m=k[g].y;
if(f==null){f=s;
}else{if(f>s){f=s;
}}if(d==null){d=o;
}else{if(d>o){d=o;
}}if(b==null){b=n;
}else{if(b<n){b=n;
}}if(a==null){a=m;
}else{if(a<m){a=m;
}}}if(f!=null&&d!=null&&b!=null&&a!=null){this.parent.zoomToRectangle(MVSdoGeometry.createRectangle(f,d,b,a));
}};
MVThemeBasedFOI.prototype.reDraw=function(f){if(this.themeLayerControl&&this.queryResult){var b=this;
var a=function(k){if(k.hidden){b.themeLayerControl.clearFOINode(k);
}else{if(b.themeLayerControl.parent.wraparound){b.themeLayerControl.clearFOINode(k);
b.themeLayerControl.displayFoi(k);
}else{var h=new Object();
h.shown=true;
h.node=k.node;
h.labelNode=k.labelNode;
h.areaNode=k.areaNode;
b.themeLayerControl.displayFoi(k,h);
if(h.shown==false){b.themeLayerControl.clearFOINode(h);
}}}};
if(f){a(f);
}else{if(this.queryResult&&this.queryResult.foiarray){var g=this.queryResult.foiarray;
for(var d=0;
d<g.length;
d++){a(g[d]);
}}}}};
MVThemeBasedFOI.prototype.enableMultiFeatureMarker=function(b,a){this.showOverLappingMarker=b;
if(a){if(typeof(a)=="string"||a instanceof MVXMLStyle||a instanceof MVStyleMarker){a={style:a};
}if(a.style){this.overLappingStyle=a.style;
if(this.themeLayerControl&&this.themeLayerControl.overLappingMarker){this.themeLayerControl.overLappingMarker=null;
}}if(a.listWidth){this.listWidth=a.listWidth;
}if(a.listHeight){this.listHeight=a.listHeight;
}}};
MVThemeBasedFOI.prototype.setOpacity=function(b){var a=this.opacity;
if(isNaN(b)){return;
}if(b>1||b<0){return;
}else{this.opacity=b;
}if(this.themeLayerControl&&this.themeLayerControl.div){this.themeLayerControl.div.style.opacity=b;
if(b==1){this.themeLayerControl.div.style.filter="";
}else{this.themeLayerControl.div.style.filter="alpha(opacity="+this.opacity*100+")";
}if(MVGlobalVariables.browser=="IF"){if(a==1&&this.opacity!=1){this.themeLayerControl.div.style.width=MVUtil.pixel(this.themeLayerControl.realWidth);
this.themeLayerControl.div.style.height=MVUtil.pixel(this.themeLayerControl.realHeight);
}else{if(a!=1&&this.opacity==1){this.themeLayerControl.div.style.width="";
this.themeLayerControl.div.style.height="";
}}}}};
MVThemeBasedFOI.prototype.setBringToTopOnHighlight=function(a){this.bringToTopOnHighlight=a;
};
MVThemeBasedFOI.prototype.getFOIById=function(f){if(!this.queryResult||!this.queryResult.foiarray){return;
}var b=this.queryResult.foiarray;
var a=b.length;
for(var d=0;
d<a;
++d){if(b[d].id==f){return b[d];
}}return null;
};
MVThemeBasedFOI.prototype.highlight2=function(f){if(!this.themeLayerControl||!this.themeLayerControl.parent.autoHighlight||typeof $==undefined){return;
}if(f==null){var b=this.queryResult.foiarray;
var a=b.length;
for(var g=0;
g<a;
++g){var h=b[g];
$(h.areaNode).mouseover();
}return;
}else{if(typeof(f)!="object"||(a=f.length)==null||f.length<1){MVi18n.reportError("MVThemeBasedFOI.highlight","MAPVIEWER-05519","foiIdArray",this.parent?this.parent.errorHandler:null);
return;
}}for(var d=0;
d<f.length;
d++){var h=this.getFOIById(f[d]);
if(h){$(h.areaNode).mouseover();
}}};
MVThemeBasedFOI.prototype.deHighlight2=function(f){if(!this.themeLayerControl||!this.themeLayerControl.parent.autoHighlight||typeof $==undefined){return;
}if(f==null){var b=this.queryResult.foiarray;
var a=b.length;
for(var g=0;
g<a;
++g){var h=b[g];
$(h.areaNode).mouseout();
}return;
}else{if(typeof(f)!="object"||(a=f.length)==null||f.length<1){MVi18n.reportError("MVThemeBasedFOI.highlight","MAPVIEWER-05519","foiIdArray",this.parent?this.parent.errorHandler:null);
return;
}}for(var d=0;
d<f.length;
d++){var h=this.getFOIById(f[d]);
if(h){$(h.areaNode).mouseout();
}}};
MVThemeBasedFOI.prototype.setHighlightStyle2=function(a){if(!a){return;
}if(a.fillColor&&MVUtil.strBeginWith(a.fillColor,"#")){a.fillColor=a.fillColor.substring(1);
}if(a.strokeColor&&MVUtil.strBeginWith(a.strokeColor,"#")){a.strokeColor=a.strokeColor.substring(1);
}this.highlight2Style=a;
};
function MVThemeBasedFOIControl(a,b){this.parent=a;
this.boundingThemeLoaded=false;
if(!b.serverURL){if(this.parent.baseURL){if(MVUtil.strEndWith(this.parent.baseURL,"/")){b.serverURL=this.parent.baseURL+"foi";
}else{b.serverURL=this.parent.baseURL+"/foi";
}}else{MVi18n.reportError("MVThemeBasedFOIControl.constructor","MAPVIEWER-05504",null,a.errorHandler);
return;
}}b.themeLayerControl=this;
this.themebasedfoi=b;
this.realWidth=0;
this.realHeight=0;
this.width=0;
this.height=0;
this.minX=0;
this.minY=0;
this.maxX=0;
this.maxY=0;
this.adjustedMinX=0;
this.adjustedMinY=0;
this.adjustedMaxX=0;
this.adjustedMaxY=0;
this.clearFirst=true;
this.isLoaded=true;
this.foiDisplayed=false;
this.lleft=0;
this.ltop=0;
this.lDragOffsetX=0;
this.lDragOffsetY=0;
this.centerX=0;
this.centerY=0;
this.loading=false;
this.FOIType=1;
this.div=document.createElement("div");
this.div.style.position="absolute";
this.div.style.left=MVUtil.pixel(0);
this.div.style.top=MVUtil.pixel(0);
this.div.style.opacity=this.themebasedfoi.opacity;
if(this.themebasedfoi.opacity==1){this.div.style.filter="";
}else{this.div.style.filter="alpha(opacity="+this.themebasedfoi.opacity*100+")";
}this.origIndex=0;
if(!b.visible){this.div.style.visibility="hidden";
}this.parent.div.appendChild(this.div);
this.transImageLayer=null;
this.transImageLayerMap=null;
this.renderedAsWholeImage=false;
this.themeId=null;
this.abortionSupported=true;
this.getThemeId();
this.showWarnings=true;
this.aborted=false;
this.t1=0;
this.t2=0;
this.t3=0;
this.mouseL1=MVSdoGeometry.createPoint(0,0);
this.mouseL2=this.mouseL1;
this.labelStyle=null;
this.currentIndex=0;
}MVThemeBasedFOIControl.prototype.beforePrint=function(m){if(this.themebasedfoi.isJDBCTheme){return this.getJDBCTheme(this.themebasedfoi.theme);
}else{var f='<theme name="'+this.themebasedfoi.name+'" template_theme="'+MVUtil.strAfterDot(this.themebasedfoi.theme)+'" render_labels="'+this.themebasedfoi.renderLabels+'" datasource="'+MVUtil.strBeforeDot(this.themebasedfoi.theme)+'"'+this.getRenderStyleParameterStr(m)+this.getSequenceParameterStr()+">\n";
if(this.themebasedfoi.queryParameter==null){f+="</theme>";
}else{f+="  <binding_parameters>\n";
for(var g=0;
g<this.themebasedfoi.queryParameterArray.length;
g++){var b=this.themebasedfoi.queryParameterArray[g];
f+="<parameter ";
if(b.type==undefined){f+='value="'+b.value+'">';
}else{f+='type="'+b.type+'" ';
if(b.type=="geometry"){f+=">"+b.value.toGML();
}else{f+='elemtype="'+b.elemtype+'" ';
if(!b.value){f+=">";
}else{if(b.value.substring!=undefined){var a=b.value;
if(b.elemtype=="String"){var l=b.value.split(",");
finalvalue="";
for(var d=0;
d<l.length;
d++){if(d>0){finalvalue+=",";
}var k=l[d].indexOf('"');
var h=l[d].lastIndexOf('"');
finalvalue+=l[d].substring(k+1,h);
}a=finalvalue;
}f+='value="'+MVUtil.strReplaceAll(a,'"',"&quot;")+'">';
}else{f+=">";
for(var d=0;
d<b.value.length;
d++){f+="<elem>"+b.value[d]+"</elem>";
}}}}}f+="</parameter>";
}f+="  </binding_parameters>\n";
f+="</theme>";
}return f;
}};
MVThemeBasedFOIControl.prototype.setSize=function(a,b){this.width=a;
this.height=b;
};
MVThemeBasedFOIControl.prototype.setRealSize=function(a,b){if(this.themebasedfoi.sizeXratio==1&&this.themebasedfoi.sizeYratio==1){this.realWidth=this.width;
this.realHeight=this.height;
}else{this.realWidth=a;
this.realHeight=b;
}};
MVThemeBasedFOIControl.prototype.isLoading=function(){return this.loading;
};
MVThemeBasedFOIControl.prototype.getRequest=function(){return this.request;
};
MVThemeBasedFOIControl.prototype.getMinX=function(){return this.minX;
};
MVThemeBasedFOIControl.prototype.getMinY=function(){return this.minY;
};
MVThemeBasedFOIControl.prototype.getMaxX=function(){return this.maxX;
};
MVThemeBasedFOIControl.prototype.getMaxY=function(){return this.maxY;
};
MVThemeBasedFOIControl.prototype.isVisible=function(){var a=this.parent.zoomLevel;
if(a<this.themebasedfoi.minZoomLevel||a>this.themebasedfoi.maxZoomLevel){return false;
}else{return !(this.div.style.visibility=="hidden");
}};
MVThemeBasedFOIControl.prototype.getContainer=function(){return this.div;
};
MVThemeBasedFOIControl.prototype.getThemeBasedFOI=function(){return this.themebasedfoi;
};
MVThemeBasedFOIControl.prototype.getlDragOffsetX=function(){return this.lDragOffsetX;
};
MVThemeBasedFOIControl.prototype.getlDragOffsetY=function(){return this.lDragOffsetY;
};
MVThemeBasedFOIControl.prototype.setlDragOffsetX=function(a){this.lDragOffsetX=a;
};
MVThemeBasedFOIControl.prototype.setlDragOffsetY=function(a){this.lDragOffsetY=a;
};
MVThemeBasedFOIControl.prototype.getImageFormat=function(){return this.themebasedfoi.imageFormat?this.themebasedfoi.imageFormat:this.parent.foiImageFormat;
};
MVThemeBasedFOIControl.prototype.shouldUseDivFilter=function(){return MVGlobalVariables.browser=="IF"&&this.getImageFormat()=="PNG24"&&MVGlobalVariables.browserMajorVersion<9;
};
MVThemeBasedFOIControl.prototype.isWholeImage=function(){return this.themebasedfoi.maxWholeImageLevel>=this.parent.zoomLevel||this.renderedAsWholeImage;
};
MVThemeBasedFOIControl.prototype.setVisible=function(g,h){if(h){if(!this.isVisible()){if(this.foiDisplayed){if((!this.shouldUseDivFilter()&&this.themebasedfoi.getFOIData()!=null&&this.themebasedfoi.getFOIData()[0].gtype%10!=1)||this.isWholeImage()||!this.themebasedfoi.renderFOIImages){if(this.themebasedfoi.clickable&&this.transImageLayer){this.transImageLayer.style.visibility="visible";
}}}this.div.style.visibility="visible";
if(!this.isLoaded){MVUtil.setLeftTop(this.div,Math.ceil((this.minX-this.parent.mapWindowMinLon)*this.parent.pixPerX),-Math.ceil((this.maxY-this.parent.mapWindowMaxLat)*this.parent.pixPerY));
this.refreshFOIs(this.parent,this.minX,this.minY,this.maxX,this.maxY,true);
}}}else{if(this.foiDisplayed){if((!this.shouldUseDivFilter()&&this.themebasedfoi.getFOIData()!=null&&this.themebasedfoi.getFOIData()[0].gtype%10!=1)||this.isWholeImage()||!this.themebasedfoi.renderFOIImages){if(this.transImageLayer){this.transImageLayer.style.visibility="hidden";
}if(this.parent.infoLayer.infoWindows.length>0){for(var f=0;
f<this.parent.transparentLayer.childNodes.length;
f++){if(this.parent.infoLayer.infoWindows[0].nid==this.parent.transparentLayer.childNodes[f].id){this.parent.infoLayer.deleteInfoWindow(this.parent.infoLayer.infoWindows[0]);
break;
}}}}else{if(this.parent.infoLayer.infoWindows.length>0){for(var d=0;
d<this.div.childNodes.length;
d++){if(this.parent.infoLayer.infoWindows[0].nid==this.div.childNodes[d].id){this.parent.infoLayer.deleteInfoWindow(this.parent.infoLayer.infoWindows[0]);
break;
}}}}}this.div.style.visibility="hidden";
this.loading=false;
this.parent.checkLayersAndSetLoadingIcon();
}};
MVThemeBasedFOIControl.prototype.getLeft=function(){if(this.loading){return this.lleft;
}else{return MVUtil.getLeft(this.div);
}};
MVThemeBasedFOIControl.prototype.getTop=function(){if(this.loading){return this.ltop;
}else{return MVUtil.getTop(this.div);
}};
MVThemeBasedFOIControl.prototype.setlLeft=function(a){if(this.loading){this.lleft=a;
}};
MVThemeBasedFOIControl.prototype.setlTop=function(a){if(this.loading){this.ltop=a;
}};
MVThemeBasedFOIControl.prototype.getLayerWidth=function(){return this.width;
};
MVThemeBasedFOIControl.prototype.getLayerHeight=function(){return this.height;
};
MVThemeBasedFOIControl.prototype.removeAll=function(){this.clearAll();
while(this.div.childNodes.length>0){var a=this.div.childNodes[0];
this.div.removeChild(a);
if(this.parent.infoLayer.infoWindows.length>0){if(this.parent.infoLayer.infoWindows[0].nid==a.id){this.parent.infoLayer.deleteInfoWindow(this.parent.infoLayer.infoWindows[0]);
}}MVUtil.deleteNode(a);
}};
MVThemeBasedFOIControl.prototype.clearAll=function(a){this.clearAllStarted=true;
var d=null;
if(this.div.parentNode){d=this.div.parentNode;
d.removeChild(this.div);
}while(this.div.childNodes.length>0){var b=this.div.childNodes[0];
this.div.removeChild(b);
while(b.childNodes.length>0){var f=b.childNodes[0];
b.removeChild(f);
MVUtil.deleteNode(f);
}MVUtil.deleteNode(b);
}this.wholeImage=null;
if(this.FOIType!=1&&!a){this.clearTransImageLayer();
}if(d){d.appendChild(this.div);
}this.clearAllStarted=false;
};
MVThemeBasedFOIControl.prototype.clearTransImageLayer=function(){if(this.transImageLayer&&this.transImageLayer.parentNode){this.transImageLayer.parentNode.removeChild(this.transImageLayer);
MVUtil.deleteNode(this.transImageLayer);
}this.transImageLayer=null;
this.transImageLayerMap=null;
};
MVThemeBasedFOIControl.prototype.getImageParameters=function(){var b="";
var a=this.getImageFormat();
if(a=="PNG8"){b+="&format="+a;
}if(this.themebasedfoi.bgColor){b+="&bgcolor="+this.themebasedfoi.bgColor;
}return b;
};
MVThemeBasedFOIControl.prototype.refreshFOIs=function(h,r,n,l,g,f,a,m,d,b){this.aborted=false;
this.renderedAsWholeImage=false;
var k=this;
var o=function(){if(!k.themeId&&k.abortionSupported){setTimeout(o,50);
return;
}if(!b){b=false;
}if(!d&&!h.displayed){var s=[h,r,n,l,g,f,a,m,b];
var C=k.refreshFOIs;
var u={obj:k,func:"refreshFOIs",params:s};
h.delayedOperations.push(u);
return;
}k.loading=true;
k.themebasedfoi.minX=k.minX=r;
k.themebasedfoi.minY=k.minY=n;
k.themebasedfoi.maxX=k.maxX=l;
k.themebasedfoi.maxY=k.maxY=g;
k.lleft=Math.ceil((k.minX-k.parent.mapWindowMinLon)*k.parent.pixPerX);
k.ltop=-Math.ceil((k.maxY-k.parent.mapWindowMaxLat)*k.parent.pixPerY);
MVUtil.setLeftTop(k.div,k.lleft,k.ltop);
k.div.style.display="none";
k.centerX=k.parent.mapCenterX;
k.centerY=k.parent.mapCenterY;
if(k.themebasedfoi.onRefreshListener){k.themebasedfoi.onRefreshListener();
}if(k.themebasedfoi){MVUtil.runListeners(k.themebasedfoi.EventListeners,MVEvent.BEFORE_REFRESH);
}k.clearFirst=f;
var v=k.parent.zoomLevel;
k.getMapBBOXArray();
k.around=k.parent.wrapAroundLayer(k.getLayerWidth());
if(!k.themebasedfoi.visible||!a&&(v<k.themebasedfoi.minZoomLevel||v>k.themebasedfoi.maxZoomLevel)){if(k.request){k.abort();
k.request=null;
}k.isLoaded=false;
k.boundingThemeLoaded=false;
k.clearAll();
return;
}k.isLoaded=true;
if(k.boundingThemeLoaded){k.foiLoaded();
return;
}k.adjustBBox(a);
if(MVGlobalVariables.browser=="IF"&&k.themebasedfoi.opacity<1){k.div.style.width=MVUtil.pixel(k.realWidth);
k.div.style.height=MVUtil.pixel(k.realHeight);
}if(k.adjustedRealWidth<=0||k.adjustedRealHeight<=0){return;
}var w="request=getfoi&version=1.0"+k.getImageParameters()+"&bbox="+k.adjustedMinX+":"+k.adjustedMinY+":"+k.adjustedMaxX+":"+k.adjustedMaxY+"&width="+k.adjustedRealWidth+"&height="+k.adjustedRealHeight;
if(!k.themebasedfoi.isCustomTheme){w+="&theme="+encodeURIComponent(k.themebasedfoi.theme);
}else{for(p in k.themebasedfoi.theme){w+="&"+p+"="+encodeURIComponent(""+k.themebasedfoi.theme[p]);
}}if(k.adjustedMinX2){w+="&bbox2="+k.adjustedMinX2+":"+k.adjustedMinY+":"+k.adjustedMaxX2+":"+k.adjustedMaxY;
}if(k.themebasedfoi.highlightStyle!=null){w+="&hilitestyle="+k.themebasedfoi.highlightStyle;
}if(k.themebasedfoi.highlightOnly==true){if(!k.themebasedfoi.filteringGeom){MVi18n.reportError("MVThemeBasedFOIControl.refreshFOIs","MAPVIEWER-05514",null,k.parent.errorHandler);
return;
}k.themebasedfoi.setQueryParameters(k.themebasedfoi.filteringGeom);
w+="&hilite=yes";
}if(k.themebasedfoi.getQueryParameters()){w+=k.themebasedfoi.getQueryParameters();
}if((k.themebasedfoi.getFOIMarker()&&k.themebasedfoi.maxWholeImageLevel<v)||!k.themebasedfoi.renderFOIImages){w+="&renderimg=no";
}if(k.themebasedfoi.minClickableLevel<=v){w+="&clickable=yes";
}else{w+="&clickable=no";
}if(!k.shouldUseDivFilter()||k.themebasedfoi.maxWholeImageLevel>=v||!k.themebasedfoi.renderFOIImages){w+="&area=yes";
}else{w+="&area=no";
}w+="&dstsrid="+k.parent.srid;
if(k.themebasedfoi.nsdpObj!=null){w+="&nsdp="+encodeURIComponent(k.themebasedfoi.nsdpObj.getFlatString());
}if(k.themebasedfoi.maxWholeImageLevel>=v){w+="&wholeimage=yes";
if(k.themebasedfoi.customedMarker){var t=k.themebasedfoi.name+"_customedmarker";
if(k.themebasedfoi.getStyleByName(t)==null){var E=new MVStyleMarker(t,"image");
E.setImageUrl(k.themebasedfoi.customedMarker.imgURL);
E.setSize(k.themebasedfoi.customedMarker.width,k.themebasedfoi.customedMarker.height);
k.themebasedfoi.addStyle(E);
}k.themebasedfoi.setRenderingStyle(t);
}}if(k.themebasedfoi.renderLabels){w+="&renderlabels=yes";
}k.startLoad=MVUtil.closureWrapper(this,function(){k.foiLoaded();
});
if(a){var B=k.parent.get1stNativeTileLayer();
if(B){w+="&mapcache="+encodeURI(B.basemap.mapSource);
}else{w+="&mapcache="+encodeURI(k.parent.msi.mapConfig.mapTileLayer);
}w+="&boundingtheme=yes&mapwinwidth="+k.parent.getPaneWidth()+"&mapwinheight="+k.parent.getPaneHeight()+"&wholeimagelevel="+k.themebasedfoi.maxWholeImageLevel;
if(b){w+="&recenteronly=yes";
}}if(k.themebasedfoi.renderStyle!=null){w+="&trs="+encodeURIComponent(k.themebasedfoi.renderStyle);
}var H=k.themebasedfoi.styles;
if(H.length>0){w+="&tempstyles=";
var G="<styles>";
for(var z=0;
z<H.length;
z++){G+=H[z].getXMLString();
}G+="</styles>";
w+=encodeURIComponent(G);
}if(!k.themebasedfoi.imageCaching||m){w+="&refresh="+Math.round(Math.random()*100000);
}if(k.themebasedfoi.imageCaching&&k.themebasedfoi.maxWholeImageLevel<v){w+="&cachefoi=yes";
}if(k.abortionSupported){w+="&tid="+k.themeId;
}if(!k.themebasedfoi.autoWholeImage){w+="&aw=no";
}if(k.themebasedfoi.wholeImageThreshold>0){w+="&mw="+k.themebasedfoi.wholeImageThreshold;
}if(k.themebasedfoi.clickableThreshold>0){w+="&mu="+k.themebasedfoi.clickableThreshold;
}if(k.themebasedfoi.sequence){w+="&sq=y";
w+="&st="+k.themebasedfoi.sequenceType;
}if(k.themebasedfoi.langCode){w+="&lang="+k.themebasedfoi.langCode;
}var F=(k.themebasedfoi.serverURL.indexOf(MVGlobalVariables.getProxyURL())<0&&MVUtil.isLocalDomain(k.themebasedfoi.serverURL));
var A=F||MVMapView.XMLHTTPEnabled;
if(MVMapView.timing){k.t1=new Date();
}if(MVMapView.debug){MVi18n.alert("Sending Theme Based FOI request. URL:"+k.themebasedfoi.serverURL+" Parameters:"+w);
}try{k.parent.setLoadingIconVisible(true);
if(k.request){k.request.onreadystatechange=null;
k.request.abort();
k.request=null;
}}catch(D){}try{k.request=MVUtil.getXMLHttpRequest(A);
k.request.onreadystatechange=k.startLoad;
k.request.open("POST",MVUtil.getXMLHttpUrl(k.themebasedfoi.serverURL),true);
k.request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
k.request.send(MVUtil.getXMLHttpReq(k.themebasedfoi.serverURL,w));
}catch(D){MVi18n.reportError("MVThemeBasedFOIControl.refreshFOIs","MAPVIEWER-05511",D,k.parent.errorHandler);
k.loading=false;
k.parent.checkLayersAndSetLoadingIcon();
return;
}};
o();
};
MVThemeBasedFOIControl.prototype.clearAllParallelly=function(){this.clearAll();
};
MVThemeBasedFOIControl.prototype.getElementByIdInDiv=function(f){var b=[];
var d=document.getElementById(f);
if(!d){return d;
}while(d&&((d.parentNode!=this.div)||(d.id!=f))){b.push({i:d.id,e:d});
d.id="";
d=document.getElementById(f);
}for(j=0,jj=b.length;
j<jj;
j++){b[j].e.id=b[j].i;
}b=null;
return d;
};
MVThemeBasedFOIControl.prototype.foiLoaded=function(){if(!this.request){return;
}if(this.request.readyState==4||this.boundingThemeLoaded){if(this.request.status==200||this.boundingThemeLoaded){var zoomLevel=this.parent.zoomLevel;
if(this.aborted){this.loading=false;
this.parent.checkLayersAndSetLoadingIcon();
return;
}var oldFois=new Object();
var removeAllNodesFirst=false;
if(this.parent.wraparound&&!this.isWholeImage()){removeAllNodesFirst=true;
var data=this.themebasedfoi.getFOIData();
if(data){for(var i=0;
i<data.length;
i++){(data[i]).node=null;
(data[i]).labelNode=null;
}}}else{if(this.themebasedfoi.getFOIData()){for(var i=0;
i<this.themebasedfoi.getFOIData().length;
i++){var foi=this.themebasedfoi.getFOIData()[i];
if(oldFois["_"+foi.nodeId]){oldFois=new Object();
removeAllNodesFirst=true;
break;
}else{oldFois["_"+foi.nodeId]=foi;
oldFois["_"+foi.nodeId].shown=false;
}}}}var result=null;
if(MVMapView.timing){this.t2=new Date();
}if(!this.boundingThemeLoaded){try{eval("result="+this.request.responseText);
if(MVMapView.timing){this.t3=new Date();
MVi18n.alert("Time taken to fetch "+this.themebasedfoi.name+":"+(this.t2-this.t1)+".\nTime taken to load the FOI data:"+(this.t3-this.t2)+".");
}}catch(e){MVi18n.reportError("MVThemeBasedFOIControl.foiLoaded","MAPVIEWER-05523",this.request.responseText,this.parent.errorHandler);
this.loading=false;
this.parent.checkLayersAndSetLoadingIcon();
return;
}this.boundingThemeResult=result;
}else{result=this.boundingThemeResult;
}if(MVMapView.codingHints&&this.showWarnings&&this.themebasedfoi.renderFOIImages&&!this.themebasedfoi.autoWholeImage&&!this.isWholeImage()&&result.foiarray.length>50){var maxFOINum=0;
if(result.foiarray[0].gtype%10==1){maxFOINum=750;
}else{maxFOINum=200;
}if(result.foiarray.length>maxFOINum){var answer=confirm("You are showing too many FOIs for theme "+this.themebasedfoi.name+" at the current level.\nIt might take a long time to render these FOIs. You might want to consider rendering\nthese FOIs as a whole image by invoking methods MVThemeBasedFOI.enableAutoWholeImage\nor MVThemeBasedFOI.setMaxWholeImageLevel.\n\nDo you want to continue to render the FOIs and ignore this message from now on?\n\n   Note: You can permanently disable warnings like this by invoking method\n   MVMapView.enableCodingHints(false).");
if(!answer){this.loading=false;
this.parent.checkLayersAndSetLoadingIcon();
return;
}else{this.showWarnings=false;
}}}if(this.themebasedfoi){this.themebasedfoi.layerMBR=result.themeMBR;
}else{return;
}if(result.labelStyle){this.labelStyle=result.labelStyle;
}if(result.isWholeImg){this.renderedAsWholeImage=true;
}else{this.renderedAsWholeImage=false;
}if(result.minx!=undefined&&!this.boundingThemeLoaded){this.boundingThemeLoaded=true;
var tcx=(result.minx+result.maxx)/2;
var tcy=(result.miny+result.maxy)/2;
if(result.adjlevel!=undefined){zoomLevel=result.adjlevel;
}if(zoomLevel<0||zoomLevel>=0&&zoomLevel<this.themebasedfoi.minClickableLevel&&zoomLevel>=this.themebasedfoi.minClickableLevel){this.boundingThemeLoaded=false;
this.parent.zoomFromTheme=this.themebasedfoi;
this.parent.zoomToRectangle(MVSdoGeometry.createRectangle(result.minx,result.miny,result.maxx,result.maxy,this.parent.srid));
this.themebasedfoi.respectVisibleZoomLevels=null;
return;
}else{this.themebasedfoi.minX=this.minX=this.adjustedMinX=result.minx;
this.themebasedfoi.minY=this.minY=this.adjustedMinY=result.miny;
this.themebasedfoi.maxX=this.maxX=this.adjustedMaxX=result.maxx;
this.themebasedfoi.maxY=this.maxY=this.adjustedMaxY=result.maxy;
this.parent.reCenterTag=true;
if(this.themebasedfoi.respectVisibleZoomLevels&&zoomLevel<this.themebasedfoi.minZoomLevel){zoomLevel=this.themebasedfoi.minZoomLevel;
}else{if(this.themebasedfoi.respectVisibleZoomLevels&&zoomLevel>this.themebasedfoi.maxZoomLevel){zoomLevel=this.themebasedfoi.maxZoomLevel;
}}this.themebasedfoi.respectVisibleZoomLevels=null;
this.parent.setCenterAndZoomLevel(MVSdoGeometry.createPoint(tcx,tcy,this.parent.srid),zoomLevel);
return;
}}else{if(this.themebasedfoi.isBoundingTheme&&result.minX==undefined&&!this.boundingThemeLoaded&&this.parent.loadBoundingTheme){this.boundingThemeLoaded=true;
var zoomLevel=0;
var par=this.parent;
if(par.zoomLevel!==undefined){zoomLevel=par.zoomLevel;
}var center=par.center;
if(!center){center=par.originalCenter;
}if(!center){var coordSys=mv.msi.mapConfig.coordSys;
var x=(coordSys.minX+coordSys.maxX)/2;
var y=(coordSys.minY+coordSys.maxY)/2;
center=MVSdoGeometry.createPoint(x,y,par.srid);
}this.parent.setCenterAndZoomLevel(center,zoomLevel);
return;
}}this.initialized=true;
this.boundingThemeLoaded=false;
if(!this.div){return;
}if(MVMapView.timing){this.t1=new Date();
}if(result.foiarray.length>=1){this.themebasedfoi.queryResult=result;
this.parent.do_GetMinMaxLonLat();
if(this.isWholeImage()||!this.themebasedfoi.renderFOIImages||(!this.shouldUseDivFilter()&&result.foiarray[0].gtype%10!=1)){this.FOIType=2;
if(this.themebasedfoi.minClickableLevel<=zoomLevel){this.setupHTMLMapLayers(result);
}else{this.clearTransImageLayer();
}}else{this.clearTransImageLayer();
this.FOIType=1;
}this.setMouseCursor();
if(this.wholeImage!=null){if(this.wholeImage instanceof Array){for(var i=0;
i<this.wholeImage.length;
i++){this.div.removeChild(this.wholeImage[i]);
MVUtil.deleteNode(this.wholeImage[i]);
}}else{this.div.removeChild(this.wholeImage);
MVUtil.deleteNode(this.wholeImage);
}this.wholeImage=null;
}if(this.isWholeImage()&&this.themebasedfoi.renderFOIImages){this.displayWholeImage(result.foiarray[0].imgurl);
}if(!this.isWholeImage()||this.themebasedfoi.minClickableLevel<=zoomLevel&&result.foiarray.length>0){var divParent=this.div.parentNode;
divParent.removeChild(this.div);
if(removeAllNodesFirst&&!this.isWholeImage()){MVUtil.removeAllChildren(this.div,this.parent.errorHandler);
}for(var i=0;
i<result.foiarray.length;
i++){if(this.aborted){this.loading=false;
this.parent.checkLayersAndSetLoadingIcon();
return;
}result.foiarray[i].attrnames=result.attrnames;
if(this.themebasedfoi.showOverLappingMarker&&result.foiarray[i].overlay){continue;
}result.foiarray[i].hiliteImgPref=result.hiliteImgPref;
result.foiarray[i].hiliteMW=result.hiliteMW;
result.foiarray[i].hiliteMH=result.hiliteMH;
if(this.FOIType==1&&!this.shouldUseDivFilter()&&result.foiarray[i].gtype%10!=1){this.FOIType=3;
this.setupHTMLMapLayers(result);
}if(this.FOIType==1&&this.themebasedfoi.highlightMarkerImage){result.foiarray[i].hiliteImgPref=this.themebasedfoi.highlightMarkerImage.imgURL;
result.foiarray[i].hiliteMW=this.themebasedfoi.highlightMarkerImage.width;
result.foiarray[i].hiliteMH=this.themebasedfoi.highlightMarkerImage.height;
}var cfoi=result.foiarray[i];
if(cfoi.scid!=undefined){cfoi.nodeId=cfoi.id+"_scid_"+cfoi.scid;
}else{cfoi.nodeId=cfoi.id;
}var ofoi=oldFois["_"+cfoi.nodeId];
var flag=false;
if(ofoi){flag=MVGlobalVariables.browser=="IF"?this.themebasedfoi.reuseIENode:true;
}if(this.parent.wraparound){this.setDuplicatePolygonIndFOIOrds(cfoi);
}var overLayFOIs=null;
if(this.themebasedfoi.showOverLappingMarker&&this.FOIType==1){for(var m=i+1;
m<result.foiarray.length;
m++){if(result.foiarray[i].overlayer){continue;
}if(result.foiarray[i].x==result.foiarray[m].x&&result.foiarray[i].y==result.foiarray[m].y){result.foiarray[i].overlay=true;
result.foiarray[m].overlay=true;
if(overLayFOIs==null){overLayFOIs=new Array(result.foiarray[i]);
}overLayFOIs.push(result.foiarray[m]);
}}if(overLayFOIs!=null&&overLayFOIs.length>1){var newFOI={id:"-OL"+result.foiarray[i].id};
newFOI.wr=result.foiarray[i].wr;
newFOI.nodeId=newFOI.id;
newFOI.gtype=result.foiarray[i].gtype;
newFOI.x=result.foiarray[i].x;
newFOI.y=result.foiarray[i].y;
if(this.themebasedfoi.overLappingStyle){if(!this.overLappingMarker){if(this.loadingOverLappingMarker){this.overLappingFOIArray.push(newFOI);
}else{this.loadingOverLappingMarker=true;
this.overLappingFOIArray=new Array(newFOI);
var styleStr=null;
if(this.themebasedfoi.overLappingStyle.getXMLString){styleStr=this.themebasedfoi.overLappingStyle.getXMLString();
}else{styleStr=this.themebasedfoi.overLappingStyle;
}if(styleStr){var markerURL=this.themebasedfoi.serverURL+"?request=getpoiimage&version=1.0&poistyle="+encodeURIComponent(styleStr)+"&refresh ="+(new Date()).getTime();
var tbf=this;
var setFOISize=function(w,h){tbf.overLappingMarker=new foiMarker(markerURL,w,h);
tbf.loadingOverLappingMarker=false;
var len=tbf.overLappingFOIArray.length;
for(var no=0;
no<len;
no++){tbf.overLappingFOIArray[no].width=tbf.overLappingMarker.height;
tbf.overLappingFOIArray[no].height=tbf.overLappingMarker.width;
tbf.overLappingFOIArray[no].imgurl=tbf.overLappingMarker.imgURL;
tbf.displayFoi(tbf.overLappingFOIArray[no]);
}tbf.overLappingFOIArray=null;
};
MVUtil.getImageSize(markerURL,setFOISize);
}}}else{newFOI.width=this.overLappingMarker.height;
newFOI.height=this.overLappingMarker.width;
newFOI.imgurl=this.overLappingMarker.imgURL;
this.displayFoi(newFOI);
}}newFOI.overLayFOIs=overLayFOIs;
continue;
}}if(flag){ofoi.shown=true;
this.displayFoi(cfoi,ofoi);
}else{this.displayFoi(cfoi);
}}divParent.appendChild(this.div);
for(var key in oldFois){foi=oldFois[key];
if(foi.shown==false){this.clearFOINode(foi);
}}}else{for(key in oldFois){foi=oldFois[key];
this.clearFOINode(foi);
}}this.makeFOIsVisiable();
this.foiDisplayed=true;
}else{this.themebasedfoi.queryResult=null;
this.clearAll();
}if(MVMapView.timing){this.t2=new Date();
MVi18n.alert("Time taken to render "+this.themebasedfoi.name+":"+(this.t2-this.t1)+".\nwholeImage:"+this.isWholeImage()+", clickable:"+(this.themebasedfoi.minClickableLevel<=zoomLevel));
}this.addTransparentLayer();
this.loading=false;
this.parent.checkLayersAndSetLoadingIcon();
this.request=null;
if(this.themebasedfoi.onRefreshedListener){this.themebasedfoi.onRefreshedListener();
}if(this.themebasedfoi){MVUtil.runListeners(this.themebasedfoi.EventListeners,MVEvent.AFTER_REFRESH);
}this.themebasedfoi.reuseIENode=true;
}}};
MVThemeBasedFOIControl.prototype.makeFOIsVisiable=function(){var d=true;
for(var b=0;
b<this.parent.mapLayers.length;
b++){if(this.parent.mapLayers[b].layerControl&&!this.parent.mapLayers[b].layerControl.zoomControl.hasZoomFinished()){d=false;
break;
}}if(d){this.div.style.display="";
}else{var a=this;
setTimeout(function(){a.makeFOIsVisiable.apply(a);
},70);
}};
MVThemeBasedFOIControl.prototype.setupHTMLMapLayers=function(t){this.clearTransImageLayer();
this.transImageLayer=document.createElement("div");
var b=this.adjustedRealWidth;
var f=this.adjustedRealHeight;
if(this.around){b=this.realWidth;
}MVUtil.setLeftTop(this.parent.transparentLayer,0,0);
if(this.themebasedfoi.visible&&this.themebasedfoi.clickable){this.transImageLayer.style.visibility="visible";
}else{this.transImageLayer.style.visibility="hidden";
}this.transImageLayer.style.position="absolute";
this.transImageLayer.id=this.themebasedfoi.name;
var r=(this.adjustedMinX-this.minX)*this.parent.pixPerX;
if(this.around){if(this.maparea.length!=2){var s=this.minX;
this.htmlMapXoffset=(this.adjustedMinX-s)*this.parent.pixPerX;
}else{this.htmlMapXoffset=0;
}r=0;
}else{this.htmlMapXoffset=0;
}var d=(this.maxY-this.adjustedMaxY)*this.parent.pixPerY;
var l=(this.parent.mapCenterX-this.centerX)*this.parent.pixPerX;
var h=(this.parent.mapCenterY-this.centerY)*this.parent.pixPerY;
var o=this.lleft-this.parent.divLeft-l+r;
var m=this.ltop-this.parent.divTop+h+d;
this.transImgLayerLeft=o;
this.transImgLayerTop=m;
MVUtil.setLeftTop(this.transImageLayer,o,m);
this.transImageLayer.style.zIndex=this.div.style.zIndex;
var a=MVGlobalVariables.imgFilePath+"transparent.gif";
var g=this.parent.zoomLevel;
if(this.themebasedfoi.minClickableLevel>g){return;
}if(MVGlobalVariables.browser=="IF"&&(!this.shouldUseDivFilter()||this.isWholeImage()||!this.themebasedfoi.renderFOIImages)){var k=document.createElement("div");
k.style.zIndex="127";
var n=document.createElement("img");
n.width=MVUtil.pixel(b);
n.height=MVUtil.pixel(f);
n.style.width=MVUtil.pixel(b);
n.style.height=MVUtil.pixel(f);
n.style.border=0;
n.src=MVGlobalVariables.imgFilePath+"transparent.gif";
n.setAttribute("usemap","#polygonMap"+this.parent.mvId+"_"+this.currentIndex+"_"+this.themebasedfoi.htmlmapIdSuffix,0);
k.style.position="absolute";
MVUtil.setLeftTop(k,0,0);
k.appendChild(n);
MVUtil.disableElementSelection(n);
this.transImageLayer.appendChild(k);
}else{this.transImageLayerImg=document.createElement("img");
this.transImageLayerImg.src=a;
this.transImageLayerImg.setAttribute("usemap","#polygonMap"+this.parent.mvId+"_"+this.currentIndex+"_"+this.themebasedfoi.htmlmapIdSuffix);
this.transImageLayerImg.width=b;
this.transImageLayerImg.height=f;
this.transImageLayerImg.style.width=MVUtil.pixel(b);
this.transImageLayerImg.style.height=MVUtil.pixel(f);
this.transImageLayerImg.style.border=0;
MVUtil.disableElementSelection(this.transImageLayerImg);
this.transImageLayer.appendChild(this.transImageLayerImg);
}this.transImageLayerMap=document.createElement("map");
this.transImageLayerMap.setAttribute("name","polygonMap"+this.parent.mvId+"_"+this.currentIndex+"_"+this.themebasedfoi.htmlmapIdSuffix);
this.transImageLayerMap.setAttribute("id","polygonMap"+this.parent.mvId+"_"+this.currentIndex+"_"+this.themebasedfoi.htmlmapIdSuffix);
this.transImageLayer.setAttribute("theme",this.themebasedfoi.name);
if(MVGlobalVariables.browser=="SF"){this.themebasedfoi.htmlmapIdSuffix++;
}this.transImageLayer.appendChild(this.transImageLayerMap);
};
MVThemeBasedFOIControl.prototype.addTransparentLayer=function(){if(this.transImageLayer){this.parent.transparentLayer.style.zIndex=Math.max(MVUtil.getZIndex(this.div)+1,MVUtil.getZIndex(this.parent.transparentLayer));
this.parent.transparentLayer.appendChild(this.transImageLayer);
if(this.parent.autoHighlight&&typeof $!="undefined"){if(MVGlobalVariables.browser=="IF"){$(this.transImageLayer).find("img").maphilight(this.themebasedfoi.highlight2Style);
}else{$(this.transImageLayerImg).maphilight(this.themebasedfoi.highlight2Style);
}}}};
var TBF_timeoutCounter=0;
MVThemeBasedFOIControl.prototype.setTimeout=function(timeoutHandler,elapseTime){var Ie="tempVar"+TBF_timeoutCounter;
TBF_timeoutCounter++;
eval(Ie+" = this;");
var oi=timeoutHandler.replace(/\\/g,"\\\\");
oi=oi.replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");'+Ie+" = null;",elapseTime);
};
MVThemeBasedFOIControl.prototype._setTimeoutDispatcher=function(func){eval(func);
};
MVThemeBasedFOIControl.prototype.displayGroupFoi=function(a){this.groupFOICount=0;
this.result=a;
this.startDisplayGroupFoi();
};
MVThemeBasedFOIControl.prototype.startDisplayGroupFoi=function(){for(var b=0;
b<180;
b++){if(this.groupFOICount<this.result.foiarray.length){this.result.foiarray[this.groupFOICount].attrnames=this.result.attrnames;
this.displayFoi(this.result.foiarray[this.groupFOICount]);
this.groupFOICount++;
}else{return;
}}this.setTimeout("this.startDisplayGroupFoi()",2);
};
MVThemeBasedFOIControl.prototype.displayFoi=function(P,A){if(!P.node&&P.hidden){return;
}if(!(this.themebasedfoi.renderFOIImages)&&(A)&&(A.node)){E=A.node;
P.mouseDown=A.mouseDown;
A.shown=false;
}if(this.isWholeImage()||P.imgurl||P.area||this.themebasedfoi.getFOIMarker()||!this.themebasedfoi.renderFOIImages){P.imgurl4Hilite=null;
P.highlightImageWidth=P.hw?P.hw:P.hiliteMW;
P.highlightImageHeight=P.hh?P.hh:P.hiliteMH;
P.pngType4Hilite=true;
P.normalPngType4Hilite=false;
P.hilitePngType4Hilite=false;
P.recalSizePos4Hilite=false;
if(this.FOIType==1&&this.themebasedfoi.highlightMarkerImage){P.imgurl4Hilite=P.hiliteImgPref;
}if(this.FOIType==1&&this.themebasedfoi.getFOIMarker()){P.width=this.themebasedfoi.getFOIMarker().width;
P.height=this.themebasedfoi.getFOIMarker().height;
}if(P.highlightImageWidth&&P.highlightImageHeight&&(P.width)&&(P.height)&&((P.width!=P.highlightImageWidth)||(P.height!=P.highlightImageHeight))){P.recalSizePos4Hilite=true;
}if(!P.recalSizePos4Hilite&&A&&A.node&&(A.highlightImageWidth!=P.highlightImageWidth||A.highlightImageHeight!=P.highlightImageHeight)){P.recalSizePos4Hilite=true;
}var r=this;
var E=null;
if(!this.isWholeImage()&&this.themebasedfoi.renderFOIImages&&!(!P.imgurl&&P.scid)){if(!(P.imgurl4Hilite)&&P.imgurl&&P.hiliteImgPref){var n=P.imgurl.lastIndexOf("/");
if(n!=-1){P.imgurl4Hilite=P.imgurl.substring(0,(n+1))+P.hiliteImgPref+P.imgurl.substr((n+1));
}}if(this.themebasedfoi.getFOIMarker()&&!MVUtil.strBeginWith(P.id,"-OL")){P.imgurl=this.themebasedfoi.getFOIMarker().imgURL;
}var l=P.imgurl.toLowerCase().indexOf(".png")==-1?false:true;
if(MVUtil.strBeginWith(P.id,"-OL")){l=true;
}P.normalPngType4Hilite=l;
if(P.imgurl4Hilite){P.hilitePngType4Hilite=P.imgurl4Hilite.toLowerCase().indexOf(".png")==-1?false:true;
}P.pngType4Hilite=(P.normalPngType4Hilite)?true:(P.hilitePngType4Hilite);
var b="IMG";
if((this.shouldUseDivFilter()&&P.pngType4Hilite)||(r.themebasedfoi.foiLayoutListener&&P.gtype%10==1)||r.themebasedfoi.foiLayoutListener){b="DIV";
}if((A)&&(A.node)){if(A.node.tagName==b){E=A.node;
P.mouseDown=A.mouseDown;
}else{A.shown=false;
}}if(!E){if(b=="DIV"){E=document.createElement("div");
}else{E=document.createElement("img");
}}P.node=E;
E.className="noprint";
MVUtil.disableElementSelection(E);
E.style.position="absolute";
if(MVGlobalVariables.browser=="IF"&&!r.themebasedfoi.foiLayoutListener){if(P.width==null){P.width=10;
}if(P.height==null){P.height=10;
}E.style.width=MVUtil.pixel(P.width);
E.style.height=MVUtil.pixel(P.height);
}if(P.nodeId&&P.nodeId!=null){E.id=P.nodeId;
}E.origX=P.x;
E.origY=P.y;
var s=this.getFOILocation(P);
P.loc=s;
if(P.gtype%10==1){MVUtil.setLeftTop(E,Math.ceil(P.loc[0]-P.width/2),Math.ceil(P.loc[1]-P.height/2));
}else{MVUtil.setLeftTop(E,P.loc[0],P.loc[1]);
}E.style.zIndex=160;
}else{if(!this.isWholeImage()&&this.themebasedfoi.renderFOIImages&&(!P.imgurl&&P.scid)&&this.shouldNotUseHTMLMap(P)){return;
}}if(E){E.tbf=r;
E.foi=P;
}var f="";
if(P.name&&P.name!="null"){f=P.name;
}if((MVGlobalVariables.browser=="IF"||MVGlobalVariables.browser=="NS")&&r.themebasedfoi.infoTip&&P.name&&P.name!="null"&&E&&!r.parent.multiThemeClickable){E.title=f;
}var k="";
if(P.name){k=MVUtil.strReplaceAll(P.name," ","&nbsp;");
}if(E&&this.shouldNotUseHTMLMap(P)){this.div.appendChild(E);
if(!r.themebasedfoi.foiLayoutListener){if(this.shouldUseDivFilter()&&P.pngType4Hilite){if(l){E.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+P.imgurl+"', sizingMethod='image');";
}else{E.innerHTML='<img src="'+encodeURIComponent(P.imgurl)+'"/>';
}}else{E.src=P.imgurl;
}if(!r.themebasedfoi.foiLayoutListener){E.setAttribute("id",P.nodeId);
E.setAttribute("border",0);
}if(P.lox!=null&&P.loy!=null){var u;
if((A)&&(A.labelNode)){u=A.labelNode;
}else{u=document.createElement("div");
}u.innerHTML=k;
u.style.cssText=this.labelStyle;
u.style.position="absolute";
u.style.cursor="default";
u.style.zIndex=E.style.zIndex;
P.labelNode=u;
MVUtil.setLeftTop(u,parseInt(E.style.left)+P.lox,parseInt(E.style.top)+P.loy);
this.div.appendChild(u);
}else{if((A)&&(A.labelNode)){A.labelNode.parentNode.removeChild(A.labelNode);
A.labelNode=null;
}}}else{r.themebasedfoi.foiLayoutListener(P);
if(P.xoffset==undefined||isNaN(P.xoffset)){P.xoffset=0;
}else{P.xoffset=parseInt(P.xoffset);
}if(P.yoffset==undefined||isNaN(P.yoffset)){P.yoffset=0;
}else{P.yoffset=parseInt(P.yoffset);
}this.displayCustomizeLayout(P,A,E);
}this.setListeners(E,P);
MVUtil.pushNode(E);
}else{var d=f;
var w=Math.floor((P.x-this.minX)*this.parent.pixPerX+0.5);
var v=Math.floor((this.maxY-P.y)*this.parent.pixPerY+0.5);
var m="";
if(this.themebasedfoi.minClickableLevel<=this.parent.zoomLevel){var o=null;
if((A)&&(A.areaNode)){P.mouseDown=A.mouseDown;
}o=document.createElement("area");
o.tbf=r;
o.foi=P;
o.node=E;
MVUtil.setCursor(o,this.themebasedfoi.cursorStyle);
P.areaNode=o;
this.hasAreaNodes=true;
o.setAttribute("border",0);
if(MVGlobalVariables.browser!="OS"){if((MVGlobalVariables.browser=="IF"||MVGlobalVariables.browser=="NS")&&r.themebasedfoi.infoTip&&P.name&&P.name!="null"){o.setAttribute("title",d);
}o.setAttribute("href","javascript:void(0)");
}if(P.gtype%10==1){var s;
if(P.wr&&P.wr.length>0){s=MVUtil.getScreenXY(this.parent,this.minX,this.adjustedMinY,this.maxX,this.adjustedMaxY,this.realWidth,this.adjustedRealHeight,P.x+P.wr[0]*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX),P.y);
}else{s=MVUtil.getScreenXY(this.parent,this.adjustedMinX,this.adjustedMinY,this.adjustedMaxX,this.adjustedMaxY,this.adjustedRealWidth,this.adjustedRealHeight,P.x,P.y);
}var L=0;
s[0]+=this.parent.divLeft+this.themebasedfoi.xOffset-L;
s[1]+=this.parent.divTop+this.themebasedfoi.yOffset;
o.setAttribute("shape","rect");
var z=parseInt(P.width);
var a=parseInt(P.height);
z=z<10?10:z;
a=a<10?10:a;
z=z/2;
a=a/2;
var h=(s[0]-z)+","+(s[1]-a)+","+(s[0]+z)+","+(s[1]+a);
o.setAttribute("coords",h);
}else{var t="";
if(typeof(P.area)=="undefined"||P.area==null||P.area==""){t="-1000,-1000";
}else{t=P.area;
if(r.themebasedfoi.foiLayoutListener&&!this.isWholeImage()){r.themebasedfoi.foiLayoutListener(P);
}if(P.xoffset==undefined||isNaN(P.xoffset)){P.xoffset=0;
}else{P.xoffset=parseInt(P.xoffset);
}if(P.yoffset==undefined||isNaN(P.yoffset)){P.yoffset=0;
}else{P.yoffset=parseInt(P.yoffset);
}var C=this.htmlMapXoffset+P.xoffset+this.themebasedfoi.xOffset;
if(P.wr&&P.wr.length>0&&this.maparea.length!=2){C+=P.wr[0]*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX)*this.parent.pixPerX;
}var B=P.yoffset+this.themebasedfoi.yOffset;
t=this.moveHTMLMap(t,C,B);
}o.setAttribute("shape","poly");
o.setAttribute("coords",t);
}if(!this.parent.multiThemeClickable&&!this.parent.autoHighlight){this.setListeners(o,P);
}MVUtil.pushNode(o);
this.transImageLayerMap.appendChild(o);
if(MVGlobalVariables.browser=="IF"&&MVGlobalVariables.browserMajorVersion>8){o.onclick=function(){return false;
};
}}else{if(P.areaNode){P.areaNode=null;
}}if(this.parent.multiThemeClickable){var t=P.area;
if(typeof(P.area)!="undefined"){var g=t.split(",");
var K=[],J=[],D=g.length/2;
var O=0;
if(D>=4){var N=maxX=K[0]=parseFloat(g[0]);
var M=maxY=J[0]=parseFloat(g[1]);
for(var G=1;
G<D;
G++){K[G]=parseFloat(g[G*2]);
J[G]=parseFloat(g[G*2+1]);
if(N>K[G]){N=K[G];
}else{if(maxX<K[G]){maxX=K[G];
}}if(M>J[G]){M=J[G];
}else{if(maxY<J[G]){maxY=J[G];
}}}P.vertx=K;
P.verty=J;
P.vertMBR={minX:N,minY:M,maxX:maxX,maxY:maxY};
}}}if(E){MVUtil.setLeftTop(E,s[0],s[1]);
E.style.position="absolute";
E.style.width=MVUtil.pixel(P.width);
E.style.height=MVUtil.pixel(P.height);
E.id=P.nodeId;
if(r.themebasedfoi.foiLayoutListener){this.displayCustomizeLayout(P,A,E);
}else{E.src=P.imgurl;
}E.style.zIndex=125;
this.div.appendChild(E);
}}this.cloneFOINode(E,P);
if(E!=null&&E.id!=null){for(var H=0;
H<r.themebasedfoi.highlightFoiList.length;
H++){if(P.id==r.themebasedfoi.highlightFoiList[H].id&&r.themebasedfoi.highlightFoiList[H].mouseDown){var F=true;
if(P.attrs&&r.themebasedfoi.highlightFoiList[H].attrs){var I=r.themebasedfoi.highlightFoiList[H].attrs.length;
if(P.attrs.length==I){for(var G=0;
G<I;
G++){if(P.attrs[G]!=r.themebasedfoi.highlightFoiList[H].attrs[G]){F=false;
break;
}}}else{F=false;
}}if(F){P.mouseDown=true;
r.themebasedfoi.highlightFoiList[H]=P;
this.highlightFOI(r,P,E);
break;
}}}}}};
MVThemeBasedFOIControl.prototype.destroy=function(){this.removeAll();
if(this.request){this.request.onreadystatechange=function(){};
this.request.abort();
this.request=null;
}if(this.themebasedfoi.queryResult&&this.themebasedfoi.queryResult.foiarray){while(this.themebasedfoi.queryResult.foiarray.length>0){var b=this.themebasedfoi.queryResult.foiarray.pop();
if(b.node){b.node=null;
}if(b.areaNode){b.areaNode=null;
}}}this.themebasedfoi.queryResult=null;
this.themebasedfoi=null;
if(this.parent){if(this.parent.div&&this.div){try{this.parent.div.removeChild(this.div);
}catch(a){}}this.div=null;
this.parent.checkLayersAndSetLoadingIcon();
this.parent=null;
}this.transImageLayerMap=null;
this.transImageLayer=null;
this.transImageLayerImg=null;
};
MVThemeBasedFOIControl.prototype.adjustBBox=function(f){var b=false;
var a=this.parent.msi.mapConfig.coordSys;
this.adjustedMinX2=0;
this.adjustedMaxX2=0;
if(this.parent.wraparound&&!f){if(this.maparea.length>=3){this.adjustedMinX=a.minX;
this.adjustedMaxX=a.maxX;
}else{if(this.maparea.length==2){var d=a.maxX-a.minX;
if(this.parent.maptype!="PROJECTED"){this.adjustedMinX=this.maparea[0].minx;
if(this.maparea[0].minx<this.maparea[1].maxx){this.adjustedMaxX=this.maparea[0].minx+d;
}else{this.adjustedMaxX=this.maparea[1].maxx+d;
}}else{this.adjustedMinX=this.maparea[0].minx;
this.adjustedMaxX=this.maparea[0].maxx;
if(this.maparea[1].maxx<this.maparea[0].minx){this.adjustedMinX2=this.maparea[1].minx;
this.adjustedMaxX2=this.maparea[1].maxx;
}else{if(this.maparea[1].minx<this.maparea[0].minx){this.adjustedMinX2=this.maparea[1].minx;
this.adjustedMaxX2=this.maparea[0].minx;
}}}}else{this.adjustedMinX=this.maparea[0].minx;
this.adjustedMaxX=this.maparea[0].maxx;
}}b=true;
}else{if(!f&&this.minX<a.minX){this.adjustedMinX=a.minX;
b=true;
}else{this.adjustedMinX=this.minX;
}if(!f&&this.maxX>a.maxX){this.adjustedMaxX=a.maxX;
b=true;
}else{this.adjustedMaxX=this.maxX;
}}if(!f&&this.minY<a.minY){this.adjustedMinY=a.minY;
b=true;
}else{this.adjustedMinY=this.minY;
}if(!f&&this.maxY>a.maxY){this.adjustedMaxY=a.maxY;
b=true;
}else{this.adjustedMaxY=this.maxY;
}if(this.adjustedMinX2){this.adjustedRealWidth=Math.round(this.realWidth*(this.adjustedMaxX-this.adjustedMinX+this.adjustedMaxX2-this.adjustedMinX2)/(this.maxX-this.minX));
}else{this.adjustedRealWidth=Math.round(this.realWidth*(this.adjustedMaxX-this.adjustedMinX)/(this.maxX-this.minX));
}this.adjustedRealHeight=Math.round(this.realHeight*(this.adjustedMaxY-this.adjustedMinY)/(this.maxY-this.minY));
};
MVThemeBasedFOIControl.prototype.getJDBCTheme=function(n){if(!n){return n;
}if(n.indexOf("<themes>")>=0){n=n.substring(n.indexOf("<themes>")+8,n.indexOf("</themes>"));
}if(this.themebasedfoi.renderStyle){var d=n.indexOf(" render_style");
if(d>0){var o='"';
var t=n.indexOf(o,d);
var a=n.indexOf("'",d);
if(t<0||a<t){o="'";
t=a;
}var r=n.indexOf(o,t+1);
n=n.substring(0,d)+n.substring(r+1);
}else{d=n.indexOf("<jdbc_query")+11;
}n=n.substring(0,d)+' render_style="'+this.themebasedfoi.renderStyle+'"'+n.substring(d);
}if(this.themebasedfoi.renderLabels){return n;
}else{var b=n.indexOf(" label_column");
if(b>0){var f='" ';
var l=n.indexOf(f,b);
var k=n.indexOf("'",b);
if(l<0||k<l){f="'";
l=k;
}var s=n.indexOf(f,l+1);
n=n.substring(0,b)+n.substring(s+1);
}var v=n.indexOf(" label_style");
if(v>0){var u='" ';
var m=n.indexOf(u,v);
var g=n.indexOf("'",v);
if(m<0||g<m){u="'";
m=g;
}var h=n.indexOf(u,m+1);
n=n.substring(0,v)+n.substring(h+1);
}}return n;
};
MVThemeBasedFOIControl.prototype.displayWholeImage=function(r){var o=-(this.adjustedMaxY-this.parent.initMapWindowMaxY)*this.parent.pixPerY;
o=o-MVUtil.getTop(this.div)+this.themebasedfoi.yOffset;
var k=this;
var n=function(s){var l=null;
if(k.shouldUseDivFilter()){l=MVUtil.createImageNode(r,true);
}else{l=document.createElement("img");
l.src=r;
}l.style.width=MVUtil.pixel(k.adjustedRealWidth);
l.style.height=MVUtil.pixel(k.adjustedRealHeight);
l.style.position="absolute";
MVUtil.setLeftTop(l,s,o);
k.div.appendChild(l);
return l;
};
this.clearAll(true);
if(!this.parent.wraparound){var b=(this.adjustedMinX-this.parent.initMapWindowMinX)*this.parent.pixPerX;
b=b-MVUtil.getLeft(this.div)+this.themebasedfoi.xOffset;
this.wholeImage=n(b);
}else{var d=this.parent.msi.mapConfig.coordSys;
var a=d.maxX-d.minX;
var h=this.maparea.length;
if(h>=3){this.wholeImage=new Array();
for(var f=0;
f<h;
f++){var b=(this.maparea[f].minx+this.maparea[f].n*a-(this.maparea[f].minx-this.adjustedMinX)-this.parent.initMapWindowMinX)*this.parent.pixPerX;
b=b-MVUtil.getLeft(this.div)+this.themebasedfoi.xOffset;
var g=n(b);
this.wholeImage.push(g);
}}else{if(h==2){var b=(this.maparea[0].minx+this.maparea[0].n*a-this.parent.initMapWindowMinX)*this.parent.pixPerX;
b=b-MVUtil.getLeft(this.div)+this.themebasedfoi.xOffset;
var g=n(b);
if(this.maparea[0].minx<this.maparea[1].maxx){this.wholeImage=new Array(g);
var m=(this.maparea[0].minx+(this.maparea[0].n+1)*a-this.parent.initMapWindowMinX)*this.parent.pixPerX;
m=m-MVUtil.getLeft(this.div)+this.themebasedfoi.xOffset;
var g=n(m);
this.wholeImage.push(g);
}else{this.wholeImage=g;
}}else{var b=(this.maparea[0].minx+this.maparea[0].n*a-this.parent.initMapWindowMinX)*this.parent.pixPerX;
b=b-MVUtil.getLeft(this.div)+this.themebasedfoi.xOffset;
this.wholeImage=n(b);
}}}};
MVThemeBasedFOIControl.prototype.getThemeId=function(h){var l="request=getthemeid";
var g=(this.themebasedfoi.serverURL.indexOf(MVGlobalVariables.getProxyURL())<0&&MVUtil.isLocalDomain(this.themebasedfoi.serverURL));
var a=g||MVMapView.XMLHTTPEnabled;
var d=null;
var f=this;
var b=function(){if(d.readyState==4&&d.status==200){f.themeId=d.responseText;
if(f.themeId.lastIndexOf("\n")==f.themeId.length-1){f.themeId=f.themeId.substr(0,f.themeId.length-1);
}if(f.themeId&&f.themeId.indexOf("MAPVIEWER-06011")>=0){f.abortionSupported=false;
}if(h){h();
}d=null;
}};
try{d=MVUtil.getXMLHttpRequest(a);
d.onreadystatechange=b;
d.open("POST",MVUtil.getXMLHttpUrl(this.themebasedfoi.serverURL),true);
d.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
d.send(MVUtil.getXMLHttpReq(this.themebasedfoi.serverURL,l));
}catch(k){MVi18n.reportError("MVThemeBasedFOIControl.getThemeId","MAPVIEWER-05511",k,this.parent.errorHandler);
}};
MVThemeBasedFOIControl.prototype.abort=function(){if(!this.abortionSupported){return;
}var h="request=abort&tid="+this.themeId;
var f=(this.themebasedfoi.serverURL.indexOf(MVGlobalVariables.getProxyURL())<0&&MVUtil.isLocalDomain(this.themebasedfoi.serverURL));
var a=f||MVMapView.XMLHTTPEnabled;
var b=null;
var d=this;
this.aborted=true;
try{b=MVUtil.getXMLHttpRequest(a);
b.open("POST",MVUtil.getXMLHttpUrl(this.themebasedfoi.serverURL),true);
b.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
b.send(MVUtil.getXMLHttpReq(this.themebasedfoi.serverURL,h));
b=null;
}catch(g){MVi18n.reportError("MVThemeBasedFOIControl.abort","MAPVIEWER-05511",g,this.parent.errorHandler);
}};
MVThemeBasedFOIControl.prototype.setMouseCursor=function(){if(this.themebasedfoi.minClickableLevel<=this.parent.zoomLevel&&this.themebasedfoi.clickable&&(this.parent.multiThemeClickable&&this.FOIType==1||!this.parent.multiThemeClickable)){MVUtil.setCursor(this.div,this.themebasedfoi.cursorStyle);
}else{MVUtil.setCursor(this.div,"default");
}};
MVThemeBasedFOIControl.prototype.displayCustomizeLayout=function(g,a,h){if(a!=null&&a.layoutListenerDiv!=null){if(a.layoutListenerDiv.parentNode!=null){a.layoutListenerDiv.parentNode.removeChild(a.layoutListenerDiv);
}MVUtil.deleteNode(a.layoutListenerDiv);
a.layoutListenerDiv=null;
}var f=document.createElement("div");
f.style.position="absolute";
f.tag="layout";
var b=this;
var d=g.xoffset+b.themebasedfoi.xOffset;
var k=g.yoffset+b.themebasedfoi.yOffset;
f.style.left=MVUtil.pixel(d);
f.style.top=MVUtil.pixel(k);
f.style.padding=MVUtil.pixel(0);
f.innerHTML=""+g.html+"";
h.appendChild(f);
g.layoutListenerDiv=f;
};
MVThemeBasedFOIControl.prototype.stopPropagation=function(a){a=(a)?a:((window.event)?event:null);
var d=MVUtil.getEventSource(a);
var b=d.tbf;
while(!b&&d.parentNode){d=d.parentNode;
b=d.tbf;
}if(a&&!b.themebasedfoi.enablePropagation){if(MVGlobalVariables.browser=="IF"){a.cancelBubble=true;
}else{if(a.stopPropagation){a.stopPropagation();
}}}};
MVThemeBasedFOIControl.prototype.stopEvent=function(a){a=(a)?a:((window.event)?event:null);
var d=MVUtil.getEventSource(a);
var b=d.tbf;
while(!b&&d.parentNode){d=d.parentNode;
b=d.tbf;
}if(!b||!b.themebasedfoi||a&&!b.themebasedfoi.enablePropagation){MVUtil.stopEvent(a);
}};
MVThemeBasedFOIControl.prototype.getMouseDownLocation=function(a){a=(a)?a:((window.event)?event:null);
var g=MVUtil.getEventSource(a);
var b=g.tbf;
while(!b&&g.parentNode){g=g.parentNode;
b=g.tbf;
}if(!b){return;
}var f=function(){b.tapHoldTimeOut=null;
b.touchAndHold(a);
};
if(MVUtil.isTouchEvent(a)){if(b.tapHoldTimeOut){b.cancelTouchAndHold();
}else{b.tapHoldTimeOut=setTimeout(f,MVGlobalVariables.touchHoldTimeOut);
}}var d=g.foi;
b.mouseL1=MVUtil.getMouseXY(a);
b.stopEvent(a);
};
MVThemeBasedFOIControl.prototype.tFoiMouseUp=function(a){a=(a)?a:((window.event)?event:null);
var f=MVUtil.getEventSource(a);
var b=f.tbf;
while(!b&&f.parentNode){f=f.parentNode;
b=f.tbf;
}if(!b){return;
}if(MVUtil.isTouchEvent(a)){if(!b.tapHoldTimeOut){return;
}else{b.cancelTouchAndHold();
}}var d=f.foi;
if(!b.themebasedfoi.clickable||b.parent.redLineIsOn){return;
}b.mouseL2=MVUtil.getMouseXY(a);
if(a.button==2){if(!b.shouldNotUseHTMLMap(d)&&MVGlobalVariables.browser=="IF"){b.tFoiRightClick(a);
}return;
}if(!b.mouseL2||b.mouseL1.x==b.mouseL2.x&&b.mouseL1.y==b.mouseL2.y){b.mouseUpFun(d,a,f);
}};
MVThemeBasedFOIControl.prototype.mouseUpFun=function(g,a,l){var b=this;
b.parent.stopDragging();
if(b.parent.getBrowserType()=="NS"){b.parent.curLay=null;
}var k=MVUtil.getMouseLocation(b.parent,a);
if(g.overlay&&l&&l.point){k=l.point;
}if(b.themebasedfoi.onClickListener||b.themebasedfoi.EventListeners[MVEvent.MOUSE_CLICK]){var f=MVSdoGeometry.createPoint(k.sdo_point.x,k.sdo_point.y,b.parent.srid);
if(b.themebasedfoi.onClickListener){b.themebasedfoi.onClickListener(f,g,MVUtil.getEvent(a));
}if(b.themebasedfoi){MVUtil.runListeners(b.themebasedfoi.EventListeners,MVEvent.MOUSE_CLICK,[f,g,MVUtil.getEvent(a)]);
}}else{if(g.attrs!=null){if(g.attrs.length>=1&&b.themebasedfoi.infoWindow){var d=g.name==null?"":MVUtil.strReplaceAll(g.name," ","&nbsp;");
b.parent.infoLayer.showAttributesWindow(g.attrs,g.attrnames,g.id,d,k.sdo_point.x,k.sdo_point.y,null,null,b.themebasedfoi,300);
}}}if(!b.themebasedfoi){b.stopEvent(a);
return;
}var h=l;
if(!b.shouldNotUseHTMLMap(g)&&l){h=l.node;
}if(b.themebasedfoi.mouseClickHighlight){b.mouseUpHighLight(b,g,h);
}};
MVThemeBasedFOIControl.prototype.tFoiRightClick=function(a){a=(a)?a:((window.event)?event:null);
var f=MVUtil.getEventSource(a);
var b=f.tbf;
while(!b&&f.parentNode){f=f.parentNode;
b=f.tbf;
}if(!b){return;
}var d=f.foi;
if(!b.themebasedfoi.clickable){return;
}b.rightClickFun(d,a,f);
};
MVThemeBasedFOIControl.prototype.rightClickFun=function(f,b,h){var d=this;
var g=MVUtil.getMouseLocation(d.parent,b);
if(f.overlay&&tareget&&h.point){g=h.point;
}var a=MVSdoGeometry.createPoint(g.sdo_point.x,g.sdo_point.y,d.parent.srid);
if(d.themebasedfoi.onRightClickListener){d.themebasedfoi.onRightClickListener(a,f,MVUtil.getEvent(b));
}if(d.themebasedfoi){MVUtil.runListeners(d.themebasedfoi.EventListeners,MVEvent.MOUSE_RIGHT_CLICK,[a,f,MVUtil.getEvent(b)]);
}d.stopEvent(b);
};
MVThemeBasedFOIControl.prototype.tFoiMouseOver=function(a){a=(a)?a:((window.event)?event:null);
var h=MVUtil.getEventSource(a);
var b=h.tbf;
var d=0;
while(!b&&h.parentNode){h=h.parentNode;
b=h.tbf;
d++;
}if(!b){return;
}var f=h.foi;
var g=h;
if(!b.shouldNotUseHTMLMap(f)){g=h.node;
if(!b.themebasedfoi.clickable){return;
}}b.mouseOverFun(f,a,h);
};
MVThemeBasedFOIControl.prototype.mouseOverFun=function(h,d,l){var f=this;
var k=MVUtil.getMouseLocation(f.parent,d);
if(h.overlay&&l&&l.point){k=l.point;
}var b=MVSdoGeometry.createPoint(k.sdo_point.x,k.sdo_point.y,f.parent.srid);
if(h.overLayFOIs){var a=MVUtil.getRealOrdinates(f.parent,k.sdo_point.x,h.x);
b=MVSdoGeometry.createPoint(a,h.y,f.parent.srid);
f.showFOIList(b,h.overLayFOIs);
}else{if(f.themebasedfoi.onMouseOverListener){f.themebasedfoi.onMouseOverListener(b,h,MVUtil.getEvent(d));
}if(f.themebasedfoi){MVUtil.runListeners(f.themebasedfoi.EventListeners,MVEvent.MOUSE_OVER,[b,h,MVUtil.getEvent(d)]);
}}if(f.themebasedfoi.infoWindowMO&&!(f.parent.infoLayer.hasInfoWindow()&&!f.parent.infoLayer.mouseOver)){if(h.attrs!=null){if(h.attrs.length>=1&&f.themebasedfoi.infoWindow){var g=h.name==null?"":MVUtil.strReplaceAll(h.name," ","&nbsp;");
f.parent.infoLayer.showAttributesWindow(h.attrs,h.attrnames,h.id,g,k.sdo_point.x,k.sdo_point.y,null,null,f.themebasedfoi,300,true);
}}}if(f.shouldNotUseHTMLMap(h)&&f.themebasedfoi.bringToTopOnMouseOver&&l){l.style.zIndex=162;
}if(!(l&&l.title)&&h.name&&h.name!="null"&&f.themebasedfoi.infoTip&&!h.overlay){var g=h.name==null?"":MVUtil.strReplaceAll(h.name," ","&nbsp;");
f.parent.infoLayer.showTextTip(g,k.sdo_point.x,k.sdo_point.y);
}if(f.parent.autoHighlight&&typeof $!="undefined"){$(h.areaNode).mouseover();
}};
MVThemeBasedFOIControl.prototype.tFoiMouseOut=function(b){b=(b)?b:((window.event)?event:null);
var k=MVUtil.getEventSource(b);
var d=k.tbf;
while(!d&&k.parentNode){k=k.parentNode;
d=k.tbf;
}if(!d){return;
}var f=k.foi;
var h=k;
if(!d.shouldNotUseHTMLMap(f)){h=k.node;
if(!d.themebasedfoi.clickable){return;
}}var g=MVUtil.getMouseLocation(d.parent,b);
if(f.overlay&&k.point){g=k.point;
}var a=MVSdoGeometry.createPoint(g.sdo_point.x,g.sdo_point.y,d.parent.srid);
if(f.overLayFOIs){d.hideFOIList(a,f.overLayFOIs);
}else{if(d.themebasedfoi.onMouseOutListener){d.themebasedfoi.onMouseOutListener(a,f,MVUtil.getEvent(b));
}if(d.themebasedfoi){MVUtil.runListeners(d.themebasedfoi.EventListeners,MVEvent.MOUSE_OUT,[a,f,MVUtil.getEvent(b)]);
}}if(d.themebasedfoi.infoWindowMO&&!(d.parent.infoLayer.hasInfoWindow()&&!d.parent.infoLayer.mouseOver)){if(f.attrs!=null){if(f.attrs.length>=1&&d.themebasedfoi.infoWindow){d.parent.removeInfoWindow();
}}}if(d.shouldNotUseHTMLMap(f)){if(d.themebasedfoi.enableHighlightMode&&d.themebasedfoi.bringToTopOnHighlight&&(f.highlight||f.scid!=null&&d.getMainFOI(f).highlight)){k.style.zIndex=161;
}else{k.style.zIndex=160;
}}d.parent.infoLayer.hideInfoTip();
if(d.themebasedfoi.enableMouseOverHighlightMode&&d.themebasedfoi.enableHighlightMode){if(h&&f.imgurl4Hilite!=null&&!(f.mouseDown)){d.deHighlightFOI(d,f,h);
}else{if(f.scid){var f=d.getMainFOI(f);
if(f&&!(f.mouseDown)){d.deHighlightFOI(d,f,f.node);
}}}}};
MVThemeBasedFOIControl.prototype.mouseOutFun=function(f,b,h){var d=this;
var g=MVUtil.getMouseLocation(d.parent,b);
if(f.overlay&&h&&h.point){g=h.point;
}var a=MVSdoGeometry.createPoint(g.sdo_point.x,g.sdo_point.y,d.parent.srid);
if(f.overLayFOIs){d.hideFOIList(a,f.overLayFOIs);
}else{if(d.themebasedfoi.onMouseOutListener){d.themebasedfoi.onMouseOutListener(a,f,MVUtil.getEvent(b));
}if(d.themebasedfoi){MVUtil.runListeners(d.themebasedfoi.EventListeners,MVEvent.MOUSE_OUT,[a,f,MVUtil.getEvent(b)]);
}}if(d.themebasedfoi.infoWindowMO&&!(d.parent.infoLayer.hasInfoWindow()&&!d.parent.infoLayer.mouseOver)){if(f.attrs!=null){if(f.attrs.length>=1&&d.themebasedfoi.infoWindow){d.parent.removeInfoWindow();
}}}if(d.shouldNotUseHTMLMap(f)&&h){if(d.themebasedfoi.enableHighlightMode&&d.themebasedfoi.bringToTopOnHighlight&&(f.highlight||f.scid!=null&&d.getMainFOI(f).highlight)){h.style.zIndex=161;
}else{h.style.zIndex=160;
}}else{if(d.parent.autoHighlight&&typeof $!="undefined"){$(f.areaNode).mouseout();
}}d.parent.infoLayer.hideInfoTip();
};
MVThemeBasedFOIControl.prototype.shouldNotUseHTMLMap=function(a){return((this.shouldUseDivFilter()||a.gtype%10==1)&&this.themebasedfoi.renderFOIImages&&!this.isWholeImage());
};
MVThemeBasedFOIControl.prototype.mouseUpHighLight=function(m,s,a){if(m.themebasedfoi.enableHighlightMode&&!m.themebasedfoi.foiLayoutListener){if(s.imgurl4Hilite!=null){var k=m.themebasedfoi.highlightFoiList.length;
var l=m.themebasedfoi.highlightMode;
var h=false;
var f=null;
if(k>0){var b=m.themebasedfoi.highlightFoiList;
var n=null;
var d=null;
for(var g=0;
g<b.length;
g++){if(b[g]==s){h=true;
f=g;
break;
}}if(l==-1||k<=l){var r=m.themebasedfoi.queryResult.foiarray;
for(var g=0;
g<b.length;
g++){var o=b[g];
o.mouseDown=false;
if(o!=null&&o.node!=null&&o.imgurl!=null){m.deHighlightFOI(m,o);
}}m.themebasedfoi.highlightFoiList=new Array();
k=0;
}else{if(l>0){for(var g=1;
g<=l;
++g){n=b[k-g];
n.mouseDown=false;
if(n!=null&&n.node!=null&&n.imgurl!=null){m.deHighlightFOI(m,n);
}}m.themebasedfoi.highlightFoiList=b.slice(0,(0-l));
k-=l;
}}}if(!h){s.mouseDown=true;
m.themebasedfoi.highlightFoiList[k++]=s;
m.highlightFOI(m,s);
}else{if(l==0){if(f!=null){m.themebasedfoi.highlightFoiList[f].mouseDown=false;
m.themebasedfoi.highlightFoiList.splice(f,1);
}m.deHighlightFOI(m,s);
}}}else{if(s.scid){var s=m.getMainFOI(s);
if(s){m.mouseUpHighLight(m,s,s.node);
}}}}};
MVThemeBasedFOIControl.prototype.deHighlightFOI=function(a,d){if(!d.highlight){return;
}var f=d.node;
d.highlight=false;
var g=function(m,k){if(a.shouldNotUseHTMLMap(d)){if(d!=null&&d.imgurl!=null){if(a.shouldUseDivFilter()&&d.pngType4Hilite){if(d.normalPngType4Hilite){m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.imgurl+"', sizingMethod='image');";
m.src=d.imgurl;
m.innerHTML="";
}else{m.onmouseover=null;
m.onmouseout=null;
m.style.filter=null;
m.src=null;
m.innerHTML='<img src="'+encodeURIComponent(d.imgurl)+'"/>';
var h=function(){m.onmouseover=a.tFoiMouseOver;
m.onmouseout=a.tFoiMouseOut;
};
window.setTimeout(h,50);
}}else{m.src=d.imgurl;
}if(d.recalSizePos4Hilite&&(d.gtype%10==1)){var l=0;
if(k&&k!=0){l=k*(a.parent.msi.coverMaxX-a.parent.msi.coverMinX)*a.parent.pixPerX;
}MVUtil.setLeftTop(m,Math.ceil(d.loc[0]-d.width/2+l),Math.ceil(d.loc[1]-d.height/2));
m.style.width=MVUtil.pixel(d.width);
m.style.height=MVUtil.pixel(d.height);
}}if(a.themebasedfoi.bringToTopOnHighlight){m.style.zIndex=160;
}}else{if(d!=null&&d.imgurl!=null){if(a.shouldUseDivFilter()&&foiObj.pngType4Hilite){m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+d.imgurl+"', sizingMethod='image');";
}m.src=d.imgurl;
}if(a.themebasedfoi.bringToTopOnHighlight){m.style.zIndex=125;
}}};
if(f instanceof Array){for(var b=0;
b<f.length;
b++){g(f[b],b);
}}else{g(f);
}};
MVThemeBasedFOIControl.prototype.highlightFOI=function(b,f){if(f.highlight){return;
}var g=f.node;
f.highlight=true;
var a=function(m,k){if(b.shouldNotUseHTMLMap(f)&&f.imgurl4Hilite){if(b.shouldUseDivFilter()&&f.pngType4Hilite){if(f.hilitePngType4Hilite){m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f.imgurl4Hilite+"', sizingMethod='image');";
m.src=f.imgurl4Hilite;
m.innerHTML="";
}else{m.onmouseout=null;
m.onmouseover=null;
m.style.filter=null;
m.src=null;
m.innerHTML='<img src="'+encodeURIComponent(f.imgurl4Hilite)+'"/>';
var h=function(){m.onmouseout=b.tFoiMouseOut;
m.onmouseover=b.tFoiMouseOver;
};
window.setTimeout(h,10);
}}else{m.src=f.imgurl4Hilite;
}if(b.themebasedfoi.bringToTopOnHighlight){m.style.zIndex=161;
}if(f.recalSizePos4Hilite&&(f.gtype%10==1)){var l=0;
if(k&&k!=0){l=k*(b.parent.msi.coverMaxX-b.parent.msi.coverMinX)*b.parent.pixPerX;
}MVUtil.setLeftTop(m,Math.ceil(f.loc[0]-f.highlightImageWidth/2+l),Math.ceil(f.loc[1]-f.highlightImageHeight/2));
m.style.width=MVUtil.pixel(f.highlightImageWidth);
m.style.height=MVUtil.pixel(f.highlightImageHeight);
}}else{if(m!=null&&(f.imgurl4Hilite)){if(b.shouldUseDivFilter()&&f.pngType4Hilite){m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f.imgurl4Hilite+"', sizingMethod='image');";
}m.src=f.imgurl4Hilite;
if(b.themebasedfoi.bringToTopOnHighlight){m.style.zIndex=126;
}}}};
if(g instanceof Array){for(var d=0;
d<g.length;
d++){a(g[d],d);
}}else{if(g){a(g);
}}};
MVThemeBasedFOIControl.prototype.getMapBBOXArray=function(){this.maparea=new Array();
var a=this.minX;
var g=this.maxX;
if(this.parent.msi!=null){var f=this.parent.msi.coverMinX;
var d=this.parent.msi.coverMaxX;
var b=d-f;
var h=0;
if(a<f){h=Math.ceil((f-a)/b);
a+=b*h;
g+=b*h;
h=0-h;
}else{if(a>=d){h=Math.ceil((a-d)/b);
a-=b*h;
if(a==d){h++;
a=f;
}g-=b*h;
}}if(g<=d&&a!=g){this.maparea.push({minx:a,maxx:g,n:h});
}else{this.maparea.push({minx:a,maxx:d,n:h});
g-=b;
h++;
while(g>d){this.maparea.push({minx:f,maxx:d,n:h});
g-=b;
h++;
}this.maparea.push({minx:f,maxx:g,n:h});
}}};
MVThemeBasedFOIControl.prototype.cloneFOINode=function(d,w,a){var o=this;
if(w.areaNode){var n=w.areaNode;
var r=n.getAttribute("coords");
var l=n.getAttribute("shape");
if(w.wr&&w.wr.length>1){if(!a){a=1;
}if(a==1){w.areaNode=new Array(n);
}for(var g=a;
g<w.wr.length;
g++){var f=n.cloneNode(true);
MVUtil.setCursor(f,this.themebasedfoi.cursorStyle);
var k=g*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX)*this.parent.pixPerX;
var s=this.moveHTMLMap(r,k,0);
if(MVGlobalVariables.browser=="IF"){f.setAttribute("shape",l);
}f.setAttribute("coords",s);
var v=f.getAttribute("coords");
if(d){f.node=d;
}this.setListeners(f,w);
MVUtil.pushNode(f);
this.transImageLayerMap.appendChild(f);
w.areaNode.push(f);
}}}if(!d){return;
}if(w.wr&&w.wr.length>1){var m=false;
if(!a){a=1;
}if(a==1){w.node=new Array(d);
if(w.lox!=null&&w.loy!=null){w.labelNode=new Array(w.labelNode);
}}for(var g=a;
g<w.wr.length;
g++){var u=d.cloneNode(true);
u.id=u.id+"clone"+g;
var b=parseInt(d.style.left);
u.style.left=MVUtil.pixel(b+g*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX)*this.parent.pixPerX);
this.div.appendChild(u);
u.orgid=d.id;
this.setListeners(u,w);
w.node.push(u);
MVUtil.pushNode(d);
if(w.lox!=null&&w.loy!=null&&!o.themebasedfoi.foiLayoutListener){var h=w.labelNode[0].cloneNode(true);
var t=parseInt(h.style.left);
h.style.left=MVUtil.pixel(t+g*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX)*this.parent.pixPerX);
w.labelNode.push(h);
this.div.appendChild(h);
}}}};
MVThemeBasedFOIControl.prototype.setListeners=function(d,b){var a=this;
d.tbf=a;
d.foi=b;
d.onmouseover=a.tFoiMouseOver;
d.onmouseout=a.tFoiMouseOut;
d.onmousemove=a.tFoiMouseMove;
if(this.themebasedfoi.minClickableLevel<=this.parent.zoomLevel){MVUtil.setListener(d,"mousedown",a.getMouseDownLocation);
MVUtil.setListener(d,"mouseup",a.tFoiMouseUp);
if(MVGlobalVariables.browser=="IF"&&!a.shouldNotUseHTMLMap(b)){d.oncontextmenu=function(){return false;
};
}else{d.oncontextmenu=a.tFoiRightClick;
}d.ondblclick=a.stopEvent;
d.onclick=a.stopPropagation;
d.onkeyup=a.stopPropagation;
}else{MVUtil.setListener(d,"mousedown",null);
MVUtil.setListener(d,"mouseup",null);
if(MVGlobalVariables.browser=="IF"&&!a.shouldNotUseHTMLMap(b)){d.oncontextmenu=function(){return false;
};
}else{d.oncontextmenu=null;
}d.ondblclick=null;
d.onclick=null;
d.onkeyup=null;
}};
MVThemeBasedFOIControl.prototype.setDuplicatePolygonIndFOIOrds=function(m){m.wr=new Array();
var b=0;
var h=this.parent.msi.coverMinX;
var d=this.parent.msi.coverMaxX;
var k=d-h;
var o=this.parent.msi.coverMinX+k/2;
var a=m.x+m.width;
var f=m.x;
var l=false;
if(f<=h||a>=d){m.wr.push(this.maparea[0].n);
if(f<o&&a<o){a=m.x+k;
f=m.x+m.width;
}else{if(f>o&&a>o){a=m.x;
f=m.x+m.width-k;
}}for(var g=1;
g<this.maparea.length;
g++){if(this.maparea[g].maxx>f){m.wr.push(this.maparea[g].n);
}}}else{for(var g=0;
g<this.maparea.length;
g++){if((f>this.maparea[g].minx&&f<this.maparea[g].maxx)||(a>this.maparea[g].minx&&a<this.maparea[g].maxx)){m.wr.push(this.maparea[g].n);
}}}};
MVThemeBasedFOIControl.prototype.moveHTMLMap=function(f,k,l){if(k!=0||l!=0){var a="";
var h=f.split(" ");
for(var d=0;
d<h.length;
d++){var b=h[d].split(",");
for(var g=0;
g<b.length;
){b[g]=parseInt(b[g++])+k;
b[g]=parseInt(b[g++])+l;
}a+=b.toString()+" ";
}if(a.length>0){a=a.substring(0,a.length-1);
}return a;
}else{return f;
}};
MVThemeBasedFOIControl.prototype.getSequenceParameterStr=function(){if(this.themebasedfoi.sequence){return' marker_sequence="'+this.themebasedfoi.sequenceType+'"';
}else{return"";
}};
MVThemeBasedFOIControl.prototype.getRenderStyleParameterStr=function(a){if(a!=null){return' render_style="'+a+'"';
}else{if(this.themebasedfoi.renderStyle){return' render_style="'+this.themebasedfoi.renderStyle+'"';
}else{return"";
}}};
MVThemeBasedFOIControl.prototype.getMainFOI=function(a){for(var b=0;
b<this.themebasedfoi.queryResult.foiarray.length;
b++){if(!this.themebasedfoi.queryResult.foiarray[b].scid&&this.themebasedfoi.queryResult.foiarray[b].id==a.id){return this.themebasedfoi.queryResult.foiarray[b];
}}return null;
};
MVThemeBasedFOIControl.prototype.tFoiMouseMove=function(a){a=(a)?a:((window.event)?event:null);
var f=MVUtil.getEventSource(a);
var b=f.tbf;
while(!b&&f.parentNode){f=f.parentNode;
b=f.tbf;
}if(!b){return;
}var d=f.foi;
if(!b.shouldNotUseHTMLMap(d)){node=f.node;
if(!b.themebasedfoi.clickable){return;
}}b.mouseMoveFun(d,a,f);
};
MVThemeBasedFOIControl.prototype.mouseMoveFun=function(f,b,h){var d=this;
var g=MVUtil.getMouseLocation(d.parent,b);
if(f.overlay&&h&&h.point){g=h.point;
}var a=MVSdoGeometry.createPoint(g.sdo_point.x,g.sdo_point.y,d.parent.srid);
if(d.themebasedfoi){MVUtil.runListeners(d.themebasedfoi.EventListeners,MVEvent.MOUSE_MOVE,[a,f,MVUtil.getEvent(b)]);
}};
MVThemeBasedFOIControl.prototype.clearFOINode=function(b){var d=b.node;
tbf=this;
var f=function(g){MVUtil.clearNode(g,tbf.parent.errorHandler);
if(g.parentNode){MVUtil.discardNode(g);
}};
if(d){if(d instanceof Array){for(var a=0;
a<d.length;
a++){f(d[a]);
}}else{f(d);
}b.node=null;
}d=b.labelNode;
if(d){if(d instanceof Array){for(var a=0;
a<d.length;
a++){f(d[a]);
}}else{f(d);
}b.labelNode=null;
}d=b.areaNode;
if(d){if(d instanceof Array){for(var a=0;
a<d.length;
a++){f(d[a]);
}}else{f(d);
}b.areaNode=null;
}};
MVThemeBasedFOIControl.prototype.showFOIList=function(a,l){var v=document.createElement("table");
var g=document.createElement("tbody");
v.appendChild(g);
var n=this;
for(var b=0;
b<l.length;
b++){var z=l[b];
var d=null;
var k=z.imgurl;
var u=z.name!=null&&z.name!=""?MVUtil.strReplaceAll(z.name," ","&nbsp;"):z.id;
var w=document.createElement("tr");
g.appendChild(w);
var t=document.createElement("td");
var s=document.createElement("td");
w.appendChild(t);
w.appendChild(s);
if(n.FOIType==1&&n.themebasedfoi.getFOIMarker()){k=n.themebasedfoi.getFOIMarker().imgURL;
z.width=n.themebasedfoi.getFOIMarker().width;
z.height=n.themebasedfoi.getFOIMarker().height;
}var f=null;
var h=k.toLowerCase().indexOf(".png")==-1?false:true;
if(MVGlobalVariables.browser=="IF"&&h){f=MVUtil.createImageNode(k,true);
}else{f=document.createElement("img");
f.src=k;
}f.style.width=MVUtil.pixel(z.width);
f.style.height=MVUtil.pixel(z.height);
f.tbf=n;
f.foi=z;
f.onmouseover=n.tFoiMouseOver;
f.onmouseout=n.tFoiMouseOut;
f.onmousemove=n.tFoiMouseMove;
f.point=a;
if(n.themebasedfoi.minClickableLevel<=n.parent.zoomLevel){if(n.themebasedfoi.clickable){f.style.cursor=n.themebasedfoi.cursorStyle;
}MVUtil.setListener(f,"mousedown",n.getMouseDownLocation,true);
MVUtil.setListener(f,"mouseup",n.tFoiMouseUp,true);
if(MVGlobalVariables.browser=="IF"&&!n.shouldNotUseHTMLMap(z)){f.oncontextmenu=function(){return false;
};
}else{f.oncontextmenu=n.tFoiRightClick;
}f.ondblclick=n.stopEvent;
f.onclick=n.stopPropagation;
f.onkeyup=n.stopPropagation;
}else{MVUtil.setListener(f,"mousedown",null);
MVUtil.setListener(f,"mouseup",null);
if(MVGlobalVariables.browser=="IF"&&!n.shouldNotUseHTMLMap(z)){f.oncontextmenu=function(){return false;
};
}else{f.oncontextmenu=null;
}f.ondblclick=null;
f.onclick=null;
f.onkeyup=null;
}t.appendChild(f);
var r=document.createElement("a");
r.style.cssText="font:11px normal Tahoma;color: #000000";
r.href="javascript:void(0);";
r.index=b;
r.onclick=function(m){m=(m)?m:((window.event)?event:null);
if(!n.themebasedfoi.clickable){return;
}var D=l[this.index];
if(D.onClickListener||(n.themebasedfoi.EventListeners[MVEvent.MOUSE_CLICK]!=null&&n.themebasedfoi.EventListeners[MVEvent.MOUSE_CLICK].length!=0)){n.parent.stopDragging();
if(n.themebasedfoi.onClickListener){n.themebasedfoi.onClickListener(a,D,MVUtil.getEvent(m));
}MVUtil.runListeners(n.themebasedfoi.EventListeners,MVEvent.MOUSE_CLICK,[a,D,MVUtil.getEvent(m)]);
}else{if(D.attrs!=null&&D.attrs.length>=1&&n.themebasedfoi.infoWindow){var B=new MVInfoWindowTab(D.infoTitle,D.infoStr);
var A=new Array(B);
var C=D.name==null?"":MVUtil.strReplaceAll(D.name," ","&nbsp;");
n.parent.infoLayer.showAttributesWindow(D.attrs,D.attrnames,D.id,C,a.sdo_point.x,a.sdo_point.y,null,null,n.themebasedfoi,300);
return;
}}};
r.innerHTML=u;
s.appendChild(r);
}var o=MVUtil.checkRealSize(n.parent,v);
if(o.width+MVInfoWindowStyle4.MultiFeatureListTotalMarginWidth<n.themebasedfoi.listWidth&&o.height+MVInfoWindowStyle4.TotalMarginHeight<n.themebasedfoi.listHeight){n.parent.showOverLayerMarkWindow(a,v);
}else{n.parent.showOverLayerMarkWindow(a,v,n.themebasedfoi.listWidth,n.themebasedfoi.listHeight);
}};
MVThemeBasedFOIControl.prototype.hideFOIList=function(d,f){var b=this.parent;
var a=function(){if(b.infoLayer&&b.infoLayer.mouseOnInfoWindow||b.infoLayer2&&b.infoLayer2.mouseOnInfoWindow){b.removeOverLayerWindow=setTimeout(a,100);
}else{b.removeOverLayerMarkWindow();
clearTimeout(b.removeOverLayerWindowTime);
}};
b.removeOverLayerWindow=setTimeout(a,100);
};
MVThemeBasedFOIControl.prototype.getFOILocation=function(b){var a=(this.parent.mapCenterX-this.centerX)*this.parent.pixPerX;
var f=(this.parent.mapCenterY-this.centerY)*this.parent.pixPerY;
var d;
if(b.wr&&b.wr.length>0){d=MVUtil.getScreenXY(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.realWidth,this.realHeight,b.x+b.wr[0]*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX),b.y);
}else{d=MVUtil.getScreenXY(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.realWidth,this.realHeight,b.x,b.y);
}d[0]-=a;
d[1]+=f;
d[0]+=this.themebasedfoi.xOffset;
d[1]+=this.themebasedfoi.yOffset;
if(MVGlobalVariables.browser=="IF"){d[1]++;
}else{}if(b.height%2==0){d[1]--;
}return d;
};
MVThemeBasedFOIControl.prototype.touchAndHold=function(a){var d=MVUtil.getEventSource(a);
var b=d.tbf;
while(!b&&d.parentNode){d=d.parentNode;
b=d.tbf;
}if(!b){return;
}b.parent.cancelTouchAndHold();
if(!b.parent.touchBehavior||!b.parent.touchBehavior.touchHold||b.parent.touchBehavior.touchHold=="mouse_right_click"){b.tFoiRightClick(a);
}else{if(b.parent.touchBehavior.touchHold=="mouse_over"){b.tFoiMouseOver(a);
}}};
MVThemeBasedFOIControl.prototype.cancelTouchAndHold=function(){if(this.tapHoldTimeOut){clearTimeout(this.tapHoldTimeOut);
this.tapHoldTimeOut=null;
}};
MVThemeBasedFOIControl.prototype.getSelectedFOIByMouseLocation=function(g){var m=this.getMouseCoords(g);
var n=m.x;
var l=m.y;
var s=this.themebasedfoi.getFOIData();
var k=0;
if(s!=null){var d=s.length;
var a=0;
for(a=0;
a<d;
a++){var r=s[a];
var f=r.vertx;
var b=r.verty;
var h=r.vertMBR;
if(f!=null&&b!=null){var o=f.length;
k=MVUtil.pointInPolygonTest(n,l,o,f,b,h);
if(k){return r;
}}}}return null;
};
MVThemeBasedFOIControl.prototype.getMouseCoords=function(d){var f=this.parent.getEventCoords(d);
var b=this.transImgLayerLeft;
var k=this.transImgLayerTop;
var m=0;
var h=0;
var n=MVUtil.getLeft(this.parent.div);
var l=MVUtil.getTop(this.parent.div);
var g=(this.adjustedMinX-this.minX)*this.parent.pixPerX;
var a=(this.maxY-this.adjustedMaxY)*this.parent.pixPerY;
m=f.left-(b+n);
h=f.top-(k+l);
return{x:m,y:h};
};
function MVInfoLayerControl(d,f,b,a){this.minX;
this.minY;
this.maxX;
this.maxY;
this.width=d.getPaneWidth();
this.height=d.getPaneHeight();
this.parent=d;
this.wininfo=null;
this.div=document.createElement("div");
this.div.style.position="absolute";
this.div.style.zIndex="3000";
this.parent.info_div.appendChild(this.div);
this.infoTip=document.createElement("div");
this.infoTip.style.position="absolute";
this.infoTip.style.padding="1px 3px";
this.infoTip.style.color="rgb(87,87,87)";
if(MVGlobalVariables.browser=="SF"){this.infoTip.style.background="-webkit-gradient(linear, left top, left bottom, from(white), color-stop(0.5, rgb(245,246,250)), to(rgb(228, 229, 240)))";
}else{if(MVGlobalVariables.browser=="NS"){this.infoTip.style.background="-moz-linear-gradient(top, white 30%, rgb(228, 229, 240))";
}else{if(MVGlobalVariables.checkBrowser("msie")){this.infoTip.style.filter="progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr='#FFFFFF', EndColorStr='#E4E5F0')";
}else{this.infoTip.style.backgroundColor="#E4E5F0";
}}}this.infoTip.style.whiteSpace="nowrap";
this.infoTip.style.border="solid rgb(118,118,118) 1px";
this.infoTip.style.visibility="hidden";
this.infoTip.style.zIndex="1200";
this.parent.div.appendChild(this.infoTip);
MVUtil.setLeftTop(this.infoTip,0,0);
this.infoWindows=new Array(0);
this.enablePropagation=false;
this.mouseOver=false;
this.id=f;
}MVInfoLayerControl.prototype.enableEventPropagation=function(a){this.enablePropagation=a;
};
MVInfoLayerControl.prototype.hideTopNode=function(){};
MVInfoLayerControl.prototype.hideInfoTip=function(){this.infoTip.style.visibility="hidden";
};
MVInfoLayerControl.prototype.refresh=function(d,a,m,l,b,k){MVUtil.setLeftTop(this.div,0,0);
this.minX=d;
this.minY=a;
this.maxX=m;
this.maxY=l;
this.width=b;
this.height=k;
var g=0;
for(;
g<this.infoWindows.length;
g++){var f=MVUtil.getScreenCoordinates(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.width,this.height,this.infoWindows[g].winX,this.infoWindows[g].winY);
this.infoWindows[g].style.visibility="hidden";
MVUtil.setLeftTop(this.infoWindows[g],f.x,f.y);
if(this.infoWindows[g].winX>=this.parent.mapWindowMinLon&&this.infoWindows[g].winX<=this.parent.mapWindowMaxLon&&this.infoWindows[g].winY>=this.parent.mapWindowMinLat&&this.infoWindows[g].winY<=this.parent.mapWindowMaxLat){this.infoWindows[g].style.visibility="visible";
}}};
MVInfoLayerControl.prototype.getContainer=function(){return this.div;
};
MVInfoLayerControl.prototype.showTextTip=function(b,a,g){this.infoTip.innerHTML=b;
if(MVGlobalVariables.browser=="NS"&&navigator.userAgent.toLowerCase().indexOf("netscape")>0){var f=MVUtil.strReplaceAll(b.toLowerCase(),"&nbsp;"," ").length;
this.infoTip.style.width=MVUtil.pixel(f*8+8);
}var d=MVUtil.getScreenCoordinates(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.width,this.height,a,g);
MVUtil.setLeftTop(this.infoTip,d.x+10,d.y+5);
this.infoTip.style.visibility="visible";
};
MVInfoLayerControl.prototype.hasInfoWindow=function(){return this.infoWindows.length>0;
};
MVInfoLayerControl.prototype.showInfoWindow=function(C,r,n,N,g,s,I,J,k,b,f,L){if(MVInfoWindowStyle1.redrawHandle){clearTimeout(MVInfoWindowStyle1.redrawHandle);
MVInfoWindowStyle1.redrawHandle=null;
}var l=this.parent.mvId+"_"+this.id;
if(MVInfoWindowStyle4.redrawHandle&&MVInfoWindowStyle4.redrawHandle[l]){clearTimeout(MVInfoWindowStyle4.redrawHandle[l]);
MVInfoWindowStyle4.redrawHandle[l]=null;
}if(J==null||J==""){J=MVGlobalVariables.defaultInfoStyle;
}if(b){this.mouseOver=true;
}else{this.mouseOver=false;
}this.hideInfoTip();
var O=this.parent;
if(N==null||N.length==0){return;
}if(!g){g=0;
}else{if(g<0){g=0;
}else{if(g>N.length-1){g=N.length-1;
}}}var G=0;
for(;
G<this.infoWindows.length;
G++){if(C&&this.infoWindows[G].nid==C){this.deleteInfoWindow(this.infoWindows[G]);
return;
}}if(this.infoWindows.length>0){this.deleteInfoWindow(this.infoWindows[0]);
}var Q=document.createElement("div");
var F=this;
var a=function(h){h=(h)?h:((window.event)?event:null);
var w=!F.enablePropagation;
if(h&&!F.enablePropagation){if(MVGlobalVariables.browser=="IF"){h.cancelBubble=true;
}else{if(h.stopPropagation){h.stopPropagation();
}}}};
var o=function(h){F.mouseOnInfoWindow=true;
if(F.div){F.div.style.zIndex=3001;
}a(h);
};
var u=function(h){F.mouseOnInfoWindow=false;
if(F.div){F.div.style.zIndex=3000;
}a(h);
};
Q.id="mvinfodiv"+this.id;
Q.onmousedown=MVUtil.closureWrapper(Q,a);
Q.onmouseup=MVUtil.closureWrapper(Q,a);
if(MVGlobalVariables.touchSupported){Q.ontouchstart=MVUtil.closureWrapper(Q,function(h){h.stopPropagation();
h.preventDefault();
});
}Q.onmousemove=MVUtil.closureWrapper(Q,a);
Q.onmouseover=MVUtil.closureWrapper(Q,o);
Q.onmouseout=MVUtil.closureWrapper(Q,u);
Q.ondblclick=MVUtil.closureWrapper(Q,a);
Q.onclick=MVUtil.closureWrapper(Q,a);
Q.onkeyup=MVUtil.closureWrapper(Q,a);
if(MVGlobalVariables.browser=="OS"){Q.onkeypress=MVUtil.closureWrapper(Q,a);
}else{Q.onkeydown=MVUtil.closureWrapper(Q,a);
}var E=MVUtil.getScreenCoordinates(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.width,this.height,r,n);
Q.style.position="absolute";
Q.style.visibility="hidden";
this.div.appendChild(Q);
if(J!="MVInfoWindowStyle1"&&J!="MVInfoWindowStyle4"){var D=document.createElement("div");
if(s){D.style.width=s;
}if(I){D.style.height=I;
}D.innerHTML=N[0].getContent();
Q.appendChild(D);
var M=document.getElementById("mvinfotable_"+this.parent.mvId);
var H=document.getElementById("mvinfotable1_"+this.parent.mvId);
var P=0,d=0;
if(M!=null&&H!=null){if(M.offsetWidth<=H.offsetWidth){P=H.offsetWidth+45;
}else{P=M.offsetWidth+45;
}s=P;
}if(P>s){s=P;
}if(M!=null&&H!=null){M.style.width=s+"px";
if(M.offsetHeight<=H.offsetHeight){d=H.offsetHeight+40;
}else{d=M.offsetHeight+40;
}}if(d>I){I=d;
}Q.removeChild(D);
}this.wininfo=null;
if(this.domDiv){this.wininfo=new MVInfoWindow(Q,0,0,null,g,s,I,J,false,this,E,{hideCloseButton:true},this.domDiv,this.id);
}else{if(J=="MVInfoWindowStyle4"&&N.length>1){if(!s||s=="undefined"||s<MVGlobalVariables.infoWindowTabsWidth){s=MVGlobalVariables.infoWindowTabsWidth;
}if(!I||I=="undefined"||I<MVGlobalVariables.infoWindowTabsHeight){I=MVGlobalVariables.infoWindowTabsHeight;
}}this.wininfo=new MVInfoWindow(Q,0,0,N,g,s,I,J,b,this,E,f,null,this.id);
}this.infoWindows.push(Q);
Q.nid=C;
Q.winX=r;
Q.winY=n;
MVUtil.setLeftTop(Q,E.x,E.y);
Q.style.visibility="visible";
Q.style.zIndex="1200";
if(!b){var R=0;
var m=0;
var M=null;
if(J=="MVInfoWindowStyle1"){M=document.getElementById("infowindow3table_"+this.parent.mvId);
}else{if(J=="MVInfoWindowStyle4"){M=document.getElementById("infowindow4_"+this.parent.mvId+"_"+this.id);
}}if(M!=null){s=M.offsetWidth;
M.style.width=MVUtil.pixel(s);
I=M.offsetHeight;
R=MVUtil.getLeft(M);
m=MVUtil.getTop(M);
}if(L&&(J=="MVInfoWindowStyle1"||J=="MVInfoWindowStyle4")){return;
}var z=s;
var K=I;
var v=this.parent.divLeft+E.x+R;
var t=this.parent.divTop+E.y+m;
var B=0;
var A=0;
if(v<0){if(this.parent.divLeft+E.x<v){B=this.parent.divLeft+E.x-10;
}else{B=v;
}}else{if(this.parent.divLeft+E.x<0){B=this.parent.divLeft+E.x-10;
}else{if(v+z>this.width){if(this.parent.divLeft+E.x>v+z){B=this.parent.divLeft+E.x-this.width+10;
}else{B=v+z-this.width;
}}else{if(this.parent.divLeft+E.x>this.width){B=this.parent.divLeft+E.x-this.width+10;
}}}}if(t<0){if(this.parent.divTop+E.y<t){A=this.parent.divTop+E.y-10;
}else{A=t;
}}else{if(this.parent.divTop+E.y<0){A=this.parent.divTop+E.y-10;
}else{if(t+K>this.height){if(this.parent.divTop+E.y>this.height){A=this.parent.divTop+E.y-this.height+10;
}else{A=t+K-this.height;
}}else{if(this.parent.divTop+E.y>this.height){A=this.parent.divTop+E.y-this.height+10;
}}}}if(k){this.setTimeout("this.parent.smoothScroll("+B+","+A+")",k);
}else{this.parent.smoothScroll(B,A);
}}};
MVInfoLayerControl.prototype.showFOIWindow=function(l,m,g,h,f,b,d,a,k,n){if(a==null||a==""){a=MVGlobalVariables.defaultInfoStyle;
}if(l.length==0){return;
}if(b&&d){this.showInfoWindow(l,m,g,h,f,b,d,a,null,null,n,true);
}else{if(a=="MVInfoWindowStyle4"){this.showInfoWindow(l,m,g,h,f,0,0,a,null,null,n,true);
}else{this.showInfoWindow(l,m,g,h,f,MVGlobalVariables.infoWindowWidth,MVGlobalVariables.infoWindowHeight,a,null,null,n,true);
}}};
MVInfoLayerControl.prototype.calculateInfoWindowHtml=function(d,r,g,h,n,A,w,k){var b=new Array(4);
if(!r){r="null";
}r=MVUtil.strReplaceAll(r," &nbsp;","  ");
var t=0;
var C=0;
var m="";
var f=12;
if(r!="null"){if(A){b[3]=r;
}else{t=r.length;
C++;
m="<tr><td>"+this.replaceWhiteSpace(r)+"</td></tr>";
}}m="<table id='mvinfotable_"+this.parent.mvId+"'>"+m;
if(g==null||g.length==0){b[0]=m;
if(w=="MVInfoWindowStyle1"){b[1]=0;
b[2]=0;
}else{b[1]=r.length*f+36;
b[2]=27+30;
}return b;
}var o=0;
var z=0;
C+=g.length;
var D;
if(w=="MVInfoWindowStyle1"){if(k){D=k.attrTableStyle;
}else{if(MVInfoWindowStyle1.defaultStyleParameters){D=MVInfoWindowStyle1.defaultStyleParameters.attrTableStyle;
}}}else{if(w=="MVInfoWindowStyle4"){if(k){D=k.attrTableStyle;
}else{if(MVInfoWindowStyle4.defaultStyleParameters){D=MVInfoWindowStyle4.defaultStyleParameters.attrTableStyle;
}}}}if(D==null||D==undefined){D="";
}m+="<tr><td><table id='mvinfotable1_"+this.parent.mvId+"' style='"+D+"'>";
for(var B=0;
B<g.length;
B++){var u="#bbbbbb";
if(B%2==0){u="#dddddd";
}if(h!=null&&h[B]!=null&&h[B].length>o){o=h[B].length;
}if(g[B]==null){g[B]="";
}if(g[B].length>z){z=g[B].length;
}var s=this.replaceWhiteSpace(g[B]);
if(D!=null&&D!=""){m=m+"<tr>";
}else{m=m+"<tr bgcolor="+u+">";
}if(h!=null){var v="";
if(h[B]==null){v="&nbsp;";
}else{v=this.replaceWhiteSpace(h[B])+":";
}m=m+"<td>"+v+"</td>";
}m=m+"<td align=left>"+s+"</td></tr>";
}var l;
if(t>(o+z)){l=(t+1)*f+40;
}else{l=(o+z+1)*f+40;
}b[0]=m+"</table></td></tr></table>";
if(w=="MVInfoWindowStyle1"||w=="MVInfoWindowStyle4"){b[1]=0;
b[2]=0;
}else{b[1]=l;
b[2]=C*11+80;
}return b;
};
MVInfoLayerControl.prototype.showAttributesWindow=function(f,g,a,s,n,m,b,z,w,l,d){var r=w.theme;
var t=w.infoWindowStyle?w.infoWindowStyle:MVGlobalVariables.defaultInfoStyle;
var v=w.nameAsInfoWindowTitle;
var A=w.infoWindowTitle;
var k=w.infoWindowStyleParameters;
if(a.length==0&&s.length==0){return;
}if(b&&z){var h=new MVInfoWindowTab(A,f);
var u=new Array(h);
this.showInfoWindow(a,n,m,h,0,b,z,t,l,d,k,true);
}else{var o=this.calculateInfoWindowHtml(a,s,f,g,r,(t=="MVInfoWindowStyle1"||t=="MVInfoWindowStyle4")&&v,t,k);
var h=new MVInfoWindowTab(A?A:o[3],o[0]);
var u=new Array(h);
if(o[1]>0&&o[2]>0||t=="MVInfoWindowStyle1"||t=="MVInfoWindowStyle4"){this.showInfoWindow(a,n,m,u,0,o[1],o[2],t,l,d,k,true);
}else{this.showInfoWindow(a,n,m,u,0,MVGlobalVariables.infoWindowWidth,MVGlobalVariables.infoWindowHeight,t,l,d,k,true);
}}};
MVInfoLayerControl.prototype.showHtmlWindow=function(a,m,k,d,f,b,l,n){var g=new MVInfoWindowTab(l,a);
var h=new Array(g);
this.showInfoWindow("",m,k,h,0,d,f,b,null,null,n);
};
MVInfoLayerControl.prototype.deleteInfoWindow=function(b){if(MVInfoWindowStyle1.redrawHandle){clearTimeout(MVInfoWindowStyle1.redrawHandle);
MVInfoWindowStyle1.redrawHandle=null;
}var d=this.parent.mvId+"_"+this.id;
if(MVInfoWindowStyle4.redrawHandle&&MVInfoWindowStyle4.redrawHandle[d]){clearTimeout(MVInfoWindowStyle4.redrawHandle[d]);
MVInfoWindowStyle4.redrawHandle[d]=null;
}var a=0;
for(a=0;
a<this.infoWindows.length;
a++){if(this.infoWindows[a]==b){this.infoWindows.splice(a,1);
}}MVUtil.freeMemory(b);
MVUtil.clearNode(b,this.parent.errorHandler);
this.div.removeChild(b);
this.mouseOnInfoWindow=false;
};
MVInfoLayerControl.prototype.setTimeout=function(timeoutHandler,elapseTime){var Ie="tempVar"+MV_timeoutCounter;
MV_timeoutCounter++;
eval(Ie+" = this;");
var oi=timeoutHandler.replace(/\\/g,"\\\\");
oi=oi.replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");'+Ie+" = null;",elapseTime);
};
MVInfoLayerControl.prototype._setTimeoutDispatcher=function(func){eval(func);
};
MVInfoLayerControl.prototype.scrollInfoLayer=function(){for(var a=0;
a<this.infoWindows.length;
a++){if(this.infoWindows[a].winX<this.parent.mapWindowMinLon||this.infoWindows[a].winX>this.parent.mapWindowMaxLon||this.infoWindows[a].winY<this.parent.mapWindowMinLat||this.infoWindows[a].winY>this.parent.mapWindowMaxLat){this.infoWindows[a].style.visibility="hidden";
}else{this.infoWindows[a].style.visibility="visible";
}}};
MVInfoLayerControl.prototype.replaceWhiteSpace=function(b){var a=b.indexOf("<");
if(a>=0&&b.indexOf(">",a)>=0){return b;
}b=b.replace(" ","&nbsp;");
return MVUtil.strReplaceAll(b,"  "," &nbsp;");
};
MVInfoLayerControl.prototype.destroy=function(){MVUtil.clearNode(this.div,this.parent.errorHandler);
MVUtil.clearNode(this.infoTip,this.parent.errorHandler);
if(this.div.parentNode){this.div.parentNode.removeChild(this.div);
}if(this.infoTip.parentNode){this.infoTip.parentNode.removeChild(this.infoTip);
}this.infoTip=null;
this.div=null;
if(this.infoWindows&&this.infoWindows.length>0){this.infoWindows.pop();
}};
MVInfoLayerControl.prototype.showTabbedHtmlWindow=function(g,b,k,a,f,h,g,d){this.showInfoWindow(null,b,k,g,d,a,f,"MVInfoWindowStyle4",null,null,h);
};
function MVFOI(a,h,b,g,f,d){if(!a||a.length==0){MVi18n.reportError("MVFOI.constructor","MAPVIEWER-05503");
return null;
}this.parent=null;
this.id=MVUtil.strTrim(a);
this.geom=h;
this.gtype=h.getGType();
this.style=b;
this.serverURL=g;
this.imgURL="";
this.infoStr=null;
this.html="";
this.htmlAlign="";
this.htmlVAlign="";
this.area="";
this.ords=null;
this.MBR=new Array(4);
this.infoTip=null;
this.width=0;
this.height=0;
this.clickable=true;
this.visible=true;
this.displayed=false;
this.topFlag=false;
this.showInfoWindow=true;
this.showTip=true;
this.onClickListener=null;
this.onRightClickListener=null;
this.onMouseOverListener=null;
this.onMouseOutListener=null;
this.EventListeners=new Object();
this.bringToTopOnMouseOver=true;
this.windowW=0;
this.windowH=0;
this.enablePropagation=true;
this.cursorStyle=null;
this.foiControl=null;
this.imgNode=null;
this.node=null;
if(this.gtype%10==1){if(!f){this.width=10;
}else{if(f>0){this.width=f;
}}if(!d){this.height=10;
}else{if(d>0){this.height=d;
}}}this.infoStyle=null;
this.infoTitle=null;
this.infoWindowStyleParameters=null;
this.zindex=100;
this.oldZIndex=100;
this.imageFormat=null;
this.bgColor=null;
this.isHTMLFOI=null;
this.origgeom=null;
this.wr=null;
this.origFOI=null;
this.cloneFOI=null;
this.areacode=null;
this.createMarker=false;
this.opacity=1;
this.htmlmapIdSuffix=0;
}MVFOI.prototype.setHTMLElement=function(a,b,d){this.html=a;
if(b){this.htmlAlign=b;
}if(d){this.htmlVAlign=d;
}};
MVFOI.createMarkerFOI=function(k,d,f,h,a){var g=new MVFOI(k,d,"",f,h,a);
g.createMarker=true;
if((!h||isNaN(h))||(!a||isNaN(a))){g.markerImageLoading=true;
var b=function(l,m){if(!h||isNaN(h)){h=l;
}if(!a||isNaN(a)){a=m;
}g.width=h;
g.height=a;
g.markerImageLoading=false;
};
MVUtil.getImageSize(f,b);
}return g;
};
MVFOI.createHTMLFOI=function(h,a,b,d,g){var f=new MVFOI(h,a,"","",0,0);
f.setHTMLElement(b,d,g);
f.isHTMLFOI=true;
return f;
};
MVFOI.prototype.addEventListener=function(a,b){this.setEventListener(a,b);
};
MVFOI.prototype.setEventListener=function(a,b){if(a==MVEvent.MOUSE_CLICK){this.onClickListener=b;
}else{if(a==MVEvent.MOUSE_RIGHT_CLICK){this.onRightClickListener=b;
}else{if(a==MVEvent.MOUSE_OVER){this.onMouseOverListener=b;
}else{if(a==MVEvent.MOUSE_OUT){this.onMouseOutListener=b;
}}}}if(this.displayed){this.foiControl.setClickListeners(this);
}};
MVFOI.prototype.attachEventListener=function(a,b){MVUtil.attachEventListener(this.EventListeners,a,b);
if(this.displayed&&this.foiControl){this.foiControl.setClickListeners(this);
}};
MVFOI.prototype.detachEventListener=function(a,b){MVUtil.detachEventListener(this.EventListeners,a,b);
};
MVFOI.prototype.setBringToTopOnMouseOver=function(a){this.bringToTopOnMouseOver=a;
};
MVFOI.prototype.setTopFlag=function(a){this.topFlag=a;
};
MVFOI.prototype.enableInfoWindow=function(a){this.showInfoWindow=a;
};
MVFOI.prototype.enableInfoTip=function(a){this.showTip=a;
};
MVFOI.prototype.setFOIOrds=function(a){this.ords=MVUtil.strTrim(a).toUpperCase();
};
MVFOI.prototype.setFOIGtype=function(a){this.gtype=a;
};
MVFOI.prototype.setVisible=function(a){this.visible=a;
if(this.parent){this.parent.indFOIsControl.setIndFOIVisible(this,a);
}};
MVFOI.prototype.isVisible=function(){return this.visible;
};
MVFOI.prototype.getId=function(){return this.id;
};
MVFOI.prototype.setClickable=function(a){this.clickable=a;
};
MVFOI.prototype.setInfoTip=function(a){if(a){this.clickable=true;
}this.infoTip=a;
};
MVFOI.prototype.setInfoWindow=function(h,d,a,b,g,f){this.infoStr=h;
this.windowW=d;
this.windowH=a;
this.infoStyle=b;
this.infoTitle=g;
this.infoWindowStyleParameters=f;
};
MVFOI.prototype.enableEventPropagation=function(a){this.enablePropagation=a;
};
MVFOI.prototype.setZIndex=function(a){this.zindex=a;
if(this.node){this.node.zIndex=a;
}};
MVFOI.prototype.setImageFormat=function(b,a){if(b){this.imageFormat=b.toUpperCase();
if(this.imageFormat=="PNG8"&&a){this.bgColor=a;
}}};
MVFOI.prototype.getMBR=function(){var d=new Array(4);
if(this.gtype%10==3&&this.elemInfo[2]==4){d[0]=parseFloat(this.ords[4]);
d[1]=parseFloat(this.ords[3])-Math.abs((parseFloat(this.ords[0])-parseFloat(this.ords[4])));
d[2]=parseFloat(this.ords[0]);
d[3]=parseFloat(this.ords[3]);
}else{d[0]=parseFloat(this.ords[0]);
d[1]=parseFloat(this.ords[1]);
d[2]=parseFloat(this.ords[0]);
d[3]=parseFloat(this.ords[1]);
for(var b=2;
b<this.ords.length;
b=b+2){if(parseFloat(this.ords[b])<d[0]){d[0]=parseFloat(this.ords[b]);
}if(parseFloat(this.ords[b])>d[2]){d[2]=parseFloat(this.ords[b]);
}if(parseFloat(this.ords[b+1])<d[1]){d[1]=parseFloat(this.ords[b+1]);
}if(parseFloat(this.ords[b+1])>d[3]){d[3]=parseFloat(this.ords[b+1]);
}}}return d;
};
MVFOI.prototype.reformRect=function(a){var g=a;
var k="";
var o=g.length;
for(var l=this.elemInfo.length;
l>0;
l=l-3){var w=0;
if(this.elemInfo[l-2]%10==3&&this.elemInfo[l-1]==3){for(var h=0;
h<this.elemInfo[l-3]-1;
h++){w=g.indexOf(",",w)+1;
}var v=w;
var u=w;
if(l==this.elemInfo.length){v=g.length;
for(var b=0;
b<2;
b++){u=g.indexOf(",",u)+1;
}u--;
}else{for(var d=0;
d<4;
d++){v=g.indexOf(",",v)+1;
if(d==1){u=v;
}}v--;
u--;
}k=g.substring(w,v);
var z=new Array(4);
var s=1;
var n=1;
for(var f=0;
f<4;
f++){n=k.indexOf(",",s);
if(f==3){n=k.length;
}if(f==0){s--;
}z[f]=k.substring(s,n);
s=n+1;
}var t=z[0]+","+z[3];
var r=z[2]+","+z[1];
this.elemInfo[l-1]=1;
if(l==this.elemInfo.length){g=g+","+r;
}else{this.elemInfo[l-3+3]=this.elemInfo[l-3+3]*1+4;
g=g.substring(0,v)+","+r+","+g.substring(v+1,g.length);
}g=g.substring(0,u)+","+t+","+g.substring(u+1,g.length);
}}return g;
};
MVFOI.prototype.composeOrds=function(a){var o=a[0]+","+a[1];
var d="";
for(var h=this.elemInfo.length;
h>0;
h=h-3){var m=this.elemInfo[h-3]-1;
var l=this.elemInfo[h]-1;
if(h==this.elemInfo.length){l=a.length;
}var g=a[m]+","+a[m+1];
var f="";
var k=l-1;
for(var n=m;
n<=k;
n++){f+=a[n]+",";
}var b=false;
if(a[m]!=a[l-1]||a[m+1]!=a[l]){f+=g;
b=true;
}if(this.elemInfo.length==3){return f;
}if(h==3){d=f+","+d;
}else{if(b){f+=","+o;
}else{f+=o;
}if(h==this.elemInfo.length){d=f;
}else{d=f+","+d;
}}}return d;
};
MVFOI.prototype.getDevCods=function(f){var a=new Array(this.ords.length);
var b=new Array(this.MBR[0],this.MBR[1],this.MBR[2],this.MBR[3]);
if(b[0]<f.indFOIsControl.minX){b[0]=f.indFOIsControl.minX;
}if(b[1]<f.indFOIsControl.minY){b[1]=f.indFOIsControl.minY;
}if(b[3]>f.indFOIsControl.maxY){b[3]=f.indFOIsControl.maxY;
}var g=b[3]-b[1];
for(var d=0;
d<this.ords.length;
d++){if(d%2==0){a[d]=Math.floor((this.ords[d]-b[0])*f.pixPerX+0.5);
}else{a[d]=Math.floor((g-(this.ords[d]-b[1]))*f.pixPerY+0.5);
}}b=null;
return a;
};
function getCircleArea(m,b){var h=new Array(b[0],b[1],b[2],b[3]);
if(h[0]<m.indFOIsControl.minX){h[0]=m.indFOIsControl.minX;
}if(h[1]<m.indFOIsControl.minY){h[1]=m.indFOIsControl.minY;
}if(h[3]>m.indFOIsControl.maxY){h[3]=m.indFOIsControl.maxY;
}var f=(b[2]+b[0])/2;
var d=(b[3]+b[1])/2;
var l=(b[2]-b[0])/2;
var a=h[3]-h[1];
var n;
var k="";
var o=2*Math.PI;
for(var g=0;
g<90;
g++){if(g%2==0){n=Math.floor((f+l*Math.cos((o*g)/90)-h[0])*m.pixPerX+0.5);
}else{n=Math.floor((a-(d+l*Math.sin((o*g)/90)-h[1]))*m.pixPerY+0.5);
}if(g==0){k+=n;
}else{k+=","+n;
}}h=null;
return k;
}MVFOI.prototype.getHtmlArea=function(a){if(this.area==null||this.area==""){this.area="";
if(this.gtype%10==3&&this.elemInfo[2]==4){this.area=getCircleArea(a,this.MBR);
}else{if(this.gtype%10==3||this.gtype%10==7){var b=this.getDevCods(a);
this.area=this.composeOrds(b);
}}}};
MVFOI.prototype.animateToNewLocation=function(f,g){var a=this;
var b=this.foiControl;
var d=function(k){if(k){f=k;
}if(f.equals(a.geom)){return;
}if(a.overlayFOI){var h=b.parent.getFOIGroup(a.groupId);
h.removeFOIfromOverLayerGroup(a);
b.addAndDisplayIndFOI(a);
}if(g==null){g=100;
}b.parent.indFOIsControl.foiToNewLocation(a,f,g);
};
if(this.overlayFOI){b=this.overlayFOI.foiControl;
}if(!f.srid){f.srid=b.parent.getSrid();
}if(f.srid&&(f.srid!=this.geom.srid)){f=b.parent.transformGeom(f,this.geom.srid,null,d);
}else{d();
}};
MVFOI.prototype.stopAnimation=function(){if(this.move_id!=null){clearTimeout(this.move_id);
this.move_id=null;
var a=this;
}};
MVFOI.prototype.setMouseCursorStyle=function(a){this.cursorStyle=a;
if(this.clickableNode){if(this.clickableNode instanceof Array){for(var b=0;
b<this.clickableNode.length;
b++){MVUtil.setCursor(this.clickableNode[b],a);
}}else{MVUtil.setCursor(this.clickableNode,a);
}}if(this.cloneFOI){this.cloneFOI.setMouseCursorStyle(a);
}};
MVFOI.prototype.getGeometry=function(){if(this.origgeom){return this.origgeom;
}return this.geom;
};
MVFOI.prototype.setRenderingStyle=function(d,b,a){this.style=d;
if(typeof b!="undefined"){if(b){this.width=b;
}else{this.width=0;
}}if(typeof a!="undefined"){if(a){this.height=a;
}else{this.height=0;
}}};
MVFOI.prototype.setWidth=function(a){if(!a){a=0;
}this.width=a;
};
MVFOI.prototype.setHeight=function(a){if(!a){a=0;
}this.height=a;
};
MVFOI.prototype.updateImageURL=function(d,h,b){this.imgURL=d;
var f=0;
var a=0;
if(h){f=this.width-h;
this.width=h;
}if(b){a=this.height-b;
this.height=b;
}var l=function(o,n,m,t,w,v){if(o){var u=MVUtil.getLeft(o)+n/2;
var s=MVUtil.getTop(o)+m/2;
if(v){v.src=d;
MVUtil.setLeftTop(o,u,s);
}else{if(o.src){o.src=d;
MVUtil.setLeftTop(o,u,s);
}else{if(o.childNodes.length>0&&o.childNodes[0].style.filter){var r=MVUtil.strReplaceAll(d,"(","%28");
r=MVUtil.strReplaceAll(r,")","%29");
o.childNodes[0].style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+r+"', sizingMethod='image');";
MVUtil.setLeftTop(o,u,s);
}else{t.removeIndFOI(w.id);
t.addIndFOI(w);
}}}}};
if(this.node instanceof Array){for(var g=0;
g<this.node.length;
g++){var k;
if(this.imgNode){k=this.imgNode[g];
}l(this.node[g],f,a,this.foiControl,this,k);
}}else{if(this.node){l(this.node,f,a,this.foiControl,this,this.imgNode);
}else{if(this.overlayFOI){this.serverURL=d;
this.width=h;
this.height=b;
}}}};
MVFOI.prototype.updateGeometry=function(a){var g=this.geom;
this.geom=a;
if(this.displayed){var b=this;
var d=this.foiControl;
var f=function(r){if(r){b.geom=r;
}if(b.geom.getGType()==1&&g.getGType()==1){if(b.geom.equals(g)){return;
}var w;
b.x=b.geom.getPointX();
b.x=MVUtil.keepInCSBoundary(d.parent,b.x);
b.y=b.geom.getPointY();
b.ords=b.geom.getFirstPoint();
b.ords=MVUtil.keepOrdinatesInCSBoundary(d.parent,b.ords);
b.geom.sdo_ordinates=b.ords;
if(b.ords.length>0){b.geom.sdo_point.x=b.ords[0];
}var z=(d.parent.mapCenterX-d.centerX)*d.parent.pixPerX;
var o=(d.parent.mapCenterY-d.centerY)*d.parent.pixPerY;
if(b.overlayFOI){var A=d.parent.getFOIGroup(b.groupId);
A.removeFOIfromOverLayerGroup(b);
if(!A.addFOItoOverLayerGroup(b)){d.addAndDisplayIndFOI(b);
}return;
}if(d.around){var v=b.wr;
var k=0;
var t=d.parent.msi.coverMinX;
var m=d.parent.msi.coverMaxX;
var l=m-t;
b.wr=new Array();
if(b.areacode!=null){var k=d.maparea[0].n;
k+=b.areacode;
b.wr.push(k);
}else{for(var s=0;
s<d.maparea.length;
s++){if(b.x>d.maparea[s].minx&&b.x<d.maparea[s].maxx){b.wr.push(d.maparea[s].n);
}}}var h=v==null?0:v.length;
var u=h<b.wr.length?h:b.wr.length;
for(var s=0;
s<u;
s++){w=MVUtil.getScreenXY(d.parent,d.minX,d.minY,d.maxX,d.maxY,d.width,d.height,b.x+b.wr[s]*(m-t),b.y);
w[0]-=z;
w[1]+=o;
if(b.node instanceof Array){MVUtil.setLeftTop(b.node[s],w[0]-b.width/2,w[1]-b.height/2);
}else{if(b.node){MVUtil.setLeftTop(b.node,w[0]-b.width/2,w[1]-b.height/2);
}}}if(h<b.wr.length){d.cloneFOINode(b.node,b,b.foiControl,h);
}else{for(var s=h-1;
s>=b.wr.length;
s--){b.node[s].parentNode.removeChild(b.node[s]);
MVUtil.deleteNode(b.node[s]);
b.node.pop();
b.imgNode.pop();
b.clickableNode.pop();
}}}else{w=MVUtil.getScreenXY(d.parent,d.minX,d.minY,d.maxX,d.maxY,d.width,d.height,b.x,b.y);
w[0]-=z;
w[1]+=o;
MVUtil.setLeftTop(b.node,w[0]-b.width/2,w[1]-b.height/2);
}}else{b.gtype=b.geom.getGType();
b.reDraw();
}};
if(this.overlayFOI){d=this.overlayFOI.foiControl;
}if(!this.geom.srid){this.geom.srid=d.parent.getSrid();
}if(this.geom.srid!=d.parent.getSrid()){d.parent.transformGeom(this.geom,d.parent.srid,null,f);
}else{f();
}}};
MVFOI.prototype.reDraw=function(){if(this.displayed){if(this.groupId>=0){if(this.foiControl==null){return;
}var a=this.foiControl.parent.getFOIGroup(this.groupId);
a.removeFOI(this);
a.addFOI(this);
return;
}this.foiControl.removeIndFOI(this.id);
this.foiControl.addIndFOI(this);
}};
MVFOI.prototype.setOpacity=function(b){if(isNaN(b)){return;
}if(b>1||b<0){return;
}else{this.opacity=b;
}if(this.displayed){var a=function(f){f.style.opacity=b;
if(b==1){f.style.filter="";
}else{f.style.filter="alpha(opacity="+b*100+")";
}};
if(this.node instanceof Array){for(var d=0;
d<this.node.length;
d++){a(this.node[d]);
}}else{a(this.node);
}}};
MVFOI.prototype.shouldGenerateHTMLArea=function(){if(this.onClickListener||(this.EventListeners[MVEvent.MOUSE_CLICK]!=null&&this.EventListeners[MVEvent.MOUSE_CLICK].length!=0)||this.onRightClickListener||(this.EventListeners[MVEvent.MOUSE_RIGHT_CLICK]!=null&&this.EventListeners[MVEvent.MOUSE_RIGHT_CLICK].length!=0)||this.onMouseOverListener||(this.EventListeners[MVEvent.MOUSE_OVER]!=null&&this.EventListeners[MVEvent.MOUSE_OVER].length!=0)||this.onMouseOutListener||(this.EventListeners[MVEvent.MOUSE_OUT]!=null&&this.EventListeners[MVEvent.MOUSE_OUT].length!=0)||(this.EventListeners[MVEvent.MOUSE_MOVE]!=null&&this.EventListeners[MVEvent.MOUSE_MOVE].length!=0)||this.infoStr||this.infoTip||this.cursorStyle){return true;
}else{return false;
}};
MVFOI.prototype.destroy=function(){this.node=null;
this.clickableNode=null;
this.imgNode=null;
};
MVFOI.prototype.setHighlightStyle=function(a){if(!a){return;
}if(a.fillColor&&MVUtil.strBeginWith(a.fillColor,"#")){a.fillColor=a.fillColor.substring(1);
}if(a.strokeColor&&MVUtil.strBeginWith(a.strokeColor,"#")){a.strokeColor=a.strokeColor.substring(1);
}this.highlightStyle=a;
};
MVFOI.prototype.highlight=function(){if(typeof $!="undefined"){$(this.clickableNode).mouseover();
}};
MVFOI.prototype.deHighlight=function(){if(typeof $!="undefined"){$(this.clickableNode).mouseout();
}};
function MVIndFOIsControl(a){this.indFOIArray=[];
this.parent=a;
var b=null;
this.minX=0;
this.minY=0;
this.maxX=0;
this.maxY=0;
this.lleft=0;
this.ltop=0;
this.isLoading=false;
this.div=document.createElement("div");
this.width=0;
this.height=0;
this.count=0;
this.centerX=this.parent.mapCenterX;
this.centerY=this.parent.mapCenterY;
this.onRefreshListener=null;
this.EventListeners=new Object();
this.div.style.position="absolute";
this.div.style.zIndex=a.foiLayerZIndex;
MVUtil.attachEvent(this.div,"mouseover",this.IndMouseOver,true);
MVUtil.attachEvent(this.div,"mouseout",this.IndMouseOut,true);
MVUtil.attachEvent(this.div,"mousedown",this.getMouseDownLocation,true);
MVUtil.attachEvent(this.div,"mouseup",this.IndMouseUp,true);
MVUtil.attachEvent(this.div,"dblclick",this.IndStopEvent,true);
MVUtil.attachEvent(this.div,"click",this.IndStopEvent,true);
MVUtil.attachEvent(this.div,"mousemove",this.IndMouseMove,true);
MVUtil.attachEvent(this.div,"contextmenu",this.IndRightClick,true);
MVUtil.attachEvent(this.div,"keyup",this.IndStopPropagation,true);
this.topDiv=document.createElement("div");
this.topDiv.style.position="absolute";
this.topDiv.style.zIndex=a.foiTopLayerZIndex;
MVUtil.attachEvent(this.topDiv,"mouseover",this.IndMouseOver,true);
MVUtil.attachEvent(this.topDiv,"mouseout",this.IndMouseOut,true);
MVUtil.attachEvent(this.topDiv,"mousedown",this.getMouseDownLocation,true);
MVUtil.attachEvent(this.topDiv,"mouseup",this.IndMouseUp,true);
MVUtil.attachEvent(this.topDiv,"dblclick",this.IndStopEvent,true);
MVUtil.attachEvent(this.topDiv,"click",this.IndStopEvent,true);
MVUtil.attachEvent(this.topDiv,"mousemove",this.IndMouseMove,true);
MVUtil.attachEvent(this.topDiv,"contextmenu",this.IndRightClick,true);
MVUtil.attachEvent(this.topDiv,"keyup",this.IndStopPropagation,true);
if(MVGlobalVariables.browser=="OS"){MVUtil.attachEvent(this.div,"keypress",this.IndStopPropagation,true);
MVUtil.attachEvent(this.topDiv,"keypress",this.IndStopPropagation,true);
}else{MVUtil.attachEvent(this.div,"keydown",this.IndStopPropagation,true);
MVUtil.attachEvent(this.div,"contextmenu",this.IndStopPropagation,true);
MVUtil.attachEvent(this.topDiv,"keydown",this.IndStopPropagation,true);
MVUtil.attachEvent(this.topDiv,"contextmenu",this.IndStopPropagation,true);
}if(MVGlobalVariables.browser=="IF"){MVUtil.attachEvent(this.div,"selectstart",this.IndStopPropagation,true);
MVUtil.attachEvent(this.topDiv,"selectstart",this.IndStopPropagation,true);
}this.move_id=null;
this.time=20;
if(this.parent.div.appendChild){this.parent.div.appendChild(this.div);
this.parent.div.appendChild(this.topDiv);
}else{document.body.appendChild(this.div);
document.body.appendChild(this.topDiv);
}this.mouseL1=MVSdoGeometry.createPoint(0,0);
this.mouseL2=this.mouseL1;
this.maparea=null;
this.around=false;
}MVIndFOIsControl.prototype.foiToNewLocation=function(m,l,a){if(a){m.time=a;
}else{m.time=this.time;
}var k=new Array();
var h=new Array();
if(l.getFirstPoint()){k.push(l.getPointX());
h.push(l.getPointY());
}else{var f=l.getDimensions();
for(var d=0;
d<=l.getOrdinates().length-f;
d=d+f){k.push(l.getOrdinates()[d]);
h.push(l.getOrdinates()[d+1]);
}}var b=0;
if(k.length<=b||h.length<=b){return;
}if(m.move_id){clearTimeout(m.move_id);
m.move_id=null;
}m.startX=m.x;
m.startY=m.y;
m.move_xarray=k;
m.move_yarray=h;
m.move_seq=b;
var g=m.id;
if(m.groupId>=0){g+=","+m.groupId;
}m.move_id=this.setTimeout('this.moveFoi("'+g+'")',m.time);
};
MVIndFOIsControl.prototype.moveFoi=function(w){var H=null;
var o=w.split(",");
if(o.length>1){var k=this.parent.getFOIGroup(o[1]);
H=k.getFOIById(o[0]);
}else{H=this.getIndFOI(o[0]);
}var z=H.node;
if(z instanceof Array){z=z[0];
}var C=parseInt(z.style.left);
var b=parseInt(z.style.top);
var A=H.move_seq;
var n=H.move_xarray;
var m=H.move_yarray;
var h=n[A];
var g=m[A];
if(H.tx&&H.tx.length>0){h+=H.wr[0]*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX);
}var F=0;
h=MVUtil.transLongitudeOnWarpAroungMap(this.parent,H.x,h);
if(this.around){F=H.wr[0]*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX);
}var I=MVUtil.getScreenXY(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.width,this.height,h+F,m[A]);
var J=(this.parent.mapCenterX-this.centerX)*this.parent.pixPerX;
var l=(this.parent.mapCenterY-this.centerY)*this.parent.pixPerY;
I[0]=Math.round(I[0]-J-H.width/2);
I[1]=Math.round(I[1]+l-H.height/2);
var E=I[0]-C;
var D=I[1]-b;
var d=Math.sqrt(E*E+D*D);
var K=40;
if(K>d){z.style.left=MVUtil.pixel(I[0]);
z.style.top=MVUtil.pixel(I[1]);
if(H.node instanceof Array){for(var B=1;
B<H.node.length;
B++){H.node[B].style.left=MVUtil.pixel(parseInt(H.node[B].style.left)+E);
H.node[B].style.top=MVUtil.pixel(parseInt(H.node[B].style.top)+D);
}}clearTimeout(H.move_id);
H.move_id=null;
H.geom.sdo_point.x=n[A];
H.geom.sdo_point.y=m[A];
H.x=n[A];
H.y=m[A];
A++;
if(n.length<=A||m.length<=A){return;
}if(n.length>1){H.startX=n[A-1];
}if(m.length>1){H.startY=m[A-1];
}H.move_seq=A;
var w=H.id;
if(H.groupId>=0){w+=","+H.groupId;
}H.move_id=this.setTimeout('this.moveFoi("'+w+'")',H.time);
}else{var v=Math.round(K*E/d);
var u=Math.round(K*D/d);
var t=parseInt(z.style.left)+v;
var r=parseInt(z.style.top)+u;
z.style.left=MVUtil.pixel(t);
z.style.top=MVUtil.pixel(r);
if(H.node instanceof Array){for(var B=1;
B<H.node.length;
B++){H.node[B].style.left=MVUtil.pixel(parseInt(H.node[B].style.left)+v);
H.node[B].style.top=MVUtil.pixel(parseInt(H.node[B].style.top)+u);
}}H.x=(h-H.x)/E*v+H.x;
H.y=(g-H.startY)*(H.x-H.startX)/(h-H.startX)+H.startY;
if(this.around){var f=MVUtil.keepInCSBoundary(this.parent,H.x);
var G;
if(f>H.x){G=-1;
}else{if(f<H.x){G=1;
}}if(G){H.x=f;
if(H.wr){for(var B=0;
B<H.wr.length;
B++){H.wr[B]+=G;
}}}}else{var s=this.parent.msi.coverMaxX-this.parent.msi.coverMinX;
if(H.x<this.parent.msi.coverMinX){H.x+=s;
z.style.left=MVUtil.pixel(t+s*this.parent.pixPerX);
}else{if(H.x>this.parent.msi.coverMaxX){H.x-=s;
z.style.left=MVUtil.pixel(t-s*this.parent.pixPerX);
}}}H.geom.sdo_point.x=H.x;
H.geom.sdo_point.y=H.y;
var w=H.id;
if(H.groupId>=0){w+=","+H.groupId;
}H.move_id=this.setTimeout('this.moveFoi("'+w+'")',H.time);
}};
MVIndFOIsControl.prototype.setTimeout=function(timeoutHandler,elapseTime){var Ie="tempVar"+MV_timeoutCounter;
MV_timeoutCounter++;
eval(Ie+" = this;");
var oi=timeoutHandler.replace(/\\/g,"\\\\");
oi=oi.replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");'+Ie+" = null;",elapseTime);
};
MVIndFOIsControl.prototype._setTimeoutDispatcher=function(func){eval(func);
};
MVIndFOIsControl.prototype.setSize=function(b,a){this.width=b;
this.height=a;
};
MVIndFOIsControl.prototype.setIndFOIVisible=function(g,l){var d=g.id;
for(var b=0;
b<this.indFOIArray.length;
b++){if(this.indFOIArray[b].id==d){this.indFOIArray[b].visible=l;
if(!l&&this.parent.infoLayer.infoWindows.length>0){if(this.parent.infoLayer.infoWindows[0].nid==d){this.parent.infoLayer.deleteInfoWindow(this.parent.infoLayer.infoWindows[0]);
}}}}var h=g.node;
if(g.groupId>=0){var k=this.parent.getFOIGroup(g.groupId);
l=l&&k.checkVisibility();
}if(!h&&l&&(!g.cloneFOI||!g.cloneFOI.node)){if(this.parent.layer_created){this.parent.indFOIsControl.addAndDisplayIndFOI(g,true);
}return;
}if(h instanceof Array){for(var f=0;
f<h.length;
f++){if(l){h[f].style.visibility="visible";
}else{h[f].style.visibility="hidden";
}}}else{if(h){if(l){h.style.visibility="visible";
}else{h.style.visibility="hidden";
}}if(g.cloneFOI&&g.cloneFOI.node){if(l){g.cloneFOI.node.style.visibility="visible";
}else{g.cloneFOI.node.style.visibility="hidden";
}}}};
MVIndFOIsControl.prototype.isLoading=function(){return this.isLoading;
};
MVIndFOIsControl.prototype.getLeft=function(){if(this.isLoading){return this.lleft;
}else{return MVUtil.getLeft(this.div);
}};
MVIndFOIsControl.prototype.getTop=function(){if(this.isLoading){return this.ltop;
}else{return MVUtil.getTop(this.div);
}};
MVIndFOIsControl.prototype.getLayerWidth=function(){return this.width;
};
MVIndFOIsControl.prototype.getLayerHeight=function(){return this.height;
};
MVIndFOIsControl.prototype.getMinX=function(){return this.minX;
};
MVIndFOIsControl.prototype.getMinY=function(){return this.minY;
};
MVIndFOIsControl.prototype.getMaxX=function(){return this.maxX;
};
MVIndFOIsControl.prototype.getMaxY=function(){return this.maxY;
};
MVIndFOIsControl.prototype.getContainer=function(){return this.div;
};
MVIndFOIsControl.prototype.getTopContainer=function(){return this.topDiv;
};
MVIndFOIsControl.prototype.setOnRefreshListener=function(a){this.onRefreshListener=a;
};
MVIndFOIsControl.prototype.clearIndFOI=function(d){for(var b=0;
b<this.div.childNodes.length;
b++){if(d==(this.div.childNodes[b]).id){var f=this.div.childNodes[b];
this.div.removeChild(f);
MVUtil.deleteNode(f);
return;
}}for(var b=0;
b<this.topDiv.childNodes.length;
b++){if(d==(this.topDiv.childNodes[b]).id){var f=this.topDiv.childNodes[b];
this.topDiv.removeChild(f);
MVUtil.deleteNode(f);
return;
}}};
MVIndFOIsControl.prototype.removeAll=function(){var d=this.indFOIArray.length;
for(var f=0;
f<d;
f++){var g=this.indFOIArray.pop();
if(this.parent.infoLayer.infoWindows.length>0){if(this.parent.infoLayer.infoWindows[0].nid==g.id){this.parent.infoLayer.deleteInfoWindow(this.parent.infoLayer.infoWindows[0]);
}}g.foiControl=null;
if(g.node){g.node.ifctl=null;
MVUtil.destroyNode(g.node,this.parent.errorHandler);
g.node=null;
}if(g.imgNode){MVUtil.destroyNode(g.imgNode);
g.imgNode=null;
}if(g.clickableNode){if(g.clickableNode.ifctl){g.clickableNode.ifctl=null;
}MVUtil.destroyNode(g.clickableNode);
g.clickableNode=null;
}g.geom=null;
g.parent=null;
g.MBR=null;
}this.indFOIArray=[];
MVUtil.clearNode(this.div,this.parent.errorHandler);
MVUtil.clearNode(this.topDiv,this.parent.errorHandler);
};
MVIndFOIsControl.prototype.removeIndFOI=function(d,l){var g=null;
if(l==null){for(var b=0;
b<this.indFOIArray.length;
b++){if(this.indFOIArray[b].id==d){g=this.indFOIArray[b];
if(g.cloneFOI){this.removeIndFOI(g.cloneFOI.id);
g.cloneFOI.origFOI=null;
g.cloneFOI.foiControl=null;
g.cloneFOI=null;
}if(this.parent.infoLayer.infoWindows.length>0){if(this.parent.infoLayer.infoWindows[0].nid==d){this.parent.infoLayer.deleteInfoWindow(this.parent.infoLayer.infoWindows[0]);
}}this.indFOIArray[b]=this.indFOIArray[this.indFOIArray.length-1];
g.parent=null;
MVUtil.deleteImage(this.indFOIArray.pop());
break;
}}}else{g=l;
}if(g){if(g.move_id!=null){clearTimeout(g.move_id);
g.move_id=null;
}if(g.node){var h=g.node;
if(h instanceof Array){for(var f=0;
f<h.length;
f++){h[f].parentNode.removeChild(h[f]);
MVUtil.deleteNode(h[f]);
}}else{if(g.node.parentNode){h.parentNode.removeChild(h);
MVUtil.deleteNode(h);
}}}g.destroy();
if(l){return g;
}for(var m=0;
m<this.topDiv.childNodes.length;
m++){if(this.topDiv.childNodes[m].id==d){var k=this.topDiv.childNodes[m];
MVUtil.discardNode(k);
k=null;
break;
}}}return g;
};
MVIndFOIsControl.prototype.getIndFOI=function(d){for(var b=0;
b<this.indFOIArray.length;
b++){if(d==this.indFOIArray[b].id){return this.indFOIArray[b];
}}return null;
};
MVIndFOIsControl.prototype.addIndFOI=function(a){a.parent=this.parent;
this.indFOIArray.push(a);
if(this.parent.layer_created&&(a.visible==true)){this.addAndDisplayIndFOI(a,true);
}};
MVIndFOIsControl.prototype.getFOIClippedSize=function(w){var v=w.MBR[0];
var t=w.MBR[1];
var n=w.MBR[2];
var l=w.MBR[3];
var u=(this.minX==0?v:this.minX);
var s=(this.minY==0?t:this.minY);
var m=(this.maxX==0?n:this.maxX);
var k=(this.maxY==0?l:this.maxY);
var h=v<u?u:v;
var g=t<s?s:t;
var f=n<m?n:m;
var d=l<k?l:k;
var o;
if(this.around){o=Math.abs(n-v);
}else{o=Math.abs(f-h);
}var b=Math.abs(d-g);
var r={x:h,y:d,width:o,height:b};
return r;
};
MVIndFOIsControl.prototype.addAndDisplayIndFOI=function(d,b){if(!d.geom.srid){d.geom.srid=this.parent.getSrid();
}var a=this;
var g=false;
var f=function(k){if(k){d.geom=k;
}if(d.gtype%10==1){d.ords=d.geom.getFirstPoint();
d.ords=MVUtil.keepOrdinatesInCSBoundary(a.parent,d.ords);
d.geom.sdo_ordinates=d.ords;
if(d.ords.length>0){d.geom.sdo_point.x=d.ords[0];
}}else{d.elemInfo=d.geom.sdo_elem_info.toString().split(",");
var r=d.geom.sdo_ordinates;
if(!d.origFOI){r=MVUtil.keepOrdinatesInCSBoundary(a.parent,r);
if(a.parent.wraparound){d.origgeom=d.geom.clone();
d.geom.sdo_ordinates=r;
var o=d.geom.getOrdinatesOfElements();
r=new Array();
for(var m=0;
m<o.length;
m++){r=r.concat(MVUtil.transOrdinatesOnWarpAroungMap(a.parent,o[m]));
}d.geom.sdo_ordinates=r;
}else{if(!a.parent.wraparound&&MVUtil.crossDateLine(a.parent,r)){d.origgeom=d.geom.clone();
var o=d.geom.getOrdinatesOfElements();
r=new Array();
for(var m=0;
m<o.length;
m++){r=r.concat(MVUtil.transOrdinatesOnWarpAroungMap(a.parent,o[m]));
}d.geom.sdo_ordinates=r;
g=true;
}}}r=r.toString();
while(r.indexOf(" ")!=-1){r=MVUtil.strReplaceAll(r," ","");
}for(var h=0;
h<d.elemInfo.length;
h+=3){if(d.elemInfo[h+2]*1==3){r=d.reformRect(r);
break;
}}d.ords=r.split(",");
}d.MBR=d.getMBR();
if(g&&d.ords.length>0&&!d.cloneFOI){var n=d.geom.clone();
n.sdo_ordinates=MVUtil.duplicateCrossDateLineOrds(a.parent,d.ords,d.MBR);
var l=MVUtil.cloneObject(d);
l.id="-CL"+d.id;
l.geom=n;
l.origFOI=d;
d.cloneFOI=l;
a.addIndFOI(l);
}d.x=d.MBR[0];
d.y=d.MBR[3];
if(d.gtype%10!=1){d.width=d.MBR[2]-d.MBR[0];
d.height=d.MBR[3]-d.MBR[1];
}a.postAddAndDisplayIndFOI(d,b);
};
if(d.geom.srid&&(d.geom.srid!=this.parent.srid)){this.parent.transformGeom(d.geom,this.parent.srid,null,f);
}else{f();
}};
MVIndFOIsControl.prototype.postAddAndDisplayIndFOI=function(foi,check){var styleStr=null;
if(foi.style){if(foi.style.getXMLString){styleStr=foi.style.getXMLString();
}else{styleStr=foi.style;
}}if(foi.gtype%10==1){if(styleStr){foi.imgURL=foi.serverURL+"?request=getpoiimage&version=1.0&poistyle="+encodeURIComponent(styleStr)+this.getImageParameters(foi);
if(!(foi.id.length>3&&MVUtil.strBeginWith(foi.id,"-OL"))){foi.imgURL+="&width="+foi.width+"&height="+foi.height;
}}if(this.around||foi.wr){foi.wr=new Array();
if(foi.areacode==null){var n=0;
var bbminx=this.parent.msi.coverMinX;
var bbmaxx=this.parent.msi.coverMaxX;
for(var i=0;
i<this.maparea.length;
i++){if(foi.x>this.maparea[i].minx&&foi.x<this.maparea[i].maxx){foi.wr.push(this.maparea[i].n);
}}}else{var n=this.maparea[0].n;
n+=foi.areacode;
foi.wr.push(n);
}}else{foi.wr=null;
}this.displayIndFOI(foi);
return;
}var foigeom1=foi.geom.toString();
var url;
var reqParas;
if(this.around||foi.wr){this.setDuplicatePolygonIndFOIOrds(foi);
}else{foi.wr=null;
}var reqMinX=this.minX;
var reqMaxX=this.maxX;
if(foi.wr&&foi.wr.length>0){var coverWidth=this.parent.msi.coverMaxX-this.parent.msi.coverMinX;
var tOrds=foi.geom.sdo_ordinates;
var crossdl=MVUtil.crossDateLine(this.parent,tOrds);
var middle=this.parent.msi.coverMinX+coverWidth/2;
if(crossdl){if((this.maparea.length>1||(this.maparea.length==1&&foi.MBR[2]<this.maparea[0].minx))&&foi.x<middle&&foi.x<this.parent.msi.coverMinX){foi.wr[0]++;
}else{if((this.maparea.length==1&&foi.MBR[0]>this.maparea[0].maxx)&&(foi.x>middle||foi.MBR[2]>middle)){foi.wr[0]--;
}}if(foi.width>(this.maxX-this.minX)){reqMinX=this.minX-foi.wr[0]*coverWidth;
reqMaxX=this.maxX-foi.wr[0]*coverWidth;
if(reqMinX>foi.x){foi.x=reqMinX;
}}else{reqMinX=foi.MBR[0];
reqMaxX=foi.MBR[2];
}}else{if(!crossdl&&foi.width>(this.maxX-this.minX)){reqMinX=this.minX-foi.wr[0]*coverWidth;
reqMaxX=this.maxX-foi.wr[0]*coverWidth;
if(reqMinX>foi.x){foi.x=reqMinX;
}}else{reqMinX=foi.MBR[0];
reqMaxX=foi.MBR[2];
}}}else{if(this.maxX>this.parent.msi.coverMaxX){reqMaxX=this.parent.msi.coverMaxX;
}if(this.minX<this.parent.msi.coverMinX){reqMinX=this.parent.msi.coverMinX;
}if(foi.MBR[2]>this.parent.msi.coverMaxX){foi.MBR[2]=this.parent.msi.coverMaxX;
}if(foi.MBR[0]<this.parent.msi.coverMinX){foi.MBR[0]=this.parent.msi.coverMinX;
foi.x=foi.MBR[0];
}}var reqMinY=this.minY;
var reqMaxY=this.maxY;
if(this.maxY>this.parent.msi.coverMaxY){reqMaxY=this.parent.msi.coverMaxY;
}if(this.minY<this.parent.msi.coverMinY){reqMinY=this.parent.msi.coverMinY;
}if(foi.MBR[1]<this.parent.msi.coverMinY){foi.MBR[1]=this.parent.msi.coverMinY;
}if(foi.MBR[3]>this.parent.msi.coverMaxY){foi.MBR[3]=this.parent.msi.coverMaxY;
foi.y=foi.MBR[3];
}reqMinX=Math.floor(reqMinX*this.parent.pixPerX)/this.parent.pixPerX;
reqMaxX=Math.ceil(reqMaxX*this.parent.pixPerX)/this.parent.pixPerX;
reqParas="&version=1.0&ratx="+this.parent.pixPerX+"&raty="+this.parent.pixPerY+"&bbox="+reqMinX+":"+reqMinY+":"+reqMaxX+":"+reqMaxY+this.getImageParameters(foi);
url=foi.serverURL+"?request=getfigimage"+reqParas+"&figord="+foigeom1;
if(MVGlobalVariables.browser=="IF"){url+="&figstyle="+encodeURIComponent(encodeURIComponent(styleStr));
}else{url+="&figstyle="+encodeURIComponent(styleStr);
}try{var indFOICtrl=this;
var localDomain=MVUtil.isLocalDomain(foi.serverURL);
var xmlHttp=localDomain||MVMapView.XMLHTTPEnabled;
var req=MVUtil.getXMLHttpRequest(xmlHttp);
req.open("POST",MVUtil.getXMLHttpUrl(foi.serverURL),true);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.onreadystatechange=MVUtil.closureWrapper(req,function(){try{if(this.readyState!=4){return;
}if(this.status==200){if(this.responseText.indexOf("imgurl")>=0){var res=null;
eval("res="+this.responseText);
foi.imgURL=res.imgurl;
if(res.area&&res.area!=""){foi.area=res.area;
}else{foi.area=null;
}if(res.io){foi.io=res.io;
}if(res.geomMBR){foi.MBR=res.geomMBR;
foi.x=foi.MBR[0];
foi.y=foi.MBR[3];
if(foi.gtype%10!=1){foi.width=foi.MBR[2]-foi.MBR[0];
foi.height=foi.MBR[3]-foi.MBR[1];
}}if(check){if(foi.topFlag){for(var td=0;
td<indFOICtrl.topDiv.childNodes.length;
td++){if(indFOICtrl.topDiv.childNodes[td].id==foi.id){MVUtil.discardNode(indFOICtrl.topDiv.childNodes[td]);
break;
}}}else{for(var td=0;
td<indFOICtrl.div.childNodes.length;
td++){if(indFOICtrl.div.childNodes[td].id==foi.id){MVUtil.discardNode(indFOICtrl.div.childNodes[td]);
break;
}}}}indFOICtrl.displayIndFOI(foi);
}}}catch(e){MVi18n.reportError("MVIndFOIsControl.postAddAndDisplayIndFOI","MAPVIEWER-05500",e,indFOICtrl.parent?indFOICtrl.parent.errorHandler:null);
}});
req.send(MVUtil.getXMLHttpReq(foi.serverURL,"request=getfig"+reqParas+"&figord="+foigeom1+"&figstyle="+encodeURIComponent(styleStr)));
}catch(ex){MVi18n.reportError("MVIndFOIsControl.postAddAndDisplayIndFOI","MAPVIEWER-05511",ex,this.parent?this.parent.errorHandler:null);
}};
MVIndFOIsControl.prototype.getAllIndFOIs=function(){return this.indFOIArray;
};
MVIndFOIsControl.prototype.refreshIndFOIs=function(f,b,k,h){this.isLoading=true;
this.parent.do_GetMinMaxLonLat();
this.minX=f;
this.minY=b;
this.maxX=k;
this.maxY=h;
this.centerX=this.parent.mapCenterX;
this.centerY=this.parent.mapCenterY;
this.lleft=Math.ceil((this.minX-this.parent.mapWindowMinLon)*this.parent.pixPerX);
this.ltop=-Math.ceil((this.maxY-this.parent.mapWindowMaxLat)*this.parent.pixPerY);
MVUtil.setLeftTop(this.div,this.lleft,this.ltop);
MVUtil.setLeftTop(this.topDiv,this.lleft,this.ltop);
MVUtil.clearNode(this.div,this.parent.errorHandler);
MVUtil.clearNode(this.topDiv,this.parent.errorHandler);
this.getMapBBOXArray();
this.around=this.parent.wrapAroundLayer(this.getLayerWidth());
if(this.onRefreshListener){this.onRefreshListener;
}MVUtil.runListeners(this.EventListeners,"refreshFOI");
MVUtil.clearNode(this.div,this.parent.errorHandler);
MVUtil.clearNode(this.topDiv,this.parent.errorHandler);
for(var d=0;
d<this.indFOIArray.length;
d++){var g=this.indFOIArray[d];
g.node=null;
if(g.move_id!=null){clearTimeout(g.move_id);
}this.addAndDisplayIndFOI(g,true);
}};
MVIndFOIsControl.prototype.setClickListeners=function(b){var d=this;
if(b.clickable){var f=function(g){if(b.imgURL&&b.gtype%10!=1&&!d.shouldUseDivFilter(b)){var h="0,0";
if(b.area.length>0){h=b.area;
}g.setAttribute("shape","poly");
g.setAttribute("coords",h);
if((b.onClickListener||(b.EventListeners[MVEvent.MOUSE_CLICK]!=null&&b.EventListeners[MVEvent.MOUSE_CLICK].length!=0)||((b.showInfoWindow&&b.infoStr)))&&MVGlobalVariables.browser!="OS"){g.setAttribute("href","javascript:void(0)");
}}if(b.onClickListener||(b.EventListeners[MVEvent.MOUSE_CLICK]!=null&&b.EventListeners[MVEvent.MOUSE_CLICK].length!=0)||(b.showInfoWindow&&b.infoStr)){MVUtil.setCursor(g,"pointer");
}};
if(b.clickableNode instanceof Array){for(var a=0;
a<b.clickableNode.length;
a++){f(b.clickableNode[a]);
}}else{f(b.clickableNode);
}}if(b.cursorStyle){if(b.clickableNode instanceof Array){for(var a=0;
a<b.clickable.length;
a++){MVUtil.setCursor(b.clickableNode[a],b.cursorStyle);
}}else{MVUtil.setCursor(b.clickableNode,b.cursorStyle);
}}};
MVIndFOIsControl.prototype.displayIndFOI=function(w){if(w.parent==null||w.parent!=this.parent){return;
}w.displayed=true;
w.foiControl=this;
var o;
if(w.wr&&w.wr.length>0){o=MVUtil.getScreenXY(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.width,this.height,w.x+w.wr[0]*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX),w.y);
}else{o=MVUtil.getScreenXY(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.width,this.height,w.x,w.y);
}var s=(this.parent.mapCenterX-this.centerX)*this.parent.pixPerX;
var h=(this.parent.mapCenterY-this.centerY)*this.parent.pixPerY;
var f;
var n=MVUtil.strEndWith(w.imgURL.toLowerCase(),"png");
if(!(MVGlobalVariables.browser=="IF"&&MVGlobalVariables.browserMajorVersion<9&&(w.style!=""||n))&&!w.html){if(w.gtype%10==1){f=document.createElement("img");
}else{f=document.createElement("div");
}}else{f=document.createElement("div");
}var d=w.visible;
if(w.groupId>=0){var u=this.parent.getFOIGroup(w.groupId);
d=d&&u.checkVisibility();
}if(d){f.style.visibility="visible";
}else{f.style.visibility="hidden";
}f.style.position="absolute";
var r=false;
for(var k=0;
k<this.parent.mapLayers.length;
k++){if(this.parent.mapLayers[k].layerControl&&this.parent.mapLayers[k].layerControl.zoomControl&&!this.parent.mapLayers[k].layerControl.zoomControl.hasZoomFinished()){r=true;
f.style.display="none";
break;
}}f.ifctl=this;
if(w.groupId>=0){f.groupid=w.groupId;
}var t=this;
var b=w.enablePropagation;
w.clickableNode=f;
w.node=f;
if(w.imgURL){f.className="noprint";
if(!d){f.style.visibility="hidden";
}if(w.id&&w.id!=null){f.id=w.id;
}f.origX=w.x;
f.origY=w.y;
f.style.zIndex=w.zindex;
if(w.groupId>=0){var u=this.parent.getFOIGroup(w.groupId);
u.addFOIDIV(f,w);
}else{if(w.topFlag){this.topDiv.appendChild(f);
}else{this.div.appendChild(f);
}}if(w.gtype%10!=1){this.displayPolygonIndFOI(f,o,s,h,w);
this.cloneFOINode(f,w,t);
}else{var g=function(){if(w.markerImageLoading){setTimeout(g,200);
return;
}t.displayPointIndFOI(f,o,s,h,w);
t.cloneFOINode(f,w,t);
};
g();
}}else{if(w.gtype%10==1){f.style.zIndex=w.zindex;
this.displayHTMLIndFOI(f,o,s,h,w);
this.cloneFOINode(f,w,t);
}}if(w.move_id!=null){var l=MVUtil.getScreenXY(this.parent,this.minX,this.minY,this.maxX,this.maxY,this.width,this.height,w.move_xarray[w.move_seq],w.move_yarray[w.move_seq]);
var a=Math.round(l[0]-w.width/2);
var v=Math.round(l[1]-w.height/2);
var m=w.id;
if(w.groupId>=0){m+=","+w.groupId;
}w.move_id=this.setTimeout('this.moveFoi("'+m+'")',w.time);
}};
MVIndFOIsControl.prototype.beforePrint=function(){var d="";
for(var g=0;
g<this.indFOIArray.length-1;
g++){for(var b=1;
b<this.indFOIArray.length;
b++){if(this.indFOIArray[g].topFlag&&!this.indFOIArray[b].topFlag){var a=this.indFOIArray[g];
this.indFOIArray[g]=this.indFOIArray[b];
this.indFOIArray[b]=a;
}}}for(var g=0;
g<this.indFOIArray.length;
g++){if((this.indFOIArray[g].style||this.indFOIArray[g].createMarker)&&this.indFOIArray[g].visible){var h=this.indFOIArray[g];
var f=h.createMarker?"indfoi_"+h.id+"_style":h.style.name==null?MVUtil.strAfterDot(h.style):h.style.name;
if(h.gtype%10==1){d+=this.createGeoFeatureForPrint(h.geom,f,h.width,h.height);
}else{d+=this.createGeoFeatureForPrint(h.geom,f);
}}}return d;
};
MVIndFOIsControl.prototype.createGeoFeatureForPrint=function(g,k,h,a){var b=g.toGML();
if(k.getXMLString){k=k.name;
}var d='<geoFeature render_style="'+k+'"';
if(h||a){var f=h?h:a;
d+=' marker_size="'+f+'"';
}d+="><geometricProperty>"+b+"</geometricProperty></geoFeature>";
return d;
};
MVIndFOIsControl.prototype.destroy=function(){MVUtil.detachEvent(this.div,"mouseover",this.IndMouseOver,true);
MVUtil.detachEvent(this.div,"mouseout",this.IndMouseOut,true);
MVUtil.detachEvent(this.div,"mousedown",this.getMouseDownLocation,true);
MVUtil.detachEvent(this.div,"mouseup",this.IndMouseUp,true);
MVUtil.detachEvent(this.div,"dblclick",this.IndStopEvent,true);
MVUtil.detachEvent(this.div,"click",this.IndStopEvent,true);
MVUtil.detachEvent(this.div,"mousemove",this.IndMouseMove,true);
MVUtil.detachEvent(this.div,"contextmenu",this.IndRightClick,true);
MVUtil.detachEvent(this.div,"keyup",this.IndStopPropagation,true);
MVUtil.detachEvent(this.topDiv,"mouseover",this.IndMouseOver,true);
MVUtil.detachEvent(this.topDiv,"mouseout",this.IndMouseOut,true);
MVUtil.detachEvent(this.topDiv,"mousedown",this.getMouseDownLocation,true);
MVUtil.detachEvent(this.topDiv,"mouseup",this.IndMouseUp,true);
MVUtil.detachEvent(this.topDiv,"dblclick",this.IndStopEvent,true);
MVUtil.detachEvent(this.topDiv,"click",this.IndStopEvent,true);
MVUtil.detachEvent(this.topDiv,"mousemove",this.IndMouseMove,true);
MVUtil.detachEvent(this.topDiv,"contextmenu",this.IndRightClick,true);
MVUtil.detachEvent(this.topDiv,"keyup",this.IndStopPropagation,true);
this.removeAll();
this.indFOIArray=null;
MVUtil.destroyNode(this.div,null);
this.div=null;
MVUtil.destroyNode(this.topDiv,null);
this.topDiv=null;
this.parent=null;
};
MVIndFOIsControl.prototype.getImageFormat=function(a){return a.imageFormat?a.imageFormat:this.parent.foiImageFormat;
};
MVIndFOIsControl.prototype.shouldUseDivFilter=function(a){return MVGlobalVariables.browser=="IF"&&this.getImageFormat(a)=="PNG24"&&MVGlobalVariables.browserMajorVersion<9;
};
MVIndFOIsControl.prototype.getImageParameters=function(a){var d="";
var b=this.getImageFormat(a);
if(b=="PNG8"){d+="&format="+b;
}if(a.bgColor){d+="&bgcolor="+a.bgColor;
}return d;
};
MVIndFOIsControl.prototype.displayHTMLIndFOI=function(b,f,h,d,n){var k=b.ifctl;
b.id=n.id;
b.style.width=MVUtil.pixel(n.width);
b.style.height=MVUtil.pixel(n.height);
b.style.opacity=n.opacity;
if(n.opacity<1){b.style.filter="alpha(opacity="+n.opacity*100+")";
}f[0]-=h;
f[1]+=d;
MVUtil.setLeftTop(b,f[0]-n.width/2,f[1]-n.height/2);
if(n.groupId>=0){var m=this.parent.getFOIGroup(n.groupId);
m.addFOIDIV(b,n);
}else{this.topDiv.appendChild(b);
}if(n.infoTip&&n.showTip&&MVGlobalVariables.browser!="OS"){b.title=n.infoTip;
}this.setCursorStyle(n,b);
if(n.html){var g=document.createElement("div");
g.style.position="absolute";
var l=n.htmlAlign;
var a=n.htmlVAlign;
g.style.left=MVUtil.pixel(l);
g.style.top=MVUtil.pixel(a);
g.style.padding=MVUtil.pixel(0);
n.foiDiv=g;
b.appendChild(g);
g.innerHTML=n.html;
}};
MVIndFOIsControl.prototype.displayPolygonIndFOI=function(v,l,J,k,I,u){var G=this;
var h=this.getFOIClippedSize(I);
v.style.width=MVUtil.pixel(Math.round(h.width*this.parent.pixPerX+0.5));
v.style.height=MVUtil.pixel(Math.round(h.height*this.parent.pixPerY+0.5));
var H;
var F;
var d=I.MBR;
if(I.wr&&I.wr.length>0){var a=this.parent.msi.coverMaxX-this.parent.msi.coverMinX;
d[0]+=I.wr[0]*a;
d[2]+=I.wr[0]*a;
}if((d[0]>this.maxX||d[2]<this.minX||d[1]>this.maxY||d[3]<this.minY)&&!this.around){return;
}if(I.wr&&I.wr.length>0){H=l[0];
}else{if(l[0]>-this.parent.divLeft&&l[0]<-this.parent.divLeft+this.width){H=l[0];
}else{if(l[0]<-this.parent.divLeft){H=-this.parent.divLeft;
}else{return;
}}}if(l[1]>-this.parent.divTop&&l[1]<-this.parent.divTop+this.height){F=l[1];
}else{if(l[1]<-this.parent.divTop){F=-this.parent.divTop;
}else{return;
}}H=Math.floor(H+0.5);
F=Math.floor(F+0.5);
H-=J;
F+=k;
if(I.io){H+=I.io;
F+=I.io;
}MVUtil.setLeftTop(v,H,F);
if(this.shouldUseDivFilter(I)){var o=MVUtil.strReplaceAll(I.imgURL,"(","%28");
o=MVUtil.strReplaceAll(o,")","%29");
if(I.opacity<1){v.style.filter="alpha(opacity="+I.opacity*100+")";
}var r=document.createElement("div");
v.appendChild(r);
I.clickableNode=r;
r.style.width=v.style.width;
r.style.height=v.style.height;
r.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+o+"', sizingMethod='image');";
if(I.infoTip&&I.showTip){r.setAttribute("title",I.infoTip);
}this.setCursorStyle(I,r);
}else{var w=FigLayer(I.imgURL,0,0,0,0,10);
w.className="mvfoi-image";
if(this.parent.autoHighlight&&typeof $!="undefined"&&I.area!==null&&I.area!==""){$(w).maphilight(I.highlightStyle);
}v.appendChild(w);
v.style.opacity=I.opacity;
if(I.opacity<1){v.style.filter="alpha(opacity="+I.opacity*100+")";
}I.node=v;
if(!I.shouldGenerateHTMLArea()){return;
}v.ifctl=null;
I.getHtmlArea(G.parent);
I.vertx=null;
I.verty=null;
I.vertMBR=null;
if(this.parent.multiThemeClickable){var m=I.area;
if(typeof(m)!="undefined"){var b=m.split(",");
var B=[],A=[],t=b.length/2;
var E=0;
if(t>=4){var D=maxX=B[0]=parseFloat(b[0]);
var C=maxY=A[0]=parseFloat(b[1]);
for(var z=1;
z<t;
z++){B[z]=parseFloat(b[z*2]);
A[z]=parseFloat(b[z*2+1]);
if(D>B[z]){D=B[z];
}else{if(maxX<B[z]){maxX=B[z];
}}if(C>A[z]){C=A[z];
}else{if(maxY<A[z]){maxY=A[z];
}}}I.vertx=B;
I.verty=A;
I.vertMBR={minX:D,minY:C,maxX:maxX,maxY:maxY};
}}if(!this.parent.autoHighlight){return;
}}var g=document.createElement("map");
var f=document.createElement("area");
f.ifctl=this;
f.id=I.id;
f.groupid=I.groupId;
g.setAttribute("name","f"+I.id+"_"+I.htmlmapIdSuffix);
g.setAttribute("id","f"+I.id+"_"+I.htmlmapIdSuffix);
f.setAttribute("border",0);
if(I.infoTip&&I.showTip&&!this.parent.multiThemeClickable){if(MVGlobalVariables.browser!="OS"){f.setAttribute("title",I.infoTip);
}}I.clickableNode=f;
var s="0,0";
if(I.clickable&&I.shouldGenerateHTMLArea()){if(I.area.length>0){s=I.area;
}if((I.onClickListener||(I.EventListeners[MVEvent.MOUSE_CLICK]!=null&&I.EventListeners[MVEvent.MOUSE_CLICK].length!=0)||((I.showInfoWindow&&I.infoStr)))&&MVGlobalVariables.browser!="OS"&&!this.parent.multiThemeClickable){f.setAttribute("href","javascript:void(0)");
}}f.setAttribute("shape","poly");
f.setAttribute("coords",s);
if(!this.parent.multiThemeClickable){this.setCursorStyle(I,f);
}w.setAttribute("usemap","#f"+I.id+"_"+I.htmlmapIdSuffix,0);
I.htmlmapIdSuffix++;
v.style.border=0;
v.appendChild(g);
g.appendChild(f);
}};
MVIndFOIsControl.prototype.displayPointIndFOI=function(b,k,l,d,o){var m=this;
k[0]-=l;
k[1]+=d;
MVUtil.setLeftTop(b,k[0]-o.width/2,k[1]-o.height/2);
var h=MVUtil.strEndWith(o.imgURL.toLowerCase(),"png");
var a=function(t,u){var s=document.createElement("div");
s.style.position="absolute";
var r=t.htmlAlign;
var v=t.htmlVAlign;
s.style.left=MVUtil.pixel(r);
s.style.top=MVUtil.pixel(v);
s.style.padding=MVUtil.pixel(0);
t.foiDiv=s;
u.appendChild(s);
s.innerHTML=t.html;
};
if((MVGlobalVariables.browser=="IF"&&MVGlobalVariables.browserMajorVersion<9)&&(o.style!=""||h)){if(!o.width){b.style.width=MVUtil.pixel(100);
}else{b.style.width=MVUtil.pixel(o.width);
}if(!o.height){b.style.height=MVUtil.pixel(100);
}else{b.style.height=MVUtil.pixel(o.height);
}var g=MVUtil.strReplaceAll(o.imgURL,"(","%28");
g=MVUtil.strReplaceAll(g,")","%29");
if(o.opacity<1){b.style.filter="alpha(opacity="+o.opacity*100+")";
}var n=document.createElement("div");
n.style.width=b.style.width;
n.style.height=b.style.height;
b.appendChild(n);
o.clickableNode=n;
if(o.infoTip&&o.showTip&&MVGlobalVariables.browser!="OS"){n.setAttribute("title",o.infoTip);
}n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+g+"', sizingMethod='image');";
if(o.html){a(o,n);
}m.setCursorStyle(o,n);
}else{b.style.opacity=o.opacity;
if(o.opacity<1){b.style.filter="alpha(opacity="+o.opacity*100+")";
}if(o.infoTip&&o.showTip&&MVGlobalVariables.browser!="OS"){b.setAttribute("title",o.infoTip);
}if(o.html){var f=document.createElement("img");
o.imgNode=f;
f.style.position="relative";
f.style.left=MVUtil.pixel(0);
f.style.top=MVUtil.pixel(0);
f.setAttribute("id",o.id);
f.src=o.imgURL;
f.setAttribute("border",0);
f.foi=b.foi;
f.ifctl=b.ifctl;
f.groupid=b.groupid;
b.appendChild(f);
a(o,b);
m.setCursorStyle(o,b);
}else{b.src=o.imgURL;
b.setAttribute("border",0);
m.setCursorStyle(o,b);
}}};
MVIndFOIsControl.prototype.IndStopPropagation=function(b){b=(b)?b:((window.event)?event:null);
var g=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(g);
var f=a.ifctl;
if(!f){return;
}var d=a.foi;
if(b&&d&&!d.enablePropagation){if(MVGlobalVariables.browser=="IF"){b.cancelBubble=true;
}else{if(b.stopPropagation){b.stopPropagation();
}}}};
MVIndFOIsControl.prototype.IndStopEvent=function(b){b=(b)?b:((window.event)?event:null);
var g=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(g);
var f=a.ifctl;
if(!f){return;
}var d=a.foi;
if(b&&d&&!d.enablePropagation){MVUtil.stopEvent(b);
}};
MVIndFOIsControl.prototype.getMouseDownLocation=function(b){b=(b)?b:((window.event)?event:null);
var h=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(h);
var f=a.ifctl;
if(!f){return;
}var g=function(){f.tapHoldTimeOut=null;
f.touchAndHold(b);
};
if(MVUtil.isTouchEvent(b)){if(f.tapHoldTimeOut){f.cancelTouchAndHold();
}else{f.tapHoldTimeOut=setTimeout(g,MVGlobalVariables.touchHoldTimeOut);
}}var d=a.foi;
if(!d.clickable){return;
}f.mouseL1=MVUtil.getMouseXY(b);
MVUtil.runListeners(d.EventListeners,MVEvent.MOUSE_DOWN,[f.mouseL1,d,MVUtil.getEvent(b)]);
f.IndStopPropagation(b);
};
MVIndFOIsControl.prototype.IndMouseUp=function(b){b=(b)?b:((window.event)?event:null);
var g=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(g);
var f=a.ifctl;
if(!f){return;
}if(MVUtil.isTouchEvent(b)){if(!f.tapHoldTimeOut){return;
}else{f.cancelTouchAndHold();
}}var d=a.foi;
if(!d.clickable){return;
}f.mouseL2=MVUtil.getMouseXY(b);
if(f.mouseL1.x==f.mouseL2.x&&f.mouseL1.y==f.mouseL2.y){if(b.button==2){return;
}f.mouseUpFun(d,b);
}f.IndStopEvent(b);
};
MVIndFOIsControl.prototype.mouseUpFun=function(g,a){var k=this;
if(!g.isRedLinePoint&&k.parent.redLineIsOn){return;
}var h=MVUtil.getMouseLocation(k.parent,a);
if(g.clickPoint){h=g.clickPoint;
}if(g.onClickListener||(g.EventListeners[MVEvent.MOUSE_CLICK]!=null&&g.EventListeners[MVEvent.MOUSE_CLICK].length!=0)){k.parent.stopDragging();
var f=MVSdoGeometry.createPoint(h.sdo_point.x,h.sdo_point.y,k.parent.srid);
if(g.onClickListener){g.onClickListener(f,g,MVUtil.getEvent(a));
}MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_CLICK,[f,g,MVUtil.getEvent(a)]);
}else{if(g.showInfoWindow&&g.infoStr){var d=new MVInfoWindowTab(g.infoTitle,g.infoStr);
var b=new Array(d);
if(g.windowW>0&&g.windowH>0){k.parent.infoLayer.showFOIWindow(g.id,h.sdo_point.x,h.sdo_point.y,b,0,g.windowW,g.windowH,g.infoStyle,g.infoTitle,g.infoWindowStyleParameters);
}else{k.parent.infoLayer.showFOIWindow(g.id,h.sdo_point.x,h.sdo_point.y,b,0,null,null,g.infoStyle,g.infoTitle,g.infoWindowStyleParameters);
}return;
}}};
MVIndFOIsControl.prototype.IndMouseOver=function(b){b=(b)?b:((window.event)?event:null);
var g=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(g);
var f=a.ifctl;
if(!f){return;
}var d=a.foi;
f.mouseOverFun(d,b);
};
MVIndFOIsControl.prototype.mouseOverFun=function(g,b){var l=this;
var k=MVUtil.getMouseLocation(l.parent,b);
if(g.clickPoint){k=g.clickPoint;
}var a=MVSdoGeometry.createPoint(k.sdo_point.x,k.sdo_point.y,l.parent.srid);
if(g.overLayFOIs){MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_OVER,[a,g.overLayFOIs,MVUtil.getEvent(b)]);
}else{if(g.onMouseOverListener){g.onMouseOverListener(a,g,MVUtil.getEvent(b));
}MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_OVER,[a,g,MVUtil.getEvent(b)]);
}if(g.bringToTopOnMouseOver){var h=g.node;
if(h instanceof Array){g.oldZIndex=new Array();
for(var d=0;
d<h.length;
d++){g.oldZIndex.push(h[d].style.zIndex);
h[d].style.zIndex=1000;
}}else{if(h){g.oldZIndex=g.node.style.zIndex;
g.node.style.zIndex=1000;
}if(g.cloneFOI&&g.cloneFOI.node){g.cloneFOI.node.style.zIndex=1000;
}}}if(g.infoTip&&g.showTip&&(MVGlobalVariables.browser=="OS"||g.gtype%10!=1&&!this.shouldUseDivFilter(g)&&this.parent.multiThemeClickable)){var f=MVUtil.strReplaceAll(g.infoTip," ","&nbsp;");
l.parent.infoLayer.showTextTip(f,k.sdo_point.x,k.sdo_point.y);
}if(l.parent.autoHighlight&&typeof $!="undefined"){$(g.clickableNode).mouseover();
}};
MVIndFOIsControl.prototype.IndMouseOut=function(b){b=(b)?b:((window.event)?event:null);
var g=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(g);
var f=a.ifctl;
if(!f){return;
}var d=a.foi;
f.mouseOutFun(d,b);
};
MVIndFOIsControl.prototype.mouseOutFun=function(f,b){var k=this;
var h=MVUtil.getMouseLocation(k.parent,b);
if(f.clickPoint){h=f.clickPoint;
}var a=MVSdoGeometry.createPoint(h.sdo_point.x,h.sdo_point.y,k.parent.srid);
if(f.overLayFOIs){MVUtil.runListeners(f.EventListeners,MVEvent.MOUSE_OUT,[a,f.overLayFOIs,MVUtil.getEvent(b)]);
}else{if(f.onMouseOutListener){f.onMouseOutListener(a,f,MVUtil.getEvent(b));
}MVUtil.runListeners(f.EventListeners,MVEvent.MOUSE_OUT,[a,f,MVUtil.getEvent(b)]);
}if(f.bringToTopOnMouseOver){var g=f.node;
if(g instanceof Array){for(var d=0;
d<g.length;
d++){g[d].style.zIndex=f.oldZIndex[d];
}}else{if(g){g.style.zIndex=f.oldZIndex;
}if(f.cloneFOI&&f.cloneFOI.node){f.cloneFOI.node.style.zIndex=f.oldZIndex;
}}}if(f.infoTip){k.parent.infoLayer.hideInfoTip();
}if(k.parent.autoHighlight&&typeof $!="undefined"){$(f.clickableNode).mouseout();
}};
MVIndFOIsControl.prototype.IndRightClick=function(b){b=(b)?b:((window.event)?event:null);
var g=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(g);
var f=a.ifctl;
if(!f){return;
}var d=a.foi;
f.rightClickFun(d,b);
};
MVIndFOIsControl.prototype.rightClickFun=function(d,a){var g=this;
if(!d.clickable){return;
}if(d.onRightClickListener||(d.EventListeners[MVEvent.MOUSE_RIGHT_CLICK]!=null&&d.EventListeners[MVEvent.MOUSE_RIGHT_CLICK].length!=0)){var f=MVUtil.getMouseLocation(g.parent,a);
if(d.clickPoint){f=d.clickPoint;
}var b=MVSdoGeometry.createPoint(f.sdo_point.x,f.sdo_point.y,g.parent.srid);
if(d.onRightClickListener){d.onRightClickListener(b,d,MVUtil.getEvent(a));
}MVUtil.runListeners(d.EventListeners,MVEvent.MOUSE_RIGHT_CLICK,[b,d,MVUtil.getEvent(a)]);
}};
MVIndFOIsControl.prototype.getMapBBOXArray=function(){this.maparea=new Array();
this.parent.do_GetMinMaxLonLat();
var k=(this.getLayerWidth()-this.parent.getPaneWidth())*0.5/this.parent.pixPerX;
var o=this.parent.mapWindowMinLon-k;
var l=this.parent.mapWindowMaxLon+k;
if(this.parent.msi!=null){var f=this.parent.msi.coverMinX;
var b=this.parent.msi.coverMaxX;
var g=b-f;
var a=0;
if(o<f){a=Math.ceil((f-o)/g);
o+=g*a;
l+=g*a;
a=0-a;
}else{if(o>b){a=Math.ceil((o-b)/g);
o-=g*a;
l-=g*a;
}}if(l<=b){this.maparea.push({minx:o,maxx:l,n:a});
}else{this.maparea.push({minx:o,maxx:b,n:a});
l-=g;
a++;
while(l>b){this.maparea.push({minx:f,maxx:b,n:a});
l-=g;
a++;
}this.maparea.push({minx:f,maxx:l,n:a});
}}var h=this.maparea.length;
var d=parseInt(h/2);
if(h>0&&d==h/2){var m=this.maparea[0].maxx-this.maparea[0].minx;
var r=this.maparea[h-1].maxx-this.maparea[h-1].minx;
if(m>r){this.centerArea=h/2-1;
}else{this.centerArea=h/2;
}}else{this.centerArea=Math.floor(h/2);
}};
MVIndFOIsControl.prototype.setCursorStyle=function(a,b){if(a.cursorStyle){MVUtil.setCursor(b,a.cursorStyle);
}else{if(a.clickable&&a.shouldGenerateHTMLArea()&&(a.EventListeners[MVEvent.MOUSE_CLICK]!=null&&a.EventListeners[MVEvent.MOUSE_CLICK].length!=0||a.onClickListener||(a.showInfoWindow&&a.infoStr))){MVUtil.setCursor(b,"pointer");
}}};
MVIndFOIsControl.prototype.setIndFOIListners=function(a,b){if(a.origFOI){a=a.origFOI;
}b.onmouseover=this.IndMouseOver;
b.onmouseout=this.IndMouseOut;
b.ondblclick=this.IndStopEvent;
b.onclick=this.IndStopEvent;
b.onmousemove=this.IndMouseMove;
if(a.clickable&&a.shouldGenerateHTMLArea()){if((a.EventListeners[MVEvent.MOUSE_CLICK]!=null&&a.EventListeners[MVEvent.MOUSE_CLICK].length!=0)||a.onClickListener||((a.showInfoWindow&&a.infoStr))){MVUtil.setCursor(b,"pointer");
}MVUtil.attachEvent(b,"mousedown",this.getMouseDownLocation,true);
MVUtil.attachEvent(b,"mouseup",this.IndMouseUp,true);
b.oncontextmenu=this.IndRightClick;
}if(a.cursorStyle){MVUtil.setCursor(b,a.cursorStyle);
}MVUtil.pushNode(b);
};
MVIndFOIsControl.prototype.setDuplicatePolygonIndFOIOrds=function(m){m.wr=new Array();
if(m.areacode!=null){var b=this.maparea[0].n;
b+=m.areacode;
m.wr.push(b);
return;
}var b=0;
var h=this.parent.msi.coverMinX;
var d=this.parent.msi.coverMaxX;
var k=d-h;
var o=this.parent.msi.coverMinX+k/2;
var a=m.MBR[2];
var f=m.MBR[0];
var l=false;
if(f<h||a>d){m.wr.push(this.maparea[0].n);
if(f<o&&a<o){for(var g=1;
g<this.maparea.length;
g++){if(this.maparea[g].maxx>(f+k)){m.wr.push(this.maparea[g].n);
}}}else{for(var g=1;
g<this.maparea.length;
g++){if(this.maparea[g].maxx>f){m.wr.push(this.maparea[g].n);
}}}}else{for(var g=0;
g<this.maparea.length;
g++){if((f>this.maparea[g].minx&&f<this.maparea[g].maxx)||(a>this.maparea[g].minx&&a<this.maparea[g].maxx)||(f<this.maparea[g].minx&&a>this.maparea[g].maxx)){m.wr.push(this.maparea[g].n);
}}}};
MVIndFOIsControl.prototype.cloneFOINode=function(f,o,l,a){var d=parseInt(f.style.left);
if(o.wr&&o.wr.length>1){var k=false;
if(o.imgNode){k=true;
}if(!a){a=1;
}if(a==1){o.node=new Array(f);
o.clickableNode=new Array(o.clickableNode);
if(k){o.imgNode=new Array(o.imgNode);
}}for(var h=a;
h<o.wr.length;
h++){var n=f.cloneNode(true);
n.id=n.id+"clone"+h;
n.groupid=o.groupId;
n.style.left=MVUtil.pixel(d+h*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX)*this.parent.pixPerX);
if(o.groupId>=0){var m=this.parent.getFOIGroup(o.groupId);
m.addFOIDIV(n,o);
}else{if(o.topFlag){this.topDiv.appendChild(n);
}else{this.div.appendChild(n);
}}n.ifctl=l;
n.orgid=f.id;
if(k&&n.childNodes.length>0){o.imgNode.push(n.childNodes[0]);
}if(o.gtype%10==1||this.shouldUseDivFilter(o)||!o.area){this.setCursorStyle(o,n);
o.clickableNode.push(n);
}else{if(n.childNodes.length>1){n.ifctl=null;
var b=n.childNodes[0];
var g=n.childNodes[1];
g.ifctl=l;
g.orgid=o.id;
g.groupid=o.groupId;
this.setCursorStyle(o,g);
b.setAttribute("usemap","#f"+o.id+"clone"+h+"_"+o.htmlmapIdSuffix,0);
g.setAttribute("name","f"+o.id+"clone"+h+"_"+o.htmlmapIdSuffix);
g.setAttribute("id","f"+o.id+"clone"+h+"_"+o.htmlmapIdSuffix);
if(g.childNodes.length>0){o.clickableNode.push(g.childNodes[0]);
}}}o.node.push(n);
}}};
MVIndFOIsControl.prototype.detachEventListener=function(a,b){MVUtil.detachEventListener(this.EventListeners,a,b);
};
MVIndFOIsControl.prototype.attachEventListener=function(a,b){MVUtil.attachEventListener(this.EventListeners,a,b);
};
MVIndFOIsControl.prototype.IndMouseMove=function(b){b=(b)?b:((window.event)?event:null);
var g=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(g);
var f=a.ifctl;
if(!f){return;
}var d=a.foi;
f.mouseMoveFun(d,b);
};
MVIndFOIsControl.prototype.mouseMoveFun=function(d,b){var g=this;
var f=MVUtil.getMouseLocation(g.parent,b);
if(d.clickPoint){f=d.clickPoint;
}var a=MVSdoGeometry.createPoint(f.sdo_point.x,f.sdo_point.y,g.parent.srid);
MVUtil.runListeners(d.EventListeners,MVEvent.MOUSE_MOVE,[a,d,MVUtil.getEvent(b)]);
};
MVIndFOIsControl.prototype.touchAndHold=function(b){var f=MVUtil.getEventSource(b);
var a=MVUtil.getMVIndFOIsControlAndFOI(f);
var d=a.ifctl;
if(!d){return;
}d.parent.cancelTouchAndHold();
if(!d.parent.touchBehavior||!d.parent.touchBehavior.touchHold||d.parent.touchBehavior.touchHold=="mouse_right_click"){d.IndRightClick(b);
}else{if(d.parent.touchBehavior.touchHold=="mouse_over"){d.IndMouseOver(b);
}}};
MVIndFOIsControl.prototype.cancelTouchAndHold=function(){if(this.tapHoldTimeOut){clearTimeout(this.tapHoldTimeOut);
this.tapHoldTimeOut=null;
}};
MVIndFOIsControl.prototype.getSelectedFOIByMouseLocation=function(u,d){var s=this.indFOIArray.length;
for(var z=s-1;
z>=0;
z--){var A=this.indFOIArray[z];
if(A.isVisible()&&A.node&&A.gtype%10!=1&&A.topFlag==d){var w=this.parent.getEventCoords(u);
var l=MVUtil.getLeft(A.node);
var r=MVUtil.getTop(A.node);
var k=MVUtil.getLeft(A.node.parentNode);
var o=MVUtil.getTop(A.node.parentNode);
var h=MVUtil.getLeft(this.parent.div);
var n=MVUtil.getTop(this.parent.div);
var g=w.left-(l+k+h);
var f=w.top-(r+o+n);
var v=A.vertx;
var t=A.verty;
var b=A.vertMBR;
if(v!=null&&t!=null){var m=v.length;
c=MVUtil.pointInPolygonTest(g,f,m,v,t,b);
if(c){return A;
}}}}return null;
};
MVIndFOIsControl.prototype.getHTMLForPrint=function(){var l=document.createElement("div");
l.style.zIndex=1000;
l.style.position="absolute";
var o=this.parent;
o.do_GetMinMaxLonLat();
var h=o.mapWindowMinLon;
var b=o.mapWindowMaxLon;
var f=o.mapWindowMinLat;
var a=o.mapWindowMaxLat;
var d=o.getPaneWidth();
var t=o.getPaneHeight();
for(var k=0;
k<this.indFOIArray.length;
k++){var u=this.indFOIArray[k];
if(u.html){var m=document.createElement("div");
m.style.position="absolute";
m.style.zIndex="1000";
var n=0;
var g=0;
if(u.htmlAlign){n=parseInt(u.htmlAlign);
}if(u.htmlVAlign){g=parseInt(u.htmlVAlign);
}var s=(u.x-h)*d/(b-h);
var r=(a-u.y)*t/(a-f);
n+=s-u.width/2;
g+=r-u.height/2;
m.style.left=MVUtil.pixel(n);
m.style.top=MVUtil.pixel(g);
m.style.padding=MVUtil.pixel(0);
l.appendChild(m);
m.innerHTML=u.html;
}}return l;
};
function MVRedlineTool(b,f,d){var a=MVGlobalVariables.redlineToolId;
MVGlobalVariables.redlineToolId=(++a);
this.id=a;
this.pointId=0;
this.lineId=0;
this.parent="";
this.serverURL=d;
this.pointStyle=null;
this.lineStyle=b;
this.areaStyle=f;
this.lon=0;
this.lat=0;
this.mouseX=0;
this.mouseY=0;
this.mouseDownX=0;
this.mouseDownY=0;
this.pointdx=0;
this.pointdy=0;
this.lineFOI=new Array();
this.state=0;
this.mouseDown=0;
this.moveMapFlag=0;
this.moveFoiFlag=0;
this.imageSrc=null;
this.imageWidth=5;
this.imageHeight=5;
this.autoClose=false;
this.fillArea=false;
this.areaFOI=null;
var g=this;
this.EventListeners=new Object();
this.mouseClickListener=null;
this.onFinishListener=null;
this.pointFOIs=new Array();
this.lineFOIs=new Array();
this.gtype=3;
this.focusFoiObj=null;
this.focusFoiObjLoc=null;
this.ctxMenuId=null;
this.afterMove=null;
this.onEditFinishListener=null;
this.generatePolygonTop=false;
this.textStyle="";
this.infoDecoration=null;
this.infoDecorationVisible=true;
this.editingMode={deletePoint:true,dragPoint:true,deleteLine:true,dragLine:true};
this.pointGenerateOnTopZIndex=101;
this.foiMouseRightClickListener=function(r,k,h){if(!g.editingMode){return;
}var o=k.objType4RedLineTool;
switch(o){case -1:if(!g.editingMode.deletePoint){return;
}break;
case -2:if(!g.editingMode.deleteLine){return;
}break;
}g.focusFoiObj=k;
var m=r.getPointX();
var l=MVUtil.calAreaCodeFromCenter(g.parent,m);
var n=new MVMenu(g.parent,r,l);
g.ctxMenuId=n.menuFOIId;
switch(o){case -1:n.addMenuItem(MVi18n.getInfoMessage("delete"),g.deleteVertexOperation);
break;
case -2:r.sdo_ordinates[0]=m;
r.sdo_point.x=m;
g.focusFoiObjLoc=r;
n.addMenuItem(MVi18n.getInfoMessage("delete"),g.deleteEdgeOperation);
n.addMenuItem(MVi18n.getInfoMessage("addPoint"),g.addVertexOperation);
break;
}MVUtil.stopEvent(h);
};
this.foiMouseOverListener=function(m,k,h){if(!g.editingMode){return;
}var l=k.objType4RedLineTool;
switch(l){case -1:if(!g.editingMode.dragPoint){return;
}break;
case -2:if(!g.editingMode.dragLine){return;
}break;
}if(g.moveFoiFlag!=0&&g.moveFoiFlag!=1){return;
}g.moveFoiFlag=1;
g.parent.draggingEnabled=false;
g.focusFoiObj=k;
};
this.foiMouseOutListener=function(l,k,h){if(g.moveFoiFlag!=1){return;
}g.moveFoiFlag=0;
g.focusFoiObj=null;
MVUtil.stopEvent(h);
};
this.deleteEdgeOperation=function(){var h=g.focusFoiObj;
if(!h){return;
}var k=h.objType4RedLineTool;
if(k==-2){g.removeEdge(h);
}};
this.deleteVertexOperation=function(){var h=g.focusFoiObj;
if(!h){return;
}var k=h.objType4RedLineTool;
if(k==-1){g.removeVertex(h);
}};
this.addVertexOperation=function(){var k=g.focusFoiObj;
if(!k){return;
}var m=k.objType4RedLineTool;
if(m==-2){var l=g.getEdge(k);
if(l[0]){var o=g.focusFoiObjLoc;
var h=null;
var n=null;
if(o){h=o.getPointX();
n=o.getPointY();
}if(h&&n){g.addVertex(l[1]+1,h,n);
}}}};
this.mouse_down=function(h){h=(h)?h:((window.event)?event:null);
var k=MVUtil.getMouseXY(h);
g.mouseDownX=k.x;
g.mouseDownY=k.y;
if(g.moveFoiFlag==1||(g.moveFoiFlag==0&&g.focusFoiObj!=null&&g.focusFoiObj.node==MVUtil.getEventSource(h))){MVGlobalVariables.redlineInstance=g;
g.moveFoiFlag=2;
g.parent.mDn(h);
g.lon=g.parent.getMouseCursorLon();
g.lat=g.parent.getMouseCursorLat();
MVUtil.stopEvent(h);
return;
}if((MVGlobalVariables.redlineInstance)!=g||(h!=null&&h.button==2)){return;
}MVUtil.stopEvent(h);
g.mouseDown=1;
g.moveMapFlag=1;
var k=MVUtil.getMouseXY(h);
g.mouseX=k.x;
g.mouseY=k.y;
};
this.keepTwoPointsInHalfEarth=function(l,k,h){if(g.parent.wraparound){if(g.parent.indFOIsControl.maparea.length==1){k.areacode=g.parent.indFOIsControl.centerArea;
return;
}var n=g.parent.msi.coverMaxX-g.parent.msi.coverMinX;
var m;
if(h){m=h.areacode;
}else{m=g.parent.indFOIsControl.centerArea;
}var o=MVUtil.keepInCSBoundary(g.parent,k.getGeometry().getPointX());
var r;
if(h){r=MVUtil.keepInCSBoundary(g.parent,h.getGeometry().getPointX());
}else{r=MVUtil.keepInCSBoundary(g.parent,g.parent.getCenterLon());
}g.lineFOI[l*2]=o;
k.areacode=m;
var s=o-r;
while(Math.abs(s)>n/2){if(s<0){o=o+n;
k.areacode=m+1;
}else{o=o-n;
k.areacode=m-1;
}s=o-r;
}}};
this.refreshRedline=function(v){var A=function(F,E){F=MVUtil.keepInCSBoundary(g.parent,F);
E=MVUtil.keepInCSBoundary(g.parent,E);
var D=E-F;
if(D>0){F=F+(g.parent.msi.coverMaxX-g.parent.msi.coverMinX);
}else{E=E+(g.parent.msi.coverMaxX-g.parent.msi.coverMinX);
}if(Math.abs(E-F)>Math.abs(D)){return Math.abs(D);
}else{return Math.abs(E-F);
}};
if(g.parent.wraparound){var s=g.pointFOIs;
if(g.getStatus()==1){if(s.length!=0){var B=0;
var t=Number.MAX_VALUE;
var l=MVUtil.keepInCSBoundary(g.parent,g.parent.getCenterLon());
for(var u=0;
u<s.length;
u++){var o=Math.abs(MVUtil.keepInCSBoundary(g.parent,s[u].getGeometry().getPointX())-l);
if(t>o){t=o;
B=u;
}}g.keepTwoPointsInHalfEarth(B,s[B],null);
if(B>0){for(var u=B-1;
u>=0;
u--){g.keepTwoPointsInHalfEarth(u,s[u],s[u+1]);
}}if(B<s.length){for(var u=B+1;
u<s.length;
u++){g.keepTwoPointsInHalfEarth(u,s[u],s[u-1]);
}}}g.refreshLines(v);
}else{if(g.getStatus()==2){if(g.parent.getFOI("-RL2RL"+g.id)){var C=g.parent.getFOI("-RL2RL"+g.id);
var w=Number.MAX_VALUE;
var z=0;
for(var u=0;
u<s.length;
u++){var o=A(s[u].getGeometry().getPointX(),g.parent.getCenterLon());
if(w>o){w=o;
z=u;
}}g.keepTwoPointsInHalfEarth(z,s[z],null);
if(z>0){for(var u=z-1;
u>=0;
u--){g.keepTwoPointsInHalfEarth(u,s[u],s[u+1]);
}}if(z<s.length){for(var u=z+1;
u<s.length;
u++){g.keepTwoPointsInHalfEarth(u,s[u],s[u-1]);
}}var k=new Array();
var n=Number.MAX_VALUE;
for(var u=0;
u<s.length;
u++){if(s[u].areacode<n){n=s[u].areacode;
}}for(var u=0;
u<s.length;
u++){if(s[u].areacode==n){k.push([u,s[u]]);
}}var r=0;
var h=Number.MAX_VALUE;
for(var u=0;
u<k.length;
u++){var m=(k[u])[1];
if(MVUtil.keepInCSBoundary(g.parent,m.getGeometry().getPointX())<h){h=MVUtil.keepInCSBoundary(g.parent,m.getGeometry().getPointX());
r=(k[u])[0];
}}C.areacode=s[r].areacode;
}}}}};
this.refreshLines=function(k){var l=g.lineFOIs;
var m=g.pointFOIs;
if(l.length!=0){for(var h=0;
h<l.length;
h++){l[h].areacode=(m[h].areacode<m[h+1].areacode)?m[h].areacode:m[h+1].areacode;
if(k){l[h].updateGeometry(MVSdoGeometry.createLineString(g.lineFOI.slice(h*2,(h*2+4)),(g.parent.srid)));
}}}};
this.mouse_up=function(h){g.parent.draggingEnabled=true;
if(g.moveFoiFlag==3){g.parent.addEventHandlers();
}g.moveFoiFlag=0;
h=(h)?h:((window.event)?event:null);
if((MVGlobalVariables.redlineInstance)!=g||g.moveMapFlag!=1||(h!=null&&h.button==2)){if(g.afterMove){g.afterMove();
g.afterMove=null;
}return;
}g.moveMapFlag=0;
if(g.mouseDown==1&&g.state==1){MVUtil.stopEvent(h);
g.parent.curLay=null;
g.mouseDown=0;
g.lon=g.parent.getMouseCursorLon();
g.lat=g.parent.getMouseCursorLat();
if(g.lat>g.parent.msi.coverMaxY){g.lat=g.parent.msi.coverMaxY;
}else{if(g.lat<g.parent.msi.coverMinY){g.lat=g.parent.msi.coverMinY;
}}if(g.gtype==1){while(g.pointFOIs.length>0){var l=g.pointFOIs.pop();
g.parent.removeFOI(l);
}while(g.lineFOIs.length>0){var l=g.lineFOIs.pop();
g.parent.removeFOI(l);
}g.pointFOIs=new Array();
g.lineFOIs=new Array();
g.parent.removeFOI("-RL2RL"+g.id);
g.parent.removeFOI("-RL10RL"+g.id);
g.lineFOI=new Array();
}if(g.lineFOI!=null&&g.lineFOI.length>=2&&g.lon==g.lineFOI[g.lineFOI.length-2]&&g.lat==g.lineFOI[g.lineFOI.length-1]){return;
}var r=null;
var m="-RL8RL"+g.id+"_"+(++g.pointId);
if(g.imageSrc){r=new MVFOI(m,MVSdoGeometry.createPoint(g.lon,g.lat,g.parent.srid),"",g.imageSrc,g.imageWidth,g.imageHeight);
}else{if(!g.pointStyle){g.pointStyle=new MVStyleMarker(MVGlobalVariables.redlineMarkerStyleName,"vector");
g.pointStyle.setStrokeColor("000000");
g.pointStyle.setStrokeWidth(1.5);
g.pointStyle.setFillColor("ff5555");
g.pointStyle.setVectorShape("c:30");
}r=new MVFOI(m,MVSdoGeometry.createPoint(g.lon,g.lat,g.parent.srid),g.pointStyle,null,12,12);
}r.enableInfoTip(false);
r.isRedLinePoint=true;
r.enableInfoWindow(false);
r.objType4RedLineTool=-1;
r.setEventListener(MVEvent.MOUSE_RIGHT_CLICK,g.foiMouseRightClickListener);
r.attachEventListener(MVEvent.MOUSE_DOWN,g.foiMouseOverListener);
r.setEventListener(MVEvent.MOUSE_OUT,g.foiMouseOutListener);
r.setMouseCursorStyle("pointer");
r.setBringToTopOnMouseOver(false);
r.setTopFlag(true);
if(g.generatePolygonTop){r.setZIndex(g.pointGenerateOnTopZIndex);
}if(g.autoClose&&g.pointFOIs.length==0){r.setEventListener(MVEvent.MOUSE_CLICK,function(){g.moveFoiFlag=0;
if(g.lineFOI.length<=2){return;
}g.lineFOI.push(g.lineFOI[0]);
g.lineFOI.push(g.lineFOI[1]);
g.generate();
if(g.onFinishListener){g.onFinishListener();
}MVUtil.runListeners(g.EventListeners,MVEvent.FINISH);
return;
});
}g.pointFOIs.push(r);
g.lineFOI.push(g.lon);
g.lineFOI.push(g.lat);
if(g.pointFOIs.length==0){g.keepTwoPointsInHalfEarth(0,r,null);
}else{g.keepTwoPointsInHalfEarth(g.pointFOIs.length-1,r,g.pointFOIs[g.pointFOIs.length-2]);
}g.parent.addFOI(r);
FOILineLen=(g.lineFOI.length);
if(FOILineLen>=4){var n=new MVFOI(("-RL6RL"+g.id+"_"+(++g.lineId)),MVSdoGeometry.createLineString(g.lineFOI.slice((FOILineLen-4)),(g.parent.srid)),g.lineStyle,g.serverURL);
n.setTopFlag(g.generatePolygonTop);
n.enableInfoTip(false);
n.enableInfoWindow(false);
n.objType4RedLineTool=-2;
n.setEventListener(MVEvent.MOUSE_RIGHT_CLICK,g.foiMouseRightClickListener);
n.setEventListener(MVEvent.MOUSE_OVER,g.foiMouseOverListener);
n.setEventListener(MVEvent.MOUSE_OUT,g.foiMouseOutListener);
n.setMouseCursorStyle("pointer");
n.setBringToTopOnMouseOver(false);
if(g.pointFOIs[g.pointFOIs.length-2].areacode<g.pointFOIs[g.pointFOIs.length-1].areacode){n.areacode=g.pointFOIs[g.pointFOIs.length-2].areacode;
}else{n.areacode=g.pointFOIs[g.pointFOIs.length-1].areacode;
}g.parent.addFOI(n);
g.lineFOIs.push(n);
}if(g.fillArea&&FOILineLen>4){var o=new Array(FOILineLen+2);
for(var k=0;
k<FOILineLen;
k++){o[k]=g.lineFOI[k];
}o[FOILineLen]=g.lineFOI[0];
o[FOILineLen+1]=g.lineFOI[1];
g.areaFOI.updateGeometry(MVSdoGeometry.createPolygon(o,g.parent.srid));
}if(g.infoDecoration&&!g.infoDecoration.isVisible()&&g.infoDecorationVisible){g.infoDecoration.setVisible(true);
}if(g.mouseClickListener){g.mouseClickListener();
}MVUtil.runListeners(g.EventListeners,MVEvent.NEW_SHAPE_POINT);
}};
this.mouse_move=function(o){o=(o)?o:((window.event)?event:null);
if((g.moveFoiFlag==2)||(g.moveFoiFlag==3)){MVGlobalVariables.redlineInstance=g;
g.parent.mDn(o);
var r=g.focusFoiObj;
var l=r.objType4RedLineTool;
switch(l){case -1:g.moveVertex(r,(g.parent.getMouseCursorLon()),(g.parent.getMouseCursorLat()));
break;
case -2:var h=(g.parent.getMouseCursorLon());
var m=(g.parent.getMouseCursorLat());
var t=h-(g.lon);
var s=m-(g.lat);
g.lon=h;
g.lat=m;
var n=MVUtil.getMouseXY(o);
g.pointdx=n.x-g.mouseDownX;
g.pointdy=n.y-g.mouseDownY;
g.moveEdge(r,t,s);
break;
}MVUtil.stopEvent(o);
if(g.moveFoiFlag==2){g.moveFoiFlag=3;
g.parent.base_div.onmousemove=function(u){};
if(g.parent.base_div.attached!=true){if(MVGlobalVariables.browser=="IF"){g.parent.base_div.attachEvent("onmousemove",g.mouse_move);
g.parent.base_div.attached=true;
}else{g.parent.base_div.addEventListener("mousemove",g.mouse_move,false);
g.parent.base_div.attached=true;
}}}return;
}if((MVGlobalVariables.redlineInstance)!=g||(o!=null&&o.button==2)){return;
}if(g.moveMapFlag==1){var t=0;
var s=0;
var n=MVUtil.getMouseXY(o);
t=n.x-g.mouseX;
s=n.y-g.mouseY;
var k=MVGlobalVariables.redlineIgnoreMove;
if((t*t+s*s)>(k*k)){g.moveMapFlag=2;
}}};
this.getStatus=function(){return this.state;
};
this.init=function(k){if(!g.infoDecoration){g.infoDecoration=new MVMapDecoration('<div id="redline_cpan_div_'+this.id+'" style="padding:3px 2px 2px 3px; border:1px solid black;font-size:9pt;background-color:white;filter:alpha(opacity=80);-moz-opacity:.80;opacity:.80;'+this.textStyle+'"><a id="finishLink_'+this.id+'" href="javascript:void(0);"> '+MVi18n.getInfoMessage("finish")+'</a> / <a id="clearLink_'+this.id+'" href="javascript:void(0);">'+MVi18n.getInfoMessage("clear")+" </a></div>",0.4,0.9);
g.infoDecoration.afterDisAction=g.redlineInfoLink;
g.parent.addMapDecoration(g.infoDecoration);
g.infoDecoration.setDraggable(true);
g.infoDecoration.setDraggable(true);
g.infoDecoration.setVisible(false);
}switch(k){case 1:this.gtype=k;
break;
case 2:this.gtype=k;
break;
default:this.gtype=k=3;
}if(!this.pointStyle){this.setRenderingStyle(MVRedlineTool.STYLE_POINT,null);
}if(!this.lineStyle){this.setRenderingStyle(MVRedlineTool.STYLE_LINE,null);
}if(!this.areaStyle){this.setRenderingStyle(MVRedlineTool.STYLE_AREA,null);
}this.parent.redLineIsOn=true;
if(this.state==0){MVUtil.attachEvent(this.parent.base_div,"mousedown",this.mouse_down,true);
MVUtil.attachEvent(this.parent.base_div,"mouseup",this.mouse_up,true);
MVUtil.attachEvent(this.parent.base_div,"mousemove",this.mouse_move,true);
}MVGlobalVariables.redlineInstance=this;
if(this.fillArea){this.areaFOI=new MVFOI("-RL10RL"+this.id,MVSdoGeometry.createPolygon([0,0,0,0,0,0,0,0],this.parent.srid),this.areaStyle,this.serverURL);
this.areaFOI.enableInfoTip(false);
this.areaFOI.enableInfoWindow(false);
this.areaFOI.setClickable(false);
this.parent.addFOI(this.areaFOI);
}while(this.pointFOIs.length>0){var h=this.pointFOIs.pop();
this.parent.removeFOI(h);
}while(this.lineFOIs.length>0){var h=this.lineFOIs.pop();
this.parent.removeFOI(h);
}this.pointFOIs=new Array();
this.lineFOIs=new Array();
this.parent.removeFOI("-RL2RL"+this.id);
this.parent.removeFOI("-RL10RL"+this.id);
if(this.ctxMenuId!=null){this.parent.removeFOI(this.ctxMenuId);
}this.lineFOI=new Array();
this.state=1;
this.parent.indFOIsControl.attachEventListener("refreshFOI",this.refreshRedline);
MVUtil.runListeners(this.EventListeners,MVEvent.INIT,[MVToolBar.BUILTIN_REDLINE]);
};
this.setTextStyle=function(h){g.textStyle=h;
};
this.setControlPanelVisible=function(h){this.infoDecorationVisible=h;
if(this.infoDecoration){this.infoDecoration.setVisible(h);
}};
this.redlineInfoLink=function(){var h=document.getElementById("finishLink_"+g.id);
var k=document.getElementById("clearLink_"+g.id);
MVUtil.attachEvent(h,"click",function(){if(g.finishLinkClick){g.finishLinkClick();
}g.generate();
if(g.getStatus()!=2){g.clear();
}},true);
MVUtil.attachEvent(k,"click",function(){if(g.clearLinkClick){g.clearLinkClick();
}g.clear();
},true);
};
this.getInfoDecorationDiv=function(){return document.getElementById("redline_cpan_div_"+this.id);
};
this.generate=function(){var k=this.gtype;
if(this.state==1){if(k==3&&this.lineFOI.length<6){MVi18n.reportError("MVRedlineTool.generate","MAPVIEWER-05512",null,this.parent?this.parent.errorHandler:null);
return;
}else{if(k==2&&this.lineFOI.length<4){MVi18n.reportError("MVRedlineTool.generate","MAPVIEWER-05512",null,this.parent?this.parent.errorHandler:null);
return;
}else{if(k==1&&this.lineFOI.length<2){MVi18n.reportError("MVRedlineTool.generate","MAPVIEWER-05512",null,this.parent?this.parent.errorHandler:null);
return;
}}}var l=this;
var h=function(){if(l.lineFOIs.length>0){if(!l.lineFOIs[l.lineFOIs.length-1].node){setTimeout(h,50);
return;
}}var m=null;
if(l.pointFOIs&&l.pointFOIs[0]){m=l.pointFOIs[0].areacode;
for(var r=1;
r<l.pointFOIs.length;
r++){if(l.pointFOIs[r]&&(l.pointFOIs[r].areacode<m)){m=l.pointFOIs[r].areacode;
}}}l.state=2;
for(var r=0;
r<l.pointFOIs.length;
r++){var s=l.pointFOIs[r];
l.parent.removeFOI(s);
}while(l.lineFOIs.length>0){var s=l.lineFOIs.pop();
l.parent.removeFOI(s);
}l.lineFOIs=new Array();
if(l.ctxMenuId!=null){l.parent.removeFOI(l.ctxMenuId);
}l.parent.removeFOI("-RL10RL"+l.id);
var o=l.lineFOI.length;
if(k==3&&(l.lineFOI[0]!=l.lineFOI[o-2]||l.lineFOI[1]!=l.lineFOI[o-1])){l.lineFOI.push(l.lineFOI[0]);
l.lineFOI.push(l.lineFOI[1]);
}var n=null;
switch(k){case 1:if(l.imageSrc){n=new MVFOI("-RL2RL"+l.id,MVSdoGeometry.createPoint(l.lineFOI[0],l.lineFOI[1],l.parent.srid),"",l.imageSrc,l.imageWidth,l.imageHeight);
}else{n=new MVFOI("-RL2RL"+l.id,MVSdoGeometry.createPoint(l.lineFOI[0],l.lineFOI[1],l.parent.srid),l.pointStyle,l.serverURL);
}break;
case 2:n=new MVFOI("-RL2RL"+l.id,MVSdoGeometry.createLineString(l.lineFOI,l.parent.srid),l.lineStyle,l.serverURL);
break;
case 3:n=new MVFOI("-RL2RL"+l.id,MVSdoGeometry.createPolygon(l.lineFOI,l.parent.srid),l.areaStyle,l.serverURL);
break;
}n.areacode=m;
n.enableInfoTip(false);
n.enableInfoWindow(false);
n.setClickable(false);
n.setTopFlag(l.generatePolygonTop);
l.parent.addFOI(n);
l.parent.redLineIsOn=false;
if(g.onFinishListener){g.onFinishListener();
}MVUtil.runListeners(g.EventListeners,MVEvent.FINISH);
};
h();
}};
this.generateArea=this.generate;
this.clear=function(){if(!this.parent){return;
}var l=false;
while(this.pointFOIs.length>0){var m=this.pointFOIs.pop();
this.parent.removeFOI(m);
l=true;
}while(this.lineFOIs.length>0){var m=this.lineFOIs.pop();
this.parent.removeFOI(m);
l=true;
}if(this.parent.getFOI("-RL2RL"+this.id)){l=true;
}this.parent.removeFOI("-RL2RL"+this.id);
if(this.parent.getFOI("-RL10RL"+this.id)){l=true;
}this.parent.removeFOI("-RL10RL"+this.id);
if(this.ctxMenuId!=null){this.parent.removeFOI(this.ctxMenuId);
}MVUtil.detachEvent(this.parent.base_div,"mousedown",this.mouse_down,true);
MVUtil.detachEvent(this.parent.base_div,"mouseup",this.mouse_up,true);
MVUtil.detachEvent(this.parent.base_div,"mousemove",this.mouse_move,true);
if(g.infoDecoration){g.infoDecoration.setVisible(false);
var h=g.infoDecoration.getContainerDiv();
for(var k=0;
k<h.childNodes.length;
k++){if(h.childNodes[k].tagName=="IMG"){h.childNodes[k].style.visibility="hidden";
}}}if(this.getStatus()==1||l){MVUtil.runListeners(g.EventListeners,MVEvent.CLEAR);
}this.state=0;
this.parent.redLineIsOn=false;
this.pointFOIs=new Array();
this.lineFOIs=new Array();
this.lineFOI=new Array();
};
this.setMarkerImage=function(h,l,k){this.imageSrc=h;
this.imageWidth=l;
this.imageHeight=k;
};
this.getPolygon=function(){var h=this.lineFOI.length;
if(h>=6&&this.lineFOI[0]==this.lineFOI[h-2]&&this.lineFOI[1]==this.lineFOI[h-1]){var k=MVSdoGeometry.createPolygon(this.lineFOI,this.parent.srid);
return k;
}else{return null;
}};
this.getSdoGeometry=function(){var h=this.lineFOI.length;
var k=null;
if(h>=6&&this.lineFOI[0]==this.lineFOI[h-2]&&this.lineFOI[1]==this.lineFOI[h-1]){k=MVSdoGeometry.createPolygon(this.lineFOI,this.parent.srid);
}else{if(h>=4){k=MVSdoGeometry.createLineString(this.lineFOI,this.parent.srid);
}else{if(h==2){k=MVSdoGeometry.createPoint(this.lineFOI,this.parent.srid);
}}}return k;
};
this.getPolygonFOI=function(){if(this.gtype==3){return this.parent.getFOI("-RL2RL"+this.id);
}else{return null;
}};
this.getFOI=function(){return this.parent.getFOI("-RL2RL"+this.id);
};
this.getOrdinates=function(){return this.lineFOI;
};
this.addEventListener=function(h,k){this.setEventListener(h,k);
};
this.setEventListener=function(h,k){if(h==MVEvent.NEW_SHAPE_POINT||h==MVEvent.MOUSE_CLICK){this.mouseClickListener=k;
}else{if(h=="on_finish"||h==MVEvent.FINISH){this.onFinishListener=k;
}else{if(h==MVEvent.MODIFY){this.onEditFinishListener=k;
}}}};
this.attachEventListener=function(h,k){MVUtil.attachEventListener(g.EventListeners,h,k);
};
this.detachEventListener=function(h,k){MVUtil.detachEventListener(g.EventListeners,h,k);
};
}MVRedlineTool.prototype.setAutoClose=function(a){this.autoClose=a;
};
MVRedlineTool.prototype.setEditingMode=function(a){if(!a){this.editingMode={deletePoint:false,dragPoint:false,deleteLine:false,dragLine:false};
}else{this.editingMode=a;
}};
MVRedlineTool.prototype.getEditingMode=function(){return this.editingMode;
};
MVRedlineTool.prototype.setGeneratePolygonTop=function(a){this.generatePolygonTop=a;
};
MVRedlineTool.prototype.setFillArea=function(a){this.fillArea=a;
};
MVRedlineTool.prototype.getPointNumber=function(){return this.pointFOIs.length;
};
MVRedlineTool.prototype.getPointFOIs=function(){return this.pointFOIs;
};
MVRedlineTool.prototype.getLineFOIs=function(){return this.lineFOIs;
};
MVRedlineTool.prototype.setRenderingStyle=function(g,a){if(a&&!(typeof(a)=="string"||(typeof(a)=="object"&&a.getXMLString!=null))){MVi18n.reportError("MVRedlineTool.setRenderingStyle","MAPVIEWER-05519","objStyle",this.parent?this.parent.errorHandler:null);
}else{switch(g){case MVRedlineTool.STYLE_POINT:if(!a){var b=new MVStyleMarker(MVGlobalVariables.redlineMarkerStyleName,"vector");
b.setStrokeColor("000000");
b.setStrokeWidth(1.5);
b.setFillColor("ff5555");
b.setVectorShape("c:30");
this.pointStyle=b;
}else{this.pointStyle=a;
}break;
case MVRedlineTool.STYLE_LINE:if(!a){var f='<svg width="1in" height="1in"><desc/><g class="line" style="stroke-width:1.0"><line class="base" style="fill:#000066;stroke-width:1.0" dash="5.0,3.0"/></g></svg>';
var d=new MVXMLStyle(MVGlobalVariables.redlineLineStyleName,f);
this.lineStyle=d;
}else{this.lineStyle=a;
}break;
case MVRedlineTool.STYLE_AREA:if(!a){var d=new MVStyleColor(MVGlobalVariables.redlineAreaStyleName,"FF0000","FF0000");
d.setFillOpacity(100);
this.areaStyle=d;
}else{this.areaStyle=a;
}break;
}}};
MVRedlineTool.prototype.getVertex=function(f){var a=this.pointFOIs.length;
var g=null;
var b=null;
if(f!=null){if(isNaN(f)){var d=0;
for(;
d<a;
++d){if(this.pointFOIs[d]==f){g=f;
b=d;
break;
}}}else{if(f<a&&f>=0){g=this.pointFOIs[f];
b=f;
}else{if(f==a){b=f;
}}}}return[g,b];
};
MVRedlineTool.prototype.getEdge=function(g){var a=this.lineFOIs.length;
var b=null;
var f=-1;
if(g!=null){if(isNaN(g)){var d=0;
for(;
d<a;
++d){if(this.lineFOIs[d]==g){b=g;
f=d;
break;
}}}else{if(g<a&&g>=0){b=this.pointFOIs[g];
f=g;
}}}return[b,f];
};
MVRedlineTool.prototype.removeVertex=function(f){if(!this.editingMode.deletePoint){return;
}var h=this.getVertex(f);
if(!h||!h[0]){return;
}var k=h[0];
var a=h[1];
var g=this.pointFOIs.length;
this.pointFOIs.splice(a,1);
var m=(a*2);
this.lineFOI.splice(m,2);
this.parent.removeFOI(k);
var b=a>0?true:false;
var l=(a<(g-1))?true:false;
var d=null;
if(b&&l){d=this.lineFOIs[a-1];
if(!this.parent.wraparound){d.updateGeometry(MVSdoGeometry.createLineString(this.lineFOI.slice((m-2),(m+2)),(this.parent.srid)));
}d=this.lineFOIs[a];
this.parent.removeFOI(d);
this.lineFOIs.splice(a,1);
}else{if(b){d=this.lineFOIs[a-1];
this.parent.removeFOI(d);
this.lineFOIs.splice((a-1),1);
}else{if(l){d=this.lineFOIs[a];
this.parent.removeFOI(d);
this.lineFOIs.splice(a,1);
}}}if(this.parent.wraparound){this.refreshRedline(true);
}if(this.onEditFinishListener){this.onEditFinishListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.MODIFY);
};
MVRedlineTool.prototype.removeEdge=function(g,f){if(!this.editingMode.deleteLine){return;
}var d=this.getEdge(g);
if(!d||!d[0]){return;
}var a=d[0];
var b=d[1];
if(f=="left"){this.removeVertex(b);
}else{this.removeVertex(b+1);
}};
MVRedlineTool.prototype.moveVertex=function(h,m,b){if(!this.editingMode.dragPoint){return;
}var l=this.getVertex(h);
if(!l||!l[0]){return;
}var o=l[0];
var d=l[1];
if(b>this.parent.msi.coverMaxY){b=this.parent.msi.coverMaxY;
}else{if(b<this.parent.msi.coverMinY){b=this.parent.msi.coverMinY;
}}o.areacode=MVUtil.calAreaCodeFromCenter(this.parent,m);
o.updateGeometry(MVSdoGeometry.createPoint(m,b,(this.parent.srid)));
var r=(d*2);
this.lineFOI[r]=m;
this.lineFOI[r+1]=b;
var k=this.pointFOIs.length;
var f=d>0?true:false;
var n=(d<(k-1))?true:false;
var g=null;
var a=this;
this.afterMove=function(){a.moveToNewEdge(f,n,d,r,o,m,b);
if(a.onEditFinishListener){a.onEditFinishListener();
}MVUtil.runListeners(a.EventListeners,MVEvent.MODIFY);
};
};
MVRedlineTool.prototype.moveToNewEdge=function(f,h,b,g,l,a,k){if(this.parent.wraparound){this.refreshRedline(true);
}else{if(f){var d=this.lineFOIs[b-1];
d.updateGeometry(MVSdoGeometry.createLineString(this.lineFOI.slice((g-2),(g+2)),(this.parent.srid)));
}if(h){var d=this.lineFOIs[b];
d.updateGeometry(MVSdoGeometry.createLineString(this.lineFOI.slice(g,(g+4)),(this.parent.srid)));
}}};
MVRedlineTool.prototype.moveEdge=function(f,s,r){if(!this.editingMode.dragLine){return;
}var l=this.getEdge(f);
if(!l||!l[0]){return;
}var m=l[0];
var d=l[1];
var o=(d*2);
this.lineFOI[o]=this.lineFOI[o]+s;
this.lineFOI[o+1]=this.lineFOI[o+1]+r;
if(this.lineFOI[o+1]>this.parent.msi.coverMaxY){this.lineFOI[o+1]=this.parent.msi.coverMaxY;
}else{if(this.lineFOI[o+1]<this.parent.msi.coverMinY){this.lineFOI[o+1]=this.parent.msi.coverMinY;
}}this.lineFOI[o+2]=this.lineFOI[o+2]+s;
this.lineFOI[o+3]=this.lineFOI[o+3]+r;
if(this.lineFOI[o+3]>this.parent.msi.coverMaxY){this.lineFOI[o+3]=this.parent.msi.coverMaxY;
}else{if(this.lineFOI[o+3]<this.parent.msi.coverMinY){this.lineFOI[o+3]=this.parent.msi.coverMinY;
}}var b=m.node;
if(MVGlobalVariables.browserClass==2){if(!(f.mouseDownX)){f.mouseDownX=b.style.pixelLeft;
f.mouseDownY=b.style.pixelTop;
}b.style.pixelLeft=f.mouseDownX+this.pointdx;
b.style.pixelTop=f.mouseDownY+this.pointdy;
}else{if(!(f.mouseDownX)){f.mouseDownX=MVUtil.getLeft(b);
f.mouseDownY=MVUtil.getTop(b);
}b.style.left=(f.mouseDownX+this.pointdx)+"px";
b.style.top=(f.mouseDownY+this.pointdy)+"px";
}var k=this.pointFOIs.length;
var g=d>0?true:false;
var n=(d<(k-2))?true:false;
var h=null;
var a=this;
this.afterMove=function(){a.moveToNewEdge2(g,n,d,o,m);
if(a.onEditFinishListener){a.onEditFinishListener();
}MVUtil.runListeners(a.EventListeners,MVEvent.MODIFY);
};
};
MVRedlineTool.prototype.moveToNewEdge2=function(f,h,d,g,a){this.pointFOIs[d].areacode=MVUtil.calAreaCodeFromCenter(this.parent,this.lineFOI[g]);
this.pointFOIs[d+1].areacode=MVUtil.calAreaCodeFromCenter(this.parent,this.lineFOI[g+2]);
this.pointFOIs[d].updateGeometry(MVSdoGeometry.createPoint(this.lineFOI[g],this.lineFOI[g+1],(this.parent.srid)));
this.pointFOIs[d+1].updateGeometry(MVSdoGeometry.createPoint(this.lineFOI[g+2],this.lineFOI[g+3],(this.parent.srid)));
if(this.parent.wraparound){this.refreshRedline(true);
}else{a.updateGeometry(MVSdoGeometry.createLineString(this.lineFOI.slice(g,(g+4)),(this.parent.srid)));
if(f){var b=this.lineFOIs[d-1];
b.updateGeometry(MVSdoGeometry.createLineString(this.lineFOI.slice((g-2),(g+2)),(this.parent.srid)));
}if(h){var b=this.lineFOIs[d+1];
b.updateGeometry(MVSdoGeometry.createLineString(this.lineFOI.slice(g+2,(g+6)),(this.parent.srid)));
}}a.mouseDownX=null;
a.mouseDownY=null;
};
MVRedlineTool.prototype.addVertex=function(a,l,b){var k=this.getVertex(a);
if(!k||!k[1]&&a!=this.pointFOIs.length){return;
}var n=k[0];
var d=k[1];
var h=this.pointFOIs.length;
var f=null;
var o="-RL8RL"+this.id+"_"+(++this.pointId);
if(this.imageSrc){f=new MVFOI(o,MVSdoGeometry.createPoint(l,b,this.parent.srid),"",this.imageSrc,this.imageWidth,this.imageHeight);
}else{f=new MVFOI(o,MVSdoGeometry.createPoint(l,b,this.parent.srid),this.pointStyle,null,12,12);
}if(this.generatePolygonTop){f.setZIndex(this.pointGenerateOnTopZIndex);
}f.enableInfoTip(false);
f.isRedLinePoint=true;
f.enableInfoWindow(false);
f.objType4RedLineTool=-1;
f.setEventListener(MVEvent.MOUSE_RIGHT_CLICK,this.foiMouseRightClickListener);
f.setEventListener(MVEvent.MOUSE_OVER,this.foiMouseOverListener);
f.setEventListener(MVEvent.MOUSE_OUT,this.foiMouseOutListener);
f.setMouseCursorStyle("pointer");
f.setBringToTopOnMouseOver(false);
f.setTopFlag(true);
f.areacode=MVUtil.calAreaCodeFromCenter(this.parent,l);
this.pointFOIs.splice(d,0,f);
var r=d*2;
this.lineFOI.splice(r,0,l,b);
this.parent.addFOI(f);
if(this.infoDecoration&&!this.infoDecoration.isVisible()&&this.infoDecorationVisible){this.infoDecoration.setVisible(true);
}if(this.pointFOIs.length==1){return;
}var m=d<h?true:false;
var g=null;
if(m){g=this.lineFOIs[d-1];
g.updateGeometry(MVSdoGeometry.createLineString(this.lineFOI.slice((r-2),(r+2)),(this.parent.srid)));
g=new MVFOI(("-RL6RL"+this.id+"_"+(++this.lineId)),MVSdoGeometry.createLineString(this.lineFOI.slice(r,(r+4)),(this.parent.srid)),this.lineStyle,this.serverURL);
g.setTopFlag(this.generatePolygonTop);
g.enableInfoTip(false);
g.enableInfoWindow(false);
g.objType4RedLineTool=-2;
g.setEventListener(MVEvent.MOUSE_RIGHT_CLICK,this.foiMouseRightClickListener);
g.setEventListener(MVEvent.MOUSE_OVER,this.foiMouseOverListener);
g.setEventListener(MVEvent.MOUSE_OUT,this.foiMouseOutListener);
g.setMouseCursorStyle("pointer");
g.setBringToTopOnMouseOver(false);
g.areacode=this.pointFOIs[d].areacode;
this.parent.addFOI(g);
this.lineFOIs.splice(d,0,g);
}else{g=new MVFOI(("-RL6RL"+this.id+"_"+(++this.lineId)),MVSdoGeometry.createLineString(this.lineFOI.slice(r-2,(r+2)),(this.parent.srid)),this.lineStyle,this.serverURL);
g.setTopFlag(this.generatePolygonTop);
g.enableInfoTip(false);
g.enableInfoWindow(false);
g.objType4RedLineTool=-2;
g.setEventListener(MVEvent.MOUSE_RIGHT_CLICK,this.foiMouseRightClickListener);
g.setEventListener(MVEvent.MOUSE_OVER,this.foiMouseOverListener);
g.setEventListener(MVEvent.MOUSE_OUT,this.foiMouseOutListener);
g.setMouseCursorStyle("pointer");
g.setBringToTopOnMouseOver(false);
g.areacode=this.pointFOIs[d].areacode;
this.parent.addFOI(g);
this.lineFOIs.push(g);
}};
MVRedlineTool.STYLE_POINT="point";
MVRedlineTool.STYLE_LINE="line";
MVRedlineTool.STYLE_AREA="area";
function MVRectangleTool(d,f){this.parent=null;
this.rectangleDiv=document.createElement("div");
this.innerRectangleDiv=null;
this.rectangleDiv.style.position="absolute";
this.rectangleDiv.style.zIndex=5000;
this.rectangleDiv.style.border="#FF0000 2px dashed";
this.rectangleDiv.style.visibility="hidden";
this.divWidth=2;
this.foiServerUrl=f;
this.areaStyle=d;
this.fromLon=0;
this.fromLat=0;
this.toLon=0;
this.toLat=0;
this.scrollMapFromLon=0;
this.scrollMapFromLat=0;
this.EventListeners=new Object();
this.onStartListener=null;
this.onFinishListener=null;
this.onDragListener=null;
this.mouseupHandler=null;
this.sdoGeometry=null;
var b=MVGlobalVariables.rectangleToolId;
++b;
MVGlobalVariables.rectangleToolId=b;
this.id=b;
this.dragStatus=0;
this.browser="NS";
var a=this;
this.keyPressFunc=function(g){g=(g)?g:((window.event)?event:null);
if(a.parent.enableMapEventListner){MVUtil.stopEvent(g);
}};
this.disableKeyPress=function(){if(this.netscape==null){if(MVGlobalVariables.checkBrowser("netscape")){this.netscape=true;
}else{this.netscape=false;
}}if(this.netscape){window.addEventListener("keypress",this.keyPressFunc,false);
}};
this.enableKeyPress=function(){if(this.netscape==null){if(MVGlobalVariables.checkBrowser("netscape")){this.netscape=true;
}else{this.netscape=false;
}}if(this.netscape){window.removeEventListener("keypress",this.keyPressFunc,false);
}};
this.refreshRetangle=function(){var h=a.parent;
if(h.wraparound){if(a.getStatus()==3){var g=a.getRectangleFOI();
if(g){g.areacode=a.parent.indFOIsControl.centerArea;
}}}};
this.OldMapDragginValue=null;
}MVRectangleTool.prototype.setDivBorderStyle=function(b,f,a){var h="#FF0000";
if(b&&b!=""){h=b;
}var g="1px";
if(f){g=f+"px";
this.divWidth=f;
}var d="dashed";
if(a!=""){d=a;
}this.rectangleDiv.style.border=h+" "+g+" "+d;
};
MVRectangleTool.prototype.setDivFillColor=function(a,b){if(!this.innerRectangleDiv){this.innerRectangleDiv=document.createElement("div");
this.innerRectangleDiv.style.width="100%";
this.innerRectangleDiv.style.height="100%";
this.rectangleDiv.appendChild(this.innerRectangleDiv);
}if(a&&a!=""){if(this.innerRectangleDiv.style.setAttribute){this.innerRectangleDiv.style.cssText+=";background-color:"+a;
}else{this.innerRectangleDiv.style.backgroundColor=a;
}}if(isNaN(b)||b<0||b>1){MVi18n.reportError("MVRectangleTool.setDivFillColor","MAPVIEWER-05519","opacity",this.parent?this.parent.errorHandler:null);
return;
}else{if(window.ActiveXObject){this.innerRectangleDiv.style.opacity=b;
this.innerRectangleDiv.style.filter="alpha(opacity="+(b*100)+")";
}else{this.innerRectangleDiv.style.opacity=b;
}}};
MVRectangleTool.prototype.setAreaStyle=function(a){this.areaStyle=a;
};
MVRectangleTool.prototype.startDrag=function(){this.fromLon=this.parent.getMouseCursorLon();
this.fromLat=this.parent.getMouseCursorLat();
};
MVRectangleTool.prototype.endDrag=function(){this.toLon=this.parent.getMouseCursorLon();
this.toLat=this.parent.getMouseCursorLat();
var a=Math.abs(this.toLon-this.fromLon);
var b=this.parent.msi.coverMaxX-this.parent.msi.coverMinX;
if(a>b){if(this.fromLon<this.toLon){this.toLon=this.fromLon+b;
}else{this.toLon=this.fromLon-b;
}}};
MVRectangleTool.prototype.hideRectangleDIV=function(){this.rectangleDiv.style.width="0px";
this.rectangleDiv.style.height="0px";
this.rectangleDiv.style.clip="rect(0px, 0px, 0px, 0px)";
this.rectangleDiv.style.visibility="hidden";
};
MVRectangleTool.prototype.drawArea=function(){if(this.dragStatus!=3){return;
}var l=(this.fromLon-this.parent.getCenterLon())*this.parent.pixPerX+(this.parent.getPaneWidth()/2);
var h=(this.fromLat-this.parent.getCenterLat())*(-this.parent.pixPerY)+(this.parent.getPaneHeight()/2);
var k=(this.toLon-this.parent.getCenterLon())*this.parent.pixPerX+(this.parent.getPaneWidth()/2);
var g=(this.toLat-this.parent.getCenterLat())*(-this.parent.pixPerY)+(this.parent.getPaneHeight()/2);
var f=Math.abs(l-k);
var a=Math.abs(h-g);
f=Math.round(f);
a=Math.round(a);
var d=(l<k?l:k);
var b=(h<g?h:g);
d=Math.round(d);
b=Math.round(b);
this.rectangleDiv.style.left=d-1-MVUtil.getLeft(this.parent.div)+"px";
this.rectangleDiv.style.top=b-1-MVUtil.getTop(this.parent.div)+"px";
if(f>0){f++;
}if(a>0){a++;
}if(this.browser=="NS"){if(f==0){f=(2*this.divWidth);
}if(a==0){a=(2*this.divWidth);
}this.rectangleDiv.style.width=Math.abs(f-(2*this.divWidth))+"px";
this.rectangleDiv.style.height=Math.abs(a-(2*this.divWidth))+"px";
this.rectangleDiv.style.clip="rect(0px, "+(f)+"px, "+(a)+"px, 0px)";
}else{this.rectangleDiv.style.width=f+"px";
this.rectangleDiv.style.height=a+"px";
this.rectangleDiv.style.clip="rect(0px, "+(f+(2*this.divWidth))+"px, "+(a+(2*this.divWidth))+"px, 0px)";
}this.rectangleDiv.style.visibility="visible";
};
MVRectangleTool.prototype.generateArea=function(){if(this.dragStatus!=3){return;
}this.parent.removeFOI("MVRectangleTool"+this.id);
if(!this.areaStyle){return;
}this.hideRectangleDIV();
if(this.fromLon!=this.toLon&&this.fromLat!=this.toLat){this.getRectangle();
var a=new MVFOI("MVRectangleTool"+this.id,this.sdoGeometry,this.areaStyle,this.foiServerUrl);
a.areacode=MVUtil.calAreaCodeFromCenter(this.parent,this.fromLon<this.toLon?this.fromLon:this.toLon);
a.setClickable(false);
a.enableInfoTip(false);
this.parent.addFOI(a);
}else{this.sdoGeometry=null;
}};
MVRectangleTool.prototype.init=function(){this.hideRectangleDIV();
this.parent.removeFOI("MVRectangleTool"+this.id);
this.dragStatus=0;
this.dragStatus=1;
MVUtil.clearListeners(this.rectangleDiv);
var b=this.parent;
var d=b.base_div;
var f=this;
this.fromLon=this.fromLat=this.toLon=this.toLat=0;
var g;
MVUtil.runListeners(f.EventListeners,MVEvent.INIT,[MVToolBar.BUILTIN_RECTANGLE]);
this.browser=this.parent.getBrowserType();
var a=function(){b.enableMapEventListner=true;
var k=b.getCenterLon();
var h=b.getCenterLat();
if((f.scrollMapFromLon)!=k||(f.scrollMapFromLat)!=h){if(f.dragStatus==2){f.dragStatus=3;
}f.toLon+=(k-f.scrollMapFromLon);
f.toLat+=(h-f.scrollMapFromLat);
f.scrollMapFromLon=k;
f.scrollMapFromLat=h;
f.drawArea();
}};
if(this.mousedownHandler){MVUtil.detachEvent(d,"mousedown",this.mousedownHandler,false);
}this.mousedownHandler=MVUtil.closureWrapper(d,function(h){f.OldMapDragginValue=b.draggingEnabled;
b.draggingEnabled=false;
b.removeFOI("MVRectangleTool"+f.id);
f.dragStatus=2;
h=(h)?h:((window.event)?event:null);
var l=b.getEventCoords(h);
b.mouseDownLoc=l;
b.getMPos(h);
var m=MVUtil.getMouseXY(h);
b.mouseDownScreenX=m.x;
b.mouseDownScreenY=m.y;
f.startDrag();
f.endDrag();
f.rectangleDiv.style.visibility="hidden";
if(f.onStartListener!=null){(f.onStartListener)();
}MVUtil.runListeners(f.EventListeners,MVEvent.START);
f.scrollMapFromLon=b.getCenterLon();
f.scrollMapFromLat=b.getCenterLat();
var k=5;
g=setInterval(a,k);
f.disableKeyPress();
return false;
});
MVUtil.attachEvent(d,"mousedown",this.mousedownHandler,false);
if(this.mousemoveHandler){MVUtil.detachEvent(d,"mousemove",this.mousemoveHandler,false);
}this.mousemoveHandler=MVUtil.closureWrapper(d,function(h){if(f.dragStatus==2){f.dragStatus=3;
}if(f.dragStatus==3){h=(h)?h:((window.event)?event:null);
b.getMPos(h);
f.endDrag();
f.drawArea();
if(f.onDragListener){f.onDragListener();
}MVUtil.runListeners(f.EventListeners,MVEvent.DRAG);
}return false;
});
MVUtil.attachEvent(d,"mousemove",this.mousemoveHandler,false);
if(this.mouseupHandler){MVUtil.detachEvent(d,"mouseup",this.mouseupHandler,false);
}this.mouseupHandler=MVUtil.closureWrapper(d,function(h){if(f.dragStatus==0||f.dragStatus==1){return false;
}if(f.OldMapDragginValue!=null){b.draggingEnabled=f.OldMapDragginValue;
}MVUtil.detachEvent(d,"mousedown",f.mousedownHandler,false);
MVUtil.detachEvent(d,"mousemove",f.mousemoveHandler,false);
MVUtil.detachEvent(d,"mouseup",f.mouseupHandler,false);
MVUtil.detachEvent(d,"mouseout",f.mouseoutHandler,false);
clearInterval(g);
h=(h)?h:((window.event)?event:null);
var k=b.getEventCoords(h);
b.mouseUpLoc=k;
b.getMPos(h);
var l=MVUtil.getMouseXY(h);
b.mouseUpScreenX=l.x;
b.mouseUpScreenY=l.y;
if(f.dragStatus==3){f.endDrag();
f.generateArea();
f.enableKeyPress();
if(f.onFinishListener){(f.onFinishListener)();
}MVUtil.runListeners(f.EventListeners,MVEvent.FINISH,[MVUtil.getEvent(h)]);
}else{f.init();
}return false;
});
MVUtil.attachEvent(d,"mouseup",this.mouseupHandler,false);
if(this.mouseoutHandler){MVUtil.detachEvent(d,"mouseout",this.mouseoutHandler,false);
}this.mouseoutHandler=MVUtil.closureWrapper(d,function(l){if(f.dragStatus!=3){return false;
}if(f.browser=="NS"||f.browser=="OS"){l=(l)?l:((window.event)?event:null);
var s=l.clientX;
var r=l.clientY;
var o=b.getPaneWidth();
var k=b.getPaneHeight();
var h=MVUtil.offsetPositionAbsolute(this);
var n=l.pageX-h.x;
var m=l.pageY-h.y;
if(n<=0||n>=o||m<=0||m>=k||s<=0||s>=document.body.clientWidth||r<=0||r>=document.body.clientHeight){return f.mouseupHandler(l);
}}});
MVUtil.attachEvent(d,"mouseout",this.mouseoutHandler,false);
this.parent.indFOIsControl.attachEventListener("refreshFOI",this.refreshRetangle);
MVUtil.runListeners(f.EventListeners,MVEvent.START,[MVToolBar.BUILTIN_DISTANCE]);
};
MVRectangleTool.prototype.clear=function(){this.hideRectangleDIV();
this.parent.removeFOI("MVRectangleTool"+this.id);
this.dragStatus=0;
var a=this.parent.base_div;
MVUtil.detachEvent(a,"mousedown",this.mousedownHandler,false);
MVUtil.detachEvent(a,"mousemove",this.mousemoveHandler,false);
MVUtil.detachEvent(a,"mouseup",this.mouseupHandler,false);
MVUtil.detachEvent(a,"mouseout",this.mouseoutHandler,false);
if(this.OldMapDragginValue!=null){this.parent.draggingEnabled=this.OldMapDragginValue;
}MVUtil.runListeners(this.EventListeners,MVEvent.CLEAR);
};
MVRectangleTool.prototype.getRectangle=function(){if(this.fromLon!=this.toLon&&this.fromLat!=this.toLat){var m=this.parent.msi.coverMaxX-this.parent.msi.coverMinX;
if((this.toLon-this.fromLon)<m/2){this.sdoGeometry=MVSdoGeometry.createRectangle(this.fromLon,this.fromLat,this.toLon,this.toLat,this.parent.srid);
return this.sdoGeometry;
}else{var f=this.fromLon;
var n=this.fromLat;
var l=this.toLon;
var k=this.toLat;
var g=(l-f)/3;
var d=(l-f)/3*2;
var h=[f,n,f,k,f+g,k,f+d,k,l,k,l,n,f+d,n,f+g,n];
this.sdoGeometry=MVSdoGeometry.createPolygon(h,this.parent.srid);
return this.sdoGeometry;
}}else{return null;
}};
MVRectangleTool.prototype.getRectangleFOI=function(){return this.parent.getFOI("MVRectangleTool"+this.id);
};
MVRectangleTool.prototype.getRectangleDIV=function(){return this.rectangleDiv;
};
MVRectangleTool.prototype.addEventListener=function(a,b){this.setEventListener(a,b);
};
MVRectangleTool.prototype.setEventListener=function(a,b){if(a=="on_start"||a==MVEvent.START){this.onStartListener=b;
}else{if(a=="on_finish"||a==MVEvent.FINISH){this.onFinishListener=b;
}else{if(a=="on_drag"||a==MVEvent.DRAG){this.onDragListener=b;
}}}};
MVRectangleTool.prototype.attachEventListener=function(a,b){MVUtil.attachEventListener(this.EventListeners,a,b);
};
MVRectangleTool.prototype.detachEventListener=function(a,b){MVUtil.detachEventListener(this.EventListeners,a,b);
};
MVRectangleTool.prototype.getStatus=function(){return this.dragStatus;
};
MVRectangleTool.prototype.getWidth=function(a){if(!a){return Math.abs(this.fromLon-this.toLon);
}else{return MVSdoGeometry.getDistance(this.fromLon,this.fromLat,MVUtil.transLongitudeOnWarpAroungMap(this.parent,this.fromLon,this.toLon),this.fromLat,this.parent.srid,a);
}};
MVRectangleTool.prototype.getHeight=function(d){var b=this.fromLat;
var a=this.toLat;
if(b>this.parent.msi.coverMaxY){b=this.parent.msi.coverMaxY;
}else{if(b<this.parent.msi.coverMinY){b=this.parent.msi.coverMinY;
}}if(a>this.parent.msi.coverMaxY){a=this.parent.msi.coverMaxY;
}else{if(a<this.parent.msi.coverMinY){a=this.parent.msi.coverMinY;
}}if(!d){return Math.abs(b-a);
}else{return MVSdoGeometry.getDistance(this.fromLon,b,this.fromLon,a,this.parent.srid,d);
}};
MVRectangleTool.prototype.setDivStyle=function(f){var h="#FF0000";
var d=2;
var b="dashed";
var g="#555555";
var a=0.3;
if(f.borderColor!=undefined){h=f.borderColor;
}if(f.borderWidth!=undefined){d=f.borderWidth;
}if(f.borderDashed!=undefined){if(!f.borderDashed){b="solid";
}}if(f.fillColor!=undefined){g=f.fillColor;
}if(f.fillOpacity!=undefined){a=f.fillOpacity;
}this.setDivFillColor(g,a);
this.setDivBorderStyle(h,d,b);
};
function MVCircleTool(f,b){this.parent=null;
this.circleDiv=document.createElement("div");
this.circleDiv.style.position="absolute";
this.circleDiv.style.visibility="hidden";
this.circleDiv.style.zIndex=5000;
this.plotPara=new Object();
this.plotPara.divWidth=2;
this.plotPara.divHeight=2;
this.plotPara.zIndex=5001;
this.plotPara.backgroundColor="#FF0000";
this.plotPara.opacity=null;
this.foiServerUrl=b;
this.areaStyle=f;
this.fromLon=0;
this.fromLat=0;
this.toLon=0;
this.toLat=0;
this.stepPx=6;
this.scrollMapFromLon=0;
this.scrollMapFromLat=0;
this.EventListeners=new Object();
this.onStartListener=null;
this.onFinishListener=null;
this.onDragListener=null;
this.mRadius=null;
this.sdoGeometry=null;
var d=MVGlobalVariables.circleToolId;
MVGlobalVariables.circleToolId=(++d);
this.id=d;
this.namePrefix="MVCircleTool";
this.dragStatus=0;
this.refresh=false;
var a=this;
this.keyPressFunc=function(g){g=(g)?g:((window.event)?event:null);
if(a.parent.enableMapEventListner){MVUtil.stopEvent(g);
}};
this.disableKeyPress=function(){if(this.netscape==null){if(MVGlobalVariables.checkBrowser("netscape")){this.netscape=true;
}else{this.netscape=false;
}}if(this.netscape){window.addEventListener("keypress",this.keyPressFunc,false);
}};
this.enableKeyPress=function(){if(this.netscape==null){if(MVGlobalVariables.checkBrowser("netscape")){this.netscape=true;
}else{this.netscape=false;
}}if(this.netscape){window.removeEventListener("keypress",this.keyPressFunc,false);
}};
this.refreshCircle=function(){var g=a.parent;
if(g.wraparound){if(a.getStatus()==3){var h=a.getCircleFOI();
if(h){h.areacode=a.parent.indFOIsControl.centerArea;
}}}};
}MVCircleTool.prototype.setPlotDivSize=function(b,a){if(b!=null){if(isNaN(b)){MVi18n.reportError("MVCircleTool.setPlotDivSize","MAPVIEWER-05519","width",this.parent?this.parent.errorHandler:null);
}else{b=Math.round(b);
this.plotPara.divWidth=b;
}}if(a!=null){if(isNaN(a)){MVi18n.reportError("MVCircleTool.setPlotDivSize","MAPVIEWER-05519","height",this.parent?this.parent.errorHandler:null);
}else{a=Math.round(a);
this.plotPara.divHeight=a;
}}};
MVCircleTool.prototype.setPlotDivFillColor=function(a,b){if(a!=null&&a!=""){this.plotPara.backgroundColor=a;
}if(isNaN(b)||b<0||b>1){MVi18n.reportError("MVCircleTool.setPlotDivFillColor","MAPVIEWER-05519","opacity",this.parent?this.parent.errorHandler:null);
}else{this.plotPara.opacity=b;
}};
MVCircleTool.prototype.setPlotDivZindex=function(a){if(a!=null){if(isNaN(a)){MVi18n.reportError("MVCircleTool.setPlotDivZindex","MAPVIEWER-05519","zindex",this.parent?this.parent.errorHandler:null);
}else{this.plotPara.zIndex=a;
this.circleDiv.style.zIndex=(a-1);
}}};
MVCircleTool.prototype.startDrag=function(){this.fromLon=this.parent.getMouseCursorLon();
this.fromLat=this.parent.getMouseCursorLat();
};
MVCircleTool.prototype.endDrag=function(){this.toLon=this.parent.getMouseCursorLon();
this.toLat=this.parent.getMouseCursorLat();
};
MVCircleTool.prototype.drawCircle=function(){if(this.dragStatus!=3){return;
}var n=this.parent.pixPerX;
var m=this.parent.pixPerY;
var r=Math.round((this.fromLon-this.parent.getCenterLon())*n+(this.parent.getPaneWidth()/2));
var o=Math.round((this.fromLat-this.parent.getCenterLat())*(-m)+(this.parent.getPaneHeight()/2));
var A=(this.toLon-this.fromLon)*n;
var z=(this.toLat-this.fromLat)*(-m);
var f=Math.round(Math.sqrt(A*A+z*z));
var B=Math.floor(n*(this.parent.msi.coverMaxX-this.parent.msi.coverMinX)/2);
if(f>B){f=B;
this.mRadius=Math.floor((this.parent.msi.coverMaxX-this.parent.msi.coverMinX)/2);
}else{this.mRadius=f/n;
}var u=2*(f+this.plotPara.divWidth);
var s=2*(f+this.plotPara.divHeight);
var t=r-f-Math.round((this.plotPara.divWidth)/2);
var a=o-f-Math.round((this.plotPara.divHeight)/2);
this.circleDiv.style.left=t+"px";
this.circleDiv.style.top=a+"px";
this.circleDiv.style.width=u+"px";
this.circleDiv.style.height=s+"px";
this.circleDiv.style.clip="rect(0px, "+s+"px, "+u+"px, 0px)";
this.circleDiv.style.visibility="visible";
var l=(this.namePrefix+this.id+"PlotsDiv");
var d=document.getElementById(l);
if(d!=null){this.circleDiv.removeChild(d);
}d=document.createElement("div");
d.id=l;
d.style.position="absolute";
d.style.left=0+"px";
d.style.top=0+"px";
this.circleDiv.appendChild(d);
var k=(this.stepPx)/f;
k=k>1?1:k;
var h=Math.acos(k);
var g=Math.asin(k);
var b=h<g?h:g;
var C=50;
if(b==0){b=Math.PI/(2*C);
}var w=Math.ceil(Math.PI/(2*b));
for(var v=0;
v<w;
++v){var D=v*b;
A=Math.round(f*Math.cos(D));
z=Math.round(f*Math.sin(D));
this.plotPos((f+A),(f+z));
this.plotPos((f+A),(f-z));
this.plotPos((f-A),(f+z));
this.plotPos((f-A),(f-z));
}};
MVCircleTool.prototype.plotPos=function(g,f){var a=(this.namePrefix+this.id+"PlotsDiv");
var d=document.getElementById(a);
if(d==null){MVi18n.reportError("MVCircleTool.plotPos","MAPVIEWER-05500","null plodsDiv found",this.parent?this.parent.errorHandler:null);
return;
}var b=document.createElement("DIV");
b.style.position="absolute";
b.style.zIndex=this.plotPara.zIndex;
if(this.plotPara.backgroundColor!=null){b.style.backgroundColor=this.plotPara.backgroundColor;
}if((this.plotPara.opacity)!=null){if(window.ActiveXObject){b.style.filter="alpha(opacity="+((this.plotPara.opacity)*100)+")";
}else{b.style.opacity=this.plotPara.opacity;
}}b.style.left=g+"px";
b.style.top=f+"px";
b.style.width=(this.plotPara.divWidth)+"px";
b.style.height=(this.plotPara.divHeight)+"px";
b.style.clip="rect(0px, "+(this.plotPara.divWidth)+"px, "+(this.plotPara.divHeight)+"px, 0px)";
d.appendChild(b);
};
MVCircleTool.prototype.generateArea=function(){if(this.dragStatus!=3){return;
}var d=this.namePrefix+this.id;
this.parent.removeFOI(d);
var a=this.mRadius;
this.sdoGeometry=MVSdoGeometry.createCirclePolygon(this.fromLon,this.fromLat,a,this.parent.srid);
if(!(this.areaStyle)){return;
}var f=new MVFOI(d,this.sdoGeometry,this.areaStyle,this.foiServerUrl);
var b=this.fromLon-a;
f.areacode=MVUtil.calAreaCodeFromCenter(this.parent,b);
f.setClickable(false);
f.enableInfoTip(false);
this.parent.addFOI(f);
};
MVCircleTool.prototype.init=function(){this.parent.removeFOI(this.namePrefix+this.id);
this.dragStatus=0;
this.parent.addEventHandlers();
this.dragStatus=1;
var b=this.parent;
var f=b.base_div;
var d=this;
var g;
MVUtil.runListeners(d.EventListeners,MVEvent.INIT,[MVToolBar.BUILTIN_CIRCLE]);
var a=function(){b.enableMapEventListner=true;
var k=b.getCenterLon();
var h=b.getCenterLat();
if((d.scrollMapFromLon)!=k||(d.scrollMapFromLat)!=h||(d.refresh)){d.refresh=false;
if(d.dragStatus==2){d.dragStatus=3;
}d.toLon+=(k-d.scrollMapFromLon);
d.toLat+=(h-d.scrollMapFromLat);
d.scrollMapFromLon=k;
d.scrollMapFromLat=h;
d.drawCircle();
}};
MVUtil.setListener(f,"mousedown",MVUtil.closureWrapper(f,function(h){b.removeFOI(d.namePrefix+d.id);
d.dragStatus=2;
h=(h)?h:((window.event)?event:null);
MVUtil.stopEvent(h);
b.getMPos(h);
d.startDrag();
d.endDrag();
d.circleDiv.style.visibility="hidden";
if(d.onStartListener!=null){(d.onStartListener)();
}MVUtil.runListeners(d.EventListeners,MVEvent.START);
d.scrollMapFromLon=b.getCenterLon();
d.scrollMapFromLat=b.getCenterLat();
var k=5;
g=setInterval(a,k);
d.disableKeyPress();
return false;
}),true);
MVUtil.setListener(f,"mousemove",MVUtil.closureWrapper(f,function(h){b.getMPos(h);
if(d.dragStatus==2){d.dragStatus=3;
}if(d.dragStatus==3){h=(h)?h:((window.event)?event:null);
d.endDrag();
d.refresh=true;
if(d.onDragListener){d.onDragListener();
}MVUtil.runListeners(d.EventListeners,MVEvent.DRAG);
}return false;
}),true);
MVUtil.setListener(f,"mouseup",MVUtil.closureWrapper(f,function(h){h=(h)?h:((window.event)?event:null);
MVUtil.stopEvent(h);
b.getMPos(h);
d.endDrag();
d.generateArea();
var k=document.getElementById(d.namePrefix+d.id+"PlotsDiv");
if(k!=null){d.circleDiv.removeChild(k);
}d.circleDiv.style.width="0px";
d.circleDiv.style.height="0px";
d.circleDiv.style.clip="rect(0px, 0px, 0px, 0px)";
d.circleDiv.style.visibility="hidden";
clearInterval(g);
b.addEventHandlers();
d.enableKeyPress();
if(d.onFinishListener!=null){(d.onFinishListener)();
}MVUtil.runListeners(d.EventListeners,MVEvent.FINISH,[MVUtil.getEvent(h)]);
return false;
}),true);
f.onmouseout=MVUtil.closureWrapper(f,function(l){if(d.dragStatus!=3){return false;
}if(!(window.ActiveXObject)){l=(l)?l:((window.event)?event:null);
var s=l.clientX;
var r=l.clientY;
var o=b.getPaneWidth();
var k=b.getPaneHeight();
var h=MVUtil.offsetPositionAbsolute(this);
var n=l.pageX-h.x;
var m=l.pageY-h.y;
if(n<=0||n>=o||m<=0||m>=k||s<=0||s>=document.body.clientWidth||r<=0||r>=document.body.clientHeight){return this.onmouseup(l);
}}});
this.parent.indFOIsControl.attachEventListener("refreshFOI",this.refreshCircle);
};
MVCircleTool.prototype.clear=function(){this.parent.removeFOI(this.namePrefix+this.id);
this.dragStatus=0;
this.parent.addEventHandlers();
MVUtil.runListeners(this.EventListeners,MVEvent.CLEAR);
};
MVCircleTool.prototype.getCircle=function(){if(this.dragStatus==3&&this.mRadius){return MVSdoGeometry.createCircle(this.fromLon,this.fromLat,this.mRadius,this.parent.srid);
}else{if(this.sdoGeometry!=null){return(this.sdoGeometry);
}else{return null;
}}};
MVCircleTool.prototype.getCirclePolygon=function(){if(this.dragStatus==3&&this.mRadius){return MVSdoGeometry.createCirclePolygon(this.fromLon,this.fromLat,this.mRadius,this.parent.srid);
}else{if(this.sdoGeometry!=null){return(this.sdoGeometry);
}else{return null;
}}};
MVCircleTool.prototype.getRadius=function(b){var a=this.parent.srid;
var d=(a===54004||a===3785||a===3857);
if(!b){return MVSdoGeometry.getDistance(this.fromLon,this.fromLat,this.toLon,this.toLat,this.parent.srid,null,d);
}else{return MVSdoGeometry.getDistance(this.fromLon,this.fromLat,this.toLon,this.toLat,this.parent.srid,b,d);
}};
MVCircleTool.prototype.getRadius2=function(a){if(!a){return MVSdoGeometry.getDistance(this.fromLon,this.fromLat,this.toLon,this.toLat,this.parent.srid,null,false);
}else{return MVSdoGeometry.getDistance(this.fromLon,this.fromLat,this.toLon,this.toLat,this.parent.srid,a,false);
}};
MVCircleTool.prototype.getCenter=function(){return MVSdoGeometry.createPoint(this.fromLon,this.fromLat,this.parent.srid);
};
MVCircleTool.prototype.getCircleFOI=function(){return this.parent.getFOI(this.namePrefix+this.id);
};
MVCircleTool.prototype.addEventListener=function(a,b){this.setEventListener(a,b);
};
MVCircleTool.prototype.setEventListener=function(a,b){if(a=="on_start"||a==MVEvent.START){this.onStartListener=b;
}else{if(a=="on_finish"||a==MVEvent.FINISH){this.onFinishListener=b;
}else{if(a=="on_drag"||a==MVEvent.DRAG){this.onDragListener=b;
}}}};
MVCircleTool.prototype.attachEventListener=function(a,b){MVUtil.attachEventListener(this.EventListeners,a,b);
};
MVCircleTool.prototype.detachEventListener=function(a,b){MVUtil.detachEventListener(this.EventListeners,a,b);
};
MVCircleTool.prototype.getStatus=function(){return this.dragStatus;
};
MVCircleTool.prototype.setAreaStyle=function(a){this.areaStyle=a;
};
function MVi18n(){}MVi18n.methodType=null;
MVi18n.methodName=null;
MVi18n.argType=null;
MVi18n.URL=null;
MVi18n.language=null;
MVi18n.country=null;
MVi18n.fetched=false;
MVi18n.timeoutCount=0;
MVi18n.isFetched=function(){if(MVi18n.fetched){return true;
}MVi18n.timeoutCount++;
if(MVi18n.timeoutCount>10){MVi18n.fetched=true;
}return MVi18n.fetched;
};
MVi18n.reportError=function(d,b,f,a){if(f){f=" ("+f+")";
}else{f="";
}if(a){a("["+d+"] "+MVi18n.getErrorMessage(b)+f);
}else{MVi18n.alert("["+d+"] "+MVi18n.getErrorMessage(b)+f);
}};
MVi18n.getErrorMessage=function(a){if(MVMessages[a]){return a+": "+MVMessages[a];
}else{return a;
}};
MVi18n.getInfoMessage=function(a){if(MVMessages[a]){return MVMessages[a];
}else{return"";
}};
MVi18n.fetchMessages=function(){if(MVi18n.URL==null){return;
}var localDomain=MVUtil.isLocalDomain(MVi18n.URL);
var xmlHttp=localDomain||MVMapView.XMLHTTPEnabled;
var url=null;
url=MVi18n.URL+"/mcserver";
try{var req=MVUtil.getXMLHttpRequest(xmlHttp);
req.open("POST",MVUtil.getXMLHttpUrl(url),true);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.onreadystatechange=MVUtil.closureWrapper(req,function(){try{if(this.readyState!=4){return;
}if(this.status==200){text=this.responseText;
}MVUtil.gc();
eval(text);
MVi18n.fetched=true;
}catch(e){MVi18n.fetched=true;
return;
}});
var params="request=getinfomsgs";
if(MVi18n.language){params=params+"&language="+MVi18n.language;
}if(MVi18n.country){params=params+"&country="+MVi18n.country;
}req.send(MVUtil.getXMLHttpReq(url,params));
}catch(ex){MVi18n.reportError("MVi18n.fetchMessages","MAPVIEWER-05511",ex);
}};
MVi18n.addBehavior=function(d,b,a){if(d==null||(d!="func"&&d!="eval")){MVi18n.alert("MethodType Error");
return;
}if(!b){MVi18n.alert("MethodName Error");
return;
}if(a==null||((a.toLowerCase())!="url"&&(a.toLowerCase())!="text")){MVi18n.alert("ArgType Error");
return;
}MVi18n.methodType=d;
MVi18n.methodName=b;
MVi18n.argType=a;
};
MVi18n.setURL=function(a){if(a==null||a==""){MVi18n.alert("Parameter should not be null or empty. Error occurs in MVi18n.setURL(...)");
return;
}MVi18n.URL=a;
};
MVi18n.alert=function(b){if(MVi18n.methodName){var a=MVi18n.methodName;
a(b);
}else{alert(b);
}};
function MVMapView(a,d){if(!a){MVi18n.reportError("MVMapView.constructor","MAPVIEWER-05519","mapDiv");
return;
}this.mvId=MVGlobal_mvCount++;
if(MVGlobalVariables.isSelfDestroy()){MVUtil.clearInvalidMapIns(a);
}MVUtil.objArray.push(this);
if(!MVi18n.methodName){MVi18n.addBehavior("func",alert,"text");
}this.center=null;
this.originalCenter=null;
this.reCenterTag=false;
this.mapCenterX=0;
this.mapCenterY=0;
this.pixPerX=0;
this.pixPerY=0;
this.tileWidth=0;
this.tileHeight=0;
this.mapBufferX=200;
this.mapBufferY=200;
this.mapTileNumX=0;
this.mapTileNumY=0;
this.mapCacheOffSet=1;
this.mapDrawOffsetX=0;
this.mapDrawOffsetY=0;
this.zoomLevel=0;
this.loaded=false;
this.layer_created=false;
this.mapScreenCenterX=0;
this.mapScreenCenterY=0;
this.mapMinMesh=null;
this.mapCntMesh=null;
this.mouseCurLon=0;
this.mouseCurLat=0;
this.mapMinLon=0;
this.mapMinLat=0;
this.mapMaxLon=0;
this.mapMaxLat=0;
this.mapWindowMinLon=0;
this.mapWindowMinLat=0;
this.mapWindowMaxLon=0;
this.mapWindowMaxLat=0;
this.scrolled=false;
this.msi=null;
this.mapLockMode=false;
this.mapmoveflag=true;
this.curLay=null;
this.TileW=new Array();
this.TileH=new Array();
this.m_scroll_id=null;
this.mapLayers=new Array();
this.mapLayerNumber=0;
this.ThemeBasedFOIGroup=new Array();
this.infoLayer=null;
this.infoLayer2=null;
this.indFOIsControl=null;
this.scalectl=null;
this.scalebarPosition=2;
this.scalebarOffsetWidth=4;
this.scalebarOffsetHeight=4;
this.scalectl_print=null;
this.mouseOnInfoWindow=false;
this.maxZoom=0;
this.displayed=false;
this.printHtml=new Array();
this.overviewmap=null;
this.overview=false;
this.zoomflag=true;
this.transformFunction=null;
this.srid=null;
this.count=0;
this.originLocation=null;
this.originZoomLevel=0;
this.mouseWheelZoomEnabled=true;
this.marqueeZoomMode="one_time";
this.marqueeZoomOn=false;
this.marqueeZoomRectangleTool=null;
this.marqueeRectDone=false;
this.marqueeRectClicked=false;
this.clearMarqueeRect=false;
this.handlersAdded=false;
this.mapDecorationArray=null;
this.mapDecorationId=1;
this.centerMarkUrl=null;
this.centerMarkW=0;
this.centerMarkH=0;
this.EventListeners=new Object();
var f=String(document.location);
var g=f.indexOf("//");
this.localbaseURL=MVGlobalVariables.getLocalBaseURL();
this.cfgbaseURL=this.localbaseURL;
this.baseURL=this.localbaseURL;
this.cursorStyleDefault="default";
this.cursorStyleDragging="move";
this.currentCursor="default";
if(d){this.cfgbaseURL=d;
this.baseURL=d;
if(MVUtil.strEndWith(d,"/")){this.cfgbaseURL=d.substring(0,d.length-1);
this.baseURL=d.substring(0,d.length-1);
}}this.baseURL=MVUtil.getAbsoluteURL(this.baseURL);
MVGlobalVariables.defaultFoiURL=this.baseURL+"/foi";
if(MVGlobalVariables.imgFilePath==MVGlobalVariables.imgRelPath){MVGlobalVariables.imgFilePath=this.baseURL+MVGlobalVariables.imgRelPath;
}MVi18n.setURL(this.baseURL);
if(a==null){return null;
}MVUtil.clearNode(a);
this.real_base_div=a;
if(this.real_base_div.style.position!="absolute"){this.real_base_div.style.position="relative";
}if(MVGlobalVariables.touchSupported){this.real_base_div.style.webkitTapHighlightColor="rgba(0, 0, 0, 0)";
}this.base_div=document.createElement("div");
this.real_base_div.appendChild(this.base_div);
this.base_div.style.position="absolute";
this.base_div.style.left=MVUtil.pixel(0);
this.base_div.style.top=MVUtil.pixel(0);
this.base_div.style.width="100%";
this.base_div.style.height="100%";
MVUtil.disableElementSelection(this.base_div);
MVUtil.disableElementSelection(this.real_base_div);
this.base_div.style.overflow="hidden";
this.transImage=document.createElement("img");
this.transImage.src=MVGlobalVariables.imgFilePath+"transparent."+(MVGlobalVariables.browser=="IF"?"gif":"png");
this.transImage.src+="?refresh="+(new Date()).getTime();
this.transImage.style.position="absolute";
this.transImage.style.left=MVUtil.pixel(0);
this.transImage.style.top=MVUtil.pixel(0);
this.transImage.onload=MVUtil.closureWrapper(this,function(){MVGlobalVariables.transImageLoaded=true;
});
this.base_div.appendChild(this.transImage);
this.info_div=document.createElement("div");
this.info_div.style.position="absolute";
this.info_div.style.left=MVUtil.pixel(0);
this.info_div.style.top=MVUtil.pixel(0);
this.real_base_div.appendChild(this.info_div);
this.div=null;
var b=this.getBrowserType();
this.toolBarContainer=null;
this.initPane();
MVUtil.disableElementSelection(this.div);
this.infoWindowHtml="";
this.infoWindowWidth=0;
this.infoWindowHeight=0;
this.foiLayerZIndex=120;
this.foiTopLayerZIndex=180;
this.createIndLayer();
this.printDiv=null;
this.transparentLayer=document.createElement("div");
MVUtil.disableElementSelection(this.transparentLayer);
this.transparentLayer.style.position="absolute";
this.transparentLayer.style.zIndex=125;
this.div.appendChild(this.transparentLayer);
this.zoomListener=null;
this.beforeZoomListener=null;
this.mouseclickListener=null;
this.recenterListener=null;
this.rightclickListener=null;
this.movingListener=null;
this.arrowKeys=new KeyCodesArray();
this.keyboardPanningEnabled=true;
this.draggingEnabled=true;
this.doubleClickAction="zoomin";
this.dblclickListener=null;
this.loadingIconEnabled=true;
this.loadingIcon=null;
this.smoothPanning=false;
this.spQueue=null;
this.spIntervalId=null;
this.oldPaneWidth=0;
this.oldPaneHeight=0;
this.sizeChanging=false;
this.sizeStaticTime=0;
this.sizeCheckingHandle=null;
this.minRectSize=5;
this.redLineIsOn=false;
this.delayedOperations=new Array();
this.infoTipDiv=null;
this.initMapWindowMinX=0;
this.initMapWindowMaxY=0;
this.origWindowOnResizeListener=null;
this.origWindowOnmouseupListener=null;
this.origBodyOnmouseupListener=null;
this.origBodyOnmousedownListener=null;
this.origWindowOnkeydownListener=null;
this.origWindowOnkeyupListener=null;
this.origBodyOnkeydownListener=null;
this.origBodyOnkeyupListener=null;
this.enableMapEventListner=false;
this.defaultDataSource=null;
this.foiImageFormat="PNG24";
this.foiBgColor=null;
this.zoomAnimationEnabled=true;
this.beingDragged=false;
this.dragCoords=null;
this.wraparound=false;
this.maptype=null;
this.enforceCSBound=true;
this.errorHandler=null;
this.resizeCount=0;
this.resizeWidth=0;
this.resizeTimer=0;
this.displayCounter=0;
this.displayTimer=0;
this.beforeZoomLevel=-1;
this.afterZoomLevel=-1;
this.foiGroupLayer=null;
this.userDefinedCopyright=null;
this.copyrightAutoAdjust=true;
this.lastTouch=0;
this.lastTouchLoc=null;
this.touchStartLocs=new Array();
this.pinchZoomStartDist=0;
this.pinchZoomScale=1;
this.touchCount=0;
this.checkMapSize=true;
this.multiThemeClickable=false;
this.autoHighlight=false;
if(!MVi18n.isFetched()){MVi18n.fetchMessages();
}this.tmpArray=[];
return this;
}MVMapView.prototype.initPane=function(){if(MVGlobalVariables.browser=="IF"&&document.compatMode&&document.compatMode!="BackCompat"){document.body.style.height="100%";
}if(this.real_base_div.style.backgroundColor==""){this.real_base_div.style.backgroundColor="lightgrey";
}this.div=document.createElement("div");
this.div.style.position="absolute";
this.div.style.zIndex=80;
this.div.style.left=MVUtil.pixel(0);
this.div.style.top=MVUtil.pixel(0);
this.info_div.style.left=MVUtil.pixel(0);
this.info_div.style.top=MVUtil.pixel(0);
this.divLeft=0;
this.divTop=0;
this.origLeft=this.divLeft;
this.origTop=this.divTop;
this.dragOffsetX=0;
this.dragOffsetY=0;
this.base_div.appendChild(this.div);
this.toolBarTable=document.createElement("table");
this.toolBarTable.style.zIndex=9999;
this.toolBarTable.style.height=MVUtil.pixel(15);
this.toolBarTable.style.position="absolute";
this.toolBarTable.style.right=MVUtil.pixel(0);
this.toolBarTable.style.bottom=MVUtil.pixel(0);
this.toolBarTable.style.backgroundColor="white";
this.base_div.appendChild(this.toolBarTable);
var a=document.createElement("tbody");
this.toolBarTable.appendChild(a);
this.toolBarContainer=document.createElement("tr");
a.appendChild(this.toolBarContainer);
};
MVMapView.prototype.setDragOffset=function(b,a){this.dragOffsetX=b-this.divLeft;
this.dragOffsetY=a-this.divTop;
};
MVMapView.prototype.move=function(h,g){this.reCenterTag=true;
this.divLeft=h-this.dragOffsetX;
this.divTop=g-this.dragOffsetY;
this.origLeft=MVUtil.getLeft(this.div);
this.origTop=MVUtil.getTop(this.div);
var d=this.checkMapDivLeftTop(this.origLeft,this.divLeft,this.origTop,this.divTop);
this.divLeft=d.left;
this.divTop=d.top;
var f=this.mapCenterX+(this.origLeft-this.divLeft)/this.pixPerX;
var b=this.mapCenterY-(this.origTop-this.divTop)/this.pixPerY;
this.moveExternalAPITileLayers(this.divLeft-this.origLeft,this.divTop-this.origTop,f,b);
var a=this.mapCenterX;
var k=this.mapCenterY;
this.mapCenterX=f;
this.mapCenterY=b;
if(a!=this.mapCenterX||k!=this.mapCenterY){this.scrolled=true;
}MVUtil.setLeftTop(this.div,this.divLeft,this.divTop);
MVUtil.setLeftTop(this.info_div,this.divLeft,this.divTop);
};
MVMapView.prototype.addEventListener=function(a,b){this.setEventListener(a,b);
};
MVMapView.prototype.setEventListener=function(a,b){if(a==MVEvent.RECENTER){this.recenterListener=b;
}else{if(a==MVEvent.MOUSE_CLICK){this.mouseclickListener=b;
}else{if(a==MVEvent.MOUSE_RIGHT_CLICK){this.rightclickListener=b;
}else{if(a==MVEvent.ZOOM_LEVEL_CHANGE){this.zoomListener=b;
}else{if(a==MVEvent.BEFORE_ZOOM_LEVEL_CHANGE){this.beforeZoomListener=b;
}else{if(a==MVEvent.MOUSE_DOUBLE_CLICK){this.dblclickListener=b;
}else{if(a==MVEvent.INITIALIZE){this.initializeListener=b;
}}}}}}}};
MVMapView.prototype.attachEventListener=function(a,b){MVUtil.attachEventListener(this.EventListeners,a,b);
};
MVMapView.prototype.detachEventListener=function(a,b){MVUtil.detachEventListener(this.EventListeners,a,b);
};
MVMapView.prototype.init=function(){if(this.displayed&&this.mapLayers){for(var b=0;
b<this.mapLayers.length;
b++){if(this.mapLayers[b] instanceof MVGoogleTileLayerV3){if(this.div.parentNode&&this.mapLayers[b].visible){this.div.parentNode.removeChild(this.div);
}}}}this.setFOILayersSize();
MVUtil.setLeftTop(this.div,0,0);
MVUtil.setLeftTop(this.info_div,0,0);
if(this.infoLayer.infoWindows.length>0){this.infoLayer.deleteInfoWindow(this.infoLayer.infoWindows[0]);
}this.divLeft=0;
this.divTop=0;
this.origLeft=this.divLeft;
this.origTop=this.divTop;
this.dragOffsetX=0;
this.dragOffsetY=0;
this.setZoomLevel(this.zoomLevel);
this.adjustParam();
var a=MVSdoGeometry.createPoint(this.mapCenterX,this.mapCenterY,this.srid);
a=this.checkMapCenter(a);
this.mapCenterX=a.getPointX();
this.mapCenterY=a.getPointY();
this.oldPaneWidth=this.getPaneWidth();
this.oldPaneHeight=this.getPaneHeight();
if(this.sizeCheckingHandle){clearTimeout(this.sizeCheckingHandle);
}this.setLoadingIconVisible(true);
this.mapScreenCenterX=this.mapDrawOffsetX+(this.mapTileNumX/2*this.tileWidth);
this.mapScreenCenterY=this.mapDrawOffsetY+(this.mapTileNumY/2*this.tileHeight);
this.do_GetMinCntMesh();
if(!this.displayed){if(this.loadBoundingTheme()){this.loadBoundingTheme=true;
return;
}}if(this.scalectl&&!this.scalectl.insideMapDecoration&&!this.scalectl.initialized){this.addScaleBarControl(this.scalectl);
}if(this.navigationPanel&&!this.navigationPanel.initialized){this.navigationPanel.init(this.base_div,this);
}for(var b=0;
b<this.mapLayers.length;
b++){if(this.mapLayers[b].layerControl){this.mapLayers[b].layerControl.loading=true;
this.mapLayers[b].layerControl.initTiles(this.getPaneWidth(),this.getPaneHeight(),this.mapCenterX,this.mapCenterY);
if(this.mapLayers[b].layerControl&&this.mapLayers[b].layerControl.zoomControl.scaling){this.mapLayers[b].layerControl.zoomControl.endScaling();
}}else{if(this.mapLayers[b].isExtAPITileLayer()){this.setExternalAPITileLayerCenter(this.mapLayers[b],this.mapCenterX,this.mapCenterY,this.zoomLevel);
}}}if(!this.infoLayer){this.infoLayer=new MVInfoLayerControl(this,"1");
}if(!this.infoLayer2){this.infoLayer2=new MVInfoLayerControl(this,"2");
}this.do_GetMinMaxLonLat();
this.initMapWindowMinX=this.mapWindowMinLon;
this.initMapWindowMaxY=this.mapWindowMaxLat;
this.transparentLayer.style.zIndex=125;
this.refreshMapContent();
this.layer_created=true;
this.loaded=true;
if(this.mapDecorationArray!=null){for(var b=0;
b<this.mapDecorationArray.length;
b++){if(this.mapDecorationArray[b]!=null&&!this.mapDecorationArray[b].displayed){var d="_md_"+this.mapDecorationId;
this.mapDecorationArray[b].init(d,this,this.base_div);
this.mapDecorationId++;
this.mapDecorationArray[b].displayed=true;
if(this.mapDecorationArray[b].afterDisAction){this.mapDecorationArray[b].afterDisAction();
}}}}if(this.overviewmap!=null&&this.overviewmap.mainmap==null){this.overviewmap.init(this.overviewmap.overviewMapDIV,this);
}this.checkLayersAndSetLoadingIcon();
if(this.checkMapSize){this.checkSize();
}if(!this.displayed||this.loadBoundingTheme){this.displayed=true;
this.loadBoundingTheme=false;
if(this.initializeListener){this.initializeListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.INITIALIZE);
if(this.isSubmap==undefined||!this.isSubmap){if(MVMapInitializers.length){for(var b=0;
b<MVMapInitializers.length;
b++){if(MVMapInitializers[b]){MVMapInitializers[b](this);
}}}}}window.status=" ";
};
MVMapView.prototype.destroy=function(){var h=null;
clearTimeout(this.sizeCheckingHandle);
if(this.fetchingMapId){clearTimeout(this.fetchingMapId);
this.fetchingMapId=null;
}while(this.mapLayers&&this.mapLayers.length>0){h=this.mapLayers.pop();
h.destroy();
h=null;
}this.mapLayers=null;
while(this.ThemeBasedFOIGroup&&this.ThemeBasedFOIGroup.length>0){var f=this.ThemeBasedFOIGroup.pop();
f.destroy();
}while(this.foiGroupArray&&this.foiGroupArray.length>0){var g=this.foiGroupArray.pop();
g.destroy();
}this.ThemeBasedFOIGroup=null;
if(this.indFOIsControl){this.indFOIsControl.destroy();
}this.indFOIsControl=null;
if(this.overviewmap){this.overviewmap.destroy();
this.overviewmap=null;
}if(this.mapDecorationArray){while(this.mapDecorationArray.length>0){var l=this.mapDecorationArray.pop();
l.destroy();
}}this.mapDecorationArray=null;
if(this.toolBar){this.toolBar.destroy();
this.toolBar=null;
}if(this.toolBarTable){if(this.toolBarTable.parentNode){MVUtil.discardNode(this.toolBarTable);
}this.toolBarTable=null;
}if(this.toolBarContainer){if(this.toolBarContainer.parentNode){MVUtil.discardNode(this.toolBarContainer);
}this.toolBarContainer=null;
}if(this.scalectl){if(this.scalectl.parentNode){this.scalectl.parentNode.removeChild(this.scalectl);
}this.scalectl=null;
}if(this.navigationPanel){this.navigationPanel.destroy();
this.navigationPanel.mvHandle=null;
this.navigationPanel=null;
}if(MVGlobalVariables.browser=="NS"&&this.base_div){this.base_div.removeEventListener("DOMMouseScroll",this.mapview_mouseWheel_Gecko,false);
}MVUtil.destroyNode(this.info_div,this.errorHandler);
this.info_div=null;
MVUtil.destroyNode(this.transparentLayer,this.errorHandler);
this.transparentLayer=null;
MVUtil.destroyNode(this.div,this.errorHandler);
this.div=null;
MVUtil.clearNode(this.base_div,this.errorHandler);
this.base_div=null;
this.transImage=null;
if(this.origWindowOnResizeListener){MVUtil.detachEvent(window,"resize",this.origWindowOnResizeListener);
}if(this.origBodyOnkeydownListener){MVUtil.detachEvent(document.body,"keydown",this.origBodyOnkeydownListener);
}if(this.origBodyOnkeyupListener){MVUtil.detachEvent(document.body,"keyup",this.origBodyOnkeyupListener);
}if(this.origBodyOnmousedownListener){MVUtil.detachEvent(document.body,"mousedown",this.origBodyOnmousedownListener);
}if(this.origWindowOnmouseupListener){MVUtil.detachEvent(window.document,"mouseup",this.origWindowOnmouseupListener);
}if(this.origWindowOnkeydownListener){MVUtil.detachEvent(window.document,"keydown",this.origWindowOnkeydownListener);
}if(this.origWindowOnkeyupListener){MVUtil.detachEvent(window.document,"keyup",this.origWindowOnkeyupListener);
}if(MVGlobalVariables.browser=="IF"&&this.bodyUp){document.body.detachEvent("onmouseup",this.bodyUp);
}this.origBodyOnkeydownListener=null;
this.origBodyOnkeyupListener=null;
this.origBodyOnmousedownListener=null;
this.origBodyOnmouseupListener=null;
this.origWindowOnResizeListener=null;
this.origWindowOnkeydownListener=null;
this.origWindowOnkeyupListener=null;
this.origWindowOnmouseupListener=null;
this.bodyUp=null;
this.msi=null;
this.originalCenter=null;
this.TileH=null;
this.TileW=null;
if(this.copyright){MVUtil.discardNode(this.copyright);
this.copyright=null;
}if(this.infoLayer){this.infoLayer.destroy();
this.infoLayer=null;
}if(this.infoLayer2){this.infoLayer2.destroy();
this.infoLayer2=null;
}var a=MVUtil.objArray.length;
for(var d=0;
d<a;
d++){if(MVUtil.objArray[d]==this){MVUtil.objArray.splice(d,1);
}}if(this.loadingIcon){MVUtil.destroyNode(this.loadingIcon);
this.loadingIcon=null;
}this.EventListeners=null;
this.mapMinMesh=null;
this.mapCntMesh=null;
this.originLocation=null;
this.touchStartLocs=null;
this.delayedOperations=null;
this.arrowKeys=null;
this.mouseUpLoc=null;
this.printHtml=null;
this.beforeZoomListener=null;
this.dblclickListener=null;
this.mouseclickListener=null;
this.recenterListener=null;
this.zoomListener=null;
this.rightclickListener=null;
this.initializeListener=null;
var b=this.real_base_div;
while(b&&b.hasChildNodes()){var k=b.firstChild;
MVUtil.clearListeners(k,null);
MVUtil.discardNode(k);
}};
MVMapView.prototype.adjustParam=function(){this.tileWidth=this.TileW[this.zoomLevel];
this.tileHeight=this.TileH[this.zoomLevel];
this.doAdjustParams();
};
MVMapView.prototype.doAdjustParams=function(){this.mapDrawOffsetX=-this.tileWidth*this.mapCacheOffSet;
this.mapDrawOffsetY=-this.tileHeight*this.mapCacheOffSet;
var a=this.getPaneWidth()/this.tileWidth;
this.mapTileNumX=parseInt(Math.ceil(a/2)+1)*2+1;
a=this.getPaneHeight()/this.tileHeight;
this.mapTileNumY=parseInt(Math.ceil(a/2)+1)*2+1;
this.mapScreenCenterX=this.mapDrawOffsetX+(this.mapTileNumX/2*this.tileWidth);
this.mapScreenCenterY=this.mapDrawOffsetY+(this.mapTileNumY/2*this.tileHeight);
var b=this.msi.mapConfig.zoomLevels[this.zoomLevel];
this.pixPerX=b.tileImageWidth/b.tileWidth;
this.pixPerY=b.tileImageHeight/b.tileHeight;
};
MVMapView.prototype.do_GetMinCntMesh=function(){this.mapCntMesh=new MVMesh(this.msi.mapConfig,this.mapCenterX,this.mapCenterY,this.zoomLevel);
this.mapMinMesh=new MVMesh(this.msi.mapConfig,this.mapCenterX,this.mapCenterY,this.zoomLevel);
this.mapMinMesh.moveMeshCode(-(Math.ceil(this.mapTileNumX/2)-1),+Math.ceil(this.mapTileNumY/2)-1);
};
MVMapView.prototype.do_GetMinMaxLonLat=function(){this.mapMinLon=this.mapMinMesh.minX;
this.mapMinLat=(this.mapMinMesh.minY+this.mapMinMesh.mh);
this.mapMaxLon=(this.mapMinMesh.minX+(this.mapMinMesh.mw*this.mapTileNumX));
this.mapMaxLat=(this.mapMinMesh.minY-(this.mapMinMesh.mh*(this.mapTileNumY-1)));
this.mapWindowMinLon=this.getMapWindowMinX(this.mapCenterX);
this.mapWindowMinLat=this.getMapWindowMinY(this.mapCenterY);
this.mapWindowMaxLon=this.getMapWindowMaxX(this.mapCenterX);
this.mapWindowMaxLat=this.getMapWindowMaxY(this.mapCenterY);
};
MVMapView.prototype.display=function(){var a=this;
var b=function(){var d=0;
if(!a.base_div){return;
}if(a.base_div.offsetWidth){d=parseInt(a.base_div.offsetWidth+"");
}else{if(typeof(a.base_div.offsetWidth)=="undefined"){d=a.getPaneWidth();
}}var f=0;
if(a.base_div.offsetHeight){f=parseInt(a.base_div.offsetHeight+"");
}else{if(typeof(a.base_div.offsetHeight)=="undefined"){f=a.getPaneHeight();
}}if(!MVi18n.isFetched()||d<=0||f<=0||!a.tileLayersConfigLoaded()||!MVGlobalVariables.transImageLoaded||!a.msi){setTimeout(b,200);
return;
}var g=function(){a.init();
if(!a.handlersAdded){a.addEventHandlers();
a.handlersAdded=true;
}a.displayed=true;
while(a.delayedOperations.length>0){var h=a.delayedOperations.shift();
if(h.func=="refreshFOIs"){h.obj.refreshFOIs(h.params[0],h.params[1],h.params[2],h.params[3],h.params[4],h.params[5],h.params[6],h.params[7],true,h.params[8]);
}else{if(h.func=="zoomToRectangle"){h.obj.zoomToRectangle(h.params[0],h.params[1]);
}else{if(h.func=="refresh"){h.obj.refresh(h.params[0]);
}}}}};
a.setCenterXY(g);
};
b();
};
MVMapView.prototype.setCenter=function(b,a){this.reCenterTag=true;
this.center=b;
this.originalCenter=b;
if(this.displayed){this.setCenterXY(null,a);
}};
MVMapView.prototype.setCenterXY=function(g,b){if(!this.center){if(g){g();
}return;
}if(!this.msi){MVi18n.reportError("MVMapView.setCenter","MAPVIEWER-05518",null,this.errorHandler);
return;
}this.srid=this.msi.getSrid();
var d=this.center;
if(!this.reCenterTag&&this.originalCenter!=null){d=this.originalCenter;
}if(d){if(!d.srid){d.srid=this.srid;
}this.center=null;
if(!(d.sdo_point)){MVi18n.reportError("MVMapView.setCenter","MAPVIEWER-05505",null,this.errorHandler);
return;
}var a=this;
var f=function(h){if(h){d=h;
}if(a.displayed){d=a.checkMapCenter(d);
}var l=false;
for(var k=0;
k<a.mapLayers.length;
k++){if(a.mapLayers[k].isExtAPITileLayer()){l=true;
}}if(!a.displayed){a.mapCenterX=d.getPointX();
a.mapCenterY=d.getPointY();
}else{if(a.mapCenterX!=a.originalCenter.getPointX()||a.mapCenterY!=a.originalCenter.getPointY()){a.map_moveX=(a.mapCenterX-d.getPointX())*a.pixPerX;
a.map_moveY=(a.mapCenterY-d.getPointY())*a.pixPerY*(-1);
}else{a.map_moveX=0;
a.map_moveY=0;
}a.panWidth=a.getPaneWidth();
a.panHeight=a.getPaneHeight();
if(Math.abs(a.map_moveX)<=(a.panWidth+a.mapBufferX)&&Math.abs(a.map_moveY)<=(a.panHeight+a.mapBufferY)){a.distance=Math.sqrt(a.map_moveX*a.map_moveX+a.map_moveY*a.map_moveY);
a.stepTime=20;
a.totalTime=a.distance>((a.panWidth+a.panHeight)/4)?300:200;
a.loopCount=0;
a.curX=0;
a.curY=0;
a.smoothPan(b);
}else{a.mapCenterX=d.getPointX();
a.mapCenterY=d.getPointY();
a.display();
if(a.recenterListener){a.recenterListener();
}MVUtil.runListeners(a.EventListeners,MVEvent.RECENTER);
}if(a.scalectl){a.scalectl.update(a);
}}if(g){g();
}};
if(this.srid!=d.srid){this.reCenterTag=true;
d=this.transformGeom(d,this.srid,null,f);
}else{f();
}}else{if(g){g();
}}};
MVMapView.prototype.setCenterLon=function(a){this.mapCenterX=a;
};
MVMapView.prototype.setCenterLat=function(a){this.mapCenterY=a;
};
MVMapView.prototype.setCenterMark=function(b,a,d){if(this.center_mark!=undefined){this.base_div.removeChild(this.center_mark);
delete this.center_mark;
}if(b==null){return;
}this.centerMarkUrl=b;
this.centerMarkW=a;
this.centerMarkH=d;
var f=document.createElement("img");
f.src=b;
f.style.zIndex=2000;
f.style.position="absolute";
f.style.width=MVUtil.pixel(a);
f.style.height=MVUtil.pixel(d);
f.style.left=MVUtil.pixel((this.getPaneWidth()-a)/2);
f.style.top=MVUtil.pixel((this.getPaneHeight()-d)/2);
this.base_div.appendChild(f);
this.center_mark=f;
};
MVMapView.prototype.setZoomLevel=function(a){if(isNaN(a)){MVi18n.reportError("MVMapView.setZoomLevel","MAPVIEWER-05506",null,this.errorHandler);
return;
}if((!this.displayed)&&this.msi==null){this.zoomLevel=a;
return;
}if(a<0){a=0;
}else{if(a>this.maxZoom){a=this.maxZoom;
}}if(this.displayed){this.zoomTo(a);
}else{this.zoomLevel=a;
this.adjustParam();
}};
MVMapView.prototype.setHomeMap=function(a,b){this.originLocation=a;
if(b){this.originZoomLevel=b;
}};
MVMapView.prototype.setMapBuffer=function(b,a){this.mapBufferX=b;
this.mapBufferY=a;
};
MVMapView.prototype.setProvider=function(k,o){var h=false;
var s=this;
var m=function(t){if(t){s.mapCenterX=t.getPointX();
s.mapCenterY=t.getPointY();
s.center=t;
}s.msi=k.msi;
s.srid=s.msi.getSrid();
s.maptype=s.msi.mapConfig.coordSys.type;
if(s.zoomLevel>(s.msi.zoomCount-1)){s.zoomLevel=s.msi.zoomCount-1;
}for(var u=0;
u<s.msi.getMaxZoomLevel();
u++){s.TileW[u]=s.msi.getTileImageWidth(s.zoomLevel);
s.TileH[u]=s.msi.getTileImageHeight(s.zoomLevel);
}s.adjustParam();
s.maxZoom=s.msi.getMaxZoomLevel()-1;
s.do_GetMinCntMesh();
o(h);
};
if(!k.msi){k.msi=new MVMapProvider(k.mapSource);
}if(this.msi){if(k.msi.mapConfig.coordSys.srid!=this.msi.mapConfig.coordSys.srid||k.msi.mapConfig.zoomLevels.length!=this.msi.mapConfig.zoomLevels.length){h=true;
}else{for(var n=0;
n<this.msi.mapConfig.zoomLevels.length;
n++){var r=k.msi.mapConfig.zoomLevels[n];
var b=this.msi.mapConfig.zoomLevels[n];
var l=r.tileWidth/r.tileImageWidth;
var a=r.tileHeight/r.tileImageHeight;
var d=b.tileWidth/b.tileImageWidth;
var g=b.tileHeight/b.tileImageHeight;
if(l!=d||a!=g){h=true;
break;
}}}if(!k.isVisible()||this.msi.getSrid()==k.msi.getSrid()){m();
return;
}else{h=true;
var f=MVSdoGeometry.createPoint(this.mapCenterX,this.mapCenterY,this.msi.getSrid());
if(!this.reCenterTag&&this.originalCenter!=null){f=this.originalCenter;
}this.transformGeom(f,k.msi.getSrid(),null,m);
}}else{m();
}};
MVMapView.prototype.getMapBaseURL=function(){return this.baseURL;
};
MVMapView.prototype.getPaneWidth=function(){var b=0;
if(this.base_div.style&&this.base_div.style.width){var a=this.base_div.style.width+"";
if(a.indexOf("%")<0){if(a.indexOf("px")>0){b=parseInt(a.substring(0,a.indexOf("px")));
}else{b=parseInt(a);
}if(b){return b;
}}}if(this.base_div.offsetWidth){b=this.base_div.offsetWidth;
}else{if(this.base_div.width){b=parseInt(this.base_div.width+"");
}}return b;
};
MVMapView.prototype.getPaneHeight=function(){var b=0;
if(this.base_div.style&&this.base_div.style.height){var a=this.base_div.style.height+"";
if(a.indexOf("%")<0){if(a.indexOf("px")>0){b=parseInt(a.substring(0,a.indexOf("px")));
}else{b=parseInt(a);
}if(b){return b;
}}}if(this.base_div.offsetHeight){b=this.base_div.offsetHeight;
}else{if(this.base_div.width){b=parseInt(this.base_div.width+"");
}}return b;
};
MVMapView.prototype.getMapWindowMinX=function(b){var a=this.getPaneWidth()/2;
return(0-a)/this.pixPerX+b;
};
MVMapView.prototype.getMapWindowMinY=function(b){var a=this.getPaneHeight()/2;
return -1*(a-1)/this.pixPerY+b;
};
MVMapView.prototype.getMapWindowMaxX=function(b){var a=this.getPaneWidth()/2;
return(a-1)/this.pixPerX+b;
};
MVMapView.prototype.getMapWindowMaxY=function(b){var a=this.getPaneHeight()/2;
return -1*(0-a)/this.pixPerY+b;
};
MVMapView.prototype.getCenter=function(){var a=MVSdoGeometry.createPoint(this.mapCenterX,this.mapCenterY,this.srid);
return a;
};
MVMapView.prototype.getCenterLon=function(){return this.mapCenterX;
};
MVMapView.prototype.getCenterLat=function(){return this.mapCenterY;
};
MVMapView.prototype.getMapWindowBBox=function(){this.do_GetMinMaxLonLat();
var a=MVSdoGeometry.createRectangle(this.mapWindowMinLon,this.mapWindowMinLat,this.mapWindowMaxLon,this.mapWindowMaxLat,this.srid);
return a;
};
MVMapView.prototype.getMouseLocation=function(){var a=MVSdoGeometry.createPoint(this.mouseCurLon,this.mouseCurLat,this.srid);
return a;
};
MVMapView.prototype.getMouseCursorLon=function(){return this.mouseCurLon;
};
MVMapView.prototype.getMouseCursorLat=function(){return this.mouseCurLat;
};
MVMapView.prototype.getZoomLevel=function(){return this.zoomLevel;
};
MVMapView.prototype.getMaxZoomLevel=function(){if(!this.msi){MVi18n.reportError("MVMapView.getMaxZoomLevel","MAPVIEWER-05526",null,this.errorHandler);
return -1;
}else{return this.msi.getMaxZoomLevel();
}};
MVMapView.prototype.enableMapBoundConstraint=function(a){return this.enforceCSBound=a;
};
MVMapView.prototype.getBaseDiv=function(){return this.base_div;
};
MVMapView.prototype.getMovableDiv=function(){return this.div;
};
MVMapView.prototype.getCenterMeshHeight=function(){return this.mapCntMesh.mh;
};
MVMapView.prototype.getCenterMeshWidth=function(){return this.mapCntMesh.mw;
};
MVMapView.prototype.getProvider=function(){return this.msi;
};
MVMapView.prototype.getMinLon=function(){return this.mapMinLon;
};
MVMapView.prototype.getMinLat=function(){return this.mapMinLat;
};
MVMapView.prototype.getMaxLon=function(){return this.mapMaxLon;
};
MVMapView.prototype.getMaxLat=function(){return this.mapMaxLat;
};
MVMapView.prototype.getScreenMinLon=function(){return this.mapWindowMinLon;
};
MVMapView.prototype.getScreenMinLat=function(){return this.mapWindowMinLat;
};
MVMapView.prototype.getScreenMaxLon=function(){return this.mapWindowMaxLon;
};
MVMapView.prototype.getScreenMaxLat=function(){return this.mapWindowMaxLat;
};
MVMapView.prototype.getPixPerLon=function(){return this.pixPerX;
};
MVMapView.prototype.getPixPerLat=function(){return this.pixPerY;
};
MVMapView.prototype.zoomIn=function(a){this.zoomTo(this.zoomLevel+1,a);
};
MVMapView.prototype.zoomOut=function(a){this.zoomTo(this.zoomLevel-1,a);
};
MVMapView.prototype.setZoomAnimationEnabled=function(a){this.zoomAnimationEnabled=a;
};
MVMapView.prototype.zoomTo=function(h,b,d,g){var a=this;
if(a.beforeZoomLevel<0){a.beforeZoomLevel=a.zoomLevel;
}var f=function(){a.zoomToCounter=0;
a.zoomToTimer=null;
if(h>=a.maxZoom){h=a.maxZoom;
}else{if(h<0){h=0;
}}if(!g&&a.afterZoomLevel==a.zoomLevel&&h==a.zoomLevel&&!b){if(a.navigationPanel){a.navigationPanel.updateSliderBar();
}return false;
}a.printReset();
a.zoomLevel=h;
if(a.navigationPanel){a.navigationPanel.updateSliderBar();
}a.zoomLevel=h;
a.adjustParam();
var k=false;
var m=MVSdoGeometry.createPoint(a.mapCenterX,a.mapCenterY,a.srid);
var l=function(n){if(n){b=n;
}if(a.m_scroll_id){clearTimeout(a.m_scroll_id);
a.m_scroll_id=null;
}if(b){if(b.getPointX()!=a.mapCenterX||b.getPointY()!=a.mapCenterY){k=true;
}a.mapCenterX=b.getPointX();
a.mapCenterY=b.getPointY();
}if(a.beforeZoomListener&&a.beforeZoomLevel!=a.zoomLevel){a.beforeZoomListener(a.beforeZoomLevel,a.zoomLevel);
}if(a.beforeZoomLevel!=a.zoomLevel){MVUtil.runListeners(a.EventListeners,MVEvent.BEFORE_ZOOM_LEVEL_CHANGE,[a.beforeZoomLevel,a.zoomLevel]);
}var o=function(){if(Math.abs(a.beforeZoomLevel-a.zoomLevel)==1&&a.displayCounter<=1&&a.zoomAnimationEnabled&&!d){for(var r=0;
r<a.mapLayers.length;
r++){if(a.mapLayers[r].layerControl&&!a.mapLayers[r].layerControl.zoomControl.scaling){a.mapLayers[r].layerControl.zoomControl.showTiles(a.beforeZoomLevel,a.zoomLevel,m,b);
}}}a.display();
a.displayCounter=0;
a.displayTimer=null;
a.afterZoomLevel=a.zoomLevel;
if(k){if(a.recenterListener){a.recenterListener();
}MVUtil.runListeners(a.EventListeners,MVEvent.RECENTER);
}if(a.overviewmap){a.overviewmap.zoomMainMap(a.beforeZoomLevel,a.zoomLevel);
var t=function(){a.overviewmap.refreshSubMap();
};
setTimeout(t,200);
}if(a.beforeZoomLevel!=a.zoomLevel){var s=a.beforeZoomLevel;
a.beforeZoomLevel=-1;
if(a.zoomListener){a.zoomListener(s,a.zoomLevel);
}MVUtil.runListeners(a.EventListeners,MVEvent.ZOOM_LEVEL_CHANGE,[s,a.zoomLevel]);
}};
if(!a.displayCounter){a.displayCounter=0;
}a.displayCounter++;
if(a.displayTimer){clearTimeout(a.displayTimer);
}a.displayTimer=setTimeout(o,200);
if(a.scalectl){a.scalectl.update(a);
}};
if(b){a.reCenterTag=true;
a.srid=a.msi.getSrid();
if(!b.srid){b.srid=a.srid;
}if(!(b.sdo_point)){MVi18n.reportError("MVMapView.zoomTo","MAPVIEWER-05505",null,a.errorHandler);
return;
}if(b.srid&&(a.srid!=b.srid)){b=a.transformGeom(b,a.srid,null,l);
}else{l();
}}else{l();
}return true;
};
if(!this.zoomToCounter){this.zoomToCounter=0;
}this.zoomToCounter++;
if(a.displayTimer){clearTimeout(a.displayTimer);
a.displayTimer=null;
}if(this.zoomToTimer){clearTimeout(this.zoomToTimer);
}if(this.zoomToCounter<2){this.zoomToTimer=setTimeout(f,200);
}else{f();
return;
}};
MVMapView.prototype.zoomToAtLocation=function(b,d){this.srid=this.msi.getSrid();
var a=this;
var f=function(k){if(k){b=k;
}var g=(a.mapCenterX-b.getPointX())*a.pixPerX;
var r=(a.mapCenterY-b.getPointY())*a.pixPerY;
var o=a.TileW[d]/a.msi.getTileWidth(d);
var n=a.TileH[d]/a.msi.getTileHeight(d);
var m=g/o+b.getPointX();
var l=r/n+b.getPointY();
var h=MVSdoGeometry.createPoint(m,l,a.srid);
a.zoomTo(d,h);
};
if(b.srid&&(this.srid!=b.srid)){b=this.transformGeom(b,this.srid,null,f);
}else{f();
}};
MVMapView.prototype.setCenterAndZoomLevel=function(b,f){if(!this.displayed){this.center=b;
this.zoomLevel=f;
this.originalCenter=b;
return;
}this.srid=this.msi.getSrid();
if(!b.srid){b.srid=this.srid;
}var a=this;
var d=function(g){if(g){b=g;
}if(f==null){f=a.zoomLevel;
}if(!a.displayed){a.setCenter(b);
a.setZoomLevel(f);
return;
}if(f==a.zoomLevel){if(!a.loaded){a.zoomTo(f,b);
return;
}else{a.map_moveX=(a.mapCenterX-b.getPointX())*a.pixPerX;
a.map_moveY=(a.mapCenterY-b.getPointY())*a.pixPerY*(-1);
a.panWidth=a.getPaneWidth();
a.panHeight=a.getPaneHeight();
if(Math.abs(a.map_moveX)<=(a.panWidth+a.mapBufferX)&&Math.abs(a.map_moveY)<=(a.panHeight+a.mapBufferY)){a.distance=Math.sqrt(a.map_moveX*a.map_moveX+a.map_moveY*a.map_moveY);
a.stepTime=20;
a.totalTime=a.distance>((a.panWidth+a.panHeight)/4)?300:200;
a.loopCount=0;
a.curX=0;
a.curY=0;
a.smoothPan();
return;
}}}a.zoomTo(f,b);
};
if(b.srid&&(this.srid!=b.srid)){b=this.transformGeom(b,this.srid,null,d);
}else{d();
}};
MVMapView.prototype.addMapTileLayer=function(d,h){d.mapview=this;
var a=this;
var f=this;
var g=function(){a.mapLayerNumber++;
a.setProvider(d,m);
a.showEmbeddedCopyright();
function m(t){d.config=MVGlobal_CacheConfig[d.mapSource];
if(!d.isExtAPITileLayer()){var n=a.getTileLayerControl(d);
d.layerControl=n;
a.combineTileLayers();
}if(t&&a.mapLayers.length>1){if(!a.overview){MVi18n.reportError("MVMapView.addMapTileLayer","MAPVIEWER-05528",null,f.errorHandler);
}for(var s=0;
s<a.mapLayers.length;
s++){if(a.mapLayers[s]!=d){a.removeMapTileLayer(a.mapLayers[s]);
}}}if(a.displayed){if(!t){if(d.isExtAPITileLayer()){var r=function(u){d.setCenterAndZoomLevel(u.getPointX(),u.getPointY(),a.zoomLevel);
};
var o=MVSdoGeometry.createPoint(a.mapCenterX,a.mapCenterY,a.srid);
a.transformGeom(o,d.srid,null,r);
}else{if(d.layerControl&&d.layerControl.initTiles){d.layerControl.initTiles(a.getPaneWidth(),a.getPaneHeight(),a.mapCenterX,a.mapCenterY);
}}}else{a.display();
}if(a.scalectl){a.scalectl.update(a);
}if(a.navigationPanel&&a.navigationPanel.getMaxZoomLevel()!=a.maxZoom){a.navigationPanel.updateSlider();
}}if(h){h();
}if(a.overviewmap&&a.overviewmap.submap&&a.overviewmap.submap.mapLayers.length==0){a.overviewmap.addOverviewMapTileLayer();
}if(a.overviewmap&&a.overviewmap.submap){a.overviewmap.resetRectangle();
}}};
if(d.getType()=="MVExternalAPIMapTileLayer"){this.has=true;
d.loadCount=0;
this.tmpArray.push(d);
var l=function(){d.loadCount++;
if(d.loadCount>50&&!d.loaded||f.tmpArray.length==0){for(var n=0;
n<f.tmpArray.length;
n++){if(f.tmpArray[n]==d){f.tmpArray.splice(n,1);
return;
}}return;
}if((MVGoogleTileLayerV3.LOADEDJS==true&&d instanceof MVGoogleTileLayerV3)||(MVNokiaTileLayer.LOADEDJS==true&&d instanceof MVNokiaTileLayer)||(MVBingTileLayerV7.LOADEDJS==true&&d instanceof MVBingTileLayerV7)||(MVTomTomTileLayer.LOADEDJS==true&&d instanceof MVTomTomTileLayer)){d.loaded=true;
if(f.tmpArray[0]===d){f.tmpArray.splice(0,1);
f.addExternalAPITileLayer(d);
MVGlobalVariables.getMapCacheConfig(d,g,f.errorHandler);
return;
}}setTimeout(l,100);
};
l();
}else{var k=function(){if(d.mapSource==undefined||d.mapSource==null||MVUtil.strTrim(d.mapSource)==""){MVi18n.reportError("MVMapView.addMapTileLayer","MAPVIEWER-05507",null,f.errorHandler);
return;
}if(!f.defaultDataSource&&f.compareBaseURL(d.mcsURL)){var m=d.mapSource.split(".");
if(m.length>=2){MVGlobalVariables.setDefaultDataSource(m[0]);
f.setDefaultDataSource(m[0]);
}}d.parent=f;
if(!d.mcsURL){if(f.baseURL){if(MVUtil.strEndWith(f.baseURL,"/")){d.mcsURL=f.baseURL+"mcserver";
}else{d.mcsURL=f.baseURL+"/mcserver";
}}else{MVi18n.reportError("MVMapView.addMapTileLayer","MAPVIEWER-05504",null,f.errorHandler);
return;
}}d.mcscfgURL=d.mcsURL;
if(d==null||!d.getType){MVi18n.reportError("MVMapView.addMapTileLayer","MAPVIEWER-05519","mapTileLayer",f.errorHandler);
return;
}f.mapLayers.push(d);
d.zIndex=f.mapLayers.length;
MVGlobalVariables.getMapCacheConfig(d,g,f.errorHandler);
};
if(!this.has){k();
}else{this.tmpArray.push(d);
var b=setInterval(function(){var m=f.tmpArray.length;
if(f.tmpArray.length>0){var n=f.tmpArray[0];
if(n==d&&!n.isExtAPITileLayer()){f.tmpArray.splice(0,1);
k();
clearInterval(b);
}return;
}clearInterval(b);
k();
},100);
}}};
MVMapView.prototype.addBaseMapLayer=MVMapView.prototype.addMapTileLayer;
MVMapView.prototype.getMapTileLayerDefinition=function(f,a,d){if(!d){d=null;
}var b=new MVMapTileLayer(a,d);
if(!b.mcsURL){if(this.baseURL){if(MVUtil.strEndWith(this.baseURL,"/")){b.mcsURL=this.baseURL+"mcserver";
}else{b.mcsURL=this.baseURL+"/mcserver";
}}else{MVi18n.reportError("MVMapView.getMapTileLayerDefinition","MAPVIEWER-05504",null,this.errorHandler);
return;
}}b.mcscfgURL=b.mcsURL;
MVGlobalVariables.getMapCacheConfig(b,f,this.errorHandler);
};
MVMapView.prototype.removeMapTileLayer=function(f){var d=0;
var l=f.mapSource;
var h=f.mcsURL;
if(f.parentLayer){var a=f.parentLayer;
for(var b=0;
b<a.childrenLayers.length;
b++){if(a.childrenLayers[b]==f){if(a.childrenLayers.length>1){a.childrenLayers[b]=a.childrenLayers[a.childrenLayers.length-1];
a.childrenLayers.pop();
var o=a.getTransparent();
if(a.layerControl){a.layerControl.isTransparent=o;
}a.refresh(true);
if(this.overviewmap){this.removeOverviewMapTileLayer(l,h);
}f.parentLayer=null;
return;
}else{a.childrenLayers[b]=null;
a.childrenLayers.pop();
f=a;
f.parentLayer=null;
}}}}for(;
d<this.mapLayers.length;
d++){if(this.mapLayers[d]==f){var m=this.mapLayers[d];
this.mapLayers[d]=this.mapLayers[this.mapLayers.length-1];
m.destroy();
this.mapLayers.pop();
this.mapLayerNumber--;
if(this.overviewmap){this.removeOverviewMapTileLayer(l,h);
}break;
}}this.showEmbeddedCopyright();
if(this.msi.mapSourceName==l&&this.mapLayers.length>0){var n=this;
var g=this.mapLayers[this.mapLayers.length-1];
function k(t){if(n.displayed){if(!t){if(g.isExtAPITileLayer()){var s=function(u){g.setCenterAndZoomLevel(u.getPointX(),u.getPointY(),n.zoomLevel);
};
var r=MVSdoGeometry.createPoint(n.mapCenterX,n.mapCenterY,n.srid);
n.transformGeom(r,g.srid,null,s);
}else{if(g.layerControl){g.layerControl.initTiles(n.getPaneWidth(),n.getPaneHeight(),n.mapCenterX,n.mapCenterY);
}}}else{n.display();
}if(n.scalectl){n.scalectl.update(n);
}if(n.navigationPanel&&n.navigationPanel.getMaxZoomLevel()!=n.maxZoom){n.navigationPanel.updateSlider();
}}}this.setProvider(g,k);
}};
MVMapView.prototype.removeOverviewMapTileLayer=function(a,d){if(this.overviewmap.submap.mapLayers.length>0){var b=this.overviewmap.submap.mapLayers[0];
if(b.mapSource==a&&b.mcsURL==d){this.overviewmap.submap.removeMapTileLayer(b);
this.overviewmap.resetRectangle();
}}};
MVMapView.prototype.createIndLayer=function(){if(!this.infoLayer){this.infoLayer=new MVInfoLayerControl(this,"1");
}if(!this.infoLayer2){this.infoLayer2=new MVInfoLayerControl(this,"2");
}this.indFOIsControl=new MVIndFOIsControl(this);
this.indFOIsControl.setSize(Math.ceil(2*(this.getPaneWidth())),Math.ceil(2*(this.getPaneHeight())));
MVUtil.setLeftTop(this.indFOIsControl.getContainer(),(this.getPaneWidth()-this.indFOIsControl.getLayerWidth())/2,(this.getPaneHeight()-this.indFOIsControl.getLayerHeight())/2);
};
MVMapView.prototype.addGroupFOI=function(a){this.groupFOICount=0;
this.groupFOI=a;
this.startAddGroupFOI();
};
MVMapView.prototype.startAddGroupFOI=function(){for(var b=0;
b<11000;
b++){if(this.groupFOICount<this.groupFOI.length){this.addFOI(this.groupFOI[this.groupFOICount]);
this.groupFOICount++;
}else{this.groupFOI=null;
this.groupFOItopFlag=null;
return;
}}this.setTimeout("this.startAddGroupFOI()",5);
};
MVMapView.prototype.addFOI=function(f){if(!this.defaultDataSource&&this.compareBaseURL(f.serverURL)&&f.style&&f.style.indexOf!=undefined){var g=f.style.split(".");
if(g.length>=2){MVGlobalVariables.setDefaultDataSource(g[0]);
this.setDefaultDataSource(g[0]);
}}if(!f||!f.id){return false;
}if(f.gtype%10==1){f.topFlag=true;
}if(f.id!=""){var d=f.id.substr(0,3);
if(d!="-RL"){for(var b=0;
b<this.indFOIsControl.indFOIArray.length;
b++){if(this.indFOIsControl.indFOIArray[b].id==f.id){MVi18n.reportError("MVMapView.addFOI","MAPVIEWER-05508","foi.id:"+f.id,this.errorHandler);
return false;
}}}}if(f.gtype%10==1&&!f.style){f.imgURL=f.serverURL;
}if(!f.serverURL&&!f.isHTMLFOI){f.serverURL=MVGlobalVariables.getDefaultFoiURL();
}this.indFOIsControl.addIndFOI(f);
return true;
};
MVMapView.prototype.getFOI=function(a){return this.indFOIsControl.getIndFOI(a);
};
MVMapView.prototype.removeFOI=function(a){if(!a){return;
}if(a.id){this.indFOIsControl.removeIndFOI(a.id);
}else{this.indFOIsControl.removeIndFOI(a);
}};
MVMapView.prototype.getAllFOIs=function(){return this.indFOIsControl.getAllIndFOIs();
};
MVMapView.prototype.refreshIndFOIs=function(){this.do_GetMinMaxLonLat();
if(this.indFOIsControl!=null){var a=(this.indFOIsControl.getLayerWidth()-this.getPaneWidth())*0.5/this.pixPerX;
var b=(this.indFOIsControl.getLayerHeight()-this.getPaneHeight())*0.5/this.pixPerY;
MVUtil.setLeftTop(this.indFOIsControl.getContainer(),(this.getPaneWidth()-this.indFOIsControl.getLayerWidth())/2,(this.getPaneHeight()-this.indFOIsControl.getLayerHeight())/2);
MVUtil.setLeftTop(this.indFOIsControl.getTopContainer(),(this.getPaneWidth()-this.indFOIsControl.getLayerWidth())/2,(this.getPaneHeight()-this.indFOIsControl.getLayerHeight())/2);
this.indFOIsControl.refreshIndFOIs(this.mapWindowMinLon-a,this.mapWindowMinLat-b,this.mapWindowMaxLon+a,this.mapWindowMaxLat+b);
}};
MVMapView.prototype.removeAllFOIs=function(){if(this.indFOIsControl){this.indFOIsControl.removeAll();
}};
MVMapView.prototype.addRedLineTool=function(a){if(a==null){MVi18n.reportError("MVMapView.addRedLineTool","MAPVIEWER-05519","redlineTool",this.errorHandler);
return;
}a.parent=this;
if(!a.serverURL){a.serverURL=MVGlobalVariables.getDefaultFoiURL();
}};
MVMapView.prototype.addCircleTool=function(a){if(a==null){MVi18n.reportError("MVMapView.addCircleTool","MAPVIEWER-05519","circleTool",this.errorHandler);
return;
}this.base_div.appendChild(a.circleDiv);
a.parent=this;
if(!a.foiServerUrl){a.foiServerUrl=MVGlobalVariables.getDefaultFoiURL();
}};
MVMapView.prototype.addRectangleTool=function(a){if(a==null){MVi18n.reportError("MVMapView.addRectangleTool","MAPVIEWER-05519","rectangleTool",this.errorHandler);
return;
}this.div.appendChild(a.rectangleDiv);
a.parent=this;
if(!a.foiServerUrl){a.foiServerUrl=MVGlobalVariables.getDefaultFoiURL();
}};
MVMapView.prototype.addDistanceTool=function(a){if(a==null){MVi18n.reportError("MVMapView.addDistanceTool","MAPVIEWER-05519","distanceTool",this.errorHandler);
return;
}a.parent=this;
if(!a.serverURL){a.serverURL=MVGlobalVariables.getDefaultFoiURL();
}};
MVMapView.prototype.addToolBar=function(a){if(a==null){MVi18n.reportError("MVMapView.addToolBar","MAPVIEWER-05519","toolBar",this.errorHandler);
return;
}this.toolBar=a;
a.mapviewer=this;
a.init();
this.addMapDecoration(a.toolBarDecoration);
a.addBuiltInButton();
if(this.displayed){a.editMapDecoration();
}else{a.toolBarDecoration.afterDisAction=a.editMapDecoration;
}};
MVMapView.prototype.stopMarqueeZoom=function(){this.marqueeZoomOn=false;
if(this.marqueeZoomRectangleTool){this.marqueeZoomRectangleTool.clear();
}MVUtil.runListeners(this.EventListeners,MVEvent.MARQUEEZOOM_FINISH);
};
MVMapView.prototype.startMarqueeZoom=function(d,a,b){if(!d){d="one_time";
}if(b&&b>0){this.minRectSize=b;
}this.marqueeZoomOn=true;
this.marqueeZoomMode=d;
this.marqueeZoom(a);
};
MVMapView.prototype.marqueeZoom=function(h){if(!this.marqueeZoomOn){return;
}this.marqueeRectDone=false;
this.clearMarqueeRect=false;
var f=this.marqueeZoomRectangleTool;
if(!f){f=new MVRectangleTool(null,null);
f.setDivFillColor("#555555",0.3);
this.addRectangleTool(f);
this.marqueeZoomRectangleTool=f;
}if(h){f.setDivStyle(h);
}f.init();
var d=MVUtil.closureWrapper(f,function(){this.clear();
var n=null;
if(this.parent.marqueeRectGeom){n=this.parent.marqueeRectGeom.getMBR();
}if(n&&(this.marqueeZoomMode=="prompt"||Math.abs(n[2]-n[0])*this.parent.pixPerX>=this.parent.minRectSize&&Math.abs(n[3]-n[1])*this.parent.pixPerY>=this.parent.minRectSize)){var m=document.getElementById("mv_mrqzm_msg");
if(m){m.parentNode.removeChild(m);
}this.parent.zoomToRectangle(this.parent.marqueeRectGeom);
}if(this.parent.marqueeZoomMode!="one_time"){this.parent.marqueeZoom();
}});
var g=MVUtil.closureWrapper(f,function(){this.parent.marqueeRectDone=true;
this.parent.marqueeRectGeom=f.getRectangle();
d();
});
var a=MVUtil.closureWrapper(f,function(){this.parent.marqueeRectGeom=f.getRectangle();
d();
this.marqueeZoomOn=false;
});
var b=MVUtil.closureWrapper(f,function(m){this.parent.marqueeRectClicked=true;
m=(m)?m:((window.event)?event:null);
MVUtil.stopEvent(m);
});
var k=MVUtil.closureWrapper(f,function(m){m=(m)?m:((window.event)?event:null);
if(this.parent.marqueeRectClicked){MVUtil.stopEvent(m);
d();
}});
var l=MVUtil.closureWrapper(f,function(){this.parent.marqueeRectDone=true;
this.parent.marqueeRectGeom=f.getRectangle();
if(!this.parent.marqueeRectGeom){this.clear();
this.parent.marqueeZoom();
return;
}var m=this.parent;
var n=f.getRectangleDIV();
MVUtil.setCursor(n,"crosshair");
if(MVi18n.getInfoMessage("marqueeZoomHint")){n.onmouseover=function(o){var r=document.getElementById("mv_mrqzm_msg");
if(r){r.parentNode.removeChild(r);
}r=MVUtil.createSingleCellTable(MVi18n.getInfoMessage("marqueeZoomHint"));
r.id="mv_mrqzm_msg";
r.style.border="1px solid #000000";
r.style.backgroundColor="#FFFFCC";
r.style.position="absolute";
var s=MVUtil.getMouseLeftTop(m,o);
r.style.left=s.x+"px";
r.style.top=s.y+"px";
r.style.zIndex=9999;
m.base_div.appendChild(r);
};
n.onmouseout=function(){var o=document.getElementById("mv_mrqzm_msg");
if(o){o.parentNode.removeChild(o);
}};
}this.parent.marqueeRectClicked=false;
MVUtil.attachEvent(n,"mousedown",b,true);
MVUtil.attachEvent(n,"mouseup",k,true);
n.onclick=function(o){MVUtil.stopEvent(o);
};
});
this.marqueeRectClicked=false;
if(this.marqueeZoomMode=="prompt"){f.addEventListener("on_finish",l);
}else{if(this.marqueeZoomMode=="continuous"){f.addEventListener("on_finish",g);
}else{f.addEventListener("on_finish",a);
}}};
MVMapView.prototype.zoomToRectangle=function(d){if(!this.displayed){this.delayOperation(this,"zoomToRectangle",d);
return;
}var a=this;
var b=function(m){var h=m.getMBR();
var s=Math.abs(h[0]-h[2]);
var n=Math.abs(h[1]-h[3]);
var v=s*(a.pixPerX);
var g=n*(a.pixPerY);
var B=a.getPaneWidth();
var l=a.getPaneHeight();
var r=a.zoomLevel;
var k=r;
var t=a.maxZoom;
if(B<v||l<g){for(var u=(r-1);
u>=0;
--u){k=u;
var o=(a.TileW[u]/a.msi.getTileWidth(u))*s;
var C=(a.TileH[u]/a.msi.getTileHeight(u))*n;
if(o<=B&&C<=l){break;
}}}else{if(B>v&&l>g){for(var u=(r+1);
u<=t;
++u){var o=(a.TileW[u]/a.msi.getTileWidth(u))*s;
var C=(a.TileH[u]/a.msi.getTileHeight(u))*n;
if(o<=B&&C<=l){k=u;
}else{break;
}}}}var A=(h[0]+h[2])/2;
var w=(h[1]+h[3])/2;
var f=MVSdoGeometry.createPoint(A,w,a.srid);
if(a.zoomFromTheme){var z=a.zoomFromTheme;
if(z.respectVisibleZoomLevels&&k<z.minZoomLevel){k=z.minZoomLevel;
}else{if(z.respectVisibleZoomLevels&&k>z.maxZoomLevel){k=z.maxZoomLevel;
}}a.zoomFromTheme=null;
}a.zoomTo(k,f);
};
if(!d.srid){d.srid=this.srid;
}if(d.srid&&this.srid!=d.srid){this.transformGeom(d,this.srid,null,b);
}else{b(d);
}};
MVMapView.prototype.getThemeBBoxAndSetThemeWindowSize=function(a){var g=(a.getLayerWidth()-this.getPaneWidth())*0.5/this.pixPerX;
var l=(a.getLayerHeight()-this.getPaneHeight())*0.5/this.pixPerY;
var k=new Array();
if(a.themebasedfoi.sizeXratio==1&&a.themebasedfoi.sizeYratio==1){k[0]=this.mapWindowMinLon;
k[1]=this.mapWindowMinLat;
k[2]=this.mapWindowMaxLon;
k[3]=this.mapWindowMaxLat;
}else{var h=this.getMeshCoordsMin4ThemeBasedFOIQuery(this.mapWindowMinLon-g,this.mapWindowMinLat-l);
var d=this.getMeshCoordsMax4ThemeBasedFOIQuery(this.mapWindowMaxLon+g,this.mapWindowMaxLat+l);
k[0]=h.x;
k[1]=h.y;
k[2]=d.x;
k[3]=d.y;
}var f=Math.floor((k[2]-k[0])*this.pixPerX+0.5);
var b=Math.floor((k[3]-k[1])*this.pixPerY+0.5);
a.setRealSize(f,b);
return k;
};
MVMapView.prototype.loadBoundingTheme=function(){this.do_GetMinMaxLonLat();
var b=0;
for(b=0;
b<this.ThemeBasedFOIGroup.length;
b++){var a=this.ThemeBasedFOIGroup[b];
if(a.themebasedfoi.isBoundingTheme){a.clearTransImageLayer();
var d=this.getThemeBBoxAndSetThemeWindowSize(a);
a.refreshFOIs(this,d[0],d[1],d[2],d[3],true,true,null,true,a.themebasedfoi.recenterOnly);
return true;
}}return false;
};
MVMapView.prototype.addScaleBarControl=function(d,f){var a=this;
var b=function(g){g.style.position="absolute";
if(a.scalebarPosition==1||a.scalebarPosition==3){g.style.right=MVUtil.pixel(a.scalebarOffsetWidth);
}else{g.style.left=MVUtil.pixel(a.scalebarOffsetWidth);
}if(a.scalebarPosition==2||a.scalebarPosition==3){g.style.bottom=MVUtil.pixel(a.scalebarOffsetHeight);
}else{g.style.top=MVUtil.pixel(a.scalebarOffsetHeight);
}};
d.initSacleBar(this,f,b);
};
MVMapView.prototype.addThemeBasedFOI=function(f){if(!this.defaultDataSource&&this.compareBaseURL(f.serverURL)&&!f.isJDBCTheme&&!f.isCustomTheme){var d=f.theme.split(".");
if(d.length>=2){MVGlobalVariables.setDefaultDataSource(d[0]);
this.setDefaultDataSource(d[0]);
}}if(this.smoothPanning){this.putThemeIntoSPQueue(f);
return;
}if(!f){MVi18n.reportError("MVMapView.addThemeBasedFOI","MAPVIEWER-05519","themeBasedFOI",this.errorHandler);
return;
}if(!this.infoLayer){this.infoLayer=new MVInfoLayerControl(this,"1");
}for(var b=0;
b<this.ThemeBasedFOIGroup.length;
b++){if(MVUtil.strTrim(this.ThemeBasedFOIGroup[b].themebasedfoi.name)==MVUtil.strTrim(f.name)){MVi18n.reportError("MVMapView.addThemeBasedFOI","MAPVIEWER-05509",MVUtil.strTrim(f.name),this.errorHandler);
return;
}}f.parent=this;
var a=new MVThemeBasedFOIControl(this,f);
a.currentIndex=this.ThemeBasedFOIGroup.length;
if(this.ThemeBasedFOIGroup.length<100){a.div.style.zIndex=this.ThemeBasedFOIGroup.length*2+130;
a.origIndex=this.ThemeBasedFOIGroup.length;
}else{a.div.style.zIndex=100*2+130;
a.origIndex=100;
}a.setSize(parseInt(f.sizeXratio*(this.getPaneWidth())),parseInt(f.sizeYratio*(this.getPaneHeight())));
this.ThemeBasedFOIGroup[this.ThemeBasedFOIGroup.length]=a;
if(this.displayed){var g=this.getThemeBBoxAndSetThemeWindowSize(a);
MVUtil.setLeftTop(a.getContainer(),Math.ceil((g[0]-this.mapWindowMinLon)*this.pixPerX),-Math.ceil((g[3]-this.mapWindowMaxLat)*this.pixPerY));
if(f.isBoundingTheme){a.refreshFOIs(this,g[0],g[1],g[2],g[3],false,true,false,false,f.recenterOnly);
}else{a.refreshFOIs(this,g[0],g[1],g[2],g[3],false,false);
}}};
MVMapView.prototype.getThemeIndex=function(b){for(var a=0;
a<this.ThemeBasedFOIGroup.length;
a++){if(MVUtil.strTrim(this.ThemeBasedFOIGroup[a].themebasedfoi.name)==MVUtil.strTrim(b.name)){return a+1;
}}MVi18n.reportError("MVMapView.getThemeIndex","MAPVIEWER-05510",MVUtil.strTrim(b.name),this.errorHandler);
};
MVMapView.prototype.getOrigThemeIndex=function(b){for(var a=0;
a<this.ThemeBasedFOIGroup.length;
a++){if(MVUtil.strTrim(this.ThemeBasedFOIGroup[a].themebasedfoi.name)==MVUtil.strTrim(b.name)){return this.ThemeBasedFOIGroup[a].origIndex;
}}MVi18n.reportError("MVMapView.getOrigThemeIndex","MAPVIEWER-05510",MVUtil.strTrim(b.name),this.errorHandler);
};
MVMapView.prototype.setThemeIndex=function(g,b){if(b>100){b=100;
}if(b<1){b=1;
}for(var f=0;
f<this.ThemeBasedFOIGroup.length;
f++){if(MVUtil.strTrim(this.ThemeBasedFOIGroup[f].themebasedfoi.name)==MVUtil.strTrim(g.name)){while(f+1<this.ThemeBasedFOIGroup.length&&f+1<b){var d=this.ThemeBasedFOIGroup[f];
this.ThemeBasedFOIGroup[f]=this.ThemeBasedFOIGroup[f+1];
this.ThemeBasedFOIGroup[f+1]=d;
f++;
}while(f+1>b){var d=this.ThemeBasedFOIGroup[f];
this.ThemeBasedFOIGroup[f]=this.ThemeBasedFOIGroup[f-1];
this.ThemeBasedFOIGroup[f-1]=d;
f--;
}break;
}}for(var a=0;
a<this.ThemeBasedFOIGroup.length;
a++){this.ThemeBasedFOIGroup[a].div.style.zIndex=a*2+130;
if(this.ThemeBasedFOIGroup[a].transImageLayer){this.ThemeBasedFOIGroup[a].transImageLayer.style.zIndex=a*2+130+1;
}if(this.ThemeBasedFOIGroup[a].transImageLayer&&this.ThemeBasedFOIGroup[a].FOIType!=1&&this.ThemeBasedFOIGroup[a].themebasedfoi.minClickableLevel<=this.zoomLevel){this.transparentLayer.style.zIndex=a*2+130+1;
}this.ThemeBasedFOIGroup[a].currentIndex=a;
}};
MVMapView.prototype.setToOrigThemeIndex=function(b){for(var a=0;
a<this.ThemeBasedFOIGroup.length;
a++){if(MVUtil.strTrim(this.ThemeBasedFOIGroup[a].themebasedfoi.name)==MVUtil.strTrim(b.name)){this.ThemeBasedFOIGroup[a].div.style.zIndex=this.ThemeBasedFOIGroup[a].origIndex*2+130;
if(this.ThemeBasedFOIGroup[a].FOIType==2&&MVGlobalVariables.browser!="IF"&&this.ThemeBasedFOIGroup[a].transImageLayer){this.ThemeBasedFOIGroup[a].transImageLayer.style.zIndex=this.ThemeBasedFOIGroup[a].origIndex*2+130+1;
}}}};
MVMapView.prototype.getThemeBasedFOI=function(a){for(var b=0;
b<this.ThemeBasedFOIGroup.length;
b++){if(this.ThemeBasedFOIGroup[b].getThemeBasedFOI().name==a){return this.ThemeBasedFOIGroup[b].getThemeBasedFOI();
}}return null;
};
MVMapView.prototype.getThemeBasedFOIs=function(){var a=new Array();
for(var b=0;
b<this.ThemeBasedFOIGroup.length;
b++){a.push(this.ThemeBasedFOIGroup[b].getThemeBasedFOI());
}return a;
};
MVMapView.prototype.enableInfoWindowEventPropagation=function(a){if(!this.infoLayer){this.infoLayer=new MVInfoLayerControl(this,"1");
}this.infoLayer.enableEventPropagation(a);
};
MVMapView.prototype.refreshThemeBasedFOIs=function(b){if(this.infoLayer){this.infoLayer.hideTopNode();
}this.do_GetMinMaxLonLat();
var g=0;
for(g=0;
g<this.ThemeBasedFOIGroup.length;
g++){var f=this.ThemeBasedFOIGroup[g];
if(f.FOIType!=1){f.clearTransImageLayer();
}var k=this.getThemeBBoxAndSetThemeWindowSize(f);
var l=f.themebasedfoi.getFOIData();
if(l!=null){if(!f.boundingThemeLoaded&&!f.themebasedfoi.autoRefreshing&&l[0].gtype%10==1&&f.themebasedfoi.maxWholeImageLevel<this.zoomLevel){f.clearAll();
f.div.style.display="none";
f.themebasedfoi.minX=f.minX=k[0];
f.themebasedfoi.minY=f.minY=k[1];
f.themebasedfoi.maxX=f.maxX=k[2];
f.themebasedfoi.maxY=f.maxY=k[3];
f.zoomLevel=this.zoomLevel;
var h=Math.ceil((f.minX-this.mapWindowMinLon)*this.pixPerX);
var a=-Math.ceil((f.maxY-this.mapWindowMaxLat)*this.pixPerY);
MVUtil.setLeftTop(f.getContainer(),h,a);
f.centerX=this.mapCenterX;
f.centerY=this.mapCenterY;
for(var d=0;
d<l.length;
d++){f.displayFoi(l[d]);
}f.makeFOIsVisiable();
f.boundingThemeLoaded=false;
f.loading=false;
continue;
}}f.refreshFOIs(this,k[0],k[1],k[2],k[3],b,false,null,true);
}};
MVMapView.prototype.getMeshCoordsMin4ThemeBasedFOIQuery=function(g,f){var b={x:0,y:0};
var d=Math.floor((g-this.msi.getMinX())/this.msi.getTileWidth(this.zoomLevel));
var a=Math.floor((f-this.msi.getMinY())/this.msi.getTileHeight(this.zoomLevel));
b.x=this.msi.getMinX()+d*this.msi.getTileWidth(this.zoomLevel);
b.y=this.msi.getMinY()+a*this.msi.getTileHeight(this.zoomLevel);
return b;
};
MVMapView.prototype.getMeshCoordsMax4ThemeBasedFOIQuery=function(g,f){var b={x:0,y:0};
var d=Math.floor((g-this.msi.getMinX())/this.msi.getTileWidth(this.zoomLevel));
var a=Math.floor((f-this.msi.getMinY())/this.msi.getTileHeight(this.zoomLevel));
b.x=this.msi.getMinX()+(d+1)*this.msi.getTileWidth(this.zoomLevel);
b.y=this.msi.getMinY()+(a+1)*this.msi.getTileHeight(this.zoomLevel);
return b;
};
MVMapView.prototype.removeAllThemeBasedFOI=function(){if(this.displayed){for(var a=0;
a<this.ThemeBasedFOIGroup.length;
a++){this.ThemeBasedFOIGroup[a].setVisible(false,false);
}this.refreshThemeBasedFOIs(false);
}while(this.ThemeBasedFOIGroup.length>0){this.ThemeBasedFOIGroup[this.ThemeBasedFOIGroup.length-1].destroy();
this.ThemeBasedFOIGroup[this.ThemeBasedFOIGroup.length-1]=null;
this.ThemeBasedFOIGroup.pop();
}while(this.transparentLayer.childNodes.length>0){this.transparentLayer.removeChild(this.transparentLayer.childNodes[0]);
}};
MVMapView.prototype.removeThemeBasedFOI=function(g){if(!g){return;
}for(var f=0;
f<this.ThemeBasedFOIGroup.length;
f++){if(g==this.ThemeBasedFOIGroup[f].getThemeBasedFOI()){this.ThemeBasedFOIGroup[f].destroy();
this.ThemeBasedFOIGroup.splice(f,1);
break;
}}for(var b=0;
b<this.transparentLayer.childNodes.length;
b++){if(this.transparentLayer.childNodes[b].id==g.name){this.transparentLayer.removeChild(this.transparentLayer.childNodes[b]);
b--;
}}for(var d=0;
d<this.ThemeBasedFOIGroup.length;
d++){this.ThemeBasedFOIGroup[d].div.style.zIndex=d*2+130;
if(this.ThemeBasedFOIGroup[d].transImageLayer&&this.ThemeBasedFOIGroup[d].FOIType!=1&&this.ThemeBasedFOIGroup[d].themebasedfoi.minClickableLevel<=this.zoomLevel){this.ThemeBasedFOIGroup[d].transImageLayer.style.zIndex=d*2+130+1;
this.transparentLayer.style.zIndex=d*2+130+1;
}this.ThemeBasedFOIGroup[d].currentIndex=d;
}};
MVMapView.prototype.scrollThemeBasedFOIs=function(){if(this.infoLayer){this.infoLayer.hideTopNode();
}this.do_GetMinMaxLonLat();
var d=0;
var n=false;
for(d=0;
d<this.ThemeBasedFOIGroup.length;
d++){var l=this.ThemeBasedFOIGroup[d];
if((this.mapWindowMinLon<l.getMinX()||this.mapWindowMinLat<l.getMinY()||this.mapWindowMaxLon>l.getMaxX()||this.mapWindowMaxLat>l.getMaxY())&&l.themebasedfoi.autoRefreshing){var g=this.getThemeBBoxAndSetThemeWindowSize(l);
if(l.FOIType!=1){l.clearTransImageLayer();
}l.refreshFOIs(this,g[0],g[1],g[2],g[3],true,false);
}else{if(l.boundingThemeLoaded){var g=this.getThemeBBoxAndSetThemeWindowSize(l);
l.refreshFOIs(this,g[0],g[1],g[2],g[3],true,false);
}}}if(this.mapWindowMinLon<this.indFOIsControl.minX||this.mapWindowMinLat<this.indFOIsControl.minY||this.mapWindowMaxLon>this.indFOIsControl.maxX||this.mapWindowMaxLat>this.indFOIsControl.maxY){var m=(this.indFOIsControl.getLayerWidth()-this.getPaneWidth())*0.5/this.pixPerX;
var f=(this.indFOIsControl.getLayerHeight()-this.getPaneHeight())*0.5/this.pixPerY;
this.indFOIsControl.refreshIndFOIs(this.mapWindowMinLon-m,this.mapWindowMinLat-f,this.mapWindowMaxLon+m,this.mapWindowMaxLat+f);
this.refreshGroupFOIs(false);
}else{if(this.wraparound){var m=(this.indFOIsControl.getLayerWidth()-this.getPaneWidth())*0.5/this.pixPerX;
var b=m-(this.mapWindowMinLon-this.indFOIsControl.minX);
var h=m-(this.indFOIsControl.maxX-this.mapWindowMaxLon);
var a=b>0?b:h;
var k=(this.msi.coverMaxX-this.msi.coverMinX)/4;
if(a>k){var f=(this.indFOIsControl.getLayerHeight()-this.getPaneHeight())*0.5/this.pixPerY;
this.indFOIsControl.refreshIndFOIs(this.mapWindowMinLon-m,this.mapWindowMinLat-f,this.mapWindowMaxLon+m,this.mapWindowMaxLat+f);
}}}if(!n){this.infoLayer.refresh(this.mapWindowMinLon,this.mapWindowMinLat,this.mapWindowMaxLon,this.mapWindowMaxLat,this.getPaneWidth(),this.getPaneHeight());
this.infoLayer2.refresh(this.mapWindowMinLon,this.mapWindowMinLat,this.mapWindowMaxLon,this.mapWindowMaxLat,this.getPaneWidth(),this.getPaneHeight());
n=true;
}};
MVMapView.prototype.getAllThemeBasedFOIs=function(){return this.ThemeBasedFOIGroup;
};
MVMapView.prototype.setDefaultInfoWindowStyle=function(a,b){MVGlobalVariables.defaultInfoStyle=a;
if(a=="MVInfoWindowStyle1"){MVInfoWindowStyle1.defaultStyleParameters=b;
}else{if(a=="MVInfoWindowStyle4"){MVInfoWindowStyle4.defaultStyleParameters=b;
}}};
MVMapView.prototype.displayInfoWindow=function(l,h,b,m,a,k,f){if(this.infoWindowTimeout){clearTimeout(this.infoWindowTimeout);
this.infoWindowTimeout=null;
}var n=this;
var d=function(o){if(o){l=o;
}n.infoLayer.showHtmlWindow(h,l.sdo_point.x,l.sdo_point.y,b,m,a,k,f);
};
var g=function(){if(n.displayed&&!n.displayTimer&&!n.zoomToTimer&&!n.m_scroll_id){if(!l.srid){l.srid=n.srid;
}if(l.srid&&(n.srid!=l.srid)){center=n.transformGeom(l,n.srid,null,d);
}else{d();
}}else{n.infoWindowTimeout=setTimeout(g,200);
}};
g();
};
MVMapView.prototype.displayTabbedInfoWindow=function(h,g,l,a,k,b){if(this.infoWindowTimeout){clearTimeout(this.infoWindowTimeout);
this.infoWindowTimeout=null;
}var m=this;
var d=function(n){if(n){h=n;
}m.infoLayer.showTabbedHtmlWindow(null,h.sdo_point.x,h.sdo_point.y,a,k,b,g,l);
};
var f=function(){if(m.displayed&&!m.displayTimer&&!m.zoomToTimer&&!m.m_scroll_id){if(!h.srid){h.srid=m.srid;
}if(h.srid&&(m.srid!=h.srid)){center=m.transformGeom(h,m.srid,null,d);
}else{d();
}}else{m.infoWindowTimeout=setTimeout(f,200);
}};
f();
};
MVMapView.prototype.setInfoWindow=function(d,a,b){this.infoWindowHtml=d;
this.infoWindowWidth=a;
this.infoWindowHeight=b;
};
MVMapView.prototype.setGlobalInfoWindowSize=function(a,b){MVGlobalVariables.infoWindowWidth=a;
MVGlobalVariables.infoWindowHeight=b;
};
MVMapView.prototype.removeInfoWindow=function(){if(this.infoLayer.infoWindows.length>0){this.infoLayer.deleteInfoWindow(this.infoLayer.infoWindows[0]);
}};
MVMapView.prototype.addCSTransformFunction=function(d,b,a){MVGlobalVariables.addCSTransFunc(b,a,d);
};
MVMapView.prototype.transformGeom=function(geometry,toSrid,mcsURL,callBack,dataSource){if(!geometry.srid){if(!this.srid){MVi18n.reportError("MVMapView.transformGeom","MAPVIEWER-05520",null,this.errorHandler);
return;
}geometry.srid=this.srid;
}if(geometry.srid==toSrid){if(callBack){callBack(geometry);
return;
}else{return geometry;
}}var clientTrans=MVGlobalVariables.getCSTransFunc(geometry.srid,toSrid);
if(clientTrans){var geom=null;
if(geometry.getGType()==1){var result=clientTrans(geometry.getPointX(),geometry.getPointY(),this.errorHandler);
geom=MVSdoGeometry.createPoint(result.x,result.y,toSrid);
}else{if((geometry.gtype%10==2||geometry.gtype%10==3)&&geometry.sdo_elem_info.length==3&&geometry.sdo_elem_info[0]==1&&(geometry.sdo_elem_info[1]==2||geometry.sdo_elem_info[1]==1003||geometry.sdo_elem_info[1]==2003)&&geometry.sdo_elem_info[2]==1){var ordinates=MVMapView.transformOrdinates(clientTrans,geometry.sdo_ordinates,this.errorHandler);
geom=new MVSdoGeometry(geometry.gtype,toSrid,geometry.sdo_elem_info,ordinates);
}}if(geom){if(callBack){callBack(geom);
return;
}else{return geom;
}}}if(mcsURL){}else{if(this.baseURL){if(MVUtil.strEndWith(this.baseURL,"/")){mcsURL=this.baseURL+"mcserver";
}else{mcsURL=this.baseURL+"/mcserver";
}}else{MVi18n.reportError("MVMapView.transformGeom","MAPVIEWER-05504",null,this.errorHandler);
return;
}}var localDomain=(MVUtil.isLocalDomain(mcsURL));
var xmlHttp=localDomain||MVMapView.XMLHTTPEnabled;
if(!xmlHttp&&!callBack){MVi18n.reportError("MVMapView.transformGeom","MAPVIEWER-05521",null,this.errorHandler);
return null;
}var request=null;
var finalresult;
var mgeometry;
var mdatasource;
if(dataSource){mdatasource=dataSource;
}else{mdatasource=this.defaultDataSource;
}mgeometry=MVUtil.strReplaceAll(geometry.toString(),"null","");
if(geometry.getGType()==1){mgeometry=MVUtil.strReplaceAll(mgeometry,"SdoPointType","");
}else{}mgeometry=MVUtil.strReplaceAll(mgeometry," ","");
var targetURL=mcsURL;
var csTransUrl=mcsURL;
var params="request=cstransform&dstsrid="+toSrid+"&geometry="+mgeometry;
if(mdatasource){params+="&datasource="+mdatasource;
}var request=null;
var mv=this;
var transformed=MVUtil.closureWrapper(this,function(){if(request.readyState==4){if(request.status==200){try{var resp=request.responseText;
eval("var result="+resp);
finalresult=result;
if(result.length==0){result=null;
return;
}var geom=null;
if(finalresult.SDO_GTYPE==1){geom=MVSdoGeometry.createPoint(finalresult.SDO_POINT.X,finalresult.SDO_POINT.Y,finalresult.SDO_SRID);
}else{geom=new MVSdoGeometry(2000+finalresult.SDO_GTYPE,finalresult.SDO_SRID,finalresult.SDO_ELEM_INFO,finalresult.SDO_ORDINATES,null);
}result=null;
}catch(e){MVi18n.reportError("MVMapView.transformGeom","MAPVIEWER-05523",request.responseText,mv.errorHandler);
return;
}if(callBack){callBack(geom);
}if(xmlHttp){return geom;
}}}});
try{request=MVUtil.getXMLHttpRequest(xmlHttp);
if(callBack||!xmlHttp){request.onreadystatechange=transformed;
}request.open("POST",MVUtil.getXMLHttpUrl(csTransUrl),callBack||!xmlHttp);
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
request.send(MVUtil.getXMLHttpReq(csTransUrl,params));
}catch(e){MVi18n.reportError("MVMapView.transformGeom","MAPVIEWER-05511",e,this.errorHandler);
return;
}if(!callBack&&xmlHttp){if(request.status==200){return transformed();
}}};
MVMapView.prototype.getSrid=function(){return this.srid;
};
MVMapView.prototype.printWaitStart=function(){MVUtil.setCursor(document.body,"wait");
MVUtil.setCursor(this.base_div,"wait");
};
MVMapView.prototype.printWaitEnd=function(){MVUtil.setCursor(document.body,"");
this.setTileLayerCursor(this.cursorStyleDefault);
};
MVMapView.prototype.getMapTileLayer=function(b){var a=b.split(".");
if(a.length<2){return"";
}else{return a[1];
}};
MVMapView.prototype.getMapImageURL=function(f,l,b,n,k){var d=this.getMapAsXML(l,b,n,k);
var m=MVUtil.isLocalDomain(this.baseURL);
var g=m||MVMapView.XMLHTTPEnabled;
var a=this.baseURL;
if(MVUtil.strEndWith(a,"/")){a=a+"omserver";
}else{a=a+"/omserver";
}var h=MVUtil.getXMLHttpRequest(g);
h.open("POST",MVUtil.getXMLHttpUrl(a),true);
h.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
h.send(MVUtil.getXMLHttpReq(a,"xml_request="+encodeURIComponent(d)));
var o=this;
h.onreadystatechange=function(){if(h.readyState==4){if(h.status==200){var t=h.responseText;
var s=t.indexOf('url="');
if(s<0){MVi18n.reportError("MVMapView.getMapImageURL","MAPVIEWER-05519",t,o.errorHandler);
return;
}var r=t.substring(s+5,t.indexOf('"',s+5));
f(r);
}}};
};
MVMapView.prototype.getMapAsXML=function(I,E,C,l){if(!E){E=this.getPaneWidth();
}if(!C){C=this.getPaneHeight();
}if(!l&&this.real_base_div.style&&this.real_base_div.style.backgroundColor){if(MVUtil.strBeginWith(this.real_base_div.style.backgroundColor,"rgb")){var J=this.real_base_div.style.backgroundColor.length;
var a=this.real_base_div.style.backgroundColor.substring(4,J-1);
var u=a.split(",");
if(u.length==3){var A=parseInt(u[0]).toString(16);
var K=parseInt(u[1]).toString(16);
var M=parseInt(u[2]).toString(16);
A=A.length>1?A:"0"+A;
K=K.length>1?K:"0"+K;
M=M.length>1?M:"0"+M;
l="#"+A+K+M;
}}else{if(MVUtil.strBeginWith(this.real_base_div.style.backgroundColor,"#")){l=this.real_base_div.style.backgroundColor;
}}}var w=l?'bgcolor="'+l+'" ':' transparent="true" ';
var h='<?xml version="1.0" standalone="yes"?>';
var D=this.defaultDataSource?this.defaultDataSource:MVMessages.default_datasource;
h=h+'<map_request datasource="'+D+'" format="'+I+'" width="'+E+'" height="'+C+'" antialiase="true" '+w+(this.getSrid()?'srid="'+this.getSrid()+'"':"");
var o=null;
for(H=0;
H<this.mapLayers.length;
H++){var s=this.mapLayers[H];
if(!s.isVisible()){continue;
}if(s instanceof MVGoogleTileLayerV3||s instanceof MVGoogleTileLayerV2||s instanceof MVBingTileLayerV6||s instanceof MVBingTileLayerV7){o=s.getStaticMapURL(E,C);
}}if(o!=null){h=h+' bgimage="'+o+'"';
}var f=this.getCopyright();
if(f){h=h+' footnote="'+f+'"';
}if(this.wraparound){h=h+' wraparound="true"';
}h=h+">";
var B=parseInt(this.getPaneHeight())/this.pixPerY;
var F=this.getCenter();
h=h+'<center size="'+B+'"><geoFeature><geometricProperty typeName="center"><Point><coordinates>'+F.sdo_point.x+","+F.sdo_point.y+"</coordinates></Point></geometricProperty></geoFeature></center>";
h=h+"<themes>";
for(var H=0;
H<this.mapLayers.length;
H++){if(this.mapLayers[H].isVisible()&&this.mapLayers[H].layerControl&&!(this.mapLayers[H] instanceof MVCustomMapTileLayer)&&(this.mapLayers[H].childrenLayers||(this.mapLayers[H].minVisibleLevel==null||this.mapLayers[H].minVisibleLevel<=this.zoomLevel)&&(this.mapLayers[H].maxVisibleLevel==null||this.mapLayers[H].maxVisibleLevel>=this.zoomLevel))){h=h+this.mapLayers[H].layerControl.getXMLForPrint(H);
}}var v="";
var d="";
var n="";
for(var H=0;
H<this.ThemeBasedFOIGroup.length;
H++){if(this.ThemeBasedFOIGroup[H].isVisible()){var k=null;
if(this.ThemeBasedFOIGroup[H].themebasedfoi.customedMarker){k=this.ThemeBasedFOIGroup[H].themebasedfoi.theme+"_markerstyle";
var L=new MVStyleMarker(k,"image");
var m=this.ThemeBasedFOIGroup[H].themebasedfoi.customedMarker;
L.setImageUrl(m.imgURL);
L.setSize(m.width,m.height);
d+=L.getXMLString();
}v+=this.ThemeBasedFOIGroup[H].beforePrint(k);
if(this.ThemeBasedFOIGroup[H].themebasedfoi.nsdpObj!=null){n+=this.ThemeBasedFOIGroup[H].themebasedfoi.nsdpObj.getXML(this.ThemeBasedFOIGroup[H].themebasedfoi);
}var t=this.ThemeBasedFOIGroup[H].themebasedfoi.styles;
if(t.length>0){for(var G=0;
G<t.length;
G++){d+=t[G].getXMLString();
}}}}for(var H=0;
H<this.indFOIsControl.indFOIArray.length;
H++){if(this.indFOIsControl.indFOIArray[H].style&&this.indFOIsControl.indFOIArray[H].style.getXMLString&&this.indFOIsControl.indFOIArray[H].visible){d+=this.indFOIsControl.indFOIArray[H].style.getXMLString();
}if(this.indFOIsControl.indFOIArray[H].createMarker){var k="indfoi_"+this.indFOIsControl.indFOIArray[H].id+"_style";
var L=new MVStyleMarker(k,"image");
L.setImageUrl(this.indFOIsControl.indFOIArray[H].imgURL);
L.setSize(this.indFOIsControl.indFOIArray[H].width,this.indFOIsControl.indFOIArray[H].height);
d+=L.getXMLString();
}}h=h+v+"</themes>";
if(d!=""){h+=" <styles>"+d+"</styles>";
}if(n!=""){h+=n;
}h=h+this.indFOIsControl.beforePrint();
if(this.scalectl){var N="SOUTH_WEST";
switch(this.scalebarPosition){case 1:N="NORTH_EAST";
break;
case 3:N="SOUTH_EAST";
break;
case 4:N="NORTH_WEST";
break;
}var z="DUAL_MODES";
if(this.scalectl.format!=null&&this.scalectl.format=="METRIC"){z="METRIC_MODE";
}else{if(this.scalectl.format!=null&&this.scalectl.format=="IMPERIAL"){z="US_MODE";
}}h=h+'<scale_bar mode="'+z+'" position="'+N+'" ';
h=h+' color1="#000000" color2="#FFFFFF"';
h=h+' offset_x="'+this.scalebarOffsetWidth;
h=h+'" offset_y="'+this.scalebarOffsetHeight+'"';
if(this.scalectl.maxLength){h=h+' length_hint="'+this.scalectl.maxLength+'"';
}if(this.msi.getCSType()=="PROJECTED"&&this.scalectl.transformToGeodetic){h=h+' transform_to_wgs84="true"';
}h=h+"/>";
}h=h+"</map_request>";
return h;
};
MVMapView.prototype.beforePrint=function(){return this.getMapAsXML("GIF_URL");
};
MVMapView.prototype.printReset=function(){this.real_base_div.className=null;
this.printImage=null;
if(this.printDiv){while(this.printDiv.childNodes.length>0){var a=this.printDiv.childNodes[0];
if(a.src){}a.onload=null;
this.printDiv.removeChild(a);
MVUtil.deleteNode(a);
}}};
MVMapView.prototype.printPrepare=function(){this.real_base_div.className=("noprint");
};
MVMapView.prototype.print=function(d){var l=this;
if(d.style.position!="absolute"){d.style.position="relative";
}d.style.width=MVUtil.pixel(this.getPaneWidth());
d.style.height=MVUtil.pixel(this.getPaneHeight());
if(!this.printing){this.printWaitStart();
this.printReset();
try{if(this.mapDecorationArray!=null){for(var g=0;
g<l.mapDecorationArray.length;
g++){if(this.mapDecorationArray[g].isPrintable&&this.mapDecorationArray[g].visible&&!this.mapDecorationArray[g].collapsed){d.appendChild(this.mapDecorationArray[g].getPrintContainer());
}}}var b=this.indFOIsControl.getHTMLForPrint();
d.appendChild(b);
}catch(k){}var f=this.beforePrint();
var m=MVUtil.isLocalDomain(this.baseURL);
var h=m||MVMapView.XMLHTTPEnabled;
var a=this.baseURL;
if(MVUtil.strEndWith(a,"/")){a=a+"omserver";
}else{a=a+"/omserver";
}req=MVUtil.getXMLHttpRequest(h);
req.open("POST",MVUtil.getXMLHttpUrl(a),true);
req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
req.send(MVUtil.getXMLHttpReq(a,"xml_request="+encodeURIComponent(f)));
req.onreadystatechange=function(){if(req.readyState==4){if(req.status==200){l.printDiv=d;
var o=document.createElement("img");
var r=req.responseText;
var n=r.indexOf('url="');
if(n<0){MVi18n.reportError("MVMapView.print","MAPVIEWER-05519",r,l.errorHandler);
return;
}o.src=r.substring(n+5,r.indexOf('"',n+5));
o.style.position="absolute";
o.style.left=MVUtil.pixel(0);
o.style.top=MVUtil.pixel(0);
l.printDiv.appendChild(o);
o.onload=MVUtil.closureWrapper(o,function(){l.printPrepare();
l.printWaitEnd();
window.print();
l.printing=false;
});
l.printImage=o;
}}};
}};
MVMapView.prototype.addPrintCopyRightPanel=function(b){var a=document.createElement("span");
a.className="copyright";
a.style.zIndex=1999;
if(typeof b=="string"){a.innerHTML=" "+b+" ";
this.printDiv.appendChild(a);
}else{if(this.copyright!=undefined){a.innerHTML=" "+this.copyright.innerHTML+" ";
this.printDiv.appendChild(a);
}}};
MVMapView.prototype.setMouseWheelZoomEnabled=function(a){this.mouseWheelZoomEnabled=a;
if(this.displayed){this.addEventHandlers();
}};
MVMapView.prototype.addEventHandlers=function(){var g=this;
var b=this.getBrowserType();
this.real_base_div.tabIndex=0;
this.real_base_div.onfocus=MVUtil.closureWrapper(this.real_base_div,function(){g.enableMapEventListner=true;
});
this.real_base_div.onblur=MVUtil.closureWrapper(this.real_base_div,function(){g.enableMapEventListner=false;
});
this.base_div.onmouseover=MVUtil.closureWrapper(this.base_div,function(){g.setTileLayerCursor(g.cursorStyleDefault);
g.enableMapEventListner=true;
});
this.base_div.onmouseout=MVUtil.closureWrapper(this.base_div,function(k){k=(k)?k:((window.event)?event:null);
var n=k.clientX;
var m=k.clientY;
var l=g.getPaneWidth();
var h=g.getPaneHeight();
var o=g.getEventCoords(k);
if(o.left<=0||o.left>=l||o.top<=0||o.top>=h||n<=1||n>=document.body.clientWidth||m<=1||m>=document.body.clientHeight){g.mUp(k);
g.enableMapEventListner=false;
if(g.arrowKeys.contains(37)){g.arrowKeys.remove(37);
}if(g.arrowKeys.contains(38)){g.arrowKeys.remove(38);
}if(g.arrowKeys.contains(39)){g.arrowKeys.remove(39);
}if(g.arrowKeys.contains(40)){g.arrowKeys.remove(40);
}}if(g.selectedFOI&&g.selectedThemeControl&&!g.clearSelect){g.clearSelect=true;
g.selectedThemeControl.mouseOutFun(g.selectedFOI,k);
g.selectedThemeControl=null;
g.selectedFOI=null;
}});
this.base_div.onclick=MVUtil.closureWrapper(this.base_div,function(h){if((g.mouseDownLoc&&g.mouseUpLoc&&(Math.abs(g.mouseDownLoc.left-g.mouseUpLoc.left)>1||Math.abs(g.mouseUpLoc.top-g.mouseUpLoc.top)>1))||(Math.abs(g.mouseDownScreenX-g.mouseUpScreenX)>1||Math.abs(g.mouseDownScreenY-g.mouseUpScreenY)>1)){return;
}h=(h)?h:((window.event)?event:null);
g.clickOnTheme(h);
if(g.mouseclickListener){g.mouseclickListener(MVUtil.getEvent(h));
}MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_CLICK,[MVUtil.getEvent(h)]);
});
if(!this.origBodyOnmousedownListener){MVUtil.detachEvent(document.body,"mousedown",this.origBodyOnmousedownListener);
}this.origBodyOnmousedownListener=MVUtil.closureWrapper(document.body,function(){g.enableMapEventListner=false;
});
MVUtil.attachEvent(document.body,"mousedown",this.origBodyOnmousedownListener);
if(b=="IF"){this.base_div.onselectstart=MVUtil.closureWrapper(this.base_div,function(){if((g.infoLayer&&g.infoLayer.mouseOnInfoWindow)||(g.infoLayer2&&g.infoLayer2.mouseOnInfoWindow)){return true;
}else{return false;
}});
this.base_div.oncontextmenu=MVUtil.closureWrapper(this.base_div,function(h){g.getMPos(window.event);
g.clickOnTheme(window.event,true);
if(g.rightclickListener){g.rightclickListener(MVUtil.getEvent(h));
}MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_RIGHT_CLICK,[MVUtil.getEvent(h)]);
if((g.infoLayer&&g.infoLayer.mouseOnInfoWindow)){return true;
}else{return false;
}});
if(this.mouseWheelZoomEnabled){this.base_div.onmousewheel=MVUtil.closureWrapper(this.base_div,function(){return g._mouseWheel(window.event);
});
}else{this.base_div.onmousewheel=null;
}this.base_div.onmousedown=MVUtil.closureWrapper(this.base_div,function(){MVUtil.stopEvent(window.event);
return g.mDn(window.event);
});
this.base_div.onmousemove=MVUtil.closureWrapper(this.base_div,function(){return g.mMv(window.event);
});
this.base_div.onmouseup=MVUtil.closureWrapper(this.base_div,function(){g.enableMapEventListner=true;
MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_UP,[window.event]);
return g.mUp(window.event);
});
this.base_div.ondblclick=MVUtil.closureWrapper(this.base_div,function(){return g.mDbClick(window.event);
});
this.bodyUp=function(){g.mUp();
};
document.body.attachEvent("onmouseup",this.bodyUp);
if(!this.overview){if(!this.origBodyOnkeydownListener){MVUtil.detachEvent(document.body,"keydown",this.origBodyOnkeydownListener);
}this.origBodyOnkeydownListener=MVUtil.closureWrapper(document.body,function(){return g._keyDown(window.event);
});
MVUtil.attachEvent(document.body,"keydown",this.origBodyOnkeydownListener);
if(!this.origBodyOnkeyupListener){MVUtil.detachEvent(document.body,"keyup",this.origBodyOnkeyupListener);
}this.origBodyOnkeyupListener=MVUtil.closureWrapper(document.body,function(){return g._keyUp(window.event);
});
MVUtil.attachEvent(document.body,"keyup",this.origBodyOnkeyupListener);
var f=function(){g._mapResized(window.event);
return false;
};
var d=function(){if(g.resizeWidth==document.body.offsetWidth){g.resizeCount=0;
f();
}else{g.resizeTimer=window.setTimeout(d,100);
}};
if(!this.origWindowOnResizeListener){MVUtil.detachEvent(window,"resize",this.origWindowOnResizeListener);
}this.origWindowOnResizeListener=MVUtil.closureWrapper(window,function(h){if(Math.abs(g.oldPaneWidth-g.getPaneWidth())<=3||Math.abs(g.oldPaneHeight-g.getPaneHeight())<=3){return;
}this.resizeCount++;
this.resizeWidth=document.body.offsetWidth;
if(this.resizeCount>1){if(this.resizeTimer){window.clearTimeout(this.resizeTimer);
}MVUtil.resizeTimer=window.setTimeout(d,100);
}});
MVUtil.attachEvent(window,"resize",this.origWindowOnResizeListener);
}}else{if(b=="NS"){this.base_div.oncontextmenu=function(h){g.getMPos(h);
g.clickOnTheme(h,true);
if(g.rightclickListener){g.rightclickListener(MVUtil.getEvent(h));
}MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_RIGHT_CLICK,[MVUtil.getEvent(h)]);
if((g.infoLayer&&g.infoLayer.mouseOnInfoWindow)){return true;
}else{return false;
}};
this.base_div.onmousedown=function(h){h.stopPropagation();
return g.mDn(h);
};
this.base_div.onmousemove=function(h){return g.mMv(h);
};
this.base_div.onmouseup=function(h){g.enableMapEventListner=true;
MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_UP,[h]);
return g.mUp(h);
};
this.mapview_mouseWheel_Gecko=function(h){MVUtil.stopEvent(h);
if(!g.lastWheelTime){g.lastWheelTime=new Date();
}else{var k=new Date();
if(k-g.lastWheelTime<10){return;
}}g.lastWheelTime=new Date();
h.preventDefault();
if(g.mouseWheelZoomEnabled){if(h.detail<0){g.zoomIn();
}else{g.zoomOut();
}}};
if(this.mouseWheelZoomEnabled){this.base_div.addEventListener("DOMMouseScroll",this.mapview_mouseWheel_Gecko,false);
}else{this.base_div.removeEventListener("DOMMouseScroll",this.mapview_mouseWheel_Gecko,false);
}this.base_div.ondblclick=function(h){return g.mDbClick(h);
};
if(!this.origWindowOnmouseupListener){MVUtil.detachEvent(window.document,"mouseup",this.origWindowOnmouseupListener);
}this.origWindowOnmouseupListener=function(h){return g.mUp(h);
};
MVUtil.attachEvent(window.document,"mouseup",this.origWindowOnmouseupListener);
if(!this.overview){if(!this.origWindowOnkeydownListener){MVUtil.detachEvent(window.document,"keydown",this.origWindowOnkeydownListener);
}this.origWindowOnkeydownListener=function(h){return g._keyDown(h);
};
MVUtil.attachEvent(window.document,"keydown",this.origWindowOnkeydownListener);
if(!this.origWindowOnkeyupListener){MVUtil.detachEvent(window.document,"keyup",this.origWindowOnkeyupListener);
}this.origWindowOnkeyupListener=function(h){return g._keyUp(h);
};
MVUtil.attachEvent(window.document,"keyup",this.origWindowOnkeyupListener);
if(!this.origWindowOnResizeListener){MVUtil.detachEvent(window,"resize",this.origWindowOnResizeListener);
}this.origWindowOnResizeListener=function(h){if(Math.abs(g.oldPaneWidth-g.getPaneWidth())<=3||Math.abs(g.oldPaneHeight-g.getPaneHeight())<=3){return;
}g._mapResized(h);
return false;
};
MVUtil.attachEvent(window,"resize",this.origWindowOnResizeListener);
}}else{if(b=="SF"){this.base_div.oncontextmenu=function(h){g.getMPos(h);
g.clickOnTheme(h,true);
if(g.rightclickListener){g.rightclickListener(MVUtil.getEvent(h));
}MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_RIGHT_CLICK,[MVUtil.getEvent(h)]);
if((g.infoLayer&&g.infoLayer.mouseOnInfoWindow)){return true;
}else{return false;
}};
this.base_div.onmousedown=function(h){h.stopPropagation();
return g.mDn(h);
};
this.base_div.onmousemove=function(h){return g.mMv(h);
};
this.base_div.onmouseup=function(h){g.enableMapEventListner=true;
MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_UP,[h]);
return g.mUp(h);
};
var a=function(h){h.preventDefault();
if(h.detail>0||h.wheelDelta<0){g.zoomOut();
}else{g.zoomIn();
}};
if(this.mouseWheelZoomEnabled){this.base_div.onmousewheel=a;
}else{this.base_div.onmousewheel=null;
}this.base_div.ondblclick=function(h){return g.mDbClick(h);
};
if(!this.origWindowOnmouseupListener){MVUtil.detachEvent(window.document,"mouseup",this.origWindowOnmouseupListener);
}this.origWindowOnmouseupListener=function(h){return g.mUp(h);
};
MVUtil.attachEvent(window.document,"mouseup",this.origWindowOnmouseupListener);
if(!this.overview){if(!this.origWindowOnkeydownListener){MVUtil.detachEvent(window.document,"keydown",this.origWindowOnkeydownListener);
}this.origWindowOnkeydownListener=function(h){return g._keyDown(h);
};
MVUtil.attachEvent(window.document,"keydown",this.origWindowOnkeydownListener);
if(!this.origWindowOnkeyupListener){MVUtil.detachEvent(window.document,"keyup",this.origWindowOnkeyupListener);
}this.origWindowOnkeyupListener=function(h){return g._keyUp(h);
};
MVUtil.attachEvent(window.document,"keyup",this.origWindowOnkeyupListener);
if(!this.origWindowOnResizeListener){MVUtil.detachEvent(window,"resize",this.origWindowOnResizeListener);
}this.origWindowOnResizeListener=function(h){if(Math.abs(g.oldPaneWidth-g.getPaneWidth())<=3||Math.abs(g.oldPaneHeight-g.getPaneHeight())<=3){return;
}g._mapResized(h);
return false;
};
MVUtil.attachEvent(window,"resize",this.origWindowOnResizeListener);
}}}}if(b=="OS"){this.base_div.onmousedown=function(){window.event.stopPropagation();
return g.mDn(window.event);
};
this.base_div.onmousemove=function(){return g.mMv(window.event);
};
this.base_div.onmouseup=function(){g.enableMapEventListner=true;
MVUtil.runListeners(g.EventListeners,MVEvent.MOUSE_UP,[window.event]);
return g.mUp(window.event);
};
this.base_div.ondblclick=function(){return g.mDbClick(window.event);
};
if(!this.origWindowOnmouseupListener){MVUtil.detachEvent(window.document,"mouseup",this.origWindowOnmouseupListener);
}this.origWindowOnmouseupListener=function(h){return g.mUp(window.event);
};
MVUtil.attachEvent(window.document,"mouseup",this.origWindowOnmouseupListener);
if(!this.overview){if(!this.origWindowOnResizeListener){MVUtil.detachEvent(window,"resize",this.origWindowOnResizeListener);
}this.origWindowOnResizeListener=function(h){if(Math.abs(g.oldPaneWidth-g.getPaneWidth())<=3||Math.abs(g.oldPaneHeight-g.getPaneHeight())<=3){return;
}g._mapResized(window.event);
return false;
};
MVUtil.attachEvent(window,"resize",this.origWindowOnResizeListener);
}this.base_div.onkeypress=function(){return g._keyDown(window.event);
};
this.base_div.onkeyup=function(){return g._keyUp(window.event);
};
}this.info_div.oncontextmenu=this.base_div.oncontextmenu;
this.info_div.onmousedown=this.base_div.onmousedown;
this.info_div.onmousemove=this.base_div.onmousemove;
this.info_div.onmouseup=this.base_div.onmouseup;
this.info_div.ondblclick=this.base_div.ondblclick;
if(MVGlobalVariables.touchSupported){MVUtil.setListener(this.base_div,"touchstart",function(h){g.touchStart(h);
h.preventDefault();
h.stopPropagation();
return g.mDn(h);
},true);
MVUtil.setListener(this.base_div,"touchmove",function(h){h.preventDefault();
h.stopPropagation();
g.cancelTouchAndHold();
if(g.touchCount==2){g.touchMove(h);
var l=g.pinchZoomScale;
if(!g.shouldPinchZoom(l)){return;
}g.pinchZooming=true;
for(var k=0;
k<g.mapLayers.length;
k++){if(g.mapLayers[k].layerControl){g.mapLayers[k].layerControl.zoomControl.scaleTiles(l);
}}return;
}return g.mMv(h);
},true);
MVUtil.setListener(this.base_div,"touchend",function(h){h.preventDefault();
h.stopPropagation();
g.enableMapEventListner=true;
g.touchEnd(h);
if(g.touchCount>0){return;
}var s=g.pinchZoomScale;
if(g.pinchZooming){var l=g.getPinchZoomingLevel(s);
g.zoomTo(l,null,true,true);
g.pinchZoomScale=1;
g.pinchZooming=false;
}else{var n=g.lastTouchLoc;
var k=MVUtil.getMouseXY(h);
g.lastTouchLoc=k;
var o=g.lastTouch;
var m=(new Date()).getTime();
g.lastTouch=m;
var r=9999;
if(n){r=(n.x-k.x)*(n.x-k.x);
r+=(n.y-k.y)*(n.y-k.y);
}if(m-o<500&&n&&r<=484){g.mDbClick(h);
}else{g.mUp(h);
}}},true);
}};
MVMapView.prototype._mouseWheel=function(a){if(a.wheelDelta>0){this.zoomIn();
}else{this.zoomOut();
}return false;
};
MVMapView.prototype._mapResized=function(a){try{this.sizeChanging=false;
this.zoomLevel=this.getZoomLevel();
if(this.zoomLevel>this.maxZoom){this.zoomLevel=this.maxZoom;
return;
}MVUtil.setLeftTop(this.div,0,0);
MVUtil.setLeftTop(this.info_div,0,0);
this.divLeft=0;
this.divTop=0;
this.origLeft=this.divLeft;
this.origTop=this.divTop;
this.dragOffsetX=0;
this.dragOffsetY=0;
this.setZoomLevel(this.zoomLevel);
if(this.center_mark){if(this.centerMarkUrl){this.setCenterMark(this.centerMarkUrl,this.centerMarkW,this.centerMarkH);
}else{this.setCenterMark(MVGlobalVariables.imgFilePath+"center.gif",20,20);
}}if(this.navigationPanel){this.navigationPanel.init(null,this);
}this.display();
if(this.scalectl){this.scalectl.update(this);
}if(this.overviewmap){this.overviewmap.submap._mapResized();
this.overviewmap.resetRectangle();
}if(this.mapDecorationArray!=null){for(var b=0;
b<this.mapDecorationArray.length;
b++){this.mapDecorationArray[b].refreshPosition();
}}return false;
}catch(d){}};
MVMapView.prototype.getBrowserType=function(){return MVGlobalVariables.browser;
};
MVMapView.prototype.enableKeyboardPanning=function(a){this.keyboardPanningEnabled=a;
};
MVMapView.prototype._keyDown=function(a){if(!this.enableMapEventListner||!this.keyboardPanningEnabled){return true;
}if(this.scroll_left==undefined||this.scroll_up==undefined||this.scroll_right==undefined||this.scroll_down==undefined){this.scroll_left=0;
this.scroll_up=0;
this.scroll_right=0;
this.scroll_down=0;
this.scroll_distance=0;
}var d=(this.getBrowserType()!="OS")?96:48;
if(!a.shiftKey){if(a.ctrlKey){switch(a.keyCode){case 90:for(var b=0;
b<this.mapDecorationArray.length;
b++){if(this.mapDecorationArray[b].collapsible){this.mapDecorationArray[b].startScrollElement();
}}break;
}return true;
}switch(a.keyCode){case 37:this.scroll_left=1;
this.arrowKeys.add(a.keyCode);
break;
case 38:this.scroll_up=1;
this.arrowKeys.add(a.keyCode);
break;
case 39:this.scroll_right=1;
this.arrowKeys.add(a.keyCode);
break;
case 40:this.scroll_down=1;
this.arrowKeys.add(a.keyCode);
break;
case d+1:this.scroll_left=1;
this.scroll_down=1;
break;
case d+2:this.scroll_down=1;
this.arrowKeys.add(a.keyCode);
break;
case d+3:this.scroll_right=1;
this.scroll_down=1;
break;
case d+4:this.scroll_left=1;
this.arrowKeys.add(a.keyCode);
break;
case d+5:break;
case d+6:this.scroll_right=1;
this.arrowKeys.add(a.keyCode);
break;
case d+7:this.scroll_left=1;
this.scroll_up=1;
break;
case d+8:this.scroll_up=1;
this.arrowKeys.add(a.keyCode);
break;
case d+9:this.scroll_up=1;
this.scroll_right=1;
break;
default:return true;
}this.startArrowScroll();
return false;
}else{return true;
}};
MVMapView.prototype._keyUp=function(a){if(!this.enableMapEventListner){return;
}var b=(this.getBrowserType()!="OS")?96:48;
if(a.shiftKey){switch(a.keyCode){case 37:this.arrowKeys.remove(a.keyCode);
break;
case 38:this.arrowKeys.remove(a.keyCode);
break;
case 39:this.arrowKeys.remove(a.keyCode);
break;
case 40:this.arrowKeys.remove(a.keyCode);
break;
default:return true;
}}else{switch(a.keyCode){case 33:this.smoothScroll(0,-this.getPaneHeight()/2);
break;
case 34:this.smoothScroll(0,this.getPaneHeight()/2);
break;
case 35:this.smoothScroll(this.getPaneWidth()/2,0);
break;
case 36:this.smoothScroll(-this.getPaneWidth()/2,0);
break;
case 37:this.arrowKeys.remove(a.keyCode);
break;
case 38:this.arrowKeys.remove(a.keyCode);
break;
case 39:this.arrowKeys.remove(a.keyCode);
break;
case 40:this.arrowKeys.remove(a.keyCode);
break;
case b+1:this.scroll_left=0;
this.scroll_down=0;
break;
case b+2:this.scroll_down=0;
this.arrowKeys.remove(a.keyCode);
break;
case b+3:this.scroll_right=0;
this.scroll_down=0;
break;
case b+4:this.scroll_left=0;
this.arrowKeys.remove(a.keyCode);
break;
case b+5:this.scroll_left=0;
this.scroll_up=0;
this.scroll_right=0;
this.scroll_down=0;
break;
case b+6:this.scroll_right=0;
this.arrowKeys.remove(a.keyCode);
break;
case b+7:this.scroll_left=0;
this.scroll_up=0;
break;
case b+8:this.scroll_up=0;
this.arrowKeys.remove(a.keyCode);
break;
case b+9:this.scroll_up=0;
this.arrowKeys.remove(a.keyCode);
this.scroll_right=0;
break;
case 107:this.zoomIn();
break;
case 187:this.zoomIn();
break;
case 109:this.zoomOut();
break;
case 189:this.zoomOut();
break;
case 61:this.zoomIn();
break;
case 43:this.zoomIn();
break;
case 45:this.zoomOut();
break;
case 95:this.zoomOut();
break;
default:return true;
}}return false;
};
MVMapView.prototype.getMX=function(a){a=(a)?a:((window.event)?event:null);
var b=a.clientX+document.body.scrollLeft-this.base_div.offsetLeft;
return b;
};
MVMapView.prototype.getMY=function(a){a=(a)?a:((window.event)?event:null);
var b=a.clientY+document.body.scrollTop-this.base_div.offsetTop;
return b;
};
MVMapView.prototype.getEventCoords=function(b){var d={left:0,top:0};
var a=MVUtil.offsetPositionAbsolute(this.real_base_div);
var f=MVUtil.getMouseXY(b);
d.left=f.x-a.x;
d.top=f.y-a.y;
return d;
};
MVMapView.prototype.mDn=function(a){a=(a)?a:((window.event)?event:null);
var d=this.getEventCoords(a);
var f=MVUtil.getMouseXY(a);
this.mouseDownScreenX=f.x;
this.mouseDownScreenY=f.y;
this.mouseDownLoc=d;
if(this.marqueeZoomOn&&this.marqueeRectDone){this.clearMarqueeRect=true;
}MVUtil.runListeners(this.EventListeners,MVEvent.MOUSE_DOWN,[a]);
if(this.mapmoveflag==false){return;
}if(!MVUtil.mouseLeftKeyPressed(a)){return;
}if((MVGlobalVariables.browser!="SF")&&(MVGlobalVariables.browser.indexOf("OS")!=0)&&((MVGlobalVariables.browser=="IF"&&a.button==4)||(MVGlobalVariables.browser!="IF"&&a.button==1))){MVUtil.stopEvent(a);
return false;
}for(var b=0;
b<this.ThemeBasedFOIGroup.length;
b++){if(this.ThemeBasedFOIGroup[b].isLoading()){this.setTileLayerCursor("wait");
}}if((MVGlobalVariables.browser.indexOf("OS")==0)&&a.button==2){mouseRightClick();
}if(this.m_scroll_id!=null){clearInterval(this.m_scroll_id);
this.m_scroll_id=null;
}this.curLay=this;
this.setDragOffset(d.left,d.top);
this.dragCoords=null;
this.getMPos(a);
if(MVGlobalVariables.browserClass==2){a.returnValue=false;
}if(this.mapLockMode){this.curLay=null;
}this.fetchMapOnDrag();
this.divLeftOrig=MVUtil.getLeft(this.div);
this.mapWindowMinXOrig=this.mapWindowMinLon;
this.mapWindowMaxYOrig=this.mapWindowMaxLon;
this.mapCenterXOrig=this.mapCenterX;
return false;
};
MVMapView.prototype.fetchMapOnDrag=function(){if(this.fetchingMapId){clearTimeout(this.fetchingMapId);
}this.fetchingMapId=this.setTimeout("this.fetching()",400);
};
MVMapView.prototype.fetching=function(){this.do_GetMinMaxLonLat();
for(var a=0;
a<this.mapLayers.length;
a++){this.mapLayers[a].scrollTiles();
}this.fetchMapOnDrag();
};
function mouseRightClick(a){a=(a)?a:((window.event)?event:null);
MVUtil.stopEvent(a);
return false;
}MVMapView.prototype.stopDragging=function(){if(this.draggedMapDecoration){this.draggedMapDecoration.stopDragging();
}if(this.marqueeZoomOn&&this.clearMarqueeRect){this.marqueeZoomRectangleTool.clear();
this.marqueeZoom();
}this.curLay=null;
this.setTileLayerCursor(this.cursorStyleDefault);
this.beingDragged=false;
if(this.transparentLayer.parentNode==null||(MVGlobalVariables.browser=="IF"&&this.transparentLayer.parentNode.tagName!="DIV")){this.div.appendChild(this.transparentLayer);
}};
MVMapView.prototype.mMv=function(a){if(MVGlobalVariables.touchSupported&&!event.touches){return;
}this.getMPos(MVUtil.getEvent(a));
if(this.draggedMapDecoration){MVUtil.runListeners(this.EventListeners,MVEvent.MOUSE_MOVE,[a]);
var d=MVUtil.getMouseXY(a);
this.draggedMapDecoration.setLeftTop(this.draggedMapDecoration.dragStartLeft+(d.x-this.draggedMapDecoration.dragStartMouseLoc.x),this.draggedMapDecoration.dragStartTop+(d.y-this.draggedMapDecoration.dragStartMouseLoc.y));
if(this.draggedMapDecoration.dragListener){this.draggedMapDecoration.dragListener(this.draggedMapDecoration.getPosition());
}MVUtil.runListeners(this.draggedMapDecoration.EventListeners,MVEvent.DRAG,[this.draggedMapDecoration.getPosition()]);
return;
}this.mouseOnTheme(a);
if(this.mapmoveflag==false||!this.curLay||this.mapLockMode||!this.draggingEnabled){MVUtil.runListeners(this.EventListeners,MVEvent.MOUSE_MOVE,[a]);
return;
}if(!this.beingDragged){this.beingDragged=true;
this.div.removeChild(this.transparentLayer);
}this.printReset();
var b=this.getEventCoords(a);
if(this.currentCursor!=this.cursorStyleDragging){this.setTileLayerCursor(this.cursorStyleDragging);
this.currentCursor=this.cursorStyleDragging;
}if(this.marqueeZoomOn&&this.marqueeRectDone&&this.clearMarqueeRect){this.clearMarqueeRect=false;
}this.move(b.left,b.top);
this.dragCoords=b;
if(this.overviewmap){this.overviewmap.moveRectanglefromMainMap(this.origLeft-this.divLeft,this.origTop-this.divTop);
}if(this.movingListener){this.movingListener(this.origLeft-this.divLeft,this.origTop-this.divTop);
}return false;
};
MVMapView.prototype.mUp=function(a){a=(a)?a:((window.event)?event:null);
if(this.dragCoords){this.mouseUpLoc=this.dragCoords;
}else{this.mouseUpLoc=this.getEventCoords(a);
}var d=MVUtil.getMouseXY(a);
this.mouseUpScreenX=d.x;
this.mouseUpScreenY=d.y;
if(this.mapmoveflag==false){return;
}this.setTileLayerCursor(this.cursorStyleDefault);
this.currentCursor=this.cursorStyleDefault;
if(!this.curLay&&!this.mapLockMode){return;
}this.stopDragging();
if(this.dragCoords){this.getMPos(this.dragCoords);
this.dragCoords=null;
}else{this.getMPos(a);
}this.do_GetMinMaxLonLat();
if(this.scrolled==true){for(var b=0;
b<this.mapLayers.length;
b++){this.mapLayers[b].scrollTiles();
}this.scrollThemeBasedFOIs();
this.scrolled=false;
if(this.overviewmap){this.overviewmap.refreshSubMap();
}if(this.recenterListener){this.recenterListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.RECENTER);
if(this.scalectl){this.scalectl.update(this);
}}if(this.fetchingMapId!=null){clearTimeout(this.fetchingMapId);
}this.setExternalAPITileLayersCenter(this.mapCenterX,this.mapCenterY,this.zoomLevel,true);
this.printReset();
};
MVMapView.prototype.setDoubleClickAction=function(a){if(a==null||(a!="recenter"&&a!="zoomin")){MVi18n.reportError("MVMapView.setDoubleClickAction","MAPVIEWER-05519","action",this.errorHandler);
return;
}this.doubleClickAction=a;
};
MVMapView.prototype.mDbClick=function(a){a=(a)?a:((window.event)?event:null);
if((this.EventListeners[MVEvent.MOUSE_DOUBLE_CLICK]!=null&&this.EventListeners[MVEvent.MOUSE_DOUBLE_CLICK].length!=0)||this.dblclickListener){if(this.dblclickListener){this.dblclickListener(MVUtil.getEvent(a));
}MVUtil.runListeners(this.EventListeners,MVEvent.MOUSE_DOUBLE_CLICK,[MVUtil.getEvent(a)]);
return true;
}if(!this.overview&&this.doubleClickAction=="zoomin"){this.zoomIn(this.getMouseLocation());
return true;
}if(this.mapLockMode){this.curLay=null;
this.base_div.style.cursor=this.cursorStyleDefault;
return true;
}this.base_div.style.cursor=this.cursorStyleDefault;
if(this.m_scroll_id!=null){clearInterval(this.m_scroll_id);
this.m_scroll_id=null;
}var f=this.getEventCoords(a);
var d=f.left;
var b=f.top;
this.map_moveX=this.getPaneWidth()/2-d;
this.map_moveY=this.getPaneHeight()/2-b;
this.distance=Math.sqrt(this.map_moveX*this.map_moveX+this.map_moveY*this.map_moveY);
this.stepTime=20;
this.panWidth=this.getPaneWidth();
this.panHeight=this.getPaneHeight();
this.totalTime=this.distance>((this.panWidth+this.panHeight)/4)?300:200;
this.loopCount=0;
this.curX=0;
this.curY=0;
this.smoothPan();
};
MVMapView.prototype.pan=function(a,b){this.smoothScroll(a,b);
};
MVMapView.prototype.smoothScroll=function(b,a){if(b==0&&a==0){return;
}if(this.mapLockMode){this.curLay=null;
this.base_div.style.cursor=this.cursorStyleDefault;
return true;
}this.base_div.style.cursor=this.cursorStyleDefault;
if(this.m_scroll_id!=null){clearTimeout(this.m_scroll_id);
this.m_scroll_id=null;
}this.map_moveX=b*(-1);
this.map_moveY=a*(-1);
this.distance=Math.sqrt(b*b+a*a);
this.stepTime=10;
this.panWidth=this.getPaneWidth();
this.panHeight=this.getPaneHeight();
this.totalTime=this.distance>((this.panWidth+this.panHeight)/4)?300:200;
this.loopCount=0;
this.curX=0;
this.curY=0;
this.smoothPan();
};
MVMapView.prototype.smoothPan=function(a){this.loopCount++;
var b=a?1:this.loopCount*this.stepTime/this.totalTime;
this.targetX=this.map_moveX*(2*b-b*b);
this.targetY=this.map_moveY*(2*b-b*b);
var f=this.panWidth/2;
var d=this.panHeight/2;
this.setDragOffset(f,d);
f=Math.round(this.targetX-this.curX)+this.panWidth/2;
d=Math.round(this.targetY-this.curY)+this.panHeight/2;
this.move(f,d);
if(this.overviewmap){this.overviewmap.moveRectanglefromMainMap(this.origLeft-this.divLeft,this.origTop-this.divTop);
}if(this.movingListener){this.movingListener(this.origLeft-this.divLeft,this.origTop-this.divTop);
}this.curX=this.targetX;
this.curY=this.targetY;
this.do_GetMinMaxLonLat();
for(i=0;
i<this.mapLayers.length;
i++){this.mapLayers[i].scrollTiles();
}if(b<1&&!(this.map_moveX==0&&this.map_moveY==0)){this.m_scroll_id=this.setTimeout("this.smoothPan()",this.stepTime);
this.smoothPanning=true;
}else{clearTimeout(this.m_scroll_id);
this.m_scroll_id=null;
this.scrollThemeBasedFOIs();
this.scrolled=false;
if(this.overviewmap){this.overviewmap.refreshSubMap();
}if(this.recenterListener){this.recenterListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.RECENTER);
if(this.scalectl){this.scalectl.update(this);
}this.printReset();
this.smoothPanning=false;
return false;
}};
MVMapView.prototype.smoothMove=function(a,f){this.targetX=a*(-1);
this.targetY=f*(-1);
var d=this.getPaneWidth()/2;
var b=this.getPaneHeight()/2;
this.setDragOffset(d,b);
d=Math.round(this.targetX+this.getPaneWidth()/2);
b=Math.round(this.targetY+this.getPaneHeight()/2);
this.move(d,b);
if(this.movingListener){this.movingListener(this.origLeft-this.divLeft,this.origTop-this.divTop);
}for(i=0;
i<this.mapLayers.length;
i++){this.mapLayers[i].scrollTiles();
}};
var MV_timeoutCounter=0;
MVMapView.prototype.setTimeout=function(timeoutHandler,elapseTime){var Ie="tempVar"+MV_timeoutCounter;
MV_timeoutCounter++;
eval(Ie+" = this;");
var oi=timeoutHandler.replace(/\\/g,"\\\\");
oi=oi.replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");'+Ie+" = null;",elapseTime);
};
MVMapView.prototype._setTimeoutDispatcher=function(func){eval(func);
};
MVMapView.prototype.startArrowScroll=function(b,a){if(!this.m_scroll_id){this.m_scroll_id=this.setTimeout("this.arrowScroll()",5);
}};
MVMapView.prototype.arrowScroll=function(){if(this.mapLockMode){this.curLay=null;
this.base_div.style.cursor=this.cursorStyleDefault;
return true;
}this.base_div.style.cursor=this.cursorStyleDefault;
if(this.m_scroll_id!=null){clearTimeout(this.m_scroll_id);
this.m_scroll_id=null;
}var g=(this.getBrowserType()!="OS")?96:48;
if(this.arrowKeys.length>0){var f=((this.arrowKeys.contains(37)||this.arrowKeys.contains(g+4))?1:0)+((this.arrowKeys.contains(39)||this.arrowKeys.contains(g+6))?-1:0);
var d=((this.arrowKeys.contains(38)||this.arrowKeys.contains(g+8))?1:0)+((this.arrowKeys.contains(40)||this.arrowKeys.contains(g+2))?-1:0);
this.moveOffsetX=(f==1?15:0)+(f==-1?-15:0);
this.moveOffsetY=(d==1?15:0)+(d==-1?-15:0);
this.setDragOffset(0,0);
this.move(this.moveOffsetX,this.moveOffsetY);
if(this.overviewmap){this.overviewmap.moveRectanglefromMainMap(this.origLeft-this.divLeft,this.origTop-this.divTop);
}if(this.movingListener){this.movingListener(this.origLeft-this.divLeft,this.origTop-this.divTop);
}for(i=0;
i<this.mapLayers.length;
i++){this.mapLayers[i].scrollTiles();
}this.m_scroll_id=this.setTimeout("this.arrowScroll()",5);
}else{this.printReset();
this.m_scroll_id=null;
this.do_GetMinMaxLonLat();
this.scrollThemeBasedFOIs();
this.scrolled=false;
if(this.overviewmap){this.overviewmap.refreshSubMap();
}if(this.recenterListener){this.recenterListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.RECENTER);
if(this.scalectl){this.scalectl.update(this);
}}};
MVMapView.prototype.dragoff=function(f){var d=this.getEventCoords(f);
var b=d.left;
var a=d.top;
if(((MVGlobalVariables.browser=="NS"))&&((b<=0)||(b>=this.getPaneWidth())||(a<=0)||(a>=this.getPaneHeight()))&&(this.curLay)){this.mUp();
}};
MVMapView.prototype.getMPos=function(a){var f=MVUtil.getMouseLocation(this,a);
var d=f.sdo_point.x;
var b=f.sdo_point.y;
this.mouseCurLon=d;
this.mouseCurLat=b;
};
MVMapView.prototype.setMapLockMode=function(a){this.mapLockMode=a;
};
MVMapView.prototype.enableDragging=function(a){this.draggingEnabled=a;
};
function KeyCodesArray(a){this.length=0;
if(a){for(var b=a.length-1;
b>=0;
--b){this.add(a[b]);
this.length++;
}}}KeyCodesArray.prototype.add=function(a){if(!this.contains(a)){this["key"+a]=1;
this.length++;
}};
KeyCodesArray.prototype.remove=function(a){if(this.exist(a)){delete this["key"+a];
this.length--;
}};
KeyCodesArray.prototype.contains=function(a){return this["key"+a]==1;
};
KeyCodesArray.prototype.exist=function(a){return this["key"+a]==1||this["key"+a]==2;
};
KeyCodesArray.prototype.sleep=function(){for(prop in this){if(typeof this[prop]!="function"){this[prop]=2;
}}};
KeyCodesArray.prototype.wakeup=function(){for(prop in this){if(typeof this[prop]!="function"){this[prop]=1;
}}};
MVMapView.prototype.addMapDecoration=function(a){if(this.mapDecorationArray==null){this.mapDecorationArray=new Array();
}this.mapDecorationArray.push(a);
if(this.displayed){var b="_md_"+this.mapDecorationId;
a.init(b,this,this.base_div);
this.mapDecorationId++;
a.displayed=true;
if(a.afterDisAction){a.afterDisAction();
}}};
MVMapView.prototype.removeMapDecoration=function(a){if(a==null||a.id==null||this.mapDecorationArray==null){return;
}for(var b=0;
b<this.mapDecorationArray.length;
b++){if(this.mapDecorationArray[b].id==a.id){if(this.mapDecorationArray[b].isPrintable){this.printReset();
}this.mapDecorationArray[b]=this.mapDecorationArray[this.mapDecorationArray.length-1];
this.mapDecorationArray.pop();
a.cleanUp();
var d=null;
if(a.collapsible){d=a.contentdiv;
}else{d=a.fixedDiv;
}d.onclick=null;
d.onmouseover=null;
d.onmouseout=null;
this.base_div.removeChild(d);
MVUtil.deleteNode(d);
this.adjustCopyrightPosition();
break;
}}};
MVMapView.prototype.addCopyRightNote=function(b,a){this.userDefinedCopyright=b;
this.showCopyRight(b,a);
};
MVMapView.prototype.addOverviewMap=function(a){if(this.overviewmap==null){this.overviewmap=a;
}else{return;
}if(this.displayed){this.overviewmap.init(this.overviewmap.overviewMapDIV,this);
}};
function createDIVMarkerNode(h,d,a,g,b,f){this.div=document.createElement("img");
this.div.src=d;
this.div.style.position="absolute";
this.div.style.zIndex=b;
if(f){this.div.title=f;
}this.div.style.width=MVUtil.pixel(a);
this.div.style.height=MVUtil.pixel(g);
MVUtil.disableElementSelection(this.div);
h.appendChild(this.div);
return this.div;
}MVMapView.prototype.addNavigationPanel=function(a,d,b,g,f){this.navigationPanel=new MVNavigationPanel(d,b,g,f);
if(!a){a="WEST";
}this.navigationPanel.navPosition=a;
if(this.displayed){this.navigationPanel.init(this.base_div,this);
}};
MVMapView.prototype.addScaleBar=function(a,b,f,d){if(this.scalectl){return;
}this.scalectl=new MVScaleBar(d);
this.scalebarPosition=a||this.scalebarPosition;
this.scalebarOffsetWidth=b||this.scalebarOffsetWidth;
this.scalebarOffsetHeight=f||this.scalebarOffsetHeight;
if(this.displayed){this.addScaleBarControl(this.scalectl);
}};
MVMapView.prototype.setMouseCursorStyle=function(a,b){if(a=="hand"){a="pointer";
}if(b=="dragging"){this.cursorStyleDragging=a;
}else{if(b=="default"){this.cursorStyleDefault=a;
MVUtil.setCursor(this.div,a);
}}};
MVMapView.prototype.enableLoadingIcon=function(a){this.loadingIconEnabled=a;
if(!a){this.setLoadingIconVisible(false);
}};
MVMapView.prototype.setLoadingIconVisible=function(f){if(!this.loadingIconEnabled){f=false;
}if(!f){if(this.loadingIcon){this.loadingIcon.style.visibility="hidden";
}}else{if(!this.loadingIcon){var g=document.createElement("img");
g.src=MVGlobalVariables.imgFilePath+"loading.gif";
g.style.zIndex=2001;
g.style.position="absolute";
var b=0,d=0;
if(g.width){b=g.width;
}if(g.height){d=g.height;
}g.style.left=MVUtil.pixel((this.getPaneWidth()-b)/2);
g.style.top=MVUtil.pixel((this.getPaneHeight()-d)/2);
var a=this;
g.onload=function(){g.style.left=MVUtil.pixel((a.getPaneWidth()-g.width)/2);
g.style.top=MVUtil.pixel((a.getPaneHeight()-g.height)/2);
g.onload=null;
};
this.base_div.appendChild(g);
this.loadingIcon=g;
}else{this.loadingIcon.style.left=MVUtil.pixel((this.getPaneWidth()-this.loadingIcon.width)/2);
this.loadingIcon.style.top=MVUtil.pixel((this.getPaneHeight()-this.loadingIcon.height)/2);
this.loadingIcon.style.visibility="visible";
}}};
MVMapView.prototype.getMapCoordinates=function(a){return MVSdoGeometry.createPoint(a.x/this.pixPerX+this.mapWindowMinLon,this.mapWindowMaxLat-a.y/this.pixPerY,this.srid);
};
MVMapView.prototype.setDefaultFOIImageFormat=function(a){if(a){this.foiImageFormat=a.toUpperCase();
}};
MVMapView.prototype.setErrorHandler=function(a){this.errorHandler=a;
};
MVMapView.prototype.checkLayersAndSetLoadingIcon=function(){var a=true;
for(var d=0;
d<this.ThemeBasedFOIGroup.length;
d++){var b=this.ThemeBasedFOIGroup[d];
if(b.div&&b.isVisible()&&b.loading){a=false;
break;
}}if(a&&this.foiGroupArray){for(var d=0;
d<this.foiGroupArray.length;
d++){var f=this.foiGroupArray[d];
if(f.loading){a=false;
break;
}}}if(a){this.setLoadingIconVisible(false);
}};
MVMapView.prototype.putThemeIntoSPQueue=function(b){if(!this.spQueue){this.spQueue=new Array();
}this.spQueue.push(b);
var a=this;
var d=function(){if(a.smoothPanning){return;
}clearInterval(a.spIntervalId);
a.spIntervalId=null;
while(a.spQueue.length>0){a.addThemeBasedFOI(a.spQueue.shift());
}};
if(!this.spIntervalId){this.spIntervalId=setInterval(d,50);
}};
MVMapView.prototype.setDefaultDataSource=function(a){if(!this.defaultDataSource){this.defaultDataSource=a;
}};
MVMapView.prototype.compareBaseURL=function(a){if(a&&a!=""&&a.indexOf(this.baseURL)<0){return false;
}else{return true;
}};
MVMapView.prototype.checkSize=function(){clearTimeout(this.sizeCheckingHandle);
var a=this;
var b=function(){if(!a.base_div){return;
}if(Math.abs(a.oldPaneWidth-a.getPaneWidth())>3||Math.abs(a.oldPaneHeight-a.getPaneHeight())>3){a.sizeChanging=true;
a.sizeStaticTime=0.4;
a.oldPaneWidth=a.getPaneWidth();
a.oldPaneHeight=a.getPaneHeight();
}else{a.sizeStaticTime+=0.4;
}if(a.sizeStaticTime>0.4&&a.sizeChanging){a._mapResized();
a.sizeChanging=false;
a.sizeStaticTime=0;
}a.checkSize();
};
this.sizeCheckingHandle=setTimeout(b,300);
};
MVMapView.prototype.getScreenXY=function(a,b){return{x:(a-this.mapCenterX)*this.pixPerX+this.getPaneWidth()/2,y:(this.mapCenterY-b)*this.pixPerY+this.getPaneHeight()/2};
};
MVMapView.prototype.showInfoTip=function(b,a){if(this.infoTipDiv){this.infoTipDiv.parentNode.removeChild(this.infoTipDiv);
}this.infoTipDiv=MVUtil.createSingleCellTable(b);
this.infoTipDiv.id="mv_mrqzm_msg";
this.infoTipDiv.style.border="1px solid #000000";
this.infoTipDiv.style.backgroundColor="#FFFFCC";
this.infoTipDiv.style.position="absolute";
var d=MVUtil.getMouseLeftTop(this,a);
this.infoTipDiv.style.left=d.x+"px";
this.infoTipDiv.style.top=d.y+"px";
this.infoTipDiv.style.zIndex=9999;
this.base_div.appendChild(this.infoTipDiv);
};
MVMapView.prototype.hideInfoTip=function(){if(this.infoTipDiv){this.infoTipDiv.parentNode.removeChild(this.infoTipDiv);
this.infoTipDiv=null;
}};
MVMapView.prototype.delayOperation=function(){if(arguments.length<2){return;
}var a=new Array();
for(var b=2;
b<arguments.length;
b++){a[b-2]=arguments[b];
}var d={obj:arguments[0],func:arguments[1],params:a};
this.delayedOperations.push(d);
};
MVMapView.addMapTileLayerDefinition=function(b){var a=b.dataSource?b.dataSource+"."+b.mapTileLayer:b.mapTileLayer;
if(b){MVGlobalVariables.addMapCacheConfig(a,b);
}};
MVMapView.XMLHTTPEnabled=false;
MVMapView.enableXMLHTTP=function(a){MVMapView.XMLHTTPEnabled=a;
};
MVMapView.isXMLHTTPEnabled=function(){return MVMapView.XMLHTTPEnabled;
};
MVMapView.setProxyPath=function(a){MVGlobalVariables.proxyPath=a;
};
MVMapView.getProxyPath=function(){return MVGlobalVariables.getProxyURL();
};
MVMapView.setErrorHandler=function(a){MVi18n.addBehavior("func",a,"text");
};
MVMapView.codingHints=true;
MVMapView.enableCodingHints=function(a){MVMapView.codingHints=a;
};
MVMapView.timing=false;
MVMapView.enableTiming=function(a){MVMapView.timing=a;
};
MVMapView.debug=false;
MVMapView.enableDebugMode=function(a){MVMapView.debug=a;
};
MVMapView.transformOrdinates=function(b,g,d){var h=new Array(g.length);
for(var f=0;
f<g.length;
f+=2){var a=b(g[f],g[f+1],d);
h[f]=a.x;
h[f+1]=a.y;
}return h;
};
MVMapView.prototype.getPixelsPerXUnit=function(){var a=this.msi.mapConfig.zoomLevels[this.zoomLevel].tileImageWidth;
var b=this.msi.mapConfig.zoomLevels[this.zoomLevel].tileWidth;
return a/b;
};
MVMapView.prototype.getPixelsPerYUnit=function(){var b=this.msi.mapConfig.zoomLevels[this.zoomLevel].tileImageHeight;
var a=this.msi.mapConfig.zoomLevels[this.zoomLevel].tileHeight;
return b/a;
};
MVMapView.prototype.wrapAroundLayer=function(a){if(!a){return false;
}if(this.wraparound){this.do_GetMinMaxLonLat();
var f=(a-this.getPaneWidth())*0.5/this.pixPerX;
var b=this.mapWindowMinLon-f;
var k=this.mapWindowMaxLon+f;
var h=this.msi.coverMinX;
var g=this.msi.coverMaxX;
var d=g-h;
var l=0;
if(b<h){l=Math.ceil((h-b)/d);
b+=d*l;
k+=d*l;
l=0-l;
}else{if(b>g){l=Math.ceil((b-g)/d);
b-=d*l;
k-=d*l;
}}if(k>g){return true;
}}return false;
};
MVMapView.prototype.enableMapWrapAround=function(a){this.wraparound=a;
};
MVMapView.extAPITileLayerCount=0;
MVMapView.prototype.addExternalAPITileLayer=function(g,k){if(!g){return;
}this.mapLayers.push(g);
var b=document.createElement("div");
this.base_div.appendChild(b);
if(!g.visible){b.style.visibility="hidden";
}b.style.zIndex=this.mapLayers.length;
b.style.position="absolute";
b.id="extTileLayer";
b.style.left=MVUtil.pixel(0);
b.style.top=MVUtil.pixel(0);
b.style.width="100%";
b.style.height="100%";
var h=document.createElement("img");
h.src=MVGlobalVariables.imgFilePath+"transparent."+(MVGlobalVariables.browser=="IF"?"gif":"png");
h.style.position="absolute";
h.style.zIndex=9999;
h.style.left=MVUtil.pixel(0);
h.style.top=MVUtil.pixel(0);
h.style.width="100%";
h.style.height="100%";
b.appendChild(h);
var a=this;
b.ondblclick=function(m){return a.mDbClick(m);
};
var l=document.createElement("div");
g.layerDiv=l;
l.id="mvexttl_"+MVMapView.extAPITileLayerCount++;
l.style.position="absolute";
l.style.left=MVUtil.pixel(0);
l.style.top=MVUtil.pixel(0);
l.style.width="100%";
l.style.height="100%";
b.appendChild(l);
g.parent=this;
if(this.displayed){var f=function(m){g.setCenterAndZoomLevel(m.getPointX(),m.getPointY(),a.zoomLevel);
g.init(l);
};
var d=MVSdoGeometry.createPoint(this.mapCenterX,this.mapCenterY,this.srid);
this.transformGeom(d,g.srid,null,f);
}MVMapView.addMapTileLayerDefinition(g.tileLayerDefinition);
};
MVMapView.prototype.moveExternalAPITileLayers=function(g,k,a,l){for(var f=0;
f<this.mapLayers.length;
f++){var d=this.mapLayers[f];
if(d.isExtAPITileLayer()&&d.isVisible()){if(d.move){d.move(g,k);
}else{var h=function(m){d.setCenter(m.getPointX(),m.getPointY());
};
var b=MVSdoGeometry.createPoint(a,l,this.srid);
this.transformGeom(b,d.srid,null,h);
}}}};
MVMapView.prototype.setExternalAPITileLayerCenter=function(f,a,k,h,g){if(!f.isVisible()&&!g){return;
}var d=function(l){if(g){f.centerX=l.getPointX();
f.centerY=l.getPointY();
if(h!=undefined&&h!=null){f.zoomLevel=h;
}}else{if(f.map){if(h!=undefined&&h!=null){f.resize();
f.setCenterAndZoomLevel(l.getPointX(),l.getPointY(),h);
}else{f.setCenter(l.getPointX(),l.getPointY());
}}else{f.centerX=l.getPointX();
f.centerY=l.getPointY();
if(h!=undefined&&h!=null){f.zoomLevel=h;
}f.init(f.layerDiv);
}}};
var b=MVSdoGeometry.createPoint(a,k,this.srid);
this.transformGeom(b,f.srid,null,d);
};
MVMapView.prototype.setExternalAPITileLayersCenter=function(a,h,g,f){for(var d=0;
d<this.mapLayers.length;
d++){var b=this.mapLayers[d];
if(b.isExtAPITileLayer()){this.setExternalAPITileLayerCenter(b,a,h,g,f);
}}};
MVMapView.prototype.get1stMapTileLayer=function(){if(this.mapLayers.length>0){return this.mapLayers[0];
}else{return null;
}};
MVMapView.prototype.checkMapDivLeftTop=function(F,g,C,l){var k,t;
if(this.wraparound||this.overview||!this.enforceCSBound){return{left:g,top:l};
}if(F==g){k=g;
}else{var E=(F-g)/this.pixPerX;
var B=(F<g);
var h=this.msi.mapConfig.coordSys.minX;
var f=this.msi.mapConfig.coordSys.maxX;
var H=(this.msi.mapConfig.coordSys.minX+this.msi.mapConfig.coordSys.maxX)/2;
var d=this.msi.mapConfig.coordSys.maxX-this.msi.mapConfig.coordSys.minX;
var A=this.mapWindowMaxLon-this.mapWindowMinLon;
var n=this.mapCenterX+E;
var w=n-A/2;
var v=n+A/2;
if(B){if(w<h){if(A>d){if(n<H){n=H;
}}else{if(this.mapWindowMinLon<h){n=this.mapCenterX;
}else{n=n-(w-h);
}}}}else{if(v>f){if(A>d){if(n>H){n=H;
}}else{if(this.mapWindowMaxLon>f){n=this.mapCenterX;
}else{n=n-(v-f);
}}}}E=n-this.mapCenterX;
k=F-E*this.pixPerX;
}if(C==l){t=l;
}else{var D=(C-l)/this.pixPerY;
var s=(C<l);
var b=this.msi.mapConfig.coordSys.minY;
var a=this.msi.mapConfig.coordSys.maxY;
var G=(this.msi.mapConfig.coordSys.minY+this.msi.mapConfig.coordSys.maxY)/2;
var r=this.msi.mapConfig.coordSys.maxY-this.msi.mapConfig.coordSys.minY;
var z=this.mapWindowMaxLat-this.mapWindowMinLat;
var m=this.mapCenterY-D;
var u=m-z/2;
var o=m+z/2;
if(!s){if(u<b){if(z>r){if(m<G){m=G;
}}else{if(this.mapWindowMinLat<b){m=this.mapCenterY;
}else{m=m-(u-b);
}}}}else{if(o>a){if(z>r){if(m>G){m=G;
}}else{if(this.mapWindowMaxLat>a){m=this.mapCenterY;
}else{m=m-(o-a);
}}}}D=m-this.mapCenterY;
t=C+D*this.pixPerY;
}return{left:Math.round(k),top:Math.round(t)};
};
MVMapView.prototype.checkMapCenter=function(b){if(this.overview){this.reCenterTag=false;
}if(this.wraparound||this.overview||!this.enforceCSBound){return b;
}if(this.originalCenter==null){this.originalCenter=b;
}if(this.reCenterTag){this.originalCenter=b;
}else{b=this.originalCenter;
}this.reCenterTag=false;
var a=this.msi.mapConfig.coordSys.minX;
var s=this.msi.mapConfig.coordSys.maxX;
var f=(this.msi.mapConfig.coordSys.minX+this.msi.mapConfig.coordSys.maxX)/2;
var v=this.msi.mapConfig.coordSys.maxX-this.msi.mapConfig.coordSys.minX;
var h=this.getPaneWidth()/this.pixPerX;
var k=b.getPointX();
var u=k-h/2;
var o=k+h/2;
if(h>v){k=f;
}else{if(u<a){k=a+h/2;
}else{if(o>s){k=s-h/2;
}}}var w=this.msi.mapConfig.coordSys.minY;
var r=this.msi.mapConfig.coordSys.maxY;
var d=(this.msi.mapConfig.coordSys.minY+this.msi.mapConfig.coordSys.maxY)/2;
var l=this.msi.mapConfig.coordSys.maxY-this.msi.mapConfig.coordSys.minY;
var m=this.getPaneHeight()/this.pixPerY;
var g=b.getPointY();
var t=g-m/2;
var n=g+m/2;
if(m>l){g=d;
}else{if(t<w){g=w+m/2;
}else{if(n>r){g=r-m/2;
}}}return MVSdoGeometry.createPoint(k,g,this.srid);
};
MVMapView.prototype.get1stNativeTileLayer=function(){for(var a=0;
a<this.mapLayers.length;
a++){if(this.mapLayers[a].layerControl){return this.mapLayers[a].layerControl;
}}return null;
};
MVMapView.prototype.combineTileLayers=function(){for(var f=0;
f<this.mapLayers.length;
f++){if(this.mapLayers[f].layerControl){for(var d=f+1;
d<this.mapLayers.length;
d++){if(MVUtil.canBeCombined(this.mapLayers[f],this.mapLayers[d])){if(!this.mapLayers[f].childrenLayers){var g=this.mapLayers[f].clone();
var b=new MVMapTilesControl(this,g);
g.parent=this;
g.layerControl=b;
g.childrenLayers=new Array();
g.childrenLayers.push(this.mapLayers[f]);
this.mapLayers[f].destroy();
this.mapLayers[f].parentLayer=g;
this.mapLayers[f]=g;
}if(this.mapLayers[d].childrenLayers){for(var a=0;
a<this.mapLayers[d].childrenLayers.length;
a++){this.mapLayers[d].childrenLayers[a].parentLayer=this.mapLayers[f];
}this.mapLayers[f].childrenLayers=this.mapLayers[f].childrenLayers.concat(this.mapLayers[d].childrenLayers);
}else{this.mapLayers[f].childrenLayers.push(this.mapLayers[d]);
this.mapLayers[d].parentLayer=this.mapLayers[f];
}this.mapLayers[f].isTransparent=this.mapLayers[f].isTransparent&&this.mapLayers[d].isTransparent;
this.mapLayers[d].destroy();
this.mapLayers.splice(d,1);
d--;
if(this.displayed){this.mapLayers[f].refresh(true);
}}else{break;
}}}}};
MVMapView.prototype.tileLayersConfigLoaded=function(){for(var a=0;
a<this.mapLayers.length;
a++){if(!this.mapLayers[a].config){return false;
}}return true;
};
MVMapView.prototype.enableMouseWheelZooming=function(a){this.setMouseWheelZoomEnabled(a);
};
MVMapView.prototype.getMapTileLayers=function(){if(this.mapLayers){return this.mapLayers.slice(0);
}else{return null;
}};
MVMapView.prototype.addFOIGroup=function(b){if(this.foiGroupArray==null){this.foiGroupArray=new Array();
}this.foiGroupArray.push(b);
b.parent=this;
if(this.foiGroupLayer==null){this.createFOIGroupLayer();
}b.init(this.foiGroupArray.length-1);
if(this.displayed){var a=(b.getLayerWidth()-this.getPaneWidth())*0.5/this.pixPerX;
var d=(b.getLayerHeight()-this.getPaneHeight())*0.5/this.pixPerY;
b.setLayerPoistion((this.getPaneWidth()-b.getLayerWidth())/2,(this.getPaneHeight()-b.getLayerHeight())/2);
b.display(this.mapWindowMinLon-a,this.mapWindowMinLat-d,this.mapWindowMaxLon+a,this.mapWindowMaxLat+d,true);
}};
MVMapView.prototype.refreshGroupFOIs=function(a){this.do_GetMinMaxLonLat();
if(this.foiGroupArray!=null){for(var b=0;
b<this.foiGroupArray.length;
b++){var f=this.foiGroupArray[b];
var d=(f.getLayerWidth()-this.getPaneWidth())*0.5/this.pixPerX;
var g=(f.getLayerHeight()-this.getPaneHeight())*0.5/this.pixPerY;
f.setLayerPoistion((this.getPaneWidth()-f.getLayerWidth())/2,(this.getPaneHeight()-f.getLayerHeight())/2);
f.display(this.mapWindowMinLon-d,this.mapWindowMinLat-g,this.mapWindowMaxLon+d,this.mapWindowMaxLat+g,a);
}}};
MVMapView.prototype.getFOIGroup=function(a){if(this.foiGroupArray&&this.foiGroupArray.length>a){return this.foiGroupArray[a];
}else{return null;
}};
MVMapView.prototype.createFOIGroupLayer=function(){this.foiGroupLayer=document.createElement("div");
this.foiGroupLayer.style.position="absolute";
this.foiGroupLayer.style.zIndex=180;
this.foiGroupLayer.style.left=MVUtil.pixel(0);
this.foiGroupLayer.style.top=MVUtil.pixel(0);
this.div.appendChild(this.foiGroupLayer);
};
MVMapView.prototype.showOverLayerMarkWindow=function(d,h,g,b){if(this.infoWindowTimeout2){clearTimeout(this.infoWindowTimeout2);
this.infoWindowTimeout2=null;
}var a=this;
var k=function(l){if(l){d=l;
}a.overlayMarker=true;
a.infoLayer2.domDiv=h;
if(g==null){g=0;
}if(b==null){b=0;
}a.infoLayer2.showHtmlWindow("",d.sdo_point.x,d.sdo_point.y,g,b,"MVInfoWindowStyle4");
a.overlayMarker=false;
a.infoLayer2.domDiv=null;
};
var f=function(){if(a.displayed){if(!d.srid){d.srid=a.srid;
}if(d.srid&&(a.srid!=d.srid)){center=a.transformGeom(d,a.srid,null,k);
}else{k();
}}else{a.infoWindowTimeout2=setTimeout(f,200);
}};
f();
};
MVMapView.prototype.removeOverLayerMarkWindow=function(){if(this.infoLayer2.infoWindows.length>0){this.infoLayer2.deleteInfoWindow(this.infoLayer2.infoWindows[0]);
}};
MVMapView.setUtilImgURL=function(a){MVGlobalVariables.imgFilePath=a;
};
MVMapView.prototype.getMapConfig=function(){if(!this.mapLayers){return null;
}if(!this.msi.mapConfig){MVi18n.reportError("MVMapView.getMapConfig","MAPVIEWER-05526");
}else{return this.msi.mapConfig;
}};
MVMapView.prototype.refreshMapContent=function(){this.refreshThemeBasedFOIs(true);
this.refreshIndFOIs();
this.refreshGroupFOIs(true);
this.infoLayer.refresh(this.mapWindowMinLon,this.mapWindowMinLat,this.mapWindowMaxLon,this.mapWindowMaxLat,this.getPaneWidth(),this.getPaneHeight());
this.infoLayer2.refresh(this.mapWindowMinLon,this.mapWindowMinLat,this.mapWindowMaxLon,this.mapWindowMaxLat,this.getPaneWidth(),this.getPaneHeight());
};
MVMapView.setLocale=function(b,a){if(MVi18n.language!=b||MVi18n.country!=a){MVi18n.language=b;
MVi18n.country=a;
}};
MVMapView.prototype.getCopyright=function(){if(this.userDefinedCopyright!=null){return this.userDefinedCopyright;
}else{return this.getEmbeddedCopyright();
}};
MVMapView.prototype.setTouchBehavior=function(a){this.touchBehavior=a;
};
MVMapView.touchSupported=function(){return MVGlobalVariables.touchSupported;
};
MVMapView.prototype.showCopyRight=function(h,m){if(this.copyright!=undefined){this.base_div.removeChild(this.copyright);
delete this.copyright;
}var b=1;
var k=1;
var g=0;
var d=0;
var a=null;
if(m){if(m.left!=undefined||m.top!=undefined){this.copyrightAutoAdjust=false;
if(m.left!=undefined){b=m.left;
}if(m.top!=undefined){k=m.top;
}if(m.xOffset!=undefined){g=m.xOffset;
}if(m.yOffset!=undefined){d=m.yOffset;
}if(m.style!=undefined){a=m.style;
}}}if(a==null){a="position:absolute;z-index:2000;font-size:12";
}var f="<div class=MV_COPYRIGHT style='"+a+"'>";
if(!this.copyrightAutoAdjust){cr=new MVMapDecoration(f+h+"</div>",b,k,500,null,g,d);
this.addMapDecoration(cr);
}else{var l=document.createElement("SPAN");
l.className="MV_COPYRIGHT";
l.innerHTML=" "+h+" ";
l.setAttribute("style",a);
l.style.cssText=a;
l.style.position="absolute";
l.style.bottom=MVUtil.pixel(1);
this.base_div.appendChild(l);
this.copyright=l;
this.adjustCopyrightPosition();
}};
MVMapView.prototype.showEmbeddedCopyright=function(){if(this.userDefinedCopyright!=null||this.overview){return;
}var a=this.getEmbeddedCopyright();
if(a==null){return;
}this.showCopyRight(a);
};
MVMapView.prototype.getEmbeddedCopyright=function(){var d="";
for(var b=0;
b<this.mapLayers.length;
b++){var a=this.mapLayers[b];
if(a.isVisible()&&a.config&&a.config.copyright){if(d){d+="; "+a.config.copyright;
}else{d=a.config.copyright;
}}}return d;
};
MVMapView.prototype.adjustCopyrightPosition=function(a){if(a==undefined){a=this;
}if(a==undefined||!a.copyrightAutoAdjust||!a.copyright){return;
}if(this.mapDecorationArray!=null){for(var b=0;
b<this.mapDecorationArray.length;
b++){var d=this.mapDecorationArray[b];
if(d.shouldAdjustCopyright&&d.visible&&!d.collapsed){a.copyright.style.right=MVUtil.pixel(d.width+3);
return;
}}}if(a.overviewmap&&a.overviewmap.mapDec&&!a.overviewmap.mapDec.collapsed&&a.overviewmap.mapDec.visible){a.copyright.style.right=MVUtil.pixel(a.overviewmap.mapDec.width+3);
}else{a.copyright.style.right=MVUtil.pixel(a.toolBarContainer.offsetWidth+5);
}};
MVMapView.prototype.setTileLayerCursor=function(b){if(this.mapLayers){for(var a=0;
a<this.mapLayers.length;
a++){if(this.mapLayers[a].layerControl){MVUtil.setCursor(this.mapLayers[a].layerControl.mapLayer,b);
}else{if(this.mapLayers[a].isExtAPITileLayer()){MVUtil.setCursor(this.mapLayers[a].layerDiv.parentNode,b);
}}}}if(this.themelayers){for(var a=0;
a<this.themelayers.length;
a++){if(this.themelayers[a].layerControl){MVUtil.setCursor(this.themelayers[a].layerControl.mapLayer,b);
}}}if(this.ThemeBasedFOIGroup){for(var a=0;
a<this.ThemeBasedFOIGroup.length;
a++){if(this.ThemeBasedFOIGroup[a].div&&(this.ThemeBasedFOIGroup[a].transImageLayerMap||this.multiThemeClickable)){MVUtil.setCursor(this.ThemeBasedFOIGroup[a].div,b);
}}}};
MVMapView.prototype.getTileLayerControl=function(mapTileLayer){var cs=null;
if(mapTileLayer.config.clientTileAccess){var ca=mapTileLayer.config.clientTileAccess;
if(mapTileLayer.config.coordSys){cs=mapTileLayer.config.coordSys;
}var tileLayer=null;
if(ca.lib_url&&ca.key){ca.lib_url=ca.lib_url.replace("=$$key$$","="+ca.key);
}var mapTypeVisible=false;
if(typeof ca.map_type_visible!=="undefined"&&ca.map_type_visible==="true"){mapTypeVisible=true;
}var options={key:ca.key,libURL:ca.lib_url,coordSys:cs,mapTypeList:ca.map_type_values,mapTypeVisible:mapTypeVisible};
if(ca.appID){options.appID=ca.appID;
}if(ca.type=="google"){var tStreetView=mapTileLayer.streetView;
var tStreetViewPosition=mapTileLayer.streetViewPosition;
tileLayer=new MVGoogleTileLayer(options);
if(tileLayer.enableStreetView&&tileLayer.setStreetViewPosition){if(tStreetView){tileLayer.enableStreetView(tStreetView);
}if(tStreetViewPosition&&tStreetViewPosition.x&&tStreetViewPosition.y){tileLayer.setStreetViewPosition(tStreetViewPosition.x,tStreetViewPosition.y);
}}}else{if(ca.type=="bing"){tileLayer=new MVBingTileLayer(options);
}else{if(ca.type=="bingV7"){tileLayer=new MVBingTileLayerV7(options);
}else{if(ca.type=="yahoo"){tileLayer=new MVYahooTileLayer(options);
}else{if(ca.type=="nokia"){tileLayer=new MVNokiaTileLayer(options);
}else{if(ca.type=="tomtom"){if(ca.display_traffic=="true"){ca.display_traffic=true;
}else{ca.display_traffic=false;
}var options={APIKey:ca.key,libURL:ca.lib_url,displayTraffic:ca.display_traffic};
tileLayer=new MVTomTomTileLayer(options);
}}}}}}if(tileLayer){tileLayer.setKey(ca.key);
if(mapTileLayer.mapType){tileLayer.setMapType(mapTileLayer.mapType);
}else{if(ca.default_map_type){var type;
eval("type="+ca.default_map_type);
tileLayer.setMapType(type);
}}this.removeMapTileLayer(mapTileLayer);
this.addMapTileLayer(tileLayer);
return tileLayer;
}}return new MVMapTilesControl(this,mapTileLayer);
};
MVMapView.prototype.setFOILayersSize=function(){for(lc=0;
lc<this.ThemeBasedFOIGroup.length;
lc++){this.ThemeBasedFOIGroup[lc].setSize(parseInt(this.ThemeBasedFOIGroup[lc].themebasedfoi.sizeXratio*(this.getPaneWidth())),parseInt(this.ThemeBasedFOIGroup[lc].themebasedfoi.sizeYratio*(this.getPaneHeight())));
}this.indFOIsControl.setSize(Math.ceil(2*(this.getPaneWidth())),Math.ceil(2*(this.getPaneHeight())));
if(this.foiGroupArray!=null){for(var a=0;
a<this.foiGroupArray.length;
a++){this.foiGroupArray[a].setSize(Math.ceil(2*(this.getPaneWidth())),Math.ceil(2*(this.getPaneHeight())));
}}};
MVMapView.prototype.shouldPinchZoom=function(b){if(b==1||b<=0){return false;
}var a=this.zoomLevel;
if(b>1&&a<this.maxZoom){return true;
}else{if(b<1&&a>0){return true;
}else{return false;
}}};
MVMapView.prototype.getPinchZoomingLevel=function(g){var h=this.zoomLevel;
if(g>0&&(g<1&&g>0.9||g>1&&g<1.1)){return h;
}var d=h;
var a=this.maxZoom;
var b=this.msi.getTileWidth(h);
var m=b/g;
if(g<1){d--;
for(var l=h-1;
l>=0;
--l){var n=this.msi.getTileWidth(l);
if(m>n){d=l;
b=n;
}else{var k=m/b;
var f=n/m;
if(k>f){d=l;
}break;
}}}else{if(g>1){d++;
for(var l=h+1;
l<=a;
l++){var n=this.msi.getTileWidth(l);
if(m<n){d=l;
b=n;
}else{var k=b/m;
var f=m/n;
if(k>f){d=l;
}break;
}}}}return d;
};
MVMapView.prototype.setTouchCount=function(a){if(a.type=="touchstart"){this.touchCount=a.touches.length;
}else{if(a.type=="touchend"){this.touchCount-=a.changedTouches.length;
}}};
MVMapView.prototype.touchStart=function(f){this.setTouchCount(f);
if(MVGlobalVariables.touchSupported){if(f.touches.length>2){this.cancelTouchAndHold();
return;
}this.pinchZoomScale=1;
if(f.touches.length==1){var h=MVUtil.getMouseXY(f.touches[0]);
this.touchStartLocs.push(h);
var a=this;
var g=function(){a.tapHoldTimeOut=null;
a.touchAndHold(f);
a.tapHoldFired=true;
};
this.tapHoldTimeOut=setTimeout(g,MVGlobalVariables.touchHoldTimeOut);
}else{if(f.touches.length==2){this.cancelTouchAndHold();
if(f.changedTouches.length==1){var h=MVUtil.getMouseXY(f.changedTouches[0]);
this.touchStartLocs.push(h);
}else{if(f.changedTouches.length==2){this.touchStartLocs=new Array();
var h=MVUtil.getMouseXY(f.changedTouches[0]);
this.touchStartLocs.push(h);
h=MVUtil.getMouseXY(f.changedTouches[1]);
this.touchStartLocs.push(h);
}}}}if(this.touchStartLocs.length==2){var d=this.touchStartLocs[1].x-this.touchStartLocs[0].x;
var b=this.touchStartLocs[1].y-this.touchStartLocs[0].y;
this.pinchZoomStartDist=Math.sqrt(d*d+b*b);
}}};
MVMapView.prototype.touchMove=function(f){if(MVGlobalVariables.touchSupported){if(f.touches.length==2){var g=MVUtil.getMouseXY(f.touches[0]);
var d=MVUtil.getMouseXY(f.touches[1]);
var b=g.x-d.x;
var a=g.y-d.y;
var h=Math.sqrt(b*b+a*a);
this.pinchZoomScale=h/this.pinchZoomStartDist;
}}};
MVMapView.prototype.touchEnd=function(a){MVUtil.runListeners(this.EventListeners,MVEvent.MOUSE_UP,[MVUtil.getEvent(a)]);
if(this.tapHoldFired){this.cancelTouchAndHold();
return;
}var b=false;
if(this.tapHoldTimeOut){b=true;
}this.cancelTouchAndHold();
this.touchStartLocs.length=0;
this.setTouchCount(a);
if(b){this.clickOnTheme(a);
if(this.mouseclickListener){this.mouseclickListener(MVUtil.getEvent(a));
}MVUtil.runListeners(this.EventListeners,MVEvent.MOUSE_CLICK,[MVUtil.getEvent(a)]);
}};
MVMapView.prototype.cancelTouchAndHold=function(d){this.tapHoldFired=false;
if(this.tapHoldTimeOut){clearTimeout(this.tapHoldTimeOut);
this.tapHoldTimeOut=null;
}this.indFOIsControl.cancelTouchAndHold();
for(var b=0;
b<this.ThemeBasedFOIGroup.length;
b++){var a=this.ThemeBasedFOIGroup[b];
a.cancelTouchAndHold();
}};
MVMapView.prototype.touchAndHold=function(a){if(!this.touchBehavior||!this.touchBehavior.touchHold||this.touchBehavior.touchHold=="mouse_right_click"){this.clickOnTheme(a,true);
if(this.rightclickListener){this.rightclickListener(MVUtil.getEvent(a));
}MVUtil.runListeners(this.EventListeners,MVEvent.MOUSE_RIGHT_CLICK,[MVUtil.getEvent(a)]);
}};
var MVMapInitializers=MVMapInitializers||new Array();
MVMapView.prototype.setTileLayerIndex=function(g,f){if(f>100){f=100;
}if(f<1){f=1;
}var b=this.mapLayers.length;
for(var k=0;
k<b;
k++){if(this.mapLayers[k]==g){while(k+1<this.mapLayers.length&&k+1<f){var h=this.mapLayers[k];
this.mapLayers[k]=this.mapLayers[k+1];
this.mapLayers[k+1]=h;
k++;
}while(k+1>f){var h=this.mapLayers[k];
this.mapLayers[k]=this.mapLayers[k-1];
this.mapLayers[k-1]=h;
k--;
}break;
}}for(var d=0;
d<b;
d++){var a=d+1;
this.mapLayers[d].zIndex=a;
if(this.mapLayers[d].isExtAPITileLayer()){if(this.mapLayers[d].layerDiv){this.mapLayers[d].layerDiv.parentNode.style.zIndex=a;
}}else{if(this.mapLayers[d].layerControl){this.mapLayers[d].layerControl.zIndex=a;
if(this.mapLayers[d].layerControl.mapLayer){this.mapLayers[d].layerControl.mapLayer.style.zIndex=a;
}}}}};
MVMapView.prototype.getTileLayerIndex=function(b){var a=this.mapLayers.length;
for(var d=0;
d<a;
d++){if(this.mapLayers[d]==b){return d+1;
}}return -1;
};
MVMapView.prototype.setFOILayerZIndex=function(a){this.foiLayerZIndex=a;
if(this.indFOIsControl){this.indFOIsControl.div.style.zIndex=a;
}};
MVMapView.prototype.setFOITopLayerZIndex=function(a){this.foiTopLayerZIndex=a;
if(this.indFOIsControl){this.indFOIsControl.topDiv.style.zIndex=a;
}};
MVMapView.prototype.enableCheckMapSize=function(a){if(a&&!this.checkMapSize){this.checkSize();
}else{if(!a&&this.checkMapSize&&this.sizeCheckingHandle!==null){clearTimeout(this.sizeCheckingHandle);
}}this.checkMapSize=a;
};
MVMapView.enableSelfDestroy=function(a){MVGlobalVariables.enableSelfDestroy=a;
};
MVMapView.prototype.enableMultiThemeClickable=function(a){this.multiThemeClickable=a;
};
MVMapView.prototype.clickOnTheme=function(m,b){if(this.multiThemeClickable){var k=MVUtil.getEventSource(m);
var l=k.tbf;
while(!l&&k.parentNode){k=k.parentNode;
l=k.tbf;
}if(l&&l.FOIType==1){return;
}var n=this.indFOIsControl;
var o=null;
if(this.foiGroupArray){var d=this.foiGroupArray.length;
for(var f=0;
f<d;
f++){o=this.foiGroupArray[f].getSelectedFOIByMouseLocation(m);
if(o){break;
}}}if(!o){o=n.getSelectedFOIByMouseLocation(m,true);
}if(o){this.clickOnFOI(n,o,b,m);
return;
}var h=this.ThemeBasedFOIGroup.length;
for(var g=h-1;
g>=0;
g--){var a=this.ThemeBasedFOIGroup[g];
if(a.FOIType==2&&a.themebasedfoi.clickable&&a.isVisible()&&a.themebasedfoi.minClickableLevel<this.zoomLevel){var o=a.getSelectedFOIByMouseLocation(m);
if(o){this.clickOnFOI(a,o,b,m);
return;
}}}if(!o){o=this.indFOIsControl.getSelectedFOIByMouseLocation(m,false);
}if(o){this.clickOnFOI(n,o,b,m);
return;
}}};
MVMapView.prototype.mouseOnTheme=function(m,b){if(this.multiThemeClickable&&!this.beingDragged){var k=MVUtil.getEventSource(m);
var l=k.tbf;
while(!l&&k.parentNode){k=k.parentNode;
l=k.tbf;
}if(l&&l.FOIType==1){return;
}var o=null;
var n=this.indFOIsControl;
if(this.foiGroupArray){var d=this.foiGroupArray.length;
for(var f=0;
f<d;
f++){o=this.foiGroupArray[f].getSelectedFOIByMouseLocation(m);
if(o){break;
}}}if(!o){o=n.getSelectedFOIByMouseLocation(m,true);
}if(o){this.mouseOutFromFOI(o,m);
this.selectedThemeControl=null;
this.mouseOverOnFOI(n,o,m);
if(o.cursorStyle){MVUtil.setCursor(n.div,o.cursorStyle);
}else{MVUtil.setCursor(n.div,"pointer");
}return;
}var h=this.ThemeBasedFOIGroup.length;
for(var g=h-1;
g>=0;
g--){var a=this.ThemeBasedFOIGroup[g];
if(a.FOIType==2&&a.themebasedfoi.clickable&&a.isVisible()&&a.themebasedfoi.minClickableLevel<this.zoomLevel){o=a.getSelectedFOIByMouseLocation(m);
if(o){this.mouseOutFromFOI(o,m);
this.selectedThemeControl=a;
this.mouseOverOnFOI(a,o,m);
MVUtil.setCursor(a.div,a.themebasedfoi.cursorStyle);
return;
}}}if(!o){o=n.getSelectedFOIByMouseLocation(m,false);
}if(o){this.mouseOutFromFOI(o,m);
this.selectedThemeControl=null;
this.mouseOverOnFOI(n,o,m);
if(o.cursorStyle){MVUtil.setCursor(n.div,o.cursorStyle);
}else{MVUtil.setCursor(n.div,"pointer");
}return;
}this.mouseOutFromFOI(o,m);
this.selectedThemeControl=null;
this.selectedFOI=null;
}};
MVMapView.prototype.mouseOutFromFOI=function(a,b){if(this.selectedFOI&&this.selectedFOI!=a){MVUtil.setCursor(this.base_div,this.cursorStyleDefault);
MVUtil.setCursor(this.div,this.cursorStyleDefault);
this.setTileLayerCursor(this.cursorStyleDefault);
if(this.selectedThemeControl){MVUtil.setCursor(this.selectedThemeControl.div,this.cursorStyleDefault);
this.selectedThemeControl.mouseOutFun(this.selectedFOI,b);
}else{MVUtil.setCursor(this.indFOIsControl.div,this.cursorStyleDefault);
this.indFOIsControl.mouseOutFun(this.selectedFOI,b);
}}};
MVMapView.prototype.mouseOverOnFOI=function(d,a,b){if(d&&d.themebasedfoi&&d.themebasedfoi.cursorStyle){MVUtil.setCursor(this.base_div,d.themebasedfoi.cursorStyle);
MVUtil.setCursor(this.div,d.themebasedfoi.cursorStyle);
}else{MVUtil.setCursor(this.base_div,"pointer");
MVUtil.setCursor(this.div,"pointer");
}if(this.selectedFOI!=a){d.mouseOverFun(a,b);
}else{d.mouseMoveFun(a,b);
}this.selectedFOI=a;
this.clearSelect=false;
};
MVMapView.prototype.clickOnFOI=function(f,a,d,b){if(d){f.rightClickFun(a,b);
}else{f.mouseUpFun(a,b);
}};
MVMapView.prototype.enableAutoHighlight=function(a){this.autoHighlight=a;
};
MVMapView.prototype.removeAllMapTypeControl=function(){if(document.getElementById("redline_cpan_div_"+this.mvId)){for(var b=this.mapLayers.length-1;
b>-1;
b--){var a=this.mapLayers[b];
if(a.mapTypeControl&&a.mapTypeControl.infoDecoration){this.removeMapDecoration(a.mapTypeControl.infoDecoration);
a.mapTypeControl.infoDecoration=null;
a.mapTypeControl=null;
return;
}}}};
function MVInfoWindow(mpane,x,y,tabs,index,_width,_height,style,mouseOver,parent,screenLoc,parameters,domDiv,infoLayerId){if(_width==null||_width<0){_width=0;
}if(_height==null||_height<0){_height=0;
}this.wininfopar=parent.parent;
if(style!="MVInfoWindowStyle1"&&style!="MVInfoWindowStyle4"){if(!_width){_width=MVGlobalVariables.infoWindowWidth;
}if(!_height){_height=MVGlobalVariables.infoWindowHeight;
}eval(style+".init()");
this.winDiv=eval(style+".createWindow("+x+","+y+","+_width+","+_height+","+parent.parent.mvId+")");
mpane.appendChild(this.winDiv);
}var close=function(){if(MVInfoWindowStyle1.redrawHandle){clearTimeout(MVInfoWindowStyle1.redrawHandle);
MVInfoWindowStyle1.redrawHandle=null;
}var id=parent.parent.mvId+"_"+infoLayerId;
if(MVInfoWindowStyle4.redrawHandle&&MVInfoWindowStyle4.redrawHandle[id]){clearTimeout(MVInfoWindowStyle4.redrawHandle[id]);
MVInfoWindowStyle4.redrawHandle[id]=null;
}MVInfoWindowStyle1.clear();
MVInfoWindowStyle4.clear();
parent.deleteInfoWindow(mpane);
};
if(style=="MVInfoWindowStyle1"){var winDiv=this.winDiv;
var mvinfo=this;
var drawInfoWindow=function(){if(MVInfoWindowStyle1.sizeChanged(parent.parent.mvId)){MVUtil.removeAllChildren(mpane);
MVInfoWindowStyle1.init(parameters);
winDiv=MVInfoWindowStyle1.createWindow(x,y,_width,_height,tabs.length,parent.parent.mvId);
MVInfoWindowStyle1.setTitleStyle(tabs,index);
mpane.appendChild(winDiv);
MVInfoWindowStyle1.addContent(mpane,tabs);
var table=document.getElementById("infowindow3table_"+parent.parent.mvId);
MVInfoWindowStyle1.getWindowSize(_width,_height,parent.parent.mvId);
MVInfoWindowStyle1.removeInActiveTabs(index,parent.parent.mvId);
if(table){if(!isNaN(screenLoc.x)){var infoPos=mvinfo.checkInfoWindowOverLayer(parent,infoLayerId,table,screenLoc,MVInfoWindowStyle1.windowOffset);
table.style.left=MVUtil.pixel(infoPos.x-screenLoc.x);
table.style.top=MVUtil.pixel(infoPos.y-screenLoc.y);
if(!mouseOver){MVInfoWindowStyle1.addCloseButton(close);
MVInfoWindowStyle1.renderCone(mpane,parent.parent.mvId);
}}else{if(!mouseOver){MVInfoWindowStyle1.addCloseButton(close);
MVInfoWindowStyle1.renderCone(mpane,parent.parent.mvId);
}}}}MVInfoWindowStyle1.redrawHandle=setTimeout(drawInfoWindow,500);
};
drawInfoWindow();
this.winDiv=winDiv;
}else{if(style=="MVInfoWindowStyle4"){var winDiv=this.winDiv;
MVInfoWindowStyle4.init(parameters);
this.mvId=parent.parent.mvId+"_"+infoLayerId;
var mvinfo=this;
var autoResize=false;
if(_width==0||_height==0){autoResize=true;
}var drawInfoWindow=function(){var mvId=mvinfo.mvId;
if(autoResize==true){_width=0;
_height=0;
}if(MVInfoWindowStyle4.sizeChanged(mvId)){if(domDiv&&domDiv.parentNode){domDiv.parentNode.removeChild(domDiv);
}MVUtil.removeAllChildren(mpane);
winDiv=document.createElement("div");
winDiv.style.position="absolute";
winDiv.style.left="0px";
winDiv.style.top="0px";
winDiv.style.zIndex="200";
var contentDiv;
if(tabs==null&&domDiv!=null){contentDiv=MVInfoWindowStyle4.createContentByDiv(mvId,domDiv,autoResize,_width,_height);
winDiv.appendChild(contentDiv);
mpane.appendChild(winDiv);
}else{if(tabs.length==1){contentDiv=MVInfoWindowStyle4.createTitleAndContent(mvId,tabs[0].getTitle(),tabs[0].getContent(),autoResize,_width,_height,close,mouseOver);
winDiv.appendChild(contentDiv);
mpane.appendChild(winDiv);
var titleCell=document.getElementById(mvId+"_title");
if(titleCell){var titleHeight=titleCell.offsetHeight;
if(_height&&_height-titleHeight-26>0){var conDiv=document.getElementById(mvId+"_content");
conDiv.style.height=MVUtil.pixel(_height-titleHeight-26);
}}}else{if(_width==0){_width=MVGlobalVariables.infoWindowWidth;
}if(_height==0){_height=MVGlobalVariables.infoWindowHeight;
}mpane.appendChild(winDiv);
contentDiv=MVInfoWindowStyle4.createTabsAndContent(tabs,index,_width,_height,winDiv,close);
}}if(autoResize){_width=contentDiv.offsetWidth;
if(_width<MVGlobalVariables.infoWindowWidth){contentDiv.style.width=MVUtil.pixel(MVGlobalVariables.infoWindowWidth);
_width=MVGlobalVariables.infoWindowWidth;
}_height=contentDiv.offsetHeight;
if(_height<MVGlobalVariables.infoWindowHeight){contentDiv.style.height=MVUtil.pixel(MVGlobalVariables.infoWindowHeight);
_height=MVGlobalVariables.infoWindowHeight;
}}var dialogDiv=MVInfoWindowStyle4.createWindow(x,y,_width,_height,tabs,mvId,close,mouseOver);
winDiv.appendChild(dialogDiv);
var table=document.getElementById("infowindow4_"+mvId);
if(table){MVInfoWindowStyle4.infoWindowWidth[mvId]=table.offsetWidth;
MVInfoWindowStyle4.infoWindowHeight[mvId]=table.offsetHeight;
if(!isNaN(screenLoc.x)){var infoPos=mvinfo.checkInfoWindowOverLayer(parent,infoLayerId,table,screenLoc,MVInfoWindowStyle4.windowOffset);
table.style.left=MVUtil.pixel(infoPos.x-screenLoc.x);
table.style.top=MVUtil.pixel(infoPos.y-screenLoc.y);
if(contentDiv!=null){contentDiv.style.left=MVUtil.pixel(infoPos.x-screenLoc.x);
contentDiv.style.top=MVUtil.pixel(infoPos.y-screenLoc.y);
}if(!mouseOver){MVInfoWindowStyle4.renderCone(mpane,mvId);
}}else{if(!mouseOver){MVInfoWindowStyle4.renderCone(mpane,mvId);
}}}}MVInfoWindowStyle4.redrawHandle[mvId]=setTimeout(drawInfoWindow,500);
};
drawInfoWindow();
this.winDiv=winDiv;
}else{div=this.createContentArea(tabs[0].getContent(),_width);
eval(style+".addContent(div)");
if(!mouseOver){eval(style+".addCloseButton(close)");
}}}}MVInfoWindow.prototype.createContentArea=function(d,a){var b=window.document.createElement("DIV");
b.className="infowindow";
b.style.position="absolute";
b.style.zIndex=3;
b.innerHTML="<table width="+a+"px><tr><td > "+d+"</td></tr></table>";
MVUtil.setCursor(b,"auto");
return b;
};
MVInfoWindow.prototype.hide=function(){if(this.winDiv){this.winDiv.style.display="none";
}};
MVInfoWindow.prototype.show=function(){this.winDiv.style.display="";
this.winDiv.style.visibility="visible";
};
MVInfoWindow.prototype.isVisible=function(){return this.winDiv&&this.winDiv.style.display!="none";
};
MVInfoWindow.prototype.checkInfoWindowOverLayer=function(g,b,A,s,f){var m=A.offsetWidth;
var v=A.offsetHeight;
var d=g.parent.divLeft;
var l=g.parent.divTop;
var z=g.width;
var t=g.height;
var o=s.x;
var n=s.y;
var B=true;
var r=true;
if(d+o>z/2){B=false;
}if(l+n<t/2){r=false;
}var a=false;
if(!g.parent.displayedWindow){g.parent.displayedWindow=new Array();
}b=parseInt(b);
if(b==2&&g.parent.displayedWindow[1]||b==1&&g.parent.displayedWindow[2]){if(B==g.parent.displayedWindow[3-b].right&&r==g.parent.displayedWindow[3-b].top){var C=d+o-z/2;
C=C/z;
var u=Math.abs(C/2);
C=l+n-t/2;
C=C/t;
var k=Math.abs(C/2);
if(u>k){r=!r;
}else{B=!B;
}}}g.parent.displayedWindow[b]={right:B,top:r,x:s.x,y:s.y};
if(r){if(l+n-f-v>=0){n=n-f-v;
}else{n=-l+f;
a=true;
}}else{if(l+n+f+v<=t){n=n+f;
}else{n=t-l-f-v;
a=true;
}}if(B){if(d+o+f+m<=z||a){o=o+f;
}else{o=z-d-f-m;
}}else{if(d+o-f-m>=0||a){o=o-f-m;
}else{o=-d+f;
}}return{x:o,y:n};
};
function MVSdoGeometry(g,b,d,a,f){if(!g){MVi18n.reportError("MVSdoGeometry.constructor","MAPVIEWER-05519","gtype");
}if(d!=undefined&&d!=null&&!MVUtil.isNumberArray(d)){MVi18n.reportError("MVSdoGeometry.constructor","MAPVIEWER-05527","sdo_elem_info");
}if(a!=undefined&&a!=null&&!MVUtil.isNumberArray(a)){MVi18n.reportError("MVSdoGeometry.constructor","MAPVIEWER-05527","sdo_ordinates");
}if(f!=undefined&&f!=null&&!(f instanceof MVSdoPointType)){MVi18n.reportError("MVSdoGeometry.constructor","MAPVIEWER-05527","sdo_point");
}this.gtype=g;
this.srid=b;
if(f){this.sdo_point=f;
}else{this.sdo_point=null;
}this.sdo_elem_info=d;
this.sdo_ordinates=a;
this.mbr=null;
}MVSdoGeometry.prototype.clone=function(){return new MVSdoGeometry(this.gtype,this.srid,this.sdo_elem_info,this.sdo_ordinates,this.sdo_point);
};
MVSdoGeometry.prototype.equals=function(a){if(a==null){return false;
}if(this.gtype!=a.gtype){return false;
}if(this.srid!=a.srid){return false;
}if(!this.array_equals(this.getPoint(),a.getPoint())){return false;
}if(!this.array_equals(this.sdo_elem_info,a.sdo_elem_info)){return false;
}if(this.gtype%10==1){return true;
}if(!this.array_equals(this.sdo_ordinates,a.sdo_ordinates)){return false;
}return true;
};
MVSdoGeometry.prototype.getDimensions=function(){return parseInt(this.gtype/1000);
};
MVSdoGeometry.prototype.getFirstPoint=function(){if(!this.isPoint()){return null;
}var a=[];
if(this.sdo_point!=null){a[0]=this.sdo_point.x;
a[1]=this.sdo_point.y;
if(this.getDimensions()>2){a[2]=this.sdo_point.z;
}}else{for(var b=0;
b<this.getDimensions();
b++){a[b]=this.sdo_ordinates[b];
}}return a;
};
MVSdoGeometry.prototype.getLabelPoint=function(){if(this.sdo_point==null){return null;
}return[this.sdo_point.x,this.sdo_point.y];
};
MVSdoGeometry.prototype.getLastPoint=function(){if(!this.isPoint()){return null;
}var a=[];
if(this.sdo_point!=null){a[0]=this.sdo_point.x;
a[1]=this.sdo_point.y;
if(this.getDimensions()>2){a[2]=this.sdo_point.z;
}}else{var d=this.sdo_ordinates.length-this.getDimensions();
for(var b=0;
b<this.getDimensions();
b++){a[b]=this.sdo_ordinates[d+b];
}}return a;
};
MVSdoGeometry.prototype.getMBR=function(){if(!this.mbr){if(this.isPoint()){this.mbr=new Array(this.getPointX(),this.getPointY(),this.getPointX(),this.getPointY());
}else{if(this.sdo_ordinates){var b;
var a;
var g;
var f;
for(var d=0;
d<this.sdo_ordinates.length;
d+=2){if(!b){b=this.sdo_ordinates[d];
g=b;
a=this.sdo_ordinates[d+1];
f=a;
}else{if(this.sdo_ordinates[d]<b){b=this.sdo_ordinates[d];
}else{if(this.sdo_ordinates[d]>g){g=this.sdo_ordinates[d];
}}if(this.sdo_ordinates[d+1]<a){a=this.sdo_ordinates[d+1];
}else{if(this.sdo_ordinates[d+1]>f){f=this.sdo_ordinates[d+1];
}}}}this.mbr=new Array(b,a,g,f);
}}}return this.mbr;
};
MVSdoGeometry.prototype.getNumPoints=function(){if(this.isPoint()){return 1;
}else{return this.sdo_ordinates.length/this.getDimensions();
}};
MVSdoGeometry.prototype.getOrdinates=function(){if(this.getGType()==1&&this.sdo_point){return[this.sdo_point.x,this.sdo_point.y];
}else{return this.sdo_ordinates;
}};
MVSdoGeometry.prototype.getOrdinatesOfElements=function(){var g=[];
var d=[];
if(this.sdo_elem_info.length==3){g[0]=this.sdo_ordinates;
}else{for(var b=0;
b<(this.sdo_elem_info.length-3)/3;
b++){var h=this.sdo_elem_info[3*b]-1;
var f=this.sdo_elem_info[3*(b+1)]-this.sdo_elem_info[3*b];
for(var a=0;
a<f;
a++){d[a]=this.sdo_ordinates[h+a];
}g[b]=d;
d=[];
}for(var a=this.sdo_elem_info[this.sdo_elem_info.length-3]-1;
a<this.sdo_ordinates.length;
a++){d[a-this.sdo_elem_info[this.sdo_elem_info.length-3]+1]=this.sdo_ordinates[a];
}g[b]=d;
}return g;
};
MVSdoGeometry.prototype.getPoint=function(){if(!this.isPoint()){return null;
}return this.getFirstPoint();
};
MVSdoGeometry.prototype.getGType=function(){return parseInt(this.gtype%10);
};
MVSdoGeometry.prototype.setSrid=function(a){this.srid=a;
};
MVSdoGeometry.prototype.isPoint=function(){return this.getGType()==1;
};
MVSdoGeometry.prototype.isCircle=function(){return this.sdo_elem_info&&this.sdo_elem_info.length==3&&this.sdo_elem_info[0]==1&&this.sdo_elem_info[1]==1003&&this.sdo_elem_info[2]==4;
};
MVSdoGeometry.prototype.getPointX=function(){if(!this.isPoint()){return null;
}return this.getFirstPoint()[0];
};
MVSdoGeometry.prototype.getPointY=function(){if(!this.isPoint()){return null;
}return this.getFirstPoint()[1];
};
MVSdoGeometry.prototype.toString=function(){var a="SdoGeometry(";
a+=this.gtype+",";
a+=this.srid+",";
a+=this.sdo_point+",";
if(!this.isPoint()&&this.sdo_elem_info!=null){a+="("+this.sdo_elem_info+"),";
}else{a+=",";
}if(!this.isPoint()&&this.sdo_ordinates!=null){a+="("+this.sdo_ordinates+"))";
}else{a+=")";
}return a;
};
MVSdoGeometry.prototype.array_equals=function(d,b){if(d==null&&b==null){return true;
}if(d==null||b==null){return false;
}if(d.length!=b.length){return false;
}for(var a=0;
a<d.length;
a++){if(d[a]!=b[a]){return false;
}}return true;
};
MVSdoGeometry.createPoint=function(a,d,b){if(!MVUtil.isNumber(a)){MVi18n.reportError("MVSdoGeometry.createPoint","MAPVIEWER-05527","x");
return null;
}if(!MVUtil.isNumber(d)){MVi18n.reportError("MVSdoGeometry.createPoint","MAPVIEWER-05527","y");
return null;
}return new MVSdoGeometry(2001,b,null,null,new MVSdoPointType(a,d,null));
};
MVSdoGeometry.createLineString=function(b,a){if(!MVUtil.isNumberArray(b)){MVi18n.reportError("MVSdoGeometry.createLineString","MAPVIEWER-05527","ordinatesArray");
return null;
}return new MVSdoGeometry(2002,a,[1,2,1],b,null);
};
MVSdoGeometry.createPolygon=function(b,a){if(!MVUtil.isNumberArray(b)){MVi18n.reportError("MVSdoGeometry.createPolygon","MAPVIEWER-05527","ordinatesArray");
return null;
}if(b.length<=2){return null;
}if(b[0]!=b[b.length-2]||b[1]!=b[b.length-1]){b.push(b[0]);
b.push(b[1]);
}return new MVSdoGeometry(2003,a,[1,1003,1],b,null);
};
MVSdoGeometry.createRectangle=function(a,h,g,f,b){if(!MVUtil.isNumber(a)){MVi18n.reportError("MVSdoGeometry.createRectangle","MAPVIEWER-05527","minX");
return null;
}if(!MVUtil.isNumber(g)){MVi18n.reportError("MVSdoGeometry.createRectangle","MAPVIEWER-05527","maxX");
return null;
}if(!MVUtil.isNumber(h)){MVi18n.reportError("MVSdoGeometry.createRectangle","MAPVIEWER-05527","minY");
return null;
}if(!MVUtil.isNumber(f)){MVi18n.reportError("MVSdoGeometry.createRectangle","MAPVIEWER-05527","maxY");
return null;
}var d;
if(a>g){d=g;
g=a;
a=d;
}if(h>f){d=f;
f=h;
h=d;
}return new MVSdoGeometry(2003,b,[1,1003,1],[a,h,a,f,g,f,g,h,a,h],null);
};
MVSdoGeometry.createRectangleByGCD=function(m,h,d,o,n){if(!MVUtil.isNumber(m)){MVi18n.reportError("MVSdoGeometry.createRectangleByGCD","MAPVIEWER-05527","minLon");
return null;
}if(!MVUtil.isNumber(h)){MVi18n.reportError("MVSdoGeometry.createRectangleByGCD","MAPVIEWER-05527","minLat");
return null;
}if(!MVUtil.isNumber(d)){MVi18n.reportError("MVSdoGeometry.createRectangleByGCD","MAPVIEWER-05527","width");
return null;
}if(!MVUtil.isNumber(o)){MVi18n.reportError("MVSdoGeometry.createRectangleByGCD","MAPVIEWER-05527","height");
return null;
}if(!n){n=8307;
}var l=MVGeomUtil.getPointAtBearing(new MVSdoPointType(m,h,0),o,0);
var k=MVGeomUtil.getPointAtBearing(new MVSdoPointType(m,h,0),d,Math.PI/2);
var g=m;
var f=h;
var b=k.x;
var a=l.y;
return new MVSdoGeometry(2003,n,[1,1003,1],[g,f,g,a,b,a,b,f,g,f],null);
};
MVSdoGeometry.createCircle=function(b,f,a,d){if(!MVUtil.isNumber(b)){MVi18n.reportError("MVSdoGeometry.createCircle","MAPVIEWER-05527","cx");
return null;
}if(!MVUtil.isNumber(f)){MVi18n.reportError("MVSdoGeometry.createCircle","MAPVIEWER-05527","cy");
return null;
}if(!MVUtil.isNumber(a)){MVi18n.reportError("MVSdoGeometry.createCircle","MAPVIEWER-05527","radius");
return null;
}return new MVSdoGeometry(2003,d,[1,1003,4],[b+a,f,b,f+a,b-a,f],null);
};
MVSdoGeometry.createCirclePolygon=function(b,h,a,d){if(!MVUtil.isNumber(b)){MVi18n.reportError("MVSdoGeometry.createCirclePolygon","MAPVIEWER-05527","cx");
return null;
}if(!MVUtil.isNumber(h)){MVi18n.reportError("MVSdoGeometry.createCirclePolygon","MAPVIEWER-05527","cy");
return null;
}if(!MVUtil.isNumber(a)){MVi18n.reportError("MVSdoGeometry.createCirclePolygon","MAPVIEWER-05527","radius");
return null;
}if(!d){d=8307;
}var f=new Array();
for(i=0;
i<36;
i++){var g=i*Math.PI/18;
f[i*2]=b+a*Math.cos(g);
f[i*2+1]=h+a*Math.sin(g);
}f[72]=f[0];
f[73]=f[1];
return new MVSdoGeometry(2003,d,[1,1003,1],f,null);
};
MVSdoGeometry.createGeodeticCirclePolygon=function(g,h,b,d){if(!MVUtil.isNumber(g)){MVi18n.reportError("MVSdoGeometry.createGeodeticCirclePolygon","MAPVIEWER-05527","longitude");
return null;
}if(!MVUtil.isNumber(h)){MVi18n.reportError("MVSdoGeometry.createGeodeticCirclePolygon","MAPVIEWER-05527","latitude");
return null;
}if(!MVUtil.isNumber(b)){MVi18n.reportError("MVSdoGeometry.createGeodeticCirclePolygon","MAPVIEWER-05527","radius");
return null;
}if(!d){d=8307;
}var f=new Array();
for(i=0;
i<36;
i++){var a=MVGeomUtil.getPointAtBearing(new MVSdoPointType(g,h,0),b,i*Math.PI/18);
f[i*2]=a.x;
f[i*2+1]=a.y;
}f[72]=f[0];
f[73]=f[1];
return new MVSdoGeometry(2003,d,[1,1003,1],f,null);
};
MVSdoGeometry.createPointAtBearing=function(f,h,d,g,b){if(!MVUtil.isNumber(f)){MVi18n.reportError("MVSdoGeometry.createPointAtBearing","MAPVIEWER-05527","longitude");
return null;
}if(!MVUtil.isNumber(h)){MVi18n.reportError("MVSdoGeometry.createPointAtBearing","MAPVIEWER-05527","latitude");
return null;
}if(!MVUtil.isNumber(d)){MVi18n.reportError("MVSdoGeometry.createPointAtBearing","MAPVIEWER-05527","bearing");
return null;
}if(!MVUtil.isNumber(g)){MVi18n.reportError("MVSdoGeometry.createPointAtBearing","MAPVIEWER-05527","distance");
return null;
}if(!b){b=8307;
}var a=MVGeomUtil.getPointAtBearing(new MVSdoPointType(f,h,0),g,d);
return MVSdoGeometry.createPoint(a.x,a.y,b);
};
MVSdoGeometry.prototype.getRequestURL=function(b){var a=String(document.location);
if(!b){b=MVGlobalVariables.getDefaultFoiURL();
}return b;
};
MVSdoGeometry.prototype.getLength=function(unit,transformToGeodetic,foiURL,callBack,dataSource){if(!dataSource){dataSource=MVGlobalVariables.getDefaultDataSource();
}if(!this.srid){var len=MVSdoGeometry.calcLength(this.sdo_ordinates);
if(callBack){callBack(len);
}return len;
}var srs=MVGlobalVariables.getSRS(this.srid);
var clientTransFunc=null;
if(transformToGeodetic){clientTransFunc=MVGlobalVariables.getCSTransFunc(this.srid,8307);
}if(!transformToGeodetic||this.srid==8307||this.srid==8265||transformToGeodetic&&clientTransFunc){if((srs||this.srid==8307||this.srid==8265||transformToGeodetic&&clientTransFunc)&&(this.gtype%10==2||this.gtype%10==3)&&this.sdo_elem_info.length==3&&this.sdo_elem_info[0]==1&&(this.sdo_elem_info[1]==2||this.sdo_elem_info[1]==1003||this.sdo_elem_info[1]==2003)&&this.sdo_elem_info[2]==1){var convFactor=0;
if(!unit||unit==""){convFactor=1;
}else{convFactor=MVGlobalVariables.getUnitFactor(unit);
if(srs&&srs.distConvFactor&&!transformToGeodetic){convFactor=convFactor/srs.distConvFactor;
}}var ordinates=this.sdo_ordinates;
if(clientTransFunc){ordinates=MVMapView.transformOrdinates(clientTransFunc,ordinates);
}if(convFactor){var len=0;
if(srs&&srs.type!="GEODETIC"&&!transformToGeodetic){len=MVSdoGeometry.calcLength(ordinates)/convFactor;
}else{len=MVGeomUtil.getGreatCircleLength(ordinates)/convFactor;
}if(callBack){callBack(len);
}return len;
}}}var request=null;
var finalresult;
var mgeometry=MVUtil.strReplaceAll(this.toString(),"null","");
if(this.gtype%10!=2&&this.gtype%10!=6&&this.gtype%10!=3&&this.gtype%10!=7){MVi18n.reportError("MVSdoGeometry.getLength","MAPVIEWER-05513");
return 0;
}else{mgeometry=MVUtil.strReplaceAll(mgeometry," ","");
}var requestURL=this.getRequestURL(foiURL);
var localDomain=(requestURL.indexOf(MVGlobalVariables.getProxyURL())<0&&MVUtil.isLocalDomain(requestURL));
var xmlHttp=localDomain||MVMapView.XMLHTTPEnabled;
if(!xmlHttp&&!callBack){MVi18n.reportError("MVSdoGeometry.getLength","MAPVIEWER-05521");
return -1;
}var requestStr="request=getlength&version=1.1&figord="+encodeURIComponent(mgeometry)+"";
if(unit){requestStr=requestStr+"&unit="+unit;
}if(transformToGeodetic){var trans=(transformToGeodetic==true)?"yes":"no";
requestStr=requestStr+"&togeodetic="+trans;
}if(dataSource){requestStr=requestStr+"&datasource="+dataSource;
}var request=null;
var respLoaded=function(){if(request.readyState==4){if(request.status==200){var resp=xmlHttp?request.responseText:this.responseText;
try{eval("var result="+resp);
finalresult=result;
if(result.length==0){result=null;
return;
}result=null;
}catch(e){MVi18n.reportError("MVSdoGeometry.getLength","MAPVIEWER-05523",resp+"\n"+e);
return;
}if(callBack){callBack(finalresult);
}if(xmlHttp){return finalresult;
}}}};
try{request=MVUtil.getXMLHttpRequest(xmlHttp);
if(callBack||!xmlHttp){request.onreadystatechange=respLoaded;
}request.open("POST",MVUtil.getXMLHttpUrl(requestURL),callBack||!xmlHttp);
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
request.send(MVUtil.getXMLHttpReq(requestURL,requestStr));
}catch(e){MVi18n.reportError("MVSdoGeometry.getLength","MAPVIEWER-05511",e);
}if(!callBack&&xmlHttp){if(request.status==200){return respLoaded();
}}};
MVSdoGeometry.prototype.getArea=function(unit,transformToGeodetic,foiURL,callBack,dataSource){if(!dataSource){dataSource=MVGlobalVariables.getDefaultDataSource();
}var request=null;
var finalresult;
var mgeometry=MVUtil.strReplaceAll(this.toString(),"null","");
if(this.gtype%10!=3&&this.gtype%10!=7){MVi18n.reportError("MVSdoGeometry.getArea","MAPVIEWER-05513");
return 0;
}else{mgeometry=MVUtil.strReplaceAll(mgeometry," ","");
}var requestURL=this.getRequestURL(foiURL);
var localDomain=(requestURL.indexOf(MVGlobalVariables.getProxyURL())<0&&MVUtil.isLocalDomain(requestURL));
var xmlHttp=localDomain||MVMapView.XMLHTTPEnabled;
if(!xmlHttp&&!callBack){MVi18n.reportError("MVSdoGeometry.getArea","MAPVIEWER-05521");
return -1;
}var requestStr="request=getarea&version=1.1&figord="+encodeURIComponent(mgeometry)+"";
if(unit){requestStr=requestStr+"&unit="+unit;
}if(transformToGeodetic){var trans=(transformToGeodetic==true)?"yes":"no";
requestStr=requestStr+"&togeodetic="+trans;
}if(dataSource){requestStr=requestStr+"&datasource="+dataSource;
}var request=null;
var respLoaded=function(){if(request.readyState==4){if(request.status==200){var resp=xmlHttp?request.responseText:this.responseText;
try{eval("var result="+resp);
finalresult=result;
if(result.length==0){result=null;
return;
}result=null;
}catch(e){MVi18n.reportError("MVSdoGeometry.getArea","MAPVIEWER-05523",resp+"\n"+e);
}if(callBack){callBack(finalresult);
}if(xmlHttp){return finalresult;
}}}};
try{request=MVUtil.getXMLHttpRequest(xmlHttp);
if(callBack||!xmlHttp){request.onreadystatechange=respLoaded;
}request.open("POST",MVUtil.getXMLHttpUrl(requestURL),callBack||!xmlHttp);
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
request.send(MVUtil.getXMLHttpReq(requestURL,requestStr));
}catch(e){MVi18n.reportError("MVSdoGeometry.getArea","MAPVIEWER-05511",e);
}if(!callBack&&xmlHttp){if(request.status==200){return respLoaded();
}}};
MVSdoGeometry.prototype.densify=function(){var k=this.getGType();
if(k<=1||k==5){return this;
}var d=MVGlobalVariables.getSRS(this.srid);
if(this.srid!=8307&&this.srid!=8265&&(!d||d.type!="GEODETIC"&&d.type!="PROJECTED")){return this;
}if(!this.sdo_elem_info||this.sdo_elem_info.length<3||!this.sdo_ordinates){return this;
}var n=this.sdo_point?this.sdo_point.clone():null;
var m=this.sdo_elem_info.slice();
var h=this.sdo_ordinates;
var b=this.getComponents(m,h);
if(b==null||b.length<=0){return null;
}var a=null;
var f=1;
if(d&&d.type=="PROJECTED"){f=100000*d.distConvFactor;
}for(var g=0;
g<b.length;
g++){var l=this.densifyComponent(b[g].elem_info,b[g].ordinates,f);
if(g==0){a=l.ordinates;
}else{m[g*3]=a.length+1;
a=a.concat(l.ordinates);
}}return new MVSdoGeometry(this.gtype,this.srid,m,a,n);
};
MVSdoGeometry.prototype.getComponents=function(d,b){if(!d||d.length<3||!b){return{elem_info:d,sdo_ordinates:b};
}var a=new Array();
var l=0;
for(var h=0;
h<d.length/3;
h++){var g=b.length;
if(h+1<d.length/3){g=d[(h+1)*3]-1;
}var k=null;
if(d[h*3+1]%10==3&&d[h*3+2]==3){d[h*3+2]=1;
var k=new Array();
k.push(b[l+0]);
k.push(b[l+1]);
k.push(b[l+0]);
k.push(b[l+3]);
k.push(b[l+2]);
k.push(b[l+3]);
k.push(b[l+2]);
k.push(b[l+1]);
k.push(b[l+0]);
k.push(b[l+1]);
}else{k=b.slice(l,g);
}var f={elem_info:d.slice(h*3,h*3+3),ordinates:k};
a.push(f);
l=g;
}return a;
};
MVSdoGeometry.prototype.densifyComponent=function(g,f,b){var d=g[1]%10;
var a={elem_info:g,ordinates:f};
switch(d){case 0:case 1:break;
case 2:case 3:if(g[2]==1){a={elem_info:g,ordinates:this.densifyOrdinates(f,b)};
}break;
default:break;
}return a;
};
MVSdoGeometry.prototype.densifyOrdinates=function(f,h){if(!f||f.length<4){return f;
}var a=new Array();
for(var k=0;
k<f.length-2;
k+=2){var g=f[k];
var m=f[k+1];
var b=f[k+2];
var l=f[k+3];
var r=b-g;
var o=l-m;
a.push(g);
a.push(m);
var d=Math.ceil(Math.abs(r)/h);
if(d>0){r=r*1/d;
o=o*1/d;
for(var n=0;
n<d-1;
n++){g+=r;
m+=o;
a.push(g);
a.push(m);
}}}a.push(f[f.length-2]);
a.push(f[f.length-1]);
return a;
};
MVSdoGeometry.prototype.toGML=function(){var b=this.getGType();
var a="";
switch(b%10){case 1:a=this.createPointForPrint(this.getOrdinates());
break;
case 2:a=this.createLineForPrint(this.getOrdinates());
break;
case 3:if(this.sdo_elem_info[2]==4){a=this.createCircleForPrint(this.getOrdinates());
}else{a=this.createPolygonForPrint(this.getOrdinates());
}break;
case 4:break;
case 5:a=this.createPointForPrint(this.getOrdinates());
break;
case 6:a=this.createMultiLineForPrint();
break;
case 7:a=this.createMultiPolygonForPrint();
break;
}return a;
};
MVSdoGeometry.prototype.createPointForPrint=function(d){var b=MVSdoGeometry.getOGCOrdinateString(d);
var a='<Point srsName="SDO:'+this.srid+'" ><coordinates>';
a=a+b+"</coordinates></Point>";
return a;
};
MVSdoGeometry.prototype.createLineForPrint=function(d){var b=MVSdoGeometry.getOGCOrdinateString(d);
var a='<LineString srsName="SDO:'+this.srid+'" ><coordinates>';
a=a+b+"</coordinates></LineString>";
return a;
};
MVSdoGeometry.prototype.createPolygonForPrint=function(d){var b=MVSdoGeometry.getOGCOrdinateString(d);
var a='<Polygon srsName="SDO:'+this.srid+'" ><outerBoundaryIs><LinearRing><coordinates>';
a=a+b+"</coordinates></LinearRing></outerBoundaryIs></Polygon>";
return a;
};
MVSdoGeometry.prototype.createMultiPolygonForPrint=function(){var a=this.getOrdinatesOfElements();
var d='<MULTIPOLYGON srsName="SDO:'+this.srid+'" >';
for(var b=0;
b<a.length;
b++){d=d+"<polygonMember>";
d=d+this.createPolygonForPrint(a[b]);
d=d+"</polygonMember>";
}d=d+"</MULTIPOLYGON>";
return d;
};
MVSdoGeometry.prototype.createMultiLineForPrint=function(){var a=this.getOrdinatesOfElements();
var b='<MultiLineString srsName="SDO:'+this.srid+'" >';
for(var d=0;
d<a.length;
d++){b=b+"<lineStringMember>";
b=b+this.createLineForPrint(a[d]);
b=b+"</lineStringMember>";
}b=b+"</MultiLineString>";
return b;
};
MVSdoGeometry.prototype.createCircleForPrint=function(l){var d=parseFloat(l[2]);
var b=parseFloat(l[1]);
var h=parseFloat(l[0])-parseFloat(l[2]);
var k="";
var m=2*Math.PI;
var g=d+h*Math.cos((m*0)/120);
for(var f=1;
f<120;
f++){if(f%2==0){k=d+h*Math.cos((m*f)/120);
g+=" "+k;
}else{k=b+h*Math.sin((m*f)/120);
g+=","+k;
}}var a='<Polygon srsName="SDO:'+this.srid+'" ><outerBoundaryIs><LinearRing><coordinates>';
a+=g+"</coordinates></LinearRing></outerBoundaryIs></Polygon>";
return a;
};
MVSdoGeometry.getOGCOrdinateString=function(d){var b=0;
var a="";
for(;
b<d.length;
b+=2){if(b>0){a+=" ";
}a+=d[b+0]+","+d[b+1];
}return a;
};
MVSdoGeometry.getDistance=function(d,l,a,k,o,m,b,n,f){if(!MVUtil.isNumber(d)){MVi18n.reportError("MVSdoGeometry.getDistance","MAPVIEWER-05527","x1");
return null;
}if(!MVUtil.isNumber(l)){MVi18n.reportError("MVSdoGeometry.getDistance","MAPVIEWER-05527","y1");
return null;
}if(!MVUtil.isNumber(a)){MVi18n.reportError("MVSdoGeometry.getDistance","MAPVIEWER-05527","x2");
return null;
}if(!MVUtil.isNumber(k)){MVi18n.reportError("MVSdoGeometry.getDistance","MAPVIEWER-05527","y2");
return null;
}var g=new Array(d,l,a,k);
var h=MVSdoGeometry.createLineString(g,o);
return h.getLength(m,b,n,f);
};
MVSdoGeometry.calcLength=function(f){var a=0,b=2;
if(f&&f.length>3){for(;
b<f.length;
b+=2){var d=f[b]-f[b-2];
var g=f[b+1]-f[b-1];
a+=Math.sqrt(d*d+g*g);
}return a;
}else{return 0;
}};
MVSdoGeometry.calcPolygonArea=function(b,h){if(b&&b.length>=4){var d=0;
var k=b.length/2;
var g;
for(g=1;
g+1<k;
g++){var f=b[g*2]-b[0];
var n=b[g*2+1]-b[1];
var a=b[g*2+2]-b[0];
var l=b[g*2+3]-b[1];
var m=f*l-a*n;
d+=m;
}return Math.abs(m/2);
}else{return 0;
}};
function MVSdoPointType(a,d,b){if(!MVUtil.isNumber(a)){MVi18n.reportError("MVSdoPointType.constructor","MAPVIEWER-05527","x");
}if(!MVUtil.isNumber(d)){MVi18n.reportError("MVSdoPointType.constructor","MAPVIEWER-05527","y");
}this.x=a;
this.y=d;
this.z=b;
}MVSdoPointType.prototype.toString=function(){var a="SdoPointType( ";
a+=this.x+", ";
a+=this.y+", ";
a+=this.z+" )";
return a;
};
MVSdoPointType.prototype.clone=function(){var a=new MVSdoPointType(this.x,this.y,this.z);
};
function MVOverviewMap(a,d,b){if(a&&!a.style){if(d){b=d;
}d=a;
}this.type="MVOverviewMap";
this.isMapControl=true;
this.overviewMapDIV=a?a:null;
this.mainmap=null;
this.diff=d?d:4;
this.submap=null;
this.overviewMapTileLayer=b;
this.moveflag=false;
this.moveX=0;
this.moveY=0;
this.coords=null;
this.moveOnSubMap=false;
this.moveOnMainMap=false;
this.borderStyle="2px solid red";
this.backgroundColor="red";
this.cursorStyleDragging=null;
this.cursorStyleDefault=null;
this.origDocumentMouseUpListener=null;
this.rectangle=null;
}MVOverviewMap.prototype.init=function(m,g){g.overviewmap=this;
if(m){this.overviewMapDIV=m;
}this.overviewMapDIV.overview=true;
this.mainmap=g;
var f=this.mainmap.getZoomLevel()-this.diff;
if(f<0){f=0;
}this.submap=new MVMapView(this.overviewMapDIV,this.mainmap.baseURL);
this.submap.isSubmap=true;
if(g.wraparound){this.submap.wraparound=true;
}this.submap.enableLoadingIcon(false);
if(this.cursorStyleDefault){this.submap.setMouseCursorStyle(this.cursorStyleDefault,"default");
}if(this.cursorStyleDragging){this.submap.setMouseCursorStyle(this.cursorStyleDragging,"dragging");
}if(this.overviewMapTileLayer==null){var k=this.mainmap.get1stMapTileLayer();
if(k){this.overviewMapTileLayer=k.clone();
}}this.rectangle=document.createElement("div");
this.submap.base_div.appendChild(this.rectangle);
this.rectangle.style.zIndex=10000;
var h=this;
var b=function(r,s){if(!h.moveOnMainMap){h.rectangle.style.left=(parseInt(h.rectangle.style.left)-r)+"px";
h.rectangle.style.top=(parseInt(h.rectangle.style.top)-s)+"px";
}};
var d=function(r,s){var t=r-s;
if(s>r&&h.mainmap.zoomflag){h.submap.zoomflag=false;
h.mainmap.setZoomLevel(MVOverviewMap.validateZoomLevel(h.mainmap.getZoomLevel()-t));
h.resetRectangle();
}else{if(s<r&&h.mainmap.zoomflag){h.submap.zoomflag=false;
if(h.mainmap.getZoomLevel()-r==h.diff){h.mainmap.setZoomLevel(MVOverviewMap.validateZoomLevel(h.mainmap.getZoomLevel()-t));
}else{h.mainmap.setZoomLevel(MVOverviewMap.validateZoomLevel(r-t+h.diff));
}h.resetRectangle();
}}h.mainmap.zoomflag=true;
h.resetRectangle();
};
var l=function(){if(!h.moveOnMainMap){h.moveOnSubMap=true;
h.mainmap.setCenter(h.submap.getCenter());
h.resetRectangle();
}h.moveOnMainMap=false;
};
this.submap.setEventListener(MVEvent.RECENTER,l);
this.submap.addEventListener(MVEvent.ZOOM_LEVEL_CHANGE,d);
var n=function(){var r=h.mainmap.getCenter();
h.submap.setCenter(r);
h.submap.setZoomLevel(MVOverviewMap.validateZoomLevel(f));
h.submap.overview=true;
function s(){h.resetRectangle();
}h.submap.setEventListener(MVEvent.INITIALIZE,s);
h.submap.display();
};
var o=this.overviewMapTileLayer;
if(!o){var a=h.mainmap.getCenter();
h.submap.setCenter(a);
h.submap.setZoomLevel(MVOverviewMap.validateZoomLevel(f));
return;
}if(o.getType&&o.getType()=="MVExternalAPIMapTileLayer"){if(o.hideCopyRights){o.initializeListener=function(){o.hideCopyRights();
};
}}this.submap.addMapTileLayer(this.overviewMapTileLayer,n);
};
MVOverviewMap.prototype.addOverviewMapTileLayer=function(){this.overviewMapTileLayer=this.mainmap.get1stMapTileLayer().clone();
this.submap.addMapTileLayer(this.overviewMapTileLayer);
};
MVOverviewMap.prototype.cleanUp=function(){this.destroy();
};
MVOverviewMap.prototype.destroy=function(){if(this.mainmap){this.mainmap.overviewmap=null;
}if(this.origDocumentMouseUpListener){MVUtil.detachEvent(window.document,"mouseup",this.origDocumentMouseUpListener);
}if(this.rectangle){if(this.mouseDownFun){MVUtil.detachEvent(this.rectangle,"mousedown",this.mouseDownFun,true);
}if(this.mouseUpFun){MVUtil.detachEvent(this.rectangle,"mouseup",this.mouseUpFun,true);
}if(this.mouseMoveFun){MVUtil.detachEvent(this.rectangle,"mousemove",this.mouseMoveFun,true);
}MVUtil.destroyNode(this.rectangle);
}this.endmove=null;
this.origDocumentMouseUpListener=null;
this.mouseDownFun=null;
this.mouseUpFun=null;
this.mouseMoveFun=null;
if(this.submap){this.submap.destroy();
}MVUtil.clearNode(this.overviewMapDIV,this.mainmap?this.mainmap.errorHandler:null);
if(this.overviewMapDIV&&this.overviewMapDIV.parentNode){MVUtil.clearNode(this.overviewMapDIV);
}this.overviewMapDIV=null;
this.overviewMapTileLayer=null;
this.mainmap=null;
if(this.mapDec){this.mapDec=null;
}this.rectangle=null;
this.submap=null;
};
MVOverviewMap.prototype.resetRectangle=function(){var f=this.mainmap.getMapWindowBBox();
var d=this.submap.getMapWindowBBox();
var a=this;
var b=function(m){var h=m.getMBR();
var k=d.getMBR();
a.xRatio=(h[2]-h[0])/(k[2]-k[0]);
a.yRatio=(h[3]-h[1])/(k[3]-k[1]);
var l=a.xRatio*a.submap.getPaneWidth();
var g=a.yRatio*a.submap.getPaneHeight();
a.rectangle.style.position="absolute";
a.rectangle.style.overflow="hidden";
a.rectangle.style.zIndex=10000;
a.rectangle.style.left=((a.submap.getPaneWidth()-l)/2)+"px";
a.rectangle.style.top=((a.submap.getPaneHeight()-g)/2)+"px";
a.rectangle.style.width=l+"px";
a.rectangle.style.height=g+"px";
a.rectangle.style.border=a.borderStyle;
if(MVGlobalVariables.browser=="NS"){a.rectangle.innerHTML="<div  style='width: "+l+"px; height: "+g+"px;opacity: 0.3;background-color:"+a.backgroundColor+";'></div>";
}else{if(MVGlobalVariables.browser=="SF"){a.rectangle.innerHTML="<div  style='width: "+l+"px; height: "+g+"px;opacity: 0.3;background-color:"+a.backgroundColor+";'></div>";
}else{if(MVGlobalVariables.browser=="IF"){a.rectangle.innerHTML="<div  style='width: "+l+"px; height: "+g+"px;opacity: 0.3; filter: alpha(opacity=30);background-color:"+a.backgroundColor+";'></div>";
}}}if(l>a.submap.getPaneWidth()||g>a.submap.getPaneHeight()){a.rectangle.style.visibility="hidden";
}else{a.rectangle.style.visibility=a.submap.base_div.style.visibility;
}if(a.mouseDownFun){MVUtil.detachEvent(a.rectangle,"mousedown",a.mouseDownFun,true);
}a.mouseDownFun=function(o){var n=a.mainmap.getCenter();
o=(o)?o:((window.event)?event:null);
if(o.button==2){return;
}a.coords=a.submap.getEventCoords(o);
a.moveflag=true;
MVUtil.stopEvent(o);
a.moveX=0;
a.moveY=0;
};
MVUtil.attachEvent(a.rectangle,"mousedown",a.mouseDownFun,true);
if(a.mouseUpFun){MVUtil.detachEvent(a.rectangle,"mouseup",a.mouseUpFun,true);
}a.mouseUpFun=function(n){if(a.moveflag){n=(n)?n:((window.event)?event:null);
a.moveflag=false;
n.cancelBubble=true;
a.endmove();
}};
MVUtil.attachEvent(a.rectangle,"mouseup",a.mouseUpFun,true);
a.endmove=function(){a.moveflag=false;
var u=parseInt(this.rectangle.style.left)+parseInt(this.rectangle.style.width)/2;
var w=parseInt(this.rectangle.style.top)+parseInt(this.rectangle.style.height)/2;
var v=a.submap;
var r=u-v.getPaneWidth()/2;
r=r/v.pixPerX;
var o=w-v.getPaneHeight()/2;
o=o/v.pixPerY;
var t=a.submap.getCenterLon()+r;
var s=a.submap.getCenterLat()-o;
var n=MVSdoGeometry.createPoint(t,s,a.submap.srid);
a.submap.setCenter(n);
};
if(a.origDocumentMouseUpListener){MVUtil.detachEvent(window.document,"mouseup",a.origDocumentMouseUpListener);
}a.origDocumentMouseUpListener=function(n){if(a.moveflag){a.moveflag=false;
a.endmove();
}};
MVUtil.attachEvent(window.document,"mouseup",a.origDocumentMouseUpListener);
if(a.mouseMoveFun){MVUtil.attachEvent(a.rectangle,"mousemove",a.mouseMoveFun);
}a.mouseMoveFun=function(n){n=(n)?n:((window.event)?event:null);
if(a.moveflag){var o=a.submap.getEventCoords(n);
x=o.left-a.coords.left;
y=o.top-a.coords.top;
a.coords=o;
a.rectangle.style.left=(parseInt(a.rectangle.style.left)+x)+"px";
a.rectangle.style.top=(parseInt(a.rectangle.style.top)+y)+"px";
n.cancelBubble=true;
}};
MVUtil.attachEvent(a.rectangle,"mousemove",a.mouseMoveFun,true);
};
if(f.srid!=d.srid){this.mainmap.transformGeom(f,d.srid,null,b);
}else{b(f);
}};
MVOverviewMap.prototype.moveRectanglefromMainMap=function(a,f){if(this.xRatio==undefined){return;
}var d=Math.floor(this.xRatio*a*(this.submap.getPaneWidth()/this.mainmap.getPaneWidth()));
var b=Math.floor(this.yRatio*f*(this.submap.getPaneHeight()/this.mainmap.getPaneHeight()));
if(d>=0){d=Math.floor(d);
}else{d=Math.ceil(d);
}if(b>=0){b=Math.floor(b);
}else{b=Math.ceil(b);
}if(!this.moveOnSubMap){this.moveOnMainMap=true;
this.rectangle.style.left=(parseInt(this.rectangle.style.left)+d)+"px";
this.rectangle.style.top=(parseInt(this.rectangle.style.top)+b)+"px";
}};
MVOverviewMap.prototype.refreshSubMap=function(){if(!this.moveOnSubMap){this.moveOnMainMap=true;
this.submap.setCenter(this.mainmap.getCenter());
this.resetRectangle();
}this.moveOnSubMap=false;
};
MVOverviewMap.prototype.zoomMainMap=function(b,d,a){var f=b-d;
if(d>=b&&this.submap.zoomflag){this.mainmap.zoomflag=false;
if(b-this.submap.getZoomLevel()==this.diff){if(a){this.submap.setCenterAndZoomLevel(a,MVOverviewMap.validateZoomLevel(this.submap.getZoomLevel()-f));
}else{this.submap.setZoomLevel(MVOverviewMap.validateZoomLevel(this.submap.getZoomLevel()-f));
}}else{if(a){this.submap.setCenterAndZoomLevel(a,MVOverviewMap.validateZoomLevel(b-f-this.diff));
}else{this.submap.setZoomLevel(MVOverviewMap.validateZoomLevel(b-f-this.diff));
}}}else{if(d<b&&this.submap.zoomflag){this.mainmap.zoomflag=false;
if(a){this.submap.setCenterAndZoomLevel(a,MVOverviewMap.validateZoomLevel(this.submap.getZoomLevel()-f));
}else{this.submap.setZoomLevel(MVOverviewMap.validateZoomLevel(this.submap.getZoomLevel()-f));
}}}this.submap.zoomflag=true;
};
MVOverviewMap.prototype.setRectangleStyle=function(a,b){this.borderStyle=a;
this.backgroundColor=b;
};
MVOverviewMap.prototype.setMouseCursorStyle=function(a,b){if(b=="dragging"){this.cursorStyleDragging=a;
}else{if(b=="default"){this.cursorStyleDefault=a;
MVUtil.setCursor(this.base_div,a);
}}};
MVOverviewMap.validateZoomLevel=function(a){if(!a||a<0){return 0;
}else{return a;
}};
MVOverviewMap.prototype.getMapConfig=function(){if(!this.overviewMapTileLayer.config){MVi18n.reportError("MVOverviewMap.getMapConfig","MAPVIEWER-05526");
}else{return this.overviewMapTileLayer.config;
}};
MVOverviewMap.prototype.getZoomLevel=function(){return this.submap.getZoomLevel();
};
function MVInfoWindowStyle1(){}MVInfoWindowStyle1.defaultStyleParameters=null;
MVInfoWindowStyle1.closeButtonImgURL=null;
MVInfoWindowStyle1.setStyleParameters=function(a){if(a&&a.hideCloseButton){this.hideCloseButton=true;
}else{this.hideCloseButton=false;
}if(a&&a.closeButtonImageURL){if(!this.style_closeButtonImageURL||this.style_closeButtonImageURL!=a.closeButtonImageURL){this.closeButtonWidth=null;
this.closeButtonHeight=null;
}this.style_closeButtonImageURL=a.closeButtonImageURL;
if(a.closeButtonWidth){this.closeButtonWidth=a.closeButtonWidth;
}if(a.closeButtonHeight){this.closeButtonHeight=a.closeButtonHeight;
}}else{if(!this.style_closeButtonImageURL||this.style_closeButtonImageURL!=MVInfoWindowStyle1.closeButtonImgURL){this.closeButtonWidth=null;
this.closeButtonHeight=null;
}this.style_closeButtonImageURL=MVInfoWindowStyle1.closeButtonImgURL;
this.closeButtonWidth=MVGlobalVariables.toolButtonW-2;
this.closeButtonHeight=MVGlobalVariables.toolButtonW-2;
}if(a&&a.bodyStyle){this.style_bodyStyle=a.bodyStyle;
}else{this.style_bodyStyle="border:1px;border-color:#8794A3;background-color:#FFFFFF";
}if(a&&a.titleBarStyle){this.style_titleBarStyle=a.titleBarStyle;
}else{this.style_titleBarStyle="background-color:#CFDCEB;font-weight:bold";
}if(a&&a.coneStyle){this.style_coneStyle=a.coneStyle;
var b=a.coneStyle.split(/;|:/);
if(b){for(i=0;
i<b.length;
i++){if(b[i].indexOf("opacity")>=0&&i<b.length){this.style_coneOpacity=parseInt(b[i+1]);
break;
}}}}else{this.style_coneStyle="background-color:#99CC33;opacity:30";
this.style_coneOpacity=30;
}if(a&&a.offset){MVInfoWindowStyle1.windowOffset=a.offset;
}else{MVInfoWindowStyle1.windowOffset=20;
}if(a&&a.activeTab){this.style_activeTab=a.activeTab;
}else{this.style_activeTab="background-color:#FFFFFF;font-weight:bold";
}if(a&&a.inactiveTab){this.style_inactiveTab=a.inactiveTab;
}else{this.style_inactiveTab="background-color:#CFDCEB;font-weight:bold";
}if(a&&a.tabBorder){this.style_tabBorder=a.tabBorder;
}else{this.style_tabBorder="1px solid #8794A3";
}if(a&&a.contentStyle){this.style_contentStyle=a.contentStyle;
}else{this.style_contentStyle="padding:5px";
}if(a&&a.attrTableStyle){this.attrTableStyle=a.attrTableStyle;
}else{this.attrTableStyle="";
}};
MVInfoWindowStyle1.init=function(a){if(!MVInfoWindowStyle1.closeButtonImgURL){MVInfoWindowStyle1.closeButtonImgURL=MVGlobalVariables.imgFilePath+"infoicons/closeDialog_n.png";
}if(a){MVInfoWindowStyle1.setStyleParameters(a);
}else{MVInfoWindowStyle1.setStyleParameters(MVInfoWindowStyle1.defaultStyleParameters);
}MVInfoWindowStyle1.infoWindowWidth=null;
MVInfoWindowStyle1.infoWindowHeight=null;
MVInfoWindowStyle1.redrawHandle=null;
this.coneDiv=null;
this.contentBar=null;
this.x=null;
this.y=null;
this.coneopp="";
this.closeButtonTD=null;
this.titleBar=null;
};
MVInfoWindowStyle1.createWindow=function(u,t,d,v,b,s){this.x=u;
this.y=t;
var g=document.createElement("div");
var w=document.createElement("table");
w.id="infowindow3table_"+s;
w.style.cssText=this.style_bodyStyle;
w.style.borderStyle="solid";
w.style.cellSpacing="0px";
w.style.borderSpacing="0px";
if(MVGlobalVariables.browser=="IF"){w.style.borderCollapse="collapse";
}w.style.padding="0px";
if(!w.style.width||w.style.width==""||w.style.width=="0"||w.style.width=="0px"){if(d){w.style.width=MVUtil.pixel(d);
}else{w.style.width=MVUtil.pixel(MVGlobalVariables.infoWindowWidth);
}}if(!w.style.height||w.style.height==""||w.style.height=="0"||w.style.height=="0px"){if(v){w.style.height=MVUtil.pixel(v);
}else{w.style.height=MVUtil.pixel(MVGlobalVariables.infoWindowHeight);
}}var r=document.createElement("tbody");
w.appendChild(r);
var a=document.createElement("tr");
this.titleRow=a;
a.style.border="0px";
a.style.padding="0px";
a.style.height=MVUtil.pixel(10);
r.appendChild(a);
this.titleBar=new Array();
var o=this;
var n=function(){MVInfoWindowStyle1.pauseRedraw=true;
var B=this.number;
var z=o.titleBar.length;
if(B==o.active){MVInfoWindowStyle1.pauseRedraw=false;
return;
}var A=document.getElementById("infowindow3table_"+s);
var C=A.childNodes[0];
if(C.childNodes.length>1){C.removeChild(C.childNodes[1]);
}C.appendChild(o.contentBar[B]);
o.titleBar[o.active].style.cssText=o.style_inactiveTab;
o.titleBar[o.active].style.height=MVUtil.pixel(10);
o.titleBar[o.active].style.width=((100-10)/z)+"%";
o.titleBar[o.active].style.borderBottom=o.style_tabBorder;
o.titleBar[o.active].style.cursor="pointer";
if(o.active+1==o.titleBar.length){o.titleBar[o.active].style.borderRight="none";
}else{o.titleBar[o.active].style.borderRight=o.style_tabBorder;
}o.titleBar[B].style.cssText=o.style_activeTab;
o.titleBar[B].style.height=MVUtil.pixel(10);
o.titleBar[B].style.width=((100-10)/z)+"%";
o.titleBar[B].style.borderBottom="none";
o.titleBar[B].style.borderRight=o.style_tabBorder;
o.titleBar[B].style.cursor="default";
if(B+1==o.titleBar.length){o.titleBar[B].style.borderRight=o.style_tabBorder;
}o.active=B;
MVInfoWindowStyle1.pauseRedraw=false;
MVInfoWindowStyle1.infoWindowWidth=A.offsetWidth;
MVInfoWindowStyle1.infoWindowHeight=A.offsetHeight;
A.style.height=A.offsetHeight;
};
for(var m=0;
m<b;
m++){var k=document.createElement("TD");
k.align="center";
k.number=m;
this.titleBar.push(k);
a.appendChild(k);
k.onclick=MVUtil.closureWrapper(k,n);
}var h=document.createElement("TD");
h.style.width="10%";
h.align="right";
h.vAlign="top";
h.style.padding="2px";
a.appendChild(h);
this.closeButtonTD=h;
this.contentBar=new Array();
for(var m=0;
m<b;
m++){var f=document.createElement("tr");
a.style.border="0px";
a.style.padding="0px";
r.appendChild(f);
var l=document.createElement("td");
l.colSpan=b+1;
l.style.cssText=this.style_contentStyle;
f.appendChild(l);
this.contentBar.push(f);
}w.style.left=MVUtil.pixel(u-MVInfoWindowStyle1.windowOffset);
w.style.top=MVUtil.pixel(t+MVInfoWindowStyle1.windowOffset);
w.style.position="absolute";
w.style.zIndex=200;
return w;
};
MVInfoWindowStyle1.addCloseButton=function(b){if(this.hideCloseButton){return;
}var a=document.createElement("img");
a.src=this.style_closeButtonImageURL;
a.style.cursor="pointer";
if(this.closeButtonWidth){a.width=this.closeButtonWidth;
a.style.width=this.closeButtonWidth;
}if(this.closeButtonHeight){a.height=this.closeButtonHeight;
a.style.height=this.closeButtonHeight;
}if(!this.closeButtonWidth&&!this.closeButtonHeight){a.onload=MVInfoWindowStyle1.setCloseButtonSize;
}if(MVGlobalVariables.touchSupported){a.ontouchend=b;
}else{a.onclick=b;
}this.closeButtonTD.appendChild(a);
};
MVInfoWindowStyle1.addContent=function(g,f){var d=true;
for(var b=0;
b<f.length;
b++){var a=this.contentBar[b].childNodes[0];
var g=this.contentBar[b];
g.removeChild(a);
a.innerHTML=f[b].getContent();
if(g.childNodes.length>0){g.insertBefore(a,g.childNodes[0]);
}else{g.appendChild(a);
}var h=f[b].getTitle();
if(!h){h="&nbsp;";
}else{d=false;
}g=this.titleBar[b].parentNode;
g.removeChild(this.titleBar[b]);
this.titleBar[b].innerHTML=h;
if(g.childNodes.length>0){g.insertBefore(this.titleBar[b],g.childNodes[0]);
}else{g.appendChild(this.titleBar[b]);
}}if(d&&this.hideCloseButton){this.titleRow.parentNode.removeChild(this.titleRow);
MVUtil.clearNode(this.titleRow);
this.titleRow=null;
}};
MVInfoWindowStyle1.setTitleStyle=function(f,b){var g=this.titleBar[0].parentNode;
var a=this.titleBar.length;
if(a>1){g.style.cssText=this.style_titleBarStyle;
g.style.border="0px none";
g.style.padding="0px";
g.style.height=MVUtil.pixel(10);
for(var d=0;
d<a;
d++){if(d==b){this.titleBar[d].style.cssText=this.style_activeTab;
}else{this.titleBar[d].style.cssText=this.style_inactiveTab;
this.titleBar[d].style.borderBottom=this.style_tabBorder;
this.titleBar[d].style.cursor="pointer";
}this.titleBar[d].style.height=MVUtil.pixel(10);
this.titleBar[d].style.width=((100-10)/a)+"%";
if(d+1!=a||d==b){this.titleBar[d].style.borderRight=this.style_tabBorder;
}}this.closeButtonTD.style.borderBottom=this.style_tabBorder;
this.closeButtonTD.style.borderTop="none";
}else{if(f[0].getTitle()){g.style.cssText=this.style_titleBarStyle;
g.style.border="0px none";
g.style.padding="0px";
g.style.height=MVUtil.pixel(10);
}}};
MVInfoWindowStyle1.renderCone=function(b,a){MVInfoWindowStyle1.renderTrail(b,this.x,this.y,a);
};
MVInfoWindowStyle1.renderTrail=function(l,s,r,o){if(this.style_coneOpacity==0){return;
}var C=document.getElementById("infowindow3table_"+o);
var J=C.style.zIndex-1;
var f=C.offsetLeft;
var d=C.offsetTop;
f-=s;
d-=r;
var G=1;
var k=1;
var g=C.offsetWidth;
var u=C.offsetHeight;
MVInfoWindowStyle1.infoWindowWidth=g;
MVInfoWindowStyle1.infoWindowHeight=u;
var z=0;
var b=50;
var K=260;
var m=340;
var n=50;
if(this.coneDiv){MVUtil.clearNode(this.coneDiv);
this.coneDiv.parentNode.removeChild(this.coneDiv);
}var w=document.createElement("DIV");
w.id=C.id+"cones";
w.style.position="absolute";
w.style.left=s+"px";
w.style.top=r+"px";
w.style.border="0px solid #000000";
w.style.zIndex=J;
this.coneDiv=w;
l.appendChild(w);
zcounter=0;
var A=n;
this.coneopp=Math.round((this.style_coneOpacity/n)*7);
var F=Math.abs(f/n);
var E=Math.abs(d/n);
var D=Math.abs(F/E);
var I=0;
for(var B=0;
B<n;
B++){var H=((f*1/n)*B);
var h=((d*1/n)*B);
K=G+Math.abs(((g-G)/n*B));
m=k+Math.abs(((u-k)/n*B));
var t=document.createElement("DIV");
t.id=C.id+"D"+B;
t.style.cssText=this.style_coneStyle;
t.style.position="absolute";
MVUtil.setDIVStyle(t,H,h,K,m);
t.style.border="0px solid black";
t.style.fontSize="1px";
t.style.lineHeight=0;
w.appendChild(t);
MVInfoWindowStyle1.opaque(t);
t.style.zIndex=zcounter;
zcounter++;
I++;
A-=B;
}coneDone=true;
};
MVInfoWindowStyle1.opaque=function(a){if(MVGlobalVariables.browser=="IF"){a.style.opacity=0.05;
a.style.filter="alpha(opacity = "+this.coneopp+")";
}else{if(MVGlobalVariables.browser=="SF"){var b=this.coneopp/100;
a.style.opacity=b;
}else{var b=this.coneopp/100;
a.style.MozOpacity=b;
a.style.opacity=b;
}}};
MVInfoWindowStyle1.sizeChanged=function(b){var a=document.getElementById("infowindow3table_"+b);
if(MVInfoWindowStyle1.pauseRedraw||(a&&MVInfoWindowStyle1.infoWindowWidth&&Math.abs(MVInfoWindowStyle1.infoWindowWidth-a.offsetWidth)<5&&MVInfoWindowStyle1.infoWindowHeight&&Math.abs(MVInfoWindowStyle1.infoWindowHeight-a.offsetHeight)<5)){return false;
}else{return true;
}};
MVInfoWindowStyle1.getWindowSize=function(b,d,g){var l=document.getElementById("infowindow3table_"+g);
if(l){var a=l.offsetWidth;
if(a>(b?b:MVGlobalVariables.infoWindowWidth)){l.style.width=MVUtil.pixel(a);
}var k=0;
var h=this.contentBar[0].offsetHeight;
for(var f=1;
f<this.contentBar.length;
f++){if(this.contentBar[k].offsetHeight<this.contentBar[f].offsetHeight){k=f;
}h+=this.contentBar[f].offsetHeight;
}var m=l.offsetHeight-h+this.contentBar[k].offsetHeight;
if(m>(d?d:MVGlobalVariables.infoWindowHeight)){l.style.height=MVUtil.pixel(m);
}}};
MVInfoWindowStyle1.setCloseButtonSize=function(){if(this.closeButtonWidth||!this.closeButtonTD||!this.closeButtonTD.firstChild){return;
}this.closeButtonWidth=this.closeButtonTD.firstChild.offsetWidth;
this.closeButtonHeight=this.closeButtonTD.firstChild.offsetHeight;
};
MVInfoWindowStyle1.clear=function(){if(this.coneDiv){MVUtil.clearNode(this.coneDiv);
}this.coneDiv=null;
if(this.contentBar&&this.contentBar.length>0){while(this.contentBar.length){var b=this.contentBar.pop();
MVUtil.clearNode(b);
}}this.contentBar=null;
if(this.closeButtonTD){MVUtil.clearNode(this.closeButtonTD);
}this.closeButtonTD=null;
if(this.titleRow){MVUtil.clearNode(this.titleRow);
}this.titleRow=null;
if(this.titleBar){for(var a=0;
a<this.titleBar.length;
a++){this.titleBar[a]=null;
}}this.titleBar=null;
};
MVInfoWindowStyle1.removeInActiveTabs=function(d,g){var b=document.getElementById("infowindow3table_"+g);
var a=this.contentBar.length;
if(a>1){for(var f=0;
f<a;
f++){if(f!=d){this.contentBar[f].parentNode.removeChild(this.contentBar[f]);
}}}this.active=d;
};
function MVInfoWindowStyle2(){}MVInfoWindowStyle2.init=function(){this.window=null;
this.windowDiv=null;
this.iw=MVGlobalVariables.imgFilePath+"/infoicons/";
this.iw_arrow=this.iw+"arrow_circle.gif";
this.iw_h=this.iw+"h.gif";
this.iw_v=this.iw+"v.gif";
this.iw_c=this.iw+"iw_c.gif";
this.iw_c1=this.iw+"iw_n.gif";
this.iw_c2=this.iw+"iw_s.gif";
this.iw_nw=this.iw+"tl.gif";
this.iw_sw=this.iw+"bl.gif";
this.iw_ne=this.iw+"tr.gif";
this.iw_se=this.iw+"br.gif";
this.closeImg=this.iw+"close_circle.gif";
this.cornerwidth=25;
this.cornerheight=25;
this.arrowwidth=41;
this.arrowheight=40;
this.arrowendheight=20;
};
MVInfoWindowStyle2.createWindow=function(b,f,d,a){this.window=new Object();
this.window.arrow=FigLayer(this.iw_arrow,this.arrowwidth+2,this.arrowheight,1,7,0);
this.window.e=FigLayer(this.iw_v,1,a+1-this.cornerheight*2,d+this.arrowwidth,this.cornerheight,0);
this.window.w=FigLayer(this.iw_v,1,a-this.cornerheight*2-20,this.arrowwidth,this.arrowendheight+this.cornerheight,0);
this.window.wu=FigLayer(this.iw_nw,this.cornerwidth,this.cornerheight,this.arrowwidth,0,0);
this.window.wd=FigLayer(this.iw_sw,this.cornerwidth,25,this.arrowwidth,a+1-this.cornerheight,0);
this.window.eu=FigLayer(this.iw_ne,this.cornerwidth,this.cornerheight,d+this.arrowwidth+1-this.cornerwidth,0,0);
this.window.ed=FigLayer(this.iw_se,this.cornerwidth,25,d+this.arrowwidth+1-this.cornerwidth,a+1-this.cornerheight,0);
this.window.c=FigLayer(this.iw_c,d-1,a+1-this.cornerheight*2,this.arrowwidth+1,this.cornerheight,0);
this.window.cu=FigLayer(this.iw_c1,d+1-this.cornerwidth*2,this.cornerheight,this.arrowwidth+this.cornerwidth,0,0);
this.window.cd=FigLayer(this.iw_c2,d+1-this.cornerwidth*2,25,this.arrowwidth+this.cornerwidth,a-this.cornerheight+1,0);
this.windowDiv=window.document.createElement("div");
this.windowDiv.style.position="relative";
this.windowDiv.style.left=MVUtil.pixel(b-1);
this.windowDiv.style.top=MVUtil.pixel(f+2);
this.windowDiv.appendChild(this.window.e);
this.windowDiv.appendChild(this.window.wu);
this.windowDiv.appendChild(this.window.w);
this.windowDiv.appendChild(this.window.cu);
this.windowDiv.appendChild(this.window.c);
this.windowDiv.appendChild(this.window.cd);
this.windowDiv.appendChild(this.window.wd);
this.windowDiv.appendChild(this.window.ed);
this.windowDiv.appendChild(this.window.eu);
this.windowDiv.appendChild(this.window.arrow);
this.width=d;
return this.windowDiv;
};
MVInfoWindowStyle2.addCloseButton=function(a){this.closeButton=FigLayer(this.closeImg,16,16,this.width+10,10,4);
this.closeButton.style.position="absolute";
this.closeButton.onclick=MVUtil.closureWrapper(this.closeButton,function(){a();
});
MVUtil.setCursor(this.closeButton,"pointer");
this.windowDiv.appendChild(this.closeButton);
};
MVInfoWindowStyle2.addContent=function(a){a.style.left=MVUtil.pixel(55);
a.style.top=MVUtil.pixel(17);
this.windowDiv.appendChild(a);
};
MVInfoWindowStyle2.getWindow=function(){return this.windowDiv;
};
function MVInfoWindowStyle3(){}MVInfoWindowStyle3.init=function(){this.window=null;
this.windowDiv=null;
this.iw=MVGlobalVariables.imgFilePath+"/infoicons/";
this.iw_arrow=this.iw+"arrow.gif";
this.iw_h=this.iw+"hline.gif";
this.iw_v=this.iw+"vline.gif";
this.iw_c=this.iw+"iw_c.gif";
this.closeImg=this.iw+"close.gif";
this.iwcWidth=600;
this.iwcHeight=600;
this.iwarrowWidth=30;
this.iwarrowHeight=16;
this.iwhlWidth=600;
this.iwhlHeight=1;
this.iwvlWidth=1;
this.iwvlHeight=600;
this.iwwuWidth=1;
this.iwwuHeight=10;
};
MVInfoWindowStyle3.createWindow=function(b,f,d,a){this.window=new Object();
this.window.arrow=FigLayer(this.iw_arrow,this.iwarrowWidth,this.iwarrowHeight,1,this.iwwuHeight,0);
this.window.n=FigLayer(this.iw_h,d+1,1,this.iwarrowWidth+1,0,0);
this.window.s=FigLayer(this.iw_h,d+1,1,this.iwarrowWidth+1,a+1,0);
this.window.e=FigLayer(this.iw_v,1,a+1,d+this.iwarrowWidth+1,1,0);
this.window.wu=FigLayer(this.iw_v,1,this.iwwuHeight,this.iwarrowWidth,0,0);
this.window.wd=FigLayer(this.iw_v,1,a-this.iwarrowHeight-this.iwwuHeight+2,this.iwarrowWidth+1,this.iwarrowHeight+this.iwwuHeight,0);
this.window.c=FigLayer(this.iw_c,d,a,this.iwarrowWidth+1,1,0);
this.windowDiv=window.document.createElement("div");
this.windowDiv=window.document.createElement("div");
this.windowDiv.style.position="relative";
this.windowDiv.style.left=MVUtil.pixel(b);
this.windowDiv.style.top=MVUtil.pixel(f);
this.windowDiv.appendChild(this.window.n);
this.windowDiv.appendChild(this.window.s);
this.windowDiv.appendChild(this.window.e);
this.windowDiv.appendChild(this.window.wu);
this.windowDiv.appendChild(this.window.c);
this.windowDiv.appendChild(this.window.wd);
this.windowDiv.appendChild(this.window.arrow);
this.width=d;
return this.windowDiv;
};
MVInfoWindowStyle3.addCloseButton=function(a){this.closeButton=FigLayer(this.closeImg,15,15,this.width-1,10,4);
this.closeButton.style.position="absolute";
MVUtil.setCursor(this.closeButton,"pointer");
this.windowDiv.appendChild(this.closeButton);
this.closeButton.onclick=MVUtil.closureWrapper(this.closeButton,function(){a();
});
};
MVInfoWindowStyle3.addContent=function(a){a.style.left=MVUtil.pixel(50);
a.style.top=MVUtil.pixel(25);
this.windowDiv.appendChild(a);
};
function MVInfoWindowStyle4(){}MVInfoWindowStyle4.defaultStyleParameters=null;
MVInfoWindowStyle4.closeButtonImgURL=null;
MVInfoWindowStyle4.infoWindowWidth=new Object();
MVInfoWindowStyle4.infoWindowHeight=new Object();
MVInfoWindowStyle4.redrawHandle=new Object();
MVInfoWindowStyle4.pageDirection=null;
MVInfoWindowStyle4.TotalMarginHeight=20;
MVInfoWindowStyle4.MultiFeatureListTotalMarginWidth=15;
MVInfoWindowStyle4.setStyleParameters=function(a){if(a&&a.hideCloseButton){this.hideCloseButton=true;
}else{this.hideCloseButton=false;
}if(a&&a.coneStyle){this.style_coneStyle=a.coneStyle;
var b=a.coneStyle.split(/;|:/);
if(b){for(i=0;
i<b.length;
i++){if(b[i].indexOf("opacity")>=0&&i<b.length){this.style_coneOpacity=parseInt(b[i+1]);
break;
}}}}else{this.style_coneStyle="background-color:#a0a0a0;opacity:30";
this.style_coneOpacity=30;
}if(a&&a.offset){MVInfoWindowStyle4.windowOffset=a.offset;
}else{MVInfoWindowStyle4.windowOffset=20;
}if(a&&a.tabStyle!=undefined&&a.tabStyle.toLowerCase()=="f"){this.tabStyle="f";
}else{this.tabStyle="p";
}if(a&&a.attrTableStyle){this.attrTableStyle=a.attrTableStyle;
}else{this.attrTableStyle="";
}};
MVInfoWindowStyle4.init=function(a){MVInfoWindowStyle4.windowHeaderLeft=MVGlobalVariables.imgFilePath+"infoicons/dialog-header-left.png";
MVInfoWindowStyle4.windowHeaderMiddle=MVGlobalVariables.imgFilePath+"infoicons/dialog-header-middle.png";
MVInfoWindowStyle4.windowHeaderRight=MVGlobalVariables.imgFilePath+"infoicons/dialog-header-right.png";
MVInfoWindowStyle4.windowFooterLeft=MVGlobalVariables.imgFilePath+"infoicons/dialog-footer-left.png";
MVInfoWindowStyle4.windowFooterMiddle=MVGlobalVariables.imgFilePath+"infoicons/dialog-footer-middle.png";
MVInfoWindowStyle4.windowFooterRight=MVGlobalVariables.imgFilePath+"infoicons/dialog-footer-right.png";
MVInfoWindowStyle4.windowTabsHeaderLeft=MVGlobalVariables.imgFilePath+"infoicons/dialog-tabs-header-left.png";
MVInfoWindowStyle4.windowTabsHeaderMiddle=MVGlobalVariables.imgFilePath+"infoicons/dialog-tabs-header-middle.png";
MVInfoWindowStyle4.windowTabsHeaderRight=MVGlobalVariables.imgFilePath+"infoicons/dialog-tabs-header-right.png";
MVInfoWindowStyle4.closeButtonEnableImgURL=MVGlobalVariables.imgFilePath+"infoicons/close_ena.png";
MVInfoWindowStyle4.closeButtonOverImgURL=MVGlobalVariables.imgFilePath+"infoicons/close_ovr.png";
MVInfoWindowStyle4.closeButtonDownImgURL=MVGlobalVariables.imgFilePath+"infoicons/close_dwn.png";
MVInfoWindowStyle4.closeButtonImgURL=MVInfoWindowStyle4.closeButtonEnableImgURL;
MVInfoWindowStyle4.tabEnableStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_start_n.png";
MVInfoWindowStyle4.tabEnableMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_mid_n.png";
MVInfoWindowStyle4.tabEnableEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_end_n.png";
MVInfoWindowStyle4.tabDisableStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_start_d.png";
MVInfoWindowStyle4.tabDisableMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_mid_d.png";
MVInfoWindowStyle4.tabDisableEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_end_d.png";
MVInfoWindowStyle4.tabSelectedStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_start_a.png";
MVInfoWindowStyle4.tabSelectedMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_mid_a.png";
MVInfoWindowStyle4.tabSelectedEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_end_a.png";
MVInfoWindowStyle4.tabContentHeadStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptts.png";
MVInfoWindowStyle4.tabContentHeadMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptt.png";
MVInfoWindowStyle4.tabContentHeadEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptte.png";
MVInfoWindowStyle4.tabContentMidStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/pts.png";
MVInfoWindowStyle4.tabContentMidMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptc.png";
MVInfoWindowStyle4.tabContentMidEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/pte.png";
MVInfoWindowStyle4.tabContentFooterStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptbs.png";
MVInfoWindowStyle4.tabContentFooterMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptb.png";
MVInfoWindowStyle4.tabContentFooterEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptbe.png";
MVInfoWindowStyle4.overFlowLeftEnable=MVGlobalVariables.imgFilePath+"infoicons/overflow_left_ena.png";
MVInfoWindowStyle4.overFlowLeftDown=MVGlobalVariables.imgFilePath+"infoicons/overflow_left_dwn.png";
MVInfoWindowStyle4.overFlowLeftOver=MVGlobalVariables.imgFilePath+"infoicons/overflow_left_ovr.png";
MVInfoWindowStyle4.overFlowRightEnable=MVGlobalVariables.imgFilePath+"infoicons/overflow_right_ena.png";
MVInfoWindowStyle4.overFlowRightDown=MVGlobalVariables.imgFilePath+"infoicons/overflow_right_dwn.png";
MVInfoWindowStyle4.overFlowRightOver=MVGlobalVariables.imgFilePath+"infoicons/overflow_right_ovr.png";
if(a){MVInfoWindowStyle4.setStyleParameters(a);
}else{MVInfoWindowStyle4.setStyleParameters(MVInfoWindowStyle4.defaultStyleParameters);
}this.coneDiv=null;
this.x=null;
this.y=null;
};
MVInfoWindowStyle4.createWindow=function(o,n,z,v,G,f,u,g){this.x=o;
this.y=n;
this.windowDiv=document.createElement("div");
this.windowDiv.id="infowindow4_"+f;
var h=document.createElement("table");
h.id="infowindow4table_"+f;
h.dir="ltr";
this.windowDiv.appendChild(h);
h.style.borderSpacing="0px";
h.cellPadding="0";
h.cellSpacing="0";
h.border="0";
h.style.width=MVUtil.pixel(z);
h.style.height=MVUtil.pixel(v);
var d=document.createElement("tbody");
h.appendChild(d);
var F=document.createElement("tr");
d.appendChild(F);
var m=document.createElement("td");
m.style.fontSize="0px";
F.appendChild(m);
var C=null;
if(G&&G.length>1){C=new FigLayer(MVInfoWindowStyle4.windowTabsHeaderLeft,5,31,null,null,null,true);
}else{C=new FigLayer(MVInfoWindowStyle4.windowHeaderLeft,5,31,null,null,null,true);
}C.style.fontSize="0px";
m.appendChild(C);
var l=document.createElement("td");
l.style.paddingTop=MVUtil.pixel(6);
if(G&&G.length>1){l.style.backgroundImage="url("+MVInfoWindowStyle4.windowTabsHeaderMiddle+")";
}else{l.style.backgroundImage="url("+MVInfoWindowStyle4.windowHeaderMiddle+")";
}l.style.backgroundRepeat="repeat-x";
l.style.textAlign="right";
l.style.verticalAlign="top";
l.style.width="100%";
F.appendChild(l);
var k=document.createElement("td");
k.style.fontSize="0px";
F.appendChild(k);
var t=null;
if(G&&G.length>1){t=new FigLayer(MVInfoWindowStyle4.windowTabsHeaderRight,5,31,null,null,null,true);
}else{t=new FigLayer(MVInfoWindowStyle4.windowHeaderRight,5,31,null,null,null,true);
}k.appendChild(t);
var E=document.createElement("tr");
d.appendChild(E);
var B=document.createElement("td");
E.appendChild(B);
B.colSpan="3";
B.style.backgroundColor="#EBEFF5";
B.style.borderLeft="1px solid #C2C7D3";
B.style.borderRight="1px solid #C2C7D3";
var w=document.createElement("div");
w.style.width=MVUtil.pixel(z-2);
w.style.height=MVUtil.pixel(v-62>0?v-62:0);
B.appendChild(w);
var D=document.createElement("tr");
d.appendChild(D);
var b=document.createElement("td");
D.appendChild(b);
var A=new FigLayer(MVInfoWindowStyle4.windowFooterLeft,5,31,null,null,null,true);
b.appendChild(A);
var a=document.createElement("td");
D.appendChild(a);
var r=new FigLayer(MVInfoWindowStyle4.windowFooterMiddle,z-5-5,31,null,null,null,true);
a.appendChild(r);
var I=document.createElement("td");
D.appendChild(I);
var H=new FigLayer(MVInfoWindowStyle4.windowFooterRight,5,31,null,null,null,true);
I.appendChild(H);
if(!h.style.width||h.style.width==""||h.style.width=="0"||h.style.width=="0px"){if(z){h.style.width=MVUtil.pixel(z);
}else{h.style.width=MVUtil.pixel(MVGlobalVariables.infoWindowWidth[f]);
}}if(!h.style.height||h.style.height==""||h.style.height=="0"||h.style.height=="0px"){if(v){h.style.height=MVUtil.pixel(v);
}else{h.style.height=MVUtil.pixel(MVGlobalVariables.infoWindowHeight[f]);
}}var s=MVInfoWindowStyle4.createWindowShadow(z,v);
this.windowDiv.appendChild(s);
this.windowDiv.style.left=MVUtil.pixel(o-MVInfoWindowStyle4.windowOffset);
this.windowDiv.style.top=MVUtil.pixel(n+MVInfoWindowStyle4.windowOffset);
this.windowDiv.style.position="absolute";
this.windowDiv.style.zIndex=200;
return this.windowDiv;
};
MVInfoWindowStyle4.createWindowShadow=function(a,l){var k=0;
var g=0;
var d=[24,16,12,10,8,6,6,4,4,4,4,2,2,2,2,2,2,2];
var m=document.createElement("DIV");
m.style.zIndex="-1";
m.style.position="absolute";
m.style.left=MVUtil.pixel(3);
m.style.top=MVUtil.pixel(3);
for(var f=0;
f<18;
f++){var b=document.createElement("DIV");
b.style.backgroundColor="#000000";
b.style.left=MVUtil.pixel(k);
b.style.top=MVUtil.pixel(g);
b.style.position="absolute";
b.style.width=MVUtil.pixel(a-3);
b.style.height=MVUtil.pixel(l-3);
var h=d[f];
MVInfoWindowStyle4.setOpaque(b,h);
if(f%2==0){k++;
}else{g++;
}m.appendChild(b);
}return m;
};
MVInfoWindowStyle4.createTitleAndContent=function(s,R,u,r,a,f,ag,ad){var al=document.createElement("table");
al.id="infowindow4tablebutton_"+s;
al.style.left="0px";
al.style.top="0px";
al.style.width=MVUtil.pixel(a);
al.style.height=MVUtil.pixel(f);
al.style.position="absolute";
al.style.zIndex="250";
al.cellPadding="0";
al.cellSpacing="0";
var J=document.createElement("tbody");
al.appendChild(J);
var M=document.createElement("tr");
J.appendChild(M);
var F=document.createElement("td");
M.appendChild(F);
var l=document.createElement("td");
M.appendChild(l);
if(R==null||R==""){F.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='10px'>";
F.width=MVUtil.pixel(10);
var ah=document.createElement("td");
ah.width=MVUtil.pixel(13);
ah.height="100%";
if(!ad){var af=document.createElement("table");
af.style.height="100%";
af.cellPadding="0";
af.cellSpacing="0";
ah.style.verticalAlign="top";
ah.appendChild(af);
var K=document.createElement("tbody");
af.appendChild(K);
var U=document.createElement("tr");
K.appendChild(U);
var E=document.createElement("td");
E.height=MVUtil.pixel(6);
E.style.fontSize="1px";
E.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='6px'>";
U.appendChild(E);
var T=document.createElement("tr");
K.appendChild(T);
var D=document.createElement("td");
D.height=MVUtil.pixel(13);
T.appendChild(D);
var S=document.createElement("tr");
K.appendChild(S);
var C=document.createElement("td");
C.style.height="100%";
C.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='5px'>";
S.appendChild(C);
var ae=MVInfoWindowStyle4.addCloseButton(ag);
if(ae!=null){D.appendChild(ae);
}}M.appendChild(ah);
var H=document.createElement("td");
H.width=MVUtil.pixel(5);
H.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='5px'>";
M.appendChild(H);
var v=document.createElement("table");
v.cellPadding="0";
v.cellSpacing="0";
v.style.width="100%";
v.style.height="100%";
l.style.verticalAlign="top";
l.appendChild(v);
var t=document.createElement("tbody");
v.appendChild(t);
var A=document.createElement("tr");
t.appendChild(A);
var ak=document.createElement("td");
ak.height=MVUtil.pixel(10);
ak.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='10px'>";
ak.style.fontSize="0px";
A.appendChild(ak);
var z=document.createElement("tr");
t.appendChild(z);
var aj=document.createElement("td");
aj.style.height="100%";
aj.style.verticalAlign="top";
z.appendChild(aj);
var G=document.createElement("div");
G.style.overflow="auto";
G.id=s+"_content";
G.innerHTML=u;
if(f&&f>20){G.style.height=MVUtil.pixel(f-20);
}if(a&&a>28){G.style.width=MVUtil.pixel(a-28);
}aj.appendChild(G);
var w=document.createElement("tr");
t.appendChild(w);
var ai=document.createElement("td");
ai.height=MVUtil.pixel(10);
ai.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='10px'>";
ai.style.fontSize="0px";
w.appendChild(ai);
}else{F.style.width=MVUtil.pixel(6);
l.style.height="100%";
F.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='6px'>";
var L=document.createElement("table");
L.cellPadding="0";
L.cellSpacing="0";
L.style.width="100%";
L.style.height="100%";
l.appendChild(L);
var n=document.createElement("tbody");
L.appendChild(n);
var Q=document.createElement("tr");
n.appendChild(Q);
var k=document.createElement("td");
k.width="100%";
Q.appendChild(k);
var d=document.createElement("table");
d.style.width="100%";
d.cellPadding="0";
d.cellSpacing="0";
k.appendChild(d);
var B=document.createElement("tbody");
d.appendChild(B);
var I=document.createElement("tr");
B.appendChild(I);
var ac=document.createElement("td");
ac.style.width="100%";
I.appendChild(ac);
var b=document.createElement("table");
b.style.width="100%";
b.cellPadding="0";
b.cellSpacing="0";
ac.appendChild(b);
var P=document.createElement("tbody");
b.appendChild(P);
var Z=document.createElement("tr");
P.appendChild(Z);
var ab=document.createElement("td");
ab.height="6px";
ab.style.fontSize="1px";
ab.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='6px'>";
Z.appendChild(ab);
var X=document.createElement("tr");
P.appendChild(X);
var Y=document.createElement("td");
Y.style.cssText="font-family: Tahoma; font-size: 12px;font-weight: bold; color:#3E403D";
X.appendChild(Y);
Y.id=s+"_title";
Y.innerHTML=R;
var V=document.createElement("tr");
P.appendChild(V);
var W=document.createElement("td");
W.height="10px";
W.style.fontSize="0px";
W.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='10px'>";
V.appendChild(W);
var aa=document.createElement("td");
aa.style.width=MVUtil.pixel(18);
I.appendChild(aa);
if(!ad){var af=document.createElement("table");
af.cellPadding="0";
af.cellSpacing="0";
af.style.height="100%";
af.style.width=MVUtil.pixel(18);
aa.style.height="100%";
aa.appendChild(af);
aa.style.verticalAlign="top";
var K=document.createElement("tbody");
af.appendChild(K);
var U=document.createElement("tr");
K.appendChild(U);
var E=document.createElement("td");
E.style.height=MVUtil.pixel(6);
E.style.fontSize="1px";
E.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='6px'>";
E.colSpan="2";
U.appendChild(E);
var T=document.createElement("tr");
K.appendChild(T);
var o=document.createElement("td");
o.style.height=MVUtil.pixel(13);
o.style.width=MVUtil.pixel(13);
T.appendChild(o);
var m=document.createElement("td");
m.style.width=MVUtil.pixel(5);
m.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='5px'>";
T.appendChild(m);
var T=document.createElement("tr");
K.appendChild(T);
var C=document.createElement("td");
C.style.height="100%";
C.colSpan="2";
T.appendChild(C);
var ae=MVInfoWindowStyle4.addCloseButton(ag);
if(ae!=null){o.appendChild(ae);
}}var O=document.createElement("tr");
n.appendChild(O);
var h=document.createElement("td");
h.width="100%";
h.height="100%";
O.appendChild(h);
var N=document.createElement("tr");
n.appendChild(N);
var g=document.createElement("td");
g.height=MVUtil.pixel(10);
g.style.fontSize="0px";
g.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='10px'>";
N.appendChild(g);
var v=document.createElement("table");
v.cellPadding="0";
v.cellSpacing="0";
v.style.height="100%";
v.style.width="100%";
h.style.verticalAlign="top";
h.appendChild(v);
var t=document.createElement("tbody");
v.appendChild(t);
A=document.createElement("tr");
t.appendChild(A);
ak=document.createElement("td");
ak.style.width=MVUtil.pixel(4);
ak.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='4px'>";
A.appendChild(ak);
aj=document.createElement("td");
A.appendChild(aj);
ai=document.createElement("td");
ai.style.width=MVUtil.pixel(5);
ai.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='5px'>";
A.appendChild(ai);
var G=document.createElement("div");
G.style.overflow="auto";
G.innerHTML=u;
G.id=s+"_content";
if(a&&a>15){G.style.width=MVUtil.pixel(a-15);
}aj.style.verticalAlign="top";
aj.appendChild(G);
}return al;
};
MVInfoWindowStyle4.createTabsAndContent=function(d,g,f,a,b,h){return MVInfoWindowStyle4.tabStyleOne(d,g,f,a,b,h,this.tabStyle);
};
MVInfoWindowStyle4.tabStyleTwo=function(l,t,a,f,N,R){var Q=MVInfoWindowStyle4.addCloseButton(R);
var X=document.createElement("div");
var L=null;
var Y=9;
var B=30;
var m=0;
var v=0;
var H=true;
var D=document.createElement("div");
var V=MVUtil.createImageNode(MVInfoWindowStyle4.overFlowLeftEnable,true);
var k=MVUtil.createImageNode(MVInfoWindowStyle4.overFlowRightEnable,true);
var r=null;
var w=null;
var A=null;
var I={startImg:null,midImg:null,endImag:null};
var n=0;
var T=new Array();
var z=a-15-13-10-5;
var b;
var E=15;
var C;
var K;
MVInfoWindowStyle4.getPageDirection(N);
var u=MVUtil.createImageNode(MVInfoWindowStyle4.tabSelectedStartImgURL,true);
u.style.width=E+"px";
u.style.height="24px";
var G=MVUtil.createImageNode(MVInfoWindowStyle4.tabEnableStartImgURL,true);
G.style.width=E+"px";
G.style.height="24px";
var s=MVUtil.createImageNode(MVInfoWindowStyle4.tabSelectedEndImgURL,true);
s.style.width="36px";
s.style.height="24px";
var O=MVUtil.createImageNode(MVInfoWindowStyle4.tabEnableEndImgURL,true);
O.style.width="36px";
O.style.height="24px";
if(t!=null||t!=undefined){m=t;
}for(var W=0;
W<l.length;
W++){T[W]=MVInfoWindowStyle4.getRealWithOfOneTab(N,l[W],z);
}X.style.position="absolute";
X.style.width=MVUtil.pixel(a);
X.style.height=MVUtil.pixel(f);
X.style.zIndex="220";
N.appendChild(X);
X.appendChild(D);
if(MVInfoWindowStyle4.pageDirection){D.style.cssText="float:left";
D.style.direction="ltr";
}else{D.style.cssText="float:right";
D.style.direction="ltr";
}D.style.zIndex="210";
D.style.position="absolute";
D.style.top="5px";
D.style.overflow="auto";
D.style.width=a-Y-15+"px";
D.style.height=f*0.3+"px";
Q.style.zIndex="300";
if(Q!=null){Q.style.position="absolute";
Q.style.top="5px";
if(MVInfoWindowStyle4.pageDirection){Q.style.right="10px";
}else{Q.style.left="10px";
}X.appendChild(Q);
}if(MVInfoWindowStyle4.pageDirection){D.style.left="15px";
}else{D.style.right="15px";
}w=document.createElement("div");
w.style.position="absolute";
w.style.borderColor="black";
w.style.backgroundColor="#ffffe1";
w.style.borderWidth="1px";
w.style.borderStyle="solid";
w.style.fontSize="14px";
w.style.whiteSpace="nowrap";
w.style.padding="2px";
w.style.zIndex="300";
w.style.fontFamily="Tahoma";
if(MVInfoWindowStyle4.pageDirection){w.style.direction="ltr";
}else{w.style.direction="rtl";
}function P(Z){Z=(Z)?Z:((window.event)?event:null);
var aa=MVUtil.getEventSource(Z);
r=aa.style.color;
aa.style.color="#78c3ff";
if(l[aa.parentNode.parentNode.indexInList].showTitle!=undefined){w.innerHTML=l[aa.parentNode.parentNode.indexInList].title;
w.style.top=aa.parentNode.parentNode.parentNode.offsetTop+30+"px";
if(MVInfoWindowStyle4.pageDirection){w.style.left=aa.parentNode.parentNode.offsetLeft+5+"px";
}else{w.style.right=aa.parentNode.parentNode.offsetLeft+5+"px";
}aa.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(w);
}}function M(Z){Z=(Z)?Z:((window.event)?event:null);
var aa=MVUtil.getEventSource(Z);
aa.style.color=r;
if(l[aa.parentNode.parentNode.indexInList].showTitle!=undefined){aa.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(w);
}}function o(Z){Z=(Z)?Z:((window.event)?event:null);
var aa=MVUtil.getEventSource(Z);
}function g(Z){Z=(Z)?Z:((window.event)?event:null);
var aa=MVUtil.getEventSource(Z);
m=aa.parentNode.parentNode.indexInList;
r="#00234c";
aa.parentNode.parentNode.style.zIndex=200;
I.startImg.parentNode.style.zIndex=100;
if(aa.parentNode.parentNode.parentNode.style.zIndex!=K){b.style.zIndex=aa.parentNode.parentNode.parentNode.style.zIndex;
b.style.top=aa.parentNode.parentNode.parentNode.style.top;
aa.parentNode.parentNode.parentNode.style.zIndex=K;
aa.parentNode.parentNode.parentNode.style.top=C;
b=aa.parentNode.parentNode.parentNode;
}MVUtil.clearNode(I.startImg);
I.startImg.appendChild(G.cloneNode(true));
if(MVInfoWindowStyle4.pageDirection){I.startImg=aa.parentNode.parentNode.firstChild;
}else{I.startImg=aa.parentNode.parentNode.childNodes[2];
}MVUtil.clearNode(I.startImg);
I.startImg.appendChild(u.cloneNode(true));
I.midImg.style.backgroundImage="url('"+MVInfoWindowStyle4.tabEnableMidImgURL+"')";
aa.parentNode.style.backgroundImage="url('"+MVInfoWindowStyle4.tabSelectedMidImgURL+"')";
I.midImg.firstChild.style.color="#e9f6fe";
I.midImg=aa.parentNode;
aa.style.color="#00234c";
MVUtil.clearNode(I.endImg);
I.endImg.appendChild(O.cloneNode(true));
if(MVInfoWindowStyle4.pageDirection){I.endImg=aa.parentNode.parentNode.childNodes[2];
}else{I.endImg=aa.parentNode.parentNode.firstChild;
}MVUtil.clearNode(I.endImg);
I.endImg.appendChild(s.cloneNode(true));
document.getElementById("realContentDivId").innerHTML=l[aa.parentNode.parentNode.indexInList].content;
D.scrollTop=D.scrollHeight;
}function J(af,Z){var ad=document.createElement("div");
af.appendChild(ad);
ad.style.position="absolute";
ad.style.zIndex=n;
ad.style.top=n*20+"px";
C=ad.style.top;
K=ad.style.zIndex;
n++;
L=5;
if(MVInfoWindowStyle4.pageDirection){ad.style.left="0px";
}else{ad.style.right="0px";
}for(var ae=0;
ae<Z.length;
ae++){var ak=document.createElement("div");
var ai=document.createElement("div");
var aj=document.createElement("div");
var ab=document.createElement("div");
var ah=document.createElement("a");
var ac=ae*(-19);
var aa;
var ag;
ad.appendChild(ak);
if(MVInfoWindowStyle4.pageDirection){ak.appendChild(ai);
ak.appendChild(aj);
ak.appendChild(ab);
ak.style.cssText="float:left;";
ak.style.left=ac+"px";
ai.style.cssText="float:left;";
aj.style.cssText="float:left;";
ab.style.cssText="float:left;";
}else{ak.appendChild(ab);
ak.appendChild(aj);
ak.appendChild(ai);
ak.style.cssText="float:right;";
ak.style.right=ac+"px";
ai.style.cssText="float:left;";
aj.style.cssText="float:left;";
ab.style.cssText="float:left;";
}ak.indexInList=Z[ae];
if(Z[ae]==m){ak.style.zIndex="200";
}else{ak.style.zIndex="100";
}ak.style.position="relative";
ai.style.width=E+"px";
ai.style.height="24px";
ai.style.backgroundPosition="bottom";
ai.style.position="relative";
if(Z[ae]==m){aa=u.cloneNode(true);
}else{aa=G.cloneNode(true);
}ai.appendChild(aa);
if(Z[ae]==m){aj.style.backgroundImage="url('"+MVInfoWindowStyle4.tabSelectedMidImgURL+"')";
}else{aj.style.backgroundImage="url('"+MVInfoWindowStyle4.tabEnableMidImgURL+"')";
}aj.style.backgroundRepeat="repeat-x";
aj.style.position="relative";
aj.style.lineHeight="1.3em";
aj.style.height="24px";
if(MVInfoWindowStyle4.pageDirection){aj.style.direction="ltr";
}else{aj.style.direction="rtl";
}aj.appendChild(ah);
ah.style.cursor="pointer";
ah.style.fontFamily="Tahoma";
ah.style.fontSize="11px";
ah.style.fontWeight="bold";
if(Z[ae]==m){ah.style.color="#00234c";
}else{ah.style.color="#e9f6fe";
}if(l[Z[ae]].showTitle!=undefined){ah.innerHTML=l[Z[ae]].showTitle.replace(/\s/g,"&nbsp;");
}else{ah.innerHTML=l[Z[ae]].title.replace(/\s/g,"&nbsp;");
}MVUtil.attachEvent(ah,"mouseover",P);
MVUtil.attachEvent(ah,"mouseout",M);
MVUtil.attachEvent(ah,"mousedown",o);
MVUtil.attachEvent(ah,"mouseup",g);
ab.style.width="36px";
ab.style.height="24px";
ab.style.backgroundPosition="bottom";
ab.style.position="relative";
if(Z[ae]==m){ag=s.cloneNode(true);
}else{ag=O.cloneNode(true);
}ab.appendChild(ag);
L=L+aj.clientWidth+E+36;
ad.style.width=L+"px";
if(Z[ae]==m){I.endImg=ab;
I.startImg=ai;
I.midImg=aj;
}}}var d=MVInfoWindowStyle4.groupingTabs(T,z);
for(var U=0;
U<d.length;
U++){for(var S=0;
S<d[U].length;
S++){if(d[U][S]==m){var h=d[U][0];
d[U][0]=d[U][S];
d[U][S]=h;
var F=d[d.length-1];
d[d.length-1]=d[U];
d[U]=F;
break;
}}}for(var W=0;
W<d.length;
W++){J(D,d[W]);
}b=D.lastChild;
if(D.clientHeight>=D.scrollHeight){A=MVInfoWindowStyle4.createContentDiv(a-Y,f-B-(n-1)*20,D.offsetTop+15+(n-1)*20);
}else{D.style.top=D.offsetTop+13+"px";
A=MVInfoWindowStyle4.createContentDiv(a-Y,f-D.offsetTop-D.offsetHeight-5,D.offsetTop+D.offsetHeight-6);
D.scrollTop=D.scrollHeight;
}X.appendChild(A);
document.getElementById("realContentDivId").innerHTML=l[m].content;
return X;
};
MVInfoWindowStyle4.tabStyleOne=function(h,t,a,b,T,Y,I){var X=MVInfoWindowStyle4.addCloseButton(Y);
var ae=document.createElement("div");
var R=null;
var ah=9;
var D=30;
var k=0;
var z=0;
var L=true;
var E=document.createElement("div");
var s=document.createElement("div");
var ab=MVUtil.createImageNode(MVInfoWindowStyle4.overFlowLeftEnable,true);
var g=MVUtil.createImageNode(MVInfoWindowStyle4.overFlowRightEnable,true);
var o=null;
var B=null;
var C=null;
var G=10;
var F=20;
var v=12;
var d=4;
var J=v;
var I=this.tabStyle;
var P;
var m;
var M={startImg:null,midImg:null,endImag:null};
if(t!=null||t!=undefined){k=t;
}MVInfoWindowStyle4.getPageDirection(T);
var u=MVUtil.createImageNode(MVInfoWindowStyle4.tabSelectedStartImgURL,true,true);
u.style.width=G+"px";
u.style.height="24px";
var K=MVUtil.createImageNode(MVInfoWindowStyle4.tabEnableStartImgURL,true,true);
K.style.width=G+"px";
K.style.height="24px";
var r=MVUtil.createImageNode(MVInfoWindowStyle4.tabSelectedEndImgURL,true,true);
r.style.width=F+"px";
r.style.height="24px";
var U=MVUtil.createImageNode(MVInfoWindowStyle4.tabEnableEndImgURL,true,true);
U.style.width=F+"px";
U.style.height="24px";
ae.style.position="absolute";
ae.style.width=MVUtil.pixel(a);
ae.style.height=MVUtil.pixel(b);
ae.style.zIndex="220";
T.appendChild(ae);
for(var ac=0;
ac<h.length;
ac++){J+=MVInfoWindowStyle4.getOrignalWithOfOneTab(T,h[ac])-v;
}ae.appendChild(s);
s.appendChild(E);
if(MVInfoWindowStyle4.pageDirection){s.style.left="15px";
E.style.cssText="float:left";
E.style.direction="ltr";
}else{s.style.right="15px";
E.style.cssText="float:right";
E.style.direction="ltr";
}s.style.position="absolute";
s.style.zIndex="210";
s.style.top="5px";
s.style.height="24px";
s.style.width=a-2-13-25-13+"px";
s.style.overflow="hidden";
E.style.position="absolute";
E.style.top="0px";
C=MVInfoWindowStyle4.createContentDiv(a-ah,b-D,20);
ae.appendChild(C);
X.style.zIndex="300";
if(X!=null){X.style.position="absolute";
X.style.top="5px";
if(MVInfoWindowStyle4.pageDirection){X.style.right="10px";
}else{X.style.left="10px";
}ae.appendChild(X);
}function W(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
if(MVInfoWindowStyle4.pageDirection){if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowLeftOver;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftOver+"', sizingMethod='image');";
}}}else{if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowRightOver;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightOver+"', sizingMethod='image');";
}}}}function Z(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
if(MVInfoWindowStyle4.pageDirection){if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowLeftEnable;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftEnable+"', sizingMethod='image');";
}}}else{if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowRightEnable;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightEnable+"', sizingMethod='image');";
}}}}function n(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
if(MVInfoWindowStyle4.pageDirection){if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowLeftDown;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftDown+"', sizingMethod='image');";
}}}else{if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowRightDown;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightDown+"', sizingMethod='image');";
}}}}function H(aj){aj=(aj)?aj:((window.event)?event:null);
var al=MVUtil.getEventSource(aj);
if(MVInfoWindowStyle4.pageDirection){if(al.tagName=="IMG"){al.src=MVInfoWindowStyle4.overFlowLeftEnable;
}else{if(al.tagName=="DIV"){al.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftEnable+"', sizingMethod='image');";
}}}else{if(al.tagName=="IMG"){al.src=MVInfoWindowStyle4.overFlowRightEnable;
}else{if(al.tagName=="DIV"){al.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightEnable+"', sizingMethod='image');";
}}}if(MVInfoWindowStyle4.pageDirection){var am=E.style.left.toString();
var ai=parseInt(am.substr(0,am.length-2));
E.style.left=MVUtil.pixel(ai+30);
}else{var am=E.style.right.toString();
var ak=parseInt(am.substr(0,am.length-2));
E.style.right=MVUtil.pixel(ak+30);
}if(E.offsetLeft>=0){ab.style.visibility="hidden";
}else{ab.style.visibility="visible";
}var an=document.getElementById("inforwindowtab_"+(h.length-1));
if(an.offsetLeft+an.offsetWidth+E.offsetLeft<=s.offsetWidth){g.style.visibility="hidden";
}else{g.style.visibility="visible";
}}ae.appendChild(ab);
if(MVInfoWindowStyle4.pageDirection){ab.style.left="2px";
}else{ab.style.right="2px";
if(ab.tagName=="IMG"){ab.src=MVInfoWindowStyle4.overFlowRightEnable;
}else{if(ab.tagName=="DIV"){ab.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightEnable+"', sizingMethod='image')";
}}}ab.style.width="13px";
ab.style.top="5px";
ab.style.position="absolute";
ab.style.zIndex=500;
ab.style.visibility="hidden";
MVUtil.attachEvent(ab,"mouseover",W);
MVUtil.attachEvent(ab,"mouseout",Z);
MVUtil.attachEvent(ab,"mousedown",n);
MVUtil.attachEvent(ab,"mouseup",H);
function S(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
if(MVInfoWindowStyle4.pageDirection){if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowRightOver;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightOver+"', sizingMethod='image');";
}}}else{if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowLeftOver;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftOver+"', sizingMethod='image');";
}}}}function O(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
if(MVInfoWindowStyle4.pageDirection){if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowRightEnable;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightEnable+"', sizingMethod='image');";
}}}else{if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowLeftEnable;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftEnable+"', sizingMethod='image');";
}}}}function A(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
if(MVInfoWindowStyle4.pageDirection){if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowRightDown;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightDown+"', sizingMethod='image');";
}}}else{if(aj.tagName=="IMG"){aj.src=MVInfoWindowStyle4.overFlowLeftDown;
}else{if(aj.tagName=="DIV"){aj.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftDown+"', sizingMethod='image');";
}}}}function ag(aj){aj=(aj)?aj:((window.event)?event:null);
var al=MVUtil.getEventSource(aj);
if(MVInfoWindowStyle4.pageDirection){if(al.tagName=="IMG"){al.src=MVInfoWindowStyle4.overFlowRightEnable;
}else{if(al.tagName=="DIV"){al.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowRightEnable+"', sizingMethod='image');";
}}}else{if(al.tagName=="IMG"){al.src=MVInfoWindowStyle4.overFlowLeftEnable;
}else{if(al.tagName=="DIV"){al.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftEnable+"', sizingMethod='image');";
}}}if(MVInfoWindowStyle4.pageDirection){var am=E.style.left.toString();
var ai=am.substr(0,am.length-2).valueOf();
E.style.left=MVUtil.pixel(ai-30);
if(E.offsetLeft>=0){ab.style.visibility="hidden";
}else{ab.style.visibility="visible";
}var an=document.getElementById("inforwindowtab_"+(h.length-1));
if(an.offsetLeft+an.offsetWidth+E.offsetLeft<=s.offsetWidth){g.style.visibility="hidden";
}else{g.style.visibility="visible";
}}else{var am=E.style.right.toString();
var ak=am.substr(0,am.length-2).valueOf();
E.style.right=MVUtil.pixel(ak-30);
if(E.offsetLeft>=0){ab.style.visibility="hidden";
}else{ab.style.visibility="visible";
}var an=document.getElementById("inforwindowtab_"+(h.length-1));
if(an.offsetLeft+an.offsetWidth+E.offsetLeft<=s.offsetWidth){g.style.visibility="hidden";
}else{g.style.visibility="visible";
}}}if(MVInfoWindowStyle4.pageDirection){g.style.right="25px";
}else{g.style.left="25px";
if(g.tagName=="IMG"){g.src=MVInfoWindowStyle4.overFlowLeftEnable;
}else{if(g.tagName=="DIV"){g.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.overFlowLeftEnable+"', sizingMethod='image')";
}}}g.style.width="13px";
g.style.top="5px";
g.style.position="absolute";
g.style.zIndex="500";
g.style.visibility="hidden";
MVUtil.attachEvent(g,"mouseover",S);
MVUtil.attachEvent(g,"mouseout",O);
MVUtil.attachEvent(g,"mousedown",A);
MVUtil.attachEvent(g,"mouseup",ag);
ae.appendChild(g);
if(MVInfoWindowStyle4.pageDirection){E.style.left="0px";
}else{E.style.right="0px";
}B=document.createElement("div");
B.style.position="absolute";
B.style.borderColor="black";
B.style.backgroundColor="#ffffe1";
B.style.borderWidth="1px";
B.style.borderStyle="solid";
B.style.fontSize="14px";
B.style.whiteSpace="nowrap";
B.style.padding="2px";
B.style.zIndex="10000";
B.style.fontFamily="Tahoma";
B.id="TabbedInforwindowToolTip";
function V(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
o=aj.style.color;
aj.style.color="#78c3ff";
B.topOffset=15;
B.leftOffset=15;
if(window.innerWidth){B.topOffset+=window.pageYOffset;
B.leftOffset+=window.pageXOffset;
}else{if(document.documentElement&&document.documentElement.clientWidth){B.topOffset+=document.documentElement.scrollTop;
B.leftOffset+=document.documentElement.scrollLeft;
}else{if(document.body.clientWidth){B.topOffset+=document.body.scrollTop;
B.leftOffset+=document.body.scrollLeft;
}}}B.innerHTML=h[aj.parentNode.parentNode.indexInList].title;
B.style.top=ai.clientY+B.topOffset+"px";
B.style.left=ai.clientX+B.leftOffset+"px";
document.body.appendChild(B);
}function Q(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
aj.style.color=o;
document.body.removeChild(B);
}function l(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
}function f(ai){ai=(ai)?ai:((window.event)?event:null);
var aj=MVUtil.getEventSource(ai);
if(aj.nodeName=="#text"){aj=aj.parentNode;
}k=aj.parentNode.parentNode.indexInList;
M.startImg.parentNode.style.zIndex=100;
aj.parentNode.parentNode.style.zIndex=200;
MVUtil.clearNode(M.startImg);
M.startImg.appendChild(K.cloneNode(true));
if(MVInfoWindowStyle4.pageDirection){M.startImg=aj.parentNode.parentNode.firstChild;
}else{M.startImg=aj.parentNode.parentNode.childNodes[2];
}MVUtil.clearNode(M.startImg);
M.startImg.appendChild(u.cloneNode(true));
M.midImg.style.backgroundImage="url('"+MVInfoWindowStyle4.tabEnableMidImgURL+"')";
aj.parentNode.style.backgroundImage="url('"+MVInfoWindowStyle4.tabSelectedMidImgURL+"')";
M.midImg.firstChild.style.color="#e9f6fe";
M.midImg=aj.parentNode;
aj.style.color="#00234c";
MVUtil.clearNode(M.endImg);
M.endImg.appendChild(U.cloneNode(true));
if(MVInfoWindowStyle4.pageDirection){M.endImg=aj.parentNode.parentNode.childNodes[2];
}else{M.endImg=aj.parentNode.parentNode.firstChild;
}MVUtil.clearNode(M.endImg);
M.endImg.appendChild(r.cloneNode(true));
document.getElementById("realContentDivId").innerHTML=h[aj.parentNode.parentNode.indexInList].content;
o=aj.style.color;
}function N(aq,an,am,ak){R=0;
for(ac=0;
ac<aq.length;
ac++){var aw=document.createElement("div");
var at=document.createElement("div");
var au=document.createElement("div");
var aj=document.createElement("div");
var ap=document.createElement("a");
var al=ac*(-v);
var ai;
var ao;
an.appendChild(aw);
if(MVInfoWindowStyle4.pageDirection){aw.appendChild(at);
aw.appendChild(au);
aw.appendChild(aj);
aw.style.cssText="float:left;";
aw.style.left=al+"px";
at.style.cssText="float:left;";
au.style.cssText="float:left;";
aj.style.cssText="float:left;";
}else{aw.appendChild(aj);
aw.appendChild(au);
aw.appendChild(at);
aw.style.cssText="float:right;";
aw.style.right=al+"px";
at.style.cssText="float:left;";
au.style.cssText="float:left;";
aj.style.cssText="float:left;";
}aw.indexInList=ac;
if(ac==k){aw.style.zIndex="200";
am.innerHTML=aq[ac].content;
}else{aw.style.zIndex="100";
}aw.style.position="relative";
at.style.width=G+"px";
at.style.height="24px";
at.style.backgroundPosition="bottom";
at.style.position="relative";
if(ac==k){ai=MVUtil.createImageNode(MVInfoWindowStyle4.tabSelectedStartImgURL,true,true);
}else{ai=MVUtil.createImageNode(MVInfoWindowStyle4.tabEnableStartImgURL,true,true);
}ai.style.width=G+"px";
ai.style.height="24px";
at.appendChild(ai);
if(ac==k){au.style.backgroundImage="url('"+MVInfoWindowStyle4.tabSelectedMidImgURL+"')";
}else{au.style.backgroundImage="url('"+MVInfoWindowStyle4.tabEnableMidImgURL+"')";
}au.style.backgroundRepeat="repeat-x";
au.style.position="relative";
au.style.lineHeight="1.3em";
au.style.height="24px";
au.appendChild(ap);
ap.style.cursor="pointer";
ap.style.fontFamily="Tahoma";
ap.style.fontSize="11px";
ap.style.fontWeight="bold";
ap.style.whiteSpace="nowrap";
ap.id="tablinkid_"+ac;
if(ac==k){ap.style.color="#00234c";
}else{ap.style.color="#e9f6fe";
}ap.innerHTML=aq[ac].title.replace(/\s/g,"&nbsp;");
if(J>s.offsetWidth+20&&I=="p"){var ar=au.clientWidth;
ap.innerHTML=aq[ac].title;
var av;
if(aq[ac].title.length-2>ak){av=aq[ac].title.substr(0,ak)+"..";
}else{av=aq[ac].title;
}ap.innerHTML=av;
}MVUtil.attachEvent(ap,"mouseover",V);
MVUtil.attachEvent(ap,"mouseout",Q);
MVUtil.attachEvent(ap,"mousedown",l);
MVUtil.attachEvent(ap,"mouseup",f);
aj.style.width=F+"px";
aj.style.height="24px";
aj.style.backgroundPosition="bottom";
aj.style.position="relative";
if(ac==k){ao=MVUtil.createImageNode(MVInfoWindowStyle4.tabSelectedEndImgURL,true,true);
}else{ao=MVUtil.createImageNode(MVInfoWindowStyle4.tabEnableEndImgURL,true,true);
}ao.style.width=F+"px";
ao.style.height="24px";
aj.appendChild(ao);
R=R+au.clientWidth+G+F;
an.style.width=R+"px";
aw.id="inforwindowtab_"+ac;
if(ac==k){M.endImg=aj;
M.startImg=at;
M.midImg=au;
}}}if(J<=s.offsetWidth+20||I=="f"){N(h,E,document.getElementById("realContentDivId"));
}else{N(h,E,document.getElementById("realContentDivId"),1);
if(E.offsetWidth-v*(h.length-1)<s.offsetWidth+20){MVUtil.removeAllChildren(E);
for(m=2;
m<400;
m++){N(h,E,document.getElementById("realContentDivId"),m);
if(E.offsetWidth-v*(h.length-1)==s.offsetWidth+20){s.style.width=a-2-13-25-13+20+"px";
return ae;
}else{if(E.offsetWidth-v*(h.length-1)>s.offsetWidth+20){for(var aa=1;
aa<3;
aa++){for(var ac=0;
ac<h.length;
ac++){var af=document.getElementById("tablinkid_"+ac);
var ad=af.offsetWidth;
if(h[ac].title.length-2>m-aa){af.innerHTML=h[ac].title.substr(0,m-aa)+"..";
}else{af.innerHTML=h[ac].title;
}var w=af.offsetWidth;
E.style.width=E.offsetWidth+w-ad;
if(E.offsetWidth-v*(h.length-1)<=s.offsetWidth+20){s.style.width=a-2-13-25-13+20+"px";
return ae;
}}if(E.offsetWidth-v*(h.length-1)<=s.offsetWidth+20){s.style.width=a-2-13-25-13+20+"px";
return ae;
}}s.style.width=a-2-13-25-13+20+"px";
return ae;
}}MVUtil.removeAllChildren(E);
}}else{if(E.offsetWidth-v*(h.length-1)>s.offsetWidth+20){MVUtil.removeAllChildren(E);
m=4;
N(h,E,document.getElementById("realContentDivId"),m);
}}}if(E.offsetWidth-v*(h.length-1)>s.offsetWidth+20){g.style.visibility="visible";
}else{if(E.offsetWidth-v*(h.length-1)>s.offsetWidth){s.style.width=a-2-13-25+7+"px";
}}return ae;
};
MVInfoWindowStyle4.createContentDiv=function(z,w,v){var b=document.createElement("div");
b.style.left="5px";
b.style.top=v+"px";
b.style.width=z+"px";
if(w<30){w=70;
}b.style.height=w+"px";
b.style.position="absolute";
var h=document.createElement("div");
var m=document.createElement("div");
var g=MVUtil.createImageNode(MVInfoWindowStyle4.tabContentHeadStartImgURL,true);
var B=document.createElement("div");
var o=document.createElement("div");
var C=MVUtil.createImageNode(MVInfoWindowStyle4.tabContentHeadEndImgURL,true);
h.style.position="absolute";
h.style.top="5px";
m.style.width="5px";
m.style.height="5px";
m.style.position="absolute";
g.style.width="5px";
g.style.position="absolute";
m.appendChild(g);
h.appendChild(m);
B.style.width=(z-5-8)+"px";
B.style.height="5px";
B.style.position="absolute";
B.style.backgroundRepeat="repeat-x";
B.style.backgroundImage="url("+MVInfoWindowStyle4.tabContentHeadMidImgURL+")";
h.appendChild(B);
o.style.width="8px";
o.style.height="5px";
o.style.position="absolute";
C.style.width="8px";
C.style.position="absolute";
o.appendChild(C);
h.appendChild(o);
b.appendChild(h);
var a=document.createElement("div");
var s=document.createElement("div");
var t=document.createElement("div");
var k=document.createElement("div");
var A=document.createElement("div");
a.style.position="absolute";
a.style.top="10px";
s.style.width="5px";
s.style.height=(w-5-7)+"px";
s.style.position="absolute";
s.style.backgroundImage="url("+MVInfoWindowStyle4.tabContentMidStartImgURL+")";
a.appendChild(s);
t.style.width=(z-5-8)+"px";
t.style.height=(w-5-7)+"px";
t.style.position="absolute";
t.style.backgroundRepeat="repeat-x";
t.style.backgroundColor="#F8F8FB";
t.style.backgroundImage="url("+MVInfoWindowStyle4.tabContentMidMidImgURL+")";
k.style.overflow="auto";
k.style.width=(z-5-8)+"px";
k.style.height=(w-5-7-6-9)+"px";
k.style.position="absolute";
k.style.top="15px";
k.style.left="0px";
k.id="realContentDivId";
t.appendChild(k);
a.appendChild(t);
A.style.width="8px";
A.style.height=(w-5-7)+"px";
A.style.position="absolute";
A.style.backgroundImage="url("+MVInfoWindowStyle4.tabContentMidEndImgURL+")";
a.appendChild(A);
b.appendChild(a);
var n=document.createElement("div");
var r=document.createElement("div");
var l=MVUtil.createImageNode(MVInfoWindowStyle4.tabContentFooterStartImgURL,true);
var d=document.createElement("div");
var u=document.createElement("div");
var f=MVUtil.createImageNode(MVInfoWindowStyle4.tabContentFooterEndImgURL,true);
n.style.position="absolute";
n.style.top=(w-7+5)+"px";
r.style.width="6px";
r.style.height="7px";
r.style.position="absolute";
l.style.width="6px";
l.style.position="absolute";
r.appendChild(l);
n.appendChild(r);
d.style.width=(z-6-8)+"px";
d.style.height="7px";
d.style.position="absolute";
d.style.backgroundRepeat="repeat-x";
d.style.backgroundImage="url("+MVInfoWindowStyle4.tabContentFooterMidImgURL+")";
n.appendChild(d);
u.style.width="8px";
u.style.height="7px";
u.style.position="absolute";
f.style.width="8px";
f.style.position="absolute";
u.appendChild(f);
n.appendChild(u);
b.appendChild(n);
if(MVInfoWindowStyle4.pageDirection){h.style.left="0px";
a.style.left="0px";
n.style.left="0px";
m.style.left="0px";
s.style.left="0px";
r.style.left="0px";
B.style.left="5px";
o.style.left=(z-8)+"px";
t.style.left="5px";
A.style.left=(z-8)+"px";
d.style.left="6px";
u.style.left=(z-8)+"px";
}else{h.style.right="0px";
a.style.right="0px";
n.style.right="0px";
m.style.right="0px";
s.style.right="0px";
r.style.right="0px";
B.style.right="5px";
o.style.right=(z-8)+"px";
t.style.right="5px";
A.style.right=(z-8)+"px";
d.style.right="6px";
u.style.right=(z-8)+"px";
}return b;
};
MVInfoWindowStyle4.addCloseButton=function(h){if(this.hideCloseButton){return null;
}var g=MVUtil.createImageNode(MVInfoWindowStyle4.closeButtonImgURL,true);
g.style.width=MVUtil.pixel(13);
g.style.height=MVUtil.pixel(13);
var f=function(k){MVInfoWindowStyle4.closeButtonImgURL=MVInfoWindowStyle4.closeButtonOverImgURL;
k=(k)?k:((window.event)?event:null);
var l=MVUtil.getEventSource(k);
if(l.tagName=="IMG"){l.src=MVInfoWindowStyle4.closeButtonImgURL;
}else{if(l.tagName=="DIV"){l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.closeButtonImgURL;
}}+"', sizingMethod='image');";
};
var d=function(k){MVInfoWindowStyle4.closeButtonImgURL=MVInfoWindowStyle4.closeButtonEnableImgURL;
k=(k)?k:((window.event)?event:null);
var l=MVUtil.getEventSource(k);
if(l.tagName=="IMG"){l.src=MVInfoWindowStyle4.closeButtonImgURL;
}else{if(l.tagName=="DIV"){l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.closeButtonImgURL;
}}+"', sizingMethod='image');";
};
var b=function(k){MVInfoWindowStyle4.closeButtonImgURL=MVInfoWindowStyle4.closeButtonDownImgURL;
k=(k)?k:((window.event)?event:null);
var l=MVUtil.getEventSource(k);
if(l.tagName=="IMG"){l.src=MVInfoWindowStyle4.closeButtonImgURL;
}else{if(l.tagName=="DIV"){l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.closeButtonImgURL;
}}+"', sizingMethod='image');";
};
var a=function(k){MVInfoWindowStyle4.closeButtonImgURL=MVInfoWindowStyle4.closeButtonOverImgURL;
k=(k)?k:((window.event)?event:null);
var l=MVUtil.getEventSource(k);
if(l.tagName=="IMG"){l.src=MVInfoWindowStyle4.closeButtonImgURL;
}else{if(l.tagName=="DIV"){l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+MVInfoWindowStyle4.closeButtonImgURL;
}}+"', sizingMethod='image');";
};
MVUtil.attachEvent(g,"mouseover",f);
MVUtil.attachEvent(g,"mouseout",d);
MVUtil.attachEvent(g,"mousedown",b);
MVUtil.attachEvent(g,"mouseup",a);
if(h!=null){MVUtil.attachEvent(g,"click",h);
}return g;
};
MVInfoWindowStyle4.renderCone=function(b,a){MVInfoWindowStyle4.renderTrail(b,this.x,this.y,a);
};
MVInfoWindowStyle4.renderTrail=function(l,s,r,o){if(this.style_coneOpacity==0){return;
}var C=document.getElementById("infowindow4_"+o);
var K=C.style.zIndex-1;
var f=C.offsetLeft;
var d=C.offsetTop;
f-=s;
d-=r;
var H=1;
var k=1;
var g=C.offsetWidth;
var u=C.offsetHeight;
var z=0;
var b=50;
var L=260;
var m=340;
var n=50;
if(this.coneDiv){MVUtil.clearNode(this.coneDiv);
if(this.coneDiv.parentNode){this.coneDiv.parentNode.removeChild(this.coneDiv);
}}var w=document.createElement("DIV");
w.id=C.id+"cones";
w.style.position="absolute";
w.style.left=s+"px";
w.style.top=r+"px";
w.style.border="0px solid #000000";
w.style.zIndex=K;
this.coneDiv=w;
l.appendChild(w);
zcounter=0;
var A=n;
var E=Math.round((this.style_coneOpacity/n)*7);
var G=Math.abs(f/n);
var F=Math.abs(d/n);
var D=Math.abs(G/F);
var J=0;
for(var B=0;
B<n;
B++){var I=((f*1/n)*B);
var h=((d*1/n)*B);
L=H+Math.abs(((g-H)/n*B));
m=k+Math.abs(((u-k)/n*B));
var t=document.createElement("DIV");
t.id=C.id+"D"+B;
t.style.cssText=this.style_coneStyle;
t.style.position="absolute";
MVUtil.setDIVStyle(t,I,h,L,m);
t.style.border="0px solid black";
t.style.fontSize="1px";
t.style.lineHeight=0;
w.appendChild(t);
MVInfoWindowStyle4.setOpaque(t,E);
t.style.zIndex=zcounter;
zcounter++;
J++;
A-=B;
}coneDone=true;
};
MVInfoWindowStyle4.setOpaque=function(a,b){if(MVGlobalVariables.browser=="IF"){a.style.filter="alpha(opacity = "+(b)+")";
}else{if(MVGlobalVariables.browser=="SF"){a.style.opacity=b/100;
}else{a.style.MozOpacity=b/100;
a.style.opacity=b/100;
}}};
MVInfoWindowStyle4.sizeChanged=function(f){var b=document.getElementById("infowindow4_"+f);
if(b){var g=document.getElementById(f+"_content");
var k=document.getElementById(f+"_title");
if(g!=null&&g.parentNode!=null){var a=g.parentNode.offsetWidth;
var d=g.parentNode.offsetHeight;
if(k){if(MVGlobalVariables.browser=="IF"&&b.style.height!="0px"){d=b.offsetHeight;
}else{d+=k.offsetHeight+26;
}a=a+15>k.offsetWidth+24?a+15:k.offsetWidth+24;
}else{if(MVGlobalVariables.browser=="IF"&&b.style.height!="0px"){d=b.offsetHeight;
}else{d+=MVInfoWindowStyle4.TotalMarginHeight;
}if(MVUtil.strEndWith(f,"2")){a+=MVInfoWindowStyle4.MultiFeatureListTotalMarginWidth;
}else{a+=28;
}}if(Math.abs(a-b.offsetWidth)>=5){return true;
}if(Math.abs(d-b.offsetHeight)>=5){return true;
}}}if((b&&MVInfoWindowStyle4.infoWindowWidth[f]&&Math.abs(MVInfoWindowStyle4.infoWindowWidth[f]-b.offsetWidth)<5&&MVInfoWindowStyle4.infoWindowHeight[f]&&Math.abs(MVInfoWindowStyle4.infoWindowHeight[f]-b.offsetHeight)<5)){return false;
}else{return true;
}};
MVInfoWindowStyle4.clear=function(){if(this.windowDiv){MVUtil.clearNode(this.windowDiv);
this.windowDiv=null;
}if(this.coneDiv){MVUtil.clearNode(this.coneDiv);
}this.coneDiv=null;
};
MVInfoWindowStyle4.createContentByDiv=function(l,n,a,b,u){var v=document.createElement("table");
v.style.position="absolute";
v.style.zIndex="300";
v.cellPadding="0";
v.cellSpacing="0";
var k=document.createElement("tbody");
v.appendChild(k);
var t=document.createElement("tr");
k.appendChild(t);
var s=document.createElement("td");
s.rowSpan="3";
s.style.width=MVUtil.pixel(10);
s.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='10px'>";
t.appendChild(s);
var h=document.createElement("td");
h.style.height=MVUtil.pixel(10);
h.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='10px'>";
t.appendChild(h);
var m=document.createElement("td");
m.style.width=MVUtil.pixel(5);
m.rowSpan="3";
m.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' width='5px'>";
t.appendChild(m);
var r=document.createElement("tr");
k.appendChild(r);
var g=document.createElement("td");
g.style.verticalAlign="top";
var d=document.createElement("div");
d.id=l+"_content";
d.appendChild(n);
g.appendChild(d);
r.appendChild(g);
var o=document.createElement("tr");
var f=document.createElement("td");
f.style.height=MVUtil.pixel(10);
f.innerHTML="<img src='"+MVGlobalVariables.imgFilePath+"transparent.gif' height='10px'>";
o.appendChild(f);
k.appendChild(o);
if(!a){d.style.width=MVUtil.pixel(b-MVInfoWindowStyle4.MultiFeatureListTotalMarginWidth);
d.style.height=MVUtil.pixel(u-MVInfoWindowStyle4.TotalMarginHeight);
d.style.overflow="auto";
}return v;
};
MVInfoWindowStyle4.getPageDirection=function(f){if(MVInfoWindowStyle4.pageDirection==null){var g=document.createElement("table");
var b=document.createElement("tr");
var a=document.createElement("td");
var k=document.createElement("td");
var d=document.createElement("tbody");
g.cellSpacing=0;
g.cellPadding=0;
a.innerHTML="fsdfsds";
k.innerHTML="p";
d.appendChild(b);
g.appendChild(d);
b.appendChild(a);
b.appendChild(k);
f.appendChild(g);
var h=a.offsetLeft;
if(h==0){MVInfoWindowStyle4.pageDirection=true;
}else{MVInfoWindowStyle4.pageDirection=false;
}f.removeChild(g);
}if(!MVInfoWindowStyle4.pageDirection){MVInfoWindowStyle4.tabEnableStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_start_n_r.png";
MVInfoWindowStyle4.tabEnableMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_mid_n_r.png";
MVInfoWindowStyle4.tabEnableEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_end_n_r.png";
MVInfoWindowStyle4.tabDisableStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_start_d_r.png";
MVInfoWindowStyle4.tabDisableMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_mid_d_r.png";
MVInfoWindowStyle4.tabDisableEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_end_d_r.png";
MVInfoWindowStyle4.tabSelectedStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_start_a_r.png";
MVInfoWindowStyle4.tabSelectedMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_mid_a_r.png";
MVInfoWindowStyle4.tabSelectedEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/t3_above_end_a_r.png";
MVInfoWindowStyle4.tabContentHeadStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptts_r.png";
MVInfoWindowStyle4.tabContentHeadMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptt_r.png";
MVInfoWindowStyle4.tabContentHeadEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptte_r.png";
MVInfoWindowStyle4.tabContentMidStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/pts_r.png";
MVInfoWindowStyle4.tabContentMidMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptc_r.png";
MVInfoWindowStyle4.tabContentMidEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/pte_r.png";
MVInfoWindowStyle4.tabContentFooterStartImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptbs_r.png";
MVInfoWindowStyle4.tabContentFooterMidImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptb_r.png";
MVInfoWindowStyle4.tabContentFooterEndImgURL=MVGlobalVariables.imgFilePath+"infoicons/ptbe_r.png";
}};
MVInfoWindowStyle4.getRealWithOfOneTab=function(b,f,a){var h=0;
var g=document.createElement("a");
var l=document.createElement("div");
l.style.position="absolute";
g.style.cursor="pointer";
g.style.fontFamily="Tahoma";
g.style.fontSize="11px";
g.style.fontWeight="bold";
b.appendChild(l);
l.appendChild(g);
var d=(a-9-36)/6;
d=d-d%1+1;
if(d>f.title.length){d=f.title.length;
}g.innerHTML=f.title.replace(/\s/g,"&nbsp;");
h=l.offsetWidth+9+36;
while(h>a){var k=f.title.substring(0,d).replace(/\s/g,"&nbsp;")+"..";
g.innerHTML=k;
h=l.offsetWidth+9+36;
f.showTitle=k;
d--;
}b.removeChild(l);
return h;
};
MVInfoWindowStyle4.getOrignalWithOfOneTab=function(a,b){var f=0;
var d=document.createElement("a");
var k=document.createElement("div");
var g=10;
var h=20;
k.style.position="absolute";
d.style.cursor="pointer";
d.style.fontFamily="Tahoma";
d.style.fontSize="11px";
d.style.fontWeight="bold";
d.style.whiteSpace="nowrap";
a.appendChild(k);
k.appendChild(d);
d.innerHTML=b.title.replace(/\s/g,"&nbsp;");
f=k.offsetWidth+g+h;
a.removeChild(k);
return f;
};
MVInfoWindowStyle4.groupingTabs=function(h,k){var u;
var r=new Array();
var a;
var o=0;
var g=false;
for(var l=0;
l<h.length;
l++){r.push([l,h[l]]);
o=o+h[l];
}r=r.sort(function(z,w){return w[1]-z[1];
});
if(o%k==0){a=o/k;
}else{a=(o-o%k)/k+1;
}for(var n=1;
n<=h.length;
n++){var v=new Array(n);
var s=0;
var f=r.slice(0);
u=new Array(n);
for(var b=0;
b<u.length;
b++){u[b]=new Array();
v[b]=0;
}var t=0;
while(true){for(var d=t;
d<n;
d++){for(var m=0;
m<f.length;
m++){v[d]+=f[m][1];
if(s!=0){v[d]-=19;
}if(v[d]>k){v[d]-=f[m][1];
if(s!=0){v[d]+=19;
}if(m==f.length-1){t=d+1;
}}else{u[d][s]=f[m][0];
f.splice(m,1);
break;
}}}if(f.length==0){break;
}if(t==n){break;
}s++;
}if(f.length==0){break;
}}return u;
};
function MVNSDP(a){this.nsdp_id=a;
this.nsdp_theme=null;
this.nsdp_keycol=null;
this.nsdp_rendersty=null;
this.nsdp_labelsty=null;
this.nsdp_params=null;
this.nsdp_timeout=20;
this.nsdp_smfo=true;
}MVNSDP.prototype.setTheme=function(a){this.nsdp_theme=a;
};
MVNSDP.prototype.setKeyColumn=function(a){this.nsdp_keycol=a;
};
MVNSDP.prototype.setRenderStyle=function(a){this.nsdp_rendersty=a;
};
MVNSDP.prototype.setLabelStyle=function(a){this.nsdp_labelsty=a;
};
MVNSDP.prototype.setShowMatchedFeatureOnly=function(a){this.nsdp_smfo=a;
};
MVNSDP.prototype.setParameters=function(a){this.nsdp_params=a;
};
MVNSDP.prototype.setTimeout=function(a){this.nsdp_timeout=a;
};
MVNSDP.prototype.getFlatString=function(){var d="{";
d+='"nsdp_id":"'+this.nsdp_id+'",';
d+='"nsdp_theme":"'+this.nsdp_theme+'",';
d+='"nsdp_keycol":"'+this.nsdp_keycol+'",';
if(this.nsdp_smfo!=null&&this.nsdp_smfo==false){d+='"nsdp_smfo":"'+this.nsdp_smfo+'",';
}if(this.nsdp_rendersty!=null){d+='"nsdp_rendersty":"'+this.nsdp_rendersty+'",';
}if(this.nsdp_labelsty!=null){d+='"nsdp_labelsty":"'+this.nsdp_labelsty+'",';
}d+='"nsdp_timeout":"'+this.nsdp_timeout+'"';
if(this.nsdp_params==null){return d+="}";
}d+=',"nsdp_params":[';
var b=0;
for(p in this.nsdp_params){var f=this.nsdp_params[p];
var a=MVUtil.strReplaceAll(f,'"','\\"');
d+='{"'+p+'":"'+a+'"},';
b++;
}if(b>0){d=d.substr(0,d.length-1);
}d+="]}";
return d;
};
MVNSDP.prototype.getXML=function(f){var b='<ns_data_provider provider_id="'+this.nsdp_id+'" ';
b+='time_out="'+this.nsdp_timeout+'">';
b+='<for_theme name="'+this.nsdp_theme+'"/>';
var a=null;
if(this.nsdp_rendersty!=null){a=this.nsdp_rendersty;
}else{if(f&&f.renderStyle!=null){a=f.renderStyle;
}}if(a){b+='<custom_rendering_style name="'+a+'"/>';
}b+='<join spatial_key_column="'+this.nsdp_keycol+'"/>';
if(this.nsdp_smfo!=null&&this.nsdp_smfo==false){b+="<display_unmatched_features>true</display_unmatched_features>";
}if(this.nsdp_params!=null){b+="<parameters>";
for(p in this.nsdp_params){var d=null;
if(p=="xml"){d=this.nsdp_params[p].replace(/</g,"&lt;");
}else{d=this.nsdp_params[p];
}b+='<parameter name="'+p+'" value="'+d+'"/>';
}b+="</parameters>";
}b+="</ns_data_provider>";
return b;
};
function MVXMLStyle(a,b){this.name=a;
this.xmlDef=b;
}MVXMLStyle.prototype.getXMLString=function(){var a='<style name="'+this.name+'">'+this.xmlDef+"</style>";
return a;
};
function MVStyleColor(a,d,b){this.name=a;
this.type="color";
this.description=null;
if(d==null){this.fill=null;
}else{if(d.charAt(0)=="#"){this.fill=d.substring(1,d.length);
}else{this.fill=d;
}}this.fill_opacity=255;
if(b==null){this.stroke=null;
}else{if(b.charAt(0)=="#"){this.stroke=b.substring(1,b.length);
}else{this.stroke=b;
}}this.stroke_opacity=255;
this.stroke_width=1;
}MVStyleColor.prototype.setStroke=function(a){if(a==null){this.stroke=null;
}else{if(a.charAt(0)=="#"){this.stroke=a.substring(1,a.length);
}else{this.stroke=a;
}}};
MVStyleColor.prototype.setStrokeOpacity=function(a){this.stroke_opacity=a;
};
MVStyleColor.prototype.setFill=function(a){if(a==null){this.fill=null;
}else{if(a.charAt(0)=="#"){this.fill=a.substring(1,a.length);
}else{this.fill=a;
}}};
MVStyleColor.prototype.setFillOpacity=function(a){this.fill_opacity=a;
};
MVStyleColor.prototype.setDescription=function(a){this.description=a;
};
MVStyleColor.prototype.setStrokeWidth=function(a){this.stroke_width=a;
};
MVStyleColor.prototype.getXMLString=function(){var g=(this.stroke==null)?"":"stroke:0x"+this.stroke+";";
var h=(this.fill==null)?"":"fill:0x"+this.fill+";";
var b=this.stroke_opacity<255?"stroke-opacity:"+this.stroke_opacity+";":"";
var k=this.fill_opacity<255?"fill-opacity:"+this.fill_opacity+";":"";
var a=this.stroke_width!=1?"stroke-width:"+this.stroke_width:"";
var d='<style name="'+this.name+'"><svg width="1in" height="1in"><g class="color" style="'+g+b+h+k+a+'"></g></svg></style>';
return d;
};
function MVStyleMarker(a,b){this.name=a;
if(b==null){this.type="image";
}else{this.type=b.toLowerCase();
}this.description=null;
this.fill=null;
this.fill_opacity=255;
this.stroke=null;
this.stroke_opacity=255;
this.stroke_width=1;
this.imageUrl=null;
this.vector=null;
this.width=16;
this.height=16;
}MVStyleMarker.prototype.setName=function(a){if(a!=null){this.name=a;
}};
MVStyleMarker.prototype.setSize=function(b,a){if(b!=null){this.width=b;
}if(a!=null){this.height=a;
}};
MVStyleMarker.prototype.setImageUrl=function(d){if(d==null){this.imageUrl=null;
}else{if(d.indexOf("://")<0){if(d.indexOf("/")==0){d=document.location.protocol+"//"+document.location.host+d;
}else{var b=document.location+"";
var a=b.lastIndexOf("/");
if(a>0){b=b.substring(0,a+1);
}d=b+d;
}}this.imageUrl=d;
}};
MVStyleMarker.prototype.setStrokeColor=function(b,a){if(b==null){this.stroke=null;
}else{if(b.charAt(0)=="#"){this.stroke=b.substring(1,b.length);
}else{this.stroke=b;
}}this.stroke_opacity=a;
};
MVStyleMarker.prototype.setFillColor=function(b,a){if(b==null){this.fill=null;
}else{if(b.charAt(0)=="#"){this.fill=b.substring(1,b.length);
}else{this.fill=b;
}}if(a!=null){this.fill_opacity=a;
}};
MVStyleMarker.prototype.setDescription=function(a){this.description=a;
};
MVStyleMarker.prototype.setStrokeWidth=function(a){this.stroke_width=a;
};
MVStyleMarker.prototype.setVectorShape=function(a){if(a==null){this.vector=null;
}else{this.vector=a;
}};
MVStyleMarker.prototype.getXMLString=function(){var h="width:"+this.width+";height:"+this.height+";";
var k=(this.stroke==null)?"":"stroke:0x"+this.stroke+";";
var l=(this.fill==null)?"":"fill:0x"+this.fill+";";
var d=this.stroke_opacity<255?"stroke-opacity:"+this.stroke_opacity+";":"";
var m=this.fill_opacity<255?"fill-opacity:"+this.fill_opacity+";":"";
var a=this.stroke_width!=1?"stroke-width:"+this.stroke_width:"";
var b="";
if(this.type=="image"){b='  <image_marker url="'+this.imageUrl+'" />';
}else{if(this.type=="vector"){if(this.vector.charAt(0)=="c"||this.vector.charAt(0)=="C"){b='  <circle cx="0" cy="0" r="1"/>';
}else{b='  <polyline points="'+this.vector+'"/>';
}}}var g='<style name="'+this.name+'"><svg width="1in" height="1in"><g class="marker" style="'+h+k+d+l+m+a+'">'+b+"</g></svg></style>";
return g;
};
function MVBucketSeries(a){this.defaultRenderingStyle=null;
this.buckets=new Array();
this.scheme=a;
if(a!="SCHEME_CUSTOM"&&a!="SCHEME_EQUAL_INTERVAL"){this.scheme="SCHEME_CUSTOM";
}}MVBucketSeries.prototype.setBuckets=function(a){this.buckets=a;
};
MVBucketSeries.prototype.getBuckets=function(){return this.buckets;
};
MVBucketSeries.prototype.getScheme=function(){return scheme;
};
MVBucketSeries.prototype.setDefaultRenderingStyle=function(a){this.defaultRenderingStyle=a;
};
MVBucketSeries.prototype.getXMLString=function(){var d=(this.defaultRenderingStyle==null)?"":' default_style="'+this.defaultRenderingStyle+'" ';
var g="<Buckets"+d+">";
for(var f=0;
f<this.buckets.length;
f++){var a=this.buckets[f];
if(a!=null){g+=a.getXMLString();
}}g+="</Buckets>";
return g;
};
function MVBucketStyle(a,b){this.name=a;
this.buckets=b;
}MVBucketStyle.prototype.getXMLString=function(){var a='<style name="'+this.name+'"><AdvancedStyle><BucketStyle>';
a+=this.buckets.getXMLString()+"</BucketStyle></AdvancedStyle></style>";
return a;
};
function MVNumericRangedBucket(a,f,d,b){this.low=a;
this.high=f;
this.renderingStyle=d;
this.label=b;
}MVNumericRangedBucket.prototype.getXMLString=function(){var b=(this.label==null)?"":'label="'+this.label+'" ';
var g="<RangedBucket "+b;
var a=(this.low==null)?"":'low="'+this.low+'" ';
var f=(this.high==null)?"":'high="'+this.high+'" ';
var d=(this.renderingStyle==null)?"":'style="'+this.renderingStyle+'" ';
g+=a+f+d;
g+="/>";
return g;
};
function MVMapDecoration(f,h,g,d,a,b,k){this.mapControl=null;
this.html=null;
if(f){if(f.isMapControl){f.insideMapDecoration=true;
f.mapDec=this;
this.mapControl=f;
}else{if(f.substr){this.html=f;
}}}this.shouldAdjustCopyright=false;
if(typeof(h)!="number"&&typeof(g)!="number"){this.shouldAdjustCopyright=true;
}if(typeof(h)=="number"){this.left=h;
}else{this.left=1;
if(!b&&d){b=-d;
}}if(typeof(g)=="number"){this.top=g;
}else{this.top=1;
if(!k&&a){k=-a;
}}this.width=d;
this.height=a;
this.fixedDiv=document.createElement("div");
this.fixedDiv.id=null;
this.fixedDiv.isMapDecoration=true;
this.parent=null;
this.collapsible=false;
this.isPrintable=false;
this.EventListeners=new Object();
this.mouseclickListener=null;
this.mouseoverListener=null;
this.mouseoutListener=null;
this.onCollapseListener=null;
this.afterCollapseListener=null;
this.onRestoreListener=null;
this.afterRestoreListener=null;
this.dragStartListener=null;
this.dragListener=null;
this.dragEndListener=null;
this.id=null;
this.visible=true;
this.xOffset=0;
this.yOffset=0;
this.titleheight=(MVGlobalVariables.browser=="IF")?MVGlobalVariables.toolButtonW+2:MVGlobalVariables.toolButtonW;
this.stepWidth=0;
this.stepHeight=0;
this.stepLeft=40;
this.stepTop=0;
this.titlediv=null;
this.icon=null;
this.scrollId=null;
this.enablePropagation=false;
this.minimizeWhenCreated=false;
this.titleText=null;
this.titleIcon=null;
this.titleInfo=null;
this.buffer=(MVGlobalVariables.browser=="IF")?5:7;
this.collapsed=false;
this.origTop=0;
this.origLeft=0;
this.setOffset(b,k);
this.minimizedIcon=null;
this.movable=false;
this.cursorStyle=null;
this.style={borderStyle:"1px solid #636661",titleBgImg:"title_bg.png",titleBgImgMO:"title_bg_over.png",titleBgImgMD:"title_bg_over.png",minBtnImg:"button_minimize.gif",minBtnImgMO:"button_minimize.gif",minBtnImgMD:"button_minimize.gif",resBtnImg:"button_restore.gif",resBtnImgMO:"button_restore.gif",resBtnImgMD:"button_restore.gif",dragIconImg:"pan.png"};
}MVMapDecoration.prototype.setOffset=function(a,b){if(!a){a=0;
}if(!b){b=0;
}this.xOffset=a;
this.yOffset=b;
};
MVMapDecoration.prototype.setPosition=function(d,b,a,f){this.shouldAdjustCopyright=false;
if(!a){a=0;
}if(!f){f=0;
}this.xOffset=a;
this.yOffset=f;
if(typeof(d)=="number"){this.left=d;
}else{this.left=1;
if(!a&&this.width){a=-this.width;
}}if(typeof(b)=="number"){this.top=b;
}else{this.top=1;
if(!f&&this.height){f=-this.height;
}}if(!this.parent){return;
}if(this.collapsible){if(!this.collapsed){this.initPosition(this.contentdiv);
}}else{this.initPosition(this.fixedDiv);
}};
MVMapDecoration.prototype.setPrintable=function(a){this.isPrintable=a;
};
MVMapDecoration.prototype.setCollapsible=function(b,d,a){this.collapsible=b;
this.minimizeWhenCreated=d;
if(a!=undefined||a){if(a.borderStyle){this.style.borderStyle=a.borderStyle;
}if(a.titleBgImg){this.style.titleBgImg=a.titleBgImg;
}if(a.titleBgImgMO){this.style.titleBgImgMO=a.titleBgImgMO;
}else{if(a.titleBgImg){this.style.titleBgImgMO=a.titleBgImg;
}}if(a.titleBgImgMD){this.style.titleBgImgMD=a.titleBgImgMD;
}else{this.style.titleBgImgMD=this.style.titleBgImgMO;
}if(a.minBtnImg){this.style.minBtnImg=a.minBtnImg;
}if(a.minBtnImgMO){this.style.minBtnImgMO=a.minBtnImgMO;
}else{if(a.minBtnImg){this.style.minBtnImgMO=a.minBtnImg;
}}if(a.minBtnImgMD){this.style.minBtnImgMD=a.minBtnImgMD;
}else{this.style.minBtnImgMD=this.style.minBtnImgMO;
}if(a.resBtnImg){this.style.resBtnImg=a.resBtnImg;
}if(a.resBtnImgMO){this.style.resBtnImgMO=a.resBtnImgMO;
}else{if(a.resBtnImg){this.style.resBtnImgMO=this.style.resBtnImg;
}}if(a.resBtnImgMD){this.style.resBtnImgMD=a.resBtnImgMD;
}else{this.style.resBtnImgMD=this.style.resBtnImgMO;
}}};
MVMapDecoration.prototype.setTitleBar=function(a,b,d){if(a){this.titleText=a;
}if(b){if(b){this.titleIcon=b;
this.style.resBtnImg=b;
this.style.minBtnImg=b;
}}if(!d&&a){d=a;
}this.titleInfo=d;
};
MVMapDecoration.prototype.setVisible=function(a){this.visible=a;
if(this.parent!=null){if(this.parent.displayed){this.changeVisibility();
}if(this.isPrintable){this.parent.printReset();
}if(this.fixedDiv.overview||this.collapsed){this.parent.adjustCopyrightPosition(this.parent);
}if(a&&this.shouldAdjustCopyright&&!this.collapsed){this.parent.adjustCopyrightPosition(this.parent);
}}};
MVMapDecoration.prototype.isVisible=function(){return this.visible;
};
MVMapDecoration.prototype.addEventListener=function(a,b){this.setEventListener(a,b);
};
MVMapDecoration.prototype.setEventListener=function(a,b){if(a==MVEvent.MOUSE_CLICK){this.mouseclickListener=b;
}else{if(a==MVEvent.MOUSE_OVER){this.mouseoverListener=b;
}else{if(a==MVEvent.MOUSE_OUT){this.mouseoutListener=b;
}else{if(a==MVEvent.COLLAPSE){this.onCollapseListener=b;
}else{if(a==MVEvent.AFTER_COLLAPSE){this.afterCollapseListener=b;
}else{if(a==MVEvent.RESTORE){this.onRestoreListener=b;
}else{if(a==MVEvent.AFTER_RESTORE){this.afterRestoreListener=b;
}else{if(a==MVEvent.DRAG_START){this.dragStartListener=b;
}else{if(a==MVEvent.DRAG){this.dragListener=b;
}else{if(a==MVEvent.DRAG_END){this.dragEndListener=b;
}}}}}}}}}}};
MVMapDecoration.prototype.attachEventListener=function(a,b){MVUtil.attachEventListener(this.EventListeners,a,b);
};
MVMapDecoration.prototype.detachEventListener=function(a,b){MVUtil.detachEventListener(this.EventListeners,a,b);
};
MVMapDecoration.prototype.getContainerDiv=function(){return this.fixedDiv;
};
MVMapDecoration.prototype.enableEventPropagation=function(a){this.enablePropagation=a;
};
MVMapDecoration.prototype.isCollapsed=function(){return this.collapsed;
};
MVMapDecoration.prototype.collapse=function(){if(this.collapsed){return;
}this.fixedDiv.style.visibility="hidden";
MVUtil.setLeftTop(this.contentdiv,this.parent.getPaneWidth()-this.titleheight-this.buffer,this.parent.getPaneHeight()-this.titleheight-this.buffer);
this.showElement=false;
if(this.scrollId){clearTimeout(this.scrollId);
}this.scrollId=null;
this.collapsed=true;
this.contentdiv.style.visibility="hidden";
if(this.visible){this.showMinimizedIcon();
}if(this.afterCollapseListener){this.afterCollapseListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.AFTER_COLLAPSE);
};
MVMapDecoration.prototype.setMouseCursorStyle=function(a){this.cursorStyle=a;
if(this.contentDiv){MVUtil.setCursor(this.contentDiv,a);
}else{if(this.fixedDiv){MVUtil.setCursor(this.fixedDiv,a);
}}};
MVMapDecoration.prototype.isDraggable=function(){return this.movable;
};
MVMapDecoration.prototype.setDraggable=function(a){this.shouldAdjustCopyright=false;
this.movable=a;
if(this.parent&&this==this.parent.draggedMapDecoration){this.stopDragging();
}if(this.parent){var b=this.fixedDiv;
if(this.collapsible){b=this.titlediv;
}if(this.movable){MVUtil.setCursor(b,"move");
}else{MVUtil.setCursor(b,"default");
}}};
MVMapDecoration.prototype.getPosition=function(){var d=this.contentdiv;
if(!this.collapsible){d=this.fixedDiv;
}var a=this.collapsed?this.origLeft:MVUtil.getLeft(d);
var b=this.collapsed?this.origTop:MVUtil.getTop(d);
return{x:a,y:b};
};
MVMapDecoration.prototype.initPosition=function(f,a){var b=(this.top==1)?this.xOffset-this.buffer/2:this.xOffset;
var d=(this.top==1)?this.yOffset-this.buffer/2:this.yOffset;
this.origTop=this.parent.getPaneHeight()*this.top+d;
this.origLeft=this.parent.getPaneWidth()*this.left+b;
if(!a){f.style.top=MVUtil.pixel(this.origTop);
f.style.left=MVUtil.pixel(this.origLeft);
}this.stepTop=this.stepLeft*(this.parent.getPaneHeight()-this.origTop)/(this.parent.getPaneWidth()-this.origLeft);
this.stepWidth=Math.ceil(this.stepLeft*this.width/(this.parent.getPaneWidth()-this.origLeft));
this.stepHeight=Math.ceil(this.stepLeft*this.height/(this.parent.getPaneWidth()-this.origLeft));
};
MVMapDecoration.prototype.init=function(d,h,a){this.id=d;
this.parent=h;
this.fixedDiv.id=this.id;
this.fixedDiv.style.zIndex=2000;
this.fixedDiv.style.position="absolute";
if(this.collapsible){this.contentdiv=document.createElement("div");
this.contentdiv.style.position="absolute";
this.contentdiv.style.zIndex=2000;
this.contentdiv.style.width=(this.width+this.buffer)+"px";
this.contentdiv.style.height=(this.height+this.buffer)+"px";
this.contentdiv.style.backgroundColor="white";
a.appendChild(this.contentdiv);
this.realContdiv=document.createElement("div");
this.realContdiv.style.position="absolute";
this.realContdiv.style.zIndex=2000;
this.realContdiv.style.left="3px";
this.realContdiv.style.top="3px";
this.realContdiv.style.width=this.width+"px";
this.realContdiv.style.height=this.height+"px";
this.realContdiv.style.border=this.style.borderStyle;
this.realContdiv.style.backgroundColor="white";
this.contentdiv.appendChild(this.realContdiv);
var m=document.createElement("div");
m.style.position="absolute";
m.style.left=MVUtil.pixel(0);
m.style.top=MVUtil.pixel(0);
m.style.width="100%";
m.style.height=this.titleheight+2+"px";
m.style.overflow="hidden";
this.titlediv=document.createElement("div");
this.titlediv.style.position="absolute";
this.titlediv.style.left=MVUtil.pixel(-1);
this.titlediv.style.top=MVUtil.pixel(-1);
this.titlediv.style.width="110%";
this.titlediv.style.height=this.titleheight+"px";
this.titlediv.style.border=this.style.borderStyle;
if(this.titleInfo){this.titlediv.title=this.titleInfo;
}m.appendChild(this.titlediv);
this.realContdiv.appendChild(m);
this.titleBg=document.createElement("img");
this.titleBg.style.width="100%";
this.titleBg.style.height="100%";
this.titleBg.src=MVUtil.getImageURL(this.style.titleBgImg);
MVUtil.disableElementSelection(this.titleBg);
this.titlediv.appendChild(this.titleBg);
var b=this;
var k=document.createElement("img");
this.icon=k;
k.style.position="absolute";
k.style.left=MVUtil.pixel(2);
k.style.top=MVUtil.pixel(1);
k.style.height=MVUtil.pixel(this.titleheight-3);
k.style.width=MVUtil.pixel(this.titleheight-3);
MVUtil.disableElementSelection(k);
this.titlediv.appendChild(k);
MVUtil.setListener(this.titlediv,"mousedown",function(o){if(b.movable){b.parent.draggedMapDecoration=b;
b.dragStartMouseLoc=MVUtil.getMouseXY(o);
b.dragStartLeft=MVUtil.getLeft(b.contentdiv);
b.dragStartTop=MVUtil.getTop(b.contentdiv);
MVUtil.setCursor(b.titlediv,"move");
if(b.dragStartListener){b.dragStartListener(b.getPosition());
}MVUtil.runListeners(b.EventListeners,MVEvent.DRAG_START,[b.getPosition()]);
}MVUtil.stopEvent(o);
});
if(this.movable){MVUtil.setCursor(this.titlediv,"move");
}MVUtil.setCursor(k,"pointer");
this.setIconImageListeners(false);
if(this.titleText){var l=document.createElement("div");
l.style.position="absolute";
l.style.left=MVUtil.pixel(this.titleheight);
l.style.top=MVUtil.pixel(-1);
l.style.width=MVUtil.pixel(this.width-2*this.titleheight);
l.style.height=MVUtil.pixel(this.titleheight);
l.style.fontSize=MVUtil.pixel(this.titleheight-(MVGlobalVariables.browser=="IF"?3:2));
this.titlediv.appendChild(l);
l.innerHTML="<center>"+this.titleText+"</center>";
}this.fixedDiv.style.left=MVUtil.pixel(0);
this.fixedDiv.style.top=this.titleheight+((MVGlobalVariables.browser=="IF")?-1:1)+"px";
this.fixedDiv.style.border=MVUtil.pixel(0);
if(MVGlobalVariables.browser=="NS"||MVGlobalVariables.browser=="IF"){this.fixedDiv.style.width=this.width-2+"px";
this.fixedDiv.style.height=(this.height-this.titleheight-1)+"px";
}else{this.fixedDiv.style.width=this.width-2+"px";
this.fixedDiv.style.height=(this.height-this.titleheight-2)+"px";
}if(this.html){this.fixedDiv.innerHTML=this.html;
}this.realContdiv.appendChild(this.fixedDiv);
this.showElement=true;
this.n=(this.height-this.titleheight)/this.stepHeight+1;
this.setListeners(this.realContdiv);
this.initPosition(this.contentdiv);
if(this.minimizeWhenCreated){this.collapse();
}else{if(this.fixedDiv.overview||this.shouldAdjustCopyright){this.parent.adjustCopyrightPosition(this.parent);
}}}else{if(this.shouldAdjustCopyright){this.parent.adjustCopyrightPosition(this.parent);
}if(this.html){this.fixedDiv.innerHTML=this.html;
}a.appendChild(this.fixedDiv);
this.initPosition(this.fixedDiv);
if(this.width){this.fixedDiv.style.width=MVUtil.pixel(this.width);
}if(this.height){this.fixedDiv.style.height=MVUtil.pixel(this.height);
}this.setListeners(this.fixedDiv);
var b=this;
var n=document.createElement("img");
n.src=MVUtil.getImageURL(this.style.dragIconImg);
MVUtil.setScaleDIVManner(n);
n.style.zIndex=9999;
n.style.left=MVUtil.pixel(0);
n.style.top=MVUtil.pixel(-20);
n.style.visibility="hidden";
if(MVGlobalVariables.browser=="NS"||MVGlobalVariables.browser=="SF"){MVUtil.setListener(n,"mousedown",function(o){if(b.movable){b.parent.draggedMapDecoration=b;
b.dragStartMouseLoc=MVUtil.getMouseXY(o);
b.dragStartLeft=MVUtil.getLeft(b.fixedDiv);
b.dragStartTop=MVUtil.getTop(b.fixedDiv);
if(b.dragStartListener){b.dragStartListener(b.getPosition());
}MVUtil.runListeners(b.EventListeners,MVEvent.DRAG_START,[b.getPosition()]);
MVUtil.stopEvent(o);
}});
}this.fixedDiv.appendChild(n);
var f=this.fixedDiv.onmouseover;
this.fixedDiv.onmouseover=function(o){if(f){f(o);
}if(b.movable){n.style.visibility="visible";
}};
var g=this.fixedDiv.onmouseout;
this.fixedDiv.onmouseout=function(o){if(g){g(o);
}if(b.parent.draggedMapDecoration!=b){n.style.visibility="hidden";
}};
if(this.movable){MVUtil.setCursor(this.fixedDiv,"move");
}else{MVUtil.setCursor(this.fixedDiv,"default");
}MVUtil.setListener(this.fixedDiv,"mousedown",function(o){if(b.movable){b.parent.draggedMapDecoration=b;
b.dragStartMouseLoc=MVUtil.getMouseXY(o);
b.dragStartLeft=MVUtil.getLeft(b.fixedDiv);
b.dragStartTop=MVUtil.getTop(b.fixedDiv);
if(b.dragStartListener){b.dragStartListener(b.getPosition());
}MVUtil.runListeners(b.EventListeners,MVEvent.DRAG_START,[b.getPosition()]);
MVUtil.trapEvent(o);
}else{if(!b.enablePropagation){MVUtil.trapEvent(o);
}}});
}if(this.mapControl){if(this.mapControl.setMouseCursorStyle&&this.cursorStyle){this.mapControl.setMouseCursorStyle(this.cursorStyle,"default");
}this.mapControl.init(this.fixedDiv,h);
this.mapControl.insideMapDecoration=true;
}if(!this.minimizeWhenCreated){this.changeVisibility();
}};
MVMapDecoration.prototype.setListeners=function(d){var b=this;
var a=function(f){if(!b.enablePropagation){MVUtil.trapEvent(f);
}};
if(this.divClickListener){MVUtil.detachEvent(d,"click",this.divClickListener,true);
}this.divClickListener=function(f){a(f);
var h=MVUtil.getMouseXY(f);
var g=b.dragStartMouseLoc;
if(b.mouseclickListener){b.parent.stopDragging();
if(!g||h.x===g.x&&h.y===g.y){b.mouseclickListener(f);
}}if(b.EventListeners[MVEvent.MOUSE_CLICK]!=null&&b.EventListeners[MVEvent.MOUSE_CLICK].length!=0){b.parent.stopDragging();
if(!g||h.x===g.x&&h.y===g.y){MVUtil.runListeners(b.EventListeners,MVEvent.MOUSE_CLICK,[f]);
}}b.dragStartMouseLoc=null;
};
MVUtil.attachEvent(d,"click",this.divClickListener,true);
d.onmouseover=function(f){a(f);
if(b.mouseoverListener){b.mouseoverListener(f);
}MVUtil.runListeners(b.EventListeners,MVEvent.MOUSE_OVER,[f]);
};
d.onmouseout=function(f){a(f);
if(b.mouseoutListener){b.mouseoutListener(f);
}MVUtil.runListeners(b.EventListeners,MVEvent.MOUSE_OUT,[f]);
};
d.ondblclick=a;
MVUtil.setListener(d,"mousedown",a);
MVUtil.setListener(d,"mouseup",function(f){a(f);
if(b.movable){b.stopDragging();
}});
d.onkeyup=a;
if(MVGlobalVariables.browser=="OS"){d.onkeypress=a;
}else{d.onkeydown=a;
}if(MVGlobalVariables.browser=="IF"){d.oncontextmenu=a;
d.onselectstart=a;
}};
MVMapDecoration.prototype.setIconImageListeners=function(b){var f;
if(this.titleIcon){f=this.titleIcon;
}else{if(b){f=MVUtil.getImageURL(this.style.resBtnImg);
}else{f=MVUtil.getImageURL(this.style.minBtnImg);
}}var g=null;
if(b){g=this.minimizedIcon;
}else{g=this.icon;
}g.src=f;
g.width=MVGlobalVariables.toolButtonW;
g.height=MVGlobalVariables.toolButtonH;
var h=this;
if(b){g.style.height=MVUtil.pixel(this.titleheight-3);
g.style.width=MVUtil.pixel(this.titleheight-3);
g.parentNode.onmouseover=MVUtil.closureWrapper(g.parentNode,function(){g.parentNode.style.backgroundImage="url("+MVUtil.getImageURL(h.style.titleBgImgMO)+")";
g.src=MVUtil.getImageURL(h.style.resBtnImgMO);
});
g.parentNode.onmouseout=MVUtil.closureWrapper(g.parentNode,function(){g.parentNode.style.backgroundImage="url("+MVUtil.getImageURL(h.style.titleBgImg)+")";
g.src=MVUtil.getImageURL(h.style.resBtnImg);
});
MVUtil.setListener(g,"mousedown",MVUtil.closureWrapper(g.parentNode,function(){g.parentNode.style.backgroundImage="url("+MVUtil.getImageURL(h.style.titleBgImgMD)+")";
g.src=MVUtil.getImageURL(h.style.resBtnImgMD);
}));
var d=this;
if(this.iconParentClickListener){MVUtil.detachEvent(g.parentNode,"click",this.iconParentClickListener,true);
}this.iconParentClickListener=function(k){MVUtil.stopEvent(k);
d.startScrollElement();
};
MVUtil.attachEvent(g.parentNode,"click",this.iconParentClickListener,true);
}else{var a=this.titleBg;
g.parentNode.onmouseover=MVUtil.closureWrapper(g.parentNode,function(){a.src=MVUtil.getImageURL(h.style.titleBgImgMO);
if(b){g.src=MVUtil.getImageURL(h.style.resBtnImgMO);
}else{g.src=MVUtil.getImageURL(h.style.minBtnImgMO);
}});
g.parentNode.onmouseout=MVUtil.closureWrapper(g.parentNode,function(){a.src=MVUtil.getImageURL(h.style.titleBgImg);
g.src=MVUtil.getImageURL(h.style.minBtnImg);
});
MVUtil.setListener(g,"mousedown",MVUtil.closureWrapper(g.parentNode,function(){a.src=MVUtil.getImageURL(h.style.titleBgImgMD);
g.src=MVUtil.getImageURL(h.style.minBtnImgMD);
}));
var d=this;
if(this.iconClickListener){MVUtil.detachEvent(g,"click",this.iconClickListener,true);
}this.iconClickListener=function(){d.startScrollElement();
};
MVUtil.attachEvent(g,"click",this.iconClickListener,true);
}};
MVMapDecoration.prototype.cleanUp=function(){this.mapControl=null;
if(this.minimizedIcon){if(this.iconParentClickListener){MVUtil.detachEvent(this.minimizedIcon.parentNode,"click",this.iconParentClickListener,true);
}MVUtil.destroyNode(this.minimizedIcon.parentNode,this.parent.errorHandler);
this.minimizedIcon=null;
}this.parent=null;
};
MVMapDecoration.prototype.refreshPosition=function(){this.setPosition(this.left,this.top,this.xOffset,this.yOffset);
};
MVMapDecoration.prototype.getPrintContainer=function(){var a=document.createElement("div");
a.innerHTML=this.html;
a.style.zIndex=2000;
a.style.position="absolute";
if(this.collapsible){a.style.right=MVUtil.pixel(0);
a.style.bottom=MVUtil.pixel(0);
a.style.width=MVUtil.pixel(this.width);
a.style.height=MVUtil.pixel(this.height-this.titleheight);
a.style.border="1px solid black";
a.style.backgroundColor="white";
}else{this.initPosition(a);
if(this.width){a.style.width=this.width;
}if(this.height){a.style.height=this.height;
}}return a;
};
MVMapDecoration.prototype._setTimeoutDispatcher=function(func){eval(func);
};
MVMapDecoration.prototype.changeVisibility=function(){if(this.visible){this.fixedDiv.style.visibility="visible";
}else{this.fixedDiv.style.visibility="hidden";
}if(this.collapsible){if(this.visible&&!this.collapsed){this.contentdiv.style.visibility="visible";
}else{this.contentdiv.style.visibility="hidden";
}if(!this.collapsed&&this.parent.overviewmap&&this.parent.overviewmap.mainmap&&this.fixedDiv.overview&&this.parent){this.parent.overviewmap.resetRectangle();
}if(this.minimizedIcon&&!this.visible){MVUtil.destroyNode(this.minimizedIcon.parentNode,this.parent.errorHandler);
this.minimizedIcon=null;
}else{if(this.visible&&this.collapsed){this.showMinimizedIcon();
}}}};
MVMapDecoration.prototype.startScrollElement=function(b){if(!this.showElement){var d=this.minimizedIcon;
MVUtil.destroyNode(d.parentNode,this.parent.errorHandler);
this.minimizedIcon=null;
this.contentdiv.style.visibility="visible";
}if(this.scrollId!=null&&this.scrollId!=""){return;
}var a=15;
if(this.showElement){if(this.onCollapseListener){this.onCollapseListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.COLLAPSE);
this.scrollId=this.setTimeout("this.scrollElement(-1)",10);
}else{if(this.onRestoreListener){this.onRestoreListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.RESTORE);
this.initPosition(this.contentdiv,true);
this.scrollId=this.setTimeout("this.scrollElement(1)",10);
}};
MVMapDecoration.prototype.showMinimizedIcon=function(){this.minimizedIcon=document.createElement("img");
var b=document.createElement("td");
b.style.border=this.style.borderStyle;
b.style.backgroundImage="url("+MVUtil.getImageURL(this.style.titleBgImg)+")";
b.appendChild(this.minimizedIcon);
if(this.titleInfo){b.title=this.titleInfo;
}MVUtil.setCursor(b,"pointer");
this.parent.toolBarContainer.appendChild(b);
var a=this.parent;
setTimeout(function(){a.adjustCopyrightPosition(a);
},100);
this.setIconImageListeners(true);
};
MVMapDecoration.prototype.scrollElement=function(l){var k=parseInt(this.contentdiv.style.height);
var h=parseInt(this.fixedDiv.style.height);
var d=parseInt(this.contentdiv.style.width);
var b=parseInt(this.fixedDiv.style.width);
var m=MVUtil.getTop(this.contentdiv);
var f=MVUtil.getLeft(this.contentdiv);
if(l<0){if(h>1){if(h>this.stepHeight){if(m<this.parent.getPaneHeight()){MVUtil.setLeftTop(this.contentdiv,f+this.stepLeft,m+this.stepTop);
this.scrollId=this.setTimeout("this.scrollElement(-1)",20);
}else{this.collapse();
}}else{this.collapse();
}}else{this.collapse();
}}if(l>0){h+=this.stepHeight;
b+=this.stepWidth;
k+=this.stepHeight;
d+=this.stepWidth;
m-=this.stepTop;
f-=this.stepLeft;
var g=false;
if(this.origTop<m){MVUtil.setLeftTop(this.contentdiv,f,m);
}else{g=true;
}if(g){this.showElement=true;
clearTimeout(this.scrollId);
this.scrollId=null;
this.setIconImageListeners(false);
MVUtil.setLeftTop(this.contentdiv,this.origLeft,this.origTop);
this.collapsed=false;
this.fixedDiv.style.visibility="visible";
if(this.fixedDiv.overview&&this.parent){var a=this.parent.getCenter();
this.parent.overviewmap.moveOnMainMap=true;
this.parent.overviewmap.submap.setCenter(a,true);
this.parent.overviewmap.moveOnMainMap=false;
this.parent.overviewmap.submap.display();
this.parent.overviewmap.resetRectangle();
}this.parent.adjustCopyrightPosition(this.parent);
if(this.afterRestoreListener){this.afterRestoreListener();
}MVUtil.runListeners(this.EventListeners,MVEvent.AFTER_RESTORE);
}else{this.scrollId=this.setTimeout("this.scrollElement(1)",20);
}}};
MVMapDecoration.prototype.setTimeout=function(timeoutHandler,elapseTime){var Ie="tempVar"+MV_timeoutCounter;
MV_timeoutCounter++;
eval(Ie+" = this;");
var oi=timeoutHandler.replace(/\\/g,"\\\\");
oi=oi.replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");'+Ie+" = null;",elapseTime);
};
MVMapDecoration.prototype.stopDragging=function(){var a=this.contentdiv;
if(!this.collapsible){a=this.fixedDiv;
}this.left=(MVUtil.getLeft(a)-this.xOffset)/this.parent.getPaneWidth();
this.top=(MVUtil.getTop(a)-this.yOffset)/this.parent.getPaneHeight();
if(this.parent.draggedMapDecoration==this){if(this.dragEndListener){this.dragEndListener(this.getPosition());
}MVUtil.runListeners(this.EventListeners,MVEvent.DRAG_END,[this.getPosition()]);
}this.parent.draggedMapDecoration=null;
};
MVMapDecoration.prototype.setLeftTop=function(b,a){var d=this.contentdiv;
if(!this.collapsible){d=this.fixedDiv;
}MVUtil.setLeftTop(d,b,a);
};
MVMapDecoration.prototype.destroy=function(){this.cleanUp();
if(this.divClickListener){if(this.realContdiv){MVUtil.detachEvent(this.realContdiv,"click",this.divClickListener,true);
}else{if(this.fixedDiv){MVUtil.detachEvent(this.fixedDiv,"click",this.divClickListener,true);
}}}if(this.icon){if(this.iconClickListener){MVUtil.detachEvent(this.icon,"click",this.iconClickListener,true);
}MVUtil.destroyNode(this.icon);
this.icon=null;
}this.iconClickListener=null;
this.divClickListener=null;
this.iconParentClickListener=null;
if(this.titleBg){MVUtil.destroyNode(this.titleBg);
this.titleBg=null;
}if(this.titlediv){MVUtil.destroyNode(this.titlediv);
this.titlediv=null;
}if(this.contentdiv){MVUtil.destroyNode(this.contentdiv);
this.contentdiv=null;
}if(this.fixedDiv){this.fixedDiv.onselectstart=null;
MVUtil.destroyNode(this.fixedDiv);
this.fixedDiv=null;
}if(this.realContdiv){this.realContdiv.onselectstart=null;
MVUtil.destroyNode(this.realContdiv);
this.realContdiv=null;
}this.parent=null;
};
function MVBarInfo(b,a){this.name=b;
this.color=null;
if(a){if(a.charAt(0)=="#"){this.color=a.substring(1,a.length);
}else{this.color=a;
}}this.color_opacity=255;
}function MVBarChartStyle(d,f,a,b){this.name=d;
this.width=f;
this.height=a;
this.bars=b;
this.minValue=null;
this.maxValue=null;
this.shareScale=true;
this.showXAxis=false;
}MVBarChartStyle.prototype.setMinValue=function(a){this.minValue=a;
};
MVBarChartStyle.prototype.setMaxValue=function(a){this.maxValue=a;
};
MVBarChartStyle.prototype.setShareScale=function(a){this.shareScale=a;
};
MVBarChartStyle.prototype.setShowXAxis=function(a){this.showXAxis=a;
};
MVBarChartStyle.prototype.getXMLString=function(){var d='<style name="'+this.name+'"><AdvancedStyle><BarChartStyle width="'+this.width+'" height="'+this.height+'"';
if(this.shareScale==true){d=d+' share_scale="true"';
}if(this.maxValue!=null&&this.minValue!=null){d=d+' min_value="'+this.minValue+'" max_value="'+this.maxValue+'"';
}if(this.showXAxis){d=d+' show_x_axis="true"';
}d=d+">";
if(this.bars!=null){for(var b=0;
b<this.bars.length;
b++){var a=this.bars[b];
d=d+' <Bar name="'+a.name+'"';
if(a.color!=null){d=d+' color="#'+a.color+'"';
}d=d+" />";
}}d+=" </BarChartStyle></AdvancedStyle></style>";
return d;
};
function MVPieSlice(b,a){this.name=b;
this.color=null;
if(a){if(a.charAt(0)=="#"){this.color=a.substring(1,a.length);
}else{this.color=a;
}}this.color_opacity=255;
}MVPieSlice.prototype.setColorOpacity=function(a){this.color_opacity=a;
};
function MVPieChartStyle(b,a,d){this.name=b;
this.radius=a;
this.slices=d;
}MVPieChartStyle.prototype.getXMLString=function(){var a='<style name="'+this.name+'"><AdvancedStyle><PieChartStyle pieradius="'+this.radius+'">';
if(this.slices!=null){for(var b=0;
b<this.slices.length;
b++){var d=this.slices[b];
if(d!=null){a=a+' <PieSlice name="'+d.name+'"';
if(d.color!=null){a=a+' color="#'+d.color+'" />';
}}}}a=a+" </PieChartStyle></AdvancedStyle></style>";
return a;
};
function MVCollectionBucket(f,b,d,a){if(d==null){this.type="string";
}else{this.type=d;
}if(a==null){this.delimiter=",";
}else{this.delimiter=a;
}this.renderingStyle=f;
this.label=b;
this.items=null;
}MVCollectionBucket.prototype.setItems=function(a){if(a==null){this.items=null;
}this.items=a;
};
MVCollectionBucket.prototype.getXMLString=function(){var a=(this.label==null)?"":'label="'+this.label+'" ';
var g="<CollectionBucket "+a;
var f=(this.type==null)?"":'type="'+this.type+'" ';
var b=(this.delimiter==null)?"":'delimiter="'+this.delimiter+'" ';
var d=(this.renderingStyle==null)?"":'style="'+this.renderingStyle+'" ';
g+=f+b+d+">"+this.items+"</CollectionBucket>";
return g;
};
function MVScaleBar(a){if(a==null||a=="undefined"){this.format="BOTH";
this.maxLength=(arguments.length==2&&typeof arguments[1]=="number")?arguments[1]:125;
this.transformToGeodetic=false;
}else{if(typeof a=="object"){this.format=a.format?a.format:"BOTH";
this.maxLength=(a.maxWidth&&(typeof a.maxWidth=="number"))?a.maxWidth:125;
this.transformToGeodetic=(a.transformToGeodetic&&(typeof a.transformToGeodetic=="boolean"))?a.transformToGeodetic:false;
}else{this.format="BOTH";
this.maxLength=(arguments.length==2&&typeof arguments[1]=="number")?arguments[1]:125;
this.transformToGeodetic=(typeof a=="boolean")?a:false;
}}this.type="MVScaleBar";
this.isMapControl=true;
this.insideMapDecoration=false;
this.textSize=11;
this.mvHandle=null;
this.initialized=false;
this.style={barStyle:"border-top:1px solid #AAAAAA;border-bottom:1px solid #555555;border-left:1px solid #AAAAAA;border-right:1px solid #555555;background-color:#D0E0F0",barHeight:3,textStyle:"font-family: Tahoma;font-size:11px;font-weight:bold"};
this.barSpacing=7;
}MVScaleBar.prototype.setStyle=function(a){if(a){if(a.barStyle){this.style.barStyle=a.barStyle;
}if(a.barHeight){this.style.barHeight=a.barHeight;
}if(a.textStyle){this.style.textStyle=a.textStyle;
}}};
MVScaleBar.prototype.init=function(f,b){this.div=f;
if(f.isMapDecoration){var a=f.offsetLeft;
var d=f.offsetTop;
b.scalebarPosition=4;
b.scalebarOffsetWidth=a;
b.scalebarOffsetHeight=d;
}this.initSacleBar(b);
};
MVScaleBar.prototype.initSacleBar=function(d,a,f){if(!a){d.scalectl=this;
}this.mvHandle=d;
if(!this.div){this.div=document.createElement("div");
this.div.style.zIndex=2000;
if(a){a.appendChild(this.div);
}else{d.base_div.appendChild(this.div);
}}this.fps=document.createElement("div");
this.metric=document.createElement("div");
MVUtil.setScaleDIVManner(this.div);
MVUtil.setScaleDIVManner(this.fps);
MVUtil.setScaleDIVManner(this.metric);
this.div.style.height=MVUtil.pixel(40);
this.div.style.width=MVUtil.pixel(125);
this.div.style.fontSize=MVUtil.pixel(5);
var b=this;
var g=function(k){var m=k.fpsLength;
var o=k.metricLength;
var n=Math.max(m,o);
var h=3;
b.setText(b.fps,k.fpsText);
b.fps.style.cssText=b.style.textStyle;
b.fps.style.position="absolute";
MVUtil.setDIVStyle(b.fps,4,0,n,h,10);
b.textSize=MVUtil.getNumber(b.fps.style.fontSize);
var l=h+b.textSize;
b.topBar=b.createBar(m,b.style.barHeight,3,l,b.style.barStyle);
b.bottomBar=b.createBar(o,b.style.barHeight,3,l+b.style.barHeight+b.barSpacing,b.style.barStyle);
b.setText(b.metric,k.metricText);
b.metric.style.cssText=b.style.textStyle;
b.metric.style.position="absolute";
MVUtil.setDIVStyle(b.metric,4,l+2*b.style.barHeight+b.barSpacing+2,n,0,10);
if(b.format=="METRIC"){b.div.appendChild(b.metric);
b.metric.style.top="0px";
b.bottomBar.style.top=l+"px";
b.topBar.style.visibility="hidden";
}else{if(b.format=="IMPERIAL"){b.div.appendChild(b.fps);
b.bottomBar.style.visibility="hidden";
}else{b.div.appendChild(b.metric);
b.div.appendChild(b.fps);
}}b.div.title=MVi18n.getInfoMessage("scaleBarInfoTip");
b.updateColor();
b.initialized=true;
if(f){f(b.div);
}};
this.decideScale(d,this.maxLength,g);
};
MVScaleBar.prototype.createBar=function(d,a,g,f,b){var h=document.createElement("div");
h.style.cssText=b;
h.style.position="absolute";
MVUtil.setLeftTop(h,g,f);
h.style.fontSize="1px";
h.style.width=MVUtil.pixel(d);
h.style.height=MVUtil.pixel(a);
this.div.appendChild(h);
return h;
};
MVScaleBar.prototype.updateColor=function(){if(!this.div){return;
}var a="black";
this.fps.style.color=a;
this.metric.style.color=a;
};
MVScaleBar.prototype.update=function(b){if(!this.div||!this.initialized){return;
}var a=this;
var d=function(f){var g=Math.max(f.fpsLength,f.metricLength);
a.setText(a.fps,f.fpsText);
a.setText(a.metric,f.metricText);
a.width=g+4;
a.topBar.style.width=MVUtil.pixel(f.fpsLength);
a.bottomBar.style.width=MVUtil.pixel(f.metricLength);
a.metric.style.width=MVUtil.pixel(f.metricLength+2);
a.fps.style.width=MVUtil.pixel(f.fpsLength+2);
};
this.decideScale(b,this.maxLength,d);
};
MVScaleBar.prototype.decideScale=function(m,C,h){var t;
var z;
var v;
var a;
var B;
var n;
var b=m.msi.getCSdistConvFactor();
var f=m.msi.getCSType();
var r=this;
var A=function(){a=r.round125(v);
if(a>=1000){var F=r.round125(v/1000);
var H=v/1000;
n=Math.round(r.maxLength*F/H);
B=MVUtil.formatNum(F)+" "+MVi18n.getInfoMessage("kilometers");
}else{n=Math.round(r.maxLength*a/v);
B=MVUtil.formatNum(a)+" "+MVi18n.getInfoMessage("meters");
}var D=v/1609.344;
var K=v*3.28084;
var J;
var I;
if(D>=1){var G=r.round125(D);
J=Math.round(r.maxLength*G/D);
I=MVUtil.formatNum(G)+" "+MVi18n.getInfoMessage("miles");
}else{var E=r.round125(K);
J=Math.round(r.maxLength*E/K);
I=MVUtil.formatNum(E)+" "+MVi18n.getInfoMessage("feet");
}return new MVScale(J,n,I,B);
};
if(f=="GEODETIC"){var s=function(D){z=D;
var F=6378137;
var E=0.9966471893352525;
var G=0.0033528106647474805;
v=MVScaleBar.calcu_dist(t,z,F,E,G);
h(A());
};
var w=function(D){t=D;
MVScaleBar.getRadiaLatLng(m.mapScreenCenterX+C/2,m.mapScreenCenterY,m,s);
};
MVScaleBar.getRadiaLatLng(m.mapScreenCenterX-C/2,m.mapScreenCenterY,m,w);
return;
}else{if(f=="PROJECTED"){if(this.transformToGeodetic==true){var l=C/2;
var k=m.mapCenterX-l/m.pixPerX;
var g=l/m.pixPerX+m.mapCenterX;
var d=m.mapCenterY;
var u=MVSdoGeometry.createLineString([k,d,g,d],m.srid);
var o=function(D){v=D;
h(A());
};
v=u.getLength("meter",true,m.baseURL+"/foi",o);
return;
}else{v=b*C/m.pixPerX;
}}else{if(f=="LOCAL"||(f=="UNDEFINED"&&b!=0)){v=b*C/m.pixPerX;
}else{if(f=="UNDEFINED"&&b==0){v=C/m.pixPerX;
MVGlobalVariables.mKilometers="";
MVGlobalVariables.mMiles="";
MVGlobalVariables.mMeters="";
MVGlobalVariables.mFeet="";
}}}}h(A());
};
MVScaleBar.prototype.round125=function(d){var a=d;
if(a>1){var b=0;
while(a>=10){a=a/10;
b=b+1;
}if(a>=5){a=5;
}else{if(a>=2){a=2;
}else{a=1;
}}while(b>0){a=a*10;
b=b-1;
}}return a;
};
MVScaleBar.prototype.setText=function(d,a){if(d.innerHTML!=a){if(d.parentNode){var b=d.parentNode;
b.removeChild(d);
d.innerHTML=a;
b.appendChild(d);
}else{d.innerHTML=a;
}}};
MVScaleBar.prototype.cleanUp=function(){this.mvHandle.scalectl=null;
};
MVScaleBar.getRadiaLatLng=function(h,f,a,d){var b=MVSdoGeometry.createPoint(0,0,a.srid);
b.sdo_point.x=(h-a.mapScreenCenterX)/a.pixPerX+a.mapCenterX;
b.sdo_point.y=a.mapCenterY-(f-a.mapScreenCenterY)/a.pixPerY;
var g=function(k){if(k){b=k;
}while(b.sdo_point.x<-180){b.sdo_point.x+=360;
}while(b.sdo_point.x>180){b.sdo_point.x-=360;
}b.sdo_point.x=(b.sdo_point.x)*Math.PI/180;
b.sdo_point.y=(b.sdo_point.y)*Math.PI/180;
d(b.sdo_point);
};
if(b.srid&&b.srid!=8307){b=a.transformGeom(b,8307,null,g);
}else{g();
}};
MVScaleBar.calcu_dist=function(w,v,K,s,r){var u;
var E;
var h;
var k;
var H;
var z;
var A;
var I;
var f;
var b;
var g;
var B;
var D;
var L;
var J;
var C;
var G;
var n;
var l;
var o;
var a;
var F=Math.PI/2;
if(F-Math.abs(w.y)<1e-10){L=w.y;
}else{L=Math.atan(s*Math.tan(w.y));
}if(F-Math.abs(v.y)<1e-10){J=v.y;
}else{J=Math.atan(s*Math.tan(v.y));
}E=(L+J)/2;
h=(L-J)/2;
u=Math.abs(w.x-v.x);
if(u>Math.PI){u=2*Math.PI-u;
}u/=2;
if(u<5e-8&&Math.abs(h)<5e-8){return 0;
}else{if((F-u<5e-8&&Math.abs(E)<5e-8)||F-Math.abs(h)<5e-8){return -1;
}}C=Math.sin(E);
G=Math.cos(E);
n=Math.sin(h);
l=Math.cos(h);
o=Math.sin(u);
k=n*n+o*o*(l*l-C*C);
H=Math.acos(1-2*k);
a=Math.sin(H);
z=2*(1-2*k);
A=2*C*C*l*l/(1-k);
I=2*n*n*G*G/k;
f=A+I;
b=A-I;
g=H/a;
B=4*g*g;
D=B*z;
var m=(D+(g-(D-z)/2)*f);
return K*a*(g-r*(g*f-b)/4+r*r*(f*m-b*(2*B+z*b)+B*f*b)/64);
};
function MVScale(a,d,b,f){this.fpsLength=a;
this.metricLength=d;
this.fpsText=b;
this.metricText=f;
}function MVNavigationPanel(f,a,d,b){this.type="MVNavigationPanel";
this.isMapControl=true;
if(MVGlobalVariables.smallMobileDevice&&f===undefined){f=0;
}else{if(f==undefined||f!=0&&f!=4&&f!=8){f=8;
}}this.panButtonFlag=f;
if(MVGlobalVariables.smallMobileDevice&&a===undefined){a=false;
}this.sliderBarFlag=a;
this.zoomButtonFlag=d;
if(MVGlobalVariables.smallMobileDevice&&b===undefined){b=false;
}this.zoomLevelBars=b;
this.control_panel_div=null;
this.navPosition=null;
this.mvHandle=null;
this.containerDiv=null;
this.initialized=false;
this.infoTipDivs=new Object();
this.infoTipTexts=null;
this.infoTipTextStyle=null;
var g=this;
this.hideInfoTimeOut;
this.enableZoomLevelInfoTip=true;
this.showInfoTip=function(){if(!g.enableZoomLevelInfoTip){return;
}clearTimeout(g.hideInfoTimeOut);
for(div in g.infoTipDivs){g.infoTipDivs[div].style.visibility="";
}};
this.hideInfoTip=function(){g.hideInfoTimeOut=setTimeout(g.doHideInfoTip,500);
};
this.doHideInfoTip=function(){for(div in g.infoTipDivs){g.infoTipDivs[div].style.visibility="hidden";
}};
this.offsetTop=10;
}MVNavigationPanel.prototype.setZoomLevelInfoTips=function(b,a){this.infoTipTexts=b;
this.infoTipTextStyle=a;
if(this.zoombarandpin){MVUtil.clearNode(this.zoombarandpin.div,this.mvHandle.errorHandler);
this.zoombarandpin=new MVZoomBarAndPin(this);
}};
MVNavigationPanel.prototype.enableZoomLevelInfoTips=function(a){this.enableZoomLevelInfoTip=a;
};
MVNavigationPanel.prototype.setNavPosition=function(a){this.navPosition=a;
};
MVNavigationPanel.prototype.init=function(f,a){if(f){this.containerDiv=f;
if(f.isMapDecoration){this.offsetTop=f.offsetTop;
}}if(this.control_panel_div){MVUtil.destroyNode(this.control_panel_div,a.errorHandler);
}this.control_panel_div=document.createElement("div");
this.control_panel_div.style.position="absolute";
this.control_panel_div.className="noprint";
this.control_panel_div.ondblclick=function(g){MVUtil.stopEvent(MVUtil.getEvent(g));
};
this.control_panel_div.onclick=function(g){MVUtil.stopEvent(MVUtil.getEvent(g));
};
this.containerDiv.appendChild(this.control_panel_div);
if(a){this.mvHandle=a;
a.navigationPanel=this;
}if(this.navPosition){if(this.navPosition.toLowerCase()=="east"){if(this.panButtonFlag==8){this.control_panel_div.style.left=MVUtil.pixel(this.mvHandle.getPaneWidth()-80);
}else{if(this.panButtonFlag==4){this.control_panel_div.style.left=MVUtil.pixel(this.mvHandle.getPaneWidth()-80);
}else{if(this.panButtonFlag==0){this.control_panel_div.style.left=MVUtil.pixel(this.mvHandle.getPaneWidth()-50);
}}}}else{if(this.panButtonFlag==8){this.control_panel_div.style.left=MVUtil.pixel(10);
}else{if(this.panButtonFlag==8){this.control_panel_div.style.left=MVUtil.pixel(10);
}else{if(this.panButtonFlag==0){this.control_panel_div.style.left=MVUtil.pixel(30);
}}}}this.control_panel_div.style.top=MVUtil.pixel(10);
}else{this.control_panel_div.style.left=MVUtil.pixel(0);
this.control_panel_div.style.top=MVUtil.pixel(0);
}this.control_panel_div.style.zIndex=2000;
MVUtil.setCursor(this.control_panel_div,"pointer");
this.panImgW=0;
this.panImgH=0;
var a=this.mvHandle;
this.navZoomMouseUp=function(g){if(a.marqueeZoomOn&&a.clearMarqueeRect){a.marqueeZoomRectangleTool.clear();
a.marqueeZoom();
}g=(g)?g:((window.event)?event:null);
MVUtil.stopEvent(g);
};
if(this.panButtonFlag!=false){this.addPanButtons();
}this.sliderBarW=0;
this.sliderBarH=0;
if(this.sliderBarFlag!=false){this.sliderBarW=MVGlobalVariables.sliderBarW;
this.sliderBarH=MVGlobalVariables.sliderBarH;
}this.zoomInOutW=0;
this.zoomInOutH=0;
if(this.zoomButtonFlag!=false){this.zoomInOutW=MVGlobalVariables.zoomInOutW;
this.zoomInOutH=MVGlobalVariables.zoomInOutH;
this.pZoomIn=new createDIVMarkerNode(this.control_panel_div,src=MVGlobalVariables.imgFilePath+"navicons/zoomin.gif",this.zoomInOutW,this.zoomInOutH,2000,MVi18n.getInfoMessage("zoomInInfoTip"));
var b=this.panButtonFlag>0?(this.panImgW*3-this.zoomInOutW)/2+1:0;
var d=this.panButtonFlag>0?this.panImgH*3+3:0;
MVUtil.setLeftTop(this.pZoomIn,b,d);
this.pZoomInMouseDownFun=function(g){g=(g)?g:((window.event)?event:null);
MVUtil.stopEvent(g);
if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.zoomIn();
};
MVUtil.attachEvent(this.pZoomIn,"mousedown",this.pZoomInMouseDownFun,true);
MVUtil.attachEvent(this.pZoomIn,"mouseup",this.navZoomMouseUp,true);
this.pZoomIn.onmouseover=this.showInfoTip;
this.pZoomIn.onmouseout=this.hideInfoTip;
this.pZoomOut=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/zoomout.gif",this.zoomInOutW,this.zoomInOutH,2000,MVi18n.getInfoMessage("zoomOutInfoTip"));
MVUtil.setLeftTop(this.pZoomOut,b,d+this.zoomInOutH+this.sliderBarH+1);
this.pZoomOutMouseDownFun=function(g){g=(g)?g:((window.event)?event:null);
MVUtil.stopEvent(g);
if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.zoomOut();
};
MVUtil.attachEvent(this.pZoomOut,"mousedown",this.pZoomOutMouseDownFun,true);
MVUtil.attachEvent(this.pZoomOut,"mouseup",this.navZoomMouseUp,true);
this.pZoomOut.onmouseover=this.showInfoTip;
this.pZoomOut.onmouseout=this.hideInfoTip;
}if(this.sliderBarFlag!=false){this.zoombarandpin=new MVZoomBarAndPin(this);
}this.initialized=true;
};
MVNavigationPanel.prototype.destroy=function(){if(this.pU){MVUtil.detachEvent(this.pU,"mousedown",this.pUMouseDownFun,true);
MVUtil.detachEvent(this.pU,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pU);
this.pUMouseDownFun=null;
this.pU=null;
}if(this.pL){MVUtil.detachEvent(this.pL,"mousedown",this.pLMouseDownFun,true);
MVUtil.detachEvent(this.pL,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pL);
this.pLMouseDownFun=null;
this.pL=null;
}if(this.pR){MVUtil.detachEvent(this.pR,"mousedown",this.pRMouseDownFun,true);
MVUtil.detachEvent(this.pR,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pR);
this.pRMouseDownFun=null;
this.pR=null;
}if(this.pD){MVUtil.detachEvent(this.pD,"mousedown",this.pDMouseDownFun,true);
MVUtil.detachEvent(this.pD,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pD);
this.pDMouseDownFun=null;
this.pD=null;
}if(this.pLU){MVUtil.detachEvent(this.pLU,"mousedown",this.pLUMouseDownFun,true);
MVUtil.detachEvent(this.pLU,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pLU);
this.pLUMouseDownFun=null;
this.pLU=null;
}if(this.pRU){MVUtil.detachEvent(this.pRU,"mousedown",this.pRUMouseDownFun,true);
MVUtil.detachEvent(this.pRU,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pRU);
this.pRUMouseDownFun=null;
this.pRU=null;
}if(this.pLD){MVUtil.detachEvent(this.pLD,"mousedown",this.pLDMouseDownFun,true);
MVUtil.detachEvent(this.pLD,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pLD);
this.pLDMouseDownFun=null;
this.pLD=null;
}if(this.pRD){MVUtil.detachEvent(this.pRD,"mousedown",this.pRDMouseDownFun,true);
MVUtil.detachEvent(this.pRD,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pRD);
this.pRDMouseDownFun=null;
this.pRD=null;
}if(this.pCenter){MVUtil.detachEvent(this.pCenter,"mousedown",this.pCenterMouseDownFun,true);
MVUtil.detachEvent(this.pCenter,"mouseup",this.navMouseUp,true);
MVUtil.destroyNode(this.pCenter);
this.pCenterMouseDownFun=null;
this.pCenter=null;
}if(this.pZoomIn){MVUtil.detachEvent(this.pZoomIn,"mousedown",this.pZoomInMouseDownFun,true);
MVUtil.detachEvent(this.pZoomIn,"mouseup",this.navZoomMouseUp,true);
MVUtil.destroyNode(this.pZoomIn);
this.pZoomInMouseDownFun=null;
this.pZoomIn=null;
}if(this.pZoomOut){MVUtil.detachEvent(this.pZoomOut,"mousedown",this.pZoomOutMouseDownFun,true);
MVUtil.detachEvent(this.pZoomOut,"mouseup",this.navZoomMouseUp,true);
MVUtil.destroyNode(this.pZoomOut);
this.pZoomOutMouseDownFun=null;
this.pZoomOut=null;
}this.navZoomMouseUp=null;
this.navMouseUp=null;
if(this.zoombarandpin){if(this.zoombarandpin.pZoomBar){MVUtil.destroyNode(this.zoombarandpin.pZoomBar);
this.zoombarandpin.pZoomBar=null;
}if(this.zoombarandpin.m_sliderBar){MVUtil.detachEvent(this.zoombarandpin.m_sliderBar,"mousedown",this.zoombarandpin.sliderMouseDownFun,true);
MVUtil.destroyNode(this.zoombarandpin.m_sliderBar);
this.sliderMouseDownFun=null;
this.zoombarandpin.m_sliderBar=null;
}if(this.zoombarandpin.div){MVUtil.detachEvent(this.zoombarandpin.div,"mousedown",this.zoombarandpin.mDownFun,true);
MVUtil.detachEvent(this.zoombarandpin.div,"mouseup",this.zoombarandpin.mUpFun,true);
MVUtil.detachEvent(this.zoombarandpin.div,"mousemove",this.zoombarandpin.mMoveFun,true);
this.zoombarandpin.mDownFun=null;
this.zoombarandpin.mUpFun=null;
this.zoombarandpin.mMoveFun=null;
MVUtil.destroyNode(this.zoombarandpin.div);
this.zoombarandpin.div=null;
}this.zoombarandpin=null;
}if(this.mapDec){delete this.mapDec;
}this.cleanUp();
};
MVNavigationPanel.prototype.addPanButtons=function(){this.panImgW=MVGlobalVariables.panImgW;
this.panImgH=MVGlobalVariables.panImgH;
var a=this.mvHandle;
this.navMouseUp=function(b){if(a.marqueeZoomOn&&a.clearMarqueeRect){a.marqueeZoomRectangleTool.clear();
a.marqueeZoom();
}b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
this.pU=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/north.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panNInfoTip"));
MVUtil.setLeftTop(this.pU,this.panImgW+1,0);
this.pUMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll(0,(a.getPaneWidth()+a.getPaneHeight())*(-0.25));
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pU,"mousedown",this.pUMouseDownFun,true);
MVUtil.attachEvent(this.pU,"mouseup",this.navMouseUp,true);
this.pL=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/west.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panWInfoTip"));
MVUtil.setLeftTop(this.pL,0,this.panImgH+1);
this.pLMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll((a.getPaneWidth()+a.getPaneHeight())*(-0.25),0);
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pL,"mousedown",this.pLMouseDownFun,true);
MVUtil.attachEvent(this.pL,"mouseup",this.navMouseUp,true);
this.pR=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/east.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panEInfoTip"));
MVUtil.setLeftTop(this.pR,this.panImgW*2+2,this.panImgH+1);
this.pRMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll((a.getPaneWidth()+a.getPaneHeight())*(0.25),0);
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pR,"mousedown",this.pRMouseDownFun,true);
MVUtil.attachEvent(this.pR,"mouseup",this.navMouseUp,true);
this.pD=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/south.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panSInfoTip"));
MVUtil.setLeftTop(this.pD,this.panImgW+1,this.panImgH*2+2);
this.pDMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll(0,(a.getPaneWidth()+a.getPaneHeight())*(0.25));
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pD,"mousedown",this.pDMouseDownFun,true);
MVUtil.attachEvent(this.pD,"mouseup",this.navMouseUp,true);
if(this.panButtonFlag==4){return;
}this.pLU=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/nw.gif",this.panImgW,this.panImgH,200,MVi18n.getInfoMessage("panNWInfoTip"));
MVUtil.setLeftTop(this.pLU,0,0);
this.pLUMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll((a.getPaneWidth()+a.getPaneHeight())*(-0.18),(a.getPaneWidth()+a.getPaneHeight())*(-0.18));
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pLU,"mousedown",this.pLUMouseDownFun,true);
MVUtil.attachEvent(this.pLU,"mouseup",this.navMouseUp,true);
this.pRU=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/ne.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panNEInfoTip"));
MVUtil.setLeftTop(this.pRU,this.panImgW*2+2,0);
this.pRUMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll((a.getPaneWidth()+a.getPaneHeight())*(0.18),(a.getPaneWidth()+a.getPaneHeight())*(-0.18));
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pRU,"mousedown",this.pRUMouseDownFun,true);
MVUtil.attachEvent(this.pRU,"mouseup",this.navMouseUp,true);
this.pLD=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/sw.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panSWInfoTip"));
MVUtil.setLeftTop(this.pLD,0,this.panImgH*2+2);
this.pLDMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll((a.getPaneWidth()+a.getPaneHeight())*(-0.18),(a.getPaneWidth()+a.getPaneHeight())*(0.18));
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pLD,"mousedown",this.pLDMouseDownFun,true);
MVUtil.attachEvent(this.pLD,"mouseup",this.navMouseUp,true);
this.pRD=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/se.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panSEInfoTip"));
MVUtil.setLeftTop(this.pRD,this.panImgW*2+2,this.panImgH*2+2);
this.pRDMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.smoothScroll((a.getPaneWidth()+a.getPaneHeight())*(0.18),(a.getPaneWidth()+a.getPaneHeight())*(0.18));
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pRD,"mousedown",this.pRDMouseDownFun,true);
MVUtil.attachEvent(this.pRD,"mouseup",this.navMouseUp,true);
if(a.originLocation){this.pCenter=new createDIVMarkerNode(this.control_panel_div,MVGlobalVariables.imgFilePath+"navicons/center.gif",this.panImgW,this.panImgH,2000,MVi18n.getInfoMessage("panCenterInfoTip"));
MVUtil.setLeftTop(this.pCenter,this.panImgW+1,this.panImgH+1);
this.pCenterMouseDownFun=function(b){if(a.marqueeZoomOn&&a.marqueeRectDone){a.clearMarqueeRect=true;
}a.setCenterAndZoomLevel(a.originLocation,a.originZoomLevel);
b=(b)?b:((window.event)?event:null);
MVUtil.stopEvent(b);
};
MVUtil.attachEvent(this.pCenter,"mousedown",this.pCenterMouseDownFun,true);
MVUtil.attachEvent(this.pCenter,"mouseup",this.navMouseUp,true);
}};
MVNavigationPanel.prototype.updateSliderBar=function(){if(!this.initialized){return;
}if(this.zoombarandpin&&this.zoombarandpin.m_sliderBar){var a=this.panImgH!=0?3:0;
this.zoombarandpin.m_sliderBar.style.top=MVUtil.pixel(this.panImgH*3+a+this.zoomInOutH+(this.sliderBarH-MVGlobalVariables.sliderH)*(this.mvHandle.maxZoom-this.mvHandle.zoomLevel)/this.mvHandle.maxZoom);
}};
MVNavigationPanel.prototype.cleanUp=function(){if(this.control_panel_div){MVUtil.destroyNode(this.control_panel_div,null);
}this.control_panel_div=null;
};
MVNavigationPanel.prototype.getMaxZoomLevel=function(){if(this.zoombarandpin.maxZoomlevel){return this.zoombarandpin.maxZoomleve;
}else{return this.parent.maxZoom;
}};
MVNavigationPanel.prototype.updateSlider=function(){if(this.zoombarandpin){MVUtil.clearNode(this.zoombarandpin.div,this.mvHandle.errorHandler);
this.zoombarandpin=new MVZoomBarAndPin(this);
}};
function MVZoomBarAndPin(m){var o=m;
this.div=document.createElement("div");
var b=o.panButtonFlag>0?(o.panImgW*3-o.sliderBarW)/2+1:0;
var r=o.panButtonFlag>0?o.panImgH*3+3+o.zoomInOutH:o.zoomInOutH;
this.pZoomBar=new createDIVMarkerNode(this.div,MVGlobalVariables.imgFilePath+"navicons/zoombar.gif",o.sliderBarW,o.sliderBarH,2000,MVi18n.getInfoMessage("sliderBarInfoTip"));
this.pZoomBar.onmouseover=m.showInfoTip;
this.pZoomBar.onmouseout=m.hideInfoTip;
MVUtil.setLeftTop(this.pZoomBar,b,r);
this.maxZoomlevel=o.mvHandle.maxZoom;
for(var f=0;
f<=o.mvHandle.maxZoom;
f++){var s=o.sliderBarW-4;
if(m.zoomLevelBars!=false&&o.mvHandle.maxZoom>0){var d=new createDIVMarkerNode(this.div,MVGlobalVariables.imgFilePath+"navicons/zoomBarHoriz.gif",s,10,1999);
MVUtil.setLeftTop(d,b+2,r+2+f*(o.sliderBarH-14)/o.mvHandle.maxZoom);
}for(tipLevel in m.infoTipTexts){if(parseInt(tipLevel)==(o.mvHandle.maxZoom-f)){this.infoDiv=document.createElement("div");
this.infoDiv.style.height=16;
this.infoDiv.style.position="absolute";
this.infoDiv.style.opacity=0.6;
this.infoDiv.style.filter="alpha(opacity = 60)";
this.infoDivTable=document.createElement("Table");
this.infoDivTable.style.direction="LTR";
this.infoDivTable.cellSpacing=0;
this.infoDivTable.cellPadding=0;
this.infoDivTable.style.border=0;
this.infoDivRow=this.infoDivTable.insertRow(0);
this.infoDivLeft=this.infoDivRow.insertCell(0);
this.infoDivCenter=this.infoDivRow.insertCell(1);
this.infoDivCenter.style.background="url("+MVGlobalVariables.imgFilePath+"navicons/tip_center.gif) repeat-x";
this.infoDivRight=this.infoDivRow.insertCell(2);
this.infoDivCenter.innerHTML=m.infoTipTexts[tipLevel];
this.infoDivCenter.style.fontSize="12px";
this.infoDivCenter.style.fontWeight="bold";
this.infoDivCenter.style.fontFamily="Verdana,Tahoma";
this.infoDivCenter.style.cssText=this.infoDivCenter.style.cssText+"; "+m.infoTipTextStyle;
this.infoDiv.appendChild(this.infoDivTable);
if(o.navPosition&&o.navPosition.toLowerCase()=="east"){this.infoDivLeft.innerHTML='<img border="0" src="'+MVGlobalVariables.imgFilePath+'navicons/tip_east_end.gif"/>';
this.infoDivRight.innerHTML='<img border="0" src="'+MVGlobalVariables.imgFilePath+'navicons/tip_east_start.gif"/>';
this.infoDivCenter.style.textAlign="left";
this.infoDivCenter.style.align="left";
this.infoDivCenter.style.direction="RTL";
if(MVGlobalVariables.browserClass==2){this.infoDiv.style.pixelRight=b-22;
if(o.mvHandle.maxZoom>0){this.infoDiv.style.pixelTop=r+f*(o.sliderBarH-16)/o.mvHandle.maxZoom;
}else{this.infoDiv.style.pixelTop=r+(o.sliderBarH-16)/2;
}}else{this.infoDiv.style.right=MVUtil.pixel(b-22);
if(o.mvHandle.maxZoom>0){this.infoDiv.style.top=MVUtil.pixel(r+f*(o.sliderBarH-16)/o.mvHandle.maxZoom);
}else{this.infoDiv.style.top=MVUtil.pixel(r+(o.sliderBarH-16)/2);
}}}else{this.infoDivLeft.innerHTML='<img border="0" src="'+MVGlobalVariables.imgFilePath+'navicons/tip_start.gif"/>';
this.infoDivRight.innerHTML='<img border="0" src="'+MVGlobalVariables.imgFilePath+'navicons/tip_end.gif"/>';
this.infoDivCenter.style.textAlign="right";
this.infoDivCenter.style.align="right";
if(o.mvHandle.maxZoom>0){MVUtil.setLeftTop(this.infoDiv,b+16,r+f*(o.sliderBarH-16)/o.mvHandle.maxZoom);
}else{MVUtil.setLeftTop(this.infoDiv,b+16,r+(o.sliderBarH-16)/2);
}}this.infoDiv.style.visibility="hidden";
this.infoDiv.zoomLevel=o.mvHandle.maxZoom-f;
this.div.appendChild(this.infoDiv);
m.infoTipDivs["div"+f]=this.infoDiv;
var n=function(l){clearTimeout(m.hideInfoTimeOut);
this.style.opacity=0.9;
this.style.filter="alpha(opacity = 90)";
this.style.zIndex=100;
};
var k=function(l){this.style.opacity=0.6;
this.style.filter="alpha(opacity = 60)";
m.hideInfoTimeOut=setTimeout(m.doHideInfoTip,500);
this.style.zIndex=0;
};
var a=function(l){m.mvHandle.zoomTo(this.zoomLevel);
l=(l)?l:((window.event)?event:null);
MVUtil.stopEvent(l);
};
this.infoDiv.onmouseover=MVUtil.closureWrapper(this.infoDiv,n);
this.infoDiv.onmouseout=MVUtil.closureWrapper(this.infoDiv,k);
MVUtil.attachEvent(this.infoDiv,"mousedown",MVUtil.closureWrapper(this.infoDiv,a),true);
}}}if(o.mvHandle.maxZoom>0){this.m_sliderBar=new createDIVMarkerNode(this.div,MVGlobalVariables.imgFilePath+"navicons/slider.gif",MVGlobalVariables.sliderW,MVGlobalVariables.sliderH,2002);
this.m_sliderBar.onmouseover=m.showInfoTip;
this.m_sliderBar.onmouseout=m.hideInfoTip;
MVUtil.setLeftTop(this.m_sliderBar,b,r+(o.sliderBarH-MVGlobalVariables.sliderH)*(o.mvHandle.maxZoom-o.mvHandle.zoomLevel)/o.mvHandle.maxZoom);
}o.control_panel_div.appendChild(this.div);
this.sPinY=Math.floor(MVGlobalVariables.sliderH/2);
var g=0;
var h=0;
this.mDownFun=function(u){o.mvHandle.mapmoveflag=false;
u=(u)?u:((window.event)?event:null);
var v=o.mvHandle.getEventCoords(u);
var A=v.top-o.zoombarandpin.sPinY-o.offsetTop;
var C=o.panImgH!=0?3:0;
var w=o.panImgH*3+C+o.zoomInOutH;
if(A<=w){A=w;
}else{if(A>=w+o.sliderBarH-MVGlobalVariables.sliderH){A=w+o.sliderBarH-MVGlobalVariables.sliderH;
}}var z=(o.sliderBarH-MVGlobalVariables.sliderH);
z=z/o.mvHandle.maxZoom;
var t=Math.floor((A-w)/z);
A=t*z+w;
var B=o.mvHandle.maxZoom-t;
o.mvHandle.zoomTo(B);
MVUtil.stopEvent(u);
if(o.mvHandle.marqueeZoomOn&&o.mvHandle.marqueeRectDone){o.mvHandle.clearMarqueeRect=true;
o.mvHandle.marqueeZoomRectangleTool.clear();
}if(o.zoombarandpin.m_sliderBar){o.zoombarandpin.m_sliderBar.style.top=MVUtil.pixel(A);
}};
this.mMoveFun=function(l){l=(l)?l:((window.event)?event:null);
o.mvHandle.mapmoveflag=false;
if(!o.zoombarandpin.mdownflg){return;
}var t=o.mvHandle.getEventCoords(l);
var u=t.top-g+h;
var v=o.panImgH!=0?3:0;
if(u<=o.panImgH*3+v+o.zoomInOutH){u=o.panImgH*3+v+o.zoomInOutH;
}else{if(u>=o.panImgH*3+v+o.zoomInOutH+o.sliderBarH-MVGlobalVariables.sliderH){u=o.panImgH*3+v+o.zoomInOutH+o.sliderBarH-MVGlobalVariables.sliderH;
}}if(o.zoombarandpin.m_sliderBar){o.zoombarandpin.m_sliderBar.style.top=MVUtil.pixel(u);
}MVUtil.stopEvent(l);
};
this.mUpFun=function(u){if(MVGlobalVariables.touchSupported){o.mvHandle.mapmoveflag=true;
}if(!o.zoombarandpin.mdownflg){return;
}u=(u)?u:((window.event)?event:null);
o.mvHandle.mapmoveflag=true;
o.zoombarandpin.mdownflg=false;
var z=0;
if(o.zoombarandpin.m_sliderBar){z=MVUtil.getTop(o.zoombarandpin.m_sliderBar);
}var B=o.panImgH!=0?3:0;
var v=o.panImgH*3+B+o.zoomInOutH;
var w=(o.sliderBarH-MVGlobalVariables.sliderH);
w=w/o.mvHandle.maxZoom;
var t=Math.round((z-v)/w);
z=t*w+v;
var A=o.mvHandle.maxZoom-t;
o.mvHandle.zoomTo(A);
if(o.zoombarandpin.m_sliderBar){o.zoombarandpin.m_sliderBar.style.top=MVUtil.pixel(z);
}o.mvHandle.zoomTo(A);
MVUtil.stopEvent(u);
if(o.mvHandle.marqueeZoomOn&&o.mvHandle.clearMarqueeRect){o.mvHandle.marqueeZoom();
}};
this.mOutFun=function(l){l=(l)?l:((window.event)?event:null);
o.mvHandle.mapmoveflag=true;
if(o.zoombarandpin.mdownflg){o.zoombarandpin.mUpFun(l);
}return false;
};
this.sliderMouseDownFun=function(l){l=(l)?l:((window.event)?event:null);
var t=o.mvHandle.getEventCoords(l);
g=t.top;
if(o.zoombarandpin.m_sliderBar){h=MVUtil.getTop(o.zoombarandpin.m_sliderBar);
}o.zoombarandpin.mdownflg=true;
MVUtil.stopEvent(l);
};
MVUtil.attachEvent(this.div,"mousedown",this.mDownFun,true);
MVUtil.attachEvent(this.div,"mouseup",this.mUpFun,true);
MVUtil.attachEvent(this.div,"mousemove",this.mMoveFun,true);
this.div.onmouseout=this.mOutFun;
if(this.m_sliderBar){MVUtil.attachEvent(this.m_sliderBar,"mousedown",this.sliderMouseDownFun,true);
}this.mdownflg=false;
}function MVCSTransformMercator(){}MVCSTransformMercator.csParameters=[{srid:54004,params:[0,0,1,0,0]},{srid:8307,params:[6378137,298.257223563]}];
MVCSTransformMercator.geodeticToMercator=function(g,m,r,t,n){var d=MVCSTransformMercator.getCSParameters(t);
var F=MVCSTransformMercator.getCSParameters(r);
if(!d||!F){MVi18n.reportError("MVCSTransformMercator.geodeticToMercator","MAPVIEWER-05522",r+"->"+t,n);
return null;
}var E=MVGeomUtil.getRadiansFromLatLon({x:g,y:m});
g=E.x;
m=E.y;
var B=d[3];
var s=d[4];
var o=d[2];
var C=d[1];
var D=F[0];
var w=1/F[1];
var A=Math.sqrt(2*w-w*w);
var l=B+D*o*(g-C);
var b=Math.sin(m);
var z=Math.tan(Math.PI/4+m/2);
var v=(1-A*b)/(1+A*b);
var u=A/2;
var h=Math.pow(v,u);
var k=s+D*o*Math.log(z*h);
return{x:l,y:k};
};
MVCSTransformMercator.mercatorToGeodetic=function(J,I,l,b,D){var n=MVCSTransformMercator.getCSParameters(l);
var R=MVCSTransformMercator.getCSParameters(b);
if(!n||!R){MVi18n.reportError("MVCSTransformMercator.mercatorToGeodetic","MAPVIEWER-05522",l+"->"+b,D);
return null;
}var C=n[3];
var s=n[4];
var A=n[2];
var d=n[1];
var Z=R[0];
var V=1/R[1];
var X=Math.sqrt(2*V-V*V);
var h=I;
var k=J;
var m=Math.E;
var L=Math.pow(m,((s-h)/(Z*A)));
var r=Math.PI/2-2*Math.atan2(L,1);
var K=Math.pow(X,4);
var H=Math.pow(X,6);
var G=Math.pow(X,8);
var Y=X*X/2;
var W=5*K/24;
var U=H/12;
var T=13*G/360;
var S=Math.sin(2*r);
var Q=7*K/48;
var P=29*H/240;
var O=811*G/11520;
var M=Math.sin(2*r);
var z=7*H/120;
var w=81*G/1120;
var v=Math.sin(6*r);
var u=4279*G/161280;
var o=Math.sin(8*r);
var F=r+(Y+W+U+T)*S+(Q+P+O)*M+(z+w)*v+u*o;
var g=((k-C)/(Z*A))+d;
return MVGeomUtil.getLatLonFromRadians({x:g,y:F});
};
MVCSTransformMercator.getCSParameters=function(a){for(var b=0;
b<MVCSTransformMercator.csParameters.length;
b++){if(MVCSTransformMercator.csParameters[b].srid==a){return MVCSTransformMercator.csParameters[b].params;
}}return null;
};
MVGlobalVariables.addCSTransFunc(54004,8307,function(a,d,b){return MVCSTransformMercator.mercatorToGeodetic(a,d,54004,8307,b);
});
MVGlobalVariables.addCSTransFunc(8307,54004,function(a,d,b){return MVCSTransformMercator.geodeticToMercator(a,d,8307,54004,b);
});
function MVZoomControl(b,a){this.mapview=b;
this.ldiff=0;
this.tdiff=0;
this.movedLeft=0;
this.movedTop=0;
this.mapLayer=a;
this.tileArray=null;
this.tileLayerDiv=null;
this.zoomStep=0.1;
this.interval=40;
this.zooming=false;
this.oldTilesLoaded=false;
this.timeouts=new Array();
this.scaling=false;
this.layerLeft=0;
this.layerTop=0;
this.parentLeft=0;
this.parentTop=0;
}MVZoomControl.prototype.computeTilesOffset=function(){var a=this.mapLayer.tileArray[0][0];
if(a&&a.parentNode){this.ldiff=-a.parentNode.offsetLeft;
this.tdiff=-a.parentNode.offsetTop;
this.movedLeft=-a.parentNode.parentNode.offsetLeft;
this.movedTop=-a.parentNode.parentNode.offsetTop;
}};
MVZoomControl.prototype.getScreenCor=function(b,k,h){var g=this.getPPXByZoomLevel(h);
var f=this.getPPYByZoomLevel(h);
var d=b-this.mapview.getPaneWidth()/2;
var a=k-this.mapview.getPaneHeight()/2;
return{x:d/g+this.mapview.mapCenterX,y:this.mapview.mapCenterY-a/f};
};
MVZoomControl.prototype.getScreenXY=function(a,g,f){var d=this.getPPXByZoomLevel(f);
var b=this.getPPYByZoomLevel(f);
return{x:(a-this.mapview.mapCenterX)*d+this.mapview.getPaneWidth()/2,y:(this.mapview.mapCenterY-g)*b+this.mapview.getPaneHeight()/2};
};
MVZoomControl.prototype.getPPXByZoomLevel=function(f){var d=this.mapview.msi.mapConfig.zoomLevels[f].tileImageWidth;
var a=this.mapview.msi.mapConfig.zoomLevels[f].tileWidth;
var b=d/a;
return b;
};
MVZoomControl.prototype.getPPYByZoomLevel=function(f){var a=this.mapview.msi.mapConfig.zoomLevels[f].tileImageHeight;
var b=this.mapview.msi.mapConfig.zoomLevels[f].tileHeight;
var d=a/b;
return d;
};
MVZoomControl.prototype.initZoomInfo=function(k,v,t){var o=this.getPPXByZoomLevel(k);
var n=this.getPPYByZoomLevel(k);
var g=this.getPPXByZoomLevel(v);
var b=this.getPPYByZoomLevel(v);
var m=this.mapview.msi.mapConfig.zoomLevels[k].tileImageWidth;
var w=this.mapview.msi.mapConfig.zoomLevels[k].tileImageWidth;
var r=this.mapview.msi.mapConfig.zoomLevels[k].tileImageWidth*g/o;
var f=this.mapview.msi.mapConfig.zoomLevels[k].tileImageHeight*b/n;
var h=MVUtil.getLeft(t)-this.movedLeft;
var u=MVUtil.getTop(t)-this.movedTop;
var l=this.getScreenCor(h-this.ldiff+this.movedLeft,u-this.tdiff+this.movedTop,k);
var s=this.getScreenXY(l.x,l.y,v);
var d=s.x+this.ldiff-this.movedLeft*g/o;
var a=s.y+this.tdiff-this.movedTop*g/o;
t.oldZoomInfo=new Object();
t.oldZoomInfo.lstart=h;
t.oldZoomInfo.tstart=u;
t.oldZoomInfo.lend=d;
t.oldZoomInfo.tend=a;
t.oldZoomInfo.fw=m;
t.oldZoomInfo.fh=w;
t.oldZoomInfo.tiw=r;
t.oldZoomInfo.tih=f;
};
MVZoomControl.prototype.zoomToFactor=function(m,g){if(g>1){return;
}var a=m.oldZoomInfo;
var d=(a.lend-a.lstart)*g+a.lstart;
var f=(a.tend-a.tstart)*g+a.tstart;
var b=(a.tiw-a.fw)*g+a.fw;
var k=(a.tih-a.fh)*g+a.fh;
MVUtil.setLeftTop(m,d,f);
m.style.width=(b+1)+"px";
m.style.height=(k+1)+"px";
};
MVZoomControl.prototype.copyTiles=function(){if(this.tileLayerDiv&&this.tileLayerDiv.parentNode){this.tileLayerDiv.parentNode.removeChild(this.tileLayerDiv);
MVUtil.deleteNode(this.tileLayerDiv);
}this.tileLayerDiv=this.mapLayer.mapLayer;
this.tileLayerDiv.zooming=true;
this.tileArray=this.mapLayer.tileArray;
this.tileLayerDiv.style.zIndex=200+this.mapLayer.zIndex;
return;
};
MVZoomControl.prototype.zoomToNewCenter=function(l,a,g){if((l)&&(a)&&(l.getPointX()!=a.getPointX()||l.getPointY()!=a.getPointY())){var d=this.getScreenXY(l.getPointX(),l.getPointY(),g);
var f=this.getScreenXY(a.getPointX(),a.getPointY(),g);
var b=f.x-d.x;
var k=f.y-d.y;
var h=this.mapview.div;
if(MVGlobalVariables.browserClass==2){h.style.pixelLeft=h.style.pixelLeft-b;
h.style.pixelTop=h.style.pixelTop-k;
}else{h.style.left=(MVUtil.getLeft(h)-b)+"px";
h.style.top=(MVUtil.getTop(h)-k)+"px";
}}};
MVZoomControl.prototype.clearLastZoom=function(){for(var b=0;
b<this.mapLayer.tileArray.length;
b++){for(var a=0;
a<this.mapLayer.tileArray[b].length;
a++){if(!this.hasTileLoaded(this.mapLayer.tileArray[b][a])){var d=MVGlobalVariables.imgFilePath+"transparent."+(MVGlobalVariables.browser=="IF"?"gif":"png");
this.mapLayer.tileArray[b][a].src=d;
this.mapLayer.tileArray[b][a].imgLoadFinished=true;
}}}for(var b=0;
b<this.timeouts.length;
b++){clearTimeout(this.timeouts[b]);
}this.timeouts=new Array();
};
MVZoomControl.prototype.showTiles=function(b,g,h,a){if(!this.mapLayer.isVisible()||this.mapLayer.tileArray==""||Math.abs(b-g)>1||this.mapLayer.isTransparent){this.reset();
return;
}this.mapLayer.setVisible(false);
this.mapLayer.mapLayer.style.visibility="visible";
this.zooming=true;
this.zoomToNewCenter(h,a,b);
this.computeTilesOffset();
this.copyTiles();
this.clearLastZoom();
for(var f=0;
f<this.tileArray.length;
f++){for(var d=0;
d<this.tileArray[f].length;
d++){this.initZoomInfo(b,g,this.tileArray[f][d]);
this.runZoom(this,f,d);
}}};
MVZoomControl.prototype.reset=function(){this.ldiff=0;
this.tdiff=0;
this.movedLeft=0;
this.movedTop=0;
if(this.tileLayerDiv&&this.tileLayerDiv.parentNode){this.tileLayerDiv.parentNode.removeChild(this.tileLayerDiv);
MVUtil.deleteNode(this.tileLayerDiv);
}this.tileArray=null;
this.tileLayerDiv=null;
this.zoomStep=0.2;
this.interval=100;
this.zooming=false;
this.oldTilesLoaded=false;
for(var a=0;
a<this.timeouts.length;
a++){clearTimeout(this.timeouts[a]);
}this.timeouts=new Array();
if(this.mapLayer.basemap.isVisible()){this.mapLayer.setVisible(true);
}};
MVZoomControl.prototype.runZoom=function(a,g,f,d){d=(d)?d:a.zoomStep;
var h=a.tileArray[g][f];
a.zoomToFactor(h,d);
if(d>=1){h.oldZoomInfo=null;
h.zoomFinished=true;
if(this.hasZoomFinished()){this.startClear();
}return;
}else{var b=setTimeout(function(){a.runZoom.call(a,a,g,f,d+a.zoomStep);
},a.interval);
this.timeouts.push(b);
}};
MVZoomControl.prototype.hasZoomFinished=function(){if(!(this.tileArray)){return true;
}for(var b=0;
b<this.tileArray.length;
b++){for(var a=0;
a<this.tileArray[b].length;
a++){if(!this.tileArray[b][a].zoomFinished){return false;
}}}return true;
};
MVZoomControl.prototype.hasTilesLoadFinished=function(){for(var b=0;
b<this.mapLayer.tileArray.length;
b++){for(var a=0;
a<this.mapLayer.tileArray[b].length;
a++){if(!this.hasTileLoaded(this.mapLayer.tileArray[b][a])){return false;
}}}return true;
};
MVZoomControl.prototype.hasTileLoaded=function(a){if(a.src==this.mapview.transImage.src){return true;
}if(MVGlobalVariables.browserClass==2){return a.imgLoadFinished;
}else{return(a.offsetWidth==this.mapLayer.tileWidth);
}};
MVZoomControl.prototype.startClear=function(){this.mapLayer.setVisible(true);
for(var d=0;
d<this.mapview.indFOIsControl.indFOIArray.length;
d++){var g=this.mapview.indFOIsControl.indFOIArray[d].node;
if(g instanceof Array){for(var b=0;
b<g.length;
b++){g[b].style.display="";
}}else{if(g!=null){g.style.display="";
}}}if(this.mapview.foiGroupArray!=null){for(var d=0;
d<this.mapview.foiGroupArray.length;
d++){var h=this.mapview.foiGroupArray[d];
for(var b=0;
b<h.pointArray.length;
b++){var f=h.pointArray[b];
if(f.displayed&&f.node){if(f.node instanceof Array){for(var a=0;
a<f.node.length;
a++){f.node[a].style.display="";
}}else{f.node.style.display="";
}}}for(var b=0;
b<h.polygonArray.length;
b++){var f=h.polygonArray[b];
if(f.displayed&&f.node){if(f.node instanceof Array){for(var a=0;
a<f.node.length;
a++){f.node[a].style.display="";
}}else{f.node.style.display="";
}}}if(h.clusterFOIArray!=null){for(var b=0;
b<h.clusterFOIArray.length;
b++){var f=h.clusterFOIArray[b];
if(f.node instanceof Array){for(var a=0;
a<f.node.length;
a++){f.node[a].style.display="";
}}else{f.node.style.display="";
}}}if(h.overlayFOIArray!=null){for(var b=0;
b<h.overlayFOIArray.length;
b++){var f=h.overlayFOIArray[b];
if(f.node instanceof Array){for(var a=0;
a<f.node.length;
a++){f.node[a].style.display="";
}}else{f.node.style.display="";
}}}}}if(MVGlobalVariables.browserClass==2){for(var d=0;
d<this.mapLayer.tileArray.length;
d++){for(var b=0;
b<this.mapLayer.tileArray[d].length;
b++){this.mapLayer.tileArray[d][b].style.display="";
}}}this.tileLayerDiv.style.zIndex=this.mapLayer.zIndex;
this.clearCloneTiles();
};
MVZoomControl.prototype.clearCloneTiles=function(){if(this.hasTilesLoadFinished()){for(var f=0;
f<this.mapLayer.tileArray.length;
f++){for(var d=0;
d<this.mapLayer.tileArray[f].length;
d++){this.mapLayer.tileArray[f][d].style.display="";
}}this.removeCloneTiles();
}else{var a=this;
var b=setTimeout(function(){a.clearCloneTiles();
},70);
this.timeouts.push(b);
}};
MVZoomControl.prototype.removeCloneTiles=function(){if(this.tileLayerDiv&&this.tileLayerDiv.parentNode){this.tileLayerDiv.parentNode.removeChild(this.tileLayerDiv);
MVUtil.deleteNode(this.tileLayerDiv);
this.tileLayerDiv=null;
}this.zooming=false;
};
MVZoomControl.prototype.scaleTiles=function(d){if(!this.scaling&&(!this.mapLayer.isVisible()||this.mapLayer.tileArray=="")){this.reset();
return;
}this.mapLayer.setVisible(false);
this.mapLayer.mapLayer.style.visibility="visible";
if(!this.scaling){this.computeTilesOffset();
this.copyTiles();
this.layerLeft=this.tileLayerDiv.offsetLeft;
this.layerTop=this.tileLayerDiv.offsetTop;
this.parentLeft=this.tileLayerDiv.parentNode.offsetLeft;
this.parentTop=this.tileLayerDiv.parentNode.offsetTop;
this.scaling=true;
for(var h=0;
h<this.tileArray.length;
h++){for(var g=0;
g<this.tileArray[h].length;
g++){var l=this.tileArray[h][g];
l.origLeft=MVUtil.getLeft(l);
l.origTop=MVUtil.getTop(l);
}}}var f=this.mapview.getZoomLevel();
var k=this.mapview.msi.mapConfig.zoomLevels[f].tileImageWidth*d;
var a=this.mapview.msi.mapConfig.zoomLevels[f].tileImageWidth*d;
var m=this.mapview.getPaneWidth()/2+this.ldiff+this.movedLeft;
var b=this.mapview.getPaneHeight()/2+this.tdiff+this.movedTop;
for(var h=0;
h<this.tileArray.length;
h++){for(var g=0;
g<this.tileArray[h].length;
g++){var l=this.tileArray[h][g];
this.scaleTile(l,d,k,a,m,b);
}}};
MVZoomControl.prototype.scaleTile=function(n,m,b,g,f,k){n.zoomFinished=true;
if(m==1){return;
}var a=f-(f-n.origLeft)*m;
var d=k-(k-n.origTop)*m;
MVUtil.setLeftTop(n,a,d);
n.style.width=(b+1)+"px";
n.style.height=(g+1)+"px";
};
MVZoomControl.prototype.endScaling=function(){this.scaling=false;
this.mapLayer.setVisible(true);
for(var d=0;
d<this.mapLayer.tileArray.length;
d++){for(var b=0;
b<this.mapLayer.tileArray[d].length;
b++){this.mapLayer.tileArray[d][b].style.display="";
}}var g=this.tileLayerDiv.offsetLeft;
var h=this.tileLayerDiv.offsetTop;
var a=this.tileLayerDiv.parentNode.offsetLeft;
var f=this.tileLayerDiv.parentNode.offsetTop;
MVUtil.setLeftTop(this.tileLayerDiv,g+this.parentLeft,h+this.parentTop);
this.startClear();
};
MVZoomControl.prototype.tileInitialized=function(){if(this.hasTilesLoadFinished()){this.mapLayer.loading=false;
}else{var a=this;
var b=setTimeout(function(){a.tileInitialized();
},70);
this.timeouts.push(b);
}};
function MVCSTransformSphereMercator(){}MVCSTransformSphereMercator.geodeticToMercator=function(l,k,b){var h=MVGeomUtil.getRadiansFromLatLon({x:l,y:k});
l=h.x;
k=h.y;
var a=Math.sin(k);
var d=Math.log((1+a)/(1-a));
var g=b*l;
var f=d*b/2;
return{x:g,y:f};
};
MVCSTransformSphereMercator.mercatorToGeodetic=function(a,l,d){var k=a/d;
var f=l*2/d;
var h=Math.pow(Math.E,f);
var b=(h-1)/(h+1);
var g=Math.asin(b);
return MVGeomUtil.getLatLonFromRadians({x:k,y:g});
};
MVGlobalVariables.addCSTransFunc(3785,8307,function(a,b){return MVCSTransformSphereMercator.mercatorToGeodetic(a,b,6378137);
});
MVGlobalVariables.addCSTransFunc(8307,3785,function(a,b){return MVCSTransformSphereMercator.geodeticToMercator(a,b,6378137);
});
MVGlobalVariables.addCSTransFunc(3857,8307,function(a,b){return MVCSTransformSphereMercator.mercatorToGeodetic(a,b,6378137);
});
MVGlobalVariables.addCSTransFunc(8307,3857,function(a,b){return MVCSTransformSphereMercator.geodeticToMercator(a,b,6378137);
});
MVGlobalVariables.addCSTransFunc(53004,8307,function(a,b){return MVCSTransformSphereMercator.mercatorToGeodetic(a,b,6371000);
});
MVGlobalVariables.addCSTransFunc(8307,53004,function(a,b){return MVCSTransformSphereMercator.geodeticToMercator(a,b,6371000);
});
MVGlobalVariables.addCSTransFunc(53004,54004,function(a,d){var b=MVCSTransformSphereMercator.mercatorToGeodetic(a,d,6371000);
return MVCSTransformMercator.geodeticToMercator(b.x,b.y,8307,54004);
});
MVGlobalVariables.addCSTransFunc(54004,53004,function(a,d){var b=MVCSTransformMercator.mercatorToGeodetic(a,d,54004,8307);
return MVCSTransformSphereMercator.geodeticToMercator(b.x,b.y,6371000);
});
MVGlobalVariables.addCSTransFunc(3785,54004,function(a,d){var b=MVCSTransformSphereMercator.mercatorToGeodetic(a,d,6378137);
return MVCSTransformMercator.geodeticToMercator(b.x,b.y,8307,54004);
});
MVGlobalVariables.addCSTransFunc(54004,3785,function(a,d){var b=MVCSTransformMercator.mercatorToGeodetic(a,d,54004,8307);
return MVCSTransformSphereMercator.geodeticToMercator(b.x,b.y,6378137);
});
MVGlobalVariables.addCSTransFunc(3857,54004,function(a,d){var b=MVCSTransformSphereMercator.mercatorToGeodetic(a,d,6378137);
return MVCSTransformMercator.geodeticToMercator(b.x,b.y,8307,54004);
});
MVGlobalVariables.addCSTransFunc(54004,3857,function(a,d){var b=MVCSTransformMercator.mercatorToGeodetic(a,d,54004,8307);
return MVCSTransformSphereMercator.geodeticToMercator(b.x,b.y,6378137);
});
MVGlobalVariables.addCSTransFunc(3785,53004,function(a,d){var b=MVCSTransformSphereMercator.mercatorToGeodetic(a,d,6378137);
return MVCSTransformSphereMercator.geodeticToMercator(b.x,b.y,6371000);
});
MVGlobalVariables.addCSTransFunc(53004,3785,function(a,d){var b=MVCSTransformSphereMercator.mercatorToGeodetic(a,d,6371000);
return MVCSTransformSphereMercator.geodeticToMercator(b.x,b.y,6378137);
});
MVGlobalVariables.addCSTransFunc(3857,53004,function(a,d){var b=MVCSTransformSphereMercator.mercatorToGeodetic(a,d,6378137);
return MVCSTransformSphereMercator.geodeticToMercator(b.x,b.y,6371000);
});
MVGlobalVariables.addCSTransFunc(53004,3857,function(a,d){var b=MVCSTransformSphereMercator.mercatorToGeodetic(a,d,6371000);
return MVCSTransformSphereMercator.geodeticToMercator(b.x,b.y,6378137);
});
MVGlobalVariables.addCSTransFunc(3857,3785,function(a,b){return{x:a,y:b};
});
MVGlobalVariables.addCSTransFunc(3785,3857,function(a,b){return{x:a,y:b};
});
function MVButtonGroup(){this.buttonTools=new Object();
this.toolBar=null;
var a=this;
this.add=function(b){a.buttonTools[b.btID]=b;
b.group=a;
b.onButtonStateChangeListener=a.onToolStateChange;
if(this.toolBar){this.toolBar.addButton(b);
}};
this.addSeparator=function(b){var d=new MVToolButton(b,MVToolButton.SEPARATOR);
this.add(d);
};
this.reset=function(){this.onToolStateChange();
};
this.onToolStateChange=function(d){if(a.buttonTools){for(var b in a.buttonTools){if(d==undefined){a.buttonTools[b].reset();
}else{if(d.substring(d.lastIndexOf("bt_")+3)=="clear"){a.buttonTools[b].forceBtUp(d,true);
}else{a.buttonTools[b].forceBtUp(d);
}}}}};
}function MVDistanceTool(a,b){var d=this;
this.displayDistance=true;
this.doubleClickFinish=true;
this.unitStandard=a;
this.serverURL=b;
this.onFinishListener=null;
this.onNewShapePointListener=null;
this.onEditFinishListener=null;
this.EventListeners=new Object();
this.srid=null;
this.tmpDouClick=null;
this.redLineTool=new MVRedlineTool(null,null,b);
this.redLineTool.setGeneratePolygonTop(false);
this.init=function(){d.parent.addRedLineTool(d.redLineTool);
d.srid=d.parent.srid;
if(d.redLineTool.getStatus()!=0){d.clear();
}d.redLineTool.finishLinkClick=d.finish;
d.redLineTool.clearLinkClick=d.clear;
d.redLineTool.init(2);
d.redLineTool.moveFoiFlag=-1;
d.redLineTool.setEventListener(MVEvent.NEW_SHAPE_POINT,d.calTotalDistance);
d.redLineTool.setEventListener(MVEvent.MODIFY,d.afterEditDistanceTool);
if(d.doubleClickFinish){d.tmpDouClick=d.parent.dblclickListener;
d.parent.setEventListener(MVEvent.MOUSE_DOUBLE_CLICK,d.finish);
}MVUtil.runListeners(this.EventListeners,MVEvent.INIT,[MVToolBar.BUILTIN_DISTANCE]);
};
this.setEventListener=function(f,g){if(f==MVEvent.NEW_SHAPE_POINT){d.onNewShapePointListener=g;
}else{if(f==MVEvent.FINISH){d.onFinishListener=g;
}else{if(f==MVEvent.MODIFY){d.onEditFinishListener=g;
}}}};
this.attachEventListener=function(f,g){MVUtil.attachEventListener(d.EventListeners,f,g);
};
this.detachEventListener=function(f,g){MVUtil.detachEventListener(d.EventListeners,f,g);
};
this.setRenderingStyle=function(g,f){this.redLineTool.setRenderingStyle(g,f);
};
this.setTextStyle=function(f){d.redLineTool.setTextStyle(f);
};
this.getOrdinates=function(){return d.redLineTool.getOrdinates();
};
this.getStatus=function(){return d.redLineTool.getStatus();
};
this.finish=function(f){if(d.redLineTool!=null&&d.getStatus()!=2){if(d.redLineTool.getOrdinates().length<=2){d.clear();
}else{d.redLineTool.generateArea();
if(d.onFinishListener){d.onFinishListener();
}MVUtil.runListeners(d.EventListeners,MVEvent.FINISH);
}}d.parent.dblclickListener=d.tmpDouClick;
};
this.clear=function(){if(d.redLineTool!=null){d.redLineTool.clear();
var f=document.getElementById("distance_info_div_"+d.redLineTool.id);
if(f){f.innerHTML="";
}MVUtil.runListeners(d.EventListeners,MVEvent.CLEAR);
d.parent.dblclickListener=d.tmpDouClick;
}};
this.calTotalDistance=function(){if(d.displayDistance){if(d.redLineTool==null){return;
}var h=d.redLineTool.getOrdinates();
if(h==null||h.length<4){if(d.onNewShapePointListener){d.onNewShapePointListener();
}MVUtil.runListeners(d.EventListeners,MVEvent.NEW_SHAPE_POINT);
return;
}var f=MVSdoGeometry.createLineString(h,d.srid);
var g=function(k){var m=MVi18n.getInfoMessage("totalDistance")+d.getReadableResult(k);
var l=document.getElementById("distance_info_div_"+d.redLineTool.id);
if(!l){l=document.createElement("div");
l.id="distance_info_div_"+d.redLineTool.id;
d.redLineTool.getInfoDecorationDiv().appendChild(l);
}l.innerHTML=m;
};
if(d.unitStandard==MVDistanceTool.METRIC){parseInt(f.getLength("meter",true,d.serverURL,g));
}else{parseInt(f.getLength("Yard",true,d.serverURL,g));
}}if(d.onNewShapePointListener){d.onNewShapePointListener();
}MVUtil.runListeners(d.EventListeners,MVEvent.NEW_SHAPE_POINT);
};
this.getDistance=function(m,g,o){if(d.redLineTool==null){return 0;
}var f=d.redLineTool.getOrdinates();
if(f==null||f.length<4){return 0;
}var h=f.length;
var r=new Array(4);
for(var k=0;
k<4;
k++){r[k]=f[h+k-4];
}var s=MVSdoGeometry.createLineString(r,d.srid);
var n;
var l=function(t){n=t;
};
parseInt(s.getLength(m,g,o,l));
return n;
};
this.getTotalDistance=function(k,l,m){if(d.redLineTool==null){return 0;
}var n=d.redLineTool.getOrdinates();
if(n==null||n.length<4){return 0;
}var g=MVSdoGeometry.createLineString(n,d.srid);
var f;
var h=function(o){f=o;
};
parseInt(g.getLength(k,l,m,h));
return f;
};
this.getReadableResult=function(f){if(d.unitStandard==MVDistanceTool.METRIC){if(f>1000){return MVUtil.formatNum(f/1000)+MVi18n.getInfoMessage("km");
}else{if(f>1){return MVUtil.formatNum(f)+MVi18n.getInfoMessage("m");
}else{return MVUtil.formatNum(f*10)+MVi18n.getInfoMessage("cm");
}}}else{if(f>1760){return MVUtil.formatNum(f/1760)+MVi18n.getInfoMessage("mi");
}else{if(f*3>1000){return MVUtil.formatNum(f)+MVi18n.getInfoMessage("yd");
}else{if(f*3>1){return MVUtil.formatNum(f*3)+MVi18n.getInfoMessage("ft");
}else{return MVUtil.formatNum(f*3*12)+MVi18n.getInfoMessage("in");
}}}}};
this.afterEditDistanceTool=function(){if(d.displayDistance){d.calTotalDistance();
}else{if(d.onEditFinishListener){d.onEditFinishListener();
}MVUtil.runListeners(d.EventListeners,MVEvent.MODIFY);
}};
}MVDistanceTool.prototype.setUnitStandard=function(a){this.unitStandard=a;
};
MVDistanceTool.METRIC=0;
MVDistanceTool.IMPERIAL=1;
function MVInfoWindowTab(b,a){this.title=b;
this.content=a;
}MVInfoWindowTab.prototype.getTitle=function(){return this.title;
};
MVInfoWindowTab.prototype.getContent=function(){return this.content;
};
function MVMenu(a,k,b){this.mapview=a;
this.menuTableId="mvmenu_table_0";
this.menuTableBodyId="mvmenu_table_body_0";
this.menuFOIId="mvmenu_0";
a.removeFOI(this.menuFOIId);
var f="<table id='"+this.menuTableId+"' cellpadding=1 cellspacing=0 style='width:1px'><tr><td style='border-width:1px;border-style:solid;border-color:black;background-color:white'><table><tbody id='"+this.menuTableBodyId+"'></tbody></table></td></tr></table>";
var h=MVFOI.createHTMLFOI(this.menuFOIId,k,f,0,0);
if(b){h.areacode=b;
}h.setInfoTip(null);
h.setInfoWindow(null,0,0);
h.setTopFlag(true);
a.addFOI(h);
var g=this.menuFOIId;
var d=function(){a.removeFOI(g);
};
a.addEventListener(MVEvent.MOUSE_CLICK,d);
}MVMenu.count=0;
MVMenu.prototype.addMenuItem=function(d,g){var h=document.getElementById(this.menuTableBodyId);
var a=document.getElementById(this.menuTableId).style.width;
var b=parseInt(a.substr(0,a.length-2));
if(b<(d.length*12)){document.getElementById(this.menuTableId).style.width=(d.length*12)+"px";
}var f=document.createElement("tr");
h.appendChild(f);
f.style.fontFamily="Arial, Helvetica, Geneva, sans-serif";
f.style.fontSize="12px";
f.style.cursor="pointer";
f.align="left";
var k=document.createElement("td");
k.innerHTML=d;
f.appendChild(k);
f.onmouseover=function(){this.style.backgroundColor="#336699";
this.style.color="#ffffff";
};
f.onmouseout=function(){this.style.backgroundColor="transparent";
this.style.color="#000000";
};
if(g){var h=this;
MVUtil.attachEvent(f,"mousedown",function(l){l=(l)?l:((window.event)?event:null);
MVUtil.stopEvent(l);
h.removeRightClickMenu();
g();
},true);
}};
MVMenu.prototype.removeRightClickMenu=function(){this.mapview.removeFOI(this.menuFOIId);
};
function MVToolBar(l,k,f){if(f==MVToolBar.VERTICAL){this.Direction=f;
}else{this.Direction=MVToolBar.HORIZONTAL;
}this.innerID=l;
this.builtInBts=k;
this.mapviewer=null;
this.toolBarDecoration=null;
this.toolBarDecorationDiv;
this.allToolBts=new Object();
var d=this;
var b=null;
this.visible=true;
this.clearButtonAdded=false;
var a=MVGlobalVariables.toolButtonW;
var g=MVGlobalVariables.toolButtonH;
this.DrawingClearButton=new MVToolButton(l+"_bt_clear",MVToolButton.COMMAND,MVGlobalVariables.imgFilePath+"tbicons/clear.gif",MVGlobalVariables.imgFilePath+"tbicons/p_clear.gif",a,g);
this.RedlineToolButton=new MVToolButton(l+"_bt_redline",MVToolButton.TOGGLE,MVGlobalVariables.imgFilePath+"tbicons/redline.gif",MVGlobalVariables.imgFilePath+"tbicons/p_redline.gif",a,g);
this.DistanceToolButton=new MVToolButton(l+"_bt_distance",MVToolButton.TOGGLE,MVGlobalVariables.imgFilePath+"tbicons/distance.gif",MVGlobalVariables.imgFilePath+"tbicons/p_distance.gif",a,g);
this.CircleToolButton=new MVToolButton(l+"_bt_circle",MVToolButton.TOGGLE,MVGlobalVariables.imgFilePath+"tbicons/circle.gif",MVGlobalVariables.imgFilePath+"tbicons/p_circle.gif",a,g);
this.RectangleToolButton=new MVToolButton(l+"_bt_rectangle",MVToolButton.TOGGLE,MVGlobalVariables.imgFilePath+"tbicons/rectangle.gif",MVGlobalVariables.imgFilePath+"tbicons/p_rectangle.gif",a,g);
this.MarqueeZoomToolButton=new MVToolButton(l+"_bt_zoom",MVToolButton.TOGGLE,MVGlobalVariables.imgFilePath+"tbicons/zoom.gif",MVGlobalVariables.imgFilePath+"tbicons/p_zoom.gif",a,g);
this.DrawingButtonGroup=new MVButtonGroup();
this.buttonGroups=new Array();
this.buttonsToAdd=new Array();
this.destroy=function(){this.builtInBts=null;
this.mapviewer=null;
this.toolBarDecoration=null;
this.toolBarDecorationDiv=null;
this.allToolBts=null;
this.DrawingClearButton.destroy();
this.RedlineToolButton.destroy();
this.DistanceToolButton.destroy();
this.CircleToolButton.destroy();
this.RectangleToolButton.destroy();
this.MarqueeZoomToolButton.destroy();
this.DrawingClearButton=null;
this.RedlineToolButton=null;
this.DistanceToolButton=null;
this.CircleToolButton=null;
this.RectangleToolButton=null;
this.MarqueeZoomToolButton=null;
this.DrawingButtonGroup=null;
this.buttonGroups=null;
this.buttonsToAdd=null;
};
this.setPosition=function(n,m,h,o){if(!h){h=0;
}if(!o){o=0;
}d.toolBarDecoration.setPosition(n,m,h,o);
};
this.setVisible=function(h){if(d.visible!=h){d.toolBarDecoration.setVisible(h);
d.visible=h;
}};
this.isVisible=function(){return this.visible;
};
this.getBuiltInTool=function(h){if(d.builtInBts[MVToolBar.BUILTIN_ALL]==true||d.builtInBts[h]==true){var m=null;
switch(h){case MVToolBar.BUILTIN_CIRCLE:m=d.CircleToolButton;
break;
case MVToolBar.BUILTIN_RECTANGLE:m=d.RectangleToolButton;
break;
case MVToolBar.BUILTIN_REDLINE:m=d.RedlineToolButton;
break;
case MVToolBar.BUILTIN_DISTANCE:m=d.DistanceToolButton;
break;
}if(m){return m.tool;
}else{return null;
}}else{return null;
}};
this.addButton=function(h){if(h.btType==MVToolButton.SEPARATOR){if(d.Direction==MVToolBar.HORIZONTAL){h.btImg.setAttribute("src",MVGlobalVariables.imgFilePath+"tbicons/bk_v.png");
}else{h.btImg.setAttribute("src",MVGlobalVariables.imgFilePath+"tbicons/bk_h.png");
}}if(b){d.addButtonToDOM(h);
}else{d.buttonsToAdd.push(h);
}};
this.addButtonToDOM=function(m){var h=null;
var n=null;
if(d.Direction==MVToolBar.HORIZONTAL){if(b.childNodes.length==0){h=b.insertRow(0);
}else{h=b.firstChild.firstChild;
}n=h.insertCell(h.childNodes.length);
n.id="_td_"+m.btID;
}else{if(b.childNodes.length==0){h=b.insertRow(0);
}else{h=b.insertRow(b.firstChild.childNodes.length);
}h.id="_tr_"+m.btID;
n=h.insertCell(0);
}m.parentToolBar=d;
n.appendChild(m.btDiv);
d.allToolBts[m.btID]=m;
m.parentToolBar=d;
};
this.addSeparator=function(h){var m=new MVToolButton(h,MVToolButton.SEPARATOR);
d.addButton(m);
};
this.getButton=function(h){return d.allToolBts[h];
};
this.getBuiltInButton=function(h){if(h==MVToolBar.BUILTIN_CLEAR&&this.clearButtonAdded){return this.DrawingClearButton;
}if(d.builtInBts[MVToolBar.BUILTIN_ALL]==true||d.builtInBts[h]==true){var m=null;
switch(h){case MVToolBar.BUILTIN_CIRCLE:m=d.CircleToolButton;
break;
case MVToolBar.BUILTIN_RECTANGLE:m=d.RectangleToolButton;
break;
case MVToolBar.BUILTIN_REDLINE:m=d.RedlineToolButton;
break;
case MVToolBar.BUILTIN_DISTANCE:m=d.DistanceToolButton;
break;
case MVToolBar.BUILTIN_MARQUEE_ZOOM:m=d.MarqueeZoomToolButton;
break;
}if(m){return m;
}else{return null;
}}else{return null;
}};
this.removeButton=function(m){if(!m){return;
}delete d.allToolBts[m.btID];
if(m.group){delete m.group.buttonTools[m.btID];
m.group=null;
}if(d.Direction==MVToolBar.HORIZONTAL){if(b.childNodes.length==0){return;
}else{oTR=b.firstChild.firstChild;
for(var h=0;
h<oTR.childNodes.length;
h++){if(oTR.childNodes[h].id=="_td_"+m.btID){oTR.deleteCell(h);
}}}}else{if(b.childNodes.length==0){return;
}else{for(var h=0;
h<b.firstChild.childNodes.length;
h++){if(b.firstChild.childNodes[h].id=="_tr_"+m.btID){b.firstChild.deleteRow(h);
}}}}};
this.getBuiltInButtonGroup=function(){return this.DrawingButtonGroup;
};
this.addButtonGroup=function(m){if(m){m.toolBar=this;
this.buttonGroups.push(m);
for(var h in m.buttonTools){this.addButton(m.buttonTools[h]);
}}};
this.removeButtonGroup=function(n){if(n){for(var m=0;
m<this.buttonGroups.length;
m++){if(this.buttonGroups[m]==n){this.buttonGroups.splice(m,1);
for(var h in n.buttonTools){this.removeButton(n.buttonTools[h]);
}return;
}}}};
this.init=function(){d.toolBarDecoration.setVisible(d.visible);
d.toolBarDecoration.setDraggable(true);
b=document.createElement("Table");
b.id="tb_"+d.innerID;
b.style.backgroundColor="rgb(242, 237, 242)";
b.cellSpacing=1;
b.cellPadding=1;
b.style.border="1px solid #7F9DB9";
d.initBuiltInButton();
var m=d.buttonsToAdd;
while(m.length>0){var h=m.shift();
d.addButtonToDOM(h);
}};
this.initBuiltInButton=function(){d.DrawingClearButton.setToolTip(MVi18n.getInfoMessage("clearButton"));
d.RedlineToolButton.setToolTip(MVi18n.getInfoMessage("redlineTool"));
d.DistanceToolButton.setToolTip(MVi18n.getInfoMessage("distanceTool"));
d.CircleToolButton.setToolTip(MVi18n.getInfoMessage("circleTool"));
d.RectangleToolButton.setToolTip(MVi18n.getInfoMessage("retangleTool"));
d.MarqueeZoomToolButton.setToolTip(MVi18n.getInfoMessage("marqueeZoomTool"));
d.RedlineToolButton.btName=MVToolBar.BUILTIN_REDLINE;
d.DistanceToolButton.btName=MVToolBar.BUILTIN_DISTANCE;
d.CircleToolButton.btName=MVToolBar.BUILTIN_CIRCLE;
d.RectangleToolButton.btName=MVToolBar.BUILTIN_RECTANGLE;
d.MarqueeZoomToolButton.btName=MVToolBar.BUILTIN_MARQUEE_ZOOM;
d.DrawingClearButton.attachEventListener(MVEvent.BUTTON_DOWN,d.builtInBtSelected);
d.RedlineToolButton.attachEventListener(MVEvent.BUTTON_DOWN,d.builtInBtSelected);
d.DistanceToolButton.attachEventListener(MVEvent.BUTTON_DOWN,d.builtInBtSelected);
d.CircleToolButton.attachEventListener(MVEvent.BUTTON_DOWN,d.builtInBtSelected);
d.RectangleToolButton.attachEventListener(MVEvent.BUTTON_DOWN,d.builtInBtSelected);
d.MarqueeZoomToolButton.attachEventListener(MVEvent.BUTTON_DOWN,d.builtInBtSelected);
d.RedlineToolButton.attachEventListener(MVEvent.BUTTON_UP,d.builtInBtUnSelected);
d.DistanceToolButton.attachEventListener(MVEvent.BUTTON_UP,d.builtInBtUnSelected);
d.CircleToolButton.attachEventListener(MVEvent.BUTTON_UP,d.builtInBtUnSelected);
d.RectangleToolButton.attachEventListener(MVEvent.BUTTON_UP,d.builtInBtUnSelected);
d.MarqueeZoomToolButton.attachEventListener(MVEvent.BUTTON_UP,d.builtInBtUnSelected);
d.DrawingButtonGroup.add(d.DrawingClearButton);
d.DrawingButtonGroup.add(d.RedlineToolButton);
d.DrawingButtonGroup.add(d.DistanceToolButton);
d.DrawingButtonGroup.add(d.CircleToolButton);
d.DrawingButtonGroup.add(d.RectangleToolButton);
d.DrawingButtonGroup.add(d.MarqueeZoomToolButton);
var n=new MVCircleTool();
var r=new MVStyleColor("_bt_circle_area_color",null,"FF0000");
n.setAreaStyle(r);
d.CircleToolButton.tool=n;
var s=new MVRectangleTool();
var r=new MVStyleColor("_bt_rectangle_area_color",null,"FF0000");
s.setAreaStyle(r);
d.RectangleToolButton.tool=s;
var u=new MVRedlineTool();
d.RedlineToolButton.tool=u;
var m=new MVDistanceTool(MVDistanceTool.IMPERIAL);
var o=new MVStyleMarker("_bt_distance_point","vector");
o.setStrokeColor("ff0000");
o.setFillColor("00FF00");
o.setVectorShape("c:30");
m.setRenderingStyle(MVRedlineTool.STYLE_POINT,o);
var t='<svg width="1in" height="1in"><desc/><g class="line" style="stroke-width:1.0"><line class="base" style="fill:#ff0000;stroke-width:1.0" /></g></svg>';
var h=new MVXMLStyle("_bt_distance_line",t);
m.setRenderingStyle(MVRedlineTool.STYLE_LINE,h);
d.DistanceToolButton.tool=m;
};
this.editMapDecoration=function(){d.toolBarDecorationDiv=document.getElementById("div_"+d.innerID);
d.toolBarDecorationDiv.appendChild(b);
};
this.addBuiltInButton=function(z){var v=[false,false,false,false,false,false];
if(z==null&&d.builtInBts){for(var t=0;
t<d.builtInBts.length;
t++){v[d.builtInBts[t]]=true;
}if(v[MVToolBar.BUILTIN_ALL]==true){v=[true,true,true,true,true,true];
}d.builtInBts=v;
for(var t=0;
t<v.length;
t++){if(v[t]){d.addButton(d.DrawingClearButton);
d.clearButtonAdded=true;
break;
}}}else{if(z!=null){if(d.builtInBts==null){d.builtInBts=[false,false,false,false,false,false];
d.builtInBts[z.btName]=true;
v=d.builtInBts;
for(var t=0;
t<v.length;
t++){if(v[t]){d.addButton(d.DrawingClearButton);
d.clearButtonAdded=true;
break;
}}}else{if(d.builtInBts[z.btName]==true){return;
}else{if(d.builtInBts[z.btName]==false){d.builtInBts[z.btName]=true;
v=[false,false,false,false,false,false];
v[z.btName]=true;
}}}}}var h=function(F){for(var D in d.allToolBts){if(d.allToolBts[D].tool){var E=d.allToolBts[D].btID;
if(E.indexOf(F)!=-1){d.allToolBts[D].forceBtUp();
}}}};
var B=function(){h("redline");
};
var o=function(){h("distance");
};
var m=function(){h("circle");
};
var s=function(){h("rectangle");
};
var r=function(){if(d.RedlineToolButton.tool.getPointFOIs().length>0){d.RedlineToolButton.tool.clear();
}h("redline");
};
var A=function(){if(d.DistanceToolButton.tool.redLineTool.getPointFOIs().length>0){d.DistanceToolButton.tool.clear();
}h("distance");
};
var u=function(){h("circle");
if(d.CircleToolButton.tool.getStatus()!=0){d.CircleToolButton.tool.clear();
}};
var C=function(){h("rectangle");
if(d.RectangleToolButton.tool.getStatus()!=0){d.RectangleToolButton.tool.clear();
}};
var w=function(){h("zoom");
};
var n=function(D){var E=d.getBuiltInButton(D);
if(E.btState==MVToolButton.UP){E.group.reset();
E.btImg.setAttribute("src",E.btSelectedIcon);
E.btState=MVToolButton.DOWN;
if(E.onButtonStateChangeListener){E.onButtonStateChangeListener(E.btID);
}}};
for(var t=1;
t<v.length;
t++){if(v[t]==true){d.addSeparator("sp_builtIn_"+t);
if(t==MVToolBar.BUILTIN_CIRCLE){d.addButton(d.CircleToolButton);
d.mapviewer.addCircleTool(d.CircleToolButton.tool);
d.CircleToolButton.tool.attachEventListener(MVEvent.FINISH,m);
d.CircleToolButton.tool.attachEventListener(MVEvent.CLEAR,u);
d.CircleToolButton.tool.attachEventListener(MVEvent.INIT,n);
}else{if(t==MVToolBar.BUILTIN_RECTANGLE){d.addButton(d.RectangleToolButton);
d.mapviewer.addRectangleTool(d.RectangleToolButton.tool);
d.RectangleToolButton.tool.attachEventListener(MVEvent.FINISH,s);
d.RectangleToolButton.tool.attachEventListener(MVEvent.CLEAR,C);
d.RectangleToolButton.tool.attachEventListener(MVEvent.INIT,n);
}else{if(t==MVToolBar.BUILTIN_REDLINE){d.addButton(d.RedlineToolButton);
d.mapviewer.addRedLineTool(d.RedlineToolButton.tool);
d.RedlineToolButton.tool.attachEventListener(MVEvent.FINISH,B);
d.RedlineToolButton.tool.attachEventListener(MVEvent.CLEAR,r);
d.RedlineToolButton.tool.attachEventListener(MVEvent.INIT,n);
}else{if(t==MVToolBar.BUILTIN_DISTANCE){d.addButton(d.DistanceToolButton);
d.mapviewer.addDistanceTool(d.DistanceToolButton.tool);
d.DistanceToolButton.tool.attachEventListener(MVEvent.FINISH,o);
d.DistanceToolButton.tool.attachEventListener(MVEvent.CLEAR,A);
d.DistanceToolButton.tool.attachEventListener(MVEvent.INIT,n);
}else{if(t==MVToolBar.BUILTIN_MARQUEE_ZOOM){d.addButton(d.MarqueeZoomToolButton);
}}}}}}}};
this.builtInBtSelected=function(n){if(n==l+"_bt_clear"){for(var r in d.allToolBts){if(d.allToolBts[r].tool){var t=d.allToolBts[r].btID;
if((t==l+"_bt_redline"||t==l+"_bt_distance"||t==l+"_bt_circle"||t==l+"_bt_rectangle"||t==l+"_bt_zoom")&&d.allToolBts[r].tool.parent!=null){d.allToolBts[r].tool.clear();
}}}}else{if(n==l+"_bt_redline"){if(d.getButton(n).tool){var h=d.getButton(n).tool;
h.init();
}}else{if(n==l+"_bt_distance"){var v;
if(d.getButton(n).tool){v=d.getButton(n).tool;
v.init();
}}else{if(n==l+"_bt_circle"){var m;
if(d.getButton(n).tool){m=d.getButton(n).tool;
m.init();
}}else{if(n==l+"_bt_rectangle"){var s;
if(d.getButton(n).tool){s=d.getButton(n).tool;
s.init();
}}else{if(n==l+"_bt_zoom"){var o=new Object();
o.borderColor="#0000FF";
o.borderWidth=2;
o.borderDashed=false;
o.fillColor="#FF0000";
o.fillOpacity=0.5;
d.mapviewer.startMarqueeZoom("continuous",o);
d.MarqueeZoomToolButton.tool=d.mapviewer.marqueeZoomRectangleTool;
var u=function(){d.allToolBts[n].forceBtUp();
};
d.mapviewer.attachEventListener(MVEvent.MARQUEEZOOM_FINISH,u);
}}}}}}};
this.builtInBtUnSelected=function(h){if(h==l+"_bt_redline"){if(d.getButton(h).tool){if(d.getButton(h).tool.getPointFOIs().length>=3){d.getButton(h).tool.generateArea();
}else{d.getButton(h).tool.clear();
}}}if(h==l+"_bt_distance"){if(d.getButton(h).tool){d.getButton(h).tool.clear();
}}else{if(h==l+"_bt_zoom"){d.mapviewer.stopMarqueeZoom();
}}};
this.toolBarDecoration=new MVMapDecoration('<div id="div_'+d.innerID+'" style="background: white;"></div>',0.35,0.05);
}MVToolBar.VERTICAL=0;
MVToolBar.HORIZONTAL=1;
MVToolBar.BUILTIN_ALL=0;
MVToolBar.BUILTIN_CIRCLE=1;
MVToolBar.BUILTIN_RECTANGLE=2;
MVToolBar.BUILTIN_REDLINE=3;
MVToolBar.BUILTIN_DISTANCE=4;
MVToolBar.BUILTIN_MARQUEE_ZOOM=5;
MVToolBar.BUILTIN_CLEAR=6;
function MVToolButton(g,f,d,k,h,a){this.btID=g;
this.btType=f;
this.btIcon=d;
this.btSelectedIcon=k;
this.btState=MVToolButton.UP;
this.parentToolBar=null;
this.EventListeners=new Object();
this.onButtonSelectedListener=null;
this.onButtonUnselectedListener=null;
this.onButtonStateChangeListener=null;
this.btDiv=document.createElement("div");
this.btImg=document.createElement("img");
this.tipDiv=document.createElement("div");
this.btName=null;
this.width=h;
this.height=a;
var b=this;
this.destroy=function(){MVUtil.clearNode(b.btDiv);
b.btDiv=null;
MVUtil.clearNode(b.btImg);
b.btImg=null;
MVUtil.clearNode(b.tipDiv);
b.tipDiv=null;
b=null;
};
this.attachEventListener=function(l,m){MVUtil.attachEventListener(b.EventListeners,l,m);
};
this.detachEventListener=function(l,m){MVUtil.detachEventListener(b.EventListeners,l,m);
};
this.setToolTip=function(l){b.tipDiv.innerHTML=l;
};
this.reset=function(){this.forceBtUp();
};
this.initButton=function(){b.btDiv.appendChild(b.btImg);
b.btDiv.appendChild(b.tipDiv);
b.tipDiv.style.position="absolute";
b.tipDiv.style.display="none";
b.tipDiv.style.borderColor="black";
b.tipDiv.style.backgroundColor="#ffffe1";
b.tipDiv.style.borderWidth="1px";
b.tipDiv.style.borderStyle="solid";
b.tipDiv.style.fontSize="14px";
b.tipDiv.style.whiteSpace="nowrap";
b.tipDiv.style.padding="2px";
if(b.btType!=MVToolButton.SEPARATOR){b.btImg.setAttribute("src",b.btIcon);
if(b.width){b.btImg.setAttribute("width",b.width);
}if(b.height){b.btImg.setAttribute("height",b.height);
}}};
this.btImg.onmouseover=function(){if(b.btType!=MVToolButton.SEPARATOR){MVUtil.setCursor(b.parentToolBar.toolBarDecorationDiv,"pointer");
if(b.tipDiv.innerHTML){b.tipDiv.style.display="";
MVUtil.setLeftTop(b.tipDiv,b.btDiv.parentNode.offsetLeft+5,b.btDiv.parentNode.offsetTop+30);
}}else{MVUtil.setCursor(b.parentToolBar.toolBarDecorationDiv,"default");
}};
this.btImg.onmouseout=function(l){if(b.btState==MVToolButton.DOWN){b.btImg.onmouseup(l);
}b.tipDiv.style.display="none";
};
MVUtil.setListener(this.btImg,"mousedown",function(l){if(b.onButtonStateChangeListener){b.onButtonStateChangeListener(b.btID);
}if(b.btType==MVToolButton.COMMAND){b.btImg.setAttribute("src",b.btSelectedIcon);
b.btState=MVToolButton.DOWN;
l=(l)?l:((window.event)?event:null);
MVUtil.stopEvent(l);
if(b.onButtonSelectedListener){b.onButtonSelectedListener(b.btID);
}MVUtil.runListeners(b.EventListeners,MVEvent.BUTTON_DOWN,[b.btID]);
}else{if(b.btType==MVToolButton.TOGGLE){if(b.btState==MVToolButton.UP){b.btImg.setAttribute("src",b.btSelectedIcon);
b.btState=MVToolButton.DOWN;
l=(l)?l:((window.event)?event:null);
MVUtil.stopEvent(l);
if(b.onButtonSelectedListener){b.onButtonSelectedListener(b.btID);
}MVUtil.runListeners(b.EventListeners,MVEvent.BUTTON_DOWN,[b.btID]);
}else{b.btImg.setAttribute("src",b.btIcon);
b.btState=MVToolButton.UP;
l=(l)?l:((window.event)?event:null);
MVUtil.stopEvent(l);
if(b.onButtonUnselectedListener){b.onButtonUnselectedListener(b.btID);
}MVUtil.runListeners(b.EventListeners,MVEvent.BUTTON_UP,[b.btID]);
}}}},true);
MVUtil.setListener(this.btImg,"mouseup",function(l){if(b.btType==MVToolButton.COMMAND&&b.btState==MVToolButton.DOWN){b.btImg.setAttribute("src",b.btIcon);
if(b.onButtonUnselectedListener){b.onButtonUnselectedListener(b.btID);
}MVUtil.runListeners(b.EventListeners,MVEvent.BUTTON_UP,[b.btID]);
b.btState=MVToolButton.UP;
}},true);
this.forceBtUp=function(l,m){if(b.btType==MVToolButton.TOGGLE&&(l==undefined||b.btID!=l)){if(b.btState==MVToolButton.DOWN){b.btImg.setAttribute("src",b.btIcon);
b.btState=MVToolButton.UP;
if(m==null||!m){MVUtil.runListeners(b.EventListeners,MVEvent.BUTTON_UP,[b.btID]);
}}}};
b.initButton();
}MVToolButton.COMMAND=0;
MVToolButton.TOGGLE=1;
MVToolButton.SEPARATOR=2;
MVToolButton.UP=0;
MVToolButton.DOWN=1;
function MVMapTypeControl(m,l,a,n){this.mapview=m;
this.tileLayer=l;
this.enableTypes=a;
this.type=n;
var g=this;
for(var f=this.mapview.mapLayers.length-1;
f>-1;
f--){var h=this.mapview.mapLayers[f];
if(h.isExtAPITileLayer()&&h==l){break;
}else{if(!h.isExtAPITileLayer()&&h.isTransparent){continue;
}else{return;
}}}this.controlLink=function(){var s=document.getElementById("redline_cpan_div_"+m.mvId);
MVUtil.attachEvent(s,"click",function(t){var v=MVUtil.getEventSource(t);
v.style.backgroundImage="url('"+MVGlobalVariables.imgFilePath+"button_bg_dwn.png')";
v.style.color="#000000";
v.style.borderColor="#e0e3e8 #606974 #606974 #e0e3e8";
if(g.tileLayer){g.tileLayer.setMapType(g.enableTypes[v.id]);
var u=document.getElementById(g.type);
u.style.backgroundImage="url('"+MVGlobalVariables.imgFilePath+"button_bg_ena.png')";
u.style.color="#003d5b";
u.style.borderColor="#e0e3e8 #606974 #606974 #e0e3e8";
g.type=v.id;
}},true);
MVUtil.attachEvent(s,"mouseover",function(t){var u=MVUtil.getEventSource(t);
if(u.id!=g.type){u.style.backgroundImage="url('"+MVGlobalVariables.imgFilePath+"button_bg_ovr.png')";
u.style.color="#000000";
}},true);
MVUtil.attachEvent(s,"mouseout",function(t){var u=MVUtil.getEventSource(t);
if(u.id!=g.type){u.style.backgroundImage="url('"+MVGlobalVariables.imgFilePath+"button_bg_ena.png')";
u.style.color="#003d5b";
}},true);
};
if(!this.infoDecoration){var b="background-image:url("+MVGlobalVariables.imgFilePath+"button_bg_ena.png);background-position:top; background-repeat:repeat-x; width:60px;display: block; padding: 1px 5px 3px 6px; margin:0; text-align:center; text-decoration:none;border-color:#e0e3e8 #606974 #606974 #e0e3e8; border-style:solid; border-width:1px; font-family:Tahoma; font-size:11px; color: #003d5b;";
var o="background-image:url("+MVGlobalVariables.imgFilePath+"button_bg_dwn.png);background-position:top; background-repeat:repeat-x; width:60px;display: block; padding: 1px 5px 3px 6px; margin:0; text-align:center; text-decoration:none;border-color:#4e555e #8f9aac #8f9aac #4e555e; border-style:solid; border-width:1px; font-family:Tahoma; font-size:11px; color: #000000;";
var d="";
var k=0;
for(var r in this.enableTypes){if(this.enableTypes[r]){if(r==this.type){d=d+'<td><a style="'+o+'" id="'+r+'" href="javascript:void(0);"> '+MVi18n.getInfoMessage(""+r+"")+"</a></td>";
}else{d=d+'<td><a style="'+b+'" id="'+r+'" href="javascript:void(0);"> '+MVi18n.getInfoMessage(""+r+"")+"</a></td>";
}k+=60;
}}if(k>0){this.mapview.mvId;
}this.infoDecoration=new MVMapDecoration('<div id="redline_cpan_div_'+this.mapview.mvId+'" style="border:0px;width:'+k+'px;"><table width=100% cellspacing=0 cellpadding=0><tr>'+d+"</tr></table></div>",0,0,(k+40),25,(this.mapview.getPaneWidth()-(k+50)),10);
this.infoDecoration.afterDisAction=this.controlLink;
this.mapview.addMapDecoration(this.infoDecoration);
this.infoDecoration.setDraggable(false);
}}function MVGoogleTileLayer(a){var d=null,b=null;
if(a&&a.libURL){d=a.libURL;
if(d.indexOf("v=2")>0||d.indexOf("v=1")>0){b=new MVGoogleTileLayerV2(a);
return b;
}}b=new MVGoogleTileLayerV3(a);
return b;
}MVGoogleTileLayer.TYPE_ROAD="road";
MVGoogleTileLayer.TYPE_SATELLITE="satellite";
MVGoogleTileLayer.TYPE_HYBRID="hybrid";
MVGoogleTileLayer.TYPE_SHADED="shaded";
MVGoogleTileLayer.MAX_ZOOMLEVEL_SHADED=15;
MVGoogleTileLayerV2.LOADEDJS=false;
MVGoogleTileLayerV2.LOADING=false;
MVGoogleTileLayerV2.TYPES=null;
MVGoogleTileLayerV2.finishLoadJs=function(){MVGoogleTileLayerV2.LOADEDJS=true;
MVGoogleTileLayerV2.TYPES=new Array();
MVGoogleTileLayerV2.TYPES[MVGoogleTileLayer.TYPE_ROAD]=G_NORMAL_MAP;
MVGoogleTileLayerV2.TYPES[MVGoogleTileLayer.TYPE_SATELLITE]=G_SATELLITE_MAP;
MVGoogleTileLayerV2.TYPES[MVGoogleTileLayer.TYPE_HYBRID]=G_HYBRID_MAP;
MVGoogleTileLayerV2.TYPES[MVGoogleTileLayer.TYPE_SHADED]=G_PHYSICAL_MAP;
};
function MVGoogleTileLayerV2(a){this.key="your_google_api_key";
this.libURL=null;
if(a&&a.mapTypeList){this.map_type_values=a.mapTypeList;
}if(a&&a.key){this.key=a.key;
}if(typeof GMap2!="undefined"){MVGoogleTileLayerV2.finishLoadJs();
}if(!MVGoogleTileLayerV2.LOADEDJS&&!MVGoogleTileLayerV2.LOADING){MVGoogleTileLayerV2.LOADING=true;
if(a&&a.libURL){this.libURL=a.libURL;
MVUtil.loadScriptByUrl(this.libURL+"&key="+this.key+"&async=2&callback=MVGoogleTileLayerV2.finishLoadJs");
}else{MVUtil.loadScriptByUrl("http://maps.google.com/maps?file=api&v=2&key="+this.key+"&async=2&callback=MVGoogleTileLayerV2.finishLoadJs");
}}this.tileLayerDefinition=MVGlobalVariables.googleTileLayerDefinition;
if(a&&a.coordSys&&a.coordSys.srid){if(this.tileLayerDefinition.coordSys.srid!==a.coordSys.srid){this.tileLayerDefinition.coordSys.srid=a.coordSys.srid;
}}this.mapTypeVisible=false;
if(a&&a.mapTypeVisible!=null){this.mapTypeVisible=a&&a.mapTypeVisible;
}this.srid=8307;
this.baseClass=MVMapTileLayer;
this.baseClass(this.tileLayerDefinition.mapTileLayer);
this.mapType=MVGoogleTileLayer.TYPE_ROAD;
if(a&&a.mapType){this.mapType=a.mapType;
}this.centerX=null;
this.centerY=null;
this.zoomLevel=null;
this.initializeListener=null;
this.map=null;
this.termsDiv=null;
this.logoDiv=null;
this.clonedGmap=null;
}MVGoogleTileLayerV2.prototype=new MVMapTileLayer;
MVGoogleTileLayerV2.prototype.setSrid=function(a){this.tileLayerDefinition.coordSys.srid=a;
};
MVGoogleTileLayerV2.prototype.getSrid=function(){return this.tileLayerDefinition.coordSys.srid;
};
MVGoogleTileLayerV2.prototype.setMapType=function(d){var a=this;
var b=function(){a.mapType=d;
if(a.map){a.checkMapType();
if(a.map){a.map.setMapType(MVGoogleTileLayerV2.TYPES[a.mapType]);
}if(a.clonedGmap){a.clonedGmap.map.setMapType(MVGoogleTileLayerV2.TYPES[a.mapType]);
}}else{setTimeout(b,1000);
}};
b();
};
MVGoogleTileLayerV2.prototype.getMapType=function(){return this.mapType;
};
MVGoogleTileLayerV2.prototype.setKey=function(a){if(a){this.key=a;
}};
MVGoogleTileLayerV2.prototype.getType=function(){return"MVExternalAPIMapTileLayer";
};
MVGoogleTileLayerV2.prototype.init=function(f){var b=this;
var a=function(){if(b.map){return;
}b.map=new GMap2(f);
b.checkMapType();
if(b.mapType){b.map.setMapType(MVGoogleTileLayerV2.TYPES[b.mapType]);
}if(b.centerX!=null&&b.centerY!=null&&b.zoomLevel!=null){var g=new GLatLng(b.centerY,b.centerX);
b.map.setCenter(g,b.zoomLevel+1);
}if(b.initializeListener){b.initializeListener();
}b.mapview.removeAllMapTypeControl();
if(b.map_type_values){var n=b.map_type_values.split(";");
var k={road:null,satellite:null,shaded:null};
for(var m=0;
m<n.length;
m++){if(n[m]=="MVGoogleTileLayer.TYPE_ROAD"){k.road=MVGoogleTileLayer.TYPE_ROAD;
}else{if(n[m]=="MVGoogleTileLayer.TYPE_SATELLITE"){k.satellite=MVGoogleTileLayer.TYPE_SATELLITE;
}else{if(n[m]=="MVGoogleTileLayer.TYPE_SHADED"){k.shaded=MVGoogleTileLayer.TYPE_SHADED;
}}}}var r=null;
for(var l in k){if(k[l]==b.mapType){r=l;
}}var h=new MVMapTypeControl(b.mapview,b,k,r);
if(h.infoDecoration){h.infoDecoration.setVisible(b.mapTypeVisible);
}}var o=function(){if(f.childNodes.length==2&&b.parent.overview==false){b.termsDiv=f.lastChild;
b.termsDiv.id="google_copyright";
f.removeChild(b.termsDiv);
b.termsDiv.style.zIndex="100";
f.parentNode.parentNode.parentNode.appendChild(b.termsDiv);
b.logoDiv=f.lastChild;
if(b.logoDiv&&b.logoDiv.id=="logocontrol"){b.logoDiv.id="google_logo";
f.removeChild(b.logoDiv);
b.logoDiv.style.zIndex="100";
f.parentNode.parentNode.appendChild(b.logoDiv);
}}};
setTimeout(o,1000);
};
var d=function(){if(MVGoogleTileLayerV2.LOADEDJS){a(f);
}else{setTimeout(d,1000);
}};
d();
};
MVGoogleTileLayerV2.prototype.setCenterAndZoomLevel=function(a,h,g,f){this.centerX=a;
this.centerY=h;
this.zoomLevel=g;
var b=this;
var d=function(){if(b.map){b.map.setCenter(new GLatLng(h,a),g+1);
}else{if(!f){setTimeout(d,1000);
}}};
d();
};
MVGoogleTileLayerV2.prototype.move=function(d,f){var a=this;
var b=function(){if(a.map){a.map.getDragObject().moveBy(new GSize(d,f));
}else{setTimeout(b,1000);
}};
b();
};
MVGoogleTileLayerV2.prototype.getCenter=function(){var a=this.map.getCenter();
if(a){return MVSdoGeometry.createPoint(a.lng(),a.lat(),this.srid);
}else{return null;
}};
MVGoogleTileLayerV2.prototype.setCenter=function(a,f){this.centerX=a;
this.centerY=f;
var b=this;
var d=function(){if(b.map){b.map.setCenter(new GLatLng(f,a));
}else{setTimeout(d,1000);
}};
d();
};
MVGoogleTileLayerV2.prototype.resize=function(){var a=this;
var b=function(){if(a.map){a.map.checkResize();
}else{setTimeout(b,1000);
}};
b();
};
MVGoogleTileLayerV2.prototype.clone=function(){this.clonedGmap=new MVGoogleTileLayerV2({mapType:this.mapType,key:this.key,libURL:this.libURL});
return this.clonedGmap;
};
MVGoogleTileLayerV2.prototype.setVisible=function(a){MVMapTileLayer.prototype.setVisible.call(this,a);
if(this.termsDiv){this.termsDiv.style.display=a?"":"none";
}if(this.logoDiv){this.logoDiv.style.display=a?"":"none";
}};
MVGoogleTileLayerV2.prototype.destroy=function(){MVMapTileLayer.prototype.destroy.call(this);
this.map=null;
if(this.termsDiv){if(this.termsDiv.parentNode){this.termsDiv.parentNode.removeChild(this.termsDiv);
}this.termsDiv=null;
}if(this.logoDiv){if(this.logoDiv.parentNode){this.logoDiv.parentNode.removeChild(this.logoDiv);
}this.logoDiv=null;
}GUnload();
};
MVGoogleTileLayerV2.prototype.getStaticMapURL=function(){var k="http://maps.google.com/maps/api/staticmap?";
var b=this.map.getCenter();
var a="center="+b.lat()+","+b.lng();
var g="zoom="+(this.zoomLevel+1);
var f="size="+this.map.getSize().width+"x"+this.map.getSize().height;
var h;
switch(this.mapType){case MVGoogleTileLayer.TYPE_SATELLITE:h="satellite";
break;
case MVGoogleTileLayer.TYPE_HYBRID:h="hybrid";
break;
case MVGoogleTileLayer.TYPE_SHADED:h="terrain";
break;
default:h="roadmap";
}h="maptype="+h;
var l="sensor=false";
var d="key="+this.key;
k=k+a+"&amp;"+g+"&amp;"+f+"&amp;"+h+"&amp;"+l+"&amp;"+d;
return k;
};
MVGoogleTileLayerV2.prototype.checkMapType=function(){var a=MVGoogleTileLayerV2.TYPES[this.mapType];
if(!a){this.mapType=MVGoogleTileLayer.TYPE_ROAD;
}};
MVGoogleTileLayerV3.LOADEDJS=false;
MVGoogleTileLayerV3.LOADING=false;
MVGoogleTileLayerV3.TYPES=null;
MVGoogleTileLayerV3.finishLoadJs=function(){MVGoogleTileLayerV3.LOADEDJS=true;
MVGoogleTileLayerV3.TYPES=new Array();
MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_ROAD]=google.maps.MapTypeId.ROADMAP;
MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_SATELLITE]=google.maps.MapTypeId.SATELLITE;
MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_HYBRID]=google.maps.MapTypeId.HYBRID;
MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_SHADED]=google.maps.MapTypeId.TERRAIN;
};
function MVGoogleTileLayerV3(a){this.libURL=null;
if(typeof google!="undefined"&&typeof google.maps!="undefined"&&typeof google.maps.Map!="undefined"){MVGoogleTileLayerV3.finishLoadJs();
}this.key=null;
if(a&&a.mapTypeList){this.map_type_values=a.mapTypeList;
}if(a&&a.key){this.key=a.key;
}this.mapTypeVisible=false;
if(a&&a.mapTypeVisible!=null){this.mapTypeVisible=a&&a.mapTypeVisible;
}this.ssl="https:"==document.location.protocol?true:false;
if(!MVGoogleTileLayerV3.LOADEDJS&&!MVGoogleTileLayerV3.LOADING){MVGoogleTileLayerV3.LOADING=true;
if(this.key){if(a&&a.libURL){this.libURL=a.libURL;
MVUtil.loadScriptByUrl(this.libURL+"&key="+this.key+"&callback=MVGoogleTileLayerV3.finishLoadJs");
}else{if(this.ssl){MVUtil.loadScriptByUrl("https://maps.googleapis.com/maps/api/js?sensor=false&key="+this.key+"&callback=MVGoogleTileLayerV3.finishLoadJs");
}else{MVUtil.loadScriptByUrl("http://maps.google.com/maps/api/js?sensor=false&key="+this.key+"&callback=MVGoogleTileLayerV3.finishLoadJs");
}}}else{if(a&&a.libURL){this.libURL=a.libURL;
MVUtil.loadScriptByUrl(this.libURL+"&callback=MVGoogleTileLayerV3.finishLoadJs");
}else{if(this.ssl){MVUtil.loadScriptByUrl("https://maps.googleapis.com/maps/api/js?sensor=false&&callback=MVGoogleTileLayerV3.finishLoadJs");
}else{MVUtil.loadScriptByUrl("http://maps.google.com/maps/api/js?sensor=false&callback=MVGoogleTileLayerV3.finishLoadJs");
}}}}this.tileLayerDefinition=MVGlobalVariables.googleTileLayerDefinition;
if(a&&a.newTile){this.tileLayerDefinition=MVGlobalVariables.googleTileLayerDefinition21;
}if(a&&a.coordSys&&a.coordSys.srid){if(this.tileLayerDefinition.coordSys.srid!==a.coordSys.srid){this.tileLayerDefinition.coordSys.srid=a.coordSys.srid;
}}if(a&&a.tilt){this.tilt=a.tilt;
}else{this.tilt=0;
}this.srid=8307;
this.baseClass=MVMapTileLayer;
this.baseClass(this.tileLayerDefinition.mapTileLayer);
this.mapType=MVGoogleTileLayer.TYPE_ROAD;
if(a&&a.mapType){this.mapType=a.mapType;
}this.centerX=null;
this.centerY=null;
this.zoomLevel=null;
this.initializeListener=null;
this.map=null;
this.termsDiv=null;
this.logoDiv=null;
this.clonedGmap=null;
this.maxZoomService=null;
this.streetViewDiv=null;
this.streetViewIcon=document.createElement("div");
this.streetViewIcon.style.backgroundImage="url("+MVGlobalVariables.imgFilePath+"streetview_icon."+(MVGlobalVariables.browser=="IF"?"gif":"png")+")";
this.streetViewIcon.style.width="48px";
this.streetViewIcon.style.height="58px";
this.streetViewIcon.stylebackgroundRepeat="no-repeat";
this.streetViewIcon.stylebackgroundPosition="right top";
this.enableSt=false;
this.panorama=null;
this.sv=null;
this.currentMaxZoom=19;
this.svdiv=document.createElement("div");
this.svdiv.style.position="absolute";
this.svdiv.style.zIndex=80;
this.svdiv.style.left=MVUtil.pixel(0);
this.svdiv.style.top=MVUtil.pixel(0);
this.streetViewIconTop=null;
this.streetViewIconLeft=null;
this.removedTile=false;
}MVGoogleTileLayerV3.prototype=new MVMapTileLayer;
MVGoogleTileLayerV3.prototype.setSrid=function(a){this.tileLayerDefinition.coordSys.srid=a;
};
MVGoogleTileLayerV3.prototype.getSrid=function(){return this.tileLayerDefinition.coordSys.srid;
};
MVGoogleTileLayerV3.prototype.setMapType=function(d){this.mapType=d;
var a=this;
var b=function(){if(a.removedTile&&a.div&&!a.map){a.init(a.div);
}if(a.map){a.checkMapType();
var f=new google.maps.LatLng(a.centerY,a.centerX);
a.map.setMapTypeId(MVGoogleTileLayerV3.TYPES[a.mapType]);
a.checkMaxZoomLevel(f);
if(a.clonedGmap){a.clonedGmap.map.setMapTypeId(MVGoogleTileLayerV3.TYPES[a.mapType]);
}}};
b();
};
MVGoogleTileLayerV3.prototype.getMapType=function(){return this.mapType;
};
MVGoogleTileLayerV3.prototype.setKey=function(a){};
MVGoogleTileLayerV3.prototype.getType=function(){return"MVExternalAPIMapTileLayer";
};
MVGoogleTileLayerV3.prototype.init=function(l){var k=null;
var f=null;
var b=this;
if(b.parent&&b.parent.div&&b.parent.div.parentNode){b.parent.div.parentNode.removeChild(b.parent.div);
}this.streetViewIcon.style.zIndex=2000;
this.streetViewIcon.style.position="absolute";
this.streetViewIcon.style.width=MVUtil.pixel(48);
this.streetViewIcon.style.height=MVUtil.pixel(58);
if(this.streetViewIconTop==null){this.streetViewIconTop=20;
}if(this.streetViewIconLeft==null){this.streetViewIconLeft=this.parent.getPaneWidth()/2-29;
}this.streetViewIcon.style.top=MVUtil.pixel(this.streetViewIconTop);
this.streetViewIcon.style.left=MVUtil.pixel(this.streetViewIconLeft);
if(!this.enableSt){this.streetViewIcon.style.visibility="hidden";
}this.parent.base_div.appendChild(this.streetViewIcon);
this.parent.base_div.appendChild(this.svdiv);
this.svdiv.style.width=MVUtil.pixel(this.parent.getPaneWidth());
this.svdiv.style.height=MVUtil.pixel(this.parent.getPaneHeight());
this.svdiv.style.visibility="hidden";
this.streetViewIcon.style.zIndex=1000;
this.svdiv.ondblclick=function(m){MVUtil.stopEvent(m);
};
var g=function(m){if(b.startSteetView){b.streetViewIcon.style.left=MVUtil.pixel(m.clientX+document.body.scrollLeft-b.parent.real_base_div.offsetLeft-24);
b.streetViewIcon.style.top=MVUtil.pixel(m.clientY+document.body.scrollTop-b.parent.real_base_div.offsetTop-29);
}};
this.parent.attachEventListener(MVEvent.MOUSE_MOVE,g);
this.streetViewIcon.onmousedown=function(m){b.startSteetView=true;
b.parent.mapLockMode=true;
};
this.streetViewIcon.onmouseup=function(n){if(b.startSteetView){b.startSteetView=false;
if(b.map){var m=b.parent.getMouseLocation(n);
if(!b.panorama||!b.sv){b.panorama=new google.maps.StreetViewPanorama(b.svdiv,{enableCloseButton:true});
b.sv=new google.maps.StreetViewService();
google.maps.event.addListener(b.panorama,"closeclick",function(){b.svdiv.style.visibility="hidden";
b.streetViewIcon.style.visibility="visible";
b.parent.div.style.visibility="visible";
b.parent.base_div.style.visibility="visible";
b.parent.mapLockMode=false;
b.streetViewIcon.style.top=MVUtil.pixel(b.streetViewIconTop);
b.streetViewIcon.style.left=MVUtil.pixel(b.streetViewIconLeft);
b.mapTypeControl&&b.mapTypeControl.infoDecoration&&b.mapTypeControl.infoDecoration.setVisible(b.mapTypeVisible);
});
}b.parent.transformGeom(m,8307,null,function(o){b.sv.getPanoramaByLocation(new google.maps.LatLng(o.sdo_point.y,o.sdo_point.x),500,function(s,r){if(r==google.maps.StreetViewStatus.OK){b.parent.div.style.visibility="hidden";
b.svdiv.style.visibility="visible";
b.streetViewIcon.style.visibility="hidden";
b.panorama.setPano(s.location.pano);
b.panorama.setPov({heading:270,pitch:0,zoom:1});
b.panorama.setVisible(true);
b.mapTypeControl&&b.mapTypeControl.infoDecoration&&b.mapTypeControl.infoDecoration.setVisible(false);
}else{b.streetViewIcon.style.top=MVUtil.pixel(b.streetViewIconTop);
b.streetViewIcon.style.left=MVUtil.pixel(b.streetViewIconLeft);
b.parent.mapLockMode=false;
}});
});
}}};
var d=function(){var m=new google.maps.LatLng(b.centerY,b.centerX);
b.checkMaxZoomLevel(m);
};
b.parent.attachEventListener(MVEvent.RECENTER,d);
var a=function(){if(b.map){return;
}if(b.centerX!=null&&b.centerY!=null){k=new google.maps.LatLng(b.centerY,b.centerX);
}if(b.zoomLevel!=null){f=b.zoomLevel+1;
}if(!b.mapType){b.mapType=MVGoogleTileLayer.TYPE_ROAD;
}else{b.checkMapType();
}var m={zoom:f,center:k,mapTypeId:MVGoogleTileLayerV3.TYPES[b.mapType],navigationControl:false,mapTypeControl:false,streetViewControl:false,scrollwheel:false,tilt:b.tilt};
b.maxZoomService=new google.maps.MaxZoomService();
b.div=l;
if(b.mapType===MVGoogleTileLayer.TYPE_SHADED||b.mapType===MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_SHADED]){b.adjustMapWhenInit(MVGoogleTileLayer.MAX_ZOOMLEVEL_SHADED,m);
}else{if(b.mapType===MVGoogleTileLayer.TYPE_ROAD||b.mapType===MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_ROAD]){b.adjustMapWhenInit(b.parent.maxZoom+1,m);
}else{b.maxZoomService.getMaxZoomAtLatLng(m.center,function(n){if(n.status!=google.maps.MaxZoomStatus.OK){return;
}else{b.adjustMapWhenInit(n.zoom,m);
}});
}}};
var h=function(){if(MVGoogleTileLayerV3.LOADEDJS){clearTimeout(b.timeout);
a(l);
}else{b.timeout=setTimeout(h,1000);
}};
h();
};
MVGoogleTileLayerV3.prototype.setCenterAndZoomLevel=function(b,h,g){var d=this;
this.zoomLevel=g;
this.centerX=b;
this.centerY=h;
if(this.map){var a=new google.maps.LatLng(h,b);
if(this.centerX==b&&this.centerY==h){var f={zoom:this.zoomLevel+1,center:a};
this.adjustMap(f);
}else{this.centerX=b;
this.centerY=h;
this.checkMaxZoomLevel(a);
}}};
MVGoogleTileLayerV3.prototype.enableStreetView=function(a){this.enableSt=true;
if(a==true){this.streetViewIcon.style.visibility="visible";
}else{this.streetViewIcon.style.visibility="hidden";
}};
MVGoogleTileLayerV3.prototype.setStreetViewPosition=function(b,a){this.streetViewIconTop=b;
this.streetViewIconLeft=a;
this.streetViewIcon.style.top=MVUtil.pixel(this.streetViewIconTop);
this.streetViewIcon.style.left=MVUtil.pixel(this.streetViewIconLeft);
};
MVGoogleTileLayerV3.prototype.getCenter=function(){var a=this.map.getCenter();
if(a){return MVSdoGeometry.createPoint(a.lng(),a.lat(),this.srid);
}else{return null;
}};
MVGoogleTileLayerV3.prototype.setCenter=function(a,f){this.centerX=a;
this.centerY=f;
var d=this;
var b=function(){if(d.map){d.map.setCenter(new google.maps.LatLng(f,a));
}else{if(!MVGoogleTileLayerV3.LOADEDJS){setTimeout(b,1000);
}}};
b();
};
MVGoogleTileLayerV3.prototype.resize=function(){var a=this;
var b=function(){if(a.map){google.maps.event.trigger(a.map,"resize");
}else{setTimeout(b,1000);
}};
b();
};
MVGoogleTileLayerV3.prototype.clone=function(){this.clonedGmap=new MVGoogleTileLayerV3({mapType:this.mapType,libURL:this.libURL});
return this.clonedGmap;
};
MVGoogleTileLayerV3.prototype.setVisible=function(a){MVMapTileLayer.prototype.setVisible.call(this,a);
if(this.termsDiv){this.termsDiv.style.display=a?"":"none";
}if(this.logoDiv){this.logoDiv.style.display=a?"":"none";
}};
MVGoogleTileLayerV3.prototype.destroy=function(){if(this.setTypeTimer){clearTimeout(this.setTypeTimer);
this.setTypeTimer=null;
}MVMapTileLayer.prototype.destroy.call(this);
if(this.termsDiv){if(this.termsDiv.parentNode){this.termsDiv.parentNode.removeChild(this.termsDiv);
}this.termsDiv=null;
}if(this.logoDiv){if(this.logoDiv.parentNode){this.logoDiv.parentNode.removeChild(this.logoDiv);
}this.logoDiv=null;
}if(this.mapTypeControl){this.parent.removeMapDecoration(this.mapTypeControl.infoDecoration);
}this.mapTypeControl=null;
};
MVGoogleTileLayerV3.prototype.getStaticMapURL=function(b,l){var g="http://maps.google.com/maps/api/staticmap?";
var h=this.map.getCenter();
var a="center="+h.lat()+","+h.lng();
var m="zoom="+(this.zoomLevel+1);
var n="size="+b+"x"+l;
var f="roadmap";
if(this.mapType==MVGoogleTileLayer.TYPE_SATELLITE){f="satellite";
}else{if(this.mapType==MVGoogleTileLayer.TYPE_HYBRID){f="hybrid";
}else{if(this.mapType==MVGoogleTileLayer.TYPE_SHADED){f="terrain";
}}}f="maptype="+f;
var d="sensor=false";
var k="key="+this.key;
g=g+a+"&amp;"+m+"&amp;"+n+"&amp;"+f+"&amp;"+d+"&amp;"+k;
return g;
};
MVGoogleTileLayerV3.prototype.checkMapType=function(){var a=MVGoogleTileLayerV3.TYPES[this.mapType];
if(!a){this.mapType=MVGoogleTileLayer.TYPE_ROAD;
}};
MVGoogleTileLayerV3.prototype.adjustMapWhenInit=function(b,a){this.currentMaxZoom=b;
if(b<a.zoom){if(this.layerDiv.parentNode){this.parentdiv=this.layerDiv.parentNode;
this.layerDiv.parentNode.removeChild(this.layerDiv);
}this.removedTile=true;
this.mapOptions=a;
if(this.setTypeTimer){clearTimeout(this.setTypeTimer);
this.setTypeTimer=null;
}}else{if(this.map){return;
}if(this.removedTile){this.parentdiv.appendChild(this.layerDiv);
}this.map=new google.maps.Map(this.div,a);
this.removedTile=false;
this.mapview.removeAllMapTypeControl();
if(this.map_type_values){var h=this.map_type_values.split(";");
var d={road:null,satellite:null,shaded:null};
for(var g=0;
g<h.length;
g++){if(h[g]=="MVGoogleTileLayer.TYPE_ROAD"){d.road=MVGoogleTileLayer.TYPE_ROAD;
}else{if(h[g]=="MVGoogleTileLayer.TYPE_SATELLITE"){d.satellite=MVGoogleTileLayer.TYPE_SATELLITE;
}else{if(h[g]=="MVGoogleTileLayer.TYPE_SHADED"){d.shaded=MVGoogleTileLayer.TYPE_SHADED;
}}}}var k=null;
for(var f in d){if(d[f]==this.mapType){k=f;
}}this.mapTypeControl=new MVMapTypeControl(this.mapview,this,d,k);
if(this.mapTypeControl.infoDecoration){this.mapTypeControl.infoDecoration.setVisible(this.mapTypeVisible);
}}}this.parent.base_div.appendChild(this.parent.div);
};
MVGoogleTileLayerV3.prototype.checkMaxZoomLevel=function(a){var d={zoom:this.zoomLevel+1,center:a};
if(this.mapType===MVGoogleTileLayer.TYPE_SHADED||this.mapType===MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_SHADED]){this.currentMaxZoom=MVGoogleTileLayer.MAX_ZOOMLEVEL_SHADED;
this.adjustMap(d);
}else{if(this.mapType===MVGoogleTileLayer.TYPE_ROAD||this.mapType===MVGoogleTileLayerV3.TYPES[MVGoogleTileLayer.TYPE_ROAD]){this.currentMaxZoom=this.parent.maxZoom+1;
this.adjustMap(d);
}else{var b=this;
this.maxZoomService.getMaxZoomAtLatLng(a,function(f){if(f.status!=google.maps.MaxZoomStatus.OK){return;
}else{b.currentMaxZoom=f.zoom;
b.adjustMap(d);
}});
}}};
MVGoogleTileLayerV3.prototype.adjustMap=function(a){if(this.currentMaxZoom<this.zoomLevel+1){this.parent.base_div.appendChild(this.parent.div);
if(!this.removedTile){this.parentdiv=this.layerDiv.parentNode;
this.parentdiv.removeChild(this.layerDiv);
this.removedTile=true;
}}else{if(this.removedTile){this.parentdiv.appendChild(this.layerDiv);
if(!this.map){this.map=new google.maps.Map(this.div,a);
}google.maps.event.trigger(this.map,"resize");
this.removedTile=false;
}this.parent.base_div.appendChild(this.parent.div);
this.map.setOptions(a);
}};
function MVBingTileLayer(a){var d=null,b=null;
if(a&&a.libURL){d=a.libURL;
if(d.indexOf("v=6")>0){b=new MVBingTileLayerV6(a);
return b;
}else{b=new MVBingTileLayerV7(a);
return b;
}}else{return new MVBingTileLayerV7(a);
}}MVBingTileLayer.TYPE_ROAD="road";
MVBingTileLayer.TYPE_AERIAL="aerial";
MVBingTileLayer.TYPE_SHADED="shaded";
MVBingTileLayer.TYPE_HYBRID="hybrid";
MVBingTileLayer.TYPE_AUTO="auto";
MVBingTileLayer.TYPE_MERCATOR="mercator";
MVBingTileLayerV6.LOADING=false;
MVBingTileLayerV6.TYPES=null;
function MVBingTileLayerV6(a){this.key="your_bing_api_key";
this.libURL=null;
if(a&&a.mapTypeList){this.map_type_values=a.mapTypeList;
}if(typeof VEMap=="undefined"&&!MVBingTileLayerV6.LOADING){if(a&&a.libURL){this.libURL=a.libURL;
MVUtil.loadScriptByUrl(this.libURL);
}else{MVUtil.loadScriptByUrl("http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3");
}MVBingTileLayerV6.LOADING=true;
}if(a&&a.key){this.key=a.key;
}this.mapTypeVisible=false;
if(a&&a.mapTypeVisible!=null){this.mapTypeVisible=a&&a.mapTypeVisible;
}this.tileLayerDefinition=MVGlobalVariables.bingTileLayerDefinition;
if(a&&a.coordSys&&a.coordSys.srid){if(this.tileLayerDefinition.coordSys.srid!==a.coordSys.srid){this.tileLayerDefinition.coordSys.srid=a.coordSys.srid;
}}this.srid=8307;
this.baseClass=MVMapTileLayer;
this.baseClass(this.tileLayerDefinition.mapTileLayer);
this.centerX=null;
this.centerY=null;
this.zoomLevel=null;
this.initializeListener=null;
this.map=null;
this.clonedMap=null;
this.mapType=MVBingTileLayer.TYPE_ROAD;
if(a&&a.mapType){this.mapType=a.mapType;
}}MVBingTileLayerV6.prototype=new MVMapTileLayer;
MVBingTileLayerV6.prototype.setSrid=function(a){this.tileLayerDefinition.coordSys.srid=a;
};
MVBingTileLayerV6.prototype.getSrid=function(){return this.tileLayerDefinition.coordSys.srid;
};
MVBingTileLayerV6.prototype.setMapType=function(d){var b=this;
var a=function(){b.mapType=d;
if(b.map){b.checkMapType();
type=MVBingTileLayerV6.TYPES[b.mapType];
if(b.map){b.map.SetMapStyle(type);
}if(b.clonedMap&&b.clonedMap.map){b.clonedMap.map.SetMapStyle(type);
}}else{setTimeout(a,1000);
}};
a();
};
MVBingTileLayerV6.prototype.getMapType=function(){return this.mapType;
};
MVBingTileLayerV6.prototype.setKey=function(a){if(a){this.key=a;
}};
MVBingTileLayerV6.prototype.getType=function(){return"MVExternalAPIMapTileLayer";
};
MVBingTileLayerV6.prototype.init=function(f){var a=this;
var b=function(o){if(MVBingTileLayerV6.TYPES==null){MVBingTileLayerV6.TYPES=[];
MVBingTileLayerV6.TYPES[MVBingTileLayer.TYPE_ROAD]=VEMapStyle.Road;
MVBingTileLayerV6.TYPES[MVBingTileLayer.TYPE_SHADED]=VEMapStyle.Shaded;
MVBingTileLayerV6.TYPES[MVBingTileLayer.TYPE_AERIAL]=VEMapStyle.Aerial;
MVBingTileLayerV6.TYPES[MVBingTileLayer.TYPE_HYBRID]=VEMapStyle.Hybrid;
}a.map=new VEMap(o.id);
a.validateKey();
var g=null;
if(a.centerX!=null&&a.centerY!=null){g=new VELatLong(a.centerY,a.centerX);
}a.checkMapType();
a.map.LoadMap(g,a.zoomLevel+1,MVBingTileLayerV6.TYPES[a.mapType],true);
if(a.initializeListener){a.initializeListener();
}a.mapview.removeAllMapTypeControl();
if(a.map_type_values){var m=a.map_type_values.split(";");
var h={road:null,satellite:null,shaded:null};
for(var l=0;
l<m.length;
l++){if(m[l]=="MVBingTileLayer.TYPE_ROAD"){h.road=MVBingTileLayer.TYPE_ROAD;
}else{if(m[l]=="MVBingTileLayer.TYPE_AERIAL"){h.satellite=MVBingTileLayer.TYPE_AERIAL;
}else{if(m[l]=="MVBingTileLayer.TYPE_SHADED"){h.shaded=MVBingTileLayer.TYPE_SHADED;
}}}}var n=null;
for(var k in h){if(h[k]==a.mapType){n=k;
}}a.mapTypeControl=new MVMapTypeControl(a.mapview,a,h,n);
if(a.mapTypeControl.infoDecoration){a.mapTypeControl.infoDecoration.setVisible(a.mapTypeVisible);
}}};
var d=setInterval(function(){if((typeof VEMap!="undefined")&&(document.getElementById(f.id).attachEvent!=undefined)){clearInterval(d);
b(f);
}},2000);
};
MVBingTileLayerV6.prototype.setCenterAndZoomLevel=function(a,h,g,f){this.centerX=a;
this.centerY=h;
this.zoomLevel=g;
var d=this;
var b=function(){if(d.map){d.map.SetCenterAndZoom(new VELatLong(h,a),g+1);
}else{if(!f){setTimeout(b,1000);
}}};
b();
};
MVBingTileLayerV6.prototype.move=function(b,f){var d=this;
var a=function(){if(d.map){d.map.vemapcontrol.PanMap(-b,-f);
}else{setTimeout(a,1000);
}};
a();
};
MVBingTileLayerV6.prototype.getCenter=function(){var a=this.map.GetCenter();
return MVSdoGeometry.createPoint(a.Longitude,a.Latitude,this.srid);
};
MVBingTileLayerV6.prototype.setCenter=function(a,f){this.centerX=a;
this.centerY=f;
var d=this;
var b=function(){if(d.map){d.map.SetCenter(new VELatLong(f,a));
}else{setTimeout(b,1000);
}};
b();
};
MVBingTileLayerV6.prototype.resize=function(){var b=this;
var a=function(){if(b.map){if(b.layerDiv.parentNode.offsetWidth>0){b.map.Resize(b.layerDiv.parentNode.offsetWidth,b.layerDiv.parentNode.offsetHeight);
}}else{setTimeout(a,1000);
}};
a();
};
MVBingTileLayerV6.prototype.clone=function(){this.clonedMap=new MVBingTileLayerV6({mapType:this.mapType,key:this.key,libURL:this.libURL});
return this.clonedMap;
};
MVBingTileLayerV6.prototype.validateKey=function(){var a="You have entered an invalid Bing Maps Key! Please replace it with a valid key.";
if(!this.map){return;
}this.map.AttachEvent("oncredentialserror",function(){alert(a);
});
this.map.SetCredentials(this.key);
};
MVBingTileLayerV6.prototype.getStaticMapURL=function(){var f="http://dev.virtualearth.net/REST/V1/Imagery/Map/";
var k=this.getCenter();
var a=k.getPointY()+","+k.getPointX();
var h="Road";
if(this.mapType==MVBingTileLayer.TYPE_SATELLITE){h="Aerial";
}else{if(this.mapType==MVBingTileLayer.TYPE_HYBRID){h="AerialWithLabels";
}}var g=this.zoomLevel+1;
var d="mapSize="+this.map.GetWidth()+","+this.map.GetHeight();
var b="key="+this.key;
f=f+h+"/"+a+"/"+g+"?"+d+"&amp;"+b;
return f;
};
MVBingTileLayerV6.prototype.checkMapType=function(){var a=MVBingTileLayerV6.TYPES[this.mapType];
if(!a){this.mapType=MVBingTileLayer.TYPE_ROAD;
}};
MVVirtualEarthTileLayer=MVBingTileLayerV6;
MVBingTileLayerV6.prototype.destroy=function(){if(this.mapTypeControl){this.mapview.removeMapDecoration(this.mapTypeControl.infoDecoration);
}this.mapTypeControl=null;
MVMapTileLayer.prototype.destroy.call(this);
this.map=null;
};
MVBingTileLayerV7.LOADING=false;
finishLoadBingJsV7=function(){MVBingTileLayerV7.LOADEDJS=true;
MVBingTileLayerV7.TYPES=new Array();
MVBingTileLayerV7.TYPES[MVBingTileLayer.TYPE_ROAD]=Microsoft.Maps.MapTypeId.road;
MVBingTileLayerV7.TYPES[MVBingTileLayer.TYPE_AERIAL]=Microsoft.Maps.MapTypeId.aerial;
MVBingTileLayerV7.TYPES[MVBingTileLayer.TYPE_AUTO]=Microsoft.Maps.MapTypeId.auto;
MVBingTileLayerV7.TYPES[MVBingTileLayer.TYPE_BIRDSEYE]=Microsoft.Maps.MapTypeId.birdseye;
MVBingTileLayerV7.TYPES[MVBingTileLayer.TYPE_COLLINSBART]=Microsoft.Maps.MapTypeId.collinsBart;
MVBingTileLayerV7.TYPES[MVBingTileLayer.TYPE_MERCATOR]=Microsoft.Maps.MapTypeId.mercator;
MVBingTileLayerV7.TYPES[MVBingTileLayer.TYPE_ORDNANCESURVEY]=Microsoft.Maps.MapTypeId.ordnanceSurvey;
};
MVBingTileLayerV7.TYPES=null;
function MVBingTileLayerV7(a){this.key="your_bing_api_key";
this.libURL=null;
if(a&&a.mapTypeList){this.map_type_values=a.mapTypeList;
}this.ssl="https:"==document.location.protocol?true:false;
if(typeof Microsoft!="undefined"){finishLoadBingJsV7();
}if(!MVBingTileLayerV7.LOADEDJS&&!MVBingTileLayerV7.LOADING){MVBingTileLayerV7.LOADING=true;
if(a&&a.libURL){this.libURL=a.libURL;
MVUtil.loadScriptByUrl(this.libURL+"&onscriptload=finishLoadBingJsV7");
}else{if(this.ssl){MVUtil.loadScriptByUrl("https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1&onscriptload=finishLoadBingJsV7");
}else{MVUtil.loadScriptByUrl("http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&onscriptload=finishLoadBingJsV7");
}}}if(a&&a.key){this.key=a.key;
}this.mapTypeVisible=false;
if(a&&a.mapTypeVisible!=null){this.mapTypeVisible=a&&a.mapTypeVisible;
}this.tileLayerDefinition=MVGlobalVariables.bingTileLayerDefinition;
if(a&&a.coordSys&&a.coordSys.srid){if(this.tileLayerDefinition.coordSys.srid!==a.coordSys.srid){this.tileLayerDefinition.coordSys.srid=a.coordSys.srid;
}}this.srid=8307;
this.baseClass=MVMapTileLayer;
this.baseClass(this.tileLayerDefinition.mapTileLayer);
this.centerX=null;
this.centerY=null;
this.zoomLevel=null;
this.initializeListener=null;
this.map=null;
this.clonedMap=null;
this.mapType=MVBingTileLayer.TYPE_ROAD;
if(a&&a.mapType){this.mapType=a.mapType;
}}MVBingTileLayerV7.prototype=new MVMapTileLayer();
MVBingTileLayerV7.prototype.setSrid=function(a){this.tileLayerDefinition.coordSys.srid=a;
};
MVBingTileLayerV7.prototype.getSrid=function(){return this.tileLayerDefinition.coordSys.srid;
};
MVBingTileLayerV7.prototype.setMapType=function(d){var b=this;
var a=function(){b.mapType=d;
if(b.map){b.checkMapType();
type=MVBingTileLayerV7.TYPES[b.mapType];
if(b.map){b.map.setMapType(type);
}if(b.clonedMap&&b.clonedMap.map){b.clonedMap.map.setMapType(type);
}}else{setTimeout(a,1000);
}};
a();
};
MVBingTileLayerV7.prototype.getMapType=function(){return this.mapType;
};
MVBingTileLayerV7.prototype.setKey=function(a){if(a){this.key=a;
}};
MVBingTileLayerV7.prototype.getType=function(){return"MVExternalAPIMapTileLayer";
};
MVBingTileLayerV7.prototype.init=function(f){var b=this;
var d=function(h){var g=null;
if(b.centerX!=null&&b.centerY!=null){g=new Microsoft.Maps.Location(b.centerY,b.centerX);
}b.checkMapType();
if(b.map){return;
}setTimeout(function(){b.map=new Microsoft.Maps.Map(h,{credentials:b.key,center:g,mapTypeId:(MVBingTileLayerV7.TYPES[b.mapType]),zoom:b.zoomLevel+1,labelOverlay:Microsoft.Maps.LabelOverlay.hidden,showDashboard:false,showCopyright:false,showScalebar:false});
b.mapview.removeAllMapTypeControl();
if(b.map_type_values){var n=b.map_type_values.split(";");
var k={road:null,satellite:null,shaded:null};
for(var m=0;
m<n.length;
m++){if(n[m]=="MVBingTileLayer.TYPE_ROAD"){k.road=MVBingTileLayer.TYPE_ROAD;
}else{if(n[m]=="MVBingTileLayer.TYPE_AERIAL"){k.satellite=MVBingTileLayer.TYPE_AERIAL;
}else{if(n[m]=="MVBingTileLayer.TYPE_SHADED"){k.shaded=MVBingTileLayer.TYPE_SHADED;
}}}}var o=null;
for(var l in k){if(k[l]==b.mapType){o=l;
}}b.mapTypeControl=new MVMapTypeControl(b.mapview,b,k,o);
if(b.mapTypeControl.infoDecoration){b.mapTypeControl.infoDecoration.setVisible(b.mapTypeVisible);
}}if(b.initializeListener){b.initializeListener();
}},0);
};
var a=function(){if(MVBingTileLayerV7.LOADEDJS){d(f);
}else{setTimeout(a,1000);
}};
a();
};
MVBingTileLayerV7.prototype.setCenterAndZoomLevel=function(a,g,f,d){this.centerX=a;
this.centerY=g;
this.zoomLevel=f;
if(this.map){var b=this.map.getOptions();
b.zoom=f+1;
b.center=new Microsoft.Maps.Location(g,a);
this.map.setView(b);
}};
MVBingTileLayerV7.prototype.getCenter=function(){var a=this.map.getCenter();
return MVSdoGeometry.createPoint(a.Longitude,a.Latitude,this.srid);
};
MVBingTileLayerV7.prototype.move=function(b,d){if(this.map){var a=this.map.getOptions();
a.center=this.map.getCenter();
a.animate=false;
a.centerOffset=new Microsoft.Maps.Point(b,d);
this.map.setView(a);
}};
MVBingTileLayerV7.prototype.resize=function(){var b=this;
var a=function(){if(b.map){if(b.layerDiv.parentNode.offsetWidth>0){b.map.setOptions({height:b.layerDiv.parentNode.offset,Height:b.layerDiv.parentNode.offsetWidth});
}}else{setTimeout(a,1000);
}};
a();
};
MVBingTileLayerV7.prototype.clone=function(){this.clonedMap=new MVBingTileLayerV7({mapType:this.mapType,key:this.key,libURL:this.libURL});
return this.clonedMap;
};
MVBingTileLayerV7.prototype.validateKey=function(){var a="You have entered an invalid Bing Maps Key! Please replace it with a valid one.";
if(!this.map){return;
}this.map.AttachEvent("oncredentialserror",function(){alert(a);
});
};
MVBingTileLayerV7.prototype.getStaticMapURL=function(b,k){var h="http://dev.virtualearth.net/REST/V1/Imagery/Map/";
var f=this.map.getCenter();
var a=f.latitude+","+f.longitude;
var d="Road";
if(this.mapType==MVBingTileLayer.TYPE_AERIAL){d="Aerial";
}else{if(this.mapType==MVBingTileLayer.TYPE_HYBRID){d="AerialWithLabels";
}}var l=this.zoomLevel+1;
var m="mapSize="+b+","+k;
var g="key="+this.key;
h=h+d+"/"+a+"/"+l+"?"+m+"&amp;"+g;
return h;
};
MVBingTileLayerV7.prototype.checkMapType=function(){var a=MVBingTileLayerV7.TYPES[this.mapType];
if(!a){this.mapType=MVBingTileLayer.TYPE_ROAD;
}};
MVVirtualEarthTileLayer=MVBingTileLayerV7;
MVBingTileLayerV7.prototype.destroy=function(){if(this.mapTypeControl){this.mapview.removeMapDecoration(this.mapTypeControl.infoDecoration);
}this.mapTypeControl=null;
try{if(this.map){this.map.dispose();
}}catch(a){}MVMapTileLayer.prototype.destroy.call(this);
this.map=null;
};
function MVYahooTileLayer(){this.tileLayerDefinition={mapTileLayer:"MV3785_1_17",format:"PNG",coordSys:{srid:3785,type:"PROJECTED",distConvFactor:1,minX:-20037508,minY:-20037508,maxX:20037508,maxY:20037508},zoomLevels:[{zoomLevel:0,name:"",tileWidth:20037508,tileHeight:20037508,tileImageWidth:256,tileImageHeight:256},{zoomLevel:1,name:"",tileWidth:10018754,tileHeight:10018754,tileImageWidth:256,tileImageHeight:256},{zoomLevel:2,name:"",tileWidth:5009377,tileHeight:5009377,tileImageWidth:256,tileImageHeight:256},{zoomLevel:3,name:"",tileWidth:2504688.5,tileHeight:2504688.5,tileImageWidth:256,tileImageHeight:256},{zoomLevel:4,name:"",tileWidth:1252344.25,tileHeight:1252344.25,tileImageWidth:256,tileImageHeight:256},{zoomLevel:5,name:"",tileWidth:626172.125,tileHeight:626172.125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:6,name:"",tileWidth:313086.0625,tileHeight:313086.0625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:7,name:"",tileWidth:156543.03125,tileHeight:156543.03125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:8,name:"",tileWidth:78271.515625,tileHeight:78271.515625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:9,name:"",tileWidth:39135.7578125,tileHeight:39135.7578125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:10,name:"",tileWidth:19567.87890625,tileHeight:19567.87890625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:11,name:"",tileWidth:9783.939453125,tileHeight:9783.939453125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:12,name:"",tileWidth:4891.9697265625,tileHeight:4891.9697265625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:13,name:"",tileWidth:2445.98486328125,tileHeight:2445.98486328125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:14,name:"",tileWidth:1222.992431640625,tileHeight:1222.992431640625,tileImageWidth:256,tileImageHeight:256},{zoomLevel:15,name:"",tileWidth:611.4962158203125,tileHeight:611.4962158203125,tileImageWidth:256,tileImageHeight:256},{zoomLevel:16,name:"",tileWidth:305.74810791015625,tileHeight:305.74810791015625,tileImageWidth:256,tileImageHeight:256}]};
this.srid=8307;
this.baseClass=MVMapTileLayer;
this.baseClass(this.tileLayerDefinition.mapTileLayer);
this.mapType=YAHOO_MAP_REG;
this.centerX=null;
this.centerY=null;
this.zoomLevel=null;
this.initializeListener=null;
this.map=null;
}MVYahooTileLayer.prototype=new MVMapTileLayer;
MVYahooTileLayer.prototype.setMapType=function(a){this.mapType=a;
if(this.map){this.map.setMapType(a);
}};
MVYahooTileLayer.prototype.getMapType=function(){return this.mapType;
};
MVYahooTileLayer.prototype.getType=function(){return"MVExternalAPIMapTileLayer";
};
MVYahooTileLayer.prototype.init=function(b){this.map=new YMap(b,this.mapType);
var a=null;
if(this.centerX!=null&&this.centerY!=null){a=new YGeoPoint(this.centerY,this.centerX);
this.map.drawZoomAndCenter(a,17-this.zoomLevel);
}if(this.initializeListener){this.initializeListener();
}};
MVYahooTileLayer.prototype.setCenterAndZoomLevel=function(a,d,b){this.centerX=a;
this.centerY=d;
this.zoomLevel=b;
if(this.map){this.map.panToLatLon(new YGeoPoint(d,a),17-this.zoomLevel);
}};
MVYahooTileLayer.prototype.getCenter=function(){var a=this.map.getCenterLatLon();
return MVSdoGeometry.createPoint(a.Lon,a.Lat,this.srid);
};
MVYahooTileLayer.prototype.move=function(a,b){this.map.moveByXY(new YCoordPoint(a,b));
};
MVYahooTileLayer.prototype.setCenter=function(a,b){this.centerX=a;
this.centerY=b;
if(this.map){this.map.panToLatLon(new YGeoPoint(b,a));
}};
MVYahooTileLayer.prototype.resize=function(){var a=new YGeoPoint(this.centerY,this.centerX);
this.map.drawZoomAndCenter(a,17-this.zoomLevel);
};
MVYahooTileLayer.prototype.clone=function(){var a=new MVYahooTileLayer();
return a;
};
MVTomTomTileLayer.LOADING=false;
MVTomTomTileLayer.LOADEDJS=false;
function MVTomTomTileLayer(a){if(typeof tomtom!=="undefined"){MVTomTomTileLayer.LOADING=true;
MVTomTomTileLayer.LOADEDJS=true;
}if(typeof tomtom==="undefined"){MVTomTomTileLayer.LOADING=false;
MVTomTomTileLayer.LOADEDJS=false;
if(a&&a.libURL){this.libURL=a.libURL;
if(this.libURL.indexOf("/",this.libURL.length-1)===-1){this.libURL=this.libURL+"/";
}}else{this.libURL=document.location.protocol+"//"+document.location.host+"/mapviewer/jslib/v2/tomtom/";
}this.om_dynamicLoadCss(this.libURL);
}if(a&&a.APIKey){this.key=a.APIKey;
}else{alert("no api key found!");
}if(a&&a.displayTraffic){this.displayTraffic=a.displayTraffic;
}else{this.displayTraffic=false;
}this.tileLayerDefinition=MVGlobalVariables.tomtomTileLayerDefinition;
this.srid=8307;
this.baseClass=MVMapTileLayer;
this.baseClass(this.tileLayerDefinition.mapTileLayer);
this.centerX=null;
this.centerY=null;
this.zoomLevel=null;
this.initializeListener=null;
this.map=null;
this.clonedMap=null;
}MVTomTomTileLayer.prototype=new MVMapTileLayer();
MVTomTomTileLayer.prototype.setSrid=function(a){this.tileLayerDefinition.coordSys.srid=a;
};
MVTomTomTileLayer.prototype.getSrid=function(){return this.tileLayerDefinition.coordSys.srid;
};
MVTomTomTileLayer.prototype.getType=function(){return"MVExternalAPIMapTileLayer";
};
MVTomTomTileLayer.prototype.init=function(h){var g=null;
var d=null;
var a=this;
var b=function(m){var k=null;
g=[a.centerY,a.centerX];
d=a.zoomLevel;
if(a.map){return;
}var l={domNode:m,apiKey:a.key,cookie:false,center:g,zoom:d+3,displayTraffic:a.displayTraffic,inertia:false,fadeAnimation:false};
a.map=new tomtom.Map(l);
a.map.invalidateSize();
};
var f=window.setInterval(function(){if(MVTomTomTileLayer.LOADEDJS){clearInterval(f);
b(h);
a.resize();
}},100);
MVUtil.attachEvent(window,"resize",a.resize);
};
MVTomTomTileLayer.prototype.setCenterAndZoomLevel=function(a,d,b){this.centerX=a;
this.centerY=d;
this.zoomLevel=b;
if(this.map){this.map.setView([this.centerY,this.centerX],this.zoomLevel+3,true);
}};
MVTomTomTileLayer.prototype.resize=function(){var a=this;
var b=function(){if(a.map){}else{setTimeout(b,100);
}};
b();
};
MVTomTomTileLayer.prototype.getCenter=function(){var a=this.map.getCenter();
return MVSdoGeometry.createPoint(a.lng,a.lat,this.srid);
};
MVTomTomTileLayer.prototype.setCenter=function(a,b){if(this.map){if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){this.map.setView([b,a],this.zoomLevel+3);
}else{this.map.setView([b,a],this.zoomLevel+3,true);
}}};
MVTomTomTileLayer.prototype.setKey=function(a){if(a){this.key=a;
}};
MVTomTomTileLayer.prototype.clone=function(){this.clonedMap=new MVTomTomTileLayer({APIKey:this.key,libURL:this.libURL});
return this.clonedMap;
};
MVTomTomTileLayer.prototype.destroy=function(){if(this.mapTypeControl){this.mapview.removeMapDecoration(this.mapTypeControl.infoDecoration);
}this.mapTypeControl=null;
if(this.map){this.map.destroy();
}MVMapTileLayer.prototype.destroy.call(this);
this.map=null;
};
MVTomTomTileLayer.prototype.om_dynamicLoadCss=function(f){var b=this;
var d=document.getElementsByTagName("head")[0];
var a=document.createElement("link");
a.setAttribute("rel","stylesheet");
a.setAttribute("href",f+"css/tomtom.map.min.css");
d.appendChild(a);
a.onload=a.onreadystatechange=function(){b.om_dynamicLoadLeaflet(f);
a.onload=a.onreadystatechange=null;
};
};
MVTomTomTileLayer.prototype.om_dynamicLoadLeaflet=function(f){var b=this;
var d=document.getElementsByTagName("head")[0];
var a=document.createElement("script");
a.setAttribute("type","text/javascript");
a.setAttribute("src",f+"js/leaflet.js");
d.appendChild(a);
a.onload=a.onreadystatechange=function(){MVTomTomTileLayer.LOADING=true;
b.om_dynamicLoadTommaps(f);
a.onload=a.onreadystatechange=null;
};
};
MVTomTomTileLayer.prototype.om_dynamicLoadTommaps=function(d){var b=document.getElementsByTagName("head")[0];
var a=document.createElement("script");
a.setAttribute("type","text/javascript");
a.setAttribute("src",d+"js/tomtom.map.js");
b.appendChild(a);
a.onload=function(){MVTomTomTileLayer.LOADEDJS=true;
tomtom.setImagePath(d+"images/");
a.onload=a.onreadystatechange=null;
};
a.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete"){MVTomTomTileLayer.LOADEDJS=true;
tomtom.setImagePath(d+"images/");
a.onload=a.onreadystatechange=null;
}};
};
MVNokiaTileLayer.LOADING=false;
MVNokiaTileLayer.LOADEDJS=false;
MVNokiaTileLayer.TYPES=null;
function MVNokiaTileLayer(config){this.key="your_nokia_api_key";
this.libURL=null;
if(config&&config.mapTypeList){this.map_type_values=config.mapTypeList;
}if(!MVNokiaTileLayer.LOADEDJS&&!MVNokiaTileLayer.LOADING){MVNokiaTileLayer.LOADING=true;
if(config&&config.libURL){this.libURL=config.libURL;
MVUtil.loadScriptByUrl(this.libURL);
}else{MVUtil.loadScriptByUrl("http://api.maps.nokia.com/2.2.1/jsl.js?map=none&search=none&routing=none&positioning=none&ui=none");
}}if(config&&config.key){this.key=config.key;
}if(config&&config.appID){this.appID=config.appID;
}this.tileLayerDefinition=MVGlobalVariables.bingTileLayerDefinition;
if(config&&config.coordSys&&config.coordSys.srid){if(this.tileLayerDefinition.coordSys.srid!==config.coordSys.srid){this.tileLayerDefinition.coordSys.srid=config.coordSys.srid;
}}this.mapTypeVisible=false;
if(config&&config.mapTypeVisible!=null){this.mapTypeVisible=config&&config.mapTypeVisible;
}this.srid=8307;
this.baseClass=MVMapTileLayer;
this.baseClass(this.tileLayerDefinition.mapTileLayer);
this.centerX=null;
this.centerY=null;
this.zoomLevel=null;
this.initializeListener=null;
this.map=null;
this.clonedMap=null;
this.mapType=MVNokiaTileLayer.TYPE_NORMAL;
if(config&&config.mapType){this.mapType=config.mapType;
}MVNokiaTileLayer.TYPES=[];
MVNokiaTileLayer.TYPES[MVNokiaTileLayer.TYPE_NORMAL]="NORMAL";
MVNokiaTileLayer.TYPES[MVNokiaTileLayer.TYPE_TERRAIN]="TERRAIN";
MVNokiaTileLayer.TYPES[MVNokiaTileLayer.TYPE_SATELLITE]="SATELLITE";
var laodFeatureInterval=window.setInterval(function(){if(eval("typeof nokia")!="undefined"&&eval("typeof nokia.Features")!="undefined"&&eval("typeof nokia.Features.load")!="undefined"){clearInterval(laodFeatureInterval);
MVNokiaTileLayer.LOADEDJS=true;
}},500);
}MVNokiaTileLayer.prototype=new MVMapTileLayer();
MVNokiaTileLayer.prototype.setSrid=function(a){this.tileLayerDefinition.coordSys.srid=a;
};
MVNokiaTileLayer.prototype.getSrid=function(){return this.tileLayerDefinition.coordSys.srid;
};
MVNokiaTileLayer.prototype.setMapType=function(b){var a=this;
a.mapType=b;
if(a.map){a.checkMapType();
if(a.map){a.map.set("baseMapType",a.map[a.mapType]);
}if(a.clonedMap&&a.clonedMap.map){a.clonedMap.map.set("baseMapType",a.map[a.mapType]);
}}};
MVNokiaTileLayer.prototype.getMapType=function(){return this.mapType;
};
MVNokiaTileLayer.prototype.setKey=function(a){if(a){this.key=a;
}};
MVNokiaTileLayer.prototype.init=function(g){var a=this;
var b=g;
var d=function(r){var h=null;
if(a.map){return;
}nokia.Settings.set("appId",a.appID);
nokia.Settings.set("authenticationToken",a.key);
a.map=new nokia.maps.map.Display(b,{zoomLevel:a.zoomLevel+1,center:[a.centerY,a.centerX]});
a.map.set("baseMapType",a.map[a.mapType]);
a.mapview.removeAllMapTypeControl();
if(a.map_type_values){var n=a.map_type_values.split(";");
var k={road:null,satellite:null,shaded:null};
for(var m=0;
m<n.length;
m++){if(n[m]=="MVNokiaTileLayer.TYPE_NORMAL"){k.road=MVNokiaTileLayer.TYPE_NORMAL;
}else{if(n[m]=="MVNokiaTileLayer.TYPE_SATELLITE"){k.satellite=MVNokiaTileLayer.TYPE_SATELLITE;
}else{if(n[m]=="MVNokiaTileLayer.TYPE_TERRAIN"){k.shaded=MVNokiaTileLayer.TYPE_TERRAIN;
}}}}var o=null;
for(var l in k){if(k[l]==a.mapType){o=l;
}}a.mapTypeControl=new MVMapTypeControl(a.mapview,a,k,o);
if(a.mapTypeControl.infoDecoration){a.mapTypeControl.infoDecoration.setVisible(a.mapTypeVisible);
}}};
var f=window.setInterval(function(){if(MVNokiaTileLayer.LOADEDJS){clearInterval(f);
nokia.Features.load({map:"auto"},d,function(){alert("error loading nokia map lib");
});
}},500);
};
MVNokiaTileLayer.prototype.setCenterAndZoomLevel=function(a,f,d,b){this.centerX=a;
this.centerY=f;
this.zoomLevel=d;
if(this.map){this.map.setAttributes(undefined,new nokia.maps.geo.Coordinate(f,a),d+1,undefined,undefined);
}};
MVNokiaTileLayer.prototype.getCenter=function(){var a=this.map.getViewBounds().getCenter();
return MVSdoGeometry.createPoint(a.longitude,a.latitude,this.srid);
};
MVNokiaTileLayer.prototype.move=function(a,b){if(this.map){this.map.pan(0,0,-a,-b);
}};
MVNokiaTileLayer.prototype.resize=function(){};
MVNokiaTileLayer.prototype.clone=function(){this.clonedMap=new MVNokiaTileLayer({mapType:this.mapType,key:this.key,appID:this.appID});
return this.clonedMap;
};
MVNokiaTileLayer.prototype.validateKey=function(){var a="You have entered an invalid nokia Maps Key! Please replace it with a valid one.";
if(!this.map){return;
}this.map.AttachEvent("oncredentialserror",function(){alert(a);
});
this.map.SetCredentials(this.key);
};
MVNokiaTileLayer.prototype.getStaticMapURL=function(g,b){var f="http://m.nok.it/";
var l=this.getCenter();
var a=l.latitude+","+l.longitude;
var k="&t=0";
if(this.mapType==MVNokiaTileLayer.TYPE_TERRAIN){k="&t=2";
}else{if(this.mapType==MVNokiaTileLayer.TYPE_SATELLITE){k="&t=1";
}}var h=this.zoomLevel+1;
var d="&w="+g+"&h="+b;
f=f+"?app_id"+this.appID+"&token"+this.key+"&c="+a+"&z="+h+k+"&nord ";
return f;
};
MVNokiaTileLayer.prototype.destroy=function(){if(this.mapTypeControl){this.mapview.removeMapDecoration(this.mapTypeControl.infoDecoration);
}this.mapTypeControl=null;
if(this.map){this.map.destroy();
}MVMapTileLayer.prototype.destroy.call(this);
this.map=null;
};
MVNokiaTileLayer.prototype.checkMapType=function(){var a=MVNokiaTileLayer.TYPES[this.mapType];
if(!a){this.mapType=MVNokiaTileLayer.TYPE_ROAD;
}};
MVNokiaTileLayer.prototype.getType=function(){return"MVExternalAPIMapTileLayer";
};
MVNokiaTileLayer.TYPE_NORMAL="NORMAL";
MVNokiaTileLayer.TYPE_TERRAIN="TERRAIN";
MVNokiaTileLayer.TYPE_SATELLITE="SATELLITE";
function MVFOIGroup(a){this.pointArray=new Array();
this.polygonArray=new Array();
this.idMap=new Object();
if(a instanceof Array){for(var b=0;
b<a.length;
b++){var d=a[b];
if(this.validateFOIId(d,"MVFOIGroup")){if(d.gtype%10==1){this.pointArray.push(d);
}else{this.polygonArray.push(d);
}}}}this.groupId=null;
this.zIndex=0;
this.div=null;
this.visible=true;
this.maxVisibleZoomLevel=100;
this.minVisibleZoomLevel=-1;
this.time=300;
this.timerId=null;
this.loading=false;
this.threshold=40;
this.clusterStyle=null;
this.minPointCount=2;
this.maxClusteringLevel=100;
this.clusterFOIArray=new Array();
this.overlayFOIArray=new Array();
}MVFOIGroup.prototype.clearAll=function(){this.clearAllPointFOIs();
this.clearAllPolygonFOIs();
this.pointArray=new Array();
this.polygonArray=new Array();
this.clusterFOIArray=new Array();
this.idMap=new Object();
if(this.clusters){for(var b=0;
b<this.clusters.length;
b++){for(var a=0;
a<this.clusters[b].length;
a++){this.clusters[b][a]=null;
}}}for(var b=0;
b<this.overlayFOIArray.length;
b++){for(var a=0;
a<this.overlayFOIArray[b].overLayFOIs.length;
a++){this.overlayFOIArray[b].overLayFOIs[a].overlayFOI=null;
}this.overlayFOIArray[b].overLayFOIs=null;
}this.overlayFOIArray=new Array();
};
MVFOIGroup.prototype.addFOIs=function(a){for(var b=0;
b<a.length;
b++){var d=a[b];
if(this.validateFOIId(d,"MVFOIGroup.addFOIs")){if(d.gtype%10==1){this.pointArray.push(d);
}else{this.polygonArray.push(d);
}if(this.parent&&this.groupId!=null){this.initFOI(d);
}}}};
MVFOIGroup.prototype.addFOI=function(d){if(!this.validateFOIId(d,"MVFOIGroup.addFOI")){return;
}if(d.gtype%10==1){this.pointArray.push(d);
}else{this.polygonArray.push(d);
}if(this.parent&&this.groupId>=0){if(this.parent.displayed){var b=this;
var a=function(){var g=d.geom.getPointX();
var k=d.geom.getPointY();
if(b.clustering&&b.maxClusteringLevel>=b.parent.zoomLevel&&d.gtype%10==1){result=b.addFOIToCluster(d);
if(result!=null){var h=b.mergeCluster(result.x,result.y);
var f=b.clusters[result.x][result.y];
if(h==null){b.reDrawClusert(f);
}else{if(f!=null){b.reDrawClusert(f);
}else{if(b.clusters[result.x+h.directionX][result.y+h.directionY]!=null){b.reDrawClusert(b.clusters[result.x+h.directionX][result.y+h.directionY]);
}else{if(b.clusters[result.x][result.y+h.directionY]!=null){b.reDrawClusert(b.clusters[result.x][result.y+h.directionY]);
}else{if(b.clusters[result.x+h.directionX][result.y]!=null){b.reDrawClusert(b.clusters[result.x+h.directionX][result.y]);
}}}}}d.displayed=true;
}return;
}else{if(d.gtype%10==1&&(g<b.minX||g>b.maxX||k<b.minY||k>b.maxY)){return;
}}d.displayed=true;
if(d.gtype%10==1&&b.enableOverLappingMarker){if(b.addFOItoOverLayerGroup(d)){return;
}}b.parent.indFOIsControl.addAndDisplayIndFOI(d);
if(d.gtype%10==1&&(b.pointDiv.parentNode==null||b.pointDiv.parentNode!=b.div)){b.div.appendChild(b.pointDiv);
}};
this.initFOI(d,a);
}}};
MVFOIGroup.prototype.removeFOI=function(s){if(!s){return;
}if(s.id!=null&&s.id!=""){this.idMap[s.id]=null;
}var r=false;
if(s.gtype%10==1){for(var f=0;
f<this.pointArray.length;
f++){if(this.pointArray[f]==s){this.pointArray.splice(f,1);
r=true;
s.parent=null;
break;
}}}else{for(var f=0;
f<this.polygonArray.length;
f++){if(this.polygonArray[f]==s){this.polygonArray.splice(f,1);
r=true;
s.parent=null;
break;
}}}if(r&&s.displayed){if(s.gtype%10==1&&this.clustering&&this.maxClusteringLevel>=this.parent.zoomLevel&&this.clusters){if(s.geom.srid==null){s.geom.srid=this.parent.srid;
}else{if(s.geom.srid!=this.parent.srid){this.parent.transformGeom(s.geom,this.parent.srid,null,callBack);
}}var k=s.geom.getPointX();
var h=s.geom.getPointY();
for(var d=0;
d<this.clusters.length;
d++){for(var a=0;
a<this.clusters[d].length;
a++){var l=this.clusters[d][a];
if(l==null){continue;
}var o=l.removeFOI(k,h,s);
if(o){var b=l.clusterFOIId;
if(b==null){this.parent.indFOIsControl.removeIndFOI(s.id,s);
break;
}var g=this.getFOIById(b);
if(l.numberOfPoints<this.minPointCount||l.numberOfPoints==0){this.removeAllFOIInCluster(l);
if(l.numberOfPoints==0){this.clusters[d][a]=null;
}else{l.clusterFOIId=null;
this.displaySingleFOIInCluster(l);
}}else{g.setHTMLElement(l.numberOfPoints,10,10);
this.parent.indFOIsControl.removeIndFOI(g.id,g);
this.parent.indFOIsControl.addAndDisplayIndFOI(g);
}break;
}}}}else{if(this.enableOverLappingMarker&&s.overlayFOI){this.removeFOIfromOverLayerGroup(s);
}else{this.parent.indFOIsControl.removeIndFOI(s.id,s);
}}if(this.parent.infoLayer.infoWindows.length>0){if(this.parent.infoLayer.infoWindows[0].nid==s.id){this.parent.infoLayer.deleteInfoWindow(this.parent.infoLayer.infoWindows[0]);
}}}};
MVFOIGroup.prototype.refresh=function(){if(this.parent&&this.parent.displayed){this.startNum=0;
if(this.timerId!=null){clearTimeout(this.timerId);
}this.clearAllPointFOIs();
this.clearAllPolygonFOIs();
var a=this;
this.transformGeomNum=0;
if(this.pointArray.length>0){this.loading=true;
this.parent.setLoadingIconVisible(true);
}for(var b=0;
b<this.pointArray.length;
b++){var d=this.pointArray[b];
var f=function(g){if(g){d.geom=g;
}a.transformGeomNum++;
if(a.transformGeomNum<a.pointArray.length){return;
}if(a.clustering&&a.maxClusteringLevel>=a.parent.zoomLevel){a.initCluster();
a.displayAsCluster();
try{if(a.pointDiv.parentNode==null||a.pointDiv.parentNode!=a.div){a.div.appendChild(this.pointDiv);
}}catch(h){alert(h);
}a.displayPointBatch(1);
}else{a.initializePointBatch();
}};
if(d.geom.srid==null){d.geom.srid=this.parent.srid;
}if(d.geom.srid!=this.parent.srid){this.parent.transformGeom(d.geom,this.parent.srid,null,f);
}else{f();
}}this.displayPolygonFOIs();
}};
MVFOIGroup.prototype.setVisible=function(d){this.visible=d;
if(this.div!=null){if(this.visible){this.refresh();
}else{var a=this.pointDiv.childNodes;
for(var b=0;
b<a.length;
b++){a[b].style.visibility="hidden";
}a=this.polygonDiv.childNodes;
for(var b=0;
b<a.length;
b++){a[b].style.visibility="hidden";
}}}};
MVFOIGroup.prototype.setMaxVisibleZoomLevel=function(a){this.maxVisibleZoomLevel=a;
};
MVFOIGroup.prototype.setMinVisibleZoomLevel=function(a){this.minVisibleZoomLevel=a;
};
MVFOIGroup.prototype.setZIndex=function(a){this.zIndex=a;
if(this.div!=null){this.div.style.zIndex=this.zIndex;
}};
MVFOIGroup.prototype.enableClustering=function(b,a){this.clustering=b;
if(a&&a.threshold){this.threshold=a.threshold;
}if(a&&a.clusterStyle){this.clusterStyle=a.clusterStyle;
}if(a&&a.minPointCount){this.minPointCount=a.minPointCount;
}if(a&&a.maxClusteringLevel){this.maxClusteringLevel=a.maxClusteringLevel;
}};
MVFOIGroup.prototype.init=function(d){this.groupId=d;
this.pointDiv=document.createElement("div");
this.pointDiv.style.position="absolute";
this.pointDiv.style.zIndex=20;
this.polygonDiv=document.createElement("div");
this.polygonDiv.style.position="absolute";
this.polygonDiv.style.zIndex=10;
this.div=document.createElement("div");
this.div.style.position="absolute";
this.div.style.zIndex=this.zIndex;
var a=this.parent.indFOIsControl;
this.div.id="groupdiv";
MVUtil.attachEvent(this.div,"mouseover",a.IndMouseOver,false);
MVUtil.attachEvent(this.div,"mouseout",a.IndMouseOut,false);
MVUtil.attachEvent(this.div,"mousedown",a.getMouseDownLocation,true);
MVUtil.attachEvent(this.div,"mouseup",a.IndMouseUp,true);
MVUtil.attachEvent(this.div,"contextmenu",a.IndRightClick,true);
MVUtil.attachEvent(this.div,"dblclick",a.IndStopEvent,true);
MVUtil.attachEvent(this.div,"click",a.IndStopEvent,true);
MVUtil.attachEvent(this.div,"mousemove",a.IndMouseMove,true);
this.parent.foiGroupLayer.appendChild(this.div);
this.setSize(Math.ceil(2*(this.parent.getPaneWidth())),Math.ceil(2*(this.parent.getPaneHeight())));
var b=this;
var f=function(g){for(var h=0;
h<g.length;
h++){var k=g[h];
b.initFOI(k);
}};
f(this.pointArray);
f(this.polygonArray);
};
MVFOIGroup.prototype.validateFOIId=function(b,a){if(b.id!=null&&b.id!=""){var d=this.idMap[b.id];
if(d==null){this.idMap[b.id]=b.id;
return true;
}else{MVi18n.reportError(a,"MAPVIEWER-05508","foi.id:"+b.id,null);
return false;
}}return true;
};
MVFOIGroup.prototype.initFOI=function(b,a){if(!b||!b.id){return;
}if(!this.parent.defaultDataSource&&this.parent.compareBaseURL(b.serverURL)&&b.style&&b.style.indexOf!=undefined){var f=b.style.split(".");
if(f.length>=2){MVGlobalVariables.setDefaultDataSource(f[0]);
this.parent.setDefaultDataSource(f[0]);
}}b.groupId=this.groupId;
b.parent=this.parent;
if(b.gtype%10==1&&!b.style){b.imgURL=b.serverURL;
}if(!b.serverURL&&!b.isHTMLFOI){b.serverURL=MVGlobalVariables.getDefaultFoiURL();
}if(this.parent.displayed){var d=function(g){if(g){b.geom=g;
}if(a){a();
}};
if(b.geom.srid==null){b.geom.srid=this.parent.srid;
}if(b.geom.srid!=this.parent.srid){this.parent.transformGeom(b.geom,this.parent.srid,null,d);
}else{d();
}}};
MVFOIGroup.prototype.display=function(g,f,b,a,k){this.minX=g;
this.minY=f;
this.maxX=b;
this.maxY=a;
this.startNum=0;
if(this.timerId!=null){clearTimeout(this.timerId);
}var l=this;
this.transformGeomNum=0;
if(this.pointArray.length>0){this.loading=true;
this.parent.setLoadingIconVisible(true);
}for(var h=0;
h<this.pointArray.length;
h++){var m=this.pointArray[h];
var d=function(n){if(n){m.geom=n;
}l.transformGeomNum++;
if(l.transformGeomNum<l.pointArray.length){return;
}if(l.clustering&&l.maxClusteringLevel>=l.parent.zoomLevel){l.clearAllPointFOIs();
l.initCluster();
l.displayAsCluster();
try{if(l.pointDiv.parentNode==null||l.pointDiv.parentNode!=l.div){l.div.appendChild(l.pointDiv);
}}catch(o){alert(o);
}l.displayPointBatch(1);
}else{if(k||l.parent.wrapAroundLayer(l.getLayerWidth())){l.clearAllPointFOIs();
l.initializePointBatch();
}else{l.refreshPointBatch();
}}};
if(m.geom.srid==null){m.geom.srid=this.parent.srid;
}if(m.geom.srid!=this.parent.srid){this.parent.transformGeom(m.geom,this.parent.srid,null,d);
}else{d();
}}this.clearAllPolygonFOIs();
this.displayPolygonFOIs();
};
MVFOIGroup.prototype.displayPolygonFOIs=function(){var d=this;
for(var a=0;
a<this.polygonArray.length;
a++){var b=this.polygonArray[a];
this.parent.indFOIsControl.addAndDisplayIndFOI(b);
}this.div.appendChild(this.polygonDiv);
};
MVFOIGroup.prototype.initializePointBatch=function(){this.displayPointBatch(0);
};
MVFOIGroup.prototype.refreshPointBatch=function(){this.displayPointBatch(1);
};
MVFOIGroup.prototype.displayPointBatch=function(g){for(var b=this.startNum;
b<this.pointArray.length;
b++){var m=this.pointArray[b];
var l=this;
if(g==0){m.displayed=false;
m.overlay=false;
}}var d=0;
if(this.enableOverLappingMarker){this.displayOverLayPointFOI(this.pointArray);
}this.loading=true;
for(var b=this.startNum;
b<this.pointArray.length;
b++){var m=this.pointArray[b];
var l=this;
if(!m.displayed){var k=m.geom.getPointX();
var h=m.geom.getPointY();
var a=this.parent.wrapAroundLayer(this.getLayerWidth());
if(this.parent.wraparound&&!a){this.minX=MVUtil.keepInCSBoundary(this.parent,this.minX);
this.maxX=MVUtil.keepInCSBoundary(this.parent,this.maxX);
}if(h>=this.minY&&h<=this.maxY&&((k>=this.minX&&k<=this.maxX)||a)){if(this.parent.indFOIsControl==null){this.parent.createIndLayer();
}if(d>=200&&b<this.pointArray.length-1){this.startNum=b++;
if(this.pointDiv.parentNode==null||this.pointDiv.parentNode!=l.div){this.div.appendChild(l.pointDiv);
}if(g==0){this.timerId=this.setTimeout("this.initializePointBatch()",this.time);
}else{if(g==1){this.timerId=this.setTimeout("this.refreshPointBatch()",this.time);
}}break;
}else{this.parent.indFOIsControl.addAndDisplayIndFOI(m);
d++;
}}}}if(b>=this.pointArray.length){this.startNum=0;
this.loading=false;
this.parent.checkLayersAndSetLoadingIcon();
try{if(this.pointDiv.parentNode==null||this.pointDiv.parentNode!=this.div){this.div.appendChild(this.pointDiv);
}}catch(f){alert(f);
}}};
MVFOIGroup.prototype.addFOIDIV=function(b,a){if(a.gtype%10==1){this.pointDiv.appendChild(b);
}else{this.polygonDiv.appendChild(b);
}};
MVFOIGroup.prototype.clearAllPolygonFOIs=function(){MVUtil.clearNode(this.polygonDiv,this.parent.errorHandler);
};
MVFOIGroup.prototype.clearAllPointFOIs=function(){MVUtil.clearNode(this.pointDiv,this.parent.errorHandler);
};
MVFOIGroup.prototype.getFOIById=function(b){for(var a=0;
a<this.pointArray.length;
a++){if(this.pointArray[a].id==b){return this.pointArray[a];
}}for(var a=0;
a<this.polygonArray.length;
a++){if(this.polygonArray[a].id==b){return this.polygonArray[a];
}}for(var a=0;
a<this.clusterFOIArray.length;
a++){if(this.clusterFOIArray[a].id==b){return this.clusterFOIArray[a];
}}for(var a=0;
a<this.overlayFOIArray.length;
a++){if(this.overlayFOIArray[a].id==b){return this.overlayFOIArray[a];
}}return null;
};
MVFOIGroup.prototype.destroy=function(){this.clearAll();
this.pointArray=null;
this.polygonArray=null;
this.clusterFOIArray=null;
this.clusters=null;
this.idMap=null;
};
MVFOIGroup.prototype.setTimeout=function(timeoutHandler,elapseTime){var Ie="tempVar"+MV_timeoutCounter;
MV_timeoutCounter++;
eval(Ie+" = this;");
var oi=timeoutHandler.replace(/\\/g,"\\\\");
oi=oi.replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");'+Ie+" = null;",elapseTime);
};
MVFOIGroup.prototype._setTimeoutDispatcher=function(func){eval(func);
};
MVFOIGroup.prototype.setSize=function(a,b){this.width=a;
this.height=b;
};
MVFOIGroup.prototype.getLayerWidth=function(){return this.width;
};
MVFOIGroup.prototype.getLayerHeight=function(){return this.height;
};
MVFOIGroup.prototype.setLayerPoistion=function(a,b){MVUtil.setLeftTop(this.pointDiv,a,b);
MVUtil.setLeftTop(this.polygonDiv,a,b);
};
MVFOIGroup.prototype.checkVisibility=function(){if(this.visible&&this.parent.zoomLevel>=this.minVisibleZoomLevel&&this.parent.zoomLevel<=this.maxVisibleZoomLevel){return true;
}else{return false;
}};
MVFOIGroup.prototype.checkFOIIds=function(){for(var a=0;
a<foiArray.length;
a++){var b=foiArray[a];
if(this.validateFOIId(b,"MVFOIGroup.addFOIs")){if(b.gtype%10==1){this.pointArray.push(b);
}else{this.polygonArray.push(b);
}if(this.parent&&this.groupId!=null){this.initFOI(b);
}}}};
MVFOIGroup.prototype.initCluster=function(){this.gridSizeInX=this.threshold/this.parent.pixPerX;
this.gridSizeInY=this.threshold/this.parent.pixPerY;
if(this.parent.wraparound){var b=this.parent.wrapAroundLayer(this.getLayerWidth());
if(!b){this.minX=MVUtil.keepInCSBoundary(this.parent,this.minX);
this.maxX=MVUtil.keepInCSBoundary(this.parent,this.maxX);
}else{this.minX=this.parent.msi.coverMinX;
this.maxX=this.parent.msi.coverMaxX;
}}this.numInX=Math.ceil((this.maxX-this.minX)/this.gridSizeInX);
this.numInY=Math.ceil((this.maxY-this.minY)/this.gridSizeInY);
this.clusters=new Array();
for(var d=0;
d<this.numInX;
d++){var f=new Array();
this.clusters.push(f);
for(var a=0;
a<this.numInY;
a++){f.push(null);
}}this.horizontalGrids=new Array(this.numInX);
this.horizontalGrids[0]=this.minX;
this.verticalGrids=new Array(this.numInY);
this.verticalGrids[0]=this.minY;
for(var d=1;
d<=this.numInX;
d++){this.horizontalGrids.push(this.horizontalGrids[d-1]+this.gridSizeInX);
}for(var d=1;
d<=this.numInY;
d++){this.verticalGrids.push(this.verticalGrids[d-1]+this.gridSizeInY);
}};
MVFOIGroup.prototype.displayAsCluster=function(){for(var b=0;
b<this.pointArray.length;
b++){var d=this.pointArray[b];
this.addFOIToCluster(d);
}var a=this.mergeAllClusters();
while(a){a=this.mergeAllClusters();
}this.displayAllClusterFOI();
};
MVFOIGroup.prototype.mergeAllClusters=function(){var d=false;
for(var b=0;
b<this.clusters.length;
b++){for(var f=0;
f<this.clusters[b].length;
f++){if(this.clusters[b][f]!=null){var a=this.mergeCluster(b,f);
if(a!=null){d=true;
}}}}return d;
};
MVFOIGroup.prototype.mergeCluster=function(m,l){var h=this.gridSizeInX*this.gridSizeInY;
var b=h;
var f=h;
var k=h;
var a=h;
var r=h;
var d=h;
var g=h;
var o=h;
if(m+1<this.numInX&&this.clusters[m+1][l]!=null){b=this.getSquareDistance(this.clusters[m][l],this.clusters[m+1][l]);
}if(l+1<this.numInY&&this.clusters[m][l+1]!=null){f=this.getSquareDistance(this.clusters[m][l],this.clusters[m][l+1]);
}if(m-1>=0&&this.clusters[m-1][l]!=null){k=this.getSquareDistance(this.clusters[m][l],this.clusters[m-1][l]);
}if(l-1>=0&&this.clusters[m][l-1]!=null){a=this.getSquareDistance(this.clusters[m][l],this.clusters[m][l-1]);
}if(m+1<this.numInX&&l+1<this.numInY&&this.clusters[m+1][l+1]!=null){r=this.getSquareDistance(this.clusters[m][l],this.clusters[m+1][l+1]);
}if(m-1>=0&&l+1<this.numInY&&this.clusters[m-1][l+1]!=null){d=this.getSquareDistance(this.clusters[m][l],this.clusters[m-1][l+1]);
}if(m+1<this.numInX&&l-1>=0&&this.clusters[m+1][l-1]!=null){g=this.getSquareDistance(this.clusters[m][l],this.clusters[m+1][l-1]);
}if(m-1>=0&&l-1>=0&&this.clusters[m-1][l-1]!=null){o=this.getSquareDistance(this.clusters[m][l],this.clusters[m-1][l-1]);
}var n=Math.min(b,Math.min(f,Math.min(k,Math.min(a,Math.min(r,Math.min(d,Math.min(g,o)))))));
if(n<h){if(b==n){this.mergeHorizontal(m,l,1);
return{directionX:1,directionY:0};
}else{if(f==n){this.mergeVertical(m,l,1);
return{directionX:0,directionY:1};
}else{if(k==n){this.mergeHorizontal(m,l,-1);
return{directionX:-1,directionY:0};
}else{if(a==n){this.mergeVertical(m,l,-1);
return{directionX:0,directionY:-1};
}else{if(r==n){this.mergeDiagonal(m,l,1,1);
return{directionX:1,directionY:1};
}else{if(d==n){this.mergeDiagonal(m,l,-1,1);
return{directionX:-1,directionY:1};
}else{if(g==n){this.mergeDiagonal(m,l,1,-1);
return{directionX:1,directionY:-1};
}else{this.mergeDiagonal(m,l,-1,-1);
return{directionX:-1,directionY:-1};
}}}}}}}return null;
}};
MVFOIGroup.prototype.getSquareDistance=function(b,a){return(b.clusterX-a.clusterX)*(b.clusterX-a.clusterX)+(b.clusterY-a.clusterY)*(b.clusterY-a.clusterY);
};
MVFOIGroup.prototype.mergeHorizontal=function(a,d,b){this.clusters[a][d].addCluster(this.clusters[a+1*b][d]);
if(this.clusters[a][d].clusterX<=this.horizontalGrids[a+1*b]){this.removeAllFOIInCluster(this.clusters[a+1*b][d]);
this.clusters[a+1*b][d]=null;
}else{this.removeAllFOIInCluster(this.clusters[a+1*b][d]);
this.clusters[a+1*b][d]=this.clusters[a][d];
this.removeAllFOIInCluster(this.clusters[a][d]);
this.clusters[a][d]=null;
}this.clusterCount--;
};
MVFOIGroup.prototype.mergeVertical=function(a,d,b){this.clusters[a][d].addCluster(this.clusters[a][d+1*b]);
if(this.clusters[a][d].clusterY<=this.verticalGrids[d+1*b]){this.removeAllFOIInCluster(this.clusters[a][d+1*b]);
this.clusters[a][d+1*b]=null;
}else{this.removeAllFOIInCluster(this.clusters[a][d+1*b]);
this.clusters[a][d+1*b]=this.clusters[a][d];
this.removeAllFOIInCluster(this.clusters[a][d]);
this.clusters[a][d]=null;
}this.clusterCount--;
};
MVFOIGroup.prototype.mergeDiagonal=function(a,f,d,b){this.clusters[a][f].addCluster(this.clusters[a+1*d][f+1*b]);
if(this.clusters[a][f].clusterX<=this.horizontalGrids[a+1*d]&&this.clusters[a][f].clusterY<=this.verticalGrids[f+1*b]){this.removeAllFOIInCluster(this.clusters[a+1*d][f+1*b]);
this.clusters[a+1*d][f+1*b]=null;
}else{if(this.clusters[a][f].clusterX>this.horizontalGrids[a+1*d]&&this.clusters[a][f].clusterY>this.verticalGrids[f+1*b]){this.removeAllFOIInCluster(this.clusters[a+1*d][f+1*b]);
this.clusters[a+1*d][f+1*b]=this.clusters[a][f];
this.removeAllFOIInCluster(this.clusters[a][f]);
this.clusters[a][f]=null;
}else{if(this.clusters[a][f].clusterX<=this.horizontalGrids[a+1*d]){if(this.clusters[a][f+1*b]==null){this.clusters[a][f+1*b]=this.clusters[a][f];
}else{this.clusters[a][f+1*b].addCluster(this.clusters[a][f]);
this.clusterCount--;
}}else{if(this.clusters[a+1*d][f]==null){this.clusters[a+1*d][f]=this.clusters[a][f];
}else{this.clusters[a+1*d][f].addCluster(this.clusters[a][f]);
this.clusterCount--;
}}this.removeAllFOIInCluster(this.clusters[a][f]);
this.clusters[a][f]=null;
this.removeAllFOIInCluster(this.clusters[a+1*d][f+1*b]);
this.clusters[a+1*d][f+1*b]=null;
}}this.clusterCount--;
};
MVFOIGroup.prototype.displayAllClusterFOI=function(){var b=this.parent;
var h=0;
this.clusterFOIArray=new Array();
for(var f=0;
f<this.clusters.length;
f++){for(var d=0;
d<this.clusters[f].length;
d++){var a=this.clusters[f][d];
if(a!=null&&a.numberOfPoints>=this.minPointCount){var g=a.createClusterFOI(this.parent,"-CL"+h,this.clusterStyle,this.groupId);
this.displayClusterFOI(g);
h++;
}}}};
MVFOIGroup.prototype.addFOIToCluster=function(f){f.displayed=false;
if(f.geom.srid==null){f.geom.srid=this.parent.srid;
}else{if(f.geom.srid!=this.parent.srid){this.parent.transformGeom(f.geom,this.parent.srid,null,callBack);
}}var b=f.geom.getPointX();
var k=f.geom.getPointY();
if(this.parent.wraparound){var d=this.parent.wrapAroundLayer(this.getLayerWidth());
if(!d){this.minX=MVUtil.keepInCSBoundary(this.parent,this.minX);
this.maxX=MVUtil.keepInCSBoundary(this.parent,this.maxX);
}else{this.minX=this.parent.msi.coverMinX;
this.maxX=this.parent.msi.coverMaxX;
}b=MVUtil.keepInCSBoundary(this.parent,b);
}if(k>=this.minY&&k<=this.maxY&&((b>=this.minX&&b<=this.maxX)||d)){var h=Math.floor((b-this.minX)/this.gridSizeInX);
var g=Math.floor((k-this.minY)/this.gridSizeInY);
var a=this.clusters[h][g];
if(a==null){a=new MVFOICluster(b,k,f);
this.clusters[h][g]=a;
}else{a.addFOI(b,k,f);
}return{x:h,y:g};
}return null;
};
MVFOIGroup.prototype.displayClusterFOI=function(b){this.clusterFOIArray.push(b);
b.parent=this.parent;
this.parent.indFOIsControl.addAndDisplayIndFOI(b);
for(var a=0;
a<b.cluster.foiArray.length;
a++){b.cluster.foiArray[a].displayed=true;
}};
MVFOIGroup.prototype.removeAllFOIInCluster=function(b){var f=b.clusterFOIId;
if(f==null){for(var a=0;
a<b.foiArray.length-1;
a++){if(b.foiArray[a].displayed){this.parent.indFOIsControl.removeIndFOI(b.foiArray[a].id,b.foiArray[a]);
}}return;
}var d=this.getFOIById(f);
this.parent.indFOIsControl.removeIndFOI(d.id,d);
b.clusterFOIId=null;
for(var g=0;
g<this.clusterFOIArray.length;
g++){if(this.clusterFOIArray[g]==d){this.clusterFOIArray.splice(g,1);
break;
}}};
MVFOIGroup.prototype.displaySingleFOIInCluster=function(a){for(var b=0;
b<a.foiArray.length;
b++){this.parent.indFOIsControl.addAndDisplayIndFOI(a.foiArray[b]);
a.foiArray[b].displayed=true;
}};
MVFOIGroup.prototype.reDrawClusert=function(b){if(b==null){return;
}var g=b.clusterFOIId;
if(g!=null&&b.numberOfPoints>=this.minPointCount){var d=this.getFOIById(g);
this.parent.indFOIsControl.removeIndFOI(d.id,d);
d.setHTMLElement(b.numberOfPoints,10,10);
this.parent.indFOIsControl.addAndDisplayIndFOI(d);
return;
}this.removeAllFOIInCluster(b);
if(b.numberOfPoints>=this.minPointCount){var f=0;
var a=this.clusterFOIArray.length;
if(a>0){f=parseInt(this.clusterFOIArray[a-1].id.substring(3))+1;
}var h=b.createClusterFOI(this.parent,"-CL"+f,this.clusterStyle,this.groupId);
this.displayClusterFOI(h);
}else{this.displaySingleFOIInCluster(b);
}};
MVFOIGroup.prototype.enableMultiFeatureMarker=function(b,a){this.enableOverLappingMarker=b;
if(a){if(typeof(a)=="string"||a instanceof MVXMLStyle||a instanceof MVStyleMarker){a={style:a};
}if(a.style){this.overlappingStyle=a.style;
}if(a.listWidth){this.listWidth=a.listWidth;
}if(a.listHeight){this.listHeight=a.listHeight;
}}};
MVFOIGroup.prototype.displayOverLayPointFOI=function(a){if(a==null&&a.length<2){return;
}for(var d=0;
d<a.length-1;
d++){if(a[d].overlay||a[d].displayed||!this.pointFOIInRange(a[d])){continue;
}var f=null;
for(var b=d+1;
b<a.length;
b++){if(a[b].overlay||a[b].displayed||!this.pointFOIInRange(a[b])){continue;
}if(a[d].geom.equals(a[b].geom)){a[d].overlay=true;
a[b].overlay=true;
if(f==null){f=new Array(a[d]);
}f.push(a[b]);
}}if(f!=null&&f.length>1){this.showOverLappingMarker(f);
}}};
MVFOIGroup.prototype.showOverLappingMarker=function(f){var b=f[0].geom.clone();
var d=new MVFOI("-OL"+f[0].id,b,this.overlappingStyle,MVGlobalVariables.defaultFoiURL);
d.attachEventListener(MVEvent.MOUSE_OVER,this.showFOIList);
d.attachEventListener(MVEvent.MOUSE_OUT,this.hideFOIList);
d.overLayFOIs=f;
d.groupId=this.groupId;
d.parent=this.parent;
this.overlayFOIArray.push(d);
this.parent.indFOIsControl.addAndDisplayIndFOI(d);
for(var a=0;
a<f.length;
a++){f[a].displayed=true;
f[a].overlayFOI=d;
}};
MVFOIGroup.prototype.showFOIList=function(b,F){var K=document.createElement("table");
var a=document.createElement("tbody");
K.appendChild(a);
var A=F[0].parent;
var n=A.getFOIGroup(F[0].groupId);
var o=MVUtil.getRealOrdinates(A,b.sdo_point.x,F[0].geom.sdo_point.x);
b=MVSdoGeometry.createPoint(o,F[0].geom.sdo_point.y,A.srid);
var H=false;
for(var E=0;
E<F.length;
E++){var M=F[E];
var t=null;
var I=M.serverURL;
if(M.style){if(M.style.getXMLString){t=M.style.getXMLString();
}else{t=M.style;
}I+="?request=getpoiimage&version=1.0&poistyle="+encodeURIComponent(t)+"&width="+M.width+"&height="+M.height;
}var D=M.infoTip!=null&&M.infoTip!=""?M.infoTip:M.id;
var k=document.createElement("tr");
a.appendChild(k);
var B=document.createElement("td");
var v=document.createElement("td");
k.appendChild(B);
k.appendChild(v);
if(I!=""){var l=null;
var f=I.toLowerCase().indexOf(".png")==-1?false:true;
if(MVGlobalVariables.browser=="IF"&&(M.style!=""||f)){l=MVUtil.createImageNode(I,true);
}else{l=document.createElement("img");
l.src=I;
}l.ifctl=A.indFOIsControl;
l.groupid=M.groupId;
l.id=M.id;
l.style.width=MVUtil.pixel(M.width);
l.style.height=MVUtil.pixel(M.height);
M.clickPoint=b;
A.indFOIsControl.setIndFOIListners(M,l);
if(M.html){var s=document.createElement("div");
s.style.position="absolute";
var g=M.htmlAlign;
var C=M.htmlVAlign;
s.style.left=MVUtil.pixel(g);
s.style.top=MVUtil.pixel(C);
s.style.padding=MVUtil.pixel(0);
var d=document.createElement("div");
d.style.position="relative";
d.style.width=MVUtil.pixel(M.width);
d.style.height=MVUtil.pixel(M.height);
d.appendChild(l);
d.appendChild(s);
s.innerHTML=M.html;
B.appendChild(d);
B.style.verticalAlign="top";
}else{B.appendChild(l);
}}else{if(M.isHTMLFOI){var u=document.createElement("div");
u.style.position="relative";
var z=MVUtil.checkRealSize(M.parent,u);
var r=z.width;
var J=z.height;
u.ifctl=A.indFOIsControl;
u.groupid=M.groupId;
u.id=M.id;
u.style.width=MVUtil.pixel(r);
M.clickPoint=b;
B.appendChild(u);
u.innerHTML=M.html;
A.indFOIsControl.setIndFOIListners(M,u);
B.width=MVUtil.pixel(r);
B.height=MVUtil.pixel(J);
var L=M.html.toLowerCase();
if(L.indexOf("img")>0){H=true;
B.id="_MFLC"+E;
}}}var N=document.createElement("a");
N.style.cssText="font:11px normal Tahoma;color: #000000";
N.href="javascript:void(0)";
N.index=E;
N.onclick=function(h){h=(h)?h:((window.event)?event:null);
var O=F[this.index];
if(O.onClickListener||(O.EventListeners[MVEvent.MOUSE_CLICK]!=null&&O.EventListeners[MVEvent.MOUSE_CLICK].length!=0)){A.stopDragging();
if(O.onClickListener){O.onClickListener(b,O,MVUtil.getEvent(h));
}MVUtil.runListeners(O.EventListeners,MVEvent.MOUSE_CLICK,[b,O,MVUtil.getEvent(h)]);
}else{if(O.showInfoWindow&&O.infoStr){var w=new MVInfoWindowTab(O.infoTitle,O.infoStr);
var m=new Array(w);
if(O.windowW>0&&O.windowH>0){A.infoLayer.showFOIWindow(O.id,b.sdo_point.x,b.sdo_point.y,m,0,O.windowW,O.windowH,O.infoStyle,O.infoTitle);
}else{A.infoLayer.showFOIWindow(O.id,b.sdo_point.x,b.sdo_point.y,m,0,null,null,O.infoStyle,O.infoTitle);
}return;
}}};
v.appendChild(N);
N.innerHTML=D;
}var G=MVUtil.checkRealSize(A,K);
if(G.width+MVInfoWindowStyle4.MultiFeatureListTotalMarginWidth<n.listWidth&&G.height+MVInfoWindowStyle4.TotalMarginHeight<n.listHeight){A.showOverLayerMarkWindow(b,K);
}else{A.showOverLayerMarkWindow(b,K,n.listWidth,n.listHeight);
}if(H&&MVGlobalVariables.browser!="IF"){n.redrawMultiFOIList=setTimeout(n.checkSize,500,b,F);
}};
MVFOIGroup.prototype.checkSize=function(f,g){var l=g[0].parent;
var h=l.getFOIGroup(g[0].groupId);
for(var d=0;
d<g.length;
d++){var a="_MFLC"+d;
var k=document.getElementById(a);
if(k&&k.childNodes.length>0&&k.childNodes[0]){var b=k.childNodes[0];
var m=MVUtil.getRealSize(b);
if(k.offsetWidth<m.width||k.offsetHeight<m.height){h.showFOIList(f,g);
break;
}}}};
MVFOIGroup.prototype.hideFOIList=function(d,g){var b=g[0].parent;
var f=b.getFOIGroup(g[0].groupId);
if(f.redrawMultiFOIList){clearTimeout(f.redrawMultiFOIList);
}var a=function(){if(b.infoLayer&&b.infoLayer.mouseOnInfoWindow||b.infoLayer2&&b.infoLayer2.mouseOnInfoWindow){b.removeOverLayerWindow=setTimeout(a,100);
}else{b.removeOverLayerMarkWindow();
clearTimeout(b.removeOverLayerWindowTime);
}};
b.removeOverLayerWindow=setTimeout(a,100);
};
MVFOIGroup.prototype.pointFOIInRange=function(d){var a=d.geom.getPointX();
var f=d.geom.getPointY();
var b=this.parent.wrapAroundLayer(this.getLayerWidth());
if(this.parent.wraparound&&!b){this.minX=MVUtil.keepInCSBoundary(this.parent,this.minX);
this.maxX=MVUtil.keepInCSBoundary(this.parent,this.maxX);
}if(f>=this.minY&&f<=this.maxY&&((a>=this.minX&&a<=this.maxX)||b)){return true;
}else{return false;
}};
MVFOIGroup.prototype.removeFOIfromOverLayerGroup=function(f){if(f.overlayFOI){for(var b=0;
b<f.overlayFOI.overLayFOIs.length;
b++){if(f.overlayFOI.overLayFOIs[b]==f){f.overlayFOI.overLayFOIs.splice(b,1);
if(f.overlayFOI.overLayFOIs.length<2){var d=f.overlayFOI.overLayFOIs[0];
d.overlayFOI=null;
this.parent.indFOIsControl.addAndDisplayIndFOI(d);
this.parent.indFOIsControl.removeIndFOI(f.overlayFOI.id,f.overlayFOI);
for(var a=0;
a<this.overlayFOIArray.length;
a++){if(this.overlayFOIArray[a]==f.overlayFOI){this.overlayFOIArray.splice(a,1);
break;
}}}f.overlayFOI=null;
return;
}}}};
MVFOIGroup.prototype.addFOItoOverLayerGroup=function(d){for(var a=0;
a<this.pointArray.length;
a++){if(this.pointArray[a].displayed&&this.pointArray[a].geom.equals(d.geom)&&this.pointArray[a].id!=d.id){if(this.pointArray[a].overlayFOI){this.pointArray[a].overlayFOI.overLayFOIs.push(d);
d.displayed=true;
d.overlayFOI=this.pointArray[a].overlayFOI;
}else{var b=new Array(this.pointArray[a]);
this.parent.indFOIsControl.removeIndFOI(this.pointArray[a].id,this.pointArray[a]);
b.push(d);
this.showOverLappingMarker(b);
}return true;
}}return false;
};
MVFOIGroup.prototype.getSelectedFOIByMouseLocation=function(g){var d=this.polygonArray.length;
for(var s=d-1;
s>=0;
s--){var z=this.polygonArray[s];
if(z.isVisible()&&z.node){var l=this.parent.getEventCoords(g);
var w=MVUtil.getLeft(z.node);
var r=MVUtil.getTop(z.node);
var v=MVUtil.getLeft(this.polygonDiv);
var n=MVUtil.getTop(this.polygonDiv);
var t=MVUtil.getLeft(this.parent.div);
var k=MVUtil.getTop(this.parent.div);
var o=l.left-(w+v+t);
var m=l.top-(r+n+k);
var f=z.vertx;
var b=z.verty;
var h=z.vertMBR;
if(f!=null&&b!=null){var u=f.length;
c=MVUtil.pointInPolygonTest(o,m,u,f,b,h);
if(c){return z;
}}}}return null;
};
MVMapView.version="Ver11.1.1.7.1_B130528";
