var OpenLayers={singleFile:true};(function(){var a=typeof OpenLayers=="object"&&OpenLayers.singleFile;var b;window.OpenLayers={_scriptName:!a?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){if(b!=undefined){return b}b="";var a=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var c=document.getElementsByTagName("script");for(var d=0,e=c.length;d<e;d++){var f=c[d].getAttribute("src");if(f){var g=f.match(a);if(g){b=g[1];break}}}return b}};if(!a){var c=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/Image/IFrame.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/WMS/Post.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/Layer/Zoomify.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/Control/Graticule.js","OpenLayers/Control/TransformFeature.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/Strategy/Refresh.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.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/Protocol/SOS.js","OpenLayers/Protocol/SOS/v1_0_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.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/Atom.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/CSWGetDomain.js","OpenLayers/Format/CSWGetDomain/v2_0_2.js","OpenLayers/Format/CSWGetRecords.js","OpenLayers/Format/CSWGetRecords/v2_0_2.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.js","OpenLayers/Format/WMSCapabilities/v1_1.js","OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSCapabilities/v1_3.js","OpenLayers/Format/WMSCapabilities/v1_3_0.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Format/OWSCommon/v1_1_0.js","OpenLayers/Format/SOSCapabilities.js","OpenLayers/Format/SOSCapabilities/v1_0_0.js","OpenLayers/Format/SOSGetObservation.js","OpenLayers/Format/SOSGetFeatureOfInterest.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 d=navigator.userAgent;var e=d.match("MSIE")||d.match("Safari");if(e){var f=new Array(c.length)}var g=OpenLayers._getScriptLocation()+"lib/";for(var h=0,i=c.length;h<i;h++){if(e){f[h]="<script src='"+g+c[h]+"'></script>"}else{var j=document.createElement("script");j.src=g+c[h];var k=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;k.appendChild(j)}}if(e){document.write(f.join(""))}}})();OpenLayers.VERSION_NUMBER="OpenLayers 2.9.1 -- $Revision: 10129 $";OpenLayers.String={startsWith:function(a,b){return a.indexOf(b)==0},contains:function(a,b){return a.indexOf(b)!=-1},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(a){var b=a.split("-");var c=b[0];for(var d=1,e=b.length;d<e;d++){var f=b[d];c+=f.charAt(0).toUpperCase()+f.substring(1)}return c},format:function(a,b,c){if(!b){b=window}var d=function(a,d){var e;var f=d.split(/\.+/);for(var g=0;g<f.length;g++){if(g==0){e=b}e=e[f[g]]}if(typeof e=="function"){e=c?e.apply(null,c):e()}if(typeof e=="undefined"){return"undefined"}else{return e}};if(a==null)return null;return a.replace(OpenLayers.String.tokenRegEx,d)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)},numericIf:function(a){return OpenLayers.String.isNumeric(a)?parseFloat(a):a}};if(!String.prototype.startsWith){String.prototype.startsWith=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,a)}}if(!String.prototype.contains){String.prototype.contains=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,a)}}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(a,b){var c=0;if(b>0){c=parseFloat(a.toPrecision(b))}return c},format:function(a,b,c,d){b=typeof b!="undefined"?b:0;c=typeof c!="undefined"?c:OpenLayers.Number.thousandsSeparator;d=typeof d!="undefined"?d:OpenLayers.Number.decimalSeparator;if(b!=null){a=parseFloat(a.toFixed(b))}var e=a.toString().split(".");if(e.length==1&&b==null){b=0}var f=e[0];if(c){var g=/(-?[0-9]+)([0-9]{3})/;while(g.test(f)){f=f.replace(g,"$1"+c+"$2")}}var h;if(b==0){h=f}else{var i=e.length>1?e[1]:"0";if(b!=null){i=i+(new Array(b-i.length+1)).join("0")}h=f+d+i}return h}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,a)}}OpenLayers.Function={bind:function(a,b){var c=Array.prototype.slice.apply(arguments,[2]);return function(){var d=c.concat(Array.prototype.slice.apply(arguments,[0]));return a.apply(b,d)}},bindAsEventListener:function(a,b){return function(c){return a.call(b,c||window.event)}},False:function(){return false},True:function(){return true}};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(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,a)}}OpenLayers.Array={filter:function(a,b,c){var d=[];if(Array.prototype.filter){d=a.filter(b,c)}else{var e=a.length;if(typeof b!="function"){throw new TypeError}for(var f=0;f<e;f++){if(f in a){var g=a[f];if(b.call(c,g,f,a)){d.push(g)}}}}return d}};OpenLayers.Class=function(){var a=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var b={};var c,d;for(var e=0,f=arguments.length;e<f;++e){if(typeof arguments[e]=="function"){if(e==0&&f>1){d=arguments[e].prototype.initialize;arguments[e].prototype.initialize=function(){};b=new arguments[e];if(d===undefined){delete arguments[e].prototype.initialize}else{arguments[e].prototype.initialize=d}}c=arguments[e].prototype}else{c=arguments[e]}OpenLayers.Util.extend(b,c)}a.prototype=b;return a};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 a=arguments[0];var b=new a(OpenLayers.Class.isPrototype);for(var c=1,d=arguments.length;c<d;c++){if(typeof arguments[c]=="function"){var e=arguments[c];arguments[c]=new e(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(b,arguments[c])}return b};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var a=[];for(var b=0,c=arguments.length;b<c;b++){var d=arguments[b];if(typeof d=="string"){d=document.getElementById(d)}if(arguments.length==1){return d}a.push(d)}return a};OpenLayers.Util.isElement=function(a){return!!(a&&a.nodeType===1)};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(a,b){a=a||{};if(b){for(var c in b){var d=b[c];if(d!==undefined){a[c]=d}}var e=typeof window.Event=="function"&&b instanceof window.Event;if(!e&&b.hasOwnProperty&&b.hasOwnProperty("toString")){a.toString=b.toString}}return a};OpenLayers.Util.removeItem=function(a,b){for(var c=a.length-1;c>=0;c--){if(a[c]==b){a.splice(c,1)}}return a};OpenLayers.Util.clearArray=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));a.length=0};OpenLayers.Util.indexOf=function(a,b){if(typeof a.indexOf=="function"){return a.indexOf(b)}else{for(var c=0,d=a.length;c<d;c++){if(a[c]==b){return c}}return-1}};OpenLayers.Util.modifyDOMElement=function(a,b,c,d,e,f,g,h){if(b){a.id=b}if(c){a.style.left=c.x+"px";a.style.top=c.y+"px"}if(d){a.style.width=d.w+"px";a.style.height=d.h+"px"}if(e){a.style.position=e}if(f){a.style.border=f}if(g){a.style.overflow=g}if(parseFloat(h)>=0&&parseFloat(h)<1){a.style.filter="alpha(opacity="+h*100+")";a.style.opacity=h}else if(parseFloat(h)==1){a.style.filter="";a.style.opacity=""}};OpenLayers.Util.createDiv=function(a,b,c,d,e,f,g,h){var i=document.createElement("div");if(d){i.style.backgroundImage="url("+d+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!e){e="absolute"}OpenLayers.Util.modifyDOMElement(i,a,b,c,e,f,g,h);return i};OpenLayers.Util.createImage=function(a,b,c,d,e,f,g,h){var i=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!e){e="relative"}OpenLayers.Util.modifyDOMElement(i,a,b,c,e,f,null,g);if(h){i.style.display="none";OpenLayers.Event.observe(i,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,i));OpenLayers.Event.observe(i,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,i))}i.style.alt=a;i.galleryImg="no";if(d){i.src=d}return i};OpenLayers.Util.setOpacity=function(a,b){OpenLayers.Util.modifyDOMElement(a,null,null,null,null,null,null,b)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||this.map&&this.viewRequestID==this.map.viewRequestID){this.style.display=""}OpenLayers.Element.removeClass(this,"olImageLoadError")};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 a=this.urls;if(a&&a instanceof Array&&a.length>1){var b=this.src.toString();var c,d;for(d=0;c=a[d];d++){if(b.indexOf(c)!=-1){break}}var e=Math.floor(a.length*Math.random());var f=a[e];d=0;while(f==c&&d++<4){e=Math.floor(a.length*Math.random());f=a[e]}this.src=b.replace(c,f)}else{this.src=this.src}}else{OpenLayers.Element.addClass(this,"olImageLoadError")}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var a=navigator.appVersion.split("MSIE");var b=parseFloat(a[1]);var c=false;try{c=!!document.body.filters}catch(d){}OpenLayers.Util.alphaHackNeeded=c&&b>=5.5&&b<7}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(a,b,c,d,e,f,g,h,i){OpenLayers.Util.modifyDOMElement(a,b,c,d,f,null,null,i);var j=a.childNodes[0];if(e){j.src=e}OpenLayers.Util.modifyDOMElement(j,a.id+"_innerImage",null,d,"relative",g);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(h==null){h="scale"}a.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+j.src+"', "+"sizingMethod='"+h+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}j.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(a,b,c,d,e,f,g,h,i){var j=OpenLayers.Util.createDiv();var k=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);j.appendChild(k);if(i){k.style.display="none";OpenLayers.Event.observe(k,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,j));OpenLayers.Event.observe(k,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,j))}OpenLayers.Util.modifyAlphaImageDiv(j,a,b,c,d,e,f,g,h);return j};OpenLayers.Util.upperCaseObject=function(a){var b={};for(var c in a){b[c.toUpperCase()]=a[c]}return b};OpenLayers.Util.applyDefaults=function(a,b){a=a||{};var c=typeof window.Event=="function"&&b instanceof window.Event;for(var d in b){if(a[d]===undefined||!c&&b.hasOwnProperty&&b.hasOwnProperty(d)&&!a.hasOwnProperty(d)){a[d]=b[d]}}if(!c&&b&&b.hasOwnProperty&&b.hasOwnProperty("toString")&&!a.hasOwnProperty("toString")){a.toString=b.toString}return a};OpenLayers.Util.getParameterString=function(a){var b=[];for(var c in a){var d=a[c];if(d!=null&&typeof d!="function"){var e;if(typeof d=="object"&&d.constructor==Array){var f=[];var g;for(var h=0,i=d.length;h<i;h++){g=d[h];f.push(encodeURIComponent(g===null||g===undefined?"":g))}e=f.join(",")}else{e=encodeURIComponent(d)}b.push(encodeURIComponent(c)+"="+e)}}return b.join("&")};OpenLayers.Util.urlAppend=function(a,b){var c=a;if(b){var d=(a+" ").split(/[?&]/);c+=d.pop()===" "?b:d.length?"&"+b:"?"+b}return c};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+"img/"};OpenLayers.Util.Try=function(){var a=null;for(var b=0,c=arguments.length;b<c;b++){var d=arguments[b];try{a=d();break}catch(e){}}return a};OpenLayers.Util.getNodes=function(a,b){var c=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(a.documentElement.childNodes,b)},function(){return OpenLayers.Util._getNodes(a.childNodes,b)});return c};OpenLayers.Util._getNodes=function(a,b){var c=[];for(var d=0,e=a.length;d<e;d++){if(a[d].nodeName==b){c.push(a[d])}}return c};OpenLayers.Util.getTagText=function(a,b,c){var d=OpenLayers.Util.getNodes(a,b);if(d&&d.length>0){if(!c){c=0}if(d[c].childNodes.length>1){return d.childNodes[1].nodeValue}else if(d[c].childNodes.length==1){return d[c].firstChild.nodeValue}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(a){var b=null;OpenLayers.Util.Try(function(){b=a.text;if(!b){b=a.textContent}if(!b){b=a.firstChild.nodeValue}},function(){b=a.textContent});return b};OpenLayers.Util.mouseLeft=function(a,b){var c=a.relatedTarget?a.relatedTarget:a.toElement;while(c!=b&&c!=null){c=c.parentNode}return c!=b};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(a,b){if(b==null){b=OpenLayers.Util.DEFAULT_PRECISION}var a;if(b==0){a=parseFloat(a)}else{a=parseFloat(parseFloat(a).toPrecision(b))}return a};OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.distVincenty=function(a,b){var c=6378137,d=6356752.3142,e=1/298.257223563;var f=OpenLayers.Util.rad(b.lon-a.lon);var g=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(a.lat)));var h=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(b.lat)));var i=Math.sin(g),j=Math.cos(g);var k=Math.sin(h),l=Math.cos(h);var m=f,n=2*Math.PI;var o=20;while(Math.abs(m-n)>1e-12&&--o>0){var p=Math.sin(m),q=Math.cos(m);var r=Math.sqrt(l*p*l*p+(j*k-i*l*q)*(j*k-i*l*q));if(r==0){return 0}var s=i*k+j*l*q;var t=Math.atan2(r,s);var u=Math.asin(j*l*p/r);var v=Math.cos(u)*Math.cos(u);var w=s-2*i*k/v;var x=e/16*v*(4+e*(4-3*v));n=m;m=f+(1-x)*e*Math.sin(u)*(t+x*r*(w+x*s*(-1+2*w*w)))}if(o==0){return NaN}var y=v*(c*c-d*d)/(d*d);var z=1+y/16384*(4096+y*(-768+y*(320-175*y)));var A=y/1024*(256+y*(-128+y*(74-47*y)));var B=A*r*(w+A/4*(s*(-1+2*w*w)-A/6*w*(-3+4*r*r)*(-3+4*w*w)));var C=d*z*(t-B);var D=C.toFixed(3)/1e3;return D};OpenLayers.Util.getParameters=function(a){a=a||window.location.href;var b="";if(OpenLayers.String.contains(a,"?")){var c=a.indexOf("?")+1;var d=OpenLayers.String.contains(a,"#")?a.indexOf("#"):a.length;b=a.substring(c,d)}var e={};var f=b.split(/[&;]/);for(var g=0,h=f.length;g<h;++g){var i=f[g].split("=");if(i[0]){var j=decodeURIComponent(i[0]);var k=i[1]||"";k=decodeURIComponent(k.replace(/\+/g," ")).split(",");if(k.length==1){k=k[0]}e[j]=k}}return e};OpenLayers.Util.getArgs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(a)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(a){if(a==null){a="id_"}OpenLayers.Util.lastSeqID+=1;return a+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=.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:.0254/OpenLayers.METERS_PER_INCH,MicroInch:254e-7/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:.01/OpenLayers.METERS_PER_INCH,Kilometer:1e3/OpenLayers.METERS_PER_INCH,Yard:.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:.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:.1/OpenLayers.METERS_PER_INCH,Millimeter:.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:.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:.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:.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:.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":5e4/OpenLayers.METERS_PER_INCH,"150kilometers":15e4/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT["Meter"]/1e3,cm:OpenLayers.INCHES_PER_UNIT["Meter"]/100,dm:OpenLayers.INCHES_PER_UNIT["Meter"]*100,km:OpenLayers.INCHES_PER_UNIT["Meter"]*1e3,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(a){var b=a>1?1/a:a;return b};OpenLayers.Util.getResolutionFromScale=function(a,b){var c;if(a){if(b==null){b="degrees"}var d=OpenLayers.Util.normalizeScale(a);c=1/(d*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH)}return c};OpenLayers.Util.getScaleFromResolution=function(a,b){if(b==null){b="degrees"}var c=a*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH;return c};OpenLayers.Util.safeStopPropagation=function(a){OpenLayers.Event.stop(a,true)};OpenLayers.Util.pagePosition=function(a){var b=0,c=0;var d=a;var e=a;while(d){if(d==document.body){if(OpenLayers.Element.getStyle(e,"position")=="absolute"){break}}b+=d.offsetTop||0;c+=d.offsetLeft||0;e=d;try{d=d.offsetParent}catch(f){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:d.id}));break}}d=a;while(d){b-=d.scrollTop||0;c-=d.scrollLeft||0;d=d.parentNode}return[c,b]};OpenLayers.Util.isEquivalentUrl=function(a,b,c){c=c||{};OpenLayers.Util.applyDefaults(c,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var d=OpenLayers.Util.createUrlObject(a,c);var e=OpenLayers.Util.createUrlObject(b,c);for(var f in d){if(f!=="args"){if(d[f]!=e[f]){return false}}}for(var f in d.args){if(d.args[f]!=e.args[f]){return false}delete e.args[f]}for(var f in e.args){return false}return true};OpenLayers.Util.createUrlObject=function(a,b){b=b||{};if(!/^\w+:\/\//.test(a)){var c=window.location;var d=c.port?":"+c.port:"";var e=c.protocol+"//"+c.host.split(":").shift()+d;if(a.indexOf("/")===0){a=e+a}else{var f=c.pathname.split("/");f.pop();a=e+f.join("/")+"/"+a}}if(b.ignoreCase){a=a.toLowerCase()}var g=document.createElement("a");g.href=a;var h={};h.host=g.host.split(":").shift();h.protocol=g.protocol;if(b.ignorePort80){h.port=g.port=="80"||g.port=="0"?"":g.port}else{h.port=g.port==""||g.port=="0"?"80":g.port}h.hash=b.ignoreHash||g.hash==="#"?"":g.hash;var i=g.search;if(!i){var j=a.indexOf("?");i=j!=-1?a.substr(j):""}h.args=OpenLayers.Util.getParameters(i);h.pathname=g.pathname.charAt(0)=="/"?g.pathname:"/"+g.pathname;return h};OpenLayers.Util.removeTail=function(a){var b=null;var c=a.indexOf("?");var d=a.indexOf("#");if(c==-1){b=d!=-1?a.substr(0,d):a}else{b=d!=-1?a.substr(0,Math.min(c,d)):a.substr(0,c)}return b};OpenLayers.Util.getBrowserName=function(){var a="";var b=navigator.userAgent.toLowerCase();if(b.indexOf("opera")!=-1){a="opera"}else if(b.indexOf("msie")!=-1){a="msie"}else if(b.indexOf("safari")!=-1){a="safari"}else if(b.indexOf("mozilla")!=-1){if(b.indexOf("firefox")!=-1){a="firefox"}else{a="mozilla"}}return a};OpenLayers.Util.getRenderedDimensions=function(a,b,c){var d,e;var f=document.createElement("div");f.style.visibility="hidden";var g=c&&c.containerElement?c.containerElement:document.body;if(b){if(b.w){d=b.w;f.style.width=d+"px"}else if(b.h){e=b.h;f.style.height=e+"px"}}if(c&&c.displayClass){f.className=c.displayClass}var h=document.createElement("div");h.innerHTML=a;h.style.overflow="visible";if(h.childNodes){for(var i=0,j=h.childNodes.length;i<j;i++){if(!h.childNodes[i].style)continue;h.childNodes[i].style.overflow="visible"}}f.appendChild(h);g.appendChild(f);var k=false;var l=f.parentNode;while(l&&l.tagName.toLowerCase()!="body"){var m=OpenLayers.Element.getStyle(l,"position");if(m=="absolute"){k=true;break}else if(m&&m!="static"){break}l=l.parentNode}if(!k){f.style.position="absolute"}if(!d){d=parseInt(h.scrollWidth);f.style.width=d+"px"}if(!e){e=parseInt(h.scrollHeight)}f.removeChild(h);g.removeChild(f);return new OpenLayers.Size(d,e)};OpenLayers.Util.getScrollbarWidth=function(){var a=OpenLayers.Util._scrollbarWidth;if(a==null){var b=null;var c=null;var d=0;var e=0;b=document.createElement("div");b.style.position="absolute";b.style.top="-1000px";b.style.left="-1000px";b.style.width="100px";b.style.height="50px";b.style.overflow="hidden";c=document.createElement("div");c.style.width="100%";c.style.height="200px";b.appendChild(c);document.body.appendChild(b);d=c.offsetWidth;b.style.overflow="scroll";e=c.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=d-e;a=OpenLayers.Util._scrollbarWidth}return a};OpenLayers.Util.getFormattedLonLat=function(a,b,c){if(!c){c="dms"}var d=Math.abs(a);var e=Math.floor(d);var f=(d-e)/(1/60);var g=f;f=Math.floor(f);var h=(g-f)/(1/60);h=Math.round(h*10);h/=10;if(e<10){e="0"+e}var i=e+" ";if(c.indexOf("dm")>=0){if(f<10){f="0"+f}i+=f+"'";if(c.indexOf("dms")>=0){if(h<10){h="0"+h}i+=h+'"'}}if(b=="lon"){i+=a<0?OpenLayers.i18n("W"):OpenLayers.i18n("E")}else{i+=a<0?OpenLayers.i18n("S"):OpenLayers.i18n("N")}return i};OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(a,b){this.container=OpenLayers.Util.getElement(a)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(a,b){this.extent=a.clone();if(b){this.resolution=null}},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(a,b){if(b==null){b=a.style}if(a.geometry){var c=a.geometry.getBounds();if(c){if(!c.intersectsBounds(this.extent)){b={display:"none"}}var d=this.drawGeometry(a.geometry,b,a.id);if(b.display!="none"&&b.label&&d!==false){var e=a.geometry.getCentroid();if(b.labelXOffset||b.labelYOffset){xOffset=isNaN(b.labelXOffset)?0:b.labelXOffset;yOffset=isNaN(b.labelYOffset)?0:b.labelYOffset;var f=this.getResolution();e.move(xOffset*f,yOffset*f)}this.drawText(a.id,b,e)}else{this.removeText(a.id)}return d}}},drawGeometry:function(a,b,c){},drawText:function(a,b,c){},removeText:function(a){},clear:function(){},getFeatureIdFromEvent:function(a){},eraseFeatures:function(a){if(!(a instanceof Array)){a=[a]}for(var b=0,c=a.length;b<c;++b){this.eraseGeometry(a[b].geometry);this.removeText(a[b].id)}},eraseGeometry:function(a){},moveRoot:function(a){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(a,b,c){OpenLayers.Util.extend(this,c);this.control=a;this.callbacks=b;if(a.map){this.setMap(a.map)}OpenLayers.Util.extend(this,c);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){if(this.keyMask==null){return true}var b=(a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT:0);return b==this.keyMask},activate:function(){if(this.active){return false}var a=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,c=a.length;b<c;b++){if(this[a[b]]){this.register(a[b],this[a[b]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var a=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,c=a.length;b<c;b++){if(this[a[b]]){this.unregister(a[b],this[a[b]])}}this.active=false;return true},callback:function(a,b){if(a&&this.callbacks[a]){this.callbacks[a].apply(this.control,b)}},register:function(a,b){this.map.events.registerPriority(a,this,b);this.map.events.registerPriority(a,this,this.setEvent)},unregister:function(a,b){this.map.events.unregister(a,this,b);this.map.events.unregister(a,this,this.setEvent)},setEvent:function(a){this.evt=a;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.Rico=new Object;OpenLayers.Rico.Corner={round:function(a,b){a=OpenLayers.Util.getElement(a);this._setOptions(b);var c=this.options.color;if(this.options.color=="fromElement"){c=this._background(a)}var d=this.options.bgColor;if(this.options.bgColor=="fromParent"){d=this._background(a.offsetParent)}this._roundCornersImpl(a,c,d)},changeColor:function(a,b){a.style.backgroundColor=b;var c=a.parentNode.getElementsByTagName("span");for(var d=0;d<c.length;d++){c[d].style.backgroundColor=b}},changeOpacity:function(a,b){var c=b;var d="alpha(opacity="+b*100+")";a.style.opacity=c;a.style.filter=d;var e=a.parentNode.getElementsByTagName("span");for(var f=0;f<e.length;f++){e[f].style.opacity=c;e[f].style.filter=d}},reRound:function(a,b){var c=a.parentNode.childNodes[0];var d=a.parentNode.childNodes[2];a.parentNode.removeChild(c);a.parentNode.removeChild(d);this.round(a.parentNode,b)},_roundCornersImpl:function(a,b,c){if(this.options.border){this._renderBorder(a,c)}if(this._isTopRounded()){this._roundTopCorners(a,b,c)}if(this._isBottomRounded()){this._roundBottomCorners(a,b,c)}},_renderBorder:function(a,b){var c="1px solid "+this._borderColor(b);var d="border-left: "+c;var e="border-right: "+c;var f="style='"+d+";"+e+"'";a.innerHTML="<div "+f+">"+a.innerHTML+"</div>"},_roundTopCorners:function(a,b,c){var d=this._createCorner(c);for(var e=0;e<this.options.numSlices;e++){d.appendChild(this._createCornerSlice(b,c,e,"top"))}a.style.paddingTop=0;a.insertBefore(d,a.firstChild)},_roundBottomCorners:function(a,b,c){var d=this._createCorner(c);for(var e=this.options.numSlices-1;e>=0;e--){d.appendChild(this._createCornerSlice(b,c,e,"bottom"))}a.style.paddingBottom=0;a.appendChild(d)},_createCorner:function(a){var b=document.createElement("div");b.style.backgroundColor=this._isTransparent()?"transparent":a;return b},_createCornerSlice:function(a,b,c,d){var e=document.createElement("span");var f=e.style;f.backgroundColor=a;f.display="block";f.height="1px";f.overflow="hidden";f.fontSize="1px";var g=this._borderColor(a,b);if(this.options.border&&c==0){f.borderTopStyle="solid";f.borderTopWidth="1px";f.borderLeftWidth="0px";f.borderRightWidth="0px";f.borderBottomWidth="0px";f.height="0px";f.borderColor=g}else if(g){f.borderColor=g;f.borderStyle="solid";f.borderWidth="0px 1px"}if(!this.options.compact&&c==this.options.numSlices-1){f.height="2px"}this._setMargin(e,c,d);this._setBorder(e,c,d);return e},_setOptions:function(a){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,a||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else if(this.options.corners.indexOf("tr")>=0){return"right"}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else if(this.options.corners.indexOf("br")>=0){return"right"}return""},_borderColor:function(a,b){if(a=="transparent"){return b}else if(this.options.border){return this.options.border}else if(this.options.blend){return this._blend(b,a)}else{return""}},_setMargin:function(a,b,c){var d=this._marginSize(b);var e=c=="top"?this._whichSideTop():this._whichSideBottom();if(e=="left"){a.style.marginLeft=d+"px";a.style.marginRight="0px"}else if(e=="right"){a.style.marginRight=d+"px";a.style.marginLeft="0px"}else{a.style.marginLeft=d+"px";a.style.marginRight=d+"px"}},_setBorder:function(a,b,c){var d=this._borderSize(b);var e=c=="top"?this._whichSideTop():this._whichSideBottom();if(e=="left"){a.style.borderLeftWidth=d+"px";a.style.borderRightWidth="0px"}else if(e=="right"){a.style.borderRightWidth=d+"px";a.style.borderLeftWidth="0px"}else{a.style.borderLeftWidth=d+"px";a.style.borderRightWidth=d+"px"}if(this.options.border!=false){a.style.borderLeftWidth=d+"px";a.style.borderRightWidth=d+"px"}},_marginSize:function(a){if(this._isTransparent()){return 0}var b=[5,3,2,1];var c=[3,2,1,0];var d=[2,1];var e=[1,0];if(this.options.compact&&this.options.blend){return e[a]}else if(this.options.compact){return d[a]}else if(this.options.blend){return c[a]}else{return b[a]}},_borderSize:function(a){var b=[5,3,2,1];var c=[2,1,1,1];var d=[1,0];var e=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else if(this.options.compact){return d[a]}else if(this.options.blend){return c[a]}else if(this.options.border){return e[a]}else if(this._isTransparent()){return b[a]}return 0},_hasString:function(a){for(var b=1;b<arguments.length;b++)if(a.indexOf(arguments[b])>=0){return true}return false},_blend:function(a,b){var c=OpenLayers.Rico.Color.createFromHex(a);c.blend(OpenLayers.Rico.Color.createFromHex(b));return c},_background:function(a){try{return OpenLayers.Rico.Color.createColorFromBackground(a).asHex()}catch(b){return"#ffffff"}},_isTransparent:function(){return this.options.color=="transparent"},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(a){return a.childNodes.length==1&&a.childNodes[0].nodeType==3}};OpenLayers.Element={visible:function(a){return OpenLayers.Util.getElement(a).style.display!="none"},toggle:function(){for(var a=0,b=arguments.length;a<b;a++){var c=OpenLayers.Util.getElement(arguments[a]);var d=OpenLayers.Element.visible(c)?"hide":"show";OpenLayers.Element[d](c)}},hide:function(){for(var a=0,b=arguments.length;a<b;a++){var c=OpenLayers.Util.getElement(arguments[a]);c.style.display="none"}},show:function(){for(var a=0,b=arguments.length;a<b;a++){var c=OpenLayers.Util.getElement(arguments[a]);c.style.display=""}},remove:function(a){a=OpenLayers.Util.getElement(a);a.parentNode.removeChild(a)},getHeight:function(a){a=OpenLayers.Util.getElement(a);return a.offsetHeight},getDimensions:function(a){a=OpenLayers.Util.getElement(a);if(OpenLayers.Element.getStyle(a,"display")!="none"){return{width:a.offsetWidth,height:a.offsetHeight}}var b=a.style;var c=b.visibility;var d=b.position;var e=b.display;b.visibility="hidden";b.position="absolute";b.display="";var f=a.clientWidth;var g=a.clientHeight;b.display=e;b.position=d;b.visibility=c;return{width:f,height:g}},hasClass:function(a,b){var c=a.className;return!!c&&(new RegExp("(^|\\s)"+b+"(\\s|$)")).test(c)},addClass:function(a,b){if(!OpenLayers.Element.hasClass(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClass:function(a,b){var c=a.className;if(c){a.className=OpenLayers.String.trim(c.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," "))}return a},toggleClass:function(a,b){if(OpenLayers.Element.hasClass(a,b)){OpenLayers.Element.removeClass(a,b)}else{OpenLayers.Element.addClass(a,b)}return a},getStyle:function(a,b){a=OpenLayers.Util.getElement(a);var c=null;if(a&&a.style){c=a.style[OpenLayers.String.camelize(b)];if(!c){if(document.defaultView&&document.defaultView.getComputedStyle){var d=document.defaultView.getComputedStyle(a,null);c=d?d.getPropertyValue(b):null}else if(a.currentStyle){c=a.currentStyle[OpenLayers.String.camelize(b)]}}var e=["left","top","right","bottom"];if(window.opera&&OpenLayers.Util.indexOf(e,b)!=-1&&OpenLayers.Element.getStyle(a,"position")=="static"){c="auto"}}return c=="auto"?null:c}};OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(a,b){this.w=parseFloat(a);this.h=parseFloat(b)},toString:function(){return"w="+this.w+",h="+this.h},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(a){var b=false;if(a!=null){b=this.w==a.w&&this.h==a.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(a.w)&&isNaN(a.h)}return b},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(a){alert(a)},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 a=document.getElementsByTagName("script");for(var b=0,c=a.length;b<c;++b){if(a[b].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(a,b,c,d){this.url=a;this.size=b?b:new OpenLayers.Size(20,20);this.offset=c?c:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=d;var e=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(e)},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(a){if(a!=null){this.size=a}this.draw()},setUrl:function(a){if(a!=null){this.url=a}this.draw()},draw:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(a);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,a)},moveTo:function(a){if(a!=null){this.px=a}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var b=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,b)}}},display:function(a){this.imageDiv.style.display=a?"":"none"},isDrawn:function(){var a=this.imageDiv&&this.imageDiv.parentNode&&this.imageDiv.parentNode.nodeType!=11;return a},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",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(a,b,c,d,e,f){if(a==null){a=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=a;this.lonlat=b;this.contentSize=c!=null?c:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(d!=null){this.contentHTML=d}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 g=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(g,null,null,null,"relative",null,"hidden");var a=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(a,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(e){this.addCloseBox(f)}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(a){if(a==null){if(this.lonlat!=null&&this.map!=null){a=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 b=a.getPropertyValue("overflow");if(b!="hidden"){this.contentDiv._oldOverflow=b;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(a);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 a=this.map.getLayerPxFromLonLat(this.lonlat);if(a){this.moveTo(a)}}},moveTo:function(a){if(a!=null&&this.div!=null){this.div.style.left=a.x+"px";this.div.style.top=a.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(a){this.size=a.clone();var b=this.getContentDivPadding();var c=b.left+b.right;var d=b.top+b.bottom;this.fixPadding();c+=this.padding.left+this.padding.right;d+=this.padding.top+this.padding.bottom;if(this.closeDiv){var e=parseInt(this.closeDiv.style.width);c+=e+b.right}this.size.w+=c;this.size.h+=d;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=b.left+b.right;this.contentSize.h+=b.bottom+b.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=a.w+"px";this.contentDiv.style.height=a.h+"px"}},updateSize:function(){var a="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var b=this.map?this.map.layerContainerDiv:document.body;var c=OpenLayers.Util.getRenderedDimensions(a,null,{displayClass:this.displayClass,containerElement:b});var d=this.getSafeContentSize(c);var e=null;if(d.equals(c)){e=c}else{var f=new OpenLayers.Size;f.w=d.w<c.w?d.w:null;f.h=d.h<c.h?d.h:null;if(f.w&&f.h){e=d}else{var g=OpenLayers.Util.getRenderedDimensions(a,f,{displayClass:this.contentDisplayClass,containerElement:b});var h=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if(h!="hidden"&&g.equals(d)){var i=OpenLayers.Util.getScrollbarWidth();if(f.w){g.h+=i}else{g.w+=i}}e=this.getSafeContentSize(g)}}this.setSize(e)},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(a){if(a!=undefined){this.opacity=a}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(a){if(a!=undefined){this.border=a}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(a){if(a!=null){this.contentHTML=a}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 a=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var b=this.contentDiv.getElementsByTagName("img");for(var c=0,d=b.length;c<d;c++){var e=b[c];if(e.width==0||e.height==0){var f={popup:this,img:e};e._onImgLoad=OpenLayers.Function.bind(a,f);OpenLayers.Event.observe(e,"load",e._onImgLoad)}}},getSafeContentSize:function(a){var b=a.clone();var c=this.getContentDivPadding();var d=c.left+c.right;var e=c.top+c.bottom;this.fixPadding();d+=this.padding.left+this.padding.right;e+=this.padding.top+this.padding.bottom;if(this.closeDiv){var f=parseInt(this.closeDiv.style.width);d+=f+c.right}if(this.minSize){b.w=Math.max(b.w,this.minSize.w-d);b.h=Math.max(b.h,this.minSize.h-e)}if(this.maxSize){b.w=Math.min(b.w,this.maxSize.w-d);b.h=Math.min(b.h,this.maxSize.h-e)}if(this.map&&this.map.size){var g=0,h=0;if(this.keepInMap&&!this.panMapIfOutOfView){var i=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":g=i.x;h=this.map.size.h-i.y;break;case"tl":g=this.map.size.w-i.x;h=this.map.size.h-i.y;break;case"bl":g=this.map.size.w-i.x;h=i.y;break;case"br":g=i.x;h=i.y;break;default:g=i.x;h=this.map.size.h-i.y;break}}var j=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-e-h;var k=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-d-g;b.w=Math.min(b.w,k);b.h=Math.min(b.h,j)}return b},getContentDivPadding:function(){var a=this._contentDivPadding;if(!a){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}a=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=a;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return a},addCloseBox:function(a){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var b=this.getContentDivPadding();this.closeDiv.style.right=b.right+"px";this.closeDiv.style.top=b.top+"px";this.groupDiv.appendChild(this.closeDiv);var c=a||function(a){this.hide();OpenLayers.Event.stop(a)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(c,this))},panIntoView:function(){var a=this.map.getSize();var b=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var c=b.clone();if(b.x<this.map.paddingForPopups.left){c.x=this.map.paddingForPopups.left}else if(b.x+this.size.w>a.w-this.map.paddingForPopups.right){c.x=a.w-this.map.paddingForPopups.right-this.size.w}if(b.y<this.map.paddingForPopups.top){c.y=this.map.paddingForPopups.top}else if(b.y+this.size.h>a.h-this.map.paddingForPopups.bottom){c.y=a.h-this.map.paddingForPopups.bottom-this.size.h}var d=b.x-c.x;var e=b.y-c.y;this.map.pan(d,e)},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(a){this.mousedown=true;OpenLayers.Event.stop(a,true)},onmousemove:function(a){if(this.mousedown){OpenLayers.Event.stop(a,true)}},onmouseup:function(a){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(a,true)}},onclick:function(a){OpenLayers.Event.stop(a,true)},onmouseout:function(a){this.mousedown=false},ondblclick:function(a){OpenLayers.Event.stop(a,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.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(a,b,c,d){if(a!=null){this.left=OpenLayers.Util.toFloat(a)}if(b!=null){this.bottom=OpenLayers.Util.toFloat(b)}if(c!=null){this.right=OpenLayers.Util.toFloat(c)}if(d!=null){this.top=OpenLayers.Util.toFloat(d)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(a){var b=false;if(a!=null){b=this.left==a.left&&this.right==a.right&&this.top==a.top&&this.bottom==a.bottom}return b},toString:function(){return"left-bottom=("+this.left+","+this.bottom+")"+" right-top=("+this.right+","+this.top+")"},toArray:function(a){if(a===true){return[this.bottom,this.left,this.top,this.right]}else{return[this.left,this.bottom,this.right,this.top]}},toBBOX:function(a,b){if(a==null){a=6}var c=Math.pow(10,a);var d=Math.round(this.left*c)/c;var e=Math.round(this.bottom*c)/c;var f=Math.round(this.right*c)/c;var g=Math.round(this.top*c)/c;if(b===true){return e+","+d+","+g+","+f}else{return d+","+e+","+f+","+g}},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(a,b){if(b==null){b=this.getCenterLonLat()}var c,d;if(b.CLASS_NAME=="OpenLayers.LonLat"){c=b.lon;d=b.lat}else{c=b.x;d=b.y}var e=(this.left-c)*a+c;var f=(this.bottom-d)*a+d;var g=(this.right-c)*a+c;var h=(this.top-d)*a+d;return new OpenLayers.Bounds(e,f,g,h)},add:function(a,b){if(a==null||b==null){var c=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(c);return null}return new OpenLayers.Bounds(this.left+a,this.bottom+b,this.right+a,this.top+b)},extend:function(a){var b=null;if(a){switch(a.CLASS_NAME){case"OpenLayers.LonLat":b=new OpenLayers.Bounds(a.lon,a.lat,a.lon,a.lat);break;case"OpenLayers.Geometry.Point":b=new OpenLayers.Bounds(a.x,a.y,a.x,a.y);break;case"OpenLayers.Bounds":b=a;break}if(b){this.centerLonLat=null;if(this.left==null||b.left<this.left){this.left=b.left}if(this.bottom==null||b.bottom<this.bottom){this.bottom=b.bottom}if(this.right==null||b.right>this.right){this.right=b.right}if(this.top==null||b.top>this.top){this.top=b.top}}}},containsLonLat:function(a,b){return this.contains(a.lon,a.lat,b)},containsPixel:function(a,b){return this.contains(a.x,a.y,b)},contains:function(a,b,c){if(c==null){c=true}if(a==null||b==null){return false}a=OpenLayers.Util.toFloat(a);b=OpenLayers.Util.toFloat(b);var d=false;if(c){d=a>=this.left&&a<=this.right&&b>=this.bottom&&b<=this.top}else{d=a>this.left&&a<this.right&&b>this.bottom&&b<this.top}return d},intersectsBounds:function(a,b){if(b==null){b=true}var c=false;var d=this.left==a.right||this.right==a.left||this.top==a.bottom||this.bottom==a.top;if(b||!d){var e=a.bottom>=this.bottom&&a.bottom<=this.top||this.bottom>=a.bottom&&this.bottom<=a.top;var f=a.top>=this.bottom&&a.top<=this.top||this.top>a.bottom&&this.top<a.top;var g=a.left>=this.left&&a.left<=this.right||this.left>=a.left&&this.left<=a.right;var h=a.right>=this.left&&a.right<=this.right||this.right>=a.left&&this.right<=a.right;c=(e||f)&&(g||h)}return c},containsBounds:function(a,b,c){if(b==null){b=false}if(c==null){c=true}var d=this.contains(a.left,a.bottom,c);var e=this.contains(a.right,a.bottom,c);var f=this.contains(a.left,a.top,c);var g=this.contains(a.right,a.top,c);return b?d||e||f||g:d&&e&&f&&g},determineQuadrant:function(a){var b="";var c=this.getCenterLonLat();b+=a.lat<c.lat?"b":"t";b+=a.lon<c.lon?"l":"r";return b},transform:function(a,b){this.centerLonLat=null;var c=OpenLayers.Projection.transform({x:this.left,y:this.bottom},a,b);var d=OpenLayers.Projection.transform({x:this.right,y:this.bottom},a,b);var e=OpenLayers.Projection.transform({x:this.left,y:this.top},a,b);var f=OpenLayers.Projection.transform({x:this.right,y:this.top},a,b);this.left=Math.min(c.x,e.x);this.bottom=Math.min(c.y,d.y);this.right=Math.max(d.x,f.x);this.top=Math.max(e.y,f.y);return this},wrapDateLine:function(a,b){b=b||{};var c=b.leftTolerance||0;var d=b.rightTolerance||0;var e=this.clone();if(a){while(e.left<a.left&&e.right-d<=a.left){e=e.add(a.getWidth(),0)}while(e.left+c>=a.right&&e.right>a.right){e=e.add(-a.getWidth(),0)}}return e},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(a){var b=a.split(",");return OpenLayers.Bounds.fromArray(b)};OpenLayers.Bounds.fromArray=function(a){return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]))};OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b="";b+=a.charAt(0)=="t"?"b":"t";b+=a.charAt(1)=="l"?"r":"l";return b};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(a,b){this.lon=OpenLayers.Util.toFloat(a);this.lat=OpenLayers.Util.toFloat(b)},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(a,b){if(a==null||b==null){var c=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(c);return null}return new OpenLayers.LonLat(this.lon+a,this.lat+b)},equals:function(a){var b=false;if(a!=null){b=this.lon==a.lon&&this.lat==a.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(a.lon)&&isNaN(a.lat)}return b},transform:function(a,b){var c=OpenLayers.Projection.transform({x:this.lon,y:this.lat},a,b);this.lon=c.x;this.lat=c.y;return this},wrapDateLine:function(a){var b=this.clone();if(a){while(b.lon<a.left){b.lon+=a.getWidth()}while(b.lon>a.right){b.lon-=a.getWidth()}}return b},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(a){var b=a.split(",");return new OpenLayers.LonLat(parseFloat(b[0]),parseFloat(b[1]))};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return"x="+this.x+",y="+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=false;if(a!=null){b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)}return b},add:function(a,b){if(a==null||b==null){var c=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(c);return null}return new OpenLayers.Pixel(this.x+a,this.y+b)},offset:function(a){var b=this.clone();if(a){b=this.add(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",autoActivate:false,active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(a){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,a);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 a in this.handlers){if(this.handlers.hasOwnProperty(a)&&typeof this.handlers[a].destroy=="function"){this.handlers[a].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(a){this.map=a;if(this.handler){this.handler.setMap(a)}},draw:function(a){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=OpenLayers.Function.False}if(this.title!=""){this.div.title=this.title}}if(a!=null){this.position=a.clone()}this.moveTo(this.position);return this.div},moveTo:function(a){if(a!=null&&this.div!=null){this.div.style.left=a.x+"px";this.div.style.top=a.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(a){var b;if(!a){a=OpenLayers.Util.getBrowserName()=="msie"?navigator.userLanguage:navigator.language}var c=a.split("-");c[0]=c[0].toLowerCase();if(typeof OpenLayers.Lang[c[0]]=="object"){b=c[0]}if(c[1]){var d=c[0]+"-"+c[1].toUpperCase();if(typeof OpenLayers.Lang[d]=="object"){b=d}}if(!b){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+c.join("-")+" dictionary, falling back to default language");b=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=b},translate:function(a,b){var c=OpenLayers.Lang[OpenLayers.Lang.getCode()];var d=c[a];if(!d){d=a}if(b){d=OpenLayers.String.format(d,b)}return d}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(a,b,c,d,e,f,g){var h=[a,b,c,d,f,g];OpenLayers.Popup.prototype.initialize.apply(this,h);this.anchor=e!=null?e:{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(a){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(a);var c=this.calculateNewPx(a);var d=new Array(c);OpenLayers.Popup.prototype.moveTo.apply(this,d);if(this.relativePosition!=b){this.updateRelativePosition()}},setSize:function(a){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if(this.lonlat&&this.map){var b=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(b)}},calculateRelativePosition:function(a){var b=this.map.getLonLatFromLayerPx(a);var c=this.map.getExtent();var d=c.determineQuadrant(b);return OpenLayers.Bounds.oppositeQuadrant(d)},updateRelativePosition:function(){},calculateNewPx:function(a){var b=a.offset(this.anchor.offset);var c=this.size||this.contentSize;var d=this.relativePosition.charAt(0)=="t";b.y+=d?-c.h:this.anchor.size.h;var e=this.relativePosition.charAt(1)=="l";b.x+=e?-c.w:this.anchor.size.w;return b},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,geometryMap:null,initialize:function(a){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(a){this.eraseFeatures(this.features[this.geometryMap[a.id]][0])},supported:function(){var a=document.createElement("canvas");return!!a.getContext},setExtent:function(a){this.extent=a.clone();this.resolution=null;this.redraw()},setSize:function(a){this.size=a.clone();this.root.style.width=a.w+"px";this.root.style.height=a.h+"px";this.root.width=a.w;this.root.height=a.h;this.resolution=null},drawFeature:function(a,b){if(b==null){b=a.style}b=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},b);this.features[a.id]=[a,b];if(a.geometry){this.geometryMap[a.geometry.id]=a.id}this.redraw()},drawGeometry:function(a,b){var c=a.CLASS_NAME;if(c=="OpenLayers.Geometry.Collection"||c=="OpenLayers.Geometry.MultiPoint"||c=="OpenLayers.Geometry.MultiLineString"||c=="OpenLayers.Geometry.MultiPolygon"){for(var d=0;d<a.components.length;d++){this.drawGeometry(a.components[d],b)}return}switch(a.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(a,b);break;case"OpenLayers.Geometry.LineString":this.drawLineString(a,b);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(a,b);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(a,b);break;default:break}},drawExternalGraphic:function(a,b){var c=new Image;c.src=b.externalGraphic;if(b.graphicTitle){c.title=b.graphicTitle}var d=b.graphicWidth||b.graphicHeight;var e=b.graphicHeight||b.graphicWidth;d=d?d:b.pointRadius*2;e=e?e:b.pointRadius*2;var f=b.graphicXOffset!=undefined?b.graphicXOffset:-(.5*d);var g=b.graphicYOffset!=undefined?b.graphicYOffset:-(.5*e);var h=b.graphicOpacity||b.fillOpacity;var i={img:c,x:a[0]+f,y:a[1]+g,width:d,height:e,canvas:this.canvas};c.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},i)},setCanvasStyle:function(a,b){if(a=="fill"){this.canvas.globalAlpha=b["fillOpacity"];this.canvas.fillStyle=b["fillColor"]}else if(a=="stroke"){this.canvas.globalAlpha=b["strokeOpacity"];this.canvas.strokeStyle=b["strokeColor"];this.canvas.lineWidth=b["strokeWidth"]}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}},drawPoint:function(a,b){if(b.graphic!==false){var c=this.getLocalXY(a);if(b.externalGraphic){this.drawExternalGraphic(c,b)}else{if(b.fill!==false){this.setCanvasStyle("fill",b);this.canvas.beginPath();this.canvas.arc(c[0],c[1],b.pointRadius,0,Math.PI*2,true);this.canvas.fill()}if(b.stroke!==false){this.setCanvasStyle("stroke",b);this.canvas.beginPath();this.canvas.arc(c[0],c[1],b.pointRadius,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(a,b){if(b.stroke!==false){this.setCanvasStyle("stroke",b);this.canvas.beginPath();var c=this.getLocalXY(a.components[0]);this.canvas.moveTo(c[0],c[1]);for(var d=1;d<a.components.length;d++){var e=this.getLocalXY(a.components[d]);this.canvas.lineTo(e[0],e[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(a,b){if(b.fill!==false){this.setCanvasStyle("fill",b);this.canvas.beginPath();var c=this.getLocalXY(a.components[0]);this.canvas.moveTo(c[0],c[1]);for(var d=1;d<a.components.length-1;d++){var e=this.getLocalXY(a.components[d]);this.canvas.lineTo(e[0],e[1])}this.canvas.fill()}if(b.stroke!==false){var f=this.canvas.lineWidth;this.setCanvasStyle("stroke",b);this.canvas.beginPath();var c=this.getLocalXY(a.components[0]);this.canvas.moveTo(c[0],c[1]);for(var d=1;d<a.components.length;d++){var e=this.getLocalXY(a.components[d]);this.canvas.lineTo(e[0],e[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawPolygon:function(a,b){this.drawLinearRing(a.components[0],b);for(var c=1;c<a.components.length;c++){this.drawLinearRing(a.components[c],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(a,b){b=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},b);var c=this.getLocalXY(a);this.setCanvasStyle("reset");this.canvas.fillStyle=b.fontColor;this.canvas.globalAlpha=b.fontOpacity||1;var d=b.fontWeight+" "+b.fontSize+" "+b.fontFamily;if(this.canvas.fillText){var e=OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[0]]||"center";this.canvas.font=d;this.canvas.textAlign=e;this.canvas.fillText(b.label,c[0],c[1])}else if(this.canvas.mozDrawText){this.canvas.mozTextStyle=d;var f=this.canvas.mozMeasureText(b.label);switch(b.labelAlign[0]){case"l":break;case"r":c[0]-=f;break;case"c":default:c[0]-=f/2}this.canvas.translate(c[0],c[1]);this.canvas.mozDrawText(b.label);this.canvas.translate(-1*c[0],-1*c[1])}this.setCanvasStyle("reset")},getLocalXY:function(a){var b=this.getResolution();var c=this.extent;var d=a.x/b+ -c.left/b;var e=c.top/b-a.y/b;return[d,e]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(a){var b=this.map.getLonLatFromPixel(a.xy);var c=this.getResolution();var d=new OpenLayers.Bounds(b.lon-c*5,b.lat-c*5,b.lon+c*5,b.lat+c*5);var e=d.toGeometry();for(var f in this.features){if(!this.features.hasOwnProperty(f)){continue}if(this.features[f][0].geometry.intersects(e)){return f}}return null},eraseFeatures:function(a){if(!(a instanceof Array)){a=[a]}for(var b=0;b<a.length;++b){delete this.features[a[b].id]}this.redraw()},redraw:function(){if(!this.locked){this.clear();var a=[];var b,c;for(var d in this.features){if(!this.features.hasOwnProperty(d)){continue}b=this.features[d][0];c=this.features[d][1];if(!b.geometry){continue}this.drawGeometry(b.geometry,c);if(c.label){a.push([b,c])}}var e;for(var f=0;len=a.length,f<len;++f){e=a[f];this.drawText(e[0].geometry.getCentroid(),e[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(a){this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(a){if(this.exists(a)){this.remove(a)}var b=a.id;this.determineZIndex(a);var c=-1;var d=this.order.length;var e;while(d-c>1){e=parseInt((c+d)/2);var f=this.compare(this,a,OpenLayers.Util.getElement(this.order[e]));if(f>0){c=e}else{d=e}}this.order.splice(d,0,b);this.indices[b]=this.getZIndex(a);return this.getNextElement(d)},remove:function(a){var b=a.id;var c=OpenLayers.Util.indexOf(this.order,b);if(c>=0){this.order.splice(c,1);delete this.indices[b];if(this.order.length>0){var d=this.order[this.order.length-1];this.maxZIndex=this.indices[d]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return this.indices[a.id]!=null},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;if(b==null){b=this.maxZIndex;a._style.graphicZIndex=b}else if(b>this.maxZIndex){this.maxZIndex=b}},getNextElement:function(a){var b=a+1;if(b<this.order.length){var c=OpenLayers.Util.getElement(this.order[b]);if(c==undefined){c=this.getNextElement(b)}return c}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(a,b,c){var d=a.getZIndex(b);var e=0;if(c){var f=a.getZIndex(c);e=d-f}return e},Z_ORDER_DRAWING_ORDER:function(a,b,c){var d=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);if(c&&d==0){d=1}return d},Z_ORDER_Y_ORDER:function(a,b,c){var d=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);if(c&&d===0){var e=c._boundsBottom-b._boundsBottom;d=e===0?1:e}return d}};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(a,b){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(b&&(b.zIndexing||b.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(b.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(a,b){},drawGeometry:function(a,b,c){var d=a.CLASS_NAME;var e=true;if(d=="OpenLayers.Geometry.Collection"||d=="OpenLayers.Geometry.MultiPoint"||d=="OpenLayers.Geometry.MultiLineString"||d=="OpenLayers.Geometry.MultiPolygon"){for(var f=0,g=a.components.length;f<g;f++){e=this.drawGeometry(a.components[f],b,c)&&e}return e}e=false;if(b.display!="none"){if(b.backgroundGraphic){this.redrawBackgroundNode(a.id,a,b,c)}e=this.redrawNode(a.id,a,b,c)}if(e==false){var h=document.getElementById(a.id);if(h){if(h._style.backgroundGraphic){h.parentNode.removeChild(document.getElementById(a.id+this.BACKGROUND_ID_SUFFIX))}h.parentNode.removeChild(h)}}return e},redrawNode:function(a,b,c,d){var e=this.nodeFactory(a,this.getNodeType(b,c));e._featureId=d;e._boundsBottom=b.getBounds().bottom;e._geometryClass=b.CLASS_NAME;e._style=c;var f=this.drawGeometryNode(e,b,c);if(f===false){return false}e=f.node;if(this.indexer){var g=this.indexer.insert(e);if(g){this.vectorRoot.insertBefore(e,g)}else{this.vectorRoot.appendChild(e)}}else{if(e.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(e)}}this.postDraw(e);return f.complete},redrawBackgroundNode:function(a,b,c,d){var e=OpenLayers.Util.extend({},c);e.externalGraphic=e.backgroundGraphic;e.graphicXOffset=e.backgroundXOffset;e.graphicYOffset=e.backgroundYOffset;e.graphicZIndex=e.backgroundGraphicZIndex;e.graphicWidth=e.backgroundWidth||e.graphicWidth;e.graphicHeight=e.backgroundHeight||e.graphicHeight;e.backgroundGraphic=null;e.backgroundXOffset=null;e.backgroundYOffset=null;e.backgroundGraphicZIndex=null;return this.redrawNode(a+this.BACKGROUND_ID_SUFFIX,b,e,null)},drawGeometryNode:function(a,b,c){c=c||a._style;OpenLayers.Util.applyDefaults(c,this.minimumSymbolizer);var d={isFilled:c.fill===undefined?true:c.fill,isStroked:c.stroke===undefined?!!c.strokeWidth:c.stroke};var e;switch(b.CLASS_NAME){case"OpenLayers.Geometry.Point":if(c.graphic===false){d.isFilled=false;d.isStroked=false}e=this.drawPoint(a,b);break;case"OpenLayers.Geometry.LineString":d.isFilled=false;e=this.drawLineString(a,b);break;case"OpenLayers.Geometry.LinearRing":e=this.drawLinearRing(a,b);break;case"OpenLayers.Geometry.Polygon":e=this.drawPolygon(a,b);break;case"OpenLayers.Geometry.Surface":e=this.drawSurface(a,b);break;case"OpenLayers.Geometry.Rectangle":e=this.drawRectangle(a,b);break;default:break}a._options=d;if(e!=false){return{node:this.setStyle(a,c,d,b),complete:e}}else{return false}},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},drawSurface:function(a,b){},removeText:function(a){var b=document.getElementById(a+this.LABEL_ID_SUFFIX);if(b){this.textRoot.removeChild(b)}},getFeatureIdFromEvent:function(a){var b=a.target;var c=b&&b.correspondingUseElement;var d=c?c:b||a.srcElement;var e=d._featureId;return e},eraseGeometry:function(a){if(a.CLASS_NAME=="OpenLayers.Geometry.MultiPoint"||a.CLASS_NAME=="OpenLayers.Geometry.MultiLineString"||a.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon"||a.CLASS_NAME=="OpenLayers.Geometry.Collection"){for(var b=0,c=a.components.length;b<c;b++){this.eraseGeometry(a.components[b])}}else{var d=OpenLayers.Util.getElement(a.id);if(d&&d.parentNode){if(d.geometry){d.geometry.destroy();d.geometry=null}d.parentNode.removeChild(d);if(this.indexer){this.indexer.remove(d)}if(d._style.backgroundGraphic){var e=a.id+this.BACKGROUND_ID_SUFFIX;var f=OpenLayers.Util.getElement(e);if(f&&f.parentNode){f.parentNode.removeChild(f)}}}}},nodeFactory:function(a,b){var c=OpenLayers.Util.getElement(a);if(c){if(!this.nodeTypeCompare(c,b)){c.parentNode.removeChild(c);c=this.nodeFactory(a,b)}}else{c=this.createNode(b,a)}return c},nodeTypeCompare:function(a,b){},createNode:function(a,b){},moveRoot:function(a){var b=this.root;if(a.root.parentNode==this.rendererRoot){b=a.root}b.parentNode.removeChild(b);a.rendererRoot.appendChild(b)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(a){return a!="circle"&&!!a},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(a){this.easing=a?a:OpenLayers.Easing.Expo.easeOut},start:function(a,b,c,d){this.playing=true;this.begin=a;this.finish=b;this.duration=c;this.callbacks=d.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 a={};for(var b in this.begin){var c=this.begin[b];var d=this.finish[b];if(c==null||d==null||isNaN(c)||isNaN(d)){OpenLayers.Console.error("invalid value for Tween")}var e=d-c;a[b]=this.easing.apply(this,[this.time,c,e,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,a)}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(a,b,c,d){return c*a/d+b},easeOut:function(a,b,c,d){return c*a/d+b},easeInOut:function(a,b,c,d){return c*a/d+b},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(a,b,c,d){return a==0?b:c*Math.pow(2,10*(a/d-1))+b},easeOut:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},easeInOut:function(a,b,c,d){if(a==0)return b;if(a==d)return b+c;if((a/=d/2)<1)return c/2*Math.pow(2,10*(a-1))+b;return c/2*(-Math.pow(2,-10*--a)+2)+b},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(a,b,c,d){return c*(a/=d)*a+b},easeOut:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOut:function(a,b,c,d){if((a/=d/2)<1)return c/2*a*a+b;return-c/2*(--a*(a-2)-1)+b},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var b=0,c=this.map.controls.length;b<c;b++){var d=this.map.controls[b];if(d!=this&&d.CLASS_NAME=="OpenLayers.Control.ArgParser"){if(d.displayProjection!=this.displayProjection){this.displayProjection=d.displayProjection}break}}if(b==this.map.controls.length){var e=OpenLayers.Util.getParameters();if(e.layers){this.layers=e.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(e.lat&&e.lon){this.center=new OpenLayers.LonLat(parseFloat(e.lon),parseFloat(e.lat));if(e.zoom){this.zoom=parseInt(e.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var a=0,b=this.layers.length;a<b;a++){var c=this.map.layers[a];var d=this.layers.charAt(a);if(d=="B"){this.map.setBaseLayer(c)}else if(d=="T"||d=="F"){c.setVisibility(d=="T")}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this});this.updateAttribution();return this.div},updateAttribution:function(){var a=[];if(this.map&&this.map.layers){for(var b=0,c=this.map.layers.length;b<c;b++){var d=this.map.layers[b];if(d.attribution&&d.getVisibility()){if(OpenLayers.Util.indexOf(a,d.attribution)===-1){a.push(d.attribution)}}}this.div.innerHTML=a.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{roundedCorner:true,roundedCornerColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[]},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Event.stopObservingElement(this.minimizeDiv);OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.clearLayersArray("base");this.clearLayersArray("data");this.map.events.un({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl()}this.redraw();return this.div},clearLayersArray:function(a){var b=this[a+"Layers"];if(b){for(var c=0,d=b.length;c<d;c++){var e=b[c];OpenLayers.Event.stopObservingElement(e.inputElem);OpenLayers.Event.stopObservingElement(e.labelSpan)}}this[a+"LayersDiv"].innerHTML="";this[a+"Layers"]=[]},checkRedraw:function(){var a=false;if(!this.layerStates.length||this.map.layers.length!=this.layerStates.length){a=true}else{for(var b=0,c=this.layerStates.length;b<c;b++){var d=this.layerStates[b];var e=this.map.layers[b];if(d.name!=e.name||d.inRange!=e.inRange||d.id!=e.id||d.visibility!=e.visibility){a=true;break}}}return a},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var a=false;var b=false;var c=this.map.layers.length;this.layerStates=new Array(c);for(var d=0;d<c;d++){var e=this.map.layers[d];this.layerStates[d]={name:e.name,visibility:e.visibility,inRange:e.inRange,id:e.id}}var f=this.map.layers.slice();if(!this.ascending){f.reverse()}for(var d=0,c=f.length;d<c;d++){var e=f[d];var g=e.isBaseLayer;if(e.displayInLayerSwitcher){if(g){b=true}else{a=true}var h=g?e==this.map.baseLayer:e.getVisibility();var i=document.createElement("input");i.id=this.id+"_input_"+e.name;i.name=g?this.id+"_baseLayers":e.name;i.type=g?"radio":"checkbox";i.value=e.name;i.checked=h;i.defaultChecked=h;if(!g&&!e.inRange){i.disabled=true}var j={inputElem:i,layer:e,layerSwitcher:this};OpenLayers.Event.observe(i,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,j));var k=document.createElement("span");OpenLayers.Element.addClass(k,"labelSpan");if(!g&&!e.inRange){k.style.color="gray"}k.innerHTML=e.name;k.style.verticalAlign=g?"bottom":"baseline";OpenLayers.Event.observe(k,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,j));var l=document.createElement("br");var m=g?this.baseLayers:this.dataLayers;m.push({layer:e,inputElem:i,labelSpan:k});var n=g?this.baseLayersDiv:this.dataLayersDiv;n.appendChild(i);n.appendChild(k);n.appendChild(l)}}this.dataLbl.style.display=a?"":"none";this.baseLbl.style.display=b?"":"none";return this.div},onInputClick:function(a){if(!this.inputElem.disabled){if(this.inputElem.type=="radio"){this.inputElem.checked=true;this.layer.map.setBaseLayer(this.layer)}else{this.inputElem.checked=!this.inputElem.checked;this.layerSwitcher.updateMap()}}OpenLayers.Event.stop(a)},onLayerClick:function(a){this.updateMap()},updateMap:function(){for(var a=0,b=this.baseLayers.length;a<b;a++){var c=this.baseLayers[a];if(c.inputElem.checked){this.map.setBaseLayer(c.layer,false)}}for(var a=0,b=this.dataLayers.length;a<b;a++){var c=this.dataLayers[a];c.layer.setVisibility(c.inputElem.checked)}},maximizeControl:function(a){this.div.style.width="";this.div.style.height="";this.showControls(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.div.style.width="0px";this.div.style.height="0px";this.showControls(true);if(a!=null){OpenLayers.Event.stop(a)}},showControls:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":"";this.layersDiv.style.display=a?"none":""},loadContents:function(){OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);this.layersDiv=document.createElement("div");this.layersDiv.id=this.id+"_layersDiv";OpenLayers.Element.addClass(this.layersDiv,"layersDiv");this.baseLbl=document.createElement("div");this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");OpenLayers.Element.addClass(this.baseLbl,"baseLbl");this.baseLayersDiv=document.createElement("div");OpenLayers.Element.addClass(this.baseLayersDiv,"baseLayersDiv");this.dataLbl=document.createElement("div");this.dataLbl.innerHTML=OpenLayers.i18n("overlays");OpenLayers.Element.addClass(this.dataLbl,"dataLbl");this.dataLayersDiv=document.createElement("div");OpenLayers.Element.addClass(this.dataLayersDiv,"dataLayersDiv");if(this.ascending){this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv);this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv)}else{this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv);this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv)}this.div.appendChild(this.layersDiv);if(this.roundedCorner){OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.roundedCornerColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,.75)}var a=OpenLayers.Util.getImagesLocation();var b=new OpenLayers.Size(18,18);var c=a+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,b,c,"absolute");OpenLayers.Element.addClass(this.maximizeDiv,"maximizeDiv");this.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var c=a+"layer-switcher-minimize.png";var b=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,b,c,"absolute");OpenLayers.Element.addClass(this.minimizeDiv,"minimizeDiv");this.minimizeDiv.style.display="none";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv)},ignoreEvent:function(a){OpenLayers.Event.stop(a)},mouseDown:function(a){this.isMouseDown=true;this.ignoreEvent(a)},mouseUp:function(a){if(this.isMouseDown){this.isMouseDown=false;this.ignoreEvent(a)}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(a){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(a){OpenLayers.Control.prototype.draw.apply(this,arguments);a=this.position;this.buttons=[];var b=new OpenLayers.Size(18,18);var c=new OpenLayers.Pixel(a.x+b.w/2,a.y);this._addButton("panup","north-mini.png",c,b);a.y=c.y+b.h;this._addButton("panleft","west-mini.png",a,b);this._addButton("panright","east-mini.png",a.add(b.w,0),b);this._addButton("pandown","south-mini.png",c.add(0,b.h*2),b);this._addButton("zoomin","zoom-plus-mini.png",c.add(0,b.h*3+5),b);this._addButton("zoomworld","zoom-world-mini.png",c.add(0,b.h*4+5),b);this._addButton("zoomout","zoom-minus-mini.png",c.add(0,b.h*5+5),b);return this.div},_addButton:function(a,b,c,d){var e=OpenLayers.Util.getImagesLocation()+b;var f=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,c,d,e,"absolute");this.div.appendChild(f);OpenLayers.Event.observe(f,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,f));OpenLayers.Event.observe(f,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,f));OpenLayers.Event.observe(f,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,f));f.action=a;f.map=this.map;if(!this.slideRatio){var g=this.slideFactor;var h=function(){return g}}else{var i=this.slideRatio;var h=function(a){return this.map.getSize()[a]*i}}f.getSlideFactor=h;this.buttons.push(f);return f},_removeButton:function(a){OpenLayers.Event.stopObservingElement(a);a.map=null;a.getSlideFactor=null;this.div.removeChild(a);OpenLayers.Util.removeItem(this.buttons,a)},removeButtons:function(){for(var a=this.buttons.length-1;a>=0;--a){this._removeButton(this.buttons[a])}},doubleClick:function(a){OpenLayers.Event.stop(a);return false},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){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(a)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:false,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var a=this.topInUnits.length;this.div.appendChild(this.eTop);if(this.topOutUnits==""||this.topInUnits==""){this.eTop.style.visibility="hidden"}else{this.eTop.style.visibility="visible"}this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+"Bottom";this.div.appendChild(this.eBottom);if(this.bottomOutUnits==""||this.bottomInUnits==""){this.eBottom.style.visibility="hidden"}else{this.eBottom.style.visibility="visible"}}this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(a){var b=parseInt(Math.log(a)/Math.log(10));var c=Math.pow(10,b);var d=parseInt(a/c);var e;if(d>5){e=5}else if(d>2){e=2}else{e=1}return e*c},update:function(){var a=this.map.getResolution();if(!a){return}var b=this.map.getUnits();var c=OpenLayers.INCHES_PER_UNIT;var d=this.maxWidth*a*c[b];var e=1;if(this.geodesic===true){var f=this.getGeodesicLength(this.maxWidth);var g=d/c["km"];e=f/g;d*=e}var h;var i;if(d>1e5){h=this.topOutUnits;i=this.bottomOutUnits}else{h=this.topInUnits;i=this.bottomInUnits}var j=d/c[h];var k=d/c[i];var l=this.getBarLen(j);var m=this.getBarLen(k);j=l/c[b]*c[h];k=m/c[b]*c[i];var n=j/a/e;var o=k/a/e;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(o)+"px";this.eBottom.innerHTML=m+" "+i}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(n)+"px";this.eTop.innerHTML=l+" "+h}},getGeodesicLength:function(a){var b=this.map;var c=b.getPixelFromLonLat(b.getCenter());var d=b.getLonLatFromPixel(c.add(0,-a/2));var e=b.getLonLatFromPixel(c.add(0,a/2));var f=b.getProjectionObject();var g=new OpenLayers.Projection("EPSG:4326");if(!f.equals(g)){d.transform(f,g);e.transform(f,g)}return OpenLayers.Util.distVincenty(d,e)},CLASS_NAME:"OpenLayers.Control.ScaleLine"});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(a){return a.target||a.srcElement},isLeftClick:function(a){return a.which&&a.which==1||a.button&&a.button==1},isRightClick:function(a){return a.which&&a.which==3||a.button&&a.button==2},stop:function(a,b){if(!b){if(a.preventDefault){a.preventDefault()}else{a.returnValue=false}}if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}},findElement:function(a,b){var c=OpenLayers.Event.element(a);while(c.parentNode&&(!c.tagName||c.tagName.toUpperCase()!=b.toUpperCase())){c=c.parentNode}return c},observe:function(a,b,c,d){var e=OpenLayers.Util.getElement(a);d=d||false;if(b=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||e.attachEvent)){b="keydown"}if(!this.observers){this.observers={}}if(!e._eventCacheID){var f="eventCacheID_";if(e.id){f=e.id+"_"+f}e._eventCacheID=OpenLayers.Util.createUniqueID(f)}var g=e._eventCacheID;if(!this.observers[g]){this.observers[g]=[]}this.observers[g].push({element:e,name:b,observer:c,useCapture:d});if(e.addEventListener){e.addEventListener(b,c,d)}else if(e.attachEvent){e.attachEvent("on"+b,c)}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var c=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[c])},_removeElementObservers:function(a){if(a){for(var b=a.length-1;b>=0;b--){var c=a[b];var d=new Array(c.element,c.name,c.observer,c.useCapture);var e=OpenLayers.Event.stopObserving.apply(this,d)}}},stopObserving:function(a,b,c,d){d=d||false;var e=OpenLayers.Util.getElement(a);var f=e._eventCacheID;if(b=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||e.detachEvent){b="keydown"}}var g=false;var h=OpenLayers.Event.observers[f];if(h){var i=0;while(!g&&i<h.length){var j=h[i];if(j.name==b&&j.observer==c&&j.useCapture==d){h.splice(i,1);if(h.length==0){delete OpenLayers.Event.observers[f]}g=true;break}i++}}if(g){if(e.removeEventListener){e.removeEventListener(b,c,d)}else if(e&&e.detachEvent){e.detachEvent("on"+b,c)}}return g},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers){var b=OpenLayers.Event.observers[a];OpenLayers.Event._removeElementObservers.apply(this,[b])}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(a,b,c,d,e){OpenLayers.Util.extend(this,e);this.object=a;this.fallThrough=d;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(c!=null){for(var f=0,g=c.length;f<g;f++){this.addEventType(c[f])}}if(b!=null){this.attachToElement(b)}},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(a){if(!this.listeners[a]){this.eventTypes.push(a);this.listeners[a]=[]}},attachToElement:function(a){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=a;for(var b=0,c=this.BROWSER_EVENTS.length;b<c;b++){var d=this.BROWSER_EVENTS[b];this.addEventType(d);OpenLayers.Event.observe(a,d,this.eventHandler)}OpenLayers.Event.observe(a,"dragstart",OpenLayers.Event.stop)},on:function(a){for(var b in a){if(b!="scope"){this.register(b,a.scope,a[b])}}},register:function(a,b,c){if(c!=null&&OpenLayers.Util.indexOf(this.eventTypes,a)!=-1){if(b==null){b=this.object}var d=this.listeners[a];d.push({obj:b,func:c})}},registerPriority:function(a,b,c){if(c!=null){if(b==null){b=this.object}var d=this.listeners[a];if(d!=null){d.unshift({obj:b,func:c})}}},un:function(a){for(var b in a){if(b!="scope"){this.unregister(b,a.scope,a[b])}}},unregister:function(a,b,c){if(b==null){b=this.object}var d=this.listeners[a];if(d!=null){for(var e=0,f=d.length;e<f;e++){if(d[e].obj==b&&d[e].func==c){d.splice(e,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(a,b){var c=this.listeners[a];if(!c||c.length==0){return}if(b==null){b={}}b.object=this.object;b.element=this.element;if(!b.type){b.type=a}var c=c.slice(),d;for(var e=0,f=c.length;e<f;e++){var g=c[e];d=g.func.apply(g.obj,[b]);if(d!=undefined&&d==false){break}}if(!this.fallThrough){OpenLayers.Event.stop(b,true)}return d},handleBrowserEvent:function(a){if(this.includeXY){a.xy=this.getMousePosition(a)}this.triggerEvent(a.type,a)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(a){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(a.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],a.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(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(a){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(a){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 the"+"past. 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}",W:"W",E:"E",N:"N",S:"S",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(a,b,c,d,e,f,g){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(a){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(a){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,a);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(a){this.border=0},setRicoCorners:function(){var a=this.getCornersToRound(this.relativePosition);var b={corners:a,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,b);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,b);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var a=["tl","tr","bl","br"];var b=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(a,b);return a.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(a,b){OpenLayers.Util.extend(this,b);this.projCode=a;if(window.Proj4js){this.proj=new Proj4js.Proj(a)}},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(a){if(a&&a.getCode){return this.getCode()==a.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(a,b,c){if(!OpenLayers.Projection.transforms[a]){OpenLayers.Projection.transforms[a]={}}OpenLayers.Projection.transforms[a][b]=c};OpenLayers.Projection.transform=function(a,b,c){if(b.proj&&c.proj){a=Proj4js.transform(b.proj,c.proj,a)}else if(b&&c&&OpenLayers.Projection.transforms[b.getCode()]&&OpenLayers.Projection.transforms[b.getCode()][c.getCode()]){OpenLayers.Projection.transforms[b.getCode()][c.getCode()](a)}return a};OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15e3,translationParameters:null,symbolMetrics:null,isGecko:null,supportUse:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.supportUse=navigator.userAgent.toLowerCase().indexOf("applewebkit/5")==-1;this.isGecko=navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1;this.symbolMetrics={}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var a="http://www.w3.org/TR/SVG11/feature#";return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(a+"SVG","1.1")||document.implementation.hasFeature(a+"BasicStructure","1.1"))},inValidRange:function(a,b,c){var d=a+(c?0:this.translationParameters.x);var e=b+(c?0:this.translationParameters.y);return d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL&&e>=-this.MAX_PIXEL&&e<=this.MAX_PIXEL},setExtent:function(a,b){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var c=this.getResolution();var d=-a.left/c;var e=a.top/c;if(b){this.left=d;this.top=e;var f="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",f);this.translate(0,0);return true}else{var g=this.translate(d-this.left,e-this.top);if(!g){this.setExtent(a,true)}return g}},translate:function(a,b){if(!this.inValidRange(a,b,true)){return false}else{var c="";if(a||b){c="translate("+a+","+b+")"}this.root.setAttributeNS(null,"transform",c);this.translationParameters={x:a,y:b};return true}},setSize:function(a){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(a,b){var c=null;switch(a.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){c="image"}else if(this.isComplexSymbol(b.graphicName)){c=this.supportUse===false?"svg":"use"}else{c="circle"}break;case"OpenLayers.Geometry.Rectangle":c="rect";break;case"OpenLayers.Geometry.LineString":c="polyline";break;case"OpenLayers.Geometry.LinearRing":c="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":c="path";break;default:break}return c},setStyle:function(a,b,c){b=b||a._style;c=c||a._options;var d=parseFloat(a.getAttributeNS(null,"r"));var e=1;var f;if(a._geometryClass=="OpenLayers.Geometry.Point"&&d){a.style.visibility="";if(b.graphic===false){a.style.visibility="hidden"}else if(b.externalGraphic){f=this.getPosition(a);if(b.graphicTitle){a.setAttributeNS(null,"title",b.graphicTitle)}if(b.graphicWidth&&b.graphicHeight){a.setAttributeNS(null,"preserveAspectRatio","none")}var g=b.graphicWidth||b.graphicHeight;var h=b.graphicHeight||b.graphicWidth;g=g?g:b.pointRadius*2;h=h?h:b.pointRadius*2;var i=b.graphicXOffset!=undefined?b.graphicXOffset:-(.5*g);var j=b.graphicYOffset!=undefined?b.graphicYOffset:-(.5*h);var k=b.graphicOpacity||b.fillOpacity;a.setAttributeNS(null,"x",(f.x+i).toFixed());a.setAttributeNS(null,"y",(f.y+j).toFixed());a.setAttributeNS(null,"width",g);a.setAttributeNS(null,"height",h);a.setAttributeNS(this.xlinkns,"href",b.externalGraphic);a.setAttributeNS(null,"style","opacity: "+k)}else if(this.isComplexSymbol(b.graphicName)){var l=b.pointRadius*3;var m=l*2;var n=this.importSymbol(b.graphicName);f=this.getPosition(a);e=this.symbolMetrics[n][0]*3/m;var o=a.parentNode;var p=a.nextSibling;if(o){o.removeChild(a)}if(this.supportUse===false){var q=document.getElementById(n);a.firstChild&&a.removeChild(a.firstChild);a.appendChild(q.firstChild.cloneNode(true));a.setAttributeNS(null,"viewBox",q.getAttributeNS(null,"viewBox"))}else{a.setAttributeNS(this.xlinkns,"href","#"+n)}a.setAttributeNS(null,"width",m);a.setAttributeNS(null,"height",m);a.setAttributeNS(null,"x",f.x-l);a.setAttributeNS(null,"y",f.y-l);if(p){o.insertBefore(a,p)}else if(o){o.appendChild(a)}}else{a.setAttributeNS(null,"r",b.pointRadius)}var r=b.rotation;if((r!==undefined||a._rotation!==undefined)&&f){a._rotation=r;r|=0;if(a.nodeName!=="svg"){a.setAttributeNS(null,"transform","rotate("+r+" "+f.x+" "+f.y+")")}else{var s=this.symbolMetrics[n];a.firstChild.setAttributeNS(null,"transform","rotate("+b.rotation+" "+s[1]+" "+s[2]+")")}}}if(c.isFilled){a.setAttributeNS(null,"fill",b.fillColor);a.setAttributeNS(null,"fill-opacity",b.fillOpacity)}else{a.setAttributeNS(null,"fill","none")}if(c.isStroked){a.setAttributeNS(null,"stroke",b.strokeColor);a.setAttributeNS(null,"stroke-opacity",b.strokeOpacity);a.setAttributeNS(null,"stroke-width",b.strokeWidth*e);a.setAttributeNS(null,"stroke-linecap",b.strokeLinecap);a.setAttributeNS(null,"stroke-linejoin","round");a.setAttributeNS(null,"stroke-dasharray",this.dashStyle(b,e))}else{a.setAttributeNS(null,"stroke","none")}if(b.pointerEvents){a.setAttributeNS(null,"pointer-events",b.pointerEvents)}if(b.cursor!=null){a.setAttributeNS(null,"cursor",b.cursor)}return a},dashStyle:function(a,b){var c=a.strokeWidth*b;var d=a.strokeDashstyle;switch(d){case"solid":return"none";case"dot":return[1,4*c].join();case"dash":return[4*c,4*c].join();case"dashdot":return[4*c,4*c,1,4*c].join();case"longdash":return[8*c,4*c].join();case"longdashdot":return[8*c,4*c,1,4*c].join();default:return OpenLayers.String.trim(d).replace(/\s+/g,",")}},createNode:function(a,b){var c=document.createElementNS(this.xmlns,a);if(b){c.setAttributeNS(null,"id",b)}return c},nodeTypeCompare:function(a,b){return b==a.nodeName},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"g")},createDefs:function(){var a=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(a);return a},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(a,b,c){var d=this.getResolution();var e=b.x/d+this.left;var f=this.top-b.y/d;if(this.inValidRange(e,f)){a.setAttributeNS(null,"cx",e);a.setAttributeNS(null,"cy",f);a.setAttributeNS(null,"r",c);return a}else{return false}},drawLineString:function(a,b){var c=this.getComponentsString(b.components);if(c.path){a.setAttributeNS(null,"points",c.path);return c.complete?a:null}else{return false}},drawLinearRing:function(a,b){var c=this.getComponentsString(b.components);if(c.path){a.setAttributeNS(null,"points",c.path);return c.complete?a:null}else{return false}},drawPolygon:function(a,b){var c="";var d=true;var e=true;var f,g;for(var h=0,i=b.components.length;h<i;h++){c+=" M";f=this.getComponentsString(b.components[h].components," ");g=f.path;if(g){c+=" "+g;e=f.complete&&e}else{d=false}}c+=" z";if(d){a.setAttributeNS(null,"d",c);a.setAttributeNS(null,"fill-rule","evenodd");return e?a:null}else{return false}},drawRectangle:function(a,b){var c=this.getResolution();var d=b.x/c+this.left;var e=this.top-b.y/c;if(this.inValidRange(d,e)){a.setAttributeNS(null,"x",d);a.setAttributeNS(null,"y",e);a.setAttributeNS(null,"width",b.width/c);a.setAttributeNS(null,"height",b.height/c);return a}else{return false}},drawSurface:function(a,b){var c=null;var d=true;for(var e=0,f=b.components.length;e<f;e++){if(e%3==0&&e/3==0){var g=this.getShortString(b.components[e]);if(!g){d=false}c="M "+g}else if(e%3==1){var g=this.getShortString(b.components[e]);if(!g){d=false}c+=" C "+g}else{var g=this.getShortString(b.components[e]);if(!g){d=false}c+=" "+g}}c+=" Z";if(d){a.setAttributeNS(null,"d",c);return a}else{return false}},drawText:function(a,b,c){var d=this.getResolution();var e=c.x/d+this.left;var f=c.y/d-this.top;var g=this.nodeFactory(a+this.LABEL_ID_SUFFIX,"text");var h=this.nodeFactory(a+this.LABEL_ID_SUFFIX+"_tspan","tspan");g.setAttributeNS(null,"x",e);g.setAttributeNS(null,"y",-f);if(b.fontColor){g.setAttributeNS(null,"fill",b.fontColor)}if(b.fontOpacity){g.setAttributeNS(null,"opacity",b.fontOpacity)}if(b.fontFamily){g.setAttributeNS(null,"font-family",b.fontFamily)}if(b.fontSize){g.setAttributeNS(null,"font-size",b.fontSize)}if(b.fontWeight){g.setAttributeNS(null,"font-weight",b.fontWeight)}if(b.labelSelect===true){g.setAttributeNS(null,"pointer-events","visible");g._featureId=a;h._featureId=a;h._geometry=c;h._geometryClass=c.CLASS_NAME}else{g.setAttributeNS(null,"pointer-events","none")}var i=b.labelAlign||"cm";g.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[i[0]]||"middle");if(this.isGecko){g.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[i[1]]||"central")}else{h.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[i[1]]||"-35%")}h.textContent=b.label;if(!g.parentNode){g.appendChild(h);this.textRoot.appendChild(g)}},getComponentsString:function(a,b){var c=[];var d=true;var e=a.length;var f=[];var g,h,i;for(var j=0;j<e;j++){h=a[j];c.push(h);g=this.getShortString(h);if(g){f.push(g)}else{if(j>0){if(this.getShortString(a[j-1])){f.push(this.clipLine(a[j],a[j-1]))}}if(j<e-1){if(this.getShortString(a[j+1])){f.push(this.clipLine(a[j],a[j+1]))}}d=false}}return{path:f.join(b||","),complete:d}},clipLine:function(a,b){if(b.equals(a)){return""}var c=this.getResolution();var d=this.MAX_PIXEL-this.translationParameters.x;var e=this.MAX_PIXEL-this.translationParameters.y;var f=b.x/c+this.left;var g=this.top-b.y/c;var h=a.x/c+this.left;var i=this.top-a.y/c;var j;if(h<-d||h>d){j=(i-g)/(h-f);h=h<0?-d:d;i=g+(h-f)*j}if(i<-e||i>e){j=(h-f)/(i-g);i=i<0?-e:e;h=f+(i-g)*j}return h+","+i},getShortString:function(a){var b=this.getResolution();var c=a.x/b+this.left;var d=this.top-a.y/b;if(this.inValidRange(c,d)){return c+","+d}else{return false}},getPosition:function(a){return{x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))}},importSymbol:function(a){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+a;if(document.getElementById(b)!=null){return b}var c=OpenLayers.Renderer.symbol[a];if(!c){throw new Error(a+" is not a valid symbol name");return}var d=this.nodeFactory(b,"symbol");var e=this.nodeFactory(null,"polygon");d.appendChild(e);var f=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var g="";var h,i;for(var j=0;j<c.length;j=j+2){h=c[j];i=c[j+1];f.left=Math.min(f.left,h);f.bottom=Math.min(f.bottom,i);f.right=Math.max(f.right,h);f.top=Math.max(f.top,i);g+=" "+h+","+i}e.setAttributeNS(null,"points",g);var k=f.getWidth();var l=f.getHeight();var m=[f.left-k,f.bottom-l,k*3,l*3];d.setAttributeNS(null,"viewBox",m.join(" "));this.symbolMetrics[b]=[Math.max(k,l),f.getCenterLonLat().lon,f.getCenterLonLat().lat];this.defs.appendChild(d);return d.id},getFeatureIdFromEvent:function(a){var b=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments);if(this.supportUse===false&&!b){var c=a.target;b=c.parentNode&&c!=this.rendererRoot&&c.parentNode._featureId}return b},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(a){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var b=document.createStyleSheet();var c=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var d=0,e=c.length;d<e;d++){b.addRule("olv\\:"+c[d],"behavior: url(#default#VML); "+"position: absolute; display: inline-block;")}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return!!document.namespaces},setExtent:function(a,b){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var c=this.getResolution();var d=a.left/c|0;var e=a.top/c-this.size.h|0;if(b||!this.offset){this.offset={x:d,y:e};d=0;e=0}else{d=d-this.offset.x;e=e-this.offset.y}var f=d+" "+e;this.root.coordorigin=f;var g=[this.root,this.vectorRoot,this.textRoot];var h;for(var i=0,j=g.length;i<j;++i){h=g[i];var k=this.size.w+" "+this.size.h;h.coordsize=k}this.root.style.flip="y";return true},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var b=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var c=this.size.w+"px";var d=this.size.h+"px";var e;for(var f=0,g=b.length;f<g;++f){e=b[f];e.style.width=c;e.style.height=d}},getNodeType:function(a,b){var c=null;switch(a.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){c="olv:rect"}else if(this.isComplexSymbol(b.graphicName)){c="olv:shape"}else{c="olv:oval"}break;case"OpenLayers.Geometry.Rectangle":c="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":c="olv:shape";break;default:break}return c},setStyle:function(a,b,c,d){b=b||a._style;c=c||a._options;var e=1;var f=b.fillColor;if(a._geometryClass==="OpenLayers.Geometry.Point"){if(b.externalGraphic){if(b.graphicTitle){a.title=b.graphicTitle}var g=b.graphicWidth||b.graphicHeight;var h=b.graphicHeight||b.graphicWidth;g=g?g:b.pointRadius*2;h=h?h:b.pointRadius*2;var i=this.getResolution();var j=b.graphicXOffset!=undefined?b.graphicXOffset:-(.5*g);var k=b.graphicYOffset!=undefined?b.graphicYOffset:-(.5*h);a.style.left=(d.x/i-this.offset.x+j|0)+"px";a.style.top=(d.y/i-this.offset.y-(k+h)|0)+"px";a.style.width=g+"px";a.style.height=h+"px";a.style.flip="y";f="none";c.isStroked=false}else if(this.isComplexSymbol(b.graphicName)){var l=this.importSymbol(b.graphicName);a.path=l.path;a.coordorigin=l.left+","+l.bottom;var m=l.size;a.coordsize=m+","+m;this.drawCircle(a,d,b.pointRadius);a.style.flip="y"}else{this.drawCircle(a,d,b.pointRadius)}}if(c.isFilled){a.fillcolor=f}else{a.filled="false"}var n=a.getElementsByTagName("fill");var o=n.length==0?null:n[0];if(!c.isFilled){if(o){a.removeChild(o)}}else{if(!o){o=this.createNode("olv:fill",a.id+"_fill")}o.opacity=b.fillOpacity;if(a._geometryClass==="OpenLayers.Geometry.Point"&&b.externalGraphic){if(b.graphicOpacity){o.opacity=b.graphicOpacity}o.src=b.externalGraphic;o.type="frame";if(!(b.graphicWidth&&b.graphicHeight)){o.aspect="atmost"}}if(o.parentNode!=a){a.appendChild(o)}}var p=b.rotation;if(p!==a._rotation){a._rotation=p;if(b.externalGraphic){this.graphicRotate(a,j,k,b);o.opacity=0}else if(a._geometryClass==="OpenLayers.Geometry.Point"){a.style.rotation=p||0}}if(c.isStroked){a.strokecolor=b.strokeColor;a.strokeweight=b.strokeWidth+"px"}else{a.stroked=false}var q=a.getElementsByTagName("stroke");var r=q.length==0?null:q[0];if(!c.isStroked){if(r){a.removeChild(r)}}else{if(!r){r=this.createNode("olv:stroke",a.id+"_stroke");a.appendChild(r)}r.opacity=b.strokeOpacity;r.endcap=!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap;r.dashstyle=this.dashStyle(b)}if(b.cursor!="inherit"&&b.cursor!=null){a.style.cursor=b.cursor}return a},graphicRotate:function(a,b,c,d){var d=d||a._style;var e=a._options;var f=d.rotation||0;var g,h;if(!(d.graphicWidth&&d.graphicHeight)){var i=new Image;i.onreadystatechange=OpenLayers.Function.bind(function(){if(i.readyState=="complete"||i.readyState=="interactive"){g=i.width/i.height;h=Math.max(d.pointRadius*2,d.graphicWidth||0,d.graphicHeight||0);b=b*g;d.graphicWidth=h*g;d.graphicHeight=h;this.graphicRotate(a,b,c,d)}},this);i.src=d.externalGraphic;return}else{h=Math.max(d.graphicWidth,d.graphicHeight);g=d.graphicWidth/d.graphicHeight}var j=Math.round(d.graphicWidth||h*g);var k=Math.round(d.graphicHeight||h);a.style.width=j+"px";a.style.height=k+"px";var l=document.getElementById(a.id+"_image");if(!l){l=this.createNode("olv:imagedata",a.id+"_image");a.appendChild(l)}l.style.width=j+"px";l.style.height=k+"px";l.src=d.externalGraphic;l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader("+"src='', sizingMethod='scale')";var m=f*Math.PI/180;var n=Math.sin(m);var o=Math.cos(m);var p="progid:DXImageTransform.Microsoft.Matrix(M11="+o+",M12="+ -n+",M21="+n+",M22="+o+",SizingMethod='auto expand')\n";var q=d.graphicOpacity||d.fillOpacity;if(q&&q!=1){p+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+q+")\n"}a.style.filter=p;var r=new OpenLayers.Geometry.Point(-b,-c);var s=(new OpenLayers.Bounds(0,0,j,k)).toGeometry();s.rotate(d.rotation,r);var t=s.getBounds();a.style.left=Math.round(parseInt(a.style.left)+t.left)+"px";a.style.top=Math.round(parseInt(a.style.top)-t.bottom)+"px"},postDraw:function(a){a.style.visibility="visible";var b=a._style.fillColor;var c=a._style.strokeColor;if(b=="none"&&a.fillcolor!=b){a.fillcolor=b}if(c=="none"&&a.strokecolor!=c){a.strokecolor=c}},setNodeDimension:function(a,b){var c=b.getBounds();if(c){var d=this.getResolution();var e=new OpenLayers.Bounds(c.left/d-this.offset.x|0,c.bottom/d-this.offset.y|0,c.right/d-this.offset.x|0,c.top/d-this.offset.y|0);a.style.left=e.left+"px";a.style.top=e.top+"px";a.style.width=e.getWidth()+"px";a.style.height=e.getHeight()+"px";a.coordorigin=e.left+" "+e.top;a.coordsize=e.getWidth()+" "+e.getHeight()}},dashStyle:function(a){var b=a.strokeDashstyle;switch(b){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return b;default:var c=b.split(/[ ,]/);if(c.length==2){if(1*c[0]>=2*c[1]){return"longdash"}return c[0]==1||c[1]==1?"dot":"dash"}else if(c.length==4){return 1*c[0]>=2*c[1]?"longdashdot":"dashdot"}return"solid"}},createNode:function(a,b){var c=document.createElement(a);if(b){c.id=b}c.unselectable="on";c.onselectstart=OpenLayers.Function.False;return c},nodeTypeCompare:function(a,b){var c=b;var d=c.indexOf(":");if(d!=-1){c=c.substr(d+1)}var e=a.nodeName;d=e.indexOf(":");if(d!=-1){e=e.substr(d+1)}return c==e},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"olv:group")},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(a,b,c){if(!isNaN(b.x)&&!isNaN(b.y)){var d=this.getResolution();a.style.left=(b.x/d-this.offset.x|0)-c+"px";a.style.top=(b.y/d-this.offset.y|0)-c+"px";var e=c*2;a.style.width=e+"px";a.style.height=e+"px";return a}return false},drawLineString:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(a,b,c){this.setNodeDimension(a,b);var d=this.getResolution();var e=b.components.length;var f=new Array(e);var g,h,i;for(var j=0;j<e;j++){g=b.components[j];h=g.x/d-this.offset.x|0;i=g.y/d-this.offset.y|0;f[j]=" "+h+","+i+" l "}var k=c?" x e":" e";a.path="m"+f.join("")+k;return a},drawPolygon:function(a,b){this.setNodeDimension(a,b);var c=this.getResolution();var d=[];var e,f,g,h,i,j,k,l;for(g=0,h=b.components.length;g<h;g++){e=b.components[g];d.push("m");for(f=0,i=e.components.length;f<i;f++){j=e.components[f];k=j.x/c-this.offset.x|0;l=j.y/c-this.offset.y|0;d.push(" "+k+","+l);if(f==0){d.push(" l")}}d.push(" x ")}d.push("e");a.path=d.join("");return a},drawRectangle:function(a,b){var c=this.getResolution();a.style.left=(b.x/c-this.offset.x|0)+"px";a.style.top=(b.y/c-this.offset.y|0)+"px";a.style.width=(b.width/c|0)+"px";a.style.height=(b.height/c|0)+"px";return a},drawText:function(a,b,c){var d=this.nodeFactory(a+this.LABEL_ID_SUFFIX,"olv:rect");var e=this.nodeFactory(a+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var f=this.getResolution();d.style.left=(c.x/f-this.offset.x|0)+"px";d.style.top=(c.y/f-this.offset.y|0)+"px";d.style.flip="y";e.innerText=b.label;if(b.fontColor){e.style.color=b.fontColor}if(b.fontOpacity){e.style.filter="alpha(opacity="+b.fontOpacity*100+")"}if(b.fontFamily){e.style.fontFamily=b.fontFamily}if(b.fontSize){e.style.fontSize=b.fontSize}if(b.fontWeight){e.style.fontWeight=b.fontWeight}if(b.labelSelect===true){d._featureId=a;e._featureId=a;e._geometry=c;e._geometryClass=c.CLASS_NAME}e.style.whiteSpace="nowrap";e.inset="1px,0px,0px,0px";if(!d.parentNode){d.appendChild(e);this.textRoot.appendChild(d)}var g=b.labelAlign||"cm";var h=e.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[g[0]||"c"];var i=e.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[g[1]||"m"];d.style.left=parseInt(d.style.left)-h-1+"px";d.style.top=parseInt(d.style.top)+i+"px"},drawSurface:function(a,b){this.setNodeDimension(a,b);var c=this.getResolution();var d=[];var e,f,g;for(var h=0,i=b.components.length;h<i;h++){e=b.components[h];f=e.x/c-this.offset.x|0;g=e.y/c-this.offset.y|0;if(h%3==0&&h/3==0){d.push("m")}else if(h%3==1){d.push(" c")}d.push(" "+f+","+g)}d.push(" x e");a.path=d.join("");return a},moveRoot:function(a){var b=this.map.getLayer(a.container.id);if(b instanceof OpenLayers.Layer.Vector.RootContainer){b=this.map.getLayer(this.container.id)}b&&b.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);b&&b.redraw()},importSymbol:function(a){var b=this.container.id+"-"+a;var c=this.symbolCache[b];if(c){return c}var d=OpenLayers.Renderer.symbol[a];if(!d){throw new Error(a+" is not a valid symbol name");return}var e=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var f=["m"];for(var g=0;g<d.length;g=g+2){var h=d[g];var i=d[g+1];e.left=Math.min(e.left,h);e.bottom=Math.min(e.bottom,i);e.right=Math.max(e.right,h);e.top=Math.max(e.top,i);f.push(h);f.push(i);if(g==0){f.push("l")}}f.push("x e");var j=f.join(" ");var k=(e.getWidth()-e.getHeight())/2;if(k>0){e.bottom=e.bottom-k;e.top=e.top+k}else{e.left=e.left+k;e.right=e.right-k}c={path:j,size:e.getWidth(),left:e.left,bottom:e.bottom};this.symbolCache[b]=c;return c},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:.5,r:1,t:0,m:.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(a,b,c,d,e){this.layer=a;this.position=b.clone();this.bounds=c.clone();this.url=d;this.size=e.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(a){if(a==null){a=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(a,this);return a},draw:function(){var a=this.layer.maxExtent;var b=a&&this.bounds.intersectsBounds(a,false);this.shouldDraw=b||this.layer.displayOutsideMaxExtent;this.clear();return this.shouldDraw},moveTo:function(a,b,c){if(c==null){c=true}this.bounds=a.clone();this.position=b.clone();if(c){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(a){var b=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(b);var c=this.layer.map.getLonLatFromLayerPx(a);var d=a.clone();d.x+=this.size.w;d.y+=this.size.h;var e=this.layer.map.getLonLatFromLayerPx(d);if(c.lon>e.lon){if(c.lon<0){c.lon=-180-(c.lon+180)}else{e.lon=180+e.lon+180}}var f=new OpenLayers.Bounds(c.lon,e.lat,e.lon,c.lat);return f},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,forceFixedZoomLevel:false,mouseDragStart:null,zoomStart:null,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);delete this.mouseDragStart;delete this.zoomStart},setMap:function(a){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(a){OpenLayers.Control.prototype.draw.apply(this,arguments);a=this.position.clone();this.buttons=[];var b=new OpenLayers.Size(18,18);var c=new OpenLayers.Pixel(a.x+b.w/2,a.y);var d=b.w;if(this.zoomWorldIcon){c=new OpenLayers.Pixel(a.x+b.w,a.y)}this._addButton("panup","north-mini.png",c,b);a.y=c.y+b.h;this._addButton("panleft","west-mini.png",a,b);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",a.add(b.w,0),b);d*=2}this._addButton("panright","east-mini.png",a.add(d,0),b);this._addButton("pandown","south-mini.png",c.add(0,b.h*2),b);this._addButton("zoomin","zoom-plus-mini.png",c.add(0,b.h*3+5),b);c=this._addZoomBar(c.add(0,b.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",c,b);return this.div},_addZoomBar:function(a){var b=OpenLayers.Util.getImagesLocation();var c=this.id+"_"+this.map.id;var d=this.map.getNumZoomLevels()-1-this.map.getZoom();var e=OpenLayers.Util.createAlphaImageDiv(c,a.add(-1,d*this.zoomStopHeight),new OpenLayers.Size(20,9),b+"slider.png","absolute");this.slider=e;this.sliderEvents=new OpenLayers.Events(this,e,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var f=new OpenLayers.Size;f.h=this.zoomStopHeight*this.map.getNumZoomLevels();f.w=this.zoomStopWidth;var g=null;if(OpenLayers.Util.alphaHack()){var c=this.id+"_"+this.map.id;g=OpenLayers.Util.createAlphaImageDiv(c,a,new OpenLayers.Size(f.w,this.zoomStopHeight),b+"zoombar.png","absolute",null,"crop");g.style.height=f.h+"px"}else{g=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,f,b+"zoombar.png")}this.zoombarDiv=g;this.divEvents=new OpenLayers.Events(this,g,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(g);this.startTop=parseInt(g.style.top);this.div.appendChild(e);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return a},_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(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var b=a.xy.y;var c=OpenLayers.Util.pagePosition(a.object)[1];var d=(b-c)/this.zoomStopHeight;if(this.forceFixedZoomLevel||!this.map.fractionalZoom){d=Math.floor(d)}var e=this.map.getNumZoomLevels()-1-d;e=Math.min(Math.max(e,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(e);OpenLayers.Event.stop(a)},zoomBarDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(a)},zoomBarDrag:function(a){if(this.mouseDragStart!=null){var b=this.mouseDragStart.y-a.xy.y;var c=OpenLayers.Util.pagePosition(this.zoombarDiv);if(a.clientY-c[1]>0&&a.clientY-c[1]<parseInt(this.zoombarDiv.style.height)-2){var d=parseInt(this.slider.style.top)-b;this.slider.style.top=d+"px";this.mouseDragStart=a.xy.clone()}OpenLayers.Event.stop(a)}},zoomBarUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.mouseDragStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var b=this.zoomStart.y-a.xy.y;var c=this.map.zoom;if(!this.forceFixedZoomLevel&&this.map.fractionalZoom){c+=b/this.zoomStopHeight;c=Math.min(Math.max(c,0),this.map.getNumZoomLevels()-1)}else{c+=Math.round(b/this.zoomStopHeight)}this.map.zoomTo(c);this.mouseDragStart=null;this.zoomStart=null;OpenLayers.Event.stop(a)}},moveZoomBar:function(){var a=(this.map.getNumZoomLevels()-1-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=a+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,base:"",displayProjection:null,initialize:function(a,b,c){OpenLayers.Control.prototype.initialize.apply(this,[c]);this.element=OpenLayers.Util.getElement(a);this.base=b||document.location.href},destroy:function(){if(this.element.parentNode==this.div){this.div.removeChild(this.element)}this.element=null;this.map.events.unregister("moveend",this,this.updateLink);OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var b=0,c=this.map.controls.length;b<c;b++){var d=this.map.controls[b];if(d.CLASS_NAME==this.argParserClass.CLASS_NAME){if(d.displayProjection!=this.displayProjection){this.displayProjection=d.displayProjection}break}}if(b==this.map.controls.length){this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.className=this.displayClass;this.element=document.createElement("a");this.element.innerHTML=OpenLayers.i18n("permalink");this.element.href="";this.div.appendChild(this.element)}this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this});this.updateLink();return this.div},updateLink:function(){var a=this.base;if(a.indexOf("?")!=-1){a=a.substring(0,a.indexOf("?"))}a+="?"+OpenLayers.Util.getParameterString(this.createParams());this.element.href=a},createParams:function(a,b,c){a=a||this.map.getCenter();var d=OpenLayers.Util.getParameters(this.base);if(a){d.zoom=b||this.map.getZoom();var e=a.lat;var f=a.lon;if(this.displayProjection){var g=OpenLayers.Projection.transform({x:f,y:e},this.map.getProjectionObject(),this.displayProjection);f=g.x;e=g.y}d.lat=Math.round(e*1e5)/1e5;d.lon=Math.round(f*1e5)/1e5;c=c||this.map.layers;d.layers="";for(var h=0,i=c.length;h<i;h++){var j=c[h];if(j.isBaseLayer){d.layers+=j==this.map.baseLayer?"B":"0"}else{d.layers+=j.getVisibility()?"T":"F"}}}return d},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1e3},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(a,b){if(arguments.length===1&&typeof a==="object"){b=a;a=b&&b.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);this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";OpenLayers.Util.extend(this,b);this.layers=[];this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(a);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 c=this.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(c,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);c=this.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(c);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 d=true;var e=document.getElementsByTagName("link");for(var f=0,g=e.length;f<g;++f){if(OpenLayers.Util.isEquivalentUrl(e.item(f).href,this.theme)){d=false;break}}if(d){var h=document.createElement("link");h.setAttribute("rel","stylesheet");h.setAttribute("type","text/css");h.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(h)}}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 f=0,g=this.controls.length;f<g;f++){this.addControlToMap(this.controls[f])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy);if(b&&b.layers){this.addLayers(b.layers);if(b.center){this.setCenter(b.center,b.zoom)}}},render:function(a){this.div=OpenLayers.Util.getElement(a);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}if(this.panTween&&this.panTween.playing){this.panTween.stop()}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 a=this.controls.length-1;a>=0;--a){this.controls[a].destroy()}this.controls=null}if(this.layers!=null){for(var a=this.layers.length-1;a>=0;--a){this.layers[a].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(a){OpenLayers.Util.extend(this,a)},getTileSize:function(){return this.tileSize},getBy:function(a,b,c){var d=typeof c.test=="function";var e=OpenLayers.Array.filter(this[a],function(a){return a[b]==c||d&&c.test(a[b])});return e},getLayersBy:function(a,b){return this.getBy("layers",a,b)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(a,b){return this.getBy("controls",a,b)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},getLayer:function(a){var b=null;for(var c=0,d=this.layers.length;c<d;c++){var e=this.layers[c];if(e.id==a){b=e;break}}return b},setLayerZIndex:function(a,b){a.setZIndex(this.Z_INDEX_BASE[a.isBaseLayer?"BaseLayer":"Overlay"]+b*5)},resetLayersZIndex:function(){for(var a=0,b=this.layers.length;a<b;a++){var c=this.layers[a];this.setLayerZIndex(c,a)}},addLayer:function(a){for(var b=0,c=this.layers.length;b<c;b++){if(this.layers[b]==a){var d=OpenLayers.i18n("layerAlreadyAdded",{layerName:a.name});OpenLayers.Console.warn(d);return false}}if(this.allOverlays){a.isBaseLayer=false}if(this.events.triggerEvent("preaddlayer",{layer:a})===false){return}a.div.className="olLayerDiv";a.div.style.overflow="";this.setLayerZIndex(a,this.layers.length);if(a.isFixed){this.viewPortDiv.appendChild(a.div)}else{this.layerContainerDiv.appendChild(a.div)}this.layers.push(a);a.setMap(this);if(a.isBaseLayer||this.allOverlays&&!this.baseLayer){if(this.baseLayer==null){this.setBaseLayer(a)}else{a.setVisibility(false)}}else{a.redraw()}this.events.triggerEvent("addlayer",{layer:a});a.afterAdd()},addLayers:function(a){for(var b=0,c=a.length;b<c;b++){this.addLayer(a[b])}},removeLayer:function(a,b){if(b==null){b=true}if(a.isFixed){this.viewPortDiv.removeChild(a.div)}else{this.layerContainerDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.layers,a);a.removeMap(this);a.map=null;if(this.baseLayer==a){this.baseLayer=null;if(b){for(var c=0,d=this.layers.length;c<d;c++){var e=this.layers[c];if(e.isBaseLayer||this.allOverlays){this.setBaseLayer(e);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:a})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(a,b){var c=this.getLayerIndex(a);if(b<0){b=0}else if(b>this.layers.length){b=this.layers.length}if(c!=b){this.layers.splice(c,1);this.layers.splice(b,0,a);for(var d=0,e=this.layers.length;d<e;d++){this.setLayerZIndex(this.layers[d],d)}this.events.triggerEvent("changelayer",{layer:a,property:"order"});if(this.allOverlays){if(b===0){this.setBaseLayer(a)}else if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}},raiseLayer:function(a,b){var c=this.getLayerIndex(a)+b;this.setLayerIndex(a,c)},setBaseLayer:function(a){if(a!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,a)!=-1){var b=this.getCenter();var c=OpenLayers.Util.getResolutionFromScale(this.getScale(),a.units);if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=a;this.viewRequestID++;if(!this.allOverlays||this.baseLayer.visibility){this.baseLayer.setVisibility(true)}if(b!=null){var d=this.getZoomForResolution(c||this.resolution,true);this.setCenter(b,d,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(a,b){this.controls.push(a);this.addControlToMap(a,b)},addControls:function(a,b){var c=arguments.length===1?[]:b;for(var d=0,e=a.length;d<e;d++){var f=a[d];var g=c[d]?c[d]:null;this.addControl(f,g)}},addControlToMap:function(a,b){a.outsideViewport=a.div!=null;if(this.displayProjection&&!a.displayProjection){a.displayProjection=this.displayProjection}a.setMap(this);var c=a.draw(b);if(c){if(!a.outsideViewport){c.style.zIndex=this.Z_INDEX_BASE["Control"]+this.controls.length;this.viewPortDiv.appendChild(c)}}if(a.autoActivate){a.activate()}},getControl:function(a){var b=null;for(var c=0,d=this.controls.length;c<d;c++){var e=this.controls[c];if(e.id==a){b=e;break}}return b},removeControl:function(a){if(a&&a==this.getControl(a.id)){if(a.div&&a.div.parentNode==this.viewPortDiv){this.viewPortDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.controls,a)}},addPopup:function(a,b){if(b){for(var c=this.popups.length-1;c>=0;--c){this.removePopup(this.popups[c])}}a.map=this;this.popups.push(a);var d=a.draw();if(d){d.style.zIndex=this.Z_INDEX_BASE["Popup"]+this.popups.length;this.layerContainerDiv.appendChild(d)}},removePopup:function(a){OpenLayers.Util.removeItem(this.popups,a);if(a.div){try{this.layerContainerDiv.removeChild(a.div)}catch(b){}}a.map=null},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},updateSize:function(){var a=this.getCurrentSize();if(a&&!isNaN(a.h)&&!isNaN(a.w)){this.events.clearMouseCache();var b=this.getSize();if(b==null){this.size=b=a}if(!a.equals(b)){this.size=a;for(var c=0,d=this.layers.length;c<d;c++){this.layers[c].onMapResize()}var e=this.getCenter();if(this.baseLayer!=null&&e!=null){var f=this.getZoom();this.zoom=null;this.setCenter(e,f)}}}},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=this.div.offsetWidth;a.h=this.div.offsetHeight}if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=parseInt(this.div.style.width);a.h=parseInt(this.div.style.height)}return a},calculateBounds:function(a,b){var c=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if(a!=null&&b!=null){var d=this.getSize();var e=d.w*b;var f=d.h*b;c=new OpenLayers.Bounds(a.lon-e/2,a.lat-f/2,a.lon+e/2,a.lat+f/2)}return c},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getZoom:function(){return this.zoom},pan:function(a,b,c){c=OpenLayers.Util.applyDefaults(c,{animate:true,dragging:false});var d=this.getViewPortPxFromLonLat(this.getCenter());var e=d.add(a,b);if(!c.dragging||!e.equals(d)){var f=this.getLonLatFromViewPortPx(e);if(c.animate){this.panTo(f)}else{this.setCenter(f,null,c.dragging)}}},panTo:function(a){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(a)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var b=this.getCenter();if(a.lon==b.lon&&a.lat==b.lat){return}var c={lon:b.lon,lat:b.lat};var d={lon:a.lon,lat:a.lat};this.panTween.start(c,d,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(a)}},setCenter:function(a,b,c,d){this.moveTo(a,b,{dragging:c,forceZoomChange:d,caller:"setCenter"})},moveTo:function(a,b,c){if(!c){c={}}if(b!=null){b=parseFloat(b);if(!this.fractionalZoom){b=Math.round(b)}}var d=c.dragging;var e=c.forceZoomChange;var f=c.noEvent;if(this.panTween&&c.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(a)){a=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(a==null){a=this.getCenter()}if(b==null){b=this.getZoom()}var g=this.getResolutionForZoom(b);var h=this.calculateBounds(a,g);if(!this.restrictedExtent.containsBounds(h)){var i=this.restrictedExtent.getCenterLonLat();if(h.getWidth()>this.restrictedExtent.getWidth()){a=new OpenLayers.LonLat(i.lon,a.lat)}else if(h.left<this.restrictedExtent.left){a=a.add(this.restrictedExtent.left-h.left,0)}else if(h.right>this.restrictedExtent.right){a=a.add(this.restrictedExtent.right-h.right,0)}if(h.getHeight()>this.restrictedExtent.getHeight()){a=new OpenLayers.LonLat(a.lon,i.lat)}else if(h.bottom<this.restrictedExtent.bottom){a=a.add(0,this.restrictedExtent.bottom-h.bottom)}else if(h.top>this.restrictedExtent.top){a=a.add(0,this.restrictedExtent.top-h.top)}}}var j=e||this.isValidZoomLevel(b)&&b!=this.getZoom();var k=this.isValidLonLat(a)&&!a.equals(this.center);if(j||k||!d){if(!this.dragging&&!f){this.events.triggerEvent("movestart")}if(k){if(!j&&this.center){this.centerLayerContainer(a)}this.center=a.clone()}if(j||this.layerContainerOrigin==null){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(j){this.zoom=b;this.resolution=this.getResolutionForZoom(b);this.viewRequestID++}var l=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(l,j,d);if(d){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:j})}}l=this.baseLayer.getExtent();for(var m=0,n=this.layers.length;m<n;m++){var o=this.layers[m];if(o!==this.baseLayer&&!o.isBaseLayer){var p=o.calculateInRange();if(o.inRange!=p){o.inRange=p;if(!p){o.display(false)}this.events.triggerEvent("changelayer",{layer:o,property:"visibility"})}if(p&&o.visibility){o.moveTo(l,j,d);if(d){o.events.triggerEvent("move")}else{o.events.triggerEvent("moveend",{zoomChanged:j})}}}}if(j){for(var m=0,n=this.popups.length;m<n;m++){this.popups[m].updatePosition()}}this.events.triggerEvent("move");if(j){this.events.triggerEvent("zoomend")}}if(!d&&!f){this.events.triggerEvent("moveend")}this.dragging=!!d},centerLayerContainer:function(a){var b=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var c=this.getViewPortPxFromLonLat(a);if(b!=null&&c!=null){this.layerContainerDiv.style.left=Math.round(b.x-c.x)+"px";this.layerContainerDiv.style.top=Math.round(b.y-c.y)+"px"}},isValidZoomLevel:function(a){return a!=null&&a>=0&&a<this.getNumZoomLevels()},isValidLonLat:function(a){var b=false;if(a!=null){var c=this.getMaxExtent();b=c.containsLonLat(a)}return b},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode():null},getProjectionObject:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.projection}return a},getMaxResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.maxResolution}return a},getMaxExtent:function(a){var b=null;if(a&&a.restricted&&this.restrictedExtent){b=this.restrictedExtent}else if(this.baseLayer!=null){b=this.baseLayer.maxExtent}return b},getNumZoomLevels:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.numZoomLevels}return a},getExtent:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getExtent()}return a},getResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getResolution()}else if(this.allOverlays===true&&this.layers.length>0){a=this.layers[0].getResolution()}return a},getUnits:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.units}return a},getScale:function(){var a=null;if(this.baseLayer!=null){var b=this.getResolution();var c=this.baseLayer.units;a=OpenLayers.Util.getScaleFromResolution(b,c)}return a},getZoomForExtent:function(a,b){var c=null;if(this.baseLayer!=null){c=this.baseLayer.getZoomForExtent(a,b)}return c},getResolutionForZoom:function(a){var b=null;if(this.baseLayer){b=this.baseLayer.getResolutionForZoom(a)}return b},getZoomForResolution:function(a,b){var c=null;if(this.baseLayer!=null){c=this.baseLayer.getZoomForResolution(a,b)}return c},zoomTo:function(a){if(this.isValidZoomLevel(a)){this.setCenter(null,a)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(a,b){var c=a.getCenterLonLat();if(this.baseLayer.wrapDateLine){var d=this.getMaxExtent();a=a.clone();while(a.right<a.left){a.right+=d.getWidth()}c=a.getCenterLonLat().wrapDateLine(d)}this.setCenter(c,this.getZoomForExtent(a,b))},zoomToMaxExtent:function(a){var b=a?a.restricted:true;var c=this.getMaxExtent({restricted:b});this.zoomToExtent(c)},zoomToScale:function(a,b){var c=OpenLayers.Util.getResolutionFromScale(a,this.baseLayer.units);var d=this.getSize();var e=d.w*c;var f=d.h*c;var g=this.getCenter();var h=new OpenLayers.Bounds(g.lon-e/2,g.lat-f/2,g.lon+e/2,g.lat+f/2);this.zoomToExtent(h,b)},getLonLatFromViewPortPx:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getLonLatFromViewPortPx(a)}return b},getViewPortPxFromLonLat:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getViewPortPxFromLonLat(a)}return b},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(a){var b=this.getViewPortPxFromLonLat(a);b.x=Math.round(b.x);b.y=Math.round(b.y);return b},getViewPortPxFromLayerPx:function(a){var b=null;if(a!=null){var c=parseInt(this.layerContainerDiv.style.left);var d=parseInt(this.layerContainerDiv.style.top);b=a.add(c,d)}return b},getLayerPxFromViewPortPx:function(a){var b=null;if(a!=null){var c=-parseInt(this.layerContainerDiv.style.left);var d=-parseInt(this.layerContainerDiv.style.top);b=a.add(c,d);if(isNaN(b.x)||isNaN(b.y)){b=null}}return b},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(a){var b=this.getPixelFromLonLat(a);return this.getLayerPxFromViewPortPx(b)},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(a,b){this.lonlat=a;var c=b?b:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=c}else{this.icon.url=c.url;this.icon.size=c.size;this.icon.offset=c.offset;this.icon.calculateOffset=c.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(a){return this.icon.draw(a)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(a){if(a!=null&&this.icon!=null){this.icon.moveTo(a)}this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){var a=this.icon&&this.icon.isDrawn();return a},onScreen:function(){var a=false;if(this.map){var b=this.map.getExtent();a=b.containsLonLat(this.lonlat)}return a},inflate:function(a){if(this.icon){var b=new OpenLayers.Size(this.icon.size.w*a,this.icon.size.h*a);this.icon.setSize(b)}},setOpacity:function(a){this.icon.setOpacity(a)},setUrl:function(a){this.icon.setUrl(a)},display:function(a){this.icon.display(a)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var a=OpenLayers.Util.getImagesLocation()+"marker.png";var b=new OpenLayers.Size(21,25);var c=function(a){return new OpenLayers.Pixel(-(a.w/2),-a.h)};return new OpenLayers.Icon(a,b,null,c)};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(a,b,c,d,e){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=d;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])}OpenLayers.Event.stopObservingElement(this.imgDiv);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(a){if(a==null){a=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}a=OpenLayers.Tile.prototype.clone.apply(this,[a]);a.imgDiv=null;return a},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(a){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(a&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!a){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 a=this.layer.maxExtent;var b=a&&this.bounds.intersectsBounds(a,false);if(b){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.getImageSize(this.bounds)||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 a=this.layer.getImageSize(this.bounds);if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,a,this.url)}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,a);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 a=this.layer.imageOffset;var b=this.layer.getImageSize(this.bounds);if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,a,b,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,a,b,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 c=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(c,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(c,this))}var d=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){c.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(d,this))},checkImgURL:function(){if(this.layer){var a=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(a,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}var a=1;if(this.backBufferTile.resolution){a=this.backBufferTile.resolution/this.layer.getResolution()}if(a!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var b=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var c=new OpenLayers.Size(this.backBufferTile.size.w*a,this.backBufferTile.size.h*a);var d=this.layer.map.getLayerPxFromLonLat(b);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,d,c);var e=this.backBufferTile.imageSize;e=new OpenLayers.Size(e.w*a,e.h*a);var f=this.backBufferTile.imageOffset;if(f){f=new OpenLayers.Pixel(f.x*a,f.y*a)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,f,e);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=a},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.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(a,b,c){this.layer=a;this.lonlat=b;this.data=c!=null?c:{};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)}}if(this.layer!=null&&this.marker!=null){this.layer.removeMarker(this.marker)}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 a=false;if(this.layer!=null&&this.layer.map!=null){var b=this.layer.map.getExtent();a=b.containsLonLat(this.lonlat)}return a},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(a){if(this.lonlat!=null){var b=this.id+"_popup";var c=this.marker?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(b,this.lonlat,this.data.popupSize,this.data.popupContentHTML,c,a)}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(a,b,c){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(a){var b=true;if(this.checkModifiers(a)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(a)){b=this.rightclick(a)}return b},rightclick:function(a){if(this.passesTolerance(a)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[a]);return!this.stopDouble}else{var b=this["double"]?OpenLayers.Util.extend({},a):this.callback("rightclick",[a]);var c=OpenLayers.Function.bind(this.delayedRightCall,this,b);this.rightclickTimerId=window.setTimeout(c,this.delay)}}return!this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;if(a){this.callback("rightclick",[a])}return!this.stopSingle},dblclick:function(a){if(this.passesTolerance(a)){if(this["double"]){this.callback("dblclick",[a])}this.clearTimer()}return!this.stopDouble},click:function(a){if(this.passesTolerance(a)){if(this.timerId!=null){this.clearTimer()}else{var b=this.single?OpenLayers.Util.extend({},a):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,b),this.delay)}}return!this.stopSingle},passesTolerance:function(a){var b=true;if(this.pixelTolerance!=null&&this.down){var c=Math.sqrt(Math.pow(this.down.x-a.xy.x,2)+Math.pow(this.down.y-a.xy.y,2));if(c>this.pixelTolerance){b=false}}return b},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(a){this.timerId=null;if(a){this.callback("click",[a])}},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;a=true}return a},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,documentDrag:false,documentEvents:null,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(a){},move:function(a){},up:function(a){},out:function(a){},mousedown:function(a){var b=true;this.dragging=false;if(this.checkModifiers(a)&&OpenLayers.Event.isLeftClick(a)){this.started=true;this.start=a.xy;this.last=a.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(a);this.callback("down",[a.xy]);OpenLayers.Event.stop(a);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart?document.onselectstart:OpenLayers.Function.True;document.onselectstart=OpenLayers.Function.False}b=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return b},mousemove:function(a){if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)){if(this.documentDrag===true&&this.documentEvents){if(a.element===document){this.adjustXY(a);this.setEvent(a)}else{this.destroyDocumentEvents()}}if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(a);this.callback("move",[a.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=OpenLayers.Function.False}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(a){if(this.started){if(this.documentDrag===true&&this.documentEvents){this.adjustXY(a);this.destroyDocumentEvents()}var b=this.start!=this.last;this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(a);this.callback("up",[a.xy]);if(b){this.callback("done",[a.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(a){if(this.started&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.documentDrag===true){this.documentEvents=new OpenLayers.Events(this,document,null,null,{includeXY:true});this.documentEvents.on({mousemove:this.mousemove,mouseup:this.mouseup});OpenLayers.Element.addClass(document.body,"olDragDown")}else{var b=this.start!=this.last;this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(a);this.callback("out",[]);if(b){this.callback("done",[a.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}}return true},click:function(a){return this.start==this.last},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;a=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return a},adjustXY:function(a){var b=OpenLayers.Util.pagePosition(this.map.div);a.xy.x-=b[0];a.xy.y-=b[1]},destroyDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown");this.documentEvents.destroy();this.documentEvents=null},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(a,b,c,d){OpenLayers.Handler.prototype.initialize.apply(this,[a,c,d]);this.layer=b},mousedown:function(a){this.down=a.xy;return this.handle(a)?!this.stopDown:true},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:true},click:function(a){return this.handle(a)?!this.stopClick:true},mousemove:function(a){if(!this.callbacks["over"]&&!this.callbacks["out"]){return true}this.handle(a);return true},dblclick:function(a){return!this.handle(a)},geometryTypeMatches:function(a){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1},handle:function(a){if(this.feature&&!this.feature.layer){this.feature=null}var b=a.type;var c=false;var d=!!this.feature;var e=b=="click"||b=="dblclick";this.feature=this.layer.getFeatureFromEvent(a);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var f=this.feature!=this.lastFeature;if(this.geometryTypeMatches(this.feature)){if(d&&f){if(this.lastFeature){this.triggerCallback(b,"out",[this.lastFeature])}this.triggerCallback(b,"in",[this.feature])}else if(!d||e){this.triggerCallback(b,"in",[this.feature])}this.lastFeature=this.feature;c=true}else{if(this.lastFeature&&(d&&f||e)){this.triggerCallback(b,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(d||e)){this.triggerCallback(b,"out",[this.lastFeature])}}return c},triggerCallback:function(a,b,c){var d=this.EVENTMAP[a][b];if(d){if(a=="click"&&this.up&&this.down){var e=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(e<=this.clickTolerance){this.callback(d,c)}}else{this.callback(d,c)}}},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},deactivate:function(){var a=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});a=true}return a},handleMapEvents:function(a){if(!a.property||a.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var a=Math.max(this.map.Z_INDEX_BASE["Feature"]-1,this.layer.getZIndex())+1;this.layer.setZIndex(a)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;if(a>=this.map.Z_INDEX_BASE["Feature"]){this.layer.setZIndex(a)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,interval:0,delta:0,cumulative:true,initialize:function(a,b,c){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(a){if(!this.map||!this.checkModifiers(a)){return}var b=false;var c=false;var d=false;var e=OpenLayers.Event.element(a);while(e!=null&&!d&&!b){if(!b){try{if(e.currentStyle){g=e.currentStyle["overflow"]}else{var f=document.defaultView.getComputedStyle(e,null);var g=f.getPropertyValue("overflow")}b=g&&g=="auto"||g=="scroll"}catch(h){}}if(!c){for(var i=0,j=this.map.layers.length;i<j;i++){if(e==this.map.layers[i].div||e==this.map.layers[i].pane){c=true;break}}}d=e==this.map.div;e=e.parentNode}if(!b&&d){if(c){var k=0;if(!a){a=window.event}if(a.wheelDelta){k=a.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){k=-k}}else if(a.detail){k=-a.detail/3}this.delta=this.delta+k;if(this.interval){window.clearTimeout(this._timeoutId);this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(a)},this),this.interval)}else{this.wheelZoom(a)}}OpenLayers.Event.stop(a)}},wheelZoom:function(a){var b=this.delta;this.delta=0;if(b){if(this.mousePosition){a.xy=this.mousePosition}if(!a.xy){a.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(b<0){this.callback("down",[a,this.cumulative?b:-1])}else{this.callback("up",[a,this.cumulative?b:1])}}},mousemove:function(a){this.mousePosition=a.xy},activate:function(a){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",b);OpenLayers.Event.observe(window,"mousewheel",b);OpenLayers.Event.observe(document,"mousewheel",b);return true}else{return false}},deactivate:function(a){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",b);OpenLayers.Event.stopObserving(window,"mousewheel",b);OpenLayers.Event.stopObserving(document,"mousewheel",b);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(a,b){this.addOptions(b);this.name=a;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(a){if(a==null){a=true}if(this.map!=null){this.map.removeLayer(this,a)}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(a){if(a==null){a=new OpenLayers.Layer(this.name,this.getOptions())}OpenLayers.Util.applyDefaults(a,this);a.map=null;return a},getOptions:function(){var a={};for(var b in this.options){a[b]=this[b]}return a},setName:function(a){if(a!=this.name){this.name=a;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(a){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},onMapResize:function(){},redraw:function(){var a=false;if(this.map){this.inRange=this.calculateInRange();var b=this.getExtent();if(b&&this.inRange&&this.visibility){var c=true;this.moveTo(b,c,false);this.events.triggerEvent("moveend",{zoomChanged:c});a=true}}return a},moveTo:function(a,b,c){var d=this.visibility;if(!this.isBaseLayer){d=d&&this.inRange}this.display(d)},setMap:function(a){if(this.map==null){this.map=a;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 b=this.visibility&&this.inRange;this.div.style.display=b?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(a){},getImageSize:function(a){return this.imageSize||this.tileSize},setTileSize:function(a){var b=a?a:this.tileSize?this.tileSize:this.map.getTileSize();this.tileSize=b;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(b.w+2*this.gutter,b.h+2*this.gutter)}},getVisibility:function(){return this.visibility},setVisibility:function(a){if(a!=this.visibility){this.visibility=a;this.display(a);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(a){if(a!=(this.div.style.display!="none")){this.div.style.display=a&&this.calculateInRange()?"block":"none"}},calculateInRange:function(){var a=false;if(this.alwaysInRange){a=true}else{if(this.map){var b=this.map.getResolution();a=b>=this.minResolution&&b<=this.maxResolution}}return a},setIsBaseLayer:function(a){if(a!=this.isBaseLayer){this.isBaseLayer=a;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var a=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var c=false;var d={};for(var e=0,f=a.length;e<f;e++){var g=a[e];if(this.options[g]&&OpenLayers.Util.indexOf(b,g)==-1){c=true}d[g]=this.options[g]||this.map[g]}if(this.alwaysInRange==null){this.alwaysInRange=!c}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){d.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){d.resolutions=null}if(!d.numZoomLevels&&d.maxZoomLevel){d.numZoomLevels=d.maxZoomLevel+1}if(d.scales!=null||d.resolutions!=null){if(d.scales!=null){d.resolutions=[];for(var e=0,f=d.scales.length;e<f;e++){var h=d.scales[e];d.resolutions[e]=OpenLayers.Util.getResolutionFromScale(h,d.units)}}d.numZoomLevels=d.resolutions.length}else{if(d.minScale){d.maxResolution=OpenLayers.Util.getResolutionFromScale(d.minScale,d.units)}else if(d.maxResolution=="auto"){var i=this.map.getSize();var j=d.maxExtent.getWidth()/i.w;var k=d.maxExtent.getHeight()/i.h;d.maxResolution=Math.max(j,k)}if(d.maxScale!=null){d.minResolution=OpenLayers.Util.getResolutionFromScale(d.maxScale,d.units)}else if(d.minResolution=="auto"&&d.minExtent!=null){var i=this.map.getSize();var j=d.minExtent.getWidth()/i.w;var k=d.minExtent.getHeight()/i.h;d.minResolution=Math.max(j,k)}if(d.minResolution!=null&&this.options.numZoomLevels==undefined){var l=d.maxResolution/d.minResolution;d.numZoomLevels=Math.floor(Math.log(l)/Math.log(2))+1}d.resolutions=new Array(d.numZoomLevels);var m=2;if(typeof d.minResolution=="number"&&d.numZoomLevels>1){m=Math.pow(d.maxResolution/d.minResolution,1/(d.numZoomLevels-1))}for(var e=0;e<d.numZoomLevels;e++){var n=d.maxResolution/Math.pow(m,e);d.resolutions[e]=n}}d.resolutions.sort(function(a,b){return b-a});this.resolutions=d.resolutions;this.maxResolution=d.resolutions[0];var o=d.resolutions.length-1;this.minResolution=d.resolutions[o];this.scales=[];for(var e=0,f=d.resolutions.length;e<f;e++){this.scales[e]=OpenLayers.Util.getScaleFromResolution(d.resolutions[e],d.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=d.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(a,b){var c=this.map.getSize();var d=Math.max(a.getWidth()/c.w,a.getHeight()/c.h);return this.getZoomForResolution(d,b)},getDataExtent:function(){},getResolutionForZoom:function(a){a=Math.max(0,Math.min(a,this.resolutions.length-1));var b;if(this.map.fractionalZoom){var c=Math.floor(a);var d=Math.ceil(a);b=this.resolutions[c]-(a-c)*(this.resolutions[c]-this.resolutions[d])}else{b=this.resolutions[Math.round(a)]}return b},getZoomForResolution:function(a,b){var c;if(this.map.fractionalZoom){var d=0;var e=this.resolutions.length-1;var f=this.resolutions[d];var g=this.resolutions[e];var h;for(var i=0,j=this.resolutions.length;i<j;++i){h=this.resolutions[i];if(h>=a){f=h;d=i}if(h<=a){g=h;e=i;break}}var k=f-g;if(k>0){c=d+(f-a)/k}else{c=d}}else{var l;var m=Number.POSITIVE_INFINITY;for(var i=0,j=this.resolutions.length;i<j;i++){if(b){l=Math.abs(this.resolutions[i]-a);if(l>m){break}m=l}else{if(this.resolutions[i]<a){break}}}c=Math.max(0,i-1)}return c},getLonLatFromViewPortPx:function(a){var b=null;if(a!=null){var c=this.map.getSize();var d=this.map.getCenter();if(d){var e=this.map.getResolution();var f=a.x-c.w/2;var g=a.y-c.h/2;b=new OpenLayers.LonLat(d.lon+f*e,d.lat-g*e);if(this.wrapDateLine){b=b.wrapDateLine(this.maxExtent)}}}return b},getViewPortPxFromLonLat:function(a){var b=null;if(a!=null){var c=this.map.getResolution();var d=this.map.getExtent();b=new OpenLayers.Pixel(1/c*(a.lon-d.left),1/c*(d.top-a.lat))}return b},setOpacity:function(a){if(a!=this.opacity){this.opacity=a;for(var b=0,c=this.div.childNodes.length;b<c;++b){var d=this.div.childNodes[b].firstChild;OpenLayers.Util.modifyDOMElement(d,null,null,null,null,null,null,a)}if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(a){if(this.gutter){var b=this.gutter*this.map.getResolution();a=new OpenLayers.Bounds(a.left-b,a.bottom-b,a.right+b,a.top+b)}if(this.wrapDateLine){var c={rightTolerance:this.getResolution()};a=a.wrapDateLine(this.maxExtent,c)}return a},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,documentDrag:false,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval,documentDrag:this.documentDrag})},panMap:function(a){this.panned=true;this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(a){if(this.panned){this.panMap(a);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});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,url:null,renderIntent:"default",initialize:function(a,b,c){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,b]);this.lonlat=null;this.geometry=a?a:null;this.state=null;this.attributes={};if(b){this.attributes=OpenLayers.Util.extend(this.attributes,b)}this.style=c?c: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(a){var b=false;if(this.layer&&this.layer.map){var c=this.layer.map.getExtent();if(a){var d=this.geometry.getBounds();b=c.intersectsBounds(d)}else{var e=c.toGeometry();b=e.intersects(this.geometry)}}return b},getVisibility:function(){return!(this.style&&this.style.display=="none"||!this.layer||this.layer&&this.layer.styleMap&&this.layer.styleMap.createSymbolizer(this,this.renderIntent).display=="none"||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(a,b,c){var d=false;if(this.geometry){d=this.geometry.atPoint(a,b,c)}return d},destroyPopup:function(){},move:function(a){if(!this.layer||!this.geometry.move){return}var b;if(a.CLASS_NAME=="OpenLayers.LonLat"){b=this.layer.getViewPortPxFromLonLat(a)}else{b=a}var c=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var d=this.layer.map.getResolution();this.geometry.move(d*(b.x-c.x),d*(c.y-b.y));this.layer.drawFeature(this);return c},toState:function(a){if(a==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=a;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else if(a==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=a;break}}else if(a==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=a;break}}else if(a==OpenLayers.State.UNKNOWN){this.state=a}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.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(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var b={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,b,{keyMask:this.keyMask})},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(a)}},startBox:function(a){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(a){var b=this.dragHandler.start.x;var c=this.dragHandler.start.y;var d=Math.abs(b-a.x);var e=Math.abs(c-a.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,e)+"px";this.zoomBox.style.left=a.x<b?a.x+"px":b+"px";this.zoomBox.style.top=a.y<c?a.y+"px":c+"px";var f=this.getBoxCharacteristics();if(f.newBoxModel){if(a.x>b){this.zoomBox.style.width=Math.max(1,d-f.xOffset)+"px"}if(a.y>c){this.zoomBox.style.height=Math.max(1,e-f.yOffset)+"px"}}},endBox:function(a){var b;if(Math.abs(this.dragHandler.start.x-a.x)>5||Math.abs(this.dragHandler.start.y-a.y)>5){var c=this.dragHandler.start;var d=Math.min(c.y,a.y);var e=Math.max(c.y,a.y);var f=Math.min(c.x,a.x);var g=Math.max(c.x,a.x);b=new OpenLayers.Bounds(f,e,g,d)}else{b=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[b])},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 a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var b=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var c=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:a,yOffset:b,newBoxModel:c}}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(a,b,c,d){var e=arguments;e=[a,d];OpenLayers.Layer.prototype.initialize.apply(this,e);this.url=b;this.params=OpenLayers.Util.extend({},c)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setUrl:function(a){this.url=a},mergeNewParams:function(a){this.params=OpenLayers.Util.extend(this.params,a);var b=this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"params"})}return b},redraw:function(a){if(a){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(a,b){var c=1;for(var d=0,e=a.length;d<e;d++){c*=a.charCodeAt(d)*this.URL_HASH_FACTOR;c-=Math.floor(c)}return b[Math.floor(c*b.length)]},getFullRequestString:function(a,b){var c=b||this.url;var d=OpenLayers.Util.extend({},this.params);d=OpenLayers.Util.extend(d,a);var e=OpenLayers.Util.getParameterString(d);if(c instanceof Array){c=this.selectUrl(e,c)}var f=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c));for(var g in d){if(g.toUpperCase()in f){delete d[g]}}e=OpenLayers.Util.getParameterString(d);return OpenLayers.Util.urlAppend(c,e)},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(a,b,c,d,e){this.url=b;this.extent=c;this.maxExtent=c;this.size=d;OpenLayers.Layer.prototype.initialize.apply(this,[a,e]);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(a){if(a==null){a=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.getOptions())}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setMap:function(a){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(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var d=this.tile==null;if(b||d){this.setTileSize();var e=new OpenLayers.LonLat(this.extent.left,this.extent.top);var f=this.map.getLayerPxFromLonLat(e);if(d){this.tile=new OpenLayers.Tile.Image(this,f,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=f.clone()}this.tile.draw()}},setTileSize:function(){var a=this.extent.getWidth()/this.map.getResolution();var b=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(a,b)},addTileMonitoringHooks:function(a){a.onLoadStart=function(){this.events.triggerEvent("loadstart")};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.events.triggerEvent("loadend")};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},setUrl:function(a){this.url=a;this.tile.draw()},getURL:function(a){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(a,b){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(a){if(a!=this.opacity){this.opacity=a;for(var b=0,c=this.markers.length;b<c;b++){this.markers[b].setOpacity(this.opacity)}}},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(b||!this.drawn){for(var d=0,e=this.markers.length;d<e;d++){this.drawMarker(this.markers[d])}this.drawn=true}},addMarker:function(a){this.markers.push(a);if(this.opacity!=null){a.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){a.map=this.map;this.drawMarker(a)}},removeMarker:function(a){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,a);a.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(a){var b=this.map.getLayerPxFromLonLat(a.lonlat);if(b==null){a.display(false)}else{if(!a.isDrawn()){var c=a.draw(b);this.div.appendChild(c)}else if(a.icon){a.icon.moveTo(b)}}},getDataExtent:function(){var a=null;if(this.markers&&this.markers.length>0){var a=new OpenLayers.Bounds;for(var b=0,c=this.markers.length;b<c;b++){var d=this.markers[b];a.extend(d.lonlat)}}return a},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var a=null;if(this.sphericalMercator){a=this.map.calculateBounds()}else{a=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return a},initMercatorParameters:function(){this.RESOLUTIONS=[];var a=156543.0339;for(var b=0;b<=this.MAX_ZOOM_LEVEL;++b){this.RESOLUTIONS[b]=a/Math.pow(2,b)}this.units="m";this.projection="EPSG:900913"},forwardMercator:function(a,b){var c=a*20037508.34/180;var d=Math.log(Math.tan((90+b)*Math.PI/360))/(Math.PI/180);d=d*20037508.34/180;return new OpenLayers.LonLat(c,d)},inverseMercator:function(a,b){var c=a/20037508.34*180;var d=b/20037508.34*180;d=180/Math.PI*(2*Math.atan(Math.exp(d*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(c,d)},projectForward:function(a){var b=OpenLayers.Layer.SphericalMercator.forwardMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a},projectInverse:function(a){var b=OpenLayers.Layer.SphericalMercator.inverseMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);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(a){if(a instanceof OpenLayers.Bounds){var b;if(!this.out){var c=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));var d=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));b=new OpenLayers.Bounds(c.lon,c.lat,d.lon,d.lat)}else{var e=Math.abs(a.right-a.left);var f=Math.abs(a.top-a.bottom);var g=Math.min(this.map.size.h/f,this.map.size.w/e);var h=this.map.getExtent();var i=this.map.getLonLatFromPixel(a.getCenterPixel());var j=i.lon-h.getWidth()/2*g;var k=i.lon+h.getWidth()/2*g;var l=i.lat-h.getHeight()/2*g;var m=i.lat+h.getHeight()/2*g;b=new OpenLayers.Bounds(j,l,k,m)}var n=this.map.getZoom();this.map.zoomToExtent(b);if(n==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(n+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(a),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(a),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(a){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,[a])},read:function(a){var b,c,d;var e=this.regExes.typeStr.exec(a);if(e){c=e[1].toLowerCase();d=e[2];if(this.parse[c]){b=this.parse[c].apply(this,[d])}if(this.internalProjection&&this.externalProjection){if(b&&b.CLASS_NAME=="OpenLayers.Feature.Vector"){b.geometry.transform(this.externalProjection,this.internalProjection)}else if(b&&c!="geometrycollection"&&typeof b=="object"){for(var f=0,g=b.length;f<g;f++){var h=b[f];h.geometry.transform(this.externalProjection,this.internalProjection)}}}}return b},write:function(a){var b,c,d,e,f;if(a.constructor==Array){b=a;f=true}else{b=[a];f=false}var g=[];if(f){g.push("GEOMETRYCOLLECTION(")}for(var h=0,i=b.length;h<i;++h){if(f&&h>0){g.push(",")}c=b[h].geometry;d=c.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[d]){return null}if(this.internalProjection&&this.externalProjection){c=c.clone();c.transform(this.internalProjection,this.externalProjection)}e=this.extract[d].apply(this,[c]);g.push(d.toUpperCase()+"("+e+")")}if(f){g.push(")")}return g.join("")},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(a){var b=[];for(var c=0,d=a.components.length;c<d;++c){b.push(this.extract.point.apply(this,[a.components[c]]))}return b.join(",")},linestring:function(a){var b=[];for(var c=0,d=a.components.length;c<d;++c){b.push(this.extract.point.apply(this,[a.components[c]]))}return b.join(",")},multilinestring:function(a){var b=[];for(var c=0,d=a.components.length;c<d;++c){b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")")}return b.join(",")},polygon:function(a){var b=[];for(var c=0,d=a.components.length;c<d;++c){b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")")}return b.join(",")},multipolygon:function(a){var b=[];for(var c=0,d=a.components.length;c<d;++c){b.push("("+this.extract.polygon.apply(this,[a.components[c]])+")")}return b.join(",")}},parse:{point:function(a){var b=OpenLayers.String.trim(a).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b[0],b[1]))},multipoint:function(a){var b=OpenLayers.String.trim(a).split(",");var c=[];for(var d=0,e=b.length;d<e;++d){c.push(this.parse.point.apply(this,[b[d]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(c))},linestring:function(a){var b=OpenLayers.String.trim(a).split(",");var c=[];for(var d=0,e=b.length;d<e;++d){c.push(this.parse.point.apply(this,[b[d]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(c))},multilinestring:function(a){var b;var c=OpenLayers.String.trim(a).split(this.regExes.parenComma);var d=[];for(var e=0,f=c.length;e<f;++e){b=c[e].replace(this.regExes.trimParens,"$1");d.push(this.parse.linestring.apply(this,[b]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(d))},polygon:function(a){var b,c,d;var e=OpenLayers.String.trim(a).split(this.regExes.parenComma);var f=[];for(var g=0,h=e.length;g<h;++g){b=e[g].replace(this.regExes.trimParens,"$1");c=this.parse.linestring.apply(this,[b]).geometry;d=new OpenLayers.Geometry.LinearRing(c.components);f.push(d)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(f))},multipolygon:function(a){var b;var c=OpenLayers.String.trim(a).split(this.regExes.doubleParenComma);var d=[];for(var e=0,f=c.length;e<f;++e){b=c[e].replace(this.regExes.trimParens,"$1");d.push(this.parse.polygon.apply(this,[b]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(d))},geometrycollection:function(a){a=a.replace(/,\s*([A-Za-z])/g,"|$1");var b=OpenLayers.String.trim(a).split("|");var c=[];for(var d=0,e=b.length;d<e;++d){c.push(OpenLayers.Format.WKT.prototype.read.apply(this,[b[d]]))}return c}},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(a,b,c,d){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 a=0,b=this.grid.length;a<b;a++){var c=this.grid[a];for(var d=0,e=c.length;d<e;d++){var f=c[d];this.removeTileMonitoringHooks(f);f.destroy()}}this.grid=[]}},clone:function(a){if(a==null){a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions())}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},moveTo:function(a,b,c){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);a=a||this.map.getExtent();if(a!=null){var d=!this.grid.length||b;var e=this.getTilesBounds();if(this.singleTile){if(d||!c&&!e.containsBounds(a)){this.initSingleTile(a)}}else{if(d||!e.containsBounds(a,true)){this.initGriddedTiles(a)}else{this.moveGriddedTiles(a)}}}},setTileSize:function(a){if(this.singleTile){a=this.map.getSize().clone();a.h=parseInt(a.h*this.ratio);a.w=parseInt(a.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])},getGridBounds:function(){var a="The getGridBounds() function is deprecated. It will be "+"removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(a);return this.getTilesBounds()},getTilesBounds:function(){var a=null;if(this.grid.length){var b=this.grid.length-1;var c=this.grid[b][0];var d=this.grid[0].length-1;var e=this.grid[0][d];a=new OpenLayers.Bounds(c.bounds.left,c.bounds.bottom,e.bounds.right,e.bounds.top)}return a},initSingleTile:function(a){var b=a.getCenterLonLat();var c=a.getWidth()*this.ratio;var d=a.getHeight()*this.ratio;var e=new OpenLayers.Bounds(b.lon-c/2,b.lat-d/2,b.lon+c/2,b.lat+d/2);var f=new OpenLayers.LonLat(e.left,e.top);var g=this.map.getLayerPxFromLonLat(f);if(!this.grid.length){this.grid[0]=[]}var h=this.grid[0][0];if(!h){h=this.addTile(e,g);this.addTileMonitoringHooks(h);h.draw();this.grid[0][0]=h}else{h.moveTo(e,g)}this.removeExcessTiles(1,1)},calculateGridLayout:function(a,b,c){var d=c*this.tileSize.w;var e=c*this.tileSize.h;var f=a.left-b.left;var g=Math.floor(f/d)-this.buffer;var h=f/d-g;var i=-h*this.tileSize.w;var j=b.left+g*d;var k=a.top-(b.bottom+e);var l=Math.ceil(k/e)+this.buffer;var m=l-k/e;var n=-m*this.tileSize.h;var o=b.bottom+l*e;return{tilelon:d,tilelat:e,tileoffsetlon:j,tileoffsetlat:o,tileoffsetx:i,tileoffsety:n}},initGriddedTiles:function(a){var b=this.map.getSize();var c=Math.ceil(b.h/this.tileSize.h)+Math.max(1,2*this.buffer);var d=Math.ceil(b.w/this.tileSize.w)+Math.max(1,2*this.buffer);var e=this.maxExtent;var f=this.map.getResolution();var g=this.calculateGridLayout(a,e,f);var h=Math.round(g.tileoffsetx);var i=Math.round(g.tileoffsety);var j=g.tileoffsetlon;var k=g.tileoffsetlat;var l=g.tilelon;var m=g.tilelat;this.origin=new OpenLayers.Pixel(h,i);var n=h;var o=j;var p=0;var q=parseInt(this.map.layerContainerDiv.style.left);var r=parseInt(this.map.layerContainerDiv.style.top);do{var s=this.grid[p++];if(!s){s=[];this.grid.push(s)}j=o;h=n;var t=0;do{var u=new OpenLayers.Bounds(j,k,j+l,k+m);var v=h;v-=q;var w=i;w-=r;var x=new OpenLayers.Pixel(v,w);var y=s[t++];if(!y){y=this.addTile(u,x);this.addTileMonitoringHooks(y);s.push(y)}else{y.moveTo(u,x,false)}j+=l;h+=this.tileSize.w}while(j<=a.right+l*this.buffer||t<d);k-=m;i+=this.tileSize.h}while(k>=a.bottom-m*this.buffer||p<c);this.removeExcessTiles(p,t);this.spiralTileLoad()},spiralTileLoad:function(){var a=[];var b=["right","down","left","up"];var c=0;var d=-1;var e=OpenLayers.Util.indexOf(b,"right");var f=0;while(f<b.length){var g=c;var h=d;switch(b[e]){case"right":h++;break;case"down":g++;break;case"left":h--;break;case"up":g--;break}var i=null;if(g<this.grid.length&&g>=0&&h<this.grid[0].length&&h>=0){i=this.grid[g][h]}if(i!=null&&!i.queued){a.unshift(i);i.queued=true;f=0;c=g;d=h}else{e=(e+1)%4;f++}}for(var j=0,k=a.length;j<k;j++){var i=a[j];i.draw();i.queued=false}},addTile:function(a,b){},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},moveGriddedTiles:function(a){var b=this.buffer||1;while(true){var c=this.grid[0][0].position;var d=this.map.getViewPortPxFromLayerPx(c);if(d.x>-this.tileSize.w*(b-1)){this.shiftColumn(true)}else if(d.x<-this.tileSize.w*b){this.shiftColumn(false)}else if(d.y>-this.tileSize.h*(b-1)){this.shiftRow(true)}else if(d.y<-this.tileSize.h*b){this.shiftRow(false)}else{break}}},shiftRow:function(a){var b=a?0:this.grid.length-1;var c=this.grid;var d=c[b];var e=this.map.getResolution();var f=a?-this.tileSize.h:this.tileSize.h;var g=e*-f;var h=a?c.pop():c.shift();for(var i=0,j=d.length;i<j;i++){var k=d[i];var l=k.bounds.clone();var m=k.position.clone();l.bottom=l.bottom+g;l.top=l.top+g;m.y=m.y+f;h[i].moveTo(l,m)}if(a){c.unshift(h)}else{c.push(h)}},shiftColumn:function(a){var b=a?-this.tileSize.w:this.tileSize.w;var c=this.map.getResolution();var d=c*b;for(var e=0,f=this.grid.length;e<f;e++){var g=this.grid[e];var h=a?0:g.length-1;var i=g[h];var j=i.bounds.clone();var k=i.position.clone();j.left=j.left+d;j.right=j.right+d;k.x=k.x+b;var l=a?this.grid[e].pop():this.grid[e].shift();l.moveTo(j,k);if(a){g.unshift(l)}else{g.push(l)}}},removeExcessTiles:function(a,b){while(this.grid.length>a){var c=this.grid.pop();for(var d=0,e=c.length;d<e;d++){var f=c[d];this.removeTileMonitoringHooks(f);f.destroy()}}while(this.grid[0].length>b){for(var d=0,e=this.grid.length;d<e;d++){var c=this.grid[d];var f=c.pop();this.removeTileMonitoringHooks(f);f.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(a){var b=this.maxExtent;var c=this.getResolution();var d=c*this.tileSize.w;var e=c*this.tileSize.h;var f=this.getLonLatFromViewPortPx(a);var g=b.left+d*Math.floor((f.lon-b.left)/d);var h=b.bottom+e*Math.floor((f.lat-b.bottom)/e);return new OpenLayers.Bounds(g,h,g+d,h+e)},CLASS_NAME:"OpenLayers.Layer.Grid"});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(a,b){OpenLayers.Util.extend(this,b);this.rules=[];if(b&&b.rules){this.addRules(b.rules)}this.setDefaultStyle(a||OpenLayers.Feature.Vector.style["default"])},destroy:function(){for(var a=0,b=this.rules.length;a<b;a++){this.rules[a].destroy();this.rules[a]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(a){var b=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),a);var c=this.rules;var d,e;var f=[];var g=false;for(var h=0,i=c.length;h<i;h++){d=c[h];var j=d.evaluate(a);if(j){if(d instanceof OpenLayers.Rule&&d.elseFilter){f.push(d)}else{g=true;this.applySymbolizer(d,b,a)}}}if(g==false&&f.length>0){g=true;for(var h=0,i=f.length;h<i;h++){this.applySymbolizer(f[h],b,a)}}if(c.length>0&&g==false){b.display="none"}return b},applySymbolizer:function(a,b,c){var d=c.geometry?this.getSymbolizerPrefix(c.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var e=a.symbolizer[d]||a.symbolizer;if(this.defaultsPerSymbolizer===true){var f=this.defaultStyle;OpenLayers.Util.applyDefaults(e,{pointRadius:f.pointRadius});if(e.stroke===true||e.graphic===true){OpenLayers.Util.applyDefaults(e,{strokeWidth:f.strokeWidth,strokeColor:f.strokeColor,strokeOpacity:f.strokeOpacity,strokeDashstyle:f.strokeDashstyle,strokeLinecap:f.strokeLinecap})}if(e.fill===true||e.graphic===true){OpenLayers.Util.applyDefaults(e,{fillColor:f.fillColor,fillOpacity:f.fillOpacity})}if(e.graphic===true){OpenLayers.Util.applyDefaults(e,{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(b,e),c)},createLiterals:function(a,b){var c=OpenLayers.Util.extend({},b.attributes||b.data);OpenLayers.Util.extend(c,this.context);for(var d in this.propertyStyles){a[d]=OpenLayers.Style.createLiteral(a[d],c,b,d)}return a},findPropertyStyles:function(){var a={};var b=this.defaultStyle;this.addPropertyStyles(a,b);var c=this.rules;var d,e;for(var f=0,g=c.length;f<g;f++){d=c[f].symbolizer;for(var h in d){e=d[h];if(typeof e=="object"){this.addPropertyStyles(a,e)}else{this.addPropertyStyles(a,d);break}}}return a},addPropertyStyles:function(a,b){var c;for(var d in b){c=b[d];if(typeof c=="string"&&c.match(/\$\{\w+\}/)){a[d]=true}}return a},addRules:function(a){this.rules=this.rules.concat(a);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(a){this.defaultStyle=a;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(a){var b=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var c=0,d=b.length;c<d;c++){if(a.CLASS_NAME.indexOf(b[c])!=-1){return b[c]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(a,b,c,d){if(typeof a=="string"&&a.indexOf("${")!=-1){a=OpenLayers.String.format(a,b,[c,d]);a=isNaN(a)||!a?a:parseFloat(a)}return a};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,documentDrag:false,zoomBox:null,zoomBoxEnabled:true,zoomWheelEnabled:true,mouseWheelOptions:null,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,autoActivate:true,initialize:function(a){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();if(this.zoomBoxEnabled){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=OpenLayers.Function.False}var a={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var b={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,a,b);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},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.mouseWheelOptions)},defaultDblClick:function(a){var b=this.map.getLonLatFromViewPortPx(a.xy);this.map.setCenter(b,this.map.zoom+1)},defaultDblRightClick:function(a){var b=this.map.getLonLatFromViewPortPx(a.xy);this.map.setCenter(b,this.map.zoom-1)},wheelChange:function(a,b){var c=this.map.getZoom();var d=this.map.getZoom()+Math.round(b);d=Math.max(d,0);d=Math.min(d,this.map.getNumZoomLevels());if(d===c){return}var e=this.map.getSize();var f=e.w/2-a.xy.x;var g=a.xy.y-e.h/2;var h=this.map.baseLayer.getResolutionForZoom(d);var i=this.map.getLonLatFromPixel(a.xy);var j=new OpenLayers.LonLat(i.lon+f*h,i.lat+g*h);this.map.setCenter(j,d)},wheelUp:function(a,b){this.wheelChange(a,b||1)},wheelDown:function(a,b){this.wheelChange(a,b||-1)},disableZoomBox:function(){this.zoomBoxEnabled=false;this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=true;if(this.active){this.zoomBox.activate()}},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.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(a){if(a){this.bounds=a.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(a){var b=this.getBounds();if(!b){this.setBounds(a)}else{this.bounds.extend(a)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(a,b){},getVertices:function(a){},atPoint:function(a,b,c){var d=false;var e=this.getBounds();if(e!=null&&a!=null){var f=b!=null?b:0;var g=c!=null?c:0;var h=new OpenLayers.Bounds(this.bounds.left-f,this.bounds.bottom-g,this.bounds.right+f,this.bounds.top+g);d=h.containsLonLat(a)}return d},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(a){var b=arguments.callee.format;if(!b){b=new OpenLayers.Format.WKT;arguments.callee.format=b}var c;var d=b.read(a);if(d instanceof OpenLayers.Feature.Vector){c=d.geometry}else if(d instanceof Array){var e=d.length;var f=new Array(e);for(var g=0;g<e;++g){f[g]=d[g].geometry}c=new OpenLayers.Geometry.Collection(f)}return c};OpenLayers.Geometry.segmentsIntersect=function(a,b,c){var d=c&&c.point;var e=c&&c.tolerance;var f=false;var g=a.x1-b.x1;var h=a.y1-b.y1;var i=a.x2-a.x1;var j=a.y2-a.y1;var k=b.y2-b.y1;var l=b.x2-b.x1;var m=k*i-l*j;var n=l*h-k*g;var o=i*h-j*g;if(m==0){if(n==0&&o==0){f=true}}else{var p=n/m;var q=o/m;if(p>=0&&p<=1&&q>=0&&q<=1){if(!d){f=true}else{var r=a.x1+p*i;var s=a.y1+p*j;f=new OpenLayers.Geometry.Point(r,s)}}}if(e){var t;if(f){if(d){var u=[a,b];var v,r,s;outer:for(var w=0;w<2;++w){v=u[w];for(var x=1;x<3;++x){r=v["x"+x];s=v["y"+x];t=Math.sqrt(Math.pow(r-f.x,2)+Math.pow(s-f.y,2));if(t<e){f.x=r;f.y=s;break outer}}}}}else{var u=[a,b];var y,z,r,s,A,B;outer:for(var w=0;w<2;++w){y=u[w];z=u[(w+1)%2];for(var x=1;x<3;++x){A={x:y["x"+x],y:y["y"+x]};B=OpenLayers.Geometry.distanceToSegment(A,z);if(B.distance<e){if(d){f=new OpenLayers.Geometry.Point(A.x,A.y)}else{f=true}break outer}}}}}return f};OpenLayers.Geometry.distanceToSegment=function(a,b){var c=a.x;var d=a.y;var e=b.x1;var f=b.y1;var g=b.x2;var h=b.y2;var i=g-e;var j=h-f;var k=(i*(c-e)+j*(d-f))/(Math.pow(i,2)+Math.pow(j,2));var l,m;if(k<=0){l=e;m=f}else if(k>=1){l=g;m=h}else{l=e+k*i;m=f+k*j}return{distance:Math.sqrt(Math.pow(l-c,2)+Math.pow(m-d,2)),x:l,y:m}};OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,sphericalMercator:false,initialize:function(a,b,c){var d=0;if(c.minZoomLevel)d=c.minZoomLevel;if(c&&c.sphericalMercator||this.sphericalMercator){c=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-128*156543.0339,-128*156543.0339,128*156543.0339,128*156543.0339),maxResolution:156543.0339/Math.pow(2,d),minZoomLevel:d,numZoomLevels:19,units:"m",projection:"EPSG:900913"},c)}b=b||this.url;a=a||this.name;var e=[a,b,{},c];OpenLayers.Layer.Grid.prototype.initialize.apply(this,e)},clone:function(a){if(a==null){a=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},getURL:function(a){var b=this.map.getResolution();var c=Math.round((a.left-this.maxExtent.left)/(b*this.tileSize.w));var d=Math.round((this.maxExtent.top-a.top)/(b*this.tileSize.h));var e=this.map.getZoom();var f=this.url;var g=""+c+d+e;if(f instanceof Array){f=this.selectUrl(g,f)}e=this.map.getZoom()+this.minZoomLevel;var h=Math.pow(2,e);var f;var i=OpenLayers.String.format(f,{x:c,y:d,z:e});return i},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>",sphericalMercator:true,url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(a,b){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(a instanceof OpenLayers.Style){this.styles["default"]=a;this.styles["select"]=a;this.styles["temporary"]=a;this.styles["delete"]=a}else if(typeof a=="object"){for(var c in a){if(a[c]instanceof OpenLayers.Style){this.styles[c]=a[c]}else if(typeof a[c]=="object"){this.styles[c]=new OpenLayers.Style(a[c])}else{this.styles["default"]=new OpenLayers.Style(a);this.styles["select"]=new OpenLayers.Style(a);this.styles["temporary"]=new OpenLayers.Style(a);this.styles["delete"]=new OpenLayers.Style(a);break}}}OpenLayers.Util.extend(this,b)},destroy:function(){for(var a in this.styles){this.styles[a].destroy()}this.styles=null},createSymbolizer:function(a,b){if(!a){a=new OpenLayers.Feature.Vector}if(!this.styles[b]){b="default"}a.renderIntent=b;var c={};if(this.extendDefault&&b!="default"){c=this.styles["default"].createSymbolizer(a)}return OpenLayers.Util.extend(c,this.styles[b].createSymbolizer(a))},addUniqueValueRules:function(a,b,c,d){var e=[];for(var f in c){e.push(new OpenLayers.Rule({symbolizer:c[f],context:d,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:b,value:f})}))}this.styles[a].addRules(e)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(a,b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(b)},clone:function(a){if(a==null){a=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(a,b){var c=!(b&&b.edge===false);var d=c&&b&&b.details;var e,f,g,h,i,j;if(a instanceof OpenLayers.Geometry.Point){f=this.x;g=this.y;h=a.x;i=a.y;e=Math.sqrt(Math.pow(f-h,2)+Math.pow(g-i,2));j=!d?e:{x0:f,y0:g,x1:h,y1:i,distance:e}}else{j=a.distanceTo(this,b);if(d){j={x0:j.x1,y0:j.y1,x1:j.x0,y1:j.y0,distance:j.distance}}}return j},equals:function(a){var b=false;if(a!=null){b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)}return b},toShortString:function(){return this.x+", "+this.y},move:function(a,b){this.x=this.x+a;this.y=this.y+b;this.clearBounds()},rotate:function(a,b){a*=Math.PI/180;var c=this.distanceTo(b);var d=a+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+c*Math.cos(d);this.y=b.y+c*Math.sin(d);this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(a,b,c){c=c==undefined?1:c;this.x=b.x+a*c*(this.x-b.x);this.y=b.y+a*(this.y-b.y);this.clearBounds();return this},intersects:function(a){var b=false;if(a.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.equals(a)}else{b=a.intersects(this)}return b},transform:function(a,b){if(a&&b){OpenLayers.Projection.transform(this,a,b);this.bounds=null}return this},getVertices:function(a){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,filter: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(a,b){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 c=0,d=this.strategies.length;c<d;c++){this.strategies[c].setLayer(this)}}},destroy:function(){if(this.strategies){var a,b,c;for(b=0,c=this.strategies.length;b<c;b++){a=this.strategies[b];if(a.autoDestroy){a.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)},clone:function(a){if(a==null){a=new OpenLayers.Layer.Vector(this.name,this.getOptions())}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);var b=this.features;var c=b.length;var d=new Array(c);for(var e=0;e<c;++e){d[e]=b[e].clone()}a.features=d;return a},refresh:function(a){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",a)}},assignRenderer:function(){for(var a=0,b=this.renderers.length;a<b;a++){var c=OpenLayers.Renderer[this.renderers[a]];if(c&&c.prototype.supported()){this.renderer=new c(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(a){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 a,b,c;for(b=0,c=this.strategies.length;b<c;b++){a=this.strategies[b];if(a.autoActivate){a.activate()}}}},removeMap:function(a){if(this.strategies){var b,c,d;for(c=0,d=this.strategies.length;c<d;c++){b=this.strategies[c];if(b.autoActivate){b.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var d=true;if(!c){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 e=this.map.getExtent();d=this.renderer.setExtent(e,b);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!b&&d){for(var f in this.unrenderedFeatures){var g=this.unrenderedFeatures[f];this.drawFeature(g)}}}if(!this.drawn||b||!d){this.drawn=true;var g;for(var f=0,h=this.features.length;f<h;f++){this.renderer.locked=f!==h-1;g=this.features[f];this.drawFeature(g)}}},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);var b=this.div.style.display;if(b!=this.renderer.root.style.display){this.renderer.root.style.display=b}},addFeatures:function(a,b){if(!(a instanceof Array)){a=[a]}var c=!b||!b.silent;if(c){var d={features:a};var e=this.events.triggerEvent("beforefeaturesadded",d);if(e===false){return}a=d.features}for(var f=0,g=a.length;f<g;f++){if(f!=a.length-1){this.renderer.locked=true}else{this.renderer.locked=false}var h=a[f];if(this.geometryType&&!(h.geometry instanceof this.geometryType)){var i=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw i}this.features.push(h);h.layer=this;if(!h.style&&this.style){h.style=OpenLayers.Util.extend({},this.style)}if(c){if(this.events.triggerEvent("beforefeatureadded",{feature:h})===false){continue}this.preFeatureInsert(h)}this.drawFeature(h);if(c){this.events.triggerEvent("featureadded",{feature:h});this.onFeatureInsert(h)}}if(c){this.events.triggerEvent("featuresadded",{features:a})}},removeFeatures:function(a,b){if(!a||a.length===0){return}if(!(a instanceof Array)){a=[a]}if(a===this.features||a===this.selectedFeatures){a=a.slice()}var c=!b||!b.silent;for(var d=a.length-1;d>=0;d--){if(d!=0&&a[d-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var e=a[d];delete this.unrenderedFeatures[e.id];if(c){this.events.triggerEvent("beforefeatureremoved",{feature:e})}this.features=OpenLayers.Util.removeItem(this.features,e);e.layer=null;if(e.geometry){this.renderer.eraseFeatures(e)}if(OpenLayers.Util.indexOf(this.selectedFeatures,e)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,e)}if(c){this.events.triggerEvent("featureremoved",{feature:e})}}if(c){this.events.triggerEvent("featuresremoved",{features:a})}},destroyFeatures:function(a,b){var c=a==undefined;if(c){a=this.features}if(a){this.removeFeatures(a,b);for(var d=a.length-1;d>=0;d--){a[d].destroy()}}},drawFeature:function(a,b){if(!this.drawn){return}if(typeof b!="object"){if(!b&&a.state===OpenLayers.State.DELETE){b="delete"}var c=b||a.renderIntent;b=a.style||this.style;if(!b){b=this.styleMap.createSymbolizer(a,c)}}if(!this.renderer.drawFeature(a,b)){this.unrenderedFeatures[a.id]=a}else{delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var b=this.renderer.getFeatureIdFromEvent(a);return this.getFeatureById(b)},getFeatureById:function(a){var b=null;for(var c=0,d=this.features.length;c<d;++c){if(this.features[c].id==a){b=this.features[c];break}}return b},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getDataExtent:function(){var a=null;var b=this.features;if(b&&b.length>0){a=new OpenLayers.Bounds;var c=null;for(var d=0,e=b.length;d<e;d++){c=b[d].geometry;if(c){a.extend(c.getBounds())}}}return a},CLASS_NAME:"OpenLayers.Layer.Vector"})
