AddressUtil.content='<div id="iw_wrapper">   <div class="iw_name">${address}</div>   <div class="iw_attribute">  ${lat} N, ${lng} E </div>   <div id="iw_tools_wrapper">       <div class="iw_tools">           ${route}       </div>       <div class="iw_tools">           ${zoom}       </div>   </div></div>';AddressUtil.prototype._text;AddressUtil.prototype._marker;AddressUtil.prototype._line;AddressUtil.prototype._map;AddressUtil.prototype._element;AddressUtil.prototype._currentValue;function AddressUtil(b,a){this._map=b;this._element=a;this._marker=new VMarker();this._marker.draggable(true);this._map.add(this._marker).add(this._line);VisicomFacade.addressUtil=this;return this}AddressUtil.CURRENT_ID;AddressUtil.prototype.search=function(text){var _this=this;search_not_found.style.display="none";if(text==""){search_info.style.display="inherit";this._element.innerHTML="";_resizeMapPanel();return}else{search_info.style.display="none"}_resizeMapPanel();text=Common.trim(text);text=text.replace(/ул\./gi,"ул. ");text=text.replace(/г\./g,"");if(this._text==text){return}this._text=text;LoadIndicator.show();AddressUtil.CURRENT_ID=Math.random();var getData=function(){var CURRENT_ID=AddressUtil.CURRENT_ID;call(VisicomFacade.mapsapi_url+"/"+_this._map.language()+"/address.json|search?q="+encodeURI(text),function callback(response){if(CURRENT_ID!=AddressUtil.CURRENT_ID){return}var object=eval("("+response+")");_this.results(object);LoadIndicator.hide()})};getData()};AddressUtil.prototype.results=function(g){g=g.adrs;var n=this;this._element.innerHTML="";if(g.length==0){search_not_found.style.display="inherit";return}search_not_found.style.display="none";var d=[];for(var m in g){var p=g[m];if(p.m_Name==undefined){continue}if(d[p.m_Country]==null){d[p.m_Country]=[]}d[p.m_Country].push(p)}var r=[];for(var f in d){if(f!="forEach"&&f!="indexOf"&&f!=""){r.push(f)}}r=r.sort().reverse();var c=0;for(var f in d){if(f!="forEach"&&f!="indexOf"&&f!=""){c++}}for(var k=0;k<r.length;k++){var s=r[k];for(var f in d){if(f!=s){continue}if(c>1){var b=document.createElement("div");b.innerHTML=f;b.className="country";this._element.appendChild(b)}for(var m in d[f]){var p=d[f][m];if(p.m_Name==undefined){continue}var a=document.createElement("a");a.href="#";a.innerHTML=p.m_Name+' <div class="desc">('+p.m_District+", "+p.m_Region+" обл.)</div>";this._element.appendChild(a);a.__id=p.id;a.__type=p.type;a.__info=p.m_Name;a.onclick=function(){n.showOnMap(this)};var b=document.createElement("div");b.className="str";var l=p.childs;for(var o in l){var e=l[o];if(e.m_Name==undefined){continue}var q=document.createElement("a");q.href="#";q.innerHTML=e.m_Name+((e.m_Zone!="")?" ("+e.m_Zone+")":"");b.appendChild(q);var h=document.createElement("div");h.id=Math.random();h.className="bld";b.appendChild(h);q.__id=e.id;q.__bld=h;q.__type=e.type;q.__info=p.m_Name+". "+e.m_Name;q.onclick=function(){n.showOnMap(this);n.loadBuildings(this)};this._element.appendChild(b);if(e.childs.length==0){continue}n._showBuilding(e.childs,h,q.__info)}}}}};AddressUtil.prototype.loadBuildings=function(href){var id=href.__id;var element=href.__bld;var _this=this;LoadIndicator.show();call(VisicomFacade.mapsapi_url+"/"+this._map.language()+"/address/"+id+".json|adr",function callback(response){var buildings=eval("("+response+")");buildings=buildings.docs;LoadIndicator.hide();if(buildings.length==0){return}_this._showBuilding(buildings,element,href.__info);element.__buildingLoaded=true})};AddressUtil.prototype._showBuilding=function(d,c,e){if(c.__buildingLoaded){return}var h=this;function g(j,i){var l=Number(j.m_Name.replace(/\D.*/,""));var k=Number(i.m_Name.replace(/\D.*/,""));return l-k}d.sort(g);for(var b in d){var f=d[b];if(f.m_Name==undefined){continue}var a=document.createElement("a");a.href="#";a.__id=f.id;a.__type=f.type;a.__info=e+", "+f.m_Name;a.innerHTML=f.m_Name+"\n";a.onclick=function(){h.showOnMap(this)};c.appendChild(a)}};AddressUtil.prototype.marker=function(coords,text){if(arguments.length==0){return this._marker}var map=this._map;map.remove(this._marker);if(coords==null){return this._marker}this._marker=new VMarker(coords);this._marker.draggable(true);var _this=this;var changeDescription=function(text){var geo=_this._marker.coords(0);var info=AddressUtil.content;var route=Locale.ROUTE[map.language()]+":  <a href='#' onclick='AddressUtil.START_ROUTE();'>"+Locale.ROUTE_FROM[map.language()]+"</a>, <a href='#' onclick='AddressUtil.FINISH_ROUTE();'>"+Locale.ROUTE_TO[map.language()]+"</a>";info=info.replace(/\$\{route\}/,route);info=info.replace(/\$\{zoom\}/,"<a href='#' onclick='if (VisicomFacade.map.zoom() < 17) VisicomFacade.map.center({ lng: "+geo.lng+", lat: "+geo.lat+" }, 17);'>"+Locale.ZOOM[map.language()]+"</a>");info=info.replace(/\$\{address\}/,text+"<br/>");info=info.replace(/\$\{lng}/,geo.lng.toPrecision(7));info=info.replace(/\$\{lat}/,geo.lat.toPrecision(7));var size=Common.getContentSizeForInfoWindow(info);_this._marker.info(info,{alwaysOpen:false,width:320,height:size.height});if(ErrorNotification.info!=null){map.remove(ErrorNotification.info)}};var requestDescription=function(){var coords=_this._marker.coords(0);call(VisicomFacade.site_url+"/utils/description/"+_this._map.language()+"/"+coords.lng+","+coords.lat,function callback(response){try{var data=eval("("+response+")")}catch(err){return}changeDescription(data.settlement+", "+data.description)})};if(text!=null){changeDescription(text)}else{requestDescription()}this._marker.enddrag(function(){VisicomFacade.urlUtil.saveState("address",_this.getState());requestDescription()});map.add(this._marker).repaint()};AddressUtil.prototype.showOnMap=function(href){var _this=this;var id=href.__id;var type=href.__type;call(VisicomFacade.mapsapi_url+"/"+this._map.language()+"/address/"+id,function callback(response){var coords=eval(response);var map=_this._map;map.remove(_this._line);var bounds=null;if(type=="street"||type=="address"){var line=new VMultiLine(coords);line.color("#ff0000");line.lineWidth(5);line.opacity(0.4);map.add(line);bounds=line.bounds();_this._line=line}else{bounds=new VRect(coords)}coords=bounds.center();_this.marker(coords,href.__info);var clientBounds=map.clientRect();var leftBottom={lng:clientBounds.leftBottom().lng+(clientBounds.rightTop().lng-clientBounds.leftBottom().lng)*0.1,lat:clientBounds.leftBottom().lat+(clientBounds.rightTop().lat-clientBounds.leftBottom().lat)*0.1};var rightTop={lng:clientBounds.rightTop().lng-(clientBounds.rightTop().lng-clientBounds.leftBottom().lng)*0.1,lat:clientBounds.rightTop().lat-(clientBounds.rightTop().lat-clientBounds.leftBottom().lat)*0.1};var min_bounds=new VRect([leftBottom,rightTop]);if((type=="street"||type=="address")&&map.zoom()>=13){if(!min_bounds.contains(bounds.center())){if(map.clientRect().contains(bounds.center())){map._smoothMove(bounds.center())}else{map.center(bounds.center())}}}else{if(map._getMinZoom(bounds)==map.zoom()&&map.clientRect().contains(bounds.center())){map._smoothMove(bounds.center())}else{map.center(bounds)}}VisicomFacade.urlUtil.saveState("address",_this.getState());VisicomFacade.urlUtil.saveState("map",map.getState())})};AddressUtil.START_ROUTE=function(){var b=VisicomFacade.addressUtil;var a=VisicomFacade.routeUtil;a.start(b._marker.coords());b._map.remove(b._marker);b._map.repaint()};AddressUtil.FINISH_ROUTE=function(){var b=VisicomFacade.addressUtil;var a=VisicomFacade.routeUtil;a.finish(b._marker.coords());b._map.remove(b._marker);b._map.repaint()};AddressUtil.prototype.getState=function(){var b="{";var d=null;if(this._marker!=null&&this._marker.visible()){var g=this._marker.coords(0);d="[ { lng: "+g.lng+", lat: "+g.lat+"} ]";b+="marker: "+d}if(this._line!=null){var f="";var c=this._line;var e=c.coords();var a=function(k){var h="[";for(var i=0;i<k.length;i++){g=k[i];if(i>0){h+=","}if(g.length!=null){h+=a(g)}else{h+="{ lng: "+g.lng+", lat: "+g.lat+"}"}}h+="]";return h};f+=a(e);if(d!=null){b+=", "}b+="lines: "+f}b+="}";return b};AddressUtil.prototype.setState=function(state){var object=eval("("+state+")");if(object==null){return}var map=this._map;if(map==null){return}map.remove(this._marker).remove(this._line);if(object.marker){this.marker(object.marker)}if(object.lines){this._line=[];this._line=new VMultiLine(object.lines);this._line.color("#FF0000");this._line.lineWidth(5);this._line.opacity(0.4);map.add(this._line)}map.repaint()};Object.size=function(c){var b=0,a;for(a in c){if(c.hasOwnProperty(a)){b++}}return b};function Common(){return this}Common.DELETE_IMAGE=(!USER_DATA.Browser.MSIE)?"<img src='"+VisicomCommons.API_URL+"/images/markers/close-hint.png' border='0'>":"<img style=\"filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"/images/markers/close-hint.png');\" src='"+VisicomCommons.API_URL+"/images/blank.gif' border='0'>";Common.getContentSizeForInfoWindow=function(d,c){var e=document.createElement("div");e.style.fontFamily="Arial,Helvetica,sans-serif";e.style.fontSize="11px";e.style.backgroundColor="white";e.style.zIndex="1000";e.style.position="absolute";e.style.left="0px";e.style.top="0px";e.style.visibility="hidden";var b=document.createElement("div");b.style.width=((c)?c:320)+"px";b.innerHTML=d;e.appendChild(b);document.body.appendChild(e);var a={width:b.scrollWidth,height:b.scrollHeight};document.body.removeChild(e);if(USER_DATA.Browser.MSIE){a.height+=7}else{if(USER_DATA.Browser.Gecko){a.height+=35}else{if(USER_DATA.Browser.Opera){a.height+=15}}}return a};Common.trim=function(a){return a.replace(/(^\s+)|(\s+$)/g,"")};Common.getWindowSize=function(){var b=0,a=0;if(typeof(window.innerWidth)=="number"){b=window.innerWidth;a=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){b=document.body.clientWidth;a=document.body.clientHeight}}}return{width:b,height:a}};if(!Array.prototype.push){Array.prototype.push=function(a){return this[this.length]=a}}Common.listeners=[];Common.addListener=function(a,b){if(!Common.listeners[a]){Common.listeners[a]=[]}Common.listeners[a].push(b)};Common.fireEvent=function(b){var a=Common.listeners[b];if(!a){return}a.forEach(function(c){c()})};Common.extendArray=function(a){if(a.__wasExtended){return}a.insertAt=function(c,b){if(b>-1&&b<=this.length){this.splice(b,0,c);return true}return false};a.insertAt=function(c,b){if(b>-1&&b<=this.length){this.splice(b,0,c);return true}return false};a.insertAfter=function(d,b){var c=this.indexOf(d);if(c==-1){return false}if(c==this.length-1){this.push(b);return true}else{return this.insertAt(b,c+1)}};a.remove=function(c){var b=this.indexOf(c);this.splice(b,1);return false};a.__wasExtended=true};Graphics.prototype._element;Graphics.prototype._graphics;function Graphics(b){this._element=b;this._graphics=[];Common.extendArray(this._graphics);if(USER_DATA.Browser.MSIE){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var c=document.createElement("style");var a=document.getElementsByTagName("head")[0];if(a==null){a=document.createElement("head");document.body.appendChild(a)}a.appendChild(c);document.styleSheets[0].addRule("v\\:polyline","behavior: url(#default#VML);");document.styleSheets[0].addRule("v\\:line","behavior: url(#default#VML);");document.styleSheets[0].addRule("v\\:stroke","behavior: url(#default#VML);");document.styleSheets[0].addRule("v\\:shape","behavior: url(#default#VML);");document.styleSheets[0].addRule("v\\:fill","behavior: url(#default#VML);");document.styleSheets[0].addRule("v\\:path","behavior: url(#default#VML);")}return this}Graphics.prototype._getBounds=function(e){var d={x:99999,y:99999};var b={x:-1,y:-1};for(var c=0;c<e.length;c++){var a=e[c];if(a.x<d.x){d.x=a.x}if(a.y<d.y){d.y=a.y}if(a.x>b.x){b.x=a.x}if(a.y>b.y){b.y=a.y}}return{min:d,max:b}};Graphics.prototype.drawLine=function(t,d){var g=this._getBounds(t);var a=(d.lineWidth)?d.lineWidth:1;var c=(d.opacity)?d.opacity:1;var s=(d.color)?d.color:"rgb(0, 0, 200)";var e=g.min.x-a;var o=g.min.y-a;var q=Math.abs(g.max.x-g.min.x)+2*a;var p=Math.abs(g.max.y-g.min.y)+2*a;var n=document.createElement("canvas");n.id=Math.random();n.style.position="absolute";n.style.left=e+"px";n.style.top=o+"px";n.width=q;n.height=p;n.style.border="none";n.style.zIndex="100";if(USER_DATA.Browser.MSIE){var m=document.createElement("v:polyline");m.style.position="absolute";m.style.antialias="true";var h=document.createElement("v:stroke");h.setAttribute("joinstyle","round");h.setAttribute("filltype","solid");m.appendChild(h);m.setAttribute("strokecolor",s);m.setAttribute("strokeweight",a+"px");m.setAttribute("filled","false");var j="";for(var u=0;u<t.length;u++){var r=t[u];var l=r.x-g.min.x+a;var k=r.y-g.min.y+a;j+=l+","+k+" "}if(t.length>0){r=t[0];var l=r.x-g.min.x+a;var k=r.y-g.min.y+a;j+=l+","+k+" "}m.setAttribute("points",j);m.setAttribute("opacity",1);n.appendChild(m)}else{var b;try{b=n.getContext("2d")}catch(f){}b.lineWidth=a;b.lineCap="round";b.lineJoin="round";b.strokeStyle=s;b.globalAlpha=c;b.beginPath();for(var u=0;u<t.length;u++){var r=t[u];var l=r.x-g.min.x+a;var k=r.y-g.min.y+a;if(u==0){b.moveTo(l,k)}else{b.lineTo(l,k)}}if(t.length>0){r=t[0];var l=r.x-g.min.x+a;var k=r.y-g.min.y+a;b.lineTo(l,k)}b.stroke()}this._graphics.push(n);this._element.appendChild(n);return n};Graphics.prototype.remove=function(a){try{this._element.removeChild(a)}catch(b){}};Graphics.prototype.clear=function(){var a=0;while(a<this._graphics.length){var b=this._graphics[a];this._element.removeChild(b);this._graphics.splice(a,1)}};DistanceUtil.prototype._map;DistanceUtil.prototype._layer;DistanceUtil.prototype._markers;DistanceUtil.prototype._labels;DistanceUtil.prototype._line;DistanceUtil.prototype._enabled;DistanceUtil.ICON=new VMarkerIcon(7,7,VisicomCommons.API_URL+"/images/markers/red-corner.png");function DistanceUtil(a){this._map=a;this._enabled=false;var b=this;this._map.mouseclick(function(e){if(!b._enabled){return}var c=new VMarker(e,DistanceUtil.ICON);c.__id=Math.random();c.dragging(function(){b._createLine();b._setLength();b._map.repaint()});c.draggable(true);c.pointer({x:3,y:4});b._layer.add(c);b._markers.push(c);var d=new VLabel(e);b._layer.add(d);d.move(5,-5);b._labels.push(d);b._createLine();b._setLength();b._map.repaint()});VisicomFacade.distanceUtil=this;return this}DistanceUtil.prototype._createLine=function(){for(var c=0;c<this._markers.length;c++){var a=this._markers[c];var b=this._labels[c];b.coords(a.coords())}this._line.coords(this._getCoords())};DistanceUtil.prototype._getCoords=function(){var c=[];for(var b=0;b<this._markers.length;b++){var a=this._markers[b];c.push(a.coords(0))}return c};DistanceUtil.prototype._setLength=function(){var e=[];var b=this._markers[0];var c=this._labels[0];c.html(Locale.START_POINT[this._map.language()]+" <a href='#' onclick='VisicomFacade.distanceUtil._removeMarker("+b.__id+");'>"+Common.DELETE_IMAGE+"</a>");e.push(b.coords(0));for(var d=1;d<this._markers.length;d++){b=this._markers[d];c=this._labels[d];e.push(b.coords(0));var a=this._formatDistance(VisicomCommons.GeoCalcLen(e));c.html(a+" <a href='#' onclick='VisicomFacade.distanceUtil._removeMarker("+b.__id+");'>"+Common.DELETE_IMAGE+"</a>")}return e};DistanceUtil.prototype._formatDistance=function(a){if(a>1000){a=a/1000;var b=(Math.round(a)+"").length+2;return a.toPrecision(b)+" "+Locale.KM[this._map.language()]}else{return Math.round(a)+" "+Locale.M[this._map.language()]}};DistanceUtil.prototype._removeMarker=function(b){for(var a=0;a<this._markers.length;a++){if(b!=this._markers[a].__id){continue}this._layer.remove(this._markers[a]);this._layer.remove(this._labels[a]);this._map.repaint();this._markers.splice(a,1);this._labels.splice(a,1);break}if(this._markers.length==0){this.toggle()}else{this._createLine();this._setLength()}this._map.repaint()};DistanceUtil.prototype.toggle=function(){this._enabled=!this._enabled;if(this._enabled){LocationUtil.disable();this._layer=new VLayer();this._line=new VLine();this._line.lineWidth(2);this._line.color("#ff0000");this._layer.add(this._line);this._markers=[];this._labels=[];this._map.add(this._layer)}else{LocationUtil.enable();this._map.remove(this._layer)}};ErrorNotification.content='<div id="iw_wrapper">   <div class="iw_name">${header}</div>   <div class="iw_attribute">${message}</div>   <textarea id="error_message" style="width: 300px; height: 90px;"></textarea>   <div class="iw_attribute">${from_email}</div>   <input id="from_email" type="text" style="width: 300px; height: 20px;" />   <input style="margin-top: 10px; width: 149px; height: 30px;" type="button" value="${send_button_value}" onclick="ErrorNotification.sendMessage();">   <input style="margin-top: 10px; width: 149px; height: 30px;" type="button" value="${close_button_value}" onclick="ErrorNotification.close();"></div>';ErrorNotification.marker;function ErrorNotification(){return this}ErrorNotification.open=function(){ErrorNotification.close();var e=VisicomFacade.map;ErrorNotification.marker=new VMarker(e.center(),new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/marker-error.png"));var a=ErrorNotification.marker;a.draggable(true);e.add(a);var c=ErrorNotification.content;c=c.replace(/\$\{header}/,Locale.ERROR_MESSAGE[e.language()]);c=c.replace(/\$\{message}/,Locale.ERROR_PROBLEM[e.language()]+":");c=c.replace(/\$\{from_email}/,Locale.ERROR_FROM[e.language()]+":");c=c.replace(/\$\{send_button_value}/,Locale.ERROR_SEND[e.language()]+":");c=c.replace(/\$\{close_button_value}/,Locale.ERROR_CLOSE[e.language()]+":");var b=Common.getContentSizeForInfoWindow(c);var d=new VInfoWindow(c,{alwaysOpen:true,width:320,height:b.height});a.info(d);e.repaint()};ErrorNotification.close=function(){var a=VisicomFacade.map;if(ErrorNotification.marker!=null){a.remove(ErrorNotification.marker)}menuWindow.close()};ErrorNotification.sendMessage=function(){var b=VisicomFacade.map;var a=ErrorNotification.marker.coords(0);a=a.lng.toPrecision(6)+":"+a.lat.toPrecision(6);var c="from_email="+encodeURI(document.getElementById("from_email").value)+"&";c+="error_message="+encodeURI(document.getElementById("error_message").value)+"&";c+="coords="+encodeURI(a)+"&";c+="link="+encodeURI(VisicomFacade.urlUtil.getLink());call(VisicomFacade.site_url+"/utils/error/",function(d){alert(d)},"POST",c);ErrorNotification.close();b.repaint()};IFrameUtil.prototype._enabled;IFrameUtil.prototype._map;IFrameUtil._info;IFrameUtil.prototype._element;IFrameUtil.prototype._graphics;IFrameUtil.prototype._markers;IFrameUtil.prototype._isMousedown;IFrameUtil.prototype._draggedObject;IFrameUtil.prototype._tool_tip;function IFrameUtil(a){this._map=a;var b=this;this._map.enddrag(function(){if(!b._enabled){return}b.changeSquare()});this._map.onzoomchange(function(){if(!b._enabled){return}b.changeSquare()});this._element=document.createElement("div");this._element.style.position="absolute";this._element.style.left="255px";this._element.style.top="255px";this._element.style.zIndex="402";VisicomUtils.addHandler(document,"mouseout",function(c){if(!c){c=window.event}if(!b._map._isMouseOnViewport(c.clientX,c.clientY)){b._draggedObject=null}});VisicomUtils.addHandler(document,"mousemove",function(f){if(b._draggedObject==null){return}if(!f){f=window.event}var c=b._draggedObject;b.showTooltip(c);var d=VisicomUtils.getBounds(b._element);if(c.__options.horizontal){c.style.left=(f.clientX-d.left-10)+"px"}if(c.__options.vertical){c.style.top=(f.clientY-d.top-10)+"px"}b.changeSquare(c);if(f.stopPropagation){f.stopPropagation()}else{f.cancelBubble=true}if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}});VisicomUtils.addHandler(document,"mouseup",function(c){b._draggedObject=null;b.hideTooltip()});this._graphics=new Graphics(this._element);this._isMousedown=false;this._draggedObject=null;IFrameUtil._info=new InfoWindow();this._enabled=false;VisicomFacade.iframeUtil=this;return this}IFrameUtil.TIMER_ID;IFrameUtil.ON_TIMER=function(){VisicomFacade.iframeUtil.changeSquare();IFrameUtil.TIMER_ID=setTimeout("IFrameUtil.ON_TIMER();",40)};IFrameUtil.prototype.changeSquare=function(h){if(!this._enabled){return}var j=this;var d=function(){var o=j._markers[0].offsetLeft+(j._markers[3].offsetLeft-j._markers[0].offsetLeft)/2;var i=j._markers[0].offsetTop+(j._markers[1].offsetTop-j._markers[0].offsetTop)/2;j._markers[4].style.left=o+"px";j._markers[4].style.top=j._markers[3].offsetTop+"px";j._markers[5].style.top=i+"px";j._markers[5].style.left=j._markers[0].offsetLeft+"px";j._markers[6].style.left=o+"px";j._markers[6].style.top=j._markers[1].offsetTop+"px";j._markers[7].style.top=i+"px";j._markers[7].style.left=j._markers[2].offsetLeft+"px"};if(h!=null){var k=this._markers.indexOf(h);switch(k){case 0:this._markers[1].style.left=h.offsetLeft+"px";this._markers[3].style.top=h.offsetTop+"px";break;case 1:this._markers[0].style.left=h.offsetLeft+"px";this._markers[2].style.top=h.offsetTop+"px";break;case 2:this._markers[1].style.top=h.offsetTop+"px";this._markers[3].style.left=h.offsetLeft+"px";break;case 3:this._markers[2].style.left=h.offsetLeft+"px";this._markers[0].style.top=h.offsetTop+"px";break;case 4:this._markers[0].style.top=h.offsetTop+"px";this._markers[3].style.top=h.offsetTop+"px";break;case 5:this._markers[0].style.left=h.offsetLeft+"px";this._markers[1].style.left=h.offsetLeft+"px";break;case 6:this._markers[1].style.top=h.offsetTop+"px";this._markers[2].style.top=h.offsetTop+"px";break;case 7:this._markers[2].style.left=h.offsetLeft+"px";this._markers[3].style.left=h.offsetLeft+"px";break}d();this._graphics.clear();var l=[];for(var g=0;g<4;g++){var h=this._markers[g];l.push({x:h.offsetLeft+3,y:h.offsetTop+3})}this._graphics.drawLine(l,{color:"red",lineWidth:1})}var c=VisicomUtils.getBounds(this._element);var e=Math.abs(this._markers[0].offsetLeft-this._markers[2].offsetLeft);var m=Math.abs(this._markers[0].offsetTop-this._markers[2].offsetTop);var b=this._map._getCoords(this._markers[0].offsetLeft+c.left+e/2,this._markers[0].offsetTop+c.top-m/2);var a=VisicomFacade.urlUtil.getIFrameLink(b,e,m);var f='<iframe src="'+a+'" width="'+e+'" height="'+m+'" scrolling="no" frameborder="0"></iframe>';var n=document.getElementById("iframe_link_text");if(n==null){return}if(n.value!=f){n.value=f;n.focus();n.select()}};IFrameUtil.prototype.enable=function(){this._enabled=true;this._element.style.width=(this._map.getDOMElement().offsetWidth-512)+"px";this._element.style.height=(this._map.getDOMElement().offsetHeight-512)+"px";this._map.getDOMElement().appendChild(this._element);var e=150;var b=this._element.offsetWidth;var a=this._element.offsetHeight;this._markers=[];this._markers.push(this.createMarker({left:e,top:a-e},{horizontal:true,vertical:true},"ne-resize"));this._markers.push(this.createMarker({left:e,top:e},{horizontal:true,vertical:true},"nw-resize"));this._markers.push(this.createMarker({left:b-e,top:e},{horizontal:true,vertical:true},"ne-resize"));this._markers.push(this.createMarker({left:b-e,top:a-e},{horizontal:true,vertical:true},"nw-resize"));var d=this._markers[0].offsetLeft+(this._markers[3].offsetLeft-this._markers[0].offsetLeft)/2;var c=this._markers[0].offsetTop+(this._markers[1].offsetTop-this._markers[0].offsetTop)/2;this._markers.push(this.createMarker({left:d,top:this._markers[0].offsetTop},{vertical:true},"n-resize"));this._markers.push(this.createMarker({left:this._markers[0].offsetLeft,top:c},{horizontal:true},"e-resize"));this._markers.push(this.createMarker({left:d,top:this._markers[1].offsetTop},{vertical:true},"n-resize"));this._markers.push(this.createMarker({left:this._markers[2].offsetLeft,top:c},{horizontal:true},"e-resize"));IFrameUtil._info.show({right:64,top:95,width:550,height:70},"<div style='font-size: 75%; vertical-align: bottom; margin-top: 5px;'>"+Locale.HTML_CODE[this._map.language()]+":    <input id='iframe_link_text' style='width: 400px;' type='text' value=''>    <input style='font-size: 10px; width: 70px; height: 22px;' type='button' onclick='VisicomFacade.iframeUtil.disable();' value='"+Locale.CLOSE[this._map.language()]+"'>    <div style='color: gray;'>"+Locale.HTML_CODE_MESSAGE[this._map.language()]+"<br/>    </div></div>");IFrameUtil.TIMER_ID=setTimeout("IFrameUtil.ON_TIMER();",40);this.changeSquare(this._markers[0]);LocationUtil.disable()};IFrameUtil.prototype.disable=function(){if(!this._enabled){return}clearTimeout(IFrameUtil.TIMER_ID);for(var b=0;b<this._markers.length;b++){var a=this._markers[b];this._element.removeChild(a)}this._map.getDOMElement().removeChild(this._element);IFrameUtil._info.close();LocationUtil.enable();this._enabled=false};IFrameUtil.prototype.createMarker=function(a,c,d){var b=document.createElement("img");b.src=VisicomFacade.mapsapi_url+"/images/markers/red-corner.png";b.style.cursor="pointer";b.style.position="absolute";b.style.zIndex="200";b.style.cursor=d;b.__options=c;if(a.left!=null){b.style.left=a.left+"px"}if(a.right!=null){b.style.right=a.right+"px"}if(a.top!=null){b.style.top=a.top+"px"}if(a.bottom!=null){b.style.bottom=a.bottom+"px"}this._element.appendChild(b);var e=this;b.onmousedown=function(f){if(!f){f=window.event}e._draggedObject=b;e.showTooltip(b);if(f.stopPropagation){f.stopPropagation()}else{f.cancelBubble=true}if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}};return b};IFrameUtil.prototype.showTooltip=function(b){if(this._tool_tip==null){this._tool_tip=document.createElement("div");this._tool_tip.style.position="absolute";this._tool_tip.style.zIndex=VisicomCommons.ZINDEX_LABEL;this._tool_tip.style.cursor="default";this._tool_tip.style.font="normal 11px Arial";this._tool_tip.style.color="#000000";this._tool_tip.style.padding="2px";this._tool_tip.style.border="1px solid gray";this._tool_tip.style.backgroundColor="#FFFFE1";this._element.appendChild(this._tool_tip)}var c=Math.abs(this._markers[0].offsetLeft-this._markers[2].offsetLeft);var a=Math.abs(this._markers[0].offsetTop-this._markers[2].offsetTop);this._tool_tip.style.left=(b.offsetLeft+b.offsetWidth)+"px";this._tool_tip.style.top=b.offsetTop+"px";this._tool_tip.innerHTML=c+" х "+a;this._tool_tip.style.display="block"};IFrameUtil.prototype.hideTooltip=function(){if(this._tool_tip==null){return}this._tool_tip.style.display="none"};ImageViewer.prototype._element;ImageViewer.prototype._image;ImageViewer.prototype._isMousedown;ImageViewer.prototype._mouseCoords;function ImageViewer(a,b){this._element=a;this._element.style.position="relative";this._element.style.overflow="hidden";this._element.style.zIndex="1";this._image=document.createElement("img");this._image.src=b;this._image.style.left="0px";this._image.style.top="0px";this._image.style.position="relative";this._image.style.zIndex="0";this._element.appendChild(this._image);var c=this;this._isMousedown=false;this._mouseCoords={};this._element.onmousedown=function(d){if(!d){d=window.event}c._isMousedown=true;c._mouseCoords.x=d.clientX;c._mouseCoords.y=d.clientY;if(d.stopPropagation){d.stopPropagation()}else{d.cancelBubble=true}if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}};this._element.onmousemove=function(d){if(!c._isMousedown){return}if(!d){d=window.event}c._image.style.left=c._image.offsetLeft+(d.clientX-c._mouseCoords.x)+"px";c._image.style.top=c._image.offsetTop+(d.clientY-c._mouseCoords.y)+"px";c._mouseCoords.x=d.clientX;c._mouseCoords.y=d.clientY;if(d.stopPropagation){d.stopPropagation()}else{d.cancelBubble=true}if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}};this._element.onmouseup=function(d){if(!d){d=window.event}c._isMousedown=false;if(d.stopPropagation){d.stopPropagation()}else{d.cancelBubble=true}if(d.preventDefault){d.preventDefault()}else{d.returnValue=false}};return this}InfoWindow.prototype._div=null;InfoWindow.prototype._element;function InfoWindow(a){this._element=a?a:document.body;InfoWindow.HEADER_IE='    <div style="position: absolute; left: 0px; top: 0px; width: 9px; height: 9px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/corner-left-top.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="9" /></div>    <div style="position: absolute; left: 9px; top: 0px; width: #width#px; height: 9px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/border-top.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="#width#" height="9" /></div>    <div style="position: absolute; left: #width+9#px; top: 0px; width: 9px; height: 9px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/corner-right-top.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="9" /></div>';InfoWindow.FORM_IE='<div>    #header#    <div style="position: absolute; left: 0px; top: 9px; width: 9px; height: #height#px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/border-left.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="#height#" /></div>    <div style="position: absolute; left: 9px; top: 9px; width: #width#px; height: #height#px; background-color: white;"><div style="padding: 3px;">#html#</div></div>    <div style="position: absolute; left: #width+9#px; top: 9px; width: 9px; height: #height#px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/border-right.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="#height#" /></div>    <div style="position: absolute; left: 0px; top: #height+9#px; width: 9px; height: 15px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/left-botoom.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="15" /></div>    <div style="position: absolute; left: 9px; top: #height+9#px; width: #width#px; height: 15px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/border-botoom.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="#width#" height="15" /></div>    <div style="position: absolute; left: #width+9#px; top: #height+9#px; width: 9px; height: 15px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomFacade.site_url+"/common/window-tool/corner-right-botoom.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="15" /></div></div>';InfoWindow.HEADER='    <div style="position: absolute; left: 0px; top: 0px; width: 9px; height: 9px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/corner-left-top.png" width="9" height="9" />    </div>    <div style="position: absolute; left: 9px; top: 0px; width: #width#px; height: 9px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/border-top.png" width="#width#" height="9" />    </div>    <div style="position: absolute; left: #width+9#px; top: 0px; width: 9px; height: 9px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/corner-right-top.png" width="9" height="9" />    </div>';InfoWindow.FORM='<div>    #header#    <div style="position: absolute; left: 0px; top: 9px; width: 9px; height: #height#px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/border-left.png" width="9" height="#height#" />    </div>    <div style="position: absolute; left: 9px; top: 9px; width: #width#px; height: #height#px; background-color: white;"><div style="padding: 3px;">#html#</div></div>    <div style="position: absolute; left: #width+9#px; top: 9px; width: 9px; height: #height#px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/border-right.png" width="9" height="#height#" />    </div>    <div style="position: absolute; left: 0px; top: #height+9#px; width: 9px; height: 15px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/corner-left-bottom.png" width="9" height="15" />    </div>    <div style="position: absolute; left: 9px; top: #height+9#px; width: #width#px; height: 15px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/border-bottom.png" width="#width#" height="15" />    </div>    <div style="position: absolute; left: #width+9#px; top: #height+9#px; width: 9px; height: 15px;">        <img src="'+VisicomFacade.site_url+'/common/window-tool/corner-right-bottom.png" width="9" height="15" />    </div></div>';return this}InfoWindow.prototype.show=function(c,b,e){if(this._div!=null){this.close()}this._div=document.createElement("div");if(c.left!=null){this._div.style.left=c.left+"px"}if(c.top!=null){this._div.style.top=c.top+"px"}if(c.right!=null){this._div.style.right=c.right+"px"}if(c.bottom!=null){this._div.style.bottom=c.bottom+"px"}this._div.style.width=c.width+"px";this._div.style.height=c.height+"px";this._div.style.position="absolute";this._div.style.zIndex="800";var d=(USER_DATA.Browser.MSIE_6)?InfoWindow.FORM_IE:InfoWindow.FORM;if(c.header!=null){d=d.replace(/\#header\#/g,(USER_DATA.Browser.MSIE_6)?InfoWindow.HEADER_IE:InfoWindow.HEADER_IE)}else{d=d.replace(/\#header\#/g,"")}d=d.replace(/\#html\#/,b);d=d.replace(/\#width\#/g,c.width);d=d.replace(/\#width\+9\#/g,c.width+9);d=d.replace(/\#height\#/g,c.height);d=d.replace(/\#height\+9\#/g,c.height+9);this._div.innerHTML=d;if(c.close!=null){var a=document.createElement("img");a.style.height="15px";a.style.width="15px";if(USER_DATA.Browser.MSIE){a.style.height="1px";a.style.width="1px";a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"images/info/close.png')"}else{a.style.height="15px";a.style.width="15px";a.src=VisicomCommons.API_URL+"images/info/close.png"}a.style.position="absolute";a.style.right="0px";a.style.top="0px";a.style.zIndex=VisicomCommons.ZINDEX_INFOWINDOW;a.style.cursor="pointer";var f=this;a.onmouseover=function(){if(USER_DATA.Browser.MSIE){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"images/info/close_hover.png')"}else{a.src=VisicomCommons.API_URL+"images/info/close_hover.png"}};a.onmouseout=function(){if(USER_DATA.Browser.MSIE){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"images/info/close.png')"}else{a.src=VisicomCommons.API_URL+"images/info/close.png"}};a.onclick=function(){e();if(USER_DATA.Browser.MSIE){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"images/info/close.png')"}else{a.src=VisicomCommons.API_URL+"images/info/close.png"}};this._div.appendChild(a)}this._element.appendChild(this._div)};InfoWindow.prototype.close=function(){if(this._div==null){return}try{this._element.removeChild(this._div)}catch(a){}this._div=null};function LoadIndicator(){return this}LoadIndicator.show=function(){load_indicator.style.display="block"};LoadIndicator.hide=function(){document.getElementById("load_indicator").style.display="none"};Locale.PHONES=[];Locale.PHONES.ru="тел.:";Locale.PHONES.ua="тел.:";Locale.PHONES.en="phones:";Locale.SEARCH=[];Locale.SEARCH.ru="Поиск";Locale.SEARCH.ru="Пошук";Locale.SEARCH.ru="Search";Locale.ZOOM=[];Locale.ZOOM.ru="Приблизить";Locale.ZOOM.ua="Наблизити";Locale.ZOOM.en="Zoom in";Locale.TRACK_IMPORT=[];Locale.TRACK_IMPORT.ru="Импорт данных";Locale.TRACK_IMPORT.ua="Імпорт даних";Locale.TRACK_IMPORT.en="Data import";Locale.RUBRIKS=[];Locale.RUBRIKS.ru="Рубрики";Locale.RUBRIKS.ua="Рубрики";Locale.RUBRIKS.en="Topics";Locale.LINK_CODE_MESSAGE=[];Locale.LINK_CODE_MESSAGE.ru="В ссылке передается точка и проложенный маршрут.";Locale.LINK_CODE_MESSAGE.ua="У посиланні передається точка і прокладений маршрут.";Locale.LINK_CODE_MESSAGE.en="A point and laid route is passed in reference.";Locale.HTML_CODE_MESSAGE=[];Locale.HTML_CODE_MESSAGE.ru="Для установки карты на ваш сайт, выделите область на экране, используя красные маркеры. Затем скопируйте данный HTML-код и вставьте на вашу страницу.";Locale.HTML_CODE_MESSAGE.ua="Для встановлення карти на ваш сайт, виділіть область на екрані, використовуючи червоні маркери. Потім скопіюйте цей HTML-код і вставте на вашу сторінку.";Locale.HTML_CODE_MESSAGE.en="To install the maps on your website, select the area on the screen using the red markers. Then copy this HTML-code and paste it on your webpage.";Locale.HTML_CODE=[];Locale.HTML_CODE.ru="HTML-код";Locale.HTML_CODE.ua="HTML-код";Locale.HTML_CODE.en="HTML";Locale.HTML_CODE_INSERT_MAP=[];Locale.HTML_CODE_INSERT_MAP.ru="HTML-код";Locale.HTML_CODE_INSERT_MAP.ua="HTML-код";Locale.HTML_CODE_INSERT_MAP.en="HTML";Locale.DISTANCE_TOOL=[];Locale.DISTANCE_TOOL.ru="Измерение расстояний";Locale.DISTANCE_TOOL.ua="Вимірювання відстаней";Locale.DISTANCE_TOOL.en="Measuring of distances";Locale.ERROR_NOTIFY=[];Locale.ERROR_NOTIFY.ru="Сообщить об ошибке";Locale.ERROR_NOTIFY.ua="Повідомити про помилку";Locale.ERROR_NOTIFY.en="Noify about error";Locale.ERROR_MESSAGE=[];Locale.ERROR_MESSAGE.ru="Сообщение об ошибке";Locale.ERROR_MESSAGE.ua="Повідомлення про помилку";Locale.ERROR_MESSAGE.en="The message about error";Locale.ERROR_MESSAGE_DESCRIPTION=[];Locale.ERROR_MESSAGE_DESCRIPTION.ru="Перетяните маркер в место на карте, где находится ошибка.  По клику откроется окно, где можно оставить описание.";Locale.ERROR_MESSAGE_DESCRIPTION.ua="Перетягніть маркер в місце на карті, де знаходиться помилка.  По кліку відкриється вікно, де можна залишити опис.";Locale.ERROR_MESSAGE_DESCRIPTION.en="Drag a marker in the place on a map, where an error is. For a clique a window will be opened, where it is possible to leave description.";Locale.ERROR_PROBLEM=[];Locale.ERROR_PROBLEM.ru="Опишите проблему в данной точке";Locale.ERROR_PROBLEM.ua="Опишіть проблему в даній точці";Locale.ERROR_PROBLEM.en="Describe a problem in this point";Locale.ERROR_FROM=[];Locale.ERROR_FROM.ru="От кого (email)";Locale.ERROR_FROM.ua="Від кого (email)";Locale.ERROR_FROM.en="From (email)";Locale.ERROR_SEND=[];Locale.ERROR_SEND.ru="Отправить";Locale.ERROR_SEND.ua="Відправити";Locale.ERROR_SEND.en="Send";Locale.ERROR_CLOSE=[];Locale.ERROR_CLOSE.ru="Отмена";Locale.ERROR_CLOSE.ua="Відміна";Locale.ERROR_CLOSE.en="Close";Locale.CLOSE=[];Locale.CLOSE.ru="Закрыть";Locale.CLOSE.ua="Закрити";Locale.CLOSE.en="Close";Locale.WAIT=[];Locale.WAIT.ru="Идет загрузка...";Locale.WAIT.ua="Йде завантаження...";Locale.WAIT.en="Loading...";Locale.ROUTE_NOT_FOUND=[];Locale.ROUTE_NOT_FOUND.ru="Не удалось расчитать маршрут между данными точками.";Locale.ROUTE_NOT_FOUND.ua="";Locale.ROUTE_NOT_FOUND.en="";Locale.FULL_DISTANCE=[];Locale.FULL_DISTANCE.ru="Длина маршрута";Locale.FULL_DISTANCE.ua="Довжина маршруту";Locale.FULL_DISTANCE.en="Total mileage";Locale.START_POINT=[];Locale.START_POINT.ru="Старт";Locale.START_POINT.ua="Старт";Locale.START_POINT.en="Start";Locale.ADD_POINT=[];Locale.ADD_POINT.ru="добавить точку";Locale.ADD_POINT.ua="додати точку";Locale.ADD_POINT.en="add point";Locale.DEL_POINT=[];Locale.DEL_POINT.ru="удалить";Locale.DEL_POINT.ua="видалити";Locale.DEL_POINT.en="remove";Locale.ADD_START=[];Locale.ADD_START.ru="добавить старт";Locale.ADD_START.ua="додати старт";Locale.ADD_START.en="add start";Locale.ADD_FINISH=[];Locale.ADD_FINISH.ru="добавить финиш";Locale.ADD_FINISH.ua="додати фініш";Locale.ADD_FINISH.en="add start";Locale.ROUTE=[];Locale.ROUTE.ru="Маршрут";Locale.ROUTE.ua="Маршрут";Locale.ROUTE.en="Route";Locale.ROUTE_CREATE=[];Locale.ROUTE_CREATE.ru="Построить маршрут";Locale.ROUTE_CREATE.ua="Побудувати маршрут";Locale.ROUTE_CREATE.en="To build a route";Locale.ROUTE_REMOVE=[];Locale.ROUTE_REMOVE.ru="Удалить маршрут";Locale.ROUTE_REMOVE.ua="Видалити маршрут";Locale.ROUTE_REMOVE.en="Remove route";Locale.ROUTE_REVERSE=[];Locale.ROUTE_REVERSE.ru="Ехать обратно";Locale.ROUTE_REVERSE.ua="Їхати назад";Locale.ROUTE_REVERSE.en="To go back";Locale.ROUTE_FROM=[];Locale.ROUTE_FROM.ru="отсюда";Locale.ROUTE_FROM.ua="звідси";Locale.ROUTE_FROM.en="from";Locale.ROUTE_TO=[];Locale.ROUTE_TO.ru="сюда";Locale.ROUTE_TO.ua="сюди";Locale.ROUTE_TO.en="to";Locale.START=[];Locale.START.ru="Старт";Locale.START.ua="Старт";Locale.START.en="Start";Locale.FINISH=[];Locale.FINISH.ru="Финиш";Locale.FINISH.ua="Фініш";Locale.FINISH.en="Finish";Locale.KM=[];Locale.KM.ru="км.";Locale.KM.ua="км.";Locale.KM.en="km.";Locale.M=[];Locale.M.ru="м.";Locale.M.ua="м.";Locale.M.en="m.";Locale.NOT_FOUND=[];Locale.NOT_FOUND.ru="Нет результатов.";Locale.NOT_FOUND.ua="Немає результатів.";Locale.NOT_FOUND.en="No results.";Locale.NOT_FOUND_IN_MBR=[];Locale.NOT_FOUND_IN_MBR.ru="Не найдено в выбранной области. Измените, пожалуйста, масштаб.";Locale.NOT_FOUND_IN_MBR.ua="Не знайдено у вибраному фрагменті. Змініть, будь ласка, масштаб.";Locale.NOT_FOUND_IN_MBR.en="It is not found at a current area. Change a scale.";function Locale(){return this}LocationUtil._map;LocationUtil._label;LocationUtil._info;LocationUtil._enable=true;LocationUtil._address;LocationUtil._content='<div id="iw_wrapper">   <div class="iw_name">${address}</div>   <div class="iw_attribute">  ${lat} N, ${lng} E </div>   <div id="iw_tools_wrapper">       <div class="iw_tools">           ${route}       </div>       <div class="iw_tools">           ${zoom}       </div>   </div></div>';function LocationUtil(map){LocationUtil._map=map;map.mouseclick(function(coords){if(!LocationUtil._enable){return}if(LocationUtil._label!=null){map.remove(LocationUtil._label)}LocationUtil.current_id=Math.random();var getDescription=function(){var current_id=LocationUtil.current_id;call(VisicomFacade.site_url+"/utils/description/"+map.language()+"/"+coords.lng+","+coords.lat,function callback(response){if(current_id!=LocationUtil.current_id){return}try{var data=eval("("+response+")")}catch(err){return}var str="<b>"+data.settlement+"</b>, "+data.description;if(str.length>30){str=str.substr(0,29)+"..."}LocationUtil._address="<b>"+data.settlement+"</b>,<br/>"+data.description;LocationUtil._label=new VLabel(coords,"<a href='#' onclick='LocationUtil.detail();'>"+str+"</a>");map.add(LocationUtil._label);map.repaint()})};getDescription()});map.beforezoomchange(function(){LocationUtil.close()});map.startdrag(function(){LocationUtil.close()});return this}LocationUtil.enable=function(){LocationUtil._enable=true};LocationUtil.disable=function(){LocationUtil.close();LocationUtil._enable=false};LocationUtil.close=function(){if(LocationUtil._label!=null){LocationUtil._map.remove(LocationUtil._label)}if(LocationUtil._info!=null){LocationUtil._map.remove(LocationUtil._info)}LocationUtil._info=null};LocationUtil.detail=function(){var e=LocationUtil._map;e.remove(LocationUtil._label);if(LocationUtil._info!=null){e.remove(LocationUtil._info)}var d=LocationUtil._label.coords(0);var g="{ lng: "+d.lng+", lat: "+d.lat+" }";var f=LocationUtil._content;var a=Locale.ROUTE[e.language()]+":  <a href='#' onclick='LocationUtil.START_ROUTE();'>"+Locale.ROUTE_FROM[e.language()]+"</a>, <a href='#' onclick='LocationUtil.FINISH_ROUTE();'>"+Locale.ROUTE_TO[e.language()]+"</a>";f=f.replace(/\$\{route\}/,a);f=f.replace(/\$\{lng}/,d.lng.toPrecision(7));f=f.replace(/\$\{lat}/,d.lat.toPrecision(7));f=f.replace(/\$\{address}/,LocationUtil._address);f=f.replace(/\$\{zoom\}/,"<a href='#' onclick='if (VisicomFacade.map.zoom() < 17) VisicomFacade.map.center("+g+", 17);'>"+Locale.ZOOM[e.language()]+"</a>");var b=Common.getContentSizeForInfoWindow(f);var c=VisicomFacade.iframeUtil;c.changeSquare();LocationUtil._info=new VInfoWindow(d,f,{alwaysOpen:false,width:320,height:b.height});e.add(LocationUtil._info);LocationUtil._info._smoothOpen();e.repaint()};LocationUtil.START_ROUTE=function(){var a=LocationUtil._map;var b=VisicomFacade.routeUtil;LocationUtil._map.remove(LocationUtil._info);b.start(LocationUtil._label.coords());a.remove(LocationUtil._label);VisicomFacade.addressUtil.marker(null);a.repaint()};LocationUtil.FINISH_ROUTE=function(){var a=LocationUtil._map;var b=VisicomFacade.routeUtil;LocationUtil._map.remove(LocationUtil._info);b.finish(LocationUtil._label.coords());a.remove(LocationUtil._label);VisicomFacade.addressUtil.marker(null);a.repaint()};PoiSearchUtil.prototype._marker;PoiSearchUtil.prototype._line;PoiSearchUtil.prototype._map;PoiSearchUtil.prototype._element;PoiSearchUtil.prototype._currentValue;PoiSearchUtil.prototype._currentHref;PoiSearchUtil.prototype._markers;PoiSearchUtil.prototype.text;PoiSearchUtil.prototype.start=1;PoiSearchUtil.prototype.pageSize=50;PoiSearchUtil.prototype.currentPage;PoiSearchUtil.prototype.total;PoiSearchUtil.MAX_VISIBLE=50;PoiSearchUtil.ICON;PoiSearchUtil.content='<div id="iw_wrapper">    <div class="iw_name">${name}</div>    <div class="iw_rubric">(${rubriks})</div>    <div class="iw_attribute">${address}       ${phones}       <!-- <a href="#" onclick="">www.dveri.com.ua</a> -->    </div>    <div id="iw_tools_wrapper">       <div class="iw_tools">           ${route}       </div>       <div class="iw_tools">           <a href="#" onclick="">${zoom}</a>       </div>    </div></div>';function PoiSearchUtil(b,a){PoiSearchUtil.ICON=new VMarkerIcon(30,31,VisicomFacade.mapsapi_url+"/images/markers/marker-info.png");this._map=b;this._element=a;this._markers=[];return this}PoiSearchUtil.prototype.back=function(){if(this.currentPage==0){return}this.search(this.text,this.currentPage--)};PoiSearchUtil.prototype.next=function(){this.search(this.text,this.currentPage++)};PoiSearchUtil.prototype.search=function(text,page){if(text==""){this._element.innerHTML="";this.clearAllMarkers();return}this.text=text;if(page==null){this.currentPage=0}this.start=this.currentPage*this.pageSize;var _this=this;LoadIndicator.show();call(VisicomFacade.mapsapi_url+"/"+this._map.language()+"/poi.json|search?q="+encodeURI(text)+"&mbr="+this.getTileString()+"&page="+this.start+";"+this.pageSize,function callback(response){var object=eval("("+response+")");_this.results(object)})};PoiSearchUtil.prototype.setPager=function(){var a=VisicomFacade.poiControls;if(this.total<this.pageSize){a.pager.style.display="none";return}else{a.pager.style.display="block"}if(this.pageSize>this.total){a.pagerNext.style.visibility="hidden"}else{a.pagerNext.style.visibility="visible"}if(this.currentPage==0){a.pagerBack.style.visibility="hidden"}else{a.pagerBack.style.visibility="visible"}};PoiSearchUtil.prototype.results=function(object){var _this=this;this._element.innerHTML="";this.total=object.pois.totalNumber;if(this.total==0){call(VisicomFacade.mapsapi_url+"/"+this._map.language()+"/poi.json|search?q="+encodeURI(this.text),function callback(response){var object=eval("("+response+")");if(_this.total==0){_this._element.innerHTML=Locale.NOT_FOUND[_this._map.language()]}else{_this._element.innerHTML=Locale.NOT_FOUND_IN_MBR[_this._map.language()]}LoadIndicator.hide()});this.total=0;this.clearAllMarkers();return}LoadIndicator.hide();scroll(0,0);var main=document.createElement("ul");this.setPager();var layers=object.pois.tree;for(var layer in layers){var pois=layers[layer];var li=document.createElement("li");li.style.marginTop="5px";li.innerHTML='<div class="poi_rubric">'+PoiTileLoader.NAMES_MAP[layer]+"</div>";var ul=document.createElement("ul");for(var i in pois){var poi=pois[i];if(poi.name==undefined){continue}var _li=document.createElement("li");_li.style.marginLeft="10px";var href=document.createElement("a");href.innerHTML=poi.name;href.__id=poi.id;href.__hint=poi.name;href.__coords=poi.geocoords;_li.appendChild(href);var div=document.createElement("div");div.className="desc";var phones="";if(poi.phones){for(var i=0;i<poi.phones.length;i++){if(poi.phones[i]&&poi.phones[i].length>1){poi.phones[i]="+380 "+poi.phones[i]}}phones=poi.phones.join("<br/>")}div.innerHTML="("+poi.address+")"+((phones!="")?"<br/>"+phones:"");_li.appendChild(div);href.href="#";href.__id=poi.id;href.__hint=poi.name;href.__coords=poi.geocoords;for(var i in poi.rubrics){poi.rubrics[i]=PoiTileLoader.NAMES_MAP[poi.rubrics[i]]}var rubriksStr=poi.rubrics.join(", ");href.__info=PoiSearchUtil.content;href.__info=href.__info.replace(/\$\{name\}/,poi.name);href.__info=href.__info.replace(/\$\{rubriks\}/,Locale.RUBRIKS[this._map.language()]+": "+rubriksStr);poi.geocoords=poi.geocoords.replace(/"/g,"");var route=Locale.ROUTE[this._map.language()]+":  <a href='#' onclick='VisicomFacade.routeUtil.start(eval(\""+poi.geocoords+"\")[0]);'>"+Locale.ROUTE_FROM[this._map.language()]+"</a>, <a href='#' onclick='VisicomFacade.routeUtil.finish(eval(\""+poi.geocoords+"\")[0]);'>"+Locale.ROUTE_TO[this._map.language()]+"</a>";href.__info=href.__info.replace(/\$\{route\}/,route);href.__info=href.__info.replace(/\$\{zoom\}/,"<a href='#' onclick='VisicomFacade.map.center(eval(\""+poi.geocoords+"\")[0], 17);'>"+Locale.ZOOM[this._map.language()]+"</a>");href.__info=href.__info.replace(/\$\{address\}/,poi.address+"<br/>");if(phones!=""){href.__info=href.__info.replace(/\$\{phones\}/,phones+"<br/>")}else{href.__info=href.__info.replace(/\$\{phones\}/,"")}poi.__info=href.__info;href.onclick=function(){_this.showOnMap(this)};ul.appendChild(_li)}li.appendChild(ul);main.appendChild(li)}this._element.appendChild(main);if(PoiSearchUtil._timer!=null){clearTimeout(PoiSearchUtil._timer)}PoiSearchUtil._this=this;PoiSearchUtil._layers=layers;PoiSearchUtil._timer=setTimeout("PoiSearchUtil.preShowMarkers();",500);_resizeMapPanel()};PoiSearchUtil._this;PoiSearchUtil._layers;PoiSearchUtil._timer;PoiSearchUtil.prototype.clearAllMarkers=function(){for(var b in this._markers){var a=this._markers[b];this._map.remove(a)}this._markers=[]};PoiSearchUtil.preShowMarkers=function(){var _this=PoiSearchUtil._this;var markers=[];var layers=PoiSearchUtil._layers;for(var layer in layers){var pois=layers[layer];for(var i in pois){var poi=pois[i];if(poi.name==undefined){continue}var coords=eval(poi.geocoords);var index=""+coords[0].lng+coords[0].lat;var marker=_this._markers[index];if(marker==null){marker=new VMarker(coords,PoiSearchUtil.ICON);if(poi._icon!=null){marker.pointer({x:12,y:12})}else{marker.pointer({x:15,y:31})}marker.hint(poi.name);var size=Common.getContentSizeForInfoWindow(poi.__info);marker.info(poi.__info,{alwaysOpen:false,width:320,height:size.height})}markers[index]=marker}}for(var i in _this._markers){var marker=markers[i];if(marker!=null){continue}_this._map.remove(_this._markers[i])}var center=_this._map.center();function sortCoords(coords1,coords2){var len1=_this.distance(coords1,center);var len2=_this.distance(coords2,center);return len1-len2}markers.sort(sortCoords);var count=0;for(var i in markers){var marker=_this._markers[i];if(marker!=null){continue}marker=markers[i];_this._map.add(marker);if(count++>PoiSearchUtil.MAX_VISIBLE){break}}_this._markers=markers;_this._map.repaint()};PoiSearchUtil.prototype.distance=function(a,b){return Math.sqrt(Math.pow(a.lng-b.lng,2)+Math.pow(a.lat-b.lat,2))};PoiSearchUtil.prototype.showOnMap=function(href){var map=this._map;if(this._currentHref==href){map.center(this._marker.coords());this._marker.info().visible(true);map.repaint();return}var coords=eval(href.__coords);if(this._marker!=null){map.remove(this._marker)}this._marker=new VMarker();this._marker.draggable(true);var bounds=new VRect(coords);this._marker.coords(bounds.center());this._marker.icon(PoiSearchUtil.ICON);this._marker.hint(href.__hint);var size=Common.getContentSizeForInfoWindow(href.__info);this._marker.info(href.__info,{alwaysOpen:false,width:320,height:size.height});this._marker.info().visible(true);map.add(this._marker);var clientBounds=map.clientRect();if(clientBounds.contains(coords[0])){map._clearSmoothTimer();map.repaint();this._marker.info()._smoothOpen()}else{map.center(coords[0]);map.repaint()}this._currentHref=href};PoiSearchUtil.prototype.getTileString=function(){var a=this._map.clientRect();var g=a.rightTop().lng-a.leftBottom().lng;var e=a.rightTop().lat-a.leftBottom().lat;var c=0.1;a=new VRect({lng:a.leftBottom().lng+g*c,lat:a.leftBottom().lat+e*c},{lng:a.rightTop().lng-g*c,lat:a.rightTop().lat-e*c});var k=this._map.zoom();var b=this._map._currentMap;var j=this._map._convertToScreenCoords(a.leftBottom());var f=Math.floor((Math.abs(j.x))/VMapTile.TILE_WIDTH);var d=Math.floor((b._height-j.y)/VMapTile.TILE_HEIGHT);j=this._map._convertToScreenCoords(a.rightTop());var i=Math.floor((Math.abs(j.x))/VMapTile.TILE_WIDTH);var h=Math.floor((b._height-j.y)/VMapTile.TILE_HEIGHT);return k+"/"+f+"/"+d+";"+k+"/"+i+"/"+h};PoiTileLoader.LAYERS=[];PoiTileLoader.LAYERS.ru=[{name:"Достопримечательности",icon:"/common/icons/poi/sights.png",childs:[{name:"Церкви, соборы, монастыри",id:"4103"},{name:"Музеи, галереи",id:"1409"},{name:"Памятники монументального искусства",id:"6401"},{name:"Памятники архитектуры и градостроения",id:"6402"},{name:"Памятники исторические",id:"6403"},{name:"Памятники археологические",id:"6404"}]},{name:"Кафе-рестораны",icon:"/common/icons/poi/nutrition.png",childs:[{name:"Кафе, бары",id:"1101"},{name:"Пиццерии",id:"1105"},{name:"Рестораны",id:"1106"},{name:"Фаст-фуды",id:"1107"}]},{name:"Развлечения",icon:"/common/icons/poi/entertainments.png",childs:[{name:"Выставочные центры",icon:"/common/icons/poi/exh_center.png",id:"1336"},{name:"Театры",icon:"/common/icons/poi/theatr.png",id:"1413"},{name:"Зоопарки",icon:"/common/icons/poi/zoo.png",id:"3904"},{name:"Кинотеатры",icon:"/common/icons/poi/cinema.png",id:"3905"},{name:"Аквапарки",icon:"/common/icons/poi/water_park.png",id:"3912"},{name:"Цирки",icon:"/common/icons/poi/theater_circus.png",id:"3913"},{name:"Развлекательные комплексы",id:"3925"},{name:"Ночные клубы",id:"3927"},{name:"Ипподромы",icon:"/common/icons/poi/hippodrome.png",id:"3928"},{name:"Боулинг",icon:"/common/icons/poi/bowling_billiard.png",id:"4521"},{name:"Бильярд",icon:"/common/icons/poi/bowling_billiard.png",id:"4522"}]},{name:"Финансы",icon:"/common/icons/poi/finances.png",childs:[{name:"Банки",id:"0302"},{name:"Банкоматы",icon:"/common/icons/poi/cash_dispense.png",id:"0314"}]},{name:"Гостиницы",icon:"/common/icons/poi/hotels.png",childs:[{name:"Гостиницы и мотели",id:"6303"},{name:"Дома отдыха",id:"6301"},{name:"Санатории, пансионаты",id:"1814"},]},{name:"Медицина",icon:"/common/icons/poi/medicine.png",childs:[{name:"Больницы, госпитали",id:"1802"},{name:"Медцентры, диагностика",id:"1806"},{name:"Поликлиники",id:"1812"},{name:"Родильные дома",id:"1813"},{name:"Аптеки",id:"1818"},{name:"Скорая помощь",id:"1819"},{name:"Ветеринария",id:"1821"}]},{name:"Автоуслуги",icon:"/common/icons/poi/autoservices.png",childs:[{name:"Автосалоны",id:"0102"},{name:"Автопрокат",id:"0104"},{name:"Шиномонтаж",id:"0105"},{name:"СТО",id:"0106"},{name:"АЗС",icon:"/common/icons/poi/gas_station.png",id:"0108"},{name:"Автомойки",id:"0114"},{name:"Автопилот",id:"0115"},{name:"АЗС газовые",icon:"/common/icons/poi/gas_station.png",id:"0116"},{name:"Автоэвакуаторы",id:"0117"}]},{name:"Спорт",icon:"/common/icons/poi/sport.png",childs:[{name:"Бассейны",icon:"/common/icons/poi/swimming.png",id:"4503"},{name:"Спортивные сооружения",id:"4510"},{name:"Теннис",icon:"/common/icons/poi/tennis.png",id:"4511"},{name:"Фитнесс, спортивные залы",id:"4513"},{name:"Гольф-клубы",id:"4523"},{name:"Яхтинг, парусный спорт",icon:"/common/icons/poi/yachting.png",id:"6104"},{name:"Дельта-парапланеризм",icon:"/common/icons/poi/parachuting.png",id:"6105"},{name:"Авто-мотоспорт",icon:"/common/icons/poi/motosport.png",id:"6106"},{name:"Прыжки с парашютом",icon:"/common/icons/poi/parachuting.png",id:"6107"}]},{name:"Торговля",icon:"/common/icons/poi/trade.png",childs:[{name:"Торговые центры",id:"1618"},{name:"Магазины разные",id:"1620,1642,1601,1701"},{name:"Рынки",id:"1629"},{name:"Супермаркеты",id:"1631"}]},{name:"Туризм и отдых",icon:"/common/icons/poi/tourism.png",childs:[{name:"Туристические информационные центры",id:"6003"},{name:"Кемпинги",id:"6302"},{name:"Туристические, спортивные базы",id:"6304"},{name:"Дендропарки",id:"3923"},{name:"Ботанические сады",id:"3901"}]},{name:"Вокзалы",icon:"/common/icons/poi/transport.png",childs:[{name:"Аэропорты",icon:"/common/icons/poi/air_transport.png",id:"0006"},{name:"Автовокзалы",id:"0007"},{name:"Железнодорожные вокзалы",icon:"/common/icons/poi/railway_transport.png",id:"0008"},{name:"Речные вокзалы",icon:"/common/icons/poi/river_transport.png",id:"0009"},{name:"Порты",icon:"/common/icons/poi/sea_transport.png",id:"0010"}]},{name:"Услуги",icon:"/common/icons/poi/services.png",childs:[{name:"Нотариальные услуги",id:"1309"},{name:"Экспресс-почта",id:"1314"},{name:"Сауны",id:"1319"},{name:"Салоны красоты",id:"1323"},{name:"Почтовые отделения",id:"1333"},{name:"Туалеты",id:"1335"},{name:"Спасательные службы",id:"5907"}]},{name:"Учереждения",icon:"/common/icons/poi/institutions.png",childs:[{name:"ГАИ, МРЭО",id:"3101"},{name:"Госадминистрации",id:"3103"},{name:"ЗАГСы",id:"3104"},{name:"Отделения милиции",id:"3106"},{name:"Прокуратуры",id:"3107"},{name:"Суды",id:"3109"},{name:"Таможенные пропускные пункты",id:"3115"},{name:"Посольства",id:"3502"}]}];PoiTileLoader.LAYERS.ua=[{name:"Пам'ятки",icon:"/common/icons/poi/sights.png",childs:[{name:"Церкви, собори, монастирі",id:"4103"},{name:"Музеї, галереї",id:"1409"},{name:"Пам'ятники монументального мистецтва",id:"6401"},{name:"Пам'ятники архітектури та містобудування",id:"6402"},{name:"Пам'ятники історичні",id:"6403"},{name:"Пам'ятники археологічні",id:"6404"}]},{name:"Кафе та ресторани",icon:"/common/icons/poi/nutrition.png",childs:[{name:"Кафе, бари",id:"1101"},{name:"Піцерії",id:"1105"},{name:"Ресторани",id:"1106"},{name:"Фаст-фуди",id:"1107"}]},{name:"Розваги",icon:"/common/icons/poi/entertainments.png",childs:[{name:"Виставкові центри",icon:"/common/icons/poi/exh_center.png",id:"1336"},{name:"Театри",icon:"/common/icons/poi/theatr.png",id:"1413"},{name:"Зоопарки",icon:"/common/icons/poi/zoo.png",id:"3904"},{name:"Кінотеатри",icon:"/common/icons/poi/cinema.png",id:"3905"},{name:"Аквапарки",icon:"/common/icons/poi/water_park.png",id:"3912"},{name:"Цирки",icon:"/common/icons/poi/theater_circus.png",id:"3913"},{name:"Розважальні комплекси",id:"3925"},{name:"Нічні клуби",id:"3927"},{name:"Іподроми",icon:"/common/icons/poi/hippodrome.png",id:"3928"},{name:"Боулінг",icon:"/common/icons/poi/bowling_billiard.png",id:"4521"},{name:"Більярд",icon:"/common/icons/poi/bowling_billiard.png",id:"4522"}]},{name:"Фінанси",icon:"/common/icons/poi/finances.png",childs:[{name:"Банки",id:"0302"},{name:"Банкомати",icon:"/common/icons/poi/cash_dispense.png",id:"0314"}]},{name:"Готелі",icon:"/common/icons/poi/hotels.png",childs:[{name:"Готелі та мотелі",id:"6303"},{name:"Будинки відпочинку",id:"6301"},{name:"Санаторії, пансіонати",id:"1814"},]},{name:"Медицина",icon:"/common/icons/poi/medicine.png",childs:[{name:"Лікарні, шпиталі",id:"1802"},{name:"Медцентри, діагностика",id:"1806"},{name:"Поліклініки",id:"1812"},{name:"Пологові будинки",id:"1813"},{name:"Аптеки",id:"1818"},{name:"Швидка допомога",id:"1819"},{name:"Ветеринарія",id:"1821"}]},{name:"Автопослуги",icon:"/common/icons/poi/autoservices.png",childs:[{name:"Автосалони",id:"0102"},{name:"Автопрокат",id:"0104"},{name:"Шиномонтаж",id:"0105"},{name:"СТО",id:"0106"},{name:"АЗС",icon:"/common/icons/poi/gas_station.png",id:"0108"},{name:"Автомийки",id:"0114"},{name:"Автопілот",id:"0115"},{name:"АЗС газові",icon:"/common/icons/poi/gas_station.png",id:"0116"},{name:"Автоевакуатори",id:"0117"}]},{name:"Спорт",icon:"/common/icons/poi/sport.png",childs:[{name:"Басейни",icon:"/common/icons/poi/swimming.png",id:"4503"},{name:"Спортивні споруди",id:"4510"},{name:"Теніс",icon:"/common/icons/poi/tennis.png",id:"4511"},{name:"Фітнес, спортивні зали",id:"4513"},{name:"Гольф-клуби",id:"4523"},{name:"Яхтінг, парусний спорт",icon:"/common/icons/poi/yachting.png",id:"6104"},{name:"Дельта-парапланеризм",icon:"/common/icons/poi/parachuting.png",id:"6105"},{name:"Авто-мотоспорт",icon:"/common/icons/poi/motosport.png",id:"6106"},{name:"Стрибки з парашутом",icon:"/common/icons/poi/parachuting.png",id:"6107"}]},{name:"Торгівля",icon:"/common/icons/poi/trade.png",childs:[{name:"Торгові центри",id:"1618"},{name:"Магазини різні",id:"1620,1642,1601,1701"},{name:"Ринки",id:"1629"},{name:"Супермаркети",id:"1631"}]},{name:"Туризм та відпочинок",icon:"/common/icons/poi/tourism.png",childs:[{name:"Туристичні інформаційні центри",id:"6003"},{name:"Кемпінги",id:"6302"},{name:"Туристичні, спортивні бази",id:"6304"},{name:"Дендропарки",id:"3923"},{name:"Ботанічні сади",id:"3901"}]},{name:"Вокзали",icon:"/common/icons/poi/transport.png",childs:[{name:"Аеропорти",icon:"/common/icons/poi/air_transport.png",id:"0006"},{name:"Автовокзали",id:"0007"},{name:"Залізничні вокзали",icon:"/common/icons/poi/railway_transport.png",id:"0008"},{name:"Річкові вокзали",icon:"/common/icons/poi/river_transport.png",id:"0009"},{name:"Порти",icon:"/common/icons/poi/sea_transport.png",id:"0010"}]},{name:"Послуги",icon:"/common/icons/poi/services.png",childs:[{name:"Нотаріальні послуги",id:"1309"},{name:"Експрес-пошта",id:"1314"},{name:"Сауни",id:"1319"},{name:"Салони краси",id:"1323"},{name:"Поштові відділення",id:"1333"},{name:"Туалети",id:"1335"},{name:"Рятувальні служби",id:"5907"}]},{name:"Установи",icon:"/common/icons/poi/institutions.png",childs:[{name:"ДАІ, МРЕВ",id:"3101"},{name:"Держадміністрації",id:"3103"},{name:"РАГСи",id:"3104"},{name:"Відділення міліції",id:"3106"},{name:"Прокуратури",id:"3107"},{name:"Суди",id:"3109"},{name:"Пункти митного контролю",id:"3115"},{name:"Посольства",id:"3502"}]}];PoiTileLoader.LAYERS.en=[{name:"Attractions",icon:"/common/icons/poi/sights.png",childs:[{name:"Churches, cathedrals, monasteries",id:"4103"},{name:"Museums, galleries",id:"1409"},{name:"Statues",id:"6401"},{name:"Monuments of architecture and town-planning",id:"6402"},{name:"Historical monuments",id:"6403"},{name:"Archeological monuments",id:"6404"}]},{name:"Cafe-Restaurants",icon:"/common/icons/poi/nutrition.png",childs:[{name:"Cafe, bars",id:"1101"},{name:"Pizzerias",id:"1105"},{name:"Restaurants",id:"1106"},{name:"Fast foods",id:"1107"}]},{name:"Entertainment",icon:"/common/icons/poi/entertainments.png",childs:[{name:"Exhibition centers",icon:"/common/icons/poi/exh_center.png",id:"1336"},{name:"Theaters",icon:"/common/icons/poi/theatr.png",id:"1413"},{name:"Zoo",icon:"/common/icons/poi/zoo.png",id:"3904"},{name:"Cinemas",icon:"/common/icons/poi/cinema.png",id:"3905"},{name:"Aquaparks",icon:"/common/icons/poi/water_park.png",id:"3912"},{name:"Circus",icon:"/common/icons/poi/theater_circus.png",id:"3913"},{name:"Entertaining complexes",id:"3925"},{name:"Night clubs",id:"3927"},{name:"Race courses",icon:"/common/icons/poi/hippodrome.png",id:"3928"},{name:"Bowling",icon:"/common/icons/poi/bowling_billiard.png",id:"4521"},{name:"Billiards",icon:"/common/icons/poi/bowling_billiard.png",id:"4522"}]},{name:"Finance",icon:"/common/icons/poi/finances.png",childs:[{name:"Banks",id:"0302"},{name:"ATMs",icon:"/common/icons/poi/cash_dispense.png",id:"0314"}]},{name:"Lodging",icon:"/common/icons/poi/hotels.png",childs:[{name:"Hotels and motels",id:"6303"},{name:"Resting houses",id:"6301"},{name:"Sanatoriums, boarding-houses",id:"1814"},]},{name:"Medicine",icon:"/common/icons/poi/medicine.png",childs:[{name:"Hospitals",id:"1802"},{name:"Medical centres, diagnostics",id:"1806"},{name:"Polyclinics",id:"1812"},{name:"Maternity hospitals",id:"1813"},{name:"Pharmacies",id:"1818"},{name:"Emergency",id:"1819"},{name:"Veterinary medicine",id:"1821"}]},{name:"Car services",icon:"/common/icons/poi/autoservices.png",childs:[{name:"Automobile sales centres",id:"0102"},{name:"Car rentals",id:"0104"},{name:"Tire fitting",id:"0105"},{name:"Service stations",id:"0106"},{name:"Filling stations",icon:"/common/icons/poi/gas_station.png",id:"0108"},{name:"Car washes",id:"0114"},{name:"Autopilot services",id:"0115"},{name:"Filling stations (gas)",icon:"/common/icons/poi/gas_station.png",id:"0116"},{name:"Car evacuation services",id:"0117"}]},{name:"Sports",icon:"/common/icons/poi/sport.png",childs:[{name:"Swimming pools",icon:"/common/icons/poi/swimming.png",id:"4503"},{name:"Sport",id:"4510"},{name:"Tennis",icon:"/common/icons/poi/tennis.png",id:"4511"},{name:"Fitness, sporting halls",id:"4513"},{name:"Golf-clubs",id:"4523"},{name:"Yachting, Sailing",icon:"/common/icons/poi/yachting.png",id:"6104"},{name:"Hang gliding",icon:"/common/icons/poi/parachuting.png",id:"6105"},{name:"Motosport",icon:"/common/icons/poi/motosport.png",id:"6106"},{name:"Skydiving",icon:"/common/icons/poi/parachuting.png",id:"6107"}]},{name:"Trade",icon:"/common/icons/poi/trade.png",childs:[{name:"Trade center services",id:"1618"},{name:"Schops (other)",id:"1620,1642,1601,1701"},{name:"Markets",id:"1629"},{name:"Super markets",id:"1631"}]},{name:"Tourism and Recreation",icon:"/common/icons/poi/tourism.png",childs:[{name:"Tourist information centers",id:"6003"},{name:"Campings",id:"6302"},{name:"Tourist and sport bases",id:"6304"},{name:"Dendroparks",id:"3923"},{name:"Botanic gardens",id:"3901"}]},{name:"Transport Terminals",icon:"/common/icons/poi/transport.png",childs:[{name:"Airports",icon:"/common/icons/poi/air_transport.png",id:"0006"},{name:"Bus stations",id:"0007"},{name:"Railway terminals",icon:"/common/icons/poi/railway_transport.png",id:"0008"},{name:"River stations",icon:"/common/icons/poi/river_transport.png",id:"0009"},{name:"Ports",icon:"/common/icons/poi/sea_transport.png",id:"0010"}]},{name:"Services",icon:"/common/icons/poi/services.png",childs:[{name:"Notaries public",id:"1309"},{name:"Express mail",id:"1314"},{name:"Saunas",id:"1319"},{name:"Beauty shops",id:"1323"},{name:"Post offices",id:"1333"},{name:"Toilets",id:"1335"},{name:"Rescue services",id:"5907"}]},{name:"Agencies",icon:"/common/icons/poi/institutions.png",childs:[{name:"Traffic police",id:"3101"},{name:"State administrations",id:"3103"},{name:"Civil registry offices",id:"3104"},{name:"Police departments",id:"3106"},{name:"Прокуратуры",id:"3107"},{name:"Courts",id:"3109"},{name:"Customs",id:"3115"},{name:"Embassies",id:"3502"}]}];PoiTileLoader.NAMES_MAP=[];PoiTileLoader.prototype._map;PoiTileLoader.prototype._customTileLayer;PoiTileLoader.prototype._visible;PoiTileLoader._MARKER;PoiTileLoader._INFO_WINDOW;PoiTileLoader._selectedLayers=[];PoiTileLoader._stringLayers="";function PoiTileLoader(a){this._map=a;this._visible=true;this._customTileLayer=new VCustomTileLayer();this._customTileLayer.getTileURL=this.getTileURL;var c=this;var b=this._customTileLayer;b.getTile=function(f,e){var d=c.getTileURL(f,e);if(b._tiles[f]==null){b._tiles[f]=[]}var g=b._tiles[f][e];if(g==null){if(d==null){return null}g=b._tiles[f][e]=new PoiCustomTile(b._parent_map,f,e,d)}else{if(d==null){g.hide();return null}if(g._url!=d){var h=(g.isVisible)?g.isVisible():false;if(h){g._url=d;g._changeSrc()}else{b._tiles[f][e]=g=new PoiCustomTile(b._parent_map,f,e,d)}}}return g};this._map.add(this._customTileLayer);VisicomFacade.poiTileLoader=this;return this}PoiTileLoader.prototype.getTileURL=function(b,a){if(PoiTileLoader._stringLayers==""){return null}return VisicomFacade.site_url+"/utils/poitile/"+this._map.language()+"/"+this._map.zoom()+"/"+b+"/"+a+"/"+PoiTileLoader._stringLayers+".png"};PoiTileLoader.prototype.createTree=function(element){var _this=this;call(VisicomFacade.mapsapi_url+this._map.language()+"/rubric.json",function(data){data=eval("("+data+")");data=data.q.result;for(var i in data){var rubric=data[i];PoiTileLoader.NAMES_MAP[rubric.entity_id]=rubric.singlename}_this._showTree(element)})};PoiTileLoader.prototype._showTree=function(g){var m=this;var c=document.createElement("ul");var f=PoiTileLoader.LAYERS[this._map.language()];for(var h=0;h<f.length;h++){var l=f[h];if(l.name==null){continue}var q=document.createElement("li");var p=document.createElement("a");p.href="#";p.layer=h;p._li=q;p.onclick=function(a){m.enable(this.layer);m._map.repaint()};p.innerHTML=l.name;q.appendChild(p);l._li=q;var o=new VMarkerIcon(24,24,VisicomFacade.site_url+l.icon);var n=document.createElement("ul");var b=function(r,j){var i=r.name.toLowerCase();var s=j.name.toLowerCase();return((i<s)?-1:((i>s)?1:0))};l.childs.sort(b);for(var d in l.childs){var e=l.childs[d];e.name=PoiTileLoader.NAMES_MAP[e.id];if(e.name==null){continue}var k=document.createElement("li");p=document.createElement("a");p.href="#";p.layer=h;p.sub_layer=d;p._li=k;p.onclick=function(a){m.enable(this.layer,this.sub_layer);m._map.repaint()};p.innerHTML=e.name;k.appendChild(p);n.appendChild(k);e._li=k}q.appendChild(n);c.appendChild(q)}g.appendChild(c)};PoiTileLoader.prototype.enable=function(a,f){var e=PoiTileLoader.LAYERS[this._map.language()][a];if(arguments.length==1){var b=false;for(var d=0;d<e.childs.length;d++){var g=e.childs[d];if(g.enable){continue}b=true;break}for(d=0;d<e.childs.length;d++){g=e.childs[d];if(g.name==null){continue}g.enable=b;var c=PoiTileLoader._selectedLayers.indexOf(g.id);if(g.enable){g._li.className="selected";if(c<0){PoiTileLoader._selectedLayers.push(g.id)}}else{g._li.className="";if(c>=0){PoiTileLoader._selectedLayers.splice(c,1)}}}}else{g=e.childs[f];g.enable=!g.enable;if(g.enable){g._li.className="selected";PoiTileLoader._selectedLayers.push(g.id)}else{g._li.className="";c=PoiTileLoader._selectedLayers.indexOf(g.id);PoiTileLoader._selectedLayers.splice(c,1)}}PoiTileLoader._stringLayers=PoiTileLoader._selectedLayers.join();this._map.remove(PoiTileLoader._MARKER)};PoiTileLoader.prototype.getState=function(){var a="{";a+='selectedLayers: "'+PoiTileLoader._stringLayers+'"';a+="}";return a};PoiTileLoader.prototype.setState=function(state){var object=eval("("+state+")");PoiTileLoader._stringLayers=object.selectedLayers};PoiCustomTile.prototype=new VCustomTile();function PoiCustomTile(d,c,b,a){this._parent_map=d;this._i=c;this._j=b;this._url=a;this._left=this._i*VMapTile.TILE_WIDTH;this._top=(this._parent_map._currentMap._height-VMapTile.TILE_HEIGHT)-this._j*VMapTile.TILE_HEIGHT;this._visible=false;return this}PoiCustomTile.prototype.show=function(){if(this._tile==null){this._tile=document.createElement("img");this._tile.id="custom_tile_"+this._i+"_"+this._j;this._tile.style.left="0px";this._tile.style.top="0px";this._tile.style.width=VMapTile.TILE_WIDTH;this._tile.style.height=VMapTile.TILE_HEIGHT;this._tile.style.position="absolute";this._tile.style.background="none";this._tile.style.border="0px";this._tile.style.display="none";this._tile.style.zIndex="401";if(USER_DATA.Browser.MSIE_6){this._tile.src=VisicomCommons.API_URL+"/images/blank.gif";this._tile.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._url+"')"}else{this._tile.src=this._url}var _this=this;this._tile.__imageLoadded=false;this._tile.__dataLoadded=false;var imageLoaded=function(tile){tile.__imageLoadded=true;if(tile.__dataLoadded){_this._showTile(tile)}};if(this._tile.complete&&!USER_DATA.Browser.MSIE){imageLoaded(this._tile)}this._tile.onload=function(){imageLoaded(this)};call(VisicomFacade.site_url+"/utils/poitile/"+this._parent_map.language()+"/"+this._parent_map.zoom()+"/"+this._i+"/"+this._j+"/"+PoiTileLoader._stringLayers+".json",function callback(data){try{var _data=eval(data)}catch(ex){return}var tile=_this._tile;tile.__data=_data;tile.__dataLoadded=true;if(USER_DATA.Browser.MSIE||USER_DATA.Browser.Opera||tile.__imageLoadded){_this._showTile(tile)}})}this._parent_map.getDOMElement().appendChild(this._tile);this._visible=true};PoiCustomTile.prototype._changeSrc=function(){var _this=this;if(USER_DATA.Browser.MSIE_6){this._tile.src=VisicomCommons.API_URL+"/images/blank.gif";this._tile.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._url+"')"}else{this._tile.src=this._url}call(VisicomFacade.site_url+"/utils/poitile/"+this._parent_map.language()+"/"+this._parent_map.zoom()+"/"+this._i+"/"+this._j+"/"+PoiTileLoader._stringLayers+".json",function callback(data){try{var _data=eval(data)}catch(ex){return}var tile=_this._tile;tile.__data=_data;tile.__dataLoadded=true;if(USER_DATA.Browser.MSIE||tile.__imageLoadded){_this._showTile(tile,null)}})};PoiCustomTile.prototype._showTile=function(f){var d=f.__data;if(d==null){return}var g=document.createElement("map");var b="map_"+Math.random();g.setAttribute("id",b);g.setAttribute("name",b);for(var c=d.length-1;c>=0;c--){var a=d[c];var e=document.createElement("area");e.shape="poly";e.coords=a.coords;e.href="#";e.__geo=a.geo;e.__id=a.id;e.__icon=a.icon;e.__name=a.name;e.__address=a.address;e.__phones=a.phones;var h=this;e.onmouseover=function(n){if(PoiTileLoader._MARKER!=null){h._parent_map.remove(PoiTileLoader._MARKER)}var l;if(this.__icon){l=new VMarkerIcon(24,24,this.__icon)}else{l=VisicomFacade.static_url+"/rubric/"+this.__id+".png"}PoiTileLoader._MARKER=new VMarker(this.__geo,l);var i=PoiTileLoader._MARKER;i.pointer({x:12,y:12});i.hint(this.__name);i.__header=PoiTileLoader.NAMES_MAP[this.__id];var m=h._parent_map;var k=null;if(this.__phones){k=this.__phones.replace(/\$/g,", ")}i.__info=PoiSearchUtil.content;i.__info=i.__info.replace(/\$\{name\}/,this.__name);i.__info=i.__info.replace(/\$\{rubriks\}/,Locale.RUBRIKS[m.language()]+": "+PoiTileLoader.NAMES_MAP[this.__id]);var j=Locale.ROUTE[m.language()]+":  <a href='#' onclick='VisicomFacade.routeUtil.start({ lng: "+this.__geo[0].lng+", lat: "+this.__geo[0].lat+" });'>"+Locale.ROUTE_FROM[m.language()]+"</a>, <a href='#' onclick='VisicomFacade.routeUtil.finish({ lng: "+this.__geo[0].lng+", lat: "+this.__geo[0].lat+" });'>"+Locale.ROUTE_TO[m.language()]+"</a>";i.__info=i.__info.replace(/\$\{route\}/,j);i.__info=i.__info.replace(/\$\{zoom\}/,"<a href='#' onclick='VisicomFacade.map.center( { lng: "+this.__geo[0].lng+", lat: "+this.__geo[0].lat+" }, 17);'>"+Locale.ZOOM[m.language()]+"</a>");i.__info=i.__info.replace(/\$\{address\}/,this.__address);if(k){i.__info=i.__info.replace(/\$\{phones\}/,"<br/>"+k)}else{i.__info=i.__info.replace(/\$\{phones\}/,"")}this.marker=i;this.marker.mouseclick(function(){var r=PoiTileLoader._INFO_WINDOW;var o=PoiTileLoader._MARKER;var q=h._parent_map;if(r!=null){q.remove(r)}var p=Common.getContentSizeForInfoWindow(o.__info);r=new VInfoWindow(o.coords(),o.__info,{alwaysOpen:false,width:320,height:p.height});r.__marker=o;q.add(r);q.repaint();r._smoothOpen();PoiTileLoader._INFO_WINDOW=r});h._parent_map.add(PoiTileLoader._MARKER);h._parent_map.repaint()};g.appendChild(e)}f.style.display="block";if(USER_DATA.Browser.MSIE){f.setAttribute("usemap","#"+b,0);f.__map=g;document.body.appendChild(g)}else{f.useMap="#"+b;f.appendChild(g)}this.repaint()};PoiCustomTile.prototype.hide=function(){if(this._tile==null){return}try{this._parent_map.getDOMElement().removeChild(this._tile)}catch(a){}this._visible=false};RouteUtil.MAX_POINTS=4;RouteUtil.ICONS;RouteUtil.MAX_POINTS;RouteUtil.prototype._element;RouteUtil.prototype._distance_element;RouteUtil.prototype._cams_element;RouteUtil.prototype._map;RouteUtil.prototype._layer;RouteUtil.prototype._accuracy;RouteUtil.prototype._points;RouteUtil.prototype._visible;RouteUtil.prototype._cams;function RouteUtil(b,a){RouteUtil.ICONS=[];RouteUtil.ICONS.push(new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/route/RS.png"));RouteUtil.ICONS.push(new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/route/R1.png"));RouteUtil.ICONS.push(new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/route/R2.png"));RouteUtil.ICONS.push(new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/route/R3.png"));RouteUtil.ICONS.push(new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/route/R4.png"));RouteUtil.ICONS.push(new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/route/R5.png"));RouteUtil.ICONS.push(new VMarkerIcon(30,28,VisicomFacade.site_url+"/common/icons/route/RF.png"));RouteUtil.MAX_POINTS=RouteUtil.ICONS.length;this._map=b;this._element=a;this._routes=[];this._points=[];Common.extendArray(this._points);this._layer=new VLayer();this._map.add(this._layer);this._distance_element=document.createElement("div");this._distance_element.className="search_info";this._distance_element.style.marginTop="12px";this._distance_element.innerHTML="";this._cams_element=document.createElement("div");this._cams_element.className="route_cams";this._cams_element.innerHTML="";a.appendChild(this._cams_element);var c=this;this._map.onzoomchange(function(){if(!c._visible){return}var h=c.getAccuracy(c._map.zoom());var e=c._accuracy;if(e==h){return}var g=c._points;if(g.length<2){return}var j=[];j.push(g[0]);for(var f=1;f<g.length;f++){var d=g[f];if(d.showRoute(h)){if(j.length>1){c.repaint(j)}j=[]}j.push(d)}if(j.length==1){return}c.repaint(j)});this._counter=0;VisicomFacade.routeUtil=this;return this}RouteUtil.prototype.getCamViews=function(c){if(!this._cams){return null}for(var a in this._cams){var b=this._cams[a];if(b.id!=c){continue}return b.views}return null};RouteUtil.prototype.createStart=function(){var c=this._map.clientRect();var a=c.rightTop().lng-c.leftBottom().lng;var b=c.leftBottom().lat+(c.rightTop().lat-c.leftBottom().lat)/2;var d={lng:c.leftBottom().lng+a*0.3,lat:b};return d};RouteUtil.prototype.createFinish=function(){var d=this._map.clientRect();var a=d.rightTop().lng-d.leftBottom().lng;var c=d.leftBottom().lat+(d.rightTop().lat-d.leftBottom().lat)/2;var b={lng:d.rightTop().lng-a*0.3,lat:c};return b};RouteUtil.prototype.init=function(){var b=this.createStart();var a=this.createFinish();this._points.push(new RoutePoint(this,b,RouteUtil.ICONS[0]));this._points.push(new RoutePoint(this,a,RouteUtil.ICONS[RouteUtil.ICONS.length-1]));this._distance_element.style.display="block";this._resetControls();this.repaint(this._points)};RouteUtil.prototype.reverse=function(){this.removeAllRoutes();this._points.reverse();this._resetControls();this.repaint();return this};RouteUtil.prototype._removeControls=function(){for(var b in this._points){var a=this._points[b];try{this._element.removeChild(a.element().getDOMElement())}catch(c){}}};RouteUtil.prototype._resetControls=function(){var d=this._points.length;for(var c=0;c<d;c++){var a=this._points[c];if(d>=RouteUtil.MAX_POINTS){a.element()._hrefAdd.style.visibility="hidden"}else{a.element()._hrefAdd.style.visibility="visible"}a.element()._hrefRemove.style.visibility="visible";this._element.appendChild(a.element().getDOMElement());var b=(c<d-1||d==1)?c:RouteUtil.MAX_POINTS-1;a.element().icon(RouteUtil.ICONS[b].source());a._marker.icon(RouteUtil.ICONS[b])}this._element.appendChild(this._distance_element);this._element.appendChild(this._cams_element)};RouteUtil.prototype.getAccuracy=function(a){if(a>=0&&a<7){return 20000}else{if(a>=7&&a<9){return 3000}else{if(a==9){return 3000}else{if(a>=10&&a<=11){return 500}else{if(a>=12&&a<15){return 100}else{return 0}}}}}};RouteUtil.prototype.removeAllRoutes=function(){var c=this._points.length;for(var b=1;b<c;b++){var a=this._points[b];a._routes=[];a._version=Math.random();a.removeRoute()}};RouteUtil.prototype.calculateRoute=function(h,b,j){var e="";var a=h.length;for(var d=0;d<a;d++){var g=h[d];if(g==null){continue}if(g._marker==null){continue}e+=g._marker.coords(0).lng.toPrecision(6)+","+g._marker.coords(0).lat.toPrecision(6)+((d<a-1)?":":"")}var f=this;var c=function(){LoadIndicator.show();call(VisicomFacade.site_url+"/utils/route/"+f._map.language()+"/"+e+"/"+b,function i(k){j(k);LoadIndicator.hide()})};c()};RouteUtil.prototype.repaint=function(points,accuracy){if(points==null){points=this._points}accuracy=(accuracy!=null)?accuracy:this.getAccuracy(this._map.zoom());this._accuracy=accuracy;var _this=this;var versions=[];for(var i in points){var p=points[i];versions[i]=p._version}this._cams=null;this.calculateRoute(points,accuracy,function callback(data){if(data==""){return}var routes=null;try{routes=eval("("+data+")");_this._cams=routes.cams;routes=routes.routes}catch(err){return}Common.fireEvent("route.change");var map=_this._map;for(var i=0;i<routes.length;i++){var route=routes[i];var point=points[i+1];point.repaintRoute(route,accuracy,versions[i+1])}if(routes.length==0){_this.removeAllRoutes()}_this.calculateDistance();_this.setCams();map.repaint()});this._map.repaint()};RouteUtil.prototype.calculateDistance=function(){if(this._points.length==0){return}var c=0;var a=this._points[0];a._label.visible(true);a._label.coords(a._marker.coords());a._label.move(10,-28);a._label.html(Locale.START_POINT[this._map.language()]+" <a href='#' onclick='VisicomFacade.routeUtil.remove(0);'>"+Common.DELETE_IMAGE+"</a>");for(var b=1;b<this._points.length;b++){a=this._points[b];if(a._routes[this._accuracy]==null){continue}c+=a._routes[this._accuracy].distance();a._label.visible(true);a._label.coords(a._marker.coords());a._label.move(10,-28);a._label.html("~&nbsp;"+this._toKilometers(c)+" <a href='#' onclick='VisicomFacade.routeUtil.remove("+b+");'>"+Common.DELETE_IMAGE+"</a>")}if(c>0){this._distance_element.innerHTML=Locale.FULL_DISTANCE[this._map.language()]+" ~ "+this._toKilometers(c)}else{this._distance_element.innerHTML=Locale.ROUTE_NOT_FOUND[this._map.language()]}};RouteUtil.prototype.setCams=function(){this._cams_element.innerHTML="";var d=VisicomFacade.trafficUtil;if(!d.visible()){return}for(var b in this._cams){var g=this._cams[b].id;var c=TrafficUtil.cams[g];var f=document.createElement("a");f.__id=g;f.href="#";f.onclick=function(){var h=TrafficUtil.cams[this.__id];if(!h){return}h.parent.map.center(h.marker.coords());if(TrafficCam.currentCam){TrafficCam.currentCam.marker.info().visible(false)}h.marker.info().visible(true);h.parent.map.repaint();h.setImage()};var e=document.createElement("div");e.innerHTML=c.cam.name;f.appendChild(e);var a=document.createElement("img");a.src=d.getCamImage(g,60,45);f.appendChild(a);this._cams_element.appendChild(f)}};RouteUtil.prototype.insertAfter=function(a){if(this._points.length==RouteUtil.MAX_POINTS){return}var b=this._points.indexOf(a);var c=new RoutePoint(this,this._map.center(),RouteUtil.ICONS[b+1]);this._points.insertAfter(a,c);this._resetControls();this.repaint()};RouteUtil.prototype.remove=function(a){if(typeof(a)=="number"){a=this._points[a]}a.destroy();if(this._points.indexOf(a)==0&&this._points.length>1){var e=this._points[1];var c=this._layer;for(var d in e._routes){var b=e._routes[d];c.remove(b)}}this._points.remove(a);if(this._points.length==0){VisicomFacade.routeControl.element.innerHTML=Locale.ROUTE_CREATE[this._map.language()];VisicomFacade.routeControl.reverse_route.style.display="none";this._distance_element.style.display="none";return}this._resetControls();this.repaint()};RouteUtil.prototype.show=function(){if(this._points.length==0){this.init()}this._visible=true;Common.fireEvent("route.change")};RouteUtil.prototype.hide=function(){Common.fireEvent("route.change");this.removeAllRoutes();this.setCams();this._layer.visible(false);this._map.repaint()};RouteUtil.prototype.destroy=function(){var d=this._points.length;for(var b=0;b<d;b++){var a=this._points[b];a.destroy()}this._points=[];Common.extendArray(this._points);try{this._element.removeChild(this._distance_element)}catch(c){}this._visible=false;this._cams=[];this.setCams()};RouteUtil.prototype.visible=function(){return this._visible};RouteUtil.prototype.start=function(b){this._visible=true;var c=this._points[0];if(c!=null&&this._points.length>1){this.remove(c)}var a=new RoutePoint(this,b,RouteUtil.ICONS[0]);this._points.insertAt(a,0);VisicomFacade.routeControl.element.innerHTML=Locale.ROUTE_REMOVE[this._map.language()];VisicomFacade.routeControl.reverse_route.style.display="block";this._resetControls();a._marker.icon(RouteUtil.ICONS[0]);a.element().icon(RouteUtil.ICONS[0].source());if(this._points.length==1){return}this.repaint()};RouteUtil.prototype.finish=function(c){this._visible=true;var a=new RoutePoint(this,c,RouteUtil.ICONS[RouteUtil.ICONS.length-1]);if(this._points.length>=2){var b=this._points[this._points.length-1];this.remove(b)}this._points.push(a);VisicomFacade.routeControl.element.innerHTML=Locale.ROUTE_REMOVE[this._map.language()];VisicomFacade.routeControl.reverse_route.style.display="block";this._resetControls();a._marker.icon(RouteUtil.ICONS[RouteUtil.ICONS.length-1]);a.element().icon(RouteUtil.ICONS[RouteUtil.ICONS.length-1].source());if(this._points.length==1){return}this.repaint()};RouteUtil.prototype.get=function(b){var a=this._first;var c=0;while(a!=null){if(c==b){return a}a=a._next;c++}return null};RouteUtil.prototype._getCenterPoint=function(b,a){return this._map.center()};RouteUtil.prototype._toKilometers=function(a){if(a>1000){var b=Math.round(a/1000000)+3;return(a/1000).toPrecision(b)+"&nbsp;"+Locale.KM[this._map.language()]}else{return Math.round(a)+"&nbsp;"+Locale.M[this._map.language()]}};RouteUtil.prototype.getState=function(){var b="{";var a=this._first;if(!this.visible()||a==null){return"{}"}var d="[";var c=0;while(a!=null){if(c>0){d+=", "}d+=" { lng: "+a._marker.coords(0).lng.toPrecision(6)+", lat: "+a._marker.coords(0).lat.toPrecision(6)+" }";a=a._next;c++}d+="]";b+="points: "+d;b+="}";return b};RouteUtil.prototype.setState=function(state){var object=eval("("+state+")");if(object==null){return}var points=object.points;if(points==null){return}this._first=new RoutePoint(this,points[0],RouteUtil.ICONS[0]);this._counter=1;var prev=this._first;for(var i=1;i<points.length;i++){var point=points[i];var newpoint=new RoutePoint(this,point,RouteUtil.ICONS[i]);prev.add(newpoint);prev=newpoint;this._counter++}VisicomFacade.routeControl.element.innerHTML=Locale.ROUTE_REMOVE[this._map.language()];VisicomFacade.routeControl.reverse_route.style.display="block";this._visible=true;this._resetControls();this.repaint()};RoutePoint.prototype._id;RoutePoint.prototype._parent;RoutePoint.prototype._element;RoutePoint.prototype._marker;RoutePoint.prototype._label;RoutePoint.prototype._routes;RoutePoint.prototype._prev;RoutePoint.prototype._next;RoutePoint.prototype._version;RoutePoint.prototype._current_route;RouteUtil.TIMER=null;RouteUtil.POINTS_MAP=[];RouteUtil.DRAGGING=function(f){clearTimeout(RouteUtil.TIMER);var a=RouteUtil.POINTS_MAP[f];a._version=Math.random();a._routes=[];a.changeDescription();var e=a._parent._points;var b=e.indexOf(a);var d=[];if(b>0){d.push(e[b-1])}d.push(a);if(b<e.length-1){var c=e[b+1];d.push(c);c._version=Math.random();c._routes=[]}a._parent.repaint(d)};RouteUtil.prototype.CURRENT_ID=null;RouteUtil.prototype.CURRENT_ROUTE;function RoutePoint(b,c,a){this._parent=b;this._id=Math.random();RouteUtil.POINTS_MAP[this._id]=this;var d=this;this._routes=[];this._marker=new VMarker(c,a);this._marker.draggable(true);this._marker.dragging(function(){d._label.visible(false);if(RouteUtil.TIMER!=null){clearTimeout(RouteUtil.TIMER)}RouteUtil.TIMER=setTimeout("RouteUtil.DRAGGING("+d._id+")",200)});this._parent._layer.add(this._marker);this._parent._map.repaint();this._element=new RouteElement(this._parent);this._element.point(this);this.changeDescription();this._label=new VLabel(c);this._parent._layer.add(this._label);this._version=Math.random();return this}RoutePoint.prototype.destroy=function(){var b=this._parent._layer;b.remove(this._marker);b.remove(this._label);for(var d in this._routes){var a=this._routes[d];b.remove(a)}this._parent._map.repaint();try{this._parent._element.removeChild(this._element.getDOMElement())}catch(c){}};RoutePoint.prototype.changeDescription=function(){var coords=this._marker.coords(0);var _this=this;call(VisicomFacade.site_url+"/utils/description/"+this._parent._map.language()+"/"+coords.lng+","+coords.lat,function callback(response){try{var data=eval("("+response+")")}catch(err){return}_this.element().text("<b>"+data.settlement+"</b>,<br/>"+data.description)})};RoutePoint.prototype.element=function(a){if(a==null){return this._element}this._element=a;return this};RoutePoint.prototype.showRoute=function(c){if(!this._routes[c]){return false}var b=this._parent._map;var a=this._parent._layer;if(this._current_route!=null){a.remove(this._current_route)}this._current_route=this._routes[c];a.add(this._current_route);this._current_route.visible(true);b.repaint();return true};RoutePoint.prototype.removeRoute=function(){var a=this._parent._layer;if(this._current_route!=null){a.remove(this._current_route)}};RoutePoint.prototype.repaintRoute=function(b,e,a){if(a!=this._version){return}if(!this._parent._visible){return}var d=this._parent._map;var c=this._parent._layer;this._routes[e]=b;if(this._parent._accuracy==e){if(this._current_route!=null){c.remove(this._current_route)}c.add(b);this._current_route=b;this._current_route.visible(true);d.repaint()}};RouteElement.prototype._parent;RouteElement.prototype._point;RouteElement.prototype._div;RouteElement.prototype._img;RouteElement.prototype._hrefInfo;RouteElement.prototype._hrefAdd;RouteElement.prototype._hrefRemove;function RouteElement(a){this._parent=a;this._createDOMElement();return this}RouteElement.prototype.getDOMElement=function(){return this._div};RouteElement.prototype._createDOMElement=function(){var e=this;this._div=document.createElement("div");this._div.className="route_point";var a=document.createElement("a");a.href="#";a.onclick=function(){e._parent._map.center(e.point()._marker.coords(),8)};this._img=document.createElement("img");this._img.border=0;this._img.src="common/icons/route/RS.png";this._img.className="png_images";this._img.style.width="30px";this._img.style.height="28px";a.appendChild(this._img);this._div.appendChild(a);this._hrefInfo=document.createElement("a");this._hrefInfo.href="#";this._hrefInfo.innerHTML=Locale.WAIT[this._parent._map.language()];this._hrefInfo.onclick=function(){e._parent._map.center(e.point()._marker.coords(),15)};this._div.appendChild(this._hrefInfo);var d=document.createElement("div");var b=document.createElement("div");b.className="del_point";this._hrefRemove=document.createElement("a");this._hrefRemove.href="#";this._hrefRemove.onclick=function(){e._parent.remove(e.point());e._parent.repaint()};this._hrefRemove.innerHTML=Locale.DEL_POINT[this._parent._map.language()];b.appendChild(this._hrefRemove);var c=document.createElement("div");c.className="add_point";this._hrefAdd=document.createElement("a");this._hrefAdd.href="#";this._hrefAdd.onclick=function(){e._parent.insertAfter(e.point())};this._hrefAdd.innerHTML=Locale.ADD_POINT[this._parent._map.language()];c.appendChild(this._hrefAdd);d.appendChild(b);d.appendChild(c);this._div.appendChild(d)};RouteElement.prototype.icon=function(a){if(a==null){return this._img.src}this._img.src=a;return this};RouteElement.prototype.text=function(a){if(a==null){return this._hrefInfo.innerHTML}this._hrefInfo.innerHTML=a;return this};RouteElement.prototype.point=function(a){if(a==null){return this._point}this._point=a;return this};TrafficUtil.map;TrafficUtil.layer;TrafficUtil.cams;TrafficUtil.infoWindow;function TrafficUtil(a){this.map=a;this.layer=new VLayer();this.map.add(this.layer);this.layer.visible(false);Common.addListener("route.change",function(){});VisicomFacade.trafficUtil=this;return this}TrafficUtil.prototype.getCamImage=function(c,b,a){return VisicomFacade.site_url+"/utils/traffic/"+this.map.language()+"/"+b+":"+a+"/"+c+"?"+Math.random()};TrafficUtil.prototype.init=function(){if(TrafficUtil.cams!=null){return}var _this=this;call(VisicomFacade.site_url+"/utils/traffic/ru/json",function(cams){cams=eval("("+cams+")");TrafficUtil.cams=[];for(var i in cams){var cam=new TrafficCam(cams[i],_this);cam.create();TrafficUtil.cams[cams[i].id]=cam}_this.map.repaint()})};TrafficUtil.prototype.show=function(){this.init();this.layer.visible(true);this.map.repaint()};TrafficUtil.prototype.hide=function(){this.layer.visible(false);this.map.repaint()};TrafficUtil.prototype.toggle=function(){if(this.layer.visible()){this.hide()}else{this.show()}};TrafficUtil.prototype.visible=function(){return this.layer.visible()};TrafficCam.prototype.cam;TrafficCam.prototype.parent;TrafficCam.prototype.zoomElement;TrafficCam.prototype.hint;TrafficCam.current_hint;TrafficCam.currentZoomCam;TrafficCam.currentCam;TrafficCam.prototype.image;TrafficCam.prototype.views;TrafficCam.prototype.marker;TrafficCam.prototype.counter;TrafficCam.prototype.error_counter;TrafficCam.prototype.timer;TrafficCam.PROGRESS_TIMEOUT=10;TrafficCam.PROGRESS_WIDTH=100;TrafficCam.PROGRESS_STEPS=100;TrafficCam.PROGRESS_STEP=TrafficCam.PROGRESS_WIDTH/TrafficCam.PROGRESS_STEPS;TrafficCam.PROGRESS_TIMEOUT=(TrafficCam.PROGRESS_TIMEOUT/TrafficCam.PROGRESS_STEPS)*1000;TrafficCam.MAX_ERRORS=3;TrafficCam.prototype.state;TrafficCam.prototype.size;TrafficCam.info='<div id="iw_wrapper" ${style}>    <div class="iw_name">${name}</div>    Направление: ${orientationName}    <div class="iw_attribute">        <div style="position: relative;">           <img id="cam_image_${id}" src="${image}" width="320" height="240" class="iw_cam" onload="TrafficCam.onImageLoad(${id});" onerror="TrafficCam.onImageError(${id});" />        </div>    </div>    <div id="iw_tools_wrapper">        <div class="iw_tools">           <div style="float: left; border: 1px solid #646464; width: '+TrafficCam.PROGRESS_WIDTH+'px; height: 8px; margin: 2px 0px 0px 3px;">               <div id="cam_progress_${id}" style="font-size: 1px; width: 0px; height: 8px; background-color: #646464;"></div>           </div>           <img id="cam_control_${id}" src="${state}.png" onclick="TrafficCam.toggleCam(${id});" style="cursor: pointer; margin: 0px -1px 0px 5px;"></div>        <div class="iw_tools">            <a href="javascript: TrafficCam.zoomInCam(${id});" onclick="">Увеличить</a>        </div>    </div></div>';TrafficCam.zoom_info='<div style="cursor: default; font-size: 11px;">    <div>        <div style="position: absolute; left: 0px; top: 0px; width: 9px; height: 9px;">            <img src="${mapsapi}/images/info/corner-left-top.png" width="9" height="9">        </div>        <div style="position: absolute; left: 9px; top: 0px; width: 656px; height: 9px;">            <img src="${mapsapi}/images/info/border-top.png" width="656" height="9">        </div>        <div style="position: absolute; left: 665px; top: 0px; width: 9px; height: 9px;">            <img src="${mapsapi}/images/info/corner-right-top.png" width="9" height="9">        </div>        <div style="position: absolute; left: 0px; top: 9px; width: 9px; height: 563px;">            <img src="${mapsapi}/images/info/border-left.png" width="9" height="563">        </div>        <div style="position: absolute; left: 9px; top: 9px; width: 656px; height: 563px; background-color: white;">            <div style="padding: 3px;">                <div id="iw_wrapper">                    <div class="iw_name">${name}</div>                    Направление: ${orientationName}                   <div class="iw_attribute">                        <div style="position: relative;">                           <img id="cam_image_${id}" src="${image}" width="640" height="480" class="iw_cam" onload="TrafficCam.onImageLoad(${id});" onerror="TrafficCam.onImageError(${id});" />                        </div>                    </div>                    <div id="iw_tools_wrapper">                        <div class="iw_tools">                           <div style="float: left; border: 1px solid #646464; width: '+TrafficCam.PROGRESS_WIDTH+'px; height: 8px; margin: 2px 0px 0px 3px;">                               <div id="cam_progress_${id}" style="font-size: 1px; width: 0px; height: 8px; background-color: #646464;"></div>                           </div>                           <img id="cam_control_${id}" src="${state}.png" onclick="TrafficCam.toggleCam(${id});" style="cursor: pointer; margin: 0px -1px 0px 5px;"></div>                        <div class="iw_tools">                           <a href="javascript: TrafficCam.zoomOutCam(${id});" onclick="">Уменьшить</a>                        </div>                    </div>                </div>            </div>        </div>        <div style="position: absolute; left: 665px; top: 9px; width: 9px; height: 563px;">            <img src="${mapsapi}/images/info/border-right.png" width="9" height="563">        </div>        <div style="position: absolute; left: 0px; top: 572px; width: 9px; height: 15px;">            <img src="${mapsapi}/images/info/corner-left-bottom.png" width="9" height="15">        </div>        <div style="position: absolute; left: 9px; top: 572px; width: 33px; height: 15px;">            <img src="${mapsapi}/images/info/pointer-clear.png" width="33" height="15">        </div>        <div style="position: absolute; left: 42px; top: 572px; width: 623px; height: 15px;">            <img src="${mapsapi}/images/info/border-bottom.png" width="623" height="15">        </div>        <div style="position: absolute; left: 665px; top: 572px; width: 9px; height: 15px;">            <img src="${mapsapi}/images/info/corner-right-bottom.png" width="9" height="15">        </div>    </div>    <img src="${mapsapi}/images/info/close.png" onmouseover="this.src=\'${mapsapi}/images/info/close_hover.png\';" onmouseout="this.src=\'${mapsapi}/images/info/close.png\';" onclick="TrafficCam.close(${id});" style="height: 15px; width: 15px; position: absolute; left: 645px; top: 13px; z-index: 590; cursor: pointer;"></div>';TrafficCam.hint='<div class="cam_hint">   <img src="${image}" width="60" height="45">   <b>${name}</b></div>';function TrafficCam(b,a){this.cam=b;this.parent=a;this.error_counter=0;return this}TrafficCam.prototype.create=function(){this.counter=0;this.state="play";var map=this.parent.map;var layer=this.parent.layer;this.cam.coords=eval("("+this.cam.coords+")");var icon=new VMarkerIcon(24,24,VisicomFacade.site_url+"/common/icons/traffic/"+this.cam.icon);this.marker=new VMarker(this.cam.coords,icon);this.marker.pointer({x:12,y:12});this.width=320;this.height=240;this.size="middle";this.createInfo();var _this=this;this.marker.onshow(function(){_this.createHint()});this.parent.map.beforezoomchange(function(){if(!TrafficCam.current_hint){return}try{document.body.removeChild(TrafficCam.current_hint)}catch(err){}});layer.add(this.marker);map.repaint()};TrafficCam.prototype.createInfo=function(){var b=TrafficCam.info;b=b.replace(/\$\{name}/,this.cam.name);b=b.replace(/\$\{orientationName}/,this.cam.orientationName);b=b.replace(/\$\{id}/g,this.cam.id);b=b.replace(/\$\{state}/g,VisicomFacade.site_url+"/common/icons/traffic/stop");var a=Common.getContentSizeForInfoWindow(b,336);b=b.replace(/\$\{image}/,VisicomFacade.site_url+"/utils/traffic/ru/"+this.width+":"+this.height+"/"+this.cam.id+"?"+Math.random());b=b.replace(/\$\{style}/,'style="overflow: hidden;"');this.marker.info(b,{width:336,height:a.height});var c=this;this.marker.info().onhide(function(){if(c.size!="middle"){return}TrafficCam.close(c.id)});this.marker.info().onshow(function(){if(TrafficCam.currentZoomCam){TrafficCam.close(TrafficCam.currentZoomCam);TrafficCam.currentZoomCam=null}TrafficCam._setCamControl(c.cam.id);c.width=320;c.height=240;c.size="middle";var d=c.marker.getDOMElement();if(d==null){return}d.style.display="block";TrafficCam.currentCam=c;c.setImage();c.setViews()})};TrafficCam.prototype.createHint=function(){var b=TrafficCam.hint;b=b.replace(/\$\{name}/,this.cam.name);b=b.replace(/\$\{orientationName}/,this.cam.orientationName);b=b.replace(/\$\{image}/,VisicomFacade.site_url+"/utils/traffic/ru/60:45/"+this.cam.id+"?"+Math.random());this.hint=document.createElement("div");this.hint.style.width="200px";this.hint.style.position="absolute";this.hint.style.zIndex=3000;this.hint.innerHTML=b;var a=this.marker.getDOMElement();var c=this;VisicomUtils.addHandler(a,"mouseover",function(f){var d=VisicomUtils.getBounds(a);c.hint.style.left=(d.left+20)+"px";c.hint.style.top=(d.top-55)+"px";document.body.appendChild(c.hint);TrafficCam.current_hint=c.hint});VisicomUtils.addHandler(a,"mouseout",function(f){try{document.body.removeChild(c.hint)}catch(d){}TrafficCam.current_hint=null})};TrafficCam.close=function(c){var b=TrafficUtil.cams[c];if(!b){return}clearTimeout(b.timer);try{if(b.zoomElement){document.body.removeChild(b.zoomElement)}}catch(a){}};TrafficCam.zoomInCam=function(e){if(TrafficUtil.infoWindow){TrafficUtil.infoWindow.close()}else{TrafficUtil.infoWindow=new InfoWindow()}var b=TrafficUtil.cams[e];if(!b){return}clearTimeout(b.timer);b.marker.info().visible(false);b.parent.map.repaint();b.width=640;b.height=480;b.size="large";var c=TrafficCam.zoom_info;c=c.replace(/\$\{name}/,b.cam.name);c=c.replace(/\$\{orientationName}/,b.cam.orientationName);c=c.replace(/\$\{id}/g,b.cam.id);c=c.replace(/\$\{image}/,VisicomFacade.site_url+"/utils/traffic/ru/"+b.width+":"+b.height+"/"+e+"?"+Math.random());c=c.replace(/\$\{state}/g,VisicomFacade.site_url+"/common/icons/traffic/"+((b.state=="play")?"stop":"play"));c=c.replace(/\$\{mapsapi}/g,VisicomFacade.mapsapi_url);var a=Common.getWindowSize().width/2-690/2;var d=Common.getWindowSize().height/2-600/2;b.zoomElement=document.createElement("div");b.zoomElement.style.position="absolute";b.zoomElement.style.left=a+"px";b.zoomElement.style.top=d+"px";b.zoomElement.style.zIndex=3000;b.zoomElement.innerHTML=c;document.body.appendChild(b.zoomElement);b.setViews();TrafficCam._setCamControl(e);TrafficCam.currentZoomCam=e;VisicomUtils.addHandler(window,"mousedown",function(f){if(!b.zoomElement){return}TrafficCam.close(e);b.size="middle"});b.zoomElement.onmousedown=function(f){if(f.stopPropagation){f.stopPropagation()}else{f.cancelBubble=true}if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}};b.parent.map.mousedown(function(){if(!b.zoomElement){return}TrafficCam.close(e);b.size="middle"})};TrafficCam.zoomOutCam=function(b){if(TrafficUtil.infoWindow){TrafficUtil.infoWindow.close()}var a=TrafficUtil.cams[b];if(!a){return}clearTimeout(a.timer);if(a.zoomElement){document.body.removeChild(a.zoomElement)}a.zoomElement=null;a.width=320;a.height=240;a.size="middle";a.marker.info().visible(true);a.parent.map.repaint();a.setImage()};TrafficCam.onImageLoad=function(c){var a=TrafficUtil.cams[c];if(!a){return}TrafficCam.setProgres(c,a.counter=0);var b=document.getElementById("cam_progress_"+c);b.style.width="0px";if(a.state!="play"){return}clearTimeout(a.timer);a.timer=setTimeout("TrafficCam.reloadCam("+c+");",TrafficCam.PROGRESS_TIMEOUT)};TrafficCam.prototype.setImage=function(){var a=document.getElementById("cam_image_"+this.cam.id);if(!a){return}a.src=VisicomFacade.site_url+"/utils/traffic/ru/"+this.width+":"+this.height+"/"+this.cam.id+"?"+Math.random()};TrafficCam.prototype.setViews=function(){var e=document.getElementById("cam_image_"+this.cam.id);if(!e){return}if(this.views){try{e.parentNode.removeChild(this.views)}catch(d){}}var b=VisicomFacade.routeUtil.getCamViews(this.cam.id);if(!b){return}this.views=document.createElement("div");this.views.id="cam_views_"+this.cam.id;this.views.style.width=this.width;this.views.style.height=this.height;this.views.style.position="absolute";this.views.style.left="0px";this.views.style.top="0px";this.views.style.zIndex="1000";for(var c in b){var a=document.createElement("img");a.style.width=this.width;a.style.height=this.height;a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.zIndex="1000";a.src=VisicomFacade.site_url+"/common/route-cams/"+this.cam.id+"/"+b[c];this.views.appendChild(a)}e.parentNode.appendChild(this.views)};TrafficCam.onImageError=function(b){var a=TrafficUtil.cams[b];if(!a){return}if(a.error_counter++>TrafficCam.MAX_ERRORS){return}a.setImage()};TrafficCam.reloadCam=function(b){var a=TrafficUtil.cams[b];if(!a){return}TrafficCam.setProgres(b,a.counter++);if(a.counter<TrafficCam.PROGRESS_STEPS){a.timer=setTimeout("TrafficCam.reloadCam("+b+");",TrafficCam.PROGRESS_TIMEOUT);return}a.setImage()};TrafficCam.setProgres=function(c,a){var b=document.getElementById("cam_progress_"+c);if(!b){return}b.style.width=(a*TrafficCam.PROGRESS_STEP)+"px"};TrafficCam.toggleCam=function(d){var b=TrafficUtil.cams[d];if(!b){return}b.state=(b.state=="play")?"stop":"play";TrafficCam._setCamControl(d);if(b.state=="stop"){clearTimeout(b.timer);TrafficCam.setProgres(d,b.counter=0)}else{var c=document.getElementById("cam_image_"+d);var a=(b.size=="middle")?"320:240":"640:480";c.src=VisicomFacade.site_url+"/utils/traffic/ru/"+a+"/"+d+"?"+Math.random()}};TrafficCam._setCamControl=function(d){var b=TrafficUtil.cams[d];if(!b){return}var a=(b.state=="play")?"stop":"play";var c=document.getElementById("cam_control_"+d);c.src=VisicomFacade.site_url+"/common/icons/traffic/"+a+".png";c.onmouseover=function(){c.src=VisicomFacade.site_url+"/common/icons/traffic/"+a+"-hover.png"};c.onmouseout=function(){c.src=VisicomFacade.site_url+"/common/icons/traffic/"+a+".png"}};URLUtil.prototype._map;function URLUtil(b){this._map=b;var d=this;var a=function(){var e=d._map.getState();d.saveState("map",e)};this._map.enddrag(function c(){a()});this._map.onzoomchange(function c(){a()});VisicomFacade.urlUtil=this;if(this._readCookie("maps_for_pc")!="OK"&&maps_for_pc!=null){maps_for_pc.style.display="block"}return this}URLUtil.prototype.readCookie=function(){try{var a=this.readState("address");if(a!=null&&a!=""){VisicomFacade.addressUtil.setState(a)}var b=this.readState("map");if(b!=null&&b!=""){this._map.setState(b)}selectTab(0)}catch(c){}};URLUtil.prototype.saveState=function(a,b){this._createCookie(a,b,30)};URLUtil.prototype.readState=function(a){return this._readCookie(a)};URLUtil.prototype._createCookie=function(c,d,e){if(d==null){document.cookie=c+"=null; path=/";return}d=d.replace(/=/g,"#equal#");d=d.replace(/;/g,"#semicolon#");if(e){var b=new Date();b.setTime(b.getTime()+(e*24*60*60*1000));var a="; expires="+b.toGMTString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"};URLUtil.prototype._readCookie=function(b){var f=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var g=a[d];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){var e=g.substring(f.length,g.length);e=e.replace(/#equal#/g,"=");e=e.replace(/#semicolon#/g,";");return e}}return null};URLUtil.prototype.clearAll=function(){this.saveState("address","");this.saveState("route","");this.saveState("map","");this.saveState("site","")};URLUtil.prototype.inheritLinks=function(){var i="";var b=/#.*lng=(\d+\.\d+)/i;if(b.exec(document.location.href)){i=document.location.href}else{this.parseLink()}var s=/#.*lng=(\d+\.\d+)/i;var f=/#.*la?td?=(\d+\.\d+)/i;var j=/#.*z=(\d+)/i;var v=s.exec(i);var h=f.exec(i);var a=j.exec(i);if((v!=null)&&(h!=null)&&(a!=null)){this._map.center({lng:parseFloat(v[1]),lat:parseFloat(h[1])},parseInt(a[1])+6)}var w=VisicomFacade.addressUtil;var r=/#.*lngm=(\d+\.\d+)/i;var c=r.exec(i);var e=/#.*la?td?m=(\d+\.\d+)/i;var m=e.exec(i);if((c!=null)&&(m!=null)){w.marker({lng:parseFloat(c[1]),lat:parseFloat(m[1])})}var n=VisicomFacade.routeUtil;var k=/#.*lngms=(\d+\.\d+)/i;var o=k.exec(i);var p=/#.*la?td?ms=(\d+\.\d+)/i;var u=p.exec(i);if(o!=null&&u!=null){n.start({lng:parseFloat(o[1]),lat:parseFloat(u[1])})}var l=/#.*lngmf=(\d+\.\d+)/i;var t=l.exec(i);var q=/#.*la?td?mf=(\d+\.\d+)/i;var g=q.exec(i);if(t!=null&&g!=null){n.finish({lng:parseFloat(t[1]),lat:parseFloat(g[1])})}if(/#/.test(document.location.href)){var d=document.location.href.replace(/#.*$/,"#");document.location.href=d}this._map.repaint()};URLUtil.prototype.parseLink=function(){var n=document.location.href.split("#");if(n.length<2){n=document.location.href.split("?");if(n.length<2){return}}n=n[1];var c=/c\/(.*?)[\/$]/i;var k=/m\/(.*?)[\/$]/i;var h=/r\/(.*?)[\/$]/i;var a=c.exec(n);if(a!=null){var d=a[1].split(":");this._map.center({lng:parseFloat(d[0]),lat:parseFloat(d[1])},parseInt(d[2]))}var g=k.exec(n);if(g!=null){d=g[1].split(":");VisicomFacade.addressUtil.marker({lng:parseFloat(d[0]),lat:parseFloat(d[1])})}var f=h.exec(n);if(f!=null){d=f[1].split(",");var j=VisicomFacade.routeUtil;for(var e=0;e<d.length;e++){if(e>=RouteUtil.MAX_POINTS){break}var l=d[e].split(":");var m=new RoutePoint(j,{lng:parseFloat(l[0]),lat:parseFloat(l[1])},RouteUtil.ICONS[e]);j._points[e]=m}if(VisicomFacade.routeControl.element!=null){VisicomFacade.routeControl.element.innerHTML=Locale.ROUTE_REMOVE[this._map.language()]}if(VisicomFacade.routeControl.reverse_route!=null){VisicomFacade.routeControl.reverse_route.style.display="block"}j._visible=true;j._resetControls();j.repaint()}if(/#/.test(document.location.href)){var b=document.location.href.replace(/#.*$/,"#");document.location.href=b}};URLUtil.prototype._getLink=function(c){var b="";var g=(c)?c:this._map.center();b+="c/"+g.lng.toPrecision(6)+":"+g.lat.toPrecision(6)+":"+this._map.zoom()+"/";var d=VisicomFacade.addressUtil.marker();if(d!=null&&d.visible()){g=d.coords(0);if(g!=null){b+="m/"+g.lng.toPrecision(6)+":"+g.lat.toPrecision(6)+"/"}}if(VisicomFacade.routeUtil.visible()){var f=VisicomFacade.routeUtil._points;b+="r/";for(var e=0;e<f.length;e++){if(e>0){b+=","}var a=f[e];g=a._marker.coords(0);b+=g.lng.toPrecision(6)+":"+g.lat.toPrecision(6)}b+="/"}return b};URLUtil.prototype.getLink=function(){var b=this._map.language();var a=VisicomFacade.site_url+((b=="ru")?"":"/"+this._map.language()+"/")+"?"+this._getLink();return a};URLUtil.prototype.getIFrameLink=function(c,d,b){var a=VisicomFacade.site_url+"/utils/iframe/"+this._map.language()+"/"+d+":"+b+"/?"+this._getLink(c);return a};VMap.prototype.getState=function(){var b="{";var a=this.center();b+="center: { lng: "+a.lng+", lat: "+a.lat+"}, ";b+="zoom: "+this.zoom();b+="}";return b};VMap.prototype.setState=function(state){if(state==null){return}var object=eval("("+state+")");if(object.center!=null){this.center(object.center,object.zoom)}};VisicomFacade.map;VisicomFacade.routeUtil;VisicomFacade.addressUtil;VisicomFacade.poiTileLoader;VisicomFacade.urlUtil;VisicomFacade.distanceUtil;VisicomFacade.errorNotificator;VisicomFacade.iframeUtil;VisicomFacade.trafficUtil;VisicomFacade.routeControl={};VisicomFacade.poiControls={};VisicomFacade.siteControls={};VisicomFacade.site_url;VisicomFacade.mapsapi_url;VisicomFacade.static_url;function VisicomFacade(){return this}var aXmlHttp=new Array();var aXmlResponse=new Array();function xmlResult(){for(var a=0;a<aXmlHttp.length;a++){if(aXmlHttp[a]&&aXmlHttp[a][0]&&aXmlHttp[a][0].readyState==4){var c=aXmlHttp[a][1];var b=aXmlHttp[a][0].responseText;aXmlHttp[a][0]=null;aXmlHttp[a][1]=null;aXmlHttp[a]=null;c(b)}}}function call(b,d,g,e){g=g||"GET";var a=aXmlHttp.length;for(var c=0;c<a;c++){if(aXmlHttp[c]==null){a=c;break}}aXmlHttp[a]=new Array(2);aXmlHttp[a][0]=getXMLHTTP();aXmlHttp[a][1]=d;if(aXmlHttp[a]){aXmlHttp[a][0].open(g,b,true);aXmlHttp[a][0].onreadystatechange=xmlResult;if(e){aXmlHttp[a][0].setRequestHeader("Content-type","application/x-www-form-urlencoded");aXmlHttp[a][0].setRequestHeader("Content-length",e.length);aXmlHttp[a][0].setRequestHeader("Connection","close")}aXmlHttp[a][0].send(e)}}function getXMLHTTP(){var a=null;try{a=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=null}}if(!a&&typeof XMLHttpRequest!="undefined"){a=new XMLHttpRequest()}return a}function drawNull(s){eval(s);return false}VisicomFacade.site_url="http://maps.visicom.ua";VisicomFacade.mapsapi_url="http://maps.visicom.ua/api/2.0.0/";VisicomFacade.static_url="http://static.visicom.ua/";