VMapObject.prototypes=[];var USER_DATA={Browser:{KHTML:/Konqueror|KHTML/.test(navigator.userAgent)&&!/Apple/.test(navigator.userAgent),Chrome:/Chrome/.test(navigator.userAgent),Safari:/KHTML/.test(navigator.userAgent)&&/Apple/.test(navigator.userAgent),Opera:!!window.opera,Mozilla:/Mozilla/.test(navigator.userAgent),MSIE:!!(window.attachEvent&&!window.opera),MSIE_6:/msie 6/i.test(navigator.userAgent),Gecko:/Gecko/.test(navigator.userAgent)&&!/Konqueror|KHTML/.test(navigator.userAgent)},OS:{Windows:navigator.platform.indexOf("Win")>-1,Mac:navigator.platform.indexOf("Mac")>-1,Linux:navigator.platform.indexOf("Linux")>-1}};if(!Array.prototype.push){Array.prototype.push=function(a){return this[this.length]=a}}if(!Array.prototype.forEach){Array.prototype.forEach=function(c,b){b=b||this;for(var a=0;a<this.length;a++){c.call(b,this[a],a,this)}}}if(!Array.indexOf){Array.prototype.indexOf=function(b){for(var a=0;a<this.length;a++){if(this[a]==b){return a}}return -1}}var _VISICOM_MapGlobalContext;function VisicomCommons(){}VisicomCommons.API_URL="http://maps.visicom.ua/api/2.0.0//";VisicomCommons.MAP_NAME="world";VisicomCommons.MSG_SEARCH_ADDRESS="Поиск по адресной базе";VisicomCommons.MSG_MORE_2="Введите более 2-х символов...";VisicomCommons.MSG_PLEASE_WAIT=[];VisicomCommons.MSG_PLEASE_WAIT.ua="Зачекайте, іде завантаження...";VisicomCommons.MSG_PLEASE_WAIT.ru="Подождите, идет загрузка...";VisicomCommons.MSG_PLEASE_WAIT.en="Please wait...";VisicomCommons.MSG_NOT_FOUND=[];VisicomCommons.MSG_NOT_FOUND.ua="Нічого не знайдено.";VisicomCommons.MSG_NOT_FOUND.ru="Нет результатов.";VisicomCommons.MSG_NOT_FOUND.en="Not found.";VisicomCommons.MSG_SETTLEMENT=[];VisicomCommons.MSG_SETTLEMENT.ua="Нічого не знайдено.";VisicomCommons.MSG_SETTLEMENT.ru="Нет результатов.";VisicomCommons.MSG_SETTLEMENT.en="Not found.";VisicomCommons.MSG_STREET=[];VisicomCommons.MSG_STREET.ua="Нічого не знайдено.";VisicomCommons.MSG_STREET.ru="Нет результатов.";VisicomCommons.MSG_STREET.en="Not found.";VisicomCommons.ZINDEX_SMOOTH_LAYER="200";VisicomCommons.ZINDEX_TILE="210";VisicomCommons.ZINDEX_MAP="220";VisicomCommons.ZINDEX_POLYLINE="400";VisicomCommons.ZINDEX_MARKERS="500";VisicomCommons.ZINDEX_MARKERS_HOVER="520";VisicomCommons.ZINDEX_INFOWINDOW_SHADOW="580";VisicomCommons.ZINDEX_LABEL="585";VisicomCommons.ZINDEX_INFOWINDOW="590";VisicomCommons.ZINDEX_INFOWINDOW_HOVER="650";VisicomCommons.ZINDEX_HINT="670";VisicomCommons.ZINDEX_LOGO="700";VisicomCommons.ZINDEX_CONTROLS="700";VisicomCommons.OPEN_HAND_CURSOR='url("'+VisicomCommons.API_URL+'images/cursor/openhand.cur.ico"), default';VisicomCommons.CLOSED_HAND_CURSOR='url("'+VisicomCommons.API_URL+'images/cursor/closedhand.cur.ico"), default';VisicomCommons.PreferableScale=0.1;VisicomCommons.m_EarthRadius=6378137;VisicomCommons.m_scaleFactor=VisicomCommons.m_EarthRadius/VisicomCommons.PreferableScale;VisicomCommons.convertToGeoProjection=function(a,d){var b=VisicomCommons.radToDeg(a/VisicomCommons.m_scaleFactor);d=d/VisicomCommons.m_scaleFactor;var c=VisicomCommons.radToDeg(Math.atan((Math.exp(d)-Math.exp(-d))/2));return{lng:b,lat:c}};VisicomCommons.convertFromGeoProjection=function(c){var a=VisicomCommons.degToRad(c.lng)*VisicomCommons.m_scaleFactor;var b=VisicomCommons.degToRad(c.lat);var d=Math.log(Math.tan(b)+1/Math.cos(b))*VisicomCommons.m_scaleFactor;return{x:a,y:d}};VisicomCommons.radToDeg=function(a){return(a*180)/Math.PI};VisicomCommons.degToRad=function(a){return(Math.PI*a)/180};VisicomCommons.a_BAxis=(1-1/298.257223563)*6378137;VisicomCommons.GeoCalcLen=function(n){var c=n[0];var h=VisicomCommons.degToRad(c.lat);var m=Math.cos(h);var o;var d=0;for(var j=1;j<n.length;j++){c=n[j-1];var b=n[j];if(b.lat==90||b.lat==-90){o=0}else{o=b.lng-c.lng;if(o>180){o=360-o}else{if(o<-180){o=360+o}}o=VisicomCommons.degToRad(o)}var g=VisicomCommons.degToRad(b.lat);var f=g-h;var e=Math.sin(f/2);var a=Math.sin(o/2);var l=Math.cos(g);e=Math.sqrt(e*e+a*a*m*l);if(e>1){e=1}d+=2*Math.asin(e);h=g;m=l}var k=Math.pow(VisicomCommons.m_EarthRadius,(1/3));k*=k*Math.pow(VisicomCommons.a_BAxis,(1/3));return k*d};function _createVisicomMap(){try{createVisicomMap()}catch(a){}}if(window.addEventListener){window.addEventListener("load",_createVisicomMap,false)}else{if(window.attachEvent){window.attachEvent("onload",_createVisicomMap)}}VCustomTile.prototype._parent_map;VCustomTile.prototype._tile;VCustomTile.prototype._url;VCustomTile.prototype._i;VCustomTile.prototype._i;VCustomTile.prototype._left;VCustomTile.prototype._top;VCustomTile.prototype._visible;function VCustomTile(d,c,b,a){if(arguments.length==0){return this}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}VCustomTile.prototype.isVisible=function(){return this._visible};VCustomTile.prototype.getDOMElement=function(){return this._tile};VCustomTile.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=VCustomTileLayer.ZINDEX;this._tile.src=this._url;this._tile.onload=function(){this.style.display="inline"}}this._parent_map.getDOMElement().appendChild(this._tile);this._visible=true};VCustomTile.prototype.repaint=function(){if(this._tile==null){return}this._tile.style.left=this._parent_map._currentMap._left+this._left+VMapTile.TILE_WIDTH+"px";this._tile.style.top=this._parent_map._currentMap._top+this._top+VMapTile.TILE_HEIGHT+"px"};VCustomTile.prototype.hide=function(){if(this._tile==null){return}try{this._parent_map.getTilesDOMElement().removeChild(this._tile)}catch(a){}this._visible=false};VCustomTileLayer.prototype._visible;VCustomTileLayer.prototype._tiles;VCustomTileLayer.prototype._parent_map;VCustomTileLayer.ZINDEX=221;function VCustomTileLayer(){if(VCustomTileLayer.ZINDEX++>VisicomCommons.ZINDEX_POLYLINE){VCustomTileLayer.ZINDEX=221}this._visible=true;return this}VCustomTileLayer.prototype._init=function(){delete (this._tiles);this._tiles=[]};VCustomTileLayer.prototype._remove=function(){var e=new Array();var d=this._parent_map.getDOMElement();var a=d.getElementsByTagName("img");for(var b=0,f=a.length;b<f;b++){if(a[b]&&/^custom_tile/.test(a[b].id)){e.push(a[b].id)}}for(var b=0,f=e.length;b<f;b++){d.removeChild(document.getElementById(e[b]))}delete (this._tiles);this._tiles=[]};VCustomTileLayer.prototype.visible=function(a){if(arguments.length==0){return this._visible}this._visible=a;return this};VCustomTileLayer.prototype.getTileURL=function(b,a){return null};VCustomTileLayer.prototype.getTile=function(c,b){var a=this.getTileURL(c,b);if(a==null){return null}if(this._tiles[c]==null){this._tiles[c]=[]}var d=this._tiles[c][b];if(d==null){d=this._tiles[c][b]=new VCustomTile(this._parent_map,c,b,a)}return d};VMapObject.prototype._div;VMapObject.prototype._left;VMapObject.prototype._top;VMapObject.prototype._width;VMapObject.prototype._height;VMapObject.prototype._mouse_over=false;VMapObject.prototype._bounds;VMapObject.prototype._visible=true;VMapObject.prototype._displayed=false;VMapObject.prototype._coords;VMapObject.prototype._parent;VMapObject.prototype._childs;VMapObject.prototype._style;VMapObject.prototype._options;VMapObject.prototype.type;VMapObject.prototype._listeners;VMapObject.prototype.displayed=function(){return this._displayed};VMapObject._wrap=function(e,a){if(a==null){return}var d;if(VMapObject.prototypes[a.type]!=null){d=VMapObject.prototypes[a.type]}else{if(a.coords==null){return}var c=a.coords[0];if(c==null){return}if(c.length!=null){d=VMultiLine.prototype}else{if(a.coords.length==1){d=VMarker.prototype}else{d=VLine.prototype}}}if(d==null){return}for(var f in d){if(d[f] instanceof Function){continue}a[f]=d[f]}for(f in d){if(!(d[f] instanceof Function)){continue}if(a[f]){a["_"+f]=a[f]}a[f]=d[f]}a._listeners=[];a.constructor=d.constructor;if(e){a._parent=e}for(var b=0;b<a._childs.length;b++){VMapObject._wrap(a,a.childs(b))}};function VMapObject(b,a){this._childs=[];this._listeners=[];this._style={};this._options=(a==undefined)?{}:a;if(b!=null){this.coords(b)}else{this._coords=[]}return this}VMapObject.prototype.getDOMElement=function(){return this._div};VMapObject.prototype._pre_init=function(){};VMapObject.prototype.style=function(b){var a=null;if(this._style!=null){a=this._style[b]}if(a==null){if(this._parent==null){return null}return this._parent.style(b)}else{return a}};VMapObject.prototype._handleOptions=function(a){};VMapObject.prototype.options=function(a,b){if(b==null){return this._options[a]}this._options[a]=b;this._handleOptions(a);return this};VMapObject.prototype._init=function(){var a=this._getMap();if(a==null){return}this._pre_init();if(this._isGeo){a._addObject(this)}if(this._childs.forEach==null){return}this._childs.forEach(function(b){b._init()})};VMapObject.prototype._getMap=function(){if(this._type=="map"){return this}if(this._parent==null){return null}if(this._parent==this){return null}if(this._parent instanceof VMap){return this._parent}try{return this._parent._getMap()}catch(a){return null}};VMapObject.prototype._pre_add=function(){};VMapObject.prototype._pre_remove=function(){};VMapObject.prototype.add=function(a){if(a==null){return this}if(a.constructor==Object||a.constructor.toString().match(/function Object/)=="function Object"){VMapObject._wrap(null,a)}if(a._parent!=null){var b=a._visible;a._parent.remove(a);a._visible=b}this._childs.push(a);a._parent=this;this._pre_add(a);return this};VMapObject.prototype.remove=function(a){if(a==null){return this}for(var b=0;b<this._childs.length;b++){if(this._childs[b]!=a){continue}a._remove();this._childs.splice(b,1);a._parent=null;this._pre_remove(a);break}return this};VMapObject.prototype.childs=function(a){if(arguments.length==0){return this._childs}if(a!=null){if(a.length!=null){this._childs=a}else{if(typeof(a)=="number"){return this._childs[a]}}}return this};VMapObject.prototype._pre_coords=function(a){};VMapObject.prototype.coords=function(c){var a=this._pre_coords(c);if(a!=undefined){return a}if(arguments.length==0){return this._coords}if(typeof(c)=="number"){return this._coords[c]}var d=this._getMap();if(d!=null){d._removeObject(this)}if(c.length!=null){if(c[0].type!=null&&c[0].type=="point"){this._coords=[];for(var b=0;b<c.length;b++){this._coords.push(c[b].coords[0])}}else{this._coords=c}}else{if(c.type!=null&&c.type=="point"){this._coords=c.coords()}else{this._coords=[c]}}this._init();this._re_create();return this};VMapObject.prototype._re_create=function(){if(this._displayed){this._hide();this._show()}};VMapObject.prototype.move=function(a,b){this._left+=a;this._top+=b};VMapObject.prototype._pre_show=function(){};VMapObject.prototype._show=function(){if(this._displayed){return}this._pre_show();var a=this._getMap();if(a==null){return}if(this._div!=null){a.getDOMElement().appendChild(this._div)}this._event("show");this._displayed=true};VMapObject.prototype._pre_hide=function(){};VMapObject.prototype._hide=function(){if(!this._displayed){return}this._pre_hide();this._event("hide");var b=this._getMap();try{b.getDOMElement().removeChild(this._div)}catch(a){}this._div=null;this._displayed=false};VMapObject.prototype._pre_visible=function(a){};VMapObject.prototype.visible=function(b){var a=this._pre_visible(b);if(a!=undefined){return a}if(arguments.length==0){return this._visible}this._visible=b;this._childs.forEach(function(c){c.visible(b)});return this};VMapObject.prototype._remove=function(){this._hide();this.visible(false);var a=this._getMap();if(a&&this._isGeo){a._removeObject(this)}this._childs.forEach(function(b){b._remove()})};VMapObject.prototype._pre_repaint=function(){};VMapObject.prototype._repaint=function(){if(this._div==null){return}this._pre_repaint();var b=this._getMap();if(b==null){return}try{this._div.style.left=Math.round(b._currentMap._left+VMapTile.TILE_WIDTH+this._left)+"px";this._div.style.top=Math.round(b._currentMap._top+VMapTile.TILE_HEIGHT+this._top)+"px"}catch(a){}};VMapObject.prototype.bounds=function(){this._bounds=new VRect(this._coords);return this._bounds};VMapObject.prototype._event=function(d,c){var a=true;var b=arguments;if(c!=null){this._listeners.push(new VEvent(d,c))}else{this._listeners.forEach(function(f){if(f._event_name!=d){return}var e=f._handler(b[2],b[3],b[4]);a=a&&((e==undefined)?true:e)})}return a};VMapObject.prototype._mouseEvent=function(e,c,d,b){var a=true;if(c!=null){this._listeners.push(new VEvent(e,c))}else{this._listeners.forEach(function(g){if(g._event_name!=e){return}var f=g._handler(d,b);a=a&&((f==undefined)?true:f)})}return a};VMapObject.prototype.mouseclick=function(b,c,a){this._mouseEvent("mouseclick",b,c,a)};VMapObject.prototype.mousedblclick=function(b,c,a){this._mouseEvent("mousedblclick",b,c,a)};VMapObject.prototype.mousedown=function(b,c,a){this._mouseEvent("mousedown",b,c,a)};VMapObject.prototype.mouseup=function(b,c,a){this._mouseEvent("mouseup",b,c,a)};VMapObject.prototype.mousemove=function(b,c,a){this._mouseEvent("mousemove",b,c,a)};VMapObject.prototype.mouseover=function(a,b){this._mouseEvent("mouseover",a,b)};VMapObject.prototype.mouseout=function(a,b){this._mouseEvent("mouseout",a,b)};VMapObject.prototype.startdrag=function(a){this._event("startdrag",a)};VMapObject.prototype.dragging=function(a){this._event("dragging",a)};VMapObject.prototype.enddrag=function(a){this._event("enddrag",a,this)};VMapObject.prototype.beforezoomchange=function(b,a){return this._event("beforezoomchange",b,a)};VMapObject.prototype.onzoomchange=function(a){return this._event("zoomchange",a)};VMapObject.prototype.onshow=function(a){this._event("show",a)};VMapObject.prototype.onhide=function(a){this._event("hide",a)};function VEvent(b,a){this._event_name=b;this._handler=a;return this}VEvent.prototype._event_name=null;VEvent.prototype._handler=null;VLayer.prototype=new VMapObject();function VLayer(){VMapObject.call(this);this.type="layer"}VLayer.prototype._pre_add=function(a){a._init()};VLayer.prototype.bounds=function(){var c=[];for(var b=0;b<this.childs().length;b++){var d=this.childs(b);for(var a=0;a<d.coords().length;a++){c.push(d.coords(a))}}this._bounds=new VRect(c);return this._bounds};VMap.prototype=new VMapObject();VMap.PROJECTION_FACTOR=0.6664856292953198;VMap.prototype._viewport;VMap.prototype._viewport_inner;VMap.prototype._logo;VMap.prototype._maps=[];VMap.prototype._currentMap=null;VMap.prototype._draggable_marker=null;VMap.prototype._mapName=null;VMap.prototype._language=null;VMap.prototype._mouse_down;VMap.prototype._dragging;VMap.prototype._dragged_object;VMap.prototype._objects_index;VMap.prototype._map_div;VMap.prototype._tiles_div;VMap.prototype._tiles;VMap.prototype._center;VMap.prototype._zoom_index;VMap.prototype._zoomControl;VMap.prototype._customTileLayers;VMap.prototype._options=null;VMap.prototype._mouse_point=null;VMap.prototype._current_zoom_point=null;VMap.prototype._zoom_helper;VMap.AUTH_KEY="";VMap.prototype.initialized=false;VMap.prototype._getContentSize=function(e,d,c){d=d?d:350;c=c?c:350;var f=document.createElement("div");f.innerHTML=e;f.style.cssFloat="left";f.style.overflow="auto";f.style.border="1px dotted gray";f.style.maxWidth=d+"px";f.style.maxHeight=c+"px";document.body.appendChild(f);var a=f.offsetWidth;var b=f.offsetHeight;document.body.removeChild(f);if(a>d){a=d}return{width:a,height:b}};function VMap(a,b){VMapObject.call(this,null,b);this._type="map";this._viewport=a;_VISICOM_MapGlobalContext=this;this._zoomControl=new VZoomControl(this,this.options("zoomControl"));this._tiles=[];this._customTileLayers=[];this._objects_index=[];if(this._zoomControl.options("smooth")){this._zoom_helper=new VZoomHelper(this)}this.init();return this}VMap.prototype.getViewport=function(){return this._viewport_inner};VMap.prototype.getDOMElement=function(){return this._map_div};VMap.prototype.getTilesDOMElement=function(){return this._map_div};VMap.prototype._init_=function(){if(USER_DATA.Browser.MSIE){document.namespaces.add("v","urn:schemas-microsoft-com:vml");var b=document.createElement("style");var a=document.getElementsByTagName("head")[0];if(a==null){a=document.createElement("head");document.body.appendChild(a)}a.appendChild(b);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);")}var e=(this._viewport.style.left!="")?parseInt(this._viewport.style.left):0;var d=(this._viewport.style.top!="")?parseInt(this._viewport.style.top):0;this._left=e;this._top=d;this._width=this._viewport.offsetWidth||parseInt(this._viewport.style.width);this._height=this._viewport.offsetHeight||parseInt(this._viewport.style.height);this._viewport.style.position="relative";this._viewport_relative=document.createElement("div");this._viewport_inner=document.createElement("div");this._viewport_inner.style.overflow="hidden";this._viewport_inner.style.position="absolute";this._viewport_inner.style.zIndex="1";this._viewport_inner.style.left="0px";this._viewport_inner.style.top="0px";this._viewport_inner.style.width=this._width+"px";this._viewport_inner.style.height=this._height+"px";this._viewport.appendChild(this._viewport_inner);var f=this;window.onmouseup=function(g){f._dragging=false};this._map_div=document.createElement("div");this._map_div.id="visicom_map_div";this._map_div.style.position="absolute";this._map_div.style.left="-"+VMapTile.TILE_WIDTH+"px";this._map_div.style.top="-"+VMapTile.TILE_HEIGHT+"px";this._map_div.style.width=this._width+VMapTile.TILE_WIDTH*2+"px";this._map_div.style.height=this._height+VMapTile.TILE_HEIGHT*2+"px";this._map_div.style.zIndex=VisicomCommons.ZINDEX_MAP;this._map_div.style.cursor=VisicomCommons.OPEN_HAND_CURSOR;VisicomUtils.clearStyles(this._map_div);this._viewport_inner.appendChild(this._map_div);var c=new Object();this._mouse_point=new Object();if(this.options("zoomControl")==null||this.options("zoomControl").mouseWheel!=false){if(USER_DATA.Browser.Opera){VisicomUtils.addHandler(window,"mousewheel",function(g){f._onMouseWheel(g)})}else{if(USER_DATA.Browser.MSIE||USER_DATA.Browser.Chrome||USER_DATA.Browser.Safari){VisicomUtils.addHandler(document,"mousewheel",function(g){f._onMouseWheel(g)})}else{VisicomUtils.addHandler(window,"DOMMouseScroll",function(g){f._onMouseWheel(g)})}}}this._map_div.onmouseover=function(g){if(!g){g=window.event}f._mouse_over=true;f.mouseover()};this._map_div.onmouseout=function(g){if(!g){g=window.event}if(!f._isMouseOnViewport(g.clientX,g.clientY)){f._mouse_over=false;f._mouse_down=false;if(f._dragging){f.enddrag();f._dragging=false}return}f.mouseout()};VisicomUtils.addHandler(document,"mousemove",function(g){if(!f._isMouseOnViewport(g.clientX,g.clientY)){f._mouse_over=false;f._mouse_down=false;if(f._dragging){f.enddrag();f._dragging=false}return}});this._map_div.onmousedown=function(i){var g=0;if(i==undefined){i=window.event;g=window.event.button}else{g=i.which}f._mouseEvent("mousedown",null,f._getCoords(i.clientX,i.clientY),(g==1)?"left":"right");if(g!=1){return}var h=f._currentMap;c.x=i.clientX-h._left;c.y=i.clientY-h._top;if(f._zoom_helper!=null){f._zoom_helper.mousedown(i)}if(!f._mouse_over){return}VInfoWindow._changeWindow();f._mouse_down=true;f._map_div.style.cursor=VisicomCommons.CLOSED_HAND_CURSOR;f.repaint();f._clearSmoothTimer();if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}};VisicomUtils.addHandler(document,"mousemove",function(i){if(!i){i=window.event}f._current_zoom_point=null;f._mouse_point.x=i.clientX;f._mouse_point.y=i.clientY;var h=f._currentMap;if(f._dragged_object!=null){var g=f._dragged_object;g._moved=true;g.coords(f._getCoords(i.clientX+g._move_delta.dx,i.clientY+g._move_delta.dy));g._pre_show();g._repaint();g.dragging();if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}f.repaint();return}f._current_zoom_point=f._getCoords(i.clientX,i.clientY);if(!f._mouse_down){f._mouseEvent("mousemove",null,f._getCoords(i.clientX,i.clientY),"left");return}if(!f._dragging){f.startdrag()}h._left=i.clientX-c.x;h._top=i.clientY-c.y;if(f._zoom_helper!=null){f._zoom_helper.mousemove(i)}f._map_div.style.cursor=VisicomCommons.CLOSED_HAND_CURSOR;f.repaint();f.dragging();f._dragging=true;if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}});this._map_div.onmouseup=function(i){var h=0;if(i==undefined){i=window.event;h=window.event.button}else{h=i.which}if(h!=1){return}f._map_div.style.cursor=VisicomCommons.OPEN_HAND_CURSOR;f._mouseEvent("mouseup",null,f._getCoords(i.clientX,i.clientY),(h==1)?"left":"right");if(f._dragged_object!=null){var g=f._dragged_object;g._onMouseUp(i)}else{if(!f._dragging){f._mouseEvent("mouseclick",null,f._getCoords(i.clientX,i.clientY),(h==1)?"left":"right")}}f._mouse_down=false;if(f._dragging){f.enddrag()}f._dragging=false};this._map_div.ondblclick=function(j){if(!j){j=window.event}var g=0;if(j==undefined){j=window.event;g=window.event.button}else{g=j.which}var h=f._getCoords(j.clientX,j.clientY);f._mouseEvent("mousedblclick",null,h,(g==1)?"left":"right");f._mouse_point.x=j.clientX;f._mouse_point.y=j.clientY;if(f.options("zoomControl")==null||f.options("zoomControl").mouseDblClick!=false){var i=f._currentMap;if(f.zoom()==f._maps.length-1){f._clearSmoothTimer();f._smoothMove(h)}else{if(f._zoomControl.options("smooth")){f._zoom_helper.run(i._zoom_index+1,f._mouse_point)}f._zoomByPoint(f._mouse_point,i._zoom_index+1)}}};this._repaintLogo()};VMap.prototype._smoothMove=function(a,c){var b=Math.random();VMap.MAPS[b]=this;VMap.CALLBACKS[b]=c;VMap.SMOOTH_MOVING_TIMER=setTimeout("VMap.SMOOTH_MOVING("+b+", { lng: "+a.lng+", lat: "+a.lat+" })",10)};VMap.MAPS=[];VMap.CALLBACKS=[];VMap.SMOOTH_MOVING_STEP=17;VMap.prototype.SMOOTH_MOVING_TIMER=null;VMap.SMOOTH_MOVING=function(c,i){var b=VMap.MAPS[c];var l=VMap.CALLBACKS[c];var a=b.center();var j=b._convertToScreenCoords(a);var k=b._convertToScreenCoords(i);var g=Math.sqrt(Math.pow(j.x-k.x,2)+Math.pow(j.y-k.y,2));var d=VMap.SMOOTH_MOVING_STEP;if(g<d){VMap.CLEAR_SMOOTH_TIMER(c);return}var n=(j.x-k.x);var m=(j.y-k.y);var f=n/g;var h=m/g;b._currentMap._left+=d*f;b._currentMap._top+=d*h;b.repaint();if(l!=null){var e=l();if(!e){VMap.CLEAR_SMOOTH_TIMER(c);return}}b.SMOOTH_MOVING_TIMER=setTimeout("VMap.SMOOTH_MOVING("+c+", { lng: "+i.lng+", lat: "+i.lat+" })",10)};VMap.prototype._clearSmoothTimer=function(){clearTimeout(this.SMOOTH_MOVING_TIMER)};VMap.CLEAR_SMOOTH_TIMER=function(b){var a=VMap.MAPS[b];clearTimeout(a.SMOOTH_MOVING_TIMER);VMap.MAPS[b]=null};VMap.prototype._isMouseOnViewport=function(d,b){var c=VisicomUtils.getBounds(this._viewport);var a=d+VisicomUtils.getClientsLeft();var e=b+VisicomUtils.getClientsTop();return !(a-c.left>=this._width||e-c.top>=this._height||a-c.left<=0||e-c.top<=0)};VMap.prototype._getCoords=function(c,a){var e=this._currentMap;var b=VisicomUtils.getBounds(this._viewport);var d=this._convertToGeoCoords((c+VisicomUtils.getClientsLeft())-e._left-b.left,(a+VisicomUtils.getClientsTop())-e._top-b.top,e._units_per_pixel);return d};VMap.prototype._checkPosition=function(){var b=true;var a=Math.round(VMapTile.TILE_WIDTH/2);var d=Math.round(VMapTile.TILE_HEIGHT/2);var c=this._currentMap;if(c._left>(this._width-a)){c._left=this._width-a;b=false}if(c._top>(this._height-d)){c._top=this._height-d;b=false}if(c._width+c._left<a){c._left=a-c._width;b=false}if(c._height+c._top<d){c._top=d-c._height;b=false}return b};VMap.prototype._checkZoom=function(b){var d=this.zoomControl();var a=(d.options("max")!=null)?d.options("max"):this._maps.length-1;var c=(d.options("min")!=null)?d.options("min"):0;return !(b<c||b>a)};VMap.prototype.repaint=function(){if(this._currentMap==null){return this}if(this._viewport_inner==null){return this}this._checkResize();this._repaintMap();return this};VMap.prototype.onpaint=function(a){this._event("onpaint",a)};VMap.prototype.zoomControl=function(){return this._zoomControl};VMap.prototype._showMap=function(){var e=this._currentMap;if(e==null){return}delete (this._tiles);this._tiles=[];if(this._center!=null){var b=(this._center.lng-this.bounds().leftBottom().lng);var d=b/e._units_per_pixel;e._left=Math.round((this._width/2)-d);var a=(this.bounds().rightTop().lat-this._center.lat);var c=a/e._units_per_pixel;e._top=Math.round((this._height/2)-c)}else{d=(this._center.lng-this.bounds().leftBottom().lng)/e._units_per_pixel;e._left=(this._width/2)-d;c=(this._center.lat-this.bounds().leftBottom().lat)/e.__units_per_pixel;e._top=(this._height/2)-c}this._checkPosition();this._initLayers();this._initObjectsIndex();this._repaintMap()};VMap.prototype._repaintMap=function(){var l,f,m,g;var k,e,o,n;var a=this._currentMap;this._checkPosition();if(a._width<this._width){l=k=0;m=o=a._x_tiles_count-1;f=e=0;g=n=a._y_tiles_count-1}else{if(a._left<0){k=Math.floor(Math.abs(a._left)/VMapTile.TILE_WIDTH);o=Math.floor((Math.abs(a._left)+this._width)/VMapTile.TILE_WIDTH)}else{k=0;o=Math.floor((this._width-a._left)/VMapTile.TILE_WIDTH)}if(a._top<0){e=Math.floor((a._height-(Math.abs(a._top)+this._height))/VMapTile.TILE_HEIGHT);n=Math.floor((a._height-Math.abs(a._top))/VMapTile.TILE_HEIGHT)}else{e=Math.floor((a._height-(this._height-a._top))/VMapTile.TILE_HEIGHT);n=a._y_tiles_count-1}l=((a._current_min_i!=null)&&(a._current_min_i<k))?a._current_min_i:k-1;m=((a._current_max_i!=null)&&(a._current_max_i>o))?a._current_max_i:o;f=((a._current_min_j!=null)&&(a._current_min_j<e))?a._current_min_j:e-1;g=((a._current_max_j!=null)&&(a._current_max_j>n))?a._current_max_j:n;l=(l<0)?l=0:l;f=(f<0)?f=0:f;m=(m>=a._x_tiles_count)?m=a._x_tiles_count-1:m;g=(g>=a._y_tiles_count)?g=a._y_tiles_count-1:g}a._current_min_i=k;a._current_max_i=o;a._current_min_j=e;a._current_max_j=n;var d=[];var b=[];for(var h=l;h<=m;h=h+2){for(var c=f+1;c<=g;c=c+2){this._repaintTile(h,c,d,b)}}for(h=l+1;h<=m;h=h+2){for(c=f;c<=g;c=c+2){this._repaintTile(h,c,d,b)}}for(h=l;h<=m;h=h+2){for(c=f;c<=g;c=c+2){this._repaintTile(h,c,d,b)}}for(h=l+1;h<=m;h=h+2){for(c=f+1;c<=g;c=c+2){this._repaintTile(h,c,d,b)}}d.forEach(function(i){if(!i.displayed()){i._show()}i._repaint()});b.forEach(function(i){if(i.displayed()){i._hide()}});this._center=this._convertToGeoCoords(Math.round(this._width/2-this._currentMap._left),Math.round(this._height/2-this._currentMap._top),this._currentMap._units_per_pixel)};VMap.prototype._repaintTile=function(h,g,f,d){var a=this._currentMap;if(this._tiles[h]==null){this._tiles[h]=[]}if(this._tiles[h][g]==null){this._tiles[h][g]=new VMapTile(h,g,this)}var p=this._tiles[h][g];if((h>=a._current_min_i)&&(h<=a._current_max_i)&&(g>=a._current_min_j)&&(g<=a._current_max_j)){if(!p.isVisible()){p.show()}p.repaint();var m=this._customTileLayers.length;for(var c=0;c<m;c++){var k=this._customTileLayers[c];var b=k.getTile(h,g);if(b==null){continue}if(!k.visible()){b.hide();continue}if(!b.isVisible()){b.show()}b.repaint()}if((this._objects_index[h]!=null)&&(this._objects_index[h][g]!=null)){var o=this._objects_index[h][g];if(o.length==0){return}m=o.length;for(var q=0;q<m;q++){var e=o[q];if(e.visible()){if(f.indexOf(e)<0){f.push(e)}var l=d.indexOf(e);if(l>=0){d.splice(l,1)}e._repaint()}else{if(d.indexOf(e)>=0){continue}d.push(e)}}}}else{if(p.isVisible()){p.hide()}m=this._customTileLayers.length;for(c=0;c<m;c++){k=this._customTileLayers[c];b=k.getTile(h,g);if(b==null){continue}if(b.isVisible()){b.hide()}}if((this._objects_index[h]!=null)&&(this._objects_index[h][g]!=null)){o=this._objects_index[h][g];if(o.length==0){return}m=o.length;for(q=0;q<m;q++){e=o[q];if(e.displayed()){if(f.indexOf(e)>=0){continue}if(d.indexOf(e)>=0){continue}d.push(e)}}}}};VMap.prototype._onKeyDown=function(g){if(!this._mouse_over){return}var f=this._currentMap;if(!g){g=window.event}var d=g.keyCode;var a=false;var c=f._left;var b=f._top;switch(d){case 38:b+=Math.round(VIEWPORT_WIDTH/10);a=true;break;case 40:b-=Math.round(VIEWPORT_WIDTH/10);a=true;break;case 37:c+=Math.round(VIEWPORT_HEIGHT/10);a=true;break;case 39:c-=Math.round(VIEWPORT_HEIGHT/10);a=true;break;case 33:b+=Math.round(VIEWPORT_WIDTH/2);a=true;break;case 34:b-=Math.round(VIEWPORT_WIDTH/2);a=true;break;case 36:c+=Math.round(VIEWPORT_WIDTH/2);a=true;break;case 35:c-=Math.round(VIEWPORT_WIDTH/2);a=true;break}if(a){if(((c<=0)&&(c+f._width>VIEWPORT_WIDTH))||((c>0)&&(c+f._width<=VIEWPORT_WIDTH))){f._left=Math.round(c)}if(((b<=0)&&(b+f._height>VIEWPORT_HEIGHT))||((b>0)&&(b+f._height<=VIEWPORT_HEIGHT))){f._top=Math.round(b)}f.repaintMap()}};VMap.prototype._onMouseWheel=function(b){if(!this._isMouseOnViewport(this._mouse_point.x,this._mouse_point.y)){return}var c=0;if(!b){b=window.event}if(!this._mouse_over){return}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}if(b.wheelDelta){c=b.wheelDelta/120}else{if(b.detail){c=-b.detail/3}}if(this.MOUSE_WHEEL_INDEX==null){this.MOUSE_WHEEL_INDEX=this.zoom()}var a=this.MOUSE_WHEEL_INDEX+((c<0)?-1:1);if(!this._checkZoom(a)){return}if(Math.abs(a-this.zoom())>2){return}this.MOUSE_WHEEL_INDEX=a;if(this._zoomControl.options("smooth")){this._zoom_helper.run(a,{x:b.clientX,y:b.clientY})}this._zoomControl.position(this.MOUSE_WHEEL_INDEX);this._startMouseWheelTimer(this._mouse_point)};VMap.prototype.MOUSE_WHEEL_INDEX;VMap.prototype.MOUSE_WHEEL_TIMER=null;VMap.MOUSE_WHEEL_TIMER_INTERVAL=200;VMap.prototype._startMouseWheelTimer=function(a){this._clearMouseWheelTimer();var b=Math.random();VMap.MAPS[b]=this;this.MOUSE_WHEEL_TIMER=setTimeout("VMap.MOUSE_WHEEL_ZOOM("+b+", { x: "+a.x+", y: "+a.y+" })",VMap.MOUSE_WHEEL_TIMER_INTERVAL)};VMap.prototype._clearMouseWheelTimer=function(){clearTimeout(this.MOUSE_WHEEL_TIMER)};VMap.MOUSE_WHEEL_ZOOM=function(c,a){var b=VMap.MAPS[c];if(b==null){return}VInfoWindow._changeWindow();b._zoomByPoint(a,b.MOUSE_WHEEL_INDEX);b.MOUSE_WHEEL_INDEX=null;b.repaint();b._clearMouseWheelTimer()};VMap.prototype._setZoom=function(a){this._clearSmoothTimer();VMarker._closeCurrentHint();this._zoom_index=a;this._zoomControl.position(a);if(this._maps[a]==null){return}if(this._currentMap!=null){this._hide()}this._currentMap=this._maps[a];this._currentMap._tiles_map=[];var b=this._currentMap;b._current_min_i=null;b._current_max_i=null;b._current_min_j=null;b._current_max_j=null};VMap.prototype._zoomByPoint=function(c,d){if(!this._checkZoom(d)){return}if(!this.beforezoomchange(null,d)){return this}var f=VisicomUtils.getBounds(this._viewport);var b=c.x-f.left+VisicomUtils.getClientsLeft();var a=c.y-f.top+VisicomUtils.getClientsTop();this._setZoom(d);var h=this._currentMap;if(h==null){return this}var g=this._current_zoom_point;var e=this._convertToScreenCoords(g);h._left=Math.round(b-e.x);h._top=Math.round(a-e.y);this._checkPosition();this._initLayers();this.repaint();this.onzoomchange();return this};VMap.prototype._hideTiles=function(){var d=this._currentMap;for(var b=d._current_min_i;b<=d._current_max_i;b++){if(this._tiles[b]==null){continue}for(var a=d._current_min_j;a<=d._current_max_j;a++){var c=this._tiles[b][a];if(c!=null){c.hide()}}}delete (this._tiles);this._tiles=[]};VMap.prototype._hide=function(){var e=this._currentMap;for(var c=e._current_min_i;c<=e._current_max_i;c++){if(this._tiles[c]==null){continue}for(var a=e._current_min_j;a<=e._current_max_j;a++){var d=this._tiles[c][a];if(d!=null){d.hide()}}}delete (this._tiles);this._tiles=[];for(var f=0;f<this._customTileLayers.length;f++){var b=this._customTileLayers[f];for(c=e._current_min_i;c<=e._current_max_i;c++){for(a=e._current_min_j;a<=e._current_max_j;a++){d=b.getTile(c,a);if(d==null){continue}d.hide()}}}this._hideLayers();e._current_min_i=e._current_max_i=e._current_min_j=e._current_max_j=null};VMap.prototype.zoom=function(a){if(arguments.length==0){return this._zoom_index}a=parseInt(a);if(this._zoom_index==a){return this}if(this._maps[a]==null){return this}var b=VisicomUtils.getBounds(this._viewport);var c={x:this._width/2+b.left-VisicomUtils.getClientsLeft(),y:this._height/2+b.top-VisicomUtils.getClientsTop()};this._zoom_index=a;VInfoWindow._changeWindow();this._current_zoom_point=this.center();this._zoomByPoint(c,a);return this};VMap.prototype.zoomIn=function(){this._mouse_down=false;var a=this._currentMap._zoom_index+1;if(this._zoom_index==a){return this}if(this._maps[a]==null){return this}var b=VisicomUtils.getBounds(this._viewport);var c={x:this._width/2+b.left-VisicomUtils.getClientsLeft(),y:this._height/2+b.top-VisicomUtils.getClientsTop()};if(this._zoomControl.options("smooth")){this._zoom_helper.run(a,c)}this.zoom(a);return this};VMap.prototype.zoomOut=function(){this._mouse_down=false;var a=this._currentMap._zoom_index-1;if(this._zoom_index==a){return this}if(this._maps[a]==null){return this}var b=VisicomUtils.getBounds(this._viewport);var c={x:this._width/2+b.left-VisicomUtils.getClientsLeft(),y:this._height/2+b.top-VisicomUtils.getClientsTop()};if(this._zoomControl.options("smooth")){this._zoom_helper.run(a,c)}this.zoom(a);return this};VMap.prototype.center=function(d,a){if(arguments.length==0){return this._center}a=(a)?parseInt(a):a;var c=this.zoom();var f=this.center();if(!f){f={lng:-1,lat:-1}}if(d instanceof VRect){this._center=d.center();a=this._getMinZoom(d);if(!this.beforezoomchange(null,a)){return this}this._setZoom(a)}else{if(a!=null){if(!this.beforezoomchange(null,a)){return this}this._setZoom(a)}if(d instanceof Array){this._center=d[0]}else{this._center=d}}var e=this._currentMap;if(e==null){return this}if(f.lng!=this._center.lng||f.lat!=this._center.lat){this._hide();var b=this._convertToScreenCoords(this._center);e._left=Math.round((this._width/2)-b.x);e._top=Math.round((this._height/2)-b.y);this._checkPosition()}if(c!=a){this._initLayers();this.onzoomchange()}this.repaint();return this};VMap.prototype.clientRect=function(){var b=this._convertToGeoCoords(-this._currentMap._left,this._height-this._currentMap._top,this._currentMap._units_per_pixel);var a=this._convertToGeoCoords(this._width-this._currentMap._left,-this._currentMap._top,this._currentMap._units_per_pixel);var c=new VRect(b,a);return c};VMap.prototype._repaintLogo=function(){if(this._logo==null){this._logo=document.getElementById("visicom_copyright_link");if(this._logo==null){this._logo=document.createElement("a");this._logo.href="http://maps.visicom.ua";this._viewport.appendChild(this._logo)}this._logo.href="http://maps.visicom.ua/";this._logo.target="_blank";this._logo.style.position="absolute";this._logo.style.right="2px";this._logo.style.bottom="2px";this._logo.style.zIndex=VisicomCommons.ZINDEX_LOGO;this._logo.style.marginLeft="0px";this._logo.style.marginRight="0px";this._logo.style.marginTop="0px";this._logo.style.marginBottom="0px";this._logo.style.maxWidth="none";this._logo.style.maxHeight="none";if(USER_DATA.Browser.MSIE){this._logo.innerHTML='<img style="background: none;" border="0" width="132" height="21" src="'+VisicomCommons.API_URL+'/images/blank.gif" style="FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/logo-with-alpha.png');\" />"}else{this._logo.innerHTML='<img style="background: none;" border="0" width="132" height="21"  src="'+VisicomCommons.API_URL+'/images/logo-with-alpha.png">'}}};VMap.prototype._checkResize=function(){this._width=this._viewport.offsetWidth||parseInt(this._viewport.style.width);this._height=this._viewport.offsetHeight||parseInt(this._viewport.style.height);this._viewport_inner.style.width=this._width+"px";this._viewport_inner.style.height=this._height+"px";this._map_div.style.width=this._width+VMapTile.TILE_WIDTH*2+"px";this._map_div.style.height=this._height+VMapTile.TILE_HEIGHT*2+"px";this._repaintLogo()};VMap.prototype._initObjectsIndex=function(){delete (this._objects_index);this._objects_index=[]};VMap.prototype._addObject=function(b){if(this._currentMap==null){return}var f=this._currentMap;if(!b._coords[0]){return}var e=this._convertToScreenCoords(b._coords[0]);var d=Math.floor((Math.abs(e.x))/VMapTile.TILE_WIDTH);var c=Math.floor((f._height-e.y)/VMapTile.TILE_HEIGHT);if(b._coords.length>1){for(var h=1;h<b._coords.length;h++){e=this._convertToScreenCoords(b._coords[h]);var a=Math.floor((Math.abs(e.x))/VMapTile.TILE_WIDTH);var g=Math.floor((f._height-e.y)/VMapTile.TILE_HEIGHT);this._addObjectToIndex(a,g,b)}}else{this._addObjectToIndex(d,c,b)}};VMap.prototype._removeObject=function(b){var a=b.bounds();if(a==null){return}var m=a.leftBottom();var h=a.rightTop();var l=this._convertToScreenCoords(m);var f=Math.floor((Math.abs(l.x))/VMapTile.TILE_WIDTH);var d=Math.floor((this._currentMap._height-l.y)/VMapTile.TILE_HEIGHT);l=this._convertToScreenCoords(h);var k=Math.floor((Math.abs(l.x))/VMapTile.TILE_WIDTH);var g=Math.floor((this._currentMap._height-l.y)/VMapTile.TILE_HEIGHT);for(var e=f;e<=k;e++){for(var c=d;c<=g;c++){this._removeObjectFromIndex(e,c,b)}}};VMap.prototype._addObjectToIndex=function(c,b,a){var d=this._objects_index[c];if(d==null){this._objects_index[c]=[]}d=this._objects_index[c][b];if(d==null){d=this._objects_index[c][b]=[]}if(this._objects_index[c][b].indexOf(a)>=0){return}this._objects_index[c][b].push(a)};VMap.prototype._removeObjectFromIndex=function(c,b,a){var f=this._objects_index[c];if(f==null){return}f=f[b];if(f==null){return}for(var e=0;e<f.length;e++){var d=f[e];if(a!=d){continue}f.splice(e,1);break}};VMap.prototype.mapname=function(){return VisicomCommons.MAP_NAME};VMap.prototype.language=function(c,b){if(arguments.length==0){return this._language}var a=this;VRemoteCall.request("language",this._mapName+"_"+c,function(j){var g=VisicomCommons.convertToGeoProjection(j.bounds[0].x,j.bounds[0].y);var d=VisicomCommons.convertToGeoProjection(j.bounds[1].x,j.bounds[1].y);a._bounds=new VRect(g,d);var e=j.zooms;for(var f=0;f<e.length;f++){var h=e[f];var k=a._maps[f];k._base_url=h.base_url;k._units_per_pixel=h.units_per_pixel}a._language=c;a._hideTiles();a.repaint();if(b!=null){b()}});return this};VMap.prototype._convertToScreenCoords=function(e,c){var d=(c!=null)?c:this._currentMap._units_per_pixel;var b=VisicomCommons.convertFromGeoProjection(e);b.x+=this.__maxLng;b.y=this.__maxLat-b.y;var a=b.x/d;var f=b.y/d;return{x:a,y:f}};VMap.prototype._convertToGeoCoords=function(c,b,d){var e=(d!=null)?d:this._currentMap._units_per_pixel;var a=c*e-this.__maxLng;var g=this.__maxLat-b*e;var f=VisicomCommons.convertToGeoProjection(a,g);return f};VMap.prototype._getMinZoom=function(e){var a=this._maps.length-1;if(e.leftBottom().lng==e.rightTop().lng&&e.leftBottom().lat==e.rightTop().lat){return a}for(var c=this._maps.length-1;c>=0;c--){var f=this._maps[c];var g=this._convertToScreenCoords(e.leftBottom(),f._units_per_pixel);var d=this._convertToScreenCoords(e.rightTop(),f._units_per_pixel);var h=d.x-g.x;var b=g.y-d.y;if((this._width>=h)&&(this._height>=b)){a=f._zoom_index;break}}return a};VMap.prototype._pre_add=function(a){if(a instanceof VCustomTileLayer){this._customTileLayers.push(a);a._parent_map=this}a._init()};VMap.prototype._pre_remove=function(b){if(b instanceof VCustomTileLayer){var a=this._customTileLayers.indexOf(b);this._customTileLayers.splice(a,1)}};VMap.prototype._initLayers=function(){this._childs.forEach(function(a){a._init()})};VMap.prototype._hideLayers=function(){var d=this._currentMap;for(var c=d._current_min_i;c<=d._current_max_i;c++){for(var b=d._current_min_j;b<=d._current_max_j;b++){var a=this._objects_index[c];if(a==null){continue}a=a[b];if(a==null){continue}a.forEach(function(e){if(e.displayed()){e._hide()}})}}};VMap.string2lnglat=function(b){var a;if((a=/(\d+\.\d+)\s*N\s*,\s*(\d+\.\d+)\s*E/.exec(b))!=null){return{lng:parseFloat(a[2]),lat:parseFloat(a[1])}}else{if((a=/(\d+\.\d+)\s*,\s*(\d+\.\d+)/.exec(b))!=null){return{lng:parseFloat(a[2]),lat:parseFloat(a[1])}}else{if((a=/(\d+\.\d+)\s*(\d+\.\d+)/.exec(b))!=null){return{lng:parseFloat(a[2]),lat:parseFloat(a[1])}}}}return{lng:0,lat:0}};var VOsmMix={};VOsmMix.extend=function(c,a){function b(){if(a.show_switcher===true){this.showSwitcher()}}b.prototype=c;b.prototype.osmTms=new VCustomTileLayer();b.prototype.osmTms.getTileURL=function(e,d){var g=this._parent_map.zoom();var h=Math.pow(2,g)-1-d;var f=(function(){var i=["a","b","c"];return i[(Math.floor(i.length*Math.random()))]})();return"http://"+f+".tile.openstreetmap.org/"+g+"/"+e+"/"+h+".png"};b.prototype.addOsmTile=function(){this.add(this.osmTms);this.repaint()};b.prototype.dropOsmTile=function(){this.remove(this.osmTms);this.repaint()};b.prototype.showSwitcher=function(){var f=this;var d=document.createElement("div");d.style.zIndex=700;d.style.position="absolute";d.style.top="10px";d.style.right="10px";var e=document.createElement("select");e.onchange=function(){if(this.value==="osm"){f.addOsmTile()}else{f.dropOsmTile()}};e.options[0]=new Option("visicom");e.options[1]=new Option("osm");d.appendChild(e);this._viewport.appendChild(d)};new b();return};VMapZoom.prototype._map;VMapZoom.prototype._left;VMapZoom.prototype._top;VMapZoom.prototype._width;VMapZoom.prototype._height;VMapZoom.prototype._base_url;VMapZoom.prototype._zoom_index;VMapZoom.prototype._units_per_pixel;VMapZoom.prototype._screenOffset;VMapZoom.prototype._x_tiles_count;VMapZoom.prototype._y_tiles_count;VMapZoom.prototype._tiles_map=[];VMapZoom.prototype._current_min_i=null;VMapZoom.prototype._current_min_j=null;VMapZoom.prototype._current_max_i=null;VMapZoom.prototype._current_max_j=null;function VMapZoom(c,a,b,d){this._width=c;this._height=a;this._zoom_index=b;this._map=d;this._x_tiles_count=Math.round(this._width/VMapTile.TILE_WIDTH);this._y_tiles_count=Math.round(this._height/VMapTile.TILE_HEIGHT);this._left=Math.round((d._width-this._width)/2);this._top=Math.round((d._height-this._height)/2);this._tiles_map=[];return this}VMapZoom.prototype._check_tiles=function(){for(var b=this._current_min_i;b<=this._current_max_i;b++){for(var a=this._current_min_j;a<=this._current_max_j;a++){if(this._tiles_map[b]==null){return}if(!this._tiles_map[b][a]){return}}}this._map.onpaint()};VMapZoom.prototype._tile_loaded=function(b,a){if(this._tiles_map[b]==null){this._tiles_map[b]=[]}this._tiles_map[b][a]=true;this._check_tiles()};VMapTile.TILE_WIDTH=256;VMapTile.TILE_HEIGHT=256;VMapTile.TMS_NUMBER=0;VMapTile.MAX_TMS_NUMBER=2;function VMapTile(a,c,b){this._x=a;this._y=c;this._left=this._x*VMapTile.TILE_WIDTH;this._top=(b._currentMap._height-VMapTile.TILE_HEIGHT)-this._y*VMapTile.TILE_HEIGHT;this._parent_map=b;this._error_counter=0;return this}VMapTile.prototype._parent_map;VMapTile.prototype._x;VMapTile.prototype._y;VMapTile.prototype._left;VMapTile.prototype._top;VMapTile.prototype._width;VMapTile.prototype._height;VMapTile.prototype._tile=null;VMapTile.prototype._visible=false;VMapTile.prototype.getX=function(){return this._x};VMapTile.prototype.getY=function(){return this._y};VMapTile.prototype.getLeft=function(){return this._left};VMapTile.prototype.getTop=function(){return this._top};VMapTile.prototype.isVisible=function(){return this._visible};VMapTile.prototype._error_counter;VMapTile.prototype.getDOMElement=function(){return this._tile};VMapTile.getTmsNumber=function(a,b){return((a%2>0)?0:1)+((b%2>0)?0:1)};VMapTile.prototype.show=function(){if(this._tile==null){this._tile=document.createElement("img");this._tile.id="tile_"+this._parent_map.zoom()+"_"+this._x+"_"+this._y;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";var a=this._parent_map._currentMap._base_url;a=a.replace(/tms\./,"tms"+VMapTile.getTmsNumber(this._x,this._y)+".");this._tile.src=a+"/"+this._x+"/"+this._y+".png";if(this._tile.complete){this._tile.style.display="block"}var b=this;this._tile.onload=function(){b._tile.style.display="block";b._parent_map._currentMap._tile_loaded(b._x,b._y)};this._tile.style.zIndex="101";this._tile.onerror=function(c){b._error_counter++;if(b._error_counter>VMapTile.MAX_TMS_NUMBER){b._tile.onerror=null;return}VMapTile.TMS_NUMBER++;if(VMapTile.TMS_NUMBER>VMapTile.MAX_TMS_NUMBER){VMapTile.TMS_NUMBER=0}a=b._parent_map._currentMap._base_url;a=a.replace(/tms\./,"tms"+VMapTile.TMS_NUMBER+".");b._tile.src=a+"/"+b._x+"/"+b._y+".png"}}this._parent_map.getTilesDOMElement().appendChild(this._tile);this._visible=true};VMapTile.prototype.repaint=function(){if(this._tile==null){return}var b=0;var a=0;this._tile.style.left=b+this._parent_map._currentMap._left+this._left+VMapTile.TILE_WIDTH+"px";this._tile.style.top=a+this._parent_map._currentMap._top+this._top+VMapTile.TILE_HEIGHT+"px"};VMapTile.prototype.hide=function(){try{this._parent_map.getTilesDOMElement().removeChild(this._tile)}catch(a){}this._visible=false};VZoomHelper.prototype.map;VZoomHelper.prototype.tiles;VZoomHelper.prototype.base_width;VZoomHelper.prototype.base_height;VZoomHelper.prototype.current_width;VZoomHelper.prototype.current_height;VZoomHelper.prototype.next_width;VZoomHelper.prototype.next_height;VZoomHelper.prototype.current_zoom;VZoomHelper.prototype.dest_zoom;VZoomHelper.prototype.div;VZoomHelper.prototype.is_run;VZoomHelper.prototype.onpaint;VZoomHelper.prototype.center;VZoomHelper.prototype._isMousedown;VZoomHelper.prototype._mouseCoords;VZoomHelper.prototype.coords;VZoomHelper.prototype.counter;VZoomHelper.prototype.clear_timer;VZoomHelper.prototype.steps;VZoomHelper.steps=8;VZoomHelper.delay=40;function VZoomHelper(a){this.map=a;this._isMousedown=false;var b=this;this.map.onpaint(function(){b.onpaint=true;if(b.div==null){return}if(b.is_run){return}var c=Math.random();VZoomHelper.INSTANCES[c]=b;b.clear_timer=setTimeout("VZoomHelper.clear("+c+");",10)})}VZoomHelper.prototype.create=function(){this.tiles=[];this.center=this.map.center();var e=this.map._currentMap;if(this.div!=null){this.map.getViewport().removeChild(this.div)}this.div=document.createElement("div");this.div.style.position="absolute";this.div.style.left="0px";this.div.style.top="0px";this.div.style.width=this.map._width+"px";this.div.style.height=this.map._height+"px";this.div.style.zIndex=VisicomCommons.ZINDEX_SMOOTH_LAYER;this.map.getViewport().appendChild(this.div);var f=this;this._mouseCoords={};VisicomUtils.addHandler(document,"mousedown",function(g){if(!g){g=window.event}f.mousedown(g)});VisicomUtils.addHandler(document,"mousemove",function(g){if(!f._isMousedown){return}f.mousemove(g)});VisicomUtils.addHandler(document,"mouseup",function(g){if(!g){g=window.event}f._isMousedown=false;if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}});for(var c=e._current_min_i;c<=e._current_max_i;c++){if(this.map._tiles[c]==null){continue}for(var a=e._current_min_j;a<=e._current_max_j;a++){var d=this.map._tiles[c][a];var b=d.getDOMElement();d.left=b.offsetLeft-VMapTile.TILE_WIDTH;d.top=b.offsetTop-VMapTile.TILE_HEIGHT;d.width=b.offsetWidth;d.height=b.offsetHeight;this.setData(d);this.div.appendChild(b);this.tiles.push(d)}}};VZoomHelper.prototype.mousemove=function(a){if(!a){a=window.event}if(this.div==null){return}this.div.style.left=this.div.offsetLeft+(a.clientX-this._mouseCoords.x)+"px";this.div.style.top=this.div.offsetTop+(a.clientY-this._mouseCoords.y)+"px";this._mouseCoords.x=a.clientX;this._mouseCoords.y=a.clientY;if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}};VZoomHelper.prototype.mousedown=function(a){if(this.div==null){return}this._isMousedown=true;this._mouseCoords.x=a.clientX;this._mouseCoords.y=a.clientY;if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}};VZoomHelper.prototype.setNext=function(){var a=(this.dest_zoom>this.current_zoom)?1:-1;var c=Math.abs(this.dest_zoom-this.current_zoom);this.steps=VZoomHelper.steps;var b=Math.pow(Math.abs(this.dest_zoom-this.current_zoom),2)/this.steps;if(a<0){b=b/2}this.next_width=this.current_width+a*b*this.current_width;this.next_height=this.current_height+a*b*this.current_height};VZoomHelper.prototype.setData=function(b){var a=b.getDOMElement();a.style.left=b.left+"px";a.style.top=b.top+"px";a.style.width=b.width+"px";a.style.height=b.height+"px"};VZoomHelper.prototype.run=function(a,b){this.dest_zoom=a;this.coords=b;if(this.is_run){return}if(this.clear_timer!=null){clearTimeout(this.clear_timer);this.clear_timer=null}this.create();this.current_zoom=this.map.zoom();this.current_width=VMapTile.TILE_WIDTH;this.current_height=VMapTile.TILE_HEIGHT;this.base_width=VMapTile.TILE_WIDTH;this.base_height=VMapTile.TILE_WIDTH;this.next_width=this.current_width;this.next_height=this.current_height;this.counter=0;this.map.getDOMElement().style.display="none";this.map.getTilesDOMElement().style.display="none";var c=Math.random();VZoomHelper.INSTANCES[c]=this;setTimeout("VZoomHelper.onTimer("+c+");",20);this.is_run=true;this.onpaint=false};VZoomHelper.INSTANCES=[];VZoomHelper.onTimer=function(e){var d=VZoomHelper.INSTANCES[e];d.counter++;if(d.counter>=d.steps-1){VZoomHelper.INSTANCES[e]=null;d.stop();return}d.setNext();var c=VisicomUtils.getBounds(d.map._viewport);for(var a in d.tiles){if(a=="forEach"||a=="indexOf"||a==""){continue}var b=d.tiles[a];b.left+=((d.coords.x-b.left-c.left+VisicomUtils.getClientsLeft())/d.current_width)*(d.current_width-d.next_width);b.top+=((d.coords.y-b.top-c.top+VisicomUtils.getClientsTop())/d.current_height)*(d.current_height-d.next_height);b.width=d.next_width+1;b.height=d.next_height+1;d.setData(b)}d.current_width=d.next_width;d.current_height=d.next_height;setTimeout("VZoomHelper.onTimer("+e+");",VZoomHelper.delay)};VZoomHelper.prototype.stop=function(){this.is_run=false;this.map.getDOMElement().style.display="block";this.map.getTilesDOMElement().style.display="block";if(!this.onpaint){return}var a=Math.random();VZoomHelper.INSTANCES[a]=this;this.clear_timer=setTimeout("VZoomHelper.clear("+a+");",20)};VZoomHelper.clear=function(c){var b=VZoomHelper.INSTANCES[c];try{b.map.getViewport().removeChild(b.div)}catch(a){}b.div=null;VZoomHelper.INSTANCES[c]=null;b.is_run=false};var VisicomUtils=(function(){function e(h){if(h==null){return(null)}var k=h.offsetLeft;var j=h.offsetTop;for(var i=h.offsetParent;i;i=i.offsetParent){k+=i.offsetLeft;j+=i.offsetTop}return{left:k,top:j,width:h.offsetWidth,height:h.offsetHeight}}function a(){var h=self.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop);return h}function d(){var h=self.pageXOffset||(document.documentElement&&document.documentElement.scrollLeft)||(document.body&&document.body.scrollLeft);return h}function b(h){if(h.style.align){h.style.align="none"}if(h.style.backgroundColor){h.style.backgroundColor="none"}h.style.backgroundImage="none";if(h.style.margin){h.style.margin="none"}h.style.marginBottom="0px";h.style.marginLeft="0px";h.style.marginRight="0px";h.style.marginLeft="0px";if(h.style.padding){h.style.padding="none"}if(h.style.border){h.style.border="none"}h.style.fontSize="0px";h.style.outline="none";h.style.verticalAlign="baseline"}function f(i,k,j,h){if(i.addEventListener){i.addEventListener(k,j,h?h:false)}else{if(i.attachEvent){i.attachEvent("on"+k,j)}}}function c(m){var k="0123456789ABCDEF";if(m<0){return"00"}if(m>255){return"FF"}var l=Math.floor(m/16);var h=m%16;return k.charAt(l)+k.charAt(h)}function g(i,h){for(var j in i){h[j]=i[j]}}return{getBounds:e,getClientsTop:a,getClientsLeft:d,addHandler:f,toHex:c,clearStyles:b,copy:g}})();VRect.prototype=new VMapObject();VRect.prototype.leftBottom=function(){return this._coords[0]};VRect.prototype.rightTop=function(){return this._coords[1]};function VRect(){VMapObject.call(this);if(arguments.length==1){this._coords=(arguments[0] instanceof Array)?this.create(arguments[0]):this.create([arguments[0]])}else{if(arguments.length==2){this._coords[0]=arguments[0];this._coords[1]=arguments[1]}}return this}VRect.prototype.contains=function(a){return(a.lng>=this._coords[0].lng)&&(a.lng<=this._coords[1].lng)&&(a.lat>=this._coords[0].lat)&&(a.lat<=this._coords[1].lat)};VRect.prototype.create=function(g){var a=null;var c=null;var b=null;var e=null;var d=function(k){if(k[0] instanceof Array){for(var j=0;j<k.length;j++){d(k[j])}return}for(var j=0;j<k.length;j++){var f=k[j];var h=f.lng;var l=f.lat;if((h<a)||(a==null)){a=h}if((l<c)||(c==null)){c=l}if((h>b)||(b==null)){b=h}if((l>e)||(e==null)){e=l}}};d(g);return[{lng:a,lat:c},{lng:b,lat:e}]};VRect.prototype.center=function(){var a=this.leftBottom().lng+(this.rightTop().lng-this.leftBottom().lng)/2;var b=this.leftBottom().lat+(this.rightTop().lat-this.leftBottom().lat)/2;return{lng:a,lat:b}};VZoomControl.prototype=new VMapObject();VZoomControl.prototype._zoom_in;VZoomControl.prototype._ruler;VZoomControl.prototype._runner;VZoomControl.prototype._zoom_out;VZoomControl.ZOOM_IN_WIDTH=17;VZoomControl.ZOOM_OUT_WIDTH=17;VZoomControl.ZOOM_IN_HEIGHT=17;VZoomControl.ZOOM_OUT_HEIGHT=17;VZoomControl.RULER_ITEM_WIDTH=17;VZoomControl.RULER_ITEM_TOP_HEIGHT=16;VZoomControl.RULER_ITEM_MIDDLE_HEIGHT=14;VZoomControl.RULER_ITEM_BOTTOM_HEIGHT=16;function VZoomControl(b,a){VMapObject.call(this,null,a);this._parent=b;return this}VZoomControl.prototype.getDOMElement=function(){return this._div};VZoomControl.prototype._createRuler=function(){this._ruler=document.createElement("div");this._ruler.style.position="relative";this._ruler.style.background="none";this._ruler.style.zIndex=VisicomCommons.ZINDEX_CONTROLS;this._ruler.style.padding="0px";this._ruler.style.border="0px";this._ruler.style.width=VZoomControl.RULER_ITEM_WIDTH+"px";this._ruler.style.cursor="pointer";var h=(this.options("max")!=null)?this.options("max"):this._parent._maps.length-1;var c=(this.options("min")!=null)?this.options("min"):0;var g=h-c;this._ruler.style.height=((g+1)*VZoomControl.RULER_ITEM_MIDDLE_HEIGHT)+"px";for(var d=g;d>=0;d--){var k=document.createElement("img");this._ruler.appendChild(k);k.style.position="absolute";k.style.border="0px";k.style.cursor="pointer";k.style.margin="0px";k.style.left="0px";var a=g-d;if(d==g){k.src=VisicomCommons.API_URL+"/images/zoom/ruler-top.gif";k.style.width=VZoomControl.RULER_ITEM_WIDTH+"px";k.style.height=VZoomControl.RULER_ITEM_TOP_HEIGHT+"px";k.style.top=(a*VZoomControl.RULER_ITEM_MIDDLE_HEIGHT)+"px"}else{if(d==0){k.src=VisicomCommons.API_URL+"/images/zoom/ruler-bottom.gif";k.style.width=VZoomControl.RULER_ITEM_WIDTH+"px";k.style.height=VZoomControl.RULER_ITEM_BOTTOM_HEIGHT+"px";k.style.top=(a*VZoomControl.RULER_ITEM_MIDDLE_HEIGHT)+"px"}else{k.src=VisicomCommons.API_URL+"/images/zoom/ruler-middle.gif";k.style.width=VZoomControl.RULER_ITEM_WIDTH+"px";k.style.height=VZoomControl.RULER_ITEM_MIDDLE_HEIGHT+"px";k.style.top=(a*VZoomControl.RULER_ITEM_MIDDLE_HEIGHT)+"px"}}}this._runner=document.createElement("div");var e=document.createElement("img");e.src=VisicomCommons.API_URL+"/images/zoom/runner.gif";e.style.border="0px";this._runner.appendChild(e);this._runner.style.position="absolute";this._runner.style.width=VZoomControl.RULER_ITEM_WIDTH+"px";this._runner.style.height=VZoomControl.RULER_ITEM_TOP_HEIGHT+"px";this._runner.style.border="0px";this._runner.style.cursor="pointer";this._ruler.appendChild(this._runner);var f=this;var j=false;function b(m){var l=VisicomUtils.getBounds(f._ruler);var i=Math.floor((m.clientY-l.top+VisicomUtils.getClientsTop())/VZoomControl.RULER_ITEM_MIDDLE_HEIGHT);i=h-i;return(i>h?h:(i<c?c:i))}this._ruler.onmousedown=function(m){if(!m){m=window.event}var i=b(m);var l=f._parent;if(i<c||i>h){l.zoom((i<c)?0:h);return}if(l.zoom()!=i){l.zoom(i)}j=true;if(m.stopPropagation){m.stopPropagation()}else{m.cancelBubble=true}if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};VisicomUtils.addHandler(document,"mouseup",function(m){if(!j){return}if(!m){m=window.event}var i=b(m);var l=f._parent;if(i<c||i>h){l.zoom((i<c)?0:h);return}if(l.zoom()!=i){l.zoom(i)}j=false});this._ruler.onmousemove=function(m){if(!j){return}if(!m){m=window.event}var i=b(m);var l=f._parent;if(i<c||i>h){l.zoom((i<c)?0:h);return}f.position(i);if(m.stopPropagation){m.stopPropagation()}else{m.cancelBubble=true}if(m.preventDefault){m.preventDefault()}else{m.returnValue=false}};this._div.appendChild(this._ruler)};VZoomControl.prototype._createDOMElement=function(){this._div=document.createElement("div");this._div.style.position="absolute";this._div.style.background="none";this._div.style.zIndex=VisicomCommons.ZINDEX_CONTROLS;this._div.style.padding="0px";this._div.style.margin="0px";this._div.style.border="0px";this._div.style.left=(this.options("left")?this.options("left"):10)+"px";this._div.style.top=(this.options("top")?this.options("top"):10)+"px";var d=this;this._zoom_in=document.createElement("div");var b=document.createElement("img");b.src=VisicomCommons.API_URL+"/images/zoom/zoom-in.gif";b.style.border="0px";this._zoom_in.appendChild(b);this._zoom_in.style.position="relative";this._zoom_in.style.width=VZoomControl.ZOOM_IN_WIDTH+"px";this._zoom_in.style.height=VZoomControl.ZOOM_IN_HEIGHT+"px";this._zoom_in.src=VisicomCommons.API_URL+"/images/zoom/zoom-in.gif";this._zoom_in.style.border="0px";this._zoom_in.style.cursor="pointer";var a=(this.options("max")!=null)?this.options("max"):this._parent._maps.length-1;var c=(this.options("min")!=null)?this.options("min"):0;this._zoom_in.onclick=function(h){var g=d._parent;var f=g.zoom()+1;if(f<c||f>a){return}d._parent.zoomIn()};this._div.appendChild(this._zoom_in);this._createRuler();if(this.options("ruler")==false){this._ruler.style.display="none";this._zoom_in.style.marginBottom="3px"}this._zoom_out=document.createElement("div");b=document.createElement("img");b.src=VisicomCommons.API_URL+"/images/zoom/zoom-out.gif";b.style.border="0px";this._zoom_out.appendChild(b);this._zoom_out.style.position="relative";this._zoom_out.style.width=VZoomControl.ZOOM_OUT_WIDTH+"px";this._zoom_out.style.height=VZoomControl.ZOOM_OUT_HEIGHT+"px";this._zoom_out.style.border="0px";this._zoom_out.style.cursor="pointer";this._zoom_out.onclick=function(h){var g=d._parent;var f=g.zoom()-1;if(f<c||f>a){return}d._parent.zoomOut()};this._div.appendChild(this._zoom_out);if(this.options("visible")!=false){this._parent._viewport.appendChild(this._div)}};VZoomControl.prototype.position=function(b){if(b==null){return this}if(this._runner==null){return this}var a=(this.options("max")!=null)?this.options("max"):this._parent._maps.length-1;var c=a-b;this._runner.style.top=(c*VZoomControl.RULER_ITEM_MIDDLE_HEIGHT)+"px";return this};VZoomControl.prototype.visible=function(b){if(b==null){return this._visible}try{if(b){this._parent._viewport.appendChild(this._div)}else{this._parent._viewport.removeChild(this._div)}}catch(a){}this._visible=b;return this};VZoomControl.prototype.options=function(a,b){if(arguments.length==0){return this._options}if(b==null){return this._options[a]}this._options[a]=b;switch(a){case"ruler":if(b){this._ruler.style.display="none"}else{this._ruler.style.display="block"}break}return this};VMarkerIcon.prototype._width=null;VMarkerIcon.prototype._height=null;VMarkerIcon.prototype._image_src=null;VMarkerIcon.prototype._alpha_enable=false;VMarkerIcon.prototype.width=function(){return this._width};VMarkerIcon.prototype.height=function(){return this._height};VMarkerIcon.prototype.source=function(){return this._image_src};function VMarkerIcon(d,a,c,b){this._width=d;this._height=a;this._image_src=c;if(b!=null){this._alpha_enable=b}return this}VMarkerIcon.prototype.alphaEnable=function(a){if(a==null){return this._alpha_enable}this._alpha_enable=a;return this};VMarkerIcon.MARKER_WIDTH=30;VMarkerIcon.MARKER_HEIGHT=28;var DEFAULT_MARKER_ICON=new VMarkerIcon(VMarkerIcon.MARKER_WIDTH,VMarkerIcon.MARKER_HEIGHT,VisicomCommons.API_URL+"images/markers/marker-red-ws.png");DEFAULT_MARKER_ICON.alphaEnable(true);VMarker.prototype=new VMapObject();VMarker.prototype.type="marker";VMarker.prototype._isGeo=true;VMarker.prototype._info=null;VMarker.prototype._hint=null;VMarker.prototype._icon=null;VMarker.prototype._mousedown=false;VMarker.prototype._mouse_coords=null;VMarker.prototype._move_delta=null;VMarker.prototype._moved=false;VMarker.prototype.draggable=function(a){if(arguments.length==0){return this.options("draggable")}this._options.draggable=a;return this};VMarker.prototype._pointer;VMarker.prototype.pointer=function(a){if(arguments.length==0){return(this._pointer==undefined)?{x:(this.icon().width()/2),y:this.icon().height()}:this._pointer}this._pointer=a;return this};function VMarker(a,b){VMapObject.call(this,a);if(typeof(b)=="string"){this.info(b);this._icon=DEFAULT_MARKER_ICON}else{this._icon=(b!=null)?b:DEFAULT_MARKER_ICON}this._mouse_coords={};this._bounds=new VRect(this._coords);return this}VMarker.prototype.info=function(){if(arguments.length==0){if(typeof(this._info)=="string"){this.info(this._info)}return this._info}if(this._info!=null&&typeof(this._info)!="string"){this._info._hide();this.remove(this._info)}var a={};if(arguments[0].type=="info"){this._info=arguments[0];a=this._info._options}else{if(arguments.length==3){if(typeof(arguments[2])!="string"){VisicomUtils.copy(arguments[2],a)}this._info=new VInfoWindow(this._coords[0],arguments[0],arguments[1],arguments[2])}else{if(arguments.length==2){if(typeof(arguments[1])!="string"){VisicomUtils.copy(arguments[1],a)}this._info=new VInfoWindow(this._coords[0],arguments[0],arguments[1])}else{this._info=new VInfoWindow(this._coords[0],arguments[0])}}}this.add(this._info);this._info.visible(false);if(a.alwaysOpen==null){this._info.options("alwaysOpen",false)}if(a.canClose==null){this._info.options("canClose",true)}this._info.__marker=this;return this};VMarker.prototype._pre_coords=function(a){if(a==null){return}if(this._info!=null&&typeof(this._info)!="string"){this._info.coords(a)}};VMarker.prototype._createDOMElement=function(){this._div=document.createElement("img");if(this._icon==null){var a=this.style("icon");if(a==null){this._icon=DEFAULT_MARKER_ICON}else{this._icon=new VMarkerIcon(24,24,a)}}this._div.id="marker_"+this.coords(0).lng+this.coords(0).lat;this._div.style.position="absolute";this._div.width=this._icon.width();this._div.height=this._icon.height();this._div.style.zIndex=VisicomCommons.ZINDEX_MARKERS;this._div.style.border="0px";if(USER_DATA.Browser.MSIE){this._div.src=VisicomCommons.API_URL+"/images/blank.gif";this._div.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._icon.source()+"')"}else{this._div.src=this._icon.source()}this._div.style.cursor="pointer";var b=this;this._div.onmouseout=function(c){b._onMouseOut(c)};this._div.onclick=function(c){b._onMouseClick(c)};this._div.onmousedown=function(c){b._onMouseDown(c)};this._div.onmouseup=function(c){b._onMouseUp(c)};this._div.ondblclick=function(f){var c=0;if(f==undefined){f=window.event;c=window.event.button}else{c=f.which}var d=b._getMap();if(d==null){return}b._mouseEvent("mousedblclick",null,d._getCoords(f.clientX,f.clientY),(c==1)?"left":"right")};this._div.onmouseover=function(d){if(!d){d=window.event}b.mouseover();b._div.style.zIndex=VisicomCommons.ZINDEX_MARKERS_HOVER;if(b._mousedown){return}var c=b._getMap();if(c==null){return}if(c._dragged_object==b){b._hideHint();return}b._showHint()}};VMarker.prototype._onMouseDown=function(f){var b=0;if(f==undefined){f=window.event;b=window.event.button}else{b=f.which}var d=this._getMap();if(d==null){return}this._moved=false;this._mouseEvent("mousedown",null,d._getCoords(f.clientX,f.clientY),(b==1)?"left":"right");if(this.options("draggable")){this._mouse_coords={x:f.clientX,y:f.clientY};var c=d._getCoords(f.clientX,f.clientY);var a=d._convertToScreenCoords(c);var g=d._convertToScreenCoords(this.coords(0));this._move_delta={dx:g.x-a.x,dy:g.y-a.y};d._dragged_object=this;if(this.info()!=null){this.info()._hide();this.info().visible(false)}this._hideHint();this._div.style.zIndex=VisicomCommons.ZINDEX_MARKERS_HOVER;this.startdrag()}if(f.stopPropagation){f.stopPropagation()}else{f.cancelBubble=true}if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}};VMarker.prototype._onMouseUp=function(b){if(!b){b=window.event}if(!this._moved){this.mouseup()}var a=this._getMap();if(a==null){return}a._mouse_over=true;a._dragged_object=null;if(!this.options("draggable")){if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}return}if(this._moved){this._repaint();this.mouseup();this.enddrag()}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}};VMarker.prototype._onMouseClick=function(c){var a=0;if(c==undefined){c=window.event;a=window.event.button}else{a=c.which}var b=this._getMap();if(b==null){return}if(!this._moved){this._mouseEvent("mouseclick",null,b._getCoords(c.clientX,c.clientY),(a==1)?"left":"right")}if(this.info()==null){return}VInfoWindow._changeWindow();if(!this._moved){this.info().coords(this.coords());this.info().visible(true);if(this.info().options("scrollOnOpen")!=false){this.info()._smoothOpen()}this._hideHint()}b.repaint();if(c.stopPropagation){c.stopPropagation()}else{c.cancelBubble=true}if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}};VMarker.prototype._onMouseOut=function(b){if(!b){b=window.event}this._div.style.zIndex=VisicomCommons.ZINDEX_MARKERS;this._hideHint();this.mouseout();var a=this._getMap();if(!a._isMouseOnViewport(b.clientX,b.clientY)&&a._dragged_object==this){this._onMouseUp(b)}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}};VMarker.prototype._pre_init=function(){this._bounds=new VRect(this._coords)};VMarker.prototype._pre_show=function(){if(this._div==null){this._createDOMElement()}var b=this._getMap();if(b==null){return}var a=b._convertToScreenCoords(this.coords(0));this._left=Math.round(a.x-this.pointer().x);this._top=Math.round(a.y-this.pointer().y)};VMarker.prototype._pre_hide=function(){if(this.info()!=null&&this.info().visible()){this.info()._hide()}};VMarker.prototype._showHint=function(){if(this.info()!=null&&this.info().visible()&&this.info().displayed()){return}if(this.hint()==null){return}if(this.hint().visible()){return}VMarker._closeCurrentHint();this.hint().coords(this.coords());this.hint().visible(true);this.hint()._show();this.hint()._repaint();VMarker.CURRENT_HINT=this.hint()};VMarker.prototype._hideHint=function(){if(this.hint()==null){return}if(!this.hint().visible()){return}this.hint().visible(false);this.hint()._hide()};VMarker.prototype.visible=function(a){if(arguments.length==0){return this._visible}if(this._visible==a){return this}this._visible=a;if(this.info()!=null){this.info().visible(false)}if(this.hint()!=null){this.hint().visible(false)}return null};VMarker.prototype.hint=function(a){if(arguments.length==0){if(typeof(this._hint)=="string"){this.hint(this._hint)}return this._hint}if(this._hint!=null){this.remove(this._hint)}this._hint=new VLabel(this.coords(),a);this._hint.visible(false);this._hint.move(0,-this.pointer().y);this.add(this._hint);return this};VMarker.prototype.icon=function(a){if(this._icon==null){this._icon=(a!=null)?a:DEFAULT_MARKER_ICON}if(arguments.length==0){return this._icon}this._icon=a;if(this._div==null){this._createDOMElement()}this._div.width=this._icon.width();this._div.height=this._icon.height();if(this.hint()!=null){this.hint().move(0,-this.pointer().y)}if(USER_DATA.Browser.MSIE){this._div.src=VisicomCommons.API_URL+"/images/blank.gif";this._div.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this._icon.source()+"')"}else{this._div.src=this._icon.source()}this._hide();this._show();return this};VMarker._closeCurrentHint=function(){if(VMarker.CURRENT_HINT==null){return}VMarker.CURRENT_HINT.visible(false)};VInfoWindow.prototype=new VMapObject();VInfoWindow.prototype.type="info";VInfoWindow.prototype._isGeo=true;VInfoWindow.CURRENT_WINDOW;VInfoWindow.FORM_OLDSTYLE='<div>    <!-- top left -->    <div style="position: absolute; left: 13px; top: 0px; width: 15px; height: 15px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/top_left.png" width="15" height="15" /></div>    <!-- arrow -->    <div style="position: absolute; left: 1px; top: 15px; width: 13px; height: 61px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/arrow.png" width="13" height="61" /></div>    <!-- left border -->    <div style="position: absolute; left: 13px; top: 76px; width: 15px; height: #height#px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/left.png" width="15" height="#height#" /></div>    <!-- bottom left -->    <div style="position: absolute; left: 13px; top: #height+76#px; width: 15px; height: 30px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/bottom_left.png" width="15" height="30" /></div>    <div style="position: absolute; left: 14px; top: 15px; width: 15px; height: 61px; background-color: white;"></div>    <!-- background -->    <div style="position: absolute; left: 28px; top: 15px; width: #width#px; height: #height+61#px; background-color: white;"><div style="padding: 3px;">#html#</div></div>    <!-- top border -->    <div style="position: absolute; left: 28px; top: 0px; width: #width#px; height: 15px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/top.png" width="#width#" height="15" /></div>    <!-- bottom border -->    <div style="position: absolute; left: 28px; top: #height+76#px; width: #width#px; height: 30px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/bottom.png" width="#width#" height="30" /></div>    <!-- top right -->    <div style="position: absolute; left: #width+28#px; top: 0px; width: 30px; height: 15px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/top_right.png" width="30" height="15" /></div>    <!-- right border -->    <div style="position: absolute; left: #width+28#px; top: 15px; width: 30px; height: #height+61#px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/right.png" width="30" height="#height+61#" /></div>    <!-- bottom right -->    <div style="position: absolute; left: #width+28#px; top: #height+76#px; width: 30px; height: 30px;"><img src="'+VisicomCommons.API_URL+'/images/info_old/bottom_right.png" width="30" height="30" /></div></div>';VInfoWindow.FORM_OLDSTYLE_IE='<div>    <!-- top left -->    <div style="position: absolute; left: 13px; top: 0px; width: 15px; height: 15px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+'/images/info_old/top_left.png\');" src="'+VisicomCommons.API_URL+'/images/blank.gif" width="15" height="15" /></div>    <!-- arrow -->    <div style="position: absolute; left: 1px; top: 15px; width: 13px; height: 61px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+'/images/info_old/arrow.png\');" src="'+VisicomCommons.API_URL+'/images/blank.gif" width="13" height="61" /></div>    <!-- left border -->    <div style="position: absolute; left: 13px; top: 76px; width: 15px; height: #height-76#px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info_old/left.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="15" height="#height-76#" /></div>    <!-- bottom left -->    <div style="position: absolute; left: 13px; top: #height+76#px; width: 15px; height: 30px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+'/images/info_old/bottom_left.png\');" src="'+VisicomCommons.API_URL+'/images/blank.gif" width="15" height="30" /></div>    <div style="position: absolute; left: 14px; top: 15px; width: 15px; height: 61px; background-color: white;"></div>    <!-- background -->    <div style="position: absolute; left: 28px; top: 15px; width: #width#px; height: #height+62#px; background-color: white;"><div style="padding: 3px;">#html#</div></div>    <!-- top border -->    <div style="position: absolute; left: 28px; top: 0px; width: #width#px; height: 15px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info_old/top.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="#width#" height="15" /></div>    <!-- bottom border -->    <div style="position: absolute; left: 28px; top: #height+76#px; width: 300px; height: 30px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info_old/bottom.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="#width#" height="30" /></div>    <!-- top right -->    <div style="position: absolute; left: #width+28#px; top: 0px; width: 30px; height: 15px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+'/images/info_old/top_right.png\');" src="'+VisicomCommons.API_URL+'/images/blank.gif" width="30" height="15" /></div>    <!-- right border -->    <div style="position: absolute; left: #width+28#px; top: 15px; width: 30px; height: #height-61#px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info_old/right.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="30" height="#height+61#" /></div>    <!-- bottom right -->    <div style="position: absolute; left: #width+28#px; top: #height+76#px; width: 30px; height: 30px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+'/images/info_old/bottom_right.png\');" src="'+VisicomCommons.API_URL+'/images/blank.gif" width="30" height="30" /></div></div>';VInfoWindow.FORM_IE='<div>    <div style="position: absolute; left: 0px; top: 0px; width: 9px; height: 9px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info/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=\''+VisicomCommons.API_URL+"/images/info/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=\''+VisicomCommons.API_URL+"/images/info/corner-right-top.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="9" /></div>    <div style="position: absolute; left: 0px; top: 9px; width: 9px; height: #height#px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info/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; font-size: 1px;"><div style="padding: 3px;">#html#</div></div>    <div style="position: absolute; left: #width+9#px; top: 9px; width: 9px; height: 120px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info/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=\''+VisicomCommons.API_URL+"/images/info/corner-left-bottom.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: 33px; height: 15px;"><img style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+"/images/info/pointer.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="33" height="15" /></div>    <div style="position: absolute; left: 42px; top: #height+9#px; width: #width-33#px; height: 15px;"><img src="'+VisicomCommons.API_URL+'/images/blank.gif" style="filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+VisicomCommons.API_URL+'/images/info/border-bottom.png\', sizingMethod=\'scale\');" width="#width-33#" 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=\''+VisicomCommons.API_URL+"/images/info/corner-right-bottom.png', sizingMethod='scale');\" src=\""+VisicomCommons.API_URL+'/images/blank.gif" width="9" height="15" /></div></div>';VInfoWindow.FORM='<div>    <div style="position: absolute; left: 0px; top: 0px; width: 9px; height: 9px;">        <img src="'+VisicomCommons.API_URL+'/images/info/corner-left-top.png" width="9" height="9" />    </div>    <div style="position: absolute; left: 9px; top: 0px; width: #width#px; height: 9px;">        <img src="'+VisicomCommons.API_URL+'/images/info/border-top.png" width="#width#" height="9" />    </div>    <div style="position: absolute; left: #width+9#px; top: 0px; width: 9px; height: 9px;">        <img src="'+VisicomCommons.API_URL+'/images/info/corner-right-top.png" width="9" height="9" />    </div>    <div style="position: absolute; left: 0px; top: 9px; width: 9px; height: #height#px;">        <img src="'+VisicomCommons.API_URL+'/images/info/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="'+VisicomCommons.API_URL+'/images/info/border-right.png" width="9" height="#height#" />    </div>    <div style="position: absolute; left: 0px; top: #height+9#px; width: 9px; height: 15px;">        <img src="'+VisicomCommons.API_URL+'/images/info/corner-left-bottom.png" width="9" height="15" />    </div>    <div style="position: absolute; left: 9px; top: #height+9#px; width: 33px; height: 15px;">        <img src="'+VisicomCommons.API_URL+'/images/info/pointer.png" width="33" height="15" />    </div>    <div style="position: absolute; left: 42px; top: #height+9#px; width: #width-33#px; height: 15px;">        <img src="'+VisicomCommons.API_URL+'/images/info/border-bottom.png" width="#width-33#" height="15" />    </div>    <div style="position: absolute; left: #width+9#px; top: #height+9#px; width: 9px; height: 15px;">        <img src="'+VisicomCommons.API_URL+'/images/info/corner-right-bottom.png" width="9" height="15" />    </div></div>';VInfoWindow.prototype._header="";VInfoWindow.prototype._text="";VInfoWindow.prototype._alwaysOpen=function(a){if(arguments.length==0){return this.options("alwaysOpen")}this._options.alwaysOpen=a;var b=this._getMap();if(b==null){return(this)}if(this._options.alwaysOpen&&VInfoWindow.CURRENT_WINDOW==this){VInfoWindow._changeWindow();b.repaint()}return this};VInfoWindow.prototype.scrollOnOpen=function(a){if(arguments.length==0){return this.options("scrollOnOpen")}this._options.scrollOnOpen=a;return this};VInfoWindow.prototype.canClose=function(a){if(arguments.length==0){return this.options("canClose")}this._options.canClose=a;return this};function VInfoWindow(){if(arguments.length==0){return this}if(typeof(arguments[0])!="string"){if(typeof(arguments[2])=="string"){this._header=arguments[1];this._text=arguments[2];VMapObject.call(this,arguments[0],arguments[3])}else{this._html=arguments[1];this._header=arguments[1];this._text=arguments[2];VMapObject.call(this,arguments[0],arguments[2])}}else{if(typeof(arguments[1])=="string"){this._header=arguments[0];this._text=arguments[1];VMapObject.call(this,null,arguments[2])}else{this._html=arguments[0];this._header=arguments[0];this._text=arguments[0];VMapObject.call(this,null,arguments[1])}}if(this.options("alwaysOpen")==null){this.options("alwaysOpen",true)}if(this.options("canClose")==null){this.options("canClose",true)}return this}VInfoWindow.prototype._createDOMElement=function(){if(this._div==null){this._div=document.createElement("div");this._div.id="info_window_";this._div.style.position="absolute";this._div.style.zIndex=VisicomCommons.ZINDEX_INFOWINDOW;this._div.style.cursor="default";this._div.style.padding="0px";this._div.style.border="0px";var d="";var c="";var e=this._getMap();if(e==null){return}if(this._html==null){var h="<div style='color: #303030; font: bold 12px Tahoma; padding: 2px; height: 14px; background-color: #E9EEF7;'>"+this._header+"</div>";var f="<div style='color: #303030; font: normal 11px Tahoma; margin-top: 3px; padding: 3px; overflow: auto;'>"+this._text+"</div>";c=h+f}else{c="<div style='color: #303030; font: normal 11px Arial, Helvetica, sans-serif; max-height: "+(this._options.height)+"px; height: "+(this._options.height)+"px; overflow-y:auto; overflow-x:hidden;'>"+this._html+"</div>"}if(!this._options.width){var b=e._getContentSize(c);this._options.width=b.width+7;this._options.height=b.height+7}if(this._options.style=="1.0.0"){if(USER_DATA.Browser.MSIE){d=VInfoWindow.FORM_OLDSTYLE_IE}else{d=VInfoWindow.FORM_OLDSTYLE}d=d.replace(/\#header\#/,this._header);d=d.replace(/\#html\#/,c);d=d.replace(/\#width\#/g,this._options.width);d=d.replace(/\#width\+28\#/g,this._options.width+28);d=d.replace(/\#height\#/g,this._options.height);d=d.replace(/\#height\+76\#/g,this._options.height+76);d=d.replace(/\#height\-76\#/g,this._options.height-76);d=d.replace(/\#height\+61\#/g,this._options.height+61);d=d.replace(/\#height\-61\#/g,this._options.height-61);d=d.replace(/\#height\+62\#/g,this._options.height+62);this._div.innerHTML=d;if(this.options("canClose")){var a=document.createElement("img");a.style.height="12px";a.style.width="12px";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_old/button_close.png')"}else{a.style.height="12px";a.style.width="12px";a.src=VisicomCommons.API_URL+"images/info_old/button_close.png"}a.style.position="absolute";a.style.left=(this._options.width+24)+"px";a.style.top="8px";a.style.zIndex=VisicomCommons.ZINDEX_INFOWINDOW;a.style.cursor="pointer";this._div.appendChild(a);var g=this;a.onmouseover=function(){if(USER_DATA.Browser.MSIE){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"images/info_old/button_close_hover.png')"}else{a.src=VisicomCommons.API_URL+"images/info_old/button_close_hover.png"}};a.onmouseout=function(){if(USER_DATA.Browser.MSIE){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"images/info_old/button_close.png')"}else{a.src=VisicomCommons.API_URL+"images/info_old/button_close.png"}};a.onclick=function(){g.visible(false);g._hide();if(USER_DATA.Browser.MSIE){a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+VisicomCommons.API_URL+"images/info_old/button_close.png')"}else{a.src=VisicomCommons.API_URL+"images/info_old/button_close.png"}}}}else{if(USER_DATA.Browser.MSIE){d=VInfoWindow.FORM_IE}else{d=VInfoWindow.FORM}d=d.replace(/\#header\#/,this._header);d=d.replace(/\#html\#/,c);d=d.replace(/\#width\#/g,this._options.width);d=d.replace(/\#width\+9\#/g,this._options.width+9);d=d.replace(/\#width\-33\#/g,this._options.width-33);d=d.replace(/\#height\#/g,this._options.height);d=d.replace(/\#height\+9\#/g,this._options.height+9);this._div.innerHTML=d;if(this.options("canClose")){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.left=(this._options.width-11)+"px";a.style.top="13px";a.style.zIndex=VisicomCommons.ZINDEX_INFOWINDOW;a.style.cursor="pointer";this._div.appendChild(a);var g=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(){g.visible(false);g._hide();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"}}}}var g=this;this._div.onmouseover=function(j){if(!j){j=window.event}g._div.style.zIndex=VisicomCommons.ZINDEX_INFOWINDOW_HOVER;var i=g._getMap();if(i!=null){i._mouse_over=false}if(j.stopPropagation){j.stopPropagation()}else{j.cancelBubble=true}if(j.preventDefault){j.preventDefault()}else{j.returnValue=false}};this._div.onmouseout=function(i){if(!i){i=window.event}g._div.style.zIndex=VisicomCommons.ZINDEX_INFOWINDOW;if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}};this._div.onmouseup=function(i){if(!i){i=window.event}if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}if(i.preventDefault){i.preventDefault()}else{i.returnValue=false}}}};VInfoWindow.prototype._pre_init=function(){this._bounds=new VRect(this._coords)};VInfoWindow.prototype._pre_show=function(){if(this._div==null){this._createDOMElement()}var c=this._getMap();if(c==null){return}var b=c._convertToScreenCoords(this.coords(0));if(this._options.style=="1.0.0"){this._left=b.x;this._top=b.y-48}else{this._left=b.x-32;this._top=b.y-this._options.height-23}if(!this.options("alwaysOpen")){VInfoWindow._changeWindow(this)}if(this.__marker==null){return}this.__marker._hideHint();var a=this.__marker.getDOMElement();if(a==null){return}a.style.display="none"};VInfoWindow.prototype._pre_hide=function(){var b=this._getMap();if(b==null){return}this._event("close");if(this.__marker==null){return}var a=this.__marker.getDOMElement();if(a==null){return}if(!this.__marker.visible()){return}a.style.display="block"};VInfoWindow.prototype.size=function(b,a){if(a==null){switch(b){case"small":this._options.width=190;this._options.height=55;break;case"medium":this._options.width=290;this._options.height=141;break;case"large":this._options.width=490;this._options.height=302;break}return}this._options.width=b;this._options.height=a;if(this._options.width>800){this._options.width=800}if(this._options.height>600){this._options.height=600}};VInfoWindow._changeWindow=function(){if(VInfoWindow.CURRENT_WINDOW!=null){if(arguments.length>0){if(VInfoWindow.CURRENT_WINDOW!=arguments[0]){VInfoWindow.CURRENT_WINDOW._hide();VInfoWindow.CURRENT_WINDOW.visible(false)}}else{VInfoWindow.CURRENT_WINDOW._hide();VInfoWindow.CURRENT_WINDOW.visible(false)}}if(arguments.length>0){VInfoWindow.CURRENT_WINDOW=arguments[0]}else{VInfoWindow.CURRENT_WINDOW=null}};VInfoWindow.prototype._smoothOpen=function(){var a=this._getMap();if(a==null){return}if(this._div==null){this._createDOMElement()}var j=a._convertToScreenCoords(this.coords(0));var l;var k;if(this._options.style=="1.0.0"){l=j.x;k=j.y-48}else{l=j.x-32;k=j.y-this.options("height")-23}var g=10;var d=g*2;l-=g;k-=g;var h=a._convertToGeoCoords(l-g,k-g);var c=a._convertToGeoCoords(l+this.options("width")+d,k);var f=a._convertToGeoCoords(l+this.options("width")+d,k+this.options("height")+d);var b=a._convertToGeoCoords(l,k+this.options("height")+d);var i=a.clientRect();if(i.contains(h)&&i.contains(c)&&i.contains(f)&&i.contains(b)){return}a._clearSmoothTimer();var e={lng:b.lng+((c.lng-b.lng)/2),lat:b.lat+((c.lat-b.lat)/2)};a._smoothMove(e,function(){var m=a.clientRect();return !((m.contains(h)&&m.contains(c)&&m.contains(f)&&m.contains(b)))})};VLabel.prototype=new VMapObject();VLabel.prototype._isGeo=true;VLabel.prototype._html;VLabel.prototype._offset;function VLabel(b,a){VMapObject.call(this,b);this._html=(a!=null)?a:"";this.type="label";return this}VLabel.prototype.html=function(a){if(arguments.length==0){return this._html}this._html=a;if(this._div!=null){this._div.innerHTML="<nobr>"+this._html+"</nobr>";this._div.style.display=(this._html!="")?"block":"none"}return this};VLabel.prototype._createDOMElement=function(){this._div=document.createElement("div");this._div.style.position="absolute";this._div.style.zIndex=VisicomCommons.ZINDEX_LABEL;this._div.style.cursor="default";this._div.style.font="normal 11px Arial";this._div.style.color="#000000";this._div.style.padding="2px";this._div.style.webkitBoxShadow="0px 0px 5px #949494";this._div.style.MozBoxShadow="0px 0px 5px #949494";this._div.style.boxShadow="0px 0px 5px #949494";this._div.style.border="1px solid gray";this._div.style.backgroundColor="#FFFFE1";this._div.innerHTML="<nobr>"+this._html+"</nobr>";var a=this;this._div.onmousedown=function(b){if(!b){b=window.event}a.mousedown();if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}};this._div.onmouseup=function(b){if(!b){b=window.event}a.mouseup();if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}};this._div.onmousemove=function(b){if(!b){b=window.event}a.mousemove()};this._div.onclick=function(b){if(!b){b=window.event}a.mouseclick();if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}};this._div.onmouseover=function(b){if(!b){b=window.event}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}};VLabel.prototype._pre_init=function(){this._bounds=new VRect(this.coords())};VLabel.prototype._pre_show=function(){if(this._div==null){this._createDOMElement()}var b=this._getMap();if(b==null){return}this._div.style.display=(this._html!="")?"block":"none";var a=b._convertToScreenCoords(this.coords(0));this._left=Math.round(a.x);this._top=Math.round(a.y)};VLabel.prototype._pre_repaint=function(){var b=this._getMap();if(b==null){return}var a=b._convertToScreenCoords(this.coords(0));this._left=Math.round(a.x);this._top=Math.round(a.y);this._top-=VisicomUtils.getBounds(this._div).height;if(this._offset==null){return}this._left+=this._offset.x;this._top+=this._offset.y};VLabel.prototype.move=function(a,b){this._offset={x:a,y:b};return this};VLine.prototype=new VMapObject();VLine.prototype.type="line";VLine.prototype._isGeo=true;VLine.prototype.color=function(a){if(arguments.length==0){return this.style("color")}this._style.color=a;var b=this;this._childs.forEach(function(c){c.color(b._style.color);c._re_create()});this._re_create();return this};VLine.prototype.lineWidth=function(a){if(arguments.length==0){return this.style("lineWidth")}this._style.lineWidth=a;var b=this;this._childs.forEach(function(c){c.lineWidth(b._style.lineWidth);c._re_create()});this._re_create();return this};VLine.prototype.opacity=function(a){if(arguments.length==0){return this.style("opacity")}this._style.opacity=a;var b=this;this._childs.forEach(function(c){c.opacity(b._style.opacity);c._re_create()});this._re_create();return this};VLine.prototype.shadow=function(b){if(arguments.length==0){return this.style("shadow")}this._style.shadow=b;var a=this;this._childs.forEach(function(c){c.shadow(a._style.shadow);c._re_create()});this._re_create();return this};VLine.prototype._screen_coords=null;function VLine(a){VMapObject.call(this,a);return this}VLine.prototype._pre_init=function(){var b=this._getMap();if(b==null){return}if(this._div!=null){this._hide()}var m=this;this._childs.forEach(function(i){i._remove()});this._childs=[];this._displayed=false;if(this._coords==null){return}var r=3500;var l=3500;var g=500;var d=function(s){var i=[];s.forEach(function(t){var u=b._convertToScreenCoords(t);i.push({x:u.x-a.x+m.lineWidth(),y:m._height-(a.y-u.y)+m.lineWidth()})});return i};var k=function(w){var v=new VRect(w);var u=b._convertToScreenCoords(v.leftBottom());var s=b._convertToScreenCoords(v.rightTop());var t=(s.x-u.x);var i=(u.y-s.y);return(!(t>r||i>l))};var q=function(E){var z=E[0];var v=E[1];var G=(v.lng-z.lng);var F=(v.lat-z.lat);var D=Math.sqrt(Math.pow(G,2)+Math.pow(F,2));var u=G/D;var A=F/D;var i=[];var s=b._currentMap._units_per_pixel;var B=((r-g)*s)*u;var w=((l-g)*s)*A;var t=VisicomCommons.convertToGeoProjection(B,w);var C={lng:z.lng+t.lng/2,lat:z.lat+t.lat/2};i.push(z);i.push(C);i.push(v);return i};var f=[];var e=0;c=k(this._coords);if(!c){for(var j=0;j<this._coords.length;j++){e++;var p=this._coords[j];f.push(p);var c=false;while(!c){c=k(f);if(c){break}if(f.length==2){f=q(f);var o=f[1];f.splice(2,1);var n=new VLine(f);n.visible(this._visible);this.add(n);n._init()}else{f.splice(e-1,1);o=f[e-2];n=new VLine(f);n.visible(this._visible);this.add(n);n._init()}f=[];f.push(o);f.push(p);e=2}}}else{f=this._coords}this._bounds=new VRect(f);var a=b._convertToScreenCoords(this._bounds.leftBottom());var h=b._convertToScreenCoords(this._bounds.rightTop());this._left=a.x-this.lineWidth();this._top=a.y-this.lineWidth();this._width=Math.abs(h.x-a.x);this._height=a.y-h.y;this._screen_coords=d(f);this._top-=this._height;this._width+=this.lineWidth()*2;this._height+=this.lineWidth()*2};VLine.prototype._pre_show=function(){if(this._div!=null){return}if(this._screen_coords==null){return}if(this._screen_coords.length==0){return}var e=this.lineWidth();if(e==null){e=2}var f=this.opacity();if(f==null){f=1}var c=this.color();if(c==null){c="#00ffff"}if(USER_DATA.Browser.MSIE){this._div=document.createElement("div");this._div.id="polyline_"+this._left+"_"+this._top;this._div.style.position="absolute";this._div.style.width=Math.round(this._width)+"px";this._div.style.height=Math.round(this._height)+"px";this._div.style.zIndex=VisicomCommons.ZINDEX_POLYLINE;this._div.style.border="none";var k=document.createElement("v:polyline");k.style.position="absolute";k.style.antialias="true";var h=document.createElement("v:stroke");if(f!=null){h.setAttribute("opacity",f)}h.setAttribute("joinstyle","round");h.setAttribute("filltype","solid");k.appendChild(h);k.setAttribute("strokecolor",((c==null)?"#0000C8":c));k.setAttribute("strokeweight",e+"px");k.setAttribute("filled","false");var g="";for(var d=0;d<this._screen_coords.length;d++){var j=this._screen_coords[d];g+=j.x+","+j.y+" "}k.setAttribute("points",g);k.setAttribute("opacity",f);this._div.appendChild(k)}else{this._div=document.createElement("canvas");this._div.id="polyline_"+this._left+"_"+this._top;this._div.style.position="absolute";this._div.width=Math.round(this._width);this._div.height=Math.round(this._height);this._div.style.zIndex=VisicomCommons.ZINDEX_POLYLINE;this._div.style.border="none";var a;try{a=this._div.getContext("2d")}catch(b){return}if(this.shadow()){a.shadowOffsetX=1;a.shadowOffsetY=1;a.shadowBlur=3;a.shadowColor="#404040"}a.lineWidth=e;a.lineCap="round";a.lineJoin="round";a.strokeStyle=(c==null)?"rgb(0, 0, 200)":c;if(f!=null){a.globalAlpha=f}a.beginPath();for(d=0;d<this._screen_coords.length;d++){j=this._screen_coords[d];if(d==0){a.moveTo(j.x,j.y)}else{a.lineTo(j.x,j.y)}}a.stroke()}};VLine.prototype.distance=function(){return VisicomCommons.GeoCalcLen(this.coords())};VMultiLine.prototype=new VLine();VMultiLine.prototype.type="multiline";function VMultiLine(a){VLine.call(this,a);return this}VMultiLine.prototype.bounds=function(){if(this._bounds==null){this._createLines()}return this._bounds};VMultiLine.prototype._createLines=function(){if(this._childs.length!=0){return}this._childs=[];var a=[];for(var b=0;b<this._coords.length;b++){var c=this._coords[b];if(c.length==null){this.add(new VLine(this._coords));a=this._coords;break}this.add(new VLine(c));var d=new VRect(c);a.push(d.leftBottom());a.push(d.rightTop())}this._bounds=new VRect(a)};VMultiLine.prototype._pre_init=function(){this._createLines()};VMultiLine.prototype.distance=function(){if(this._childs.length==0){this._createLines()}var c=0;for(var b in this._childs){var a=this._childs[b];c+=a.distance()}return c};VArea.prototype=new VLine();function VArea(a){VLine.call(this,a);this.type="area";return this}VArea.prototype._pre_show=function(){if(this._screen_coords==null){return}if(this._screen_coords.length==0){return}var f=this.lineWidth();if(f==null){f=3}var g=this.opacity();if(g==null){g=0.35}var d=this.color();if(d==null){d="#0000ff"}if(USER_DATA.Browser.MSIE){this._div=document.createElement("div");this._div.id="polygone_"+this._left+"_"+this._top;this._div.style.position="absolute";this._div.style.width=Math.round(this._width);this._div.style.height=Math.round(this._height);this._div.style.zIndex="102";this._div.style.border="0px";var h=document.createElement("v:shape");h.setAttribute("fillcolor",d);h.setAttribute("coordorigin","0 0");h.setAttribute("coordsize",Math.round(this._width)+" "+Math.round(this._height));h.style.left="0px";h.style.top="0px";h.style.width=Math.round(this._width)+"px";h.style.height=Math.round(this._height)+"px";h.style.position="absolute";var l=document.createElement("v:fill");l.opacity=g;h.appendChild(l);var m=document.createElement("v:stroke");m.fillstyle=d;m.opacity=g;m.joinstyle="miter";h.appendChild(m);var n=document.createElement("v:path");h.appendChild(n);var k=this._screen_coords[0];var a="m "+Math.round(k.x)+","+Math.round(k.y)+" l ";for(var e=1;e<this._screen_coords.length;e++){if(e!=1){a+=", "}var j=this._screen_coords[e];a+=Math.round(j.x)+","+Math.round(j.y)}a+=" x e";n.setAttribute("v",a);this._div.appendChild(h)}else{this._div=document.createElement("canvas");this._div.id="polygone_"+this._left+"_"+this._top;this._div.style.position="absolute";this._div.width=Math.round(this._width);this._div.height=Math.round(this._height);this._div.style.zIndex="102";this._div.style.border="0px";var b;try{b=this._div.getContext("2d")}catch(c){return}b.lineWidth=f;b.lineCap="round";b.lineJoin="round";b.fillStyle=(d==null)?"rgb(0, 0, 200)":d;b.globalAlpha=g;b.beginPath();for(e=0;e<this._screen_coords.length;e++){var j=this._screen_coords[e];if(e==0){b.moveTo(j.x,j.y)}else{b.lineTo(j.x,j.y)}}b.fill()}};VRemoteRequest.prototype._script;VRemoteRequest.prototype._callback;function VRemoteRequest(){return this}var _VISICOM_remoteRequestMap=new Object();VRemoteRequest.prototype.request=function(a,c){this._callback=c;var b="remote_"+Math.random();_VISICOM_remoteRequestMap[b]=this;this._script=document.createElement("script");this._script.id=b;this._script.type="text/javascript";this._script.src=a+"&id="+b+"&mapname="+_VISICOM_MapGlobalContext.mapname()+"_"+_VISICOM_MapGlobalContext.language();document.body.appendChild(this._script)};function _VISICOM_remoteRequestCallback(c,b){var a=_VISICOM_remoteRequestMap[c];if(a==null){return}if(a._callback!=null){a._callback(b)}if(a._script!=null){document.body.removeChild(a._script);delete (a._script)}_VISICOM_remoteRequestMap[c]=null}var VRemoteCall=(function(){function c(){if(arguments.length<2){return}var n=arguments[0];var m=arguments[arguments.length-1];var h=new VRemoteRequest();var f=VisicomCommons.API_URL+n+"?";for(var g=1;g<arguments.length-1;g++){var l=arguments[g];if(g>=2){f+="&"}if((l.lng!=null)&&(l.lat!=null)){var k="";k+=l.lng.toPrecision(6)+","+l.lat.toPrecision(6)+";";f+="p"+g+"="+k}else{if(l instanceof Array){k="";for(var e=0;e<l.length;e++){k+=l[e].lng.toPrecision(6)+","+l[e].lat.toPrecision(6)+";"}f+="p"+g+"="+k}else{if(l instanceof VMapObject){k="";for(var e=0;e<l.coords().length;e++){k+=l.coords(e).lng.toPrecision(6)+","+l.coords(e).lat.toPrecision(6)+";"}f+="p"+g+"="+k}else{if(typeof(l)=="number"){f+="p"+g+"="+l}else{if(typeof(l)=="string"){f+="p"+g+"="+encodeURI(l)}}}}}}if(arguments.length>=2){f+="&"}else{f+="?"}f+=((VMap.AUTH_KEY!="")?"key="+VMap.AUTH_KEY:"");h.request(f,function(i){if(i.error!=null){throw new Error(i.error)}VMapObject._wrap(null,i);m(i)})}function a(){c("address",arguments)}function b(){c("route",arguments)}function d(){c("language",arguments)}return{request:c,address:a,route:b}})();VBounds.prototype=new VRect();VBounds.prototype.min=function(){return this._coords[0]};VBounds.prototype.max=function(){return this._coords[1]};function VBounds(){VRect.call(this,arguments);return this}VMap.prototype.clientBounds=function(){return this.clientRect()};VPoint.prototype=new VMapObject();function VPoint(a,b){VMapObject.call(this,{lng:a,lat:b});return this}VPoint.prototype.distanceTo=function(b){var a=VisicomCommons.GeoCalcLen([this.coords(0),b]);return a};VRoute.prototype=new VMapObject();VRoute.prototype._distance=null;VRoute.prototype.distance=function(a){if(arguments.length==0){return this._distance}this._distance=a;return this};function VRoute(a){VMapObject.call(this);if(a!=null){this.edges(a)}this._type="route";return this}VRoute.prototype.edges=function(a){if(arguments.length==0){return this._childs}this._childs=a;return this};VEdge.prototype=new VLine();VEdge.prototype._name=null;VEdge.prototype._distance=null;function VEdge(a){VLine.call(this,a);return this}VEdge.prototype.name=function(a){if(arguments.length==0){return this._name}this._name=a;return this};VEdge.prototype.distance=function(a){if(arguments.length==0){return this._distance}this._distance=a;return this};VMapObject.prototypes.route=VRoute.prototype;VMapObject.prototypes.edge=VEdge.prototype;VMap.prototype.init=function(){if(this.initialized){return}this._screenOffsets=[];this._init_();this._mapName="ukraine_ru";this._mapName=this._mapName.split("_")[0];this._language="ru";var l=parseFloat(-200375082);var f=parseFloat(200375082);var j=parseFloat(-200375083);var c=parseFloat(200375083);this.__minLng=l;this.__maxLng=f;this.__minLat=j;this.__maxLat=c;var d=VisicomCommons.convertToGeoProjection(l,j);var m=VisicomCommons.convertToGeoProjection(f,c);this._bounds=new VRect(d,m);var e=0;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/0";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=1565430.332031;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/1";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=782715.166016;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/2";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=391357.583008;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/3";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=195678.791504;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/4";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=97839.395752;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/5";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=48919.697876;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/6";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=24459.848938;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/7";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=12229.924469;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/8";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=6114.962234;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/9";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=3057.481117;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/10";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=1528.740559;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/11";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=764.370279;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/12";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=382.18514;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/13";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=191.09257;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/14";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=95.546285;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/15";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=47.773142;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/16";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=23.886571;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/17";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=11.943286;this._maps[e]=a;e++;var b="http://tms.visicom.ua/1.0.3/ukraine_ru/18";var g=b.split("/");var h=g[g.length-1];var k=Math.pow(2,h)*VMapTile.TILE_WIDTH;var n=Math.pow(2,h)*VMapTile.TILE_HEIGHT;var a=new VMapZoom(k,n,e,this);a._base_url=b;a._units_per_pixel=5.971643;this._maps[e]=a;e++;this._currentMap=this._maps[this._zoom_index];this._showMap();this._zoomControl._createDOMElement();this._zoomControl.position(this._zoom_index);this.initialized=true};VMapObject.prototypes.mapobject=VMapObject.prototype;VMapObject.prototypes.layer=VLayer.prototype;VMapObject.prototypes.collection=VLayer.prototype;VMapObject.prototypes.label=VLabel.prototype;VMapObject.prototypes.marker=VMarker.prototype;VMapObject.prototypes.info=VInfoWindow.prototype;VMapObject.prototypes.line=VLine.prototype;VMapObject.prototypes.area=VArea.prototype;VMapObject.prototypes.multiline=VMultiLine.prototype;VMapObject.prototypes.rect=VRect.prototype;
