var iOverviewMap=new OverviewMap();function OverviewMap(){var n=null;var A=2.5;var h=null;var r=null;var j=null;var i=null;var v=0;var w=0;var B=0;var F=0;var o=null;var u=null;var x=0;var y=0;var z=0;var C=5;var G=new VEMaps();iGlobalZoomListener.addListener(this);iGlobalPanListener.addListener(this);iGlobalSmallPanListener.addListener(this);iFirstTimeLoadListener.addListener(this);var p=0;var s=0;var g=1;var L=1000;var t=null;var H=false;this.onFirstTimeLoad=function(){setTimeout(R,1500)};function R(){p=Math.round(iWidth*iScheme.iSmallKoef);s=Math.round(iHeight*iScheme.iSmallKoef);var a=0;var b=iHeight-s-1-C;n=iDoc.createElement("div");n.style.position="absolute";n.style.left=a+"px";n.style.top=b+"px";n.style.width=(p+C)+"px";n.style.height=(s+C)+"px";n.style.overflow="hidden";n.style.backgroundColor="white";n.style.borderTop="1px solid darkgray";n.style.borderRight="1px solid darkgray";o=iDoc.createElement("div");o.style.position="absolute";o.style.left="0px";o.style.top=(C-1)+"px";o.style.width=(p)+"px";o.style.height=(s)+"px";o.style.overflow="hidden";o.style.borderTop="1px solid darkgray";o.style.borderRight="1px solid darkgray";n.appendChild(o);iGraphicsDiv.appendChild(n);S();var c=iDoc.createElement("img");c.style.width="14px";c.style.height="14px";c.style.position="absolute";c.style.left="0px";var d=iHeight-16;if(Browser.SVG){d+=2}c.style.top=d+"px";c.style.cursor="pointer";c.setAttribute("id","omStatus");c.onclick=M;iGraphicsDiv.appendChild(c);M()}function M(){var a="visible";var b="hidden";var c=iDoc.getElementById("omStatus");if(c){var d=c.getAttribute("vis_status");if(d===a){c.src=iPath+"img/oArr1.png";c.setAttribute("vis_status",b);n.style.visibility=b}else{c.src=iPath+"img/oArr0.png";c.setAttribute("vis_status",a);n.style.visibility=a}}}function S(){var a=p;var b=s;if(!Browser.SVG){h=iDrawingTools.createGroup(null,a,b,null,null,null,null)}else{b+=1;h=iDrawingTools.createElement("svg");h.setAttribute("width",a);h.setAttribute("height",b)}h.style.position="absolute";o.appendChild(h);G.setRootForMap(h);if(!Browser.SVG){r=iDrawingTools.createGroup(null,a,b,null,null,null,null)}else{r=iDrawingTools.createElement("svg");r.setAttribute("width",a);r.setAttribute("height",b)}r.style.position="absolute";o.appendChild(r);if(!Browser.SVG){j=iDrawingTools.createGroup(null,a,b,null,null,null,null)}else{j=iDrawingTools.createElement("svg");j.setAttribute("width",a);j.setAttribute("height",b)}j.style.position="absolute";o.appendChild(j);I()}this.setViewBox=function(){I()};function I(){var a=iVbX-(iVbWidth*A-iVbWidth)/2;var b=iVbY-(iVbHeight*A-iVbHeight)/2;var c=iVbWidth*A;var d=iVbHeight*A;g=c/p;v=a;w=b;B=c;F=d;z=B/(p);var e=Math.round(v/g);var f=Math.round(w/g);var l=p;var k=s;if(!Browser.SVG){h.setAttribute("coordorigin",e+","+f);h.setAttribute("coordsize",l+","+k)}else{h.setAttribute("viewBox",e+" "+f+" "+l+" "+k)}if(!Browser.SVG){r.setAttribute("coordorigin",e+","+f);r.setAttribute("coordsize",l+","+k)}else{r.setAttribute("viewBox",e+" "+f+" "+l+" "+k)}var m=null;var q=null;var D=null;var E=null;if(!Browser.SVG){q=j.getAttribute("coordorigin");if(q){m=[q.X,q.Y];D=(Number(m[0])-e)/5;E=(Number(m[1])-f)/5;J(D,E,e,f,Number(m[0]),Number(m[1]),1)}else{j.setAttribute("coordorigin",e+","+f);j.setAttribute("coordsize",l+","+k)}}else{q=j.getAttribute("viewBox");if(q){m=q.split(" ");if(m[0]){D=(Number(m[0])-e)/5;E=(Number(m[1])-f)/5;J(D,E,e,f,Number(m[0]),Number(m[1]),1)}}else{j.setAttribute("viewBox",e+" "+f+" "+l+" "+k)}}T()}function T(){if(!iMap.checkForVEMap()){var a="&";var b=v;var c=w;var d=B;var e=F;var f=iMap.getMapUrlBasis();f+=a+"width="+p+a+"height="+s;var l="BBOX="+Math.round(b)+","+Math.round((-1)*(c+e))+","+Math.round(b+d)+","+Math.round((-1)*c);f+=a+l+a+"SRS="+iMapCoord.getEPSG()+a+"elvis=is_alive";b=Math.round(b/g);c=Math.round(c/g);d=p;e=s;var k=null;if(!Browser.SVG){k=iDrawingTools.createImage(iPath+"img/trans.gif",b,c,d,e)}else{k=iDrawingTools.createImage(f,b,c,d,e)}if(k){h.appendChild(k)}if(!Browser.SVG){k.setAttribute("src",f)}}else{G.VEInit(p,s,v,-w,B,F);G.VEUpdateMap(iMap.getMapId(),g)}U()}function U(){iXmlTools.removeChilds(r);var b=1;var c=iDrawingTools.createRectangle(Math.round(iVbX/g),Math.round(iVbY/g),Math.round(iVbWidth/g),Math.round(iVbHeight/g),"#FFFFFF","#666666",b,0,null,null,null,"crispEdges");r.appendChild(c);if(!i){i=iDrawingTools.createRectangle(Math.round(iVbX/g),Math.round(iVbY/g),Math.round(iVbWidth/g),Math.round(iVbHeight/g),"#808080",iScheme.iOverWndRectColor,b,0.4,null,null,null,"crispEdges");if(Browser.type!==0||!Browser.SVG){i.style.cursor="url('"+iPath+"img/cursor.cur'), default"}if(Browser.vers===30){i.ontouchstart=function(a){a.preventDefault();V(a);return false};i.ontouchmove=function(a){a.preventDefault();W(a);return false};i.ontouchend=function(a){a.preventDefault();X(a);return false}}else{i.onmousedown=Y}j.appendChild(i)}}this.onZoom=function(){this.RemoveRectBox();if(h){var a=0;for(a=0;a1){h.removeChild(h.firstChild)}}else{var b=3;if(a>b){if(h.firstChild){h.removeChild(h.firstChild)}}}I()}}this.onSmallPan=function(){if(!Browser.SVG&&i){var a=i.style;a.left=Math.round(iVbX/g);a.top=Math.round(iVbY/g)}else if(i){i.setAttribute("x",Math.round(iVbX/g));i.setAttribute("y",Math.round(iVbY/g))}};function V(a){var b=a.touches.item(0);x=b.clientX;y=b.clientY;iPointData.hideIcons(true)}function W(a){var b=a.touches.item(0);var c=b.clientX;var d=b.clientY;P(c,d)}function X(a){K()}function Y(a){if(a){x=a.layerX;y=a.layerY}else{var b=Math.round((iVbX-v)/z);var c=Math.round((iVbY-w)/z);var d=window.event;x=d.offsetX+b;y=d.offsetY+c}iPointData.hideIcons(true);Z()}function Z(){u=iDrawingTools.createRectangle(Math.round(v/g),Math.round(w/g),p,s,"#FFFFFF","#FFFFFF",0,0,null,null,null,null);u.onmousemove=ba;u.onmouseup=bb;u.onmouseout=bc;if(Browser.type!==0||!Browser.SVG){u.style.cursor="url('"+iPath+"img/cursordown.cur'), default"}j.appendChild(u)}function bb(){Q();K()}function bc(){Q();K()}function Q(){u.parentNode.removeChild(u);u=null}function ba(a){var b=0;var c=0;if(a){b=a.layerX;c=a.layerY}else{var d=window.event;b=d.offsetX;c=d.offsetY}P(b,c)}function P(a,b){var c=0;var d=0;if(!Browser.SVG){var e=i.style.left;if(e.indexOf("p")!==-1){e=e.substring(0,e.length-2)}var f=i.style.top;if(f.indexOf("p")!==-1){f=f.substring(0,f.length-2)}c=Number(e);d=Number(f)}else{c=Number(i.getAttribute("x"));d=Number(i.getAttribute("y"))}var l=z*(a-x);x=a;var k=z*(b-y);y=b;if(!Browser.SVG){i.style.left=(c+Math.round(l/g))+"px";i.style.top=(d+Math.round(k/g))+"px"}else{i.setAttribute("x",(c+Math.round(l/g)));i.setAttribute("y",(d+Math.round(k/g)))}iBasic.setViewBox(iVbX+l,iVbY+k,iVbWidth,iVbHeight);iGlobalSmallPanListener.notifyListeners();iPointData.checkStayOnMoveAndRecalc()}function K(){H=true;iGlobalPanListener.notifyListeners()}function J(a,b,c,d,e,f,l,k){var m=p;var q=s;l++;if(l<6){if(Browser.SVG){j.setAttribute("viewBox",(e-a)+" "+(f-b)+" "+m+" "+q)}else{j.setAttribute("coordorigin",(e-a)+","+(f-b));j.setAttribute("coordsize",m+","+q)}setTimeout(function(){J(a,b,c,d,e-a,f-b,l)},100)}else{if(Browser.SVG){j.setAttribute("viewBox",c+" "+d+" "+m+" "+q)}else{j.setAttribute("coordorigin",c+","+d);j.setAttribute("coordsize",m+","+q)}}}this.RemoveRectBox=function(){if(j){iXmlTools.removeChilds(j)}i=null}}