// --------------------------------------------------------------------------------------------
// khtml javascript library
// --------------------------------------------------------------------------------------------
// (C) Copyright 2010-2011 by Bernhard Zwischenbrugger, Florian Hengartner, Stefan Kemper
//
// Project Info:  http://www.khtml.org
//				  http://www.khtml.org/iphonemap/help.php
//
// This library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this library.  If not, see <http://www.gnu.org/licenses/>.
// --------------------------------------------------------------------------------------------
var khtml={};khtml.maplib={};khtml.maplib.base={};khtml.maplib.geometry={};khtml.maplib.overlay={};khtml.maplib.overlay.renderer={};khtml.maplib.parser={};khtml.maplib.ui={};khtml.maplib.util={};khtml.maplib.overlay.renderer={};khtml.maplib.version=function(){return"khtmlib_hsr v0.02"};khtml.maplib.Map=function(a){return new khtml.maplib.base.Map(a)};khtml.maplib.LatLng=function(a,c){return new khtml.maplib.geometry.LatLng(a,c)};khtml.maplib.standardimagepath="http://maplib.khtml.org/img/";khtml.maplib.base.helpers={};khtml.maplib.base.helpers.parseXml=function(a){var c;window.ActiveXObject?(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a)):document.implementation&&document.implementation.createDocument&&(c=(new DOMParser).parseFromString(a,"text/xml"));return c};
khtml.maplib.base.helpers.contains=function(a,c){var d=[a.sw().lat(),a.ne().lat()],b=[a.sw().lng(),a.ne().lng()];return(khtml.maplib.base.helpers.between(d,c.sw().lat())||khtml.maplib.base.helpers.between(d,c.ne().lat()))&&(khtml.maplib.base.helpers.between(b,c.sw().lng())||khtml.maplib.base.helpers.between(b,c.ne().lng()))?!0:!1};khtml.maplib.base.helpers.overlaps=function(a,c){return a.sw().lng()>c.ne().lng()||a.ne().lng()<c.sw().lng()||a.sw().lat()>c.ne().lat()||a.ne().lat()<c.sw().lat()?!1:!0};
khtml.maplib.base.helpers.overlapsBuggy=function(a,c){var d=[a.sw().lat(),a.ne().lat()],b=[a.sw().lng(),a.ne().lng()],e=[c.sw().lat(),c.ne().lat()],g=[c.sw().lng(),c.ne().lng()];return(khtml.maplib.base.helpers.between(d,c.sw().lat())||khtml.maplib.base.helpers.between(d,c.ne().lat()))&&(khtml.maplib.base.helpers.between(b,c.sw().lng())||khtml.maplib.base.helpers.between(b,c.ne().lng()))||(khtml.maplib.base.helpers.between(e,a.sw().lat())||khtml.maplib.base.helpers.between(e,a.ne().lat()))&&(khtml.maplib.base.helpers.between(g,
    a.sw().lng())||khtml.maplib.base.helpers.between(g,a.ne().lng()))?!0:!1};
khtml.maplib.base.helpers.extendBBox=function(a,c){if(!(a instanceof khtml.maplib.geometry.Bounds)){var d=new khtml.maplib.geometry.LatLng(-80,-170),b=new khtml.maplib.geometry.LatLng(90,180);a=new khtml.maplib.geometry.Bounds(b,d);a.sw(b);a.ne(d)}if(!c)return a;c instanceof khtml.maplib.geometry.LatLng?a=khtml.maplib.base.helpers.extendBBoxByPoint(a,c):(a=khtml.maplib.base.helpers.extendBBoxByPoint(a,c.sw()),a=khtml.maplib.base.helpers.extendBBoxByPoint(a,c.ne()));return a};
khtml.maplib.base.helpers.extendBBoxByPoint=function(a,c){var d=a.sw().lng(),b=a.ne().lat(),e=a.sw().lat(),g=a.ne().lng();c.lat()>b&&(b=c.lat());c.lat()<e&&(e=c.lat());c.lng()<d&&(d=c.lng());c.lng()>g&&(g=c.lng());d=new khtml.maplib.geometry.LatLng(e,d);b=new khtml.maplib.geometry.LatLng(b,g);return new khtml.maplib.geometry.Bounds(d,b)};khtml.maplib.base.helpers.between=function(a,c){return a[0]<=c&&c<=a[1]?!0:!1};
khtml.maplib.base.helpers.cloneObject=function(a){var c={},d;for(d in a)c[d]=typeof a[d]=="object"?khtml.maplib.base.helpers.cloneObject(a[d]):a[d];return c};khtml.maplib.base.helpers.convertObjectToArray=function(a){for(var c=[],d=0,b=a.length;d<b;d++)c.push(a[d]);return c};
khtml.maplib.base.helpers.eventAttach=function(a,c,d,b,e){var g=arguments.length>5?$a(arguments).slice(5,arguments.length):[],f=function(f){g.unshift(f||window.event);return d.apply(b?b:a,g)};a.addEventListener?(navigator.appName.indexOf("Netscape")==-1&&c=="DOMMouseScroll"&&(c="mousewheel"),navigator.userAgent.indexOf("Safari")!=-1?c=="DOMMouseScroll"?a.onmousewheel=f:a.addEventListener(c,f,e):a.addEventListener(c,f,e)):(c=c=="DOMMouseScroll"?"onmousewheel":"on"+c,a.attachEvent(c,f));return{o:a,
    type:c,fn:f,c:e}};khtml.maplib.base.helpers.eventRemove=function(a){a.o.removeEventListener&&a.o.removeEventListener(a.type,a.fn,a.c)};khtml.maplib.base.helpers.mixin=function(a,c,d){if(d)if(d instanceof Array)for(var b=0;b<d.length;b++)a[d[b]]=c[d[b]];else c[d]&&(a[d]=c[d]);else for(b in c)a[b]=c[b]};
khtml.maplib.base.helpers.showOnMap=function(a,c){var d=[];a instanceof khtml.maplib.geometry.Bounds&&(khtml.maplib.base.Log.log("Bounds"),khtml.maplib.base.Log.log("Northwest / Topleft",a.nw()),khtml.maplib.base.Log.log("Northeast / Topright",a.ne()),khtml.maplib.base.Log.log("Southeast / Bottomright",a.se()),khtml.maplib.base.Log.log("Southwest / Bottomleft",a.sw()),d.push(a.nw()),d.push(a.ne()),d.push(a.se()),d.push(a.sw()));for(var b=0;b<d.length;b++){var e=document.createElement("div");e.style.width=
    "1px";e.style.height="1px";e.style.color="red";e.style["font-size"]="2em";e.textContent="X";e=new khtml.maplib.overlay.Marker(d[b],e);c.addOverlay(e)}};khtml.maplib.base.helpers.cancelEvent=function(a){a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation()};khtml.maplib.base.helpers.stopEventPropagation=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};khtml.maplib.base.helpers.isIE=function(){return navigator.userAgent.indexOf("MSIE")!=-1};
khtml.maplib.base.helpers.isParentNodeEmpty=function(a){if(khtml.maplib.base.helpers.isIE())return a.parentNode.nodeValue==null;return!a.parentNode};
khtml.maplib.base.helpers.parseLine=function(a){if(a instanceof khtml.maplib.geometry.LatLng)return a;if(a){if(typeof a=="string")a=khtml.maplib.base.helpers.parseLineString;if(typeof a=="object"){if(typeof a[0]=="string"&&typeof a[1]=="string"&&!isNaN(parseFloat(a[0]))&&!isNaN(parseFloat(a[1]))&&a.length==2){var c=parseFloat(a[1]),d=parseFloat(a[0]),b=khtml.maplib.LatLng(c,d);return b}if(typeof a[0]=="number"&&typeof a[0]=="number"&&a.length==2)a=new khtml.maplib.LatLng(a[1],a[0]);else for(b in a){var e=
    a[b];e instanceof khtml.maplib.geometry.LatLng||(c=e[1],d=e[0],a[b]=typeof c=="number"&&typeof d=="number"&&e.length==2?new khtml.maplib.LatLng(c,d):khtml.maplib.base.helpers.parseLine(a[b]))}c=a}}else c=[];return c};khtml.maplib.base.helpers.parseLineString=function(a){if(typeof a=="string"){points=[];a=a.split(" ");for(var c=0;c<a.length;c++){var d=a[c].split(",");d.length==2&&(d[0]=parseFloat(d[0]),d[1]=parseFloat(d[1]),points.push(new khtml.maplib.LatLng(d[0],d[1])))}}return points};
khtml.maplib.base.helpers.parseMultiLine=function(a){if(a&&typeof a=="object")for(var c in a){var d=a[c],b;for(b in d){var e=d[b];if(!(e instanceof khtml.maplib.geometry.LatLng)){var g=e[0];e=e[1];typeof g=="number"&&typeof e=="number"&&(d[b]=new khtml.maplib.LatLng(g,e))}}}else a=[];return a};var stop=0;
khtml.maplib.base.helpers.stringify=function(a,c,d){var b=!0;typeof a.push=="undefined"&&(b=!1);for(var e="",g=c?c+1:c===!1?!1:1,f=e="",m=0;m<g-1;m++)f+="   ";c!==!1&&(f="\n"+f,e=f+"   ");m="";for(var h in a)if(h!="owner"&&typeof a[h]!="function")if(a[h]instanceof khtml.maplib.geometry.Bounds)m+=e+'"bbox":',m+="["+a[h].sw().lng()+","+a[h].sw().lat()+",",m+=""+a[h].ne().lng()+","+a[h].ne().lat()+"]",m+=",";else if(a[h]instanceof khtml.maplib.geometry.LatLng)a.type!="Marker"&&(a.type=="Point"&&(m+=
    '"coordinates":'),m+="["+a[h].lng()+","+a[h].lat()+"],");else if(typeof a[h]=="string"){if((h=="type"||d)&&h!="animVal")a[h]!="Marker"&&(m+=e+'"'+h+'":"'+a[h]+'",')}else if(console.log(h,c),b||h=="type"||h=="features"||a[h]&&a[h].type=="Feature"||h=="geometry"||h=="coordinates"||h=="properties"||h=="bbox"||h=="className")console.log(h,c),m+=b?e+khtml.maplib.base.helpers.stringify(a[h],g)+",":h=="properties"?e+'"'+h+'":'+khtml.maplib.base.helpers.stringify(a[h],g)+",":e+'"'+h+'":'+khtml.maplib.base.helpers.stringify(a[h],
    g,!0)+",";m=m.substring(0,m.length-1);return b?"["+m+"]":"{"+m+f+"}"};khtml.maplib.base.helpers.rotate=function(a,c){var d="rotate("+c+"deg)";a.style.webkitTransform=d;a.style.MozTransform=d;a.style.OTransform=d;if(document.all)rad=c*(Math.PI*2/360),costheta=Math.cos(rad),sintheta=Math.sin(rad),a.filters.item(0).M11=costheta,a.filters.item(0).M12=-sintheta,a.filters.item(0).M21=sintheta,a.filters.item(0).M22=costheta};
khtml.maplib.base.helpers.Boundingbox=function(a){this.map=a;this.div=document.createElement("div");this.div.style.border="1px dotted blue";this.div.style.position="absolute";this.div.style.strokeDasharray="4,4";this.div.style.zIndex=1;this.div.style.pointerEvents="none";a.mapParent.appendChild(this.div);this.show=function(a){this.div.style.display="";var b=this.map.latlngToXY(a.sw());a=this.map.latlngToXY(a.ne());this.div.style.top=a.y-parseInt(this.div.style.borderWidth)+"px";this.div.style.left=
    b.x-parseInt(this.div.style.borderWidth)+"px";this.div.style.width=a.x-b.x+"px";this.div.style.height=-a.y+b.y+"px";this.div.zIndex=10};this.hide=function(){c.div.style.display="none"};var c=this;this.map.addCallbackFunction(c.hide)};khtml.maplib.base.helpers.ajaxload="data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA%3D%3D";
khtml.maplib.base.helpers.close="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAAA5ElEQVR42tRTQYoEIQwsl/2Bl3gQoY9eBKEf5kvyG8G7h4Z+S38gIu5lp5lZ2R7YPm1BDhZJSFWiGmPgDj5wE7cbfD4/mBkAHprUj9yTTyn9OsGIMSLG+Fxwxc8SiAi9d4QQHskjhIDeO4jorQcq5wwiQmsN3nt479FaAxEh5zxJmyZIKalSClprL1FKQUpJXZr4DBH52xqZeRhjICKw1sJaCxGBMQbMPN41GFpriAicc6i1otYK5xxEBFrraQuThGVZAADbtp2amXms6woAOI7j0gO17/t5MN+HNfEvBf//M30NAKe7aRqUOIlfAAAAAElFTkSuQmCC";
khtml.maplib.base.helpers.imageNotSelectable=function(a){a.style.MozUserSelect="none";a.style.webkitUserSelect="none";a.style.webkitUserDrag="none";a.style.KhtmlUserSelect="none";a.style.OUserSelect="none";a.style.userSelect="none"};
khtml.maplib.base.helpers.setCursor=function(a,c){if(navigator.userAgent.indexOf("MSIE")!=-1)a.style.cursor=c=="grab"?"url('"+khtml.maplib.standardimagepath+"hand.cur'), default":c=="grabbing"?"url('"+khtml.maplib.standardimagepath+"fist.cur'), move":"pointer";else if(a.style.cursor="-moz-"+c,a.style.cursor!="-moz-"+c&&(a.style.cursor="-webkit-"+c,a.style.cursor!="-webkit-"+c&&(a.style.cursor="-ms-"+c,a.style.cursor!="-ms-"+c&&(a.style.cursor="-khtml-"+c,a.style.cursor!="-khtml-"+c&&(a.style.cursor=
    c,a.style.cursor!=c)))))a.style.cursor="pointer"};
khtml.maplib.base.helpers.reduceToJSON=function(a,c){var d=["type","features","coordinates","style","className","baseVal","geometry","fill","stroke","strokeWidth","opacity","fillOpacity","strokeOpacity","dashArray","marker","icon","shadow","url","draggable","size","origin","anchor","width","height","x","y"];if(a instanceof khtml.maplib.geometry.LatLng)return[a.lng(),a.lat()];c||(c=0);if(!(c>15)){var b={};if(typeof a=="string"||typeof a=="number")return a;if(a instanceof Array){d=[];for(var e=0;e<
    a.length;e++)d[e]=khtml.maplib.base.helpers.reduceToJSON(a[e],c+1);return d}if(a instanceof CSSStyleDeclaration){d={};for(e=0;e<a.length;e++)d[a[e]]=a[a[e]];return d}for(var g in a){var f=!0;for(e=0;e<d.length;e++)if(d[e]==g){f=!1;break}f||(b[g]=typeof a[g]=="string"?a[g]:khtml.maplib.base.helpers.reduceToJSON(a[g],c+1))}return b}};khtml.maplib.base.Map=function(a){typeof a=="string"&&(a=document.getElementById(a));(typeof a!="object"||null==a)&&console.log("Error: map is null or not an object. (map: "+a+")");this.addOverlay=function(f){if(null==f||f instanceof Array)return console.log('Map.addOverlay(): Illegal argument (was "null" or "Array")'),!1;this.overlays.push(f);typeof f.init=="function"&&f.init(this);this.renderOverlay(f)};this.addOverlays=function(f){if(f instanceof Array)for(var b=0;b<f.length;b++)this.addOverlay(f[b]);
else this.addOverlay(f)};this.renderOverlay=function(f){try{f.render()}catch(b){}};this.renderOverlays=function(){this.overlayDiv.style.display="";for(obj in this.overlays)this.overlays[obj].render()};this._hideOverlays=function(){this.overlayDiv.style.display="none";for(obj in this.overlays)this.overlays[obj].hide&&this.overlays[obj].hide(e)};this.removeOverlays=function(){for(;this.overlays.length>0;)this.overlays.pop().clear()};this.stopRenderOverlays=function(){for(obj in this.overlays)typeof this.overlays[obj].cancel==
    "function"&&this.overlays[obj].cancel()};this.removeOverlay=function(f){for(var b=0;b<this.overlays.length;b++)if(f==this.overlays[b]){f.clear();this.overlays.splice(b,1);break}};this.callbackFunctions=[];this.addCallbackFunction=function(f){typeof f=="function"&&this.callbackFunctions.push(f)};this._executeCallbackFunctions=function(){for(var f=0;f<this.callbackFunctions.length;f++)this.callbackFunctions[f].call(this)};this.myTimer=function(f){this.reset=function(){this._isRunning=!1};this.isTimeRunning=
    function(){if(!1==this._isRunning)return!1;if(this.time+this.myInterval>(new Date).getTime())return!1;this._isRunning=!1;return!0};this.start=function(){this._isRunning=!0;this.time=(new Date).getTime()};this.interval=function(f){if(typeof f!="undefined")this.myInterval=parseInt(f);return this.myInterval};this.reset();this.interval(f);return this};this.oldMoveY=this.oldMoveX=0;this.moving=!1;this._start=function(f){f.preventDefault?f.preventDefault():f.returnValue=!1;this.moving=this.center();this.downEvent=
    f;this.moveAnimationBlocked=!0;if(f.touches.length==1){this.startMoveX=this.moveX-this.pageX(f.touches[0])/this.faktor/this.sc;this.startMoveY=this.moveY-this.pageY(f.touches[0])/this.faktor/this.sc;if(this.mousedownTime!=null&&(new Date).getTime()-this.mousedownTime<this._doubleclickTime){var b=Math.ceil(0.01+this._getZoom()-this.intZoom);this._autoZoom(this.pageX(f.touches[0]),this.pageY(f.touches[0]),b)}this.mousedownTime=(new Date).getTime();clearTimeout(this.zoomOutInterval);this.zoomOutInterval=
    window.setInterval(function(){},20)}if(f.touches.length==2){window.clearInterval(this.zoomOutInterval);this.moveok=!1;b=this.pageX(f.touches[0]);var a=this.pageY(f.touches[0]),c=this.pageX(f.touches[1]);f=this.pageY(f.touches[1]);this.startDistance=Math.sqrt(Math.pow(c-b,2)+Math.pow(f-a,2));this.startZZ=this.position.zoom;f=(a+f)/2/this.faktor/this.sc;this.startMoveX=this.moveX-(b+c)/2/this.faktor/this.sc;this.startMoveY=this.moveY-f}this.oldMoveX=this.moveX;this.oldMoveY=this.moveY};this.moveok=
    !0;this._move=function(f){f.preventDefault?f.preventDefault():f.returnValue=!1;this.moveEvent=f;if(f.touches.length==1&&this.moveok){this.lastMoveX=this.moveX;this.lastMoveY=this.moveY;this.lastMoveTime=new Date(f.timeStamp);this.moveX=this.pageX(f.touches[0])/this.faktor/this.sc+this.startMoveX;this.moveY=this.pageY(f.touches[0])/this.faktor/this.sc+this.startMoveY;if(!this.zoomOutStarted){if(Math.abs(this.moveX-this.oldMoveX)>5||Math.abs(this.moveY-this.oldMoveY)>5)window.clearInterval(this.zoomOutInterval),
    this.zoomOutSpeed=0.01,this.mousedownTime=null;var b=new khtml.maplib.LatLng(this.lat,this.lng);this.setCenter2(b,this.position.zoom);this.moveAnimationBlocked=!1}if(Math.abs(this.moveX-this.oldMoveX)>5||Math.abs(this.moveY-this.oldMoveY)>5)this.mousedownTime=null}if(f.touches.length==2){this.mousedownTime=null;var a=this.pageX(f.touches[0]),c=this.pageY(f.touches[0]),e=this.pageX(f.touches[1]),g=this.pageY(f.touches[1]);b=Math.sqrt(Math.pow(e-a,2)+Math.pow(g-c,2))/this.startDistance;f=this.startZZ+
    b-1;f>this.tileSource.maxzoom?(f=this.tileSource.maxzoom,b=this.zoomDeltaOld):this.zoomDeltaOld=b;a=(a+e)/2;c=(c+g)/2;faktor=Math.pow(2,f);e=a/faktor-this.width/2;g=c/faktor-this.height/2;b=Math.pow(2,b-1);this.moveX=(a+(e-e*b))/faktor+this.startMoveX;this.moveY=(c+(g-g*b))/faktor+this.startMoveY;b=new khtml.maplib.LatLng(this.lat,this.lng);this.setCenter2(b,f)}};this._end=function(f){f.preventDefault?f.preventDefault():f.returnValue=!1;window.clearInterval(this.zoomOutInterval);this.zoomOutStarted=
    !1;this.zoomOutSpeed=0.01;if(f.touches.length==0&&(this.moveok=!0,this.moveAnimationMobile&&this.moveAnimationBlocked==!1)){var b=new Date(f.timeStamp)-this.lastMoveTime,a=(this.lastMoveX-this.moveX)/b*4;b=(this.lastMoveY-this.moveY)/b*4;var c=this.wheelSpeedConfig.animateMaxSpeed;a>c&&(a=c);b>c&&(b=c);a<-c&&(a=-c);b<-c&&(b=-c);c=Math.pow(2,this.zoom());this._animateMove(a,b,c)}if(f.touches.length==1)this.startMoveX=this.moveX-f.touches[0].pageX/this.faktor/this.sc,this.startMoveY=this.moveY-f.touches[0].pageY/
    this.faktor/this.sc};this.pageX=function(f){try{return(f.pageX===void 0?f.clientX+document.body.scrollLeft+document.documentElement.scrollLeft:f.pageX)-this.mapLeft}catch(b){return this.lastMouseX}};this.pageY=function(f){try{return(f.pageY===void 0?f.clientY+document.body.scrollTop+document.documentElement.scrollTop:f.pageY)-this.mapTop}catch(b){return this.lastMouseY}};this.doubleclickBlocked=!1;this._doubleclick=function(f){var b;if(!f)f=window.event;f.which?b=f.which==3:f.button&&(b=f.button==
    2);b?this._discretZoom(-1,this.pageX(f),this.pageY(f)):this._discretZoom(1,this.pageX(f),this.pageY(f))};this._mousedown=function(f){this.mapParent.focus();f.preventDefault?f.preventDefault():window.event.returnValue=!1;this.downEvent=f;this.lastMouseX=this.pageX(f);this.lastMouseY=this.pageY(f);this.moveAnimationBlocked=!0;if(this.mousedownTime2!=null&&(new Date).getTime()-this.mousedownTime2<this._doubleclickTime2)this._doubleclick(f);else{this.mousedownTime2=(new Date).getTime();if(f.shiftKey){this.selectRectLeft=
    this.pageX(f);this.selectRectTop=this.pageY(f);this.selectRect=document.createElement("div");this.selectRect.style.left=this.selectRectLeft+"px";this.selectRect.style.top=this.selectRectTop+"px";this.selectRect.style.border="1px solid gray";if(!this.internetExplorer)this.selectRect.style.opacity=0.5,this.selectRect.style.backgroundColor="white";this.selectRect.style.position="absolute";this.map.parentNode.appendChild(this.selectRect);khtml.maplib.base.helpers.setCursor(this.mapParent,"crosshair")}else this.moving=
    this.center(),this.startMoveX=this.moveX-this.pageX(f)/this.faktor/this.sc,this.startMoveY=this.moveY-this.pageY(f)/this.faktor/this.sc,this.movestarted=!0,khtml.maplib.base.helpers.setCursor(this.mapParent,"grabbing");return!1}};this._mousemove=function(f){f.preventDefault?f.preventDefault():window.event.returnValue=!1;this.moveEvent=f;this.lastMouseX=this.pageX(f);this.lastMouseY=this.pageY(f);if(f.shiftKey){if(this.selectRect){this.selectRect.style.width=Math.abs(this.pageX(f)-this.selectRectLeft)+
    "px";this.selectRect.style.height=Math.abs(this.pageY(f)-this.selectRectTop)+"px";if(this.pageX(f)<this.selectRectLeft)this.selectRect.style.left=this.pageX(f)+"px";if(this.pageY(f)<this.selectRectTop)this.selectRect.style.top=this.pageY(f)+"px"}}else if(this.movestarted)this.lastMoveX=this.moveX,this.lastMoveY=this.moveY,this.lastMoveTime=new Date(f.timeStamp),this.moveX=this.pageX(f)/this.faktor/this.sc+this.startMoveX,this.moveY=this.pageY(f)/this.faktor/this.sc+this.startMoveY,this.setCenter2(new khtml.maplib.LatLng(this.lat,
    this.lng),this.position.zoom),this.moveAnimationBlocked=!1;return!1};this._mouseup=function(f){khtml.maplib.base.helpers.setCursor(this.mapParent,"grab");this.lastMouseX=this.pageX(f);this.lastMouseY=this.pageY(f);if(this.moveMarker)this.moveMarker=null;if(this.selectRect){var b=this.XYTolatlng(this.selectRect.offsetLeft,this.selectRect.offsetTop+this.selectRect.offsetHeight),a=this.XYTolatlng(this.selectRect.offsetLeft+this.selectRect.offsetWidth,this.selectRect.offsetTop);this._setBounds(new khtml.maplib.geometry.Bounds(b,
    a));this.selectRect.parentNode.removeChild(this.selectRect);this.selectRect=null}b=new Date(f.timeStamp)-this.lastMoveTime;if(this.wheelSpeedConfig.moveAnimateDesktop&&b!=0&&this.movestarted&&this.moveAnimationBlocked==!1)f=(this.lastMoveX-this.moveX)/b,b=(this.lastMoveY-this.moveY)/b,a=this.wheelSpeedConfig.animateMaxSpeed,f>a&&(f=a),b>a&&(b=a),f<-a&&(f=-a),b<-a&&(b=-a),a=Math.pow(2,this.zoom()),this._animateMove(f,b,a);var c=this;setTimeout(function(){c.movestarted=!1},1)};this._mouseupIE=function(f){f.preventDefault?
    f.preventDefault():f.returnValue=!1;this.lastMouseX=this.pageX(f);this.lastMouseY=this.pageY(f);this.setCenter2(this.XYTolatlng(this.lastMouseX,this.lastMouseY),this.zoom())};this.startZoomTime=null;this._mousewheel=function(f){f.preventDefault?f.preventDefault():f.returnValue=!1;this.mapParent.focus();if(!f)f=window.event;if(f.wheelDelta)var b=f.wheelDelta/60;else if(f.detail)b=-f.detail/3,this.lastWheelDelta*b<0&&(this.wheelSpeedConfig.digizoom||(b=0)),this.lastWheelDelta=-f.detail/3;b=b<0?-1:1;
    if(this.wheelSpeedConfig.digizoom)this._discretZoom(b,this.pageX(f),this.pageY(f));else{if(!this.startZoomTime)this.startZoomTime=new Date,this.startZoomTime2=new Date,this.oldZoom=this.zoom(),this.speed=1;var a=new Date-this.startZoomTime,c=new Date-this.startZoomTime2;this.startZoomTime=new Date;if(a>300)this.startZoomTime2=new Date,this.oldZoom=this.zoom(),this.speed=1,c=0.1;this.speed*=2;if(this.speed>5)this.speed=5;b=this.oldZoom+c/3E3*this.speed*b*(f.shiftKey?0.1:1);if(b>this.position.maxZoom)b=
        this.position.maxZoom;if(b<this.position.minZoom)b=this.position.minZoom;this.centerAndZoomXY(this.center(),b,this.pageX(f),this.pageY(f))}};this._shiftkeydown=function(f){f.shiftKey&&khtml.maplib.base.helpers.setCursor(this.mapParent,"crosshair")};this._shiftkeyup=function(){khtml.maplib.base.helpers.setCursor(this.mapParent,"grab")};this.zoomTimeouts=[];this.discretZoomBlocked=!1;this._discretZoom=function(f,b,a){if(!this.discretZoomBlocked){var c=this;this.discretZoomBlockedTimeout=setTimeout(function(){c.discretZoomBlocked=
    !1},200);this.discretZoomBlocked=!0;for(var e=1;e<=20;e++)this.zoomTimeouts[e]&&clearTimeout(this.zoomTimeouts[e]);e=this.zoom();var g=f==1?Math.ceil(this.zoom()+0.9):Math.floor(this.zoom()-0.9);g=Math.abs(e-g);var d=0;for(e=1;e<=20;e++){var p=f*Math.sin(e/20*Math.PI/2)*g;this.zoomTimeouts[e]=this._discretZoomExec(b,a,p-d,e,20);d=p}}};this._discretZoomExec=function(f,b,a,c,e){var g=this;return setTimeout(function(){var d=g.zoom()+a;c==e&&(d=Math.round(d));g.centerAndZoomXY(g.center(),d,f,b)},c*20)};
    this.digizoomblocked=!1;this.wheelZoomTimeout=this.digizoomblockedTimeout=null;this._animateMove=function(f,b,a){if(!this.internetExplorer){clearTimeout(this.animateMoveTimeout);if(Math.abs(f)<this.wheelSpeedConfig.animateMinSpeed/a&&Math.abs(b)<this.wheelSpeedConfig.animateMinSpeed/a)this.moving=!1;else{this.moveX+=-f;this.moveY+=-b;var c=this,e=Math.sqrt(Math.pow(f,2)+Math.pow(b,2)),g=f/e,d=b/e;this.animateMoveTimeout=window.setTimeout(function(){c._animateMove(f-g*c.wheelSpeedConfig.moveAnimationSlowdown/
        a,b-d*c.wheelSpeedConfig.moveAnimationSlowdown/a,a)},20)}this.setCenter2(this.position.center,this.position.zoom)}};this.autoZoomStartTime=this.autoZoomInTimeout=null;this._autoZoom=function(f,b,a){this.autoZoomInTimeout&&window.clearTimeout(this.autoZoomInTimeout);var c=0.2;a<0&&(c=-c);zoomGap=!1;Math.abs(a)<=Math.abs(c)&&(zoomGap=!0);var e=this.position.zoom+c;e=Math.round(e*1E3)/1E3;zoomGap&&(e=a<0?Math.floor(e):Math.ceil(e-0.2),c=e-this.position.zoom);faktor=Math.pow(2,e);var g=f-this.mapLeft-
        this.width/2,d=b-this.mapTop-this.height/2,p=Math.pow(2,c);g-=g*p;d-=d*p;var w=this;p=(new Date).getMilliseconds();var u=this.autoZoomStartTime?p-this.autoZoomStartTime:0;this.autoZoomStartTime=p;if(u<100||zoomGap){e>=this.tileSource.minzoom&&e<=this.tileSource.maxzoom&&(this.moveX+=g/faktor,this.moveY+=d/faktor);var t=new khtml.maplib.LatLng(this.lat,this.lng);if(e>this.tileSource.maxzoom)e=this.tileSource.maxzoom;if(e<this.tileSource.minzoom)e=this.tileSource.minzoom;setTimeout(function(){w.setCenter2(t,
        e)},1)}var x=a-c;zoomGap?this.digizoomblocked=!1:this.autoZoomInTimeout=window.setTimeout(function(){w._autoZoom(f,b,x)},40)};this.centerAndZoomXY=function(f,b,a,c){faktor=Math.pow(2,b);f=a-this.size.width/2;c-=this.size.height/2;a=b-this.zoom();a=Math.pow(2,a);f-=f*a;c-=c*a;b>=this.tileSource.minzoom&&b<=this.tileSource.maxzoom&&(this.moveX+=f/faktor,this.moveY+=c/faktor);f=new khtml.maplib.LatLng(this.lat,this.lng);if(b>this.tileSource.maxzoom)b=this.tileSource.maxzoom;if(b<this.tileSource.minzoom)b=
        this.tileSource.minzoom;this.setCenter2(f,b)};this.centerAndZoom=function(b,a){this.moveY=this.moveX=0;if(a>this.tileSource.maxzoom)a=this.tileSource.maxzoom;if(a<this.tileSource.minzoom)a=this.tileSource.minzoom;this.record();this.setCenterNoLog(b,a)};this.render=function(){this.center(this.center())};this._setCenter3=function(b,a){this.moveY=this.moveX=0;this.setCenterNoLog(b,a)};this.setCenter2=function(b,a){this.record();this.setCenterNoLog(b,a)};this.setCenterNoLog=function(b,a){this.position.center=
        b;this.lat=b.lat();this.lng=b.lng();a=parseFloat(a);if(a>this.tileSource.maxzoom)a=this.tileSource.maxzoom;if(a<this.tileSource.minzoom)a=this.tileSource.minzoom;this.position.center=b;this.position.zoom=a;this.layer(this.map,this.lat,this.lng,this.moveX,this.moveY,a);this._executeCallbackFunctions();this._getBounds()};this.center=function(b){typeof b!="undefined"&&this.centerAndZoom(b,this._getZoom());if(this.moveX!=0||this.moveY!=0)return b=new khtml.maplib.LatLng(this.movedLat,this.movedLng);return this.position.center};
    this.zoom=function(b){typeof b!="undefined"&&this.centerAndZoom(this.position.center,b);return this.position.zoom};this.moveXY=function(b,a){this.moveX=parseFloat(b)/this.faktor/this.sc+this.moveDelayedX;this.moveY=parseFloat(a)/this.faktor/this.sc+this.moveDelayedY;this.setCenter2(this.center(),this.zoom())};this.tiles=function(b){this.clearMap();this.tileSource=b};this.tileOverlays=[];this.addTilesOverlay=function(b){this.tileOverlays.push(b);b=this.tileOverlays[this.tileOverlays.length-1];this.clearMap();
        return b};this.removeTilesOverlay=function(b){for(var a=0;a<this.tileOverlays.length;a++)if(b==this.tileOverlays[a]){this.tileOverlays.splice(a,1);break}this.clearMap()};this._getCenter=function(){if(this.moveX&&this.moveX!=0||this.moveY&&this.moveY!=0)var b=new khtml.maplib.LatLng(this.movedLat,this.movedLng);else if(this.position.center)b=this.position.center;return b};this.bounds=function(b){if(typeof b!="undefined")this._setBounds(b);else return this.mapBounds};this.mapBounds=null;this._getBounds=
        function(){var b=this.XYTolatlng(0,this.height),a=this.XYTolatlng(this.width,0);this.mapBounds=new khtml.maplib.geometry.Bounds(b,a)};this._setBounds=function(f){if(typeof khtml.maplib.geometry.Bounds=="undefined"||!(f instanceof khtml.maplib.geometry.Bounds))return!1;var a=f.sw();f=f.ne();var c=a.lat(),e=f.lat();a=a.lng();f=f.lng();c=d(c);var g=d(e);e=(a+f)/2;var n=b((c+g)/2);e=new khtml.maplib.LatLng(n,e);c=Math.abs(g-c);a=Math.abs(f-a);a/this.width>c/this.height?f=this.width:(a=c,f=this.height);
        a=Math.log(360/a/(512/f))/Math.log(2)+1;if(a>this.tileSource.maxzoom)a=this.tileSource.maxzoom;if(a<this.tileSource.minzoom)a=this.tileSource.minzoom;this.position.center?this.wheelSpeedConfig.rectShiftAnimate?this.animatedGoto(e,a,this.wheelSpeedConfig.rectShiftAnimationTime):this.centerAndZoom(e,a):this.centerAndZoom(e,a)};this.animatedGotoStep=null;this.animatedGotoTimeout=[];this.animatedGoto=function(b,a,c){c/=10;var e=this._getCenter(),g=b.lat();b=b.lng();var d=e.lat(),o=e.lng(),p=this._getZoom(),
        w=(g-d)/c,u=(b-o)/c,t=(a-p)/c,x=this.moveX/c,H=this.moveY/c,I=this.moveX,y=this.moveY;this.animatedGotoStep=0;for(var A=this;timeout=this.animatedGotoTimeout.pop();)clearTimeout(timeout);for(a=0;a<=c;a++)this.animatedGotoTimeout[a]=window.setTimeout(function(){A._animatedGotoExec(d,o,p,w,u,t,I,y,x,H)},10*a)};this._animatedGotoExec=function(b,a,c,e,g,d,o,p,w,u){this.moveX=-w;this.moveY=-u;b+=e*this.animatedGotoStep;a+=g*this.animatedGotoStep;c+=d*this.animatedGotoStep;this.animatedGotoStep++;this.centerAndZoom(new khtml.maplib.LatLng(b,
        a),c)};this._getZoom=function(){return this.position.zoom};this._gettZoom=function(){return this.intZoom};this.latlngToXY=function(b){var a=b.lat();b=b.lng();a>90&&(a-=180);a<-90&&(a+=180);var e=this._gettZoom();b=c(a,b,e);a=this._getCenter();a=c(a.lat(),a.lng(),e);e=(a[0]-b[0])*this.tileW*this.sc-this.width/2;a=(a[1]-b[1])*this.tileW*this.sc-this.height/2;b=[];b.x=-e;b.y=-a;return b};this.XYTolatlng=function(a,e){var g=this._getCenter();if(g){var d=Math.pow(2,this.intZoom),l=g.lat();g=g.lng();
        g=c(l,g,this.intZoom);l=(g[0]+(a-this.width/2)/this.tileW/this.sc)/d*360-180;d=-b((g[1]+(e-this.height/2)/this.tileH/this.sc)/d*360-180)+0;return new khtml.maplib.LatLng(d,l)}};this.mouseToLatLng=function(b){var a=this.pageX(b);b=this.pageY(b);return this.XYTolatlng(a,b)};this.reSize=function(){var b=this;window.setTimeout(function(){b._getSize(b)},1050)};this._getSize=function(){this.width=this.map.parentNode.offsetWidth;this.height=this.map.parentNode.offsetHeight;var b=this.map,a=0,c=0;do a+=b.offsetLeft,
        c+=b.offsetTop,b=b.offsetParent;while(b.offsetParent);this.mapTop=c;this.mapLeft=a};this.recordArray=[];this.record=function(){var b=this._getCenter();if(b){var a=b.lat();b=b.lng();var c=this._getZoom();this.recordArray.push([a,b,c])}};this.play=function(b){if(!(b<1)&&!(b>this.recordArray.length-1)){b=this.recordArray[b];var a=new khtml.maplib.LatLng(b[0],b[1]);this.moveY=this.moveX=0;this._setCenter3(a,b[2])}};this.layerDrawLastFrame=null;this.doTheOverlays=!0;this.finalDraw=!1;this.moveDelayedY=
        this.moveDelayedX=this.layerOldZoom=0;this.layerTimer=new this.myTimer(300);this.layer=function(b,a,c,e,g,d){this.stopRenderOverlays();d||(d=this._getZoom());var o=this.wheelSpeedConfig.digizoom?Math.floor(d):Math.round(d);this.layerDrawLastFrame&&window.clearTimeout(this.layerDrawLastFrame);if(this.layerTimer.isTimeRunning()||this.finalDraw==!1){var p=this,w=function(){if(o==p.visibleZoom)p.finalDraw=!0;p.layer(b,a,c,e,g,d)};this.visibleZoom=parseInt(this.visibleZoom);this.visibleZoom=parseInt(this.visibleZoom);
        if(!p.finalDraw)this.layerDrawLastFrame=window.setTimeout(w,100);if(this.layerTimer.isTimeRunning()){this.moveDelayedX=e;this.moveDelayedY=g;return}}this.layerTimer.start();for(w=this.moveDelayedY=this.moveDelayedX=0;w<22;w++)if(this.layers[w])this.layers[w].layerDiv.style.visibility="hidden";o=this.wheelSpeedConfig.digizoom?Math.floor(d):Math.round(d);if(this.layerOldZoom>d&&!this.finalDraw&&this.layers[o]&&!this.layers[o].loadComplete)this.visibleZoom=o+1;this.intZoom=o;if(o>this.tileSource.maxzoom)o=
        this.tileSource.maxzoom;if(!this.visibleZoom)this.oldtZoom=this.visibleZoom=o;this.faktor=Math.pow(2,o);this.sc=Math.pow(2,d-o);this.loadingZoomLevel=o;if(this.visibleZoom<o&&Math.abs(this.visibleZoom-o)<4)this.loadingZoomLevel=parseInt(this.visibleZoom)+1;this.draw(this.map,a,c,e,g,this.loadingZoomLevel,d,this.tileSource.src);this.layers[this.loadingZoomLevel].layerDiv.style.visibility="";if(o!=this.visibleZoom)this.visibleZoom<o+2?(this.draw(this.map,a,c,e,g,this.visibleZoom,d,this.tileSource.src),
        this.layers[this.visibleZoom].layerDiv.style.visibility=""):this.layers[this.visibleZoom].layerDiv.style.visibility="hidden";if(o==this.visibleZoom)this.draw(this.map,a,c,e,g,this.visibleZoom-1,d,this.tileSource.src),this.layers[this.visibleZoom-1].layerDiv.style.visibility="hidden";if(this.layers[this.loadingZoomLevel].loadComplete&&this.visibleLayer!=o)this.layers[this.loadingZoomLevel].loadComplete=!1,this._hideLayer(this.visibleZoom),this.visibleZoom=this.loadingZoomLevel;this.quadtreeTimeout&&
    clearTimeout(this.quadtreeTimeout);if(this.loadingZoomLevel!=o)p=this,this.quadtreeTimeout=window.setTimeout(function(){p.layer(b,a,c,e,g)},200);this.oldtZoom!=this.intZoom&&this.oldtZoom!=this.visibleZoom&&this._hideLayer(this.oldtZoom);this.oldtZoom=o;this.delayedOverlay&&window.clearTimeout(this.delayedOverlay);this.doTheOverlays||this.finalDraw||this.layerOldZoom==this.zoom()?(w=new Date,this.lastDX=this.moveX,this.lastDY=this.moveY,this.renderOverlays(),this.layerOldZoom=this.zoom(),
        this.doTheOverlays=new Date-w>10&&!this.finalDraw?!1:!0):this._hideOverlays();p=this;this.layerBlockTimeout&&clearTimeout(this.layerBlockTimeout);this.layerBlockTimeout=window.setTimeout(function(){p.layerTimer.reset()},20);this.finalDraw=!1};this.draw=function(a,e,g,k,l,n,o,p){this.framesCounter++;var w=this;window.setTimeout(function(){w.framesCounter--},1E3);var u=Math.pow(2,n);if(this.layers[n])t=this.layers[n].layerDiv,x=d(e)-this.layers[n].startLat,g-=this.layers[n].startLng;else{x=c(e,g,n);
        this.layers[n]=[];this.layers[n].startTileX=x[0];this.layers[n].startTileY=x[1];this.layers[n].startLat=d(e);this.layers[n].startLng=g;this.layers[n].images={};var t=document.createElement("div");t.setAttribute("zoomlevel",n);t.style.position="absolute";x=a.childNodes;a=!1;for(g=x.length-1;g>=0;g--)e=x.item(g),e.getAttribute("zoomlevel")<n&&(this.map.insertBefore(t,e),a=!0);a||this.map.appendChild(t);this.layers[n].layerDiv=t;var x=0;g=0}t.style.visibility="hidden";t.style.opacity=1;t.style.filter=
        "alpha(opacity=100)";this.movedLng=(this.layers[n].startTileX/u-k/this.tileW)*360-180+g;this.movedLat=-b((this.layers[n].startTileY/u-l/this.tileH)*360-180-x);x=c(this.movedLat,this.movedLng,n);k=x[0];g=x[1];l=Math.floor(k);a=Math.floor(g);e=this.layers[n].startTileX;var H=this.layers[n].startTileY;k=k-e-(-e+Math.floor(e));var I=g-H-(-H+Math.floor(H)),y;for(y in this.layers[n].images)this.layers[n].images[y].visibility=!1;g=this.width;var A=this.height;C=Math.pow(2,o-n);minX=Math.floor(-g/2/C/this.tileW+
        k);maxX=Math.ceil(g/2/C/this.tileW+k);minY=Math.floor(-A/2/C/this.tileH+I);maxY=Math.ceil(A/2/C/this.tileH+I);for(g=minX;g<maxX;g++)for(A=minY;A<maxY;A++){var z=Math.floor(e+g),q=Math.floor(H+A),D=z%u,B=q;D<0&&(D+=u);if(!(B<0)&&!(B>=u)){var F=p(D,B,n);z=F+"-"+z+"-"+q;minsc=this.wheelSpeedConfig.digizoom?1:0.5;if(this.layers[n].images[z]==null&&C>=minsc){q=document.createElement("img");q.style.visibility="hidden";q.style.position="absolute";q.style.padding="0px";q.style.margin="0px";q.style.borderWidth=
        "0px";q.style.left=g*this.tileW+"px";q.style.top=A*this.tileH+"px";q.style.width=this.tileW+"px";q.style.height=this.tileH+"px";if(this.tileSource.opacity)q.style.opacity=this.tileSource.opacity;t.childNodes.length>0?t.insertBefore(q,t.childNodes.item(0)):t.appendChild(q);this.layers[n].images[z]={};this.layers[n].images[z].img=q;this.layers[n].images[z].array=[];this.layers[n].images[z].array.push(q);this.layers[n].loadComplete=!1;for(ov in this.tileOverlays){var G=this.tileOverlays[ov],E=q.cloneNode(!0);
        G=G.src(D,B,n);E.setAttribute("overlay",ov);khtml.maplib.base.helpers.eventAttach(E,"load",this._imgLoaded,this,!1);t.appendChild(E);E.setAttribute("src",G);this.layers[n].images[z].array.push(E)}khtml.maplib.base.helpers.eventAttach(q,"load",this._imgLoaded,this,!1);khtml.maplib.base.helpers.eventAttach(q,"error",this._imgError,this,!1);q.setAttribute("src",F)}if(!this.css3d&&this.layers[n].images[z]){D=this.layers[n].images[z].array;for(B=0;B<D.length;B++){var J=x[0]-l+Math.floor(k);E=x[1]-a+Math.floor(I);
        var K=Math.round(this.tileW*C);G=Math.round(this.tileH*C);F=Math.floor(-J*K+g*K);q=Math.floor(-E*G+A*G);J=Math.floor(-J*K+(g+1)*K);E=Math.floor(-E*G+(A+1)*G);D[B].style.left=F+"px";D[B].style.top=q+"px";D[B].style.height=J-F+"px";D[B].style.width=E-q+"px"}}this.layers[n].images[z]&&(this.layers[n].images[z].visibility=!0)}}for(y in this.layers[n].images)if(this.layers[n].images[y].visibility){if(this.layers[n].images[y].array[0].getAttribute("loaded")=="yes"){p=this.layers[n].images[y].array;for(u=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 0;u<p.length;u++)if(p[u].getAttribute("loaded")=="yes")p[u].style.visibility=""}}else{p=this.layers[n].images[y].array;for(u=0;u<p.length;u++)this.layers[n].images[y].array[u].style.visibility="hidden",this.layers[n].images[y].array[u].getAttribute("loaded")!="yes"&&t.removeChild(this.layers[n].images[y].array[u]);delete this.layers[n].images[y].img;delete this.layers[n].images[y]}var C=Math.pow(2,o-n);F=-k*this.tileW;q=-I*this.tileH;if(this.css3d)t.style["-webkit-transform-origin"]=-1*F+"px "+-1*
        q+"px",t.style.webkitTransform="translate3d("+F+"px,"+q+"px,0px)  "+(" scale3d("+C+","+C+",1) ");t.style.visibility="";t.style.opacity=1;t.style.filter="";t=o=0;for(y in this.layers[this.loadingZoomLevel].images)t++,q=this.layers[this.loadingZoomLevel].images[y].array[0],q.getAttribute("loaded")!="yes"&&o++;this.notLoadedImages=o;o<1&&(this.layers[this.loadingZoomLevel].loadComplete=!0);this.loadingZoomLevel==n&&this._imgLoadInfo(t,o)};this.fadeOutTimeout=null;this._fadeOut=function(b,a){this.fadeOutTimeout&&
    clearTimeout(this.fadeOutTimeout);if(a>0){b.style.opacity=a;b.style.filter="alpha( opacity="+a*100+" )";var c=this;this.fadeOutTimeout=setTimeout(function(){c._fadeOut(b,a-0.2)},40)}else b.style.visibility="hidden"};this._hideLayer=function(b){if(this.intZoom!=b&&this.layers[b])this.layers[b].layerDiv.style.opacity=1,this.layers[b].layerDiv.style.filter="alpha(opacity=100)",this._fadeOut(this.layers[b].layerDiv,1);if(this.layers[b])for(var a in this.layers[b].images)if(this.layers[b].images[a]&&this.layers[b].images[a].img&&
        this.layers[b].images[a].img.getAttribute("loaded")!="yes"&&b!=this.intZoom){for(var c=this.layers[b].images[a].array,e=0;e<c.length;e++)this.layers[b].layerDiv.removeChild(this.layers[b].images[a].array[e]);delete this.layers[b].images[a].img;delete this.layers[b].images[a]}};this._imgLoaded=function(b){b=b.target?b.target:b.srcElement;var a=!0;b.style.visibility="";b.setAttribute("loaded","yes");if(b.parentNode){for(var c=0,e=0,g=b.parentNode.getAttribute("zoomlevel"),d=0;d<b.parentNode.getElementsByTagName("img").length;d++){var o=
        b.parentNode.getElementsByTagName("img").item(d);o.getAttribute("overlay")||(e++,o.getAttribute("loaded")!="yes"&&(c++,a=!1))}this.notLoadedImages=c;this.loadingZoomLevel==g&&this._imgLoadInfo(e,c);if((this.layers[g].loadComplete=a)&&this.loadingZoomLevel==g)this._hideLayer(this.visibleZoom),this._hideLayer(this.visibleZoom+1),this.visibleZoom=g}};this._imgError=function(b){var a=b.target?b.target:b.srcElement;a.parentNode&&(a.src!="http://khtml.org/notfound.png"&&a.setAttribute("src","http://khtml.org/notfound.png"),
        this._imgLoaded(b))};var c=function(b,a,c){return[(a+180)/360*(1<<c),(1-Math.log(Math.tan(b*Math.PI/180)+1/Math.cos(b*Math.PI/180))/Math.PI)/2*(1<<c)]};this._calculateMapSize=function(){var b=this.mapParent.getBoundingClientRect();return{top:b.top-document.body.scrollTop,left:b.left-document.body.scrollLeft,width:b.width?b.width:b.right-b.left,height:b.height?b.height:b.bottom-b.top,deltaTop:b.top-document.body.scrollTop,deltaLeft:b.left-document.body.scrollLeft,deltaBottom:b.bottom,deltaRight:b.right}};
    this.redraw=function(){this._setMapPosition()};this._setMapPosition=function(){this.size=this._calculateMapSize();var b=this.mapParent;b.currentStyle||window.getComputedStyle&&document.defaultView.getComputedStyle(b,null);this.mapTop=this.size.top;this.mapLeft=this.size.left;this.width=this.size.width;this.height=this.size.height;relativetop=this.size.deltaTop;relativeleft=this.size.deltaLeft;this.clone.style.top="0px";this.clone.style.left="0px";this.clone.style.width="100%";this.clone.style.height=
        "100%";this.clone.style.position="relative";this.clone.style.overflow="hidden";this.map.style.left="50%";this.map.style.top="50%";this._getCenter()&&this._getZoom()&&this.centerAndZoom(this._getCenter(),this._getZoom());this._copyright()};this.clearMap=function(){if(this.map){for(;this.map.firstChild;)this.map.removeChild(this.map.firstChild);for(;this.layers.length>0;)this.layers.pop();this.redraw()}};var d=function(b){return 180/Math.PI*Math.log(Math.tan(Math.PI/4+b*(Math.PI/180)/2))},b=function(b){return 180/
        Math.PI*(2*Math.atan(Math.exp(b*Math.PI/180))-Math.PI/2)};this._imgLoadInfo=function(b,a){if(!this.loadInfoDiv)this.loadInfoDiv=document.createElement("div"),this.loadInfoDiv.style.position="absolute",this.loadInfoDiv.style.top="0px",this.loadInfoDiv.style.right="0px",this.loadInfoDiv.style.backgroundColor="white",this.loadInfoDiv.style.border="1px solid gray",this.loadInfoDiv.style.fontSize="10px",this.map.parentNode.appendChild(this.loadInfoDiv);if(a==0)this.loadInfoDiv.style.display="none";else{for(this.loadInfoDiv.style.display=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       "";this.loadInfoDiv.firstChild;)this.loadInfoDiv.removeChild(this.loadInfoDiv.firstChild);this.loadInfoDiv.appendChild(document.createTextNode(a+" images to load"))}};this.copyrightdiv=null;this._copyright=function(){if(this.copyrightdiv==null)this.copyrightdiv=document.createElement("div"),this.overlayDiv.appendChild(this.copyrightdiv);for(;this.copyrightdiv.firstChild;)this.copyrightdiv.removeChild(this.copyrightdiv.firstChild);var b=document.createElement("img"),a=document.createElement("a");a.setAttribute("href",
        "http://maplib.khtml.org");a.setAttribute("target","_blank");b.setAttribute("src","http://maplib.khtml.org/favicon.png");b.style.border="0px solid black";b.style.position="absolute";b.style.backgroundColor="transparent";b.style.margin="0px";b.style.padding="0px";var c=this.size.height-26;b.style.top=c+"px";b.style.left="3px";b.style.width="24px";b.style.height="24px";a.appendChild(b);this.copyrightdiv.appendChild(a);b=document.createElement("a");b.appendChild(document.createTextNode("openstreetmap"));
        b.style.position="absolute";b.style.top=c+2+"px";b.style.left="28px";b.style.textDecoration="none";b.style.color="gray";b.setAttribute("href","http://www.openstreetmap.org/copyright");this.copyrightdiv.appendChild(b)};this.internetExplorer=!1;if(navigator.userAgent.indexOf("MSIE")!=-1)this.internetExplorer=!0;if(navigator.userAgent.indexOf("Android")!=-1){var e=this;setInterval(function(){e.layerTimer.reset()},300)}this.position={};this.tiles({maxzoom:18,minzoom:1,src:function(b,a,c){switch((b+a)%
        3){case 0:var e="a";break;case 1:e="b";break;case 2:e="c";break;default:e="f"}return"http://"+e+".tile.openstreetmap.org/"+c+"/"+b+"/"+a+".png"},copyright:"osm"});this.wheelSpeedConfig=[];this.wheelSpeedConfig.acceleration=2;this.wheelSpeedConfig.maxSpeed=2;this.wheelSpeedConfig.animate=!1;navigator.userAgent.indexOf("AppleWebKit")!=-1&&(this.wheelSpeedConfig.animate=!0);navigator.userAgent.indexOf("Opera")!=-1&&(this.wheelSpeedConfig.animate=!1);this.wheelSpeedConfig.animate=!1;this.wheelSpeedConfig.digizoom=
        !0;this.wheelSpeedConfig.zoomAnimationSlowdown=0.02;this.wheelSpeedConfig.animationFPS=50;this.wheelSpeedConfig.moveAnimateDesktop=!0;this.wheelSpeedConfig.rectShiftAnimate=!1;this.wheelSpeedConfig.rectShiftAnimationTime=500;this.wheelSpeedConfig.animateMinSpeed=0.4;this.wheelSpeedConfig.animateMaxSpeed=200;this.wheelSpeedConfig.moveAnimationSlowdown=0.4;this.framesCounter=this.wheelEventCounter=0;this.mapParent=a;khtml.maplib.base.helpers.setCursor(this.mapParent,"grab");this.clone=a.cloneNode(!0);
    this.clone=document.createElement("div");this.clone.removeAttribute("id");a.firstChild?a.insertBefore(this.clone,a.firstChild):a.appendChild(this.clone);this.map=document.createElement("div");this.map.style.position="relative";this.clone.appendChild(this.map);this.overlayDiv=document.createElement("div");this.overlayDiv.style.position="absolute";this.clone.appendChild(this.overlayDiv);this._setMapPosition();this.overlays=[];if(khtml.maplib.overlay.GeoJson){var g=new khtml.maplib.overlay.GeoJson;this.addOverlay(g);
        this.featureCollection=g.featureCollection}this.distanceMeasuring="no";this.measureLine=this.moveMarker=null;this.moveAnimationMobile=!0;this.moveAnimationBlocked=this.moveAnimationDesktop=!1;this.lastMouseX=this.width/2;this.lastMouseY=this.height/2;this.layers=[];this.intZoom=this.oldVisibleZoom=this.visibleZoom=null;this.lastMoveTime=this.lastMoveY=this.lastMoveX=this.moveY=this.moveX=0;this.zoomDeltaOld=1;this.startMoveY=this.startMoveX=0;this.sc=1;this.blocked=!1;this.tileH=this.tileW=256;this.position.zoom=
        1;this.movestarted=!1;this.mousedownTime=null;this._doubleclickTime=400;this.mousedownTime2=null;this._doubleclickTime2=500;this.zoomOutTime=1E3;this.zoomOutSpeed=0.01;this.zoomOutInterval=null;this.zoomOutStarted=!1;this.zoomSpeedTimer=null;this.zoomAcceleration=1;this.css3d=!1;if(navigator.userAgent.indexOf("iPhone OS")!=-1)this.css3d=!0;if(navigator.userAgent.indexOf("iPad")!=-1)this.css3d=!1;if(navigator.userAgent.indexOf("Safari")!=-1)this.css3d=navigator.userAgent.indexOf("Mac")!=-1?!1:!0;if(navigator.userAgent.indexOf("iPhone OS")!=
        -1)this.css3d=!0;if(navigator.userAgent.indexOf("Android")!=-1)this.css3d=!1;this.internetExplorer?(g=a,navigator.userAgent.indexOf("Windows Phone OS")!=-1&&khtml.maplib.base.helpers.eventAttach(g,"mouseup",this._mouseupIE,this,!1)):g=window;khtml.maplib.base.helpers.eventAttach(window,"resize",this._setMapPosition,this,!1);navigator.userAgent.indexOf("Konqueror")!=-1&&(g=a);khtml.maplib.base.helpers.eventAttach(a,"touchstart",this._start,this,!1);khtml.maplib.base.helpers.eventAttach(a,"touchmove",
        this._move,this,!1);khtml.maplib.base.helpers.eventAttach(a,"touchend",this._end,this,!1);khtml.maplib.base.helpers.eventAttach(g,"mousemove",this._mousemove,this,!1);khtml.maplib.base.helpers.eventAttach(a,"mousedown",this._mousedown,this,!1);khtml.maplib.base.helpers.eventAttach(g,"mouseup",this._mouseup,this,!0);khtml.maplib.base.helpers.eventAttach(g,"orientationchange",this.reSize,this,!1);khtml.maplib.base.helpers.eventAttach(a,"DOMMouseScroll",this._mousewheel,this,!1);khtml.maplib.base.helpers.eventAttach(a,
        "dblclick",this._doubleclick,this,!1);khtml.maplib.base.helpers.eventAttach(g,"keydown",this._shiftkeydown,this,!1);khtml.maplib.base.helpers.eventAttach(g,"keyup",this._shiftkeyup,this,!1);khtml.maplib.base.helpers.eventAttach(a,"contextmenu",function(b){b.preventDefault()},this,!1)};khtml.maplib.geometry.Bounds=function(a,c){this.enlarge=function(b){b.lng()>this.southwest.lng()&&b.lng()>this.northeast.lng()&&this.northeast.lng(b.lng());b.lng()<this.southwest.lng()&&b.lng()<this.northeast.lng()&&this.southwest.lng(b.lng());b.lat()>this.southwest.lat()&&b.lat()>this.northeast.lat()&&this.northeast.lat(b.lat());b.lat()<this.southwest.lat()&&b.lat()<this.northeast.lat()&&this.southwest.lat(b.lat())};this.sw=function(b){if(b)this.southwest=b;return this.southwest};this.se=function(){return new khtml.maplib.LatLng(this.southwest.lat(),
    this.northeast.lng())};this.ne=function(b){if(b)this.northeast=b;return this.northeast};this.nw=function(){return new khtml.maplib.LatLng(this.northeast.lat(),this.southwest.lng())};this.getCenter=function(){return this.center};this.getOpticalCenter=function(b){var a=b.latlngToXY(this.southwest),c=b.latlngToXY(this.northeast);return b.XYTolatlng(Math.abs(a.x+c.x)/2,Math.abs(a.y+c.y)/2)};this.getZoomLevel=function(b){origZoom=b.getZoom();var a=b.latlngToXY(this.southwest),c=b.latlngToXY(this.northeast),
    f=b.width/Math.abs(a.x-c.x);b=b.height/Math.abs(a.y-c.y);if(f>b)var d=b;f<=b&&(d=f);return origZoom+Math.log(d)/Math.log(2)};this.getDistance=function(){return this.distance(this.southwest.lat(),this.southwest.lng(),this.northeast.lat(),this.northeast.lng())};this.getnerRadius=function(){var b=this.distance(this.center.lat(),this.southwest.lng(),this.center.lat(),this.northeast.lng()),a=this.distance(this.southwest.lat(),this.center.lng(),this.northeast.lat(),this.center.lng());return b>a?a/2:b/
    2};this.distance=function(b,a,c,f){b=b*Math.PI/180;c=c*Math.PI/180;return Math.acos(Math.sin(b)*Math.sin(c)+Math.cos(b)*Math.cos(c)*Math.cos(f*Math.PI/180-a*Math.PI/180))*180/Math.PI/360*4E7};this.intersects=function(b){if(!(b instanceof khtml.maplib.geometry.Bounds))return khtml.maplib.base.Log.warn('Bounds.intersects(): Illegal argument. Has to be "khtml.maplib.geometry.Bounds"!'),!1;var a=Math.min(this.sw().lat(),this.ne().lat()),c=Math.max(this.sw().lat(),this.ne().lat()),f=Math.min(this.sw().lng(),
    this.ne().lng()),d=Math.max(this.sw().lng(),this.ne().lng()),h=[];h.push(b.ne());h.push(b.se());h.push(b.sw());h.push(b.nw());for(b=0;b<h.length;b++){var k=h[b],l=k.lat()>=a&&k.lat()<=c;k=k.lng()>=f&&k.lng()<=d;if(l&&k)return!0}return!1};this.createBoundsFrom2Points=function(b,a){var c=new khtml.maplib.LatLng(Math.min(b.lat(),a.lat()),Math.min(b.lng(),a.lng())),f=new khtml.maplib.LatLng(Math.max(b.lat(),a.lat()),Math.max(b.lng(),a.lng()));return{sw:c,ne:f}};var d=this.createBoundsFrom2Points(a,c);
    this.southwest=d.sw;this.northeast=d.ne;this.center=new khtml.maplib.LatLng((this.southwest.lat()+this.northeast.lat())/2,(this.southwest.lng()+this.northeast.lng())/2)};khtml.maplib.geometry.LatLng=function(a,c){this.callbackFunctions=[];this.addCallbackFunction=function(a){typeof a=="function"&&this.callbackFunctions.push(a)};this.removeCallbackFunction=function(a){for(var b=0;b<this.callbackFunctions.length;b++)this.callbackFunctions[b]==a&&this.callbackFunctions.splice(b,1)};this._executeCallbackFunctions=function(){for(var a=0;a<this.callbackFunctions.length;a++)this.callbackFunctions[a].call(this)};this.lat=function(a){if(typeof a=="number")this.latitude=a,
    this._executeCallbackFunctions();else if(typeof a=="string")this.latitude=parseFloat(a),this._executeCallbackFunctions();return this.latitude};this.lng=function(a){if(typeof a=="number")this.longitude=a,this._executeCallbackFunctions();else if(typeof a=="string")this.longitude=parseFloat(a),this._executeCallbackFunctions();return this.longitude};this.equals=function(a){if(null==a)return!1;if(!(a instanceof khtml.maplib.LatLng))return khtml.maplib.base.Log.warn("Point.equals(): Error - illegal argument!",
    a),!1;return a.lat()===this.lat()&&a.lng()===this.lng()};a instanceof khtml.maplib.geometry.LatLng?(this.lat(a.lat()),this.lng(a.lng())):typeof a=="object"?(a.lat&&this.lat(a.lat),a.lng&&this.lng(a.lng)):(this.lat(a),this.lng(c))};khtml.maplib.geometry.Feature=function(a,c){var d=this;if(a.type=="FeatureCollection")return new khtml.maplib.geometry.FeatureCollection(a,c);this.type="Feature";this.events=[];this.geometry={};a.geometry?(this.geometry.coordinates=khtml.maplib.base.helpers.parseLine(a.geometry.coordinates),this.geometry.type=a.geometry.type):(this.geometry.coordinates=khtml.maplib.base.helpers.parseLine(a.coordinates),this.geometry.type=a.type);this.style=a.style?a.style:{};this.className=a.className?a.className:
{};if(a.properties)this.properties=a.properties;if(a.infobox)this.infobox=a.infobox;if(a.title)this.title=a.title;this.init=function(b){this.parentNode=b;this.documentElement=b.documentElement;if(!this.bbox)this.bbox=this.makeBounds()};this.eventAttach=function(b,a,c,f){this.element&&khtml.maplib.base.helpers.eventAttach(this.element,b,a,c,f);this.events.push({eventType:b,method:a,context:c,bubble:f})};this.eventRemove=function(){console.log("not implemented")};this.makeBounds=function(b){if(!b)b=
    this.geometry.coordinates;var a=90,c=-90,f=180,d=-180;if(b instanceof khtml.maplib.geometry.LatLng){if(b.lat){var h=b.lng(),k=b.lat();k>c&&(c=k);k<a&&(a=k);h>d&&(d=h);h<f&&(f=h)}}else for(var l=0;l<b.length;l++)b[l]instanceof khtml.maplib.geometry.LatLng?(h=b[l].lng(),k=b[l].lat(),k>c&&(c=k),k<a&&(a=k),h>d&&(d=h),h<f&&(f=h)):(h=this.makeBounds(b[l]),h.sw().lat()<a&&(a=h.sw().lat()),h.sw().lng()<f&&(f=h.sw().lng()),h.ne().lat()>c&&(c=h.ne().lat()),h.ne().lng()>d&&(d=h.ne().lng()));b=new khtml.maplib.LatLng(a,
    f);c=new khtml.maplib.LatLng(c,d);return new khtml.maplib.geometry.Bounds(b,c)};this.render=function(){if(d.documentElement){if(!d.parentNode)d.parentNode=d.featureCollection;if(khtml.maplib.base.helpers.overlaps(d.documentElement.map.bounds(),d.bbox))switch(d.style.display="",d.documentElement.backend){case "svg":d.renderSVG(d);break;case "vml":d.renderVML(d);break;case "canvas":d.renderCanvas(d);break;default:console&&console.log&&console.log("backend unknown",d.parentNode.backend)}else d.style.display=
    "none";d.geometry.type=="Point"&&d.renderMarker(d.parentNode.element)}};this.renderMarker=function(){if(!this.mmarker){if(!a.marker)a.marker={};this.marker=a.marker;this.mmarker=new khtml.maplib.overlay.Marker({position:this.geometry.coordinates,map:this.documentElement.map,title:a.title,icon:a.marker.icon,shadow:a.marker.shadow,draggable:a.draggable,raiseOnDrag:a.raiseOnDrag});if(a.marker.infobox)this.mmarker.box=new khtml.maplib.overlay.InfoWindow({content:a.marker.infobox}),this.mmarker.attachEvent("click",
    function(){this.box.open(this.mapObj,this)})}};old=null;this.doSVGPath=function(b,a,c){var f=0,d=0,h=1,k=1;if(b.documentElement.element.finished&&b.documentElement.element&&b.documentElement.element.topright)f=b.documentElement.element.topright.y,d=b.documentElement.element.bottomleft.x,k=b.documentElement.element.bottomleft.y-f,h=(b.documentElement.element.topright.x-d)/b.documentElement.map.size.width,k/=b.documentElement.map.size.height,old=f;for(var l="",n=0;n<a.length;n++)if(a[n]instanceof khtml.maplib.geometry.LatLng){var o=
    this.documentElement.map.latlngToXY(a[n]);o={x:o.x-d,y:o.y-f};o.x/=h;o.y/=k;n==0?l=" M"+o.x+" "+o.y:l+=" L"+o.x+" "+o.y;c&&n==a.length-1&&(l+=" z")}else l+=this.doSVGPath(b,a[n],c);return l};this.renderSVG=function(b){if(b.geometry.type!="Point"){var a=!1;if(b.geometry.type=="LinearRing"||b.geometry.type=="Polygon"||b.geometry.type=="MultiPolygon")a=!0;a=this.doSVGPath(b,b.geometry.coordinates,a);if(!this.element){this.element=document.createElementNS("http://www.w3.org/2000/svg","path");this.element.feature=
    b;this.parentNode.element.appendChild(this.element);for(var c=0;c<b.events.length;c++){var f=b.events[c];khtml.maplib.base.helpers.eventAttach(this.element,f.eventType,f.method,f.context,f.bubble)}}this.element.setAttribute("d",a);if(b.geometry.type=="Polygon"||b.geometry.type=="MultiPolygon")this.element.setAttribute("fill-rule","evenodd");else{if(!this.style)this.style={};this.style.fill="none"}for(var d in this.style)try{this.element.style[d]=this.style[d]}catch(h){}this.style=this.element.style;
    this.element.className.baseVal=b.className.baseVal;this.element.style.display=typeof this.display!="undefined"?this.display:""}};this.doVMLPath=function(b,a,c){for(var f="",d=0;d<a.length;d++)if(a[d]instanceof khtml.maplib.geometry.LatLng){var h=this.documentElement.map.latlngToXY(a[d]);d==0?f=" "+h.x+","+h.y:f+=" "+h.x+","+h.y;c&&d==a.length-1&&(h=this.documentElement.map.latlngToXY(a[0]),f+=" "+h.x+","+h.y)}else f+=this.doVMLPath(b,a[d],c);return f};this.renderVML=function(b){if(b.geometry.type!=
    "Point"){var a=!1;if(b.geometry.type=="LinearRing"||b.geometry.type=="Polygon"||b.geometry.type=="MultiPolygon")a=!0;a=this.doVMLPath(b,b.geometry.coordinates,a);if(!this.element)this.element=document.createElement("v:polyline"),this.fillEl=document.createElement("v:fill"),this.element.appendChild(this.fillEl),this.strokeEl=document.createElement("v:stroke"),this.element.appendChild(this.strokeEl),this.element.style.position="absolute",this.element.feature=b,this.documentElement.element.appendChild(this.element);
    this.element.points.value=a+" x e";b=this.documentElement.canvasStyler.makeCanvasStyle(b);this.element.setAttribute("fillcolor",b.fillRGB);this.element.setAttribute("strokecolor",b.strokeRGB);this.element.setAttribute("strokeweight",b.lineWidth+"px");document.documentMode==8?(this.element.fillcolor=b.fillRGB,this.element.strokecolor=b.strokeRGB,this.element.stokeweight=b.lineWidth,this.fillEl.opacity=b.fillOpacity,this.strokeEl.opacity=b.strokeOpacity):(this.element.setAttribute("fillcolor",b.fillRGB),
        this.element.setAttribute("strokecolor",b.strokeRGB),this.element.setAttribute("strokeweight",b.lineWidth+"px"),this.fillEl.setAttribute("opacity",b.fillOpacity),this.strokeEl.setAttribute("opacity",b.strokeOpacity))}};this.doCanvasPath=function(b,a,c,f,d,h){d||(d=0);h||(h=0);if(!(b=="Polygon"&&d>0&&h>0))a.globalCompositeOperation="destination-over";for(h=0;h<c.length;h++)if(c[h]instanceof khtml.maplib.geometry.LatLng){var k=this.documentElement.map.latlngToXY(c[h]),l={};l.x=k.x-this.documentElement.deltaX;
    l.y=k.y-this.documentElement.deltaY;h==0?a.moveTo(l.x,l.y):a.lineTo(l.x,l.y);f&&h==c.length-1&&(k=this.documentElement.map.latlngToXY(c[0]),a.lineTo(k.x,k.y))}else this.doCanvasPath(b,a,c[h],f,d+1,h)};this.renderCanvas=function(b){if(b.geometry.type!="Point"){if(!b.canvasStyle){var a=this.documentElement.canvasStyler.makeCanvasStyle(b);b.canvasStyle=a}a=!1;if(b.geometry.type=="LinearRing"||b.geometry.type=="Polygon"||b.geometry.type=="MultiPolygon")a=!0;var c=this.documentElement.context;c.beginPath();
    for(var f in b.canvasStyle)c[f]=b.canvasStyle[f];this.doCanvasPath(b.geometry.type,c,b.geometry.coordinates,a);c.stroke();c.fill()}};c&&this.init(c);this.toJSON=function(){return khtml.maplib.base.helpers.reduceToJSON(this)}};khtml.maplib.geometry.FeatureCollection=function(a,c){this.type="FeatureCollection";this.style={};this.className={};if(c){this.parentNode=c;this.documentElement=c.documentElement?this.parentNode.documentElement:c;this.map=this.parentNode.map;if(this.parentNode.context)this.context=this.parentNode.context;if(this.documentElement.backend=="svg")this.element=document.createElementNS("http://www.w3.org/2000/svg","g"),this.parentNode.element&&this.parentNode.element.appendChild(this.element);if(this.documentElement.backend==
    "vml")this.element=document.createElement("v:group"),this.parentNode.element&&c.element.appendChild(this.element)}if(!this.features)this.features=[];this.childNodes=this.features;if(this.documentElement&&this.documentElement.backend=="svg"){this.style=this.element.style;if(a.style)for(var d in a.style)this.style[d]=a.style[d];this.className=this.element.className;if(a.className)this.className.baseVal=a.className.baseVal}if(a)this.properties=a.properties;this.init=function(b){if(this.documentElement.backend==
    "svg"){if(!this.element)this.element=document.createElementNS("http://www.w3.org/2000/svg","g"),this.style=this.element.style;b.element.appendChild(this.element)}if(this.documentElement.backend=="vml"){if(!this.element)this.element=document.createElement("v:group");b.element.appendChild(this.element)}this.parentNode=b;this.documentElement=this.parentNode.documentElement;if(a&&a.features)for(b=0;b<a.features.length;b++)this.appendChild(a.features[b]);if(this.features)for(b=0;b<this.features.length;b++)this.features[b].element||
this.features[b].init(this)};this.appendChild=function(b){if(!b.element&&!b.mmarker)b.render?(b.parentNode=this,b.documentElement=this.documentElement):b=new khtml.maplib.geometry.Feature(b,this);else for(var a=0;a<b.parentNode.features.length;a++)if(b.parentNode.features[a]==b){if(this==b.parentNode&&a==b.parentNode.features.length-1)return b;b.parentNode.features.splice(a,1);b.element&&this.element&&this.element.appendChild(b.element);break}this.features.push(b);if(this.documentElement)b.documentElement=
    this.documentElement,this.documentElement.recurseLinksDirty=!0;b.parentNode=this;b.init(this);b.render();return b};this.insertBefore=function(b,a){var c=!1;if(!a)if(this.features[0])a=this.features[0];else return this.appendChild(b),!1;if(b==a)return b;if(!b.element&&!b.marker)b=new khtml.maplib.geometry.Feature(b);else if(c=!0,b.parentNode)for(var f=0;f<b.parentNode.features.length;f++)if(b.parentNode.features[f]==b){b.parentNode.features.splice(f,1);break}for(f=0;f<this.features.length;f++)if(this.features[f]==
    a){this.features.splice(f,0,b);b.element&&this.element.insertBefore(b.element,a.element);break}this.documentElement.recurseLinksDirty=!0;b.parentNode=this;c||b.init(this);b.render();this.makeBounds();return b};this.removeChild=function(b){if(b){for(var a=0;a<this.features.length;a++)if(this.features[a]==b){if(this.features[a].preceding)this.features[a].preceding.following=this.features[a].following;if(this.features[a].following)this.features[a].following.preceding=this.features[a].preceding;this._removeMarkers(this.features[a]);
    try{this.element.removeChild(this.features[a].element)}catch(c){}this.features.splice(a,1);break}this.features.length>0?(this.firstChild=this.features[0],this.lastChild=this.features[this.features.length-1]):this.lastChild=this.firstChild=null;this.documentElement.backend=="canvas"&&this.documentElement.render(!0)}};this._removeMarkers=function(b){if(b.mmarker)b.mmarker.destroy();else if(b.type=="FeatureCollection")for(var a=0;a<b.features.length;a++)this._removeMarkers(b.features[a])};this.replaceChild=
    function(b,a){var c=this.insertBefore(b,a);this.removeChild(a);return c};this.render=function(){};this.toJSON=function(){return khtml.maplib.base.helpers.reduceToJSON(this)};this.makeBounds=function(){this.bbox=null;for(var b=0;b<this.features.length;b++)if(this.features[b].makeBounds){var a=this.features[b].bbox?this.features[b].bbox:this.features[b].makeBounds();this.bbox=khtml.maplib.base.helpers.extendBBox(this.bbox,a)}return this.bbox}};khtml.maplib.overlay.MarkerImage=function(a,c,d,b){if(a)this.url=a;if(c)this.size=c;if(d)this.origin=d;if(b)this.anchor=b};khtml.maplib.overlay.MarkerOptions=function(a,c,d,b,e,g,f,m,h,k,l,n,o){if(b)this.draggable=b;if(g)this.icon=g;if(f)this.map=f;if(h)this.position=h;if(k)this.raiseOnDrag=k;if(l)this.shadow=l;if(n)this.shape=n;if(o)this.title=o};
khtml.maplib.overlay.Marker=function(a){this.setPosition=function(b){b&&(this.position.lat(b.lat()),this.position.lng(b.lng()),this.render());return this.position};this.getPosition=function(){return this.position};this.pixelOffset=function(){var b=[];!isNaN(parseInt(this.marker.style.width))&&!isNaN(parseInt(this.marker.style.height))?(b.x=parseInt(this.marker.style.width)/2,b.y=parseInt(this.marker.style.height)):b={x:0,y:0};return b};this.clear=function(){if(this.marker&&this.marker.parentNode)try{this.owner.overlayDiv.markerDiv.removeChild(this.marker),
    this.shadow&&this.owner.overlayDiv.shadowDiv.removeChild(this.shadow)}catch(b){}};this.destroy=function(){this.mapObj.removeOverlay(this)};this.callbackFunctions=[];this.addCallbackFunction=function(b){typeof b=="function"&&this.callbackFunctions.push(b)};this._executeCallbackFunctions=function(){for(var b=0;b<this.callbackFunctions.length;b++)this.callbackFunctions[b].call(this)};this._setCursor=function(b){this.MarkerOptions.shape&&navigator.userAgent.indexOf("MSIE")==-1&&navigator.userAgent.indexOf("iPhone")==
    -1&&navigator.userAgent.indexOf("iPad")==-1?(khtml.maplib.base.helpers.setCursor(this.marker,""),khtml.maplib.base.helpers.setCursor(this.area,b)):khtml.maplib.base.helpers.setCursor(this.marker,b)};this.moving=!1;this._mousedown=function(b){this.moving=!0;this.clickx=this.marker.offsetLeft-this.mapObj.pageX(b)+this.dx;this.clicky=this.marker.offsetTop-this.mapObj.pageY(b)+this.dy;b.preventDefault?b.preventDefault():window.event.returnValue=!1;b.stopPropagation?b.stopPropagation():window.event.cancelBubble=
    !0;b=navigator.userAgent.indexOf("MSIE")!=-1?this.mapObj.mapParent:window;khtml.maplib.base.helpers.eventAttach(b,"mousemove",this._mousemove,this,!1);khtml.maplib.base.helpers.eventAttach(b,"mouseup",this._mouseup,this,!1);khtml.maplib.base.helpers.setCursor(this.mapObj.mapParent,"grabbing");this._setCursor("grabbing")};this._mousemove=function(b){if(this.moving){this.x=this.mapObj.pageX(b)+this.clickx;this.y=this.mapObj.pageY(b)+this.clicky;this.position.lat(this.mapObj.XYTolatlng(this.x,this.y).lat());
    this.position.lng(this.mapObj.XYTolatlng(this.x,this.y).lng());this.render();b.stopPropagation?b.stopPropagation():window.event.cancelBubble=!0;this.marker.style.zIndex=1E6;if(this.shadow)this.shadow.style.zIndex=1E6;if((this.MarkerOptions.raiseOnDrag==null||this.MarkerOptions.raiseOnDrag==!0)&&!this.raised){this.dragcross=document.createElement("div");this.dragcross.style.position="absolute";this.dragcross.dx=8;this.dragcross.dy=8;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+
        5))<=7?(b=document.createElement("div"),b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+dragcross_image+"')",b.style.width="100%",b.style.height="100%"):(b=document.createElement("img"),b.style.backgroundColor="transparent",b.style.padding="0px",b.style.margin="0px",b.setAttribute("src",dragcross_image));this.dragcross.style.width="16px";this.dragcross.style.height="16px";this.dragcross.appendChild(b);this.dragcross.style.left=this.x-this.dragcross.dx+"px";this.dragcross.style.top=
        this.y-this.dragcross.dy+"px";this.owner.overlayDiv.markerDiv.appendChild(this.dragcross);var a=this;window.clearInterval(this.markerDropInterval);this.markerRaiseInterval=window.setInterval(function(){a._raiseMarker()},5);this.raised=!0}this._mousemoveMap()}};this._mouseup=function(){if(this.moving)this.position.lat(this.mapObj.XYTolatlng(this.x,this.y).lat()),this.position.lng(this.mapObj.XYTolatlng(this.x,this.y).lng()),this.moving=!1,d=c=mapMoveSpeed=1,window.clearInterval(this.mapmoveInterval);
    var b=this.mapObj.latlngToXY(this.position);this.marker.style.zIndex=this.mapObj.size.height+b.y;if(this.shadow)this.shadow.style.zIndex=b.y;if((this.MarkerOptions.raiseOnDrag==null||this.MarkerOptions.raiseOnDrag==!0)&&this.raised){this.owner.overlayDiv.markerDiv.removeChild(this.dragcross);var a=this;window.clearInterval(this.markerRaiseInterval);this.markerDropInterval=window.setInterval(function(){a._dropMarker()},5);this.raised=!1}khtml.maplib.base.helpers.setCursor(this.mapObj.mapParent,"grab");
    this._setCursor("pointer");this.render();this._executeCallbackFunctions()};this._touchstart=function(b){b.touches.length==1?(this.moving=!0,this.touchx=this.marker.offsetLeft-this.mapObj.pageX(b.touches[0]),this.touchy=this.marker.offsetTop-this.mapObj.pageY(b.touches[0]),khtml.maplib.base.helpers.eventAttach(window,"touchmove",this._touchmove,this,!0),khtml.maplib.base.helpers.eventAttach(window,"touchend",this._touchend,this,!0)):this.moving=!1};this._touchmove=function(b){if(b.touches.length==
    1&&this.moving){this.x=this.mapObj.pageX(b.touches[0])+this.touchx+this.dx;this.y=this.mapObj.pageY(b.touches[0])+this.touchy+this.dy;this.position.lat(this.mapObj.XYTolatlng(this.x,this.y).lat());this.position.lng(this.mapObj.XYTolatlng(this.x,this.y).lng());this.render();if(!this.clicked)b.stopPropagation?b.stopPropagation():window.event.cancelBubble=!0;this.marker.style.zIndex=1E6;if(this.shadow)this.shadow.style.zIndex=1E6;if((this.MarkerOptions.raiseOnDrag==null||this.MarkerOptions.raiseOnDrag==
    !0)&&!this.raised){this.dragcross=document.createElement("div");this.dragcross.style.position="absolute";this.dragcross.dx=8;this.dragcross.dy=8;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?(b=document.createElement("div"),b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+dragcross_image+"')",b.style.width="100%",b.style.height="100%"):(b=document.createElement("img"),b.style.backgroundColor="transparent",
    b.style.padding="0px",b.style.margin="0px",b.setAttribute("src",dragcross_image));this.dragcross.style.width="16px";this.dragcross.style.height="16px";this.dragcross.appendChild(b);this.dragcross.style.left=this.x-this.dragcross.dx+"px";this.dragcross.style.top=this.y-this.dragcross.dy+"px";this.owner.overlayDiv.markerDiv.appendChild(this.dragcross);var a=this;window.clearInterval(this.markerDropInterval);this.markerRaiseInterval=window.setInterval(function(){a._raiseMarker()},20);this.raised=!0}this._mousemoveMap()}};
    this._touchend=function(){if(this.moving)this.position.lat(this.mapObj.XYTolatlng(this.x,this.y).lat()),this.position.lng(this.mapObj.XYTolatlng(this.x,this.y).lng()),this.moving=!1,d=c=mapMoveSpeed=1,window.clearInterval(this.mapmoveInterval);var b=this.mapObj.latlngToXY(this.position);this.marker.style.zIndex=b.y;if(this.shadow)this.shadow.style.zIndex=b.y;if((this.MarkerOptions.raiseOnDrag==null||this.MarkerOptions.raiseOnDrag==!0)&&this.raised){this.owner.overlayDiv.markerDiv.removeChild(this.dragcross);
        var a=this;window.clearInterval(this.markerRaiseInterval);this.markerDropInterval=window.setInterval(function(){a._dropMarker()},20);this.raised=!1}window.clearInterval(this.mapmoveInterval);this.render()};this._raiseMarker=function(){this.dy+=5;this.shadow&&(this.shadow.dx-=3.75,this.shadow.dy+=3.75);this.render();if(isNaN(this.i))this.i=0;this.i+=5;this.i>20&&window.clearInterval(this.markerRaiseInterval)};this._dropMarker=function(){isNaN(this.i)?this.i=0:this.i>=5?(this.i-=5,this.dy-=5,this.shadow&&
        (this.shadow.dx+=3.75,this.shadow.dy-=3.75),this.render()):window.clearInterval(this.markerDropInterval)};var c=1,d=1;this._mousemoveMap=function(){var b=this;this.mapObj.latlngToXY(this.position).x<this.mapObj.size.width/10?(c=(1-this.mapObj.latlngToXY(this.position).x/(this.mapObj.size.width/10))*10,this.mapObj.latlngToXY(this.position).y<this.mapObj.size.height/10?(window.clearInterval(this.mapmoveInterval),d=(1-this.mapObj.latlngToXY(this.position).y/(this.mapObj.size.height/10))*10,this.mapmoveInterval=
        window.setInterval(function(){b.mapObj.moveXY(c,d)},10)):this.mapObj.latlngToXY(this.position).y>this.mapObj.size.height-this.mapObj.size.height/10?(window.clearInterval(this.mapmoveInterval),d=(1-(this.mapObj.size.height-this.mapObj.latlngToXY(this.position).y)/(this.mapObj.size.height/10))*10,this.mapmoveInterval=window.setInterval(function(){b.mapObj.moveXY(c,-d)},10)):(window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){b.mapObj.moveXY(c,0)},10))):this.mapObj.latlngToXY(this.position).x>
        this.mapObj.size.width-this.mapObj.size.width/10?(c=(1-(this.mapObj.size.width-this.mapObj.latlngToXY(this.position).x)/(this.mapObj.size.width/10))*10,this.mapObj.latlngToXY(this.position).y<this.mapObj.size.height/10?(window.clearInterval(this.mapmoveInterval),d=(1-this.mapObj.latlngToXY(this.position).y/(this.mapObj.size.height/10))*10,this.mapmoveInterval=window.setInterval(function(){b.mapObj.moveXY(-c,d)},10)):this.mapObj.latlngToXY(this.position).y>this.mapObj.size.height-this.mapObj.size.height/
        10?(window.clearInterval(this.mapmoveInterval),d=(1-(this.mapObj.size.height-this.mapObj.latlngToXY(this.position).y)/(this.mapObj.size.height/10))*10,this.mapmoveInterval=window.setInterval(function(){b.mapObj.moveXY(-c,-d)},10)):(window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){b.mapObj.moveXY(-c,0)},10))):this.mapObj.latlngToXY(this.position).y<this.mapObj.size.height/10?(window.clearInterval(this.mapmoveInterval),d=(1-this.mapObj.latlngToXY(this.position).y/
        (this.mapObj.size.height/10))*10,this.mapmoveInterval=window.setInterval(function(){b.mapObj.moveXY(0,d)},10)):this.mapObj.latlngToXY(this.position).y>this.mapObj.size.height-this.mapObj.size.height/10?(window.clearInterval(this.mapmoveInterval),d=(1-(this.mapObj.size.height-this.mapObj.latlngToXY(this.position).y)/(this.mapObj.size.height/10))*10,this.mapmoveInterval=window.setInterval(function(){b.mapObj.moveXY(0,-d)},10)):(window.clearInterval(this.mapmoveInterval),d=c=1)};this.makeMoveable=function(){this.MarkerOptions.shape?
        (khtml.maplib.base.helpers.eventAttach(this.area,"mousedown",this._mousedown,this,!1),khtml.maplib.base.helpers.eventAttach(this.area,"touchstart",this._touchstart,this,!1)):(khtml.maplib.base.helpers.eventAttach(this.marker,"mousedown",this._mousedown,this,!1),khtml.maplib.base.helpers.eventAttach(this.marker,"touchstart",this._touchstart,this,!1));this.MarkerOptions.draggable=!0};this.clickDetectY=this.clickDetectX=-1;this._touchclickdetectstart=function(b){if(b.touches.length==1)this.clickDetectY=
        this.clickDetectX=-1,this.clicked=!0};this._touchclickdetectmove=function(b){if(b.touches.length==1&&(this.clickDetectX=b.touches[0].pageX,this.clickDetectY=b.touches[0].pageY,this.MarkerOptions.draggable))b.stopPropagation?b.stopPropagation():window.event.cancelBubble=!0};this._touchclickdetectstop=function(b){if(b.touches.length==0&&this.clickDetectX==-1&&this.clickDetectY==-1)this.originalClickFunction(),this.clicked=!1};this._mouseclickdetectstart=function(b){this.leftclick=!1;if(!b)b=window.event;
        if(b.which)this.leftclick=b.which==1;else if(b.button)this.leftclick=b.button==0||b.button==1};this._mouseclickdetectmove=function(){this.leftclick=!1};this._mouseclickdetectstop=function(){this.leftclick&&this.originalClickFunction()};this.attachEvent=function(b,a,c,e){c||(c=this);e||(e=!1);if(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)){if(b=="click")this.originalClickFunction=a,this.MarkerOptions.shape?(khtml.maplib.base.helpers.eventAttach(this.area,
        "touchstart",this._touchclickdetectstart,c,e),khtml.maplib.base.helpers.eventAttach(this.area,"touchmove",this._touchclickdetectmove,c,e),khtml.maplib.base.helpers.eventAttach(this.area,"touchend",this._touchclickdetectstop,c,e)):(khtml.maplib.base.helpers.eventAttach(this.marker,"touchstart",this._touchclickdetectstart,c,e),khtml.maplib.base.helpers.eventAttach(this.marker,"touchmove",this._touchclickdetectmove,c,e),khtml.maplib.base.helpers.eventAttach(this.marker,"touchend",this._touchclickdetectstop,
        c,e))}else switch(b){case "click":this.originalClickFunction=a;this.MarkerOptions.shape?(khtml.maplib.base.helpers.eventAttach(this.area,"mousedown",this._mouseclickdetectstart,c,e),khtml.maplib.base.helpers.eventAttach(this.area,"mousemove",this._mouseclickdetectmove,c,e),khtml.maplib.base.helpers.eventAttach(this.area,"mouseup",this._mouseclickdetectstop,c,e)):(khtml.maplib.base.helpers.eventAttach(this.marker,"mousedown",this._mouseclickdetectstart,c,e),khtml.maplib.base.helpers.eventAttach(this.marker,
        "mousemove",this._mouseclickdetectmove,c,e),khtml.maplib.base.helpers.eventAttach(this.marker,"mouseup",this._mouseclickdetectstop,c,e));break;default:khtml.maplib.base.helpers.eventAttach(this.marker,b,a,c,e)}};this.init=function(b){this.owner=b;this.mapObj=b instanceof khtml.maplib.base.Map?b:b.map;this.x=this.mapObj.latlngToXY(this.position).x;this.y=this.mapObj.latlngToXY(this.position).y;if(!this.owner.overlayDiv.markerDiv)this.owner.overlayDiv.markerDiv=document.createElement("div"),this.owner.overlayDiv.appendChild(this.owner.overlayDiv.markerDiv),
        this.owner.overlayDiv.markerDiv.setAttribute("id","markerDiv");if(this.shadow&&!this.owner.overlayDiv.shadowDiv)this.owner.overlayDiv.shadowDiv=document.createElement("div"),this.owner.overlayDiv.insertBefore(this.owner.overlayDiv.shadowDiv,this.owner.overlayDiv.markerDiv),this.owner.overlayDiv.shadowDiv.setAttribute("id","shadowDiv");this.owner.overlayDiv.markerDiv.appendChild(this.marker);this.shadow&&this.owner.overlayDiv.shadowDiv.appendChild(this.shadow);this.MarkerOptions.draggable==!0?this.makeMoveable():
        (khtml.maplib.base.helpers.eventAttach(this.marker,"mousedown",function(){if(!this.MarkerOptions.draggable)this.clicked=!0},this,!1),khtml.maplib.base.helpers.eventAttach(this.marker,"mousemove",function(){this.MarkerOptions.draggable||(this.clicked==!0?this._setCursor("grabbing"):this._setCursor("pointer"))},this,!1),b=navigator.userAgent.indexOf("MSIE")!=-1?this.mapObj.mapParent:window,khtml.maplib.base.helpers.eventAttach(b,"mouseup",function(){if(!this.MarkerOptions.draggable)this.clicked=!1,
            this._setCursor("pointer")},this,!1))};this.render=function(){if(this.marker&&this.position&&!isNaN(this.position.lat())&&!isNaN(this.position.lng())){if(this.moving)var b=this.x,a=this.y;else a=this.mapObj.latlngToXY(this.position),b=a.x,a=a.y,this.x=b,this.y=a;if((b<-this.width||a<-this.height||b>this.mapObj.size.width+this.width||a>this.mapObj.size.height+this.height)&&!this.moving){if(this.marker.style.display="none",this.shadow)this.shadow.style.display="none"}else{this.marker.style.display=
        "";this.marker.style.left=b-this.dx+"px";this.marker.style.top=a-this.dy+"px";if(this.shadow)this.shadow.style.display="",this.shadow.style.left=b-this.shadow.dx+"px",this.shadow.style.top=a-this.shadow.dy+"px";if(this.dragcross)this.dragcross.style.left=b-this.dragcross.dx+"px",this.dragcross.style.top=a-this.dragcross.dy+"px";if(!this.moving&&(this.marker.style.zIndex=this.mapObj.size.height+parseInt(a),this.shadow))this.shadow.style.zIndex=parseInt(a)}if(!this.owner.overlayDiv.markerDiv)this.owner.overlayDiv.markerDiv=
        document.createElement("div"),this.owner.overlayDiv.appendChild(this.owner.overlayDiv.markerDiv),this.owner.overlayDiv.markerDiv.setAttribute("id","markerDiv");if(this.shadow&&!this.owner.overlayDiv.shadowDiv)this.owner.overlayDiv.shadowDiv=document.createElement("div"),this.owner.overlayDiv.insertBefore(this.owner.overlayDiv.shadowDiv,this.owner.overlayDiv.markerDiv),this.owner.overlayDiv.shadowDiv.setAttribute("id","shadowDiv");this.marker.parentNode||this.owner.overlayDiv.markerDiv.appendChild(this.marker);
        this.shadow&&!this.shadow.parentNode&&this.owner.overlayDiv.shadowDiv.appendChild(this.shadow)}};this.nodeName=this.nodeType="Marker";this.geometry={};this.geometry.type="Point";this.type="Marker";this.constructor.number++;var b=document.createElement("div");b.style.position="absolute";this.marker=b;if(a){this.MarkerOptions=a;if(a.position)this.position=a.position,this.geometry.coordinates=a.position;if(a.icon){if((typeof a.icon=="string"||typeof a.icon=="object")&&!a.icon.url)a.icon.url=a.icon;typeof a.icon.url==
        "object"&&(b.appendChild(a.icon.url),a.title&&b.setAttribute("title",a.title),this._setCursor("pointer"));if(typeof a.icon.url=="string"){var e=document.createElement("img");e.style.backgroundColor="transparent";e.style.padding="0px";e.style.margin="0px";e.setAttribute("src",a.icon.url);if(a.icon.origin){if(a.icon.origin.x)e.style.left=a.icon.origin.x;if(a.icon.origin.y)e.style.top=a.icon.origin.y}e.style.border=0;e.style.margin=0;e.style.padding=0;khtml.maplib.base.helpers.imageNotSelectable(e);
        b.appendChild(e);a.shape&&navigator.userAgent.indexOf("MSIE")==-1&&navigator.userAgent.indexOf("iPhone")==-1&&navigator.userAgent.indexOf("iPad")==-1?(e.setAttribute("usemap","#shapemap"+this.constructor.number),e=document.createElement("map"),e.setAttribute("id","shapemap"+this.constructor.number),e.setAttribute("name","shapemap"+this.constructor.number),g=document.createElement("area"),g.setAttribute("shape",a.shape.type),g.setAttribute("coords",a.shape.coord),a.title&&g.setAttribute("title",a.title),
            g.style.cursor="pointer",g.style.display="block",e.appendChild(g),b.appendChild(e),this.area=g):(this.area=this.MarkerOptions.shape=null,a.title&&e.setAttribute("title",a.title),this._setCursor("pointer"))}a.icon.anchor?(this.dy=a.icon.anchor.y?Math.abs(parseInt(a.icon.anchor.y)):0,this.dx=a.icon.anchor.x?Math.abs(parseInt(a.icon.anchor.x)):0):this.dy=this.dx=0;a.icon.size?(a.icon.size.width?(this.width=Math.abs(parseInt(a.icon.size.width)),b.style.width=this.width+"px",b.style.overflow="hidden"):
        b.style.width="auto",a.icon.size.height?(this.height=Math.abs(parseInt(a.icon.size.height)),b.style.height=this.height+"px",b.style.overflow="hidden"):b.style.height="auto"):(b.style.width="auto",b.style.height="auto");if(a.shadow){g=document.createElement("div");g.style.position="absolute";this.shadow=g;if((typeof a.shadow=="string"||typeof a.shadow=="object")&&!a.shadow.url)a.shadow.url=a.shadow;if(a.shadow.url){this.shadow.dy=a.shadow.anchor.y?Math.abs(parseInt(a.shadow.anchor.y)):0;this.shadow.dx=
        a.shadow.anchor.x?Math.abs(parseInt(a.shadow.anchor.x)):0;if(a.shadow.size.width)g.style.width=Math.abs(parseInt(a.shadow.size.width))+"px",g.style.overflow="hidden";if(a.shadow.size.height)g.style.height=Math.abs(parseInt(a.shadow.size.height))+"px",g.style.overflow="hidden";if(typeof a.shadow.url=="object")g.appendChild(a.shadow.url);else if(typeof a.shadow.url=="string")e=document.createElement("img"),e.style.backgroundColor="transparent",e.style.padding="0px",e.style.margin="0px",e.setAttribute("src",
        a.shadow.url),e.style.position="absolute",e.style.left=a.shadow.origin.x?a.shadow.origin.x+"px":0,e.style.top=a.shadow.origin.y?a.shadow.origin.y+"px":0,khtml.maplib.base.helpers.imageNotSelectable(e),g.appendChild(e);this.shadow.dx=this.dx;this.shadow.dy=this.dy}}}else{g=document.createElement("div");g.style.position="absolute";this.shadow=g;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?(e=document.createElement("div"),
        e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='"+standardmarker_shadow+"')",e.style.width="100%",e.style.height="100%"):(e=document.createElement("img"),e.style.backgroundColor="transparent",e.style.padding="0px",e.style.margin="0px",e.setAttribute("src",standardmarker_shadow));e.style.position="absolute";e.style.left="0px";e.style.top="0px";khtml.maplib.base.helpers.imageNotSelectable(e);g.style.width="42px";g.style.height="36px";g.appendChild(e);this.shadow.dx=
        2;this.shadow.dy=36;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?(e=document.createElement("div"),e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true',src='"+standardmarker_image+"')",e.style.width="100%",e.style.height="100%"):(e=document.createElement("img"),e.style.backgroundColor="transparent",e.style.padding="0px",e.style.margin="0px",e.setAttribute("src",standardmarker_image));e.style.border=
        0;e.style.margin=0;e.style.padding=0;khtml.maplib.base.helpers.imageNotSelectable(e);navigator.userAgent.indexOf("MSIE")==-1?e.setAttribute("usemap","#shapemap"+this.constructor.number):a&&a.title&&e.setAttribute("title",a.title);b.style.width="20px";b.style.height="36px";b.appendChild(e);if(navigator.userAgent.indexOf("MSIE")==-1&&navigator.userAgent.indexOf("iPhone")==-1&&navigator.userAgent.indexOf("iPad")==-1){e=document.createElement("map");e.setAttribute("id","shapemap"+this.constructor.number);
        e.setAttribute("name","shapemap"+this.constructor.number);var g=document.createElement("area");g.setAttribute("href","javascript:void(0)");g.setAttribute("shape",standardmarker_shape.type);g.setAttribute("coords",standardmarker_shape.coord);a&&a.title&&g.setAttribute("title",a.title);g.style.cursor="pointer";g.style.display="block";e.appendChild(g);b.appendChild(e);this.area=g;this.MarkerOptions.shape={}}else this.area=this.MarkerOptions.shape=null,this._setCursor("pointer");this.dx=2;this.dy=36;
        b.style.width="20px";b.style.height="36px"}a.map&&a.map.addOverlay(this)}else this.MarkerOptions={},this.MarkerOptions.draggable=!1,this.dy=this.dx=0,this._setCursor("pointer")};khtml.maplib.overlay.Marker.number=0;
navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?(dragcross_image=khtml.maplib.standardimagepath+"./dragcross_nor.png",standardmarker_image=khtml.maplib.standardimagepath+"./standardmarker_nor.png",standardmarker_shadow=khtml.maplib.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14,18,15,17,16,16,17,15,18,13,19,8,20,8,21,8,22,7,23,7,24,7,25,7,26,6,27,6,28,6,29,5,30,5,31,5,32,4,33,4,34,3,35,1,35,1,34,1,33,1,32,1,31,1,30,2,29,2,28,2,27,3,26,3,25,3,24,4,23,4,22,4,21,4,20,5,19,4,18,3,17,2,16,1,15,1,14,0,13,0,6,1,4,2,3,3,2,4,1,6,0,13,0],type:"poly"};khtml.maplib.overlay.InfoWindowOptions=function(a,c,d,b,e){if(a)this.content=a;if(e)this.position=e};
khtml.maplib.overlay.InfoWindow=function(a){this.infobox=document.createElement("div");this.infobox.style.position="absolute";this.infobox.style.left="-1000px";upperleftdiv=document.createElement("div");upperleftdiv.style.position="absolute";upperleftdiv.style.width="10px";upperleftdiv.style.height="10px";upperleftdiv.style.top=0;upperleftdiv.style.left=0;upperleftdiv.style.overflow="hidden";navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+
    5))<=7?(upperleftimg=document.createElement("div"),upperleftimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+corner_image+"')",upperleftimg.style.width="100%",upperleftimg.style.height="100%"):(upperleftimg=document.createElement("img"),upperleftimg.setAttribute("src",corner_image));upperleftimg.style.position="absolute";upperleftimg.style.top=0;upperleftimg.style.left=0;khtml.maplib.base.helpers.imageNotSelectable(upperleftimg);upperleftdiv.appendChild(upperleftimg);this.infobox.appendChild(upperleftdiv);
    this.upperdiv=document.createElement("div");this.upperdiv.style.position="absolute";this.upperdiv.style.height="10px";this.upperdiv.style.left="10px";this.upperdiv.style.top=0;this.upperdiv.style.borderTop="1px solid gray";this.upperdiv.style.backgroundColor="white";this.infobox.appendChild(this.upperdiv);upperrightdiv=document.createElement("div");upperrightdiv.style.position="absolute";upperrightdiv.style.width="10px";upperrightdiv.style.height="10px";upperrightdiv.style.top=0;upperrightdiv.style.right=
        0;upperrightdiv.style.overflow="hidden";navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?(upperrightimg=document.createElement("div"),upperrightimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+corner_image+"')",upperrightimg.style.width="100%",upperrightimg.style.height="100%"):(upperrightimg=document.createElement("img"),upperrightimg.setAttribute("src",corner_image));upperrightimg.style.position=
        "absolute";upperrightimg.style.top=0;upperrightimg.style.right=0;khtml.maplib.base.helpers.imageNotSelectable(upperrightimg);upperrightdiv.appendChild(upperrightimg);this.infobox.appendChild(upperrightdiv);this.leftdiv=document.createElement("div");this.leftdiv.style.position="absolute";this.leftdiv.style.width="10px";this.leftdiv.style.top="10px";this.leftdiv.style.left=0;this.leftdiv.style.borderLeft="1px solid gray";this.leftdiv.style.backgroundColor="white";this.infobox.appendChild(this.leftdiv);
    lowerleftdiv=document.createElement("div");lowerleftdiv.style.position="absolute";lowerleftdiv.style.width="10px";lowerleftdiv.style.height="10px";lowerleftdiv.style.bottom=0;lowerleftdiv.style.left=0;lowerleftdiv.style.overflow="hidden";navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?(lowerleftimg=document.createElement("div"),lowerleftimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+corner_image+
        "')",lowerleftimg.style.width="100%",lowerleftimg.style.height="100%"):(lowerleftimg=document.createElement("img"),lowerleftimg.setAttribute("src",corner_image));lowerleftimg.style.position="absolute";lowerleftimg.style.bottom=0;lowerleftimg.style.left=0;khtml.maplib.base.helpers.imageNotSelectable(lowerleftimg);lowerleftdiv.appendChild(lowerleftimg);this.infobox.appendChild(lowerleftdiv);this.rightdiv=document.createElement("div");this.rightdiv.style.position="absolute";this.rightdiv.style.width=
        "10px";this.rightdiv.style.top="10px";this.rightdiv.style.right=0;this.rightdiv.style.borderRight="1px solid gray";this.rightdiv.style.backgroundColor="white";this.infobox.appendChild(this.rightdiv);lowerrightdiv=document.createElement("div");lowerrightdiv.style.position="absolute";lowerrightdiv.style.width="10px";lowerrightdiv.style.height="10px";lowerrightdiv.style.bottom=0;lowerrightdiv.style.right=0;lowerrightdiv.style.overflow="hidden";navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+
        5))<=7?(lowerrightimg=document.createElement("div"),lowerrightimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+corner_image+"')",lowerrightimg.style.width="100%",lowerrightimg.style.height="100%"):(lowerrightimg=document.createElement("img"),lowerrightimg.setAttribute("src",corner_image));lowerrightimg.style.position="absolute";lowerrightimg.style.bottom=0;lowerrightimg.style.right=0;khtml.maplib.base.helpers.imageNotSelectable(lowerrightimg);lowerrightdiv.appendChild(lowerrightimg);
    this.infobox.appendChild(lowerrightdiv);this.lowerdiv=document.createElement("div");this.lowerdiv.style.position="absolute";this.lowerdiv.style.height="10px";this.lowerdiv.style.left="10px";this.lowerdiv.style.bottom=0;this.lowerdiv.style.borderBottom="1px solid gray";this.lowerdiv.style.backgroundColor="white";this.infobox.appendChild(this.lowerdiv);khtml.maplib.base.helpers.setCursor(this.infobox,"default");this.infobox.content=document.createElement("div");this.infobox.content.style.position="absolute";
    this.infobox.content.style.backgroundColor="white";if(a.content)this.infobox.content.innerHTML=a.content;this.infobox.appendChild(this.infobox.content);this.infobox.pointer=document.createElement("div");this.infobox.pointer.style.position="absolute";this.infobox.pointer.style.bottom="0";this.infobox.pointer.style.left="0";for(var c=0;c<10;c++){el=document.createElement("div");el.style.position="absolute";el.style.overflow="hidden";el.style.cursor="default";el.style.height=pointerheight/10+1+"px";
        el.style.width=pointerwidth/2+4-pointerwidth/10/2*c+2+"px";el.style.bottom=-(c+1)*pointerheight/10+"px";el.style.left=pointerwidth/2-5*c-(10-c)/2+"px";if(navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7){var d=document.createElement("div");d.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+pointer_image+"')";d.style.width="100%";d.style.height="100%"}else d=document.createElement("img"),d.setAttribute("src",
            pointer_image);d.style.cursor="default";d.style.position="absolute";d.style.top=-c*pointerheight/10+"px";d.style.left=-pointerwidth/2+5*c+(10-c)/2+"px";d.style.zIndex=0;khtml.maplib.base.helpers.imageNotSelectable(d);el.appendChild(d);this.infobox.pointer.appendChild(el)}this.infobox.appendChild(this.infobox.pointer);this.closebutton=document.createElement("div");this.closebutton.style.position="absolute";navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)?
        (this.closebutton.style.height="28px",this.closebutton.style.width="28px",this.closebutton.style.top="0px",this.closebutton.style.right="0px"):(this.closebutton.style.height="10px",this.closebutton.style.width="10px",this.closebutton.style.top="4px",this.closebutton.style.right="4px");this.closebutton.style.padding="0";this.closebutton.style.zIndex="10000";navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?(el=document.createElement("div"),
        el.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+close_image+"')",el.style.width="100%",el.style.height="100%"):(el=document.createElement("img"),el.setAttribute("src",close_image));el.style.opacity=0.6;el.style.cursor="pointer";el.style.position="absolute";navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/iPad/i)?(el.style.width="20px",el.style.height="20px",el.style.top="4px",el.style.right="4px"):(el.style.width="10px",
        el.style.height="10px",el.style.top=0,el.style.right=0);khtml.maplib.base.helpers.imageNotSelectable(el);el.setAttribute("onmouseover","javascript:this.style.opacity='1'");el.setAttribute("onmouseout","javascript:this.style.opacity='0.6'");this.closebutton.appendChild(el);this.infobox.appendChild(this.closebutton);khtml.maplib.base.helpers.eventAttach(this.closebutton,"click",function(){this.close()},this,!1);shadow={};this.shadow=document.createElement("div");this.shadow.style.position="absolute";
    this.shadow.style.left="-1000px";this.shadow.upperleftdiv=document.createElement("div");this.shadow.upperleftdiv.style.position="absolute";this.shadow.upperleftdiv.style.width="30px";this.shadow.upperleftdiv.style.height="20px";this.shadow.upperleftdiv.style.top=0;this.shadow.upperleftdiv.style.overflow="hidden";shadow.upperleftimg=document.createElement("img");shadow.upperleftimg.style.position="absolute";shadow.upperleftimg.style.top=0;shadow.upperleftimg.style.left="-309px";navigator.userAgent.indexOf("MSIE")!=
        -1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?shadow.upperleftimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.upperleftimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.upperleftimg);this.shadow.upperleftdiv.appendChild(shadow.upperleftimg);this.shadow.appendChild(this.shadow.upperleftdiv);this.shadow.upperrightdiv=document.createElement("div");this.shadow.upperrightdiv.style.position=
        "absolute";this.shadow.upperrightdiv.style.width="30px";this.shadow.upperrightdiv.style.height="20px";this.shadow.upperrightdiv.style.top=0;this.shadow.upperrightdiv.style.right=0;this.shadow.upperrightdiv.style.overflow="hidden";shadow.upperrightimg=document.createElement("img");shadow.upperrightimg.style.position="absolute";shadow.upperrightimg.style.top=0;shadow.upperrightimg.style.right=0;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+
        5))<=7?shadow.upperrightimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.upperrightimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.upperrightimg);this.shadow.upperrightdiv.appendChild(shadow.upperrightimg);this.shadow.appendChild(this.shadow.upperrightdiv);this.shadow.upperdiv=document.createElement("div");this.shadow.upperdiv.style.position="absolute";this.shadow.upperdiv.style.height=this.shadow.upperrightdiv.style.height;
    this.shadow.upperdiv.style.top=this.shadow.upperleftdiv.style.top;this.shadow.upperdiv.style.overflow="hidden";shadow.upperimg=document.createElement("img");shadow.upperimg.style.position="absolute";shadow.upperimg.style.top=0;shadow.upperimg.style.right="-"+this.shadow.upperrightdiv.style.width;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?shadow.upperimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+
        shadow_image+"')":shadow.upperimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.upperimg);this.shadow.upperdiv.appendChild(shadow.upperimg);this.shadow.appendChild(this.shadow.upperdiv);this.shadow.lowerleftdiv=document.createElement("div");this.shadow.lowerleftdiv.style.position="absolute";this.shadow.lowerleftdiv.style.height="54px";this.shadow.lowerleftdiv.style.bottom=0;this.shadow.lowerleftdiv.style.left=0;this.shadow.lowerleftdiv.style.overflow="hidden";
    shadow.lowerleftimg=document.createElement("img");shadow.lowerleftimg.style.position="absolute";shadow.lowerleftimg.style.bottom=0;shadow.lowerleftimg.style.left=0;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?shadow.lowerleftimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.lowerleftimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.lowerleftimg);
    this.shadow.lowerleftdiv.appendChild(shadow.lowerleftimg);this.shadow.appendChild(this.shadow.lowerleftdiv);this.shadow.lowerrightdiv=document.createElement("div");this.shadow.lowerrightdiv.style.position="absolute";this.shadow.lowerrightdiv.style.height="54px";this.shadow.lowerrightdiv.style.bottom=0;this.shadow.lowerrightdiv.style.overflow="hidden";shadow.lowerrightimg=document.createElement("img");shadow.lowerrightimg.style.position="absolute";shadow.lowerrightimg.style.bottom=0;shadow.lowerrightimg.style.right=
        "-300px";navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?shadow.lowerrightimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.lowerrightimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.lowerrightimg);this.shadow.lowerrightdiv.appendChild(shadow.lowerrightimg);this.shadow.appendChild(this.shadow.lowerrightdiv);this.shadow.rightdiv=document.createElement("div");
    this.shadow.rightdiv.style.position="absolute";this.shadow.rightdiv.style.top=this.shadow.upperrightdiv.style.height;this.shadow.rightdiv.style.right=0;this.shadow.rightdiv.style.overflow="hidden";shadow.rightimg=document.createElement("img");shadow.rightimg.style.position="absolute";shadow.rightimg.style.top="-"+this.shadow.upperrightdiv.style.height;shadow.rightimg.style.right=0;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=
        7?shadow.rightimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.rightimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.rightimg);this.shadow.rightdiv.appendChild(shadow.rightimg);this.shadow.appendChild(this.shadow.rightdiv);this.shadow.leftdiv=document.createElement("div");this.shadow.leftdiv.style.position="absolute";this.shadow.leftdiv.style.top=this.shadow.upperleftdiv.style.height;this.shadow.leftdiv.style.left=
        0;this.shadow.leftdiv.style.overflow="hidden";shadow.leftimg=document.createElement("img");shadow.leftimg.style.position="absolute";shadow.leftimg.style.bottom="-"+this.shadow.lowerleftdiv.style.height;shadow.leftimg.style.left=0;navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?shadow.leftimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.leftimg.setAttribute("src",shadow_image);
    khtml.maplib.base.helpers.imageNotSelectable(shadow.leftimg);this.shadow.leftdiv.appendChild(shadow.leftimg);this.shadow.appendChild(this.shadow.leftdiv);this.shadow.middlediv=document.createElement("div");this.shadow.middlediv.style.position="absolute";this.shadow.middlediv.style.top=this.shadow.upperleftdiv.style.height;this.shadow.middlediv.style.overflow="hidden";shadow.middleimg=document.createElement("img");shadow.middleimg.style.position="absolute";shadow.middleimg.style.top="-"+this.shadow.upperleftdiv.style.height;
    shadow.middleimg.style.left=parseInt(shadow.upperleftimg.style.left)-parseInt(this.shadow.upperleftdiv.style.height)+"px";navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?shadow.middleimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.middleimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.middleimg);this.shadow.middlediv.appendChild(shadow.middleimg);
    this.shadow.appendChild(this.shadow.middlediv);this.shadow.pointer=document.createElement("div");this.shadow.pointer.style.position="absolute";this.shadow.pointer.style.overflow="hidden";this.shadow.pointer.style.width="140px";this.shadow.pointer.style.height="54px";this.shadow.pointer.style.bottom=0;shadow.pointerimg=document.createElement("img");shadow.pointerimg.style.position="absolute";shadow.pointerimg.style.bottom=0;shadow.pointerimg.style.left="-255px";navigator.userAgent.indexOf("MSIE")!=
        -1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7?shadow.pointerimg.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+shadow_image+"')":shadow.pointerimg.setAttribute("src",shadow_image);khtml.maplib.base.helpers.imageNotSelectable(shadow.pointerimg);this.shadow.pointer.appendChild(shadow.pointerimg);this.shadow.appendChild(this.shadow.pointer);this.render=function(){typeof this.anchorObject=="object"?(this.xy=this.mapObj.latlngToXY(this.anchorObject.getPosition()),
        this.offset=this.anchorObject.pixelOffset?this.anchorObject.pixelOffset():{x:0,y:0}):a?(this.xy=a.position?this.mapObj.latlngToXY(a.position):this.mapObj.latlngToXY(this.mapObj.getCenter()),a.pixelOffset?(this.offset.x=a.pixelOffset.x?a.pixelOffset.x:0,this.offset.y=a.pixelOffset.y?a.pixelOffset.y:0):this.offset={x:0,y:0}):this.xy=this.mapObj.latlngToXY(this.mapObj.getCenter());this.infobox.style.left=this.xy.x+this.offset.x-(parseInt(this.infobox.style.width)-pointerwidth)/2+"px";this.infobox.style.bottom=
        -this.xy.y+this.offset.y+pointerheight-1+"px";this.infobox.style.zIndex=parseInt(this.xy.y)+this.mapObj.size.height;this.shadow.style.left=parseInt(this.infobox.style.left)+pointerheight/2+"px";this.shadow.style.bottom=parseInt(this.infobox.style.bottom)-pointerheight+"px";this.shadow.style.zIndex=parseInt(this.xy.y);this.opened&&this._moveMap()};this.open=function(b,a){this.mapObj=b;this.anchorObject=a;if(!this.mapObj.overlayDiv.infoboxShadowDiv)this.mapObj.overlayDiv.infoboxShadowDiv=document.createElement("div"),
        this.mapObj.overlayDiv.appendChild(this.mapObj.overlayDiv.infoboxShadowDiv),this.mapObj.overlayDiv.infoboxShadowDiv.setAttribute("id","infoboxShadowDiv");this.shadow.parentNode&&this.shadow.parentNode.removeChild(this.shadow);this.mapObj.overlayDiv.infoboxShadowDiv.appendChild(this.shadow);if(!this.mapObj.overlayDiv.infoboxDiv)this.mapObj.overlayDiv.infoboxDiv=document.createElement("div"),this.mapObj.overlayDiv.appendChild(this.mapObj.overlayDiv.infoboxDiv),this.mapObj.overlayDiv.infoboxDiv.setAttribute("id",
        "infoboxDiv");this.infobox.parentNode&&this.infobox.parentNode.removeChild(this.infobox);this.mapObj.overlayDiv.infoboxDiv.appendChild(this.infobox);this.opened=!0;this.mapObj.addOverlay(this);this.infobox.style.width=parseInt(this.infobox.content.offsetWidth)>250?parseInt(this.infobox.content.offsetWidth)+20+"px":"270px";if(parseInt(this.infobox.content.offsetWidth)>parseInt(this.mapObj.size.width)-40)this.infobox.style.width=parseInt(this.mapObj.size.width)-20+"px",this.infobox.style.whiteSpace=
        "normal";if(parseInt(this.infobox.content.offsetWidth)>640)this.infobox.style.width="660px",this.infobox.style.whiteSpace="normal";this.infobox.content.style.left="10px";this.infobox.content.style.width=parseInt(this.infobox.style.width)-20+"px";this.infobox.style.height=parseInt(this.infobox.content.offsetHeight)>60?parseInt(this.infobox.content.offsetHeight)+20+"px":"80px";if(parseInt(this.infobox.content.offsetHeight)>parseInt(this.mapObj.size.height)-40-pointerheight-this.offset.y)this.infobox.style.height=
        this.mapObj.size.height-pointerheight-this.offset.y-20+"px",this.infobox.content.style.overflowY="scroll",this.infobox.content.style.overflow="auto",this.infobox.content.style.WebkitOverflowScrolling="touch";this.upperdiv.style.width=parseInt(this.infobox.style.width)-20+"px";this.leftdiv.style.height=parseInt(this.infobox.style.height)-20+"px";this.rightdiv.style.height=parseInt(this.infobox.style.height)-20+"px";this.lowerdiv.style.width=parseInt(this.infobox.style.width)-20+"px";this.infobox.content.style.top=
        "10px";this.infobox.content.style.height=parseInt(this.infobox.style.height)-20+"px";this.infobox.pointer.style.left=(parseInt(this.infobox.style.width)-pointerwidth)/2+"px";this.shadow.style.width=parseInt(this.infobox.style.width)+Math.floor(parseInt(this.infobox.style.height)/2)+"px";this.shadow.style.height=Math.ceil(parseInt(this.infobox.style.height)/2)+pointerheight/2+"px";this.shadow.pointer.style.left=parseInt(this.infobox.pointer.style.left)-pointerheight/2+"px";this.shadow.lowerleftdiv.style.width=
        this.shadow.pointer.style.left;this.shadow.upperleftdiv.style.left=Math.floor(parseInt(this.infobox.style.height)/2)-(parseInt(this.shadow.lowerrightdiv.style.height)-pointerheight/2)-9+"px";this.shadow.lowerrightdiv.style.left=parseInt(this.shadow.pointer.style.left)+parseInt(this.shadow.pointer.style.width)+"px";this.shadow.lowerrightdiv.style.width=parseInt(this.shadow.style.width)-parseInt(this.shadow.pointer.style.left)-parseInt(this.shadow.pointer.style.width)-parseInt(this.shadow.upperleftdiv.style.left)+
        9+"px";this.shadow.upperdiv.style.left=parseInt(this.shadow.upperleftdiv.style.left)+parseInt(this.shadow.upperleftdiv.style.width)+"px";this.shadow.upperdiv.style.width=parseInt(this.shadow.style.width)-parseInt(this.shadow.upperleftdiv.style.left)-parseInt(this.shadow.upperleftdiv.style.width)-parseInt(this.shadow.upperrightdiv.style.width)+"px";this.shadow.rightdiv.style.width=Math.floor(parseInt(this.infobox.style.height)/2)+"px";this.shadow.rightdiv.style.height=parseInt(this.shadow.style.height)-
        74+"px";this.shadow.leftdiv.style.width=Math.floor(parseInt(this.infobox.style.height)/2)+"px";this.shadow.leftdiv.style.height=parseInt(this.shadow.style.height)-74+"px";this.shadow.middlediv.style.left=this.shadow.leftdiv.style.width;this.shadow.middlediv.style.width=parseInt(this.shadow.style.width)-parseInt(this.shadow.leftdiv.style.width)-parseInt(this.shadow.rightdiv.style.width)+"px";this.shadow.middlediv.style.height=parseInt(this.shadow.style.height)-parseInt(this.shadow.upperdiv.style.height)-
        parseInt(this.shadow.lowerleftdiv.style.height)+"px";khtml.maplib.base.helpers.eventAttach(this.infobox,"DOMMouseScroll",khtml.maplib.base.helpers.cancelEvent,this,!1);khtml.maplib.base.helpers.eventAttach(this.infobox,"dblclick",khtml.maplib.base.helpers.cancelEvent,this,!1);khtml.maplib.base.helpers.eventAttach(this.infobox.content,"mousedown",khtml.maplib.base.helpers.cancelEvent,this,!1);khtml.maplib.base.helpers.eventAttach(this.infobox.content,"touchstart",khtml.maplib.base.helpers.cancelEvent,
        this,!1);khtml.maplib.base.helpers.eventAttach(this.infobox.content,"touchmove",khtml.maplib.base.helpers.cancelEvent,this,!1);khtml.maplib.base.helpers.eventAttach(this.infobox,"mousedown",function(b){khtml.maplib.base.helpers.stopEventPropagation(b);khtml.maplib.base.helpers.cancelEvent(b)},this,!1);khtml.maplib.base.helpers.eventAttach(this.infobox.content,"contextmenu",khtml.maplib.base.helpers.cancelEvent,this,!1);if(this.anchorObject){var c=this;this.anchorObject.position.addCallbackFunction(function(){c.render()})}};
    this.clear=function(){if(this.infobox&&this.infobox.parentNode)try{this.infobox.parentNode.removeChild(this.infobox)}catch(b){}if(this.shadow&&this.shadow.parentNode)try{this.shadow.parentNode.removeChild(this.shadow)}catch(a){}this.opened=!1};this.close=function(){this.mapObj.removeOverlay(this)};this.setContent=function(b){this.infobox.content.innerHTML=b};var b=1,e=1;this._moveMap=function(){var a=this;this.infobox.offsetLeft+parseInt(this.infobox.style.width)>this.mapObj.size.width-10?(this.infobox.offsetLeft+
        parseInt(this.infobox.style.width)<this.mapObj.size.width?b=10-(this.mapObj.size.width-(this.infobox.offsetLeft+parseInt(this.infobox.style.width))):b<20&&b++,this.infobox.offsetTop<10?(this.infobox.offsetTop>0?e=10-this.infobox.offsetTop:e<20&&e++,window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(-b,e)},10)):this.xy.y>this.mapObj.size.height-10?(this.xy.y<this.mapObj.size.height?e=10-(this.mapObj.size.height-this.xy.y):e<20&&e++,window.clearInterval(this.mapmoveInterval),
        this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(-b,-e)},10)):(window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(-b,0)},10))):this.infobox.offsetLeft<10?(this.infobox.offsetLeft>0?b=10-this.infobox.offsetLeft:b<20&&b++,this.infobox.offsetTop<10?(this.infobox.offsetTop>0?e=10-this.infobox.offsetTop:e<20&&e++,window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(b,e)},
        10)):this.xy.y>this.mapObj.size.height-10?(this.xy.y<this.mapObj.size.height?e=10-(this.mapObj.size.height-this.xy.y):e<20&&e++,window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(b,-e)},10)):(window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(b,0)},10))):this.infobox.offsetTop<10?(this.infobox.offsetTop>0?e=10-this.infobox.offsetTop:e<20&&e++,window.clearInterval(this.mapmoveInterval),
        this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(0,e)},10)):this.xy.y>this.mapObj.size.height-10?(this.xy.y<this.mapObj.size.height?e=10-(this.mapObj.size.height-this.xy.y):e<20&&e++,window.clearInterval(this.mapmoveInterval),this.mapmoveInterval=window.setInterval(function(){a.mapObj.moveXY(0,-e)},10)):(window.clearInterval(this.mapmoveInterval),mapMoveSpeed=1,this.opened=!1)};this._clickdetectstart=function(b){if(b.touches.length==1)this.clickDetectY=this.clickDetectX=-1};this._clickdetectmove=
        function(b){if(b.touches.length==1)this.clickDetectX=b.touches[0].pageX,this.clickDetectY=b.touches[0].pageY};this._clickdetectstop=function(b){b.touches.length==0&&this.clickDetectX==-1&&this.clickDetectY==-1&&this.close()};khtml.maplib.base.helpers.eventAttach(this.closebutton,"touchstart",this._clickdetectstart,this,!1);khtml.maplib.base.helpers.eventAttach(this.closebutton,"touchmove",this._clickdetectmove,this,!1);khtml.maplib.base.helpers.eventAttach(this.closebutton,"touchend",this._clickdetectstop,
        this,!1)};var pointerwidth=90,pointerheight=70;
if(navigator.userAgent.indexOf("MSIE")!=-1&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))<=7)var pointer_image=khtml.maplib.standardimagepath+"./pointer_nor.png",corner_image=khtml.maplib.standardimagepath+"./corners_nor.png",shadow_image=khtml.maplib.standardimagepath+"./shadow_nor.png",close_image=khtml.maplib.standardimagepath+"./close_nor.png";else pointer_image="data:image/png;base64, ",corner_image=
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+I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qUowwgAAAgJJREFUeNqslF1kW2EYx5+T0y1ChIRxktGrfBDGOCE3vYhcHSmj7GpUu5vdjVHKbCRh097sYlezq+1mjUQJIzLKmJBQCSHycRESJRLCiIREpbL/E++ptouk69mfv/N4znl/53m/HikWi9ECWeFn8BNYhRWRP4NL8LHweTQavTZwbQHsBXygqqrD5/OR0+kkq9U6fzEYDNa73e56rVbbqlQqB0jtCfClpCsV3oc/A7QbCARIURRaplarRcVikQA/RJWv9bwcCoX0+EswGNyJRCKXFS2T3W4nt9tNk8lkI5FI3APnJ+dN+jRR2bamafQvMpvNFA6HGfwmHo9rOpDLecfTvIssFguJsR8AlRm4jcSDVWu2TLx5Ho/Hj1Bj4KbX6yWjEoxNBqp8NIxKMFSTLMvKbXZ1lWw2Gz8emiRJov8hwZFN0+n093g8NgwcjUb86PEannY6HcNAwThlYLrRaBgGCkaagUelUqlvpEqGNZvNGsITBvLk9/mi30XoQJRMJi8QvkKTuNDv8tdyufwpm83ScDi8NazX61Eul+PwLWAnN7vND0z7vFAobOBcyi6Xayksn89TKpUaoT++BOzjogbLZb+Hv2cymW/tdvuR3+8nh8Mx742z2WxeUb/fp3q9zuv2C98+B6y1qmNX4EC1Wt2CnyJ2w4/FD8swL35a+C/9EWAAn8a43yIKi2QAAAAASUVORK5CYII=",
    shadow_image="data:image/png;base64, ",
    close_image="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzoz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6AbCbEMHIEP3Qg1VwWIYDMRCzYAbeB+I3YD4Iw5Dj0ENk8Yi/xqInaFmoHj5FFTiI45wk8BhmAMQX8AVKWehhr4jItm8gBp2jVCyOYvHpXgNw5ewCYH/QPyd2IRtDI1ZfLlFEikt4jXQEmqYEBGulIOmU0VcBoIM247DZU+gMYov16AYCHLRLhyG3QFiC2gkvMAiLw01VAjZQFAyKcCi+CbUoKfQGMVl6CxYUkP28lwgTkHiX0MyDJsFMNAExWDAgmYTyFBmIM6HpsUXOFztDI08kPp6ZElGHCU2GxD/IqKAfUdswv5FRLLBmj0BAgwAom1FkjBGocAAAAAASUVORK5CYII=";khtml.maplib.overlay.SimpleMarker=function(a,c,d){this.nodeName=this.nodeType="SimpleMarker";this.geometry={};this.geometry.coordinates=a;this.geometry.type="Point";this.type="SimpleMarker";var b=document.createElement("div");b.appendChild(c);b.style.position="absolute";if(d){if(d.dy)b.style.top=typeof d.dy=="number"?d.dy+"px":d.dy;if(d.dx)b.style.left=typeof d.dx=="number"?d.dx+"px":d.dx}else b.style.top="0px",b.style.left="0px";var e=document.createElement("div");e.style.position="absolute";e.appendChild(b);
    this.marker=e;this.point=a;this.options=d;this.el=c;this.init=function(b){this.style=this.marker.style;this.owner=b;this.marker.owner=this;this.mapObj=b instanceof khtml.maplib.base.Map?b:b.map;b.overlayDiv.appendChild(this.marker)};this.render=function(){if(this.mapObj&&this.marker&&this.point&&!isNaN(this.point.lat())&&!isNaN(this.point.lng())){var b=this.mapObj.latlngToXY(this.point);b.x<0||b.y<0?this.marker.style.display="none":(this.marker.style.display="",this.marker.style.left=b.x+"px",this.marker.style.top=
        b.y+"px");this.marker.parentNode||this.owner.overlayDiv.appendChild(this.marker)}};this.position=function(b){if(b)this.point=b,this.render();return this.point};this.clear=function(){this.marker&&this.marker.parentNode&&this.marker.parentNode.removeChild(this.marker)};this.destroy=function(){this.clear()};this.moveable=function(b){(this.enabled=b)?(this.downevent=khtml.maplib.base.helpers.eventAttach(this.marker,"mousedown",this.down,this,!0),this.moveevent=khtml.maplib.base.helpers.eventAttach(window,
        "mousemove",this.move,this,!0),this.upevent=khtml.maplib.base.helpers.eventAttach(window,"mouseup",this.up,this,!0)):(khtml.maplib.base.helpers.eventRemove(this.downevent),khtml.maplib.base.helpers.eventRemove(this.moveevent),khtml.maplib.base.helpers.eventRemove(this.upevent))};this.moving=!1;this.dy=this.dx=0;this.down=function(b){this.moving=!0;this.dx=this.marker.offsetLeft-this.mapObj.pageX(b);this.dy=this.marker.offsetTop-this.mapObj.pageY(b)};this.move=function(b){if(this.moving){this.mapObj.pageX(b);
        this.mapObj.pageY(b);var a=this.mapObj.mouseToLatLng(b);this.point.lat(a.lat());this.point.lng(a.lng());this.render();b.stopPropagation()}};this.up=function(){this.moving=!1}};khtml.maplib.overlay.WMS=function(a){this.type="Feature";this.geometry={};this.geometry.type="WMS";this.options=a;this.delayTimeout=null;this.init=function(a){this.owner=a;this.map=this.owner.map instanceof khtml.maplib.Map?this.owner.map:a};this.render=function(){if(map.finalDraw){this.bounds=this.map.bounds();this.map.bounds().getCenter();var a=this.map.bounds().sw().lat(),b=this.map.bounds().ne().lat(),c=this.map.bounds().sw().lng(),g=this.map.bounds().ne().lng(),f=this.map.size.width,m=this.map.size.height,
    h="",k;for(k in this.options.layers)h+=this.options.layers[k]+",";h=h.substring(0,h.length-1);a=this.options.url+"?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.0&FORMAT="+(this.options.parameters.FORMAT?this.options.parameters.FORMAT:"image/png")+"&SRS=EPSG%3A4326&TILED=false&LAYERS="+h+"&BBOX="+c+","+a+","+g+","+b+"&WIDTH="+f+"&HEIGHT="+m;this.tempImg=document.createElement("img");this.tempImg.setAttribute("src",a);khtml.maplib.base.helpers.eventAttach(this.tempImg,"load",this._imgLoaded,this.marker,!1)}else this.map.zoom(),
    this.oldZoom=this.map.zoom()};var c=this;this._imgLoaded=function(){var a=c.options.opacity,b={dx:-c.map.size.width/2,dy:-c.map.size.height/2};c.groundOverlay&&c.map.removeOverlay(c.groundOverlay);c.tempImg.style.opacity=a;c.groundOverlay=new khtml.maplib.overlay.GroundOverlay(c.bounds,c.tempImg,b);c.map.addOverlay(c.groundOverlay)}};khtml.maplib.overlay.GroundOverlay=function(a,c,d){this.geometry={};this.geometry.type="GroundOverlay";this.options=d;this.type="Feature";this._createRenderElement=function(){var b=document.createElement("div");b.appendChild(this.el);b.style.position="absolute";b.style.top="0px";b.style.left="0px";if(this.options){if(this.options.dy)b.style.top=this.options.dy;if(this.options.dx)b.style.left=this.options.dx}return b};this._calcImageSize=function(){var b=this.map.latlngToXY(this.bbox.sw()),a=this.map.latlngToXY(this.bbox.ne()),
    c=this.map.latlngToXY(this.bbox.nw());dx=a.x-b.x;dy=b.y-a.y;this.renderElement.style.width=dx;this.renderElement.style.height=dy;this.renderElement.style.left=c.x+"px";this.renderElement.style.top=c.y+"px";if((b=this.renderElement.getElementsByTagName("img")[0])&&b.tagName=="IMG")b.width=dx,b.height=dy};this.init=function(b){this.owner=b;this.map=b instanceof khtml.maplib.base.Map?b:b.map;khtml.maplib.base.helpers.rotate(this.renderElement,this.rotation*-1)};this.render=function(){this.renderElement&&
    this.point&&!isNaN(this.point.lat())&&!isNaN(this.point.lng())&&this.map&&(null==this.renderElement.parentNode&&this.owner.overlayDiv.appendChild(this.renderElement),this._calcImageSize())};this.bounds=function(){if(this.rotation){khtml.maplib.base.Log.log("lng: "+this.bbox.sw().lng()+"; lat:"+this.bbox.sw().lat());var b=this._transformPoint(this.bbox.sw());khtml.maplib.base.Log.log("lng: "+b.lng()+"; lat:"+b.lat());var a=this._transformPoint(this.bbox.se()),c=this._transformPoint(this.bbox.ne()),
    d=this._transformPoint(this.bbox.nw()),m=Math.min(b.lng(),a.lng(),c.lng(),d.lng()),h=Math.min(b.lat(),a.lat(),c.lat(),d.lat()),k=Math.max(b.lng(),a.lng(),c.lng(),d.lng());b=Math.max(b.lat(),a.lat(),c.lat(),d.lat());khtml.maplib.base.Log.log("in bounds");return new khtml.maplib.geometry.Bounds(new khtml.maplib.LatLng(h,m),new khtml.maplib.geometry.Point(b,k))}else return this.bbox};this._transformPoint=function(b){var a=this.bbox.getCenter(),c=a.lng();a=a.lat();var d=this.rotation*Math.PI/180;khtml.maplib.base.Log.log("theta: "+
    d);khtml.maplib.base.Log.log("rotation: "+this.rotation);var m=b.lng();b=b.lat();b=new khtml.maplib.LatLng(a-(m-c)*Math.sin(d)+(b-a)*Math.cos(d),c+(m-c)*Math.cos(d)+(b-a)*Math.sin(d));c=new khtml.maplib.overlay.SimpleMarker(b,"http://www.din-5008-richtlinien.de/bilder/punkt.gif",{dx:-1,dy:-1});map.addOverlay(c);return b};this.position=function(b){if(b)this.point=b;return this.point};this.clear=function(){this.renderElement.parentNode.removeChild(this.renderElement)};this.makeMoveable=function(){khtml.maplib.base.helpers.eventAttach(this.renderElement,
    "mousedown",this.down,this,!1);khtml.maplib.base.helpers.eventAttach(window,"mousemove",this.move,this,!0);khtml.maplib.base.helpers.eventAttach(window,"mouseup",this.up,this,!0)};this.moving=!1;this.dy=this.dx=0;this.down=function(b){this.moving=!0;this.dx=this.renderElement.offsetLeft-this._map.pageX(b);this.dy=this.renderElement.offsetTop-this._map.pageY(b)};this.move=function(b){if(this.moving){var a=this._map.pageX(b)+this.dx,c=this._map.pageY(b)+this.dy;this.point=this._map.XYTolatlng(a,c);
    this.render();b.stopPropagation()}};this.up=function(){this.moving=!1};this.options=d;this.el=c;this.bbox=a;this.point=this.bbox.nw();if(d!=void 0&&d.rotation!=void 0)this.rotation=d.rotation;this.renderElement=this._createRenderElement()};khtml.maplib.overlay.renderer.Styler=function(){function a(b,a){if(b.search(/^rgb\(/)!=-1){khtml.maplib.base.Log.log("test1");var g;g=b.replace("rgb(","rgba(");return g=g.replace(")",","+a+")")}b[0]!="#"&&(b=="none"?(b="000000",a=0):b="#"+c[b]);g="rgba(";b.charAt(0)=="#"&&(b=b.substr(1));b.length==3&&(b=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2));b=b.toUpperCase();var f=0;for(i=0;i<b.length;i++){var m;for(j=0;j<d.length;j++)if(b.charAt(i)==d[j]){m=j;break}i%2==0?f=m*16:
    (f+=m,g+=i==b.length-1?f+","+a+")":f+", ")}return g}this.classes=[];this.makeCanvasStyle=function(b){if(b.canvasStyle&&!b.owner.map.finalDraw)return b.canvasStyle;for(var a=b,c=null,d=[],m=b.style;a.owner;)d.push(a),a=a.owner;for(a=d.length-1;a>=0;a--){var h=d[a];if(h.className){this.classes[h.className.baseVal]||(this.classes[h.className.baseVal]=this.getCssStyles(h.className.baseVal));var k=this.classes[h.className.baseVal];c=c?this.mergeStyles(k,c):k;h.style&&(c=this.mergeStyles(h.style,c))}}c&&
(c=this.mergeStyles(m,c));if(b.geometry.type!="Polygon"&&b.geometry.type!="MultiPolygon")c.fillOpacity=0;c=this.cssToCanvas(c);return b.canvasStyle=c};this.mergeStyles=function(b,a){var c={},d;for(d in b)c[d]=b[d];c.opacity?a.opacity!=void 0&&(c.opacity*=a.opacity):c.opacity=a.opacity;c.fillOpacity?a.fillOpacity!=void 0&&(c.fillOpacity*=a.fillOpacity):c.fillOpacity=a.fillOpacity;c.strokeOpacity?a.strokeOpacity!=void 0&&(c.strokeOpacity*=a.strokeOpacity):c.strokeOpacity=a.strokeOpacity;if(!c.stroke)c.stroke=
    a.stroke;if(!c.fill)c.fill=a.fill;if(!c.strokeWidth)c.strokeWidth=parseFloat(a.strokeWidth);c.strokeWidth=parseFloat(c.strokeWidth);return c};this.rgba=[];this.cssToCanvas=function(b){if(!b.stroke)b.stroke="none";if(!b.fill)b.fill="black";if(b.opacity==void 0)b.opacity=1;if(b.strokeOpacity==void 0)b.strokeOpacity=1;if(b.fillOpacity==void 0)b.fillOpacity=1;if(!b.strokeWidth)b.strokeWidth=1;if(b.stroke){var c=b.opacity*b.strokeOpacity,d=b.stroke+"X"+c;this.rgba[d]||(this.rgba[d]=a(b.stroke,c));d=b.stroke;
    var f=c,m=this.rgba[b.stroke+"_"+c]}if(b.fill){c=b.opacity*b.fillOpacity;this.rgba[b.fill+"_"+c]||(this.rgba[b.fill+"_"+c]=a(b.fill,c));var h=b.fill,k=c;c=this.rgba[b.fill+"_"+c]}else h=0,k=1,c=0;return{strokeStyle:m,fillStyle:c,lineWidth:b.strokeWidth,fillRGB:h,strokeRGB:d,fillOpacity:k,strokeOpacity:f}};this.getCssStyles=function(b){for(var a={},c=0;c<document.styleSheets.length;c++){var d=document.styleSheets[c];d=d.cssRules?d.cssRules:d.rules;for(r=0;r<d.length;r++){var m=d[r].style.cssText;selectorText=
    d[r].selectorText;if(selectorText=="."+b){m=m.split(";");for(var h=0;h<m.length;h++){var k=m[h].split(":");if(k.length>1){var l=k[0].replace(/^\s/,"");k=k[1].replace(/^\s/,"");if(l=="stroke")a.stroke=k;if(l=="fill")a.fill=k;if(l=="stroke-width")a.strokeWidth=parseFloat(k);if(l=="opacity")a.opacity=parseFloat(k);if(l=="fill-opacity")a.fillOpacity=parseFloat(k);if(l=="stroke-opacity")a.strokeOpacity=parseFloat(k)}}}}}return a};var c={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",
    azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",
    darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",
    khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",
    mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",
    peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",
    white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},d=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"]};khtml.maplib.overlay.GeoJson=function(){function a(){var a=999;navigator.appVersion.indexOf("MSIE")!=-1&&(a=parseFloat(navigator.appVersion.split("MSIE")[1]));return a}this.backend="svg";if(navigator.userAgent.indexOf("MSIE")!=-1){if(a()<9)this.backend="vml";if(document.documentMode<9)this.backend="vml"}this.deltaY=this.deltaX=this.count=0;this.init=function(a){this.map=a;this.root&&this.root.parentNode.removeChild(this.root);this.element&&(this.element.parentNode.removeChild(this.element),delete this.element);
    this.root=document.createElement("div");this.root.style.position="absolute";this.root.setAttribute("GeoJson","root");this.root.setAttribute("id","root");this.map.overlayDiv.appendChild(this.root);this.load({type:"FeatureCollection"})};this.load=function(a){if(!this.element){this.element=this.renderElement(this.root);if(this.backend=="canvas")this.context=this.element.getContext("2d"),this.canvasStyler=new khtml.maplib.overlay.renderer.Styler;if(this.backend=="vml")this.canvasStyler=new khtml.maplib.overlay.renderer.Styler}this.parentNode=
    this.featureCollection=this.recurseInit(a);this.recurseLinksDirty=!0};this.bounds=this.lastzoom=null;this.render=function(a){if(this.featureCollection)if(this.recurseLinksDirty&&this.recurseLink(),!a&&this.backend!="vml"&&(!this.map.finalDraw||this.map.moving)){if(this.element.finished)this.visibleElement=this.element;else{if(!this.oldelement)return;this.visibleElement=this.oldelement}if(this.visibleElement.bounds)this.visibleElement.style.display="",this.visibleElement.bottomleft=this.map.latlngToXY(this.visibleElement.bounds.sw()),
    this.visibleElement.topright=this.map.latlngToXY(this.visibleElement.bounds.ne()),a=this.visibleElement.bottomleft.x,this.visibleElement.style.top=this.visibleElement.topright.y+"px",this.visibleElement.style.left=a+"px",this.visibleElement.style.width=this.visibleElement.topright.x-this.visibleElement.bottomleft.x+"px",this.visibleElement.style.height=-this.visibleElement.topright.y+this.visibleElement.bottomleft.y+"px"}else{if(!this.element)this.element=this.renderElement();if(this.element.finished)this.oldelement&&
    this.root.removeChild(this.oldelement),this.backend=="canvas"?(this.oldelement=this.element,this.element=this.renderElement()):this.oldelement=this.element.cloneNode(!0),this.root.appendChild(this.oldelement),this.oldelement.bounds=this.element.bounds,this.oldelement.style.display="",this.element.style.display="none",this.element.finished=!1,this.element.topright=null,this.element.setAttribute("viewBox","0 0 "+this.map.size.width+" "+this.map.size.height);this.element.style.top="0px";this.element.style.left=
    "0px";this.element.style.width=this.map.size.width+"px";this.element.style.height=this.map.size.height+"px";this.element.bounds=this.map.bounds();this.lastzoom=this.map.zoom();this.clear();a=this.featureCollection;this.recurse(a,a);this.deltaY=this.deltaX=0}};this.makeGroupElements=function(a,d){a.element=document.createElementNS("http://www.w3.org/2000/svg","g");a.element.bounds=this.map.bounds();d.appendChild(a.element);for(var b=0;b<a.features.length;b++)a.features[b].type=="FeatureCollection"&&
this.makeGroupElements(a.features[b],a.element);a.style=a.element.style};this.renderbackend=function(a){var d=this.featureCollection.toJSON();this.root.removeChild(this.element);delete this.element;this.backend=a;this.load(d);this.render(!0)};this.draw=function(){this.recurseLinksDirty=!0;this.render(!0)};this.hide=function(){this.root.style.display="none"};this.recurse=function(a,d){var b=this;this.busy=!0;if(!(this.topright||!this.map.doTheOverlays&&!this.map.finalDraw)){if(d)var e=new Date-d;else d=
    new Date,e=0;if(a&&a.following)if(e<50){for(e=0;e<100;e++){if(!a)break;a.render();a=a.following}if(a)b.recurse(a.following,d);else{b.cleanup();return}}else setTimeout(function(){b.recurse(a.following,new Date)},0);else b.cleanup();a&&a.render()}};this.cleanup=function(){this.oldelement&&(this.root.removeChild(this.oldelement),delete this.oldelement);this.element.style.display="";this.element.finished=!0;this.root.style.display=""};this.recurseInit=function(a,d,b){d||(d=a);var e=d.type=="FeatureCollection"?
    new khtml.maplib.geometry.FeatureCollection(d,this):new khtml.maplib.geometry.Feature(d,this);if(b)e.parentNode=b;if(b)e.documentElement=b.documentElement;if(b)e.owner=b;if(d.type=="FeatureCollection"&&d.features)for(b=0;b<d.features.length;b++){var g=this.recurseInit(a,d.features[b],e);e.features.push(g)}return e};this.recurseLinksDirty=!0;this.recurseLink=function(a,d,b){if(!a)this.removeLinks(),a=this.featureCollection,this.last=null;b||(b=0);d||(d=a);if(this.last)d.preceding=this.last,this.last.following=
    d;this.last=d;if(d.type=="FeatureCollection"){for(var e=0;e<d.features.length;e++){this.recurseLink(a,d.features[e],b+1);if(e==0)d.features[e].precedingSibling=null;if(e>0)d.features[e].precedingSibling=d.features[e-1];if(e<d.features.length-1)d.features[e].followingSibling=d.features[e+1];if(e==d.features.length-1)d.features[e].followingSibling=null}if(d.features[0])d.firstChild=d.features[0],d.lastChild=d.features[d.features.length-1]}if(b==0)this.recurseLinksDirty=!1};this.removeLinks=function(a){if(!a)a=
    this.featureCollection;if(a.features)for(var d=0;d<a.features.length;d++)this.removeLinks(a.features[d]);a.following=null;a.preceding=null;a.followingSibling=null;a.precedingSibling=null};this.initFeature=function(a){return new khtml.maplib.geometry.Feature(a)};this.clear=function(){};this.renderElement=function(){switch(this.backend){case "svg":var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.style.height=this.map.size.height+"px";a.style.width=this.map.size.width+"px";a.style.position=
    "absolute";a.style.top="0px";a.style.left="0px";a.setAttribute("viewBox","0 0 "+this.map.size.width+" "+this.map.size.height);this.root.appendChild(a);return a;case "canvas":return a=document.createvectorEl("canvas"),a.style.height=this.map.size.height+"px",a.style.width=this.map.size.width+"px",a.setAttribute("height",this.map.size.height),a.setAttribute("width",this.map.size.width),a.style.position="absolute",a.style.top="0px",a.style.left="0px",this.context=a.getContext("2d"),this.root.appendChild(a),
    a;case "vml":return document.namespaces&&document.namespaces.v==null&&(document.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),a=document.createStyleSheet(),a.addRule("v\\:group","behavior: url(#default#VML);"),a.addRule("v\\:polyline","behavior: url(#default#VML);"),a.addRule("v\\:stroke","behavior: url(#default#VML);"),a.addRule("v\\:fill","behavior: url(#default#VML);"),a.addRule("v\\:shape","behavior: url(#default#VML);display:inline-block"),a.addRule("v\\:path","behavior: url(#default#VML);")),
    a=document.createElement("v:vml"),a.style.position="absolute",a.style.height=this.map.size.height+"px",a.style.width=this.map.size.width+"px",a.style.position="absolute",a.style.top="0px",a.style.left="0px",a.setAttribute("coordsize",this.map.size.width+" "+this.map.size.height),this.root.appendChild(a),a;default:console.log("not implemented")}}};khtml.maplib.parser.MapCSS=function(){function a(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")}this.size="width:16px;height:16px;";this.mapcss=document.styleSheets[0]?document.styleSheets[0]:document.createStyleSheet("dyn css","projection,tv,screen");this.parse=function(c){var d=0,b="";c=("__"+c+"__").split("");var e={singleQuote:!1,doubleQuote:!1,regex:!1,blockComment:!1,lineComment:!1,condComp:!1},g=0;for(b=c.length;g<b;g++)if(e.regex){if(c[g]==="/"&&c[g-1]!=="\\")e.regex=!1}else if(e.singleQuote){if(c[g]===
    "'"&&c[g-1]!=="\\")e.singleQuote=!1}else if(e.doubleQuote){if(c[g]==='"'&&c[g-1]!=="\\")e.doubleQuote=!1}else if(e.blockComment){if(c[g]==="*"&&c[g+1]==="/")c[g+1]="",e.blockComment=!1;c[g]=""}else if(e.lineComment){if(c[g+1]==="\n"||c[g+1]==="\r")e.lineComment=!1;c[g]=""}else if(e.condComp){if(c[g-2]==="@"&&c[g-1]==="*"&&c[g]==="/")e.condComp=!1}else if(e.doubleQuote=c[g]==='"',e.singleQuote=c[g]==="'",c[g]==="/")c[g+1]==="*"&&c[g+2]==="@"?e.condComp=!0:c[g+1]==="*"?(c[g]="",e.blockComment=!0):c[g+
    1]==="/"?(c[g]="",e.lineComment=!0):e.regex=!0;c=c.join("").slice(2,-2);var f=c.split(/\r\n|\r|\n/);c=[];for(e=0;e<f.length;e++)g=!1,b=a(f[e]).split(/{/),b[1]&&(g=b[1].split(/}/)[0],b="",g&&(c[d]=b+f[e],d++));for(e=0;e<c.length;e++)if(b=c[e].split(/{/),b[1]){g=a(b[1].split(/}/)[0]);d=b[0];selectors=d.split(",");newstring="";for(b=0;b<selectors.length;b++){f=newstring;var m=selectors[b],h=m.split("["),k=h[0].split("|");k[1]&&(k=k[1],k=k.substring(1,k.length),k.split("-"),k.split("-")[1]&&k.split("-"));
    k=h[0].substring(0,4)=="node"?"div.osm_marker":"path";for(var l=1;l<h.length;l++){var n=h[l],o=n.split("]")[0];o=o.split("|")[0];n=n.split("]")[1].split(":");o=o.replace(":","_");n=/[0-9a-zA-Z=_]*/;n=/^[0-9a-zA-Z=_]*$/;n.test(o)&&(k+="[mapcss_"+o+"]")}if((n=m.split(":"))&&n[1])n[1]=a(n[1]),n[1]=="hover"&&(k+=" :"+n[1],console.log(k));newstring=f+(k+",")}b=newstring=newstring.substring(0,newstring.length-1);g=g.split(";");f="";for(m=0;m<g.length;m++)if(h="",k=g[m])l=k.split(":"),l[1]&&(k=a(l[0]),l=
    a(l[1]),k=="fill-color"&&(k="fill"),k=="color"&&(k="stroke"),k=="width"&&(k="stroke-width"),k=="icon-image"&&(k="background-image",l="url("+l+")",h="width:16px;height:16px;"),f+=k+":"+l+";"+h);g=f;f=1;m=18;d=d.split("[")[0];if(d.split("|").length>0&&(d=d.split("|")[1]))d=d.substring(1,d.length),d=d.split("-")[0],f=d[0],d[1]&&(m=d[1]);for(d=f;d<=m;d++)if(b!="path"&&b!="div"){h=".z"+d+" "+b+" {"+g+"}";if(f!=1||m!=18)h=".z"+d+" "+b+" {"+g+"}";else{h=b+" {"+g+"}";this.mapcss.insertRule(h,0);break}this.mapcss.insertRule(h,
    0)}}}};khtml.maplib.parser.Osm=function(){function a(a){return a.replace(/^\s+/,"").replace(/\s+$/,"")}this.nodes=[];this.ways=[];this.mapcssjson={};this.data=function(){return this.featureCollection};this.style=function(a){console.log(a,this.mapcssjson);var d=[],b;for(b in this.mapcssjson)d.push(b);d.sort(function(b,a){return parseFloat(b)-parseFloat(a)});for(var e=0;e<d.length;e++){b=d[e];var g=new khtml.maplib.overlay.FeatureCollection;this.add(a,g,b);map.featureCollection.appendChild(g)}};this.lineStyle=
    function(a,d){for(var b in a.properties)for(var e=0;e<this.mapcssjson[d].length;e++){var g=this.mapcssjson[d][e];if(g.selector.properties&&(g.selector.properties[b]==a.properties[b]||g.selector.properties[b]===!0)){for(var f in g.rules)g.rules[f]&&(a.style[f]=g.rules[f]);if(g.selector.special)a.geometry.type="MultiPolygon"}else a.style.opacity=1}};this.add=function(a,d,b){for(var e=a.getElementsByTagName("node"),g=0;g<e.length;g++){var f=e[g],m=f.getAttribute("id");if(!this.nodes[m]){var h=f.getElementsByTagName("tag");
    f=new khtml.maplib.LatLng(f.getAttribute("lat"),f.getAttribute("lon"));this.nodes[m]=f;m=document.createElement("div");if(h.length>0){var k=new khtml.maplib.overlay.SimpleMarker(f,m);k.properties={};for(f=0;f<h.length;f++){var l=h[f],n=l.getAttribute("k");l=l.getAttribute("v");m.setAttribute("mapcss_"+n,l);k.properties[n]=l}m.className="osm_marker";k.moveable(!0)}}}a=a.getElementsByTagName("way");for(e=0;e<a.length;e++)if(h=a[e],m=b+"_"+h.getAttribute("id"),!this.ways[m]){g=new khtml.maplib.geometry.Feature("MultiLineString");
    g.close=!0;g.id=m;f=h.getElementsByTagName("nd");for(n=0;n<f.length;n++)l=f[n].getAttribute("ref"),this.nodes[l]!=void 0&&g.geometry.coordinates.push(this.nodes[l]);h=h.getElementsByTagName("tag");for(f=0;f<h.length;f++)l=h[f],n=l.getAttribute("k"),l=l.getAttribute("v"),g.properties[n]=l;this.lineStyle(g,b);(g.style.stroke||g.style.fill)&&d.appendChild(g);this.ways[m]=g}};this.mapcss=function(c){cssjson=[];console.log("parse");c=("__"+c+"__").split("");for(var d={singleQuote:!1,doubleQuote:!1,regex:!1,
    blockComment:!1,lineComment:!1,condComp:!1},b=0,e=c.length;b<e;b++)if(d.regex){if(c[b]==="/"&&c[b-1]!=="\\")d.regex=!1}else if(d.singleQuote){if(c[b]==="'"&&c[b-1]!=="\\")d.singleQuote=!1}else if(d.doubleQuote){if(c[b]==='"'&&c[b-1]!=="\\")d.doubleQuote=!1}else if(d.blockComment){if(c[b]==="*"&&c[b+1]==="/")c[b+1]="",d.blockComment=!1;c[b]=""}else if(d.lineComment){if(c[b+1]==="\n"||c[b+1]==="\r")d.lineComment=!1;c[b]=""}else if(d.condComp){if(c[b-2]==="@"&&c[b-1]==="*"&&c[b]==="/")d.condComp=!1}else if(d.doubleQuote=
    c[b]==='"',d.singleQuote=c[b]==="'",c[b]==="/")c[b+1]==="*"&&c[b+2]==="@"?d.condComp=!0:c[b+1]==="*"?(c[b]="",d.blockComment=!0):c[b+1]==="/"?(c[b]="",d.lineComment=!0):d.regex=!0;c=c.join("").slice(2,-2);c=c.replace(/@.*\n/g,"");c=c.replace(/[ \t\n]+/g," ");c=c.split(/\}/);for(d=0;d<c.length;d++){b=c[d].split(/\{/);e=b[0].split(/,/);for(var g=0;g<e.length;g++)if(b[1]){for(var f={},m=b[1].split(";"),h=0;h<m.length;h++){var k=a(m[h]).split(":"),l=k[0];k=k[1];l!=""&&(f[l]=a(k))}m={};l=e[g].split("[");
    if(l[0].indexOf("|")==-1)h=l[0];else{k=l[0].split("|");h=a(k[0]);var n=k[1];k=0;var o=25;if(n)n=n.substring(1,n.length),n=n.split("-")[0],k=n[0],n[1]&&(o=n[1]),m.zoom={},m.zoom.min=k,m.zoom.max=o}if(l[1])for(k=1;k<l.length;k++){if(!m.properties)m.properties={};if(l[k].indexOf("=")==-1){k=l[k];var p=k.split("]");m.properties[p[0]]=!0}else o=l[k].split("="),p=a(o[1]).split("]"),m.properties[o[0]]=p[0]}if(p&&p[1]){k=p[1];if(p[1].indexOf("::")!=-1)l=a(p[1]).split("::"),m.subpart=l[1],l.length>0&&(k=l[0]);
        l=a(k).split("/:/");m.special={};for(k=0;k<l.length;k++)l[k]&&(m.special[l[k]]=!0)}m.type=h;cssjson.push({selectororig:e[g],rules:f,selector:m})}}p=cssjson;for(c=0;c<p.length;c++)for(s in p[c].rules)switch(s){case "color":p[c].rules.stroke=p[c].rules[s];break;case "fill-color":p[c].rules.fill=p[c].rules[s];break;case "dashes":p[c].rules["stroke-dasharray"]=p[c].rules[s];break;case "width":p[c].rules["stroke-width"]=p[c].rules[s]}cssjson=p;cssjsonz=this.zindex(cssjson);console.log(cssjsonz);this.mapcssjson=
    cssjsonz};this.zindex=function(a){for(var d=0;d<a.length;d++){var b=0;a[d].rules["z-index"]&&(b=a[d].rules["z-index"]);this.mapcssjson[b]||(console.log("---"+b),this.mapcssjson[b]=[]);this.mapcssjson[b].push(a[d])}return this.mapcssjson}};khtml.maplib.parser.Gpx=function(a){this.parse=function(){for(var a=[],d=this.dom.getElementsByTagName("trkseg"),b=0;b<d.length;b++){for(var e=[],g=d.item(b).getElementsByTagName("trkpt"),f=0;f<g.length;f++){var m=g.item(f),h=parseFloat(m.getAttribute("lat"));m=parseFloat(m.getAttribute("lon"));e.push([m,h])}a.push(e)}return new khtml.maplib.geometry.Feature({type:"MultiLineString",coordinates:a})};this.setDom=function(a){this.dom=typeof a=="string"?khtml.maplib.base.helpers.parseXml(a):a};this.setDom(a);
    return this.parse()};khtml.maplib.parser.Kml=function(a){function c(a,c){try{var d=a.getElementsByTagName(c).item(0).firstChild.nodeValue}catch(f){d=""}return d}this.styles=[];var d=new khtml.maplib.geometry.Feature({type:"FeatureCollection"});a.appendChild(d);this.folders=[];this.parse=function(a){a=a.getElementsByTagName("Document").item(0);console.log(a);for(var c=0;c<a.childNodes.length;c++){var g=a.childNodes[c];if(g.nodeType==1)switch(g.tagName){case "Folder":g=this.parseFolder(g);d.appendChild(g);break;case "Style":this.parseStyle(g)}}return d};
    this.parseStyle=function(a){for(var d=0;d<a.childNodes.length;d++){var g=a.childNodes[d];if(g.nodeType==1){var f=a.getAttribute("id");this.styles[f]={};switch(g.tagName){case "LineStyle":g=c(g,"width");this.styles[f].strokeWidth=g;break;case "PolyStyle":g=c(g,"color");f=this.styles[f];var m=g;g=parseInt(m.substring(0,2),16)/256;var h=parseInt(m.substring(2,4),16),k=parseInt(m.substring(4,6),16);m=parseInt(m.substring(6,8),16);f.fill="rgba("+h+","+k+","+m+","+g+")"}}}};this.parseFolder=function(a){var d=
        c(a,"name"),g={name:d};g.placeMarks=[];this.folders.push(g);var f=new khtml.maplib.geometry.Feature({type:"FeatureCollection"});g.feature=f;for(var m=0;m<a.childNodes.length;m++){var h=a.childNodes[m];d=c(h,"name");d={name:d};g.placeMarks.push(d);if(h.nodeType==1){switch(h.tagName){case "Placemark":var k=this.parsePlacemark(f,h);break;case "GroundOverlay":this.parseGroundOverlay(f,h)}if(k)f.appendChild(k),d.feature=k}}return f};this.parseGroundOverlay=function(a,d){var g=c(d.getElementsByTagName("Icon").item(0),
        "href"),f=document.createElement("img");f.setAttribute("src",g);g=d.getElementsByTagName("LatLonBox")[0];var m=c(g,"north"),h=c(g,"east"),k=c(g,"south"),l=c(g,"west");g.getElementsByTagName("rotation");g=new khtml.maplib.geometry.Bounds(new khtml.maplib.LatLng(k,l),new khtml.maplib.LatLng(m,h));f=new khtml.maplib.overlay.GroundOverlay(g,f,{});map.addOverlay(f)};this.parsePlacemark=function(a,d){try{var g=c(d,"styleUrl")}catch(f){}for(var m=0;m<d.childNodes.length;m++){var h=d.childNodes[m];if(h.nodeType==
        1)switch(h.tagName){case "Polygon":var k={type:"Feature"};k.geometry={type:"Polygon"};var l=c(h,"coordinates");l=l.replace(/\n/g," ");l=l.replace(/ +/g," ");l=l.replace(/^ +/,"");l=l.replace(/ +$/,"");h=l.split(" ");k.geometry.coordinates=[];for(m=0;m<h.length;m++){var n=h[m].split(",")[1];l=h[m].split(",")[0];k.geometry.coordinates.push([l,n])}h=g.substring(1,g.length);k.style=this.styles[h];k=a.appendChild(new khtml.maplib.geometry.Feature(k));break;case "Point":k={type:"Feature"},k.geometry={type:"Point"},
        l=c(h,"coordinates"),n=l.split(",")[1],l=l.split(",")[0],k.geometry.coordinates=[l,n],k.marker={},k.marker.infobox=c(h.parentNode,"description"),k=a.appendChild(new khtml.maplib.geometry.Feature(k))}}return k}};khtml.maplib.ui.KeyBoard=function(){this.zoomtime=400;this.init=function(a){this.map=a;khtml.maplib.base.helpers.eventAttach(a.mapParent,"keydown",this.keydown,this,!1)};this.keydown=function(a){switch(a.keyCode){case 37:this.moveit(30,0);break;case 38:this.moveit(0,30);break;case 39:this.moveit(-30,0);break;case 40:this.moveit(0,-30);break;case 35:this.moveit(this.map.size.width*0.4,0);break;case 36:this.moveit(-this.map.size.width*0.4,0);break;case 33:this.moveit(0,this.map.size.height*0.4);break;
    case 34:this.moveit(0,-this.map.size.height*0.4);break;case 187:case 61:case 43:this.zoomin();break;case 189:case 190:case 109:case 45:this.zoomout();break;default:return}a.preventDefault?a.preventDefault():a.returnValue=!1};this.render=function(){};this.zoominge=!1;this.zoomin=function(){var a=Math.ceil(this.map.zoom()+0.1);this.zoominge&&a++;this.map.animatedGoto(this.map.center(),a,this.zoomtime);var c=this;setTimeout(function(){c.zoominge=!1},this.zoomtime);this.zoominge=!0};this.zoomout=
    function(){var a=Math.floor(this.map.zoom()-0.1);this.zoomingOut&&a--;this.map.animatedGoto(this.map.center(),a,this.zoomtime);var c=this;setTimeout(function(){c.zoomingOut=!1},this.zoomtime);this.zoomingOut=!0};this.keyup=function(){};this.moveit=function(a,c){for(var d=a/20,b=c/20,e=0;e<20;e++){var g=Math.cos(3*(-10+e)/20)*5;this.moveitexec(d*g,b*g,e)}};this.moveitexec=function(a,c,d){setTimeout(function(){this.map.moveXY(a,c)},20*d)}};khtml.maplib.ui.Zoombar=function(){this.moving=!1;this._cancelEvent=function(a){a.cancelBubble=!0;a.stopPropagation&&a.stopPropagation()};this._stopEventPropagation=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};this._calcZFromY=function(a){return 22-a/10};this._zoom=function(a){a=a.type=="touchstart"||a.type=="touchmove"?this.map.pageY(a.touches[0]):this.map.pageY(a)+this.dy;this.map.centerAndZoom(this.map.center(),this._calcZFromY(a))};this.dy=0;this._down=function(a){var c=a.target?
    a.target:a.srcElement;this._cancelEvent(a);this.moving=!0;this.dy=c==this.scrollhandle?this.scrollhandle.offsetTop-this.map.pageY(a)+10:0;this._zoom(a);this._stopEventPropagation(a)};this._move=function(a){this._cancelEvent(a);this.moving&&(this._zoom(a),this.render(),this._stopEventPropagation(a))};this._up=function(a){this._cancelEvent(a);this.moving=!1;this._stopEventPropagation(a)};this.init=function(a){this.map=a;a=a.mapParent.getElementsByTagName("*");for(var c=0;c<a.length;c++){var d=a.item(c);
    if(d.className=="scrollhandle")this.scrollhandle=d;if(d.className=="zoombar")this.zoombar=d}a=navigator.userAgent.indexOf("MSIE")!=-1?this.map.mapParent:window;if(!this.zoombar)this.zoombar=this._createZoombar();if(!this.scrollhandle)this.scrollhandle=this._createScrollhandle();khtml.maplib.base.helpers.eventAttach(this.zoombar,"mousedown",this._down,this,!1);khtml.maplib.base.helpers.eventAttach(a,"mousemove",this._move,this,!1);khtml.maplib.base.helpers.eventAttach(a,"mouseup",this._up,this,!1);
    khtml.maplib.base.helpers.eventAttach(this.zoombar,"touchstart",this._down,this,!1);khtml.maplib.base.helpers.eventAttach(this.zoombar,"touchmove",this._move,this,!1);khtml.maplib.base.helpers.eventAttach(this.zoombar,"touchend",this._up,this,!1)};this.render=function(){this.scrollhandle.style.top=(21-this.map.zoom())*10+"px";this.scrollhandle.firstChild.nodeValue=Math.round(this.map.zoom())};this._createZoombar=function(){var a=document.createElement("div");a.setAttribute("style","position:absolute;left:10px;width:30px;height:221px;");
    var c=document.createElement("div");c.setAttribute("style","position:absolute;left:7px;top:20px;height:200px;width:11px;background-color:white; overflow:hidden;-moz-border-radius: 5px; -webkit-border-radius: 5px;border:1px solid grey;cursor:pointer;box-shadow:inset 2px 2px 3px #e8e8e8;");a.appendChild(c);this.map.overlayDiv.appendChild(a);return a};this._createScrollhandle=function(){var a=document.createElement("div");a.setAttribute("style","position:absolute;left:3px;top:-10px;width:20px;height:20px;background-color:lightgrey;opacity:0.8; border:1px solid grey;-moz-border-radius: 5px; -webkit-border-radius: 5px;text-align:center;cursor:pointer;box-shadow:1px 1px 4px grey;");
    a.appendChild(document.createTextNode("T"));this.zoombar.appendChild(a);return a};this.clear=function(){this.map.overlayDiv.removeChild(this.zoombar)}};khtml.maplib.util.Http=function(){this._get=function(a,c,d,b){try{return jQuery.get(a,c,d,b)}catch(e){khtml.maplib.base.Log.warn("Exception occured! Did you include the jQuery library?"),khtml.maplib.base.Log.exception(e)}};this.get=function(a,c,d,b){return this._get(a,c,d,b).error(function(a){khtml.maplib.base.Log.error("khtml.maplib.util.Http.get(): request failed!",a)})}};khtml.maplib.util.Urlparam=function(a){HTTP_GET_VARS=[];strGET=document.location.search.substr(1,document.location.search.length);if(strGET!=""){gArr=strGET.split("&");for(i=0;i<gArr.length;++i)v="",vArr=gArr[i].split("="),vArr.length>1&&(v=vArr[1]),HTTP_GET_VARS[unescape(vArr[0])]=unescape(v)}this.GET=function(a){if(!HTTP_GET_VARS[a])return"undefined";return HTTP_GET_VARS[a]};this.GET("lat")!="undefined"&&this.GET("lon")!="undefined"&&a.center(new khtml.maplib.LatLng(parseFloat(this.GET("lat")),
    parseFloat(this.GET("lon"))));this.GET("zoom")!="undefined"&&a.zoom(parseFloat(this.GET("zoom")));this.GET("mlat")!="undefined"&&this.GET("mlon")!="undefined"&&new khtml.maplib.overlay.Marker({position:new khtml.maplib.LatLng(parseFloat(this.GET("mlat")),parseFloat(this.GET("mlon"))),map:a})};khtml.maplib.util.scriptTagProxy=function(a,c){var d=document.getElementsByTagName("head")[0],b=document.createElement("script");b.type="text/javascript";b.onload=function(){d.removeChild(b)};b.src=a;d.appendChild(b);searchResult=c;return b};khtml.maplib.ui.Nominatim=function(){this.width=300;this.height=200;this.init=function(a){this.map=a;this.div=this.createWindow();khtml.maplib.base.helpers.eventAttach(this.map.mapParent,"keydown",this.start,this,!1)};this.render=function(){};var a=this;this.keyup=function(c){this.focus();c.keyCode==27&&this.stop();c=a.input.value;if(c.length<=2)for(;a.div.firstChild;)a.div.removeChild(a.div.firstChild);else c="http://nominatim.openstreetmap.org/search?q="+c+"&format=json&polygon=1&addressdetails=1&json_callback=searchResult",
    this.scriptElement&&this.scriptElement.parentNode&&this.scriptElement.parentNode.removeChild(this.scriptElement),this.ajaxload.style.display="",a.close.style.display="none",this.scriptElement=khtml.maplib.util.scriptTagProxy(c,a.showResult)};this.focus=function(){if(!this.started)this.input.value="";this.started=!0;this.input.style.color="black"};this.showResult=function(c){a.ajaxload.style.display="none";a.close.style.display="";for(a.div.style.display="";a.div.firstChild;)a.div.removeChild(a.div.firstChild);
    for(var d=0;d<c.length;d++){var b=c[d],e=document.createElement("div"),g=document.createTextNode(b.display_name);e.appendChild(g);e.style.fontSize="12px";e.style.width="1200px";e.style.cursor="pointer";a.div.appendChild(e);khtml.maplib.base.helpers.eventAttach(e,"mouseover",a.highlight,e,!1);khtml.maplib.base.helpers.eventAttach(e,"mouseout",a.lowlight,e,!1);khtml.maplib.base.helpers.eventAttach(e,"mousedown",a.select,b,!1)}};this.hideResult=function(){this.timeout=setTimeout(function(){a.div.style.display=
    "none"},1E3)};this.unhideResult=function(){a.div.style.display="";clearTimeout(this.timeout)};this.highlight=function(){this.style.backgroundColor="yellow"};this.lowlight=function(){this.style.backgroundColor=""};this.select=function(){var c=new khtml.maplib.LatLng(this.boundingbox[0],this.boundingbox[2]),d=new khtml.maplib.LatLng(this.boundingbox[1],this.boundingbox[3]);c=new khtml.maplib.geometry.Bounds(c,d);a.map.bounds(c);a.div.style.display="none";a.showPoly(this.polygonpoints)};this.showPoly=
    function(a){this.poly&&this.map.featureCollection.removeChild(this.poly);this.poly=new khtml.maplib.geometry.Feature({type:"LineString",coordinates:a});this.poly.style.fill="none";this.poly.style.stroke="red";this.poly.style.strokeWidth="4";this.map.featureCollection.appendChild(this.poly)};this.stop=function(){this.started=!1;this.win.style.display="none";this.map.mapParent.focus()};this.start=function(a){if(a.keyCode==70){this.win.style.display="";if(a.target!=this.input)this.started=!1;this.input.focus()}};
    this.createWindow=function(){this.win=document.createElement("div");this.win.style.display="none";this.ajaxload=document.createElement("img");this.ajaxload.setAttribute("src",khtml.maplib.base.helpers.ajaxload);this.ajaxload.style.display="none";this.ajaxload.style.position="relative";this.ajaxload.style.top="2px";this.ajaxload.style.left="-20px";this.close=document.createElement("img");this.close.setAttribute("src",khtml.maplib.base.helpers.close);this.close.style.position="relative";this.close.style.top=
        "3px";this.close.style.left="-18px";khtml.maplib.base.helpers.eventAttach(this.close,"mousedown",this.stop,this,!1);this.input=document.createElement("input");this.input.style.width="300px";this.input.style.height="20px";this.input.style.border="1px solid lightgray";this.input.style.color="lightgrey";this.input.value="nominatim search";this.win.appendChild(this.input);this.win.appendChild(this.close);this.win.appendChild(this.ajaxload);khtml.maplib.base.helpers.eventAttach(this.input,"keyup",this.keyup,
        this,!1);var a=document.createElement("div");this.win.style.position="absolute";a.style.width=this.width+"px";var d=this.map.size.left;this.win.style.top=this.map.size.top+"px";this.win.style.left=d+"px";a.style.border="1px solid lightgrey";a.style.backgroundColor="white";a.style.opacity=0.8;a.style.display="none";a.style.overflow="hidden";a.style.borderBottomRightRadius="10px";a.style.borderBottomLeftRadius="10px";a.style.boxShadow="1px 1px 15px #ccc";khtml.maplib.base.helpers.eventAttach(this.win,
        "mouseout",this.hideResult,this,!1);khtml.maplib.base.helpers.eventAttach(this.win,"mouseover",this.unhideResult,this,!1);this.win.appendChild(a);this.map.mapParent.parentNode.appendChild(this.win);return a}};