var OpenLayers={singleFile:true};(function(){var o=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!o)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var d="";var b=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var g=document.getElementsByTagName("script");for(var e=0,a=g.length;e<a;e++){var c=g[e].getAttribute("src");if(c){var f=c.match(b);if(f){d=f[1];break}}}return d}};if(!o){var n=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/ArcGIS93Rest.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/ArcIMS.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/XYZ.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/Snapping.js","OpenLayers/Control/Split.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Control/WMSGetFeatureInfo.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/Vector/RootContainer.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Strategy/Save.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Protocol/WFS.js","OpenLayers/Protocol/WFS/v1.js","OpenLayers/Protocol/WFS/v1_0_0.js","OpenLayers/Protocol/WFS/v1_1_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/ArcXML.js","OpenLayers/Format/ArcXML/Features.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WFSCapabilities.js","OpenLayers/Format/WFSCapabilities/v1.js","OpenLayers/Format/WFSCapabilities/v1_0_0.js","OpenLayers/Format/WFSCapabilities/v1_1_0.js","OpenLayers/Format/WFSDescribeFeatureType.js","OpenLayers/Format/WMSDescribeLayer.js","OpenLayers/Format/WMSDescribeLayer/v1_1.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Filter/v1_1_0.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/WFST.js","OpenLayers/Format/WFST/v1.js","OpenLayers/Format/WFST/v1_0_0.js","OpenLayers/Format/WFST/v1_1_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Format/WMSCapabilities.js","OpenLayers/Format/WMSCapabilities/v1_1.js","OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/GetFeature.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var u=navigator.userAgent;var s=(u.match("MSIE")||u.match("Safari"));if(s){var v=new Array(n.length)}var m=OpenLayers._getScriptLocation()+"lib/";for(var t=0,q=n.length;t<q;t++){if(s){v[t]="<script src='"+m+n[t]+"'><\/script>"}else{var i=document.createElement("script");i.src=m+n[t];var r=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;r.appendChild(i)}}if(s){document.write(v.join(""))}}})();OpenLayers.VERSION_NUMBER="OpenLayers 2.8 -- $Revision: 9492 $";OpenLayers.String={startsWith:function(c,d){return(c.indexOf(d)==0)},contains:function(c,d){return(c.indexOf(d)!=-1)},trim:function(b){return b.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(j){var l=j.split("-");var g=l[0];for(var m=1,i=l.length;m<i;m++){var k=l[m];g+=k.charAt(0).toUpperCase()+k.substring(1)}return g},format:function(g,i,f){if(!i){i=window}var e=function(a,l){var b;var c=l.split(/\.+/);for(var d=0;d<c.length;d++){if(d==0){b=i}b=b[c[d]]}if(typeof b=="function"){b=f?b.apply(null,f):b()}if(typeof b=="undefined"){return"undefined"}else{return b}};return g.replace(OpenLayers.String.tokenRegEx,e)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(b){return OpenLayers.String.numberRegEx.test(b)},numericIf:function(b){return OpenLayers.String.isNumeric(b)?parseFloat(b):b}};if(!String.prototype.startsWith){String.prototype.startsWith=function(b){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,b)}}if(!String.prototype.contains){String.prototype.contains=function(b){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,b)}}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));return OpenLayers.String.trim(this)}}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return OpenLayers.String.camelize(this)}}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(e,f){var d=0;if(f>0){d=parseFloat(e.toPrecision(f))}return d},format:function(r,t,m,k){t=(typeof t!="undefined")?t:0;m=(typeof m!="undefined")?m:OpenLayers.Number.thousandsSeparator;k=(typeof k!="undefined")?k:OpenLayers.Number.decimalSeparator;if(t!=null){r=parseFloat(r.toFixed(t))}var s=r.toString().split(".");if(s.length==1&&t==null){t=0}var q=s[0];if(m){var o=/(-?[0-9]+)([0-9]{3})/;while(o.test(q)){q=q.replace(o,"$1"+m+"$2")}}var n;if(t==0){n=q}else{var l=s.length>1?s[1]:"0";if(t!=null){l=l+new Array(t-l.length+1).join("0")}n=q+k+l}return n}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(b){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,b)}}OpenLayers.Function={bind:function(f,d){var e=Array.prototype.slice.apply(arguments,[2]);return function(){var a=e.concat(Array.prototype.slice.apply(arguments,[0]));return f.apply(d,a)}},bindAsEventListener:function(c,d){return function(a){return c.call(d,a||window.event)}}};if(!Function.prototype.bind){Function.prototype.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bind"}));Array.prototype.unshift.apply(arguments,[this]);return OpenLayers.Function.bind.apply(null,arguments)}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(b){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,b)}}OpenLayers.Array={filter:function(k,l,i){var n=[];if(Array.prototype.filter){n=k.filter(l,i)}else{var j=k.length;if(typeof l!="function"){throw new TypeError()}for(var o=0;o<j;o++){if(o in k){var m=k[o];if(l.call(i,m,o,k)){n.push(m)}}}}return n}};OpenLayers.Class=function(){var l=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var m={};var j,g;for(var k=0,i=arguments.length;k<i;++k){if(typeof arguments[k]=="function"){if(k==0&&i>1){g=arguments[k].prototype.initialize;arguments[k].prototype.initialize=function(){};m=new arguments[k];if(g===undefined){delete arguments[k].prototype.initialize}else{arguments[k].prototype.initialize=g}}j=arguments[k].prototype}else{j=arguments[k]}OpenLayers.Util.extend(m,j)}l.prototype=m;return l};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}}};OpenLayers.Class.inherit=function(){var j=arguments[0];var i=new j(OpenLayers.Class.isPrototype);for(var k=1,g=arguments.length;k<g;k++){if(typeof arguments[k]=="function"){var f=arguments[k];arguments[k]=new f(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(i,arguments[k])}return i};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var g=[];for(var i=0,f=arguments.length;i<f;i++){var e=arguments[i];if(typeof e=="string"){e=document.getElementById(e)}if(arguments.length==1){return e}g.push(e)}return g};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(g,i){g=g||{};if(i){for(var j in i){var k=i[j];if(k!==undefined){g[j]=k}}var f=typeof window.Event=="function"&&i instanceof window.Event;if(!f&&i.hasOwnProperty&&i.hasOwnProperty("toString")){g.toString=i.toString}}return g};OpenLayers.Util.removeItem=function(f,d){for(var e=f.length-1;e>=0;e--){if(f[e]==d){f.splice(e,1)}}return f};OpenLayers.Util.clearArray=function(b){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));b.length=0};OpenLayers.Util.indexOf=function(g,i){for(var e=0,f=g.length;e<f;e++){if(g[e]==i){return e}}return -1};OpenLayers.Util.modifyDOMElement=function(o,l,q,n,k,r,m,j){if(l){o.id=l}if(q){o.style.left=q.x+"px";o.style.top=q.y+"px"}if(n){o.style.width=n.w+"px";o.style.height=n.h+"px"}if(k){o.style.position=k}if(r){o.style.border=r}if(m){o.style.overflow=m}if(parseFloat(j)>=0&&parseFloat(j)<1){o.style.filter="alpha(opacity="+(j*100)+")";o.style.opacity=j}else{if(parseFloat(j)==1){o.style.filter="";o.style.opacity=""}}};OpenLayers.Util.createDiv=function(t,k,l,n,o,r,s,m){var q=document.createElement("div");if(n){q.style.backgroundImage="url("+n+")"}if(!t){t=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!o){o="absolute"}OpenLayers.Util.modifyDOMElement(q,t,k,l,o,r,s,m);return q};OpenLayers.Util.createImage=function(t,l,m,o,q,r,n,k){var s=document.createElement("img");if(!t){t=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!q){q="relative"}OpenLayers.Util.modifyDOMElement(s,t,l,m,q,r,null,n);if(k){s.style.display="none";OpenLayers.Event.observe(s,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,s));OpenLayers.Event.observe(s,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,s))}s.style.alt=t;s.galleryImg="no";if(o){s.src=o}return s};OpenLayers.Util.setOpacity=function(c,d){OpenLayers.Util.modifyDOMElement(c,null,null,null,null,null,null,d)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor="transparent";this.style.display=""}};OpenLayers.Util.onImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var l=this.urls;if(l&&l instanceof Array&&l.length>1){var k=this.src.toString();var m,i;for(i=0;m=l[i];i++){if(k.indexOf(m)!=-1){break}}var j=Math.floor(l.length*Math.random());var g=l[j];i=0;while(g==m&&i++<4){j=Math.floor(l.length*Math.random());g=l[j]}this.src=k.replace(m,g)}else{this.src=this.src}}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var g=navigator.appVersion.split("MSIE");var f=parseFloat(g[1]);var e=false;try{e=!!(document.body.filters)}catch(i){}OpenLayers.Util.alphaHackNeeded=(e&&(f>=5.5)&&(f<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(v,u,l,m,o,q,t,s,n){OpenLayers.Util.modifyDOMElement(v,u,l,m,q,null,null,n);var r=v.childNodes[0];if(o){r.src=o}OpenLayers.Util.modifyDOMElement(r,v.id+"_innerImage",null,m,"relative",t);if(OpenLayers.Util.alphaHack()){if(v.style.display!="none"){v.style.display="inline-block"}if(s==null){s="scale"}v.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+r.src+"', sizingMethod='"+s+"')";if(parseFloat(v.style.opacity)>=0&&parseFloat(v.style.opacity)<1){v.style.filter+=" alpha(opacity="+v.style.opacity*100+")"}r.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(w,n,o,r,s,v,u,q,m){var z=OpenLayers.Util.createDiv();var t=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);z.appendChild(t);if(m){t.style.display="none";OpenLayers.Event.observe(t,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,z));OpenLayers.Event.observe(t,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,z))}OpenLayers.Util.modifyAlphaImageDiv(z,w,n,o,r,s,v,u,q);return z};OpenLayers.Util.upperCaseObject=function(d){var e={};for(var f in d){e[f.toUpperCase()]=d[f]}return e};OpenLayers.Util.applyDefaults=function(g,i){g=g||{};var e=typeof window.Event=="function"&&i instanceof window.Event;for(var f in i){if(g[f]===undefined||(!e&&i.hasOwnProperty&&i.hasOwnProperty(f)&&!g.hasOwnProperty(f))){g[f]=i[f]}}if(!e&&i&&i.hasOwnProperty&&i.hasOwnProperty("toString")&&!g.hasOwnProperty("toString")){g.toString=i.toString}return g};OpenLayers.Util.getParameterString=function(l){var m=[];for(var r in l){var o=l[r];if((o!=null)&&(typeof o!="function")){var j;if(typeof o=="object"&&o.constructor==Array){var n=[];for(var q=0,k=o.length;q<k;q++){n.push(encodeURIComponent(o[q]))}j=n.join(",")}else{j=encodeURIComponent(o)}m.push(encodeURIComponent(r)+"="+j)}}return m.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var j=null;for(var k=0,g=arguments.length;k<g;k++){var e=arguments[k];try{j=e();break}catch(i){}}return j};OpenLayers.Util.getNodes=function(f,d){var e=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(f.documentElement.childNodes,d)},function(){return OpenLayers.Util._getNodes(f.childNodes,d)});return e};OpenLayers.Util._getNodes=function(k,i){var f=[];for(var j=0,g=k.length;j<g;j++){if(k[j].nodeName==i){f.push(k[j])}}return f};OpenLayers.Util.getTagText=function(i,g,e){var f=OpenLayers.Util.getNodes(i,g);if(f&&(f.length>0)){if(!e){e=0}if(f[e].childNodes.length>1){return f.childNodes[1].nodeValue}else{if(f[e].childNodes.length==1){return f[e].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(d){var c=null;OpenLayers.Util.Try(function(){c=d.text;if(!c){c=d.textContent}if(!c){c=d.firstChild.nodeValue}},function(){c=d.textContent});return c};OpenLayers.Util.mouseLeft=function(e,f){var d=(e.relatedTarget)?e.relatedTarget:e.toElement;while(d!=f&&d!=null){d=d.parentNode}return(d!=f)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(c,d){if(d==null){d=OpenLayers.Util.DEFAULT_PRECISION}var c;if(d==0){c=parseFloat(c)}else{c=parseFloat(parseFloat(c).toPrecision(d))}return c};OpenLayers.Util.rad=function(b){return b*Math.PI/180};OpenLayers.Util.distVincenty=function(aq,at){var b=6378137,d=6356752.3142,C=1/298.257223563;var ak=OpenLayers.Util.rad(at.lon-aq.lon);var f=Math.atan((1-C)*Math.tan(OpenLayers.Util.rad(aq.lat)));var s=Math.atan((1-C)*Math.tan(OpenLayers.Util.rad(at.lat)));var al=Math.sin(f),ao=Math.cos(f);var am=Math.sin(s),ap=Math.cos(s);var af=ak,aj=2*Math.PI;var ah=20;while(Math.abs(af-aj)>1e-12&&--ah>0){var ad=Math.sin(af),ar=Math.cos(af);var a=Math.sqrt((ap*ad)*(ap*ad)+(ao*am-al*ap*ar)*(ao*am-al*ap*ar));if(a==0){return 0}var W=al*am+ao*ap*ar;var ae=Math.atan2(a,W);var an=Math.asin(ao*ap*ad/a);var U=Math.cos(an)*Math.cos(an);var ai=W-2*al*am/U;var V=C/16*U*(4+C*(4-3*U));aj=af;af=ak+(1-V)*C*Math.sin(an)*(ae+V*a*(ai+V*W*(-1+2*ai*ai)))}if(ah==0){return NaN}var ab=U*(b*b-d*d)/(d*d);var ag=1+ab/16384*(4096+ab*(-768+ab*(320-175*ab)));var B=ab/1024*(256+ab*(-128+ab*(74-47*ab)));var aa=B*a*(ai+B/4*(W*(-1+2*ai*ai)-B/6*ai*(-3+4*a*a)*(-3+4*ai*ai)));var ac=d*ag*(ae-aa);var A=ac.toFixed(3)/1000;return A};OpenLayers.Util.getParameters=function(C){C=C||window.location.href;var D="";if(OpenLayers.String.contains(C,"?")){var B=C.indexOf("?")+1;var z=OpenLayers.String.contains(C,"#")?C.indexOf("#"):C.length;D=C.substring(B,z)}var i={};var A=D.split(/[&;]/);for(var u=0,t=A.length;u<t;++u){var v=A[u].split("=");if(v[0]){var r=decodeURIComponent(v[0]);var s=v[1]||"";s=s.split(",");for(var w=0,j=s.length;w<j;w++){s[w]=decodeURIComponent(s[w])}if(s.length==1){s=s[0]}i[r]=s}}return i};OpenLayers.Util.getArgs=function(b){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(b)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(b){if(b==null){b="id_"}OpenLayers.Util.lastSeqID+=1;return b+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.METERS_PER_INCH=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(c){var d=(c>1)?(1/c):c;return d};OpenLayers.Util.getResolutionFromScale=function(g,f){if(f==null){f="degrees"}var i=OpenLayers.Util.normalizeScale(g);var e=1/(i*OpenLayers.INCHES_PER_UNIT[f]*OpenLayers.DOTS_PER_INCH);return e};OpenLayers.Util.getScaleFromResolution=function(d,e){if(e==null){e="degrees"}var f=d*OpenLayers.INCHES_PER_UNIT[e]*OpenLayers.DOTS_PER_INCH;return f};OpenLayers.Util.safeStopPropagation=function(b){OpenLayers.Event.stop(b,true)};OpenLayers.Util.pagePosition=function(k){var i=0,l=0;var e=k;var j=k;while(e){if(e==document.body){if(OpenLayers.Element.getStyle(j,"position")=="absolute"){break}}i+=e.offsetTop||0;l+=e.offsetLeft||0;j=e;try{e=e.offsetParent}catch(m){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:e.id}));break}}e=k;while(e){i-=e.scrollTop||0;l-=e.scrollLeft||0;e=e.parentNode}return[l,i]};OpenLayers.Util.isEquivalentUrl=function(j,k,m){m=m||{};OpenLayers.Util.applyDefaults(m,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var g=OpenLayers.Util.createUrlObject(j,m);var i=OpenLayers.Util.createUrlObject(k,m);for(var l in g){if(l!=="args"){if(g[l]!=i[l]){return false}}}for(var l in g.args){if(g.args[l]!=i.args[l]){return false}delete i.args[l]}for(var l in i.args){return false}return true};OpenLayers.Util.createUrlObject=function(u,a){a=a||{};if(!(/^\w+:\/\//).test(u)){var q=window.location;var s=q.port?":"+q.port:"";var o=q.protocol+"//"+q.host.split(":").shift()+s;if(u.indexOf("/")===0){u=o+u}else{var r=q.pathname.split("/");r.pop();u=o+r.join("/")+"/"+u}}if(a.ignoreCase){u=u.toLowerCase()}var n=document.createElement("a");n.href=u;var t={};t.host=n.host.split(":").shift();t.protocol=n.protocol;if(a.ignorePort80){t.port=(n.port=="80"||n.port=="0")?"":n.port}else{t.port=(n.port==""||n.port=="0")?"80":n.port}t.hash=(a.ignoreHash||n.hash==="#")?"":n.hash;var v=n.search;if(!v){var m=u.indexOf("?");v=(m!=-1)?u.substr(m):""}t.args=OpenLayers.Util.getParameters(v);t.pathname=(n.pathname.charAt(0)=="/")?n.pathname:"/"+n.pathname;return t};OpenLayers.Util.removeTail=function(e){var i=null;var f=e.indexOf("?");var g=e.indexOf("#");if(f==-1){i=(g!=-1)?e.substr(0,g):e}else{i=(g!=-1)?e.substr(0,Math.min(f,g)):e.substr(0,f)}return i};OpenLayers.Util.getBrowserName=function(){var c="";var d=navigator.userAgent.toLowerCase();if(d.indexOf("opera")!=-1){c="opera"}else{if(d.indexOf("msie")!=-1){c="msie"}else{if(d.indexOf("safari")!=-1){c="safari"}else{if(d.indexOf("mozilla")!=-1){if(d.indexOf("firefox")!=-1){c="firefox"}else{c="mozilla"}}}}}return c};OpenLayers.Util.getRenderedDimensions=function(C,l,i){var t,z;var D=document.createElement("div");D.style.visibility="hidden";var r=(i&&i.containerElement)?i.containerElement:document.body;if(l){if(l.w){t=l.w;D.style.width=t+"px"}else{if(l.h){z=l.h;D.style.height=z+"px"}}}if(i&&i.displayClass){D.className=i.displayClass}var w=document.createElement("div");w.innerHTML=C;w.style.overflow="visible";if(w.childNodes){for(var A=0,B=w.childNodes.length;A<B;A++){if(!w.childNodes[A].style){continue}w.childNodes[A].style.overflow="visible"}}D.appendChild(w);r.appendChild(D);var s=false;var u=D.parentNode;while(u&&u.tagName.toLowerCase()!="body"){var v=OpenLayers.Element.getStyle(u,"position");if(v=="absolute"){s=true;break}else{if(v&&v!="static"){break}}u=u.parentNode}if(!s){D.style.position="absolute"}if(!t){t=parseInt(w.scrollWidth);D.style.width=t+"px"}if(!z){z=parseInt(w.scrollHeight)}D.removeChild(w);r.removeChild(D);return new OpenLayers.Size(t,z)};OpenLayers.Util.getScrollbarWidth=function(){var k=OpenLayers.Util._scrollbarWidth;if(k==null){var i=null;var j=null;var g=0;var f=0;i=document.createElement("div");i.style.position="absolute";i.style.top="-1000px";i.style.left="-1000px";i.style.width="100px";i.style.height="50px";i.style.overflow="hidden";j=document.createElement("div");j.style.width="100%";j.style.height="200px";i.appendChild(j);document.body.appendChild(i);g=j.offsetWidth;i.style.overflow="scroll";f=j.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(g-f);k=OpenLayers.Util._scrollbarWidth}return k};OpenLayers.Element={visible:function(b){return OpenLayers.Util.getElement(b).style.display!="none"},toggle:function(){for(var i=0,f=arguments.length;i<f;i++){var e=OpenLayers.Util.getElement(arguments[i]);var g=OpenLayers.Element.visible(e)?"hide":"show";OpenLayers.Element[g](e)}},hide:function(){for(var f=0,e=arguments.length;f<e;f++){var d=OpenLayers.Util.getElement(arguments[f]);d.style.display="none"}},show:function(){for(var f=0,e=arguments.length;f<e;f++){var d=OpenLayers.Util.getElement(arguments[f]);d.style.display=""}},remove:function(b){b=OpenLayers.Util.getElement(b);b.parentNode.removeChild(b)},getHeight:function(b){b=OpenLayers.Util.getElement(b);return b.offsetHeight},getDimensions:function(g){g=OpenLayers.Util.getElement(g);if(OpenLayers.Element.getStyle(g,"display")!="none"){return{width:g.offsetWidth,height:g.offsetHeight}}var i=g.style;var k=i.visibility;var m=i.position;i.visibility="hidden";i.position="absolute";i.display="";var j=g.clientWidth;var l=g.clientHeight;i.display="none";i.position=m;i.visibility=k;return{width:j,height:l}},hasClass:function(d,e){var f=d.className;return(!!f&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(f))},addClass:function(c,d){if(!OpenLayers.Element.hasClass(c,d)){c.className+=(c.className?" ":"")+d}return c},removeClass:function(d,e){var f=d.className;if(f){d.className=OpenLayers.String.trim(f.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," "))}return d},toggleClass:function(c,d){if(OpenLayers.Element.hasClass(c,d)){OpenLayers.Element.removeClass(c,d)}else{OpenLayers.Element.addClass(c,d)}return c},getStyle:function(k,j){k=OpenLayers.Util.getElement(k);var i=null;if(k&&k.style){i=k.style[OpenLayers.String.camelize(j)];if(!i){if(document.defaultView&&document.defaultView.getComputedStyle){var f=document.defaultView.getComputedStyle(k,null);i=f?f.getPropertyValue(j):null}else{if(k.currentStyle){i=k.currentStyle[OpenLayers.String.camelize(j)]}}}var g=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(g,j)!=-1)&&(OpenLayers.Element.getStyle(k,"position")=="static")){i="auto"}}return i=="auto"?null:i}};OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(d,c){this.w=parseFloat(d);this.h=parseFloat(c)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(c){var d=false;if(c!=null){d=((this.w==c.w&&this.h==c.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(c.w)&&isNaN(c.h)))}return d},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(b){alert(b)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){var d=document.getElementsByTagName("script");for(var f=0,e=d.length;f<e;++f){if(d[f].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}}})();OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(g,f,j,k){this.url=g;this.size=(f)?f:new OpenLayers.Size(20,20);this.offset=j?j:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=k;var i=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(i)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(b){if(b!=null){this.size=b}this.draw()},setUrl:function(b){if(b!=null){this.url=b}this.draw()},draw:function(b){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(b);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(b){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,b)},moveTo:function(d){if(d!=null){this.px=d}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var c=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,c)}}},display:function(b){this.imageDiv.style.display=(b)?"":"none"},isDrawn:function(){var b=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return b},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",closeDivPadd:true,lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:false,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,keepInMap:false,closeOnMove:false,map:null,initialize:function(k,o,l,i,m,n){if(k==null){k=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=k;this.lonlat=o;this.contentSize=(l!=null)?l:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(i!=null){this.contentHTML=i}this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;var j=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(j,null,null,null,"relative",null,"hidden");var k=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(k,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(m){this.addCloseBox(n)}this.registerEvents()},destroy:function(){this.id=null;this.lonlat=null;this.size=null;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null;if(this.closeOnMove&&this.map){this.map.events.unregister("movestart",this,this.hide)}this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv)}this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this)}this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;this.padding=null;this.panMapIfOutOfView=null},draw:function(b){if(b==null){if((this.lonlat!=null)&&(this.map!=null)){b=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(!this.disableFirefoxOverflowHack&&OpenLayers.Util.getBrowserName()=="firefox"){this.map.events.register("movestart",this,function(){var a=document.defaultView.getComputedStyle(this.contentDiv,null);var d=a.getPropertyValue("overflow");if(d!="hidden"){this.contentDiv._oldOverflow=d;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var a=this.contentDiv._oldOverflow;if(a){this.contentDiv.style.overflow=a;this.contentDiv._oldOverflow=null}})}this.moveTo(b);if(!this.autoSize&&!this.size){this.setSize(this.contentSize)}this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView()}return this.div},updatePosition:function(){if((this.lonlat)&&(this.map)){var b=this.map.getLayerPxFromLonLat(this.lonlat);if(b){this.moveTo(b)}}},moveTo:function(b){if((b!=null)&&(this.div!=null)){this.div.style.left=b.x+"px";this.div.style.top=b.y+"px"}},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){if(this.visible()){this.hide()}else{this.show()}},show:function(){OpenLayers.Element.show(this.div);if(this.panMapIfOutOfView){this.panIntoView()}},hide:function(){OpenLayers.Element.hide(this.div)},setSize:function(k){this.size=k.clone();var f=this.getContentDivPadding();var g=f.left+f.right;var i=f.top+f.bottom;this.fixPadding();g+=this.padding.left+this.padding.right;i+=this.padding.top+this.padding.bottom;if(this.closeDiv&&this.closeDivPadd){var j=parseInt(this.closeDiv.style.width);g+=j+f.right}this.size.w+=g;this.size.h+=i;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=f.left+f.right;this.contentSize.h+=f.bottom+f.top}if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}if(this.contentDiv!=null){this.contentDiv.style.width=k.w+"px";this.contentDiv.style.height=k.h+"px"}},updateSize:function(){var o="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var l=(this.map)?this.map.layerContainerDiv:document.body;var k=OpenLayers.Util.getRenderedDimensions(o,null,{displayClass:this.displayClass,containerElement:l});var m=this.getSafeContentSize(k);var n=null;if(m.equals(k)){n=k}else{var s=new OpenLayers.Size();s.w=(m.w<k.w)?m.w:null;s.h=(m.h<k.h)?m.h:null;if(s.w&&s.h){n=m}else{var q=OpenLayers.Util.getRenderedDimensions(o,s,{displayClass:this.contentDisplayClass,containerElement:l});var r=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((r!="hidden")&&(q.equals(m))){var t=OpenLayers.Util.getScrollbarWidth();if(s.w){q.h+=t}else{q.w+=t}}n=this.getSafeContentSize(q)}}this.setSize(n)},setBackgroundColor:function(b){if(b!=undefined){this.backgroundColor=b}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(b){if(b!=undefined){this.opacity=b}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(b){if(b!=undefined){this.border=b}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(b){if(b!=null){this.contentHTML=b}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var j=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var g=this.contentDiv.getElementsByTagName("img");for(var k=0,i=g.length;k<i;k++){var m=g[k];if(m.width==0||m.height==0){var l={popup:this,img:m};m._onImgLoad=OpenLayers.Function.bind(j,l);OpenLayers.Event.observe(m,"load",m._onImgLoad)}}},getSafeContentSize:function(m){var u=m.clone();var o=this.getContentDivPadding();var n=o.left+o.right;var r=o.top+o.bottom;this.fixPadding();n+=this.padding.left+this.padding.right;r+=this.padding.top+this.padding.bottom;if(this.closeDiv){var v=parseInt(this.closeDiv.style.width);n+=v+o.right}if(this.minSize){u.w=Math.max(u.w,(this.minSize.w-n));u.h=Math.max(u.h,(this.minSize.h-r))}if(this.maxSize){u.w=Math.min(u.w,(this.maxSize.w-n));u.h=Math.min(u.h,(this.maxSize.h-r))}if(this.map&&this.map.size){var s=0,t=0;if(this.keepInMap&&!this.panMapIfOutOfView){var q=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":s=q.x;t=this.map.size.h-q.y;break;case"tl":s=this.map.size.w-q.x;t=this.map.size.h-q.y;break;case"bl":s=this.map.size.w-q.x;t=q.y;break;case"br":s=q.x;t=q.y;break;default:s=q.x;t=this.map.size.h-q.y;break}}var z=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-r-t;var w=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-n-s;u.w=Math.min(u.w,w);u.h=Math.min(u.h,z)}return u},getContentDivPadding:function(){var b=this._contentDivPadding;if(!b){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}b=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));this._contentDivPadding=b;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return b},addCloseBox:function(f){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var d=this.getContentDivPadding();this.closeDiv.style.right=d.right+"px";this.closeDiv.style.top=d.top+"px";this.groupDiv.appendChild(this.closeDiv);var e=f||function(a){this.hide();OpenLayers.Event.stop(a)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(e,this))},panIntoView:function(){var i=this.map.getSize();var j=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var k=j.clone();if(j.x<this.map.paddingForPopups.left){k.x=this.map.paddingForPopups.left}else{if((j.x+this.size.w)>(i.w-this.map.paddingForPopups.right)){k.x=i.w-this.map.paddingForPopups.right-this.size.w}}if(j.y<this.map.paddingForPopups.top){k.y=this.map.paddingForPopups.top}else{if((j.y+this.size.h)>(i.h-this.map.paddingForPopups.bottom)){k.y=i.h-this.map.paddingForPopups.bottom-this.size.h}}var f=j.x-k.x;var g=j.y-k.y;this.map.pan(f,g)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})},onmousedown:function(b){this.mousedown=true;OpenLayers.Event.stop(b,true)},onmousemove:function(b){if(this.mousedown){OpenLayers.Event.stop(b,true)}},onmouseup:function(b){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(b,true)}},onclick:function(b){OpenLayers.Event.stop(b,true)},onmouseout:function(b){this.mousedown=false},ondblclick:function(b){OpenLayers.Event.stop(b,true)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,initialize:function(b){b=b||{};OpenLayers.Util.extend(this,b);this.options=b},destroy:function(){this.options=null;this.format=null},read:function(){},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(b){},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(b){OpenLayers.Util.extend(this,b)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(d,c){this.container=OpenLayers.Util.getElement(d)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(d,c){this.extent=d.clone();if(c){this.resolution=null}},setSize:function(b){this.size=b.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(m,l){if(l==null){l=m.style}if(m.geometry){var k=m.geometry.getBounds();if(k){if(!k.intersectsBounds(this.extent)){l={display:"none"}}var j=this.drawGeometry(m.geometry,l,m.id);if(l.display!="none"&&l.label&&j!==false){this.drawText(m.id,l,m.geometry.getCentroid());var i=m.geometry.getCentroid();if(l.labelXOffset||l.labelYOffset){xOffset=isNaN(l.labelXOffset)?0:l.labelXOffset;yOffset=isNaN(l.labelYOffset)?0:l.labelYOffset;var g=this.getResolution();i.move(xOffset*g,yOffset*g)}this.drawText(m.id,l,i)}else{this.removeText(m.id)}return j}}},drawGeometry:function(f,e,d){},drawText:function(f,d,e){},removeText:function(b){},clear:function(){},getFeatureIdFromEvent:function(b){},eraseFeatures:function(f){if(!(f instanceof Array)){f=[f]}for(var d=0,e=f.length;d<e;++d){this.eraseGeometry(f[d].geometry);this.removeText(f[d].id)}},eraseGeometry:function(b){},moveRoot:function(b){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(b){OpenLayers.Util.extend(this,b);this.options=b;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(b){this.layer=b},activate:function(){if(!this.active){this.active=true;return true}return false},deactivate:function(){if(this.active){this.active=false;return true}return false},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(g,f,e,i){if(g!=null){this.left=OpenLayers.Util.toFloat(g)}if(f!=null){this.bottom=OpenLayers.Util.toFloat(f)}if(e!=null){this.right=OpenLayers.Util.toFloat(e)}if(i!=null){this.top=OpenLayers.Util.toFloat(i)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(c){var d=false;if(c!=null){d=((this.left==c.left)&&(this.right==c.right)&&(this.top==c.top)&&(this.bottom==c.bottom))}return d},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")},toArray:function(){return[this.left,this.bottom,this.right,this.top]},toBBOX:function(e){if(e==null){e=6}var d=Math.pow(10,e);var f=Math.round(this.left*d)/d+","+Math.round(this.bottom*d)/d+","+Math.round(this.right*d)/d+","+Math.round(this.top*d)/d;return f},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return(this.right-this.left)},getHeight:function(){return(this.top-this.bottom)},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat){this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)}return this.centerLonLat},scale:function(n,l){if(l==null){l=this.getCenterLonLat()}var t=[];var o,q;if(l.CLASS_NAME=="OpenLayers.LonLat"){o=l.lon;q=l.lat}else{o=l.x;q=l.y}var r=(this.left-o)*n+o;var s=(this.bottom-q)*n+q;var k=(this.right-o)*n+o;var m=(this.top-q)*n+q;return new OpenLayers.Bounds(r,s,k,m)},add:function(e,f){if((e==null)||(f==null)){var d=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(d);return null}return new OpenLayers.Bounds(this.left+e,this.bottom+f,this.right+e,this.top+f)},extend:function(d){var c=null;if(d){switch(d.CLASS_NAME){case"OpenLayers.LonLat":c=new OpenLayers.Bounds(d.lon,d.lat,d.lon,d.lat);break;case"OpenLayers.Geometry.Point":c=new OpenLayers.Bounds(d.x,d.y,d.x,d.y);break;case"OpenLayers.Bounds":c=d;break}if(c){this.centerLonLat=null;if((this.left==null)||(c.left<this.left)){this.left=c.left}if((this.bottom==null)||(c.bottom<this.bottom)){this.bottom=c.bottom}if((this.right==null)||(c.right>this.right)){this.right=c.right}if((this.top==null)||(c.top>this.top)){this.top=c.top}}}},containsLonLat:function(c,d){return this.contains(c.lon,c.lat,d)},containsPixel:function(c,d){return this.contains(c.x,c.y,d)},contains:function(e,g,f){if(f==null){f=true}if(e==null||g==null){return false}e=OpenLayers.Util.toFloat(e);g=OpenLayers.Util.toFloat(g);var i=false;if(f){i=((e>=this.left)&&(e<=this.right)&&(g>=this.bottom)&&(g<=this.top))}else{i=((e>this.left)&&(e<this.right)&&(g>this.bottom)&&(g<this.top))}return i},intersectsBounds:function(o,j){if(j==null){j=true}var q=false;var l=(this.left==o.right||this.right==o.left||this.top==o.bottom||this.bottom==o.top);if(j||!l){var m=(((o.bottom>=this.bottom)&&(o.bottom<=this.top))||((this.bottom>=o.bottom)&&(this.bottom<=o.top)));var n=(((o.top>=this.bottom)&&(o.top<=this.top))||((this.top>o.bottom)&&(this.top<o.top)));var r=(((o.left>=this.left)&&(o.left<=this.right))||((this.left>=o.left)&&(this.left<=o.right)));var k=(((o.right>=this.left)&&(o.right<=this.right))||((this.right>=o.left)&&(this.right<=o.right)));q=((m||n)&&(r||k))}return q},containsBounds:function(k,i,j){if(i==null){i=false}if(j==null){j=true}var o=this.contains(k.left,k.bottom,j);var n=this.contains(k.right,k.bottom,j);var l=this.contains(k.left,k.top,j);var m=this.contains(k.right,k.top,j);return(i)?(o||n||l||m):(o&&n&&l&&m)},determineQuadrant:function(f){var d="";var e=this.getCenterLonLat();d+=(f.lat<e.lat)?"b":"t";d+=(f.lon<e.lon)?"l":"r";return d},transform:function(l,g){this.centerLonLat=null;var k=OpenLayers.Projection.transform({x:this.left,y:this.bottom},l,g);var i=OpenLayers.Projection.transform({x:this.right,y:this.bottom},l,g);var m=OpenLayers.Projection.transform({x:this.left,y:this.top},l,g);var j=OpenLayers.Projection.transform({x:this.right,y:this.top},l,g);this.left=Math.min(k.x,m.x);this.bottom=Math.min(k.y,i.y);this.right=Math.max(i.x,j.x);this.top=Math.max(m.y,j.y);return this},wrapDateLine:function(g,k){k=k||{};var j=k.leftTolerance||0;var f=k.rightTolerance||0;var i=this.clone();if(g){while(i.left<g.left&&(i.right-f)<=g.left){i=i.add(g.getWidth(),0)}while((i.left+j)>=g.right&&i.right>g.right){i=i.add(-g.getWidth(),0)}}return i},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(c){var d=c.split(",");return OpenLayers.Bounds.fromArray(d)};OpenLayers.Bounds.fromArray=function(b){return new OpenLayers.Bounds(parseFloat(b[0]),parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3]))};OpenLayers.Bounds.fromSize=function(b){return new OpenLayers.Bounds(0,b.h,b.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(d){var c="";c+=(d.charAt(0)=="t")?"b":"t";c+=(d.charAt(1)=="l")?"r":"l";return c};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(c,d){this.lon=OpenLayers.Util.toFloat(c);this.lat=OpenLayers.Util.toFloat(d)},toString:function(){return("lon="+this.lon+",lat="+this.lat)},toShortString:function(){return(this.lon+", "+this.lat)},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(f,e){if((f==null)||(e==null)){var d=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(d);return null}return new OpenLayers.LonLat(this.lon+f,this.lat+e)},equals:function(c){var d=false;if(c!=null){d=((this.lon==c.lon&&this.lat==c.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(c.lon)&&isNaN(c.lat)))}return d},transform:function(f,d){var e=OpenLayers.Projection.transform({x:this.lon,y:this.lat},f,d);this.lon=e.x;this.lat=e.y;return this},wrapDateLine:function(d){var c=this.clone();if(d){while(c.lon<d.left){c.lon+=d.getWidth()}while(c.lon>d.right){c.lon-=d.getWidth()}}return c},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(c){var d=c.split(",");return new OpenLayers.LonLat(parseFloat(d[0]),parseFloat(d[1]))};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(d,c){this.x=parseFloat(d);this.y=parseFloat(c)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(d){var c=false;if(d!=null){c=((this.x==d.x&&this.y==d.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(d.x)&&isNaN(d.y)))}return c},add:function(e,f){if((e==null)||(f==null)){var d=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(d);return null}return new OpenLayers.Pixel(this.x+e,this.y+f)},offset:function(d){var c=this.clone();if(d){c=this.add(d.x,d.y)}return c},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(b){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,b);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.handlers){for(var b in this.handlers){if(this.handlers.hasOwnProperty(b)&&typeof this.handlers[b].destroy=="function"){this.handlers[b].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(b){this.map=b;if(this.handler){this.handler.setMap(b)}},draw:function(b){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false)}}if(this.title!=""){this.div.title=this.title}}if(b!=null){this.position=b.clone()}this.moveTo(this.position);return this.div},moveTo:function(b){if((b!=null)&&(this.div!=null)){this.div.style.left=b.x+"px";this.div.style.top=b.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;if(this.map){OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;if(this.map){OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("deactivate");return true}return false},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(e){var g;if(!e){e=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var i=e.split("-");i[0]=i[0].toLowerCase();if(typeof OpenLayers.Lang[i[0]]=="object"){g=i[0]}if(i[1]){var f=i[0]+"-"+i[1].toUpperCase();if(typeof OpenLayers.Lang[f]=="object"){g=f}}if(!g){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+i.join("-")+" dictionary, falling back to default language");g=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=g},translate:function(e,f){var g=OpenLayers.Lang[OpenLayers.Lang.getCode()];var i=g[e];if(!i){i=e}if(f){i=OpenLayers.String.format(i,f)}return i}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(l,q,m,r,j,n,o){var k=[l,q,m,r,n,o];OpenLayers.Popup.prototype.initialize.apply(this,k);this.anchor=(j!=null)?j:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null;this.relativePosition=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(i){var e=this.relativePosition;this.relativePosition=this.calculateRelativePosition(i);var g=this.calculateNewPx(i);var f=new Array(g);OpenLayers.Popup.prototype.moveTo.apply(this,f);if(this.relativePosition!=e){this.updateRelativePosition()}},setSize:function(c){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var d=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(d)}},calculateRelativePosition:function(e){var g=this.map.getLonLatFromLayerPx(e);var i=this.map.getExtent();var f=i.determineQuadrant(g);return OpenLayers.Bounds.oppositeQuadrant(f)},updateRelativePosition:function(){},calculateNewPx:function(f){var i=f.offset(this.anchor.offset);var g=this.size||this.contentSize;var j=(this.relativePosition.charAt(0)=="t");i.y+=(j)?-g.h:this.anchor.size.h;var k=(this.relativePosition.charAt(1)=="l");i.x+=(k)?-g.w:this.anchor.size.w;return i},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,geometryMap:null,initialize:function(b){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);this.canvas=this.root.getContext("2d");this.features={};this.geometryMap={}},eraseGeometry:function(b){this.eraseFeatures(this.features[this.geometryMap[b.id]][0])},supported:function(){var b=document.createElement("canvas");return !!b.getContext},setExtent:function(b){this.extent=b.clone();this.resolution=null;this.redraw()},setSize:function(b){this.size=b.clone();this.root.style.width=b.w+"px";this.root.style.height=b.h+"px";this.root.width=b.w;this.root.height=b.h;this.resolution=null},drawFeature:function(d,c){if(c==null){c=d.style}c=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},c);this.features[d.id]=[d,c];if(d.geometry){this.geometryMap[d.geometry.id]=d.id}this.redraw()},drawGeometry:function(g,i){var e=g.CLASS_NAME;if((e=="OpenLayers.Geometry.Collection")||(e=="OpenLayers.Geometry.MultiPoint")||(e=="OpenLayers.Geometry.MultiLineString")||(e=="OpenLayers.Geometry.MultiPolygon")){for(var f=0;f<g.components.length;f++){this.drawGeometry(g.components[f],i)}return}switch(g.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(g,i);break;case"OpenLayers.Geometry.LineString":this.drawLineString(g,i);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(g,i);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(g,i);break;default:break}},drawExternalGraphic:function(k,t){var o=new Image();o.src=t.externalGraphic;if(t.graphicTitle){o.title=t.graphicTitle}var r=t.graphicWidth||t.graphicHeight;var l=t.graphicHeight||t.graphicWidth;r=r?r:t.pointRadius*2;l=l?l:t.pointRadius*2;var m=(t.graphicXOffset!=undefined)?t.graphicXOffset:-(0.5*r);var q=(t.graphicYOffset!=undefined)?t.graphicYOffset:-(0.5*l);var n=t.graphicOpacity||t.fillOpacity;var s={img:o,x:(k[0]+m),y:(k[1]+q),width:r,height:l,canvas:this.canvas};o.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},s)},setCanvasStyle:function(c,d){if(c=="fill"){this.canvas.globalAlpha=d.fillOpacity;this.canvas.fillStyle=d.fillColor}else{if(c=="stroke"){this.canvas.globalAlpha=d.strokeOpacity;this.canvas.strokeStyle=d.strokeColor;this.canvas.lineWidth=d.strokeWidth}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}}},drawPoint:function(f,e){if(e.graphic!==false){var d=this.getLocalXY(f);if(e.externalGraphic){this.drawExternalGraphic(d,e)}else{if(e.fill!==false){this.setCanvasStyle("fill",e);this.canvas.beginPath();this.canvas.arc(d[0],d[1],6,0,Math.PI*2,true);this.canvas.fill()}if(e.stroke!==false){this.setCanvasStyle("stroke",e);this.canvas.beginPath();this.canvas.arc(d[0],d[1],6,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(j,f){if(f.stroke!==false){this.setCanvasStyle("stroke",f);this.canvas.beginPath();var i=this.getLocalXY(j.components[0]);this.canvas.moveTo(i[0],i[1]);for(var g=1;g<j.components.length;g++){var k=this.getLocalXY(j.components[g]);this.canvas.lineTo(k[0],k[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(k,m){if(m.fill!==false){this.setCanvasStyle("fill",m);this.canvas.beginPath();var j=this.getLocalXY(k.components[0]);this.canvas.moveTo(j[0],j[1]);for(var g=1;g<k.components.length-1;g++){var l=this.getLocalXY(k.components[g]);this.canvas.lineTo(l[0],l[1])}this.canvas.fill()}if(m.stroke!==false){var i=this.canvas.lineWidth;this.setCanvasStyle("stroke",m);this.canvas.beginPath();var j=this.getLocalXY(k.components[0]);this.canvas.moveTo(j[0],j[1]);for(var g=1;g<k.components.length;g++){var l=this.getLocalXY(k.components[g]);this.canvas.lineTo(l[0],l[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawPolygon:function(f,d){this.drawLinearRing(f.components[0],d);for(var e=1;e<f.components.length;e++){this.drawLinearRing(f.components[e],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(g,l){l=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},l);var k=this.getLocalXY(g);this.setCanvasStyle("reset");this.canvas.fillStyle=l.fontColor;this.canvas.globalAlpha=1;var j=l.fontWeight+" "+l.fontSize+" "+l.fontFamily;if(this.canvas.fillText){var m=OpenLayers.Renderer.Canvas.LABEL_ALIGN[l.labelAlign[0]]||"middle";this.canvas.font=j;this.canvas.textAlign=m;this.canvas.fillText(l.label,k[0],k[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=j;var i=this.canvas.mozMeasureText(l.label);switch(l.labelAlign[0]){case"l":break;case"r":k[0]-=i;break;case"c":default:k[0]-=i/2}this.canvas.translate(k[0],k[1]);this.canvas.mozDrawText(l.label);this.canvas.translate(-1*k[0],-1*k[1])}}this.setCanvasStyle("reset")},getLocalXY:function(f){var k=this.getResolution();var j=this.extent;var g=(f.x/k+(-j.left/k));var i=((j.top/k)-f.y/k);return[g,i]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(i){var j=this.map.getLonLatFromPixel(i.xy);var g=this.getResolution();var k=new OpenLayers.Bounds(j.lon-g*5,j.lat-g*5,j.lon+g*5,j.lat+g*5);var m=k.toGeometry();for(var l in this.features){if(!this.features.hasOwnProperty(l)){continue}if(this.features[l][0].geometry.intersects(m)){return l}}return null},eraseFeatures:function(c){if(!(c instanceof Array)){c=[c]}for(var d=0;d<c.length;++d){delete this.features[c[d].id]}this.redraw()},redraw:function(){if(!this.locked){this.clear();var k=[];var g,m;for(var j in this.features){if(!this.features.hasOwnProperty(j)){continue}g=this.features[j][0];m=this.features[j][1];if(!g.geometry){continue}this.drawGeometry(g.geometry,m);if(m.label){k.push([g,m])}}var l;for(var i=0;len=k.length,i<len;++i){l=k[i];this.drawText(l[0].geometry.getCentroid(),l[1])}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right"};OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(b){this.compare=b?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(m){if(this.exists(m)){this.remove(m)}var j=m.id;this.determineZIndex(m);var l=-1;var k=this.order.length;var i;while(k-l>1){i=parseInt((l+k)/2);var g=this.compare(this,m,OpenLayers.Util.getElement(this.order[i]));if(g>0){l=i}else{k=i}}this.order.splice(k,0,j);this.indices[j]=this.getZIndex(m);return this.getNextElement(k)},remove:function(e){var g=e.id;var f=OpenLayers.Util.indexOf(this.order,g);if(f>=0){this.order.splice(f,1);delete this.indices[g];if(this.order.length>0){var i=this.order[this.order.length-1];this.maxZIndex=this.indices[i]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(b){return(this.indices[b.id]!=null)},getZIndex:function(b){return b._style.graphicZIndex},determineZIndex:function(d){var c=d._style.graphicZIndex;if(c==null){c=this.maxZIndex;d._style.graphicZIndex=c}else{if(c>this.maxZIndex){this.maxZIndex=c}}},getNextElement:function(d){var e=d+1;if(e<this.order.length){var f=OpenLayers.Util.getElement(this.order[e]);if(f==undefined){f=this.getNextElement(e)}return f}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(k,l,g){var i=k.getZIndex(l);var j=0;if(g){var m=k.getZIndex(g);j=i-m}return j},Z_ORDER_DRAWING_ORDER:function(i,e,f){var g=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(i,e,f);if(f&&g==0){g=1}return g},Z_ORDER_Y_ORDER:function(l,m,i){var k=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(l,m,i);if(i&&k==0){var o=m._geometry.getBounds().bottom;var n=i._geometry.getBounds().bottom;var j=n-o;k=(j==0)?1:j}return k}};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(d,c){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot);this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);if(c&&(c.zIndexing||c.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(c.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){if(this.vectorRoot){while(this.vectorRoot.childNodes.length>0){this.vectorRoot.removeChild(this.vectorRoot.firstChild)}}if(this.textRoot){while(this.textRoot.childNodes.length>0){this.textRoot.removeChild(this.textRoot.firstChild)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(c,d){},drawGeometry:function(m,q,n){var r=m.CLASS_NAME;var l=true;if((r=="OpenLayers.Geometry.Collection")||(r=="OpenLayers.Geometry.MultiPoint")||(r=="OpenLayers.Geometry.MultiLineString")||(r=="OpenLayers.Geometry.MultiPolygon")){for(var i=0,k=m.components.length;i<k;i++){l=this.drawGeometry(m.components[i],q,n)&&l}return l}l=false;if(q.display!="none"){if(q.backgroundGraphic){this.redrawBackgroundNode(m.id,m,q,n)}l=this.redrawNode(m.id,m,q,n)}if(l==false){var o=document.getElementById(m.id);if(o){if(o._style.backgroundGraphic){o.parentNode.removeChild(document.getElementById(m.id+this.BACKGROUND_ID_SUFFIX))}o.parentNode.removeChild(o)}}return l},redrawNode:function(k,l,i,m){var o=this.nodeFactory(k,this.getNodeType(l,i));o._featureId=m;o._geometry=l;o._geometryClass=l.CLASS_NAME;o._style=i;var j=this.drawGeometryNode(o,l,i);if(j===false){return false}o=j.node;if(this.indexer){var n=this.indexer.insert(o);if(n){this.vectorRoot.insertBefore(o,n)}else{this.vectorRoot.appendChild(o)}}else{if(o.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(o)}}this.postDraw(o);return j.complete},redrawBackgroundNode:function(i,j,f,k){var g=OpenLayers.Util.extend({},f);g.externalGraphic=g.backgroundGraphic;g.graphicXOffset=g.backgroundXOffset;g.graphicYOffset=g.backgroundYOffset;g.graphicZIndex=g.backgroundGraphicZIndex;g.graphicWidth=g.backgroundWidth||g.graphicWidth;g.graphicHeight=g.backgroundHeight||g.graphicHeight;g.backgroundGraphic=null;g.backgroundXOffset=null;g.backgroundYOffset=null;g.backgroundGraphicZIndex=null;return this.redrawNode(i+this.BACKGROUND_ID_SUFFIX,j,g,null)},drawGeometryNode:function(k,i,f){f=f||k._style;OpenLayers.Util.applyDefaults(f,this.minimumSymbolizer);var g={isFilled:f.fill===undefined?true:f.fill,isStroked:f.stroke===undefined?!!f.strokeWidth:f.stroke};var j;switch(i.CLASS_NAME){case"OpenLayers.Geometry.Point":if(f.graphic===false){g.isFilled=false;g.isStroked=false}j=this.drawPoint(k,i);break;case"OpenLayers.Geometry.LineString":g.isFilled=false;j=this.drawLineString(k,i);break;case"OpenLayers.Geometry.LinearRing":j=this.drawLinearRing(k,i);break;case"OpenLayers.Geometry.Polygon":j=this.drawPolygon(k,i);break;case"OpenLayers.Geometry.Surface":j=this.drawSurface(k,i);break;case"OpenLayers.Geometry.Rectangle":j=this.drawRectangle(k,i);break;default:break}k._style=f;k._options=g;if(j!=false){return{node:this.setStyle(k,f,g,i),complete:j}}else{return false}},postDraw:function(b){},drawPoint:function(d,c){},drawLineString:function(d,c){},drawLinearRing:function(d,c){},drawPolygon:function(d,c){},drawRectangle:function(d,c){},drawCircle:function(d,c){},drawSurface:function(d,c){},removeText:function(c){var d=document.getElementById(c+this.LABEL_ID_SUFFIX);if(d){this.textRoot.removeChild(d)}},getFeatureIdFromEvent:function(g){var j=g.target;var f=j&&j.correspondingUseElement;var k=f?f:(j||g.srcElement);var i=k._featureId;return i},eraseGeometry:function(j){if((j.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(j.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(j.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(j.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var l=0,i=j.components.length;l<i;l++){this.eraseGeometry(j.components[l])}}else{var m=OpenLayers.Util.getElement(j.id);if(m&&m.parentNode){if(m.geometry){m.geometry.destroy();m.geometry=null}m.parentNode.removeChild(m);if(this.indexer){this.indexer.remove(m)}if(m._style.backgroundGraphic){var g=j.id+this.BACKGROUND_ID_SUFFIX;var k=OpenLayers.Util.getElement(g);if(k&&k.parentNode){k.parentNode.removeChild(k)}}}}},nodeFactory:function(f,e){var d=OpenLayers.Util.getElement(f);if(d){if(!this.nodeTypeCompare(d,e)){d.parentNode.removeChild(d);d=this.nodeFactory(f,e)}}else{d=this.createNode(e,f)}return d},nodeTypeCompare:function(c,d){},createNode:function(d,c){},moveRoot:function(c){var d=this.root;if(c.root.parentNode==this.rendererRoot){d=c.root}d.parentNode.removeChild(d);c.rendererRoot.appendChild(d)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(b){return(b!="circle")&&!!b},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(b){this.easing=(b)?b:OpenLayers.Easing.Expo.easeOut},start:function(i,e,g,f){this.playing=true;this.begin=i;this.finish=e;this.duration=g;this.callbacks=f.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null}if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin)}this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){if(!this.playing){return}if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)}window.clearInterval(this.interval);this.interval=null;this.playing=false},play:function(){var f={};for(var k in this.begin){var b=this.begin[k];var i=this.finish[k];if(b==null||i==null||isNaN(b)||isNaN(i)){OpenLayers.Console.error("invalid value for Tween")}var c=i-b;f[k]=this.easing.apply(this,[this.time,b,c,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,f)}if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playing=false}window.clearInterval(this.interval);this.interval=null}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(i,b,c,d){return c*i/d+b},easeOut:function(i,b,c,d){return c*i/d+b},easeInOut:function(i,b,c,d){return c*i/d+b},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(i,b,c,d){return(i==0)?b:c*Math.pow(2,10*(i/d-1))+b},easeOut:function(i,b,c,d){return(i==d)?b+c:c*(-Math.pow(2,-10*i/d)+1)+b},easeInOut:function(i,b,c,d){if(i==0){return b}if(i==d){return b+c}if((i/=d/2)<1){return c/2*Math.pow(2,10*(i-1))+b}return c/2*(-Math.pow(2,-10*--i)+2)+b},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(i,b,c,d){return c*(i/=d)*i+b},easeOut:function(i,b,c,d){return -c*(i/=d)*(i-2)+b},easeInOut:function(i,b,c,d){if((i/=d/2)<1){return c/2*i*i+b}return -c/2*((--i)*(i-2)-1)+b},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(b){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},draw:function(d){OpenLayers.Control.prototype.draw.apply(this,arguments);d=this.position;this.buttons=[];var f=new OpenLayers.Size(18,18);var e=new OpenLayers.Pixel(d.x+f.w/2,d.y);this._addButton("panup","north-mini.png",e,f);d.y=e.y+f.h;this._addButton("panleft","west-mini.png",d,f);this._addButton("panright","east-mini.png",d.add(f.w,0),f);this._addButton("pandown","south-mini.png",e.add(0,f.h*2),f);this._addButton("zoomin","zoom-plus-mini.png",e.add(0,f.h*3+5),f);this._addButton("zoomworld","zoom-world-mini.png",e.add(0,f.h*4+5),f);this._addButton("zoomout","zoom-minus-mini.png",e.add(0,f.h*5+5),f);return this.div},_addButton:function(t,q,k,m){var n=OpenLayers.Util.getImagesLocation()+q;var s=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+t,k,m,n,"absolute");this.div.appendChild(s);OpenLayers.Event.observe(s,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,s));OpenLayers.Event.observe(s,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,s));OpenLayers.Event.observe(s,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,s));s.action=t;s.map=this.map;if(!this.slideRatio){var r=this.slideFactor;var o=function(){return r}}else{var l=this.slideRatio;var o=function(a){return this.map.getSize()[a]*l}}s.getSlideFactor=o;this.buttons.push(s);return s},_removeButton:function(b){OpenLayers.Event.stopObservingElement(b);b.map=null;this.div.removeChild(b);OpenLayers.Util.removeItem(this.buttons,b)},removeButtons:function(){for(var b=this.buttons.length-1;b>=0;--b){this._removeButton(this.buttons[b])}},doubleClick:function(b){OpenLayers.Event.stop(b);return false},buttonDown:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor("h"));break;case"pandown":this.map.pan(0,this.getSlideFactor("h"));break;case"panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case"panright":this.map.pan(this.getSlideFactor("w"),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break}OpenLayers.Event.stop(b)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.controls=[]},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var b=this.controls.length-1;b>=0;b--){if(this.controls[b].events){this.controls[b].events.un({activate:this.redraw,deactivate:this.redraw,scope:this})}OpenLayers.Event.stopObservingElement(this.controls[b].panel_div);this.controls[b].panel_div=null}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var c=0,d=this.controls.length;c<d;c++){if(this.controls[c]==this.defaultControl){this.controls[c].activate()}}this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var c=0,d=this.controls.length;c<d;c++){this.controls[c].deactivate()}return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var c=0,d=this.controls.length;c<d;c++){this.map.addControl(this.controls[c]);this.controls[c].deactivate();this.controls[c].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.activate();return this.div},redraw:function(){this.div.innerHTML="";if(this.active){for(var f=0,e=this.controls.length;f<e;f++){var d=this.controls[f].panel_div;if(this.controls[f].active){d.className=this.controls[f].displayClass+"ItemActive"}else{d.className=this.controls[f].displayClass+"ItemInactive"}this.div.appendChild(d)}}},activateControl:function(f){if(!this.active){return false}if(f.type==OpenLayers.Control.TYPE_BUTTON){f.trigger();this.redraw();return}if(f.type==OpenLayers.Control.TYPE_TOGGLE){if(f.active){f.deactivate()}else{f.activate()}this.redraw();return}for(var d=0,e=this.controls.length;d<e;d++){if(this.controls[d]!=f){if(this.controls[d].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[d].deactivate()}}}f.activate()},addControls:function(f){if(!(f instanceof Array)){f=[f]}this.controls=this.controls.concat(f);for(var j=0,g=f.length;j<g;j++){var k=document.createElement("div");var i=document.createTextNode(" ");f[j].panel_div=k;if(f[j].title!=""){f[j].panel_div.title=f[j].title}OpenLayers.Event.observe(f[j].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,f[j]));OpenLayers.Event.observe(f[j].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var j=0,g=f.length;j<g;j++){this.map.addControl(f[j]);f[j].deactivate();f[j].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.redraw()}},onClick:function(c,d){OpenLayers.Event.stop(d?d:window.event);this.activateControl(c)},getControlsBy:function(i,f){var g=(typeof f.test=="function");var e=OpenLayers.Array.filter(this.controls,function(a){return a[i]==f||(g&&f.test(a[i]))});return e},getControlsByName:function(b){return this.getControlsBy("name",b)},getControlsByClass:function(b){return this.getControlsBy("CLASS_NAME",b)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(b){return b.target||b.srcElement},isLeftClick:function(b){return(((b.which)&&(b.which==1))||((b.button)&&(b.button==1)))},isRightClick:function(b){return(((b.which)&&(b.which==3))||((b.button)&&(b.button==2)))},stop:function(c,d){if(!d){if(c.preventDefault){c.preventDefault()}else{c.returnValue=false}}if(c.stopPropagation){c.stopPropagation()}else{c.cancelBubble=true}},findElement:function(f,d){var e=OpenLayers.Event.element(f);while(e.parentNode&&(!e.tagName||(e.tagName.toUpperCase()!=d.toUpperCase()))){e=e.parentNode}return e},observe:function(i,n,o,j){var m=OpenLayers.Util.getElement(i);j=j||false;if(n=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||m.attachEvent)){n="keydown"}if(!this.observers){this.observers={}}if(!m._eventCacheID){var l="eventCacheID_";if(m.id){l=m.id+"_"+l}m._eventCacheID=OpenLayers.Util.createUniqueID(l)}var k=m._eventCacheID;if(!this.observers[k]){this.observers[k]=[]}this.observers[k].push({element:m,name:n,observer:o,useCapture:j});if(m.addEventListener){m.addEventListener(n,o,j)}else{if(m.attachEvent){m.attachEvent("on"+n,o)}}},stopObservingElement:function(e){var d=OpenLayers.Util.getElement(e);var f=d._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[f])},_removeElementObservers:function(i){if(i){for(var f=i.length-1;f>=0;f--){var k=i[f];var g=new Array(k.element,k.name,k.observer,k.useCapture);var j=OpenLayers.Event.stopObserving.apply(this,g)}}},stopObserving:function(n,v,o,u){u=u||false;var q=OpenLayers.Util.getElement(n);var s=q._eventCacheID;if(v=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||q.detachEvent){v="keydown"}}var i=false;var t=OpenLayers.Event.observers[s];if(t){var r=0;while(!i&&r<t.length){var m=t[r];if((m.name==v)&&(m.observer==o)&&(m.useCapture==u)){t.splice(r,1);if(t.length==0){delete OpenLayers.Event.observers[s]}i=true;break}r++}}if(i){if(q.removeEventListener){q.removeEventListener(v,o,u)}else{if(q&&q.detachEvent){q.detachEvent("on"+v,o)}}}return i},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var d in OpenLayers.Event.observers){var c=OpenLayers.Event.observers[d];OpenLayers.Event._removeElementObservers.apply(this,[c])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event)}else{var Event=OpenLayers.Event}OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,clearMouseListener:null,initialize:function(o,m,k,l,i){OpenLayers.Util.extend(this,i);this.object=o;this.fallThrough=l;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(k!=null){for(var n=0,j=k.length;n<j;n++){this.addEventType(k[n])}}if(m!=null){this.attachToElement(m)}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element);if(this.element.hasScrollEvent){OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)}}this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(b){if(!this.listeners[b]){this.eventTypes.push(b);this.listeners[b]=[]}},attachToElement:function(g){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=g;for(var i=0,f=this.BROWSER_EVENTS.length;i<f;i++){var e=this.BROWSER_EVENTS[i];this.addEventType(e);OpenLayers.Event.observe(g,e,this.eventHandler)}OpenLayers.Event.observe(g,"dragstart",OpenLayers.Event.stop)},on:function(d){for(var c in d){if(c!="scope"){this.register(c,d.scope,d[c])}}},register:function(e,g,i){if((i!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,e)!=-1)){if(g==null){g=this.object}var f=this.listeners[e];f.push({obj:g,func:i})}},registerPriority:function(e,g,i){if(i!=null){if(g==null){g=this.object}var f=this.listeners[e];if(f!=null){f.unshift({obj:g,func:i})}}},un:function(d){for(var c in d){if(c!="scope"){this.unregister(c,d.scope,d[c])}}},unregister:function(l,j,k){if(j==null){j=this.object}var m=this.listeners[l];if(m!=null){for(var g=0,i=m.length;g<i;g++){if(m[g].obj==j&&m[g].func==k){m.splice(g,1);break}}}},remove:function(b){if(this.listeners[b]!=null){this.listeners[b]=[]}},triggerEvent:function(m,i){var n=this.listeners[m];if(!n||n.length==0){return}if(i==null){i={}}i.object=this.object;i.element=this.element;if(!i.type){i.type=m}var n=n.slice(),l;for(var o=0,j=n.length;o<j;o++){var k=n[o];l=k.func.apply(k.obj,[i]);if((l!=undefined)&&(l==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(i,true)}return l},handleBrowserEvent:function(b){if(this.includeXY){b.xy=this.getMousePosition(b)}this.triggerEvent(b.type,b)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(b){if(!this.includeXY){this.clearMouseCache()}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",this.clearMouseListener);this.element.hasScrollEvent=true}}if(!this.element.scrolls){this.element.scrolls=[(document.documentElement.scrollLeft||document.body.scrollLeft),(document.documentElement.scrollTop||document.body.scrollTop)]}if(!this.element.lefttop){this.element.lefttop=[(document.documentElement.clientLeft||0),(document.documentElement.clientTop||0)]}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element.offsets[0]+=this.element.scrolls[0];this.element.offsets[1]+=this.element.scrolls[1]}return new OpenLayers.Pixel((b.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(b.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:false,initialize:function(b){OpenLayers.Util.extend(this,b);this.options=b},destroy:function(){},read:function(b){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(b){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(k,o,l,i,j,m,n){this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)},draw:function(b){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(b){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(b){if(b!=undefined){this.backgroundColor=b}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(b){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,b);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(b){this.border=0},setRicoCorners:function(){var d=this.getCornersToRound(this.relativePosition);var c={corners:d,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,c);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,c);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var d=["tl","tr","bl","br"];var c=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(d,c);return d.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,initialize:function(k,o,l,i,j,m,n){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePosition){this.updateRelativePosition();this.calculateRelativePosition=function(a){return this.relativePosition}}this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(m){this.closeDiv.style.zIndex=1}this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePosition=false;this.positionBlocks=null;for(var d=0;d<this.blocks.length;d++){var c=this.blocks[d];if(c.image){c.div.removeChild(c.image)}c.image=null;if(c.div){this.groupDiv.removeChild(c.div)}c.div=null}this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(b){},setBorder:function(){},setOpacity:function(b){},setSize:function(b){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var b=this.getContentDivPadding();this.closeDiv.style.right=b.right+this.padding.right+"px";this.closeDiv.style.top=b.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(d){var c=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);c=c.offset(this.positionBlocks[this.relativePosition].offset);return c},createBlocks:function(){this.blocks=[];var n=null;for(var o in this.positionBlocks){n=o;break}var k=this.positionBlocks[n];for(var q=0;q<k.blocks.length;q++){var l={};this.blocks.push(l);var i=this.id+"_FrameDecorationDiv_"+q;l.div=OpenLayers.Util.createDiv(i,null,null,null,"absolute",null,"hidden",null);var r=this.id+"_FrameDecorationImg_"+q;var m=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;l.image=m(r,null,this.imageSize,this.imageSrc,"absolute",null,null,null);l.div.appendChild(l.image);this.groupDiv.appendChild(l.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var o=this.positionBlocks[this.relativePosition];for(var r=0;r<o.blocks.length;r++){var u=o.blocks[r];var s=this.blocks[r];var t=u.anchor.left;var l=u.anchor.bottom;var v=u.anchor.right;var b=u.anchor.top;var i=(isNaN(u.size.w))?this.size.w-(v+t):u.size.w;var q=(isNaN(u.size.h))?this.size.h-(l+b):u.size.h;s.div.style.width=(i<0?0:i)+"px";s.div.style.height=(q<0?0:q)+"px";s.div.style.left=(t!=null)?t+"px":"";s.div.style.bottom=(l!=null)?l+"px":"";s.div.style.right=(v!=null)?v+"px":"";s.div.style.top=(b!=null)?b+"px":"";s.image.style.left=u.position.x+"px";s.image.style.top=u.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(c,d){OpenLayers.Util.extend(this,d);this.projCode=c;if(window.Proj4js){this.proj=new Proj4js.Proj(c)}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(b){if(b&&b.getCode){return this.getCode()==b.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(f,d,e){if(!OpenLayers.Projection.transforms[f]){OpenLayers.Projection.transforms[f]={}}OpenLayers.Projection.transforms[f][d]=e};OpenLayers.Projection.transform=function(e,f,d){if(f.proj&&d.proj){e=Proj4js.transform(f.proj,d.proj,e)}else{if(f&&d&&OpenLayers.Projection.transforms[f.getCode()]&&OpenLayers.Projection.transforms[f.getCode()][d.getCode()]){OpenLayers.Projection.transforms[f.getCode()][d.getCode()](e)}}return e};OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},isGecko:null,initialize:function(b){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.isGecko=(navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var b="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(b+"SVG","1.1")||document.implementation.hasFeature(b+"BasicStructure","1.1")))},inValidRange:function(g,i,f){var j=g+(f?0:this.translationParameters.x);var k=i+(f?0:this.translationParameters.y);return(j>=-this.MAX_PIXEL&&j<=this.MAX_PIXEL&&k>=-this.MAX_PIXEL&&k<=this.MAX_PIXEL)},setExtent:function(i,n){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var j=this.getResolution();var l=-i.left/j;var m=i.top/j;if(n){this.left=l;this.top=m;var o="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",o);this.translate(0,0);return true}else{var k=this.translate(l-this.left,m-this.top);if(!k){this.setExtent(i,true)}return k}},translate:function(e,f){if(!this.inValidRange(e,f,true)){return false}else{var d="";if(e||f){d="translate("+e+","+f+")"}this.root.setAttributeNS(null,"transform",d);this.translationParameters={x:e,y:f};return true}},setSize:function(b){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(f,d){var e=null;switch(f.CLASS_NAME){case"OpenLayers.Geometry.Point":if(d.externalGraphic){e="image"}else{if(this.isComplexSymbol(d.graphicName)){e="use"}else{e="circle"}}break;case"OpenLayers.Geometry.Rectangle":e="rect";break;case"OpenLayers.Geometry.LineString":e="polyline";break;case"OpenLayers.Geometry.LinearRing":e="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":e="path";break;default:break}return e},setStyle:function(A,v,P){v=v||A._style;P=P||A._options;var F=parseFloat(A.getAttributeNS(null,"r"));var G=1;var K;if(A._geometryClass=="OpenLayers.Geometry.Point"&&F){A.style.visibility="";if(v.graphic===false){A.style.visibility="hidden"}else{if(v.externalGraphic){K=this.getPosition(A);if(v.graphicTitle){A.setAttributeNS(null,"title",v.graphicTitle)}if(v.graphicWidth&&v.graphicHeight){A.setAttributeNS(null,"preserveAspectRatio","none")}var B=v.graphicWidth||v.graphicHeight;var D=v.graphicHeight||v.graphicWidth;B=B?B:v.pointRadius*2;D=D?D:v.pointRadius*2;var r=(v.graphicXOffset!=undefined)?v.graphicXOffset:-(0.5*B);var J=(v.graphicYOffset!=undefined)?v.graphicYOffset:-(0.5*D);var Q=v.graphicOpacity||v.fillOpacity;A.setAttributeNS(null,"x",(K.x+r).toFixed());A.setAttributeNS(null,"y",(K.y+J).toFixed());A.setAttributeNS(null,"width",B);A.setAttributeNS(null,"height",D);A.setAttributeNS(this.xlinkns,"href",v.externalGraphic);A.setAttributeNS(null,"style","opacity: "+Q)}else{if(this.isComplexSymbol(v.graphicName)){var M=v.pointRadius*3;var E=M*2;var C=this.importSymbol(v.graphicName);var w="#"+C;K=this.getPosition(A);G=this.symbolSize[C]/E;var I=A.parentNode;var H=A.nextSibling;if(I){I.removeChild(A)}A.setAttributeNS(this.xlinkns,"href",w);A.setAttributeNS(null,"width",E);A.setAttributeNS(null,"height",E);A.setAttributeNS(null,"x",K.x-M);A.setAttributeNS(null,"y",K.y-M);if(H){I.insertBefore(A,H)}else{if(I){I.appendChild(A)}}}else{A.setAttributeNS(null,"r",v.pointRadius)}}}if(typeof v.rotation!="undefined"&&K){var z=OpenLayers.String.format("rotate(${0} ${1} ${2})",[v.rotation,K.x,K.y]);A.setAttributeNS(null,"transform",z)}}if(P.isFilled){A.setAttributeNS(null,"fill",v.fillColor);A.setAttributeNS(null,"fill-opacity",v.fillOpacity)}else{A.setAttributeNS(null,"fill","none")}if(P.isStroked){A.setAttributeNS(null,"stroke",v.strokeColor);A.setAttributeNS(null,"stroke-opacity",v.strokeOpacity);A.setAttributeNS(null,"stroke-width",v.strokeWidth*G);A.setAttributeNS(null,"stroke-linecap",v.strokeLinecap);A.setAttributeNS(null,"stroke-linejoin","round");A.setAttributeNS(null,"stroke-dasharray",this.dashStyle(v,G))}else{A.setAttributeNS(null,"stroke","none")}if(v.pointerEvents){A.setAttributeNS(null,"pointer-events",v.pointerEvents)}if(v.cursor!=null){A.setAttributeNS(null,"cursor",v.cursor)}return A},dashStyle:function(f,d){var e=f.strokeWidth*d;switch(f.strokeDashstyle){case"solid":return"none";case"dot":return[1,4*e].join();case"dash":return[4*e,4*e].join();case"dashdot":return[4*e,4*e,1,4*e].join();case"longdash":return[8*e,4*e].join();case"longdashdot":return[8*e,4*e,1,4*e].join();default:return f.strokeDashstyle.replace(/ /g,",")}},createNode:function(e,f){var d=document.createElementNS(this.xmlns,e);if(f){d.setAttributeNS(null,"id",f)}return d},nodeTypeCompare:function(c,d){return(d==c.nodeName)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(b){return this.nodeFactory(this.container.id+b,"g")},createDefs:function(){var b=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(b);return b},drawPoint:function(d,c){return this.drawCircle(d,c,1)},drawCircle:function(l,k,g){var m=this.getResolution();var i=(k.x/m+this.left);var j=(this.top-k.y/m);if(this.inValidRange(i,j)){l.setAttributeNS(null,"cx",i);l.setAttributeNS(null,"cy",j);l.setAttributeNS(null,"r",g);return l}else{return false}},drawLineString:function(d,f){var e=this.getComponentsString(f.components);if(e.path){d.setAttributeNS(null,"points",e.path);return(e.complete?d:null)}else{return false}},drawLinearRing:function(d,f){var e=this.getComponentsString(f.components);if(e.path){d.setAttributeNS(null,"points",e.path);return(e.complete?d:null)}else{return false}},drawPolygon:function(s,m){var n="";var j=true;var t=true;var r,d;for(var q=0,o=m.components.length;q<o;q++){n+=" M";r=this.getComponentsString(m.components[q].components," ");d=r.path;if(d){n+=" "+d;t=r.complete&&t}else{j=false}}n+=" z";if(j){s.setAttributeNS(null,"d",n);s.setAttributeNS(null,"fill-rule","evenodd");return t?s:null}else{return false}},drawRectangle:function(k,j){var f=this.getResolution();var g=(j.x/f+this.left);var i=(this.top-j.y/f);if(this.inValidRange(g,i)){k.setAttributeNS(null,"x",g);k.setAttributeNS(null,"y",i);k.setAttributeNS(null,"width",j.width/f);k.setAttributeNS(null,"height",j.height/f);return k}else{return false}},drawSurface:function(m,k){var l=null;var d=true;for(var n=0,i=k.components.length;n<i;n++){if((n%3)==0&&(n/3)==0){var o=this.getShortString(k.components[n]);if(!o){d=false}l="M "+o}else{if((n%3)==1){var o=this.getShortString(k.components[n]);if(!o){d=false}l+=" C "+o}else{var o=this.getShortString(k.components[n]);if(!o){d=false}l+=" "+o}}}l+=" Z";if(d){m.setAttributeNS(null,"d",l);return m}else{return false}},drawText:function(r,t,k){var s=this.getResolution();var l=(k.x/s+this.left);var o=(k.y/s-this.top);var m=this.nodeFactory(r+this.LABEL_ID_SUFFIX,"text");var n=this.nodeFactory(r+this.LABEL_ID_SUFFIX+"_tspan","tspan");m.setAttributeNS(null,"x",l);m.setAttributeNS(null,"y",-o);m.setAttributeNS(null,"pointer-events","visible");if(t.fontColor){m.setAttributeNS(null,"fill",t.fontColor);m.appendChild(n);this.textRoot.appendChild(m)}if(t.fontFamily){m.setAttributeNS(null,"font-family",t.fontFamily)}if(t.fontSize){m.setAttributeNS(null,"font-size",t.fontSize)}if(t.fontWeight){m.setAttributeNS(null,"font-weight",t.fontWeight)}var q=t.labelAlign||"cm";m.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[q[0]]||"middle");if(this.isGecko){m.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[q[1]]||"central")}else{n.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[q[1]]||"-35%")}n.textContent=t.label;m._featureId=r;n._featureId=r;n.style.cursor="pointer";n._geometry=k;n._geometryClass=k.CLASS_NAME;if(!m.parentNode){m.appendChild(n);this.textRoot.appendChild(m)}},getComponentsString:function(r,s){var o=[];var v=true;var q=r.length;var i=[];var n,j,u;for(var t=0;t<q;t++){j=r[t];o.push(j);n=this.getShortString(j);if(n){i.push(n)}else{if(t>0){if(this.getShortString(r[t-1])){i.push(this.clipLine(r[t],r[t-1]))}}if(t<q-1){if(this.getShortString(r[t+1])){i.push(this.clipLine(r[t],r[t+1]))}}v=false}}return{path:i.join(s||","),complete:v}},clipLine:function(r,n){if(n.equals(r)){return""}var q=this.getResolution();var u=this.MAX_PIXEL-this.translationParameters.x;var v=this.MAX_PIXEL-this.translationParameters.y;var s=n.x/q+this.left;var k=this.top-n.y/q;var t=r.x/q+this.left;var m=this.top-r.y/q;var o;if(t<-u||t>u){o=(m-k)/(t-s);t=t<0?-u:u;m=k+(t-s)*o}if(m<-v||m>v){o=(t-s)/(m-k);m=m<0?-v:v;t=s+(m-k)*o}return t+","+m},getShortString:function(e){var i=this.getResolution();var f=(e.x/i+this.left);var g=(this.top-e.y/i);if(this.inValidRange(f,g)){return f+","+g}else{return false}},getPosition:function(b){return({x:parseFloat(b.getAttributeNS(null,"cx")),y:parseFloat(b.getAttributeNS(null,"cy"))})},importSymbol:function(z){if(!this.defs){this.defs=this.createDefs()}var C=this.container.id+"-"+z;if(document.getElementById(C)!=null){return C}var A=OpenLayers.Renderer.symbol[z];if(!A){throw new Error(z+" is not a valid symbol name");return}var v=this.nodeFactory(C,"symbol");var B=this.nodeFactory(null,"polygon");v.appendChild(B);var q=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var s="";var t,u;for(var w=0;w<A.length;w=w+2){t=A[w];u=A[w+1];q.left=Math.min(q.left,t);q.bottom=Math.min(q.bottom,u);q.right=Math.max(q.right,t);q.top=Math.max(q.top,u);s+=" "+t+","+u}B.setAttributeNS(null,"points",s);var D=q.getWidth();var r=q.getHeight();var i=[q.left-D,q.bottom-r,D*3,r*3];v.setAttributeNS(null,"viewBox",i.join(" "));this.symbolSize[C]=Math.max(D,r)*3;this.defs.appendChild(v);return v.id},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};OpenLayers.Renderer.SVG.LABEL_VSHIFT={t:"-70%",b:"0"};OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(f){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var i=document.createStyleSheet();var k=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var j=0,g=k.length;j<g;j++){i.addRule("olv\\:"+k[j],"behavior: url(#default#VML); position: absolute; display: inline-block;")}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.offset={x:0,y:0}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return !!(document.namespaces)},setExtent:function(o,z){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var v=this.getResolution();var w=o.left/v;var s=o.top/v-this.size.h;if(z){this.offset={x:w,y:s};w=0;s=0}else{w=w-this.offset.x;s=s-this.offset.y}var i=w+" "+s;this.root.coordorigin=i;var q=[this.root,this.vectorRoot,this.textRoot];var r;for(var u=0,t=q.length;u<t;++u){r=q[u];var n=this.size.w+" "+this.size.h;r.coordsize=n}this.root.style.flip="y";return true},setSize:function(l){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var n=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var o=this.size.w+"px";var k=this.size.h+"px";var i;for(var m=0,j=n.length;m<j;++m){i=n[m];i.style.width=o;i.style.height=k}},getNodeType:function(f,d){var e=null;switch(f.CLASS_NAME){case"OpenLayers.Geometry.Point":if(d.externalGraphic){e="olv:rect"}else{if(this.isComplexSymbol(d.graphicName)){e="olv:shape"}else{e="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":e="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":e="olv:shape";break;default:break}return e},setStyle:function(G,I,s,z){I=I||G._style;s=s||G._options;var B=1;if(G._geometryClass=="OpenLayers.Geometry.Point"){if(I.externalGraphic){if(I.graphicTitle){G.title=I.graphicTitle}var H=I.graphicWidth||I.graphicHeight;var w=I.graphicHeight||I.graphicWidth;H=H?H:I.pointRadius*2;w=w?w:I.pointRadius*2;var E=this.getResolution();var C=(I.graphicXOffset!=undefined)?I.graphicXOffset:-(0.5*H);var F=(I.graphicYOffset!=undefined)?I.graphicYOffset:-(0.5*w);G.style.left=((z.x/E-this.offset.x)+C).toFixed();G.style.top=((z.y/E-this.offset.y)-(F+w)).toFixed();G.style.width=H+"px";G.style.height=w+"px";G.style.flip="y";I.fillColor="none";s.isStroked=false}else{if(this.isComplexSymbol(I.graphicName)){var J=this.importSymbol(I.graphicName);G.path=J.path;G.coordorigin=J.left+","+J.bottom;var t=J.size;G.coordsize=t+","+t;this.drawCircle(G,z,I.pointRadius);G.style.flip="y"}else{this.drawCircle(G,z,I.pointRadius)}}}if(s.isFilled){G.fillcolor=I.fillColor}else{G.filled="false"}var A=G.getElementsByTagName("fill");var u=(A.length==0)?null:A[0];if(!s.isFilled){if(u){G.removeChild(u)}}else{if(!u){u=this.createNode("olv:fill",G.id+"_fill")}u.opacity=I.fillOpacity;if(G._geometryClass=="OpenLayers.Geometry.Point"&&I.externalGraphic){if(I.graphicOpacity){u.opacity=I.graphicOpacity}u.src=I.externalGraphic;u.type="frame";if(!(I.graphicWidth&&I.graphicHeight)){u.aspect="atmost"}}if(u.parentNode!=G){G.appendChild(u)}}if(typeof I.rotation!="undefined"){if(I.externalGraphic){this.graphicRotate(G,C,F);u.opacity=0}else{G.style.rotation=I.rotation}}if(s.isStroked){G.strokecolor=I.strokeColor;G.strokeweight=I.strokeWidth+"px"}else{G.stroked=false}var D=G.getElementsByTagName("stroke");var v=(D.length==0)?null:D[0];if(!s.isStroked){if(v){G.removeChild(v)}}else{if(!v){v=this.createNode("olv:stroke",G.id+"_stroke");G.appendChild(v)}v.opacity=I.strokeOpacity;v.endcap=!I.strokeLinecap||I.strokeLinecap=="butt"?"flat":I.strokeLinecap;v.dashstyle=this.dashStyle(I)}if(I.cursor!="inherit"&&I.cursor!=null){G.style.cursor=I.cursor}return G},graphicRotate:function(C,w,K){var z=z||C._style;var P=C._options;var T,G;if(!(z.graphicWidth&&z.graphicHeight)){var v=new Image();v.onreadystatechange=OpenLayers.Function.bind(function(){if(v.readyState=="complete"||v.readyState=="interactive"){T=v.width/v.height;G=Math.max(z.pointRadius*2,z.graphicWidth||0,z.graphicHeight||0);w=w*T;z.graphicWidth=G*T;z.graphicHeight=G;this.graphicRotate(C,w,K)}},this);v.src=z.externalGraphic;return}else{G=Math.max(z.graphicWidth,z.graphicHeight);T=z.graphicWidth/z.graphicHeight}var D=Math.round(z.graphicWidth||G*T);var F=Math.round(z.graphicHeight||G);C.style.width=D+"px";C.style.height=F+"px";var E=document.getElementById(C.id+"_image");if(!E){E=this.createNode("olv:imagedata",C.id+"_image");C.appendChild(E)}E.style.width=D+"px";E.style.height=F+"px";E.src=z.externalGraphic;E.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var B=z.rotation*Math.PI/180;var I=Math.sin(B);var M=Math.cos(B);var J="progid:DXImageTransform.Microsoft.Matrix(M11="+M+",M12="+(-I)+",M21="+I+",M22="+M+",SizingMethod='auto expand')\n";var R=z.graphicOpacity||z.fillOpacity;if(R&&R!=1){J+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+R+")\n"}C.style.filter=J;var A=new OpenLayers.Geometry.Point(-w,-K);var Q=new OpenLayers.Bounds(0,0,D,F).toGeometry();Q.rotate(z.rotation,A);var H=Q.getBounds();C.style.left=Math.round(parseInt(C.style.left)+H.left)+"px";C.style.top=Math.round(parseInt(C.style.top)-H.bottom)+"px"},postDraw:function(e){var f=e._style.fillColor;var d=e._style.strokeColor;if(f=="none"&&e.fillcolor!=f){e.fillcolor=f}if(d=="none"&&e.strokecolor!=d){e.strokecolor=d}},setNodeDimension:function(f,i){var j=i.getBounds();if(j){var g=this.getResolution();var k=new OpenLayers.Bounds((j.left/g-this.offset.x).toFixed(),(j.bottom/g-this.offset.y).toFixed(),(j.right/g-this.offset.x).toFixed(),(j.top/g-this.offset.y).toFixed());f.style.left=k.left+"px";f.style.top=k.top+"px";f.style.width=k.getWidth()+"px";f.style.height=k.getHeight()+"px";f.coordorigin=k.left+" "+k.top;f.coordsize=k.getWidth()+" "+k.getHeight()}},dashStyle:function(e){var f=e.strokeDashstyle;switch(f){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return f;default:var d=f.split(/[ ,]/);if(d.length==2){if(1*d[0]>=2*d[1]){return"longdash"}return(d[0]==1||d[1]==1)?"dot":"dash"}else{if(d.length==4){return(1*d[0]>=2*d[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(e,f){var d=document.createElement(e);if(f){d.id=f}d.unselectable="on";d.onselectstart=function(){return(false)};return d},nodeTypeCompare:function(k,f){var j=f;var g=j.indexOf(":");if(g!=-1){j=j.substr(g+1)}var i=k.nodeName;g=i.indexOf(":");if(g!=-1){i=i.substr(g+1)}return(j==i)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(b){return this.nodeFactory(this.container.id+b,"olv:group")},drawPoint:function(d,c){return this.drawCircle(d,c,1)},drawCircle:function(j,i,g){if(!isNaN(i.x)&&!isNaN(i.y)){var f=this.getResolution();j.style.left=((i.x/f-this.offset.x).toFixed()-g)+"px";j.style.top=((i.y/f-this.offset.y).toFixed()-g)+"px";var k=g*2;j.style.width=k+"px";j.style.height=k+"px";return j}return false},drawLineString:function(d,c){return this.drawLine(d,c,false)},drawLinearRing:function(d,c){return this.drawLine(d,c,true)},drawLine:function(w,n,r){this.setNodeDimension(w,n);var v=this.getResolution();var z=n.components.length;var t=new Array(z);var q,i,o;for(var s=0;s<z;s++){q=n.components[s];i=(q.x/v-this.offset.x);o=(q.y/v-this.offset.y);t[s]=" "+i.toFixed()+","+o.toFixed()+" l "}var u=(r)?" x e":" e";w.path="m"+t.join("")+u;return w},drawPolygon:function(A,q){this.setNodeDimension(A,q);var z=this.getResolution();var i=[];var u,v,w,s,B,t,j,r;for(w=0,s=q.components.length;w<s;w++){u=q.components[w];i.push("m");for(v=0,B=u.components.length;v<B;v++){t=u.components[v];j=t.x/z-this.offset.x;r=t.y/z-this.offset.y;i.push(" "+j.toFixed()+","+r.toFixed());if(v==0){i.push(" l")}}i.push(" x ")}i.push("e");A.path=i.join("");return A},drawRectangle:function(d,f){var e=this.getResolution();d.style.left=(f.x/e-this.offset.x)+"px";d.style.top=(f.y/e-this.offset.y)+"px";d.style.width=f.width/e+"px";d.style.height=f.height/e+"px";return d},drawText:function(q,t,l){var m=this.nodeFactory(q+this.LABEL_ID_SUFFIX,"olv:rect");var n=this.nodeFactory(q+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var r=this.getResolution();m.style.left=(l.x/r-this.offset.x).toFixed()+"px";m.style.top=(l.y/r-this.offset.y).toFixed()+"px";m.style.flip="y";n.innerText=t.label;if(t.fillColor){n.style.color=t.fontColor}if(t.fontFamily){n.style.fontFamily=t.fontFamily}if(t.fontSize){n.style.fontSize=t.fontSize}if(t.fontWeight){n.style.fontWeight=t.fontWeight}if(t.cursor){n.style.cursor=t.cursor}n.style.whiteSpace="nowrap";n.inset="1px,0px,0px,0px";if(!m.parentNode){m.appendChild(n);this.textRoot.appendChild(m)}var o=t.labelAlign||"cm";var k=n.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[o.substr(0,1)]);var s=n.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[o.substr(1,1)]);m.style.left=parseInt(m.style.left)-k-1+"px";m.style.top=parseInt(m.style.top)+s+"px";m._featureId=q;n._featureId=q;n._geometry=l;n._geometryClass=l.CLASS_NAME},drawSurface:function(t,m){this.setNodeDimension(t,m);var s=this.getResolution();var i=[];var q,l,n;for(var r=0,o=m.components.length;r<o;r++){q=m.components[r];l=q.x/s-this.offset.x;n=q.y/s-this.offset.y;if((r%3)==0&&(r/3)==0){i.push("m")}else{if((r%3)==1){i.push(" c")}}i.push(" "+l+","+n)}i.push(" x e");t.path=i.join("");return t},moveRoot:function(c){var d=this.map.getLayer(c.container.id);if(d instanceof OpenLayers.Layer.Vector.RootContainer){d=this.map.getLayer(this.container.id)}d&&d.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);d&&d.redraw()},importSymbol:function(q){var s=this.container.id+"-"+q;var t=this.symbolCache[s];if(t){return t}var r=OpenLayers.Renderer.symbol[q];if(!r){throw new Error(q+" is not a valid symbol name");return}var l=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var o=["m"];for(var n=0;n<r.length;n=n+2){x=r[n];y=r[n+1];l.left=Math.min(l.left,x);l.bottom=Math.min(l.bottom,y);l.right=Math.max(l.right,x);l.top=Math.max(l.top,y);o.push(x);o.push(y);if(n==0){o.push("l")}}o.push("x e");var i=o.join(" ");var m=(l.getWidth()-l.getHeight())/2;if(m>0){l.bottom=l.bottom-m;l.top=l.top+m}else{l.left=l.left-m;l.right=l.right+m}t={path:i,size:l.getWidth(),left:l.left,bottom:l.bottom};this.symbolCache[s]=t;return t},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,initialize:function(j,g,i,f,k){this.layer=j;this.position=g.clone();this.bounds=i.clone();this.url=f;this.size=k.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},unload:function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("unload")}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destroy();this.events=null},clone:function(b){if(b==null){b=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(b,this);return b},draw:function(){var d=this.layer.maxExtent;var c=(d&&this.bounds.intersectsBounds(d,false));this.shouldDraw=(c||this.layer.displayOutsideMaxExtent);this.clear();return this.shouldDraw},moveTo:function(d,e,f){if(f==null){f=true}this.bounds=d.clone();this.position=e.clone();if(f){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(i){var j=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(j);var l=this.layer.map.getLonLatFromLayerPx(i);var m=i.clone();m.x+=this.size.w;m.y+=this.size.h;var g=this.layer.map.getLonLatFromLayerPx(m);if(l.lon>g.lon){if(l.lon<0){l.lon=-180-(l.lon+180)}else{g.lon=180+g.lon+180}}var k=new OpenLayers.Bounds(l.lon,g.lat,g.lon,l.lat);return k},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this._removeZoomBar();this.map.events.un({changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)},setMap:function(b){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){if(this.div!=null){this.removeButtons();this._removeZoomBar()}this.draw()},draw:function(e){OpenLayers.Control.prototype.draw.apply(this,arguments);e=this.position.clone();this.buttons=[];var g=new OpenLayers.Size(18,18);var f=new OpenLayers.Pixel(e.x+g.w/2,e.y);var i=g.w;if(this.zoomWorldIcon){f=new OpenLayers.Pixel(e.x+g.w,e.y)}this._addButton("panup","north-mini.png",f,g);e.y=f.y+g.h;this._addButton("panleft","west-mini.png",e,g);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",e.add(g.w,0),g);i*=2}this._addButton("panright","east-mini.png",e.add(i,0),g);this._addButton("pandown","south-mini.png",f.add(0,g.h*2),g);this._addButton("zoomin","zoom-plus-mini.png",f.add(0,g.h*3+5),g);f=this._addZoomBar(f.add(0,g.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",f,g);return this.div},_addZoomBar:function(j){var m=OpenLayers.Util.getImagesLocation();var k=this.id+"_"+this.map.id;var i=this.map.getNumZoomLevels()-1-this.map.getZoom();var o=OpenLayers.Util.createAlphaImageDiv(k,j.add(-1,i*this.zoomStopHeight),new OpenLayers.Size(20,9),m+"slider.png","absolute");this.slider=o;this.sliderEvents=new OpenLayers.Events(this,o,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var n=new OpenLayers.Size();n.h=this.zoomStopHeight*this.map.getNumZoomLevels();n.w=this.zoomStopWidth;var l=null;if(OpenLayers.Util.alphaHack()){var k=this.id+"_"+this.map.id;l=OpenLayers.Util.createAlphaImageDiv(k,j,new OpenLayers.Size(n.w,this.zoomStopHeight),m+"zoombar.png","absolute",null,"crop");l.style.height=n.h+"px"}else{l=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,j,n,m+"zoombar.png")}this.zoombarDiv=l;this.divEvents=new OpenLayers.Events(this,l,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(l);this.startTop=parseInt(l.style.top);this.div.appendChild(o);this.map.events.register("zoomend",this,this.moveZoomBar);j=j.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return j},_removeZoomBar:function(){this.sliderEvents.un({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});this.sliderEvents.destroy();this.divEvents.un({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.divEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.map.events.unregister("zoomend",this,this.moveZoomBar)},passEventToSlider:function(b){this.sliderEvents.handleBrowserEvent(b)},divClick:function(g){if(!OpenLayers.Event.isLeftClick(g)){return}var i=g.xy.y;var j=OpenLayers.Util.pagePosition(g.object)[1];var k=(i-j)/this.zoomStopHeight;if(!this.map.fractionalZoom){k=Math.floor(k)}var f=(this.map.getNumZoomLevels()-1)-k;f=Math.min(Math.max(f,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(f);OpenLayers.Event.stop(g)},zoomBarDown:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=b.xy.clone();this.zoomStart=b.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(b)},zoomBarDrag:function(e){if(this.mouseDragStart!=null){var f=this.mouseDragStart.y-e.xy.y;var g=OpenLayers.Util.pagePosition(this.zoombarDiv);if((e.clientY-g[1])>0&&(e.clientY-g[1])<parseInt(this.zoombarDiv.style.height)-2){var i=parseInt(this.slider.style.top)-f;this.slider.style.top=i+"px";this.mouseDragStart=e.xy.clone()}OpenLayers.Event.stop(e)}},zoomBarUp:function(d){if(!OpenLayers.Event.isLeftClick(d)){return}if(this.zoomStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var e=this.zoomStart.y-d.xy.y;var f=this.map.zoom;if(this.map.fractionalZoom){f+=e/this.zoomStopHeight;f=Math.min(Math.max(f,0),this.map.getNumZoomLevels()-1)}else{f+=Math.round(e/this.zoomStopHeight)}this.map.zoomTo(f);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(d)}},moveZoomBar:function(){var b=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=b+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,initialize:function(b){OpenLayers.Format.prototype.initialize.apply(this,[b])},read:function(json,filter){try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){var object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}if(this.keepData){this.data=object}return object}}catch(e){}return null},write:function(i,k){this.pretty=!!k;var g=null;var f=typeof i;if(this.serialize[f]){try{g=this.serialize[f].apply(this,[i])}catch(j){OpenLayers.Console.error("Trouble serializing: "+j)}}return g},writeIndent:function(){var c=[];if(this.pretty){for(var d=0;d<this.level;++d){c.push(this.indent)}}return c.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{object:function(m){if(m==null){return"null"}if(m.constructor==Date){return this.serialize.date.apply(this,[m])}if(m.constructor==Array){return this.serialize.array.apply(this,[m])}var j=["{"];this.level+=1;var l,g,k;var i=false;for(l in m){if(m.hasOwnProperty(l)){g=OpenLayers.Format.JSON.prototype.write.apply(this,[l,this.pretty]);k=OpenLayers.Format.JSON.prototype.write.apply(this,[m[l],this.pretty]);if(g!=null&&k!=null){if(i){j.push(",")}j.push(this.writeNewline(),this.writeIndent(),g,":",this.writeSpace(),k);i=true}}}this.level-=1;j.push(this.writeNewline(),this.writeIndent(),"}");return j.join("")},array:function(i){var k;var j=["["];this.level+=1;for(var f=0,g=i.length;f<g;++f){k=OpenLayers.Format.JSON.prototype.write.apply(this,[i[f],this.pretty]);if(k!=null){if(f>0){j.push(",")}j.push(this.writeNewline(),this.writeIndent(),k)}}this.level-=1;j.push(this.writeNewline(),this.writeIndent(),"]");return j.join("")},string:function(c){var d={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(/["\\\x00-\x1f]/.test(c)){return'"'+c.replace(/([\x00-\x1f\\"])/g,function(b,g){var a=d[g];if(a){return a}a=g.charCodeAt();return"\\u00"+Math.floor(a/16).toString(16)+(a%16).toString(16)})+'"'}return'"'+c+'"'},number:function(b){return isFinite(b)?String(b):"null"},"boolean":function(b){return String(b)},date:function(d){function c(a){return(a<10)?"0"+a:a}return'"'+d.getFullYear()+"-"+c(d.getMonth()+1)+"-"+c(d.getDate())+"T"+c(d.getHours())+":"+c(d.getMinutes())+":"+c(d.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(f,d,e){OpenLayers.Util.extend(this,e);this.control=f;this.callbacks=d;if(f.map){this.setMap(f.map)}OpenLayers.Util.extend(this,e);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(b){this.map=b},checkModifiers:function(d){if(this.keyMask==null){return true}var c=(d.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(d.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(d.altKey?OpenLayers.Handler.MOD_ALT:0);return(c==this.keyMask)},activate:function(){if(this.active){return false}var f=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var d=0,e=f.length;d<e;d++){if(this[f[d]]){this.register(f[d],this[f[d]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var f=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var d=0,e=f.length;d<e;d++){if(this[f[d]]){this.unregister(f[d],this[f[d]])}}this.active=false;return true},callback:function(c,d){if(c&&this.callbacks[c]){this.callbacks[c].apply(this.control,d)}},register:function(d,c){this.map.events.registerPriority(d,this,c);this.map.events.registerPriority(d,this,this.setEvent)},unregister:function(d,c){this.map.events.unregister(d,this,c);this.map.events.unregister(d,this,this.setEvent)},setEvent:function(b){this.evt=b;return true},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,allOverlays:false,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,initialize:function(l,q){if(arguments.length===1&&typeof l==="object"){q=l;l=q&&q.div}this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);OpenLayers.Util.extend(this,q);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(l);if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}OpenLayers.Element.addClass(this.div,"olMap");var m=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(m,null,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPortDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendChild(this.viewPortDiv);m=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(m);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough,{includeXY:true});this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var n=true;var r=document.getElementsByTagName("link");for(var o=0,k=r.length;o<k;++o){if(OpenLayers.Util.isEquivalentUrl(r.item(o).href,this.theme)){n=false;break}}if(n){var i=document.createElement("link");i.setAttribute("rel","stylesheet");i.setAttribute("type","text/css");i.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(i)}}this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var o=0,k=this.controls.length;o<k;o++){this.addControlToMap(this.controls[o])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy)},render:function(b){this.div=OpenLayers.Util.getElement(b);OpenLayers.Element.addClass(this.div,"olMap");this.events.attachToElement(this.div);this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)}else{this.events.unregister("resize",this,this.updateSize)}this.paddingForPopups=null;if(this.controls!=null){for(var b=this.controls.length-1;b>=0;--b){this.controls[b].destroy()}this.controls=null}if(this.layers!=null){for(var b=this.layers.length-1;b>=0;--b){this.layers[b].destroy(false)}this.layers=null}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)}this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null}this.events.destroy();this.events=null},setOptions:function(b){OpenLayers.Util.extend(this,b)},getTileSize:function(){return this.tileSize},getBy:function(i,k,g){var j=(typeof g.test=="function");var f=OpenLayers.Array.filter(this[i],function(a){return a[k]==g||(j&&g.test(a[k]))});return f},getLayersBy:function(c,d){return this.getBy("layers",c,d)},getLayersByName:function(b){return this.getLayersBy("name",b)},getLayersByClass:function(b){return this.getLayersBy("CLASS_NAME",b)},getControlsBy:function(c,d){return this.getBy("controls",c,d)},getControlsByClass:function(b){return this.getControlsBy("CLASS_NAME",b)},getLayer:function(i){var f=null;for(var j=0,g=this.layers.length;j<g;j++){var k=this.layers[j];if(k.id==i){f=k;break}}return f},setLayerZIndex:function(c,d){c.setZIndex(this.Z_INDEX_BASE[c.isBaseLayer?"BaseLayer":"Overlay"]+d*5)},resetLayersZIndex:function(){for(var f=0,e=this.layers.length;f<e;f++){var d=this.layers[f];this.setLayerZIndex(d,f)}},addLayer:function(i){for(var e=0,f=this.layers.length;e<f;e++){if(this.layers[e]==i){var g=OpenLayers.i18n("layerAlreadyAdded",{layerName:i.name});OpenLayers.Console.warn(g);return false}}if(this.allOverlays){i.isBaseLayer=false}this.events.triggerEvent("preaddlayer",{layer:i});i.div.className="olLayerDiv";i.div.style.overflow="";this.setLayerZIndex(i,this.layers.length);if(i.isFixed){this.viewPortDiv.appendChild(i.div)}else{this.layerContainerDiv.appendChild(i.div)}this.layers.push(i);i.setMap(this);if(i.isBaseLayer||(this.allOverlays&&!this.baseLayer)){if(this.baseLayer==null){this.setBaseLayer(i)}else{i.setVisibility(false)}}else{i.redraw()}this.events.triggerEvent("addlayer",{layer:i});i.afterAdd()},addLayers:function(f){for(var d=0,e=f.length;d<e;d++){this.addLayer(f[d])}},removeLayer:function(k,i){if(i==null){i=true}if(k.isFixed){this.viewPortDiv.removeChild(k.div)}else{this.layerContainerDiv.removeChild(k.div)}OpenLayers.Util.removeItem(this.layers,k);k.removeMap(this);k.map=null;if(this.baseLayer==k){this.baseLayer=null;if(i){for(var f=0,g=this.layers.length;f<g;f++){var j=this.layers[f];if(j.isBaseLayer||this.allOverlays){this.setBaseLayer(j);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:k})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(b){return OpenLayers.Util.indexOf(this.layers,b)},setLayerIndex:function(j,f){var i=this.getLayerIndex(j);if(f<0){f=0}else{if(f>this.layers.length){f=this.layers.length}}if(i!=f){this.layers.splice(i,1);this.layers.splice(f,0,j);for(var k=0,g=this.layers.length;k<g;k++){this.setLayerZIndex(this.layers[k],k)}this.events.triggerEvent("changelayer",{layer:j,property:"order"});if(this.allOverlays){if(f===0){this.setBaseLayer(j)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(d,f){var e=this.getLayerIndex(d)+f;this.setLayerIndex(d,e)},setBaseLayer:function(i){var j=null;if(this.baseLayer){j=this.baseLayer.getExtent()}if(i!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,i)!=-1){if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=i;this.viewRequestID++;if(!this.allOverlays){this.baseLayer.visibility=true}var g=this.getCenter();if(g!=null){var f=(j)?j.getCenterLonLat():g;var k=(j)?this.getZoomForExtent(j,true):this.getZoomForResolution(this.resolution,true);this.setCenter(f,k,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(c,d){this.controls.push(c);this.addControlToMap(c,d)},addControlToMap:function(d,e){d.outsideViewport=(d.div!=null);if(this.displayProjection&&!d.displayProjection){d.displayProjection=this.displayProjection}d.setMap(this);var f=d.draw(e);if(f){if(!d.outsideViewport){f.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(f)}}},getControl:function(i){var f=null;for(var k=0,g=this.controls.length;k<g;k++){var j=this.controls[k];if(j.id==i){f=j;break}}return f},removeControl:function(b){if((b)&&(b==this.getControl(b.id))){if(b.div&&(b.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(b.div)}OpenLayers.Util.removeItem(this.controls,b)}},addPopup:function(f,g){if(g){for(var e=this.popups.length-1;e>=0;--e){this.removePopup(this.popups[e])}}f.map=this;this.popups.push(f);var i=f.draw();if(i){i.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(i)}},removePopup:function(d){OpenLayers.Util.removeItem(this.popups,d);if(d.div){try{this.layerContainerDiv.removeChild(d.div)}catch(c){}}d.map=null},getSize:function(){var b=null;if(this.size!=null){b=this.size.clone()}return b},updateSize:function(){this.events.clearMouseCache();var o=this.getCurrentSize();var l=this.getSize();if(l==null){this.size=l=o}if(!o.equals(l)){this.size=o;for(var n=0,i=this.layers.length;n<i;n++){this.layers[n].onMapResize()}if(this.baseLayer!=null){var j=new OpenLayers.Pixel(o.w/2,o.h/2);var k=this.getLonLatFromViewPortPx(j);var m=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),m)}}},getCurrentSize:function(){var d=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(d.w==0&&d.h==0||isNaN(d.w)&&isNaN(d.h)){var c=OpenLayers.Element.getDimensions(this.div);d.w=c.width;d.h=c.height}if(d.w==0&&d.h==0||isNaN(d.w)&&isNaN(d.h)){d.w=parseInt(this.div.style.width);d.h=parseInt(this.div.style.height)}return d},calculateBounds:function(i,g){var k=null;if(i==null){i=this.getCenter()}if(g==null){g=this.getResolution()}if((i!=null)&&(g!=null)){var l=this.getSize();var j=l.w*g;var m=l.h*g;k=new OpenLayers.Bounds(i.lon-j/2,i.lat-m/2,i.lon+j/2,i.lat+m/2)}return k},getCenter:function(){var b=null;if(this.center){b=this.center.clone()}return b},getZoom:function(){return this.zoom},pan:function(l,m,k){k=OpenLayers.Util.applyDefaults(k,{animate:true,dragging:false});var j=this.getViewPortPxFromLonLat(this.getCenter());var g=j.add(l,m);if(!k.dragging||!g.equals(j)){var i=this.getLonLatFromViewPortPx(g);if(k.animate){this.panTo(i)}else{this.setCenter(i,null,k.dragging)}}},panTo:function(e){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(e)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var f=this.getCenter();if(e.lon==f.lon&&e.lat==f.lat){return}var g={lon:f.lon,lat:f.lat};var i={lon:e.lon,lat:e.lat};this.panTween.start(g,i,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(a){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(a){a=new OpenLayers.LonLat(a.lon,a.lat);this.moveTo(a,this.zoom,{dragging:true,noEvent:true})},this),done:OpenLayers.Function.bind(function(a){a=new OpenLayers.LonLat(a.lon,a.lat);this.moveTo(a,this.zoom,{noEvent:true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(e)}},setCenter:function(i,f,e,g){this.moveTo(i,f,{dragging:e,forceZoomChange:g,caller:"setCenter"})},moveTo:function(C,u,J){if(!J){J={}}var v=J.dragging;var G=J.forceZoomChange;var B=J.noEvent;if(this.panTween&&J.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(C)){C=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(C==null){C=this.getCenter()}if(u==null){u=this.getZoom()}var F=this.getResolutionForZoom(u);var t=this.calculateBounds(C,F);if(!this.restrictedExtent.containsBounds(t)){var i=this.restrictedExtent.getCenterLonLat();if(t.getWidth()>this.restrictedExtent.getWidth()){C=new OpenLayers.LonLat(i.lon,C.lat)}else{if(t.left<this.restrictedExtent.left){C=C.add(this.restrictedExtent.left-t.left,0)}else{if(t.right>this.restrictedExtent.right){C=C.add(this.restrictedExtent.right-t.right,0)}}}if(t.getHeight()>this.restrictedExtent.getHeight()){C=new OpenLayers.LonLat(C.lon,i.lat)}else{if(t.bottom<this.restrictedExtent.bottom){C=C.add(0,this.restrictedExtent.bottom-t.bottom)}else{if(t.top>this.restrictedExtent.top){C=C.add(0,this.restrictedExtent.top-t.top)}}}}}var H=G||((this.isValidZoomLevel(u))&&(u!=this.getZoom()));var E=(this.isValidLonLat(C))&&(!C.equals(this.center));if(H||E||!v){if(!this.dragging&&!B){this.events.triggerEvent("movestart")}if(E){if((!H)&&(this.center)){this.centerLayerContainer(C)}this.center=C.clone()}if((H)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(H){this.zoom=u;this.resolution=this.getResolutionForZoom(u);this.viewRequestID++}var I=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(I,H,v);if(v){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:H})}}I=this.baseLayer.getExtent();for(var D=0,z=this.layers.length;D<z;D++){var A=this.layers[D];if(A!==this.baseLayer&&!A.isBaseLayer){var w=A.calculateInRange();if(A.inRange!=w){A.inRange=w;if(!w){A.display(false)}this.events.triggerEvent("changelayer",{layer:A,property:"visibility"})}if(w&&A.visibility){A.moveTo(I,H,v);if(v){A.events.triggerEvent("move")}else{A.events.triggerEvent("moveend",{zoomChanged:H})}}}}if(H){for(var D=0,z=this.popups.length;D<z;D++){this.popups[D].updatePosition()}}this.events.triggerEvent("move");if(H){this.events.triggerEvent("zoomend")}}if(!v&&!B){this.events.triggerEvent("moveend")}this.dragging=!!v},centerLayerContainer:function(d){var e=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var f=this.getViewPortPxFromLonLat(d);if((e!=null)&&(f!=null)){this.layerContainerDiv.style.left=Math.round(e.x-f.x)+"px";this.layerContainerDiv.style.top=Math.round(e.y-f.y)+"px"}},isValidZoomLevel:function(b){return((b!=null)&&(b>=0)&&(b<this.getNumZoomLevels()))},isValidLonLat:function(f){var d=false;if(f!=null){var e=this.getMaxExtent();d=e.containsLonLat(f)}return d},getProjection:function(){var b=this.getProjectionObject();return b?b.getCode():null},getProjectionObject:function(){var b=null;if(this.baseLayer!=null){b=this.baseLayer.projection}return b},getMaxResolution:function(){var b=null;if(this.baseLayer!=null){b=this.baseLayer.maxResolution}return b},getMaxExtent:function(c){var d=null;if(c&&c.restricted&&this.restrictedExtent){d=this.restrictedExtent}else{if(this.baseLayer!=null){d=this.baseLayer.maxExtent}}return d},getNumZoomLevels:function(){var b=null;if(this.baseLayer!=null){b=this.baseLayer.numZoomLevels}return b},getExtent:function(){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getExtent()}return b},getResolution:function(){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getResolution()}return b},getUnits:function(){var b=null;if(this.baseLayer!=null){b=this.baseLayer.units}return b},getScale:function(){var f=null;if(this.baseLayer!=null){var d=this.getResolution();var e=this.baseLayer.units;f=OpenLayers.Util.getScaleFromResolution(d,e)}return f},getZoomForExtent:function(f,d){var e=null;if(this.baseLayer!=null){e=this.baseLayer.getZoomForExtent(f,d)}return e},getResolutionForZoom:function(c){var d=null;if(this.baseLayer){d=this.baseLayer.getResolutionForZoom(c)}return d},getZoomForResolution:function(e,f){var d=null;if(this.baseLayer!=null){d=this.baseLayer.getZoomForResolution(e,f)}return d},zoomTo:function(b){if(this.isValidZoomLevel(b)){this.setCenter(null,b)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(g,i){var e=g.getCenterLonLat();if(this.baseLayer.wrapDateLine){var f=this.getMaxExtent();g=g.clone();while(g.right<g.left){g.right+=f.getWidth()}e=g.getCenterLonLat().wrapDateLine(f)}this.setCenter(e,this.getZoomForExtent(g,i))},zoomToMaxExtent:function(f){var d=(f)?f.restricted:true;var e=this.getMaxExtent({restricted:d});this.zoomToExtent(e)},zoomToScale:function(l,m){var q=OpenLayers.Util.getResolutionFromScale(l,this.baseLayer.units);var r=this.getSize();var n=r.w*q;var j=r.h*q;var k=this.getCenter();var o=new OpenLayers.Bounds(k.lon-n/2,k.lat-j/2,k.lon+n/2,k.lat+j/2);this.zoomToExtent(o,m)},getLonLatFromViewPortPx:function(d){var c=null;if(this.baseLayer!=null){c=this.baseLayer.getLonLatFromViewPortPx(d)}return c},getViewPortPxFromLonLat:function(c){var d=null;if(this.baseLayer!=null){d=this.baseLayer.getViewPortPxFromLonLat(c)}return d},getLonLatFromPixel:function(b){return this.getLonLatFromViewPortPx(b)},getPixelFromLonLat:function(c){var d=this.getViewPortPxFromLonLat(c);d.x=Math.round(d.x);d.y=Math.round(d.y);return d},getViewPortPxFromLayerPx:function(g){var i=null;if(g!=null){var e=parseInt(this.layerContainerDiv.style.left);var f=parseInt(this.layerContainerDiv.style.top);i=g.add(e,f)}return i},getLayerPxFromViewPortPx:function(i){var g=null;if(i!=null){var e=-parseInt(this.layerContainerDiv.style.left);var f=-parseInt(this.layerContainerDiv.style.top);g=i.add(e,f);if(isNaN(g.x)||isNaN(g.y)){g=null}}return g},getLonLatFromLayerPx:function(b){b=this.getViewPortPxFromLayerPx(b);return this.getLonLatFromViewPortPx(b)},getLayerPxFromLonLat:function(c){var d=this.getPixelFromLonLat(c);return this.getLayerPxFromViewPortPx(d)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(f,d){this.lonlat=f;var e=(d)?d:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=e}else{this.icon.url=e.url;this.icon.size=e.size;this.icon.offset=e.offset;this.icon.calculateOffset=e.calculateOffset}this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null}},draw:function(b){return this.icon.draw(b)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(b){if((b!=null)&&(this.icon!=null)){this.icon.moveTo(b)}this.lonlat=this.map.getLonLatFromLayerPx(b)},isDrawn:function(){var b=(this.icon&&this.icon.isDrawn());return b},onScreen:function(){var c=false;if(this.map){var d=this.map.getExtent();c=d.containsLonLat(this.lonlat)}return c},inflate:function(c){if(this.icon){var d=new OpenLayers.Size(this.icon.size.w*c,this.icon.size.h*c);this.icon.setSize(d)}},setOpacity:function(b){this.icon.setOpacity(b)},setUrl:function(b){this.icon.setUrl(b)},display:function(b){this.icon.display(b)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var e=OpenLayers.Util.getImagesLocation()+"marker.png";var d=new OpenLayers.Size(21,25);var f=function(a){return new OpenLayers.Pixel(-(a.w/2),-a.h)};return new OpenLayers.Icon(e,d,null,f)};OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),initialize:function(k,o,l,i,j,m,n){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative.png";OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(u){var r=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});u=OpenLayers.Util.applyDefaults(u,r);var s=new OpenLayers.Request.XMLHttpRequest();var z=u.url;if(u.params){var t=OpenLayers.Util.getParameterString(u.params);if(t.length>0){var o=(z.indexOf("?")>-1)?"&":"?";z+=o+t}}if(u.proxy&&(z.indexOf("http")==0)){z=u.proxy+encodeURIComponent(z)}s.open(u.method,z,u.async,u.user,u.password);for(var q in u.headers){s.setRequestHeader(q,u.headers[q])}var w=(u.scope)?OpenLayers.Function.bind(u.callback,u.scope):u.callback;var n;if(u.success){n=(u.scope)?OpenLayers.Function.bind(u.success,u.scope):u.success}var v;if(u.failure){v=(u.scope)?OpenLayers.Function.bind(u.failure,u.scope):u.failure}var m=this.events;s.onreadystatechange=function(){if(s.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var a=m.triggerEvent("complete",{request:s,config:u,requestUrl:z});if(a!==false){w(s);if(!s.status||(s.status>=200&&s.status<300)){m.triggerEvent("success",{request:s,config:u,requestUrl:z});if(n){n(s)}}if(s.status&&(s.status<200||s.status>=300)){m.triggerEvent("failure",{request:s,config:u,requestUrl:z});if(v){v(s)}}}}};if(u.async===false){s.send(u.data)}else{window.setTimeout(function(){s.send(u.data)},0)}return s},GET:function(b){b=OpenLayers.Util.extend(b,{method:"GET"});return OpenLayers.Request.issue(b)},POST:function(b){b=OpenLayers.Util.extend(b,{method:"POST"});b.headers=b.headers?b.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(b.headers))){b.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(b)},PUT:function(b){b=OpenLayers.Util.extend(b,{method:"PUT"});b.headers=b.headers?b.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(b.headers))){b.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(b)},DELETE:function(b){b=OpenLayers.Util.extend(b,{method:"DELETE"});return OpenLayers.Request.issue(b)},HEAD:function(b){b=OpenLayers.Util.extend(b,{method:"HEAD"});return OpenLayers.Request.issue(b)},OPTIONS:function(b){b=OpenLayers.Util.extend(b,{method:"OPTIONS"});return OpenLayers.Request.issue(b)}};OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(j,g,i,f,k){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=f;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id)}OpenLayers.Event.stopObservingElement(this.imgDiv.id);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null;this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)}this.frame=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null}this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(b){if(b==null){b=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}b=OpenLayers.Tile.prototype.clone.apply(this,[b]);b.imgDiv=null;return b},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var b=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(b){if(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();this.backBufferTile.isBackBuffer=true;this.events.register("loadend",this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer)}this.startTransition()}else{if(this.backBufferTile){this.backBufferTile.clear()}}}else{if(b&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!b){return false}if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}return this.renderTile()},resetBackBuffer:function(){this.showTile();if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=false;var d=this.layer.maxExtent;var c=(d&&this.bounds.intersectsBounds(d,false));if(c){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.imageSize||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBufferTile.resolution=this.layer.getResolution();this.backBufferTile.renderTile()}this.backBufferTile.hide()}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.async){this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);this.positionImage()}return true},positionImage:function(){if(this.layer==null){return}OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var b=this.layer.getImageSize();if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,b,this.url)}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,b);this.imgDiv.src=this.url}},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image.useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}}},initImgDiv:function(){var g=this.layer.imageOffset;var e=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,g,e,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,g,e,null,"relative",null,null,true)}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var i=function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("loadend")}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(i,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(i,this))}var f=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){i.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(f,this))},checkImgURL:function(){if(this.layer){var b=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(b,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}var l=1;if(this.backBufferTile.resolution){l=this.backBufferTile.resolution/this.layer.getResolution()}if(l!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var m=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var g=new OpenLayers.Size(this.backBufferTile.size.w*l,this.backBufferTile.size.h*l);var i=this.layer.map.getLayerPxFromLonLat(m);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,i,g);var k=this.backBufferTile.imageSize;k=new OpenLayers.Size(k.w*l,k.h*l);var j=this.backBufferTile.imageOffset;if(j){j=new OpenLayers.Pixel(j.x*l,j.y*l)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,j,k);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=l},show:function(){this.frame.style.display="";if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scrollLeft}}},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:false,handlers:null,resolutionFactor:1,initialize:function(b){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[b])},destroy:function(){if(!this.mapDiv){return}this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.extentRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy();this.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeChild(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null}if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null}this.map.events.un({moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var l=this.map.baseLayer.clone();this.layers=[l]}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div}}this.element=document.createElement("div");this.element.className=this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var k=OpenLayers.Util.getImagesLocation();var g=k+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),g,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var g=k+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),g,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var j=["dblclick","mousedown"];for(var m=0,i=j.length;m<i;m++){OpenLayers.Event.observe(this.maximizeDiv,j[m],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,j[m],OpenLayers.Event.stop)}this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.register("moveend",this,this.update);return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(k){var q=this.handlers.drag.last.x-k.x;var s=this.handlers.drag.last.y-k.y;if(q!=0||s!=0){var m=this.rectPxBounds.top;var t=this.rectPxBounds.left;var o=Math.abs(this.rectPxBounds.getHeight());var r=this.rectPxBounds.getWidth();var n=Math.max(0,(m-s));n=Math.min(n,this.ovmap.size.h-this.hComp-o);var l=Math.max(0,(t-q));l=Math.min(l,this.ovmap.size.w-this.wComp-r);this.setRectPxBounds(new OpenLayers.Bounds(l,n+o,l+r,n))}},mapDivClick:function(m){var u=this.rectPxBounds.getCenterPixel();var r=m.xy.x-u.x;var s=m.xy.y-u.y;var o=this.rectPxBounds.top;var t=this.rectPxBounds.left;var l=Math.abs(this.rectPxBounds.getHeight());var v=this.rectPxBounds.getWidth();var q=Math.max(0,(o+s));q=Math.min(q,this.ovmap.size.h-l);var n=Math.max(0,(t+r));n=Math.min(n,this.ovmap.size.w-v);this.setRectPxBounds(new OpenLayers.Bounds(n,q+l,n+v,q));this.updateMapToRect()},maximizeControl:function(b){this.element.style.display="";this.showToggle(false);if(b!=null){OpenLayers.Event.stop(b)}},minimizeControl:function(b){this.element.style.display="none";this.showToggle(true);if(b!=null){OpenLayers.Event.stop(b)}},showToggle:function(b){this.maximizeDiv.style.display=b?"":"none";this.minimizeDiv.style.display=b?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var e=this.map.getExtent();var f=this.map.maxExtent;var i=new OpenLayers.Bounds(Math.max(e.left,f.left),Math.max(e.bottom,f.bottom),Math.min(e.right,f.right),Math.min(e.top,f.top));if(this.ovmap.getProjection()!=this.map.getProjection()){i=i.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var g=this.ovmap.getResolution()/this.map.getResolution();return((g>this.minRatio)&&(g<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(i)))},updateOverview:function(){var i=this.map.getResolution();var e=this.ovmap.getResolution();var g=e/i;if(g>this.maxRatio){e=this.minRatio*i}else{if(g<=this.minRatio){e=this.maxRatio*i}}var f;if(this.ovmap.getProjection()!=this.map.getProjection()){f=this.map.center.clone();f.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{f=this.map.center}this.ovmap.setCenter(f,this.ovmap.getZoomForResolution(e*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var d=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,d);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:true,"double":false,stopSingle:true,stopDouble:true,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(a){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(a){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var f=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var e=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=f&&e?OpenLayers.INCHES_PER_UNIT[f]/OpenLayers.INCHES_PER_UNIT[e]:1}},updateRectToMap:function(){var c;if(this.ovmap.getProjection()!=this.map.getProjection()){c=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{c=this.map.getExtent()}var d=this.getRectBoundsFromMapBounds(c);if(d){this.setRectPxBounds(d)}},updateMapToRect:function(){var b=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){b=b.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(b.getCenterLonLat())},setRectPxBounds:function(q){var m=Math.max(q.top,0);var o=Math.max(q.left,0);var s=Math.min(q.top+Math.abs(q.getHeight()),this.ovmap.size.h-this.hComp);var l=Math.min(q.left+q.getWidth(),this.ovmap.size.w-this.wComp);var r=Math.max(l-o,0);var k=Math.max(s-m,0);if(r<this.minRectSize||k<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var n=o+(r/2)-(this.minRectSize/2);var t=m+(k/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(t)+"px";this.extentRectangle.style.left=Math.round(n)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(m)+"px";this.extentRectangle.style.left=Math.round(o)+"px";this.extentRectangle.style.height=Math.round(k)+"px";this.extentRectangle.style.width=Math.round(r)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(o),Math.round(s),Math.round(l),Math.round(m))},getRectBoundsFromMapBounds:function(l){var i=new OpenLayers.LonLat(l.left,l.bottom);var j=new OpenLayers.LonLat(l.right,l.top);var m=this.getOverviewPxFromLonLat(i);var g=this.getOverviewPxFromLonLat(j);var k=null;if(m&&g){k=new OpenLayers.Bounds(m.x,m.y,g.x,g.y)}return k},getMapBoundsFromRectBounds:function(j){var k=new OpenLayers.Pixel(j.left,j.bottom);var f=new OpenLayers.Pixel(j.right,j.top);var g=this.getLonLatFromOverviewPx(k);var i=this.getLonLatFromOverviewPx(f);return new OpenLayers.Bounds(g.lon,g.lat,i.lon,i.lat)},getLonLatFromOverviewPx:function(j){var m=this.ovmap.size;var g=this.ovmap.getResolution();var i=this.ovmap.getExtent().getCenterLonLat();var k=j.x-(m.w/2);var l=j.y-(m.h/2);return new OpenLayers.LonLat(i.lon+k*g,i.lat-l*g)},getOverviewPxFromLonLat:function(g){var e=this.ovmap.getResolution();var i=this.ovmap.getExtent();var f=null;if(i){f=new OpenLayers.Pixel(Math.round(1/e*(g.lon-i.left)),Math.round(1/e*(i.top-g.lat)))}return f},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(e,f,d){this.layer=e;this.lonlat=f;this.data=(d!=null)?d:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)}}this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null}if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null}},onScreen:function(){var c=false;if((this.layer!=null)&&(this.layer.map!=null)){var d=this.layer.map.getExtent();c=d.containsLonLat(this.lonlat)}return c},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)}return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(d){if(this.lonlat!=null){var f=this.id+"_popup";var e=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(f,this.lonlat,this.data.popupSize,this.data.popupContentHTML,e,d)}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow}this.popup.feature=this}return this.popup},destroyPopup:function(){if(this.popup){this.popup.feature=null;this.popup.destroy();this.popup=null}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,stopSingle:false,stopDouble:false,timerId:null,down:null,rightclickTimerId:null,initialize:function(f,d,e){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(a){this.down=a.xy;return true}}},mousedown:null,mouseup:function(c){var d=true;if(this.checkModifiers(c)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(c)){d=this.rightclick(c)}return d},rightclick:function(d){if(this.passesTolerance(d)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[d]);return !this.stopDouble}else{var e=this["double"]?OpenLayers.Util.extend({},d):this.callback("rightclick",[d]);var f=OpenLayers.Function.bind(this.delayedRightCall,this,e);this.rightclickTimerId=window.setTimeout(f,this.delay)}}return !this.stopSingle},delayedRightCall:function(b){this.rightclickTimerId=null;if(b){this.callback("rightclick",[b])}return !this.stopSingle},dblclick:function(b){if(this.passesTolerance(b)){if(this["double"]){this.callback("dblclick",[b])}this.clearTimer()}return !this.stopDouble},click:function(c){if(this.passesTolerance(c)){if(this.timerId!=null){this.clearTimer()}else{var d=this.single?OpenLayers.Util.extend({},c):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,d),this.delay)}}return !this.stopSingle},passesTolerance:function(d){var f=true;if(this.pixelTolerance!=null&&this.down){var e=Math.sqrt(Math.pow(this.down.x-d.xy.x,2)+Math.pow(this.down.y-d.xy.y,2));if(e>this.pixelTolerance){f=false}}return f},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}if(this.rightclickTimerId!=null){window.clearTimeout(this.rightclickTimerId);this.rightclickTimerId=null}},delayedCall:function(b){this.timerId=null;if(b){this.callback("click",[b])}},deactivate:function(){var b=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;b=true}return b},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(f,d,e){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(b){},move:function(b){},up:function(b){},out:function(b){},mousedown:function(c){var d=true;this.dragging=false;if(this.checkModifiers(c)&&OpenLayers.Event.isLeftClick(c)){this.started=true;this.start=c.xy;this.last=c.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(c);this.callback("down",[c.xy]);OpenLayers.Event.stop(c);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return true};document.onselectstart=function(){return false}}d=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return d},mousemove:function(b){if(this.started&&!this.timeoutId&&(b.xy.x!=this.last.x||b.xy.y!=this.last.y)){if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(b);this.callback("move",[b.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=function(){return false}}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(c){if(this.started){var d=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(c);this.callback("up",[c.xy]);if(d){this.callback("done",[c.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(c){if(this.started&&OpenLayers.Util.mouseLeft(c,this.map.div)){var d=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(c);this.callback("out",[]);if(d){this.callback("done",[c.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}return true},click:function(b){return(this.start==this.last)},activate:function(){var b=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;b=true}return b},deactivate:function(){var b=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;b=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return b},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:false,initialize:function(g,e,i,f){OpenLayers.Handler.prototype.initialize.apply(this,[g,i,f]);this.layer=e},mousedown:function(b){this.down=b.xy;return this.handle(b)?!this.stopDown:true},mouseup:function(b){this.up=b.xy;return this.handle(b)?!this.stopUp:true},click:function(b){return this.handle(b)?!this.stopClick:true},mousemove:function(b){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(b);return true},dblclick:function(b){return !this.handle(b)},geometryTypeMatches:function(b){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,b.geometry.CLASS_NAME)>-1},handle:function(i){if(this.feature&&!this.feature.layer){this.feature=null}var m=i.type;var j=false;var k=!!(this.feature);var l=(m=="click"||m=="dblclick");this.feature=this.layer.getFeatureFromEvent(i);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var g=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(k&&g){if(this.lastFeature){this.triggerCallback(m,"out",[this.lastFeature])}this.triggerCallback(m,"in",[this.feature])}else{if(!k||l){this.triggerCallback(m,"in",[this.feature])}}this.lastFeature=this.feature;j=true}else{if(this.lastFeature&&(k&&g||l)){this.triggerCallback(m,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(k||l)){this.triggerCallback(m,"out",[this.lastFeature])}}return j},triggerCallback:function(j,i,f){var k=this.EVENTMAP[j][i];if(k){if(j=="click"&&this.up&&this.down){var g=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(g<=this.clickTolerance){this.callback(k,f)}}else{this.callback(k,f)}}},activate:function(){var b=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});b=true}return b},deactivate:function(){var b=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();this.feature=null;this.lastFeature=null;this.down=null;this.up=null;this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});b=true}return b},handleMapEvents:function(b){if(!b.property||b.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var b=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(b)},moveLayerBack:function(){var b=this.layer.getZIndex()-1;if(b>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(b)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(f,d,e){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var c=0,d=this.KEY_EVENTS.length;c<d;c++){OpenLayers.Event.observe(document,this.KEY_EVENTS[c],this.eventListener)}return true}else{return false}},deactivate:function(){var f=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var d=0,e=this.KEY_EVENTS.length;d<e;d++){OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[d],this.eventListener)}f=true}return f},handleKeyEvent:function(b){if(this.checkModifiers(b)){this.callback(b.type,[b])}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(f,d,e){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(i){if(!this.map||!this.checkModifiers(i)){return}var q=false;var e=false;var r=false;var u=OpenLayers.Event.element(i);while((u!=null)&&!r&&!q){if(!q){try{if(u.currentStyle){t=u.currentStyle.overflow}else{var v=document.defaultView.getComputedStyle(u,null);var t=v.getPropertyValue("overflow")}q=(t&&(t=="auto")||(t=="scroll"))}catch(s){}}if(!e){for(var o=0,n=this.map.layers.length;o<n;o++){if(u==this.map.layers[o].div||u==this.map.layers[o].pane){e=true;break}}}r=(u==this.map.div);u=u.parentNode}if(!q&&r){if(e){this.wheelZoom(i)}OpenLayers.Event.stop(i)}},wheelZoom:function(d){var c=0;if(!d){d=window.event}if(d.wheelDelta){c=d.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){c=-c}}else{if(d.detail){c=-d.detail/3}}if(c){if(this.mousePosition){d.xy=this.mousePosition}if(!d.xy){d.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(c<0){this.callback("down",[d,c])}else{this.callback("up",[d,c])}}},mousemove:function(b){this.mousePosition=b.xy},activate:function(d){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var c=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",c);OpenLayers.Event.observe(window,"mousewheel",c);OpenLayers.Event.observe(document,"mousewheel",c);return true}else{return false}},deactivate:function(d){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var c=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",c);OpenLayers.Event.stopObserving(window,"mousewheel",c);OpenLayers.Event.stopObserving(document,"mousewheel",c);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(c,d){this.addOptions(d);this.name=c;if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLayers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.div.dir="ltr";this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}}if(this.wrapDateLine){this.displayOutsideMaxExtent=true}},destroy:function(b){if(b==null){b=true}if(this.map!=null){this.map.removeLayer(this,b)}this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},clone:function(b){if(b==null){b=new OpenLayers.Layer(this.name,this.options)}OpenLayers.Util.applyDefaults(b,this);b.map=null;return b},setName:function(b){if(b!=this.name){this.name=b;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(b){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,b);OpenLayers.Util.extend(this,b)},onMapResize:function(){},redraw:function(){var d=false;if(this.map){this.inRange=this.calculateInRange();var f=this.getExtent();if(f&&this.inRange&&this.visibility){var e=true;this.moveTo(f,e,false);this.events.triggerEvent("moveend",{zoomChanged:e});d=true}}return d},moveTo:function(e,f,i){var g=this.visibility;if(!this.isBaseLayer){g=g&&this.inRange}this.display(g)},setMap:function(c){if(this.map==null){this.map=c;this.maxExtent=this.maxExtent||this.map.maxExtent;this.projection=this.projection||this.map.projection;if(this.projection&&typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var d=((this.visibility)&&(this.inRange));this.div.style.display=d?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(b){},getImageSize:function(){return(this.imageSize||this.tileSize)},setTileSize:function(d){var c=(d)?d:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=c;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(c.w+(2*this.gutter),c.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(b){if(b!=this.visibility){this.visibility=b;this.display(b);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(d){var c=this.calculateInRange();if(d!=(this.div.style.display!="none")){this.div.style.display=(d&&c)?"block":"none"}},calculateInRange:function(){var c=false;if(this.alwaysInRange){c=true}else{if(this.map){var d=this.map.getResolution();c=((d>=this.minResolution)&&(d<=this.maxResolution))}}return c},setIsBaseLayer:function(b){if(b!=this.isBaseLayer){this.isBaseLayer=b;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var t=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var G=["projection","units"];var D=false;var E={};for(var C=0,z=t.length;C<z;C++){var i=t[C];if(this.options[i]&&OpenLayers.Util.indexOf(G,i)==-1){D=true}E[i]=this.options[i]||this.map[i]}if(this.alwaysInRange==null){this.alwaysInRange=!D}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){E.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){E.resolutions=null}if((!E.numZoomLevels)&&(E.maxZoomLevel)){E.numZoomLevels=E.maxZoomLevel+1}if((E.scales!=null)||(E.resolutions!=null)){if(E.scales!=null){E.resolutions=[];for(var C=0,z=E.scales.length;C<z;C++){var F=E.scales[C];E.resolutions[C]=OpenLayers.Util.getResolutionFromScale(F,E.units)}}E.numZoomLevels=E.resolutions.length}else{if(E.minScale){E.maxResolution=OpenLayers.Util.getResolutionFromScale(E.minScale,E.units)}else{if(E.maxResolution=="auto"){var s=this.map.getSize();var u=E.maxExtent.getWidth()/s.w;var A=E.maxExtent.getHeight()/s.h;E.maxResolution=Math.max(u,A)}}if(E.maxScale!=null){E.minResolution=OpenLayers.Util.getResolutionFromScale(E.maxScale,E.units)}else{if((E.minResolution=="auto")&&(E.minExtent!=null)){var s=this.map.getSize();var u=E.minExtent.getWidth()/s.w;var A=E.minExtent.getHeight()/s.h;E.minResolution=Math.max(u,A)}}if(E.minResolution!=null&&this.options.numZoomLevels==undefined){var v=E.maxResolution/E.minResolution;E.numZoomLevels=Math.floor(Math.log(v)/Math.log(2))+1}E.resolutions=new Array(E.numZoomLevels);var H=2;if(typeof E.minResolution=="number"&&E.numZoomLevels>1){H=Math.pow((E.maxResolution/E.minResolution),(1/(E.numZoomLevels-1)))}for(var C=0;C<E.numZoomLevels;C++){var w=E.maxResolution/Math.pow(H,C);E.resolutions[C]=w}}E.resolutions.sort(function(b,a){return(a-b)});this.resolutions=E.resolutions;this.maxResolution=E.resolutions[0];var B=E.resolutions.length-1;this.minResolution=E.resolutions[B];this.scales=[];for(var C=0,z=E.resolutions.length;C<z;C++){this.scales[C]=OpenLayers.Util.getScaleFromResolution(E.resolutions[C],E.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=E.numZoomLevels},getResolution:function(){var b=this.map.getZoom();return this.getResolutionForZoom(b)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(e,i){var g=this.map.getSize();var f=Math.max(e.getWidth()/g.w,e.getHeight()/g.h);return this.getZoomForResolution(f,i)},getDataExtent:function(){},getResolutionForZoom:function(i){i=Math.max(0,Math.min(i,this.resolutions.length-1));var e;if(this.map.fractionalZoom){var f=Math.floor(i);var g=Math.ceil(i);e=this.resolutions[f]-((i-f)*(this.resolutions[f]-this.resolutions[g]))}else{e=this.resolutions[Math.round(i)]}return e},getZoomForResolution:function(z,D){var i;if(this.map.fractionalZoom){var s=0;var B=this.resolutions.length-1;var A=this.resolutions[s];var C=this.resolutions[B];var t;for(var w=0,v=this.resolutions.length;w<v;++w){t=this.resolutions[w];if(t>=z){A=t;s=w}if(t<=z){C=t;B=w;break}}var u=A-C;if(u>0){i=s+((A-z)/u)}else{i=s}}else{var r;var q=Number.POSITIVE_INFINITY;for(var w=0,v=this.resolutions.length;w<v;w++){if(D){r=Math.abs(this.resolutions[w]-z);if(r>q){break}q=r}else{if(this.resolutions[w]<z){break}}}i=Math.max(0,w-1)}return i},getLonLatFromViewPortPx:function(i){var m=null;if(i!=null){var n=this.map.getSize();var j=this.map.getCenter();if(j){var o=this.map.getResolution();var k=i.x-(n.w/2);var l=i.y-(n.h/2);m=new OpenLayers.LonLat(j.lon+k*o,j.lat-l*o);if(this.wrapDateLine){m=m.wrapDateLine(this.maxExtent)}}}return m},getViewPortPxFromLonLat:function(g){var e=null;if(g!=null){var f=this.map.getResolution();var i=this.map.getExtent();e=new OpenLayers.Pixel((1/f*(g.lon-i.left)),(1/f*(i.top-g.lat)))}return e},setOpacity:function(e){if(e!=this.opacity){this.opacity=e;for(var g=0,f=this.div.childNodes.length;g<f;++g){var i=this.div.childNodes[g].firstChild;OpenLayers.Util.modifyDOMElement(i,null,null,null,null,null,null,e)}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(b){this.div.style.zIndex=b},adjustBounds:function(d){if(this.gutter){var e=this.gutter*this.map.getResolution();d=new OpenLayers.Bounds(d.left-e,d.bottom-e,d.right+e,d.top+e)}if(this.wrapDateLine){var f={rightTolerance:this.getResolution()};d=d.wrapDateLine(this.maxExtent,f)}return d},CLASS_NAME:"OpenLayers.Layer"});(function(){var q=window.XMLHttpRequest;var l=!!window.controllers,o=window.document.all&&!window.opera;function r(){this._object=q?new q:new window.ActiveXObject("Microsoft.XMLHTTP")}if(l&&q.wrapped){r.wrapped=q.wrapped}r.UNSENT=0;r.OPENED=1;r.HEADERS_RECEIVED=2;r.LOADING=3;r.DONE=4;r.prototype.readyState=r.UNSENT;r.prototype.responseText="";r.prototype.responseXML=null;r.prototype.status=0;r.prototype.statusText="";r.prototype.onreadystatechange=null;r.onreadystatechange=null;r.onopen=null;r.onsend=null;r.onabort=null;r.prototype.open=function(a,f,b,e,c){this._async=b;var g=this,i=this.readyState;if(o){var d=function(){if(g._object.readyState!=r.DONE){k(g)}};if(b){window.attachEvent("onunload",d)}}this._object.onreadystatechange=function(){if(l&&!b){return}g.readyState=g._object.readyState;m(g);if(g._aborted){g.readyState=r.UNSENT;return}if(g.readyState==r.DONE){k(g);if(o&&b){window.detachEvent("onunload",d)}}if(i!=g.readyState){n(g)}i=g.readyState};if(r.onopen){r.onopen.apply(this,arguments)}this._object.open(a,f,b,e,c);if(!b&&l){this.readyState=r.OPENED;n(this)}};r.prototype.send=function(a){if(r.onsend){r.onsend.apply(this,arguments)}if(a&&a.nodeType){a=window.XMLSerializer?new window.XMLSerializer().serializeToString(a):a.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}if(!this._aborted){this._object.send(a)}if(l&&!this._async){this.readyState=r.OPENED;m(this);while(this.readyState<r.DONE){this.readyState++;n(this);if(this._aborted){return}}}};r.prototype.abort=function(){if(r.onabort){r.onabort.apply(this,arguments)}if(this.readyState>r.UNSENT){this._aborted=true}this._object.abort();k(this)};r.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};r.prototype.getResponseHeader=function(a){return this._object.getResponseHeader(a)};r.prototype.setRequestHeader=function(b,a){if(!this._headers){this._headers={}}this._headers[b]=a;return this._object.setRequestHeader(b,a)};r.prototype.toString=function(){return"[object XMLHttpRequest]"};r.toString=function(){return"[XMLHttpRequest]"};function n(a){if(a.onreadystatechange){a.onreadystatechange.apply(a)}if(r.onreadystatechange){r.onreadystatechange.apply(a)}}function j(a){var b=a.responseXML;if(o&&b&&!b.documentElement&&a.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){b=new ActiveXObject("Microsoft.XMLDOM");b.loadXML(a.responseText)}if(b){if((o&&b.parseError!=0)||(b.documentElement&&b.documentElement.tagName=="parsererror")){return null}}return b}function m(b){try{b.responseText=b._object.responseText}catch(a){}try{b.responseXML=j(b._object)}catch(a){}try{b.status=b._object.status}catch(a){}try{b.statusText=b._object.statusText}catch(a){}}function k(a){a._object.onreadystatechange=new window.Function;delete a._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(b,a){if(!a){a=[]}b.__func=this;b.__func(a[0],a[1],a[2],a[3],a[4]);delete b.__func}}OpenLayers.Request.XMLHttpRequest=r})();OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(c,d){},onDrag:function(c,d){},onComplete:function(c,d){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(c,d){OpenLayers.Control.prototype.initialize.apply(this,[d]);this.layer=c;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(b){if(!this.handlers.drag.dragging){this.feature=b;this.handlers.drag.activate();this.over=true;OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over")}else{if(this.feature.id==b.id){this.over=true}else{this.over=false}}},downFeature:function(b){this.lastPixel=b;this.onStart(this.feature,b)},moveFeature:function(d){var c=this.map.getResolution();this.feature.geometry.move(c*(d.x-this.lastPixel.x),c*(this.lastPixel.y-d.y));this.layer.drawFeature(this.feature);this.lastPixel=d;this.onDrag(this.feature,d)},upFeature:function(b){if(!this.over){this.handlers.drag.deactivate()}},doneDragging:function(b){this.onComplete(this.feature,b)},outFeature:function(b){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");this.feature=null}else{if(this.feature.id==b.id){this.over=false}}},cancel:function(){this.handlers.drag.deactivate();this.over=false},setMap:function(b){this.handlers.drag.setMap(b);this.handlers.feature.setMap(b);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval})},panMap:function(b){this.panned=true;this.map.pan(this.handler.last.x-b.x,this.handler.last.y-b.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(b){if(this.panned){this.panMap(b);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress});this.activate()},defaultKeyPress:function(d){switch(d.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:var c=this.map.getSize();this.map.pan(0,-0.75*c.h);break;case 34:var c=this.map.getSize();this.map.pan(0,0.75*c.h);break;case 35:var c=this.map.getSize();this.map.pan(0.75*c.w,0);break;case 36:var c=this.map.getSize();this.map.pan(-0.75*c.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut();break}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:"default",initialize:function(f,e,d){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,e]);this.lonlat=null;this.geometry=f?f:null;this.state=null;this.attributes={};if(e){this.attributes=OpenLayers.Util.extend(this.attributes,e)}this.style=d?d:null},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null}this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(j){var k=false;if(this.layer&&this.layer.map){var g=this.layer.map.getExtent();if(j){var f=this.geometry.getBounds();k=g.intersectsBounds(f)}else{var i=g.toGeometry();k=i.intersects(this.geometry)}}return k},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(e,g,i){var f=false;if(this.geometry){f=this.geometry.atPoint(e,g,i)}return f},destroyPopup:function(){},move:function(f){if(!this.layer||!this.geometry.move){return}var e;if(f.CLASS_NAME=="OpenLayers.LonLat"){e=this.layer.getViewPortPxFromLonLat(f)}else{e=f}var g=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var i=this.layer.map.getResolution();this.geometry.move(i*(e.x-g.x),i*(g.y-e.y));this.layer.drawFeature(this);return g},toState:function(b){if(b==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=b;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(b==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=b;break}}else{if(b==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=b;break}}else{if(b==OpenLayers.State.UNKNOWN){this.state=b}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}};OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(f,d,e){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var d={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,d,{keyMask:this.keyMask})},setMap:function(b){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(b)}},startBox:function(b){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(j){var l=this.dragHandler.start.x;var g=this.dragHandler.start.y;var m=Math.abs(l-j.x);var i=Math.abs(g-j.y);this.zoomBox.style.width=Math.max(1,m)+"px";this.zoomBox.style.height=Math.max(1,i)+"px";this.zoomBox.style.left=j.x<l?j.x+"px":l+"px";this.zoomBox.style.top=j.y<g?j.y+"px":g+"px";var k=this.getBoxCharacteristics();if(k.newBoxModel){if(j.x>l){this.zoomBox.style.width=Math.max(1,m-k.xOffset)+"px"}if(j.y>g){this.zoomBox.style.height=Math.max(1,i-k.yOffset)+"px"}}},endBox:function(i){var j;if(Math.abs(this.dragHandler.start.x-i.x)>5||Math.abs(this.dragHandler.start.y-i.y)>5){var k=this.dragHandler.start;var l=Math.min(k.y,i.y);var o=Math.max(k.y,i.y);var m=Math.min(k.x,i.x);var n=Math.max(k.x,i.x);j=new OpenLayers.Bounds(m,o,n,l)}else{j=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[j])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxCharacteristics=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return true}else{return false}},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var e=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var f=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var d=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:e,yOffset:f,newBoxModel:d}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(j,k,i,f){var g=arguments;g=[j,f];OpenLayers.Layer.prototype.initialize.apply(this,g);this.url=k;this.params=OpenLayers.Util.extend({},i)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(b){if(b==null){b=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options)}b=OpenLayers.Layer.prototype.clone.apply(this,[b]);return b},setUrl:function(b){this.url=b},mergeNewParams:function(b){this.params=OpenLayers.Util.extend(this.params,b);return this.redraw()},redraw:function(b){if(b){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(i,j){var k=1;for(var f=0,g=i.length;f<g;f++){k*=i.charCodeAt(f)*this.URL_HASH_FACTOR;k-=Math.floor(k)}return j[Math.floor(k*j.length)]},getFullRequestString:function(n,o){var s=o||this.url;var m=OpenLayers.Util.extend({},this.params);m=OpenLayers.Util.extend(m,n);var t=OpenLayers.Util.getParameterString(m);if(s instanceof Array){s=this.selectUrl(t,s)}var q=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(s));for(var l in m){if(l.toUpperCase() in q){delete m[l]}}t=OpenLayers.Util.getParameterString(m);var k=s;if(t!=""){var r=s.charAt(s.length-1);if((r=="&")||(r=="?")){k+=t}else{if(s.indexOf("?")==-1){k+="?"+t}else{k+="&"+t}}}return k},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:true,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(k,f,i,j,g){this.url=f;this.extent=i;this.maxExtent=i;this.size=j;OpenLayers.Layer.prototype.initialize.apply(this,[k,g]);this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.extent.getWidth()/this.size.w)},destroy:function(){if(this.tile){this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null}OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(b){if(b==null){b=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.options)}b=OpenLayers.Layer.prototype.clone.apply(this,[b]);return b},setMap:function(b){if(this.options.maxResolution==null){this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w}OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(k,i,j){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var g=(this.tile==null);if(i||g){this.setTileSize();var l=new OpenLayers.LonLat(this.extent.left,this.extent.top);var m=this.map.getLayerPxFromLonLat(l);if(g){this.tile=new OpenLayers.Tile.Image(this,m,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=m.clone()}this.tile.draw()}},setTileSize:function(){var c=this.extent.getWidth()/this.map.getResolution();var d=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(c,d)},addTileMonitoringHooks:function(b){b.onLoadStart=function(){this.events.triggerEvent("loadstart")};b.events.register("loadstart",this,b.onLoadStart);b.onLoadEnd=function(){this.events.triggerEvent("loadend")};b.events.register("loadend",this,b.onLoadEnd);b.events.register("unload",this,b.onLoadEnd)},removeTileMonitoringHooks:function(b){b.unload();b.events.un({loadstart:b.onLoadStart,loadend:b.onLoadEnd,unload:b.onLoadEnd,scope:this})},setUrl:function(b){this.url=b;this.tile.draw()},getURL:function(b){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(c,d){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(d){if(d!=this.opacity){this.opacity=d;for(var f=0,e=this.markers.length;f<e;f++){this.markers[f].setOpacity(this.opacity)}}},moveTo:function(j,f,i){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(f||!this.drawn){for(var k=0,g=this.markers.length;k<g;k++){this.drawMarker(this.markers[k])}this.drawn=true}},addMarker:function(b){this.markers.push(b);if(this.opacity!=null){b.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){b.map=this.map;this.drawMarker(b)}},removeMarker:function(b){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,b);b.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(e){var d=this.map.getLayerPxFromLonLat(e.lonlat);if(d==null){e.display(false)}else{if(!e.isDrawn()){var f=e.draw(d);this.div.appendChild(f)}else{if(e.icon){e.icon.moveTo(d)}}}},getDataExtent:function(){var e=null;if(this.markers&&(this.markers.length>0)){var e=new OpenLayers.Bounds();for(var g=0,f=this.markers.length;g<f;g++){var i=this.markers[g];e.extend(i.lonlat)}}return e},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,alwaysZoom:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(w){if(w instanceof OpenLayers.Bounds){if(!this.out){var v=this.map.getLonLatFromPixel(new OpenLayers.Pixel(w.left,w.bottom));var r=this.map.getLonLatFromPixel(new OpenLayers.Pixel(w.right,w.top));var E=new OpenLayers.Bounds(v.lon,v.lat,r.lon,r.lat)}else{var z=Math.abs(w.right-w.left);var u=Math.abs(w.top-w.bottom);var B=Math.min((this.map.size.h/u),(this.map.size.w/z));var q=this.map.getExtent();var F=this.map.getLonLatFromPixel(w.getCenterPixel());var D=F.lon-(q.getWidth()/2)*B;var A=F.lon+(q.getWidth()/2)*B;var s=F.lat-(q.getHeight()/2)*B;var C=F.lat+(q.getHeight()/2)*B;var E=new OpenLayers.Bounds(D,s,A,C)}var t=this.map.getZoom();this.map.zoomToExtent(E);if(t==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(t+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(w),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(w),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(b){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[b])},read:function(n){var o,q,l;var m=this.regExes.typeStr.exec(n);if(m){q=m[1].toLowerCase();l=m[2];if(this.parse[q]){o=this.parse[q].apply(this,[l])}if(this.internalProjection&&this.externalProjection){if(o&&o.CLASS_NAME=="OpenLayers.Feature.Vector"){o.geometry.transform(this.externalProjection,this.internalProjection)}else{if(o&&q!="geometrycollection"&&typeof o=="object"){for(var r=0,k=o.length;r<k;r++){var i=o[r];i.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return o},write:function(t){var n,i,l,q,s;if(t.constructor==Array){n=t;s=true}else{n=[t];s=false}var r=[];if(s){r.push("GEOMETRYCOLLECTION(")}for(var o=0,m=n.length;o<m;++o){if(s&&o>0){r.push(",")}i=n[o].geometry;l=i.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[l]){return null}if(this.internalProjection&&this.externalProjection){i=i.clone();i.transform(this.internalProjection,this.externalProjection)}q=this.extract[l].apply(this,[i]);r.push(l.toUpperCase()+"("+q+")")}if(s){r.push(")")}return r.join("")},extract:{point:function(b){return b.x+" "+b.y},multipoint:function(i){var g=[];for(var e=0,f=i.components.length;e<f;++e){g.push(this.extract.point.apply(this,[i.components[e]]))}return g.join(",")},linestring:function(e){var g=[];for(var i=0,f=e.components.length;i<f;++i){g.push(this.extract.point.apply(this,[e.components[i]]))}return g.join(",")},multilinestring:function(i){var g=[];for(var e=0,f=i.components.length;e<f;++e){g.push("("+this.extract.linestring.apply(this,[i.components[e]])+")")}return g.join(",")},polygon:function(i){var g=[];for(var e=0,f=i.components.length;e<f;++e){g.push("("+this.extract.linestring.apply(this,[i.components[e]])+")")}return g.join(",")},multipolygon:function(g){var i=[];for(var e=0,f=g.components.length;e<f;++e){i.push("("+this.extract.polygon.apply(this,[g.components[e]])+")")}return i.join(",")}},parse:{point:function(c){var d=OpenLayers.String.trim(c).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(d[0],d[1]))},multipoint:function(i){var k=OpenLayers.String.trim(i).split(",");var j=[];for(var f=0,g=k.length;f<g;++f){j.push(this.parse.point.apply(this,[k[f]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(j))},linestring:function(i){var k=OpenLayers.String.trim(i).split(",");var j=[];for(var f=0,g=k.length;f<g;++f){j.push(this.parse.point.apply(this,[k[f]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(j))},multilinestring:function(j){var m;var g=OpenLayers.String.trim(j).split(this.regExes.parenComma);var k=[];for(var l=0,i=g.length;l<i;++l){m=g[l].replace(this.regExes.trimParens,"$1");k.push(this.parse.linestring.apply(this,[m]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(k))},polygon:function(l){var r,i,n;var m=OpenLayers.String.trim(l).split(this.regExes.parenComma);var o=[];for(var q=0,k=m.length;q<k;++q){r=m[q].replace(this.regExes.trimParens,"$1");i=this.parse.linestring.apply(this,[r]).geometry;n=new OpenLayers.Geometry.LinearRing(i.components);o.push(n)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(o))},multipolygon:function(j){var l;var g=OpenLayers.String.trim(j).split(this.regExes.doubleParenComma);var k=[];for(var m=0,i=g.length;m<i;++m){l=g[m].replace(this.regExes.trimParens,"$1");k.push(this.parse.polygon.apply(this,[l]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(k))},geometrycollection:function(i){i=i.replace(/,\s*([A-Za-z])/g,"|$1");var j=OpenLayers.String.trim(i).split("|");var k=[];for(var f=0,g=j.length;f<g;++f){k.push(OpenLayers.Format.WKT.prototype.read.apply(this,[j[f]]))}return k}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(i,e,g,f){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[]},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var j=0,g=this.grid.length;j<g;j++){var k=this.grid[j];for(var m=0,i=k.length;m<i;m++){var l=k[m];this.removeTileMonitoringHooks(l);l.destroy()}}this.grid=[]}},clone:function(b){if(b==null){b=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)}b=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[b]);if(this.tileSize!=null){b.tileSize=this.tileSize.clone()}b.grid=[];return b},moveTo:function(j,g,i){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);j=j||this.map.getExtent();if(j!=null){var k=!this.grid.length||g;var f=this.getTilesBounds();if(this.singleTile){if(k||(!i&&!f.containsBounds(j))){this.initSingleTile(j)}}else{if(k||!f.containsBounds(j,true)){this.initGriddedTiles(j)}else{this.moveGriddedTiles(j)}}}},setTileSize:function(b){if(this.singleTile){b=this.map.getSize().clone();b.h=parseInt(b.h*this.ratio);b.w=parseInt(b.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[b])},getGridBounds:function(){var b="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(b);return this.getTilesBounds()},getTilesBounds:function(){var i=null;if(this.grid.length){var g=this.grid.length-1;var j=this.grid[g][0];var f=this.grid[0].length-1;var k=this.grid[0][f];i=new OpenLayers.Bounds(j.bounds.left,j.bounds.bottom,k.bounds.right,k.bounds.top)}return i},initSingleTile:function(n){var k=n.getCenterLonLat();var l=n.getWidth()*this.ratio;var j=n.getHeight()*this.ratio;var m=new OpenLayers.Bounds(k.lon-(l/2),k.lat-(j/2),k.lon+(l/2),k.lat+(j/2));var q=new OpenLayers.LonLat(m.left,m.top);var r=this.map.getLayerPxFromLonLat(q);if(!this.grid.length){this.grid[0]=[]}var o=this.grid[0][0];if(!o){o=this.addTile(m,r);this.addTileMonitoringHooks(o);o.draw();this.grid[0][0]=o}else{o.moveTo(m,r)}this.removeExcessTiles(1,1)},calculateGridLayout:function(H,r,D){var v=D*this.tileSize.w;var F=D*this.tileSize.h;var z=H.left-r.left;var u=Math.floor(z/v)-this.buffer;var w=z/v-u;var C=-w*this.tileSize.w;var t=r.left+u*v;var G=H.top-(r.bottom+F);var A=Math.ceil(G/F)+this.buffer;var s=A-G/F;var E=-s*this.tileSize.h;var B=r.bottom+A*F;return{tilelon:v,tilelat:F,tileoffsetlon:t,tileoffsetlat:B,tileoffsetx:C,tileoffsety:E}},initGriddedTiles:function(aa){var ac=this.map.getSize();var D=Math.ceil(ac.h/this.tileSize.h)+Math.max(1,2*this.buffer);var M=Math.ceil(ac.w/this.tileSize.w)+Math.max(1,2*this.buffer);var P=this.maxExtent;var H=this.map.getResolution();var I=this.calculateGridLayout(aa,P,H);var ad=Math.round(I.tileoffsetx);var ag=Math.round(I.tileoffsety);var V=I.tileoffsetlon;var R=I.tileoffsetlat;var ae=I.tilelon;var W=I.tilelat;this.origin=new OpenLayers.Pixel(ad,ag);var E=ad;var Q=V;var F=0;var ai=parseInt(this.map.layerContainerDiv.style.left);var G=parseInt(this.map.layerContainerDiv.style.top);do{var ab=this.grid[F++];if(!ab){ab=[];this.grid.push(ab)}V=Q;ad=E;var af=0;do{var ah=new OpenLayers.Bounds(V,R,V+ae,R+W);var T=ad;T-=ai;var U=ag;U-=G;var K=new OpenLayers.Pixel(T,U);var J=ab[af++];if(!J){J=this.addTile(ah,K);this.addTileMonitoringHooks(J);ab.push(J)}else{J.moveTo(ah,K,false)}V+=ae;ad+=this.tileSize.w}while((V<=aa.right+ae*this.buffer)||af<M);R-=W;ag+=this.tileSize.h}while((R>=aa.bottom-W*this.buffer)||F<D);this.removeExcessTiles(F,af);this.spiralTileLoad()},spiralTileLoad:function(){var w=[];var q=["right","down","left","up"];var r=0;var z=-1;var n=OpenLayers.Util.indexOf(q,"right");var i=0;while(i<q.length){var o=r;var v=z;switch(q[n]){case"right":v++;break;case"down":o++;break;case"left":v--;break;case"up":o--;break}var s=null;if((o<this.grid.length)&&(o>=0)&&(v<this.grid[0].length)&&(v>=0)){s=this.grid[o][v]}if((s!=null)&&(!s.queued)){w.unshift(s);s.queued=true;i=0;r=o;z=v}else{n=(n+1)%4;i++}}for(var u=0,t=w.length;u<t;u++){var s=w[u];s.draw();s.queued=false}},addTile:function(c,d){},addTileMonitoringHooks:function(b){b.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};b.events.register("loadstart",this,b.onLoadStart);b.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};b.events.register("loadend",this,b.onLoadEnd);b.events.register("unload",this,b.onLoadEnd)},removeTileMonitoringHooks:function(b){b.unload();b.events.un({loadstart:b.onLoadStart,loadend:b.onLoadEnd,unload:b.onLoadEnd,scope:this})},moveGriddedTiles:function(i){var e=this.buffer||1;while(true){var f=this.grid[0][0].position;var g=this.map.getViewPortPxFromLayerPx(f);if(g.x>-this.tileSize.w*(e-1)){this.shiftColumn(true)}else{if(g.x<-this.tileSize.w*e){this.shiftColumn(false)}else{if(g.y>-this.tileSize.h*(e-1)){this.shiftRow(true)}else{if(g.y<-this.tileSize.h*e){this.shiftRow(false)}else{break}}}}}},shiftRow:function(i){var B=(i)?0:(this.grid.length-1);var C=this.grid;var w=C[B];var z=this.map.getResolution();var u=(i)?-this.tileSize.h:this.tileSize.h;var v=z*-u;var q=(i)?C.pop():C.shift();for(var t=0,r=w.length;t<r;t++){var A=w[t];var D=A.bounds.clone();var s=A.position.clone();D.bottom=D.bottom+v;D.top=D.top+v;s.y=s.y+u;q[t].moveTo(D,s)}if(i){C.unshift(q)}else{C.push(q)}},shiftColumn:function(i){var w=(i)?-this.tileSize.w:this.tileSize.w;var z=this.map.getResolution();var q=z*w;for(var v=0,t=this.grid.length;v<t;v++){var o=this.grid[v];var r=(i)?0:(o.length-1);var A=o[r];var B=A.bounds.clone();var u=A.position.clone();B.left=B.left+q;B.right=B.right+q;u.x=u.x+w;var s=i?this.grid[v].pop():this.grid[v].shift();s.moveTo(B,u);if(i){o.unshift(s)}else{o.push(s)}}},removeExcessTiles:function(k,m){while(this.grid.length>k){var j=this.grid.pop();for(var g=0,i=j.length;g<i;g++){var l=j[g];this.removeTileMonitoringHooks(l);l.destroy()}}while(this.grid[0].length>m){for(var g=0,i=this.grid.length;g<i;g++){var j=this.grid[g];var l=j.pop();this.removeTileMonitoringHooks(l);l.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(q){var r=this.maxExtent;var n=this.getResolution();var o=n*this.tileSize.w;var j=n*this.tileSize.h;var l=this.getLonLatFromViewPortPx(q);var k=r.left+(o*Math.floor((l.lon-r.left)/o));var m=r.bottom+(j*Math.floor((l.lat-r.bottom)/j));return new OpenLayers.Bounds(k,m,k+o,m+j)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,initialize:function(b){this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments)},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(f,e,d){return OpenLayers.Function.bind(function(){f.apply(this,[e,d])},this)},read:function(e){e=OpenLayers.Util.applyDefaults(e,this.options);var d=(e.readWithPOST!==undefined)?e.readWithPOST:this.readWithPOST;var f=new OpenLayers.Protocol.Response({requestType:"read"});if(e.filter&&e.filter instanceof OpenLayers.Filter.Spatial){if(e.filter.type==OpenLayers.Filter.Spatial.BBOX){e.params=OpenLayers.Util.extend(e.params,{bbox:e.filter.value.toArray()})}}if(d){f.priv=OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,f,e),data:OpenLayers.Util.getParameterString(e.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}else{f.priv=OpenLayers.Request.GET({url:e.url,callback:this.createCallback(this.handleRead,f,e),params:e.params,headers:e.headers})}return f},handleRead:function(c,d){this.handleResponse(c,d)},create:function(d,e){e=OpenLayers.Util.applyDefaults(e,this.options);var f=new OpenLayers.Protocol.Response({reqFeatures:d,requestType:"create"});f.priv=OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleCreate,f,e),headers:e.headers,data:this.format.write(d)});return f},handleCreate:function(c,d){this.handleResponse(c,d)},update:function(i,e){var f=e.url||i.url||this.options.url;e=OpenLayers.Util.applyDefaults(e,this.options);var g=new OpenLayers.Protocol.Response({reqFeatures:i,requestType:"update"});g.priv=OpenLayers.Request.PUT({url:f,callback:this.createCallback(this.handleUpdate,g,e),headers:e.headers,data:this.format.write(i)});return g},handleUpdate:function(c,d){this.handleResponse(c,d)},"delete":function(i,e){var f=e.url||i.url||this.options.url;e=OpenLayers.Util.applyDefaults(e,this.options);var g=new OpenLayers.Protocol.Response({reqFeatures:i,requestType:"delete"});g.priv=OpenLayers.Request.DELETE({url:f,callback:this.createCallback(this.handleDelete,g,e),headers:e.headers});return g},handleDelete:function(c,d){this.handleResponse(c,d)},handleResponse:function(f,e){var d=f.priv;if(e.callback){if(d.status>=200&&d.status<300){if(f.requestType!="delete"){f.features=this.parseFeatures(d)}f.code=OpenLayers.Protocol.Response.SUCCESS}else{f.code=OpenLayers.Protocol.Response.FAILURE}e.callback.call(e.scope,f)}},parseFeatures:function(d){var c=d.responseXML;if(!c||!c.documentElement){c=d.responseText}if(!c||c.length<=0){return null}return this.format.read(c)},commit:function(H,J){J=OpenLayers.Util.applyDefaults(J,this.options);var F=[],v=0;var z={};z[OpenLayers.State.INSERT]=[];z[OpenLayers.State.UPDATE]=[];z[OpenLayers.State.DELETE]=[];var i,w,G=[];for(var E=0,A=H.length;E<A;++E){i=H[E];w=z[i.state];if(w){w.push(i);G.push(i)}}var C=(z[OpenLayers.State.INSERT].length>0?1:0)+z[OpenLayers.State.UPDATE].length+z[OpenLayers.State.DELETE].length;var t=true;var I=new OpenLayers.Protocol.Response({reqFeatures:G});function B(c){var d=c.features?c.features.length:0;var a=new Array(d);for(var b=0;b<d;++b){a[b]=c.features[b].fid}I.insertIds=a;u.apply(this,[c])}function u(a){this.callUserCallback(a,J);t=t&&a.success();v++;if(v>=C){if(J.callback){I.code=t?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;J.callback.apply(J.scope,[I])}}}var D=z[OpenLayers.State.INSERT];if(D.length>0){F.push(this.create(D,OpenLayers.Util.applyDefaults({callback:B,scope:this},J.create)))}D=z[OpenLayers.State.UPDATE];for(var E=D.length-1;E>=0;--E){F.push(this.update(D[E],OpenLayers.Util.applyDefaults({callback:u,scope:this},J.update)))}D=z[OpenLayers.State.DELETE];for(var E=D.length-1;E>=0;--E){F.push(this["delete"](D[E],OpenLayers.Util.applyDefaults({callback:u,scope:this},J["delete"])))}return F},abort:function(b){if(b){b.priv.abort()}},callUserCallback:function(f,e){var d=e[f.requestType];if(d&&d.callback){d.callback.call(d.scope,f)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(c,d){OpenLayers.Util.extend(this,d);this.rules=[];if(d&&d.rules){this.addRules(d.rules)}this.setDefaultStyle(c||OpenLayers.Feature.Vector.style["default"])},destroy:function(){for(var c=0,d=this.rules.length;c<d;c++){this.rules[c].destroy();this.rules[c]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(i){var v=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),i);var m=this.rules;var n,u;var t=[];var q=false;for(var s=0,r=m.length;s<r;s++){n=m[s];var o=n.evaluate(i);if(o){if(n instanceof OpenLayers.Rule&&n.elseFilter){t.push(n)}else{q=true;this.applySymbolizer(n,v,i)}}}if(q==false&&t.length>0){q=true;for(var s=0,r=t.length;s<r;s++){this.applySymbolizer(t[s],v,i)}}if(m.length>0&&q==false){v.display="none"}return v},applySymbolizer:function(j,l,g){var i=g.geometry?this.getSymbolizerPrefix(g.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var m=j.symbolizer[i]||j.symbolizer;if(this.defaultsPerSymbolizer===true){var k=this.defaultStyle;OpenLayers.Util.applyDefaults(m,{pointRadius:k.pointRadius});if(m.stroke===true||m.graphic===true){OpenLayers.Util.applyDefaults(m,{strokeWidth:k.strokeWidth,strokeColor:k.strokeColor,strokeOpacity:k.strokeOpacity,strokeDashstyle:k.strokeDashstyle,strokeLinecap:k.strokeLinecap})}if(m.fill===true||m.graphic===true){OpenLayers.Util.applyDefaults(m,{fillColor:k.fillColor,fillOpacity:k.fillOpacity})}if(m.graphic===true){OpenLayers.Util.applyDefaults(m,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}}return this.createLiterals(OpenLayers.Util.extend(l,m),g)},createLiterals:function(g,i){var e=this.context||i.attributes||i.data;for(var f in this.propertyStyles){g[f]=OpenLayers.Style.createLiteral(g[f],e,i)}return g},findPropertyStyles:function(){var q={};var n=this.defaultStyle;this.addPropertyStyles(q,n);var l=this.rules;var o,m;for(var r=0,k=l.length;r<k;r++){o=l[r].symbolizer;for(var i in o){m=o[i];if(typeof m=="object"){this.addPropertyStyles(q,m)}else{this.addPropertyStyles(q,o);break}}}return q},addPropertyStyles:function(e,i){var g;for(var f in i){g=i[f];if(typeof g=="string"&&g.match(/\$\{\w+\}/)){e[f]=true}}return e},addRules:function(b){this.rules=this.rules.concat(b);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(b){this.defaultStyle=b;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(g){var i=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var e=0,f=i.length;e<f;e++){if(g.CLASS_NAME.indexOf(i[e])!=-1){return i[e]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(f,d,e){if(typeof f=="string"&&f.indexOf("${")!=-1){f=OpenLayers.String.format(f,d,[e]);f=(isNaN(f)||!f)?f:parseFloat(f)}return f};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,initialize:function(b){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy()}this.zoomBox=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate()}this.handlers.click.activate();this.zoomBox.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks){this.map.viewPortDiv.oncontextmenu=function(){return false}}var d={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var c={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,d,c);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown});this.activate()},defaultDblClick:function(c){var d=this.map.getLonLatFromViewPortPx(c.xy);this.map.setCenter(d,this.map.zoom+1)},defaultDblRightClick:function(c){var d=this.map.getLonLatFromViewPortPx(c.xy);this.map.setCenter(d,this.map.zoom-1)},wheelChange:function(l,r){var n=this.map.getZoom()+r;if(!this.map.isValidZoomLevel(n)){return}var k=this.map.getSize();var o=k.w/2-l.xy.x;var q=l.xy.y-k.h/2;var m=this.map.baseLayer.getResolutionForZoom(n);var t=this.map.getLonLatFromPixel(l.xy);var s=new OpenLayers.LonLat(t.lon+o*m,t.lat+q*m);this.map.setCenter(s,n)},wheelUp:function(b){this.wheelChange(b,1)},wheelDown:function(b){this.wheelChange(b,-1)},disableZoomWheel:function(){this.zoomWheelEnabled=false;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=true;if(this.active){this.handlers.wheel.activate()}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Filter=OpenLayers.Class({initialize:function(b){OpenLayers.Util.extend(this,b)},destroy:function(){},evaluate:function(b){return true},clone:function(){return null},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(b){if(b){this.bounds=b.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(c){var d=this.getBounds();if(!d){this.setBounds(c)}else{this.bounds.extend(c)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(c,d){},getVertices:function(b){},atPoint:function(o,l,n){var r=false;var q=this.getBounds();if((q!=null)&&(o!=null)){var j=(l!=null)?l:0;var k=(n!=null)?n:0;var m=new OpenLayers.Bounds(this.bounds.left-j,this.bounds.bottom-k,this.bounds.right+j,this.bounds.top+k);r=m.containsLonLat(o)}return r},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(l){var k=arguments.callee.format;if(!k){k=new OpenLayers.Format.WKT();arguments.callee.format=k}var n;var i=k.read(l);if(i instanceof OpenLayers.Feature.Vector){n=i.geometry}else{if(i instanceof Array){var j=i.length;var m=new Array(j);for(var o=0;o<j;++o){m[o]=i[o].geometry}n=new OpenLayers.Geometry.Collection(m)}}return n};OpenLayers.Geometry.segmentsIntersect=function(ao,i,an){var T=an&&an.point;var ad=an&&an.tolerance;var ak=false;var aa=ao.x1-i.x1;var M=ao.y1-i.y1;var ac=ao.x2-ao.x1;var d=ao.y2-ao.y1;var Q=i.y2-i.y1;var ag=i.x2-i.x1;var R=(Q*ac)-(ag*d);var al=(ag*M)-(Q*aa);var am=(ac*M)-(d*aa);if(R==0){if(al==0&&am==0){ak=true}}else{var P=al/R;var V=am/R;if(P>=0&&P<=1&&V>=0&&V<=1){if(!T){ak=true}else{var ai=ao.x1+(P*ac);var aj=ao.y1+(P*d);ak=new OpenLayers.Geometry.Point(ai,aj)}}}if(ad){var U;if(ak){if(T){var ae=[ao,i];var ab,ai,aj;outer:for(var J=0;J<2;++J){ab=ae[J];for(var K=1;K<3;++K){ai=ab["x"+K];aj=ab["y"+K];U=Math.sqrt(Math.pow(ai-ak.x,2)+Math.pow(aj-ak.y,2));if(U<ad){ak.x=ai;ak.y=aj;break outer}}}}}else{var ae=[ao,i];var W,j,ai,aj,af,ah;outer:for(var J=0;J<2;++J){W=ae[J];j=ae[(J+1)%2];for(var K=1;K<3;++K){af={x:W["x"+K],y:W["y"+K]};ah=OpenLayers.Geometry.distanceToSegment(af,j);if(ah.distance<ad){if(T){ak=new OpenLayers.Geometry.Point(af.x,af.y)}else{ak=true}break outer}}}}}return ak};OpenLayers.Geometry.distanceToSegment=function(r,A){var B=r.x;var s=r.y;var C=A.x1;var t=A.y1;var D=A.x2;var w=A.y2;var o=D-C;var q=w-t;var u=((o*(B-C))+(q*(s-t)))/(Math.pow(o,2)+Math.pow(q,2));var v,z;if(u<=0){v=C;z=t}else{if(u>=1){v=D;z=w}else{v=C+u*o;z=t+u*q}}return{distance:Math.sqrt(Math.pow(v-B,2)+Math.pow(z-s,2)),x:v,y:z}};OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",isBaseLayer:true,tileOrigin:null,serverResolutions:null,initialize:function(g,i,e){var f=[];f.push(g,i,{},e);OpenLayers.Layer.Grid.prototype.initialize.apply(this,f)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(b){if(b==null){b=new OpenLayers.Layer.TMS(this.name,this.url,this.options)}b=OpenLayers.Layer.Grid.prototype.clone.apply(this,[b]);return b},getURL:function(n){n=this.adjustBounds(n);var o=this.map.getResolution();var j=Math.round((n.left-this.tileOrigin.lon)/(o*this.tileSize.w));var k=Math.round((n.bottom-this.tileOrigin.lat)/(o*this.tileSize.h));var l=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,o):this.map.getZoom();var m=this.serviceVersion+"/"+this.layername+"/"+l+"/"+j+"/"+k+"."+this.type;var i=this.url;if(i instanceof Array){i=this.selectUrl(m,i)}return i+m},addTile:function(c,d){return new OpenLayers.Tile.Image(this,d,c,null,this.tileSize)},setMap:function(b){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.TMS"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(b){this.symbolizer={};OpenLayers.Util.extend(this,b);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var b in this.symbolizer){this.symbolizer[b]=null}this.symbolizer=null},evaluate:function(i){var e=this.getContext(i);var f=true;if(this.minScaleDenominator||this.maxScaleDenominator){var g=i.layer.map.getScale()}if(this.minScaleDenominator){f=g>=OpenLayers.Style.createLiteral(this.minScaleDenominator,e)}if(f&&this.maxScaleDenominator){f=g<OpenLayers.Style.createLiteral(this.maxScaleDenominator,e)}if(f&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){f=this.filter.evaluate(i)}else{f=this.filter.evaluate(e)}}return f},getContext:function(c){var d=this.context;if(!d){d=c.attributes||c.data}if(typeof this.context=="function"){d=this.context(c)}return d},clone:function(){var d=OpenLayers.Util.extend({},this);d.symbolizer={};for(var c in this.symbolizer){value=this.symbolizer[c];type=typeof value;if(type==="object"){d.symbolizer[c]=OpenLayers.Util.extend({},value)}else{if(type==="string"){d.symbolizer[c]=value}}}d.filter=this.filter&&this.filter.clone();d.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(d)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(f,e){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(f instanceof OpenLayers.Style){this.styles["default"]=f;this.styles.select=f;this.styles.temporary=f;this.styles["delete"]=f}else{if(typeof f=="object"){for(var d in f){if(f[d] instanceof OpenLayers.Style){this.styles[d]=f[d]}else{if(typeof f[d]=="object"){this.styles[d]=new OpenLayers.Style(f[d])}else{this.styles["default"]=new OpenLayers.Style(f);this.styles.select=new OpenLayers.Style(f);this.styles.temporary=new OpenLayers.Style(f);this.styles["delete"]=new OpenLayers.Style(f);break}}}}}OpenLayers.Util.extend(this,e)},destroy:function(){for(var b in this.styles){this.styles[b].destroy()}this.styles=null},createSymbolizer:function(d,f){if(!d){d=new OpenLayers.Feature.Vector()}if(!this.styles[f]){f="default"}d.renderIntent=f;var e={};if(this.extendDefault&&f!="default"){e=this.styles["default"].createSymbolizer(d)}return OpenLayers.Util.extend(e,this.styles[f].createSymbolizer(d))},addUniqueValueRules:function(g,l,j,i){var k=[];for(var m in j){k.push(new OpenLayers.Rule({symbolizer:j[m],context:i,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:l,value:m})}))}this.styles[g].addRules(k)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(b){OpenLayers.Filter.prototype.initialize.apply(this,[b])},evaluate:function(f){var e=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(f.geometry){var d=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){d=this.value.toGeometry()}if(f.geometry.intersects(d)){e=true}}break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));break}return e},clone:function(){var b=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(b)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(b!=null){this.addComponents(b)}},destroy:function(){this.components.length=0;this.components=null},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var d=[];for(var f=0,e=this.components.length;f<e;f++){d.push(this.components[f].toShortString())}return d.join(",")},calculateBounds:function(){this.bounds=null;if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var c=1,d=this.components.length;c<d;c++){this.extendBounds(this.components[c].getBounds())}}},addComponents:function(f){if(!(f instanceof Array)){f=[f]}for(var d=0,e=f.length;d<e;d++){this.addComponent(f[d])}},addComponent:function(f,g){var j=false;if(f){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,f.CLASS_NAME)>-1)){if(g!=null&&(g<this.components.length)){var i=this.components.slice(0,g);var k=this.components.slice(g,this.components.length);i.push(f);this.components=i.concat(k)}else{this.components.push(f)}f.parent=this;this.clearBounds();j=true}}return j},removeComponents:function(c){if(!(c instanceof Array)){c=[c]}for(var d=c.length-1;d>=0;--d){this.removeComponent(c[d])}},removeComponent:function(b){OpenLayers.Util.removeItem(this.components,b);this.clearBounds()},getLength:function(){var f=0;for(var d=0,e=this.components.length;d<e;d++){f+=this.components[d].getLength()}return f},getArea:function(){var f=0;for(var d=0,e=this.components.length;d<e;d++){f+=this.components[d].getArea()}return f},getGeodesicArea:function(e){var g=0;for(var i=0,f=this.components.length;i<f;i++){g+=this.components[i].getGeodesicArea(e)}return g},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(e){var g=0;for(var i=0,f=this.components.length;i<f;i++){g+=this.components[i].getGeodesicLength(e)}return g},move:function(e,g){for(var i=0,f=this.components.length;i<f;i++){this.components[i].move(e,g)}},rotate:function(g,e){for(var i=0,f=this.components.length;i<f;++i){this.components[i].rotate(g,e)}},resize:function(g,f,i){for(var e=0;e<this.components.length;++e){this.components[e].resize(g,f,i)}return this},distanceTo:function(m,l){var s=!(l&&l.edge===false);var t=s&&l&&l.details;var i,r;var q=Number.POSITIVE_INFINITY;for(var o=0,n=this.components.length;o<n;++o){i=this.components[o].distanceTo(m,l);distance=t?i.distance:i;if(distance<q){q=distance;r=i;if(q==0){break}}}return r},equals:function(g){var e=true;if(!g||!g.CLASS_NAME||(this.CLASS_NAME!=g.CLASS_NAME)){e=false}else{if(!(g.components instanceof Array)||(g.components.length!=this.components.length)){e=false}else{for(var i=0,f=this.components.length;i<f;++i){if(!this.components[i].equals(g.components[i])){e=false;break}}}}return e},transform:function(i,k){if(i&&k){for(var j=0,g=this.components.length;j<g;j++){var f=this.components[j];f.transform(i,k)}this.bounds=null}return this},intersects:function(g){var e=false;for(var i=0,f=this.components.length;i<f;++i){e=g.intersects(this.components[i]);if(e){break}}return e},getVertices:function(e){var i=[];for(var g=0,f=this.components.length;g<f;++g){Array.prototype.push.apply(i,this.components[g].getVertices(e))}return i},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(d,c){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(d);this.y=parseFloat(c)},clone:function(b){if(b==null){b=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(b,this);return b},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(q,l){var s=!(l&&l.edge===false);var v=s&&l&&l.details;var u,r,n,t,o,m;if(q instanceof OpenLayers.Geometry.Point){r=this.x;n=this.y;t=q.x;o=q.y;u=Math.sqrt(Math.pow(r-t,2)+Math.pow(n-o,2));m=!v?u:{x0:r,y0:n,x1:t,y1:o,distance:u}}else{m=q.distanceTo(this,l);if(v){m={x0:m.x1,y0:m.y1,x1:m.x0,y1:m.y0,distance:m.distance}}}return m},equals:function(d){var c=false;if(d!=null){c=((this.x==d.x&&this.y==d.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(d.x)&&isNaN(d.y)))}return c},toShortString:function(){return(this.x+", "+this.y)},move:function(d,c){this.x=this.x+d;this.y=this.y+c;this.clearBounds()},rotate:function(g,e){g*=Math.PI/180;var f=this.distanceTo(e);var i=g+Math.atan2(this.y-e.y,this.x-e.x);this.x=e.x+(f*Math.cos(i));this.y=e.y+(f*Math.sin(i));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(f,e,d){d=(d==undefined)?1:d;this.x=e.x+(f*d*(this.x-e.x));this.y=e.y+(f*(this.y-e.y));this.clearBounds();return this},intersects:function(c){var d=false;if(c.CLASS_NAME=="OpenLayers.Geometry.Point"){d=this.equals(c)}else{d=c.intersects(this)}return d},transform:function(c,d){if((c&&d)){OpenLayers.Projection.transform(this,c,d);this.bounds=null}return this},getVertices:function(b){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(i,e){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var g=0,f=this.strategies.length;g<f;g++){this.strategies[g].setLayer(this)}}},destroy:function(){if(this.strategies){var f,d,e;for(d=0,e=this.strategies.length;d<e;d++){f=this.strategies[d];if(f.autoDestroy){f.destroy()}}this.strategies=null}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()}this.protocol=null}this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;if(this.renderer){this.renderer.destroy()}this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},refresh:function(b){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",b)}},assignRenderer:function(){for(var f=0,e=this.renderers.length;f<e;f++){var d=OpenLayers.Renderer[this.renderers[f]];if(d&&d.prototype.supported()){this.renderer=new d(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(b){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.renderer){this.map.removeLayer(this)}else{this.renderer.map=this.map;this.renderer.setSize(this.map.getSize())}},afterAdd:function(){if(this.strategies){var f,d,e;for(d=0,e=this.strategies.length;d<e;d++){f=this.strategies[d];if(f.autoActivate){f.activate()}}}},removeMap:function(i){if(this.strategies){var g,e,f;for(e=0,f=this.strategies.length;e<f;e++){g=this.strategies[e];if(g.autoActivate){g.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(m,i,l){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var o=true;if(!l){this.renderer.root.style.visibility="hidden";this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var n=this.map.getExtent();o=this.renderer.setExtent(n,i);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!i&&o){for(var q in this.unrenderedFeatures){var r=this.unrenderedFeatures[q];this.drawFeature(r)}}}if(!this.drawn||i||!o){this.drawn=true;var r;for(var q=0,k=this.features.length;q<k;q++){this.renderer.locked=(q!==(k-1));r=this.features[q];this.drawFeature(r)}}},display:function(d){OpenLayers.Layer.prototype.display.apply(this,arguments);var c=this.div.style.display;if(c!=this.renderer.root.style.display){this.renderer.root.style.display=c}},addFeatures:function(s,i){if(!(s instanceof Array)){s=[s]}var m=!i||!i.silent;if(m){var t={features:s};var n=this.events.triggerEvent("beforefeaturesadded",t);if(n===false){return}s=t.features}for(var r=0,o=s.length;r<o;r++){if(r!=(s.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var l=s[r];if(this.geometryType&&!(l.geometry instanceof this.geometryType)){var q=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw q}this.features.push(l);l.layer=this;if(!l.style&&this.style){l.style=OpenLayers.Util.extend({},this.style)}if(m){if(this.events.triggerEvent("beforefeatureadded",{feature:l})===false){continue}this.preFeatureInsert(l)}this.drawFeature(l);if(m){this.events.triggerEvent("featureadded",{feature:l});this.onFeatureInsert(l)}}if(m){this.events.triggerEvent("featuresadded",{features:s})}},removeFeatures:function(i,g){if(!i||i.length===0){return}if(!(i instanceof Array)){i=[i]}if(i===this.features){i=i.slice()}var j=!g||!g.silent;for(var k=i.length-1;k>=0;k--){if(k!=0&&i[k-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var f=i[k];delete this.unrenderedFeatures[f.id];if(j){this.events.triggerEvent("beforefeatureremoved",{feature:f})}this.features=OpenLayers.Util.removeItem(this.features,f);f.layer=null;if(f.geometry){this.renderer.eraseFeatures(f)}if(OpenLayers.Util.indexOf(this.selectedFeatures,f)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,f)}if(j){this.events.triggerEvent("featureremoved",{feature:f})}}if(j){this.events.triggerEvent("featuresremoved",{features:i})}},destroyFeatures:function(g,f){var i=(g==undefined);if(i){g=this.features}if(g){this.removeFeatures(g,f);for(var e=g.length-1;e>=0;e--){g[e].destroy()}}},drawFeature:function(e,d){if(!this.drawn){return}if(typeof d!="object"){if(!d&&e.state===OpenLayers.State.DELETE){d="delete"}var f=d||e.renderIntent;d=e.style||this.style;if(!d){d=this.styleMap.createSymbolizer(e,f)}}if(!this.renderer.drawFeature(e,d)){this.unrenderedFeatures[e.id]=e}else{delete this.unrenderedFeatures[e.id]}},eraseFeatures:function(b){this.renderer.eraseFeatures(b)},getFeatureFromEvent:function(d){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var c=this.renderer.getFeatureIdFromEvent(d);return this.getFeatureById(c)},getFeatureById:function(g){var i=null;for(var e=0,f=this.features.length;e<f;++e){if(this.features[e].id==g){i=this.features[e];break}}return i},onFeatureInsert:function(b){},preFeatureInsert:function(b){},getDataExtent:function(){var d=null;if(this.features&&(this.features.length>0)){d=new OpenLayers.Bounds();for(var f=0,e=this.features.length;f<e;f++){d.extend(this.features[f].geometry.getBounds())}}return d},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(b){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(d,c){this.addComponent(d,c)},removePoint:function(b){this.removeComponent(b)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(f,d,e){if(!(e&&e.layerOptions&&e.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var b=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,b);this.map.addLayer(this.layer);return true},createFeature:function(d){var c=this.map.getLonLatFromPixel(d);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(c.lon,c.lat));this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}if(this.drawing){this.cancel()}this.destroyFeature();if(this.layer.map!=null){this.layer.destroy(false)}this.layer=null;return true},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.point=null},finalize:function(c){var d=c?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(d,[this.geometryClone()]);if(c||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(b){OpenLayers.Event.stop(b);return false},dblclick:function(b){OpenLayers.Event.stop(b);return false},modifyFeature:function(d){var c=this.map.getLonLatFromPixel(d);this.point.geometry.x=c.lon;this.point.geometry.y=c.lat;this.callback("modify",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var b=this.point&&this.point.geometry;if(b&&this.multi){b=new OpenLayers.Geometry.MultiPoint([b])}return b},geometryClone:function(){var b=this.getGeometry();return b&&b.clone()},mousedown:function(b){if(!this.checkModifiers(b)){return true}if(this.lastDown&&this.lastDown.equals(b.xy)){return true}this.drawing=true;if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(b.xy)}else{this.modifyFeature(b.xy)}this.lastDown=b.xy;return false},mousemove:function(b){if(this.drawing){this.modifyFeature(b.xy)}return true},mouseup:function(b){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:false,layers:null,initialize:function(c,d){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(f){var g=this.layers;var i;for(var e=0;e<g.length;e++){i=g[e].getFeatureFromEvent(f);if(i){return i}}},setMap:function(b){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();b.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(b){b.events.unregister("changelayer",this,this.handleChangeLayer);this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){var c;for(var d=0;d<this.map.layers.length;++d){c=this.map.layers[d];if(OpenLayers.Util.indexOf(this.layers,c)!=-1){c.renderer.moveRoot(this.renderer)}}},resetRoots:function(){var c;for(var d=0;d<this.layers.length;++d){c=this.layers[d];if(this.renderer&&c.renderer.getRenderLayerId()==this.id){this.renderer.moveRoot(c.renderer)}}},handleChangeLayer:function(d){var c=d.layer;if(d.property=="order"&&OpenLayers.Util.indexOf(this.layers,c)!=-1){this.resetRoots();this.collectRoots()}},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,initialize:function(b){OpenLayers.Strategy.prototype.initialize.apply(this,[b])},activate:function(){var b=OpenLayers.Strategy.prototype.activate.call(this);if(b){this.layer.events.on({moveend:this.update,scope:this});this.layer.events.on({refresh:this.update,scope:this})}return b},deactivate:function(){var b=OpenLayers.Strategy.prototype.deactivate.call(this);if(b){this.layer.events.un({moveend:this.update,scope:this});this.layer.events.un({refresh:this.update,scope:this})}return b},update:function(c){var d=this.getMapBounds();if((c&&c.force)||this.invalidBounds(d)){this.calculateBounds(d);this.resolution=this.layer.map.getResolution();this.triggerRead()}},getMapBounds:function(){var b=this.layer.map.getExtent();if(!this.layer.projection.equals(this.layer.map.getProjectionObject())){b=b.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)}return b},invalidBounds:function(e){if(!e){e=this.getMapBounds()}var f=!this.bounds||!this.bounds.containsBounds(e);if(!f&&this.resFactor){var d=this.resolution/this.layer.map.getResolution();f=(d>=this.resFactor||d<=(1/this.resFactor))}return f},calculateBounds:function(e){if(!e){e=this.getMapBounds()}var f=e.getCenterLonLat();var g=e.getWidth()*this.ratio;var i=e.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(f.lon-(g/2),f.lat-(i/2),f.lon+(g/2),f.lat+(i/2))},triggerRead:function(){this.layer.protocol.abort(this.response);this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read({filter:this.createFilter(),callback:this.merge,scope:this})},createFilter:function(){var b=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){b=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,b]})}return b},merge:function(k){this.layer.destroyFeatures();var m=k.features;if(m&&m.length>0){var l=this.layer.projection;var n=this.layer.map.getProjectionObject();if(!n.equals(l)){var o;for(var i=0,j=m.length;i<j;++i){o=m[i].geometry;if(o){o.transform(l,n)}}}this.layer.addFeatures(m)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,highlightOnly:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(f,e){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[e]);if(this.scope===null){this.scope=this}if(f instanceof Array){this.layers=f;this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:f})}else{this.layer=f}var d={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){d.over=this.overFeature;d.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(d,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.layers){this.layer.destroy()}},activate:function(){if(!this.active){if(this.layers){this.map.addLayer(this.layer)}this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}if(this.layers){this.map.removeLayer(this.layer)}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(g){var j=this.layers||[this.layer];var k,l;for(var i=0;i<j.length;++i){k=j[i];for(var m=k.selectedFeatures.length-1;m>=0;--m){l=k.selectedFeatures[m];if(!g||g.except!=l){this.unselect(l)}}}},clickFeature:function(d){if(!this.hover){var c=(OpenLayers.Util.indexOf(d.layer.selectedFeatures,d)>-1);if(c){if(this.toggleSelect()){this.unselect(d)}else{if(!this.multipleSelect()){this.unselectAll({except:d})}}}else{if(!this.multipleSelect()){this.unselectAll({except:d})}this.select(d)}}},multipleSelect:function(){return this.multiple||(this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey])},toggleSelect:function(){return this.toggle||(this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey])},clickoutFeature:function(b){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(c){var d=c.layer;if(this.hover){if(this.highlightOnly){this.highlight(c)}else{if(OpenLayers.Util.indexOf(d.selectedFeatures,c)==-1){this.select(c)}}}},outFeature:function(d){if(this.hover){if(this.highlightOnly){if(d._lastHighlighter==this.id){if(d._prevHighlighter&&d._prevHighlighter!=this.id){delete d._lastHighlighter;var c=this.map.getControl(d._prevHighlighter);if(c){c.highlight(d)}}else{this.unhighlight(d)}}}else{this.unselect(d)}}},highlight:function(i){var e=i.layer;var f=this.events.triggerEvent("beforefeaturehighlighted",{feature:i});if(f!==false){i._prevHighlighter=i._lastHighlighter;i._lastHighlighter=this.id;var g=this.selectStyle||this.renderIntent;e.drawFeature(i,g);this.events.triggerEvent("featurehighlighted",{feature:i})}},unhighlight:function(c){var d=c.layer;c._lastHighlighter=c._prevHighlighter;delete c._prevHighlighter;d.drawFeature(c,c.style||c.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:c})},select:function(f){var e=this.onBeforeSelect.call(this.scope,f);var d=f.layer;if(e!==false){e=d.events.triggerEvent("beforefeatureselected",{feature:f});if(e!==false){d.selectedFeatures.push(f);this.highlight(f);d.events.triggerEvent("featureselected",{feature:f});this.onSelect.call(this.scope,f)}}},unselect:function(c){var d=c.layer;this.unhighlight(c);OpenLayers.Util.removeItem(d.selectedFeatures,c);d.events.triggerEvent("featureunselected",{feature:c});this.onUnselect.call(this.scope,c)},selectBox:function(t){if(t instanceof OpenLayers.Bounds){var q=this.map.getLonLatFromPixel(new OpenLayers.Pixel(t.left,t.bottom));var l=this.map.getLonLatFromPixel(new OpenLayers.Pixel(t.right,t.top));var z=new OpenLayers.Bounds(q.lon,q.lat,l.lon,l.lat);if(!this.multipleSelect()){this.unselectAll()}var o=this.multiple;this.multiple=true;var u=this.layers||[this.layer];var s;for(var w=0;w<u.length;++w){s=u[w];for(var v=0,r=s.features.length;v<r;++v){var i=s.features[v];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,i.geometry.CLASS_NAME)>-1){if(z.toGeometry().intersects(i.geometry)){if(OpenLayers.Util.indexOf(s.selectedFeatures,i)==-1){this.select(i)}}}}}this.multiple=o}},setMap:function(b){this.handlers.feature.setMap(b);if(this.box){this.handlers.box.setMap(b)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(b){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var f=0;if(this.components&&(this.components.length>1)){for(var d=1,e=this.components.length;d<e;d++){f+=this.components[d-1].distanceTo(this.components[d])}}return f},getGeodesicLength:function(i){var o=this;if(i){var r=new OpenLayers.Projection("EPSG:4326");if(!r.equals(i)){o=this.clone().transform(i,r)}}var n=0;if(o.components&&(o.components.length>1)){var l,m;for(var q=1,k=o.components.length;q<k;q++){l=o.components[q-1];m=o.components[q];n+=OpenLayers.Util.distVincenty({lon:l.x,lat:l.y},{lon:m.x,lat:m.y})}}return n*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(b){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(b){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(w){var G=false;var z=w.CLASS_NAME;if(z=="OpenLayers.Geometry.LineString"||z=="OpenLayers.Geometry.LinearRing"||z=="OpenLayers.Geometry.Point"){var i=this.getSortedSegments();var v;if(z=="OpenLayers.Geometry.Point"){v=[{x1:w.x,y1:w.y,x2:w.x,y2:w.y}]}else{v=w.getSortedSegments()}var J,C,E,I,K,M,F,H;outer:for(var B=0,A=i.length;B<A;++B){J=i[B];C=J.x1;E=J.x2;I=J.y1;K=J.y2;inner:for(var D=0,j=v.length;D<j;++D){M=v[D];if(M.x1>E){break}if(M.x2<C){continue}F=M.y1;H=M.y2;if(Math.min(F,H)>Math.max(I,K)){continue}if(Math.max(F,H)<Math.min(I,K)){continue}if(OpenLayers.Geometry.segmentsIntersect(J,M)){G=true;break outer}}}}else{G=w.intersects(this)}return G},getSortedSegments:function(){var f=this.components.length-1;var e=new Array(f);for(var i=0;i<f;++i){point1=this.components[i];point2=this.components[i+1];if(point1.x<point2.x){e[i]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}}else{e[i]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}}}function g(a,b){return a.x1-b.x1}return e.sort(g)},splitWithSegment:function(D,W){var V=!(W&&W.edge===false);var G=W&&W.tolerance;var aa=[];var B=this.getVertices();var H=[];var i=[];var P=false;var T,U,J;var M,E,A;var R={point:true,tolerance:G};var Q=null;for(var I=0,K=B.length-2;I<=K;++I){T=B[I];H.push(T.clone());U=B[I+1];A={x1:T.x,y1:T.y,x2:U.x,y2:U.y};J=OpenLayers.Geometry.segmentsIntersect(D,A,R);if(J instanceof OpenLayers.Geometry.Point){if((J.x===D.x1&&J.y===D.y1)||(J.x===D.x2&&J.y===D.y2)||J.equals(T)||J.equals(U)){E=true}else{E=false}if(E||V){if(!J.equals(i[i.length-1])){i.push(J.clone())}if(I===0){if(J.equals(T)){continue}}if(J.equals(U)){continue}P=true;if(!J.equals(T)){H.push(J)}aa.push(new OpenLayers.Geometry.LineString(H));H=[J.clone()]}}}if(P){H.push(U.clone());aa.push(new OpenLayers.Geometry.LineString(H))}if(i.length>0){var F=D.x1<D.x2?1:-1;var C=D.y1<D.y2?1:-1;Q={lines:aa,points:i.sort(function(a,b){return(F*a.x-F*b.x)||(C*a.y-C*b.y)})}}return Q},split:function(H,W){var J=null;var U=W&&W.mutual;var M,T,K,V;if(H instanceof OpenLayers.Geometry.LineString){var I=this.getVertices();var Q,R,i,P,aa,F;var C=[];K=[];for(var k=0,G=I.length-2;k<=G;++k){Q=I[k];R=I[k+1];i={x1:Q.x,y1:Q.y,x2:R.x,y2:R.y};V=V||[H];if(U){C.push(Q.clone())}for(var D=0;D<V.length;++D){P=V[D].splitWithSegment(i,W);if(P){aa=P.lines;if(aa.length>0){aa.unshift(D,1);Array.prototype.splice.apply(V,aa);D+=aa.length-2}if(U){for(var E=0,j=P.points.length;E<j;++E){F=P.points[E];if(!F.equals(Q)){C.push(F);K.push(new OpenLayers.Geometry.LineString(C));if(F.equals(R)){C=[]}else{C=[F.clone()]}}}}}}}if(U&&K.length>0&&C.length>0){C.push(R.clone());K.push(new OpenLayers.Geometry.LineString(C))}}else{J=H.splitWith(this,W)}if(V&&V.length>1){T=true}else{V=[]}if(K&&K.length>1){M=true}else{K=[]}if(T||M){if(U){J=[K,V]}else{J=V}}return J},splitWith:function(c,d){return c.split(this,d)},getVertices:function(d){var c;if(d===true){c=[this.components[0],this.components[this.components.length-1]]}else{if(d===false){c=this.components.slice(1,this.components.length-1)}else{c=this.components.slice()}}return c},distanceTo:function(W,aa){var V=!(aa&&aa.edge===false);var I=V&&aa&&aa.details;var H,ac={};var E=Number.POSITIVE_INFINITY;if(W instanceof OpenLayers.Geometry.Point){var G=this.getSortedSegments();var K=W.x;var P=W.y;var M;for(var i=0,Q=G.length;i<Q;++i){M=G[i];H=OpenLayers.Geometry.distanceToSegment(W,M);if(H.distance<E){E=H.distance;ac=H;if(E===0){break}}else{if(M.x2>K&&((P>M.y1&&P<M.y2)||(P<M.y1&&P>M.y2))){break}}}if(I){ac={distance:ac.distance,x0:ac.x,y0:ac.y,x1:K,y1:P}}else{ac=ac.distance}}else{if(W instanceof OpenLayers.Geometry.LineString){var ad=this.getSortedSegments();var ae=W.getSortedSegments();var af,ag,R,J,ab;var T=ae.length;var U={point:true};outer:for(var i=0,Q=ad.length;i<Q;++i){af=ad[i];J=af.x1;ab=af.y1;for(var j=0;j<T;++j){ag=ae[j];R=OpenLayers.Geometry.segmentsIntersect(af,ag,U);if(R){E=0;ac={distance:0,x0:R.x,y0:R.y,x1:R.x,y1:R.y};break outer}else{H=OpenLayers.Geometry.distanceToSegment({x:J,y:ab},ag);if(H.distance<E){E=H.distance;ac={distance:E,x0:J,y0:ab,x1:H.x,y1:H.y}}}}}if(!I){ac=ac.distance}if(E!==0){if(af){H=W.distanceTo(new OpenLayers.Geometry.Point(af.x2,af.y2),aa);var F=I?H.distance:H;if(F<E){if(I){ac={distance:E,x0:H.x1,y0:H.y1,x1:H.x0,y1:H.y0}}else{ac=F}}}}}else{ac=W.distanceTo(this,aa);if(I){ac={distance:ac.distance,x0:ac.x1,y0:ac.y1,x1:ac.x0,y1:ac.y0}}}}return ac},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(b){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(g,f){var k=false;var j=this.components.pop();if(f!=null||!g.equals(j)){k=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var i=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[i]);return k},removeComponent:function(d){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var c=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[c])}},move:function(e,g){for(var i=0,f=this.components.length;i<f-1;i++){this.components[i].move(e,g)}},rotate:function(g,e){for(var i=0,f=this.components.length;i<f-1;++i){this.components[i].rotate(g,e)}},resize:function(i,f,j){for(var k=0,g=this.components.length;k<g-1;++k){this.components[k].resize(i,f,j)}return this},transform:function(i,k){if(i&&k){for(var j=0,g=this.components.length;j<g-1;j++){var f=this.components[j];f.transform(i,k)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var m=0;var n=0;for(var q=0;q<this.components.length-1;q++){var r=this.components[q];var c=this.components[q+1];m+=(r.x+c.x)*(r.x*c.y-c.x*r.y);n+=(r.y+c.y)*(r.x*c.y-c.x*r.y)}var o=-1*this.getArea();var b=m/(6*o);var i=n/(6*o)}return new OpenLayers.Geometry.Point(b,i)},getArea:function(){var i=0;if(this.components&&(this.components.length>2)){var k=0;for(var l=0,m=this.components.length;l<m-1;l++){var b=this.components[l];var c=this.components[l+1];k+=(b.x+c.x)*(c.y-b.y)}i=-k/2}return i},getGeodesicArea:function(i){var q=this;if(i){var r=new OpenLayers.Projection("EPSG:4326");if(!r.equals(i)){q=this.clone().transform(i,r)}}var n=0;var k=q.components&&q.components.length;if(k>2){var l,m;for(var o=0;o<k-1;o++){l=q.components[o];m=q.components[o+1];n+=OpenLayers.Util.rad(m.x-l.x)*(2+Math.sin(OpenLayers.Util.rad(l.y))+Math.sin(OpenLayers.Util.rad(m.y)))}n=n*6378137*6378137/2}return n},containsPoint:function(C){var i=OpenLayers.Number.limitSigDigs;var D=14;var E=i(C.x,D);var F=i(C.y,D);function v(a,c,e,d,b){return(((c-d)*a)+((d*e)-(c*b)))/(e-b)}var Q=this.components.length-1;var H,I,w,K,A,P,J,M;var G=0;for(var B=0;B<Q;++B){H=this.components[B];w=i(H.x,D);K=i(H.y,D);I=this.components[B+1];A=i(I.x,D);P=i(I.y,D);if(K==P){if(F==K){if(w<=A&&(E>=w&&E<=A)||w>=A&&(E<=w&&E>=A)){G=-1;break}}continue}J=i(v(F,w,K,A,P),D);if(J==E){if(K<P&&(F>=K&&F<=P)||K>P&&(F<=K&&F>=P)){G=-1;break}}if(J<=E){continue}if(w!=A&&(J<Math.min(w,A)||J>Math.max(w,A))){continue}if(K<P&&(F>=K&&F<P)||K>P&&(F<K&&F>=P)){++G}}var z=(G==-1)?1:!!(G&1);return z},intersects:function(g){var e=false;if(g.CLASS_NAME=="OpenLayers.Geometry.Point"){e=this.containsPoint(g)}else{if(g.CLASS_NAME=="OpenLayers.Geometry.LineString"){e=g.intersects(this)}else{if(g.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){e=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[g])}else{for(var i=0,f=g.components.length;i<f;++i){e=g.components[i].intersects(this);if(e){break}}}}}return e},getVertices:function(b){return(b===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(b){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(k,H){var A=null;var I=H&&H.mutual;var j,G,J,v,F;var C=[];var i=[k];for(var B=0,z=this.components.length;B<z;++B){G=this.components[B];v=false;for(var D=0;D<i.length;++D){j=G.split(i[D],H);if(j){if(I){J=j[0];for(var E=0,w=J.length;E<w;++E){if(E===0&&C.length){C[C.length-1].addComponent(J[E])}else{C.push(new OpenLayers.Geometry.MultiLineString([J[E]]))}}v=true;j=j[1]}if(j.length){j.unshift(D,1);Array.prototype.splice.apply(i,j);break}}}if(!v){if(C.length){C[C.length-1].addComponent(G.clone())}else{C=[new OpenLayers.Geometry.MultiLineString(G.clone())]}}}if(C&&C.length>1){v=true}else{C=[]}if(i&&i.length>1){F=true}else{i=[]}if(v||F){if(I){A=[C,i]}else{A=i}}return A},splitWith:function(k,H){var A=null;var I=H&&H.mutual;var j,E,J,v,G,C,i;if(k instanceof OpenLayers.Geometry.LineString){i=[];C=[k];for(var B=0,z=this.components.length;B<z;++B){G=false;E=this.components[B];for(var D=0;D<C.length;++D){j=C[D].split(E,H);if(j){if(I){J=j[0];if(J.length){J.unshift(D,1);Array.prototype.splice.apply(C,J);D+=J.length-2}j=j[1];if(j.length===0){j=[E.clone()]}}for(var F=0,w=j.length;F<w;++F){if(F===0&&i.length){i[i.length-1].addComponent(j[F])}else{i.push(new OpenLayers.Geometry.MultiLineString([j[F]]))}}G=true}}if(!G){if(i.length){i[i.length-1].addComponent(E.clone())}else{i=[new OpenLayers.Geometry.MultiLineString([E.clone()])]}}}}else{A=k.split(this)}if(C&&C.length>1){v=true}else{C=[]}if(i&&i.length>1){G=true}else{i=[]}if(v||G){if(I){A=[C,i]}else{A=i}}return A},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(f,d,e){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(d){var c=this.control.map.getLonLatFromPixel(d);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(c.lon,c.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);this.line=null},removePoint:function(){if(this.point){this.layer.removeFeatures([this.point])}},addPoint:function(d){this.layer.removeFeatures([this.point]);var c=this.control.map.getLonLatFromPixel(d);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(c.lon,c.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature()},freehandMode:function(b){return(this.freehandToggle&&b[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(d){var c=this.control.map.getLonLatFromPixel(d);this.point.geometry.x=c.lon;this.point.geometry.y=c.lat;this.callback("modify",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var b=this.line&&this.line.geometry;if(b&&this.multi){b=new OpenLayers.Geometry.MultiLineString([b])}return b},mousedown:function(b){if(this.lastDown&&this.lastDown.equals(b.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(b.xy)}else{if((this.lastUp==null)||!this.lastUp.equals(b.xy)){this.addPoint(b.xy)}}this.mouseDown=true;this.lastDown=b.xy;this.drawing=true;return false},mousemove:function(b){if(this.drawing){if(this.mouseDown&&this.freehandMode(b)){this.addPoint(b.xy)}else{this.modifyFeature(b.xy)}}return true},mouseup:function(b){this.mouseDown=false;if(this.drawing){if(this.freehandMode(b)){this.removePoint();this.finalize()}else{if(this.lastUp==null){this.addPoint(b.xy)}this.lastUp=b.xy}return false}return true},dblclick:function(d){if(!this.freehandMode(d)){var c=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[c]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(b){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var f=0;if(this.components&&(this.components.length>0)){f+=Math.abs(this.components[0].getArea());for(var d=1,e=this.components.length;d<e;d++){f-=Math.abs(this.components[d].getArea())}}return f},getGeodesicArea:function(e){var g=0;if(this.components&&(this.components.length>0)){g+=Math.abs(this.components[0].getGeodesicArea(e));for(var i=1,f=this.components.length;i<f;i++){g-=Math.abs(this.components[i].getGeodesicArea(e))}}return g},containsPoint:function(g){var i=this.components.length;var k=false;if(i>0){k=this.components[0].containsPoint(g);if(k!==1){if(k&&i>1){var j;for(var f=1;f<i;++f){j=this.components[f].containsPoint(g);if(j){if(j===1){k=1}else{k=false}break}}}}}return k},intersects:function(i){var f=false;var j,g;if(i.CLASS_NAME=="OpenLayers.Geometry.Point"){f=this.containsPoint(i)}else{if(i.CLASS_NAME=="OpenLayers.Geometry.LineString"||i.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(j=0,g=this.components.length;j<g;++j){f=i.intersects(this.components[j]);if(f){break}}if(!f){for(j=0,g=i.components.length;j<g;++j){f=this.containsPoint(i.components[j]);if(f){break}}}}else{for(j=0,g=i.components.length;j<g;++j){f=this.intersects(i.components[j]);if(f){break}}}}if(!f&&i.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var k=this.components[0];for(j=0,g=k.components.length;j<g;++j){f=i.containsPoint(k.components[j]);if(f){break}}}return f},distanceTo:function(g,e){var i=!(e&&e.edge===false);var f;if(!i&&this.intersects(g)){f=0}else{f=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[g,e])}return f},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(o,s,w,i){var v=Math.PI*((1/w)-(1/2));if(i){v+=(i/180)*Math.PI}var z,q,r;var n=[];for(var t=0;t<w;++t){z=v+(t*2*Math.PI/w);q=o.x+(s*Math.cos(z));r=o.y+(s*Math.sin(z));n.push(new OpenLayers.Geometry.Point(q,r))}var u=new OpenLayers.Geometry.LinearRing(n);return new OpenLayers.Geometry.Polygon([u])};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(b){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{initialize:function(b){OpenLayers.Format.JSON.prototype.initialize.apply(this,[b])},read:function(i,m,t){m=(m)?m:"FeatureCollection";var q=null;var r=null;if(typeof i=="string"){r=OpenLayers.Format.JSON.prototype.read.apply(this,[i,t])}else{r=i}if(!r){OpenLayers.Console.error("Bad JSON: "+i)}else{if(typeof(r.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+i)}else{if(this.isValidType(r,m)){switch(m){case"Geometry":try{q=this.parseGeometry(r)}catch(s){OpenLayers.Console.error(s)}break;case"Feature":try{q=this.parseFeature(r);q.type="Feature"}catch(s){OpenLayers.Console.error(s)}break;case"FeatureCollection":q=[];switch(r.type){case"Feature":try{q.push(this.parseFeature(r))}catch(s){q=null;OpenLayers.Console.error(s)}break;case"FeatureCollection":for(var o=0,n=r.features.length;o<n;++o){try{q.push(this.parseFeature(r.features[o]))}catch(s){q=null;OpenLayers.Console.error(s)}}break;default:try{var l=this.parseGeometry(r);q.push(new OpenLayers.Feature.Vector(l))}catch(s){q=null;OpenLayers.Console.error(s)}}break}}}}return q},isValidType:function(f,e){var d=false;switch(e){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],f.type)==-1){OpenLayers.Console.error("Unsupported geometry type: "+f.type)}else{d=true}break;case"FeatureCollection":d=true;break;default:if(f.type==e){d=true}else{OpenLayers.Console.error("Cannot convert types from "+f.type+" to "+e)}}return d},parseFeature:function(l){var g,j,i,k;i=(l.properties)?l.properties:{};k=(l.geometry&&l.geometry.bbox)||l.bbox;try{j=this.parseGeometry(l.geometry)}catch(m){throw m}g=new OpenLayers.Feature.Vector(j,i);if(k){g.bounds=OpenLayers.Bounds.fromArray(k)}if(l.id){g.fid=l.id}return g},parseGeometry:function(m){if(m==null){return null}var k,l=false;if(m.type=="GeometryCollection"){if(!(m.geometries instanceof Array)){throw"GeometryCollection must have geometries array: "+m}var i=m.geometries.length;var n=new Array(i);for(var j=0;j<i;++j){n[j]=this.parseGeometry.apply(this,[m.geometries[j]])}k=new OpenLayers.Geometry.Collection(n);l=true}else{if(!(m.coordinates instanceof Array)){throw"Geometry must have coordinates array: "+m}if(!this.parseCoords[m.type.toLowerCase()]){throw"Unsupported geometry type: "+m.type}try{k=this.parseCoords[m.type.toLowerCase()].apply(this,[m.coordinates])}catch(o){throw o}}if(this.internalProjection&&this.externalProjection&&!l){k.transform(this.externalProjection,this.internalProjection)}return k},parseCoords:{point:function(b){if(b.length!=2){throw"Only 2D points are supported: "+b}return new OpenLayers.Geometry.Point(b[0],b[1])},multipoint:function(j){var m=[];var k=null;for(var g=0,i=j.length;g<i;++g){try{k=this.parseCoords.point.apply(this,[j[g]])}catch(l){throw l}m.push(k)}return new OpenLayers.Geometry.MultiPoint(m)},linestring:function(j){var m=[];var k=null;for(var g=0,i=j.length;g<i;++g){try{k=this.parseCoords.point.apply(this,[j[g]])}catch(l){throw l}m.push(k)}return new OpenLayers.Geometry.LineString(m)},multilinestring:function(j){var m=[];var g=null;for(var l=0,i=j.length;l<i;++l){try{g=this.parseCoords.linestring.apply(this,[j[l]])}catch(k){throw k}m.push(g)}return new OpenLayers.Geometry.MultiLineString(m)},polygon:function(k){var l=[];var m,i;for(var o=0,j=k.length;o<j;++o){try{i=this.parseCoords.linestring.apply(this,[k[o]])}catch(n){throw n}m=new OpenLayers.Geometry.LinearRing(i.components);l.push(m)}return new OpenLayers.Geometry.Polygon(l)},multipolygon:function(j){var g=[];var k=null;for(var m=0,i=j.length;m<i;++m){try{k=this.parseCoords.polygon.apply(this,[j[m]])}catch(l){throw l}g.push(k)}return new OpenLayers.Geometry.MultiPolygon(g)},box:function(b){if(b.length!=2){throw"GeoJSON box coordinates must have 2 elements"}return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(b[0][0],b[0][1]),new OpenLayers.Geometry.Point(b[1][0],b[0][1]),new OpenLayers.Geometry.Point(b[1][0],b[1][1]),new OpenLayers.Geometry.Point(b[0][0],b[1][1]),new OpenLayers.Geometry.Point(b[0][0],b[0][1])])])}},write:function(m,n){var j={type:null};if(m instanceof Array){j.type="FeatureCollection";var k=m.length;j.features=new Array(k);for(var o=0;o<k;++o){var i=m[o];if(!i instanceof OpenLayers.Feature.Vector){var l="FeatureCollection only supports collections of features: "+i;throw l}j.features[o]=this.extract.feature.apply(this,[i])}}else{if(m.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){j=this.extract.geometry.apply(this,[m])}else{if(m instanceof OpenLayers.Feature.Vector){j=this.extract.feature.apply(this,[m]);if(m.layer&&m.layer.projection){j.crs=this.createCRSObject(m)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[j,n])},createCRSObject:function(e){var i=e.layer.projection.toString();var f={};if(i.match(/epsg:/i)){var g=parseInt(i.substring(i.indexOf(":")+1));if(g==4326){f={type:"OGC",properties:{urn:"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{f={type:"EPSG",properties:{code:g}}}}return f},extract:{feature:function(c){var d=this.extract.geometry.apply(this,[c.geometry]);return{type:"Feature",id:c.fid==null?c.id:c.fid,properties:c.attributes,geometry:d}},geometry:function(g){if(g==null){return null}if(this.internalProjection&&this.externalProjection){g=g.clone();g.transform(this.internalProjection,this.externalProjection)}var f=g.CLASS_NAME.split(".")[2];var i=this.extract[f.toLowerCase()].apply(this,[g]);var e;if(f=="Collection"){e={type:"GeometryCollection",geometries:i}}else{e={type:f,coordinates:i}}return e},point:function(b){return[b.x,b.y]},multipoint:function(i){var g=[];for(var e=0,f=i.components.length;e<f;++e){g.push(this.extract.point.apply(this,[i.components[e]]))}return g},linestring:function(e){var g=[];for(var i=0,f=e.components.length;i<f;++i){g.push(this.extract.point.apply(this,[e.components[i]]))}return g},multilinestring:function(i){var g=[];for(var e=0,f=i.components.length;e<f;++e){g.push(this.extract.linestring.apply(this,[i.components[e]]))}return g},polygon:function(i){var g=[];for(var e=0,f=i.components.length;e<f;++e){g.push(this.extract.linestring.apply(this,[i.components[e]]))}return g},multipolygon:function(g){var i=[];for(var e=0,f=g.components.length;e<f;++e){i.push(this.extract.polygon.apply(this,[g.components[e]]))}return i},collection:function(i){var f=i.components.length;var g=new Array(f);for(var e=0;e<f;++e){g[e]=this.extract.geometry.apply(this,[i.components[e]])}return g}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});NSZemljevid=OpenLayers.Class({startBtPos:130,currentBtPos:0,options:{tileBuffer:null,mapType:null},initialize:function(g,e){OpenLayers.Util.extend(this.options,e);this.setupHost();try{if(NSZemljevid.Util.isIE6){document.execCommand("BackgroundImageCache",false,true)}}catch(i){}if(!this.initCheck(g)){return}this.map=new NSZemljevid.Map(g,{tileSize:new OpenLayers.Size(NSZemljevid.TILE_SIZE,NSZemljevid.TILE_SIZE),maxExtent:new OpenLayers.Bounds(0,0,NSZemljevid.MAX_RESOLUTION,NSZemljevid.MAX_RESOLUTION),maxResolution:NSZemljevid.MAX_RESOLUTION/NSZemljevid.TILE_SIZE,numZoomLevels:NSZemljevid.ZOOM_LEVELS,controls:[],theme:null,info:new NSZemljevid.IMapInfo()});this.map.div.style.backgroundColor="#E3E2D1";OpenLayers.Util.extend(this.map,{topLeftCoords:function(c){var b=this.getLonLatFromViewPortPx(new OpenLayers.Pixel(0,0));if(typeof c=="undefined"||c==NSZemljevid.GK_COORD){var a=this.info.getGKFromLonLat(b);return new NSZemljevid.GK(a.x,a.y)}else{var a=this.info.getGKFromLonLat(b);var d=this.info.gk2GPS(a.y,a.x);return new NSZemljevid.LonLat(d.lon,d.lat)}return null},bottomRightCoords:function(c){var d=this.getSize();var b=this.getLonLatFromViewPortPx(new OpenLayers.Pixel(d.w,d.h));if(typeof c=="undefined"||c==NSZemljevid.GK_COORD){var a=this.info.getGKFromLonLat(b);return new NSZemljevid.GK(a.x,a.y)}else{var a=this.info.getGKFromLonLat(b);var k=this.info.gk2GPS(a.y,a.x);return new NSZemljevid.LonLat(k.lon,k.lat)}return null},getCoords:function(b,c){var a=this.info.getGKFromLonLat(this.getLonLatFromViewPortPx(b));if(typeof c=="undefined"||c==NSZemljevid.GK_COORD){return new NSZemljevid.GK(a.x,a.y)}else{var d=this.info.gk2GPS(a.y,a.x);return new NSZemljevid.LonLat(d.lon,d.lat)}return null}});this.map.defaultPopup=NSZemljevid.FramedCloud;var f=new OpenLayers.Control.Navigation();this.map.addControl(f);this.map.addControl(new NSZemljevid.Scale());this.map.addControl(new NSZemljevid.CopyRight());if(!this.options.mapType){this._addStandardControl().activate()}else{if(this.options.mapType.match(/^satellite$/i)){this.addSatelliteControl().activate();this.setCopyRightStyle("doflayer")}else{if(this.options.mapType.match(/^hybrid$/i)){this.addHybridControl().activate();this.setCopyRightStyle("hybridlayer")}}}OpenLayers.Util.extend(f.dragPan.handler,{down:function(){this.map.div.style.cursor="move"},up:function(){this.map.div.style.cursor=""}});this.map.events.on({addlayer:this.onLayerAdd,popupclose:this.onPopupClose,changebaselayer:this.onBaseLayerChange,scope:this});this.setZoom(NSZemljevid.INITIAL_ZOOM);NSZemljevid.onTrafficData=OpenLayers.Function.bind(this.onTrafficData,this)},onTrafficData:function(c){var d=this.getControlByClass("ITrafficButton");if(d){d.onTrafficData(c)}},onPopupClose:function(){var b=this.map.getControlsByClass("NSZemljevid.Cameras")[0];if(b){b.onClosePopup()}},onBaseLayerChange:function(b){this.setCopyRightStyle(b.layer.name)},setCopyRightStyle:function(d){var c=this.getControlByClass("NSZemljevid.CopyRight");if(d.match(/doflayer/ig)||d.match(/hybridlayer/ig)){c.setWhite()}else{c.setBlack()}},onLayerAdd:function(i){if(!i.layer.CLASS_NAME.match(/vector/ig)||(i.layer.CLASS_NAME.match(/vector/ig)&&i.layer.name.match(/NavLayer/ig))||i.layer.name.match(/control/ig)||(i.layer.CLASS_NAME.match(/vector/ig)&&i.layer.name.match(/Handler.Path$/ig))){return}var k=this.map.getControlsByClass("OpenLayers.Control.SelectFeature")[0];var j=[];if(k){if(k.layers){for(var e=0,g=k.layers.length;e<g;e++){j.push(k.layers[e])}}else{j.push(k.layer)}k.destroy();this.map.removeControl(k)}j.push(i.layer);this.createSelectFeatureControl(j)},createSelectFeatureControl:function(r){var o=new OpenLayers.Control.SelectFeature(r,{hover:true,highlightOnly:false,callbacks:{click:OpenLayers.Function.bind(this.onFeatureClick,this)}});o.handlers.feature.clickTolerance=999999;this.map.addControl(o);o.events.on({featurehighlighted:this.featureOver,featureunhighlighted:this.featureOut});o.activate();var l=this.map.getLayersByName("Traffic")[0]||this.map.getLayersByName("Weather")[0];if(l){var i=null;for(var q=0,m=this.map.layers.length;q<m;q++){var s=this.map.layers[q];if(s.name.match(/selectfeature/ig)){i=s;break}}if(i){var n=this.map.getLayerIndex(l);if(this.map.getLayerIndex(i)!=n){this.map.setLayerIndex(i,n);this.map.resetLayersZIndex()}var t=this.map.getLayersByName("Cameras")[0];if(t){if(this.map.getLayerIndex(i)!=this.map.getLayerIndex(t)){this.map.setLayerIndex(t,this.map.getLayerIndex(i));this.map.resetLayersZIndex()}}}}},initCheck:function(b){if(typeof b=="undefined"||b==null){return false}return true},setZoom:function(b){if(this.map.isValidZoomLevel(b)){this.map.zoomTo(b)}else{throw"Zoom out of range!";return}},getZoom:function(){return this.map.zoom},setMinZoom:function(b){if(typeof b=="undefined"){return}if(b<NSZemljevid.INITIAL_ZOOM||b>NSZemljevid.ZOOM_LEVELS-1){return}this.map.minZoom=b},setMaxZoom:function(b){if(typeof b=="undefined"){return}b++;if(b<NSZemljevid.INITIAL_ZOOM||b>NSZemljevid.ZOOM_LEVELS-1){return}this.map.maxZoom=b},setCenter:function(c,d){this.map._nsz_setCenter(c,d)},getCenter:function(b){return this.map._nsz_getCenter(b)},panTo:function(b){this.map._nsz_panTo(b)},addKeyboardNavigation:function(){var b=this.map.getControlsByClass("OpenLayers.Control.KeyboardDefaults");if(b.length==0){this.keyboardDef=new OpenLayers.Control.KeyboardDefaults();this.map.addControl(this.keyboardDef)}else{this.keyboardDef.activate()}},removeKeyboardNavigation:function(){if(!this.keyboardDef){return}this.keyboardDef.deactivate()},addPanZoomControl:function(k,i){var f=new OpenLayers.Pixel(5,5);if(i){f.y=i.top?parseInt(i.top):5;f.x=i.left?parseInt(i.left):5}var g=null;if(!k||k==NS_PANZOOM_TYPE1){g=this.map.getControlsByClass("NSZemljevid.PanZoomBar2");if(g.length>0){return g[0]}g=this.map.getControlsByClass("NSZemljevid.PanZoomBar3");if(g.length>0){return g[0]}var j=new NSZemljevid.PanZoomBar({zoomStopHeight:12,zoomStopWidth:49,position:f});this.map.addControl(j);return j}else{if(k&&k==NS_PANZOOM_TYPE2){g=this.map.getControlsByClass("NSZemljevid.PanZoomBar");if(g.length>0){return g[0]}g=this.map.getControlsByClass("NSZemljevid.PanZoomBar3");if(g.length>0){return g[0]}var j=new NSZemljevid.PanZoomBar2({zoomStopHeight:12,zoomStopWidth:49,position:f});this.map.addControl(j);return j}else{if(k&&k==NS_PANZOOM_TYPE3){g=this.map.getControlsByClass("NSZemljevid.PanZoomBar");if(g.length>0){return g[0]}g=this.map.getControlsByClass("NSZemljevid.PanZoomBar2");if(g.length>0){return g[0]}var j=new NSZemljevid.PanZoomBar3({zoomStopHeight:12,zoomStopWidth:49,position:f});this.map.addControl(j);return j}}}},addPanZoomControl2:function(){var d=this.map.getControlsByClass("NSZemljevid.PanZoomBar2");if(d.length==0){var c=new NSZemljevid.PanZoomBar2({zoomStopHeight:12,zoomStopWidth:49,position:new OpenLayers.Pixel(5,5)});this.map.addControl(c);return c}return d[0]},addPanZoomControl3:function(){var d=this.map.getControlsByClass("NSZemljevid.PanZoomBar3");if(d.length==0){var c=new NSZemljevid.PanZoomBar3({zoomStopHeight:12,zoomStopWidth:49,position:new OpenLayers.Pixel(5,5)});this.map.addControl(c);return c}return d[0]},addPanZoomControl4:function(){var d=this.map.getControlsByClass("NSZemljevid.PanZoomBar4");if(d.length==0){NSZemljevid.Instance=this;var c=new NSZemljevid.PanZoomBar4({zoomStopHeight:12,zoomStopWidth:49,position:new OpenLayers.Pixel(5,5),options:arguments[0]});this.map.addControl(c);return c}return d[0]},removeGPSControl:function(){var b=this.map.getControlsByClass("MousePositionGPS")[0];if(!b){return}this.map.removeControl(b);b=null},removeMeasureControl:function(){var b=this.map.getControlsByClass("Measure")[0];if(!b){return}this.map.removeControl(b)},addOverviewControl:function(){var d={tileSize:new OpenLayers.Size(NSZemljevid.TILE_SIZE,NSZemljevid.TILE_SIZE),maxExtent:new OpenLayers.Bounds(0,0,NSZemljevid.MAX_RESOLUTION,NSZemljevid.MAX_RESOLUTION),maxResolution:NSZemljevid.MAX_RESOLUTION/NSZemljevid.TILE_SIZE};var e=new OpenLayers.Control.OverviewMap({size:new OpenLayers.Size(200,110),mapOptions:d,minRatio:16,maxRatio:16});this.map.addControl(e);e.div.style.position="absolute";e.div.style.right="0";e.div.style.bottom="0";e.element.style.padding="0";e.element.style.borderTop="2px solid #444";e.element.style.borderLeft="2px solid #444";try{e.mapDiv.style.borderBottom="0 px solid #fff";e.mapDiv.style.borderRight="0 px solid #fff"}catch(f){}e.mapDiv.className="";e.mapDiv.style.zIndex=0;e.mapDiv.style.display="block";e.minimizeDiv.style.right="0";e.minimizeDiv.style.bottom="0";e.minimizeDiv.style.cursor="pointer";e.maximizeDiv.style.right="0";e.maximizeDiv.style.bottom="0";e.maximizeDiv.style.cursor="pointer";e.extentRectangle.style.overflow="hidden";e.extentRectangle.style.background="url("+OpenLayers.ImgPath+"blank.gif) no-repeat 0 0";e.extentRectangle.style.cursor="move";e.extentRectangle.style.backgroundColor="#003B54";e.extentRectangle.style.opacity=".4";e.extentRectangle.style.filter="alpha(opacity=40)"},addGPSMeasure:function(d){var c=this.map.getControlsByClass("NSZemljevid.Overlays")[0];if(c){c.addGPSMeasure(d)}else{c=this.enableOverlays();c.addGPSMeasure(d)}},removePanZoomControl:function(){var b=this.map.getControlsByClass("NSZemljevid.PanZoomBar");if(b.length!=0){this.map.removeControl(b[0])}else{b=this.map.getControlsByClass("NSZemljevid.PanZoomBar2");if(b.length!=0){this.map.removeControl(b[0])}else{b=this.map.getControlsByClass("NSZemljevid.PanZoomBar3");if(b.length!=0){this.map.removeControl(b[0])}}}},addEventListener:function(e,d,f){if(e=="resize"){if(typeof f=="undefined"){OpenLayers.Event.observe(window,"resize",OpenLayers.Function.bind(d,this))}else{OpenLayers.Event.observe(window,"resize",OpenLayers.Function.bind(d,f))}return}if(typeof f=="undefined"){this.map.events.register(e,this,d)}else{this.map.events.register(e,f,d)}},removeEventListener:function(e,d,f){if(typeof f=="undefined"){this.map.events.unregister(e,this,d)}else{this.map.events.unregister(e,f,d)}},setSize:function(f,g){try{if(f){this.map.div.style.width=parseInt(f)+"px"}if(g){this.map.div.style.height=parseInt(g)+"px"}this.map.updateSize();var e=this.map.getControlsByClass("NSZemljevid.PanZoomBar4")[0];if(typeof e!="undefined"){e.updateBtPos()}}catch(i){}},addMarker:function(d,c){if(d.isDraggable()){this.addDragM(d,c)}else{this.addNoDragM(d,c)}},_createVectorLayers:function(){var f=new OpenLayers.Layer.Vector("NoDraggableMarkers",{isBaseLayer:false,styleMap:this.getMarkerStyleMap()});var d=new OpenLayers.Layer.Vector("DraggableMarkers",{isBaseLayer:false,styleMap:this.getMarkerStyleMap()});this.map.addLayers([f,d]);var e=new OpenLayers.Control.DragFeature(d,{onComplete:function(k,j){if(k.isDraggable()){var b=new OpenLayers.LonLat(k.geometry.x,k.geometry.y);var a=this.map.info.getGKFromLonLat(b);if(typeof k.ll.CLASS_NAME!="undefined"&&k.ll.CLASS_NAME.match(/LonLat$/ig)){k.ll=b}else{if(k.ll.CLASS.match(/LonLat$/ig)){var c=this.map.info.gk2GPS(a.y,a.x);k.ll=new NSZemljevid.LonLat(c.lon,c.lat);c=null}else{k.ll=new NSZemljevid.GK(a.x,a.y)}}k.lonlat=b;b=a=null;if(k._dragend){if(k.context){k._dragend.apply(k.context,[k])}else{k._dragend(k)}}}},onStart:function(b,a){if(b.popup){this.map.removePopup(b.popup);b.popup.destroy();b.popup=null}if(b._dragstart){if(b.context){b._dragstart.apply(b.context,[b])}else{b._dragstart(b)}}}});e.handlers.feature.stopClick=false;this.map.addControl(e);e.activate()},featureOver:function(b){if(b.feature._mouseover){if(b.feature.context){b.feature._mouseover.apply(b.feature.context,[b.feature])}else{b.feature._mouseover(b.feature)}}},featureOut:function(b){if(b.feature._mouseout){if(b.feature.context){b.feature._mouseout.apply(b.feature.context,[b.feature])}else{b.feature._mouseout(b.feature)}}},onFeatureClick:function(b){if(this.adm&&b.attributes.tip){this.adm.onFeatureClick.apply(this.adm,[b])}if(b._click){if(b.context){b._click.apply(b.context,[b])}else{b._click(b)}}},addNoDragM:function(e,d){var f=this.map.getLayersByName("NoDraggableMarkers")[0];if(!f||typeof f=="undefined"){this._createVectorLayers();f=this.map.getLayersByName("NoDraggableMarkers")[0]}f.addFeatures([e],d)},addDragM:function(e,d){var f=this.map.getLayersByName("DraggableMarkers")[0];if(!f||typeof f=="undefined"){this._createVectorLayers();f=this.map.getLayersByName("DraggableMarkers")[0]}f.addFeatures([e],d)},getMarkerStyleMap:function(){return new OpenLayers.StyleMap({"default":{externalGraphic:"${icon}",graphicZIndex:"${zIndex}",graphicYOffset:"${iconYOffset}",graphicXOffset:"${iconXOffset}",pointRadius:10,graphicWidth:"${iconWidth}",graphicHeight:"${iconHeight}",backgroundGraphic:"${backgroundGraphic}",backgroundHeight:"${backgroundHeight}",backgroundWidth:"${backgroundWidth}",backgroundYOffset:-23,backgroundXOffset:-1,backgroundGraphicZIndex:"10",graphicTitle:"${graphicTitle}"},select:{externalGraphic:"${selectIcon}",graphicYOffset:"${iconYOffset}",pointRadius:10,graphicWidth:"${iconWidth}",graphicHeight:"${iconHeight}",cursor:"${cursor}"},"delete":{display:"none"}})},addVectorMarker:function(r,l){if(typeof r=="undefined"){return}var v=null;if(r.CLASS=="NSZemljevid.GK"){v=this.map.info.getLonLat(r.x,r.y)}else{if(r.CLASS=="NSZemljevid.LonLat"){var q=this.map.info.fromWGS84ToGK(r);v=this.map.info.getLonLat(q.x,q.y)}else{return}}var s=null;if(typeof l!="undefined"){s=l}var n=this.map.getLayersByName("VectorLayer")[0];if(!n){n=new OpenLayers.Layer.Vector("VectorLayer");this.map.addLayer(n)}var u=new OpenLayers.Geometry.Point(v.lon,v.lat);var o=s!=null&&s.pointRadius?parseInt(s.pointRadius):40;var m=OpenLayers.Geometry.Polygon.createRegularPolygon(u,o,40,null);var t=new OpenLayers.Feature.Vector(m,null,s);n.addFeatures([t]);return t},removeVectorMarker:function(c){var d=this.map.getLayersByName("VectorLayer")[0];if(!d){return}if(c instanceof Array){d.destroyFeatures(c)}else{d.destroyFeatures([c])}if(d.features.length==0){this.map.removeLayer(d);d=null}},getMarkers:function(){var k=this.map.getLayersByName("DraggableMarkers")[0];var i=this.map.getLayersByName("NoDraggableMarkers")[0];var j=[];if(k){for(var f=0,g=k.features.length;f<g;f++){j.push(k.features[f])}}if(i){for(var f=0,g=i.features.length;f<g;f++){j.push(i.features[f])}}return j},removeAllMarkers:function(){var d=this.map.getLayersByName("DraggableMarkers")[0];var c=this.map.getLayersByName("NoDraggableMarkers")[0];if(d&&typeof d!="undefined"){d.removeFeatures(d.features)}if(c&&typeof c!="undefined"){c.removeFeatures(c.features)}},removeMarker:function(d){if(!d||d.CLASS!="NSZemljevid.Marker"){return}var c=null;if(d.options.draggable){c=this.map.getLayersByName("DraggableMarkers")[0]}else{c=this.map.getLayersByName("NoDraggableMarkers")[0]}if(!c){return}d.cleanUp();c.removeFeatures([d]);c=null},zoomToMarkersExtent:function(){var e=this.map.getLayersByName("DraggableMarkers")[0];var d=this.map.getLayersByName("NoDraggableMarkers")[0];var f=null;if(e){f=e.getDataExtent()}if(d){if(f){f.extend(d.getDataExtent())}else{f=d.getDataExtent()}}if(f){this.map.zoomToExtent(f)}},closePopup:function(){if(this.map.popups.length==0){return}this.map.removePopup(this.map.popups[0])},defaultPopup:function(b){if(typeof b=="undefined"||!b||b=="NSZemljevid.FramedCloud"){this.map.defaultPopup=NSZemljevid.FramedCloud}else{if(b=="NSZemljevid.FramedCloud2"){this.map.defaultPopup=NSZemljevid.FramedCloud2}else{if(b=="NSZemljevid.FramedCloud3"){this.map.defaultPopup=NSZemljevid.FramedCloud3}}}},activateADM:function(c){if(!this.adm){this.adm=new NSZemljevid.ADM({EVENT_TYPES:["activate","deactivate","navigationToClick","navigationFromClick","sendMailClick","printClick"],proxy:c&&c.proxy?c.proxy:null});this.map.addControl(this.adm);var d={};d.minZoom=6;d.masterHide=false;this.adm.activate(d)}},deactivateADM:function(){this.adm.deactivate()},setupHost:function(){try{var e=document.getElementsByTagName("script");for(var m=0,i=e.length;m<i;m++){var j=e[m].getAttribute("src");if(j){if(j.match(/\/api\/NSZemljevid\-/g)){var l=j.substring(0,j.lastIndexOf("/")-3);NSZemljevid.ADM_SERVICE=l+"servlet/MapAdsServlet";break}}}}catch(k){}},drawNavigation:function(u,i){if(!u){return}var E={strokeColor:"#ff0000",strokeWidth:5,strokeOpacity:0.5};if(i&&i.style){OpenLayers.Util.extend(E,i.style)}var t={startIcon:new NSZemljevid.Icon(NS_RED_ICON,"A"),endIcon:new NSZemljevid.Icon(NS_RED_ICON,"B")};if(i&&i.startIcon&&i.endIcon){t.startIcon=i.startIcon;t.endIcon=i.endIcon}var z=new NSZemljevid.Marker(new NSZemljevid.GK(u[0].x,u[0].y),{icon:t.startIcon,navigation:true});var r=u.length;var B=u[r-1];var v=new NSZemljevid.Marker(new NSZemljevid.GK(B.x,B.y),{icon:t.endIcon,navigation:true});var F=this.map.getLayersByName("NavLayer")[0];if(!F){F=this._addNavigationLayer()}if(F){for(var C=0;C<r;C++){var A=u[C];var w=this.map.info.getLonLat(A.x,A.y);A.x=w.lon,A.y=w.lat}var D=new OpenLayers.Geometry.LineString(u);var s=new OpenLayers.Feature.Vector(D,null,E);this.clearNavigation();F.addFeatures([s,z,v]);this.map.zoomToExtent(F.getDataExtent())}},_addNavigationLayer:function(){var g=new OpenLayers.Layer.Vector("NavLayer",{styleMap:new OpenLayers.StyleMap({"default":{externalGraphic:"${icon}",graphicZIndex:"${zIndex}",graphicYOffset:"${iconYOffset}",graphicXOffset:"${iconXOffset}",pointRadius:10,graphicWidth:"${iconWidth}",graphicHeight:"${iconHeight}",label:"${iconLabel}",fontFamily:"Arial",fontColor:"${fontColor}",fontSize:"11px",fontWeight:"bold",backgroundGraphic:"${backgroundGraphic}",backgroundHeight:"${backgroundHeight}",backgroundWidth:"${backgroundWidth}",backgroundYOffset:-23,backgroundXOffset:-1,backgroundGraphicZIndex:"10",labelYOffset:"${iconLabelYOffset}",graphicTitle:"${graphicTitle}"},select:{externalGraphic:"${selectIcon}",graphicYOffset:"${iconYOffset}",pointRadius:10,graphicWidth:"${iconWidth}",graphicHeight:"${iconHeight}",cursor:"${cursor}"},"delete":{display:"none"}}),displayInLayerSwitcher:false,isBaseLayer:false});this.map.addLayer(g);for(var i=0,f=this.map.layers.length;i<f;i++){var e=this.map.layers[i];if(!e.isBaseLayer){continue}this.map.setLayerIndex(g,this.map.getLayerIndex(e));this.map.resetLayersZIndex();break}return g},clearNavigation:function(){var b=this.map.getLayersByName("NavLayer")[0];if(b){b.destroyFeatures()}},isSatelliteControlActive:function(){var b=this.map.getControlsByClass("NSZemljevid.DOFControl")[0];if(!b){return false}if(b.active){return true}return false},isStandardControlActive:function(){var b=this.map.getControlsByClass("NSZemljevid.StandardMapControl")[0];if(!b){return false}if(b.active){return true}return false},isHybridControlActive:function(){var b=this.map.getControlsByClass("NSZemljevid.HybridControl")[0];if(!b){return false}if(b.active){return true}return false},addSatelliteControl:function(d){var f=this.map.getControlsByClass("NSZemljevid.DOFControl")[0];if(f){return f}var e={btTitle:"Satelit",top:7,right:this.startBtPos+75*this.currentBtPos,clickActive:true};OpenLayers.Util.extend(e,d);f=new NSZemljevid.DOFControl(e);this.currentBtPos+=1;this.map.addControl(f);this._moveControls();return f},_moveControls:function(){if(this.currentBtPos==1){this._addStandardControl()}else{if(this.currentBtPos==3){var f=this.getControlByClass("NSZemljevid.StandardMapControl");if(f){f.div.style.right=this.startBtPos+75*2+"px";f.show()}var i=this.getControlByClass("NSZemljevid.DOFControl");if(i){i.div.style.right=this.startBtPos+75+"px"}}else{if(this.currentBtPos==2){var d=this.getControlByClass("NSZemljevid.StandardMapControl");d.show();var g=this.getControlByClass("NSZemljevid.DOFControl");if(g){d.div.style.right=this.startBtPos+"px"}else{d.div.style.right=this.startBtPos+75+"px"}}}}},_addStandardControl:function(){var c=this.map.getControlsByClass("NSZemljevid.StandardMapControl")[0];if(c){c.show();return c}var d=new NSZemljevid.StandardMapControl({btTitle:"Zemljevid",top:7,right:this.startBtPos+75*this.currentBtPos,clickActive:true,currentBtPos:this.currentBtPos,eventListeners:{onActivate:OpenLayers.Function.bind(this.onStandardMapTypeActivate,this)}});this.currentBtPos+=1;this.map.addControl(d);return d},onStandardMapTypeActivate:function(b){this.setCookie(b.type)},addHybridControl:function(f){var d=this.map.getControlsByClass("NSZemljevid.HybridControl")[0];if(d){return d}var e={btTitle:"Hibrid",top:7,right:this.startBtPos,clickActive:true};OpenLayers.Util.extend(e,f);d=new NSZemljevid.HybridControl(e);this.currentBtPos+=1;this.map.addControl(d);this._moveControls();return d},activateSatelliteMap:function(){var b=this.map.getControlsByClass("NSZemljevid.DOFControl")[0];if(!b){return}if(!b.active){b.activate()}},activateHybridMap:function(){var b=this.map.getControlsByClass("NSZemljevid.HybridControl")[0];if(!b){return}if(!b.active){b.activate()}},activateStandardMap:function(){var b=this.map.getControlsByClass("NSZemljevid.StandardMapControl")[0];if(!b){return}if(!b.active){b.activate()}},activeOverlays:function(){var b=this.map.getControlsByClass("NSZemljevid.Overlays")[0];if(!b){return null}return b.activeOverlays()},enableOverlays:function(e){var f=this.map.getControlsByClass("NSZemljevid.Overlays")[0];if(f){f.registerListeners(e)}else{var d=new Object();OpenLayers.Util.extend(d,e);f=new NSZemljevid.Overlays(d);this.map.addControl(f)}return f},getControlByClass:function(c){if(c){var d=this.map.getControlsByClass(c)[0];if(d){return d}}return null},setCookie:function(j){var f=new Date();f.setTime(f.getTime()+5*24*60*60*1000);var g="; expires="+f.toGMTString();var i="; path=/";var k=(document.domain.indexOf(".najdi.si")!=-1)?"; domain=.najdi.si":"";document.cookie="_ns_zemljevid_map_type="+j+g+k+i},readCookie:function(){var b=document.cookie.match("_ns_zemljevid_map_type=(.*?)(;|$)");return b},CLASS_NAME:"NSZemljevid"});NSZemljevid.Instance=null;NSZemljevid.Map=OpenLayers.Class(OpenLayers.Map,{initialize:function(){OpenLayers.Map.prototype.initialize.apply(this,arguments)},isValidZoomLevel:function(d){var e,f=null;e=this.minZoom?this.minZoom:NSZemljevid.INITIAL_ZOOM;f=this.maxZoom?this.maxZoom:this.getNumZoomLevels();return((d!=null)&&(d>=e)&&(d<f))},removePopup:function(d){OpenLayers.Util.removeItem(this.popups,d);if(d.div){try{this.layerContainerDiv.removeChild(d.div)}catch(c){}}d.map=null;this.events.triggerEvent("popupclose")},_nsz_setCenter:function(g,e){if(g.CLASS!="NSZemljevid.LonLat"&&g.CLASS!="NSZemljevid.GK"){throw"NSZemljevid.LonLat or NSZemljevid.GK required";return}var f=NSZemljevid.INITIAL_ZOOM;if(typeof e=="undefined"){f=this.zoom}else{f=e}if(g.CLASS=="NSZemljevid.LonLat"){var i=this.info.fromWGS84ToGK(g);this.setCenter(this.info.getLonLat(i.x,i.y),f);i=null}else{this.setCenter(this.info.getLonLat(g.x,g.y),f)}},_nsz_panTo:function(c){if(c.CLASS!="NSZemljevid.LonLat"&&c.CLASS!="NSZemljevid.GK"){throw"NSZemljevid.LonLat or NSZemljevid.GK required";return}if(c.CLASS=="NSZemljevid.LonLat"){var d=this.info.fromWGS84ToGK(c);this.panTo(this.info.getLonLat(d.x,d.y));d=null}else{this.panTo(this.info.getLonLat(c.x,c.y))}},_nsz_getCenter:function(f){var e=this.getCenter();if(typeof f=="undefined"||f==NSZemljevid.GK_COORD){return this.info.getGKFromLonLat(e)}else{var d=this.info.getGKFromLonLat(e);return this.info.gk2GPS(d.y,d.x)}return null},_nsz_center2:function(d){if(!this.isValidZoomLevel(d)){return}var f=this._nsz_getCenter();var e=this.info.getFaktor(150,this.getZoom());this._nsz_setCenter(new NSZemljevid.GK(f.x+e,f.y),d);e=this.info.getFaktor(150,d);f=this._nsz_getCenter();this._nsz_setCenter(new NSZemljevid.GK(f.x-e,f.y))}});NSZemljevid.LonLat=OpenLayers.Class({lon:null,lat:null,initialize:function(d,c){this.lon=d;this.lat=c},clone:function(){return new NSZemljevid.LonLat(this.lon,this.lat)},CLASS:"NSZemljevid.LonLat"});NSZemljevid.GK=OpenLayers.Class({x:null,y:null,initialize:function(c,d){this.x=c;this.y=d},clone:function(){return new NSZemljevid.GK(this.x,this.y)},CLASS:"NSZemljevid.GK"});NSZemljevid.onWeatherData=function(b){NSZemljevid.weatherControl.onWeatherData(b)};NSZemljevid.onCameraData=function(b){NSZemljevid.cameraControl.onCameraData(b)};OpenLayers.Layer.Vector.prototype.drawFeature=function(e,i){if(!this.drawn){return}if(typeof i!="object"){if(!i&&e.state===OpenLayers.State.DELETE){i="delete"}var g=i||e.renderIntent;i=e.style||this.style;if(!i){i=this.styleMap.createSymbolizer(e,g);for(var f in i){if(i[f]==false||i[f]=="undefined"){delete i[f]}}}}if(!this.renderer.drawFeature(e,i)){this.unrenderedFeatures[e.id]=e}else{delete this.unrenderedFeatures[e.id]}};document.write('<style type="text/css">.olHandlerBoxZoomBox{background-color:white;border:2px solid red;font-size:1px;opacity:0.5;position:absolute;filter: alpha(opacity=50);}</style>');NSZemljevid.Marker=OpenLayers.Class(OpenLayers.Feature.Vector,{_mouseover:null,_mouseout:null,_click:null,_dragend:null,_dragstart:null,context:null,ll:null,lonlat:null,options:null,initialize:function(j,l){if(typeof j=="undefined"){return}this.ll=j;var m={draggable:false,dropShadow:true};if(typeof l!="undefined"){this.options=OpenLayers.Util.extend(m,l);m=null}else{this.options=m}if(typeof this.options.icon=="undefined"){this.options.icon=new NSZemljevid.Icon(NS_RED_ICON)}var k=this.getMapLonLat(j);var g={icon:this.options.icon.url,selectIcon:this.getSelectIcon(),iconYOffset:this.options.icon.offset?this.options.icon.offset.y:-this.options.icon.size.h,iconXOffset:this.options.icon.offset?this.options.icon.offset.x:(this.options.icon.size.w/2),iconWidth:this.options.icon.size.w,iconHeight:this.options.icon.size.h,cursor:this.options.draggable?"move":"pointer",graphicTitle:this.options.graphicTitle?this.options.graphicTitle.replace(/<\/?b>/ig,"").replace("&amp;","-"):"",zIndex:this.options.zIndex?this.options.zIndex:11};if(this.options.icon.CLASS.match(/icon$/ig)&&this.options.dropShadow){g.backgroundGraphic=OpenLayers.ImgPath+"shadow_v2.png";g.backgroundWidth=28;g.backgroundHeight=24}if(this.options.navigation){g.iconLabel=this.options.icon.index?this.options.icon.index:"";g.fontColor="#ffffff";g.iconLabelYOffset=22}var i=new OpenLayers.Geometry.Point(k.lon,k.lat);OpenLayers.Feature.Vector.prototype.initialize.apply(this,[i,g,null]);this.lonlat=k},getMapLonLat:function(g){if(typeof g.CLASS_NAME!="undeined"&&g.CLASS_NAME=="OpenLayers.LonLat"){return g}var f=null;var e=new NSZemljevid.IMapInfo();if(this.ll.CLASS=="NSZemljevid.GK"){f=e.getLonLat(this.ll.x,this.ll.y)}else{if(this.ll.CLASS=="NSZemljevid.LonLat"){var i=e.fromWGS84ToGK(this.ll);f=e.getLonLat(i.x,i.y)}}e=null;return f},getSelectIcon:function(){if(!this.options.hover||this.options.icon.CLASS.match(/icon4$/ig)){return this.options.icon.url}if(this.options.icon.index){return OpenLayers.ImgPath+"marker/"+this.options.icon.iconSet.selected+this.options.icon.index+".png"}return OpenLayers.ImgPath+this.options.icon.iconSet.selected+".png"},isDraggable:function(){return this.options.draggable},getCoordinate:function(){if(typeof this.ll.CLASS_NAME!="undefined"&&this.ll.CLASS_NAME.match(/LonLat/ig)){var b=this.layer.map.info.getGKFromLonLat(this.ll);return this.layer.map.info.gk2GPS(b.y,b.x)}return this.ll},getIndex:function(){return this.options.icon.index},addEventListener:function(f,d,e){if(f=="mouseover"||f=="mouseout"||f=="click"||f=="dragend"||f=="dragstart"){this["_"+f]=d;if(typeof e!="undefined"){this.context=e}}},removeEventListener:function(f,d,e){this["_"+f]=null;this.context=null},openPopup:function(g,e,f){if(typeof g=="undefined"||g==""){return}if(this.options.icon.CLASS.match(/icon$/ig)||this.options.icon.CLASS.match(/icon2$/ig)){this.layer.map.defaultPopup=NSZemljevid.FramedCloud}else{if(this.options.icon.CLASS.match(/icon4$/ig)){this.layer.map.defaultPopup=NSZemljevid.FramedCloud2}}var i=new this.layer.map.defaultPopup("nsPopup",this.lonlat,null,g,this.options.icon,true,f?f:null,e);this.popup=i;this.layer.map.addPopup(i,true)},cleanUp:function(){this._mouseover=this._mouseout=this._click=this._dragend=this._dragstart=this.context=this.options=null},CLASS:"NSZemljevid.Marker"});NSZemljevid.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{initialize:function(l,q,m,r,j,n,o,k){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative2.png";OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass;this.closeDiv.style.background="transparent url("+OpenLayers.ImgPath+"close.png) no-repeat scroll 0 0";this.closeDiv.style.cursor="pointer";this.closeDivPadd=false},contentDisplayClass:"popupContent",autoSize:true,fixedRelativePosition:false,minSize:new OpenLayers.Size(105,10),imageSize:new OpenLayers.Size(497,642),isAlphaImage:true,panMapIfOutOfView:true,maxSize:new OpenLayers.Size(497,642),destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"NSZemljevid.FramedCloud",positionBlocks:{tl:{offset:new OpenLayers.Pixel(20,5),padding:new OpenLayers.Bounds(2,60,7,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,60,15,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,66,0,0),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,50,15,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,50,0,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(48,52),anchor:new OpenLayers.Bounds(null,5,3,null),position:new OpenLayers.Pixel(-112,-589)}]},tr:{offset:new OpenLayers.Pixel(-15,5),padding:new OpenLayers.Bounds(2,60,7,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,60,15,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,66,0,0),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,50,15,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,50,0,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(48,52),anchor:new OpenLayers.Bounds(0,5,null,null),position:new OpenLayers.Pixel(-2,-588)}]},bl:{offset:new OpenLayers.Pixel(21,-15),padding:new OpenLayers.Bounds(2,5,7,67),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,16,16,60),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,16,1,60),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,0,16,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,0,1,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(51,50),anchor:new OpenLayers.Bounds(null,null,0,11),position:new OpenLayers.Pixel(-177,-586)}]},br:{offset:new OpenLayers.Pixel(-13,-13),padding:new OpenLayers.Bounds(2,5,7,67),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,16,16,60),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,16,1,60),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,0,16,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,0,1,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(51,50),anchor:new OpenLayers.Bounds(0,null,null,11),position:new OpenLayers.Pixel(-60,-588)}]}}});NSZemljevid.FramedCloudOkx=OpenLayers.Class(OpenLayers.Popup.Framed,{initialize:function(k,o,l,i,j,m,n){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative2.png";OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass;this.closeDiv.style.background="transparent url("+OpenLayers.ImgPath+"close.png) no-repeat scroll 0 0";this.closeDiv.style.cursor="pointer";this.closeDivPadd=false},contentDisplayClass:"popupContent",autoSize:true,fixedRelativePosition:false,minSize:new OpenLayers.Size(105,10),imageSize:new OpenLayers.Size(497,642),maxSize:new OpenLayers.Size(497,642),isAlphaImage:true,panMapIfOutOfView:true,closePopup:function(b){this.hide();OpenLayers.Event.stop(b)},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"NSZemljevid.FramedCloudOkx",positionBlocks:{tl:{offset:new OpenLayers.Pixel(12,15),padding:new OpenLayers.Bounds(2,60,7,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,60,15,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,66,0,0),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,50,15,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,50,0,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(48,52),anchor:new OpenLayers.Bounds(null,5,3,null),position:new OpenLayers.Pixel(-112,-589)}]},tr:{offset:new OpenLayers.Pixel(-8,14),padding:new OpenLayers.Bounds(2,60,7,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,60,15,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,66,0,0),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,50,15,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,50,0,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(48,52),anchor:new OpenLayers.Bounds(0,6,null,null),position:new OpenLayers.Pixel(-2,-588)}]},bl:{offset:new OpenLayers.Pixel(13,-22),padding:new OpenLayers.Bounds(2,5,7,67),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,16,16,60),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,16,1,60),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,0,16,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,0,1,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(51,50),anchor:new OpenLayers.Bounds(null,null,0,11),position:new OpenLayers.Pixel(-177,-586)}]},br:{offset:new OpenLayers.Pixel(-7,-20),padding:new OpenLayers.Bounds(2,5,7,67),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,16,16,60),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(15,"auto"),anchor:new OpenLayers.Bounds(null,16,1,60),position:new OpenLayers.Pixel(-482,0)},{size:new OpenLayers.Size("auto",16),anchor:new OpenLayers.Bounds(0,0,16,null),position:new OpenLayers.Pixel(0,-560)},{size:new OpenLayers.Size(15,16),anchor:new OpenLayers.Bounds(null,0,1,null),position:new OpenLayers.Pixel(-482,-560)},{size:new OpenLayers.Size(51,50),anchor:new OpenLayers.Bounds(0,null,null,11),position:new OpenLayers.Pixel(-60,-588)}]}}});NSZemljevid.Scale=OpenLayers.Class(OpenLayers.Control,{iscaleImage:null,revision:"2.2",initialize:function(b){OpenLayers.Control.prototype.initialize.apply(this,[b])},CLASS_NAME:"IScale",draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.iscaleImage){this.div.style.display="block";this.div.style.position="absolute";this.iscale=document.createElement("div");this.iscale.className=this.displayClass+"bottom";this.div.style.left="5px";this.div.style.bottom="20px";this.div.appendChild(this.iscale);this.iscaleImage=document.createElement("img");this.iscale.appendChild(this.iscaleImage);this.iscaleImage.src=NSZemljevid.IMGURL+"/2"}this.map.events.register("moveend",this,this.update);this.update();return this.div},update:function(){var b=this.map.getResolution();if(!b){return}this.iscaleImage.src=NSZemljevid.IMGURL+"/zoom/"+this.map.zoom},setPosition:function(f,e){try{this.div.style.left=parseInt(f)+"px";this.div.style.bottom=parseInt(e)+"px"}catch(d){}}});NSZemljevid.CopyRight=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"NSZemljevid.CopyRight",initialize:function(b){OpenLayers.Control.prototype.initialize.apply(this,[b])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.div.style.bottom="3px";this.div.style.left="5px";this.div.style.color="#333";this.div.style.fontFamily="Verdana";this.div.style.fontSize="10px";this.div.style.overflow="hidden";this.div.style.height="13px";this.div.style.whiteSpace="nowrap";this.div.style.textShadow="0 1px 10px #333333";var b="&copy; 2010 Najdi.si - podatki &copy; 2010 Monolit, &copy; 2010 ";this.div.innerHTML=b;this.link=document.createElement("a");this.link.style.color="#333333";this.link.style.textDecoration="underline";this.link.setAttribute("href","http://www.gu.gov.si");this.link.setAttribute("target","_blank");this.div.appendChild(this.link);this.link.innerHTML="GURS";return this.div},setWhite:function(){this.link.style.color="#fff";this.div.style.color="#fff";this.div.style.textShadow="0 1px 1px #000"},setBlack:function(){this.link.style.color="#333";this.div.style.color="#333";this.div.style.textShadow="0 1px 10px #333"},setPosition:function(f,e){try{this.div.style.left=parseInt(f)+"px";this.div.style.bottom=parseInt(e)+"px"}catch(d){}}});NSZemljevid.PanZoomBar2=OpenLayers.Class(OpenLayers.Control.PanZoomBar,{CLASS_NAME:"NSZemljevid.PanZoomBar2",slideFactor:50,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},buttonDown:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor());break;case"pandown":this.map.pan(0,this.getSlideFactor());break;case"panleft":this.map.pan(-this.getSlideFactor(),0);break;case"panright":this.map.pan(this.getSlideFactor(),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break}OpenLayers.Event.stop(b)},draw:function(E){OpenLayers.Control.prototype.draw.apply(this,arguments);E=this.position.clone();var r=OpenLayers.Util.getImagesLocation();this.buttons=[];var F=new OpenLayers.Size(19,19);var B=OpenLayers.Util.createAlphaImageDiv("_03",E,F,r+"nav2_03.png","absolute");this.div.appendChild(B);var v=this._addButton("panup","nav2_04.png",E.add(19,0),new OpenLayers.Size(18,19));v.style.cursor="pointer";F=new OpenLayers.Size(21,19);var C=OpenLayers.Util.createAlphaImageDiv("_05",E.add(37,0),F,r+"nav2_05.png","absolute");this.div.appendChild(C);var t=this._addButton("panleft","nav2_07.png",E.add(0,19),new OpenLayers.Size(19,18));t.style.cursor="pointer";F=new OpenLayers.Size(18,18);var A=OpenLayers.Util.createAlphaImageDiv("_08",E.add(19,19),F,r+"nav2_08.png","absolute");this.div.appendChild(A);var D=this._addButton("panright","nav2_09.png",E.add(37,19),new OpenLayers.Size(21,18));D.style.cursor="pointer";F=new OpenLayers.Size(19,21);var q=OpenLayers.Util.createAlphaImageDiv("_10",E.add(0,37),F,r+"nav2_10.png","absolute");this.div.appendChild(q);var z=this._addButton("pandown","nav2_11.png",E.add(19,37),new OpenLayers.Size(18,21));z.style.cursor="pointer";F=new OpenLayers.Size(21,21);var s=OpenLayers.Util.createAlphaImageDiv("_12",E.add(37,37),F,r+"nav2_12.png","absolute");this.div.appendChild(s);var u=this._addButton("zoomout","nav2_15.png",E.add(6,65),new OpenLayers.Size(22,24));u.style.cursor="pointer";var w=this._addButton("zoomin","nav2_16.png",E.add(28,65),new OpenLayers.Size(24,24));w.style.cursor="pointer";return this.div},_removeZoomBar:function(){this.div.removeChild($("_03"));this.div.removeChild($("_05"));this.div.removeChild($("_08"));this.div.removeChild($("_10"));this.div.removeChild($("_12"))},setPosition:function(f,d){try{this.moveTo(new OpenLayers.Pixel(parseInt(f),parseInt(d)))}catch(e){}}});NSZemljevid.PanZoomBar3=OpenLayers.Class(OpenLayers.Control.PanZoomBar,{CLASS_NAME:"NSZemljevid.PanZoomBar3",initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},buttonDown:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor());break;case"pandown":this.map.pan(0,this.getSlideFactor());break;case"panleft":this.map.pan(-this.getSlideFactor(),0);break;case"panright":this.map.pan(this.getSlideFactor(),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break}OpenLayers.Event.stop(b)},draw:function(F){OpenLayers.Control.prototype.draw.apply(this,arguments);F=this.position.clone();var r=OpenLayers.Util.getImagesLocation();this.buttons=[];OpenLayers.Event.observe(this.div,"mouseover",OpenLayers.Function.bind(this.onNavMouseOver,this));OpenLayers.Event.observe(this.div,"mouseout",OpenLayers.Function.bind(this.onNavMouseOut,this));var q=new OpenLayers.Size(21,22);var B=OpenLayers.Util.createAlphaImageDiv("_03",F,q,r+"firma/nav-firma-white-ul.png","absolute");this.div.appendChild(B);var u=this._addButton("panup","firma/nav-firma-white_u.png",F.add(21,0),new OpenLayers.Size(25,22));u.style.cursor="pointer";var D=OpenLayers.Util.createAlphaImageDiv("_04",F.add(46,0),new OpenLayers.Size(21,22),r+"firma/nav-firma-white_ur.png","absolute");this.div.appendChild(D);var s=this._addButton("panleft","firma/nav-firma-white_l.png",F.add(0,22),new OpenLayers.Size(21,24));s.style.cursor="pointer";var A=OpenLayers.Util.createAlphaImageDiv("_05",F.add(21,22),new OpenLayers.Size(25,24),r+"firma/nav-firma-white_cent.png","absolute");this.div.appendChild(A);var E=this._addButton("panright","firma/nav-firma-white_r.png",F.add(46,22),new OpenLayers.Size(21,24));E.style.cursor="pointer";var v=OpenLayers.Util.createAlphaImageDiv("_06",F.add(0,46),new OpenLayers.Size(21,21),r+"firma/nav-firma-white_bl.png","absolute");this.div.appendChild(v);var z=this._addButton("pandown","firma/nav-firma-white_d.png",F.add(21,46),new OpenLayers.Size(25,21));z.style.cursor="pointer";var C=OpenLayers.Util.createAlphaImageDiv("_07",F.add(46,46),new OpenLayers.Size(21,21),r+"firma/nav-firma-white_br.png","absolute");this.div.appendChild(C);var t=this._addButton("zoomout","firma/zoomout-firma-hover.png",F.add(37,70),new OpenLayers.Size(29,29));t.style.cursor="pointer";var w=this._addButton("zoomin","firma/zoomin-firma-hover.png",F.add(3,70),new OpenLayers.Size(29,29));w.style.cursor="pointer";return this.div},onNavMouseOver:function(d){var f=OpenLayers.Event.element(d);if(!f.src){return}var e=OpenLayers.Util.getImagesLocation();if(f.id.match(/panup/ig)){f.src=e+"firma/nav-firma-black_u.png"}else{if(f.id.match(/panleft/ig)){f.src=e+"firma/nav-firma-black_l.png"}else{if(f.id.match(/panright/ig)){f.src=e+"firma/nav-firma-black_r.png"}else{if(f.id.match(/pandown/ig)){f.src=e+"firma/nav-firma-black_d.png"}else{if(f.id.match(/zoomin/ig)){f.src=e+"firma/zoomin-firma.png"}else{if(f.id.match(/zoomout/ig)){f.src=e+"firma/zoomout-firma.png"}}}}}}},onNavMouseOut:function(d){var f=OpenLayers.Event.element(d);if(!f.src){return}var e=OpenLayers.Util.getImagesLocation();if(f.id.match(/panup/ig)){f.src=e+"firma/nav-firma-white_u.png"}else{if(f.id.match(/panleft/ig)){f.src=e+"firma/nav-firma-white_l.png"}else{if(f.id.match(/panright/ig)){f.src=e+"firma/nav-firma-white_r.png"}else{if(f.id.match(/pandown/ig)){f.src=e+"firma/nav-firma-white_d.png"}else{if(f.id.match(/zoomin/ig)){f.src=e+"firma/zoomin-firma-hover.png"}else{if(f.id.match(/zoomout/ig)){f.src=e+"firma/zoomout-firma-hover.png"}}}}}}},_removeZoomBar:function(){this.div.removeChild($("_03"));this.div.removeChild($("_04"));this.div.removeChild($("_05"));this.div.removeChild($("_06"));this.div.removeChild($("_07"))},setPosition:function(f,d){try{this.moveTo(new OpenLayers.Pixel(parseInt(f),parseInt(d)))}catch(e){}}});NSZemljevid.PanZoomBar4=OpenLayers.Class(OpenLayers.Control.PanZoomBar,{CLASS_NAME:"NSZemljevid.PanZoomBar4",_enableAutoMarker:true,marker:null,fc:null,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},buttonDown:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor());break;case"pandown":this.map.pan(0,this.getSlideFactor());break;case"panleft":this.map.pan(-this.getSlideFactor(),0);break;case"panright":this.map.pan(this.getSlideFactor(),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break}OpenLayers.Event.stop(b)},draw:function(s){OpenLayers.Control.prototype.draw.apply(this,arguments);var D=this.map.getSize();var z=Math.ceil(D.w/2);var G=Math.ceil(D.h/2);s=this.position.clone();var B=OpenLayers.Util.getImagesLocation();this.buttons=[];var C=new OpenLayers.Size(30,25);var t=z-5-Math.ceil(C.w/2);var F=this._addButton("panup","firma/black-up.png",s.add(t,0),C);F.unselectable="on";F.style.cursor="pointer";C=new OpenLayers.Size(24,30);var v=G-5-Math.ceil(C.h/2);var H=this._addButton("panleft","firma/black-left.png",s.add(0,v),C);H.unselectable="on";H.style.cursor="pointer";var J=this._addButton("panright","firma/black-right.png",s.add(t*2,v),C.clone());J.unselectable="on";J.style.cursor="pointer";C=new OpenLayers.Size(30,24);var u=this._addButton("pandown","firma/black-down.png",s.add(t,v*2),C);u.unselectable="on";u.style.cursor="pointer";var I=this._addButton("zoomin","firma/zoomin-firma.png",s.add(0,0),new OpenLayers.Size(29,29));I.unselectable="on";I.style.cursor="pointer";var E=this._addButton("zoomout","firma/zoomout-firma.png",s.add(0,35),new OpenLayers.Size(29,29));E.unselectable="on";E.style.cursor="pointer";var A=new OpenLayers.Size(32,40);var w=OpenLayers.Util.createAlphaImageDiv("_03",s.add(0,35+29+10),A,B+"firma/user-marker-black.png","absolute");if(this.options&&this.options.hint){w.title=this.options.hint}w.style.cursor="pointer";if(NSZemljevid.Util.isChrome){w.id+=" _userMB"}w.unselectable="on";OpenLayers.Event.observe(this.div,"click",OpenLayers.Function.bind(this.onIconClick,this));this.div.appendChild(w);return this.div},updateBtPos:function(){var m=this.map.getSize();var o=Math.ceil(m.w/2);var n=Math.ceil(m.h/2);var k=o-5-15;var l=n-5-15;for(var q=0,i=this.buttons.length;q<i;q++){var r=this.buttons[q];if(r.id.match(/panup$/ig)){r.style.left=k+"px"}else{if(r.id.match(/panright/ig)){r.style.left=(k*2)+"px";r.style.top=l+"px"}else{if(r.id.match(/panleft/ig)){r.style.top=l+"px"}else{if(r.id.match(/pandown/ig)){r.style.left=k+"px";r.style.top=(l*2)+"px"}}}}}},onIconClick:function(g){var i=NSZemljevid.Util.isChrome;if(!i){OpenLayers.Event.stop(g)}if(this._enableAutoMarker){this._enableAutoMarker=false;var e=this.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(40,124));this.marker=new NSZemljevid.Marker(e,{icon:new NSZemljevid.Icon4(),draggable:true});var f=undefined;if(this.options&&this.options.click){this.marker.addEventListener("click",this.options.click)}if(this.options&&this.options.dragend){this.marker.addEventListener("dragend",this.options.dragend,this.options.scope)}if(this.options&&this.options.dragstart){this.marker.addEventListener("dragstart",this.options.dragstart)}if(this.options&&this.options.mouseover){this.marker.addEventListener("mouseover",this.options.mouseover)}if(this.options&&this.options.mouseout){this.marker.addEventListener("mouseout",this.options.mouseout)}if(i){OpenLayers.Event.observe(this.map.div,"click",OpenLayers.Function.bind(this.onMouseClick,this));this.map.events.on({mousemove:this.onMouseMove,scope:this})}else{this.map.events.on({mousemove:this.onMouseMove,click:this.onMouseClick,scope:this})}this.map.div.style.cursor="move";NSZemljevid.Instance.addMarker(this.marker)}},onMouseMove:function(b){this.marker.move(new OpenLayers.Pixel(b.xy.x,b.xy.y-5))},onMouseClick:function(f){this.map.div.style.cursor="";var e=OpenLayers.Event.element(f);if(e.id.match(/_userMB$/ig)){return}else{if(e.parentNode.id.match(/_userMB$/ig)){return}}if(this.marker._dragend){var d=new OpenLayers.LonLat(this.marker.geometry.x,this.marker.geometry.y);this.marker.ll=this.marker.lonlat=d;if(this.marker.context){this.marker._dragend.apply(this.marker.context,[this.marker])}else{this.marker._dragend(this.marker)}}this.marker=null;this.map.events.un({mousemove:this.onMouseMove,click:this.onMouseClick,scope:this})},_removeZoomBar:function(){this.div.removeChild($("_03"))},setPosition:function(f,d){try{this.moveTo(new OpenLayers.Pixel(parseInt(f),parseInt(d)))}catch(e){}}});NSZemljevid.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoomBar,{CLASS_NAME:"NSZemljevid.PanZoomBar",initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments);this.zoomStopHeight=11},buttonDown:function(f){if(!OpenLayers.Event.isLeftClick(f)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor());break;case"pandown":this.map.pan(0,this.getSlideFactor());break;case"panleft":this.map.pan(-this.getSlideFactor(),0);break;case"panright":this.map.pan(this.getSlideFactor(),0);break;case"zoomin":if(this.map.tstatus){this.map._nsz_center2(this.map.getZoom()+1)}else{this.map.zoomIn()}break;case"zoomout":if(this.map.tstatus){this.map._nsz_center2(this.map.getZoom()-1)}else{this.map.zoomOut()}break;case"zoomworld":if(!this.map.tstatus){this.map.zoomTo(NSZemljevid.INITIAL_ZOOM);this.map.zoomToMaxExtent()}else{this.map.zoomToMaxExtent();var g=this.map.info.getGKFromLonLat(this.map.getCenter());var e=this.map.info.getFaktor(150,NSZemljevid.INITIAL_ZOOM);var i=this.map.info.getLonLat(g.x-e,g.y);this.map.setCenter(i,NSZemljevid.INITIAL_ZOOM)}break}OpenLayers.Event.stop(f)},draw:function(D){OpenLayers.Control.prototype.draw.apply(this,arguments);D=this.position.clone();if(typeof this.map.tstatus!="undefined"&&this.map.tstatus==false){this.moveTo(new OpenLayers.Pixel(-145,5))}var s=OpenLayers.Util.getImagesLocation();this.buttons=[];var q=new OpenLayers.Size(19,19);var B=OpenLayers.Util.createAlphaImageDiv("_03",D,q,s+"zp_03.png","absolute");this.div.appendChild(B);var v=this._addButton("panup","zp_04.png",D.add(19,0),new OpenLayers.Size(18,19));v.style.cursor="pointer";q=new OpenLayers.Size(20,19);var C=OpenLayers.Util.createAlphaImageDiv("_05",D.add(37,0),q,s+"zp_05.png","absolute");this.div.appendChild(C);var w=this._addButton("panleft","zp_07.png",D.add(0,19),new OpenLayers.Size(19,17));var E=this._addButton("zoomworld","zp_08.png",D.add(19,19),new OpenLayers.Size(18,17));var A=this._addButton("panright","zp_09.png",D.add(37,19),new OpenLayers.Size(20,17));w.style.cursor="pointer";E.style.cursor="pointer";A.style.cursor="pointer";q=new OpenLayers.Size(19,21);var r=OpenLayers.Util.createAlphaImageDiv("_10",D.add(0,36),q,s+"zp_10.png","absolute");this.div.appendChild(r);var F=this._addButton("pandown","zp_11.png",D.add(19,36),new OpenLayers.Size(18,21));F.style.cursor="pointer";q=new OpenLayers.Size(20,21);var t=OpenLayers.Util.createAlphaImageDiv("_12",D.add(37,36),q,s+"zp_12.png","absolute");this.div.appendChild(t);var z=this._addButton("zoomin","zp-plus.png",D.add(13,60),new OpenLayers.Size(31,27));z.style.cursor="pointer";var u=this._addButton("zoomout","zp-minus.png",D.add(13,D.y+189),new OpenLayers.Size(31,27));u.style.cursor="pointer";this._addZoomBar(D.add(18,87));this._addTownStreetLevels();return this.div},_removeZoomBar:function(){this.sliderEvents.un({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});this.sliderEvents.destroy();this.divEvents.un({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.divEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.div.removeChild($("_03"));this.div.removeChild($("_05"));this.div.removeChild($("_10"));this.div.removeChild($("_12"));this.map.events.unregister("zoomend",this,this.moveZoomBar)},_addZoomBar:function(o){var k=OpenLayers.Util.getImagesLocation();var r=this.id+"_"+this.map.id;var n=this.map.getNumZoomLevels()-1-this.map.getZoom();var m=OpenLayers.Util.createDiv(r,o.add(0,n*this.zoomStopHeight),null,null,"absolute");m.style.width="19px";m.style.height="4px";m.style.cursor="pointer";var q=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(19,4),k+"zp-slider.png","relative",null,"image");q.style.padding="0 10px 10px 0";m.appendChild(q);this.slider=m;this.sliderEvents=new OpenLayers.Events(this,m,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var l=new OpenLayers.Size();l.h=107;l.w=this.zoomStopWidth;var s=null;if(OpenLayers.Util.alphaHack()){var t=this.id+"_"+this.map.id;s=OpenLayers.Util.createAlphaImageDiv(t,o,new OpenLayers.Size(l.w,this.zoomStopHeight),k+"zp-bar.png","absolute",null,"crop");s.style.height=l.h+"px"}else{s=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,o,l,k+"zp-bar.png")}s.style.cursor="pointer";s.style.backgroundRepeat="no-repeat";this.zoombarDiv=s;this.divEvents=new OpenLayers.Events(this,s,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick,mouseover:this.mouseOver,mouseout:this.mouseOut});this.div.appendChild(s);this.startTop=parseInt(s.style.top);this.div.appendChild(m);this.map.events.register("zoomend",this,this.moveZoomBar);o=o.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return o},mouseOver:function(){if(this._timerId){window.clearTimeout(this._timerId);this._timerId=null}else{this._streetTownDiv.style.display="block"}},mouseOut:function(b){this._timerId=window.setTimeout(OpenLayers.Function.bind(this.timeoutable,this,b),1000)},timeoutable:function(b){this._streetTownDiv.style.display="none";this._timerId=null},_addTownStreetLevels:function(){var f=OpenLayers.Util.getImagesLocation();var i=this.position.clone();var k=new OpenLayers.Pixel(50,98).add(i.x-5,i.y-5);this._streetTownDiv=OpenLayers.Util.createDiv("sliderLevels",k,null,null,"absolute");this._streetTownDiv.style.display="none";this.div.appendChild(this._streetTownDiv);var g=null;if(OpenLayers.Util.alphaHack()){g=OpenLayers.Util.createAlphaImageDiv("street",new OpenLayers.Pixel(0,0),new OpenLayers.Size(61,16),f+"zp-ulica.png","absolute",null,"crop")}else{g=OpenLayers.Util.createDiv("street",new OpenLayers.Pixel(0,0),new OpenLayers.Size(61,16),f+"zp-ulica.png")}g.style.cursor="pointer";this._streetTownDiv.appendChild(g);OpenLayers.Event.observe(g,"mouseover",this.levelMouseOver.bind(this));OpenLayers.Event.observe(g,"mouseout",this.levelMouseOut.bind(this));OpenLayers.Event.observe(g,"click",this.levelMouseClick.bind(this));var j=null;if(OpenLayers.Util.alphaHack()){j=OpenLayers.Util.createAlphaImageDiv("street",new OpenLayers.Pixel(0,0),new OpenLayers.Size(61,16),f+"zp-mesto.png","absolute",null,"crop")}else{j=OpenLayers.Util.createDiv("street",new OpenLayers.Pixel(0,0),new OpenLayers.Size(61,16),f+"zp-mesto.png")}j.id="town";j.style.top="34px";j.style.cursor="pointer";this._streetTownDiv.appendChild(j);OpenLayers.Event.observe(j,"mouseover",this.levelMouseOver.bind(this));OpenLayers.Event.observe(j,"mouseout",this.levelMouseOut.bind(this));OpenLayers.Event.observe(j,"click",this.levelMouseClick.bind(this))},levelMouseOver:function(b){if(this._timerId){window.clearTimeout(this._timerId);this._timerId=null}},levelMouseOut:function(b){if(!this._timerId){this._timerId=window.setTimeout(OpenLayers.Function.bind(this.timeoutable,this,b),1000)}},levelMouseClick:function(d){var c=OpenLayers.Event.element(d);if(c.id.match(/town|street/gi)){if(c.id.match(/town/)){if(this.map.tstatus){this.map._nsz_center2(7)}else{this.map.zoomTo(7)}}else{if(this.map.tstatus){this.map._nsz_center2(10)}else{this.map.zoomTo(10)}}}else{c=c.parentNode;if(c.id.match(/town/)){if(this.map.tstatus){this.map._nsz_center2(7)}else{this.map.zoomTo(7)}}else{if(this.map.tstatus){this.map._nsz_center2(10)}else{this.map.zoomTo(10)}}}},setPosition:function(f,d){try{this.moveTo(new OpenLayers.Pixel(parseInt(f),parseInt(d)))}catch(e){}}});NSZemljevid.IMapInfo=OpenLayers.Class({initialize:function(){this.X1=375209;this.X2=624161;this.Y1=30781;this.Y2=193272;this.rows=Math.pow(2,NSZemljevid.MAX_ZOOM_LEVEL);this.gfaktor=Math.round((this.rows/2*256*NSZemljevid.MAX_GEO_ZOOM)/this.getDpm());this.sloCenter=this.getSloCenter();this.minGeoX=this.sloCenter.x-this.gfaktor;this.minGeoY=this.gfaktor+this.sloCenter.y;this.wgs84_a=6378137;this.wgs84_a2=40680631590769;this.wgs84_b=6356752.314;this.wgs84_b2=40408299981544.4;this.wgs84_e2=0.00669438006676466;this.wgs84_e2_=0.00673949681993606;this.bessel_a=6377397.155;this.bessel_a2=40671194472602.1;this.bessel_b=6356078.963;this.bessel_b2=40399739783891.2;this.bessel_e2=0.00667437217497493;this.bessel_e2_=0.00671921874158131;this.bessel_e4=0.0000445472439300796;this.bessel_e6=2.97324885358744e-7;this.bessel_e8=1.98445694176601e-9;this.dX=-409.520465;this.dY=-72.191827;this.dZ=-486.872387;this.Alfa=0.0000149625622332431;this.Beta=0.0000265141935723559;this.Gama=-0.000053428261468891;this.dm=-0.000017919456;this.M0=new Array(1,Math.sin(this.Gama),-1*Math.sin(this.Beta));this.M1=new Array(-1*Math.sin(this.Gama),1,Math.sin(this.Alfa));this.M2=new Array(Math.sin(this.Beta),-Math.sin(this.Alfa),1);this.E=4.76916455578838e-12;this.D=3.43836164444015e-9;this.C=0.00000264094456224583;this.B=0.0025239245915757;this.A=1.00503730599692;this.ab=(1*this.bessel_a+1*this.bessel_b)},getSloCenter:function(){var c=this.X1+this.getSloGeoWidth()/2;var d=this.Y1+this.getSloGeoHeight()/2;return{x:c,y:d}},getSloGeoWidth:function(){return this.X2-this.X1},getSloGeoHeight:function(){return this.Y2-this.Y1},getDpm:function(){return 72/2.54*100},getLonLat:function(g,i){var e=Math.floor(((g-this.minGeoX)*this.getDpm())/NSZemljevid.MAX_GEO_ZOOM);var f=Math.floor(((this.minGeoY-i)*this.getDpm())/NSZemljevid.MAX_GEO_ZOOM);return new OpenLayers.LonLat(e,NSZemljevid.MAX_RESOLUTION-f)},getGKFromLonLat:function(d){var e=this.minGeoX+(d.lon*NSZemljevid.MAX_GEO_ZOOM)/this.getDpm();var f=this.minGeoY-((NSZemljevid.MAX_RESOLUTION-d.lat)*NSZemljevid.MAX_GEO_ZOOM)/this.getDpm();return{x:Math.round(e),y:Math.round(f)}},zoomToZoomLevel:function(b){return Math.round(NSZemljevid.MAX_ZOOM_LEVEL-Math.log(b/NSZemljevid.MAX_GEO_ZOOM)/Math.log(2))},zoomLevelToZoom:function(b){return Math.pow(2,NSZemljevid.MAX_ZOOM_LEVEL-b)*NSZemljevid.MAX_GEO_ZOOM},getFaktor:function(c,d){if(c<=0){return 0}return(c*this.zoomLevelToZoom(d))/this.getDpm()},fromWGS84ToGK:function(au){var aN,aJ,aA,A,C,D,E,T,aC,aF,aG,aI,an,ap,aP,aO,aE,aS,ao,ar,aK,aR,aT,aV,az,aB,B,av,aw,aD,at,ay,aQ,aU,aX,aq,aH,F,am,al,ax,aW,aL,aM;aN=au.lat;aJ=au.lon;al=5;aQ=0.9999;aU=-4500000;aX=1000000;aE=6377397.155;av=6356078.962818;aw=(aE*aE-av*av)/(av*av);aO=(aE*aE-av*av)/(aE*aE);aS=aO*aO;ao=aS*aO;ar=aS*aS;aK=ao*aS;aR=1+3*aO/4+45*aS/64+175*ao/256+11025*ar/16384+43659*aK/65536;aT=3*aO/4+15*aS/16+525*ao/512+2205*ar/2048+72765*aK/65536;aV=15*aS/64+105*ao/256+2205*ar/4096+10395*aK/16384;az=35*ao/512+315*ar/2048+31185*aK/131072;aB=315*ar/16384+3465*aK/65536;B=693*aK/131072;aN=aN*Math.PI/180;aJ=aJ*Math.PI/180;aC=Math.sin(aN)/Math.cos(aN);aA=aE*aE/Math.sqrt(aE*aE+av*av*(aC*aC));A=aA*Math.sin(aN)/2;C=aA*(Math.cos(aN)*Math.cos(aN))/6*(1-aC*aC+aw*Math.cos(aN)*Math.cos(aN));D=aA*Math.sin(aN)*(Math.cos(aN)*Math.cos(aN))/24*(5-aC*aC+9*aw*(Math.cos(aN)*Math.cos(aN)));E=aA*Math.sin(aN)*Math.cos(aN)*Math.cos(aN)*Math.cos(aN)*Math.cos(aN)/120*(5-18*aC*aC+(aC*aC*aC*aC)+aw*(14-72*(Math.sin(aN)*Math.sin(aN))));T=aA*Math.sin(aN)*Math.cos(aN)*Math.cos(aN)*Math.cos(aN)*Math.cos(aN)/720*(61-58*(aC*aC)+(aC*aC*aC*aC));ap=aJ-al*3*Math.PI/180;aP=aE*(1-aO)*(aR*aN-aT/2*Math.sin(2*aN)+aV/4*Math.sin(4*aN)-az/6*Math.sin(6*aN)+aB/8*Math.sin(8*aN)-B/10*Math.sin(10*aN));aI=1*aP+A*(ap*ap)+D*ap*ap*ap*ap+T*(ap*ap*ap*ap)*(ap*ap);an=aA*ap+C*(ap*ap)*ap+E*(ap*ap*ap*ap)*ap;aG=an*aQ+1*aU+al*aX;aF=aI*aQ;aF-=5000000;aF+=37.510809374041855;aG+=363.9643364697695;return{x:aG,y:aF}},gk2GPS:function(i,j){h=0;j=(j-500000)/0.9999;i=(1*i+5000000)/0.9999;var k=(2*i)/this.ab;var f=Math.tan(k);dif=1;p1=this.bessel_a*(1-this.bessel_e2);var g=25;while(Math.abs(dif)>0&&g>0){L=p1*(this.A*k-this.B*Math.sin(2*k)+this.C*Math.sin(4*k)-this.D*Math.sin(6*k)+this.E*Math.sin(8*k));dif=(2*(i-L)/this.ab);k=k+dif;g--}N=this.bessel_a/(Math.sqrt(1-this.bessel_e2*Math.pow(Math.sin(k),2)));t2=Math.pow(f,2);t4=Math.pow(t2,2);cosFi=Math.cos(k);ni2=this.bessel_e2_*Math.pow(cosFi,2);lambda=0.261799387799149+(j/(N*cosFi))-(((1+2*t2+ni2)*Math.pow(j,3))/(6*Math.pow(N,3)*cosFi))+(((5+28*t2+24*t4)*Math.pow(j,5))/(120*Math.pow(N,5)*cosFi));fi=k-((f*(1+ni2)*Math.pow(j,2))/(2*Math.pow(N,2)))+(f*(5+3*t2+6*ni2-6*ni2*t2)*Math.pow(j,4))/(24*Math.pow(N,4))-(f*(61+90*t2+45*t4)*Math.pow(j,6))/(720*Math.pow(N,6));N=this.bessel_a/(Math.sqrt(1-this.bessel_e2*Math.pow(Math.sin(fi),2)));X=(N+h)*Math.cos(fi)*Math.cos(lambda);Y=(N+h)*Math.cos(fi)*Math.sin(lambda);Z=((this.bessel_b2/this.bessel_a2)*N+h)*Math.sin(fi);X-=this.dX;Y-=this.dY;Z-=this.dZ;X/=(1+this.dm);Y/=(1+this.dm);Z/=(1+this.dm);X1=X-this.M0[1]*Y-this.M0[2]*Z;Y1=-1*this.M1[0]*X+Y-this.M1[2]*Z;Z1=-1*this.M2[0]*X-this.M2[1]*Y+Z;p=Math.sqrt(Math.pow(X1,2)+Math.pow(Y1,2));O=Math.atan2(Z1*this.wgs84_a,p*this.wgs84_b);SinO=Math.sin(O);Sin3O=Math.pow(SinO,3);CosO=Math.cos(O);Cos3O=Math.pow(CosO,3);fif=Math.atan2(Z1+this.wgs84_e2_*this.wgs84_b*Sin3O,p-this.wgs84_e2*this.wgs84_a*Cos3O);lambdaf=Math.atan2(Y1,X1);N=this.wgs84_a/Math.sqrt(1-this.wgs84_e2*Math.pow(Math.sin(fif),2));hf=p/Math.cos(fif)-N;fif=(fif*180)/Math.PI;lambdaf=(lambdaf*180)/Math.PI;return{lat:fif,lon:lambdaf}},deg2DMS:function(f){var e=Math.floor(f);f=(f-e)*60;var d=Math.floor(f);S=Math.round((f-d)*6000);S/=100;S=S.toFixed(2);if(d<10){if(S<10){S="0"+S}return e+"&#186; 0"+d+"' "+S+"''"}else{if(S<10){S="0"+S}return e+"&#186; "+d+"' "+S+"''"}}});NSZemljevid.Icon=OpenLayers.Class(OpenLayers.Icon,{index:null,divE:null,icontype:null,iconSet:null,initialize:function(){if(arguments.length==1&&typeof arguments[0]=="object"){this.options={};OpenLayers.Util.extend(this.options,arguments[0]);this._init();return}this.iconSet=NSZemljevid.IconSet;var c=new OpenLayers.Size(23,32);var d=new OpenLayers.Pixel(-c.w/2,-c.h);if(arguments.length==1){this.icontype=arguments[0];OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}else{if(arguments.length==2){this.icontype=arguments[0]?arguments[0]:NS_RED_ICON;this.index=arguments[1];if(!isNaN(this.index)&&parseInt(this.index)<50){this.index=parseInt(this.index);OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+"marker/"+this.iconSet[this.icontype]+this.index+".png",c,d,null])}else{OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}}else{if(arguments.length==0){this.icontype=NS_RED_ICON;OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}}}},_init:function(){var e=this.options.url?this.options.url:OpenLayers.ImgPath+"arrow-red.png";var d=this.options.size?this.options.size:new OpenLayers.Size(23,33);var f=this.options.offset?this.options.offset:new NSZemljevid.Pixel(11,-33);OpenLayers.Icon.prototype.initialize.apply(this,[e,d,f,null])},CLASS:"NSZemljevid.Icon"});NSZemljevid.Size=OpenLayers.Class(OpenLayers.Size,{initialize:function(){OpenLayers.Size.prototype.initialize.apply(this,arguments)}});NSZemljevid.Pixel=OpenLayers.Class(OpenLayers.Pixel,{initialize:function(){OpenLayers.Pixel.prototype.initialize.apply(this,arguments)}});NSZemljevid.Icon2=OpenLayers.Class(OpenLayers.Icon,{index:null,divE:null,icontype:null,iconSet:null,initialize:function(){this.iconSet=NSZemljevid.IconSet2;var c=new OpenLayers.Size(21,28);var d=new OpenLayers.Pixel(-c.w/2,-c.h+3);if(arguments.length==1){this.icontype=arguments[0];OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}else{if(arguments.length==2){this.icontype=arguments[0]?arguments[0]:NS_RED_ICON;this.index=arguments[1];if(this.index<50){OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+"marker/"+this.iconSet[this.icontype]+this.index+".png",c,d,null])}else{OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}}else{if(arguments.length==0){this.icontype=NS_RED_ICON;OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}}}},draw:function(){},CLASS:"NSZemljevid.Icon2"});NSZemljevid.Icon3=OpenLayers.Class(OpenLayers.Icon,{index:null,divE:null,icontype:null,iconSet:null,initialize:function(){this.iconSet={black:"firma/pin-firma-nonum",selected:"firma/pin-firma-nonum-hover"};var c=new OpenLayers.Size(33,39);var d=new OpenLayers.Pixel(-c.w/2,-c.h+2);if(arguments.length==1){this.iconSet={black:"firma/pin-firma",selected:"firma/pin-firma-hover"};this.icontype="black";this.index=arguments[0];if(this.index<50){OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+"marker/"+this.iconSet[this.icontype]+this.index+".png",c,d,null])}else{OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}}else{if(arguments.length==0||arguments.length>1){this.icontype="black";OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+this.iconSet[this.icontype]+".png",c,d,null])}}},draw:function(){},CLASS:"NSZemljevid.Icon3"});NSZemljevid.Icon4=OpenLayers.Class(OpenLayers.Icon,{icontype:0,initialize:function(){var c=new OpenLayers.Size(32,40);var d=new OpenLayers.Pixel(-c.w/2,-c.h+2);if(arguments.length!=0&&arguments[0]==1){this.icontype=1}if(this.icontype==0){OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+"firma/user-marker-black.png",c,d,null])}else{if(this.icontype==1){OpenLayers.Icon.prototype.initialize.apply(this,[OpenLayers.ImgPath+"firma/user-marker-white.png",c,d,null])}}},draw:function(){},CLASS:"NSZemljevid.Icon4"});NSZemljevid.Icon4.BLACK=0;NSZemljevid.Icon4.WHITE=1;NSZemljevid.FramedCloud2=OpenLayers.Class(OpenLayers.Popup.Framed,{initialize:function(){this.imageSrc=OpenLayers.Util.getImagesLocation()+"firma-popup2.png";if(typeof arguments[7]!="undefined"&&arguments[7] instanceof Object){var b=arguments[7];if(typeof b.position!="undefined"&&b.position){this.fixedRelativePosition=true;switch(b.position){case"l":this.relativePosition="bl";this.positionBlocks=this._positionBlocks_fixed;break;case"r":this.relativePosition="br";this.positionBlocks=this._positionBlocks_fixed;break;case"tl":this.relativePosition="tl";this.positionBlocks=this._positionBlocks_def;break;case"tr":this.relativePosition="tr";this.positionBlocks=this._positionBlocks_def;break;case"bl":this.relativePosition="bl";this.positionBlocks=this._positionBlocks_def;break;case"br":this.relativePosition="br";this.positionBlocks=this._positionBlocks_def;break}}}if(!this.positionBlocks){this.positionBlocks=this._positionBlocks_def}OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass;this.closeDiv.style.background="transparent url("+OpenLayers.ImgPath+"close-firma.png) no-repeat scroll 0 0";this.closeDiv.style.width="13px";this.closeDiv.style.height="13px";this.closeDiv.style.cursor="pointer"},contentDisplayClass:"popupContent",autoSize:true,fixedRelativePosition:false,minSize:new OpenLayers.Size(100,10),imageSize:new OpenLayers.Size(462,441),isAlphaImage:true,panMapIfOutOfView:true,maxSize:new OpenLayers.Size(462,441),destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"NSZemljevid.FramedCloud2",_positionBlocks_fixed:{bl:{offset:new OpenLayers.Pixel(0,-35),padding:new OpenLayers.Bounds(8,11,10,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,11,10,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(7,"auto"),anchor:new OpenLayers.Bounds(null,11,3,0),position:new OpenLayers.Pixel(-455,0)},{size:new OpenLayers.Size("auto",7),anchor:new OpenLayers.Bounds(0,4,10,null),position:new OpenLayers.Pixel(0,-415)},{size:new OpenLayers.Size(7,7),anchor:new OpenLayers.Bounds(null,4,3,null),position:new OpenLayers.Pixel(-455,-415)},{size:new OpenLayers.Size(12,19),anchor:new OpenLayers.Bounds(null,null,0,7),position:new OpenLayers.Pixel(-91,-422)}]},br:{offset:new OpenLayers.Pixel(5,-35),padding:new OpenLayers.Bounds(15,11,10,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(3,11,10,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(7,"auto"),anchor:new OpenLayers.Bounds(null,11,3,0),position:new OpenLayers.Pixel(-455,0)},{size:new OpenLayers.Size("auto",7),anchor:new OpenLayers.Bounds(3,4,10,null),position:new OpenLayers.Pixel(0,-415)},{size:new OpenLayers.Size(7,7),anchor:new OpenLayers.Bounds(null,4,3,null),position:new OpenLayers.Pixel(-455,-415)},{size:new OpenLayers.Size(12,19),anchor:new OpenLayers.Bounds(0,null,null,7),position:new OpenLayers.Pixel(-80,-422)}]}},_positionBlocks_def:{tl:{offset:new OpenLayers.Pixel(38,0),padding:new OpenLayers.Bounds(8,11,7,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,11,7,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(7,"auto"),anchor:new OpenLayers.Bounds(null,11,0,0),position:new OpenLayers.Pixel(-455,0)},{size:new OpenLayers.Size("auto",7),anchor:new OpenLayers.Bounds(0,4,7,null),position:new OpenLayers.Pixel(0,-415)},{size:new OpenLayers.Size(7,7),anchor:new OpenLayers.Bounds(null,4,0,null),position:new OpenLayers.Pixel(-455,-415)},{size:new OpenLayers.Size(24,12),anchor:new OpenLayers.Bounds(null,-2,10,null),position:new OpenLayers.Pixel(-17,-430)}]},tr:{offset:new OpenLayers.Pixel(-37,0),padding:new OpenLayers.Bounds(8,11,7,7),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,11,7,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(7,"auto"),anchor:new OpenLayers.Bounds(null,11,0,0),position:new OpenLayers.Pixel(-455,0)},{size:new OpenLayers.Size("auto",7),anchor:new OpenLayers.Bounds(0,4,7,null),position:new OpenLayers.Pixel(0,-415)},{size:new OpenLayers.Size(7,7),anchor:new OpenLayers.Bounds(null,4,0,null),position:new OpenLayers.Pixel(-455,-415)},{size:new OpenLayers.Size(24,12),anchor:new OpenLayers.Bounds(10,-2,null,null),position:new OpenLayers.Pixel(-17,-430)}]},bl:{offset:new OpenLayers.Pixel(37,0),padding:new OpenLayers.Bounds(8,11,7,11),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,11,7,0),position:new OpenLayers.Pixel(0,4)},{size:new OpenLayers.Size(7,"auto"),anchor:new OpenLayers.Bounds(null,11,0,4),position:new OpenLayers.Pixel(-455,0)},{size:new OpenLayers.Size("auto",7),anchor:new OpenLayers.Bounds(0,4,7,null),position:new OpenLayers.Pixel(0,-415)},{size:new OpenLayers.Size(7,7),anchor:new OpenLayers.Bounds(null,4,0,null),position:new OpenLayers.Pixel(-455,-415)},{size:new OpenLayers.Size(24,12),anchor:new OpenLayers.Bounds(null,null,10,0),position:new OpenLayers.Pixel(-48,-430)}]},br:{offset:new OpenLayers.Pixel(-39,0),padding:new OpenLayers.Bounds(8,11,7,11),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,11,7,0),position:new OpenLayers.Pixel(0,4)},{size:new OpenLayers.Size(7,"auto"),anchor:new OpenLayers.Bounds(null,11,0,4),position:new OpenLayers.Pixel(-455,0)},{size:new OpenLayers.Size("auto",7),anchor:new OpenLayers.Bounds(0,4,7,null),position:new OpenLayers.Pixel(0,-415)},{size:new OpenLayers.Size(7,7),anchor:new OpenLayers.Bounds(null,4,0,null),position:new OpenLayers.Pixel(-455,-415)},{size:new OpenLayers.Size(24,12),anchor:new OpenLayers.Bounds(10,null,null,0),position:new OpenLayers.Pixel(-48,-430)}]}}});NSZemljevid.Util={isIE6:navigator.userAgent.search(/MSIE 6.0/i)>=0,isIE:!!(window.attachEvent&&navigator.userAgent.indexOf("Opera")===-1),isOpera:navigator.userAgent.indexOf("Opera")>-1,isWebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,isChrome:navigator.userAgent.match(/Chrome/ig),isGecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")===-1,isMobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/),getDimension:function(){var j={};var f=["Width","Height"];for(var k=0,g=f.length;k<g;k++){var i=f[k];if(NSZemljevid.Util.isWebKit&&!document.evaluate){j[i]=self["inner"+i]}else{if(NSZemljevid.Util.isOpera&&parseFloat(window.opera.version())<9.5){j[i]=document.body["client"+i]}else{j[i]=document.documentElement["client"+i]}}}return j}};NSZemljevid.MousePositionGPS=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",gpsDigits:5,lastXy:null,initialize:function(){this.EVENT_TYPES=OpenLayers.Control.prototype.EVENT_TYPES.concat(["onGPSClick","onGPSChange"]);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeypress})},defaultKeypress:function(b){if(b.keyCode==27){this.deactivate()}},destroy:function(){if(this.map){this.map.events.unregister("click",this,this._gpsMapClick);this.map.removeControl(this)}this.onGPSClick=null;OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.handler){this.handler.destroy()}},draw:function(){},_gpsMapClick:function(i){if(!this.active){return}var f=this.map.getLonLatFromPixel(i.xy);var g=this.map.info.getGKFromLonLat(f);var e=this.map.info.gk2GPS(g.y,g.x);if(this.gpsDigits){e.lat=e.lat.toFixed(this.gpsDigits);e.lon=e.lon.toFixed(this.gpsDigits)}this.events.triggerEvent("onGPSClick",{lon:e.lon,lat:e.lat})},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("click",this,this._gpsMapClick)},activate:function(){if(this.handler){this.handler.activate()}this.active=true;this.events.triggerEvent("activate");this.events.triggerEvent("onGPSChange",{status:true});return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;this.events.triggerEvent("deactivate");this.events.triggerEvent("onGPSChange",{status:false});return true}return false},CLASS_NAME:"MousePositionGPS"});NSZemljevid.Measure=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"Measure",EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,measureDigits:2,displaySystem:"metric",initialize:function(c,d){this.EVENT_TYPES=OpenLayers.Control.prototype.EVENT_TYPES.concat(["onMeasure","onMeasureChange"]);OpenLayers.Control.prototype.initialize.apply(this,[d]);this.callbacks={done:this.measureComplete,point:this.measurePartial};this.handler=new c(this,this.callbacks,this.handlerOptions);this.handler.click=function(a){return true};this.keyboardHandler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeypress})},draw:function(){},defaultKeypress:function(b){if(b.keyCode==27){this.deactivate()}},measureComplete:function(b){this.measure(b,"measure")},measurePartial:function(d,c){this.measure(c,"measurepartial")},measure:function(g,e){var f="m";if(g.CLASS_NAME.indexOf("LineString")>-1){var i=this.getLength(g);if(i>=1000){i=i/1000;f="km"}if(this.measureDigits){i=i.toFixed(this.measureDigits)}this.events.triggerEvent("onMeasure",{length:i,units:f})}},getLength:function(m){var q=0;if(m.components&&m.components.length>1){var k=m.components.length;for(var r=1;r<k;r++){var i=m.components[r];var l=m.components[r-1];var n=this.map.info.getGKFromLonLat(new OpenLayers.LonLat(l.x,l.y));var o=this.map.info.getGKFromLonLat(new OpenLayers.LonLat(i.x,i.y));q+=new OpenLayers.Geometry.Point(n.x,n.y).distanceTo(new OpenLayers.Geometry.Point(o.x,o.y))}}return q},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.keyboardHandler){this.keyboardHandler.destroy()}if(this.handlers){for(var b in this.handlers){if(this.handlers.hasOwnProperty(b)&&typeof this.handlers[b].destroy=="function"){this.handlers[b].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}if(this.keyboardHandler){this.keyboardHandler.activate()}this.active=true;this.events.triggerEvent("activate");this.events.triggerEvent("onMeasureChange",{status:true});return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}if(this.keyboardHandler){this.keyboardHandler.deactivate()}this.active=false;this.events.triggerEvent("deactivate");this.events.triggerEvent("onMeasureChange",{status:false});return true}return false}});NSZemljevid.WeatherButton=OpenLayers.Class(OpenLayers.Control,{element:null,lastXy:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.onWeatherActivate);this.events.register("deactivate",this,this.onWeatherDeactivate)},destroy:function(){if(this.map){this.map.events.unregister("zoomend",this,this.onZoomWeatherChange)}OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.handler){this.handler.destroy()}},draw:function(){this.map.events.register("zoomend",this,this.onZoomWeatherChange)},onZoomWeatherChange:function(){if(!this.active){return}var j=this.map.getLayersByName("Weather")[0];if(j){var g=j.markers.length;for(var k=0;k<g;k++){var f=j.markers[k];var i=f.zoom;if(i.min==-1&&i.max!=-1&&this.map.zoom>i.max){f.icon.display(false)}else{if(i.min!=-1&&i.max==-1&&this.map.zoom<i.min){f.icon.display(false)}else{if(i.min!=-1&&i.max!=-1&&(this.map.zoom<i.min||this.map.zoom>i.max)){f.icon.display(false)}else{f.icon.display(true)}}}}}},onWeatherActivate:function(b){this.loadWeather()},onWeatherDeactivate:function(c){var d=this.map.getLayersByName("Weather");if(d&&d.length>0){d[0].setVisibility(!d[0].getVisibility())}if(this.map.popups[0]){this.map.removePopup(this.map.popups[0])}},loadWeather:function(){var g=this.map.getLayersByName("Weather");var i=null;if(g&&g.length>0){i=g[0];i.setVisibility(!i.getVisibility());return}else{i=new OpenLayers.Layer.Markers("Weather");this.map.addLayer(i);this.map.raiseLayer(i,999);this.map.resetLayersZIndex()}var f=document.createElement("script");f.setAttribute("type","text/javascript");f.setAttribute("src",NSZemljevid.WEATHER_SERVICE);f.setAttribute("id","wscr");var e=document.getElementsByTagName("head")[0];NSZemljevid.weatherControl=this;e.appendChild(f);e=null},onWeatherData:function(B){NSZemljevid.weatherControl=null;var s=document.getElementsByTagName("head")[0];s.removeChild($("wscr"));s=null;if(!B){return}var v=this.map.getLayersByName("Weather")[0];var i=new OpenLayers.Size(60,73);for(var A=0,u=B.data.length;A<u;A++){var E=B.data[A].metData;if(!E.lat||!E.lon||E.lat==1||E.lon==1){continue}var F=parseInt(E.zoom.min);var o=parseInt(E.zoom.max);var w=this.map.info.fromWGS84ToGK(new OpenLayers.LonLat(E.lon,E.lat));var D=E.weatherIcon?"http://www.najdi.si/dsg/weather_icons_v1/"+E.weatherIcon+".png":"http://www.najdi.si/dsg/pixel_blank.gif";var z=this.map.info.getLonLat(w.x,w.y);var t=new NSZemljevid.WeatherIcon(OpenLayers.ImgPath+"weatherBck.png",i,null,null,{wicon:D,temp:E.temperature,condition:E.condition,station:E.station});var C=new NSZemljevid.WeatherMarker(z,t,{min:F,max:o});C.events.register("click",C,this.onWeatherMarkerClick);if(F==-1&&o!=-1&&this.map.zoom>o){C.icon.display(false)}else{if(F!=-1&&o==-1&&this.map.zoom<F){C.icon.display(false)}else{if(F!=-1&&o!=-1&&(this.map.zoom<F||this.map.zoom>o)){C.icon.display(false)}}}v.addMarker(C)}},onWeatherMarkerClick:function(){var c='<div style="width:200px;float:none;font-size:11px;font-family:Arial;padding:5px 10px 10px 10px;"><div style="float:none;font-size:12px;padding:0 0 2px 0;"><strong>TRENUTNE RAZMERE</strong></div>';c+='<div style="border-bottom: 1px solid #cccccc;"></div>';c+='<div style="padding:15px 0 20px 0;text-align:center;">';c+="<table cellpadding=0 cellspacing=0 border=0 width=100%>";c+='<tr><td width=50% align=right><img border=0 src="'+this.icon.wicon+'"/></td>';c+='<td width=50% align=left><span style="font-weight:bold;font-size:12px;">'+this.icon.temp+"\u00b0C</span></td></tr>";c+="</table>";c+="</div>";c+='<div style="float:none;font-size:12px">Lokacija: <strong>'+this.icon.station+"</strong></div>";if(this.icon.condition){c+='<div style="padding:10px 0 0 0;float:none;font-size:12px">Razmere: <strong>'+this.icon.condition+"</strong></div>"}c+='<div style="padding:10px 0 7px 0;float:none;font-size:12px">Temperatura: <strong>'+this.icon.temp+"\u00b0C</strong></div>";c+='<div style="border-bottom: 1px solid #cccccc;"></div>';c+='<div style="text-align:center;float:none;padding:5px 0px;"><a style="color:#4963ad;" href = "http://www.najdi.si/index_news.jsp?tab=news&action=Vreme" target="_blank"><strong>Napoved za Slovenijo</strong></a>';c+="</div>";var d=new NSZemljevid.FramedCloud("weatherCloud",this.lonlat,null,c,this.icon,true);this.map.addPopup(d,true)},CLASS_NAME:"WeatherButton"});NSZemljevid.WeatherIcon=OpenLayers.Class(OpenLayers.Icon,{dataContainer:null,temp:null,wicon:null,condition:null,station:null,initialize:function(){OpenLayers.Icon.prototype.initialize.apply(this,arguments);this.temp=arguments[4].temp;this.condition=arguments[4].condition;this.wicon=arguments[4].wicon;this.station=arguments[4].station},draw:function(e){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");if(!this.dataContainer){this.dataContainer=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(8,5),null,null,"absolute");this.dataContainer.style.fontWeight="bold";this.dataContainer.style.fontFamily="Arial";this.dataContainer.style.fontSize="13px";this.dataContainer.style.width="37px";this.dataContainer.style.textAlign="center";this.imageDiv.appendChild(this.dataContainer);var i=OpenLayers.Util.createImage("wicon",null,new OpenLayers.Size(32,32),this.wicon);this.dataContainer.appendChild(i);var f=OpenLayers.Util.createDiv("temp",null,null,null,"relative");f.style.paddingTop="3px";this.dataContainer.appendChild(f);var g=document.createTextNode(this.temp+"\u00b0C");f.appendChild(g)}this.moveTo(e);this.imageDiv.style.cursor="pointer";return this.imageDiv}});NSZemljevid.WeatherMarker=OpenLayers.Class(OpenLayers.Marker,{zoom:null,initialize:function(){OpenLayers.Marker.prototype.initialize.apply(this,arguments);this.zoom=arguments[2]},CLASS_NAME:"WeatherMarker"});NSZemljevid.BBOX=OpenLayers.Class(OpenLayers.Strategy.BBOX,{initialize:function(b){OpenLayers.Strategy.BBOX.prototype.initialize.apply(this,[b])},update:function(c){this.layer.protocol.options.params.zoom=this.layer.map.getZoom();var d=this.getMapBounds();if((c&&c.force)||this.invalidBounds(d)){this.calculateBounds(d);this.resolution=this.layer.map.getResolution();if(this.layer.protocol.options.params.url){this.layer.protocol.options.params.url=NSZemljevid.ADM_SERVICE+"?zoom="+this.layer.map.getZoom()+"&bbox="+this.bounds.left+","+this.bounds.bottom+","+this.bounds.right+","+this.bounds.top}this.triggerRead()}},CLASS_NAME:"NSZemljevid.BBOX"});NSZemljevid.ADM=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"NSZemljevid.ADM",zoomLevel:0,masterHide:true,proxy:null,showIcons:false,fromElement:null,_to:null,_mail:null,_print:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},draw:function(){this.map.events.register("zoomend",this,this.zoomChange)},destroy:function(){if(this.map){this.map.removeControl(this)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(b){if(b){OpenLayers.Util.extend(this,b)}if(this.active&&!this.masterHide){this.zoomChange()}if(this.active){return false}this.active=true;if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.createVector();return true},deactivate:function(){this.masterHide=true;this.zoomChange();return false},createVector:function(){this.layer=this.map.getLayersByName("adLayer")[0];if(this.layer){return}this.layer=new OpenLayers.Layer.Vector("adLayer",{strategies:[new NSZemljevid.BBOX({ratio:1,resFactor:2})],protocol:new OpenLayers.Protocol.HTTP({url:this.proxy?this.proxy:NSZemljevid.ADM_SERVICE,format:new OpenLayers.Format.GeoJSON(),params:{url:this.proxy?this.proxy:null}}),isBaseLayer:false,rendererOptions:{yOrdering:false,zIndexing:true},styleMap:new OpenLayers.StyleMap({"default":{externalGraphic:"${externalGraphics}",graphicZIndex:11,graphicYOffset:-6,graphicXOffset:-6,pointRadius:12,graphicWidth:12,graphicHeight:12,graphicTitle:"${companyTitle}"},select:{pointRadius:5,graphicWidth:12,graphicHeight:12,cursor:"pointer"},"delete":{display:"none"}})});this.map.addLayer(this.layer);if(this.map.getZoom()>this.minZoom){this.layer.setVisibility(true)}else{this.layer.setVisibility(false)}},onFeatureClick:function(j){if(j.attributes.imgUrl){this.sendStat(j.attributes.imgUrl)}var i={size:new NSZemljevid.Size(12,12),offset:new NSZemljevid.Pixel(-6,-6)};var k=new OpenLayers.LonLat(j.geometry.x,j.geometry.y);var f=this.createContent2(j.attributes);var g=new NSZemljevid.FramedCloudOkx("nsPopup",k,null,f,i,true,null);j.popup=g;j.layer.map.addPopup(g,true);this.currentFeature=j;if(this.fromElement){OpenLayers.Event.stopObserving(this.div,"click",this.onClick);OpenLayers.Event.stopObserving(this.fromElement,"click",this.fromElementClick);OpenLayers.Event.stopObserving(this._to,"click",this._toClick);OpenLayers.Event.stopObserving(this._mail,"click",this._mailClick);OpenLayers.Event.stopObserving(this._print,"click",this._printClick);this.fromElement=this._to=this._mail=this._print=null}if(this.showIcons){this.fromElement=$("_NSZemljevid_nav_from");this._to=$("_NSZemljevid_nav_to");this._mail=$("_NSZemljevid_mail");this._print=$("_NSZemljevid_print");OpenLayers.Event.observe(this.fromElement,"click",this.fromElementClick.bind(this));OpenLayers.Event.observe(this._to,"click",this._toClick.bind(this));OpenLayers.Event.observe(this._mail,"click",this._mailClick.bind(this));OpenLayers.Event.observe(this._print,"click",this._printClick.bind(this))}},getDataObject:function(){var b={coordinate:this.currentFeature.attributes.gk,imageUrl:this.currentFeature.attributes.hashImgUrl,maticna:this.currentFeature.attributes.maticna,company:this.currentFeature.attributes.company};b.company.title=this.currentFeature.attributes.companyTitle;return b},fromElementClick:function(b){this.events.triggerEvent("navigationFromClick",{adData:this.getDataObject()});return true},_toClick:function(b){this.events.triggerEvent("navigationToClick",{adData:this.getDataObject()});return true},_mailClick:function(b){this.events.triggerEvent("sendMailClick",{adData:this.getDataObject()});return true},_printClick:function(b){this.events.triggerEvent("printClick",{adData:this.getDataObject()});return true},zoomChange:function(f){if(!this.layer){return}if(this.masterHide){this.layer.setVisibility(false);return}var e=this.map.getZoom();if(e>this.minZoom){this.layer.setVisibility(true)}else{this.layer.setVisibility(false)}if(this.currentFeature){if(!this.layer.getVisibility()){this.hidep()}else{var d=this.currentFeature.attributes.tip;if((d.match(/okb/ig)&&e==7)||(d.match(/oka/ig)&&e==8)){this.hidep()}}}},hidep:function(){this.currentFeature.popup.hide();this.currentFeature=null},getImageHtml2:function(e,d){var f=null;if(e){f='<a title="'+e.replace(/^http:\/\//,"")+'" target="_blank" href="'+e+'">';f+='<img src="'+d+'" border="0"/>';f+="</a>"}else{f='<img src="'+d+'" border="0"/>'}return f},createContent2:function(I){var i="#194478";var J='<div style="font-family:Arial;font-size:11px;color:#000000;width:260px;">';J+='<div style="padding:12px;"><table cellpadding=0 cellspacing=0 border=0 width=100%><tr>';if(I.hashImgUrl||I.additionalImg){var l=null;if(I.attributes.i){l=I.attributes.i[0]}J+='<td valign=top align=left style="padding-right:10px;">';if(I.imgUrl){J+=this.getImageHtml2(l,I.hashImgUrl)}if(I.additionalImg){J+="<br/>"+this.getImageHtml2(l,I.additionalImg)}J+="</td>"}if(I.companyTitle){J+="<td valign=top align=left><strong>"+I.companyTitle+"</strong>";J+='<p style="margin:0;color:#000;padding:5px 0 0 0;font-size:11px;">'+I.company.street+" "+I.company.ehis+"</p>";J+='<p style="margin:0;color:#000;padding:0;font-size:11px;">'+I.company.post+"</p>";J+='<p style="margin:0;color:#000;padding:0;font-size:11px;">'+I.company.city+"</p>";J+="</td>"}J+="</tr></table>";if(I.attributes){if(I.attributes.T){J+='<div style="padding:5px 0 0 0;font-size:11px;">';for(var t=0,c=I.attributes.T.length;t<c;t++){J+='<p style="margin:0;color:#000;padding:0;font-size:11px;">T: '+I.attributes.T[t]+"</p>"}if(I.attributes.F){for(var z=0,w=I.attributes.F.length;z<w;z++){J+='<p style="margin:0;color:#000;padding:0;font-size:11px;">F: '+I.attributes.F[z]+"</p>"}}J+='</div><div style="padding:5px 0 10px 0;float:none;">';if(I.attributes.R){for(var D=0,A=I.attributes.R.length;D<A;D++){J+='<p style="margin:0;padding:0;"><a onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" style="color:'+i+';text-decoration:none;font-size:11px;padding:0;" href="mailto:'+I.attributes.R[D]+'">'+I.attributes.R[D]+"</a></p>"}if(I.attributes.i){for(var F=0,E=I.attributes.i.length;F<E;F++){var B=I.attributes.i[F];J+='<p style="margin:0;"><a onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" style="color:'+i+';text-decoration:none;font-size:11px;padding:0;" target="_blank" href="'+B+'">'+B.replace(/^http:\/\//,"")+"</a></p>"}}}J+="</div>"}}J+='<div style="float:none;border-top:1px solid '+i+';"></div>';if(I.desc){J+='<div style="padding:10px 0 10px 0;float:none;">';J+='<p style="margin:0;color:#000;padding:0;">'+I.desc+"</p>";J+="</div>";J+='<div style="float:none;border-top:1px solid '+i+';"></div>'}if(I.activityList){J+='<div style="float:none;padding:10px 0 0 0;">';J+='<ul style="padding-left:15px;margin:0;">';for(var H=0,C=I.activityList.length;H<C;H++){var G=I.activityList[H];J+='<li style="color:'+i+';">';J+='<a style="font-size:11px;color:'+i+';text-decoration:none;" onmouseover="this.style.textDecoration=\'underline\'" onmouseout="this.style.textDecoration=\'none\'" target="_blank" href="'+G.url+'">'+G.title+"</a>";J+="</li>"}J+="</ul>";J+="</div>"}if(this.showIcons){J+='<div style="padding:10px 0 0 0;">';J+='<ul style="margin:0;padding:0;list-style:none outside none;">';J+='<li style="list-style-type:none;padding-right:5px;float:left;">';J+='<div id="_NSZemljevid_nav_from" style="cursor:pointer;width:22px;height:22px;background:url('+OpenLayers.ImgPath+'nav_from.png) no-repeat 0 0;"></div>';J+="</li>";J+='<li style="list-style-type:none;padding-right:5px;float:left;">';J+='<div id="_NSZemljevid_nav_to" style="cursor:pointer;width:22px;height:22px;background:url('+OpenLayers.ImgPath+'nav_to.png) no-repeat 0 0;"></div>';J+="</li>";J+='<li style="list-style-type:none;padding-right:5px;float:left;">';J+='<div id="_NSZemljevid_mail" style="cursor:pointer;width:22px;height:22px;background:url('+OpenLayers.ImgPath+'mail_icon.png) no-repeat 0 0;"></div>';J+="</li>";J+='<li style="list-style-type:none;padding-right:5px;float:left;">';J+='<div id="_NSZemljevid_print" style="cursor:pointer;width:22px;height:22px;background:url('+OpenLayers.ImgPath+'print_icon.png) no-repeat 0 0;"></div>';J+="</li>";J+="</ul>";J+='<div style="clear:both;"></div>';J+="</div>"}J+="</div>";J+="</div>";return J},sendStat:function(i){try{var e=this.proxy?this.proxy:NSZemljevid.ADM_SERVICE;var g={};if(this.proxy){g.url=NSZemljevid.ADM_SERVICE+"?imgUrl="+i}else{g.imgUrl=i}var k=new OpenLayers.Request.GET({url:e,params:g})}catch(j){}}});NSZemljevid.Point=OpenLayers.Class(OpenLayers.Geometry.Point,{initialize:function(){OpenLayers.Geometry.Point.prototype.initialize.apply(this,arguments)},CLASS:"NSZemljevid.Point"});NSZemljevid.MapTypeControl=OpenLayers.Class(OpenLayers.Control,{CLASS_NAME:"NSZemljevid.MapTypeControl",btTitle:null,right:null,top:null,backgrondColor:"#ffffff",borderRight:"#aeaeae",borderTopBototm:"#7f7f7f",borderMaster:"#393939",_regularControls:["NSZemljevid.StandardMapControl","NSZemljevid.DOFControl","NSZemljevid.HybridControl"],initialize:function(){this.EVENT_TYPES=OpenLayers.Control.prototype.EVENT_TYPES.concat(["onActivate"]);OpenLayers.Control.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.onActivate);this.events.register("deactivate",this,this.onDeactivate)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.bt=OpenLayers.Util.createDiv("bt");this.bt.style.position="absolute";this.bt.style.width="72px";this.bt.style.height="21px";this.div.appendChild(this.bt);this.innerDiv=OpenLayers.Util.createDiv("innerDiv",null,null,null,"absolute");this.innerDiv.innerHTML=this.btTitle;this.innerDiv.style.top="0px";this.innerDiv.style.width="72px";this.innerDiv.style.left="0px";this.innerDiv.style.fontFamily="Arial";this.innerDiv.style.fontSize="12px";this.innerDiv.style.fontWeight="bold";this.innerDiv.style.paddingTop="3px";this.innerDiv.style.textAlign="center";this.bt.appendChild(this.innerDiv);this.setDefaultStyle();if(this.clickActive){OpenLayers.Event.observe(this.div,"click",this.onClick.bind(this))}this.div.style.top=this.top+"px";this.div.style.right=this.right+"px";return this.div},setDefaultStyle:function(){this.bt.style.cursor="pointer";this.bt.style.zIndex=1;if(OpenLayers.Util.alphaHack()){this.bt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+"top-not-active.png', sizingMethod='image')"}else{this.bt.style.background="url("+OpenLayers.ImgPath+"top-not-active.png) no-repeat 0 0"}this.innerDiv.style.color="#000000"},setPressedStyle:function(){if(OpenLayers.Util.alphaHack()){this.bt.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+"top-active.png', sizingMethod='image')"}else{this.bt.style.background="url("+OpenLayers.ImgPath+"top-active.png) no-repeat 0 0"}this.innerDiv.style.color="#000000"},onActivate:function(){if(this.bt){this.setPressedStyle()}},onDeactivate:function(){if(this.bt){this.setDefaultStyle()}},onClick:function(b){OpenLayers.Event.stop(b);if(!this.active){this.activate()}},setDisabled:function(){if(this.bt){this.bt.style.cursor=""}},deactivateActiveControl:function(j){for(var k=0,g=this._regularControls.length;k<g;k++){var f=this._regularControls[k];if(f.match(j)){continue}var i=this.map.getControlsByClass(f)[0];if(i&&i.active){i.deactivate();break}}}});NSZemljevid.Overlays=OpenLayers.Class(OpenLayers.Control,{mppList:null,currentProga:null,buttonIndex:0,iconTopPadding:6,initialize:function(){arguments[0].EVENT_TYPES=["weatherActivate","weatherDeactivate","activate","deactivate","mppActivate","vrhoviActivate","cameraActivate","trafficActivate"];OpenLayers.Control.prototype.initialize.apply(this,arguments)},registerListeners:function(b){if(b.eventListeners&&b.eventListeners instanceof Object){this.events.on(b.eventListeners)}if(b.weather){this.addWeather()}if(b.traffic){this.addTraffic()}if(b.mpp){this.addMPP()}if(b.vrhovi){this.addVrhovi()}if(b.cameras){this.addCameras()}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.div.style.top="0";this.div.style.right="0";this.elementsDiv=OpenLayers.Util.createDiv("elementsContainer",null,null,null,"relative");this.elementsDiv.style.fontFamily="Arial";this.elementsDiv.style.fontSize="12px";this.elementsDiv.style.display="block";this.elementsDiv.style.width="50px";this.div.appendChild(this.elementsDiv);OpenLayers.Event.observe(this.div,"mouseover",OpenLayers.Function.bind(this.onMouseOver,this),NSZemljevid.Util.isIE?true:false);OpenLayers.Event.observe(this.div,"mouseout",OpenLayers.Function.bind(this.onMouseOut,this),NSZemljevid.Util.isIE?true:false);OpenLayers.Event.observe(this.div,"click",OpenLayers.Function.bind(this.onMouseClick,this),NSZemljevid.Util.isIE?true:false);OpenLayers.Event.observe(this.div,"dblclick",OpenLayers.Function.bindAsEventListener(this.mouseDblClick,this));if(this.weather){this.addWeather()}if(this.traffic){this.addTraffic()}if(this.mpp){this.addMPP()}if(this.vrhovi){this.addVrhovi()}if(this.cameras){this.addCameras()}return this.div},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Control.prototype.destroy.apply(this,arguments)},activeOverlays:function(){var b={weather:false,traffic:false,mpp:false,vrhovi:false,cameras:false};if(this.trafficControl&&this.trafficControl.active){b.traffic=true}if(this.weatherControl&&this.weatherControl.active){b.weather=true}if(this.mppControl&&this.mppControl.active){b.mpp=true}if(this.vrhoviControl&&this.vrhoviControl.active){b.vrhovi=true}if(this.camerasControl&&this.camerasControl.active){b.cameras=true}return b},handleTrafficClick:function(){if(!this.trafficControl.active){this.trafficControl.activate();this.applyImage("_nsz_traffic","api-traffic-active.png");this.events.triggerEvent("trafficActivate")}else{this.trafficControl.deactivate()}return true},handleWeatherClick:function(){if(!this.weatherControl.active){this.weatherControl.activate();this.events.triggerEvent("weatherActivate");this.applyImage("_nsz_weather","api-weather-active.png")}else{this.weatherControl.deactivate();this.events.triggerEvent("weatherDeactivate")}},mppListClick:function(b){if(b.action.match(/^activate$/i)){this.mppControl.showProga(b);this.mppControl.alloff=false;this.applyImage("_nsz_mpp","api-bus-active.png");this.events.triggerEvent("mppActivate",b)}else{this.mppControl.removeProga();if(b.alloff){this.applyImage("_nsz_mpp","api-bus.png");this.mppControl.alloff=true}}},mppListMouseOver:function(b){OpenLayers.Event.stop(b);this.handleTimer();return true},vrhoviListMouseOver:function(b){OpenLayers.Event.stop(b);this.handleTimer3();return true},mppListMouseOut:function(b){OpenLayers.Event.stop(b);this.startTimer();return true},vrhoviListMouseOut:function(b){OpenLayers.Event.stop(b);this.startTimer3();return true},mouseDblClick:function(b){OpenLayers.Event.stop(b);return true},onMouseOver:function(c){OpenLayers.Event.stop(c);var d=OpenLayers.Event.element(c);if(d&&d.id){switch(d.id){case"_nsz_vrhovi":if(this.map.getZoom()<this.vrhoviControl.minZoomLevel){this.handleTimer3()}this.applyImage(d,"api-mountain-active.png");break;case"_nsz_weather":this.applyImage(d,"api-weather-active.png");break;case"_nsz_traffic":this.applyImage(d,"api-traffic-active.png");break;case"_nsz_cameras":this.applyImage(d,"api-camera-active.png");break;case"_nsz_mpp":this.handleTimer();this.applyImage(d,"api-bus-active.png");break;case"_nsz_gps_measure":this.handleTimer2();if(!this.measureControl.active&&!this.gpsControl.active){this.applyImage(d,"api-add-more-active.png")}break}}return true},onMouseOut:function(c){OpenLayers.Event.stop(c);var d=OpenLayers.Event.element(c);if(d&&d.id){switch(d.id){case"_nsz_vrhovi":if(this.map.getZoom()<this.vrhoviControl.minZoomLevel){this.startTimer3()}if(!this.vrhoviControl.active){this.applyImage(d,"api-mountain.png")}break;case"_nsz_weather":if(!this.weatherControl.active){this.applyImage(d,"weather-icon.png")}break;case"_nsz_traffic":if(!this.trafficControl.active){this.applyImage(d,"api-traffic.png")}break;case"_nsz_cameras":if(!this.camerasControl.active){this.applyImage(d,"api-camera.png")}break;case"_nsz_mpp":this.startTimer();if(this.mppControl.alloff){this.applyImage(d,"api-bus.png")}break;case"_nsz_gps_measure":this.startTimer2();if(!this.measureControl.active&&!this.gpsControl.active){this.applyImage(d,"api-add-more.png")}break}}return true},startTimer:function(){if(this._timerId){window.clearTimeout(this._timerId)}this._timerId=window.setTimeout(OpenLayers.Function.bind(this.onTimeOut,this),50)},handleTimer:function(){if(this._timerId){window.clearTimeout(this._timerId);this._timerId=null}else{if(this.map.getZoom()>=this.mppControl.minZoomLevel){this.mppList.show()}else{this.mppListSmall.show()}}},startTimer2:function(){if(this._timerId2){window.clearTimeout(this._timerId2)}this._timerId2=window.setTimeout(OpenLayers.Function.bind(this.onTimeOut2,this),50)},startTimer3:function(){if(this._timerId3){window.clearTimeout(this._timerId3)}this._timerId3=window.setTimeout(OpenLayers.Function.bind(this.onTimeOut3,this),50)},handleTimer2:function(){if(this._timerId2){window.clearTimeout(this._timerId2);this._timerId2=null}else{this.gpsMeasureList.show()}},handleTimer3:function(){if(this._timerId3){window.clearTimeout(this._timerId3);this._timerId3=null}else{this.vrhoviList.show()}},onMouseClick:function(c){var d=OpenLayers.Event.element(c);if(d&&d.id){switch(d.id){case"_nsz_weather":this.handleWeatherClick();break;case"_nsz_traffic":this.handleTrafficClick();break;case"_nsz_vrhovi":this.handleVrhoviClick();break;case"_nsz_cameras":this.handleCameraClick();break;case"_nsz_mpp":break}}},onTimeOut:function(){if(this.map.getZoom()>=this.mppControl.minZoomLevel){this.mppList.hide()}else{this.mppListSmall.hide()}this._timerId=null},onTimeOut2:function(){this.gpsMeasureList.hide();this._timerId2=null},onTimeOut3:function(){this.vrhoviList.hide();this._timerId3=null},addTraffic:function(){if(this.trafficControl){return}this.buttonIndex+=1;this.createIcon("_nsz_traffic","api-traffic.png","Promet");this.trafficControl=new NSZemljevid.TrafficButton();this.map.addControl(this.trafficControl)},addWeather:function(){if(this.weatherControl){return}this.createIcon("_nsz_weather","weather-icon.png","Vreme");this.weatherControl=new NSZemljevid.WeatherButton();this.map.addControl(this.weatherControl);this.buttonIndex+=1},addMPP:function(){if(this.mppControl){return}this.createIcon("_nsz_mpp","api-bus.png","");this.mppControl=new NSZemljevid.MPP();this.map.addControl(this.mppControl);this.buttonIndex+=1;this.mppList=new NSZemljevid.MppList({EVENT_TYPES:["activate","deactivate","mouseOver","mouseOut","click"],topPosition:this.getPosition(this.buttonIndex)});this.mppListSmall=new NSZemljevid.MppListSmall({EVENT_TYPES:["activate","deactivate","mouseOver","mouseOut","click"],topPosition:this.getPosition(this.buttonIndex)});this.map.addControl(this.mppList);this.map.addControl(this.mppListSmall);this.mppList.events.register("mouseOver",this,this.mppListMouseOver);this.mppList.events.register("mouseOut",this,this.mppListMouseOut);this.mppList.events.register("click",this,this.mppListClick);this.mppListSmall.events.register("mouseOver",this,this.mppListMouseOver);this.mppListSmall.events.register("mouseOut",this,this.mppListMouseOut);this.mppListSmall.events.register("click",this,this.mppListSmallClick)},getPosition:function(b){return b*this.iconTopPadding+(b-1)*43-1},addVrhovi:function(){if(this.vrhoviControl){return}this.createIcon("_nsz_vrhovi","api-mountain.png","");this.vrhoviControl=new NSZemljevid.Vrhovi();this.map.addControl(this.vrhoviControl);this.buttonIndex+=1;this.map.events.register("zoomend",this,this.onZoomVrhoviChange);this.vrhoviList=new NSZemljevid.VrhoviList({EVENT_TYPES:["activate","deactivate","mouseOver","mouseOut","click"],topPosition:this.getPosition(this.buttonIndex)});this.vrhoviList.events.register("mouseOver",this,this.vrhoviListMouseOver);this.vrhoviList.events.register("mouseOut",this,this.vrhoviListMouseOut);this.vrhoviList.events.register("click",this,this.vrhoviListClick);this.map.addControl(this.vrhoviList)},addCameras:function(){if(this.camerasControl){return}this.buttonIndex+=1;var b=this.createIcon("_nsz_cameras","api-camera.png","Kamere");this.camerasControl=new NSZemljevid.Cameras();this.map.addControl(this.camerasControl)},addGPSMeasure:function(r){this.createIcon("_nsz_gps_measure","api-add-more.png");this.buttonIndex+=1;this.gpsMeasureList=new NSZemljevid.GPSMeasureList({EVENT_TYPES:["activate","deactivate","mouseOver","mouseOut","click"],topPosition:this.getPosition(this.buttonIndex)});this.map.addControl(this.gpsMeasureList);this.gpsMeasureList.events.register("mouseOver",this,this.gpsMeasureListMouseOver);this.gpsMeasureList.events.register("mouseOut",this,this.gpsMeasureListMouseOut);this.gpsMeasureList.events.register("click",this,this.gpsMeasureListClick);var n={};var q={};if(r.eventListeners){for(var j in r.eventListeners){if(j.match(/^onGPSClick$/)||j.match(/^onGPSChange$/)){n[j]=r.eventListeners[j]}if(j.match(/^onMeasure$/)||j.match(/^onMeasureChange$/)){q[j]=r.eventListeners[j]}}}this.gpsControl=new NSZemljevid.MousePositionGPS({eventListeners:n,gpsDigits:r.gpsDigits?r.gpsDigits:5});this.map.addControl(this.gpsControl);this.gpsControl.events.register("deactivate",this,this.onGpsEsc);n=null;var l={eventListeners:q,measureDigits:r.measureDigits?r.measureDigits:2};var k={Point:{pointRadius:8,graphicName:"circle",fillColor:"white",fillOpacity:0.5,strokeWidth:1,strokeOpacity:0.5,strokeColor:"#f00"},Line:{strokeWidth:3,strokeOpacity:1,strokeColor:"#f00"}};var o=new OpenLayers.Style();o.addRules([new OpenLayers.Rule({symbolizer:k})]);var m=new OpenLayers.StyleMap({"default":o});l.handlerOptions={style:"default",layerOptions:{styleMap:m},persist:true};this.measureControl=new NSZemljevid.Measure(OpenLayers.Handler.Path,l);this.map.addControl(this.measureControl);this.measureControl.events.register("deactivate",this,this.onMeasureEsc);q=null},onMeasureEsc:function(){this.gpsMeasureList.uncheck("measure");this.applyImage("_nsz_gps_measure","api-add-more.png")},onGpsEsc:function(){this.gpsMeasureList.uncheck("gps");this.applyImage("_nsz_gps_measure","api-add-more.png")},gpsMeasureListClick:function(b){if(b.action.match(/^gps_act$/)){this.gpsControl.activate()}if(b.action.match(/^gps_deact$/)){this.gpsControl.deactivate()}if(b.action.match(/^measure_deact$/)){this.measureControl.deactivate()}if(b.action.match(/^measure_act$/)){this.measureControl.activate()}if(!this.measureControl.active&&!this.gpsControl.active){this.applyImage("_nsz_gps_measure","api-add-more.png")}else{if(this.measureControl.active||this.gpsControl.active){this.applyImage("_nsz_gps_measure","api-add-more-active.png")}}},gpsMeasureListMouseOver:function(b){OpenLayers.Event.stop(b);this.handleTimer2();return true},gpsMeasureListMouseOut:function(b){OpenLayers.Event.stop(b);this.startTimer2();return true},createIcon:function(i,f,j){var g=OpenLayers.Util.createDiv(i+"_container",null,null,null,"relative");g.style.width="43px";g.style.display="block";g.style.margin="0 auto";g.style.padding=this.iconTopPadding+"px 0 0 0";this.elementsDiv.appendChild(g);var k=OpenLayers.Util.createDiv(i,null,null,null,"relative");this.applyImage(k,f);k.style.height="43px";k.style.cursor="pointer";if(j){k.title=j}g.appendChild(k);return k},applyImage:function(c,d){c=c instanceof Object?c:$(c);if(OpenLayers.Util.alphaHack()){c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+d+"', sizingMethod='image')"}else{c.style.background="url("+OpenLayers.ImgPath+d+") no-repeat 0 0"}},onZoomVrhoviChange:function(){var b=$("_nsz_vrhovi");if(this.map.getZoom()>=this.vrhoviControl.minZoomLevel){if(this.vrhoviControl.active){this.applyImage(b,"api-mountain-active.png")}}else{this.applyImage(b,"api-mountain.png");this.vrhoviControl.deactivate()}},handleMppClick:function(){if(!this.mppControl.active){this.mppControl.activate();this.events.triggerEvent("mppActivate")}else{this.mppControl.deactivate()}return true},handleVrhoviClick:function(){if(this.map.getZoom()<this.vrhoviControl.minZoomLevel){return true}if(!this.vrhoviControl.active){this.vrhoviControl.activate();this.events.triggerEvent("vrhoviActivate")}else{this.vrhoviControl.deactivate()}return true},handleCameraClick:function(){if(!this.camerasControl.active){this.camerasControl.activate();this.applyImage("_nsz_cameras","api-camera-active.png");this.events.triggerEvent("cameraActivate")}else{this.camerasControl.deactivate()}},mppListSmallClick:function(b){this.map.zoomTo(6);this.map._nsz_panTo(b.coord);this.mppListSmall.hide();this.mppList.show()},vrhoviListClick:function(){if(this.map.tstatus){this.map._nsz_center2(8)}else{this.map.zoomTo(8)}this.handleVrhoviClick();this.applyImage("_nsz_vrhovi","api-mountain-active.png")},CLASS_NAME:"NSZemljevid.Overlays"});NSZemljevid.DOFControl=OpenLayers.Class(NSZemljevid.MapTypeControl,{initialize:function(){NSZemljevid.MapTypeControl.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.__onActivate)},draw:function(){NSZemljevid.MapTypeControl.prototype.draw.apply(this,arguments);return this.div},__onActivate:function(){if(!this.layer){this.addLayer()}this.deactivateActiveControl(this.CLASS_NAME);this.events.triggerEvent("onActivate",{type:"satellite"});this.map.setBaseLayer(this.layer)},addLayer:function(){this.layer=new OpenLayers.Layer.TMS("DOFLayer",NSZemljevid.IMGURL,{getURL:this._getDOFUrl,alpha:false,transitionEffect:"resize",isBaseLayer:true,buffer:(this.tileBuffer&&this.tileBuffer!=null)?this.tileBuffer:NSZemljevid.TILE_BUFFER});this.map.addLayer(this.layer)},_getDOFUrl:function(k){var f=this.map.getResolution();var i=Math.round((k.left-this.maxExtent.left)/(f*this.tileSize.w));var j=Math.round((this.maxExtent.top-k.top)/(f*this.tileSize.h));var g=this.map.getZoom();return this.url+"/dof/"+g+"/"+j+"/"+i},onZoomDofChange:function(b){if(this.map.getZoom()>6){OpenLayers.Event.observe(this.div,"click",this.onClick.bind(this))}else{OpenLayers.Event.stopObserving(this.div,"click",this.onClick)}},CLASS_NAME:"NSZemljevid.DOFControl"});NSZemljevid.HybridControl=OpenLayers.Class(NSZemljevid.MapTypeControl,{initialize:function(){NSZemljevid.MapTypeControl.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.onHybridActivate)},draw:function(){NSZemljevid.MapTypeControl.prototype.draw.apply(this,arguments);return this.div},onHybridActivate:function(){if(!this.layer){this.addLayer()}this.events.triggerEvent("onActivate",{type:"hybrid"});this.deactivateActiveControl(this.CLASS_NAME);this.map.setBaseLayer(this.layer)},addLayer:function(){this.layer=new OpenLayers.Layer.TMS("HybridLayer",NSZemljevid.IMGURL,{getURL:this._getHybridUrl,alpha:false,transitionEffect:"null",isBaseLayer:true,buffer:(this.tileBuffer&&this.tileBuffer!=null)?this.tileBuffer:NSZemljevid.TILE_BUFFER});this.map.addLayer(this.layer)},_getHybridUrl:function(k){var f=this.map.getResolution();var i=Math.round((k.left-this.maxExtent.left)/(f*this.tileSize.w));var j=Math.round((this.maxExtent.top-k.top)/(f*this.tileSize.h));var g=this.map.getZoom();return this.url+"/hybrid/"+g+"/"+j+"/"+i},CLASS_NAME:"NSZemljevid.HybridControl"});NSZemljevid.StandardMapControl=OpenLayers.Class(NSZemljevid.MapTypeControl,{initialize:function(){NSZemljevid.MapTypeControl.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this._onActivate)},draw:function(){NSZemljevid.MapTypeControl.prototype.draw.apply(this,arguments);if(this.currentBtPos==0){this.hide()}return this.div},show:function(){this.div.style.display="block"},hide:function(){this.div.style.display="none"},_onActivate:function(b){if(!this.layer){this.addLayer()}this.deactivateActiveControl(this.CLASS_NAME);this.events.triggerEvent("onActivate",{type:"standard"});this.map.setBaseLayer(this.layer)},addLayer:function(){this.layer=new OpenLayers.Layer.TMS("TileLayer",NSZemljevid.IMGURL,{getURL:this._getMyUrl,alpha:false,transitionEffect:"null",isBaseLayer:true,buffer:this.tileBuffer!=null?this.tileBuffer:NSZemljevid.TILE_BUFFER});this.map.addLayer(this.layer)},_getMyUrl:function(m){var g=this.map.getResolution();var j=Math.round((m.left-this.maxExtent.left)/(g*this.tileSize.w));var k=Math.round((this.maxExtent.top-m.top)/(g*this.tileSize.h));var i=this.map.getZoom();var l=this.url+"/0/"+i+"/"+k+"/"+j;return l},CLASS_NAME:"NSZemljevid.StandardMapControl"});NSZemljevid.TrafficButton=OpenLayers.Class(OpenLayers.Control,{element:null,lastXy:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.onTrafficActivate);this.events.register("deactivate",this,this.onTrafficDeactivate)},draw:function(){},onTrafficActivate:function(){if(!this.layer){this.addLayer()}else{this.layer.setVisibility(!this.layer.getVisibility())}},onTrafficDeactivate:function(){this.layer.setVisibility(!this.layer.getVisibility());if(this.map.popups[0]){this.map.removePopup(this.map.popups[0])}},loadData:function(){var d=document.createElement("script");d.setAttribute("type","text/javascript");d.setAttribute("src",NSZemljevid.TRAFFIC_SERVICE);d.setAttribute("id","najdi_traffic_data");var c=document.getElementsByTagName("head")[0];c.appendChild(d);c=null},addLayer:function(){this.layer=new OpenLayers.Layer.Markers("Traffic");this.map.addLayer(this.layer);var f=this.map.getLayersByName("Weather")[0];if(f){var d=this.map.getLayerIndex(f);var e=this.map.getLayerIndex(this.layer);this.map.raiseLayer(this.layer,d-e)}this.map.resetLayersZIndex();this.loadData()},onTrafficData:function(C){var H=document.getElementsByTagName("head")[0];H.removeChild($("najdi_traffic_data"));H=null;if(C){var G=new OpenLayers.Size(20,20);var v=C.entry.length;try{for(var B=0;B<v;B++){var E=C.entry[B];var o=E.point.lat;var F=E.point.lon;if(!o||!F||o==1||F==1){continue}var e=new OpenLayers.LonLat(F,o);var w=this.map.info.fromWGS84ToGK(e);var z=OpenLayers.ImgPath+"traffic_icon/"+E.icon;var A=this.map.info.getLonLat(w.x,w.y);var i=new TrafficIcon(z,G,null,null,{title:E.title,summary:E.summary,update:E.updated,updateTime:E.updateTime,link:C.link});var D=new TrafficMarker(A,i);D.events.register("click",D,this.onTrafficMarkerClick);this.layer.addMarker(D)}}catch(u){}}},onTrafficMarkerClick:function(){var c='<div style="font-family:Arial;font-size:11px;padding:5px 10px 10px 10px;">';c+='<div style="padding-bottom:3px;font-size:12px;">';c+="<table cellpadding=0 cellspacing=0 border=0 width=100%>";c+="<tr><td width=20>";c+='<img border=0 width=20 height=20 src="'+this.icon.url+'"/></td>';c+="<td>&nbsp;<strong>"+this.icon.title+"</strong></td>";c+="</tr></table>";c+="</div>";c+='<div style="border-bottom: 1px solid #cccccc;"></div>';c+='<div style="padding-top:5px;">'+this.icon.summary+"</div>";c+='<div style="padding:5px 0 5px;color:#666;">Zadnja posodobitev: '+this.icon.update+" - "+this.icon.updateTime+"</div>";c+='<div style="border-bottom: 1px solid #cccccc;"></div>';c+='<div style="float:none;text-align:right;padding-top:5px;color:#666;"><a style="color:#666;" target="_blank" href="'+this.icon.link+'">'+this.icon.link+"</a></div>";c+="</div>";var d=new NSZemljevid.FramedCloud("trafficCloud",this.lonlat,null,c,this.icon,true);this.map.addPopup(d,true)},CLASS_NAME:"ITrafficButton"});TrafficIcon=OpenLayers.Class(OpenLayers.Icon,{title:null,summary:null,update:null,link:null,updateTime:null,initialize:function(){OpenLayers.Icon.prototype.initialize.apply(this,arguments);this.title=arguments[4].title;this.summary=arguments[4].summary;this.update=arguments[4].update;this.link=arguments[4].link;this.updateTime=arguments[4].updateTime},draw:function(b){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(b);this.imageDiv.style.cursor="pointer";return this.imageDiv}});TrafficMarker=OpenLayers.Class(OpenLayers.Marker,{zoom:null,initialize:function(){OpenLayers.Marker.prototype.initialize.apply(this,arguments);this.zoom=arguments[2]},CLASS_NAME:"NSZemljevid.TrafficButton"});NSZemljevid.MPP=OpenLayers.Class(OpenLayers.Control,{layer:null,minZoomLevel:6,alloff:true,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.onMPPActivate);this.events.register("deactivate",this,this.onMPPDeactivate)},draw:function(){},onMPPActivate:function(){if(this.layer){this.layer.setVisibility(true)}},onMPPDeactivate:function(){if(this.layer){this.layer.setVisibility(false);this.map.removeLayer(this.layer);this.layer=null}},showProga:function(b){this.removeProga();this.addLayer(b)},removeProga:function(){if(this.layer){this.map.removeLayer(this.layer);this.layer=null;this.map.resetLayersZIndex()}},addLayer:function(b){this.layer=new OpenLayers.Layer.TMS("MPPLayer",NSZemljevid.IMGURL,{getURL:this._getMPPUrl,alpha:NSZemljevid.Util.isIE6,transitionEffect:"null",isBaseLayer:false,progaData:b?b:null,buffer:(this.tileBuffer&&this.tileBuffer!=null)?this.tileBuffer:NSZemljevid.TILE_BUFFER});this.map.addLayer(this.layer);this.handleLayerIndex()},_getMPPUrl:function(k){var f=this.map.getResolution();var i=Math.round((k.left-this.maxExtent.left)/(f*this.tileSize.w));var j=Math.round((this.maxExtent.top-k.top)/(f*this.tileSize.h));var g=this.map.getZoom();return this.url+"/mpp/"+this.progaData.mesto+"/"+this.progaData.proga.toLowerCase()+"/"+g+"/"+j+"/"+i},handleLayerIndex:function(){for(var f=0,e=this.map.layers.length;f<e;f++){var d=this.map.layers[f];if(!d.isBaseLayer){continue}this.map.setLayerIndex(this.layer,this.map.getLayerIndex(d));this.map.resetLayersZIndex();break}},CLASS_NAME:"NSZemljevid.MPP"});NSZemljevid.Vrhovi=OpenLayers.Class(OpenLayers.Control,{layer:null,minZoomLevel:8,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.onVrhoviActivate);this.events.register("deactivate",this,this.onVrhoviDeactivate)},draw:function(){},onVrhoviActivate:function(){if(!this.layer){this.addLayer()}else{this.layer.setVisibility(true)}},onVrhoviDeactivate:function(){if(this.layer){this.layer.setVisibility(false)}},addLayer:function(){this.layer=new OpenLayers.Layer.TMS("VrhoviLayer",NSZemljevid.IMGURL,{getURL:this._getVrhoviUrl,alpha:false,transitionEffect:"null",isBaseLayer:false,buffer:(this.tileBuffer&&this.tileBuffer!=null)?this.tileBuffer:NSZemljevid.TILE_BUFFER});this.map.addLayer(this.layer);for(var f=0,e=this.map.layers.length;f<e;f++){var d=this.map.layers[f];if(!d.isBaseLayer){continue}this.map.setLayerIndex(this.layer,this.map.getLayerIndex(d));this.map.resetLayersZIndex();break}},_getVrhoviUrl:function(k){var f=this.map.getResolution();var i=Math.round((k.left-this.maxExtent.left)/(f*this.tileSize.w));var j=Math.round((this.maxExtent.top-k.top)/(f*this.tileSize.h));var g=this.map.getZoom();return this.url+"/vrhovi/"+g+"/"+j+"/"+i},CLASS_NAME:"NSZemljevid.Vrhovi"});NSZemljevid.Cameras=OpenLayers.Class(OpenLayers.Control,{layer:null,loadingImages:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.events.register("activate",this,this.onCamerasActivate);this.events.register("deactivate",this,this.onCamerasDeactivate)},draw:function(){},onCamerasActivate:function(){if(!this.layer){this.addLayer()}else{this.loadData()}},onCamerasDeactivate:function(){if(this.layer){this.layer.destroyFeatures()}},addLayer:function(){this.layer=new OpenLayers.Layer.Vector("Cameras",{isBaseLayer:false,styleMap:new OpenLayers.StyleMap({"default":{externalGraphic:"${icon}",graphicZIndex:"${zIndex}",graphicYOffset:"${iconYOffset}",graphicXOffset:"${iconXOffset}",pointRadius:10,graphicWidth:"${iconWidth}",graphicHeight:"${iconHeight}",backgroundGraphic:"${backgroundGraphic}",backgroundHeight:"${backgroundHeight}",backgroundWidth:"${backgroundWidth}",backgroundYOffset:-23,backgroundXOffset:-1,backgroundGraphicZIndex:"10",graphicTitle:"${graphicTitle}"},select:{externalGraphic:"${selectIcon}",graphicYOffset:"${iconYOffset}",pointRadius:10,graphicWidth:"${iconWidth}",graphicHeight:"${iconHeight}",cursor:"${cursor}"},"delete":{display:"none"}})});this.map.addLayer(this.layer);this.loadData()},loadData:function(){var d=document.createElement("script");d.setAttribute("type","text/javascript");d.setAttribute("src",NSZemljevid.CAMERAS_SERVICE);d.setAttribute("id","najdi_camera_data");var c=document.getElementsByTagName("head")[0];NSZemljevid.cameraControl=this;c.appendChild(d);c=null},onCameraData:function(n){var q=document.getElementsByTagName("head")[0];q.removeChild($("najdi_camera_data"));q=null;NSZemljevid.cameraControl=null;if(!n){return}var l=[];for(var r=0,k=n.length;r<k;r++){var o=new NSZemljevid.Icon({url:OpenLayers.ImgPath+"poi-kamera.png",size:new NSZemljevid.Size(22,14),offset:new NSZemljevid.Pixel(-11,-7)});var m=new NSZemljevid.LonLat(n[r].coordinate.lon,n[r].coordinate.lat);var i=new NSZemljevid.Marker(m,{icon:o,dropShadow:false,graphicTitle:n[r].naslov,cameraData:n[r].data});i.addEventListener("click",this.onCameraClick,this);l.push(i)}this.layer.addFeatures(l);l=n=formater=null},onCameraClick:function(m){var q='<div style="padding:0 10px 10px 10px;font-family:Arial;font-size:12px;">';if(m.options.cameraData&&m.options.cameraData.length==1){q+='<div style="padding:0 0 5px 0;width:220px;"><strong>'+m.options.graphicTitle+"</strong></div>"}else{q+='<div style="padding:0 0 5px 0;"><strong>'+m.options.graphicTitle+"</strong></div>"}q+="<table cellpadding=0 cellspacing=0 border=0>";q+="<tr>";if(m.options.cameraData){var n=m.options.cameraData;this.loadingImages={};for(var r=0,i=n.length;r<i;r++){if(r==2){break}var f,o;if(n[r].url){f=n[r].url}if(n[r].opis){o=n[r].opis}q+="<td valign=top";if(r==0){q+=' style="padding:0 10px 0 0;"'}q+=">";var l="NSZemljevid.loadingImage"+r;q+='<div style="width:220px;height:180px;"><div id="'+l+'"><strong>Nalagam sliko...</strong></div></div>';q+='<div style="width:220px;">'+o;q+="</div>";q+="</td>";this.createImage(f,o,l)}this.imageLoadingTimerId=window.setTimeout(OpenLayers.Function.bind(this.onImageLoadingTimer,this),5000)}q+="</tr></table>";q+='<div style="text-align:right;color:#999;font-size:10px;">Vir: DARS</div></div>';m.openPopup(q,null,this.onHidePopup)},createImage:function(e,k,i){var g=document.createElement("img");g.title=k;g.style.width="220px";g.style.height="165px";g.id="_"+i;this.loadingImages[i]={status:0,url:e,opis:k,img:g};try{OpenLayers.Event.observe(g,"load",OpenLayers.Function.bind(this.onImgLoad,this,i))}catch(j){}if(e.match(/\?/ig)){g.src=e+"&ts="+new Date().getTime()}else{g.src=e+"?ts="+new Date().getTime()}},onImgLoad:function(g,i){var f=this.loadingImages[g].img;if(f){this.loadingImages[g].img=null;this.loadingImages[g].status=1;var e=$(g);e.innerHTML="";e.appendChild(f)}},onImageLoadingTimer:function(){this.imageLoadingTimerId=null;for(var b in this.loadingImages){if(this.loadingImages[b].status==0){$(b).innerHTML='<span style="color:red;">Slika trenutno ni na voljo.</span>';this.loadingImages[b].img=null}}this.imageReloadTimerId=window.setInterval(OpenLayers.Function.bind(this.onImageReloadTimer,this),10000)},onClosePopup:function(b){this.clearTimeout(false)},onHidePopup:function(c){this.hide();OpenLayers.Event.stop(c);var d=this.map.getControlsByClass("NSZemljevid.Cameras")[0];if(d){d.clearTimeout(true)}},clearTimeout:function(b){if(this.imageLoadingTimerId&&b){window.clearTimeout(this.imageLoadingTimerId);this.imageLoadingTimerId=null}if(this.imageReloadTimerId){window.clearInterval(this.imageReloadTimerId);this.imageReloadTimerId=null}},onImageReloadTimer:function(){for(var c in this.loadingImages){var d=this.loadingImages[c];if(d.status==1){if(d.url.match(/\?/ig)){$("_"+c).src=d.url+"&ts="+new Date().getTime()}else{$("_"+c).src=d.url+"?ts="+new Date().getTime()}}}},CLASS_NAME:"NSZemljevid.Cameras"});NSZemljevid.MppList=OpenLayers.Class(OpenLayers.Control,{currentLine:null,topPosition:114,data:{LJUBLJANA:[{p:1,ime:"Vi\u017emarje - Mestni log"},{p:"N1",ime:"Bavarski dvor - Gameljne (no\u010dna)"},{p:"1B",ime:"Mestni log - Gameljne (nedelja)"},{p:"1S",ime:"Nedeljski sejem - Gameljne (Nedelja do 13:00)"},{p:"2",ime:"Nove Jar\u0161e Zelena jama"},{p:"3",ime:"Litostroj - Rudnik"},{p:"5",ime:"Podutik - \u0160tepanjsko naselje "},{p:"N5",ime:"Podutik - \u0160tepanjsko naselje (no\u010dna)"},{p:"6",ime:"\u010crnu\u010de - Dolgi most"},{p:"6B",ime:"\u010crnu\u010de - Vnanje Gorice"},{p:"7",ime:"Pr\u017ean - Nove Jar\u0161e"},{p:"7L",ime:"Pr\u017ean - Letali\u0161ka"},{p:"8",ime:"Gameljne - Brn\u010di\u010deva"},{p:"9",ime:"\u0160tepanjsko naselje - Trnovo"},{p:"11",ime:"Je\u017eica - Zalog"},{p:"N11",ime:"Bavarski dvor - Zalog"},{p:"11B",ime:"Be\u017eigrad - Zalog (21:00 - 24:00 in sobota)"},{p:"12",ime:"Be\u017eigrad - Vev\u010de"},{p:"13",ime:"Be\u017eigrad - Sostro"},{p:"14",ime:"Savlje - Vrhovci"},{p:"14B",ime:"Savlje - Bokalce"},{p:"18",ime:"Tovarna Lek - Kino \u0160i\u0161ka"},{p:"19",ime:"Toma\u010devo - Barje"},{p:"19B",ime:"Barje - Jezero"},{p:"20",ime:"Nove Sto\u017eice - Fu\u017eine"},{p:"20Z",ime:"Nove Sto\u017eice - Zalog (nedelja)"},{p:"21",ime:"Beri\u010devo - Je\u017eica"},{p:"22",ime:"Kamna Gorica - Fu\u017eine"},{p:"23",ime:"Kolodvor - ZOO ( Maj - Oktober)"},{p:"24",ime:"Bizovik - Kodeljevo"},{p:"25",ime:"Medvode - Zadobrova"},{p:"27",ime:"NS Rudnik - BTC - Letali\u0161ka"},{p:"27K",ime:"Bavarski dvor - Kolosej (nedelja)"},{p:"28",ime:"Kodeljevo - Mali Lipoglav"}],MARIBOR:[{p:1,ime:"Tezenska Dobrava"},{p:2,ime:"Betnavska - Kardeljeva - gosti\u0161\u010de Lebe/Razvanje"},{p:3,ime:"Dobrava - Tezno - Gosposvetska - AP Mlinska - Pobre\u017eje - Dobrava"},{p:4,ime:"Studenci - Lesarska \u0161ola - Limbu\u0161 Bla\u017eovica"},{p:6,ime:"Vzpenja\u010da"},{p:7,ime:"Kamnica - Ro\u0161poh"},{p:8,ime:"Gregor\u010di\u010deva - Terme Fontana"},{p:9,ime:"Zrkovci"},{p:10,ime:"Male\u010dnik"},{p:12,ime:"Dobrava - Pobre\u017eje - AP Mlinska - Gosposvetska rondo - Tezno Dobrava"},{p:13,ime:"\u010crnogorska - cona TAM"},{p:15,ime:"Ko\u0161a\u0161ki dol - Bresternica"},{p:16,ime:"Dogo\u0161e"},{p:17,ime:"Studenci + Ribni\u0161ko selo"},{p:18,ime:"Pekre"},{p:19,ime:"\u0161arhova"},{p:20,ime:"Gru\u0161ova"},{p:21,ime:"Ljubljanska"}]},initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.div.style.position="absolute";this.div.style.top=this.topPosition+"px";this.div.style.right="41px";this.div.style.fontFamily="Arial";this.div.style.fontSize="11px";this.div.style.padding="5px 1px 5px 8px";this.div.style.width="214px";this.div.style.height="216px";var q=document.createElement("div");q.style.width="205px";q.style.height="206px";q.style.overflow="auto";this.div.appendChild(q);var w='<div style="width:205px;height:206px;overflow-y:auto;';if(OpenLayers.Util.alphaHack()){w+="position:absolute;z-index:1;"}w+='">';w+='<form onsubmit="return false;" style="margin:0;padding:0;">';w+='<div style="text-align:center;padding:5px 0;"><input style="cursor:pointer;font-size:11px;" type="button" value="Po\u010disti" /></div>';for(var s in this.data){w+='<div style="text-align:center;padding:5px 0;background-color:#fcd142;"><strong>'+s+"</strong></div>";var c=this.data[s];var v="lj";if(s.match(/ljubljana/ig)){v="lj"}else{if(s.match(/maribor/ig)){v="mb"}}w+="<table cellspacing=0 border=0>";var t=0;for(var z=0,u=c.length;z<u;z++){var i=c[z];if(!i.p){continue}var r="<strong>"+i.p+"</strong> - "+i.ime;var B=(t%2)==0?"background-color:#e5e8f0;":"";w+='<tr style="'+B+'"><td style="padding:2px;"><input style="cursor:pointer;" town="'+v+'" type=checkbox name="'+v+"_"+i.p+'" value="'+i.p+'" id="_'+v+"_"+i.p+'"/></td>';w+='<td style="padding:2px;"><label style="cursor:pointer;" for="_'+v+"_"+i.p+'">'+r+"</label></td></tr>";t+=1}w+="</table>"}w+="</form></div>";q.innerHTML=w;if(OpenLayers.Util.alphaHack()){var A=OpenLayers.Util.createAlphaImageDiv(null,new OpenLayers.Pixel(0,0),new OpenLayers.Size(214,216),OpenLayers.ImgPath+"menu/menu-bck.png","absolute",null,"image");this.div.appendChild(A)}else{this.applyImage(this.div,"menu/menu-bck.png")}OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mouseover",OpenLayers.Function.bindAsEventListener(this.mouseOver,this));OpenLayers.Event.observe(this.div,"mouseout",OpenLayers.Function.bindAsEventListener(this.mouseOut,this));OpenLayers.Event.observe(this.div,"click",OpenLayers.Function.bindAsEventListener(this.mouseClick,this));OpenLayers.Event.observe(this.div,"dblclick",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));this.hide();return this.div},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Control.prototype.destroy.apply(this,arguments)},mouseClick:function(g){var e=OpenLayers.Event.element(g);if(e.tagName.match(/input/ig)){e.blur();var f=e.getAttribute("type");if(f.match(/checkbox/ig)){var i=e.getAttribute("town");if(this.currentLine&&this.currentLine.name==e.name){this.events.triggerEvent("click",{proga:e.value,mesto:i,action:"deactivate",alloff:true});this.currentLine=null}else{if(this.currentLine){this.events.triggerEvent("click",{proga:this.currentLine.value,mesto:this.currentLine.getAttribute("town"),action:"deactivate"});this.currentLine.checked=false}this.currentLine=e;this.events.triggerEvent("click",{proga:e.value,mesto:i,action:"activate"})}}else{if(f.match(/button/ig)){this.events.triggerEvent("click",{action:"deactivate",alloff:true});this.currentLine.checked=false;this.currentLine=null}}}return true},mouseUpDown:function(b){OpenLayers.Event.stop(b);return true},mouseOver:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOver");return true},mouseOut:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOut");return true},applyImage:function(c,d){if(OpenLayers.Util.alphaHack()){c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+d+"', sizingMethod='image')"}else{c.style.background="url("+OpenLayers.ImgPath+d+") no-repeat 0 0"}},hide:function(){this.div.style.display="none"},show:function(){this.div.style.display="block"},CLASS_NAME:"NSZemljevid.MppList"});NSZemljevid.GPSMeasureList=OpenLayers.Class(OpenLayers.Control,{data:[{name:"Prikaz GPS koordinat",value:"gps"},{name:"Merjenje razdalje",value:"measure"}],topPosition:273,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.div.style.position="absolute";this.div.style.top=this.topPosition+"px";this.div.style.right="41px";this.div.style.fontFamily="Arial";this.div.style.fontSize="11px";this.div.style.padding="5px 1px 5px 8px";this.div.style.width="161px";this.div.style.height="65px";var j='<div style="width:161px;height:65px;padding:5px 0 0 0;';if(OpenLayers.Util.alphaHack()){j+="position:absolute;z-index:1;"}j+='">';j+='<form name=_nsz_gps_measure_form onsubmit="return false;" style="margin:0;padding:0;">';j+="<table cellspacing=0 border=0>";for(var k=0,g=this.data.length;k<g;k++){var i="";j+='<tr style="'+i+'"><td style="padding:2px;"><input style="cursor:pointer;" type=checkbox name="'+this.data[k].value+'" value="'+this.data[k].value+'" id="_gps_'+k+'" /></td>';j+='<td style="padding:2px;"><label style="cursor:pointer;" for="_gps_'+k+'">'+this.data[k].name+"</label></td></tr>"}j+="</table>";j+="</form></div>";this.div.innerHTML=j;if(OpenLayers.Util.alphaHack()){var f=OpenLayers.Util.createAlphaImageDiv(null,new OpenLayers.Pixel(0,0),new OpenLayers.Size(214,216),OpenLayers.ImgPath+"menu/menu-bck2.png","absolute",null,"image");this.div.appendChild(f)}else{this.applyImage(this.div,"menu/menu-bck2.png")}OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mouseover",OpenLayers.Function.bindAsEventListener(this.mouseOver,this));OpenLayers.Event.observe(this.div,"mouseout",OpenLayers.Function.bindAsEventListener(this.mouseOut,this));OpenLayers.Event.observe(this.div,"click",OpenLayers.Function.bindAsEventListener(this.mouseClick,this));OpenLayers.Event.observe(this.div,"dblclick",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));this.hide();return this.div},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Control.prototype.destroy.apply(this,arguments)},mouseClick:function(k){var m=OpenLayers.Event.element(k);if(m.tagName.match(/input/ig)){m.blur();for(var e=0,i=this.data.length;e<i;e++){if(m.name==this.data[e].value){continue}if(document._nsz_gps_measure_form[this.data[e].value].checked){this.uncheck(this.data[e].value);var l={};l.action=this.data[e].value+"_deact";this.events.triggerEvent("click",l)}}var j={};if(m.checked){j.action=m.value+"_act"}else{j.action=m.value+"_deact"}this.events.triggerEvent("click",j)}return true},uncheck:function(b){if(document._nsz_gps_measure_form[b].checked){document._nsz_gps_measure_form[b].checked=false}},mouseUpDown:function(b){OpenLayers.Event.stop(b);return true},mouseOver:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOver");return true},mouseOut:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOut");return true},applyImage:function(c,d){if(OpenLayers.Util.alphaHack()){c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+d+"', sizingMethod='image')"}else{c.style.background="url("+OpenLayers.ImgPath+d+") no-repeat 0 0"}},hide:function(){this.div.style.display="none"},show:function(){this.div.style.display="block"},CLASS_NAME:"NSZemljevid.GPSMeasureList"});NSZemljevid.MppListSmall=OpenLayers.Class(OpenLayers.Control,{data:{lj:new NSZemljevid.GK(461993,101061),mb:new NSZemljevid.GK(549727,157816)},topPosition:273,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.div.style.position="absolute";this.div.style.top=this.topPosition+"px";this.div.style.right="41px";this.div.style.fontFamily="Arial";this.div.style.fontSize="11px";this.div.style.padding="5px 1px 5px 8px";this.div.style.width="161px";this.div.style.height="65px";var c='<div style="width:161px;height:65px;padding:5px 0 0 0;';if(OpenLayers.Util.alphaHack()){c+="position:absolute;z-index:1;"}c+='">';c+="<div>Prenizka pove\u010dava za prikaz.</div>";c+='<div style="padding-top:2px;"><a style="color:#4963AD;" town=lj href="javascript:void(0)">Pove\u010daj v LJ</a></div>';c+='<div style="padding-top:2px;"><a style="color:#4963AD;" town= mb href="javascript:void(0)">Pove\u010daj v MB</a></div>';c+="</div>";this.div.innerHTML=c;if(OpenLayers.Util.alphaHack()){var d=OpenLayers.Util.createAlphaImageDiv(null,new OpenLayers.Pixel(0,0),new OpenLayers.Size(214,216),OpenLayers.ImgPath+"menu/menu-bck2.png","absolute",null,"image");this.div.appendChild(d)}else{this.applyImage(this.div,"menu/menu-bck2.png")}OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mouseover",OpenLayers.Function.bindAsEventListener(this.mouseOver,this));OpenLayers.Event.observe(this.div,"mouseout",OpenLayers.Function.bindAsEventListener(this.mouseOut,this));OpenLayers.Event.observe(this.div,"click",OpenLayers.Function.bindAsEventListener(this.mouseClick,this));OpenLayers.Event.observe(this.div,"dblclick",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));this.hide();return this.div},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Control.prototype.destroy.apply(this,arguments)},mouseClick:function(f){var e=OpenLayers.Event.element(f);if(e.tagName.match(/^a$/ig)){e.blur();var d=e.getAttribute("town");this.events.triggerEvent("click",{town:d,coord:this.data[d]})}return true},uncheck:function(b){if(document._nsz_gps_measure_form[b].checked){document._nsz_gps_measure_form[b].checked=false}},mouseUpDown:function(b){OpenLayers.Event.stop(b);return true},mouseOver:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOver");return true},mouseOut:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOut");return true},applyImage:function(c,d){if(OpenLayers.Util.alphaHack()){c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+d+"', sizingMethod='image')"}else{c.style.background="url("+OpenLayers.ImgPath+d+") no-repeat 0 0"}},hide:function(){this.div.style.display="none"},show:function(){this.div.style.display="block"},CLASS_NAME:"NSZemljevid.MppListSmall"});NSZemljevid.VrhoviList=OpenLayers.Class(OpenLayers.Control,{data:{lj:new NSZemljevid.GK(461993,101061),mb:new NSZemljevid.GK(549727,157816)},topPosition:273,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.div.style.position="absolute";this.div.style.top=this.topPosition+"px";this.div.style.right="41px";this.div.style.fontFamily="Arial";this.div.style.fontSize="11px";this.div.style.padding="5px 1px 5px 8px";this.div.style.width="161px";this.div.style.height="65px";var c='<div style="width:161px;height:65px;padding:5px 0 0 0;';if(OpenLayers.Util.alphaHack()){c+="position:absolute;z-index:1;"}c+='">';c+="<div>Prenizka pove\u010dava za prikaz.</div>";c+='<div style="padding-top:7px;"><a style="color:#4963AD;" href="javascript:void(0)">Pove\u010daj</a></div>';c+="</div>";this.div.innerHTML=c;if(OpenLayers.Util.alphaHack()){var d=OpenLayers.Util.createAlphaImageDiv(null,new OpenLayers.Pixel(0,0),new OpenLayers.Size(214,216),OpenLayers.ImgPath+"menu/menu-bck2.png","absolute",null,"image");this.div.appendChild(d)}else{this.applyImage(this.div,"menu/menu-bck2.png")}OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));OpenLayers.Event.observe(this.div,"mouseover",OpenLayers.Function.bindAsEventListener(this.mouseOver,this));OpenLayers.Event.observe(this.div,"mouseout",OpenLayers.Function.bindAsEventListener(this.mouseOut,this));OpenLayers.Event.observe(this.div,"click",OpenLayers.Function.bindAsEventListener(this.mouseClick,this));OpenLayers.Event.observe(this.div,"dblclick",OpenLayers.Function.bindAsEventListener(this.mouseUpDown,this));this.hide();return this.div},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Control.prototype.destroy.apply(this,arguments)},mouseClick:function(c){var d=OpenLayers.Event.element(c);if(d.tagName.match(/^a$/ig)){d.blur();this.events.triggerEvent("click")}return true},mouseUpDown:function(b){OpenLayers.Event.stop(b);return true},mouseOver:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOver");return true},mouseOut:function(b){OpenLayers.Event.stop(b);this.events.triggerEvent("mouseOut");return true},applyImage:function(c,d){if(OpenLayers.Util.alphaHack()){c.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+OpenLayers.ImgPath+d+"', sizingMethod='image')"}else{c.style.background="url("+OpenLayers.ImgPath+d+") no-repeat 0 0"}},hide:function(){this.div.style.display="none"},show:function(){this.div.style.display="block"},CLASS_NAME:"NSZemljevid.VrhoviList"});NS_RED_ICON="red";NS_BLUE_ICON="blue";NS_GREEN_ICON="green";NS_PURPLE_ICON="purple";NS_BLUE_LIGHT_ICON="blued";NS_WHITE_ICON="white";NS_PANZOOM_TYPE1=1;NS_PANZOOM_TYPE2=2;NS_PANZOOM_TYPE3=3;NSZemljevid.INITIAL_ZOOM=2;NSZemljevid.MAX_ZOOM_LEVEL=11;NSZemljevid.TILE_SIZE=256;NSZemljevid.ZOOM_LEVELS=12;NSZemljevid.MAX_GEO_ZOOM=2343;NSZemljevid.REVISION=0;NSZemljevid.GK_COORD=1;NSZemljevid.LONLAT_COORD=2;NSZemljevid.TILE_BUFFER=1;NSZemljevid.MAX_RESOLUTION=Math.pow(2,NSZemljevid.ZOOM_LEVELS-1)*NSZemljevid.TILE_SIZE;NSZemljevid.IconSet={red:"arrow-red",blue:"arrow-blue",green:"arrow-green",purple:"arrow-purple",blued:"arrow-blue",selected:"arrow-selected"};NSZemljevid.IconSet2={red:"icon_red",blue:"icon_blue",green:"icon_green",purple:"icon_purple",white:"icon_white",selected:"icon_selected"};NSZemljevid.WEATHER_SERVICE="http://www.najdi.si/maps/weather/service.jsp?callback=NSZemljevid.onWeatherData";OpenLayers.ImgPath="http://www.najdi.si/api/images/";NSZemljevid.TRAFFIC_SERVICE="http://www.najdi.si/maps/traffic/service.jsp?callback=NSZemljevid.onTrafficData";NSZemljevid.CAMERAS_SERVICE="http://www.najdi.si/maps/traffic/camera.jsp?callback=NSZemljevid.onCameraData";NSZemljevid.ADM_SERVICE="http://www.najdi.si/servlet/MapAdsServlet";NSZemljevid.IMGURL="http://maps-nsi.sdn.si/"+NSZemljevid.REVISION;
