var OpenLayers={singleFile:true};(function(){var g=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!g)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var q="";var s=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var m=document.getElementsByTagName("script");for(var p=0,h=m.length;p<h;p++){var r=m[p].getAttribute("src");if(r){var o=r.match(s);if(o){q=o[1];break}}}return q}};if(!g){var j=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/LayerSwitcherSG.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/NavToolbarSG.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","OpenLayers/Lang/pl.js");var b=navigator.userAgent;var d=(b.match("MSIE")||b.match("Safari"));if(d){var a=new Array(j.length)}var k=OpenLayers._getScriptLocation()+"lib/";for(var c=0,f=j.length;c<f;c++){if(d){a[c]="<script src='"+k+j[c]+"'><\/script>"}else{var l=document.createElement("script");l.src=k+j[c];var e=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;e.appendChild(l)}}if(d){document.write(a.join(""))}}})();OpenLayers.VERSION_NUMBER="$Revision: 9309 $";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(f){var d=f.split("-");var b=d[0];for(var c=1,a=d.length;c<a;c++){var e=d[c];b+=e.charAt(0).toUpperCase()+e.substring(1)}return b},format:function(d,c,a){if(!c){c=window}var b=function(j,e){var h;var g=e.split(/\.+/);for(var f=0;f<g.length;f++){if(f==0){h=c}h=h[g[f]]}if(typeof h=="function"){h=a?h.apply(null,a):h()}if(typeof h=="undefined"){return"undefined"}else{return h}};return d.replace(OpenLayers.String.tokenRegEx,b)},tokenRegEx:/\${([\w.]+?)}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)},numericIf:function(a){return OpenLayers.String.isNumeric(a)?parseFloat(a):a}};if(!String.prototype.startsWith){String.prototype.startsWith=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,a)}}if(!String.prototype.contains){String.prototype.contains=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,a)}}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));return OpenLayers.String.trim(this)}}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return OpenLayers.String.camelize(this)}}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(a,c){var b=0;if(c>0){b=parseFloat(a.toPrecision(c))}return b},format:function(c,a,g,j){a=(typeof a!="undefined")?a:0;g=(typeof g!="undefined")?g:OpenLayers.Number.thousandsSeparator;j=(typeof j!="undefined")?j:OpenLayers.Number.decimalSeparator;if(a!=null){c=parseFloat(c.toFixed(a))}var b=c.toString().split(".");if(b.length==1&&a==null){a=0}var d=b[0];if(g){var e=/(-?[0-9]+)([0-9]{3})/;while(e.test(d)){d=d.replace(e,"$1"+g+"$2")}}var f;if(a==0){f=d}else{var h=b.length>1?b[1]:"0";if(a!=null){h=h+new Array(a-h.length+1).join("0")}f=d+j+h}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(g,f,b){var d=[];if(Array.prototype.filter){d=g.filter(f,b)}else{var a=g.length;if(typeof f!="function"){throw new TypeError()}for(var c=0;c<a;c++){if(c in g){var e=g[c];if(f.call(b,e,c,g)){d.push(e)}}}}return d}};OpenLayers.Class=function(){var d=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var c={};var f,b;for(var e=0,a=arguments.length;e<a;++e){if(typeof arguments[e]=="function"){if(e==0&&a>1){b=arguments[e].prototype.initialize;arguments[e].prototype.initialize=function(){};c=new arguments[e];if(b===undefined){delete arguments[e].prototype.initialize}else{arguments[e].prototype.initialize=b}}f=arguments[e].prototype}else{f=arguments[e]}OpenLayers.Util.extend(c,f)}d.prototype=c;return d};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 d=arguments[0];var e=new d(OpenLayers.Class.isPrototype);for(var c=1,a=arguments.length;c<a;c++){if(typeof arguments[c]=="function"){var b=arguments[c];arguments[c]=new b(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(e,arguments[c])}return e};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var d=[];for(var c=0,a=arguments.length;c<a;c++){var b=arguments[c];if(typeof b=="string"){b=document.getElementById(b)}if(arguments.length==1){return b}d.push(b)}return d};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(a,e){a=a||{};if(e){for(var d in e){var c=e[d];if(c!==undefined){a[d]=c}}var b=typeof window.Event=="function"&&e instanceof window.Event;if(!b&&e.hasOwnProperty&&e.hasOwnProperty("toString")){a.toString=e.toString}}return a};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(d,c){for(var b=0,a=d.length;b<a;b++){if(d[b]==c){return b}}return -1};OpenLayers.Util.modifyDOMElement=function(e,h,d,f,a,c,g,b){if(h){e.id=h}if(d){e.style.left=d.x+"px";e.style.top=d.y+"px"}if(f){e.style.width=f.w+"px";e.style.height=f.h+"px"}if(a){e.style.position=a}if(c){e.style.border=c}if(g){e.style.overflow=g}if(parseFloat(b)>=0&&parseFloat(b)<1){e.style.filter="alpha(opacity="+(b*100)+")";e.style.opacity=b}else{if(parseFloat(b)==1){e.style.filter="";e.style.opacity=""}}};OpenLayers.Util.createDiv=function(a,j,h,f,e,c,b,g){var d=document.createElement("div");if(f){d.style.backgroundImage="url("+f+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!e){e="absolute"}OpenLayers.Util.modifyDOMElement(d,a,j,h,e,c,b,g);return d};OpenLayers.Util.createImage=function(a,h,g,e,d,c,f,j){var b=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!d){d="relative"}OpenLayers.Util.modifyDOMElement(b,a,h,g,d,c,null,f);if(j){b.style.display="none";OpenLayers.Event.observe(b,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,b));OpenLayers.Event.observe(b,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,b))}b.style.alt=a;b.galleryImg="no";if(e){b.src=e}return b};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 d=this.urls;if(d&&d instanceof Array&&d.length>1){var e=this.src.toString();var c,a;for(a=0;c=d[a];a++){if(e.indexOf(c)!=-1){break}}var f=Math.floor(d.length*Math.random());var b=d[f];a=0;while(b==c&&a++<4){f=Math.floor(d.length*Math.random());b=d[f]}this.src=e.replace(c,b)}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 d=navigator.appVersion.split("MSIE");var a=parseFloat(d[1]);var b=false;try{b=!!(document.body.filters)}catch(c){}OpenLayers.Util.alphaHackNeeded=(b&&(a>=5.5)&&(a<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(a,b,k,j,g,f,c,d,h){OpenLayers.Util.modifyDOMElement(a,b,k,j,f,null,null,h);var e=a.childNodes[0];if(g){e.src=g}OpenLayers.Util.modifyDOMElement(e,a.id+"_innerImage",null,j,"relative",c);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(d==null){d="scale"}a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.src+"', sizingMethod='"+d+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}e.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(b,k,j,g,f,c,d,h,l){var a=OpenLayers.Util.createDiv();var e=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);a.appendChild(e);if(l){e.style.display="none";OpenLayers.Event.observe(e,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,a));OpenLayers.Event.observe(e,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,a))}OpenLayers.Util.modifyAlphaImageDiv(a,b,k,j,g,f,c,d,h);return a};OpenLayers.Util.upperCaseObject=function(b){var a={};for(var c in b){a[c.toUpperCase()]=b[c]}return a};OpenLayers.Util.applyDefaults=function(d,c){d=d||{};var b=typeof window.Event=="function"&&c instanceof window.Event;for(var a in c){if(d[a]===undefined||(!b&&c.hasOwnProperty&&c.hasOwnProperty(a)&&!d.hasOwnProperty(a))){d[a]=c[a]}}if(!b&&c&&c.hasOwnProperty&&c.hasOwnProperty("toString")&&!d.hasOwnProperty("toString")){d.toString=c.toString}return d};OpenLayers.Util.getParameterString=function(h){var g=[];for(var c in h){var e=h[c];if((e!=null)&&(typeof e!="function")){var b;if(typeof e=="object"&&e.constructor==Array){var f=[];for(var d=0,a=e.length;d<a;d++){f.push(encodeURIComponent(e[d]))}b=f.join(",")}else{b=encodeURIComponent(e)}g.push(encodeURIComponent(c)+"="+b)}}return g.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var d=null;for(var c=0,a=arguments.length;c<a;c++){var b=arguments[c];try{d=b();break}catch(f){}}return d};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(c,e){var b=[];for(var d=0,a=c.length;d<a;d++){if(c[d].nodeName==e){b.push(c[d])}}return b};OpenLayers.Util.getTagText=function(c,d,b){var a=OpenLayers.Util.getNodes(c,d);if(a&&(a.length>0)){if(!b){b=0}if(a[b].childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a[b].childNodes.length==1){return a[b].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(a){var b=null;OpenLayers.Util.Try(function(){b=a.text;if(!b){b=a.textContent}if(!b){b=a.firstChild.nodeValue}},function(){b=a.textContent});return b};OpenLayers.Util.mouseLeft=function(a,c){var b=(a.relatedTarget)?a.relatedTarget:a.toElement;while(b!=c&&b!=null){b=b.parentNode}return(b!=c)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(b,a){if(a==null){a=OpenLayers.Util.DEFAULT_PRECISION}var b;if(a==0){b=parseFloat(b)}else{b=parseFloat(parseFloat(b).toPrecision(a))}return b};OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.distVincenty=function(g,c){var P=6378137,O=6356752.3142,J=1/298.257223563;var o=OpenLayers.Util.rad(c.lon-g.lon);var N=Math.atan((1-J)*Math.tan(OpenLayers.Util.rad(g.lat)));var M=Math.atan((1-J)*Math.tan(OpenLayers.Util.rad(c.lat)));var m=Math.sin(N),j=Math.cos(N);var l=Math.sin(M),h=Math.cos(M);var t=o,p=2*Math.PI;var r=20;while(Math.abs(t-p)>1e-12&&--r>0){var F=Math.sin(t),e=Math.cos(t);var Q=Math.sqrt((h*F)*(h*F)+(j*l-m*h*e)*(j*l-m*h*e));if(Q==0){return 0}var H=m*l+j*h*e;var E=Math.atan2(Q,H);var k=Math.asin(j*h*F/Q);var I=Math.cos(k)*Math.cos(k);var q=H-2*m*l/I;var w=J/16*I*(4+J*(4-3*I));p=t;t=o+(1-w)*J*Math.sin(k)*(E+w*Q*(q+w*H*(-1+2*q*q)))}if(r==0){return NaN}var v=I*(P*P-O*O)/(O*O);var D=1+v/16384*(4096+v*(-768+v*(320-175*v)));var z=v/1024*(256+v*(-128+v*(74-47*v)));var G=z*Q*(q+z/4*(H*(-1+2*q*q)-z/6*q*(-3+4*Q*Q)*(-3+4*q*q)));var u=O*D*(E-G);var K=u.toFixed(3)/1000;return K};OpenLayers.Util.getParameters=function(b){b=b||window.location.href;var a="";if(OpenLayers.String.contains(b,"?")){var c=b.indexOf("?")+1;var e=OpenLayers.String.contains(b,"#")?b.indexOf("#"):b.length;a=b.substring(c,e)}var p={};var d=a.split(/[&;]/);for(var h=0,k=d.length;h<k;++h){var g=d[h].split("=");if(g[0]){var m=decodeURIComponent(g[0]);var l=g[1]||"";l=l.split(",");for(var f=0,o=l.length;f<o;f++){l[f]=decodeURIComponent(l[f])}if(l.length==1){l=l[0]}p[m]=l}}return p};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.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(b){var a=(b>1)?(1/b):b;return a};OpenLayers.Util.getResolutionFromScale=function(d,a){if(a==null){a="degrees"}var c=OpenLayers.Util.normalizeScale(d);var b=1/(c*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH);return b};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(f){var a=0,d=0;var b=f;var g=f;while(b){if(b==document.body){if(OpenLayers.Element.getStyle(g,"position")=="absolute"){break}}a+=b.offsetTop||0;d+=b.offsetLeft||0;g=b;try{b=b.offsetParent}catch(c){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:b.id}));break}}b=f;while(b){a-=b.scrollTop||0;d-=b.scrollLeft||0;b=b.parentNode}return[d,a]};OpenLayers.Util.isEquivalentUrl=function(f,e,c){c=c||{};OpenLayers.Util.applyDefaults(c,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=OpenLayers.Util.createUrlObject(f,c);var a=OpenLayers.Util.createUrlObject(e,c);for(var d in b){if(d!=="args"){if(b[d]!=a[d]){return false}}}for(var d in b.args){if(b.args[d]!=a.args[d]){return false}delete a.args[d]}for(var d in a.args){return false}return true};OpenLayers.Util.createUrlObject=function(c,l){l=l||{};if(!(/^\w+:\/\//).test(c)){var g=window.location;var e=g.port?":"+g.port:"";var h=g.protocol+"//"+g.host.split(":").shift()+e;if(c.indexOf("/")===0){c=h+c}else{var f=g.pathname.split("/");f.pop();c=h+f.join("/")+"/"+c}}if(l.ignoreCase){c=c.toLowerCase()}var j=document.createElement("a");j.href=c;var d={};d.host=j.host.split(":").shift();d.protocol=j.protocol;if(l.ignorePort80){d.port=(j.port=="80"||j.port=="0")?"":j.port}else{d.port=(j.port==""||j.port=="0")?"80":j.port}d.hash=(l.ignoreHash||j.hash==="#")?"":j.hash;var b=j.search;if(!b){var k=c.indexOf("?");b=(k!=-1)?c.substr(k):""}d.args=OpenLayers.Util.getParameters(b);d.pathname=(j.pathname.charAt(0)=="/")?j.pathname:"/"+j.pathname;return d};OpenLayers.Util.removeTail=function(b){var c=null;var a=b.indexOf("?");var d=b.indexOf("#");if(a==-1){c=(d!=-1)?b.substr(0,d):b}else{c=(d!=-1)?b.substr(0,Math.min(a,d)):b.substr(0,a)}return c};OpenLayers.Util.getBrowserName=function(){var b="";var a=navigator.userAgent.toLowerCase();if(a.indexOf("opera")!=-1){b="opera"}else{if(a.indexOf("msie")!=-1){b="msie"}else{if(a.indexOf("safari")!=-1){b="safari"}else{if(a.indexOf("mozilla")!=-1){if(a.indexOf("firefox")!=-1){b="firefox"}else{b="mozilla"}}}}}return b};OpenLayers.Util.getRenderedDimensions=function(b,p,q){var k,e;var a=document.createElement("div");a.style.visibility="hidden";var o=(q&&q.containerElement)?q.containerElement:document.body;if(p){if(p.w){k=p.w;a.style.width=k+"px"}else{if(p.h){e=p.h;a.style.height=e+"px"}}}if(q&&q.displayClass){a.className=q.displayClass}var f=document.createElement("div");f.innerHTML=b;f.style.overflow="visible";if(f.childNodes){for(var d=0,c=f.childNodes.length;d<c;d++){if(!f.childNodes[d].style){continue}f.childNodes[d].style.overflow="visible"}}a.appendChild(f);o.appendChild(a);var m=false;var j=a.parentNode;while(j&&j.tagName.toLowerCase()!="body"){var g=OpenLayers.Element.getStyle(j,"position");if(g=="absolute"){m=true;break}else{if(g&&g!="static"){break}}j=j.parentNode}if(!m){a.style.position="absolute"}if(!k){k=parseInt(f.scrollWidth);a.style.width=k+"px"}if(!e){e=parseInt(f.scrollHeight)}a.removeChild(f);o.removeChild(a);return new OpenLayers.Size(k,e)};OpenLayers.Util.getScrollbarWidth=function(){var c=OpenLayers.Util._scrollbarWidth;if(c==null){var e=null;var d=null;var a=0;var b=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";d=document.createElement("div");d.style.width="100%";d.style.height="200px";e.appendChild(d);document.body.appendChild(e);a=d.offsetWidth;e.style.overflow="scroll";b=d.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(a-b);c=OpenLayers.Util._scrollbarWidth}return c};OpenLayers.Rico=new Object();OpenLayers.Rico.Corner={round:function(d,b){d=OpenLayers.Util.getElement(d);this._setOptions(b);var a=this.options.color;if(this.options.color=="fromElement"){a=this._background(d)}var c=this.options.bgColor;if(this.options.bgColor=="fromParent"){c=this._background(d.offsetParent)}this._roundCornersImpl(d,a,c)},changeColor:function(c,b){c.style.backgroundColor=b;var a=c.parentNode.getElementsByTagName("span");for(var d=0;d<a.length;d++){a[d].style.backgroundColor=b}},changeOpacity:function(c,f){var d=f;var a="alpha(opacity="+f*100+")";c.style.opacity=d;c.style.filter=a;var b=c.parentNode.getElementsByTagName("span");for(var e=0;e<b.length;e++){b[e].style.opacity=d;b[e].style.filter=a}},reRound:function(d,c){var b=d.parentNode.childNodes[0];var a=d.parentNode.childNodes[2];d.parentNode.removeChild(b);d.parentNode.removeChild(a);this.round(d.parentNode,c)},_roundCornersImpl:function(c,a,b){if(this.options.border){this._renderBorder(c,b)}if(this._isTopRounded()){this._roundTopCorners(c,a,b)}if(this._isBottomRounded()){this._roundBottomCorners(c,a,b)}},_renderBorder:function(d,e){var b="1px solid "+this._borderColor(e);var a="border-left: "+b;var f="border-right: "+b;var c="style='"+a+";"+f+"'";d.innerHTML="<div "+c+">"+d.innerHTML+"</div>"},_roundTopCorners:function(c,a,e){var d=this._createCorner(e);for(var b=0;b<this.options.numSlices;b++){d.appendChild(this._createCornerSlice(a,e,b,"top"))}c.style.paddingTop=0;c.insertBefore(d,c.firstChild)},_roundBottomCorners:function(c,a,e){var d=this._createCorner(e);for(var b=(this.options.numSlices-1);b>=0;b--){d.appendChild(this._createCornerSlice(a,e,b,"bottom"))}c.style.paddingBottom=0;c.appendChild(d)},_createCorner:function(b){var a=document.createElement("div");a.style.backgroundColor=(this._isTransparent()?"transparent":b);return a},_createCornerSlice:function(c,d,g,a){var e=document.createElement("span");var b=e.style;b.backgroundColor=c;b.display="block";b.height="1px";b.overflow="hidden";b.fontSize="1px";var f=this._borderColor(c,d);if(this.options.border&&g==0){b.borderTopStyle="solid";b.borderTopWidth="1px";b.borderLeftWidth="0px";b.borderRightWidth="0px";b.borderBottomWidth="0px";b.height="0px";b.borderColor=f}else{if(f){b.borderColor=f;b.borderStyle="solid";b.borderWidth="0px 1px"}}if(!this.options.compact&&(g==(this.options.numSlices-1))){b.height="2px"}this._setMargin(e,g,a);this._setBorder(e,g,a);return e},_setOptions:function(a){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,a||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else{if(this.options.corners.indexOf("tr")>=0){return"right"}}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else{if(this.options.corners.indexOf("br")>=0){return"right"}}return""},_borderColor:function(a,b){if(a=="transparent"){return b}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(b,a)}else{return""}}}},_setMargin:function(d,e,b){var c=this._marginSize(e);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){d.style.marginLeft=c+"px";d.style.marginRight="0px"}else{if(a=="right"){d.style.marginRight=c+"px";d.style.marginLeft="0px"}else{d.style.marginLeft=c+"px";d.style.marginRight=c+"px"}}},_setBorder:function(d,e,b){var c=this._borderSize(e);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){d.style.borderLeftWidth=c+"px";d.style.borderRightWidth="0px"}else{if(a=="right"){d.style.borderRightWidth=c+"px";d.style.borderLeftWidth="0px"}else{d.style.borderLeftWidth=c+"px";d.style.borderRightWidth=c+"px"}}if(this.options.border!=false){d.style.borderLeftWidth=c+"px";d.style.borderRightWidth=c+"px"}},_marginSize:function(e){if(this._isTransparent()){return 0}var d=[5,3,2,1];var a=[3,2,1,0];var c=[2,1];var b=[1,0];if(this.options.compact&&this.options.blend){return b[e]}else{if(this.options.compact){return c[e]}else{if(this.options.blend){return a[e]}else{return d[e]}}}},_borderSize:function(e){var d=[5,3,2,1];var b=[2,1,1,1];var a=[1,0];var c=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else{if(this.options.compact){return a[e]}else{if(this.options.blend){return b[e]}else{if(this.options.border){return c[e]}else{if(this._isTransparent()){return d[e]}}}}}return 0},_hasString:function(b){for(var a=1;a<arguments.length;a++){if(b.indexOf(arguments[a])>=0){return true}}return false},_blend:function(c,a){var b=OpenLayers.Rico.Color.createFromHex(c);b.blend(OpenLayers.Rico.Color.createFromHex(a));return b},_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 c=0,a=arguments.length;c<a;c++){var b=OpenLayers.Util.getElement(arguments[c]);var d=OpenLayers.Element.visible(b)?"hide":"show";OpenLayers.Element[d](b)}},hide:function(){for(var c=0,a=arguments.length;c<a;c++){var b=OpenLayers.Util.getElement(arguments[c]);b.style.display="none"}},show:function(){for(var c=0,a=arguments.length;c<a;c++){var b=OpenLayers.Util.getElement(arguments[c]);b.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(b){b=OpenLayers.Util.getElement(b);if(OpenLayers.Element.getStyle(b,"display")!="none"){return{width:b.offsetWidth,height:b.offsetHeight}}var a=b.style;var e=a.visibility;var c=a.position;a.visibility="hidden";a.position="absolute";a.display="";var f=b.clientWidth;var d=b.clientHeight;a.display="none";a.position=c;a.visibility=e;return{width:f,height:d}},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(c,d){c=OpenLayers.Util.getElement(c);var e=null;if(c&&c.style){e=c.style[OpenLayers.String.camelize(d)];if(!e){if(document.defaultView&&document.defaultView.getComputedStyle){var b=document.defaultView.getComputedStyle(c,null);e=b?b.getPropertyValue(d):null}else{if(c.currentStyle){e=c.currentStyle[OpenLayers.String.camelize(d)]}}}var a=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(a,d)!=-1)&&(OpenLayers.Element.getStyle(c,"position")=="static")){e="auto"}}return e=="auto"?null:e}};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(a,b,d,c){this.url=a;this.size=(b)?b:new OpenLayers.Size(20,20);this.offset=d?d:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=c;var e=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(e)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(a){if(a!=null){this.size=a}this.draw()},setUrl:function(a){if(a!=null){this.url=a}this.draw()},draw:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(a);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,a)},moveTo:function(a){if(a!=null){this.px=a}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var b=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,b)}}},display:function(a){this.imageDiv.style.display=(a)?"":"none"},isDrawn:function(){var a=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return a},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:false,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,keepInMap:false,closeOnMove:false,map:null,initialize:function(g,c,f,b,e,d){if(g==null){g=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=g;this.lonlat=c;this.contentSize=(f!=null)?f:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(b!=null){this.contentHTML=b}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 g=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(g,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(e){this.addCloseBox(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 b=document.defaultView.getComputedStyle(this.contentDiv,null);var c=b.getPropertyValue("overflow");if(c!="hidden"){this.contentDiv._oldOverflow=c;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(c){this.size=c.clone();var b=this.getContentDivPadding();var a=b.left+b.right;var e=b.top+b.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;e+=this.padding.top+this.padding.bottom;if(this.closeDiv){var d=parseInt(this.closeDiv.style.width);a+=d+b.right}this.size.w+=a;this.size.h+=e;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=c.w+"px";this.contentDiv.style.height=c.h+"px"}},updateSize:function(){var e="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var h=(this.map)?this.map.layerContainerDiv:document.body;var j=OpenLayers.Util.getRenderedDimensions(e,null,{displayClass:this.displayClass,containerElement:h});var g=this.getSafeContentSize(j);var f=null;if(g.equals(j)){f=j}else{var b=new OpenLayers.Size();b.w=(g.w<j.w)?g.w:null;b.h=(g.h<j.h)?g.h:null;if(b.w&&b.h){f=g}else{var d=OpenLayers.Util.getRenderedDimensions(e,b,{displayClass:this.contentDisplayClass,containerElement:h});var c=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((c!="hidden")&&(d.equals(g))){var a=OpenLayers.Util.getScrollbarWidth();if(b.w){d.h+=a}else{d.w+=a}}f=this.getSafeContentSize(d)}}this.setSize(f)},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 f=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var b=this.contentDiv.getElementsByTagName("img");for(var e=0,a=b.length;e<a;e++){var c=b[e];if(c.width==0||c.height==0){var d={popup:this,img:c};c._onImgLoad=OpenLayers.Function.bind(f,d);OpenLayers.Event.observe(c,"load",c._onImgLoad)}}},getSafeContentSize:function(l){var d=l.clone();var j=this.getContentDivPadding();var k=j.left+j.right;var g=j.top+j.bottom;this.fixPadding();k+=this.padding.left+this.padding.right;g+=this.padding.top+this.padding.bottom;if(this.closeDiv){var c=parseInt(this.closeDiv.style.width);k+=c+j.right}if(this.minSize){d.w=Math.max(d.w,(this.minSize.w-k));d.h=Math.max(d.h,(this.minSize.h-g))}if(this.maxSize){d.w=Math.min(d.w,(this.maxSize.w-k));d.h=Math.min(d.h,(this.maxSize.h-g))}if(this.map&&this.map.size){var f=0,e=0;if(this.keepInMap&&!this.panMapIfOutOfView){var h=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":f=h.x;e=this.map.size.h-h.y;break;case"tl":f=this.map.size.w-h.x;e=this.map.size.h-h.y;break;case"bl":f=this.map.size.w-h.x;e=h.y;break;case"br":f=h.x;e=h.y;break;default:f=h.x;e=this.map.size.h-h.y;break}}var a=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-g-e;var b=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-k-f;d.w=Math.min(d.w,b);d.h=Math.min(d.h,a)}return d},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 e=this.map.getSize();var d=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var c=d.clone();if(d.x<this.map.paddingForPopups.left){c.x=this.map.paddingForPopups.left}else{if((d.x+this.size.w)>(e.w-this.map.paddingForPopups.right)){c.x=e.w-this.map.paddingForPopups.right-this.size.w}}if(d.y<this.map.paddingForPopups.top){c.y=this.map.paddingForPopups.top}else{if((d.y+this.size.h)>(e.h-this.map.paddingForPopups.bottom)){c.y=e.h-this.map.paddingForPopups.bottom-this.size.h}}var b=d.x-c.x;var a=d.y-c.y;this.map.pan(b,a)},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(a,b){this.extent=a.clone();if(b){this.resolution=null}},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(a,b){if(b==null){b=a.style}if(a.geometry){var c=a.geometry.getBounds();if(c){if(!c.intersectsBounds(this.extent)){b={display:"none"}}var d=this.drawGeometry(a.geometry,b,a.id);if(b.display!="none"&&b.label&&d!==false){this.drawText(a.id,b,a.geometry.getCentroid())}else{this.removeText(a.id)}return d}}},drawGeometry:function(c,a,b){},drawText:function(c,b,a){},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(c,b,a){this.rgb={r:c,g:b,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(b){var a=this.asHSB();a.h=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.b)},setSaturation:function(b){var a=this.asHSB();a.s=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.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(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.max(a.b-b,0))},brighten:function(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.min(a.b+b,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(d){if(d.length==4){var b=d;var d="#";for(var c=1;c<4;c++){d+=(b.charAt(c)+b.charAt(c))}}if(d.indexOf("#")==0){d=d.substring(1)}var f=d.substring(0,2);var e=d.substring(2,4);var a=d.substring(4,6);return new OpenLayers.Rico.Color(parseInt(f,16),parseInt(e,16),parseInt(a,16))};OpenLayers.Rico.Color.createColorFromBackground=function(d){var b=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(d),"backgroundColor","background-color");if(b=="transparent"&&d.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(d.parentNode)}if(b==null){return new OpenLayers.Rico.Color(255,255,255)}if(b.indexOf("rgb(")==0){var a=b.substring(4,b.length-1);var c=a.split(",");return new OpenLayers.Rico.Color(parseInt(c[0]),parseInt(c[1]),parseInt(c[2]))}else{if(b.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(b)}else{return new OpenLayers.Rico.Color(255,255,255)}}};OpenLayers.Rico.Color.HSBtoRGB=function(j,e,l){var c=0;var d=0;var m=0;if(e==0){c=parseInt(l*255+0.5);d=c;m=c}else{var g=(j-Math.floor(j))*6;var k=g-Math.floor(g);var b=l*(1-e);var a=l*(1-e*k);var o=l*(1-(e*(1-k)));switch(parseInt(g)){case 0:c=(l*255+0.5);d=(o*255+0.5);m=(b*255+0.5);break;case 1:c=(a*255+0.5);d=(l*255+0.5);m=(b*255+0.5);break;case 2:c=(b*255+0.5);d=(l*255+0.5);m=(o*255+0.5);break;case 3:c=(b*255+0.5);d=(a*255+0.5);m=(l*255+0.5);break;case 4:c=(o*255+0.5);d=(b*255+0.5);m=(l*255+0.5);break;case 5:c=(l*255+0.5);d=(b*255+0.5);m=(a*255+0.5);break}}return{r:parseInt(c),g:parseInt(d),b:parseInt(m)}};OpenLayers.Rico.Color.RGBtoHSB=function(a,f,m){var h;var e;var l;var o=(a>f)?a:f;if(m>o){o=m}var j=(a<f)?a:f;if(m<j){j=m}l=o/255;if(o!=0){e=(o-j)/o}else{e=0}if(e==0){h=0}else{var c=(o-a)/(o-j);var k=(o-f)/(o-j);var d=(o-m)/(o-j);if(a==o){h=d-k}else{if(f==o){h=2+c-d}else{h=4+k-c}}h=h/6;if(h<0){h=h+1}}return{h:h,s:e,b:l}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(d,a,b,c){if(d!=null){this.left=OpenLayers.Util.toFloat(d)}if(a!=null){this.bottom=OpenLayers.Util.toFloat(a)}if(b!=null){this.right=OpenLayers.Util.toFloat(b)}if(c!=null){this.top=OpenLayers.Util.toFloat(c)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(b){var a=false;if(b!=null){a=((this.left==b.left)&&(this.right==b.right)&&(this.top==b.top)&&(this.bottom==b.bottom))}return a},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(a){if(a==null){a=6}var b=Math.pow(10,a);var c=Math.round(this.left*b)/b+","+Math.round(this.bottom*b)/b+","+Math.round(this.right*b)/b+","+Math.round(this.top*b)/b;return c},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(f,h){if(h==null){h=this.getCenterLonLat()}var a=[];var e,d;if(h.CLASS_NAME=="OpenLayers.LonLat"){e=h.lon;d=h.lat}else{e=h.x;d=h.y}var c=(this.left-e)*f+e;var b=(this.bottom-d)*f+d;var j=(this.right-e)*f+e;var g=(this.top-d)*f+d;return new OpenLayers.Bounds(c,b,j,g)},add:function(a,c){if((a==null)||(c==null)){var b=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Bounds(this.left+a,this.bottom+c,this.right+a,this.top+c)},extend:function(a){var b=null;if(a){switch(a.CLASS_NAME){case"OpenLayers.LonLat":b=new OpenLayers.Bounds(a.lon,a.lat,a.lon,a.lat);break;case"OpenLayers.Geometry.Point":b=new OpenLayers.Bounds(a.x,a.y,a.x,a.y);break;case"OpenLayers.Bounds":b=a;break}if(b){this.centerLonLat=null;if((this.left==null)||(b.left<this.left)){this.left=b.left}if((this.bottom==null)||(b.bottom<this.bottom)){this.bottom=b.bottom}if((this.right==null)||(b.right>this.right)){this.right=b.right}if((this.top==null)||(b.top>this.top)){this.top=b.top}}}},containsLonLat:function(b,a){return this.contains(b.lon,b.lat,a)},containsPixel:function(b,a){return this.contains(b.x,b.y,a)},contains:function(b,d,a){if(a==null){a=true}if(b==null||d==null){return false}b=OpenLayers.Util.toFloat(b);d=OpenLayers.Util.toFloat(d);var c=false;if(a){c=((b>=this.left)&&(b<=this.right)&&(d>=this.bottom)&&(d<=this.top))}else{c=((b>this.left)&&(b<this.right)&&(d>this.bottom)&&(d<this.top))}return c},intersectsBounds:function(e,b){if(b==null){b=true}var d=false;var h=(this.left==e.right||this.right==e.left||this.top==e.bottom||this.bottom==e.top);if(b||!h){var g=(((e.bottom>=this.bottom)&&(e.bottom<=this.top))||((this.bottom>=e.bottom)&&(this.bottom<=e.top)));var f=(((e.top>=this.bottom)&&(e.top<=this.top))||((this.top>e.bottom)&&(this.top<e.top)));var c=(((e.left>=this.left)&&(e.left<=this.right))||((this.left>=e.left)&&(this.left<=e.right)));var a=(((e.right>=this.left)&&(e.right<=this.right))||((this.right>=e.left)&&(this.right<=e.right)));d=((g||f)&&(c||a))}return d},containsBounds:function(g,b,a){if(b==null){b=false}if(a==null){a=true}var c=this.contains(g.left,g.bottom,a);var d=this.contains(g.right,g.bottom,a);var f=this.contains(g.left,g.top,a);var e=this.contains(g.right,g.top,a);return(b)?(c||d||f||e):(c&&d&&f&&e)},determineQuadrant:function(c){var b="";var a=this.getCenterLonLat();b+=(c.lat<a.lat)?"b":"t";b+=(c.lon<a.lon)?"l":"r";return b},transform:function(d,b){this.centerLonLat=null;var e=OpenLayers.Projection.transform({x:this.left,y:this.bottom},d,b);var a=OpenLayers.Projection.transform({x:this.right,y:this.bottom},d,b);var c=OpenLayers.Projection.transform({x:this.left,y:this.top},d,b);var f=OpenLayers.Projection.transform({x:this.right,y:this.top},d,b);this.left=Math.min(e.x,c.x);this.bottom=Math.min(e.y,a.y);this.right=Math.max(a.x,f.x);this.top=Math.max(c.y,f.y);return this},wrapDateLine:function(a,c){c=c||{};var d=c.leftTolerance||0;var b=c.rightTolerance||0;var e=this.clone();if(a){while(e.left<a.left&&(e.right-b)<=a.left){e=e.add(a.getWidth(),0)}while((e.left+d)>=a.right&&e.right>a.right){e=e.add(-a.getWidth(),0)}}return e},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(a){var b="";b+=(a.charAt(0)=="t")?"b":"t";b+=(a.charAt(1)=="l")?"r":"l";return b};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(b,a){this.lon=OpenLayers.Util.toFloat(b);this.lat=OpenLayers.Util.toFloat(a)},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(c,a){if((c==null)||(a==null)){var b=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.LonLat(this.lon+c,this.lat+a)},equals:function(b){var a=false;if(b!=null){a=((this.lon==b.lon&&this.lat==b.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(b.lon)&&isNaN(b.lat)))}return a},transform:function(c,b){var a=OpenLayers.Projection.transform({x:this.lon,y:this.lat},c,b);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,c){if((a==null)||(c==null)){var b=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Pixel(this.x+a,this.y+c)},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 d;if(!b){b=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var c=b.split("-");c[0]=c[0].toLowerCase();if(typeof OpenLayers.Lang[c[0]]=="object"){d=c[0]}if(c[1]){var a=c[0]+"-"+c[1].toUpperCase();if(typeof OpenLayers.Lang[a]=="object"){d=a}}if(!d){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+c.join("-")+" dictionary, falling back to default language");d=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=d},translate:function(b,a){var d=OpenLayers.Lang[OpenLayers.Lang.getCode()];var c=d[b];if(!c){c=b}if(a){c=OpenLayers.String.format(c,a)}return c}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(h,d,g,c,b,f,e){var a=[h,d,g,c,f,e];OpenLayers.Popup.prototype.initialize.apply(this,a);this.anchor=(b!=null)?b:{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(c){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(c);var d=this.calculateNewPx(c);var a=new Array(d);OpenLayers.Popup.prototype.moveTo.apply(this,a);if(this.relativePosition!=b){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(b){var d=this.map.getLonLatFromLayerPx(b);var c=this.map.getExtent();var a=c.determineQuadrant(d);return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(b){var e=b.offset(this.anchor.offset);var a=this.size||this.contentSize;var d=(this.relativePosition.charAt(0)=="t");e.y+=(d)?-a.h:this.anchor.size.h;var c=(this.relativePosition.charAt(1)=="l");e.x+=(c)?-a.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(b){b=OpenLayers.Util.applyDefaults(b,OpenLayers.Protocol.WFS.DEFAULTS);var a=OpenLayers.Protocol.WFS["v"+b.version.replace(/\./g,"_")];if(!a){throw"Unsupported WFS version: "+b.version}return new a(b)};OpenLayers.Protocol.WFS.fromWMSLayer=function(d,c){var a,e;var g=d.params.LAYERS;var f=(g instanceof Array?g[0]:g).split(":");if(f.length>1){e=f[0]}a=f.pop();var b={url:d.url,featureType:a,featurePrefix:e,srsName:d.projection&&d.projection.getCode()||d.map&&d.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(c,b))};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(a,b){if(b==null){b=a.style}b=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},b);this.features[a.id]=[a,b];if(a.geometry){this.geometryMap[a.geometry.id]=a.id}this.redraw()},drawGeometry:function(d,c){var b=d.CLASS_NAME;if((b=="OpenLayers.Geometry.Collection")||(b=="OpenLayers.Geometry.MultiPoint")||(b=="OpenLayers.Geometry.MultiLineString")||(b=="OpenLayers.Geometry.MultiPolygon")){for(var a=0;a<d.components.length;a++){this.drawGeometry(d.components[a],c)}return}switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(d,c);break;case"OpenLayers.Geometry.LineString":this.drawLineString(d,c);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(d,c);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(d,c);break;default:break}},drawExternalGraphic:function(j,a){var e=new Image();e.src=a.externalGraphic;if(a.graphicTitle){e.title=a.graphicTitle}var c=a.graphicWidth||a.graphicHeight;var h=a.graphicHeight||a.graphicWidth;c=c?c:a.pointRadius*2;h=h?h:a.pointRadius*2;var g=(a.graphicXOffset!=undefined)?a.graphicXOffset:-(0.5*c);var d=(a.graphicYOffset!=undefined)?a.graphicYOffset:-(0.5*h);var f=a.graphicOpacity||a.fillOpacity;var b={img:e,x:(j[0]+g),y:(j[1]+d),width:c,height:h,canvas:this.canvas};e.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},b)},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(c,a){if(a.graphic!==false){var b=this.getLocalXY(c);if(a.externalGraphic){this.drawExternalGraphic(b,a)}else{if(a.fill!==false){this.setCanvasStyle("fill",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],6,0,Math.PI*2,true);this.canvas.fill()}if(a.stroke!==false){this.setCanvasStyle("stroke",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],6,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(d,b){if(b.stroke!==false){this.setCanvasStyle("stroke",b);this.canvas.beginPath();var e=this.getLocalXY(d.components[0]);this.canvas.moveTo(e[0],e[1]);for(var a=1;a<d.components.length;a++){var c=this.getLocalXY(d.components[a]);this.canvas.lineTo(c[0],c[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(e,c){if(c.fill!==false){this.setCanvasStyle("fill",c);this.canvas.beginPath();var f=this.getLocalXY(e.components[0]);this.canvas.moveTo(f[0],f[1]);for(var b=1;b<e.components.length-1;b++){var d=this.getLocalXY(e.components[b]);this.canvas.lineTo(d[0],d[1])}this.canvas.fill()}if(c.stroke!==false){var a=this.canvas.lineWidth;this.setCanvasStyle("stroke",c);this.canvas.beginPath();var f=this.getLocalXY(e.components[0]);this.canvas.moveTo(f[0],f[1]);for(var b=1;b<e.components.length;b++){var d=this.getLocalXY(e.components[b]);this.canvas.lineTo(d[0],d[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawPolygon:function(c,b){this.drawLinearRing(c.components[0],b);for(var a=1;a<c.components.length;a++){this.drawLinearRing(c.components[a],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(b,d){d=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},d);var e=this.getLocalXY(b);this.setCanvasStyle("reset");this.canvas.fillStyle=d.fontColor;this.canvas.globalAlpha=1;var f=d.fontWeight+" "+d.fontSize+" "+d.fontFamily;if(this.canvas.fillText){var c=OpenLayers.Renderer.Canvas.LABEL_ALIGN[d.labelAlign[0]]||"middle";this.canvas.font=f;this.canvas.textAlign=c;this.canvas.fillText(d.label,e[0],e[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=f;var a=this.canvas.mozMeasureText(d.label);switch(d.labelAlign[0]){case"l":break;case"r":e[0]-=a;break;case"c":default:e[0]-=a/2}this.canvas.translate(e[0],e[1]);this.canvas.mozDrawText(d.label);this.canvas.translate(-1*e[0],-1*e[1])}}this.setCanvasStyle("reset")},getLocalXY:function(b){var c=this.getResolution();var d=this.extent;var a=(b.x/c+(-d.left/c));var e=((d.top/c)-b.y/c);return[a,e]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(a){var f=this.map.getLonLatFromPixel(a.xy);var b=this.getResolution();var e=new OpenLayers.Bounds(f.lon-b*5,f.lat-b*5,f.lon+b*5,f.lat+b*5);var c=e.toGeometry();for(var d in this.features){if(!this.features.hasOwnProperty(d)){continue}if(this.features[d][0].geometry.intersects(c)){return d}}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 e=[];var b,c;for(var f in this.features){if(!this.features.hasOwnProperty(f)){continue}b=this.features[f][0];c=this.features[f][1];if(!b.geometry){continue}this.drawGeometry(b.geometry,c);if(c.label){e.push([b,c])}}var d;for(var a=0;len=e.length,a<len;++a){d=e[a];this.drawText(d[0].geometry.getCentroid(),d[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(c){if(this.exists(c)){this.remove(c)}var f=c.id;this.determineZIndex(c);var d=-1;var e=this.order.length;var a;while(e-d>1){a=parseInt((d+e)/2);var b=this.compare(this,c,OpenLayers.Util.getElement(this.order[a]));if(b>0){d=a}else{e=a}}this.order.splice(e,0,f);this.indices[f]=this.getZIndex(c);return this.getNextElement(e)},remove:function(b){var d=b.id;var a=OpenLayers.Util.indexOf(this.order,d);if(a>=0){this.order.splice(a,1);delete this.indices[d];if(this.order.length>0){var c=this.order[this.order.length-1];this.maxZIndex=this.indices[c]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return(this.indices[a.id]!=null)},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;if(b==null){b=this.maxZIndex;a._style.graphicZIndex=b}else{if(b>this.maxZIndex){this.maxZIndex=b}}},getNextElement:function(b){var a=b+1;if(a<this.order.length){var c=OpenLayers.Util.getElement(this.order[a]);if(c==undefined){c=this.getNextElement(a)}return c}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(e,d,b){var a=e.getZIndex(d);var f=0;if(b){var c=e.getZIndex(b);f=a-c}return f},Z_ORDER_DRAWING_ORDER:function(c,b,a){var d=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(c,b,a);if(a&&d==0){d=1}return d},Z_ORDER_Y_ORDER:function(f,e,b){var g=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(f,e,b);if(b&&g==0){var c=e._geometry.getBounds().bottom;var d=b._geometry.getBounds().bottom;var a=d-c;g=(a==0)?1:a}return g}};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(b,a){},drawGeometry:function(g,d,f){var c=g.CLASS_NAME;var h=true;if((c=="OpenLayers.Geometry.Collection")||(c=="OpenLayers.Geometry.MultiPoint")||(c=="OpenLayers.Geometry.MultiLineString")||(c=="OpenLayers.Geometry.MultiPolygon")){for(var b=0,a=g.components.length;b<a;b++){h=this.drawGeometry(g.components[b],d,f)&&h}return h}h=false;if(d.display!="none"){if(d.backgroundGraphic){this.redrawBackgroundNode(g.id,g,d,f)}h=this.redrawNode(g.id,g,d,f)}if(h==false){var e=document.getElementById(g.id);if(e){if(e._style.backgroundGraphic){e.parentNode.removeChild(document.getElementById(g.id+this.BACKGROUND_ID_SUFFIX))}e.parentNode.removeChild(e)}}return h},redrawNode:function(g,f,b,e){var c=this.nodeFactory(g,this.getNodeType(f,b));c._featureId=e;c._geometry=f;c._geometryClass=f.CLASS_NAME;c._style=b;var a=this.drawGeometryNode(c,f,b);if(a===false){return false}c=a.node;if(this.indexer){var d=this.indexer.insert(c);if(d){this.vectorRoot.insertBefore(c,d)}else{this.vectorRoot.appendChild(c)}}else{if(c.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(c)}}this.postDraw(c);return a.complete},redrawBackgroundNode:function(e,d,b,c){var a=OpenLayers.Util.extend({},b);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,d,a,null)},drawGeometryNode:function(c,e,b){b=b||c._style;OpenLayers.Util.applyDefaults(b,this.minimumSymbolizer);var a={isFilled:b.fill===undefined?true:b.fill,isStroked:b.stroke===undefined?!!b.strokeWidth:b.stroke};var d;switch(e.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.graphic===false){a.isFilled=false;a.isStroked=false}d=this.drawPoint(c,e);break;case"OpenLayers.Geometry.LineString":a.isFilled=false;d=this.drawLineString(c,e);break;case"OpenLayers.Geometry.LinearRing":d=this.drawLinearRing(c,e);break;case"OpenLayers.Geometry.Polygon":d=this.drawPolygon(c,e);break;case"OpenLayers.Geometry.Surface":d=this.drawSurface(c,e);break;case"OpenLayers.Geometry.Rectangle":d=this.drawRectangle(c,e);break;default:break}c._style=b;c._options=a;if(d!=false){return{node:this.setStyle(c,b,a,e),complete:d}}else{return false}},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},drawSurface:function(a,b){},removeText:function(b){var a=document.getElementById(b+this.LABEL_ID_SUFFIX);if(a){this.textRoot.removeChild(a)}},getFeatureIdFromEvent:function(a){var d=a.target;var b=d&&d.correspondingUseElement;var c=b?b:(d||a.srcElement);var e=c._featureId;return e},eraseGeometry:function(f){if((f.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(f.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(f.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(f.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var d=0,a=f.components.length;d<a;d++){this.eraseGeometry(f.components[d])}}else{var c=OpenLayers.Util.getElement(f.id);if(c&&c.parentNode){if(c.geometry){c.geometry.destroy();c.geometry=null}c.parentNode.removeChild(c);if(this.indexer){this.indexer.remove(c)}if(c._style.backgroundGraphic){var b=f.id+this.BACKGROUND_ID_SUFFIX;var e=OpenLayers.Util.getElement(b);if(e&&e.parentNode){e.parentNode.removeChild(e)}}}}},nodeFactory:function(c,a){var b=OpenLayers.Util.getElement(c);if(b){if(!this.nodeTypeCompare(b,a)){b.parentNode.removeChild(b);b=this.nodeFactory(c,a)}}else{b=this.createNode(a,c)}return b},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(a){if((!a||a.zoomChanged)&&this.features){var c=this.layer.map.getResolution();if(c!=this.resolution||!this.clustersExist()){this.resolution=c;var h=[];var m,b,k;for(var e=0;e<this.features.length;++e){m=this.features[e];if(m.geometry){b=false;for(var d=0;d<h.length;++d){k=h[d];if(this.shouldCluster(k,m)){this.addToCluster(k,m);b=true;break}}if(!b){h.push(this.createCluster(this.features[e]))}}}this.layer.destroyFeatures();if(h.length>0){if(this.threshold>1){var g=h.slice();h=[];var l;for(var e=0,f=g.length;e<f;++e){l=g[e];if(l.attributes.count<this.threshold){Array.prototype.push.apply(h,l.cluster)}else{h.push(l)}}}this.clustering=true;this.layer.addFeatures(h);this.clustering=false}this.clusters=h}}},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(a,b){var e=a.geometry.getBounds().getCenterLonLat();var c=b.geometry.getBounds().getCenterLonLat();var d=(Math.sqrt(Math.pow((e.lon-c.lon),2)+Math.pow((e.lat-c.lat),2))/this.resolution);return(d<=this.distance)},addToCluster:function(a,b){a.cluster.push(b);a.attributes.count+=1},createCluster:function(c){var b=c.geometry.getBounds().getCenterLonLat();var a=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat),{count:1});a.cluster=[c];return a},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 e=g.features;if(e&&e.length>0){var f=this.layer.projection;var d=this.layer.map.getProjectionObject();if(!d.equals(f)){var c;for(var b=0,a=e.length;b<a;++b){c=e[b].geometry;if(c){c.transform(f,d)}}}this.layer.addFeatures(e)}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(a){var b=false;if(this.features){if(this.num===null){this.num=-1}var c=(this.num+1)*this.length;b=this.page(c,a)}return b},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(e,c){var d=false;if(this.features){if(e>=0&&e<this.features.length){var a=Math.floor(e/this.length);if(a!=this.num){this.paging=true;var b=this.features.slice(e,e+this.length);this.layer.removeFeatures(this.layer.features);this.num=a;if(c&&c.features){c.features=b}else{this.layer.addFeatures(b)}this.paging=false;d=true}}}return d},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(d){if(!d){d=this.layer.features}var f=this.layer.projection;var c=this.layer.map.getProjectionObject();if(!c.equals(f)){var a=d.length;var e=new Array(a);var h,g;for(var b=0;b<a;++b){h=d[b];g=h.clone();g.fid=h.fid;g.state=h.state;g._original=h;g.geometry.transform(c,f);e[b]=g}d=e}this.layer.protocol.commit(d,{callback:this.onCommit,scope:this})},onCommit:function(d){if(d.success()){var b=d.reqFeatures;var a,k;var c=[];var h=d.insertIds||[];var e=0;for(var f=0,g=b.length;f<g;++f){k=b[f];k=k._original||k;a=k.state;if(a){if(a==OpenLayers.State.DELETE){c.push(k)}else{if(a==OpenLayers.State.INSERT){k.fid=h[e];++e}}k.state=null}}if(c.length>0){this.layer.destroyFeatures(c)}}},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(c,b,d,a){this.playing=true;this.begin=c;this.finish=b;this.duration=d;this.callbacks=a.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 g={};for(var d in this.begin){var a=this.begin[d];var e=this.finish[d];if(a==null||e==null||isNaN(a)||isNaN(e)){OpenLayers.Console.error("invalid value for Tween")}var h=e-a;g[d]=this.easing.apply(this,[this.time,a,h,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,g)}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(e,a,g,f){return g*e/f+a},easeOut:function(e,a,g,f){return g*e/f+a},easeInOut:function(e,a,g,f){return g*e/f+a},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(e,a,g,f){return(e==0)?a:g*Math.pow(2,10*(e/f-1))+a},easeOut:function(e,a,g,f){return(e==f)?a+g:g*(-Math.pow(2,-10*e/f)+1)+a},easeInOut:function(e,a,g,f){if(e==0){return a}if(e==f){return a+g}if((e/=f/2)<1){return g/2*Math.pow(2,10*(e-1))+a}return g/2*(-Math.pow(2,-10*--e)+2)+a},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(e,a,g,f){return g*(e/=f)*e+a},easeOut:function(e,a,g,f){return -g*(e/=f)*(e-2)+a},easeInOut:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a}return -g/2*((--e)*(e-2)-1)+a},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 c=0,a=this.map.controls.length;c<a;c++){var d=this.map.controls[c];if((d!=this)&&(d.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(d.displayProjection!=this.displayProjection){this.displayProjection=d.displayProjection}break}}if(c==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 b=this.map.layers[d];var e=this.layers.charAt(d);if(e=="B"){this.map.setBaseLayer(b)}else{if((e=="T")||(e=="F")){b.setVisibility(e=="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 d=[];if(this.map&&this.map.layers){for(var c=0,a=this.map.layers.length;c<a;c++){var b=this.map.layers[c];if(b.attribution&&b.getVisibility()){d.push(b.attribution)}}this.div.innerHTML=d.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(d){var e=this[d+"Layers"];if(e){for(var c=0,a=e.length;c<a;c++){var b=e[c];OpenLayers.Event.stopObservingElement(b.inputElem);OpenLayers.Event.stopObservingElement(b.labelSpan)}}this[d+"LayersDiv"].innerHTML="";this[d+"Layers"]=[]},checkRedraw:function(){var e=false;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){e=true}else{for(var c=0,a=this.layerStates.length;c<a;c++){var d=this.layerStates[c];var b=this.map.layers[c];if((d.name!=b.name)||(d.inRange!=b.inRange)||(d.id!=b.id)||(d.visibility!=b.visibility)){e=true;break}}}return e},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var d=false;var m=false;var h=this.map.layers.length;this.layerStates=new Array(h);for(var f=0;f<h;f++){var g=this.map.layers[f];this.layerStates[f]={name:g.name,visibility:g.visibility,inRange:g.inRange,id:g.id}}var e=this.map.layers.slice();if(!this.ascending){e.reverse()}for(var f=0,h=e.length;f<h;f++){var g=e[f];var j=g.isBaseLayer;if(g.displayInLayerSwitcher){if(j){m=true}else{d=true}var l=(j)?(g==this.map.baseLayer):g.getVisibility();var k=document.createElement("input");k.id=this.id+"_input_"+g.name;k.name=(j)?"baseLayers":g.name;k.type=(j)?"radio":"checkbox";k.value=g.name;k.checked=l;k.defaultChecked=l;if(!j&&!g.inRange){k.disabled=true}var a={inputElem:k,layer:g,layerSwitcher:this};OpenLayers.Event.observe(k,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var b=document.createElement("span");if(!j&&!g.inRange){b.style.color="gray"}b.innerHTML=g.name;b.style.verticalAlign=(j)?"bottom":"baseline";OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var p=document.createElement("br");var o=(j)?this.baseLayers:this.dataLayers;o.push({layer:g,inputElem:k,labelSpan:b});var c=(j)?this.baseLayersDiv:this.dataLayersDiv;c.appendChild(k);c.appendChild(b);c.appendChild(p)}}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 c=OpenLayers.Util.getImagesLocation();var b=new OpenLayers.Size(18,18);var a=c+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,b,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=c+"layer-switcher-minimize.png";var b=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,b,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(b){if(!OpenLayers.Event.isLeftClick(b)){return}var a=!this.performedDrag;this.performedDrag=false;return a},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);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(e){this.mousePosition=e.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var d=Math.abs(this.mouseDragStart.x-e.xy.x);var b=Math.abs(this.mouseDragStart.y-e.xy.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(e.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=e.xy.x+"px"}if(e.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=e.xy.y+"px"}}else{var d=this.mouseDragStart.x-e.xy.x;var b=this.mouseDragStart.y-e.xy.y;var f=this.map.getSize();var a=new OpenLayers.Pixel(f.w/2+d,f.h/2+b);var c=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(c,null,true);this.mouseDragStart=e.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 h=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var a=this.map.getLonLatFromViewPortPx(b.xy);var g=Math.max(h.lat,a.lat);var c=Math.min(h.lat,a.lat);var f=Math.min(h.lon,a.lon);var d=Math.max(h.lon,a.lon);var e=new OpenLayers.Bounds(f,c,d,g);this.map.zoomToExtent(e)}else{var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(new OpenLayers.LonLat((a.lon),(a.lat)),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(c){var b=false;var a=OpenLayers.Event.element(c);while(a!=null){if(this.map&&a==this.map.div){b=true;break}a=a.parentNode}if(b){var d=0;if(!c){c=window.event}if(c.wheelDelta){d=c.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){d=-d}}else{if(c.detail){d=-c.detail/3}}if(d){c.xy=this.mousePosition;if(d<0){this.defaultWheelDown(c)}else{this.defaultWheelUp(c)}}OpenLayers.Event.stop(c)}},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(a){var c;if(a==null){c=new OpenLayers.LonLat(0,0)}else{if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity){this.lastXy=a.xy;return}c=this.map.getLonLatFromPixel(a.xy);if(!c){return}if(this.displayProjection){c.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=a.xy}var b=this.formatOutput(c);if(b!=this.element.innerHTML){this.element.innerHTML=b}},formatOutput:function(b){var c=parseInt(this.numDigits);var a=this.prefix+b.lon.toFixed(c)+this.separator+b.lat.toFixed(c)+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(b,a){this.direction=b;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[a])},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(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position;this.buttons=[];var c=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+c.w/2,b.y);this._addButton("panup","north-mini.png",a,c);b.y=a.y+c.h;this._addButton("panleft","west-mini.png",b,c);this._addButton("panright","east-mini.png",b.add(c.w,0),c);this._addButton("pandown","south-mini.png",a.add(0,c.h*2),c);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,c.h*3+5),c);this._addButton("zoomworld","zoom-world-mini.png",a.add(0,c.h*4+5),c);this._addButton("zoomout","zoom-minus-mini.png",a.add(0,c.h*5+5),c);return this.div},_addButton:function(a,d,j,g){var f=OpenLayers.Util.getImagesLocation()+d;var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,j,g,f,"absolute");this.div.appendChild(b);OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,b));OpenLayers.Event.observe(b,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));b.action=a;b.map=this.map;if(!this.slideRatio){var c=this.slideFactor;var e=function(){return c}}else{var h=this.slideRatio;var e=function(k){return this.map.getSize()[k]*h}}b.getSlideFactor=e;this.buttons.push(b);return b},_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 c=0,a=this.controls.length;c<a;c++){var b=this.controls[c].panel_div;if(this.controls[c].active){b.className=this.controls[c].displayClass+"ItemActive"}else{b.className=this.controls[c].displayClass+"ItemInactive"}this.div.appendChild(b)}}},activateControl:function(c){if(!this.active){return false}if(c.type==OpenLayers.Control.TYPE_BUTTON){c.trigger();this.redraw();return}if(c.type==OpenLayers.Control.TYPE_TOGGLE){if(c.active){c.deactivate()}else{c.activate()}this.redraw();return}for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]!=c){if(this.controls[b].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[b].deactivate()}}}c.activate()},addControls:function(b){if(!(b instanceof Array)){b=[b]}this.controls=this.controls.concat(b);for(var d=0,a=b.length;d<a;d++){var c=document.createElement("div");var e=document.createTextNode(" ");b[d].panel_div=c;if(b[d].title!=""){b[d].panel_div.title=b[d].title}OpenLayers.Event.observe(b[d].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,b[d]));OpenLayers.Event.observe(b[d].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var d=0,a=b.length;d<a;d++){this.map.addControl(b[d]);b[d].deactivate();b[d].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(c,a){var d=(typeof a.test=="function");var b=OpenLayers.Array.filter(this.controls,function(e){return e[c]==a||(d&&a.test(e[c]))});return b},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(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b)},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 d=parseInt(Math.log(b)/Math.log(10));var a=Math.pow(10,d);var c=parseInt(b/a);var e;if(c>5){e=5}else{if(c>2){e=2}else{e=1}}return e*a},update:function(){var h=this.map.getResolution();if(!h){return}var m=this.map.getUnits();var c=OpenLayers.INCHES_PER_UNIT;var j=this.maxWidth*h*c[m];var a;var d;if(j>100000){a=this.topOutUnits;d=this.bottomOutUnits}else{a=this.topInUnits;d=this.bottomInUnits}var f=j/c[a];var k=j/c[d];var g=this.getBarLen(f);var e=this.getBarLen(k);f=g/c[m]*c[a];k=e/c[m]*c[d];var b=f/h;var l=k/h;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(l)+"px";this.eBottom.innerHTML=e+" "+d}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(b)+"px";this.eTop.innerHTML=g+" "+a}},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(b,a){if(!a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}},findElement:function(c,b){var a=OpenLayers.Event.element(c);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observe:function(b,d,c,a){var e=OpenLayers.Util.getElement(b);a=a||false;if(d=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||e.attachEvent)){d="keydown"}if(!this.observers){this.observers={}}if(!e._eventCacheID){var f="eventCacheID_";if(e.id){f=e.id+"_"+f}e._eventCacheID=OpenLayers.Util.createUniqueID(f)}var g=e._eventCacheID;if(!this.observers[g]){this.observers[g]=[]}this.observers[g].push({element:e,name:d,observer:c,useCapture:a});if(e.addEventListener){e.addEventListener(d,c,a)}else{if(e.attachEvent){e.attachEvent("on"+d,c)}}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var c=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[c])},_removeElementObservers:function(e){if(e){for(var b=e.length-1;b>=0;b--){var c=e[b];var a=new Array(c.element,c.name,c.observer,c.useCapture);var d=OpenLayers.Event.stopObserving.apply(this,a)}}},stopObserving:function(h,a,g,b){b=b||false;var f=OpenLayers.Util.getElement(h);var d=f._eventCacheID;if(a=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||f.detachEvent){a="keydown"}}var k=false;var c=OpenLayers.Event.observers[d];if(c){var e=0;while(!k&&e<c.length){var j=c[e];if((j.name==a)&&(j.observer==g)&&(j.useCapture==b)){c.splice(e,1);if(c.length==0){delete OpenLayers.Event.observers[d]}k=true;break}e++}}if(k){if(f.removeEventListener){f.removeEventListener(a,g,b)}else{if(f&&f.detachEvent){f.detachEvent("on"+a,g)}}}return k},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers){var b=OpenLayers.Event.observers[a];OpenLayers.Event._removeElementObservers.apply(this,[b])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event)}else{var Event=OpenLayers.Event}OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,clearMouseListener:null,initialize:function(c,e,g,f,b){OpenLayers.Util.extend(this,b);this.object=c;this.fallThrough=f;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(g!=null){for(var d=0,a=g.length;d<a;d++){this.addEventType(g[d])}}if(e!=null){this.attachToElement(e)}},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 c=0,a=this.BROWSER_EVENTS.length;c<a;c++){var b=this.BROWSER_EVENTS[c];this.addEventType(b);OpenLayers.Event.observe(d,b,this.eventHandler)}OpenLayers.Event.observe(d,"dragstart",OpenLayers.Event.stop)},on:function(a){for(var b in a){if(b!="scope"){this.register(b,a.scope,a[b])}}},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(a){for(var b in a){if(b!="scope"){this.unregister(b,a.scope,a[b])}}},unregister:function(d,f,e){if(f==null){f=this.object}var c=this.listeners[d];if(c!=null){for(var b=0,a=c.length;b<a;b++){if(c[b].obj==f&&c[b].func==e){c.splice(b,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(e,b){var d=this.listeners[e];if(!d||d.length==0){return}if(b==null){b={}}b.object=this.object;b.element=this.element;if(!b.type){b.type=e}var d=d.slice(),f;for(var c=0,a=d.length;c<a;c++){var g=d[c];f=g.func.apply(g.obj,[b]);if((f!=undefined)&&(f==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(b,true)}return f},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 thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};OpenLayers.Lang.pl={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Warstwy",baseLayer:"Tło",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Skala = 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(g,c,f,b,a,e,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 a=this.getCornersToRound(this.relativePosition);var b={corners:a,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,b);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,b);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var a=["tl","tr","bl","br"];var b=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(a,b);return a.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,initialize:function(g,c,f,b,a,e,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(e){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 a=0;a<this.blocks.length;a++){var b=this.blocks[a];if(b.image){b.div.removeChild(b.image)}b.image=null;if(b.div){this.groupDiv.removeChild(b.div)}b.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 e in this.positionBlocks){f=e;break}var a=this.positionBlocks[f];for(var d=0;d<a.blocks.length;d++){var h={};this.blocks.push(h);var b=this.id+"_FrameDecorationDiv_"+d;h.div=OpenLayers.Util.createDiv(b,null,null,null,"absolute",null,"hidden",null);var c=this.id+"_FrameDecorationImg_"+d;var g=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;h.image=g(c,null,this.imageSize,this.imageSrc,"absolute",null,null,null);h.div.appendChild(h.image);this.groupDiv.appendChild(h.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var j=this.positionBlocks[this.relativePosition];for(var f=0;f<j.blocks.length;f++){var c=j.blocks[f];var e=this.blocks[f];var d=c.anchor.left;var k=c.anchor.bottom;var a=c.anchor.right;var o=c.anchor.top;var m=(isNaN(c.size.w))?this.size.w-(a+d):c.size.w;var g=(isNaN(c.size.h))?this.size.h-(k+o):c.size.h;e.div.style.width=(m<0?0:m)+"px";e.div.style.height=(g<0?0:g)+"px";e.div.style.left=(d!=null)?d+"px":"";e.div.style.bottom=(k!=null)?k+"px":"";e.div.style.right=(a!=null)?a+"px":"";e.div.style.top=(o!=null)?o+"px":"";e.image.style.left=c.position.x+"px";e.image.style.top=c.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(b,a){OpenLayers.Util.extend(this,a);this.projCode=b;if(window.Proj4js){this.proj=new Proj4js.Proj(b)}},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(c,b,a){if(!OpenLayers.Projection.transforms[c]){OpenLayers.Projection.transforms[c]={}}OpenLayers.Projection.transforms[c][b]=a};OpenLayers.Projection.transform=function(a,c,b){if(c.proj&&b.proj){a=Proj4js.transform(c.proj,b.proj,a)}else{if(c&&b&&OpenLayers.Projection.transforms[c.getCode()]&&OpenLayers.Projection.transforms[c.getCode()][b.getCode()]){OpenLayers.Projection.transforms[c.getCode()][b.getCode()](a)}}return a};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(c,d){if(!this.featureNS&&c.prefix==this.featurePrefix){this.featureNS=c.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(c,a,b){return OpenLayers.Function.bind(function(){c.apply(this,[a,b])},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,b){if(b.callback){var c=a.priv;if(c.status>=200&&c.status<300){a.features=this.parseFeatures(c);a.code=OpenLayers.Protocol.Response.SUCCESS}else{a.code=OpenLayers.Protocol.Response.FAILURE}b.callback.call(b.scope,a)}},parseFeatures:function(a){var b=a.responseXML;if(!b||!b.documentElement){b=a.responseText}if(!b||b.length<=0){return null}return this.format.read(b)},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(a,b){if(b.callback){var c=a.priv;var d=c.responseXML;if(!d||!d.documentElement){d=c.responseText}var e=this.format.read(d)||{};a.insertIds=e.insertIds||[];a.code=(e.success)?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},filterDelete:function(e,c){c=OpenLayers.Util.extend({},c);OpenLayers.Util.applyDefaults(c,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:(c.featureNS?this.featurePrefix+":":"")+c.featureType}});if(c.featureNS){d.setAttribute("xmlns:"+this.featurePrefix,c.featureNS)}var g=this.format.writeNode("ogc:Filter",e);d.appendChild(g);a.appendChild(d);var f=OpenLayers.Format.XML.prototype.write.apply(this.format,[a]);return OpenLayers.Request.POST({url:this.url,callback:c.callback||function(){},data:f})},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,e,b){var d=a+(b?0:this.translationParameters.x);var c=e+(b?0:this.translationParameters.y);return(d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL&&c>=-this.MAX_PIXEL&&c<=this.MAX_PIXEL)},setExtent:function(b,d){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var f=-b.left/a;var e=b.top/a;if(d){this.left=f;this.top=e;var c="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",c);this.translate(0,0);return true}else{var g=this.translate(f-this.left,e-this.top);if(!g){this.setExtent(b,true)}return g}},translate:function(a,c){if(!this.inValidRange(a,c,true)){return false}else{var b="";if(a||c){b="translate("+a+","+c+")"}this.root.setAttributeNS(null,"transform",b);this.translationParameters={x:a,y:c};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(c,b){var a=null;switch(c.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="image"}else{if(this.isComplexSymbol(b.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(p,t,b){t=t||p._style;b=b||p._options;var j=parseFloat(p.getAttributeNS(null,"r"));var h=1;var d;if(p._geometryClass=="OpenLayers.Geometry.Point"&&j){p.style.visibility="";if(t.graphic===false){p.style.visibility="hidden"}else{if(t.externalGraphic){d=this.getPosition(p);if(t.graphicTitle){p.setAttributeNS(null,"title",t.graphicTitle)}if(t.graphicWidth&&t.graphicHeight){p.setAttributeNS(null,"preserveAspectRatio","none")}var o=t.graphicWidth||t.graphicHeight;var l=t.graphicHeight||t.graphicWidth;o=o?o:t.pointRadius*2;l=l?l:t.pointRadius*2;var u=(t.graphicXOffset!=undefined)?t.graphicXOffset:-(0.5*o);var e=(t.graphicYOffset!=undefined)?t.graphicYOffset:-(0.5*l);var a=t.graphicOpacity||t.fillOpacity;p.setAttributeNS(null,"x",(d.x+u).toFixed());p.setAttributeNS(null,"y",(d.y+e).toFixed());p.setAttributeNS(null,"width",o);p.setAttributeNS(null,"height",l);p.setAttributeNS(this.xlinkns,"href",t.externalGraphic);p.setAttributeNS(null,"style","opacity: "+a)}else{if(this.isComplexSymbol(t.graphicName)){var c=t.pointRadius*3;var k=c*2;var m=this.importSymbol(t.graphicName);var s="#"+m;d=this.getPosition(p);h=this.symbolSize[m]/k;var f=p.parentNode;var g=p.nextSibling;if(f){f.removeChild(p)}p.setAttributeNS(this.xlinkns,"href",s);p.setAttributeNS(null,"width",k);p.setAttributeNS(null,"height",k);p.setAttributeNS(null,"x",d.x-c);p.setAttributeNS(null,"y",d.y-c);if(g){f.insertBefore(p,g)}else{if(f){f.appendChild(p)}}}else{p.setAttributeNS(null,"r",t.pointRadius)}}}if(typeof t.rotation!="undefined"&&d){var q=OpenLayers.String.format("rotate(${0} ${1} ${2})",[t.rotation,d.x,d.y]);p.setAttributeNS(null,"transform",q)}}if(b.isFilled){p.setAttributeNS(null,"fill",t.fillColor);p.setAttributeNS(null,"fill-opacity",t.fillOpacity)}else{p.setAttributeNS(null,"fill","none")}if(b.isStroked){p.setAttributeNS(null,"stroke",t.strokeColor);p.setAttributeNS(null,"stroke-opacity",t.strokeOpacity);p.setAttributeNS(null,"stroke-width",t.strokeWidth*h);p.setAttributeNS(null,"stroke-linecap",t.strokeLinecap);p.setAttributeNS(null,"stroke-linejoin","round");p.setAttributeNS(null,"stroke-dasharray",this.dashStyle(t,h))}else{p.setAttributeNS(null,"stroke","none")}if(t.pointerEvents){p.setAttributeNS(null,"pointer-events",t.pointerEvents)}if(t.cursor!=null){p.setAttributeNS(null,"cursor",t.cursor)}return p},dashStyle:function(c,b){var a=c.strokeWidth*b;switch(c.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 c.strokeDashstyle.replace(/ /g,",")}},createNode:function(a,c){var b=document.createElementNS(this.xmlns,a);if(c){b.setAttributeNS(null,"id",c)}return b},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(a,b){return this.drawCircle(a,b,1)},drawCircle:function(d,e,b){var c=this.getResolution();var a=(e.x/c+this.left);var f=(this.top-e.y/c);if(this.inValidRange(a,f)){d.setAttributeNS(null,"cx",a);d.setAttributeNS(null,"cy",f);d.setAttributeNS(null,"r",b);return d}else{return false}},drawLineString:function(b,c){var a=this.getComponentsString(c.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawLinearRing:function(b,c){var a=this.getComponentsString(c.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawPolygon:function(b,h){var g="";var k=true;var a=true;var c,l;for(var e=0,f=h.components.length;e<f;e++){g+=" M";c=this.getComponentsString(h.components[e].components," ");l=c.path;if(l){g+=" "+l;a=c.complete&&a}else{k=false}}g+=" z";if(k){b.setAttributeNS(null,"d",g);b.setAttributeNS(null,"fill-rule","evenodd");return a?b:null}else{return false}},drawRectangle:function(c,d){var b=this.getResolution();var a=(d.x/b+this.left);var e=(this.top-d.y/b);if(this.inValidRange(a,e)){c.setAttributeNS(null,"x",a);c.setAttributeNS(null,"y",e);c.setAttributeNS(null,"width",d.width/b);c.setAttributeNS(null,"height",d.height/b);return c}else{return false}},drawSurface:function(f,h){var g=null;var b=true;for(var e=0,a=h.components.length;e<a;e++){if((e%3)==0&&(e/3)==0){var c=this.getShortString(h.components[e]);if(!c){b=false}g="M "+c}else{if((e%3)==1){var c=this.getShortString(h.components[e]);if(!c){b=false}g+=" C "+c}else{var c=this.getShortString(h.components[e]);if(!c){b=false}g+=" "+c}}}g+=" Z";if(b){f.setAttributeNS(null,"d",g);return f}else{return false}},drawText:function(c,a,j){var b=this.getResolution();var h=(j.x/b+this.left);var e=(j.y/b-this.top);var g=this.nodeFactory(c+this.LABEL_ID_SUFFIX,"text");var f=this.nodeFactory(c+this.LABEL_ID_SUFFIX+"_tspan","tspan");g.setAttributeNS(null,"x",h);g.setAttributeNS(null,"y",-e);g.setAttributeNS(null,"pointer-events","none");if(a.fontColor){g.setAttributeNS(null,"fill",a.fontColor)}if(a.fontFamily){g.setAttributeNS(null,"font-family",a.fontFamily)}if(a.fontSize){g.setAttributeNS(null,"font-size",a.fontSize)}if(a.fontWeight){g.setAttributeNS(null,"font-weight",a.fontWeight)}var d=a.labelAlign||"cm";g.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[d[0]]||"middle");if(this.isGecko){g.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[d[1]]||"central")}else{f.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[d[1]]||"-35%")}f.textContent=a.label;if(!g.parentNode){g.appendChild(f);this.textRoot.appendChild(g)}},getComponentsString:function(e,d){var g=[];var a=true;var f=e.length;var l=[];var h,k,b;for(var c=0;c<f;c++){k=e[c];g.push(k);h=this.getShortString(k);if(h){l.push(h)}else{if(c>0){if(this.getShortString(e[c-1])){l.push(this.clipLine(e[c],e[c-1]))}}if(c<f-1){if(this.getShortString(e[c+1])){l.push(this.clipLine(e[c],e[c+1]))}}a=false}}return{path:l.join(d||","),complete:a}},clipLine:function(e,h){if(h.equals(e)){return""}var f=this.getResolution();var b=this.MAX_PIXEL-this.translationParameters.x;var a=this.MAX_PIXEL-this.translationParameters.y;var d=h.x/f+this.left;var l=this.top-h.y/f;var c=e.x/f+this.left;var j=this.top-e.y/f;var g;if(c<-b||c>b){g=(j-l)/(c-d);c=c<0?-b:b;j=l+(c-d)*g}if(j<-a||j>a){g=(c-d)/(j-l);j=j<0?-a:a;c=d+(j-l)*g}return c+","+j},getShortString:function(b){var c=this.getResolution();var a=(b.x/c+this.left);var d=(this.top-b.y/c);if(this.inValidRange(a,d)){return a+","+d}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(e){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+e;if(document.getElementById(b)!=null){return b}var d=OpenLayers.Renderer.symbol[e];if(!d){throw new Error(e+" is not a valid symbol name");return}var g=this.nodeFactory(b,"symbol");var c=this.nodeFactory(null,"polygon");g.appendChild(c);var m=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var k="";var j,h;for(var f=0;f<d.length;f=f+2){j=d[f];h=d[f+1];m.left=Math.min(m.left,j);m.bottom=Math.min(m.bottom,h);m.right=Math.max(m.right,j);m.top=Math.max(m.top,h);k+=" "+j+","+h}c.setAttributeNS(null,"points",k);var a=m.getWidth();var l=m.getHeight();var o=[m.left-a,m.bottom-l,a*3,l*3];g.setAttributeNS(null,"viewBox",o.join(" "));this.symbolSize[b]=Math.max(a,l)*3;this.defs.appendChild(g);return g.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(a){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var b=document.createStyleSheet();b.addRule("olv\\:*","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(j,a){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var c=this.getResolution();var b=j.left/c;var f=j.top/c-this.size.h;if(a){this.offset={x:b,y:f};b=0;f=0}else{b=b-this.offset.x;f=f-this.offset.y}var l=b+" "+f;this.root.setAttribute("coordorigin",l);var h=[this.root,this.vectorRoot,this.textRoot];var g;for(var d=0,e=h.length;d<e;++d){g=h[d];var k=this.size.w+" "+this.size.h;g.setAttribute("coordsize",k)}this.root.style.flip="y";return true},setSize:function(f){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var d=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var c=this.size.w+"px";var g=this.size.h+"px";var b;for(var e=0,a=d.length;e<a;++e){b=d[e];b.style.width=c;b.style.height=g}},getNodeType:function(c,b){var a=null;switch(c.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="olv:rect"}else{if(this.isComplexSymbol(b.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(d,b,r,l){b=b||d._style;r=r||d._options;var j=1;if(d._geometryClass=="OpenLayers.Geometry.Point"){if(b.externalGraphic){if(b.graphicTitle){d.title=b.graphicTitle}var c=b.graphicWidth||b.graphicHeight;var m=b.graphicHeight||b.graphicWidth;c=c?c:b.pointRadius*2;m=m?m:b.pointRadius*2;var f=this.getResolution();var h=(b.graphicXOffset!=undefined)?b.graphicXOffset:-(0.5*c);var e=(b.graphicYOffset!=undefined)?b.graphicYOffset:-(0.5*m);d.style.left=((l.x/f-this.offset.x)+h).toFixed();d.style.top=((l.y/f-this.offset.y)-(e+m)).toFixed();d.style.width=c+"px";d.style.height=m+"px";d.style.flip="y";b.fillColor="none";r.isStroked=false}else{if(this.isComplexSymbol(b.graphicName)){var a=this.importSymbol(b.graphicName);d.setAttribute("path",a.path);d.setAttribute("coordorigin",a.left+","+a.bottom);var q=a.size;d.setAttribute("coordsize",q+","+q);this.drawCircle(d,l,b.pointRadius);d.style.flip="y"}else{this.drawCircle(d,l,b.pointRadius)}}}if(r.isFilled){d.setAttribute("fillcolor",b.fillColor)}else{d.setAttribute("filled","false")}var k=d.getElementsByTagName("fill");var p=(k.length==0)?null:k[0];if(!r.isFilled){if(p){d.removeChild(p)}}else{if(!p){p=this.createNode("olv:fill",d.id+"_fill")}p.setAttribute("opacity",b.fillOpacity);if(d._geometryClass=="OpenLayers.Geometry.Point"&&b.externalGraphic){if(b.graphicOpacity){p.setAttribute("opacity",b.graphicOpacity)}p.setAttribute("src",b.externalGraphic);p.setAttribute("type","frame");if(!(b.graphicWidth&&b.graphicHeight)){p.aspect="atmost"}}if(p.parentNode!=d){d.appendChild(p)}}if(typeof b.rotation!="undefined"){if(b.externalGraphic){this.graphicRotate(d,h,e);p.setAttribute("opacity",0)}else{d.style.rotation=b.rotation}}if(r.isStroked){d.setAttribute("strokecolor",b.strokeColor);d.setAttribute("strokeweight",b.strokeWidth+"px")}else{d.setAttribute("stroked","false")}var g=d.getElementsByTagName("stroke");var o=(g.length==0)?null:g[0];if(!r.isStroked){if(o){d.removeChild(o)}}else{if(!o){o=this.createNode("olv:stroke",d.id+"_stroke");d.appendChild(o)}o.setAttribute("opacity",b.strokeOpacity);o.setAttribute("endcap",!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap);o.setAttribute("dashstyle",this.dashStyle(b))}if(b.cursor!="inherit"&&b.cursor!=null){d.style.cursor=b.cursor}return d},graphicRotate:function(p,t,f){var s=s||p._style;var d=p._options;var a,k;if(!(s.graphicWidth&&s.graphicHeight)){var u=new Image();u.onreadystatechange=OpenLayers.Function.bind(function(){if(u.readyState=="complete"||u.readyState=="interactive"){a=u.width/u.height;k=Math.max(s.pointRadius*2,s.graphicWidth||0,s.graphicHeight||0);t=t*a;s.graphicWidth=k*a;s.graphicHeight=k;this.graphicRotate(p,t,f)}},this);u.src=s.externalGraphic;return}else{k=Math.max(s.graphicWidth,s.graphicHeight);a=s.graphicWidth/s.graphicHeight}var o=Math.round(s.graphicWidth||k*a);var l=Math.round(s.graphicHeight||k);p.style.width=o+"px";p.style.height=l+"px";var m=document.getElementById(p.id+"_image");if(!m){m=this.createNode("olv:imagedata",p.id+"_image");p.appendChild(m)}m.style.width=o+"px";m.style.height=l+"px";m.src=s.externalGraphic;m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var q=s.rotation*Math.PI/180;var h=Math.sin(q);var e=Math.cos(q);var g="progid:DXImageTransform.Microsoft.Matrix(M11="+e+",M12="+(-h)+",M21="+h+",M22="+e+",SizingMethod='auto expand')\n";var b=s.graphicOpacity||s.fillOpacity;if(b&&b!=1){g+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+b+")\n"}p.style.filter=g;var r=new OpenLayers.Geometry.Point(-t,-f);var c=new OpenLayers.Bounds(0,0,o,l).toGeometry();c.rotate(s.rotation,r);var j=c.getBounds();p.style.left=Math.round(parseInt(p.style.left)+j.left)+"px";p.style.top=Math.round(parseInt(p.style.top)-j.bottom)+"px"},postDraw:function(a){var c=a._style.fillColor;var b=a._style.strokeColor;if(c=="none"&&a.getAttribute("fillcolor")!=c){a.setAttribute("fillcolor",c)}if(b=="none"&&a.getAttribute("strokecolor")!=b){a.setAttribute("strokecolor",b)}},setNodeDimension:function(b,e){var d=e.getBounds();if(d){var a=this.getResolution();var c=new OpenLayers.Bounds((d.left/a-this.offset.x).toFixed(),(d.bottom/a-this.offset.y).toFixed(),(d.right/a-this.offset.x).toFixed(),(d.top/a-this.offset.y).toFixed());b.style.left=c.left+"px";b.style.top=c.top+"px";b.style.width=c.getWidth()+"px";b.style.height=c.getHeight()+"px";b.coordorigin=c.left+" "+c.top;b.coordsize=c.getWidth()+" "+c.getHeight()}},dashStyle:function(a){var c=a.strokeDashstyle;switch(c){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return c;default:var b=c.split(/[ ,]/);if(b.length==2){if(1*b[0]>=2*b[1]){return"longdash"}return(b[0]==1||b[1]==1)?"dot":"dash"}else{if(b.length==4){return(1*b[0]>=2*b[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(a,c){var b=document.createElement(a);if(c){b.setAttribute("id",c)}b.setAttribute("unselectable","on",0);b.onselectstart=function(){return(false)};return b},nodeTypeCompare:function(c,b){var d=b;var a=d.indexOf(":");if(a!=-1){d=d.substr(a+1)}var e=c.nodeName;a=e.indexOf(":");if(a!=-1){e=e.substr(a+1)}return(d==e)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"olv:group")},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(d,e,a){if(!isNaN(e.x)&&!isNaN(e.y)){var b=this.getResolution();d.style.left=((e.x/b-this.offset.x).toFixed()-a)+"px";d.style.top=((e.y/b-this.offset.y).toFixed()-a)+"px";var c=a*2;d.style.width=c+"px";d.style.height=c+"px";return d}return false},drawLineString:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(b,k,g){this.setNodeDimension(b,k);var c=this.getResolution();var a=k.components.length;var e=new Array(a);var h,l,j;for(var f=0;f<a;f++){h=k.components[f];l=(h.x/c-this.offset.x);j=(h.y/c-this.offset.y);e[f]=" "+l.toFixed()+","+j.toFixed()+" l "}var d=(g)?" x e":" e";b.path="m"+e.join("")+d;return b},drawPolygon:function(b,l){this.setNodeDimension(b,l);var c=this.getResolution();var o=[];var f,e,d,h,a,g,m,k;for(d=0,h=l.components.length;d<h;d++){f=l.components[d];o.push("m");for(e=0,a=f.components.length;e<a;e++){g=f.components[e];m=g.x/c-this.offset.x;k=g.y/c-this.offset.y;o.push(" "+m.toFixed()+","+k.toFixed());if(e==0){o.push(" l")}}o.push(" x ")}o.push("e");b.path=o.join("");return b},drawRectangle:function(b,c){var a=this.getResolution();b.style.left=(c.x/a-this.offset.x)+"px";b.style.top=(c.y/a-this.offset.y)+"px";b.style.width=c.width/a+"px";b.style.height=c.height/a+"px";return b},drawText:function(d,a,h){var g=this.nodeFactory(d+this.LABEL_ID_SUFFIX,"olv:rect");var f=this.nodeFactory(d+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var c=this.getResolution();g.style.left=(h.x/c-this.offset.x).toFixed()+"px";g.style.top=(h.y/c-this.offset.y).toFixed()+"px";g.style.flip="y";f.innerText=a.label;if(a.fillColor){f.style.color=a.fontColor}if(a.fontFamily){f.style.fontFamily=a.fontFamily}if(a.fontSize){f.style.fontSize=a.fontSize}if(a.fontWeight){f.style.fontWeight=a.fontWeight}f.style.whiteSpace="nowrap";f.inset="0px,0px,0px,0px";if(!g.parentNode){g.appendChild(f);this.textRoot.appendChild(g)}var e=a.labelAlign||"cm";var j=f.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[e.substr(0,1)]);var b=f.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[e.substr(1,1)]);g.style.left=parseInt(g.style.left)-j+"px";g.style.top=parseInt(g.style.top)+b+"px"},drawSurface:function(a,g){this.setNodeDimension(a,g);var b=this.getResolution();var j=[];var d,h,f;for(var c=0,e=g.components.length;c<e;c++){d=g.components[c];h=d.x/b-this.offset.x;f=d.y/b-this.offset.y;if((c%3)==0&&(c/3)==0){j.push("m")}else{if((c%3)==1){j.push(" c")}}j.push(" "+h+","+f)}j.push(" x e");a.path=j.join("");return a},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(d){var b=this.container.id+"-"+d;var a=this.symbolCache[b];if(a){return a}var c=OpenLayers.Renderer.symbol[d];if(!c){throw new Error(d+" is not a valid symbol name");return}var h=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var e=["m"];for(var f=0;f<c.length;f=f+2){x=c[f];y=c[f+1];h.left=Math.min(h.left,x);h.bottom=Math.min(h.bottom,y);h.right=Math.max(h.right,x);h.top=Math.max(h.top,y);e.push(x);e.push(y);if(f==0){e.push("l")}}e.push("x e");var j=e.join(" ");var g=(h.getWidth()-h.getHeight())/2;if(g>0){h.bottom=h.bottom-g;h.top=h.top+g}else{h.left=h.left-g;h.right=h.right+g}a={path:j,size:h.getWidth(),left:h.left,bottom:h.bottom};this.symbolCache[b]=a;return a},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(d,a,e,b,c){this.layer=d;this.position=a.clone();this.bounds=e.clone();this.url=b;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(b,a,c){if(c==null){c=true}this.bounds=b.clone();this.position=a.clone();if(c){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(a){var f=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(f);var d=this.layer.map.getLonLatFromLayerPx(a);var c=a.clone();c.x+=this.size.w;c.y+=this.size.h;var b=this.layer.map.getLonLatFromLayerPx(c);if(d.lon>b.lon){if(d.lon<0){d.lon=-180-(d.lon+180)}else{b.lon=180+b.lon+180}}var e=new OpenLayers.Bounds(d.lon,b.lat,b.lon,d.lat);return e},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.LayerSwitcherSG=OpenLayers.Class(OpenLayers.Control.LayerSwitcher,{loadContents:function(){OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);this.layersDiv=document.createElement("div");this.layersDiv.id=this.id+"_layersDiv";this.baseLbl=document.createElement("div");this.baseLbl.id=this.id+"_bases_desc";this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");this.baseLayersDiv=document.createElement("div");this.baseLayersDiv.className=this.id+"_layersDivList";this.dataLbl=document.createElement("div");this.dataLbl.id=this.id+"_overlays_desc";this.dataLbl.innerHTML=OpenLayers.i18n("overlays");this.dataLayersDiv=document.createElement("div");this.dataLayersDiv.id=this.id+"_dataLayersDiv";this.dataLayersDiv.className=this.id+"_layersDivList";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)},onInputClick:function(a){if(!this.inputElem.disabled){if(this.inputElem.type=="radio"){this.inputElem.checked=true;this.layer.map.setBaseLayer(this.layer)}else{if(a.ctrlKey==true){var b=!this.inputElem.checked;for(i=0;i<this.layerSwitcher.dataLayers.length;i++){this.layerSwitcher.dataLayers[i].layer.setVisibility(b)}}else{this.inputElem.checked=!this.inputElem.checked}this.layerSwitcher.updateMap()}}OpenLayers.Event.stop(a)},CLASS_NAME:"OpenLayers.Control.LayerSwitcherSG"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);if(a){this.position=a}if(b){this.direction=b}this.measureDivs=[]},destroy:function(){for(var b in this.buttons){var a=this.buttons[b];a.map=null;a.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,e,d,j,g,h){var f=OpenLayers.Util.getImagesLocation()+e;var c=OpenLayers.Util.getImagesLocation()+d;var b=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+a,j,g,f,"absolute");this.div.appendChild(b);b.imgLocation=f;b.activeImgLocation=c;b.events=new OpenLayers.Events(this,b,null,true);b.events.on({mousedown:this.buttonDown,mouseup:this.buttonUp,dblclick:OpenLayers.Event.stop,scope:this});b.action=a;b.title=h;b.alt=h;b.map=this.map;this.buttons[a]=b;return b},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(b){this.switchModeTo("pan");this.performedDrag=false;var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);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 c="";if(this.measureStart){var b=this.map.getLonLatFromViewPortPx(this.mouseDragStart);c=OpenLayers.Util.distVincenty(this.measureStart,b);c=Math.round(c*100)/100;c=c+"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(c){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=c;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(e){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var d=Math.abs(this.mouseDragStart.x-e.xy.x);var b=Math.abs(this.mouseDragStart.y-e.xy.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(e.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=e.xy.x+"px"}if(e.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=e.xy.y+"px"}break;default:var d=this.mouseDragStart.x-e.xy.x;var b=this.mouseDragStart.y-e.xy.y;var f=this.map.getSize();var a=new OpenLayers.Pixel(f.w/2+d,f.h/2+b);var c=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(c,null,true);this.mouseDragStart=e.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(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.registry=OpenLayers.Util.extend({moveend:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution()}}},this.registry);this.clear();var b={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(b,this.previousOptions);this.previous=new OpenLayers.Control.Button(b);var c={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(c,this.nextOptions);this.next=new OpenLayers.Control.Button(c)},onPreviousChange:function(b,a){if(b&&!this.previous.active){this.previous.activate()}else{if(!b&&this.previous.active){this.previous.deactivate()}}},onNextChange:function(b,a){if(b&&!this.next.active){this.next.activate()}else{if(!b&&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(b){var a=this.map.getZoomForResolution(b.resolution);this.map.setCenter(b.center,a)},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(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position.clone();this.buttons=[];var d=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+d.w/2,b.y);var c=d.w;if(this.zoomWorldIcon){a=new OpenLayers.Pixel(b.x+d.w,b.y)}this._addButton("panup","north-mini.png",a,d);b.y=a.y+d.h;this._addButton("panleft","west-mini.png",b,d);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",b.add(d.w,0),d);c*=2}this._addButton("panright","east-mini.png",b.add(c,0),d);this._addButton("pandown","south-mini.png",a.add(0,d.h*2),d);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,d.h*3+5),d);a=this._addZoomBar(a.add(0,d.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",a,d);return this.div},_addZoomBar:function(a){var e=OpenLayers.Util.getImagesLocation();var g=this.id+"_"+this.map.id;var b=this.map.getNumZoomLevels()-1-this.map.getZoom();var c=OpenLayers.Util.createAlphaImageDiv(g,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),e+"slider.png","absolute");this.slider=c;this.sliderEvents=new OpenLayers.Events(this,c,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var d=new OpenLayers.Size();d.h=this.zoomStopHeight*this.map.getNumZoomLevels();d.w=this.zoomStopWidth;var f=null;if(OpenLayers.Util.alphaHack()){var g=this.id+"_"+this.map.id;f=OpenLayers.Util.createAlphaImageDiv(g,a,new OpenLayers.Size(d.w,this.zoomStopHeight),e+"zoombar.png","absolute",null,"crop");f.style.height=d.h+"px"}else{f=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,d,e+"zoombar.png")}this.zoombarDiv=f;this.divEvents=new OpenLayers.Events(this,f,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(f);this.startTop=parseInt(f.style.top);this.div.appendChild(c);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return a},_removeZoomBar:function(){this.sliderEvents.un({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});this.sliderEvents.destroy();this.divEvents.un({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.divEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.map.events.unregister("zoomend",this,this.moveZoomBar)},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var e=a.xy.y;var d=OpenLayers.Util.pagePosition(a.object)[1];var c=(e-d)/this.zoomStopHeight;if(!this.map.fractionalZoom){c=Math.floor(c)}var b=(this.map.getNumZoomLevels()-1)-c;b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(b);OpenLayers.Event.stop(a)},zoomBarDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(a)},zoomBarDrag:function(b){if(this.mouseDragStart!=null){var a=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 c=parseInt(this.slider.style.top)-a;this.slider.style.top=c+"px";this.mouseDragStart=b.xy.clone()}OpenLayers.Event.stop(b)}},zoomBarUp:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}if(this.zoomStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var a=this.zoomStart.y-b.xy.y;var c=this.map.zoom;if(this.map.fractionalZoom){c+=a/this.zoomStopHeight;c=Math.min(Math.max(c,0),this.map.getNumZoomLevels()-1)}else{c+=Math.round(a/this.zoomStopHeight)}this.map.zoomTo(c);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(b)}},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,c,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b);this.base=c||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 b=0,a=this.map.controls.length;b<a;b++){var c=this.map.controls[b];if(c.CLASS_NAME==this.argParserClass.CLASS_NAME){if(c.displayProjection!=this.displayProjection){this.displayProjection=c.displayProjection}break}}if(b==this.map.controls.length){this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.className=this.displayClass;this.element=document.createElement("a");this.element.innerHTML=OpenLayers.i18n("permalink");this.element.href="";this.div.appendChild(this.element)}this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this});this.updateLink();return this.div},updateLink:function(){var a=this.base;if(a.indexOf("?")!=-1){a=a.substring(0,a.indexOf("?"))}a+="?"+OpenLayers.Util.getParameterString(this.createParams());this.element.href=a},createParams:function(a,k,e){a=a||this.map.getCenter();var d=OpenLayers.Util.getParameters(this.base);if(a){d.zoom=k||this.map.getZoom();var j=a.lat;var b=a.lon;if(this.displayProjection){var c=OpenLayers.Projection.transform({x:b,y:j},this.map.getProjectionObject(),this.displayProjection);b=c.x;j=c.y}d.lat=Math.round(j*100000)/100000;d.lon=Math.round(b*100000)/100000;e=e||this.map.layers;d.layers="";for(var f=0,h=e.length;f<h;f++){var g=e[f];if(g.isBaseLayer){d.layers+=(g==this.map.baseLayer)?"B":"0"}else{d.layers+=(g.getVisibility())?"T":"F"}}}return d},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(e,c){this.pretty=!!c;var a=null;var b=typeof e;if(this.serialize[b]){try{a=this.serialize[b].apply(this,[e])}catch(d){OpenLayers.Console.error("Trouble serializing: "+d)}}return a},writeIndent:function(){var b=[];if(this.pretty){for(var a=0;a<this.level;++a){b.push(this.indent)}}return b.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{object:function(c){if(c==null){return"null"}if(c.constructor==Date){return this.serialize.date.apply(this,[c])}if(c.constructor==Array){return this.serialize.array.apply(this,[c])}var f=["{"];this.level+=1;var d,b,e;var a=false;for(d in c){if(c.hasOwnProperty(d)){b=OpenLayers.Format.JSON.prototype.write.apply(this,[d,this.pretty]);e=OpenLayers.Format.JSON.prototype.write.apply(this,[c[d],this.pretty]);if(b!=null&&e!=null){if(a){f.push(",")}f.push(this.writeNewline(),this.writeIndent(),b,":",this.writeSpace(),e);a=true}}}this.level-=1;f.push(this.writeNewline(),this.writeIndent(),"}");return f.join("")},array:function(e){var c;var d=["["];this.level+=1;for(var b=0,a=e.length;b<a;++b){c=OpenLayers.Format.JSON.prototype.write.apply(this,[e[b],this.pretty]);if(c!=null){if(b>0){d.push(",")}d.push(this.writeNewline(),this.writeIndent(),c)}}this.level-=1;d.push(this.writeNewline(),this.writeIndent(),"]");return d.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(e,d){var f=a[d];if(f){return f}f=d.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(a){function b(c){return(c<10)?"0"+c:c}return'"'+a.getFullYear()+"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.WFST=function(b){b=OpenLayers.Util.applyDefaults(b,OpenLayers.Format.WFST.DEFAULTS);var a=OpenLayers.Format.WFST["v"+b.version.replace(/\./g,"_")];if(!a){throw"Unsupported WFST version: "+b.version}return new a(b)};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(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var c=e.documentElement;var b=this.version||c.getAttribute("version")||this.defaultVersion;if(!this.parser||this.parser.version!==b){var d=OpenLayers.Format.WMSCapabilities["v"+b.replace(/\./g,"_")];if(!d){throw"Can't find a WMS capabilities parser for version "+b}var f=new d(this.options)}var a=f.read(e);a.version=b;return a},CLASS_NAME:"OpenLayers.Format.WMSCapabilities"});OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(a){if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}OpenLayers.Format.prototype.initialize.apply(this,[a]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var b in this.namespaces){this.namespaceAlias[this.namespaces[b]]=b}},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 a=c.indexOf("<");if(a>0){c=c.substring(a)}var b=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=b}return b},write:function(b){var c;if(this.xmldom){c=b.xml}else{var a=new XMLSerializer();if(b.nodeType==1){var d=document.implementation.createDocument("","",null);if(d.importNode){b=d.importNode(b,true)}d.appendChild(b);c=a.serializeToString(d)}else{c=a.serializeToString(b)}}return c},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(e,d,c){var a=[];if(e.getElementsByTagNameNS){a=e.getElementsByTagNameNS(d,c)}else{var b=e.getElementsByTagName("*");var j,f;for(var g=0,h=b.length;g<h;++g){j=b[g];f=(j.prefix)?(j.prefix+":"+c):c;if((c=="*")||(f==j.nodeName)){if((d=="*")||(d==j.namespaceURI)){a.push(j)}}}}return a},getAttributeNodeNS:function(c,b,a){var j=null;if(c.getAttributeNodeNS){j=c.getAttributeNodeNS(b,a)}else{var e=c.attributes;var h,d;for(var f=0,g=e.length;f<g;++f){h=e[f];if(h.namespaceURI==b){d=(h.prefix)?(h.prefix+":"+a):a;if(d==h.nodeName){j=h;break}}}}return j},getAttributeNS:function(e,d,a){var b="";if(e.getAttributeNS){b=e.getAttributeNS(d,a)||""}else{var c=this.getAttributeNodeNS(e,d,a);if(c){b=c.nodeValue}}return b},getChildValue:function(a,c){var b=c||"";if(a){for(var d=a.firstChild;d;d=d.nextSibling){switch(d.nodeType){case 3:case 4:b+=d.nodeValue}}}return b},concatChildValues:function(b,d){var c="";var e=b.firstChild;var a;while(e){a=e.nodeValue;if(a){c+=a}e=e.nextSibling}if(c==""&&d!=undefined){c=d}return c},isSimpleContent:function(a){var c=true;for(var b=a.firstChild;b;b=b.nextSibling){if(b.nodeType===1){c=false;break}}return c},contentType:function(c){var e=false,b=false;var a=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var d=c.firstChild;d;d=d.nextSibling){switch(d.nodeType){case 1:b=true;break;case 8:break;default:e=true}if(b&&e){break}}if(b&&e){a=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(b){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(e){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return a},hasAttributeNS:function(c,b,a){var d=false;if(c.hasAttributeNS){d=c.hasAttributeNS(b,a)}else{d=!!this.getAttributeNodeNS(c,b,a)}return d},setAttributeNS:function(d,c,a,e){if(d.setAttributeNS){d.setAttributeNS(c,a,e)}else{if(this.xmldom){if(c){var b=d.ownerDocument.createNode(2,a,c);b.nodeValue=e;d.setAttributeNode(b)}else{d.setAttribute(a,e)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(b,a){a=a||{};var d=a.uri||this.namespaces[a.prefix];if(!d){var f=b.indexOf(":");d=this.namespaces[b.substring(0,f)]}if(!d){d=this.namespaces[this.defaultPrefix]}var c=this.createElementNS(d,b);if(a.attributes){this.setAttributes(c,a.attributes)}var e=a.value;if(e!=null){if(typeof e=="boolean"){e=String(e)}c.appendChild(this.createTextNode(e))}return c},setAttributes:function(c,e){var d,b;for(var a in e){if(e[a]!=null&&e[a].toString){d=e[a].toString();b=this.namespaces[a.substring(0,a.indexOf(":"))]||null;this.setAttributeNS(c,b,a,d)}}},readNode:function(c,e){if(!e){e={}}var d=this.readers[this.namespaceAlias[c.namespaceURI]];if(d){var b=c.localName||c.nodeName.split(":").pop();var a=d[b]||d["*"];if(a){a.apply(this,[c,e])}}return e},readChildNodes:function(d,e){if(!e){e={}}var c=d.childNodes;var f;for(var b=0,a=c.length;b<a;++b){f=c[b];if(f.nodeType==1){this.readNode(f,e)}}return e},writeNode:function(a,f,d){var e,c;var b=a.indexOf(":");if(b>0){e=a.substring(0,b);c=a.substring(b+1)}else{if(d){e=this.namespaceAlias[d.namespaceURI]}else{e=this.defaultPrefix}c=a}var g=this.writers[e][c].apply(this,[f]);if(d){d.appendChild(g)}return g},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,c){outer:for(var b=d;b;b=b.nextSibling){switch(b.nodeType){case 1:if((!a||a===(b.localName||b.nodeName.split(":").pop()))&&(!c||c===b.namespaceURI)){break outer}b=null;break outer;case 3:if(/^\s*$/.test(b.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:b=null;break outer}}return b||null},lookupNamespaceURI:function(e,f){var d=null;if(e){if(e.lookupNamespaceURI){d=e.lookupNamespaceURI(f)}else{outer:switch(e.nodeType){case 1:if(e.namespaceURI!==null&&e.prefix===f){d=e.namespaceURI;break outer}var b=e.attributes.length;if(b){var a;for(var c=0;c<b;++c){a=e.attributes[c];if(a.prefix==="xmlns"&&a.name==="xmlns:"+f){d=a.value||null;break outer}else{if(a.name==="xmlns"&&f===null){d=a.value||null;break outer}}}}d=this.lookupNamespaceURI(e.parentNode,f);break outer;case 2:d=this.lookupNamespaceURI(e.ownerElement,f);break outer;case 9:d=this.lookupNamespaceURI(e.documentElement,f);break outer;case 6:case 12:case 10:case 11:break outer;default:d=this.lookupNamespaceURI(e.parentNode,f);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(c,b,a){OpenLayers.Util.extend(this,a);this.control=c;this.callbacks=b;if(c.map){this.setMap(c.map)}OpenLayers.Util.extend(this,a);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 c=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=c.length;b<a;b++){if(this[c[b]]){this.register(c[b],this[c[b]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var c=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=c.length;b<a;b++){if(this[c[b]]){this.unregister(c[b],this[c[b]])}}this.active=false;return true},callback:function(b,a){if(b&&this.callbacks[b]){this.callbacks[b].apply(this.control,a)}},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(h,d){if(arguments.length===1&&typeof h==="object"){d=h;h=d&&d.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,d);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(h);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 g=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(g,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);g=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(g);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 f=true;var c=document.getElementsByTagName("link");for(var e=0,a=c.length;e<a;++e){if(OpenLayers.Util.isEquivalentUrl(c.item(e).href,this.theme)){f=false;break}}if(f){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(b)}}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 e=0,a=this.controls.length;e<a;e++){this.addControlToMap(this.controls[e])}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,c,a){var d=(typeof a.test=="function");var b=OpenLayers.Array.filter(this[e],function(f){return f[c]==a||(d&&a.test(f[c]))});return b},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(b,a){b.setZIndex(this.Z_INDEX_BASE[b.isBaseLayer?"BaseLayer":"Overlay"]+a*5)},resetLayersZIndex:function(){for(var c=0,a=this.layers.length;c<a;c++){var b=this.layers[c];this.setLayerZIndex(b,c)}},addLayer:function(c){for(var b=0,a=this.layers.length;b<a;b++){if(this.layers[b]==c){var d=OpenLayers.i18n("layerAlreadyAdded",{layerName:c.name});OpenLayers.Console.warn(d);return false}}if(this.allOverlays){c.isBaseLayer=false}this.events.triggerEvent("preaddlayer",{layer:c});c.div.className="olLayerDiv";c.div.style.overflow="";this.setLayerZIndex(c,this.layers.length);if(c.isFixed){this.viewPortDiv.appendChild(c.div)}else{this.layerContainerDiv.appendChild(c.div)}this.layers.push(c);c.setMap(this);if(c.isBaseLayer||(this.allOverlays&&!this.baseLayer)){if(this.baseLayer==null){this.setBaseLayer(c)}else{c.setVisibility(false)}}else{c.redraw()}this.events.triggerEvent("addlayer",{layer:c});c.afterAdd()},addLayers:function(c){for(var b=0,a=c.length;b<a;b++){this.addLayer(c[b])}},removeLayer:function(c,e){if(e==null){e=true}if(c.isFixed){this.viewPortDiv.removeChild(c.div)}else{this.layerContainerDiv.removeChild(c.div)}OpenLayers.Util.removeItem(this.layers,c);c.removeMap(this);c.map=null;if(this.baseLayer==c){this.baseLayer=null;if(e){for(var b=0,a=this.layers.length;b<a;b++){var d=this.layers[b];if(d.isBaseLayer||this.allOverlays){this.setBaseLayer(d);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:c})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(d,b){var e=this.getLayerIndex(d);if(b<0){b=0}else{if(b>this.layers.length){b=this.layers.length}}if(e!=b){this.layers.splice(e,1);this.layers.splice(b,0,d);for(var c=0,a=this.layers.length;c<a;c++){this.setLayerZIndex(this.layers[c],c)}this.events.triggerEvent("changelayer",{layer:d,property:"order"});if(this.allOverlays){if(b===0){this.setBaseLayer(d)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(b,c){var a=this.getLayerIndex(b)+c;this.setLayerIndex(b,a)},setBaseLayer:function(e){var d=null;if(this.baseLayer){d=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 a=this.getCenter();if(a!=null){var b=(d)?d.getCenterLonLat():a;var c=(d)?this.getZoomForExtent(d,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(b,a){b.outsideViewport=(b.div!=null);if(this.displayProjection&&!b.displayProjection){b.displayProjection=this.displayProjection}b.setMap(this);var c=b.draw(a);if(c){if(!b.outsideViewport){c.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(c)}}},getControl:function(e){var b=null;for(var c=0,a=this.controls.length;c<a;c++){var d=this.controls[c];if(d.id==e){b=d;break}}return b},removeControl:function(a){if((a)&&(a==this.getControl(a.id))){if(a.div&&(a.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.controls,a)}},addPopup:function(a,d){if(d){for(var b=this.popups.length-1;b>=0;--b){this.removePopup(this.popups[b])}}a.map=this;this.popups.push(a);var c=a.draw();if(c){c.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(c)}},removePopup:function(a){OpenLayers.Util.removeItem(this.popups,a);if(a.div){try{this.layerContainerDiv.removeChild(a.div)}catch(b){}}a.map=null},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},updateSize:function(){this.events.clearMouseCache();var c=this.getCurrentSize();var f=this.getSize();if(f==null){this.size=f=c}if(!c.equals(f)){this.size=c;for(var d=0,b=this.layers.length;d<b;d++){this.layers[d].onMapResize()}if(this.baseLayer!=null){var a=new OpenLayers.Pixel(c.w/2,c.h/2);var g=this.getLonLatFromViewPortPx(a);var e=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),e)}}},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(a,b){var e=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if((a!=null)&&(b!=null)){var d=this.getSize();var f=d.w*b;var c=d.h*b;e=new OpenLayers.Bounds(a.lon-f/2,a.lat-c/2,a.lon+f/2,a.lat+c/2)}return e},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getZoom:function(){return this.zoom},pan:function(d,c,e){e=OpenLayers.Util.applyDefaults(e,{animate:true,dragging:false});var f=this.getViewPortPxFromLonLat(this.getCenter());var b=f.add(d,c);if(!e.dragging||!b.equals(f)){var a=this.getLonLatFromViewPortPx(b);if(e.animate){this.panTo(a)}else{this.setCenter(a,null,e.dragging)}}},panTo:function(b){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(b)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var a=this.getCenter();if(b.lon==a.lon&&b.lat==a.lat){return}var d={lon:a.lon,lat:a.lat};var c={lon:b.lon,lat:b.lat};this.panTween.start(d,c,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(b)}},setCenter:function(c,a,b,d){this.moveTo(c,a,{dragging:b,forceZoomChange:d,caller:"setCenter"})},moveTo:function(g,o,r){if(!r){r={}}var m=r.dragging;var c=r.forceZoomChange;var h=r.noEvent;if(this.panTween&&r.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(o==null){o=this.getZoom()}var d=this.getResolutionForZoom(o);var p=this.calculateBounds(g,d);if(!this.restrictedExtent.containsBounds(p)){var q=this.restrictedExtent.getCenterLonLat();if(p.getWidth()>this.restrictedExtent.getWidth()){g=new OpenLayers.LonLat(q.lon,g.lat)}else{if(p.left<this.restrictedExtent.left){g=g.add(this.restrictedExtent.left-p.left,0)}else{if(p.right>this.restrictedExtent.right){g=g.add(this.restrictedExtent.right-p.right,0)}}}if(p.getHeight()>this.restrictedExtent.getHeight()){g=new OpenLayers.LonLat(g.lon,q.lat)}else{if(p.bottom<this.restrictedExtent.bottom){g=g.add(0,this.restrictedExtent.bottom-p.bottom)}else{if(p.top>this.restrictedExtent.top){g=g.add(0,this.restrictedExtent.top-p.top)}}}}}var b=c||((this.isValidZoomLevel(o))&&(o!=this.getZoom()));var e=(this.isValidLonLat(g))&&(!g.equals(this.center));if(b||e||!m){if(!this.dragging&&!h){this.events.triggerEvent("movestart")}if(e){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=o;this.resolution=this.getResolutionForZoom(o);this.viewRequestID++}var a=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(a,b,m);if(m){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:b})}}a=this.baseLayer.getExtent();for(var f=0,k=this.layers.length;f<k;f++){var j=this.layers[f];if(j!==this.baseLayer&&!j.isBaseLayer){var l=j.calculateInRange();if(j.inRange!=l){j.inRange=l;if(!l){j.display(false)}this.events.triggerEvent("changelayer",{layer:j,property:"visibility"})}if(l&&j.visibility){j.moveTo(a,b,m);if(m){j.events.triggerEvent("move")}else{j.events.triggerEvent("moveend",{zoomChanged:b})}}}}if(b){for(var f=0,k=this.popups.length;f<k;f++){this.popups[f].updatePosition()}}this.events.triggerEvent("move");if(b){this.events.triggerEvent("zoomend")}}if(!m&&!h){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(c){var b=false;if(c!=null){var a=this.getMaxExtent();b=a.containsLonLat(c)}return b},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode():null},getProjectionObject:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.projection}return a},getMaxResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.maxResolution}return a},getMaxExtent:function(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(c,b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getZoomForExtent(c,b)}return a},getResolutionForZoom:function(b){var a=null;if(this.baseLayer){a=this.baseLayer.getResolutionForZoom(b)}return a},getZoomForResolution:function(a,c){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getZoomForResolution(a,c)}return b},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(d,c){var b=d.getCenterLonLat();if(this.baseLayer.wrapDateLine){var a=this.getMaxExtent();d=d.clone();while(d.right<d.left){d.right+=a.getWidth()}b=d.getCenterLonLat().wrapDateLine(a)}this.setCenter(b,this.getZoomForExtent(d,c))},zoomToMaxExtent:function(c){var b=(c)?c.restricted:true;var a=this.getMaxExtent({restricted:b});this.zoomToExtent(a)},zoomToScale:function(h,g){var d=OpenLayers.Util.getResolutionFromScale(h,this.baseLayer.units);var c=this.getSize();var f=c.w*d;var b=c.h*d;var a=this.getCenter();var e=new OpenLayers.Bounds(a.lon-f/2,a.lat-b/2,a.lon+f/2,a.lat+b/2);this.zoomToExtent(e,g)},getLonLatFromViewPortPx:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getLonLatFromViewPortPx(a)}return b},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 c=null;if(d!=null){var b=parseInt(this.layerContainerDiv.style.left);var a=parseInt(this.layerContainerDiv.style.top);c=d.add(b,a)}return c},getLayerPxFromViewPortPx:function(c){var d=null;if(c!=null){var b=-parseInt(this.layerContainerDiv.style.left);var a=-parseInt(this.layerContainerDiv.style.top);d=c.add(b,a);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(b){if(this.icon){var a=new OpenLayers.Size(this.icon.size.w*b,this.icon.size.h*b);this.icon.setSize(a)}},setOpacity:function(a){this.icon.setOpacity(a)},setUrl:function(a){this.icon.setUrl(a)},display:function(a){this.icon.display(a)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var a=OpenLayers.Util.getImagesLocation()+"marker.png";var b=new OpenLayers.Size(21,25);var c=function(d){return new OpenLayers.Pixel(-(d.w/2),-d.h)};return new OpenLayers.Icon(a,b,null,c)};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(g,c,f,b,a,e,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(d){var g=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});d=OpenLayers.Util.applyDefaults(d,g);var f=new OpenLayers.Request.XMLHttpRequest();var a=d.url;if(d.params){var e=OpenLayers.Util.getParameterString(d.params);if(e.length>0){var j=(a.indexOf("?")>-1)?"&":"?";a+=j+e}}if(d.proxy&&(a.indexOf("http")==0)){a=d.proxy+encodeURIComponent(a)}f.open(d.method,a,d.async,d.user,d.password);for(var h in d.headers){f.setRequestHeader(h,d.headers[h])}var b=(d.scope)?OpenLayers.Function.bind(d.callback,d.scope):d.callback;var k;if(d.success){k=(d.scope)?OpenLayers.Function.bind(d.success,d.scope):d.success}var c;if(d.failure){c=(d.scope)?OpenLayers.Function.bind(d.failure,d.scope):d.failure}var l=this.events;f.onreadystatechange=function(){if(f.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var m=l.triggerEvent("complete",{request:f,config:d,requestUrl:a});if(m!==false){b(f);if(!f.status||(f.status>=200&&f.status<300)){l.triggerEvent("success",{request:f,config:d,requestUrl:a});if(k){k(f)}}if(f.status&&(f.status<200||f.status>=300)){l.triggerEvent("failure",{request:f,config:d,requestUrl:a});if(c){c(f)}}}}};if(d.async===false){f.send(d.data)}else{window.setTimeout(function(){f.send(d.data)},0)}return f},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(d,a,e,b,c){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;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 b=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,d,b,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,d,b,null,"relative",null,null,true)}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var c=function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("loadend")}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(c,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(c,this))}var a=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){c.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(a,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 d=1;if(this.backBufferTile.resolution){d=this.backBufferTile.resolution/this.layer.getResolution()}if(d!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var c=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var b=new OpenLayers.Size(this.backBufferTile.size.w*d,this.backBufferTile.size.h*d);var a=this.layer.map.getLayerPxFromLonLat(c);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);var e=this.backBufferTile.imageSize;e=new OpenLayers.Size(e.w*d,e.h*d);var f=this.backBufferTile.imageOffset;if(f){f=new OpenLayers.Pixel(f.x*d,f.y*d)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,f,e);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=d},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 d=this.map.baseLayer.clone();this.layers=[d]}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 b=e+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),b,"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 b=e+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),b,"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 f=["dblclick","mousedown"];for(var c=0,a=f.length;c<a;c++){OpenLayers.Event.observe(this.maximizeDiv,f[c],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,f[c],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(j){var d=this.handlers.drag.last.x-j.x;var b=this.handlers.drag.last.y-j.y;if(d!=0||b!=0){var g=this.rectPxBounds.top;var a=this.rectPxBounds.left;var e=Math.abs(this.rectPxBounds.getHeight());var c=this.rectPxBounds.getWidth();var f=Math.max(0,(g-b));f=Math.min(f,this.ovmap.size.h-this.hComp-e);var h=Math.max(0,(a-d));h=Math.min(h,this.ovmap.size.w-this.wComp-c);this.setRectPxBounds(new OpenLayers.Bounds(h,f+e,h+c,f))}},mapDivClick:function(j){var b=this.rectPxBounds.getCenterPixel();var e=j.xy.x-b.x;var d=j.xy.y-b.y;var g=this.rectPxBounds.top;var c=this.rectPxBounds.left;var k=Math.abs(this.rectPxBounds.getHeight());var a=this.rectPxBounds.getWidth();var f=Math.max(0,(g+d));f=Math.min(f,this.ovmap.size.h-k);var h=Math.max(0,(c+e));h=Math.min(h,this.ovmap.size.w-a);this.setRectPxBounds(new OpenLayers.Bounds(h,f+k,h+a,f));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 a=this.map.maxExtent;var c=new OpenLayers.Bounds(Math.max(b.left,a.left),Math.max(b.bottom,a.bottom),Math.min(b.right,a.right),Math.min(b.top,a.top));if(this.ovmap.getProjection()!=this.map.getProjection()){c=c.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var d=this.ovmap.getResolution()/this.map.getResolution();return((d>this.minRatio)&&(d<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(c)))},updateOverview:function(){var c=this.map.getResolution();var b=this.ovmap.getResolution();var d=b/c;if(d>this.maxRatio){b=this.minRatio*c}else{if(d<=this.minRatio){b=this.maxRatio*c}}var a;if(this.ovmap.getProjection()!=this.map.getProjection()){a=this.map.center.clone();a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{a=this.map.center}this.ovmap.setCenter(a,this.ovmap.getZoomForResolution(b*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var b=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,b);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 c=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=c&&a?OpenLayers.INCHES_PER_UNIT[c]/OpenLayers.INCHES_PER_UNIT[a]:1}},updateRectToMap:function(){var b;if(this.ovmap.getProjection()!=this.map.getProjection()){b=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{b=this.map.getExtent()}var a=this.getRectBoundsFromMapBounds(b);if(a){this.setRectPxBounds(a)}},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(d){var g=Math.max(d.top,0);var e=Math.max(d.left,0);var b=Math.min(d.top+Math.abs(d.getHeight()),this.ovmap.size.h-this.hComp);var h=Math.min(d.left+d.getWidth(),this.ovmap.size.w-this.wComp);var c=Math.max(h-e,0);var j=Math.max(b-g,0);if(c<this.minRectSize||j<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var f=e+(c/2)-(this.minRectSize/2);var a=g+(j/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(a)+"px";this.extentRectangle.style.left=Math.round(f)+"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(g)+"px";this.extentRectangle.style.left=Math.round(e)+"px";this.extentRectangle.style.height=Math.round(j)+"px";this.extentRectangle.style.width=Math.round(c)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(e),Math.round(b),Math.round(h),Math.round(g))},getRectBoundsFromMapBounds:function(d){var a=new OpenLayers.LonLat(d.left,d.bottom);var f=new OpenLayers.LonLat(d.right,d.top);var c=this.getOverviewPxFromLonLat(a);var b=this.getOverviewPxFromLonLat(f);var e=null;if(c&&b){e=new OpenLayers.Bounds(c.x,c.y,b.x,b.y)}return e},getMapBoundsFromRectBounds:function(d){var c=new OpenLayers.Pixel(d.left,d.bottom);var b=new OpenLayers.Pixel(d.right,d.top);var a=this.getLonLatFromOverviewPx(c);var e=this.getLonLatFromOverviewPx(b);return new OpenLayers.Bounds(a.lon,a.lat,e.lon,e.lat)},getLonLatFromOverviewPx:function(f){var c=this.ovmap.size;var b=this.ovmap.getResolution();var a=this.ovmap.getExtent().getCenterLonLat();var e=f.x-(c.w/2);var d=f.y-(c.h/2);return new OpenLayers.LonLat(a.lon+e*b,a.lat-d*b)},getOverviewPxFromLonLat:function(d){var b=this.ovmap.getResolution();var c=this.ovmap.getExtent();var a=null;if(c){a=new OpenLayers.Pixel(Math.round(1/b*(d.lon-c.left)),Math.round(1/b*(c.top-d.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,c,b){this.layer=a;this.lonlat=c;this.data=(b!=null)?b:{};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(b){if(this.lonlat!=null){var c=this.id+"_popup";var a=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(c,this.lonlat,this.data.popupSize,this.data.popupContentHTML,a,b)}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(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var c=e.documentElement;var b=this.version;if(!b){b=c.getAttribute("version");if(!b){b=this.defaultVersion}}var d=OpenLayers.Format.WFSCapabilities["v"+b.replace(/\./g,"_")];if(!d){throw"Can't find a WFS capabilities parser for version "+b}var f=new d(this.options);var a=f.read(e);a.version=b;return a},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(d,j){var e=[];var b={};var f={complexTypes:e,customTypes:b};this.readChildNodes(d,f);var g=d.attributes;var l,a;for(var h=0,k=g.length;h<k;++h){l=g[h];a=l.name;if(a.indexOf("xmlns")==0){this.setNamespace(a.split(":")[1]||"",l.value)}else{j[a]=l.value}}j.featureTypes=e;j.targetPrefix=this.namespaceAlias[j.targetNamespace];var m,c;for(var h=0,k=e.length;h<k;++h){m=e[h];c=b[m.typeName];if(b[m.typeName]){m.typeName=c.name}}},complexType:function(b,c){var a={typeName:b.getAttribute("name")};this.readChildNodes(b,a);c.complexTypes.push(a)},complexContent:function(a,b){this.readChildNodes(a,b)},extension:function(a,b){this.readChildNodes(a,b)},sequence:function(a,b){var c={elements:[]};this.readChildNodes(a,c);b.properties=c.elements},element:function(a,c){if(c.elements){var d={};var b=a.attributes;var g;for(var e=0,f=b.length;e<f;++e){g=b[e];d[g.name]=g.value}var h=d.type;if(!h){h={};this.readChildNodes(a,h);d.restriction=h;d.type=h.base}var k=h.base||h;d.localType=k.split(":").pop();c.elements.push(d)}if(c.complexTypes){var h=a.getAttribute("type");var j=h.split(":").pop();c.customTypes[j]={name:a.getAttribute("name"),type:h}}},simpleType:function(a,b){this.readChildNodes(a,b)},restriction:function(a,b){b.base=a.getAttribute("base");this.readRestriction(a,b)}}},readRestriction:function(d,f){var c=d.childNodes;var h,g,e;for(var b=0,a=c.length;b<a;++b){h=c[b];if(h.nodeType==1){g=h.nodeName.split(":").pop();e=h.getAttribute("value");if(!f[g]){f[g]=e}else{if(typeof f[g]=="string"){f[g]=[f[g]]}f[g].push(e)}}}},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(c,b){var a=b&&b.srsName;if(!a){if(c&&c.layer){a=c.layer.projection.getCode()}else{a=this.srsName}}return a},read:function(a){if(typeof a=="string"){a=OpenLayers.Format.XML.prototype.read.apply(this,[a])}if(a&&a.nodeType==9){a=a.documentElement}var b={};this.readNode(a,b);if(b.features){b=b.features}return b},readers:{wfs:{FeatureCollection:function(a,b){b.features=[];this.readChildNodes(a,b)}}},write:function(a){var b=this.writeNode("wfs:Transaction",a);var c=this.schemaLocationAttr();if(c){this.setAttributeNS(b,this.namespaces.xsi,"xsi:schemaLocation",c)}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(e){var f=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});if(e){var b,d;for(var c=0,a=e.length;c<a;++c){d=e[c];b=this.stateName[d.state];if(b){this.writeNode(b,d,f)}}}return f},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 b;if(c instanceof OpenLayers.Feature.Vector){b=this.createElementNSPlus("wfs:Value");this.srsName=this.getSrsName(c);var a=this.writeNode("feature:_geometry",c.geometry).firstChild;b.appendChild(a)}else{b=this.createElementNSPlus("wfs:Value",{value:c})}return b},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(a){a=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},a);var f=OpenLayers.Util.extend({},this.schemaLocations);if(a.schema){f[a.featurePrefix]=a.schema}var e=[];var c;for(var b in f){c=this.namespaces[b];if(c){e.push(c+" "+f[b])}}var d=e.join(" ")||undefined;return d},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(e,c){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var b=e.documentElement;var a=this.version;if(!a){a=b.getAttribute("version");if(!a){a=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=a){var g=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!g){throw"Can't find a WMC parser for version "+a}this.parser=new g(this.options)}var d=this.parser.read(e,c);var f;if(c.map){this.context=d;if(c.map instanceof OpenLayers.Map){f=this.mergeContextToMap(d,c.map)}else{f=this.contextToMap(d,c.map)}}else{f=d}return f},contextToMap:function(a,c){var b=new OpenLayers.Map(c,{maxExtent:a.maxExtent,projection:a.projection});b.addLayers(a.layers);b.setCenter(a.bounds.getCenterLonLat(),b.getZoomForExtent(a.bounds,true));return b},mergeContextToMap:function(a,b){b.addLayers(a.layers);return b},write:function(e,b){if(e.CLASS_NAME=="OpenLayers.Map"){e=this.mapToContext(e)}var a=(b&&b.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=a){var d=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!d){throw"Can't find a WMS capabilities parser for version "+a}this.parser=new d(this.options)}var c=this.parser.write(e,b);return c},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,e){var c=e.childNodes;var b,d;for(var a=0;a<c.length;++a){b=c[a];if(b.nodeType==1){d=this["read_cap_"+b.nodeName];if(d){d.apply(this,[f,b])}}}},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(c,b){var a={formats:[]};this.runChildNodes(a,b);c.getmap=a},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(b,e,f){var h={formats:b.request.getmap.formats||[],styles:[],queryable:(e.getAttribute("queryable")==="1"||e.getAttribute("queryable")==="true")};if(f){h.styles=h.styles.concat(f.styles);h.llbbox=f.llbbox;h.minScale=f.minScale;h.maxScale=f.maxScale}var c=e.childNodes;var a,k,d;for(var g=0;g<c.length;++g){a=c[g];k=a.nodeName;d=this["read_cap_"+a.nodeName];if(d){if(k=="Layer"){d.apply(this,[b,a,h])}else{d.apply(this,[h,a])}}}if(h.name){var j=h.name.indexOf(":");if(j>0){h.prefix=h.name.substring(0,j)}b.layers.push(h)}},read_cap_ScaleHint:function(e,f){var d=f.getAttribute("min");var a=f.getAttribute("max");var c=Math.pow(2,0.5);var b=OpenLayers.INCHES_PER_UNIT.m;e.maxScale=parseFloat(((c*d)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13));e.minScale=parseFloat(((c*a)*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(b,a){var c=this.getChildValue(a);if(c){b.title=c}},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(c,d){var b={width:d.getAttribute("width"),height:d.getAttribute("height")};var a=d.getElementsByTagName("OnlineResource");if(a.length>0){this.read_cap_OnlineResource(b,a[0])}c.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(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var c=e.documentElement;var b=this.version;if(!b){b=c.getAttribute("version");if(!b){b=this.defaultVersion}}if(b=="1.1.1"||b=="1.1.0"){b="1.1"}var d=OpenLayers.Format.WMSDescribeLayer["v"+b.replace(/\./g,"_")];if(!d){throw"Can't find a WMS DescribeLayer parser for version "+b}var f=new d(this.options);var a=f.read(e);a.version=b;return a},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 a;if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var b=e.documentElement;if(b){var c=this;var d=this["read_"+b.nodeName];if(d){a=d.call(this,b)}else{a=new OpenLayers.Format.GML((this.options?this.options:{})).read(e)}}else{a=e}return a},read_msGMLOutput:function(g){var d=[];var b=this.getSiblingNodesByTagCriteria(g,this.layerIdentifier);if(b){for(var h=0,m=b.length;h<m;++h){var c=b[h];var k=c.nodeName;if(c.prefix){k=k.split(":")[1]}var k=k.replace(this.layerIdentifier,"");var l=this.getSiblingNodesByTagCriteria(c,this.featureIdentifier);if(l){for(var f=0;f<l.length;f++){var a=l[f];var o=this.parseGeometry(a);var e=this.parseAttributes(a);var p=new OpenLayers.Feature.Vector(o,e,null);p.type=k;d.push(p)}}}}return d},read_FeatureInfoResponse:function(f){var c=[];var h=this.getElementsByTagNameNS(f,"*","FIELDS");for(var g=0,k=h.length;g<k;g++){var a=h[g];var l=null;var e={};for(var d=0,m=a.attributes.length;d<m;d++){var b=a.attributes[d];e[b.nodeName]=b.nodeValue}c.push(new OpenLayers.Feature.Vector(l,e,null))}return c},getSiblingNodesByTagCriteria:function(f,j){var a=[];var c,e,d,g,b;if(f&&f.hasChildNodes()){c=f.childNodes;d=c.length;for(var h=0;h<d;h++){b=c[h];while(b&&b.nodeType!=1){b=b.nextSibling;h++}e=(b?b.nodeName:"");if(e.length>0&&e.indexOf(j)>-1){a.push(b)}else{g=this.getSiblingNodesByTagCriteria(b,j);if(g.length>0){(a.length==0)?a=g:a.push(g)}}}}return a},parseAttributes:function(d){var e={};if(d.nodeType==1){var c=d.childNodes;n=c.length;for(var f=0;f<n;++f){var b=c[f];if(b.nodeType==1){var j=b.childNodes;if(j.length==1){var h=j[0];if(h.nodeType==3||h.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var g=h.nodeValue.replace(this.regExes.trimSpace,"");e[a]=g}}}}}return e},parseGeometry:function(b){if(!this.gmlFormat){this.gmlFormat=new OpenLayers.Format.GML()}var a=this.gmlFormat.parseFeature(b);var c=null;if(a&&a.geometry){c=a.geometry.clone();a.destroy()}return c},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(c,b,a){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(b){var a=true;if(this.checkModifiers(b)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(b)){a=this.rightclick(b)}return a},rightclick:function(b){if(this.passesTolerance(b)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[b]);return !this.stopDouble}else{var a=this["double"]?OpenLayers.Util.extend({},b):this.callback("rightclick",[b]);var c=OpenLayers.Function.bind(this.delayedRightCall,this,a);this.rightclickTimerId=window.setTimeout(c,this.delay)}}return !this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;if(a){this.callback("rightclick",[a])}return !this.stopSingle},dblclick:function(a){if(this.passesTolerance(a)){if(this["double"]){this.callback("dblclick",[a])}this.clearTimer()}return !this.stopDouble},click:function(b){if(this.passesTolerance(b)){if(this.timerId!=null){this.clearTimer()}else{var a=this.single?OpenLayers.Util.extend({},b):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}}return !this.stopSingle},passesTolerance:function(b){var c=true;if(this.pixelTolerance!=null&&this.down){var a=Math.sqrt(Math.pow(this.down.x-b.xy.x,2)+Math.pow(this.down.y-b.xy.y,2));if(a>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(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(a){},move:function(a){},up:function(a){},out:function(a){},mousedown:function(b){var a=true;this.dragging=false;if(this.checkModifiers(b)&&OpenLayers.Event.isLeftClick(b)){this.started=true;this.start=b.xy;this.last=b.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(b);this.callback("down",[b.xy]);OpenLayers.Event.stop(b);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return true};document.onselectstart=function(){return false}}a=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return a},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(b){if(this.started){var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(b);this.callback("up",[b.xy]);if(a){this.callback("done",[b.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(b){if(this.started&&OpenLayers.Util.mouseLeft(b,this.map.div)){var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(b);this.callback("out",[]);if(a){this.callback("done",[b.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(d,b,c,a){OpenLayers.Handler.prototype.initialize.apply(this,[d,c,a]);this.layer=b},mousedown:function(a){this.down=a.xy;return this.handle(a)?!this.stopDown:true},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:true},click:function(a){return this.handle(a)?!this.stopClick:true},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(a);return true},dblclick:function(a){return !this.handle(a)},geometryTypeMatches:function(a){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1},handle:function(a){if(this.feature&&!this.feature.layer){this.feature=null}var c=a.type;var f=false;var e=!!(this.feature);var d=(c=="click"||c=="dblclick");this.feature=this.layer.getFeatureFromEvent(a);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var b=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(e&&b){if(this.lastFeature){this.triggerCallback(c,"out",[this.lastFeature])}this.triggerCallback(c,"in",[this.feature])}else{if(!e||d){this.triggerCallback(c,"in",[this.feature])}}this.lastFeature=this.feature;f=true}else{if(this.lastFeature&&(e&&b||d)){this.triggerCallback(c,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(e||d)){this.triggerCallback(c,"out",[this.lastFeature])}}return f},triggerCallback:function(d,e,b){var c=this.EVENTMAP[d][e];if(c){if(d=="click"&&this.up&&this.down){var a=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(a<=this.clickTolerance){this.callback(c,b)}}else{this.callback(c,b)}}},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(c,b,a){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(b){var c=true;if(this.pixelTolerance&&this.px){var a=Math.sqrt(Math.pow(this.px.x-b.x,2)+Math.pow(this.px.y-b.y,2));if(a<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(c,b,a){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(c,b,a){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(k){if(!this.map||!this.checkModifiers(k)){return}var g=false;var l=false;var f=false;var b=OpenLayers.Event.element(k);while((b!=null)&&!f&&!g){if(!g){try{if(b.currentStyle){c=b.currentStyle.overflow}else{var a=document.defaultView.getComputedStyle(b,null);var c=a.getPropertyValue("overflow")}g=(c&&(c=="auto")||(c=="scroll"))}catch(d){}}if(!l){for(var h=0,j=this.map.layers.length;h<j;h++){if(b==this.map.layers[h].div||b==this.map.layers[h].pane){l=true;break}}}f=(b==this.map.div);b=b.parentNode}if(!g&&f){if(l){this.wheelZoom(k)}OpenLayers.Event.stop(k)}},wheelZoom:function(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){b=a.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){b=-b}}else{if(a.detail){b=-a.detail/3}}if(b){if(this.mousePosition){a.xy=this.mousePosition}if(!a.xy){a.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(b<0){this.callback("down",[a,b])}else{this.callback("up",[a,b])}}},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(b,a){this.addOptions(a);this.name=b;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 b=false;if(this.map){this.inRange=this.calculateInRange();var c=this.getExtent();if(c&&this.inRange&&this.visibility){var a=true;this.moveTo(c,a,false);this.events.triggerEvent("moveend",{zoomChanged:a});b=true}}return b},moveTo:function(b,a,c){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(a){var b=this.calculateInRange();if(a!=(this.div.style.display!="none")){this.div.style.display=(a&&b)?"block":"none"}},calculateInRange:function(){var b=false;if(this.alwaysInRange){b=true}else{if(this.map){var a=this.map.getResolution();b=((a>=this.minResolution)&&(a<=this.maxResolution))}}return b},setIsBaseLayer:function(a){if(a!=this.isBaseLayer){this.isBaseLayer=a;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var o=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var e=false;var d={};for(var f=0,j=o.length;f<j;f++){var q=o[f];if(this.options[q]&&OpenLayers.Util.indexOf(b,q)==-1){e=true}d[q]=this.options[q]||this.map[q]}if(this.alwaysInRange==null){this.alwaysInRange=!e}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){d.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){d.resolutions=null}if((!d.numZoomLevels)&&(d.maxZoomLevel)){d.numZoomLevels=d.maxZoomLevel+1}if((d.scales!=null)||(d.resolutions!=null)){if(d.scales!=null){d.resolutions=[];for(var f=0,j=d.scales.length;f<j;f++){var c=d.scales[f];d.resolutions[f]=OpenLayers.Util.getResolutionFromScale(c,d.units)}}d.numZoomLevels=d.resolutions.length}else{if(d.minScale){d.maxResolution=OpenLayers.Util.getResolutionFromScale(d.minScale,d.units)}else{if(d.maxResolution=="auto"){var p=this.map.getSize();var m=d.maxExtent.getWidth()/p.w;var h=d.maxExtent.getHeight()/p.h;d.maxResolution=Math.max(m,h)}}if(d.maxScale!=null){d.minResolution=OpenLayers.Util.getResolutionFromScale(d.maxScale,d.units)}else{if((d.minResolution=="auto")&&(d.minExtent!=null)){var p=this.map.getSize();var m=d.minExtent.getWidth()/p.w;var h=d.minExtent.getHeight()/p.h;d.minResolution=Math.max(m,h)}}if(d.minResolution!=null&&this.options.numZoomLevels==undefined){var l=d.maxResolution/d.minResolution;d.numZoomLevels=Math.floor(Math.log(l)/Math.log(2))+1}d.resolutions=new Array(d.numZoomLevels);var a=2;if(typeof d.minResolution=="number"&&d.numZoomLevels>1){a=Math.pow((d.maxResolution/d.minResolution),(1/(d.numZoomLevels-1)))}for(var f=0;f<d.numZoomLevels;f++){var k=d.maxResolution/Math.pow(a,f);d.resolutions[f]=k}}d.resolutions.sort(function(s,r){return(r-s)});this.resolutions=d.resolutions;this.maxResolution=d.resolutions[0];var g=d.resolutions.length-1;this.minResolution=d.resolutions[g];this.scales=[];for(var f=0,j=d.resolutions.length;f<j;f++){this.scales[f]=OpenLayers.Util.getScaleFromResolution(d.resolutions[f],d.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=d.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(b,c){var d=this.map.getSize();var a=Math.max(b.getWidth()/d.w,b.getHeight()/d.h);return this.getZoomForResolution(a,c)},getDataExtent:function(){},getResolutionForZoom:function(c){c=Math.max(0,Math.min(c,this.resolutions.length-1));var b;if(this.map.fractionalZoom){var a=Math.floor(c);var d=Math.ceil(c);b=this.resolutions[a]-((c-a)*(this.resolutions[a]-this.resolutions[d]))}else{b=this.resolutions[Math.round(c)]}return b},getZoomForResolution:function(e,a){var o;if(this.map.fractionalZoom){var k=0;var c=this.resolutions.length-1;var d=this.resolutions[k];var b=this.resolutions[c];var j;for(var f=0,g=this.resolutions.length;f<g;++f){j=this.resolutions[f];if(j>=e){d=j;k=f}if(j<=e){b=j;c=f;break}}var h=d-b;if(h>0){o=k+((d-e)/h)}else{o=k}}else{var l;var m=Number.POSITIVE_INFINITY;for(var f=0,g=this.resolutions.length;f<g;f++){if(a){l=Math.abs(this.resolutions[f]-e);if(l>m){break}m=l}else{if(this.resolutions[f]<e){break}}}o=Math.max(0,f-1)}return o},getLonLatFromViewPortPx:function(b){var e=null;if(b!=null){var d=this.map.getSize();var a=this.map.getCenter();if(a){var c=this.map.getResolution();var g=b.x-(d.w/2);var f=b.y-(d.h/2);e=new OpenLayers.LonLat(a.lon+g*c,a.lat-f*c);if(this.wrapDateLine){e=e.wrapDateLine(this.maxExtent)}}}return e},getViewPortPxFromLonLat:function(d){var b=null;if(d!=null){var a=this.map.getResolution();var c=this.map.getExtent();b=new OpenLayers.Pixel((1/a*(d.lon-c.left)),(1/a*(c.top-d.lat)))}return b},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var d=0,a=this.div.childNodes.length;d<a;++d){var c=this.div.childNodes[d].firstChild;OpenLayers.Util.modifyDOMElement(c,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(b,c,a){this.bounds=b;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(c,a)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(a,b){if(!a){a="red"}if(!b){b=2}this.div.style.border=b+"px solid "+a},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 d=window.XMLHttpRequest;var h=!!window.controllers,e=window.document.all&&!window.opera;function c(){this._object=d?new d:new window.ActiveXObject("Microsoft.XMLHTTP")}if(h&&d.wrapped){c.wrapped=d.wrapped}c.UNSENT=0;c.OPENED=1;c.HEADERS_RECEIVED=2;c.LOADING=3;c.DONE=4;c.prototype.readyState=c.UNSENT;c.prototype.responseText="";c.prototype.responseXML=null;c.prototype.status=0;c.prototype.statusText="";c.prototype.onreadystatechange=null;c.onreadystatechange=null;c.onopen=null;c.onsend=null;c.onabort=null;c.prototype.open=function(m,q,l,r,k){this._async=l;var p=this,o=this.readyState;if(e){var j=function(){if(p._object.readyState!=c.DONE){a(p)}};if(l){window.attachEvent("onunload",j)}}this._object.onreadystatechange=function(){if(h&&!l){return}p.readyState=p._object.readyState;g(p);if(p._aborted){p.readyState=c.UNSENT;return}if(p.readyState==c.DONE){a(p);if(e&&l){window.detachEvent("onunload",j)}}if(o!=p.readyState){f(p)}o=p.readyState};if(c.onopen){c.onopen.apply(this,arguments)}this._object.open(m,q,l,r,k);if(!l&&h){this.readyState=c.OPENED;f(this)}};c.prototype.send=function(j){if(c.onsend){c.onsend.apply(this,arguments)}if(j&&j.nodeType){j=window.XMLSerializer?new window.XMLSerializer().serializeToString(j):j.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(j);if(h&&!this._async){this.readyState=c.OPENED;g(this);while(this.readyState<c.DONE){this.readyState++;f(this);if(this._aborted){return}}}};c.prototype.abort=function(){if(c.onabort){c.onabort.apply(this,arguments)}if(this.readyState>c.UNSENT){this._aborted=true}this._object.abort();a(this)};c.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};c.prototype.getResponseHeader=function(j){return this._object.getResponseHeader(j)};c.prototype.setRequestHeader=function(j,k){if(!this._headers){this._headers={}}this._headers[j]=k;return this._object.setRequestHeader(j,k)};c.prototype.toString=function(){return"[object XMLHttpRequest]"};c.toString=function(){return"[XMLHttpRequest]"};function f(j){if(j.onreadystatechange){j.onreadystatechange.apply(j)}if(c.onreadystatechange){c.onreadystatechange.apply(j)}}function b(k){var j=k.responseXML;if(e&&j&&!j.documentElement&&k.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){j=new ActiveXObject("Microsoft.XMLDOM");j.loadXML(k.responseText)}if(j){if((e&&j.parseError!=0)||(j.documentElement&&j.documentElement.tagName=="parsererror")){return null}}return j}function g(j){try{j.responseText=j._object.responseText}catch(k){}try{j.responseXML=b(j._object)}catch(k){}try{j.status=j._object.status}catch(k){}try{j.statusText=j._object.statusText}catch(k){}}function a(j){j._object.onreadystatechange=new window.Function;delete j._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(j,k){if(!k){k=[]}j.__func=this;j.__func(k[0],k[1],k[2],k[3],k[4]);delete j.__func}}OpenLayers.Request.XMLHttpRequest=c})();OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(a){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:a.statusText}))};OpenLayers.loadURL=function(d,g,b,e,c){if(typeof g=="string"){g=OpenLayers.Util.getParameters(g)}var f=(e)?e:OpenLayers.nullHandler;var a=(c)?c:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:d,params:g,success:f,failure:a,scope:b})};OpenLayers.parseXMLString=function(c){var a=c.indexOf("<");if(a>0){c=c.substring(a)}var b=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 b};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,c,f){var a;for(var b=0;b<this.responders.length;b++){a=this.responders[b];if(a[g]&&typeof a[g]=="function"){try{a[g].apply(a,[c,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(b,a){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[a]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(b,"http")){b=OpenLayers.ProxyHost+encodeURIComponent(b)}this.transport=OpenLayers.Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var d=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){d._method=this.method;this.method="post"}this.parameters=d;if(d=OpenLayers.Util.getParameterString(d)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+d}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+="&_="}}}try{var a=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,a);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||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){e["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){e.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(typeof c.push=="function"){for(var b=0,d=c.length;b<d;b+=2){e[c[b]]=c[b+1]}}else{for(var b in c){e[b]=c[b]}}}for(var a in e){this.transport.setRequestHeader(a,e[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(a){var c=OpenLayers.Ajax.Request.Events[a];var b=new OpenLayers.Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(b)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type")}try{(this.options["on"+c]||OpenLayers.Ajax.emptyFunction)(b);OpenLayers.Ajax.Responders.dispatch("on"+c,this,b)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},dispatchException:function(c){var d=this.options.onException;if(d){d(this,c);OpenLayers.Ajax.Responders.dispatch("onException",this,c)}else{var e=false;var a=OpenLayers.Ajax.Responders.responders;for(var b=0;b<a.length;b++){if(a[b].onException){e=true;break}}if(e){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(c){this.request=c;var d=this.transport=c.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 b=d.responseXML;this.responseXML=b===undefined?null:b}},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(b,a,c,e){var d=null;if(b.getElementsByTagNameNS){d=b.getElementsByTagNameNS(a,e)}else{d=b.getElementsByTagName(c+":"+e)}return d};OpenLayers.Ajax.serializeXMLToString=function(a){var b=new XMLSerializer();var c=b.serializeToString(a);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(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;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(a){switch(a.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 b=this.map.getSize();this.map.pan(0,-0.75*b.h);break;case 34:var b=this.map.getSize();this.map.pan(0,0.75*b.h);break;case 35:var b=this.map.getSize();this.map.pan(0.75*b.w,0);break;case 36:var b=this.map.getSize();this.map.pan(-0.75*b.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 f=[];var e=this.layers||this.map.layers;var d,b;for(var c=0,a=e.length;c<a;++c){d=e[c];if(d instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||d.getVisibility())){b=d.url instanceof Array?d.url[0]:d.url;if(!this.url){this.url=b}if(this.urlMatches(b)){f.push(d)}}}return f},urlMatches:function(b){var d=OpenLayers.Util.isEquivalentUrl(this.url,b);if(!d&&this.layerUrls){for(var c=0,a=this.layerUrls.length;c<a;++c){if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[c],b)){d=true;break}}}return d},request:function(a,j){j=j||{};var f=[];var g=[];var c=this.findLayers();if(c.length>0){for(var d=0,e=c.length;d<e;d++){f=f.concat(c[d].params.LAYERS);if(c[d].params.STYLES){g=g.concat(c[d].params.STYLES)}else{if(c[d].params.LAYERS instanceof Array){g=g.concat(new Array(c[d].params.LAYERS.length))}else{g=g.concat(c[d].params.LAYERS.replace(/[^,]/g,""))}}}var h={url:this.url,params:OpenLayers.Util.applyDefaults({service:"WMS",version:"1.1.0",request:"GetFeatureInfo",layers:f,query_layers:f,styles:g,bbox:this.map.getExtent().toBBOX(),srs:this.map.getProjection(),feature_count:this.maxFeatures,x:a.x,y:a.y,height:this.map.getSize().h,width:this.map.getSize().w,info_format:this.infoFormat},this.vendorParams),callback:function(k){this.handleResponse(a,k)},scope:this};var b=OpenLayers.Request.GET(h);if(j.hover===true){this.hoverRequest=b.priv}}else{OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(d,b){var c=b.responseXML;if(!c||!c.documentElement){c=b.responseText}var a=this.format.read(c);this.events.triggerEvent("getfeatureinfo",{text:b.responseText,features:a,request:b,xy:d});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(c,a,b){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,a]);this.lonlat=null;this.geometry=c?c:null;this.state=null;this.attributes={};if(a){this.attributes=OpenLayers.Util.extend(this.attributes,a)}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 c=false;if(this.layer&&this.layer.map){var a=this.layer.map.getExtent();if(d){var b=this.geometry.getBounds();c=a.intersectsBounds(b)}else{var e=a.toGeometry();c=e.intersects(this.geometry)}}return c},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(b,d,c){var a=false;if(this.geometry){a=this.geometry.atPoint(b,d,c)}return a},destroyPopup:function(){},move:function(a){if(!this.layer||!this.geometry.move){return}var b;if(a.CLASS_NAME=="OpenLayers.LonLat"){b=this.layer.getViewPortPxFromLonLat(a)}else{b=a}var d=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var c=this.layer.map.getResolution();this.geometry.move(c*(b.x-d.x),c*(d.y-b.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(c,b){var a=arguments;var d=this.processXMLNode(b);a=new Array(c,d.lonlat,d);OpenLayers.Feature.prototype.initialize.apply(this,a);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 a=OpenLayers.Ajax.getElementsByTagNameNS(b,"http://www.opengis.net/gml","gml","Point");var d=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(a[0],"http://www.opengis.net/gml","gml","coordinates")[0]);var c=d.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,e){var c=e.childNodes;var b,d;for(var a=0;a<c.length;++a){b=c[a];if(b.nodeType==1){d=this["read_cap_"+b.nodeName];if(d){d.apply(this,[f,b])}}}},read_cap_FeatureTypeList:function(c,b){var a={featureTypes:[]};this.runChildNodes(a,b);c.featureTypeList=a},read_cap_FeatureType:function(a,d,b){var c={};this.runChildNodes(c,d);a.featureTypes.push(c)},read_cap_Name:function(c,b){var a=this.getChildValue(b);if(a){c.name=a}},read_cap_Title:function(b,a){var c=this.getChildValue(a);if(c){b.title=c}},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(a){var b=null;if(a==null){b=this.namespaces[this.defaultPrefix]}else{for(b in this.namespaces){if(this.namespaces[b]==a){break}}}return b},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(e,d){var b=d.childNodes;var a,c,g,j;for(var f=0,h=b.length;f<h;++f){a=b[f];if(a.nodeType==1){g=this.getNamespacePrefix(a.namespaceURI);j=a.nodeName.split(":").pop();c=this["read_"+g+"_"+j];if(c){c.apply(this,[e,a])}}}},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(b,c){var d={params:this.layerParams||{},options:{visibility:(c.getAttribute("hidden")!="1"),queryable:(c.getAttribute("queryable")=="1")},formats:[],styles:[]};this.runChildNodes(d,c);d.params.layers=d.name;d.options.maxExtent=d.maxExtent;var a=this.getLayerFromInfo(d);b.layers.push(a)},getLayerFromInfo:function(c){var a=c.options;if(this.layerOptions){OpenLayers.Util.applyDefaults(a,this.layerOptions)}var b=new OpenLayers.Layer.WMS(c.title,c.href,c.params,a);return b},read_wmc_Extension:function(b,a){this.runChildNodes(b,a)},read_ol_units:function(b,a){b.options.units=this.getChildValue(a)},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(b,a){b.params.transparent=this.getChildValue(a)},read_ol_numZoomLevels:function(b,a){b.options.numZoomLevels=parseInt(this.getChildValue(a))},read_ol_opacity:function(b,a){b.options.opacity=parseFloat(this.getChildValue(a))},read_ol_singleTile:function(b,a){b.options.singleTile=(this.getChildValue(a)=="true")},read_ol_isBaseLayer:function(b,a){b.options.isBaseLayer=(this.getChildValue(a)=="true")},read_ol_displayInLayerSwitcher:function(b,a){b.options.displayInLayerSwitcher=(this.getChildValue(a)=="true")},read_wmc_Server:function(b,a){b.params.version=a.getAttribute("version");this.runChildNodes(b,a)},read_wmc_FormatList:function(b,a){this.runChildNodes(b,a)},read_wmc_Format:function(c,a){var b=this.getChildValue(a);c.formats.push(b);if(a.getAttribute("current")=="1"){c.params.format=b}},read_wmc_StyleList:function(b,a){this.runChildNodes(b,a)},read_wmc_Style:function(c,b){var a={};this.runChildNodes(a,b);if(b.getAttribute("current")=="1"){if(a.href){c.params.sld=a.href}else{if(a.body){c.params.sld_body=a.body}else{c.params.styles=a.name}}}c.styles.push(a)},read_wmc_SLD:function(a,b){this.runChildNodes(a,b)},read_sld_StyledLayerDescriptor:function(c,b){var a=OpenLayers.Format.XML.prototype.write.apply(this,[b]);c.body=a},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(b,a){var c=this.getChildValue(a);if(c){b.title=c}},read_wmc_MetadataURL:function(c,b){var d={};var a=b.getElementsByTagName("OnlineResource");if(a.length>0){this.read_wmc_OnlineResource(d,a[0])}c.options.metadataURL=d.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(c,d){var b={width:d.getAttribute("width"),height:d.getAttribute("height")};var a=d.getElementsByTagName("OnlineResource");if(a.length>0){this.read_wmc_OnlineResource(b,a[0])}c.legend=b},write:function(c,b){var a=this.createElementDefaultNS("ViewContext");this.setAttributes(a,{version:this.VERSION,id:(b&&typeof b.id=="string")?b.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")});this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);a.appendChild(this.write_wmc_General(c));a.appendChild(this.write_wmc_LayerList(c));return OpenLayers.Format.XML.prototype.write.apply(this,[a])},createElementDefaultNS:function(c,b,a){var d=this.createElementNS(this.namespaces[this.defaultPrefix],c);if(b){d.appendChild(this.createTextNode(b))}if(a){this.setAttributes(d,a)}return d},setAttributes:function(b,d){var c;for(var a in d){c=d[a].toString();if(c.match(/[A-Z]/)){this.setAttributeNS(b,null,a,c)}else{b.setAttribute(a,c)}}},write_wmc_General:function(a){var c=this.createElementDefaultNS("General");if(a.size){c.appendChild(this.createElementDefaultNS("Window",null,{width:a.size.w,height:a.size.h}))}var b=a.bounds;c.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:b.left.toPrecision(10),miny:b.bottom.toPrecision(10),maxx:b.right.toPrecision(10),maxy:b.top.toPrecision(10),SRS:a.projection}));c.appendChild(this.createElementDefaultNS("Title",a.title));c.appendChild(this.write_ol_MapExtension(a));return c},write_ol_MapExtension:function(b){var d=this.createElementDefaultNS("Extension");var c=b.maxExtent;if(c){var a=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(a,{minx:c.left.toPrecision(10),miny:c.bottom.toPrecision(10),maxx:c.right.toPrecision(10),maxy:c.top.toPrecision(10)});d.appendChild(a)}return d},write_wmc_LayerList:function(d){var e=this.createElementDefaultNS("LayerList");var c;for(var b=0,a=d.layers.length;b<a;++b){c=d.layers[b];if(c instanceof OpenLayers.Layer.WMS){e.appendChild(this.write_wmc_Layer(c))}}return e},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(f){var d=this.createElementDefaultNS("Extension");var a=f.maxExtent;var j=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(j,{minx:a.left.toPrecision(10),miny:a.bottom.toPrecision(10),maxx:a.right.toPrecision(10),maxy:a.top.toPrecision(10)});d.appendChild(j);var c=f.params.TRANSPARENT;if(c){var k=this.createElementNS(this.namespaces.ol,"ol:transparent");k.appendChild(this.createTextNode(c));d.appendChild(k)}var h=["numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"];var b;for(var e=0,g=h.length;e<g;++e){b=this.createOLPropertyNode(f,h[e]);if(b){d.appendChild(b)}}return d},createOLPropertyNode:function(b,c){var a=null;if(b[c]!=null){a=this.createElementNS(this.namespaces.ol,"ol:"+c);a.appendChild(this.createTextNode(b[c].toString()))}return a},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(e){var d=this.createElementDefaultNS("StyleList");var c=this.createElementDefaultNS("Style",null,{current:"1"});if(e.params.SLD){var b=this.createElementDefaultNS("SLD");var g=this.write_wmc_OnlineResource(e.params.SLD);b.appendChild(g);c.appendChild(b)}else{if(e.params.SLD_BODY){var b=this.createElementDefaultNS("SLD");var f=e.params.SLD_BODY;var h=OpenLayers.Format.XML.prototype.read.apply(this,[f]);var j=h.documentElement;if(b.ownerDocument&&b.ownerDocument.importNode){j=b.ownerDocument.importNode(j,true)}b.appendChild(j);c.appendChild(b)}else{var a=e.params.STYLES?e.params.STYLES:this.defaultStyleName;c.appendChild(this.createElementDefaultNS("Name",a));c.appendChild(this.createElementDefaultNS("Title",this.defaultStyleTitle))}}d.appendChild(c);return d},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(g){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var b=g.documentElement;var e=b.childNodes;var a=[];for(var d=0;d<e.length;++d){childNode=e[d];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")}}a.push({owsType:h,owsURL:f,typeName:c})}}return a},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var b={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,b,{keyMask:this.keyMask})},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(a)}},startBox:function(a){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(f){var d=this.dragHandler.start.x;var b=this.dragHandler.start.y;var c=Math.abs(d-f.x);var a=Math.abs(b-f.y);this.zoomBox.style.width=Math.max(1,c)+"px";this.zoomBox.style.height=Math.max(1,a)+"px";this.zoomBox.style.left=f.x<d?f.x+"px":d+"px";this.zoomBox.style.top=f.y<b?f.y+"px":b+"px";var e=this.getBoxCharacteristics();if(e.newBoxModel){if(f.x>d){this.zoomBox.style.width=Math.max(1,c-e.xOffset)+"px"}if(f.y>b){this.zoomBox.style.height=Math.max(1,a-e.yOffset)+"px"}}},endBox:function(b){var a;if(Math.abs(this.dragHandler.start.x-b.x)>5||Math.abs(this.dragHandler.start.y-b.y)>5){var g=this.dragHandler.start;var f=Math.min(g.y,b.y);var c=Math.max(g.y,b.y);var e=Math.min(g.x,b.x);var d=Math.max(g.x,b.x);a=new OpenLayers.Bounds(e,c,d,f)}else{a=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[a])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxCharacteristics=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return true}else{return false}},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var c=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:a,yOffset:c,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(c,b,a){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,[c,b,a]);this.options=(a)?a: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(a){this.fixedRadius=!!(this.radius);var b=this.map.getLonLatFromPixel(a.xy);this.origin=new OpenLayers.Geometry.Point(b.lon,b.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(c){var f=this.map.getLonLatFromPixel(c.xy);var a=new OpenLayers.Geometry.Point(f.lon,f.lat);if(this.irregular){var g=Math.sqrt(2)*Math.abs(a.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,g)}else{if(this.fixedRadius){this.origin=a}else{this.calculateAngle(a,c);this.radius=Math.max(this.map.getResolution()/2,a.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var d=a.x-this.origin.x;var b=a.y-this.origin.y;var e;if(b==0){e=d/(this.radius*Math.sqrt(2))}else{e=d/b}this.feature.geometry.resize(1,this.origin,e);this.feature.geometry.move(d/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 f,c,b,a;var d=this.feature.geometry.components[0];if(d.components.length!=(this.sides+1)){this.createGeometry();d=this.feature.geometry.components[0]}for(var e=0;e<this.sides;++e){a=d.components[e];f=this.angle+(e*2*Math.PI/this.sides);a.x=this.origin.x+(this.radius*Math.cos(f));a.y=this.origin.y+(this.radius*Math.sin(f));a.clearBounds()}},calculateAngle:function(a,b){var d=Math.atan2(a.y-this.origin.y,a.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!b[this.snapToggle])){var c=(Math.PI/180)*this.snapAngle;this.angle=Math.round(d/c)*c}else{this.angle=d}},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(b,a){if(this.callbacks[b]){this.callbacks[b].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(b=="done"||b=="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(b,a){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 g=this.map.getSize();var a=Math.min(g.w,300);var e=Math.min(g.h,200);var b=new OpenLayers.Size(a,e);var d=new OpenLayers.Pixel(g.w/2,g.h/2);var c=d.add(-b.w/2,-b.h/2);var f=OpenLayers.Util.createDiv(this.name+"_warning",c,b,null,null,null,"auto");f.style.padding="7px";f.style.backgroundColor="yellow";f.innerHTML=this.getWarningHTML();this.div.appendChild(f)},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(c,d,k){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var e=this.map.getCenter();var g=this.map.getZoom();if(e!=null){var f=this.getMapObjectCenter();var b=this.getOLLonLatFromMapObjectLonLat(f);var h=this.getMapObjectZoom();var o=this.getOLZoomFromMapObjectZoom(h);if(!(e.equals(b))||!(g==o)){if(k&&this.dragPanMapObject&&this.smoothDragPan){var j=this.map.getViewPortPxFromLonLat(b);var l=this.map.getViewPortPxFromLonLat(e);this.dragPanMapObject(l.x-j.x,j.y-l.y)}else{var a=this.getMapObjectLonLatFromOLLonLat(e);var m=this.getMapObjectZoomFromOLZoom(g);this.setMapObjectCenter(a,m,k)}}}}},getLonLatFromViewPortPx:function(a){var b=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var d=this.getMapObjectPixelFromOLPixel(a);var c=this.getMapObjectLonLatFromMapObjectPixel(d);b=this.getOLLonLatFromMapObjectLonLat(c)}return b},getViewPortPxFromLonLat:function(b){var a=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var d=this.getMapObjectLonLatFromOLLonLat(b);var c=this.getMapObjectPixelFromMapObjectLonLat(d);a=this.getOLPixelFromMapObjectPixel(c)}return a},getOLLonLatFromMapObjectLonLat:function(d){var a=null;if(d!=null){var c=this.getLongitudeFromMapObjectLonLat(d);var b=this.getLatitudeFromMapObjectLonLat(d);a=new OpenLayers.LonLat(c,b)}return a},getMapObjectLonLatFromOLLonLat:function(a){var b=null;if(a!=null){b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat)}return b},getOLPixelFromMapObjectPixel:function(d){var b=null;if(d!=null){var a=this.getXFromMapObjectPixel(d);var c=this.getYFromMapObjectPixel(d);b=new OpenLayers.Pixel(a,c)}return b},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 c=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");for(var b=0,a=c.length;b<a;b++){var f=c[b];this[f]=(this.options[f]!=null)?this.options[f]:this.map[f]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var g;var e=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){g=this.maxZoomLevel-this.minZoomLevel+1}else{g=this.numZoomLevels}if(g!=null){this.numZoomLevels=Math.min(g,e)}else{this.numZoomLevels=e}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var d=0;this.resolutions=[];for(var b=this.minZoomLevel;b<=this.maxZoomLevel;b++){this.resolutions[d++]=this.RESOLUTIONS[b]}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 a=null;var c=this.map.getSize();var b=this.getExtent();if((c!=null)&&(b!=null)){a=Math.max(b.getWidth()/c.w,b.getHeight()/c.h)}return a}},getExtent:function(){var c=null;var b=this.map.getSize();var e=new OpenLayers.Pixel(0,0);var f=this.getLonLatFromViewPortPx(e);var a=new OpenLayers.Pixel(b.w,b.h);var d=this.getLonLatFromViewPortPx(a);if((f!=null)&&(d!=null)){c=new OpenLayers.Bounds(f.lon,d.lat,d.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(a){var b=null;if(a!=null){b=a-this.minZoomLevel}return b},getMapObjectZoomFromOLZoom:function(a){var b=null;if(a!=null){b=a+this.minZoomLevel}return b},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(d,c,e,b){var a=arguments;a=[d,b];OpenLayers.Layer.prototype.initialize.apply(this,a);this.url=c;this.params=OpenLayers.Util.extend({},e)},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(e,d){var c=1;for(var b=0,a=e.length;b<a;b++){c*=e.charCodeAt(b)*this.URL_HASH_FACTOR;c-=Math.floor(c)}return d[Math.floor(c*d.length)]},getFullRequestString:function(f,e){var b=e||this.url;var g=OpenLayers.Util.extend({},this.params);g=OpenLayers.Util.extend(g,f);var a=OpenLayers.Util.getParameterString(g);if(b instanceof Array){b=this.selectUrl(a,b)}var d=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var h in g){if(h.toUpperCase() in d){delete g[h]}}a=OpenLayers.Util.getParameterString(g);var j=b;if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){j+=a}else{if(b.indexOf("?")==-1){j+="?"+a}else{j+="&"+a}}}return j},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(c,b,e,d,a){this.url=b;this.extent=e;this.maxExtent=e;this.size=d;OpenLayers.Layer.prototype.initialize.apply(this,[c,a]);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(e,a,f){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var b=(this.tile==null);if(a||b){this.setTileSize();var d=new OpenLayers.LonLat(this.extent.left,this.extent.top);var c=this.map.getLayerPxFromLonLat(d);if(b){this.tile=new OpenLayers.Tile.Image(this,c,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=c.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(b,a){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(d,b,e){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(b||!this.drawn){for(var c=0,a=this.markers.length;c<a;c++){this.drawMarker(this.markers[c])}this.drawn=true}},addMarker:function(a){this.markers.push(a);if(this.opacity!=null){a.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){a.map=this.map;this.drawMarker(a)}},removeMarker:function(a){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,a);a.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(a){var b=this.map.getLayerPxFromLonLat(a.lonlat);if(b==null){a.display(false)}else{if(!a.isDrawn()){var c=a.draw(b);this.div.appendChild(c)}else{if(a.icon){a.icon.moveTo(b)}}}},getDataExtent:function(){var b=null;if(this.markers&&(this.markers.length>0)){var b=new OpenLayers.Bounds();for(var d=0,a=this.markers.length;d<a;d++){var c=this.markers[d];b.extend(c.lonlat)}}return b},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var a=null;if(this.sphericalMercator){a=this.map.calculateBounds()}else{a=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return a},initMercatorParameters:function(){this.RESOLUTIONS=[];var a=156543.0339;for(var b=0;b<=this.MAX_ZOOM_LEVEL;++b){this.RESOLUTIONS[b]=a/Math.pow(2,b)}this.units="m";this.projection="EPSG:900913"},forwardMercator:function(c,b){var a=c*20037508.34/180;var d=Math.log(Math.tan((90+b)*Math.PI/360))/(Math.PI/180);d=d*20037508.34/180;return new OpenLayers.LonLat(a,d)},inverseMercator:function(a,d){var c=(a/20037508.34)*180;var b=(d/20037508.34)*180;b=180/Math.PI*(2*Math.atan(Math.exp(b*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(c,b)},projectForward:function(a){var b=OpenLayers.Layer.SphericalMercator.forwardMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a},projectInverse:function(a){var b=OpenLayers.Layer.SphericalMercator.inverseMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);OpenLayers.Tile.WFS=OpenLayers.Class(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(d,a,e,b,c){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;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(b,a){if(this.request){this.request.abort()}this.request=OpenLayers.Request.GET({url:this.url,success:b,failure:a,scope:this})},requestSuccess:function(b){if(this.features){var d=b.responseXML;if(!d||!d.documentElement){d=b.responseText}if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(d))}else{var a=new OpenLayers.Format.XML();if(typeof d=="string"){d=a.read(d)}var c=a.getElementsByTagNameNS(d,"http://www.opengis.net/gml","featureMember");this.addResults(c)}}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"});var map;OpenLayers.IMAGE_RELOAD_ATTEMPTS=3;OpenLayers.Util.onImageLoadErrorColor="transparent";OpenLayers.Lang.code="pl";OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";var bounds;var format="image/png";var popup;var identyfication=[];function loadControls2(){map.addControl(new OpenLayers.Control.MousePosition({element:$("location")}));map.addControl(new OpenLayers.Control.Scale($("scale")));var a=new OpenLayers.Control.ScaleLine({bottomOutUnits:""});map.addControl(a);var d=new OpenLayers.Control.PanZoomBar({id:"pzb",position:new OpenLayers.Pixel(0,15)});d.draw=function(h){OpenLayers.Control.prototype.draw.apply(this,arguments);h=this.position.clone();this.buttons=[];var k=new OpenLayers.Size(18,18);var g=new OpenLayers.Pixel(h.x+k.w/2,h.y);var j=k.w;if(this.zoomWorldIcon){g=new OpenLayers.Pixel(h.x+k.w,h.y)}this._addButton("zoomin","zoom-plus-mini.png",g.add(0,k.h*3+5),k);g=this._addZoomBar(g.add(0,k.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",g,k);return this.div};map.addControl(d);var c=new OpenLayers.Control.ZoomBox({title:"Powiększ fragment mapy"});var f=new OpenLayers.Control.MouseDefaults({title:"Przeciągania mapy"});var e=new OpenLayers.Control.ZoomToMaxExtent({title:"Pokaż całą mapę"});var b=new OpenLayers.Control.Panel({defaultControl:f,position:new OpenLayers.Pixel(0,0)});b.addControls([f,c,e]);map.addControl(b)}function init(){bounds=new OpenLayers.Bounds(776675.105201767,223386.61235403398,777992.7328370222,224510.5514549142);var a={controls:[],maxExtent:bounds,minScale:5000,maxScale:500,numZoomLevels:6,projection:"EPSG:2180",units:"m",theme:null};map=new OpenLayers.Map("map",a);loadControls3();loadData_public();map.zoomToExtent(bounds);OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url="}function loadData_public(){var b="http://bolestraszyce.gis-net.pl:8080";var e=new OpenLayers.Layer.WMS("rosliny",b+"/geoserver/wms",{layers:"bolestraszyce:roslina",srs:"EPSG:2180",transparent:true,format:format},{buffer:1,isBaseLayer:false});identyfication.push(e);var d=new OpenLayers.Layer.WMS("kolekcje",b+"/geoserver/wms",{layers:"bolestraszyce:kolekcje",srs:"EPSG:2180",transparent:true,format:format},{buffer:1,isBaseLayer:false});identyfication.push(d);var c=new OpenLayers.Layer.WMS("budynki_polygon",b+"/geoserver/wms",{layers:"bolestraszyce:budynki",srs:"EPSG:2180",transparent:true,format:format},{buffer:1,isBaseLayer:false});identyfication.push(c);var f=new OpenLayers.Layer.WMS("opisy",b+"/geoserver/wms",{layers:"bolestraszyce:opisy",srs:"EPSG:2180",transparent:true,format:format},{buffer:1,isBaseLayer:false});var a=new OpenLayers.Layer.WMS("arboretum",b+"/geoserver/wms",{layers:"bolestraszyce:bolestraszyce_400dpi",srs:"EPSG:2180",styles:"",format:format,tiled:true,tilesOrigin:"776675.105201767,223386.61235403398"},{buffer:1});map.addLayers([a,e,d,f,c])}function setHTML2(a){if(a.text.indexOf("no results")==-1){var b=new OpenLayers.Pixel(a.xy.x,a.xy.y);var c=map.getLonLatFromPixel(b);if(popup!=null){popup.destroy();popup=null}popup=new OpenLayers.Popup.FramedCloud("WMSInfo",c,null,a.text,null,true);popup._contentDivPadding=new OpenLayers.Bounds(5,5,5,5);popup.autosize=false;popup.maxSize=new OpenLayers.Size(450,450);map.addPopup(popup);popup.events.register("click",map,popupDestroy)}}function popupDestroy(a){popup.destroy();popup=null;OpenLayers.Util.safeStopPropagation(a)}function loadControls3(){map.addControl(new OpenLayers.Control.MousePosition({element:$("location")}));map.addControl(new OpenLayers.Control.PanZoomBar({position:new OpenLayers.Pixel(0,0)}));map.addControl(new OpenLayers.Control.Scale($("scale")));var a=new OpenLayers.Control.ScaleLine({bottomOutUnits:"",maxWidth:300});map.addControl(a);var b=new OpenLayers.Control.NavToolbarSG();var d=new OpenLayers.Control.WMSGetFeatureInfo({id:"ident1",url:"http://bolestraszyce.gis-net.pl:8080/geoserver/wms",title:"Pokaż atrybuty obiektu",layers:identyfication,queryVisible:true});d.events.register("getfeatureinfo",this,setHTML2);b.addControls(d);var c=new OpenLayers.Control.ZoomToMaxExtent({title:"Pokaż całą mapę"});b.addControls(c);map.addControl(b)}OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,initialize:function(b,c,a){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(f,e){this.layer.events.triggerEvent("sketchmodified",{vertex:f,feature:e})},create:function(f,e){this.layer.events.triggerEvent("sketchstarted",{vertex:f,feature:e})}},this.callbacks);this.layer=b;var d=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(d){this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":d})})}this.handler=new c(this,this.callbacks,this.handlerOptions)},drawFeature:function(c){var a=new OpenLayers.Feature.Vector(c);var b=this.layer.events.triggerEvent("sketchcomplete",{feature:a});if(b!==false){a.state=OpenLayers.State.INSERT;this.layer.addFeatures([a]);this.featureAdded(a);this.events.triggerEvent("featureadded",{feature:a})}},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(b,a){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);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 b(this,this.callbacks,this.handlerOptions)},cancel:function(){this.handler.cancel()},updateHandler:function(b,a){var c=this.active;if(c){this.deactivate()}this.handler=new b(this,this.callbacks,a);if(c){this.activate()}},measureComplete:function(a){if(this.delayedTrigger){window.clearTimeout(this.delayedTrigger)}this.measure(a,"measure")},measurePartial:function(a,b){this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(b,"measurepartial")},this),this.partialDelay)},measure:function(d,b){var c,a;if(d.CLASS_NAME.indexOf("LineString")>-1){c=this.getBestLength(d);a=1}else{c=this.getBestArea(d);a=2}this.events.triggerEvent(b,{measure:c[0],units:c[1],order:a,geometry:d})},getBestArea:function(f){var b=this.displaySystemUnits[this.displaySystem];var e,d;for(var c=0,a=b.length;c<a;++c){e=b[c];d=this.getArea(f,e);if(d>1){break}}return[d,e]},getArea:function(f,a){var b,c;if(this.geodesic){b=f.getGeodesicArea(this.map.getProjectionObject());c="m"}else{b=f.getArea();c=this.map.getUnits()}var e=OpenLayers.INCHES_PER_UNIT[a];if(e){var d=OpenLayers.INCHES_PER_UNIT[c];b*=Math.pow((d/e),2)}return b},getBestLength:function(f){var b=this.displaySystemUnits[this.displaySystem];var e,d;for(var c=0,a=b.length;c<a;++c){e=b[c];d=this.getLength(f,e);if(d>1){break}}return[d,e]},getLength:function(f,a){var b,c;if(this.geodesic){b=f.getGeodesicLength(this.map.getProjectionObject());c="m"}else{b=f.getLength();c=this.map.getUnits()}var e=OpenLayers.INCHES_PER_UNIT[a];if(e){var d=OpenLayers.INCHES_PER_UNIT[c];b*=(d/e)}return b},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(h){if(h instanceof OpenLayers.Bounds){if(!this.out){var j=this.map.getLonLatFromPixel(new OpenLayers.Pixel(h.left,h.bottom));var o=this.map.getLonLatFromPixel(new OpenLayers.Pixel(h.right,h.top));var b=new OpenLayers.Bounds(j.lon,j.lat,o.lon,o.lat)}else{var g=Math.abs(h.right-h.left);var k=Math.abs(h.top-h.bottom);var e=Math.min((this.map.size.h/k),(this.map.size.w/g));var p=this.map.getExtent();var a=this.map.getLonLatFromPixel(h.getCenterPixel());var c=a.lon-(p.getWidth()/2)*e;var f=a.lon+(p.getWidth()/2)*e;var m=a.lat-(p.getHeight()/2)*e;var d=a.lat+(p.getHeight()/2)*e;var b=new OpenLayers.Bounds(c,m,f,d)}var l=this.map.getZoom();this.map.zoomToExtent(b);if(l==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(l+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(h),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(h),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(f){var e,d,h;var g=this.regExes.typeStr.exec(f);if(g){d=g[1].toLowerCase();h=g[2];if(this.parse[d]){e=this.parse[d].apply(this,[h])}if(this.internalProjection&&this.externalProjection){if(e&&e.CLASS_NAME=="OpenLayers.Feature.Vector"){e.geometry.transform(this.externalProjection,this.internalProjection)}else{if(e&&d!="geometrycollection"&&typeof e=="object"){for(var c=0,a=e.length;c<a;c++){var b=e[c];b.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return e},write:function(a){var f,j,h,d,b;if(a.constructor==Array){f=a;b=true}else{f=[a];b=false}var c=[];if(b){c.push("GEOMETRYCOLLECTION(")}for(var e=0,g=f.length;e<g;++e){if(b&&e>0){c.push(",")}j=f[e].geometry;h=j.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[h]){return null}if(this.internalProjection&&this.externalProjection){j=j.clone();j.transform(this.internalProjection,this.externalProjection)}d=this.extract[h].apply(this,[j]);c.push(h.toUpperCase()+"("+d+")")}if(b){c.push(")")}return c.join("")},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(c){var d=[];for(var b=0,a=c.components.length;b<a;++b){d.push(this.extract.point.apply(this,[c.components[b]]))}return d.join(",")},linestring:function(b){var d=[];for(var c=0,a=b.components.length;c<a;++c){d.push(this.extract.point.apply(this,[b.components[c]]))}return d.join(",")},multilinestring: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(",")},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(d){var c=[];for(var b=0,a=d.components.length;b<a;++b){c.push("("+this.extract.polygon.apply(this,[d.components[b]])+")")}return c.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(e){var c=OpenLayers.String.trim(e).split(",");var d=[];for(var b=0,a=c.length;b<a;++b){d.push(this.parse.point.apply(this,[c[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(d))},linestring:function(e){var c=OpenLayers.String.trim(e).split(",");var d=[];for(var b=0,a=c.length;b<a;++b){d.push(this.parse.point.apply(this,[c[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(d))},multilinestring:function(f){var c;var b=OpenLayers.String.trim(f).split(this.regExes.parenComma);var e=[];for(var d=0,a=b.length;d<a;++d){c=b[d].replace(this.regExes.trimParens,"$1");e.push(this.parse.linestring.apply(this,[c]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(e))},polygon:function(h){var c,b,f;var g=OpenLayers.String.trim(h).split(this.regExes.parenComma);var e=[];for(var d=0,a=g.length;d<a;++d){c=g[d].replace(this.regExes.trimParens,"$1");b=this.parse.linestring.apply(this,[c]).geometry;f=new OpenLayers.Geometry.LinearRing(b.components);e.push(f)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(e))},multipolygon:function(f){var d;var b=OpenLayers.String.trim(f).split(this.regExes.doubleParenComma);var e=[];for(var c=0,a=b.length;c<a;++c){d=b[c].replace(this.regExes.trimParens,"$1");e.push(this.parse.polygon.apply(this,[d]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(e))},geometrycollection:function(e){e=e.replace(/,\s*([A-Za-z])/g,"|$1");var d=OpenLayers.String.trim(e).split("|");var c=[];for(var b=0,a=d.length;b<a;++b){c.push(OpenLayers.Format.WKT.prototype.read.apply(this,[d[b]]))}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(b,a){b.options.maxScale=this.getChildValue(a)},read_sld_MaxScaleDenominator:function(b,a){b.options.minScale=this.getChildValue(a)},write_wmc_Layer:function(b){var c=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[b]);if(b.options.resolutions||b.options.scales||b.options.minResolution||b.options.maxScale){var d=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");d.appendChild(this.createTextNode(b.maxScale.toPrecision(10)));c.insertBefore(d,c.childNodes[3])}if(b.options.resolutions||b.options.scales||b.options.maxResolution||b.options.minScale){var a=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator");a.appendChild(this.createTextNode(b.minScale.toPrecision(10)));c.insertBefore(a,c.childNodes[4])}return c},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(b,a){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(a){var d=a.bounds;var f=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(d.left,d.top));var c=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(d.right,d.bottom));if(c==null||f==null){a.display(false)}else{var e=new OpenLayers.Size(Math.max(1,c.x-f.x),Math.max(1,c.y-f.y));var b=a.draw(f,e);if(!a.drawn){this.div.appendChild(b);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(c,a,b){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[c,b]);this.location=a;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(c,a,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadRSS()}},parseData:function(k){var p=k.responseXML;if(!p||!p.documentElement){p=OpenLayers.Format.XML.prototype.read(k.responseText)}if(this.useFeedTitle){var a=null;try{a=p.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(j){a=p.getElementsByTagName("title")[0].firstChild.nodeValue}if(a){this.setName(a)}}var t={};OpenLayers.Util.extend(t,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){t.externalProjection=this.projection;t.internalProjection=this.map.getProjectionObject()}var q=new OpenLayers.Format.GeoRSS(t);var b=q.read(p);for(var g=0,h=b.length;g<h;g++){var f={};var s=b[g];if(!s.geometry){continue}var m=s.attributes.title?s.attributes.title:"Untitled";var r=s.attributes.description?s.attributes.description:"No description.";var l=s.attributes.link?s.attributes.link:"";var o=s.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(m||r){f.title=m;f.description=r;var c='<div class="olLayerGeoRSSClose">[x]</div>';c+='<div class="olLayerGeoRSSTitle">';if(l){c+='<a class="link" href="'+l+'" target="_blank">'}c+=m;if(l){c+="</a>"}c+="</div>";c+='<div style="" class="olLayerGeoRSSDescription">';c+=r;c+="</div>";f.popupContentHTML=c}var s=new OpenLayers.Feature(this,o,f);this.features.push(s);var d=s.createMarker();d.events.register("click",s,this.markerClick);this.addMarker(d)}this.events.triggerEvent("loadend")},markerClick:function(c){var e=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!e)?this:null;for(var d=0,a=this.layer.map.popups.length;d<a;d++){this.layer.map.removePopup(this.layer.map.popups[d])}if(!e){var b=this.createPopup();OpenLayers.Event.observe(b.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(b)}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,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031,0.00000536441802978515,0.00000268220901489257],type:null,sphericalMercator:false,dragObject:null,termsOfUse:null,poweredBy:null,initialize:function(b,a){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(b){var c=null;if(b!=null){var a=b.getSouthWest();var d=b.getNorthEast();if(this.sphericalMercator){a=this.forwardMercator(a.lng(),a.lat());d=this.forwardMercator(d.lng(),d.lat())}else{a=new OpenLayers.LonLat(a.lng(),a.lat());d=new OpenLayers.LonLat(d.lng(),d.lat())}c=new OpenLayers.Bounds(a.lon,a.lat,d.lon,d.lat)}return c},getMapObjectBoundsFromOLBounds:function(c){var b=null;if(c!=null){var a=this.sphericalMercator?this.inverseMercator(c.bottom,c.left):new OpenLayers.LonLat(c.bottom,c.left);var d=this.sphericalMercator?this.inverseMercator(c.top,c.right):new OpenLayers.LonLat(c.top,c.right);b=new GLatLngBounds(new GLatLng(a.lat,a.lon),new GLatLng(d.lat,d.lon))}return b},addContainerPxFunction:function(){if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){GMap2.prototype.fromLatLngToContainerPixel=function(b){var a=this.fromLatLngToDivPixel(b);var c=this.getContainer().firstChild.firstChild;a.x+=c.offsetLeft;a.y+=c.offsetTop;return a}}},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},setMapObjectCenter:function(a,b){this.mapObject.setCenter(a,b)},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(d,b){var c;if(this.sphericalMercator){var a=this.inverseMercator(d,b);c=new GLatLng(a.lat,a.lon)}else{c=new GLatLng(b,d)}return c},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(c,b,d,a){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 f=0,b=this.grid.length;f<b;f++){var e=this.grid[f];for(var c=0,a=e.length;c<a;c++){var d=e[c];this.removeTileMonitoringHooks(d);d.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(d,a,e){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);d=d||this.map.getExtent();if(d!=null){var c=!this.grid.length||a;var b=this.getTilesBounds();if(this.singleTile){if(c||(!e&&!b.containsBounds(d))){this.initSingleTile(d)}}else{if(c||!b.containsBounds(d,true)){this.initGriddedTiles(d)}else{this.moveGriddedTiles(d)}}}},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 e=null;if(this.grid.length){var a=this.grid.length-1;var d=this.grid[a][0];var b=this.grid[0].length-1;var c=this.grid[0][b];e=new OpenLayers.Bounds(d.bounds.left,d.bounds.bottom,c.bounds.right,c.bounds.top)}return e},initSingleTile:function(f){var a=f.getCenterLonLat();var h=f.getWidth()*this.ratio;var b=f.getHeight()*this.ratio;var g=new OpenLayers.Bounds(a.lon-(h/2),a.lat-(b/2),a.lon+(h/2),a.lat+(b/2));var d=new OpenLayers.LonLat(g.left,g.top);var c=this.map.getLayerPxFromLonLat(d);if(!this.grid.length){this.grid[0]=[]}var e=this.grid[0][0];if(!e){e=this.addTile(g,c);this.addTileMonitoringHooks(e);e.draw();this.grid[0][0]=e}else{e.moveTo(g,c)}this.removeExcessTiles(1,1)},calculateGridLayout:function(a,q,e){var l=e*this.tileSize.w;var c=e*this.tileSize.h;var j=a.left-q.left;var m=Math.floor(j/l)-this.buffer;var k=j/l-m;var f=-k*this.tileSize.w;var o=q.left+m*l;var b=a.top-(q.bottom+c);var h=Math.ceil(b/c)+this.buffer;var p=h-b/c;var d=-p*this.tileSize.h;var g=q.bottom+h*c;return{tilelon:l,tilelat:c,tileoffsetlon:o,tileoffsetlat:g,tileoffsetx:f,tileoffsety:d}},initGriddedTiles:function(j){var g=this.map.getSize();var z=Math.ceil(g.h/this.tileSize.h)+Math.max(1,2*this.buffer);var B=Math.ceil(g.w/this.tileSize.w)+Math.max(1,2*this.buffer);var q=this.maxExtent;var t=this.map.getResolution();var s=this.calculateGridLayout(j,q,t);var f=Math.round(s.tileoffsetx);var c=Math.round(s.tileoffsety);var l=s.tileoffsetlon;var p=s.tileoffsetlat;var e=s.tilelon;var k=s.tilelat;this.origin=new OpenLayers.Pixel(f,c);var w=f;var A=l;var v=0;var a=parseInt(this.map.layerContainerDiv.style.left);var u=parseInt(this.map.layerContainerDiv.style.top);do{var h=this.grid[v++];if(!h){h=[];this.grid.push(h)}l=A;f=w;var d=0;do{var b=new OpenLayers.Bounds(l,p,l+e,p+k);var o=f;o-=a;var m=c;m-=u;var r=new OpenLayers.Pixel(o,m);var C=h[d++];if(!C){C=this.addTile(b,r);this.addTileMonitoringHooks(C);h.push(C)}else{C.moveTo(b,r,false)}l+=e;f+=this.tileSize.w}while((l<=j.right+e*this.buffer)||d<B);p-=k;c+=this.tileSize.h}while((p>=j.bottom-k*this.buffer)||v<z);this.removeExcessTiles(v,d);this.spiralTileLoad()},spiralTileLoad:function(){var b=[];var h=["right","down","left","up"];var g=0;var a=-1;var k=OpenLayers.Util.indexOf(h,"right");var l=0;while(l<h.length){var j=g;var c=a;switch(h[k]){case"right":c++;break;case"down":j++;break;case"left":c--;break;case"up":j--;break}var f=null;if((j<this.grid.length)&&(j>=0)&&(c<this.grid[0].length)&&(c>=0)){f=this.grid[j][c]}if((f!=null)&&(!f.queued)){b.unshift(f);f.queued=true;l=0;g=j;a=c}else{k=(k+1)%4;l++}}for(var d=0,e=b.length;d<e;d++){var f=b[d];f.draw();f.queued=false}},addTile:function(b,a){},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(c){var b=this.buffer||1;while(true){var a=this.grid[0][0].position;var d=this.map.getViewPortPxFromLayerPx(a);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 b=this.grid;var f=b[c];var e=this.map.getResolution();var h=(o)?-this.tileSize.h:this.tileSize.h;var g=e*-h;var m=(o)?b.pop():b.shift();for(var j=0,l=f.length;j<l;j++){var d=f[j];var a=d.bounds.clone();var k=d.position.clone();a.bottom=a.bottom+g;a.top=a.top+g;k.y=k.y+h;m[j].moveTo(a,k)}if(o){b.unshift(m)}else{b.push(m)}},shiftColumn:function(m){var d=(m)?-this.tileSize.w:this.tileSize.w;var c=this.map.getResolution();var k=c*d;for(var e=0,g=this.grid.length;e<g;e++){var l=this.grid[e];var j=(m)?0:(l.length-1);var b=l[j];var a=b.bounds.clone();var f=b.position.clone();a.left=a.left+k;a.right=a.right+k;f.x=f.x+d;var h=m?this.grid[e].pop():this.grid[e].shift();h.moveTo(a,f);if(m){l.unshift(h)}else{l.push(h)}}},removeExcessTiles:function(e,c){while(this.grid.length>e){var f=this.grid.pop();for(var b=0,a=f.length;b<a;b++){var d=f[b];this.removeTileMonitoringHooks(d);d.destroy()}}while(this.grid[0].length>c){for(var b=0,a=this.grid.length;b<a;b++){var f=this.grid[b];var d=f.pop();this.removeTileMonitoringHooks(d);d.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(d){var c=this.maxExtent;var f=this.getResolution();var e=f*this.tileSize.w;var b=f*this.tileSize.h;var h=this.getLonLatFromViewPortPx(d);var a=c.left+(e*Math.floor((h.lon-c.left)/e));var g=c.bottom+(b*Math.floor((h.lat-c.bottom)/b));return new OpenLayers.Bounds(a,g,a+e,g+b)},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,0.0000858306884765625,0.00004291534423828125],type:null,initialize:function(b,a){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(a,b){this.mapObject.goToPosition(a,b)},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(d,c){var a;if(this.sphericalMercator){var b=this.inverseMercator(d,c);a=new MMLatLon(b.lat,b.lon)}else{a=new MMLatLon(c,d)}return a},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(b,a){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(c,a,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadText()}},parseData:function(k){var m=k.responseText;var p={};OpenLayers.Util.extend(p,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){p.externalProjection=this.projection;p.internalProjection=this.map.getProjectionObject()}var b=new OpenLayers.Format.Text(p);var c=b.read(m);for(var g=0,h=c.length;g<h;g++){var f={};var o=c[g];var l;var j,d;l=new OpenLayers.LonLat(o.geometry.x,o.geometry.y);if(o.style.graphicWidth&&o.style.graphicHeight){j=new OpenLayers.Size(o.style.graphicWidth,o.style.graphicHeight)}if(o.style.graphicXOffset!==undefined&&o.style.graphicYOffset!==undefined){d=new OpenLayers.Pixel(o.style.graphicXOffset,o.style.graphicYOffset)}if(o.style.externalGraphic!=null){f.icon=new OpenLayers.Icon(o.style.externalGraphic,j,d)}else{f.icon=OpenLayers.Marker.defaultIcon();if(j!=null){f.icon.setSize(j)}}if((o.attributes.title!=null)&&(o.attributes.description!=null)){f.popupContentHTML="<h2>"+o.attributes.title+"</h2><p>"+o.attributes.description+"</p>"}f.overflow=o.attributes.overflow||"auto";var a=new OpenLayers.Feature(this,l,f);this.features.push(a);var e=a.createMarker();if((o.attributes.title!=null)&&(o.attributes.description!=null)){e.events.register("click",a,this.markerClick)}this.addMarker(e)}this.events.triggerEvent("loadend")},markerClick:function(b){var d=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!d)?this:null;for(var c=0,a=this.layer.map.popups.length;c<a;c++){this.layer.map.removePopup(this.layer.map.popups[c])}if(!d){this.layer.map.addPopup(this.createPopup())}OpenLayers.Event.stop(b)},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,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062],type:null,sphericalMercator:false,initialize:function(b,a){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(a,b){this.mapObject.SetCenterAndZoom(a,b)},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(d,b){var c;if(this.sphericalMercator){var a=this.inverseMercator(d,b);c=new VELatLong(a.lat,a.lon)}else{c=new VELatLong(b,d)}return c},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,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031],type:null,sphericalMercator:false,initialize:function(b,a){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(a){var b=null;if(a!=null){b=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[a]);b=18-b}return b},getMapObjectZoomFromOLZoom:function(a){var b=null;if(a!=null){b=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[a]);b=18-b}return b},setMapObjectCenter:function(a,b){this.mapObject.drawZoomAndCenter(a,b)},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(d,c){var a;if(this.sphericalMercator){var b=this.inverseMercator(d,c);a=new YGeoPoint(b.lat,b.lon)}else{a=new YGeoPoint(c,d)}return a},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(c,a,b){return OpenLayers.Function.bind(function(){c.apply(this,[a,b])},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(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var c=new OpenLayers.Protocol.Response({reqFeatures:b,requestType:"create"});c.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleCreate,c,a),headers:a.headers,data:this.format.write(b)});return c},handleCreate:function(b,a){this.handleResponse(b,a)},update:function(c,b){var a=b.url||c.url||this.options.url;b=OpenLayers.Util.applyDefaults(b,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:c,requestType:"update"});d.priv=OpenLayers.Request.PUT({url:a,callback:this.createCallback(this.handleUpdate,d,b),headers:b.headers,data:this.format.write(c)});return d},handleUpdate:function(b,a){this.handleResponse(b,a)},"delete":function(c,b){var a=b.url||c.url||this.options.url;b=OpenLayers.Util.applyDefaults(b,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:c,requestType:"delete"});d.priv=OpenLayers.Request.DELETE({url:a,callback:this.createCallback(this.handleDelete,d,b),headers:b.headers});return d},handleDelete:function(b,a){this.handleResponse(b,a)},handleResponse:function(c,a){var b=c.priv;if(a.callback){if(b.status>=200&&b.status<300){if(c.requestType!="delete"){c.features=this.parseFeatures(b)}c.code=OpenLayers.Protocol.Response.SUCCESS}else{c.code=OpenLayers.Protocol.Response.FAILURE}a.callback.call(a.scope,c)}},parseFeatures:function(a){var b=a.responseXML;if(!b||!b.documentElement){b=a.responseText}if(!b||b.length<=0){return null}return this.format.read(b)},commit:function(b,r){r=OpenLayers.Util.applyDefaults(r,this.options);var d=[],m=0;var k={};k[OpenLayers.State.INSERT]=[];k[OpenLayers.State.UPDATE]=[];k[OpenLayers.State.DELETE]=[];var q,l,c=[];for(var e=0,j=b.length;e<j;++e){q=b[e];l=k[q.state];if(l){l.push(q);c.push(q)}}var g=(k[OpenLayers.State.INSERT].length>0?1:0)+k[OpenLayers.State.UPDATE].length+k[OpenLayers.State.DELETE].length;var p=true;var a=new OpenLayers.Protocol.Response({reqFeatures:c});function h(t){var s=t.features?t.features.length:0;var v=new Array(s);for(var u=0;u<s;++u){v[u]=t.features[u].fid}a.insertIds=v;o.apply(this,[t])}function o(s){this.callUserCallback(s,r);p=p&&s.success();m++;if(m>=g){if(r.callback){a.code=p?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;r.callback.apply(r.scope,[a])}}}var f=k[OpenLayers.State.INSERT];if(f.length>0){d.push(this.create(f,OpenLayers.Util.applyDefaults({callback:h,scope:this},r.create)))}f=k[OpenLayers.State.UPDATE];for(var e=f.length-1;e>=0;--e){d.push(this.update(f[e],OpenLayers.Util.applyDefaults({callback:o,scope:this},r.update)))}f=k[OpenLayers.State.DELETE];for(var e=f.length-1;e>=0;--e){d.push(this["delete"](f[e],OpenLayers.Util.applyDefaults({callback:o,scope:this},r["delete"])))}return d},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(b,a){OpenLayers.Util.extend(this,a);this.rules=[];if(a&&a.rules){this.addRules(a.rules)}this.setDefaultStyle(b||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(k){var a=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),k);var j=this.rules;var h,b;var c=[];var f=false;for(var d=0,e=j.length;d<e;d++){h=j[d];var g=h.evaluate(k);if(g){if(h instanceof OpenLayers.Rule&&h.elseFilter){c.push(h)}else{f=true;this.applySymbolizer(h,a,k)}}}if(f==false&&c.length>0){f=true;for(var d=0,e=c.length;d<e;d++){this.applySymbolizer(c[d],a,k)}}if(j.length>0&&f==false){a.display="none"}return a},applySymbolizer:function(f,d,b){var a=b.geometry?this.getSymbolizerPrefix(b.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var c=f.symbolizer[a]||f.symbolizer;if(this.defaultsPerSymbolizer===true){var e=this.defaultStyle;OpenLayers.Util.applyDefaults(c,{pointRadius:e.pointRadius});if(c.stroke===true||c.graphic===true){OpenLayers.Util.applyDefaults(c,{strokeWidth:e.strokeWidth,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeDashstyle:e.strokeDashstyle,strokeLinecap:e.strokeLinecap})}if(c.fill===true||c.graphic===true){OpenLayers.Util.applyDefaults(c,{fillColor:e.fillColor,fillOpacity:e.fillOpacity})}if(c.graphic===true){OpenLayers.Util.applyDefaults(c,{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(d,c),b)},createLiterals:function(d,c){var b=this.context||c.attributes||c.data;for(var a in this.propertyStyles){d[a]=OpenLayers.Style.createLiteral(d[a],b,c)}return d},findPropertyStyles:function(){var d={};var f=this.defaultStyle;this.addPropertyStyles(d,f);var h=this.rules;var e,g;for(var c=0,a=h.length;c<a;c++){e=h[c].symbolizer;for(var b in e){g=e[b];if(typeof g=="object"){this.addPropertyStyles(d,g)}else{this.addPropertyStyles(d,e);break}}}return d},addPropertyStyles:function(b,c){var d;for(var a in c){d=c[a];if(typeof d=="string"&&d.match(/\$\{\w+\}/)){b[a]=true}}return b},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(d){var c=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var b=0,a=c.length;b<a;b++){if(d.CLASS_NAME.indexOf(c[b])!=-1){return c[b]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(c,b,a){if(typeof c=="string"&&c.indexOf("${")!=-1){c=OpenLayers.String.format(c,b,[a]);c=(isNaN(c)||!c)?c:parseFloat(c)}return c};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 a={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var b={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,a,b);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},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(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1)},defaultDblRightClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom-1)},wheelChange:function(h,c){var f=this.map.getZoom()+c;if(!this.map.isValidZoomLevel(f)){return}var j=this.map.getSize();var e=j.w/2-h.xy.x;var d=h.xy.y-j.h/2;var g=this.map.baseLayer.getResolutionForZoom(f);var a=this.map.getLonLatFromPixel(h.xy);var b=new OpenLayers.LonLat(a.lon+e*g,a.lat+d*g);this.map.setCenter(b,f)},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(b){var a=this.getBounds();if(!a){this.setBounds(b)}else{this.bounds.extend(b)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(b,a){},getVertices:function(a){},atPoint:function(e,h,f){var c=false;var d=this.getBounds();if((d!=null)&&(e!=null)){var b=(h!=null)?h:0;var a=(f!=null)?f:0;var g=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-a,this.bounds.right+b,this.bounds.top+a);c=g.containsLonLat(e)}return c},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(f){var g=arguments.callee.format;if(!g){g=new OpenLayers.Format.WKT();arguments.callee.format=g}var d;var b=g.read(f);if(b instanceof OpenLayers.Feature.Vector){d=b.geometry}else{if(b instanceof Array){var a=b.length;var e=new Array(a);for(var c=0;c<a;++c){e[c]=b[c].geometry}d=new OpenLayers.Geometry.Collection(e)}}return d};OpenLayers.Geometry.segmentsIntersect=function(a,I,b){var t=b&&b.point;var A=b&&b.tolerance;var f=false;var C=a.x1-I.x1;var G=a.y1-I.y1;var q=a.x2-a.x1;var z=a.y2-a.y1;var u=I.y2-I.y1;var l=I.x2-I.x1;var E=(u*q)-(l*z);var e=(l*G)-(u*C);var c=(q*G)-(z*C);if(E==0){if(e==0&&c==0){f=true}}else{var F=e/E;var D=c/E;if(F>=0&&F<=1&&D>=0&&D<=1){if(!t){f=true}else{var h=a.x1+(F*q);var g=a.y1+(F*z);f=new OpenLayers.Geometry.Point(h,g)}}}if(A){var s;if(f){if(t){var o=[a,I];var B,h,g;outer:for(var w=0;w<2;++w){B=o[w];for(var v=1;v<3;++v){h=B["x"+v];g=B["y"+v];s=Math.sqrt(Math.pow(h-f.x,2)+Math.pow(g-f.y,2));if(s<A){f.x=h;f.y=g;break outer}}}}}else{var o=[a,I];var r,H,h,g,m,k;outer:for(var w=0;w<2;++w){r=o[w];H=o[(w+1)%2];for(var v=1;v<3;++v){m={x:r["x"+v],y:r["y"+v]};k=OpenLayers.Geometry.distanceToSegment(m,H);if(k.distance<A){if(t){f=new OpenLayers.Geometry.Point(m.x,m.y)}else{f=true}break outer}}}}}return f};OpenLayers.Geometry.distanceToSegment=function(l,d){var c=l.x;var k=l.y;var b=d.x1;var j=d.y1;var a=d.x2;var f=d.y2;var o=a-b;var m=f-j;var h=((o*(c-b))+(m*(k-j)))/(Math.pow(o,2)+Math.pow(m,2));var g,e;if(h<=0){g=b;e=j}else{if(h>=1){g=a;e=f}else{g=b+h*o;e=j+h*m}}return{distance:Math.sqrt(Math.pow(g-c,2)+Math.pow(e-k,2)),x:g,y:e}};OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:true,initialize:function(d,c,e,b){var a=[];e=OpenLayers.Util.upperCaseObject(e);a.push(d,c,e,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.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(e){e=this.adjustBounds(e);var d=this.projection.getCode().split(":");var c=d[d.length-1];var g=this.getImageSize();var h={BBOX:e.toBBOX(),SIZE:g.w+","+g.h,F:"image",BBOXSR:c,IMAGESR:c};if(this.layerDefs){var f=[];var a;for(a in this.layerDefs){if(this.layerDefs.hasOwnProperty(a)){if(this.layerDefs[a]){f.push(a);f.push(":");f.push(this.layerDefs[a]);f.push(";")}}}if(f.length>0){h.LAYERDEFS=f.join("")}}var b=this.getFullRequestString(h);return b},setLayerFilter:function(b,a){if(!this.layerDefs){this.layerDefs={}}if(a){this.layerDefs[b]=a}else{delete this.layerDefs[b]}},clearLayerFilter:function(a){if(a){delete this.layerDefs[a]}else{delete this.layerDefs}},mergeNewParams:function(c){var b=OpenLayers.Util.upperCaseObject(c);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,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(d,c,e,b){var a=[];a.push(d,c,e,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(c){c=this.adjustBounds(c);var d=this.map.getResolution();var e=Math.round((this.map.getScale()*10000))/10000;var b=Math.round(c.left/d);var a=-Math.round(c.top/d);return this.getFullRequestString({t:a,l:b,s:e})},addTile:function(c,a){var b=this.getURL(c);return new OpenLayers.Tile.Image(this,a,c,b,this.tileSize)},calculateGridLayout:function(a,q,e){var l=e*this.tileSize.w;var c=e*this.tileSize.h;var j=a.left;var m=Math.floor(j/l)-this.buffer;var k=j/l-m;var f=-k*this.tileSize.w;var o=m*l;var b=a.top;var h=Math.ceil(b/c)+this.buffer;var p=h-b/c;var d=-(p+1)*this.tileSize.h;var g=h*c;return{tilelon:l,tilelat:c,tileoffsetlon:o,tileoffsetlat:g,tileoffsetx:f,tileoffsety:d}},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(c){var e=this.getResolution();var d=e*this.tileSize.w;var b=e*this.tileSize.h;var g=this.getLonLatFromViewPortPx(c);var a=d*Math.floor(g.lon/d);var f=b*Math.floor(g.lat/b);return new OpenLayers.Bounds(a,f,a+d,f+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(c,b,d,a){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(a==null||a.isBaseLayer==null){this.isBaseLayer=((this.transparent!="true")&&(this.transparent!=true))}if(a&&a.useOverlay!=null){this.useOverlay=a.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(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(a){var d;var b=a.getCenterLonLat();var h=this.map.getCurrentSize();if(this.singleTile){var e={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:h.h*this.ratio,setdisplaywidth:h.w*this.ratio,setviewcenterx:b.lon,setviewcentery:b.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var j={};j=OpenLayers.Util.extend(j,e);j.operation="GETVISIBLEMAPEXTENT";j.version="1.0.0";j.session=this.params.session;j.mapName=this.params.mapName;j.format="text/xml";d=this.getFullRequestString(j);OpenLayers.Request.GET({url:d,async:false})}d=this.getFullRequestString(e)}else{var g=this.map.getResolution();var f=Math.floor((a.left-this.maxExtent.left)/g);f=Math.round(f/this.tileSize.w);var c=Math.floor((this.maxExtent.top-a.top)/g);c=Math.round(c/this.tileSize.h);if(this.useHttpTile){d=this.getImageFilePath({tilecol:f,tilerow:c,scaleindex:this.resolutions.length-this.map.zoom-1})}else{d=this.getFullRequestString({tilecol:f,tilerow:c,scaleindex:this.resolutions.length-this.map.zoom-1})}}return d},getFullRequestString:function(f,e){var b=(e==null)?this.url:e;if(typeof b=="object"){b=b[Math.floor(Math.random()*b.length)]}var j=b;var g=OpenLayers.Util.extend({},this.params);g=OpenLayers.Util.extend(g,f);var d=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(b));for(var h in g){if(h.toUpperCase() in d){delete g[h]}}var a=OpenLayers.Util.getParameterString(g);a=a.replace(/,/g,"+");if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){j+=a}else{if(b.indexOf("?")==-1){j+="?"+a}else{j+="&"+a}}}return j},getImageFilePath:function(g,e){var c=(e==null)?this.url:e;if(typeof c=="object"){c=c[Math.floor(Math.random()*c.length)]}var b=c;var d="";var f="";if(g.tilerow<0){d="-"}if(g.tilerow==0){d+="0"}else{d+=Math.floor(Math.abs(g.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(g.tilecol<0){f="-"}if(g.tilecol==0){f+="0"}else{f+=Math.floor(Math.abs(g.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var a="/S"+Math.floor(g.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+d+"/C"+f+"/"+(g.tilerow%this.params.tileRowsPerFolder)+"_"+(g.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){a+="?"+this.params.querystring}b+=a;return b},calculateGridLayout:function(a,q,e){var l=e*this.tileSize.w;var c=e*this.tileSize.h;var j=a.left-q.left;var m=Math.floor(j/l)-this.buffer;var k=j/l-m;var f=-k*this.tileSize.w;var o=q.left+m*l;var b=q.top-a.top+c;var h=Math.floor(b/c)-this.buffer;var p=h-b/c;var d=p*this.tileSize.h;var g=q.top-c*h;return{tilelon:l,tilelat:c,tileoffsetlon:o,tileoffsetlat:g,tileoffsetx:f,tileoffsety:d}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(d,c,e,b){var a=[];a.push(d,c,e,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(b==null||b.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(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(c){c=this.adjustBounds(c);var b=[c.left,c.bottom,c.right,c.top];var d=this.getImageSize();var a=this.getFullRequestString({mapext:b,imgext:b,map_size:[d.w,d.h],imgx:d.w/2,imgy:d.h/2,imgxy:[d.w,d.h]});return a},getFullRequestString:function(f,e){var b=(e==null)?this.url:e;var g=OpenLayers.Util.extend({},this.params);g=OpenLayers.Util.extend(g,f);var a=OpenLayers.Util.getParameterString(g);if(b instanceof Array){b=this.selectUrl(a,b)}var d=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var h in g){if(h.toUpperCase() in d){delete g[h]}}a=OpenLayers.Util.getParameterString(g);var j=b;a=a.replace(/,/g,"+");if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){j+=a}else{if(b.indexOf("?")==-1){j+="?"+a}else{j+="&"+a}}}return j},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(d,c,b){var a=[];a.push(d,c,{},b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},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(d){d=this.adjustBounds(d);var c=this.map.getResolution();var a=Math.round((d.left-this.tileOrigin.lon)/(c*this.tileSize.w));var g=Math.round((d.bottom-this.tileOrigin.lat)/(c*this.tileSize.h));var f=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,c):this.map.getZoom();var e=this.serviceVersion+"/"+this.layername+"/"+f+"/"+a+"/"+g+"."+this.type;var b=this.url;if(b instanceof Array){b=this.selectUrl(e,b)}return b+e},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,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(c,b,d,a){this.layername=d;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[c,b,{},a]);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(b){var f=this.map.getResolution();var g=this.maxExtent;var l=this.tileSize;var a=Math.round((b.left-g.left)/(f*l.w));var k=Math.round((b.bottom-g.bottom)/(f*l.h));var h=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,f):this.map.getZoom();function e(q,p){q=String(q);var m=[];for(var o=0;o<p;++o){m.push("0")}return m.join("").substring(0,p-q.length)+q}var d=[this.layername,e(h,2),e(parseInt(a/1000000),3),e((parseInt(a/1000)%1000),3),e((parseInt(a)%1000),3),e(parseInt(k/1000000),3),e((parseInt(k/1000)%1000),3),e((parseInt(k)%1000),3)+"."+this.extension];var j=d.join("/");var c=this.url;if(c instanceof Array){c=this.selectUrl(j,c)}c=(c.charAt(c.length-1)=="/")?c:c+"/";return c+j},addTile:function(c,a){var b=this.getURL(c);return new OpenLayers.Tile.Image(this,a,c,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(d,c,e,b){var a=[];e=OpenLayers.Util.upperCaseObject(e);a.push(d,c,e,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.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 d={BBOX:this.encodeBBOX?b.toBBOX():b.toArray(),WIDTH:c.w,HEIGHT:c.h};var a=this.getFullRequestString(d);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},mergeNewParams:function(c){var b=OpenLayers.Util.upperCaseObject(c);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},getFullRequestString:function(c,b){var a=this.map.getProjection();this.params.SRS=(a=="none")?null:a;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(d,c,e,g,f,b){this.lzd=e;this.zoomLevels=g;var a=[];a.push(d,c,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getZoom:function(){var b=this.map.getZoom();var a=this.map.getMaxExtent();b=b-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2);return b},getURL:function(e){e=this.adjustBounds(e);var d=this.getZoom();var b=this.map.getMaxExtent();var c=this.lzd/Math.pow(2,this.getZoom());var a=Math.floor((e.left-b.left)/c);var f=Math.floor((e.bottom-b.bottom)/c);if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return this.getFullRequestString({L:d,X:a,Y:f})}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(d,c,b){if(b&&b.sphericalMercator||this.sphericalMercator){b=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"},b)}c=c||this.url;d=d||this.name;var a=[d,c,{},b];OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},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(a){var d=this.map.getResolution();var g=Math.round((a.left-this.maxExtent.left)/(d*this.tileSize.w));var f=Math.round((this.maxExtent.top-a.top)/(d*this.tileSize.h));var e=this.map.getZoom();var c=Math.pow(2,e);var b=this.url;var j=""+g+f+e;if(b instanceof Array){b=this.selectUrl(j,b)}var h=OpenLayers.String.format(b,{x:g,y:f,z:e});return h},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,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(b){b=OpenLayers.Util.applyDefaults(b,this.options);var c,d=[];var a=this.db.execute("SELECT * FROM "+this.tableName);while(a.isValidRow()){c=this.unfreezeFeature(a);if(this.evaluateFilter(c,b.filter)){if(!b.noFeatureStateReset){c.state=null}d.push(c)}a.next()}a.close();var e=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"read",features:d});if(b&&b.callback){b.callback.call(b.scope,e)}return e},unfreezeFeature:function(d){var a;var b=d.fieldByName("geometry");if(b==this.NULL_GEOMETRY){a=new OpenLayers.Feature.Vector()}else{a=this.wktParser.read(b)}a.attributes=this.jsonParser.read(d.fieldByName("properties"));a.fid=this.extractFidFromField(d.fieldByName("fid"));var c=d.fieldByName("state");if(c==this.NULL_FEATURE_STATE){c=null}a.state=c;return a},extractFidFromField:function(a){if(!a.match(this.fidRegExp)&&this.typeOfFid=="number"){a=parseFloat(a)}return a},create:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var c=this.createOrUpdate(b);c.requestType="create";if(a&&a.callback){a.callback.call(a.scope,c)}return c},update:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var c=this.createOrUpdate(b);c.requestType="update";if(a&&a.callback){a.callback.call(a.scope,c)}return c},createOrUpdate:function(e){if(!(e instanceof Array)){e=[e]}var c,a=e.length,b;var d=new Array(a);for(c=0;c<a;c++){b=e[c];var f=this.freezeFeature(b);this.db.execute("REPLACE INTO "+this.tableName+" (fid, geometry, properties, state) VALUES (?, ?, ?, ?)",f);var g=b.clone();g.fid=this.extractFidFromField(f[0]);d[c]=g}return new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,features:d,reqFeatures:e})},freezeFeature:function(b){b.fid=b.fid!=null?""+b.fid:OpenLayers.Util.createUniqueID(this.FID_PREFIX);var d=b.geometry!=null?b.geometry.toString():this.NULL_GEOMETRY;var a=this.jsonParser.write(b.attributes);var c=this.getFeatureStateForFreeze(b);return[b.fid,d,a,c]},getFeatureStateForFreeze:function(a){var b;if(!this.saveFeatureState){b=this.NULL_FEATURE_STATE}else{if(this.createdOffline(a)){b=OpenLayers.State.INSERT}else{b=a.state}}return b},"delete":function(f,c){if(!(f instanceof Array)){f=[f]}c=OpenLayers.Util.applyDefaults(c,this.options);var e,a,d;for(e=0,a=f.length;e<a;e++){d=f[e];if(this.saveFeatureState&&!this.createdOffline(d)){var b=d.clone();b.fid=d.fid;if(b.geometry){b.geometry.destroy();b.geometry=null}b.state=d.state;this.createOrUpdate(b)}else{this.db.execute("DELETE FROM "+this.tableName+" WHERE fid = ?",[d.fid])}}var g=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"delete",reqFeatures:f});if(c&&c.callback){c.callback.call(c.scope,g)}return g},createdOffline:function(a){return(typeof a.fid=="string"&&!!(a.fid.match(this.fidRegExp)))},commit:function(c,m){var b,e=[],g=0,h=0;function k(o){if(++h<g){o.last=false}this.callUserCallback(m,o)}var l,j=[],a=[],d=[];for(var f=c.length-1;f>=0;f--){l=c[f];switch(l.state){case OpenLayers.State.INSERT:j.push(l);break;case OpenLayers.State.UPDATE:a.push(l);break;case OpenLayers.State.DELETE:d.push(l);break}}if(j.length>0){g++;b=OpenLayers.Util.applyDefaults({callback:k,scope:this},m.create);e.push(this.create(j,b))}if(a.length>0){g++;b=OpenLayers.Util.applyDefaults({callback:k,scope:this},m.update);e.push(this.update(a,b))}if(d.length>0){g++;b=OpenLayers.Util.applyDefaults({callback:k,scope:this},m["delete"]);e.push(this["delete"](d,b))}return e},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(c){var b=this.getContext(c);var a=true;if(this.minScaleDenominator||this.maxScaleDenominator){var d=c.layer.map.getScale()}if(this.minScaleDenominator){a=d>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b)}if(a&&this.maxScaleDenominator){a=d<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b)}if(a&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){a=this.filter.evaluate(c)}else{a=this.filter.evaluate(b)}}return a},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 a=OpenLayers.Util.extend({},this);a.symbolizer={};for(var b in this.symbolizer){value=this.symbolizer[b];type=typeof value;if(type==="object"){a.symbolizer[b]=OpenLayers.Util.extend({},value)}else{if(type==="string"){a.symbolizer[b]=value}}}a.filter=this.filter&&this.filter.clone();a.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(a)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(c,a){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(c instanceof OpenLayers.Style){this.styles["default"]=c;this.styles.select=c;this.styles.temporary=c;this.styles["delete"]=c}else{if(typeof c=="object"){for(var b in c){if(c[b] instanceof OpenLayers.Style){this.styles[b]=c[b]}else{if(typeof c[b]=="object"){this.styles[b]=new OpenLayers.Style(c[b])}else{this.styles["default"]=new OpenLayers.Style(c);this.styles.select=new OpenLayers.Style(c);this.styles.temporary=new OpenLayers.Style(c);this.styles["delete"]=new OpenLayers.Style(c);break}}}}}OpenLayers.Util.extend(this,a)},destroy:function(){for(var a in this.styles){this.styles[a].destroy()}this.styles=null},createSymbolizer:function(b,c){if(!b){b=new OpenLayers.Feature.Vector()}if(!this.styles[c]){c="default"}b.renderIntent=c;var a={};if(this.extendDefault&&c!="default"){a=this.styles["default"].createSymbolizer(b)}return OpenLayers.Util.extend(a,this.styles[c].createSymbolizer(b))},addUniqueValueRules:function(b,d,f,a){var e=[];for(var c in f){e.push(new OpenLayers.Rule({symbolizer:f[c],context:a,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:d,value:c})}))}this.styles[b].addRules(e)},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.Control.NavToolbarSG=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Navigation({title:"Obsługa nawigacji"}),new OpenLayers.Control.ZoomBox({title:"Powiększenie obszaru"})])},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 a=false;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:var b=c[this.property];var e=this.value;if(!this.matchCase&&typeof b=="string"&&typeof e=="string"){a=(b.toUpperCase()==e.toUpperCase())}else{a=(b==e)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:var b=c[this.property];var e=this.value;if(!this.matchCase&&typeof b=="string"&&typeof e=="string"){a=(b.toUpperCase()!=e.toUpperCase())}else{a=(b!=e)}break;case OpenLayers.Filter.Comparison.LESS_THAN:a=c[this.property]<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:a=c[this.property]>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:a=c[this.property]<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:a=c[this.property]>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:a=(c[this.property]>=this.lowerBoundary)&&(c[this.property]<=this.upperBoundary);break;case OpenLayers.Filter.Comparison.LIKE:var d=new RegExp(this.value,"gi");a=d.test(c[this.property]);break}return a},value2regex:function(d,b,a){if(d=="."){var c="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";OpenLayers.Console.error(c);return null}d=d?d:"*";b=b?b:".";a=a?a:"!";this.value=this.value.replace(new RegExp("\\"+a+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+b,"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"),"\\"+b);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(c){for(var b=0,a=this.fids.length;b<a;b++){var d=c.fid||c.id;if(d==this.fids[b]){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(c){switch(this.type){case OpenLayers.Filter.Logical.AND:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(c)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(c)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(c))}},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(c){var a=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(c.geometry){var b=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){b=this.value.toGeometry()}if(c.geometry.intersects(b)){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(c){if(!(c instanceof Array)){c=[c]}for(var b=0,a=c.length;b<a;b++){this.addComponent(c[b])}},addComponent:function(b,a){var d=false;if(b){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,b.CLASS_NAME)>-1)){if(a!=null&&(a<this.components.length)){var e=this.components.slice(0,a);var c=this.components.slice(a,this.components.length);e.push(b);this.components=e.concat(c)}else{this.components.push(b)}b.parent=this;this.clearBounds();d=true}}return d},removeComponents:function(b){if(!(b instanceof Array)){b=[b]}for(var a=b.length-1;a>=0;--a){this.removeComponent(b[a])}},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 c=0;for(var b=0,a=this.components.length;b<a;b++){c+=this.components[b].getArea()}return c},getGeodesicArea:function(b){var d=0;for(var c=0,a=this.components.length;c<a;c++){d+=this.components[c].getGeodesicArea(b)}return d},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,d){for(var c=0,a=this.components.length;c<a;c++){this.components[c].move(b,d)}},rotate:function(d,b){for(var c=0,a=this.components.length;c<a;++c){this.components[c].rotate(d,b)}},resize:function(d,a,c){for(var b=0;b<this.components.length;++b){this.components[b].resize(d,a,c)}return this},distanceTo:function(g,h){var b=!(h&&h.edge===false);var a=b&&h&&h.details;var j,c;var d=Number.POSITIVE_INFINITY;for(var e=0,f=this.components.length;e<f;++e){j=this.components[e].distanceTo(g,h);distance=a?j.distance:j;if(distance<d){d=distance;c=j;if(d==0){break}}}return c},equals:function(d){var b=true;if(!d||!d.CLASS_NAME||(this.CLASS_NAME!=d.CLASS_NAME)){b=false}else{if(!(d.components instanceof Array)||(d.components.length!=this.components.length)){b=false}else{for(var c=0,a=this.components.length;c<a;++c){if(!this.components[c].equals(d.components[c])){b=false;break}}}}return b},transform:function(e,c){if(e&&c){for(var d=0,a=this.components.length;d<a;d++){var b=this.components[d];b.transform(e,c)}this.bounds=null}return this},intersects:function(d){var b=false;for(var c=0,a=this.components.length;c<a;++c){b=d.intersects(this.components[c]);if(b){break}}return b},getVertices:function(b){var c=[];for(var d=0,a=this.components.length;d<a;++d){Array.prototype.push.apply(c,this.components[d].getVertices(b))}return c},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(f,k){var d=!(k&&k.edge===false);var a=d&&k&&k.details;var b,e,h,c,g,j;if(f instanceof OpenLayers.Geometry.Point){e=this.x;h=this.y;c=f.x;g=f.y;b=Math.sqrt(Math.pow(e-c,2)+Math.pow(h-g,2));j=!a?b:{x0:e,y0:h,x1:c,y1:g,distance:b}}else{j=f.distanceTo(this,k);if(a){j={x0:j.x1,y0:j.y1,x1:j.x0,y1:j.y0,distance:j.distance}}}return j},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},toShortString:function(){return(this.x+", "+this.y)},move:function(a,b){this.x=this.x+a;this.y=this.y+b;this.clearBounds()},rotate:function(d,b){d*=Math.PI/180;var a=this.distanceTo(b);var c=d+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+(a*Math.cos(c));this.y=b.y+(a*Math.sin(c));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(c,a,b){b=(b==undefined)?1:b;this.x=a.x+(c*b*(this.x-a.x));this.y=a.y+(c*(this.y-a.y));this.clearBounds();return this},intersects:function(b){var a=false;if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.equals(b)}else{a=b.intersects(this)}return a},transform:function(b,a){if((b&&a)){OpenLayers.Projection.transform(this,b,a);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(b,d,c,a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=b;this.y=d;this.width=c;this.height=a},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(c,b,d,a){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments);this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||DEFAULT_FORMAT]},getURL:function(a){a=this.adjustBounds(a);var f=this.map.getResolution();var e=Math.round((this.map.getScale()*10000))/10000;var d=Math.round(a.left/f);var c=-Math.round(a.top/f);var j=Math.floor(d/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w;var h=Math.floor(c/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h;var b=this.url;if(b instanceof Array){b=this.selectUrl(paramsString,b)}var g=[b,"/",this.params.map,"/",e,"/",this.params.g.replace(/\s/g,"_"),"/def/t",h,"/l",j,"/t",c,"l",d,".",this.extension];return g.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:true,initialize:function(c,b,e,a){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(c,b){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var d=0,a=this.strategies.length;d<a;d++){this.strategies[d].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 c=0,a=this.renderers.length;c<a;c++){var b=OpenLayers.Renderer[this.renderers[c]];if(b&&b.prototype.supported()){this.renderer=new b(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(c){if(this.strategies){var d,b,a;for(b=0,a=this.strategies.length;b<a;b++){d=this.strategies[b];if(d.autoActivate){d.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(g,b,h){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var e=true;if(!h){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 f=this.map.getExtent();e=this.renderer.setExtent(f,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 d in this.unrenderedFeatures){var c=this.unrenderedFeatures[d];this.drawFeature(c)}}}if(!this.drawn||b||!e){this.drawn=true;var c;for(var d=0,a=this.features.length;d<a;d++){this.renderer.locked=(d!==(a-1));c=this.features[d];this.drawFeature(c)}}},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(b,j){if(!(b instanceof Array)){b=[b]}var g=!j||!j.silent;if(g){var a={features:b};var f=this.events.triggerEvent("beforefeaturesadded",a);if(f===false){return}b=a.features}for(var c=0,e=b.length;c<e;c++){if(c!=(b.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var h=b[c];if(this.geometryType&&!(h.geometry instanceof this.geometryType)){var d=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw d}this.features.push(h);h.layer=this;if(!h.style&&this.style){h.style=OpenLayers.Util.extend({},this.style)}if(g){if(this.events.triggerEvent("beforefeatureadded",{feature:h})===false){continue}this.preFeatureInsert(h)}this.drawFeature(h);if(g){this.events.triggerEvent("featureadded",{feature:h});this.onFeatureInsert(h)}}if(g){this.events.triggerEvent("featuresadded",{features:b})}},removeFeatures:function(e,a){if(!e||e.length===0){return}if(!(e instanceof Array)){e=[e]}if(e===this.features){e=e.slice()}var d=!a||!a.silent;for(var c=e.length-1;c>=0;c--){if(c!=0&&e[c-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var b=e[c];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,a){var c=(d==undefined);if(c){d=this.features}if(d){this.removeFeatures(d,a);for(var b=d.length-1;b>=0;b--){d[b].destroy()}}},drawFeature:function(a,b){if(!this.drawn){return}if(typeof b!="object"){if(!b&&a.state===OpenLayers.State.DELETE){b="delete"}var c=b||a.renderIntent;b=a.style||this.style;if(!b){b=this.styleMap.createSymbolizer(a,c)}}if(!this.renderer.drawFeature(a,b)){this.unrenderedFeatures[a.id]=a}else{delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var b=this.renderer.getFeatureIdFromEvent(a);return this.getFeatureById(b)},getFeatureById:function(d){var c=null;for(var b=0,a=this.features.length;b<a;++b){if(this.features[b].id==d){c=this.features[b];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(c,b,e,a){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(a){var c;for(var b=this.features.length-1;b>=0;--b){c=this.features[b];if(!a||a.except!=c){this.unselect(c)}}},selectSingle:function(a){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var b=this.pixelToBounds(a.xy);this.setModifiers(a);this.request(b,{single:true})},selectBox:function(a){if(a instanceof OpenLayers.Bounds){var d=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));var c=new OpenLayers.Bounds(d.lon,d.lat,b.lon,b.lat);this.setModifiers(this.handlers.box.dragHandler.evt);this.request(c)}},selectHover:function(a){var b=this.pixelToBounds(a.xy);this.request(b,{single:true,hover:true})},cancelHover:function(){if(this.hoverResponse){this.protocol.abort(this.hoverResponse);this.hoverResponse=null}},request:function(d,b){b=b||{};var c=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:d});var a=this.protocol.read({maxFeatures:b.single==true?this.maxFeatures:undefined,filter:c,callback:function(e){if(e.code==1){if(e.features.length){if(b.single==true){this.selectBestFeature(e.features,d.getCenterLonLat(),b)}else{this.select(e.features)}}else{if(b.hover){this.hoverSelect()}else{this.events.triggerEvent("clickout");if(this.clickout){this.unselectAll()}}}}OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});if(b.hover==true){this.hoverResponse=a}},selectBestFeature:function(b,a,j){j=j||{};if(b.length){var g=new OpenLayers.Geometry.Point(a.lon,a.lat);var h,d,e;var f=Number.MAX_VALUE;for(var c=0;c<b.length;++c){h=b[c];if(h.geometry){e=g.distanceTo(h.geometry,{edge:false});if(e<f){f=e;d=h;if(f==0){break}}}}if(j.hover==true){this.hoverSelect(d)}else{this.select(d||b)}}},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 c;for(var b=0,a=d.length;b<a;++b){c=d[b];if(this.features[c.fid||c.id]){if(this.modifiers.toggle){this.unselect(this.features[c.fid||c.id])}}else{cont=this.events.triggerEvent("beforefeatureselected",{feature:c});if(cont!==false){this.features[c.fid||c.id]=c;this.events.triggerEvent("featureselected",{feature:c})}}}},hoverSelect:function(a){var c=a?a.fid||a.id:null;var b=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;if(b&&b!=c){this.events.triggerEvent("outfeature",{feature:this.hoverFeature});this.hoverFeature=null}if(c&&c!=b){this.events.triggerEvent("hoverfeature",{feature:a});this.hoverFeature=a}},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 e=b.add(-this.clickTolerance/2,this.clickTolerance/2);var a=b.add(this.clickTolerance/2,-this.clickTolerance/2);var c=this.map.getLonLatFromPixel(e);var d=this.map.getLonLatFromPixel(a);return new OpenLayers.Bounds(c.lon,c.lat,d.lon,d.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(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.layer){this.setLayer(this.options.layer)}var b=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(b,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(b){this.targets=[];if(b&&b.length){var d;for(var c=0,a=b.length;c<a;++c){d=b[c];if(d instanceof OpenLayers.Layer.Vector){this.addTargetLayer(d)}else{this.addTarget(d)}}}},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(b){var c;for(var a=this.targets.length-1;a>=0;--a){c=this.targets[a];if(c.layer===b){this.removeTarget(c)}}},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(a){this.feature=a.feature;var b=this.layer.map.getLonLatFromViewPortPx(a.pixel);this.considerSnapping(a.vertex,new OpenLayers.Geometry.Point(b.lon,b.lat))},considerSnapping:function(h,d){var a={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null};var c=false;var j,f;for(var b=0,e=this.targets.length;b<e;++b){f=this.targets[b];j=this.testTarget(f,d);if(j){if(this.greedy){a=j;a.target=f;c=true;break}else{if((j.rank<a.rank)||(j.rank===a.rank&&j.dist<a.dist)){a=j;a.target=f;c=true}}}}if(c){var g=this.events.triggerEvent("beforesnap",{point:h,x:a.x,y:a.y,distance:a.dist,layer:a.target.layer,snapType:this.precedence[a.rank]});if(g!==false){h.x=a.x;h.y=a.y;this.point=h;this.events.triggerEvent("snap",{point:h,snapType:this.precedence[a.rank],layer:a.target.layer,distance:a.dist})}else{c=false}}if(this.point&&!c){h.x=d.x;h.y=d.y;this.point=null;this.events.triggerEvent("unsnap",{point:h})}},testTarget:function(B,f){var z={node:this.getGeoTolerance(B.nodeTolerance),vertex:this.getGeoTolerance(B.vertexTolerance),edge:this.getGeoTolerance(B.edgeTolerance)};var g=Math.max(z.node,z.vertex,z.edge);var h={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY};var e=false;var c=B.layer.features;var b,a,d,A,p,q,o;var m=this.precedence.length;var l=new OpenLayers.LonLat(f.x,f.y);for(var v=0,w=c.length;v<w;++v){b=c[v];if(b!==this.feature&&!b._sketch&&b.state!==OpenLayers.State.DELETE&&(!B.filter||B.filter.evaluate(b.attributes))){if(b.atPoint(l,g,g)){for(var u=0,r=Math.min(h.rank+1,m);u<r;++u){a=this.precedence[u];if(B[a]){if(a==="edge"){p=b.geometry.distanceTo(f,{details:true});q=p.distance;if(q<=z[a]&&q<h.dist){h={rank:u,dist:q,x:p.x0,y:p.y0};e=true;break}}else{d=b.geometry.getVertices(a==="node");o=false;for(var t=0,s=d.length;t<s;++t){A=d[t];q=A.distanceTo(f);if(q<=z[a]&&(u<h.rank||(u===h.rank&&q<h.dist))){h={rank:u,dist:q,x:A.x,y:A.y};e=true;o=true}}if(o){break}}}}}}}return e?h:null},getGeoTolerance:function(a){var b=this.layer.map.getResolution();if(b!==this.resolution){this.resolution=b;this.geoToleranceCache={}}var c=this.geoToleranceCache[a];if(c===undefined){c=a*b;this.geoToleranceCache[a]=c}return c},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(c,b){var a=(b&&b.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=a){var d=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!d){throw"Can't find a Filter parser for version "+a}this.parser=new d(this.options)}return this.parser.write(c)},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a=this.version;if(!a){a=this.defaultVersion}if(!this.parser||this.parser.VERSION!=a){var d=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!d){throw"Can't find a Filter parser for version "+a}this.parser=new d(this.options)}var b=this.parser.read(c);return b},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(d,c){var b=(c&&c.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=b){var e=OpenLayers.Format.SLD["v"+b.replace(/\./g,"_")];if(!e){throw"Can't find a SLD parser for version "+b}this.parser=new e(this.options)}var a=this.parser.write(d);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},read:function(e,c){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var b=e.documentElement;var a=this.version;if(!a){a=b.getAttribute("version");if(!a){a=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=a){var f=OpenLayers.Format.SLD["v"+a.replace(/\./g,"_")];if(!f){throw"Can't find a SLD parser for version "+a}this.parser=new f(this.options)}var d=this.parser.read(e,c);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(k){var a=k.split("\n");var b;var g=[];for(var v=0;v<(a.length-1);v++){var u=a[v].replace(/^\s*/,"").replace(/\s*$/,"");if(u.charAt(0)!="#"){if(!b){b=u.split("\t")}else{var m=u.split("\t");var d=new OpenLayers.Geometry.Point(0,0);var h={};var r=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null;var s,t,c,p;var l=false;for(var j=0;j<m.length;j++){if(m[j]){if(b[j]=="point"){var q=m[j].split(",");d.y=parseFloat(q[0]);d.x=parseFloat(q[1]);l=true}else{if(b[j]=="lat"){d.y=parseFloat(m[j]);l=true}else{if(b[j]=="lon"){d.x=parseFloat(m[j]);l=true}else{if(b[j]=="title"){h.title=m[j]}else{if(b[j]=="image"||b[j]=="icon"&&r){r.externalGraphic=m[j]}else{if(b[j]=="iconSize"&&r){var o=m[j].split(",");r.graphicWidth=parseFloat(o[0]);r.graphicHeight=parseFloat(o[1])}else{if(b[j]=="iconOffset"&&r){var f=m[j].split(",");r.graphicXOffset=parseFloat(f[0]);r.graphicYOffset=parseFloat(f[1])}else{if(b[j]=="description"){h.description=m[j]}else{if(b[j]=="overflow"){h.overflow=m[j]}else{h[b[j]]=m[j]}}}}}}}}}}}if(l){if(this.internalProjection&&this.externalProjection){d.transform(this.externalProjection,this.internalProjection)}var e=new OpenLayers.Feature.Vector(d,h,r);g.push(e)}}}}return g},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(a,b){this.addComponent(a,b)},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(c,b,a){if(!(a&&a.layerOptions&&a.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(d,c,b){var a=[];a.push(d,b);OpenLayers.Layer.Vector.prototype.initialize.apply(this,a);this.url=c},setVisibility:function(a,b){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},moveTo:function(c,a,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 d=c.responseXML;if(!d||!d.documentElement){d=c.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 b=this.format?new this.format(a):new OpenLayers.Format.GML(a);this.addFeatures(b.read(d));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(b,a){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},addNodes:function(f){if(f.length<2){OpenLayers.Console.error("At least two point features have to be added to createa line from");return}var k=new Array(f.length-1);var g,a,h;for(var c=0,e=f.length;c<e;c++){g=f[c];h=g.geometry;if(!h){var d=g.lonlat;h=new OpenLayers.Geometry.Point(d.lon,d.lat)}else{if(h.CLASS_NAME!="OpenLayers.Geometry.Point"){OpenLayers.Console.error("Only features with point geometries are supported.");return}}if(c>0){var b=(this.dataFrom!=null)?(f[c+this.dataFrom].data||f[c+this.dataFrom].attributes):null;var j=new OpenLayers.Geometry.LineString([a,h]);k[c-1]=new OpenLayers.Feature.Vector(j,b)}a=h}this.addFeatures(k)},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(b,a){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(a){var d=this.layers;var c;for(var b=0;b<d.length;b++){c=d[b].getFeatureFromEvent(a);if(c){return c}}},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 b;for(var a=0;a<this.map.layers.length;++a){b=this.map.layers[a];if(OpenLayers.Util.indexOf(this.layers,b)!=-1){b.renderer.moveRoot(this.renderer)}}},resetRoots:function(){var b;for(var a=0;a<this.layers.length;++a){b=this.layers[a];if(this.renderer&&b.renderer.getRenderLayerId()==this.id){this.renderer.moveRoot(b.renderer)}}},handleChangeLayer:function(a){var b=a.layer;if(a.property=="order"&&OpenLayers.Util.indexOf(this.layers,b)!=-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(d,c,e,b){if(b==undefined){b={}}if(b.featureClass||!OpenLayers.Layer.Vector||!OpenLayers.Feature.Vector){this.vectorMode=false}OpenLayers.Util.extend(b,{reportError:false});var a=[];a.push(d,b);OpenLayers.Layer.Vector.prototype.initialize.apply(this,a);if(!this.renderer||!this.vectorMode){this.vectorMode=false;if(!b.featureClass){b.featureClass=OpenLayers.Feature.WFS}OpenLayers.Layer.Markers.prototype.initialize.apply(this,a)}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(e,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(a,b,p){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments)}if(p){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(a==null){a=this.map.getExtent()}var o=(this.tile==null);var g=(!o&&!this.tile.bounds.containsBounds(a));if(b||o||(!p&&g)){var c=a.getCenterLonLat();var m=a.getWidth()*this.ratio;var h=a.getHeight()*this.ratio;var k=new OpenLayers.Bounds(c.lon-(m/2),c.lat-(h/2),c.lon+(m/2),c.lat+(h/2));var q=this.map.getSize();q.w=q.w*this.ratio;q.h=q.h*this.ratio;var j=new OpenLayers.LonLat(k.left,k.top);var l=this.map.getLayerPxFromLonLat(j);var d=this.getFullRequestString();var f=null;var e=this.params.filter||this.params.FILTER;if(e){f={FILTER:e}}else{f={BBOX:this.encodeBBOX?k.toBBOX():k.toArray()}}if(this.map&&!this.projection.equals(this.map.getProjectionObject())){var r=k.clone();r.transform(this.map.getProjectionObject(),this.projection);if(!e){f.BBOX=this.encodeBBOX?r.toBBOX():r.toArray()}}d+="&"+OpenLayers.Util.getParameterString(f);if(!this.tile){this.tile=new OpenLayers.Tile.WFS(this,l,k,d,q);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,l,k,d,q);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(c){var b=OpenLayers.Util.upperCaseObject(c);var a=[b];return OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,a)},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(c,b){var a=this.projection.getCode()||this.map.getProjection();this.params.SRS=(a=="none")?null:a;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(c){var a=c.responseText;if(a.indexOf("SUCCESS")!=-1){this.commitReport(OpenLayers.i18n("commitSuccess",{response:a}));for(var b=0;b<this.features.length;b++){this.features[b].state=null}}else{if(a.indexOf("FAILED")!=-1||a.indexOf("Exception")!=-1){this.commitReport(OpenLayers.i18n("commitFailed",{response:a}))}}},commitFailure:function(a){},commitReport:function(b,a){OpenLayers.Console.userError(b)},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(a){if(!a){a=this.getMapBounds()}var c=!this.bounds||!this.bounds.containsBounds(a);if(!c&&this.resFactor){var b=this.resolution/this.layer.map.getResolution();c=(b>=this.resFactor||b<=(1/this.resFactor))}return c},calculateBounds:function(b){if(!b){b=this.getMapBounds()}var a=b.getCenterLonLat();var d=b.getWidth()*this.ratio;var c=b.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(a.lon-(d/2),a.lat-(c/2),a.lon+(d/2),a.lat+(c/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 e=g.features;if(e&&e.length>0){var f=this.layer.projection;var d=this.layer.map.getProjectionObject();if(!d.equals(f)){var c;for(var b=0,a=e.length;b<a;++b){c=e[b].geometry;if(c){c.transform(f,d)}}}this.layer.addFeatures(e)}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,a){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);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 b={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){b.over=this.overFeature;b.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(b,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(b){var f=this.layers||[this.layer];var e,d;for(var a=0;a<f.length;++a){e=f[a];for(var c=e.selectedFeatures.length-1;c>=0;--c){d=e.selectedFeatures[c];if(!b||b.except!=d){this.unselect(d)}}}},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(a){if(this.hover){if(this.highlightOnly){if(a._lastHighlighter==this.id){if(a._prevHighlighter&&a._prevHighlighter!=this.id){delete a._lastHighlighter;var b=this.map.getControl(a._prevHighlighter);if(b){b.highlight(a)}}else{this.unhighlight(a)}}}else{this.unselect(a)}}},highlight:function(c){var b=c.layer;var a=this.events.triggerEvent("beforefeaturehighlighted",{feature:c});if(a!==false){c._prevHighlighter=c._lastHighlighter;c._lastHighlighter=this.id;var d=this.selectStyle||this.renderIntent;b.drawFeature(c,d);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(c){var a=this.onBeforeSelect.call(this.scope,c);var b=c.layer;if(a!==false){a=b.events.triggerEvent("beforefeatureselected",{feature:c});if(a!==false){b.selectedFeatures.push(c);this.highlight(c);b.events.triggerEvent("featureselected",{feature:c});this.onSelect.call(this.scope,c)}}},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(e){if(e instanceof OpenLayers.Bounds){var h=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.left,e.bottom));var k=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.right,e.top));var a=new OpenLayers.Bounds(h.lon,h.lat,k.lon,k.lat);if(!this.multipleSelect()){this.unselectAll()}var j=this.multiple;this.multiple=true;var d=this.layers||[this.layer];var f;for(var b=0;b<d.length;++b){f=d[b];for(var c=0,g=f.features.length;c<g;++c){var m=f.features[c];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,m.geometry.CLASS_NAME)>-1){if(a.toGeometry().intersects(m.geometry)){if(OpenLayers.Util.indexOf(f.selectedFeatures,m)==-1){this.select(m)}}}}}this.multiple=j}},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(a){var b={};this.readers.ogc.Filter.apply(this,[a,b]);return b.filter},readers:{ogc:{Filter:function(b,a){var c={fids:[],filters:[]};this.readChildNodes(b,c);if(c.fids.length>0){a.filter=new OpenLayers.Filter.FeatureId({fids:c.fids})}else{if(c.filters.length>0){a.filter=c.filters[0]}}},FeatureId:function(a,b){var c=a.getAttribute("fid");if(c){b.fids.push(c)}},And:function(b,c){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(b,a);c.filters.push(a)},Or:function(b,c){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(b,a);c.filters.push(a)},Not:function(b,c){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsLessThan:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsGreaterThan:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsLessThanOrEqualTo:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsGreaterThanOrEqualTo:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsBetween:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsLike:function(d,e){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(d,c);var f=d.getAttribute("wildCard");var b=d.getAttribute("singleChar");var a=d.getAttribute("escape");c.value2regex(f,b,a);e.filters.push(c)},Literal:function(a,b){b.value=OpenLayers.String.numericIf(this.getChildValue(a))},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(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(a,b){b.distance=parseInt(this.getChildValue(a));b.distanceUnits=a.getAttribute("units")}}},readSpatial:function(c,d,b){var a=new OpenLayers.Filter.Spatial({type:b});this.readChildNodes(c,a);a.value=a.components[0];delete a.components;d.filters.push(a)},readOgcExpression:function(a){var c={};this.readChildNodes(a,c);var b=c.value;if(!b){b=this.getChildValue(a)}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 b=c.CLASS_NAME.split(".").pop();if(b=="FeatureId"){for(var a=0;a<c.fids.length;++a){this.writeNode("FeatureId",c.fids[a],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 b;for(var a=0;a<c.filters.length;++a){b=c.filters[a];this.writeNode(this.getFilterType(b),b,d)}return d},Or:function(c){var d=this.createElementNSPlus("ogc:Or");var b;for(var a=0;a<c.filters.length;++a){b=c.filters[a];this.writeNode(this.getFilterType(b),b,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(a){var b=this.filterMap[a.type];if(!b){throw"Filter writing not supported for rule type: "+a.type}return b},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(b){var e=this;if(b){var c=new OpenLayers.Projection("EPSG:4326");if(!c.equals(b)){e=this.clone().transform(b,c)}}var f=0;if(e.components&&(e.components.length>1)){var h,g;for(var d=1,a=e.components.length;d<a;d++){h=e.components[d-1];g=e.components[d];f+=OpenLayers.Util.distVincenty({lon:h.x,lat:h.y},{lon:g.x,lat:g.y})}}return f*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(d,c){this.layer=d;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,[c]);if(!(this.deleteCodes instanceof Array)){this.deleteCodes=[this.deleteCodes]}var f=this;var a={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(d,a);var b={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(h,g){f.dragStart.apply(f,[h,g])},onDrag:function(h,g){f.dragVertex.apply(f,[h,g])},onComplete:function(g){f.dragComplete.apply(f,[g])}};this.dragControl=new OpenLayers.Control.DragFeature(d,b);var e={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,e)}},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(b,a){this.modified=true;if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=b){this.feature=b}this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}else{if(b._index){b.geometry.parent.addComponent(b.geometry,b._index);delete b._index;OpenLayers.Util.removeItem(this.virtualVertices,b);this.vertices.push(b)}else{if(b==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(b!==this.radiusHandle){this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}}}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(b)},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(a){var b=a.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,b)!=-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(h){var d,e,j,f;if(h.CLASS_NAME=="OpenLayers.Geometry.Point"){e=new OpenLayers.Feature.Vector(h);e._sketch=true;a.vertices.push(e)}else{var c=h.components.length;if(h.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){c-=1}for(d=0;d<c;++d){j=h.components[d];if(j.CLASS_NAME=="OpenLayers.Geometry.Point"){e=new OpenLayers.Feature.Vector(j);e._sketch=true;a.vertices.push(e)}else{b(j)}}if(h.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(d=0,f=h.components.length;d<f-1;++d){var m=h.components[d];var o=h.components[d+1];if(m.CLASS_NAME=="OpenLayers.Geometry.Point"&&o.CLASS_NAME=="OpenLayers.Geometry.Point"){var k=(m.x+o.x)/2;var g=(m.y+o.y)/2;var l=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(k,g),null,a.virtualStyle);l.geometry.parent=h;l._index=d+1;l._sketch=true;a.virtualVertices.push(l)}}}}}b.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var d=this.feature.geometry;var a=d.getBounds().getCenterLonLat();var c=new OpenLayers.Geometry.Point(a.lon,a.lat);var b=new OpenLayers.Feature.Vector(c);c.move=function(e,f){OpenLayers.Geometry.Point.prototype.move.call(this,e,f);d.move(e,f)};b._sketch=true;this.dragHandle=b;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var h=this.feature.geometry;var a=h.getBounds();var b=a.getCenterLonLat();var j=new OpenLayers.Geometry.Point(b.lon,b.lat);var g=new OpenLayers.Geometry.Point(a.right,a.bottom);var f=new OpenLayers.Feature.Vector(g);var c=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var e=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var d=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);g.move=function(v,u){OpenLayers.Geometry.Point.prototype.move.call(this,v,u);var w=this.x-j.x;var r=this.y-j.y;var z=w-v;var s=r-u;if(d){var l=Math.atan2(s,z);var k=Math.atan2(r,w);var p=k-l;p*=180/Math.PI;h.rotate(p,j)}if(c){var o,t;if(e){o=r/s;t=(w/z)/o}else{var q=Math.sqrt((z*z)+(s*s));var m=Math.sqrt((w*w)+(r*r));o=m/q}h.resize(o,j,t)}};f._sketch=true;this.radiusHandle=f;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(m){var c=false;var l=m.CLASS_NAME;if(l=="OpenLayers.Geometry.LineString"||l=="OpenLayers.Geometry.LinearRing"||l=="OpenLayers.Geometry.Point"){var q=this.getSortedSegments();var o;if(l=="OpenLayers.Geometry.Point"){o=[{x1:m.x,y1:m.y,x2:m.x,y2:m.y}]}else{o=m.getSortedSegments()}var t,g,e,a,s,r,d,b;outer:for(var h=0,k=q.length;h<k;++h){t=q[h];g=t.x1;e=t.x2;a=t.y1;s=t.y2;inner:for(var f=0,p=o.length;f<p;++f){r=o[f];if(r.x1>e){break}if(r.x2<g){continue}d=r.y1;b=r.y2;if(Math.min(d,b)>Math.max(a,s)){continue}if(Math.max(d,b)<Math.min(a,s)){continue}if(OpenLayers.Geometry.segmentsIntersect(t,r)){c=true;break outer}}}}else{c=m.intersects(this)}return c},getSortedSegments:function(){var a=this.components.length-1;var b=new Array(a);for(var c=0;c<a;++c){point1=this.components[c];point2=this.components[c+1];if(point1.x<point2.x){b[c]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}}else{b[c]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}}}function d(f,e){return f.x1-e.x1}return b.sort(d)},splitWithSegment:function(s,b){var c=!(b&&b.edge===false);var p=b&&b.tolerance;var a=[];var u=this.getVertices();var o=[];var w=[];var h=false;var e,d,l;var j,r,v;var f={point:true,tolerance:p};var g=null;for(var m=0,k=u.length-2;m<=k;++m){e=u[m];o.push(e.clone());d=u[m+1];v={x1:e.x,y1:e.y,x2:d.x,y2:d.y};l=OpenLayers.Geometry.segmentsIntersect(s,v,f);if(l instanceof OpenLayers.Geometry.Point){if((l.x===s.x1&&l.y===s.y1)||(l.x===s.x2&&l.y===s.y2)||l.equals(e)||l.equals(d)){r=true}else{r=false}if(r||c){if(!l.equals(w[w.length-1])){w.push(l.clone())}if(m===0){if(l.equals(e)){continue}}if(l.equals(d)){continue}h=true;if(!l.equals(e)){o.push(l)}a.push(new OpenLayers.Geometry.LineString(o));o=[l.clone()]}}}if(h){o.push(d.clone());a.push(new OpenLayers.Geometry.LineString(o))}if(w.length>0){var q=s.x1<s.x2?1:-1;var t=s.y1<s.y2?1:-1;g={lines:a,points:w.sort(function(A,z){return(q*A.x-q*z.x)||(t*A.y-t*z.y)})}}return g},split:function(A,b){var o=null;var d=b&&b.mutual;var l,e,m,c;if(A instanceof OpenLayers.Geometry.LineString){var z=this.getVertices();var g,f,w,h,a,q;var t=[];m=[];for(var u=0,p=z.length-2;u<=p;++u){g=z[u];f=z[u+1];w={x1:g.x,y1:g.y,x2:f.x,y2:f.y};c=c||[A];if(d){t.push(g.clone())}for(var s=0;s<c.length;++s){h=c[s].splitWithSegment(w,b);if(h){a=h.lines;if(a.length>0){a.unshift(s,1);Array.prototype.splice.apply(c,a);s+=a.length-2}if(d){for(var r=0,v=h.points.length;r<v;++r){q=h.points[r];if(!q.equals(g)){t.push(q);m.push(new OpenLayers.Geometry.LineString(t));if(q.equals(f)){t=[]}else{t=[q.clone()]}}}}}}}if(d&&m.length>0&&t.length>0){t.push(f.clone());m.push(new OpenLayers.Geometry.LineString(t))}}else{o=A.splitWith(this,b)}if(c&&c.length>1){e=true}else{c=[]}if(m&&m.length>1){l=true}else{m=[]}if(e||l){if(d){o=[m,c]}else{o=c}}return o},splitWith:function(b,a){return b.split(this,a)},getVertices:function(a){var b;if(a===true){b=[this.components[0],this.components[this.components.length-1]]}else{if(a===false){b=this.components.slice(1,this.components.length-1)}else{b=this.components.slice()}}return b},distanceTo:function(h,g){var k=!(g&&g.edge===false);var C=k&&g&&g.details;var r,e={};var u=Number.POSITIVE_INFINITY;if(h instanceof OpenLayers.Geometry.Point){var s=this.getSortedSegments();var q=h.x;var p=h.y;var A;for(var w=0,z=s.length;w<z;++w){A=s[w];r=OpenLayers.Geometry.distanceToSegment(h,A);if(r.distance<u){u=r.distance;e=r;if(u===0){break}}else{if(A.x2>q&&((p>A.y1&&p<A.y2)||(p<A.y1&&p>A.y2))){break}}}if(C){e={distance:e.distance,x0:e.x,y0:e.y,x1:q,y1:p}}else{e=e.distance}}else{if(h instanceof OpenLayers.Geometry.LineString){var d=this.getSortedSegments();var c=h.getSortedSegments();var b,a,o,B,f;var m=c.length;var l={point:true};outer:for(var w=0,z=d.length;w<z;++w){b=d[w];B=b.x1;f=b.y1;for(var v=0;v<m;++v){a=c[v];o=OpenLayers.Geometry.segmentsIntersect(b,a,l);if(o){u=0;e={distance:0,x0:o.x,y0:o.y,x1:o.x,y1:o.y};break outer}else{r=OpenLayers.Geometry.distanceToSegment({x:B,y:f},a);if(r.distance<u){u=r.distance;e={distance:u,x0:B,y0:f,x1:r.x,y1:r.y}}}}}if(!C){e=e.distance}if(u!==0){if(b){r=h.distanceTo(new OpenLayers.Geometry.Point(b.x2,b.y2),g);var t=C?r.distance:r;if(t<u){if(C){e={distance:u,x0:r.x1,y0:r.y1,x1:r.x0,y1:r.y0}}else{e=t}}}}}else{e=h.distanceTo(this,g);if(C){e={distance:e.distance,x0:e.x1,y0:e.y1,x1:e.x0,y1:e.y0}}}}return e},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 c=[];if(this.extractTracks){var u=A.getElementsByTagName("trk");for(var t=0,v=u.length;t<v;t++){var o={};if(this.extractAttributes){o=this.parseAttributes(u[t])}var h=this.getElementsByTagNameNS(u[t],u[t].namespaceURI,"trkseg");for(var s=0,f=h.length;s<f;s++){var m=this.extractSegment(h[s],"trkpt");c.push(new OpenLayers.Feature.Vector(m,o))}}}if(this.extractRoutes){var a=A.getElementsByTagName("rte");for(var r=0,q=a.length;r<q;r++){var o={};if(this.extractAttributes){o=this.parseAttributes(a[r])}var z=this.extractSegment(a[r],"rtept");c.push(new OpenLayers.Feature.Vector(z,o))}}if(this.extractWaypoints){var b=A.getElementsByTagName("wpt");for(var p=0,v=b.length;p<v;p++){var o={};if(this.extractAttributes){o=this.parseAttributes(b[p])}var e=new OpenLayers.Geometry.Point(b[p].getAttribute("lon"),b[p].getAttribute("lat"));c.push(new OpenLayers.Feature.Vector(e,o))}}if(this.internalProjection&&this.externalProjection){for(var w=0,d=c.length;w<d;w++){c[w].geometry.transform(this.externalProjection,this.internalProjection)}}return c},extractSegment:function(e,f){var d=this.getElementsByTagNameNS(e,e.namespaceURI,f);var b=[];for(var c=0,a=d.length;c<a;c++){b.push(new OpenLayers.Geometry.Point(d[c].getAttribute("lon"),d[c].getAttribute("lat")))}return new OpenLayers.Geometry.LineString(b)},parseAttributes:function(b){var a={};var d=b.firstChild;while(d){if(d.nodeType==1){var c=d.firstChild;if(c.nodeType==3||c.nodeType==4){name=(d.prefix)?d.nodeName.split(":")[1]:d.nodeName;if(name!="trkseg"&&name!="rtept"){a[name]=c.nodeValue}}}d=d.nextSibling}return a},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(a,b){var c=false;var d=this.components.pop();if(b!=null||!a.equals(d)){c=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var e=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[e]);return c},removeComponent:function(a){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var b=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[b])}},move:function(b,d){for(var c=0,a=this.components.length;c<a-1;c++){this.components[c].move(b,d)}},rotate:function(d,b){for(var c=0,a=this.components.length;c<a-1;++c){this.components[c].rotate(d,b)}},resize:function(e,b,d){for(var c=0,a=this.components.length;c<a-1;++c){this.components[c].resize(e,b,d)}return this},transform:function(e,c){if(e&&c){for(var d=0,a=this.components.length;d<a-1;d++){var b=this.components[d];b.transform(e,c)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var h=0;var g=0;for(var e=0;e<this.components.length-1;e++){var d=this.components[e];var k=this.components[e+1];h+=(d.x+k.x)*(d.x*k.y-k.x*d.y);g+=(d.y+k.y)*(d.x*k.y-k.x*d.y)}var f=-1*this.getArea();var a=h/(6*f);var j=g/(6*f)}return new OpenLayers.Geometry.Point(a,j)},getArea:function(){var g=0;if(this.components&&(this.components.length>2)){var f=0;for(var e=0,d=this.components.length;e<d-1;e++){var a=this.components[e];var h=this.components[e+1];f+=(a.x+h.x)*(h.y-a.y)}g=-f/2}return g},getGeodesicArea:function(b){var d=this;if(b){var c=new OpenLayers.Projection("EPSG:4326");if(!c.equals(b)){d=this.clone().transform(b,c)}}var f=0;var a=d.components&&d.components.length;if(a>2){var h,g;for(var e=0;e<a-1;e++){h=d.components[e];g=d.components[e+1];f+=OpenLayers.Util.rad(g.x-h.x)*(2+Math.sin(OpenLayers.Util.rad(h.y))+Math.sin(OpenLayers.Util.rad(g.y)))}f=f*6378137*6378137/2}return f},containsPoint:function(m){var t=OpenLayers.Number.limitSigDigs;var l=14;var k=t(m.x,l);var j=t(m.y,l);function s(A,v,z,u,w){return(((v-u)*A)+((u*z)-(v*w)))/(z-w)}var a=this.components.length-1;var g,f,r,d,p,b,e,c;var h=0;for(var o=0;o<a;++o){g=this.components[o];r=t(g.x,l);d=t(g.y,l);f=this.components[o+1];p=t(f.x,l);b=t(f.y,l);if(d==b){if(j==d){if(r<=p&&(k>=r&&k<=p)||r>=p&&(k<=r&&k>=p)){h=-1;break}}continue}e=t(s(j,r,d,p,b),l);if(e==k){if(d<b&&(j>=d&&j<=b)||d>b&&(j<=d&&j>=b)){h=-1;break}}if(e<=k){continue}if(r!=p&&(e<Math.min(r,p)||e>Math.max(r,p))){continue}if(d<b&&(j>=d&&j<b)||d>b&&(j<d&&j>=b)){++h}}var q=(h==-1)?1:!!(h&1);return q},intersects:function(d){var b=false;if(d.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(d)}else{if(d.CLASS_NAME=="OpenLayers.Geometry.LineString"){b=d.intersects(this)}else{if(d.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[d])}else{for(var c=0,a=d.components.length;c<a;++c){b=d.components[c].intersects(this);if(b){break}}}}}return b},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(o,t){var g=null;var s=t&&t.mutual;var p,a,r,m,b;var e=[];var q=[o];for(var f=0,h=this.components.length;f<h;++f){a=this.components[f];m=false;for(var d=0;d<q.length;++d){p=a.split(q[d],t);if(p){if(s){r=p[0];for(var c=0,l=r.length;c<l;++c){if(c===0&&e.length){e[e.length-1].addComponent(r[c])}else{e.push(new OpenLayers.Geometry.MultiLineString([r[c]]))}}m=true;p=p[1]}if(p.length){p.unshift(d,1);Array.prototype.splice.apply(q,p);break}}}if(!m){if(e.length){e[e.length-1].addComponent(a.clone())}else{e=[new OpenLayers.Geometry.MultiLineString(a.clone())]}}}if(e&&e.length>1){m=true}else{e=[]}if(q&&q.length>1){b=true}else{q=[]}if(m||b){if(s){g=[e,q]}else{g=q}}return g},splitWith:function(o,t){var g=null;var s=t&&t.mutual;var p,c,r,m,a,e,q;if(o instanceof OpenLayers.Geometry.LineString){q=[];e=[o];for(var f=0,h=this.components.length;f<h;++f){a=false;c=this.components[f];for(var d=0;d<e.length;++d){p=e[d].split(c,t);if(p){if(s){r=p[0];if(r.length){r.unshift(d,1);Array.prototype.splice.apply(e,r);d+=r.length-2}p=p[1];if(p.length===0){p=[c.clone()]}}for(var b=0,l=p.length;b<l;++b){if(b===0&&q.length){q[q.length-1].addComponent(p[b])}else{q.push(new OpenLayers.Geometry.MultiLineString([p[b]]))}}a=true}}if(!a){if(q.length){q[q.length-1].addComponent(c.clone())}else{q=[new OpenLayers.Geometry.MultiLineString([c.clone()])]}}}}else{g=o.split(this)}if(e&&e.length>1){m=true}else{e=[]}if(q&&q.length>1){a=true}else{q=[]}if(m||a){if(s){g=[e,q]}else{g=q}}return g},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(c,b,a){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(c,d){for(var b=0,a=c.length;b<a;++b){if(c[b].geometry===d){c.splice(b,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(c){sourceSplit=false;targetSplit=false;if(!this.sourceFilter||this.sourceFilter.evaluate(c.attributes)){var f=this.layer&&this.layer.features||[];var A,p,g,a;var l=[],z=[];var d=(this.layer===this.source)&&this.mutual;var b={edge:this.edge,tolerance:this.tolerance,mutual:d};var h=[c.geometry];var o,e;var r,q;for(var v=0,w=f.length;v<w;++v){o=f[v];if(this.isEligible(o)){e=[o.geometry];for(var u=0;u<h.length;++u){r=h[u];for(var s=0;s<e.length;++s){A=e[s];if(r.getBounds().intersectsBounds(A.getBounds())){p=r.split(A,b);if(p){a=this.events.triggerEvent("beforesplit",{source:c,target:o});if(a!==false){if(d){q=p[0];if(q.length>1){q.unshift(u,1);Array.prototype.splice.apply(h,q);u+=q.length-3}p=p[1]}if(p.length>1){p.unshift(s,1);Array.prototype.splice.apply(e,p);s+=p.length-3}}}}}}if(e&&e.length>1){this.geomsToFeatures(o,e);this.events.triggerEvent("split",{original:o,features:e});Array.prototype.push.apply(l,e);z.push(o);targetSplit=true}}}if(h&&h.length>1){this.geomsToFeatures(c,h);this.events.triggerEvent("split",{original:c,features:h});Array.prototype.push.apply(l,h);z.push(c);sourceSplit=true}if(sourceSplit||targetSplit){if(this.deferDelete){var m,t=[];for(var v=0,w=z.length;v<w;++v){m=z[v];if(m.state===OpenLayers.State.INSERT){t.push(m)}else{m.state=OpenLayers.State.DELETE;this.layer.drawFeature(m)}}this.layer.destroyFeatures(t,{silent:true});for(var v=0,w=l.length;v<w;++v){l[v].state=OpenLayers.State.INSERT}}else{this.layer.destroyFeatures(z,{silent:true})}this.layer.addFeatures(l,{silent:true});this.events.triggerEvent("aftersplit",{source:c,features:l})}}return sourceSplit},geomsToFeatures:function(c,d){var f=c.clone();delete f.geometry;var e;for(var b=0,a=d.length;b<a;++b){e=f.clone();e.geometry=d[b];e.state=OpenLayers.State.INSERT;d[b]=e}},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 c=0;if(this.components&&(this.components.length>0)){c+=Math.abs(this.components[0].getArea());for(var b=1,a=this.components.length;b<a;b++){c-=Math.abs(this.components[b].getArea())}}return c},getGeodesicArea:function(b){var d=0;if(this.components&&(this.components.length>0)){d+=Math.abs(this.components[0].getGeodesicArea(b));for(var c=1,a=this.components.length;c<a;c++){d-=Math.abs(this.components[c].getGeodesicArea(b))}}return d},containsPoint:function(a){var e=this.components.length;var c=false;if(e>0){c=this.components[0].containsPoint(a);if(c!==1){if(c&&e>1){var d;for(var b=1;b<e;++b){d=this.components[b].containsPoint(a);if(d){if(d===1){c=1}else{c=false}break}}}}}return c},intersects:function(e){var b=false;var d,a;if(e.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(e)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LineString"||e.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(d=0,a=this.components.length;d<a;++d){b=e.intersects(this.components[d]);if(b){break}}if(!b){for(d=0,a=e.components.length;d<a;++d){b=this.containsPoint(e.components[d]);if(b){break}}}}else{for(d=0,a=e.components.length;d<a;++d){b=this.intersects(e.components[d]);if(b){break}}}}if(!b&&e.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var c=this.components[0];for(d=0,a=c.components.length;d<a;++d){b=e.containsPoint(c.components[d]);if(b){break}}}return b},distanceTo:function(d,b){var c=!(b&&b.edge===false);var a;if(!c&&this.intersects(d)){a=0}else{a=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[d,b])}return a},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(j,f,b,l){var c=Math.PI*((1/b)-(1/2));if(l){c+=(l/180)*Math.PI}var a,h,g;var k=[];for(var e=0;e<b;++e){a=c+(e*2*Math.PI/b);h=j.x+(f*Math.cos(a));g=j.y+(f*Math.sin(a));k.push(new OpenLayers.Geometry.Point(h,g))}var d=new OpenLayers.Geometry.LinearRing(k);return new OpenLayers.Geometry.Polygon([d])};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(o){var m=this.getElementsByTagNameNS(o,this.georssns,"point");var g=this.getElementsByTagNameNS(o,this.geons,"lat");var a=this.getElementsByTagNameNS(o,this.geons,"long");var q=this.getElementsByTagNameNS(o,this.georssns,"line");var k=this.getElementsByTagNameNS(o,this.georssns,"polygon");var c=this.getElementsByTagNameNS(o,this.georssns,"where");var d=this.getElementsByTagNameNS(o,this.georssns,"box");if(m.length>0||(g.length>0&&a.length>0)){var l;if(m.length>0){l=OpenLayers.String.trim(m[0].firstChild.nodeValue).split(/\s+/);if(l.length!=2){l=OpenLayers.String.trim(m[0].firstChild.nodeValue).split(/\s*,\s*/)}}else{l=[parseFloat(g[0].firstChild.nodeValue),parseFloat(a[0].firstChild.nodeValue)]}var h=new OpenLayers.Geometry.Point(parseFloat(l[1]),parseFloat(l[0]))}else{if(q.length>0){var j=OpenLayers.String.trim(this.concatChildValues(q[0])).split(/\s+/);var e=[];var m;for(var b=0,f=j.length;b<f;b+=2){m=new OpenLayers.Geometry.Point(parseFloat(j[b+1]),parseFloat(j[b]));e.push(m)}h=new OpenLayers.Geometry.LineString(e)}else{if(k.length>0){var j=OpenLayers.String.trim(this.concatChildValues(k[0])).split(/\s+/);var e=[];var m;for(var b=0,f=j.length;b<f;b+=2){m=new OpenLayers.Geometry.Point(parseFloat(j[b+1]),parseFloat(j[b]));e.push(m)}h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(e)])}else{if(c.length>0){if(!this.gmlParser){this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})}var p=this.gmlParser.parseFeature(c[0]);h=p.geometry}else{if(d.length>0){var j=OpenLayers.String.trim(d[0].firstChild.nodeValue).split(/\s+/);var e=[];var m;if(j.length>3){m=new OpenLayers.Geometry.Point(parseFloat(j[1]),parseFloat(j[0]));e.push(m);m=new OpenLayers.Geometry.Point(parseFloat(j[1]),parseFloat(j[2]));e.push(m);m=new OpenLayers.Geometry.Point(parseFloat(j[3]),parseFloat(j[2]));e.push(m);m=new OpenLayers.Geometry.Point(parseFloat(j[3]),parseFloat(j[0]));e.push(m);m=new OpenLayers.Geometry.Point(parseFloat(j[1]),parseFloat(j[0]));e.push(m)}h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(e)])}}}}}if(h&&this.internalProjection&&this.externalProjection){h.transform(this.externalProjection,this.internalProjection)}return h},createFeatureFromItem:function(j){var d=this.createGeometryFromItem(j);var g=this.getChildValue(j,"*","title",this.featureTitle);var h=this.getChildValue(j,"*","description",this.getChildValue(j,"*","content",this.getChildValue(j,"*","summary",this.featureDescription)));var f=this.getChildValue(j,"*","link");if(!f){try{f=this.getElementsByTagNameNS(j,"*","link")[0].getAttribute("href")}catch(c){f=null}}var a=this.getChildValue(j,"*","id",null);var b={title:g,description:h,link:f};var k=new OpenLayers.Feature.Vector(d,b);k.fid=a;return k},getChildValue:function(d,b,c,f){var e;var a=this.getElementsByTagNameNS(d,b,c);if(a&&a[0]&&a[0].firstChild&&a[0].firstChild.nodeValue){e=a[0].firstChild.nodeValue}else{e=(f==undefined)?"":f}return e},read:function(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var a=null;a=this.getElementsByTagNameNS(e,"*","item");if(a.length==0){a=this.getElementsByTagNameNS(e,"*","entry")}var c=a.length;var d=new Array(c);for(var b=0;b<c;b++){d[b]=this.createFeatureFromItem(a[b])}return d},write:function(c){var d;if(c instanceof Array){d=this.createElementNS(this.rssns,"rss");for(var b=0,a=c.length;b<a;b++){d.appendChild(this.createFeatureXML(c[b]))}}else{d=this.createFeatureXML(c)}return OpenLayers.Format.XML.prototype.write.apply(this,[d])},createFeatureXML:function(k){var f=this.buildGeometryNode(k.geometry);var a=this.createElementNS(this.rssns,"item");var d=this.createElementNS(this.rssns,"title");d.appendChild(this.createTextNode(k.attributes.title?k.attributes.title:""));var b=this.createElementNS(this.rssns,"description");b.appendChild(this.createTextNode(k.attributes.description?k.attributes.description:""));a.appendChild(d);a.appendChild(b);if(k.attributes.link){var h=this.createElementNS(this.rssns,"link");h.appendChild(this.createTextNode(k.attributes.link));a.appendChild(h)}for(var j in k.attributes){if(j=="link"||j=="title"||j=="description"){continue}var g=this.createTextNode(k.attributes[j]);var e=j;if(j.search(":")!=-1){e=j.split(":")[1]}var c=this.createElementNS(this.featureNS,"feature:"+e);c.appendChild(g);a.appendChild(c)}a.appendChild(f);return a},buildGeometryNode:function(b){if(this.internalProjection&&this.externalProjection){b=b.clone();b.transform(this.internalProjection,this.externalProjection)}var a;if(b.CLASS_NAME=="OpenLayers.Geometry.Polygon"){a=this.createElementNS(this.georssns,"georss:polygon");a.appendChild(this.buildCoordinatesNode(b.components[0]))}else{if(b.CLASS_NAME=="OpenLayers.Geometry.LineString"){a=this.createElementNS(this.georssns,"georss:line");a.appendChild(this.buildCoordinatesNode(b))}else{if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.createElementNS(this.georssns,"georss:point");a.appendChild(this.buildCoordinatesNode(b))}else{throw"Couldn't parse "+b.CLASS_NAME}}}return a},buildCoordinatesNode:function(f){var c=null;if(f.components){c=f.components}var e;if(c){var b=c.length;var d=new Array(b);for(var a=0;a<b;a++){d[a]=c[a].y+" "+c[a].x}e=d.join(" ")}else{e=f.y+" "+f.x}return this.createTextNode(e)},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,c){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var e=["Link","NetworkLink","Style","StyleMap","Placemark"];for(var d=0,a=e.length;d<a;++d){var f=e[d];var b=this.getElementsByTagNameNS(g,"*",f);if(b.length==0){continue}switch(f.toLowerCase()){case"link":case"networklink":this.parseLinks(b,c);break;case"style":if(this.extractStyles){this.parseStyles(b,c)}break;case"stylemap":if(this.extractStyles){this.parseStyleMaps(b,c)}break;case"placemark":this.parseFeatures(b,c);break}}return this.features},parseLinks:function(c,d){if(d.depth>=this.maxDepth){return false}var g=OpenLayers.Util.extend({},d);g.depth++;for(var e=0,a=c.length;e<a;e++){var b=this.parseProperty(c[e],"*","href");if(b&&!this.fetched[b]){this.fetched[b]=true;var f=this.fetchLink(b);if(f){this.parseData(f,g)}}}},fetchLink:function(a){var b=OpenLayers.Request.GET({url:a,async:false});if(b){return b.responseText}},parseStyles:function(b,c){for(var d=0,a=b.length;d<a;d++){var e=this.parseStyle(b[d]);if(e){styleName=(c.styleBaseUrl||"")+"#"+e.id;this.styles[styleName]=e}}},parseStyle:function(z){var K={};var I=["LineStyle","PolyStyle","IconStyle","BalloonStyle"];var S,k,l,t;for(var N=0,o=I.length;N<o;++N){S=I[N];styleTypeNode=this.getElementsByTagNameNS(z,"*",S)[0];if(!styleTypeNode){continue}switch(S.toLowerCase()){case"linestyle":var s=this.parseProperty(styleTypeNode,"*","color");if(s){var c=(s.toString()).match(this.regExes.kmlColor);var L=c[1];K.strokeOpacity=parseInt(L,16)/255;var R=c[2];var P=c[3];var J=c[4];K.strokeColor="#"+J+P+R}var a=this.parseProperty(styleTypeNode,"*","width");if(a){K.strokeWidth=a}case"polystyle":var s=this.parseProperty(styleTypeNode,"*","color");if(s){var c=(s.toString()).match(this.regExes.kmlColor);var L=c[1];K.fillOpacity=parseInt(L,16)/255;var R=c[2];var P=c[3];var J=c[4];K.fillColor="#"+J+P+R}var m=this.parseProperty(styleTypeNode,"*","fill");if(m=="0"){K.fillColor="none"}break;case"iconstyle":var A=parseFloat(this.parseProperty(styleTypeNode,"*","scale")||1);var a=32*A;var d=32*A;var e=this.getElementsByTagNameNS(styleTypeNode,"*","Icon")[0];if(e){var q=this.parseProperty(e,"*","href");if(q){var H=this.parseProperty(e,"*","w");var O=this.parseProperty(e,"*","h");var j="http://maps.google.com/mapfiles/kml";if(OpenLayers.String.startsWith(q,j)&&!H&&!O){H=64;O=64;A=A/2}H=H||O;O=O||H;if(H){a=parseInt(H)*A}if(O){d=parseInt(O)*A}var c=q.match(this.regExes.kmlIconPalette);if(c){var M=c[1];var p=c[2];var G=this.parseProperty(e,"*","x");var F=this.parseProperty(e,"*","y");var C=G?G/32:0;var B=F?(7-F/32):7;var v=B*8+C;q="http://maps.google.com/mapfiles/kml/pal"+M+"/icon"+v+p}K.graphicOpacity=1;K.externalGraphic=q}}var E=this.getElementsByTagNameNS(styleTypeNode,"*","hotSpot")[0];if(E){var G=parseFloat(E.getAttribute("x"));var F=parseFloat(E.getAttribute("y"));var u=E.getAttribute("xunits");if(u=="pixels"){K.graphicXOffset=-G*A}else{if(u=="insetPixels"){K.graphicXOffset=-a+(G*A)}else{if(u=="fraction"){K.graphicXOffset=-a*G}}}var f=E.getAttribute("yunits");if(f=="pixels"){K.graphicYOffset=-d+(F*A)+1}else{if(f=="insetPixels"){K.graphicYOffset=-(F*A)+1}else{if(f=="fraction"){K.graphicYOffset=-d*(1-F)+1}}}}K.graphicWidth=a;K.graphicHeight=d;break;case"balloonstyle":var Q=OpenLayers.Util.getXmlNodeValue(styleTypeNode);if(Q){K.balloonStyle=Q.replace(this.regExes.straightBracket,"${$1}")}break;default:}}if(!K.strokeColor&&K.fillColor){K.strokeColor=K.fillColor}var D=z.getAttribute("id");if(D&&K){K.id=D}return K},parseStyleMaps:function(a,o){for(var g=0,h=a.length;g<h;g++){var d=a[g];var c=this.getElementsByTagNameNS(d,"*","Pair");var b=d.getAttribute("id");for(var f=0,m=c.length;f<m;f++){var e=c[f];var l=this.parseProperty(e,"*","key");var k=this.parseProperty(e,"*","styleUrl");if(k&&l=="normal"){this.styles[(o.styleBaseUrl||"")+"#"+b]=this.styles[(o.styleBaseUrl||"")+k]}if(k&&l=="highlight"){}}}},parseFeatures:function(a,j){var d=new Array(a.length);for(var e=0,f=a.length;e<f;e++){var b=a[e];var h=this.parseFeature.apply(this,[b]);if(h){if(this.extractStyles&&h.attributes&&h.attributes.styleUrl){h.style=this.getStyle(h.attributes.styleUrl,j)}if(this.extractStyles){var g=this.getElementsByTagNameNS(b,"*","Style")[0];if(g){var c=this.parseStyle(g);if(c){h.style=OpenLayers.Util.extend(h.style,c)}}}d[e]=h}else{throw"Bad Placemark: "+e}}this.features=this.features.concat(d)},parseFeature:function(b){var c=["MultiGeometry","Polygon","LineString","Point"];var j,e,k,a;for(var g=0,h=c.length;g<h;++g){j=c[g];this.internalns=b.namespaceURI?b.namespaceURI:this.kmlns;e=this.getElementsByTagNameNS(b,this.internalns,j);if(e.length>0){var a=this.parseGeometry[j.toLowerCase()];if(a){k=a.apply(this,[e[0]]);if(this.internalProjection&&this.externalProjection){k.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:j}))}break}}var f;if(this.extractAttributes){f=this.parseAttributes(b)}var l=new OpenLayers.Feature.Vector(k,f);var d=b.getAttribute("id")||b.getAttribute("name");if(d!=null){l.fid=d}return l},getStyle:function(b,a){var c=OpenLayers.Util.removeTail(b);var f=OpenLayers.Util.extend({},a);f.depth++;f.styleBaseUrl=c;if(!this.styles[b]&&!OpenLayers.String.startsWith(b,"#")&&f.depth<=this.maxDepth&&!this.fetched[c]){var e=this.fetchLink(c);if(e){this.parseData(e,f)}}var d=OpenLayers.Util.extend({},this.styles[b]);return d},parseGeometry:{point:function(d){var c=this.getElementsByTagNameNS(d,this.internalns,"coordinates");var e=[];if(c.length>0){var b=c[0].firstChild.nodeValue;b=b.replace(this.regExes.removeSpace,"");e=b.split(",")}var a=null;if(e.length>1){if(e.length==2){e[2]=null}a=new OpenLayers.Geometry.Point(e[0],e[1],e[2])}else{throw"Bad coordinate string: "+b}return a},linestring:function(c,e){var d=this.getElementsByTagNameNS(c,this.internalns,"coordinates");var l=null;if(d.length>0){var b=this.getChildValue(d[0]);b=b.replace(this.regExes.trimSpace,"");b=b.replace(this.regExes.trimComma,",");var a=b.split(this.regExes.splitSpace);var h=a.length;var k=new Array(h);var j,g;for(var f=0;f<h;++f){j=a[f].split(",");g=j.length;if(g>1){if(j.length==2){j[2]=null}k[f]=new OpenLayers.Geometry.Point(j[0],j[1],j[2])}else{throw"Bad LineString point coordinates: "+a[f]}}if(h){if(e){l=new OpenLayers.Geometry.LinearRing(k)}else{l=new OpenLayers.Geometry.LineString(k)}}else{throw"Bad LineString coordinates: "+b}}return l},polygon:function(f){var c=this.getElementsByTagNameNS(f,this.internalns,"LinearRing");var g=c.length;var e=new Array(g);if(g>0){var b;for(var d=0,a=c.length;d<a;++d){b=this.parseGeometry.linestring.apply(this,[c[d],true]);if(b){e[d]=b}else{throw"Bad LinearRing geometry: "+d}}}return new OpenLayers.Geometry.Polygon(e)},multigeometry:function(e){var h,g;var f=[];var c=e.childNodes;for(var b=0,a=c.length;b<a;++b){h=c[b];if(h.nodeType==1){var d=(h.prefix)?h.nodeName.split(":")[1]:h.nodeName;var g=this.parseGeometry[d.toLowerCase()];if(g){f.push(g.apply(this,[h]))}}}return new OpenLayers.Geometry.Collection(f)}},parseAttributes:function(d){var e={};var f=d.getElementsByTagName("ExtendedData");if(f.length){e=this.parseExtendedData(f[0])}var b,l,k;var c=d.childNodes;for(var g=0,h=c.length;g<h;++g){b=c[g];if(b.nodeType==1){l=b.childNodes;if(l.length==1||l.length==3){var k;switch(l.length){case 1:k=l[0];break;case 3:default:k=l[1];break}if(k.nodeType==3||k.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var j=OpenLayers.Util.getXmlNodeValue(k);if(j){j=j.replace(this.regExes.trimSpace,"");e[a]=j}}}}}return e},parseExtendedData:function(b){var d={};var c=b.getElementsByTagName("Data");for(var f=0,h=c.length;f<h;f++){var e=c[f];var j=e.getAttribute("name");var g={};var k=e.getElementsByTagName("value");if(k.length){g.value=this.getChildValue(k[0])}var a=e.getElementsByTagName("displayName");if(a.length){g.displayName=this.getChildValue(a[0])}d[j]=g}return d},parseProperty:function(c,d,b){var f;var a=this.getElementsByTagNameNS(c,d,b);try{f=OpenLayers.Util.getXmlNodeValue(a[0])}catch(g){f=null}return f},write:function(d){if(!(d instanceof Array)){d=[d]}var b=this.createElementNS(this.kmlns,"kml");var e=this.createFolderXML();for(var c=0,a=d.length;c<a;++c){e.appendChild(this.createPlacemarkXML(d[c]))}b.appendChild(e);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},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 g=this.createElementNS(this.kmlns,"name");var c=(e.attributes.name)?e.attributes.name:e.id;g.appendChild(this.createTextNode(c));var d=this.createElementNS(this.kmlns,"description");var f=(e.attributes.description)?e.attributes.description:this.placemarksDesc;d.appendChild(this.createTextNode(f));var b=this.createElementNS(this.kmlns,"Placemark");if(e.fid!=null){b.setAttribute("id",e.fid)}b.appendChild(g);b.appendChild(d);var a=this.buildGeometryNode(e.geometry);b.appendChild(a);return b},buildGeometryNode:function(e){if(this.internalProjection&&this.externalProjection){e=e.clone();e.transform(this.internalProjection,this.externalProjection)}var c=e.CLASS_NAME;var b=c.substring(c.lastIndexOf(".")+1);var a=this.buildGeometry[b.toLowerCase()];var d=null;if(a){d=a.apply(this,[e])}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(h){var b=this.createElementNS(this.kmlns,"Polygon");var g=h.components;var e,f,d;for(var c=0,a=g.length;c<a;++c){d=(c==0)?"outerBoundaryIs":"innerBoundaryIs";e=this.createElementNS(this.kmlns,d);f=this.buildGeometry.linearring.apply(this,[g[c]]);e.appendChild(f);b.appendChild(e)}return b},multipolygon:function(a){return this.buildGeometry.collection.apply(this,[a])},collection:function(d){var b=this.createElementNS(this.kmlns,"MultiGeometry");var e;for(var c=0,a=d.components.length;c<a;++c){e=this.buildGeometryNode.apply(this,[d.components[c]]);if(e){b.appendChild(e)}}return b}},buildCoordinatesNode:function(e){var a=this.createElementNS(this.kmlns,"coordinates");var j;var h=e.components;if(h){var g;var f=h.length;var c=new Array(f);for(var d=0;d<f;++d){g=h[d];c[d]=g.x+","+g.y}j=c.join(" ")}else{j=e.x+","+e.y}var b=this.createTextNode(j);a.appendChild(b);return a},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:false,interestingTagsExclude:null,areaTags:null,initialize:function(a){var d={interestingTagsExclude:["source","source_ref","source:ref","history","attribution","created_by"],areaTags:["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]};d=OpenLayers.Util.extend(d,a);var e={};for(var b=0;b<d.interestingTagsExclude.length;b++){e[d.interestingTagsExclude[b]]=true}d.interestingTagsExclude=e;var c={};for(var b=0;b<d.areaTags.length;b++){c[d.areaTags[b]]=true}d.areaTags=c;OpenLayers.Format.XML.prototype.initialize.apply(this,[d])},read:function(o){if(typeof o=="string"){o=OpenLayers.Format.XML.prototype.read.apply(this,[o])}var b=this.getNodes(o);var p=this.getWays(o);var g=new Array(p.length);for(var f=0;f<p.length;f++){var l=new Array(p[f].nodes.length);var a=this.isWayArea(p[f])?1:0;for(var e=0;e<p[f].nodes.length;e++){var c=b[p[f].nodes[e]];var m=new OpenLayers.Geometry.Point(c.lon,c.lat);m.osm_id=parseInt(p[f].nodes[e]);l[e]=m;c.used=true}var k=null;if(a){k=new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(l))}else{k=new OpenLayers.Geometry.LineString(l)}if(this.internalProjection&&this.externalProjection){k.transform(this.externalProjection,this.internalProjection)}var h=new OpenLayers.Feature.Vector(k,p[f].tags);h.osm_id=parseInt(p[f].id);h.fid="way."+h.osm_id;g[f]=h}for(var d in b){var c=b[d];if(!c.used||this.checkTags){var r=null;if(this.checkTags){var q=this.getTags(c.node,true);if(c.used&&!q[1]){continue}r=q[0]}else{r=this.getTags(c.node)}var h=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(c.lon,c.lat),r);if(this.internalProjection&&this.externalProjection){h.geometry.transform(this.externalProjection,this.internalProjection)}h.osm_id=parseInt(d);h.fid="node."+h.osm_id;g.push(h)}c.node=null}return g},getNodes:function(e){var d=e.getElementsByTagName("node");var a={};for(var b=0;b<d.length;b++){var c=d[b];var f=c.getAttribute("id");a[f]={lat:c.getAttribute("lat"),lon:c.getAttribute("lon"),node:c}}return a},getWays:function(g){var f=g.getElementsByTagName("way");var h=[];for(var d=0;d<f.length;d++){var b=f[d];var c={id:b.getAttribute("id")};c.tags=this.getTags(b);var e=b.getElementsByTagName("nd");c.nodes=new Array(e.length);for(var a=0;a<e.length;a++){c.nodes[a]=e[a].getAttribute("ref")}h.push(c)}return h},getTags:function(e,g){var a=e.getElementsByTagName("tag");var c={};var f=false;for(var b=0;b<a.length;b++){var d=a[b].getAttribute("k");c[d]=a[b].getAttribute("v");if(g){if(!this.interestingTagsExclude[d]){f=true}}}return g?[c,f]:c},isWayArea:function(b){var a=false;var d=false;if(b.nodes[0]==b.nodes[b.nodes.length-1]){a=true}if(this.checkTags){for(var c in b.tags){if(this.areaTags[c]){d=true;break}}}return a&&(this.checkTags?d:true)},write:function(d){if(!(d instanceof Array)){d=[d]}this.osm_id=1;this.created_nodes={};var e=this.createElementNS(null,"osm");e.setAttribute("version","0.5");e.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var c=d.length-1;c>=0;c--){var a=this.createFeatureNodes(d[c]);for(var b=0;b<a.length;b++){e.appendChild(a[b])}}return OpenLayers.Format.XML.prototype.write.apply(this,[e])},createFeatureNodes:function(c){var b=[];var e=c.geometry.CLASS_NAME;var d=e.substring(e.lastIndexOf(".")+1);d=d.toLowerCase();var a=this.createXML[d];if(a){b=a.apply(this,[c])}return b},createXML:{point:function(a){var e=null;var c=a.geometry?a.geometry:a;var d=false;if(a.osm_id){e=a.osm_id;if(this.created_nodes[e]){d=true}}else{e=-this.osm_id;this.osm_id++}if(d){b=this.created_nodes[e]}else{var b=this.createElementNS(null,"node")}this.created_nodes[e]=b;b.setAttribute("id",e);b.setAttribute("lon",c.x);b.setAttribute("lat",c.y);if(a.attributes){this.serializeTags(a,b)}this.setState(a,b);return d?[]:[b]},linestring:function(d){var a=[];var h=d.geometry;if(d.osm_id){id=d.osm_id}else{id=-this.osm_id;this.osm_id++}var b=this.createElementNS(null,"way");b.setAttribute("id",id);for(var c=0;c<h.components.length;c++){var f=this.createXML.point.apply(this,[h.components[c]]);if(f.length){f=f[0];var e=f.getAttribute("id");a.push(f)}else{e=h.components[c].osm_id;f=this.created_nodes[e]}this.setState(d,f);var g=this.createElementNS(null,"nd");g.setAttribute("ref",e);b.appendChild(g)}this.serializeTags(d,b);a.push(b);return a},polygon:function(b){var a=OpenLayers.Util.extend({area:"yes"},b.attributes);var c=new OpenLayers.Feature.Vector(b.geometry.components[0],a);c.osm_id=b.osm_id;return this.createXML.linestring.apply(this,[c])}},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(a,b){if(a.state){var c=null;switch(a.state){case OpenLayers.State.UPDATE:c="modify";case OpenLayers.State.DELETE:c="delete"}if(c){b.setAttribute("action",c)}}},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(c,b,a){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(c,b){OpenLayers.Control.Panel.prototype.initialize.apply(this,[b]);this.addControls([new OpenLayers.Control.Navigation()]);var a=[new OpenLayers.Control.DrawFeature(c,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(c,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(c,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon"})];this.addControls(a)},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(a){this.request=new OpenLayers.Format.ArcXML.Request();this.response=new OpenLayers.Format.ArcXML.Response();if(a){if(a.requesttype=="feature"){this.request.get_image=null;var c=this.request.get_feature.query;this.addCoordSys(c.featurecoordsys,a.featureCoordSys);this.addCoordSys(c.filtercoordsys,a.filterCoordSys);if(a.polygon){c.isspatial=true;c.spatialfilter.polygon=a.polygon}else{if(a.envelope){c.isspatial=true;c.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0};this.parseEnvelope(c.spatialfilter.envelope,a.envelope)}}}else{if(a.requesttype=="image"){this.request.get_feature=null;var b=this.request.get_image.properties;this.parseEnvelope(b.envelope,a.envelope);this.addLayers(b.layerlist,a.layers);this.addImageSize(b.imagesize,a.tileSize);this.addCoordSys(b.featurecoordsys,a.featureCoordSys);this.addCoordSys(b.filtercoordsys,a.filterCoordSys)}else{this.request=null}}}OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},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(d,c){for(var b=0,a=c.length;b<a;b++){d.push(c[b])}},addImageSize:function(b,a){if(a!==null){b.width=a.w;b.height=a.h;b.printwidth=a.w;b.printheight=a.h}},addCoordSys:function(a,b){if(typeof b=="string"){a.id=parseInt(b);a.string=b}else{if(typeof b=="object"&&b.proj!==null){a.id=b.proj.srsProjNumber;a.string=b.proj.srsCode}else{a=b}}},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 a=null;if(f&&f.documentElement){if(f.documentElement.nodeName=="ARCXML"){a=f.documentElement}else{a=f.documentElement.getElementsByTagName("ARCXML")[0]}}if(!a){var c,e;try{c=f.firstChild.nodeValue;e=f.firstChild.childNodes[1].firstChild.nodeValue}catch(d){}throw {message:"Error parsing the ArcXML request",error:c,source:e}}var b=this.parseResponse(a);return b},write:function(c){if(!c){c=this.request}var s=this.createElementNS("","ARCXML");s.setAttribute("version","1.1");var h=this.createElementNS("","REQUEST");if(c.get_image!=null){var l=this.createElementNS("","GET_IMAGE");h.appendChild(l);var k=this.createElementNS("","PROPERTIES");l.appendChild(k);var b=c.get_image.properties;if(b.featurecoordsys!=null){var q=this.createElementNS("","FEATURECOORDSYS");k.appendChild(q);if(b.featurecoordsys.id===0){q.setAttribute("string",b.featurecoordsys.string)}else{q.setAttribute("id",b.featurecoordsys.id)}}if(b.filtercoordsys!=null){var o=this.createElementNS("","FILTERCOORDSYS");k.appendChild(o);if(b.filtercoordsys.id===0){o.setAttribute("string",b.filtercoordsys.string)}else{o.setAttribute("id",b.filtercoordsys.id)}}if(b.envelope!=null){var w=this.createElementNS("","ENVELOPE");k.appendChild(w);w.setAttribute("minx",b.envelope.minx);w.setAttribute("miny",b.envelope.miny);w.setAttribute("maxx",b.envelope.maxx);w.setAttribute("maxy",b.envelope.maxy)}var u=this.createElementNS("","IMAGESIZE");k.appendChild(u);u.setAttribute("height",b.imagesize.height);u.setAttribute("width",b.imagesize.width);if(b.imagesize.height!=b.imagesize.printheight||b.imagesize.width!=b.imagesize.printwidth){u.setAttribute("printheight",b.imagesize.printheight);u.setArrtibute("printwidth",b.imagesize.printwidth)}if(b.background!=null){var a=this.createElementNS("","BACKGROUND");k.appendChild(a);a.setAttribute("color",b.background.color.r+","+b.background.color.g+","+b.background.color.b);if(b.background.transcolor!==null){a.setAttribute("transcolor",b.background.transcolor.r+","+b.background.transcolor.g+","+b.background.transcolor.b)}}if(b.layerlist!=null&&b.layerlist.length>0){var g=this.createElementNS("","LAYERLIST");k.appendChild(g);for(var r=0;r<b.layerlist.length;r++){var p=this.createElementNS("","LAYERDEF");g.appendChild(p);p.setAttribute("id",b.layerlist[r].id);p.setAttribute("visible",b.layerlist[r].visible);if(typeof b.layerlist[r].query=="object"){var f=b.layerlist[r].query;if(f.where.length<0){continue}var B=null;if(typeof f.spatialfilter=="boolean"&&f.spatialfilter){B=this.createElementNS("","SPATIALQUERY")}else{B=this.createElementNS("","QUERY")}B.setAttribute("where",f.where);if(typeof f.accuracy=="number"&&f.accuracy>0){B.setAttribute("accuracy",f.accuracy)}if(typeof f.featurelimit=="number"&&f.featurelimit<2000){B.setAttribute("featurelimit",f.featurelimit)}if(typeof f.subfields=="string"&&f.subfields!="#ALL#"){B.setAttribute("subfields",f.subfields)}if(typeof f.joinexpression=="string"&&f.joinexpression.length>0){B.setAttribute("joinexpression",f.joinexpression)}if(typeof f.jointables=="string"&&f.jointables.length>0){B.setAttribute("jointables",f.jointables)}p.appendChild(B)}if(typeof b.layerlist[r].renderer=="object"){this.addRenderer(p,b.layerlist[r].renderer)}}}}else{if(c.get_feature!=null){var l=this.createElementNS("","GET_FEATURES");l.setAttribute("outputmode","newxml");l.setAttribute("checkesc","true");if(c.get_feature.geometry){l.setAttribute("geometry",c.get_feature.geometry)}else{l.setAttribute("geometry","false")}if(c.get_feature.compact){l.setAttribute("compact",c.get_feature.compact)}if(c.get_feature.featurelimit=="number"){l.setAttribute("featurelimit",c.get_feature.featurelimit)}l.setAttribute("globalenvelope","true");h.appendChild(l);if(c.get_feature.layer!=null&&c.get_feature.layer.length>0){var z=this.createElementNS("","LAYER");z.setAttribute("id",c.get_feature.layer);l.appendChild(z)}var t=c.get_feature.query;if(t!=null){var v=null;if(t.isspatial){v=this.createElementNS("","SPATIALQUERY")}else{v=this.createElementNS("","QUERY")}l.appendChild(v);if(typeof t.accuracy=="number"){v.setAttribute("accuracy",t.accuracy)}if(t.featurecoordsys!=null){var e=this.createElementNS("","FEATURECOORDSYS");if(t.featurecoordsys.id==0){e.setAttribute("string",t.featurecoordsys.string)}else{e.setAttribute("id",t.featurecoordsys.id)}v.appendChild(e)}if(t.filtercoordsys!=null){var d=this.createElementNS("","FILTERCOORDSYS");if(t.filtercoordsys.id===0){d.setAttribute("string",t.filtercoordsys.string)}else{d.setAttribute("id",t.filtercoordsys.id)}v.appendChild(d)}if(t.buffer>0){var m=this.createElementNS("","BUFFER");m.setAttribute("distance",t.buffer);v.appendChild(m)}if(t.isspatial){var j=this.createElementNS("","SPATIALFILTER");j.setAttribute("relation",t.spatialfilter.relation);v.appendChild(j);if(t.spatialfilter.envelope){var A=this.createElementNS("","ENVELOPE");A.setAttribute("minx",t.spatialfilter.envelope.minx);A.setAttribute("miny",t.spatialfilter.envelope.miny);A.setAttribute("maxx",t.spatialfilter.envelope.maxx);A.setAttribute("maxy",t.spatialfilter.envelope.maxy);j.appendChild(A)}else{if(typeof t.spatialfilter.polygon=="object"){j.appendChild(this.writePolygonGeometry(t.spatialfilter.polygon))}}}if(t.where!=null&&t.where.length>0){v.setAttribute("where",t.where)}}}}s.appendChild(h);return OpenLayers.Format.XML.prototype.write.apply(this,[s])},addGroupRenderer:function(b,a){var e=this.createElementNS("","GROUPRENDERER");b.appendChild(e);for(var c=0;c<a.length;c++){var d=a[c];this.addRenderer(e,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(h,g){h.setAttribute("lookupfield",g.lookupfield);h.setAttribute("labelfield",g.labelfield);if(typeof g.exacts=="object"){for(var a=0,k=g.exacts.length;a<k;a++){var e=g.exacts[a];var d=this.createElementNS("","EXACT");if(typeof e.value=="string"){d.setAttribute("value",e.value)}if(typeof e.label=="string"){d.setAttribute("label",e.label)}if(typeof e.method=="string"){d.setAttribute("method",e.method)}h.appendChild(d);if(typeof e.symbol=="object"){var b=null;if(e.symbol.type=="text"){b=this.createElementNS("","TEXTSYMBOL")}if(b!=null){var l=this.fontStyleKeys;for(var c=0,f=l.length;c<f;c++){var j=l[c];if(symbol[j]){b.setAttribute(j,g[j])}}d.appendChild(b)}}}}},addValueMapRenderer:function(k,j){k.setAttribute("lookupfield",j.lookupfield);if(typeof j.ranges=="object"){for(var a=0,b=j.ranges.length;a<b;a++){var g=j.ranges[a];var e=this.createElementNS("","RANGE");e.setAttribute("lower",g.lower);e.setAttribute("upper",g.upper);k.appendChild(e);if(typeof g.symbol=="object"){var d=null;if(g.symbol.type=="simplepolygon"){d=this.createElementNS("","SIMPLEPOLYGONSYMBOL")}if(d!=null){if(typeof g.symbol.boundarycolor=="string"){d.setAttribute("boundarycolor",g.symbol.boundarycolor)}if(typeof g.symbol.fillcolor=="string"){d.setAttribute("fillcolor",g.symbol.fillcolor)}if(typeof g.symbol.filltransparency=="number"){d.setAttribute("filltransparency",g.symbol.filltransparency)}e.appendChild(d)}}}}else{if(typeof j.exacts=="object"){for(var c=0,l=j.exacts.length;c<l;c++){var h=j.exacts[c];var f=this.createElementNS("","EXACT");if(typeof h.value=="string"){f.setAttribute("value",h.value)}if(typeof h.label=="string"){f.setAttribute("label",h.label)}if(typeof h.method=="string"){f.setAttribute("method",h.method)}k.appendChild(f);if(typeof h.symbol=="object"){var d=null;if(h.symbol.type=="simplemarker"){d=this.createElementNS("","SIMPLEMARKERSYMBOL")}if(d!=null){if(typeof h.symbol.antialiasing=="string"){d.setAttribute("antialiasing",h.symbol.antialiasing)}if(typeof h.symbol.color=="string"){d.setAttribute("color",h.symbol.color)}if(typeof h.symbol.outline=="string"){d.setAttribute("outline",h.symbol.outline)}if(typeof h.symbol.overlap=="string"){d.setAttribute("overlap",h.symbol.overlap)}if(typeof h.symbol.shadow=="string"){d.setAttribute("shadow",h.symbol.shadow)}if(typeof h.symbol.transparency=="number"){d.setAttribute("transparency",h.symbol.transparency)}if(typeof h.symbol.usecentroid=="string"){d.setAttribute("usecentroid",h.symbol.usecentroid)}if(typeof h.symbol.width=="number"){d.setAttribute("width",h.symbol.width)}f.appendChild(d)}}}}}},addSimpleLabelRenderer:function(f,h){f.setAttribute("field",h.field);var e=["featureweight","howmanylabels","labelbufferratio","labelpriorities","labelweight","linelabelposition","rotationalangles"];for(var d=0,a=e.length;d<a;d++){var c=e[d];if(h[c]){f.setAttribute(c,h[c])}}if(h.symbol.type=="text"){var g=h.symbol;var b=this.createElementNS("","TEXTSYMBOL");f.appendChild(b);var e=this.fontStyleKeys;for(var d=0,a=e.length;d<a;d++){var c=e[d];if(g[c]){b.setAttribute(c,h[c])}}}},writePolygonGeometry:function(g){if(!(g instanceof OpenLayers.Geometry.Polygon)){throw {message:"Cannot write polygon geometry to ArcXML with an "+g.CLASS_NAME+" object.",geometry:g}}var b=this.createElementNS("","POLYGON");for(var e=0,c=g.components.length;e<c;e++){var a=g.components[e];var j=this.createElementNS("","RING");for(var d=0,k=a.components.length;d<k;d++){var h=a.components[d];var f=this.createElementNS("","POINT");f.setAttribute("x",h.x);f.setAttribute("y",h.y);j.appendChild(f)}b.appendChild(j)}return b},parseResponse:function(D){if(typeof D=="string"){var p=new OpenLayers.Format.XML();D=p.read(D)}var a=new OpenLayers.Format.ArcXML.Response();var E=D.getElementsByTagName("ERROR");if(E!=null&&E.length>0){a.error=this.getChildValue(E,"Unknown error.")}else{var t=D.getElementsByTagName("RESPONSE");if(t==null||t.length==0){a.error="No RESPONSE tag found in ArcXML response.";return a}var s=t[0].firstChild.nodeName;if(s=="#text"){s=t[0].firstChild.nextSibling.nodeName}if(s=="IMAGE"){var c=D.getElementsByTagName("ENVELOPE");var A=D.getElementsByTagName("OUTPUT");if(c==null||c.length==0){a.error="No ENVELOPE tag found in ArcXML response."}else{if(A==null||A.length==0){a.error="No OUTPUT tag found in ArcXML response."}else{var w=this.parseAttributes(c[0]);var z=this.parseAttributes(A[0]);if(typeof z.type=="string"){a.image={envelope:w,output:{type:z.type,data:this.getChildValue(A[0])}}}else{a.image={envelope:w,output:z}}}}}else{if(s=="FEATURES"){var j=t[0].getElementsByTagName("FEATURES");var r=j[0].getElementsByTagName("FEATURECOUNT");a.features.featurecount=r[0].getAttribute("count");if(a.features.featurecount>0){var d=j[0].getElementsByTagName("ENVELOPE");a.features.envelope=this.parseAttributes(d[0],typeof(0));var B=j[0].getElementsByTagName("FEATURE");for(var o=0;o<B.length;o++){var h=new OpenLayers.Feature.Vector();var u=B[o].getElementsByTagName("FIELD");for(var f=0;f<u.length;f++){var g=u[f].getAttribute("name");var l=u[f].getAttribute("value");h.attributes[g]=l}var v=B[o].getElementsByTagName("POLYGON");if(v.length>0){var k=v[0].getElementsByTagName("RING");var e=[];for(var q=0;q<k.length;q++){var C=[];C.push(this.parsePointGeometry(k[q]));var m=k[q].getElementsByTagName("HOLE");for(var b=0;b<m.length;b++){C.push(this.parsePointGeometry(m[b]))}m=null;e.push(new OpenLayers.Geometry.Polygon(C));C=null}k=null;if(e.length==1){h.geometry=e[0]}else{h.geometry=new OpenLayers.Geometry.MultiPolygon(e)}}a.features.feature.push(h)}}}else{a.error="Unidentified response type."}}}return a},parseAttributes:function(d,c){var b={};for(var a=0;a<d.attributes.length;a++){if(c=="number"){b[d.attributes[a].nodeName]=parseFloat(d.attributes[a].nodeValue)}else{b[d.attributes[a].nodeName]=d.attributes[a].nodeValue}}return b},parsePointGeometry:function(d){var b=[];var e=d.getElementsByTagName("COORDS");if(e.length>0){var f=this.getChildValue(e[0]);f=f.split(/;/);for(var h=0;h<f.length;h++){var g=f[h].split(/ /);b.push(new OpenLayers.Geometry.Point(parseFloat(g[0]),parseFloat(g[1])))}e=null}else{var a=d.getElementsByTagName("POINT");if(a.length>0){for(var c=0;c<a.length;c++){b.push(new OpenLayers.Geometry.Point(parseFloat(a[c].getAttribute("x")),parseFloat(a[c].getAttribute("y"))))}}a=null}return new OpenLayers.Geometry.LinearRing(b)},CLASS_NAME:"OpenLayers.Format.ArcXML"});OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(b){var a={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,a)},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"});OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(b){var a={image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""};return OpenLayers.Util.extend(this,a)},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(d){if(typeof d=="string"){d=OpenLayers.Format.XML.prototype.read.apply(this,[d])}var e=this.getElementsByTagNameNS(d.documentElement,this.gmlns,this.featureName);var c=[];for(var b=0;b<e.length;b++){var a=this.parseFeature(e[b]);if(a){c.push(a)}}return c},parseFeature:function(c){var d=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope","Box"];var j,f,k,b;for(var h=0;h<d.length;++h){j=d[h];f=this.getElementsByTagNameNS(c,this.gmlns,j);if(f.length>0){var b=this.parseGeometry[j.toLowerCase()];if(b){k=b.apply(this,[f[0]]);if(this.internalProjection&&this.externalProjection){k.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:j}))}break}}var g;if(this.extractAttributes){g=this.parseAttributes(c)}var l=new OpenLayers.Feature.Vector(k,g);l.gml={featureType:c.firstChild.nodeName.split(":")[1],featureNS:c.firstChild.namespaceURI,featureNSPrefix:c.firstChild.prefix};var a=c.firstChild;var e;while(a){if(a.nodeType==1){e=a.getAttribute("fid")||a.getAttribute("id");if(e){break}}a=a.nextSibling}l.fid=e;return l},parseGeometry:{point:function(d){var b,a;var e=[];var b=this.getElementsByTagNameNS(d,this.gmlns,"pos");if(b.length>0){a=b[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");e=a.split(this.regExes.splitSpace)}if(e.length==0){b=this.getElementsByTagNameNS(d,this.gmlns,"coordinates");if(b.length>0){a=b[0].firstChild.nodeValue;a=a.replace(this.regExes.removeSpace,"");e=a.split(",")}}if(e.length==0){b=this.getElementsByTagNameNS(d,this.gmlns,"coord");if(b.length>0){var f=this.getElementsByTagNameNS(b[0],this.gmlns,"X");var c=this.getElementsByTagNameNS(b[0],this.gmlns,"Y");if(f.length>0&&c.length>0){e=[f[0].firstChild.nodeValue,c[0].firstChild.nodeValue]}}}if(e.length==2){e[2]=null}if(this.xy){return new OpenLayers.Geometry.Point(e[0],e[1],e[2])}else{return new OpenLayers.Geometry.Point(e[1],e[0],e[2])}},multipoint:function(e){var b=this.getElementsByTagNameNS(e,this.gmlns,"Point");var d=[];if(b.length>0){var a;for(var c=0;c<b.length;++c){a=this.parseGeometry.point.apply(this,[b[c]]);if(a){d.push(a)}}}return new OpenLayers.Geometry.MultiPoint(d)},linestring:function(c,e){var d,b;var o=[];var p=[];d=this.getElementsByTagNameNS(c,this.gmlns,"posList");if(d.length>0){b=this.getChildValue(d[0]);b=b.replace(this.regExes.trimSpace,"");o=b.split(this.regExes.splitSpace);var h=parseInt(d[0].getAttribute("dimension"));var f,m,l,k;for(var g=0;g<o.length/h;++g){f=g*h;m=o[f];l=o[f+1];k=(h==2)?null:o[f+2];if(this.xy){p.push(new OpenLayers.Geometry.Point(m,l,k))}else{p.push(new OpenLayers.Geometry.Point(l,m,k))}}}if(o.length==0){d=this.getElementsByTagNameNS(c,this.gmlns,"coordinates");if(d.length>0){b=this.getChildValue(d[0]);b=b.replace(this.regExes.trimSpace,"");b=b.replace(this.regExes.trimComma,",");var a=b.split(this.regExes.splitSpace);for(var g=0;g<a.length;++g){o=a[g].split(",");if(o.length==2){o[2]=null}if(this.xy){p.push(new OpenLayers.Geometry.Point(o[0],o[1],o[2]))}else{p.push(new OpenLayers.Geometry.Point(o[1],o[0],o[2]))}}}}var q=null;if(p.length!=0){if(e){q=new OpenLayers.Geometry.LinearRing(p)}else{q=new OpenLayers.Geometry.LineString(p)}}return q},multilinestring:function(e){var b=this.getElementsByTagNameNS(e,this.gmlns,"LineString");var d=[];if(b.length>0){var a;for(var c=0;c<b.length;++c){a=this.parseGeometry.linestring.apply(this,[b[c]]);if(a){d.push(a)}}}return new OpenLayers.Geometry.MultiLineString(d)},polygon:function(e){var b=this.getElementsByTagNameNS(e,this.gmlns,"LinearRing");var d=[];if(b.length>0){var a;for(var c=0;c<b.length;++c){a=this.parseGeometry.linestring.apply(this,[b[c],true]);if(a){d.push(a)}}}return new OpenLayers.Geometry.Polygon(d)},multipolygon:function(e){var a=this.getElementsByTagNameNS(e,this.gmlns,"Polygon");var d=[];if(a.length>0){var c;for(var b=0;b<a.length;++b){c=this.parseGeometry.polygon.apply(this,[a[b]]);if(c){d.push(c)}}}return new OpenLayers.Geometry.MultiPolygon(d)},envelope:function(b){var e=[];var a;var f;var k=this.getElementsByTagNameNS(b,this.gmlns,"lowerCorner");if(k.length>0){var h=[];if(k.length>0){a=k[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");h=a.split(this.regExes.splitSpace)}if(h.length==2){h[2]=null}if(this.xy){var d=new OpenLayers.Geometry.Point(h[0],h[1],h[2])}else{var d=new OpenLayers.Geometry.Point(h[1],h[0],h[2])}}var g=this.getElementsByTagNameNS(b,this.gmlns,"upperCorner");if(g.length>0){var h=[];if(g.length>0){a=g[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");h=a.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(d&&j){e.push(new OpenLayers.Geometry.Point(d.x,d.y));e.push(new OpenLayers.Geometry.Point(j.x,d.y));e.push(new OpenLayers.Geometry.Point(j.x,j.y));e.push(new OpenLayers.Geometry.Point(d.x,j.y));e.push(new OpenLayers.Geometry.Point(d.x,d.y));var c=new OpenLayers.Geometry.LinearRing(e);f=new OpenLayers.Geometry.Polygon([c])}return f}},parseAttributes:function(e){var f={};var a=e.firstChild;var d,g,c,k,j,b,h;while(a){if(a.nodeType==1){d=a.childNodes;for(g=0;g<d.length;++g){c=d[g];if(c.nodeType==1){k=c.childNodes;if(k.length==1){j=k[0];if(j.nodeType==3||j.nodeType==4){b=(c.prefix)?c.nodeName.split(":")[1]:c.nodeName;h=j.nodeValue.replace(this.regExes.trimSpace,"");f[b]=h}}else{f[c.nodeName.split(":").pop()]=null}}}break}a=a.nextSibling}return f},write:function(c){if(!(c instanceof Array)){c=[c]}var b=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName);for(var a=0;a<c.length;a++){b.appendChild(this.createFeatureXML(c[a]))}return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(k){var h=k.geometry;var e=this.buildGeometryNode(h);var j=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);j.appendChild(e);var a=this.createElementNS(this.gmlns,"gml:"+this.featureName);var l=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);var c=k.fid||k.id;l.setAttribute("fid",c);l.appendChild(j);for(var g in k.attributes){var f=this.createTextNode(k.attributes[g]);var d=g.substring(g.lastIndexOf(":")+1);var b=this.createElementNS(this.featureNS,this.featurePrefix+":"+d);b.appendChild(f);l.appendChild(b)}a.appendChild(l);return a},buildGeometryNode:function(d){if(this.externalProjection&&this.internalProjection){d=d.clone();d.transform(this.internalProjection,this.externalProjection)}var c=d.CLASS_NAME;var b=c.substring(c.lastIndexOf(".")+1);var a=this.buildGeometry[b.toLowerCase()];return a.apply(this,[d])},buildGeometry:{point:function(b){var a=this.createElementNS(this.gmlns,"gml:Point");a.appendChild(this.buildCoordinatesNode(b));return a},multipoint:function(f){var d=this.createElementNS(this.gmlns,"gml:MultiPoint");var c=f.components;var b,e;for(var a=0;a<c.length;a++){b=this.createElementNS(this.gmlns,"gml:pointMember");e=this.buildGeometry.point.apply(this,[c[a]]);b.appendChild(e);d.appendChild(b)}return d},linestring:function(b){var a=this.createElementNS(this.gmlns,"gml:LineString");a.appendChild(this.buildCoordinatesNode(b));return a},multilinestring:function(f){var d=this.createElementNS(this.gmlns,"gml:MultiLineString");var a=f.components;var c,e;for(var b=0;b<a.length;++b){c=this.createElementNS(this.gmlns,"gml:lineStringMember");e=this.buildGeometry.linestring.apply(this,[a[b]]);c.appendChild(e);d.appendChild(c)}return d},linearring:function(b){var a=this.createElementNS(this.gmlns,"gml:LinearRing");a.appendChild(this.buildCoordinatesNode(b));return a},polygon:function(g){var d=this.createElementNS(this.gmlns,"gml:Polygon");var f=g.components;var c,e,b;for(var a=0;a<f.length;++a){b=(a==0)?"outerBoundaryIs":"innerBoundaryIs";c=this.createElementNS(this.gmlns,"gml:"+b);e=this.buildGeometry.linearring.apply(this,[f[a]]);c.appendChild(e);d.appendChild(c)}return d},multipolygon:function(f){var d=this.createElementNS(this.gmlns,"gml:MultiPolygon");var a=f.components;var e,b;for(var c=0;c<a.length;++c){e=this.createElementNS(this.gmlns,"gml:polygonMember");b=this.buildGeometry.polygon.apply(this,[a[c]]);e.appendChild(b);d.appendChild(e)}return d},bounds:function(b){var a=this.createElementNS(this.gmlns,"gml:Box");a.appendChild(this.buildCoordinatesNode(b));return a}},buildCoordinatesNode:function(f){var a=this.createElementNS(this.gmlns,"gml:coordinates");a.setAttribute("decimal",".");a.setAttribute("cs",",");a.setAttribute("ts"," ");var e=[];if(f instanceof OpenLayers.Bounds){e.push(f.left+","+f.bottom);e.push(f.right+","+f.top)}else{var c=(f.components)?f.components:[f];for(var b=0;b<c.length;b++){e.push(c[b].x+","+c[b].y)}}var d=this.createTextNode(e.join(" "));a.appendChild(d);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(j,g,a){g=(g)?g:"FeatureCollection";var d=null;var c=null;if(typeof j=="string"){c=OpenLayers.Format.JSON.prototype.read.apply(this,[j,a])}else{c=j}if(!c){OpenLayers.Console.error("Bad JSON: "+j)}else{if(typeof(c.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+j)}else{if(this.isValidType(c,g)){switch(g){case"Geometry":try{d=this.parseGeometry(c)}catch(b){OpenLayers.Console.error(b)}break;case"Feature":try{d=this.parseFeature(c);d.type="Feature"}catch(b){OpenLayers.Console.error(b)}break;case"FeatureCollection":d=[];switch(c.type){case"Feature":try{d.push(this.parseFeature(c))}catch(b){d=null;OpenLayers.Console.error(b)}break;case"FeatureCollection":for(var e=0,f=c.features.length;e<f;++e){try{d.push(this.parseFeature(c.features[e]))}catch(b){d=null;OpenLayers.Console.error(b)}}break;default:try{var h=this.parseGeometry(c);d.push(new OpenLayers.Feature.Vector(h))}catch(b){d=null;OpenLayers.Console.error(b)}}break}}}}return d},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(d){var b,f,a,e;a=(d.properties)?d.properties:{};e=(d.geometry&&d.geometry.bbox)||d.bbox;try{f=this.parseGeometry(d.geometry)}catch(c){throw c}b=new OpenLayers.Feature.Vector(f,a);if(e){b.bounds=OpenLayers.Bounds.fromArray(e)}if(d.id){b.fid=d.id}return b},parseGeometry:function(e){if(e==null){return null}var g,f=false;if(e.type=="GeometryCollection"){if(!(e.geometries instanceof Array)){throw"GeometryCollection must have geometries array: "+e}var b=e.geometries.length;var d=new Array(b);for(var a=0;a<b;++a){d[a]=this.parseGeometry.apply(this,[e.geometries[a]])}g=new OpenLayers.Geometry.Collection(d);f=true}else{if(!(e.coordinates instanceof Array)){throw"Geometry must have coordinates array: "+e}if(!this.parseCoords[e.type.toLowerCase()]){throw"Unsupported geometry type: "+e.type}try{g=this.parseCoords[e.type.toLowerCase()].apply(this,[e.coordinates])}catch(c){throw c}}if(this.internalProjection&&this.externalProjection&&!f){g.transform(this.externalProjection,this.internalProjection)}return g},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 c=[];var e=null;for(var b=0,a=f.length;b<a;++b){try{e=this.parseCoords.point.apply(this,[f[b]])}catch(d){throw d}c.push(e)}return new OpenLayers.Geometry.MultiPoint(c)},linestring:function(f){var c=[];var e=null;for(var b=0,a=f.length;b<a;++b){try{e=this.parseCoords.point.apply(this,[f[b]])}catch(d){throw d}c.push(e)}return new OpenLayers.Geometry.LineString(c)},multilinestring:function(f){var c=[];var b=null;for(var d=0,a=f.length;d<a;++d){try{b=this.parseCoords.linestring.apply(this,[f[d]])}catch(e){throw e}c.push(b)}return new OpenLayers.Geometry.MultiLineString(c)},polygon:function(g){var f=[];var e,b;for(var c=0,a=g.length;c<a;++c){try{b=this.parseCoords.linestring.apply(this,[g[c]])}catch(d){throw d}e=new OpenLayers.Geometry.LinearRing(b.components);f.push(e)}return new OpenLayers.Geometry.Polygon(f)},multipolygon:function(f){var b=[];var e=null;for(var c=0,a=f.length;c<a;++c){try{e=this.parseCoords.polygon.apply(this,[f[c]])}catch(d){throw d}b.push(e)}return new OpenLayers.Geometry.MultiPolygon(b)},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(e,d){var a={type:null};if(e instanceof Array){a.type="FeatureCollection";var g=e.length;a.features=new Array(g);for(var c=0;c<g;++c){var b=e[c];if(!b instanceof OpenLayers.Feature.Vector){var f="FeatureCollection only supports collections of features: "+b;throw f}a.features[c]=this.extract.feature.apply(this,[b])}}else{if(e.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){a=this.extract.geometry.apply(this,[e])}else{if(e instanceof OpenLayers.Feature.Vector){a=this.extract.feature.apply(this,[e]);if(e.layer&&e.layer.projection){a.crs=this.createCRSObject(e)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[a,d])},createCRSObject:function(b){var c=b.layer.projection.toString();var a={};if(c.match(/epsg:/i)){var d=parseInt(c.substring(c.indexOf(":")+1));if(d==4326){a={type:"OGC",properties:{urn:"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{a={type:"EPSG",properties:{code:d}}}}return a},extract:{feature:function(b){var a=this.extract.geometry.apply(this,[b.geometry]);return{type:"Feature",id:b.fid==null?b.id:b.fid,properties:b.attributes,geometry:a}},geometry:function(d){if(d==null){return null}if(this.internalProjection&&this.externalProjection){d=d.clone();d.transform(this.internalProjection,this.externalProjection)}var a=d.CLASS_NAME.split(".")[2];var c=this.extract[a.toLowerCase()].apply(this,[d]);var b;if(a=="Collection"){b={type:"GeometryCollection",geometries:c}}else{b={type:a,coordinates:c}}return b},point:function(a){return[a.x,a.y]},multipoint:function(c){var d=[];for(var b=0,a=c.components.length;b<a;++b){d.push(this.extract.point.apply(this,[c.components[b]]))}return d},linestring:function(b){var d=[];for(var c=0,a=b.components.length;c<a;++c){d.push(this.extract.point.apply(this,[b.components[c]]))}return d},multilinestring: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},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(d){var c=[];for(var b=0,a=d.components.length;b<a;++b){c.push(this.extract.polygon.apply(this,[d.components[b]]))}return c},collection:function(c){var a=c.components.length;var d=new Array(a);for(var b=0;b<a;++b){d[b]=this.extract.geometry.apply(this,[c.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 b=new OpenLayers.Format.ArcXML();var a=b.read(c);return a.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 c=[];this.readNode(e,{features:c});if(c.length==0){var d=this.getElementsByTagNameNS(e,this.namespaces.gml,"featureMember");if(d.length){for(var b=0,a=d.length;b<a;++b){this.readNode(d[b],{features:c})}}else{var d=this.getElementsByTagNameNS(e,this.namespaces.gml,"featureMembers");if(d.length){this.readNode(d[0],{features:c})}}}return c},readers:{gml:{featureMember:function(a,b){this.readChildNodes(a,b)},featureMembers:function(a,b){this.readChildNodes(a,b)},name:function(a,b){b.name=this.getChildValue(a)},boundedBy:function(b,c){var a={};this.readChildNodes(b,a);if(a.components&&a.components.length>0){c.bounds=a.components[0]}},Point:function(b,a){var c={points:[]};this.readChildNodes(b,c);if(!a.components){a.components=[]}a.components.push(c.points[0])},coordinates:function(e,g){var h=this.getChildValue(e).replace(this.regExes.trimSpace,"");h=h.replace(this.regExes.trimComma,",");var a=h.split(this.regExes.splitSpace);var f;var d=a.length;var c=new Array(d);for(var b=0;b<d;++b){f=a[b].split(",");if(this.xy){c[b]=new OpenLayers.Geometry.Point(f[0],f[1],f[2])}else{c[b]=new OpenLayers.Geometry.Point(f[1],f[0],f[2])}}g.points=c},coord:function(a,b){var c={};this.readChildNodes(a,c);if(!b.points){b.points=[]}b.points.push(new OpenLayers.Geometry.Point(c.x,c.y,c.z))},X:function(a,b){b.x=this.getChildValue(a)},Y:function(a,b){b.y=this.getChildValue(a)},Z:function(a,b){b.z=this.getChildValue(a)},MultiPoint:function(b,a){var c={components:[]};this.readChildNodes(b,c);a.components=[new OpenLayers.Geometry.MultiPoint(c.components)]},pointMember:function(a,b){this.readChildNodes(a,b)},LineString:function(b,a){var c={};this.readChildNodes(b,c);if(!a.components){a.components=[]}a.components.push(new OpenLayers.Geometry.LineString(c.points))},MultiLineString:function(b,a){var c={components:[]};this.readChildNodes(b,c);a.components=[new OpenLayers.Geometry.MultiLineString(c.components)]},lineStringMember:function(a,b){this.readChildNodes(a,b)},Polygon:function(b,a){var c={outer:null,inner:[]};this.readChildNodes(b,c);c.inner.unshift(c.outer);if(!a.components){a.components=[]}a.components.push(new OpenLayers.Geometry.Polygon(c.inner))},LinearRing:function(b,c){var a={};this.readChildNodes(b,a);c.components=[new OpenLayers.Geometry.LinearRing(a.points)]},MultiPolygon:function(b,a){var c={components:[]};this.readChildNodes(b,c);a.components=[new OpenLayers.Geometry.MultiPolygon(c.components)]},polygonMember:function(a,b){this.readChildNodes(a,b)},GeometryCollection:function(b,a){var c={components:[]};this.readChildNodes(b,c);a.components=[new OpenLayers.Geometry.Collection(c.components)]},geometryMember:function(a,b){this.readChildNodes(a,b)}},feature:{"*":function(c,d){var a;var b=c.localName||c.nodeName.split(":").pop();if(!this.singleFeatureType&&(OpenLayers.Util.indexOf(this.featureType,b)!=-1)){a="_typeName"}else{if(b==this.featureType){a="_typeName"}else{if(c.childNodes.length==0||(c.childNodes.length==1&&c.firstChild.nodeType==3)){if(this.extractAttributes){a="_attribute"}}else{a="_geometry"}}}if(a){this.readers.feature[a].apply(this,[c,d])}},_typeName:function(c,d){var a={components:[],attributes:{}};this.readChildNodes(c,a);if(a.name){a.attributes.name=a.name}var b=new OpenLayers.Feature.Vector(a.components[0],a.attributes);if(!this.singleFeatureType){b.type=c.nodeName.split(":").pop();b.namespace=c.namespaceURI}var e=c.getAttribute("fid")||this.getAttributeNS(c,this.namespaces.gml,"id");if(e){b.fid=e}if(this.internalProjection&&this.externalProjection&&b.geometry){b.geometry.transform(this.externalProjection,this.internalProjection)}if(a.bounds){b.geometry.bounds=a.bounds}d.features.push(b)},_geometry:function(a,b){this.readChildNodes(a,b)},_attribute:function(b,d){var a=b.localName||b.nodeName.split(":").pop();var c=this.getChildValue(b);d.attributes[a]=c}},wfs:{FeatureCollection:function(a,b){this.readChildNodes(a,b)}}},write:function(c){var b;if(c instanceof Array){b="featureMembers"}else{b="featureMember"}var a=this.writeNode("gml:"+b,c);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:{featureMember:function(a){var b=this.createElementNSPlus("gml:featureMember");this.writeNode("feature:_typeName",a,b);return b},MultiPoint:function(c){var b=this.createElementNSPlus("gml:MultiPoint");for(var a=0;a<c.components.length;++a){this.writeNode("pointMember",c.components[a],b)}return b},pointMember:function(b){var a=this.createElementNSPlus("gml:pointMember");this.writeNode("Point",b,a);return a},MultiLineString:function(c){var b=this.createElementNSPlus("gml:MultiLineString");for(var a=0;a<c.components.length;++a){this.writeNode("lineStringMember",c.components[a],b)}return b},lineStringMember:function(b){var a=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",b,a);return a},MultiPolygon:function(c){var b=this.createElementNSPlus("gml:MultiPolygon");for(var a=0;a<c.components.length;++a){this.writeNode("polygonMember",c.components[a],b)}return b},polygonMember:function(b){var a=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",b,a);return a},GeometryCollection:function(d){var c=this.createElementNSPlus("gml:GeometryCollection");for(var b=0,a=d.components.length;b<a;++b){this.writeNode("geometryMember",d.components[b],c)}return c},geometryMember:function(b){var a=this.createElementNSPlus("gml:geometryMember");var c=this.writeNode("feature:_geometry",b);a.appendChild(c.firstChild);return a}},feature:{_typeName:function(b){var c=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:b.fid}});if(b.geometry){this.writeNode("feature:_geometry",b.geometry,c)}for(var a in b.attributes){var d=b.attributes[a];if(d!=null){this.writeNode("feature:_attribute",{name:a,value:d},c)}}return c},_geometry:function(c){if(this.externalProjection&&this.internalProjection){c=c.clone().transform(this.internalProjection,this.externalProjection)}var b=this.createElementNSPlus("feature:"+this.geometryName);var a=this.geometryTypes[c.CLASS_NAME];var d=this.writeNode("gml:"+a,c,b);if(this.srsName){d.setAttribute("srsName",this.srsName)}return b},_attribute:function(a){return this.createElementNSPlus("feature:"+a.name,{value:a.value})}},wfs:{FeatureCollection:function(c){var d=this.createElementNSPlus("wfs:FeatureCollection");for(var b=0,a=c.length;b<a;++b){this.writeNode("gml:featureMember",c[b],d)}return d}}},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(a,b){OpenLayers.Format.GML.prototype.initialize.apply(this,[a]);this.layer=b;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(b){var c=this.createElementNS(this.wfsns,"wfs:Transaction");c.setAttribute("version","1.0.0");c.setAttribute("service","WFS");for(var a=0;a<b.length;a++){switch(b[a].state){case OpenLayers.State.INSERT:c.appendChild(this.insert(b[a]));break;case OpenLayers.State.UPDATE:c.appendChild(this.update(b[a]));break;case OpenLayers.State.DELETE:c.appendChild(this.remove(b[a]));break}}return OpenLayers.Format.XML.prototype.write.apply(this,[c])},createFeatureXML:function(f){var c=this.buildGeometryNode(f.geometry);var g=this.createElementNS(this.featureNS,"feature:"+this.geometryName);g.appendChild(c);var b=this.createElementNS(this.featureNS,"feature:"+this.featureName);b.appendChild(g);for(var a in f.attributes){var h=this.createTextNode(f.attributes[a]);var d=a;if(a.search(":")!=-1){d=a.split(":")[1]}var e=this.createElementNS(this.featureNS,"feature:"+d);e.appendChild(h);b.appendChild(e)}return b},insert:function(b){var a=this.createElementNS(this.wfsns,"wfs:Insert");a.appendChild(this.createFeatureXML(b));return a},update:function(k){if(!k.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"))}var f=this.createElementNS(this.wfsns,"wfs:Update");f.setAttribute("typeName",this.featurePrefix+":"+this.featureName);f.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var h=this.createElementNS(this.wfsns,"wfs:Property");var a=this.createElementNS(this.wfsns,"wfs:Name");var c=this.createTextNode(this.geometryName);a.appendChild(c);h.appendChild(a);var j=this.createElementNS(this.wfsns,"wfs:Value");var d=this.buildGeometryNode(k.geometry);if(k.layer){d.setAttribute("srsName",k.layer.projection.getCode())}j.appendChild(d);h.appendChild(j);f.appendChild(h);for(var e in k.attributes){h=this.createElementNS(this.wfsns,"wfs:Property");a=this.createElementNS(this.wfsns,"wfs:Name");a.appendChild(this.createTextNode(e));h.appendChild(a);j=this.createElementNS(this.wfsns,"wfs:Value");j.appendChild(this.createTextNode(k.attributes[e]));h.appendChild(j);f.appendChild(h)}var g=this.createElementNS(this.ogcns,"ogc:Filter");var b=this.createElementNS(this.ogcns,"ogc:FeatureId");b.setAttribute("fid",k.fid);g.appendChild(b);f.appendChild(g);return f},remove:function(b){if(!b.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"));return false}var a=this.createElementNS(this.wfsns,"wfs:Delete");a.setAttribute("typeName",this.featurePrefix+":"+this.featureName);a.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var c=this.createElementNS(this.ogcns,"ogc:Filter");var d=this.createElementNS(this.ogcns,"ogc:FeatureId");d.setAttribute("fid",b.fid);c.appendChild(d);a.appendChild(c);return a},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(c,b,a){this.tileSize=new OpenLayers.Size(512,512);this.params=OpenLayers.Util.applyDefaults({ServiceName:a.serviceName},this.DEFAULT_PARAMS);this.options=OpenLayers.Util.applyDefaults(a,this.DEFAULT_OPTIONS);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[c,b,this.params,a]);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(d){var a="";d=this.adjustBounds(d);var c=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:d.toArray(),tileSize:this.tileSize}));var b=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:c.write(),async:false});if(b!=null){var f=b.responseXML;if(!f||!f.documentElement){f=b.responseText}var e=new OpenLayers.Format.ArcXML();var g=e.read(f);a=this.getUrlOrImage(g.image.output)}return a},getURLasync:function(c,a,e,d){c=this.adjustBounds(c);var b=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:c.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(),async:true,data:b.write(),callback:function(f){var h=f.responseXML;if(!h||!h.documentElement){h=f.responseText}var g=new OpenLayers.Format.ArcXML();var j=g.read(h);a[e]=this.getUrlOrImage(j.image.output);d.apply(a)},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(h,f,l){var b=l.buffer||1;var j=l.callback||function(){};var k=l.scope||window;var a={};OpenLayers.Util.extend(a,this.options);a.requesttype="feature";if(h instanceof OpenLayers.LonLat){a.polygon=null;a.envelope=[h.lon-b,h.lat-b,h.lon+b,h.lat+b]}else{if(h instanceof OpenLayers.Geometry.Polygon){a.envelope=null;a.polygon=h}}var e=new OpenLayers.Format.ArcXML(a);OpenLayers.Util.extend(e.request.get_feature,l);e.request.get_feature.layer=f.id;if(typeof f.query.accuracy=="number"){e.request.get_feature.query.accuracy=f.query.accuracy}else{var g=this.map.getCenter();var d=this.map.getViewPortPxFromLonLat(g);d.x++;var c=this.map.getLonLatFromPixel(d);e.request.get_feature.query.accuracy=c.lon-g.lon}e.request.get_feature.query.where=f.query.where;e.request.get_feature.query.spatialfilter.relation="area_intersection";OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:e.write(),callback:function(o){var m=e.parseResponse(o.responseText);if(!e.iserror()){j.call(k,m.features)}else{j.call(k,null)}}})},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,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(b,a){var c={};this.readChildNodes(b,c);a.outer=c.components[0]},innerBoundaryIs:function(b,a){var c={};this.readChildNodes(b,c);a.inner.push(c.components[0])},Box:function(d,b){var e={};this.readChildNodes(d,e);if(!b.components){b.components=[]}var c=e.points[0];var a=e.points[1];b.components.push(new OpenLayers.Bounds(c.x,c.y,a.x,a.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 b;if(c instanceof Array){b="wfs:FeatureCollection"}else{b="gml:featureMember"}var a=this.writeNode(b,c);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(b){var a=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[b],a);return a},coordinates:function(d){var c=d.length;var e=new Array(c);var a;for(var b=0;b<c;++b){a=d[b];if(this.xy){e[b]=a.x+","+a.y}else{e[b]=a.y+","+a.x}if(a.z!=undefined){e[b]+=","+a.z}}return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:(c==1)?e[0]:e.join(" ")})},LineString:function(b){var a=this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",b.components,a);return a},Polygon:function(c){var b=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",c.components[0],b);for(var a=1;a<c.components.length;++a){this.writeNode("innerBoundaryIs",c.components[a],b)}return b},outerBoundaryIs:function(a){var b=this.createElementNSPlus("gml:outerBoundaryIs");this.writeNode("LinearRing",a,b);return b},innerBoundaryIs:function(a){var b=this.createElementNSPlus("gml:innerBoundaryIs");this.writeNode("LinearRing",a,b);return b},LinearRing:function(a){var b=this.createElementNSPlus("gml:LinearRing");this.writeNode("coordinates",a.components,b);return b},Box:function(b){var a=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:b.left,y:b.bottom},{x:b.right,y:b.top}],a);if(this.srsName){a.setAttribute("srsName",this.srsName)}return a}},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(a,b){this.readChildNodes(a,b)},Curve:function(b,a){var c={points:[]};this.readChildNodes(b,c);if(!a.components){a.components=[]}a.components.push(new OpenLayers.Geometry.LineString(c.points))},segments:function(a,b){this.readChildNodes(a,b)},LineStringSegment:function(b,a){var c={};this.readChildNodes(b,c);if(c.points){Array.prototype.push.apply(a.points,c.points)}},pos:function(b,d){var e=this.getChildValue(b).replace(this.regExes.trimSpace,"");var c=e.split(this.regExes.splitSpace);var a;if(this.xy){a=new OpenLayers.Geometry.Point(c[0],c[1],c[2])}else{a=new OpenLayers.Geometry.Point(c[1],c[0],c[2])}d.points=[a]},posList:function(a,d){var h=this.getChildValue(a).replace(this.regExes.trimSpace,"");var m=h.split(this.regExes.splitSpace);var e=parseInt(a.getAttribute("dimension"))||2;var b,o,l,g;var k=m.length/e;var p=new Array(k);for(var c=0,f=m.length;c<f;c+=e){o=m[c];l=m[c+1];g=(e==2)?undefined:m[c+2];if(this.xy){p[c/e]=new OpenLayers.Geometry.Point(o,l,g)}else{p[c/e]=new OpenLayers.Geometry.Point(l,o,g)}}d.points=p},Surface:function(a,b){this.readChildNodes(a,b)},patches:function(a,b){this.readChildNodes(a,b)},PolygonPatch:function(a,b){this.readers.gml.Polygon.apply(this,[a,b])},exterior:function(b,a){var c={};this.readChildNodes(b,c);a.outer=c.components[0]},interior:function(b,a){var c={};this.readChildNodes(b,c);a.inner.push(c.components[0])},MultiCurve:function(b,a){var c={components:[]};this.readChildNodes(b,c);if(c.components.length>0){a.components=[new OpenLayers.Geometry.MultiLineString(c.components)]}},curveMember:function(a,b){this.readChildNodes(a,b)},MultiSurface:function(b,a){var c={components:[]};this.readChildNodes(b,c);if(c.components.length>0){a.components=[new OpenLayers.Geometry.MultiPolygon(c.components)]}},surfaceMember:function(a,b){this.readChildNodes(a,b)},surfaceMembers:function(a,b){this.readChildNodes(a,b)},pointMembers:function(a,b){this.readChildNodes(a,b)},lineStringMembers:function(a,b){this.readChildNodes(a,b)},polygonMembers:function(a,b){this.readChildNodes(a,b)},geometryMembers:function(a,b){this.readChildNodes(a,b)},Envelope:function(d,b){var e={points:new Array(2)};this.readChildNodes(d,e);if(!b.components){b.components=[]}var c=e.points[0];var a=e.points[1];b.components.push(new OpenLayers.Bounds(c.x,c.y,a.x,a.y))},lowerCorner:function(b,a){var c={};this.readers.gml.pos.apply(this,[b,c]);a.points[0]=c.points[0]},upperCorner:function(b,a){var c={};this.readers.gml.pos.apply(this,[b,c]);a.points[1]=c.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 b;if(c instanceof Array){b="featureMembers"}else{b="featureMember"}var a=this.writeNode("gml:"+b,c);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(c){var d=this.createElementNSPlus("gml:featureMembers");for(var b=0,a=c.length;b<a;++b){this.writeNode("feature:_typeName",c[b],d)}return d},Point:function(b){var a=this.createElementNSPlus("gml:Point");this.writeNode("pos",b,a);return a},pos:function(a){var b=(this.xy)?(a.x+" "+a.y):(a.y+" "+a.x);return this.createElementNSPlus("gml:pos",{value:b})},LineString:function(b){var a=this.createElementNSPlus("gml:LineString");this.writeNode("posList",b.components,a);return a},Curve:function(b){var a=this.createElementNSPlus("gml:Curve");this.writeNode("segments",b,a);return a},segments:function(b){var a=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",b,a);return a},LineStringSegment:function(b){var a=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",b.components,a);return a},posList:function(d){var b=d.length;var e=new Array(b);var a;for(var c=0;c<b;++c){a=d[c];if(this.xy){e[c]=a.x+" "+a.y}else{e[c]=a.y+" "+a.x}}return this.createElementNSPlus("gml:posList",{value:e.join(" ")})},Surface:function(b){var a=this.createElementNSPlus("gml:Surface");this.writeNode("patches",b,a);return a},patches:function(b){var a=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",b,a);return a},PolygonPatch:function(d){var c=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",d.components[0],c);for(var b=1,a=d.components.length;b<a;++b){this.writeNode("interior",d.components[b],c)}return c},Polygon:function(d){var c=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",d.components[0],c);for(var b=1,a=d.components.length;b<a;++b){this.writeNode("interior",d.components[b],c)}return c},exterior:function(a){var b=this.createElementNSPlus("gml:exterior");this.writeNode("LinearRing",a,b);return b},interior:function(a){var b=this.createElementNSPlus("gml:interior");this.writeNode("LinearRing",a,b);return b},LinearRing:function(a){var b=this.createElementNSPlus("gml:LinearRing");this.writeNode("posList",a.components,b);return b},MultiCurve:function(d){var c=this.createElementNSPlus("gml:MultiCurve");for(var b=0,a=d.components.length;b<a;++b){this.writeNode("curveMember",d.components[b],c)}return c},curveMember:function(b){var a=this.createElementNSPlus("gml:curveMember");if(this.curve){this.writeNode("Curve",b,a)}else{this.writeNode("LineString",b,a)}return a},MultiSurface:function(d){var c=this.createElementNSPlus("gml:MultiSurface");for(var b=0,a=d.components.length;b<a;++b){this.writeNode("surfaceMember",d.components[b],c)}return c},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(b){var a=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",b,a);this.writeNode("upperCorner",b,a);if(this.srsName){a.setAttribute("srsName",this.srsName)}return a},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(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsNotEqualTo:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(b,a);c.filters.push(a)}},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(a){var c=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",a,c);var b=this.writeNode("gml:Box",a.value,c);if(a.projection){b.setAttribute("srsName",a.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(b,a){var c=this.createElementNSPlus("ogc:"+a);this.writeNode("PropertyName",b,c);var d;if(b.value instanceof OpenLayers.Geometry){d=this.writeNode("feature:_geometry",b.value).firstChild}else{d=this.writeNode("gml:Box",b.value)}if(b.projection){d.setAttribute("srsName",b.projection)}c.appendChild(d);return c},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(b,d){var c=b.getAttribute("matchCase");var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!(c==="false"||c==="0")});this.readChildNodes(b,a);d.filters.push(a)},PropertyIsNotEqualTo:function(b,d){var c=b.getAttribute("matchCase");var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!(c==="false"||c==="0")});this.readChildNodes(b,a);d.filters.push(a)}},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(a){var c=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",a,c);var b=this.writeNode("gml:Envelope",a.value);if(a.projection){b.setAttribute("srsName",a.projection)}c.appendChild(b);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(b,a){var c=this.createElementNSPlus("ogc:"+a);this.writeNode("PropertyName",b,c);var d;if(b.value instanceof OpenLayers.Geometry){d=this.writeNode("feature:_geometry",b.value).firstChild}else{d=this.writeNode("gml:Envelope",b.value)}if(b.projection){d.setAttribute("srsName",b.projection)}c.appendChild(d);return c},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,a){a=OpenLayers.Util.applyDefaults(a,this.options);var b={namedLayers:a.namedLayersAsArray===true?[]:{}};this.readChildNodes(c,b);return b},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(a,b){b.version=a.getAttribute("version");this.readChildNodes(a,b)},Name:function(a,b){b.name=this.getChildValue(a)},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b.description=this.getChildValue(a)},NamedLayer:function(d,e){var c={userStyles:[],namedStyles:[]};this.readChildNodes(d,c);for(var b=0,a=c.userStyles.length;b<a;++b){c.userStyles[b].layerName=c.name}if(e.namedLayers instanceof Array){e.namedLayers.push(c)}else{e.namedLayers[c.name]=c}},NamedStyle:function(b,a){a.namedStyles.push(this.getChildName(b.firstChild))},UserStyle:function(c,a){var d={defaultsPerSymbolizer:true,rules:[]};this.readChildNodes(c,d);var b=new OpenLayers.Style(this.defaultSymbolizer,d);a.userStyles.push(b)},IsDefault:function(b,a){if(this.getChildValue(b)=="1"){a.isDefault=true}},FeatureTypeStyle:function(b,a){var c={rules:[]};this.readChildNodes(b,c);a.rules=c.rules},Rule:function(a,c){var b=new OpenLayers.Rule();this.readChildNodes(a,b);c.rules.push(b)},ElseFilter:function(a,b){b.elseFilter=true},MinScaleDenominator:function(a,b){b.minScaleDenominator=parseFloat(this.getChildValue(a))},MaxScaleDenominator:function(a,b){b.maxScaleDenominator=parseFloat(this.getChildValue(a))},TextSymbolizer:function(b,c){var a=c.symbolizer.Text||{};this.readChildNodes(b,a);c.symbolizer.Text=a},Label:function(b,a){var d={};this.readChildNodes(b,d);if(d.property){a.label="${"+d.property+"}"}else{var c=this.readOgcExpression(b);if(c){a.label=c}}},Font:function(b,a){this.readChildNodes(b,a)},Halo:function(b,a){var c={};this.readChildNodes(b,c);a.haloRadius=c.haloRadius;a.haloColor=c.fillColor;a.haloOpacity=c.fillOpacity},Radius:function(c,b){var a=this.readOgcExpression(c);if(a!=null){b.haloRadius=a}},LineSymbolizer:function(b,c){var a=c.symbolizer.Line||{};this.readChildNodes(b,a);c.symbolizer.Line=a},PolygonSymbolizer:function(b,c){var a=c.symbolizer.Polygon||{};this.readChildNodes(b,a);c.symbolizer.Polygon=a},PointSymbolizer:function(b,c){var a=c.symbolizer.Point||{};this.readChildNodes(b,a);c.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(c,b){var a=c.getAttribute("name");var e=this.cssMap[a];if(e){var d=this.readOgcExpression(c);if(d){b[e]=d}}},Graphic:function(e,d){d.graphic=true;var h={};this.readChildNodes(e,h);var c=["strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fillColor","fillOpacity","graphicName","rotation","graphicFormat"];var g,f;for(var b=0,a=c.length;b<a;++b){g=c[b];f=h[g];if(f!=undefined){d[g]=f}}if(h.opacity!=undefined){d.graphicOpacity=h.opacity}if(h.size!=undefined){d.pointRadius=h.size/2}if(h.href!=undefined){d.externalGraphic=h.href}if(h.rotation!=undefined){d.rotation=h.rotation}},ExternalGraphic:function(a,b){this.readChildNodes(a,b)},Mark:function(a,b){this.readChildNodes(a,b)},WellKnownName:function(a,b){b.graphicName=this.getChildValue(a)},Opacity:function(b,c){var a=this.readOgcExpression(b);if(a){c.opacity=a}},Size:function(b,c){var a=this.readOgcExpression(b);if(a){c.size=a}},Rotation:function(b,c){var a=this.readOgcExpression(b);if(a){c.rotation=a}},OnlineResource:function(a,b){b.href=this.getAttributeNS(a,this.namespaces.xlink,"href")},Format:function(a,b){b.graphicFormat=this.getChildValue(a)}}},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(a){var d,c;for(var b in this.graphicFormats){if(this.graphicFormats[b].test(a)){d=b;break}}return d||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(e){var b=this.createElementNSPlus("StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});if(e.name){this.writeNode("Name",e.name,b)}if(e.title){this.writeNode("Title",e.title,b)}if(e.description){this.writeNode("Abstract",e.description,b)}if(e.namedLayers instanceof Array){for(var d=0,a=e.namedLayers.length;d<a;++d){this.writeNode("NamedLayer",e.namedLayers[d],b)}}else{for(var c in e.namedLayers){this.writeNode("NamedLayer",e.namedLayers[c],b)}}return b},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(c){var d=this.createElementNSPlus("NamedLayer");this.writeNode("Name",c.name,d);if(c.namedStyles){for(var b=0,a=c.namedStyles.length;b<a;++b){this.writeNode("NamedStyle",c.namedStyles[b],d)}}if(c.userStyles){for(var b=0,a=c.userStyles.length;b<a;++b){this.writeNode("UserStyle",c.userStyles[b],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(c){var d=this.createElementNSPlus("FeatureTypeStyle");for(var b=0,a=c.rules.length;b<a;++b){this.writeNode("Rule",c.rules[b],d)}return d},Rule:function(g){var f=this.createElementNSPlus("Rule");if(g.name){this.writeNode("Name",g.name,f)}if(g.title){this.writeNode("Title",g.title,f)}if(g.description){this.writeNode("Abstract",g.description,f)}if(g.elseFilter){this.writeNode("ElseFilter",null,f)}else{if(g.filter){this.writeNode("ogc:Filter",g.filter,f)}}if(g.minScaleDenominator!=undefined){this.writeNode("MinScaleDenominator",g.minScaleDenominator,f)}if(g.maxScaleDenominator!=undefined){this.writeNode("MaxScaleDenominator",g.maxScaleDenominator,f)}var c=OpenLayers.Style.SYMBOLIZER_PREFIXES;var e,d;for(var b=0,a=c.length;b<a;++b){e=c[b];d=g.symbolizer[e];if(d){this.writeNode(e+"Symbolizer",d,f)}}return f},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 f=this.createElementNSPlus("Label");var g=b.split("${");f.appendChild(this.createTextNode(g[0]));var e,d;for(var c=1,a=g.length;c<a;c++){e=g[c];d=e.indexOf("}");if(d>0){this.writeNode("ogc:PropertyName",{property:e.substring(0,d)},f);f.appendChild(this.createTextNode(e.substring(++d)))}else{f.appendChild(this.createTextNode("${"+e))}}return f},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 b=this.createElementNSPlus("ExternalGraphic");this.writeNode("OnlineResource",a.externalGraphic,b);var c=a.graphicFormat||this.getGraphicFormat(a.externalGraphic);this.writeNode("Format",c,b);return b},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(a,b){b.insertIds=[];b.success=false;this.readChildNodes(a,b)},InsertResult:function(b,a){var c={fids:[]};this.readChildNodes(b,c);a.insertIds.push(c.fids[0])},TransactionResult:function(a,b){this.readChildNodes(a,b)},Status:function(a,b){this.readChildNodes(a,b)},SUCCESS:function(a,b){b.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(b){b=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},b);var d=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b.featureNS?b.featurePrefix+":":"")+b.featureType}});if(b.featureNS){d.setAttribute("xmlns:"+b.featurePrefix,b.featureNS)}if(b.propertyNames){for(var c=0,a=b.propertyNames.length;c<a;c++){this.writeNode("ogc:PropertyName",{property:b.propertyNames[c]},d)}}if(b.filter){this.setFilterProperty(b.filter);this.writeNode("ogc:Filter",b.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(a,b){b.insertIds=[];b.success=false;this.readChildNodes(a,b)},TransactionSummary:function(a,b){b.success=true},InsertResults:function(a,b){this.readChildNodes(a,b)},Feature:function(b,a){var c={fids:[]};this.readChildNodes(b,c);a.insertIds.push(c.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(b){b=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},b);var d=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b.featureNS?b.featurePrefix+":":"")+b.featureType,srsName:b.srsName}});if(b.featureNS){d.setAttribute("xmlns:"+b.featurePrefix,b.featureNS)}if(b.propertyNames){for(var c=0,a=b.propertyNames.length;c<a;c++){this.writeNode("wfs:PropertyName",{property:b.propertyNames[c]},d)}}if(b.filter){this.setFilterProperty(b.filter);this.writeNode("ogc:Filter",b.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"});
