var theAlert=window.alert;window.alert=null;var mv_blnInit=!1,mv_Doc=null,mv_Map=null,mv_Overview=null,mv_Scalebar=null,mv_Measure=null,mv_HighlightColors=null,mv_SelRecColors=null,mv_GraphColors=[],mv_XMLFileArray={},mv_ImgInfo=[];function mv_testRoot(){try{null==dojo.byId("MVmapDoc").getSVGDocument().getElementById("map")?mv_checkRootLoaded():mv_init()}catch(a){console.log("mv_testRoot: "+a),mv_checkRootLoaded()}}function mv_checkRootLoaded(a){window.setTimeout(mv_testRoot,200)}
function mv_testEmbedMap(){try{null==dojo.byId("MVmapDoc").getSVGDocument()?mv_checkLoaded():mv_checkRootLoaded()}catch(a){console.log("mv_testEmbedMap: "+a),mv_checkLoaded()}}function mv_checkLoaded(){window.setTimeout(mv_testEmbedMap,200)}
function mv_init(){try{document.implementation.hasFeature("XPath","3.0")&&(window.Document&&!window.XMLDocument&&(window.XMLDocument=window.Document),XMLDocument.prototype.selectNodes=function(a,c){c||(c=this);for(var d=this.createNSResolver(this.documentElement),d=this.evaluate(a,c,d,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null),e=[],f=0;f<d.snapshotLength;f++)e[f]=d.snapshotItem(f);return e},XMLDocument.prototype.selectSingleNode=function(a,c){c||(c=this);var d=this.selectNodes(a,c);return 0<d.length?
d[0]:null},Element.prototype.selectNodes=function(a){if(this.ownerDocument.selectNodes)return this.ownerDocument.selectNodes(a,this);throw"For XML Elements Only";},Element.prototype.selectSingleNode=function(a){if(this.ownerDocument.selectSingleNode)return this.ownerDocument.selectSingleNode(a,this);throw"For XML Elements Only";})}catch(a){}mv_declareClassList();mv_declareClassDoc();mv_Doc=new MV.Doc;mv_DocSettings();mv_declareClassColor();mv_declareClassPoint();mv_declareClassSymbol();mv_declareClassMap();
mv_Map=new MV.Map;mv_MapSettings();mv_declareClassXMLFiles();null!=document.MVformZoom&&(document.MVformZoom.MVlistZoom.selectedIndex=0);mv_initializeLegend();mv_testLayers(0)}function mv_testLayers(a){a<mv_Map.getLayerList().length?mv_testLayer(a):mv_init2()}function mv_checkLayerLoaded(a){window.setTimeout("mv_testLayer("+a+")",200)}
function mv_testLayer(a){try{var b=mv_Map.getLayerList()[a],c=mv_Map.Root.getElementById(b.id);null==c?mv_checkLayerLoaded(a):(mv_setMVNSLayerproperties(b.SVGLayerProp,c),null!=b.TxtLayers?mv_testTxtLayers(a,0):mv_testLayers(a+1))}catch(d){mv_checkLayerLoaded(a)}}function mv_testTxtLayers(a,b){var c=mv_Map.getLayerList()[a];b<c.TxtLayers.length?mv_testTxtLayer(a,b):mv_testLayers(a+1)}function mv_checkTxtLayerLoaded(a,b){window.setTimeout("mv_testTxtLayer("+a+","+b+")",200)}
function mv_testTxtLayer(a,b){var c=mv_Map.getLayerList()[a],d=mv_Map.Root.getElementById(c.id+c.TxtLayers[b].id);null==d?mv_checkTxtLayerLoaded(a,b):(mv_setMVNSLayerproperties(c.TxtLayers[b],d),mv_testTxtLayers(a,b+1))}
function mv_setMVNSLayerproperties(a,b){a.MinScale=parseFloat(b.getAttributeNS(mv_Doc.ProgNS,"minscale"));a.MaxScale=parseFloat(b.getAttributeNS(mv_Doc.ProgNS,"maxscale"));a.ScaleEle=b.getAttributeNS(mv_Doc.ProgNS,"scaleEle");a.StyleProp=b.getAttributeNS(mv_Doc.ProgNS,"styleprop")}
function mv_init2(){var a=mv_Map.Root.getElementById("mapContent");mv_Map.MinScale=parseFloat(a.getAttributeNS(mv_Doc.ProgNS,"minscale"));mv_Map.MaxScale=parseFloat(a.getAttributeNS(mv_Doc.ProgNS,"maxscale"));null!=dojo.byId("MVoverviewDoc")&&(mv_declareClassOverview(),mv_Overview=new MV.Overview,mv_Doc.IsMobile&&(mv_Overview.WinMap.addEventListener("touchstart",mv_beginMobileOverviewPan,!1),mv_Overview.WinMap.addEventListener("touchmove",mv_doMobileOverviewPan,!1),mv_Overview.WinMap.addEventListener("touchend",
mv_endMobileOverviewPan,!1)));a=null!=dojo.byId("MVoverviewDoc")?"w":"a";a+=mv_Map.Precision.toString()+mv_Map.XOrigin.toString().substr(1,1)+"uM";a+=mv_Doc.HiColor.substr(2,1).toUpperCase()+mv_Map.LegMapKoeff.toString().substr(mv_Map.LegMapKoeff.toString().length-1,1);if(mv_Doc.CheckStatus!=a){var b="Mappetizer Travel Diary - ";if(0==document.title.indexOf(b))for(var a=document.title.substr(document.title.indexOf(b)+b.length),b=a.split(" "),a=String.fromCharCode(60+a.length),c=0;c<b.length;++c)a+=
b[c].charAt(1).toLowerCase()+(b[c].charCodeAt(0)+2*c)+String.fromCharCode(50+c+a.length)}mv_Doc.CheckStatus!=a&&(mv_Doc.CheckStatus="Demo");null!=mv_Map.WinMap&&0==mv_Doc.PrintStatus&&(dojo.isFF?mv_Map.WinMap.addEventListener("DOMMouseScroll",mv_zoomMouseWheel,!1):9>dojo.isIE&&0==mv_Map.Layers.hasTileServerLayers()?document.getElementById("MVmapDoc").attachEvent("onmousewheel",mv_zoomMouseWheel):mv_Map.WinMap.addEventListener("mousewheel",mv_zoomMouseWheel,!1));mv_setPanEvent(!0);mv_Doc.IsMobile&&
(mv_Map.WinMap.addEventListener("touchstart",mv_beginMobileMapPan,!1),mv_Map.WinMap.addEventListener("touchmove",mv_doMobileMapPan,!1),mv_Map.WinMap.addEventListener("touchend",mv_endMobileMapPan,!1));mv_initializeSettings();mv_Map.Scalebar?window.setTimeout(mv_testScalebar,100):mv_init3()}function mv_checkScalebarLoaded(){window.setTimeout(mv_testScalebar,100)}function mv_testScalebar(){null==mv_Map.Root.getElementById("scalebar")?mv_checkScalebarLoaded():mv_init3()}
function mv_init3(){mv_Map.Root.getElementById("scalebar")&&(mv_declareClassScalebar(),mv_Scalebar=new MV.Scalebar,mv_ScalebarSettings());mv_Map.resize(mv_Doc.ResizeMap);mv_Doc.resize();mv_Doc.ResizeMap&&(mv_scaleSym(mv_Map.DefaultExt.Height/mv_Map.CurrentExt.Height*mv_Map.ScaleFakt),mv_Map.LegMapKoeff=mv_Map.LegMapKoeff*mv_Map.DefaultExt.Height/mv_Map.CurrentExt.Height,mv_Map.InitScale=mv_Map.DefaultExt.Height/mv_Map.CurrentExt.Height);0==mv_Doc.PrintStatus&&mv_checkVisThemes(mv_Map.Layers,!0);null!=
mv_Scalebar&&"WebMercator"==mv_Map.Projection&&mv_Scalebar.changeScalebar();mv_Map.addExtentToList();mv_userInit();mv_initializeSettings2();mv_writeDemoPath();dojo.style(dojo.body(),"visibility","visible");mv_Doc.PrintStatus&&mv_printPage();mv_blnInit=!0}
function mv_writeDemoPath(){if("Demo"==mv_Doc.CheckStatus&&!mv_Doc.PrintStatus){var a=mv_Map.Root.createElementNS("http://www.w3.org/2000/svg","defs"),b=mv_makeSVGNode(mv_Map.Root,"path",{id:"demopath",d:"M "+mv_Map.DefaultVB.X+" "+mv_Map.DefaultVB.Y+"l "+mv_Map.DefaultVB.Width+" "+mv_Map.DefaultVB.Height});mv_appendNode(b,a,mv_Map.Map);b=(mv_Map.CurrentExt.Width+mv_Map.CurrentExt.Height)/6*mv_Map.LegMapKoeff;0==b&&(b=100);var a=mv_makeSVGNode(mv_Map.Root,"text",{id:"demotext","font-size":b,fill:"grey",
"fill-opacity":.6,"pointer-events":"none"}),c=mv_Map.Root.createTextNode("DEMO"),d=mv_Map.Root.createElementNS("http://www.w3.org/2000/svg","textPath");d.setAttributeNS("http://www.w3.org/1999/xlink","href","#demopath");d.setAttributeNS(null,"startOffset","15%");d.appendChild(c);mv_appendNode(d,a,mv_Map.Map);dojo.isFF&&(a=mv_makeSVGNode(mv_Map.Root,"text",{x:0,y:200,"font-size":b/12,fill:"grey","fill-opacity":.6,"pointer-events":"none"},"DEMO"),mv_Map.Map.appendChild(a))}}
function mv_updateDemoPath(){if("Demo"==mv_Doc.CheckStatus){var a=mv_Map.Root.getElementById("demopath");if(null!=a){a.setAttributeNS(null,"d","M "+mv_Map.CurrentVB.X+" "+mv_Map.CurrentVB.Y+"l "+mv_Map.CurrentVB.Width+" "+mv_Map.CurrentVB.Height);var b=(mv_Map.CurrentExt.Width+mv_Map.CurrentExt.Height)/6*mv_Map.LegMapKoeff/mv_Map.Scale,a=mv_Map.Root.getElementById("demotext");a.setAttributeNS(null,"font-size",b)}}}
function mv_declareClassList(){dojo.declare("MV.List",null,{constructor:function(){this.List=[]},addMe:function(a){this.List.push(a)},item:function(a){if(0==isNaN(a))return this.List[a];for(var b=0;b<this.List.length;b++)if(this.List[b].id==a)return this.List[b];return null},exists:function(a){for(var b=0;b<this.List.length;b++)if(this.List[b].id==a)return!0;return!1},length:function(){return this.List.length},deleteItem:function(a){if(0==isNaN(a))return this.List.splice(a,1);for(var b=0;b<this.List.length;b++)if(this.List[b].id==
a)return this.List.splice(b,1);return null},deleteMe:function(){this.List=[]},killMe:function(){this.List=[]}})}
function mv_declareClassDoc(){dojo.declare("MV.LegLayout",null,{LegKastOffset:16,LegKastWidth:24,LegKastX:2,LegKastXText:36,GroupLegOffset:18,constructor:function(){},legKastExtent:function(){return{h:this.LegKastOffset,w:this.LegKastWidth}}});dojo.declare("MV.Doc",null,{Task:"",BaseURL:"",ZoomObjects:new MV.List,ProgNS:"http://www.mappetizer.de",BGColor:"white",BGColor2:"silver",HiColor:"green",HiQueryColor:"yellow",TableColor:"green",TileCount:100,ResizeMap:!0,RowColor:"green",MediaScreen:"",FullWin:"MVFullWin",
TableWin:null,Toolbars:null,Language:void 0,WinSettings:"toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes",TableWinSettings:"width=800,height=600,top=50,left=50,toolbar=no,menubar=no,location=no,hotkeys=no,resizable=yes,scrollbars=yes,dependent=yes,status=no",CategoriesTabContainer:"MVcategoriesContainer",ShortListContainer:"MVidentifyContainer",VisPoints:[],CheckStatus:"Demo",WikiLang:"en",Lang:"de",DefLang:"de",Para:null,TrkMarker:null,PrintStatus:!1,IsMobile:!1,ShowHyperlinks:"bestOf",
constructor:function(){-1!=location.href.lastIndexOf("/")&&(this.BaseURL=location.href.substring(0,location.href.lastIndexOf("/")+1));this.Texts={};this.LegLayout=new MV.LegLayout;-1<navigator.userAgent.toLowerCase().search(/(iphone|ipod|ipad|opera mini|opera mobile|fennec|palm|blackberry|android|symbian|series60)/)&&(this.IsMobile=!0)},userSettings:function(a,b,c,d,e,f,g){this.BGColor=a;this.BGColor2=b;this.HiColor=c;this.HiQueryColor=d;this.TableColor=e;this.ResizeMap=f;g&&mv_declareClassTiles()},
showHyperlinks:function(){return this.ShowHyperlinks},getText:function(a,b){var c=this.Texts[a];return"undefined"!=typeof c?c:b},setMapTab:function(){mv_oExists(dojo.byId("MVmapContainer"))&&dijit.byId("MVtabContainer").selectChild("MVmapContainer")},isSmartPhoneLayout:function(){return"smartphone"==this.MediaScreen?!0:!1},resize:function(){var a=mv_getMediaScreen();if(a!=this.MediaScreen&&(this.MediaScreen=a,this.swapContent(a,"MVlegend"),"undefined"!=typeof mv_Query&&this.swapContent(a,"MVquery"),
"smartphone"!=a)){if("smallscreen"==a&&mv_oExists(mv_Doc.SelectDependents))for(a=0;a<mv_Doc.SelectDependents.length;a++)mv_Doc.SelectDependents[a].init();if(null!=mv_Map.Identifys&&0<mv_Map.Identifys.length()){var b=mv_Map.Identifys.item(mv_Map.Identifys.length()-1),a=b.id,b=b.data.Status;mv_deleteTPs(mv_Map.Identifys);mv_identify(a,b)}mv_mapTipOut()}},swapContent:function(a,b){var c=dojo.byId(b+"Content");if(null!=c){var d=dijit.byId(b+"FP");"undefined"!=typeof d&&d.destroy();try{switch(a){case "smallscreen":dojo.byId(b+
"ContentContainer").appendChild(c);break;case "screen":dojo.byId(b+"Container").appendChild(c);break;case "smartphone":dojo.byId(b+"Container").appendChild(c)}}catch(e){}}}})}
function mv_declareClassXMLFiles(){dojo.declare("MV.XMLHeadings",MV.List,{PDispF:"",SortF:"",PointerF:"",SliderTitle:"",Summary:"",constructor:function(a){this.XMLNode=a;this.loadHeadings()},loadHeadings:function(){if(!(0<this.length())){null!=this.XMLNode.getAttribute("pdispf")&&(this.PDispF=this.XMLNode.getAttribute("pdispf"));null!=this.XMLNode.getAttribute("sortf")&&(this.SortF=this.XMLNode.getAttribute("sortf"));null!=this.XMLNode.getAttribute("pointerf")&&(this.PointerF=this.XMLNode.getAttribute("pointerf"));
null!=this.XMLNode.getAttribute("summary")&&(this.Summary=this.XMLNode.getAttribute("summary"));null!=this.XMLNode.getAttribute("sltitle")&&(this.SliderTitle=this.XMLNode.getAttribute("sltitle"));for(var a=0;a<this.XMLNode.childNodes.length;a++){var b=this.XMLNode.childNodes.item(a);1==b.nodeType&&(b=new MV.XMLHeading(b,a),-1!=this.PDispF.indexOf("##"+b.NodeName+"##")&&""==this.SortF&&(this.SortF=b.NodeName),this.addMe(b))}}},sliderLabels:function(){for(var a=[],b=0;b<this.length();b++)null!=this.item(b).SliderLabel&&
a.push(this.item(b).SliderLabel);return a},sliderFieldStart:function(){for(var a=0;a<this.length();a++)if(null!=this.item(a).SliderLabel)return this.item(a).NodeName;return""},getHeadings:function(){return this.List},getHeadingByName:function(a){for(var b=0;b<this.length();b++)if(this.item(b).Name==a)return this.item(b);return null},getHeadingByNodeName:function(a){for(var b=0;b<this.length();b++)if(this.item(b).NodeName==a)return this.item(b);return null},setName:function(a){return this.substitute(this.PDispF,
a)},substitute:function(a,b){if(""==a)return"";for(var c=0;c<this.length();c++){var d=this.item(c);if(-1!=a.indexOf("##"+d.NodeName+"##")){var e;try{e=b.selectSingleNode("c/"+d.NodeName).firstChild.nodeValue}catch(f){e=this.substituteFieldValue(b,d.Name)}if(""==e)try{var g=b.getAttribute("id");e=Number(g.substring(g.indexOf("rec")+3))}catch(f){}a=a.replace(new RegExp("##"+d.NodeName+"##",["g"]),e)}}return a},substituteFieldValue:function(a,b){try{for(var c=a.split("|"),d=0;d<c.length;d++)if(c[d].split("##")[0]==
b)return mv_changeUmlaut(c[d].split("##")[1])}catch(e){}return""}});dojo.declare("MV.XMLHeading",null,{Alias:"",Name:"",HasDefault:!1,DefValue:null,DefSubst:"",NodeName:"",Visible:!0,TextPrefix:"",SliderLabel:null,constructor:function(a,b){a.hasChildNodes()&&(this.Alias=a.firstChild.nodeValue);if(null!=a.getAttribute("default")){this.HasDefault=!0;var c=a.getAttribute("default").split(";");this.DefValue=c[0];1<c.length&&(this.DefSubst=c[1])}this.NodeName=a.nodeName;this.Datatype=a.getAttribute("datatype");
null!=a.getAttribute("txtprefix")&&(this.TextPrefix=a.getAttribute("txtprefix"));null!=a.getAttribute("sllab")&&(this.SliderLabel=a.getAttribute("sllab"));null!=a.getAttribute("visible")&&(this.Visible=mv_str2bool(a.getAttribute("visible")));null!=a.getAttribute("fname")&&(this.Name=a.getAttribute("fname"))}});dojo.declare("MV.XMLFile",null,{Count:0,Name:"",XMLFile:null,Graphs:null,Identifies:null,IsValid:!1,constructor:function(a){var b=mv_loadXMLDoc(mv_Doc.BaseURL+"embfiles/"+a+".xml","xml");if(null==
b)return null;dojo.style(dojo.body(),"cursor","wait");this.XMLFile=b;this.TopNode=b.documentElement;if(null==this.TopNode)return null;this.IsValid=!0;this.Name=this.getNodeValue(this.TopNode,"title","");this.Desc=this.getNodeValue(this.TopNode,"desc","");this.id=a;null!=this.TopNode.selectSingleNode("fs")&&(this.Headings=new MV.XMLHeadings(this.TopNode.selectSingleNode("fs")));null!=this.TopNode.selectSingleNode("graphs")&&(this.Graphs=this.TopNode.selectSingleNode("graphs"));a=this.TopNode.selectSingleNode("identify");
null!=a&&(0==a.selectNodes("identify").length?this.Identifies=new MV.XMLChart(a):this.Identifies=a.selectNodes("identify"));this.LoadedFiles=[];a=this.TopNode.selectSingleNode("files");dojo.style(dojo.body(),"cursor","auto");if(null!=a&&a.hasChildNodes()){this.RecArray=[];for(b=0;b<a.childNodes.length;b++){var c=a.childNodes.item(b);1==c.nodeType&&c.hasChildNodes()&&this.RecArray.push(c.firstChild.nodeValue)}this.Count=this.RecArray.length}},loadFile:function(a){dojo.style(dojo.body(),"cursor","wait");
var b=mv_loadXMLDoc(mv_Doc.BaseURL+"embfiles/"+this.id+"_"+a+".xml","xml");if(null==b)return null;b=b.documentElement;if(null==b)return null;b=b.selectSingleNode("records").cloneNode(!0);if(0==this.LoadedFiles.length)this.TopNode.appendChild(b);else{for(var c=!1,d=0;d<this.LoadedFiles.length;d++)if(a<this.LoadedFiles[d]){c=this.TopNode.selectSingleNode("records[@id = '"+this.id+"_"+this.LoadedFiles[d]+"']");this.TopNode.insertBefore(b,c);c=!0;break}0==c&&this.TopNode.appendChild(b)}this.LoadedFiles.push(a);
this.LoadedFiles.sort(mv_numsort);dojo.style(dojo.body(),"cursor","auto")},loadAll:function(){if(this.Count!=this.LoadedFiles.length)for(var a=0;a<this.Count;a++)0==this.fileIsLoaded(a)&&this.loadFile(a)},fileIsLoaded:function(a){for(var b=0;b<this.LoadedFiles.length;b++)if(a==this.LoadedFiles[b])return!0;return!1},getRecord:function(a){var b=this.TopNode.selectSingleNode("records/rec[@id = '"+a+"']");if(null==b&&0<this.Count){for(var b=Number(a.substring(a.indexOf("rec")+3)),c=0;c<this.RecArray.length;c++)if(b<
this.RecArray[c]){this.loadFile(c);break}b=this.TopNode.selectSingleNode("records/rec[@id = '"+a+"']")}return b},getNode:function(a){try{return this.TopNode.selectSingleNode(a)}catch(b){return null}},setProperty:function(a,b){try{this.XMLFile.setProperty(a,b)}catch(c){}},query:function(a){this.setProperty("SelectionLanguage","XPath");a=mv_makeSQLString(a);return this.TopNode.selectNodes("records/rec/c["+a+"]")},queryTableLink:function(a){return this.TopNode.selectNodes("records/rec[TL = '"+a+"']")},
getRecords:function(){return this.TopNode.selectNodes("records/rec")},recsSortByField:function(a,b,c,d){for(var e=[],f=0,g=a.length;f<g;f++)try{var h=a[f].selectSingleNode(b).firstChild.nodeValue;0==c&&(h=parseFloat(h));0==d?e.push({name:h,obj:a[f]}):e.push({name:h,obj:a[f].parentNode})}catch(l){}0==c?(a=e.slice(0),a.sort(function(a,b){return a.name-b.name})):(a=e.slice(0),a.sort(function(a,b){var c=a.name.substr(0,1).toLowerCase(),d=b.name.substr(0,1).toLowerCase();return c<d?-1:c>d?1:0}));return a},
getUniques:function(a,b,c){for(var d=[],e=0,f=a.length;e<f;e++){try{var g=a[e].selectSingleNode(b).firstChild.nodeValue}catch(h){continue}d.push(g)}d=d.unique();0==c?d.sort(mv_numsort2):d.sort();return d},count:function(){return this.TopNode.getElementsByTagName("rec").length},getNodeValue:function(a,b,c){try{return a.selectSingleNode(b).firstChild.nodeValue}catch(d){return c}},getFirstRec:function(){if(0<this.Count){0==this.fileIsLoaded(0)&&this.loadFile(0);var a=this.TopNode.selectSingleNode("records[@id = '"+
this.id+"_0']")}else a=this.TopNode.selectSingleNode("records");for(a=a.firstChild;null!=a;){if(1==a.nodeType)return a;a=a.nextSibling}},getHeadings:function(){return this.Headings.getHeadings()},sliderLabels:function(){return this.Headings.sliderLabels()},sliderFieldStart:function(){return this.Headings.sliderFieldStart()},sliderTitle:function(){return this.Headings.SliderTitle}});dojo.declare("MV.XMLChart",null,{Node:null,constructor:function(a){this.Node=a},getDesc:function(){},getChartInfo:function(a,
b,c){if(c)try{return mv_str2bool(mv_getXMLAttrValue(this.Node.selectSingleNode("chart").selectSingleNode("enlarged"),a,b))}catch(d){return b}else try{return mv_str2bool(mv_getXMLAttrValue(this.Node.selectSingleNode("chart"),a,b))}catch(d){return b}},getNodeValue:function(a,b,c){"undefined"==typeof c&&(c=this.Node);try{return c.selectSingleNode(a).firstChild.nodeValue}catch(d){return b}}})}
function mv_loadAttrTableFile(a,b){null==mv_XMLFileArray[a]&&(mv_XMLFileArray[a]=new MV.XMLFile(a));if(0==mv_XMLFileArray[a].IsValid)return null;b&&mv_XMLFileArray[a].loadAll();return mv_XMLFileArray[a]}
function mv_declareClassMap(){dojo.declare("MV.Layer",null,{TxtLayers:null,Layertype:"FeatureLayer",SymXMLNode:null,Renderer:null,Settings:null,Name:null,VB:null,TileRules:null,BaseGroup:null,Layers:null,ServiceId:"",LayerObj:null,HasLegend:!1,HasAttrTable:!1,HasInfo:!1,symbols:null,InLegend:!0,TurnedOn:!0,Visible:!0,XMLAccess:!0,TxtIds:"",Data:"",FeatureCount:0,constructor:function(a,b){dojo.safeMixin(this,b);this.id=a;this.SVGLayerProp=new MV.SVGLayerProperties(a);this.SVGLayerProp.Visible=this.Visible;
if("OSMLayer"==this.Layertype||"WMSLayer"==this.Layertype||"WMTSLayer"==this.Layertype||"BaseLayer"==this.Layertype)this.BaseGroup=new MV.List;"OSMLayer"==this.Layertype&&this.BaseGroup.addMe(new MV.MapTileServer("","OSM","http://tile.openstreetmap.org/",!0));"WeatherLayer"==this.Layertype&&(this.doSingleWeather=!0);"PanoramioLayer"==this.Layertype&&(this.imgCount=50);"WMSLayer"==this.Layertype&&""!=this.Data&&this.BaseGroup.addMe(new MV.WMSServer("","WMS",this.Data));if("WMTSLayer"==this.Layertype&&
""!=this.Data){var c=new MV.WMTSServer("","WMTS",this.Data);dojo.safeMixin(c,b);this.BaseGroup.addMe(c)}"BaseLayer"==this.Layertype&&(this.ServiceId=this.Data);0==this.XMLAccess&&(mv_declareClassDBModule(),this.DB=new MV.DBModule(this.Data));if("GroupLayer"==this.Layertype||"GPXLayer"==this.Layertype||"GPXRootLayer"==this.Layertype||"TrackingRootLayer"==this.Layertype)this.Layers=new MV.LayerList;if(""!=this.TxtIds){this.TxtLayers=[];for(var c=this.TxtIds.split(","),d=0;d<c.length;++d)this.TxtLayers.push(new MV.SVGLayerProperties(c[d]))}this.IdentifyObj=
{};this.IdentifyObj.Container="MVidentify";this.IdentifyObj.DeleteRecInMap=!1;this.IdentifyObj.ShowHeadings=!0;this.IdentifyObj.FPMultiple=!1;mv_XMLFileArray[a]=null;-1<a.lastIndexOf("-")?(c=a.substring(0,a.lastIndexOf("-")),c=mv_Map.Layers.item(c),this.addToParentLayer(c)):"TrackingLayer"==this.Layertype?(c=mv_Map.Layers.getLayerByType("TrackingRootLayer"),this.addToParentLayer(c)):mv_Map.Layers.addMe(this)},getTxtLayerSVGLayerProp:function(a){for(var b=0;b<this.TxtLayers.length;b++)if(this.TxtLayers[b].id==
a)return this.TxtLayers[b]},getIdentifyContainer:function(){return this.IdentifyObj.Container+"Container"},getTPAppendNode:function(a){switch(a){case "route":return"MVidentifyRoute";case "graph":return"MVgraphContainer";default:return this.IdentifyObj.Container+"List"}},addToParentLayer:function(a){null!=a&&null!=a.Layers&&a.Layers.addMe(this)},hasTileServerLayers:function(){if(null!=this.BaseGroup)for(var a=0;a<this.BaseGroup.length();a++)switch(this.BaseGroup.item(a).declaredClass){case "MV.WMSServer":return!0;
case "MV.WMTSServer":return!0;case "MV.MapTileServer":return!0}return!1},getServiceLayers:function(a){null!=this.Layers&&(a=this.Layers.getServiceLayers(a));return a},getSubLayerByName:function(a){if(null!=this.Layers)for(var b=0;b<this.Layers.length();b++){var c=this.Layers.item(b);if(c.Name==a)return c}return null},getName:function(){return dojo.isObject(this.Name)?mv_getXMLTextValue(this.Name,""):dojo.isString(this.Name)?this.Name:""},getTiles:function(){0!=this.Visible&&null!=this.TileRules&&
this.TileRules.getTiles(this)},isTiled:function(){return"DBLayer"==this.Layertype&&null!=this.TileRules?!0:"TileLayer"==this.Layertype&&null!=this.TileRules?!0:!1},isVectorLayer:function(){return"FeatureLayer"==this.Layertype||"DBLayer"==this.Layertype||"TileLayer"==this.Layertype&&"MV.SVGTileRules"==this.TileRules.declaredClass?!0:!1},displayLegend:function(a){null!=a&&(a=mv_colorMapSettings(a),mv_colorMapLegend(a,this.id+"Legend"))}});dojo.declare("MV.SVGLayerProperties",null,{MinScale:1,MaxScale:1E14,
ScaleEle:null,StypeProp:null,Ele:null,Visible:null,constructor:function(a){this.id=a},checkThemeScale:function(){mv_Map.mapScale()>=this.MinScale&&mv_Map.mapScale()<=this.MaxScale?this.Visible=!0:this.Visible=!1}});dojo.declare("MV.Viewbox",null,{X:null,Y:null,Width:0,Height:0,constructor:function(a,b){"undefined"!=typeof a&&(dojo.isArray(a)?this.set(a):dojo.isObject(a)&&"MV.Point"==a.declaredClass&&(this.X=parseFloat(a.x),this.Y=parseFloat(a.y),"undefined"!=typeof b&&(this.Width=parseFloat(b.x)-
this.X,this.Height=parseFloat(b.y)-this.Y)))},XMax:function(){return parseFloat(this.X+this.Width)},YMin:function(){return parseFloat(this.Y+this.Height)},YMinWMS:function(a){return a?parseFloat(this.Y+this.Height):parseFloat(this.Y-this.Height)},getVBString:function(a){return this.X+","+this.XMax()+","+this.Y+","+this.YMin()+","+a},getViewBoxString:function(){return this.X+" "+this.Y+" "+this.Width+" "+this.Height},set:function(a){this.X=parseFloat(a[0]);this.Y=parseFloat(a[1]);this.Width=parseFloat(a[2]);
this.Height=parseFloat(a[3])},isEmpty:function(){return 0==this.Width&&0==this.Height&&null==this.X&&null==this.Y?!0:!1},centerP:function(){return new MV.Point(this.X+this.Width/2,this.Y+this.Height/2)},union:function(a){if(1!=a.isEmpty())if(this.isEmpty())this.X=a.X,this.Width=a.Width,this.Y=a.Y,this.Height=a.Height;else{var b=Math.min(this.X,a.X),c=Math.max(this.XMax(),a.XMax());this.X=b;this.Width=c-b;b=Math.min(this.Y,a.Y);a=Math.max(this.YMin(),a.YMin());this.Y=b;this.Height=a-b}},pointWithIn:function(a){return a.x<
this.X||a.x>this.XMax()||a.y<this.Y||a.y>this.YMin()?!1:!0}});dojo.declare("MV.TileRules",null,{xMinTile:0,xMaxTile:0,yMinTile:0,yMaxTile:0,XCount:0,YCount:0,constructor:function(a){dojo.safeMixin(this,a)},setTiles:function(){var a=mv_Map.CurrentVB,b=!1;a.XMax()<this.X||a.X>this.X+this.Width||a.Y+a.Height<this.Y||a.Y>this.Y+this.Height||(b=!0);if(0==b)return!1;b=0;0<this.Extent.toString().indexOf(".")&&(b=this.Extent.toString().length-this.Extent.toString().indexOf("."));8<=b&&(b=8);this.xMinTile=
Math.max(0,Math.floor((a.X-this.X)/this.Extent));this.yMinTile=Math.max(0,Math.floor((a.Y-this.Y)/this.Extent));var c=Number((this.X+this.xMinTile*this.Extent).toFixed(b)),d=Number((this.Y+this.yMinTile*this.Extent).toFixed(b));this.xMaxTile=this.xMinTile;this.yMaxTile=this.yMinTile;c=Number((c+this.Extent).toFixed(b));for(d=Number((d+this.Extent).toFixed(b));c<this.X+this.Width&&c<a.X+a.Width;)this.xMaxTile+=1,c=Number((this.X+this.xMaxTile*this.Extent).toFixed(b)),c=Number((c+this.Extent).toFixed(b));
for(;d<this.Y+this.Height&&d<a.Y+a.Height;)this.yMaxTile+=1,d=Number((this.Y+this.yMaxTile*this.Extent).toFixed(b)),d=Number((d+this.Extent).toFixed(b));this.XCount=Math.ceil((this.Width/this.Extent).toFixed(3))-1;this.YCount=Math.ceil((this.Height/this.Extent).toFixed(3))-1;-1<this.XTilesNum&&(this.xMaxTile=Math.min(this.xMaxTile,this.XTilesNum-1));-1<this.YTilesNum&&(this.yMaxTile=Math.min(this.yMaxTile,this.YTilesNum-1));return!0}});dojo.declare("MV.SVGTileRules",MV.TileRules,{IsConstructed:!0,
PartLoadedTiles:0,constructor:function(a,b,c,d){a=mv_Map.Layers.item(b);a.TileRules=this;this.Extent=c;this.Folder=d;this.URLBase=mv_Doc.BaseURL+"svg/"+a.id+"/";this.LoadedTiles=new MV.Tiles},getTiles:function(a){var b=this.Folder;if(0!=this.setTiles()){1==this.IsConstructed&&(this.LoadedTiles.List=[]);for(var c=[],d=this.xMinTile,e=this.xMaxTile,f=this.yMinTile,g=this.yMaxTile;0<=b;){this.addYRow(c,this.URLBase+b+"/","_"+b,f,g,d,e);if(null!=a.TxtLayers&&b==this.Folder)for(var h=0;h<a.TxtLayers.length;h++){var l=
this.URLBase+a.TxtLayers[h].id+"/"+b+"/";this.addYRow(c,l,a.TxtLayers[h].id+"_"+b,f,g,d,e)}b--;d=Math.floor(d/2);e=Math.floor(e/2);f=Math.floor(f/2);g=Math.floor(g/2)}if(null!=a.TxtLayers)for(h=0;h<a.TxtLayers.length;h++)a.Visible&&(l=this.URLBase+a.TxtLayers[h].id+"/"+b+"/",this.addYRow(c,l,a.TxtLayers[h].id+"_"+b,0,0,0,0));this.PartLoadedTiles=c.length;null!=mv_Map.WinMap&&mv_Map.WinMap.mv_loadSVGTiles(window,c);this.IsConstructed=!1}},addYRow:function(a,b,c,d,e,f,g){for(;d<=e;)this.addXRow(a,b,
c,d,f,g),d++},addXRow:function(a,b,c,d,e,f){for(;e<=f;)this.addTile(a,b,c,e,d),e++},addTile:function(a,b,c,d,e){c=c+"_"+d+"_"+e;if(null==this.LoadedTiles.item(c)||1==this.IsConstructed)this.LoadedTiles.addMe(new MV.Tile(c,-1)),a.push(b+d+"_"+e+"."+this.Ext)},getSpecificTiles:function(a,b){for(var c=[],d=0;d<b.length;d++)if(-1!=b[d].indexOf("_")){var e=b[d].substr(b[d].indexOf("_"));null==this.LoadedTiles.item(e)&&(this.LoadedTiles.addMe(new MV.Tile(e,-1)),e=e.substring(e.indexOf("_")+1),e=this.URLBase+
e.substring(0,e.indexOf("_"))+"/"+e.substr(e.indexOf("_")+1),c.push(e+"."+this.Ext))}null!=mv_Map.WinMap&&mv_Map.WinMap.mv_loadSVGTiles(window,c)}});dojo.declare("MV.DeepZoomRules",MV.TileRules,{URLBase:"",FolderBase:"",Extent:0,XCount:1,YCount:1,XTilesNum:-1,YTilesNum:-1,TileSize:1,constructor:function(a,b,c,d,e,f,g){a=mv_Map.Layers.item(b);a.TileRules=this;this.ImgWidth=e;this.ImgHeight=f;this.TileSize=c;"undefined"!=typeof g&&(this.Rendering=g);this.FolderCount=d;this.MaxFolder=Math.ceil(Math.log(Math.max(this.ImgWidth,
this.ImgHeight))/Math.log(2));this.FolderBase=a.id+"_files"},getTiles:function(a){for(var b=this.Width/mv_Map.CurrentVB.Width*mv_Map.CurrentExt.Width,c=0,d=this.ImgWidth;d/2>b;)c+=1,d/=2;b=this.MaxFolder-c;0>b||(b>this.FolderCount&&(c+=b-this.FolderCount,b=this.FolderCount),this.Extent=this.TileSize/this.ImgWidth*this.Width*Math.pow(2,c),this.Overlap=1/this.ImgWidth*this.Width*Math.pow(2,c),0!=this.setTiles()&&(this.URLBase="../images/"+this.FolderBase+"/"+b+"/",mv_removeSVGele(a.id+"G"),c=this.X+
this.xMinTile*this.Extent,b=this.Y+this.yMinTile*this.Extent,0<this.xMinTile&&(c-=this.Overlap),0<this.yMinTile&&(b-=this.Overlap),d=mv_makeSVGNode(mv_Map.Root,"g",{id:a.id+"G"}),this.addYRow(d,b,c,this.yMinTile,this.yMaxTile,this.xMinTile,this.xMaxTile),mv_Map.Root.getElementById(a.id).appendChild(d)))},addYRow:function(a,b,c,d,e,f,g){0==d&&0!=this.YCount&&(this.addXRow(a,b,c,d,f,g,this.Extent+this.Overlap),b=b+this.Extent-this.Overlap,d++);var h=!0;e==this.YCount&&(e--,h=!1);for(;d<=e;)this.addXRow(a,
b,c,d,f,g,this.Extent+2*this.Overlap),b+=this.Extent,d++;0==h&&this.addXRow(a,b,c,d,f,g,this.Y+this.Height-b)},addXRow:function(a,b,c,d,e,f,g){0==e&&0!=this.XCount&&(this.addTile(a,c,b,this.Extent+this.Overlap,g,e,d),c=c+this.Extent-this.Overlap,e++);var h=!0;f==this.XCount&&(f--,h=!1);for(;e<=f;)this.addTile(a,c,b,this.Extent+2*this.Overlap,g,e,d),c+=this.Extent,e++;0==h&&this.addTile(a,c,b,this.X+this.Width-c,g,e,d)},addTile:function(a,b,c,d,e,f,g){b=mv_makeSVGNode(mv_Map.Root,"image",{x:b,y:c,
width:d,height:e,preserveAspectRatio:"none"});f=this.URLBase+(f+"_"+g+"."+this.Ext);"undefined"!=typeof this.Rendering&&b.setAttributeNS(null,"image-rendering",this.Rendering);b.setAttributeNS("http://www.w3.org/1999/xlink","href",f);a.appendChild(b)}});dojo.declare("MV.Extent",null,{Width:0,Height:0,constructor:function(a,b){"undefined"!=typeof a&&this.set(a,b)},set:function(a,b){this.Width=a;this.Height=b},ratio:function(){return this.Width/this.Height}});dojo.declare("MV.LayerList",MV.List,{constructor:function(){},
getLayerByType:function(a){if(0==a.indexOf("th"))return mv_Map.Layers.item(a);for(var b=0;b<this.List.length;b++){var c=this.List[b];if(c.Layertype==a||null!=c.Layers&&(c=c.Layers.getLayerByType(a),null!=c))return c}return null},hasTileServerLayers:function(){for(var a=0;a<this.List.length;a++){var b=this.List[a];if(1==b.hasTileServerLayers()||null!=b.Layers&&1==b.Layers.hasTileServerLayers())return!0}return!1},item:function(a){if(0==isNaN(a))return this.List[a];for(var b=0;b<this.List.length;b++){if(this.List[b].id==
a)return this.List[b];if(null!=this.List[b].Layers){var c=this.List[b].Layers.item(a);if(null!=c)return c}}return null},fillLayerList:function(a){for(var b=0;b<this.List.length;b++)a.push(this.List[b]),null!=this.List[b].Layers&&this.List[b].Layers.fillLayerList(a)},getServiceLayers:function(a){for(var b=0;b<this.List.length;b++){var c=this.List[b];c.isTiled()&&1==c.TurnedOn&&a.push(c);"WMSLayer"==c.Layertype&&1==c.TurnedOn&&a.push(c);"OSMLayer"==c.Layertype&&1==c.TurnedOn&&a.push(c);null!=c.Layers&&
c.getServiceLayers(a)}return a},getLayerObj:function(a){for(var b=0;b<this.List.length;b++){var c=this.List[b];if(null!=c.LayerObj&&c.LayerObj.declaredClass==a)return c.LayerObj;if(null!=c.Layers&&(c=c.Layers.getLayerObj(a),null!=c))return c}return null}});dojo.declare("MV.Map",null,{Layers:new MV.LayerList,Identifys:null,Scale:1,MinScale:1,MaxScale:1E14,InitScale:1,OrigScale:1,UseScaleInfo:!0,ExtentList:[],ExtentIndex:-1,LoadedLayers:null,Pressed:!1,Point:null,MapPoint:null,MapPointPan:null,MapPointPanUp:null,
MapOrigin:new MV.Point(7,45),Projection:"",WikiRows:30,WikiArray:null,WheelZoomFakt:1.1,ScaleConvert:1,MaxScaleFakt:20,MouseWheelEvt:!0,MouseWheelZoom:!1,XOrigin:0,YOrigin:0,LegMapKoeff:1,NormalizeFactor:1,Precision:0,MapUnits:!1,Scalebar:!1,ScaleFakt:1,DispUnit:1,DispUnitPrecision:2,ColorMapLayer:{},IsBlocked:!1,constructor:function(){var a=dojo.byId("MVmapDoc");root=a.getSVGDocument();if(!root||null==root)return mv_alert("Map is not fully loaded. Please refresh the window"),!1;this.Root=root;var b=
null;if(this.Root&&this.Root.defaultView)b=this.Root.defaultView;else if(a.window)b=a.window;else try{b=a.getWindow()}catch(c){mv_alert("Browser does not support MapViewSVG functionality\n("+c.message+")")}this.WinMap=b;this.Map=this.Root.getElementById("map");a=this.Map.getAttributeNS(null,"viewBox").split(" ");this.DefaultVB=new MV.Viewbox(a);this.VisibleVB=new MV.Viewbox(a);this.CurrentVB=new MV.Viewbox(a);this.ClientVB=new MV.Viewbox(a);this.DefResizeVB=null;this.MapOrigin.y=parseInt(dojo.byId("MVmap").style.top);
this.MapOrigin.x=parseInt(dojo.byId("MVmap").style.left);this.MapWheelSource=new MV.Point(0,0);this.setMapWheelSource();a=500*this.DefaultVB.Width/this.DefaultVB.Height;this.DefaultExt=new MV.Extent(a,500);this.CurrentExt=new MV.Extent(a,500);this.CanvasExt=new MV.Extent(a,500);this.ClientExt=new MV.Extent},userSettings:function(a,b,c,d,e,f,g,h){this.XOrigin=a;this.YOrigin=b;this.LegMapKoeff=c;this.NormalizeFactor=d;this.Precision=e;this.MapUnits=f;this.ScaleConvert=g;this.Projection=h},getLayerList:function(){var a=
[];this.Layers.fillLayerList(a);return a},colorMapLayer:function(a){return"undefined"==typeof a?null==this.ColorMapLayer[1]?null:this.ColorMapLayer[1].split(",").shift():null==this.ColorMapLayer[a]?null:this.ColorMapLayer[a].split(",").shift()},resize:function(a){mv_getMediaScreen();if(a){var b=dojo.byId("MVmap").parentNode;if(0==b.clientWidth||0==b.clientHeight)return;this.ClientExt.Width=b.clientWidth-this.MapOrigin.x-3;this.ClientExt.Height=b.clientHeight-this.MapOrigin.y-4;this.adaptExtent();
this.resizeLimitCheck();this.saveCurrentVB();null!=mv_Overview&&mv_Overview.moveOverRect();this.Map.setAttributeNS(null,"viewBox",this.CurrentVB.X+" "+this.CurrentVB.Y+" "+this.CurrentVB.Width+" "+mv_Map.CurrentVB.Height);(mv_Doc.isSmartPhoneLayout()||mv_Doc.IsMobile)&&mv_getServiceLayers(mv_Map.Layers)}mv_showMapScale();null!=mv_Scalebar&&mv_Scalebar.resize(a);this.setMaxScaleFakt();null!=this.Root.getElementById("bingmap")&&this.Root.getElementById("bingmap").setAttributeNS(null,"y",this.CurrentExt.Height-
57)},resizeLimitCheck:function(){if(this.Scale!=this.getLimitScale(this.Scale)){this.Scale=this.getLimitScale(this.Scale);var a=this.CurrentVB.centerP();mv_centerZoom(a.x,a.y);mv_zoomChange(!0);a=this.Map.getAttributeNS(null,"viewBox").split(" ");this.DefResizeVB=new MV.Viewbox(a);this.OrigScale=this.Scale}},getLimitScale:function(a){var b=this.getScale(this.MinScale);b<=a&&(a=b);b=this.getScale(this.MaxScale);b>=a&&(a=b);return a},setNewMapViewbox:function(a){var b=this.DefaultVB.centerP();mv_centerZoom2(b.x,
b.y);1==this.Scale&&(b=this.Map.getAttributeNS(null,"viewBox").split(" "),this.DefResizeVB=new MV.Viewbox(b),this.ScaleFakt=a,this.LegMapKoeff*=a);mv_adaptMapRects()},adaptExtent:function(){var a=this.Scale;1>=a&&(a=1);var b=this.ClientExt.Width,c=this.ClientExt.Height;if(this.ClientExt.ratio()>=this.DefaultExt.ratio()){this.VisibleVB.Height=this.DefaultVB.Height;this.ClientVB.Height=this.DefaultVB.Height;this.ClientVB.Width=this.ClientExt.Width/(this.ClientExt.Height*this.DefaultExt.ratio())*this.DefaultVB.Width;
this.VisibleVB.Width=this.ClientVB.Width;this.CanvasExt.Width=this.ClientExt.Height*this.DefaultExt.ratio();this.CanvasExt.Height=this.ClientExt.Height;var d=this.ClientExt.Height*this.DefaultExt.ratio();this.ClientExt.Width>a*d&&this.setNewMapViewbox(1)}else this.VisibleVB.Width=this.DefaultVB.Width,this.ClientVB.Width=this.DefaultVB.Width,this.ClientVB.Height=this.ClientExt.Height/(this.ClientExt.Width/this.DefaultExt.ratio())*this.DefaultVB.Height,this.VisibleVB.Height=this.ClientVB.Height,this.CanvasExt.Width=
this.ClientExt.Width,this.CanvasExt.Height=this.ClientExt.Width/this.DefaultExt.ratio(),d=this.ClientExt.Width/this.DefaultExt.ratio(),this.ClientExt.Height>a*d&&this.setNewMapViewbox(this.ClientExt.Height/(a*d));this.drawExtent(b,c);this.setMapWheelSource()},drawExtent:function(a,b){mv_setAttr(dojo.byId("MVmapDoc"),{width:a,height:b});mv_setAttrSVG(this.Map,{width:a,height:b});this.CurrentExt.set(a,b);null!=mv_Scalebar&&mv_Scalebar.setPosition()},setMapWheelSource:function(){},saveCurrentVB:function(){var a=
this.Map.getAttributeNS(null,"viewBox").split(" ");this.CurrentVB.X=parseFloat(a[0]);this.CurrentVB.Y=parseFloat(a[1]);this.CurrentVB.Width=this.VisibleVB.Width/this.Scale;this.CurrentVB.Height=this.VisibleVB.Height/this.Scale},setMaxScaleFakt:function(){"WebMercator"==this.Projection&&(this.MaxScaleFakt=this.VisibleVB.Width/this.CurrentExt.Width/this.NormalizeFactor/2)},getScale:function(a){return this.MapUnits?parseFloat(this.ScaleConvert*this.VisibleVB.Width/(a*this.CurrentExt.Width)/this.checkMercator()/
mv_Map.NormalizeFactor):a},addExtentToList:function(){var a=[];a[0]=new MV.Viewbox(this.Map.getAttributeNS(null,"viewBox").split(" "));a[1]=this.Scale;a[2]=new MV.Extent(parseFloat(this.Map.getAttributeNS(null,"width")),parseFloat(this.Map.getAttributeNS(null,"height")));this.ExtentIndex==this.ExtentList.length-1?this.ExtentList.push(a):this.ExtentList.splice(this.ExtentIndex+1,this.ExtentList.length-this.ExtentIndex-1,a);this.ExtentIndex+=1},addExtentToListAfterMouseWheel:function(){this.MouseWheelZoom&&
(this.addExtentToList(),this.MouseWheelZoom=!1)},getMapPoint:function(a,b){a=this.getMapX(a);b=this.getMapY(b);return new MV.Point(a,b)},getRealMapPoint:function(a,b){a=this.getRealMapX(this.getMapX(a));b=this.getRealMapY(this.getMapY(b));return new MV.Point(a,b)},getMapviewPoint:function(a){return new MV.Point(this.getMapviewX(a.x),this.getMapviewY(a.y))},getScreenPoint:function(a){a.x=(a.x-this.CurrentVB.X)*this.Scale*this.CurrentExt.Width/this.VisibleVB.Width;a.y=(a.y-this.CurrentVB.Y)*this.Scale*
this.CurrentExt.Height/this.VisibleVB.Height;return a},getMapX:function(a){return a*this.VisibleVB.Width/this.CurrentExt.Width/this.Scale+this.CurrentVB.X},getMapY:function(a){return a*this.VisibleVB.Height/this.CurrentExt.Height/this.Scale+this.CurrentVB.Y},getRealMapX:function(a){a=(this.XOrigin+a)/this.NormalizeFactor;"WebMercator"==this.Projection&&(a=this.mercator2lon(a));return a},getRealMapY:function(a){a=(this.YOrigin-a)/this.NormalizeFactor;"WebMercator"==this.Projection&&(a=this.mercator2lat(a));
return a},getMapViewbox:function(a){var b=new MV.Viewbox;a?(b.Y=this.mercator2lat((this.YOrigin-this.CurrentVB.Y)/this.NormalizeFactor),b.X=this.mercator2lon(parseFloat(this.XOrigin+this.CurrentVB.X)/this.NormalizeFactor),b.Width=this.mercator2lon((this.XOrigin+this.CurrentVB.X+this.CurrentVB.Width)/this.NormalizeFactor)-b.X,b.Height=this.mercator2lat((this.YOrigin-this.CurrentVB.Y-this.CurrentVB.Height)/this.NormalizeFactor)-b.Y):(b.X=parseFloat(this.XOrigin+this.CurrentVB.X)/this.NormalizeFactor,
b.Y=(this.YOrigin-this.CurrentVB.Y)/this.NormalizeFactor,b.Width=this.CurrentVB.Width/this.NormalizeFactor,b.Height=this.CurrentVB.Height/this.NormalizeFactor);return b},mapScale:function(){return this.MapUnits?parseInt(this.ScaleConvert/this.NormalizeFactor*this.VisibleVB.Width/(this.Scale*this.CurrentExt.Width)/this.checkMercator()+.5):this.Scale},getMapviewX:function(a){if(isNaN(a))return Number.NaN;a=this.lon2mercator(a);a=parseFloat(a)*this.NormalizeFactor;return parseFloat(a)-this.XOrigin},
getMapviewY:function(a){if(isNaN(a))return Number.NaN;a=this.lat2mercator(a);a=parseFloat(a)*this.NormalizeFactor;return this.YOrigin-parseFloat(a)},mercator2lon:function(a){return a/2.003750834E7*180},mercator2lat:function(a){a=a/2.003750834E7*180*(Math.PI/180);a=(Math.pow(Math.E,a)-Math.pow(Math.E,-a))/2;a=Math.atan(a);return a=180*a/Math.PI},lon2mercator:function(a){return"WebMercator"!=this.Projection?a:2.003750834E7*a/180},lat2mercator:function(a){if("WebMercator"!=this.Projection)return a;a=
Math.log(Math.tan((90+a)*Math.PI/360))/(Math.PI/180);return this.lon2mercator(a)},checkMercator:function(){return"WebMercator"!=this.Projection?1:1/Math.cos(this.getMapViewbox(!0).YMin()*Math.PI/180)}})}function mv_declareClassSVGBaseLayer(){dojo.declare("MV.SVGBaseLayer",null,{constructor:function(a,b,c){this.id=b;this.BaseLayer=mv_Map.Layers.item(c);a=mv_Map.Layers.item(a);null!=a.BaseGroup&&a.BaseGroup.addMe(this)}})}
function mv_changeBaseLayerChange(a,b){(dojo.isWebKit||dojo.isChrome)&&mv_changeBaseLayer(a,b)}function mv_getBaseLayer(a){null!=a.BaseGroup&&mv_changeBaseLayer(a.id,a.ServiceId)}
function mv_changeBaseLayer(a,b){var c=mv_Map.Layers.item(a);if(null!=c.BaseGroup){var d=c.BaseGroup.item(c.ServiceId);if(null!=d){if("MV.SVGBaseLayer"==d.declaredClass)if(c.ServiceId!=b)mv_changeLayerVis2(!0,d.BaseLayer);else if(0==d.BaseLayer.Visible)return;c.ServiceId!=b&&mv_removeSVGele("bingmaplogo")}d=c.BaseGroup.item(b);if(null!=d){c.ServiceId=b;var e=a+"BaseMap";switch(d.declaredClass){case "MV.WMSServer":mv_getWMSLayer(c,d,e);break;case "MV.WMTSServer":mv_getWMTSLayer(c,d,e);break;case "MV.BingMapServer":mv_getBingMapLayer(c,
d,e);break;case "MV.MapTileServer":mv_getOSMLayer(c,d,e);break;case "MV.SVGBaseLayer":mv_removeSVGele(e),mv_changeLayerVis2(!1,d.BaseLayer),null!=d.BaseLayer.Layers&&mv_changeBaseSubLayers(d.BaseLayer.Layers)}}}}function mv_changeBaseSubLayers(a){for(var b=0;b<a.length();b++){var c=a.item(b);mv_changeLayerVis2(!1,c)}}
function mv_declareClassColor(){dojo.declare("MV.ColorList",MV.List,{RecArray:null,doLoop:!0,doCopy:!1,doColor:!1,hiColor:mv_Doc.HiColor,prop:"",TimerNum:20,constructor:function(a){dojo.safeMixin(this,a);this.RecArray=[];this.Timer=new mv_Timer;this.doCopy&&(this.TopNode=mv_Map.Root.getElementById("mapContent"));this.doFillRecArray()},doFillRecArray:function(){for(var a=0;a<this.recIds.length;a++)this.fillRecArray(this.recIds[a],0)},fillRecArray:function(a,b){var c=mv_Map.Root.getElementById(a);c?
(this.RecArray.push(c),this.fillEleWithDelay(c)):this.doLoop&&b<this.TimerNum&&(new mv_Timer).setTimeout("mv_fillRecArray",100,this,a,b+1)},fillWithDelay:function(){this.fill(this.hiColor,this.doColor)},fillEleWithDelay:function(a){this.doCopy&&(a=this.copyEleOnTop(a));this.insertEle(a,this.prop,this.hiColor,this.doColor)},copyEleOnTop:function(a){a=a.cloneNode(!1);mv_setAttrSVG(a,{"pointer-events":"none"});this.TopNode.appendChild(a);return a},fill:function(a,b){for(var c=this.copyOnTop(),d=0;d<
c.length;++d)this.insertEle(c[d],this.prop,a,b)},copyOnTop:function(){if(0==this.doCopy)return this.RecArray;for(var a=[],b=0;b<this.RecArray.length;b++){var c=this.copyEleOnTop(this.RecArray[b]);a.push(c)}return a},flicker:function(a,b,c,d){if(0==b){if(mv_Map.IsBlocked)return;this.doCopy&&this.fill(mv_Doc.HiColor,!1,!1);if(0==this.List.length)return;c=null!=mv_HighlightColors?mv_HighlightColors.List[0].Color:this.List[0].ele.getAttributeNS(this.List[0].NS,this.List[0].Prop);"image"!=this.List[0].ele.nodeName?
(d=mv_Doc.HiColor,c==d&&(d=mv_Doc.HiQueryColor)):(d=this.getHiImg(c),c==d&&(d=this.getHiHiImg(c)))}a?(this.setColor(d),a=!1):(this.setColor(c),a=!0);b++;mv_Map.IsBlocked=!0;6>b?(new mv_Timer).setTimeout("mv_flickerFunction",100,this,a,b,c,d):(mv_Map.IsBlocked=!1,null!=mv_HighlightColors&&mv_HighlightColors.setColor(d),1==this.doCopy&&this.killMe())},setColor:function(a){for(var b=0;b<this.length();b++)this.item(b).setColor(a)},getHiHiImg:function(a){return"url(#imgHoverHi)"},getHiImg:function(a){return"url(#imgHover)"},
update:function(a,b){for(var c=0;c<this.length();c++)this.item(c).update(a,b)},insertEle:function(a,b,c,d){"image"==a.nodeName&&(b="filter");color=a.getAttributeNS(null,b);b=new MV.Color(a,null,b,color);this.addMe(b);d&&("image"!=a.nodeName?color==c&&(c=mv_Doc.HiQueryColor):(c=this.getHiImg(color),color==c&&(c=this.getHiHiImg(color))),b.setColor(c))},deleteMe:function(){if(1==this.doCopy)this.killMe();else{for(;0<this.List.length;)this.List.pop().deleteMe();this.inherited(arguments)}},killMe:function(){for(;0<
this.List.length;)this.List.pop().killMe();this.inherited(arguments)}});dojo.declare("MV.Color",null,{constructor:function(a,b,c,d){this.ele=a;this.Prop=c;this.Color=d;this.NS=b},setColor:function(a){""==a?this.ele.removeAttributeNS(this.NS,this.Prop):this.ele.setAttributeNS(this.NS,this.Prop,a)},update:function(a,b){-1!=this.ele.getAttributeNS(null,"id").indexOf(a)&&(this.Color=this.ele.getAttributeNS(this.NS,this.Prop),this.setColor(b))},deleteMe:function(){this.ele.setAttributeNS(this.NS,this.Prop,
this.Color)},killMe:function(){this.ele.parentNode.removeChild(this.ele)}})}function mv_fillRecArray(a,b,c){a.fillRecArray(b,c)}function mv_flickerFunction(a,b,c,d,e){a.flicker(b,c,d,e)}function mv_getColor(a,b,c,d){if(null!=d)for(var e=0;e<d.length;e++){var f=d[e];if(null!=f&&(f=f.item(a),null!=f))return f.Color}return b.getAttributeNS(null,c)}
function mv_declareClassSymbol(){dojo.declare("MV.Symbol",null,{fill:"none",stroke:"black",r:4,src:"",width:18,height:18,strokeOpacity:1,fillOpacity:1,type:"symbol",shape:"","stroke-width":1,isValid:!1,constructor:function(a){dojo.mixin(this,a)},copyAttributes:function(a){if(null==a)return null;for(var b in a)"function"!=typeof a[b]&&(this[b]=a[b]);return this},makeSVGNode:function(a,b,c){var d=null;switch(this.shape){case "path":d=mv_makeSVGNode(a,"path",{fill:this.fill,stroke:this.stroke,"stroke-width":this["stroke-width"]*
b});break;case "circle":d=mv_makeSVGNode(a,"circle",{r:this.r*b,fill:this.fill,stroke:this.stroke,"stroke-width":this["stroke-width"]*b});break;case "line":d=mv_makeSVGNode(a,"line",{stroke:this.stroke,"stroke-width":this["stroke-width"]*b});break;case "img":d=mv_makeSVGNode(a,"image",{width:this.width*b,height:this.height*b});a=this.src;-1==this.src.indexOf("http")&&(a=mv_Doc.BaseURL+a);d.setAttributeNS("http://www.w3.org/1999/xlink","href",a);break;case "rect":d=mv_makeSVGNode(a,"rect",{width:this.width*
b,height:this.height*b,fill:this.fill,stroke:this.stroke,"stroke-width":this["stroke-width"]*b});break;case "text":d=mv_makeSVGNode(a,"text",{"class":"mapTipText"})}null!=d&&mv_setAttrSVG(d,c);return d},randomColor:function(a){var b="rgb("+parseInt(255*Math.random())+","+parseInt(255*Math.random())+","+parseInt(255*Math.random())+")";switch(a){case "fill":this.fill=b;break;case "stroke":this.stroke=b}},getStroke:function(){return{color:this.stroke,width:this["stroke-width"]}}});dojo.declare("MV.XMLSymbol",
MV.Symbol,{constructor:function(a){"string"==typeof a?this.shape=a:this.setSymbol(a)},clone:function(){var a=new MV.XMLSymbol;return a=a.copyAttributes(this)},setSymbol:function(a){if(null!=a){this.isValid=!0;this.shape=a.nodeName;for(var b=["fill","stroke","stroke-width","r","src"],c=["fill","stroke","stroke-width","r","src"],d=0;d<b.length;d++){var e=c[d];this[e]=mv_getXMLAttrValue(a,b[d],this[e])}"none"!=this.fill&&(this.fillOpacity=mv_getXMLAttrValue(a,"fill-opacity",this.fillOpacity));this.width=
parseFloat(mv_getXMLAttrValue(a,"width",String(this.width)).replace(/px/g,""));this.height=parseFloat(mv_getXMLAttrValue(a,"height",String(this.height)).replace(/px/g,""))}},setLayerSymbol:function(a,b){try{var c=mv_getXMLSubNode(a.SymXMLNode.selectSingleNode(b).firstChild);this.setSymbol(c)}catch(d){return this}}});dojo.declare("MV.JSONSymbol",MV.Symbol,{constructor:function(a,b){dojo.mixin(this,b);this.setSymbol(a)},setSymbol:function(a){if(null!=a){this.isValid=!0;for(var b in a)this[b]=a[b]}},
clone:function(){var a=new MV.JSONSymbol;return a=a.copyAttributes(this)}})}
function mv_declareClassScalebar(){dojo.declare("MV.Scalebar",null,{constructor:function(){},userSettings:function(a,b,c){this.RectCount=a;this.Width=b;this.MassLength=c},changeScalebar:function(){for(var a=parseFloat(this.MassLength/mv_Map.Scale/mv_Map.checkMercator()),b=1;b<=this.RectCount;b++)mv_Map.Root.getElementById("masstext"+b).firstChild.data=1>a?(Math.round(a*b*100)/100).toString():(Math.round(a*b*10)/10).toString()},resize:function(a){if(a){a=0;for(var b=this.Width*mv_Map.CanvasExt.Width/
mv_Map.DefaultExt.Width,c=1;c<=this.RectCount;c++)mv_setAttrSVG(mv_Map.Root.getElementById("massrect"+c),{width:b,x:a}),mv_Map.Root.getElementById("masstext"+c).setAttributeNS(null,"x",a+b-2),a+=b;this.setPosition()}},setPosition:function(){mv_Map.Root.getElementById("scalebar").setAttributeNS(null,"y",mv_Map.CurrentExt.Height-18)}})}
function mv_declareClassOverview(){dojo.declare("MV.Overview",null,{startPoint:null,origPoint:null,startEvt:null,DoMove:!1,TileServer:null,constructor:function(){var a=document.getElementById("MVoverviewDoc"),b=null;try{b=a.getSVGDocument()}catch(c){}this.Root=b;b=null;if(this.Root&&this.Root.defaultView)b=this.Root.defaultView;else if(a.window)b=a.window;else try{b=a.getWindow()}catch(c){}this.WinMap=b;a=this.Root.getElementById("overview");this.CurrentVB=this.DefaultVB=new MV.Viewbox(a.getAttributeNS(null,
"viewBox").split(" "));this.CurrentExt=new MV.Extent(parseFloat(a.getAttributeNS(null,"width")),parseFloat(a.getAttributeNS(null,"height")));this.CrossHairFakt=8*this.DefaultVB.Width/this.CurrentExt.Width;this.DragRect=this.Root.getElementById("overrect");this.BackRect=this.Root.getElementById("overback");this.CrossHairShow=!1;this.CrossVertical=this.Root.getElementById("crossVertical");this.CrossHorizontal=this.Root.getElementById("crossHorizontal")},setTileServer:function(a){this.TileServer=a;this.TileServer.RootEle=
this;var b={Visible:!0,id:"overth"};switch(a.declaredClass){case "MV.MapTileServer":mv_getOSMLayer(b,this.TileServer,"overOSM");break;case "MV.WMTSServer":mv_getWMTSLayer(b,this.TileServer,"overOSM")}},getMapViewbox:function(a){var b=new MV.Viewbox;a?(b.Y=mv_Map.mercator2lat((mv_Map.YOrigin-this.DefaultVB.Y)/mv_Map.NormalizeFactor),b.X=mv_Map.mercator2lon(parseFloat(mv_Map.XOrigin+this.DefaultVB.X)/mv_Map.NormalizeFactor),b.Width=mv_Map.mercator2lon((mv_Map.XOrigin+this.DefaultVB.X+this.DefaultVB.Width)/
mv_Map.NormalizeFactor)-b.X,b.Height=mv_Map.mercator2lat((mv_Map.YOrigin-this.DefaultVB.Y-this.DefaultVB.Height)/mv_Map.NormalizeFactor)-b.Y):(b.X=parseFloat(mv_Map.XOrigin+this.DefaultVB.X)/mv_Map.NormalizeFactor,b.Y=(mv_Map.YOrigin-this.DefaultVB.Y)/mv_Map.NormalizeFactor,b.Width=this.DefaultVB.Width/mv_Map.NormalizeFactor,b.Height=this.DefaultVB.Height/mv_Map.NormalizeFactor);return b},beginOverPan:function(a){this.DoMove=!0;this.startPoint=new MV.Point(parseFloat(this.DragRect.getAttributeNS(null,
"x")),parseFloat(this.DragRect.getAttributeNS(null,"y")));this.origPoint=new MV.Point(parseFloat(this.DragRect.getAttributeNS(null,"x")),parseFloat(this.DragRect.getAttributeNS(null,"y")));this.startEvt=new MV.Point(a.clientX,a.clientY);this.DragRect.setAttributeNS(null,"pointer-events","none");this.BackRect.setAttributeNS(null,"pointer-events","all")},doOverPan:function(a){var b=parseFloat(a.clientX);a=parseFloat(a.clientY);var c=this.startPoint.y+(a-this.startEvt.y)*this.DefaultVB.Height/this.CurrentExt.Height;
this.DragRect.setAttributeNS(null,"x",this.startPoint.x+(b-this.startEvt.x)*this.DefaultVB.Width/this.CurrentExt.Width);this.DragRect.setAttributeNS(null,"y",c);this.startEvt.x=b;this.startEvt.y=a;this.startPoint.x=parseFloat(this.DragRect.getAttributeNS(null,"x"));this.startPoint.y=parseFloat(this.DragRect.getAttributeNS(null,"y"));this.moveCrossHair()},endOverPan:function(){if(0==this.DoMove)return!0;this.DoMove=!1;mv_setAttrSVG(mv_Map.Map,{viewBox:mv_Map.CurrentVB.X-(this.origPoint.x-this.startPoint.x)+
" "+(mv_Map.CurrentVB.Y-(this.origPoint.y-this.startPoint.y))+" "+mv_Map.CurrentVB.Width+" "+mv_Map.CurrentVB.Height});mv_Map.CurrentVB.set(mv_Map.Map.getAttributeNS(null,"viewBox").split(" "));this.BackRect.setAttributeNS(null,"pointer-events","none");this.DragRect.setAttributeNS(null,"pointer-events","all");this.startEvt=this.startPoint=null;mv_getServiceLayers(mv_Map.Layers);mv_Map.addExtentToList();mv_adaptMapRects()},moveOverRect:function(){if(this.CrossHairFakt>mv_Map.CurrentVB.Width){this.CrossHairShow=
!0;var a=mv_Map.Scale/10*(this.DefaultVB.Width/mv_Map.DefaultVB.Width),b=mv_Map.CurrentVB.centerP();mv_setAttrSVG(this.DragRect,{x:b.x-mv_Map.CurrentVB.Width*a/2,y:b.y-mv_Map.CurrentVB.Height*a/2,width:mv_Map.CurrentVB.Width*a,height:mv_Map.CurrentVB.Height*a});this.moveCrossHair()}else this.CrossHairShow=!1,mv_setAttrSVG(this.DragRect,{x:mv_Map.CurrentVB.X,y:mv_Map.CurrentVB.Y,width:mv_Map.CurrentVB.Width,height:mv_Map.CurrentVB.Height});this.showCrossHair()},showCrossHair:function(){this.CrossHairShow?
(this.CrossVertical.setAttributeNS(null,"display","inline"),this.CrossHorizontal.setAttributeNS(null,"display","inline"),mv_setAttrSVG(this.DragRect,{"fill-opacity":0,"stroke-opacity":0})):(this.CrossVertical.setAttributeNS(null,"display","none"),this.CrossHorizontal.setAttributeNS(null,"display","none"),mv_setAttrSVG(this.DragRect,{"fill-opacity":.5,"stroke-opacity":1}))},moveCrossHair:function(){var a=parseFloat(this.DragRect.getAttributeNS(null,"x"))+parseFloat(this.DragRect.getAttributeNS(null,
"width"))/2,b=parseFloat(this.DragRect.getAttributeNS(null,"y"))+parseFloat(this.DragRect.getAttributeNS(null,"height"))/2;mv_setAttrSVG(this.CrossVertical,{x1:a,x2:a});mv_setAttrSVG(this.CrossHorizontal,{y1:b,y2:b})}})}function mv_resizeMap(a){null!=mv_Map&&(mv_Map.resize(mv_Doc.ResizeMap),mv_Doc.resize())}
function mv_watchSplitter(a){try{var b={},c=a.getSplitter("left");dojo.connect(c,"_startDrag",function(){b[c.widgetId]=dojo.connect(c.domNode,"onmousemove",function(a){mv_Map.resize(mv_Doc.ResizeMap)})});dojo.connect(c,"_stopDrag",function(a){dojo.disconnect(b[c.widgetId]);delete b[c.widgetId];mv_Map.resize(mv_Doc.ResizeMap);1!=mv_Map.Scale&&(mv_Map.DefResizeVB=null)})}catch(d){}}
function mv_showMapScale(){document.getElementById("MVmassstab")&&(document.getElementById("MVmassstab").value=mv_Map.mapScale())}
function mv_checkVisThemes(a,b){for(var c=null,d=0;d<a.length();d++){var e=a.item(d),f=e.Visible;e.SVGLayerProp.checkThemeScale();e.Visible=e.SVGLayerProp.Visible;if(f!=e.Visible||b)mv_chkBackground(e.Visible,e.id),(e.TurnedOn||b)&&mv_setMapDisplay(e.TurnedOn,e.Visible,mv_Map.Root.getElementById(e.id));mv_checkTxtThemeScale(e,b);e.TurnedOn&&e.Visible&&mv_getServiceLayer(e);if(null!=e.Layers&&(e.TurnedOn||e.ScaleRange||b)){var g=mv_checkVisThemes(e.Layers,b);e.ScaleRange&&e.displayLegend(g)}1!=e.Visible||
f==e.Visible&&!b||(c=e.id)}return c}function mv_checkTxtThemeScale(a,b){if(null==a.TxtLayers)return!0;for(var c=0;c<a.TxtLayers.length;c++){var d=a.TxtLayers[c],e=d.Visible;d.checkThemeScale();(e!=d.Visible&&a.TurnedOn||b)&&mv_setMapDisplay(a.TurnedOn,d.Visible,mv_Map.Root.getElementById(a.id+a.TxtLayers[c].id))}}function mv_getServiceLayers(a){for(var b=0;b<a.length();b++){var c=a.item(b);c.TurnedOn&&(mv_getServiceLayer(c),null!=c.Layers&&mv_getServiceLayers(c.Layers))}}
function mv_getServiceLayer(a){"FeatureLayer"!=a.Layertype&&"GroupLayer"!=a.Layertype&&"RasterLayer"!=a.Layertype&&(mv_getServiceLayer2(a),"BaseLayer"==a.Layertype&&mv_getBaseLayer(a))}
function mv_getServiceLayer2(a){if(0!=a.Visible)switch(a.Layertype){case "WMSLayer":mv_getWMSLayer(a,a.BaseGroup.item(0),a.id+"image");break;case "WMTSLayer":mv_getWMTSLayer(a,a.BaseGroup.item(0),a.id+"WMTS");break;case "OSMLayer":mv_getOSMLayer(a,a.BaseGroup.item(0),"OSMLayer");break;case "TileLayer":a.getTiles();break;case "WeatherLayer":mv_doWeatherBB(a);break;case "WikipediaLayer":mv_doWikipediaBB(a);break;case "PanoramioLayer":mv_doPanoramioBB(a);break;case "ClusterLayer":mv_getClusterLayer(a);
break;case "PhotoLayer":mv_doPhotoLayer(a);break;case "DBLayer":a.isTiled&&a.getTiles(),mv_getLayerDB(a)}}function mv_setMapDisplay(a,b,c){a&&b?c.setAttributeNS(null,"display","inline"):c.setAttributeNS(null,"display","none")}
function mv_changeLayerVis(a){a=a.id.substring(0,a.id.lastIndexOf("Check"));var b=mv_Map.Layers.item(a);0==b.TurnedOn&&_mv_handleRadioLegends(a);mv_changeLayerVis2(b.TurnedOn,b);mv_oExists(dojo.byId("MVborderTabContainer"))&&mv_oExists(mv_Doc.Datagraphs)&&0<mv_Doc.Datagraphs.length()&&("GroupLayer"==b.Layertype?mv_swapDatagraph():mv_swapDatagraph(a))}
function mv_changeLayerVis2(a,b){b.TurnedOn=!a;mv_setMapDisplay(b.TurnedOn,b.Visible,mv_Map.Root.getElementById(b.id));if(null!=b.TxtLayers)for(var c=0;c<b.TxtLayers.length;c++)mv_setMapDisplay(b.TurnedOn,b.TxtLayers[c].Visible,mv_Map.Root.getElementById(b.id+b.TxtLayers[c].id));if(b.TurnedOn&&b.Visible){mv_getServiceLayer2(b);null!=b.Layers&&mv_checkVisThemes(b.Layers,!0);for(var d=b.getServiceLayers([]),c=0;c<d.length;c++)mv_getServiceLayer2(d[c])}}
function _mv_handleRadioLegends(a){dojo.forEach(mv_Map.RadioLayers,function(b){if(-1<mv_Map.RadioLayers.indexOf(a)&&b!=a){var c=dijit.byId(b+"Check");mv_oExists(c)||(c=dijit.byId("MVsharedCheck"+b));mv_oExists(c)&&c.set("checked",!1)}})}
function mv_chkBackground(a,b){-1<b.indexOf("d")&&(b=b.substring(0,b.indexOf("d")));var c=dojo.byId("MV"+b+"Legend");if(null!=c){var d=1,e="black",f="opacity:1";0==a&&(d=.4,e="#aaa",f="opacity:0.4");try{var g=dojo.byId(b+"Legend");null!=g&&(g.style.opacity=d);dojo.query("label",c).forEach(function(a){a.style.color=e});dojo.query("input",c).forEach(function(b){if(widget=dijit.getEnclosingWidget(b))widget.set("style",f),a&&widget.set("disabled",!1)})}catch(h){}}}
function mv_showLegend(a,b){0==isNaN(a)&&(a=a.toString());0==a.indexOf("th")?(ele=dojo.byId(a+"Legend"),0==mv_oExists(ele)&&(ele=dojo.byId("MVlegend"+a))):ele=dojo.byId("MVlegend"+a);null!=ele&&(ele=dijit.getEnclosingWidget(ele));var c=!ele.get("open");mv_oExists(b)&&(c=b);ele.set("open",c);ele=dojo.byId("MVslider"+a);null!=ele&&(ele=dijit.getEnclosingWidget(ele),0==mv_oExists(c)&&(c=!ele.get("open")),ele.set("open",c),null!=dojo.byId("MVsliderButton"+a)&&(dojo.byId("MVsliderButton"+a).style.display=
c))}function mv_layerInfo(a,b,c){if(0==isNaN(b)||1==c){c=dijit.byId("MVsharedSel"+b.toString());if(null==c)return;b=mv_colorMapAnalyzeStr(c.value,"themaId");var d=mv_colorMapAnalyzeStr(c.value,"field")}if(null!=d&&(c=mv_Map.Layers.item(b),null!=c&&null!=c.VectorSettings)){mv_showPopup(a,c.VectorSettings.name,c.VectorSettings.desc);return}b=mv_loadAttrTableFile(b,!1);null!=b&&mv_showPopup(a,b.Name,b.Desc)}
function mv_showTable(a,b,c,d){if(0==isNaN(a)||1==d){b=dijit.byId("MVsharedSel"+a.toString());if(null==b)return;a=mv_colorMapAnalyzeStr(b.value,"themaId");var e=null;null!=b.lastFocusedChild&&(e=b.lastFocusedChild.label)}b=mv_Map.Layers.item(a);null!=b.Layers&&(b.TurnedOn||b.ScaleRange)&&(a=mv_checkVisThemes(b.Layers,!0),b=mv_Map.Layers.item(a));if("undefined"==typeof c||""==c)c="MVAttributeTable";b.XMLAccess?mv_showTableInFP(a,e):mv_showTableDB(c,a,"")}
function mv_showLegendInFP(a){if(!mv_Doc.isSmartPhoneLayout()&&!mv_Doc.IsMobile&&mv_oExists(dojo.byId("MVlegendFPContainer"))){var b=dijit.byId("MVlegendFP");if("undefined"!=typeof b)b.bringToTop(),b.show(),b.set("style","width:auto;height:auto");else{var c=null!=a.label?a.label:a.currentTarget.title;a=dojo.byId("MVlegendContent");b=mv_makeNode(document,"div",{id:"MVlegendFP"});b.style.display="none";dojo.byId("MVlegendFPContainer").appendChild(b);b.appendChild(a);require(["dojox/layout/FloatingPane"],
function(a){a=new a({resizable:!1,dockable:!1,title:c,style:"position:absolute;top:60px;left:30px;width:auto;height:auto;visibility:hidden;z-index:4;",close:function(){this.hide()}},"MVlegendFP");a.startup();a.bringToTop();a.show();a.set("style","width:auto;height:auto")})}}}function mv_showHelp(a){mv_doShowInfoHelp(a,"./embfiles/help.html")}function mv_showInfo(a){mv_doShowInfoHelp(a,"./embfiles/info.html")}
function mv_doShowInfoHelp(a,b){mv_showDialog(a.currentTarget?a.currentTarget.title:a.label,"",b)}
function mv_showPopup(a,b,c){if(0!=c.length){var d=dijit.byId("MVPopup"),e=Math.min(400,window.innerWidth-20),f=Math.min(600,window.innerHeight-100);require(["dojo/dom-style","dijit/TooltipDialog","dijit/popup"],function(g,h,l){if(d&&(l.close(k),d.title==b))return;var k=new h({id:"MVPopup",title:b,content:c,style:"width:auto;height:auto;",onClick:function(){l.close(k)}});h=k.containerNode;g.set(h,"maxHeight",f-43+"px");g.set(h,"maxWidth",e+"px");g.set(h,"overflow","auto");l.open({parent:a,around:a.domNode,
popup:k,onClose:function(){k.destroy()},orient:["above","below"]})})}}function mv_showDialog(a,b,c){var d=Math.min(400,window.innerWidth-20),e=Math.min(600,window.innerHeight-100),f="width:"+d+"px;height:"+e+"px;",f="width:"+d+"px;height:auto;";require(["dojo/dom-style","dijit/Dialog"],function(d,h){var l={},l=c?new h({title:a,href:c,style:f}):new h({title:a,content:b,style:f}),k=l.containerNode;d.set(k,"maxHeight",e-43+"px");d.set(k,"overflow","auto");d.set(k,"paddingBottom","10px");l.show()})}
function mv_scaleSym(a){if(a==mv_Map.Scale)return!0;for(var b=a/mv_Map.Scale,c=0;c<mv_Map.getLayerList().length;c++){var d=mv_Map.getLayerList()[c];if(null!=d&&"ClusterLayer"!=d.Layertype&&("WeatherLayer"==d.Layertype&&mv_removeSVGele("WeathLayer"),mv_scaleSymTheme(d.id,a,d.SVGLayerProp.ScaleEle),null!=d.TxtLayers))for(var e=0;e<d.TxtLayers.length;e++)mv_scaleSymTheme(d.id+d.TxtLayers[e].id,a,d.TxtLayers[e].ScaleEle)}a=mv_Map.Root.getElementsByTagName("pattern");for(c=0;c<a.length;c++)for(var d=a.item(c),
f=d.childNodes,e=0;e<f.length;e++){var g=f.item(e);if("image"==g.nodeName){var h=g.getAttributeNS(null,"width");g.setAttributeNS(null,"width",h*b);h=g.getAttributeNS(null,"height");g.setAttributeNS(null,"height",h*b);h=d.getAttributeNS(null,"width");d.setAttributeNS(null,"width",h*b);h=d.getAttributeNS(null,"height");d.setAttributeNS(null,"height",h*b)}}e=mv_Map.Root.getElementById("drawPath");null!=e&&(c=e.getAttributeNS(null,"stroke-width")*b,e.setAttributeNS(null,"stroke-width",c),e=mv_Map.Root.getElementById("drawStartCircle"),
null!=e&&(c=e.getAttributeNS(null,"stroke-width")*b,a=e.getAttributeNS(null,"r")*b,mv_setAttrSVG(e,{"stroke-width":c,r:a})));for(c=0;c<mv_Doc.VisPoints.length;c++)e=mv_Map.Root.getElementById(mv_Doc.VisPoints[c]),null!=e&&mv_doScaleDrawPoint(e,b);mv_scalePictFilter(b)}
function mv_scalePictFilter(a){if(null!=mv_Map.Root.getElementById("pictFilter")){var b=mv_Map.Root.getElementById("pictBlur");a*=parseFloat(b.getAttributeNS(null,"stdDeviation"));b.setAttributeNS(null,"stdDeviation",a);mv_setAttrSVG(mv_Map.Root.getElementById("pictOffset"),{dx:a,dy:a})}}
function mv_doScaleDrawPoint(a,b){switch(a.nodeName){case "circle":var c=parseFloat(a.getAttributeNS(null,"r"))*b;a.setAttributeNS(null,"r",c);0!=a.getAttributeNS(null,"stroke-width")&&(c=parseFloat(a.getAttributeNS(null,"stroke-width"))*b,a.setAttributeNS(null,"stroke-width",c));break;case "image":mv_doScaleSymEle(a,b)}}
function mv_scaleSymTheme(a,b,c){if(""!=c&&null!=c){b/=mv_Map.Scale;a=mv_Map.Root.getElementById(a);var d=!1;"inline"==a.getAttributeNS(null,"display")&&(a.setAttributeNS(null,"display","none"),d=!0);-1!=c.indexOf("chart")&&mv_doScaleChart(a,b);-1!=c.indexOf("text")&&mv_doScaleSym(a,"text",["font-size"],b,"px");-1!=c.indexOf("tspan")&&mv_doScaleSym(a,"tspan",["font-size"],b,"px");-1!=c.indexOf("gText")&&mv_doScaleSym(a,"g",["font-size"],b,"px");-1!=c.indexOf("gPath")&&mv_doScaleSym(a,"g",["stroke-width"],
b,"");-1!=c.indexOf("use")&&mv_doScaleSym(a,"use",["stroke-width"],b,"");-1!=c.indexOf("path")&&mv_doScaleSym(a,"path",["stroke-width"],b,"");-1!=c.indexOf("line")&&mv_doScaleSym(a,"line",["stroke-width"],b,"");-1!=c.indexOf("pCL")&&mv_doScaleSym2(a,b);-1!=c.indexOf("circle")&&mv_doScaleSym(a,"circle",["stroke-width","r"],b,"");-1!=c.indexOf("image")&&mv_doScaleSym3(a,"image",b);-1!=c.indexOf("rect")&&mv_doScaleSym3(a,"rect",b);-1!=c.indexOf("rect")&&mv_doScaleSym(a,"rect",["stroke-width"],b,"");
-1!=c.indexOf("gCircle")&&(mv_doScaleSym(a,"g",["stroke-width"],b,""),mv_doScaleSym(a,"circle",["r"],b,""));d&&a.setAttributeNS(null,"display","inline")}}function mv_doScaleChart(a,b){for(var c=a.getElementsByTagName("g"),d=0,e=c.length;d<e;d++){var f=c.item(d);mv_getChartScale(f,b)}}function mv_doScaleSym(a,b,c,d,e){a=a.getElementsByTagName(b);b=0;for(var f=a.length;b<f;b++)for(var g=a.item(b),h=0;h<c.length;h++){var l=parseFloat(g.getAttributeNS(null,c[h]))*d;g.setAttributeNS(null,c[h],l+e)}}
function mv_doScaleSym2(a,b){for(var c=a.getElementsByTagName("path"),d=0,e=c.length;d<e;d++){var f=c.item(d);if(-1!=f.getAttributeNS(null,"id").indexOf("rec")){var g=f.getAttributeNS(null,"stroke-width")*b;f.setAttributeNS(null,"stroke-width",g)}}}function mv_doScaleSym3(a,b,c){a=a.getElementsByTagName(b);b=0;for(var d=a.length;b<d;b++)mv_doScaleSymEle(a.item(b),c)}
function mv_doScaleSymEle(a,b){var c=parseFloat(a.getAttributeNS(null,"width")),d=parseFloat(a.getAttributeNS(null,"height")),e=parseFloat(a.getAttributeNS(null,"x"))+c/2-c*b/2,f=parseFloat(a.getAttributeNS(null,"y"))+d/2-d*b/2;mv_setAttrSVG(a,{x:e,y:f,width:c*b,height:d*b})}
function mv_hiliteRec(a,b,c,d,e){a=a.split(",");if(1<a.length)for(var f=a.pop(),g=0;g<a.length;g++)a[g]=f.concat(a[g]);f=mv_getThemaIdFromRecId(a[0]);f=mv_Map.Layers.item(f);mv_hiliteRec2(f.SVGLayerProp.StyleProp,b,a,c,d,e,mv_Doc.HiColor)}
function mv_hiliteRec2(a,b,c,d,e,f,g){var h=!1;e.event?e.event.ctrlKey&&(h=!0,mv_Map.UseScaleInfo=!1,mv_zoomToExtent2(b,20),mv_Map.UseScaleInfo=!1):f.ctrlKey&&(h=!0,mv_Map.UseScaleInfo=!1,mv_zoomToExtent2(b,20),mv_Map.UseScaleInfo=!1);mv_HighlightColors&&mv_HighlightColors.deleteMe();mv_HighlightColors=new MV.ColorList({recIds:c,prop:a,doLoop:h,hiColor:g,doColor:!0});mv_Doc.RowColor=d.style.backgroundColor;d.style.backgroundColor=g}
function mv_recOut(a){mv_HighlightColors&&mv_HighlightColors.deleteMe();mv_HighlightColors=null;a.style.backgroundColor=mv_Doc.RowColor}function mv_clearFeatures(){mv_SelRecColors&&mv_SelRecColors.deleteMe();mv_SelRecColors=null}
function mv_print(a){var b=mv_Doc.BaseURL+"print.html?";if("string"==typeof a&&""!=mv_Map.Identifys.item(a).data.getVBString(20))var c=mv_Map.Identifys.item(a).data.getVBString(20),b=b+("1|"+c+"|");else c=mv_Map.Scale==mv_Map.OrigScale?mv_Map.DefaultVB:mv_Map.CurrentVB,b+="0|"+c.X+","+c.XMax()+","+c.Y+","+(c.Y+c.Height)+",0|";for(var d=[],e=[],f=[],c=mv_Map.getLayerList(),g=!1,h="",l=0;l<c.length;l++){var k=c[l];d.push(k.id+"="+mv_bool2int(k.TurnedOn));-1<k.id.indexOf("d")&&(h=k.id.substring(0,k.id.indexOf("d")),
k.TurnedOn&&(g=!0));"GPXLayer"==k.Layertype&&k.TurnedOn&&("string"!=typeof a?e.push(k.id):null==dojo.byId("MVlegend0")&&e.push(k.id));"BaseLayer"==k.Layertype&&f.push(k.id+"="+k.ServiceId)}0==g&&""!=h&&d.push(h+"=0");var b=b+(d.join(",")+"|"+e.join(",")+"|"+f.join(",")),c=[],m;for(m in mv_Map.ColorMapLayer)k=mv_Map.colorMapLayer(m),k=mv_Map.Layers.item(k),null!=k&&k.TurnedOn&&mv_oExists(k.VectorSettings)&&k.VectorSettings.print&&(k.VectorSettings.slider&&"undefined"!=typeof mv_Slider&&null!=mv_Slider?
c.push(mv_Map.ColorMapLayer[m]+"x"+m+"x"+mv_Slider.slider.value):c.push(mv_Map.ColorMapLayer[m]+"x"+m));0<c.length&&(b+="|"+c.join("xx"));b=mv_showWindow(b,"MVPrintPreview","","newWindow");if(null!=mv_Map.Identifys||"undefined"!=typeof mv_OSMNominatim)mv_Doc.Para=null,"string"==typeof a?(c=new MV.List,c.addMe(mv_Map.Identifys.item(a)),mv_Doc.Para=[b,c,mv_Map.Scale,"MVidentifyContainer"]):mv_Doc.Para=[b,mv_Map.Identifys,mv_Map.Scale,"MVidentifyContainer"],a=null,"undefined"!=typeof mv_OSMNominatim&&
(a=mv_OSMNominatim.print()),mv_Doc.Para.push(a),window.setTimeout("mv_testIdentifyParNode()",1500)}function mv_checkIdentifyParNode(){window.setTimeout("mv_testIdentifyParNode()",100)}function mv_testIdentifyParNode(){try{null==mv_Doc.Para[0].document.getElementById(mv_Doc.Para[3])?mv_checkIdentifyParNode():mv_printIdentifysRoutes()}catch(a){mv_checkIdentifyParNode()}}
function mv_printIdentifysRoutes(){if(null!=mv_Doc.Para[1]||null!=mv_Doc.Para[4]){var a=mv_Doc.Para[0],b=mv_Doc.Para[1],c=mv_Doc.Para[2],d=a.document.getElementById(mv_Doc.Para[3]);mv_Doc.Para=null;null!=b&&mv_printIdentifys(a,b,c,d)}}
function mv_printPage(){mv_Map.resize(!0);if(0!=window.location.search.length){var a=window.location.search.substr(1,window.location.search.length).split("|");a.shift();var b=a.shift();0<b.length&&mv_zoomToExtent2(b);for(var c=a.shift().split(","),d=a.shift().split(","),e=a.shift().split(","),b=0;b<c.length;b++){var f=c[b].split("="),g=mv_Map.Layers.item(f[0]);if(null==g)0==mv_int2bool(f[1])&&(g=dojo.byId(f[0]+"LegDiv"))&&dojo.style(g,"display","none");else if("GPXRootLayer"!=g.Layertype){var h=dijit.byId(g.id+
"Check");if(0==mv_int2bool(f[1])||0==g.Visible)g.TurnedOn&&(null!=h?h.set("checked",!1):mv_changeLayerVis2(!0,g)),(g=dojo.byId(g.id+"LegDiv"))&&dojo.style(g,"display","none");else if("GPXLayer"==g.Layertype&&0<=dojo.indexOf(d,g.id)&&mv_loadGPXLayer(g.id,!1),0==g.TurnedOn&&(null!=h?h.set("checked",!0):mv_changeLayerVis2(!1,g)),"BaseLayer"==g.Layertype)for(f=0;f<e.length;f++)if(h=e[f].split("="),h[0]==g.id&&h[1]!=g.ServiceId){mv_changeBaseLayer(g.id,h[1]);break}}}if(0<a.length)for(a=a.shift().split("xx"),
b=0;b<a.length;b++)d=a[b].split("x"),c=d.shift(),e=d.shift(),mv_colorMapChange(c,e),0<d.length&&(d=parseInt(d.shift()),c=c.split(",").shift(),mv_colorMap(d,c))}}function mv_checkPrintMapLoaded(){window.setTimeout("mv_testEmbedPrintMap()",200)}function mv_testEmbedPrintMap(){try{null==mv_Doc.Para[0].document.getElementById("MVmapDoc").getSVGDocument()?mv_checkPrintMapLoaded():mv_printFeatures()}catch(a){mv_checkPrintMapLoaded()}}
function mv_printFeatures(){var a=mv_Doc.Para[0],b=mv_Doc.Para[1],c=mv_Doc.Para[2],d=mv_Doc.Para[3],e=a.document.getElementById("MVmapDoc").getSVGDocument(),c=e.getElementById(c);if(null!=c)if(a=d/a.mv_Map.Scale,dojo.isArray(b))for(d=0;d<b.length;d++)mv_printMapEle(e,c,b[d],a);else switch(b.nodeName){case "g":if(b.hasChildNodes())for(b=b.firstChild;null!=b;)mv_printMapEle(e,c,b,a),b=b.nextSibling;break;default:mv_printMapEle(e,c,b,a)}}
function mv_printMapEle(a,b,c,d){var e=null;switch(c.nodeName){case "path":e=mv_makeSVGNode(a,"path",{d:c.getAttributeNS(null,"d"),stroke:c.getAttributeNS(null,"stroke"),"stroke-width":c.getAttributeNS(null,"stroke-width")*d,fill:c.getAttributeNS(null,"fill")});break;case "image":var e=parseFloat(c.getAttributeNS(null,"width")),f=parseFloat(c.getAttributeNS(null,"height")),g=parseFloat(c.getAttributeNS(null,"x"))+e/2-e*d/2,h=parseFloat(c.getAttributeNS(null,"y"))+f/2-f*d/2,e=mv_makeSVGNode(a,"image",
{x:g,y:h,width:e*d,height:f*d});e.setAttributeNS("http://www.w3.org/1999/xlink","href",c.getAttributeNS("http://www.w3.org/1999/xlink","href"));break;case "circle":e=mv_makeSVGNode(a,"circle",{cx:c.getAttributeNS(null,"cx"),cy:c.getAttributeNS(null,"cy"),r:c.getAttributeNS(null,"r")*d,stroke:c.getAttributeNS(null,"stroke"),"stroke-width":c.getAttributeNS(null,"stroke-width")*d,fill:c.getAttributeNS(null,"fill")})}null!=e&&b.appendChild(e)}
function mv_makeButton(a,b,c,d,e,f){b=mv_makeNode(b,"button",{type:"button"});"undefined"!=typeof f&&b.setAttribute("id",f);a.appendChild(b);return new dijit.form.Button({iconClass:d,showLabel:!1,label:c,onClick:function(){dojo.eval(e)}},b)}function mv_cloneObj(a){var b={},c;for(c in a)b[c]=a[c];return b}function mv_changeLang(a){mv_Doc.Lang=a;mv_Doc.WikiLang=a;"undefined"!=typeof mv_GPXModul&&mv_changeLangGPX();"undefined"!=typeof mv_OSMNominatim&&mv_OSMNominatim.setLang()}
Number.prototype.toRad=function(){return this*Math.PI/180};function mv_getRecId(a){a=a.getAttributeNS(null,"id");if(-1!=a.indexOf("gpxmar"))return a;-1!=a.indexOf("_grp")&&(a=a.substring(0,a.indexOf("_grp")));-1!=a.indexOf("_")&&(a=a.substring(0,a.indexOf("_")));return a}function mv_getThemaId(a){-1<a.indexOf("_")&&(a=a.substring(0,a.indexOf("_")));return a}function mv_getThemaIdFromRecId(a){a=mv_getTableIdFromRecId(a);return 0==a.indexOf("th")?a:mv_Map.Layers.getLayerByType("ClusterLayer").id}
function mv_getTableIdFromRecId(a){return-1==a.indexOf("rec")?a:a.substring(0,a.indexOf("rec"))}function mv_getSVGLayerProperties(a){a=mv_getThemaId(a);if(-1==a.indexOf("txt"))return mv_Map.Layers.item(a).SVGLayerProp;var b=a.substring(0,a.indexOf("txt"));a=a.substring(a.indexOf("txt"));return mv_Map.Layers.item(b).getTxtLayerSVGLayerProp(a)}
function mv_getRecEle(a){a=a.target;null==a.nodeName&&(a=a.correspondingUseElement);for(;""==a.getAttributeNS(null,"id")||null==a.getAttributeNS(null,"id");)a=a.parentNode;return a}function mv_getMediaScreen(){var a=window.getComputedStyle(document.body,":after").getPropertyValue("content"),a=a.replace(/"/g,"");return a=a.replace(/'/g,"")}function mv_appendNode(a,b,c){b.appendChild(a);c.appendChild(b)}
function mv_writeTRTDs(a,b,c,d){for(var e=mv_makeNode(a,"tr",{}),f=0;f<d.length;f++){var g=d[f],h=mv_makeNode(a,"td",c);dojo.isObject(g)&&(dojo.isArray(g)?mv_makeFullNodeInner(a,h,g):h.appendChild(g));dojo.isString(g)&&(g=String(g),mv_makeFullNodeInner(a,h,g));e.appendChild(h)}b.appendChild(e)}function mv_makeFullNode(a,b,c,d){b=a.createElement(b);mv_setAttr(b,c);mv_makeFullNodeInner(a,b,d);return b}
function mv_makeFullNodeInner(a,b,c){if(null!=c)if(dojo.isString(c))for(a=String(c),a=a.split("\n"),b.innerHTML=a[0],c=1;c<a.length;c++)b.innerHTML+="<br/>",b.innerHTML+=a[c];else{if(dojo.isArray(c)){var d=String(c[0]),e=c[2],f=c[3];c=!c[1]||-1==d.indexOf("@")&&"http"!=d.substr(0,4).toLowerCase()&&"url:"!=d.substr(0,4).toLowerCase()&&"js:"!=d.substr(0,3).toLowerCase()?a.createTextNode(d):mv_writeLink(d,a,f,e)}b.appendChild(c)}}
function mv_writeLink(a,b,c,d){"url:"==a.substr(0,4).toLowerCase()&&(a=a.substr(4));var e=a,f="";-1!=a.indexOf(";")&&(f=a.split(";"),a=f[0],e=f[1],f=f[1]);if(-1!=a.indexOf("@"))return a=mv_makeFullNode(b,"a",{href:"mailto:"+a},e);if("js:"==a.substr(0,3).toLowerCase())return a="javascript:"+c+a.substr(3),a=mv_makeFullNode(b,"a",{href:a},e);"http"!=a.substr(0,4).toLowerCase()&&(a=mv_Doc.BaseURL+a);if(-1!=a.toLowerCase().indexOf(".jpg")||-1!=a.toLowerCase().indexOf(".gif")||-1!=a.toLowerCase().indexOf(".png")){var g=
mv_makeNode(b,"img",{src:a,"class":"imgTable",alt:f,title:f});if(0==d)return g;a=a.replace(/_tn/g,"");d=mv_Doc.ShowHyperlinks;"bestOf"==d&&(d="dojoImage");switch(d){case "newWindow":return a=mv_makeFullNode(b,"a",{href:a,target:mv_Doc.FullWin},g);case "greybox":return a=mv_makeFullNode(b,"a",{href:a},g),mv_setAttr(a,{onclick:"return "+c+"GB_showCenter('"+f+"',this.href,550,800,'',false);"}),a;case "dojoImage":return mv_setAttr(g,{onclick:c+"mv_lightBox('"+a+"|"+f+"')"}),g.style.cursor="pointer",g}}if(-1!=
a.toLowerCase().indexOf(".pdf")&&"newWindow"!=mv_Doc.ShowHyperlinks)return a=mv_makeFullNode(b,"a",{href:a},e),mv_setAttr(a,{onclick:"return "+c+"GB_showCenter('"+f+"',this.href,550,800,'',false);"}),a;c=[];-1!=a.indexOf(".")&&-1==a.indexOf("#")&&(c=[a.split(".").pop()],a=a.replace("."+c[0],""));-1!=a.indexOf("#")&&(f=a.split("#"),a=f[0],c=f[1].split(","));if(1==mv_checkVideo(c))return mv_makeVideoAudioNode(b,"video",{autoplay:"autoplay",controls:"controls","class":"imgTable"},a,c);if(1==mv_checkAudio(c))return mv_makeVideoAudioNode(b,
"audio",{autoplay:"autoplay",controls:"controls"},a,c);a=a+"."+c[0];return a=mv_makeFullNode(b,"a",{href:a,target:mv_Doc.FullWin},e)}function mv_quoteSQLString(a,b){if(a){var c="'";-1!=b.indexOf("'")&&(c='"');c=""+c+b+c}else c='"'+b+'"';return c}function mv_createMethodRef(a,b){return function(){a[b].apply(a,arguments)}}
function mv_showWindow(a,b,c,d){if(0==a.indexOf("links/")||0==a.indexOf(".")||0==a.indexOf("embfiles")||0==a.indexOf("gpxdata/"))a=mv_Doc.BaseURL+a;if("undefined"==typeof b||""==b)b=mv_Doc.FullWin;if("undefined"==typeof c||""==c)c=mv_Doc.WinSettings,-1==c.indexOf("width")&&(c=c+",width="+window.innerWidth),-1==c.indexOf("height")&&(c=c+",height="+window.innerHeight);"undefined"==typeof d&&(d=mv_Doc.ShowHyperlinks);"bestOf"==d&&(d=a.toLowerCase(),d=0<d.indexOf(".gif")||0<d.indexOf(".png")||0<d.indexOf(".jpg")?
"dojoImage":0<d.indexOf(".pdf")?"greybox":"newWindow");mv_Doc.IsMobile&&(d="newWindow");switch(d){case "greybox":return GB_showCenter("",a,500,750,"",!1);case "newWindow":return(a=window.open(a,b,c))&&a.focus(),a;case "dojoImage":mv_lightBox(a+"|")}}
function mv_lightBox(a){mv_Doc.PrintStatus||require(["dojox/image/Lightbox"],function(b){var c=a.split("|"),d=c[0].split("#"),e=c[1].split("#"),f=String((new Date).getTime()),g=new b.LightboxDialog({});g.startup();if(g){for(b=0;b<d.length;++b)g.addImage({title:e[b],href:mv_checkRelLink(d[b],!1)},f);setTimeout(function(){g.show({title:e[0],group:f})},500)}})}
function mv_lightBox_normal(a){require(["dojox/image/Lightbox"],function(b){for(var c=a.split("|")[0].split("#"),d=a.split("|")[1].split("#"),e="sl"+String((new Date).getTime()),f=0;f<c.length;++f){var g=new b({title:d[f],group:e,href:mv_checkRelLink(c[f],!1)});g.startup()}g.show()})}function mv_checkRelLink(a,b){0!=a.indexOf("http")&&0!=a.indexOf(mv_Doc.BaseURL)&&(a="gpxdata/"+a,b&&(a="url:"+a));return a}
function __mv_setSelectedIndex_alt(a,b){if(null!=dojo.byId(a)&&(dojo.byId(a).selectedIndex=b,"smartphone"==mv_getMediaScreen()))try{dijit.byId(a).textbox.readOnly=!0}catch(c){}}
function mv_loadXMLDoc(a,b){if(void 0!=window.ActiveXObject&&1==mv_localUsage())return _mv_loadXMLDocIELocal(a,b);mv_isIE&&"xml"==b&&(b="msxml",dojo.contentHandlers.msxml=function(a){var b=a.responseXML,c=function(a){return"MSXML"+a+".DOMDocument"},c=["Microsoft.XMLDOM",c(6),c(4),c(3),c(2)];dojo.some(c,function(c){try{var f=new ActiveXObject(c);f.async=!1;f.loadXML(a.responseText);b=f}catch(l){return!1}return!0});return b});window.status="Loading file, please wait ...";if(34==dojo.isChrome&&"xml"==
b){var c=dojo.xhrGet({url:a,handleAs:"text",timeout:5E3,sync:!0,load:function(a,b){window.status="";parser=new DOMParser;return a=parser.parseFromString(a,"text/xml")},error:function(a,c){window.status="Error when retrieving data from the server! "+b;return a}});return c.results[0]}c=dojo.xhrGet({url:a,handleAs:b,timeout:5E3,sync:!0,load:function(a,b){window.status="";return a},error:function(a,c){window.status="Error when retrieving data from the server! "+b;return a}});return c.results[0]}
function mv_loadDOMDoc(a){try{try{var b=new ActiveXObject("Msxml2.DOMDocument.6.0")}catch(c){try{b=new ActiveXObject("Msxml2.DOMDocument.5.0")}catch(d){try{b=new ActiveXObject("Msxml2.DOMDocument.4.0")}catch(e){try{b=new ActiveXObject("Msxml2.DOMDocument.3.0")}catch(f){b=new ActiveXObject("Msxml2.DOMDocument")}}}}window.status="Loading file, please wait ...";b.async=!1;b.load(a);return b}catch(f){return null}}
function mv_isOpera(){var a=!!navigator.userAgent.match(/OPR/);return 1<dojo.isOpera||a?!0:!1}function mv_isIE(){var a=!(!navigator.userAgent.match(/Trident/)||!navigator.userAgent.match(/rv:11/));return dojo.isIE||a?!0:!1}function mv_isEdge(){return navigator.userAgent.match(/Edge/)?!0:!1}function mv_getTranslate(a){a=a.substring(a.indexOf("(")+1,a.indexOf(")"));var b=a.split(",");1==b.length&&(b=a.split(" "));1==b.length&&b.unshift(0);return b}
function mv_getRecIdsFromXMLFile(a,b){var c=[];if(null!=a){var d=a.getAttribute("extId");if(a.hasChildNodes()&&"1"==d)for(d=a.firstChild;null!=d;)1==d.nodeType&&(c[c.length]=b.concat(d.firstChild.nodeValue)),d=d.nextSibling}0==c.length&&(c[0]=b);return c}function mv_getRecIdsFromParaList(a,b){if(b){b=b.split(",");for(var c=[];0<b.length;)c.push(a.concat(b.pop()))}else c=[a];return c}function mv_setAttr(a,b){for(var c in b)a.setAttribute(c,b[c])}
function mv_makeNode(a,b,c){a=a.createElement(b);mv_setAttr(a,c);return a}function mv_embedSVGNode(a,b,c,d,e){return dojo.isWebKit?mv_makeNode(a,"iframe",{type:"image/svg+xml",id:b,width:c,height:d,src:e,frameborder:"0"}):mv_makeNode(a,"embed",{type:"image/svg+xml",id:b,width:c,height:d,src:e})}function mv_imgSVGNode(a,b,c,d,e){return mv_makeNode(a,"img",{id:b,width:c,height:d,src:e})}function mv_setAttrSVG(a,b){for(var c in b)a.setAttributeNS(null,c,b[c])}
function mv_makeSVGNode(a,b,c,d){b=a.createElementNS("http://www.w3.org/2000/svg",b);mv_setAttrSVG(b,c);null!=d&&(a=a.createTextNode(d),b.appendChild(a));return b}function mv_makeLayerNode(a,b){return mv_makeSVGNode(mv_Map.Root,"g",{id:a,display:1==b?"inline":"none"})}function mv_alert(a){window.alert=theAlert;alert(a);window.alert=null}function mv_HTMLSonder(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/>/g,"&gt;");return a=a.replace(/"/g,"&quot;")}
function mv_getXMLNodeValue(a,b,c){try{return a.selectSingleNode(b).firstChild.nodeValue}catch(d){return c}}function mv_getXMLAttrValue(a,b,c){a=a.getAttribute(b);return null==a?String(c):a}function mv_getXMLSubNode(a){for(;null!=a&&1!=a.nodeType;)a=a.nextSibling;return a}function mv_getXMLSubNodes(a){var b=[];if(null!=a)for(a=a.firstChild;null!=a;)1==a.nodeType&&b.push(a),a=a.nextSibling;return b}
function mv_changeUmlaut(a){a=a.replace(/&#34;/g,'"');a=a.replace(/&#39;/g,"'");a=a.replace(/&#60;/g,"<");a=a.replace(/&#62;/g,">");for(var b=127;255>=b;b++)a=a.replace(new RegExp("&#"+b+";",["g"]),String.fromCharCode(b));return a=a.replace(/&#38;/g,"&")}function mv_bool2int(a){return a?1:0}function mv_int2bool(a){return 0==parseInt(a)?!1:!0}function mv_str2bool(a){return"TRUE"==a.toUpperCase()?!0:"FALSE"==a.toUpperCase()?!1:a}function mv_numsort(a,b){return a[0]<b[0]?-1:a[0]>b[0]?1:0}
function mv_numsort2(a,b){return a-b}function mv_removeEle(a){a=document.getElementById(a);null!=a&&a.parentNode.removeChild(a);return a}function mv_removeSubEles(a){if(null!=a)for(var b=a.childNodes.length-1;0<=b;b--){var c=a.childNodes.item(b);a.removeChild(c)}}function mv_removeSVGele(a){a=mv_Map.Root.getElementById(a);null!=a&&a.parentNode.removeChild(a)}function mv_removeSVGele2(a,b){var c=a.getElementById(b);null!=c&&c.parentNode.removeChild(c)}
function mv_drawPoint(a,b,c,d,e,f){mv_removeSVGele(a);-1==dojo.indexOf(mv_Doc.VisPoints,a)&&-1==a.indexOf("rec")&&mv_Doc.VisPoints.push(a);var g=mv_Map.LegMapKoeff/mv_Map.Scale;"number"==typeof e&&(e=new MV.Symbol({shape:"circle",r:e,fill:"magenta",stroke:mv_Doc.HiQueryColor}));switch(e.shape){case "circle":var h=e.makeSVGNode(mv_Map.Root,g,{id:a,cx:c,cy:d});break;case "img":h=g*e.width,h=e.makeSVGNode(mv_Map.Root,g,{id:a,x:c-h/2,y:d-h/2})}dojo.isString(f)&&(h.setAttributeNS(null,"onmouseover","parent.mv_mapTipOver(evt,'"+
decodeURI(f)+"');"),h.setAttributeNS(null,"onmouseout","parent.mv_mapTipOut()"));c=mv_Map.Map;-1!=a.indexOf("th")&&(c=mv_getThemaIdFromRecId(a),c=mv_Map.Root.getElementById(c));c.appendChild(h);if(b)for(mv_HighlightColors&&mv_HighlightColors.deleteMe(),mv_HighlightColors=new MV.ColorList({recIds:[a],prop:"fill",doLoop:!1}),a=0;10>a;a++)mv_HighlightColors.flicker(!0,0);return h}
function mv_SendRequest(a,b){dojo.xhrGet({url:a,timeout:5E4,handleAs:"text",load:b,error:function(a,b){window.status="Error when retrieving data from the server! "+a}})}function mv_SendRequestJson(a,b){dojo.xhrGet({url:a,timeout:5E4,handleAs:"json",load:b,error:function(a,b){window.status="Error when retrieving data from the server! "+a}})}function mv_closeTPs(a){for(var b=0;b<a.length();++b){var c=a.item(b);c.open&&c.toggle()}}
function mv_deleteTPs(a){if(a)for(var b=a.length(),c=0;c<b;c++)a.item(b-1-c).deleteItem()}function mv_deleteTP(a){a=dijit.byId(a);null!=a&&a.deleteItem()}function mv_mapTipOver(a,b){if(!mv_blnInit)return!0;mv_mapTipShow(a,b)}function mv_mapTipOut(){if(!mv_blnInit)return!0;var a=mv_Map.Root.getElementById("mapTip");null!=a&&a.setAttributeNS(null,"visibility","hidden")}
function mv_mapTipShow(a,b){if(!mv_blnInit||""==b)return!0;var c=mv_mapTipShowInit();mv_mapTipShowMakeText(b,c);mv_mapTipShow2(a,c)}function mv_mapTipShowInit(){mv_removeSVGele("mapTipText");var a={rectLength:0,rectHeight:14,x:8};a.gParentNode=mv_makeSVGNode(mv_Map.Root,"g",{id:"mapTipText"});a.mapTipNode=mv_Map.Root.getElementById("mapTip");a.mapTipNode.appendChild(a.gParentNode);return a}
function mv_mapTipShowMakeText(a,b){for(var c=a.split("<br>"),d,e=0;e<c.length;e++)0<c[e].length&&(d=mv_makeSVGNode(mv_Map.Root,"text",{x:b.x,y:b.rectHeight,"class":"mapTipText"},c[e]),b.gParentNode.appendChild(d),b.rectLength=Math.max(b.rectLength,d.getComputedTextLength()),b.rectHeight+=13);b.rectLength+=16}
function mv_mapTipShow2(a,b){var c=mv_Map.CurrentVB.Width/mv_Map.CurrentExt.Width,d=mv_Map.CurrentVB.X,e=mv_Map.CurrentVB.Y;mv_setAttrSVG(mv_Map.Root.getElementById("mapTipRect"),{width:b.rectLength,height:b.rectHeight-7});mv_setAttrSVG(b.mapTipNode,{transform:"matrix("+c+",0,0,"+c+","+(a.clientX+b.rectLength>mv_Map.CurrentExt.Width?d+(a.clientX-b.rectLength-5)*c:d+a.clientX*c)+","+(a.clientY+b.rectHeight>=mv_Map.CurrentExt.Height?e+(a.clientY-b.rectHeight)*c:e+(a.clientY+30)*c)+")",visibility:"visible"})}
function mv_chartRecOut(a,b){if(!mv_blnInit)return!0;if(0!=mv_GraphColors.length){var c=mv_GraphColors.pop();mv_getChartScale(c.ele,1/b);mv_HighlightColors&&mv_HighlightColors.deleteMe();mv_HighlightColors=null}}function mv_getChartScale(a,b){if(null==a)return 1;var c=a.getAttributeNS(null,"transform");if(c){var d=c.indexOf("scale("),d=c.substring(c.indexOf("(",d)+1,c.indexOf(")",d));a.setAttributeNS(null,"transform",c.replace(new RegExp("\\("+d+"\\)",["g"]),"("+b*d+")"));return d}return 1}
function mv_chartRecOver(a,b,c){if(!mv_blnInit)return!0;var d=mv_getRecEle(a);c=mv_getChartScale(d,c);var e={};e.ele=d;e.scale=c;mv_GraphColors.push(e);c=d.getAttributeNS(mv_Doc.ProgNS,"recIds");d=mv_getRecId(d);d=d.substring(0,d.indexOf("ch"));e=mv_getThemaIdFromRecId(d);e=mv_Map.Layers.item(e);d=mv_getRecIdsFromParaList(d,c);mv_HighlightColors&&mv_HighlightColors.deleteMe();mv_HighlightColors=new MV.ColorList({recIds:d,prop:e.SVGLayerProp.StyleProp,doColor:!0,doLoop:!1});""!=b&&mv_mapTipShow(a,
b)}function mv_hiliteOut(){if(!mv_blnInit)return!0;mv_HighlightColors&&mv_HighlightColors.deleteMe();mv_HighlightColors=null}function mv_declareClassTiles(){dojo.declare("MV.Tiles",MV.List,{TileCount:0,constructor:function(){},doTileCount:function(){this.TileCount++},deleteItem:function(a){this.inherited(arguments);this.TileCount--}});dojo.declare("MV.Tile",null,{constructor:function(a,b){this.id=a;this.Visible=b}})}
function mv_dynLayerAppend(a){if(a){groupId=11==a.nodeType?a.firstChild.getAttributeNS(null,"id"):a.getAttributeNS(null,"id");var b=mv_getThemaId(groupId),c=b;groupId.substr(groupId.indexOf("_"));-1!=groupId.indexOf("txt")&&(c=groupId.substring(0,groupId.indexOf("txt")),groupId.substr(groupId.indexOf("txt")));b=mv_Map.Root.getElementById(b);c=mv_Map.Layers.item(c);null!=b&&(b.appendChild(a),c.TileRules.LoadedTiles.TileCount++,c.TileRules.PartLoadedTiles--)}window.status="";return groupId}
function mv_dynLayerRemove(a,b){for(var c=b.length()-1;0<=c;c--){var d=b.List[c];if(0==d.Visible){var e=mv_Map.Root.getElementById(a+d.id);if(e&&(e.parentNode.removeChild(e),window.status="removing "+a+d.id,b.deleteItem(d.id),b.length()<=mv_Doc.TileCount))break}}window.status=""}
function mv_declareClassToolbar(){dojo.declare("MV.Toolbar",MV.List,{constructor:function(a){this.id=a},clearAction:function(){for(var a={pressed:"#D3D3D3",unpressed:"none"},b=0;b<this.List.length;b++){var c=this.List[b];c.doToggle&&(0<c.id.indexOf(mv_Doc.Task)?mv_setToggleButtonStyle(c,!1,a):mv_setToggleButtonStyle(c,!0,a))}}});dojo.extend(dijit.form.ToggleButton,{doToggle:!0,onClick:function(){"dijit.form.ToggleButton"==this.declaredClass&&(this.doToggle||(this.checked?this.set("style","background:#D3D3D3"):
this.set("style","background:none")))}})}function mv_setToggleButtonStyle(a,b,c){0!=mv_oExists(a)&&(b?a.set("style","background:"+c.unpressed):a.set("style","background:"+c.pressed),a.set("checked",!b))}
function mv_createToolbar(){if(null!=dojo.byId("MVtoolbar")){var a=new MV.Toolbar("MVtoolbar");mv_Doc.Toolbars.addMe(a);dojo.query('*[id^="MVtoolbar."]').forEach(function(b,c,d){b=dijit.getEnclosingWidget(b);if("dijit.form.ToggleButton"==b.declaredClass&&0==a.exists(b.id)){if("MVtoolbar.wikipedia"==b.id||"MVtoolbar.panoramio"==b.id||"MVtoolbar.weather"==b.id||"MVtoolbar.photos"==b.id)b.doToggle=!1;a.addMe(b)}})}}
function mv_getNextTool(){null==mv_Measure||0==mv_Measure.ClickCount?mv_identifyTool():mv_measureTool()}function mv_identifyTool(){mv_clearEvents(!1,"identify");mv_Map.MapPoint=null}function mv_zoomInTool(){mv_clearEvents(!0,"zoomin");mv_arrangePanZoom("mv_beginMapZoom","mv_doMapZoom","mv_endMapZoom","mv_outMap","mv_overMap")}function mv_zoomOutTool(){mv_clearEvents(!0,"zoomout");mv_arrangePanZoom("mv_beginMapZoom","mv_doMapZoom","mv_endMapZoom","mv_outMap","mv_overMap")}
function mv_panTool(){"pan"==mv_Doc.Task?mv_getNextTool():(mv_clearEvents(!0,"pan"),mv_arrangePanZoom("mv_beginMapPan","mv_doMapPan","mv_endMapPan","mv_outMap","mv_overMap"))}function mv_zoomNextExtentTool(){mv_zoomExtentList(1)}function mv_zoomPreviousExtentTool(){mv_Map.addExtentToListAfterMouseWheel();mv_zoomExtentList(-1)}function mv_coordinateTool(){"koord"==mv_Doc.Task?mv_identifyTool():(mv_clearEvents(!1,"koord"),mv_arrangeKoordMeas())}
function mv_measureTool(a){"measure"==mv_Doc.Task&&"string"!=typeof a?mv_identifyTool():(mv_clearEvents(!0,"measure"),mv_arrangeKoordMeas(),"string"==typeof a?mv_Measure.setFeatureType(a):mv_Measure.setFeatureType("Line"))}function mv_measureLineTool(){mv_Measure.setFeatureType("Line")}function mv_measureAreaTool(){mv_Measure.setFeatureType("Polygon")}function mv_measureClearTool(){mv_Measure.reset()}function mv_measureSumTool(){mv_Measure.Sum=!dijit.byId("MVmeasureToolbar.sum").checked}
function mv_toolsTPClick(a){a.open||a.id.substring(2)==mv_Doc.Task&&mv_identifyTool()}
function mv_clearEvents(a,b){var c=a,d=a;mv_Map.addExtentToListAfterMouseWheel();c&&"measure"==mv_Doc.Task&&(null==mv_Measure||0==mv_Measure.ClickCount?c=!1:mv_Measure.draw(mv_Measure.PathString),d=!1);var e=mv_Map.Layers.getLayerObj("MV.Painting");d&&"paint"==mv_Doc.Task&&(null==e||0==e.ClickCount?d=!1:(e.draw(e.PathString),e.IsLocked=!0),c=!1);0==c&&(null!=mv_Measure&&mv_Measure.destroy(),dojo.byId("MVshowKoord")&&(dojo.byId("MVshowKoord").value=""),mv_Map.Root.getElementById("koordrect")&&mv_Map.Root.getElementById("koordrect").setAttributeNS(null,
"pointer-events","none"),mv_mapTipOut());0==d&&null!=e&&e.destroy();dojo.byId("MVshowKoord")&&(dojo.byId("MVshowKoord").value="");mv_Map.Root.getElementById("panAndZoomRect")&&(c=mv_Map.Root.getElementById("panAndZoomRect"),c.setAttributeNS(null,"pointer-events","none"),c.removeEventListener("mousedown",mv_beginMapZoom,!1),c.removeEventListener("mousemove",mv_doMapZoom,!1),c.removeEventListener("mouseup",mv_endMapZoom,!1),c.removeEventListener("mousedown",mv_beginMapPan,!1),c.removeEventListener("mousemove",
mv_doMapPan,!1),c.removeEventListener("mouseup",mv_endMapPan,!1),c.removeEventListener("mouseout",mv_outMap,!1),c.removeEventListener("mouseover",mv_overMap,!1));mv_Map.Root.getElementById("cur"+mv_Doc.Task)&&mv_Map.Root.getElementById("cur"+mv_Doc.Task).setAttributeNS(null,"visibility","hidden");mv_Doc.Task=b;null!=mv_Doc.Toolbars.item("MVtoolbar")&&mv_Doc.Toolbars.item("MVtoolbar").clearAction()}
function mv_setPanEvent(a){var b=mv_Map.Root.getElementById("mapContent");a?(b.addEventListener("touchstart",mv_initMapPan,!1),b.addEventListener("mousedown",mv_initMapPan,!1)):(b.removeEventListener("touchstart",mv_initMapPan,!1),b.removeEventListener("mousedown",mv_initMapPan,!1))}
function mv_arrangePanZoom(a,b,c,d,e){var f=mv_Map.Root.getElementById("panAndZoomRect");f.setAttributeNS(null,"pointer-events","all");f.addEventListener("mousedown",dojo.eval(a),!1);f.addEventListener("mousemove",dojo.eval(b),!1);f.addEventListener("mouseup",dojo.eval(c),!1);f.addEventListener("mouseout",dojo.eval(d),!1);f.addEventListener("mouseover",dojo.eval(e),!1);mv_setAttrSVG(mv_Map.Root.getElementById("cur"+mv_Doc.Task),{x:-100,y:-100,visibility:"visible"})}
function mv_beginMapZoom(a){if(2==a.button||mv_Map.Pressed)return!0;mv_Map.addExtentToListAfterMouseWheel();mv_Map.Pressed=!0;mv_Map.Point=new MV.Point(a.clientX,a.clientY);mv_Map.MapPoint=mv_Map.getMapPoint(a.clientX,a.clientY);"zoomin"==mv_Doc.Task&&(a=mv_makeSVGNode(mv_Map.Root,"rect",{id:"zoomRect",x:mv_Map.MapPoint.x,y:mv_Map.MapPoint.y,width:0,height:0,fill:mv_Doc.BGColor2,"fill-opacity":.5,stroke:"black","stroke-width":mv_Map.DefaultVB.Width/mv_Map.CanvasExt.Width/mv_Map.Scale*2,"shape-rendering":"optimizeSpeed",
"pointer-events":"none"}),mv_Map.Map.appendChild(a))}
function mv_zoomMouseWheel(a){a.preventDefault();if(0!=mv_Map.MouseWheelEvt){mv_Map.MouseWheelEvt=!1;var b=mv_Map.Scale,c=mv_Map.VisibleVB.Width,d=mv_Map.VisibleVB.Height,e=mv_Map.getMapPoint(a.clientX-mv_Map.MapWheelSource.x,a.clientY-mv_Map.MapWheelSource.y);mv_Map.Scale=0<a.detail||0>a.wheelDelta?mv_Map.Scale/mv_Map.WheelZoomFakt:mv_Map.Scale*mv_Map.WheelZoomFakt;mv_Map.Scale=mv_Map.getLimitScale(mv_Map.Scale);mv_scaleSym(b);mv_Doc.ResizeMap&&mv_Map.adaptExtent();c=mv_Map.VisibleVB.Width-c;d=mv_Map.VisibleVB.Height-
d;a=mv_Map.VisibleVB.Width/mv_Map.Scale;var f=mv_Map.VisibleVB.Height/mv_Map.Scale,g=(e.x-mv_Map.CurrentVB.X)/(mv_Map.VisibleVB.Width/b)*a,b=(e.y-mv_Map.CurrentVB.Y)/(mv_Map.VisibleVB.Height/b)*f,g=e.x-g,b=e.y-b;mv_Doc.ResizeMap&&(0!=c&&(g-=c/2/mv_Map.Scale),0!=d&&(b-=d/2/mv_Map.Scale));mv_setAttrSVG(mv_Map.Map,{viewBox:g+" "+b+" "+a+" "+f});mv_zoomChange(!0);mv_Map.MouseWheelEvt=!0;mv_Map.MouseWheelZoom=!0}}
function mv_doMapZoom(a){mv_setAttrSVG(mv_Map.Root.getElementById("cur"+mv_Doc.Task),{x:parseInt(a.clientX+15),y:parseInt(a.clientY+15)});if(mv_Map.Pressed&&"zoomin"==mv_Doc.Task){var b=mv_Map.getMapPoint(a.clientX,a.clientY);0>b.x-mv_Map.MapPoint.x&&mv_Map.Root.getElementById("zoomRect").setAttributeNS(null,"x",b.x);0>b.y-mv_Map.MapPoint.y&&mv_Map.Root.getElementById("zoomRect").setAttributeNS(null,"y",b.y);a=Math.abs(b.x-mv_Map.MapPoint.x);b=Math.abs(b.y-mv_Map.MapPoint.y);mv_setAttrSVG(mv_Map.Root.getElementById("zoomRect"),
{width:a,height:b})}}
function mv_endMapZoom(a){if(mv_Map.Pressed){mv_Map.Pressed=!1;var b=mv_Map.Scale,c=mv_Map.getMapPoint(a.clientX,a.clientY);switch(mv_Doc.Task){case "zoomin":mv_removeSVGele("zoomRect");3>=Math.abs(a.clientX-mv_Map.Point.x)&&3>=Math.abs(a.clientY-mv_Map.Point.y)?mv_Map.Scale*=2:(mv_Map.Scale=Math.min(mv_Map.VisibleVB.Width/Math.abs(c.x-mv_Map.MapPoint.x),mv_Map.VisibleVB.Height/Math.abs(c.y-mv_Map.MapPoint.y)),c.x<mv_Map.MapPoint.x&&(a=mv_Map.MapPoint.x,mv_Map.MapPoint.x=c.x,c.x=a),c.y<mv_Map.MapPoint.y&&
(a=mv_Map.MapPoint.y,mv_Map.MapPoint.y=c.y,c.y=a),c.x=Math.abs(c.x-mv_Map.MapPoint.x)/2+mv_Map.MapPoint.x,c.y=Math.abs(c.y-mv_Map.MapPoint.y)/2+mv_Map.MapPoint.y);break;case "zoomout":mv_Map.Scale/=2}mv_Map.Scale=mv_Map.getLimitScale(mv_Map.Scale);mv_scaleSym(b);mv_centerZoomChanges(c.x,c.y,!0);mv_Map.MapPoint=null;mv_getNextTool()}}function mv_initMapPan(a){mv_beginMapPan(a)}
function mv_beginMapPan(a){if(2!=a.button){var b=mv_Map.Root.getElementById("mapContent");b.addEventListener("touchmove",mv_doMapPan,!1);b.addEventListener("mousemove",mv_doMapPan,!1);b.addEventListener("touchend",mv_endMapPan,!1);b.addEventListener("mouseup",mv_endMapPan,!1);mv_Map.Pressed=!0;mv_Map.addExtentToListAfterMouseWheel();mv_Map.MapPoint="undefined"!=typeof a.clientX?mv_Map.getMapPoint(a.clientX,a.clientY):mv_Map.getMapPoint(a.targetTouches[0].clientX,a.targetTouches[0].clientY);null!=
mv_Overview&&(mv_Overview.startPoint=new MV.Point(parseFloat(mv_Overview.DragRect.getAttributeNS(null,"x")),parseFloat(mv_Overview.DragRect.getAttributeNS(null,"y"))))}}function mv_beginMobileMapPan(a){mv_Map.MapPointPan=mv_Map.getMapPoint(a.targetTouches[0].clientX,a.targetTouches[0].clientY);mv_Map.MapPointPanUp=mv_Map.MapPointPan;mv_beginMapPan(a.targetTouches[0])}
function mv_doMapPan(a){if(null!=mv_Doc){if("undefined"!=typeof a.clientX){var b=a.clientX;a=a.clientY}else b=a.targetTouches[0].clientX,a=a.targetTouches[0].clientY;"pan"==mv_Doc.Task&&mv_setAttrSVG(mv_Map.Root.getElementById("curpan"),{x:parseInt(b+15),y:parseFloat(a+15)});mv_Map.Pressed&&(mv_setAttrSVG(mv_Map.Map,{cursor:"move"}),b=mv_Map.getMapPoint(b,a),mv_setAttrSVG(mv_Map.Map,{viewBox:mv_Map.CurrentVB.X+(mv_Map.MapPoint.x-b.x)+" "+(mv_Map.CurrentVB.Y+(mv_Map.MapPoint.y-b.y))+" "+mv_Map.CurrentVB.Width+
" "+mv_Map.CurrentVB.Height}),mv_doOverviewPan(mv_Map.MapPoint.x-b.x,mv_Map.MapPoint.y-b.y))}}
function mv_doMobileMapPan(a){if(null!=mv_Doc&&mv_Map.Pressed){a.preventDefault();var b=mv_Map.getMapPoint(a.targetTouches[0].clientX,a.targetTouches[0].clientY);mv_setAttrSVG(mv_Map.Map,{viewBox:mv_Map.CurrentVB.X+(mv_Map.MapPoint.x-b.x)+" "+(mv_Map.CurrentVB.Y+(mv_Map.MapPoint.y-b.y))+" "+mv_Map.CurrentVB.Width+" "+mv_Map.CurrentVB.Height});mv_Map.MapPointPanUp=mv_Map.getMapPoint(a.targetTouches[0].clientX,a.targetTouches[0].clientY);mv_Map.MapPointPan=new MV.Point(mv_Map.CurrentVB.X+(mv_Map.MapPoint.x-
mv_Map.MapPointPanUp.x),mv_Map.CurrentVB.Y+(mv_Map.MapPoint.y-mv_Map.MapPointPanUp.y))}}function mv_doOverviewPan(a,b){null!=mv_Overview&&(mv_setAttrSVG(mv_Overview.DragRect,{x:mv_Overview.startPoint.x+a,y:mv_Overview.startPoint.y+b}),mv_Overview.moveCrossHair())}
function mv_endMapPan(){var a=mv_Map.Root.getElementById("mapContent");a.removeEventListener("touchmove",mv_doMapPan,!1);a.removeEventListener("mousemove",mv_doMapPan,!1);a.removeEventListener("touchend",mv_endMapPan,!1);a.removeEventListener("mouseup",mv_endMapPan,!1);mv_Map.Pressed&&(mv_Map.Pressed=!1,mv_Map.CurrentVB.set(mv_Map.Map.getAttributeNS(null,"viewBox").split(" ")),mv_getServiceLayers(mv_Map.Layers),mv_Map.addExtentToList(),mv_adaptMapRects(),null!=mv_Scalebar&&"WebMercator"==mv_Map.Projection&&
mv_Scalebar.changeScalebar(),mv_updateDemoPath(),mv_Map.MapPoint=null,mv_Map.MapPointPan=null,mv_Map.MapPointPanUp=null,mv_setAttrSVG(mv_Map.Map,{cursor:"default"}))}
function mv_endMobileMapPan(a){!mv_oExists(mv_Map.MapPoint)||mv_Map.MapPoint.x==mv_Map.MapPointPan.x&&mv_Map.MapPoint.y==mv_Map.MapPointPan.y||(mv_oExists(mv_Map.MapPointPanUp)&&mv_oExists(mv_Map.MapPointPan)&&(mv_setAttrSVG(mv_Map.Map,{viewBox:mv_Map.MapPointPan.x+" "+mv_Map.MapPointPan.y+" "+mv_Map.CurrentVB.Width+" "+mv_Map.CurrentVB.Height}),mv_doOverviewPan(mv_Map.MapPoint.x-mv_Map.MapPointPanUp.x,mv_Map.MapPoint.y-mv_Map.MapPointPanUp.y)),mv_endMapPan(),a.preventDefault())}
function mv_outMap(a){mv_Map.Root.getElementById("cur"+mv_Doc.Task)&&mv_Map.Root.getElementById("cur"+mv_Doc.Task).setAttributeNS(null,"visibility","hidden")}function mv_overMap(a){mv_Map.Root.getElementById("cur"+mv_Doc.Task)&&mv_Map.Root.getElementById("cur"+mv_Doc.Task).setAttributeNS(null,"visibility","visible")}
function mv_zoomToScale(a){if(1<=parseFloat(a)){var b=mv_Map.Scale,c=mv_Map.getScale(parseFloat(a));mv_Map.Scale=mv_Map.getLimitScale(c);a=!1;mv_Map.Scale!=c&&(a=!0);c=mv_Map.CurrentVB.centerP();mv_scaleSym(b);mv_centerZoomChanges(c.x,c.y,a)}else mv_showMapScale();return!1}function mv_zoomPercent(a){if(mv_Map.Scale!=a){var b=mv_Map.Scale;mv_Map.Scale=a;a=mv_Map.CurrentVB.centerP();mv_scaleSym(b);mv_centerZoom(a.x,a.y);mv_zoomChange(!1)}}
function mv_zoomBookmark(a){a?mv_zoomToExtent2(a,0):mv_fullExtent()}function mv_zoomToExtent2(a,b){var c=a.split(",");5==c.length&&(b=parseFloat(c[4]));mv_zoomToExtent(c[0],c[1],c[2],c[3],b)}
function mv_zoomToExtent(a,b,c,d,e){if(!(isNaN(a)||isNaN(b)||isNaN(c)||isNaN(d)||(a=parseFloat(a),b=parseFloat(b),c=parseFloat(c),d=parseFloat(d),"undefined"==typeof e&&(e=20),isNaN(e)))){var f=mv_Map.Scale,g=mv_Map.MaxScaleFakt,h=mv_Map.MaxScaleFakt;0<b-a&&(g=mv_Map.ClientVB.Width/(b-a));0<d-c&&(h=mv_Map.ClientVB.Height/(d-c));0==b-a&&0<d-c&&(g=h);0==d-c&&0<b-a&&(h=g);g>mv_Map.MaxScaleFakt&&h>mv_Map.MaxScaleFakt&&(h=g=mv_Map.MaxScaleFakt,e=0);e=g<h?mv_Map.CanvasExt.Width/(mv_Map.CanvasExt.Width-
2*e):mv_Map.CanvasExt.Height/(mv_Map.CanvasExt.Height-2*e);mv_Map.Scale=Math.min(g,h)/e;mv_Map.Scale=mv_Map.getLimitScale(mv_Map.Scale);mv_scaleSym(f);mv_centerZoomChanges((a+b)/2,(c+d)/2,!0)}}
function mv_fullExtent(){var a=mv_Map.Scale;mv_Map.Scale=1;mv_Map.Scale=mv_Map.OrigScale;mv_Map.addExtentToListAfterMouseWheel();null!=mv_Map.DefResizeVB?mv_Map.Map.setAttributeNS(null,"viewBox",mv_Map.DefResizeVB.getViewBoxString()):mv_Doc.ResizeMap&&mv_Map.adaptExtent();mv_zoomChange(!0);mv_scaleSym(a);mv_Map.addExtentToList();document.MVformZoom&&(document.MVformZoom.MVlistZoom.selectedIndex=0)}function mv_centerZoomChanges(a,b,c){mv_centerZoom(a,b);mv_zoomChange(c);mv_Map.addExtentToList()}
function mv_centerZoom(a,b){mv_Doc.ResizeMap&&mv_Map.adaptExtent();mv_centerZoom2(a,b)}function mv_centerZoom2(a,b){mv_setAttrSVG(mv_Map.Map,{viewBox:a-mv_Map.VisibleVB.Width/mv_Map.Scale/2+" "+(b-mv_Map.VisibleVB.Height/mv_Map.Scale/2)+" "+mv_Map.VisibleVB.Width/mv_Map.Scale+" "+mv_Map.VisibleVB.Height/mv_Map.Scale})}
function mv_zoomChange(a){mv_Map.saveCurrentVB();mv_Map.MapUnits&&a&&mv_showMapScale();mv_checkVisThemes(mv_Map.Layers,!1);null!=mv_Overview&&mv_Overview.moveOverRect();null!=mv_Scalebar&&mv_Scalebar.changeScalebar();mv_adaptMapRects();mv_updateDemoPath();mv_mapTipOut()}
function mv_adaptMapRects(){var a=Math.max(mv_Map.CurrentVB.Width,mv_Map.CurrentVB.Height);null!=mv_Map.Root.getElementById("panAndZoomRect")&&mv_setAttrSVG(mv_Map.Root.getElementById("panAndZoomRect"),{x:mv_Map.CurrentVB.X-a,y:mv_Map.CurrentVB.Y-a,width:mv_Map.CurrentVB.Width+2*a,height:mv_Map.CurrentVB.Height+2*a});null!=mv_Map.Root.getElementById("koordrect")&&mv_setAttrSVG(mv_Map.Root.getElementById("koordrect"),{x:mv_Map.CurrentVB.X-a,y:mv_Map.CurrentVB.Y-a,width:mv_Map.CurrentVB.Width+2*a,height:mv_Map.CurrentVB.Height+
2*a})}function mv_zoomExtentList(a){if(mv_Map.ExtentList[mv_Map.ExtentIndex+a]){var b=mv_Map.Scale,c=mv_Map.ExtentList[mv_Map.ExtentIndex+a];mv_Map.Map.setAttributeNS(null,"viewBox",c[0].getViewBoxString());mv_Map.Scale=c[1];mv_Doc.ResizeMap&&mv_Map.adaptExtent();mv_Map.ExtentIndex+=a;mv_zoomChange(!0);mv_scaleSym(b)}}
function mv_declareClassPoint(){dojo.declare("MV.Point",null,{constructor:function(a,b){if("object"==typeof a){var c=a.selectSingleNode("ext").firstChild.nodeValue.split(",");this.x=parseFloat(c[0]);this.y=parseFloat(c[2])}else this.x=a,this.y=b},distance:function(a,b){if(b){if(this.equal(a))return 0;var c=mv_calcLengthLatLng(a.y,a.x,this.y,this.x);return isNaN(c)?0:c}c=a.y-this.y;c=Math.sqrt(Math.pow(a.x-this.x,2)+Math.pow(c,2));return Math.round(1E3*c)/1E3},equal:function(a){return this.x==a.x&&
this.y==a.y?!0:!1},withinDistance:function(a,b,c){a=this.distance(a,c);return b<=a?!0:!1}})}
function mv_declareClassDrawing(){dojo.declare("MV.Drawing",null,{PathNode:null,PointNode:null,PathString:"M ",ClickCount:0,OldEvt:null,DblClick:!1,DrawCircle:!0,IsLocked:!1,ParMapNode:mv_Map.Root.getElementById("measure"),constructor:function(){},init:function(){this.initDrawFeatures()},initDrawFeatures:function(){var a=new MV.Symbol({shape:"path","stroke-width":1});this.PathString="M ";this.PathNode=a.makeSVGNode(mv_Map.Root,mv_Map.LegMapKoeff/mv_Map.Scale,{id:"drawPath","pointer-events":"none",
d:this.PathString});this.ParMapNode.appendChild(this.PathNode);this.DrawCircle&&(this.PointNode=(new MV.Symbol({shape:"circle",r:6,fill:"orange",stroke:mv_Doc.HiQueryColor})).makeSVGNode(mv_Map.Root,mv_Map.LegMapKoeff/mv_Map.Scale,{id:"drawStartCircle","pointer-events":"none"}),this.ParMapNode.appendChild(this.PointNode));if(null!=this.PathNode)switch(this.FeatureType){case "Line":mv_setAttrSVG(this.PathNode,{fill:"none"});break;case "Polygon":mv_setAttrSVG(this.PathNode,{fill:mv_Doc.HiColor,"fill-opacity":.1})}},
start:function(a,b){var c=mv_Map.getMapviewPoint(a);this.PathString="M "+c.x+" "+c.y;null!=this.PointNode&&mv_setAttrSVG(this.PointNode,{cx:c.x,cy:c.y});c=mv_Map.getMapviewPoint(a);this.PathString="M "+c.x+" "+c.y;null!=this.PointNode&&mv_setAttrSVG(this.PointNode,{cx:c.x,cy:c.y})},stop:function(){},reset:function(){this.IsLocked?this.IsLocked=!1:this.destroyDrawFeatures()},destroyDrawFeatures:function(){this.ClickCount=0;null!=this.PathNode&&this.PathNode.parentNode.removeChild(this.PathNode);this.PathNode=
null;null!=this.PointNode&&this.PointNode.parentNode.removeChild(this.PointNode);this.PointNode=null},destroy:function(){this.destroyDrawFeatures()},click:function(a){var b=mv_Map.getRealMapPoint(a.clientX,a.clientY);0==this.ClickCount&&(null==this.PathNode&&this.init(),this.start(b,a));this.ClickCount+=1;this.setDoubleClick(a);a=mv_Map.getMapviewPoint(b);this.PathString+=" L "+a.x+" "+a.y;this.draw(this.PathString)},setDoubleClick:function(a){null!=this.OldEvt&&this.OldEvt.clientY==a.clientY&&this.OldEvt.clientX==
a.clientX?(this.DblClick=!0,this.OldEvt=null):(this.DblClick=!1,this.OldEvt=a)},mouseMove:function(a){0!=this.ClickCount&&(a=mv_Map.getRealMapPoint(a.clientX,a.clientY),a=mv_Map.getMapviewPoint(a),this.draw(this.PathString+" L "+a.x+" "+a.y))},movePoint:function(a){if(null!=this.PathNode){for(a=0;a<this.Features.length;a++){var b=this.Features[a],c=b.getAttributeNS(null,"cx"),b=b.getAttributeNS(null,"cy");0==a&&(this.PathString="M "+c+" "+b);this.PathString+=" L "+c+" "+b}this.draw(this.PathString)}},
draw:function(a){"Polygon"==this.FeatureType&&(a+="Z");this.PathNode.setAttributeNS(null,"d",a)}})}
function mv_declareClassMeasure(){mv_declareClassDrawing();dojo.declare("MV.CalcGraphs",null,{Line:0,SegmentLine:0,TotalLine:0,SegmentArea:0,TotalArea:0,Areasum:0,TotalAreaShow:0,TotalLineShow:0,PrevPoint:null,StartPoint:null,AreaP:null,TotalAngle:0,AreaSphere:0,DoMercator2LatLon:!1,Method:0,constructor:function(){"WebMercator"==mv_Map.Projection&&(this.DoMercator2LatLon=!0)},init:function(){try{this.PathNode.getTotalLength()}catch(a){this.Method=1}this.DoMercator2LatLon&&(this.Method=1)},start:function(a,
b){this.SegmentArea=this.Line=0;this.StartPoint=this.PrevPoint=a;this.TotalAngle=this.Areasum=0;this.AreaP=[]},stop:function(){},reset:function(){this.SegmentLine=this.TotalAreaShow=this.TotalArea=this.TotalLineShow=this.TotalLine=0},destroy:function(){},click:function(a){a=mv_Map.getRealMapPoint(a.clientX,a.clientY);if(1==this.Method){var b=this.PrevPoint.distance(a,this.DoMercator2LatLon);2>b&&1<this.ClickCount?this.ClickCount=0:(this.SegmentLine=0,this.Line+=b,"Polygon"==this.FeatureType&&(this.SegmentLine=
a.distance(this.StartPoint,this.DoMercator2LatLon)))}else this.DblClick&&(this.ClickCount=0);"Polygon"==this.FeatureType&&0<this.ClickCount&&(this.Areasum+=this.calcArea(this.PrevPoint,a),this.DoMercator2LatLon&&(this.AreaP.push(a),this.AreaSphere=this.calcSphericalArea(this.AreaP,!0)));0==this.ClickCount&&(this.SegmentLine=0,0==this.Method?this.Line=this.PathNode.getTotalLength()/mv_Map.NormalizeFactor:"Polygon"==this.FeatureType&&(this.Line+=a.distance(this.StartPoint,this.DoMercator2LatLon)),this.TotalLineShow=
this.TotalLine+=this.Line,"Polygon"==this.FeatureType&&(this.SegmentArea=Math.abs(.5*(this.Areasum+this.calcArea(a,this.StartPoint))),this.TotalAreaShow=this.TotalArea="WebMercator"==mv_Map.Projection&&1E6<this.SegmentArea?this.TotalArea+this.AreaSphere:this.TotalArea+this.SegmentArea),0==this.Sum&&(this.TotalLineShow=this.TotalLine=this.TotalAreaShow=this.TotalArea=0));this.PrevPoint=a},mouseMove:function(a){if(0!=this.ClickCount){a=mv_Map.getRealMapPoint(a.clientX,a.clientY);if(0==this.Method)this.SegmentLine=
this.PathNode.getTotalLength()/mv_Map.NormalizeFactor;else{var b=this.PrevPoint.distance(a,this.DoMercator2LatLon);"Polygon"==this.FeatureType&&(b+=a.distance(this.StartPoint,this.DoMercator2LatLon));this.SegmentLine=b}this.TotalLineShow=this.TotalLine+this.Line+this.SegmentLine;"Polygon"==this.FeatureType&&1<this.ClickCount&&(b=this.Areasum+this.calcArea(this.PrevPoint,a),this.SegmentArea=Math.abs(.5*(b+this.calcArea(a,this.StartPoint))),this.DoMercator2LatLon&&1E6<this.SegmentArea?(b=[],b=b.concat(this.AreaP),
b.push(a),this.AreaSphere=this.calcSphericalArea(b,!1),this.TotalAreaShow=this.TotalArea+this.AreaSphere):this.TotalAreaShow=this.TotalArea+this.SegmentArea)}},movePoint:function(a){this.TotalAngle=this.Areasum=this.SegmentArea=this.Line=0;this.AreaP=[];for(a=0;a<this.Features.length;a++){var b=this.Features[a],c=parseFloat(b.getAttributeNS(null,"cx")),b=parseFloat(b.getAttributeNS(null,"cy")),c=new MV.Point(mv_Map.getRealMapX(c),mv_Map.getRealMapY(b));0==a&&(this.StartPoint=this.PrevPoint=c);1==
this.Method&&(b=this.PrevPoint.distance(c,this.DoMercator2LatLon),this.Line+=b);"Polygon"==this.FeatureType&&(this.Areasum+=this.calcArea(this.PrevPoint,c),this.DoMercator2LatLon&&(this.AreaP.push(c),this.AreaSphere=this.calcSphericalArea(this.AreaP,!0)));this.PrevPoint=c}0==this.Method?this.Line=this.PathNode.getTotalLength()/mv_Map.NormalizeFactor:"Polygon"==this.FeatureType&&(this.Line+=c.distance(this.StartPoint,this.DoMercator2LatLon));"Polygon"==this.FeatureType&&(this.SegmentArea=Math.abs(.5*
(this.Areasum+this.calcArea(c,this.StartPoint))))},getLength:function(){return((this.Line+this.SegmentLine)*mv_Map.DispUnit).toFixed(mv_Map.DispUnitPrecision)},getSumLength:function(){return(this.TotalLineShow*mv_Map.DispUnit).toFixed(mv_Map.DispUnitPrecision)},getArea:function(){return(this.SegmentArea*mv_Map.DispUnit*mv_Map.DispUnit).toFixed(mv_Map.DispUnitPrecision)},getSumArea:function(){return(this.TotalAreaShow*mv_Map.DispUnit*mv_Map.DispUnit).toFixed(mv_Map.DispUnitPrecision)},calcArea:function(a,
b){if("WebMercator"==mv_Map.Projection){var c=12734920*Math.PI/360,d=a.x*c*Math.cos(a.y.toRad()),e=a.y*c,f=b.x*c*Math.cos(b.y.toRad());return d*b.y*c-f*e}return a.x*b.y-b.x*a.y},calcSphericalArea:function(a,b){if(3>a.length)return 0;var c=this.AreaSphere,d=this.TotalAngle;for(i=a.length-3;i<a.length;++i){var e=this.angle(a[i],a[(i+1)%a.length],a[(i+2)%a.length]),d=d+e;1==b&&(this.TotalAngle+=e,b=!1)}var e=180*(a.length-2),f=d-e;420<f?(d=360*a.length-d,f=d-e):300<f&&420>f&&(f=Math.abs(360-f));return 179<=
f.toFixed(0)&&181>=f.toFixed(0)?c:f*Math.PI/180*40544546851600},angle:function(a,b,c){a=this.bearing(b,a);b=this.bearing(b,c);b=a-b;0>b&&(b+=360);return b},bearing:function(a,b){var c=a.y.toRad(),d=a.x.toRad(),e=b.y.toRad(),f=b.x.toRad(),c=-Math.atan2(Math.sin(d-f)*Math.cos(e),Math.cos(c)*Math.sin(e)-Math.sin(c)*Math.cos(e)*Math.cos(d-f));0>c&&(c+=2*Math.PI);return c=180*c/Math.PI}});dojo.declare("MV.Measure",[MV.Drawing,MV.CalcGraphs],{"-chains-":{init:"after",start:"after",click:"after",mouseMove:"after",
reset:"before",destroy:"after"},Sum:!1,FeatureType:"Line",constructor:function(){null!=dojo.byId("MVmeasureToolbar")&&(1==dijit.byId("MVmeasureToolbar.area").checked?this.FeatureType="Polygon":(this.FeatureType="Line",dijit.byId("MVmeasureToolbar.line").set("checked",!0)),1==dijit.byId("MVmeasureToolbar.sum").checked&&(this.Sum=!0))},userSettings:function(a,b,c,d,e,f,g,h){mv_Doc.Texts.Line=a;mv_Doc.Texts.Perimeter=b;mv_Doc.Texts.Area=c;mv_Doc.Texts.Sum=d;mv_Doc.Texts.UnitLength=e;mv_Doc.Texts.UnitArea=
f;mv_Map.DispUnit=g;mv_Map.DispUnitPrecision=h},init:function(a,b){},start:function(a,b){this.showText(b)},reset:function(){var a=dijit.byId("MVtoolbar.measure");a&&a.set("style","background:#D3D3D3");this.showText()},destroy:function(){var a=dijit.byId("MVtoolbar.measure");a&&a.set("style","background:none");this.showText()},click:function(a){},mouseMove:function(a){0!=this.ClickCount&&this.showText(a)},setFeatureType:function(a){"Polygon"==a&&null!=dojo.byId("MVmeasureToolbar.line")&&dijit.byId("MVmeasureToolbar.line").set("checked",
!1);"Line"==a&&null!=dojo.byId("MVmeasureToolbar.area")&&dijit.byId("MVmeasureToolbar.area").set("checked",!1);this.FeatureType=a;this.reset()},showText:function(a){if("undefined"==typeof a)mv_showText("MVshowMeasure","");else{var b="Line"==this.FeatureType?mv_Doc.getText("Line","Length"):mv_Doc.getText("Perimeter","Perimeter"),b=b+(": "+this.getLength()+" "+mv_Doc.getText("UnitLength",""));this.Sum&&(b+="\n"+mv_Doc.getText("Sum","Sum")+": "+this.getSumLength()+" "+mv_Doc.getText("UnitLength",""));
"Polygon"==this.FeatureType&&(b+="\n"+mv_Doc.getText("Area","Area")+": "+this.getArea()+" "+mv_Doc.getText("UnitArea",""),this.Sum&&(b+="\n"+mv_Doc.getText("Sum","Sum")+": "+this.getSumArea()+" "+mv_Doc.getText("UnitArea","")));mv_showText("MVshowMeasure",b,a)}}})}
function mv_arrangeKoordMeas(){mv_Map.Root.getElementById("koordrect").setAttributeNS(null,"pointer-events","all");dojo.byId("MVshowKoord")&&(dojo.byId("MVshowKoord").value="");switch(mv_Doc.Task){case "koord":if(null==dojo.byId("MVkoord"))break;mv_showTabContainer("MVkoord");dijit.byId("MVkoord").set("open",!0);break;case "measure":if(null==dojo.byId("MVmeasure"))break;mv_showTabContainer("MVmeasure");dijit.byId("MVmeasure").set("open",!0);break;case "sunlight":mv_arrangeSunlight()}}
function mv_showTabContainer(a){try{for(var b="",c=dijit.byId(a).getParent();null!=c;){if("dijit.layout.ContentPane"==c.declaredClass){b=c.id;break}c=c.getParent()}dijit.byId("MVtabContainer").selectChild(b)}catch(d){}}function mv_doMeasure(a,b,c,d){switch(mv_Doc.Task){case "sunlight":mv_getSunlight(a);break;case "measure":mv_Measure.click(a);break;case "paint":mv_Map.Layers.getLayerObj("MV.Painting").click(a)}}
function mv_doKoordMeasure(a){switch(mv_Doc.Task){case "koord":var b=mv_Map.getRealMapPoint(a.clientX,a.clientY),b=b.x.toFixed(mv_Map.Precision)+" : "+b.y.toFixed(mv_Map.Precision);mv_showText("MVshowKoord",b,a);break;case "measure":mv_Measure.mouseMove(a);break;case "paint":mv_Map.Layers.getLayerObj("MV.Painting").mouseMove(a)}}function mv_endKoord(){mv_mapTipOut();"koord"==mv_Doc.Task&&mv_showText("MVshowKoord","")}
function mv_showText(a,b,c){if(null!=dojo.byId(a)&&(dijit.byId(a).set("value",b),"screen"==mv_getMediaScreen()))return;"undefined"!=typeof c&&mv_mapTipShow(c,b)}function mv_calcLengthLatLng_Haver(a,b,c,d){var e=(c-a).toRad();b=(d-b).toRad();a=Math.sin(e/2)*Math.sin(e/2)+Math.cos(c.toRad())*Math.cos(a.toRad())*Math.sin(b/2)*Math.sin(b/2);return 1.2745595121712E7*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}
function mv_calcLengthLatLng_Vincenty(a,b,c,d){var e=(d-b).toRad();b=Math.cos(a.toRad())*Math.sin(e);d=Math.cos(c.toRad())*Math.sin(a.toRad())-Math.sin(c.toRad())*Math.cos(a.toRad())*Math.cos(e);a=Math.sin(c.toRad())*Math.sin(a.toRad())+Math.cos(c.toRad())*Math.cos(a.toRad())*Math.cos(e);return 6372797.560856*Math.atan2(Math.sqrt(b*b+d*d),a)}
function mv_calcLengthLatLng(a,b,c,d){a=6372797.560856*Math.acos(Math.sin(a.toRad())*Math.sin(c.toRad())+Math.cos(a.toRad())*Math.cos(c.toRad())*Math.cos((d-b).toRad()));return isNaN(a)?0:a}function mv_colorMapCheck(a){var b=a.checked;a=a.id.substring(13);b&&_mv_handleRadioLegends(a);mv_colorMapCheck2(b,a)}
function mv_colorMapCheck2(a,b){if(null!=mv_Map){var c=dijit.byId("MVsharedSel"+b);null==mv_Map.colorMapLayer(b)&&null!=c&&mv_colorMapChange(c.value,b);var d=mv_Map.Layers.item(mv_Map.colorMapLayer(b));if(null!=d){var e=!1;"undefined"!=typeof mv_Slider&&null!=mv_Slider&&mv_Slider.HandleId==b&&(e=!0);c&&c.set("disabled",!a);0==e?mv_changeLayerVis2(!a,d):mv_Slider.getDisabled()&&a||mv_changeLayerVis2(!a,d)}}}
function mv_colorMapAnalyzeStr(a,b){var c=a.split(","),d=c.shift();if("themaId"==b)return d;var d=null,e=!1;0<c.length&&(d=c.shift(),"TRUE"==d.toUpperCase()||"FALSE"==d.toUpperCase())&&(e=mv_str2bool(d),d=null);if("field"==b)return d;0<c.length&&(e=mv_str2bool(c.shift()));return e}
function mv_colorMapChange(a,b){var c=mv_colorMapAnalyzeStr(a,"themaId"),d=mv_colorMapAnalyzeStr(a,"field"),e=mv_colorMapAnalyzeStr(a,"slider");if(mv_Map.colorMapLayer(b)!=c){var f=mv_Map.Layers.item(mv_Map.colorMapLayer(b));null!=f&&mv_changeLayerVis2(!0,f);null!=dojo.byId("MVlegend"+b)&&mv_removeEle("MVlegend"+b+"Doc")}mv_Map.ColorMapLayer[b]=a;f=mv_Map.Layers.item(c);if(null!=f&&e)null==d?mv_sliderCreate(c,b):mv_sliderCreate(c+","+String(d),b);else if("undefined"!=typeof mv_Slider&&null!=mv_Slider&&
mv_Slider.HandleId==b&&(null!=dojo.byId("MVslider"+b)&&(dojo.byId("MVslider"+b).style.display="none"),null!=mv_Slider&&(mv_Slider.slider.destroy(),mv_Slider=null)),null!=f)if(-1!=c.indexOf("d"))mv_changeLayerVis2(!1,f);else if(e=mv_colorMapSettings(c,d),null!=e){e.slider=!1;e.drawField=e.field;f.VectorSettings=e;var g=dijit.byId("MVsharedCheck"+b),h=!1;null!=g?g.checked&&(h=!0):h=!0;h&&(null!=d?f.XMLAccess?mv_colorMapVector(c,e):mv_colorMapVectorDB(f,d):0==f.TurnedOn&&mv_changeLayerVis2(!1,f));f.XMLAccess?
mv_colorMapLegend(e,"MVlegend"+b):0==f.DB.WriteLeg&&mv_colorMapLegend(e,"MVlegend"+b)}}
function mv_colorMapSettings(a,b){var c=mv_Map.Layers.item(a);if(null==c.symbols){c.symbols=mv_loadXMLDoc(mv_Doc.BaseURL+"embfiles/"+a+"col_json.js","json");if(null==c.symbols)return null;for(var d=0;d<c.symbols.length;d++)if(g=c.symbols[d],null!=g.symbols){g.defSymbol=null;for(var e=0;e<g.symbols.length;e++){var f=g.symbols[e];g.symbols[e]=new MV.JSONSymbol(f);"defSymbol"==f.type&&(g.defSymbol=new MV.JSONSymbol(f))}}}var g=null;if(null==b)g=c.symbols[0],"null"!=g.legHeight&&(g.legend="legend"+a+
".svg");else for(f=!1,d=0;d<c.symbols.length&&!f;d++)if(g=c.symbols[d],dojo.isArray(g.field))for(var h=g.field,e=0;e<h.length;e++)h[e]==b&&("null"!=g.legHeight&&(g.legend="legend"+a+h[e]+".svg"),f=!0);else g.field==b&&("null"!=g.legHeight&&(g.legend="legend"+a+b+".svg"),f=!0);null!=g&&(g.print=!0);return g}
function mv_colorMapGetSymbol(a,b){if(null==a)return b.needsDefSymbol=!0,b.defSymbol;var c=b.defSymbol;if("simple"==b.type)return b.defSymbol;for(var d=0;d<b.symbols.length;d++)if("symbol"==b.symbols[d].type)if("unique"==b.type){if(a==b.symbols[d].value)return d}else if(a=parseFloat(a),a>=b.symbols[d].min&&a<=b.symbols[d].max)return d;b.needsDefSymbol=!0;return c}
function mv_colorMapLegend(a,b){var c=dojo.byId(b);if(null!=c){mv_removeEle(b+"Doc");if(mv_Doc.PrintStatus){var d=mv_makeFullNode(document,"p",{},a.name);c.appendChild(d)}null!=a.legend&&(d="440px",null!=dojo.byId("MVtabContainer")&&(d=dojo.byId("MVtabContainer").style.width),d=""==d||"0px"==d?"100%":String(parseInt(d.substring(0,d.indexOf("px")))-37)+"px",d=mv_embedSVGNode(dojo.doc,b+"Doc",d,a.legHeight,"embfiles/"+a.legend),c.appendChild(d))}}
function mv_colorMapVector_Tiling(a,b){var c=mv_Map.Root.getElementById(a),d=mv_getThemaId(a),e=mv_loadAttrTableFile(d,!0);null!=e&&(d=mv_Map.Layers.item(d),mv_colorMapRecs(c.childNodes,e,b,d.SVGLayerProp.StyleProp))}
function mv_colorMapRecs(a,b,c,d){dojo.forEach(a,function(a){if(1==a.nodeType){var f=a.getAttributeNS(null,"id");if(-1<f.indexOf("_")){var g=mv_Map.Root.getElementById(f);mv_colorMapRecs(g.childNodes,b,c,d)}try{var h=b.getRecord(f).selectSingleNode("c/"+c.drawField).firstChild.nodeValue}catch(l){h=null}mv_colorMapRec(a,h,c,d)}})}function mv_colorMapRec(a,b,c,d){b=mv_colorMapGetSymbol(b,c);"number"==typeof b&&(b=c.symbols[b]);null!=b&&a.setAttributeNS(null,d,b[d]);return b}
function mv_colorMapVector(a,b){a=mv_getThemaId(a);var c=mv_Map.Layers.item(a),d=mv_loadAttrTableFile(a,!0);if(null!=d){d=d.getRecords();if(null==d)return!1;mv_clearFeatures();for(var e=0,f=d.length;e<f;e++){var g=d[e];try{var h=g.selectSingleNode("c/"+b.drawField).firstChild.nodeValue}catch(l){h=null}g=mv_Map.Root.getElementById(g.getAttribute("id"));null!=g&&mv_colorMapRec(g,h,b,c.SVGLayerProp.StyleProp)}0==c.TurnedOn&&mv_changeLayerVis2(!1,c)}}
function mv_writeLegendGFXContainer(a,b,c){var d=b.getAttribute("id").substring(0,b.getAttribute("id").indexOf("Legend")),e=mv_makeNode(a,"div",{});e.style.marginTop="5px";e.style.marginBottom="5px";b.appendChild(e);a=mv_makeNode(a,"div",{id:d+"InnerLegend"});e.appendChild(a);return dojox.gfx.createSurface(a,"100%",c*mv_Doc.LegLayout.LegKastOffset+4)}
function mv_writeLegendDownMenu(a,b){var c=new dijit.DropDownMenu({}),d=new dijit.form.DropDownButton({label:b,showLabel:!1,"class":"MVlegendButton",dropDown:c});a.appendChild(d.domNode);return c}function mv_writeLegendMenuItem(a,b,c,d){b=String(b);b=new dijit.MenuItem({label:b,onClick:function(){eval(d)}});""!=c&&b.set("iconClass",c);a.addChild(b)}
function mv_writeLegendCheckbox(a,b,c){var d;d=mv_makeNode(document,"input",{type:"checkbox"});a.appendChild(d);return new dijit.form.CheckBox({id:b.id+"Check",checked:c,onChange:function(){mv_changeLayerVis(this);mv_showLegend(b.id,this.checked)}},d)}
function mv_writeLegend(a,b,c){var d=mv_makeNode(document,"div",{id:"MV"+b.id+"Legend",style:"margin: 3px 0px 3px "+mv_Doc.LegLayout.GroupLegOffset+"px"});a.appendChild(d);var e=mv_makeNode(document,"div",{});d.appendChild(e);a=mv_makeNode(document,"div",{id:b.id+"Legend",style:"display:"+(b.TurnedOn?"block":"none")+";padding-left"+mv_Doc.LegLayout.GroupLegOffset+"px"});d.appendChild(a);d=mv_writeLegendCheckbox(e,b,b.TurnedOn);if(null!=b.Layers&&0<b.Layers.length())for(e=0;e<b.Layers.length();e++){var f=
b.Layers.item(e);mv_writeLegend(a,f,c)}else{if(b.HasAttrTable||b.HasLegend||b.HasInfo)f=mv_writeLegendDownMenu(e,mv_Doc.getText("OptionsForLayer","Options for layer")),b.HasLegend&&mv_writeLegendMenuItem(f,mv_Doc.getText("Legend","Legend"),"dijitMapViewIcon dijitMapViewIconLegend","mv_showLegend('"+b.id+"')"),b.HasAttrTable&&mv_writeLegendMenuItem(f,mv_Doc.getText("AttributeTable","Attribute table"),"dijitMapViewIcon dijitMapViewIconTable","mv_showUserTable('"+b.id+"')"),b.HasInfo&&mv_writeLegendMenuItem(f,
mv_Doc.getText("Description","Description"),"dijitMapViewIcon dijitMapViewIconHelp","mv_layerInfo('"+b.id+"')");f=mv_makeFullNode(document,"label",{"for":b.id+"Check"},b.getName());e.appendChild(f);mv_writeLegendKast(a,b,c,b.SVGLayerProp.StyleProp)}return d}function mv_showUserTable(a){}
function mv_writeLegendKast(a,b,c,d){if(null!=a&&null!=b.symbols){var e=b.symbols.length;null!=b.defSymbol&&0==b.needsDefSymbol&&e--;a=mv_writeLegendGFXContainer(document,a,e);for(var f=e=0;f<b.symbols.length;f++){var g=b.symbols[f];if("defSymbol"!=g.type||0!=b.needsDefSymbol){var h="";c&&(h=g.value);null!=b.curSymList&&0<b.curSymList.length&&"symbol"==g.type&&"graduated"==b.type&&(f<b.curSymList[0]||f>b.curSymList[b.curSymList.length-1])||(mv_writeLegendGFXEntries(a,e,g,h,d),e++)}}}}
function mv_writeLegendGFXEntries(a,b,c,d,e){if(null!=a){b*=mv_Doc.LegLayout.LegKastOffset;var f=mv_Doc.LegLayout.legKastExtent();switch(c.shape){case "path":"stroke"!=e?a.createRect({x:mv_Doc.LegLayout.LegKastX,y:b+2,width:f.w,height:f.h-4}).setFill(c.fill).setStroke(c.getStroke()):(e=f.h/2+b,a.createLine({x1:mv_Doc.LegLayout.LegKastX,y1:e,x2:f.w+mv_Doc.LegLayout.LegKastX,y2:e}).setStroke(c.getStroke()));break;case "circle":a.createCircle({cx:f.w/2+mv_Doc.LegLayout.LegKastX,cy:f.h/2+b,r:c.r}).setFill(c.fill).setStroke(c.getStroke());
break;case "rect":a.createRect({x:(f.w-c.width)/2+mv_Doc.LegLayout.LegKastX,y:(f.h-c.height)/2+b+1,width:c.width,height:c.height}).setFill(c.fill).setStroke(c.getStroke());break;case "img":a.createImage({x:(f.w-c.width)/2+mv_Doc.LegLayout.LegKastX,y:(f.h-c.height)/2+b+1,src:c.src,width:c.width,height:c.height});break;case "text":a.createText({x:mv_Doc.LegLayout.LegKastX,y:b+10,text:d}).setFont({family:"Arial",size:"8pt"}).setFill(c.fill),d=""}""!=d&&a.createText({x:mv_Doc.LegLayout.LegKastXText,y:b+
12,text:d}).setFont({family:"Arial",size:"8pt"}).setFill("black")}}function mv_makeVideoAudioNode(a,b,c,d,e){var f=a.createElement(b);mv_setAttr(f,c);dojo.forEach(e,function(c,e){var l=c;"ogv"==l&&(l="ogg");"mp3"==l&&(l="mpeg");l=mv_makeNode(a,"source",{src:d+"."+c,type:b+"/"+l});f.appendChild(l)});return f}
function mv_checkVideo(a){var b=document.createElement("video");if(b.canPlayType){var c=!1;dojo.forEach(a,function(a,e){var f=!1;-1!=a.indexOf("mp4")&&(f=!!b.canPlayType&&""!=b.canPlayType("video/mp4"),1==f&&(c=!0));-1!=a.indexOf("ogv")&&(f=!!b.canPlayType&&""!=b.canPlayType("video/ogg"),1==f&&(c=!0));-1!=a.indexOf("webm")&&(f=!!b.canPlayType&&""!=b.canPlayType("video/webm"),1==f&&(c=!0))})}return c}
function mv_checkAudio(a){var b=document.createElement("audio");if(b.canPlayType){var c=!1;dojo.forEach(a,function(a,e){var f=!1;-1!=a.indexOf("mp3")&&(f=!!b.canPlayType&&""!=b.canPlayType("audio/mpeg"),1==f&&(c=!0));-1!=a.indexOf("ogg")&&(f=!!b.canPlayType&&""!=b.canPlayType('audio/ogg; codecs="vorbis"'),1==f&&(c=!0));-1!=a.indexOf("wav")&&(f=!!b.canPlayType&&""!=b.canPlayType("audio/wav"),1==f&&(c=!0))})}return c}
function mv_showOverview(a,b){var c={pressed:"#D3D3D3",unpressed:b},d=dojo.byId("MVoverviewFrame");"inline"==d.style.display?(d.style.display="none",mv_setToggleButtonStyle(a,!0,c)):(d.style.display="inline",mv_setToggleButtonStyle(a,!1,c))}function mv_mobileInit(){"smartphone"==mv_getMediaScreen()&&document.getElementById("MVtabContainer").setAttribute("data-dojo-type","dijit.layout.TabContainer")}
function mv_mobileHandleWidgets(a,b){if("smartphone"==mv_getMediaScreen()){var c=dijit.byId("MVtabContainer"),d;try{(d=dijit.byId("MVgraphContainer"))&&c.removeChild(d,0),b&&(d=dijit.byId(b))&&c.removeChild(d,0)}catch(e){}d=new dijit.layout.ContentPane({id:"MVmapContainer",title:a});c.addChild(d,0);c.selectChild(d);d=dojo.byId("MVmap");dojo.byId("MVmapContainer").appendChild(d);dijit.byId("MVmapContainer").resize();d=dojo.byId("MVtoolbar.MapService");if(null!=d&&null==dojo.byId("MVmapserviceContainer")){var f=
mv_makeNode(document,"div",{id:"MVmapserviceContainer",style:"margin-top:10px;margin-bottom:10px"});d.style.marginLeft="0";d.style.width="100%";f.appendChild(d);(c=dojo.byId("MVlegendContent"))&&c.insertBefore(f,c.childNodes[0])}if(null==dojo.byId("MVzoomObjects")){f=dojo.byId("MVzoomserviceContainer");null==dojo.byId("MVzoomserviceContainer")&&(f=mv_makeNode(document,"div",{id:"MVzoomserviceContainer",style:"margin-top:10px;margin-bottom:10px"}));var g=!1;dojo.query(".MVselToolbar").forEach(function(a){a=
dijit.getEnclosingWidget(a);a=a.domNode;a.style.marginLeft="0";a.style.marginBottom="3px";a.style.width="100%";f.appendChild(a);g=!0});1==g&&(c=dojo.byId("MVlegendContent"))&&c.insertBefore(f,c.childNodes[0])}dojo.query(".MVFilteringSelect").forEach(function(a){a=dijit.getEnclosingWidget(a);try{a.textbox.readOnly=!0}catch(b){}})}}function mv_zoomInButton(){mv_zoomButton(2)}function mv_zoomOutButton(){mv_zoomButton(.5)}
function mv_zoomButton(a){var b=mv_Map.Scale;mv_Map.Scale*=a;mv_Map.Scale=mv_Map.getLimitScale(mv_Map.Scale);mv_scaleSym(b);a=mv_Map.CurrentVB.centerP();mv_centerZoomChanges(a.x,a.y,!0)}function mv_beginMobileOverviewPan(a){mv_Overview.beginOverPan(a.targetTouches[0])}function mv_doMobileOverviewPan(a){mv_Overview.doOverPan(a.targetTouches[0])}function mv_endMobileOverviewPan(){mv_Overview.endOverPan()}function mv_panLeftButton(){mv_panButton(mv_Map.CurrentVB.Width/5*-1,0)}
function mv_imgResize(a,b,c){if(0!=mv_isIE()||0!=mv_isOpera())if(a=a.target,1==b){mv_ImgInfo[0]=a.getAttributeNS(null,"x");mv_ImgInfo[1]=a.getAttributeNS(null,"y");mv_ImgInfo[2]=a.getAttributeNS(null,"width");mv_ImgInfo[3]=a.getAttributeNS(null,"height");b=mv_ImgInfo[0]-(mv_ImgInfo[2]*c-mv_ImgInfo[2])/2;b<mv_Map.CurrentVB.X?b=mv_Map.CurrentVB.X:b+mv_ImgInfo[2]*c>mv_Map.CurrentVB.X+mv_Map.CurrentVB.Width&&(b=mv_Map.CurrentVB.X+mv_Map.CurrentVB.Width-mv_ImgInfo[2]*c);var d=mv_ImgInfo[1]-(mv_ImgInfo[3]*
c-mv_ImgInfo[3])/2;d<mv_Map.CurrentVB.Y?d=mv_Map.CurrentVB.Y:d+mv_ImgInfo[3]*c>mv_Map.CurrentVB.Y+mv_Map.CurrentVB.Height&&(d=mv_Map.CurrentVB.Y+mv_Map.CurrentVB.Height-mv_ImgInfo[3]*c);mv_setAttrSVG(a,{x:b,y:d,width:mv_ImgInfo[2]*c,height:mv_ImgInfo[3]*c})}else mv_setAttrSVG(a,{x:mv_ImgInfo[0],y:mv_ImgInfo[1],width:mv_ImgInfo[2],height:mv_ImgInfo[3]})}function mv_Timer(){this.obj=arguments.length?arguments[0]:window;return this}
mv_Timer.prototype.setInterval=function(a,b){var c=mv_Timer.getNew(),d=mv_Timer.buildCall(this.obj,c,arguments);mv_Timer.set[c].timer=window.setInterval(d,b);return c};mv_Timer.prototype.setTimeout=function(a,b){var c=mv_Timer.getNew();mv_Timer.buildCall(this.obj,c,arguments);mv_Timer.set[c].timer=window.setTimeout("mv_Timer.callOnce("+c+");",b);return c};mv_Timer.prototype.clearInterval=function(a){mv_Timer.set[a]&&(window.clearInterval(mv_Timer.set[a].timer),mv_Timer.set[a]=null)};
mv_Timer.prototype.clearTimeout=function(a){mv_Timer.set[a]&&(window.clearTimeout(mv_Timer.set[a].timer),mv_Timer.set[a]=null)};mv_Timer.set=[];mv_Timer.buildCall=function(a,b,c){var d="";mv_Timer.set[b]=[];a!=window&&(mv_Timer.set[b].obj=a,d="mv_Timer.set["+b+"].obj.");d+=c[0]+"(";if(2<c.length)for(mv_Timer.set[b][0]=c[2],d+="mv_Timer.set["+b+"][0]",a=1;a+2<c.length;a++)mv_Timer.set[b][a]=c[a+2],d+=", mv_Timer.set["+b+"]["+a+"]";d+=");";return mv_Timer.set[b].call=d};
mv_Timer.callOnce=function(a){mv_Timer.set[a]&&(eval(mv_Timer.set[a].call),mv_Timer.set[a]=null)};mv_Timer.getNew=function(){for(var a=0;mv_Timer.set[a];)a++;return a};
function mv_fullScreen(){var a=document.getElementById("MVhtmlBody");self.frameElement?mv_showWindow(self.frameElement.contentWindow.location.href,"map","_blank","newWindow"):document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():
a.requestFullscreen?a.requestFullscreen():a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.msRequestFullscreen&&a.msRequestFullscreen()}function mv_encodeEntities(a){return a.replace(/[\u00A0-\u99999<>\&]/gim,function(a){return"&#"+a.charCodeAt(0)+";"})}function mv_localUsage(){return-1!=document.URL.indexOf("file://")}function mv_localUsage(){return-1!=document.URL.indexOf("file://")}
function mv_oExists(a){return"undefined"==typeof a?!1:null!=a}function _mv_loadXMLDocIELocal(a,b){var c,d=new ActiveXObject("Microsoft.xmlHTTP");d.open("GET",a,!1);d.onreadystatechange=function(){if(4==d.readyState)if("xml"==b){var a=new ActiveXObject("Microsoft.XMLDOM");a.async=!1;a.loadXML(d.responseText);c=a}else c=d.responseText};d.send();return c};