﻿var OpenLayers={singleFile:true};(function(){var c=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!c)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var p="";var r=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var h=document.getElementsByTagName("script");for(var q=0,m=h.length;q<m;q++){var s=h[q].getAttribute("src");if(s){var o=s.match(r);if(o){p=o[1];break}}}return p}};if(!c){var l=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/ArcGIS93Rest.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/ArcIMS.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/XYZ.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/Snapping.js","OpenLayers/Control/Split.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Control/WMSGetFeatureInfo.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/Vector/RootContainer.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Strategy/Save.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Protocol/WFS.js","OpenLayers/Protocol/WFS/v1.js","OpenLayers/Protocol/WFS/v1_0_0.js","OpenLayers/Protocol/WFS/v1_1_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/ArcXML.js","OpenLayers/Format/ArcXML/Features.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WFSCapabilities.js","OpenLayers/Format/WFSCapabilities/v1.js","OpenLayers/Format/WFSCapabilities/v1_0_0.js","OpenLayers/Format/WFSCapabilities/v1_1_0.js","OpenLayers/Format/WFSDescribeFeatureType.js","OpenLayers/Format/WMSDescribeLayer.js","OpenLayers/Format/WMSDescribeLayer/v1_1.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Filter/v1_1_0.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/WFST.js","OpenLayers/Format/WFST/v1.js","OpenLayers/Format/WFST/v1_0_0.js","OpenLayers/Format/WFST/v1_1_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Format/WMSCapabilities.js","OpenLayers/Format/WMSCapabilities/v1_1.js","OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/GetFeature.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var d=navigator.userAgent;var e=(d.match("MSIE")||d.match("Safari"));if(e){var b=new Array(l.length)}var k=OpenLayers._getScriptLocation()+"lib/";for(var a=0,j=l.length;a<j;a++){if(e){b[a]="<script src='"+k+l[a]+"'></script>"}else{var g=document.createElement("script");g.src=k+l[a];var f=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;f.appendChild(g)}}if(e){document.write(b.join(""))}}})();OpenLayers.VERSION_NUMBER="OpenLayers 2.8 -- $Revision: 9492 $";OpenLayers.String={startsWith:function(b,a){return(b.indexOf(a)==0)},contains:function(b,a){return(b.indexOf(a)!=-1)},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(d){var b=d.split("-");var c=b[0];for(var e=1,a=b.length;e<a;e++){var f=b[e];c+=f.charAt(0).toUpperCase()+f.substring(1)}return c},format:function(a,c,b){if(!c){c=window}var d=function(h,g){var j;var e=g.split(/\.+/);for(var f=0;f<e.length;f++){if(f==0){j=c}j=j[e[f]]}if(typeof j=="function"){j=b?j.apply(null,b):j()}if(typeof j=="undefined"){return"undefined"}else{return j}};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(c,b){var a=0;if(b>0){a=parseFloat(c.toPrecision(b))}return a},format:function(i,a,d,b){a=(typeof a!="undefined")?a:0;d=(typeof d!="undefined")?d:OpenLayers.Number.thousandsSeparator;b=(typeof b!="undefined")?b:OpenLayers.Number.decimalSeparator;if(a!=null){i=parseFloat(i.toFixed(a))}var e=i.toString().split(".");if(e.length==1&&a==null){a=0}var c=e[0];if(d){var h=/(-?[0-9]+)([0-9]{3})/;while(h.test(c)){c=c.replace(h,"$1"+d+"$2")}}var f;if(a==0){f=c}else{var g=e.length>1?e[1]:"0";if(a!=null){g=g+new Array(a-g.length+1).join("0")}f=c+b+g}return f}};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(c,b){var a=Array.prototype.slice.apply(arguments,[2]);return function(){var d=a.concat(Array.prototype.slice.apply(arguments,[0]));return c.apply(b,d)}},bindAsEventListener:function(b,a){return function(c){return b.call(a,c||window.event)}}};if(!Function.prototype.bind){Function.prototype.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.Function.bind"}));Array.prototype.unshift.apply(arguments,[this]);return OpenLayers.Function.bind.apply(null,arguments)}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,a)}}OpenLayers.Array={filter:function(f,g,b){var a=[];if(Array.prototype.filter){a=f.filter(g,b)}else{var e=f.length;if(typeof g!="function"){throw new TypeError()}for(var d=0;d<e;d++){if(d in f){var c=f[d];if(g.call(b,c,d,f)){a.push(c)}}}}return a}};OpenLayers.Class=function(){var c=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var f={};var b,e;for(var d=0,a=arguments.length;d<a;++d){if(typeof arguments[d]=="function"){if(d==0&&a>1){e=arguments[d].prototype.initialize;arguments[d].prototype.initialize=function(){};f=new arguments[d];if(e===undefined){delete arguments[d].prototype.initialize}else{arguments[d].prototype.initialize=e}}b=arguments[d].prototype}else{b=arguments[d]}OpenLayers.Util.extend(f,b)}c.prototype=f;return c};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 b=arguments[0];var c=new b(OpenLayers.Class.isPrototype);for(var d=1,a=arguments.length;d<a;d++){if(typeof arguments[d]=="function"){var e=arguments[d];arguments[d]=new e(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(c,arguments[d])}return c};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var b=[];for(var c=0,a=arguments.length;c<a;c++){var d=arguments[c];if(typeof d=="string"){d=document.getElementById(d)}if(arguments.length==1){return d}b.push(d)}return b};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(c,e){c=c||{};if(e){for(var d in e){var a=e[d];if(a!==undefined){c[d]=a}}var b=typeof window.Event=="function"&&e instanceof window.Event;if(!b&&e.hasOwnProperty&&e.hasOwnProperty("toString")){c.toString=e.toString}}return c};OpenLayers.Util.removeItem=function(c,b){for(var a=c.length-1;a>=0;a--){if(c[a]==b){c.splice(a,1)}}return c};OpenLayers.Util.clearArray=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{"newMethod":"array = []"}));a.length=0};OpenLayers.Util.indexOf=function(c,d){for(var b=0,a=c.length;b<a;b++){if(c[b]==d){return b}}return -1};OpenLayers.Util.modifyDOMElement=function(d,a,g,f,c,h,e,b){if(a){d.id=a}if(g){d.style.left=g.x+"px";d.style.top=g.y+"px"}if(f){d.style.width=f.w+"px";d.style.height=f.h+"px"}if(c){d.style.position=c}if(h){d.style.border=h}if(e){d.style.overflow=e}if(parseFloat(b)>=0&&parseFloat(b)<1){d.style.filter="alpha(opacity="+(b*100)+")";d.style.opacity=b}else{if(parseFloat(b)==1){d.style.filter="";d.style.opacity=""}}};OpenLayers.Util.createDiv=function(a,g,f,e,c,h,d,b){var i=document.createElement("div");if(e){i.style.backgroundImage="url("+e+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!c){c="absolute"}OpenLayers.Util.modifyDOMElement(i,a,g,f,c,h,d,b);return i};OpenLayers.Util.createImage=function(a,g,e,d,c,i,b,h){var f=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!c){c="relative"}OpenLayers.Util.modifyDOMElement(f,a,g,e,c,i,null,b);if(h){f.style.display="none";OpenLayers.Event.observe(f,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,f));OpenLayers.Event.observe(f,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,f))}f.style.alt=a;f.galleryImg="no";if(d){f.src=d}return f};OpenLayers.Util.setOpacity=function(b,a){OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,a)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor="transparent";this.style.display=""}};OpenLayers.Util.onImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var c=this.urls;if(c&&c instanceof Array&&c.length>1){var f=this.src.toString();var e,b;for(b=0;e=c[b];b++){if(f.indexOf(e)!=-1){break}}var a=Math.floor(c.length*Math.random());var d=c[a];b=0;while(d==e&&b++<4){a=Math.floor(c.length*Math.random());d=c[a]}this.src=f.replace(e,d)}else{this.src=this.src}}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var c=navigator.appVersion.split("MSIE");var b=parseFloat(c[1]);var a=false;try{a=!!(document.body.filters)}catch(d){}OpenLayers.Util.alphaHackNeeded=(a&&(b>=5.5)&&(b<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(j,a,h,g,f,c,i,e,b){OpenLayers.Util.modifyDOMElement(j,a,h,g,c,null,null,b);var d=j.childNodes[0];if(f){d.src=f}OpenLayers.Util.modifyDOMElement(d,j.id+"_innerImage",null,g,"relative",i);if(OpenLayers.Util.alphaHack()){if(j.style.display!="none"){j.style.display="inline-block"}if(e==null){e="scale"}j.style.filter="progid:DXImageTransform.Microsoft"+".AlphaImageLoader(src='"+d.src+"', "+"sizingMethod='"+e+"')";if(parseFloat(j.style.opacity)>=0&&parseFloat(j.style.opacity)<1){j.style.filter+=" alpha(opacity="+j.style.opacity*100+")"}d.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(a,h,g,f,c,j,e,b,i){var k=OpenLayers.Util.createDiv();var d=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);k.appendChild(d);if(i){d.style.display="none";OpenLayers.Event.observe(d,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,k));OpenLayers.Event.observe(d,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,k))}OpenLayers.Util.modifyAlphaImageDiv(k,a,h,g,f,c,j,e,b);return k};OpenLayers.Util.upperCaseObject=function(b){var a={};for(var c in b){a[c.toUpperCase()]=b[c]}return a};OpenLayers.Util.applyDefaults=function(b,a){b=b||{};var c=typeof window.Event=="function"&&a instanceof window.Event;for(var d in a){if(b[d]===undefined||(!c&&a.hasOwnProperty&&a.hasOwnProperty(d)&&!b.hasOwnProperty(d))){b[d]=a[d]}}if(!c&&a&&a.hasOwnProperty&&a.hasOwnProperty("toString")&&!b.hasOwnProperty("toString")){b.toString=a.toString}return b};OpenLayers.Util.getParameterString=function(f){var b=[];for(var a in f){var c=f[a];if((c!=null)&&(typeof c!="function")){var d;if(typeof c=="object"&&c.constructor==Array){var e=[];for(var g=0,h=c.length;g<h;g++){e.push(encodeURIComponent(c[g]))}d=e.join(",")}else{d=encodeURIComponent(c)}b.push(encodeURIComponent(a)+"="+d)}}return b.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var b=null;for(var d=0,a=arguments.length;d<a;d++){var c=arguments[d];try{b=c();break}catch(f){}}return b};OpenLayers.Util.getNodes=function(c,b){var a=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(c.documentElement.childNodes,b)},function(){return OpenLayers.Util._getNodes(c.childNodes,b)});return a};OpenLayers.Util._getNodes=function(b,e){var d=[];for(var c=0,a=b.length;c<a;c++){if(b[c].nodeName==e){d.push(b[c])}}return d};OpenLayers.Util.getTagText=function(b,c,d){var a=OpenLayers.Util.getNodes(b,c);if(a&&(a.length>0)){if(!d){d=0}if(a[d].childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a[d].childNodes.length==1){return a[d].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(b){var a=null;OpenLayers.Util.Try(function(){a=b.text;if(!a){a=b.textContent}if(!a){a=b.firstChild.nodeValue}},function(){a=b.textContent});return a};OpenLayers.Util.mouseLeft=function(b,a){var c=(b.relatedTarget)?b.relatedTarget:b.toElement;while(c!=a&&c!=null){c=c.parentNode}return(c!=a)};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(D,c){var r=6378137,t=6356752.3142,z=1/298.257223563;var F=OpenLayers.Util.rad(c.lon-D.lon);var e=Math.atan((1-z)*Math.tan(OpenLayers.Util.rad(D.lat)));var q=Math.atan((1-z)*Math.tan(OpenLayers.Util.rad(c.lat)));var u=Math.sin(e),i=Math.cos(e);var g=Math.sin(q),l=Math.cos(q);var M=F,w=2*Math.PI;var h=20;while(Math.abs(M-w)>1e-12&&--h>0){var P=Math.sin(M),I=Math.cos(M);var G=Math.sqrt((l*P)*(l*P)+(i*g-u*l*I)*(i*g-u*l*I));if(G==0){return 0}var H=u*g+i*l*I;var m=Math.atan2(G,H);var N=Math.asin(i*l*P/G);var p=Math.cos(N)*Math.cos(N);var o=H-2*u*g/p;var j=z/16*p*(4+z*(4-3*p));w=M;M=F+(1-j)*z*Math.sin(N)*(m+j*G*(o+j*H*(-1+2*o*o)))}if(h==0){return NaN}var J=p*(r*r-t*t)/(t*t);var O=1+J/16384*(4096+J*(-768+J*(320-175*J)));var K=J/1024*(256+J*(-128+J*(74-47*J)));var v=K*G*(o+K/4*(H*(-1+2*o*o)-K/6*o*(-3+4*G*G)*(-3+4*o*o)));var k=t*O*(m-v);var E=k.toFixed(3)/1000;return E};OpenLayers.Util.getParameters=function(g){g=g||window.location.href;var l="";if(OpenLayers.String.contains(g,"?")){var o=g.indexOf("?")+1;var d=OpenLayers.String.contains(g,"#")?g.indexOf("#"):g.length;l=g.substring(o,d)}var m={};var e=l.split(/[&;]/);for(var a=0,c=e.length;a<c;++a){var h=e[a].split("=");if(h[0]){var p=decodeURIComponent(h[0]);var f=h[1]||"";f=f.split(",");for(var b=0,k=f.length;b<k;b++){f[b]=decodeURIComponent(f[b])}if(f.length==1){f=f[0]}m[p]=f}}return m};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=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{"Inch":OpenLayers.INCHES_PER_UNIT.inches,"Meter":1/OpenLayers.METERS_PER_INCH,"Foot":0.304800609601219/OpenLayers.METERS_PER_INCH,"IFoot":0.3048/OpenLayers.METERS_PER_INCH,"ClarkeFoot":0.3047972651151/OpenLayers.METERS_PER_INCH,"SearsFoot":0.304799471538676/OpenLayers.METERS_PER_INCH,"GoldCoastFoot":0.304799710181509/OpenLayers.METERS_PER_INCH,"IInch":0.0254/OpenLayers.METERS_PER_INCH,"MicroInch":2.54e-05/OpenLayers.METERS_PER_INCH,"Mil":2.54e-08/OpenLayers.METERS_PER_INCH,"Centimeter":0.01/OpenLayers.METERS_PER_INCH,"Kilometer":1000/OpenLayers.METERS_PER_INCH,"Yard":0.914401828803658/OpenLayers.METERS_PER_INCH,"SearsYard":0.914398414616029/OpenLayers.METERS_PER_INCH,"IndianYard":0.914398530744441/OpenLayers.METERS_PER_INCH,"IndianYd37":0.91439523/OpenLayers.METERS_PER_INCH,"IndianYd62":0.9143988/OpenLayers.METERS_PER_INCH,"IndianYd75":0.9143985/OpenLayers.METERS_PER_INCH,"IndianFoot":0.30479951/OpenLayers.METERS_PER_INCH,"IndianFt37":0.30479841/OpenLayers.METERS_PER_INCH,"IndianFt62":0.3047996/OpenLayers.METERS_PER_INCH,"IndianFt75":0.3047995/OpenLayers.METERS_PER_INCH,"Mile":1609.34721869444/OpenLayers.METERS_PER_INCH,"IYard":0.9144/OpenLayers.METERS_PER_INCH,"IMile":1609.344/OpenLayers.METERS_PER_INCH,"NautM":1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.316488933/OpenLayers.METERS_PER_INCH,"Lat-83":110946.257368722/OpenLayers.METERS_PER_INCH,"Decimeter":0.1/OpenLayers.METERS_PER_INCH,"Millimeter":0.001/OpenLayers.METERS_PER_INCH,"Dekameter":10/OpenLayers.METERS_PER_INCH,"Decameter":10/OpenLayers.METERS_PER_INCH,"Hectometer":100/OpenLayers.METERS_PER_INCH,"GermanMeter":1.0000135965/OpenLayers.METERS_PER_INCH,"CaGrid":0.999738/OpenLayers.METERS_PER_INCH,"ClarkeChain":20.1166194976/OpenLayers.METERS_PER_INCH,"GunterChain":20.1168402336805/OpenLayers.METERS_PER_INCH,"BenoitChain":20.1167824943759/OpenLayers.METERS_PER_INCH,"SearsChain":20.11676512155/OpenLayers.METERS_PER_INCH,"ClarkeLink":0.201166194976/OpenLayers.METERS_PER_INCH,"GunterLink":0.201168402336805/OpenLayers.METERS_PER_INCH,"BenoitLink":0.201167824943759/OpenLayers.METERS_PER_INCH,"SearsLink":0.2011676512155/OpenLayers.METERS_PER_INCH,"Rod":5.02921005842012/OpenLayers.METERS_PER_INCH,"IntnlChain":20.1168/OpenLayers.METERS_PER_INCH,"IntnlLink":0.201168/OpenLayers.METERS_PER_INCH,"Perch":5.02921005842012/OpenLayers.METERS_PER_INCH,"Pole":5.02921005842012/OpenLayers.METERS_PER_INCH,"Furlong":201.168402336805/OpenLayers.METERS_PER_INCH,"Rood":3.778266898/OpenLayers.METERS_PER_INCH,"CapeFoot":0.3047972615/OpenLayers.METERS_PER_INCH,"Brealey":375/OpenLayers.METERS_PER_INCH,"ModAmFt":0.304812252984506/OpenLayers.METERS_PER_INCH,"Fathom":1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{"mm":OpenLayers.INCHES_PER_UNIT["Meter"]/1000,"cm":OpenLayers.INCHES_PER_UNIT["Meter"]/100,"dm":OpenLayers.INCHES_PER_UNIT["Meter"]*100,"km":OpenLayers.INCHES_PER_UNIT["Meter"]*1000,"kmi":OpenLayers.INCHES_PER_UNIT["nmi"],"fath":OpenLayers.INCHES_PER_UNIT["Fathom"],"ch":OpenLayers.INCHES_PER_UNIT["IntnlChain"],"link":OpenLayers.INCHES_PER_UNIT["IntnlLink"],"us-in":OpenLayers.INCHES_PER_UNIT["inches"],"us-ft":OpenLayers.INCHES_PER_UNIT["Foot"],"us-yd":OpenLayers.INCHES_PER_UNIT["Yard"],"us-ch":OpenLayers.INCHES_PER_UNIT["GunterChain"],"us-mi":OpenLayers.INCHES_PER_UNIT["Mile"],"ind-yd":OpenLayers.INCHES_PER_UNIT["IndianYd37"],"ind-ft":OpenLayers.INCHES_PER_UNIT["IndianFt37"],"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(b){var a=(b>1)?(1/b):b;return a};OpenLayers.Util.getResolutionFromScale=function(d,a){if(a==null){a="degrees"}var b=OpenLayers.Util.normalizeScale(d);var c=1/(b*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH);return c};OpenLayers.Util.getScaleFromResolution=function(b,a){if(a==null){a="degrees"}var c=b*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH;return c};OpenLayers.Util.safeStopPropagation=function(a){OpenLayers.Event.stop(a,true)};OpenLayers.Util.pagePosition=function(a){var b=0,d=0;var f=a;var c=a;while(f){if(f==document.body){if(OpenLayers.Element.getStyle(c,"position")=="absolute"){break}}b+=f.offsetTop||0;d+=f.offsetLeft||0;c=f;try{f=f.offsetParent}catch(g){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{"elemId":f.id}));break}}f=a;while(f){b-=f.scrollTop||0;d-=f.scrollLeft||0;f=f.parentNode}return[d,b]};OpenLayers.Util.isEquivalentUrl=function(f,d,e){e=e||{};OpenLayers.Util.applyDefaults(e,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=OpenLayers.Util.createUrlObject(f,e);var a=OpenLayers.Util.createUrlObject(d,e);for(var c in b){if(c!=="args"){if(b[c]!=a[c]){return false}}}for(var c in b.args){if(b.args[c]!=a.args[c]){return false}delete a.args[c]}for(var c in a.args){return false}return true};OpenLayers.Util.createUrlObject=function(f,b){b=b||{};if(!(/^\w+:\/\//).test(f)){var j=window.location;var d=j.port?":"+j.port:"";var e=j.protocol+"//"+j.host.split(":").shift()+d;if(f.indexOf("/")===0){f=e+f}else{var i=j.pathname.split("/");i.pop();f=e+i.join("/")+"/"+f}}if(b.ignoreCase){f=f.toLowerCase()}var g=document.createElement("a");g.href=f;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 c=g.search;if(!c){var k=f.indexOf("?");c=(k!=-1)?f.substr(k):""}h.args=OpenLayers.Util.getParameters(c);h.pathname=(g.pathname.charAt(0)=="/")?g.pathname:"/"+g.pathname;return h};OpenLayers.Util.removeTail=function(c){var b=null;var a=c.indexOf("?");var d=c.indexOf("#");if(a==-1){b=(d!=-1)?c.substr(0,d):c}else{b=(d!=-1)?c.substr(0,Math.min(a,d)):c.substr(0,a)}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(j,m,a){var p,q;var b=document.createElement("div");b.style.visibility="hidden";var e=(a&&a.containerElement)?a.containerElement:document.body;if(m){if(m.w){p=m.w;b.style.width=p+"px"}else{if(m.h){q=m.h;b.style.height=q+"px"}}}if(a&&a.displayClass){b.className=a.displayClass}var o=document.createElement("div");o.innerHTML=j;o.style.overflow="visible";if(o.childNodes){for(var k=0,c=o.childNodes.length;k<c;k++){if(!o.childNodes[k].style){continue}o.childNodes[k].style.overflow="visible"}}b.appendChild(o);e.appendChild(b);var g=false;var f=b.parentNode;while(f&&f.tagName.toLowerCase()!="body"){var d=OpenLayers.Element.getStyle(f,"position");if(d=="absolute"){g=true;break}else{if(d&&d!="static"){break}}f=f.parentNode}if(!g){b.style.position="absolute"}if(!p){p=parseInt(o.scrollWidth);b.style.width=p+"px"}if(!q){q=parseInt(o.scrollHeight)}b.removeChild(o);e.removeChild(b);return new OpenLayers.Size(p,q)};OpenLayers.Util.getScrollbarWidth=function(){var c=OpenLayers.Util._scrollbarWidth;if(c==null){var e=null;var a=null;var b=0;var d=0;e=document.createElement("div");e.style.position="absolute";e.style.top="-1000px";e.style.left="-1000px";e.style.width="100px";e.style.height="50px";e.style.overflow="hidden";a=document.createElement("div");a.style.width="100%";a.style.height="200px";e.appendChild(a);document.body.appendChild(e);b=a.offsetWidth;e.style.overflow="scroll";d=a.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(b-d);c=OpenLayers.Util._scrollbarWidth}return c};OpenLayers.Rico=new Object();OpenLayers.Rico.Corner={round:function(c,b){c=OpenLayers.Util.getElement(c);this._setOptions(b);var d=this.options.color;if(this.options.color=="fromElement"){d=this._background(c)}var a=this.options.bgColor;if(this.options.bgColor=="fromParent"){a=this._background(c.offsetParent)}this._roundCornersImpl(c,d,a)},changeColor:function(c,a){c.style.backgroundColor=a;var d=c.parentNode.getElementsByTagName("span");for(var b=0;b<d.length;b++){d[b].style.backgroundColor=a}},changeOpacity:function(c,a){var f=a;var d="alpha(opacity="+a*100+")";c.style.opacity=f;c.style.filter=d;var e=c.parentNode.getElementsByTagName("span");for(var b=0;b<e.length;b++){e[b].style.opacity=f;e[b].style.filter=d}},reRound:function(b,d){var a=b.parentNode.childNodes[0];var c=b.parentNode.childNodes[2];b.parentNode.removeChild(a);b.parentNode.removeChild(c);this.round(b.parentNode,d)},_roundCornersImpl:function(b,c,a){if(this.options.border){this._renderBorder(b,a)}if(this._isTopRounded()){this._roundTopCorners(b,c,a)}if(this._isBottomRounded()){this._roundBottomCorners(b,c,a)}},_renderBorder:function(b,c){var d="1px solid "+this._borderColor(c);var a="border-left: "+d;var f="border-right: "+d;var e="style='"+a+";"+f+"'";b.innerHTML="<div "+e+">"+b.innerHTML+"</div>"},_roundTopCorners:function(a,e,b){var d=this._createCorner(b);for(var c=0;c<this.options.numSlices;c++){d.appendChild(this._createCornerSlice(e,b,c,"top"))}a.style.paddingTop=0;a.insertBefore(d,a.firstChild)},_roundBottomCorners:function(a,e,b){var d=this._createCorner(b);for(var c=(this.options.numSlices-1);c>=0;c--){d.appendChild(this._createCornerSlice(e,b,c,"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(g,d,a,f){var e=document.createElement("span");var c=e.style;c.backgroundColor=g;c.display="block";c.height="1px";c.overflow="hidden";c.fontSize="1px";var b=this._borderColor(g,d);if(this.options.border&&a==0){c.borderTopStyle="solid";c.borderTopWidth="1px";c.borderLeftWidth="0px";c.borderRightWidth="0px";c.borderBottomWidth="0px";c.height="0px";c.borderColor=b}else{if(b){c.borderColor=b;c.borderStyle="solid";c.borderWidth="0px 1px"}}if(!this.options.compact&&(a==(this.options.numSlices-1))){c.height="2px"}this._setMargin(e,a,f);this._setBorder(e,a,f);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(b,a){if(b=="transparent"){return a}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(a,b)}else{return""}}}},_setMargin:function(b,a,d){var c=this._marginSize(a);var e=d=="top"?this._whichSideTop():this._whichSideBottom();if(e=="left"){b.style.marginLeft=c+"px";b.style.marginRight="0px"}else{if(e=="right"){b.style.marginRight=c+"px";b.style.marginLeft="0px"}else{b.style.marginLeft=c+"px";b.style.marginRight=c+"px"}}},_setBorder:function(b,a,d){var c=this._borderSize(a);var e=d=="top"?this._whichSideTop():this._whichSideBottom();if(e=="left"){b.style.borderLeftWidth=c+"px";b.style.borderRightWidth="0px"}else{if(e=="right"){b.style.borderRightWidth=c+"px";b.style.borderLeftWidth="0px"}else{b.style.borderLeftWidth=c+"px";b.style.borderRightWidth=c+"px"}}if(this.options.border!=false){b.style.borderLeftWidth=c+"px";b.style.borderRightWidth=c+"px"}},_marginSize:function(b){if(this._isTransparent()){return 0}var e=[5,3,2,1];var a=[3,2,1,0];var c=[2,1];var d=[1,0];if(this.options.compact&&this.options.blend){return d[b]}else{if(this.options.compact){return c[b]}else{if(this.options.blend){return a[b]}else{return e[b]}}}},_borderSize:function(b){var e=[5,3,2,1];var a=[2,1,1,1];var c=[1,0];var d=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else{if(this.options.compact){return c[b]}else{if(this.options.blend){return a[b]}else{if(this.options.border){return d[b]}else{if(this._isTransparent()){return e[b]}}}}}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(b,a){var c=OpenLayers.Rico.Color.createFromHex(b);c.blend(OpenLayers.Rico.Color.createFromHex(a));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}};(function(){if(window.google&&google.gears){return}var a=null;if(typeof GearsFactory!="undefined"){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(a.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:a}}})();OpenLayers.Element={visible:function(a){return OpenLayers.Util.getElement(a).style.display!="none"},toggle:function(){for(var b=0,a=arguments.length;b<a;b++){var c=OpenLayers.Util.getElement(arguments[b]);var d=OpenLayers.Element.visible(c)?"hide":"show";OpenLayers.Element[d](c)}},hide:function(){for(var b=0,a=arguments.length;b<a;b++){var c=OpenLayers.Util.getElement(arguments[b]);c.style.display="none"}},show:function(){for(var b=0,a=arguments.length;b<a;b++){var c=OpenLayers.Util.getElement(arguments[b]);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(e){e=OpenLayers.Util.getElement(e);if(OpenLayers.Element.getStyle(e,"display")!="none"){return{width:e.offsetWidth,height:e.offsetHeight}}var f=e.style;var a=f.visibility;var d=f.position;f.visibility="hidden";f.position="absolute";f.display="";var c=e.clientWidth;var b=e.clientHeight;f.display="none";f.position=d;f.visibility=a;return{width:c,height:b}},hasClass:function(b,a){var c=b.className;return(!!c&&new RegExp("(^|\\s)"+a+"(\\s|$)").test(c))},addClass:function(b,a){if(!OpenLayers.Element.hasClass(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClass:function(b,a){var c=b.className;if(c){b.className=OpenLayers.String.trim(c.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," "))}return b},toggleClass:function(b,a){if(OpenLayers.Element.hasClass(b,a)){OpenLayers.Element.removeClass(b,a)}else{OpenLayers.Element.addClass(b,a)}return b},getStyle:function(d,b){d=OpenLayers.Util.getElement(d);var a=null;if(d&&d.style){a=d.style[OpenLayers.String.camelize(b)];if(!a){if(document.defaultView&&document.defaultView.getComputedStyle){var c=document.defaultView.getComputedStyle(d,null);a=c?c.getPropertyValue(b):null}else{if(d.currentStyle){a=d.currentStyle[OpenLayers.String.camelize(b)]}}}var e=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(e,b)!=-1)&&(OpenLayers.Element.getStyle(d,"position")=="static")){a="auto"}}return a=="auto"?null:a}};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(b){var a=false;if(b!=null){a=((this.w==b.w&&this.h==b.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(b.w)&&isNaN(b.h)))}return a},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 b=document.getElementsByTagName("script");for(var c=0,a=b.length;c<a;++c){if(b[c].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(d,a,e,b){this.url=d;this.size=(a)?a:new OpenLayers.Size(20,20);this.offset=e?e:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=b;var c=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(c)},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(f,c,b,e,g,d){if(f==null){f=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=f;this.lonlat=c;this.contentSize=(b!=null)?b:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(e!=null){this.contentHTML=e}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 a=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,"relative",null,"hidden");var f=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(f,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(g){this.addCloseBox(d)}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 c=document.defaultView.getComputedStyle(this.contentDiv,null);var b=c.getPropertyValue("overflow");if(b!="hidden"){this.contentDiv._oldOverflow=b;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var b=this.contentDiv._oldOverflow;if(b){this.contentDiv.style.overflow=b;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 f="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var b=(this.map)?this.map.layerContainerDiv:document.body;var h=OpenLayers.Util.getRenderedDimensions(f,null,{displayClass:this.displayClass,containerElement:b});var e=this.getSafeContentSize(h);var c=null;if(e.equals(h)){c=h}else{var g=new OpenLayers.Size();g.w=(e.w<h.w)?e.w:null;g.h=(e.h<h.h)?e.h:null;if(g.w&&g.h){c=e}else{var i=OpenLayers.Util.getRenderedDimensions(f,g,{displayClass:this.contentDisplayClass,containerElement:b});var d=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((d!="hidden")&&(i.equals(e))){var a=OpenLayers.Util.getScrollbarWidth();if(g.w){i.h+=a}else{i.w+=a}}c=this.getSafeContentSize(i)}}this.setSize(c)},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 e=this.contentDiv.getElementsByTagName("img");for(var d=0,b=e.length;d<b;d++){var c=e[d];if(c.width==0||c.height==0){var f={"popup":this,"img":c};c._onImgLoad=OpenLayers.Function.bind(a,f);OpenLayers.Event.observe(c,"load",c._onImgLoad)}}},getSafeContentSize:function(g){var b=g.clone();var j=this.getContentDivPadding();var i=j.left+j.right;var f=j.top+j.bottom;this.fixPadding();i+=this.padding.left+this.padding.right;f+=this.padding.top+this.padding.bottom;if(this.closeDiv){var d=parseInt(this.closeDiv.style.width);i+=d+j.right}if(this.minSize){b.w=Math.max(b.w,(this.minSize.w-i));b.h=Math.max(b.h,(this.minSize.h-f))}if(this.maxSize){b.w=Math.min(b.w,(this.maxSize.w-i));b.h=Math.min(b.h,(this.maxSize.h-f))}if(this.map&&this.map.size){var a=0,e=0;if(this.keepInMap&&!this.panMapIfOutOfView){var c=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":a=c.x;e=this.map.size.h-c.y;break;case"tl":a=this.map.size.w-c.x;e=this.map.size.h-c.y;break;case"bl":a=this.map.size.w-c.x;e=c.y;break;case"br":a=c.x;e=c.y;break;default:a=c.x;e=this.map.size.h-c.y;break}}var h=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-f-e;var k=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-i-a;b.w=Math.min(b.w,k);b.h=Math.min(b.h,h)}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(c){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 a=c||function(d){this.hide();OpenLayers.Event.stop(d)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))},panIntoView:function(){var b=this.map.getSize();var e=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var a=e.clone();if(e.x<this.map.paddingForPopups.left){a.x=this.map.paddingForPopups.left}else{if((e.x+this.size.w)>(b.w-this.map.paddingForPopups.right)){a.x=b.w-this.map.paddingForPopups.right-this.size.w}}if(e.y<this.map.paddingForPopups.top){a.y=this.map.paddingForPopups.top}else{if((e.y+this.size.h)>(b.h-this.map.paddingForPopups.bottom)){a.y=b.h-this.map.paddingForPopups.bottom-this.size.h}}var d=e.x-a.x;var c=e.y-a.y;this.map.pan(d,c)},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.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,initialize:function(a){a=a||{};OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){this.options=null;this.format=null},read:function(){},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(a){},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(a){OpenLayers.Util.extend(this,a)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(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(b,a){this.extent=b.clone();if(a){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(c,b){if(b==null){b=c.style}if(c.geometry){var a=c.geometry.getBounds();if(a){if(!a.intersectsBounds(this.extent)){b={display:"none"}}var d=this.drawGeometry(c.geometry,b,c.id);if(b.display!="none"&&b.label&&d!==false){this.drawText(c.id,b,c.geometry.getCentroid())}else{this.removeText(c.id)}return d}}},drawGeometry:function(a,b,c){},drawText:function(b,a,c){},removeText:function(a){},clear:function(){},getFeatureIdFromEvent:function(a){},eraseFeatures:function(c){if(!(c instanceof Array)){c=[c]}for(var b=0,a=c.length;b<a;++b){this.eraseGeometry(c[b].geometry);this.removeText(c[b].id)}},eraseGeometry:function(a){},moveRoot:function(a){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(a){this.layer=a},activate:function(){if(!this.active){this.active=true;return true}return false},deactivate:function(){if(this.active){this.active=false;return true}return false},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(b,c,a){this.rgb={r:b,g:c,b:a}},setRed:function(a){this.rgb.r=a},setGreen:function(a){this.rgb.g=a},setBlue:function(a){this.rgb.b=a},setHue:function(a){var b=this.asHSB();b.h=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)},setSaturation:function(a){var b=this.asHSB();b.s=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)},setBrightness:function(a){var c=this.asHSB();c.b=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(c.h,c.s,c.b)},darken:function(a){var b=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,Math.max(b.b-a,0))},brighten:function(a){var b=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,Math.min(b.b+a,1))},blend:function(a){this.rgb.r=Math.floor((this.rgb.r+a.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+a.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+a.rgb.b)/2)},isBright:function(){var a=this.asHSB();return this.asHSB().b>0.5},isDark:function(){return !this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}});OpenLayers.Rico.Color.createFromHex=function(e){if(e.length==4){var f=e;var e="#";for(var d=1;d<4;d++){e+=(f.charAt(d)+f.charAt(d))}}if(e.indexOf("#")==0){e=e.substring(1)}var c=e.substring(0,2);var a=e.substring(2,4);var b=e.substring(4,6);return new OpenLayers.Rico.Color(parseInt(c,16),parseInt(a,16),parseInt(b,16))};OpenLayers.Rico.Color.createColorFromBackground=function(b){var d=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(b),"backgroundColor","background-color");if(d=="transparent"&&b.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(b.parentNode)}if(d==null){return new OpenLayers.Rico.Color(255,255,255)}if(d.indexOf("rgb(")==0){var c=d.substring(4,d.length-1);var a=c.split(",");return new OpenLayers.Rico.Color(parseInt(a[0]),parseInt(a[1]),parseInt(a[2]))}else{if(d.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(d)}else{return new OpenLayers.Rico.Color(255,255,255)}}};OpenLayers.Rico.Color.HSBtoRGB=function(i,e,d){var a=0;var b=0;var m=0;if(e==0){a=parseInt(d*255+0.5);b=a;m=a}else{var k=(i-Math.floor(i))*6;var g=k-Math.floor(k);var c=d*(1-e);var j=d*(1-e*g);var l=d*(1-(e*(1-g)));switch(parseInt(k)){case 0:a=(d*255+0.5);b=(l*255+0.5);m=(c*255+0.5);break;case 1:a=(j*255+0.5);b=(d*255+0.5);m=(c*255+0.5);break;case 2:a=(c*255+0.5);b=(d*255+0.5);m=(l*255+0.5);break;case 3:a=(c*255+0.5);b=(j*255+0.5);m=(d*255+0.5);break;case 4:a=(l*255+0.5);b=(c*255+0.5);m=(d*255+0.5);break;case 5:a=(d*255+0.5);b=(c*255+0.5);m=(j*255+0.5);break}}return{r:parseInt(a),g:parseInt(b),b:parseInt(m)}};OpenLayers.Rico.Color.RGBtoHSB=function(k,j,e){var m;var i;var h;var l=(k>j)?k:j;if(e>l){l=e}var d=(k<j)?k:j;if(e<d){d=e}h=l/255;if(l!=0){i=(l-d)/l}else{i=0}if(i==0){m=0}else{var c=(l-k)/(l-d);var a=(l-j)/(l-d);var f=(l-e)/(l-d);if(k==l){m=f-a}else{if(j==l){m=2+c-f}else{m=4+a-c}}m=m/6;if(m<0){m=m+1}}return{h:m,s:i,b:h}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(c,d,b,a){if(c!=null){this.left=OpenLayers.Util.toFloat(c)}if(d!=null){this.bottom=OpenLayers.Util.toFloat(d)}if(b!=null){this.right=OpenLayers.Util.toFloat(b)}if(a!=null){this.top=OpenLayers.Util.toFloat(a)}},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(){return[this.left,this.bottom,this.right,this.top]},toBBOX:function(c){if(c==null){c=6}var a=Math.pow(10,c);var b=Math.round(this.left*a)/a+","+Math.round(this.bottom*a)/a+","+Math.round(this.right*a)/a+","+Math.round(this.top*a)/a;return b},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(i,a){if(a==null){a=this.getCenterLonLat()}var f=[];var e,d;if(a.CLASS_NAME=="OpenLayers.LonLat"){e=a.lon;d=a.lat}else{e=a.x;d=a.y}var c=(this.left-e)*i+e;var g=(this.bottom-d)*i+d;var h=(this.right-e)*i+e;var b=(this.top-d)*i+d;return new OpenLayers.Bounds(c,g,h,b)},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(b){var a=null;if(b){switch(b.CLASS_NAME){case"OpenLayers.LonLat":a=new OpenLayers.Bounds(b.lon,b.lat,b.lon,b.lat);break;case"OpenLayers.Geometry.Point":a=new OpenLayers.Bounds(b.x,b.y,b.x,b.y);break;case"OpenLayers.Bounds":a=b;break}if(a){this.centerLonLat=null;if((this.left==null)||(a.left<this.left)){this.left=a.left}if((this.bottom==null)||(a.bottom<this.bottom)){this.bottom=a.bottom}if((this.right==null)||(a.right>this.right)){this.right=a.right}if((this.top==null)||(a.top>this.top)){this.top=a.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,d){if(d==null){d=true}if(a==null||b==null){return false}a=OpenLayers.Util.toFloat(a);b=OpenLayers.Util.toFloat(b);var c=false;if(d){c=((a>=this.left)&&(a<=this.right)&&(b>=this.bottom)&&(b<=this.top))}else{c=((a>this.left)&&(a<this.right)&&(b>this.bottom)&&(b<this.top))}return c},intersectsBounds:function(g,h){if(h==null){h=true}var b=false;var e=(this.left==g.right||this.right==g.left||this.top==g.bottom||this.bottom==g.top);if(h||!e){var d=(((g.bottom>=this.bottom)&&(g.bottom<=this.top))||((this.bottom>=g.bottom)&&(this.bottom<=g.top)));var a=(((g.top>=this.bottom)&&(g.top<=this.top))||((this.top>g.bottom)&&(this.top<g.top)));var f=(((g.left>=this.left)&&(g.left<=this.right))||((this.left>=g.left)&&(this.left<=g.right)));var c=(((g.right>=this.left)&&(g.right<=this.right))||((this.right>=g.left)&&(this.right<=g.right)));b=((d||a)&&(f||c))}return b},containsBounds:function(a,f,g){if(f==null){f=false}if(g==null){g=true}var e=this.contains(a.left,a.bottom,g);var d=this.contains(a.right,a.bottom,g);var b=this.contains(a.left,a.top,g);var c=this.contains(a.right,a.top,g);return(f)?(e||d||b||c):(e&&d&&b&&c)},determineQuadrant:function(b){var c="";var a=this.getCenterLonLat();c+=(b.lat<a.lat)?"b":"t";c+=(b.lon<a.lon)?"l":"r";return c},transform:function(d,f){this.centerLonLat=null;var c=OpenLayers.Projection.transform({"x":this.left,"y":this.bottom},d,f);var b=OpenLayers.Projection.transform({"x":this.right,"y":this.bottom},d,f);var e=OpenLayers.Projection.transform({"x":this.left,"y":this.top},d,f);var a=OpenLayers.Projection.transform({"x":this.right,"y":this.top},d,f);this.left=Math.min(c.x,e.x);this.bottom=Math.min(c.y,b.y);this.right=Math.max(b.x,a.x);this.top=Math.max(e.y,a.y);return this},wrapDateLine:function(c,d){d=d||{};var b=d.leftTolerance||0;var e=d.rightTolerance||0;var a=this.clone();if(c){while(a.left<c.left&&(a.right-e)<=c.left){a=a.add(c.getWidth(),0)}while((a.left+b)>=c.right&&a.right>c.right){a=a.add(-c.getWidth(),0)}}return a},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(b){var a=b.split(",");return OpenLayers.Bounds.fromArray(a)};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(b){var a="";a+=(b.charAt(0)=="t")?"b":"t";a+=(b.charAt(1)=="l")?"r":"l";return a};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,c){if((a==null)||(c==null)){var b=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.LonLat(this.lon+a,this.lat+c)},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(b,c){var a=OpenLayers.Projection.transform({"x":this.lon,"y":this.lat},b,c);this.lon=a.x;this.lat=a.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(b){var a=b.split(",");return new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[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:"",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=function(){return(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(b){var a;if(!b){b=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var d=b.split("-");d[0]=d[0].toLowerCase();if(typeof OpenLayers.Lang[d[0]]=="object"){a=d[0]}if(d[1]){var c=d[0]+"-"+d[1].toUpperCase();if(typeof OpenLayers.Lang[c]=="object"){a=c}}if(!a){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+d.join("-")+" dictionary, falling back to default language");a=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=a},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,d,e,f,g,h,c){var b=[a,d,e,f,h,c];OpenLayers.Popup.prototype.initialize.apply(this,b);this.anchor=(g!=null)?g:{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 c=this.relativePosition;this.relativePosition=this.calculateRelativePosition(a);var d=this.calculateNewPx(a);var b=new Array(d);OpenLayers.Popup.prototype.moveTo.apply(this,b);if(this.relativePosition!=c){this.updateRelativePosition()}},setSize:function(b){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(a)}},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 e=a.offset(this.anchor.offset);var b=this.size||this.contentSize;var d=(this.relativePosition.charAt(0)=="t");e.y+=(d)?-b.h:this.anchor.size.h;var c=(this.relativePosition.charAt(1)=="l");e.x+=(c)?-b.w:this.anchor.size.w;return e},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Protocol.SQL=OpenLayers.Class(OpenLayers.Protocol,{databaseName:"ol",tableName:"ol_vector_features",postReadFiltering:true,initialize:function(a){OpenLayers.Protocol.prototype.initialize.apply(this,[a])},destroy:function(){OpenLayers.Protocol.prototype.destroy.apply(this)},supported:function(){return false},evaluateFilter:function(a,b){return b&&this.postReadFiltering?b.evaluate(a):true},CLASS_NAME:"OpenLayers.Protocol.SQL"});OpenLayers.Protocol.WFS=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Protocol.WFS.DEFAULTS);var b=OpenLayers.Protocol.WFS["v"+a.version.replace(/\./g,"_")];if(!b){throw"Unsupported WFS version: "+a.version}return new b(a)};OpenLayers.Protocol.WFS.fromWMSLayer=function(a,e){var c,b;var d=a.params["LAYERS"];var g=(d instanceof Array?d[0]:d).split(":");if(g.length>1){b=g[0]}c=g.pop();var f={url:a.url,featureType:c,featurePrefix:b,srsName:a.projection&&a.projection.getCode()||a.map&&a.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(e,f))};OpenLayers.Protocol.WFS.DEFAULTS={"version":"1.0.0"};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(b,a){if(a==null){a=b.style}a=OpenLayers.Util.extend({"fillColor":"#000000","strokeColor":"#000000","strokeWidth":2,"fillOpacity":1,"strokeOpacity":1},a);this.features[b.id]=[b,a];if(b.geometry){this.geometryMap[b.geometry.id]=b.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(d,i){var c=new Image();c.src=i.externalGraphic;if(i.graphicTitle){c.title=i.graphicTitle}var a=i.graphicWidth||i.graphicHeight;var e=i.graphicHeight||i.graphicWidth;a=a?a:i.pointRadius*2;e=e?e:i.pointRadius*2;var b=(i.graphicXOffset!=undefined)?i.graphicXOffset:-(0.5*a);var g=(i.graphicYOffset!=undefined)?i.graphicYOffset:-(0.5*e);var f=i.graphicOpacity||i.fillOpacity;var h={img:c,x:(d[0]+b),y:(d[1]+g),width:a,height:e,canvas:this.canvas};c.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},h)},setCanvasStyle:function(b,a){if(b=="fill"){this.canvas.globalAlpha=a["fillOpacity"];this.canvas.fillStyle=a["fillColor"]}else{if(b=="stroke"){this.canvas.globalAlpha=a["strokeOpacity"];this.canvas.strokeStyle=a["strokeColor"];this.canvas.lineWidth=a["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],6,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],6,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(d,c){c=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},c);var f=this.getLocalXY(d);this.setCanvasStyle("reset");this.canvas.fillStyle=c.fontColor;this.canvas.globalAlpha=1;var a=c.fontWeight+" "+c.fontSize+" "+c.fontFamily;if(this.canvas.fillText){var b=OpenLayers.Renderer.Canvas.LABEL_ALIGN[c.labelAlign[0]]||"middle";this.canvas.font=a;this.canvas.textAlign=b;this.canvas.fillText(c.label,f[0],f[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=a;var e=this.canvas.mozMeasureText(c.label);switch(c.labelAlign[0]){case"l":break;case"r":f[0]-=e;break;case"c":default:f[0]-=e/2}this.canvas.translate(f[0],f[1]);this.canvas.mozDrawText(c.label);this.canvas.translate(-1*f[0],-1*f[1])}}this.setCanvasStyle("reset")},getLocalXY:function(e){var c=this.getResolution();var d=this.extent;var a=(e.x/c+(-d.left/c));var b=((d.top/c)-e.y/c);return[a,b]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(b){var e=this.map.getLonLatFromPixel(b.xy);var d=this.getResolution();var a=new OpenLayers.Bounds(e.lon-d*5,e.lat-d*5,e.lon+d*5,e.lat+d*5);var f=a.toGeometry();for(var c in this.features){if(!this.features.hasOwnProperty(c)){continue}if(this.features[c][0].geometry.intersects(f)){return c}}return null},eraseFeatures:function(b){if(!(b instanceof Array)){b=[b]}for(var a=0;a<b.length;++a){delete this.features[b[a].id]}this.redraw()},redraw:function(){if(!this.locked){this.clear();var d=[];var c,b;for(var e in this.features){if(!this.features.hasOwnProperty(e)){continue}c=this.features[e][0];b=this.features[e][1];if(!c.geometry){continue}this.drawGeometry(c.geometry,b);if(b.label){d.push([c,b])}}var a;for(var f=0;len=d.length,f<len;++f){a=d[f];this.drawText(a[0].geometry.getCentroid(),a[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(f){if(this.exists(f)){this.remove(f)}var e=f.id;this.determineZIndex(f);var d=-1;var b=this.order.length;var a;while(b-d>1){a=parseInt((d+b)/2);var c=this.compare(this,f,OpenLayers.Util.getElement(this.order[a]));if(c>0){d=a}else{b=a}}this.order.splice(b,0,e);this.indices[e]=this.getZIndex(f);return this.getNextElement(b)},remove:function(d){var c=d.id;var b=OpenLayers.Util.indexOf(this.order,c);if(b>=0){this.order.splice(b,1);delete this.indices[c];if(this.order.length>0){var a=this.order[this.order.length-1];this.maxZIndex=this.indices[a]}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(b){var a=b._style.graphicZIndex;if(a==null){a=this.maxZIndex;b._style.graphicZIndex=a}else{if(a>this.maxZIndex){this.maxZIndex=a}}},getNextElement:function(c){var b=c+1;if(b<this.order.length){var a=OpenLayers.Util.getElement(this.order[b]);if(a==undefined){a=this.getNextElement(b)}return a}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(a,f,c){var b=a.getZIndex(f);var d=0;if(c){var e=a.getZIndex(c);d=b-e}return d},Z_ORDER_DRAWING_ORDER:function(a,d,b){var c=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,d,b);if(b&&c==0){c=1}return c},Z_ORDER_Y_ORDER:function(a,g,d){var e=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,g,d);if(d&&e==0){var f=g._geometry.getBounds().bottom;var c=d._geometry.getBounds().bottom;var b=c-f;e=(b==0)?1:b}return e}};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(c,f,d){var h=c.CLASS_NAME;var g=true;if((h=="OpenLayers.Geometry.Collection")||(h=="OpenLayers.Geometry.MultiPoint")||(h=="OpenLayers.Geometry.MultiLineString")||(h=="OpenLayers.Geometry.MultiPolygon")){for(var a=0,e=c.components.length;a<e;a++){g=this.drawGeometry(c.components[a],f,d)&&g}return g}g=false;if(f.display!="none"){if(f.backgroundGraphic){this.redrawBackgroundNode(c.id,c,f,d)}g=this.redrawNode(c.id,c,f,d)}if(g==false){var b=document.getElementById(c.id);if(b){if(b._style.backgroundGraphic){b.parentNode.removeChild(document.getElementById(c.id+this.BACKGROUND_ID_SUFFIX))}b.parentNode.removeChild(b)}}return g},redrawNode:function(e,a,b,c){var g=this.nodeFactory(e,this.getNodeType(a,b));g._featureId=c;g._geometry=a;g._geometryClass=a.CLASS_NAME;g._style=b;var f=this.drawGeometryNode(g,a,b);if(f===false){return false}g=f.node;if(this.indexer){var d=this.indexer.insert(g);if(d){this.vectorRoot.insertBefore(g,d)}else{this.vectorRoot.appendChild(g)}}else{if(g.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(g)}}this.postDraw(g);return f.complete},redrawBackgroundNode:function(e,b,c,d){var a=OpenLayers.Util.extend({},c);a.externalGraphic=a.backgroundGraphic;a.graphicXOffset=a.backgroundXOffset;a.graphicYOffset=a.backgroundYOffset;a.graphicZIndex=a.backgroundGraphicZIndex;a.graphicWidth=a.backgroundWidth||a.graphicWidth;a.graphicHeight=a.backgroundHeight||a.graphicHeight;a.backgroundGraphic=null;a.backgroundXOffset=null;a.backgroundYOffset=null;a.backgroundGraphicZIndex=null;return this.redrawNode(e+this.BACKGROUND_ID_SUFFIX,b,a,null)},drawGeometryNode:function(e,a,b){b=b||e._style;OpenLayers.Util.applyDefaults(b,this.minimumSymbolizer);var c={"isFilled":b.fill===undefined?true:b.fill,"isStroked":b.stroke===undefined?!!b.strokeWidth:b.stroke};var d;switch(a.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.graphic===false){c.isFilled=false;c.isStroked=false}d=this.drawPoint(e,a);break;case"OpenLayers.Geometry.LineString":c.isFilled=false;d=this.drawLineString(e,a);break;case"OpenLayers.Geometry.LinearRing":d=this.drawLinearRing(e,a);break;case"OpenLayers.Geometry.Polygon":d=this.drawPolygon(e,a);break;case"OpenLayers.Geometry.Surface":d=this.drawSurface(e,a);break;case"OpenLayers.Geometry.Rectangle":d=this.drawRectangle(e,a);break;default:break}e._style=b;e._options=c;if(d!=false){return{node:this.setStyle(e,b,c,a),complete:d}}else{return false}},postDraw:function(a){},drawPoint:function(b,a){},drawLineString:function(b,a){},drawLinearRing:function(b,a){},drawPolygon:function(b,a){},drawRectangle:function(b,a){},drawCircle:function(b,a){},drawSurface:function(b,a){},removeText:function(b){var a=document.getElementById(b+this.LABEL_ID_SUFFIX);if(a){this.textRoot.removeChild(a)}},getFeatureIdFromEvent:function(b){var c=b.target;var a=c&&c.correspondingUseElement;var e=a?a:(c||b.srcElement);var d=e._featureId;return d},eraseGeometry:function(b){if((b.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(b.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(b.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(b.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var e=0,a=b.components.length;e<a;e++){this.eraseGeometry(b.components[e])}}else{var f=OpenLayers.Util.getElement(b.id);if(f&&f.parentNode){if(f.geometry){f.geometry.destroy();f.geometry=null}f.parentNode.removeChild(f);if(this.indexer){this.indexer.remove(f)}if(f._style.backgroundGraphic){var d=b.id+this.BACKGROUND_ID_SUFFIX;var c=OpenLayers.Util.getElement(d);if(c&&c.parentNode){c.parentNode.removeChild(c)}}}}},nodeFactory:function(b,a){var c=OpenLayers.Util.getElement(b);if(c){if(!this.nodeTypeCompare(c,a)){c.parentNode.removeChild(c);c=this.nodeFactory(b,a)}}else{c=this.createNode(a,b)}return c},nodeTypeCompare:function(b,a){},createNode:function(a,b){},moveRoot:function(b){var a=this.root;if(b.root.parentNode==this.rendererRoot){a=b.root}a.parentNode.removeChild(a);b.rendererRoot.appendChild(a)},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.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:false,resolution:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({"beforefeaturesadded":this.cacheFeatures,"moveend":this.cluster,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({"beforefeaturesadded":this.cacheFeatures,"moveend":this.cluster,scope:this})}return a},cacheFeatures:function(b){var a=true;if(!this.clustering){this.clearCache();this.features=b.features;this.cluster();a=false}return a},clearCache:function(){this.features=null},cluster:function(c){if((!c||c.zoomChanged)&&this.features){var g=this.layer.map.getResolution();if(g!=this.resolution||!this.clustersExist()){this.resolution=g;var k=[];var m,e,h;for(var a=0;a<this.features.length;++a){m=this.features[a];if(m.geometry){e=false;for(var b=0;b<k.length;++b){h=k[b];if(this.shouldCluster(h,m)){this.addToCluster(h,m);e=true;break}}if(!e){k.push(this.createCluster(this.features[a]))}}}this.layer.destroyFeatures();if(k.length>0){if(this.threshold>1){var f=k.slice();k=[];var d;for(var a=0,l=f.length;a<l;++a){d=f[a];if(d.attributes.count<this.threshold){Array.prototype.push.apply(k,d.cluster)}else{k.push(d)}}}this.clustering=true;this.layer.addFeatures(k);this.clustering=false}this.clusters=k}}},clustersExist:function(){var b=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){b=true;for(var a=0;a<this.clusters.length;++a){if(this.clusters[a]!=this.layer.features[a]){b=false;break}}}return b},shouldCluster:function(e,c){var b=e.geometry.getBounds().getCenterLonLat();var a=c.geometry.getBounds().getCenterLonLat();var d=(Math.sqrt(Math.pow((b.lon-a.lon),2)+Math.pow((b.lat-a.lat),2))/this.resolution);return(d<=this.distance)},addToCluster:function(b,a){b.cluster.push(a);b.attributes.count+=1},createCluster:function(b){var a=b.geometry.getBounds().getCenterLonLat();var c=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a.lon,a.lat),{count:1});c.cluster=[b];return c},CLASS_NAME:"OpenLayers.Strategy.Cluster"});OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},destroy:function(){OpenLayers.Strategy.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Strategy.prototype.activate.apply(this,arguments)){this.layer.events.on({"refresh":this.load,scope:this});if(this.layer.visibility==true||this.preload){this.load()}else{this.layer.events.on({"visibilitychanged":this.load,scope:this})}return true}return false},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({"refresh":this.load,"visibilitychanged":this.load,scope:this})}return a},load:function(a){this.layer.events.triggerEvent("loadstart");this.layer.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,scope:this},a));this.layer.events.un({"visibilitychanged":this.load,scope:this})},merge:function(g){this.layer.destroyFeatures();var b=g.features;if(b&&b.length>0){var d=this.layer.projection;var a=this.layer.map.getProjectionObject();if(!a.equals(d)){var f;for(var c=0,e=b.length;c<e;++c){f=b[c].geometry;if(f){f.transform(d,a)}}}this.layer.addFeatures(b)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({"beforefeaturesadded":this.cacheFeatures,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({"beforefeaturesadded":this.cacheFeatures,scope:this})}return a},cacheFeatures:function(a){if(!this.paging){this.clearCache();this.features=a.features;this.pageNext(a)}},clearCache:function(){if(this.features){for(var a=0;a<this.features.length;++a){this.features[a].destroy()}}this.features=null;this.num=null},pageCount:function(){var a=this.features?this.features.length:0;return Math.ceil(a/this.length)},pageNum:function(){return this.num},pageLength:function(a){if(a&&a>0){this.length=a}return this.length},pageNext:function(c){var a=false;if(this.features){if(this.num===null){this.num=-1}var b=(this.num+1)*this.length;a=this.page(b,c)}return a},pagePrevious:function(){var a=false;if(this.features){if(this.num===null){this.num=this.pageCount()}var b=(this.num-1)*this.length;a=this.page(b)}return a},page:function(c,d){var a=false;if(this.features){if(c>=0&&c<this.features.length){var e=Math.floor(c/this.length);if(e!=this.num){this.paging=true;var b=this.features.slice(c,c+this.length);this.layer.removeFeatures(this.layer.features);this.num=e;if(d&&d.features){d.features=b}else{this.layer.addFeatures(b)}this.paging=false;a=true}}}return a},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{auto:false,timer:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),this.auto*1000)}else{this.layer.events.on({"featureadded":this.triggerSave,"afterfeaturemodified":this.triggerSave,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){window.clearInterval(this.timer)}else{this.layer.events.un({"featureadded":this.triggerSave,"afterfeaturemodified":this.triggerSave,scope:this})}}}return a},triggerSave:function(b){var a=b.feature;if(a.state===OpenLayers.State.INSERT||a.state===OpenLayers.State.UPDATE||a.state===OpenLayers.State.DELETE){this.save([b.feature])}},save:function(e){if(!e){e=this.layer.features}var d=this.layer.projection;var b=this.layer.map.getProjectionObject();if(!b.equals(d)){var f=e.length;var c=new Array(f);var h,g;for(var a=0;a<f;++a){h=e[a];g=h.clone();g.fid=h.fid;g.state=h.state;g._original=h;g.geometry.transform(b,d);c[a]=g}e=c}this.layer.protocol.commit(e,{callback:this.onCommit,scope:this})},onCommit:function(d){if(d.success()){var f=d.reqFeatures;var e,h;var g=[];var k=d.insertIds||[];var b=0;for(var a=0,c=f.length;a<c;++a){h=f[a];h=h._original||h;e=h.state;if(e){if(e==OpenLayers.State.DELETE){g.push(h)}else{if(e==OpenLayers.State.INSERT){h.fid=k[b];++b}}h.state=null}}if(g.length>0){this.layer.destroyFeatures(g)}}},CLASS_NAME:"OpenLayers.Strategy.Save"});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,c,d,b){this.playing=true;this.begin=a;this.finish=c;this.duration=d;this.callbacks=b.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 g in this.begin){var d=this.begin[g];var h=this.finish[g];if(d==null||h==null||isNaN(d)||isNaN(h)){OpenLayers.Console.error("invalid value for Tween")}var e=h-d;a[g]=this.easing.apply(this,[this.time,d,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,e,f,g){return f*a/g+e},easeOut:function(a,e,f,g){return f*a/g+e},easeInOut:function(a,e,f,g){return f*a/g+e},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(a,e,f,g){return(a==0)?e:f*Math.pow(2,10*(a/g-1))+e},easeOut:function(a,e,f,g){return(a==g)?e+f:f*(-Math.pow(2,-10*a/g)+1)+e},easeInOut:function(a,e,f,g){if(a==0){return e}if(a==g){return e+f}if((a/=g/2)<1){return f/2*Math.pow(2,10*(a-1))+e}return f/2*(-Math.pow(2,-10*--a)+2)+e},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(a,e,f,g){return f*(a/=g)*a+e},easeOut:function(a,e,f,g){return -f*(a/=g)*(a-2)+e},easeInOut:function(a,e,f,g){if((a/=g/2)<1){return f/2*a*a+e}return -f/2*((--a)*(a-2)-1)+e},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(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var d=0,a=this.map.controls.length;d<a;d++){var c=this.map.controls[d];if((c!=this)&&(c.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(c.displayProjection!=this.displayProjection){this.displayProjection=c.displayProjection}break}}if(d==this.map.controls.length){var b=OpenLayers.Util.getParameters();if(b.layers){this.layers=b.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(b.lat&&b.lon){this.center=new OpenLayers.LonLat(parseFloat(b.lon),parseFloat(b.lat));if(b.zoom){this.zoom=parseInt(b.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 d=0,a=this.layers.length;d<a;d++){var e=this.map.layers[d];var b=this.layers.charAt(d);if(b=="B"){this.map.setBaseLayer(e)}else{if((b=="T")||(b=="F")){e.setVisibility(b=="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 b=[];if(this.map&&this.map.layers){for(var c=0,a=this.map.layers.length;c<a;c++){var d=this.map.layers[c];if(d.attribution&&d.getVisibility()){b.push(d.attribution)}}this.div.innerHTML=b.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:"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(e){var d=this[e+"Layers"];if(d){for(var c=0,a=d.length;c<a;c++){var b=d[c];OpenLayers.Event.stopObservingElement(b.inputElem);OpenLayers.Event.stopObservingElement(b.labelSpan)}}this[e+"LayersDiv"].innerHTML="";this[e+"Layers"]=[]},checkRedraw:function(){var b=false;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){b=true}else{for(var c=0,a=this.layerStates.length;c<a;c++){var e=this.layerStates[c];var d=this.map.layers[c];if((e.name!=d.name)||(e.inRange!=d.inRange)||(e.id!=d.id)||(e.visibility!=d.visibility)){b=true;break}}}return b},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var d=false;var m=false;var o=this.map.layers.length;this.layerStates=new Array(o);for(var a=0;a<o;a++){var c=this.map.layers[a];this.layerStates[a]={"name":c.name,"visibility":c.visibility,"inRange":c.inRange,"id":c.id}}var k=this.map.layers.slice();if(!this.ascending){k.reverse()}for(var a=0,o=k.length;a<o;a++){var c=k[a];var f=c.isBaseLayer;if(c.displayInLayerSwitcher){if(f){m=true}else{d=true}var g=(f)?(c==this.map.baseLayer):c.getVisibility();var e=document.createElement("input");e.id=this.id+"_input_"+c.name;e.name=(f)?"baseLayers":c.name;e.type=(f)?"radio":"checkbox";e.value=c.name;e.checked=g;e.defaultChecked=g;if(!f&&!c.inRange){e.disabled=true}var j={"inputElem":e,"layer":c,"layerSwitcher":this};OpenLayers.Event.observe(e,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,j));var l=document.createElement("span");if(!f&&!c.inRange){l.style.color="gray"}l.innerHTML=c.name;l.style.verticalAlign=(f)?"bottom":"baseline";OpenLayers.Event.observe(l,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,j));var h=document.createElement("br");var b=(f)?this.baseLayers:this.dataLayers;b.push({"layer":c,"inputElem":e,"labelSpan":l});var p=(f)?this.baseLayersDiv:this.dataLayersDiv;p.appendChild(e);p.appendChild(l);p.appendChild(h)}}this.dataLbl.style.display=(d)?"":"none";this.baseLbl.style.display=(m)?"":"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 b=0,a=this.baseLayers.length;b<a;b++){var c=this.baseLayers[b];if(c.inputElem.checked){this.map.setBaseLayer(c.layer,false)}}for(var b=0,a=this.dataLayers.length;b<a;b++){var c=this.dataLayers[b];c.layer.setVisibility(c.inputElem.checked)}},maximizeControl:function(a){this.div.style.width="20em";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(){this.div.style.position="absolute";this.div.style.top="25px";this.div.style.right="0px";this.div.style.left="";this.div.style.fontFamily="sans-serif";this.div.style.fontWeight="bold";this.div.style.marginTop="3px";this.div.style.marginLeft="3px";this.div.style.marginBottom="3px";this.div.style.fontSize="smaller";this.div.style.color="white";this.div.style.backgroundColor="transparent";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";this.layersDiv.style.paddingTop="5px";this.layersDiv.style.paddingLeft="10px";this.layersDiv.style.paddingBottom="5px";this.layersDiv.style.paddingRight="75px";this.layersDiv.style.backgroundColor=this.activeColor;this.layersDiv.style.width="100%";this.layersDiv.style.height="100%";this.baseLbl=document.createElement("div");this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");this.baseLbl.style.marginTop="3px";this.baseLbl.style.marginLeft="3px";this.baseLbl.style.marginBottom="3px";this.baseLayersDiv=document.createElement("div");this.baseLayersDiv.style.paddingLeft="10px";this.dataLbl=document.createElement("div");this.dataLbl.innerHTML=OpenLayers.i18n("overlays");this.dataLbl.style.marginTop="3px";this.dataLbl.style.marginLeft="3px";this.dataLbl.style.marginBottom="3px";this.dataLayersDiv=document.createElement("div");this.dataLayersDiv.style.paddingLeft="10px";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);OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.activeColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);var b=OpenLayers.Util.getImagesLocation();var c=new OpenLayers.Size(18,18);var a=b+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,c,a,"absolute");this.maximizeDiv.style.top="5px";this.maximizeDiv.style.right="0px";this.maximizeDiv.style.left="";this.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var a=b+"layer-switcher-minimize.png";var c=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,c,a,"absolute");this.minimizeDiv.style.top="5px";this.minimizeDiv.style.right="0px";this.minimizeDiv.style.left="";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.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;this.map.events.un({"click":this.defaultClick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope:this});OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.map.events.on({"click":this.defaultClick,"dblclick":this.defaultDblClick,"mousedown":this.defaultMouseDown,"mouseup":this.defaultMouseUp,"mousemove":this.defaultMouseMove,"mouseout":this.defaultMouseOut,scope:this});this.registerWheelEvents()},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)},defaultClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var b=!this.performedDrag;this.performedDrag=false;return b},defaultDblClick:function(a){var b=this.map.getLonLatFromViewPortPx(a.xy);this.map.setCenter(b,this.map.zoom+1);OpenLayers.Event.stop(a);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;if(a.shiftKey){this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox)}document.onselectstart=function(){return false};OpenLayers.Event.stop(a)},defaultMouseMove:function(b){this.mousePosition=b.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var f=Math.abs(this.mouseDragStart.x-b.xy.x);var d=Math.abs(this.mouseDragStart.y-b.xy.y);this.zoomBox.style.width=Math.max(1,f)+"px";this.zoomBox.style.height=Math.max(1,d)+"px";if(b.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=b.xy.x+"px"}if(b.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=b.xy.y+"px"}}else{var f=this.mouseDragStart.x-b.xy.x;var d=this.mouseDragStart.y-b.xy.y;var a=this.map.getSize();var e=new OpenLayers.Pixel(a.w/2+f,a.h/2+d);var c=this.map.getLonLatFromViewPortPx(e);this.map.setCenter(c,null,true);this.mouseDragStart=b.xy.clone();this.map.div.style.cursor="move"}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.zoomBox){this.zoomBoxEnd(a)}else{if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor=""},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox()}this.mouseDragStart=null}},defaultWheelUp:function(a){if(this.map.getZoom()<=this.map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()+1)}},defaultWheelDown:function(a){if(this.map.getZoom()>0){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()-1)}},zoomBoxEnd:function(b){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-b.xy.x)>5||Math.abs(this.mouseDragStart.y-b.xy.y)>5){var g=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var d=this.map.getLonLatFromViewPortPx(b.xy);var c=Math.max(g.lat,d.lat);var f=Math.min(g.lat,d.lat);var a=Math.min(g.lon,d.lon);var h=Math.max(g.lon,d.lon);var e=new OpenLayers.Bounds(a,f,h,c);this.map.zoomToExtent(e)}else{var d=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(new OpenLayers.LonLat((d.lon),(d.lat)),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(d){var a=false;var b=OpenLayers.Event.element(d);while(b!=null){if(this.map&&b==this.map.div){a=true;break}b=b.parentNode}if(a){var c=0;if(!d){d=window.event}if(d.wheelDelta){c=d.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){c=-c}}else{if(d.detail){c=-d.detail/3}}if(c){d.xy=this.mousePosition;if(c<0){this.defaultWheelDown(d)}else{this.defaultWheelUp(d)}}OpenLayers.Event.stop(d)}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.map){this.map.events.unregister("mousemove",this,this.redraw)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}this.redraw();return this.div},redraw:function(b){var c;if(b==null){c=new OpenLayers.LonLat(0,0)}else{if(this.lastXy==null||Math.abs(b.xy.x-this.lastXy.x)>this.granularity||Math.abs(b.xy.y-this.lastXy.y)>this.granularity){this.lastXy=b.xy;return}c=this.map.getLonLatFromPixel(b.xy);if(!c){return}if(this.displayProjection){c.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=b.xy}var a=this.formatOutput(c);if(a!=this.element.innerHTML){this.element.innerHTML=a}},formatOutput:function(c){var b=parseInt(this.numDigits);var a=this.prefix+c.lon.toFixed(b)+this.separator+c.lat.toFixed(b)+this.suffix;return a},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("mousemove",this,this.redraw)},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(a,b){this.direction=a;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[b])},trigger:function(){switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,this.slideFactor);break;case OpenLayers.Control.Pan.WEST:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(this.slideFactor,0);break}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";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 c=new OpenLayers.Size(18,18);var b=new OpenLayers.Pixel(a.x+c.w/2,a.y);this._addButton("panup","north-mini.png",b,c);a.y=b.y+c.h;this._addButton("panleft","west-mini.png",a,c);this._addButton("panright","east-mini.png",a.add(c.w,0),c);this._addButton("pandown","south-mini.png",b.add(0,c.h*2),c);this._addButton("zoomin","zoom-plus-mini.png",b.add(0,c.h*3+5),c);this._addButton("zoomworld","zoom-world-mini.png",b.add(0,c.h*4+5),c);this._addButton("zoomout","zoom-minus-mini.png",b.add(0,c.h*5+5),c);return this.div},_addButton:function(a,b,g,f){var c=OpenLayers.Util.getImagesLocation()+b;var d=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,g,f,c,"absolute");this.div.appendChild(d);OpenLayers.Event.observe(d,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,d));OpenLayers.Event.observe(d,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,d));OpenLayers.Event.observe(d,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,d));d.action=a;d.map=this.map;if(!this.slideRatio){var i=this.slideFactor;var e=function(){return i}}else{var h=this.slideRatio;var e=function(j){return this.map.getSize()[j]*h}}d.getSlideFactor=e;this.buttons.push(d);return d},_removeButton:function(a){OpenLayers.Event.stopObservingElement(a);a.map=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.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.controls=[]},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var a=this.controls.length-1;a>=0;a--){if(this.controls[a].events){this.controls[a].events.un({"activate":this.redraw,"deactivate":this.redraw,scope:this})}OpenLayers.Event.stopObservingElement(this.controls[a].panel_div);this.controls[a].panel_div=null}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]==this.defaultControl){this.controls[b].activate()}}this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){this.controls[b].deactivate()}return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var b=0,a=this.controls.length;b<a;b++){this.map.addControl(this.controls[b]);this.controls[b].deactivate();this.controls[b].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this})}this.activate();return this.div},redraw:function(){this.div.innerHTML="";if(this.active){for(var b=0,a=this.controls.length;b<a;b++){var c=this.controls[b].panel_div;if(this.controls[b].active){c.className=this.controls[b].displayClass+"ItemActive"}else{c.className=this.controls[b].displayClass+"ItemInactive"}this.div.appendChild(c)}}},activateControl:function(b){if(!this.active){return false}if(b.type==OpenLayers.Control.TYPE_BUTTON){b.trigger();this.redraw();return}if(b.type==OpenLayers.Control.TYPE_TOGGLE){if(b.active){b.deactivate()}else{b.activate()}this.redraw();return}for(var c=0,a=this.controls.length;c<a;c++){if(this.controls[c]!=b){if(this.controls[c].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[c].deactivate()}}}b.activate()},addControls:function(d){if(!(d instanceof Array)){d=[d]}this.controls=this.controls.concat(d);for(var c=0,a=d.length;c<a;c++){var e=document.createElement("div");var b=document.createTextNode(" ");d[c].panel_div=e;if(d[c].title!=""){d[c].panel_div.title=d[c].title}OpenLayers.Event.observe(d[c].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,d[c]));OpenLayers.Event.observe(d[c].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var c=0,a=d.length;c<a;c++){this.map.addControl(d[c]);d[c].deactivate();d[c].events.on({"activate":this.redraw,"deactivate":this.redraw,scope:this})}this.redraw()}},onClick:function(b,a){OpenLayers.Event.stop(a?a:window.event);this.activateControl(b)},getControlsBy:function(b,a){var c=(typeof a.test=="function");var d=OpenLayers.Array.filter(this.controls,function(e){return e[b]==a||(c&&a.test(e[b]))});return d},getControlsByName:function(a){return this.getControlsBy("name",a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.element=OpenLayers.Util.getElement(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.element=document.createElement("div");this.div.appendChild(this.element)}this.map.events.register("moveend",this,this.updateScale);this.updateScale();return this.div},updateScale:function(){var a=this.map.getScale();if(!a){return}if(a>=9500&&a<=950000){a=Math.round(a/1000)+"K"}else{if(a>=950000){a=Math.round(a/1000000)+"M"}else{a=Math.round(a)}}this.element.innerHTML=OpenLayers.i18n("scale",{"scaleDenom":a})},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.div.style.display="block";this.div.style.position="absolute";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(b){var a=parseInt(Math.log(b)/Math.log(10));var c=Math.pow(10,a);var e=parseInt(b/c);var d;if(e>5){d=5}else{if(e>2){d=2}else{d=1}}return d*c},update:function(){var a=this.map.getResolution();if(!a){return}var d=this.map.getUnits();var e=OpenLayers.INCHES_PER_UNIT;var c=this.maxWidth*a*e[d];var i;var g;if(c>100000){i=this.topOutUnits;g=this.bottomOutUnits}else{i=this.topInUnits;g=this.bottomInUnits}var h=c/e[i];var b=c/e[g];var k=this.getBarLen(h);var j=this.getBarLen(b);h=k/e[d]*e[i];b=j/e[d]*e[g];var l=h/a;var f=b/a;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(f)+"px";this.eBottom.innerHTML=j+" "+g}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(l)+"px";this.eTop.innerHTML=k+" "+i}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){this.map.zoomToMaxExtent()}},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});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,c){var b=OpenLayers.Event.element(a);while(b.parentNode&&(!b.tagName||(b.tagName.toUpperCase()!=c.toUpperCase()))){b=b.parentNode}return b},observe:function(e,a,c,d){var f=OpenLayers.Util.getElement(e);d=d||false;if(a=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||f.attachEvent)){a="keydown"}if(!this.observers){this.observers={}}if(!f._eventCacheID){var g="eventCacheID_";if(f.id){g=f.id+"_"+g}f._eventCacheID=OpenLayers.Util.createUniqueID(g)}var b=f._eventCacheID;if(!this.observers[b]){this.observers[b]=[]}this.observers[b].push({"element":f,"name":a,"observer":c,"useCapture":d});if(f.addEventListener){f.addEventListener(a,c,d)}else{if(f.attachEvent){f.attachEvent("on"+a,c)}}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var c=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[c])},_removeElementObservers:function(b){if(b){for(var e=b.length-1;e>=0;e--){var a=b[e];var c=new Array(a.element,a.name,a.observer,a.useCapture);var d=OpenLayers.Event.stopObserving.apply(this,c)}}},stopObserving:function(h,f,e,b){b=b||false;var c=OpenLayers.Util.getElement(h);var k=c._eventCacheID;if(f=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||c.detachEvent){f="keydown"}}var a=false;var d=OpenLayers.Event.observers[k];if(d){var g=0;while(!a&&g<d.length){var j=d[g];if((j.name==f)&&(j.observer==e)&&(j.useCapture==b)){d.splice(g,1);if(d.length==0){delete OpenLayers.Event.observers[k]}a=true;break}g++}}if(a){if(c.removeEventListener){c.removeEventListener(f,e,b)}else{if(c&&c.detachEvent){c.detachEvent("on"+f,e)}}}return a},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var b in OpenLayers.Event.observers){var a=OpenLayers.Event.observers[b];OpenLayers.Event._removeElementObservers.apply(this,[a])}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(d,f,e,b,g){OpenLayers.Util.extend(this,g);this.object=d;this.fallThrough=b;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(e!=null){for(var c=0,a=e.length;c<a;c++){this.addEventType(e[c])}}if(f!=null){this.attachToElement(f)}},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(d){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=d;for(var b=0,a=this.BROWSER_EVENTS.length;b<a;b++){var c=this.BROWSER_EVENTS[b];this.addEventType(c);OpenLayers.Event.observe(d,c,this.eventHandler)}OpenLayers.Event.observe(d,"dragstart",OpenLayers.Event.stop)},on:function(b){for(var a in b){if(a!="scope"){this.register(a,b.scope,b[a])}}},register:function(b,d,c){if((c!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,b)!=-1)){if(d==null){d=this.object}var a=this.listeners[b];a.push({obj:d,func:c})}},registerPriority:function(b,d,c){if(c!=null){if(d==null){d=this.object}var a=this.listeners[b];if(a!=null){a.unshift({obj:d,func:c})}}},un:function(b){for(var a in b){if(a!="scope"){this.unregister(a,b.scope,b[a])}}},unregister:function(c,f,d){if(f==null){f=this.object}var b=this.listeners[c];if(b!=null){for(var e=0,a=b.length;e<a;e++){if(b[e].obj==f&&b[e].func==d){b.splice(e,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(e,d){var c=this.listeners[e];if(!c||c.length==0){return}if(d==null){d={}}d.object=this.object;d.element=this.element;if(!d.type){d.type=e}var c=c.slice(),b;for(var f=0,a=c.length;f<a;f++){var g=c[f];b=g.func.apply(g.obj,[d]);if((b!=undefined)&&(b==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(d,true)}return b},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}","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(f,c,a,e,b,g,d){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 b=this.getCornersToRound(this.relativePosition);var a={corners:b,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,a);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,a);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var b=["tl","tr","bl","br"];var a=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(b,a);return b.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,initialize:function(f,c,a,e,b,g,d){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePosition){this.updateRelativePosition();this.calculateRelativePosition=function(h){return this.relativePosition}}this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(g){this.closeDiv.style.zIndex=1}this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePosition=false;this.positionBlocks=null;for(var b=0;b<this.blocks.length;b++){var a=this.blocks[b];if(a.image){a.div.removeChild(a.image)}a.image=null;if(a.div){this.groupDiv.removeChild(a.div)}a.div=null}this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(a){},setBorder:function(){},setOpacity:function(a){},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var a=this.getContentDivPadding();this.closeDiv.style.right=a.right+this.padding.right+"px";this.closeDiv.style.top=a.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(a){var b=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);b=b.offset(this.positionBlocks[this.relativePosition].offset);return b},createBlocks:function(){this.blocks=[];var f=null;for(var d in this.positionBlocks){f=d;break}var c=this.positionBlocks[f];for(var a=0;a<c.blocks.length;a++){var b={};this.blocks.push(b);var h=this.id+"_FrameDecorationDiv_"+a;b.div=OpenLayers.Util.createDiv(h,null,null,null,"absolute",null,"hidden",null);var g=this.id+"_FrameDecorationImg_"+a;var e=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;b.image=e(g,null,this.imageSize,this.imageSrc,"absolute",null,null,null);b.div.appendChild(b.image);this.groupDiv.appendChild(b.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var f=this.positionBlocks[this.relativePosition];for(var a=0;a<f.blocks.length;a++){var e=f.blocks[a];var c=this.blocks[a];var d=e.anchor.left;var g=e.anchor.bottom;var j=e.anchor.right;var k=e.anchor.top;var m=(isNaN(e.size.w))?this.size.w-(j+d):e.size.w;var o=(isNaN(e.size.h))?this.size.h-(g+k):e.size.h;c.div.style.width=(m<0?0:m)+"px";c.div.style.height=(o<0?0:o)+"px";c.div.style.left=(d!=null)?d+"px":"";c.div.style.bottom=(g!=null)?g+"px":"";c.div.style.right=(j!=null)?j+"px":"";c.div.style.top=(k!=null)?k+"px":"";c.image.style.left=e.position.x+"px";c.image.style.top=e.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(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,c,b){if(!OpenLayers.Projection.transforms[a]){OpenLayers.Projection.transforms[a]={}}OpenLayers.Projection.transforms[a][c]=b};OpenLayers.Projection.transform=function(c,b,a){if(b.proj&&a.proj){c=Proj4js.transform(b.proj,a.proj,c)}else{if(b&&a&&OpenLayers.Projection.transforms[b.getCode()]&&OpenLayers.Projection.transforms[b.getCode()][a.getCode()]){OpenLayers.Projection.transforms[b.getCode()][a.getCode()](c)}}return c};OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,initialize:function(b){OpenLayers.Protocol.prototype.initialize.apply(this,[b]);if(!b.format){this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))}if(!this.featureNS){var a=this.format.readNode;this.format.readNode=function(d,c){if(!this.featureNS&&d.prefix==this.featurePrefix){this.featureNS=d.namespaceURI;this.setNamespace("feature",this.featureNS)}return a.apply(this,arguments)}}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy()}this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(a,b,c){return OpenLayers.Function.bind(function(){a.apply(this,[b,c])},this)},read:function(b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options||{});var a=new OpenLayers.Protocol.Response({requestType:"read"});var c=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",b)]);a.priv=OpenLayers.Request.POST({url:b.url,callback:this.createCallback(this.handleRead,a,b),params:b.params,headers:b.headers,data:c});return a},handleRead:function(a,c){if(c.callback){var b=a.priv;if(b.status>=200&&b.status<300){a.features=this.parseFeatures(b);a.code=OpenLayers.Protocol.Response.SUCCESS}else{a.code=OpenLayers.Protocol.Response.FAILURE}c.callback.call(c.scope,a)}},parseFeatures:function(b){var a=b.responseXML;if(!a||!a.documentElement){a=b.responseText}if(!a||a.length<=0){return null}return this.format.read(a)},commit:function(c,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);var a=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:c});a.priv=OpenLayers.Request.POST({url:b.url,data:this.format.write(c,b),callback:this.createCallback(this.handleCommit,a,b)});return a},handleCommit:function(b,d){if(d.callback){var c=b.priv;var e=c.responseXML;if(!e||!e.documentElement){e=c.responseText}var a=this.format.read(e)||{};b.insertIds=a.insertIds||[];b.code=(a.success)?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;d.callback.call(d.scope,b)}},filterDelete:function(f,e){e=OpenLayers.Util.extend({},e);OpenLayers.Util.applyDefaults(e,this.options);var b=new OpenLayers.Protocol.Response({requestType:"commit"});var a=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});var d=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(e.featureNS?this.featurePrefix+":":"")+e.featureType}});if(e.featureNS){d.setAttribute("xmlns:"+this.featurePrefix,e.featureNS)}var c=this.format.writeNode("ogc:Filter",f);d.appendChild(c);a.appendChild(d);var g=OpenLayers.Format.XML.prototype.write.apply(this.format,[a]);return OpenLayers.Request.POST({url:this.url,callback:e.callback||function(){},data:g})},abort:function(a){if(a){a.priv.abort()}},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},isGecko:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.isGecko=(navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var 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,e){var d=a+(e?0:this.translationParameters.x);var c=b+(e?0:this.translationParameters.y);return(d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL&&c>=-this.MAX_PIXEL&&c<=this.MAX_PIXEL)},setExtent:function(e,b){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var f=this.getResolution();var d=-e.left/f;var c=e.top/f;if(b){this.left=d;this.top=c;var g="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",g);this.translate(0,0);return true}else{var a=this.translate(d-this.left,c-this.top);if(!a){this.setExtent(e,true)}return a}},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(b,c){var a=null;switch(b.CLASS_NAME){case"OpenLayers.Geometry.Point":if(c.externalGraphic){a="image"}else{if(this.isComplexSymbol(c.graphicName)){a="use"}else{a="circle"}}break;case"OpenLayers.Geometry.Rectangle":a="rect";break;case"OpenLayers.Geometry.LineString":a="polyline";break;case"OpenLayers.Geometry.LinearRing":a="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="path";break;default:break}return a},setStyle:function(f,j,g){j=j||f._style;g=g||f._options;var d=parseFloat(f.getAttributeNS(null,"r"));var b=1;var s;if(f._geometryClass=="OpenLayers.Geometry.Point"&&d){f.style.visibility="";if(j.graphic===false){f.style.visibility="hidden"}else{if(j.externalGraphic){s=this.getPosition(f);if(j.graphicTitle){f.setAttributeNS(null,"title",j.graphicTitle)}if(j.graphicWidth&&j.graphicHeight){f.setAttributeNS(null,"preserveAspectRatio","none")}var h=j.graphicWidth||j.graphicHeight;var c=j.graphicHeight||j.graphicWidth;h=h?h:j.pointRadius*2;c=c?c:j.pointRadius*2;var l=(j.graphicXOffset!=undefined)?j.graphicXOffset:-(0.5*h);var a=(j.graphicYOffset!=undefined)?j.graphicYOffset:-(0.5*c);var o=j.graphicOpacity||j.fillOpacity;f.setAttributeNS(null,"x",(s.x+l).toFixed());f.setAttributeNS(null,"y",(s.y+a).toFixed());f.setAttributeNS(null,"width",h);f.setAttributeNS(null,"height",c);f.setAttributeNS(this.xlinkns,"href",j.externalGraphic);f.setAttributeNS(null,"style","opacity: "+o)}else{if(this.isComplexSymbol(j.graphicName)){var m=j.pointRadius*3;var i=m*2;var k=this.importSymbol(j.graphicName);var e="#"+k;s=this.getPosition(f);b=this.symbolSize[k]/i;var t=f.parentNode;var q=f.nextSibling;if(t){t.removeChild(f)}f.setAttributeNS(this.xlinkns,"href",e);f.setAttributeNS(null,"width",i);f.setAttributeNS(null,"height",i);f.setAttributeNS(null,"x",s.x-m);f.setAttributeNS(null,"y",s.y-m);if(q){t.insertBefore(f,q)}else{if(t){t.appendChild(f)}}}else{f.setAttributeNS(null,"r",j.pointRadius)}}}if(typeof j.rotation!="undefined"&&s){var p=OpenLayers.String.format("rotate(${0} ${1} ${2})",[j.rotation,s.x,s.y]);f.setAttributeNS(null,"transform",p)}}if(g.isFilled){f.setAttributeNS(null,"fill",j.fillColor);f.setAttributeNS(null,"fill-opacity",j.fillOpacity)}else{f.setAttributeNS(null,"fill","none")}if(g.isStroked){f.setAttributeNS(null,"stroke",j.strokeColor);f.setAttributeNS(null,"stroke-opacity",j.strokeOpacity);f.setAttributeNS(null,"stroke-width",j.strokeWidth*b);f.setAttributeNS(null,"stroke-linecap",j.strokeLinecap);f.setAttributeNS(null,"stroke-linejoin","round");f.setAttributeNS(null,"stroke-dasharray",this.dashStyle(j,b))}else{f.setAttributeNS(null,"stroke","none")}if(j.pointerEvents){f.setAttributeNS(null,"pointer-events",j.pointerEvents)}if(j.cursor!=null){f.setAttributeNS(null,"cursor",j.cursor)}return f},dashStyle:function(b,c){var a=b.strokeWidth*c;switch(b.strokeDashstyle){case"solid":return"none";case"dot":return[1,4*a].join();case"dash":return[4*a,4*a].join();case"dashdot":return[4*a,4*a,1,4*a].join();case"longdash":return[8*a,4*a].join();case"longdashdot":return[8*a,4*a,1,4*a].join();default:return b.strokeDashstyle.replace(/ /g,",")}},createNode:function(a,b){var c=document.createElementNS(this.xmlns,a);if(b){c.setAttributeNS(null,"id",b)}return c},nodeTypeCompare:function(b,a){return(a==b.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(b,a){return this.drawCircle(b,a,1)},drawCircle:function(f,b,a){var d=this.getResolution();var e=(b.x/d+this.left);var c=(this.top-b.y/d);if(this.inValidRange(e,c)){f.setAttributeNS(null,"cx",e);f.setAttributeNS(null,"cy",c);f.setAttributeNS(null,"r",a);return f}else{return false}},drawLineString:function(c,a){var b=this.getComponentsString(a.components);if(b.path){c.setAttributeNS(null,"points",b.path);return(b.complete?c:null)}else{return false}},drawLinearRing:function(c,a){var b=this.getComponentsString(a.components);if(b.path){c.setAttributeNS(null,"points",b.path);return(b.complete?c:null)}else{return false}},drawPolygon:function(b,e){var f="";var h=true;var a=true;var k,i;for(var g=0,c=e.components.length;g<c;g++){f+=" M";k=this.getComponentsString(e.components[g].components," ");i=k.path;if(i){f+=" "+i;a=k.complete&&a}else{h=false}}f+=" z";if(h){b.setAttributeNS(null,"d",f);b.setAttributeNS(null,"fill-rule","evenodd");return a?b:null}else{return false}},drawRectangle:function(e,a){var c=this.getResolution();var d=(a.x/c+this.left);var b=(this.top-a.y/c);if(this.inValidRange(d,b)){e.setAttributeNS(null,"x",d);e.setAttributeNS(null,"y",b);e.setAttributeNS(null,"width",a.width/c);e.setAttributeNS(null,"height",a.height/c);return e}else{return false}},drawSurface:function(h,b){var g=null;var f=true;for(var c=0,a=b.components.length;c<a;c++){if((c%3)==0&&(c/3)==0){var e=this.getShortString(b.components[c]);if(!e){f=false}g="M "+e}else{if((c%3)==1){var e=this.getShortString(b.components[c]);if(!e){f=false}g+=" C "+e}else{var e=this.getShortString(b.components[c]);if(!e){f=false}g+=" "+e}}}g+=" Z";if(f){h.setAttributeNS(null,"d",g);return h}else{return false}},drawText:function(g,i,d){var f=this.getResolution();var c=(d.x/f+this.left);var a=(d.y/f-this.top);var h=this.nodeFactory(g+this.LABEL_ID_SUFFIX,"text");var e=this.nodeFactory(g+this.LABEL_ID_SUFFIX+"_tspan","tspan");h.setAttributeNS(null,"x",c);h.setAttributeNS(null,"y",-a);h.setAttributeNS(null,"pointer-events","none");if(i.fontColor){h.setAttributeNS(null,"fill",i.fontColor)}if(i.fontFamily){h.setAttributeNS(null,"font-family",i.fontFamily)}if(i.fontSize){h.setAttributeNS(null,"font-size",i.fontSize)}if(i.fontWeight){h.setAttributeNS(null,"font-weight",i.fontWeight)}var b=i.labelAlign||"cm";h.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[b[0]]||"middle");if(this.isGecko){h.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[b[1]]||"central")}else{e.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[b[1]]||"-35%")}e.textContent=i.label;if(!h.parentNode){h.appendChild(e);this.textRoot.appendChild(h)}},getComponentsString:function(k,g){var h=[];var a=true;var l=k.length;var d=[];var f,c,b;for(var e=0;e<l;e++){c=k[e];h.push(c);f=this.getShortString(c);if(f){d.push(f)}else{if(e>0){if(this.getShortString(k[e-1])){d.push(this.clipLine(k[e],k[e-1]))}}if(e<l-1){if(this.getShortString(k[e+1])){d.push(this.clipLine(k[e],k[e+1]))}}a=false}}return{path:d.join(g||","),complete:a}},clipLine:function(b,c){if(c.equals(b)){return""}var e=this.getResolution();var d=this.MAX_PIXEL-this.translationParameters.x;var h=this.MAX_PIXEL-this.translationParameters.y;var i=c.x/e+this.left;var j=this.top-c.y/e;var f=b.x/e+this.left;var g=this.top-b.y/e;var a;if(f<-d||f>d){a=(g-j)/(f-i);f=f<0?-d:d;g=j+(f-i)*a}if(g<-h||g>h){a=(f-i)/(g-j);g=g<0?-h:h;f=i+(g-j)*a}return f+","+g},getShortString:function(d){var c=this.getResolution();var a=(d.x/c+this.left);var b=(this.top-d.y/c);if(this.inValidRange(a,b)){return a+","+b}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(f){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+f;if(document.getElementById(b)!=null){return b}var h=OpenLayers.Renderer.symbol[f];if(!h){throw new Error(f+" is not a valid symbol name");return}var j=this.nodeFactory(b,"symbol");var g=this.nodeFactory(null,"polygon");j.appendChild(g);var m=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var k="";var d,e;for(var a=0;a<h.length;a=a+2){d=h[a];e=h[a+1];m.left=Math.min(m.left,d);m.bottom=Math.min(m.bottom,e);m.right=Math.max(m.right,d);m.top=Math.max(m.top,e);k+=" "+d+","+e}g.setAttributeNS(null,"points",k);var c=m.getWidth();var o=m.getHeight();var l=[m.left-c,m.bottom-o,c*3,o*3];j.setAttributeNS(null,"viewBox",l.join(" "));this.symbolSize[b]=Math.max(c,o)*3;this.defs.appendChild(j);return j.id},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.SVG.LABEL_ALIGN={"l":"start","r":"end","b":"bottom","t":"hanging"};OpenLayers.Renderer.SVG.LABEL_VSHIFT={"t":"-70%","b":"0"};OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(b){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var e=document.createStyleSheet();var c=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var d=0,a=c.length;d<a;d++){e.addRule("olv\\:"+c[d],"behavior: url(#default#VML); "+"position: absolute; display: inline-block;")}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.offset={x:0,y:0}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return !!(document.namespaces)},setExtent:function(h,f){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var k=this.getResolution();var e=h.left/k;var d=h.top/k-this.size.h;if(f){this.offset={x:e,y:d};e=0;d=0}else{e=e-this.offset.x;d=d-this.offset.y}var c=e+" "+d;this.root.coordorigin=c;var g=[this.root,this.vectorRoot,this.textRoot];var b;for(var a=0,l=g.length;a<l;++a){b=g[a];var j=this.size.w+" "+this.size.h;b.coordsize=j}this.root.style.flip="y";return true},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var e=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var d=this.size.w+"px";var b=this.size.h+"px";var c;for(var f=0,g=e.length;f<g;++f){c=e[f];c.style.width=d;c.style.height=b}},getNodeType:function(b,c){var a=null;switch(b.CLASS_NAME){case"OpenLayers.Geometry.Point":if(c.externalGraphic){a="olv:rect"}else{if(this.isComplexSymbol(c.graphicName)){a="olv:shape"}else{a="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":a="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="olv:shape";break;default:break}return a},setStyle:function(b,o,a,e){o=o||b._style;a=a||b._options;var f=1;if(b._geometryClass=="OpenLayers.Geometry.Point"){if(o.externalGraphic){if(o.graphicTitle){b.title=o.graphicTitle}var c=o.graphicWidth||o.graphicHeight;var h=o.graphicHeight||o.graphicWidth;c=c?c:o.pointRadius*2;h=h?h:o.pointRadius*2;var k=this.getResolution();var i=(o.graphicXOffset!=undefined)?o.graphicXOffset:-(0.5*c);var l=(o.graphicYOffset!=undefined)?o.graphicYOffset:-(0.5*h);b.style.left=((e.x/k-this.offset.x)+i).toFixed();b.style.top=((e.y/k-this.offset.y)-(l+h)).toFixed();b.style.width=c+"px";b.style.height=h+"px";b.style.flip="y";o.fillColor="none";a.isStroked=false}else{if(this.isComplexSymbol(o.graphicName)){var m=this.importSymbol(o.graphicName);b.path=m.path;b.coordorigin=m.left+","+m.bottom;var g=m.size;b.coordsize=g+","+g;this.drawCircle(b,e,o.pointRadius);b.style.flip="y"}else{this.drawCircle(b,e,o.pointRadius)}}}if(a.isFilled){b.fillcolor=o.fillColor}else{b.filled="false"}var q=b.getElementsByTagName("fill");var p=(q.length==0)?null:q[0];if(!a.isFilled){if(p){b.removeChild(p)}}else{if(!p){p=this.createNode("olv:fill",b.id+"_fill")}p.opacity=o.fillOpacity;if(b._geometryClass=="OpenLayers.Geometry.Point"&&o.externalGraphic){if(o.graphicOpacity){p.opacity=o.graphicOpacity}p.src=o.externalGraphic;p.type="frame";if(!(o.graphicWidth&&o.graphicHeight)){p.aspect="atmost"}}if(p.parentNode!=b){b.appendChild(p)}}if(typeof o.rotation!="undefined"){if(o.externalGraphic){this.graphicRotate(b,i,l);p.opacity=0}else{b.style.rotation=o.rotation}}if(a.isStroked){b.strokecolor=o.strokeColor;b.strokeweight=o.strokeWidth+"px"}else{b.stroked=false}var j=b.getElementsByTagName("stroke");var d=(j.length==0)?null:j[0];if(!a.isStroked){if(d){b.removeChild(d)}}else{if(!d){d=this.createNode("olv:stroke",b.id+"_stroke");b.appendChild(d)}d.opacity=o.strokeOpacity;d.endcap=!o.strokeLinecap||o.strokeLinecap=="butt"?"flat":o.strokeLinecap;d.dashstyle=this.dashStyle(o)}if(o.cursor!="inherit"&&o.cursor!=null){b.style.cursor=o.cursor}return b},graphicRotate:function(s,m,a){var j=j||s._style;var f=s._options;var r,i;if(!(j.graphicWidth&&j.graphicHeight)){var g=new Image();g.onreadystatechange=OpenLayers.Function.bind(function(){if(g.readyState=="complete"||g.readyState=="interactive"){r=g.width/g.height;i=Math.max(j.pointRadius*2,j.graphicWidth||0,j.graphicHeight||0);m=m*r;j.graphicWidth=i*r;j.graphicHeight=i;this.graphicRotate(s,m,a)}},this);g.src=j.externalGraphic;return}else{i=Math.max(j.graphicWidth,j.graphicHeight);r=j.graphicWidth/j.graphicHeight}var h=Math.round(j.graphicWidth||i*r);var c=Math.round(j.graphicHeight||i);s.style.width=h+"px";s.style.height=c+"px";var d=document.getElementById(s.id+"_image");if(!d){d=this.createNode("olv:imagedata",s.id+"_image");s.appendChild(d)}d.style.width=h+"px";d.style.height=c+"px";d.src=j.externalGraphic;d.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader("+"src='', sizingMethod='scale')";var q=j.rotation*Math.PI/180;var t=Math.sin(q);var o=Math.cos(q);var k="progid:DXImageTransform.Microsoft.Matrix(M11="+o+",M12="+(-t)+",M21="+t+",M22="+o+",SizingMethod='auto expand')\n";var p=j.graphicOpacity||j.fillOpacity;if(p&&p!=1){k+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+p+")\n"}s.style.filter=k;var l=new OpenLayers.Geometry.Point(-m,-a);var e=new OpenLayers.Bounds(0,0,h,c).toGeometry();e.rotate(j.rotation,l);var b=e.getBounds();s.style.left=Math.round(parseInt(s.style.left)+b.left)+"px";s.style.top=Math.round(parseInt(s.style.top)-b.bottom)+"px"},postDraw:function(c){var a=c._style.fillColor;var b=c._style.strokeColor;if(a=="none"&&c.fillcolor!=a){c.fillcolor=a}if(b=="none"&&c.strokecolor!=b){c.strokecolor=b}},setNodeDimension:function(e,a){var d=a.getBounds();if(d){var c=this.getResolution();var b=new OpenLayers.Bounds((d.left/c-this.offset.x).toFixed(),(d.bottom/c-this.offset.y).toFixed(),(d.right/c-this.offset.x).toFixed(),(d.top/c-this.offset.y).toFixed());e.style.left=b.left+"px";e.style.top=b.top+"px";e.style.width=b.getWidth()+"px";e.style.height=b.getHeight()+"px";e.coordorigin=b.left+" "+b.top;e.coordsize=b.getWidth()+" "+b.getHeight()}},dashStyle:function(b){var a=b.strokeDashstyle;switch(a){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return a;default:var c=a.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=function(){return(false)};return c},nodeTypeCompare:function(e,d){var a=d;var b=a.indexOf(":");if(b!=-1){a=a.substr(b+1)}var c=e.nodeName;b=c.indexOf(":");if(b!=-1){c=c.substr(b+1)}return(a==c)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"olv:group")},drawPoint:function(b,a){return this.drawCircle(b,a,1)},drawCircle:function(e,b,a){if(!isNaN(b.x)&&!isNaN(b.y)){var d=this.getResolution();e.style.left=((b.x/d-this.offset.x).toFixed()-a)+"px";e.style.top=((b.y/d-this.offset.y).toFixed()-a)+"px";var c=a*2;e.style.width=c+"px";e.style.height=c+"px";return e}return false},drawLineString:function(b,a){return this.drawLine(b,a,false)},drawLinearRing:function(b,a){return this.drawLine(b,a,true)},drawLine:function(b,d,f){this.setNodeDimension(b,d);var j=this.getResolution();var l=d.components.length;var g=new Array(l);var h,a,e;for(var k=0;k<l;k++){h=d.components[k];a=(h.x/j-this.offset.x);e=(h.y/j-this.offset.y);g[k]=" "+a.toFixed()+","+e.toFixed()+" l "}var c=(f)?" x e":" e";b.path="m"+g.join("")+c;return b},drawPolygon:function(b,d){this.setNodeDimension(b,d);var k=this.getResolution();var o=[];var f,a,m,c,l,h,g,e;for(m=0,c=d.components.length;m<c;m++){f=d.components[m];o.push("m");for(a=0,l=f.components.length;a<l;a++){h=f.components[a];g=h.x/k-this.offset.x;e=h.y/k-this.offset.y;o.push(" "+g.toFixed()+","+e.toFixed());if(a==0){o.push(" l")}}o.push(" x ")}o.push("e");b.path=o.join("");return b},drawRectangle:function(c,a){var b=this.getResolution();c.style.left=(a.x/b-this.offset.x)+"px";c.style.top=(a.y/b-this.offset.y)+"px";c.style.width=a.width/b+"px";c.style.height=a.height/b+"px";return c},drawText:function(g,i,b){var h=this.nodeFactory(g+this.LABEL_ID_SUFFIX,"olv:rect");var e=this.nodeFactory(g+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var f=this.getResolution();h.style.left=(b.x/f-this.offset.x).toFixed()+"px";h.style.top=(b.y/f-this.offset.y).toFixed()+"px";h.style.flip="y";e.innerText=i.label;if(i.fillColor){e.style.color=i.fontColor}if(i.fontFamily){e.style.fontFamily=i.fontFamily}if(i.fontSize){e.style.fontSize=i.fontSize}if(i.fontWeight){e.style.fontWeight=i.fontWeight}e.style.whiteSpace="nowrap";e.inset="1px,0px,0px,0px";if(!h.parentNode){h.appendChild(e);this.textRoot.appendChild(h)}var c=i.labelAlign||"cm";var d=e.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[c.substr(0,1)]);var a=e.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[c.substr(1,1)]);h.style.left=parseInt(h.style.left)-d-1+"px";h.style.top=parseInt(h.style.top)+a+"px"},drawSurface:function(b,j){this.setNodeDimension(b,j);var f=this.getResolution();var h=[];var e,c,d;for(var a=0,g=j.components.length;a<g;a++){e=j.components[a];c=e.x/f-this.offset.x;d=e.y/f-this.offset.y;if((a%3)==0&&(a/3)==0){h.push("m")}else{if((a%3)==1){h.push(" c")}}h.push(" "+c+","+d)}h.push(" x e");b.path=h.join("");return b},moveRoot:function(b){var a=this.map.getLayer(b.container.id);if(a instanceof OpenLayers.Layer.Vector.RootContainer){a=this.map.getLayer(this.container.id)}a&&a.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);a&&a.redraw()},importSymbol:function(c){var b=this.container.id+"-"+c;var h=this.symbolCache[b];if(h){return h}var e=OpenLayers.Renderer.symbol[c];if(!e){throw new Error(c+" is not a valid symbol name");return}var g=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var f=["m"];for(var a=0;a<e.length;a=a+2){x=e[a];y=e[a+1];g.left=Math.min(g.left,x);g.bottom=Math.min(g.bottom,y);g.right=Math.max(g.right,x);g.top=Math.max(g.top,y);f.push(x);f.push(y);if(a==0){f.push("l")}}f.push("x e");var j=f.join(" ");var d=(g.getWidth()-g.getHeight())/2;if(d>0){g.bottom=g.bottom-d;g.top=g.top+d}else{g.left=g.left-d;g.right=g.right+d}h={path:j,size:g.getWidth(),left:g.left,bottom:g.bottom};this.symbolCache[b]=h;return h},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={"l":0,"c":0.5,"r":1,"t":0,"m":0.5,"b":1};OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,initialize:function(a,e,b,d,c){this.layer=a;this.position=e.clone();this.bounds=b.clone();this.url=d;this.size=c.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,c,b){if(b==null){b=true}this.bounds=a.clone();this.position=c.clone();if(b){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(f){var c=OpenLayers.i18n("reprojectDeprecated",{"layerName":this.layer.name});OpenLayers.Console.warn(c);var b=this.layer.map.getLonLatFromLayerPx(f);var a=f.clone();a.x+=this.size.w;a.y+=this.size.h;var d=this.layer.map.getLonLatFromLayerPx(a);if(b.lon>d.lon){if(b.lon<0){b.lon=-180-(b.lon+180)}else{d.lon=180+d.lon+180}}var e=new OpenLayers.Bounds(b.lon,d.lat,d.lon,b.lat);return e},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);if(b){this.position=b}if(a){this.direction=a}this.measureDivs=[]},destroy:function(){for(var a in this.buttons){var b=this.buttons[a];b.map=null;b.events.destroy()}OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);this.buttons={};var b=new OpenLayers.Size(28,28);var a=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",a,b,"Shift->Drag to zoom to area");a=a.add((this.direction=="vertical"?0:b.w),(this.direction=="vertical"?b.h:0));this._addButton("pan","panning-hand-off.png","panning-hand-on.png",a,b,"Drag the map to pan.");a=a.add((this.direction=="vertical"?0:b.w),(this.direction=="vertical"?b.h:0));this.switchModeTo("pan");return this.div},_addButton:function(a,b,e,i,h,g){var c=OpenLayers.Util.getImagesLocation()+b;var d=OpenLayers.Util.getImagesLocation()+e;var f=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+a,i,h,c,"absolute");this.div.appendChild(f);f.imgLocation=c;f.activeImgLocation=d;f.events=new OpenLayers.Events(this,f,null,true);f.events.on({"mousedown":this.buttonDown,"mouseup":this.buttonUp,"dblclick":OpenLayers.Event.stop,scope:this});f.action=a;f.title=g;f.alt=g;f.map=this.map;this.buttons[a]=f;return f},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.buttonClicked=a.element.action;OpenLayers.Event.stop(a)},buttonUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.buttonClicked!=null){if(this.buttonClicked==a.element.action){this.switchModeTo(a.element.action)}OpenLayers.Event.stop(a);this.buttonClicked=null}},defaultDblClick:function(a){this.switchModeTo("pan");this.performedDrag=false;var b=this.map.getLonLatFromViewPortPx(a.xy);this.map.setCenter(b,this.map.zoom+1);OpenLayers.Event.stop(a);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;this.startViaKeyboard=false;if(a.shiftKey&&this.mode!="zoombox"){this.switchModeTo("zoombox");this.startViaKeyboard=true}else{if(a.altKey&&this.mode!="measure"){this.switchModeTo("measure")}else{if(!this.mode){this.switchModeTo("pan")}}}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.performedDrag=true;break;case"measure":var b="";if(this.measureStart){var c=this.map.getLonLatFromViewPortPx(this.mouseDragStart);b=OpenLayers.Util.distVincenty(this.measureStart,c);b=Math.round(b*100)/100;b=b+"km";this.measureStartBox=this.measureBox}this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBox.style.width="4px";this.measureBox.style.height="4px";this.measureBox.style.fontSize="1px";this.measureBox.style.backgroundColor="red";this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendChild(this.measureBox);if(b){this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBoxDistance.innerHTML=b;this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendChild(this.measureBoxDistance);this.measureDivs.push(this.measureBoxDistance)}this.measureBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;this.map.layerContainerDiv.appendChild(this.measureBox);this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor="move";break}document.onselectstart=function(){return false};OpenLayers.Event.stop(a)},switchModeTo:function(c){if(c!=this.mode){if(this.mode&&this.buttons[this.mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation)}if(this.mode=="measure"&&c!="measure"){for(var b=0,a=this.measureDivs.length;b<a;b++){if(this.measureDivs[b]){this.map.layerContainerDiv.removeChild(this.measureDivs[b])}}this.measureDivs=[];this.measureStart=null}this.mode=c;if(this.buttons[c]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[c],null,null,null,this.buttons[c].activeImgLocation)}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";break;default:this.map.div.style.cursor="";break}}},leaveMode:function(){this.switchModeTo("pan")},defaultMouseMove:function(b){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var f=Math.abs(this.mouseDragStart.x-b.xy.x);var d=Math.abs(this.mouseDragStart.y-b.xy.y);this.zoomBox.style.width=Math.max(1,f)+"px";this.zoomBox.style.height=Math.max(1,d)+"px";if(b.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=b.xy.x+"px"}if(b.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=b.xy.y+"px"}break;default:var f=this.mouseDragStart.x-b.xy.x;var d=this.mouseDragStart.y-b.xy.y;var a=this.map.getSize();var e=new OpenLayers.Pixel(a.w/2+f,a.h/2+d);var c=this.map.getLonLatFromViewPortPx(e);this.map.setCenter(c,null,true);this.mouseDragStart=b.xy.clone()}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.mode){case"zoombox":this.zoomBoxEnd(a);if(this.startViaKeyboard){this.leaveMode()}break;case"pan":if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="default"},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox();if(this.startViaKeyboard){this.leaveMode()}}this.mouseDragStart=null;this.map.div.style.cursor="default"}},defaultClick:function(a){if(this.performedDrag){this.performedDrag=false;return false}},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});OpenLayers.Control.MouseToolbar.X=6;OpenLayers.Control.MouseToolbar.Y=300;OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:true,clearOnDeactivate:false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,initialize:function(c){OpenLayers.Control.prototype.initialize.apply(this,[c]);this.registry=OpenLayers.Util.extend({"moveend":function(){return{center:this.map.getCenter(),resolution:this.map.getResolution()}}},this.registry);this.clear();var a={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(a,this.previousOptions);this.previous=new OpenLayers.Control.Button(a);var b={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(b,this.nextOptions);this.next=new OpenLayers.Control.Button(b)},onPreviousChange:function(a,b){if(a&&!this.previous.active){this.previous.activate()}else{if(!a&&this.previous.active){this.previous.deactivate()}}},onNextChange:function(a,b){if(a&&!this.next.active){this.next.activate()}else{if(!a&&this.next.active){this.next.deactivate()}}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var a in this){this[a]=null}},setMap:function(a){this.map=a;this.next.setMap(a);this.previous.setMap(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw();if(this.activateOnDraw){this.activate()}},previousTrigger:function(){var b=this.previousStack.shift();var a=this.previousStack.shift();if(a!=undefined){this.nextStack.unshift(b);this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}else{this.previousStack.unshift(b)}return a},nextTrigger:function(){var a=this.nextStack.shift();if(a!=undefined){this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}return a},clear:function(){this.previousStack=[];this.nextStack=[]},restore:function(a){var b=this.map.getZoomForResolution(a.resolution);this.map.setCenter(a.center,b)},setListeners:function(){this.listeners={};for(var a in this.registry){this.listeners[a]=OpenLayers.Function.bind(function(){if(!this.restoring){var b=this.registry[a].apply(this,arguments);this.previousStack.unshift(b);if(this.previousStack.length>1){this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}if(this.previousStack.length>(this.limit+1)){this.previousStack.pop()}if(this.nextStack.length>0){this.nextStack=[];this.onNextChange(null,0)}}return true},this)}},activate:function(){var a=false;if(this.map){if(OpenLayers.Control.prototype.activate.apply(this)){if(this.listeners==null){this.setListeners()}for(var b in this.listeners){this.map.events.register(b,this,this.listeners[b])}a=true;if(this.previousStack.length==0){this.initStack()}}}return a},initStack:function(){if(this.map.getCenter()){this.listeners.moveend()}},deactivate:function(){var b=false;if(this.map){if(OpenLayers.Control.prototype.deactivate.apply(this)){for(var a in this.listeners){this.map.events.unregister(a,this,this.listeners[a])}if(this.clearOnDeactivate){this.clear()}b=true}}return b},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)])},CLASS_NAME:"OpenLayers.Control.PanPanel"});OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this._removeZoomBar();this.map.events.un({"changebaselayer":this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)},setMap:function(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 d=new OpenLayers.Size(18,18);var c=new OpenLayers.Pixel(a.x+d.w/2,a.y);var b=d.w;if(this.zoomWorldIcon){c=new OpenLayers.Pixel(a.x+d.w,a.y)}this._addButton("panup","north-mini.png",c,d);a.y=c.y+d.h;this._addButton("panleft","west-mini.png",a,d);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",a.add(d.w,0),d);b*=2}this._addButton("panright","east-mini.png",a.add(b,0),d);this._addButton("pandown","south-mini.png",c.add(0,d.h*2),d);this._addButton("zoomin","zoom-plus-mini.png",c.add(0,d.h*3+5),d);c=this._addZoomBar(c.add(0,d.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",c,d);return this.div},_addZoomBar:function(d){var e=OpenLayers.Util.getImagesLocation();var a=this.id+"_"+this.map.id;var f=this.map.getNumZoomLevels()-1-this.map.getZoom();var g=OpenLayers.Util.createAlphaImageDiv(a,d.add(-1,f*this.zoomStopHeight),new OpenLayers.Size(20,9),e+"slider.png","absolute");this.slider=g;this.sliderEvents=new OpenLayers.Events(this,g,null,true,{includeXY:true});this.sliderEvents.on({"mousedown":this.zoomBarDown,"mousemove":this.zoomBarDrag,"mouseup":this.zoomBarUp,"dblclick":this.doubleClick,"click":this.doubleClick});var c=new OpenLayers.Size();c.h=this.zoomStopHeight*this.map.getNumZoomLevels();c.w=this.zoomStopWidth;var b=null;if(OpenLayers.Util.alphaHack()){var a=this.id+"_"+this.map.id;b=OpenLayers.Util.createAlphaImageDiv(a,d,new OpenLayers.Size(c.w,this.zoomStopHeight),e+"zoombar.png","absolute",null,"crop");b.style.height=c.h+"px"}else{b=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,d,c,e+"zoombar.png")}this.zoombarDiv=b;this.divEvents=new OpenLayers.Events(this,b,null,true,{includeXY:true});this.divEvents.on({"mousedown":this.divClick,"mousemove":this.passEventToSlider,"dblclick":this.doubleClick,"click":this.doubleClick});this.div.appendChild(b);this.startTop=parseInt(b.style.top);this.div.appendChild(g);this.map.events.register("zoomend",this,this.moveZoomBar);d=d.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return d},_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(d){if(!OpenLayers.Event.isLeftClick(d)){return}var b=d.xy.y;var c=OpenLayers.Util.pagePosition(d.object)[1];var e=(b-c)/this.zoomStopHeight;if(!this.map.fractionalZoom){e=Math.floor(e)}var a=(this.map.getNumZoomLevels()-1)-e;a=Math.min(Math.max(a,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(a);OpenLayers.Event.stop(d)},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(b){if(this.mouseDragStart!=null){var c=this.mouseDragStart.y-b.xy.y;var d=OpenLayers.Util.pagePosition(this.zoombarDiv);if((b.clientY-d[1])>0&&(b.clientY-d[1])<parseInt(this.zoombarDiv.style.height)-2){var a=parseInt(this.slider.style.top)-c;this.slider.style.top=a+"px";this.mouseDragStart=b.xy.clone()}OpenLayers.Event.stop(b)}},zoomBarUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.zoomStart){this.div.style.cursor="";this.map.events.un({"mouseup":this.passEventToSlider,"mousemove":this.passEventToSlider,scope:this});var c=this.zoomStart.y-a.xy.y;var b=this.map.zoom;if(this.map.fractionalZoom){b+=c/this.zoomStopHeight;b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1)}else{b+=Math.round(c/this.zoomStopHeight)}this.map.zoomTo(b);this.moveZoomBar();this.mouseDragStart=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(b,a,c){OpenLayers.Control.prototype.initialize.apply(this,[c]);this.element=OpenLayers.Util.getElement(b);this.base=a||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(d){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var c=0,a=this.map.controls.length;c<a;c++){var b=this.map.controls[c];if(b.CLASS_NAME==this.argParserClass.CLASS_NAME){if(b.displayProjection!=this.displayProjection){this.displayProjection=b.displayProjection}break}}if(c==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(b,f,h){b=b||this.map.getCenter();var e=OpenLayers.Util.getParameters(this.base);if(b){e.zoom=f||this.map.getZoom();var a=b.lat;var g=b.lon;if(this.displayProjection){var d=OpenLayers.Projection.transform({x:g,y:a},this.map.getProjectionObject(),this.displayProjection);g=d.x;a=d.y}e.lat=Math.round(a*100000)/100000;e.lon=Math.round(g*100000)/100000;h=h||this.map.layers;e.layers="";for(var j=0,k=h.length;j<k;j++){var c=h[j];if(c.isBaseLayer){e.layers+=(c==this.map.baseLayer)?"B":"0"}else{e.layers+=(c.getVisibility())?"T":"F"}}}return e},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.ZoomIn(),new OpenLayers.Control.ZoomToMaxExtent(),new OpenLayers.Control.ZoomOut()])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(json,filter){try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){var object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}if(this.keepData){this.data=object}return object}}catch(e){}return null},write:function(a,d){this.pretty=!!d;var b=null;var c=typeof a;if(this.serialize[c]){try{b=this.serialize[c].apply(this,[a])}catch(e){OpenLayers.Console.error("Trouble serializing: "+e)}}return b},writeIndent:function(){var a=[];if(this.pretty){for(var b=0;b<this.level;++b){a.push(this.indent)}}return a.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{"object":function(e){if(e==null){return"null"}if(e.constructor==Date){return this.serialize.date.apply(this,[e])}if(e.constructor==Array){return this.serialize.array.apply(this,[e])}var a=["{"];this.level+=1;var b,c,d;var f=false;for(b in e){if(e.hasOwnProperty(b)){c=OpenLayers.Format.JSON.prototype.write.apply(this,[b,this.pretty]);d=OpenLayers.Format.JSON.prototype.write.apply(this,[e[b],this.pretty]);if(c!=null&&d!=null){if(f){a.push(",")}a.push(this.writeNewline(),this.writeIndent(),c,":",this.writeSpace(),d);f=true}}}this.level-=1;a.push(this.writeNewline(),this.writeIndent(),"}");return a.join("")},"array":function(e){var c;var b=["["];this.level+=1;for(var d=0,a=e.length;d<a;++d){c=OpenLayers.Format.JSON.prototype.write.apply(this,[e[d],this.pretty]);if(c!=null){if(d>0){b.push(",")}b.push(this.writeNewline(),this.writeIndent(),c)}}this.level-=1;b.push(this.writeNewline(),this.writeIndent(),"]");return b.join("")},"string":function(b){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(/["\\\x00-\x1f]/.test(b)){return'"'+b.replace(/([\x00-\x1f\\"])/g,function(d,e){var f=a[e];if(f){return f}f=e.charCodeAt();return"\\u00"+Math.floor(f/16).toString(16)+(f%16).toString(16)})+'"'}return'"'+b+'"'},"number":function(a){return isFinite(a)?String(a):"null"},"boolean":function(a){return String(a)},"date":function(b){function a(c){return(c<10)?"0"+c:c}return'"'+b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+"T"+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.WFST=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Format.WFST.DEFAULTS);var b=OpenLayers.Format.WFST["v"+a.version.replace(/\./g,"_")];if(!b){throw"Unsupported WFST version: "+a.version}return new b(a)};OpenLayers.Format.WFST.DEFAULTS={"version":"1.0.0"};OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.1",version:null,parser:null,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a]);this.options=a},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var e=this.version||c.getAttribute("version")||this.defaultVersion;if(!this.parser||this.parser.version!==e){var d=OpenLayers.Format.WMSCapabilities["v"+e.replace(/\./g,"_")];if(!d){throw"Can't find a WMS capabilities parser for version "+e}var a=new d(this.options)}var b=a.read(f);b.version=e;return b},CLASS_NAME:"OpenLayers.Format.WMSCapabilities"});OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(b){if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}OpenLayers.Format.prototype.initialize.apply(this,[b]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var a in this.namespaces){this.namespaceAlias[this.namespaces[a]]=a}},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(a,b){this.namespaces[a]=b;this.namespaceAlias[b]=a},read:function(c){var b=c.indexOf("<");if(b>0){c=c.substring(b)}var a=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var d;if(window.ActiveXObject&&!this.xmldom){d=new ActiveXObject("Microsoft.XMLDOM")}else{d=this.xmldom}d.loadXML(c);return d}),this),function(){return new DOMParser().parseFromString(c,"text/xml")},function(){var d=new XMLHttpRequest();d.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(c),false);if(d.overrideMimeType){d.overrideMimeType("text/xml")}d.send(null);return d.responseXML});if(this.keepData){this.data=a}return a},write:function(d){var b;if(this.xmldom){b=d.xml}else{var c=new XMLSerializer();if(d.nodeType==1){var a=document.implementation.createDocument("","",null);if(a.importNode){d=a.importNode(d,true)}a.appendChild(d);b=c.serializeToString(a)}else{b=c.serializeToString(d)}}return b},createElementNS:function(c,a){var b;if(this.xmldom){if(typeof c=="string"){b=this.xmldom.createNode(1,a,c)}else{b=this.xmldom.createNode(1,a,"")}}else{b=document.createElementNS(c,a)}return b},createTextNode:function(b){var a;if(this.xmldom){a=this.xmldom.createTextNode(b)}else{a=document.createTextNode(b)}return a},getElementsByTagNameNS:function(b,e,f){var c=[];if(b.getElementsByTagNameNS){c=b.getElementsByTagNameNS(e,f)}else{var j=b.getElementsByTagName("*");var d,g;for(var a=0,h=j.length;a<h;++a){d=j[a];g=(d.prefix)?(d.prefix+":"+f):f;if((f=="*")||(g==d.nodeName)){if((e=="*")||(e==d.namespaceURI)){c.push(d)}}}}return c},getAttributeNodeNS:function(b,e,f){var g=null;if(b.getAttributeNodeNS){g=b.getAttributeNodeNS(e,f)}else{var c=b.attributes;var d,h;for(var a=0,j=c.length;a<j;++a){d=c[a];if(d.namespaceURI==e){h=(d.prefix)?(d.prefix+":"+f):f;if(h==d.nodeName){g=d;break}}}}return g},getAttributeNS:function(e,d,a){var c="";if(e.getAttributeNS){c=e.getAttributeNS(d,a)||""}else{var b=this.getAttributeNodeNS(e,d,a);if(b){c=b.nodeValue}}return c},getChildValue:function(d,c){var a=c||"";if(d){for(var b=d.firstChild;b;b=b.nextSibling){switch(b.nodeType){case 3:case 4:a+=b.nodeValue}}}return a},concatChildValues:function(e,d){var a="";var b=e.firstChild;var c;while(b){c=b.nodeValue;if(c){a+=c}b=b.nextSibling}if(a==""&&d!=undefined){a=d}return a},isSimpleContent:function(c){var a=true;for(var b=c.firstChild;b;b=b.nextSibling){if(b.nodeType===1){a=false;break}}return a},contentType:function(e){var a=false,b=false;var c=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var d=e.firstChild;d;d=d.nextSibling){switch(d.nodeType){case 1:b=true;break;case 8:break;default:a=true}if(b&&a){break}}if(b&&a){c=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(b){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(a){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return c},hasAttributeNS:function(d,c,a){var b=false;if(d.hasAttributeNS){b=d.hasAttributeNS(c,a)}else{b=!!this.getAttributeNodeNS(d,c,a)}return b},setAttributeNS:function(e,d,b,c){if(e.setAttributeNS){e.setAttributeNS(d,b,c)}else{if(this.xmldom){if(d){var a=e.ownerDocument.createNode(2,b,d);a.nodeValue=c;e.setAttributeNode(a)}else{e.setAttribute(b,c)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(a,d){d=d||{};var e=d.uri||this.namespaces[d.prefix];if(!e){var b=a.indexOf(":");e=this.namespaces[a.substring(0,b)]}if(!e){e=this.namespaces[this.defaultPrefix]}var f=this.createElementNS(e,a);if(d.attributes){this.setAttributes(f,d.attributes)}var c=d.value;if(c!=null){if(typeof c=="boolean"){c=String(c)}f.appendChild(this.createTextNode(c))}return f},setAttributes:function(e,a){var d,b;for(var c in a){if(a[c]!=null&&a[c].toString){d=a[c].toString();b=this.namespaces[c.substring(0,c.indexOf(":"))]||null;this.setAttributeNS(e,b,c,d)}}},readNode:function(e,b){if(!b){b={}}var c=this.readers[this.namespaceAlias[e.namespaceURI]];if(c){var a=e.localName||e.nodeName.split(":").pop();var d=c[a]||c["*"];if(d){d.apply(this,[e,b])}}return b},readChildNodes:function(f,b){if(!b){b={}}var c=f.childNodes;var d;for(var e=0,a=c.length;e<a;++e){d=c[e];if(d.nodeType==1){this.readNode(d,b)}}return b},writeNode:function(b,g,c){var f,a;var d=b.indexOf(":");if(d>0){f=b.substring(0,d);a=b.substring(d+1)}else{if(c){f=this.namespaceAlias[c.namespaceURI]}else{f=this.defaultPrefix}a=b}var e=this.writers[f][a].apply(this,[g]);if(c){c.appendChild(e)}return e},getChildEl:function(c,a,b){return c&&this.getThisOrNextEl(c.firstChild,a,b)},getNextEl:function(c,a,b){return c&&this.getThisOrNextEl(c.nextSibling,a,b)},getThisOrNextEl:function(d,a,b){outer:for(var c=d;c;c=c.nextSibling){switch(c.nodeType){case 1:if((!a||a===(c.localName||c.nodeName.split(":").pop()))&&(!b||b===c.namespaceURI)){break outer}c=null;break outer;case 3:if(/^\s*$/.test(c.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:c=null;break outer}}return c||null},lookupNamespaceURI:function(f,b){var d=null;if(f){if(f.lookupNamespaceURI){d=f.lookupNamespaceURI(b)}else{outer:switch(f.nodeType){case 1:if(f.namespaceURI!==null&&f.prefix===b){d=f.namespaceURI;break outer}var a=f.attributes.length;if(a){var e;for(var c=0;c<a;++c){e=f.attributes[c];if(e.prefix==="xmlns"&&e.name==="xmlns:"+b){d=e.value||null;break outer}else{if(e.name==="xmlns"&&b===null){d=e.value||null;break outer}}}}d=this.lookupNamespaceURI(f.parentNode,b);break outer;case 2:d=this.lookupNamespaceURI(f.ownerElement,b);break outer;case 9:d=this.lookupNamespaceURI(f.documentElement,b);break outer;case 6:case 12:case 10:case 11:break outer;default:d=this.lookupNamespaceURI(f.parentNode,b);break outer}}}return d},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3};OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(b,a,c){OpenLayers.Util.extend(this,c);this.control=b;this.callbacks=a;if(b.map){this.setMap(b.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 b=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var c=0,a=b.length;c<a;c++){if(this[b[c]]){this.register(b[c],this[b[c]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var b=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var c=0,a=b.length;c<a;c++){if(this[b[c]]){this.unregister(b[c],this[b[c]])}}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.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,allOverlays:false,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,initialize:function(c,a){if(arguments.length===1&&typeof c==="object"){a=c;c=a&&a.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,a);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(c);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 b=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(b,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);b=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(b);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 h=true;var g=document.getElementsByTagName("link");for(var d=0,e=g.length;d<e;++d){if(OpenLayers.Util.isEquivalentUrl(g.item(d).href,this.theme)){h=false;break}}if(h){var f=document.createElement("link");f.setAttribute("rel","stylesheet");f.setAttribute("type","text/css");f.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(f)}}this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var d=0,e=this.controls.length;d<e;d++){this.addControlToMap(this.controls[d])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy)},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}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(e,b,a){var c=(typeof a.test=="function");var d=OpenLayers.Array.filter(this[e],function(f){return f[b]==a||(c&&a.test(f[b]))});return d},getLayersBy:function(b,a){return this.getBy("layers",b,a)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(b,a){return this.getBy("controls",b,a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},getLayer:function(e){var b=null;for(var d=0,a=this.layers.length;d<a;d++){var c=this.layers[d];if(c.id==e){b=c;break}}return b},setLayerZIndex:function(a,b){a.setZIndex(this.Z_INDEX_BASE[a.isBaseLayer?"BaseLayer":"Overlay"]+b*5)},resetLayersZIndex:function(){for(var b=0,a=this.layers.length;b<a;b++){var c=this.layers[b];this.setLayerZIndex(c,b)}},addLayer:function(a){for(var d=0,b=this.layers.length;d<b;d++){if(this.layers[d]==a){var c=OpenLayers.i18n("layerAlreadyAdded",{"layerName":a.name});OpenLayers.Console.warn(c);return false}}if(this.allOverlays){a.isBaseLayer=false}this.events.triggerEvent("preaddlayer",{layer:a});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(c){for(var b=0,a=c.length;b<a;b++){this.addLayer(c[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 e=0,c=this.layers.length;e<c;e++){var d=this.layers[e];if(d.isBaseLayer||this.allOverlays){this.setBaseLayer(d);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,e){var b=this.getLayerIndex(a);if(e<0){e=0}else{if(e>this.layers.length){e=this.layers.length}}if(b!=e){this.layers.splice(b,1);this.layers.splice(e,0,a);for(var d=0,c=this.layers.length;d<c;d++){this.setLayerZIndex(this.layers[d],d)}this.events.triggerEvent("changelayer",{layer:a,property:"order"});if(this.allOverlays){if(e===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(e){var a=null;if(this.baseLayer){a=this.baseLayer.getExtent()}if(e!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,e)!=-1){if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=e;this.viewRequestID++;if(!this.allOverlays){this.baseLayer.visibility=true}var d=this.getCenter();if(d!=null){var b=(a)?a.getCenterLonLat():d;var c=(a)?this.getZoomForExtent(a,true):this.getZoomForResolution(this.resolution,true);this.setCenter(b,c,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(b,a){this.controls.push(b);this.addControlToMap(b,a)},addControlToMap:function(c,a){c.outsideViewport=(c.div!=null);if(this.displayProjection&&!c.displayProjection){c.displayProjection=this.displayProjection}c.setMap(this);var b=c.draw(a);if(b){if(!c.outsideViewport){b.style.zIndex=this.Z_INDEX_BASE["Control"]+this.controls.length;this.viewPortDiv.appendChild(b)}}},getControl:function(e){var b=null;for(var d=0,a=this.controls.length;d<a;d++){var c=this.controls[d];if(c.id==e){b=c;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(d,a){if(a){for(var b=this.popups.length-1;b>=0;--b){this.removePopup(this.popups[b])}}d.map=this;this.popups.push(d);var c=d.draw();if(c){c.style.zIndex=this.Z_INDEX_BASE["Popup"]+this.popups.length;this.layerContainerDiv.appendChild(c)}},removePopup:function(b){OpenLayers.Util.removeItem(this.popups,b);if(b.div){try{this.layerContainerDiv.removeChild(b.div)}catch(a){}}b.map=null},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},updateSize:function(){this.events.clearMouseCache();var e=this.getCurrentSize();var d=this.getSize();if(d==null){this.size=d=e}if(!e.equals(d)){this.size=e;for(var f=0,a=this.layers.length;f<a;f++){this.layers[f].onMapResize()}if(this.baseLayer!=null){var g=new OpenLayers.Pixel(e.w/2,e.h/2);var c=this.getLonLatFromViewPortPx(g);var b=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),b)}}},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)){var b=OpenLayers.Element.getDimensions(this.div);a.w=b.width;a.h=b.height}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(c,d){var e=null;if(c==null){c=this.getCenter()}if(d==null){d=this.getResolution()}if((c!=null)&&(d!=null)){var a=this.getSize();var b=a.w*d;var f=a.h*d;e=new OpenLayers.Bounds(c.lon-b/2,c.lat-f/2,c.lon+b/2,c.lat+f/2)}return e},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getZoom:function(){return this.zoom},pan:function(e,c,d){d=OpenLayers.Util.applyDefaults(d,{animate:true,dragging:false});var f=this.getViewPortPxFromLonLat(this.getCenter());var b=f.add(e,c);if(!d.dragging||!b.equals(f)){var a=this.getLonLatFromViewPortPx(b);if(d.animate){this.panTo(a)}else{this.setCenter(a,null,d.dragging)}}},panTo:function(d){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(d)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var c=this.getCenter();if(d.lon==c.lon&&d.lat==c.lat){return}var a={lon:c.lon,lat:c.lat};var b={lon:d.lon,lat:d.lat};this.panTween.start(a,b,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(e){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(e){e=new OpenLayers.LonLat(e.lon,e.lat);this.moveTo(e,this.zoom,{"dragging":true,"noEvent":true})},this),done:OpenLayers.Function.bind(function(e){e=new OpenLayers.LonLat(e.lon,e.lat);this.moveTo(e,this.zoom,{"noEvent":true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(d)}},setCenter:function(c,a,b,d){this.moveTo(c,a,{"dragging":b,"forceZoomChange":d,"caller":"setCenter"})},moveTo:function(g,e,a){if(!a){a={}}var m=a.dragging;var d=a.forceZoomChange;var j=a.noEvent;if(this.panTween&&a.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(g)){g=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(g==null){g=this.getCenter()}if(e==null){e=this.getZoom()}var k=this.getResolutionForZoom(e);var f=this.calculateBounds(g,k);if(!this.restrictedExtent.containsBounds(f)){var q=this.restrictedExtent.getCenterLonLat();if(f.getWidth()>this.restrictedExtent.getWidth()){g=new OpenLayers.LonLat(q.lon,g.lat)}else{if(f.left<this.restrictedExtent.left){g=g.add(this.restrictedExtent.left-f.left,0)}else{if(f.right>this.restrictedExtent.right){g=g.add(this.restrictedExtent.right-f.right,0)}}}if(f.getHeight()>this.restrictedExtent.getHeight()){g=new OpenLayers.LonLat(g.lon,q.lat)}else{if(f.bottom<this.restrictedExtent.bottom){g=g.add(0,this.restrictedExtent.bottom-f.bottom)}else{if(f.top>this.restrictedExtent.top){g=g.add(0,this.restrictedExtent.top-f.top)}}}}}var b=d||((this.isValidZoomLevel(e))&&(e!=this.getZoom()));var r=(this.isValidLonLat(g))&&(!g.equals(this.center));if(b||r||!m){if(!this.dragging&&!j){this.events.triggerEvent("movestart")}if(r){if((!b)&&(this.center)){this.centerLayerContainer(g)}this.center=g.clone()}if((b)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(b){this.zoom=e;this.resolution=this.getResolutionForZoom(e);this.viewRequestID++}var h=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(h,b,m);if(m){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{"zoomChanged":b})}}h=this.baseLayer.getExtent();for(var l=0,o=this.layers.length;l<o;l++){var c=this.layers[l];if(c!==this.baseLayer&&!c.isBaseLayer){var p=c.calculateInRange();if(c.inRange!=p){c.inRange=p;if(!p){c.display(false)}this.events.triggerEvent("changelayer",{layer:c,property:"visibility"})}if(p&&c.visibility){c.moveTo(h,b,m);if(m){c.events.triggerEvent("move")}else{c.events.triggerEvent("moveend",{"zoomChanged":b})}}}}if(b){for(var l=0,o=this.popups.length;l<o;l++){this.popups[l].updatePosition()}}this.events.triggerEvent("move");if(b){this.events.triggerEvent("zoomend")}}if(!m&&!j){this.events.triggerEvent("moveend")}this.dragging=!!m},centerLayerContainer:function(b){var a=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var c=this.getViewPortPxFromLonLat(b);if((a!=null)&&(c!=null)){this.layerContainerDiv.style.left=Math.round(a.x-c.x)+"px";this.layerContainerDiv.style.top=Math.round(a.y-c.y)+"px"}},isValidZoomLevel:function(a){return((a!=null)&&(a>=0)&&(a<this.getNumZoomLevels()))},isValidLonLat:function(b){var c=false;if(b!=null){var a=this.getMaxExtent();c=a.containsLonLat(b)}return c},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(b){var a=null;if(b&&b.restricted&&this.restrictedExtent){a=this.restrictedExtent}else{if(this.baseLayer!=null){a=this.baseLayer.maxExtent}}return a},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()}return a},getUnits:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.units}return a},getScale:function(){var c=null;if(this.baseLayer!=null){var b=this.getResolution();var a=this.baseLayer.units;c=OpenLayers.Util.getScaleFromResolution(b,a)}return c},getZoomForExtent:function(a,c){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getZoomForExtent(a,c)}return b},getResolutionForZoom:function(a){var b=null;if(this.baseLayer){b=this.baseLayer.getResolutionForZoom(a)}return b},getZoomForResolution:function(b,c){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getZoomForResolution(b,c)}return a},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,d){var c=a.getCenterLonLat();if(this.baseLayer.wrapDateLine){var b=this.getMaxExtent();a=a.clone();while(a.right<a.left){a.right+=b.getWidth()}c=a.getCenterLonLat().wrapDateLine(b)}this.setCenter(c,this.getZoomForExtent(a,d))},zoomToMaxExtent:function(c){var b=(c)?c.restricted:true;var a=this.getMaxExtent({"restricted":b});this.zoomToExtent(a)},zoomToScale:function(d,c){var h=OpenLayers.Util.getResolutionFromScale(d,this.baseLayer.units);var g=this.getSize();var f=g.w*h;var a=g.h*h;var b=this.getCenter();var e=new OpenLayers.Bounds(b.lon-f/2,b.lat-a/2,b.lon+f/2,b.lat+a/2);this.zoomToExtent(e,c)},getLonLatFromViewPortPx:function(b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getLonLatFromViewPortPx(b)}return a},getViewPortPxFromLonLat:function(b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getViewPortPxFromLonLat(b)}return a},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(b){var a=this.getViewPortPxFromLonLat(b);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getViewPortPxFromLayerPx:function(d){var a=null;if(d!=null){var b=parseInt(this.layerContainerDiv.style.left);var c=parseInt(this.layerContainerDiv.style.top);a=d.add(b,c)}return a},getLayerPxFromViewPortPx:function(c){var d=null;if(c!=null){var a=-parseInt(this.layerContainerDiv.style.left);var b=-parseInt(this.layerContainerDiv.style.top);d=c.add(a,b);if(isNaN(d.x)||isNaN(d.y)){d=null}}return d},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(b){var a=this.getPixelFromLonLat(b);return this.getLayerPxFromViewPortPx(a)},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(c,b){this.lonlat=c;var a=(b)?b:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=a}else{this.icon.url=a.url;this.icon.size=a.size;this.icon.offset=a.offset;this.icon.calculateOffset=a.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 b=false;if(this.map){var a=this.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},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 c=OpenLayers.Util.getImagesLocation()+"marker.png";var a=new OpenLayers.Size(21,25);var b=function(d){return new OpenLayers.Pixel(-(d.w/2),-d.h)};return new OpenLayers.Icon(c,a,null,b)};OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{"tl":{"offset":new OpenLayers.Pixel(44,0),"padding":new OpenLayers.Bounds(8,40,8,9),"blocks":[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},"tr":{"offset":new OpenLayers.Pixel(-45,0),"padding":new OpenLayers.Bounds(8,40,8,9),"blocks":[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},"bl":{"offset":new OpenLayers.Pixel(45,0),"padding":new OpenLayers.Bounds(8,9,8,40),"blocks":[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},"br":{"offset":new OpenLayers.Pixel(-44,0),"padding":new OpenLayers.Bounds(8,9,8,40),"blocks":[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),initialize:function(f,c,a,e,b,g,d){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative.png";OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(i){var g=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});i=OpenLayers.Util.applyDefaults(i,g);var k=new OpenLayers.Request.XMLHttpRequest();var d=i.url;if(i.params){var b=OpenLayers.Util.getParameterString(i.params);if(b.length>0){var h=(d.indexOf("?")>-1)?"&":"?";d+=h+b}}if(i.proxy&&(d.indexOf("http")==0)){d=i.proxy+encodeURIComponent(d)}k.open(i.method,d,i.async,i.user,i.password);for(var a in i.headers){k.setRequestHeader(a,i.headers[a])}var j=(i.scope)?OpenLayers.Function.bind(i.callback,i.scope):i.callback;var e;if(i.success){e=(i.scope)?OpenLayers.Function.bind(i.success,i.scope):i.success}var c;if(i.failure){c=(i.scope)?OpenLayers.Function.bind(i.failure,i.scope):i.failure}var f=this.events;k.onreadystatechange=function(){if(k.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var l=f.triggerEvent("complete",{request:k,config:i,requestUrl:d});if(l!==false){j(k);if(!k.status||(k.status>=200&&k.status<300)){f.triggerEvent("success",{request:k,config:i,requestUrl:d});if(e){e(k)}}if(k.status&&(k.status<200||k.status>=300)){f.triggerEvent("failure",{request:k,config:i,requestUrl:d});if(c){c(k)}}}}};if(i.async===false){k.send(i.data)}else{window.setTimeout(function(){k.send(i.data)},0)}return k},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},PUT:function(a){a=OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}};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,e,b,d,c){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].id)}OpenLayers.Event.stopObservingElement(this.imgDiv.id);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null;this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)}this.frame=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null}this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(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.imageSize||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBufferTile.resolution=this.layer.getResolution();this.backBufferTile.renderTile()}this.backBufferTile.hide()}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.async){this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);this.positionImage()}return true},positionImage:function(){if(this.layer==null){return}OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var a=this.layer.getImageSize();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 d=this.layer.imageOffset;var a=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,d,a,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,d,a,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 b=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(b,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(b,this))}var c=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){b.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(c,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 d=new OpenLayers.Size(this.backBufferTile.size.w*a,this.backBufferTile.size.h*a);var f=this.layer.map.getLayerPxFromLonLat(b);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,f,d);var e=this.backBufferTile.imageSize;e=new OpenLayers.Size(e.w*a,e.h*a);var c=this.backBufferTile.imageOffset;if(c){c=new OpenLayers.Pixel(c.x*a,c.y*a)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,c,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.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:false,handlers:null,resolutionFactor:1,initialize:function(a){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[a])},destroy:function(){if(!this.mapDiv){return}this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.extentRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy();this.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeChild(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null}if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null}this.map.events.un({"moveend":this.update,"changebaselayer":this.baseLayerDraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var a=this.map.baseLayer.clone();this.layers=[a]}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div}}this.element=document.createElement("div");this.element.className=this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var e=OpenLayers.Util.getImagesLocation();var c=e+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),c,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var c=e+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),c,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var d=["dblclick","mousedown"];for(var b=0,f=d.length;b<f;b++){OpenLayers.Event.observe(this.maximizeDiv,d[b],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,d[b],OpenLayers.Event.stop)}this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.register("moveend",this,this.update);return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(f){var d=this.handlers.drag.last.x-f.x;var g=this.handlers.drag.last.y-f.y;if(d!=0||g!=0){var b=this.rectPxBounds.top;var i=this.rectPxBounds.left;var c=Math.abs(this.rectPxBounds.getHeight());var h=this.rectPxBounds.getWidth();var e=Math.max(0,(b-g));e=Math.min(e,this.ovmap.size.h-this.hComp-c);var a=Math.max(0,(i-d));a=Math.min(a,this.ovmap.size.w-this.wComp-h);this.setRectPxBounds(new OpenLayers.Bounds(a,e+c,a+h,e))}},mapDivClick:function(b){var i=this.rectPxBounds.getCenterPixel();var f=b.xy.x-i.x;var j=b.xy.y-i.y;var c=this.rectPxBounds.top;var d=this.rectPxBounds.left;var g=Math.abs(this.rectPxBounds.getHeight());var a=this.rectPxBounds.getWidth();var h=Math.max(0,(c+j));h=Math.min(h,this.ovmap.size.h-g);var e=Math.max(0,(d+f));e=Math.min(e,this.ovmap.size.w-a);this.setRectPxBounds(new OpenLayers.Bounds(e,h+g,e+a,h));this.updateMapToRect()},maximizeControl:function(a){this.element.style.display="";this.showToggle(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.element.style.display="none";this.showToggle(true);if(a!=null){OpenLayers.Event.stop(a)}},showToggle:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var b=this.map.getExtent();var c=this.map.maxExtent;var d=new OpenLayers.Bounds(Math.max(b.left,c.left),Math.max(b.bottom,c.bottom),Math.min(b.right,c.right),Math.min(b.top,c.top));if(this.ovmap.getProjection()!=this.map.getProjection()){d=d.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var a=this.ovmap.getResolution()/this.map.getResolution();return((a>this.minRatio)&&(a<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(d)))},updateOverview:function(){var a=this.map.getResolution();var d=this.ovmap.getResolution();var b=d/a;if(b>this.maxRatio){d=this.minRatio*a}else{if(b<=this.minRatio){d=this.maxRatio*a}}var c;if(this.ovmap.getProjection()!=this.map.getProjection()){c=this.map.center.clone();c.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{c=this.map.center}this.ovmap.setCenter(c,this.ovmap.getZoomForResolution(d*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var c=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,c);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{"click":this.mapDivClick},{"single":true,"double":false,"stopSingle":true,"stopDouble":true,"pixelTolerance":1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(d){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(d){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var b=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var a=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=b&&a?OpenLayers.INCHES_PER_UNIT[b]/OpenLayers.INCHES_PER_UNIT[a]:1}},updateRectToMap:function(){var a;if(this.ovmap.getProjection()!=this.map.getProjection()){a=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{a=this.map.getExtent()}var b=this.getRectBoundsFromMapBounds(a);if(b){this.setRectPxBounds(b)}},updateMapToRect:function(){var a=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){a=a.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(a.getCenterLonLat())},setRectPxBounds:function(e){var b=Math.max(e.top,0);var c=Math.max(e.left,0);var g=Math.min(e.top+Math.abs(e.getHeight()),this.ovmap.size.h-this.hComp);var h=Math.min(e.left+e.getWidth(),this.ovmap.size.w-this.wComp);var a=Math.max(h-c,0);var f=Math.max(g-b,0);if(a<this.minRectSize||f<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var i=c+(a/2)-(this.minRectSize/2);var d=b+(f/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(d)+"px";this.extentRectangle.style.left=Math.round(i)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(b)+"px";this.extentRectangle.style.left=Math.round(c)+"px";this.extentRectangle.style.height=Math.round(f)+"px";this.extentRectangle.style.width=Math.round(a)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(c),Math.round(g),Math.round(h),Math.round(b))},getRectBoundsFromMapBounds:function(f){var d=new OpenLayers.LonLat(f.left,f.bottom);var c=new OpenLayers.LonLat(f.right,f.top);var b=this.getOverviewPxFromLonLat(d);var e=this.getOverviewPxFromLonLat(c);var a=null;if(b&&e){a=new OpenLayers.Bounds(b.x,b.y,e.x,e.y)}return a},getMapBoundsFromRectBounds:function(a){var c=new OpenLayers.Pixel(a.left,a.bottom);var d=new OpenLayers.Pixel(a.right,a.top);var b=this.getLonLatFromOverviewPx(c);var e=this.getLonLatFromOverviewPx(d);return new OpenLayers.Bounds(b.lon,b.lat,e.lon,e.lat)},getLonLatFromOverviewPx:function(f){var a=this.ovmap.size;var e=this.ovmap.getResolution();var c=this.ovmap.getExtent().getCenterLonLat();var b=f.x-(a.w/2);var d=f.y-(a.h/2);return new OpenLayers.LonLat(c.lon+b*e,c.lat-d*e)},getOverviewPxFromLonLat:function(b){var c=this.ovmap.getResolution();var d=this.ovmap.getExtent();var a=null;if(d){a=new OpenLayers.Pixel(Math.round(1/c*(b.lon-d.left)),Math.round(1/c*(d.top-b.lat)))}return a},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(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)}}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 b=false;if((this.layer!=null)&&(this.layer.map!=null)){var a=this.layer.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},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(c){if(this.lonlat!=null){var b=this.id+"_popup";var a=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(b,this.lonlat,this.data.popupSize,this.data.popupContentHTML,a,c)}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.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.0",version:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var e=this.version;if(!e){e=c.getAttribute("version");if(!e){e=this.defaultVersion}}var d=OpenLayers.Format.WFSCapabilities["v"+e.replace(/\./g,"_")];if(!d){throw"Can't find a WFS capabilities parser for version "+e}var a=new d(this.options);var b=a.read(f);b.version=e;return b},CLASS_NAME:"OpenLayers.Format.WFSCapabilities"});OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},readers:{"xsd":{"schema":function(b,a){var g=[];var j={};var l={complexTypes:g,customTypes:j};this.readChildNodes(b,l);var d=b.attributes;var e,c;for(var k=0,f=d.length;k<f;++k){e=d[k];c=e.name;if(c.indexOf("xmlns")==0){this.setNamespace(c.split(":")[1]||"",e.value)}else{a[c]=e.value}}a.featureTypes=g;a.targetPrefix=this.namespaceAlias[a.targetNamespace];var m,h;for(var k=0,f=g.length;k<f;++k){m=g[k];h=j[m.typeName];if(j[m.typeName]){m.typeName=h.name}}},"complexType":function(c,a){var b={"typeName":c.getAttribute("name")};this.readChildNodes(c,b);a.complexTypes.push(b)},"complexContent":function(b,a){this.readChildNodes(b,a)},"extension":function(b,a){this.readChildNodes(b,a)},"sequence":function(c,a){var b={elements:[]};this.readChildNodes(c,b);a.properties=b.elements},"element":function(b,g){if(g.elements){var d={};var c=b.attributes;var k;for(var a=0,j=c.length;a<j;++a){k=c[a];d[k.name]=k.value}var e=d.type;if(!e){e={};this.readChildNodes(b,e);d.restriction=e;d.type=e.base}var h=e.base||e;d.localType=h.split(":").pop();g.elements.push(d)}if(g.complexTypes){var e=b.getAttribute("type");var f=e.split(":").pop();g.customTypes[f]={"name":b.getAttribute("name"),"type":e}}},"simpleType":function(b,a){this.readChildNodes(b,a)},"restriction":function(b,a){a.base=b.getAttribute("base");this.readRestriction(b,a)}}},readRestriction:function(b,f){var c=b.childNodes;var h,e,d;for(var a=0,g=c.length;a<g;++a){h=c[a];if(h.nodeType==1){e=h.nodeName.split(":").pop();d=h.getAttribute("value");if(!f[e]){f[e]=d}else{if(typeof f[e]=="string"){f[e]=[f[e]]}f[e].push(d)}}}},read:function(b){if(typeof b=="string"){b=OpenLayers.Format.XML.prototype.read.apply(this,[b])}if(b&&b.nodeType==9){b=b.documentElement}var a={};this.readNode(b,a);return a},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});OpenLayers.Format.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs",gml:"http://www.opengis.net/gml",ogc:"http://www.opengis.net/ogc"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:true,xy:true,stateName:null,initialize:function(a){this.stateName={};this.stateName[OpenLayers.State.INSERT]="wfs:Insert";this.stateName[OpenLayers.State.UPDATE]="wfs:Update";this.stateName[OpenLayers.State.DELETE]="wfs:Delete";OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},getSrsName:function(b,c){var a=c&&c.srsName;if(!a){if(b&&b.layer){a=b.layer.projection.getCode()}else{a=this.srsName}}return a},read:function(b){if(typeof b=="string"){b=OpenLayers.Format.XML.prototype.read.apply(this,[b])}if(b&&b.nodeType==9){b=b.documentElement}var a={};this.readNode(b,a);if(a.features){a=a.features}return a},readers:{"wfs":{"FeatureCollection":function(b,a){a.features=[];this.readChildNodes(b,a)}}},write:function(c){var b=this.writeNode("wfs:Transaction",c);var a=this.schemaLocationAttr();if(a){this.setAttributeNS(b,this.namespaces["xsi"],"xsi:schemaLocation",a)}return OpenLayers.Format.XML.prototype.write.apply(this,[b])},writers:{"wfs":{"GetFeature":function(a){var b=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,maxFeatures:a&&a.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(a)}});this.writeNode("Query",a,b);return b},"Query":function(a){a=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},a);var b=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(a.featureNS?a.featurePrefix+":":"")+a.featureType,srsName:a.srsName}});if(a.featureNS){b.setAttribute("xmlns:"+a.featurePrefix,a.featureNS)}if(a.filter){this.setFilterProperty(a.filter);this.writeNode("ogc:Filter",a.filter,b)}return b},"Transaction":function(f){var e=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});if(f){var b,d;for(var c=0,a=f.length;c<a;++c){d=f[c];b=this.stateName[d.state];if(b){this.writeNode(b,d,e)}}}return e},"Insert":function(a){var b=this.createElementNSPlus("wfs:Insert");this.srsName=this.getSrsName(a);this.writeNode("feature:_typeName",a,b);return b},"Update":function(b){var c=this.createElementNSPlus("wfs:Update",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){c.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("Property",{name:this.geometryName,value:b},c);for(var a in b.attributes){this.writeNode("Property",{name:a,value:b.attributes[a]},c)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[b.fid]}),c);return c},"Property":function(b){var a=this.createElementNSPlus("wfs:Property");this.writeNode("Name",b.name,a);this.writeNode("Value",b.value,a);return a},"Name":function(a){return this.createElementNSPlus("wfs:Name",{value:a})},"Value":function(c){var a;if(c instanceof OpenLayers.Feature.Vector){a=this.createElementNSPlus("wfs:Value");this.srsName=this.getSrsName(c);var b=this.writeNode("feature:_geometry",c.geometry).firstChild;a.appendChild(b)}else{a=this.createElementNSPlus("wfs:Value",{value:c})}return a},"Delete":function(a){var b=this.createElementNSPlus("wfs:Delete",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){b.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[a.fid]}),b);return b}}},schemaLocationAttr:function(d){d=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},d);var f=OpenLayers.Util.extend({},this.schemaLocations);if(d.schema){f[d.featurePrefix]=d.schema}var a=[];var e;for(var c in f){e=this.namespaces[c];if(e){a.push(e+" "+f[c])}}var b=a.join(" ")||undefined;return b},setFilterProperty:function(c){if(c.filters){for(var b=0,a=c.filters.length;b<a;++b){this.setFilterProperty(c.filters[b])}}else{if(c instanceof OpenLayers.Filter.Spatial){c.property=this.geometryName}}},CLASS_NAME:"OpenLayers.Format.WFST.v1"});OpenLayers.Format.WMC=OpenLayers.Class({defaultVersion:"1.1.0",version:null,layerOptions:null,layerParams:null,parser:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},read:function(g,e){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var b=g.documentElement;var d=this.version;if(!d){d=b.getAttribute("version");if(!d){d=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=d){var a=OpenLayers.Format.WMC["v"+d.replace(/\./g,"_")];if(!a){throw"Can't find a WMC parser for version "+d}this.parser=new a(this.options)}var c=this.parser.read(g,e);var f;if(e.map){this.context=c;if(e.map instanceof OpenLayers.Map){f=this.mergeContextToMap(c,e.map)}else{f=this.contextToMap(c,e.map)}}else{f=c}return f},contextToMap:function(b,c){var a=new OpenLayers.Map(c,{maxExtent:b.maxExtent,projection:b.projection});a.addLayers(b.layers);a.setCenter(b.bounds.getCenterLonLat(),a.getZoomForExtent(b.bounds,true));return a},mergeContextToMap:function(a,b){b.addLayers(a.layers);return b},write:function(e,d){if(e.CLASS_NAME=="OpenLayers.Map"){e=this.mapToContext(e)}var c=(d&&d.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=c){var a=OpenLayers.Format.WMC["v"+c.replace(/\./g,"_")];if(!a){throw"Can't find a WMS capabilities parser for version "+c}this.parser=new a(this.options)}var b=this.parser.write(e,d);return b},mapToContext:function(b){var a={bounds:b.getExtent(),maxExtent:b.maxExtent,projection:b.projection,layers:b.layers,size:b.getSize()};return a},CLASS_NAME:"OpenLayers.Format.WMC"});OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a={};var b=c.documentElement;this.runChildNodes(a,b);return a},runChildNodes:function(f,d){var a=d.childNodes;var c,e;for(var b=0;b<a.length;++b){c=a[b];if(c.nodeType==1){e=this["read_cap_"+c.nodeName];if(e){e.apply(this,[f,c])}}}},read_cap_Capability:function(a,c){var b={layers:[]};this.runChildNodes(b,c);a.capability=b},read_cap_Request:function(c,b){var a={};this.runChildNodes(a,b);c.request=a},read_cap_GetMap:function(a,c){var b={formats:[]};this.runChildNodes(b,c);a.getmap=b},read_cap_Format:function(b,a){if(b.formats){b.formats.push(this.getChildValue(a))}},read_cap_DCPType:function(c,b){var a=b.getElementsByTagName("OnlineResource");if(a.length>0){this.read_cap_OnlineResource(c,a[0])}},read_cap_Service:function(b,c){var a={};this.runChildNodes(a,c);b.service=a},read_cap_Layer:function(h,b,e){var c={formats:h.request.getmap.formats||[],styles:[],queryable:(b.getAttribute("queryable")==="1"||b.getAttribute("queryable")==="true")};if(e){c.styles=c.styles.concat(e.styles);c.llbbox=e.llbbox;c.minScale=e.minScale;c.maxScale=e.maxScale}var j=b.childNodes;var g,f,k;for(var a=0;a<j.length;++a){g=j[a];f=g.nodeName;k=this["read_cap_"+g.nodeName];if(k){if(f=="Layer"){k.apply(this,[h,g,c])}else{k.apply(this,[c,g])}}}if(c.name){var d=c.name.indexOf(":");if(d>0){c.prefix=c.name.substring(0,d)}h.layers.push(c)}},read_cap_ScaleHint:function(a,f){var c=f.getAttribute("min");var e=f.getAttribute("max");var d=Math.pow(2,0.5);var b=OpenLayers.INCHES_PER_UNIT["m"];a.maxScale=parseFloat(((d*c)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13));a.minScale=parseFloat(((d*e)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13))},read_cap_Name:function(c,b){var a=this.getChildValue(b);if(a){c.name=a}},read_cap_Title:function(c,b){var a=this.getChildValue(b);if(a){c.title=a}},read_cap_Abstract:function(c,b){var a=this.getChildValue(b);if(a){c["abstract"]=a}},read_cap_LatLonBoundingBox:function(a,b){a.llbbox=[parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy"))]},read_cap_Style:function(a,c){var b={};this.runChildNodes(b,c);a.styles.push(b)},read_cap_LegendURL:function(a,d){var b={width:d.getAttribute("width"),height:d.getAttribute("height")};var c=d.getElementsByTagName("OnlineResource");if(c.length>0){this.read_cap_OnlineResource(b,c[0])}a.legend=b},read_cap_OnlineResource:function(b,a){b.href=this.getAttributeNS(a,"http://www.w3.org/1999/xlink","href")},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1"});OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.1",version:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var e=this.version;if(!e){e=c.getAttribute("version");if(!e){e=this.defaultVersion}}if(e=="1.1.1"||e=="1.1.0"){e="1.1"}var b=OpenLayers.Format.WMSDescribeLayer["v"+e.replace(/\./g,"_")];if(!b){throw"Can't find a WMS DescribeLayer parser for version "+e}var a=new b(this.options);var d=a.read(f);d.version=e;return d},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"});OpenLayers.Format.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Format.XML,{layerIdentifier:"_layer",featureIdentifier:"_feature",regExes:{trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)},gmlFormat:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,arguments);OpenLayers.Util.extend(this,a);this.options=a},read:function(e){var b;if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var d=e.documentElement;if(d){var a=this;var c=this["read_"+d.nodeName];if(c){b=c.call(this,d)}else{b=new OpenLayers.Format.GML((this.options?this.options:{})).read(e)}}else{b=e}return b},read_msGMLOutput:function(g){var d=[];var f=this.getSiblingNodesByTagCriteria(g,this.layerIdentifier);if(f){for(var a=0,m=f.length;a<m;++a){var b=f[a];var l=b.nodeName;if(b.prefix){l=l.split(":")[1]}var l=l.replace(this.layerIdentifier,"");var e=this.getSiblingNodesByTagCriteria(b,this.featureIdentifier);if(e){for(var k=0;k<e.length;k++){var h=e[k];var p=this.parseGeometry(h);var c=this.parseAttributes(h);var o=new OpenLayers.Feature.Vector(p,c,null);o.type=l;d.push(o)}}}}return d},read_FeatureInfoResponse:function(g){var e=[];var f=this.getElementsByTagNameNS(g,"*","FIELDS");for(var a=0,c=f.length;a<c;a++){var l=f[a];var m=null;var d={};for(var b=0,k=l.attributes.length;b<k;b++){var h=l.attributes[b];d[h.nodeName]=h.nodeValue}e.push(new OpenLayers.Feature.Vector(m,d,null))}return e},getSiblingNodesByTagCriteria:function(a,d){var h=[];var b,c,i,f,e;if(a&&a.hasChildNodes()){b=a.childNodes;i=b.length;for(var g=0;g<i;g++){e=b[g];while(e&&e.nodeType!=1){e=e.nextSibling;g++}c=(e?e.nodeName:"");if(c.length>0&&c.indexOf(d)>-1){h.push(e)}else{f=this.getSiblingNodesByTagCriteria(e,d);if(f.length>0){(h.length==0)?h=f:h.push(f)}}}}return h},parseAttributes:function(b){var d={};if(b.nodeType==1){var c=b.childNodes;n=c.length;for(var a=0;a<n;++a){var j=c[a];if(j.nodeType==1){var h=j.childNodes;if(h.length==1){var g=h[0];if(g.nodeType==3||g.nodeType==4){var f=(j.prefix)?j.nodeName.split(":")[1]:j.nodeName;var e=g.nodeValue.replace(this.regExes.trimSpace,"");d[f]=e}}}}}return d},parseGeometry:function(c){if(!this.gmlFormat){this.gmlFormat=new OpenLayers.Format.GML()}var b=this.gmlFormat.parseFeature(c);var a=null;if(b&&b.geometry){a=b.geometry.clone();b.destroy()}return a},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"});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(b,a,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(d){this.down=d.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 c=this["double"]?OpenLayers.Util.extend({},a):this.callback("rightclick",[a]);var b=OpenLayers.Function.bind(this.delayedRightCall,this,c);this.rightclickTimerId=window.setTimeout(b,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 c=true;if(this.pixelTolerance!=null&&this.down){var b=Math.sqrt(Math.pow(this.down.x-a.xy.x,2)+Math.pow(this.down.y-a.xy.y,2));if(b>this.pixelTolerance){c=false}}return c},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,initialize:function(b,a,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:function(){return true};document.onselectstart=function(){return 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.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=function(){return false}}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(a){if(this.started){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)){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},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(c,a,b,d){OpenLayers.Handler.prototype.initialize.apply(this,[c,b,d]);this.layer=a},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(c){if(this.feature&&!this.feature.layer){this.feature=null}var d=c.type;var a=false;var b=!!(this.feature);var e=(d=="click"||d=="dblclick");this.feature=this.layer.getFeatureFromEvent(c);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(b&&f){if(this.lastFeature){this.triggerCallback(d,"out",[this.lastFeature])}this.triggerCallback(d,"in",[this.feature])}else{if(!b||e){this.triggerCallback(d,"in",[this.feature])}}this.lastFeature=this.feature;a=true}else{if(this.lastFeature&&(b&&f||e)){this.triggerCallback(d,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(b||e)){this.triggerCallback(d,"out",[this.lastFeature])}}return a},triggerCallback:function(b,d,a){var c=this.EVENTMAP[b][d];if(c){if(b=="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(c,a)}}else{this.callback(c,a)}}},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.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(b,a,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(a){if(this.passesTolerance(a.xy)){this.clearTimer();this.callback("move",[a]);this.px=a.xy;a=OpenLayers.Util.extend({},a);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}return !this.stopMove},mouseout:function(a){if(OpenLayers.Util.mouseLeft(a,this.map.div)){this.clearTimer();this.callback("move",[a])}return true},passesTolerance:function(a){var c=true;if(this.pixelTolerance&&this.px){var b=Math.sqrt(Math.pow(this.px.x-a.x,2)+Math.pow(this.px.y-a.y,2));if(b<this.pixelTolerance){c=false}}return c},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(a){this.callback("pause",[a])},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();a=true}return a},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(b,a,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.observe(document,this.KEY_EVENTS[b],this.eventListener)}return true}else{return false}},deactivate:function(){var c=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[b],this.eventListener)}c=true}return c},handleKeyEvent:function(a){if(this.checkModifiers(a)){this.callback(a.type,[a])}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(b,a,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(f){if(!this.map||!this.checkModifiers(f)){return}var d=false;var g=false;var c=false;var k=OpenLayers.Event.element(f);while((k!=null)&&!c&&!d){if(!d){try{if(k.currentStyle){b=k.currentStyle["overflow"]}else{var l=document.defaultView.getComputedStyle(k,null);var b=l.getPropertyValue("overflow")}d=(b&&(b=="auto")||(b=="scroll"))}catch(h){}}if(!g){for(var a=0,j=this.map.layers.length;a<j;a++){if(k==this.map.layers[a].div||k==this.map.layers[a].pane){g=true;break}}}c=(k==this.map.div);k=k.parentNode}if(!d&&c){if(g){this.wheelZoom(f)}OpenLayers.Event.stop(f)}},wheelZoom:function(b){var a=0;if(!b){b=window.event}if(b.wheelDelta){a=b.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){a=-a}}else{if(b.detail){a=-b.detail/3}}if(a){if(this.mousePosition){b.xy=this.mousePosition}if(!b.xy){b.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(a<0){this.callback("down",[b,a])}else{this.callback("up",[b,a])}}},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.options)}OpenLayers.Util.applyDefaults(a,this);a.map=null;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 c=this.getExtent();if(c&&this.inRange&&this.visibility){var b=true;this.moveTo(c,b,false);this.events.triggerEvent("moveend",{"zoomChanged":b});a=true}}return a},moveTo:function(a,c,b){var d=this.visibility;if(!this.isBaseLayer){d=d&&this.inRange}this.display(d)},setMap:function(b){if(this.map==null){this.map=b;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 a=((this.visibility)&&(this.inRange));this.div.style.display=a?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(a){},getImageSize:function(){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(b){var a=this.calculateInRange();if(b!=(this.div.style.display!="none")){this.div.style.display=(b&&a)?"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 b=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var e=["projection","units"];var p=false;var f={};for(var a=0,l=b.length;a<l;a++){var g=b[a];if(this.options[g]&&OpenLayers.Util.indexOf(e,g)==-1){p=true}f[g]=this.options[g]||this.map[g]}if(this.alwaysInRange==null){this.alwaysInRange=!p}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){f.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){f.resolutions=null}if((!f.numZoomLevels)&&(f.maxZoomLevel)){f.numZoomLevels=f.maxZoomLevel+1}if((f.scales!=null)||(f.resolutions!=null)){if(f.scales!=null){f.resolutions=[];for(var a=0,l=f.scales.length;a<l;a++){var d=f.scales[a];f.resolutions[a]=OpenLayers.Util.getResolutionFromScale(d,f.units)}}f.numZoomLevels=f.resolutions.length}else{if(f.minScale){f.maxResolution=OpenLayers.Util.getResolutionFromScale(f.minScale,f.units)}else{if(f.maxResolution=="auto"){var q=this.map.getSize();var j=f.maxExtent.getWidth()/q.w;var k=f.maxExtent.getHeight()/q.h;f.maxResolution=Math.max(j,k)}}if(f.maxScale!=null){f.minResolution=OpenLayers.Util.getResolutionFromScale(f.maxScale,f.units)}else{if((f.minResolution=="auto")&&(f.minExtent!=null)){var q=this.map.getSize();var j=f.minExtent.getWidth()/q.w;var k=f.minExtent.getHeight()/q.h;f.minResolution=Math.max(j,k)}}if(f.minResolution!=null&&this.options.numZoomLevels==undefined){var o=f.maxResolution/f.minResolution;f.numZoomLevels=Math.floor(Math.log(o)/Math.log(2))+1}f.resolutions=new Array(f.numZoomLevels);var c=2;if(typeof f.minResolution=="number"&&f.numZoomLevels>1){c=Math.pow((f.maxResolution/f.minResolution),(1/(f.numZoomLevels-1)))}for(var a=0;a<f.numZoomLevels;a++){var m=f.maxResolution/Math.pow(c,a);f.resolutions[a]=m}}f.resolutions.sort(function(i,r){return(r-i)});this.resolutions=f.resolutions;this.maxResolution=f.resolutions[0];var h=f.resolutions.length-1;this.minResolution=f.resolutions[h];this.scales=[];for(var a=0,l=f.resolutions.length;a<l;a++){this.scales[a]=OpenLayers.Util.getScaleFromResolution(f.resolutions[a],f.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=f.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(c,d){var b=this.map.getSize();var a=Math.max(c.getWidth()/b.w,c.getHeight()/b.h);return this.getZoomForResolution(a,d)},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(k,d){var f;if(this.map.fractionalZoom){var m=0;var c=this.resolutions.length-1;var o=this.resolutions[m];var b=this.resolutions[c];var a;for(var h=0,g=this.resolutions.length;h<g;++h){a=this.resolutions[h];if(a>=k){o=a;m=h}if(a<=k){b=a;c=h;break}}var e=o-b;if(e>0){f=m+((o-k)/e)}else{f=m}}else{var j;var l=Number.POSITIVE_INFINITY;for(var h=0,g=this.resolutions.length;h<g;h++){if(d){j=Math.abs(this.resolutions[h]-k);if(j>l){break}l=j}else{if(this.resolutions[h]<k){break}}}f=Math.max(0,h-1)}return f},getLonLatFromViewPortPx:function(g){var e=null;if(g!=null){var a=this.map.getSize();var d=this.map.getCenter();if(d){var f=this.map.getResolution();var c=g.x-(a.w/2);var b=g.y-(a.h/2);e=new OpenLayers.LonLat(d.lon+c*f,d.lat-b*f);if(this.wrapDateLine){e=e.wrapDateLine(this.maxExtent)}}}return e},getViewPortPxFromLonLat:function(b){var a=null;if(b!=null){var c=this.map.getResolution();var d=this.map.getExtent();a=new OpenLayers.Pixel((1/c*(b.lon-d.left)),(1/c*(d.top-b.lat)))}return a},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var c=0,a=this.div.childNodes.length;c<a;++c){var d=this.div.childNodes[c].firstChild;OpenLayers.Util.modifyDOMElement(d,null,null,null,null,null,null,b)}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(b){if(this.gutter){var a=this.gutter*this.map.getResolution();b=new OpenLayers.Bounds(b.left-a,b.bottom-a,b.right+a,b.top+a)}if(this.wrapDateLine){var c={"rightTolerance":this.getResolution()};b=b.wrapDateLine(this.maxExtent,c)}return b},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(a,b,c){this.bounds=a;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(b,c)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(b,a){if(!b){b="red"}if(!a){a=2}this.div.style.border=a+"px solid "+b},draw:function(a,b){OpenLayers.Util.modifyDOMElement(this.div,null,a,b);return this.div},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsBounds(this.bounds,true,true)}return b},display:function(a){this.div.style.display=(a)?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});(function(){var h=window.XMLHttpRequest;var e=!!window.controllers,d=window.document.all&&!window.opera;function g(){this._object=h?new h:new window.ActiveXObject("Microsoft.XMLHTTP")}if(e&&h.wrapped){g.wrapped=h.wrapped}g.UNSENT=0;g.OPENED=1;g.HEADERS_RECEIVED=2;g.LOADING=3;g.DONE=4;g.prototype.readyState=g.UNSENT;g.prototype.responseText="";g.prototype.responseXML=null;g.prototype.status=0;g.prototype.statusText="";g.prototype.onreadystatechange=null;g.onreadystatechange=null;g.onopen=null;g.onsend=null;g.onabort=null;g.prototype.open=function(o,l,j,i,q){this._async=j;var p=this,k=this.readyState;if(d){var m=function(){if(p._object.readyState!=g.DONE){c(p)}};if(j){window.attachEvent("onunload",m)}}this._object.onreadystatechange=function(){if(e&&!j){return}p.readyState=p._object.readyState;f(p);if(p._aborted){p.readyState=g.UNSENT;return}if(p.readyState==g.DONE){c(p);if(d&&j){window.detachEvent("onunload",m)}}if(k!=p.readyState){a(p)}k=p.readyState};if(g.onopen){g.onopen.apply(this,arguments)}this._object.open(o,l,j,i,q);if(!j&&e){this.readyState=g.OPENED;a(this)}};g.prototype.send=function(i){if(g.onsend){g.onsend.apply(this,arguments)}if(i&&i.nodeType){i=window.XMLSerializer?new window.XMLSerializer().serializeToString(i):i.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(i);if(e&&!this._async){this.readyState=g.OPENED;f(this);while(this.readyState<g.DONE){this.readyState++;a(this);if(this._aborted){return}}}};g.prototype.abort=function(){if(g.onabort){g.onabort.apply(this,arguments)}if(this.readyState>g.UNSENT){this._aborted=true}this._object.abort();c(this)};g.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};g.prototype.getResponseHeader=function(i){return this._object.getResponseHeader(i)};g.prototype.setRequestHeader=function(j,i){if(!this._headers){this._headers={}}this._headers[j]=i;return this._object.setRequestHeader(j,i)};g.prototype.toString=function(){return"["+"object"+" "+"XMLHttpRequest"+"]"};g.toString=function(){return"["+"XMLHttpRequest"+"]"};function a(i){if(i.onreadystatechange){i.onreadystatechange.apply(i)}if(g.onreadystatechange){g.onreadystatechange.apply(i)}}function b(j){var i=j.responseXML;if(d&&i&&!i.documentElement&&j.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){i=new ActiveXObject("Microsoft.XMLDOM");i.loadXML(j.responseText)}if(i){if((d&&i.parseError!=0)||(i.documentElement&&i.documentElement.tagName=="parsererror")){return null}}return i}function f(j){try{j.responseText=j._object.responseText}catch(i){}try{j.responseXML=b(j._object)}catch(i){}try{j.status=j._object.status}catch(i){}try{j.statusText=j._object.statusText}catch(i){}}function c(i){i._object.onreadystatechange=new window.Function;delete i._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(j,i){if(!i){i=[]}j.__func=this;j.__func(i[0],i[1],i[2],i[3],i[4]);delete j.__func}}OpenLayers.Request.XMLHttpRequest=g})();OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(a){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{"statusText":a.statusText}))};OpenLayers.loadURL=function(e,a,g,c,b){if(typeof a=="string"){a=OpenLayers.Util.getParameters(a)}var f=(c)?c:OpenLayers.nullHandler;var d=(b)?b:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:e,params:a,success:f,failure:d,scope:g})};OpenLayers.parseXMLString=function(c){var b=c.indexOf("<");if(b>0){c=c.substring(b)}var a=OpenLayers.Util.Try(function(){var d=new ActiveXObject("Microsoft.XMLDOM");d.loadXML(c);return d},function(){return new DOMParser().parseFromString(c,"text/xml")},function(){var d=new XMLHttpRequest();d.open("GET","data:"+"text/xml"+";charset=utf-8,"+encodeURIComponent(c),false);if(d.overrideMimeType){d.overrideMimeType("text/xml")}d.send(null);return d.responseXML});return a};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(b){for(var a=0;a<this.responders.length;a++){if(b==this.responders[a]){return}}this.responders.push(b)},unregister:function(a){OpenLayers.Util.removeItem(this.reponders,a)},dispatch:function(g,b,f){var a;for(var c=0;c<this.responders.length;c++){a=this.responders[c];if(a[g]&&typeof a[g]=="function"){try{a[g].apply(a,[b,f])}catch(d){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters)}}});OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(a,b){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[b]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(a,"http")){a=OpenLayers.ProxyHost+encodeURIComponent(a)}this.transport=OpenLayers.Ajax.getTransport();this.request(a)},request:function(c){this.url=c;this.method=this.options.method;var a=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){a["_method"]=this.method;this.method="post"}this.parameters=a;if(a=OpenLayers.Util.getParameterString(a)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+a}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){a+="&_="}}}try{var b=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(b)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,b);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10)}this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||a):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var d={"X-Requested-With":"XMLHttpRequest","Accept":"text/javascript, text/html, application/xml, text/xml, */*","OpenLayers":true};if(this.method=="post"){d["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){d["Connection"]="close"}}if(typeof this.options.requestHeaders=="object"){var e=this.options.requestHeaders;if(typeof e.push=="function"){for(var c=0,b=e.length;c<b;c+=2){d[e[c]]=e[c+1]}}else{for(var c in e){d[c]=e[c]}}}for(var a in d){this.transport.setRequestHeader(a,d[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(c){var a=OpenLayers.Ajax.Request.Events[c];var d=new OpenLayers.Ajax.Response(this);if(a=="Complete"){try{this._complete=true;(this.options["on"+d.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(d)}catch(f){this.dispatchException(f)}var b=d.getHeader("Content-type")}try{(this.options["on"+a]||OpenLayers.Ajax.emptyFunction)(d);OpenLayers.Ajax.Responders.dispatch("on"+a,this,d)}catch(f){this.dispatchException(f)}if(a=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},dispatchException:function(c){var e=this.options.onException;if(e){e(this,c);OpenLayers.Ajax.Responders.dispatch("onException",this,c)}else{var a=false;var b=OpenLayers.Ajax.Responders.responders;for(var d=0;d<b.length;d++){if(b[d].onException){a=true;break}}if(a){OpenLayers.Ajax.Responders.dispatch("onException",this,c)}else{throw c}}}});OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(b){this.request=b;var d=this.transport=b.transport,a=this.readyState=d.readyState;if((a>2&&!(!!(window.attachEvent&&!window.opera)))||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=d.responseText==null?"":String(d.responseText)}if(a==4){var c=d.responseXML;this.responseXML=c===undefined?null:c}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(a){return this.transport.getResponseHeader(a)}});OpenLayers.Ajax.getElementsByTagNameNS=function(a,b,e,d){var c=null;if(a.getElementsByTagNameNS){c=a.getElementsByTagNameNS(b,d)}else{c=a.getElementsByTagName(e+":"+d)}return c};OpenLayers.Ajax.serializeXMLToString=function(b){var a=new XMLSerializer();var c=a.serializeToString(b);return c};OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(b,a){},onDrag:function(b,a){},onComplete:function(b,a){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.layer=a;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){if(!this.handlers.drag.dragging){this.feature=a;this.handlers.drag.activate();this.over=true;OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over")}else{if(this.feature.id==a.id){this.over=true}else{this.over=false}}},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b*(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(a){if(!this.over){this.handlers.drag.deactivate()}},doneDragging:function(a){this.onComplete(this.feature,a)},outFeature:function(a){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");this.feature=null}else{if(this.feature.id==a.id){this.over=false}}},cancel:function(){this.handlers.drag.deactivate();this.over=false},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{"move":this.panMap,"done":this.panMapDone},{interval:this.interval})},panMap:function(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.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{"keydown":this.defaultKeyPress});this.activate()},defaultKeyPress:function(b){switch(b.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:var a=this.map.getSize();this.map.pan(0,-0.75*a.h);break;case 34:var a=this.map.getSize();this.map.pan(0,0.75*a.h);break;case 35:var a=this.map.getSize();this.map.pan(0.75*a.w,0);break;case 36:var a=this.map.getSize();this.map.pan(-0.75*a.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut();break}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:false,maxFeatures:10,layers:null,queryVisible:false,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,EVENT_TYPES:["getfeatureinfo"],initialize:function(a){this.EVENT_TYPES=OpenLayers.Control.WMSGetFeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);a=a||{};a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);if(!this.format){this.format=new OpenLayers.Format.WMSGetFeatureInfo(a.formatOptions)}if(this.hover){this.handler=new OpenLayers.Handler.Hover(this,{"move":this.cancelHover,"pause":this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{"delay":250}))}else{this.handler=new OpenLayers.Handler.Click(this,{click:this.getInfoForClick},this.handlerOptions.click||{})}},activate:function(){if(!this.active){this.handler.activate()}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},getInfoForClick:function(a){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");this.request(a.xy,{})},getInfoForHover:function(a){this.request(a.xy,{hover:true})},cancelHover:function(){if(this.hoverRequest){this.hoverRequest.abort();this.hoverRequest=null}},findLayers:function(){var e=[];var f=this.layers||this.map.layers;var a,c;for(var d=0,b=f.length;d<b;++d){a=f[d];if(a instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||a.getVisibility())){c=a.url instanceof Array?a.url[0]:a.url;if(!this.url){this.url=c}if(this.urlMatches(c)){e.push(a)}}}return e},urlMatches:function(c){var b=OpenLayers.Util.isEquivalentUrl(this.url,c);if(!b&&this.layerUrls){for(var d=0,a=this.layerUrls.length;d<a;++d){if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[d],c)){b=true;break}}}return b},request:function(j,a){a=a||{};var c=[];var e=[];var d=this.findLayers();if(d.length>0){for(var g=0,h=d.length;g<h;g++){c=c.concat(d[g].params.LAYERS);if(d[g].params.STYLES){e=e.concat(d[g].params.STYLES)}else{if(d[g].params.LAYERS instanceof Array){e=e.concat(new Array(d[g].params.LAYERS.length))}else{e=e.concat(d[g].params.LAYERS.replace(/[^,]/g,""))}}}var f={url:this.url,params:OpenLayers.Util.applyDefaults({service:"WMS",version:"1.1.0",request:"GetFeatureInfo",layers:c,query_layers:c,styles:e,bbox:this.map.getExtent().toBBOX(),srs:this.map.getProjection(),feature_count:this.maxFeatures,x:j.x,y:j.y,height:this.map.getSize().h,width:this.map.getSize().w,info_format:this.infoFormat},this.vendorParams),callback:function(i){this.handleResponse(j,i)},scope:this};var b=OpenLayers.Request.GET(f);if(a.hover===true){this.hoverRequest=b.priv}}else{OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(a,c){var b=c.responseXML;if(!b||!b.documentElement){b=c.responseText}var d=this.format.read(b);this.events.triggerEvent("getfeatureinfo",{text:c.responseText,features:d,request:c,xy:a});OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},setMap:function(a){this.handler.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:"default",initialize:function(a,c,b){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,c]);this.lonlat=null;this.geometry=a?a:null;this.state=null;this.attributes={};if(c){this.attributes=OpenLayers.Util.extend(this.attributes,c)}this.style=b?b: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(d){var e=false;if(this.layer&&this.layer.map){var c=this.layer.map.getExtent();if(d){var a=this.geometry.getBounds();e=c.intersectsBounds(a)}else{var b=c.toGeometry();e=b.intersects(this.geometry)}}return e},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(c,d,a){var b=false;if(this.geometry){b=this.geometry.atPoint(c,d,a)}return b},destroyPopup:function(){},move:function(b){if(!this.layer||!this.geometry.move){return}var c;if(b.CLASS_NAME=="OpenLayers.LonLat"){c=this.layer.getViewPortPxFromLonLat(b)}else{c=b}var d=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var a=this.layer.map.getResolution();this.geometry.move(a*(c.x-d.x),a*(d.y-c.y));this.layer.drawFeature(this);return d},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:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"select":{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},"temporary":{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}};OpenLayers.Feature.WFS=OpenLayers.Class(OpenLayers.Feature,{initialize:function(a,b){var c=arguments;var d=this.processXMLNode(b);c=new Array(a,d.lonlat,d);OpenLayers.Feature.prototype.initialize.apply(this,c);this.createMarker();this.layer.addMarker(this.marker)},destroy:function(){if(this.marker!=null){this.layer.removeMarker(this.marker)}OpenLayers.Feature.prototype.destroy.apply(this,arguments)},processXMLNode:function(b){var d=OpenLayers.Ajax.getElementsByTagNameNS(b,"http://www.opengis.net/gml","gml","Point");var a=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(d[0],"http://www.opengis.net/gml","gml","coordinates")[0]);var c=a.split(",");return{lonlat:new OpenLayers.LonLat(parseFloat(c[0]),parseFloat(c[1])),id:null}},CLASS_NAME:"OpenLayers.Feature.WFS"});OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.WFSCapabilities,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a={};var b=c.documentElement;this.runChildNodes(a,b);return a},runChildNodes:function(f,d){var a=d.childNodes;var c,e;for(var b=0;b<a.length;++b){c=a[b];if(c.nodeType==1){e=this["read_cap_"+c.nodeName];if(e){e.apply(this,[f,c])}}}},read_cap_FeatureTypeList:function(a,c){var b={featureTypes:[]};this.runChildNodes(b,c);a.featureTypeList=b},read_cap_FeatureType:function(c,d,a){var b={};this.runChildNodes(b,d);c.featureTypes.push(b)},read_cap_Name:function(c,b){var a=this.getChildValue(b);if(a){c.name=a}},read_cap_Title:function(c,b){var a=this.getChildValue(b);if(a){c.title=a}},read_cap_Abstract:function(c,b){var a=this.getChildValue(b);if(a){c["abstract"]=a}},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"});OpenLayers.Format.WMC.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ol:"http://openlayers.org/context",wmc:"http://www.opengis.net/context",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"",getNamespacePrefix:function(b){var a=null;if(b==null){a=this.namespaces[this.defaultPrefix]}else{for(a in this.namespaces){if(this.namespaces[a]==b){break}}}return a},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"Default",initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a=c.documentElement;this.rootPrefix=a.prefix;var b={version:a.getAttribute("version")};this.runChildNodes(b,a);return b},runChildNodes:function(a,b){var h=b.childNodes;var e,j,d,c;for(var f=0,g=h.length;f<g;++f){e=h[f];if(e.nodeType==1){d=this.getNamespacePrefix(e.namespaceURI);c=e.nodeName.split(":").pop();j=this["read_"+d+"_"+c];if(j){j.apply(this,[a,e])}}}},read_wmc_General:function(a,b){this.runChildNodes(a,b)},read_wmc_BoundingBox:function(a,b){a.projection=b.getAttribute("SRS");a.bounds=new OpenLayers.Bounds(parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy")))},read_wmc_LayerList:function(a,b){a.layers=[];this.runChildNodes(a,b)},read_wmc_Layer:function(c,d){var b={params:this.layerParams||{},options:{visibility:(d.getAttribute("hidden")!="1"),queryable:(d.getAttribute("queryable")=="1")},formats:[],styles:[]};this.runChildNodes(b,d);b.params.layers=b.name;b.options.maxExtent=b.maxExtent;var a=this.getLayerFromInfo(b);c.layers.push(a)},getLayerFromInfo:function(b){var c=b.options;if(this.layerOptions){OpenLayers.Util.applyDefaults(c,this.layerOptions)}var a=new OpenLayers.Layer.WMS(b.title,b.href,b.params,c);return a},read_wmc_Extension:function(b,a){this.runChildNodes(b,a)},read_ol_units:function(a,b){a.options.units=this.getChildValue(b)},read_ol_maxExtent:function(c,b){var a=new OpenLayers.Bounds(b.getAttribute("minx"),b.getAttribute("miny"),b.getAttribute("maxx"),b.getAttribute("maxy"));c.maxExtent=a},read_ol_transparent:function(a,b){a.params.transparent=this.getChildValue(b)},read_ol_numZoomLevels:function(a,b){a.options.numZoomLevels=parseInt(this.getChildValue(b))},read_ol_opacity:function(a,b){a.options.opacity=parseFloat(this.getChildValue(b))},read_ol_singleTile:function(a,b){a.options.singleTile=(this.getChildValue(b)=="true")},read_ol_isBaseLayer:function(a,b){a.options.isBaseLayer=(this.getChildValue(b)=="true")},read_ol_displayInLayerSwitcher:function(a,b){a.options.displayInLayerSwitcher=(this.getChildValue(b)=="true")},read_wmc_Server:function(a,b){a.params.version=b.getAttribute("version");this.runChildNodes(a,b)},read_wmc_FormatList:function(a,b){this.runChildNodes(a,b)},read_wmc_Format:function(a,c){var b=this.getChildValue(c);a.formats.push(b);if(c.getAttribute("current")=="1"){a.params.format=b}},read_wmc_StyleList:function(a,b){this.runChildNodes(a,b)},read_wmc_Style:function(a,c){var b={};this.runChildNodes(b,c);if(c.getAttribute("current")=="1"){if(b.href){a.params.sld=b.href}else{if(b.body){a.params.sld_body=b.body}else{a.params.styles=b.name}}}a.styles.push(b)},read_wmc_SLD:function(a,b){this.runChildNodes(a,b)},read_sld_StyledLayerDescriptor:function(a,c){var b=OpenLayers.Format.XML.prototype.write.apply(this,[c]);a.body=b},read_wmc_OnlineResource:function(b,a){b.href=this.getAttributeNS(a,this.namespaces.xlink,"href")},read_wmc_Name:function(c,b){var a=this.getChildValue(b);if(a){c.name=a}},read_wmc_Title:function(c,b){var a=this.getChildValue(b);if(a){c.title=a}},read_wmc_MetadataURL:function(a,d){var b={};var c=d.getElementsByTagName("OnlineResource");if(c.length>0){this.read_wmc_OnlineResource(b,c[0])}a.options.metadataURL=b.href},read_wmc_Abstract:function(c,b){var a=this.getChildValue(b);if(a){c["abstract"]=a}},read_wmc_LatLonBoundingBox:function(a,b){a.llbbox=[parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy"))]},read_wmc_LegendURL:function(a,d){var b={width:d.getAttribute("width"),height:d.getAttribute("height")};var c=d.getElementsByTagName("OnlineResource");if(c.length>0){this.read_wmc_OnlineResource(b,c[0])}a.legend=b},write:function(b,c){var a=this.createElementDefaultNS("ViewContext");this.setAttributes(a,{version:this.VERSION,id:(c&&typeof c.id=="string")?c.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")});this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);a.appendChild(this.write_wmc_General(b));a.appendChild(this.write_wmc_LayerList(b));return OpenLayers.Format.XML.prototype.write.apply(this,[a])},createElementDefaultNS:function(a,b,c){var d=this.createElementNS(this.namespaces[this.defaultPrefix],a);if(b){d.appendChild(this.createTextNode(b))}if(c){this.setAttributes(d,c)}return d},setAttributes:function(d,a){var c;for(var b in a){c=a[b].toString();if(c.match(/[A-Z]/)){this.setAttributeNS(d,null,b,c)}else{d.setAttribute(b,c)}}},write_wmc_General:function(b){var c=this.createElementDefaultNS("General");if(b.size){c.appendChild(this.createElementDefaultNS("Window",null,{width:b.size.w,height:b.size.h}))}var a=b.bounds;c.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:a.left.toPrecision(10),miny:a.bottom.toPrecision(10),maxx:a.right.toPrecision(10),maxy:a.top.toPrecision(10),SRS:b.projection}));c.appendChild(this.createElementDefaultNS("Title",b.title));c.appendChild(this.write_ol_MapExtension(b));return c},write_ol_MapExtension:function(c){var d=this.createElementDefaultNS("Extension");var a=c.maxExtent;if(a){var b=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(b,{minx:a.left.toPrecision(10),miny:a.bottom.toPrecision(10),maxx:a.right.toPrecision(10),maxy:a.top.toPrecision(10)});d.appendChild(b)}return d},write_wmc_LayerList:function(c){var b=this.createElementDefaultNS("LayerList");var a;for(var d=0,e=c.layers.length;d<e;++d){a=c.layers[d];if(a instanceof OpenLayers.Layer.WMS){b.appendChild(this.write_wmc_Layer(a))}}return b},write_wmc_Layer:function(a){var b=this.createElementDefaultNS("Layer",null,{queryable:a.queryable?"1":"0",hidden:a.visibility?"0":"1"});b.appendChild(this.write_wmc_Server(a));b.appendChild(this.createElementDefaultNS("Name",a.params["LAYERS"]));b.appendChild(this.createElementDefaultNS("Title",a.name));if(a.metadataURL){b.appendChild(this.write_wmc_MetadataURL(a))}b.appendChild(this.write_wmc_FormatList(a));b.appendChild(this.write_wmc_StyleList(a));b.appendChild(this.write_wmc_LayerExtension(a));return b},write_wmc_LayerExtension:function(c){var b=this.createElementDefaultNS("Extension");var e=c.maxExtent;var f=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(f,{minx:e.left.toPrecision(10),miny:e.bottom.toPrecision(10),maxx:e.right.toPrecision(10),maxy:e.top.toPrecision(10)});b.appendChild(f);var h=c.params["TRANSPARENT"];if(h){var g=this.createElementNS(this.namespaces.ol,"ol:transparent");g.appendChild(this.createTextNode(h));b.appendChild(g)}var k=["numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"];var d;for(var a=0,j=k.length;a<j;++a){d=this.createOLPropertyNode(c,k[a]);if(d){b.appendChild(d)}}return b},createOLPropertyNode:function(c,a){var b=null;if(c[a]!=null){b=this.createElementNS(this.namespaces.ol,"ol:"+a);b.appendChild(this.createTextNode(c[a].toString()))}return b},write_wmc_Server:function(a){var b=this.createElementDefaultNS("Server");this.setAttributes(b,{service:"OGC:WMS",version:a.params["VERSION"]});b.appendChild(this.write_wmc_OnlineResource(a.url));return b},write_wmc_MetadataURL:function(a){var b=this.createElementDefaultNS("MetadataURL");b.appendChild(this.write_wmc_OnlineResource(a.metadataURL));return b},write_wmc_FormatList:function(a){var b=this.createElementDefaultNS("FormatList");b.appendChild(this.createElementDefaultNS("Format",a.params["FORMAT"],{current:"1"}));return b},write_wmc_StyleList:function(b){var a=this.createElementDefaultNS("StyleList");var i=this.createElementDefaultNS("Style",null,{current:"1"});if(b.params["SLD"]){var f=this.createElementDefaultNS("SLD");var c=this.write_wmc_OnlineResource(b.params["SLD"]);f.appendChild(c);i.appendChild(f)}else{if(b.params["SLD_BODY"]){var f=this.createElementDefaultNS("SLD");var h=b.params["SLD_BODY"];var g=OpenLayers.Format.XML.prototype.read.apply(this,[h]);var e=g.documentElement;if(f.ownerDocument&&f.ownerDocument.importNode){e=f.ownerDocument.importNode(e,true)}f.appendChild(e);i.appendChild(f)}else{var d=b.params["STYLES"]?b.params["STYLES"]:this.defaultStyleName;i.appendChild(this.createElementDefaultNS("Name",d));i.appendChild(this.createElementDefaultNS("Title",this.defaultStyleTitle))}}a.appendChild(i);return a},write_wmc_OnlineResource:function(a){var b=this.createElementDefaultNS("OnlineResource");this.setAttributeNS(b,this.namespaces.xlink,"xlink:type","simple");this.setAttributeNS(b,this.namespaces.xlink,"xlink:href",a);return b},CLASS_NAME:"OpenLayers.Format.WMC.v1"});OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.0",initialize:function(a){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"});OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.1",initialize:function(a){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1"});OpenLayers.Format.WMSDescribeLayer.v1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(a){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[a])},read:function(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var b=e.documentElement;var g=b.childNodes;var d=[];for(var a=0;a<g.length;++a){childNode=g[a];nodeName=childNode.nodeName;if(nodeName=="LayerDescription"){var h="";var f="";var c="";if(childNode.getAttribute("owsType")){h=childNode.getAttribute("owsType");f=childNode.getAttribute("owsURL")}else{if(childNode.getAttribute("wfs")!=""){h="WFS";f=childNode.getAttribute("wfs")}else{if(childNode.getAttribute("wcs")!=""){h="WCS";f=childNode.getAttribute("wcs")}}}query=childNode.getElementsByTagName("Query");if(query.length>0){c=query[0].getAttribute("typeName");if(!c){c=query[0].getAttribute("typename")}}d.push({owsType:h,owsURL:f,typeName:c})}}return d},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(b,a,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var a={"down":this.startBox,"move":this.moveBox,"out":this.removeBox,"up":this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,a,{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 f=Math.abs(b-a.x);var e=Math.abs(c-a.y);this.zoomBox.style.width=Math.max(1,f)+"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 d=this.getBoxCharacteristics();if(d.newBoxModel){if(a.x>b){this.zoomBox.style.width=Math.max(1,f-d.xOffset)+"px"}if(a.y>c){this.zoomBox.style.height=Math.max(1,e-d.yOffset)+"px"}}},endBox:function(f){var c;if(Math.abs(this.dragHandler.start.x-f.x)>5||Math.abs(this.dragHandler.start.y-f.y)>5){var d=this.dragHandler.start;var a=Math.min(d.y,f.y);var g=Math.max(d.y,f.y);var e=Math.min(d.x,f.x);var b=Math.max(d.x,f.x);c=new OpenLayers.Bounds(e,g,b,a)}else{c=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[c])},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 c=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var b=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:c,yOffset:a,newBoxModel:b}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(b,a,c){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,[b,a,c]);this.options=(c)?c:new Object()},setOptions:function(a){OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b={displayInLayerSwitcher:false,calculateInRange:function(){return true}};this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,b);this.map.addLayer(this.layer);a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel()}if(this.layer.map!=null){this.layer.destroy(false);if(this.feature){this.feature.destroy()}}this.layer=null;this.feature=null;a=true}return a},down:function(b){this.fixedRadius=!!(this.radius);var a=this.map.getLonLatFromPixel(b.xy);this.origin=new OpenLayers.Geometry.Point(a.lon,a.lat);if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution()}if(this.persist){this.clear()}this.feature=new OpenLayers.Feature.Vector();this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature],{silent:true});this.layer.drawFeature(this.feature,this.style)},move:function(d){var a=this.map.getLonLatFromPixel(d.xy);var g=new OpenLayers.Geometry.Point(a.lon,a.lat);if(this.irregular){var e=Math.sqrt(2)*Math.abs(g.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,e)}else{if(this.fixedRadius){this.origin=g}else{this.calculateAngle(g,d);this.radius=Math.max(this.map.getResolution()/2,g.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var f=g.x-this.origin.x;var b=g.y-this.origin.y;var c;if(b==0){c=f/(this.radius*Math.sqrt(2))}else{c=f/b}this.feature.geometry.resize(1,this.origin,c);this.feature.geometry.move(f/2,b/2)}this.layer.drawFeature(this.feature,this.style)},up:function(a){this.finalize();if(this.start==this.last){this.callback("done",[a.xy])}},out:function(a){this.finalize()},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180)}this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var d,e,c,f;var a=this.feature.geometry.components[0];if(a.components.length!=(this.sides+1)){this.createGeometry();a=this.feature.geometry.components[0]}for(var b=0;b<this.sides;++b){f=a.components[b];d=this.angle+(b*2*Math.PI/this.sides);f.x=this.origin.x+(this.radius*Math.cos(d));f.y=this.origin.y+(this.radius*Math.sin(d));f.clearBounds()}},calculateAngle:function(d,a){var c=Math.atan2(d.y-this.origin.y,d.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!a[this.snapToggle])){var b=(Math.PI/180)*this.snapAngle;this.angle=Math.round(c/b)*b}else{this.angle=c}},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){this.layer.renderer.clear();this.layer.destroyFeatures()},callback:function(a,b){if(this.callbacks[a]){this.callbacks[a].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(a=="done"||a=="cancel")){this.clear()}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(a,b){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(this.pane==null){this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")}},destroy:function(){this.mapObject=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(OpenLayers.Util.getBrowserName()=="msie"){this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)"}if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane)}else{this.map.layerContainerDiv.appendChild(this.pane)}this.loadMapObject();if(this.mapObject==null){this.loadWarningMessage()}},removeMap:function(a){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane);this.pane=null}OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var d=this.map.getSize();var c=Math.min(d.w,300);var f=Math.min(d.h,200);var a=new OpenLayers.Size(c,f);var g=new OpenLayers.Pixel(d.w/2,d.h/2);var e=g.add(-a.w/2,-a.h/2);var b=OpenLayers.Util.createDiv(this.name+"_warning",e,a,null,null,null,"auto");b.style.padding="7px";b.style.backgroundColor="yellow";b.innerHTML=this.getWarningHTML();this.div.appendChild(b)},getWarningHTML:function(){return""},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(a){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveTo:function(h,b,a){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var g=this.map.getCenter();var e=this.map.getZoom();if(g!=null){var m=this.getMapObjectCenter();var l=this.getOLLonLatFromMapObjectLonLat(m);var c=this.getMapObjectZoom();var j=this.getOLZoomFromMapObjectZoom(c);if(!(g.equals(l))||!(e==j)){if(a&&this.dragPanMapObject&&this.smoothDragPan){var k=this.map.getViewPortPxFromLonLat(l);var i=this.map.getViewPortPxFromLonLat(g);this.dragPanMapObject(i.x-k.x,k.y-i.y)}else{var d=this.getMapObjectLonLatFromOLLonLat(g);var f=this.getMapObjectZoomFromOLZoom(e);this.setMapObjectCenter(d,f,a)}}}}},getLonLatFromViewPortPx:function(c){var b=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var a=this.getMapObjectPixelFromOLPixel(c);var d=this.getMapObjectLonLatFromMapObjectPixel(a);b=this.getOLLonLatFromMapObjectLonLat(d)}return b},getViewPortPxFromLonLat:function(b){var c=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var d=this.getMapObjectLonLatFromOLLonLat(b);var a=this.getMapObjectPixelFromMapObjectLonLat(d);c=this.getOLPixelFromMapObjectPixel(a)}return c},getOLLonLatFromMapObjectLonLat:function(d){var c=null;if(d!=null){var b=this.getLongitudeFromMapObjectLonLat(d);var a=this.getLatitudeFromMapObjectLonLat(d);c=new OpenLayers.LonLat(b,a)}return c},getMapObjectLonLatFromOLLonLat:function(a){var b=null;if(a!=null){b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat)}return b},getOLPixelFromMapObjectPixel:function(a){var d=null;if(a!=null){var b=this.getXFromMapObjectPixel(a);var c=this.getYFromMapObjectPixel(a);d=new OpenLayers.Pixel(b,c)}return d},getMapObjectPixelFromOLPixel:function(a){var b=null;if(a!=null){b=this.getMapObjectPixelFromXY(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var a=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");for(var g=0,c=a.length;g<c;g++){var d=a[g];this[d]=(this.options[d]!=null)?this.options[d]:this.map[d]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var b;var f=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){b=this.maxZoomLevel-this.minZoomLevel+1}else{b=this.numZoomLevels}if(b!=null){this.numZoomLevels=Math.min(b,f)}else{this.numZoomLevels=f}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var e=0;this.resolutions=[];for(var g=this.minZoomLevel;g<=this.maxZoomLevel;g++){this.resolutions[e++]=this.RESOLUTIONS[g]}this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getResolution.apply(this,arguments)}else{var b=null;var a=this.map.getSize();var c=this.getExtent();if((a!=null)&&(c!=null)){b=Math.max(c.getWidth()/a.w,c.getHeight()/a.h)}return b}},getExtent:function(){var c=null;var a=this.map.getSize();var d=new OpenLayers.Pixel(0,0);var f=this.getLonLatFromViewPortPx(d);var e=new OpenLayers.Pixel(a.w,a.h);var b=this.getLonLatFromViewPortPx(e);if((f!=null)&&(b!=null)){c=new OpenLayers.Bounds(f.lon,b.lat,b.lon,f.lat)}return c},getZoomForResolution:function(a){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)}else{var b=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(b)}},getOLZoomFromMapObjectZoom:function(b){var a=null;if(b!=null){a=b-this.minZoomLevel}return a},getMapObjectZoomFromOLZoom:function(b){var a=null;if(b!=null){a=b+this.minZoomLevel}return a},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(b,c,a,e){var d=arguments;d=[b,e];OpenLayers.Layer.prototype.initialize.apply(this,d);this.url=c;this.params=OpenLayers.Util.extend({},a)},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.options)}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);return this.redraw()},redraw:function(a){if(a){return this.mergeNewParams({"_olSalt":Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(b,d){var c=1;for(var e=0,a=b.length;e<a;e++){c*=b.charCodeAt(e)*this.URL_HASH_FACTOR;c-=Math.floor(c)}return d[Math.floor(c*d.length)]},getFullRequestString:function(g,a){var c=a||this.url;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var e=OpenLayers.Util.getParameterString(h);if(c instanceof Array){c=this.selectUrl(e,c)}var f=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c));for(var b in h){if(b.toUpperCase() in f){delete h[b]}}e=OpenLayers.Util.getParameterString(h);var d=c;if(e!=""){var i=c.charAt(c.length-1);if((i=="&")||(i=="?")){d+=e}else{if(c.indexOf("?")==-1){d+="?"+e}else{d+="&"+e}}}return d},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(b,c,d,a,e){this.url=c;this.extent=d;this.maxExtent=d;this.size=a;OpenLayers.Layer.prototype.initialize.apply(this,[b,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.options)}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(b,d,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var a=(this.tile==null);if(d||a){this.setTileSize();var f=new OpenLayers.LonLat(this.extent.left,this.extent.top);var e=this.map.getLayerPxFromLonLat(f);if(a){this.tile=new OpenLayers.Tile.Image(this,e,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=e.clone()}this.tile.draw()}},setTileSize:function(){var b=this.extent.getWidth()/this.map.getResolution();var a=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(b,a)},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(b){if(b!=this.opacity){this.opacity=b;for(var c=0,a=this.markers.length;c<a;c++){this.markers[c].setOpacity(this.opacity)}}},moveTo:function(b,d,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(d||!this.drawn){for(var e=0,a=this.markers.length;e<a;e++){this.drawMarker(this.markers[e])}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(b){var a=this.map.getLayerPxFromLonLat(b.lonlat);if(a==null){b.display(false)}else{if(!b.isDrawn()){var c=b.draw(a);this.div.appendChild(c)}else{if(b.icon){b.icon.moveTo(a)}}}},getDataExtent:function(){var c=null;if(this.markers&&(this.markers.length>0)){var c=new OpenLayers.Bounds();for(var d=0,a=this.markers.length;d<a;d++){var b=this.markers[d];c.extend(b.lonlat)}}return c},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 b=156543.0339;for(var a=0;a<=this.MAX_ZOOM_LEVEL;++a){this.RESOLUTIONS[a]=b/Math.pow(2,a)}this.units="m";this.projection="EPSG:900913"},forwardMercator:function(a,c){var d=a*20037508.34/180;var b=Math.log(Math.tan((90+c)*Math.PI/360))/(Math.PI/180);b=b*20037508.34/180;return new OpenLayers.LonLat(d,b)},inverseMercator:function(a,b){var d=(a/20037508.34)*180;var c=(b/20037508.34)*180;c=180/Math.PI*(2*Math.atan(Math.exp(c*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(d,c)},projectForward:function(b){var a=OpenLayers.Layer.SphericalMercator.forwardMercator(b.x,b.y);b.x=a.lon;b.y=a.lat;return b},projectInverse:function(b){var a=OpenLayers.Layer.SphericalMercator.inverseMercator(b.x,b.y);b.x=a.lon;b.y=a.lat;return b}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);OpenLayers.Tile.WFS=OpenLayers.Class(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(a,e,b,d,c){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=d;this.features=[]},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(this,arguments);this.destroyAllFeatures();this.features=null;this.url=null;if(this.request){this.request.abort();this.request=null}},clear:function(){this.destroyAllFeatures()},draw:function(){if(OpenLayers.Tile.prototype.draw.apply(this,arguments)){if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}this.loadFeaturesForRegion(this.requestSuccess)}},loadFeaturesForRegion:function(a,b){if(this.request){this.request.abort()}this.request=OpenLayers.Request.GET({url:this.url,success:a,failure:b,scope:this})},requestSuccess:function(d){if(this.features){var a=d.responseXML;if(!a||!a.documentElement){a=d.responseText}if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(a))}else{var c=new OpenLayers.Format.XML();if(typeof a=="string"){a=c.read(a)}var b=c.getElementsByTagNameNS(a,"http://www.opengis.net/gml","featureMember");this.addResults(b)}}if(this.events){this.events.triggerEvent("loadend")}this.request=null},addResults:function(c){for(var b=0;b<c.length;b++){var a=new this.layer.featureClass(this.layer,c[b]);this.features.push(a)}},destroyAllFeatures:function(){while(this.features.length>0){var a=this.features.shift();a.destroy()}},CLASS_NAME:"OpenLayers.Tile.WFS"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,initialize:function(a,c,d){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[d]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(e,f){this.layer.events.triggerEvent("sketchmodified",{vertex:e,feature:f})},create:function(e,f){this.layer.events.triggerEvent("sketchstarted",{vertex:e,feature:f})}},this.callbacks);this.layer=a;var b=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(b){this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":b})})}this.handler=new c(this,this.callbacks,this.handlerOptions)},drawFeature:function(a){var b=new OpenLayers.Feature.Vector(a);var c=this.layer.events.triggerEvent("sketchcomplete",{feature:b});if(c!==false){b.state=OpenLayers.State.INSERT;this.layer.addFeatures([b]);this.featureAdded(b);this.events.triggerEvent("featureadded",{feature:b})}},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:false,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:false,initialize:function(a,b){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[b]);this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new a(this,this.callbacks,this.handlerOptions)},cancel:function(){this.handler.cancel()},updateHandler:function(a,b){var c=this.active;if(c){this.deactivate()}this.handler=new a(this,this.callbacks,b);if(c){this.activate()}},measureComplete:function(a){if(this.delayedTrigger){window.clearTimeout(this.delayedTrigger)}this.measure(a,"measure")},measurePartial:function(b,a){this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(a,"measurepartial")},this),this.partialDelay)},measure:function(a,c){var d,b;if(a.CLASS_NAME.indexOf("LineString")>-1){d=this.getBestLength(a);b=1}else{d=this.getBestArea(a);b=2}this.events.triggerEvent(c,{measure:d[0],units:d[1],order:b,geometry:a})},getBestArea:function(b){var c=this.displaySystemUnits[this.displaySystem];var d,e;for(var f=0,a=c.length;f<a;++f){d=c[f];e=this.getArea(b,d);if(e>1){break}}return[e,d]},getArea:function(a,b){var c,d;if(this.geodesic){c=a.getGeodesicArea(this.map.getProjectionObject());d="m"}else{c=a.getArea();d=this.map.getUnits()}var e=OpenLayers.INCHES_PER_UNIT[b];if(e){var f=OpenLayers.INCHES_PER_UNIT[d];c*=Math.pow((f/e),2)}return c},getBestLength:function(b){var c=this.displaySystemUnits[this.displaySystem];var d,f;for(var e=0,a=c.length;e<a;++e){d=c[e];f=this.getLength(b,d);if(f>1){break}}return[f,d]},getLength:function(a,b){var e,c;if(this.geodesic){e=a.getGeodesicLength(this.map.getProjectionObject());c="m"}else{e=a.getLength();c=this.map.getUnits()}var d=OpenLayers.INCHES_PER_UNIT[b];if(d){var f=OpenLayers.INCHES_PER_UNIT[c];e*=(f/d)}return e},CLASS_NAME:"OpenLayers.Control.Measure"});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(c){if(c instanceof OpenLayers.Bounds){if(!this.out){var e=this.map.getLonLatFromPixel(new OpenLayers.Pixel(c.left,c.bottom));var l=this.map.getLonLatFromPixel(new OpenLayers.Pixel(c.right,c.top));var k=new OpenLayers.Bounds(e.lon,e.lat,l.lon,l.lat)}else{var g=Math.abs(c.right-c.left);var i=Math.abs(c.top-c.bottom);var a=Math.min((this.map.size.h/i),(this.map.size.w/g));var f=this.map.getExtent();var b=this.map.getLonLatFromPixel(c.getCenterPixel());var d=b.lon-(f.getWidth()/2)*a;var m=b.lon+(f.getWidth()/2)*a;var j=b.lat-(f.getHeight()/2)*a;var o=b.lat+(f.getHeight()/2)*a;var k=new OpenLayers.Bounds(d,j,m,o)}var h=this.map.getZoom();this.map.zoomToExtent(k);if(h==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(h+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(c),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(c),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(a){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"});OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(a){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"});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(e){var g,d,f;var c=this.regExes.typeStr.exec(e);if(c){d=c[1].toLowerCase();f=c[2];if(this.parse[d]){g=this.parse[d].apply(this,[f])}if(this.internalProjection&&this.externalProjection){if(g&&g.CLASS_NAME=="OpenLayers.Feature.Vector"){g.geometry.transform(this.externalProjection,this.internalProjection)}else{if(g&&d!="geometrycollection"&&typeof g=="object"){for(var a=0,h=g.length;a<h;a++){var b=g[a];b.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return g},write:function(g){var j,c,d,e,f;if(g.constructor==Array){j=g;f=true}else{j=[g];f=false}var h=[];if(f){h.push("GEOMETRYCOLLECTION(")}for(var a=0,b=j.length;a<b;++a){if(f&&a>0){h.push(",")}c=j[a].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]);h.push(d.toUpperCase()+"("+e+")")}if(f){h.push(")")}return h.join("")},extract:{"point":function(a){return a.x+" "+a.y},"multipoint":function(d){var b=[];for(var c=0,a=d.components.length;c<a;++c){b.push(this.extract.point.apply(this,[d.components[c]]))}return b.join(",")},"linestring":function(d){var b=[];for(var c=0,a=d.components.length;c<a;++c){b.push(this.extract.point.apply(this,[d.components[c]]))}return b.join(",")},"multilinestring":function(d){var c=[];for(var b=0,a=d.components.length;b<a;++b){c.push("("+this.extract.linestring.apply(this,[d.components[b]])+")")}return c.join(",")},"polygon":function(c){var d=[];for(var b=0,a=c.components.length;b<a;++b){d.push("("+this.extract.linestring.apply(this,[c.components[b]])+")")}return d.join(",")},"multipolygon":function(b){var d=[];for(var c=0,a=b.components.length;c<a;++c){d.push("("+this.extract.polygon.apply(this,[b.components[c]])+")")}return d.join(",")}},parse:{"point":function(b){var a=OpenLayers.String.trim(b).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0],a[1]))},"multipoint":function(d){var e=OpenLayers.String.trim(d).split(",");var c=[];for(var b=0,a=e.length;b<a;++b){c.push(this.parse.point.apply(this,[e[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(c))},"linestring":function(d){var e=OpenLayers.String.trim(d).split(",");var c=[];for(var b=0,a=e.length;b<a;++b){c.push(this.parse.point.apply(this,[e[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(c))},"multilinestring":function(d){var e;var f=OpenLayers.String.trim(d).split(this.regExes.parenComma);var c=[];for(var b=0,a=f.length;b<a;++b){e=f[b].replace(this.regExes.trimParens,"$1");c.push(this.parse.linestring.apply(this,[e]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(c))},"polygon":function(d){var e,b,c;var g=OpenLayers.String.trim(d).split(this.regExes.parenComma);var f=[];for(var a=0,h=g.length;a<h;++a){e=g[a].replace(this.regExes.trimParens,"$1");b=this.parse.linestring.apply(this,[e]).geometry;c=new OpenLayers.Geometry.LinearRing(b.components);f.push(c)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(f))},"multipolygon":function(d){var f;var b=OpenLayers.String.trim(d).split(this.regExes.doubleParenComma);var c=[];for(var e=0,a=b.length;e<a;++e){f=b[e].replace(this.regExes.trimParens,"$1");c.push(this.parse.polygon.apply(this,[f]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(c))},"geometrycollection":function(d){d=d.replace(/,\s*([A-Za-z])/g,"|$1");var b=OpenLayers.String.trim(d).split("|");var c=[];for(var e=0,a=b.length;e<a;++e){c.push(OpenLayers.Format.WKT.prototype.read.apply(this,[b[e]]))}return c}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMC.v1_0_0"});OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},read_sld_MinScaleDenominator:function(a,b){a.options.maxScale=this.getChildValue(b)},read_sld_MaxScaleDenominator:function(a,b){a.options.minScale=this.getChildValue(b)},write_wmc_Layer:function(a){var d=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[a]);if(a.options.resolutions||a.options.scales||a.options.minResolution||a.options.maxScale){var c=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");c.appendChild(this.createTextNode(a.maxScale.toPrecision(10)));d.insertBefore(c,d.childNodes[3])}if(a.options.resolutions||a.options.scales||a.options.maxResolution||a.options.minScale){var b=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator");b.appendChild(this.createTextNode(a.minScale.toPrecision(10)));d.insertBefore(b,d.childNodes[4])}return d},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(a,b){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(a){var d=a.bounds;var c=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(d.left,d.top));var f=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(d.right,d.bottom));if(f==null||c==null){a.display(false)}else{var b=new OpenLayers.Size(Math.max(1,f.x-c.x),Math.max(1,f.y-c.y));var e=a.draw(c,b);if(!a.drawn){this.div.appendChild(e);a.drawn=true}}},removeMarker:function(a){OpenLayers.Util.removeItem(this.markers,a);if((a.div!=null)&&(a.div.parentNode==this.div)){this.div.removeChild(a.div)}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:true,initialize:function(a,b,c){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[a,c]);this.location=b;this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadRSS:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this});this.loaded=true}},moveTo:function(a,c,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadRSS()}},parseData:function(m){var b=m.responseXML;if(!b||!b.documentElement){b=OpenLayers.Format.XML.prototype.read(m.responseText)}if(this.useFeedTitle){var s=null;try{s=b.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(q){s=b.getElementsByTagName("title")[0].firstChild.nodeValue}if(s){this.setName(s)}}var h={};OpenLayers.Util.extend(h,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){h.externalProjection=this.projection;h.internalProjection=this.map.getProjectionObject()}var o=new OpenLayers.Format.GeoRSS(h);var r=o.read(b);for(var g=0,t=r.length;g<t;g++){var f={};var c=r[g];if(!c.geometry){continue}var l=c.attributes.title?c.attributes.title:"Untitled";var j=c.attributes.description?c.attributes.description:"No description.";var p=c.attributes.link?c.attributes.link:"";var d=c.geometry.getBounds().getCenterLonLat();f.icon=this.icon==null?OpenLayers.Marker.defaultIcon():this.icon.clone();f.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120);if(l||j){f.title=l;f.description=j;var a='<div class="olLayerGeoRSSClose">[x]</div>';a+='<div class="olLayerGeoRSSTitle">';if(p){a+='<a class="link" href="'+p+'" target="_blank">'}a+=l;if(p){a+="</a>"}a+="</div>";a+='<div style="" class="olLayerGeoRSSDescription">';a+=j;a+="</div>";f["popupContentHTML"]=a}var c=new OpenLayers.Feature(this,d,f);this.features.push(c);var k=c.createMarker();k.events.register("click",c,this.markerClick);this.addMarker(k)}this.events.triggerEvent("loadend")},markerClick:function(c){var a=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!a)?this:null;for(var d=0,b=this.layer.map.popups.length;d<b;d++){this.layer.map.removePopup(this.layer.map.popups[d])}if(!a){var e=this.createPopup();OpenLayers.Event.observe(e.div,"click",OpenLayers.Function.bind(function(){for(var g=0,f=this.layer.map.popups.length;g<f;g++){this.layer.map.removePopup(this.layer.map.popups[g])}},this));this.layer.map.addPopup(e)}OpenLayers.Event.stop(c)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,8.58306884765625e-05,4.29153442382813e-05,2.14576721191406e-05,1.07288360595703e-05,5.36441802978515e-06,2.68220901489257e-06],type:null,sphericalMercator:false,dragObject:null,termsOfUse:null,poweredBy:null,initialize:function(a,b){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.addContainerPxFunction();if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{this.mapObject=new GMap2(this.div);if(typeof this.mapObject.getDragObject=="function"){this.dragObject=this.mapObject.getDragObject()}else{this.dragPanMapObject=null}this.termsOfUse=this.div.lastChild;this.div.removeChild(this.termsOfUse);if(this.isFixed){this.map.viewPortDiv.appendChild(this.termsOfUse)}else{this.map.layerContainerDiv.appendChild(this.termsOfUse)}this.termsOfUse.style.zIndex="1100";this.termsOfUse.style.display=this.div.style.display;this.termsOfUse.style.right="";this.termsOfUse.style.bottom="";this.termsOfUse.className="olLayerGoogleCopyright";this.poweredBy=this.div.lastChild;this.div.removeChild(this.poweredBy);if(this.isFixed){this.map.viewPortDiv.appendChild(this.poweredBy)}else{this.map.layerContainerDiv.appendChild(this.poweredBy)}this.poweredBy.style.zIndex="1100";this.poweredBy.style.display=this.div.style.display;this.poweredBy.style.right="";this.poweredBy.style.bottom="";this.poweredBy.className="olLayerGooglePoweredBy gmnoprint"}catch(a){OpenLayers.Console.error(a)}},setMap:function(a){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);if(this.type!=null){this.map.events.register("moveend",this,this.setMapType)}},setMapType:function(){if(this.mapObject.getCenter()!=null){if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1){this.mapObject.addMapType(this.type)}this.mapObject.setMapType(this.type);this.map.events.unregister("moveend",this,this.setMapType)}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize()}else{if(!this._resized){var a=this;var b=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(b);delete a._resized;a.mapObject.checkResize();a.moveTo(a.map.getCenter(),a.map.getZoom())})}this._resized=true}},display:function(a){OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);this.termsOfUse.style.display=this.div.style.display;this.poweredBy.style.display=this.div.style.display},removeMap:function(a){if(this.termsOfUse&&this.termsOfUse.parentNode){this.termsOfUse.parentNode.removeChild(this.termsOfUse);this.termsOfUse=null}if(this.poweredBy&&this.poweredBy.parentNode){this.poweredBy.parentNode.removeChild(this.poweredBy);this.poweredBy=null}OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(c){var b=null;if(c!=null){var d=c.getSouthWest();var a=c.getNorthEast();if(this.sphericalMercator){d=this.forwardMercator(d.lng(),d.lat());a=this.forwardMercator(a.lng(),a.lat())}else{d=new OpenLayers.LonLat(d.lng(),d.lat());a=new OpenLayers.LonLat(a.lng(),a.lat())}b=new OpenLayers.Bounds(d.lon,d.lat,a.lon,a.lat)}return b},getMapObjectBoundsFromOLBounds:function(b){var c=null;if(b!=null){var d=this.sphericalMercator?this.inverseMercator(b.bottom,b.left):new OpenLayers.LonLat(b.bottom,b.left);var a=this.sphericalMercator?this.inverseMercator(b.top,b.right):new OpenLayers.LonLat(b.top,b.right);c=new GLatLngBounds(new GLatLng(d.lat,d.lon),new GLatLng(a.lat,a.lon))}return c},addContainerPxFunction:function(){if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){GMap2.prototype.fromLatLngToContainerPixel=function(b){var c=this.fromLatLngToDivPixel(b);var a=this.getContainer().firstChild.firstChild;c.x+=a.offsetLeft;c.y+=a.offsetTop;return c}}},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},setMapObjectCenter:function(b,a){this.mapObject.setCenter(b,a)},dragPanMapObject:function(b,a){this.dragObject.moveBy(new GSize(-b,a))},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.fromContainerPixelToLatLng(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.fromLatLngToContainerPixel(a)},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lon:a.lng()},getLatitudeFromMapObjectLonLat:function(b){var a=this.sphericalMercator?this.forwardMercator(b.lng(),b.lat()).lat:b.lat();return a},getMapObjectLonLatFromLonLat:function(a,d){var b;if(this.sphericalMercator){var c=this.inverseMercator(a,d);b=new GLatLng(c.lat,c.lon)}else{b=new GLatLng(d,a)}return b},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new GPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(b,c,a,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 e=0,a=this.grid.length;e<a;e++){var d=this.grid[e];for(var f=0,b=d.length;f<b;f++){var c=d[f];this.removeTileMonitoringHooks(c);c.destroy()}}this.grid=[]}},clone:function(a){if(a==null){a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},moveTo:function(b,e,d){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);b=b||this.map.getExtent();if(b!=null){var a=!this.grid.length||e;var c=this.getTilesBounds();if(this.singleTile){if(a||(!d&&!c.containsBounds(b))){this.initSingleTile(b)}}else{if(a||!c.containsBounds(b,true)){this.initGriddedTiles(b)}else{this.moveGriddedTiles(b)}}}},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 e=this.grid.length-1;var d=this.grid[e][0];var b=this.grid[0].length-1;var c=this.grid[0][b];a=new OpenLayers.Bounds(d.bounds.left,d.bounds.bottom,c.bounds.right,c.bounds.top)}return a},initSingleTile:function(c){var a=c.getCenterLonLat();var e=c.getWidth()*this.ratio;var b=c.getHeight()*this.ratio;var d=new OpenLayers.Bounds(a.lon-(e/2),a.lat-(b/2),a.lon+(e/2),a.lat+(b/2));var g=new OpenLayers.LonLat(d.left,d.top);var f=this.map.getLayerPxFromLonLat(g);if(!this.grid.length){this.grid[0]=[]}var h=this.grid[0][0];if(!h){h=this.addTile(d,f);this.addTileMonitoringHooks(h);h.draw();this.grid[0][0]=h}else{h.moveTo(d,f)}this.removeExcessTiles(1,1)},calculateGridLayout:function(j,h,l){var k=l*this.tileSize.w;var d=l*this.tileSize.h;var c=j.left-h.left;var b=Math.floor(c/k)-this.buffer;var o=c/k-b;var g=-o*this.tileSize.w;var p=h.left+b*k;var e=j.top-(h.bottom+d);var a=Math.ceil(e/d)+this.buffer;var i=a-e/d;var f=-i*this.tileSize.h;var m=h.bottom+a*d;return{tilelon:k,tilelat:d,tileoffsetlon:p,tileoffsetlat:m,tileoffsetx:g,tileoffsety:f}},initGriddedTiles:function(u){var i=this.map.getSize();var r=Math.ceil(i.h/this.tileSize.h)+Math.max(1,2*this.buffer);var h=Math.ceil(i.w/this.tileSize.w)+Math.max(1,2*this.buffer);var s=this.maxExtent;var w=this.map.getResolution();var b=this.calculateGridLayout(u,s,w);var e=Math.round(b.tileoffsetx);var m=Math.round(b.tileoffsety);var p=b.tileoffsetlon;var c=b.tileoffsetlat;var v=b.tilelon;var k=b.tilelat;this.origin=new OpenLayers.Pixel(e,m);var z=e;var A=p;var l=0;var j=parseInt(this.map.layerContainerDiv.style.left);var g=parseInt(this.map.layerContainerDiv.style.top);do{var t=this.grid[l++];if(!t){t=[];this.grid.push(t)}p=A;e=z;var B=0;do{var q=new OpenLayers.Bounds(p,c,p+v,c+k);var f=e;f-=j;var a=m;a-=g;var o=new OpenLayers.Pixel(f,a);var d=t[B++];if(!d){d=this.addTile(q,o);this.addTileMonitoringHooks(d);t.push(d)}else{d.moveTo(q,o,false)}p+=v;e+=this.tileSize.w}while((p<=u.right+v*this.buffer)||B<h);c-=k;m+=this.tileSize.h}while((c>=u.bottom-k*this.buffer)||l<r);this.removeExcessTiles(l,B);this.spiralTileLoad()},spiralTileLoad:function(){var c=[];var e=["right","down","left","up"];var k=0;var l=-1;var h=OpenLayers.Util.indexOf(e,"right");var a=0;while(a<e.length){var f=k;var d=l;switch(e[h]){case"right":d++;break;case"down":f++;break;case"left":d--;break;case"up":f--;break}var g=null;if((f<this.grid.length)&&(f>=0)&&(d<this.grid[0].length)&&(d>=0)){g=this.grid[f][d]}if((g!=null)&&(!g.queued)){c.unshift(g);g.queued=true;a=0;k=f;l=d}else{h=(h+1)%4;a++}}for(var j=0,b=c.length;j<b;j++){var g=c[j];g.draw();g.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(o){var c=(o)?0:(this.grid.length-1);var m=this.grid;var a=m[c];var g=this.map.getResolution();var l=(o)?-this.tileSize.h:this.tileSize.h;var k=g*-l;var h=(o)?m.pop():m.shift();for(var f=0,b=a.length;f<b;f++){var d=a[f];var j=d.bounds.clone();var e=d.position.clone();j.bottom=j.bottom+k;j.top=j.top+k;e.y=e.y+l;h[f].moveTo(j,e)}if(o){m.unshift(h)}else{m.push(h)}},shiftColumn:function(m){var e=(m)?-this.tileSize.w:this.tileSize.w;var h=this.map.getResolution();var d=h*e;for(var a=0,k=this.grid.length;a<k;a++){var j=this.grid[a];var c=(m)?0:(j.length-1);var b=j[c];var f=b.bounds.clone();var l=b.position.clone();f.left=f.left+d;f.right=f.right+d;l.x=l.x+e;var g=m?this.grid[a].pop():this.grid[a].shift();g.moveTo(f,l);if(m){j.unshift(g)}else{j.push(g)}}},removeExcessTiles:function(e,a){while(this.grid.length>e){var d=this.grid.pop();for(var c=0,f=d.length;c<f;c++){var b=d[c];this.removeTileMonitoringHooks(b);b.destroy()}}while(this.grid[0].length>a){for(var c=0,f=this.grid.length;c<f;c++){var d=this.grid[c];var b=d.pop();this.removeTileMonitoringHooks(b);b.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(a){var h=this.maxExtent;var d=this.getResolution();var c=d*this.tileSize.w;var e=d*this.tileSize.h;var b=this.getLonLatFromViewPortPx(a);var g=h.left+(c*Math.floor((b.lon-h.left)/c));var f=h.bottom+(e*Math.floor((b.lat-h.bottom)/e));return new OpenLayers.Bounds(g,f,g+c,f+e)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Layer.MultiMap=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[9,1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,8.58306884765625e-05,4.29153442382813e-05],type:null,initialize:function(a,b){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters();this.RESOLUTIONS.unshift(10)}},loadMapObject:function(){try{this.mapObject=new MultimapViewer(this.div)}catch(a){}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{"layerType":"MM","layerLib":"MultiMap"})},setMapObjectCenter:function(b,a){this.mapObject.goToPosition(b,a)},getMapObjectCenter:function(){return this.mapObject.getCurrentPosition()},getMapObjectZoom:function(){return this.mapObject.getZoomFactor()},getMapObjectLonLatFromMapObjectPixel:function(a){a.x=a.x-(this.map.getSize().w/2);a.y=a.y-(this.map.getSize().h/2);return this.mapObject.getMapPositionAt(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.geoPosToContainerPixels(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lon:a.lon},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lat:a.lat},getMapObjectLonLatFromLonLat:function(a,d){var b;if(this.sphericalMercator){var c=this.inverseMercator(a,d);b=new MMLatLon(c.lat,c.lon)}else{b=new MMLatLon(d,a)}return b},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new MMPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.MultiMap"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(a,b){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=new Array()},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadText:function(){if(!this.loaded){if(this.location!=null){var a=function(b){this.events.triggerEvent("loadend")};this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:a,scope:this});this.loaded=true}}},moveTo:function(a,c,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadText()}},parseData:function(f){var j=f.responseText;var a={};OpenLayers.Util.extend(a,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}var o=new OpenLayers.Format.Text(a);var c=o.read(j);for(var k=0,l=c.length;k<l;k++){var e={};var m=c[k];var d;var g,b;d=new OpenLayers.LonLat(m.geometry.x,m.geometry.y);if(m.style.graphicWidth&&m.style.graphicHeight){g=new OpenLayers.Size(m.style.graphicWidth,m.style.graphicHeight)}if(m.style.graphicXOffset!==undefined&&m.style.graphicYOffset!==undefined){b=new OpenLayers.Pixel(m.style.graphicXOffset,m.style.graphicYOffset)}if(m.style.externalGraphic!=null){e.icon=new OpenLayers.Icon(m.style.externalGraphic,g,b)}else{e.icon=OpenLayers.Marker.defaultIcon();if(g!=null){e.icon.setSize(g)}}if((m.attributes.title!=null)&&(m.attributes.description!=null)){e["popupContentHTML"]="<h2>"+m.attributes.title+"</h2>"+"<p>"+m.attributes.description+"</p>"}e["overflow"]=m.attributes.overflow||"auto";var h=new OpenLayers.Feature(this,d,e);this.features.push(h);var p=h.createMarker();if((m.attributes.title!=null)&&(m.attributes.description!=null)){p.events.register("click",h,this.markerClick)}this.addMarker(p)}this.events.triggerEvent("loadend")},markerClick:function(c){var a=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!a)?this:null;for(var d=0,b=this.layer.map.popups.length;d<b;d++){this.layer.map.removePopup(this.layer.map.popups[d])}if(!a){this.layer.map.addPopup(this.createPopup())}OpenLayers.Event.stop(c)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,8.58306884765625e-05,4.29153442382813e-05,2.14576721191406e-05],type:null,sphericalMercator:false,initialize:function(a,b){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){var a=OpenLayers.Util.createDiv(this.name);var c=this.map.getSize();a.style.width=c.w+"px";a.style.height=c.h+"px";this.div.appendChild(a);try{this.mapObject=new VEMap(this.name)}catch(b){}if(this.mapObject!=null){try{this.mapObject.LoadMap(null,null,this.type,true);this.mapObject.AttachEvent("onmousedown",function(){return true})}catch(b){}this.mapObject.HideDashboard()}if(!this.mapObject||!this.mapObject.vemapcontrol||!this.mapObject.vemapcontrol.PanMap||(typeof this.mapObject.vemapcontrol.PanMap!="function")){this.dragPanMapObject=null}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{"layerType":"VE","layerLib":"VirtualEarth"})},setMapObjectCenter:function(b,a){this.mapObject.SetCenterAndZoom(b,a)},getMapObjectCenter:function(){return this.mapObject.GetCenter()},dragPanMapObject:function(b,a){this.mapObject.vemapcontrol.PanMap(b,-a)},getMapObjectZoom:function(){return this.mapObject.GetZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(a){return(typeof VEPixel!="undefined")?this.mapObject.PixelToLatLong(a):this.mapObject.PixelToLatLong(a.x,a.y)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.LatLongToPixel(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Longitude,a.Latitude).lon:a.Longitude},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Longitude,a.Latitude).lat:a.Latitude},getMapObjectLonLatFromLonLat:function(a,c){var d;if(this.sphericalMercator){var b=this.inverseMercator(a,c);d=new VELatLong(b.lat,b.lon)}else{d=new VELatLong(c,a)}return d},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return(typeof VEPixel!="undefined")?new VEPixel(a,b):new Msn.VE.Pixel(a,b)},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,8.58306884765625e-05,4.29153442382813e-05,2.14576721191406e-05,1.07288360595703e-05],type:null,sphericalMercator:false,initialize:function(a,b){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{var a=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new YMap(this.div,this.type,a);this.mapObject.disableKeyControls();this.mapObject.disableDragMap();if(!this.mapObject.moveByXY||(typeof this.mapObject.moveByXY!="function")){this.dragPanMapObject=null}}catch(b){}},onMapResize:function(){try{var a=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(a)}catch(b){}},setMap:function(a){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.fixYahooEventPane)},fixYahooEventPane:function(){var a=OpenLayers.Util.getElement("ygddfdiv");if(a!=null){if(a.parentNode!=null){a.parentNode.removeChild(a)}this.map.events.unregister("moveend",this,this.fixYahooEventPane)}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{"layerType":"Yahoo","layerLib":"Yahoo"})},getOLZoomFromMapObjectZoom:function(b){var a=null;if(b!=null){a=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[b]);a=18-a}return a},getMapObjectZoomFromOLZoom:function(b){var a=null;if(b!=null){a=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[b]);a=18-a}return a},setMapObjectCenter:function(b,a){this.mapObject.drawZoomAndCenter(b,a)},getMapObjectCenter:function(){return this.mapObject.getCenterLatLon()},dragPanMapObject:function(b,a){this.mapObject.moveByXY({"x":-b,"y":a})},getMapObjectZoom:function(){return this.mapObject.getZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.convertXYLatLon(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.convertLatLonXY(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Lon,a.Lat).lon:a.Lon},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Lon,a.Lat).lat:a.Lat},getMapObjectLonLatFromLonLat:function(a,c){var d;if(this.sphericalMercator){var b=this.inverseMercator(a,c);d=new YGeoPoint(b.lat,b.lon)}else{d=new YGeoPoint(c,a)}return d},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new YCoordPoint(a,b)},getMapObjectSizeFromOLSize:function(a){return new YSize(a.w,a.h)},CLASS_NAME:"OpenLayers.Layer.Yahoo"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,initialize:function(a){this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments)},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(a,b,c){return OpenLayers.Function.bind(function(){a.apply(this,[b,c])},this)},read:function(a){a=OpenLayers.Util.applyDefaults(a,this.options);var b=(a.readWithPOST!==undefined)?a.readWithPOST:this.readWithPOST;var c=new OpenLayers.Protocol.Response({requestType:"read"});if(a.filter&&a.filter instanceof OpenLayers.Filter.Spatial){if(a.filter.type==OpenLayers.Filter.Spatial.BBOX){a.params=OpenLayers.Util.extend(a.params,{bbox:a.filter.value.toArray()})}}if(b){c.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,c,a),data:OpenLayers.Util.getParameterString(a.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}else{c.priv=OpenLayers.Request.GET({url:a.url,callback:this.createCallback(this.handleRead,c,a),params:a.params,headers:a.headers})}return c},handleRead:function(b,a){this.handleResponse(b,a)},create:function(c,b){b=OpenLayers.Util.applyDefaults(b,this.options);var a=new OpenLayers.Protocol.Response({reqFeatures:c,requestType:"create"});a.priv=OpenLayers.Request.POST({url:b.url,callback:this.createCallback(this.handleCreate,a,b),headers:b.headers,data:this.format.write(c)});return a},handleCreate:function(b,a){this.handleResponse(b,a)},update:function(b,c){var a=c.url||b.url||this.options.url;c=OpenLayers.Util.applyDefaults(c,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:b,requestType:"update"});d.priv=OpenLayers.Request.PUT({url:a,callback:this.createCallback(this.handleUpdate,d,c),headers:c.headers,data:this.format.write(b)});return d},handleUpdate:function(b,a){this.handleResponse(b,a)},"delete":function(b,c){var a=c.url||b.url||this.options.url;c=OpenLayers.Util.applyDefaults(c,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:b,requestType:"delete"});d.priv=OpenLayers.Request.DELETE({url:a,callback:this.createCallback(this.handleDelete,d,c),headers:c.headers});return d},handleDelete:function(b,a){this.handleResponse(b,a)},handleResponse:function(c,b){var a=c.priv;if(b.callback){if(a.status>=200&&a.status<300){if(c.requestType!="delete"){c.features=this.parseFeatures(a)}c.code=OpenLayers.Protocol.Response.SUCCESS}else{c.code=OpenLayers.Protocol.Response.FAILURE}b.callback.call(b.scope,c)}},parseFeatures:function(b){var a=b.responseXML;if(!a||!a.documentElement){a=b.responseText}if(!a||a.length<=0){return null}return this.format.read(a)},commit:function(o,a){a=OpenLayers.Util.applyDefaults(a,this.options);var j=[],q=0;var e={};e[OpenLayers.State.INSERT]=[];e[OpenLayers.State.UPDATE]=[];e[OpenLayers.State.DELETE]=[];var d,l,b=[];for(var k=0,p=o.length;k<p;++k){d=o[k];l=e[d.state];if(l){l.push(d);b.push(d)}}var r=(e[OpenLayers.State.INSERT].length>0?1:0)+e[OpenLayers.State.UPDATE].length+e[OpenLayers.State.DELETE].length;var h=true;var m=new OpenLayers.Protocol.Response({reqFeatures:b});function f(t){var s=t.features?t.features.length:0;var u=new Array(s);for(var v=0;v<s;++v){u[v]=t.features[v].fid}m.insertIds=u;g.apply(this,[t])}function g(i){this.callUserCallback(i,a);h=h&&i.success();q++;if(q>=r){if(a.callback){m.code=h?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;a.callback.apply(a.scope,[m])}}}var c=e[OpenLayers.State.INSERT];if(c.length>0){j.push(this.create(c,OpenLayers.Util.applyDefaults({callback:f,scope:this},a.create)))}c=e[OpenLayers.State.UPDATE];for(var k=c.length-1;k>=0;--k){j.push(this.update(c[k],OpenLayers.Util.applyDefaults({callback:g,scope:this},a.update)))}c=e[OpenLayers.State.DELETE];for(var k=c.length-1;k>=0;--k){j.push(this["delete"](c[k],OpenLayers.Util.applyDefaults({callback:g,scope:this},a["delete"])))}return j},abort:function(a){if(a){a.priv.abort()}},callUserCallback:function(c,a){var b=a[c.requestType];if(b&&b.callback){b.callback.call(b.scope,c)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(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 b=0,a=this.rules.length;b<a;b++){this.rules[b].destroy();this.rules[b]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(e){var j=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),e);var f=this.rules;var c,h;var k=[];var d=false;for(var a=0,b=f.length;a<b;a++){c=f[a];var g=c.evaluate(e);if(g){if(c instanceof OpenLayers.Rule&&c.elseFilter){k.push(c)}else{d=true;this.applySymbolizer(c,j,e)}}}if(d==false&&k.length>0){d=true;for(var a=0,b=k.length;a<b;a++){this.applySymbolizer(k[a],j,e)}}if(f.length>0&&d==false){j.display="none"}return j},applySymbolizer:function(f,c,d){var e=d.geometry?this.getSymbolizerPrefix(d.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var b=f.symbolizer[e]||f.symbolizer;if(this.defaultsPerSymbolizer===true){var a=this.defaultStyle;OpenLayers.Util.applyDefaults(b,{pointRadius:a.pointRadius});if(b.stroke===true||b.graphic===true){OpenLayers.Util.applyDefaults(b,{strokeWidth:a.strokeWidth,strokeColor:a.strokeColor,strokeOpacity:a.strokeOpacity,strokeDashstyle:a.strokeDashstyle,strokeLinecap:a.strokeLinecap})}if(b.fill===true||b.graphic===true){OpenLayers.Util.applyDefaults(b,{fillColor:a.fillColor,fillOpacity:a.fillOpacity})}if(b.graphic===true){OpenLayers.Util.applyDefaults(b,{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(c,b),d)},createLiterals:function(a,c){var b=this.context||c.attributes||c.data;for(var d in this.propertyStyles){a[d]=OpenLayers.Style.createLiteral(a[d],b,c)}return a},findPropertyStyles:function(){var b={};var g=this.defaultStyle;this.addPropertyStyles(b,g);var e=this.rules;var c,d;for(var a=0,f=e.length;a<f;a++){c=e[a].symbolizer;for(var h in c){d=c[h];if(typeof d=="object"){this.addPropertyStyles(b,d)}else{this.addPropertyStyles(b,c);break}}}return b},addPropertyStyles:function(d,a){var c;for(var b in a){c=a[b];if(typeof c=="string"&&c.match(/\$\{\w+\}/)){d[b]=true}}return d},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(b){var c=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var d=0,a=c.length;d<a;d++){if(b.CLASS_NAME.indexOf(c[d])!=-1){return c[d]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(a,b,c){if(typeof a=="string"&&a.indexOf("${")!=-1){a=OpenLayers.String.format(a,b,[c]);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,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,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();this.zoomBox.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks){this.map.viewPortDiv.oncontextmenu=function(){return false}}var b={"dblclick":this.defaultDblClick,"dblrightclick":this.defaultDblRightClick};var a={"double":true,"stopDouble":true};this.handlers.click=new OpenLayers.Handler.Click(this,b,a);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{"up":this.wheelUp,"down":this.wheelDown});this.activate()},defaultDblClick:function(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,g){var c=this.map.getZoom()+g;if(!this.map.isValidZoomLevel(c)){return}var f=this.map.getSize();var e=f.w/2-a.xy.x;var h=a.xy.y-f.h/2;var i=this.map.baseLayer.getResolutionForZoom(c);var b=this.map.getLonLatFromPixel(a.xy);var d=new OpenLayers.LonLat(b.lon+e*i,b.lat+h*i);this.map.setCenter(d,c)},wheelUp:function(a){this.wheelChange(a,1)},wheelDown:function(a){this.wheelChange(a,-1)},disableZoomWheel:function(){this.zoomWheelEnabled=false;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=true;if(this.active){this.handlers.wheel.activate()}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Filter=OpenLayers.Class({initialize:function(a){OpenLayers.Util.extend(this,a)},destroy:function(){},evaluate:function(a){return true},clone:function(){return null},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(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(d,e,h){var a=false;var f=this.getBounds();if((f!=null)&&(d!=null)){var b=(e!=null)?e:0;var c=(h!=null)?h:0;var g=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-c,this.bounds.right+b,this.bounds.top+c);a=g.containsLonLat(d)}return a},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(b){var f=arguments.callee.format;if(!f){f=new OpenLayers.Format.WKT();arguments.callee.format=f}var e;var c=f.read(b);if(c instanceof OpenLayers.Feature.Vector){e=c.geometry}else{if(c instanceof Array){var a=c.length;var d=new Array(a);for(var g=0;g<a;++g){d[g]=c[g].geometry}e=new OpenLayers.Geometry.Collection(d)}}return e};OpenLayers.Geometry.segmentsIntersect=function(I,f,m){var G=m&&m.point;var o=m&&m.tolerance;var B=false;var e=I.x1-f.x1;var A=I.y1-f.y1;var E=I.x2-I.x1;var k=I.y2-I.y1;var v=f.y2-f.y1;var h=f.x2-f.x1;var z=(v*E)-(h*k);var H=(h*A)-(v*e);var l=(E*A)-(k*e);if(z==0){if(H==0&&l==0){B=true}}else{var r=H/z;var w=l/z;if(r>=0&&r<=1&&w>=0&&w<=1){if(!G){B=true}else{var c=I.x1+(r*E);var a=I.y1+(r*k);B=new OpenLayers.Geometry.Point(c,a)}}}if(o){var F;if(B){if(G){var q=[I,f];var u,c,a;outer:for(var s=0;s<2;++s){u=q[s];for(var t=1;t<3;++t){c=u["x"+t];a=u["y"+t];F=Math.sqrt(Math.pow(c-B.x,2)+Math.pow(a-B.y,2));if(F<o){B.x=c;B.y=a;break outer}}}}}else{var q=[I,f];var b,C,c,a,g,D;outer:for(var s=0;s<2;++s){b=q[s];C=q[(s+1)%2];for(var t=1;t<3;++t){g={x:b["x"+t],y:b["y"+t]};D=OpenLayers.Geometry.distanceToSegment(g,C);if(D.distance<o){if(G){B=new OpenLayers.Geometry.Point(g.x,g.y)}else{B=true}break outer}}}}}return B};OpenLayers.Geometry.distanceToSegment=function(h,j){var g=h.x;var a=h.y;var l=j.x1;var m=j.y1;var d=j.x2;var e=j.y2;var c=d-l;var i=e-m;var k=((c*(g-l))+(i*(a-m)))/(Math.pow(c,2)+Math.pow(i,2));var f,b;if(k<=0){f=l;b=m}else{if(k>=1){f=d;b=e}else{f=l+k*c;b=m+k*i}}return{distance:Math.sqrt(Math.pow(f-g,2)+Math.pow(b-a,2)),x:f,y:b}};OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:true,initialize:function(b,c,a,e){var d=[];a=OpenLayers.Util.upperCaseObject(a);d.push(b,c,a,e);OpenLayers.Layer.Grid.prototype.initialize.apply(this,d);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((e==null)||(!e.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="jpg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(c){c=this.adjustBounds(c);var g=this.projection.getCode().split(":");var h=g[g.length-1];var a=this.getImageSize();var f={"BBOX":c.toBBOX(),"SIZE":a.w+","+a.h,"F":"image","BBOXSR":h,"IMAGESR":h};if(this.layerDefs){var e=[];var d;for(d in this.layerDefs){if(this.layerDefs.hasOwnProperty(d)){if(this.layerDefs[d]){e.push(d);e.push(":");e.push(this.layerDefs[d]);e.push(";")}}}if(e.length>0){f["LAYERDEFS"]=e.join("")}}var b=this.getFullRequestString(f);return b},setLayerFilter:function(a,b){if(!this.layerDefs){this.layerDefs={}}if(b){this.layerDefs[a]=b}else{delete this.layerDefs[a]}},clearLayerFilter:function(a){if(a){delete this.layerDefs[a]}else{delete this.layerDefs}},mergeNewParams:function(a){var b=OpenLayers.Util.upperCaseObject(a);var c=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,c)},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(b,c,a,e){var d=[];d.push(b,c,a,e);OpenLayers.Layer.Grid.prototype.initialize.apply(this,d);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(b){b=this.adjustBounds(b);var a=this.map.getResolution();var e=Math.round((this.map.getScale()*10000))/10000;var d=Math.round(b.left/a);var c=-Math.round(b.top/a);return this.getFullRequestString({t:c,l:d,s:e})},addTile:function(a,c){var b=this.getURL(a);return new OpenLayers.Tile.Image(this,c,a,b,this.tileSize)},calculateGridLayout:function(j,h,l){var k=l*this.tileSize.w;var d=l*this.tileSize.h;var c=j.left;var b=Math.floor(c/k)-this.buffer;var o=c/k-b;var g=-o*this.tileSize.w;var p=b*k;var e=j.top;var a=Math.ceil(e/d)+this.buffer;var i=a-e/d;var f=-(i+1)*this.tileSize.h;var m=a*d;return{tilelon:k,tilelat:d,tileoffsetlon:p,tileoffsetlat:m,tileoffsetx:g,tileoffsety:f}},clone:function(a){if(a==null){a=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},getTileBounds:function(f){var e=this.getResolution();var g=e*this.tileSize.w;var b=e*this.tileSize.h;var c=this.getLonLatFromViewPortPx(f);var d=g*Math.floor(c.lon/g);var a=b*Math.floor(c.lat/b);return new OpenLayers.Bounds(d,a,d+g,a+b)},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,useHttpTile:false,singleTile:false,useOverlay:false,useAsyncOverlay:true,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300,300),initialize:function(b,c,a,d){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(d==null||d.isBaseLayer==null){this.isBaseLayer=((this.transparent!="true")&&(this.transparent!=true))}if(d&&d.useOverlay!=null){this.useOverlay=d.useOverlay}if(this.singleTile){if(this.useOverlay){OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS);if(!this.useAsyncOverlay){this.params.version="1.0.0"}}else{OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS)}}else{if(this.useHttpTile){OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS)}else{OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS)}this.setTileSize(this.defaultSize)}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},getURL:function(h){var e;var a=h.getCenterLonLat();var g=this.map.getCurrentSize();if(this.singleTile){var d={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:g.h*this.ratio,setdisplaywidth:g.w*this.ratio,setviewcenterx:a.lon,setviewcentery:a.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var c={};c=OpenLayers.Util.extend(c,d);c.operation="GETVISIBLEMAPEXTENT";c.version="1.0.0";c.session=this.params.session;c.mapName=this.params.mapName;c.format="text/xml";e=this.getFullRequestString(c);OpenLayers.Request.GET({url:e,async:false})}e=this.getFullRequestString(d)}else{var b=this.map.getResolution();var i=Math.floor((h.left-this.maxExtent.left)/b);i=Math.round(i/this.tileSize.w);var f=Math.floor((this.maxExtent.top-h.top)/b);f=Math.round(f/this.tileSize.h);if(this.useHttpTile){e=this.getImageFilePath({tilecol:i,tilerow:f,scaleindex:this.resolutions.length-this.map.zoom-1})}else{e=this.getFullRequestString({tilecol:i,tilerow:f,scaleindex:this.resolutions.length-this.map.zoom-1})}}return e},getFullRequestString:function(g,a){var c=(a==null)?this.url:a;if(typeof c=="object"){c=c[Math.floor(Math.random()*c.length)]}var d=c;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var f=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(c));for(var b in h){if(b.toUpperCase() in f){delete h[b]}}var e=OpenLayers.Util.getParameterString(h);e=e.replace(/,/g,"+");if(e!=""){var i=c.charAt(c.length-1);if((i=="&")||(i=="?")){d+=e}else{if(c.indexOf("?")==-1){d+="?"+e}else{d+="&"+e}}}return d},getImageFilePath:function(a,f){var e=(f==null)?this.url:f;if(typeof e=="object"){e=e[Math.floor(Math.random()*e.length)]}var g=e;var b="";var d="";if(a.tilerow<0){b="-"}if(a.tilerow==0){b+="0"}else{b+=Math.floor(Math.abs(a.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(a.tilecol<0){d="-"}if(a.tilecol==0){d+="0"}else{d+=Math.floor(Math.abs(a.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var c="/S"+Math.floor(a.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+b+"/C"+d+"/"+(a.tilerow%this.params.tileRowsPerFolder)+"_"+(a.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){c+="?"+this.params.querystring}g+=c;return g},calculateGridLayout:function(j,h,l){var k=l*this.tileSize.w;var d=l*this.tileSize.h;var c=j.left-h.left;var b=Math.floor(c/k)-this.buffer;var o=c/k-b;var g=-o*this.tileSize.w;var p=h.left+b*k;var e=h.top-j.top+d;var a=Math.floor(e/d)-this.buffer;var i=a-e/d;var f=i*this.tileSize.h;var m=h.top-d*a;return{tilelon:k,tilelat:d,tileoffsetlon:p,tileoffsetlat:m,tileoffsetx:g,tileoffsety:f}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(b,c,a,e){var d=[];d.push(b,c,a,e);OpenLayers.Layer.Grid.prototype.initialize.apply(this,d);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(e==null||e.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},getURL:function(a){a=this.adjustBounds(a);var c=[a.left,a.bottom,a.right,a.top];var d=this.getImageSize();var b=this.getFullRequestString({mapext:c,imgext:c,map_size:[d.w,d.h],imgx:d.w/2,imgy:d.h/2,imgxy:[d.w,d.h]});return b},getFullRequestString:function(g,a){var c=(a==null)?this.url:a;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var e=OpenLayers.Util.getParameterString(h);if(c instanceof Array){c=this.selectUrl(e,c)}var f=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c));for(var b in h){if(b.toUpperCase() in f){delete h[b]}}e=OpenLayers.Util.getParameterString(h);var d=c;e=e.replace(/,/g,"+");if(e!=""){var i=c.charAt(c.length-1);if((i=="&")||(i=="?")){d+=e}else{if(c.indexOf("?")==-1){d+="?"+e}else{d+="&"+e}}}return d},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",isBaseLayer:true,tileOrigin:null,serverResolutions:null,initialize:function(a,b,d){var c=[];c.push(a,b,{},d);OpenLayers.Layer.Grid.prototype.initialize.apply(this,c)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.TMS(this.name,this.url,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(a){a=this.adjustBounds(a);var e=this.map.getResolution();var f=Math.round((a.left-this.tileOrigin.lon)/(e*this.tileSize.w));var b=Math.round((a.bottom-this.tileOrigin.lat)/(e*this.tileSize.h));var c=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,e):this.map.getZoom();var g=this.serviceVersion+"/"+this.layername+"/"+c+"/"+f+"/"+b+"."+this.type;var d=this.url;if(d instanceof Array){d=this.selectUrl(g,d)}return d+g},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.map.maxExtent.left,this.map.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.TMS"});OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,format:"image/png",serverResolutions:null,initialize:function(a,b,d,c){this.layername=d;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a,b,{},c]);this.extension=this.format.split("/")[1].toLowerCase();this.extension=(this.extension=="jpg")?"jpeg":this.extension},clone:function(a){if(a==null){a=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(f){var a=this.map.getResolution();var k=this.maxExtent;var i=this.tileSize;var d=Math.round((f.left-k.left)/(a*i.w));var e=Math.round((f.bottom-k.bottom)/(a*i.h));var c=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,a):this.map.getZoom();function b(o,p){o=String(o);var m=[];for(var l=0;l<p;++l){m.push("0")}return m.join("").substring(0,p-o.length)+o}var h=[this.layername,b(c,2),b(parseInt(d/1000000),3),b((parseInt(d/1000)%1000),3),b((parseInt(d)%1000),3),b(parseInt(e/1000000),3),b((parseInt(e/1000)%1000),3),b((parseInt(e)%1000),3)+"."+this.extension];var j=h.join("/");var g=this.url;if(g instanceof Array){g=this.selectUrl(j,g)}g=(g.charAt(g.length-1)=="/")?g:g+"/";return g+j},addTile:function(a,c){var b=this.getURL(a);return new OpenLayers.Tile.Image(this,c,a,b,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,noMagic:false,initialize:function(b,c,a,e){var d=[];a=OpenLayers.Util.upperCaseObject(a);d.push(b,c,a,e);OpenLayers.Layer.Grid.prototype.initialize.apply(this,d);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((e==null)||(!e.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){b=this.adjustBounds(b);var c=this.getImageSize();var a={"BBOX":this.encodeBBOX?b.toBBOX():b.toArray(),"WIDTH":c.w,"HEIGHT":c.h};var d=this.getFullRequestString(a);return d},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},mergeNewParams:function(a){var b=OpenLayers.Util.upperCaseObject(a);var c=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,c)},getFullRequestString:function(a,b){var c=this.map.getProjection();this.params.SRS=(c=="none")?null:c;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:true,lzd:null,zoomLevels:null,initialize:function(b,d,c,a,g,f){this.lzd=c;this.zoomLevels=a;var e=[];e.push(b,d,g,f);OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},getZoom:function(){var a=this.map.getZoom();var b=this.map.getMaxExtent();a=a-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2);return a},getURL:function(a){a=this.adjustBounds(a);var c=this.getZoom();var d=this.map.getMaxExtent();var f=this.lzd/Math.pow(2,this.getZoom());var e=Math.floor((a.left-d.left)/f);var b=Math.floor((a.bottom-d.bottom)/f);if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return this.getFullRequestString({L:c,X:e,Y:b})}else{return OpenLayers.Util.getImagesLocation()+"blank.gif"}},CLASS_NAME:"OpenLayers.Layer.WorldWind"});OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,sphericalMercator:false,initialize:function(a,b,d){if(d&&d.sphericalMercator||this.sphericalMercator){d=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-128*156543.0339,-128*156543.0339,128*156543.0339,128*156543.0339),maxResolution:156543.0339,numZoomLevels:19,units:"m",projection:"EPSG:900913"},d)}b=b||this.url;a=a||this.name;var c=[a,b,{},d];OpenLayers.Layer.Grid.prototype.initialize.apply(this,c)},clone:function(a){if(a==null){a=new OpenLayers.Layer.XYZ(this.name,this.url,this.options)}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},getURL:function(f){var a=this.map.getResolution();var c=Math.round((f.left-this.maxExtent.left)/(a*this.tileSize.w));var b=Math.round((this.maxExtent.top-f.top)/(a*this.tileSize.h));var e=this.map.getZoom();var g=Math.pow(2,e);var d=this.url;var h=""+c+b+e;if(d instanceof Array){d=this.selectUrl(h,d)}var i=OpenLayers.String.format(d,{"x":c,"y":b,"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.Protocol.SQL.Gears=OpenLayers.Class(OpenLayers.Protocol.SQL,{FID_PREFIX:"__gears_fid__",NULL_GEOMETRY:"__gears_null_geometry__",NULL_FEATURE_STATE:"__gears_null_feature_state__",jsonParser:null,wktParser:null,fidRegExp:null,saveFeatureState:true,typeOfFid:"string",db:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Protocol.SQL.prototype.initialize.apply(this,[a]);this.jsonParser=new OpenLayers.Format.JSON();this.wktParser=new OpenLayers.Format.WKT();this.fidRegExp=new RegExp("^"+this.FID_PREFIX);this.initializeDatabase()},initializeDatabase:function(){this.db=google.gears.factory.create("beta.database");this.db.open(this.databaseName);this.db.execute("CREATE TABLE IF NOT EXISTS "+this.tableName+" (fid TEXT UNIQUE, geometry TEXT, properties TEXT,"+"  state TEXT)")},destroy:function(){this.db.close();this.db=null;this.jsonParser=null;this.wktParser=null;OpenLayers.Protocol.SQL.prototype.destroy.apply(this)},supported:function(){return !!(window.google&&google.gears)},read:function(d){d=OpenLayers.Util.applyDefaults(d,this.options);var c,e=[];var b=this.db.execute("SELECT * FROM "+this.tableName);while(b.isValidRow()){c=this.unfreezeFeature(b);if(this.evaluateFilter(c,d.filter)){if(!d.noFeatureStateReset){c.state=null}e.push(c)}b.next()}b.close();var a=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"read",features:e});if(d&&d.callback){d.callback.call(d.scope,a)}return a},unfreezeFeature:function(d){var c;var b=d.fieldByName("geometry");if(b==this.NULL_GEOMETRY){c=new OpenLayers.Feature.Vector()}else{c=this.wktParser.read(b)}c.attributes=this.jsonParser.read(d.fieldByName("properties"));c.fid=this.extractFidFromField(d.fieldByName("fid"));var a=d.fieldByName("state");if(a==this.NULL_FEATURE_STATE){a=null}c.state=a;return c},extractFidFromField:function(a){if(!a.match(this.fidRegExp)&&this.typeOfFid=="number"){a=parseFloat(a)}return a},create:function(c,b){b=OpenLayers.Util.applyDefaults(b,this.options);var a=this.createOrUpdate(c);a.requestType="create";if(b&&b.callback){b.callback.call(b.scope,a)}return a},update:function(c,b){b=OpenLayers.Util.applyDefaults(b,this.options);var a=this.createOrUpdate(c);a.requestType="update";if(b&&b.callback){b.callback.call(b.scope,a)}return a},createOrUpdate:function(g){if(!(g instanceof Array)){g=[g]}var e,a=g.length,d;var b=new Array(a);for(e=0;e<a;e++){d=g[e];var c=this.freezeFeature(d);this.db.execute("REPLACE INTO "+this.tableName+" (fid, geometry, properties, state)"+" VALUES (?, ?, ?, ?)",c);var f=d.clone();f.fid=this.extractFidFromField(c[0]);b[e]=f}return new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,features:b,reqFeatures:g})},freezeFeature:function(d){d.fid=d.fid!=null?""+d.fid:OpenLayers.Util.createUniqueID(this.FID_PREFIX);var b=d.geometry!=null?d.geometry.toString():this.NULL_GEOMETRY;var c=this.jsonParser.write(d.attributes);var a=this.getFeatureStateForFreeze(d);return[d.fid,b,c,a]},getFeatureStateForFreeze:function(b){var a;if(!this.saveFeatureState){a=this.NULL_FEATURE_STATE}else{if(this.createdOffline(b)){a=OpenLayers.State.INSERT}else{a=b.state}}return a},"delete":function(g,e){if(!(g instanceof Array)){g=[g]}e=OpenLayers.Util.applyDefaults(e,this.options);var b,a,c;for(b=0,a=g.length;b<a;b++){c=g[b];if(this.saveFeatureState&&!this.createdOffline(c)){var f=c.clone();f.fid=c.fid;if(f.geometry){f.geometry.destroy();f.geometry=null}f.state=c.state;this.createOrUpdate(f)}else{this.db.execute("DELETE FROM "+this.tableName+" WHERE fid = ?",[c.fid])}}var d=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"delete",reqFeatures:g});if(e&&e.callback){e.callback.call(e.scope,d)}return d},createdOffline:function(a){return(typeof a.fid=="string"&&!!(a.fid.match(this.fidRegExp)))},commit:function(h,a){var g,f=[],j=0,k=0;function m(i){if(++k<j){i.last=false}this.callUserCallback(a,i)}var c,b=[],e=[],l=[];for(var d=h.length-1;d>=0;d--){c=h[d];switch(c.state){case OpenLayers.State.INSERT:b.push(c);break;case OpenLayers.State.UPDATE:e.push(c);break;case OpenLayers.State.DELETE:l.push(c);break}}if(b.length>0){j++;g=OpenLayers.Util.applyDefaults({"callback":m,"scope":this},a.create);f.push(this.create(b,g))}if(e.length>0){j++;g=OpenLayers.Util.applyDefaults({"callback":m,"scope":this},a.update);f.push(this.update(e,g))}if(l.length>0){j++;g=OpenLayers.Util.applyDefaults({"callback":m,"scope":this},a["delete"]);f.push(this["delete"](l,g))}return f},clear:function(){this.db.execute("DELETE FROM "+this.tableName)},callUserCallback:function(a,c){var b=a[c.requestType];if(b&&b.callback){b.callback.call(b.scope,c)}if(c.last&&a.callback){a.callback.call(a.scope)}},CLASS_NAME:"OpenLayers.Protocol.SQL.Gears"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a in this.symbolizer){this.symbolizer[a]=null}this.symbolizer=null},evaluate:function(b){var a=this.getContext(b);var c=true;if(this.minScaleDenominator||this.maxScaleDenominator){var d=b.layer.map.getScale()}if(this.minScaleDenominator){c=d>=OpenLayers.Style.createLiteral(this.minScaleDenominator,a)}if(c&&this.maxScaleDenominator){c=d<OpenLayers.Style.createLiteral(this.maxScaleDenominator,a)}if(c&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){c=this.filter.evaluate(b)}else{c=this.filter.evaluate(a)}}return c},getContext:function(b){var a=this.context;if(!a){a=b.attributes||b.data}if(typeof this.context=="function"){a=this.context(b)}return a},clone:function(){var b=OpenLayers.Util.extend({},this);b.symbolizer={};for(var a in this.symbolizer){value=this.symbolizer[a];type=typeof value;if(type==="object"){b.symbolizer[a]=OpenLayers.Util.extend({},value)}else{if(type==="string"){b.symbolizer[a]=value}}}b.filter=this.filter&&this.filter.clone();b.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(b)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(b,c){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(b instanceof OpenLayers.Style){this.styles["default"]=b;this.styles["select"]=b;this.styles["temporary"]=b;this.styles["delete"]=b}else{if(typeof b=="object"){for(var a in b){if(b[a] instanceof OpenLayers.Style){this.styles[a]=b[a]}else{if(typeof b[a]=="object"){this.styles[a]=new OpenLayers.Style(b[a])}else{this.styles["default"]=new OpenLayers.Style(b);this.styles["select"]=new OpenLayers.Style(b);this.styles["temporary"]=new OpenLayers.Style(b);this.styles["delete"]=new OpenLayers.Style(b);break}}}}}OpenLayers.Util.extend(this,c)},destroy:function(){for(var a in this.styles){this.styles[a].destroy()}this.styles=null},createSymbolizer:function(a,c){if(!a){a=new OpenLayers.Feature.Vector()}if(!this.styles[c]){c="default"}a.renderIntent=c;var b={};if(this.extendDefault&&c!="default"){b=this.styles["default"].createSymbolizer(a)}return OpenLayers.Util.extend(b,this.styles[c].createSymbolizer(a))},addUniqueValueRules:function(a,c,d,e){var b=[];for(var f in d){b.push(new OpenLayers.Rule({symbolizer:d[f],context:e,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:c,value:f})}))}this.styles[a].addRules(b)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Navigation(),new OpenLayers.Control.ZoomBox()])},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:true,lowerBoundary:null,upperBoundary:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(c){var b=false;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:var e=c[this.property];var a=this.value;if(!this.matchCase&&typeof e=="string"&&typeof a=="string"){b=(e.toUpperCase()==a.toUpperCase())}else{b=(e==a)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:var e=c[this.property];var a=this.value;if(!this.matchCase&&typeof e=="string"&&typeof a=="string"){b=(e.toUpperCase()!=a.toUpperCase())}else{b=(e!=a)}break;case OpenLayers.Filter.Comparison.LESS_THAN:b=c[this.property]<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:b=c[this.property]>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:b=c[this.property]<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:b=c[this.property]>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:b=(c[this.property]>=this.lowerBoundary)&&(c[this.property]<=this.upperBoundary);break;case OpenLayers.Filter.Comparison.LIKE:var d=new RegExp(this.value,"gi");b=d.test(c[this.property]);break}return b},value2regex:function(d,a,b){if(d=="."){var c="'.' is an unsupported wildCard character for "+"OpenLayers.Filter.Comparison";OpenLayers.Console.error(c);return null}d=d?d:"*";a=a?a:".";b=b?b:"!";this.value=this.value.replace(new RegExp("\\"+b+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+a,"g"),".");this.value=this.value.replace(new RegExp("\\"+d,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+d);this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+a);return this.value},regex2value:function(){var a=this.value;a=a.replace(/!/g,"!!");a=a.replace(/(\\)?\\\./g,function(c,b){return b?c:"!."});a=a.replace(/(\\)?\\\*/g,function(c,b){return b?c:"!*"});a=a.replace(/\\\\/g,"\\");a=a.replace(/\.\*/g,"*");return a},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison(),this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(a){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(b){for(var d=0,a=this.fids.length;d<a;d++){var c=b.fid||b.id;if(c==this.fids[d]){return true}}return false},clone:function(){var a=new OpenLayers.Filter.FeatureId();OpenLayers.Util.extend(a,this);a.fids=this.fids.slice();return a},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(a){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(b){switch(this.type){case OpenLayers.Filter.Logical.AND:for(var c=0,a=this.filters.length;c<a;c++){if(this.filters[c].evaluate(b)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(var c=0,a=this.filters.length;c<a;c++){if(this.filters[c].evaluate(b)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(b))}},clone:function(){var c=[];for(var b=0,a=this.filters.length;b<a;++b){c.push(this.filters[b].clone())}return new OpenLayers.Filter.Logical({type:this.type,filters:c})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(b){var a=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(b.geometry){var c=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){c=this.value.toGeometry()}if(b.geometry.intersects(c)){a=true}}break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));break}return a},clone:function(){var a=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(a)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(a!=null){this.addComponents(a)}},destroy:function(){this.components.length=0;this.components=null},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var b=[];for(var c=0,a=this.components.length;c<a;c++){b.push(this.components[c].toShortString())}return b.join(",")},calculateBounds:function(){this.bounds=null;if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var b=1,a=this.components.length;b<a;b++){this.extendBounds(this.components[b].getBounds())}}},addComponents:function(b){if(!(b instanceof Array)){b=[b]}for(var c=0,a=b.length;c<a;c++){this.addComponent(b[c])}},addComponent:function(d,e){var b=false;if(d){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,d.CLASS_NAME)>-1)){if(e!=null&&(e<this.components.length)){var a=this.components.slice(0,e);var c=this.components.slice(e,this.components.length);a.push(d);this.components=a.concat(c)}else{this.components.push(d)}d.parent=this;this.clearBounds();b=true}}return b},removeComponents:function(a){if(!(a instanceof Array)){a=[a]}for(var b=a.length-1;b>=0;--b){this.removeComponent(a[b])}},removeComponent:function(a){OpenLayers.Util.removeItem(this.components,a);this.clearBounds()},getLength:function(){var c=0;for(var b=0,a=this.components.length;b<a;b++){c+=this.components[b].getLength()}return c},getArea:function(){var b=0;for(var c=0,a=this.components.length;c<a;c++){b+=this.components[c].getArea()}return b},getGeodesicArea:function(b){var c=0;for(var d=0,a=this.components.length;d<a;d++){c+=this.components[d].getGeodesicArea(b)}return c},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(b){var d=0;for(var c=0,a=this.components.length;c<a;c++){d+=this.components[c].getGeodesicLength(b)}return d},move:function(b,c){for(var d=0,a=this.components.length;d<a;d++){this.components[d].move(b,c)}},rotate:function(c,d){for(var b=0,a=this.components.length;b<a;++b){this.components[b].rotate(c,d)}},resize:function(d,c,a){for(var b=0;b<this.components.length;++b){this.components[b].resize(d,c,a)}return this},distanceTo:function(d,a){var c=!(a&&a.edge===false);var h=c&&a&&a.details;var j,e;var b=Number.POSITIVE_INFINITY;for(var f=0,g=this.components.length;f<g;++f){j=this.components[f].distanceTo(d,a);distance=h?j.distance:j;if(distance<b){b=distance;e=j;if(b==0){break}}}return e},equals:function(b){var d=true;if(!b||!b.CLASS_NAME||(this.CLASS_NAME!=b.CLASS_NAME)){d=false}else{if(!(b.components instanceof Array)||(b.components.length!=this.components.length)){d=false}else{for(var c=0,a=this.components.length;c<a;++c){if(!this.components[c].equals(b.components[c])){d=false;break}}}}return d},transform:function(d,e){if(d&&e){for(var c=0,a=this.components.length;c<a;c++){var b=this.components[c];b.transform(d,e)}this.bounds=null}return this},intersects:function(b){var c=false;for(var d=0,a=this.components.length;d<a;++d){c=b.intersects(this.components[d]);if(c){break}}return c},getVertices:function(c){var b=[];for(var d=0,a=this.components.length;d<a;++d){Array.prototype.push.apply(b,this.components[d].getVertices(c))}return b},CLASS_NAME:"OpenLayers.Geometry.Collection"});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(d,a){var b=!(a&&a.edge===false);var i=b&&a&&a.details;var e,g,h,c,j,f;if(d instanceof OpenLayers.Geometry.Point){g=this.x;h=this.y;c=d.x;j=d.y;e=Math.sqrt(Math.pow(g-c,2)+Math.pow(h-j,2));f=!i?e:{x0:g,y0:h,x1:c,y1:j,distance:e}}else{f=d.distanceTo(this,a);if(i){f={x0:f.x1,y0:f.y1,x1:f.x0,y1:f.y0,distance:f.distance}}}return f},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(c,d){c*=Math.PI/180;var a=this.distanceTo(d);var b=c+Math.atan2(this.y-d.y,this.x-d.x);this.x=d.x+(a*Math.cos(b));this.y=d.y+(a*Math.sin(b));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(c,b,a){a=(a==undefined)?1:a;this.x=b.x+(c*a*(this.x-b.x));this.y=b.y+(c*(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.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(a,b,c,d){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=a;this.y=b;this.width=c;this.height=d},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)},getLength:function(){var a=(2*this.width)+(2*this.height);return a},getArea:function(){var a=this.width*this.height;return a},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers.Layer.KaMapCache=OpenLayers.Class(OpenLayers.Layer.KaMap,{IMAGE_EXTENSIONS:{"jpeg":"jpg","gif":"gif","png":"png","png8":"png","png24":"png","dithered":"png"},DEFAULT_FORMAT:"jpeg",initialize:function(b,c,a,d){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments);this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||DEFAULT_FORMAT]},getURL:function(d){d=this.adjustBounds(d);var i=this.map.getResolution();var b=Math.round((this.map.getScale()*10000))/10000;var a=Math.round(d.left/i);var e=-Math.round(d.top/i);var h=Math.floor(a/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w;var g=Math.floor(e/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h;var c=this.url;if(c instanceof Array){c=this.selectUrl(paramsString,c)}var f=[c,"/",this.params.map,"/",b,"/",this.params.g.replace(/\s/g,"_"),"/def/t",g,"/l",h,"/t",e,"l",a,".",this.extension];return f.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:true,initialize:function(b,c,a,e){OpenLayers.Layer.MapServer.prototype.initialize.apply(this,arguments);var d="The OpenLayers.Layer.MapServer.Untiled class is deprecated and "+"will be removed in 3.0. Instead, you should use the "+"normal OpenLayers.Layer.MapServer class, passing it the option "+"'singleTile' as true.";OpenLayers.Console.warn(d)},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer.Untiled(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.MapServer.prototype.clone.apply(this,[a]);return a},CLASS_NAME:"OpenLayers.Layer.MapServer.Untiled"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(b,d){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,a=this.strategies.length;c<a;c++){this.strategies[c].setLayer(this)}}},destroy:function(){if(this.strategies){var c,b,a;for(b=0,a=this.strategies.length;b<a;b++){c=this.strategies[b];if(c.autoDestroy){c.destroy()}}this.strategies=null}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()}this.protocol=null}this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;if(this.renderer){this.renderer.destroy()}this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},refresh:function(a){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",a)}},assignRenderer:function(){for(var b=0,a=this.renderers.length;b<a;b++){var c=OpenLayers.Renderer[this.renderers[b]];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 c,b,a;for(b=0,a=this.strategies.length;b<a;b++){c=this.strategies[b];if(c.autoActivate){c.activate()}}}},removeMap:function(d){if(this.strategies){var c,b,a;for(b=0,a=this.strategies.length;b<a;b++){c=this.strategies[b];if(c.autoActivate){c.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(d,b,f){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var e=true;if(!f){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 c=this.map.getExtent();e=this.renderer.setExtent(c,b);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!b&&e){for(var a in this.unrenderedFeatures){var h=this.unrenderedFeatures[a];this.drawFeature(h)}}}if(!this.drawn||b||!e){this.drawn=true;var h;for(var a=0,g=this.features.length;a<g;a++){this.renderer.locked=(a!==(g-1));h=this.features[a];this.drawFeature(h)}}},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(f,a){if(!(f instanceof Array)){f=[f]}var c=!a||!a.silent;if(c){var d={features:f};var b=this.events.triggerEvent("beforefeaturesadded",d);if(b===false){return}f=d.features}for(var e=0,g=f.length;e<g;e++){if(e!=(f.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var j=f[e];if(this.geometryType&&!(j.geometry instanceof this.geometryType)){var h=OpenLayers.i18n("componentShouldBe",{"geomType":this.geometryType.prototype.CLASS_NAME});throw h}this.features.push(j);j.layer=this;if(!j.style&&this.style){j.style=OpenLayers.Util.extend({},this.style)}if(c){if(this.events.triggerEvent("beforefeatureadded",{feature:j})===false){continue}this.preFeatureInsert(j)}this.drawFeature(j);if(c){this.events.triggerEvent("featureadded",{feature:j});this.onFeatureInsert(j)}}if(c){this.events.triggerEvent("featuresadded",{features:f})}},removeFeatures:function(e,c){if(!e||e.length===0){return}if(!(e instanceof Array)){e=[e]}if(e===this.features){e=e.slice()}var d=!c||!c.silent;for(var a=e.length-1;a>=0;a--){if(a!=0&&e[a-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var b=e[a];delete this.unrenderedFeatures[b.id];if(d){this.events.triggerEvent("beforefeatureremoved",{feature:b})}this.features=OpenLayers.Util.removeItem(this.features,b);b.layer=null;if(b.geometry){this.renderer.eraseFeatures(b)}if(OpenLayers.Util.indexOf(this.selectedFeatures,b)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,b)}if(d){this.events.triggerEvent("featureremoved",{feature:b})}}if(d){this.events.triggerEvent("featuresremoved",{features:e})}},destroyFeatures:function(d,b){var c=(d==undefined);if(c){d=this.features}if(d){this.removeFeatures(d,b);for(var a=d.length-1;a>=0;a--){d[a].destroy()}}},drawFeature:function(c,b){if(!this.drawn){return}if(typeof b!="object"){if(!b&&c.state===OpenLayers.State.DELETE){b="delete"}var a=b||c.renderIntent;b=c.style||this.style;if(!b){b=this.styleMap.createSymbolizer(c,a)}}if(!this.renderer.drawFeature(c,b)){this.unrenderedFeatures[c.id]=c}else{delete this.unrenderedFeatures[c.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(b){var c=null;for(var d=0,a=this.features.length;d<a;++d){if(this.features[d].id==b){c=this.features[d];break}}return c},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getDataExtent:function(){var b=null;if(this.features&&(this.features.length>0)){b=new OpenLayers.Bounds();for(var c=0,a=this.features.length;c<a;c++){b.extend(this.features[c].geometry.getBounds())}}return b},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS,{singleTile:true,initialize:function(b,c,a,e){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);var d="The OpenLayers.Layer.WMS.Untiled class is deprecated and "+"will be removed in 3.0. Instead, you should use the "+"normal OpenLayers.Layer.WMS class, passing it the option "+"'singleTile' as true.";OpenLayers.Console.warn(d)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.WMS.prototype.clone.apply(this,[a]);return a},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"});OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:false,click:true,clickout:true,toggle:false,clickTolerance:5,hover:false,box:false,maxFeatures:10,features:null,hoverFeature:null,handlerOptions:null,handlers:null,hoverResponse:null,EVENT_TYPES:["featureselected","featureunselected","clickout","beforefeatureselected","hoverfeature","outfeature"],initialize:function(a){this.EVENT_TYPES=OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);this.features={};this.handlers={};if(this.click){this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectSingle},this.handlerOptions.click||{})}if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"}))}if(this.hover){this.handlers.hover=new OpenLayers.Handler.Hover(this,{"move":this.cancelHover,"pause":this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{"delay":250}))}},activate:function(){if(!this.active){for(var a in this.handlers){this.handlers[a].activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){for(var a in this.handlers){this.handlers[a].deactivate()}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(c){var b;for(var a=this.features.length-1;a>=0;--a){b=this.features[a];if(!c||c.except!=b){this.unselect(b)}}},selectSingle:function(b){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var a=this.pixelToBounds(b.xy);this.setModifiers(b);this.request(a,{single:true})},selectBox:function(d){if(d instanceof OpenLayers.Bounds){var c=this.map.getLonLatFromPixel(new OpenLayers.Pixel(d.left,d.bottom));var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(d.right,d.top));var a=new OpenLayers.Bounds(c.lon,c.lat,b.lon,b.lat);this.setModifiers(this.handlers.box.dragHandler.evt);this.request(a)}},selectHover:function(b){var a=this.pixelToBounds(b.xy);this.request(a,{single:true,hover:true})},cancelHover:function(){if(this.hoverResponse){this.protocol.abort(this.hoverResponse);this.hoverResponse=null}},request:function(a,c){c=c||{};var d=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:a});var b=this.protocol.read({maxFeatures:c.single==true?this.maxFeatures:undefined,filter:d,callback:function(e){if(e.code==1){if(e.features.length){if(c.single==true){this.selectBestFeature(e.features,a.getCenterLonLat(),c)}else{this.select(e.features)}}else{if(c.hover){this.hoverSelect()}else{this.events.triggerEvent("clickout");if(this.clickout){this.unselectAll()}}}}OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});if(c.hover==true){this.hoverResponse=b}},selectBestFeature:function(g,h,a){a=a||{};if(g.length){var f=new OpenLayers.Geometry.Point(h.lon,h.lat);var j,e,d;var b=Number.MAX_VALUE;for(var c=0;c<g.length;++c){j=g[c];if(j.geometry){d=f.distanceTo(j.geometry,{edge:false});if(d<b){b=d;e=j;if(b==0){break}}}}if(a.hover==true){this.hoverSelect(e)}else{this.select(e||g)}}},setModifiers:function(a){this.modifiers={multiple:this.multiple||(this.multipleKey&&a[this.multipleKey]),toggle:this.toggle||(this.toggleKey&&a[this.toggleKey])}},select:function(d){if(!this.modifiers.multiple&&!this.modifiers.toggle){this.unselectAll()}if(!(d instanceof Array)){d=[d]}var b;for(var c=0,a=d.length;c<a;++c){b=d[c];if(this.features[b.fid||b.id]){if(this.modifiers.toggle){this.unselect(this.features[b.fid||b.id])}}else{cont=this.events.triggerEvent("beforefeatureselected",{feature:b});if(cont!==false){this.features[b.fid||b.id]=b;this.events.triggerEvent("featureselected",{feature:b})}}}},hoverSelect:function(b){var c=b?b.fid||b.id:null;var a=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;if(a&&a!=c){this.events.triggerEvent("outfeature",{feature:this.hoverFeature});this.hoverFeature=null}if(c&&c!=a){this.events.triggerEvent("hoverfeature",{feature:b});this.hoverFeature=b}},unselect:function(a){delete this.features[a.fid||a.id];this.events.triggerEvent("featureunselected",{feature:a})},unselectAll:function(){for(var a in this.features){this.unselect(this.features[a])}},setMap:function(b){for(var a in this.handlers){this.handlers[a].setMap(b)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(b){var a=b.add(-this.clickTolerance/2,this.clickTolerance/2);var d=b.add(this.clickTolerance/2,-this.clickTolerance/2);var c=this.map.getLonLatFromPixel(a);var e=this.map.getLonLatFromPixel(d);return new OpenLayers.Bounds(c.lon,c.lat,e.lon,e.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesnap","snap","unsnap"],DEFAULTS:{tolerance:10,node:true,edge:true,vertex:true},greedy:true,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(b){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[b]);this.options=b||{};if(this.options.layer){this.setLayer(this.options.layer)}var a=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(a,this.DEFAULTS);this.setTargets(this.options.targets);if(this.targets.length===0&&this.layer){this.addTargetLayer(this.layer)}this.geoToleranceCache={}},setLayer:function(a){if(this.active){this.deactivate();this.layer=a;this.activate()}else{this.layer=a}},setTargets:function(a){this.targets=[];if(a&&a.length){var c;for(var d=0,b=a.length;d<b;++d){c=a[d];if(c instanceof OpenLayers.Layer.Vector){this.addTargetLayer(c)}else{this.addTarget(c)}}}},addTargetLayer:function(a){this.addTarget({layer:a})},addTarget:function(a){a=OpenLayers.Util.applyDefaults(a,this.defaults);a.nodeTolerance=a.nodeTolerance||a.tolerance;a.vertexTolerance=a.vertexTolerance||a.tolerance;a.edgeTolerance=a.edgeTolerance||a.tolerance;this.targets.push(a)},removeTargetLayer:function(a){var b;for(var c=this.targets.length-1;c>=0;--c){b=this.targets[c];if(b.layer===a){this.removeTarget(b)}}},removeTarget:function(a){return OpenLayers.Util.removeItem(this.targets,a)},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}this.feature=null;this.point=null;return a},onSketchModified:function(a){this.feature=a.feature;this.considerSnapping(a.vertex,a.vertex)},onVertexModified:function(b){this.feature=b.feature;var a=this.layer.map.getLonLatFromViewPortPx(b.pixel);this.considerSnapping(b.vertex,new OpenLayers.Geometry.Point(a.lon,a.lat))},considerSnapping:function(e,d){var f={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null};var g=false;var j,h;for(var a=0,b=this.targets.length;a<b;++a){h=this.targets[a];j=this.testTarget(h,d);if(j){if(this.greedy){f=j;f.target=h;g=true;break}else{if((j.rank<f.rank)||(j.rank===f.rank&&j.dist<f.dist)){f=j;f.target=h;g=true}}}}if(g){var c=this.events.triggerEvent("beforesnap",{point:e,x:f.x,y:f.y,distance:f.dist,layer:f.target.layer,snapType:this.precedence[f.rank]});if(c!==false){e.x=f.x;e.y=f.y;this.point=e;this.events.triggerEvent("snap",{point:e,snapType:this.precedence[f.rank],layer:f.target.layer,distance:f.dist})}else{g=false}}if(this.point&&!g){e.x=d.x;e.y=d.y;this.point=null;this.events.triggerEvent("unsnap",{point:e})}},testTarget:function(u,z){var h={node:this.getGeoTolerance(u.nodeTolerance),vertex:this.getGeoTolerance(u.vertexTolerance),edge:this.getGeoTolerance(u.edgeTolerance)};var c=Math.max(h.node,h.vertex,h.edge);var m={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY};var q=false;var s=u.layer.features;var b,a,d,r,A,w,e;var l=this.precedence.length;var p=new OpenLayers.LonLat(z.x,z.y);for(var f=0,B=s.length;f<B;++f){b=s[f];if(b!==this.feature&&!b._sketch&&b.state!==OpenLayers.State.DELETE&&(!u.filter||u.filter.evaluate(b.attributes))){if(b.atPoint(p,c,c)){for(var g=0,v=Math.min(m.rank+1,l);g<v;++g){a=this.precedence[g];if(u[a]){if(a==="edge"){A=b.geometry.distanceTo(z,{details:true});w=A.distance;if(w<=h[a]&&w<m.dist){m={rank:g,dist:w,x:A.x0,y:A.y0};q=true;break}}else{d=b.geometry.getVertices(a==="node");e=false;for(var o=0,t=d.length;o<t;++o){r=d[o];w=r.distanceTo(z);if(w<=h[a]&&(g<m.rank||(g===m.rank&&w<m.dist))){m={rank:g,dist:w,x:r.x,y:r.y};q=true;e=true}}if(e){break}}}}}}}return q?m:null},getGeoTolerance:function(c){var b=this.layer.map.getResolution();if(b!==this.resolution){this.resolution=b;this.geoToleranceCache={}}var a=this.geoToleranceCache[c];if(a===undefined){a=c*b;this.geoToleranceCache[c]=a}return a},destroy:function(){if(this.active){this.deactivate()}delete this.layer;delete this.targets;OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"});OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},write:function(d,c){var b=(c&&c.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=b){var a=OpenLayers.Format.Filter["v"+b.replace(/\./g,"_")];if(!a){throw"Can't find a Filter parser for version "+b}this.parser=new a(this.options)}return this.parser.write(d)},read:function(d){if(typeof d=="string"){d=OpenLayers.Format.XML.prototype.read.apply(this,[d])}var b=this.version;if(!b){b=this.defaultVersion}if(!this.parser||this.parser.VERSION!=b){var a=OpenLayers.Format.Filter["v"+b.replace(/\./g,"_")];if(!a){throw"Can't find a Filter parser for version "+b}this.parser=new a(this.options)}var c=this.parser.read(d);return c},CLASS_NAME:"OpenLayers.Format.Filter"});OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,namedLayersAsArray:false,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},write:function(c,e){var d=(e&&e.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=d){var b=OpenLayers.Format.SLD["v"+d.replace(/\./g,"_")];if(!b){throw"Can't find a SLD parser for version "+d}this.parser=new b(this.options)}var a=this.parser.write(c);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},read:function(f,e){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var b=f.documentElement;var c=this.version;if(!c){c=b.getAttribute("version");if(!c){c=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=c){var a=OpenLayers.Format.SLD["v"+c.replace(/\./g,"_")];if(!a){throw"Can't find a SLD parser for version "+c}this.parser=new a(this.options)}var d=this.parser.read(f,e);return d},CLASS_NAME:"OpenLayers.Format.SLD"});OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:true,initialize:function(a){a=a||{};if(a.extractStyles!==false){a.defaultStyle={"externalGraphic":OpenLayers.Util.getImagesLocation()+"marker.png","graphicWidth":21,"graphicHeight":25,"graphicXOffset":-10.5,"graphicYOffset":-12.5}}OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(b){var s=b.split("\n");var m;var r=[];for(var p=0;p<(s.length-1);p++){var t=s[p].replace(/^\s*/,"").replace(/\s*$/,"");if(t.charAt(0)!="#"){if(!m){m=t.split("\t")}else{var k=t.split("\t");var g=new OpenLayers.Geometry.Point(0,0);var d={};var l=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null;var i,a,h,j;var f=false;for(var o=0;o<k.length;o++){if(k[o]){if(m[o]=="point"){var u=k[o].split(",");g.y=parseFloat(u[0]);g.x=parseFloat(u[1]);f=true}else{if(m[o]=="lat"){g.y=parseFloat(k[o]);f=true}else{if(m[o]=="lon"){g.x=parseFloat(k[o]);f=true}else{if(m[o]=="title"){d["title"]=k[o]}else{if(m[o]=="image"||m[o]=="icon"&&l){l["externalGraphic"]=k[o]}else{if(m[o]=="iconSize"&&l){var e=k[o].split(",");l["graphicWidth"]=parseFloat(e[0]);l["graphicHeight"]=parseFloat(e[1])}else{if(m[o]=="iconOffset"&&l){var q=k[o].split(",");l["graphicXOffset"]=parseFloat(q[0]);l["graphicYOffset"]=parseFloat(q[1])}else{if(m[o]=="description"){d["description"]=k[o]}else{if(m[o]=="overflow"){d["overflow"]=k[o]}else{d[m[o]]=k[o]}}}}}}}}}}}if(f){if(this.internalProjection&&this.externalProjection){g.transform(this.externalProjection,this.internalProjection)}var c=new OpenLayers.Feature.Vector(g,d,l);r.push(c)}}}}return r},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(b,a){this.addComponent(b,a)},removePoint:function(a){this.removeComponent(a)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(b,a,c){if(!(c&&c.layerOptions&&c.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var a=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a);this.map.addLayer(this.layer);return true},createFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}if(this.drawing){this.cancel()}this.destroyFeature();if(this.layer.map!=null){this.layer.destroy(false)}this.layer=null;return true},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.point=null},finalize:function(b){var a=b?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(a,[this.geometryClone()]);if(b||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(a){OpenLayers.Event.stop(a);return false},dblclick:function(a){OpenLayers.Event.stop(a);return false},modifyFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.point&&this.point.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPoint([a])}return a},geometryClone:function(){var a=this.getGeometry();return a&&a.clone()},mousedown:function(a){if(!this.checkModifiers(a)){return true}if(this.lastDown&&this.lastDown.equals(a.xy)){return true}this.drawing=true;if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{this.modifyFeature(a.xy)}this.lastDown=a.xy;return false},mousemove:function(a){if(this.drawing){this.modifyFeature(a.xy)}return true},mouseup:function(a){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Layer.GML=OpenLayers.Class(OpenLayers.Layer.Vector,{loaded:false,format:null,formatOptions:null,initialize:function(a,b,d){var c=[];c.push(a,d);OpenLayers.Layer.Vector.prototype.initialize.apply(this,c);this.url=b},setVisibility:function(a,b){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},moveTo:function(a,c,b){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},loadGML:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.url,success:this.requestSuccess,failure:this.requestFailure,scope:this});this.loaded=true}},setUrl:function(a){this.url=a;this.destroyFeatures();this.loaded=false;this.loadGML()},requestSuccess:function(c){var b=c.responseXML;if(!b||!b.documentElement){b=c.responseText}var d={};OpenLayers.Util.extend(d,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){d.externalProjection=this.projection;d.internalProjection=this.map.getProjectionObject()}var a=this.format?new this.format(d):new OpenLayers.Format.GML(d);this.addFeatures(a.read(b));this.events.triggerEvent("loadend")},requestFailure:function(a){OpenLayers.Console.userError(OpenLayers.i18n("errorLoadingGML",{"url":this.url}));this.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Layer.GML"});OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,initialize:function(a,b){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},addNodes:function(b){if(b.length<2){OpenLayers.Console.error("At least two point features have to be added to create"+"a line from");return}var g=new Array(b.length-1);var k,f,e;for(var a=0,j=b.length;a<j;a++){k=b[a];e=k.geometry;if(!e){var h=k.lonlat;e=new OpenLayers.Geometry.Point(h.lon,h.lat)}else{if(e.CLASS_NAME!="OpenLayers.Geometry.Point"){OpenLayers.Console.error("Only features with point geometries are supported.");return}}if(a>0){var d=(this.dataFrom!=null)?(b[a+this.dataFrom].data||b[a+this.dataFrom].attributes):null;var c=new OpenLayers.Geometry.LineString([f,e]);g[a-1]=new OpenLayers.Feature.Vector(c,d)}f=e}this.addFeatures(g)},CLASS_NAME:"OpenLayers.Layer.PointTrack"});OpenLayers.Layer.PointTrack.dataFrom={"SOURCE_NODE":-1,"TARGET_NODE":0};OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:false,layers:null,initialize:function(a,b){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(a){var d=this.layers;var b;for(var c=0;c<d.length;c++){b=d[c].getFeatureFromEvent(a);if(b){return b}}},setMap:function(a){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();a.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(a){a.events.unregister("changelayer",this,this.handleChangeLayer);this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){var a;for(var b=0;b<this.map.layers.length;++b){a=this.map.layers[b];if(OpenLayers.Util.indexOf(this.layers,a)!=-1){a.renderer.moveRoot(this.renderer)}}},resetRoots:function(){var a;for(var b=0;b<this.layers.length;++b){a=this.layers[b];if(this.renderer&&a.renderer.getRenderLayerId()==this.id){this.renderer.moveRoot(a.renderer)}}},handleChangeLayer:function(b){var a=b.layer;if(b.property=="order"&&OpenLayers.Util.indexOf(this.layers,a)!=-1){this.resetRoots();this.collectRoots()}},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Layer.WFS=OpenLayers.Class(OpenLayers.Layer.Vector,OpenLayers.Layer.Markers,{isBaseLayer:false,tile:null,ratio:2,DEFAULT_PARAMS:{service:"WFS",version:"1.0.0",request:"GetFeature"},featureClass:null,format:null,formatObject:null,formatOptions:null,vectorMode:true,encodeBBOX:false,extractAttributes:false,initialize:function(b,c,a,e){if(e==undefined){e={}}if(e.featureClass||!OpenLayers.Layer.Vector||!OpenLayers.Feature.Vector){this.vectorMode=false}OpenLayers.Util.extend(e,{"reportError":false});var d=[];d.push(b,e);OpenLayers.Layer.Vector.prototype.initialize.apply(this,d);if(!this.renderer||!this.vectorMode){this.vectorMode=false;if(!e.featureClass){e.featureClass=OpenLayers.Feature.WFS}OpenLayers.Layer.Markers.prototype.initialize.apply(this,d)}if(this.params&&this.params.typename&&!this.options.typename){this.options.typename=this.params.typename}if(!this.options.geometry_column){this.options.geometry_column="the_geom"}this.params=OpenLayers.Util.applyDefaults(a,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));this.url=c},destroy:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.destroy.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments)}if(this.tile){this.tile.destroy()}this.tile=null;this.ratio=null;this.featureClass=null;this.format=null;if(this.formatObject&&this.formatObject.destroy){this.formatObject.destroy()}this.formatObject=null;this.formatOptions=null;this.vectorMode=null;this.encodeBBOX=null;this.extractAttributes=null},setMap:function(b){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);var a={"extractAttributes":this.extractAttributes};OpenLayers.Util.extend(a,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}this.formatObject=this.format?new this.format(a):new OpenLayers.Format.GML(a)}else{OpenLayers.Layer.Markers.prototype.setMap.apply(this,arguments)}},moveTo:function(h,b,o){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments)}if(o){return false}if(b){if(this.vectorMode){this.renderer.clear()}}if(this.options.minZoomLevel){OpenLayers.Console.warn(OpenLayers.i18n("minZoomLevelError"));if(this.map.getZoom()<this.options.minZoomLevel){return null}}if(h==null){h=this.map.getExtent()}var g=(this.tile==null);var l=(!g&&!this.tile.bounds.containsBounds(h));if(b||g||(!o&&l)){var a=h.getCenterLonLat();var k=h.getWidth()*this.ratio;var m=h.getHeight()*this.ratio;var i=new OpenLayers.Bounds(a.lon-(k/2),a.lat-(m/2),a.lon+(k/2),a.lat+(m/2));var f=this.map.getSize();f.w=f.w*this.ratio;f.h=f.h*this.ratio;var e=new OpenLayers.LonLat(i.left,i.top);var j=this.map.getLayerPxFromLonLat(e);var p=this.getFullRequestString();var d=null;var c=this.params.filter||this.params.FILTER;if(c){d={FILTER:c}}else{d={BBOX:this.encodeBBOX?i.toBBOX():i.toArray()}}if(this.map&&!this.projection.equals(this.map.getProjectionObject())){var q=i.clone();q.transform(this.map.getProjectionObject(),this.projection);if(!c){d.BBOX=this.encodeBBOX?q.toBBOX():q.toArray()}}p+="&"+OpenLayers.Util.getParameterString(d);if(!this.tile){this.tile=new OpenLayers.Tile.WFS(this,j,i,p,f);this.addTileMonitoringHooks(this.tile);this.tile.draw()}else{if(this.vectorMode){this.destroyFeatures();this.renderer.clear()}else{this.clearMarkers()}this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null;this.tile=new OpenLayers.Tile.WFS(this,j,i,p,f);this.addTileMonitoringHooks(this.tile);this.tile.draw()}}},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this==this.layer.tile){this.layer.events.triggerEvent("loadstart")}};a.events.register("loadstart",a,a.onLoadStart);a.onLoadEnd=function(){if(this==this.layer.tile){this.layer.events.triggerEvent("tileloaded");this.layer.events.triggerEvent("loadend")}};a.events.register("loadend",a,a.onLoadEnd);a.events.register("unload",a,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({"loadstart":a.onLoadStart,"loadend":a.onLoadEnd,"unload":a.onLoadEnd,scope:a})},onMapResize:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.onMapResize.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.onMapResize.apply(this,arguments)}},display:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.display.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.display.apply(this,arguments)}},mergeNewParams:function(a){var b=OpenLayers.Util.upperCaseObject(a);var c=[b];return OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,c)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WFS(this.name,this.url,this.params,this.options)}if(this.vectorMode){a=OpenLayers.Layer.Vector.prototype.clone.apply(this,[a])}else{a=OpenLayers.Layer.Markers.prototype.clone.apply(this,[a])}return a},getFullRequestString:function(a,b){var c=this.projection.getCode()||this.map.getProjection();this.params.SRS=(c=="none")?null:c;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},commit:function(){if(!this.writer){var a={};if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}this.writer=new OpenLayers.Format.WFS(a,this)}var b=this.writer.write(this.features);OpenLayers.Request.POST({url:this.url,data:b,success:this.commitSuccess,failure:this.commitFailure,scope:this})},commitSuccess:function(b){var a=b.responseText;if(a.indexOf("SUCCESS")!=-1){this.commitReport(OpenLayers.i18n("commitSuccess",{"response":a}));for(var c=0;c<this.features.length;c++){this.features[c].state=null}}else{if(a.indexOf("FAILED")!=-1||a.indexOf("Exception")!=-1){this.commitReport(OpenLayers.i18n("commitFailed",{"response":a}))}}},commitFailure:function(a){},commitReport:function(a,b){OpenLayers.Console.userError(a)},refresh:function(){if(this.tile){if(this.vectorMode){this.renderer.clear();this.features.length=0}else{this.clearMarkers();this.markers.length=0}this.tile.draw()}},getDataExtent:function(){var a;if(this.vectorMode){a=OpenLayers.Layer.Vector.prototype.getDataExtent.apply(this)}else{a=OpenLayers.Layer.Markers.prototype.getDataExtent.apply(this)}return a},setOpacity:function(a){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setOpacity.apply(this,[a])}else{OpenLayers.Layer.Markers.prototype.setOpacity.apply(this,[a])}},CLASS_NAME:"OpenLayers.Layer.WFS"});OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({"moveend":this.update,scope:this});this.layer.events.on({"refresh":this.update,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({"moveend":this.update,scope:this});this.layer.events.un({"refresh":this.update,scope:this})}return a},update:function(b){var a=this.getMapBounds();if((b&&b.force)||this.invalidBounds(a)){this.calculateBounds(a);this.resolution=this.layer.map.getResolution();this.triggerRead()}},getMapBounds:function(){var a=this.layer.map.getExtent();if(!this.layer.projection.equals(this.layer.map.getProjectionObject())){a=a.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)}return a},invalidBounds:function(b){if(!b){b=this.getMapBounds()}var a=!this.bounds||!this.bounds.containsBounds(b);if(!a&&this.resFactor){var c=this.resolution/this.layer.map.getResolution();a=(c>=this.resFactor||c<=(1/this.resFactor))}return a},calculateBounds:function(b){if(!b){b=this.getMapBounds()}var c=b.getCenterLonLat();var d=b.getWidth()*this.ratio;var a=b.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(c.lon-(d/2),c.lat-(a/2),c.lon+(d/2),c.lat+(a/2))},triggerRead:function(){this.layer.protocol.abort(this.response);this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read({filter:this.createFilter(),callback:this.merge,scope:this})},createFilter:function(){var a=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,a]})}return a},merge:function(g){this.layer.destroyFeatures();var b=g.features;if(b&&b.length>0){var d=this.layer.projection;var a=this.layer.map.getProjectionObject();if(!a.equals(d)){var f;for(var c=0,e=b.length;c<e;++c){f=b[c].geometry;if(f){f.transform(d,a)}}}this.layer.addFeatures(b)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,highlightOnly:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(c,b){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[b]);if(this.scope===null){this.scope=this}if(c instanceof Array){this.layers=c;this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:c})}else{this.layer=c}var a={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){a.over=this.overFeature;a.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(a,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.layers){this.layer.destroy()}},activate:function(){if(!this.active){if(this.layers){this.map.addLayer(this.layer)}this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}if(this.layers){this.map.removeLayer(this.layer)}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(d){var e=this.layers||[this.layer];var a,c;for(var f=0;f<e.length;++f){a=e[f];for(var b=a.selectedFeatures.length-1;b>=0;--b){c=a.selectedFeatures[b];if(!d||d.except!=c){this.unselect(c)}}}},clickFeature:function(a){if(!this.hover){var b=(OpenLayers.Util.indexOf(a.layer.selectedFeatures,a)>-1);if(b){if(this.toggleSelect()){this.unselect(a)}else{if(!this.multipleSelect()){this.unselectAll({except:a})}}}else{if(!this.multipleSelect()){this.unselectAll({except:a})}this.select(a)}}},multipleSelect:function(){return this.multiple||(this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey])},toggleSelect:function(){return this.toggle||(this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey])},clickoutFeature:function(a){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(b){var a=b.layer;if(this.hover){if(this.highlightOnly){this.highlight(b)}else{if(OpenLayers.Util.indexOf(a.selectedFeatures,b)==-1){this.select(b)}}}},outFeature:function(b){if(this.hover){if(this.highlightOnly){if(b._lastHighlighter==this.id){if(b._prevHighlighter&&b._prevHighlighter!=this.id){delete b._lastHighlighter;var a=this.map.getControl(b._prevHighlighter);if(a){a.highlight(b)}}else{this.unhighlight(b)}}}else{this.unselect(b)}}},highlight:function(c){var a=c.layer;var d=this.events.triggerEvent("beforefeaturehighlighted",{feature:c});if(d!==false){c._prevHighlighter=c._lastHighlighter;c._lastHighlighter=this.id;var b=this.selectStyle||this.renderIntent;a.drawFeature(c,b);this.events.triggerEvent("featurehighlighted",{feature:c})}},unhighlight:function(b){var a=b.layer;b._lastHighlighter=b._prevHighlighter;delete b._prevHighlighter;a.drawFeature(b,b.style||b.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:b})},select:function(b){var c=this.onBeforeSelect.call(this.scope,b);var a=b.layer;if(c!==false){c=a.events.triggerEvent("beforefeatureselected",{feature:b});if(c!==false){a.selectedFeatures.push(b);this.highlight(b);a.events.triggerEvent("featureselected",{feature:b});this.onSelect.call(this.scope,b)}}},unselect:function(b){var a=b.layer;this.unhighlight(b);OpenLayers.Util.removeItem(a.selectedFeatures,b);a.events.triggerEvent("featureunselected",{feature:b});this.onUnselect.call(this.scope,b)},selectBox:function(b){if(b instanceof OpenLayers.Bounds){var d=this.map.getLonLatFromPixel(new OpenLayers.Pixel(b.left,b.bottom));var j=this.map.getLonLatFromPixel(new OpenLayers.Pixel(b.right,b.top));var g=new OpenLayers.Bounds(d.lon,d.lat,j.lon,j.lat);if(!this.multipleSelect()){this.unselectAll()}var m=this.multiple;this.multiple=true;var f=this.layers||[this.layer];var c;for(var k=0;k<f.length;++k){c=f[k];for(var a=0,h=c.features.length;a<h;++a){var e=c.features[a];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,e.geometry.CLASS_NAME)>-1){if(g.toGeometry().intersects(e.geometry)){if(OpenLayers.Util.indexOf(c.selectedFeatures,e)==-1){this.select(e)}}}}}this.multiple=m}},setMap:function(a){this.handlers.feature.setMap(a);if(this.box){this.handlers.box.setMap(a)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(b){var a={};this.readers.ogc["Filter"].apply(this,[b,a]);return a.filter},readers:{"ogc":{"Filter":function(c,b){var a={fids:[],filters:[]};this.readChildNodes(c,a);if(a.fids.length>0){b.filter=new OpenLayers.Filter.FeatureId({fids:a.fids})}else{if(a.filters.length>0){b.filter=a.filters[0]}}},"FeatureId":function(c,a){var b=c.getAttribute("fid");if(b){a.fids.push(b)}},"And":function(c,a){var b=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(c,b);a.filters.push(b)},"Or":function(c,a){var b=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(c,b);a.filters.push(b)},"Not":function(c,a){var b=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(c,b);a.filters.push(b)},"PropertyIsLessThan":function(c,a){var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(c,b);a.filters.push(b)},"PropertyIsGreaterThan":function(c,a){var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(c,b);a.filters.push(b)},"PropertyIsLessThanOrEqualTo":function(c,a){var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(c,b);a.filters.push(b)},"PropertyIsGreaterThanOrEqualTo":function(c,a){var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(c,b);a.filters.push(b)},"PropertyIsBetween":function(c,a){var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(c,b);a.filters.push(b)},"PropertyIsLike":function(f,a){var d=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(f,d);var e=f.getAttribute("wildCard");var b=f.getAttribute("singleChar");var c=f.getAttribute("escape");d.value2regex(e,b,c);a.filters.push(d)},"Literal":function(b,a){a.value=OpenLayers.String.numericIf(this.getChildValue(b))},"PropertyName":function(b,a){a.property=this.getChildValue(b)},"LowerBoundary":function(b,a){a.lowerBoundary=OpenLayers.String.numericIf(this.readOgcExpression(b))},"UpperBoundary":function(b,a){a.upperBoundary=OpenLayers.String.numericIf(this.readOgcExpression(b))},"Intersects":function(b,a){this.readSpatial(b,a,OpenLayers.Filter.Spatial.INTERSECTS)},"Within":function(b,a){this.readSpatial(b,a,OpenLayers.Filter.Spatial.WITHIN)},"Contains":function(b,a){this.readSpatial(b,a,OpenLayers.Filter.Spatial.CONTAINS)},"DWithin":function(b,a){this.readSpatial(b,a,OpenLayers.Filter.Spatial.DWITHIN)},"Distance":function(b,a){a.distance=parseInt(this.getChildValue(b));a.distanceUnits=b.getAttribute("units")}}},readSpatial:function(d,a,b){var c=new OpenLayers.Filter.Spatial({type:b});this.readChildNodes(d,c);c.value=c.components[0];delete c.components;a.filters.push(c)},readOgcExpression:function(c){var a={};this.readChildNodes(c,a);var b=a.value;if(!b){b=this.getChildValue(c)}return b},write:function(a){return this.writers.ogc["Filter"].apply(this,[a])},writers:{"ogc":{"Filter":function(c){var d=this.createElementNSPlus("ogc:Filter");var a=c.CLASS_NAME.split(".").pop();if(a=="FeatureId"){for(var b=0;b<c.fids.length;++b){this.writeNode("FeatureId",c.fids[b],d)}}else{this.writeNode(this.getFilterType(c),c,d)}return d},"FeatureId":function(a){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:a}})},"And":function(c){var d=this.createElementNSPlus("ogc:And");var a;for(var b=0;b<c.filters.length;++b){a=c.filters[b];this.writeNode(this.getFilterType(a),a,d)}return d},"Or":function(c){var d=this.createElementNSPlus("ogc:Or");var a;for(var b=0;b<c.filters.length;++b){a=c.filters[b];this.writeNode(this.getFilterType(a),a,d)}return d},"Not":function(b){var c=this.createElementNSPlus("ogc:Not");var a=b.filters[0];this.writeNode(this.getFilterType(a),a,c);return c},"PropertyIsLessThan":function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThan");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"PropertyIsGreaterThan":function(a){var b=this.createElementNSPlus("ogc:PropertyIsGreaterThan");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"PropertyIsLessThanOrEqualTo":function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"PropertyIsGreaterThanOrEqualTo":function(a){var b=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"PropertyIsBetween":function(a){var b=this.createElementNSPlus("ogc:PropertyIsBetween");this.writeNode("PropertyName",a,b);this.writeNode("LowerBoundary",a,b);this.writeNode("UpperBoundary",a,b);return b},"PropertyIsLike":function(a){var b=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.regex2value(),b);return b},"PropertyName":function(a){return this.createElementNSPlus("ogc:PropertyName",{value:a.property})},"Literal":function(a){return this.createElementNSPlus("ogc:Literal",{value:a})},"LowerBoundary":function(a){var b=this.createElementNSPlus("ogc:LowerBoundary");this.writeNode("Literal",a.lowerBoundary,b);return b},"UpperBoundary":function(a){var b=this.createElementNSPlus("ogc:UpperBoundary");this.writeNode("Literal",a.upperBoundary,b);return b},"INTERSECTS":function(a){return this.writeSpatial(a,"Intersects")},"WITHIN":function(a){return this.writeSpatial(a,"Within")},"CONTAINS":function(a){return this.writeSpatial(a,"Contains")},"DWITHIN":function(a){var b=this.writeSpatial(a,"DWithin");this.writeNode("Distance",a,b);return b},"Distance":function(a){return this.createElementNSPlus("ogc:Distance",{attributes:{units:a.distanceUnits},value:a.distance})}}},getFilterType:function(b){var a=this.filterMap[b.type];if(!a){throw"Filter writing not supported for rule type: "+b.type}return a},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike","BBOX":"BBOX","DWITHIN":"DWITHIN","WITHIN":"WITHIN","CONTAINS":"CONTAINS","INTERSECTS":"INTERSECTS"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var c=0;if(this.components&&(this.components.length>1)){for(var b=1,a=this.components.length;b<a;b++){c+=this.components[b-1].distanceTo(this.components[b])}}return c},getGeodesicLength:function(c){var h=this;if(c){var g=new OpenLayers.Projection("EPSG:4326");if(!g.equals(c)){h=this.clone().transform(c,g)}}var e=0;if(h.components&&(h.components.length>1)){var b,d;for(var a=1,f=h.components.length;a<f;a++){b=h.components[a-1];d=h.components[a];e+=OpenLayers.Util.distVincenty({lon:b.x,lat:b.y},{lon:d.x,lat:d.y})}}return e*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,modified:false,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(a,e){this.layer=a;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());this.virtualStyle.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[e]);if(!(this.deleteCodes instanceof Array)){this.deleteCodes=[this.deleteCodes]}var c=this;var d={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};this.selectControl=new OpenLayers.Control.SelectFeature(a,d);var f={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(h,g){c.dragStart.apply(c,[h,g])},onDrag:function(h,g){c.dragVertex.apply(c,[h,g])},onComplete:function(g){c.dragComplete.apply(c,[g])}};this.dragControl=new OpenLayers.Control.DragFeature(a,f);var b={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,b)}},destroy:function(){this.layer=null;this.selectControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.selectControl.activate()&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){var a=false;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.vertices,{silent:true});this.layer.removeFeatures(this.virtualVertices,{silent:true});this.vertices=[];this.dragControl.deactivate();if(this.feature&&this.feature.geometry&&this.feature.layer){this.selectControl.unselect.apply(this.selectControl,[this.feature])}this.selectControl.deactivate();this.handlers.keyboard.deactivate();a=true}return a},beforeSelectFeature:function(a){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:a})},selectFeature:function(a){this.feature=a;this.modified=false;this.resetVertices();this.dragControl.activate();this.onModificationStart(this.feature)},unselectFeature:function(a){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[];if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});delete this.dragHandle}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});delete this.radiusHandle}this.feature=null;this.dragControl.deactivate();this.onModificationEnd(a);this.layer.events.triggerEvent("afterfeaturemodified",{feature:a,modified:this.modified});this.modified=false},dragStart:function(b,a){if(b!=this.feature&&!b.geometry.parent&&b!=this.dragHandle&&b!=this.radiusHandle){if(this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature])}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,b.geometry.CLASS_NAME)!=-1){this.selectControl.clickFeature.apply(this.selectControl,[b]);this.dragControl.overFeature.apply(this.dragControl,[b]);this.dragControl.lastPixel=a;this.dragControl.handlers.drag.started=true;this.dragControl.handlers.drag.start=a;this.dragControl.handlers.drag.last=a}}},dragVertex:function(a,b){this.modified=true;if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=a){this.feature=a}this.layer.events.triggerEvent("vertexmodified",{vertex:a.geometry,feature:this.feature,pixel:b})}else{if(a._index){a.geometry.parent.addComponent(a.geometry,a._index);delete a._index;OpenLayers.Util.removeItem(this.virtualVertices,a);this.vertices.push(a)}else{if(a==this.dragHandle){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}}else{if(a!==this.radiusHandle){this.layer.events.triggerEvent("vertexmodified",{vertex:a.geometry,feature:this.feature,pixel:b})}}}if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}this.layer.drawFeature(this.feature,this.selectControl.renderIntent)}this.layer.drawFeature(a)},dragComplete:function(a){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE){this.feature.state=OpenLayers.State.UPDATE}},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature)}if(this.vertices.length>0){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[]}if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});this.dragHandle=null}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle()}if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle()}if(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE){if(!(this.mode&OpenLayers.Control.ModifyFeature.RESIZE)){this.collectVertices()}}}},handleKeypress:function(b){var a=b.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,a)!=-1){var c=this.dragControl.feature;if(c&&OpenLayers.Util.indexOf(this.vertices,c)!=-1&&!this.dragControl.handlers.drag.dragging&&c.geometry.parent){c.geometry.parent.removeComponent(c.geometry);this.layer.drawFeature(this.feature,this.selectControl.renderIntent);this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})}}},collectVertices:function(){this.vertices=[];this.virtualVertices=[];var a=this;function b(e){var c,d,l,m;if(e.CLASS_NAME=="OpenLayers.Geometry.Point"){d=new OpenLayers.Feature.Vector(e);d._sketch=true;a.vertices.push(d)}else{var o=e.components.length;if(e.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){o-=1}for(c=0;c<o;++c){l=e.components[c];if(l.CLASS_NAME=="OpenLayers.Geometry.Point"){d=new OpenLayers.Feature.Vector(l);d._sketch=true;a.vertices.push(d)}else{b(l)}}if(e.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(c=0,m=e.components.length;c<m-1;++c){var j=e.components[c];var g=e.components[c+1];if(j.CLASS_NAME=="OpenLayers.Geometry.Point"&&g.CLASS_NAME=="OpenLayers.Geometry.Point"){var h=(j.x+g.x)/2;var f=(j.y+g.y)/2;var k=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(h,f),null,a.virtualStyle);k.geometry.parent=e;k._index=c+1;k._sketch=true;a.virtualVertices.push(k)}}}}}b.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var b=this.feature.geometry;var c=b.getBounds().getCenterLonLat();var a=new OpenLayers.Geometry.Point(c.lon,c.lat);var d=new OpenLayers.Feature.Vector(a);a.move=function(e,f){OpenLayers.Geometry.Point.prototype.move.call(this,e,f);b.move(e,f)};d._sketch=true;this.dragHandle=d;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var d=this.feature.geometry;var f=d.getBounds();var b=f.getCenterLonLat();var e=new OpenLayers.Geometry.Point(b.lon,b.lat);var h=new OpenLayers.Geometry.Point(f.right,f.bottom);var a=new OpenLayers.Feature.Vector(h);var c=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var i=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var g=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);h.move=function(p,k){OpenLayers.Geometry.Point.prototype.move.call(this,p,k);var u=this.x-e.x;var m=this.y-e.y;var w=u-p;var q=m-k;if(g){var t=Math.atan2(q,w);var j=Math.atan2(m,u);var r=j-t;r*=180/Math.PI;d.rotate(r,e)}if(c){var o,v;if(i){o=m/q;v=(u/w)/o}else{var s=Math.sqrt((w*w)+(q*q));var l=Math.sqrt((u*u)+(m*m));o=l/s}d.resize(o,e,v)}};a._sketch=true;this.radiusHandle=a;this.layer.addFeatures([this.radiusHandle],{silent:true})},setMap:function(a){this.selectControl.setMap(a);this.dragControl.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(a){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(a){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(g){var p=false;var a=g.CLASS_NAME;if(a=="OpenLayers.Geometry.LineString"||a=="OpenLayers.Geometry.LinearRing"||a=="OpenLayers.Geometry.Point"){var m=this.getSortedSegments();var o;if(a=="OpenLayers.Geometry.Point"){o=[{x1:g.x,y1:g.y,x2:g.x,y2:g.y}]}else{o=g.getSortedSegments()}var t,f,c,r,b,d,l,e;outer:for(var h=0,q=m.length;h<q;++h){t=m[h];f=t.x1;c=t.x2;r=t.y1;b=t.y2;inner:for(var k=0,s=o.length;k<s;++k){d=o[k];if(d.x1>c){break}if(d.x2<f){continue}l=d.y1;e=d.y2;if(Math.min(l,e)>Math.max(r,b)){continue}if(Math.max(l,e)<Math.min(r,b)){continue}if(OpenLayers.Geometry.segmentsIntersect(t,d)){p=true;break outer}}}}else{p=g.intersects(this)}return p},getSortedSegments:function(){var b=this.components.length-1;var a=new Array(b);for(var c=0;c<b;++c){point1=this.components[c];point2=this.components[c+1];if(point1.x<point2.x){a[c]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}}else{a[c]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}}}function d(f,e){return f.x1-e.x1}return a.sort(d)},splitWithSegment:function(j,k){var e=!(k&&k.edge===false);var l=k&&k.tolerance;var t=[];var o=this.getVertices();var m=[];var b=[];var s=false;var a,c,w;var h,f,u;var g={point:true,tolerance:l};var v=null;for(var q=0,r=o.length-2;q<=r;++q){a=o[q];m.push(a.clone());c=o[q+1];u={x1:a.x,y1:a.y,x2:c.x,y2:c.y};w=OpenLayers.Geometry.segmentsIntersect(j,u,g);if(w instanceof OpenLayers.Geometry.Point){if((w.x===j.x1&&w.y===j.y1)||(w.x===j.x2&&w.y===j.y2)||w.equals(a)||w.equals(c)){f=true}else{f=false}if(f||e){if(!w.equals(b[b.length-1])){b.push(w.clone())}if(q===0){if(w.equals(a)){continue}}if(w.equals(c)){continue}s=true;if(!w.equals(a)){m.push(w)}t.push(new OpenLayers.Geometry.LineString(m));m=[w.clone()]}}}if(s){m.push(c.clone());t.push(new OpenLayers.Geometry.LineString(m))}if(b.length>0){var p=j.x1<j.x2?1:-1;var d=j.y1<j.y2?1:-1;v={lines:t,points:b.sort(function(z,i){return(p*z.x-p*i.x)||(d*z.y-d*i.y)})}}return v},split:function(u,d){var c=null;var q=d&&d.mutual;var v,g,s,r;if(u instanceof OpenLayers.Geometry.LineString){var m=this.getVertices();var a,b,f,e,t,z;var l=[];s=[];for(var o=0,w=m.length-2;o<=w;++o){a=m[o];b=m[o+1];f={x1:a.x,y1:a.y,x2:b.x,y2:b.y};r=r||[u];if(q){l.push(a.clone())}for(var p=0;p<r.length;++p){e=r[p].splitWithSegment(f,d);if(e){t=e.lines;if(t.length>0){t.unshift(p,1);Array.prototype.splice.apply(r,t);p+=t.length-2}if(q){for(var h=0,A=e.points.length;h<A;++h){z=e.points[h];if(!z.equals(a)){l.push(z);s.push(new OpenLayers.Geometry.LineString(l));if(z.equals(b)){l=[]}else{l=[z.clone()]}}}}}}}if(q&&s.length>0&&l.length>0){l.push(b.clone());s.push(new OpenLayers.Geometry.LineString(l))}}else{c=u.splitWith(this,d)}if(r&&r.length>1){g=true}else{r=[]}if(s&&s.length>1){v=true}else{s=[]}if(g||v){if(q){c=[s,r]}else{c=r}}return c},splitWith:function(a,b){return a.split(this,b)},getVertices:function(b){var a;if(b===true){a=[this.components[0],this.components[this.components.length-1]]}else{if(b===false){a=this.components.slice(1,this.components.length-1)}else{a=this.components.slice()}}return a},distanceTo:function(h,m){var g=!(m&&m.edge===false);var t=g&&m&&m.details;var q,z={};var o=Number.POSITIVE_INFINITY;if(h instanceof OpenLayers.Geometry.Point){var p=this.getSortedSegments();var d=h.x;var a=h.y;var s;for(var l=0,C=p.length;l<C;++l){s=p[l];q=OpenLayers.Geometry.distanceToSegment(h,s);if(q.distance<o){o=q.distance;z=q;if(o===0){break}}else{if(s.x2>d&&((a>s.y1&&a<s.y2)||(a<s.y1&&a>s.y2))){break}}}if(t){z={distance:z.distance,x0:z.x,y0:z.y,x1:d,y1:a}}else{z=z.distance}}else{if(h instanceof OpenLayers.Geometry.LineString){var r=this.getSortedSegments();var B=h.getSortedSegments();var w,b,v,e,f;var c=B.length;var A={point:true};outer:for(var l=0,C=r.length;l<C;++l){w=r[l];e=w.x1;f=w.y1;for(var u=0;u<c;++u){b=B[u];v=OpenLayers.Geometry.segmentsIntersect(w,b,A);if(v){o=0;z={distance:0,x0:v.x,y0:v.y,x1:v.x,y1:v.y};break outer}else{q=OpenLayers.Geometry.distanceToSegment({x:e,y:f},b);if(q.distance<o){o=q.distance;z={distance:o,x0:e,y0:f,x1:q.x,y1:q.y}}}}}if(!t){z=z.distance}if(o!==0){if(w){q=h.distanceTo(new OpenLayers.Geometry.Point(w.x2,w.y2),m);var k=t?q.distance:q;if(k<o){if(t){z={distance:o,x0:q.x1,y0:q.y1,x1:q.x0,y1:q.y0}}else{z=k}}}}}else{z=h.distanceTo(this,m);if(t){z={distance:z.distance,x0:z.x1,y0:z.y1,x1:z.x0,y1:z.y0}}}}return z},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{extractWaypoints:true,extractTracks:true,extractRoutes:true,extractAttributes:true,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){if(typeof a=="string"){a=OpenLayers.Format.XML.prototype.read.apply(this,[a])}var v=[];if(this.extractTracks){var u=a.getElementsByTagName("trk");for(var s=0,A=u.length;s<A;s++){var r={};if(this.extractAttributes){r=this.parseAttributes(u[s])}var o=this.getElementsByTagNameNS(u[s],u[s].namespaceURI,"trkseg");for(var q=0,e=o.length;q<e;q++){var w=this.extractSegment(o[q],"trkpt");v.push(new OpenLayers.Feature.Vector(w,r))}}}if(this.extractRoutes){var z=a.getElementsByTagName("rte");for(var h=0,f=z.length;h<f;h++){var r={};if(this.extractAttributes){r=this.parseAttributes(z[h])}var c=this.extractSegment(z[h],"rtept");v.push(new OpenLayers.Feature.Vector(c,r))}}if(this.extractWaypoints){var p=a.getElementsByTagName("wpt");for(var m=0,A=p.length;m<A;m++){var r={};if(this.extractAttributes){r=this.parseAttributes(p[m])}var d=new OpenLayers.Geometry.Point(p[m].getAttribute("lon"),p[m].getAttribute("lat"));v.push(new OpenLayers.Feature.Vector(d,r))}}if(this.internalProjection&&this.externalProjection){for(var t=0,b=v.length;t<b;t++){v[t].geometry.transform(this.externalProjection,this.internalProjection)}}return v},extractSegment:function(d,f){var e=this.getElementsByTagNameNS(d,d.namespaceURI,f);var a=[];for(var c=0,b=e.length;c<b;c++){a.push(new OpenLayers.Geometry.Point(e[c].getAttribute("lon"),e[c].getAttribute("lat")))}return new OpenLayers.Geometry.LineString(a)},parseAttributes:function(d){var c={};var b=d.firstChild;while(b){if(b.nodeType==1){var a=b.firstChild;if(a.nodeType==3||a.nodeType==4){name=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;if(name!="trkseg"&&name!="rtept"){c[name]=a.nodeValue}}}b=b.nextSibling}return c},CLASS_NAME:"OpenLayers.Format.GPX"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(e,d){var b=false;var c=this.components.pop();if(d!=null||!e.equals(c)){b=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var a=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[a]);return b},removeComponent:function(b){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var a=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[a])}},move:function(b,c){for(var d=0,a=this.components.length;d<a-1;d++){this.components[d].move(b,c)}},rotate:function(c,d){for(var b=0,a=this.components.length;b<a-1;++b){this.components[b].rotate(c,d)}},resize:function(e,d,a){for(var c=0,b=this.components.length;c<b-1;++c){this.components[c].resize(e,d,a)}return this},transform:function(d,e){if(d&&e){for(var c=0,a=this.components.length;c<a-1;c++){var b=this.components[c];b.transform(d,e)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var d=0;var k=0;for(var a=0;a<this.components.length-1;a++){var g=this.components[a];var h=this.components[a+1];d+=(g.x+h.x)*(g.x*h.y-h.x*g.y);k+=(g.y+h.y)*(g.x*h.y-h.x*g.y)}var j=-1*this.getArea();var e=d/(6*j);var f=k/(6*j)}return new OpenLayers.Geometry.Point(e,f)},getArea:function(){var d=0;if(this.components&&(this.components.length>2)){var h=0;for(var g=0,a=this.components.length;g<a-1;g++){var e=this.components[g];var f=this.components[g+1];h+=(e.x+f.x)*(f.y-e.y)}d=-h/2}return d},getGeodesicArea:function(c){var e=this;if(c){var h=new OpenLayers.Projection("EPSG:4326");if(!h.equals(c)){e=this.clone().transform(c,h)}}var d=0;var g=e.components&&e.components.length;if(g>2){var b,f;for(var a=0;a<g-1;a++){b=e.components[a];f=e.components[a+1];d+=OpenLayers.Util.rad(f.x-b.x)*(2+Math.sin(OpenLayers.Util.rad(b.y))+Math.sin(OpenLayers.Util.rad(f.y)))}d=d*6378137*6378137/2}return d},containsPoint:function(t){var p=OpenLayers.Number.limitSigDigs;var g=14;var o=p(t.x,g);var c=p(t.y,g);function d(v,i,u,w,z){return(((i-w)*v)+((w*u)-(i*z)))/(u-z)}var f=this.components.length-1;var q,h,l,m,r,s,a,j;var b=0;for(var k=0;k<f;++k){q=this.components[k];l=p(q.x,g);m=p(q.y,g);h=this.components[k+1];r=p(h.x,g);s=p(h.y,g);if(m==s){if(c==m){if(l<=r&&(o>=l&&o<=r)||l>=r&&(o<=l&&o>=r)){b=-1;break}}continue}a=p(d(c,l,m,r,s),g);if(a==o){if(m<s&&(c>=m&&c<=s)||m>s&&(c<=m&&c>=s)){b=-1;break}}if(a<=o){continue}if(l!=r&&(a<Math.min(l,r)||a>Math.max(l,r))){continue}if(m<s&&(c>=m&&c<s)||m>s&&(c<m&&c>=s)){++b}}var e=(b==-1)?1:!!(b&1);return e},intersects:function(b){var c=false;if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){c=this.containsPoint(b)}else{if(b.CLASS_NAME=="OpenLayers.Geometry.LineString"){c=b.intersects(this)}else{if(b.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){c=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[b])}else{for(var d=0,a=b.components.length;d<a;++d){c=b.components[d].intersects(this);if(c){break}}}}}return c},getVertices:function(a){return(a===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(s,a){var g=null;var f=a&&a.mutual;var t,r,e,c,d;var b=[];var l=[s];for(var o=0,p=this.components.length;o<p;++o){r=this.components[o];c=false;for(var h=0;h<l.length;++h){t=r.split(l[h],a);if(t){if(f){e=t[0];for(var q=0,m=e.length;q<m;++q){if(q===0&&b.length){b[b.length-1].addComponent(e[q])}else{b.push(new OpenLayers.Geometry.MultiLineString([e[q]]))}}c=true;t=t[1]}if(t.length){t.unshift(h,1);Array.prototype.splice.apply(l,t);break}}}if(!c){if(b.length){b[b.length-1].addComponent(r.clone())}else{b=[new OpenLayers.Geometry.MultiLineString(r.clone())]}}}if(b&&b.length>1){c=true}else{b=[]}if(l&&l.length>1){d=true}else{l=[]}if(c||d){if(f){g=[b,l]}else{g=l}}return g},splitWith:function(f,a){var h=null;var g=a&&a.mutual;var t,e,l,c,d,b,o;if(f instanceof OpenLayers.Geometry.LineString){o=[];b=[f];for(var q=0,r=this.components.length;q<r;++q){d=false;e=this.components[q];for(var m=0;m<b.length;++m){t=b[m].split(e,a);if(t){if(g){l=t[0];if(l.length){l.unshift(m,1);Array.prototype.splice.apply(b,l);m+=l.length-2}t=t[1];if(t.length===0){t=[e.clone()]}}for(var s=0,p=t.length;s<p;++s){if(s===0&&o.length){o[o.length-1].addComponent(t[s])}else{o.push(new OpenLayers.Geometry.MultiLineString([t[s]]))}}d=true}}if(!d){if(o.length){o[o.length-1].addComponent(e.clone())}else{o=[new OpenLayers.Geometry.MultiLineString([e.clone()])]}}}}else{h=f.split(this)}if(b&&b.length>1){c=true}else{b=[]}if(o&&o.length>1){d=true}else{o=[]}if(c||d){if(g){h=[b,o]}else{h=o}}return h},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(b,a,c){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);this.line=null},removePoint:function(){if(this.point){this.layer.removeFeatures([this.point])}},addPoint:function(a){this.layer.removeFeatures([this.point]);var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature()},freehandMode:function(a){return(this.freehandToggle&&a[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var a=this.line&&this.line.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiLineString([a])}return a},mousedown:function(a){if(this.lastDown&&this.lastDown.equals(a.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{if((this.lastUp==null)||!this.lastUp.equals(a.xy)){this.addPoint(a.xy)}}this.mouseDown=true;this.lastDown=a.xy;this.drawing=true;return false},mousemove:function(a){if(this.drawing){if(this.mouseDown&&this.freehandMode(a)){this.addPoint(a.xy)}else{this.modifyFeature(a.xy)}}return true},mouseup:function(a){this.mouseDown=false;if(this.drawing){if(this.freehandMode(a)){this.removePoint();this.finalize()}else{if(this.lastUp==null){this.addPoint(a.xy)}this.lastUp=a.xy}return false}return true},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesplit","split","aftersplit"],layer:null,source:null,sourceOptions:null,tolerance:null,edge:true,deferDelete:false,mutual:true,targetFilter:null,sourceFilter:null,handler:null,initialize:function(a){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};if(this.options.source){this.setSource(this.options.source)}},setSource:function(a){if(this.active){this.deactivate();if(this.handler){this.handler.destroy();delete this.handler}this.source=a;this.activate()}else{this.source=a}},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(!this.source){if(!this.handler){this.handler=new OpenLayers.Handler.Path(this,{done:function(b){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(b)})}},{layerOptions:this.sourceOptions})}this.handler.activate()}else{if(this.source.events){this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.source&&this.source.events){this.layer.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}return a},onSketchComplete:function(a){this.feature=null;return !this.considerSplit(a.feature)},afterFeatureModified:function(b){if(b.modified){var a=b.feature;if(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString){this.feature=b.feature;this.considerSplit(b.feature)}}},removeByGeometry:function(d,b){for(var c=0,a=d.length;c<a;++c){if(d[c].geometry===b){d.splice(c,1);break}}},isEligible:function(a){return(a.state!==OpenLayers.State.DELETE)&&(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString)&&(this.feature!==a)&&(!this.targetFilter||this.targetFilter.evaluate(a.attributes))},considerSplit:function(a){sourceSplit=false;targetSplit=false;if(!this.sourceFilter||this.sourceFilter.evaluate(a.attributes)){var s=this.layer&&this.layer.features||[];var v,b,m,p;var f=[],z=[];var q=(this.layer===this.source)&&this.mutual;var h={edge:this.edge,tolerance:this.tolerance,mutual:q};var t=[a.geometry];var u,d;var r,w;for(var g=0,A=s.length;g<A;++g){u=s[g];if(this.isEligible(u)){d=[u.geometry];for(var o=0;o<t.length;++o){r=t[o];for(var l=0;l<d.length;++l){v=d[l];if(r.getBounds().intersectsBounds(v.getBounds())){b=r.split(v,h);if(b){p=this.events.triggerEvent("beforesplit",{source:a,target:u});if(p!==false){if(q){w=b[0];if(w.length>1){w.unshift(o,1);Array.prototype.splice.apply(t,w);o+=w.length-3}b=b[1]}if(b.length>1){b.unshift(l,1);Array.prototype.splice.apply(d,b);l+=b.length-3}}}}}}if(d&&d.length>1){this.geomsToFeatures(u,d);this.events.triggerEvent("split",{original:u,features:d});Array.prototype.push.apply(f,d);z.push(u);targetSplit=true}}}if(t&&t.length>1){this.geomsToFeatures(a,t);this.events.triggerEvent("split",{original:a,features:t});Array.prototype.push.apply(f,t);z.push(a);sourceSplit=true}if(sourceSplit||targetSplit){if(this.deferDelete){var e,c=[];for(var g=0,A=z.length;g<A;++g){e=z[g];if(e.state===OpenLayers.State.INSERT){c.push(e)}else{e.state=OpenLayers.State.DELETE;this.layer.drawFeature(e)}}this.layer.destroyFeatures(c,{silent:true});for(var g=0,A=f.length;g<A;++g){f[g].state=OpenLayers.State.INSERT}}else{this.layer.destroyFeatures(z,{silent:true})}this.layer.addFeatures(f,{silent:true});this.events.triggerEvent("aftersplit",{source:a,features:f})}}return sourceSplit},geomsToFeatures:function(d,b){var f=d.clone();delete f.geometry;var c;for(var e=0,a=b.length;e<a;++e){c=f.clone();c.geometry=b[e];c.state=OpenLayers.State.INSERT;b[e]=c}},destroy:function(){if(this.active){this.deactivate()}OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var b=0;if(this.components&&(this.components.length>0)){b+=Math.abs(this.components[0].getArea());for(var c=1,a=this.components.length;c<a;c++){b-=Math.abs(this.components[c].getArea())}}return b},getGeodesicArea:function(b){var c=0;if(this.components&&(this.components.length>0)){c+=Math.abs(this.components[0].getGeodesicArea(b));for(var d=1,a=this.components.length;d<a;d++){c-=Math.abs(this.components[d].getGeodesicArea(b))}}return c},containsPoint:function(e){var a=this.components.length;var b=false;if(a>0){b=this.components[0].containsPoint(e);if(b!==1){if(b&&a>1){var c;for(var d=1;d<a;++d){c=this.components[d].containsPoint(e);if(c){if(c===1){b=1}else{b=false}break}}}}}return b},intersects:function(b){var c=false;var d,a;if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){c=this.containsPoint(b)}else{if(b.CLASS_NAME=="OpenLayers.Geometry.LineString"||b.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(d=0,a=this.components.length;d<a;++d){c=b.intersects(this.components[d]);if(c){break}}if(!c){for(d=0,a=b.components.length;d<a;++d){c=this.containsPoint(b.components[d]);if(c){break}}}}else{for(d=0,a=b.components.length;d<a;++d){c=this.intersects(b.components[d]);if(c){break}}}}if(!c&&b.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var e=this.components[0];for(d=0,a=e.components.length;d<a;++d){c=b.containsPoint(e.components[d]);if(c){break}}}return c},distanceTo:function(a,d){var c=!(d&&d.edge===false);var b;if(!c&&this.intersects(a)){b=0}else{b=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[a,d])}return b},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(b,a,d,c){var g=Math.PI*((1/d)-(1/2));if(c){g+=(c/180)*Math.PI}var l,e,f;var h=[];for(var k=0;k<d;++k){l=g+(k*2*Math.PI/d);e=b.x+(a*Math.cos(l));f=b.y+(a*Math.sin(l));h.push(new OpenLayers.Geometry.Point(e,f))}var j=new OpenLayers.Geometry.LinearRing(h);return new OpenLayers.Geometry.Polygon([j])};OpenLayers.Format.GeoRSS=OpenLayers.Class(OpenLayers.Format.XML,{rssns:"http://backend.userland.com/rss2",featureNS:"http://mapserver.gis.umn.edu/mapserver",georssns:"http://www.georss.org/georss",geons:"http://www.w3.org/2003/01/geo/wgs84_pos#",featureTitle:"Untitled",featureDescription:"No Description",gmlParser:null,xy:false,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},createGeometryFromItem:function(d){var j=this.getElementsByTagNameNS(d,this.georssns,"point");var a=this.getElementsByTagNameNS(d,this.geons,"lat");var h=this.getElementsByTagNameNS(d,this.geons,"long");var c=this.getElementsByTagNameNS(d,this.georssns,"line");var o=this.getElementsByTagNameNS(d,this.georssns,"polygon");var q=this.getElementsByTagNameNS(d,this.georssns,"where");var f=this.getElementsByTagNameNS(d,this.georssns,"box");if(j.length>0||(a.length>0&&h.length>0)){var g;if(j.length>0){g=OpenLayers.String.trim(j[0].firstChild.nodeValue).split(/\s+/);if(g.length!=2){g=OpenLayers.String.trim(j[0].firstChild.nodeValue).split(/\s*,\s*/)}}else{g=[parseFloat(a[0].firstChild.nodeValue),parseFloat(h[0].firstChild.nodeValue)]}var e=new OpenLayers.Geometry.Point(parseFloat(g[1]),parseFloat(g[0]))}else{if(c.length>0){var k=OpenLayers.String.trim(this.concatChildValues(c[0])).split(/\s+/);var l=[];var j;for(var m=0,b=k.length;m<b;m+=2){j=new OpenLayers.Geometry.Point(parseFloat(k[m+1]),parseFloat(k[m]));l.push(j)}e=new OpenLayers.Geometry.LineString(l)}else{if(o.length>0){var k=OpenLayers.String.trim(this.concatChildValues(o[0])).split(/\s+/);var l=[];var j;for(var m=0,b=k.length;m<b;m+=2){j=new OpenLayers.Geometry.Point(parseFloat(k[m+1]),parseFloat(k[m]));l.push(j)}e=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(l)])}else{if(q.length>0){if(!this.gmlParser){this.gmlParser=new OpenLayers.Format.GML({"xy":this.xy})}var p=this.gmlParser.parseFeature(q[0]);e=p.geometry}else{if(f.length>0){var k=OpenLayers.String.trim(f[0].firstChild.nodeValue).split(/\s+/);var l=[];var j;if(k.length>3){j=new OpenLayers.Geometry.Point(parseFloat(k[1]),parseFloat(k[0]));l.push(j);j=new OpenLayers.Geometry.Point(parseFloat(k[1]),parseFloat(k[2]));l.push(j);j=new OpenLayers.Geometry.Point(parseFloat(k[3]),parseFloat(k[2]));l.push(j);j=new OpenLayers.Geometry.Point(parseFloat(k[3]),parseFloat(k[0]));l.push(j);j=new OpenLayers.Geometry.Point(parseFloat(k[1]),parseFloat(k[0]));l.push(j)}e=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(l)])}}}}}if(e&&this.internalProjection&&this.externalProjection){e.transform(this.externalProjection,this.internalProjection)}return e},createFeatureFromItem:function(b){var c=this.createGeometryFromItem(b);var f=this.getChildValue(b,"*","title",this.featureTitle);var i=this.getChildValue(b,"*","description",this.getChildValue(b,"*","content",this.getChildValue(b,"*","summary",this.featureDescription)));var a=this.getChildValue(b,"*","link");if(!a){try{a=this.getElementsByTagNameNS(b,"*","link")[0].getAttribute("href")}catch(g){a=null}}var h=this.getChildValue(b,"*","id",null);var d={"title":f,"description":i,"link":a};var j=new OpenLayers.Feature.Vector(c,d);j.fid=h;return j},getChildValue:function(f,c,a,e){var d;var b=this.getElementsByTagNameNS(f,c,a);if(b&&b[0]&&b[0].firstChild&&b[0].firstChild.nodeValue){d=b[0].firstChild.nodeValue}else{d=(e==undefined)?"":e}return d},read:function(b){if(typeof b=="string"){b=OpenLayers.Format.XML.prototype.read.apply(this,[b])}var c=null;c=this.getElementsByTagNameNS(b,"*","item");if(c.length==0){c=this.getElementsByTagNameNS(b,"*","entry")}var a=c.length;var e=new Array(a);for(var d=0;d<a;d++){e[d]=this.createFeatureFromItem(c[d])}return e},write:function(d){var b;if(d instanceof Array){b=this.createElementNS(this.rssns,"rss");for(var c=0,a=d.length;c<a;c++){b.appendChild(this.createFeatureXML(d[c]))}}else{b=this.createFeatureXML(d)}return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(j){var d=this.buildGeometryNode(j.geometry);var h=this.createElementNS(this.rssns,"item");var i=this.createElementNS(this.rssns,"title");i.appendChild(this.createTextNode(j.attributes.title?j.attributes.title:""));var c=this.createElementNS(this.rssns,"description");c.appendChild(this.createTextNode(j.attributes.description?j.attributes.description:""));h.appendChild(i);h.appendChild(c);if(j.attributes.link){var f=this.createElementNS(this.rssns,"link");f.appendChild(this.createTextNode(j.attributes.link));h.appendChild(f)}for(var b in j.attributes){if(b=="link"||b=="title"||b=="description"){continue}var e=this.createTextNode(j.attributes[b]);var a=b;if(b.search(":")!=-1){a=b.split(":")[1]}var g=this.createElementNS(this.featureNS,"feature:"+a);g.appendChild(e);h.appendChild(g)}h.appendChild(d);return h},buildGeometryNode:function(a){if(this.internalProjection&&this.externalProjection){a=a.clone();a.transform(this.internalProjection,this.externalProjection)}var b;if(a.CLASS_NAME=="OpenLayers.Geometry.Polygon"){b=this.createElementNS(this.georssns,"georss:polygon");b.appendChild(this.buildCoordinatesNode(a.components[0]))}else{if(a.CLASS_NAME=="OpenLayers.Geometry.LineString"){b=this.createElementNS(this.georssns,"georss:line");b.appendChild(this.buildCoordinatesNode(a))}else{if(a.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.createElementNS(this.georssns,"georss:point");b.appendChild(this.buildCoordinatesNode(a))}else{throw"Couldn't parse "+a.CLASS_NAME}}}return b},buildCoordinatesNode:function(a){var e=null;if(a.components){e=a.components}var d;if(e){var c=e.length;var f=new Array(c);for(var b=0;b<c;b++){f[b]=e[b].y+" "+e[b].x}d=f.join(" ")}else{d=a.y+" "+a.x}return this.createTextNode(d)},CLASS_NAME:"OpenLayers.Format.GeoRSS"});OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new Date(),extractAttributes:true,extractStyles:false,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(a){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g),kmlColor:(/(\w{2})(\w{2})(\w{2})(\w{2})/),kmlIconPalette:(/root:\/\/icons\/palette-(\d+)(\.\w+)/),straightBracket:(/\$\[(.*?)\]/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(b){this.features=[];this.styles={};this.fetched={};var a={depth:0,styleBaseUrl:this.styleBaseUrl};return this.parseData(b,a)},parseData:function(g,f){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var e=["Link","NetworkLink","Style","StyleMap","Placemark"];for(var b=0,a=e.length;b<a;++b){var d=e[b];var c=this.getElementsByTagNameNS(g,"*",d);if(c.length==0){continue}switch(d.toLowerCase()){case"link":case"networklink":this.parseLinks(c,f);break;case"style":if(this.extractStyles){this.parseStyles(c,f)}break;case"stylemap":if(this.extractStyles){this.parseStyleMaps(c,f)}break;case"placemark":this.parseFeatures(c,f);break}}return this.features},parseLinks:function(c,d){if(d.depth>=this.maxDepth){return false}var f=OpenLayers.Util.extend({},d);f.depth++;for(var b=0,a=c.length;b<a;b++){var e=this.parseProperty(c[b],"*","href");if(e&&!this.fetched[e]){this.fetched[e]=true;var g=this.fetchLink(e);if(g){this.parseData(g,f)}}}},fetchLink:function(b){var a=OpenLayers.Request.GET({url:b,async:false});if(a){return a.responseText}},parseStyles:function(c,d){for(var b=0,a=c.length;b<a;b++){var e=this.parseStyle(c[b]);if(e){styleName=(d.styleBaseUrl||"")+"#"+e.id;this.styles[styleName]=e}}},parseStyle:function(J){var v={};var G=["LineStyle","PolyStyle","IconStyle","BalloonStyle"];var c,l,B,e;for(var N=0,d=G.length;N<d;++N){c=G[N];styleTypeNode=this.getElementsByTagNameNS(J,"*",c)[0];if(!styleTypeNode){continue}switch(c.toLowerCase()){case"linestyle":var P=this.parseProperty(styleTypeNode,"*","color");if(P){var u=(P.toString()).match(this.regExes.kmlColor);var S=u[1];v["strokeOpacity"]=parseInt(S,16)/255;var I=u[2];var K=u[3];var z=u[4];v["strokeColor"]="#"+z+K+I}var A=this.parseProperty(styleTypeNode,"*","width");if(A){v["strokeWidth"]=A}case"polystyle":var P=this.parseProperty(styleTypeNode,"*","color");if(P){var u=(P.toString()).match(this.regExes.kmlColor);var S=u[1];v["fillOpacity"]=parseInt(S,16)/255;var I=u[2];var K=u[3];var z=u[4];v["fillColor"]="#"+z+K+I}var L=this.parseProperty(styleTypeNode,"*","fill");if(L=="0"){v["fillColor"]="none"}break;case"iconstyle":var k=parseFloat(this.parseProperty(styleTypeNode,"*","scale")||1);var A=32*k;var f=32*k;var t=this.getElementsByTagNameNS(styleTypeNode,"*","Icon")[0];if(t){var p=this.parseProperty(t,"*","href");if(p){var C=this.parseProperty(t,"*","w");var D=this.parseProperty(t,"*","h");var m="http://maps.google.com/mapfiles/kml";if(OpenLayers.String.startsWith(p,m)&&!C&&!D){C=64;D=64;k=k/2}C=C||D;D=D||C;if(C){A=parseInt(C)*k}if(D){f=parseInt(D)*k}var u=p.match(this.regExes.kmlIconPalette);if(u){var H=u[1];var a=u[2];var q=this.parseProperty(t,"*","x");var s=this.parseProperty(t,"*","y");var j=q?q/32:0;var O=s?(7-s/32):7;var E=O*8+j;p="http://maps.google.com/mapfiles/kml/pal"+H+"/icon"+E+a}v["graphicOpacity"]=1;v["externalGraphic"]=p}}var o=this.getElementsByTagNameNS(styleTypeNode,"*","hotSpot")[0];if(o){var q=parseFloat(o.getAttribute("x"));var s=parseFloat(o.getAttribute("y"));var R=o.getAttribute("xunits");if(R=="pixels"){v["graphicXOffset"]=-q*k}else{if(R=="insetPixels"){v["graphicXOffset"]=-A+(q*k)}else{if(R=="fraction"){v["graphicXOffset"]=-A*q}}}var M=o.getAttribute("yunits");if(M=="pixels"){v["graphicYOffset"]=-f+(s*k)+1}else{if(M=="insetPixels"){v["graphicYOffset"]=-(s*k)+1}else{if(M=="fraction"){v["graphicYOffset"]=-f*(1-s)+1}}}}v["graphicWidth"]=A;v["graphicHeight"]=f;break;case"balloonstyle":var F=OpenLayers.Util.getXmlNodeValue(styleTypeNode);if(F){v["balloonStyle"]=F.replace(this.regExes.straightBracket,"${$1}")}break;default:}}if(!v["strokeColor"]&&v["fillColor"]){v["strokeColor"]=v["fillColor"]}var Q=J.getAttribute("id");if(Q&&v){v.id=Q}return v},parseStyleMaps:function(o,a){for(var k=0,l=o.length;k<l;k++){var b=o[k];var e=this.getElementsByTagNameNS(b,"*","Pair");var f=b.getAttribute("id");for(var g=0,h=e.length;g<h;g++){var c=e[g];var d=this.parseProperty(c,"*","key");var m=this.parseProperty(c,"*","styleUrl");if(m&&d=="normal"){this.styles[(a.styleBaseUrl||"")+"#"+f]=this.styles[(a.styleBaseUrl||"")+m]}if(m&&d=="highlight"){}}}},parseFeatures:function(h,a){var e=new Array(h.length);for(var d=0,b=h.length;d<b;d++){var f=h[d];var g=this.parseFeature.apply(this,[f]);if(g){if(this.extractStyles&&g.attributes&&g.attributes.styleUrl){g.style=this.getStyle(g.attributes.styleUrl,a)}if(this.extractStyles){var c=this.getElementsByTagNameNS(f,"*","Style")[0];if(c){var j=this.parseStyle(c);if(j){g.style=OpenLayers.Util.extend(g.style,j)}}}e[d]=g}else{throw"Bad Placemark: "+d}}this.features=this.features.concat(e)},parseFeature:function(b){var g=["MultiGeometry","Polygon","LineString","Point"];var e,c,d,l;for(var a=0,j=g.length;a<j;++a){e=g[a];this.internalns=b.namespaceURI?b.namespaceURI:this.kmlns;c=this.getElementsByTagNameNS(b,this.internalns,e);if(c.length>0){var l=this.parseGeometry[e.toLowerCase()];if(l){d=l.apply(this,[c[0]]);if(this.internalProjection&&this.externalProjection){d.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{"geomType":e}))}break}}var f;if(this.extractAttributes){f=this.parseAttributes(b)}var k=new OpenLayers.Feature.Vector(d,f);var h=b.getAttribute("id")||b.getAttribute("name");if(h!=null){k.fid=h}return k},getStyle:function(c,d){var a=OpenLayers.Util.removeTail(c);var e=OpenLayers.Util.extend({},d);e.depth++;e.styleBaseUrl=a;if(!this.styles[c]&&!OpenLayers.String.startsWith(c,"#")&&e.depth<=this.maxDepth&&!this.fetched[a]){var f=this.fetchLink(a);if(f){this.parseData(f,e)}}var b=OpenLayers.Util.extend({},this.styles[c]);return b},parseGeometry:{point:function(e){var a=this.getElementsByTagNameNS(e,this.internalns,"coordinates");var b=[];if(a.length>0){var c=a[0].firstChild.nodeValue;c=c.replace(this.regExes.removeSpace,"");b=c.split(",")}var d=null;if(b.length>1){if(b.length==2){b[2]=null}d=new OpenLayers.Geometry.Point(b[0],b[1],b[2])}else{throw"Bad coordinate string: "+c}return d},linestring:function(b,h){var e=this.getElementsByTagNameNS(b,this.internalns,"coordinates");var c=null;if(e.length>0){var d=this.getChildValue(e[0]);d=d.replace(this.regExes.trimSpace,"");d=d.replace(this.regExes.trimComma,",");var f=d.split(this.regExes.splitSpace);var a=f.length;var g=new Array(a);var j,l;for(var k=0;k<a;++k){j=f[k].split(",");l=j.length;if(l>1){if(j.length==2){j[2]=null}g[k]=new OpenLayers.Geometry.Point(j[0],j[1],j[2])}else{throw"Bad LineString point coordinates: "+f[k]}}if(a){if(h){c=new OpenLayers.Geometry.LinearRing(g)}else{c=new OpenLayers.Geometry.LineString(g)}}else{throw"Bad LineString coordinates: "+d}}return c},polygon:function(g){var c=this.getElementsByTagNameNS(g,this.internalns,"LinearRing");var d=c.length;var e=new Array(d);if(d>0){var b;for(var f=0,a=c.length;f<a;++f){b=this.parseGeometry.linestring.apply(this,[c[f],true]);if(b){e[f]=b}else{throw"Bad LinearRing geometry: "+f}}}return new OpenLayers.Geometry.Polygon(e)},multigeometry:function(b){var h,f;var e=[];var c=b.childNodes;for(var a=0,g=c.length;a<g;++a){h=c[a];if(h.nodeType==1){var d=(h.prefix)?h.nodeName.split(":")[1]:h.nodeName;var f=this.parseGeometry[d.toLowerCase()];if(f){e.push(f.apply(this,[h]))}}}return new OpenLayers.Geometry.Collection(e)}},parseAttributes:function(b){var d={};var e=b.getElementsByTagName("ExtendedData");if(e.length){d=this.parseExtendedData(e[0])}var l,k,j;var c=b.childNodes;for(var a=0,f=c.length;a<f;++a){l=c[a];if(l.nodeType==1){k=l.childNodes;if(k.length==1||k.length==3){var j;switch(k.length){case 1:j=k[0];break;case 3:default:j=k[1];break}if(j.nodeType==3||j.nodeType==4){var g=(l.prefix)?l.nodeName.split(":")[1]:l.nodeName;var h=OpenLayers.Util.getXmlNodeValue(j);if(h){h=h.replace(this.regExes.trimSpace,"");d[g]=h}}}}}return d},parseExtendedData:function(b){var c={};var j=b.getElementsByTagName("Data");for(var a=0,k=j.length;a<k;a++){var f=j[a];var d=f.getAttribute("name");var h={};var e=f.getElementsByTagName("value");if(e.length){h["value"]=this.getChildValue(e[0])}var g=f.getElementsByTagName("displayName");if(g.length){h["displayName"]=this.getChildValue(g[0])}c[d]=h}return c},parseProperty:function(d,a,g){var b;var c=this.getElementsByTagNameNS(d,a,g);try{b=OpenLayers.Util.getXmlNodeValue(c[0])}catch(f){b=null}return b},write:function(e){if(!(e instanceof Array)){e=[e]}var a=this.createElementNS(this.kmlns,"kml");var c=this.createFolderXML();for(var d=0,b=e.length;d<b;++d){c.appendChild(this.createPlacemarkXML(e[d]))}a.appendChild(c);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},createFolderXML:function(){var e=this.createElementNS(this.kmlns,"name");var d=this.createTextNode(this.foldersName);e.appendChild(d);var a=this.createElementNS(this.kmlns,"description");var b=this.createTextNode(this.foldersDesc);a.appendChild(b);var c=this.createElementNS(this.kmlns,"Folder");c.appendChild(e);c.appendChild(a);return c},createPlacemarkXML:function(e){var a=this.createElementNS(this.kmlns,"name");var f=(e.attributes.name)?e.attributes.name:e.id;a.appendChild(this.createTextNode(f));var g=this.createElementNS(this.kmlns,"description");var c=(e.attributes.description)?e.attributes.description:this.placemarksDesc;g.appendChild(this.createTextNode(c));var d=this.createElementNS(this.kmlns,"Placemark");if(e.fid!=null){d.setAttribute("id",e.fid)}d.appendChild(a);d.appendChild(g);var b=this.buildGeometryNode(e.geometry);d.appendChild(b);return d},buildGeometryNode:function(a){if(this.internalProjection&&this.externalProjection){a=a.clone();a.transform(this.internalProjection,this.externalProjection)}var c=a.CLASS_NAME;var b=c.substring(c.lastIndexOf(".")+1);var e=this.buildGeometry[b.toLowerCase()];var d=null;if(e){d=e.apply(this,[a])}return d},buildGeometry:{point:function(b){var a=this.createElementNS(this.kmlns,"Point");a.appendChild(this.buildCoordinatesNode(b));return a},multipoint:function(a){return this.buildGeometry.collection.apply(this,[a])},linestring:function(b){var a=this.createElementNS(this.kmlns,"LineString");a.appendChild(this.buildCoordinatesNode(b));return a},multilinestring:function(a){return this.buildGeometry.collection.apply(this,[a])},linearring:function(b){var a=this.createElementNS(this.kmlns,"LinearRing");a.appendChild(this.buildCoordinatesNode(b));return a},polygon:function(b){var h=this.createElementNS(this.kmlns,"Polygon");var d=b.components;var e,a,c;for(var f=0,g=d.length;f<g;++f){c=(f==0)?"outerBoundaryIs":"innerBoundaryIs";e=this.createElementNS(this.kmlns,c);a=this.buildGeometry.linearring.apply(this,[d[f]]);e.appendChild(a);h.appendChild(e)}return h},multipolygon:function(a){return this.buildGeometry.collection.apply(this,[a])},collection:function(b){var a=this.createElementNS(this.kmlns,"MultiGeometry");var d;for(var e=0,c=b.components.length;e<c;++e){d=this.buildGeometryNode.apply(this,[b.components[e]]);if(d){a.appendChild(d)}}return a}},buildCoordinatesNode:function(d){var b=this.createElementNS(this.kmlns,"coordinates");var j;var f=d.components;if(f){var g;var a=f.length;var e=new Array(a);for(var h=0;h<a;++h){g=f[h];e[h]=g.x+","+g.y}j=e.join(" ")}else{j=d.x+","+d.y}var c=this.createTextNode(j);b.appendChild(c);return b},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:false,interestingTagsExclude:null,areaTags:null,initialize:function(d){var b={"interestingTagsExclude":["source","source_ref","source:ref","history","attribution","created_by"],"areaTags":["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]};b=OpenLayers.Util.extend(b,d);var a={};for(var e=0;e<b.interestingTagsExclude.length;e++){a[b.interestingTagsExclude[e]]=true}b.interestingTagsExclude=a;var c={};for(var e=0;e<b.areaTags.length;e++){c[b.areaTags[e]]=true}b.areaTags=c;OpenLayers.Format.XML.prototype.initialize.apply(this,[b])},read:function(o){if(typeof o=="string"){o=OpenLayers.Format.XML.prototype.read.apply(this,[o])}var h=this.getNodes(o);var q=this.getWays(o);var p=new Array(q.length);for(var a=0;a<q.length;a++){var g=new Array(q[a].nodes.length);var l=this.isWayArea(q[a])?1:0;for(var b=0;b<q[a].nodes.length;b++){var c=h[q[a].nodes[b]];var m=new OpenLayers.Geometry.Point(c.lon,c.lat);m.osm_id=parseInt(q[a].nodes[b]);g[b]=m;c.used=true}var f=null;if(l){f=new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(g))}else{f=new OpenLayers.Geometry.LineString(g)}if(this.internalProjection&&this.externalProjection){f.transform(this.externalProjection,this.internalProjection)}var e=new OpenLayers.Feature.Vector(f,q[a].tags);e.osm_id=parseInt(q[a].id);e.fid="way."+e.osm_id;p[a]=e}for(var k in h){var c=h[k];if(!c.used||this.checkTags){var r=null;if(this.checkTags){var d=this.getTags(c.node,true);if(c.used&&!d[1]){continue}r=d[0]}else{r=this.getTags(c.node)}var e=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(c["lon"],c["lat"]),r);if(this.internalProjection&&this.externalProjection){e.geometry.transform(this.externalProjection,this.internalProjection)}e.osm_id=parseInt(k);e.fid="node."+e.osm_id;p.push(e)}c.node=null}return p},getNodes:function(b){var a=b.getElementsByTagName("node");var c={};for(var d=0;d<a.length;d++){var f=a[d];var e=f.getAttribute("id");c[e]={"lat":f.getAttribute("lat"),"lon":f.getAttribute("lon"),"node":f}}return c},getWays:function(e){var f=e.getElementsByTagName("way");var h=[];for(var a=0;a<f.length;a++){var d=f[a];var c={id:d.getAttribute("id")};c.tags=this.getTags(d);var g=d.getElementsByTagName("nd");c.nodes=new Array(g.length);for(var b=0;b<g.length;b++){c.nodes[b]=g[b].getAttribute("ref")}h.push(c)}return h},getTags:function(e,d){var b=e.getElementsByTagName("tag");var c={};var a=false;for(var g=0;g<b.length;g++){var f=b[g].getAttribute("k");c[f]=b[g].getAttribute("v");if(d){if(!this.interestingTagsExclude[f]){a=true}}}return d?[c,a]:c},isWayArea:function(c){var b=false;var d=false;if(c.nodes[0]==c.nodes[c.nodes.length-1]){b=true}if(this.checkTags){for(var a in c.tags){if(this.areaTags[a]){d=true;break}}}return b&&(this.checkTags?d:true)},write:function(e){if(!(e instanceof Array)){e=[e]}this.osm_id=1;this.created_nodes={};var d=this.createElementNS(null,"osm");d.setAttribute("version","0.5");d.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var c=e.length-1;c>=0;c--){var b=this.createFeatureNodes(e[c]);for(var a=0;a<b.length;a++){d.appendChild(b[a])}}return OpenLayers.Format.XML.prototype.write.apply(this,[d])},createFeatureNodes:function(d){var c=[];var a=d.geometry.CLASS_NAME;var b=a.substring(a.lastIndexOf(".")+1);b=b.toLowerCase();var e=this.createXML[b];if(e){c=e.apply(this,[d])}return c},createXML:{"point":function(e){var d=null;var a=e.geometry?e.geometry:e;var b=false;if(e.osm_id){d=e.osm_id;if(this.created_nodes[d]){b=true}}else{d=-this.osm_id;this.osm_id++}if(b){c=this.created_nodes[d]}else{var c=this.createElementNS(null,"node")}this.created_nodes[d]=c;c.setAttribute("id",d);c.setAttribute("lon",a.x);c.setAttribute("lat",a.y);if(e.attributes){this.serializeTags(e,c)}this.setState(e,c);return b?[]:[c]},linestring:function(g){var h=[];var d=g.geometry;if(g.osm_id){id=g.osm_id}else{id=-this.osm_id;this.osm_id++}var e=this.createElementNS(null,"way");e.setAttribute("id",id);for(var a=0;a<d.components.length;a++){var b=this.createXML["point"].apply(this,[d.components[a]]);if(b.length){b=b[0];var c=b.getAttribute("id");h.push(b)}else{c=d.components[a].osm_id;b=this.created_nodes[c]}this.setState(g,b);var f=this.createElementNS(null,"nd");f.setAttribute("ref",c);e.appendChild(f)}this.serializeTags(g,e);h.push(e);return h},polygon:function(c){var a=OpenLayers.Util.extend({"area":"yes"},c.attributes);var b=new OpenLayers.Feature.Vector(c.geometry.components[0],a);b.osm_id=c.osm_id;return this.createXML["linestring"].apply(this,[b])}},serializeTags:function(c,d){for(var b in c.attributes){var a=this.createElementNS(null,"tag");a.setAttribute("k",b);a.setAttribute("v",c.attributes[b]);d.appendChild(a)}},setState:function(b,c){if(b.state){var a=null;switch(b.state){case OpenLayers.State.UPDATE:a="modify";case OpenLayers.State.DELETE:a="delete"}if(a){c.setAttribute("action",a)}}},CLASS_NAME:"OpenLayers.Format.OSM"});OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(b,a,c){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var a=this.polygon&&this.polygon.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPolygon([a])}return a},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a,b){OpenLayers.Control.Panel.prototype.initialize.apply(this,[b]);this.addControls([new OpenLayers.Control.Navigation()]);var c=[new OpenLayers.Control.DrawFeature(a,OpenLayers.Handler.Point,{"displayClass":"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(a,OpenLayers.Handler.Path,{"displayClass":"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(a,OpenLayers.Handler.Polygon,{"displayClass":"olControlDrawFeaturePolygon"})];this.addControls(c)},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:["antialiasing","blockout","font","fontcolor","fontsize","fontstyle","glowing","interval","outline","printmode","shadow","transparency"],request:null,response:null,initialize:function(b){this.request=new OpenLayers.Format.ArcXML.Request();this.response=new OpenLayers.Format.ArcXML.Response();if(b){if(b.requesttype=="feature"){this.request.get_image=null;var c=this.request.get_feature.query;this.addCoordSys(c.featurecoordsys,b.featureCoordSys);this.addCoordSys(c.filtercoordsys,b.filterCoordSys);if(b.polygon){c.isspatial=true;c.spatialfilter.polygon=b.polygon}else{if(b.envelope){c.isspatial=true;c.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0};this.parseEnvelope(c.spatialfilter.envelope,b.envelope)}}}else{if(b.requesttype=="image"){this.request.get_feature=null;var a=this.request.get_image.properties;this.parseEnvelope(a.envelope,b.envelope);this.addLayers(a.layerlist,b.layers);this.addImageSize(a.imagesize,b.tileSize);this.addCoordSys(a.featurecoordsys,b.featureCoordSys);this.addCoordSys(a.filtercoordsys,b.filterCoordSys)}else{this.request=null}}}OpenLayers.Format.XML.prototype.initialize.apply(this,[b])},parseEnvelope:function(b,a){if(a&&a.length==4){b.minx=a[0];b.miny=a[1];b.maxx=a[2];b.maxy=a[3]}},addLayers:function(c,b){for(var d=0,a=b.length;d<a;d++){c.push(b[d])}},addImageSize:function(a,b){if(b!==null){a.width=b.w;a.height=b.h;a.printwidth=b.w;a.printheight=b.h}},addCoordSys:function(b,a){if(typeof a=="string"){b.id=parseInt(a);b.string=a}else{if(typeof a=="object"&&a.proj!==null){b.id=a.proj.srsProjNumber;b.string=a.proj.srsCode}else{b=a}}},iserror:function(c){var a=null;if(!c){a=(this.response.error!=="")}else{c=OpenLayers.Format.XML.prototype.read.apply(this,[c]);var b=c.documentElement.getElementsByTagName("ERROR");a=(b!==null&&b.length>0)}return a},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=null;if(f&&f.documentElement){if(f.documentElement.nodeName=="ARCXML"){c=f.documentElement}else{c=f.documentElement.getElementsByTagName("ARCXML")[0]}}if(!c){var a,e;try{a=f.firstChild.nodeValue;e=f.firstChild.childNodes[1].firstChild.nodeValue}catch(d){}throw {message:"Error parsing the ArcXML request",error:a,source:e}}var b=this.parseResponse(c);return b},write:function(z){if(!z){z=this.request}var u=this.createElementNS("","ARCXML");u.setAttribute("version","1.1");var A=this.createElementNS("","REQUEST");if(z.get_image!=null){var a=this.createElementNS("","GET_IMAGE");A.appendChild(a);var e=this.createElementNS("","PROPERTIES");a.appendChild(e);var b=z.get_image.properties;if(b.featurecoordsys!=null){var g=this.createElementNS("","FEATURECOORDSYS");e.appendChild(g);if(b.featurecoordsys.id===0){g.setAttribute("string",b.featurecoordsys["string"])}else{g.setAttribute("id",b.featurecoordsys.id)}}if(b.filtercoordsys!=null){var w=this.createElementNS("","FILTERCOORDSYS");e.appendChild(w);if(b.filtercoordsys.id===0){w.setAttribute("string",b.filtercoordsys.string)}else{w.setAttribute("id",b.filtercoordsys.id)}}if(b.envelope!=null){var v=this.createElementNS("","ENVELOPE");e.appendChild(v);v.setAttribute("minx",b.envelope.minx);v.setAttribute("miny",b.envelope.miny);v.setAttribute("maxx",b.envelope.maxx);v.setAttribute("maxy",b.envelope.maxy)}var p=this.createElementNS("","IMAGESIZE");e.appendChild(p);p.setAttribute("height",b.imagesize.height);p.setAttribute("width",b.imagesize.width);if(b.imagesize.height!=b.imagesize.printheight||b.imagesize.width!=b.imagesize.printwidth){p.setAttribute("printheight",b.imagesize.printheight);p.setArrtibute("printwidth",b.imagesize.printwidth)}if(b.background!=null){var q=this.createElementNS("","BACKGROUND");e.appendChild(q);q.setAttribute("color",b.background.color.r+","+b.background.color.g+","+b.background.color.b);if(b.background.transcolor!==null){q.setAttribute("transcolor",b.background.transcolor.r+","+b.background.transcolor.g+","+b.background.transcolor.b)}}if(b.layerlist!=null&&b.layerlist.length>0){var l=this.createElementNS("","LAYERLIST");e.appendChild(l);for(var r=0;r<b.layerlist.length;r++){var f=this.createElementNS("","LAYERDEF");l.appendChild(f);f.setAttribute("id",b.layerlist[r].id);f.setAttribute("visible",b.layerlist[r].visible);if(typeof b.layerlist[r].query=="object"){var m=b.layerlist[r].query;if(m.where.length<0){continue}var j=null;if(typeof m.spatialfilter=="boolean"&&m.spatialfilter){j=this.createElementNS("","SPATIALQUERY")}else{j=this.createElementNS("","QUERY")}j.setAttribute("where",m.where);if(typeof m.accuracy=="number"&&m.accuracy>0){j.setAttribute("accuracy",m.accuracy)}if(typeof m.featurelimit=="number"&&m.featurelimit<2000){j.setAttribute("featurelimit",m.featurelimit)}if(typeof m.subfields=="string"&&m.subfields!="#ALL#"){j.setAttribute("subfields",m.subfields)}if(typeof m.joinexpression=="string"&&m.joinexpression.length>0){j.setAttribute("joinexpression",m.joinexpression)}if(typeof m.jointables=="string"&&m.jointables.length>0){j.setAttribute("jointables",m.jointables)}f.appendChild(j)}if(typeof b.layerlist[r].renderer=="object"){this.addRenderer(f,b.layerlist[r].renderer)}}}}else{if(z.get_feature!=null){var a=this.createElementNS("","GET_FEATURES");a.setAttribute("outputmode","newxml");a.setAttribute("checkesc","true");if(z.get_feature.geometry){a.setAttribute("geometry",z.get_feature.geometry)}else{a.setAttribute("geometry","false")}if(z.get_feature.compact){a.setAttribute("compact",z.get_feature.compact)}if(z.get_feature.featurelimit=="number"){a.setAttribute("featurelimit",z.get_feature.featurelimit)}a.setAttribute("globalenvelope","true");A.appendChild(a);if(z.get_feature.layer!=null&&z.get_feature.layer.length>0){var k=this.createElementNS("","LAYER");k.setAttribute("id",z.get_feature.layer);a.appendChild(k)}var t=z.get_feature.query;if(t!=null){var o=null;if(t.isspatial){o=this.createElementNS("","SPATIALQUERY")}else{o=this.createElementNS("","QUERY")}a.appendChild(o);if(typeof t.accuracy=="number"){o.setAttribute("accuracy",t.accuracy)}if(t.featurecoordsys!=null){var c=this.createElementNS("","FEATURECOORDSYS");if(t.featurecoordsys.id==0){c.setAttribute("string",t.featurecoordsys.string)}else{c.setAttribute("id",t.featurecoordsys.id)}o.appendChild(c)}if(t.filtercoordsys!=null){var s=this.createElementNS("","FILTERCOORDSYS");if(t.filtercoordsys.id===0){s.setAttribute("string",t.filtercoordsys.string)}else{s.setAttribute("id",t.filtercoordsys.id)}o.appendChild(s)}if(t.buffer>0){var h=this.createElementNS("","BUFFER");h.setAttribute("distance",t.buffer);o.appendChild(h)}if(t.isspatial){var i=this.createElementNS("","SPATIALFILTER");i.setAttribute("relation",t.spatialfilter.relation);o.appendChild(i);if(t.spatialfilter.envelope){var d=this.createElementNS("","ENVELOPE");d.setAttribute("minx",t.spatialfilter.envelope.minx);d.setAttribute("miny",t.spatialfilter.envelope.miny);d.setAttribute("maxx",t.spatialfilter.envelope.maxx);d.setAttribute("maxy",t.spatialfilter.envelope.maxy);i.appendChild(d)}else{if(typeof t.spatialfilter.polygon=="object"){i.appendChild(this.writePolygonGeometry(t.spatialfilter.polygon))}}}if(t.where!=null&&t.where.length>0){o.setAttribute("where",t.where)}}}}u.appendChild(A);return OpenLayers.Format.XML.prototype.write.apply(this,[u])},addGroupRenderer:function(e,c){var a=this.createElementNS("","GROUPRENDERER");e.appendChild(a);for(var b=0;b<c.length;b++){var d=c[b];this.addRenderer(a,d)}},addRenderer:function(c,b){if(b instanceof Array){this.addGroupRenderer(c,b)}else{var a=this.createElementNS("",b.type.toUpperCase()+"RENDERER");c.appendChild(a);if(a.tagName=="VALUEMAPRENDERER"){this.addValueMapRenderer(a,b)}else{if(a.tagName=="VALUEMAPLABELRENDERER"){this.addValueMapLabelRenderer(a,b)}else{if(a.tagName=="SIMPLELABELRENDERER"){this.addSimpleLabelRenderer(a,b)}else{if(a.tagName=="SCALEDEPENDENTRENDERER"){this.addScaleDependentRenderer(a,b)}}}}}},addScaleDependentRenderer:function(a,b){if(typeof b.lower=="string"||typeof b.lower=="number"){a.setAttribute("lower",b.lower)}if(typeof b.upper=="string"||typeof b.upper=="number"){a.setAttribute("upper",b.upper)}this.addRenderer(a,b.renderer)},addValueMapLabelRenderer:function(k,l){k.setAttribute("lookupfield",l.lookupfield);k.setAttribute("labelfield",l.labelfield);if(typeof l.exacts=="object"){for(var g=0,f=l.exacts.length;g<f;g++){var j=l.exacts[g];var b=this.createElementNS("","EXACT");if(typeof j.value=="string"){b.setAttribute("value",j.value)}if(typeof j.label=="string"){b.setAttribute("label",j.label)}if(typeof j.method=="string"){b.setAttribute("method",j.method)}k.appendChild(b);if(typeof j.symbol=="object"){var e=null;if(j.symbol.type=="text"){e=this.createElementNS("","TEXTSYMBOL")}if(e!=null){var h=this.fontStyleKeys;for(var a=0,c=h.length;a<c;a++){var d=h[a];if(j.symbol[d]){e.setAttribute(d,j.symbol[d])}}b.appendChild(e)}}}}},addValueMapRenderer:function(i,k){i.setAttribute("lookupfield",k.lookupfield);if(typeof k.ranges=="object"){for(var b=0,e=k.ranges.length;b<e;b++){var d=k.ranges[b];var j=this.createElementNS("","RANGE");j.setAttribute("lower",d.lower);j.setAttribute("upper",d.upper);i.appendChild(j);if(typeof d.symbol=="object"){var c=null;if(d.symbol.type=="simplepolygon"){c=this.createElementNS("","SIMPLEPOLYGONSYMBOL")}if(c!=null){if(typeof d.symbol.boundarycolor=="string"){c.setAttribute("boundarycolor",d.symbol.boundarycolor)}if(typeof d.symbol.fillcolor=="string"){c.setAttribute("fillcolor",d.symbol.fillcolor)}if(typeof d.symbol.filltransparency=="number"){c.setAttribute("filltransparency",d.symbol.filltransparency)}j.appendChild(c)}}}}else{if(typeof k.exacts=="object"){for(var g=0,f=k.exacts.length;g<f;g++){var h=k.exacts[g];var a=this.createElementNS("","EXACT");if(typeof h.value=="string"){a.setAttribute("value",h.value)}if(typeof h.label=="string"){a.setAttribute("label",h.label)}if(typeof h.method=="string"){a.setAttribute("method",h.method)}i.appendChild(a);if(typeof h.symbol=="object"){var c=null;if(h.symbol.type=="simplemarker"){c=this.createElementNS("","SIMPLEMARKERSYMBOL")}if(c!=null){if(typeof h.symbol.antialiasing=="string"){c.setAttribute("antialiasing",h.symbol.antialiasing)}if(typeof h.symbol.color=="string"){c.setAttribute("color",h.symbol.color)}if(typeof h.symbol.outline=="string"){c.setAttribute("outline",h.symbol.outline)}if(typeof h.symbol.overlap=="string"){c.setAttribute("overlap",h.symbol.overlap)}if(typeof h.symbol.shadow=="string"){c.setAttribute("shadow",h.symbol.shadow)}if(typeof h.symbol.transparency=="number"){c.setAttribute("transparency",h.symbol.transparency)}if(typeof h.symbol.usecentroid=="string"){c.setAttribute("usecentroid",h.symbol.usecentroid)}if(typeof h.symbol.width=="number"){c.setAttribute("width",h.symbol.width)}a.appendChild(c)}}}}}},addSimpleLabelRenderer:function(g,h){g.setAttribute("field",h.field);var f=["featureweight","howmanylabels","labelbufferratio","labelpriorities","labelweight","linelabelposition","rotationalangles"];for(var a=0,b=f.length;a<b;a++){var c=f[a];if(h[c]){g.setAttribute(c,h[c])}}if(h.symbol.type=="text"){var e=h.symbol;var d=this.createElementNS("","TEXTSYMBOL");g.appendChild(d);var f=this.fontStyleKeys;for(var a=0,b=f.length;a<b;a++){var c=f[a];if(e[c]){d.setAttribute(c,h[c])}}}},writePolygonGeometry:function(i){if(!(i instanceof OpenLayers.Geometry.Polygon)){throw {message:"Cannot write polygon geometry to ArcXML with an "+i.CLASS_NAME+" object.",geometry:i}}var c=this.createElementNS("","POLYGON");for(var j=0,e=i.components.length;j<e;j++){var g=i.components[j];var b=this.createElementNS("","RING");for(var d=0,f=g.components.length;d<f;d++){var h=g.components[d];var a=this.createElementNS("","POINT");a.setAttribute("x",h.x);a.setAttribute("y",h.y);b.appendChild(a)}c.appendChild(b)}return c},parseResponse:function(D){if(typeof D=="string"){var C=new OpenLayers.Format.XML();D=C.read(D)}var m=new OpenLayers.Format.ArcXML.Response();var s=D.getElementsByTagName("ERROR");if(s!=null&&s.length>0){m.error=this.getChildValue(s,"Unknown error.")}else{var v=D.getElementsByTagName("RESPONSE");if(v==null||v.length==0){m.error="No RESPONSE tag found in ArcXML response.";return m}var A=v[0].firstChild.nodeName;if(A=="#text"){A=v[0].firstChild.nextSibling.nodeName}if(A=="IMAGE"){var o=D.getElementsByTagName("ENVELOPE");var l=D.getElementsByTagName("OUTPUT");if(o==null||o.length==0){m.error="No ENVELOPE tag found in ArcXML response."}else{if(l==null||l.length==0){m.error="No OUTPUT tag found in ArcXML response."}else{var z=this.parseAttributes(o[0]);var e=this.parseAttributes(l[0]);if(typeof e.type=="string"){m.image={envelope:z,output:{type:e.type,data:this.getChildValue(l[0])}}}else{m.image={envelope:z,output:e}}}}}else{if(A=="FEATURES"){var u=v[0].getElementsByTagName("FEATURES");var w=u[0].getElementsByTagName("FEATURECOUNT");m.features.featurecount=w[0].getAttribute("count");if(m.features.featurecount>0){var a=u[0].getElementsByTagName("ENVELOPE");m.features.envelope=this.parseAttributes(a[0],typeof(0));var p=u[0].getElementsByTagName("FEATURE");for(var r=0;r<p.length;r++){var c=new OpenLayers.Feature.Vector();var d=p[r].getElementsByTagName("FIELD");for(var b=0;b<d.length;b++){var t=d[b].getAttribute("name");var q=d[b].getAttribute("value");c.attributes[t]=q}var i=p[r].getElementsByTagName("POLYGON");if(i.length>0){var h=i[0].getElementsByTagName("RING");var g=[];for(var f=0;f<h.length;f++){var j=[];j.push(this.parsePointGeometry(h[f]));var B=h[f].getElementsByTagName("HOLE");for(var k=0;k<B.length;k++){j.push(this.parsePointGeometry(B[k]))}B=null;g.push(new OpenLayers.Geometry.Polygon(j));j=null}h=null;if(g.length==1){c.geometry=g[0]}else{c.geometry=new OpenLayers.Geometry.MultiPolygon(g)}}m.features.feature.push(c)}}}else{m.error="Unidentified response type."}}}return m},parseAttributes:function(d,b){var c={};for(var a=0;a<d.attributes.length;a++){if(b=="number"){c[d.attributes[a].nodeName]=parseFloat(d.attributes[a].nodeValue)}else{c[d.attributes[a].nodeName]=d.attributes[a].nodeValue}}return c},parsePointGeometry:function(a){var g=[];var f=a.getElementsByTagName("COORDS");if(f.length>0){var c=this.getChildValue(f[0]);c=c.split(/;/);for(var b=0;b<c.length;b++){var d=c[b].split(/ /);g.push(new OpenLayers.Geometry.Point(parseFloat(d[0]),parseFloat(d[1])))}f=null}else{var e=a.getElementsByTagName("POINT");if(e.length>0){for(var h=0;h<e.length;h++){g.push(new OpenLayers.Geometry.Point(parseFloat(e[h].getAttribute("x")),parseFloat(e[h].getAttribute("y"))))}}e=null}return new OpenLayers.Geometry.LinearRing(g)},CLASS_NAME:"OpenLayers.Format.ArcXML"});OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(a){var b={get_image:{properties:{background:null,draw:true,envelope:{minx:0,miny:0,maxx:0,maxy:0},featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},imagesize:{height:0,width:0,dpi:96,printheight:0,printwidth:0,scalesymbols:false},layerlist:[],output:{baseurl:"",legendbaseurl:"",legendname:"",legendpath:"",legendurl:"",name:"",path:"",type:"jpg",url:""}}},get_feature:{layer:"",query:{isspatial:false,featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},buffer:0,where:"",spatialfilter:{relation:"envelope_intersection",envelope:null}}},environment:{separators:{cs:" ",ts:";"}},layer:[],workspaces:[]};return OpenLayers.Util.extend(this,b)},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"});OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(a){var b={image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""};return OpenLayers.Util.extend(this,b)},CLASS_NAME:"OpenLayers.Format.ArcXML.Response"});OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.umn.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"features",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.opengis.net/gml",extractAttributes:true,xy:true,initialize:function(a){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var c=this.getElementsByTagNameNS(e.documentElement,this.gmlns,this.featureName);var a=[];for(var d=0;d<c.length;d++){var b=this.parseFeature(c[d]);if(b){a.push(b)}}return a},parseFeature:function(b){var h=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope","Box"];var e,c,d,l;for(var a=0;a<h.length;++a){e=h[a];c=this.getElementsByTagNameNS(b,this.gmlns,e);if(c.length>0){var l=this.parseGeometry[e.toLowerCase()];if(l){d=l.apply(this,[c[0]]);if(this.internalProjection&&this.externalProjection){d.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{"geomType":e}))}break}}var f;if(this.extractAttributes){f=this.parseAttributes(b)}var k=new OpenLayers.Feature.Vector(d,f);k.gml={featureType:b.firstChild.nodeName.split(":")[1],featureNS:b.firstChild.namespaceURI,featureNSPrefix:b.firstChild.prefix};var g=b.firstChild;var j;while(g){if(g.nodeType==1){j=g.getAttribute("fid")||g.getAttribute("id");if(j){break}}g=g.nextSibling}k.fid=j;return k},parseGeometry:{point:function(f){var b,d;var c=[];var b=this.getElementsByTagNameNS(f,this.gmlns,"pos");if(b.length>0){d=b[0].firstChild.nodeValue;d=d.replace(this.regExes.trimSpace,"");c=d.split(this.regExes.splitSpace)}if(c.length==0){b=this.getElementsByTagNameNS(f,this.gmlns,"coordinates");if(b.length>0){d=b[0].firstChild.nodeValue;d=d.replace(this.regExes.removeSpace,"");c=d.split(",")}}if(c.length==0){b=this.getElementsByTagNameNS(f,this.gmlns,"coord");if(b.length>0){var a=this.getElementsByTagNameNS(b[0],this.gmlns,"X");var e=this.getElementsByTagNameNS(b[0],this.gmlns,"Y");if(a.length>0&&e.length>0){c=[a[0].firstChild.nodeValue,e[0].firstChild.nodeValue]}}}if(c.length==2){c[2]=null}if(this.xy){return new OpenLayers.Geometry.Point(c[0],c[1],c[2])}else{return new OpenLayers.Geometry.Point(c[1],c[0],c[2])}},multipoint:function(e){var a=this.getElementsByTagNameNS(e,this.gmlns,"Point");var b=[];if(a.length>0){var c;for(var d=0;d<a.length;++d){c=this.parseGeometry.point.apply(this,[a[d]]);if(c){b.push(c)}}}return new OpenLayers.Geometry.MultiPoint(b)},linestring:function(b,q){var c,e;var o=[];var l=[];c=this.getElementsByTagNameNS(b,this.gmlns,"posList");if(c.length>0){e=this.getChildValue(c[0]);e=e.replace(this.regExes.trimSpace,"");o=e.split(this.regExes.splitSpace);var m=parseInt(c[0].getAttribute("dimension"));var p,f,g,h;for(var a=0;a<o.length/m;++a){p=a*m;f=o[p];g=o[p+1];h=(m==2)?null:o[p+2];if(this.xy){l.push(new OpenLayers.Geometry.Point(f,g,h))}else{l.push(new OpenLayers.Geometry.Point(g,f,h))}}}if(o.length==0){c=this.getElementsByTagNameNS(b,this.gmlns,"coordinates");if(c.length>0){e=this.getChildValue(c[0]);e=e.replace(this.regExes.trimSpace,"");e=e.replace(this.regExes.trimComma,",");var k=e.split(this.regExes.splitSpace);for(var a=0;a<k.length;++a){o=k[a].split(",");if(o.length==2){o[2]=null}if(this.xy){l.push(new OpenLayers.Geometry.Point(o[0],o[1],o[2]))}else{l.push(new OpenLayers.Geometry.Point(o[1],o[0],o[2]))}}}}var d=null;if(l.length!=0){if(q){d=new OpenLayers.Geometry.LinearRing(l)}else{d=new OpenLayers.Geometry.LineString(l)}}return d},multilinestring:function(e){var a=this.getElementsByTagNameNS(e,this.gmlns,"LineString");var b=[];if(a.length>0){var c;for(var d=0;d<a.length;++d){c=this.parseGeometry.linestring.apply(this,[a[d]]);if(c){b.push(c)}}}return new OpenLayers.Geometry.MultiLineString(b)},polygon:function(e){var b=this.getElementsByTagNameNS(e,this.gmlns,"LinearRing");var c=[];if(b.length>0){var a;for(var d=0;d<b.length;++d){a=this.parseGeometry.linestring.apply(this,[b[d],true]);if(a){c.push(a)}}}return new OpenLayers.Geometry.Polygon(c)},multipolygon:function(e){var a=this.getElementsByTagNameNS(e,this.gmlns,"Polygon");var b=[];if(a.length>0){var d;for(var c=0;c<a.length;++c){d=this.parseGeometry.polygon.apply(this,[a[c]]);if(d){b.push(d)}}}return new OpenLayers.Geometry.MultiPolygon(b)},envelope:function(a){var i=[];var c;var g;var e=this.getElementsByTagNameNS(a,this.gmlns,"lowerCorner");if(e.length>0){var h=[];if(e.length>0){c=e[0].firstChild.nodeValue;c=c.replace(this.regExes.trimSpace,"");h=c.split(this.regExes.splitSpace)}if(h.length==2){h[2]=null}if(this.xy){var b=new OpenLayers.Geometry.Point(h[0],h[1],h[2])}else{var b=new OpenLayers.Geometry.Point(h[1],h[0],h[2])}}var d=this.getElementsByTagNameNS(a,this.gmlns,"upperCorner");if(d.length>0){var h=[];if(d.length>0){c=d[0].firstChild.nodeValue;c=c.replace(this.regExes.trimSpace,"");h=c.split(this.regExes.splitSpace)}if(h.length==2){h[2]=null}if(this.xy){var j=new OpenLayers.Geometry.Point(h[0],h[1],h[2])}else{var j=new OpenLayers.Geometry.Point(h[1],h[0],h[2])}}if(b&&j){i.push(new OpenLayers.Geometry.Point(b.x,b.y));i.push(new OpenLayers.Geometry.Point(j.x,b.y));i.push(new OpenLayers.Geometry.Point(j.x,j.y));i.push(new OpenLayers.Geometry.Point(b.x,j.y));i.push(new OpenLayers.Geometry.Point(b.x,b.y));var f=new OpenLayers.Geometry.LinearRing(i);g=new OpenLayers.Geometry.Polygon([f])}return g}},parseAttributes:function(b){var d={};var g=b.firstChild;var c,a,k,j,h,f,e;while(g){if(g.nodeType==1){c=g.childNodes;for(a=0;a<c.length;++a){k=c[a];if(k.nodeType==1){j=k.childNodes;if(j.length==1){h=j[0];if(h.nodeType==3||h.nodeType==4){f=(k.prefix)?k.nodeName.split(":")[1]:k.nodeName;e=h.nodeValue.replace(this.regExes.trimSpace,"");d[f]=e}}else{d[k.nodeName.split(":").pop()]=null}}}break}g=g.nextSibling}return d},write:function(c){if(!(c instanceof Array)){c=[c]}var a=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName);for(var b=0;b<c.length;b++){a.appendChild(this.createFeatureXML(c[b]))}return OpenLayers.Format.XML.prototype.write.apply(this,[a])},createFeatureXML:function(j){var f=j.geometry;var g=this.buildGeometryNode(f);var a=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);a.appendChild(g);var i=this.createElementNS(this.gmlns,"gml:"+this.featureName);var k=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);var c=j.fid||j.id;k.setAttribute("fid",c);k.appendChild(a);for(var b in j.attributes){var d=this.createTextNode(j.attributes[b]);var e=b.substring(b.lastIndexOf(":")+1);var h=this.createElementNS(this.featureNS,this.featurePrefix+":"+e);h.appendChild(d);k.appendChild(h)}i.appendChild(k);return i},buildGeometryNode:function(a){if(this.externalProjection&&this.internalProjection){a=a.clone();a.transform(this.internalProjection,this.externalProjection)}var c=a.CLASS_NAME;var b=c.substring(c.lastIndexOf(".")+1);var d=this.buildGeometry[b.toLowerCase()];return d.apply(this,[a])},buildGeometry:{point:function(a){var b=this.createElementNS(this.gmlns,"gml:Point");b.appendChild(this.buildCoordinatesNode(a));return b},multipoint:function(a){var d=this.createElementNS(this.gmlns,"gml:MultiPoint");var e=a.components;var b,c;for(var f=0;f<e.length;f++){b=this.createElementNS(this.gmlns,"gml:pointMember");c=this.buildGeometry.point.apply(this,[e[f]]);b.appendChild(c);d.appendChild(b)}return d},linestring:function(a){var b=this.createElementNS(this.gmlns,"gml:LineString");b.appendChild(this.buildCoordinatesNode(a));return b},multilinestring:function(a){var c=this.createElementNS(this.gmlns,"gml:MultiLineString");var e=a.components;var b,f;for(var d=0;d<e.length;++d){b=this.createElementNS(this.gmlns,"gml:lineStringMember");f=this.buildGeometry.linestring.apply(this,[e[d]]);b.appendChild(f);c.appendChild(b)}return c},linearring:function(a){var b=this.createElementNS(this.gmlns,"gml:LinearRing");b.appendChild(this.buildCoordinatesNode(a));return b},polygon:function(b){var e=this.createElementNS(this.gmlns,"gml:Polygon");var d=b.components;var a,c,g;for(var f=0;f<d.length;++f){g=(f==0)?"outerBoundaryIs":"innerBoundaryIs";a=this.createElementNS(this.gmlns,"gml:"+g);c=this.buildGeometry.linearring.apply(this,[d[f]]);a.appendChild(c);e.appendChild(a)}return e},multipolygon:function(b){var e=this.createElementNS(this.gmlns,"gml:MultiPolygon");var a=b.components;var d,f;for(var c=0;c<a.length;++c){d=this.createElementNS(this.gmlns,"gml:polygonMember");f=this.buildGeometry.polygon.apply(this,[a[c]]);d.appendChild(f);e.appendChild(d)}return e},bounds:function(a){var b=this.createElementNS(this.gmlns,"gml:Box");b.appendChild(this.buildCoordinatesNode(a));return b}},buildCoordinatesNode:function(b){var a=this.createElementNS(this.gmlns,"gml:coordinates");a.setAttribute("decimal",".");a.setAttribute("cs",",");a.setAttribute("ts"," ");var e=[];if(b instanceof OpenLayers.Bounds){e.push(b.left+","+b.bottom);e.push(b.right+","+b.top)}else{var f=(b.components)?b.components:[b];for(var d=0;d<f.length;d++){e.push(f[d].x+","+f[d].y)}}var c=this.createTextNode(e.join(" "));a.appendChild(c);return a},CLASS_NAME:"OpenLayers.Format.GML"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{initialize:function(a){OpenLayers.Format.JSON.prototype.initialize.apply(this,[a])},read:function(h,d,c){d=(d)?d:"FeatureCollection";var e=null;var a=null;if(typeof h=="string"){a=OpenLayers.Format.JSON.prototype.read.apply(this,[h,c])}else{a=h}if(!a){OpenLayers.Console.error("Bad JSON: "+h)}else{if(typeof(a.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+h)}else{if(this.isValidType(a,d)){switch(d){case"Geometry":try{e=this.parseGeometry(a)}catch(f){OpenLayers.Console.error(f)}break;case"Feature":try{e=this.parseFeature(a);e.type="Feature"}catch(f){OpenLayers.Console.error(f)}break;case"FeatureCollection":e=[];switch(a.type){case"Feature":try{e.push(this.parseFeature(a))}catch(f){e=null;OpenLayers.Console.error(f)}break;case"FeatureCollection":for(var g=0,b=a.features.length;g<b;++g){try{e.push(this.parseFeature(a.features[g]))}catch(f){e=null;OpenLayers.Console.error(f)}}break;default:try{var j=this.parseGeometry(a);e.push(new OpenLayers.Feature.Vector(j))}catch(f){e=null;OpenLayers.Console.error(f)}}break}}}}return e},isValidType:function(c,a){var b=false;switch(a){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],c.type)==-1){OpenLayers.Console.error("Unsupported geometry type: "+c.type)}else{b=true}break;case"FeatureCollection":b=true;break;default:if(c.type==a){b=true}else{OpenLayers.Console.error("Cannot convert types from "+c.type+" to "+a)}}return b},parseFeature:function(f){var b,a,e,d;e=(f.properties)?f.properties:{};d=(f.geometry&&f.geometry.bbox)||f.bbox;try{a=this.parseGeometry(f.geometry)}catch(c){throw c}b=new OpenLayers.Feature.Vector(a,e);if(d){b.bounds=OpenLayers.Bounds.fromArray(d)}if(f.id){b.fid=f.id}return b},parseGeometry:function(g){if(g==null){return null}var b,a=false;if(g.type=="GeometryCollection"){if(!(g.geometries instanceof Array)){throw"GeometryCollection must have geometries array: "+g}var f=g.geometries.length;var c=new Array(f);for(var e=0;e<f;++e){c[e]=this.parseGeometry.apply(this,[g.geometries[e]])}b=new OpenLayers.Geometry.Collection(c);a=true}else{if(!(g.coordinates instanceof Array)){throw"Geometry must have coordinates array: "+g}if(!this.parseCoords[g.type.toLowerCase()]){throw"Unsupported geometry type: "+g.type}try{b=this.parseCoords[g.type.toLowerCase()].apply(this,[g.coordinates])}catch(d){throw d}}if(this.internalProjection&&this.externalProjection&&!a){b.transform(this.externalProjection,this.internalProjection)}return b},parseCoords:{"point":function(a){if(a.length!=2){throw"Only 2D points are supported: "+a}return new OpenLayers.Geometry.Point(a[0],a[1])},"multipoint":function(f){var e=[];var c=null;for(var b=0,a=f.length;b<a;++b){try{c=this.parseCoords["point"].apply(this,[f[b]])}catch(d){throw d}e.push(c)}return new OpenLayers.Geometry.MultiPoint(e)},"linestring":function(f){var e=[];var c=null;for(var b=0,a=f.length;b<a;++b){try{c=this.parseCoords["point"].apply(this,[f[b]])}catch(d){throw d}e.push(c)}return new OpenLayers.Geometry.LineString(e)},"multilinestring":function(e){var d=[];var f=null;for(var b=0,a=e.length;b<a;++b){try{f=this.parseCoords["linestring"].apply(this,[e[b]])}catch(c){throw c}d.push(f)}return new OpenLayers.Geometry.MultiLineString(d)},"polygon":function(f){var b=[];var a,g;for(var e=0,c=f.length;e<c;++e){try{g=this.parseCoords["linestring"].apply(this,[f[e]])}catch(d){throw d}a=new OpenLayers.Geometry.LinearRing(g.components);b.push(a)}return new OpenLayers.Geometry.Polygon(b)},"multipolygon":function(f){var a=[];var c=null;for(var e=0,b=f.length;e<b;++e){try{c=this.parseCoords["polygon"].apply(this,[f[e]])}catch(d){throw d}a.push(c)}return new OpenLayers.Geometry.MultiPolygon(a)},"box":function(a){if(a.length!=2){throw"GeoJSON box coordinates must have 2 elements"}return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(a[0][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[0][1])])])}},write:function(g,d){var e={"type":null};if(g instanceof Array){e.type="FeatureCollection";var c=g.length;e.features=new Array(c);for(var b=0;b<c;++b){var f=g[b];if(!f instanceof OpenLayers.Feature.Vector){var a="FeatureCollection only supports collections "+"of features: "+f;throw a}e.features[b]=this.extract.feature.apply(this,[f])}}else{if(g.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){e=this.extract.geometry.apply(this,[g])}else{if(g instanceof OpenLayers.Feature.Vector){e=this.extract.feature.apply(this,[g]);if(g.layer&&g.layer.projection){e.crs=this.createCRSObject(g)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[e,d])},createCRSObject:function(c){var a=c.layer.projection.toString();var d={};if(a.match(/epsg:/i)){var b=parseInt(a.substring(a.indexOf(":")+1));if(b==4326){d={"type":"OGC","properties":{"urn":"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{d={"type":"EPSG","properties":{"code":b}}}}return d},extract:{"feature":function(a){var b=this.extract.geometry.apply(this,[a.geometry]);return{"type":"Feature","id":a.fid==null?a.id:a.fid,"properties":a.attributes,"geometry":b}},"geometry":function(a){if(a==null){return null}if(this.internalProjection&&this.externalProjection){a=a.clone();a.transform(this.internalProjection,this.externalProjection)}var d=a.CLASS_NAME.split(".")[2];var c=this.extract[d.toLowerCase()].apply(this,[a]);var b;if(d=="Collection"){b={"type":"GeometryCollection","geometries":c}}else{b={"type":d,"coordinates":c}}return b},"point":function(a){return[a.x,a.y]},"multipoint":function(d){var b=[];for(var c=0,a=d.components.length;c<a;++c){b.push(this.extract.point.apply(this,[d.components[c]]))}return b},"linestring":function(d){var b=[];for(var c=0,a=d.components.length;c<a;++c){b.push(this.extract.point.apply(this,[d.components[c]]))}return b},"multilinestring":function(d){var c=[];for(var b=0,a=d.components.length;b<a;++b){c.push(this.extract.linestring.apply(this,[d.components[b]]))}return c},"polygon":function(c){var d=[];for(var b=0,a=c.components.length;b<a;++b){d.push(this.extract.linestring.apply(this,[c.components[b]]))}return d},"multipolygon":function(b){var d=[];for(var c=0,a=b.components.length;c<a;++c){d.push(this.extract.polygon.apply(this,[b.components[c]]))}return d},"collection":function(a){var c=a.components.length;var d=new Array(c);for(var b=0;b<c;++b){d[b]=this.extract.geometry.apply(this,[a.components[b]])}return d}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(c){var a=new OpenLayers.Format.ArcXML();var b=a.read(c);return b.features.feature}});if(!OpenLayers.Format.GML){OpenLayers.Format.GML={}}OpenLayers.Format.GML.Base=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs"},defaultPrefix:"gml",schemaLocation:null,featureType:null,featureNS:null,geometryName:"geometry",extractAttributes:true,srsName:null,xy:true,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.setGeometryTypes();if(a&&a.featureNS){this.setNamespace("feature",a.featureNS)}this.singleFeatureType=!a||(typeof a.featureType==="string")},read:function(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}if(e&&e.nodeType==9){e=e.documentElement}var b=[];this.readNode(e,{features:b});if(b.length==0){var c=this.getElementsByTagNameNS(e,this.namespaces.gml,"featureMember");if(c.length){for(var d=0,a=c.length;d<a;++d){this.readNode(c[d],{features:b})}}else{var c=this.getElementsByTagNameNS(e,this.namespaces.gml,"featureMembers");if(c.length){this.readNode(c[0],{features:b})}}}return b},readers:{"gml":{"featureMember":function(b,a){this.readChildNodes(b,a)},"featureMembers":function(b,a){this.readChildNodes(b,a)},"name":function(b,a){a.name=this.getChildValue(b)},"boundedBy":function(c,a){var b={};this.readChildNodes(c,b);if(b.components&&b.components.length>0){a.bounds=b.components[0]}},"Point":function(c,b){var a={points:[]};this.readChildNodes(c,a);if(!b.components){b.components=[]}b.components.push(a.points[0])},"coordinates":function(b,e){var h=this.getChildValue(b).replace(this.regExes.trimSpace,"");h=h.replace(this.regExes.trimComma,",");var c=h.split(this.regExes.splitSpace);var f;var a=c.length;var d=new Array(a);for(var g=0;g<a;++g){f=c[g].split(",");if(this.xy){d[g]=new OpenLayers.Geometry.Point(f[0],f[1],f[2])}else{d[g]=new OpenLayers.Geometry.Point(f[1],f[0],f[2])}}e.points=d},"coord":function(c,a){var b={};this.readChildNodes(c,b);if(!a.points){a.points=[]}a.points.push(new OpenLayers.Geometry.Point(b.x,b.y,b.z))},"X":function(b,a){a.x=this.getChildValue(b)},"Y":function(b,a){a.y=this.getChildValue(b)},"Z":function(b,a){a.z=this.getChildValue(b)},"MultiPoint":function(c,b){var a={components:[]};this.readChildNodes(c,a);b.components=[new OpenLayers.Geometry.MultiPoint(a.components)]},"pointMember":function(b,a){this.readChildNodes(b,a)},"LineString":function(c,b){var a={};this.readChildNodes(c,a);if(!b.components){b.components=[]}b.components.push(new OpenLayers.Geometry.LineString(a.points))},"MultiLineString":function(c,b){var a={components:[]};this.readChildNodes(c,a);b.components=[new OpenLayers.Geometry.MultiLineString(a.components)]},"lineStringMember":function(b,a){this.readChildNodes(b,a)},"Polygon":function(c,b){var a={outer:null,inner:[]};this.readChildNodes(c,a);a.inner.unshift(a.outer);if(!b.components){b.components=[]}b.components.push(new OpenLayers.Geometry.Polygon(a.inner))},"LinearRing":function(c,a){var b={};this.readChildNodes(c,b);a.components=[new OpenLayers.Geometry.LinearRing(b.points)]},"MultiPolygon":function(c,b){var a={components:[]};this.readChildNodes(c,a);b.components=[new OpenLayers.Geometry.MultiPolygon(a.components)]},"polygonMember":function(b,a){this.readChildNodes(b,a)},"GeometryCollection":function(c,b){var a={components:[]};this.readChildNodes(c,a);b.components=[new OpenLayers.Geometry.Collection(a.components)]},"geometryMember":function(b,a){this.readChildNodes(b,a)}},"feature":{"*":function(d,b){var c;var a=d.localName||d.nodeName.split(":").pop();if(!this.singleFeatureType&&(OpenLayers.Util.indexOf(this.featureType,a)!=-1)){c="_typeName"}else{if(a==this.featureType){c="_typeName"}else{if(d.childNodes.length==0||(d.childNodes.length==1&&d.firstChild.nodeType==3)){if(this.extractAttributes){c="_attribute"}}else{c="_geometry"}}}if(c){this.readers.feature[c].apply(this,[d,b])}},"_typeName":function(e,a){var b={components:[],attributes:{}};this.readChildNodes(e,b);if(b.name){b.attributes.name=b.name}var c=new OpenLayers.Feature.Vector(b.components[0],b.attributes);if(!this.singleFeatureType){c.type=e.nodeName.split(":").pop();c.namespace=e.namespaceURI}var d=e.getAttribute("fid")||this.getAttributeNS(e,this.namespaces["gml"],"id");if(d){c.fid=d}if(this.internalProjection&&this.externalProjection&&c.geometry){c.geometry.transform(this.externalProjection,this.internalProjection)}if(b.bounds){c.geometry.bounds=b.bounds}a.features.push(c)},"_geometry":function(b,a){this.readChildNodes(b,a)},"_attribute":function(d,b){var a=d.localName||d.nodeName.split(":").pop();var c=this.getChildValue(d);b.attributes[a]=c}},"wfs":{"FeatureCollection":function(b,a){this.readChildNodes(b,a)}}},write:function(c){var a;if(c instanceof Array){a="featureMembers"}else{a="featureMember"}var b=this.writeNode("gml:"+a,c);this.setAttributeNS(b,this.namespaces["xsi"],"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},writers:{"gml":{"featureMember":function(a){var b=this.createElementNSPlus("gml:featureMember");this.writeNode("feature:_typeName",a,b);return b},"MultiPoint":function(a){var c=this.createElementNSPlus("gml:MultiPoint");for(var b=0;b<a.components.length;++b){this.writeNode("pointMember",a.components[b],c)}return c},"pointMember":function(a){var b=this.createElementNSPlus("gml:pointMember");this.writeNode("Point",a,b);return b},"MultiLineString":function(a){var c=this.createElementNSPlus("gml:MultiLineString");for(var b=0;b<a.components.length;++b){this.writeNode("lineStringMember",a.components[b],c)}return c},"lineStringMember":function(a){var b=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",a,b);return b},"MultiPolygon":function(a){var c=this.createElementNSPlus("gml:MultiPolygon");for(var b=0;b<a.components.length;++b){this.writeNode("polygonMember",a.components[b],c)}return c},"polygonMember":function(a){var b=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",a,b);return b},"GeometryCollection":function(b){var d=this.createElementNSPlus("gml:GeometryCollection");for(var c=0,a=b.components.length;c<a;++c){this.writeNode("geometryMember",b.components[c],d)}return d},"geometryMember":function(a){var c=this.createElementNSPlus("gml:geometryMember");var b=this.writeNode("feature:_geometry",a);c.appendChild(b.firstChild);return c}},"feature":{"_typeName":function(b){var d=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:b.fid}});if(b.geometry){this.writeNode("feature:_geometry",b.geometry,d)}for(var a in b.attributes){var c=b.attributes[a];if(c!=null){this.writeNode("feature:_attribute",{name:a,value:c},d)}}return d},"_geometry":function(a){if(this.externalProjection&&this.internalProjection){a=a.clone().transform(this.internalProjection,this.externalProjection)}var d=this.createElementNSPlus("feature:"+this.geometryName);var c=this.geometryTypes[a.CLASS_NAME];var b=this.writeNode("gml:"+c,a,d);if(this.srsName){b.setAttribute("srsName",this.srsName)}return d},"_attribute":function(a){return this.createElementNSPlus("feature:"+a.name,{value:a.value})}},"wfs":{"FeatureCollection":function(d){var c=this.createElementNSPlus("wfs:FeatureCollection");for(var b=0,a=d.length;b<a;++b){this.writeNode("gml:featureMember",d[b],c)}return c}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"});OpenLayers.Format.WFS=OpenLayers.Class(OpenLayers.Format.GML,{layer:null,wfsns:"http://www.opengis.net/wfs",ogcns:"http://www.opengis.net/ogc",initialize:function(b,a){OpenLayers.Format.GML.prototype.initialize.apply(this,[b]);this.layer=a;if(this.layer.featureNS){this.featureNS=this.layer.featureNS}if(this.layer.options.geometry_column){this.geometryName=this.layer.options.geometry_column}if(this.layer.options.typename){this.featureName=this.layer.options.typename}},write:function(c){var a=this.createElementNS(this.wfsns,"wfs:Transaction");a.setAttribute("version","1.0.0");a.setAttribute("service","WFS");for(var b=0;b<c.length;b++){switch(c[b].state){case OpenLayers.State.INSERT:a.appendChild(this.insert(c[b]));break;case OpenLayers.State.UPDATE:a.appendChild(this.update(c[b]));break;case OpenLayers.State.DELETE:a.appendChild(this.remove(c[b]));break}}return OpenLayers.Format.XML.prototype.write.apply(this,[a])},createFeatureXML:function(g){var c=this.buildGeometryNode(g.geometry);var a=this.createElementNS(this.featureNS,"feature:"+this.geometryName);a.appendChild(c);var h=this.createElementNS(this.featureNS,"feature:"+this.featureName);h.appendChild(a);for(var b in g.attributes){var d=this.createTextNode(g.attributes[b]);var e=b;if(b.search(":")!=-1){e=b.split(":")[1]}var f=this.createElementNS(this.featureNS,"feature:"+e);f.appendChild(d);h.appendChild(f)}return h},insert:function(b){var a=this.createElementNS(this.wfsns,"wfs:Insert");a.appendChild(this.createFeatureXML(b));return a},update:function(b){if(!b.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"))}var c=this.createElementNS(this.wfsns,"wfs:Update");c.setAttribute("typeName",this.featurePrefix+":"+this.featureName);c.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var j=this.createElementNS(this.wfsns,"wfs:Property");var g=this.createElementNS(this.wfsns,"wfs:Name");var a=this.createTextNode(this.geometryName);g.appendChild(a);j.appendChild(g);var d=this.createElementNS(this.wfsns,"wfs:Value");var i=this.buildGeometryNode(b.geometry);if(b.layer){i.setAttribute("srsName",b.layer.projection.getCode())}d.appendChild(i);j.appendChild(d);c.appendChild(j);for(var h in b.attributes){j=this.createElementNS(this.wfsns,"wfs:Property");g=this.createElementNS(this.wfsns,"wfs:Name");g.appendChild(this.createTextNode(h));j.appendChild(g);d=this.createElementNS(this.wfsns,"wfs:Value");d.appendChild(this.createTextNode(b.attributes[h]));j.appendChild(d);c.appendChild(j)}var e=this.createElementNS(this.ogcns,"ogc:Filter");var f=this.createElementNS(this.ogcns,"ogc:FeatureId");f.setAttribute("fid",b.fid);e.appendChild(f);c.appendChild(e);return c},remove:function(a){if(!a.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"));return false}var c=this.createElementNS(this.wfsns,"wfs:Delete");c.setAttribute("typeName",this.featurePrefix+":"+this.featureName);c.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var b=this.createElementNS(this.ogcns,"ogc:Filter");var d=this.createElementNS(this.ogcns,"ogc:FeatureId");d.setAttribute("fid",a.fid);b.appendChild(d);c.appendChild(b);return c},destroy:function(){this.layer=null},CLASS_NAME:"OpenLayers.Format.WFS"});OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},tileSize:null,featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:true,name:"ArcIMS",isBaseLayer:true,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:true,async:true,name:"ArcIMS"},initialize:function(a,b,c){this.tileSize=new OpenLayers.Size(512,512);this.params=OpenLayers.Util.applyDefaults({ServiceName:c.serviceName},this.DEFAULT_PARAMS);this.options=OpenLayers.Util.applyDefaults(c,this.DEFAULT_OPTIONS);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a,b,this.params,c]);if(this.transparent){if(!this.isBaseLayer){this.isBaseLayer=false}if(this.format=="image/jpeg"){this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}if(this.options.layers===null){this.options.layers=[]}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},getURL:function(b){var e="";b=this.adjustBounds(b);var f=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:b.toArray(),tileSize:this.tileSize}));var c=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:f.write(),async:false});if(c!=null){var d=c.responseXML;if(!d||!d.documentElement){d=c.responseText}var g=new OpenLayers.Format.ArcXML();var a=g.read(d);e=this.getUrlOrImage(a.image.output)}return e},getURLasync:function(a,e,c,b){a=this.adjustBounds(a);var d=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:a.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(),async:true,data:d.write(),callback:function(g){var f=g.responseXML;if(!f||!f.documentElement){f=g.responseText}var i=new OpenLayers.Format.ArcXML();var h=i.read(f);e[c]=this.getUrlOrImage(h.image.output);b.apply(e)},scope:this})},getUrlOrImage:function(a){var b="";if(a.url){b=a.url}else{if(a.data){b="data:image/"+a.type+";base64,"+a.data}}return b},setLayerQuery:function(c,a){for(var b=0;b<this.options.layers.length;b++){if(c==this.options.layers[b].id){this.options.layers[b].query=a;return}}this.options.layers.push({id:c,visible:true,query:a})},getFeatureInfo:function(j,c,a){var d=a.buffer||1;var k=a.callback||function(){};var e=a.scope||window;var h={};OpenLayers.Util.extend(h,this.options);h.requesttype="feature";if(j instanceof OpenLayers.LonLat){h.polygon=null;h.envelope=[j.lon-d,j.lat-d,j.lon+d,j.lat+d]}else{if(j instanceof OpenLayers.Geometry.Polygon){h.envelope=null;h.polygon=j}}var f=new OpenLayers.Format.ArcXML(h);OpenLayers.Util.extend(f.request.get_feature,a);f.request.get_feature.layer=c.id;if(typeof c.query.accuracy=="number"){f.request.get_feature.query.accuracy=c.query.accuracy}else{var i=this.map.getCenter();var g=this.map.getViewPortPxFromLonLat(i);g.x++;var b=this.map.getLonLatFromPixel(g);f.request.get_feature.query.accuracy=b.lon-i.lon}f.request.get_feature.query.where=c.query.where;f.request.get_feature.query.spatialfilter.relation="area_intersection";OpenLayers.Request.POST({url:this.getFullRequestString({"CustomService":"Query"}),data:f.write(),callback:function(m){var l=f.parseResponse(m.responseText);if(!f.iserror()){k.call(e,l.features)}else{k.call(e,null)}}})},addTile:function(a,b){return new OpenLayers.Tile.Image(this,b,a,null,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.ArcIMS"});OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",initialize:function(a){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[a])},readers:{"gml":OpenLayers.Util.applyDefaults({"outerBoundaryIs":function(c,b){var a={};this.readChildNodes(c,a);b.outer=a.components[0]},"innerBoundaryIs":function(c,b){var a={};this.readChildNodes(c,a);b.inner.push(a.components[0])},"Box":function(e,b){var a={};this.readChildNodes(e,a);if(!b.components){b.components=[]}var c=a.points[0];var d=a.points[1];b.components.push(new OpenLayers.Bounds(c.x,c.y,d.x,d.y))}},OpenLayers.Format.GML.Base.prototype.readers["gml"]),"feature":OpenLayers.Format.GML.Base.prototype.readers["feature"],"wfs":OpenLayers.Format.GML.Base.prototype.readers["wfs"]},write:function(c){var a;if(c instanceof Array){a="wfs:FeatureCollection"}else{a="gml:featureMember"}var b=this.writeNode(a,c);this.setAttributeNS(b,this.namespaces["xsi"],"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},writers:{"gml":OpenLayers.Util.applyDefaults({"Point":function(a){var b=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[a],b);return b},"coordinates":function(c){var b=c.length;var d=new Array(b);var e;for(var a=0;a<b;++a){e=c[a];if(this.xy){d[a]=e.x+","+e.y}else{d[a]=e.y+","+e.x}if(e.z!=undefined){d[a]+=","+e.z}}return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:(b==1)?d[0]:d.join(" ")})},"LineString":function(a){var b=this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",a.components,b);return b},"Polygon":function(a){var c=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",a.components[0],c);for(var b=1;b<a.components.length;++b){this.writeNode("innerBoundaryIs",a.components[b],c)}return c},"outerBoundaryIs":function(b){var a=this.createElementNSPlus("gml:outerBoundaryIs");this.writeNode("LinearRing",b,a);return a},"innerBoundaryIs":function(b){var a=this.createElementNSPlus("gml:innerBoundaryIs");this.writeNode("LinearRing",b,a);return a},"LinearRing":function(b){var a=this.createElementNSPlus("gml:LinearRing");this.writeNode("coordinates",b.components,a);return a},"Box":function(a){var b=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:a.left,y:a.bottom},{x:a.right,y:a.top}],b);if(this.srsName){b.setAttribute("srsName",this.srsName)}return b}},OpenLayers.Format.GML.Base.prototype.writers["gml"]),"feature":OpenLayers.Format.GML.Base.prototype.writers["feature"],"wfs":OpenLayers.Format.GML.Base.prototype.writers["wfs"]},CLASS_NAME:"OpenLayers.Format.GML.v2"});OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:false,multiCurve:true,surface:false,multiSurface:true,initialize:function(a){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[a])},readers:{"gml":OpenLayers.Util.applyDefaults({"featureMembers":function(b,a){this.readChildNodes(b,a)},"Curve":function(c,b){var a={points:[]};this.readChildNodes(c,a);if(!b.components){b.components=[]}b.components.push(new OpenLayers.Geometry.LineString(a.points))},"segments":function(b,a){this.readChildNodes(b,a)},"LineStringSegment":function(c,b){var a={};this.readChildNodes(c,a);if(a.points){Array.prototype.push.apply(b.points,a.points)}},"pos":function(e,a){var d=this.getChildValue(e).replace(this.regExes.trimSpace,"");var b=d.split(this.regExes.splitSpace);var c;if(this.xy){c=new OpenLayers.Geometry.Point(b[0],b[1],b[2])}else{c=new OpenLayers.Geometry.Point(b[1],b[0],b[2])}a.points=[c]},"posList":function(b,a){var k=this.getChildValue(b).replace(this.regExes.trimSpace,"");var m=k.split(this.regExes.splitSpace);var l=parseInt(b.getAttribute("dimension"))||2;var p,f,g,h;var d=m.length/l;var e=new Array(d);for(var o=0,c=m.length;o<c;o+=l){f=m[o];g=m[o+1];h=(l==2)?undefined:m[o+2];if(this.xy){e[o/l]=new OpenLayers.Geometry.Point(f,g,h)}else{e[o/l]=new OpenLayers.Geometry.Point(g,f,h)}}a.points=e},"Surface":function(b,a){this.readChildNodes(b,a)},"patches":function(b,a){this.readChildNodes(b,a)},"PolygonPatch":function(b,a){this.readers.gml.Polygon.apply(this,[b,a])},"exterior":function(c,b){var a={};this.readChildNodes(c,a);b.outer=a.components[0]},"interior":function(c,b){var a={};this.readChildNodes(c,a);b.inner.push(a.components[0])},"MultiCurve":function(c,b){var a={components:[]};this.readChildNodes(c,a);if(a.components.length>0){b.components=[new OpenLayers.Geometry.MultiLineString(a.components)]}},"curveMember":function(b,a){this.readChildNodes(b,a)},"MultiSurface":function(c,b){var a={components:[]};this.readChildNodes(c,a);if(a.components.length>0){b.components=[new OpenLayers.Geometry.MultiPolygon(a.components)]}},"surfaceMember":function(b,a){this.readChildNodes(b,a)},"surfaceMembers":function(b,a){this.readChildNodes(b,a)},"pointMembers":function(b,a){this.readChildNodes(b,a)},"lineStringMembers":function(b,a){this.readChildNodes(b,a)},"polygonMembers":function(b,a){this.readChildNodes(b,a)},"geometryMembers":function(b,a){this.readChildNodes(b,a)},"Envelope":function(e,b){var a={points:new Array(2)};this.readChildNodes(e,a);if(!b.components){b.components=[]}var c=a.points[0];var d=a.points[1];b.components.push(new OpenLayers.Bounds(c.x,c.y,d.x,d.y))},"lowerCorner":function(c,b){var a={};this.readers.gml.pos.apply(this,[c,a]);b.points[0]=a.points[0]},"upperCorner":function(c,b){var a={};this.readers.gml.pos.apply(this,[c,a]);b.points[1]=a.points[0]}},OpenLayers.Format.GML.Base.prototype.readers["gml"]),"feature":OpenLayers.Format.GML.Base.prototype.readers["feature"],"wfs":OpenLayers.Format.GML.Base.prototype.readers["wfs"]},write:function(c){var a;if(c instanceof Array){a="featureMembers"}else{a="featureMember"}var b=this.writeNode("gml:"+a,c);this.setAttributeNS(b,this.namespaces["xsi"],"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},writers:{"gml":OpenLayers.Util.applyDefaults({"featureMembers":function(d){var c=this.createElementNSPlus("gml:featureMembers");for(var b=0,a=d.length;b<a;++b){this.writeNode("feature:_typeName",d[b],c)}return c},"Point":function(a){var b=this.createElementNSPlus("gml:Point");this.writeNode("pos",a,b);return b},"pos":function(b){var a=(this.xy)?(b.x+" "+b.y):(b.y+" "+b.x);return this.createElementNSPlus("gml:pos",{value:a})},"LineString":function(a){var b=this.createElementNSPlus("gml:LineString");this.writeNode("posList",a.components,b);return b},"Curve":function(a){var b=this.createElementNSPlus("gml:Curve");this.writeNode("segments",a,b);return b},"segments":function(a){var b=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",a,b);return b},"LineStringSegment":function(a){var b=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",a.components,b);return b},"posList":function(c){var a=c.length;var d=new Array(a);var e;for(var b=0;b<a;++b){e=c[b];if(this.xy){d[b]=e.x+" "+e.y}else{d[b]=e.y+" "+e.x}}return this.createElementNSPlus("gml:posList",{value:d.join(" ")})},"Surface":function(a){var b=this.createElementNSPlus("gml:Surface");this.writeNode("patches",a,b);return b},"patches":function(a){var b=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",a,b);return b},"PolygonPatch":function(b){var d=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",b.components[0],d);for(var c=1,a=b.components.length;c<a;++c){this.writeNode("interior",b.components[c],d)}return d},"Polygon":function(b){var d=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",b.components[0],d);for(var c=1,a=b.components.length;c<a;++c){this.writeNode("interior",b.components[c],d)}return d},"exterior":function(b){var a=this.createElementNSPlus("gml:exterior");this.writeNode("LinearRing",b,a);return a},"interior":function(b){var a=this.createElementNSPlus("gml:interior");this.writeNode("LinearRing",b,a);return a},"LinearRing":function(b){var a=this.createElementNSPlus("gml:LinearRing");this.writeNode("posList",b.components,a);return a},"MultiCurve":function(b){var d=this.createElementNSPlus("gml:MultiCurve");for(var c=0,a=b.components.length;c<a;++c){this.writeNode("curveMember",b.components[c],d)}return d},"curveMember":function(a){var b=this.createElementNSPlus("gml:curveMember");if(this.curve){this.writeNode("Curve",a,b)}else{this.writeNode("LineString",a,b)}return b},"MultiSurface":function(b){var d=this.createElementNSPlus("gml:MultiSurface");for(var c=0,a=b.components.length;c<a;++c){this.writeNode("surfaceMember",b.components[c],d)}return d},"surfaceMember":function(a){var b=this.createElementNSPlus("gml:surfaceMember");if(this.surface){this.writeNode("Surface",a,b)}else{this.writeNode("Polygon",a,b)}return b},"Envelope":function(a){var b=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",a,b);this.writeNode("upperCorner",a,b);if(this.srsName){b.setAttribute("srsName",this.srsName)}return b},"lowerCorner":function(a){var b=(this.xy)?(a.left+" "+a.bottom):(a.bottom+" "+a.left);return this.createElementNSPlus("gml:lowerCorner",{value:b})},"upperCorner":function(a){var b=(this.xy)?(a.right+" "+a.top):(a.top+" "+a.right);return this.createElementNSPlus("gml:upperCorner",{value:b})}},OpenLayers.Format.GML.Base.prototype.writers["gml"]),"feature":OpenLayers.Format.GML.Base.prototype.writers["feature"],"wfs":OpenLayers.Format.GML.Base.prototype.writers["wfs"]},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":(this.curve===true)?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":(this.multiCurve===false)?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":(this.surface===true)?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":(this.multiSurface===false)?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"});OpenLayers.Format.Filter.v1_0_0=OpenLayers.Class(OpenLayers.Format.GML.v2,OpenLayers.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(a){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[a])},readers:{"ogc":OpenLayers.Util.applyDefaults({"PropertyIsEqualTo":function(c,a){var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(c,b);a.filters.push(b)},"PropertyIsNotEqualTo":function(c,a){var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(c,b);a.filters.push(b)}},OpenLayers.Format.Filter.v1.prototype.readers["ogc"]),"gml":OpenLayers.Format.GML.v2.prototype.readers["gml"],"feature":OpenLayers.Format.GML.v2.prototype.readers["feature"]},writers:{"ogc":OpenLayers.Util.applyDefaults({"PropertyIsEqualTo":function(a){var b=this.createElementNSPlus("ogc:PropertyIsEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"PropertyIsNotEqualTo":function(a){var b=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"BBOX":function(b){var c=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",b,c);var a=this.writeNode("gml:Box",b.value,c);if(b.projection){a.setAttribute("srsName",b.projection)}return c}},OpenLayers.Format.Filter.v1.prototype.writers["ogc"]),"gml":OpenLayers.Format.GML.v2.prototype.writers["gml"],"feature":OpenLayers.Format.GML.v2.prototype.writers["feature"]},writeSpatial:function(c,a){var d=this.createElementNSPlus("ogc:"+a);this.writeNode("PropertyName",c,d);var b;if(c.value instanceof OpenLayers.Geometry){b=this.writeNode("feature:_geometry",c.value).firstChild}else{b=this.writeNode("gml:Box",c.value)}if(c.projection){b.setAttribute("srsName",c.projection)}d.appendChild(b);return d},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"});OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(a){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[a])},readers:{"ogc":OpenLayers.Util.applyDefaults({"PropertyIsEqualTo":function(d,a){var c=d.getAttribute("matchCase");var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!(c==="false"||c==="0")});this.readChildNodes(d,b);a.filters.push(b)},"PropertyIsNotEqualTo":function(d,a){var c=d.getAttribute("matchCase");var b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!(c==="false"||c==="0")});this.readChildNodes(d,b);a.filters.push(b)}},OpenLayers.Format.Filter.v1.prototype.readers["ogc"]),"gml":OpenLayers.Format.GML.v3.prototype.readers["gml"],"feature":OpenLayers.Format.GML.v3.prototype.readers["feature"]},writers:{"ogc":OpenLayers.Util.applyDefaults({"PropertyIsEqualTo":function(a){var b=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:a.matchCase}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"PropertyIsNotEqualTo":function(a){var b=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:a.matchCase}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},"BBOX":function(b){var c=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",b,c);var a=this.writeNode("gml:Envelope",b.value);if(b.projection){a.setAttribute("srsName",b.projection)}c.appendChild(a);return c}},OpenLayers.Format.Filter.v1.prototype.writers["ogc"]),"gml":OpenLayers.Format.GML.v3.prototype.writers["gml"],"feature":OpenLayers.Format.GML.v3.prototype.writers["feature"]},writeSpatial:function(c,a){var d=this.createElementNSPlus("ogc:"+a);this.writeNode("PropertyName",c,d);var b;if(c.value instanceof OpenLayers.Geometry){b=this.writeNode("feature:_geometry",c.value).firstChild}else{b=this.writeNode("gml:Envelope",c.value)}if(c.projection){b.setAttribute("srsName",c.projection)}d.appendChild(b);return d},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"});OpenLayers.Format.SLD.v1=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,{namespaces:{sld:"http://www.opengis.net/sld",ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"sld",schemaLocation:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,graphicName:"square"},initialize:function(a){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[a])},read:function(c,b){b=OpenLayers.Util.applyDefaults(b,this.options);var a={namedLayers:b.namedLayersAsArray===true?[]:{}};this.readChildNodes(c,a);return a},readers:OpenLayers.Util.applyDefaults({"sld":{"StyledLayerDescriptor":function(b,a){a.version=b.getAttribute("version");this.readChildNodes(b,a)},"Name":function(b,a){a.name=this.getChildValue(b)},"Title":function(b,a){a.title=this.getChildValue(b)},"Abstract":function(b,a){a.description=this.getChildValue(b)},"NamedLayer":function(e,b){var a={userStyles:[],namedStyles:[]};this.readChildNodes(e,a);for(var d=0,c=a.userStyles.length;d<c;++d){a.userStyles[d].layerName=a.name}if(b.namedLayers instanceof Array){b.namedLayers.push(a)}else{b.namedLayers[a.name]=a}},"NamedStyle":function(b,a){a.namedStyles.push(this.getChildName(b.firstChild))},"UserStyle":function(d,a){var b={defaultsPerSymbolizer:true,rules:[]};this.readChildNodes(d,b);var c=new OpenLayers.Style(this.defaultSymbolizer,b);a.userStyles.push(c)},"IsDefault":function(b,a){if(this.getChildValue(b)=="1"){a.isDefault=true}},"FeatureTypeStyle":function(c,b){var a={rules:[]};this.readChildNodes(c,a);b.rules=a.rules},"Rule":function(c,a){var b=new OpenLayers.Rule();this.readChildNodes(c,b);a.rules.push(b)},"ElseFilter":function(b,a){a.elseFilter=true},"MinScaleDenominator":function(b,a){a.minScaleDenominator=parseFloat(this.getChildValue(b))},"MaxScaleDenominator":function(b,a){a.maxScaleDenominator=parseFloat(this.getChildValue(b))},"TextSymbolizer":function(c,b){var a=b.symbolizer["Text"]||{};this.readChildNodes(c,a);b.symbolizer["Text"]=a},"Label":function(d,a){var b={};this.readChildNodes(d,b);if(b.property){a.label="${"+b.property+"}"}else{var c=this.readOgcExpression(d);if(c){a.label=c}}},"Font":function(b,a){this.readChildNodes(b,a)},"Halo":function(c,a){var b={};this.readChildNodes(c,b);a.haloRadius=b.haloRadius;a.haloColor=b.fillColor;a.haloOpacity=b.fillOpacity},"Radius":function(c,b){var a=this.readOgcExpression(c);if(a!=null){b.haloRadius=a}},"LineSymbolizer":function(c,b){var a=b.symbolizer["Line"]||{};this.readChildNodes(c,a);b.symbolizer["Line"]=a},"PolygonSymbolizer":function(c,b){var a=b.symbolizer["Polygon"]||{};this.readChildNodes(c,a);b.symbolizer["Polygon"]=a},"PointSymbolizer":function(c,b){var a=b.symbolizer["Point"]||{};this.readChildNodes(c,a);b.symbolizer["Point"]=a},"Stroke":function(b,a){a.stroke=true;this.readChildNodes(b,a)},"Fill":function(b,a){a.fill=true;this.readChildNodes(b,a)},"CssParameter":function(e,a){var b=e.getAttribute("name");var c=this.cssMap[b];if(c){var d=this.readOgcExpression(e);if(d){a[c]=d}}},"Graphic":function(b,d){d.graphic=true;var f={};this.readChildNodes(b,f);var h=["strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fillColor","fillOpacity","graphicName","rotation","graphicFormat"];var c,e;for(var a=0,g=h.length;a<g;++a){c=h[a];e=f[c];if(e!=undefined){d[c]=e}}if(f.opacity!=undefined){d.graphicOpacity=f.opacity}if(f.size!=undefined){d.pointRadius=f.size/2}if(f.href!=undefined){d.externalGraphic=f.href}if(f.rotation!=undefined){d.rotation=f.rotation}},"ExternalGraphic":function(b,a){this.readChildNodes(b,a)},"Mark":function(b,a){this.readChildNodes(b,a)},"WellKnownName":function(b,a){a.graphicName=this.getChildValue(b)},"Opacity":function(c,a){var b=this.readOgcExpression(c);if(b){a.opacity=b}},"Size":function(c,b){var a=this.readOgcExpression(c);if(a){b.size=a}},"Rotation":function(c,a){var b=this.readOgcExpression(c);if(b){a.rotation=b}},"OnlineResource":function(b,a){a.href=this.getAttributeNS(b,this.namespaces.xlink,"href")},"Format":function(b,a){a.graphicFormat=this.getChildValue(b)}}},OpenLayers.Format.Filter.v1_0_0.prototype.readers),cssMap:{"stroke":"strokeColor","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-dasharray":"strokeDashstyle","fill":"fillColor","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","font-weight":"fontWeight","font-style":"fontStyle"},getCssProperty:function(a){var b=null;for(var c in this.cssMap){if(this.cssMap[c]==a){b=c;break}}return b},getGraphicFormat:function(d){var a,b;for(var c in this.graphicFormats){if(this.graphicFormats[c].test(d)){a=c;break}}return a||this.defautlGraphicFormat},defaultGraphicFormat:"image/png",graphicFormats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(a){return this.writers.sld.StyledLayerDescriptor.apply(this,[a])},writers:OpenLayers.Util.applyDefaults({"sld":{"StyledLayerDescriptor":function(c){var d=this.createElementNSPlus("StyledLayerDescriptor",{attributes:{"version":this.VERSION,"xsi:schemaLocation":this.schemaLocation}});if(c.name){this.writeNode("Name",c.name,d)}if(c.title){this.writeNode("Title",c.title,d)}if(c.description){this.writeNode("Abstract",c.description,d)}if(c.namedLayers instanceof Array){for(var e=0,a=c.namedLayers.length;e<a;++e){this.writeNode("NamedLayer",c.namedLayers[e],d)}}else{for(var b in c.namedLayers){this.writeNode("NamedLayer",c.namedLayers[b],d)}}return d},"Name":function(a){return this.createElementNSPlus("Name",{value:a})},"Title":function(a){return this.createElementNSPlus("Title",{value:a})},"Abstract":function(a){return this.createElementNSPlus("Abstract",{value:a})},"NamedLayer":function(a){var d=this.createElementNSPlus("NamedLayer");this.writeNode("Name",a.name,d);if(a.namedStyles){for(var c=0,b=a.namedStyles.length;c<b;++c){this.writeNode("NamedStyle",a.namedStyles[c],d)}}if(a.userStyles){for(var c=0,b=a.userStyles.length;c<b;++c){this.writeNode("UserStyle",a.userStyles[c],d)}}return d},"NamedStyle":function(a){var b=this.createElementNSPlus("NamedStyle");this.writeNode("Name",a,b);return b},"UserStyle":function(a){var b=this.createElementNSPlus("UserStyle");if(a.name){this.writeNode("Name",a.name,b)}if(a.title){this.writeNode("Title",a.title,b)}if(a.description){this.writeNode("Abstract",a.description,b)}if(a.isDefault){this.writeNode("IsDefault",a.isDefault,b)}this.writeNode("FeatureTypeStyle",a,b);return b},"IsDefault":function(a){return this.createElementNSPlus("IsDefault",{value:(a)?"1":"0"})},"FeatureTypeStyle":function(b){var d=this.createElementNSPlus("FeatureTypeStyle");for(var c=0,a=b.rules.length;c<a;++c){this.writeNode("Rule",b.rules[c],d)}return d},"Rule":function(f){var g=this.createElementNSPlus("Rule");if(f.name){this.writeNode("Name",f.name,g)}if(f.title){this.writeNode("Title",f.title,g)}if(f.description){this.writeNode("Abstract",f.description,g)}if(f.elseFilter){this.writeNode("ElseFilter",null,g)}else{if(f.filter){this.writeNode("ogc:Filter",f.filter,g)}}if(f.minScaleDenominator!=undefined){this.writeNode("MinScaleDenominator",f.minScaleDenominator,g)}if(f.maxScaleDenominator!=undefined){this.writeNode("MaxScaleDenominator",f.maxScaleDenominator,g)}var d=OpenLayers.Style.SYMBOLIZER_PREFIXES;var c,b;for(var e=0,a=d.length;e<a;++e){c=d[e];b=f.symbolizer[c];if(b){this.writeNode(c+"Symbolizer",b,g)}}return g},"ElseFilter":function(){return this.createElementNSPlus("ElseFilter")},"MinScaleDenominator":function(a){return this.createElementNSPlus("MinScaleDenominator",{value:a})},"MaxScaleDenominator":function(a){return this.createElementNSPlus("MaxScaleDenominator",{value:a})},"LineSymbolizer":function(a){var b=this.createElementNSPlus("LineSymbolizer");this.writeNode("Stroke",a,b);return b},"Stroke":function(a){var b=this.createElementNSPlus("Stroke");if(a.strokeColor!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeColor"},b)}if(a.strokeOpacity!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeOpacity"},b)}if(a.strokeWidth!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeWidth"},b)}return b},"CssParameter":function(a){return this.createElementNSPlus("CssParameter",{attributes:{name:this.getCssProperty(a.key)},value:a.symbolizer[a.key]})},"TextSymbolizer":function(a){var b=this.createElementNSPlus("TextSymbolizer");if(a.label!=null){this.writeNode("Label",a.label,b)}if(a.fontFamily!=null||a.fontSize!=null||a.fontWeight!=null||a.fontStyle!=null){this.writeNode("Font",a,b)}if(a.haloRadius!=null||a.haloColor!=null||a.haloOpacity!=null){this.writeNode("Halo",a,b)}if(a.fillColor!=null||a.fillOpacity!=null){this.writeNode("Fill",a,b)}return b},"Font":function(a){var b=this.createElementNSPlus("Font");if(a.fontFamily){this.writeNode("CssParameter",{symbolizer:a,key:"fontFamily"},b)}if(a.fontSize){this.writeNode("CssParameter",{symbolizer:a,key:"fontSize"},b)}if(a.fontWeight){this.writeNode("CssParameter",{symbolizer:a,key:"fontWeight"},b)}if(a.fontStyle){this.writeNode("CssParameter",{symbolizer:a,key:"fontStyle"},b)}return b},"Label":function(b){var g=this.createElementNSPlus("Label");var d=b.split("${");g.appendChild(this.createTextNode(d[0]));var f,c;for(var e=1,a=d.length;e<a;e++){f=d[e];c=f.indexOf("}");if(c>0){this.writeNode("ogc:PropertyName",{property:f.substring(0,c)},g);g.appendChild(this.createTextNode(f.substring(++c)))}else{g.appendChild(this.createTextNode("${"+f))}}return g},"Halo":function(a){var b=this.createElementNSPlus("Halo");if(a.haloRadius){this.writeNode("Radius",a.haloRadius,b)}if(a.haloColor||a.haloOpacity){this.writeNode("Fill",{fillColor:a.haloColor,fillOpacity:a.haloOpacity},b)}return b},"Radius":function(a){return node=this.createElementNSPlus("Radius",{value:a})},"PolygonSymbolizer":function(a){var b=this.createElementNSPlus("PolygonSymbolizer");if(a.fillColor!=undefined||a.fillOpacity!=undefined){this.writeNode("Fill",a,b)}if(a.strokeWidth!=undefined||a.strokeColor!=undefined||a.strokeOpacity!=undefined||a.strokeDashstyle!=undefined){this.writeNode("Stroke",a,b)}return b},"Fill":function(a){var b=this.createElementNSPlus("Fill");if(a.fillColor){this.writeNode("CssParameter",{symbolizer:a,key:"fillColor"},b)}if(a.fillOpacity!=null){this.writeNode("CssParameter",{symbolizer:a,key:"fillOpacity"},b)}return b},"PointSymbolizer":function(a){var b=this.createElementNSPlus("PointSymbolizer");this.writeNode("Graphic",a,b);return b},"Graphic":function(a){var b=this.createElementNSPlus("Graphic");if(a.externalGraphic!=undefined){this.writeNode("ExternalGraphic",a,b)}else{this.writeNode("Mark",a,b)}if(a.graphicOpacity!=undefined){this.writeNode("Opacity",a.graphicOpacity,b)}if(a.pointRadius!=undefined){this.writeNode("Size",a.pointRadius*2,b)}if(a.rotation!=undefined){this.writeNode("Rotation",a.rotation,b)}return b},"ExternalGraphic":function(a){var c=this.createElementNSPlus("ExternalGraphic");this.writeNode("OnlineResource",a.externalGraphic,c);var b=a.graphicFormat||this.getGraphicFormat(a.externalGraphic);this.writeNode("Format",b,c);return c},"Mark":function(a){var b=this.createElementNSPlus("Mark");if(a.graphicName){this.writeNode("WellKnownName",a.graphicName,b)}this.writeNode("Fill",a,b);this.writeNode("Stroke",a,b);return b},"WellKnownName":function(a){return this.createElementNSPlus("WellKnownName",{value:a})},"Opacity":function(a){return this.createElementNSPlus("Opacity",{value:a})},"Size":function(a){return this.createElementNSPlus("Size",{value:a})},"Rotation":function(a){return this.createElementNSPlus("Rotation",{value:a})},"OnlineResource":function(a){return this.createElementNSPlus("OnlineResource",{attributes:{"xlink:type":"simple","xlink:href":a}})},"Format":function(a){return this.createElementNSPlus("Format",{value:a})}}},OpenLayers.Format.Filter.v1_0_0.prototype.writers),CLASS_NAME:"OpenLayers.Format.SLD.v1"});OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:"1.0.0",schemaLocations:{"wfs":"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"},initialize:function(a){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[a]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[a])},readers:{"wfs":OpenLayers.Util.applyDefaults({"WFS_TransactionResponse":function(b,a){a.insertIds=[];a.success=false;this.readChildNodes(b,a)},"InsertResult":function(c,b){var a={fids:[]};this.readChildNodes(c,a);b.insertIds.push(a.fids[0])},"TransactionResult":function(b,a){this.readChildNodes(b,a)},"Status":function(b,a){this.readChildNodes(b,a)},"SUCCESS":function(b,a){a.success=true}},OpenLayers.Format.WFST.v1.prototype.readers["wfs"]),"gml":OpenLayers.Format.GML.v2.prototype.readers["gml"],"feature":OpenLayers.Format.GML.v2.prototype.readers["feature"],"ogc":OpenLayers.Format.Filter.v1_0_0.prototype.readers["ogc"]},writers:{"wfs":OpenLayers.Util.applyDefaults({"Query":function(c){c=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},c);var d=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(c.featureNS?c.featurePrefix+":":"")+c.featureType}});if(c.featureNS){d.setAttribute("xmlns:"+c.featurePrefix,c.featureNS)}if(c.propertyNames){for(var b=0,a=c.propertyNames.length;b<a;b++){this.writeNode("ogc:PropertyName",{property:c.propertyNames[b]},d)}}if(c.filter){this.setFilterProperty(c.filter);this.writeNode("ogc:Filter",c.filter,d)}return d}},OpenLayers.Format.WFST.v1.prototype.writers["wfs"]),"gml":OpenLayers.Format.GML.v2.prototype.writers["gml"],"feature":OpenLayers.Format.GML.v2.prototype.writers["feature"],"ogc":OpenLayers.Format.Filter.v1_0_0.prototype.writers["ogc"]},CLASS_NAME:"OpenLayers.Format.WFST.v1_0_0"});OpenLayers.Format.WFST.v1_1_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0,OpenLayers.Format.WFST.v1,{version:"1.1.0",schemaLocations:{"wfs":"http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"},initialize:function(a){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[a]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[a])},readers:{"wfs":OpenLayers.Util.applyDefaults({"TransactionResponse":function(b,a){a.insertIds=[];a.success=false;this.readChildNodes(b,a)},"TransactionSummary":function(b,a){a.success=true},"InsertResults":function(b,a){this.readChildNodes(b,a)},"Feature":function(c,b){var a={fids:[]};this.readChildNodes(c,a);b.insertIds.push(a.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers["wfs"]),"gml":OpenLayers.Format.GML.v3.prototype.readers["gml"],"feature":OpenLayers.Format.GML.v3.prototype.readers["feature"],"ogc":OpenLayers.Format.Filter.v1_1_0.prototype.readers["ogc"]},writers:{"wfs":OpenLayers.Util.applyDefaults({"Query":function(c){c=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},c);var d=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(c.featureNS?c.featurePrefix+":":"")+c.featureType,srsName:c.srsName}});if(c.featureNS){d.setAttribute("xmlns:"+c.featurePrefix,c.featureNS)}if(c.propertyNames){for(var b=0,a=c.propertyNames.length;b<a;b++){this.writeNode("wfs:PropertyName",{property:c.propertyNames[b]},d)}}if(c.filter){this.setFilterProperty(c.filter);this.writeNode("ogc:Filter",c.filter,d)}return d},"PropertyName":function(a){return this.createElementNSPlus("wfs:PropertyName",{value:a.property})}},OpenLayers.Format.WFST.v1.prototype.writers["wfs"]),"gml":OpenLayers.Format.GML.v3.prototype.writers["gml"],"feature":OpenLayers.Format.GML.v3.prototype.writers["feature"],"ogc":OpenLayers.Format.Filter.v1_1_0.prototype.writers["ogc"]},CLASS_NAME:"OpenLayers.Format.WFST.v1_1_0"});OpenLayers.Format.SLD.v1_0_0=OpenLayers.Class(OpenLayers.Format.SLD.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd",initialize:function(a){OpenLayers.Format.SLD.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0"});OpenLayers.Protocol.WFS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_0_0"});OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.1.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_1_0"});
