var OpenLayers={singleFile:true};(function(){var k=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!k)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var s="";var w=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var p=document.getElementsByTagName("script");for(var r=0,h=p.length;r<h;r++){var u=p[r].getAttribute("src");if(u){var q=u.match(w);if(q){s=q[1];break}}}return s}};if(!k){var l=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/ArcGIS93Rest.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/ArcIMS.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/XYZ.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/Snapping.js","OpenLayers/Control/Split.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Control/WMSGetFeatureInfo.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/Vector/RootContainer.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Strategy/Save.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Protocol/WFS.js","OpenLayers/Protocol/WFS/v1.js","OpenLayers/Protocol/WFS/v1_0_0.js","OpenLayers/Protocol/WFS/v1_1_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/ArcXML.js","OpenLayers/Format/ArcXML/Features.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WFSCapabilities.js","OpenLayers/Format/WFSCapabilities/v1.js","OpenLayers/Format/WFSCapabilities/v1_0_0.js","OpenLayers/Format/WFSCapabilities/v1_1_0.js","OpenLayers/Format/WFSDescribeFeatureType.js","OpenLayers/Format/WMSDescribeLayer.js","OpenLayers/Format/WMSDescribeLayer/v1_1.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Filter/v1_1_0.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/WFST.js","OpenLayers/Format/WFST/v1.js","OpenLayers/Format/WFST/v1_0_0.js","OpenLayers/Format/WFST/v1_1_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Format/WMSCapabilities.js","OpenLayers/Format/WMSCapabilities/v1_1.js","OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/GetFeature.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var b=navigator.userAgent;var e=(b.match("MSIE")||b.match("Safari"));if(e){var a=new Array(l.length)}var m=OpenLayers._getScriptLocation()+"lib/";for(var c=0,g=l.length;c<g;c++){if(e){a[c]="<script src='"+m+l[c]+"'><\/script>"}else{var o=document.createElement("script");o.src=m+l[c];var f=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;f.appendChild(o)}}if(e){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(g){var e=g.split("-");var b=e[0];for(var c=1,a=e.length;c<a;c++){var f=e[c];b+=f.charAt(0).toUpperCase()+f.substring(1)}return b},format:function(e,c,a){if(!c){c=window}var b=function(l,f){var k;var h=f.split(/\.+/);for(var g=0;g<h.length;g++){if(g==0){k=c}k=k[h[g]]}if(typeof k=="function"){k=a?k.apply(null,a):k()}if(typeof k=="undefined"){return"undefined"}else{return k}};return e.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,h,l){a=(typeof a!="undefined")?a:0;h=(typeof h!="undefined")?h:OpenLayers.Number.thousandsSeparator;l=(typeof l!="undefined")?l: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 e=b[0];if(h){var f=/(-?[0-9]+)([0-9]{3})/;while(f.test(e)){e=e.replace(f,"$1"+h+"$2")}}var g;if(a==0){g=e}else{var k=b.length>1?b[1]:"0";if(a!=null){k=k+new Array(a-k.length+1).join("0")}g=e+l+k}return g}};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 e=a.concat(Array.prototype.slice.apply(arguments,[0]));return c.apply(b,e)}},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(h,g,b){var e=[];if(Array.prototype.filter){e=h.filter(g,b)}else{var a=h.length;if(typeof g!="function"){throw new TypeError()}for(var c=0;c<a;c++){if(c in h){var f=h[c];if(g.call(b,f,c,h)){e.push(f)}}}}return e}};OpenLayers.Class=function(){var e=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var c={};var g,b;for(var f=0,a=arguments.length;f<a;++f){if(typeof arguments[f]=="function"){if(f==0&&a>1){b=arguments[f].prototype.initialize;arguments[f].prototype.initialize=function(){};c=new arguments[f];if(b===undefined){delete arguments[f].prototype.initialize}else{arguments[f].prototype.initialize=b}}g=arguments[f].prototype}else{g=arguments[f]}OpenLayers.Util.extend(c,g)}e.prototype=c;return e};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 e=arguments[0];var f=new e(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(f,arguments[c])}return f};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var e=[];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}e.push(b)}return e};if($==null){var $=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(a,f){a=a||{};if(f){for(var e in f){var c=f[e];if(c!==undefined){a[e]=c}}var b=typeof window.Event=="function"&&f instanceof window.Event;if(!b&&f.hasOwnProperty&&f.hasOwnProperty("toString")){a.toString=f.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(e,c){for(var b=0,a=e.length;b<a;b++){if(e[b]==c){return b}}return -1};OpenLayers.Util.modifyDOMElement=function(f,k,e,g,a,c,h,b){if(k){f.id=k}if(e){f.style.left=e.x+"px";f.style.top=e.y+"px"}if(g){f.style.width=g.w+"px";f.style.height=g.h+"px"}if(a){f.style.position=a}if(c){f.style.border=c}if(h){f.style.overflow=h}if(parseFloat(b)>=0&&parseFloat(b)<1){f.style.filter="alpha(opacity="+(b*100)+")";f.style.opacity=b}else{if(parseFloat(b)==1){f.style.filter="";f.style.opacity=""}}};OpenLayers.Util.createDiv=function(a,l,k,g,f,c,b,h){var e=document.createElement("div");if(g){e.style.backgroundImage="url("+g+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!f){f="absolute"}OpenLayers.Util.modifyDOMElement(e,a,l,k,f,c,b,h);return e};OpenLayers.Util.createImage=function(a,k,h,f,e,c,g,l){var b=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!e){e="relative"}OpenLayers.Util.modifyDOMElement(b,a,k,h,e,c,null,g);if(l){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(f){b.src=f}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 e=this.urls;if(e&&e instanceof Array&&e.length>1){var f=this.src.toString();var c,a;for(a=0;c=e[a];a++){if(f.indexOf(c)!=-1){break}}var g=Math.floor(e.length*Math.random());var b=e[g];a=0;while(b==c&&a++<4){g=Math.floor(e.length*Math.random());b=e[g]}this.src=f.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 f=navigator.appVersion.split("MSIE");var a=parseFloat(f[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,m,l,h,g,c,e,k){OpenLayers.Util.modifyDOMElement(a,b,m,l,g,null,null,k);var f=a.childNodes[0];if(h){f.src=h}OpenLayers.Util.modifyDOMElement(f,a.id+"_innerImage",null,l,"relative",c);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(e==null){e="scale"}a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f.src+"', sizingMethod='"+e+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}f.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(b,m,l,h,g,c,e,k,o){var a=OpenLayers.Util.createDiv();var f=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);a.appendChild(f);if(o){f.style.display="none";
OpenLayers.Event.observe(f,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,a));OpenLayers.Event.observe(f,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,a))}OpenLayers.Util.modifyAlphaImageDiv(a,b,m,l,h,g,c,e,k);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(e,c){e=e||{};var b=typeof window.Event=="function"&&c instanceof window.Event;for(var a in c){if(e[a]===undefined||(!b&&c.hasOwnProperty&&c.hasOwnProperty(a)&&!e.hasOwnProperty(a))){e[a]=c[a]}}if(!b&&c&&c.hasOwnProperty&&c.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")){e.toString=c.toString}return e};OpenLayers.Util.getParameterString=function(k){var h=[];for(var c in k){var f=k[c];if((f!=null)&&(typeof f!="function")){var b;if(typeof f=="object"&&f.constructor==Array){var g=[];for(var e=0,a=f.length;e<a;e++){g.push(encodeURIComponent(f[e]))}b=g.join(",")}else{b=encodeURIComponent(f)}h.push(encodeURIComponent(c)+"="+b)}}return h.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var f=null;for(var c=0,a=arguments.length;c<a;c++){var b=arguments[c];try{f=b();break}catch(g){}}return f};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,f){var b=[];for(var e=0,a=c.length;e<a;e++){if(c[e].nodeName==f){b.push(c[e])}}return b};OpenLayers.Util.getTagText=function(c,e,b){var a=OpenLayers.Util.getNodes(c,e);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 S=6378137,R=6356752.3142,N=1/298.257223563;var p=OpenLayers.Util.rad(c.lon-g.lon);var Q=Math.atan((1-N)*Math.tan(OpenLayers.Util.rad(g.lat)));var P=Math.atan((1-N)*Math.tan(OpenLayers.Util.rad(c.lat)));var o=Math.sin(Q),k=Math.cos(Q);var m=Math.sin(P),h=Math.cos(P);var w=p,q=2*Math.PI;var u=20;while(Math.abs(w-q)>1e-12&&--u>0){var I=Math.sin(w),e=Math.cos(w);var T=Math.sqrt((h*I)*(h*I)+(k*m-o*h*e)*(k*m-o*h*e));if(T==0){return 0}var K=o*m+k*h*e;var H=Math.atan2(T,K);var l=Math.asin(k*h*I/T);var M=Math.cos(l)*Math.cos(l);var r=K-2*o*m/M;var E=N/16*M*(4+N*(4-3*M));q=w;w=p+(1-E)*N*Math.sin(l)*(H+E*T*(r+E*K*(-1+2*r*r)))}if(u==0){return NaN}var D=M*(S*S-R*R)/(R*R);var G=1+D/16384*(4096+D*(-768+D*(320-175*D)));var F=D/1024*(256+D*(-128+D*(74-47*D)));var J=F*T*(r+F/4*(K*(-1+2*r*r)-F/6*r*(-3+4*T*T)*(-3+4*r*r)));var z=R*G*(H-J);var O=z.toFixed(3)/1000;return O};OpenLayers.Util.getParameters=function(b){b=b||window.location.href;var a="";if(OpenLayers.String.contains(b,"?")){var c=b.indexOf("?")+1;var f=OpenLayers.String.contains(b,"#")?b.indexOf("#"):b.length;a=b.substring(c,f)}var q={};var e=a.split(/[&;]/);for(var k=0,l=e.length;k<l;++k){var h=e[k].split("=");if(h[0]){var o=decodeURIComponent(h[0]);var m=h[1]||"";m=m.split(",");for(var g=0,p=m.length;g<p;g++){m[g]=decodeURIComponent(m[g])}if(m.length==1){m=m[0]}q[o]=m}}return q};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(e,a){if(a==null){a="degrees"}var c=OpenLayers.Util.normalizeScale(e);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(g){var a=0,f=0;var b=g;var h=g;while(b){if(b==document.body){if(OpenLayers.Element.getStyle(h,"position")=="absolute"){break}}a+=b.offsetTop||0;f+=b.offsetLeft||0;h=b;try{b=b.offsetParent}catch(c){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:b.id}));break}}b=g;while(b){a-=b.scrollTop||0;f-=b.scrollLeft||0;b=b.parentNode}return[f,a]};OpenLayers.Util.isEquivalentUrl=function(k,h,c){c=c||{};OpenLayers.Util.applyDefaults(c,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=OpenLayers.Util.createUrlObject(k,c);var a=OpenLayers.Util.createUrlObject(h,c);for(var e in b){if(c.test){OpenLayers.Console.userError(e+"\n1:"+b[e]+"\n2:"+a[e])}var g=b[e];var f=a[e];switch(e){case"args":break;case"host":case"port":case"protocol":if((g=="")||(f=="")){break}default:if((e!="args")&&(b[e]!=a[e])){return false}break}}for(var e in b.args){if(b.args[e]!=a.args[e]){return false}delete a.args[e]}for(var e in a.args){return false}return true};OpenLayers.Util.createUrlObject=function(g,e){e=e||{};var z={};if(e.ignoreCase){g=g.toLowerCase()}var B=document.createElement("a");B.href=g;z.host=B.host||window.location.host;var o=B.port;if(o.length<=0){var s=z.host.length-(o.length);z.host=z.host.substring(0,s)}z.protocol=B.protocol;z.port=((o=="80")&&(e.ignorePort80))?"":o;z.hash=(e.ignoreHash)?"":B.hash;var c=B.search;if(!c){var l=g.indexOf("?");c=(l!=-1)?g.substr(l):""}z.args=OpenLayers.Util.getParameters(c);if(((z.protocol=="file:")&&(g.indexOf("file:")!=-1))||((z.protocol!="file:")&&(z.host!=""))){z.pathname=B.pathname;var p=z.pathname.indexOf("?");if(p!=-1){z.pathname=z.pathname.substring(0,p)}}else{var m=OpenLayers.Util.removeTail(g);var w=0;do{var h=m.indexOf("../");if(h==0){w++;m=m.substr(3)}else{if(h>=0){var q=m.substr(0,h-1);var u=q.indexOf("/");q=(u!=-1)?q.substr(0,u+1):"";var A=m.substr(h+3);m=q+A}}}while(h!=-1);var f=document.createElement("a");var r=window.location.href;if(e.ignoreCase){r=r.toLowerCase()}f.href=r;z.protocol=f.protocol;var b=(f.pathname.indexOf("/")!=-1)?"/":"\\";var k=f.pathname.split(b);k.pop();while((w>0)&&(k.length>0)){k.pop();w--}m=k.join("/")+"/"+m;z.pathname=m}if((z.protocol=="file:")||(z.protocol=="")){z.host="localhost"}return z};OpenLayers.Util.removeTail=function(b){var c=null;var a=b.indexOf("?");var e=b.indexOf("#");if(a==-1){c=(e!=-1)?b.substr(0,e):b}else{c=(e!=-1)?b.substr(0,Math.min(a,e)):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(k,e,c){var b,f;var a=document.createElement("div");a.style.overflow="";a.style.position="absolute";a.style.left="-9999px";var l=(c&&c.containerElement)?c.containerElement:document.body;if(e){if(e.w){b=e.w;a.style.width=b+"px"}else{if(e.h){f=e.h;a.style.height=f+"px"}}}if(c&&c.displayClass){a.className=c.displayClass}var g=document.createElement("div");g.innerHTML=k;a.appendChild(g);l.appendChild(a);if(!b){b=parseInt(g.scrollWidth);a.style.width=b+"px"}if(!f){f=parseInt(g.scrollHeight)}a.removeChild(g);l.removeChild(a);return new OpenLayers.Size(b,f)};OpenLayers.Util.getScrollbarWidth=function(){var c=OpenLayers.Util._scrollbarWidth;if(c==null){var f=null;var e=null;var a=0;var b=0;f=document.createElement("div");f.style.position="absolute";f.style.top="-1000px";f.style.left="-1000px";f.style.width="100px";f.style.height="50px";f.style.overflow="hidden";e=document.createElement("div");e.style.width="100%";e.style.height="200px";f.appendChild(e);document.body.appendChild(f);a=e.offsetWidth;f.style.overflow="scroll";b=e.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(f,b){f=OpenLayers.Util.getElement(f);this._setOptions(b);var a=this.options.color;if(this.options.color=="fromElement"){a=this._background(f)}var c=this.options.bgColor;if(this.options.bgColor=="fromParent"){c=this._background(f.offsetParent)}this._roundCornersImpl(f,a,c)},changeColor:function(c,b){c.style.backgroundColor=b;var a=c.parentNode.getElementsByTagName("span");for(var e=0;e<a.length;e++){a[e].style.backgroundColor=b}},changeOpacity:function(c,g){var e=g;var a="alpha(opacity="+g*100+")";c.style.opacity=e;c.style.filter=a;var b=c.parentNode.getElementsByTagName("span");for(var f=0;f<b.length;f++){b[f].style.opacity=e;b[f].style.filter=a}},reRound:function(e,c){var b=e.parentNode.childNodes[0];var a=e.parentNode.childNodes[2];e.parentNode.removeChild(b);e.parentNode.removeChild(a);this.round(e.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(e,f){var b="1px solid "+this._borderColor(f);var a="border-left: "+b;var g="border-right: "+b;var c="style='"+a+";"+g+"'";e.innerHTML="<div "+c+">"+e.innerHTML+"</div>"},_roundTopCorners:function(c,a,f){var e=this._createCorner(f);for(var b=0;b<this.options.numSlices;b++){e.appendChild(this._createCornerSlice(a,f,b,"top"))}c.style.paddingTop=0;c.insertBefore(e,c.firstChild)},_roundBottomCorners:function(c,a,f){var e=this._createCorner(f);for(var b=(this.options.numSlices-1);b>=0;b--){e.appendChild(this._createCornerSlice(a,f,b,"bottom"))}c.style.paddingBottom=0;c.appendChild(e)},_createCorner:function(b){var a=document.createElement("div");a.style.backgroundColor=(this._isTransparent()?"transparent":b);return a},_createCornerSlice:function(c,e,h,a){var f=document.createElement("span");var b=f.style;b.backgroundColor=c;b.display="block";b.height="1px";b.overflow="hidden";b.fontSize="1px";var g=this._borderColor(c,e);if(this.options.border&&h==0){b.borderTopStyle="solid";b.borderTopWidth="1px";b.borderLeftWidth="0px";b.borderRightWidth="0px";b.borderBottomWidth="0px";b.height="0px";b.borderColor=g}else{if(g){b.borderColor=g;b.borderStyle="solid";b.borderWidth="0px 1px"}}if(!this.options.compact&&(h==(this.options.numSlices-1))){b.height="2px"}this._setMargin(f,h,a);this._setBorder(f,h,a);return f},_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(e,f,b){var c=this._marginSize(f);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.marginLeft=c+"px";e.style.marginRight="0px"}else{if(a=="right"){e.style.marginRight=c+"px";e.style.marginLeft="0px"}else{e.style.marginLeft=c+"px";e.style.marginRight=c+"px"}}},_setBorder:function(e,f,b){var c=this._borderSize(f);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.borderLeftWidth=c+"px";e.style.borderRightWidth="0px"}else{if(a=="right"){e.style.borderRightWidth=c+"px";e.style.borderLeftWidth="0px"}else{e.style.borderLeftWidth=c+"px";e.style.borderRightWidth=c+"px"}}if(this.options.border!=false){e.style.borderLeftWidth=c+"px";e.style.borderRightWidth=c+"px"}},_marginSize:function(f){if(this._isTransparent()){return 0}var e=[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[f]}else{if(this.options.compact){return c[f]}else{if(this.options.blend){return a[f]}else{return e[f]}}}},_borderSize:function(f){var e=[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[f]}else{if(this.options.blend){return b[f]}else{if(this.options.border){return c[f]}else{if(this._isTransparent()){return e[f]}}}}}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 e=OpenLayers.Element.visible(b)?"hide":"show";OpenLayers.Element[e](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 f=a.visibility;var c=a.position;a.visibility="hidden";a.position="absolute";a.display="";var g=b.clientWidth;var e=b.clientHeight;a.display="none";a.position=c;a.visibility=f;return{width:g,height:e}},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,e){c=OpenLayers.Util.getElement(c);var f=null;if(c&&c.style){f=c.style[OpenLayers.String.camelize(e)];if(!f){if(document.defaultView&&document.defaultView.getComputedStyle){var b=document.defaultView.getComputedStyle(c,null);f=b?b.getPropertyValue(e):null}else{if(c.currentStyle){f=c.currentStyle[OpenLayers.String.camelize(e)]}}}var a=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(a,e)!=-1)&&(OpenLayers.Element.getStyle(c,"position")=="static")){f="auto"}}return f=="auto"?null:f}};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,e,c){this.url=a;this.size=(b)?b:new OpenLayers.Size(20,20);this.offset=e?e:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=c;var f=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(f)},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(h,c,g,b,f,e){if(h==null){h=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
}this.id=h;this.lonlat=c;this.contentSize=(g!=null)?g: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 h=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(h,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(f){this.addCloseBox(e)}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 f=b.top+b.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;f+=this.padding.top+this.padding.bottom;if(this.closeDiv){var e=parseInt(this.closeDiv.style.width);a+=e+b.right}this.size.w+=a;this.size.h+=f;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 f="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"<div>";var k=(this.map)?this.map.layerContainerDiv:document.body;var l=OpenLayers.Util.getRenderedDimensions(f,null,{displayClass:this.displayClass,containerElement:k});var h=this.getSafeContentSize(l);var g=null;if(h.equals(l)){g=l}else{var b=new OpenLayers.Size();b.w=(h.w<l.w)?h.w:null;b.h=(h.h<l.h)?h.h:null;if(b.w&&b.h){g=h}else{var e=OpenLayers.Util.getRenderedDimensions(f,b,{displayClass:this.contentDisplayClass,containerElement:k});var c=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((c!="hidden")&&(e.equals(h))){var a=OpenLayers.Util.getScrollbarWidth();if(b.w){e.h+=a}else{e.w+=a}}g=this.getSafeContentSize(e)}}this.setSize(g)},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 g=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 f=0,a=b.length;f<a;f++){var c=b[f];if(c.width==0||c.height==0){var e={popup:this,img:c};c._onImgLoad=OpenLayers.Function.bind(g,e);OpenLayers.Event.observe(c,"load",c._onImgLoad)}}},getSafeContentSize:function(o){var e=o.clone();var l=this.getContentDivPadding();var m=l.left+l.right;var h=l.top+l.bottom;this.fixPadding();m+=this.padding.left+this.padding.right;h+=this.padding.top+this.padding.bottom;if(this.closeDiv){var c=parseInt(this.closeDiv.style.width);m+=c+l.right}if(this.minSize){e.w=Math.max(e.w,(this.minSize.w-m));e.h=Math.max(e.h,(this.minSize.h-h))}if(this.maxSize){e.w=Math.min(e.w,(this.maxSize.w-m));e.h=Math.min(e.h,(this.maxSize.h-h))}if(this.map&&this.map.size){var g=0,f=0;if(this.keepInMap&&!this.panMapIfOutOfView){var k=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":g=k.x;f=this.map.size.h-k.y;break;case"tl":g=this.map.size.w-k.x;f=this.map.size.h-k.y;break;case"bl":g=this.map.size.w-k.x;f=k.y;break;case"br":g=k.x;f=k.y;break;default:g=k.x;f=this.map.size.h-k.y;break}}var a=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-h-f;var b=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-m-g;e.w=Math.min(e.w,b);e.h=Math.min(e.h,a)}return e},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(f){this.hide();OpenLayers.Event.stop(f)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))},panIntoView:function(){var f=this.map.getSize();var e=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var c=e.clone();if(e.x<this.map.paddingForPopups.left){c.x=this.map.paddingForPopups.left}else{if((e.x+this.size.w)>(f.w-this.map.paddingForPopups.right)){c.x=f.w-this.map.paddingForPopups.right-this.size.w}}if(e.y<this.map.paddingForPopups.top){c.y=this.map.paddingForPopups.top}else{if((e.y+this.size.h)>(f.h-this.map.paddingForPopups.bottom)){c.y=f.h-this.map.paddingForPopups.bottom-this.size.h
}}var b=e.x-c.x;var a=e.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 e=this.drawGeometry(a.geometry,b,a.id);if(b.display!="none"&&b.label&&e!==false){this.drawText(a.id,b,a.geometry.getCentroid())}else{this.removeText(a.id)}return e}}},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(e){if(e.length==4){var b=e;var e="#";for(var c=1;c<4;c++){e+=(b.charAt(c)+b.charAt(c))}}if(e.indexOf("#")==0){e=e.substring(1)}var g=e.substring(0,2);var f=e.substring(2,4);var a=e.substring(4,6);return new OpenLayers.Rico.Color(parseInt(g,16),parseInt(f,16),parseInt(a,16))};OpenLayers.Rico.Color.createColorFromBackground=function(e){var b=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(e),"backgroundColor","background-color");if(b=="transparent"&&e.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(e.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(l,g,o){var c=0;var e=0;var r=0;if(g==0){c=parseInt(o*255+0.5);e=c;r=c}else{var k=(l-Math.floor(l))*6;var m=k-Math.floor(k);var b=o*(1-g);var a=o*(1-g*m);var s=o*(1-(g*(1-m)));switch(parseInt(k)){case 0:c=(o*255+0.5);e=(s*255+0.5);r=(b*255+0.5);break;case 1:c=(a*255+0.5);e=(o*255+0.5);r=(b*255+0.5);break;case 2:c=(b*255+0.5);e=(o*255+0.5);r=(s*255+0.5);break;case 3:c=(b*255+0.5);e=(a*255+0.5);r=(o*255+0.5);break;case 4:c=(s*255+0.5);e=(b*255+0.5);r=(o*255+0.5);break;case 5:c=(o*255+0.5);e=(b*255+0.5);r=(a*255+0.5);break}}return{r:parseInt(c),g:parseInt(e),b:parseInt(r)}};OpenLayers.Rico.Color.RGBtoHSB=function(a,h,p){var k;var f;var o;var q=(a>h)?a:h;if(p>q){q=p}var l=(a<h)?a:h;if(p<l){l=p}o=q/255;if(q!=0){f=(q-l)/q}else{f=0}if(f==0){k=0}else{var c=(q-a)/(q-l);var m=(q-h)/(q-l);var e=(q-p)/(q-l);if(a==q){k=e-m}else{if(h==q){k=2+c-e}else{k=4+m-c}}k=k/6;if(k<0){k=k+1}}return{h:k,s:f,b:o}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(e,a,b,c){if(e!=null){this.left=OpenLayers.Util.toFloat(e)}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(g,k){if(k==null){k=this.getCenterLonLat()}var a=[];var f,e;if(k.CLASS_NAME=="OpenLayers.LonLat"){f=k.lon;e=k.lat}else{f=k.x;e=k.y}var c=(this.left-f)*g+f;var b=(this.bottom-e)*g+e;var l=(this.right-f)*g+f;var h=(this.top-e)*g+e;return new OpenLayers.Bounds(c,b,l,h)},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,e,a){if(a==null){a=true}if(b==null||e==null){return false}b=OpenLayers.Util.toFloat(b);e=OpenLayers.Util.toFloat(e);var c=false;if(a){c=((b>=this.left)&&(b<=this.right)&&(e>=this.bottom)&&(e<=this.top))}else{c=((b>this.left)&&(b<this.right)&&(e>this.bottom)&&(e<this.top))}return c},intersectsBounds:function(f,b){if(b==null){b=true}var e=false;var k=(this.left==f.right||this.right==f.left||this.top==f.bottom||this.bottom==f.top);if(b||!k){var h=(((f.bottom>=this.bottom)&&(f.bottom<=this.top))||((this.bottom>=f.bottom)&&(this.bottom<=f.top)));var g=(((f.top>=this.bottom)&&(f.top<=this.top))||((this.top>f.bottom)&&(this.top<f.top)));var c=(((f.left>=this.left)&&(f.left<=this.right))||((this.left>=f.left)&&(this.left<=f.right)));var a=(((f.right>=this.left)&&(f.right<=this.right))||((this.right>=f.left)&&(this.right<=f.right)));e=((h||g)&&(c||a))}return e},containsBounds:function(h,b,a){if(b==null){b=false}if(a==null){a=true}var c=this.contains(h.left,h.bottom,a);var e=this.contains(h.right,h.bottom,a);var g=this.contains(h.left,h.top,a);var f=this.contains(h.right,h.top,a);return(b)?(c||e||g||f):(c&&e&&g&&f)},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(e,b){this.centerLonLat=null;var f=OpenLayers.Projection.transform({x:this.left,y:this.bottom},e,b);var a=OpenLayers.Projection.transform({x:this.right,y:this.bottom},e,b);var c=OpenLayers.Projection.transform({x:this.left,y:this.top},e,b);var g=OpenLayers.Projection.transform({x:this.right,y:this.top},e,b);this.left=Math.min(f.x,c.x);this.bottom=Math.min(f.y,a.y);this.right=Math.max(a.x,g.x);this.top=Math.max(c.y,g.y);return this},wrapDateLine:function(a,c){c=c||{};var e=c.leftTolerance||0;var b=c.rightTolerance||0;var f=this.clone();if(a){while(f.left<a.left&&(f.right-b)<=a.left){f=f.add(a.getWidth(),0)}while((f.left+e)>=a.right&&f.right>a.right){f=f.add(-a.getWidth(),0)}}return f},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 e;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"){e=c[0]}if(c[1]){var a=c[0]+"-"+c[1].toUpperCase();if(typeof OpenLayers.Lang[a]=="object"){e=a}}if(!e){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+c.join("-")+" dictionary, falling back to default language");e=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=e},translate:function(b,a){var e=OpenLayers.Lang[OpenLayers.Lang.getCode()];var c=e[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(k,e,h,c,b,g,f){var a=[k,e,h,c,g,f];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 e=this.calculateNewPx(c);var a=new Array(e);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 e=this.map.getLonLatFromLayerPx(b);var c=this.map.getExtent();var a=c.determineQuadrant(e);return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(b){var f=b.offset(this.anchor.offset);var a=this.size||this.contentSize;var e=(this.relativePosition.charAt(0)=="t");f.y+=(e)?-a.h:this.anchor.size.h;var c=(this.relativePosition.charAt(1)=="l");f.x+=(c)?-a.w:this.anchor.size.w;return f},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(e,c){var a,f;var h=e.params.LAYERS;var g=(h instanceof Array?h[0]:h).split(":");if(g.length>1){f=g[0]}a=g.pop();var b={url:e.url,featureType:a,featurePrefix:f,srsName:e.projection&&e.projection.getCode()||e.map&&e.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(e,c){var b=e.CLASS_NAME;if((b=="OpenLayers.Geometry.Collection")||(b=="OpenLayers.Geometry.MultiPoint")||(b=="OpenLayers.Geometry.MultiLineString")||(b=="OpenLayers.Geometry.MultiPolygon")){for(var a=0;a<e.components.length;a++){this.drawGeometry(e.components[a],c)}return}switch(e.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(e,c);break;case"OpenLayers.Geometry.LineString":this.drawLineString(e,c);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(e,c);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(e,c);break;default:break}},drawExternalGraphic:function(l,a){var f=new Image();f.src=a.externalGraphic;if(a.graphicTitle){f.title=a.graphicTitle}var c=a.graphicWidth||a.graphicHeight;var k=a.graphicHeight||a.graphicWidth;c=c?c:a.pointRadius*2;k=k?k:a.pointRadius*2;var h=(a.graphicXOffset!=undefined)?a.graphicXOffset:-(0.5*c);var e=(a.graphicYOffset!=undefined)?a.graphicYOffset:-(0.5*k);var g=a.graphicOpacity||a.fillOpacity;var b={img:f,x:(l[0]+h),y:(l[1]+e),width:c,height:k,canvas:this.canvas};f.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(e,b){if(b.stroke!==false){this.setCanvasStyle("stroke",b);this.canvas.beginPath();var f=this.getLocalXY(e.components[0]);this.canvas.moveTo(f[0],f[1]);for(var a=1;a<e.components.length;a++){var c=this.getLocalXY(e.components[a]);this.canvas.lineTo(c[0],c[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(f,c){if(c.fill!==false){this.setCanvasStyle("fill",c);this.canvas.beginPath();var g=this.getLocalXY(f.components[0]);this.canvas.moveTo(g[0],g[1]);for(var b=1;b<f.components.length-1;b++){var e=this.getLocalXY(f.components[b]);this.canvas.lineTo(e[0],e[1])}this.canvas.fill()}if(c.stroke!==false){var a=this.canvas.lineWidth;this.setCanvasStyle("stroke",c);this.canvas.beginPath();var g=this.getLocalXY(f.components[0]);this.canvas.moveTo(g[0],g[1]);for(var b=1;b<f.components.length;b++){var e=this.getLocalXY(f.components[b]);this.canvas.lineTo(e[0],e[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,e){e=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},e);var f=this.getLocalXY(b);this.setCanvasStyle("reset");this.canvas.fillStyle=e.fontColor;this.canvas.globalAlpha=1;var g=e.fontWeight+" "+e.fontSize+" "+e.fontFamily;if(this.canvas.fillText){var c=OpenLayers.Renderer.Canvas.LABEL_ALIGN[e.labelAlign[0]]||"middle";this.canvas.font=g;this.canvas.textAlign=c;this.canvas.fillText(e.label,f[0],f[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=g;var a=this.canvas.mozMeasureText(e.label);switch(e.labelAlign[0]){case"l":break;case"r":f[0]-=a;break;
case"c":default:f[0]-=a/2}this.canvas.translate(f[0],f[1]);this.canvas.mozDrawText(e.label);this.canvas.translate(-1*f[0],-1*f[1])}}this.setCanvasStyle("reset")},getLocalXY:function(b){var c=this.getResolution();var e=this.extent;var a=(b.x/c+(-e.left/c));var f=((e.top/c)-b.y/c);return[a,f]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(a){var g=this.map.getLonLatFromPixel(a.xy);var b=this.getResolution();var f=new OpenLayers.Bounds(g.lon-b*5,g.lat-b*5,g.lon+b*5,g.lat+b*5);var c=f.toGeometry();for(var e in this.features){if(!this.features.hasOwnProperty(e)){continue}if(this.features[e][0].geometry.intersects(c)){return e}}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 f=[];var b,c;for(var g in this.features){if(!this.features.hasOwnProperty(g)){continue}b=this.features[g][0];c=this.features[g][1];if(!b.geometry){continue}this.drawGeometry(b.geometry,c);if(c.label){f.push([b,c])}}var e;for(var a=0;len=f.length,a<len;++a){e=f[a];this.drawText(e[0].geometry.getCentroid(),e[1])}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right"};OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(a){this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(c){if(this.exists(c)){this.remove(c)}var g=c.id;this.determineZIndex(c);var e=-1;var f=this.order.length;var a;while(f-e>1){a=parseInt((e+f)/2);var b=this.compare(this,c,OpenLayers.Util.getElement(this.order[a]));if(b>0){e=a}else{f=a}}this.order.splice(f,0,g);this.indices[g]=this.getZIndex(c);return this.getNextElement(f)},remove:function(b){var e=b.id;var a=OpenLayers.Util.indexOf(this.order,e);if(a>=0){this.order.splice(a,1);delete this.indices[e];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(f,e,b){var a=f.getZIndex(e);var g=0;if(b){var c=f.getZIndex(b);g=a-c}return g},Z_ORDER_DRAWING_ORDER:function(c,b,a){var e=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(c,b,a);if(a&&e==0){e=1}return e},Z_ORDER_Y_ORDER:function(g,f,b){var h=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(g,f,b);if(b&&h==0){var c=f._geometry.getBounds().bottom;var e=b._geometry.getBounds().bottom;var a=e-c;h=(a==0)?1:a}return h}};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(h,e,g){var c=h.CLASS_NAME;var k=true;if((c=="OpenLayers.Geometry.Collection")||(c=="OpenLayers.Geometry.MultiPoint")||(c=="OpenLayers.Geometry.MultiLineString")||(c=="OpenLayers.Geometry.MultiPolygon")){for(var b=0,a=h.components.length;b<a;b++){k=this.drawGeometry(h.components[b],e,g)&&k}return k}k=false;if(e.display!="none"){if(e.backgroundGraphic){this.redrawBackgroundNode(h.id,h,e,g)}k=this.redrawNode(h.id,h,e,g)}if(k==false){var f=document.getElementById(h.id);if(f){if(f._style.backgroundGraphic){f.parentNode.removeChild(document.getElementById(h.id+this.BACKGROUND_ID_SUFFIX))}f.parentNode.removeChild(f)}}return k},redrawNode:function(h,g,b,f){var c=this.nodeFactory(h,this.getNodeType(g,b));c._featureId=f;c._geometry=g;c._geometryClass=g.CLASS_NAME;c._style=b;var a=this.drawGeometryNode(c,g,b);if(a===false){return false}c=a.node;if(this.indexer){var e=this.indexer.insert(c);if(e){this.vectorRoot.insertBefore(c,e)}else{this.vectorRoot.appendChild(c)}}else{if(c.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(c)}}this.postDraw(c);return a.complete},redrawBackgroundNode:function(f,e,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(f+this.BACKGROUND_ID_SUFFIX,e,a,null)},drawGeometryNode:function(c,f,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 e;switch(f.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.graphic===false){a.isFilled=false;a.isStroked=false}e=this.drawPoint(c,f);break;case"OpenLayers.Geometry.LineString":a.isFilled=false;e=this.drawLineString(c,f);break;case"OpenLayers.Geometry.LinearRing":e=this.drawLinearRing(c,f);break;case"OpenLayers.Geometry.Polygon":e=this.drawPolygon(c,f);break;case"OpenLayers.Geometry.Surface":e=this.drawSurface(c,f);break;case"OpenLayers.Geometry.Rectangle":e=this.drawRectangle(c,f);break;default:break}c._style=b;c._options=a;if(e!=false){return{node:this.setStyle(c,b,a,f),complete:e}}else{return false}},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},drawSurface:function(a,b){},removeText:function(b){var a=document.getElementById(b+this.LABEL_ID_SUFFIX);if(a){this.textRoot.removeChild(a)}},getFeatureIdFromEvent:function(a){var e=a.target;var b=e&&e.correspondingUseElement;var c=b?b:(e||a.srcElement);var f=c._featureId;return f},eraseGeometry:function(g){if((g.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(g.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(g.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(g.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var e=0,a=g.components.length;e<a;e++){this.eraseGeometry(g.components[e])}}else{var c=OpenLayers.Util.getElement(g.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=g.id+this.BACKGROUND_ID_SUFFIX;var f=OpenLayers.Util.getElement(b);
if(f&&f.parentNode){f.parentNode.removeChild(f)}}}}},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 k=[];var o,b,l;for(var f=0;f<this.features.length;++f){o=this.features[f];if(o.geometry){b=false;for(var e=0;e<k.length;++e){l=k[e];if(this.shouldCluster(l,o)){this.addToCluster(l,o);b=true;break}}if(!b){k.push(this.createCluster(this.features[f]))}}}this.layer.destroyFeatures();if(k.length>0){if(this.threshold>1){var h=k.slice();k=[];var m;for(var f=0,g=h.length;f<g;++f){m=h[f];if(m.attributes.count<this.threshold){Array.prototype.push.apply(k,m.cluster)}else{k.push(m)}}}this.clustering=true;this.layer.addFeatures(k);this.clustering=false}this.clusters=k}}},clustersExist:function(){var b=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){b=true;for(var a=0;a<this.clusters.length;++a){if(this.clusters[a]!=this.layer.features[a]){b=false;break}}}return b},shouldCluster:function(a,b){var f=a.geometry.getBounds().getCenterLonLat();var c=b.geometry.getBounds().getCenterLonLat();var e=(Math.sqrt(Math.pow((f.lon-c.lon),2)+Math.pow((f.lat-c.lat),2))/this.resolution);return(e<=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(h){this.layer.destroyFeatures();var f=h.features;if(f&&f.length>0){var g=this.layer.projection;var e=this.layer.map.getProjectionObject();if(!e.equals(g)){var c;for(var b=0,a=f.length;b<a;++b){c=f[b].geometry;if(c){c.transform(g,e)}}}this.layer.addFeatures(f)}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(f,c){var e=false;if(this.features){if(f>=0&&f<this.features.length){var a=Math.floor(f/this.length);if(a!=this.num){this.paging=true;var b=this.features.slice(f,f+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;e=true}}}return e},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{auto:false,timer:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),this.auto*1000)}else{this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){window.clearInterval(this.timer)}else{this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},triggerSave:function(b){var a=b.feature;if(a.state===OpenLayers.State.INSERT||a.state===OpenLayers.State.UPDATE||a.state===OpenLayers.State.DELETE){this.save([b.feature])}},save:function(e){if(!e){e=this.layer.features}var g=this.layer.projection;var c=this.layer.map.getProjectionObject();if(!c.equals(g)){var a=e.length;var f=new Array(a);var k,h;for(var b=0;b<a;++b){k=e[b];h=k.clone();h.fid=k.fid;h.state=k.state;h._original=k;h.geometry.transform(c,g);f[b]=h}e=f}this.layer.protocol.commit(e,{callback:this.onCommit,scope:this})},onCommit:function(e){if(e.success()){var b=e.reqFeatures;var a,l;var c=[];var k=e.insertIds||[];var f=0;for(var g=0,h=b.length;g<h;++g){l=b[g];l=l._original||l;a=l.state;if(a){if(a==OpenLayers.State.DELETE){c.push(l)}else{if(a==OpenLayers.State.INSERT){l.fid=k[f];++f}}l.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,e,a){this.playing=true;this.begin=c;this.finish=b;this.duration=e;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 h={};for(var e in this.begin){var a=this.begin[e];var g=this.finish[e];if(a==null||g==null||isNaN(a)||isNaN(g)){OpenLayers.Console.error("invalid value for Tween")}var k=g-a;h[e]=this.easing.apply(this,[this.time,a,k,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,h)}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(f){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var c=0,a=this.map.controls.length;c<a;c++){var e=this.map.controls[c];if((e!=this)&&(e.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(e.displayProjection!=this.displayProjection){this.displayProjection=e.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 e=0,a=this.layers.length;e<a;e++){var b=this.map.layers[e];var f=this.layers.charAt(e);if(f=="B"){this.map.setBaseLayer(b)}else{if((f=="T")||(f=="F")){b.setVisibility(f=="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 e=[];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()){e.push(b.attribution)}}this.div.innerHTML=e.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[]},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Event.stopObservingElement(this.minimizeDiv);OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.clearLayersArray("base");this.clearLayersArray("data");this.map.events.un({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl()}this.redraw();return this.div},clearLayersArray:function(e){var f=this[e+"Layers"];if(f){for(var c=0,a=f.length;c<a;c++){var b=f[c];OpenLayers.Event.stopObservingElement(b.inputElem);OpenLayers.Event.stopObservingElement(b.labelSpan)}}this[e+"LayersDiv"].innerHTML="";this[e+"Layers"]=[]},checkRedraw:function(){var f=false;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){f=true}else{for(var c=0,a=this.layerStates.length;c<a;c++){var e=this.layerStates[c];var b=this.map.layers[c];if((e.name!=b.name)||(e.inRange!=b.inRange)||(e.id!=b.id)||(e.visibility!=b.visibility)){f=true;break}}}return f},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var e=false;var p=false;var k=this.map.layers.length;this.layerStates=new Array(k);for(var g=0;g<k;g++){var h=this.map.layers[g];this.layerStates[g]={name:h.name,visibility:h.visibility,inRange:h.inRange,id:h.id}}var f=this.map.layers.slice();if(!this.ascending){f.reverse()}for(var g=0,k=f.length;g<k;g++){var h=f[g];var l=h.isBaseLayer;if(h.displayInLayerSwitcher){if(l){p=true}else{e=true}var o=(l)?(h==this.map.baseLayer):h.getVisibility();var m=document.createElement("input");m.id=this.id+"_input_"+h.name;m.name=(l)?"baseLayers":h.name;m.type=(l)?"radio":"checkbox";m.value=h.name;m.checked=o;m.defaultChecked=o;if(!l&&!h.inRange){m.disabled=true}var a={inputElem:m,layer:h,layerSwitcher:this};OpenLayers.Event.observe(m,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var b=document.createElement("span");if(!l&&!h.inRange){b.style.color="gray"}b.innerHTML=h.name;b.style.verticalAlign=(l)?"bottom":"baseline";OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var r=document.createElement("br");var q=(l)?this.baseLayers:this.dataLayers;q.push({layer:h,inputElem:m,labelSpan:b});var c=(l)?this.baseLayersDiv:this.dataLayersDiv;c.appendChild(m);c.appendChild(b);c.appendChild(r)}}this.dataLbl.style.display=(e)?"":"none";this.baseLbl.style.display=(p)?"":"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(f){this.mousePosition=f.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var e=Math.abs(this.mouseDragStart.x-f.xy.x);var b=Math.abs(this.mouseDragStart.y-f.xy.y);this.zoomBox.style.width=Math.max(1,e)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(f.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=f.xy.x+"px"}if(f.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=f.xy.y+"px"}}else{var e=this.mouseDragStart.x-f.xy.x;var b=this.mouseDragStart.y-f.xy.y;var g=this.map.getSize();var a=new OpenLayers.Pixel(g.w/2+e,g.h/2+b);var c=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(c,null,true);this.mouseDragStart=f.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 k=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var a=this.map.getLonLatFromViewPortPx(b.xy);var h=Math.max(k.lat,a.lat);var c=Math.min(k.lat,a.lat);var g=Math.min(k.lon,a.lon);var e=Math.max(k.lon,a.lon);var f=new OpenLayers.Bounds(g,c,e,h);this.map.zoomToExtent(f)}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 f=0;if(!c){c=window.event}if(c.wheelDelta){f=c.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){f=-f}}else{if(c.detail){f=-c.detail/3}}if(f){c.xy=this.mousePosition;if(f<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,e,l,h){var g=OpenLayers.Util.getImagesLocation()+e;var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,l,h,g,"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 f=function(){return c}}else{var k=this.slideRatio;var f=function(m){return this.map.getSize()[m]*k}}b.getSlideFactor=f;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 e=0,a=b.length;e<a;e++){var c=document.createElement("div");var f=document.createTextNode(" ");b[e].panel_div=c;if(b[e].title!=""){b[e].panel_div.title=b[e].title}OpenLayers.Event.observe(b[e].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,b[e]));OpenLayers.Event.observe(b[e].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var e=0,a=b.length;e<a;e++){this.map.addControl(b[e]);b[e].deactivate();b[e].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 e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this.controls,function(f){return f[c]==a||(e&&a.test(f[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 e=parseInt(Math.log(b)/Math.log(10));var a=Math.pow(10,e);var c=parseInt(b/a);var f;if(c>5){f=5}else{if(c>2){f=2}else{f=1}}return f*a},update:function(){var k=this.map.getResolution();if(!k){return}var p=this.map.getUnits();var c=OpenLayers.INCHES_PER_UNIT;var l=this.maxWidth*k*c[p];var a;var e;if(l>100000){a=this.topOutUnits;e=this.bottomOutUnits}else{a=this.topInUnits;e=this.bottomInUnits}var g=l/c[a];var m=l/c[e];var h=this.getBarLen(g);var f=this.getBarLen(m);g=h/c[p]*c[a];m=f/c[p]*c[e];var b=g/k;var o=m/k;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(o)+"px";this.eBottom.innerHTML=f+" "+e}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(b)+"px";this.eTop.innerHTML=h+" "+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,e,c,a){var f=OpenLayers.Util.getElement(b);a=a||false;if(e=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||f.attachEvent)){e="keydown"}if(!this.observers){this.observers={}}if(!f._eventCacheID){var g="eventCacheID_";if(f.id){g=f.id+"_"+g}f._eventCacheID=OpenLayers.Util.createUniqueID(g)}var h=f._eventCacheID;if(!this.observers[h]){this.observers[h]=[]}this.observers[h].push({element:f,name:e,observer:c,useCapture:a});if(f.addEventListener){f.addEventListener(e,c,a)}else{if(f.attachEvent){f.attachEvent("on"+e,c)}}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var c=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[c])},_removeElementObservers:function(f){if(f){for(var b=f.length-1;b>=0;b--){var c=f[b];var a=new Array(c.element,c.name,c.observer,c.useCapture);var e=OpenLayers.Event.stopObserving.apply(this,a)}}},stopObserving:function(k,a,h,b){b=b||false;var g=OpenLayers.Util.getElement(k);var e=g._eventCacheID;if(a=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||g.detachEvent){a="keydown"}}var m=false;var c=OpenLayers.Event.observers[e];if(c){var f=0;while(!m&&f<c.length){var l=c[f];if((l.name==a)&&(l.observer==h)&&(l.useCapture==b)){c.splice(f,1);if(c.length==0){delete OpenLayers.Event.observers[e]}m=true;break}f++}}if(m){if(g.removeEventListener){g.removeEventListener(a,h,b)}else{if(g&&g.detachEvent){g.detachEvent("on"+a,h)}}}return m},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);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,initialize:function(c,f,h,g,b){OpenLayers.Util.extend(this,b);this.object=c;this.fallThrough=g;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.eventTypes=[];if(h!=null){for(var e=0,a=h.length;e<a;e++){this.addEventType(h[e])}}if(f!=null){this.attachToElement(f)}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}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(e){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=e;for(var c=0,a=this.BROWSER_EVENTS.length;c<a;c++){var b=this.BROWSER_EVENTS[c];this.addEventType(b);OpenLayers.Event.observe(e,b,this.eventHandler)}OpenLayers.Event.observe(e,"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,e,c){if((c!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,b)!=-1)){if(e==null){e=this.object}var a=this.listeners[b];a.push({obj:e,func:c})}},registerPriority:function(b,e,c){if(c!=null){if(e==null){e=this.object}var a=this.listeners[b];if(a!=null){a.unshift({obj:e,func:c})}}},un:function(a){for(var b in a){if(b!="scope"){this.unregister(b,a.scope,a[b])}}},unregister:function(e,g,f){if(g==null){g=this.object}var c=this.listeners[e];if(c!=null){for(var b=0,a=c.length;b<a;b++){if(c[b].obj==g&&c[b].func==f){c.splice(b,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(f,b){var e=this.listeners[f];if(!e||e.length==0){return}if(b==null){b={}}b.object=this.object;b.element=this.element;if(!b.type){b.type=f}var e=e.slice(),g;for(var c=0,a=e.length;c<a;c++){var h=e[c];g=h.func.apply(h.obj,[b]);if((g!=undefined)&&(g==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(b,true)}return g},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",OpenLayers.Function.bind(this.clearMouseCache,this));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.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(h,c,g,b,a,f,e){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(h,c,g,b,a,f,e){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePosition){this.updateRelativePosition();
this.calculateRelativePosition=function(k){return this.relativePosition}}this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(f){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 g=null;for(var f in this.positionBlocks){g=f;break}var a=this.positionBlocks[g];for(var e=0;e<a.blocks.length;e++){var k={};this.blocks.push(k);var b=this.id+"_FrameDecorationDiv_"+e;k.div=OpenLayers.Util.createDiv(b,null,null,null,"absolute",null,"hidden",null);var c=this.id+"_FrameDecorationImg_"+e;var h=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;k.image=h(c,null,this.imageSize,this.imageSrc,"absolute",null,null,null);k.div.appendChild(k.image);this.groupDiv.appendChild(k.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var m=this.positionBlocks[this.relativePosition];for(var g=0;g<m.blocks.length;g++){var c=m.blocks[g];var f=this.blocks[g];var e=c.anchor.left;var o=c.anchor.bottom;var a=c.anchor.right;var q=c.anchor.top;var p=(isNaN(c.size.w))?this.size.w-(a+e):c.size.w;var k=(isNaN(c.size.h))?this.size.h-(o+q):c.size.h;f.div.style.width=(p<0?0:p)+"px";f.div.style.height=(k<0?0:k)+"px";f.div.style.left=(e!=null)?e+"px":"";f.div.style.bottom=(o!=null)?o+"px":"";f.div.style.right=(a!=null)?a+"px":"";f.div.style.top=(q!=null)?q+"px":"";f.image.style.left=c.position.x+"px";f.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,e){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 e=c.responseXML;if(!e||!e.documentElement){e=c.responseText}var f=this.format.read(e)||{};a.insertIds=f.insertIds||[];a.code=(f.success)?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},filterDelete:function(f,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 e=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(c.featureNS?this.featurePrefix+":":"")+c.featureType}});if(c.featureNS){e.setAttribute("xmlns:"+this.featurePrefix,c.featureNS)}var h=this.format.writeNode("ogc:Filter",f);e.appendChild(h);a.appendChild(e);var g=OpenLayers.Format.XML.prototype.write.apply(this.format,[a]);return OpenLayers.Request.POST({url:this.url,callback:c.callback||function(){},data:g})},abort:function(a){if(a){a.priv.abort()}},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},isGecko:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.isGecko=(navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var a="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(a+"SVG","1.1")||document.implementation.hasFeature(a+"BasicStructure","1.1")))},inValidRange:function(a,f,b){var e=a+(b?0:this.translationParameters.x);var c=f+(b?0:this.translationParameters.y);
return(e>=-this.MAX_PIXEL&&e<=this.MAX_PIXEL&&c>=-this.MAX_PIXEL&&c<=this.MAX_PIXEL)},setExtent:function(b,e){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var g=-b.left/a;var f=b.top/a;if(e){this.left=g;this.top=f;var c="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",c);this.translate(0,0);return true}else{var h=this.translate(g-this.left,f-this.top);if(!h){this.setExtent(b,true)}return h}},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(g,c,w){c=c||g._style;w=w||g._options;var a=parseFloat(g.getAttributeNS(null,"r"));var o=1;var p;if(g._geometryClass=="OpenLayers.Geometry.Point"&&a){g.style.visibility="";if(c.graphic===false){g.style.visibility="hidden"}else{if(c.externalGraphic){p=this.getPosition(g);if(c.graphicTitle){g.setAttributeNS(null,"title",c.graphicTitle)}if(c.graphicWidth&&c.graphicHeight){g.setAttributeNS(null,"preserveAspectRatio","none")}var f=c.graphicWidth||c.graphicHeight;var q=c.graphicHeight||c.graphicWidth;f=f?f:c.pointRadius*2;q=q?q:c.pointRadius*2;var m=(c.graphicXOffset!=undefined)?c.graphicXOffset:-(0.5*f);var h=(c.graphicYOffset!=undefined)?c.graphicYOffset:-(0.5*q);var l=c.graphicOpacity||c.fillOpacity;g.setAttributeNS(null,"x",(p.x+m).toFixed());g.setAttributeNS(null,"y",(p.y+h).toFixed());g.setAttributeNS(null,"width",f);g.setAttributeNS(null,"height",q);g.setAttributeNS(this.xlinkns,"href",c.externalGraphic);g.setAttributeNS(null,"style","opacity: "+l)}else{if(this.isComplexSymbol(c.graphicName)){var k=c.pointRadius*3;var u=k*2;var e=this.importSymbol(c.graphicName);var b="#"+e;p=this.getPosition(g);o=this.symbolSize[e]/u;if(g.getAttributeNS(this.xlinkns,"href")!=b){g.setAttributeNS(this.xlinkns,"href",b)}else{if(u!=parseFloat(g.getAttributeNS(null,"width"))){g.style.visibility="hidden";this.container.scrollLeft=this.container.scrollLeft}}g.setAttributeNS(null,"width",u);g.setAttributeNS(null,"height",u);g.setAttributeNS(null,"x",p.x-k);g.setAttributeNS(null,"y",p.y-k);g.style.visibility=""}else{g.setAttributeNS(null,"r",c.pointRadius)}}}if(typeof c.rotation!="undefined"&&p){var s=OpenLayers.String.format("rotate(${0} ${1} ${2})",[c.rotation,p.x,p.y]);g.setAttributeNS(null,"transform",s)}}if(w.isFilled){g.setAttributeNS(null,"fill",c.fillColor);g.setAttributeNS(null,"fill-opacity",c.fillOpacity)}else{g.setAttributeNS(null,"fill","none")}if(w.isStroked){g.setAttributeNS(null,"stroke",c.strokeColor);g.setAttributeNS(null,"stroke-opacity",c.strokeOpacity);g.setAttributeNS(null,"stroke-width",c.strokeWidth*o);g.setAttributeNS(null,"stroke-linecap",c.strokeLinecap);g.setAttributeNS(null,"stroke-linejoin","round");g.setAttributeNS(null,"stroke-dasharray",this.dashStyle(c,o))}else{g.setAttributeNS(null,"stroke","none")}if(c.pointerEvents){g.setAttributeNS(null,"pointer-events",c.pointerEvents)}if(c.cursor!=null){g.setAttributeNS(null,"cursor",c.cursor)}return g},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(e,f,b){var c=this.getResolution();var a=(f.x/c+this.left);var g=(this.top-f.y/c);if(this.inValidRange(a,g)){e.setAttributeNS(null,"cx",a);e.setAttributeNS(null,"cy",g);e.setAttributeNS(null,"r",b);return e}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,e){var b=this.getResolution();var a=(e.x/b+this.left);var f=(this.top-e.y/b);if(this.inValidRange(a,f)){c.setAttributeNS(null,"x",a);c.setAttributeNS(null,"y",f);c.setAttributeNS(null,"width",e.width/b);c.setAttributeNS(null,"height",e.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,l){var b=this.getResolution();var k=(l.x/b+this.left);var f=(l.y/b-this.top);var h=this.nodeFactory(c+this.LABEL_ID_SUFFIX,"text");var g=this.nodeFactory(c+this.LABEL_ID_SUFFIX+"_tspan","tspan");h.setAttributeNS(null,"x",k);h.setAttributeNS(null,"y",-f);h.setAttributeNS(null,"pointer-events","none");if(a.fontColor){h.setAttributeNS(null,"fill",a.fontColor)}if(a.fontFamily){h.setAttributeNS(null,"font-family",a.fontFamily)}if(a.fontSize){h.setAttributeNS(null,"font-size",a.fontSize)}if(a.fontWeight){h.setAttributeNS(null,"font-weight",a.fontWeight)}var e=a.labelAlign||"cm";h.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[0]]||"middle");if(this.isGecko){h.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[1]]||"central")}else{g.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[e[1]]||"-35%")}g.textContent=a.label;if(!h.parentNode){h.appendChild(g);this.textRoot.appendChild(h)}},getComponentsString:function(f,e){var h=[];var a=true;var g=f.length;var m=[];var k,l,b;for(var c=0;c<g;c++){l=f[c];h.push(l);k=this.getShortString(l);if(k){m.push(k)}else{if(c>0){if(this.getShortString(f[c-1])){m.push(this.clipLine(f[c],f[c-1]))}}if(c<g-1){if(this.getShortString(f[c+1])){m.push(this.clipLine(f[c],f[c+1]))}}a=false}}return{path:m.join(e||","),complete:a}},clipLine:function(f,l){if(l.equals(f)){return""}var g=this.getResolution();var b=this.MAX_PIXEL-this.translationParameters.x;var a=this.MAX_PIXEL-this.translationParameters.y;var e=l.x/g+this.left;var o=this.top-l.y/g;var c=f.x/g+this.left;var m=this.top-f.y/g;var h;if(c<-b||c>b){h=(m-o)/(c-e);c=c<0?-b:b;m=o+(c-e)*h}if(m<-a||m>a){h=(c-e)/(m-o);
m=m<0?-a:a;c=e+(m-o)*h}return c+","+m},getShortString:function(b){var c=this.getResolution();var a=(b.x/c+this.left);var e=(this.top-b.y/c);if(this.inValidRange(a,e)){return a+","+e}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(f){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+f;if(document.getElementById(b)!=null){return b}var e=OpenLayers.Renderer.symbol[f];if(!e){throw new Error(f+" is not a valid symbol name");return}var h=this.nodeFactory(b,"symbol");var c=this.nodeFactory(null,"polygon");h.appendChild(c);var p=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var m="";var l,k;for(var g=0;g<e.length;g=g+2){l=e[g];k=e[g+1];p.left=Math.min(p.left,l);p.bottom=Math.min(p.bottom,k);p.right=Math.max(p.right,l);p.top=Math.max(p.top,k);m+=" "+l+","+k}c.setAttributeNS(null,"points",m);var a=p.getWidth();var o=p.getHeight();var q=[p.left-a,p.bottom-o,a*3,o*3];h.setAttributeNS(null,"viewBox",q.join(" "));this.symbolSize[b]=Math.max(a,o)*3;this.defs.appendChild(h);return h.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(l,a){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var c=this.getResolution();var b=l.left/c;var g=l.top/c-this.size.h;if(a){this.offset={x:b,y:g};b=0;g=0}else{b=b-this.offset.x;g=g-this.offset.y}var o=b+" "+g;this.root.setAttribute("coordorigin",o);var k=[this.root,this.vectorRoot,this.textRoot];var h;for(var e=0,f=k.length;e<f;++e){h=k[e];var m=this.size.w+" "+this.size.h;h.setAttribute("coordsize",m)}this.root.style.flip="y";return true},setSize:function(g){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var e=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var c=this.size.w+"px";var k=this.size.h+"px";var b;for(var f=0,a=e.length;f<a;++f){b=e[f];b.style.width=c;b.style.height=k}},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(e,b,u,o){b=b||e._style;u=u||e._options;var l=1;if(e._geometryClass=="OpenLayers.Geometry.Point"){if(b.externalGraphic){if(b.graphicTitle){e.title=b.graphicTitle}var c=b.graphicWidth||b.graphicHeight;var p=b.graphicHeight||b.graphicWidth;c=c?c:b.pointRadius*2;p=p?p:b.pointRadius*2;var g=this.getResolution();var k=(b.graphicXOffset!=undefined)?b.graphicXOffset:-(0.5*c);var f=(b.graphicYOffset!=undefined)?b.graphicYOffset:-(0.5*p);e.style.left=((o.x/g-this.offset.x)+k).toFixed();e.style.top=((o.y/g-this.offset.y)-(f+p)).toFixed();e.style.width=c+"px";e.style.height=p+"px";e.style.flip="y";b.fillColor="none";u.isStroked=false}else{if(this.isComplexSymbol(b.graphicName)){var a=this.importSymbol(b.graphicName);e.setAttribute("path",a.path);e.setAttribute("coordorigin",a.left+","+a.bottom);var s=a.size;e.setAttribute("coordsize",s+","+s);this.drawCircle(e,o,b.pointRadius);e.style.flip="y"}else{this.drawCircle(e,o,b.pointRadius)}}}if(u.isFilled){e.setAttribute("fillcolor",b.fillColor)}else{e.setAttribute("filled","false")}var m=e.getElementsByTagName("fill");var r=(m.length==0)?null:m[0];if(!u.isFilled){if(r){e.removeChild(r)}}else{if(!r){r=this.createNode("olv:fill",e.id+"_fill")}r.setAttribute("opacity",b.fillOpacity);if(e._geometryClass=="OpenLayers.Geometry.Point"&&b.externalGraphic){if(b.graphicOpacity){r.setAttribute("opacity",b.graphicOpacity)}r.setAttribute("src",b.externalGraphic);r.setAttribute("type","frame");if(!(b.graphicWidth&&b.graphicHeight)){r.aspect="atmost"}}if(r.parentNode!=e){e.appendChild(r)}}if(typeof b.rotation!="undefined"){if(b.externalGraphic){this.graphicRotate(e,k,f);r.setAttribute("opacity",0)}else{e.style.rotation=b.rotation}}if(u.isStroked){e.setAttribute("strokecolor",b.strokeColor);e.setAttribute("strokeweight",b.strokeWidth+"px")}else{e.setAttribute("stroked","false")}var h=e.getElementsByTagName("stroke");var q=(h.length==0)?null:h[0];if(!u.isStroked){if(q){e.removeChild(q)}}else{if(!q){q=this.createNode("olv:stroke",e.id+"_stroke");e.appendChild(q)}q.setAttribute("opacity",b.strokeOpacity);q.setAttribute("endcap",!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap);q.setAttribute("dashstyle",this.dashStyle(b))}if(b.cursor!="inherit"&&b.cursor!=null){e.style.cursor=b.cursor}return e},graphicRotate:function(r,z,g){var w=w||r._style;var e=r._options;var a,m;if(!(w.graphicWidth&&w.graphicHeight)){var A=new Image();A.onreadystatechange=OpenLayers.Function.bind(function(){if(A.readyState=="complete"||A.readyState=="interactive"){a=A.width/A.height;m=Math.max(w.pointRadius*2,w.graphicWidth||0,w.graphicHeight||0);z=z*a;w.graphicWidth=m*a;w.graphicHeight=m;this.graphicRotate(r,z,g)}},this);A.src=w.externalGraphic;return}else{m=Math.max(w.graphicWidth,w.graphicHeight);a=w.graphicWidth/w.graphicHeight}var q=Math.round(w.graphicWidth||m*a);var o=Math.round(w.graphicHeight||m);r.style.width=q+"px";r.style.height=o+"px";var p=document.getElementById(r.id+"_image");if(!p){p=this.createNode("olv:imagedata",r.id+"_image");r.appendChild(p)}p.style.width=q+"px";p.style.height=o+"px";p.src=w.externalGraphic;p.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var s=w.rotation*Math.PI/180;var k=Math.sin(s);var f=Math.cos(s);var h="progid:DXImageTransform.Microsoft.Matrix(M11="+f+",M12="+(-k)+",M21="+k+",M22="+f+",SizingMethod='auto expand')\n";var b=w.graphicOpacity||w.fillOpacity;if(b&&b!=1){h+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+b+")\n"}r.style.filter=h;var u=new OpenLayers.Geometry.Point(-z,-g);var c=new OpenLayers.Bounds(0,0,q,o).toGeometry();c.rotate(w.rotation,u);var l=c.getBounds();r.style.left=Math.round(parseInt(r.style.left)+l.left)+"px";r.style.top=Math.round(parseInt(r.style.top)-l.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,f){var e=f.getBounds();if(e){var a=this.getResolution();var c=new OpenLayers.Bounds((e.left/a-this.offset.x).toFixed(),(e.bottom/a-this.offset.y).toFixed(),(e.right/a-this.offset.x).toFixed(),(e.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 e=b;var a=e.indexOf(":");if(a!=-1){e=e.substr(a+1)}var f=c.nodeName;a=f.indexOf(":");if(a!=-1){f=f.substr(a+1)}return(e==f)},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(e,f,a){if(!isNaN(f.x)&&!isNaN(f.y)){var b=this.getResolution();e.style.left=((f.x/b-this.offset.x).toFixed()-a)+"px";e.style.top=((f.y/b-this.offset.y).toFixed()-a)+"px";var c=a*2;e.style.width=c+"px";e.style.height=c+"px";return e}return false},drawLineString:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(b,m,h){this.setNodeDimension(b,m);var c=this.getResolution();var a=m.components.length;var f=new Array(a);var k,o,l;for(var g=0;g<a;g++){k=m.components[g];o=(k.x/c-this.offset.x);l=(k.y/c-this.offset.y);f[g]=" "+o.toFixed()+","+l.toFixed()+" l "}var e=(h)?" x e":" e";b.path="m"+f.join("")+e;return b},drawPolygon:function(b,m){this.setNodeDimension(b,m);var c=this.getResolution();var p=[];var g,f,e,k,a,h,o,l;for(e=0,k=m.components.length;e<k;e++){g=m.components[e];p.push("m");for(f=0,a=g.components.length;f<a;f++){h=g.components[f];o=h.x/c-this.offset.x;l=h.y/c-this.offset.y;p.push(" "+o.toFixed()+","+l.toFixed());if(f==0){p.push(" l")}}p.push(" x ")}p.push("e");b.path=p.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(e,a,k){var h=this.nodeFactory(e+this.LABEL_ID_SUFFIX,"olv:rect");var g=this.nodeFactory(e+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var c=this.getResolution();h.style.left=(k.x/c-this.offset.x).toFixed()+"px";h.style.top=(k.y/c-this.offset.y).toFixed()+"px";h.style.flip="y";g.innerText=a.label;if(a.fillColor){g.style.color=a.fontColor}if(a.fontFamily){g.style.fontFamily=a.fontFamily}if(a.fontSize){g.style.fontSize=a.fontSize}if(a.fontWeight){g.style.fontWeight=a.fontWeight}g.style.whiteSpace="nowrap";g.inset="0px,0px,0px,0px";if(!h.parentNode){h.appendChild(g);this.textRoot.appendChild(h)}var f=a.labelAlign||"cm";var l=g.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[f.substr(0,1)]);var b=g.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[f.substr(1,1)]);h.style.left=parseInt(h.style.left)-l+"px";h.style.top=parseInt(h.style.top)+b+"px"},drawSurface:function(a,h){this.setNodeDimension(a,h);var b=this.getResolution();var l=[];var e,k,g;for(var c=0,f=h.components.length;c<f;c++){e=h.components[c];k=e.x/b-this.offset.x;g=e.y/b-this.offset.y;if((c%3)==0&&(c/3)==0){l.push("m")}else{if((c%3)==1){l.push(" c")}}l.push(" "+k+","+g)}l.push(" x e");a.path=l.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(e){var b=this.container.id+"-"+e;var a=this.symbolCache[b];if(a){return a}var c=OpenLayers.Renderer.symbol[e];if(!c){throw new Error(e+" is not a valid symbol name");return}var k=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var f=["m"];for(var g=0;g<c.length;g=g+2){x=c[g];y=c[g+1];k.left=Math.min(k.left,x);k.bottom=Math.min(k.bottom,y);k.right=Math.max(k.right,x);k.top=Math.max(k.top,y);f.push(x);f.push(y);if(g==0){f.push("l")}}f.push("x e");var l=f.join(" ");var h=(k.getWidth()-k.getHeight())/2;if(h>0){k.bottom=k.bottom-h;k.top=k.top+h}else{k.left=k.left-h;k.right=k.right+h}a={path:l,size:k.getWidth(),left:k.left,bottom:k.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(e,a,f,b,c){this.layer=e;this.position=a.clone();this.bounds=f.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 g=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(g);var e=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(e.lon>b.lon){if(e.lon<0){e.lon=-180-(e.lon+180)}else{b.lon=180+b.lon+180}}var f=new OpenLayers.Bounds(e.lon,b.lat,b.lon,e.lat);return f},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(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,f,e,l,h,k){var g=OpenLayers.Util.getImagesLocation()+f;var c=OpenLayers.Util.getImagesLocation()+e;var b=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+a,l,h,g,"absolute");this.div.appendChild(b);b.imgLocation=g;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=k;b.alt=k;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(f){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var e=Math.abs(this.mouseDragStart.x-f.xy.x);var b=Math.abs(this.mouseDragStart.y-f.xy.y);this.zoomBox.style.width=Math.max(1,e)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(f.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=f.xy.x+"px"}if(f.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=f.xy.y+"px"}break;default:var e=this.mouseDragStart.x-f.xy.x;var b=this.mouseDragStart.y-f.xy.y;var g=this.map.getSize();var a=new OpenLayers.Pixel(g.w/2+e,g.h/2+b);var c=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(c,null,true);this.mouseDragStart=f.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 e=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+e.w/2,b.y);var c=e.w;if(this.zoomWorldIcon){a=new OpenLayers.Pixel(b.x+e.w,b.y)}this._addButton("panup","north-mini.png",a,e);b.y=a.y+e.h;this._addButton("panleft","west-mini.png",b,e);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",b.add(e.w,0),e);c*=2}this._addButton("panright","east-mini.png",b.add(c,0),e);this._addButton("pandown","south-mini.png",a.add(0,e.h*2),e);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,e.h*3+5),e);a=this._addZoomBar(a.add(0,e.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",a,e);return this.div},_addZoomBar:function(a){var f=OpenLayers.Util.getImagesLocation();var h=this.id+"_"+this.map.id;var b=this.map.getNumZoomLevels()-1-this.map.getZoom();var c=OpenLayers.Util.createAlphaImageDiv(h,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),f+"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 e=new OpenLayers.Size();e.h=this.zoomStopHeight*this.map.getNumZoomLevels();e.w=this.zoomStopWidth;var g=null;if(OpenLayers.Util.alphaHack()){var h=this.id+"_"+this.map.id;g=OpenLayers.Util.createAlphaImageDiv(h,a,new OpenLayers.Size(e.w,this.zoomStopHeight),f+"zoombar.png","absolute",null,"crop");g.style.height=e.h+"px"}else{g=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,e,f+"zoombar.png")}this.zoombarDiv=g;this.divEvents=new OpenLayers.Events(this,g,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(g);this.startTop=parseInt(g.style.top);this.div.appendChild(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 f=a.xy.y;var e=OpenLayers.Util.pagePosition(a.object)[1];var c=(f-e)/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 e=OpenLayers.Util.pagePosition(this.zoombarDiv);if((b.clientY-e[1])>0&&(b.clientY-e[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(e){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,m,f){a=a||this.map.getCenter();var e=OpenLayers.Util.getParameters(this.base);if(a){e.zoom=m||this.map.getZoom();var l=a.lat;var b=a.lon;if(this.displayProjection){var c=OpenLayers.Projection.transform({x:b,y:l},this.map.getProjectionObject(),this.displayProjection);b=c.x;l=c.y}e.lat=Math.round(l*100000)/100000;e.lon=Math.round(b*100000)/100000;f=f||this.map.layers;e.layers="";for(var g=0,k=f.length;g<k;g++){var h=f[g];if(h.isBaseLayer){e.layers+=(h==this.map.baseLayer)?"B":"0"}else{e.layers+=(h.getVisibility())?"T":"F"}}}return e},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);
this.addControls([new OpenLayers.Control.ZoomIn(),new OpenLayers.Control.ZoomToMaxExtent(),new OpenLayers.Control.ZoomOut()])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(json,filter){try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){var object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}if(this.keepData){this.data=object}return object}}catch(e){}return null},write:function(f,c){this.pretty=!!c;var a=null;var b=typeof f;if(this.serialize[b]){try{a=this.serialize[b].apply(this,[f])}catch(e){OpenLayers.Console.error("Trouble serializing: "+e)}}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 g=["{"];this.level+=1;var e,b,f;var a=false;for(e in c){if(c.hasOwnProperty(e)){b=OpenLayers.Format.JSON.prototype.write.apply(this,[e,this.pretty]);f=OpenLayers.Format.JSON.prototype.write.apply(this,[c[e],this.pretty]);if(b!=null&&f!=null){if(a){g.push(",")}g.push(this.writeNewline(),this.writeIndent(),b,":",this.writeSpace(),f);a=true}}}this.level-=1;g.push(this.writeNewline(),this.writeIndent(),"}");return g.join("")},array:function(f){var c;var e=["["];this.level+=1;for(var b=0,a=f.length;b<a;++b){c=OpenLayers.Format.JSON.prototype.write.apply(this,[f[b],this.pretty]);if(c!=null){if(b>0){e.push(",")}e.push(this.writeNewline(),this.writeIndent(),c)}}this.level-=1;e.push(this.writeNewline(),this.writeIndent(),"]");return e.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(f,e){var g=a[e];if(g){return g}g=e.charCodeAt();return"\\u00"+Math.floor(g/16).toString(16)+(g%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(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var b=this.version||c.getAttribute("version")||this.defaultVersion;if(!this.parser||this.parser.version!==b){var e=OpenLayers.Format.WMSCapabilities["v"+b.replace(/\./g,"_")];if(!e){throw"Can't find a WMS capabilities parser for version "+b}var g=new e(this.options)}var a=g.read(f);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 e;if(window.ActiveXObject&&!this.xmldom){e=new ActiveXObject("Microsoft.XMLDOM")}else{e=this.xmldom}e.loadXML(c);return e}),this),function(){return new DOMParser().parseFromString(c,"text/xml")},function(){var e=new XMLHttpRequest();e.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(c),false);if(e.overrideMimeType){e.overrideMimeType("text/xml")}e.send(null);return e.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 e=document.implementation.createDocument("","",null);if(e.importNode){b=e.importNode(b,true)}e.appendChild(b);c=a.serializeToString(e)}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(f,e,c){var a=[];if(f.getElementsByTagNameNS){a=f.getElementsByTagNameNS(e,c)}else{var b=f.getElementsByTagName("*");var l,g;for(var h=0,k=b.length;h<k;++h){l=b[h];g=(l.prefix)?(l.prefix+":"+c):c;if((c=="*")||(g==l.nodeName)){if((e=="*")||(e==l.namespaceURI)){a.push(l)}}}}return a},getAttributeNodeNS:function(c,b,a){var l=null;if(c.getAttributeNodeNS){l=c.getAttributeNodeNS(b,a)}else{var f=c.attributes;var k,e;for(var g=0,h=f.length;g<h;++g){k=f[g];if(k.namespaceURI==b){e=(k.prefix)?(k.prefix+":"+a):a;if(e==k.nodeName){l=k;break}}}}return l},getAttributeNS:function(f,e,a){var b="";if(f.getAttributeNS){b=f.getAttributeNS(e,a)||""}else{var c=this.getAttributeNodeNS(f,e,a);if(c){b=c.nodeValue}}return b},getChildValue:function(a,c){var b=c||"";if(a){for(var e=a.firstChild;e;e=e.nextSibling){switch(e.nodeType){case 3:case 4:b+=e.nodeValue}}}return b},concatChildValues:function(b,e){var c="";var f=b.firstChild;var a;while(f){a=f.nodeValue;if(a){c+=a}f=f.nextSibling}if(c==""&&e!=undefined){c=e}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 f=false,b=false;var a=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var e=c.firstChild;e;e=e.nextSibling){switch(e.nodeType){case 1:b=true;break;case 8:break;default:f=true}if(b&&f){break}}if(b&&f){a=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(b){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(f){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return a},hasAttributeNS:function(c,b,a){var e=false;if(c.hasAttributeNS){e=c.hasAttributeNS(b,a)}else{e=!!this.getAttributeNodeNS(c,b,a)}return e},setAttributeNS:function(e,c,a,f){if(e.setAttributeNS){e.setAttributeNS(c,a,f)}else{if(this.xmldom){if(c){var b=e.ownerDocument.createNode(2,a,c);b.nodeValue=f;e.setAttributeNode(b)}else{e.setAttribute(a,f)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(b,a){a=a||{};var e=a.uri||this.namespaces[a.prefix];if(!e){var g=b.indexOf(":");e=this.namespaces[b.substring(0,g)]}if(!e){e=this.namespaces[this.defaultPrefix]}var c=this.createElementNS(e,b);if(a.attributes){this.setAttributes(c,a.attributes)}var f=a.value;if(f!=null){if(typeof f=="boolean"){f=String(f)}c.appendChild(this.createTextNode(f))}return c},setAttributes:function(c,f){var e,b;
for(var a in f){if(f[a]!=null&&f[a].toString){e=f[a].toString();b=this.namespaces[a.substring(0,a.indexOf(":"))]||null;this.setAttributeNS(c,b,a,e)}}},readNode:function(c,f){if(!f){f={}}var e=this.readers[this.namespaceAlias[c.namespaceURI]];if(e){var b=c.localName||c.nodeName.split(":").pop();var a=e[b]||e["*"];if(a){a.apply(this,[c,f])}}return f},readChildNodes:function(e,f){if(!f){f={}}var c=e.childNodes;var g;for(var b=0,a=c.length;b<a;++b){g=c[b];if(g.nodeType==1){this.readNode(g,f)}}return f},writeNode:function(a,g,e){var f,c;var b=a.indexOf(":");if(b>0){f=a.substring(0,b);c=a.substring(b+1)}else{if(e){f=this.namespaceAlias[e.namespaceURI]}else{f=this.defaultPrefix}c=a}var h=this.writers[f][c].apply(this,[g]);if(e){e.appendChild(h)}return h},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(e,a,c){outer:for(var b=e;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(f,g){var e=null;if(f){if(f.lookupNamespaceURI){e=f.lookupNamespaceURI(g)}else{outer:switch(f.nodeType){case 1:if(f.namespaceURI!==null&&f.prefix===g){e=f.namespaceURI;break outer}var b=f.attributes.length;if(b){var a;for(var c=0;c<b;++c){a=f.attributes[c];if(a.prefix==="xmlns"&&a.name==="xmlns:"+g){e=a.value||null;break outer}else{if(a.name==="xmlns"&&g===null){e=a.value||null;break outer}}}}e=this.lookupNamespaceURI(f.parentNode,g);break outer;case 2:e=this.lookupNamespaceURI(f.ownerElement,g);break outer;case 9:e=this.lookupNamespaceURI(f.documentElement,g);break outer;case 6:case 12:case 10:case 11:break outer;default:e=this.lookupNamespaceURI(f.parentNode,g);break outer}}}return e},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(k,e){if(arguments.length===1&&typeof k==="object"){e=k;k=e&&e.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="/olmap/js/theme/default/style.css";OpenLayers.Util.extend(this,e);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(k);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 h=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(h,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);h=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(h);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 g=true;var c=document.getElementsByTagName("link");for(var f=0,a=c.length;f<a;++f){if(OpenLayers.Util.isEquivalentUrl(c.item(f).href,this.theme)){g=false;break}}if(g){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 f=0,a=this.controls.length;f<a;f++){this.addControlToMap(this.controls[f])}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(f,c,a){var e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this[f],function(g){return g[c]==a||(e&&a.test(g[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(f){var b=null;for(var e=0,a=this.layers.length;e<a;e++){var c=this.layers[e];if(c.id==f){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 e=OpenLayers.i18n("layerAlreadyAdded",{layerName:c.name});OpenLayers.Console.warn(e);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,f){if(f==null){f=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(f){for(var b=0,a=this.layers.length;b<a;b++){var e=this.layers[b];if(e.isBaseLayer||this.allOverlays){this.setBaseLayer(e);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(e,b){var f=this.getLayerIndex(e);if(b<0){b=0}else{if(b>this.layers.length){b=this.layers.length}}if(f!=b){this.layers.splice(f,1);this.layers.splice(b,0,e);for(var c=0,a=this.layers.length;c<a;c++){this.setLayerZIndex(this.layers[c],c)}this.events.triggerEvent("changelayer",{layer:e,property:"order"});if(this.allOverlays){if(b===0){this.setBaseLayer(e)}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(f){var e=null;if(this.baseLayer){e=this.baseLayer.getExtent()}if(f!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,f)!=-1){if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=f;this.viewRequestID++;if(!this.allOverlays){this.baseLayer.visibility=true}var a=this.getCenter();if(a!=null){var b=(e)?e.getCenterLonLat():a;var c=(e)?this.getZoomForExtent(e,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(f){var b=null;for(var c=0,a=this.controls.length;c<a;c++){var e=this.controls[c];if(e.id==f){b=e;break}}return b},removeControl:function(a){if((a)&&(a==this.getControl(a.id))){if(a.div&&(a.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.controls,a)}},addPopup:function(a,e){if(e){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 g=this.getSize();if(g==null){this.size=g=c}if(!c.equals(g)){this.size=c;for(var e=0,b=this.layers.length;e<b;e++){this.layers[e].onMapResize()}if(this.baseLayer!=null){var a=new OpenLayers.Pixel(c.w/2,c.h/2);var h=this.getLonLatFromViewPortPx(a);var f=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),f)}}},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){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 f=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if((a!=null)&&(b!=null)){var e=this.getSize();var g=e.w*b;var c=e.h*b;f=new OpenLayers.Bounds(a.lon-g/2,a.lat-c/2,a.lon+g/2,a.lat+c/2)}return f},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getZoom:function(){return this.zoom},pan:function(e,c,f){f=OpenLayers.Util.applyDefaults(f,{animate:true,dragging:false});var g=this.getViewPortPxFromLonLat(this.getCenter());var b=g.add(e,c);if(!f.dragging||!b.equals(g)){var a=this.getLonLatFromViewPortPx(b);if(f.animate){this.panTo(a)}else{this.setCenter(a,null,f.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 e={lon:a.lon,lat:a.lat};var c={lon:b.lon,lat:b.lat};this.panTween.start(e,c,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(f){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(f){f=new OpenLayers.LonLat(f.lon,f.lat);this.moveTo(f,this.zoom,{dragging:true,noEvent:true})},this),done:OpenLayers.Function.bind(function(f){f=new OpenLayers.LonLat(f.lon,f.lat);this.moveTo(f,this.zoom,{noEvent:true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(b)}},setCenter:function(c,a,b,e){this.moveTo(c,a,{dragging:b,forceZoomChange:e,caller:"setCenter"})},moveTo:function(h,q,u){if(!u){u={}}var p=u.dragging;var c=u.forceZoomChange;var k=u.noEvent;if(this.panTween&&u.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(h)){h=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(h==null){h=this.getCenter()}if(q==null){q=this.getZoom()}var e=this.getResolutionForZoom(q);var r=this.calculateBounds(h,e);if(!this.restrictedExtent.containsBounds(r)){var s=this.restrictedExtent.getCenterLonLat();if(r.getWidth()>this.restrictedExtent.getWidth()){h=new OpenLayers.LonLat(s.lon,h.lat)}else{if(r.left<this.restrictedExtent.left){h=h.add(this.restrictedExtent.left-r.left,0)}else{if(r.right>this.restrictedExtent.right){h=h.add(this.restrictedExtent.right-r.right,0)}}}if(r.getHeight()>this.restrictedExtent.getHeight()){h=new OpenLayers.LonLat(h.lon,s.lat)
}else{if(r.bottom<this.restrictedExtent.bottom){h=h.add(0,this.restrictedExtent.bottom-r.bottom)}else{if(r.top>this.restrictedExtent.top){h=h.add(0,this.restrictedExtent.top-r.top)}}}}}var b=c||((this.isValidZoomLevel(q))&&(q!=this.getZoom()));var f=(this.isValidLonLat(h))&&(!h.equals(this.center));if(b||f||!p){if(!this.dragging&&!k){this.events.triggerEvent("movestart")}if(f){if((!b)&&(this.center)){this.centerLayerContainer(h)}this.center=h.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=q;this.resolution=this.getResolutionForZoom(q);this.viewRequestID++}var a=this.getExtent();this.baseLayer.moveTo(a,b,p);if(p){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:b})}a=this.baseLayer.getExtent();for(var g=0,m=this.layers.length;g<m;g++){var l=this.layers[g];if(l!==this.baseLayer&&!l.isBaseLayer){var o=l.calculateInRange();if(l.inRange!=o){l.inRange=o;if(!o){l.display(false)}this.events.triggerEvent("changelayer",{layer:l,property:"visibility"})}if(o&&l.visibility){l.moveTo(a,b,p);if(p){l.events.triggerEvent("move")}else{l.events.triggerEvent("moveend",{zoomChanged:b})}}}}if(b){for(var g=0,m=this.popups.length;g<m;g++){this.popups[g].updatePosition()}}this.events.triggerEvent("move");if(b){this.events.triggerEvent("zoomend")}}if(!p&&!k){this.events.triggerEvent("moveend")}this.dragging=!!p},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(e,c){var b=e.getCenterLonLat();if(this.baseLayer.wrapDateLine){var a=this.getMaxExtent();e=e.clone();while(e.right<e.left){e.right+=a.getWidth()}b=e.getCenterLonLat().wrapDateLine(a)}this.setCenter(b,this.getZoomForExtent(e,c))},zoomToMaxExtent:function(c){var b=(c)?c.restricted:true;var a=this.getMaxExtent({restricted:b});this.zoomToExtent(a)},zoomToScale:function(k,h){var e=OpenLayers.Util.getResolutionFromScale(k,this.baseLayer.units);var c=this.getSize();var g=c.w*e;var b=c.h*e;var a=this.getCenter();var f=new OpenLayers.Bounds(a.lon-g/2,a.lat-b/2,a.lon+g/2,a.lat+b/2);this.zoomToExtent(f,h)},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(e){var c=null;if(e!=null){var b=parseInt(this.layerContainerDiv.style.left);var a=parseInt(this.layerContainerDiv.style.top);c=e.add(b,a)}return c},getLayerPxFromViewPortPx:function(c){var e=null;if(c!=null){var b=-parseInt(this.layerContainerDiv.style.left);var a=-parseInt(this.layerContainerDiv.style.top);e=c.add(b,a);if(isNaN(e.x)||isNaN(e.y)){e=null}}return e},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(e){return new OpenLayers.Pixel(-(e.w/2),-e.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(h,c,g,b,a,f,e){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(e){var h=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});e=OpenLayers.Util.applyDefaults(e,h);var g=new OpenLayers.Request.XMLHttpRequest();var a=e.url;if(e.params){var f=OpenLayers.Util.getParameterString(e.params);if(f.length>0){var l=(a.indexOf("?")>-1)?"&":"?";a+=l+f}}if(e.proxy&&(a.indexOf("http")==0)){a=e.proxy+encodeURIComponent(a)}g.open(e.method,a,e.async,e.user,e.password);for(var k in e.headers){g.setRequestHeader(k,e.headers[k])}var b=(e.scope)?OpenLayers.Function.bind(e.callback,e.scope):e.callback;var m;if(e.success){m=(e.scope)?OpenLayers.Function.bind(e.success,e.scope):e.success}var c;if(e.failure){c=(e.scope)?OpenLayers.Function.bind(e.failure,e.scope):e.failure}var o=this.events;g.onreadystatechange=function(){if(g.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var p=o.triggerEvent("complete",{request:g,config:e,requestUrl:a});if(p!==false){b(g);if(!g.status||(g.status>=200&&g.status<300)){o.triggerEvent("success",{request:g,config:e,requestUrl:a});if(m){m(g)}}if(g.status&&(g.status<200||g.status>=300)){o.triggerEvent("failure",{request:g,config:e,requestUrl:a});if(c){c(g)}}}}};if(e.async===false){g.send(e.data)}else{window.setTimeout(function(){g.send(e.data)},0)}return g},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(e,a,f,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 e=this.layer.imageOffset;var b=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,e,b,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,e,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 e=1;if(this.backBufferTile.resolution){e=this.backBufferTile.resolution/this.layer.getResolution()}if(e!=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*e,this.backBufferTile.size.h*e);
var a=this.layer.map.getLayerPxFromLonLat(c);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);var f=this.backBufferTile.imageSize;f=new OpenLayers.Size(f.w*e,f.h*e);var g=this.backBufferTile.imageOffset;if(g){g=new OpenLayers.Pixel(g.x*e,g.y*e)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,g,f);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=e},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 e=this.map.baseLayer.clone();this.layers=[e]}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 f=OpenLayers.Util.getImagesLocation();var b=f+"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=f+"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 g=["dblclick","mousedown"];for(var c=0,a=g.length;c<a;c++){OpenLayers.Event.observe(this.maximizeDiv,g[c],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,g[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(l){var e=this.handlers.drag.last.x-l.x;var b=this.handlers.drag.last.y-l.y;if(e!=0||b!=0){var h=this.rectPxBounds.top;var a=this.rectPxBounds.left;var f=Math.abs(this.rectPxBounds.getHeight());var c=this.rectPxBounds.getWidth();var g=Math.max(0,(h-b));g=Math.min(g,this.ovmap.size.h-this.hComp-f);var k=Math.max(0,(a-e));k=Math.min(k,this.ovmap.size.w-this.wComp-c);this.setRectPxBounds(new OpenLayers.Bounds(k,g+f,k+c,g))}},mapDivClick:function(l){var b=this.rectPxBounds.getCenterPixel();var f=l.xy.x-b.x;var e=l.xy.y-b.y;var h=this.rectPxBounds.top;var c=this.rectPxBounds.left;var m=Math.abs(this.rectPxBounds.getHeight());var a=this.rectPxBounds.getWidth();var g=Math.max(0,(h+e));g=Math.min(g,this.ovmap.size.h-m);var k=Math.max(0,(c+f));k=Math.min(k,this.ovmap.size.w-a);this.setRectPxBounds(new OpenLayers.Bounds(k,g+m,k+a,g));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 e=this.ovmap.getResolution()/this.map.getResolution();return((e>this.minRatio)&&(e<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(c)))},updateOverview:function(){var c=this.map.getResolution();var b=this.ovmap.getResolution();var e=b/c;if(e>this.maxRatio){b=this.minRatio*c}else{if(e<=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(f){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()
}});this.rectEvents.register("mouseout",this,function(f){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(e){var h=Math.max(e.top,0);var f=Math.max(e.left,0);var b=Math.min(e.top+Math.abs(e.getHeight()),this.ovmap.size.h-this.hComp);var k=Math.min(e.left+e.getWidth(),this.ovmap.size.w-this.wComp);var c=Math.max(k-f,0);var l=Math.max(b-h,0);if(c<this.minRectSize||l<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var g=f+(c/2)-(this.minRectSize/2);var a=h+(l/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(a)+"px";this.extentRectangle.style.left=Math.round(g)+"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(h)+"px";this.extentRectangle.style.left=Math.round(f)+"px";this.extentRectangle.style.height=Math.round(l)+"px";this.extentRectangle.style.width=Math.round(c)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(f),Math.round(b),Math.round(k),Math.round(h))},getRectBoundsFromMapBounds:function(e){var a=new OpenLayers.LonLat(e.left,e.bottom);var g=new OpenLayers.LonLat(e.right,e.top);var c=this.getOverviewPxFromLonLat(a);var b=this.getOverviewPxFromLonLat(g);var f=null;if(c&&b){f=new OpenLayers.Bounds(c.x,c.y,b.x,b.y)}return f},getMapBoundsFromRectBounds:function(e){var c=new OpenLayers.Pixel(e.left,e.bottom);var b=new OpenLayers.Pixel(e.right,e.top);var a=this.getLonLatFromOverviewPx(c);var f=this.getLonLatFromOverviewPx(b);return new OpenLayers.Bounds(a.lon,a.lat,f.lon,f.lat)},getLonLatFromOverviewPx:function(g){var c=this.ovmap.size;var b=this.ovmap.getResolution();var a=this.ovmap.getExtent().getCenterLonLat();var f=g.x-(c.w/2);var e=g.y-(c.h/2);return new OpenLayers.LonLat(a.lon+f*b,a.lat-e*b)},getOverviewPxFromLonLat:function(e){var b=this.ovmap.getResolution();var c=this.ovmap.getExtent();var a=null;if(c){a=new OpenLayers.Pixel(Math.round(1/b*(e.lon-c.left)),Math.round(1/b*(c.top-e.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(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var b=this.version;if(!b){b=c.getAttribute("version");if(!b){b=this.defaultVersion}}var e=OpenLayers.Format.WFSCapabilities["v"+b.replace(/\./g,"_")];if(!e){throw"Can't find a WFS capabilities parser for version "+b}var g=new e(this.options);var a=g.read(f);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(e,l){var f=[];var b={};var g={complexTypes:f,customTypes:b};this.readChildNodes(e,g);var h=e.attributes;var o,a;for(var k=0,m=h.length;k<m;++k){o=h[k];a=o.name;if(a.indexOf("xmlns")==0){this.setNamespace(a.split(":")[1]||"",o.value)}else{l[a]=o.value}}l.featureTypes=f;l.targetPrefix=this.namespaceAlias[l.targetNamespace];var p,c;for(var k=0,m=f.length;k<m;++k){p=f[k];c=b[p.typeName];if(b[p.typeName]){p.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 e={};var b=a.attributes;var h;for(var f=0,g=b.length;f<g;++f){h=b[f];e[h.name]=h.value}var k=e.type;if(!k){k={};this.readChildNodes(a,k);e.restriction=k;e.type=k.base}var m=k.base||k;e.localType=m.split(":").pop();c.elements.push(e)}if(c.complexTypes){var k=a.getAttribute("type");var l=k.split(":").pop();c.customTypes[l]={name:a.getAttribute("name"),type:k}}},simpleType:function(a,b){this.readChildNodes(a,b)},restriction:function(a,b){b.base=a.getAttribute("base");this.readRestriction(a,b)}}},readRestriction:function(e,g){var c=e.childNodes;var k,h,f;for(var b=0,a=c.length;b<a;++b){k=c[b];if(k.nodeType==1){h=k.nodeName.split(":").pop();f=k.getAttribute("value");if(!g[h]){g[h]=f}else{if(typeof g[h]=="string"){g[h]=[g[h]]}g[h].push(f)}}}},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(f){var g=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});if(f){var b,e;for(var c=0,a=f.length;c<a;++c){e=f[c];b=this.stateName[e.state];if(b){this.writeNode(b,e,g)}}}return g},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 g=OpenLayers.Util.extend({},this.schemaLocations);if(a.schema){g[a.featurePrefix]=a.schema}var f=[];var c;for(var b in g){c=this.namespaces[b];if(c){f.push(c+" "+g[b])}}var e=f.join(" ")||undefined;return e},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(f,c){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var b=f.documentElement;var a=this.version;if(!a){a=b.getAttribute("version");if(!a){a=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=a){var h=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!h){throw"Can't find a WMC parser for version "+a}this.parser=new h(this.options)}var e=this.parser.read(f,c);var g;if(c.map){this.context=e;if(c.map instanceof OpenLayers.Map){g=this.mergeContextToMap(e,c.map)}else{g=this.contextToMap(e,c.map)}}else{g=e}return g},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(f,b){if(f.CLASS_NAME=="OpenLayers.Map"){f=this.mapToContext(f)}var a=(b&&b.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=a){var e=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!e){throw"Can't find a WMS capabilities parser for version "+a}this.parser=new e(this.options)}var c=this.parser.write(f,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(g,f){var c=f.childNodes;var b,e;for(var a=0;a<c.length;++a){b=c[a];if(b.nodeType==1){e=this["read_cap_"+b.nodeName];if(e){e.apply(this,[g,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,f,g){var k={formats:b.request.getmap.formats||[],styles:[],queryable:(f.getAttribute("queryable")==="1"||f.getAttribute("queryable")==="true")};if(g){k.styles=k.styles.concat(g.styles);k.llbbox=g.llbbox;k.minScale=g.minScale;k.maxScale=g.maxScale}var c=f.childNodes;var a,m,e;for(var h=0;h<c.length;++h){a=c[h];m=a.nodeName;e=this["read_cap_"+a.nodeName];if(e){if(m=="Layer"){e.apply(this,[b,a,k])}else{e.apply(this,[k,a])}}}if(k.name){var l=k.name.indexOf(":");if(l>0){k.prefix=k.name.substring(0,l)}b.layers.push(k)}},read_cap_ScaleHint:function(f,g){var e=g.getAttribute("min");var a=g.getAttribute("max");var c=Math.pow(2,0.5);var b=OpenLayers.INCHES_PER_UNIT.m;f.maxScale=parseFloat(((c*e)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13));f.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,e){var b={width:e.getAttribute("width"),height:e.getAttribute("height")};var a=e.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(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.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 e=OpenLayers.Format.WMSDescribeLayer["v"+b.replace(/\./g,"_")];if(!e){throw"Can't find a WMS DescribeLayer parser for version "+b}var g=new e(this.options);var a=g.read(f);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(f){var a;if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var b=f.documentElement;if(b){var c=this;var e=this["read_"+b.nodeName];if(e){a=e.call(this,b)}else{a=new OpenLayers.Format.GML((this.options?this.options:{})).read(f)}}else{a=f}return a},read_msGMLOutput:function(h){var e=[];var b=this.getSiblingNodesByTagCriteria(h,this.layerIdentifier);if(b){for(var k=0,o=b.length;k<o;++k){var c=b[k];var l=c.nodeName;if(c.prefix){l=l.split(":")[1]}var l=l.replace(this.layerIdentifier,"");var m=this.getSiblingNodesByTagCriteria(c,this.featureIdentifier);if(m){for(var g=0;g<m.length;g++){var a=m[g];var p=this.parseGeometry(a);var f=this.parseAttributes(a);var q=new OpenLayers.Feature.Vector(p,f,null);q.type=l;e.push(q)}}}}return e},read_FeatureInfoResponse:function(g){var c=[];var k=this.getElementsByTagNameNS(g,"*","FIELDS");for(var h=0,l=k.length;h<l;h++){var a=k[h];var m=null;var f={};for(var e=0,o=a.attributes.length;e<o;e++){var b=a.attributes[e];f[b.nodeName]=b.nodeValue}c.push(new OpenLayers.Feature.Vector(m,f,null))}return c},getSiblingNodesByTagCriteria:function(g,m){var a=[];var c,f,e,h,b;if(g&&g.hasChildNodes()){c=g.childNodes;e=c.length;for(var l=0;l<e;l++){b=c[l];while(b&&b.nodeType!=1){b=b.nextSibling;l++}f=(b?b.nodeName:"");if(f.length>0&&f.indexOf(m)>-1){a.push(b)}else{h=this.getSiblingNodesByTagCriteria(b,m);if(h.length>0){(a.length==0)?a=h:a.push(h)}}}}return a},parseAttributes:function(e){var f={};if(e.nodeType==1){var c=e.childNodes;n=c.length;for(var g=0;g<n;++g){var b=c[g];if(b.nodeType==1){var l=b.childNodes;if(l.length==1){var k=l[0];if(k.nodeType==3||k.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var h=k.nodeValue.replace(this.regExes.trimSpace,"");f[a]=h}}}}}return f},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(e){this.down=e.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(e,b,c,a){OpenLayers.Handler.prototype.initialize.apply(this,[e,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 g=false;var f=!!(this.feature);var e=(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(f&&b){if(this.lastFeature){this.triggerCallback(c,"out",[this.lastFeature])}this.triggerCallback(c,"in",[this.feature])}else{if(!f||e){this.triggerCallback(c,"in",[this.feature])}}this.lastFeature=this.feature;g=true}else{if(this.lastFeature&&(f&&b||e)){this.triggerCallback(c,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(f||e)){this.triggerCallback(c,"out",[this.lastFeature])}}return g},triggerCallback:function(e,f,b){var c=this.EVENTMAP[e][f];if(c){if(e=="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(m){if(!this.map||!this.checkModifiers(m)){return}var h=false;var o=false;var g=false;var b=OpenLayers.Event.element(m);while((b!=null)&&!g&&!h){if(!h){try{if(b.currentStyle){c=b.currentStyle.overflow}else{var a=document.defaultView.getComputedStyle(b,null);var c=a.getPropertyValue("overflow")}h=(c&&(c=="auto")||(c=="scroll"))}catch(f){}}if(!o){for(var k=0,l=this.map.layers.length;k<l;k++){if(b==this.map.layers[k].div||b==this.map.layers[k].pane){o=true;break}}}g=(b==this.map.div);b=b.parentNode}if(!h&&g){if(o){this.wheelZoom(m)}OpenLayers.Event.stop(m)}},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 e=this.visibility;if(!this.isBaseLayer){e=e&&this.inRange}this.display(e)},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 q=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var f=false;var e={};for(var g=0,l=q.length;g<l;g++){var s=q[g];if(this.options[s]&&OpenLayers.Util.indexOf(b,s)==-1){f=true}e[s]=this.options[s]||this.map[s]}if(this.alwaysInRange==null){this.alwaysInRange=!f}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){e.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){e.resolutions=null}if((!e.numZoomLevels)&&(e.maxZoomLevel)){e.numZoomLevels=e.maxZoomLevel+1}if((e.scales!=null)||(e.resolutions!=null)){if(e.scales!=null){e.resolutions=[];for(var g=0,l=e.scales.length;g<l;g++){var c=e.scales[g];e.resolutions[g]=OpenLayers.Util.getResolutionFromScale(c,e.units)}}e.numZoomLevels=e.resolutions.length}else{if(e.minScale){e.maxResolution=OpenLayers.Util.getResolutionFromScale(e.minScale,e.units)}else{if(e.maxResolution=="auto"){var r=this.map.getSize();var p=e.maxExtent.getWidth()/r.w;var k=e.maxExtent.getHeight()/r.h;e.maxResolution=Math.max(p,k)}}if(e.maxScale!=null){e.minResolution=OpenLayers.Util.getResolutionFromScale(e.maxScale,e.units)}else{if((e.minResolution=="auto")&&(e.minExtent!=null)){var r=this.map.getSize();var p=e.minExtent.getWidth()/r.w;var k=e.minExtent.getHeight()/r.h;e.minResolution=Math.max(p,k)}}if(e.minResolution!=null&&this.options.numZoomLevels==undefined){var o=e.maxResolution/e.minResolution;e.numZoomLevels=Math.floor(Math.log(o)/Math.log(2))+1}e.resolutions=new Array(e.numZoomLevels);var a=2;if(typeof e.minResolution=="number"&&e.numZoomLevels>1){a=Math.pow((e.maxResolution/e.minResolution),(1/(e.numZoomLevels-1)))}for(var g=0;g<e.numZoomLevels;g++){var m=e.maxResolution/Math.pow(a,g);e.resolutions[g]=m}}e.resolutions.sort(function(w,u){return(u-w)});this.resolutions=e.resolutions;this.maxResolution=e.resolutions[0];var h=e.resolutions.length-1;this.minResolution=e.resolutions[h];this.scales=[];for(var g=0,l=e.resolutions.length;g<l;g++){this.scales[g]=OpenLayers.Util.getScaleFromResolution(e.resolutions[g],e.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=e.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(b,c){var e=this.map.getSize();var a=Math.max(b.getWidth()/e.w,b.getHeight()/e.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 e=Math.ceil(c);b=this.resolutions[a]-((c-a)*(this.resolutions[a]-this.resolutions[e]))}else{b=this.resolutions[Math.round(c)]}return b},getZoomForResolution:function(f,a){var q;if(this.map.fractionalZoom){var m=0;var c=this.resolutions.length-1;var e=this.resolutions[m];var b=this.resolutions[c];var l;for(var g=0,h=this.resolutions.length;g<h;++g){l=this.resolutions[g];if(l>=f){e=l;m=g}if(l<=f){b=l;c=g;break}}var k=e-b;if(k>0){q=m+((e-f)/k)}else{q=m}}else{var o;var p=Number.POSITIVE_INFINITY;for(var g=0,h=this.resolutions.length;g<h;g++){if(a){o=Math.abs(this.resolutions[g]-f);if(o>p){break}p=o}else{if(this.resolutions[g]<f){break}}}q=Math.max(0,g-1)}return q},getLonLatFromViewPortPx:function(b){var f=null;if(b!=null){var e=this.map.getSize();var a=this.map.getCenter();if(a){var c=this.map.getResolution();var h=b.x-(e.w/2);var g=b.y-(e.h/2);f=new OpenLayers.LonLat(a.lon+h*c,a.lat-g*c);if(this.wrapDateLine){f=f.wrapDateLine(this.maxExtent)}}}return f},getViewPortPxFromLonLat:function(e){var b=null;if(e!=null){var a=this.map.getResolution();var c=this.map.getExtent();b=new OpenLayers.Pixel((1/a*(e.lon-c.left)),(1/a*(c.top-e.lat)))}return b},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var e=0,a=this.div.childNodes.length;e<a;++e){var c=this.div.childNodes[e].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 e=window.XMLHttpRequest;var k=!!window.controllers,f=window.document.all&&!window.opera;function c(){this._object=e?new e:new window.ActiveXObject("Microsoft.XMLHTTP")}if(k&&e.wrapped){c.wrapped=e.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(p,s,o,u,m){this._async=o;var r=this,q=this.readyState;if(f){var l=function(){if(r._object.readyState!=c.DONE){a(r)}};if(o){window.attachEvent("onunload",l)}}this._object.onreadystatechange=function(){if(k&&!o){return}r.readyState=r._object.readyState;h(r);if(r._aborted){r.readyState=c.UNSENT;return}if(r.readyState==c.DONE){a(r);if(f&&o){window.detachEvent("onunload",l)}}if(q!=r.readyState){g(r)}q=r.readyState};if(c.onopen){c.onopen.apply(this,arguments)}this._object.open(p,s,o,u,m);if(!o&&k){this.readyState=c.OPENED;g(this)}};c.prototype.send=function(l){if(c.onsend){c.onsend.apply(this,arguments)}if(l&&l.nodeType){l=window.XMLSerializer?new window.XMLSerializer().serializeToString(l):l.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(l);if(k&&!this._async){this.readyState=c.OPENED;h(this);while(this.readyState<c.DONE){this.readyState++;g(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(l){return this._object.getResponseHeader(l)};c.prototype.setRequestHeader=function(l,m){if(!this._headers){this._headers={}}this._headers[l]=m;return this._object.setRequestHeader(l,m)};c.prototype.toString=function(){return"[object XMLHttpRequest]"};c.toString=function(){return"[XMLHttpRequest]"};function g(l){if(l.onreadystatechange){l.onreadystatechange.apply(l)}if(c.onreadystatechange){c.onreadystatechange.apply(l)}}function b(m){var l=m.responseXML;if(f&&l&&!l.documentElement&&m.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){l=new ActiveXObject("Microsoft.XMLDOM");l.loadXML(m.responseText)}if(l){if((f&&l.parseError!=0)||(l.documentElement&&l.documentElement.tagName=="parsererror")){return null}}return l}function h(l){try{l.responseText=l._object.responseText}catch(m){}try{l.responseXML=b(l._object)}catch(m){}try{l.status=l._object.status}catch(m){}try{l.statusText=l._object.statusText}catch(m){}}function a(l){l._object.onreadystatechange=new window.Function;delete l._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(l,m){if(!m){m=[]}l.__func=this;l.__func(m[0],m[1],m[2],m[3],m[4]);delete l.__func}}OpenLayers.Request.XMLHttpRequest=c})();OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(a){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:a.statusText}))};OpenLayers.loadURL=function(e,h,b,f,c){if(typeof h=="string"){h=OpenLayers.Util.getParameters(h)}var g=(f)?f:OpenLayers.nullHandler;var a=(c)?c:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:e,params:h,success:g,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 e=new ActiveXObject("Microsoft.XMLDOM");e.loadXML(c);return e},function(){return new DOMParser().parseFromString(c,"text/xml")},function(){var e=new XMLHttpRequest();e.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(c),false);if(e.overrideMimeType){e.overrideMimeType("text/xml")}e.send(null);return e.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(h,c,g){var a;for(var b=0;b<this.responders.length;b++){a=this.responders[b];if(a[h]&&typeof a[h]=="function"){try{a[h].apply(a,[c,g])}catch(f){}}}}};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 f=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){f._method=this.method;this.method="post"}this.parameters=f;if(f=OpenLayers.Util.getParameterString(f)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+f}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){f+="&_="}}}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||f):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 f={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){f["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){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(typeof c.push=="function"){for(var b=0,e=c.length;b<e;b+=2){f[c[b]]=c[b+1]}}else{for(var b in c){f[b]=c[b]}}}for(var a in f){this.transport.setRequestHeader(a,f[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(f){this.dispatchException(f)}var g=b.getHeader("Content-type")}try{(this.options["on"+c]||OpenLayers.Ajax.emptyFunction)(b);OpenLayers.Ajax.Responders.dispatch("on"+c,this,b)}catch(f){this.dispatchException(f)}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 e=this.options.onException;if(e){e(this,c);OpenLayers.Ajax.Responders.dispatch("onException",this,c)
}else{var f=false;var a=OpenLayers.Ajax.Responders.responders;for(var b=0;b<a.length;b++){if(a[b].onException){f=true;break}}if(f){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 e=this.transport=c.transport,a=this.readyState=e.readyState;if((a>2&&!(!!(window.attachEvent&&!window.opera)))||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=e.responseText==null?"":String(e.responseText)}if(a==4){var b=e.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,f){var e=null;if(b.getElementsByTagNameNS){e=b.getElementsByTagNameNS(a,f)}else{e=b.getElementsByTagName(c+":"+f)}return e};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 g=[];var f=this.layers||this.map.layers;var e,b;for(var c=0,a=f.length;c<a;++c){e=f[c];if(e instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||e.getVisibility())){b=e.url instanceof Array?e.url[0]:e.url;if(!this.url){this.url=b}if(this.urlMatches(b)){g.push(e)}}}return g},urlMatches:function(b){var e=OpenLayers.Util.isEquivalentUrl(this.url,b);if(!e&&this.layerUrls){for(var c=0,a=this.layerUrls.length;c<a;++c){if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[c],b)){e=true;break}}}return e},request:function(a,l){l=l||{};var g=[];var h=[];var c=this.findLayers();if(c.length>0){for(var e=0,f=c.length;e<f;e++){g=g.concat(c[e].params.LAYERS);if(c[e].params.STYLES){h=h.concat(c[e].params.STYLES)}else{if(c[e].params.LAYERS instanceof Array){h=h.concat(new Array(c[e].params.LAYERS.length))}else{h=h.concat(c[e].params.LAYERS.replace(/[^,]/g,""))}}}var k={url:this.url,params:OpenLayers.Util.applyDefaults({service:"WMS",version:"1.1.0",request:"GetFeatureInfo",layers:g,query_layers:g,styles:h,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(m){this.handleResponse(a,m)
},scope:this};var b=OpenLayers.Request.GET(k);if(l.hover===true){this.hoverRequest=b.priv}}else{OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(e,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:e});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(e){var c=false;if(this.layer&&this.layer.map){var a=this.layer.map.getExtent();if(e){var b=this.geometry.getBounds();c=a.intersectsBounds(b)}else{var f=a.toGeometry();c=f.intersects(this.geometry)}}return c},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(b,e,c){var a=false;if(this.geometry){a=this.geometry.atPoint(b,e,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 e=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var c=this.layer.map.getResolution();this.geometry.move(c*(b.x-e.x),c*(e.y-b.y));this.layer.drawFeature(this);return e},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 e=this.processXMLNode(b);a=new Array(c,e.lonlat,e);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 e=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(a[0],"http://www.opengis.net/gml","gml","coordinates")[0]);var c=e.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(g,f){var c=f.childNodes;var b,e;for(var a=0;a<c.length;++a){b=c[a];if(b.nodeType==1){e=this["read_cap_"+b.nodeName];if(e){e.apply(this,[g,b])}}}},read_cap_FeatureTypeList:function(c,b){var a={featureTypes:[]};this.runChildNodes(a,b);c.featureTypeList=a},read_cap_FeatureType:function(a,e,b){var c={};this.runChildNodes(c,e);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(f,e){var b=e.childNodes;var a,c,h,l;for(var g=0,k=b.length;g<k;++g){a=b[g];if(a.nodeType==1){h=this.getNamespacePrefix(a.namespaceURI);l=a.nodeName.split(":").pop();c=this["read_"+h+"_"+l];if(c){c.apply(this,[f,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 e={params:this.layerParams||{},options:{visibility:(c.getAttribute("hidden")!="1"),queryable:(c.getAttribute("queryable")=="1")},formats:[],styles:[]};this.runChildNodes(e,c);e.params.layers=e.name;e.options.maxExtent=e.maxExtent;var a=this.getLayerFromInfo(e);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 e={};var a=b.getElementsByTagName("OnlineResource");if(a.length>0){this.read_wmc_OnlineResource(e,a[0])}c.options.metadataURL=e.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,e){var b={width:e.getAttribute("width"),height:e.getAttribute("height")};var a=e.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 e=this.createElementNS(this.namespaces[this.defaultPrefix],c);if(b){e.appendChild(this.createTextNode(b))}if(a){this.setAttributes(e,a)}return e},setAttributes:function(b,e){var c;for(var a in e){c=e[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 e=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)});e.appendChild(a)}return e},write_wmc_LayerList:function(e){var f=this.createElementDefaultNS("LayerList");var c;for(var b=0,a=e.layers.length;b<a;++b){c=e.layers[b];if(c instanceof OpenLayers.Layer.WMS){f.appendChild(this.write_wmc_Layer(c))}}return f},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(g){var e=this.createElementDefaultNS("Extension");var a=g.maxExtent;var l=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(l,{minx:a.left.toPrecision(10),miny:a.bottom.toPrecision(10),maxx:a.right.toPrecision(10),maxy:a.top.toPrecision(10)});e.appendChild(l);var c=g.params.TRANSPARENT;if(c){var m=this.createElementNS(this.namespaces.ol,"ol:transparent");m.appendChild(this.createTextNode(c));e.appendChild(m)}var k=["numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"];var b;for(var f=0,h=k.length;f<h;++f){b=this.createOLPropertyNode(g,k[f]);if(b){e.appendChild(b)}}return e},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(f){var e=this.createElementDefaultNS("StyleList");var c=this.createElementDefaultNS("Style",null,{current:"1"});if(f.params.SLD){var b=this.createElementDefaultNS("SLD");var h=this.write_wmc_OnlineResource(f.params.SLD);b.appendChild(h);c.appendChild(b)}else{if(f.params.SLD_BODY){var b=this.createElementDefaultNS("SLD");var g=f.params.SLD_BODY;var k=OpenLayers.Format.XML.prototype.read.apply(this,[g]);var l=k.documentElement;if(b.ownerDocument&&b.ownerDocument.importNode){l=b.ownerDocument.importNode(l,true)}b.appendChild(l);c.appendChild(b)}else{var a=f.params.STYLES?f.params.STYLES:this.defaultStyleName;c.appendChild(this.createElementDefaultNS("Name",a));c.appendChild(this.createElementDefaultNS("Title",this.defaultStyleTitle))}}e.appendChild(c);return e},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(h){if(typeof h=="string"){h=OpenLayers.Format.XML.prototype.read.apply(this,[h])}var b=h.documentElement;var f=b.childNodes;var a=[];for(var e=0;e<f.length;++e){childNode=f[e];nodeName=childNode.nodeName;if(nodeName=="LayerDescription"){var k="";var g="";var c="";if(childNode.getAttribute("owsType")){k=childNode.getAttribute("owsType");g=childNode.getAttribute("owsURL")
}else{if(childNode.getAttribute("wfs")!=""){k="WFS";g=childNode.getAttribute("wfs")}else{if(childNode.getAttribute("wcs")!=""){k="WCS";g=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:k,owsURL:g,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(g){var e=this.dragHandler.start.x;var b=this.dragHandler.start.y;var c=Math.abs(e-g.x);var a=Math.abs(b-g.y);this.zoomBox.style.width=Math.max(1,c)+"px";this.zoomBox.style.height=Math.max(1,a)+"px";this.zoomBox.style.left=g.x<e?g.x+"px":e+"px";this.zoomBox.style.top=g.y<b?g.y+"px":b+"px";var f=this.getBoxCharacteristics();if(f.newBoxModel){if(g.x>e){this.zoomBox.style.width=Math.max(1,c-f.xOffset)+"px"}if(g.y>b){this.zoomBox.style.height=Math.max(1,a-f.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 h=this.dragHandler.start;var g=Math.min(h.y,b.y);var c=Math.max(h.y,b.y);var f=Math.min(h.x,b.x);var e=Math.max(h.x,b.x);a=new OpenLayers.Bounds(f,c,e,g)}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 g=this.map.getLonLatFromPixel(c.xy);var a=new OpenLayers.Geometry.Point(g.lon,g.lat);if(this.irregular){var h=Math.sqrt(2)*Math.abs(a.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,h)}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 e=a.x-this.origin.x;var b=a.y-this.origin.y;var f;if(b==0){f=e/(this.radius*Math.sqrt(2))}else{f=e/b}this.feature.geometry.resize(1,this.origin,f);this.feature.geometry.move(e/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 g,c,b,a;var e=this.feature.geometry.components[0];if(e.components.length!=(this.sides+1)){this.createGeometry();e=this.feature.geometry.components[0]}for(var f=0;f<this.sides;++f){a=e.components[f];g=this.angle+(f*2*Math.PI/this.sides);a.x=this.origin.x+(this.radius*Math.cos(g));a.y=this.origin.y+(this.radius*Math.sin(g));a.clearBounds()}},calculateAngle:function(a,b){var e=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(e/c)*c}else{this.angle=e}},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 h=this.map.getSize();var a=Math.min(h.w,300);var f=Math.min(h.h,200);
var b=new OpenLayers.Size(a,f);var e=new OpenLayers.Pixel(h.w/2,h.h/2);var c=e.add(-b.w/2,-b.h/2);var g=OpenLayers.Util.createDiv(this.name+"_warning",c,b,null,null,null,"auto");g.style.padding="7px";g.style.backgroundColor="yellow";g.innerHTML=this.getWarningHTML();this.div.appendChild(g)},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,e,m){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var f=this.map.getCenter();var h=this.map.getZoom();if(f!=null){var g=this.getMapObjectCenter();var b=this.getOLLonLatFromMapObjectLonLat(g);var k=this.getMapObjectZoom();var q=this.getOLZoomFromMapObjectZoom(k);if(!(f.equals(b))||!(h==q)){if(m&&this.dragPanMapObject&&this.smoothDragPan){var l=this.map.getViewPortPxFromLonLat(b);var o=this.map.getViewPortPxFromLonLat(f);this.dragPanMapObject(o.x-l.x,l.y-o.y)}else{var a=this.getMapObjectLonLatFromOLLonLat(f);var p=this.getMapObjectZoomFromOLZoom(h);this.setMapObjectCenter(a,p,m)}}}}},getLonLatFromViewPortPx:function(a){var b=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var e=this.getMapObjectPixelFromOLPixel(a);var c=this.getMapObjectLonLatFromMapObjectPixel(e);b=this.getOLLonLatFromMapObjectLonLat(c)}return b},getViewPortPxFromLonLat:function(b){var a=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var e=this.getMapObjectLonLatFromOLLonLat(b);var c=this.getMapObjectPixelFromMapObjectLonLat(e);a=this.getOLPixelFromMapObjectPixel(c)}return a},getOLLonLatFromMapObjectLonLat:function(e){var a=null;if(e!=null){var c=this.getLongitudeFromMapObjectLonLat(e);var b=this.getLatitudeFromMapObjectLonLat(e);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(e){var b=null;if(e!=null){var a=this.getXFromMapObjectPixel(e);var c=this.getYFromMapObjectPixel(e);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 g=c[b];this[g]=(this.options[g]!=null)?this.options[g]:this.map[g]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var h;var f=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){h=this.maxZoomLevel-this.minZoomLevel+1}else{h=this.numZoomLevels}if(h!=null){this.numZoomLevels=Math.min(h,f)}else{this.numZoomLevels=f}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var e=0;this.resolutions=[];for(var b=this.minZoomLevel;b<=this.maxZoomLevel;b++){this.resolutions[e++]=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 f=new OpenLayers.Pixel(0,0);var g=this.getLonLatFromViewPortPx(f);var a=new OpenLayers.Pixel(b.w,b.h);var e=this.getLonLatFromViewPortPx(a);if((g!=null)&&(e!=null)){c=new OpenLayers.Bounds(g.lon,e.lat,e.lon,g.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(e,c,f,b){var a=arguments;a=[e,b];OpenLayers.Layer.prototype.initialize.apply(this,a);this.url=c;this.params=OpenLayers.Util.extend({},f)},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(f,e){var c=1;for(var b=0,a=f.length;b<a;b++){c*=f.charCodeAt(b)*this.URL_HASH_FACTOR;c-=Math.floor(c)}return e[Math.floor(c*e.length)]},getFullRequestString:function(g,f){var b=f||this.url;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var a=OpenLayers.Util.getParameterString(h);if(b instanceof Array){b=this.selectUrl(a,b)}var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var k in h){if(k.toUpperCase() in e){delete h[k]}}a=OpenLayers.Util.getParameterString(h);var l=b;if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){l+=a}else{if(b.indexOf("?")==-1){l+="?"+a}else{l+="&"+a}}}return l},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,f,e,a){this.url=b;this.extent=f;this.maxExtent=f;this.size=e;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(f,a,g){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var b=(this.tile==null);if(a||b){this.setTileSize();var e=new OpenLayers.LonLat(this.extent.left,this.extent.top);var c=this.map.getLayerPxFromLonLat(e);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(e,b,f){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 e=0,a=this.markers.length;e<a;e++){var c=this.markers[e];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 e=Math.log(Math.tan((90+b)*Math.PI/360))/(Math.PI/180);e=e*20037508.34/180;return new OpenLayers.LonLat(a,e)},inverseMercator:function(a,e){var c=(a/20037508.34)*180;var b=(e/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(e,a,f,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 e=b.responseXML;if(!e||!e.documentElement){e=b.responseText}if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(e))}else{var a=new OpenLayers.Format.XML();if(typeof e=="string"){e=a.read(e)}var c=a.getElementsByTagNameNS(e,"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"});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(g,f){this.layer.events.triggerEvent("sketchmodified",{vertex:g,feature:f})},create:function(g,f){this.layer.events.triggerEvent("sketchstarted",{vertex:g,feature:f})}},this.callbacks);this.layer=b;var e=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(e){this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":e})})}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(e,b){var c,a;if(e.CLASS_NAME.indexOf("LineString")>-1){c=this.getBestLength(e);a=1}else{c=this.getBestArea(e);a=2}this.events.triggerEvent(b,{measure:c[0],units:c[1],order:a,geometry:e})},getBestArea:function(g){var b=this.displaySystemUnits[this.displaySystem];var f,e;for(var c=0,a=b.length;c<a;++c){f=b[c];e=this.getArea(g,f);if(e>1){break}}return[e,f]},getArea:function(g,a){var b,c;if(this.geodesic){b=g.getGeodesicArea(this.map.getProjectionObject());c="m"}else{b=g.getArea();c=this.map.getUnits()}var f=OpenLayers.INCHES_PER_UNIT[a];if(f){var e=OpenLayers.INCHES_PER_UNIT[c];b*=Math.pow((e/f),2)}return b},getBestLength:function(g){var b=this.displaySystemUnits[this.displaySystem];var f,e;for(var c=0,a=b.length;c<a;++c){f=b[c];e=this.getLength(g,f);if(e>1){break}}return[e,f]},getLength:function(g,a){var b,c;if(this.geodesic){b=g.getGeodesicLength(this.map.getProjectionObject());c="m"}else{b=g.getLength();c=this.map.getUnits()}var f=OpenLayers.INCHES_PER_UNIT[a];if(f){var e=OpenLayers.INCHES_PER_UNIT[c];b*=(e/f)}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(k){if(k instanceof OpenLayers.Bounds){if(!this.out){var l=this.map.getLonLatFromPixel(new OpenLayers.Pixel(k.left,k.bottom));var q=this.map.getLonLatFromPixel(new OpenLayers.Pixel(k.right,k.top));var b=new OpenLayers.Bounds(l.lon,l.lat,q.lon,q.lat)}else{var h=Math.abs(k.right-k.left);var m=Math.abs(k.top-k.bottom);var f=Math.min((this.map.size.h/m),(this.map.size.w/h));var r=this.map.getExtent();var a=this.map.getLonLatFromPixel(k.getCenterPixel());var c=a.lon-(r.getWidth()/2)*f;var g=a.lon+(r.getWidth()/2)*f;var p=a.lat-(r.getHeight()/2)*f;var e=a.lat+(r.getHeight()/2)*f;var b=new OpenLayers.Bounds(c,p,g,e)}var o=this.map.getZoom();this.map.zoomToExtent(b);if(o==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(o+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(k),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(k),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(g){var f,e,k;var h=this.regExes.typeStr.exec(g);if(h){e=h[1].toLowerCase();k=h[2];if(this.parse[e]){f=this.parse[e].apply(this,[k])}if(this.internalProjection&&this.externalProjection){if(f&&f.CLASS_NAME=="OpenLayers.Feature.Vector"){f.geometry.transform(this.externalProjection,this.internalProjection)}else{if(f&&e!="geometrycollection"&&typeof f=="object"){for(var c=0,a=f.length;c<a;c++){var b=f[c];b.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return f},write:function(a){var g,l,k,e,b;if(a.constructor==Array){g=a;b=true}else{g=[a];b=false}var c=[];if(b){c.push("GEOMETRYCOLLECTION(")}for(var f=0,h=g.length;f<h;++f){if(b&&f>0){c.push(",")}l=g[f].geometry;k=l.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[k]){return null}if(this.internalProjection&&this.externalProjection){l=l.clone();l.transform(this.internalProjection,this.externalProjection)}e=this.extract[k].apply(this,[l]);c.push(k.toUpperCase()+"("+e+")")}if(b){c.push(")")}return c.join("")},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(c){var e=[];for(var b=0,a=c.components.length;b<a;++b){e.push(this.extract.point.apply(this,[c.components[b]]))}return e.join(",")},linestring:function(b){var e=[];for(var c=0,a=b.components.length;c<a;++c){e.push(this.extract.point.apply(this,[b.components[c]]))}return e.join(",")},multilinestring:function(c){var e=[];for(var b=0,a=c.components.length;b<a;++b){e.push("("+this.extract.linestring.apply(this,[c.components[b]])+")")}return e.join(",")},polygon:function(c){var e=[];for(var b=0,a=c.components.length;b<a;++b){e.push("("+this.extract.linestring.apply(this,[c.components[b]])+")")}return e.join(",")},multipolygon:function(e){var c=[];for(var b=0,a=e.components.length;b<a;++b){c.push("("+this.extract.polygon.apply(this,[e.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(f){var c=OpenLayers.String.trim(f).split(",");var e=[];for(var b=0,a=c.length;b<a;++b){e.push(this.parse.point.apply(this,[c[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(e))},linestring:function(f){var c=OpenLayers.String.trim(f).split(",");var e=[];for(var b=0,a=c.length;b<a;++b){e.push(this.parse.point.apply(this,[c[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(e))},multilinestring:function(g){var c;var b=OpenLayers.String.trim(g).split(this.regExes.parenComma);var f=[];for(var e=0,a=b.length;e<a;++e){c=b[e].replace(this.regExes.trimParens,"$1");f.push(this.parse.linestring.apply(this,[c]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(f))},polygon:function(k){var c,b,g;var h=OpenLayers.String.trim(k).split(this.regExes.parenComma);var f=[];for(var e=0,a=h.length;e<a;++e){c=h[e].replace(this.regExes.trimParens,"$1");b=this.parse.linestring.apply(this,[c]).geometry;g=new OpenLayers.Geometry.LinearRing(b.components);f.push(g)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(f))},multipolygon:function(g){var e;var b=OpenLayers.String.trim(g).split(this.regExes.doubleParenComma);var f=[];for(var c=0,a=b.length;c<a;++c){e=b[c].replace(this.regExes.trimParens,"$1");f.push(this.parse.polygon.apply(this,[e]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(f))},geometrycollection:function(f){f=f.replace(/,\s*([A-Za-z])/g,"|$1");var e=OpenLayers.String.trim(f).split("|");var c=[];for(var b=0,a=e.length;b<a;++b){c.push(OpenLayers.Format.WKT.prototype.read.apply(this,[e[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 e=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");e.appendChild(this.createTextNode(b.maxScale.toPrecision(10)));c.insertBefore(e,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 e=a.bounds;var g=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(e.left,e.top));var c=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(e.right,e.bottom));if(c==null||g==null){a.display(false)}else{var f=new OpenLayers.Size(Math.max(1,c.x-g.x),Math.max(1,c.y-g.y));var b=a.draw(g,f);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(m){var r=m.responseXML;if(!r||!r.documentElement){r=OpenLayers.Format.XML.prototype.read(m.responseText)}if(this.useFeedTitle){var a=null;try{a=r.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(l){a=r.getElementsByTagName("title")[0].firstChild.nodeValue}if(a){this.setName(a)}}var z={};OpenLayers.Util.extend(z,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){z.externalProjection=this.projection;z.internalProjection=this.map.getProjectionObject()}var s=new OpenLayers.Format.GeoRSS(z);var b=s.read(r);for(var h=0,k=b.length;h<k;h++){var g={};var w=b[h];if(!w.geometry){continue}var p=w.attributes.title?w.attributes.title:"Untitled";var u=w.attributes.description?w.attributes.description:"No description.";var o=w.attributes.link?w.attributes.link:"";var q=w.geometry.getBounds().getCenterLonLat();g.icon=this.icon==null?OpenLayers.Marker.defaultIcon():this.icon.clone();g.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120);if(p||u){g.title=p;g.description=u;var c='<div class="olLayerGeoRSSClose">[x]</div>';c+='<div class="olLayerGeoRSSTitle">';if(o){c+='<a class="link" href="'+o+'" target="_blank">'}c+=p;if(o){c+="</a>"}c+="</div>";c+='<div style="" class="olLayerGeoRSSDescription">';c+=u;c+="</div>";g.popupContentHTML=c}var w=new OpenLayers.Feature(this,q,g);this.features.push(w);var f=w.createMarker();f.events.register("click",w,this.markerClick);this.addMarker(f)}this.events.triggerEvent("loadend")},markerClick:function(c){var f=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!f)?this:null;for(var e=0,a=this.layer.map.popups.length;e<a;e++){this.layer.map.removePopup(this.layer.map.popups[e])}if(!f){var b=this.createPopup();OpenLayers.Event.observe(b.div,"click",OpenLayers.Function.bind(function(){for(var h=0,g=this.layer.map.popups.length;h<g;h++){this.layer.map.removePopup(this.layer.map.popups[h])}},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.checkResize()}else{if(!this._resized){var a=this;var b=GEvent.addListener(this.mapObject,"tilesloaded",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 e=b.getNorthEast();if(this.sphericalMercator){a=this.forwardMercator(a.lng(),a.lat());e=this.forwardMercator(e.lng(),e.lat())}else{a=new OpenLayers.LonLat(a.lng(),a.lat());e=new OpenLayers.LonLat(e.lng(),e.lat())}c=new OpenLayers.Bounds(a.lon,a.lat,e.lon,e.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 e=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(e.lat,e.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(e,b){var c;if(this.sphericalMercator){var a=this.inverseMercator(e,b);c=new GLatLng(a.lat,a.lon)}else{c=new GLatLng(b,e)}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,e,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 g=0,b=this.grid.length;g<b;g++){var f=this.grid[g];for(var c=0,a=f.length;c<a;c++){var e=f[c];this.removeTileMonitoringHooks(e);e.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(e,a,f){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);e=e||this.map.getExtent();if(e!=null){var c=!this.grid.length||a;var b=this.getTilesBounds();if(this.singleTile){if(c||(!f&&!b.containsBounds(e))){this.initSingleTile(e)}}else{if(c||!b.containsBounds(e,true)){this.initGriddedTiles(e)}else{this.moveGriddedTiles(e)}}}},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 f=null;if(this.grid.length){var a=this.grid.length-1;var e=this.grid[a][0];var b=this.grid[0].length-1;var c=this.grid[0][b];f=new OpenLayers.Bounds(e.bounds.left,e.bounds.bottom,c.bounds.right,c.bounds.top)}return f},initSingleTile:function(g){var a=g.getCenterLonLat();var k=g.getWidth()*this.ratio;var b=g.getHeight()*this.ratio;var h=new OpenLayers.Bounds(a.lon-(k/2),a.lat-(b/2),a.lon+(k/2),a.lat+(b/2));var e=new OpenLayers.LonLat(h.left,h.top);var c=this.map.getLayerPxFromLonLat(e);if(!this.grid.length){this.grid[0]=[]}var f=this.grid[0][0];if(!f){f=this.addTile(h,c);this.addTileMonitoringHooks(f);f.draw();this.grid[0][0]=f}else{f.moveTo(h,c)}this.removeExcessTiles(1,1)},calculateGridLayout:function(a,s,f){var o=f*this.tileSize.w;var c=f*this.tileSize.h;var l=a.left-s.left;var p=Math.floor(l/o)-this.buffer;var m=l/o-p;var g=-m*this.tileSize.w;var q=s.left+p*o;var b=a.top-(s.bottom+c);var k=Math.ceil(b/c)+this.buffer;var r=k-b/c;var e=-r*this.tileSize.h;var h=s.bottom+k*c;return{tilelon:o,tilelat:c,tileoffsetlon:q,tileoffsetlat:h,tileoffsetx:g,tileoffsety:e}},initGriddedTiles:function(l){var h=this.map.getSize();var D=Math.ceil(h.h/this.tileSize.h)+Math.max(1,2*this.buffer);var F=Math.ceil(h.w/this.tileSize.w)+Math.max(1,2*this.buffer);var s=this.maxExtent;var z=this.map.getResolution();var w=this.calculateGridLayout(l,s,z);var g=Math.round(w.tileoffsetx);var c=Math.round(w.tileoffsety);var o=w.tileoffsetlon;var r=w.tileoffsetlat;var f=w.tilelon;var m=w.tilelat;this.origin=new OpenLayers.Pixel(g,c);var C=g;var E=o;var B=0;var a=parseInt(this.map.layerContainerDiv.style.left);var A=parseInt(this.map.layerContainerDiv.style.top);do{var k=this.grid[B++];if(!k){k=[];this.grid.push(k)}o=E;g=C;var e=0;do{var b=new OpenLayers.Bounds(o,r,o+f,r+m);var q=g;q-=a;var p=c;p-=A;var u=new OpenLayers.Pixel(q,p);var G=k[e++];if(!G){G=this.addTile(b,u);this.addTileMonitoringHooks(G);k.push(G)}else{G.moveTo(b,u,false)}o+=f;g+=this.tileSize.w}while((o<=l.right+f*this.buffer)||e<F);r-=m;c+=this.tileSize.h}while((r>=l.bottom-m*this.buffer)||B<D);this.removeExcessTiles(B,e);this.spiralTileLoad()},spiralTileLoad:function(){var b=[];var k=["right","down","left","up"];var h=0;var a=-1;var m=OpenLayers.Util.indexOf(k,"right");var o=0;while(o<k.length){var l=h;var c=a;switch(k[m]){case"right":c++;break;case"down":l++;break;case"left":c--;break;case"up":l--;break}var g=null;if((l<this.grid.length)&&(l>=0)&&(c<this.grid[0].length)&&(c>=0)){g=this.grid[l][c]}if((g!=null)&&(!g.queued)){b.unshift(g);g.queued=true;o=0;h=l;a=c}else{m=(m+1)%4;o++}}for(var e=0,f=b.length;e<f;e++){var g=b[e];g.draw();g.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 e=this.map.getViewPortPxFromLayerPx(a);if(e.x>-this.tileSize.w*(b-1)){this.shiftColumn(true)}else{if(e.x<-this.tileSize.w*b){this.shiftColumn(false)}else{if(e.y>-this.tileSize.h*(b-1)){this.shiftRow(true)}else{if(e.y<-this.tileSize.h*b){this.shiftRow(false)}else{break}}}}}},shiftRow:function(q){var c=(q)?0:(this.grid.length-1);var b=this.grid;var g=b[c];var f=this.map.getResolution();var k=(q)?-this.tileSize.h:this.tileSize.h;var h=f*-k;var p=(q)?b.pop():b.shift();for(var l=0,o=g.length;l<o;l++){var e=g[l];var a=e.bounds.clone();var m=e.position.clone();a.bottom=a.bottom+h;a.top=a.top+h;m.y=m.y+k;p[l].moveTo(a,m)}if(q){b.unshift(p)}else{b.push(p)}},shiftColumn:function(p){var e=(p)?-this.tileSize.w:this.tileSize.w;var c=this.map.getResolution();var m=c*e;for(var f=0,h=this.grid.length;f<h;f++){var o=this.grid[f];var l=(p)?0:(o.length-1);var b=o[l];var a=b.bounds.clone();var g=b.position.clone();a.left=a.left+m;a.right=a.right+m;g.x=g.x+e;var k=p?this.grid[f].pop():this.grid[f].shift();k.moveTo(a,g);if(p){o.unshift(k)}else{o.push(k)}}},removeExcessTiles:function(f,c){while(this.grid.length>f){var g=this.grid.pop();for(var b=0,a=g.length;b<a;b++){var e=g[b];this.removeTileMonitoringHooks(e);e.destroy()}}while(this.grid[0].length>c){for(var b=0,a=this.grid.length;b<a;b++){var g=this.grid[b];var e=g.pop();this.removeTileMonitoringHooks(e);e.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(e){var c=this.maxExtent;var g=this.getResolution();var f=g*this.tileSize.w;var b=g*this.tileSize.h;var k=this.getLonLatFromViewPortPx(e);var a=c.left+(f*Math.floor((k.lon-c.left)/f));var h=c.bottom+(b*Math.floor((k.lat-c.bottom)/b));return new OpenLayers.Bounds(a,h,a+f,h+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(e,c){var a;if(this.sphericalMercator){var b=this.inverseMercator(e,c);a=new MMLatLon(b.lat,b.lon)}else{a=new MMLatLon(c,e)}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(m){var p=m.responseText;var r={};OpenLayers.Util.extend(r,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){r.externalProjection=this.projection;r.internalProjection=this.map.getProjectionObject()}var b=new OpenLayers.Format.Text(r);var c=b.read(p);for(var h=0,k=c.length;h<k;h++){var g={};var q=c[h];var o;var l,e;o=new OpenLayers.LonLat(q.geometry.x,q.geometry.y);if(q.style.graphicWidth&&q.style.graphicHeight){l=new OpenLayers.Size(q.style.graphicWidth,q.style.graphicHeight)}if(q.style.graphicXOffset!==undefined&&q.style.graphicYOffset!==undefined){e=new OpenLayers.Pixel(q.style.graphicXOffset,q.style.graphicYOffset)}if(q.style.externalGraphic!=null){g.icon=new OpenLayers.Icon(q.style.externalGraphic,l,e)}else{g.icon=OpenLayers.Marker.defaultIcon();if(l!=null){g.icon.setSize(l)}}if((q.attributes.title!=null)&&(q.attributes.description!=null)){g.popupContentHTML="<h2>"+q.attributes.title+"</h2><p>"+q.attributes.description+"</p>"}g.overflow=q.attributes.overflow||"auto";var a=new OpenLayers.Feature(this,o,g);this.features.push(a);var f=a.createMarker();if((q.attributes.title!=null)&&(q.attributes.description!=null)){f.events.register("click",a,this.markerClick)}this.addMarker(f)}this.events.triggerEvent("loadend")},markerClick:function(b){var e=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!e)?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(!e){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(e,b){var c;if(this.sphericalMercator){var a=this.inverseMercator(e,b);c=new VELatLong(a.lat,a.lon)}else{c=new VELatLong(b,e)}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(e,c){var a;if(this.sphericalMercator){var b=this.inverseMercator(e,c);a=new YGeoPoint(b.lat,b.lon)}else{a=new YGeoPoint(c,e)}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 e=new OpenLayers.Protocol.Response({reqFeatures:c,requestType:"update"});e.priv=OpenLayers.Request.PUT({url:a,callback:this.createCallback(this.handleUpdate,e,b),headers:b.headers,data:this.format.write(c)});return e},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 e=new OpenLayers.Protocol.Response({reqFeatures:c,requestType:"delete"});e.priv=OpenLayers.Request.DELETE({url:a,callback:this.createCallback(this.handleDelete,e,b),headers:b.headers});return e},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,u){u=OpenLayers.Util.applyDefaults(u,this.options);var e=[],p=0;var m={};m[OpenLayers.State.INSERT]=[];m[OpenLayers.State.UPDATE]=[];m[OpenLayers.State.DELETE]=[];var s,o,c=[];for(var f=0,l=b.length;f<l;++f){s=b[f];o=m[s.state];if(o){o.push(s);c.push(s)}}var h=(m[OpenLayers.State.INSERT].length>0?1:0)+m[OpenLayers.State.UPDATE].length+m[OpenLayers.State.DELETE].length;var r=true;var a=new OpenLayers.Protocol.Response({reqFeatures:c});function k(z){var w=z.features?z.features.length:0;var B=new Array(w);for(var A=0;A<w;++A){B[A]=z.features[A].fid}a.insertIds=B;q.apply(this,[z])}function q(w){this.callUserCallback(w,u);r=r&&w.success();p++;if(p>=h){if(u.callback){a.code=r?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;u.callback.apply(u.scope,[a])}}}var g=m[OpenLayers.State.INSERT];if(g.length>0){e.push(this.create(g,OpenLayers.Util.applyDefaults({callback:k,scope:this},u.create)))}g=m[OpenLayers.State.UPDATE];for(var f=g.length-1;f>=0;--f){e.push(this.update(g[f],OpenLayers.Util.applyDefaults({callback:q,scope:this},u.update)))}g=m[OpenLayers.State.DELETE];for(var f=g.length-1;f>=0;--f){e.push(this["delete"](g[f],OpenLayers.Util.applyDefaults({callback:q,scope:this},u["delete"])))}return e},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(m){var a=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),m);var l=this.rules;var k,b;var c=[];var g=false;for(var e=0,f=l.length;e<f;e++){k=l[e];var h=k.evaluate(m);if(h){if(k instanceof OpenLayers.Rule&&k.elseFilter){c.push(k)}else{g=true;this.applySymbolizer(k,a,m)}}}if(g==false&&c.length>0){g=true;for(var e=0,f=c.length;e<f;e++){this.applySymbolizer(c[e],a,m)}}if(l.length>0&&g==false){a.display="none"}return a},applySymbolizer:function(g,e,b){var a=b.geometry?this.getSymbolizerPrefix(b.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var c=g.symbolizer[a]||g.symbolizer;if(this.defaultsPerSymbolizer===true){var f=this.defaultStyle;OpenLayers.Util.applyDefaults(c,{pointRadius:f.pointRadius});if(c.stroke===true||c.graphic===true){OpenLayers.Util.applyDefaults(c,{strokeWidth:f.strokeWidth,strokeColor:f.strokeColor,strokeOpacity:f.strokeOpacity,strokeDashstyle:f.strokeDashstyle,strokeLinecap:f.strokeLinecap})}if(c.fill===true||c.graphic===true){OpenLayers.Util.applyDefaults(c,{fillColor:f.fillColor,fillOpacity:f.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(e,c),b)},createLiterals:function(e,c){var b=this.context||c.attributes||c.data;for(var a in this.propertyStyles){e[a]=OpenLayers.Style.createLiteral(e[a],b,c)}return e},findPropertyStyles:function(){var e={};var g=this.defaultStyle;this.addPropertyStyles(e,g);var k=this.rules;var f,h;for(var c=0,a=k.length;c<a;c++){f=k[c].symbolizer;for(var b in f){h=f[b];if(typeof h=="object"){this.addPropertyStyles(e,h)}else{this.addPropertyStyles(e,f);break}}}return e},addPropertyStyles:function(b,c){var e;for(var a in c){e=c[a];if(typeof e=="string"&&e.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(e){var c=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var b=0,a=c.length;b<a;b++){if(e.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(k,c){var g=this.map.getZoom()+c;if(!this.map.isValidZoomLevel(g)){return}var l=this.map.getSize();var f=l.w/2-k.xy.x;var e=k.xy.y-l.h/2;var h=this.map.baseLayer.getResolutionForZoom(g);var a=this.map.getLonLatFromPixel(k.xy);var b=new OpenLayers.LonLat(a.lon+f*h,a.lat+e*h);this.map.setCenter(b,g)},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(f,k,g){var c=false;var e=this.getBounds();if((e!=null)&&(f!=null)){var b=(k!=null)?k:0;var a=(g!=null)?g:0;var h=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-a,this.bounds.right+b,this.bounds.top+a);c=h.containsLonLat(f)}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(g){var h=arguments.callee.format;if(!h){h=new OpenLayers.Format.WKT();arguments.callee.format=h}var e;var b=h.read(g);if(b instanceof OpenLayers.Feature.Vector){e=b.geometry}else{if(b instanceof Array){var a=b.length;var f=new Array(a);for(var c=0;c<a;++c){f[c]=b[c].geometry}e=new OpenLayers.Geometry.Collection(f)}}return e};OpenLayers.Geometry.segmentsIntersect=function(a,K,b){var u=b&&b.point;var C=b&&b.tolerance;var f=false;var E=a.x1-K.x1;var I=a.y1-K.y1;var q=a.x2-a.x1;var B=a.y2-a.y1;var w=K.y2-K.y1;var l=K.x2-K.x1;var G=(w*q)-(l*B);var e=(l*I)-(w*E);var c=(q*I)-(B*E);if(G==0){if(e==0&&c==0){f=true}}else{var H=e/G;var F=c/G;if(H>=0&&H<=1&&F>=0&&F<=1){if(!u){f=true}else{var h=a.x1+(H*q);var g=a.y1+(H*B);f=new OpenLayers.Geometry.Point(h,g)}}}if(C){var s;if(f){if(u){var o=[a,K];var D,h,g;outer:for(var A=0;A<2;++A){D=o[A];for(var z=1;z<3;++z){h=D["x"+z];g=D["y"+z];s=Math.sqrt(Math.pow(h-f.x,2)+Math.pow(g-f.y,2));if(s<C){f.x=h;f.y=g;break outer}}}}}else{var o=[a,K];var r,J,h,g,m,k;outer:for(var A=0;A<2;++A){r=o[A];J=o[(A+1)%2];for(var z=1;z<3;++z){m={x:r["x"+z],y:r["y"+z]};k=OpenLayers.Geometry.distanceToSegment(m,J);if(k.distance<C){if(u){f=new OpenLayers.Geometry.Point(m.x,m.y)}else{f=true}break outer}}}}}return f};OpenLayers.Geometry.distanceToSegment=function(o,e){var c=o.x;var m=o.y;var b=e.x1;var l=e.y1;var a=e.x2;var g=e.y2;var q=a-b;var p=g-l;var k=((q*(c-b))+(p*(m-l)))/(Math.pow(q,2)+Math.pow(p,2));var h,f;if(k<=0){h=b;f=l}else{if(k>=1){h=a;f=g}else{h=b+k*q;f=l+k*p}}return{distance:Math.sqrt(Math.pow(h-c,2)+Math.pow(f-m,2)),x:h,y:f}};OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:true,initialize:function(e,c,f,b){var a=[];f=OpenLayers.Util.upperCaseObject(f);a.push(e,c,f,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(f){f=this.adjustBounds(f);var e=this.projection.getCode().split(":");var c=e[e.length-1];var h=this.getImageSize();var k={BBOX:f.toBBOX(),SIZE:h.w+","+h.h,F:"image",BBOXSR:c,IMAGESR:c};if(this.layerDefs){var g=[];var a;for(a in this.layerDefs){if(this.layerDefs.hasOwnProperty(a)){if(this.layerDefs[a]){g.push(a);g.push(":");g.push(this.layerDefs[a]);g.push(";")}}}if(g.length>0){k.LAYERDEFS=g.join("")}}var b=this.getFullRequestString(k);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(e,c,f,b){var a=[];
a.push(e,c,f,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 e=this.map.getResolution();var f=Math.round((this.map.getScale()*10000))/10000;var b=Math.round(c.left/e);var a=-Math.round(c.top/e);return this.getFullRequestString({t:a,l:b,s:f})},addTile:function(c,a){var b=this.getURL(c);return new OpenLayers.Tile.Image(this,a,c,b,this.tileSize)},calculateGridLayout:function(a,s,f){var o=f*this.tileSize.w;var c=f*this.tileSize.h;var l=a.left;var p=Math.floor(l/o)-this.buffer;var m=l/o-p;var g=-m*this.tileSize.w;var q=p*o;var b=a.top;var k=Math.ceil(b/c)+this.buffer;var r=k-b/c;var e=-(r+1)*this.tileSize.h;var h=k*c;return{tilelon:o,tilelat:c,tileoffsetlon:q,tileoffsetlat:h,tileoffsetx:g,tileoffsety:e}},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 f=this.getResolution();var e=f*this.tileSize.w;var b=f*this.tileSize.h;var h=this.getLonLatFromViewPortPx(c);var a=e*Math.floor(h.lon/e);var g=b*Math.floor(h.lat/b);return new OpenLayers.Bounds(a,g,a+e,g+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:"PNG8",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,e,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 e;var b=a.getCenterLonLat();var k=this.map.getCurrentSize();if(this.singleTile){var f={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:k.h*this.ratio,setdisplaywidth:k.w*this.ratio,setviewcenterx:b.lon,setviewcentery:b.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var l={};l=OpenLayers.Util.extend(l,f);l.operation="GETVISIBLEMAPEXTENT";l.version="1.0.0";l.session=this.params.session;l.mapName=this.params.mapName;l.format="text/xml";e=this.getFullRequestString(l);OpenLayers.Request.GET({url:e,async:false})}e=this.getFullRequestString(f)}else{var h=this.map.getResolution();var g=Math.floor((a.left-this.maxExtent.left)/h);g=Math.round(g/this.tileSize.w);var c=Math.floor((this.maxExtent.top-a.top)/h);c=Math.round(c/this.tileSize.h);if(this.useHttpTile){e=this.getImageFilePath({tilecol:g,tilerow:c,scaleindex:this.resolutions.length-this.map.zoom-1})}else{e=this.getFullRequestString({tilecol:g,tilerow:c,scaleindex:this.resolutions.length-this.map.zoom-1})}}return e},getFullRequestString:function(g,f){var b=(f==null)?this.url:f;if(typeof b=="object"){b=b[Math.floor(Math.random()*b.length)]}var l=b;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(b));for(var k in h){if(k.toUpperCase() in e){delete h[k]}}var a=OpenLayers.Util.getParameterString(h);a=a.replace(/,/g,"+");if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){l+=a}else{if(b.indexOf("?")==-1){l+="?"+a}else{l+="&"+a}}}return l},getImageFilePath:function(h,f){var c=(f==null)?this.url:f;if(typeof c=="object"){c=c[Math.floor(Math.random()*c.length)]}var b=c;var e="";var g="";if(h.tilerow<0){e="-"}if(h.tilerow==0){e+="0"}else{e+=Math.floor(Math.abs(h.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(h.tilecol<0){g="-"}if(h.tilecol==0){g+="0"}else{g+=Math.floor(Math.abs(h.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var a="/S"+Math.floor(h.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+e+"/C"+g+"/"+(h.tilerow%this.params.tileRowsPerFolder)+"_"+(h.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){a+="?"+this.params.querystring}b+=a;return b},calculateGridLayout:function(a,s,f){var o=f*this.tileSize.w;var c=f*this.tileSize.h;var l=a.left-s.left;var p=Math.floor(l/o)-this.buffer;var m=l/o-p;var g=-m*this.tileSize.w;var q=s.left+p*o;var b=s.top-a.top+c;var k=Math.floor(b/c)-this.buffer;var r=k-b/c;var e=r*this.tileSize.h;var h=s.top-c*k;return{tilelon:o,tilelat:c,tileoffsetlon:q,tileoffsetlat:h,tileoffsetx:g,tileoffsety:e}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(e,c,f,b){var a=[];a.push(e,c,f,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 e=this.getImageSize();var a=this.getFullRequestString({mapext:b,imgext:b,map_size:[e.w,e.h],imgx:e.w/2,imgy:e.h/2,imgxy:[e.w,e.h]});return a},getFullRequestString:function(g,f){var b=(f==null)?this.url:f;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var a=OpenLayers.Util.getParameterString(h);if(b instanceof Array){b=this.selectUrl(a,b)}var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var k in h){if(k.toUpperCase() in e){delete h[k]}}a=OpenLayers.Util.getParameterString(h);var l=b;a=a.replace(/,/g,"+");if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){l+=a}else{if(b.indexOf("?")==-1){l+="?"+a}else{l+="&"+a}}}return l},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(e,c,b){var a=[];a.push(e,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(e){e=this.adjustBounds(e);var c=this.map.getResolution();var a=Math.round((e.left-this.tileOrigin.lon)/(c*this.tileSize.w));var h=Math.round((e.bottom-this.tileOrigin.lat)/(c*this.tileSize.h));var g=this.serverResolutions!=null?this.serverResolutions.indexOf(c):this.map.getZoom();var f=this.serviceVersion+"/"+this.layername+"/"+g+"/"+a+"/"+h+"."+this.type;var b=this.url;if(b instanceof Array){b=this.selectUrl(f,b)}return b+f},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,e,a){this.layername=e;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 g=this.map.getResolution();var h=this.maxExtent;var o=this.tileSize;var a=Math.round((b.left-h.left)/(g*o.w));var m=Math.round((b.bottom-h.bottom)/(g*o.h));var k=this.serverResolutions!=null?this.serverResolutions.indexOf(g):this.map.getZoom();function f(s,r){s=String(s);var p=[];for(var q=0;q<r;++q){p.push("0")}return p.join("").substring(0,r-s.length)+s}var e=[this.layername,f(k,2),f(parseInt(a/1000000),3),f((parseInt(a/1000)%1000),3),f((parseInt(a)%1000),3),f(parseInt(m/1000000),3),f((parseInt(m/1000)%1000),3),f((parseInt(m)%1000),3)+"."+this.extension];var l=e.join("/");var c=this.url;if(c instanceof Array){c=this.selectUrl(l,c)}c=(c.charAt(c.length-1)=="/")?c:c+"/";return c+l},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(e,c,f,b){var a=[];f=OpenLayers.Util.upperCaseObject(f);a.push(e,c,f,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 e={BBOX:this.encodeBBOX?b.toBBOX():b.toArray(),WIDTH:c.w,HEIGHT:c.h};var a=this.getFullRequestString(e);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(e,c,f,h,g,b){this.lzd=f;this.zoomLevels=h;var a=[];a.push(e,c,g,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(f){f=this.adjustBounds(f);var e=this.getZoom();var b=this.map.getMaxExtent();var c=this.lzd/Math.pow(2,this.getZoom());var a=Math.floor((f.left-b.left)/c);var g=Math.floor((f.bottom-b.bottom)/c);if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return this.getFullRequestString({L:e,X:a,Y:g})}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(e,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;e=e||this.name;var a=[e,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 e=this.map.getResolution();var h=Math.round((a.left-this.maxExtent.left)/(e*this.tileSize.w));var g=Math.round((this.maxExtent.top-a.top)/(e*this.tileSize.h));var f=this.map.getZoom();var c=Math.pow(2,f);var b=this.url;var l=""+h+g+f;if(b instanceof Array){b=this.selectUrl(l,b)}var k=OpenLayers.String.format(b,{x:h,y:g,z:f});return k},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,e=[];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}e.push(c)}a.next()}a.close();var f=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"read",features:e});if(b&&b.callback){b.callback.call(b.scope,f)}return f},unfreezeFeature:function(e){var a;var b=e.fieldByName("geometry");if(b==this.NULL_GEOMETRY){a=new OpenLayers.Feature.Vector()}else{a=this.wktParser.read(b)}a.attributes=this.jsonParser.read(e.fieldByName("properties"));a.fid=this.extractFidFromField(e.fieldByName("fid"));var c=e.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(f){if(!(f instanceof Array)){f=[f]}var c,a=f.length,b;var e=new Array(a);for(c=0;c<a;c++){b=f[c];var g=this.freezeFeature(b);this.db.execute("REPLACE INTO "+this.tableName+" (fid, geometry, properties, state) VALUES (?, ?, ?, ?)",g);var h=b.clone();h.fid=this.extractFidFromField(g[0]);e[c]=h}return new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,features:e,reqFeatures:f})},freezeFeature:function(b){b.fid=b.fid!=null?""+b.fid:OpenLayers.Util.createUniqueID(this.FID_PREFIX);var e=b.geometry!=null?b.geometry.toString():this.NULL_GEOMETRY;var a=this.jsonParser.write(b.attributes);var c=this.getFeatureStateForFreeze(b);return[b.fid,e,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(g,c){if(!(g instanceof Array)){g=[g]}c=OpenLayers.Util.applyDefaults(c,this.options);var f,a,e;for(f=0,a=g.length;f<a;f++){e=g[f];if(this.saveFeatureState&&!this.createdOffline(e)){var b=e.clone();b.fid=e.fid;if(b.geometry){b.geometry.destroy();b.geometry=null}b.state=e.state;this.createOrUpdate(b)}else{this.db.execute("DELETE FROM "+this.tableName+" WHERE fid = ?",[e.fid])}}var h=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"delete",reqFeatures:g});if(c&&c.callback){c.callback.call(c.scope,h)}return h},createdOffline:function(a){return(typeof a.fid=="string"&&!!(a.fid.match(this.fidRegExp)))},commit:function(c,p){var b,f=[],h=0,k=0;function m(q){if(++k<h){q.last=false}this.callUserCallback(p,q)}var o,l=[],a=[],e=[];for(var g=c.length-1;g>=0;g--){o=c[g];switch(o.state){case OpenLayers.State.INSERT:l.push(o);break;case OpenLayers.State.UPDATE:a.push(o);break;case OpenLayers.State.DELETE:e.push(o);break}}if(l.length>0){h++;b=OpenLayers.Util.applyDefaults({callback:m,scope:this},p.create);f.push(this.create(l,b))}if(a.length>0){h++;b=OpenLayers.Util.applyDefaults({callback:m,scope:this},p.update);f.push(this.update(a,b))}if(e.length>0){h++;b=OpenLayers.Util.applyDefaults({callback:m,scope:this},p["delete"]);f.push(this["delete"](e,b))}return f},clear:function(){this.db.execute("DELETE FROM "+this.tableName)},callUserCallback:function(a,c){var b=a[c.requestType];if(b&&b.callback){b.callback.call(b.scope,c)}if(c.last&&a.callback){a.callback.call(a.scope)}},CLASS_NAME:"OpenLayers.Protocol.SQL.Gears"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a in this.symbolizer){this.symbolizer[a]=null}this.symbolizer=null},evaluate:function(c){var b=this.getContext(c);var a=true;if(this.minScaleDenominator||this.maxScaleDenominator){var e=c.layer.map.getScale()}if(this.minScaleDenominator){a=e>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b)}if(a&&this.maxScaleDenominator){a=e<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,e,g,a){var f=[];for(var c in g){f.push(new OpenLayers.Rule({symbolizer:g[c],context:a,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:e,value:c})}))}this.styles[b].addRules(f)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Navigation(),new OpenLayers.Control.ZoomBox()])},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:true,lowerBoundary:null,upperBoundary:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(c){var a=false;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:var b=c[this.property];var f=this.value;if(!this.matchCase&&typeof b=="string"&&typeof f=="string"){a=(b.toUpperCase()==f.toUpperCase())}else{a=(b==f)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:var b=c[this.property];var f=this.value;if(!this.matchCase&&typeof b=="string"&&typeof f=="string"){a=(b.toUpperCase()!=f.toUpperCase())}else{a=(b!=f)}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 e=new RegExp(this.value,"gi");a=e.test(c[this.property]);break}return a},value2regex:function(e,b,a){if(e=="."){var c="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";OpenLayers.Console.error(c);return null}e=e?e:"*";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("\\"+e,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+e);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 e=c.fid||c.id;if(e==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 e=false;if(b){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,b.CLASS_NAME)>-1)){if(a!=null&&(a<this.components.length)){var f=this.components.slice(0,a);var c=this.components.slice(a,this.components.length);f.push(b);this.components=f.concat(c)}else{this.components.push(b)}b.parent=this;this.clearBounds();e=true}}return e},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 e=0;for(var c=0,a=this.components.length;c<a;c++){e+=this.components[c].getGeodesicArea(b)}return e},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(b){var e=0;for(var c=0,a=this.components.length;c<a;c++){e+=this.components[c].getGeodesicLength(b)}return e},move:function(b,e){for(var c=0,a=this.components.length;c<a;c++){this.components[c].move(b,e)}},rotate:function(e,b){for(var c=0,a=this.components.length;c<a;++c){this.components[c].rotate(e,b)}},resize:function(e,a,c){for(var b=0;b<this.components.length;++b){this.components[b].resize(e,a,c)}return this},distanceTo:function(h,k){var b=!(k&&k.edge===false);var a=b&&k&&k.details;var l,c;var e=Number.POSITIVE_INFINITY;for(var f=0,g=this.components.length;f<g;++f){l=this.components[f].distanceTo(h,k);distance=a?l.distance:l;if(distance<e){e=distance;c=l;if(e==0){break}}}return c},equals:function(e){var b=true;if(!e||!e.CLASS_NAME||(this.CLASS_NAME!=e.CLASS_NAME)){b=false}else{if(!(e.components instanceof Array)||(e.components.length!=this.components.length)){b=false}else{for(var c=0,a=this.components.length;c<a;++c){if(!this.components[c].equals(e.components[c])){b=false;break}}}}return b},transform:function(f,c){if(f&&c){for(var e=0,a=this.components.length;e<a;e++){var b=this.components[e];b.transform(f,c)}this.bounds=null}return this},intersects:function(e){var b=false;for(var c=0,a=this.components.length;c<a;++c){b=e.intersects(this.components[c]);if(b){break}}return b},getVertices:function(b){var c=[];for(var e=0,a=this.components.length;e<a;++e){Array.prototype.push.apply(c,this.components[e].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(g,m){var e=!(m&&m.edge===false);var a=e&&m&&m.details;var b,f,k,c,h,l;if(g instanceof OpenLayers.Geometry.Point){f=this.x;k=this.y;c=g.x;h=g.y;b=Math.sqrt(Math.pow(f-c,2)+Math.pow(k-h,2));l=!a?b:{x0:f,y0:k,x1:c,y1:h,distance:b}}else{l=g.distanceTo(this,m);if(a){l={x0:l.x1,y0:l.y1,x1:l.x0,y1:l.y0,distance:l.distance}}}return l},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(e,b){e*=Math.PI/180;var a=this.distanceTo(b);var c=e+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,e,c,a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=b;this.y=e;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,e,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 g=this.map.getResolution();var f=Math.round((this.map.getScale()*10000))/10000;var e=Math.round(a.left/g);var c=-Math.round(a.top/g);var l=Math.floor(e/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w;var k=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 h=[b,"/",this.params.map,"/",f,"/",this.params.g.replace(/\s/g,"_"),"/def/t",k,"/l",l,"/t",c,"l",e,".",this.extension];return h.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:true,initialize:function(c,b,f,a){OpenLayers.Layer.MapServer.prototype.initialize.apply(this,arguments);var e="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(e)},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 e=0,a=this.strategies.length;e<a;e++){this.strategies[e].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 e,b,a;for(b=0,a=this.strategies.length;b<a;b++){e=this.strategies[b];if(e.autoActivate){e.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(h,b,k){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var f=true;if(!k){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 g=this.map.getExtent();f=this.renderer.setExtent(g,b);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!b&&f){for(var e in this.unrenderedFeatures){var c=this.unrenderedFeatures[e];this.drawFeature(c)}}}if(!this.drawn||b||!f){this.drawn=true;var c;for(var e=0,a=this.features.length;e<a;e++){this.renderer.locked=(e!==(a-1));c=this.features[e];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,l){if(!(b instanceof Array)){b=[b]}var h=!l||!l.silent;if(h){var a={features:b};var g=this.events.triggerEvent("beforefeaturesadded",a);if(g===false){return}b=a.features}for(var c=0,f=b.length;c<f;c++){if(c!=(b.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var k=b[c];if(this.geometryType&&!(k.geometry instanceof this.geometryType)){var e=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw e}this.features.push(k);k.layer=this;if(!k.style&&this.style){k.style=OpenLayers.Util.extend({},this.style)}if(h){if(this.events.triggerEvent("beforefeatureadded",{feature:k})===false){continue}this.preFeatureInsert(k)}this.drawFeature(k);if(h){this.events.triggerEvent("featureadded",{feature:k});this.onFeatureInsert(k)}}if(h){this.events.triggerEvent("featuresadded",{features:b})}},removeFeatures:function(f,a){if(!f||f.length===0){return}if(!(f instanceof Array)){f=[f]}if(f===this.features){f=f.slice()}var e=!a||!a.silent;for(var c=f.length-1;c>=0;c--){if(c!=0&&f[c-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var b=f[c];delete this.unrenderedFeatures[b.id];if(e){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(e){this.events.triggerEvent("featureremoved",{feature:b})}}if(e){this.events.triggerEvent("featuresremoved",{features:f})}},destroyFeatures:function(e,a){var c=(e==undefined);if(c){e=this.features}if(e){this.removeFeatures(e,a);for(var b=e.length-1;b>=0;b--){e[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(e){var c=null;for(var b=0,a=this.features.length;b<a;++b){if(this.features[b].id==e){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,f,a){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);var e="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(e)},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 e=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(e.lon,e.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(e,b){b=b||{};var c=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:e});var a=this.protocol.read({maxFeatures:b.single==true?this.maxFeatures:undefined,filter:c,callback:function(f){if(f.code==1){if(f.features.length){if(b.single==true){this.selectBestFeature(f.features,e.getCenterLonLat(),b)}else{this.select(f.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,l){l=l||{};if(b.length){var h=new OpenLayers.Geometry.Point(a.lon,a.lat);var k,e,f;var g=Number.MAX_VALUE;for(var c=0;c<b.length;++c){k=b[c];if(k.geometry){f=h.distanceTo(k.geometry,{edge:false});if(f<g){g=f;e=k;if(g==0){break}}}}if(l.hover==true){this.hoverSelect(e)}else{this.select(e||b)}}},setModifiers:function(a){this.modifiers={multiple:this.multiple||(this.multipleKey&&a[this.multipleKey]),toggle:this.toggle||(this.toggleKey&&a[this.toggleKey])}},select:function(e){if(!this.modifiers.multiple&&!this.modifiers.toggle){this.unselectAll()}if(!(e instanceof Array)){e=[e]}var c;for(var b=0,a=e.length;b<a;++b){c=e[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 f=b.add(-this.clickTolerance/2,this.clickTolerance/2);var a=b.add(this.clickTolerance/2,-this.clickTolerance/2);var c=this.map.getLonLatFromPixel(f);var e=this.map.getLonLatFromPixel(a);return new OpenLayers.Bounds(c.lon,c.lat,e.lon,e.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesnap","snap","unsnap"],DEFAULTS:{tolerance:10,node:true,edge:true,vertex:true},greedy:true,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(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 e;for(var c=0,a=b.length;c<a;++c){e=b[c];if(e instanceof OpenLayers.Layer.Vector){this.addTargetLayer(e)}else{this.addTarget(e)}}}},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(k,e){var a={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null};var c=false;var l,g;for(var b=0,f=this.targets.length;b<f;++b){g=this.targets[b];l=this.testTarget(g,e);if(l){if(this.greedy){a=l;a.target=g;c=true;break}else{if((l.rank<a.rank)||(l.rank===a.rank&&l.dist<a.dist)){a=l;a.target=g;c=true}}}}if(c){var h=this.events.triggerEvent("beforesnap",{point:k,x:a.x,y:a.y,distance:a.dist,layer:a.target.layer,snapType:this.precedence[a.rank]});if(h!==false){k.x=a.x;k.y=a.y;this.point=k;this.events.triggerEvent("snap",{point:k,snapType:this.precedence[a.rank],layer:a.target.layer,distance:a.dist})}else{c=false}}if(this.point&&!c){k.x=e.x;k.y=e.y;this.point=null;this.events.triggerEvent("unsnap",{point:k})}},testTarget:function(E,g){var C={node:this.getGeoTolerance(E.nodeTolerance),vertex:this.getGeoTolerance(E.vertexTolerance),edge:this.getGeoTolerance(E.edgeTolerance)};var h=Math.max(C.node,C.vertex,C.edge);var l={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY};var f=false;var c=E.layer.features;var b,a,e,D,q,r,p;var o=this.precedence.length;var m=new OpenLayers.LonLat(g.x,g.y);for(var A=0,B=c.length;A<B;++A){b=c[A];if(b!==this.feature&&!b._sketch&&b.state!==OpenLayers.State.DELETE&&(!E.filter||E.filter.evaluate(b.attributes))){if(b.atPoint(m,h,h)){for(var z=0,s=Math.min(l.rank+1,o);z<s;++z){a=this.precedence[z];if(E[a]){if(a==="edge"){q=b.geometry.distanceTo(g,{details:true});r=q.distance;if(r<=C[a]&&r<l.dist){l={rank:z,dist:r,x:q.x0,y:q.y0};f=true;break}}else{e=b.geometry.getVertices(a==="node");p=false;for(var w=0,u=e.length;w<u;++w){D=e[w];r=D.distanceTo(g);if(r<=C[a]&&(z<l.rank||(z===l.rank&&r<l.dist))){l={rank:z,dist:r,x:D.x,y:D.y};f=true;p=true}}if(p){break}}}}}}}return f?l: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 e=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!e){throw"Can't find a Filter parser for version "+a}this.parser=new e(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 e=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!e){throw"Can't find a Filter parser for version "+a}this.parser=new e(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(e,c){var b=(c&&c.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=b){var f=OpenLayers.Format.SLD["v"+b.replace(/\./g,"_")];if(!f){throw"Can't find a SLD parser for version "+b}this.parser=new f(this.options)}var a=this.parser.write(e);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},read:function(f,c){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var b=f.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.SLD["v"+a.replace(/\./g,"_")];if(!g){throw"Can't find a SLD parser for version "+a}this.parser=new g(this.options)}var e=this.parser.read(f,c);return e},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(m){var a=m.split("\n");var b;var h=[];for(var B=0;B<(a.length-1);B++){var A=a[B].replace(/^\s*/,"").replace(/\s*$/,"");if(A.charAt(0)!="#"){if(!b){b=A.split("\t")}else{var p=A.split("\t");var e=new OpenLayers.Geometry.Point(0,0);var k={};var u=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null;var w,z,c,r;var o=false;for(var l=0;l<p.length;l++){if(p[l]){if(b[l]=="point"){var s=p[l].split(",");e.y=parseFloat(s[0]);e.x=parseFloat(s[1]);o=true}else{if(b[l]=="lat"){e.y=parseFloat(p[l]);o=true}else{if(b[l]=="lon"){e.x=parseFloat(p[l]);o=true}else{if(b[l]=="title"){k.title=p[l]}else{if(b[l]=="image"||b[l]=="icon"&&u){u.externalGraphic=p[l]}else{if(b[l]=="iconSize"&&u){var q=p[l].split(",");u.graphicWidth=parseFloat(q[0]);u.graphicHeight=parseFloat(q[1])}else{if(b[l]=="iconOffset"&&u){var g=p[l].split(",");u.graphicXOffset=parseFloat(g[0]);u.graphicYOffset=parseFloat(g[1])}else{if(b[l]=="description"){k.description=p[l]}else{if(b[l]=="overflow"){k.overflow=p[l]}else{k[b[l]]=p[l]}}}}}}}}}}}if(o){if(this.internalProjection&&this.externalProjection){e.transform(this.externalProjection,this.internalProjection)}var f=new OpenLayers.Feature.Vector(e,k,u);h.push(f)}}}}return h},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(e,c,b){var a=[];a.push(e,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 e=c.responseXML;if(!e||!e.documentElement){e=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(e));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(g){if(g.length<2){OpenLayers.Console.error("At least two point features have to be added to createa line from");return}var m=new Array(g.length-1);var h,a,k;for(var c=0,f=g.length;c<f;c++){h=g[c];k=h.geometry;if(!k){var e=h.lonlat;k=new OpenLayers.Geometry.Point(e.lon,e.lat)}else{if(k.CLASS_NAME!="OpenLayers.Geometry.Point"){OpenLayers.Console.error("Only features with point geometries are supported.");return}}if(c>0){var b=(this.dataFrom!=null)?(g[c+this.dataFrom].data||g[c+this.dataFrom].attributes):null;var l=new OpenLayers.Geometry.LineString([a,k]);m[c-1]=new OpenLayers.Feature.Vector(l,b)}a=k}this.addFeatures(m)},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 e=this.layers;var c;for(var b=0;b<e.length;b++){c=e[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(e,c,f,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(e,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(f,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,r){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments)}if(r){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 q=(this.tile==null);var h=(!q&&!this.tile.bounds.containsBounds(a));if(b||q||(!r&&h)){var c=a.getCenterLonLat();var p=a.getWidth()*this.ratio;var k=a.getHeight()*this.ratio;var m=new OpenLayers.Bounds(c.lon-(p/2),c.lat-(k/2),c.lon+(p/2),c.lat+(k/2));var s=this.map.getSize();s.w=s.w*this.ratio;s.h=s.h*this.ratio;var l=new OpenLayers.LonLat(m.left,m.top);var o=this.map.getLayerPxFromLonLat(l);var e=this.getFullRequestString();var g=null;var f=this.params.filter||this.params.FILTER;if(f){g={FILTER:f}}else{g={BBOX:this.encodeBBOX?m.toBBOX():m.toArray()}}if(this.map&&!this.projection.equals(this.map.getProjectionObject())){var u=m.clone();u.transform(this.map.getProjectionObject(),this.projection);if(!f){g.BBOX=this.encodeBBOX?u.toBBOX():u.toArray()}}e+="&"+OpenLayers.Util.getParameterString(g);if(!this.tile){this.tile=new OpenLayers.Tile.WFS(this,o,m,e,s);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,o,m,e,s);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 e=b.getWidth()*this.ratio;var c=b.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(a.lon-(e/2),a.lat-(c/2),a.lon+(e/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(h){this.layer.destroyFeatures();var f=h.features;if(f&&f.length>0){var g=this.layer.projection;var e=this.layer.map.getProjectionObject();if(!e.equals(g)){var c;for(var b=0,a=f.length;b<a;++b){c=f[b].geometry;if(c){c.transform(g,e)}}}this.layer.addFeatures(f)}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:this,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(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 g=this.layers||[this.layer];var f,e;for(var a=0;a<g.length;++a){f=g[a];for(var c=f.selectedFeatures.length-1;c>=0;--c){e=f.selectedFeatures[c];if(!b||b.except!=e){this.unselect(e)}}}},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 e=this.selectStyle||this.renderIntent;b.drawFeature(c,e);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(f){if(f instanceof OpenLayers.Bounds){var k=this.map.getLonLatFromPixel(new OpenLayers.Pixel(f.left,f.bottom));var o=this.map.getLonLatFromPixel(new OpenLayers.Pixel(f.right,f.top));var a=new OpenLayers.Bounds(k.lon,k.lat,o.lon,o.lat);if(!this.multipleSelect()){this.unselectAll()}var m=this.multiple;this.multiple=true;var e=this.layers||[this.layer];var g;for(var b=0;b<e.length;++b){g=e[b];for(var c=0,h=g.features.length;c<h;++c){var p=g.features[c];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,p.geometry.CLASS_NAME)>-1){if(a.toGeometry().intersects(p.geometry)){if(OpenLayers.Util.indexOf(g.selectedFeatures,p)==-1){this.select(p)}}}}}this.multiple=m}},setMap:function(a){this.handlers.feature.setMap(a);if(this.box){this.handlers.box.setMap(a)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(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(e,f){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(e,c);var g=e.getAttribute("wildCard");var b=e.getAttribute("singleChar");var a=e.getAttribute("escape");c.value2regex(g,b,a);f.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,e,b){var a=new OpenLayers.Filter.Spatial({type:b});this.readChildNodes(c,a);a.value=a.components[0];delete a.components;e.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 e=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],e)}}else{this.writeNode(this.getFilterType(c),c,e)}return e},FeatureId:function(a){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:a}})},And:function(c){var e=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,e)}return e},Or:function(c){var e=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,e)}return e},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 f=this;if(b){var c=new OpenLayers.Projection("EPSG:4326");if(!c.equals(b)){f=this.clone().transform(b,c)}}var g=0;if(f.components&&(f.components.length>1)){var k,h;for(var e=1,a=f.components.length;e<a;e++){k=f.components[e-1];h=f.components[e];g+=OpenLayers.Util.distVincenty({lon:k.x,lat:k.y},{lon:h.x,lat:h.y})}}return g*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(e,c){this.layer=e;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 g=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(e,a);var b={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(k,h){g.dragStart.apply(g,[k,h])},onDrag:function(k,h){g.dragVertex.apply(g,[k,h])},onComplete:function(h){g.dragComplete.apply(g,[h])}};this.dragControl=new OpenLayers.Control.DragFeature(e,b);var f={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,f)}},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(k){var e,f,l,g;if(k.CLASS_NAME=="OpenLayers.Geometry.Point"){f=new OpenLayers.Feature.Vector(k);f._sketch=true;a.vertices.push(f)}else{var c=k.components.length;if(k.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){c-=1}for(e=0;e<c;++e){l=k.components[e];if(l.CLASS_NAME=="OpenLayers.Geometry.Point"){f=new OpenLayers.Feature.Vector(l);f._sketch=true;a.vertices.push(f)}else{b(l)}}if(k.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(e=0,g=k.components.length;e<g-1;++e){var p=k.components[e];var q=k.components[e+1];if(p.CLASS_NAME=="OpenLayers.Geometry.Point"&&q.CLASS_NAME=="OpenLayers.Geometry.Point"){var m=(p.x+q.x)/2;var h=(p.y+q.y)/2;var o=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(m,h),null,a.virtualStyle);o.geometry.parent=k;o._index=e+1;o._sketch=true;a.virtualVertices.push(o)}}}}}b.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var e=this.feature.geometry;var a=e.getBounds().getCenterLonLat();var c=new OpenLayers.Geometry.Point(a.lon,a.lat);var b=new OpenLayers.Feature.Vector(c);c.move=function(f,g){OpenLayers.Geometry.Point.prototype.move.call(this,f,g);e.move(f,g)};b._sketch=true;this.dragHandle=b;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var k=this.feature.geometry;var a=k.getBounds();var b=a.getCenterLonLat();var l=new OpenLayers.Geometry.Point(b.lon,b.lat);var h=new OpenLayers.Geometry.Point(a.right,a.bottom);var g=new OpenLayers.Feature.Vector(h);var c=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var f=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var e=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);h.move=function(B,A){OpenLayers.Geometry.Point.prototype.move.call(this,B,A);var C=this.x-l.x;var u=this.y-l.y;var D=C-B;var w=u-A;if(e){var o=Math.atan2(w,D);var m=Math.atan2(u,C);var r=m-o;r*=180/Math.PI;k.rotate(r,l)}if(c){var q,z;if(f){q=u/w;z=(C/D)/q}else{var s=Math.sqrt((D*D)+(w*w));var p=Math.sqrt((C*C)+(u*u));q=p/s}k.resize(q,l,z)}};g._sketch=true;this.radiusHandle=g;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(o){var c=false;var m=o.CLASS_NAME;if(m=="OpenLayers.Geometry.LineString"||m=="OpenLayers.Geometry.LinearRing"||m=="OpenLayers.Geometry.Point"){var r=this.getSortedSegments();var p;if(m=="OpenLayers.Geometry.Point"){p=[{x1:o.x,y1:o.y,x2:o.x,y2:o.y}]}else{p=o.getSortedSegments()}var w,h,f,a,u,s,e,b;outer:for(var k=0,l=r.length;k<l;++k){w=r[k];h=w.x1;f=w.x2;a=w.y1;u=w.y2;inner:for(var g=0,q=p.length;g<q;++g){s=p[g];if(s.x1>f){break}if(s.x2<h){continue}e=s.y1;b=s.y2;if(Math.min(e,b)>Math.max(a,u)){continue}if(Math.max(e,b)<Math.min(a,u)){continue}if(OpenLayers.Geometry.segmentsIntersect(w,s)){c=true;break outer}}}}else{c=o.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 e(g,f){return g.x1-f.x1}return b.sort(e)},splitWithSegment:function(w,b){var c=!(b&&b.edge===false);var r=b&&b.tolerance;var a=[];var A=this.getVertices();var q=[];var C=[];var k=false;var f,e,o;var l,u,B;var g={point:true,tolerance:r};var h=null;for(var p=0,m=A.length-2;p<=m;++p){f=A[p];q.push(f.clone());e=A[p+1];B={x1:f.x,y1:f.y,x2:e.x,y2:e.y};o=OpenLayers.Geometry.segmentsIntersect(w,B,g);if(o instanceof OpenLayers.Geometry.Point){if((o.x===w.x1&&o.y===w.y1)||(o.x===w.x2&&o.y===w.y2)||o.equals(f)||o.equals(e)){u=true}else{u=false}if(u||c){if(!o.equals(C[C.length-1])){C.push(o.clone())}if(p===0){if(o.equals(f)){continue}}if(o.equals(e)){continue}k=true;if(!o.equals(f)){q.push(o)}a.push(new OpenLayers.Geometry.LineString(q));q=[o.clone()]}}}if(k){q.push(e.clone());a.push(new OpenLayers.Geometry.LineString(q))}if(C.length>0){var s=w.x1<w.x2?1:-1;var z=w.y1<w.y2?1:-1;h={lines:a,points:C.sort(function(E,D){return(s*E.x-s*D.x)||(z*E.y-z*D.y)})}}return h},split:function(D,b){var p=null;var e=b&&b.mutual;var m,f,o,c;if(D instanceof OpenLayers.Geometry.LineString){var C=this.getVertices();var h,g,B,l,a,r;var w=[];o=[];for(var z=0,q=C.length-2;z<=q;++z){h=C[z];g=C[z+1];B={x1:h.x,y1:h.y,x2:g.x,y2:g.y};c=c||[D];if(e){w.push(h.clone())}for(var u=0;u<c.length;++u){l=c[u].splitWithSegment(B,b);if(l){a=l.lines;if(a.length>0){a.unshift(u,1);Array.prototype.splice.apply(c,a);u+=a.length-2}if(e){for(var s=0,A=l.points.length;s<A;++s){r=l.points[s];if(!r.equals(h)){w.push(r);o.push(new OpenLayers.Geometry.LineString(w));if(r.equals(g)){w=[]}else{w=[r.clone()]}}}}}}}if(e&&o.length>0&&w.length>0){w.push(g.clone());o.push(new OpenLayers.Geometry.LineString(w))}}else{p=D.splitWith(this,b)}if(c&&c.length>1){f=true}else{c=[]}if(o&&o.length>1){m=true}else{o=[]}if(f||m){if(e){p=[o,c]}else{p=c}}return p},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(k,h){var l=!(h&&h.edge===false);var F=l&&h&&h.details;var s,f={};var z=Number.POSITIVE_INFINITY;if(k instanceof OpenLayers.Geometry.Point){var u=this.getSortedSegments();var r=k.x;var q=k.y;var D;for(var B=0,C=u.length;B<C;++B){D=u[B];s=OpenLayers.Geometry.distanceToSegment(k,D);if(s.distance<z){z=s.distance;f=s;if(z===0){break}}else{if(D.x2>r&&((q>D.y1&&q<D.y2)||(q<D.y1&&q>D.y2))){break}}}if(F){f={distance:f.distance,x0:f.x,y0:f.y,x1:r,y1:q}}else{f=f.distance}}else{if(k instanceof OpenLayers.Geometry.LineString){var e=this.getSortedSegments();
var c=k.getSortedSegments();var b,a,p,E,g;var o=c.length;var m={point:true};outer:for(var B=0,C=e.length;B<C;++B){b=e[B];E=b.x1;g=b.y1;for(var A=0;A<o;++A){a=c[A];p=OpenLayers.Geometry.segmentsIntersect(b,a,m);if(p){z=0;f={distance:0,x0:p.x,y0:p.y,x1:p.x,y1:p.y};break outer}else{s=OpenLayers.Geometry.distanceToSegment({x:E,y:g},a);if(s.distance<z){z=s.distance;f={distance:z,x0:E,y0:g,x1:s.x,y1:s.y}}}}}if(!F){f=f.distance}if(z!==0){if(b){s=k.distanceTo(new OpenLayers.Geometry.Point(b.x2,b.y2),h);var w=F?s.distance:s;if(w<z){if(F){f={distance:z,x0:s.x1,y0:s.y1,x1:s.x0,y1:s.y0}}else{f=w}}}}}else{f=k.distanceTo(this,h);if(F){f={distance:f.distance,x0:f.x1,y0:f.y1,x1:f.x0,y1:f.y0}}}}return f},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(D){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var c=[];if(this.extractTracks){var z=D.getElementsByTagName("trk");for(var w=0,A=z.length;w<A;w++){var p={};if(this.extractAttributes){p=this.parseAttributes(z[w])}var m=this.getElementsByTagNameNS(z[w],z[w].namespaceURI,"trkseg");for(var u=0,h=m.length;u<h;u++){var o=this.extractSegment(m[u],"trkpt");c.push(new OpenLayers.Feature.Vector(o,p))}}}if(this.extractRoutes){var a=D.getElementsByTagName("rte");for(var s=0,r=a.length;s<r;s++){var p={};if(this.extractAttributes){p=this.parseAttributes(a[s])}var C=this.extractSegment(a[s],"rtept");c.push(new OpenLayers.Feature.Vector(C,p))}}if(this.extractWaypoints){var b=D.getElementsByTagName("wpt");for(var q=0,A=b.length;q<A;q++){var p={};if(this.extractAttributes){p=this.parseAttributes(b[q])}var f=new OpenLayers.Geometry.Point(b[q].getAttribute("lon"),b[q].getAttribute("lat"));c.push(new OpenLayers.Feature.Vector(f,p))}}if(this.internalProjection&&this.externalProjection){for(var B=0,e=c.length;B<e;B++){c[B].geometry.transform(this.externalProjection,this.internalProjection)}}return c},extractSegment:function(f,g){var e=this.getElementsByTagNameNS(f,f.namespaceURI,g);var b=[];for(var c=0,a=e.length;c<a;c++){b.push(new OpenLayers.Geometry.Point(e[c].getAttribute("lon"),e[c].getAttribute("lat")))}return new OpenLayers.Geometry.LineString(b)},parseAttributes:function(b){var a={};var e=b.firstChild;while(e){if(e.nodeType==1){var c=e.firstChild;if(c.nodeType==3||c.nodeType==4){name=(e.prefix)?e.nodeName.split(":")[1]:e.nodeName;if(name!="trkseg"&&name!="rtept"){a[name]=c.nodeValue}}}e=e.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 e=this.components.pop();if(b!=null||!a.equals(e)){c=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var f=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[f]);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,e){for(var c=0,a=this.components.length;c<a-1;c++){this.components[c].move(b,e)}},rotate:function(e,b){for(var c=0,a=this.components.length;c<a-1;++c){this.components[c].rotate(e,b)}},resize:function(f,b,e){for(var c=0,a=this.components.length;c<a-1;++c){this.components[c].resize(f,b,e)}return this},transform:function(f,c){if(f&&c){for(var e=0,a=this.components.length;e<a-1;e++){var b=this.components[e];b.transform(f,c)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var k=0;var h=0;for(var f=0;f<this.components.length-1;f++){var e=this.components[f];var m=this.components[f+1];k+=(e.x+m.x)*(e.x*m.y-m.x*e.y);h+=(e.y+m.y)*(e.x*m.y-m.x*e.y)}var g=-1*this.getArea();var a=k/(6*g);var l=h/(6*g)}return new OpenLayers.Geometry.Point(a,l)},getArea:function(){var h=0;if(this.components&&(this.components.length>2)){var g=0;for(var f=0,e=this.components.length;f<e-1;f++){var a=this.components[f];var k=this.components[f+1];g+=(a.x+k.x)*(k.y-a.y)}h=-g/2}return h},getGeodesicArea: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 g=0;var a=e.components&&e.components.length;if(a>2){var k,h;for(var f=0;f<a-1;f++){k=e.components[f];h=e.components[f+1];g+=OpenLayers.Util.rad(h.x-k.x)*(2+Math.sin(OpenLayers.Util.rad(k.y))+Math.sin(OpenLayers.Util.rad(h.y)))}g=g*6378137*6378137/2}return g},containsPoint:function(p){var z=OpenLayers.Number.limitSigDigs;var o=14;var m=z(p.x,o);var l=z(p.y,o);function w(E,B,D,A,C){return(((B-A)*E)+((A*D)-(B*C)))/(D-C)}var a=this.components.length-1;var h,g,u,e,r,b,f,c;var k=0;for(var q=0;q<a;++q){h=this.components[q];u=z(h.x,o);e=z(h.y,o);g=this.components[q+1];r=z(g.x,o);b=z(g.y,o);if(e==b){if(l==e){if(u<=r&&(m>=u&&m<=r)||u>=r&&(m<=u&&m>=r)){k=-1;break}}continue}f=z(w(l,u,e,r,b),o);if(f==m){if(e<b&&(l>=e&&l<=b)||e>b&&(l<=e&&l>=b)){k=-1;break}}if(f<=m){continue}if(u!=r&&(f<Math.min(u,r)||f>Math.max(u,r))){continue}if(e<b&&(l>=e&&l<b)||e>b&&(l<e&&l>=b)){++k}}var s=(k==-1)?1:!!(k&1);return s},intersects:function(e){var b=false;if(e.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(e)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LineString"){b=e.intersects(this)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[e])}else{for(var c=0,a=e.components.length;c<a;++c){b=e.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(p,w){var h=null;var u=w&&w.mutual;var q,a,s,o,b;var f=[];var r=[p];for(var g=0,l=this.components.length;g<l;++g){a=this.components[g];o=false;for(var e=0;e<r.length;++e){q=a.split(r[e],w);if(q){if(u){s=q[0];for(var c=0,m=s.length;c<m;++c){if(c===0&&f.length){f[f.length-1].addComponent(s[c])}else{f.push(new OpenLayers.Geometry.MultiLineString([s[c]]))}}o=true;q=q[1]}if(q.length){q.unshift(e,1);Array.prototype.splice.apply(r,q);break}}}if(!o){if(f.length){f[f.length-1].addComponent(a.clone())}else{f=[new OpenLayers.Geometry.MultiLineString(a.clone())]}}}if(f&&f.length>1){o=true}else{f=[]}if(r&&r.length>1){b=true}else{r=[]}if(o||b){if(u){h=[f,r]}else{h=r}}return h},splitWith:function(p,w){var h=null;var u=w&&w.mutual;var q,c,s,o,a,f,r;if(p instanceof OpenLayers.Geometry.LineString){r=[];f=[p];for(var g=0,l=this.components.length;g<l;++g){a=false;c=this.components[g];for(var e=0;e<f.length;++e){q=f[e].split(c,w);if(q){if(u){s=q[0];if(s.length){s.unshift(e,1);Array.prototype.splice.apply(f,s);e+=s.length-2}q=q[1];if(q.length===0){q=[c.clone()]}}for(var b=0,m=q.length;b<m;++b){if(b===0&&r.length){r[r.length-1].addComponent(q[b])}else{r.push(new OpenLayers.Geometry.MultiLineString([q[b]]))}}a=true}}if(!a){if(r.length){r[r.length-1].addComponent(c.clone())}else{r=[new OpenLayers.Geometry.MultiLineString([c.clone()])]}}}}else{h=p.split(this)}if(f&&f.length>1){o=true}else{f=[]}if(r&&r.length>1){a=true}else{r=[]}if(o||a){if(u){h=[f,r]}else{h=r}}return h},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,e){for(var b=0,a=c.length;b<a;++b){if(c[b].geometry===e){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 g=this.layer&&this.layer.features||[];var D,q,h,a;var m=[],C=[];var e=(this.layer===this.source)&&this.mutual;var b={edge:this.edge,tolerance:this.tolerance,mutual:e};var l=[c.geometry];var p,f;var s,r;for(var A=0,B=g.length;A<B;++A){p=g[A];if(this.isEligible(p)){f=[p.geometry];for(var z=0;z<l.length;++z){s=l[z];for(var u=0;u<f.length;++u){D=f[u];if(s.getBounds().intersectsBounds(D.getBounds())){q=s.split(D,b);if(q){a=this.events.triggerEvent("beforesplit",{source:c,target:p});if(a!==false){if(e){r=q[0];if(r.length>1){r.unshift(z,1);Array.prototype.splice.apply(l,r);z+=r.length-3}q=q[1]}if(q.length>1){q.unshift(u,1);Array.prototype.splice.apply(f,q);u+=q.length-3}}}}}}if(f&&f.length>1){this.geomsToFeatures(p,f);this.events.triggerEvent("split",{original:p,features:f});Array.prototype.push.apply(m,f);C.push(p);targetSplit=true}}}if(l&&l.length>1){this.geomsToFeatures(c,l);this.events.triggerEvent("split",{original:c,features:l});Array.prototype.push.apply(m,l);C.push(c);sourceSplit=true}if(sourceSplit||targetSplit){if(this.deferDelete){var o,w=[];for(var A=0,B=C.length;A<B;++A){o=C[A];if(o.state===OpenLayers.State.INSERT){w.push(o)}else{o.state=OpenLayers.State.DELETE;this.layer.drawFeature(o)}}this.layer.destroyFeatures(w,{silent:true});for(var A=0,B=m.length;A<B;++A){m[A].state=OpenLayers.State.INSERT}}else{this.layer.destroyFeatures(C,{silent:true})}this.layer.addFeatures(m,{silent:true});this.events.triggerEvent("aftersplit",{source:c,features:m})}}return sourceSplit},geomsToFeatures:function(c,e){var g=c.clone();delete g.geometry;var f;for(var b=0,a=e.length;b<a;++b){f=g.clone();f.geometry=e[b];f.state=OpenLayers.State.INSERT;e[b]=f}},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 e=0;if(this.components&&(this.components.length>0)){e+=Math.abs(this.components[0].getGeodesicArea(b));for(var c=1,a=this.components.length;c<a;c++){e-=Math.abs(this.components[c].getGeodesicArea(b))}}return e},containsPoint:function(a){var f=this.components.length;var c=false;if(f>0){c=this.components[0].containsPoint(a);if(c!==1){if(c&&f>1){var e;for(var b=1;b<f;++b){e=this.components[b].containsPoint(a);if(e){if(e===1){c=1}else{c=false}break}}}}}return c},intersects:function(f){var b=false;var e,a;if(f.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(f)}else{if(f.CLASS_NAME=="OpenLayers.Geometry.LineString"||f.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(e=0,a=this.components.length;e<a;++e){b=f.intersects(this.components[e]);if(b){break}}if(!b){for(e=0,a=f.components.length;e<a;++e){b=this.containsPoint(f.components[e]);if(b){break}}}}else{for(e=0,a=f.components.length;e<a;++e){b=this.intersects(f.components[e]);
if(b){break}}}}if(!b&&f.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var c=this.components[0];for(e=0,a=c.components.length;e<a;++e){b=f.containsPoint(c.components[e]);if(b){break}}}return b},distanceTo:function(e,b){var c=!(b&&b.edge===false);var a;if(!c&&this.intersects(e)){a=0}else{a=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[e,b])}return a},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(l,g,b,o){var c=Math.PI*((1/b)-(1/2));if(o){c+=(o/180)*Math.PI}var a,k,h;var m=[];for(var f=0;f<b;++f){a=c+(f*2*Math.PI/b);k=l.x+(g*Math.cos(a));h=l.y+(g*Math.sin(a));m.push(new OpenLayers.Geometry.Point(k,h))}var e=new OpenLayers.Geometry.LinearRing(m);return new OpenLayers.Geometry.Polygon([e])};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(q){var p=this.getElementsByTagNameNS(q,this.georssns,"point");var h=this.getElementsByTagNameNS(q,this.geons,"lat");var a=this.getElementsByTagNameNS(q,this.geons,"long");var s=this.getElementsByTagNameNS(q,this.georssns,"line");var m=this.getElementsByTagNameNS(q,this.georssns,"polygon");var c=this.getElementsByTagNameNS(q,this.georssns,"where");var e=this.getElementsByTagNameNS(q,this.georssns,"box");if(p.length>0||(h.length>0&&a.length>0)){var o;if(p.length>0){o=OpenLayers.String.trim(p[0].firstChild.nodeValue).split(/\s+/);if(o.length!=2){o=OpenLayers.String.trim(p[0].firstChild.nodeValue).split(/\s*,\s*/)}}else{o=[parseFloat(h[0].firstChild.nodeValue),parseFloat(a[0].firstChild.nodeValue)]}var k=new OpenLayers.Geometry.Point(parseFloat(o[1]),parseFloat(o[0]))}else{if(s.length>0){var l=OpenLayers.String.trim(this.concatChildValues(s[0])).split(/\s+/);var f=[];var p;for(var b=0,g=l.length;b<g;b+=2){p=new OpenLayers.Geometry.Point(parseFloat(l[b+1]),parseFloat(l[b]));f.push(p)}k=new OpenLayers.Geometry.LineString(f)}else{if(m.length>0){var l=OpenLayers.String.trim(this.concatChildValues(m[0])).split(/\s+/);var f=[];var p;for(var b=0,g=l.length;b<g;b+=2){p=new OpenLayers.Geometry.Point(parseFloat(l[b+1]),parseFloat(l[b]));f.push(p)}k=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(f)])}else{if(c.length>0){if(!this.gmlParser){this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})}var r=this.gmlParser.parseFeature(c[0]);k=r.geometry}else{if(e.length>0){var l=OpenLayers.String.trim(e[0].firstChild.nodeValue).split(/\s+/);var f=[];var p;if(l.length>3){p=new OpenLayers.Geometry.Point(parseFloat(l[1]),parseFloat(l[0]));f.push(p);p=new OpenLayers.Geometry.Point(parseFloat(l[1]),parseFloat(l[2]));f.push(p);p=new OpenLayers.Geometry.Point(parseFloat(l[3]),parseFloat(l[2]));f.push(p);p=new OpenLayers.Geometry.Point(parseFloat(l[3]),parseFloat(l[0]));f.push(p);p=new OpenLayers.Geometry.Point(parseFloat(l[1]),parseFloat(l[0]));f.push(p)}k=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(f)])}}}}}if(k&&this.internalProjection&&this.externalProjection){k.transform(this.externalProjection,this.internalProjection)}return k},createFeatureFromItem:function(l){var f=this.createGeometryFromItem(l);var h=this.getChildValue(l,"*","title",this.featureTitle);var k=this.getChildValue(l,"*","description",this.getChildValue(l,"*","content",this.getChildValue(l,"*","summary",this.featureDescription)));var g=this.getChildValue(l,"*","link");if(!g){try{g=this.getElementsByTagNameNS(l,"*","link")[0].getAttribute("href")}catch(c){g=null}}var a=this.getChildValue(l,"*","id",null);var b={title:h,description:k,link:g};var m=new OpenLayers.Feature.Vector(f,b);m.fid=a;return m},getChildValue:function(e,b,c,g){var f;var a=this.getElementsByTagNameNS(e,b,c);if(a&&a[0]&&a[0].firstChild&&a[0].firstChild.nodeValue){f=a[0].firstChild.nodeValue}else{f=(g==undefined)?"":g}return f},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var a=null;a=this.getElementsByTagNameNS(f,"*","item");if(a.length==0){a=this.getElementsByTagNameNS(f,"*","entry")}var c=a.length;var e=new Array(c);for(var b=0;b<c;b++){e[b]=this.createFeatureFromItem(a[b])}return e},write:function(c){var e;if(c instanceof Array){e=this.createElementNS(this.rssns,"rss");for(var b=0,a=c.length;b<a;b++){e.appendChild(this.createFeatureXML(c[b]))}}else{e=this.createFeatureXML(c)}return OpenLayers.Format.XML.prototype.write.apply(this,[e])},createFeatureXML:function(m){var g=this.buildGeometryNode(m.geometry);var a=this.createElementNS(this.rssns,"item");var e=this.createElementNS(this.rssns,"title");e.appendChild(this.createTextNode(m.attributes.title?m.attributes.title:""));var b=this.createElementNS(this.rssns,"description");b.appendChild(this.createTextNode(m.attributes.description?m.attributes.description:""));a.appendChild(e);a.appendChild(b);if(m.attributes.link){var k=this.createElementNS(this.rssns,"link");k.appendChild(this.createTextNode(m.attributes.link));a.appendChild(k)}for(var l in m.attributes){if(l=="link"||l=="title"||l=="description"){continue}var h=this.createTextNode(m.attributes[l]);var f=l;if(l.search(":")!=-1){f=l.split(":")[1]}var c=this.createElementNS(this.featureNS,"feature:"+f);c.appendChild(h);a.appendChild(c)}a.appendChild(g);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(g){var c=null;if(g.components){c=g.components}var f;if(c){var b=c.length;var e=new Array(b);for(var a=0;a<b;a++){e[a]=c[a].y+" "+c[a].x}f=e.join(" ")}else{f=g.y+" "+g.x}return this.createTextNode(f)},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(h,c){if(typeof h=="string"){h=OpenLayers.Format.XML.prototype.read.apply(this,[h])}var f=["Link","NetworkLink","Style","StyleMap","Placemark"];for(var e=0,a=f.length;e<a;++e){var g=f[e];var b=this.getElementsByTagNameNS(h,"*",g);if(b.length==0){continue}switch(g.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,e){if(e.depth>=this.maxDepth){return false}var h=OpenLayers.Util.extend({},e);h.depth++;for(var f=0,a=c.length;f<a;f++){var b=this.parseProperty(c[f],"*","href");
if(b&&!this.fetched[b]){this.fetched[b]=true;var g=this.fetchLink(b);if(g){this.parseData(g,h)}}}},fetchLink:function(a){var b=OpenLayers.Request.GET({url:a,async:false});if(b){return b.responseText}},parseStyles:function(b,c){for(var e=0,a=b.length;e<a;e++){var f=this.parseStyle(b[e]);if(f){styleName=(c.styleBaseUrl||"")+"#"+f.id;this.styles[styleName]=f}}},parseStyle:function(D){var O={};var M=["LineStyle","PolyStyle","IconStyle","BalloonStyle"];var W,m,o,A;for(var R=0,q=M.length;R<q;++R){W=M[R];styleTypeNode=this.getElementsByTagNameNS(D,"*",W)[0];if(!styleTypeNode){continue}switch(W.toLowerCase()){case"linestyle":var z=this.parseProperty(styleTypeNode,"*","color");if(z){var c=(z.toString()).match(this.regExes.kmlColor);var P=c[1];O.strokeOpacity=parseInt(P,16)/255;var V=c[2];var T=c[3];var N=c[4];O.strokeColor="#"+N+T+V}var a=this.parseProperty(styleTypeNode,"*","width");if(a){O.strokeWidth=a}case"polystyle":var z=this.parseProperty(styleTypeNode,"*","color");if(z){var c=(z.toString()).match(this.regExes.kmlColor);var P=c[1];O.fillOpacity=parseInt(P,16)/255;var V=c[2];var T=c[3];var N=c[4];O.fillColor="#"+N+T+V}var p=this.parseProperty(styleTypeNode,"*","fill");if(p=="0"){O.fillColor="none"}break;case"iconstyle":var E=parseFloat(this.parseProperty(styleTypeNode,"*","scale")||1);var a=32*E;var e=32*E;var f=this.getElementsByTagNameNS(styleTypeNode,"*","Icon")[0];if(f){var u=this.parseProperty(f,"*","href");if(u){var L=this.parseProperty(f,"*","w");var S=this.parseProperty(f,"*","h");var l="http://maps.google.com/mapfiles/kml";if(OpenLayers.String.startsWith(u,l)&&!L&&!S){L=64;S=64;E=E/2}L=L||S;S=S||L;if(L){a=parseInt(L)*E}if(S){e=parseInt(S)*E}var c=u.match(this.regExes.kmlIconPalette);if(c){var Q=c[1];var s=c[2];var K=this.parseProperty(f,"*","x");var J=this.parseProperty(f,"*","y");var G=K?K/32:0;var F=J?(7-J/32):7;var C=F*8+G;u="http://maps.google.com/mapfiles/kml/pal"+Q+"/icon"+C+s}O.graphicOpacity=1;O.externalGraphic=u}}var I=this.getElementsByTagNameNS(styleTypeNode,"*","hotSpot")[0];if(I){var K=parseFloat(I.getAttribute("x"));var J=parseFloat(I.getAttribute("y"));var B=I.getAttribute("xunits");if(B=="pixels"){O.graphicXOffset=-K*E}else{if(B=="insetPixels"){O.graphicXOffset=-a+(K*E)}else{if(B=="fraction"){O.graphicXOffset=-a*K}}}var k=I.getAttribute("yunits");if(k=="pixels"){O.graphicYOffset=-e+(J*E)+1}else{if(k=="insetPixels"){O.graphicYOffset=-(J*E)+1}else{if(k=="fraction"){O.graphicYOffset=-e*(1-J)+1}}}}O.graphicWidth=a;O.graphicHeight=e;break;case"balloonstyle":var U=OpenLayers.Util.getXmlNodeValue(styleTypeNode);if(U){O.balloonStyle=U.replace(this.regExes.straightBracket,"${$1}")}break;default:}}if(!O.strokeColor&&O.fillColor){O.strokeColor=O.fillColor}var H=D.getAttribute("id");if(H&&O){O.id=H}return O},parseStyleMaps:function(a,p){for(var h=0,k=a.length;h<k;h++){var e=a[h];var c=this.getElementsByTagNameNS(e,"*","Pair");var b=e.getAttribute("id");for(var g=0,o=c.length;g<o;g++){var f=c[g];var m=this.parseProperty(f,"*","key");var l=this.parseProperty(f,"*","styleUrl");if(l&&m=="normal"){this.styles[(p.styleBaseUrl||"")+"#"+b]=this.styles[(p.styleBaseUrl||"")+l]}if(l&&m=="highlight"){}}}},parseFeatures:function(a,l){var e=new Array(a.length);for(var f=0,g=a.length;f<g;f++){var b=a[f];var k=this.parseFeature.apply(this,[b]);if(k){if(this.extractStyles&&k.attributes&&k.attributes.styleUrl){k.style=this.getStyle(k.attributes.styleUrl,l)}if(this.extractStyles){var h=this.getElementsByTagNameNS(b,"*","Style")[0];if(h){var c=this.parseStyle(h);if(c){k.style=OpenLayers.Util.extend(k.style,c)}}}e[f]=k}else{throw"Bad Placemark: "+f}}this.features=this.features.concat(e)},parseFeature:function(b){var c=["MultiGeometry","Polygon","LineString","Point"];var l,f,m,a;for(var h=0,k=c.length;h<k;++h){l=c[h];this.internalns=b.namespaceURI?b.namespaceURI:this.kmlns;f=this.getElementsByTagNameNS(b,this.internalns,l);if(f.length>0){var a=this.parseGeometry[l.toLowerCase()];if(a){m=a.apply(this,[f[0]]);if(this.internalProjection&&this.externalProjection){m.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:l}))}break}}var g;if(this.extractAttributes){g=this.parseAttributes(b)}var o=new OpenLayers.Feature.Vector(m,g);var e=b.getAttribute("id")||b.getAttribute("name");if(e!=null){o.fid=e}return o},getStyle:function(b,a){var c=OpenLayers.Util.removeTail(b);var g=OpenLayers.Util.extend({},a);g.depth++;g.styleBaseUrl=c;if(!this.styles[b]&&!OpenLayers.String.startsWith(b,"#")&&g.depth<=this.maxDepth&&!this.fetched[c]){var f=this.fetchLink(c);if(f){this.parseData(f,g)}}var e=OpenLayers.Util.extend({},this.styles[b]);return e},parseGeometry:{point:function(e){var c=this.getElementsByTagNameNS(e,this.internalns,"coordinates");var f=[];if(c.length>0){var b=c[0].firstChild.nodeValue;b=b.replace(this.regExes.removeSpace,"");f=b.split(",")}var a=null;if(f.length>1){if(f.length==2){f[2]=null}a=new OpenLayers.Geometry.Point(f[0],f[1],f[2])}else{throw"Bad coordinate string: "+b}return a},linestring:function(c,f){var e=this.getElementsByTagNameNS(c,this.internalns,"coordinates");var o=null;if(e.length>0){var b=this.getChildValue(e[0]);b=b.replace(this.regExes.trimSpace,"");b=b.replace(this.regExes.trimComma,",");var a=b.split(this.regExes.splitSpace);var k=a.length;var m=new Array(k);var l,h;for(var g=0;g<k;++g){l=a[g].split(",");h=l.length;if(h>1){if(l.length==2){l[2]=null}m[g]=new OpenLayers.Geometry.Point(l[0],l[1],l[2])}else{throw"Bad LineString point coordinates: "+a[g]}}if(k){if(f){o=new OpenLayers.Geometry.LinearRing(m)}else{o=new OpenLayers.Geometry.LineString(m)}}else{throw"Bad LineString coordinates: "+b}}return o},polygon:function(g){var c=this.getElementsByTagNameNS(g,this.internalns,"LinearRing");var h=c.length;var f=new Array(h);if(h>0){var b;for(var e=0,a=c.length;e<a;++e){b=this.parseGeometry.linestring.apply(this,[c[e],true]);if(b){f[e]=b}else{throw"Bad LinearRing geometry: "+e}}}return new OpenLayers.Geometry.Polygon(f)},multigeometry:function(f){var k,h;var g=[];var c=f.childNodes;for(var b=0,a=c.length;b<a;++b){k=c[b];if(k.nodeType==1){var e=(k.prefix)?k.nodeName.split(":")[1]:k.nodeName;var h=this.parseGeometry[e.toLowerCase()];if(h){g.push(h.apply(this,[k]))}}}return new OpenLayers.Geometry.Collection(g)}},parseAttributes:function(e){var f={};var g=e.getElementsByTagName("ExtendedData");if(g.length){f=this.parseExtendedData(g[0])}var b,o,m;var c=e.childNodes;for(var h=0,k=c.length;h<k;++h){b=c[h];if(b.nodeType==1){o=b.childNodes;if(o.length==1||o.length==3){var m;switch(o.length){case 1:m=o[0];break;case 3:default:m=o[1];break}if(m.nodeType==3||m.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var l=OpenLayers.Util.getXmlNodeValue(m);if(l){l=l.replace(this.regExes.trimSpace,"");f[a]=l}}}}}return f},parseExtendedData:function(b){var e={};var c=b.getElementsByTagName("Data");for(var g=0,k=c.length;g<k;g++){var f=c[g];var l=f.getAttribute("name");var h={};var m=f.getElementsByTagName("value");if(m.length){h.value=this.getChildValue(m[0])}var a=f.getElementsByTagName("displayName");if(a.length){h.displayName=this.getChildValue(a[0])}e[l]=h}return e},parseProperty:function(c,f,b){var g;var a=this.getElementsByTagNameNS(c,f,b);try{g=OpenLayers.Util.getXmlNodeValue(a[0])}catch(h){g=null}return g},write:function(e){if(!(e instanceof Array)){e=[e]}var b=this.createElementNS(this.kmlns,"kml");var f=this.createFolderXML();for(var c=0,a=e.length;c<a;++c){f.appendChild(this.createPlacemarkXML(e[c]))}b.appendChild(f);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFolderXML:function(){var f=this.createElementNS(this.kmlns,"name");var e=this.createTextNode(this.foldersName);f.appendChild(e);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(f);c.appendChild(a);return c},createPlacemarkXML:function(f){var h=this.createElementNS(this.kmlns,"name");
var c=(f.attributes.name)?f.attributes.name:f.id;h.appendChild(this.createTextNode(c));var e=this.createElementNS(this.kmlns,"description");var g=(f.attributes.description)?f.attributes.description:this.placemarksDesc;e.appendChild(this.createTextNode(g));var b=this.createElementNS(this.kmlns,"Placemark");if(f.fid!=null){b.setAttribute("id",f.fid)}b.appendChild(h);b.appendChild(e);var a=this.buildGeometryNode(f.geometry);b.appendChild(a);return b},buildGeometryNode:function(f){if(this.internalProjection&&this.externalProjection){f=f.clone();f.transform(this.internalProjection,this.externalProjection)}var c=f.CLASS_NAME;var b=c.substring(c.lastIndexOf(".")+1);var a=this.buildGeometry[b.toLowerCase()];var e=null;if(a){e=a.apply(this,[f])}return e},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(k){var b=this.createElementNS(this.kmlns,"Polygon");var h=k.components;var f,g,e;for(var c=0,a=h.length;c<a;++c){e=(c==0)?"outerBoundaryIs":"innerBoundaryIs";f=this.createElementNS(this.kmlns,e);g=this.buildGeometry.linearring.apply(this,[h[c]]);f.appendChild(g);b.appendChild(f)}return b},multipolygon:function(a){return this.buildGeometry.collection.apply(this,[a])},collection:function(e){var b=this.createElementNS(this.kmlns,"MultiGeometry");var f;for(var c=0,a=e.components.length;c<a;++c){f=this.buildGeometryNode.apply(this,[e.components[c]]);if(f){b.appendChild(f)}}return b}},buildCoordinatesNode:function(f){var a=this.createElementNS(this.kmlns,"coordinates");var l;var k=f.components;if(k){var h;var g=k.length;var c=new Array(g);for(var e=0;e<g;++e){h=k[e];c[e]=h.x+","+h.y}l=c.join(" ")}else{l=f.x+","+f.y}var b=this.createTextNode(l);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 e={interestingTagsExclude:["source","source_ref","source:ref","history","attribution","created_by"],areaTags:["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]};e=OpenLayers.Util.extend(e,a);var f={};for(var b=0;b<e.interestingTagsExclude.length;b++){f[e.interestingTagsExclude[b]]=true}e.interestingTagsExclude=f;var c={};for(var b=0;b<e.areaTags.length;b++){c[e.areaTags[b]]=true}e.areaTags=c;OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(p){if(typeof p=="string"){p=OpenLayers.Format.XML.prototype.read.apply(this,[p])}var b=this.getNodes(p);var q=this.getWays(p);var h=new Array(q.length);for(var g=0;g<q.length;g++){var m=new Array(q[g].nodes.length);var a=this.isWayArea(q[g])?1:0;for(var f=0;f<q[g].nodes.length;f++){var c=b[q[g].nodes[f]];var o=new OpenLayers.Geometry.Point(c.lon,c.lat);o.osm_id=parseInt(q[g].nodes[f]);m[f]=o;c.used=true}var l=null;if(a){l=new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(m))}else{l=new OpenLayers.Geometry.LineString(m)}if(this.internalProjection&&this.externalProjection){l.transform(this.externalProjection,this.internalProjection)}var k=new OpenLayers.Feature.Vector(l,q[g].tags);k.osm_id=parseInt(q[g].id);k.fid="way."+k.osm_id;h[g]=k}for(var e in b){var c=b[e];if(!c.used||this.checkTags){var s=null;if(this.checkTags){var r=this.getTags(c.node,true);if(c.used&&!r[1]){continue}s=r[0]}else{s=this.getTags(c.node)}var k=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(c.lon,c.lat),s);if(this.internalProjection&&this.externalProjection){k.geometry.transform(this.externalProjection,this.internalProjection)}k.osm_id=parseInt(e);k.fid="node."+k.osm_id;h.push(k)}c.node=null}return h},getNodes:function(f){var e=f.getElementsByTagName("node");var a={};for(var b=0;b<e.length;b++){var c=e[b];var g=c.getAttribute("id");a[g]={lat:c.getAttribute("lat"),lon:c.getAttribute("lon"),node:c}}return a},getWays:function(h){var g=h.getElementsByTagName("way");var k=[];for(var e=0;e<g.length;e++){var b=g[e];var c={id:b.getAttribute("id")};c.tags=this.getTags(b);var f=b.getElementsByTagName("nd");c.nodes=new Array(f.length);for(var a=0;a<f.length;a++){c.nodes[a]=f[a].getAttribute("ref")}k.push(c)}return k},getTags:function(f,h){var a=f.getElementsByTagName("tag");var c={};var g=false;for(var b=0;b<a.length;b++){var e=a[b].getAttribute("k");c[e]=a[b].getAttribute("v");if(h){if(!this.interestingTagsExclude[e]){g=true}}}return h?[c,g]:c},isWayArea:function(b){var a=false;var e=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]){e=true;break}}}return a&&(this.checkTags?e:true)},write:function(e){if(!(e instanceof Array)){e=[e]}this.osm_id=1;this.created_nodes={};var f=this.createElementNS(null,"osm");f.setAttribute("version","0.5");f.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var c=e.length-1;c>=0;c--){var a=this.createFeatureNodes(e[c]);for(var b=0;b<a.length;b++){f.appendChild(a[b])}}return OpenLayers.Format.XML.prototype.write.apply(this,[f])},createFeatureNodes:function(c){var b=[];var f=c.geometry.CLASS_NAME;var e=f.substring(f.lastIndexOf(".")+1);e=e.toLowerCase();var a=this.createXML[e];if(a){b=a.apply(this,[c])}return b},createXML:{point:function(a){var f=null;var c=a.geometry?a.geometry:a;var e=false;if(a.osm_id){f=a.osm_id;if(this.created_nodes[f]){e=true}}else{f=-this.osm_id;this.osm_id++}if(e){b=this.created_nodes[f]}else{var b=this.createElementNS(null,"node")}this.created_nodes[f]=b;b.setAttribute("id",f);b.setAttribute("lon",c.x);b.setAttribute("lat",c.y);if(a.attributes){this.serializeTags(a,b)}this.setState(a,b);return e?[]:[b]},linestring:function(e){var a=[];var k=e.geometry;if(e.osm_id){id=e.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<k.components.length;c++){var g=this.createXML.point.apply(this,[k.components[c]]);if(g.length){g=g[0];var f=g.getAttribute("id");a.push(g)}else{f=k.components[c].osm_id;g=this.created_nodes[f]}this.setState(e,g);var h=this.createElementNS(null,"nd");h.setAttribute("ref",f);b.appendChild(h)}this.serializeTags(e,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,e){for(var b in c.attributes){var a=this.createElementNS(null,"tag");a.setAttribute("k",b);a.setAttribute("v",c.attributes[b]);e.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(e,c){for(var b=0,a=c.length;b<a;b++){e.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(g){if(typeof g=="string"){g=OpenLayers.Format.XML.prototype.read.apply(this,[g])}var a=null;if(g&&g.documentElement){if(g.documentElement.nodeName=="ARCXML"){a=g.documentElement}else{a=g.documentElement.getElementsByTagName("ARCXML")[0]}}if(!a){var c,f;try{c=g.firstChild.nodeValue;f=g.firstChild.childNodes[1].firstChild.nodeValue}catch(e){}throw {message:"Error parsing the ArcXML request",error:c,source:f}}var b=this.parseResponse(a);return b},write:function(c){if(!c){c=this.request}var w=this.createElementNS("","ARCXML");w.setAttribute("version","1.1");var k=this.createElementNS("","REQUEST");if(c.get_image!=null){var o=this.createElementNS("","GET_IMAGE");k.appendChild(o);var m=this.createElementNS("","PROPERTIES");o.appendChild(m);var b=c.get_image.properties;if(b.featurecoordsys!=null){var s=this.createElementNS("","FEATURECOORDSYS");m.appendChild(s);if(b.featurecoordsys.id===0){s.setAttribute("string",b.featurecoordsys.string)}else{s.setAttribute("id",b.featurecoordsys.id)}}if(b.filtercoordsys!=null){var q=this.createElementNS("","FILTERCOORDSYS");m.appendChild(q);if(b.filtercoordsys.id===0){q.setAttribute("string",b.filtercoordsys.string)}else{q.setAttribute("id",b.filtercoordsys.id)}}if(b.envelope!=null){var C=this.createElementNS("","ENVELOPE");m.appendChild(C);C.setAttribute("minx",b.envelope.minx);C.setAttribute("miny",b.envelope.miny);C.setAttribute("maxx",b.envelope.maxx);C.setAttribute("maxy",b.envelope.maxy)}var A=this.createElementNS("","IMAGESIZE");m.appendChild(A);A.setAttribute("height",b.imagesize.height);A.setAttribute("width",b.imagesize.width);if(b.imagesize.height!=b.imagesize.printheight||b.imagesize.width!=b.imagesize.printwidth){A.setAttribute("printheight",b.imagesize.printheight);A.setArrtibute("printwidth",b.imagesize.printwidth)}if(b.background!=null){var a=this.createElementNS("","BACKGROUND");m.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 h=this.createElementNS("","LAYERLIST");m.appendChild(h);for(var u=0;u<b.layerlist.length;u++){var r=this.createElementNS("","LAYERDEF");h.appendChild(r);r.setAttribute("id",b.layerlist[u].id);r.setAttribute("visible",b.layerlist[u].visible);if(typeof b.layerlist[u].query=="object"){var g=b.layerlist[u].query;if(g.where.length<0){continue}var F=null;if(typeof g.spatialfilter=="boolean"&&g.spatialfilter){F=this.createElementNS("","SPATIALQUERY")}else{F=this.createElementNS("","QUERY")}F.setAttribute("where",g.where);if(typeof g.accuracy=="number"&&g.accuracy>0){F.setAttribute("accuracy",g.accuracy)}if(typeof g.featurelimit=="number"&&g.featurelimit<2000){F.setAttribute("featurelimit",g.featurelimit)}if(typeof g.subfields=="string"&&g.subfields!="#ALL#"){F.setAttribute("subfields",g.subfields)}if(typeof g.joinexpression=="string"&&g.joinexpression.length>0){F.setAttribute("joinexpression",g.joinexpression)}if(typeof g.jointables=="string"&&g.jointables.length>0){F.setAttribute("jointables",g.jointables)}r.appendChild(F)}if(typeof b.layerlist[u].renderer=="object"){this.addRenderer(r,b.layerlist[u].renderer)}}}}else{if(c.get_feature!=null){var o=this.createElementNS("","GET_FEATURES");o.setAttribute("outputmode","newxml");o.setAttribute("checkesc","true");if(c.get_feature.geometry){o.setAttribute("geometry",c.get_feature.geometry)}else{o.setAttribute("geometry","false")}if(c.get_feature.compact){o.setAttribute("compact",c.get_feature.compact)}if(c.get_feature.featurelimit=="number"){o.setAttribute("featurelimit",c.get_feature.featurelimit)}o.setAttribute("globalenvelope","true");k.appendChild(o);if(c.get_feature.layer!=null&&c.get_feature.layer.length>0){var D=this.createElementNS("","LAYER");D.setAttribute("id",c.get_feature.layer);o.appendChild(D)}var z=c.get_feature.query;if(z!=null){var B=null;if(z.isspatial){B=this.createElementNS("","SPATIALQUERY")}else{B=this.createElementNS("","QUERY")}o.appendChild(B);if(typeof z.accuracy=="number"){B.setAttribute("accuracy",z.accuracy)}if(z.featurecoordsys!=null){var f=this.createElementNS("","FEATURECOORDSYS");if(z.featurecoordsys.id==0){f.setAttribute("string",z.featurecoordsys.string)}else{f.setAttribute("id",z.featurecoordsys.id)}B.appendChild(f)}if(z.filtercoordsys!=null){var e=this.createElementNS("","FILTERCOORDSYS");if(z.filtercoordsys.id===0){e.setAttribute("string",z.filtercoordsys.string)
}else{e.setAttribute("id",z.filtercoordsys.id)}B.appendChild(e)}if(z.buffer>0){var p=this.createElementNS("","BUFFER");p.setAttribute("distance",z.buffer);B.appendChild(p)}if(z.isspatial){var l=this.createElementNS("","SPATIALFILTER");l.setAttribute("relation",z.spatialfilter.relation);B.appendChild(l);if(z.spatialfilter.envelope){var E=this.createElementNS("","ENVELOPE");E.setAttribute("minx",z.spatialfilter.envelope.minx);E.setAttribute("miny",z.spatialfilter.envelope.miny);E.setAttribute("maxx",z.spatialfilter.envelope.maxx);E.setAttribute("maxy",z.spatialfilter.envelope.maxy);l.appendChild(E)}else{if(typeof z.spatialfilter.polygon=="object"){l.appendChild(this.writePolygonGeometry(z.spatialfilter.polygon))}}}if(z.where!=null&&z.where.length>0){B.setAttribute("where",z.where)}}}}w.appendChild(k);return OpenLayers.Format.XML.prototype.write.apply(this,[w])},addGroupRenderer:function(b,a){var f=this.createElementNS("","GROUPRENDERER");b.appendChild(f);for(var c=0;c<a.length;c++){var e=a[c];this.addRenderer(f,e)}},addRenderer:function(c,b){if(b instanceof Array){this.addGroupRenderer(c,b)}else{var a=this.createElementNS("",b.type.toUpperCase()+"RENDERER");c.appendChild(a);if(a.tagName=="VALUEMAPRENDERER"){this.addValueMapRenderer(a,b)}else{if(a.tagName=="VALUEMAPLABELRENDERER"){this.addValueMapLabelRenderer(a,b)}else{if(a.tagName=="SIMPLELABELRENDERER"){this.addSimpleLabelRenderer(a,b)}else{if(a.tagName=="SCALEDEPENDENTRENDERER"){this.addScaleDependentRenderer(a,b)}}}}}},addScaleDependentRenderer:function(a,b){if(typeof b.lower=="string"||typeof b.lower=="number"){a.setAttribute("lower",b.lower)}if(typeof b.upper=="string"||typeof b.upper=="number"){a.setAttribute("upper",b.upper)}this.addRenderer(a,b.renderer)},addValueMapLabelRenderer:function(k,h){k.setAttribute("lookupfield",h.lookupfield);k.setAttribute("labelfield",h.labelfield);if(typeof h.exacts=="object"){for(var a=0,m=h.exacts.length;a<m;a++){var f=h.exacts[a];var e=this.createElementNS("","EXACT");if(typeof f.value=="string"){e.setAttribute("value",f.value)}if(typeof f.label=="string"){e.setAttribute("label",f.label)}if(typeof f.method=="string"){e.setAttribute("method",f.method)}k.appendChild(e);if(typeof f.symbol=="object"){var b=null;if(f.symbol.type=="text"){b=this.createElementNS("","TEXTSYMBOL")}if(b!=null){var o=this.fontStyleKeys;for(var c=0,g=o.length;c<g;c++){var l=o[c];if(symbol[l]){b.setAttribute(l,h[l])}}e.appendChild(b)}}}}},addValueMapRenderer:function(m,l){m.setAttribute("lookupfield",l.lookupfield);if(typeof l.ranges=="object"){for(var a=0,b=l.ranges.length;a<b;a++){var h=l.ranges[a];var f=this.createElementNS("","RANGE");f.setAttribute("lower",h.lower);f.setAttribute("upper",h.upper);m.appendChild(f);if(typeof h.symbol=="object"){var e=null;if(h.symbol.type=="simplepolygon"){e=this.createElementNS("","SIMPLEPOLYGONSYMBOL")}if(e!=null){if(typeof h.symbol.boundarycolor=="string"){e.setAttribute("boundarycolor",h.symbol.boundarycolor)}if(typeof h.symbol.fillcolor=="string"){e.setAttribute("fillcolor",h.symbol.fillcolor)}if(typeof h.symbol.filltransparency=="number"){e.setAttribute("filltransparency",h.symbol.filltransparency)}f.appendChild(e)}}}}else{if(typeof l.exacts=="object"){for(var c=0,o=l.exacts.length;c<o;c++){var k=l.exacts[c];var g=this.createElementNS("","EXACT");if(typeof k.value=="string"){g.setAttribute("value",k.value)}if(typeof k.label=="string"){g.setAttribute("label",k.label)}if(typeof k.method=="string"){g.setAttribute("method",k.method)}m.appendChild(g);if(typeof k.symbol=="object"){var e=null;if(k.symbol.type=="simplemarker"){e=this.createElementNS("","SIMPLEMARKERSYMBOL")}if(e!=null){if(typeof k.symbol.antialiasing=="string"){e.setAttribute("antialiasing",k.symbol.antialiasing)}if(typeof k.symbol.color=="string"){e.setAttribute("color",k.symbol.color)}if(typeof k.symbol.outline=="string"){e.setAttribute("outline",k.symbol.outline)}if(typeof k.symbol.overlap=="string"){e.setAttribute("overlap",k.symbol.overlap)}if(typeof k.symbol.shadow=="string"){e.setAttribute("shadow",k.symbol.shadow)}if(typeof k.symbol.transparency=="number"){e.setAttribute("transparency",k.symbol.transparency)}if(typeof k.symbol.usecentroid=="string"){e.setAttribute("usecentroid",k.symbol.usecentroid)}if(typeof k.symbol.width=="number"){e.setAttribute("width",k.symbol.width)}g.appendChild(e)}}}}}},addSimpleLabelRenderer:function(g,k){g.setAttribute("field",k.field);var f=["featureweight","howmanylabels","labelbufferratio","labelpriorities","labelweight","linelabelposition","rotationalangles"];for(var e=0,a=f.length;e<a;e++){var c=f[e];if(k[c]){g.setAttribute(c,k[c])}}if(k.symbol.type=="text"){var h=k.symbol;var b=this.createElementNS("","TEXTSYMBOL");g.appendChild(b);var f=this.fontStyleKeys;for(var e=0,a=f.length;e<a;e++){var c=f[e];if(h[c]){b.setAttribute(c,k[c])}}}},writePolygonGeometry:function(h){if(!(h instanceof OpenLayers.Geometry.Polygon)){throw {message:"Cannot write polygon geometry to ArcXML with an "+h.CLASS_NAME+" object.",geometry:h}}var b=this.createElementNS("","POLYGON");for(var f=0,c=h.components.length;f<c;f++){var a=h.components[f];var l=this.createElementNS("","RING");for(var e=0,m=a.components.length;e<m;e++){var k=a.components[e];var g=this.createElementNS("","POINT");g.setAttribute("x",k.x);g.setAttribute("y",k.y);l.appendChild(g)}b.appendChild(l)}return b},parseResponse:function(H){if(typeof H=="string"){var r=new OpenLayers.Format.XML();H=r.read(H)}var a=new OpenLayers.Format.ArcXML.Response();var I=H.getElementsByTagName("ERROR");if(I!=null&&I.length>0){a.error=this.getChildValue(I,"Unknown error.")}else{var z=H.getElementsByTagName("RESPONSE");if(z==null||z.length==0){a.error="No RESPONSE tag found in ArcXML response.";return a}var w=z[0].firstChild.nodeName;if(w=="#text"){w=z[0].firstChild.nextSibling.nodeName}if(w=="IMAGE"){var c=H.getElementsByTagName("ENVELOPE");var E=H.getElementsByTagName("OUTPUT");if(c==null||c.length==0){a.error="No ENVELOPE tag found in ArcXML response."}else{if(E==null||E.length==0){a.error="No OUTPUT tag found in ArcXML response."}else{var C=this.parseAttributes(c[0]);var D=this.parseAttributes(E[0]);if(typeof D.type=="string"){a.image={envelope:C,output:{type:D.type,data:this.getChildValue(E[0])}}}else{a.image={envelope:C,output:D}}}}}else{if(w=="FEATURES"){var l=z[0].getElementsByTagName("FEATURES");var u=l[0].getElementsByTagName("FEATURECOUNT");a.features.featurecount=u[0].getAttribute("count");if(a.features.featurecount>0){var e=l[0].getElementsByTagName("ENVELOPE");a.features.envelope=this.parseAttributes(e[0],typeof(0));var F=l[0].getElementsByTagName("FEATURE");for(var q=0;q<F.length;q++){var k=new OpenLayers.Feature.Vector();var A=F[q].getElementsByTagName("FIELD");for(var g=0;g<A.length;g++){var h=A[g].getAttribute("name");var o=A[g].getAttribute("value");k.attributes[h]=o}var B=F[q].getElementsByTagName("POLYGON");if(B.length>0){var m=B[0].getElementsByTagName("RING");var f=[];for(var s=0;s<m.length;s++){var G=[];G.push(this.parsePointGeometry(m[s]));var p=m[s].getElementsByTagName("HOLE");for(var b=0;b<p.length;b++){G.push(this.parsePointGeometry(p[b]))}p=null;f.push(new OpenLayers.Geometry.Polygon(G));G=null}m=null;if(f.length==1){k.geometry=f[0]}else{k.geometry=new OpenLayers.Geometry.MultiPolygon(f)}}a.features.feature.push(k)}}}else{a.error="Unidentified response type."}}}return a},parseAttributes:function(e,c){var b={};for(var a=0;a<e.attributes.length;a++){if(c=="number"){b[e.attributes[a].nodeName]=parseFloat(e.attributes[a].nodeValue)}else{b[e.attributes[a].nodeName]=e.attributes[a].nodeValue}}return b},parsePointGeometry:function(e){var b=[];var f=e.getElementsByTagName("COORDS");if(f.length>0){var g=this.getChildValue(f[0]);g=g.split(/;/);for(var k=0;k<g.length;k++){var h=g[k].split(/ /);b.push(new OpenLayers.Geometry.Point(parseFloat(h[0]),parseFloat(h[1])))}f=null}else{var a=e.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(e){if(typeof e=="string"){e=OpenLayers.Format.XML.prototype.read.apply(this,[e])}var f=this.getElementsByTagNameNS(e.documentElement,this.gmlns,this.featureName);var c=[];for(var b=0;b<f.length;b++){var a=this.parseFeature(f[b]);if(a){c.push(a)}}return c},parseFeature:function(c){var e=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope","Box"];var l,g,m,b;for(var k=0;k<e.length;++k){l=e[k];g=this.getElementsByTagNameNS(c,this.gmlns,l);if(g.length>0){var b=this.parseGeometry[l.toLowerCase()];if(b){m=b.apply(this,[g[0]]);if(this.internalProjection&&this.externalProjection){m.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:l}))}break}}var h;if(this.extractAttributes){h=this.parseAttributes(c)}var o=new OpenLayers.Feature.Vector(m,h);o.gml={featureType:c.firstChild.nodeName.split(":")[1],featureNS:c.firstChild.namespaceURI,featureNSPrefix:c.firstChild.prefix};var a=c.firstChild;var f;while(a){if(a.nodeType==1){f=a.getAttribute("fid")||a.getAttribute("id");if(f){break}}a=a.nextSibling}o.fid=f;return o},parseGeometry:{point:function(e){var b,a;var f=[];var b=this.getElementsByTagNameNS(e,this.gmlns,"pos");if(b.length>0){a=b[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");f=a.split(this.regExes.splitSpace)}if(f.length==0){b=this.getElementsByTagNameNS(e,this.gmlns,"coordinates");if(b.length>0){a=b[0].firstChild.nodeValue;a=a.replace(this.regExes.removeSpace,"");f=a.split(",")}}if(f.length==0){b=this.getElementsByTagNameNS(e,this.gmlns,"coord");if(b.length>0){var g=this.getElementsByTagNameNS(b[0],this.gmlns,"X");var c=this.getElementsByTagNameNS(b[0],this.gmlns,"Y");if(g.length>0&&c.length>0){f=[g[0].firstChild.nodeValue,c[0].firstChild.nodeValue]}}}if(f.length==2){f[2]=null}if(this.xy){return new OpenLayers.Geometry.Point(f[0],f[1],f[2])}else{return new OpenLayers.Geometry.Point(f[1],f[0],f[2])}},multipoint:function(f){var b=this.getElementsByTagNameNS(f,this.gmlns,"Point");var e=[];if(b.length>0){var a;for(var c=0;c<b.length;++c){a=this.parseGeometry.point.apply(this,[b[c]]);if(a){e.push(a)}}}return new OpenLayers.Geometry.MultiPoint(e)},linestring:function(c,f){var e,b;var p=[];var q=[];e=this.getElementsByTagNameNS(c,this.gmlns,"posList");if(e.length>0){b=this.getChildValue(e[0]);b=b.replace(this.regExes.trimSpace,"");p=b.split(this.regExes.splitSpace);var k=parseInt(e[0].getAttribute("dimension"));var g,o,m,l;for(var h=0;h<p.length/k;++h){g=h*k;o=p[g];m=p[g+1];l=(k==2)?null:p[g+2];if(this.xy){q.push(new OpenLayers.Geometry.Point(o,m,l))}else{q.push(new OpenLayers.Geometry.Point(m,o,l))}}}if(p.length==0){e=this.getElementsByTagNameNS(c,this.gmlns,"coordinates");if(e.length>0){b=this.getChildValue(e[0]);b=b.replace(this.regExes.trimSpace,"");b=b.replace(this.regExes.trimComma,",");var a=b.split(this.regExes.splitSpace);for(var h=0;h<a.length;++h){p=a[h].split(",");if(p.length==2){p[2]=null}if(this.xy){q.push(new OpenLayers.Geometry.Point(p[0],p[1],p[2]))}else{q.push(new OpenLayers.Geometry.Point(p[1],p[0],p[2]))}}}}var r=null;if(q.length!=0){if(f){r=new OpenLayers.Geometry.LinearRing(q)}else{r=new OpenLayers.Geometry.LineString(q)}}return r},multilinestring:function(f){var b=this.getElementsByTagNameNS(f,this.gmlns,"LineString");var e=[];if(b.length>0){var a;for(var c=0;c<b.length;++c){a=this.parseGeometry.linestring.apply(this,[b[c]]);if(a){e.push(a)}}}return new OpenLayers.Geometry.MultiLineString(e)},polygon:function(f){var b=this.getElementsByTagNameNS(f,this.gmlns,"LinearRing");var e=[];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){e.push(a)}}}return new OpenLayers.Geometry.Polygon(e)},multipolygon:function(f){var a=this.getElementsByTagNameNS(f,this.gmlns,"Polygon");var e=[];if(a.length>0){var c;for(var b=0;b<a.length;++b){c=this.parseGeometry.polygon.apply(this,[a[b]]);if(c){e.push(c)}}}return new OpenLayers.Geometry.MultiPolygon(e)},envelope:function(b){var f=[];var a;var g;var m=this.getElementsByTagNameNS(b,this.gmlns,"lowerCorner");if(m.length>0){var k=[];if(m.length>0){a=m[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");k=a.split(this.regExes.splitSpace)}if(k.length==2){k[2]=null}if(this.xy){var e=new OpenLayers.Geometry.Point(k[0],k[1],k[2])}else{var e=new OpenLayers.Geometry.Point(k[1],k[0],k[2])}}var h=this.getElementsByTagNameNS(b,this.gmlns,"upperCorner");if(h.length>0){var k=[];if(h.length>0){a=h[0].firstChild.nodeValue;a=a.replace(this.regExes.trimSpace,"");k=a.split(this.regExes.splitSpace)}if(k.length==2){k[2]=null}if(this.xy){var l=new OpenLayers.Geometry.Point(k[0],k[1],k[2])}else{var l=new OpenLayers.Geometry.Point(k[1],k[0],k[2])}}if(e&&l){f.push(new OpenLayers.Geometry.Point(e.x,e.y));f.push(new OpenLayers.Geometry.Point(l.x,e.y));f.push(new OpenLayers.Geometry.Point(l.x,l.y));f.push(new OpenLayers.Geometry.Point(e.x,l.y));f.push(new OpenLayers.Geometry.Point(e.x,e.y));var c=new OpenLayers.Geometry.LinearRing(f);g=new OpenLayers.Geometry.Polygon([c])}return g}},parseAttributes:function(f){var g={};var a=f.firstChild;var e,h,c,m,l,b,k;while(a){if(a.nodeType==1){e=a.childNodes;for(h=0;h<e.length;++h){c=e[h];if(c.nodeType==1){m=c.childNodes;if(m.length==1){l=m[0];if(l.nodeType==3||l.nodeType==4){b=(c.prefix)?c.nodeName.split(":")[1]:c.nodeName;k=l.nodeValue.replace(this.regExes.trimSpace,"");g[b]=k}}else{g[c.nodeName.split(":").pop()]=null}}}break}a=a.nextSibling}return g},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(m){var k=m.geometry;var f=this.buildGeometryNode(k);var l=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);l.appendChild(f);var a=this.createElementNS(this.gmlns,"gml:"+this.featureName);var o=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);var c=m.fid||m.id;o.setAttribute("fid",c);o.appendChild(l);for(var h in m.attributes){var g=this.createTextNode(m.attributes[h]);
var e=h.substring(h.lastIndexOf(":")+1);var b=this.createElementNS(this.featureNS,this.featurePrefix+":"+e);b.appendChild(g);o.appendChild(b)}a.appendChild(o);return a},buildGeometryNode:function(e){if(this.externalProjection&&this.internalProjection){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()];return a.apply(this,[e])},buildGeometry:{point:function(b){var a=this.createElementNS(this.gmlns,"gml:Point");a.appendChild(this.buildCoordinatesNode(b));return a},multipoint:function(g){var e=this.createElementNS(this.gmlns,"gml:MultiPoint");var c=g.components;var b,f;for(var a=0;a<c.length;a++){b=this.createElementNS(this.gmlns,"gml:pointMember");f=this.buildGeometry.point.apply(this,[c[a]]);b.appendChild(f);e.appendChild(b)}return e},linestring:function(b){var a=this.createElementNS(this.gmlns,"gml:LineString");a.appendChild(this.buildCoordinatesNode(b));return a},multilinestring:function(g){var e=this.createElementNS(this.gmlns,"gml:MultiLineString");var a=g.components;var c,f;for(var b=0;b<a.length;++b){c=this.createElementNS(this.gmlns,"gml:lineStringMember");f=this.buildGeometry.linestring.apply(this,[a[b]]);c.appendChild(f);e.appendChild(c)}return e},linearring:function(b){var a=this.createElementNS(this.gmlns,"gml:LinearRing");a.appendChild(this.buildCoordinatesNode(b));return a},polygon:function(h){var e=this.createElementNS(this.gmlns,"gml:Polygon");var g=h.components;var c,f,b;for(var a=0;a<g.length;++a){b=(a==0)?"outerBoundaryIs":"innerBoundaryIs";c=this.createElementNS(this.gmlns,"gml:"+b);f=this.buildGeometry.linearring.apply(this,[g[a]]);c.appendChild(f);e.appendChild(c)}return e},multipolygon:function(g){var e=this.createElementNS(this.gmlns,"gml:MultiPolygon");var a=g.components;var f,b;for(var c=0;c<a.length;++c){f=this.createElementNS(this.gmlns,"gml:polygonMember");b=this.buildGeometry.polygon.apply(this,[a[c]]);f.appendChild(b);e.appendChild(f)}return e},bounds:function(b){var a=this.createElementNS(this.gmlns,"gml:Box");a.appendChild(this.buildCoordinatesNode(b));return a}},buildCoordinatesNode:function(g){var a=this.createElementNS(this.gmlns,"gml:coordinates");a.setAttribute("decimal",".");a.setAttribute("cs",",");a.setAttribute("ts"," ");var f=[];if(g instanceof OpenLayers.Bounds){f.push(g.left+","+g.bottom);f.push(g.right+","+g.top)}else{var c=(g.components)?g.components:[g];for(var b=0;b<c.length;b++){f.push(c[b].x+","+c[b].y)}}var e=this.createTextNode(f.join(" "));a.appendChild(e);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(l,h,a){h=(h)?h:"FeatureCollection";var e=null;var c=null;if(typeof l=="string"){c=OpenLayers.Format.JSON.prototype.read.apply(this,[l,a])}else{c=l}if(!c){OpenLayers.Console.error("Bad JSON: "+l)}else{if(typeof(c.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+l)}else{if(this.isValidType(c,h)){switch(h){case"Geometry":try{e=this.parseGeometry(c)}catch(b){OpenLayers.Console.error(b)}break;case"Feature":try{e=this.parseFeature(c);e.type="Feature"}catch(b){OpenLayers.Console.error(b)}break;case"FeatureCollection":e=[];switch(c.type){case"Feature":try{e.push(this.parseFeature(c))}catch(b){e=null;OpenLayers.Console.error(b)}break;case"FeatureCollection":for(var f=0,g=c.features.length;f<g;++f){try{e.push(this.parseFeature(c.features[f]))}catch(b){e=null;OpenLayers.Console.error(b)}}break;default:try{var k=this.parseGeometry(c);e.push(new OpenLayers.Feature.Vector(k))}catch(b){e=null;OpenLayers.Console.error(b)}}break}}}}return e},isValidType:function(c,a){var b=false;switch(a){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],c.type)==-1){OpenLayers.Console.error("Unsupported geometry type: "+c.type)}else{b=true}break;case"FeatureCollection":b=true;break;default:if(c.type==a){b=true}else{OpenLayers.Console.error("Cannot convert types from "+c.type+" to "+a)}}return b},parseFeature:function(e){var b,g,a,f;a=(e.properties)?e.properties:{};f=(e.geometry&&e.geometry.bbox)||e.bbox;try{g=this.parseGeometry(e.geometry)}catch(c){throw c}b=new OpenLayers.Feature.Vector(g,a);if(f){b.bounds=OpenLayers.Bounds.fromArray(f)}if(e.id){b.fid=e.id}return b},parseGeometry:function(f){if(f==null){return null}var h,g=false;if(f.type=="GeometryCollection"){if(!(f.geometries instanceof Array)){throw"GeometryCollection must have geometries array: "+f}var b=f.geometries.length;var e=new Array(b);for(var a=0;a<b;++a){e[a]=this.parseGeometry.apply(this,[f.geometries[a]])}h=new OpenLayers.Geometry.Collection(e);g=true}else{if(!(f.coordinates instanceof Array)){throw"Geometry must have coordinates array: "+f}if(!this.parseCoords[f.type.toLowerCase()]){throw"Unsupported geometry type: "+f.type}try{h=this.parseCoords[f.type.toLowerCase()].apply(this,[f.coordinates])}catch(c){throw c}}if(this.internalProjection&&this.externalProjection&&!g){h.transform(this.externalProjection,this.internalProjection)}return h},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(g){var c=[];var f=null;for(var b=0,a=g.length;b<a;++b){try{f=this.parseCoords.point.apply(this,[g[b]])}catch(e){throw e}c.push(f)}return new OpenLayers.Geometry.MultiPoint(c)},linestring:function(g){var c=[];var f=null;for(var b=0,a=g.length;b<a;++b){try{f=this.parseCoords.point.apply(this,[g[b]])}catch(e){throw e}c.push(f)}return new OpenLayers.Geometry.LineString(c)},multilinestring:function(g){var c=[];var b=null;for(var e=0,a=g.length;e<a;++e){try{b=this.parseCoords.linestring.apply(this,[g[e]])}catch(f){throw f}c.push(b)}return new OpenLayers.Geometry.MultiLineString(c)},polygon:function(h){var g=[];var f,b;for(var c=0,a=h.length;c<a;++c){try{b=this.parseCoords.linestring.apply(this,[h[c]])}catch(e){throw e}f=new OpenLayers.Geometry.LinearRing(b.components);g.push(f)}return new OpenLayers.Geometry.Polygon(g)},multipolygon:function(g){var b=[];var f=null;for(var c=0,a=g.length;c<a;++c){try{f=this.parseCoords.polygon.apply(this,[g[c]])}catch(e){throw e}b.push(f)}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(f,e){var a={type:null};if(f instanceof Array){a.type="FeatureCollection";var h=f.length;a.features=new Array(h);for(var c=0;c<h;++c){var b=f[c];if(!b instanceof OpenLayers.Feature.Vector){var g="FeatureCollection only supports collections of features: "+b;throw g}a.features[c]=this.extract.feature.apply(this,[b])}}else{if(f.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){a=this.extract.geometry.apply(this,[f])}else{if(f instanceof OpenLayers.Feature.Vector){a=this.extract.feature.apply(this,[f]);if(f.layer&&f.layer.projection){a.crs=this.createCRSObject(f)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[a,e])},createCRSObject:function(b){var c=b.layer.projection.toString();var a={};if(c.match(/epsg:/i)){var e=parseInt(c.substring(c.indexOf(":")+1));if(e==4326){a={type:"OGC",properties:{urn:"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{a={type:"EPSG",properties:{code:e}}}}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(e){if(e==null){return null}if(this.internalProjection&&this.externalProjection){e=e.clone();e.transform(this.internalProjection,this.externalProjection)
}var a=e.CLASS_NAME.split(".")[2];var c=this.extract[a.toLowerCase()].apply(this,[e]);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 e=[];for(var b=0,a=c.components.length;b<a;++b){e.push(this.extract.point.apply(this,[c.components[b]]))}return e},linestring:function(b){var e=[];for(var c=0,a=b.components.length;c<a;++c){e.push(this.extract.point.apply(this,[b.components[c]]))}return e},multilinestring:function(c){var e=[];for(var b=0,a=c.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[c.components[b]]))}return e},polygon:function(c){var e=[];for(var b=0,a=c.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[c.components[b]]))}return e},multipolygon:function(e){var c=[];for(var b=0,a=e.components.length;b<a;++b){c.push(this.extract.polygon.apply(this,[e.components[b]]))}return c},collection:function(c){var a=c.components.length;var e=new Array(a);for(var b=0;b<a;++b){e[b]=this.extract.geometry.apply(this,[c.components[b]])}return e}},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(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}if(f&&f.nodeType==9){f=f.documentElement}var c=[];this.readNode(f,{features:c});if(c.length==0){var e=this.getElementsByTagNameNS(f,this.namespaces.gml,"featureMember");if(e.length){for(var b=0,a=e.length;b<a;++b){this.readNode(e[b],{features:c})}}else{var e=this.getElementsByTagNameNS(f,this.namespaces.gml,"featureMembers");if(e.length){this.readNode(e[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(f,h){var k=this.getChildValue(f).replace(this.regExes.trimSpace,"");k=k.replace(this.regExes.trimComma,",");var a=k.split(this.regExes.splitSpace);var g;var e=a.length;var c=new Array(e);for(var b=0;b<e;++b){g=a[b].split(",");if(this.xy){c[b]=new OpenLayers.Geometry.Point(g[0],g[1],g[2])}else{c[b]=new OpenLayers.Geometry.Point(g[1],g[0],g[2])}}h.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,e){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,e])}},_typeName:function(c,e){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 f=c.getAttribute("fid")||this.getAttributeNS(c,this.namespaces.gml,"id");if(f){b.fid=f}if(this.internalProjection&&this.externalProjection&&b.geometry){b.geometry.transform(this.externalProjection,this.internalProjection)}if(a.bounds){b.geometry.bounds=a.bounds}e.features.push(b)},_geometry:function(a,b){this.readChildNodes(a,b)},_attribute:function(b,e){var a=b.localName||b.nodeName.split(":").pop();var c=this.getChildValue(b);e.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(e){var c=this.createElementNSPlus("gml:GeometryCollection");for(var b=0,a=e.components.length;b<a;++b){this.writeNode("geometryMember",e.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 e=b.attributes[a];if(e!=null){this.writeNode("feature:_attribute",{name:a,value:e},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 e=this.writeNode("gml:"+a,c,b);if(this.srsName){e.setAttribute("srsName",this.srsName)}return b},_attribute:function(a){return this.createElementNSPlus("feature:"+a.name,{value:a.value})}},wfs:{FeatureCollection:function(c){var e=this.createElementNSPlus("wfs:FeatureCollection");for(var b=0,a=c.length;b<a;++b){this.writeNode("gml:featureMember",c[b],e)}return e}}},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(g){var c=this.buildGeometryNode(g.geometry);var h=this.createElementNS(this.featureNS,"feature:"+this.geometryName);h.appendChild(c);var b=this.createElementNS(this.featureNS,"feature:"+this.featureName);b.appendChild(h);for(var a in g.attributes){var k=this.createTextNode(g.attributes[a]);var e=a;if(a.search(":")!=-1){e=a.split(":")[1]}var f=this.createElementNS(this.featureNS,"feature:"+e);f.appendChild(k);b.appendChild(f)}return b},insert:function(b){var a=this.createElementNS(this.wfsns,"wfs:Insert");a.appendChild(this.createFeatureXML(b));return a},update:function(m){if(!m.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"))}var g=this.createElementNS(this.wfsns,"wfs:Update");g.setAttribute("typeName",this.featurePrefix+":"+this.featureName);g.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var k=this.createElementNS(this.wfsns,"wfs:Property");var a=this.createElementNS(this.wfsns,"wfs:Name");var c=this.createTextNode(this.geometryName);a.appendChild(c);k.appendChild(a);var l=this.createElementNS(this.wfsns,"wfs:Value");var e=this.buildGeometryNode(m.geometry);if(m.layer){e.setAttribute("srsName",m.layer.projection.getCode())}l.appendChild(e);k.appendChild(l);g.appendChild(k);for(var f in m.attributes){k=this.createElementNS(this.wfsns,"wfs:Property");a=this.createElementNS(this.wfsns,"wfs:Name");a.appendChild(this.createTextNode(f));k.appendChild(a);l=this.createElementNS(this.wfsns,"wfs:Value");l.appendChild(this.createTextNode(m.attributes[f]));k.appendChild(l);g.appendChild(k)}var h=this.createElementNS(this.ogcns,"ogc:Filter");var b=this.createElementNS(this.ogcns,"ogc:FeatureId");b.setAttribute("fid",m.fid);h.appendChild(b);g.appendChild(h);return g},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 e=this.createElementNS(this.ogcns,"ogc:FeatureId");e.setAttribute("fid",b.fid);c.appendChild(e);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(e){var a="";e=this.adjustBounds(e);var c=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:e.toArray(),tileSize:this.tileSize}));var b=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:c.write(),async:false});if(b!=null){var g=b.responseXML;if(!g||!g.documentElement){g=b.responseText}var f=new OpenLayers.Format.ArcXML();var h=f.read(g);a=this.getUrlOrImage(h.image.output)}return a},getURLasync:function(c,a,f,e){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(g){var k=g.responseXML;if(!k||!k.documentElement){k=g.responseText}var h=new OpenLayers.Format.ArcXML();var l=h.read(k);a[f]=this.getUrlOrImage(l.image.output);e.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(k,g,o){var b=o.buffer||1;var l=o.callback||function(){};var m=o.scope||window;var a={};OpenLayers.Util.extend(a,this.options);a.requesttype="feature";if(k instanceof OpenLayers.LonLat){a.polygon=null;a.envelope=[k.lon-b,k.lat-b,k.lon+b,k.lat+b]}else{if(k instanceof OpenLayers.Geometry.Polygon){a.envelope=null;a.polygon=k}}var f=new OpenLayers.Format.ArcXML(a);OpenLayers.Util.extend(f.request.get_feature,o);f.request.get_feature.layer=g.id;if(typeof g.query.accuracy=="number"){f.request.get_feature.query.accuracy=g.query.accuracy}else{var h=this.map.getCenter();var e=this.map.getViewPortPxFromLonLat(h);e.x++;var c=this.map.getLonLatFromPixel(e);f.request.get_feature.query.accuracy=c.lon-h.lon}f.request.get_feature.query.where=g.query.where;f.request.get_feature.query.spatialfilter.relation="area_intersection";OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:f.write(),callback:function(q){var p=f.parseResponse(q.responseText);if(!f.iserror()){l.call(m,f.features)}else{l.call(m,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(e,b){var f={};this.readChildNodes(e,f);if(!b.components){b.components=[]}var c=f.points[0];var a=f.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(e){var c=e.length;var f=new Array(c);var a;for(var b=0;b<c;++b){a=e[b];if(this.xy){f[b]=a.x+","+a.y}else{f[b]=a.y+","+a.x}if(a.z!=undefined){f[b]+=","+a.z}}return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:(c==1)?f[0]:f.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,e){var f=this.getChildValue(b).replace(this.regExes.trimSpace,"");var c=f.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])}e.points=[a]},posList:function(a,e){var k=this.getChildValue(a).replace(this.regExes.trimSpace,"");var o=k.split(this.regExes.splitSpace);var f=parseInt(a.getAttribute("dimension"))||2;var b,p,m,h;var l=o.length/f;var q=new Array(l);for(var c=0,g=o.length;c<g;c+=f){p=o[c];m=o[c+1];h=(f==2)?undefined:o[c+2];if(this.xy){q[c/f]=new OpenLayers.Geometry.Point(p,m,h)}else{q[c/f]=new OpenLayers.Geometry.Point(m,p,h)}}e.points=q},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(e,b){var f={points:new Array(2)};this.readChildNodes(e,f);if(!b.components){b.components=[]}var c=f.points[0];var a=f.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 e=this.createElementNSPlus("gml:featureMembers");for(var b=0,a=c.length;b<a;++b){this.writeNode("feature:_typeName",c[b],e)}return e},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(e){var b=e.length;var f=new Array(b);var a;for(var c=0;c<b;++c){a=e[c];if(this.xy){f[c]=a.x+" "+a.y}else{f[c]=a.y+" "+a.x}}return this.createElementNSPlus("gml:posList",{value:f.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(e){var c=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",e.components[0],c);for(var b=1,a=e.components.length;b<a;++b){this.writeNode("interior",e.components[b],c)}return c},Polygon:function(e){var c=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",e.components[0],c);for(var b=1,a=e.components.length;b<a;++b){this.writeNode("interior",e.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(e){var c=this.createElementNSPlus("gml:MultiCurve");for(var b=0,a=e.components.length;
b<a;++b){this.writeNode("curveMember",e.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(e){var c=this.createElementNSPlus("gml:MultiSurface");for(var b=0,a=e.components.length;b<a;++b){this.writeNode("surfaceMember",e.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 e;if(b.value instanceof OpenLayers.Geometry){e=this.writeNode("feature:_geometry",b.value).firstChild}else{e=this.writeNode("gml:Box",b.value)}if(b.projection){e.setAttribute("srsName",b.projection)}c.appendChild(e);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,e){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);e.filters.push(a)},PropertyIsNotEqualTo:function(b,e){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);e.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 e;if(b.value instanceof OpenLayers.Geometry){e=this.writeNode("feature:_geometry",b.value).firstChild}else{e=this.writeNode("gml:Envelope",b.value)}if(b.projection){e.setAttribute("srsName",b.projection)}c.appendChild(e);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(e,f){var c={userStyles:[],namedStyles:[]};this.readChildNodes(e,c);for(var b=0,a=c.userStyles.length;b<a;++b){c.userStyles[b].layerName=c.name}if(f.namedLayers instanceof Array){f.namedLayers.push(c)}else{f.namedLayers[c.name]=c}},NamedStyle:function(b,a){a.namedStyles.push(this.getChildName(b.firstChild))},UserStyle:function(c,a){var e={defaultsPerSymbolizer:true,rules:[]};this.readChildNodes(c,e);var b=new OpenLayers.Style(this.defaultSymbolizer,e);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 e={};this.readChildNodes(b,e);if(e.property){a.label="${"+e.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 f=this.cssMap[a];if(f){var e=this.readOgcExpression(c);if(e){b[f]=e}}},Graphic:function(f,e){e.graphic=true;var k={};this.readChildNodes(f,k);var c=["strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fillColor","fillOpacity","graphicName","rotation","graphicFormat"];var h,g;for(var b=0,a=c.length;b<a;++b){h=c[b];g=k[h];if(g!=undefined){e[h]=g}}if(k.opacity!=undefined){e.graphicOpacity=k.opacity}if(k.size!=undefined){e.pointRadius=k.size/2}if(k.href!=undefined){e.externalGraphic=k.href}if(k.rotation!=undefined){e.rotation=k.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 e,c;for(var b in this.graphicFormats){if(this.graphicFormats[b].test(a)){e=b;break}}return e||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(f){var b=this.createElementNSPlus("StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});if(f.name){this.writeNode("Name",f.name,b)}if(f.title){this.writeNode("Title",f.title,b)}if(f.description){this.writeNode("Abstract",f.description,b)}if(f.namedLayers instanceof Array){for(var e=0,a=f.namedLayers.length;e<a;++e){this.writeNode("NamedLayer",f.namedLayers[e],b)}}else{for(var c in f.namedLayers){this.writeNode("NamedLayer",f.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 e=this.createElementNSPlus("NamedLayer");this.writeNode("Name",c.name,e);if(c.namedStyles){for(var b=0,a=c.namedStyles.length;b<a;++b){this.writeNode("NamedStyle",c.namedStyles[b],e)}}if(c.userStyles){for(var b=0,a=c.userStyles.length;b<a;++b){this.writeNode("UserStyle",c.userStyles[b],e)}}return e},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 e=this.createElementNSPlus("FeatureTypeStyle");for(var b=0,a=c.rules.length;b<a;++b){this.writeNode("Rule",c.rules[b],e)}return e},Rule:function(h){var g=this.createElementNSPlus("Rule");if(h.name){this.writeNode("Name",h.name,g)}if(h.title){this.writeNode("Title",h.title,g)}if(h.description){this.writeNode("Abstract",h.description,g)}if(h.elseFilter){this.writeNode("ElseFilter",null,g)}else{if(h.filter){this.writeNode("ogc:Filter",h.filter,g)}}if(h.minScaleDenominator!=undefined){this.writeNode("MinScaleDenominator",h.minScaleDenominator,g)}if(h.maxScaleDenominator!=undefined){this.writeNode("MaxScaleDenominator",h.maxScaleDenominator,g)}var c=OpenLayers.Style.SYMBOLIZER_PREFIXES;var f,e;for(var b=0,a=c.length;b<a;++b){f=c[b];e=h.symbolizer[f];if(e){this.writeNode(f+"Symbolizer",e,g)}}return g},ElseFilter:function(){return this.createElementNSPlus("ElseFilter")},MinScaleDenominator:function(a){return this.createElementNSPlus("MinScaleDenominator",{value:a})},MaxScaleDenominator:function(a){return this.createElementNSPlus("MaxScaleDenominator",{value:a})},LineSymbolizer:function(a){var b=this.createElementNSPlus("LineSymbolizer");this.writeNode("Stroke",a,b);return b},Stroke:function(a){var b=this.createElementNSPlus("Stroke");if(a.strokeColor!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeColor"},b)}if(a.strokeOpacity!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeOpacity"},b)}if(a.strokeWidth!=undefined){this.writeNode("CssParameter",{symbolizer:a,key:"strokeWidth"},b)}return b},CssParameter:function(a){return this.createElementNSPlus("CssParameter",{attributes:{name:this.getCssProperty(a.key)},value:a.symbolizer[a.key]})},TextSymbolizer:function(a){var b=this.createElementNSPlus("TextSymbolizer");if(a.label!=null){this.writeNode("Label",a.label,b)}if(a.fontFamily!=null||a.fontSize!=null||a.fontWeight!=null||a.fontStyle!=null){this.writeNode("Font",a,b)}if(a.haloRadius!=null||a.haloColor!=null||a.haloOpacity!=null){this.writeNode("Halo",a,b)}if(a.fillColor!=null||a.fillOpacity!=null){this.writeNode("Fill",a,b)}return b},Font:function(a){var b=this.createElementNSPlus("Font");if(a.fontFamily){this.writeNode("CssParameter",{symbolizer:a,key:"fontFamily"},b)}if(a.fontSize){this.writeNode("CssParameter",{symbolizer:a,key:"fontSize"},b)}if(a.fontWeight){this.writeNode("CssParameter",{symbolizer:a,key:"fontWeight"},b)}if(a.fontStyle){this.writeNode("CssParameter",{symbolizer:a,key:"fontStyle"},b)}return b},Label:function(b){var g=this.createElementNSPlus("Label");var h=b.split("${");g.appendChild(this.createTextNode(h[0]));var f,e;for(var c=1,a=h.length;c<a;c++){f=h[c];e=f.indexOf("}");if(e>0){this.writeNode("ogc:PropertyName",{property:f.substring(0,e)},g);g.appendChild(this.createTextNode(f.substring(++e)))}else{g.appendChild(this.createTextNode("${"+f))}}return g},Halo:function(a){var b=this.createElementNSPlus("Halo");if(a.haloRadius){this.writeNode("Radius",a.haloRadius,b)}if(a.haloColor||a.haloOpacity){this.writeNode("Fill",{fillColor:a.haloColor,fillOpacity:a.haloOpacity},b)}return b},Radius:function(a){return node=this.createElementNSPlus("Radius",{value:a})},PolygonSymbolizer:function(a){var b=this.createElementNSPlus("PolygonSymbolizer");if(a.fillColor!=undefined||a.fillOpacity!=undefined){this.writeNode("Fill",a,b)}if(a.strokeWidth!=undefined||a.strokeColor!=undefined||a.strokeOpacity!=undefined||a.strokeDashstyle!=undefined){this.writeNode("Stroke",a,b)}return b},Fill:function(a){var b=this.createElementNSPlus("Fill");
if(a.fillColor){this.writeNode("CssParameter",{symbolizer:a,key:"fillColor"},b)}if(a.fillOpacity!=null){this.writeNode("CssParameter",{symbolizer:a,key:"fillOpacity"},b)}return b},PointSymbolizer:function(a){var b=this.createElementNSPlus("PointSymbolizer");this.writeNode("Graphic",a,b);return b},Graphic:function(a){var b=this.createElementNSPlus("Graphic");if(a.externalGraphic!=undefined){this.writeNode("ExternalGraphic",a,b)}else{this.writeNode("Mark",a,b)}if(a.graphicOpacity!=undefined){this.writeNode("Opacity",a.graphicOpacity,b)}if(a.pointRadius!=undefined){this.writeNode("Size",a.pointRadius*2,b)}if(a.rotation!=undefined){this.writeNode("Rotation",a.rotation,b)}return b},ExternalGraphic:function(a){var 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 e=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b.featureNS?b.featurePrefix+":":"")+b.featureType}});if(b.featureNS){e.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]},e)}}if(b.filter){this.setFilterProperty(b.filter);this.writeNode("ogc:Filter",b.filter,e)}return e}},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 e=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b.featureNS?b.featurePrefix+":":"")+b.featureType,srsName:b.srsName}});if(b.featureNS){e.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]},e)}}if(b.filter){this.setFilterProperty(b.filter);this.writeNode("ogc:Filter",b.filter,e)}return e},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"});OpenLayers.Layer.Watermark=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:false,initialize:function(e,c,b){var a=[];a.push(e,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(){return this.url},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.Watermark"});var Elgin=window.Elgin||{};Elgin.MapSettings={requestDev:false,url_GeoServerWFS:"/olmap/php/proxy.php?proxy_url=geoserverInstance/wfs",url_GeoServerWMS:"geoserverInstance/wms",url_ElginWebLogger:"http://services.web2.elgin.gov.uk/WCFWebLogger/WebLogger.svc/Log",path_proxyElginWebLogger:"/olmap/php/",maxCQLLength:1500,hsPxMO_1:10000,hsPxMO_2:5000,hsPxMO_3:2500,hsPxMO_4:1250,hsPxMO_5:300,hsPxMO_6:75,hsPxMO_7:30,hsPxMO_8:20,hsPxMO_9:10,hsPxMO_10:3,hsPxTT_1:30,hsPxTT_2:30,hsPxTT_3:15,getFeatureWFSVer:"1.1.0",getFeatureWFSFM:"gml:featureMembers",maxGetWFSFeatures:25,maxFeaturesInProperties:5,tooltip_enabled:true,tooltip_ITN:"onclick",tooltip_ITN_maxScale:499999,tooltip_ITN_minScale:4999,tooltip_ITN_addToProperties:false,tooltip_ITN_addToStatusBar:false,tooltip_ITN_displayTime:2000,tooltip_mouseStaticTime:1000,tooltip_displayTime:15000,tooltip_displayed:false,mapLayers_visbleTooltips:[],tooltip_maxScale:2500,map_defaultCentreEasting:475850,map_defaultCentreNorthing:273024,map_defaultScale:4000000,jema_map_defaultCentreEasting:584858,jema_map_defaultCentreNorthing:152373,jema_map_defaultScale:500000,map_defaultOSLicence:"100019520",mapZoomLevels:[250,500,1000,1750,2500,5000,7500,10000,25000,100000,500000,1000000,2000000,4000000,6000000],mapFullExtent:[0,0,660000,1225000],osmmBaseMapScale:5000,BASE_LAYER_NAME:"MapGuide Tiled Base Layer",OSMM_BASE_LAYER_NAME:"OSMM Non-tiled Base Layer",VECTOR_LAYER_NAME:"Vector Layer",SCOTLAND_MASK_LAYER_NAME:"Scotland Mask",useMapGuideOSMMBaseMap:false,mapLayers_defaultVisible:"STREETWORKSCURRENTSEVERE,STREETWORKSCURRENTHIGH,STREETWORKSCURRENTMEDIUM",mapLayers_OSMMVisible:["TRO_PUBLIC"],watermark:null,STREETWORKS:{name:"Roadworks",columns:"SW_TYPE,SE_ID,PHASE_ID,ORIGINATOR_REF,IMPACT_SCORE,SYMBOL_ID,START_DATE_DISPLAY,END_DATE_DISPLAY,WORKS_LOCATION,ROAD_LOCATION,IMPACT_DESC,WORKS_DESC,EASTING,NORTHING,PROMOTER,WORKS_STATE,PERMIT_STATUS,LAST_ADAPTER_UPDATE_DISPLAY",lyrType:"streetwork",imageType:"image/gif",tiled:false,theme:null,antialias:"full"},STREETWORKSSEARCH:null,STREETWORKSCURRENTSEVERE:null,STREETWORKSCURRENTHIGH:null,STREETWORKSCURRENTMEDIUM:null,STREETWORKSCURRENTLOW:null,STREETWORKSFUTURESEVERE:null,STREETWORKSFUTUREHIGH:null,STREETWORKSFUTUREMEDIUM:null,STREETWORKSFUTURELOW:null,STREETWORKSFORWARDPLAN:null,STREETWORKSFORWARDPLAN_PRIVATE:null,STREETWORKSFORWARDPLAN_PUBLIC:null,STREETWORKSFORWARDPLANNING:null,STRUCTURES:{name:"Bridges and structures",columns:"STRUCTREF,NAME,LOCATION,CATEGORY,TYPE,OWNER,OWNERTEL,MAINTBY,MAINTTEL,EASTING,NORTHING,LENGTH,ROADREL,ROUTEO,ROUTEU,HTRESTRIC,WDRESTRIC1,WDRESTRIC2,LDRESTRIC,DECKMAT,SUPPORTMAT,PARAPETMAT,HERITAGECL,YEARBUILT,DESCRIPT,ORGANISATION_NAME,LAST_UPDATE",lyrType:"structure",imageType:"image/gif",tiled:false,theme:"STRUCTURES"},STRUCTURES_PRIVATE:null,STRUCTURES_PUBLIC:null,NAPTAN:{name:"Bus stops",columns:"ATCOCODE,NAPTANCODE,PLATECODE,EASTING,NORTHING,COMMONNAME,SHORTNAME,LANDMARK,BEARING,CROSSING,INDICATOR,STREET,LOCALITYNAME,TOWN,SUBURB,STOPTYPE,BUSSTOPTYPE,ORGANISATION_NAME,LAST_UPDATE",lyrType:"busstop",imageType:"image/gif",tiled:false,theme:"NAPTAN"},NAPTAN_PRIVATE:null,NAPTAN_PUBLIC:null,SALTING:{name:"Salting routes",columns:"ROUTE_ID,ROUTE_NAME,USRN,ROADNUMBER,ROADNAME,PRIORITY,SALT_TYPE,DESCRIPT,LAST_UPDATE,ORGANISATION_NAME",lyrType:"saltingroute",theme:"SALTING",antialias:"full"},SALTING_PRIVATE:null,SALTING_PUBLIC:null,STREETLIGHT:{name:"Street lighting",columns:"TOWN,STREET,UNITNO,EASTING,NORTHING,COLMAT,COLFINISH,COLHEIGHT,BRACKET,LOCATION,LAST_UPDATE,ORGANISATION_NAME,UNITDESC",lyrType:"streetlight",theme:"STREETLIGHT"},STREETLIGHT_PRIVATE:null,STREETLIGHT_PUBLIC:null,NSG_STREET:{name:"NSG (unthemed)",columns:"USRN,STREET,LOCALITY,TOWN,COUNTY,ROAD_NUMBER,EASTING,NORTHING,ORGANISATION_NAME",lyrType:"nsg",theme:"NSG_STREET",antialias:"full"},NSG_STREET_PRIVATE:null,NSG_STREET_PUBLIC:null,NSG_REINSTATEMENTDESIG:{name:"NSG - Reinstatement designation",columns:"USRN,STREET,TOWN,REINSTATEMENT_TYPE,MULTI_DESIGNATIONS,REINSTATE_TYPE_CODE,ORGANISATION_NAME",lyrType:"nsg_reinstate_desig",theme:"NSG_REINSTATEMENTDESIG",infoGroup:"NSG_STREET",chkDup:"USRN",antialias:"full"},NSG_REINSTATEMENTDESIG_PRIVATE:null,NSG_REINSTATEMENTDESIG_PUBLIC:null,NSG_ROADSTATUS:{name:"NSG - Road status",columns:"USRN,STREET,TOWN,ROAD_STATUS,MULTI_ROAD_STATUS,ORGANISATION_NAME",lyrType:"nsg_road_status",theme:"NSG_ROADSTATUS",infoGroup:"NSG_STREET",chkDup:"USRN",antialias:"full"},NSG_ROADSTATUS_PRIVATE:null,NSG_ROADSTATUS_PUBLIC:null,NSG_SPECIALDESIG:{name:"NSG - Special designation",columns:"USRN,STREET,TOWN,SPECIAL_DESIG_CODE,SPECIAL_DESIG_LOC,SPECIAL_DESIG_DESC,SPECIAL_DESIGNATION,WHOLE_ROAD,MULTI_SPECIAL_DESIGNATION,ORGANISATION_NAME",lyrType:"nsg_special_desig",theme:"NSG_SPECIALDESIG",infoGroup:"NSG_STREET",chkDup:"USRN",antialias:"full"},NSG_SPECIALDESIG_PRIVATE:null,NSG_SPECIALDESIG_PUBLIC:null,TRO:{name:"Parking restrictions (TROs)",columns:"SWA_ORG_REF,ORDER_ID,ORDER_TYPE,ORDER_REF,SIDE_OF_ROAD,LOCATION,SCHEDULE,EASTING,NORTHING,DATE_FROM,DATE_TO,TRO_LOCATION,TRO_DESCRIPTION,LAST_UPDATE,ORGANISATION_NAME,TRO_STYLE_ID,FILL_COLOUR,STROKE_COLOUR",lyrType:"tro",theme:"TRO",chkDup:"SIDE_OF_ROAD,SCHEDULE,TRO_LOCATION",antialias:"full"},TRO_PRIVATE:null,TRO_PUBLIC:null,COMMUNITY_AREAS:{name:"Community Areas",columns:"ORGANISATION_ID,MEMBERS,NAME,LABEL,URL,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",lyrType:"community_areas",theme:"COMMUNITY_AREAS",antialias:"full"},COMMUNITY_AREAS_PRIVATE:null,COMMUNITY_AREAS_PUBLIC:null,LORRYROUTES:{name:"Lorry routes",columns:"SWA_ORG_REF,ORDER_ID,ORDER_TYPE,ORDER_REF,SIDE_OF_ROAD,LOCATION,EASTING,NORTHING,DATE_FROM,TRO_LOCATION,TRO_DESCRIPTION,LAST_UPDATE,ORGANISATION_NAME,TRO_STYLE_ID,FILL_COLOUR,STROKE_COLOUR",lyrType:"lorryroute",theme:"LORRYROUTES",antialias:"full"},LORRYROUTES_PRIVATE:null,LORRYROUTES_PUBLIC:null,RESTRICTIONS:{name:"Restrictions",columns:"NOTIFICATIONTYPE,PROPOSEDRESTRICTION,CREATEDATE,COMMENTS,PROJREF,PROJDESC,WORKSREF,WORKSDESC,USRN,LOCDESC,PROPOSEDSTARTDATE,RESTRICTIONENDDATE,PROMOTERNAME,PROMOTERADDRESS,CONTRACTORNAME,CONTRACTORADDRESS,LOCTYPE,GEOM,LAST_UPDATE,ORGANISATION_NAME",lyrType:"restriction",theme:"RESTRICTIONS_PUBLIC",antialias:"full"},RESTRICTIONS_PRIVATE:null,RESTRICTIONS_PUBLIC:null,ASD_2_TRAFFIC_SENS_STREETS:{name:"Traffic sensitive streets",columns:"USRN,MIN_TS_TIM,ROADDESIGNATION,WHOLE,ROADNAME,LAST_UPDATE,ORGANISATION_NAME",lyrType:"asd_traffic_sensitive_streets",theme:"ASD_2_TRAFFIC_SENS_STREETS",antialias:"full"},ASD_3_SED:{name:"Special Engineering Difficulty ",columns:"USRN,STREET,DESCRIPTIO,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",lyrType:"asd_specialengdiff",theme:"ASD_3_SED",tiled:false},ASD_9_ENV_SENSITIVE_AREAS:{name:"Environmentaly sensitive areas",columns:"IDCO,LENGTH_MET,HAB_TYPE,UK_RARE_SC,KENT_RARE_,WOOD__INDI,GRASS_INDI,NOTABLE,SPRING_CUT,AUTUMN_CUT,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",lyrType:"envsensitivearea",theme:"ASD_9_ENV_SENSITIVE_AREAS",antialias:"full"},ASD_10_STRUCTURES_NOT_SED:{name:"Structures (not SED)",columns:"USRN,STREET,RESTRICT,RESTRICT1,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",lyrType:"asd_structures_notsed",imageType:"image/gif",tiled:false,theme:"ASD_10_STRUCTURES_NOT_SED"},ASD_12_PIPELINES:{name:"Pipelines",columns:"TYPE1_USRN,TYPE2_USRN,ESUID,ESU_LENGTH,STREET,DESCRIPTIO,RESTRICT1,RESTRICT2,RESTRICT3,RESTRICT4,RESTRICT5,RESTRICT6,RESTRICT7,RESTRICT8,RESTRICT9,RESTRICT10,RESTRICT11,RESTRICT12,RESTRICT13,RESTRICT14,RESTRICT15,MORE,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",lyrType:"asd_pipelines",theme:"ASD_12_PIPELINES",antialias:"full"},ASD_20_PEDCROSSINGS:{name:"Pedestrian crossings",columns:"USRN,STREET,RESTRICT,RESTRICT1,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",lyrType:"asd_pedestrian_crossing",imageType:"image/gif",tiled:false,theme:"ASD_20_PEDCROSSINGS"},ASD_21_SPEED_LIMITS:{name:"Speed limits",columns:"USRN,STREET,DESCRIPTIO,WHOLE_STREET,SPEED_LIMIT,SL_CODE,PERIOD,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",lyrType:"asd_speedlimits",theme:"ASD_21_SPEED_LIMITS_unthemed",chkDup:"USRN",antialias:"full"},KENT_NOTIFICATION_OF_ACTS:{name:"Early notification of activities",columns:"ID,USRN,TOWN,DISTRICT,ROAD_NAME,EASTING,NORTHING,WHOLE_ROAD,SECTION,COORDS,LAST_UPDATE,ORGANISATION_NAME",lyrType:"kent_earlyNotificationActivities",theme:"KENT_NOTIFICATION_OF_ACTS",antialias:"full"},OLYMPIC_ROUTE_NETWORK:{name:"Olympic Route Network",columns:"USRN,SWA_ORG_REF,DESCRIPTIO,LOCALITY,TOWN,ROADNUM,OR_TYPE,STROKE_COLOR,SPECIAL_DESIG",lyrType:"OlympicRouteNetwork",objType:"line",imageType:"image/gif",tiled:true,theme:"Olympic_Route_Network",antialias:"full",chkDup:"USRN"},OLYMPIC_TORCHROUTE:{name:"Olympic Torch Route",columns:"TR_ID,RELAY_DAY_,DAY,TR_DATE,TOWNS_IN_T,NATION_OR_",lyrType:"OlympicTorchRoute",tiled:true,theme:"Olympic_TorchRoute",antialias:"full"},JEMA_GEOLOGY_DRIFT:{name:"Drift geology",columns:"DRIFT_TYPE_ID,GEN,DRIFT_TYPE,FILL,LAST_UPDATE,ORGANISATION_NAME",lyrType:"jema_geology_drift",theme:"JEMA_GEOLOGY_DRIFT",chkDup:"DRIFT_TYPE_ID",antialias:"full"},JEMA_GEOLOGY_SOLID:{name:"Solid geology",columns:"SOLID_TYPE_ID,GEN,SOLID_TYPE,FILL,LAST_UPDATE,ORGANISATION_NAME",lyrType:"jema_geology_solid",theme:"JEMA_GEOLOGY_SOLID",chkDup:"SOLID_TYPE_ID",antialias:"full"},JEMA_GEOLOGY_FAULTS:{name:"Faultlines",columns:"ID,LAST_UPDATE,ORGANISATION_NAME",lyrType:"jema_geology_faults",theme:"JEMA_FAULTLINES",showProperties:false,antialias:"full"},JEMA_GEOLOGY_BOREHOLES:{name:"Boreholes",columns:"REGNO,NAME,LAST_UPDATE,ORGANISATION_NAME",lyrType:"jema_geology_boreholes",theme:"JEMA_BOREHOLES",antialias:"full"},JEMA_SOURCEPROTECTION:{name:"Source protection",columns:"SP_ID,SP_TYPE_ID,CODE,NAME,SP_TYPE,FILL,LAST_UPDATE,ORGANISATION_NAME",lyrType:"jema_source_protection",theme:"JEMA_SOURCEPROTECTION",chkDup:"SP_TYPE_ID",antialias:"full"},JEMA_TOPOGRAPHY:{name:"Topography",columns:"HEIGHT,LAST_UPDATE,ORGANISATION_NAME",lyrType:"jema_site",lyrType:"jema_topography",theme:"JEMA_TOPOGRAPHY",showProperties:false,antialias:"full"},JEMA_SITES:{name:"Landfill sites",columns:"SITEID,SITENAME,ISLANDFILL,EASTING,NORTHING,LAST_UPDATE,ORGANISATION_NAME",cql:null,lyrType:"jema_site",theme:"JEMA_SITES",chkDup:"SITEID",antialias:"full"},JEMA_SAMPLESITES:{name:"Sample sites",columns:"SITEID,MAP_REF,SITENAME,SAMPLESITETYPE,SYMBOLID,FILL,EASTING,NORTHING,SITESTATUS,LAST_UPDATE,ORGANISATION_NAME",lyrType:"jema_samplesite",theme:"JEMA_SAMPLESITES_ONLINE",tiled:false,antialias:"full"},JEMA_SAMPLESITES_ONLINE:null,JEMA_SAMPLESITES_OFFLINE:null,setMapParamsPostLoad:function(){Elgin.MapSettings.url_GeoServerWFS=Elgin.MapSettings.url_GeoServerWFS.replace("geoserverInstance",Elgin.mgMapSettings.geoserverDynamic);
Elgin.MapSettings.url_GeoServerWMS=Elgin.MapSettings.url_GeoServerWMS.replace("geoserverInstance",Elgin.mgMapSettings.geoserverDynamic);Elgin.MapSettings.STREETWORKSSEARCH=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSCURRENTSEVERE=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSCURRENTHIGH=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSCURRENTMEDIUM=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSCURRENTLOW=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFUTURESEVERE=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFUTUREHIGH=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFUTUREMEDIUM=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFUTURELOW=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFORWARDPLAN=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFORWARDPLAN_PRIVATE=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFORWARDPLAN_PUBLIC=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSFORWARDPLANNING=Object.clone(Elgin.MapSettings.STREETWORKS);Elgin.MapSettings.STREETWORKSSEARCH.name="Roadworks - search results";Elgin.MapSettings.STREETWORKSSEARCH.coordRegEx=/CE BETWEEN [0-9\.]+\s*AND [0-9\.]+\s*AND CN BETWEEN [0-9\.]+\s*AND [0-9\.]+\s*AND\s*/;Elgin.MapSettings.STREETWORKSSEARCH.cql=swSearch_cqlWhere;Elgin.MapSettings.STREETWORKSSEARCH.theme="Streetworks_FullTheme_type1";Elgin.MapSettings.STREETWORKSCURRENTSEVERE.theme="Streetworks_FullTheme_type2";Elgin.MapSettings.STREETWORKSCURRENTHIGH.theme="Streetworks_FullTheme_type2";Elgin.MapSettings.STREETWORKSCURRENTMEDIUM.theme="Streetworks_FullTheme_type1";Elgin.MapSettings.STREETWORKSCURRENTLOW.theme="Streetworks_FullTheme_type1";Elgin.MapSettings.STREETWORKSFUTURESEVERE.theme="Streetworks_FullTheme_type2";Elgin.MapSettings.STREETWORKSFUTUREHIGH.theme="Streetworks_FullTheme_type2";Elgin.MapSettings.STREETWORKSFUTUREMEDIUM.theme="Streetworks_FullTheme_type1";Elgin.MapSettings.STREETWORKSFUTURELOW.theme="Streetworks_FullTheme_type1";Elgin.MapSettings.STREETWORKSFORWARDPLAN_PRIVATE.theme="Streetworks_FullTheme_type2";Elgin.MapSettings.STREETWORKSFORWARDPLAN_PUBLIC.theme="Streetworks_FullTheme_type2";Elgin.MapSettings.STRUCTURES_PRIVATE=Elgin.MapSettings.STRUCTURES;Elgin.MapSettings.STRUCTURES_PUBLIC=Elgin.MapSettings.STRUCTURES;Elgin.MapSettings.NAPTAN_PRIVATE=Elgin.MapSettings.NAPTAN;Elgin.MapSettings.NAPTAN_PUBLIC=Elgin.MapSettings.NAPTAN;Elgin.MapSettings.SALTING_PRIVATE=Elgin.MapSettings.SALTING;Elgin.MapSettings.SALTING_PUBLIC=Elgin.MapSettings.SALTING;Elgin.MapSettings.STREETLIGHT_PRIVATE=Elgin.MapSettings.STREETLIGHT;Elgin.MapSettings.STREETLIGHT_PUBLIC=Elgin.MapSettings.STREETLIGHT;Elgin.MapSettings.TRO_PRIVATE=Elgin.MapSettings.TRO;Elgin.MapSettings.TRO_PUBLIC=Elgin.MapSettings.TRO;Elgin.MapSettings.TRO_HISTORIC=Object.clone(Elgin.MapSettings.TRO);Elgin.MapSettings.TRO_HISTORIC.lyrType="tro_historic";Elgin.MapSettings.COMMUNITY_AREAS_PRIVATE=Elgin.MapSettings.COMMUNITY_AREAS;Elgin.MapSettings.COMMUNITY_AREAS_PUBLIC=Elgin.MapSettings.COMMUNITY_AREAS;Elgin.MapSettings.LORRYROUTES_PRIVATE=Elgin.MapSettings.LORRYROUTES;Elgin.MapSettings.LORRYROUTES_PUBLIC=Elgin.MapSettings.LORRYROUTES;Elgin.MapSettings.RESTRICTIONS_PRIVATE=Elgin.MapSettings.RESTRICTIONS;Elgin.MapSettings.RESTRICTIONS_PUBLIC=Elgin.MapSettings.RESTRICTIONS;Elgin.MapSettings.NSG_STREET_PRIVATE=Elgin.MapSettings.NSG_STREET;Elgin.MapSettings.NSG_STREET_PUBLIC=Elgin.MapSettings.NSG_STREET;Elgin.MapSettings.NSG_REINSTATEMENTDESIG_PRIVATE=Elgin.MapSettings.NSG_REINSTATEMENTDESIG;Elgin.MapSettings.NSG_REINSTATEMENTDESIG_PUBLIC=Elgin.MapSettings.NSG_REINSTATEMENTDESIG;Elgin.MapSettings.NSG_SPECIALDESIG_PRIVATE=Elgin.MapSettings.NSG_SPECIALDESIG;Elgin.MapSettings.NSG_SPECIALDESIG_PUBLIC=Elgin.MapSettings.NSG_SPECIALDESIG;Elgin.MapSettings.NSG_ROADSTATUS_PRIVATE=Elgin.MapSettings.NSG_ROADSTATUS;Elgin.MapSettings.NSG_ROADSTATUS_PUBLIC=Elgin.MapSettings.NSG_ROADSTATUS;Elgin.MapSettings.NSG_ROADSTATUS_PRIVATE=Elgin.MapSettings.NSG_ROADSTATUS;Elgin.MapSettings.NSG_ROADSTATUS_PUBLIC=Elgin.MapSettings.NSG_ROADSTATUS;Elgin.MapSettings.JEMA_SITES.cql=jemaUserSites_cqlWhere;Elgin.MapSettings.JEMA_SAMPLESITES.cql=jemaUserSites_cqlWhere;Elgin.MapSettings.JEMA_SAMPLESITES_ONLINE=Elgin.MapSettings.JEMA_SAMPLESITES;Elgin.MapSettings.JEMA_SAMPLESITES_OFFLINE=Elgin.MapSettings.JEMA_SAMPLESITES}};Ext.namespace("mapfish.widgets");mapfish.widgets.RadioTreeNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{renderElements:function(f,o,m,p){this.indentMarkup=f.parentNode?f.parentNode.ui.getChildIndent():"";var g=typeof o.checked=="boolean";var h=f.attributes.radioGrp||"radioGrp";var c=o.href?o.href:Ext.isGecko?"":"#";var e=['<li class="x-tree-node"><div ext:tree-node-id="',f.id,'" class="x-tree-node-el x-tree-node-leaf x-unselectable ',o.cls,'" unselectable="on">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />','<img src="',o.icon||this.emptyIcon,'" class="x-tree-node-icon',(o.icon?" x-tree-node-inline-icon":""),(o.iconCls?" "+o.iconCls:""),'" unselectable="on" />',g?('<input class="x-tree-node-cb" type="radio" id="'+f.id+'" name="'+h+'" '+(o.checked?'checked="checked" />':"/>")):"",'<a hidefocus="on" class="x-tree-node-anchor" href="',c,'" tabIndex="1" ',o.hrefTarget?' target="'+o.hrefTarget+'"':"",'><span unselectable="on">',f.text,"</span></a></div>",'<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>"].join("");var b;if(p!==true&&f.nextSibling&&(b=f.nextSibling.ui.getEl())){this.wrap=Ext.DomHelper.insertHtml("beforeBegin",b,e)}else{this.wrap=Ext.DomHelper.insertHtml("beforeEnd",m,e)}this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];var l=this.elNode.childNodes;this.indentNode=l[0];this.ecNode=l[1];this.iconNode=l[2];var k=3;if(g){this.checkbox=l[3];k++}this.anchor=l[k];this.textNode=l[k].firstChild},_unused_renderElements:function(h,c,f,b){mapfish.widgets.RadioTreeNodeUI.superclass.renderElements.apply(this,arguments);var g=Ext.DomQuery.selectNode(".x-tree-node-cb",this.elNode);var e=h.attributes.radioGrp||"radioGrp";g.setAttribute("type","radio");g.setAttribute("id",h.id);g.setAttribute("name",e)},onRadioChange:function(){var a=this.checkbox.checked;this.node.attributes.checked=a;this.fireEvent("radiochange",this.node,a)}});mapfish.widgets.LayerTreeEventModel=Ext.extend(Ext.tree.TreeEventModel,{delegateClick:function(b,a){if(!this.beforeEvent(b)){return}if(b.getTarget("input[type=checkbox]",1)){this.onCheckboxClick(b,this.getNode(b))}else{if(b.getTarget("input[type=radio]",1)){this.onRadioClick(b,this.getNode(b))}else{if(b.getTarget(".x-tree-ec-icon",1)){this.onIconClick(b,this.getNode(b))}else{if(this.getNodeTarget(b)){this.onNodeClick(b,this.getNode(b))}}}}},onRadioClick:function(b,a){if(!a.ui.onRadioChange){OpenLayers.Console.error("Invalid TreeNodeUI Class, no onRadioChange is available");return}a.ui.onRadioChange(b)}});mapfish.widgets.LayerTree=function(a){Ext.apply(this,a);mapfish.widgets.LayerTree.superclass.constructor.call(this)};Ext.extend(mapfish.widgets.LayerTree,Ext.tree.TreePanel,{separator:":",model:null,showWmsLegend:false,rootVisible:false,animate:true,autoScroll:true,loader:new Ext.tree.TreeLoader({}),enableDD:false,containerScroll:true,ascending:true,_automaticModel:true,layerNameToLayer:{},baseLayerNames:[],layersWithSublayers:{},layerToNodeIds:{},nodeIdToNode:{},nodeIdToLayers:{},hasCheckbox:function(a){return typeof(a.attributes.checked)=="boolean"},setNodeChecked:function(a,e,b){var c=(a instanceof Ext.data.Node)?a:this.getNodeById(a);if(!c||!this.hasCheckbox(c)){return}if(e===undefined){e=!c.attributes.checked}c.attributes.checked=e;if(c.ui&&c.ui.checkbox){c.ui.checkbox.checked=e}if(b||(b===undefined)){c.fireEvent("checkchange",c,e)}},_updateCachedObjects:function(){if(!this.map){OpenLayers.Console.error("map Object needs to be available when calling _updateCachedObjects");
return}this.layerNameToLayer={};this.baseLayerNames=[];this.layersWithSublayers={};this.layerToNodeIds={};this.nodeIdToNode={};this.nodeIdToLayers={};Ext.each(this.map.layers,function(b){var a=b.name;this.layerNameToLayer[a]=b;if(b.isBaseLayer){this.baseLayerNames.push(a)}},this);this.getRootNode().cascade(function(c){if(!c.attributes.layerNames){return true}var e=c.attributes.layerNames;for(var b=0;b<e.length;b++){var a=e[b];if(a.indexOf(this.separator)!=-1){var a=a.split(this.separator)[0];this.layersWithSublayers[a]=true}if(!this.nodeIdToLayers[c.id]){this.nodeIdToLayers[c.id]=[]}this.nodeIdToLayers[c.id].push(this.layerNameToLayer[a])}},this);this.getRootNode().cascade(function(e){var c=e.attributes.checked;var f=e.attributes.layerNames;if(!f){return}for(var b=0;b<f.length;b++){var a=f[b];if(!a){continue}if(!this.layerToNodeIds[a]){this.layerToNodeIds[a]=[]}this.layerToNodeIds[a].push(e.id);this.nodeIdToNode[e.id]=e}},this)},_updateCheckboxAncestors:function(){var e={};var c=this;function b(k){if(!c.hasCheckbox(k)){throw new Error(arguments.callee.name+" should only be called on checkbox nodes")}var h=[];k.eachChild(function(l){if(c.hasCheckbox(l)){h.push(l)}},this);if(h.length==0){return k.attributes.checked}var g=true;Ext.each(h,function(l){if(!b(l)){g=false;return false}},this);c.setNodeChecked(k,g,false);delete e[k.id];return g}var a=[];this.getRootNode().cascade(function(g){if(this.hasCheckbox(g)){a.push(g);e[g.id]=true}},this);var f;while(f=a.shift()){if(e[f.id]){b(f)}}},_handleModelChange:function LT__handleModelChange(q,k){if(q){q.cascade(function(r){this.setNodeChecked(r,k,false)},this)}this._updateCheckboxAncestors();if(!this.map){return}this._updateCachedObjects();function g(){var r={};Ext.each(this.map.layers,function(w){var u=w.name;r[u]=w.visibility;if(!(w instanceof OpenLayers.Layer.WMS)&&!(w instanceof OpenLayers.Layer.WMS.Untiled)&&!(w instanceof OpenLayers.Layer.MapServer)){return}if(!this.layersWithSublayers[w.name]){return}if(w.isBaseLayer){OpenLayers.Console.error("Using sublayers on a base layer is not supported (base layer is "+u+")")}if(!w._origLayers){w._origLayers=w.params.LAYERS||w.params.layers}var A=w._origLayers;if(A instanceof Array){for(var s=0;s<A.length;s++){var z=A[s];r[u+this.separator+z]=w.visibility}}},this);return r}function e(s){var r={};this.getRootNode().cascade(function(A){var z=A.attributes.checked;var C=A.attributes.layerNames;var B=null;if(!C){return}for(var w=0;w<C.length;w++){var u=C[w];if(!u){continue}if(s[u]==undefined){OpenLayers.Console.error("Invalid layer: ",u)}if(A.attributes.radio){B=A.attributes.radioGrp||"radioGrp";if(!c[B]){c[B]={}}c[B][u]=z}if(r[u]){continue}if(A==q){if(this.baseLayerNames.indexOf(u)!=-1){o=u}if(B){h[0]=B;h[1]=u}r[u]=true}s[u]=z}},this);return s}function m(u,s,z){var w=0;for(var r=0;r<this.baseLayerNames.length;r++){if(u[this.baseLayerNames[r]]){w++}}if(w==1){return u}for(var r=0;r<this.baseLayerNames.length;r++){u[this.baseLayerNames[r]]=false}if(s){u[s]=true;return u}if(!z){return u}u[z]=true;return u}function p(u,z,s){for(var w in s){for(var r in s[w]){if(z[0]==w){u[r]=r==z[1]}else{u[r]=s[w][r]}}}return u}function a(B){for(var u in B){var z=this.layerToNodeIds[u];if(!z){continue}for(var w=0;w<z.length;w++){var A=this.nodeIdToNode[z[w]];if(!A){continue}var C=A.attributes.layerNames;if(!C){OpenLayers.Console.error("unexpected state");continue}var r=true;for(var s=0;s<C.length;s++){var u=C[s];if(!u){continue}if(!B[u]){r=false;break}}this.setNodeChecked(A,r,false)}}}function b(E){var F={};for(var D in E){var s=E[D];var G=D.split(this.separator);if(G.length!=2){continue}delete E[D];D=G[0];var H=G[1];if(!F[D]){F[D]=[]}if(s){F[D].push(H)}}for(D in F){if(E[D]!==undefined){delete E[D]}}for(var D in E){var C=this.layerNameToLayer[D];if(!C){OpenLayers.Console.error("Non existing layer name",D);continue}if(this.baseLayerNames.indexOf(D)!=-1){if(E[D]){this.map.setBaseLayer(C)}}else{C.setVisibility(E[D])}}for(var D in F){var C=this.layerNameToLayer[D];var z=F[D];if(C.isBaseLayer){OpenLayers.Console.error("base layer for sublayer are not supported");return}if(z.length==0){C.setVisibility(false,true)}else{if(!this.enableDD){if(!C._origLayers){OpenLayers.Console.error("Assertion failure")}var B=C._origLayers;var A=[];for(var w=0;w<B.length;w++){var u=B[w];if(z.indexOf(u)!=-1){A.push(u)}}z=A}var r=C.params.LAYERS?"LAYERS":"layers";if(!mapfish.Util.arrayEqual(C.params[r],z)){C.params[r]=z;C.redraw()}C.setVisibility(true,true)}}}var l;if(this.map.baseLayer){l=this.map.baseLayer.name}var o;var c={};var h=[];var f=g.call(this);f=e.call(this,f);m.call(this,f,o,l);p.call(this,f,h,c);a.call(this,f);b.call(this,f)},_extractOLModel:function LT__extractOLModel(){var m=[];var e=this.map.layers.slice();if(!this.ascending){e.reverse()}for(var o=0;o<e.length;o++){var f=e[o];var g=[];if(f instanceof OpenLayers.Layer.WMS||f instanceof OpenLayers.Layer.WMS.Untiled||f instanceof OpenLayers.Layer.MapServer){var k=f.params.LAYERS||f.params.layers;if(k instanceof Array){for(var h=0;h<k.length;h++){var p=k[h];var a;if(this.showWmsLegend){a=mapfish.Util.getIconUrl(f.url,{layer:p})}var b={text:p,checked:f.getVisibility(),icon:a,layerName:f.name+this.separator+p,children:[],cls:"cf-wms-node"};if(this.ascending){g.push(b)}else{g.unshift(b)}}}}var c={text:f.name,checked:f.getVisibility(),layerName:(g.length>0?null:f.name),children:g};if(!f.displayInLayerSwitcher){c.uiProvider=function(){};c.hidden=true;c.uiProvider.prototype={render:function(){},renderIndent:function(){},updateExpandIcon:function(){}}}m.push(c)}return m},_updateOrder:function(){this._updateCachedObjects();function e(m,h){for(var k=0;k<m.length;k++){var g=m[k];if(g.name==h){return k}}return -1}var a=this.map.layers.slice();var f={};var b=[];this.getRootNode().cascade(function(g){if(this.ascending){b.push(g)}else{b.unshift(g)}},this);Ext.each(b,function(g){var h=this.nodeIdToLayers[g.id];if(!h){return}Ext.each(h,function(m){var l=m.name;if(f[l]){return}f[l]=true;var k=e(a,l);if(k==-1||!this.layerNameToLayer[l]){throw new Error("Layer "+l+" not available")}a.splice(k,1);a.push(this.layerNameToLayer[l])},this)},this);this._updateCheckboxAncestors();this.map.layers=a;for(var c=0;c<this.map.layers.length;c++){this.map.setLayerZIndex(this.map.layers[c],c)}},_fixupModel:function(){this.getRootNode().cascade(function(b){var a=b.attributes;if(!a.layerNames&&a.layerName){a.layerNames=[a.layerName];delete a.layerName}},this);if(this.map){this._updateCachedObjects()}this.getRootNode().cascade(function(c){var e;if(!c.attributes.radio&&(!this.map||!(e=this.nodeIdToLayers[c.id]))){return}var b=false;var a=false;if(e){b=true;Ext.each(e,function(f){if(!f.isBaseLayer){b=false}if(f.displayInLayerSwitcher){a=true}},this)}else{a=true}if((b||c.attributes.radio)&&a){c.attributes.uiProvider=mapfish.widgets.RadioTreeNodeUI;if(c.ui){c.ui=new mapfish.widgets.RadioTreeNodeUI(c)}}},this)},initComponent:function(){this.eventModel=new mapfish.widgets.LayerTreeEventModel(this);mapfish.widgets.LayerTree.superclass.initComponent.call(this);this.addListener("checkchange",function e(h,g){this._handleModelChange(h,g)},this);this.addListener("radiochange",function b(h,g){this._handleModelChange(h,g)},this);this._automaticModel=!this.model;if(!this.model){this.model=this._extractOLModel()}var a={text:"Root",draggable:false,id:"source",children:this.model,leaf:false};function f(g){var l=new Ext.tree.TreeNode(g);var k=g.children;l.leaf=!k;if(!k){return l}for(var h=0;h<k.length;h++){if(!k[h]){continue}l.appendChild(f(k[h]))}return l}var c=f(a);this.setRootNode(c);this._fixupModel();if(this.enableDD){this.addListener("dragdrop",function(){this._updateOrder(arguments)},this);this.addListener("nodedragover",this.isDragAllowed,this)}if(!this._automaticModel){this._handleModelChange(null,null);if(this.enableDD){this._updateOrder()}}},isDragAllowed:function(c){var a=c.data.node;var b=c.target;if(c.point=="above"||c.point=="below"){b=b.parentNode}if(a.parentNode!=b){return false}return true},onRender:function(b,a){if(!this.el){this.el=document.createElement("div")
}mapfish.widgets.LayerTree.superclass.onRender.apply(this,arguments)}});Ext.reg("layertree",mapfish.widgets.LayerTree);mapfish.widgets.LayerTree.getNodeLayers=function(a,c){var b=[];c.cascade(function(f){var e=a.nodeIdToLayers[f.id];if(e){b=b.concat(e)}});return b};mapfish.widgets.LayerTree.removeNode=function(a,c){c.cascade(function(o){if(o.attributes&&o.attributes.layerNames){var m=o.attributes.layerNames;for(var g=0;g<m.length;++g){var f=m[g].split(a.separator);var l=a.layerNameToLayer[f[0]];var k=f[1];var h;if(l.params.LAYERS){h=l.params.LAYERS=mapfish.Util.fixArray(l.params.LAYERS)}else{h=l.params.layers=mapfish.Util.fixArray(l.params.layers)}if(k&&h){h.remove(k)}if(!k||!h||h.length==0){l.destroy()}else{l.redraw()}}}});var b=c.parentNode;c.remove();while(b){if(b.hasChildNodes()){break}var e=b;b=b.parentNode;e.remove()}a._updateCachedObjects()};mapfish.widgets.LayerTree.MenuFeatures={opacitySlide:function(a,c,b){if(b.length==0){return null}return{text:OpenLayers.Lang.translate("mf.layertree.opacity"),menu:{plain:true,items:[mapfish.widgets.LayerTree.MenuFeatures.opacitySlideDirect(a,c,b)]}}},opacitySlideDirect:function(a,e,c){if(c.length==0){return null}var f=0;for(var b=0;b<c.length;++b){f+=c[b].opacity==null?1:c[b].opacity}f=f/c.length;return new Ext.menu.Adapter(new Ext.Slider({width:200,value:f*100,listeners:{change:function(h,k){for(var g=0;g<c.length;++g){c[g].setOpacity(k/100)}}}}))},remove:function(a,f,e){if(e.length==0){return null}for(var c=0;c<e.length;++c){var b=e[c];if(b.isBaseLayer&&b.getVisibility()){return null}}return{text:OpenLayers.Lang.translate("mf.layertree.remove"),handler:function(){mapfish.widgets.LayerTree.removeNode(a,f)}}},zoomToExtent:function(a,f,e){if(e.length==0){return null}var g=null;for(var c=0;c<e.length;++c){var b=e[c];if(g){g.extend(b.maxExtent)}else{g=b.maxExtent.clone()}}return{text:OpenLayers.Lang.translate("mf.layertree.zoomToExtent"),handler:function(){a.map.zoomToExtent(g)}}}};mapfish.widgets.LayerTree.createContextualMenuPlugin=function(a){return{init:function(b){function c(m,o){var l=mapfish.widgets.LayerTree.getNodeLayers(b,m);var f=[];for(var g=0;g<a.length;++g){var k=mapfish.widgets.LayerTree.MenuFeatures[a[g]];var h=k(b,m,l);if(h){f.push(h)}}if(f.length>0){var p=new Ext.menu.Menu({ignoreParentClick:true,defaults:{scope:b},items:f});p.showAt(o.getXY());p.on("hide",function(){p.destroy()})}}if(Ext.isOpera){b.on("click",function(f,g){if(g.hasModifier()){g.stopEvent();c(f,g)}})}else{b.on("contextMenu",function(f,g){g.stopEvent();c(f,g)})}}}};mapfish.widgets.LayerTree.createDisableLayersPlugin=function(a){return{init:function(b){if(!b.map){return}b.map.events.on({zoomend:function(){function c(f,e){if(e){f.disable()}else{var g=b.map.getScale();g=g*a/OpenLayers.DOTS_PER_INCH;if(g<f.attributes.minScale||g>f.attributes.maxScale){f.disable();e=true}else{f.enable();e=false}}f.eachChild(function(h){c(h,e)})}c(b.root,false)}})}}};var Elgin=window.Elgin||{};Elgin.LayerTree={tree:null,legendWin:null,layerTreeWin:null,layerTreeFirstView:true,saveMLParamsTimer:0,saveMLParams:false,infoWin:null,infoTabs:null,infoNav:null,firstInfoTab:null,MAX_HEIGHT:270,loadWMSLayers:function(){var e=1.5;var c="image/png";var b="e";var f="";var g=Elgin.OlMap._getUsersMapLayers("layers");if(!g){return}for(var a=0;a<g.length;a++){Elgin.OlMap.map.addLayer(Elgin.OlMap._getWMSLayer(Elgin.LayerTree.getWmsUrl(),b,g[a].layer,c,e,Elgin.LayerTree.getCQLFilter(g[a].layer),Elgin.LayerTree.getLayerTheme(g[a].layer),Elgin.LayerTree.getImageType(g[a].layer),Elgin.LayerTree.getImageTiling(g[a].layer),Elgin.LayerTree.getAntialising(g[a].layer)))}},getWmsUrl:function(){var a=Elgin.MapSettings.url_GeoServerWMS;var b=0;if(Elgin.mgMapSettings.geoserverWmsDnsSuffixes.length>0){if(Elgin.mgMapSettings.geoserverWmsDnsSuffixes.length>1){b=Math.floor(Math.random()*Elgin.mgMapSettings.geoserverWmsDnsSuffixes.length)}a=a.replace(/http:\/\/d[23]\./,"http://"+Elgin.mgMapSettings.geoserverWmsDnsSuffixes[b])}return a},getCQLFilter:function(a){if(!Elgin.MapSettings[a]){alert("Map error!\n[err] '"+a+"' is undefined in Elgin.Mapsetting\n[js] Elgin.LayerTree.js -> Elgin.LayerTree.getCQLFilter()")}if(Elgin.MapSettings[a].cql){var b=Elgin.MapSettings[a].cql}else{var b=null}if(b&&b.replace(/\W/g,"___").length>Elgin.MapSettings.maxCQLLength){alert("Unable to map the layer: "+a+".\n\nIf this is the Roadworks Search layer it is probable that your search parameters resulted in too complex a map transaction.\nPlease simplify your search.");try{logger.error("CQL Filter too long",{jsFile:"/olmap/js/MapFish/Elgin.LayerTree.js",jsFunction:"Elgin.LayerTree.setCQLFilter()",olLayer:a,maxCQLLength:Elgin.MapSettings.maxCQLLength+" (from Elgin.MapSettings.maxCQLLength)",actualCQLLength:b.length,escapedCQLLength:b.replace(/\W/g,"___").length,cql:b})}catch(c){}return"SE_ID = -1"}else{return b}},getLayerTheme:function(a){if(!Elgin.MapSettings[a].theme){return null}else{return Elgin.MapSettings[a].theme}},getAntialising:function(a){if(!Elgin.MapSettings[a].antialias){return"none"}else{return Elgin.MapSettings[a].antialias}},getImageType:function(a){if(!Elgin.MapSettings[a].imageType){return"image/png"}else{return Elgin.MapSettings[a].imageType}},getImageTiling:function(a){if(typeof(Elgin.MapSettings[a].tiled)=="undefined"){return true}else{return Elgin.MapSettings[a].tiled}},renderLayerTree:function(){var a=Elgin.OlMap._getUsersMapLayers("tree");Elgin.LayerTree.createLayerTreeWindow();Elgin.LayerTree.tree=new mapfish.widgets.LayerTree({xtype:"layertree",map:Elgin.OlMap.map,el:"layers_extwin",model:a,showWmsLegend:true,autoScroll:true,plugins:[Elgin.LayerTree.createDisableLayersPlugin(Elgin.OlMap.map)]});if(!mapPrintWindow){Elgin.LayerTree.tree.render()}},setTreeCookieOnHide:false,createLayerTreeWindow:function(){var a=new Array();a[0]={title:"Map layers",html:"<div id='layers_extwin' style='height:650px;overflow:visible'></div>"};a[1]={title:"Legend",html:"<div id='mapLegend_extwin' style='height:"+(isEToN?285:(Elgin.LayerTree.MAX_HEIGHT-65))+"px;width:100%;overflow:visible'>Loading...</div>",listeners:{activate:Elgin.LayerTree.getMapLegend}};var b=new Ext.TabPanel({region:"center",activeTab:0,resizeTabs:true,enableTabScroll:true,defaults:{autoScroll:true},items:a});Elgin.LayerTree.layerTreeWin=new Ext.Window({layout:"fit",width:220,height:(isEToN?350:Elgin.LayerTree.MAX_HEIGHT),closable:true,defaults:{autoScroll:true},closeAction:"hide",plain:true,x:Elgin.LayerTree.getLayerTreeLeftPos(),y:Elgin.LayerTree.getLayerTreeTopPos(),constrain:true,listeners:{hide:function(){var c=$("displayMapLayers");if(c){c.removeClassName("btnDown")}if(Elgin.LayerTree.setTreeCookieOnHide){Elgin.Utils.createCookie("ELGINMAP_LYRTREE"+mapCookieSuffix,0)}else{Elgin.LayerTree.setTreeCookieOnHide=true}},show:function(){var c=$("displayMapLayers");if(c){c.addClassName("btnDown")}}},items:[b]});Elgin.LayerTree.layerTreeWin.show();Elgin.LayerTree.layerTreeWin.hide()},toggleLayerTree:function(a){btnObj=$(a.name?a.name:a.id);if(Elgin.LayerTree.layerTreeWin.hidden){btnObj.addClassName("btnDown");Elgin.LayerTree.layerTreeWin.x=Elgin.LayerTree.getLayerTreeLeftPos();Elgin.LayerTree.layerTreeWin.y=Elgin.LayerTree.getLayerTreeTopPos();Elgin.LayerTree.layerTreeWin.show();Elgin.Utils.createCookie("ELGINMAP_LYRTREE"+mapCookieSuffix,1)}else{Elgin.LayerTree.layerTreeWin.hide();Elgin.Utils.createCookie("ELGINMAP_LYRTREE"+mapCookieSuffix,0)}},getMapLegend:function(){var a="../index.cfm?";a+="fuseaction=map.mapKey_olmap&";a+="mapLayers="+escape(Elgin.Utils.readCookie("ELGINMAPLYRVIS"+mapCookieSuffix));new Ajax.Request(a,{method:"post",onSuccess:function(e){var b=e.responseText||"<strong>Error: unable to retrieve map key</strong><br><br>Err: <br>[Ajax err 1] <br>[fa: map.mapKey_olmap] <br>[lyrs: "+Elgin.Utils.readCookie("ELGINMAPLYRVIS"+mapCookieSuffix)+"]";var c=$("mapLegend_extwin");if(c){c.innerHTML=b}else{alert("Unable to load map legend")}},onFailure:function(b){Elgin.LayerTree.loadMapLegend_singleLyr("<strong>Error: unable to retrieve map key</strong><br><br>Err: <br>[Ajax err 2] <br>[fa: map.mapKey_olmap] <br>[lyrs: "+Elgin.Utils.readCookie("ELGINMAPLYRVIS"+mapCookieSuffix)+"]");
logger.error("Map AJAX legend request FAILED",{jsFile:"/olmap/js/MapFish/Elgin.LayerTree.js",jsFunction:"Elgin.LayerTree.getMapLegend()",mapLayers:Elgin.Utils.readCookie("ELGINMAPLYRVIS"+mapCookieSuffix),ajaxFailure:"onFailure",ajaxURL:a})},onException:function(b,c){Elgin.LayerTree.loadMapLegend_singleLyr("<strong>Error: unable to retrieve map key</strong><br><br>Err: <br>[Ajax err 4] <br>[fa: map.mapKey_olmap] <br>[lyrs: "+Elgin.Utils.readCookie("ELGINMAPLYRVIS"+mapCookieSuffix)+"]<br><br>Exception:<br>["+c+"]");logger.error("Map AJAX legend request FAILED",{jsFile:"/olmap/js/MapFish/Elgin.LayerTree.js",jsFunction:"Elgin.LayerTree.getMapLegend()",mapLayer:Elgin.Utils.readCookie("ELGINMAPLYRVIS"+mapCookieSuffix),ajaxFailure:"onException",ajaxURL:a,ajaxException:c})}})},displayMapLayerInfo:function(a){if(!a.layer.visibility){return}var b=Elgin.LayerTree.getLayernameStub(a.layer.name);if(!Elgin.MapSettings[b]){return}if(isEToN){return}var e=","+Elgin.Utils.readCookie("ELGINMAP_ACLSDISP")+",";if(Elgin.MapSettings[b].infoGroup){b=Elgin.MapSettings[b].infoGroup}var f=false;for(var c in elginLayerInfo){if(c==b){if(elginLayerInfo[c].isdisclaimer==1&&e.indexOf(","+c+",")==-1){f=true}break}}if(f){Elgin.LayerTree.showMapLayerInfo(b);Elgin.Utils.createCookie("ELGINMAP_ACLSDISP",Elgin.Utils.readCookie("ELGINMAP_ACLSDISP")+","+b)}},showMapLayerInfo:function(e){if(!Elgin.LayerTree.infoWin){if(!Elgin.LayerTree.infoTabs){Elgin.LayerTree.infoTabs=new Ext.TabPanel({enableTabScroll:true,region:"center",defaults:{autoScroll:true}})}var g="<div class='extTabContainer'><ul>";for(var b in elginLayerInfo){if(!elginLayerInfo[b].grouped){if(!e&&!Elgin.LayerTree.firstInfoTab){Elgin.LayerTree.firstInfoTab=b}var a="<div class='extTabContainer'>";a+="<span style='font-size:small'><b>"+elginLayerInfo[b].name+"</b></span><br><br>";g+="<li><a href=\"javascript:Elgin.LayerTree.mapLyrsNavLink('"+b+'\')" title="View info for '+elginLayerInfo[b].name+'">'+elginLayerInfo[b].name+"</a></li>";a+=(elginLayerInfo[b].desc?elginLayerInfo[b].desc+"<br><br>":"");var h=new Array();for(var f=0;f<userACLMapLayers.mapxml_groupname.length;f++){if(userACLMapLayers.mapxml_groupname[f]==b){h.push("<li style='padding-left:15px'>"+userACLMapLayers.laname[f]+"</li>")}}for(var f=0;f<mapLayers_InfoGroups.mapxml_groupname.length;f++){if(mapLayers_InfoGroups.info_grouped_groupname[f]==b){h.push("<li><br><b>"+mapLayers_InfoGroups.layer_name[f]+" map layer is available in the following areas:</b></li>");for(var c=0;c<userACLMapLayers.mapxml_groupname.length;c++){if(userACLMapLayers.mapxml_groupname[c]==Elgin.LayerTree.getLayernameStub(mapLayers_InfoGroups.mapxml_groupname[f])){h.push("<li style='padding-left:15px'>"+userACLMapLayers.laname[c]+"</li>")}}}}if(h.length>0){a+="<b>"+elginLayerInfo[b].name+" map layer is available in the following areas:</b><ul>"+h.join("")+"</ul><br>"}a+="<hr><b><i>Elgin makes no claims as to the accuracy or completeness of the information displayed for this map layer</i></b><br><br>";a+="For queries regarding the data please contact the data provider. The data provider is displayed when you click on a map feature.<br><br>";if(requestDev){a+="<br><b>[dev]</b><br>";a+="lyr name  : "+b+"<br><br>"}a+="<br><br></div>";Elgin.LayerTree.infoTabs.add({id:b,title:elginLayerInfo[b].name,html:a}).show()}}g+="</ul></div>";Elgin.LayerTree.infoNav=new Ext.Panel({title:"Map layers",region:"west",split:true,width:150,collapsible:true,margins:"3 0 3 3",cmargins:"3 3 3 3",html:g,autoScroll:true,defaults:{autoScroll:true}});Elgin.LayerTree.infoWin=new Ext.Window({closable:true,closeAction:"hide",width:600,height:Elgin.LayerTree.MAX_HEIGHT,plain:true,layout:"border",constrain:true,items:[Elgin.LayerTree.infoNav,Elgin.LayerTree.infoTabs],listeners:{hide:function(){Elgin.LayerTree.hideMapLayerInfo()}}})}Elgin.LayerTree.infoWin.show();Elgin.LayerTree.infoTabs.activate((e?e:Elgin.LayerTree.firstInfoTab));$("mapLayerInfo").addClassName("btnDown")},hideMapLayerInfo:function(){Elgin.LayerTree.infoWin.hide();$("mapLayerInfo").removeClassName("btnDown")},toggleMapLayerInfo:function(a){a=$(a);if(a.hasClassName("btnDown")){a.removeClassName("btnDown");Elgin.LayerTree.hideMapLayerInfo()}else{a.addClassName("btnDown");Elgin.LayerTree.showMapLayerInfo()}},mapLyrsNavLink:function(a){Elgin.LayerTree.infoTabs.activate((a?a:Elgin.LayerTree.firstInfoTab))},preSaveMapLayerParams:function(a){if(Elgin.OlMap._initialising==1){return}if(Elgin.LayerTree.saveMLParamsTimer==0){Elgin.LayerTree.saveMLParamsTimer=setTimeout("Elgin.LayerTree.saveMapLayerParams()",1000)}else{return}},saveMapLayerParams:function(){var a=new Array();for(i=0;i<Elgin.OlMap.map.layers.length;i++){if(Elgin.OlMap.map.layers[i] instanceof OpenLayers.Layer.WMS||Elgin.OlMap.map.layers[i].name=="NSG_TT_PUBLIC"||Elgin.OlMap.map.layers[i].name=="NSG_TT_PRIVATE"){if(Elgin.OlMap.map.layers[i].visibility){a.push(Elgin.OlMap.map.layers[i].name)}}}var b=a.join(",");b=b.replace(/_PUBLIC/g,"");b=b.replace(/_PRIVATE/g,"");Elgin.Utils.createCookie("ELGINMAPLYRVIS"+mapCookieSuffix,b,null,"/");Elgin.LayerTree.saveMLParamsTimer=0;Elgin.OlMap._checkDisableZoomIn();Elgin.OlMap.resigterTooltipEvents()},createDisableLayersPlugin:function(a){return{init:function(b){if(!b.map){return}b.map.events.on({zoomend:function(){function c(f,e){if(e){f.disable()}else{var g=Elgin.OlMap.map.getScale();if(g<f.attributes.minScale||g>f.attributes.maxScale){f.disable();e=true}else{f.enable();e=false}}f.eachChild(function(h){c(h,e)})}c(b.root,false)}})}}},getLayernameStub:function(a){var b=a.replace(/_PUBLIC$/,"");return b.replace(/_PRIVATE$/,"")},getLayerTreeLeftPos:function(){var a=Elgin.Utils.findPos($("mapShield")).left;return a+4},getLayerTreeTopPos:function(){var a=Elgin.Utils.findPos($("mapShield")).top;return a+4}};var Elgin=window.Elgin||{};Elgin.OlMap={MAX_VERTICES:180,mapToolOn:"toolSelect",zoominDisabled:false,map:null,style:null,styleRedline:null,styleEToNSite:null,measureControls:null,measureControl:null,getCoordState:false,layerOSMM:null,layerOSMMLabels:null,layerRedline:null,layerEToNSite:null,layerScotlandMask:null,toolPanZoomBar:null,toolNavigation:null,propsMap:null,propsUser:null,extras:null,osmmDecolourised:false,previousScale:null,_initialising:0,_pixelSelectBuffer:10,_bDrawToolsEnabled:true,initialise:function(f){if(!f){throw ("No properties provided to Elgin.OlMap.initialise()");return}try{this.propsInit=f.propsInit;this.qcm=f.qcm;this.extras=f.extras;this.dimension=f.dimensions}catch(c){throw ("There was a problem with the properties provided to Elgin.OlMap.initialise()");return}Elgin.OlMap._initialising=1;Elgin.MapSettings.setMapParamsPostLoad();OpenLayers.IMAGE_RELOAD_ATTEMPTS=3;OpenLayers.DOTS_PER_INCH=127;OpenLayers.Util.onImageLoadErrorColor="transparent";Prototype.Browser.IE6=Prototype.Browser.IE&&(parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6);this.propsMap=Elgin.OlMap._createPropsMap(this.propsInit);this.extras=Elgin.OlMap._setInitialOsLicence(this.propsInit,this.extras);Elgin.OlMap.propsMap=this.propsMap;Elgin.OlMap.propsUser=this.propsUser;Elgin.OlMap.extras=this.extras;Elgin.OlMap.map=Elgin.OlMap._createMap(this.propsMap);Elgin.OlMap.layerCombined=Elgin.OlMap._createBaseLayerCombined(this.qcm);if(!Elgin.MapSettings.useMapGuideOSMMBaseMap){if(Prototype.Browser.IE6){Elgin.OlMap.layerOSMM=Elgin.OlMap._createBaseLayerOSMMPlusLabels(this.qcm)}else{Elgin.OlMap.layerOSMM=Elgin.OlMap._createBaseLayerOSMM(this.qcm);Elgin.OlMap.layerOSMMLabels=Elgin.OlMap._createBaseLayerOSMMLabels(this.qcm)}}else{Elgin.OlMap.layerOSMM=Elgin.OlMap._createBaseLayerMapGuideOSMM(this.qcm)}Elgin.OlMap._createStyle("redline");Elgin.OlMap.layerRedline=Elgin.OlMap._createVectorLayer(Elgin.OlMap.styleRedline);Elgin.OlMap.previousScale=Elgin.OlMap.map.getScale();Elgin.OlMap._configureMapEventHandlers();Elgin.OlMap.map.addLayers([Elgin.OlMap.layerCombined,Elgin.OlMap.layerOSMM,Elgin.OlMap.layerRedline]);if(Elgin.OlMap.layerOSMMLabels){Elgin.OlMap.map.addLayer(Elgin.OlMap.layerOSMMLabels)
}if(isEToN){Elgin.OlMap._createStyle("eton");Elgin.OlMap.layerEToNSite=Elgin.OlMap._createVectorLayer(Elgin.OlMap.styleEToNSite);Elgin.OlMap.map.addLayers([Elgin.OlMap.layerEToNSite])}if(this.propsMap.scale<Elgin.MapSettings.osmmBaseMapScale){Elgin.OlMap.map.setBaseLayer(Elgin.OlMap.layerOSMM)}if($("divMousePosition")){Elgin.OlMap.map.addControl(new OpenLayers.Control.MousePosition({prefix:"&nbsp;&nbsp;Grid ref: ",suffix:"",numDigits:0,div:$("divMousePosition")}))}if($("divScale")){Elgin.OlMap.map.addControl(new OpenLayers.Control.Scale($("divScale")))}if($("divScaleLine")){slprop={div:$("divScaleLine"),maxWidth:150,bottomOutUnits:"",bottomInUnits:""};Elgin.OlMap.map.addControl(new OpenLayers.Control.ScaleLine(slprop))}if(!mapPrintWindow){Elgin.OlMap._createTools();for(var a in Elgin.OlMap.tools){if(a.indexOf("Measure")>-1||a.indexOf("DrawReportLine")>-1||a.indexOf("DrawReportPolygon")>-1){control=Elgin.OlMap.tools[a];control.events.on({measure:(a.indexOf("Measure")>-1?Elgin.OlMap._handleMeasurements:Elgin.Redline.drawComplete),measurepartial:Elgin.OlMap._handleMeasurements});Elgin.OlMap.map.addControl(control)}else{Elgin.OlMap.map.addControl(Elgin.OlMap.tools[a])}}Elgin.OlMap._configureToolEventHandlers();var b={toolName:Elgin.OlMap.mapToolOn};Elgin.OlMap.tools[Elgin.OlMap.mapToolOn].activate();Elgin.OlMap._toolButtonChanger()}Elgin.OlMap._addExtras(this.extras);if(Elgin.OlMap.modeTweaks){Elgin.OlMap.modeTweaks(this.extras)}Elgin.OlMap._showCopyright(this.propsInit.osLic);if(watermarkImgSrc.length>0){Elgin.MapSettings.watermark=new OpenLayers.Layer.Watermark("WATERMARK",watermarkImgSrc,{isBaseLayer:false,opacity:0.7,tileSize:new OpenLayers.Size(350,180),buffer:0,visibility:(this.propsMap.scale>Elgin.MapSettings.osmmBaseMapScale?false:true)});Elgin.OlMap.map.addLayer(Elgin.MapSettings.watermark)}if($("divMousePosition")){if(isRoadworksFinder&&this.propsMap.scale<Elgin.MapSettings.osmmBaseMapScale){$("divMousePosition").style.display="none";if($("divScaleLine")){$("divScaleLine").style.bottom="3px"}}}if(this.propsInit.zoomToMBR){Elgin.OlMap.map.zoomToExtent(new OpenLayers.Bounds(parseInt(this.propsInit.minx),parseInt(this.propsInit.miny),parseInt(this.propsInit.maxx),parseInt(this.propsInit.maxy)),true)}else{Elgin.OlMap.map.setCenter(Elgin.OlMap._getInitialLonLat(this.propsMap),Elgin.OlMap.getZoomLevel(this.propsMap.scale,this.propsMap.zoomLevels))}if(isEmailAlert){Elgin.Redline.showEmailAlertButton()}Elgin.OlMap._initialising=0},_addExtras:function(c){if(c){if(c.wkt){wkts=c.wkt.split(";");for(var b=0;b<wkts.length;b++){var e=new OpenLayers.Format.WKT();var a=e.read(wkts[b]);if(c.wktType=="eton"){Elgin.OlMap.layerEToNSite.addFeatures([a])}else{Elgin.OlMap.layerRedline.addFeatures([a])}}}}},_getInitialLonLat:function(a){if(a.lonLat){return a.lonLat}if(a.extent){return a.extent.getCenterLonLat()}else{console.log("[Elgin]_setInitialXY: Can't determine initial x,y because extent is null.");return null}},getZoomLevel:function(g,f){var a=f.length-1;if(g){if(g>f[f.length-1]){a=f.length-1}else{if(g<f[0]){a=0}else{for(var c=0;c<f.length-1;c++){var b=f[c];var e=f[c+1];if(g>=b&&g<=e){if((g-b)<(e-g)){a=c}else{a=c+1}break}}}}}return f.length-1-a},_configureMapEventHandlers:function(){Elgin.OlMap.map.events.register("zoomend",Elgin.OlMap.map,Elgin.OlMap._switchBaseLayer);Elgin.OlMap.map.events.register("zoomend",Elgin.OlMap.map,Elgin.OlMap._disableDrawTools);Elgin.OlMap.map.events.register("zoomend",Elgin.OlMap.map,Elgin.OlMap._setPreviousScale);Elgin.OlMap.map.events.register("zoomend",Elgin.OlMap.map,Elgin.OlMap._setZoomScaleBar);Elgin.OlMap.map.events.register("zoomend",Elgin.OlMap.map,Elgin.OlMap._setMousePositionVisibility);Elgin.OlMap.map.events.register("moveend",Elgin.OlMap.map,function(){if(Elgin.OlMap._initialising==1){Elgin.OlMap._initialising=0}Elgin.OlMap._saveMapParams()});Elgin.OlMap.map.events.register("addlayer",Elgin.OlMap.map,function(a){a.layer.events.register("loadstart",a.layer,Elgin.OlMap._loadStart);a.layer.events.register("loadend",a.layer,Elgin.OlMap._loadEnd)});Elgin.OlMap.map.events.register("changelayer",Elgin.OlMap.map,function(a){a.layer.events.register("visibilitychanged",a.layer,Elgin.LayerTree.preSaveMapLayerParams(a));a.layer.events.register("visibilitychanged",a.layer,Elgin.LayerTree.displayMapLayerInfo(a))});Elgin.OlMap.map.events.register("click",Elgin.OlMap.map,Elgin.Properties.clickHandler);if(Elgin.MapSettings.tooltip_enabled){Elgin.OlMap.resigterTooltipEvents();Elgin.OlMap.map.events.register("movestart",Elgin.OlMap.map,Elgin.Properties.hideTooltip)}},resigterTooltipEvents:function(){var a=0;var b=false;var c=","+Elgin.Utils.readCookie("ELGINMAPLYRVIS")+",";for(i=0;i<Elgin.MapSettings.mapLayers_visbleTooltips.length;i++){if(c.indexOf(","+Elgin.MapSettings.mapLayers_visbleTooltips[i]+",")>-1){b=true;break}}if(Elgin.MapSettings.tooltip_ITN=="onmousemove"||b){if(Elgin.OlMap.mapToolOn=="toolSelect"){Elgin.OlMap.map.events.register("mousemove",Elgin.OlMap.map,Elgin.Properties.mousemoveToolTipHandler);Elgin.Properties.tooltipMousemoveEventRegistered=true}else{a=1}}else{a=2}if(a>0){Elgin.OlMap.map.events.unregister("mousemove",Elgin.OlMap.map,Elgin.Properties.mousemoveToolTipHandler);Elgin.Properties.tooltipMousemoveEventRegistered=false}},_saveMapParams:function(){var b=Elgin.OlMap.map.getExtent();var a=Elgin.OlMap.map.getCurrentSize();Elgin.Utils.createCookie("ELGINMAPPARAMS"+mapCookieSuffix,parseInt(Elgin.OlMap.map.center.lon)+","+parseInt(Elgin.OlMap.map.center.lat)+","+parseInt(Elgin.OlMap.map.getScale()))},_deactivateTools:function(){for(var a in Elgin.OlMap.tools){Elgin.OlMap.tools[a].deactivate()}Elgin.OlMap._dispMeasureResult();Elgin.Redline._hideDrawingTip();Elgin.Redline._hideRedlineSavedTip();if(Elgin.OlMap.highlightCtrl&&Elgin.OlMap.clickCtrl){Elgin.OlMap.highlightCtrl.deactivate();Elgin.OlMap.clickCtrl.deactivate()}},_toolHandler:function(a){Elgin.OlMap._deactivateTools();Elgin.OlMap.tools[this.toolName].activate();if(this.toolName=="toolSelect"){if(Elgin.OlMap.highlightCtrl&&Elgin.OlMap.clickCtrl){Elgin.OlMap.highlightCtrl.activate();Elgin.OlMap.clickCtrl.activate()}}},_toolButtonChanger:function(g){if(g){var a=Event.element(g).tagName.toLowerCase();var h=this.toolName.replace(/tool/,"btn")}else{h="btnSelect"}for(var c in Elgin.OlMap.tools){var f=c.replace(/tool/,"btn");if($(f)){if(h==f){$(f).addClassName("btnDown")}else{$(f).removeClassName("btnDown")}}}Elgin.OlMap.mapToolOn=h.replace(/btn/,"tool");var b=$("map");if(b){cur="auto";switch(Elgin.OlMap.mapToolOn){case"toolZoomBox":cur="url(/olmap/js/theme/default/img/zoomin.cur), crosshair";break;case"toolZoomOut":cur="url(/olmap/js/theme/default/img/zoomout.cur), crosshair";break;case"toolDragPan":cur="move";break;case"toolSelect":cur="url(/olmap/js/theme/default/img/info.cur), default";break;case"toolFaultReporting":cur="url(/olmap/js/theme/default/img/spanner.cur), default";break;case"toolMeasureArea":case"toolMeasureDistance":case"toolGetCoord":case"toolDrawPolygon":case"toolDrawPoint":case"toolDrawLine":case"toolDrawReportPolygon":case"toolDrawReportPoint":case"toolDrawReportLine":cur="crosshair";break}b.style.cursor=cur}if(Elgin.MapSettings.tooltip_enabled){Elgin.OlMap.resigterTooltipEvents()}},_configureToolEventHandlers:function(){for(var a in Elgin.OlMap.tools){var b=a.replace(/tool/,"btn");if($(b)){var c={toolName:a};Event.observe(b,"click",Elgin.OlMap._toolHandler.bindAsEventListener(c));Event.observe(b,"click",Elgin.OlMap._toolButtonChanger.bindAsEventListener(c))}}if($("btnRefreshMap")){Event.observe($("btnRefreshMap"),"click",function(){Elgin.OlMap._resetMap(false,false)})}if($("btnResetMap")){Event.observe($("btnResetMap"),"click",function(){Elgin.OlMap._resetMap(true,false)})}if($("btnPrintMap")){Event.observe($("btnPrintMap"),"click",function(){Elgin.OlMap.printMap()})}if($("btnClearDrawing")){$("btnClearDrawing").observe("click",function(){var e=Elgin.Utils.createCustomEventElement("helperClearPolygon");e.fire("polygon:clear")})}},_resetMap:function(a,b){if(a){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat((isJEMA?Elgin.MapSettings.jema_map_defaultCentreEasting:Elgin.MapSettings.map_defaultCentreEasting),(isJEMA?Elgin.MapSettings.jema_map_defaultCentreNorthing:Elgin.MapSettings.map_defaultCentreNorthing)),0)
}else{Elgin.OlMap.map.setCenter(new OpenLayers.LonLat((Elgin.OlMap.map.center.lon-1),(Elgin.OlMap.map.center.lat-1)),Elgin.OlMap.map.getScale())}},_createStyle:function(b){switch(b){case"eton":ptFill="#c000c0";ptStroke="#333333";lStroke="#800080";pFill="#c000c0";pStroke="#800080";break;default:ptFill="#c00000";ptStroke="#333333";lStroke="#800000";pFill="#c00000";pStroke="#800000";break}var a=new OpenLayers.Style();a.addRules([new OpenLayers.Rule({symbolizer:{Point:{pointRadius:6,graphicName:"circle",fillColor:ptFill,fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:ptStroke},Line:{strokeWidth:1.8,strokeOpacity:1,strokeColor:lStroke,strokeDashstyle:"line"},Polygon:{strokeWidth:1.2,strokeOpacity:1,strokeColor:pStroke,fillColor:pFill,fillOpacity:0.3}}})]);if(b=="redline"){Elgin.OlMap.style=a;Elgin.OlMap.styleRedline=new OpenLayers.StyleMap({"default":a})}else{if(b=="eton"){Elgin.OlMap.styleEToNSite=new OpenLayers.StyleMap({"default":a})}}},_createMap:function(b){var a={maxExtent:b.extent,restrictedExtent:b.extent,units:"m",projection:"EPSG:81989",scales:b.zoomLevels,controls:[]};return new OpenLayers.Map("map",a)},_createBaseLayerCombined:function(a){return new OpenLayers.Layer.TileCache("Combined",a.vsm,"combi",{format:"image/gif",buffer:0})},_createBaseLayerOSMM:function(a){return new OpenLayers.Layer.WMS("OSMM",geoserverOsmm+"/wms",{layers:"MasterMap_Area-ORA_Line-SHP",format:"image/gif",tiled:"false",srs:"EPSG:81898"},{isBaseLayer:true,singleTile:true,transitionEffect:"resize",ratio:1})},_createBaseLayerOSMMLabels:function(a){return new OpenLayers.Layer.WMS("OSMM Labels",geoserverOsmm+"/wms",{layers:"MasterMap_Text-SHP",srs:"EPSG:81898",format:"image/png",transparent:"true"},{singleTile:true,ratio:1,scales:[2500,1750,1000,500,250]})},_createBaseLayerOSMMPlusLabels:function(a){return new OpenLayers.Layer.WMS("OSMM plus cartotext",geoserverOsmm+"/wms",{layers:"MasterMap_Area-ORA_Line-SHP_Text-SHP",format:"image/gif",tiled:"false",srs:"EPSG:81989"},{isBaseLayer:true,singleTile:true,transitionEffect:"none",ratio:1})},_createBaseLayerMapGuideOSMM:function(a){return new OpenLayers.Layer.MapGuide(Elgin.MapSettings.OSMM_BASE_LAYER_NAME,a.wtn,{mapdefinition:a.pt},{isBaseLayer:true,singleTile:true,transitionEffect:(Prototype.Browser.IE6?"none":"resize"),buffer:0,useHttpTile:false})},_createVectorLayer:function(a){return new OpenLayers.Layer.Vector(Elgin.MapSettings.VECTOR_LAYER_NAME,{styleMap:a})},_createScotlandMaskLayer:function(a){return new OpenLayers.Layer.WMS(Elgin.MapSettings.SCOTLAND_MASK_LAYER_NAME,a,{layers:"Elgin:scotlandmask",srs:"EPSG:27700",format:(Prototype.Browser.IE6?"image/gif":"image/png"),transparent:"TRUE"},{isBaseLayer:false,buffer:0,singleTile:true})},_createTools:function(){Elgin.OlMap.tools={toolZoomBox:(Prototype.Browser.IE6?new OpenLayers.Control({type:OpenLayers.Control.TYPE_TOOL,CLASS_NAME:"OpenLayers.Control.IE6ZoomIn",handler:new OpenLayers.Handler.Point(this,{done:function(a){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(a.x,a.y),Elgin.OlMap.map.getZoom()+1)}})}):new OpenLayers.Control.ZoomBox({alwaysZoom:true,displayClass:"ElginControlZoomIn"})),toolZoomOut:(Prototype.Browser.IE6?new OpenLayers.Control({type:OpenLayers.Control.TYPE_TOOL,CLASS_NAME:"OpenLayers.Control.IE6ZoomOut",handler:new OpenLayers.Handler.Point(this,{done:function(a){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(a.x,a.y),Elgin.OlMap.map.getZoom()-1)}})}):new OpenLayers.Control.ZoomBox({out:true,alwaysZoom:true,displayClass:"ElginControlZoomOut"})),toolDragPan:new OpenLayers.Control.DragPan(),toolDrawPolygon:new OpenLayers.Control.DrawFeature(Elgin.OlMap.layerRedline,OpenLayers.Handler.Polygon,{featureAdded:function(a){Elgin.Redline._hideDrawingTip();if(Elgin.Redline.tooManyVertices(a)){return}Elgin.Redline.saveRedlineObject(a.geometry,"poly")},handlerOptions:{style:"default",layerOptions:{styleMap:Elgin.OlMap.styleRedline},freehandToggle:null,createFeature:function(){Elgin.OlMap.layerRedline.destroyFeatures();OpenLayers.Handler.Polygon.prototype.createFeature.apply(this,arguments);Elgin.Redline._showDrawingTip()}}}),toolDrawReportPoint:new OpenLayers.Control.DrawFeature(Elgin.OlMap.layerRedline,OpenLayers.Handler.Point,{featureAdded:function(a){Elgin.Redline.saveRedlineObject(a.geometry,"point");Elgin.OlMap._dispMeasureResult("Grid ref: "+Math.round(a.geometry.x)+","+Math.round(a.geometry.y))},handlerOptions:{style:"default",layerOptions:{styleMap:Elgin.OlMap.styleRedline},createFeature:function(){Elgin.OlMap.layerRedline.destroyFeatures();OpenLayers.Handler.Point.prototype.createFeature.apply(this,arguments)}}}),toolDrawReportLine:new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{persist:true,handlerOptions:{style:"default",freehandToggle:null,layerOptions:{styleMap:Elgin.OlMap.styleRedline},createFeature:function(){Elgin.OlMap.layerRedline.destroyFeatures();OpenLayers.Handler.Path.prototype.createFeature.apply(this,arguments);Elgin.Redline._showDrawingTip()}}}),toolDrawReportPolygon:new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{persist:true,handlerOptions:{style:"default",layerOptions:{styleMap:Elgin.OlMap.styleRedline},freehandToggle:null,createFeature:function(){Elgin.OlMap.layerRedline.destroyFeatures();OpenLayers.Handler.Polygon.prototype.createFeature.apply(this,arguments);Elgin.Redline._showDrawingTip()}}}),toolMeasureDistance:new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{persist:true,handlerOptions:{layerOptions:{styleMap:Elgin.OlMap.styleRedline}}}),toolMeasureArea:new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{persist:true,handlerOptions:{layerOptions:{styleMap:Elgin.OlMap.styleRedline}}}),toolGetCoord:new OpenLayers.Control({type:OpenLayers.Control.TYPE_TOOL,displayClass:"olControlSelect",eventListeners:{activate:function(){Elgin.OlMap.map.events.register("click",Elgin.OlMap.map,Elgin.OlMap._displayGetCoord)}}}),toolSelect:new OpenLayers.Control({type:OpenLayers.Control.TYPE_TOOL,displayClass:"olControlSelect"}),toolFaultReporting:new OpenLayers.Control({type:OpenLayers.Control.TYPE_TOOL,displayClass:"olControlSelect",eventListeners:{activate:function(){if(Elgin.OlMap._selectFaultReportingClick){Elgin.OlMap.map.events.register("click",Elgin.OlMap.map,Elgin.OlMap._selectFaultReportingClick)}},deactivate:function(){if(Elgin.OlMap._selectFaultReportingClick){Elgin.OlMap.map.events.unregister("click",Elgin.OlMap.map,Elgin.OlMap._selectFaultReportingClick)}}}}),toolSelectRoad:new OpenLayers.Control({type:OpenLayers.Control.TYPE_TOOL,displayClass:"olControlSelect",eventListeners:{activate:function(){if(Elgin.OlMap._selectSelectRoadClick){Elgin.OlMap.map.events.register("click",Elgin.OlMap.map,Elgin.OlMap._selectSelectRoadClick)}},deactivate:function(){if(Elgin.OlMap._selectSelectRoadClick){Elgin.OlMap.map.events.unregister("click",Elgin.OlMap.map,Elgin.OlMap._selectSelectRoadClick)}}}})}},_createPropsMap:function(b){var a=Elgin.OlMap._setInitialMapLocation(b);a.extent=new OpenLayers.Bounds(Elgin.MapSettings.mapFullExtent[0],Elgin.MapSettings.mapFullExtent[1],Elgin.MapSettings.mapFullExtent[2],Elgin.MapSettings.mapFullExtent[3]);a.zoomLevels=Elgin.MapSettings.mapZoomLevels;return a},_setInitialMapLocation:function(k){var g={};var c=parseInt(k.x);var b=parseInt(k.y);var h=parseInt(k.scale);var f=(isJEMA?Elgin.MapSettings.jema_map_defaultCentreEasting:Elgin.MapSettings.map_defaultCentreEasting);var e=(isJEMA?Elgin.MapSettings.jema_map_defaultCentreNorthing:Elgin.MapSettings.map_defaultCentreNorthing);var a=(isJEMA?Elgin.MapSettings.jema_map_defaultScale:Elgin.MapSettings.map_defaultScale);if(c>0&&b>0&&h>0){f=c;e=b;a=h}else{cparams_=Elgin.Utils.readCookie("ELGINMAPPARAMS"+mapCookieSuffix);if(cparams_){cparams=cparams_.split(",");if(cparams.length==3){if((cparams[0].isInteger&&cparams[0]>0)&&(cparams[1].isInteger&&cparams[1]>0)&&(cparams[2].isInteger&&cparams[2]>0)){f=cparams[0];e=cparams[1];a=cparams[2]}}}}g.lonLat=new OpenLayers.LonLat(f,e);g.cen_x=f;g.cen_y=e;g.scale=a;return g},_setInitialOsLicence:function(b,a){a.licenceNumber=(b.osLic!="")?b.osLic:Elgin.MapSettings.map_defaultOSLicence;
return a},_loading:0,_loadStart:function(){if(Elgin.OlMap._loading==0){if($("imgLoadingSandtimer")){$("imgLoadingSandtimer").style.display="inline"}}Elgin.OlMap._loading++},_loadEnd:function(){Elgin.OlMap._loading--;if(Elgin.OlMap._loading==0){if($("imgLoadingSandtimer")){$("imgLoadingSandtimer").style.display="none"}if(Elgin.LayerTree.layerTreeWin&&!$("splash")){if(((!Elgin.Utils.readCookie("ELGINMAP_LYRTREE"+mapCookieSuffix)||Elgin.Utils.readCookie("ELGINMAP_LYRTREE"+mapCookieSuffix)==1))&&!isEmailAlert&&!isEToN){Elgin.LayerTree.layerTreeWin.show();$("displayMapLayers").addClassName("btnDown")}}}},_switchBaseLayer:function(){var a=this.getScale();a=Math.round(a);if(a>=1000000){$("map").style.backgroundColor="#D0F0FF"}else{$("map").style.backgroundColor="#EEEEEE"}if(a>=Elgin.MapSettings.osmmBaseMapScale){if(Elgin.OlMap.map.baseLayer!==Elgin.OlMap.layerCombined){Elgin.OlMap.map.setBaseLayer(Elgin.OlMap.layerCombined)}Elgin.MapSettings.watermark.setVisibility(false)}else{if(!Elgin.OlMap.zoominDisabled){if(Elgin.OlMap.map.baseLayer!==Elgin.OlMap.layerOSMM){Elgin.OlMap.map.setBaseLayer(Elgin.OlMap.layerOSMM)}}Elgin.MapSettings.watermark.setVisibility(true)}},_setMousePositionVisibility:function(){if($("divMousePosition")){var a="inline";var c="14px";var b=this.getScale();b=Math.round(b);if(isRoadworksFinder&&b<Elgin.MapSettings.osmmBaseMapScale){a="none";c="3px"}$("divMousePosition").style.display=a;if($("divScaleLine")){$("divScaleLine").style.bottom=c}}},_checkDisableZoomIn:function(){if(!Elgin.MapSettings.enable_disableZoomIn){return}var b=true;if(!isRoadworksFinder){b=false}else{var c=","+unescape(Elgin.Utils.readCookie("ELGINMAPLYRVIS"+mapCookieSuffix))+",";for(var a=0;a<Elgin.MapSettings.mapLayers_OSMMVisible.length;a++){if(c.indexOf(Elgin.MapSettings.mapLayers_OSMMVisible[a])>-1){b=false;break}}}Elgin.OlMap._disableZoomIn(Math.round(Elgin.OlMap.map.getScale()),(b?true:false))},_disableZoomIn:function(c,a){Elgin.OlMap.zoominDisabled=a;if($("scaleDiv2500")){$("scaleDiv2500").style.display=(a?"none":"inline");$("scaleDiv1000").style.display=(a?"none":"inline");$("scaleDiv500").style.display=(a?"none":"inline");$("scaleDiv250").style.display=(a?"none":"inline");$("scaleDiv100").style.display=(a?"none":"inline")}if(a&&c<Elgin.MapSettings.osmmBaseMapScale){Elgin.OlMap.changeMapScale(Elgin.MapSettings.osmmBaseMapScale)}},_setPreviousScale:function(){Elgin.OlMap.previousScale=this.getScale()},changeMapScale:function(a){if(a==-1){Elgin.OlMap._resetMap(true,false)}else{Elgin.OlMap.map.zoomToScale(a-10)}},changeMapScale_zoom:function(c){var b=Math.round(Elgin.OlMap.map.getScale());if(c&&Elgin.OlMap.zoominDisabled&&b<=Elgin.MapSettings.osmmBaseMapScale){return}for(var a=0;a<Elgin.OlMap.propsMap.zoomLevels.length;a++){if(Elgin.OlMap.propsMap.zoomLevels[a]==b){break}}if(c){if(a>0){Elgin.OlMap.changeMapScale(Elgin.OlMap.propsMap.zoomLevels[--a])}}else{if(a<(Elgin.OlMap.propsMap.zoomLevels.length-1)){Elgin.OlMap.changeMapScale(Elgin.OlMap.propsMap.zoomLevels[++a])}}},_setZoomScaleBar:function(){var a=Math.round(Elgin.OlMap.map.getScale());for(var b=0;b<Elgin.OlMap.propsMap.zoomLevels.length;b++){sb=$("scaleDiv"+Elgin.OlMap.propsMap.zoomLevels[b]);if(sb){if(Elgin.OlMap.propsMap.zoomLevels[b]==a){sb.addClassName("scaleDivActive")}else{sb.removeClassName("scaleDivActive")}}}},_checkForHertsFaultReporting:function(){return false},_showCopyright:function(a){var b=window.document.createElement("div");b.id="copyright";b.innerHTML="&copy; Crown Copyright Ordnance Survey";if(a){b.innerHTML+="<br/>Licence no. "+a}b.setAttribute("unselectable","on");var c=window.document.getElementById("map");c.appendChild(b)},_selectFaultReportingClick:function(a){var c=Elgin.OlMap.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(a.xy.x,a.xy.y));var b="/index.cfm?fuseaction=Streetworks.faultReporting&";b+="mouseX="+Math.round(c.lon)+"&";b+="mouseY="+Math.round(c.lat)+"&";mapExeIFrame.document.location.href=b;logger.info("Herts Fault Reporting Tool Activated",{coord:Math.round(c.lon)+","+Math.round(c.lat)})},_displayGetCoord:function(a){var b=Elgin.OlMap.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(a.xy.x,a.xy.y));Elgin.OlMap._dispMeasureResult("Grid ref: "+Math.round(b.lon)+","+Math.round(b.lat))},_handleMeasurements:function(b){var k=b.geometry;var c=b.units;var a=b.order;var h=b.measure;var f=document.getElementById("output");var g=(h<10?2:(h<100?1:0));var e="";if(a==1){e+="Distance: "+h.toFixed(g)+" "+c}else{e+="Area: "+h.toFixed(g)+" "+c+"<sup style='font-size:4pt'>2</sup>"}Elgin.OlMap._dispMeasureResult(e);if($("measureDisplay")){$("measureDisplay").innerHTML=e;$("measureDisplay").style.display="inline"}},_dispMeasureResult:function(a){if($("measureDisplay")){$("measureDisplay").innerHTML=(a?a:"");$("measureDisplay").style.display=(a?"inline":"none")}},printMap:function(){url="index.cfm?fuseaction="+fuseaction_mapPrint+"&fuseaction_forchangemapsize="+fuseaction_mapPrint+"&";if(Elgin.OlMap.osmmDecolourised){url+="osmmDecolourised=1&"}if(Elgin.Properties.pWin&&!Elgin.Properties.pWin.hidden){url+="displayProperties=1&";url+="propVislyrs="+escape(Elgin.Properties.propVislyrs)+"&";url+="evtMouseE="+Math.round(Elgin.Properties.evtMouseE)+"&";url+="evtMouseN="+Math.round(Elgin.Properties.evtMouseN)+"&";url+="buffM="+Elgin.Properties.buffM+"&"}tmpwin=window.open(url,"ElginMap")}};var Elgin=window.Elgin||{};Elgin.OlMap=window.Elgin.OlMap||{};Elgin.OlMap.modeTweaks=function(a){Elgin.OlMap._configureWfsLayers(a);if(a.mode==2){if(Elgin.OlMap.toolPanZoomBar){Elgin.OlMap.map.removeControl(Elgin.OlMap.toolPanZoomBar)}if(Elgin.OlMap.toolNavigation){Elgin.OlMap.map.removeControl(Elgin.OlMap.toolNavigation);Elgin.OlMap.toolNavigation.deactivate()}}};Elgin.OlMap.setMapSize=function(){var f=parseInt(document.documentElement.clientHeight);var k=properties.dimensions.mHeader+properties.dimensions.mToolbar+properties.dimensions.mMinMapHt+properties.dimensions.mStatusbar+properties.dimensions.mFooter;var e=f-(properties.dimensions.mHeader+properties.dimensions.mToolbar+properties.dimensions.mStatusbar+properties.dimensions.mFooter);var b=parseInt(document.documentElement.clientWidth);var c=b-properties.dimensions.mWidthFF;if(Prototype.Browser.IE6){var h={};h.width="auto";h.height=properties.dimensions.mMinMapHt+"px";if(f>k){h.height=e+"px"}$("mapShield").setStyle(h);$("map").setStyle(h)}else{var g="auto";var a=properties.dimensions.mMinMapHt+"px";if(f>k){a=e+"px"}$("mapShield").setStyle({height:a,width:g});$("map").setStyle({height:a});g=properties.dimensions.mMinMapWd+"px";if(b>properties.dimensions.mMinMapWd){g=c+"px"}$("mapdiv").setStyle({width:g})}};Elgin.OlMap.resetMapSize=function(){window.clearTimeout(Elgin.OlMap.resizeTimeoutId);Elgin.OlMap.resizeTimeoutId=window.setTimeout("Elgin.OlMap.setMapSize();",10)};Elgin.OlMap.setMapSizeV5=function(){var b=parseInt(document.documentElement.clientHeight);if(Elgin.OlMap.MapMeasurements){var a=Elgin.OlMap.MapMeasurements.banner_height;var e=Elgin.OlMap.MapMeasurements.footer_height;var c=Elgin.OlMap.MapMeasurements.toolbar_height;var f=b-c;f+="px"}else{var a=189;var e=75;var c=44;var f=b-(a+e);f+="px"}$("mapShield").setStyle({height:f});$("map").setStyle({height:f});if($("mapdiv")){f=(parseInt(f)+c)+"px";$("mapdiv").setStyle({height:f})}};Elgin.OlMap.resetMapSizeV5=function(){window.clearTimeout(Elgin.OlMap.resizeTimeoutId);Elgin.OlMap.resizeTimeoutId=window.setTimeout("Elgin.OlMap.setMapSizeV5();",10)};Elgin.OlMap._configureWfsLayers=function(g){if(!Elgin.OlMap.map){console.log("[Elgin]modeTweaks: No map found!.");return}var e=[];if(g.xgt){var c=g.xgt.split(",")}else{var c=new Array()}var a=[];for(var f=0;f<c.length;f++){for(var b=0;b<e.length;b++){if(c[f]==e[b].id){a.push(new Elgin.OlMap.WfsLayer(e[b],g.xnt))}}}for(var f=0;f<a.length;f++){if(a[f].layer){Elgin.OlMap.map.addLayer(a[f].layer)}}Elgin.OlMap._configureTooltipLayers();Elgin.LayerTree.loadWMSLayers();Elgin.LayerTree.renderLayerTree()};Elgin.OlMap._getUsersMapLayers=function(a){if(a=="layers"){if(!wmsLayerNames){alert("Error!\nUnable to load map layers.\n\n Error: wmsLayerNames is null\n[template: olmap/js/Elgin.OlMap.MapExtras.js]\n[Function: getUsersMapLayers()]");
return null}else{return wmsLayerNames}}else{if(a=="tree"){if(!elginLayerTree){alert("Error!\nUnable to load map layer tree.\n\n Error: elginLayerTree is null\n[template: olmap/js/Elgin.OlMap.MapExtras.js]\n[Function: getUsersMapLayers()]");return null}else{return elginLayerTree}}}};Elgin.OlMap._getWMSLayer=function(a,g,l,m,k,f,e,h,b,c){return new OpenLayers.Layer.WMS(l,a,{srs:"EPSG:27700",format:(Prototype.Browser.IE6?"image/gif":h),antialias:c,tiled:(b?"true":"false"),transparent:"TRUE",cql_filter:f,styles:e,layers:g+":"+l},{buffer:0,singleTile:!b,ratio:k})};Elgin.OlMap.WfsLayer=Class.create({initialize:function(b,a){this.checked=b.checked;this.id=b.id;this.company=b.company;this.type=b.type;this.layer=null;this.layerName=this.company+" - "+this.type;this.layer=this.createWmsLayer(this.type.toUpperCase(),this.id.truncate(this.id.length,""),this.layerName,a,b.ns);this.iconUrl=this.determineIconUrl(this.type);this.checked=b.checked},createWmsLayer:function(c,f,g,a,b,e){if(!OpenLayers.Layer.WMS){return null}return new OpenLayers.Layer.WMS(g,a,{height:"550",width:"350",layers:b+":"+f,styles:"",srs:"EPSG:27700",format:(Prototype.Browser.IE6?"image/gif":"image/png"),tiled:"true",transparent:"TRUE"},{isBaseLayer:false,buffer:0})},determineIconUrl:function(a){switch(a){case"Electricity":return"img/red.gif";break;case"Gas":return"img/yellow.gif";break;case"Sewer":return"img/brown.gif";break;case"Water":return"img/blue.gif";break;default:return"js/MapFish1.0/client/mfbase/ext/resources/images/default/tree/leaf.gif";break}},toString:function(){return"WfsLayer object:\n\nid: "+this.id+"\ncompany: "+this.company+"\ntype: "+this.type+"\nlayerName: "+this.layerName+"\nlayer: "+(this.layer?"Created":"null")+"\niconUrl: "+this.iconUrl}});Elgin.OlMap.highlightCtrl=null;Elgin.OlMap.clickCtrl=null;Elgin.OlMap._configureTooltipLayers=function(){OpenLayers.ProxyHost="/olmap/proxy/proxy.py?url=";var a=geoserverTt+"/wfs";var o=new OpenLayers.Style({fillColor:"#ffffff",fillOpacity:0.01,strokeWidth:1,strokeColor:"#ffffff",strokeOpacity:0.01});var h=new OpenLayers.StyleMap({"default":o});var m=new OpenLayers.Style({strokeWidth:10,strokeColor:"#ffffff",strokeOpacity:0.01});var g=new OpenLayers.StyleMap({"default":m});g.styles["default"].addRules([new OpenLayers.Rule({minScaleDenominator:2499,maxScaleDenominator:2501,symbolizer:{strokeWidth:18}}),new OpenLayers.Rule({minScaleDenominator:1749,maxScaleDenominator:1751,symbolizer:{strokeWidth:20}}),new OpenLayers.Rule({minScaleDenominator:999,maxScaleDenominator:1001,symbolizer:{strokeWidth:24}}),new OpenLayers.Rule({minScaleDenominator:499,maxScaleDenominator:501,symbolizer:{strokeWidth:48}}),new OpenLayers.Rule({minScaleDenominator:249,maxScaleDenominator:251,symbolizer:{strokeWidth:120}}),new OpenLayers.Rule({elseFilter:true})]);var f=new OpenLayers.Style({strokeWidth:10,strokeColor:"#ffffff",strokeOpacity:0.01});var e=new OpenLayers.StyleMap({"default":f});e.styles["default"]=g.styles["default"];e.styles["default"].addRules([new OpenLayers.Rule({minScaleDenominator:4999,maxScaleDenominator:5001,symbolizer:{strokeWidth:14}}),new OpenLayers.Rule({minScaleDenominator:7499,maxScaleDenominator:7501,symbolizer:{strokeWidth:10}}),new OpenLayers.Rule({minScaleDenominator:9999,maxScaleDenominator:10001,symbolizer:{strokeWidth:7}})]);var l=new OpenLayers.Layer.Vector("TRO_PRIVATE_TT",{scales:[2500,1750,1000,500,250],styleMap:h,strategies:[new OpenLayers.Strategy.BBOX()],protocol:new OpenLayers.Protocol.WFS({url:a,featureType:"TRO_TT_PRIVATE",featureNS:"http://www.elgin.gov.uk",featurePrefix:"e",geometryName:"GEOM"}),visibility:false});var k=new OpenLayers.Layer.Vector("ITN All roads gen. 1",{scales:[2500],styleMap:g,strategies:[new OpenLayers.Strategy.BBOX()],protocol:new OpenLayers.Protocol.WFS({url:a,featureType:"ITN_Types_All_gen1",featureNS:"http://www.elgin.gov.uk",featurePrefix:"e"})});var c=new OpenLayers.Layer.Vector("ITN All roads ungen.",{scales:[1750,1000,500,250],styleMap:g,strategies:[new OpenLayers.Strategy.BBOX()],protocol:new OpenLayers.Protocol.WFS({url:a,featureType:"ITN_Types_All",featureNS:"http://www.elgin.gov.uk",featurePrefix:"e"})});var p=(isRoadworksFinder?"NSG_TT_PUBLIC":"NSG_TT_PRIVATE");var b=new OpenLayers.Layer.Vector(p,{scales:[10000,7500,5000,2500,1750,1000,500,250],styleMap:e,visibility:false,strategies:[new OpenLayers.Strategy.BBOX()],protocol:new OpenLayers.Protocol.WFS({url:a,featureType:p,featureNS:"http://www.elgin.gov.uk",featurePrefix:"e",geometryName:"GEOM"})});Elgin.OlMap.layerRedline.visible=false;Elgin.OlMap.map.addLayers([k,c,l,b]);Elgin.OlMap.highlightCtrl=new OpenLayers.Control.SelectFeature([Elgin.OlMap.layerRedline,k,c,l,b],{hover:true,highlightOnly:true,renderIntent:"default",eventListeners:{featurehighlighted:Elgin.OlMap._doTip,featureunhighlighted:Elgin.Properties.hideTooltip}});Elgin.OlMap.clickCtrl=new OpenLayers.Control.SelectFeature([Elgin.OlMap.layerRedline,k,c,l,b],{renderIntent:"default",eventListeners:{featurehighlighted:Elgin.OlMap._doProperties}});Elgin.OlMap.map.addControl(Elgin.OlMap.highlightCtrl);Elgin.OlMap.map.addControl(Elgin.OlMap.clickCtrl);Elgin.OlMap.highlightCtrl.activate();Elgin.OlMap.clickCtrl.activate()};Elgin.OlMap._doTip=function(a){var c=a.object.handlers.feature.evt.xy;Elgin.Properties.evtTTMouseX=c.x;Elgin.Properties.evtTTMouseY=c.y;var b="";if(a.feature.attributes.DISPLAYNAM){b=a.feature.attributes.DISPLAYNAM}else{if(a.feature.attributes.T){b=a.feature.attributes.T;b=b.replace(/;/gi,"<br/>")}else{if(a.feature.attributes.TT){if(a.feature.layer.name.include("TRO")){b="<b>Traffic Regulation Order</b><br/>"+a.feature.attributes.TT}else{b=a.feature.attributes.TT;b=b.replace(/;/gi,"<br/>")}}}}if(b.length>0){Elgin.Properties.tooltip=b;Elgin.Properties.displayTooltip(30000)}};Elgin.OlMap._doProperties=function(a){var b=a.object.handlers.feature.evt;Elgin.Properties.clickHandler(b);a.object.unselectAll()};var Elgin=window.Elgin||{};Elgin.Properties={mulE:0,mulN:0,evtMouseX:0,evtMouseY:0,evtMouseE:0,evtMouseN:0,buffM:0,buffPx:2,evtTTMouseX:0,evtTTMouseY:0,pWin:null,ttWin:null,historicTROSearch:false,propVislyrs:null,propFilters:null,propColumns:null,dupChkRepository:[],dupCount:0,jemaSchematicWin:null,jemaSchematicPanel:null,pBroker:null,progress:{wfs_showing:false,wfs_status:"dormant",road_status:"dormant"},tooltip:"",currentRoadDisplayTimeout:null,tooltipDisplayTimeout:null,tooltipMousemoveEventRegistered:false,clickHandler:function(h){if(Elgin.OlMap.mapToolOn!="toolSelect"){return}Elgin.Properties.start();Elgin.Properties.dupChkRepository=[];Elgin.Properties.propVislyrs="";var a="";for(var b=Elgin.OlMap.map.layers.length-1;b>0;b--){layer=Elgin.OlMap.map.layers[b];if(Elgin.OlMap.map.layers[b].visibility&&Elgin.OlMap.map.layers[b].name!=Elgin.MapSettings.BASE_LAYER_NAME&&Elgin.OlMap.map.layers[b].name!=Elgin.MapSettings.OSMM_BASE_LAYER_NAME&&Elgin.OlMap.map.layers[b].name!=Elgin.MapSettings.VECTOR_LAYER_NAME&&Elgin.Properties.getShowProperties(Elgin.OlMap.map.layers[b].name)){try{sc=Elgin.Properties._findMaxScale(elginLayerTree,Elgin.OlMap.map.layers[b].name)}catch(c){Elgin.LayerTree.tree.expandAll();sc=Elgin.LayerTree.tree.getNodeById(Elgin.OlMap.map.layers[b].name).attributes.maxScale}if(sc>=Elgin.OlMap.map.getScale()){Elgin.Properties.propVislyrs+=a+Elgin.OlMap.map.layers[b].params.LAYERS;a=","}}}var g=Elgin.OlMap.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(h.xy.x,h.xy.y));Elgin.Properties.evtMouseX=h.xy.x;Elgin.Properties.evtMouseY=h.xy.y;Elgin.Properties.evtMouseE=g.lon;Elgin.Properties.evtMouseN=g.lat;Elgin.Properties.evtTTMouseX=h.xy.x;Elgin.Properties.evtTTMouseY=h.xy.y;Elgin.Properties.setSearchBuffers();Elgin.Properties.progress.wfs_showing=false;Elgin.Properties.progress.wfs_status="dormant";Elgin.Properties.progress.road_status="dormant";mScale=Math.round(Elgin.OlMap.map.getScale());if(Elgin.Properties.propVislyrs.length>0){Elgin.Properties.retrieveFromWfs_ajax(Elgin.Properties.propVislyrs,Elgin.Properties.evtMouseE,Elgin.Properties.evtMouseN,Elgin.Properties.buffM,mScale)
}else{Elgin.Properties.progress.wfs_status="failure"}if(Elgin.MapSettings.tooltip_enabled&&Elgin.MapSettings.tooltip_ITN=="onclick"&&mScale<Elgin.MapSettings.tooltip_ITN_maxScale&&mScale>Elgin.MapSettings.tooltip_ITN_minScale){Elgin.Properties.retrieveTooltip("ITN")}var k=5;var f=(new Date()).getTime()+(k*1000);new PeriodicalExecuter(function(e){if((new Date()).getTime()>f){if(Elgin.Properties.progress.wfs_status!="success"&&Elgin.Properties.progress.road_status!="success"){Elgin.Properties.showMonologueBox()}e.stop()}else{if(Elgin.Properties.progress.wfs_status=="closed"){e.stop()}else{if(Elgin.Properties.progress.wfs_status=="success"){if(Elgin.Properties.progress.wfs_showing){if(Elgin.Properties.progress.road_status=="success"){if(Elgin.MapSettings.tooltip_ITN_addToProperties){Elgin.Properties.addRoadInfoToPropertiesWindow()}e.stop()}}else{Elgin.Properties.showPropertiesWindow();Elgin.Properties.progress.wfs_showing=true}}else{if(Elgin.Properties.progress.wfs_status=="failure"){if(Elgin.Properties.progress.road_status=="success"){Elgin.Properties.showMonologueBox({road:true});e.stop()}else{if(Elgin.Properties.progress.road_status=="failure"){Elgin.Properties.showMonologueBox({road:false});e.stop()}}}}}}},0.2)},_findMaxScale:function(b,a){var e=-1;var c=function(f,g){for(var h in f){if(typeof(f[h])=="object"){c(f[h],g);if(f[h].id&&f[h].id==g){e=f[h].maxScale}}}};c(b,a);return e},retrieveFromWfs_ajax:function(f,e,g,a,h){Elgin.Properties.propFilters=Elgin.Properties.getFiltersForLayers(f,e,g,h);Elgin.Properties.propColumns=Elgin.Properties.getColumnsForLayers(f);if(Prototype.Browser.IE6){Elgin.Properties.retrieveFromWfs_IE6(f)}else{var c={request:"GetFeature",service:"WFS",version:Elgin.MapSettings.getFeatureWFSVer,typeName:f,cql_filter:Elgin.Properties.propFilters,propertyName:Elgin.Properties.propColumns,maxFeatures:Elgin.MapSettings.maxGetWFSFeatures+1};var b=Elgin.MapSettings.url_GeoServerWFS;new Ajax.Request(b,{method:"post",parameters:c,onSuccess:function(k){Elgin.Properties.displayPropertiesWin_wfs(k.responseText)},onFailure:function(k){Elgin.Properties.end();logger.error("Map objects AJAX properties request FAILED",{jsFile:"/olmap/js/Elgin.Properties.js",jsFunction:"Elgin.Properties.retrieveFromWfs_ajax()",ajaxFailure:"onFailure",ajaxURL:b});Elgin.Properties.progress.wfs_status="failure"},onException:function(){Elgin.Properties.progress.wfs_status="failure"}})}},retrieveFromWfs_IE6:function(b){var a=document.getPropertiesIE6Form;a.version.value=Elgin.MapSettings.getFeatureWFSVer;a.typename.value=b;a.cql_filter.value=Elgin.Properties.propFilters;a.propertyName.value=Elgin.Properties.propColumns;a.maxFeatures.value=(Elgin.MapSettings.maxGetWFSFeatures+1);a.submit()},displayPropertiesWin_wfs:function(f){var a=f;var c=a.replace(/xmlns:xml="http:\/\/www.w3.org\/XML\/1998\/namespace"/," ");var b=Elgin.Utils.parseXml(c);try{Elgin.Properties.pBroker=new Elgin.Properties.Broker(b);Elgin.Properties.progress.wfs_status="success"}catch(g){Elgin.Properties.progress.wfs_status="failure"}},showPropertiesWindow:function(){var b=Elgin.Properties.pBroker;var o=Math.round(Elgin.OlMap.map.getScale());if(Elgin.Properties.pWin){Elgin.Properties.pWin.destroy()}if(b.props.length==0){return}var c=new Array();var l=b.props.length;var g=true;if(Elgin.OlMap.zoominDisabled&&o==Elgin.MapSettings.osmmBaseMapScale){g=false}else{if(b.props.length>Elgin.MapSettings.maxFeaturesInProperties){l=Elgin.MapSettings.maxFeaturesInProperties}}for(var f=0;f<l;f++){var m={title:b.props[f].tabTitleImage+b.props[f].tabTitle,html:b.props[f].toHtml()};c.push(m)}if(b.props.length>Elgin.MapSettings.maxFeaturesInProperties&&g){var a=Elgin.OlMap.getZoomLevel(o,Elgin.MapSettings.mapZoomLevels)+2;if(a<=Elgin.MapSettings.mapZoomLevels.length){zScale=Elgin.MapSettings.mapZoomLevels[Elgin.MapSettings.mapZoomLevels.length-a-1]}else{zScale=Elgin.MapSettings.mapZoomLevels[Elgin.MapSettings.mapZoomLevels.length-1]}if(Elgin.OlMap.zoominDisabled&&zScale<Elgin.MapSettings.osmmBaseMapScale){zScale=Elgin.MapSettings.osmmBaseMapScale}var e="<div class='property_container'>";e+='<p class="property_title">'+(b.props.length>Elgin.MapSettings.maxGetWFSFeatures?"More than "+Elgin.MapSettings.maxGetWFSFeatures:b.props.length)+" map features found at this location</p>";e+='<p class="property_subtitle">The first 5 are displayed here</p>';e+="<p>Please zoom in order to distinguish the individual map features</p>";e+='<p class="property_url_p"><a class="property_url" href="javascript:Elgin.Properties.zoomToCoord('+Elgin.Properties.mulE+","+Elgin.Properties.mulN+","+zScale+')"><img src="/i/map.gif" style="noDecoration" align="absmiddle"><b>Zoom to map features</b></a></p>';e+="</div>";var m={title:"<img src='/images/blank.gif' style='width:1px;height:25px'>More....",html:e};c.push(m)}var k=new Ext.TabPanel({region:"center",activeTab:0,enableTabScroll:true,defaults:{autoScroll:true},items:c});var h="Map feature information";if(b.props.length>Elgin.MapSettings.maxGetWFSFeatures){h+=" - more than "+Elgin.MapSettings.maxGetWFSFeatures+" features found";if(b.props.length>Elgin.MapSettings.maxFeaturesInProperties&&g){h+=" (displaying first "+Elgin.MapSettings.maxFeaturesInProperties+")"}else{h+="(Displaying the first "+Elgin.MapSettings.maxGetWFSFeatures+")"}}else{h+=(b.props.length>1?" - "+b.props.length+" map features found "+(b.props.length>Elgin.MapSettings.maxFeaturesInProperties&&g?"(displaying the first "+Elgin.MapSettings.maxFeaturesInProperties+")":""):"")}Elgin.Properties.pWin=new Ext.Window({title:h,closable:true,width:450,height:400,plain:true,layout:"border",constrain:true,items:[k],bbar:[" ",{xtype:"tbtext",text:'<span id="txtRoadInfo"></span>'},"->",{xtype:"button",text:"Close",handler:function(){Elgin.Properties.progress.wfs_status="closed";Elgin.Properties.pWin.destroy()}}]});Elgin.Properties.pWin.show();Elgin.Properties.pBroker=b=null;Elgin.Properties.end()},showMonologueBox:function(a){Elgin.Properties.end()},mmoveEnd:0,mmoveTimeout:null,mousemoveToolTipHandler:function(b){if(Elgin.Properties.mmoveTimeout){clearTimeout(Elgin.Properties.mmoveTimeout)}if(Math.round(Elgin.OlMap.map.getScale())>Elgin.MapSettings.tooltip_maxScale){return false}Elgin.Properties.hideTooltip();var a=Elgin.OlMap.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(b.xy.x,b.xy.y));Elgin.Properties.evtMouseX=b.xy.x;Elgin.Properties.evtMouseY=b.xy.y;Elgin.Properties.evtTTMouseX=b.xy.x;Elgin.Properties.evtTTMouseY=b.xy.y;Elgin.Properties.evtMouseE=a.lon;Elgin.Properties.evtMouseN=a.lat;Elgin.Properties.mmoveTimeout=setTimeout(function(){if(Elgin.MapSettings.tooltip_ITN=="onmousemove"){Elgin.Properties.retrieveTooltip("ITN")}if(Elgin.Properties.tooltipMousemoveEventRegistered){Elgin.Properties.retrieveTooltip("mlObj")}},Elgin.MapSettings.tooltip_mouseStaticTime)},retrieveTooltip:function(a){if(!Elgin.MapSettings.tooltip_enabled){return false}Elgin.Properties.tooltip="";if(a=="mlObj"){var c=new Array();var f=","+Elgin.Utils.readCookie("ELGINMAPLYRVIS").replace(/\%2C/g,",")+",";for(i=0;i<Elgin.MapSettings.mapLayers_visbleTooltips.length;i++){if(f.indexOf(","+Elgin.MapSettings.mapLayers_visbleTooltips[i]+",")>-1){c[c.length]=Elgin.MapSettings.mapLayers_visbleTooltips[i]}}if(c.length==0){return false}}var b="index.cfm";var e={fuseaction:"map.getObjectTooltip",insertHTMLHead:"false",easting:Math.round(Elgin.Properties.evtMouseE),northing:Math.round(Elgin.Properties.evtMouseN),offset:Elgin.Properties.buffM,mapLayers:(a=="ITN"?"ITN":c.join(",")),generalisation:(a=="ITN"?(Math.round(Elgin.OlMap.map.getScale())<=25009?1:3):null)};new Ajax.Request(b,{method:"post",parameters:e,onSuccess:function(h){if(!h.responseText.blank()){var g=h.responseText.evalJSON();if(g.tooltip){Elgin.Properties.tooltip=g.tooltip;if(a=="ITN"){Elgin.Properties.progress.road_status="success"}Elgin.Properties.displayTooltip((a=="ITN"?Elgin.MapSettings.tooltip_ITN_displayTime:Elgin.MapSettings.tooltip_displayTime));Elgin.Properties.evtTTMouseX=Elgin.Properties.evtMouseX;Elgin.Properties.evtTTMouseY=Elgin.Properties.evtMouseY
}else{if(g.error_message){retrieveTooltipElgin.Properties.progress.road_status="failure";logger.log("Ajax request to find road name returned an error",{message:g.error_message,easting:e.easting,northing:e.northing,offset:e.offset,generalisation:e.generalisation,jsFile:"/olmap/js/Elgin.Properties.js",jsFunction:"Elgin.Properties.retrieveTooltip()"})}else{if(a=="ITN"){Elgin.Properties.progress.road_status="failure"}}}}else{if(a=="ITN"){Elgin.Properties.progress.road_status="failure"}}},onFailure:function(g){logger.error("Ajax request to find road name failed",{jsFile:"/olmap/js/Elgin.Properties.js",jsFunction:"Elgin.Properties.retrieveTooltip()",ajaxFailure:"onFailure",ajaxURL:b});if(a=="ITN"){Elgin.Properties.progress.road_status="failure"}},onException:function(g){if(a=="ITN"){Elgin.Properties.progress.road_status="failure"}}})},displayTooltip:function(a){if(Elgin.Properties.progress.wfs_status=="failure"){Elgin.Properties.end()}Elgin.Properties.hideTooltip();var b={html:Elgin.Properties.tooltip,x:Elgin.Properties.evtTTMouseX+(isRoadworksFinder?50:30),y:Elgin.Properties.evtTTMouseY+findPosY($("map"))-(isRoadworksFinder?25:20),baseCls:"x-tipcustom"};if(Prototype.Browser.IE6){b.width=150}Elgin.Properties.ttWin=new Ext.Tip(b);Elgin.Properties.ttWin.show();Elgin.MapSettings.tooltip_displayed=true;Elgin.Properties.tooltipDisplayTimeout=setTimeout("Elgin.Properties.hideTooltip()",a)},hideTooltip:function(){if(Elgin.MapSettings.tooltip_displayed){if(Elgin.Properties.ttWin){Elgin.Properties.ttWin.destroy()}Elgin.MapSettings.tooltip_displayed=false}if(Elgin.Properties.tooltipDisplayTimeout){clearTimeout(Elgin.Properties.tooltipDisplayTimeout)}},addRoadInfoToPropertiesWindow:function(){if(!Elgin.Properties.tooltip.blank()){if($("txtRoadInfo")){$("txtRoadInfo").innerHTML="<b>Road</b>: "+Elgin.Properties.tooltip}Elgin.Properties.displayRoadInMapStatusBar()}},displayRoadInMapStatusBar:function(){if($("roadnameStatusBar")){if(Elgin.Properties.currentRoadDisplayTimeout){window.clearTimeout(Elgin.Properties.currentRoadDisplayTimeout)}$("roadnameStatusBar").innerHTML="<b>Road</b>: "+Elgin.Properties.tooltip;Elgin.Properties.currentRoadDisplayTimeout=setTimeout(function(){$("roadnameStatusBar").innerHTML=""},7500)}},setSearchBuffers:function(){var b=Math.round(Elgin.OlMap.map.getScale());Elgin.Properties.buffPx=(b<=100000?(b>Elgin.MapSettings.osmmBaseMapScale?Elgin.MapSettings.hsPxTT_2:Elgin.MapSettings.hsPxTT_1):Elgin.MapSettings.hsPxTT_3);var c=Elgin.OlMap.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(0,0));var a=Elgin.OlMap.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(Elgin.Properties.buffPx,Elgin.Properties.buffPx));Elgin.Properties.buffM=Math.round((a.lon-c.lon)/2)},getFiltersForLayers:function(k,g,c,m){var a="DWITHIN(__GEOM_COL_NAME___,POINT("+g+" "+c+"),"+Elgin.Properties.getDWITHINSearchDist(m)+",meters)";var h=k.split(",");var b="";var l="";sep="";for(var f=0;f<h.length;f++){cql=Elgin.LayerTree.getCQLFilter(h[f].replace(/^e:/,""));if(cql){if(Elgin.MapSettings[h[f].replace(/^e:/,"")].coordRegEx){l=cql.replace(Elgin.MapSettings[h[f].replace(/^e:/,"")].coordRegEx,"")}else{l=cql}}else{l=""}b+=sep+l+(l.length>0?" AND ":"")+a.replace(/__GEOM_COL_NAME___/,Elgin.Properties.getLayerGeomCol(h[f].replace(/^e:/,"")));sep=";"}return b},getColumnsForLayers:function(g){var a=g.split(",");var b=[];for(var f=0;f<a.length;f++){try{b.push(Elgin.MapSettings[a[f].replace(/^e:/,"")].columns)}catch(h){b.push("")}}var c="";for(var f=0;f<b.length;f++){c+="("+b[f]+")"}return c},getLayerObjectType:function(a){if(Elgin.MapSettings[a.replace(/^e:/,"")].objType){return Elgin.MapSettings[a.replace(/^e:/,"")].objType}else{return"point"}},getLayerGeomCol:function(a){if(Elgin.MapSettings[a.replace(/^e:/,"")].geomCol){return Elgin.MapSettings[a.replace(/^e:/,"")].geomCol}else{return"GEOM"}},getDWITHINSearchDist:function(a){if(a>=4000000){return Elgin.MapSettings.hsPxMO_1}else{if(a>=2000000&a<4000000){return Elgin.MapSettings.hsPxMO_2}else{if(a>=1000000&a<2000000){return Elgin.MapSettings.hsPxMO_3}else{if(a>=500000&a<1000000){return Elgin.MapSettings.hsPxMO_4}else{if(a>=100000&a<500000){return Elgin.MapSettings.hsPxMO_5}else{if(a>=25000&a<100000){return Elgin.MapSettings.hsPxMO_6}else{if(a>=10000&a<25000){return Elgin.MapSettings.hsPxMO_7}else{if(a>=5000&a<10000){return Elgin.MapSettings.hsPxMO_8}else{if(a>=2500&a<5000){return Elgin.MapSettings.hsPxMO_9}else{return Elgin.MapSettings.hsPxMO_10}}}}}}}}}},getShowProperties:function(a){if(typeof Elgin.MapSettings[a]=="undefined"){return false}else{if(typeof(Elgin.MapSettings[a].showProperties)=="undefined"){return true}else{return Elgin.MapSettings[a].showProperties}}},getDisclaimerDivs:function(c,b,a){t="<div class='property_disclaimer'>";if(a){t+="<b><i>"+a+"</i></b><br><br>"}t+="<b>Source</b>: "+c+(b?"<br><b>Last updated</b>: "+b:"")+"<br><br>Elgin makes no claims to the accuracy or completeness of the information displayed. Contact "+c+" for more details.</div>";return t},getFeatureURLs:function(h,g,l,f,k,c){var b=(c?c:"after");var a="";if(h&&!isEToN){a+='<img src="/i/details.gif" style="noDecoration" align="absmiddle"><a class="property_url" href="'+h+'" target="_top" title="View full details"><b>View full details</b></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'}if(g&&l){Elgin.Properties.mulE=g;Elgin.Properties.mulN=l;a+='<a class="property_url" href="javascript:Elgin.Properties.zoomToCoord('+g+","+l+","+(f?f:5000)+')"><img src="/i/map.gif" style="noDecoration" align="absmiddle" title="Zoom to map feature"><b>Zoom to map feature</b></a>'}if(k){if(b=="before"){a=k+a}else{a+=k}}return'<div class="property_url_p" style="padding-top:5px;text-align:center">'+a+"</div>"},getFeatureURLs_noTxt:function(f,c,g,b){var a="";if(f){a+='<a class="property_image_url" href="'+f+'" target="_top"><img src="/i/details.gif" style="noDecoration" align="absmiddle" title="View full details"></a> '}if(c&&g){a+='<a class="property_image_url" href="javascript:Elgin.Properties.zoomToCoord('+c+","+g+","+(b?b:5000)+')"><img src="/i/map.gif" style="noDecoration" align="absmiddle" title="Zoom to map feature"></a>'}return a},getDisplayRow:function(g,b,e,f,c){var a="";if(e.length>0||f>0){a="<tr>";a+="<td class='property_dataGridTitle' style='width:120px'>"+b+"</td>";if(b=="Link"){"<td class='property_dataGridData'><span id='propGrid_"+g+"'><a href='"+(e.length>0?e:"")+"' target='_blank'>Open link in new window...</a></span></td>"}else{a+="<td class='property_dataGridData'"+(c?"style='"+c+"'":"")+"><span id='propGrid_"+g+"'>"+(e.length>0?e:"&nbsp;-")+"</span></td>"}a+="</tr>"}return a},getPropertiesGrid:function(e,g,b,h,l,f,a){if(!h){var h=new Array();for(j=0;j<g.length;j++){h[j]=1}}if(!f){var f=new Array();for(j=0;j<g.length;j++){f[j]=0}}if(!a){var a=new Array();for(j=0;j<g.length;j++){a[j]=null}}var k="<table border=0 style='width:"+(Prototype.Browser.IE?"95":"100")+"%;table-layout:fixed'>";for(var c=0;c<g.length;c++){if(f[c]==0&&(Elgin.Utils.getByTagName(e,("e:"+g[c]))[0]||g[c]=="_BLANK_CELL")){k+=Elgin.Properties.getDisplayRow(g[c]+"_"+(l?l:""),b[g[c]],(g[c]=="_BLANK_CELL"?"&nbsp;":Elgin.Properties.getXMLVal(e,g[c])),h[c],a[c])}}k+="</table>";return k},getHistoricalTROs:function(){url="index.cfm?";url+="fuseaction=tro.troMapHistoricTROSearch&";url+="fromMap=1&";url+="MouseCoord="+Math.round(Elgin.Properties.evtMouseE)+","+Math.round(Elgin.Properties.evtMouseN)+"&";url+="tro_type=historic&";url+="insertHTMLHead=false&";new Ajax.Request(url,{method:"get",onSuccess:function(a){Elgin.Properties.historicTROSearch=true;Elgin.Properties.displayPropertiesWin_wfs(a.responseText);Elgin.Properties.wfs_status="success"},onFailure:function(){Elgin.Properties.wfs_status="failure"},onError:function(){Elgin.Properties.wfs_status="failure"}})},jemaViewSiteSchematic:function(b){var a="index.cfm?";a+="fuseaction=jema.jema_boreholeSchematicDisplay&";a+="Borehole_MapRef="+b+"&";a+="keepThis=true&";a+="insertHTMLHead=false&";new Ajax.Request(a,{method:"post",onSuccess:function(e){var c=e.responseText||alert("Unable to view samplesite schamtic.\nError details\n[AJAX] onSuccess, unable to read response\n[Func] Elgin.properties.jemaViewSiteSchematic \n[MapRef] "+b);
Elgin.Properties.toggleJEMASchematicWin(true,c)},onFailure:function(c){alert("Unable to view samplesite schematic.\nError details\n[AJAX] onFailure\n[Func] Elgin.properties.jemaViewSiteSchematic \n[MapRef] "+b);logger.error("Map AJAX legend request FAILED",{jsFile:"/olmap/js/Elgin.Properties.js",jsFunction:"Elgin.Properties.jemaViewSiteSchematic()",mapref:b,ajaxFailure:"onFailure",ajaxURL:a})},onException:function(c,f){logger.error("Map AJAX legend request FAILED",{jsFile:"/olmap/js/Elgin.Properties.js",jsFunction:"Elgin.Properties.jemaViewSiteSchematic()",mapref:b,ajaxFailure:"onException",ajaxURL:a,ajaxException:f})}})},loadJEMASchematicWin:function(){var a="<div id='jemaSchematic_extwin' class='extJEMASchematic'>Loading...</div>";Elgin.Properties.jemaSchematicPanel=new Ext.Panel({html:a,preventBodyReset:true});Elgin.Properties.jemaSchematicWin=new Ext.Window({title:"Borehole schematic",layout:"fit",width:340,height:505,closeAction:"hide",plain:true,resizable:false,items:[Elgin.Properties.jemaSchematicPanel],preventBodyReset:true,buttons:[{text:"Close",handler:function(){Elgin.Properties.jemaSchematicWin.hide()}}]});Elgin.Properties.jemaSchematicWin.show()},toggleJEMASchematicWin:function(b,a){if(!Elgin.Properties.jemaSchematicWin){Elgin.Properties.loadJEMASchematicWin()}if(!$("jemaSchematic_extwin")){alert("Unable to view samplesite schematic\n\nErr: jemaSchematicPanel failed to load");return}if(b){$("jemaSchematic_extwin").innerHTML="<div id='jemaSchematic_extwin' class='extJEMASchematic'>"+a+"</div>";Elgin.Properties.jemaSchematicWin.show()}else{Elgin.Properties.jemaSchematicWin.hide()}},getXMLVal:function(b,a){try{return Elgin.Utils.getByTagName(b,"e:"+a)[0].firstChild.nodeValue}catch(c){return""}},zoomToCoord:function(b,c,a){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(b,c),Elgin.OlMap.getZoomLevel(a,Elgin.MapSettings.mapZoomLevels));if(Elgin.Properties.pWin){Elgin.Properties.pWin.destroy()}},start:function(){if($("imgLoadingSandtimer")){$("imgLoadingSandtimer").style.display="inline"}},end:function(){if(Elgin.OlMap._loading==0){if($("imgLoadingSandtimer")){$("imgLoadingSandtimer").style.display="none"}}},getTRODetailsURL:function(c,b){var a="/index.cfm?fuseaction=tro.TRODetail&";a+="tro_id="+c+","+b+"&";a+="order_id="+c+"&";a+="swa_org_ref="+b+"&";a+="mousecoord="+Elgin.Properties.evtMouseE+","+Elgin.Properties.evtMouseN+"&";a+="saveSearch_TRO=1&";a+="fromMap=1&";a+="isRF="+(isRoadworksFinder?1:0)+"&";return a},_getSWSymbol:function(e,b,g,a){var f="";var c=new Array();switch(parseInt(b)){case 1:f="Low";c[0]="lowimpact_px";break;case 3:f="High";c[0]="highimpact_px";break;case 2:f="Med";c[0]="mediumimpact_px";break;case 0:f="ForwardPlanning";c[0]="grayimpact_px";break;case 4:f="Sev";c[0]="severeimpact_px";break;default:f="High";c[0]="highimpact_px"}if(g=="sw_fp"||a==1){f+="_grey"}switch(parseInt(e)){case 1:c[1]="RWSign"+f;c[2]="Roadwork";break;case 2:c[1]="TLSign"+f;c[2]="Roadwork with traffic lights";break;case 3:c[1]=(g=="sw_fp"?"RWClosed_grey":"RWClosed");c[2]="Possible lane/road closure";break;case 90:c[1]="RWSignHigh_grey";c[2]="Forward Planning";break;case 18:c[1]="StopGoTriangle"+f;c[2]="Roadworks with Stop/Go board";break;case 4:c[1]="ExclamTriangle"+f;c[2]="Obstruction";break;case 6:c[1]="Flag"+f;c[2]="Public event";break;case 7:c[1]="ExclamTriangle"+f;c[2]="Accident";break;case 8:c[1]="ExclamTriangle"+f;c[2]="Incident";break;case 9:c[1]="ExclamTriangle"+f;c[2]="Adverse weather conditions";break;case 11:c[1]="ExclamTriangle"+f;c[2]="Unknown event";break;case 12:c[1]="Skip"+f;c[2]="Skip";break;case 13:c[1]="Scaffolding"+f;c[2]="Scaffolding";break;case 14:c[1]="Sack"+f;c[2]="Materials on road";break;case 15:c[1]="noteIcon"+f;c[2]="Traffic Order";break;case 16:c[1]="DiversionSign"+f;c[2]="Diversion";break;case 19:c[1]="RWClosed";c[2]="Non-roadworks related street closure";break;default:c[1]="RWSignHigh";c[2]="Roadwork"}return c}};var Elgin=window.Elgin||{};Elgin.Properties=window.Elgin.Properties||{};Elgin.Properties.Broker=Class.create({props:[],initialize:function(g){if(!g){return}this.props.clear();var m=Elgin.Utils.getByTagName(g,Elgin.MapSettings.getFeatureWFSFM);if(m[0].childNodes.length==0){var b=false;var a=Elgin.Utils.readCookie("ELGINMAPLYRVIS").split(",");if(!Elgin.Properties.historicTROSearch){for(var f=1;f<a.length;f++){if(a[f].search(/^TRO/i)>-1){b=true;break}}}else{Elgin.Properties.historicTROSearch=false}if(b){Elgin.Properties.getHistoricalTROs();return false}else{throw new Error("Elgin.Properties.Broker: no properties found")}}else{for(var f=0,h=m[0].childNodes.length;f<h;++f){try{var o=Elgin.MapSettings[m[0].childNodes[f].nodeName.replace(/^e:/,"")].lyrType}catch(k){var o="unknown"}propsTab=null;switch(o){case"streetwork":if(isRoadworksFinder){propsTab=new Elgin.Properties.StreetworksV5(m[0].childNodes[f])}else{propsTab=new Elgin.Properties.Streetworks(m[0].childNodes[f])}break;case"busstop":propsTab=new Elgin.Properties.BusStops(m[0].childNodes[f]);break;case"lorryroute":propsTab=new Elgin.Properties.LorryRoutes(m[0].childNodes[f]);break;case"saltingroute":propsTab=new Elgin.Properties.SaltingRoutes(m[0].childNodes[f]);break;case"streetlight":propsTab=new Elgin.Properties.StreetLights(m[0].childNodes[f]);break;case"structure":propsTab=new Elgin.Properties.Structures(m[0].childNodes[f]);break;case"restriction":propsTab=new Elgin.Properties.Restriction(m[0].childNodes[f]);break;case"envsensitivearea":propsTab=new Elgin.Properties.EnvSensitiveAreas(m[0].childNodes[f]);break;case"asd_traffic_sensitive_streets":propsTab=new Elgin.Properties.ASD_TrafficSensStreet(m[0].childNodes[f]);break;case"asd_specialengdiff":propsTab=new Elgin.Properties.ASD_SpecialEngDiff(m[0].childNodes[f]);break;case"asd_speedlimits":propsTab=new Elgin.Properties.ASD_SpeedLimits(m[0].childNodes[f]);break;case"asd_pipelines":propsTab=new Elgin.Properties.ASD_displayType1(m[0].childNodes[f],o);break;case"asd_pedestrian_crossing":case"asd_structures_notsed":propsTab=new Elgin.Properties.ASD_displayType2(m[0].childNodes[f],o);break;case"kent_earlyNotificationActivities":propsTab=new Elgin.Properties.Kent_earlyNotificationActivities(m[0].childNodes[f]);break;case"tro":case"tro_historic":propsTab=new Elgin.Properties.TROs(m[0].childNodes[f],o);break;case"community_areas":propsTab=new Elgin.Properties.CommunityAreas(m[0].childNodes[f]);break;case"nsg":propsTab=new Elgin.Properties.NSG(m[0].childNodes[f]);break;case"nsg_special_desig":propsTab=new Elgin.Properties.NSGSpecialDesignation(m[0].childNodes[f]);break;case"nsg_road_status":propsTab=new Elgin.Properties.NSGRoadStatus(m[0].childNodes[f]);break;case"nsg_reinstate_desig":propsTab=new Elgin.Properties.NSGReinstatementDesignation(m[0].childNodes[f]);break;case"OlympicRouteNetwork":propsTab=new Elgin.Properties.OlympicRouteNetwork(m[0].childNodes[f]);break;case"OlympicTorchRoute":propsTab=new Elgin.Properties.OlympicTorchRoute(m[0].childNodes[f]);break;case"jema_geology_drift":propsTab=new Elgin.Properties.JEMAGeologyDrift(m[0].childNodes[f]);break;case"jema_geology_solid":propsTab=new Elgin.Properties.JEMAGeologySolid(m[0].childNodes[f]);break;case"jema_source_protection":propsTab=new Elgin.Properties.JEMASourceProtection(m[0].childNodes[f]);break;case"jema_geology_boreholes":propsTab=new Elgin.Properties.JEMAGeologyBoreholes(m[0].childNodes[f]);break;case"jema_site":propsTab=new Elgin.Properties.JEMASites(m[0].childNodes[f]);break;case"jema_samplesite":propsTab=new Elgin.Properties.JEMASampleSites(m[0].childNodes[f]);break;default:propsTab=new Elgin.Properties.Base(m[0].childNodes[f]);break}if(Elgin.MapSettings[m[0].childNodes[f].nodeName.replace(/^e:/,"")].chkDup){chkstr=m[0].childNodes[f].nodeName.replace(/^e:/,"");cols=Elgin.MapSettings[m[0].childNodes[f].nodeName.replace(/^e:/,"")].chkDup.split(",");for(var l=0;l<cols.length;l++){chkstr+="["+cols[l]+":"+Elgin.Properties.getXMLVal(m[0].childNodes[f],cols[l])+"]"}isdup=false;for(d=0;d<Elgin.Properties.dupChkRepository.length;d++){if(Elgin.Properties.dupChkRepository[d]==chkstr){isdup=true;
break}}if(!isdup){this.props.push(propsTab);Elgin.Properties.dupChkRepository.push(chkstr)}}else{this.props.push(propsTab)}}}},toString:function(){return""}});var Elgin=window.Elgin||{};Elgin.Properties=window.Elgin.Properties||{};Elgin.Properties.Base=Class.create({htmlTitle:'<h1 class="property_title_base">Unknown feature type</h1>',htmlUrls:"",htmlDisclaimer:"",swSymbol:new Array(),initialize:function(a){this.xml=a;this.tabTitle=this.getTabTitle();this.tabTitleImage=this.getTabTitleImage();this.htmlFields=this.getHtmlFields()},getTabTitle:function(){return'<img src="images/blank.gif" style="width:1px;height:25px">Unknown Type'},getTabTitleImage:function(){return""},getHtmlFields:function(){return"<br><br>ToDo: enunerate variables for error display..."},toHtml:function(){return'<div class="property_container">'+this.htmlTitle+this.htmlFields+this.htmlUrls+this.htmlDisclaimer+"</div>"}});Elgin.Properties.StreetworksV5=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return""},getTabTitleImage:function(){this.swSymbol=Elgin.Properties._getSWSymbol(Elgin.Properties.getXMLVal(this.xml,"SYMBOL_ID"),Elgin.Properties.getXMLVal(this.xml,"IMPACT_SCORE"),Elgin.Properties.getXMLVal(this.xml,"SW_TYPE"),Elgin.Properties.getXMLVal(this.xml,"WORKS_STATE"));return'<img src="/images/icons/'+this.swSymbol[1]+'.gif" alt="'+this.swSymbol[2]+'">'},getHtmlTitle:function(){return""},getHtmlFields:function(){var f=function(e){var q=Elgin.Properties.getXMLVal(e,"ROAD_LOCATION");if(q.strip().empty()){q="TBC"}return q};try{var p=Elgin.Properties.getXMLVal(this.xml,"PERMIT_STATUS")}catch(k){var p=-1}p=(typeof(p)=="string"&&p.length==0?-1:p);isHA=(Elgin.Properties.getXMLVal(this.xml,"PROMOTER")=="Highways Agency"?true:false);swlyrTitle="";swTypeXML=Elgin.Properties.getXMLVal(this.xml,"SW_TYPE");symID=parseInt(Elgin.Properties.getXMLVal(this.xml,"SYMBOL_ID"));swDesc="Roadwork or obstruction";isRoadClosure=false;switch(symID){case 1:swDesc="Roadwork";break;case 2:swDesc="Roadwork with traffic management";break;case 3:swDesc="Road closure";isRoadClosure=true;break;case 4:swDesc="Obstruction or incident";break;case 6:swDesc="Public event";break;case 7:swDesc="Accident";break;case 8:swDesc="Obstruction or incident";break;case 9:swDesc="Weather incident";break;case 11:swDesc="Unknown incident";break;case 12:swDesc="Skip";break;case 13:swDesc="Scaffolding or hoarding";break;case 14:swDesc="Materials on highway";break;case 15:swDesc="Temporary traffic order";break;case 16:swDesc="Diversion";break;case 17:swDesc="Restriction";break;case 18:swDesc="Roadwork with Stop/Go boards";break;case 19:swDesc="Non-roadworks related street closure";break}if(symID!=7&&symID!=8){if(swTypeXML=="sw_s"){if(isHA&&isRoadClosure){swlyrTitle="Possible road/lane closure in search results"}else{if(p>-1){swlyrTitle="Permit in search results"}else{swlyrTitle=swDesc+" in search results"}}}else{switch(swTypeXML){case"sw_c":swType="Current";break;case"sw_f":swType="Planned";break;case"sw_fp":swType="Forward planned";break}if(isHA&&isRoadClosure){swlyrTitle="Possible "+swType.toLowerCase()+" road/lane closure"}else{if(p>-1){swlyrTitle=swType+" permit"}else{swlyrTitle=swType+" "+swDesc.toLowerCase()}}}}if(symID==6){swlyrTitle+="<br><br>"+Elgin.Properties.getXMLVal(this.xml,"WORKS_DESC").replace(/[\d ]{6,14}/," <em>xxxx xxx xxxx</em> ")}var l=function(r,q){var u=Elgin.Properties.getXMLVal(q,"SE_ID");var w=Elgin.Properties.getXMLVal(q,"PHASE_ID");var e='<a href="index.cfm?fuseaction=streetworks.streetworksDetail&amp;se_id='+u+"&amp;phase_id="+w+"&amp;hdn_details_initiator=map&amp;fromMap=1&amp;swClickedOnIs="+swTypeXML+'&amp;searchType=mapclick&amp;typeOfLastSWSearch=current">'+r+"</a>";return e};var b=function(r,q){var w=Elgin.Properties.getXMLVal(q,"EASTING");var u=Elgin.Properties.getXMLVal(q,"NORTHING");var e='<a href="index.cfm?fuseaction=streetworks.streetworksMap&amp;zoomX='+w+"&amp;zoomY="+u+'&amp;zoomS=5000&amp;zoomMapS=5000">'+r+"</a>";Elgin.Properties.mulE=w;Elgin.Properties.mulN=u;return e};var h=function(r){var e="";var q=Elgin.Properties.getXMLVal(r,"SYMBOL_ID");if(q==3){e="<p>Road closure</p>"}return e};var m=function(s){var w=Elgin.Properties.getXMLVal(s,"START_DATE_DISPLAY");var e=Elgin.Properties.getXMLVal(s,"END_DATE_DISPLAY");var r=false;var q=false;var u="(estimated)";if(w.include(u)){r=true;w=w.gsub(u,"")}if(e.include(u)){q=true;e=e.gsub(u,"")}return w.strip()+"&nbsp;&nbsp;&nbsp;to&nbsp;&nbsp;&nbsp;"+e.strip()+(r||q?"&nbsp;&nbsp;"+u:"")};var o=function(e){var r=Elgin.Properties.getXMLVal(e,"IMPACT_SCORE");var q="";switch(r){case"4":q="Severe";break;case"3":q="Moderate";break;case"2":q="Slight";break;case"1":q="Minimal";break;default:q="Unknown";break}return q};var c=function(e){var q=Elgin.Properties._getSWSymbol(Elgin.Properties.getXMLVal(e,"SYMBOL_ID"),Elgin.Properties.getXMLVal(e,"IMPACT_SCORE"),Elgin.Properties.getXMLVal(e,"SW_TYPE"),Elgin.Properties.getXMLVal(e,"WORKS_STATE"));return"/images/icons/"+q[1]+".gif"};var a="\n";var g='<div class="summary_results">'+a+'  <div class="summary_title" style="background-image:url('+c(this.xml)+')">'+a+l(f(this.xml),this.xml)+"  </div>"+a+'  <div class="summary_tables">'+a+'    <table class="left_table">'+a+"      <tr>"+a+"        <td>"+swlyrTitle+"<br><br></td>"+a+"      </tr>"+a+"      <tr>"+a+"        <td>"+m(this.xml)+"</td>"+a+"      </tr>"+a+"      <tr>"+a+"        <td>"+a+"          "+o(this.xml)+" impact on journey time"+a+"        </td>"+a+"      </tr>"+a+"    </table>"+a+'    <table class="right_table">'+a+"      <tr>"+a+"        <th>Responsibility&nbsp;for&nbsp;these&nbsp;works:</th>"+a+"        <td>"+(Elgin.Properties.getXMLVal(this.xml,"PROMOTER")?Elgin.Properties.getXMLVal(this.xml,"PROMOTER"):"Not recorded")+a+"      </tr>"+a+"      <tr>"+a+"        <th>Last updated on Elgin:</th>"+a+"        <td>"+Elgin.Properties.getXMLVal(this.xml,"LAST_ADAPTER_UPDATE_DISPLAY")+a+"      </tr>"+a+"    </table>"+a+'    <br class="clear">'+a+"  </div>"+a;if(swTypeXML=="sw_fp"){g+='<div class="summary_tables" style="padding-top:5px">'+a+"These works have been provisionally planned to take place, and final details may vary. In particular, the dates provided sometimes represent a broad timescale, and may not indicate exact start and end dates.</div>"}g+='  <div class="summary_links"><img src="/i/details.gif" alt="Full details"/>&nbsp;'+l("Full details",this.xml)+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="/i/map.gif" alt="Zoom to the feature"/>&nbsp;'+b("Zoom to the feature",this.xml)+"  </div>"+a+"</div>";if(requestDev){g+='  <div class="summary_tables">'+a+'    <table class="left_table">'+a+"      <tr><td><b>[Dev]</b></td><td>&nbsp;</td></tr>"+a+"      <tr><td>SE_ID:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"SE_ID")+"</td></tr>"+a+"      <tr><td>ORIGINATOR_REF:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"ORIGINATOR_REF")+"</td></tr>"+a+"      <tr><td>SW_TYPE:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"SW_TYPE")+"</td></tr>"+a+"      <tr><td>IMPACT_SCORE:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"IMPACT_SCORE")+"</td></tr>"+a+"      <tr><td>SYMBOL_ID:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"SYMBOL_ID")+"</td></tr>"+a+"      <tr><td>E,N:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"EASTING")+","+Elgin.Properties.getXMLVal(this.xml,"NORTHING")+"</td></tr>"+a+"      <tr><td>WORKS_LOCATION:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"WORKS_LOCATION")+"</td></tr>"+a+"      <tr><td>WORKS_DESC:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"WORKS_DESC")+"</td></tr>"+a+"      <tr><td>ROAD_LOCATION:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"ROAD_LOCATION")+"</td></tr>"+a+"      <tr><td>WORKS_STATE:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"WORKS_STATE")+"</td></tr>"+a+"      <tr><td>PERMIT_STATUS:</td><td>"+Elgin.Properties.getXMLVal(this.xml,"PERMIT_STATUS")+"</td></tr>"+a+"    </table>"+a+"</div><br>"}return g
},getHtmlUrls:function(){return""}});Elgin.Properties.Streetworks=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return""},getTabTitleImage:function(){this.swSymbol=Elgin.Properties._getSWSymbol(Elgin.Properties.getXMLVal(this.xml,"SYMBOL_ID"),Elgin.Properties.getXMLVal(this.xml,"IMPACT_SCORE"),Elgin.Properties.getXMLVal(this.xml,"SW_TYPE"),Elgin.Properties.getXMLVal(this.xml,"WORKS_STATE"));return'<img src="/images/icons/'+this.swSymbol[1]+'.gif" alt="'+this.swSymbol[2]+'">'},getHtmlTitle:function(){var g="Roadwork - type [tbd]";try{var f=Elgin.Properties.getXMLVal(this.xml,"PERMIT_STATUS")}catch(c){var f=-1}f=(typeof(f)=="string"&&f.length==0?-1:f);switch(Elgin.Properties.getXMLVal(this.xml,"SW_TYPE")){case"sw_c":g="Current "+(f==-1?"roadwork or obstruction":"permit");break;case"sw_f":g="Future "+(f==-1?"roadwork or obstruction":"permit");break;case"sw_fp":g="Planned "+(f==-1?"roadwork or obstruction":"permit");break;case"sw_s":g=(f==-1?"Roadwork":"Permit")+" in search results";break}var b=Elgin.Properties.getXMLVal(this.xml,"IMPACT_DESC");if(b.indexOf("Low - ")==0){b=b.replace(/^Low/,"Minimal")}else{if(b.indexOf("Medium - ")==0){b=b.replace(/^Medium/,"Slight")}else{if(b.indexOf("High - ")==0){b=b.replace(/^High/,"Moderate")}}}var a='<p class="property_title">'+g+"</p>";a+='<p class="property_subtitle"><img src="/images/icons/'+this.swSymbol[0]+'.gif" style="border:1px solid #808080;width:12px;height:12px;vertical-align:bottom" alt="'+this.swSymbol[2]+'"> Impact: '+b+(this.swSymbol[1]=="RWClosed"?" - possible road/lane closure":"")+"</p>";return a},getHtmlFields:function(){var g=["ORIGINATOR_REF","ROAD_LOCATION","WORKS_LOCATION","START_DATE_DISPLAY","END_DATE_DISPLAY","WORKS_DESC","PROMOTER","LAST_ADAPTER_UPDATE_DISPLAY"];var a={ORIGINATOR_REF:"Works reference",ROAD_LOCATION:"Road&nbsp;location",WORKS_LOCATION:"Works&nbsp;location",START_DATE_DISPLAY:"Works&nbsp;start&nbsp;date",END_DATE_DISPLAY:"Works&nbsp;end&nbsp;date",WORKS_DESC:"Works&nbsp;description",PROMOTER:"Promoter",LAST_ADAPTER_UPDATE_DISPLAY:"Last&nbsp;updated&nbsp;on&nbsp;Elgin"};var e=[1,1,1,1,0,1,1,1];var f=((((userRolesList.indexOf("ELGIN_LA")>-1||userRolesList.indexOf("ELGIN_LA_ADMIN")>-1)&&(Elgin.Properties.getXMLVal(this.xml,"WORKS_DESC").length!=0&&Elgin.Properties.getXMLVal(this.xml,"WORKS_DESC")!=Elgin.Properties.getXMLVal(this.xml,"WORKS_LOCATION")))||SWWorksDescDisplayOrgNames.indexOf(","+Elgin.Properties.getXMLVal(this.xml,"PROMOTER").toUpperCase()+",")>-1||nonSWIcons.indexOf(","+Elgin.Properties.getXMLVal(this.xml,"SYMBOL_ID")+",")>-1)?0:1);var c=[0,0,0,0,0,f,0,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,g,a,e,null,c);if(Elgin.Properties.getXMLVal(this.xml,"SW_TYPE")=="sw_fp"){b+='<div style="padding:5px">These works have been provisionally planned to take place, and final details may vary. In particular, the dates provided sometimes represent a broad timescale, and may not indicate exact start and end dates.</div>'}return b},getHtmlUrls:function(){var b=Elgin.Properties.getXMLVal(this.xml,"PHASE_ID");var a="/index.cfm?fuseaction="+(isRoadworksFinder?"streetworks":"tma")+".streetworksDetail&";a+="se_id="+Elgin.Properties.getXMLVal(this.xml,"SE_ID")+"&";a+="phase_id="+b+"&";a+="fromMap=1&";a+="swClickedOnIs=current&";a+="searchType=mapclick&";a+="typeOfLastSWSearch=current&";if(b>1){a+="#streetwork"+b}return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.BusStops=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return""},getTabTitleImage:function(){return'<img src="/images/icons/Busstop.gif" alt="Bus stop">'},getHtmlTitle:function(){var a='<p class="property_title" style="margin:0">Bus stop</p>';return a},getHtmlFields:function(){var f=["ATCOCODE","NAPTANCODE","COMMONNAME","SHORTNAME","LANDMARK","BEARING","CROSSING","STREET","LOCALITYNAME","TOWN","SUBURB","STOPTYPE","PLATECODE"];var b={ATCOCODE:"ATCO Code",NAPTANCODE:"NaPTAN Code",COMMONNAME:"Name",SHORTNAME:"Alt name",LANDMARK:"Landmark",BEARING:"Direction",CROSSING:"Crossing",STREET:"Street",LOCALITYNAME:"Locality",TOWN:"Town",SUBURB:"Suburb",STOPTYPE:"Stop type",PLATECODE:"Plate Code"};var e=[1,0,1,0,0,0,0,1,1,1,0,1,0];var c=Elgin.Properties.getPropertiesGrid(this.xml,f,b,e);if(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME").search("Kent")>-1){var a="If planning works which would require a road closure, please contact Kent County Council, Transport Integration (at <a href='mailto:transport.integration@kent.gov.uk?subject=Bus%20stop%20query%20ATCO%20code%20-%20"+Elgin.Properties.getXMLVal(this.xml,"ATCOCODE")+"'>transport.integration@kent.gov.uk</a> or on 01622 605095) quoting the ATCO code indicated."}else{var a}c+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"),a);return c},getHtmlUrls:function(){return Elgin.Properties.getFeatureURLs(null,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.EnvSensitiveAreas=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"Environmentally Sensitive Area"},getHtmlTitle:function(){var a='<p class="property_title">Environmentaly Sensitive Area</p>';a+='<p class="property_subtitle">Before any works/site visit contact Kent Wildlife Trust Roadside Verge Officer on 01622 662012 and quote the reference IDCode below </p>';return a},getHtmlFields:function(){var c=["IDCO","LENGTH_MET","HAB_TYPE","UK_RARE_SC","KENT_RARE_","WOOD__INDI","GRASS_INDI","NOTABLE","SPRING_CUT","AUTUMN_CUT"];var a={IDCO:"IDCode",LENGTH_MET:"Length (m)",HAB_TYPE:"Habitat",UK_RARE_SC:"Species which are nationally rare or scarce",KENT_RARE_:"Species which are rare or scarce in Kent",WOOD__INDI:"Ancient woodland indicator species",GRASS_INDI:"Indicators of unimproved grassland habitats",NOTABLE:"Other notable species",SPRING_CUT:"Spring Management Recommendations",AUTUMN_CUT:"Autumn Management recommendations"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));b+="<div class='property_disclaimer'>Part street data is displayed approximately so please refer to full details for accurate start and end coordinates.</div>";return b},getHtmlUrls:function(){return Elgin.Properties.getFeatureURLs(null,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.ASD_StructuresNotSED=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"Structures"},getHtmlTitle:function(){var a='<p class="property_title">Structures (not SED)</p>';return a},getHtmlFields:function(){var c=["USRN","STREET","RESTRICT"];var a={USRN:"USRN",STREET:"Street",RESTRICT:"Restrictions"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.ASD_TrafficSensStreet=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()
},getTabTitle:function(){return"Traffic Sensitive Street"},getHtmlTitle:function(){var a='<p class="property_title">Traffic Sensitive Street</p>';return a},getHtmlFields:function(){var c=["USRN","ROADNAME","ROADDESIGNATION","WHOLE"];var a={USRN:"USRN",ROADNAME:"Road name",ROADDESIGNATION:"Designation",WHOLE:"Applicable to"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));b+="<div class='property_disclaimer'>Part street data is displayed approximately so please refer to full details for accurate start and end coordinates.</div>";return b},getHtmlUrls:function(){var a="index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN")+" &fromTrafficSensitivity=1";return Elgin.Properties.getFeatureURLs(a,null,null)}});Elgin.Properties.ASD_displayType1=Class.create(Elgin.Properties.Base,{initialize:function($super,a,b){$super(a);this.lyrType=b;this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls();this.tabTitle=this.getTabTitle()},getTabTitle:function(){switch(this.lyrType){case"asd_specialengdiff":return"Special Engineering Difficulty";case"asd_speedlimits":return"Speed limit";case"asd_pipelines":return"Pipeline"}},getHtmlTitle:function(){switch(this.lyrType){case"asd_specialengdiff":var a='<p class="property_title">Special Engineering Difficulty</p>';break;case"asd_speedlimits":var a='<p class="property_title">Speed Limit</p>';break;case"asd_pipelines":var a='<p class="property_title">Pipeline</p>';break}return a},getHtmlFields:function(){var e=["TYPE1_USRN","TYPE2_USRN","ESUID","ESU_LENGTH","STREET","DESCRIPTIO","RESTRICT1","RESTRICT2","RESTRICT3","RESTRICT4","RESTRICT5","RESTRICT6","RESTRICT7","RESTRICT8","RESTRICT9","RESTRICT10","RESTRICT11","RESTRICT12","RESTRICT13","RESTRICT14","RESTRICT15","MORE"];var a={TYPE1_USRN:"USRN&nbsp;(Type&nbsp;1)",TYPE2_USRN:"USRN&nbsp;(Type&nbsp;2)",ESUID:"ESU",ESU_LENGTH:"ESU Length",STREET:"Street",DESCRIPTIO:"Description",RESTRICT1:"Restriction&nbsp;1",RESTRICT2:"Restriction&nbsp;2",RESTRICT3:"Restriction&nbsp;3",RESTRICT4:"Restriction&nbsp;4",RESTRICT5:"Restriction&nbsp;5",RESTRICT6:"Restriction&nbsp;6",RESTRICT7:"Restriction&nbsp;7",RESTRICT8:"Restriction&nbsp;8",RESTRICT9:"Restriction&nbsp;9",RESTRICT10:"Restriction&nbsp;10",RESTRICT11:"Restriction&nbsp;11",RESTRICT12:"Restriction&nbsp;12",RESTRICT13:"Restriction&nbsp;13",RESTRICT14:"Restriction&nbsp;14",RESTRICT15:"Restriction&nbsp;15",MORE:"More details"};var c=[1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));b+="<div class='property_disclaimer'>Part street data is displayed approximately so please refer to full details for accurate start and end coordinates.</div>";return b},getHtmlUrls:function(){var b=(Elgin.Utils.getByTagName(this.xml,"e:TYPE1_USRN")[0]?Elgin.Properties.getXMLVal(this.xml,"TYPE1_USRN"):Elgin.Properties.getXMLVal(this.xml,"TYPE2_USRN"));var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+b;return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.ASD_displayType2=Class.create(Elgin.Properties.Base,{initialize:function($super,a,b){$super(a,b);this.lyrType=b;this.htmlUrls=this.getHtmlUrls();this.htmlTitle=this.getHtmlTitle();this.tabTitle=this.getTabTitle()},getTabTitle:function(){switch(this.lyrType){case"asd_pedestrian_crossing":return"Pedestrian Crossing/Lights";case"asd_structures_notsed":return"Structure"}},getHtmlTitle:function(){switch(this.lyrType){case"asd_pedestrian_crossing":var a='<p class="property_title">Pedestrian Crossing or Traffic Light </p>';break;case"asd_structures_notsed":var a='<p class="property_title">Structures (not SED)</p>';break}return a},getHtmlFields:function(){var c=["USRN","STREET","RESTRICT","RESTRICT1"];var a={USRN:"USRN",STREET:"Street",RESTRICT:"Location",RESTRICT1:"Description"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));b+="<div class='property_disclaimer'>Part street data is displayed approximately so please refer to full details for accurate start and end coordinates.</div>";return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.ASD_SpecialEngDiff=Class.create(Elgin.Properties.Base,{initialize:function($super,a,b){$super(a,b);this.lyrType=b;this.htmlUrls=this.getHtmlUrls();this.htmlTitle=this.getHtmlTitle();this.tabTitle=this.getTabTitle()},getTabTitle:function(){return"Special engineering difficulty"},getHtmlTitle:function(){var a='<p class="property_title">Special engineering difficulty </p>';return a},getHtmlFields:function(){var c=["USRN","STREET","DESCRIPTIO","EASTING","NORTHING"];var a={USRN:"USRN",STREET:"Location",DESCRIPTIO:"Description",EASTING:"Easting",NORTHING:"Northing"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));b+="<div class='property_disclaimer'>Part street data is displayed approximately so please refer to full details for accurate start and end coordinates.</div>";return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.ASD_SpeedLimits=Class.create(Elgin.Properties.Base,{initialize:function($super,a,b){$super(a,b);this.lyrType=b;this.htmlUrls=this.getHtmlUrls();this.htmlTitle=this.getHtmlTitle();this.tabTitle=this.getTabTitle()},getTabTitle:function(){return"Speed limit"},getHtmlTitle:function(){var a='<p class="property_title">Speed limit</p>';return a},getHtmlFields:function(){var c=["USRN","STREET","DESCRIPTIO","SPEED_LIMIT","PERIOD","WHOLE_STREET"];var a={USRN:"USRN",STREET:"Street",DESCRIPTIO:"Description",SPEED_LIMIT:"Speed limit",PERIOD:"Restriction period",WHOLE_STREET:"Whole street"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));b+="<div class='property_disclaimer'>Part street data is displayed approximately so please refer to full details for accurate start and end coordinates.</div>";return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.Kent_earlyNotificationActivities=Class.create(Elgin.Properties.Base,{initialize:function($super,a,b){$super(a,b);this.lyrType=b;this.htmlUrls=this.getHtmlUrls();this.htmlTitle=this.getHtmlTitle();this.tabTitle=this.getTabTitle()},getTabTitle:function(){return"Notification of activity"},getHtmlTitle:function(){var a='<p class="property_title">Early notification of immediate activity</p>';return a},getHtmlFields:function(){var e=["USRN","ROAD_NAME","TOWN","DISTRICT","WHOLE_ROAD","SECTION","COORDS"];var a={USRN:"USRN",ROAD_NAME:"Road",TOWN:"Town",DISTRICT:"District",WHOLE_ROAD:"Whole road?",SECTION:"Section",COORDS:"Section coords"};var c=[1,1,1,1,1,1,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a);
b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.LorryRoutes=Class.create(Elgin.Properties.Base,{});Elgin.Properties.SaltingRoutes=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle()},getTabTitle:function(){return"Salting route"},getHtmlTitle:function(){var a='<p class="property_title">Salting route</p>';return a},getHtmlFields:function(){var e=["ROUTE_ID","ROUTE_NAME","USRN","ROADNUMBER","ROADNAME","PRIORITY","SALT_TYPE","DESCRIPT"];var a={ROUTE_ID:"Route ID",ROUTE_NAME:"Route name",USRN:"USRN",ROADNUMBER:"Road no.",ROADNAME:"Road name",PRIORITY:"Salting priority",SALT_TYPE:"Salt type",DESCRIPT:"Notes"};var c=[1,1,0,0,0,1,0,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b}});Elgin.Properties.StreetLights=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"Street light"},getHtmlTitle:function(){var a='<p class="property_title">Street light</p>';return a},getHtmlFields:function(){var e=["UNITNO","UNITDESC","LOCATION","STREET","TOWN","COLMAT","COLFINISH","COLHEIGHT","BRACKET"];var a={UNITNO:"ID.",UNITDESC:"Type",LOCATION:"Location",STREET:"Street",TOWN:"Town",COLMAT:"Column material",COLFINISH:"Column finsih",COLHEIGHT:"Height",BRACKET:"Bracket type"};var c=[1,1,1,1,1,0,0,0,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b},getHtmlUrls:function(){return Elgin.Properties.getFeatureURLs(null,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.TROs=Class.create(Elgin.Properties.Base,{initialize:function($super,a,b){$super(a,b);this.lyrType=b;this.htmlUrls=this.getHtmlUrls();this.htmlTitle=this.getHtmlTitle();this.tabTitle=this.getTabTitle()},getTabTitleImage:function(){return'<div class="tabColouredKey" style="background-color:'+Elgin.Properties.getXMLVal(this.xml,"FILL_COLOUR")+";border:1px solid "+Elgin.Properties.getXMLVal(this.xml,"STROKE_COLOUR")+'"></div>'},getTabTitle:function(){switch(this.lyrType){case"tro":return"Restriction";case"tro_historic":return"Previous restriction"}},getHtmlTitle:function(){var a="<div class='property_title_div'>";switch(this.lyrType){case"tro":a+='<div class="property_title_left">Restriction</div>';break;case"tro_historic":a+='<div class="property_title_left">Previous restriction</div>';break}var b=Elgin.Properties.getTRODetailsURL(Elgin.Properties.getXMLVal(this.xml,"ORDER_ID"),Elgin.Properties.getXMLVal(this.xml,"SWA_ORG_REF"));a+='<div class="property_title_right">'+Elgin.Properties.getFeatureURLs_noTxt(b,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"),1000)+"</div>";a+="</div>";return a},getHtmlFields:function(){var k=["_BLANK_CELL","TRO_DESCRIPTION","ORDER_REF","TRO_LOCATION","SIDE_OF_ROAD","LOCATION","DATE_FROM","DATE_TO"];var b={_BLANK_CELL:"<i>Key colour</i>",TRO_DESCRIPTION:"Restriction",ORDER_REF:"Ref",TRO_LOCATION:"Street",SIDE_OF_ROAD:"Side of road",LOCATION:"Location",DATE_FROM:"Applicable from",DATE_TO:"Applicable to"};var h=[1,1,1,1,0,0,1,0];var g=[0,0,0,0,0,0,0,0];var e=["background-color:"+Elgin.Properties.getXMLVal(this.xml,"FILL_COLOUR")+";border:solid 1px "+Elgin.Properties.getXMLVal(this.xml,"STROKE_COLOUR")+";opacity:0.5;filter:alpha(opacity=50)",null,null,null,null,null,null,null];url="/index.cfm?fuseaction=map.TROStreetDetails&";url+="usrnSrch_easting="+Elgin.Properties.evtMouseE+"&";url+="usrnSrch_northing="+Elgin.Properties.evtMouseN+"&";url+="insertHTMLHead=false&";url+="order_id="+Elgin.Properties.getXMLVal(this.xml,"ORDER_ID")+"&";new Ajax.Request(url,{method:"post",onSuccess:function(m){var l=m.responseText.strip().split(";");if($("propGrid_TRO_LOCATION_TRO_ID_"+l[0])){$("propGrid_TRO_LOCATION_TRO_ID_"+l[0]).innerHTML=l[1]}},onFailure:function(l){console.log(l)}});var f="TRO_ID_"+Elgin.Properties.getXMLVal(this.xml,"ORDER_ID");var c=Elgin.Properties.getPropertiesGrid(this.xml,k,b,h,f,g,e);var a="This map is not a legal document. View the Restriction's details, which includes the copy of the legal document.";c+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"),a);return c},getHtmlUrls:function(){var a=Elgin.Properties.getTRODetailsURL(Elgin.Properties.getXMLVal(this.xml,"ORDER_ID"),Elgin.Properties.getXMLVal(this.xml,"SWA_ORG_REF"));return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"),1000)}});Elgin.Properties.Structures=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return""},getTabTitleImage:function(){return'<img src="/images/icons/bridge.gif" alt="Structures">'},getHtmlTitle:function(){var a='<p class="property_title">Structures/Bridges</p>';return a},getHtmlFields:function(){var e=["STRUCTREF","NAME","LOCATION","CATEGORY","TYPE","OWNER","OWNERTEL","MAINTBY","MAINTTEL","LENGTH","ROADREL","ROUTEO","ROUTEU","HTRESTRIC","WDRESTRIC1","WDRESTRIC2","LDRESTRIC","DECKMAT","SUPPORTMAT","PARAPETMAT","HERITAGECL","YEARBUILT","DESCRIPT"];var a={STRUCTREF:"Structure Reference",NAME:"Name",LOCATION:"Location",CATEGORY:"Category",TYPE:"Type",OWNER:"Owner",OWNERTEL:"Owner�s telephone",MAINTBY:"Maintained by",MAINTTEL:"Maintainance telephone",LENGTH:"Length (m)",ROADREL:"Road relationship",ROUTEO:"Route Over",ROUTEU:"Route Under",HTRESTRIC:"Height restriction",WDRESTRIC1:"Width Restriction 1: Min width of road over",WDRESTRIC2:"Width Restriction 2: Min width of road under",LDRESTRIC:"Max weight of road over",DECKMAT:"Deck Material",SUPPORTMAT:"Support Material",PARAPETMAT:"Parapet Material",HERITAGECL:"Heritage Class",YEARBUILT:"Year built",DESCRIPT:"Description/Notes"};var c=[1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b},getHtmlUrls:function(){return Elgin.Properties.getFeatureURLs(null,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.Restriction=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle()},getTabTitle:function(){return(Elgin.Properties.getXMLVal(this.xml,"NOTIFICATIONTYPE").indexOf("Force")>-1?"Restriction in Force":"Proposed Restriction")},getHtmlTitle:function(){var a='<p class="property_title">Restriction</p>';return a},getHtmlFields:function(){var e=["NOTIFICATIONTYPE","PROPOSEDSTARTDATE","RESTRICTIONENDDATE","COMMENTS","PROJREF","PROJDESC","WORKSREF","WORKSDESC","USRN","LOCDESC","PROMOTERNAME","PROMOTERADDRESS","CONTRACTORNAME","CONTRACTORADDRESS","CREATEDATE"];var a={NOTIFICATIONTYPE:"Restriction type",PROPOSEDSTARTDATE:(Elgin.Properties.getXMLVal(this.xml,"NOTIFICATIONTYPE").indexOf("Force")>-1?"Actual start date":"Proposed start date"),RESTRICTIONENDDATE:"End date",COMMENTS:"Comments",PROJREF:"Project ref",PROJDESC:"Project description",WORKSREF:"Works ref",WORKSDESC:"Works description",USRN:"USRN",LOCDESC:"Location",PROMOTERNAME:"Promoter",PROMOTERADDRESS:"Promoter address",CONTRACTORNAME:"Contractor",CONTRACTORADDRESS:"Contractor address",CREATEDATE:"Create date"};
var c=[1,1,1,0,0,0,1,1,1,1,0,0,0,0,1];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b}});Elgin.Properties.NSG=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"NSG"},getHtmlTitle:function(){return'<p class="property_title">NSG</p>'},getHtmlFields:function(){var e=["USRN","ROAD_NUMBER","STREET","LOCALITY","TOWN","COUNTY"];var a={USRN:"USRN",ROAD_NUMBER:"Road number",STREET:"Street name",LOCALITY:"Locality",TOWN:"Town",COUNTY:"County"};var c=[1,0,1,0,1,1];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),null);return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.NSGSpecialDesignation=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"NSG - Special Designations"},getHtmlTitle:function(){return'<p class="property_title">NSG - Special Designations</p>'},getHtmlFields:function(){var g=["USRN","STREET","TOWN","SPECIAL_DESIGNATION","SPECIAL_DESIG_DESC","SPECIAL_DESIG_LOC","WHOLE_ROAD","MULTI_SPECIAL_DESIGNATION"];var a={USRN:"USRN",STREET:"Street name",TOWN:"Town",SPECIAL_DESIGNATION:"Special designation",SPECIAL_DESIG_DESC:"Description",SPECIAL_DESIG_LOC:"Location",WHOLE_ROAD:"Applies to whole USRN?",MULTI_SPECIAL_DESIGNATION:"Multiple designations?"};var f=[1,1,1,1,1,1,1,0];var c=(Elgin.Properties.getXMLVal(this.xml,"MULTI_SPECIAL_DESIGNATION").length>0?1:0);var e=[0,0,0,c,c,c,0,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,g,a,f,null,e);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),null);return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,null,null)}});Elgin.Properties.NSGRoadStatus=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"NSG - Road Status"},getHtmlTitle:function(){return'<p class="property_title">NSG - Road Status</p>'},getHtmlFields:function(){var f=["USRN","STREET","TOWN","ROAD_STATUS","MULTI_ROAD_STATUS"];var a={USRN:"USRN",STREET:"Street name",TOWN:"Town",ROAD_STATUS:"Road status type",MULTI_ROAD_STATUS:"Multiple states?"};var e=[1,1,1,1,0];var g=(Elgin.Properties.getXMLVal(this.xml,"MULTI_ROAD_STATUS").length>0?1:0);var c=[0,0,0,g,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,f,a,e,null,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),null);return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,null,null)}});Elgin.Properties.NSGReinstatementDesignation=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"NSG - Reinstatement Designation"},getHtmlTitle:function(){return'<p class="property_title">NSG - Reinstatement Designation</p>'},getHtmlFields:function(){var g=["USRN","STREET","TOWN","REINSTATEMENT_TYPE","MULTI_DESIGNATIONS"];var a={USRN:"USRN",STREET:"Street name",TOWN:"Town",REINSTATEMENT_TYPE:"Reinstatement type",MULTI_DESIGNATIONS:"Multiple designations?"};var f=[1,1,1,1,0];var c=(Elgin.Properties.getXMLVal(this.xml,"MULTI_DESIGNATIONS").length>0?1:0);var e=[0,0,0,c,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,g,a,f);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),null);return b},getHtmlUrls:function(){var a="/index.cfm?fuseaction=tma.usrnDetail&usrnSrch_USRN="+Elgin.Properties.getXMLVal(this.xml,"USRN");return Elgin.Properties.getFeatureURLs(a,null,null)}});Elgin.Properties.OlympicRouteNetwork=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle()},getTabTitleImage:function(){return'<div class="tabColouredKey" style="background-color:'+Elgin.Properties.getXMLVal(this.xml,"STROKE_COLOR")+';border:1px solid #444444"></div>'},getTabTitle:function(){return"Olympic Route"},getHtmlTitle:function(){switch(Elgin.Properties.getXMLVal(this.xml,"OR_TYPE")){case"Core":or_type="Olympic Route Network Core";break;case"Venue":or_type="Olympic Route Network Venues";break;case"Alternative":or_type="Olympic Route Network Alternative";break;case"Training":or_type="Olympic Route Network Preferred Training Venues";break}var a='<p class="property_title">'+or_type+"</p>";return a},getHtmlFields:function(){var e=["USRN","ROADNUM","DESCRIPTIO","LOCALITY","TOWN","SPECIAL_DESIG"];var a={USRN:"USRN",ROADNUM:"Road no.",DESCRIPTIO:"Description",TOWN:"Town",LOCALITY:"Locality",SPECIAL_DESIG:"Restrictions"};var c=[1,0,0,0,0];v;var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);return b}});Elgin.Properties.OlympicTorchRoute=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle()},getTabTitleImage:function(){return'<div class="tabColouredKey" style="background-color:#f15703;border:1px solid #444444"></div>'},getTabTitle:function(){return"Olympic Torch Route"},getHtmlTitle:function(){var a='<p class="property_title">Olympic Torch Route</p>';return a},getHtmlFields:function(){var e=["RELAY_DAY_","TR_DATE","TOWNS_IN_T","VISIT_TYPE"];var a={RELAY_DAY_:"Relay day",TR_DATE:"Date",TOWNS_IN_T:"Town",VISIT_TYPE:"Visit type"};var c=[1,1,1,1];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);return b}});Elgin.Properties.CommunityAreas=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitle:function(){return"Community Area"},getHtmlTitle:function(){return'<p class="property_title">Community Area</p>'},getHtmlFields:function(){var e=["NAME","MEMBERS","URL"];var a={NAME:"Area",MEMBERS:"Members",URL:"Link"};var c=[1,0,0];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b},getHtmlUrls:function(){return Elgin.Properties.getFeatureURLs(null,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"))}});Elgin.Properties.JEMAGeologyDrift=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle()},getTabTitleImage:function(){return'<div class="tabColouredKey" style="background-color:'+Elgin.Properties.getXMLVal(this.xml,"FILL")+'"></div>'},getTabTitle:function(){return"Drift geology"},getHtmlTitle:function(){return'<p class="property_title">Drift geology</p>'},getHtmlFields:function(){var e=["_BLANK_CELL","DRIFT_TYPE"];var a={_BLANK_CELL:"<i>Key colour</i>",DRIFT_TYPE:"Drift type"};var c=["background-color:"+Elgin.Properties.getXMLVal(this.xml,"FILL")+";opacity:0.5;filter:alpha(opacity=50)",null];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,null,null,null,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b}});Elgin.Properties.JEMAGeologySolid=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);
this.htmlTitle=this.getHtmlTitle()},getTabTitleImage:function(){return'<div class="tabColouredKey" style="background-color:'+Elgin.Properties.getXMLVal(this.xml,"FILL")+'"></div>'},getTabTitle:function(){return"Solid geology"},getHtmlTitle:function(){return'<p class="property_title">Solid geology</p>'},getHtmlFields:function(){var e=["_BLANK_CELL","SOLID_TYPE"];var a={_BLANK_CELL:"<i>Key colour</i>",SOLID_TYPE:"Solid type"};var c=["background-color:"+Elgin.Properties.getXMLVal(this.xml,"FILL")+";opacity:0.5;filter:alpha(opacity=50)",null];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,null,null,null,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b}});Elgin.Properties.JEMAGeologyBoreholes=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle()},getTabTitleImage:function(){return'<img src="/images/icons/geologyborehole.gif" style="padding:2px>'},getTabTitle:function(){return"Borehole"},getHtmlTitle:function(){return'<p class="property_title">Boreholes</p>'},getHtmlFields:function(){var c=["REGNO","NAME"];var a={REGNO:"Registration No.",NAME:"Name"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b}});Elgin.Properties.JEMASourceProtection=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle()},getTabTitleImage:function(){return'<div class="tabColouredKey" style="background-color:'+Elgin.Properties.getXMLVal(this.xml,"FILL")+'"></div>'},getTabTitle:function(){return"Source protection zone"},getHtmlTitle:function(){return'<p class="property_title">Source protection zones</p>'},getHtmlFields:function(){var f=["_BLANK_CELL","SP_TYPE","NAME","CODE"];var a={_BLANK_CELL:"<i>Key colour</i>",SP_TYPE:"Zone",NAME:"Name",CODE:"Code"};var e=[1,1,0,0];var c=["background-color:"+Elgin.Properties.getXMLVal(this.xml,"FILL")+";opacity:0.5;filter:alpha(opacity=50)",null,null,null];var b=Elgin.Properties.getPropertiesGrid(this.xml,f,a,e,null,null,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b}});Elgin.Properties.JEMASites=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitleImage:function(){return'<img src="/images/icons/jema_'+(Elgin.Properties.getXMLVal(this.xml,"ISLANDFILL")==1?"landfill":"recycling")+'_star.gif">'},getTabTitle:function(){return(Elgin.Properties.getXMLVal(this.xml,"ISLANDFILL")==1?"Landfill Site":"Civic Amenity Site")},getHtmlTitle:function(){return'<p class="property_title">'+(Elgin.Properties.getXMLVal(this.xml,"ISLANDFILL")==1?"Landfill Site":"Civic Amenity Site")+"</p>"},getHtmlFields:function(){var c=["SITEID","SITENAME"];var a={SITEID:"Site ID",SITENAME:"Name"};var b=Elgin.Properties.getPropertiesGrid(this.xml,c,a);return b},getHtmlUrls:function(){var a=" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src='/images/icons/pdf.gif' style='noDecoration' align='absmiddle'> <a class='property_url' href='index.cfm?fuseaction=jema.jemaPDFReports&getPDFReportList=1&selLandfill="+Elgin.Properties.getXMLVal(this.xml,"SITEID")+"' title='View site reports' target='_top'><b>View site reports</b></a>";a+=" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src='/images/icons/gif.gif' style='noDecoration' align='absmiddle'> <a class='property_url' href='index.cfm?fuseaction=jema.jemaLandfillImages&selLandfill="+Elgin.Properties.getXMLVal(this.xml,"SITEID")+"' title='View site images' target='_top'><b>View site images</b></a>";return Elgin.Properties.getFeatureURLs(null,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"),null,a)}});Elgin.Properties.JEMASampleSites=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a);this.htmlTitle=this.getHtmlTitle();this.htmlUrls=this.getHtmlUrls()},getTabTitleImage:function(){return'<img src="/images/icons/jema_borehole_'+Elgin.Properties.getXMLVal(this.xml,"SYMBOLID")+'.gif" alt="'+Elgin.Properties.getXMLVal(this.xml,"SAMPLESITETYPE")+'">'},getTabTitle:function(){return"Sample site"},getHtmlTitle:function(){return'<p class="property_title">Sample site</p>'},getHtmlFields:function(){var e=["SAMPLESITETYPE","SITESTATUS","MAP_REF","SITEID","SITENAME"];var a={SAMPLESITETYPE:"Sample site type",SITESTATUS:"Status",MAP_REF:"Sample site ref",SITEID:"Site ID",SITENAME:"Site Name"};var c=["font-weight:bold","color:"+(Elgin.Properties.getXMLVal(this.xml,"SITESTATUS")=="Online"?"DarkGreen":"DarkRed")+";font-weight:bold",null,null,null];var b=Elgin.Properties.getPropertiesGrid(this.xml,e,a,null,null,null,c);b+=Elgin.Properties.getDisclaimerDivs(Elgin.Properties.getXMLVal(this.xml,"ORGANISATION_NAME"),Elgin.Properties.getXMLVal(this.xml,"LAST_UPDATE"));return b},getHtmlUrls:function(){var a=" <img src='/jema/images/bh_schematics/bs_icon.gif' style='' align='absmiddle'> <a class='property_url' href='javascript:Elgin.Properties.jemaViewSiteSchematic(\""+Elgin.Properties.getXMLVal(this.xml,"MAP_REF")+"\")' ><b>View sample site schematic</b></a>";a+=" &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <img src='/images/icons/graphicon.gif' style='' align='absmiddle'> <a class='property_url' href='index.cfm?fuseaction=jema.jemaGraphForm&fromMap=1&Borehole_MapRef="+Elgin.Properties.getXMLVal(this.xml,"MAP_REF")+"' target='_top'><b>Graph sample data</b></a>";a+="<br><img src='/images/blank.gif' style='height:5px'><br>";return Elgin.Properties.getFeatureURLs(null,Elgin.Properties.getXMLVal(this.xml,"EASTING"),Elgin.Properties.getXMLVal(this.xml,"NORTHING"),2500,a,"before")}});Elgin.Properties.devDisplay=Class.create(Elgin.Properties.Base,{initialize:function($super,a){$super(a)},getTabTitle:function(){return"[dev]"},getHtmlTitle:function(){var a='<p class="property_title">[Dev]</p>';return a},getHtmlFields:function(){var a="No map object found at mouse click<br>This may not be an error...<br><br>This info panel is visible as the map is in dev mode.";return a}});var Elgin=window.Elgin||{};Elgin.Zoom={ZOOM_PANEL_ID:"divZoomPanel",SLIDE_DURATION:0.15,SEARCH_TIMEOUT:5000,controlRepositioned:false,controlShowing:false,initialise:function(){Elgin.Zoom.initialiseControl();Event.observe($("cbxZoomTypes"),"change",Elgin.Zoom.toggleControl);Event.observe($("btnZoomClose"),"click",Elgin.Zoom.initialiseControl);Event.observe($("btnZoomClose"),"mouseover",function(){this.addClassName("x-tool-close-over")});Event.observe($("btnZoomClose"),"mouseout",function(){this.removeClassName("x-tool-close-over")});if($("btnZoomToPostcode")){Event.observe($("btnZoomToPostcode"),"click",Elgin.Zoom.toPostcode);Elgin.Zoom.setEnterKey("txtPostcode",Elgin.Zoom.toPostcode)}if($("btnZoomToUsrn")){Event.observe($("btnZoomToUsrn"),"click",Elgin.Zoom.toUsrn);Elgin.Zoom.setEnterKey("txtUsrn",Elgin.Zoom.toUsrn)}if($("btnFindStreets")){Event.observe($("btnFindStreets"),"click",Elgin.Zoom.findStreets);Event.observe($("btnZoomToStreet"),"click",Elgin.Zoom.toStreet);Event.observe($("lstStreets"),"dblclick",Elgin.Zoom.toStreet);Elgin.Zoom.setEnterKey("txtStreet",Elgin.Zoom.findStreets);Elgin.Zoom.setEnterKey("txtStreetTown",Elgin.Zoom.findStreets);Elgin.Zoom.setEnterKey("lstStreets",Elgin.Zoom.toStreet)}if($("btnFindTowns")){Event.observe($("btnFindTowns"),"click",Elgin.Zoom.findTowns);Event.observe($("btnZoomToTown"),"click",Elgin.Zoom.toTown);Event.observe($("lstTowns"),"dblclick",Elgin.Zoom.toTown);Elgin.Zoom.setEnterKey("txtTownTown",Elgin.Zoom.findTowns);Elgin.Zoom.setEnterKey("lstTowns",Elgin.Zoom.toTown)}if($("btnZoomToLA")){Event.observe($("btnZoomToLA"),"click",Elgin.Zoom.toLA);Elgin.Zoom.setEnterKey("cbxLA",Elgin.Zoom.toLA)}if($("btnZoomToGridReference")){Event.observe($("btnZoomToGridReference"),"click",Elgin.Zoom.toGridReference);
Elgin.Zoom.setEnterKey("txtEasting",Elgin.Zoom.toGridReference);Elgin.Zoom.setEnterKey("txtNorthing",Elgin.Zoom.toGridReference)}if($("btnZoomJEMASite")){Event.observe($("btnZoomJEMASite"),"click",Elgin.Zoom.toJEMASite);Elgin.Zoom.setEnterKey("cbxJEMASite",Elgin.Zoom.toJEMASite)}if($("btnZoomJEMACas")){Event.observe($("btnZoomJEMACas"),"click",Elgin.Zoom.toJEMACas);Elgin.Zoom.setEnterKey("cbxJEMACas",Elgin.Zoom.toJEMACas)}$("txtPostcode","txtUsrn","txtEasting","txtNorthing","txtTownTown","txtStreetTown","txtStreet").each(function(a){if(a){new Elgin.SearchPlay(a.id);new Elgin.Selectable(a.id)}})},setEnterKey:function(a,b){if(!a||a.blank()||!b||(typeof b!="function")){return}Event.observe(a,"keyup",function(c){if(c.keyCode==Event.KEY_RETURN){b()}})},blurThenActivate:function(a){$(a).blur();activate=function(){$(a).activate()};setTimeout(activate,300)},toPostcode:function(){var a=$("txtPostcode").value.strip();if(a.empty()||a.toLowerCase()=="postcode"){alert("Please enter a postcode.");Elgin.Zoom.blurThenActivate("txtPostcode");return}var c={fuseaction:"map.zoomToPUnitJson",insertHTMLHead:false,punit:a};var b={requestType:"postcode"};new Ajax.Request("../index.cfm?",{method:"post",parameters:c,onSuccess:function(g){var e=g.responseText.strip().evalJSON();if(e.easting){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(e.easting,e.northing),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));Elgin.Zoom.initialiseControl()}else{var f='Elgin does not recognise the postcode "'+a+'".\n\nPlease try again.';alert(f);Elgin.Zoom.blurThenActivate("txtPostcode")}},onFailure:Elgin.Zoom.errorHandler.bindAsEventListener(b)})},findStreets:function(){var b=$("txtStreetTown").value.strip();if(b.empty()||b.toLowerCase()=="town name"){b="Town name..."}var a=$("cbxStreetLA").value;var f=$("txtStreet").value.strip();if(f.empty()||f.toLowerCase()=="street name"){alert("Please enter a street to zoom to.");Elgin.Zoom.blurThenActivate("txtStreet");return}var e={fuseaction:"map.zoomToStreetJson",insertHTMLHead:false,zoomToStreet_LAID:a,zoomToStreet_town:b,zoomToStreet_street:f};var c={requestType:"street",textboxID:"txtStreet",buttonID:"btnFindStreets"};$(c.buttonID).ancestors()[0].addClassName("zoomsandtimer");new Ajax.Request("../index.cfm?",{method:"post",parameters:e,onCreate:Elgin.Zoom.monitorAjaxRequest.bindAsEventListener(c),onSuccess:function(o){var h=o.responseText.strip().evalJSON();if(h.streets){if(h.streets.length==1){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(h.streets[0].easting,h.streets[0].northing),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));$("txtStreet").value=h.streets[0].street;$("divZoomStreetList").hide();Elgin.Zoom.initialiseControl()}else{if(h.streets.length<101){$("divZoomStreetList").show();$("lstStreets").options.length=0;for(var g=0;g<h.streets.length;g++){var k=new Option(h.streets[g].street,h.streets[g].easting+","+h.streets[g].northing);try{$("lstStreets").add(k,null)}catch(l){$("lstStreets").add(k)}}$(c.buttonID).ancestors()[0].removeClassName("zoomsandtimer")}else{$(c.buttonID).ancestors()[0].removeClassName("zoomsandtimer");alert("There are too many streets to display. Please refine your search.");Elgin.Zoom.blurThenActivate("txtStreet");return}}}else{$(c.buttonID).ancestors()[0].removeClassName("zoomsandtimer");var m='Elgin does not recognise the street "'+f+'".\n\nPlease try again.';alert(m);Elgin.Zoom.blurThenActivate("txtStreet")}},onFailure:Elgin.Zoom.errorHandler.bindAsEventListener(c)})},toStreet:function(){if($("lstStreets").options.length==0||$("lstStreets").value.blank()){return}var a=$("lstStreets").value.split(",");Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(a[0],a[1]),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));Elgin.Zoom.initialiseControl()},findTowns:function(){var b=$("txtTownTown").value.strip();if(b.empty()||b.toLowerCase()=="town name"){alert("Please enter a town to zoom to.");Elgin.Zoom.blurThenActivate("txtTownTown");return}var a=$("cbxTownLA").value;var e={fuseaction:"map.zoomToTownJson",insertHTMLHead:false,zoomToTown_LAID:a,townSearch:b};var c={requestType:"town",textboxID:"txtTownTown",buttonID:"btnFindTowns"};$(c.buttonID).ancestors()[0].addClassName("zoomsandtimer");new Ajax.Request("../index.cfm?",{method:"post",parameters:e,onCreate:Elgin.Zoom.monitorAjaxRequest.bindAsEventListener(c),onSuccess:function(m){var g=m.responseText.strip().evalJSON();if(g.towns){if(g.towns.length==1){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(g.towns[0].easting,g.towns[0].northing),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));$("txtTownTown").value=g.towns[0].town;$("divZoomTownList").hide();Elgin.Zoom.initialiseControl()}else{if(g.towns.length<101){$("divZoomTownList").show();$("lstTowns").options.length=0;for(var f=0;f<g.towns.length;f++){var h=new Option(g.towns[f].town,g.towns[f].easting+","+g.towns[f].northing);try{$("lstTowns").add(h,null)}catch(k){$("lstTowns").add(h)}}$(c.buttonID).ancestors()[0].removeClassName("zoomsandtimer")}else{$(c.buttonID).ancestors()[0].removeClassName("zoomsandtimer");alert("There are too many towns to display. Please refine your search.");Elgin.Zoom.blurThenActivate("txtTownTown");return}}}else{$(c.buttonID).ancestors()[0].removeClassName("zoomsandtimer");var l='Elgin does not recognise the town "'+b+'".\n\nPlease try again.';alert(l);Elgin.Zoom.blurThenActivate("txtTownTown")}},onFailure:Elgin.Zoom.errorHandler.bindAsEventListener(c)})},toTown:function(){if($("lstTowns").options.length==0||$("lstTowns").value.blank()){return}var a=$("lstTowns").value.split(",");Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(a[0],a[1]),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));Elgin.Zoom.initialiseControl()},toUsrn:function(){var c=$("txtUsrn").value.strip();if(c.empty()||c.toLowerCase()=="usrn"){alert("Please enter a USRN.");Elgin.Zoom.blurThenActivate("txtUsrn");return}var b={fuseaction:"map.zoomToUsrnJson",insertHTMLHead:false,usrn:c};var a={requestType:"usrn"};new Ajax.Request("../index.cfm?",{method:"post",parameters:b,onSuccess:function(g){var e=g.responseText.strip().evalJSON();if(e.easting){Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(e.easting,e.northing),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));Elgin.Zoom.initialiseControl()}else{var f='Unable to zoom to USRN "'+c+'". Elgin does not recognise the USRN you have supplied.\n\nEither you have entered an invalid USRN or the necessary NSG data does not exist in Elgin.\n\nPlease try again.';alert(f);Elgin.Zoom.blurThenActivate("txtUsrn")}},onFailure:Elgin.Zoom.errorHandler.bindAsEventListener(a)})},toLA:function(){var b=$("cbxLA").value;if(b==0){alert("Please choose a local authority.");return}for(var a=0;a<LA_MBRs_wddx.la_id.length;a++){if(LA_MBRs_wddx.la_id[a]==b){if(LA_MBRs_wddx.sw_x[a]==""){alert("Unable to zoom into the selected area.");return}Elgin.OlMap.map.zoomToExtent(new OpenLayers.Bounds(parseInt(LA_MBRs_wddx.sw_x[a]),parseInt(LA_MBRs_wddx.sw_y[a]),parseInt(LA_MBRs_wddx.ne_x[a]),parseInt(LA_MBRs_wddx.ne_y[a])),true);Elgin.Zoom.initialiseControl();break}}},toJEMASite:function(){var a=$("cbxJEMASite").value;for(var b=0;b<JEMA_Sites_wddx.siteid.length;b++){if(JEMA_Sites_wddx.siteid[b]==a){if(JEMA_Sites_wddx.mineasting[b]==""){alert("Unable to zoom into the selected area.");return}Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(JEMA_Sites_wddx.centroideasting[b],JEMA_Sites_wddx.centroidnorthing[b]),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));Elgin.Zoom.initialiseControl();break}}},toJEMACas:function(){var a=$("cbxJEMACas").value;for(var b=0;b<JEMA_CAS_wddx.siteid.length;b++){if(JEMA_CAS_wddx.siteid[b]==a){if(JEMA_CAS_wddx.mineasting[b]==""){alert("Unable to zoom into the selected area.");return}Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(JEMA_CAS_wddx.mineasting[b],JEMA_CAS_wddx.minnorthing[b]),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));Elgin.Zoom.initialiseControl();break}}},toGridReference:function(){var b=$("txtEasting").value.strip();
var a=$("txtNorthing").value.strip();if(b.empty()||b.toLowerCase()=="easting"||!isInteger(b)||a.empty()||a.toLowerCase()=="northing"||!isInteger(a)){alert("Please enter valid coordinates.");Elgin.Zoom.blurThenActivate("txtEasting");return false}Elgin.OlMap.map.setCenter(new OpenLayers.LonLat(b,a),Elgin.OlMap.getZoomLevel(5000,Elgin.MapSettings.mapZoomLevels));Elgin.Zoom.initialiseControl()},toggleControl:function(){if(!Elgin.Zoom.controlRepositioned){Elgin.Zoom.repositionControl();Elgin.Zoom.controlRepositioned=true}if(this.value=="none"){Elgin.Zoom.closePanel()}else{$$(".zoomcontrol").each(function(c){c.style.display="none"});var b="divZoom_"+this.value;$(b).style.display="block";Elgin.Zoom.openPanel();var a=$(b).select("input");if(a.length==0){a=$(b).select("select")}if(a.length>0){Elgin.Zoom.blurThenActivate(a[0].id)}}},initialiseControl:function(){$("cbxZoomTypes").selectedIndex=0;Elgin.Zoom.closePanel();$$(".buttonwrapper").each(function(a){a.removeClassName("zoomsandtimer")})},repositionControl:function(){if($("page-home")){$("page-home").insert($(Elgin.Zoom.ZOOM_PANEL_ID).remove())}var a=Elgin.Utils.findPos($("map"));var b=Elgin.Utils.findPos($("cbxZoomTypes"));$(Elgin.Zoom.ZOOM_PANEL_ID).setStyle({top:(a.top-1)+"px",left:(b.left-88)+"px"})},openPanel:function(){if(!Elgin.Zoom.controlShowing){new Effect.Appear(Elgin.Zoom.ZOOM_PANEL_ID,{duration:Elgin.Zoom.SLIDE_DURATION});Elgin.Zoom.controlShowing=true}},closePanel:function(){if(Elgin.Zoom.controlShowing){new Effect.Fade(Elgin.Zoom.ZOOM_PANEL_ID,{duration:Elgin.Zoom.SLIDE_DURATION});Elgin.Zoom.controlShowing=false}},callInProgress:function(a){switch(a.readyState){case 1:case 2:case 3:return true;break;default:return false;break}},monitorAjaxRequest:function(c){var b=this.textboxID;var a=$(this.buttonID).ancestors()[0];c.timeoutId=window.setTimeout(function(){if(Elgin.Zoom.callInProgress(c.transport)){c.transport.abort();a.removeClassName("zoomsandtimer");alert("The search has taken too long. Please refine your search terms.");Elgin.Zoom.blurThenActivate(b)}},Elgin.Zoom.SEARCH_TIMEOUT)},errorHandler:function(a){if(logger){logger.error("Problem when zooming.",{zoomType:this.requestType,body:a.request.body,url:a.request.url})}alert("There was a problem and Elgin couldn't continue the zoom. The issue has been logged.\n\nPlease try again.")}};var Elgin=window.Elgin||{};Elgin.Redline={emailAlerts_publicAlert_maxArea:100000000000,emailAlerts_operationalAlert_maxArea:100000000000,showEmailAlertButton:function(){htm='<div style="padding:10px;background-color:white;text-align:center">      <input type="image"       src="/images/mapicons/emailAlertArea.gif"       class="btnUp"       style="width:28px;height:24px;padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px"       ID="btnDrawPolygon"       title="Draw email alert area"       alt="Draw email alert area"       onfocus="this.blur()"      ><br><img src="/images/blank.gif" style="width:1px;height:4px"><br>      <b>Click this button to draw email alert area</b><br><img src="/images/blank.gif" style="width:1px;height:4px"><br>     Double-click on the map to finish drawing the area <br><br><br><br> </div> ';var e=new Ext.Window({title:"Draw email alert",width:160,height:140,renderTo:"mapShield",x:50,y:50,constrain:true,id:"redlineButtonWin",autoScroll:false,html:htm,closable:false});var a="toolDrawPolygon";var b=a.replace(/tool/,"btn");if($(b)){var c={toolName:a};Event.observe(b,"click",Elgin.OlMap._toolHandler.bindAsEventListener(c));Event.observe(b,"click",Elgin.OlMap._toolButtonChanger.bindAsEventListener(c))}e.show()},drawComplete:function(a){Elgin.Redline._hideDrawingTip();if(Elgin.Redline.tooManyVertices(a)){return}Elgin.Redline.saveRedlineObject(a.geometry,(a.geometry.toString().indexOf("LINESTRING")>-1?"line":"poly"))},saveRedlineObject:function(e,a){if(isEmailAlert){if(e.getArea()>Elgin.Redline.emailAlerts_publicAlert_maxArea){alert("The drawn area is too large. Please restrict it to less than "+Elgin.Redline.emailAlerts_publicAlert_maxArea/1000/1000+"km\262.");var c=Elgin.Utils.createCustomEventElement("helperClearPolygon");c.fire("polygon:clear")}else{var c=Elgin.Utils.createCustomEventElement("helperPolygonDrawn");c.fire("polygon:drawn",{coords:e.toString()})}}else{if(isEToN){if(parent.redlineBroker){var b=parent.redlineBroker(Elgin.Redline.wkt2gmlstr(e.toString(),2),Elgin.Redline.wkt2csv(e.toString(),0),a);if(b==0){Elgin.Redline._showRedlineSavedTip()}else{alert("ERROR: Unable to save the works location.\n\n[Error details] parent.redlineBroker returned an error\n[err code] "+b+"\n[src] /olmap/js/Elgin.Redline.js")}}else{alert("ERROR: Unable to save the works location.\n\n[Error details] parent.redlineBroker does not exist\n[src] /olmap/js/Elgin.Redline.js")}}}},tooManyVertices:function(c){var a=true;if(!c||!c.geometry){console.log("[tooManyVertices] No geometry object was passed in.");return a}var b=0;if(c.geometry.components[0].components){b=c.geometry.components[0].components.length-1}else{if(c.geometry.components){b=c.geometry.components.length}}console.log("[tooManyVertices] Info: the drawn shape has "+b+" vertices; the maximum is "+Elgin.OlMap.MAX_VERTICES+".");if(b<=Elgin.OlMap.MAX_VERTICES){a=false}else{alert("The shape you have drawn has too many vertices. The maximum is "+Elgin.OlMap.MAX_VERTICES+".\n\nPlease redraw your shape with fewer clicks.");a=true}return a},_showDrawingTip:function(){if($("divDrawingTip")){Effect.Appear("divDrawingTip",{duration:0.2})}},_hideDrawingTip:function(){if($("divDrawingTip")){Effect.Fade("divDrawingTip",{duration:0.2})}},_showRedlineSavedTip:function(){if($("divEToNRedlineTip")){Effect.Appear("divEToNRedlineTip",{duration:0.3});setTimeout("Elgin.Redline._hideRedlineSavedTip()",5000)}},_hideRedlineSavedTip:function(){if($("divEToNRedlineTip")){Effect.Fade("divEToNRedlineTip",{duration:0.2})}},wkt2csv:function(c,e){var a=c.replace(/^POLYGON\(/,"");a=a.replace(/^LINESTRING\(/,"");a=a.replace(/^POINT\(/,"");a=a.replace(/^\(/,"");a=a.replace(/\)*$/,"");a=a.replace(/\s+/g,",");if(typeof(e)=="number"){csv_nu=new Array();csv_1=a.split(",");for(var b=0;b<csv_1.length;b++){num=new Number(parseFloat(csv_1[b]));csv_nu[b]=num.toFixed(e)}a=csv_nu.join(",")}return a},wkt2gmlstr:function(b,e){var c=Elgin.Redline.wkt2csv(b,e);sep="";gmlstr_nu="";gmlstr_1=c.split(",");for(var a=0;a<gmlstr_1.length;a++){gmlstr_nu+=sep+gmlstr_1[a];sep=(a%2==0?",":" ")}return gmlstr_nu}};Event.observe(window,"load",function(){if(Elgin&&Elgin.WebLogger&&Elgin.MapSettings){logger=new Elgin.WebLogger(Elgin.MapSettings.path_proxyElginWebLogger,Elgin.MapSettings.url_ElginWebLogger)}if(Elgin&&Elgin.OlMap&&Elgin.OlMap.initialise&&properties){Elgin.OlMap.initialise(properties)}if(Elgin&&Elgin.Zoom&&Elgin.Zoom.initialise){Elgin.Zoom.initialise()}});Event.observe(window,"load",Elgin.OlMap.setMapSizeV5);Event.observe(window,"resize",Elgin.OlMap.resetMapSizeV5);
