var OpenLayers={VERSION_NUMBER:"Release 2.13.1",singleFile:!0,_getScriptLocation:function(){for(var u=/(^|(.*?\/))(OpenLayers[^\/]*?\.js)(\?|$)/,i=document.getElementsByTagName("script"),n,r="",t=0,f=i.length;t<f;t++)if((n=i[t].getAttribute("src"))&&(n=n.match(u))){r=n[1];break}return function(){return r}}(),ImgPath:""};OpenLayers.Class=function(){var n=arguments.length,r=arguments[0],t=arguments[n-1],i="function"==typeof t.initialize?t.initialize:function(){r.prototype.initialize.apply(this,arguments)};return 1<n?(n=[i,r].concat(Array.prototype.slice.call(arguments).slice(1,n-1),t),OpenLayers.inherit.apply(null,n)):i.prototype=t,i},OpenLayers.inherit=function(n,t){var i=function(){},u,r;for(i.prototype=t.prototype,n.prototype=new i,i=2,u=arguments.length;i<u;i++)r=arguments[i],"function"==typeof r&&(r=r.prototype),OpenLayers.Util.extend(n.prototype,r)},OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.extend=function(n,t){var i,r;if(n=n||{},t){for(i in t)r=t[i],void 0!==r&&(n[i]=r);"function"==typeof window.Event&&t instanceof window.Event||!t.hasOwnProperty||!t.hasOwnProperty("toString")||(n.toString=t.toString)}return n},OpenLayers.String={startsWith:function(n,t){return 0==n.indexOf(t)},contains:function(n,t){return-1!=n.indexOf(t)},trim:function(n){return n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(n){var i,r;n=n.split("-");for(var r=n[0],t=1,u=n.length;t<u;t++)i=n[t],r=r+(i.charAt(0).toUpperCase()+i.substring(1));return r},format:function(n,t,i){return t||(t=window),n.replace(OpenLayers.String.tokenRegEx,function(n,r){for(var u,e=r.split(/\.+/),f=0;f<e.length;f++){if(0==f&&(u=t),void 0===u)break;u=u[e[f]]}return"function"==typeof u&&(u=i?u.apply(null,i):u()),"undefined"==typeof u?"undefined":u})},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(n){return OpenLayers.String.numberRegEx.test(n)},numericIf:function(n,t){var i=n;return!0===t&&null!=n&&n.replace&&(n=n.replace(/^\s*|\s*$/g,"")),OpenLayers.String.isNumeric(n)?parseFloat(n):i}},OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(n,t){var i=0;return 0<t&&(i=parseFloat(n.toPrecision(t))),i},format:function(n,t,i,r){var u,f;if(t="undefined"!=typeof t?t:0,i="undefined"!=typeof i?i:OpenLayers.Number.thousandsSeparator,r="undefined"!=typeof r?r:OpenLayers.Number.decimalSeparator,null!=t&&(n=parseFloat(n.toFixed(t))),u=n.toString().split("."),1==u.length&&null==t&&(t=0),n=u[0],i)for(f=/(-?[0-9]+)([0-9]{3})/;f.test(n);)n=n.replace(f,"$1"+i+"$2");return 0==t?t=n:(i=1<u.length?u[1]:"0",null!=t&&(i+=Array(t-i.length+1).join("0")),t=n+r+i),t},zeroPad:function(n,t,i){for(n=n.toString(i||10);n.length<t;)n="0"+n;return n}},OpenLayers.Function={bind:function(n,t){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var r=i.concat(Array.prototype.slice.apply(arguments,[0]));return n.apply(t,r)}},bindAsEventListener:function(n,t){return function(i){return n.call(t,i||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},OpenLayers.Array={filter:function(n,t,i){var u=[],e,r,f;if(Array.prototype.filter)u=n.filter(t,i);else{if(e=n.length,"function"!=typeof t)throw new TypeError;for(r=0;r<e;r++)r in n&&(f=n[r],t.call(i,f,r,n)&&u.push(f))}return u}},OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(n,t,i,r){OpenLayers.Util.isArray(n)&&(r=n[3],i=n[2],t=n[1],n=n[0]),null!=n&&(this.left=OpenLayers.Util.toFloat(n)),null!=t&&(this.bottom=OpenLayers.Util.toFloat(t)),null!=i&&(this.right=OpenLayers.Util.toFloat(i)),null!=r&&(this.top=OpenLayers.Util.toFloat(r))},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(n){var t=!1;return null!=n&&(t=this.left==n.left&&this.right==n.right&&this.top==n.top&&this.bottom==n.bottom),t},toString:function(){return[this.left,this.bottom,this.right,this.top].join()},toArray:function(n){return!0===n?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]},toBBOX:function(n,t){null==n&&(n=6);var i=Math.pow(10,n),r=Math.round(this.left*i)/i,u=Math.round(this.bottom*i)/i,f=Math.round(this.right*i)/i,i=Math.round(this.top*i)/i;return!0===t?u+","+r+","+i+","+f:r+","+u+","+f+","+i},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(){return this.centerLonLat||(this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat},scale:function(n,t){null==t&&(t=this.getCenterLonLat());var i,r;return"OpenLayers.LonLat"==t.CLASS_NAME?(i=t.lon,r=t.lat):(i=t.x,r=t.y),new OpenLayers.Bounds((this.left-i)*n+i,(this.bottom-r)*n+r,(this.right-i)*n+i,(this.top-r)*n+r)},add:function(n,t){if(null==n||null==t)throw new TypeError("Bounds.add cannot receive null values");return new OpenLayers.Bounds(this.left+n,this.bottom+t,this.right+n,this.top+t)},extend:function(n){if(n)switch(n.CLASS_NAME){case"OpenLayers.LonLat":this.extendXY(n.lon,n.lat);break;case"OpenLayers.Geometry.Point":this.extendXY(n.x,n.y);break;case"OpenLayers.Bounds":this.centerLonLat=null,(null==this.left||n.left<this.left)&&(this.left=n.left),(null==this.bottom||n.bottom<this.bottom)&&(this.bottom=n.bottom),(null==this.right||n.right>this.right)&&(this.right=n.right),(null==this.top||n.top>this.top)&&(this.top=n.top)}},extendXY:function(n,t){this.centerLonLat=null,(null==this.left||n<this.left)&&(this.left=n),(null==this.bottom||t<this.bottom)&&(this.bottom=t),(null==this.right||n>this.right)&&(this.right=n),(null==this.top||t>this.top)&&(this.top=t)},containsLonLat:function(n,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var i=this.contains(n.lon,n.lat,t.inclusive),r=t.worldBounds;return r&&!i&&(i=r.getWidth(),r=Math.round((n.lon-(r.left+r.right)/2)/i),i=this.containsLonLat({lon:n.lon-r*i,lat:n.lat},{inclusive:t.inclusive})),i},containsPixel:function(n,t){return this.contains(n.x,n.y,t)},contains:function(n,t,i){if(null==i&&(i=!0),null==n||null==t)return!1;n=OpenLayers.Util.toFloat(n),t=OpenLayers.Util.toFloat(t);var r=!1;return r=i?n>=this.left&&n<=this.right&&t>=this.bottom&&t<=this.top:n>this.left&&n<this.right&&t>this.bottom&&t<this.top},intersectsBounds:function(n,t){var i,r,u;if("boolean"==typeof t&&(t={inclusive:t}),t=t||{},t.worldBounds?(i=this.wrapDateLine(t.worldBounds),n=n.wrapDateLine(t.worldBounds)):i=this,null==t.inclusive&&(t.inclusive=!0),r=!1,u=i.left==n.right||i.right==n.left||i.top==n.bottom||i.bottom==n.top,t.inclusive||!u)var r=n.top>=i.bottom&&n.top<=i.top||i.top>n.bottom&&i.top<n.top,u=n.left>=i.left&&n.left<=i.right||i.left>=n.left&&i.left<=n.right,e=n.right>=i.left&&n.right<=i.right||i.right>=n.left&&i.right<=n.right,r=(n.bottom>=i.bottom&&n.bottom<=i.top||i.bottom>=n.bottom&&i.bottom<=n.top||r)&&(u||e);if(t.worldBounds&&!r){var f=t.worldBounds,u=f.getWidth(),e=!f.containsBounds(i),f=!f.containsBounds(n);e&&!f?(n=n.add(-u,0),r=i.intersectsBounds(n,{inclusive:t.inclusive})):f&&!e&&(i=i.add(-u,0),r=n.intersectsBounds(i,{inclusive:t.inclusive}))}return r},containsBounds:function(n,t,i){null==t&&(t=!1),null==i&&(i=!0);var r=this.contains(n.left,n.bottom,i),u=this.contains(n.right,n.bottom,i),f=this.contains(n.left,n.top,i);return n=this.contains(n.right,n.top,i),t?r||u||f||n:r&&u&&f&&n},determineQuadrant:function(n){var i="",t=this.getCenterLonLat(),i=i+(n.lat<t.lat?"b":"t");return i+=n.lon<t.lon?"l":"r"},transform:function(n,t){this.centerLonLat=null;var i=OpenLayers.Projection.transform({x:this.left,y:this.bottom},n,t),r=OpenLayers.Projection.transform({x:this.right,y:this.bottom},n,t),u=OpenLayers.Projection.transform({x:this.left,y:this.top},n,t),f=OpenLayers.Projection.transform({x:this.right,y:this.top},n,t);return this.left=Math.min(i.x,u.x),this.bottom=Math.min(i.y,r.y),this.right=Math.max(r.x,f.x),this.top=Math.max(u.y,f.y),this},wrapDateLine:function(n,t){var u;t=t||{};var r=t.leftTolerance||0,f=t.rightTolerance||0,i=this.clone();if(n){for(u=n.getWidth();i.left<n.left&&i.right-f<=n.left;)i=i.add(u,0);for(;i.left+r>=n.right&&i.right>n.right;)i=i.add(-u,0);r=i.left+r,r<n.right&&r>n.left&&i.right-f>n.right&&(i=i.add(-u,0))}return i},CLASS_NAME:"OpenLayers.Bounds"}),OpenLayers.Bounds.fromString=function(n,t){var i=n.split(",");return OpenLayers.Bounds.fromArray(i,t)},OpenLayers.Bounds.fromArray=function(n,t){return!0===t?new OpenLayers.Bounds(n[1],n[0],n[3],n[2]):new OpenLayers.Bounds(n[0],n[1],n[2],n[3])},OpenLayers.Bounds.fromSize=function(n){return new OpenLayers.Bounds(0,n.h,n.w,0)},OpenLayers.Bounds.oppositeQuadrant=function(n){var t;return t=""+("t"==n.charAt(0)?"b":"t"),t+="l"==n.charAt(1)?"r":"l"},OpenLayers.Element={visible:function(n){return"none"!=OpenLayers.Util.getElement(n).style.display},toggle:function(){for(var t,r,n=0,i=arguments.length;n<i;n++)t=OpenLayers.Util.getElement(arguments[n]),r=OpenLayers.Element.visible(t)?"none":"",t.style.display=r},remove:function(n){n=OpenLayers.Util.getElement(n),n.parentNode.removeChild(n)},getHeight:function(n){return n=OpenLayers.Util.getElement(n),n.offsetHeight},hasClass:function(n,t){var i=n.className;return!!i&&RegExp("(^|\\s)"+t+"(\\s|$)").test(i)},addClass:function(n,t){return OpenLayers.Element.hasClass(n,t)||(n.className+=(n.className?" ":"")+t),n},removeClass:function(n,t){var i=n.className;return i&&(n.className=OpenLayers.String.trim(i.replace(RegExp("(^|\\s+)"+t+"(\\s+|$)")," "))),n},toggleClass:function(n,t){return OpenLayers.Element.hasClass(n,t)?OpenLayers.Element.removeClass(n,t):OpenLayers.Element.addClass(n,t),n},getStyle:function(n,t){var i,r;return n=OpenLayers.Util.getElement(n),i=null,n&&n.style&&(i=n.style[OpenLayers.String.camelize(t)],i||(document.defaultView&&document.defaultView.getComputedStyle?i=(i=document.defaultView.getComputedStyle(n,null))?i.getPropertyValue(t):null:n.currentStyle&&(i=n.currentStyle[OpenLayers.String.camelize(t)])),r=["left","top","right","bottom"],window.opera&&-1!=OpenLayers.Util.indexOf(r,t)&&"static"==OpenLayers.Element.getStyle(n,"position")&&(i="auto")),"auto"==i?null:i}},OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(n,t){OpenLayers.Util.isArray(n)&&(t=n[1],n=n[0]),this.lon=OpenLayers.Util.toFloat(n),this.lat=OpenLayers.Util.toFloat(t)},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(n,t){if(null==n||null==t)throw new TypeError("LonLat.add cannot receive null values");return new OpenLayers.LonLat(this.lon+OpenLayers.Util.toFloat(n),this.lat+OpenLayers.Util.toFloat(t))},equals:function(n){var t=!1;return null!=n&&(t=this.lon==n.lon&&this.lat==n.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(n.lon)&&isNaN(n.lat)),t},transform:function(n,t){var i=OpenLayers.Projection.transform({x:this.lon,y:this.lat},n,t);return this.lon=i.x,this.lat=i.y,this},wrapDateLine:function(n){var t=this.clone();if(n){for(;t.lon<n.left;)t.lon+=n.getWidth();for(;t.lon>n.right;)t.lon-=n.getWidth()}return t},CLASS_NAME:"OpenLayers.LonLat"}),OpenLayers.LonLat.fromString=function(n){return n=n.split(","),new OpenLayers.LonLat(n[0],n[1])},OpenLayers.LonLat.fromArray=function(n){var t=OpenLayers.Util.isArray(n);return new OpenLayers.LonLat(t&&n[0],t&&n[1])},OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(n,t){this.x=parseFloat(n),this.y=parseFloat(t)},toString:function(){return"x="+this.x+",y="+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(n){var t=!1;return null!=n&&(t=this.x==n.x&&this.y==n.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(n.x)&&isNaN(n.y)),t},distanceTo:function(n){return Math.sqrt(Math.pow(this.x-n.x,2)+Math.pow(this.y-n.y,2))},add:function(n,t){if(null==n||null==t)throw new TypeError("Pixel.add cannot receive null values");return new OpenLayers.Pixel(this.x+n,this.y+t)},offset:function(n){var t=this.clone();return n&&(t=this.add(n.x,n.y)),t},CLASS_NAME:"OpenLayers.Pixel"}),OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(n,t){this.w=parseFloat(n),this.h=parseFloat(t)},toString:function(){return"w="+this.w+",h="+this.h},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(n){var t=!1;return null!=n&&(t=this.w==n.w&&this.h==n.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(n.w)&&isNaN(n.h)),t},CLASS_NAME:"OpenLayers.Size"}),OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(n){alert(n)},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(){for(var t=document.getElementsByTagName("script"),n=0,i=t.length;n<i;++n)if(-1!=t[n].src.indexOf("firebug.js")&&console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}(),OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){return OpenLayers.Lang.code||OpenLayers.Lang.setCode(),OpenLayers.Lang.code},setCode:function(n){var t,i;n||(n="msie"==OpenLayers.BROWSER_NAME?navigator.userLanguage:navigator.language),n=n.split("-"),n[0]=n[0].toLowerCase(),"object"==typeof OpenLayers.Lang[n[0]]&&(t=n[0]),n[1]&&(i=n[0]+"-"+n[1].toUpperCase(),"object"==typeof OpenLayers.Lang[i]&&(t=i)),t||(OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+n.join("-")+" dictionary, falling back to default language"),t=OpenLayers.Lang.defaultCode),OpenLayers.Lang.code=t},translate:function(n,t){var i=OpenLayers.Lang[OpenLayers.Lang.getCode()];return(i=i&&i[n])||(i=n),t&&(i=OpenLayers.String.format(i,t)),i}},OpenLayers.i18n=OpenLayers.Lang.translate,OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.getElement=function(){for(var n,i=[],t=0,r=arguments.length;t<r;t++){if(n=arguments[t],"string"==typeof n&&(n=document.getElementById(n)),1==arguments.length)return n;i.push(n)}return i},OpenLayers.Util.isElement=function(n){return!(!n||1!==n.nodeType)},OpenLayers.Util.isArray=function(n){return"[object Array]"===Object.prototype.toString.call(n)},OpenLayers.Util.removeItem=function(n,t){for(var i=n.length-1;0<=i;i--)n[i]==t&&n.splice(i,1);return n},OpenLayers.Util.indexOf=function(n,t){if("function"==typeof n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;i<r;i++)if(n[i]==t)return i;return-1},OpenLayers.Util.dotless=/\./g,OpenLayers.Util.modifyDOMElement=function(n,t,i,r,u,f,e,o){t&&(n.id=t.replace(OpenLayers.Util.dotless,"_")),i&&(n.style.left=i.x+"px",n.style.top=i.y+"px"),r&&(n.style.width=r.w+"px",n.style.height=r.h+"px"),u&&(n.style.position=u),f&&(n.style.border=f),e&&(n.style.overflow=e),0<=parseFloat(o)&&1>parseFloat(o)?(n.style.filter="alpha(opacity="+100*o+")",n.style.opacity=o):1==parseFloat(o)&&(n.style.filter="",n.style.opacity="")},OpenLayers.Util.createDiv=function(n,t,i,r,u,f,e,o){var s=document.createElement("div");return r&&(s.style.backgroundImage="url("+r+")"),n||(n=OpenLayers.Util.createUniqueID("OpenLayersDiv")),u||(u="absolute"),OpenLayers.Util.modifyDOMElement(s,n,t,i,u,f,e,o),s},OpenLayers.Util.createImage=function(n,t,i,r,u,f,e,o){var s=document.createElement("img");return n||(n=OpenLayers.Util.createUniqueID("OpenLayersDiv")),u||(u="relative"),OpenLayers.Util.modifyDOMElement(s,n,t,i,u,f,null,e),o&&(s.style.display="none",t=function(){s.style.display="",OpenLayers.Event.stopObservingElement(s)},OpenLayers.Event.observe(s,"load",t),OpenLayers.Event.observe(s,"error",t)),s.style.alt=n,s.galleryImg="no",r&&(s.src=r),s},OpenLayers.IMAGE_RELOAD_ATTEMPTS=0,OpenLayers.Util.alphaHackNeeded=null,OpenLayers.Util.alphaHack=function(){if(null==OpenLayers.Util.alphaHackNeeded){var n=navigator.appVersion.split("MSIE"),n=parseFloat(n[1]),t=!1;try{t=!!document.body.filters}catch(i){}OpenLayers.Util.alphaHackNeeded=t&&5.5<=n&&7>n}return OpenLayers.Util.alphaHackNeeded},OpenLayers.Util.modifyAlphaImageDiv=function(n,t,i,r,u,f,e,o,s){OpenLayers.Util.modifyDOMElement(n,t,i,r,f,null,null,s),t=n.childNodes[0],u&&(t.src=u),OpenLayers.Util.modifyDOMElement(t,n.id+"_innerImage",null,r,"relative",e),OpenLayers.Util.alphaHack()&&("none"!=n.style.display&&(n.style.display="inline-block"),null==o&&(o="scale"),n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t.src+"', sizingMethod='"+o+"')",0<=parseFloat(n.style.opacity)&&1>parseFloat(n.style.opacity)&&(n.style.filter+=" alpha(opacity="+100*n.style.opacity+")"),t.style.filter="alpha(opacity=0)")},OpenLayers.Util.createAlphaImageDiv=function(n,t,i,r,u,f,e,o,s){var h=OpenLayers.Util.createDiv();return s=OpenLayers.Util.createImage(null,null,null,null,null,null,null,s),s.className="olAlphaImg",h.appendChild(s),OpenLayers.Util.modifyAlphaImageDiv(h,n,t,i,r,u,f,e,o),h},OpenLayers.Util.upperCaseObject=function(n){var i={},t;for(t in n)i[t.toUpperCase()]=n[t];return i},OpenLayers.Util.applyDefaults=function(n,t){n=n||{};var r="function"==typeof window.Event&&t instanceof window.Event,i;for(i in t)(void 0===n[i]||!r&&t.hasOwnProperty&&t.hasOwnProperty(i)&&!n.hasOwnProperty(i))&&(n[i]=t[i]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!n.hasOwnProperty("toString")&&(n.toString=t.toString),n},OpenLayers.Util.getParameterString=function(n){var f=[],r,t;for(r in n)if(t=n[r],null!=t&&"function"!=typeof t){if("object"==typeof t&&t.constructor==Array){for(var e=[],i,u=0,o=t.length;u<o;u++)i=t[u],e.push(encodeURIComponent(null===i||void 0===i?"":i));t=e.join(",")}else t=encodeURIComponent(t);f.push(encodeURIComponent(r)+"="+t)}return f.join("&")},OpenLayers.Util.urlAppend=function(n,t){var r=n,i;return t&&(i=(n+" ").split(/[?&]/),r=r+(" "===i.pop()?t:i.length?"&"+t:"?"+t)),r},OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+"img/"},OpenLayers.Util.getImageLocation=function(n){return OpenLayers.Util.getImagesLocation()+n},OpenLayers.Util.Try=function(){for(var i,t=null,n=0,r=arguments.length;n<r;n++){i=arguments[n];try{t=i();break}catch(u){}}return t},OpenLayers.Util.getXmlNodeValue=function(n){var t=null;return OpenLayers.Util.Try(function(){t=n.text,t||(t=n.textContent),t||(t=n.firstChild.nodeValue)},function(){t=n.textContent}),t},OpenLayers.Util.mouseLeft=function(n,t){for(var i=n.relatedTarget?n.relatedTarget:n.toElement;i!=t&&null!=i;)i=i.parentNode;return i!=t},OpenLayers.Util.DEFAULT_PRECISION=14,OpenLayers.Util.toFloat=function(n,t){return null==t&&(t=OpenLayers.Util.DEFAULT_PRECISION),"number"!=typeof n&&(n=parseFloat(n)),0===t?n:parseFloat(n.toPrecision(t))},OpenLayers.Util.rad=function(n){return n*Math.PI/180},OpenLayers.Util.deg=function(n){return 180*n/Math.PI},OpenLayers.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563},OpenLayers.Util.distVincenty=function(n,t){for(var i=OpenLayers.Util.VincentyConstants,u=i.a,h=i.b,i=i.f,w=OpenLayers.Util.rad(t.lon-n.lon),s=Math.atan((1-i)*Math.tan(OpenLayers.Util.rad(n.lat))),f=Math.atan((1-i)*Math.tan(OpenLayers.Util.rad(t.lat))),c=Math.sin(s),s=Math.cos(s),l=Math.sin(f),f=Math.cos(f),v=w,d=2*Math.PI,b=20;1e-12<Math.abs(v-d)&&0<--b;){var r=Math.sin(v),o=Math.cos(v),e=Math.sqrt(f*r*f*r+(s*l-c*f*o)*(s*l-c*f*o));if(0==e)return 0;var o=c*l+s*f*o,k=Math.atan2(e,o),y=Math.asin(s*f*r/e),a=Math.cos(y)*Math.cos(y),r=o-2*c*l/a,p=i/16*a*(4+i*(4-3*a)),d=v,v=w+(1-p)*i*Math.sin(y)*(k+p*e*(r+p*o*(-1+2*r*r)))}return 0==b?NaN:(u=a*(u*u-h*h)/(h*h),i=u/1024*(256+u*(-128+u*(74-47*u))),(h*(1+u/16384*(4096+u*(-768+u*(320-175*u))))*(k-i*e*(r+i/4*(o*(-1+2*r*r)-i/6*r*(-3+4*e*e)*(-3+4*r*r))))).toFixed(3)/1e3)},OpenLayers.Util.destinationVincenty=function(n,t,i){var s=OpenLayers.Util,a=s.VincentyConstants,r=a.a,e=a.b,h=a.f,a=n.lon,u;n=n.lat,u=s.rad(t),t=Math.sin(u),u=Math.cos(u),n=(1-h)*Math.tan(s.rad(n));var c=1/Math.sqrt(1+n*n),v=n*c,b=Math.atan2(n,u);n=c*t;for(var y=1-n*n,r=y*(r*r-e*e)/(e*e),w=1+r/16384*(4096+r*(-768+r*(320-175*r))),p=r/1024*(256+r*(-128+r*(74-47*r))),r=i/(e*w),d=2*Math.PI;1e-12<Math.abs(r-d);)var f=Math.cos(2*b+r),o=Math.sin(r),l=Math.cos(r),k=p*o*(f+p/4*(l*(-1+2*f*f)-p/6*f*(-3+4*o*o)*(-3+4*f*f))),d=r,r=i/(e*w)+k;return i=v*o-c*l*u,e=Math.atan2(v*l+c*o*u,(1-h)*Math.sqrt(n*n+i*i)),t=Math.atan2(o*t,c*l-v*o*u),u=h/16*y*(4+h*(4-3*y)),f=t-(1-u)*h*n*(r+u*o*(f+u*l*(-1+2*f*f))),Math.atan2(n,-i),new OpenLayers.LonLat(a+s.deg(f),s.deg(e))},OpenLayers.Util.getParameters=function(n,t){var u,i,r;if(t=t||{},n=null===n||void 0===n?window.location.href:n,u="",OpenLayers.String.contains(n,"?"))var f=n.indexOf("?")+1,u=OpenLayers.String.contains(n,"#")?n.indexOf("#"):n.length,u=n.substring(f,u);for(var f={},u=u.split(/[&;]/),e=0,o=u.length;e<o;++e)if(i=u[e].split("="),i[0]){r=i[0];try{r=decodeURIComponent(r)}catch(s){r=unescape(r)}i=(i[1]||"").replace(/\+/g," ");try{i=decodeURIComponent(i)}catch(h){i=unescape(i)}!1!==t.splitArgs&&(i=i.split(",")),1==i.length&&(i=i[0]),f[r]=i}return f},OpenLayers.Util.lastSeqID=0,OpenLayers.Util.createUniqueID=function(n){return n=null==n?"id_":n.replace(OpenLayers.Util.dotless,"_"),OpenLayers.Util.lastSeqID+=1,n+OpenLayers.Util.lastSeqID},OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.37,km:39370,dd:4374754,yd:36},OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches,OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd,OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m,OpenLayers.METERS_PER_INCH=.0254000508001016,OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:.30480060960121919/OpenLayers.METERS_PER_INCH,IFoot:.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:.30479971018150881/OpenLayers.METERS_PER_INCH,IInch:.0254/OpenLayers.METERS_PER_INCH,MicroInch:254e-7/OpenLayers.METERS_PER_INCH,Mil:254e-10/OpenLayers.METERS_PER_INCH,Centimeter:.01/OpenLayers.METERS_PER_INCH,Kilometer:1e3/OpenLayers.METERS_PER_INCH,Yard:.91440182880365761/OpenLayers.METERS_PER_INCH,SearsYard:.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:.91439853074444077/OpenLayers.METERS_PER_INCH,IndianYd37:.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:.1/OpenLayers.METERS_PER_INCH,Millimeter:.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:.20116840233680469/OpenLayers.METERS_PER_INCH,BenoitLink:.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":5e4/OpenLayers.METERS_PER_INCH,"150kilometers":15e4/OpenLayers.METERS_PER_INCH}),OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1e3,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:100*OpenLayers.INCHES_PER_UNIT.Meter,km:1e3*OpenLayers.INCHES_PER_UNIT.Meter,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(n){return 1<n?1/n:n},OpenLayers.Util.getResolutionFromScale=function(n,t){var i;return n&&(null==t&&(t="degrees"),i=1/(OpenLayers.Util.normalizeScale(n)*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH)),i},OpenLayers.Util.getScaleFromResolution=function(n,t){return null==t&&(t="degrees"),n*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH},OpenLayers.Util.pagePosition=function(n){var i=[0,0],r=OpenLayers.Util.getViewportElement(),u,t;if(!n||n==window||n==r)return i;if(u=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&"absolute"==OpenLayers.Element.getStyle(n,"position")&&(""==n.style.top||""==n.style.left),t=null,n.getBoundingClientRect)n=n.getBoundingClientRect(),t=window.pageYOffset||r.scrollTop,i[0]=n.left+(window.pageXOffset||r.scrollLeft),i[1]=n.top+t;else if(document.getBoxObjectFor&&!u)n=document.getBoxObjectFor(n),r=document.getBoxObjectFor(r),i[0]=n.screenX-r.screenX,i[1]=n.screenY-r.screenY;else{if(i[0]=n.offsetLeft,i[1]=n.offsetTop,t=n.offsetParent,t!=n)for(;t;)i[0]+=t.offsetLeft,i[1]+=t.offsetTop,t=t.offsetParent;for(r=OpenLayers.BROWSER_NAME,("opera"==r||"safari"==r&&"absolute"==OpenLayers.Element.getStyle(n,"position"))&&(i[1]-=document.body.offsetTop),t=n.offsetParent;t&&t!=document.body;)i[0]-=t.scrollLeft,("opera"!=r||"TR"!=t.tagName)&&(i[1]-=t.scrollTop),t=t.offsetParent}return i},OpenLayers.Util.getViewportElement=function(){var n=arguments.callee.viewportElement;return void 0==n&&(n="msie"==OpenLayers.BROWSER_NAME&&"CSS1Compat"!=document.compatMode?document.body:document.documentElement,arguments.callee.viewportElement=n),n},OpenLayers.Util.isEquivalentUrl=function(n,t,i){i=i||{},OpenLayers.Util.applyDefaults(i,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0,splitArgs:!1}),n=OpenLayers.Util.createUrlObject(n,i),t=OpenLayers.Util.createUrlObject(t,i);for(var r in n)if("args"!==r&&n[r]!=t[r])return!1;for(r in n.args){if(n.args[r]!=t.args[r])return!1;delete t.args[r]}for(r in t.args)return!1;return!0},OpenLayers.Util.createUrlObject=function(n,t){var u;if(t=t||{},!/^\w+:\/\//.test(n)){var i=window.location,r=i.port?":"+i.port:"",r=i.protocol+"//"+i.host.split(":").shift()+r;0===n.indexOf("/")?n=r+n:(i=i.pathname.split("/"),i.pop(),n=r+i.join("/")+"/"+n)}return t.ignoreCase&&(n=n.toLowerCase()),i=document.createElement("a"),i.href=n,r={},r.host=i.host.split(":").shift(),r.protocol=i.protocol,r.port=t.ignorePort80?"80"==i.port||"0"==i.port?"":i.port:""==i.port||"0"==i.port?"80":i.port,r.hash=t.ignoreHash||"#"===i.hash?"":i.hash,u=i.search,u||(u=n.indexOf("?"),u=-1!=u?n.substr(u):""),r.args=OpenLayers.Util.getParameters(u,{splitArgs:t.splitArgs}),r.pathname="/"==i.pathname.charAt(0)?i.pathname:"/"+i.pathname,r},OpenLayers.Util.removeTail=function(n){var t=null,t=n.indexOf("?"),i=n.indexOf("#");return t=-1==t?-1!=i?n.substr(0,i):n:-1!=i?n.substr(0,Math.min(t,i)):n.substr(0,t)},OpenLayers.IS_GECKO=function(){var n=navigator.userAgent.toLowerCase();return-1==n.indexOf("webkit")&&-1!=n.indexOf("gecko")}(),OpenLayers.CANVAS_SUPPORTED=function(){var n=document.createElement("canvas");return!(!n.getContext||!n.getContext("2d"))}(),OpenLayers.BROWSER_NAME=function(){var n="",t=navigator.userAgent.toLowerCase();return-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("msie")?n="msie":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("mozilla")&&(n=-1!=t.indexOf("firefox")?"firefox":"mozilla"),n}(),OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME},OpenLayers.Util.getRenderedDimensions=function(n,t,i){var e,o,r=document.createElement("div"),h;r.style.visibility="hidden";for(var f=i&&i.containerElement?i.containerElement:document.body,c=!1,u=null,s=f;s&&"body"!=s.tagName.toLowerCase();){if(h=OpenLayers.Element.getStyle(s,"position"),"absolute"==h){c=!0;break}else if(h&&"static"!=h)break;s=s.parentNode}if(c&&(0===f.clientHeight||0===f.clientWidth)&&(u=document.createElement("div"),u.style.visibility="hidden",u.style.position="absolute",u.style.overflow="visible",u.style.width=document.body.clientWidth+"px",u.style.height=document.body.clientHeight+"px",u.appendChild(r)),r.style.position="absolute",t&&(t.w?(e=t.w,r.style.width=e+"px"):t.h&&(o=t.h,r.style.height=o+"px")),i&&i.displayClass&&(r.className=i.displayClass),t=document.createElement("div"),t.innerHTML=n,t.style.overflow="visible",t.childNodes)for(n=0,i=t.childNodes.length;n<i;n++)t.childNodes[n].style&&(t.childNodes[n].style.overflow="visible");return r.appendChild(t),u?f.appendChild(u):f.appendChild(r),e||(e=parseInt(t.scrollWidth),r.style.width=e+"px"),o||(o=parseInt(t.scrollHeight)),r.removeChild(t),u?(u.removeChild(r),f.removeChild(u)):f.removeChild(r),new OpenLayers.Size(e,o)},OpenLayers.Util.getScrollbarWidth=function(){var t=OpenLayers.Util._scrollbarWidth;if(null==t){var n=null,i=null,n=t=0,n=document.createElement("div");n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.style.width="100px",n.style.height="50px",n.style.overflow="hidden",i=document.createElement("div"),i.style.width="100%",i.style.height="200px",n.appendChild(i),document.body.appendChild(n),t=i.offsetWidth,n.style.overflow="scroll",n=i.offsetWidth,document.body.removeChild(document.body.lastChild),OpenLayers.Util._scrollbarWidth=t-n,t=OpenLayers.Util._scrollbarWidth}return t},OpenLayers.Util.getFormattedLonLat=function(n,t,i){i||(i="dms"),n=(n+540)%360-180;var r=Math.abs(n),u=Math.floor(r),f=r=(r-u)/(1/60),r=Math.floor(r),f=Math.round((f-r)/(1/60)*10),f=f/10;return 60<=f&&(f-=60,r+=1,60<=r&&(r-=60,u+=1)),10>u&&(u="0"+u),u+="°",0<=i.indexOf("dm")&&(10>r&&(r="0"+r),u+=r+"'",0<=i.indexOf("dms")&&(10>f&&(f="0"+f),u+=f+'"')),u="lon"==t?u+(0>n?OpenLayers.i18n("W"):OpenLayers.i18n("E")):u+(0>n?OpenLayers.i18n("S"):OpenLayers.i18n("N"))},OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(n){OpenLayers.Util.extend(this,n),this.options=n},destroy:function(){},read:function(){throw Error("Read not implemented.");},write:function(){throw Error("Write not implemented.");},CLASS_NAME:"OpenLayers.Format"}),OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(n){window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM")),OpenLayers.Format.prototype.initialize.apply(this,[n]),this.namespaces=OpenLayers.Util.extend({},this.namespaces),this.namespaceAlias={};for(var t in this.namespaces)this.namespaceAlias[this.namespaces[t]]=t},destroy:function(){this.xmldom=null,OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(n,t){this.namespaces[n]=t,this.namespaceAlias[t]=n},read:function(n){var t=n.indexOf("<");return 0<t&&(n=n.substring(t)),t=OpenLayers.Util.Try(OpenLayers.Function.bind(function(){var t;return t=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom,t.loadXML(n),t},this),function(){return(new DOMParser).parseFromString(n,"text/xml")},function(){var t=new XMLHttpRequest;return t.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(n),!1),t.overrideMimeType&&t.overrideMimeType("text/xml"),t.send(null),t.responseXML}),this.keepData&&(this.data=t),t},write:function(n){var i,t;return this.xmldom?n=n.xml:(i=new XMLSerializer,1==n.nodeType?(t=document.implementation.createDocument("","",null),t.importNode&&(n=t.importNode(n,!0)),t.appendChild(n),n=i.serializeToString(t)):n=i.serializeToString(n)),n},createElementNS:function(n,t){return this.xmldom?"string"==typeof n?this.xmldom.createNode(1,t,n):this.xmldom.createNode(1,t,""):document.createElementNS(n,t)},createDocumentFragment:function(){return this.xmldom?this.xmldom.createDocumentFragment():document.createDocumentFragment()},createTextNode:function(n){return"string"!=typeof n&&(n=String(n)),this.xmldom?this.xmldom.createTextNode(n):document.createTextNode(n)},getElementsByTagNameNS:function(n,t,i){var f=[],r,e,u,o;if(n.getElementsByTagNameNS)f=n.getElementsByTagNameNS(t,i);else for(n=n.getElementsByTagName("*"),u=0,o=n.length;u<o;++u)(r=n[u],e=r.prefix?r.prefix+":"+i:i,"*"==i||e==r.nodeName)&&("*"!=t&&t!=r.namespaceURI||f.push(r));return f},getAttributeNodeNS:function(n,t,i){var f=null,r,e,u,o;if(n.getAttributeNodeNS)f=n.getAttributeNodeNS(t,i);else for(n=n.attributes,u=0,o=n.length;u<o;++u)if(r=n[u],r.namespaceURI==t&&(e=r.prefix?r.prefix+":"+i:i,e==r.nodeName)){f=r;break}return f},getAttributeNS:function(n,t,i){var r="";return n.getAttributeNS?r=n.getAttributeNS(t,i)||"":(n=this.getAttributeNodeNS(n,t,i))&&(r=n.nodeValue),r},getChildValue:function(n,t){var r=t||"",i;if(n)for(i=n.firstChild;i;i=i.nextSibling)switch(i.nodeType){case 3:case 4:r+=i.nodeValue}return r},isSimpleContent:function(n){var t=!0;for(n=n.firstChild;n;n=n.nextSibling)if(1===n.nodeType){t=!1;break}return t},contentType:function(n){var t=!1,i=!1,r=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(n=n.firstChild;n;n=n.nextSibling){switch(n.nodeType){case 1:i=!0;break;case 8:break;default:t=!0}if(i&&t)break}if(i&&t)r=OpenLayers.Format.XML.CONTENT_TYPE.MIXED;else{if(i)return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX;if(t)return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}return r},hasAttributeNS:function(n,t,i){var r=!1;return r=n.hasAttributeNS?n.hasAttributeNS(t,i):!!this.getAttributeNodeNS(n,t,i)},setAttributeNS:function(n,t,i,r){if(n.setAttributeNS)n.setAttributeNS(t,i,r);else if(this.xmldom)t?(t=n.ownerDocument.createNode(2,i,t),t.nodeValue=r,n.setAttributeNode(t)):n.setAttribute(i,r);else throw"setAttributeNS not implemented";},createElementNSPlus:function(n,t){var i,r;return t=t||{},i=t.uri||this.namespaces[t.prefix],i||(i=n.indexOf(":"),i=this.namespaces[n.substring(0,i)]),i||(i=this.namespaces[this.defaultPrefix]),i=this.createElementNS(i,n),t.attributes&&this.setAttributes(i,t.attributes),r=t.value,null!=r&&i.appendChild(this.createTextNode(r)),i},setAttributes:function(n,t){var r,u,i;for(i in t)null!=t[i]&&t[i].toString&&(r=t[i].toString(),u=this.namespaces[i.substring(0,i.indexOf(":"))]||null,this.setAttributeNS(n,u,i,r))},readNode:function(n,t){var i,r;return t||(t={}),i=this.readers[n.namespaceURI?this.namespaceAlias[n.namespaceURI]:this.defaultPrefix],i&&(r=n.localName||n.nodeName.split(":").pop(),(i=i[r]||i["*"])&&i.apply(this,[n,t])),t},readChildNodes:function(n,t){t||(t={});for(var u=n.childNodes,i,r=0,f=u.length;r<f;++r)i=u[r],1==i.nodeType&&this.readNode(i,t);return t},writeNode:function(n,t,i){var r,u=n.indexOf(":");return 0<u?(r=n.substring(0,u),n=n.substring(u+1)):r=i?this.namespaceAlias[i.namespaceURI]:this.defaultPrefix,t=this.writers[r][n].apply(this,[t]),i&&i.appendChild(t),t},getChildEl:function(n,t,i){return n&&this.getThisOrNextEl(n.firstChild,t,i)},getNextEl:function(n,t,i){return n&&this.getThisOrNextEl(n.nextSibling,t,i)},getThisOrNextEl:function(n,t,i){n:for(;n;n=n.nextSibling)switch(n.nodeType){case 1:if(!(t&&t!==(n.localName||n.nodeName.split(":").pop())||i&&i!==n.namespaceURI))break n;n=null;break n;case 3:if(/^\s*$/.test(n.nodeValue))break;case 4:case 6:case 12:case 10:case 11:n=null;break n}return n||null},lookupNamespaceURI:function(n,t){var i=null,r,u;if(n)if(n.lookupNamespaceURI)i=n.lookupNamespaceURI(t);else n:switch(n.nodeType){case 1:if(null!==n.namespaceURI&&n.prefix===t){i=n.namespaceURI;break n}if(i=n.attributes.length)for(u=0;u<i;++u)if(r=n.attributes[u],"xmlns"===r.prefix&&r.name==="xmlns:"+t){i=r.value||null;break n}else if("xmlns"===r.name&&null===t){i=r.value||null;break n}i=this.lookupNamespaceURI(n.parentNode,t);break n;case 2:i=this.lookupNamespaceURI(n.ownerElement,t);break n;case 9:i=this.lookupNamespaceURI(n.documentElement,t);break n;case 6:case 12:case 10:case 11:break n;default:i=this.lookupNamespaceURI(n.parentNode,t)}return i},getXMLDoc:function(){return OpenLayers.Format.XML.document||this.xmldom||(document.implementation&&document.implementation.createDocument?OpenLayers.Format.XML.document=document.implementation.createDocument("","",null):!this.xmldom&&window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM"))),OpenLayers.Format.XML.document||this.xmldom},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.Format.XML.document=null,OpenLayers.Date={dateRegEx:/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,toISOString:function(){return"toISOString"in Date.prototype?function(n){return n.toISOString()}:function(n){return isNaN(n.getTime())?"Invalid Date":n.getUTCFullYear()+"-"+OpenLayers.Number.zeroPad(n.getUTCMonth()+1,2)+"-"+OpenLayers.Number.zeroPad(n.getUTCDate(),2)+"T"+OpenLayers.Number.zeroPad(n.getUTCHours(),2)+":"+OpenLayers.Number.zeroPad(n.getUTCMinutes(),2)+":"+OpenLayers.Number.zeroPad(n.getUTCSeconds(),2)+"."+OpenLayers.Number.zeroPad(n.getUTCMilliseconds(),3)+"Z"}}(),parse:function(n){var t,i,r;if((n=n.match(this.dateRegEx))&&(n[1]||n[7])){if(t=parseInt(n[1],10)||0,i=parseInt(n[2],10)-1||0,r=parseInt(n[3],10)||1,t=new Date(Date.UTC(t,i,r)),i=n[7]){var r=parseInt(n[4],10),e=parseInt(n[5],10),u=parseFloat(n[6]),f=u|0,u=Math.round(1e3*(u-f));t.setUTCHours(r,e,f,u),"Z"!==i&&(i=parseInt(i,10),n=parseInt(n[8],10)||0,n=-1e3*(3600*i+60*n),t=new Date(t.getTime()+n))}}else t=new Date("invalid");return t}},OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:null,popup:null,initialize:function(n,t,i){this.layer=n,this.lonlat=t,this.data=null!=i?i:{},this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){null!=this.layer&&null!=this.layer.map&&null!=this.popup&&this.layer.map.removePopup(this.popup),null!=this.layer&&null!=this.marker&&this.layer.removeMarker(this.marker),this.data=this.lonlat=this.id=this.layer=null,null!=this.marker&&(this.destroyMarker(this.marker),this.marker=null),null!=this.popup&&(this.destroyPopup(this.popup),this.popup=null)},onScreen:function(){var n=!1;return null!=this.layer&&null!=this.layer.map&&(n=this.layer.map.getExtent().containsLonLat(this.lonlat)),n},createMarker:function(){return null!=this.lonlat&&(this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)),this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(n){return null!=this.lonlat&&(this.popup||(this.popup=new(this.popupClass?this.popupClass:OpenLayers.Popup.Anchored)(this.id+"_popup",this.lonlat,this.data.popupSize,this.data.popupContentHTML,this.marker?this.marker.icon:null,n)),null!=this.data.overflow&&(this.popup.contentDiv.style.overflow=this.data.overflow),this.popup.feature=this),this.popup},destroyPopup:function(){this.popup&&(this.popup.feature=null,this.popup.destroy(),this.popup=null)},CLASS_NAME:"OpenLayers.Feature"}),OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"},OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,url:null,renderIntent:"default",modified:null,initialize:function(n,t,i){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,t]),this.lonlat=null,this.geometry=n?n:null,this.state=null,this.attributes={},t&&(this.attributes=OpenLayers.Util.extend(this.attributes,t)),this.style=i?i:null},destroy:function(){this.layer&&(this.layer.removeFeatures(this),this.layer=null),this.modified=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(n){var t=!1;return this.layer&&this.layer.map&&(t=this.layer.map.getExtent(),n?(n=this.geometry.getBounds(),t=t.intersectsBounds(n)):t=t.toGeometry().intersects(this.geometry)),t},getVisibility:function(){return!(this.style&&"none"==this.style.display||!this.layer||this.layer&&this.layer.styleMap&&"none"==this.layer.styleMap.createSymbolizer(this,this.renderIntent).display||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(n,t,i){var r=!1;return this.geometry&&(r=this.geometry.atPoint(n,t,i)),r},destroyPopup:function(){},move:function(n){if(this.layer&&this.geometry.move){n="OpenLayers.LonLat"==n.CLASS_NAME?this.layer.getViewPortPxFromLonLat(n):n;var t=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),i=this.layer.map.getResolution();return this.geometry.move(i*(n.x-t.x),i*(t.y-n.y)),this.layer.drawFeature(this),t}},toState:function(n){if(n==OpenLayers.State.UPDATE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=n}else if(n==OpenLayers.State.INSERT)switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=n}else if(n==OpenLayers.State.DELETE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=n}else n==OpenLayers.State.UNKNOWN&&(this.state=n)},CLASS_NAME:"OpenLayers.Feature.Vector"}),OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},"delete":{display:"none"}},OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.bounds=this.id=null},clone:function(){return new OpenLayers.Geometry},setBounds:function(n){n&&(this.bounds=n.clone())},clearBounds:function(){this.bounds=null,this.parent&&this.parent.clearBounds()},extendBounds:function(n){this.getBounds()?this.bounds.extend(n):this.setBounds(n)},getBounds:function(){return null==this.bounds&&this.calculateBounds(),this.bounds},calculateBounds:function(){},distanceTo:function(){},getVertices:function(){},atPoint:function(n,t,i){var r=!1;return null!=this.getBounds()&&null!=n&&(t=null!=t?t:0,i=null!=i?i:0,r=new OpenLayers.Bounds(this.bounds.left-t,this.bounds.bottom-i,this.bounds.right+t,this.bounds.top+i).containsLonLat(n)),r},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.WKT?OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this)):Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Geometry"}),OpenLayers.Geometry.fromWKT=function(n){var i,t,r;if(OpenLayers.Format&&OpenLayers.Format.WKT)if(t=OpenLayers.Geometry.fromWKT.format,t||(t=new OpenLayers.Format.WKT,OpenLayers.Geometry.fromWKT.format=t),n=t.read(n),n instanceof OpenLayers.Feature.Vector)i=n.geometry;else if(OpenLayers.Util.isArray(n)){for(i=n.length,t=Array(i),r=0;r<i;++r)t[r]=n[r].geometry;i=new OpenLayers.Geometry.Collection(t)}return i},OpenLayers.Geometry.segmentsIntersect=function(n,t,i){var h=i&&i.point;i=i&&i.tolerance;var o=!1,r=n.x1-t.x1,s=n.y1-t.y1,e=n.x2-n.x1,u=n.y2-n.y1,c=t.y2-t.y1,l=t.x2-t.x1,f=c*e-l*u,c=l*s-c*r,s=e*s-u*r;if(0==f?0==c&&0==s&&(o=!0):(r=c/f,f=s/f,0<=r&&1>=r&&0<=f&&1>=f&&(h?(e=n.x1+r*e,f=n.y1+r*u,o=new OpenLayers.Geometry.Point(e,f)):o=!0)),i)if(o){if(h)n:for(n=[n,t],t=0;2>t;++t)for(r=n[t],u=1;3>u;++u)if(e=r["x"+u],f=r["y"+u],h=Math.sqrt(Math.pow(e-o.x,2)+Math.pow(f-o.y,2)),h<i){o.x=e,o.y=f;break n}}else n:for(n=[n,t],t=0;2>t;++t)for(e=n[t],f=n[(t+1)%2],u=1;3>u;++u)if(r={x:e["x"+u],y:e["y"+u]},s=OpenLayers.Geometry.distanceToSegment(r,f),s.distance<i){o=h?new OpenLayers.Geometry.Point(r.x,r.y):!0;break n}return o},OpenLayers.Geometry.distanceToSegment=function(n,t){var i=OpenLayers.Geometry.distanceSquaredToSegment(n,t);return i.distance=Math.sqrt(i.distance),i},OpenLayers.Geometry.distanceSquaredToSegment=function(n,t){var o=n.x,s=n.y,i=t.x1,r=t.y1,h=t.x2,c=t.y2,f=h-i,e=c-r,u=(f*(o-i)+e*(s-r))/(Math.pow(f,2)+Math.pow(e,2));return 0>=u||(1<=u?(i=h,r=c):(i+=u*f,r+=u*e)),{distance:Math.pow(i-o,2)+Math.pow(r-s,2),x:i,y:r,along:u}},OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(n,t){OpenLayers.Geometry.prototype.initialize.apply(this,arguments),this.x=parseFloat(n),this.y=parseFloat(t)},clone:function(n){return null==n&&(n=new OpenLayers.Geometry.Point(this.x,this.y)),OpenLayers.Util.applyDefaults(n,this),n},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(n,t){var o=!(t&&!1===t.edge)&&t&&t.details,i,r,u,f,e;return n instanceof OpenLayers.Geometry.Point?(r=this.x,u=this.y,f=n.x,e=n.y,i=Math.sqrt(Math.pow(r-f,2)+Math.pow(u-e,2)),i=o?{x0:r,y0:u,x1:f,y1:e,distance:i}:i):(i=n.distanceTo(this,t),o&&(i={x0:i.x1,y0:i.y1,x1:i.x0,y1:i.y0,distance:i.distance})),i},equals:function(n){var t=!1;return null!=n&&(t=this.x==n.x&&this.y==n.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(n.x)&&isNaN(n.y)),t},toShortString:function(){return this.x+", "+this.y},move:function(n,t){this.x+=n,this.y+=t,this.clearBounds()},rotate:function(n,t){n*=Math.PI/180;var i=this.distanceTo(t),r=n+Math.atan2(this.y-t.y,this.x-t.x);this.x=t.x+i*Math.cos(r),this.y=t.y+i*Math.sin(r),this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(n,t,i){return this.x=t.x+n*(void 0==i?1:i)*(this.x-t.x),this.y=t.y+n*(this.y-t.y),this.clearBounds(),this},intersects:function(n){var t=!1;return t="OpenLayers.Geometry.Point"==n.CLASS_NAME?this.equals(n):n.intersects(this)},transform:function(n,t){return n&&t&&(OpenLayers.Projection.transform(this,n,t),this.bounds=null),this},getVertices:function(){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"}),OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(n){OpenLayers.Geometry.prototype.initialize.apply(this,arguments),this.components=[],null!=n&&this.addComponents(n)},destroy:function(){this.components.length=0,this.components=null,OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},clone:function(){for(var a=eval("new "+this.CLASS_NAME+"()"),b=0,c=this.components.length;b<c;b++)a.addComponent(this.components[b].clone());return OpenLayers.Util.applyDefaults(a,this),a},getComponentsString:function(){for(var t=[],n=0,i=this.components.length;n<i;n++)t.push(this.components[n].toShortString());return t.join(",")},calculateBounds:function(){var n,t,i,r;if(this.bounds=null,n=new OpenLayers.Bounds,t=this.components,t)for(i=0,r=t.length;i<r;i++)n.extend(t[i].getBounds());null!=n.left&&null!=n.bottom&&null!=n.right&&null!=n.top&&this.setBounds(n)},addComponents:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var t=0,i=n.length;t<i;t++)this.addComponent(n[t])},addComponent:function(n,t){var i=!1,r;return n&&(null==this.componentTypes||-1<OpenLayers.Util.indexOf(this.componentTypes,n.CLASS_NAME))&&(null!=t&&t<this.components.length?(i=this.components.slice(0,t),r=this.components.slice(t,this.components.length),i.push(n),this.components=i.concat(r)):this.components.push(n),n.parent=this,this.clearBounds(),i=!0),i},removeComponents:function(n){var i=!1,t;for(OpenLayers.Util.isArray(n)||(n=[n]),t=n.length-1;0<=t;--t)i=this.removeComponent(n[t])||i;return i},removeComponent:function(n){return OpenLayers.Util.removeItem(this.components,n),this.clearBounds(),!0},getLength:function(){for(var t=0,n=0,i=this.components.length;n<i;n++)t+=this.components[n].getLength();return t},getArea:function(){for(var t=0,n=0,i=this.components.length;n<i;n++)t+=this.components[n].getArea();return t},getGeodesicArea:function(n){for(var i=0,t=0,r=this.components.length;t<r;t++)i+=this.components[t].getGeodesicArea(n);return i},getCentroid:function(n){var r,o,t;if(!n)return this.components.length&&this.components[0].getCentroid();if(n=this.components.length,!n)return!1;for(var f=[],s=[],e=0,u=Number.MAX_VALUE,i,t=0;t<n;++t)i=this.components[t],r=i.getArea(),i=i.getCentroid(!0),isNaN(r)||isNaN(i.x)||isNaN(i.y)||(f.push(r),e+=r,u=r<u&&0<r?r:u,s.push(i));if(n=f.length,0===e){for(t=0;t<n;++t)f[t]=1;e=f.length}else{for(t=0;t<n;++t)f[t]/=u;e/=u}for(o=u=0,t=0;t<n;++t)i=s[t],r=f[t],u+=i.x*r,o+=i.y*r;return new OpenLayers.Geometry.Point(u/e,o/e)},getGeodesicLength:function(n){for(var i=0,t=0,r=this.components.length;t<r;t++)i+=this.components[t].getGeodesicLength(n);return i},move:function(n,t){for(var i=0,r=this.components.length;i<r;i++)this.components[i].move(n,t)},rotate:function(n,t){for(var i=0,r=this.components.length;i<r;++i)this.components[i].rotate(n,t)},resize:function(n,t,i){for(var r=0;r<this.components.length;++r)this.components[r].resize(n,t,i);return this},distanceTo:function(n,t){for(var o=!(t&&!1===t.edge)&&t&&t.details,i,e,r,u=Number.POSITIVE_INFINITY,f=0,s=this.components.length;f<s&&!(i=this.components[f].distanceTo(n,t),r=o?i.distance:i,r<u&&(u=r,e=i,0==u));++f);return e},equals:function(n){var i=!0,t,r;if(n&&n.CLASS_NAME&&this.CLASS_NAME==n.CLASS_NAME)if(OpenLayers.Util.isArray(n.components)&&n.components.length==this.components.length){for(t=0,r=this.components.length;t<r;++t)if(!this.components[t].equals(n.components[t])){i=!1;break}}else i=!1;else i=!1;return i},transform:function(n,t){if(n&&t){for(var i=0,r=this.components.length;i<r;i++)this.components[i].transform(n,t);this.bounds=null}return this},intersects:function(n){for(var i=!1,t=0,r=this.components.length;t<r&&!(i=n.intersects(this.components[t]));++t);return i},getVertices:function(n){for(var i=[],t=0,r=this.components.length;t<r;++t)Array.prototype.push.apply(i,this.components[t].getVertices(n));return i},CLASS_NAME:"OpenLayers.Geometry.Collection"}),OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],addPoint:function(n,t){this.addComponent(n,t)},removePoint:function(n){this.removeComponent(n)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"}),OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],getLength:function(){var t=0,n,i;if(this.components&&1<this.components.length)for(n=1,i=this.components.length;n<i;n++)t+=this.components[n-1].distanceTo(this.components[n]);return t},getGeodesicLength:function(n){var t=this,i,u,r,f;if(n&&(i=new OpenLayers.Projection("EPSG:4326"),i.equals(n)||(t=this.clone().transform(n,i))),n=0,t.components&&1<t.components.length)for(r=1,f=t.components.length;r<f;r++)i=t.components[r-1],u=t.components[r],n+=OpenLayers.Util.distVincenty({lon:i.x,lat:i.y},{lon:u.x,lat:u.y});return 1e3*n},CLASS_NAME:"OpenLayers.Geometry.Curve"}),OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{removeComponent:function(){var t=this.components&&2<this.components.length;return t&&OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments),t},intersects:function(n){var f=!1,t=n.CLASS_NAME,e,l,a,o,s,i,h,c,r,v,u,y;if("OpenLayers.Geometry.LineString"==t||"OpenLayers.Geometry.LinearRing"==t||"OpenLayers.Geometry.Point"==t){e=this.getSortedSegments(),n="OpenLayers.Geometry.Point"==t?[{x1:n.x,y1:n.y,x2:n.x,y2:n.y}]:n.getSortedSegments(),r=0,v=e.length;n:for(;r<v;++r)for(t=e[r],l=t.x1,a=t.x2,o=t.y1,s=t.y2,u=0,y=n.length;u<y;++u){if(i=n[u],i.x1>a)break;if(!(i.x2<l||(h=i.y1,c=i.y2,Math.min(h,c)>Math.max(o,s)||Math.max(h,c)<Math.min(o,s)||!OpenLayers.Geometry.segmentsIntersect(t,i)))){f=!0;break n}}}else f=n.intersects(this);return f},getSortedSegments:function(){for(var r=this.components.length-1,u=Array(r),n,t,i=0;i<r;++i)n=this.components[i],t=this.components[i+1],u[i]=n.x<t.x?{x1:n.x,y1:n.y,x2:t.x,y2:t.y}:{x1:t.x,y1:t.y,x2:n.x,y2:n.y};return u.sort(function(n,t){return n.x1-t.x1})},splitWithSegment:function(n,t){for(var v=!(t&&!1===t.edge),r=t&&t.tolerance,s=[],h=this.getVertices(),u=[],e=[],c=!1,f,i,y,p={point:!0,tolerance:r},b=null,o=0,w=h.length-2;o<=w;++o)(r=h[o],u.push(r.clone()),f=h[o+1],i={x1:r.x,y1:r.y,x2:f.x,y2:f.y},i=OpenLayers.Geometry.segmentsIntersect(n,i,p),i instanceof OpenLayers.Geometry.Point&&((y=i.x===n.x1&&i.y===n.y1||i.x===n.x2&&i.y===n.y2||i.equals(r)||i.equals(f)?!0:!1)||v))&&(i.equals(e[e.length-1])||e.push(i.clone()),0===o&&i.equals(r)||i.equals(f)||(c=!0,i.equals(r)||u.push(i),s.push(new OpenLayers.Geometry.LineString(u)),u=[i.clone()]));if(c&&(u.push(f.clone()),s.push(new OpenLayers.Geometry.LineString(u))),0<e.length)var l=n.x1<n.x2?1:-1,a=n.y1<n.y2?1:-1,b={lines:s,points:e.sort(function(n,t){return l*n.x-l*t.x||a*n.y-a*t.y})};return b},split:function(n,t){var y=null,c=t&&t.mutual,p,w,u,i,l,o,s,b,a,r,f,h,k,e,v,d;if(n instanceof OpenLayers.Geometry.LineString){for(l=this.getVertices(),f=[],u=[],h=0,k=l.length-2;h<=k;++h)for(o=l[h],s=l[h+1],b={x1:o.x,y1:o.y,x2:s.x,y2:s.y},i=i||[n],c&&f.push(o.clone()),e=0;e<i.length;++e)if((a=i[e].splitWithSegment(b,t))&&(r=a.lines,0<r.length&&(r.unshift(e,1),Array.prototype.splice.apply(i,r),e+=r.length-2),c))for(v=0,d=a.points.length;v<d;++v)r=a.points[v],r.equals(o)||(f.push(r),u.push(new OpenLayers.Geometry.LineString(f)),f=r.equals(s)?[]:[r.clone()]);c&&0<u.length&&0<f.length&&(f.push(s.clone()),u.push(new OpenLayers.Geometry.LineString(f)))}else y=n.splitWith(this,t);return i&&1<i.length?w=!0:i=[],u&&1<u.length?p=!0:u=[],(w||p)&&(y=c?[u,i]:i),y},splitWith:function(n,t){return n.split(this,t)},getVertices:function(n){return!0===n?[this.components[0],this.components[this.components.length-1]]:!1===n?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(n,t){var s=!(t&&!1===t.edge)&&t&&t.details,i,r={},f=Number.POSITIVE_INFINITY,a;if(n instanceof OpenLayers.Geometry.Point){for(var c=this.getSortedSegments(),l=n.x,u=n.y,e,o=0,y=c.length;o<y;++o)if(e=c[o],i=OpenLayers.Geometry.distanceToSegment(n,e),i.distance<f){if(f=i.distance,r=i,0===f)break}else if(e.x2>l&&(u>e.y1&&u<e.y2||u<e.y1&&u>e.y2))break;r=s?{distance:r.distance,x0:r.x,y0:r.y,x1:l,y1:u}:r.distance}else if(n instanceof OpenLayers.Geometry.LineString){var c=this.getSortedSegments(),l=n.getSortedSegments(),h,v,p=l.length,w={point:!0},o=0,y=c.length;n:for(;o<y;++o)for(u=c[o],e=u.x1,v=u.y1,a=0;a<p;++a)if(i=l[a],h=OpenLayers.Geometry.segmentsIntersect(u,i,w)){f=0,r={distance:0,x0:h.x,y0:h.y,x1:h.x,y1:h.y};break n}else i=OpenLayers.Geometry.distanceToSegment({x:e,y:v},i),i.distance<f&&(f=i.distance,r={distance:f,x0:e,y0:v,x1:i.x,y1:i.y});s||(r=r.distance),0!==f&&u&&(i=n.distanceTo(new OpenLayers.Geometry.Point(u.x2,u.y2),t),o=s?i.distance:i,o<f&&(r=s?{distance:f,x0:i.x1,y0:i.y1,x1:i.x0,y1:i.y0}:o))}else r=n.distanceTo(this,t),s&&(r={distance:r.distance,x0:r.x1,y0:r.y1,x1:r.x0,y1:r.y0});return r},simplify:function(n){var i;if(this&&null!==this){if(i=this.getVertices(),3>i.length)return this;var u=function(n,t,i,f){for(var l=0,s=0,c=t,e;c<i;c++){e=n[t];var o=n[i],h=n[c],h=Math.abs(.5*(e.x*o.y+o.x*h.y+h.x*e.y-o.x*e.y-h.x*o.y-e.x*h.y));e=Math.sqrt(Math.pow(e.x-o.x,2)+Math.pow(e.y-o.y,2)),e=h/e*2,e>l&&(l=e,s=c)}l>f&&s!=t&&(r.push(s),u(n,t,s,f),u(n,s,i,f))},t=i.length-1,r=[];for(r.push(0),r.push(t);i[0].equals(i[t]);)t--,r.push(t);for(u(i,0,t,n),n=[],r.sort(function(n,t){return n-t}),t=0;t<r.length;t++)n.push(i[r[t]]);return new OpenLayers.Geometry.LineString(n)}return this},CLASS_NAME:"OpenLayers.Geometry.LineString"}),OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],addComponent:function(n,t){var i=!1,r=this.components.pop();return null==t&&n.equals(r)||(i=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)),OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]),i},removeComponent:function(){var t=this.components&&3<this.components.length;return t&&(this.components.pop(),OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments),OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]])),t},move:function(n,t){for(var i=0,r=this.components.length;i<r-1;i++)this.components[i].move(n,t)},rotate:function(n,t){for(var i=0,r=this.components.length;i<r-1;++i)this.components[i].rotate(n,t)},resize:function(n,t,i){for(var r=0,u=this.components.length;r<u-1;++r)this.components[r].resize(n,t,i);return this},transform:function(n,t){if(n&&t){for(var i=0,r=this.components.length;i<r-1;i++)this.components[i].transform(n,t);this.bounds=null}return this},getCentroid:function(){var n,t;if(this.components){if(n=this.components.length,0<n&&2>=n)return this.components[0].clone();if(2<n){var e=0,o=0,i=this.components[0].x,r=this.components[0].y,s=-1*this.getArea();if(0!=s){for(t=0;t<n-1;t++)var u=this.components[t],f=this.components[t+1],e=e+(u.x+f.x-2*i)*((u.x-i)*(f.y-r)-(f.x-i)*(u.y-r)),o=o+(u.y+f.y-2*r)*((u.x-i)*(f.y-r)-(f.x-i)*(u.y-r));e=i+e/(6*s),n=r+o/(6*s)}else{for(t=0;t<n-1;t++)e+=this.components[t].x,o+=this.components[t].y;e/=n-1,n=o/(n-1)}return new OpenLayers.Geometry.Point(e,n)}return null}},getArea:function(){var t=0,n,i;if(this.components&&2<this.components.length){for(n=t=0,i=this.components.length;n<i-1;n++)var r=this.components[n],u=this.components[n+1],t=t+(r.x+u.x)*(u.y-r.y);t=-t/2}return t},getGeodesicArea:function(n){var i=this,t,u,f,r;if(n&&(t=new OpenLayers.Projection("EPSG:4326"),t.equals(n)||(i=this.clone().transform(n,t))),n=0,t=i.components&&i.components.length,2<t){for(r=0;r<t-1;r++)u=i.components[r],f=i.components[r+1],n+=OpenLayers.Util.rad(f.x-u.x)*(2+Math.sin(OpenLayers.Util.rad(u.y))+Math.sin(OpenLayers.Util.rad(f.y)));n=40680631590769*n/2}return n},containsPoint:function(n){var f=OpenLayers.Number.limitSigDigs,e=f(n.x,14);n=f(n.y,14);for(var c=this.components.length-1,t,i,u,r,o,s=0,h=0;h<c;++h)if(t=this.components[h],u=f(t.x,14),t=f(t.y,14),i=this.components[h+1],r=f(i.x,14),i=f(i.y,14),t==i){if(n==t&&(u<=r&&e>=u&&e<=r||u>=r&&e<=u&&e>=r)){s=-1;break}}else{if(o=f((r-u)/(i-t)*(n-i)+r,14),o==e&&(t<i&&n>=t&&n<=i||t>i&&n<=t&&n>=i)){s=-1;break}o<=e||u!=r&&(o<Math.min(u,r)||o>Math.max(u,r))||(t<i&&n>=t&&n<i||t>i&&n<t&&n>=i)&&++s}return-1==s?1:!!(s&1)},intersects:function(n){var t=!1,i,r;if("OpenLayers.Geometry.Point"==n.CLASS_NAME)t=this.containsPoint(n);else if("OpenLayers.Geometry.LineString"==n.CLASS_NAME)t=n.intersects(this);else if("OpenLayers.Geometry.LinearRing"==n.CLASS_NAME)t=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[n]);else for(i=0,r=n.components.length;i<r&&!(t=n.components[i].intersects(this));++i);return t},getVertices:function(n){return!0===n?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"}),OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],getArea:function(){var n=0;if(this.components&&0<this.components.length)for(var n=n+Math.abs(this.components[0].getArea()),t=1,i=this.components.length;t<i;t++)n-=Math.abs(this.components[t].getArea());return n},getGeodesicArea:function(n){var t=0;if(this.components&&0<this.components.length)for(var t=t+Math.abs(this.components[0].getGeodesicArea(n)),i=1,r=this.components.length;i<r;i++)t-=Math.abs(this.components[i].getGeodesicArea(n));return t},containsPoint:function(n){var r=this.components.length,t=!1,u,i;if(0<r&&(t=this.components[0].containsPoint(n),1!==t&&t&&1<r))for(i=1;i<r;++i)if(u=this.components[i].containsPoint(n)){t=1===u?1:!1;break}return t},intersects:function(n){var i=!1,t,r,u;if("OpenLayers.Geometry.Point"==n.CLASS_NAME)i=this.containsPoint(n);else if("OpenLayers.Geometry.LineString"==n.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==n.CLASS_NAME){for(t=0,r=this.components.length;t<r&&!(i=n.intersects(this.components[t]));++t);if(!i)for(t=0,r=n.components.length;t<r&&!(i=this.containsPoint(n.components[t]));++t);}else for(t=0,r=n.components.length;t<r&&!(i=this.intersects(n.components[t]));++t);if(!i&&"OpenLayers.Geometry.Polygon"==n.CLASS_NAME)for(u=this.components[0],t=0,r=u.components.length;t<r&&!(i=n.containsPoint(u.components[t]));++t);return i},distanceTo:function(n,t){return t&&!1===t.edge&&this.intersects(n)?0:OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[n,t])},CLASS_NAME:"OpenLayers.Geometry.Polygon"}),OpenLayers.Geometry.Polygon.createRegularPolygon=function(n,t,i,r){var o=Math.PI*(1/i-.5),u,e,f;for(r&&(o+=r/180*Math.PI),e=[],f=0;f<i;++f)u=o+2*f*Math.PI/i,r=n.x+t*Math.cos(u),u=n.y+t*Math.sin(u),e.push(new OpenLayers.Geometry.Point(r,u));return n=new OpenLayers.Geometry.LinearRing(e),new OpenLayers.Geometry.Polygon([n])},OpenLayers.Event={observers:!1,KEY_SPACE:32,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(n){return n.target||n.srcElement},isSingleTouch:function(n){return n.touches&&1==n.touches.length},isMultiTouch:function(n){return n.touches&&1<n.touches.length},isLeftClick:function(n){return n.which&&1==n.which||n.button&&1==n.button},isRightClick:function(n){return n.which&&3==n.which||n.button&&2==n.button},stop:function(n,t){t||OpenLayers.Event.preventDefault(n),n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},preventDefault:function(n){n.preventDefault?n.preventDefault():n.returnValue=!1},findElement:function(n,t){for(var i=OpenLayers.Event.element(n);i.parentNode&&(!i.tagName||i.tagName.toUpperCase()!=t.toUpperCase());)i=i.parentNode;return i},observe:function(n,t,i,r){if(n=OpenLayers.Util.getElement(n),r=r||!1,"keypress"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||n.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!n._eventCacheID){var u="eventCacheID_";n.id&&(u=n.id+"_"+u),n._eventCacheID=OpenLayers.Util.createUniqueID(u)}u=n._eventCacheID,this.observers[u]||(this.observers[u]=[]),this.observers[u].push({element:n,name:t,observer:i,useCapture:r}),n.addEventListener?n.addEventListener(t,i,r):n.attachEvent&&n.attachEvent("on"+t,i)},stopObservingElement:function(n){n=OpenLayers.Util.getElement(n)._eventCacheID,this._removeElementObservers(OpenLayers.Event.observers[n])},_removeElementObservers:function(n){var i,t;if(n)for(i=n.length-1;0<=i;i--)t=n[i],OpenLayers.Event.stopObserving.apply(this,[t.element,t.name,t.observer,t.useCapture])},stopObserving:function(n,t,i,r){var s,f,u,e,o;if(r=r||!1,n=OpenLayers.Util.getElement(n),s=n._eventCacheID,"keypress"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||n.detachEvent)&&(t="keydown"),f=!1,u=OpenLayers.Event.observers[s],u)for(e=0;!f&&e<u.length;){if(o=u[e],o.name==t&&o.observer==i&&o.useCapture==r){u.splice(e,1),0==u.length&&delete OpenLayers.Event.observers[s],f=!0;break}e++}return f&&(n.removeEventListener?n.removeEventListener(t,i,r):n&&n.detachEvent&&n.detachEvent("on"+t,i)),f},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var n in OpenLayers.Event.observers)OpenLayers.Event._removeElementObservers.apply(this,[OpenLayers.Event.observers[n]]);OpenLayers.Event.observers=!1}},CLASS_NAME:"OpenLayers.Event"},OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,!1),OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:"mouseover mouseout mousedown mouseup mousemove click dblclick rightclick dblrightclick resize focus blur touchstart touchmove touchend keydown".split(" "),listeners:null,object:null,element:null,eventHandler:null,fallThrough:null,includeXY:!1,extensions:null,extensionCount:null,clearMouseListener:null,initialize:function(n,t,i,r,u){OpenLayers.Util.extend(this,u),this.object=n,this.fallThrough=r,this.listeners={},this.extensions={},this.extensionCount={},this._msTouches=[],null!=t&&this.attachToElement(t)},destroy:function(){for(var n in this.extensions)"boolean"!=typeof this.extensions[n]&&this.extensions[n].destroy();this.extensions=null,this.element&&(OpenLayers.Event.stopObservingElement(this.element),this.element.hasScrollEvent&&OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)),this.eventHandler=this.fallThrough=this.object=this.listeners=this.element=null},addEventType:function(){},attachToElement:function(n){this.element?OpenLayers.Event.stopObservingElement(this.element):(this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this)),this.element=n;for(var r=!!window.navigator.msMaxTouchPoints,t,i=0,u=this.BROWSER_EVENTS.length;i<u;i++)t=this.BROWSER_EVENTS[i],OpenLayers.Event.observe(n,t,this.eventHandler),r&&0===t.indexOf("touch")&&this.addMsTouchListener(n,t,this.eventHandler);OpenLayers.Event.observe(n,"dragstart",OpenLayers.Event.stop)},on:function(n){for(var t in n)"scope"!=t&&n.hasOwnProperty(t)&&this.register(t,n.scope,n[t])},register:function(n,t,i,r){if(n in OpenLayers.Events&&!this.extensions[n]&&(this.extensions[n]=new OpenLayers.Events[n](this)),null!=i){null==t&&(t=this.object);var u=this.listeners[n];u||(u=[],this.listeners[n]=u,this.extensionCount[n]=0),t={obj:t,func:i},r?(u.splice(this.extensionCount[n],0,t),"object"==typeof r&&r.extension&&this.extensionCount[n]++):u.push(t)}},registerPriority:function(n,t,i){this.register(n,t,i,!0)},un:function(n){for(var t in n)"scope"!=t&&n.hasOwnProperty(t)&&this.unregister(t,n.scope,n[t])},unregister:function(n,t,i){if(null==t&&(t=this.object),n=this.listeners[n],null!=n)for(var r=0,u=n.length;r<u;r++)if(n[r].obj==t&&n[r].func==i){n.splice(r,1);break}},remove:function(n){null!=this.listeners[n]&&(this.listeners[n]=[])},triggerEvent:function(n,t){var r=this.listeners[n];if(r&&0!=r.length){null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=n);for(var r=r.slice(),i,u=0,f=r.length;u<f&&(i=r[u],i=i.func.apply(i.obj,[t]),void 0==i||!1!=i);u++);return this.fallThrough||OpenLayers.Event.stop(t,!0),i}},handleBrowserEvent:function(n){var f=n.type,t=this.listeners[f];if(t&&0!=t.length){if((t=n.touches)&&t[0]){for(var e=0,o=0,i=t.length,r,u=0;u<i;++u)r=this.getTouchClientXY(t[u]),e+=r.clientX,o+=r.clientY;n.clientX=e/i,n.clientY=o/i}this.includeXY&&(n.xy=this.getMousePosition(n)),this.triggerEvent(f,n)}},getTouchClientXY:function(n){var r=window.olMockWin||window,u=r.pageXOffset,r=r.pageYOffset,t=n.clientX,i=n.clientY;return 0===n.pageY&&Math.floor(i)>Math.floor(n.pageY)||0===n.pageX&&Math.floor(t)>Math.floor(n.pageX)?(t-=u,i-=r):(i<n.pageY-r||t<n.pageX-u)&&(t=n.pageX-u,i=n.pageY-r),n.olClientX=t,n.olClientY=i,{clientX:t,clientY:i}},clearMouseCache:function(){this.element.scrolls=null,this.element.lefttop=null,this.element.offsets=null},getMousePosition:function(n){if(this.includeXY?this.element.hasScrollEvent||(OpenLayers.Event.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var t=OpenLayers.Util.getViewportElement();this.element.scrolls=[window.pageXOffset||t.scrollLeft,window.pageYOffset||t.scrollTop]}return this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=OpenLayers.Util.pagePosition(this.element)),new OpenLayers.Pixel(n.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],n.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])},addMsTouchListener:function(n,t,i){function u(n){i(OpenLayers.Util.applyDefaults({stopPropagation:function(){for(var n=r.length-1;0<=n;--n)r[n].stopPropagation()},preventDefault:function(){for(var n=r.length-1;0<=n;--n)r[n].preventDefault()},type:t},n))}var r=this._msTouches;switch(t){case"touchstart":return this.addMsTouchListenerStart(n,t,u);case"touchend":return this.addMsTouchListenerEnd(n,t,u);case"touchmove":return this.addMsTouchListenerMove(n,t,u);default:throw"Unknown touch event type";}},addMsTouchListenerStart:function(n,t,i){var r=this._msTouches;OpenLayers.Event.observe(n,"MSPointerDown",function(n){for(var u=!1,t=0,f=r.length;t<f;++t)if(r[t].pointerId==n.pointerId){u=!0;break}u||r.push(n),n.touches=r.slice(),i(n)}),OpenLayers.Event.observe(n,"MSPointerUp",function(n){for(var t=0,i=r.length;t<i;++t)if(r[t].pointerId==n.pointerId){r.splice(t,1);break}})},addMsTouchListenerMove:function(n,t,i){var r=this._msTouches;OpenLayers.Event.observe(n,"MSPointerMove",function(n){if((n.pointerType!=n.MSPOINTER_TYPE_MOUSE||0!=n.buttons)&&(1!=r.length||r[0].pageX!=n.pageX||r[0].pageY!=n.pageY)){for(var t=0,u=r.length;t<u;++t)if(r[t].pointerId==n.pointerId){r[t]=n;break}n.touches=r.slice(),i(n)}})},addMsTouchListenerEnd:function(n,t,i){var r=this._msTouches;OpenLayers.Event.observe(n,"MSPointerUp",function(n){for(var t=0,u=r.length;t<u;++t)if(r[t].pointerId==n.pointerId){r.splice(t,1);break}n.touches=r.slice(),i(n)})},CLASS_NAME:"OpenLayers.Events"}),OpenLayers.ProxyHost="",OpenLayers.Request||(OpenLayers.Request={}),OpenLayers.Util.extend(OpenLayers.Request,{DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:!0,user:void 0,password:void 0,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new OpenLayers.Events(this),makeSameOrigin:function(n,t){var u=0!==n.indexOf("http"),i=!u&&n.match(this.URL_SPLIT_REGEX);if(i){var r=window.location,u=i[1]==r.protocol&&i[3]==r.hostname,i=i[4],r=r.port;(80!=i&&""!=i||"80"!=r&&""!=r)&&(u=u&&i==r)}return u||t&&(n="function"==typeof t?t(n):t+encodeURIComponent(n)),n},issue:function(n){var i=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost}),u,f,e,o;n=n||{},n.headers=n.headers||{},n=OpenLayers.Util.applyDefaults(n,i),n.headers=OpenLayers.Util.applyDefaults(n.headers,i.headers),i=!1;for(u in n.headers)n.headers.hasOwnProperty(u)&&"x-requested-with"===u.toLowerCase()&&(i=!0);!1===i&&(n.headers["X-Requested-With"]="XMLHttpRequest");var t=new OpenLayers.Request.XMLHttpRequest,r=OpenLayers.Util.urlAppend(n.url,OpenLayers.Util.getParameterString(n.params||{})),r=OpenLayers.Request.makeSameOrigin(r,n.proxy);t.open(n.method,r,n.async,n.user,n.password);for(f in n.headers)t.setRequestHeader(f,n.headers[f]);return e=this.events,o=this,t.onreadystatechange=function(){t.readyState==OpenLayers.Request.XMLHttpRequest.DONE&&!1!==e.triggerEvent("complete",{request:t,config:n,requestUrl:r})&&o.runCallbacks({request:t,config:n,requestUrl:r})},!1===n.async?t.send(n.data):window.setTimeout(function(){0!==t.readyState&&t.send(n.data)},0),t},runCallbacks:function(n){var i=n.request,t=n.config,f=t.scope?OpenLayers.Function.bind(t.callback,t.scope):t.callback,r,u;t.success&&(r=t.scope?OpenLayers.Function.bind(t.success,t.scope):t.success),t.failure&&(u=t.scope?OpenLayers.Function.bind(t.failure,t.scope):t.failure),"file:"==OpenLayers.Util.createUrlObject(t.url).protocol&&i.responseText&&(i.status=200),f(i),(!i.status||200<=i.status&&300>i.status)&&(this.events.triggerEvent("success",n),r&&r(i)),i.status&&(200>i.status||300<=i.status)&&(this.events.triggerEvent("failure",n),u&&u(i))},GET:function(n){return n=OpenLayers.Util.extend(n,{method:"GET"}),OpenLayers.Request.issue(n)},POST:function(n){return n=OpenLayers.Util.extend(n,{method:"POST"}),n.headers=n.headers?n.headers:{},"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(n.headers)||(n.headers["Content-Type"]="application/xml"),OpenLayers.Request.issue(n)},PUT:function(n){return n=OpenLayers.Util.extend(n,{method:"PUT"}),n.headers=n.headers?n.headers:{},"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(n.headers)||(n.headers["Content-Type"]="application/xml"),OpenLayers.Request.issue(n)},DELETE:function(n){return n=OpenLayers.Util.extend(n,{method:"DELETE"}),OpenLayers.Request.issue(n)},HEAD:function(n){return n=OpenLayers.Util.extend(n,{method:"HEAD"}),OpenLayers.Request.issue(n)},OPTIONS:function(n){return n=OpenLayers.Util.extend(n,{method:"OPTIONS"}),OpenLayers.Request.issue(n)}}),function(){function e(){this._object=i&&!s?new i:new window.ActiveXObject("Microsoft.XMLHTTP"),this._listeners=[]}function n(){return new e}function r(t){n.onreadystatechange&&n.onreadystatechange.apply(t),t.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function o(n){try{n.responseText=n._object.responseText}catch(e){}try{var u,r=n._object,i=r.responseXML,f=r.responseText;t&&f&&i&&!i.documentElement&&r.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)&&(i=new window.ActiveXObject("Microsoft.XMLDOM"),i.async=!1,i.validateOnParse=!1,i.loadXML(f)),u=i&&(t&&0!=i.parseError||!i.documentElement||i.documentElement&&"parsererror"==i.documentElement.tagName)?null:i,n.responseXML=u}catch(o){}try{n.status=n._object.status}catch(s){}try{n.statusText=n._object.statusText}catch(h){}}function u(n){n._object.onreadystatechange=new window.Function}var i=window.XMLHttpRequest,f=!!window.controllers,t=window.document.all&&!window.opera,s=t&&window.navigator.userAgent.match(/MSIE 7.0/);n.prototype=e.prototype,f&&i.wrapped&&(n.wrapped=i.wrapped),n.UNSENT=0,n.OPENED=1,n.HEADERS_RECEIVED=2,n.LOADING=3,n.DONE=4,n.prototype.readyState=n.UNSENT,n.prototype.responseText="",n.prototype.responseXML=null,n.prototype.status=0,n.prototype.statusText="",n.prototype.priority="NORMAL",n.prototype.onreadystatechange=null,n.onreadystatechange=null,n.onopen=null,n.onsend=null,n.onabort=null,n.prototype.open=function(i,e,s,h,c){delete this._headers,3>arguments.length&&(s=!0),this._async=s;var l=this,a=this.readyState,v;t&&s&&(v=function(){a!=n.DONE&&(u(l),l.abort())},window.attachEvent("onunload",v)),n.onopen&&n.onopen.apply(this,arguments),4<arguments.length?this._object.open(i,e,s,h,c):3<arguments.length?this._object.open(i,e,s,h):this._object.open(i,e,s),this.readyState=n.OPENED,r(this),this._object.onreadystatechange=function(){(!f||s)&&(l.readyState=l._object.readyState,o(l),l._aborted?l.readyState=n.UNSENT:(l.readyState==n.DONE&&(delete l._data,u(l),t&&s&&window.detachEvent("onunload",v)),a!=l.readyState&&r(l),a=l.readyState))}},n.prototype.send=function(t){n.onsend&&n.onsend.apply(this,arguments),arguments.length||(t=null),t&&t.nodeType&&(t=window.XMLSerializer?(new window.XMLSerializer).serializeToString(t):t.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")),this._data=t;n:if(this._object.send(this._data),f&&!this._async)for(this.readyState=n.OPENED,o(this);this.readyState<n.DONE;)if(this.readyState++,r(this),this._aborted)break n},n.prototype.abort=function(){n.onabort&&n.onabort.apply(this,arguments),this.readyState>n.UNSENT&&(this._aborted=!0),this._object.abort(),u(this),this.readyState=n.UNSENT,delete this._data},n.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()},n.prototype.getResponseHeader=function(n){return this._object.getResponseHeader(n)},n.prototype.setRequestHeader=function(n,t){return this._headers||(this._headers={}),this._headers[n]=t,this._object.setRequestHeader(n,t)},n.prototype.addEventListener=function(n,t,i){for(var u=0,r;r=this._listeners[u];u++)if(r[0]==n&&r[1]==t&&r[2]==i)return;this._listeners.push([n,t,i])},n.prototype.removeEventListener=function(n,t,i){for(var u=0,r;(r=this._listeners[u])&&(r[0]!=n||r[1]!=t||r[2]!=i);u++);r&&this._listeners.splice(u,1)},n.prototype.dispatchEvent=function(n){n={type:n.type,target:this,currentTarget:this,eventPhase:2,bubbles:n.bubbles,cancelable:n.cancelable,timeStamp:n.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}},"readystatechange"==n.type&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[n]);for(var i=0,t;t=this._listeners[i];i++)t[0]!=n.type||t[2]||(t[1].handleEvent||t[1]).apply(this,[n])},n.prototype.toString=function(){return"[object XMLHttpRequest]"},n.toString=function(){return"[XMLHttpRequest]"},window.Function.prototype.apply||(window.Function.prototype.apply=function(n,t){t||(t=[]),n.__func=this,n.__func(t[0],t[1],t[2],t[3],t[4]),delete n.__func}),OpenLayers.Request||(OpenLayers.Request={}),OpenLayers.Request.XMLHttpRequest=n}(),OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(n,t){OpenLayers.Util.extend(this,t),this.projCode=n,"object"==typeof Proj4js&&(this.proj=new Proj4js.Proj(n))},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(n){var t=!1;return n&&(n instanceof OpenLayers.Projection||(n=new OpenLayers.Projection(n)),"object"==typeof Proj4js&&this.proj.defData&&n.proj.defData?t=this.proj.defData.replace(this.titleRegEx,"")==n.proj.defData.replace(this.titleRegEx,""):n.getCode&&(t=this.getCode(),n=n.getCode(),t=t==n||!!OpenLayers.Projection.transforms[t]&&OpenLayers.Projection.transforms[t][n]===OpenLayers.Projection.nullTransform)),t},destroy:function(){delete this.proj,delete this.projCode},CLASS_NAME:"OpenLayers.Projection"}),OpenLayers.Projection.transforms={},OpenLayers.Projection.defaults={"EPSG:4326":{units:"degrees",maxExtent:[-180,-90,180,90],yx:!0},"CRS:84":{units:"degrees",maxExtent:[-180,-90,180,90]},"EPSG:900913":{units:"m",maxExtent:[-20037508.34,-20037508.34,20037508.34,20037508.34]}},OpenLayers.Projection.addTransform=function(n,t,i){if(i===OpenLayers.Projection.nullTransform){var r=OpenLayers.Projection.defaults[n];r&&!OpenLayers.Projection.defaults[t]&&(OpenLayers.Projection.defaults[t]=r)}OpenLayers.Projection.transforms[n]||(OpenLayers.Projection.transforms[n]={}),OpenLayers.Projection.transforms[n][t]=i},OpenLayers.Projection.transform=function(n,t,i){if(t&&i)if(t instanceof OpenLayers.Projection||(t=new OpenLayers.Projection(t)),i instanceof OpenLayers.Projection||(i=new OpenLayers.Projection(i)),t.proj&&i.proj)n=Proj4js.transform(t.proj,i.proj,n);else{t=t.getCode(),i=i.getCode();var r=OpenLayers.Projection.transforms;r[t]&&r[t][i]&&r[t][i](n)}return n},OpenLayers.Projection.nullTransform=function(n){return n},function(){function f(n){return n.x=180*n.x/t,n.y=180/Math.PI*(2*Math.atan(Math.exp(n.y/t*Math.PI))-Math.PI/2),n}function e(n){n.x=n.x*t/180;var i=Math.log(Math.tan((90+n.y)*Math.PI/360))/Math.PI*t;return n.y=Math.max(-20037508.34,Math.min(i,20037508.34)),n}function u(n,t){for(var u=OpenLayers.Projection.addTransform,c=OpenLayers.Projection.nullTransform,i,s,o,r=0,h=t.length;r<h;++r)for(i=t[r],u(n,i,e),u(i,n,f),o=r+1;o<h;++o)s=t[o],u(i,s,c),u(s,i,c)}for(var t=20037508.34,i=["EPSG:900913","EPSG:3857","EPSG:102113","EPSG:102100"],r=["CRS:84","urn:ogc:def:crs:EPSG:6.6:4326","EPSG:4326"],n=i.length-1;0<=n;--n)u(i[n],r);for(n=r.length-1;0<=n;--n)u(r[n],i)}(),OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{kml:"http://www.opengis.net/kml/2.2",gx:"http://www.google.com/kml/ext/2.2"},kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new Date,extractAttributes:!0,kvpAttributes:!1,extractStyles:!1,extractTracks:!1,trackAttributes:null,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(n){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},this.externalProjection=new OpenLayers.Projection("EPSG:4326"),OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){return this.features=[],this.styles={},this.fetched={},this.parseData(n,{depth:0,styleBaseUrl:this.styleBaseUrl})},parseData:function(n,t){var u,i;"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));for(var f=["Link","NetworkLink","Style","StyleMap","Placemark"],r=0,e=f.length;r<e;++r)if(u=f[r],i=this.getElementsByTagNameNS(n,"*",u),0!=i.length)switch(u.toLowerCase()){case"link":case"networklink":this.parseLinks(i,t);break;case"style":this.extractStyles&&this.parseStyles(i,t);break;case"stylemap":this.extractStyles&&this.parseStyleMaps(i,t);break;case"placemark":this.parseFeatures(i,t)}return this.features},parseLinks:function(n,t){var u,r,f,i;if(t.depth>=this.maxDepth)return!1;for(u=OpenLayers.Util.extend({},t),u.depth++,r=0,f=n.length;r<f;r++)i=this.parseProperty(n[r],"*","href"),i&&!this.fetched[i]&&(this.fetched[i]=!0,(i=this.fetchLink(i))&&this.parseData(i,u))},fetchLink:function(n){if(n=OpenLayers.Request.GET({url:n,async:!1}))return n.responseText},parseStyles:function(n,t){for(var r,i=0,u=n.length;i<u;i++)r=this.parseStyle(n[i]),r&&(this.styles[(t.styleBaseUrl||"")+"#"+r.id]=r)},parseKmlColor:function(n){var t=null;return n&&(n=n.match(this.regExes.kmlColor))&&(t={color:"#"+n[4]+n[3]+n[2],opacity:parseInt(n[1],16)/255}),t},parseStyle:function(n){for(var s,h,u,e,f,o,t={},l=["LineStyle","PolyStyle","IconStyle","BalloonStyle","LabelStyle"],i,r,c=0,a=l.length;c<a;++c)if(i=l[c],r=this.getElementsByTagNameNS(n,"*",i)[0])switch(i.toLowerCase()){case"linestyle":i=this.parseProperty(r,"*","color"),(i=this.parseKmlColor(i))&&(t.strokeColor=i.color,t.strokeOpacity=i.opacity),(i=this.parseProperty(r,"*","width"))&&(t.strokeWidth=i);break;case"polystyle":i=this.parseProperty(r,"*","color"),(i=this.parseKmlColor(i))&&(t.fillOpacity=i.opacity,t.fillColor=i.color),"0"==this.parseProperty(r,"*","fill")&&(t.fillColor="none"),"0"==this.parseProperty(r,"*","outline")&&(t.strokeWidth="0");break;case"iconstyle":s=parseFloat(this.parseProperty(r,"*","scale")||1),i=32*s,h=32*s,u=this.getElementsByTagNameNS(r,"*","Icon")[0],u&&(e=this.parseProperty(u,"*","href"),e&&(f=this.parseProperty(u,"*","w"),o=this.parseProperty(u,"*","h"),!OpenLayers.String.startsWith(e,"http://maps.google.com/mapfiles/kml")||f||o||(o=f=64,s/=2),f=f||o,o=o||f,f&&(i=parseInt(f)*s),o&&(h=parseInt(o)*s),(o=e.match(this.regExes.kmlIconPalette))&&(f=o[1],o=o[2],e=this.parseProperty(u,"*","x"),u=this.parseProperty(u,"*","y"),e="http://maps.google.com/mapfiles/kml/pal"+f+"/icon"+(8*(u?7-u/32:7)+(e?e/32:0))+o),t.graphicOpacity=1,t.externalGraphic=e)),(r=this.getElementsByTagNameNS(r,"*","hotSpot")[0])&&(e=parseFloat(r.getAttribute("x")),u=parseFloat(r.getAttribute("y")),f=r.getAttribute("xunits"),"pixels"==f?t.graphicXOffset=-e*s:"insetPixels"==f?t.graphicXOffset=-i+e*s:"fraction"==f&&(t.graphicXOffset=-i*e),r=r.getAttribute("yunits"),"pixels"==r?t.graphicYOffset=-h+u*s+1:"insetPixels"==r?t.graphicYOffset=-(u*s)+1:"fraction"==r&&(t.graphicYOffset=-h*(1-u)+1)),t.graphicWidth=i,t.graphicHeight=h;break;case"balloonstyle":(r=OpenLayers.Util.getXmlNodeValue(r))&&(t.balloonStyle=r.replace(this.regExes.straightBracket,"${$1}"));break;case"labelstyle":(i=this.parseProperty(r,"*","color"),i=this.parseKmlColor(i))&&(t.fontColor=i.color,t.fontOpacity=i.opacity)}return!t.strokeColor&&t.fillColor&&(t.strokeColor=t.fillColor),(n=n.getAttribute("id"))&&t&&(t.id=n),t},parseStyleMaps:function(n,t){for(var i,s,r=0,e=n.length;r<e;r++)for(var u=n[r],o=this.getElementsByTagNameNS(u,"*","Pair"),u=u.getAttribute("id"),f=0,h=o.length;f<h;f++)i=o[f],s=this.parseProperty(i,"*","key"),(i=this.parseProperty(i,"*","styleUrl"))&&"normal"==s&&(this.styles[(t.styleBaseUrl||"")+"#"+u]=this.styles[(t.styleBaseUrl||"")+i])},parseFeatures:function(n,t){for(var r,i,u,f=[],e=0,o=n.length;e<o;e++)if(r=n[e],i=this.parseFeature.apply(this,[r]),i)this.extractStyles&&i.attributes&&i.attributes.styleUrl&&(i.style=this.getStyle(i.attributes.styleUrl,t)),this.extractStyles&&(u=this.getElementsByTagNameNS(r,"*","Style")[0],u&&(u=this.parseStyle(u))&&(i.style=OpenLayers.Util.extend(i.style,u))),this.extractTracks?(r=this.getElementsByTagNameNS(r,this.namespaces.gx,"Track"))&&0<r.length&&(i={features:[],feature:i},this.readNode(r[0],i),0<i.features.length&&f.push.apply(f,i.features)):f.push(i);else throw"Bad Placemark: "+e;this.features=this.features.concat(f)},readers:{kml:{when:function(n,t){t.whens.push(OpenLayers.Date.parse(this.getChildValue(n)))},_trackPointAttribute:function(n,t){var i=n.nodeName.split(":").pop();t.attributes[i].push(this.getChildValue(n))}},gx:{Track:function(n,t){var i={whens:[],points:[],angles:[]},r,s,u,f,e,o,h;if(this.trackAttributes)for(i.attributes={},f=0,e=this.trackAttributes.length;f<e;++f)r=this.trackAttributes[f],i.attributes[r]=[],r in this.readers.kml||(this.readers.kml[r]=this.readers.kml._trackPointAttribute);if(this.readChildNodes(n,i),i.whens.length!==i.points.length)throw Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:coord ("+i.points.length+") elements.");if(s=0<i.angles.length,s&&i.whens.length!==i.angles.length)throw Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:angles ("+i.angles.length+") elements.");for(f=0,e=i.whens.length;f<e;++f){if(u=t.feature.clone(),u.fid=t.feature.fid||t.feature.id,r=i.points[f],u.geometry=r,"z"in r&&(u.attributes.altitude=r.z),this.internalProjection&&this.externalProjection&&u.geometry.transform(this.externalProjection,this.internalProjection),this.trackAttributes)for(o=0,h=this.trackAttributes.length;o<h;++o)r=this.trackAttributes[o],u.attributes[r]=i.attributes[r][f];u.attributes.when=i.whens[f],u.attributes.trackId=t.feature.id,s&&(r=i.angles[f],u.attributes.heading=parseFloat(r[0]),u.attributes.tilt=parseFloat(r[1]),u.attributes.roll=parseFloat(r[2])),t.features.push(u)}},coord:function(n,t){var i=this.getChildValue(n).replace(this.regExes.trimSpace,"").split(/\s+/),r=new OpenLayers.Geometry.Point(i[0],i[1]);2<i.length&&(r.z=parseFloat(i[2])),t.points.push(r)},angles:function(n,t){var i=this.getChildValue(n).replace(this.regExes.trimSpace,"").split(/\s+/);t.angles.push(i)}}},parseFeature:function(n){for(var e,i=["MultiGeometry","Polygon","LineString","Point"],t,r,u,f=0,o=i.length;f<o;++f)if(t=i[f],this.internalns=n.namespaceURI?n.namespaceURI:this.kmlns,r=this.getElementsByTagNameNS(n,this.internalns,t),0<r.length){if(i=this.parseGeometry[t.toLowerCase()])u=i.apply(this,[r[0]]),this.internalProjection&&this.externalProjection&&u.transform(this.externalProjection,this.internalProjection);else throw new TypeError("Unsupported geometry type: "+t);break}return this.extractAttributes&&(e=this.parseAttributes(n)),t=new OpenLayers.Feature.Vector(u,e),n=n.getAttribute("id")||n.getAttribute("name"),null!=n&&(t.fid=n),t},getStyle:function(n,t){var i=OpenLayers.Util.removeTail(n),r=OpenLayers.Util.extend({},t);return r.depth++,r.styleBaseUrl=i,!this.styles[n]&&!OpenLayers.String.startsWith(n,"#")&&r.depth<=this.maxDepth&&!this.fetched[i]&&(i=this.fetchLink(i))&&this.parseData(i,r),OpenLayers.Util.extend({},this.styles[n])},parseGeometry:{point:function(n){var t=this.getElementsByTagNameNS(n,this.internalns,"coordinates"),i;if(n=[],0<t.length&&(i=t[0].firstChild.nodeValue,i=i.replace(this.regExes.removeSpace,""),n=i.split(",")),t=null,1<n.length)2==n.length&&(n[2]=null),t=new OpenLayers.Geometry.Point(n[0],n[1],n[2]);else throw"Bad coordinate string: "+i;return t},linestring:function(n,t){var r=this.getElementsByTagNameNS(n,this.internalns,"coordinates"),u=null;if(0<r.length){for(var r=this.getChildValue(r[0]),r=r.replace(this.regExes.trimSpace,""),r=r.replace(this.regExes.trimComma,","),u=r.split(this.regExes.splitSpace),e=u.length,o=Array(e),i,s,f=0;f<e;++f)if(i=u[f].split(","),s=i.length,1<s)2==i.length&&(i[2]=null),o[f]=new OpenLayers.Geometry.Point(i[0],i[1],i[2]);else throw"Bad LineString point coordinates: "+u[f];if(e)u=t?new OpenLayers.Geometry.LinearRing(o):new OpenLayers.Geometry.LineString(o);else throw"Bad LineString coordinates: "+r;}return u},polygon:function(n){var i,r,t,u;if(n=this.getElementsByTagNameNS(n,this.internalns,"LinearRing"),i=n.length,r=Array(i),0<i)for(t=0,u=n.length;t<u;++t)if(i=this.parseGeometry.linestring.apply(this,[n[t],!0]))r[t]=i;else throw"Bad LinearRing geometry: "+t;return new OpenLayers.Geometry.Polygon(r)},multigeometry:function(n){for(var t,r=[],u=n.childNodes,i=0,f=u.length;i<f;++i)n=u[i],1==n.nodeType&&(t=n.prefix?n.nodeName.split(":")[1]:n.nodeName,(t=this.parseGeometry[t.toLowerCase()])&&r.push(t.apply(this,[n])));return new OpenLayers.Geometry.Collection(r)}},parseAttributes:function(n){var f={},u=n.getElementsByTagName("ExtendedData"),r,i,t,e;for(u.length&&(f=this.parseExtendedData(u[0])),n=n.childNodes,u=0,e=n.length;u<e;++u)if(r=n[u],1==r.nodeType&&(i=r.childNodes,1<=i.length&&3>=i.length)){switch(i.length){case 1:t=i[0];break;case 2:t=i[0],i=i[1],t=3==t.nodeType||4==t.nodeType?t:i;break;default:t=i[1]}(3==t.nodeType||4==t.nodeType)&&(r=r.prefix?r.nodeName.split(":")[1]:r.nodeName,t=OpenLayers.Util.getXmlNodeValue(t))&&(t=t.replace(this.regExes.trimSpace,""),f[r]=t)}return f},parseExtendedData:function(n){for(var f={},t,u,s=n.getElementsByTagName("Data"),i,o,r=0,e=s.length;r<e;r++)t=s[r],u=t.getAttribute("name"),i={},o=t.getElementsByTagName("value"),o.length&&(i.value=this.getChildValue(o[0])),this.kvpAttributes?f[u]=i.value:(t=t.getElementsByTagName("displayName"),t.length&&(i.displayName=this.getChildValue(t[0])),f[u]=i);for(n=n.getElementsByTagName("SimpleData"),r=0,e=n.length;r<e;r++)i={},t=n[r],u=t.getAttribute("name"),i.value=this.getChildValue(t),this.kvpAttributes?f[u]=i.value:(i.displayName=u,f[u]=i);return f},parseProperty:function(n,t,i){var r;n=this.getElementsByTagNameNS(n,t,i);try{r=OpenLayers.Util.getXmlNodeValue(n[0])}catch(u){r=null}return r},write:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var i=this.createElementNS(this.kmlns,"kml"),r=this.createFolderXML(),t=0,u=n.length;t<u;++t)r.appendChild(this.createPlacemarkXML(n[t]));return i.appendChild(r),OpenLayers.Format.XML.prototype.write.apply(this,[i])},createFolderXML:function(){var i=this.createElementNS(this.kmlns,"Folder"),n,t;return this.foldersName&&(n=this.createElementNS(this.kmlns,"name"),t=this.createTextNode(this.foldersName),n.appendChild(t),i.appendChild(n)),this.foldersDesc&&(n=this.createElementNS(this.kmlns,"description"),t=this.createTextNode(this.foldersDesc),n.appendChild(t),i.appendChild(n)),i},createPlacemarkXML:function(n){var i=this.createElementNS(this.kmlns,"name"),t=n.style&&n.style.label?n.style.label:n.id,r;return i.appendChild(this.createTextNode(n.attributes.name||t)),r=this.createElementNS(this.kmlns,"description"),r.appendChild(this.createTextNode(n.attributes.description||this.placemarksDesc)),t=this.createElementNS(this.kmlns,"Placemark"),null!=n.fid&&t.setAttribute("id",n.fid),t.appendChild(i),t.appendChild(r),i=this.buildGeometryNode(n.geometry),t.appendChild(i),n.attributes&&(n=this.buildExtendedData(n.attributes))&&t.appendChild(n),t},buildGeometryNode:function(n){var t=n.CLASS_NAME,t=t.substring(t.lastIndexOf(".")+1),t=this.buildGeometry[t.toLowerCase()],i=null;return t&&(i=t.apply(this,[n])),i},buildGeometry:{point:function(n){var t=this.createElementNS(this.kmlns,"Point");return t.appendChild(this.buildCoordinatesNode(n)),t},multipoint:function(n){return this.buildGeometry.collection.apply(this,[n])},linestring:function(n){var t=this.createElementNS(this.kmlns,"LineString");return t.appendChild(this.buildCoordinatesNode(n)),t},multilinestring:function(n){return this.buildGeometry.collection.apply(this,[n])},linearring:function(n){var t=this.createElementNS(this.kmlns,"LinearRing");return t.appendChild(this.buildCoordinatesNode(n)),t},polygon:function(n){var r=this.createElementNS(this.kmlns,"Polygon"),t,u,i,f;for(n=n.components,i=0,f=n.length;i<f;++i)t=0==i?"outerBoundaryIs":"innerBoundaryIs",t=this.createElementNS(this.kmlns,t),u=this.buildGeometry.linearring.apply(this,[n[i]]),t.appendChild(u),r.appendChild(t);return r},multipolygon:function(n){return this.buildGeometry.collection.apply(this,[n])},collection:function(n){for(var i=this.createElementNS(this.kmlns,"MultiGeometry"),r,t=0,u=n.components.length;t<u;++t)(r=this.buildGeometryNode.apply(this,[n.components[t]]))&&i.appendChild(r);return i}},buildCoordinatesNode:function(n){var r=this.createElementNS(this.kmlns,"coordinates"),t;if(t=n.components){for(var u=t.length,f=Array(u),i=0;i<u;++i)n=t[i],f[i]=this.buildCoordinates(n);t=f.join(" ")}else t=this.buildCoordinates(n);return t=this.createTextNode(t),r.appendChild(t),r},buildCoordinates:function(n){return this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection)),n.x+","+n.y},buildExtendedData:function(n){var u=this.createElementNS(this.kmlns,"ExtendedData"),t,i,r,f;for(t in n)n[t]&&"name"!=t&&"description"!=t&&"styleUrl"!=t&&(i=this.createElementNS(this.kmlns,"Data"),i.setAttribute("name",t),r=this.createElementNS(this.kmlns,"value"),"object"==typeof n[t]?(n[t].value&&r.appendChild(this.createTextNode(n[t].value)),n[t].displayName)&&(f=this.createElementNS(this.kmlns,"displayName"),f.appendChild(this.getXMLDoc().createCDATASection(n[t].displayName)),i.appendChild(f)):r.appendChild(this.createTextNode(n[t])),i.appendChild(r),u.appendChild(i));return this.isSimpleContent(u)?null:u},CLASS_NAME:"OpenLayers.Format.KML"}),OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],split:function(n,t){for(var o,e,v,c=null,l=t&&t.mutual,f,s,r,a,i=[],u=[n],h=0,y=this.components.length;h<y;++h){for(s=this.components[h],r=!1,o=0;o<u.length;++o)if(f=s.split(u[o],t)){if(l){for(r=f[0],e=0,v=r.length;e<v;++e)0===e&&i.length?i[i.length-1].addComponent(r[e]):i.push(new OpenLayers.Geometry.MultiLineString([r[e]]));r=!0,f=f[1]}if(f.length){f.unshift(o,1),Array.prototype.splice.apply(u,f);break}}r||(i.length?i[i.length-1].addComponent(s.clone()):i=[new OpenLayers.Geometry.MultiLineString(s.clone())])}return i&&1<i.length?r=!0:i=[],u&&1<u.length?a=!0:u=[],(r||a)&&(c=l?[i,u]:u),c},splitWith:function(n,t){var h=null,c=t&&t.mutual,u,o,i,l,f,r,s,a,e,v;if(n instanceof OpenLayers.Geometry.LineString)for(r=[],f=[n],s=0,a=this.components.length;s<a;++s){for(i=!1,o=this.components[s],e=0;e<f.length;++e)if(u=f[e].split(o,t)){for(c&&(i=u[0],i.length&&(i.unshift(e,1),Array.prototype.splice.apply(f,i),e+=i.length-2),u=u[1],0===u.length&&(u=[o.clone()])),i=0,v=u.length;i<v;++i)0===i&&r.length?r[r.length-1].addComponent(u[i]):r.push(new OpenLayers.Geometry.MultiLineString([u[i]]));i=!0}i||(r.length?r[r.length-1].addComponent(o.clone()):r=[new OpenLayers.Geometry.MultiLineString([o.clone()])])}else h=n.split(this);return f&&1<f.length?l=!0:f=[],r&&1<r.length?i=!0:r=[],(l||i)&&(h=c?[f,r]:r),h},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"}),OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"}),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:!0,xy:!0,initialize:function(n){this.regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var i,t,r;for("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n=this.getElementsByTagNameNS(n.documentElement,this.gmlns,this.featureName),i=[],t=0;t<n.length;t++)r=this.parseFeature(n[t]),r&&i.push(r);return i},parseFeature:function(n){for(var r,f,e,o,u,s,t="MultiPolygon Polygon MultiLineString LineString MultiPoint Point Envelope".split(" "),i=0;i<t.length;++i)if(r=t[i],f=this.getElementsByTagNameNS(n,this.gmlns,r),0<f.length){if(e=this.parseGeometry[r.toLowerCase()])e=e.apply(this,[f[0]]),this.internalProjection&&this.externalProjection&&e.transform(this.externalProjection,this.internalProjection);else throw new TypeError("Unsupported geometry type: "+r);break}for(r=this.getElementsByTagNameNS(n,this.gmlns,"Box"),i=0;i<r.length;++i)t=r[i],f=this.parseGeometry.box.apply(this,[t]),t=t.parentNode,"boundedBy"===(t.localName||t.nodeName.split(":").pop())?o=f:e=f.toGeometry();for(this.extractAttributes&&(u=this.parseAttributes(n)),u=new OpenLayers.Feature.Vector(e,u),u.bounds=o,u.gml={featureType:n.firstChild.nodeName.split(":")[1],featureNS:n.firstChild.namespaceURI,featureNSPrefix:n.firstChild.prefix},n=n.firstChild;n&&(1!=n.nodeType||!(s=n.getAttribute("fid")||n.getAttribute("id")));)n=n.nextSibling;return u.fid=s,u},parseGeometry:{point:function(n){var i,t;return t=[],i=this.getElementsByTagNameNS(n,this.gmlns,"pos"),0<i.length&&(t=i[0].firstChild.nodeValue,t=t.replace(this.regExes.trimSpace,""),t=t.split(this.regExes.splitSpace)),0==t.length&&(i=this.getElementsByTagNameNS(n,this.gmlns,"coordinates"),0<i.length&&(t=i[0].firstChild.nodeValue,t=t.replace(this.regExes.removeSpace,""),t=t.split(","))),0==t.length&&(i=this.getElementsByTagNameNS(n,this.gmlns,"coord"),0<i.length&&(n=this.getElementsByTagNameNS(i[0],this.gmlns,"X"),i=this.getElementsByTagNameNS(i[0],this.gmlns,"Y"),0<n.length&&0<i.length&&(t=[n[0].firstChild.nodeValue,i[0].firstChild.nodeValue]))),2==t.length&&(t[2]=null),this.xy?new OpenLayers.Geometry.Point(t[0],t[1],t[2]):new OpenLayers.Geometry.Point(t[1],t[0],t[2])},multipoint:function(n){var i,r,t;if(n=this.getElementsByTagNameNS(n,this.gmlns,"Point"),i=[],0<n.length)for(t=0;t<n.length;++t)(r=this.parseGeometry.point.apply(this,[n[t]]))&&i.push(r);return new OpenLayers.Geometry.MultiPoint(i)},linestring:function(n,t){var r,i,u,f,e,o,s;if(i=[],u=[],r=this.getElementsByTagNameNS(n,this.gmlns,"posList"),0<r.length)for(i=this.getChildValue(r[0]),i=i.replace(this.regExes.trimSpace,""),i=i.split(this.regExes.splitSpace),f=parseInt(r[0].getAttribute("dimension")),r=0;r<i.length/f;++r)e=r*f,o=i[e],s=i[e+1],e=2==f?null:i[e+2],this.xy?u.push(new OpenLayers.Geometry.Point(o,s,e)):u.push(new OpenLayers.Geometry.Point(s,o,e));if(0==i.length&&(r=this.getElementsByTagNameNS(n,this.gmlns,"coordinates"),0<r.length))for(i=this.getChildValue(r[0]),i=i.replace(this.regExes.trimSpace,""),i=i.replace(this.regExes.trimComma,","),f=i.split(this.regExes.splitSpace),r=0;r<f.length;++r)i=f[r].split(","),2==i.length&&(i[2]=null),this.xy?u.push(new OpenLayers.Geometry.Point(i[0],i[1],i[2])):u.push(new OpenLayers.Geometry.Point(i[1],i[0],i[2]));return i=null,0!=u.length&&(i=t?new OpenLayers.Geometry.LinearRing(u):new OpenLayers.Geometry.LineString(u)),i},multilinestring:function(n){var i,r,t;if(n=this.getElementsByTagNameNS(n,this.gmlns,"LineString"),i=[],0<n.length)for(t=0;t<n.length;++t)(r=this.parseGeometry.linestring.apply(this,[n[t]]))&&i.push(r);return new OpenLayers.Geometry.MultiLineString(i)},polygon:function(n){var i,r,t;if(n=this.getElementsByTagNameNS(n,this.gmlns,"LinearRing"),i=[],0<n.length)for(t=0;t<n.length;++t)(r=this.parseGeometry.linestring.apply(this,[n[t],!0]))&&i.push(r);return new OpenLayers.Geometry.Polygon(i)},multipolygon:function(n){var i,r,t;if(n=this.getElementsByTagNameNS(n,this.gmlns,"Polygon"),i=[],0<n.length)for(t=0;t<n.length;++t)(r=this.parseGeometry.polygon.apply(this,[n[t]]))&&i.push(r);return new OpenLayers.Geometry.MultiPolygon(i)},envelope:function(n){var i=[],t,e,f=this.getElementsByTagNameNS(n,this.gmlns,"lowerCorner"),r,u;return 0<f.length&&(t=[],0<f.length&&(t=f[0].firstChild.nodeValue,t=t.replace(this.regExes.trimSpace,""),t=t.split(this.regExes.splitSpace)),2==t.length&&(t[2]=null),r=this.xy?new OpenLayers.Geometry.Point(t[0],t[1],t[2]):new OpenLayers.Geometry.Point(t[1],t[0],t[2])),n=this.getElementsByTagNameNS(n,this.gmlns,"upperCorner"),0<n.length&&(t=[],0<n.length&&(t=n[0].firstChild.nodeValue,t=t.replace(this.regExes.trimSpace,""),t=t.split(this.regExes.splitSpace)),2==t.length&&(t[2]=null),u=this.xy?new OpenLayers.Geometry.Point(t[0],t[1],t[2]):new OpenLayers.Geometry.Point(t[1],t[0],t[2])),r&&u&&(i.push(new OpenLayers.Geometry.Point(r.x,r.y)),i.push(new OpenLayers.Geometry.Point(u.x,r.y)),i.push(new OpenLayers.Geometry.Point(u.x,u.y)),i.push(new OpenLayers.Geometry.Point(r.x,u.y)),i.push(new OpenLayers.Geometry.Point(r.x,r.y)),i=new OpenLayers.Geometry.LinearRing(i),e=new OpenLayers.Geometry.Polygon([i])),e},box:function(n){var t=this.getElementsByTagNameNS(n,this.gmlns,"coordinates"),i=n=null;return 0<t.length&&(t=t[0].firstChild.nodeValue,t=t.split(" "),2==t.length&&(n=t[0].split(","),i=t[1].split(","))),null!==n&&null!==i?new OpenLayers.Bounds(parseFloat(n[0]),parseFloat(n[1]),parseFloat(i[0]),parseFloat(i[1])):void 0}},parseAttributes:function(n){var u={},r,t,i;for(n=n.firstChild;n;){if(1==n.nodeType){for(n=n.childNodes,r=0;r<n.length;++r)(t=n[r],1==t.nodeType)&&((i=t.childNodes,1==i.length)?(i=i[0],3==i.nodeType||4==i.nodeType)&&(t=t.prefix?t.nodeName.split(":")[1]:t.nodeName,i=i.nodeValue.replace(this.regExes.trimSpace,""),u[t]=i):u[t.nodeName.split(":").pop()]=null);break}n=n.nextSibling}return u},write:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var i=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName),t=0;t<n.length;t++)i.appendChild(this.createFeatureXML(n[t]));return OpenLayers.Format.XML.prototype.write.apply(this,[i])},createFeatureXML:function(n){var i=this.buildGeometryNode(n.geometry),u=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName),t,r;u.appendChild(i),i=this.createElementNS(this.gmlns,"gml:"+this.featureName),t=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName),t.setAttribute("fid",n.fid||n.id),t.appendChild(u);for(r in n.attributes){var u=this.createTextNode(n.attributes[r]),f=r.substring(r.lastIndexOf(":")+1),f=this.createElementNS(this.featureNS,this.featurePrefix+":"+f);f.appendChild(u),t.appendChild(f)}return i.appendChild(t),i},buildGeometryNode:function(n){this.externalProjection&&this.internalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection));var t=n.CLASS_NAME,t=t.substring(t.lastIndexOf(".")+1);return this.buildGeometry[t.toLowerCase()].apply(this,[n])},buildGeometry:{point:function(n){var t=this.createElementNS(this.gmlns,"gml:Point");return t.appendChild(this.buildCoordinatesNode(n)),t},multipoint:function(n){var r=this.createElementNS(this.gmlns,"gml:MultiPoint"),i,u,t;for(n=n.components,t=0;t<n.length;t++)i=this.createElementNS(this.gmlns,"gml:pointMember"),u=this.buildGeometry.point.apply(this,[n[t]]),i.appendChild(u),r.appendChild(i);return r},linestring:function(n){var t=this.createElementNS(this.gmlns,"gml:LineString");return t.appendChild(this.buildCoordinatesNode(n)),t},multilinestring:function(n){var r=this.createElementNS(this.gmlns,"gml:MultiLineString"),i,u,t;for(n=n.components,t=0;t<n.length;++t)i=this.createElementNS(this.gmlns,"gml:lineStringMember"),u=this.buildGeometry.linestring.apply(this,[n[t]]),i.appendChild(u),r.appendChild(i);return r},linearring:function(n){var t=this.createElementNS(this.gmlns,"gml:LinearRing");return t.appendChild(this.buildCoordinatesNode(n)),t},polygon:function(n){var r=this.createElementNS(this.gmlns,"gml:Polygon"),t,u,i;for(n=n.components,i=0;i<n.length;++i)t=0==i?"outerBoundaryIs":"innerBoundaryIs",t=this.createElementNS(this.gmlns,"gml:"+t),u=this.buildGeometry.linearring.apply(this,[n[i]]),t.appendChild(u),r.appendChild(t);return r},multipolygon:function(n){var r=this.createElementNS(this.gmlns,"gml:MultiPolygon"),i,u,t;for(n=n.components,t=0;t<n.length;++t)i=this.createElementNS(this.gmlns,"gml:polygonMember"),u=this.buildGeometry.polygon.apply(this,[n[t]]),i.appendChild(u),r.appendChild(i);return r},bounds:function(n){var t=this.createElementNS(this.gmlns,"gml:Box");return t.appendChild(this.buildCoordinatesNode(n)),t}},buildCoordinatesNode:function(n){var i=this.createElementNS(this.gmlns,"gml:coordinates"),t,r;if(i.setAttribute("decimal","."),i.setAttribute("cs",","),i.setAttribute("ts"," "),t=[],n instanceof OpenLayers.Bounds)t.push(n.left+","+n.bottom),t.push(n.right+","+n.top);else for(n=n.components?n.components:[n],r=0;r<n.length;r++)t.push(n[r].x+","+n[r].y);return t=this.createTextNode(t.join(" ")),i.appendChild(t),i},CLASS_NAME:"OpenLayers.Format.GML"}),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:!0,srsName:null,xy:!0,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,featureMember:/^(.*:)?featureMembers?$/},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]),this.setGeometryTypes(),n&&n.featureNS&&this.setNamespace("feature",n.featureNS),this.singleFeatureType=!n||"string"==typeof n.featureType},read:function(n){var i,t,r;if("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement),i=[],this.readNode(n,{features:i},!0),0==i.length)if(t=this.getElementsByTagNameNS(n,this.namespaces.gml,"featureMember"),t.length)for(n=0,r=t.length;n<r;++n)this.readNode(t[n],{features:i},!0);else t=this.getElementsByTagNameNS(n,this.namespaces.gml,"featureMembers"),t.length&&this.readNode(t[0],{features:i},!0);return i},readNode:function(n,t,i){return!0===i&&!0===this.autoConfig&&(this.featureType=null,delete this.namespaceAlias[this.featureNS],delete this.namespaces.feature,this.featureNS=null),this.featureNS||n.prefix in this.namespaces||n.parentNode.namespaceURI!=this.namespaces.gml||!this.regExes.featureMember.test(n.parentNode.nodeName)||(this.featureType=n.nodeName.split(":").pop(),this.setNamespace("feature",n.namespaceURI),this.featureNS=n.namespaceURI,this.autoConfig=!0),OpenLayers.Format.XML.prototype.readNode.apply(this,[n,t])},readers:{gml:{_inherit:function(){},featureMember:function(n,t){this.readChildNodes(n,t)},featureMembers:function(n,t){this.readChildNodes(n,t)},name:function(n,t){t.name=this.getChildValue(n)},boundedBy:function(n,t){var i={};this.readChildNodes(n,i),i.components&&0<i.components.length&&(t.bounds=i.components[0])},Point:function(n,t){var i={points:[]};this.readChildNodes(n,i),t.components||(t.components=[]),t.components.push(i.points[0])},coordinates:function(n,t){for(var r=this.getChildValue(n).replace(this.regExes.trimSpace,""),r=r.replace(this.regExes.trimComma,","),r=r.split(this.regExes.splitSpace),i,f=r.length,e=Array(f),u=0;u<f;++u)i=r[u].split(","),e[u]=this.xy?new OpenLayers.Geometry.Point(i[0],i[1],i[2]):new OpenLayers.Geometry.Point(i[1],i[0],i[2]);t.points=e},coord:function(n,t){var i={};this.readChildNodes(n,i),t.points||(t.points=[]),t.points.push(new OpenLayers.Geometry.Point(i.x,i.y,i.z))},X:function(n,t){t.x=this.getChildValue(n)},Y:function(n,t){t.y=this.getChildValue(n)},Z:function(n,t){t.z=this.getChildValue(n)},MultiPoint:function(n,t){var i={components:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),t.components=[new OpenLayers.Geometry.MultiPoint(i.components)]},pointMember:function(n,t){this.readChildNodes(n,t)},LineString:function(n,t){var i={};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.LineString(i.points))},MultiLineString:function(n,t){var i={components:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),t.components=[new OpenLayers.Geometry.MultiLineString(i.components)]},lineStringMember:function(n,t){this.readChildNodes(n,t)},Polygon:function(n,t){var i={outer:null,inner:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),i.inner.unshift(i.outer),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.Polygon(i.inner))},LinearRing:function(n,t){var i={};this.readers.gml._inherit.apply(this,[n,i]),this.readChildNodes(n,i),t.components=[new OpenLayers.Geometry.LinearRing(i.points)]},MultiPolygon:function(n,t){var i={components:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)]},polygonMember:function(n,t){this.readChildNodes(n,t)},GeometryCollection:function(n,t){var i={components:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),t.components=[new OpenLayers.Geometry.Collection(i.components)]},geometryMember:function(n,t){this.readChildNodes(n,t)}},feature:{"*":function(n,t){var i,r=n.localName||n.nodeName.split(":").pop();t.features?this.singleFeatureType||-1===OpenLayers.Util.indexOf(this.featureType,r)?r===this.featureType&&(i="_typeName"):i="_typeName":0==n.childNodes.length||1==n.childNodes.length&&3==n.firstChild.nodeType?this.extractAttributes&&(i="_attribute"):i="_geometry",i&&this.readers.feature[i].apply(this,[n,t])},_typeName:function(n,t){var i={components:[],attributes:{}},r,u;this.readChildNodes(n,i),i.name&&(i.attributes.name=i.name),r=new OpenLayers.Feature.Vector(i.components[0],i.attributes),this.singleFeatureType||(r.type=n.nodeName.split(":").pop(),r.namespace=n.namespaceURI),u=n.getAttribute("fid")||this.getAttributeNS(n,this.namespaces.gml,"id"),u&&(r.fid=u),this.internalProjection&&this.externalProjection&&r.geometry&&r.geometry.transform(this.externalProjection,this.internalProjection),i.bounds&&(r.bounds=i.bounds),t.features.push(r)},_geometry:function(n,t){this.geometryName||(this.geometryName=n.nodeName.split(":").pop()),this.readChildNodes(n,t)},_attribute:function(n,t){var i=n.localName||n.nodeName.split(":").pop(),r=this.getChildValue(n);t.attributes[i]=r}},wfs:{FeatureCollection:function(n,t){this.readChildNodes(n,t)}}},write:function(n){var t;return t=OpenLayers.Util.isArray(n)?"featureMembers":"featureMember",n=this.writeNode("gml:"+t,n),this.setAttributeNS(n,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[n])},writers:{gml:{featureMember:function(n){var t=this.createElementNSPlus("gml:featureMember");return this.writeNode("feature:_typeName",n,t),t},MultiPoint:function(n){var i=this.createElementNSPlus("gml:MultiPoint"),t,r;for(n=n.components||[n],t=0,r=n.length;t<r;++t)this.writeNode("pointMember",n[t],i);return i},pointMember:function(n){var t=this.createElementNSPlus("gml:pointMember");return this.writeNode("Point",n,t),t},MultiLineString:function(n){var i=this.createElementNSPlus("gml:MultiLineString"),t,r;for(n=n.components||[n],t=0,r=n.length;t<r;++t)this.writeNode("lineStringMember",n[t],i);return i},lineStringMember:function(n){var t=this.createElementNSPlus("gml:lineStringMember");return this.writeNode("LineString",n,t),t},MultiPolygon:function(n){var i=this.createElementNSPlus("gml:MultiPolygon"),t,r;for(n=n.components||[n],t=0,r=n.length;t<r;++t)this.writeNode("polygonMember",n[t],i);return i},polygonMember:function(n){var t=this.createElementNSPlus("gml:polygonMember");return this.writeNode("Polygon",n,t),t},GeometryCollection:function(n){for(var i=this.createElementNSPlus("gml:GeometryCollection"),t=0,r=n.components.length;t<r;++t)this.writeNode("geometryMember",n.components[t],i);return i},geometryMember:function(n){var t=this.createElementNSPlus("gml:geometryMember");return n=this.writeNode("feature:_geometry",n),t.appendChild(n.firstChild),t}},feature:{_typeName:function(n){var t=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:n.fid}}),i,r;n.geometry&&this.writeNode("feature:_geometry",n.geometry,t);for(i in n.attributes)r=n.attributes[i],null!=r&&this.writeNode("feature:_attribute",{name:i,value:r},t);return t},_geometry:function(n){this.externalProjection&&this.internalProjection&&(n=n.clone().transform(this.internalProjection,this.externalProjection));var t=this.createElementNSPlus("feature:"+this.geometryName);return n=this.writeNode("gml:"+this.geometryTypes[n.CLASS_NAME],n,t),this.srsName&&n.setAttribute("srsName",this.srsName),t},_attribute:function(n){return this.createElementNSPlus("feature:"+n.name,{value:n.value})}},wfs:{FeatureCollection:function(n){for(var i=this.createElementNSPlus("wfs:FeatureCollection"),t=0,r=n.length;t<r;++t)this.writeNode("gml:featureMember",n[t],i);return i}}},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.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(n){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[n])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(n,t){var i={};this.readChildNodes(n,i),t.outer=i.components[0]},innerBoundaryIs:function(n,t){var i={};this.readChildNodes(n,i),t.inner.push(i.components[0])},Box:function(n,t){var i={},r;this.readChildNodes(n,i),t.components||(t.components=[]),r=i.points[0],i=i.points[1],t.components.push(new OpenLayers.Bounds(r.x,r.y,i.x,i.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(n){var t;return t=OpenLayers.Util.isArray(n)?"wfs:FeatureCollection":"gml:featureMember",n=this.writeNode(t,n),this.setAttributeNS(n,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[n])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(n){var t=this.createElementNSPlus("gml:Point");return this.writeNode("coordinates",[n],t),t},coordinates:function(n){for(var u=n.length,r=Array(u),t,i=0;i<u;++i)t=n[i],r[i]=this.xy?t.x+","+t.y:t.y+","+t.x,void 0!=t.z&&(r[i]+=","+t.z);return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:1==u?r[0]:r.join(" ")})},LineString:function(n){var t=this.createElementNSPlus("gml:LineString");return this.writeNode("coordinates",n.components,t),t},Polygon:function(n){var i=this.createElementNSPlus("gml:Polygon"),t;for(this.writeNode("outerBoundaryIs",n.components[0],i),t=1;t<n.components.length;++t)this.writeNode("innerBoundaryIs",n.components[t],i);return i},outerBoundaryIs:function(n){var t=this.createElementNSPlus("gml:outerBoundaryIs");return this.writeNode("LinearRing",n,t),t},innerBoundaryIs:function(n){var t=this.createElementNSPlus("gml:innerBoundaryIs");return this.writeNode("LinearRing",n,t),t},LinearRing:function(n){var t=this.createElementNSPlus("gml:LinearRing");return this.writeNode("coordinates",n.components,t),t},Box:function(n){var t=this.createElementNSPlus("gml:Box");return this.writeNode("coordinates",[{x:n.left,y:n.bottom},{x:n.right,y:n.top}],t),this.srsName&&t.setAttribute("srsName",this.srsName),t}},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.Style=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:!1,propertyStyles:null,initialize:function(n,t){OpenLayers.Util.extend(this,t),this.rules=[],t&&t.rules&&this.addRules(t.rules),this.setDefaultStyle(n||OpenLayers.Feature.Vector.style["default"]),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var n=0,t=this.rules.length;n<t;n++)this.rules[n].destroy(),this.rules[n]=null;this.defaultStyle=this.rules=null},createSymbolizer:function(n){for(var t=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),n),e=this.rules,r,u=[],f=!1,i=0,o=e.length;i<o;i++)r=e[i],r.evaluate(n)&&(r instanceof OpenLayers.Rule&&r.elseFilter?u.push(r):(f=!0,this.applySymbolizer(r,t,n)));if(!1==f&&0<u.length)for(f=!0,i=0,o=u.length;i<o;i++)this.applySymbolizer(u[i],t,n);return 0<e.length&&!1==f&&(t.display="none"),null!=t.label&&"string"!=typeof t.label&&(t.label=String(t.label)),t},applySymbolizer:function(n,t,i){var r=i.geometry?this.getSymbolizerPrefix(i.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];return n=n.symbolizer[r]||n.symbolizer,!0===this.defaultsPerSymbolizer&&(r=this.defaultStyle,OpenLayers.Util.applyDefaults(n,{pointRadius:r.pointRadius}),!0!==n.stroke&&!0!==n.graphic||OpenLayers.Util.applyDefaults(n,{strokeWidth:r.strokeWidth,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeDashstyle:r.strokeDashstyle,strokeLinecap:r.strokeLinecap}),!0!==n.fill&&!0!==n.graphic||OpenLayers.Util.applyDefaults(n,{fillColor:r.fillColor,fillOpacity:r.fillOpacity}),!0===n.graphic&&OpenLayers.Util.applyDefaults(n,{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})),this.createLiterals(OpenLayers.Util.extend(t,n),i)},createLiterals:function(n,t){var r=OpenLayers.Util.extend({},t.attributes||t.data),i;OpenLayers.Util.extend(r,this.context);for(i in this.propertyStyles)n[i]=OpenLayers.Style.createLiteral(n[i],r,t,i);return n},findPropertyStyles:function(){var n={},f;this.addPropertyStyles(n,this.defaultStyle);for(var u=this.rules,t,i,r=0,e=u.length;r<e;r++){t=u[r].symbolizer;for(f in t)if(i=t[f],"object"==typeof i)this.addPropertyStyles(n,i);else{this.addPropertyStyles(n,t);break}}return n},addPropertyStyles:function(n,t){var i,r;for(r in t)i=t[r],"string"==typeof i&&i.match(/\$\{\w+\}/)&&(n[r]=!0);return n},addRules:function(n){Array.prototype.push.apply(this.rules,n),this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(n){this.defaultStyle=n,this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(n){for(var i=OpenLayers.Style.SYMBOLIZER_PREFIXES,t=0,r=i.length;t<r;t++)if(-1!=n.CLASS_NAME.indexOf(i[t]))return i[t]},clone:function(){var t=OpenLayers.Util.extend({},this),n,i;if(this.rules)for(t.rules=[],n=0,i=this.rules.length;n<i;++n)t.rules.push(this.rules[n].clone());return t.context=this.context&&OpenLayers.Util.extend({},this.context),n=OpenLayers.Util.extend({},this.defaultStyle),new OpenLayers.Style(n,t)},CLASS_NAME:"OpenLayers.Style"}),OpenLayers.Style.createLiteral=function(n,t,i,r){return"string"==typeof n&&-1!=n.indexOf("${")&&(n=OpenLayers.String.format(n,t,[i,r]),n=isNaN(n)||!n?n:parseFloat(n)),n},OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text","Raster"],OpenLayers.Rule=OpenLayers.Class({id:null,name:null,title:null,description:null,context:null,filter:null,elseFilter:!1,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(n){this.symbolizer={},OpenLayers.Util.extend(this,n),this.symbolizers&&delete this.symbolizer,this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var n in this.symbolizer)this.symbolizer[n]=null;this.symbolizer=null,delete this.symbolizers},evaluate:function(n){var i=this.getContext(n),t=!0,r;return(this.minScaleDenominator||this.maxScaleDenominator)&&(r=n.layer.map.getScale()),this.minScaleDenominator&&(t=r>=OpenLayers.Style.createLiteral(this.minScaleDenominator,i)),t&&this.maxScaleDenominator&&(t=r<OpenLayers.Style.createLiteral(this.maxScaleDenominator,i)),t&&this.filter&&(t="OpenLayers.Filter.FeatureId"==this.filter.CLASS_NAME?this.filter.evaluate(n):this.filter.evaluate(i)),t},getContext:function(n){var t=this.context;return t||(t=n.attributes||n.data),"function"==typeof this.context&&(t=this.context(n)),t},clone:function(){var n=OpenLayers.Util.extend({},this),i,t,r;if(this.symbolizers)for(i=this.symbolizers.length,n.symbolizers=Array(i),t=0;t<i;++t)n.symbolizers[t]=this.symbolizers[t].clone();else{n.symbolizer={};for(r in this.symbolizer)i=this.symbolizer[r],t=typeof i,"object"===t?n.symbolizer[r]=OpenLayers.Util.extend({},i):"string"===t&&(n.symbolizer[r]=i)}return n.filter=this.filter&&this.filter.clone(),n.context=this.context&&OpenLayers.Util.extend({},this.context),new OpenLayers.Rule(n)},CLASS_NAME:"OpenLayers.Rule"}),OpenLayers.Format.OGCExceptionReport=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},defaultPrefix:"ogc",read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));var t={exceptionReport:null};return n.documentElement&&(this.readChildNodes(n,t),null===t.exceptionReport&&(t=(new OpenLayers.Format.OWSCommon).read(n))),t},readers:{ogc:{ServiceExceptionReport:function(n,t){t.exceptionReport={exceptions:[]},this.readChildNodes(n,t.exceptionReport)},ServiceException:function(n,t){var i={code:n.getAttribute("code"),locator:n.getAttribute("locator"),text:this.getChildValue(n)};t.exceptions.push(i)}}},CLASS_NAME:"OpenLayers.Format.OGCExceptionReport"}),OpenLayers.Format.XML.VersionedOGC=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:null,version:null,profile:null,allowFallback:!1,name:null,stringifyOutput:!1,parser:null,initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]),n=this.CLASS_NAME,this.name=n.substring(n.lastIndexOf(".")+1)},getVersion:function(n,t){var i;return n?(i=this.version,i||(i=n.getAttribute("version"),i||(i=this.defaultVersion))):i=t&&t.version||this.version||this.defaultVersion,i},getParser:function(n){var t,i;if(n=n||this.defaultVersion,t=this.profile?"_"+this.profile:"",!this.parser||this.parser.VERSION!=n){if(i=OpenLayers.Format[this.name]["v"+n.replace(/\./g,"_")+t],!i&&(""!==t&&this.allowFallback&&(t="",i=OpenLayers.Format[this.name]["v"+n.replace(/\./g,"_")]),!i))throw"Can't find a "+this.name+" parser for version "+n+t;this.parser=new i(this.options)}return this.parser},write:function(n,t){var i=this.getVersion(null,t);return this.parser=this.getParser(i),i=this.parser.write(n,t),!1===this.stringifyOutput?i:OpenLayers.Format.XML.prototype.write.apply(this,[i])},read:function(n,t){var u,i,r;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),u=this.getVersion(n.documentElement),this.parser=this.getParser(u),i=this.parser.read(n,t),r=this.parser.errorProperty||null,null!==r&&void 0===i[r]&&(r=new OpenLayers.Format.OGCExceptionReport,i.error=r.read(n)),i.version=u,i},CLASS_NAME:"OpenLayers.Format.XML.VersionedOGC"}),OpenLayers.Filter=OpenLayers.Class({initialize:function(n){OpenLayers.Util.extend(this,n)},destroy:function(){},evaluate:function(){return!0},clone:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.CQL?OpenLayers.Format.CQL.prototype.write(this):Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Filter"}),OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,type:"FID",initialize:function(n){this.fids=[],OpenLayers.Filter.prototype.initialize.apply(this,[n])},evaluate:function(n){for(var t=0,i=this.fids.length;t<i;t++)if((n.fid||n.id)==this.fids[t])return!0;return!1},clone:function(){var n=new OpenLayers.Filter.FeatureId;return OpenLayers.Util.extend(n,this),n.fids=this.fids.slice(),n},CLASS_NAME:"OpenLayers.Filter.FeatureId"}),OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(n){this.filters=[],OpenLayers.Filter.prototype.initialize.apply(this,[n])},destroy:function(){this.filters=null,OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(n){var t,i;switch(this.type){case OpenLayers.Filter.Logical.AND:for(t=0,i=this.filters.length;t<i;t++)if(!1==this.filters[t].evaluate(n))return!1;return!0;case OpenLayers.Filter.Logical.OR:for(t=0,i=this.filters.length;t<i;t++)if(!0==this.filters[t].evaluate(n))return!0;return!1;case OpenLayers.Filter.Logical.NOT:return!this.filters[0].evaluate(n)}},clone:function(){for(var t=[],n=0,i=this.filters.length;n<i;++n)t.push(this.filters[n].clone());return new OpenLayers.Filter.Logical({type:this.type,filters:t})},CLASS_NAME:"OpenLayers.Filter.Logical"}),OpenLayers.Filter.Logical.AND="&&",OpenLayers.Filter.Logical.OR="||",OpenLayers.Filter.Logical.NOT="!",OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:!0,lowerBoundary:null,upperBoundary:null,initialize:function(n){OpenLayers.Filter.prototype.initialize.apply(this,[n]),this.type===OpenLayers.Filter.Comparison.LIKE&&void 0===n.matchCase&&(this.matchCase=null)},evaluate:function(n){n instanceof OpenLayers.Feature.Vector&&(n=n.attributes);var t=!1;n=n[this.property];switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:t=this.value,t=this.matchCase||"string"!=typeof n||"string"!=typeof t?n==t:n.toUpperCase()==t.toUpperCase();break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:t=this.value,t=this.matchCase||"string"!=typeof n||"string"!=typeof t?n!=t:n.toUpperCase()!=t.toUpperCase();break;case OpenLayers.Filter.Comparison.LESS_THAN:t=n<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:t=n>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:t=n<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:t=n>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:t=n>=this.lowerBoundary&&n<=this.upperBoundary;break;case OpenLayers.Filter.Comparison.LIKE:t=RegExp(this.value,"gi").test(n);break;case OpenLayers.Filter.Comparison.IS_NULL:t=null===n}return t},value2regex:function(n,t,i){if("."==n)throw Error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison");return n=n?n:"*",t=t?t:".",this.value=this.value.replace(RegExp("\\"+(i?i:"!")+"(.|$)","g"),"\\$1"),this.value=this.value.replace(RegExp("\\"+t,"g"),"."),this.value=this.value.replace(RegExp("\\"+n,"g"),".*"),this.value=this.value.replace(RegExp("\\\\.\\*","g"),"\\"+n),this.value=this.value.replace(RegExp("\\\\\\.","g"),"\\"+t)},regex2value:function(){var n=this.value,n=n.replace(/!/g,"!!"),n=n.replace(/(\\)?\\\./g,function(n,t){return t?n:"!."}),n=n.replace(/(\\)?\\\*/g,function(n,t){return t?n:"!*"}),n=n.replace(/\\\\/g,"\\");return n=n.replace(/\.\*/g,"*")},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.Comparison.IS_NULL="NULL",OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,evaluate:function(n){var i=!1,t;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:n.geometry&&(t=this.value,"OpenLayers.Bounds"==this.value.CLASS_NAME&&(t=this.value.toGeometry()),n.geometry.intersects(t)&&(i=!0));break;default:throw Error("evaluate is not implemented for this filter type.");}return i},clone:function(){var n=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(n)},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.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{profile:null,defaultVersion:"1.0.0",stringifyOutput:!0,namedLayersAsArray:!1,CLASS_NAME:"OpenLayers.Format.SLD"}),OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.Filter"}),OpenLayers.Filter.Function=OpenLayers.Class(OpenLayers.Filter,{name:null,params:null,CLASS_NAME:"OpenLayers.Filter.Function"}),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(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var t={};return this.readers.ogc.Filter.apply(this,[n,t]),t.filter},readers:{ogc:{_expression:function(n){for(var i="",t=n.firstChild;t;t=t.nextSibling)switch(t.nodeType){case 1:n=this.readNode(t),n.property?i+="${"+n.property+"}":void 0!==n.value&&(i+=n.value);break;case 3:case 4:i+=t.nodeValue}return i},Filter:function(n,t){var i={fids:[],filters:[]};this.readChildNodes(n,i),0<i.fids.length?t.filter=new OpenLayers.Filter.FeatureId({fids:i.fids}):0<i.filters.length&&(t.filter=i.filters[0])},FeatureId:function(n,t){var i=n.getAttribute("fid");i&&t.fids.push(i)},And:function(n,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(n,i),t.filters.push(i)},Or:function(n,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(n,i),t.filters.push(i)},Not:function(n,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsLessThan:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsGreaterThan:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsLessThanOrEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsGreaterThanOrEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsBetween:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(n,i),t.filters.push(i)},Literal:function(n,t){t.value=OpenLayers.String.numericIf(this.getChildValue(n),!0)},PropertyName:function(n,t){t.property=this.getChildValue(n)},LowerBoundary:function(n,t){t.lowerBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,n),!0)},UpperBoundary:function(n,t){t.upperBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,n),!0)},Intersects:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(n,t){t.distance=parseInt(this.getChildValue(n)),t.distanceUnits=n.getAttribute("units")},Function:function(){},PropertyIsNull:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.IS_NULL});this.readChildNodes(n,i),t.filters.push(i)}}},readSpatial:function(n,t,i){i=new OpenLayers.Filter.Spatial({type:i}),this.readChildNodes(n,i),i.value=i.components[0],delete i.components,t.filters.push(i)},encodeLiteral:function(n){return n instanceof Date&&(n=OpenLayers.Date.toISOString(n)),n},writeOgcExpression:function(n,t){return n instanceof OpenLayers.Filter.Function?this.writeNode("Function",n,t):this.writeNode("Literal",n,t),t},write:function(n){return this.writers.ogc.Filter.apply(this,[n])},writers:{ogc:{Filter:function(n){var t=this.createElementNSPlus("ogc:Filter");return this.writeNode(this.getFilterType(n),n,t),t},_featureIds:function(n){for(var i=this.createDocumentFragment(),t=0,r=n.fids.length;t<r;++t)this.writeNode("ogc:FeatureId",n.fids[t],i);return i},FeatureId:function(n){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:n}})},And:function(n){for(var r=this.createElementNSPlus("ogc:And"),t,i=0,u=n.filters.length;i<u;++i)t=n.filters[i],this.writeNode(this.getFilterType(t),t,r);return r},Or:function(n){for(var r=this.createElementNSPlus("ogc:Or"),t,i=0,u=n.filters.length;i<u;++i)t=n.filters[i],this.writeNode(this.getFilterType(t),t,r);return r},Not:function(n){var t=this.createElementNSPlus("ogc:Not");return n=n.filters[0],this.writeNode(this.getFilterType(n),n,t),t},PropertyIsLessThan:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLessThan");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsGreaterThan:function(n){var t=this.createElementNSPlus("ogc:PropertyIsGreaterThan");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsLessThanOrEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsGreaterThanOrEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsBetween:function(n){var t=this.createElementNSPlus("ogc:PropertyIsBetween");return this.writeNode("PropertyName",n,t),this.writeNode("LowerBoundary",n,t),this.writeNode("UpperBoundary",n,t),t},PropertyName:function(n){return this.createElementNSPlus("ogc:PropertyName",{value:n.property})},Literal:function(n){return this.createElementNSPlus("ogc:Literal",{value:(this.encodeLiteral||OpenLayers.Format.Filter.v1.prototype.encodeLiteral)(n)})},LowerBoundary:function(n){var t=this.createElementNSPlus("ogc:LowerBoundary");return this.writeOgcExpression(n.lowerBoundary,t),t},UpperBoundary:function(n){var t=this.createElementNSPlus("ogc:UpperBoundary");return this.writeNode("Literal",n.upperBoundary,t),t},INTERSECTS:function(n){return this.writeSpatial(n,"Intersects")},WITHIN:function(n){return this.writeSpatial(n,"Within")},CONTAINS:function(n){return this.writeSpatial(n,"Contains")},DWITHIN:function(n){var t=this.writeSpatial(n,"DWithin");return this.writeNode("Distance",n,t),t},Distance:function(n){return this.createElementNSPlus("ogc:Distance",{attributes:{units:n.distanceUnits},value:n.distance})},Function:function(n){var i=this.createElementNSPlus("ogc:Function",{attributes:{name:n.name}}),t,r;for(n=n.params,t=0,r=n.length;t<r;t++)this.writeOgcExpression(n[t],i);return i},PropertyIsNull:function(n){var t=this.createElementNSPlus("ogc:PropertyIsNull");return this.writeNode("PropertyName",n,t),t}}},getFilterType:function(n){var t=this.filterMap[n.type];if(!t)throw"Filter writing not supported for rule type: "+n.type;return t},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",NULL:"PropertyIsNull",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"_featureIds"},CLASS_NAME:"OpenLayers.Format.Filter.v1"}),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(n){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[n])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsNotEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsLike:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(n,i);var r=n.getAttribute("wildCard"),u=n.getAttribute("singleChar"),f=n.getAttribute("escape");i.value2regex(r,u,f),t.filters.push(i)}},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(n){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsNotEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsLike:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});return this.writeNode("PropertyName",n,t),this.writeNode("Literal",n.regex2value(),t),t},BBOX:function(n){var t=this.createElementNSPlus("ogc:BBOX"),i;return n.property&&this.writeNode("PropertyName",n,t),i=this.writeNode("gml:Box",n.value,t),n.projection&&i.setAttribute("srsName",n.projection),t}},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(n,t){var i=this.createElementNSPlus("ogc:"+t),r;return this.writeNode("PropertyName",n,i),n.value instanceof OpenLayers.Filter.Function?this.writeNode("Function",n.value,i):(r=n.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",n.value).firstChild:this.writeNode("gml:Box",n.value),n.projection&&r.setAttribute("srsName",n.projection),i.appendChild(r)),i},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"}),OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(n){OpenLayers.Util.extend(this,n)},clone:function(){return new(eval(this.CLASS_NAME))(OpenLayers.Util.extend({},this))},CLASS_NAME:"OpenLayers.Symbolizer"}),OpenLayers.Symbolizer.Point=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Point"}),OpenLayers.Symbolizer.Line=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Line"}),OpenLayers.Symbolizer.Polygon=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Polygon"}),OpenLayers.Symbolizer.Text=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Text"}),OpenLayers.Symbolizer.Raster=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Raster"}),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,multipleSymbolizers:!1,featureTypeCounter:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,graphicName:"square"},read:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i={namedLayers:!0===t.namedLayersAsArray?[]:{}};return this.readChildNodes(n,i),i},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(n,t){t.version=n.getAttribute("version"),this.readChildNodes(n,t)},Name:function(n,t){t.name=this.getChildValue(n)},Title:function(n,t){t.title=this.getChildValue(n)},Abstract:function(n,t){t.description=this.getChildValue(n)},NamedLayer:function(n,t){var i={userStyles:[],namedStyles:[]},r,u;for(this.readChildNodes(n,i),r=0,u=i.userStyles.length;r<u;++r)i.userStyles[r].layerName=i.name;OpenLayers.Util.isArray(t.namedLayers)?t.namedLayers.push(i):t.namedLayers[i.name]=i},NamedStyle:function(n,t){t.namedStyles.push(this.getChildName(n.firstChild))},UserStyle:function(n,t){var i={defaultsPerSymbolizer:!0,rules:[]};this.featureTypeCounter=-1,this.readChildNodes(n,i),this.multipleSymbolizers?(delete i.defaultsPerSymbolizer,i=new OpenLayers.Style2(i)):i=new OpenLayers.Style(this.defaultSymbolizer,i),t.userStyles.push(i)},IsDefault:function(n,t){"1"==this.getChildValue(n)&&(t.isDefault=!0)},FeatureTypeStyle:function(n,t){++this.featureTypeCounter;var i={rules:this.multipleSymbolizers?t.rules:[]};this.readChildNodes(n,i),this.multipleSymbolizers||(t.rules=i.rules)},Rule:function(n,t){var i;this.multipleSymbolizers&&(i={symbolizers:[]}),i=new OpenLayers.Rule(i),this.readChildNodes(n,i),t.rules.push(i)},ElseFilter:function(n,t){t.elseFilter=!0},MinScaleDenominator:function(n,t){t.minScaleDenominator=parseFloat(this.getChildValue(n))},MaxScaleDenominator:function(n,t){t.maxScaleDenominator=parseFloat(this.getChildValue(n))},TextSymbolizer:function(n,t){var i={};this.readChildNodes(n,i),this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Text(i))):t.symbolizer.Text=OpenLayers.Util.applyDefaults(i,t.symbolizer.Text)},LabelPlacement:function(n,t){this.readChildNodes(n,t)},PointPlacement:function(n,t){var r={},i,u,f;this.readChildNodes(n,r),r.labelRotation=r.rotation,delete r.rotation,u=t.labelAnchorPointX,f=t.labelAnchorPointY,u<=1/3?i="l":u>1/3&&u<2/3?i="c":u>=2/3&&(i="r"),f<=1/3?i+="b":f>1/3&&f<2/3?i+="m":f>=2/3&&(i+="t"),r.labelAlign=i,OpenLayers.Util.applyDefaults(t,r)},AnchorPoint:function(n,t){this.readChildNodes(n,t)},AnchorPointX:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.labelAnchorPointX=i)},AnchorPointY:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.labelAnchorPointY=i)},Displacement:function(n,t){this.readChildNodes(n,t)},DisplacementX:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.labelXOffset=i)},DisplacementY:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.labelYOffset=i)},LinePlacement:function(n,t){this.readChildNodes(n,t)},PerpendicularOffset:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.labelPerpendicularOffset=i)},Label:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.label=i)},Font:function(n,t){this.readChildNodes(n,t)},Halo:function(n,t){var i={};this.readChildNodes(n,i),t.haloRadius=i.haloRadius,t.haloColor=i.fillColor,t.haloOpacity=i.fillOpacity},Radius:function(n,t){var i=this.readers.ogc._expression.call(this,n);null!=i&&(t.haloRadius=i)},RasterSymbolizer:function(n,t){var i={};this.readChildNodes(n,i),this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Raster(i))):t.symbolizer.Raster=OpenLayers.Util.applyDefaults(i,t.symbolizer.Raster)},Geometry:function(n,t){t.geometry={},this.readChildNodes(n,t.geometry)},ColorMap:function(n,t){t.colorMap=[],this.readChildNodes(n,t.colorMap)},ColorMapEntry:function(n,t){var i=n.getAttribute("quantity"),r=n.getAttribute("opacity");t.push({color:n.getAttribute("color"),quantity:null!==i?parseFloat(i):void 0,label:n.getAttribute("label")||void 0,opacity:null!==r?parseFloat(r):void 0})},LineSymbolizer:function(n,t){var i={};this.readChildNodes(n,i),this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Line(i))):t.symbolizer.Line=OpenLayers.Util.applyDefaults(i,t.symbolizer.Line)},PolygonSymbolizer:function(n,t){var i={fill:!1,stroke:!1};this.multipleSymbolizers||(i=t.symbolizer.Polygon||i),this.readChildNodes(n,i),this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Polygon(i))):t.symbolizer.Polygon=i},PointSymbolizer:function(n,t){var i={fill:!1,stroke:!1,graphic:!1};this.multipleSymbolizers||(i=t.symbolizer.Point||i),this.readChildNodes(n,i),this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Point(i))):t.symbolizer.Point=i},Stroke:function(n,t){t.stroke=!0,this.readChildNodes(n,t)},Fill:function(n,t){t.fill=!0,this.readChildNodes(n,t)},CssParameter:function(n,t){var i=n.getAttribute("name"),r=this.cssMap[i];t.label&&("fill"===i?r="fontColor":"fill-opacity"===i&&(r="fontOpacity")),r&&(i=this.readers.ogc._expression.call(this,n))&&(t[r]=i)},Graphic:function(n,t){var i;t.graphic=!0,i={},this.readChildNodes(n,i);for(var e="stroke strokeColor strokeWidth strokeOpacity strokeLinecap fill fillColor fillOpacity graphicName rotation graphicFormat".split(" "),r,u,f=0,o=e.length;f<o;++f)r=e[f],u=i[r],void 0!=u&&(t[r]=u);void 0!=i.opacity&&(t.graphicOpacity=i.opacity),void 0!=i.size&&(isNaN(i.size/2)?t.graphicWidth=i.size:t.pointRadius=i.size/2),void 0!=i.href&&(t.externalGraphic=i.href),void 0!=i.rotation&&(t.rotation=i.rotation)},ExternalGraphic:function(n,t){this.readChildNodes(n,t)},Mark:function(n,t){this.readChildNodes(n,t)},WellKnownName:function(n,t){t.graphicName=this.getChildValue(n)},Opacity:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.opacity=i)},Size:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.size=i)},Rotation:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.rotation=i)},OnlineResource:function(n,t){t.href=this.getAttributeNS(n,this.namespaces.xlink,"href")},Format:function(n,t){t.graphicFormat=this.getChildValue(n)}}},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(n){var i=null,t;for(t in this.cssMap)if(this.cssMap[t]==n){i=t;break}return i},getGraphicFormat:function(n){var i,t;for(t in this.graphicFormats)if(this.graphicFormats[t].test(n)){i=t;break}return i||this.defaultGraphicFormat},defaultGraphicFormat:"image/png",graphicFormats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(n){return this.writers.sld.StyledLayerDescriptor.apply(this,[n])},writers:OpenLayers.Util.applyDefaults({sld:{_OGCExpression:function(n,t){var i=this.createElementNSPlus(n),e="string"==typeof t?t.split("${"):[t],r,u,f,o;for(i.appendChild(this.createTextNode(e[0])),f=1,o=e.length;f<o;f++)r=e[f],u=r.indexOf("}"),0<u?(this.writeNode("ogc:PropertyName",{property:r.substring(0,u)},i),i.appendChild(this.createTextNode(r.substring(++u)))):i.appendChild(this.createTextNode("${"+r));return i},StyledLayerDescriptor:function(n){var t=this.createElementNSPlus("sld:StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}}),i,r;if(t.setAttribute("xmlns:ogc",this.namespaces.ogc),t.setAttribute("xmlns:gml",this.namespaces.gml),n.name&&this.writeNode("Name",n.name,t),n.title&&this.writeNode("Title",n.title,t),n.description&&this.writeNode("Abstract",n.description,t),OpenLayers.Util.isArray(n.namedLayers))for(i=0,r=n.namedLayers.length;i<r;++i)this.writeNode("NamedLayer",n.namedLayers[i],t);else for(i in n.namedLayers)this.writeNode("NamedLayer",n.namedLayers[i],t);return t},Name:function(n){return this.createElementNSPlus("sld:Name",{value:n})},Title:function(n){return this.createElementNSPlus("sld:Title",{value:n})},Abstract:function(n){return this.createElementNSPlus("sld:Abstract",{value:n})},NamedLayer:function(n){var i=this.createElementNSPlus("sld:NamedLayer"),t,r;if(this.writeNode("Name",n.name,i),n.namedStyles)for(t=0,r=n.namedStyles.length;t<r;++t)this.writeNode("NamedStyle",n.namedStyles[t],i);if(n.userStyles)for(t=0,r=n.userStyles.length;t<r;++t)this.writeNode("UserStyle",n.userStyles[t],i);return i},NamedStyle:function(n){var t=this.createElementNSPlus("sld:NamedStyle");return this.writeNode("Name",n,t),t},UserStyle:function(n){var u=this.createElementNSPlus("sld:UserStyle"),h,a;if(n.name&&this.writeNode("Name",n.name,u),n.title&&this.writeNode("Title",n.title,u),n.description&&this.writeNode("Abstract",n.description,u),n.isDefault&&this.writeNode("IsDefault",n.isDefault,u),this.multipleSymbolizers&&n.rules){for(var f={0:[]},s=[0],i,e,c,t,o,r=0,l=n.rules.length;r<l;++r)if(i=n.rules[r],i.symbolizers){for(e={},h=0,a=i.symbolizers.length;h<a;++h)c=i.symbolizers[h],t=c.zIndex,t in e||(o=i.clone(),o.symbolizers=[],e[t]=o),e[t].symbolizers.push(c.clone());for(t in e)t in f||(s.push(t),f[t]=[]),f[t].push(e[t])}else f[0].push(i.clone());for(s.sort(),r=0,l=s.length;r<l;++r)i=f[s[r]],0<i.length&&(o=n.clone(),o.rules=f[s[r]],this.writeNode("FeatureTypeStyle",o,u))}else this.writeNode("FeatureTypeStyle",n,u);return u},IsDefault:function(n){return this.createElementNSPlus("sld:IsDefault",{value:n?"1":"0"})},FeatureTypeStyle:function(n){for(var i=this.createElementNSPlus("sld:FeatureTypeStyle"),t=0,r=n.rules.length;t<r;++t)this.writeNode("Rule",n.rules[t],i);return i},Rule:function(n){var t=this.createElementNSPlus("sld:Rule"),r,u,i,f;if(n.name&&this.writeNode("Name",n.name,t),n.title&&this.writeNode("Title",n.title,t),n.description&&this.writeNode("Abstract",n.description,t),n.elseFilter?this.writeNode("ElseFilter",null,t):n.filter&&this.writeNode("ogc:Filter",n.filter,t),void 0!=n.minScaleDenominator&&this.writeNode("MinScaleDenominator",n.minScaleDenominator,t),void 0!=n.maxScaleDenominator&&this.writeNode("MaxScaleDenominator",n.maxScaleDenominator,t),this.multipleSymbolizers&&n.symbolizers)for(i=0,f=n.symbolizers.length;i<f;++i)u=n.symbolizers[i],r=u.CLASS_NAME.split(".").pop(),this.writeNode(r+"Symbolizer",u,t);else for(var f=OpenLayers.Style.SYMBOLIZER_PREFIXES,i=0,e=f.length;i<e;++i)r=f[i],(u=n.symbolizer[r])&&this.writeNode(r+"Symbolizer",u,t);return t},ElseFilter:function(){return this.createElementNSPlus("sld:ElseFilter")},MinScaleDenominator:function(n){return this.createElementNSPlus("sld:MinScaleDenominator",{value:n})},MaxScaleDenominator:function(n){return this.createElementNSPlus("sld:MaxScaleDenominator",{value:n})},LineSymbolizer:function(n){var t=this.createElementNSPlus("sld:LineSymbolizer");return this.writeNode("Stroke",n,t),t},Stroke:function(n){var t=this.createElementNSPlus("sld:Stroke");return void 0!=n.strokeColor&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeColor"},t),void 0!=n.strokeOpacity&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeOpacity"},t),void 0!=n.strokeWidth&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeWidth"},t),void 0!=n.strokeDashstyle&&"solid"!==n.strokeDashstyle&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeDashstyle"},t),void 0!=n.strokeLinecap&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeLinecap"},t),t},CssParameter:function(n){return this.createElementNSPlus("sld:CssParameter",{attributes:{name:this.getCssProperty(n.key)},value:n.symbolizer[n.key]})},TextSymbolizer:function(n){var t=this.createElementNSPlus("sld:TextSymbolizer");return null!=n.label&&this.writeNode("Label",n.label,t),null==n.fontFamily&&null==n.fontSize&&null==n.fontWeight&&null==n.fontStyle||this.writeNode("Font",n,t),null==n.labelAnchorPointX&&null==n.labelAnchorPointY&&null==n.labelAlign&&null==n.labelXOffset&&null==n.labelYOffset&&null==n.labelRotation&&null==n.labelPerpendicularOffset||this.writeNode("LabelPlacement",n,t),null==n.haloRadius&&null==n.haloColor&&null==n.haloOpacity||this.writeNode("Halo",n,t),null==n.fontColor&&null==n.fontOpacity||this.writeNode("Fill",{fillColor:n.fontColor,fillOpacity:n.fontOpacity},t),t},LabelPlacement:function(n){var t=this.createElementNSPlus("sld:LabelPlacement");return null==n.labelAnchorPointX&&null==n.labelAnchorPointY&&null==n.labelAlign&&null==n.labelXOffset&&null==n.labelYOffset&&null==n.labelRotation||null!=n.labelPerpendicularOffset||this.writeNode("PointPlacement",n,t),null!=n.labelPerpendicularOffset&&this.writeNode("LinePlacement",n,t),t},LinePlacement:function(n){var t=this.createElementNSPlus("sld:LinePlacement");return this.writeNode("PerpendicularOffset",n.labelPerpendicularOffset,t),t},PerpendicularOffset:function(n){return this.createElementNSPlus("sld:PerpendicularOffset",{value:n})},PointPlacement:function(n){var t=this.createElementNSPlus("sld:PointPlacement");return null==n.labelAnchorPointX&&null==n.labelAnchorPointY&&null==n.labelAlign||this.writeNode("AnchorPoint",n,t),null==n.labelXOffset&&null==n.labelYOffset||this.writeNode("Displacement",n,t),null!=n.labelRotation&&this.writeNode("Rotation",n.labelRotation,t),t},AnchorPoint:function(n){var r=this.createElementNSPlus("sld:AnchorPoint"),t=n.labelAnchorPointX,i=n.labelAnchorPointY,u;return null!=t&&this.writeNode("AnchorPointX",t,r),null!=i&&this.writeNode("AnchorPointY",i,r),null==t&&null==i&&(u=n.labelAlign.substr(0,1),n=n.labelAlign.substr(1,1),"l"===u?t=0:"c"===u?t=.5:"r"===u&&(t=1),"b"===n?i=0:"m"===n?i=.5:"t"===n&&(i=1),this.writeNode("AnchorPointX",t,r),this.writeNode("AnchorPointY",i,r)),r},AnchorPointX:function(n){return this.createElementNSPlus("sld:AnchorPointX",{value:n})},AnchorPointY:function(n){return this.createElementNSPlus("sld:AnchorPointY",{value:n})},Displacement:function(n){var t=this.createElementNSPlus("sld:Displacement");return null!=n.labelXOffset&&this.writeNode("DisplacementX",n.labelXOffset,t),null!=n.labelYOffset&&this.writeNode("DisplacementY",n.labelYOffset,t),t},DisplacementX:function(n){return this.createElementNSPlus("sld:DisplacementX",{value:n})},DisplacementY:function(n){return this.createElementNSPlus("sld:DisplacementY",{value:n})},Font:function(n){var t=this.createElementNSPlus("sld:Font");return n.fontFamily&&this.writeNode("CssParameter",{symbolizer:n,key:"fontFamily"},t),n.fontSize&&this.writeNode("CssParameter",{symbolizer:n,key:"fontSize"},t),n.fontWeight&&this.writeNode("CssParameter",{symbolizer:n,key:"fontWeight"},t),n.fontStyle&&this.writeNode("CssParameter",{symbolizer:n,key:"fontStyle"},t),t},Label:function(n){return this.writers.sld._OGCExpression.call(this,"sld:Label",n)},Halo:function(n){var t=this.createElementNSPlus("sld:Halo");return n.haloRadius&&this.writeNode("Radius",n.haloRadius,t),(n.haloColor||n.haloOpacity)&&this.writeNode("Fill",{fillColor:n.haloColor,fillOpacity:n.haloOpacity},t),t},Radius:function(n){return this.createElementNSPlus("sld:Radius",{value:n})},RasterSymbolizer:function(n){var t=this.createElementNSPlus("sld:RasterSymbolizer");return n.geometry&&this.writeNode("Geometry",n.geometry,t),n.opacity&&this.writeNode("Opacity",n.opacity,t),n.colorMap&&this.writeNode("ColorMap",n.colorMap,t),t},Geometry:function(n){var t=this.createElementNSPlus("sld:Geometry");return n.property&&this.writeNode("ogc:PropertyName",n,t),t},ColorMap:function(n){for(var i=this.createElementNSPlus("sld:ColorMap"),t=0,r=n.length;t<r;++t)this.writeNode("ColorMapEntry",n[t],i);return i},ColorMapEntry:function(n){var t=this.createElementNSPlus("sld:ColorMapEntry");return t.setAttribute("color",n.color),void 0!==n.opacity&&t.setAttribute("opacity",parseFloat(n.opacity)),void 0!==n.quantity&&t.setAttribute("quantity",parseFloat(n.quantity)),void 0!==n.label&&t.setAttribute("label",n.label),t},PolygonSymbolizer:function(n){var t=this.createElementNSPlus("sld:PolygonSymbolizer");return!1!==n.fill&&this.writeNode("Fill",n,t),!1!==n.stroke&&this.writeNode("Stroke",n,t),t},Fill:function(n){var t=this.createElementNSPlus("sld:Fill");return n.fillColor&&this.writeNode("CssParameter",{symbolizer:n,key:"fillColor"},t),null!=n.fillOpacity&&this.writeNode("CssParameter",{symbolizer:n,key:"fillOpacity"},t),t},PointSymbolizer:function(n){var t=this.createElementNSPlus("sld:PointSymbolizer");return this.writeNode("Graphic",n,t),t},Graphic:function(n){var t=this.createElementNSPlus("sld:Graphic");return void 0!=n.externalGraphic?this.writeNode("ExternalGraphic",n,t):this.writeNode("Mark",n,t),void 0!=n.graphicOpacity&&this.writeNode("Opacity",n.graphicOpacity,t),void 0!=n.pointRadius?this.writeNode("Size",2*n.pointRadius,t):void 0!=n.graphicWidth&&this.writeNode("Size",n.graphicWidth,t),void 0!=n.rotation&&this.writeNode("Rotation",n.rotation,t),t},ExternalGraphic:function(n){var t=this.createElementNSPlus("sld:ExternalGraphic");return this.writeNode("OnlineResource",n.externalGraphic,t),n=n.graphicFormat||this.getGraphicFormat(n.externalGraphic),this.writeNode("Format",n,t),t},Mark:function(n){var t=this.createElementNSPlus("sld:Mark");return n.graphicName&&this.writeNode("WellKnownName",n.graphicName,t),!1!==n.fill&&this.writeNode("Fill",n,t),!1!==n.stroke&&this.writeNode("Stroke",n,t),t},WellKnownName:function(n){return this.createElementNSPlus("sld:WellKnownName",{value:n})},Opacity:function(n){return this.createElementNSPlus("sld:Opacity",{value:n})},Size:function(n){return this.writers.sld._OGCExpression.call(this,"sld:Size",n)},Rotation:function(n){return this.createElementNSPlus("sld:Rotation",{value:n})},OnlineResource:function(n){return this.createElementNSPlus("sld:OnlineResource",{attributes:{"xlink:type":"simple","xlink:href":n}})},Format:function(n){return this.createElementNSPlus("sld:Format",{value:n})}}},OpenLayers.Format.Filter.v1_0_0.prototype.writers),CLASS_NAME:"OpenLayers.Format.SLD.v1"}),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",CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0"}),OpenLayers.Format.Context=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{layerOptions:null,layerParams:null,read:function(n,t){var i=OpenLayers.Format.XML.VersionedOGC.prototype.read.apply(this,arguments),r;return t&&t.map&&((this.context=i,t.map instanceof OpenLayers.Map)?i=this.mergeContextToMap(i,t.map):(r=t.map,(OpenLayers.Util.isElement(r)||"string"==typeof r)&&(r={div:r}),i=this.contextToMap(i,r))),i},getLayerFromContext:function(n){var t,u,i={queryable:n.queryable,visibility:n.visibility,maxExtent:n.maxExtent,metadata:OpenLayers.Util.applyDefaults(n.metadata,{styles:n.styles,formats:n.formats,abstract:n.abstract,dataURL:n.dataURL}),numZoomLevels:n.numZoomLevels,units:n.units,isBaseLayer:n.isBaseLayer,opacity:n.opacity,displayInLayerSwitcher:n.displayInLayerSwitcher,singleTile:n.singleTile,tileSize:n.tileSize?new OpenLayers.Size(n.tileSize.width,n.tileSize.height):void 0,minScale:n.minScale||n.maxScaleDenominator,maxScale:n.maxScale||n.minScaleDenominator,srs:n.srs,dimensions:n.dimensions,metadataURL:n.metadataURL},f,r;if(this.layerOptions&&OpenLayers.Util.applyDefaults(i,this.layerOptions),f={layers:n.name,transparent:n.transparent,version:n.version},n.formats&&0<n.formats.length)for(f.format=n.formats[0].value,t=0,u=n.formats.length;t<u;t++)if(r=n.formats[t],!0==r.current){f.format=r.value;break}if(n.styles&&0<n.styles.length)for(t=0,u=n.styles.length;t<u;t++)if(r=n.styles[t],!0==r.current){r.href?f.sld=r.href:r.body?f.sld_body=r.body:f.styles=r.name;break}return this.layerParams&&OpenLayers.Util.applyDefaults(f,this.layerParams),t=null,u=n.service,u==OpenLayers.Format.Context.serviceTypes.WFS?(i.strategies=[new OpenLayers.Strategy.BBOX],i.protocol=new OpenLayers.Protocol.WFS({url:n.url,featurePrefix:n.name.split(":")[0],featureType:n.name.split(":").pop()}),t=new OpenLayers.Layer.Vector(n.title||n.name,i)):u==OpenLayers.Format.Context.serviceTypes.KML?(i.strategies=[new OpenLayers.Strategy.Fixed],i.protocol=new OpenLayers.Protocol.HTTP({url:n.url,format:new OpenLayers.Format.KML}),t=new OpenLayers.Layer.Vector(n.title||n.name,i)):u==OpenLayers.Format.Context.serviceTypes.GML?(i.strategies=[new OpenLayers.Strategy.Fixed],i.protocol=new OpenLayers.Protocol.HTTP({url:n.url,format:new OpenLayers.Format.GML}),t=new OpenLayers.Layer.Vector(n.title||n.name,i)):n.features?(t=new OpenLayers.Layer.Vector(n.title||n.name,i),t.addFeatures(n.features)):!0!==n.categoryLayer&&(t=new OpenLayers.Layer.WMS(n.title||n.name,n.url,f,i)),t},getLayersFromContext:function(n){for(var i,r=[],t=0,u=n.length;t<u;t++)i=this.getLayerFromContext(n[t]),null!==i&&r.push(i);return r},contextToMap:function(n,t){t=OpenLayers.Util.applyDefaults({maxExtent:n.maxExtent,projection:n.projection,units:n.units},t),t.maxExtent&&(t.maxResolution=t.maxExtent.getWidth()/OpenLayers.Map.TILE_WIDTH),t.metadata={contactInformation:n.contactInformation,abstract:n.abstract,keywords:n.keywords,logo:n.logo,descriptionURL:n.descriptionURL};var i=new OpenLayers.Map(t);return i.addLayers(this.getLayersFromContext(n.layersContext)),i.setCenter(n.bounds.getCenterLonLat(),i.getZoomForExtent(n.bounds,!0)),i},mergeContextToMap:function(n,t){return t.addLayers(this.getLayersFromContext(n.layersContext)),t},write:function(n){return n=this.toContext(n),OpenLayers.Format.XML.VersionedOGC.prototype.write.apply(this,arguments)},CLASS_NAME:"OpenLayers.Format.Context"}),OpenLayers.Format.Context.serviceTypes={WMS:"urn:ogc:serviceType:WMS",WFS:"urn:ogc:serviceType:WFS",WCS:"urn:ogc:serviceType:WCS",GML:"urn:ogc:serviceType:GML",SLD:"urn:ogc:serviceType:SLD",FES:"urn:ogc:serviceType:FES",KML:"urn:ogc:serviceType:KML"},OpenLayers.Format.OWSContext=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"0.3.1",getVersion:function(){var i=OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this,arguments);return"0.3.0"===i&&(i=this.defaultVersion),i},toContext:function(n){var t={};return"OpenLayers.Map"==n.CLASS_NAME&&(t.bounds=n.getExtent(),t.maxExtent=n.maxExtent,t.projection=n.projection,t.size=n.getSize(),t.layers=n.layers),t},CLASS_NAME:"OpenLayers.Format.OWSContext"}),OpenLayers.Format.OWSCommon=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",getVersion:function(n){var i=this.version,r;return i||(r=n.getAttribute("xmlns:ows"),r&&"1.1"===r.substring(r.lastIndexOf("/")+1)&&(i="1.1.0"),i||(i=this.defaultVersion)),i},CLASS_NAME:"OpenLayers.Format.OWSCommon"}),OpenLayers.Format.OWSCommon.v1=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(n,t){OpenLayers.Util.applyDefaults(t,this.options);var i={};return this.readChildNodes(n,i),i},readers:{ows:{Exception:function(n,t){var i={code:n.getAttribute("exceptionCode"),locator:n.getAttribute("locator"),texts:[]};t.exceptions.push(i),this.readChildNodes(n,i)},ExceptionText:function(n,t){var i=this.getChildValue(n);t.texts.push(i)},ServiceIdentification:function(n,t){t.serviceIdentification={},this.readChildNodes(n,t.serviceIdentification)},Title:function(n,t){t.title=this.getChildValue(n)},Abstract:function(n,t){t.abstract=this.getChildValue(n)},Keywords:function(n,t){t.keywords={},this.readChildNodes(n,t.keywords)},Keyword:function(n,t){t[this.getChildValue(n)]=!0},ServiceType:function(n,t){t.serviceType={codeSpace:n.getAttribute("codeSpace"),value:this.getChildValue(n)}},ServiceTypeVersion:function(n,t){t.serviceTypeVersion=this.getChildValue(n)},Fees:function(n,t){t.fees=this.getChildValue(n)},AccessConstraints:function(n,t){t.accessConstraints=this.getChildValue(n)},ServiceProvider:function(n,t){t.serviceProvider={},this.readChildNodes(n,t.serviceProvider)},ProviderName:function(n,t){t.providerName=this.getChildValue(n)},ProviderSite:function(n,t){t.providerSite=this.getAttributeNS(n,this.namespaces.xlink,"href")},ServiceContact:function(n,t){t.serviceContact={},this.readChildNodes(n,t.serviceContact)},IndividualName:function(n,t){t.individualName=this.getChildValue(n)},PositionName:function(n,t){t.positionName=this.getChildValue(n)},ContactInfo:function(n,t){t.contactInfo={},this.readChildNodes(n,t.contactInfo)},Phone:function(n,t){t.phone={},this.readChildNodes(n,t.phone)},Voice:function(n,t){t.voice=this.getChildValue(n)},Address:function(n,t){t.address={},this.readChildNodes(n,t.address)},DeliveryPoint:function(n,t){t.deliveryPoint=this.getChildValue(n)},City:function(n,t){t.city=this.getChildValue(n)},AdministrativeArea:function(n,t){t.administrativeArea=this.getChildValue(n)},PostalCode:function(n,t){t.postalCode=this.getChildValue(n)},Country:function(n,t){t.country=this.getChildValue(n)},ElectronicMailAddress:function(n,t){t.electronicMailAddress=this.getChildValue(n)},Role:function(n,t){t.role=this.getChildValue(n)},OperationsMetadata:function(n,t){t.operationsMetadata={},this.readChildNodes(n,t.operationsMetadata)},Operation:function(n,t){var i=n.getAttribute("name");t[i]={},this.readChildNodes(n,t[i])},DCP:function(n,t){t.dcp={},this.readChildNodes(n,t.dcp)},HTTP:function(n,t){t.http={},this.readChildNodes(n,t.http)},Get:function(n,t){t.get||(t.get=[]);var i={url:this.getAttributeNS(n,this.namespaces.xlink,"href")};this.readChildNodes(n,i),t.get.push(i)},Post:function(n,t){t.post||(t.post=[]);var i={url:this.getAttributeNS(n,this.namespaces.xlink,"href")};this.readChildNodes(n,i),t.post.push(i)},Parameter:function(n,t){t.parameters||(t.parameters={});var i=n.getAttribute("name");t.parameters[i]={},this.readChildNodes(n,t.parameters[i])},Constraint:function(n,t){t.constraints||(t.constraints={});var i=n.getAttribute("name");t.constraints[i]={},this.readChildNodes(n,t.constraints[i])},Value:function(n,t){t[this.getChildValue(n)]=!0},OutputFormat:function(n,t){t.formats.push({value:this.getChildValue(n)}),this.readChildNodes(n,t)},WGS84BoundingBox:function(n,t){var i={};i.crs=n.getAttribute("crs"),t.BoundingBox?t.BoundingBox.push(i):(t.projection=i.crs,i=t),this.readChildNodes(n,i)},BoundingBox:function(n,t){this.readers.ows.WGS84BoundingBox.apply(this,[n,t])},LowerCorner:function(n,t){var i=this.getChildValue(n).replace(this.regExes.trimSpace,""),i=i.replace(this.regExes.trimComma,","),i=i.split(this.regExes.splitSpace);t.left=i[0],t.bottom=i[1]},UpperCorner:function(n,t){var i=this.getChildValue(n).replace(this.regExes.trimSpace,""),i=i.replace(this.regExes.trimComma,","),i=i.split(this.regExes.splitSpace);t.right=i[0],t.top=i[1],t.bounds=new OpenLayers.Bounds(t.left,t.bottom,t.right,t.top),delete t.left,delete t.bottom,delete t.right,delete t.top},Language:function(n,t){t.language=this.getChildValue(n)}}},writers:{ows:{BoundingBox:function(n,t){var i=this.createElementNSPlus(t||"ows:BoundingBox",{attributes:{crs:n.projection}});return this.writeNode("ows:LowerCorner",n,i),this.writeNode("ows:UpperCorner",n,i),i},LowerCorner:function(n){return this.createElementNSPlus("ows:LowerCorner",{value:n.bounds.left+" "+n.bounds.bottom})},UpperCorner:function(n){return this.createElementNSPlus("ows:UpperCorner",{value:n.bounds.right+" "+n.bounds.top})},Identifier:function(n){return this.createElementNSPlus("ows:Identifier",{value:n})},Title:function(n){return this.createElementNSPlus("ows:Title",{value:n})},Abstract:function(n){return this.createElementNSPlus("ows:Abstract",{value:n})},OutputFormat:function(n){return this.createElementNSPlus("ows:OutputFormat",{value:n})}}},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1"}),OpenLayers.Format.OWSCommon.v1_0_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1,{namespaces:{ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink"},readers:{ows:OpenLayers.Util.applyDefaults({ExceptionReport:function(n,t){t.success=!1,t.exceptionReport={version:n.getAttribute("version"),language:n.getAttribute("language"),exceptions:[]},this.readChildNodes(n,t.exceptionReport)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Format.OWSCommon.v1.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1_0_0"}),OpenLayers.Format.OWSContext.v0_3_1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{owc:"http://www.opengis.net/ows-context",gml:"http://www.opengis.net/gml",kml:"http://www.opengis.net/kml/2.2",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},VERSION:"0.3.1",schemaLocation:"http://www.opengis.net/ows-context http://www.ogcnetwork.net/schemas/owc/0.3.1/owsContext.xsd",defaultPrefix:"owc",extractAttributes:!0,xy:!0,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},featureNS:"http://mapserver.gis.umn.edu/mapserver",featureType:"vector",geometryName:"geometry",nestingLayerLookup:null,initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]),OpenLayers.Format.GML.v2.prototype.setGeometryTypes.call(this)},setNestingPath:function(n){var t,u;if(n.layersContext)for(t=0,u=n.layersContext.length;t<u;t++){var i=n.layersContext[t],r=[],f=n.title||"";n.metadata&&n.metadata.nestingPath&&(r=n.metadata.nestingPath.slice()),""!=f&&r.push(f),i.metadata.nestingPath=r,i.layersContext&&this.setNestingPath(i)}},decomposeNestingPath:function(n){var t=[];if(OpenLayers.Util.isArray(n)){for(n=n.slice();0<n.length;)t.push(n.slice()),n.pop();t.reverse()}return t},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),this.setNestingPath({layersContext:t.layersContext}),n=[],this.processLayer(n,t),delete t.layersContext,t.layersContext=n,t},processLayer:function(n,t){var i,u,r;if(t.layersContext)for(i=0,u=t.layersContext.length;i<u;i++)r=t.layersContext[i],n.push(r),r.layersContext&&this.processLayer(n,r)},write:function(n,t){this.nestingLayerLookup={},t=t||{},OpenLayers.Util.applyDefaults(t,n);var i=this.writeNode("OWSContext",t);return this.nestingLayerLookup=null,this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},readers:{kml:{Document:function(n,t){t.features=new OpenLayers.Format.KML({kmlns:this.namespaces.kml,extractStyles:!0}).read(n)}},owc:{OWSContext:function(n,t){this.readChildNodes(n,t)},General:function(n,t){this.readChildNodes(n,t)},ResourceList:function(n,t){this.readChildNodes(n,t)},Layer:function(n,t){var i={metadata:{},visibility:"1"!=n.getAttribute("hidden"),queryable:"1"==n.getAttribute("queryable"),opacity:null!=n.getAttribute("opacity")?parseFloat(n.getAttribute("opacity")):null,name:n.getAttribute("name"),categoryLayer:null==n.getAttribute("name"),formats:[],styles:[]};t.layersContext||(t.layersContext=[]),t.layersContext.push(i),this.readChildNodes(n,i)},InlineGeometry:function(n,t){t.features=[];var i=this.getElementsByTagNameNS(n,this.namespaces.gml,"featureMember"),r;1<=i.length&&(r=i[0]),r&&r.firstChild&&(i=r.firstChild.nextSibling?r.firstChild.nextSibling:r.firstChild,this.setNamespace("feature",i.namespaceURI),this.featureType=i.localName||i.nodeName.split(":").pop(),this.readChildNodes(n,t))},Server:function(n,t){(t.service||t.version)&&t.service==OpenLayers.Format.Context.serviceTypes.WMS||(t.service=n.getAttribute("service"),t.version=n.getAttribute("version"),this.readChildNodes(n,t))},Name:function(n,t){t.name=this.getChildValue(n),this.readChildNodes(n,t)},Title:function(n,t){t.title=this.getChildValue(n),this.readChildNodes(n,t)},StyleList:function(n,t){this.readChildNodes(n,t.styles)},Style:function(n,t){var i={};t.push(i),this.readChildNodes(n,i)},LegendURL:function(n,t){var i={};t.legend=i,this.readChildNodes(n,i)},OnlineResource:function(n,t){t.url=this.getAttributeNS(n,this.namespaces.xlink,"href"),this.readChildNodes(n,t)}},ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows,gml:OpenLayers.Format.GML.v2.prototype.readers.gml,sld:OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{owc:{OWSContext:function(n){var t=this.createElementNSPlus("OWSContext",{attributes:{version:this.VERSION,id:n.id||OpenLayers.Util.createUniqueID("OpenLayers_OWSContext_")}});return this.writeNode("General",n,t),this.writeNode("ResourceList",n,t),t},General:function(n){var t=this.createElementNSPlus("General");return this.writeNode("ows:BoundingBox",n,t),this.writeNode("ows:Title",n.title||"OpenLayers OWSContext",t),t},ResourceList:function(n){for(var i,u,r=this.createElementNSPlus("ResourceList"),t=0,f=n.layers.length;t<f;t++)i=n.layers[t],u=this.decomposeNestingPath(i.metadata.nestingPath),this.writeNode("_Layer",{layer:i,subPaths:u},r);return r},Server:function(n){var t=this.createElementNSPlus("Server",{attributes:{version:n.version,service:n.service}});return this.writeNode("OnlineResource",n,t),t},OnlineResource:function(n){return this.createElementNSPlus("OnlineResource",{attributes:{"xlink:href":n.url}})},InlineGeometry:function(n){var i=this.createElementNSPlus("InlineGeometry"),t=n.getDataExtent(),r;for(null!==t&&this.writeNode("gml:boundedBy",t,i),t=0,r=n.features.length;t<r;t++)this.writeNode("gml:featureMember",n.features[t],i);return i},StyleList:function(n){for(var i=this.createElementNSPlus("StyleList"),t=0,r=n.length;t<r;t++)this.writeNode("Style",n[t],i);return i},Style:function(n){var t=this.createElementNSPlus("Style");return this.writeNode("Name",n,t),this.writeNode("Title",n,t),n.legend&&this.writeNode("LegendURL",n,t),t},Name:function(n){return this.createElementNSPlus("Name",{value:n.name})},Title:function(n){return this.createElementNSPlus("Title",{value:n.title})},LegendURL:function(n){var t=this.createElementNSPlus("LegendURL");return this.writeNode("OnlineResource",n.legend,t),t},_WMS:function(n){var t=this.createElementNSPlus("Layer",{attributes:{name:n.params.LAYERS,queryable:n.queryable?"1":"0",hidden:n.visibility?"0":"1",opacity:n.hasOwnProperty("opacity")?n.opacity:null}});return this.writeNode("ows:Title",n.name,t),this.writeNode("ows:OutputFormat",n.params.FORMAT,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WMS,version:n.params.VERSION,url:n.url},t),n.metadata.styles&&0<n.metadata.styles.length&&this.writeNode("StyleList",n.metadata.styles,t),t},_Layer:function(n){var t,r,i;return t=n.layer,r=n.subPaths,i=null,0<r.length?(t=r[0].join("/"),r=t.lastIndexOf("/"),i=this.nestingLayerLookup[t],r=0<r?t.substring(r+1,t.length):t,i||(i=this.createElementNSPlus("Layer"),this.writeNode("ows:Title",r,i),this.nestingLayerLookup[t]=i),n.subPaths.shift(),this.writeNode("_Layer",n,i)):(t instanceof OpenLayers.Layer.WMS?i=this.writeNode("_WMS",t):t instanceof OpenLayers.Layer.Vector&&(t.protocol instanceof OpenLayers.Protocol.WFS.v1?i=this.writeNode("_WFS",t):t.protocol instanceof OpenLayers.Protocol.HTTP?t.protocol.format instanceof OpenLayers.Format.GML?(t.protocol.format.version="2.1.2",i=this.writeNode("_GML",t)):t.protocol.format instanceof OpenLayers.Format.KML&&(t.protocol.format.version="2.2",i=this.writeNode("_KML",t)):(this.setNamespace("feature",this.featureNS),i=this.writeNode("_InlineGeometry",t))),t.options.maxScale&&this.writeNode("sld:MinScaleDenominator",t.options.maxScale,i),t.options.minScale&&this.writeNode("sld:MaxScaleDenominator",t.options.minScale,i),this.nestingLayerLookup[t.name]=i),i},_WFS:function(n){var t=this.createElementNSPlus("Layer",{attributes:{name:n.protocol.featurePrefix+":"+n.protocol.featureType,hidden:n.visibility?"0":"1"}});return this.writeNode("ows:Title",n.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WFS,version:n.protocol.version,url:n.protocol.url},t),t},_InlineGeometry:function(n){var t=this.createElementNSPlus("Layer",{attributes:{name:this.featureType,hidden:n.visibility?"0":"1"}});return this.writeNode("ows:Title",n.name,t),this.writeNode("InlineGeometry",n,t),t},_GML:function(n){var t=this.createElementNSPlus("Layer");return this.writeNode("ows:Title",n.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.GML,url:n.protocol.url,version:n.protocol.format.version},t),t},_KML:function(n){var t=this.createElementNSPlus("Layer");return this.writeNode("ows:Title",n.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.KML,version:n.protocol.format.version,url:n.protocol.url},t),t}},gml:OpenLayers.Util.applyDefaults({boundedBy:function(n){var t=this.createElementNSPlus("gml:boundedBy");return this.writeNode("gml:Box",n,t),t}},OpenLayers.Format.GML.v2.prototype.writers.gml),ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.writers.ows,sld:OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},CLASS_NAME:"OpenLayers.Format.OWSContext.v0_3_1"}),OpenLayers.Format.CSWGetRecords=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Format.CSWGetRecords.DEFAULTS);var t=OpenLayers.Format.CSWGetRecords["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSWGetRecords version: "+n.version;return new t(n)},OpenLayers.Format.CSWGetRecords.DEFAULTS={version:"2.0.2"},OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:!1,displayClass:"",title:"",autoActivate:!1,active:null,handlerOptions:null,handler:null,eventListeners:null,events:null,initialize:function(n){if(this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,""),OpenLayers.Util.extend(this,n),this.events=new OpenLayers.Events(this),this.eventListeners instanceof Object)this.events.on(this.eventListeners);null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"))},destroy:function(){if(this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=null),this.eventListeners=null,this.handler&&(this.handler.destroy(),this.handler=null),this.handlers){for(var n in this.handlers)this.handlers.hasOwnProperty(n)&&"function"==typeof this.handlers[n].destroy&&this.handlers[n].destroy();this.handlers=null}this.map&&(this.map.removeControl(this),this.map=null),this.div=null},setMap:function(n){this.map=n,this.handler&&this.handler.setMap(n)},draw:function(n){return null==this.div&&(this.div=OpenLayers.Util.createDiv(this.id),this.div.className=this.displayClass,this.allowSelection||(this.div.className+=" olControlNoSelect",this.div.setAttribute("unselectable","on",0),this.div.onselectstart=OpenLayers.Function.False),""!=this.title&&(this.div.title=this.title)),null!=n&&(this.position=n.clone()),this.moveTo(this.position),this.div},moveTo:function(n){null!=n&&null!=this.div&&(this.div.style.left=n.x+"px",this.div.style.top=n.y+"px")},activate:function(){return this.active?!1:(this.handler&&this.handler.activate(),this.active=!0,this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("activate"),!0)},deactivate:function(){return this.active?(this.handler&&this.handler.deactivate(),this.active=!1,this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("deactivate"),!0):!1},CLASS_NAME:"OpenLayers.Control"}),OpenLayers.Control.TYPE_BUTTON=1,OpenLayers.Control.TYPE_TOGGLE=2,OpenLayers.Control.TYPE_TOOL=3,OpenLayers.Events.buttonclick=OpenLayers.Class({target:null,events:"mousedown mouseup click dblclick touchstart touchmove touchend keydown".split(" "),startRegEx:/^mousedown|touchstart$/,cancelRegEx:/^touchmove$/,completeRegEx:/^mouseup|touchend$/,initialize:function(n){for(this.target=n,n=this.events.length-1;0<=n;--n)this.target.register(this.events[n],this,this.buttonClick,{extension:!0})},destroy:function(){for(var n=this.events.length-1;0<=n;--n)this.target.unregister(this.events[n],this,this.buttonClick);delete this.target},getPressedButton:function(n){var i=3,t;do{if(OpenLayers.Element.hasClass(n,"olButton")){t=n;break}n=n.parentNode}while(0<--i&&n);return t},ignore:function(n){var i=3,t=!1;do{if("a"===n.nodeName.toLowerCase()){t=!0;break}n=n.parentNode}while(0<--i&&n);return t},buttonClick:function(n){var t=!0,i=OpenLayers.Event.element(n);if(i&&(OpenLayers.Event.isLeftClick(n)||!~n.type.indexOf("mouse")))if(i=this.getPressedButton(i)){if("keydown"===n.type)switch(n.keyCode){case OpenLayers.Event.KEY_RETURN:case OpenLayers.Event.KEY_SPACE:this.target.triggerEvent("buttonclick",{buttonElement:i}),OpenLayers.Event.stop(n),t=!1}else if(this.startEvt){if(this.completeRegEx.test(n.type)){var t=OpenLayers.Util.pagePosition(i),r=OpenLayers.Util.getViewportElement(),u=window.pageYOffset||r.scrollTop;t[0]-=window.pageXOffset||r.scrollLeft,t[1]-=u,this.target.triggerEvent("buttonclick",{buttonElement:i,buttonXY:{x:this.startEvt.clientX-t[0],y:this.startEvt.clientY-t[1]}})}this.cancelRegEx.test(n.type)&&delete this.startEvt,OpenLayers.Event.stop(n),t=!1}this.startRegEx.test(n.type)&&(this.startEvt=n,OpenLayers.Event.stop(n),t=!1)}else t=!this.ignore(OpenLayers.Event.element(n)),delete this.startEvt;return t}}),OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.vendorPrefix=function(){function f(n){return n?n.replace(/([A-Z])/g,function(n){return"-"+n.toLowerCase()}).replace(/^ms-/,"-ms-"):null}function i(t,i){if(void 0===n[i]){var r,f=0,e=u.length,o="undefined"!=typeof t.cssText;for(n[i]=null;f<e;f++)if((r=u[f])?(o||(r=r.toLowerCase()),r=r+i.charAt(0).toUpperCase()+i.slice(1)):r=i,void 0!==t[r]){n[i]=r;break}}return n[i]}function r(n){return i(e,n)}var u=["","O","ms","Moz","Webkit"],e=document.createElement("div").style,t={},n={};return{css:function(n){if(void 0===t[n]){var i=n.replace(/(-[\s\S])/g,function(n){return n.charAt(1).toUpperCase()}),i=r(i);t[n]=f(i)}return t[n]},js:i,style:r,cssCache:t,jsCache:n}}(),OpenLayers.Animation=function(n){var r=OpenLayers.Util.vendorPrefix.js(n,"requestAnimationFrame"),u=!!r,i=function(){var t=n[r]||function(t){n.setTimeout(t,16)};return function(i,r){t.apply(n,[i,r])}}(),f=0,t={};return{isNative:u,requestFrame:i,start:function(n,r,u){r=0<r?r:Number.POSITIVE_INFINITY;var e=++f,o=+new Date;return t[e]=function(){t[e]&&+new Date-o<=r?(n(),t[e]&&i(t[e],u)):delete t[e]},i(t[e],u),e},stop:function(n){delete t[n]}}}(window),OpenLayers.Tween=OpenLayers.Class({easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,minFrameRate:null,startTime:null,animationId:null,playing:!1,initialize:function(n){this.easing=n?n:OpenLayers.Easing.Expo.easeOut},start:function(n,t,i,r){this.playing=!0,this.begin=n,this.finish=t,this.duration=i,this.callbacks=r.callbacks,this.minFrameRate=r.minFrameRate||30,this.time=0,this.startTime=+new Date,OpenLayers.Animation.stop(this.animationId),this.animationId=null,this.callbacks&&this.callbacks.start&&this.callbacks.start.call(this,this.begin),this.animationId=OpenLayers.Animation.start(OpenLayers.Function.bind(this.play,this))},stop:function(){this.playing&&(this.callbacks&&this.callbacks.done&&this.callbacks.done.call(this,this.finish),OpenLayers.Animation.stop(this.animationId),this.animationId=null,this.playing=!1)},play:function(){var r={},t,n,i;for(t in this.begin){if(n=this.begin[t],i=this.finish[t],null==n||null==i||isNaN(n)||isNaN(i))throw new TypeError("invalid value for Tween");r[t]=this.easing.apply(this,[this.time,n,i-n,this.duration])}this.time++,this.callbacks&&this.callbacks.eachStep&&(+new Date-this.startTime)/this.time<=1e3/this.minFrameRate&&this.callbacks.eachStep.call(this,r),this.time>this.duration&&this.stop()},CLASS_NAME:"OpenLayers.Tween"}),OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"},OpenLayers.Easing.Linear={easeIn:function(n,t,i,r){return i*n/r+t},easeOut:function(n,t,i,r){return i*n/r+t},easeInOut:function(n,t,i,r){return i*n/r+t},CLASS_NAME:"OpenLayers.Easing.Linear"},OpenLayers.Easing.Expo={easeIn:function(n,t,i,r){return 0==n?t:i*Math.pow(2,10*(n/r-1))+t},easeOut:function(n,t,i,r){return n==r?t+i:i*(-Math.pow(2,-10*n/r)+1)+t},easeInOut:function(n,t,i,r){return 0==n?t:n==r?t+i:1>(n/=r/2)?i/2*Math.pow(2,10*(n-1))+t:i/2*(-Math.pow(2,-10*--n)+2)+t},CLASS_NAME:"OpenLayers.Easing.Expo"},OpenLayers.Easing.Quad={easeIn:function(n,t,i,r){return i*(n/=r)*n+t},easeOut:function(n,t,i,r){return-i*(n/=r)*(n-2)+t},easeInOut:function(n,t,i,r){return 1>(n/=r/2)?i/2*n*n+t:-i/2*(--n*(n-2)-1)+t},CLASS_NAME:"OpenLayers.Easing.Quad"},OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1e3},id:null,fractionalZoom:!1,events:null,allOverlays:!1,div:null,dragging:!1,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,options:null,tileSize:null,projection:"EPSG:4326",units:null,resolutions:null,maxResolution:null,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:!1,autoUpdateSize:!0,eventListeners:null,panTween:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,zoomTween:null,zoomMethod:OpenLayers.Easing.Quad.easeOut,zoomDuration:20,paddingForPopups:null,layerContainerOriginPx:null,minPx:null,maxPx:null,initialize:function(n,t){var i;if(1===arguments.length&&"object"==typeof n&&(n=(t=n)&&t.div),this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT),this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15),this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css",this.options=OpenLayers.Util.extend({},t),OpenLayers.Util.extend(this,t),OpenLayers.Util.applyDefaults(this,OpenLayers.Projection.defaults[this.projection instanceof OpenLayers.Projection?this.projection.projCode:this.projection]),!this.maxExtent||this.maxExtent instanceof OpenLayers.Bounds||(this.maxExtent=new OpenLayers.Bounds(this.maxExtent)),!this.minExtent||this.minExtent instanceof OpenLayers.Bounds||(this.minExtent=new OpenLayers.Bounds(this.minExtent)),!this.restrictedExtent||this.restrictedExtent instanceof OpenLayers.Bounds||(this.restrictedExtent=new OpenLayers.Bounds(this.restrictedExtent)),!this.center||this.center instanceof OpenLayers.LonLat||(this.center=new OpenLayers.LonLat(this.center)),this.layers=[],this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_"),this.div=OpenLayers.Util.getElement(n),this.div||(this.div=document.createElement("div"),this.div.style.height="1px",this.div.style.width="1px"),OpenLayers.Element.addClass(this.div,"olMap"),i=this.id+"_OpenLayers_ViewPort",this.viewPortDiv=OpenLayers.Util.createDiv(i,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),this.events=new OpenLayers.Events(this,this.viewPortDiv,null,this.fallThrough,{includeXY:!0}),OpenLayers.TileManager&&null!==this.tileManager&&(this.tileManager instanceof OpenLayers.TileManager||(this.tileManager=new OpenLayers.TileManager(this.tileManager)),this.tileManager.addMap(this)),i=this.id+"_OpenLayers_Container",this.layerContainerDiv=OpenLayers.Util.createDiv(i),this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1,this.layerContainerOriginPx={x:0,y:0},this.applyTransform(),this.viewPortDiv.appendChild(this.layerContainerDiv),this.updateSize(),this.eventListeners instanceof Object)this.events.on(this.eventListeners);if(!0===this.autoUpdateSize&&(this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this),OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)),this.theme){for(var i=!0,f=document.getElementsByTagName("link"),r=0,u=f.length;r<u;++r)if(OpenLayers.Util.isEquivalentUrl(f.item(r).href,this.theme)){i=!1;break}i&&(i=document.createElement("link"),i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",this.theme),document.getElementsByTagName("head")[0].appendChild(i))}for(null==this.controls&&(this.controls=[],null!=OpenLayers.Control&&(OpenLayers.Control.Navigation?this.controls.push(new OpenLayers.Control.Navigation):OpenLayers.Control.TouchNavigation&&this.controls.push(new OpenLayers.Control.TouchNavigation),OpenLayers.Control.Zoom?this.controls.push(new OpenLayers.Control.Zoom):OpenLayers.Control.PanZoom&&this.controls.push(new OpenLayers.Control.PanZoom),OpenLayers.Control.ArgParser&&this.controls.push(new OpenLayers.Control.ArgParser),OpenLayers.Control.Attribution&&this.controls.push(new OpenLayers.Control.Attribution))),r=0,u=this.controls.length;r<u;r++)this.addControlToMap(this.controls[r]);this.popups=[],this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this),OpenLayers.Event.observe(window,"unload",this.unloadDestroy),t&&t.layers&&(delete this.center,delete this.zoom,this.addLayers(t.layers),t.center&&!this.getCenter()&&this.setCenter(t.center,t.zoom)),this.panMethod&&(this.panTween=new OpenLayers.Tween(this.panMethod)),this.zoomMethod&&this.applyTransform.transform&&(this.zoomTween=new OpenLayers.Tween(this.zoomMethod))},getViewport:function(){return this.viewPortDiv},render:function(n){this.div=OpenLayers.Util.getElement(n),OpenLayers.Element.addClass(this.div,"olMap"),this.viewPortDiv.parentNode.removeChild(this.viewPortDiv),this.div.appendChild(this.viewPortDiv),this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy)return!1;if(this.panTween&&(this.panTween.stop(),this.panTween=null),this.zoomTween&&(this.zoomTween.stop(),this.zoomTween=null),OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy),this.unloadDestroy=null,this.updateSizeDestroy&&OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy),this.paddingForPopups=null,null!=this.controls){for(var n=this.controls.length-1;0<=n;--n)this.controls[n].destroy();this.controls=null}if(null!=this.layers){for(n=this.layers.length-1;0<=n;--n)this.layers[n].destroy(!1);this.layers=null}this.viewPortDiv&&this.viewPortDiv.parentNode&&this.viewPortDiv.parentNode.removeChild(this.viewPortDiv),this.viewPortDiv=null,this.tileManager&&(this.tileManager.removeMap(this),this.tileManager=null),this.eventListeners&&(this.events.un(this.eventListeners),this.eventListeners=null),this.events.destroy(),this.options=this.events=null},setOptions:function(n){var t=this.minPx&&n.restrictedExtent!=this.restrictedExtent;OpenLayers.Util.extend(this,n),t&&this.moveTo(this.getCachedCenter(),this.zoom,{forceZoomChange:!0})},getTileSize:function(){return this.tileSize},getBy:function(n,t,i){var r="function"==typeof i.test;return OpenLayers.Array.filter(this[n],function(n){return n[t]==i||r&&i.test(n[t])})},getLayersBy:function(n,t){return this.getBy("layers",n,t)},getLayersByName:function(n){return this.getLayersBy("name",n)},getLayersByClass:function(n){return this.getLayersBy("CLASS_NAME",n)},getControlsBy:function(n,t){return this.getBy("controls",n,t)},getControlsByClass:function(n){return this.getControlsBy("CLASS_NAME",n)},getLayer:function(n){for(var i,r=null,t=0,u=this.layers.length;t<u;t++)if(i=this.layers[t],i.id==n){r=i;break}return r},setLayerZIndex:function(n,t){n.setZIndex(this.Z_INDEX_BASE[n.isBaseLayer?"BaseLayer":"Overlay"]+5*t)},resetLayersZIndex:function(){for(var n=0,t=this.layers.length;n<t;n++)this.setLayerZIndex(this.layers[n],n)},addLayer:function(n){for(var t=0,i=this.layers.length;t<i;t++)if(this.layers[t]==n)return!1;return!1===this.events.triggerEvent("preaddlayer",{layer:n})?!1:(this.allOverlays&&(n.isBaseLayer=!1),n.div.className="olLayerDiv",n.div.style.overflow="",this.setLayerZIndex(n,this.layers.length),n.isFixed?this.viewPortDiv.appendChild(n.div):this.layerContainerDiv.appendChild(n.div),this.layers.push(n),n.setMap(this),n.isBaseLayer||this.allOverlays&&!this.baseLayer?null==this.baseLayer?this.setBaseLayer(n):n.setVisibility(!1):n.redraw(),this.events.triggerEvent("addlayer",{layer:n}),n.events.triggerEvent("added",{map:this,layer:n}),n.afterAdd(),!0)},addLayers:function(n){for(var t=0,i=n.length;t<i;t++)this.addLayer(n[t])},removeLayer:function(n,t){var i,u,r;if(!1!==this.events.triggerEvent("preremovelayer",{layer:n})){if(null==t&&(t=!0),n.isFixed?this.viewPortDiv.removeChild(n.div):this.layerContainerDiv.removeChild(n.div),OpenLayers.Util.removeItem(this.layers,n),n.removeMap(this),n.map=null,this.baseLayer==n&&(this.baseLayer=null,t))for(i=0,u=this.layers.length;i<u;i++)if(r=this.layers[i],r.isBaseLayer||this.allOverlays){this.setBaseLayer(r);break}this.resetLayersZIndex(),this.events.triggerEvent("removelayer",{layer:n}),n.events.triggerEvent("removed",{map:this,layer:n})}},getNumLayers:function(){return this.layers.length},getLayerIndex:function(n){return OpenLayers.Util.indexOf(this.layers,n)},setLayerIndex:function(n,t){var i=this.getLayerIndex(n),r;if(0>t?t=0:t>this.layers.length&&(t=this.layers.length),i!=t){for(this.layers.splice(i,1),this.layers.splice(t,0,n),i=0,r=this.layers.length;i<r;i++)this.setLayerZIndex(this.layers[i],i);this.events.triggerEvent("changelayer",{layer:n,property:"order"}),this.allOverlays&&(0===t?this.setBaseLayer(n):this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0]))}},raiseLayer:function(n,t){var i=this.getLayerIndex(n)+t;this.setLayerIndex(n,i)},setBaseLayer:function(n){if(n!=this.baseLayer&&-1!=OpenLayers.Util.indexOf(this.layers,n)){var t=this.getCachedCenter(),i=OpenLayers.Util.getResolutionFromScale(this.getScale(),n.units);null==this.baseLayer||this.allOverlays||this.baseLayer.setVisibility(!1),this.baseLayer=n,(!this.allOverlays||this.baseLayer.visibility)&&(this.baseLayer.setVisibility(!0),!1===this.baseLayer.inRange&&this.baseLayer.redraw()),null!=t&&(n=this.getZoomForResolution(i||this.resolution,!0),this.setCenter(t,n,!1,!0)),this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}},addControl:function(n,t){this.controls.push(n),this.addControlToMap(n,t)},addControls:function(n,t){for(var r=1===arguments.length?[]:t,i=0,u=n.length;i<u;i++)this.addControl(n[i],r[i]?r[i]:null)},addControlToMap:function(n,t){n.outsideViewport=null!=n.div,this.displayProjection&&!n.displayProjection&&(n.displayProjection=this.displayProjection),n.setMap(this);var i=n.draw(t);i&&!n.outsideViewport&&(i.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length,this.viewPortDiv.appendChild(i)),n.autoActivate&&n.activate()},getControl:function(n){for(var i,r=null,t=0,u=this.controls.length;t<u;t++)if(i=this.controls[t],i.id==n){r=i;break}return r},removeControl:function(n){n&&n==this.getControl(n.id)&&(n.div&&n.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(n.div),OpenLayers.Util.removeItem(this.controls,n))},addPopup:function(n,t){if(t)for(var i=this.popups.length-1;0<=i;--i)this.removePopup(this.popups[i]);n.map=this,this.popups.push(n),(i=n.draw())&&(i.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length,this.layerContainerDiv.appendChild(i))},removePopup:function(n){if(OpenLayers.Util.removeItem(this.popups,n),n.div)try{this.layerContainerDiv.removeChild(n.div)}catch(t){}n.map=null},getSize:function(){var n=null;return null!=this.size&&(n=this.size.clone()),n},updateSize:function(){var n=this.getCurrentSize(),t;if(n&&!isNaN(n.h)&&!isNaN(n.w)&&(this.events.clearMouseCache(),t=this.getSize(),null==t&&(this.size=t=n),!n.equals(t))){for(this.size=n,n=0,t=this.layers.length;n<t;n++)this.layers[n].onMapResize();n=this.getCachedCenter(),null!=this.baseLayer&&null!=n&&(t=this.getZoom(),this.zoom=null,this.setCenter(n,t))}this.events.triggerEvent("updatesize")},getCurrentSize:function(){var n=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);return(0==n.w&&0==n.h||isNaN(n.w)&&isNaN(n.h))&&(n.w=this.div.offsetWidth,n.h=this.div.offsetHeight),(0==n.w&&0==n.h||isNaN(n.w)&&isNaN(n.h))&&(n.w=parseInt(this.div.style.width),n.h=parseInt(this.div.style.height)),n},calculateBounds:function(n,t){var i=null;if(null==n&&(n=this.getCachedCenter()),null==t&&(t=this.getResolution()),null!=n&&null!=t)var i=this.size.w*t/2,r=this.size.h*t/2,i=new OpenLayers.Bounds(n.lon-i,n.lat-r,n.lon+i,n.lat+r);return i},getCenter:function(){var n=null,t=this.getCachedCenter();return t&&(n=t.clone()),n},getCachedCenter:function(){return!this.center&&this.size&&(this.center=this.getLonLatFromViewPortPx({x:this.size.w/2,y:this.size.h/2})),this.center},getZoom:function(){return this.zoom},pan:function(n,t,i){if(i=OpenLayers.Util.applyDefaults(i,{animate:!0,dragging:!1}),i.dragging)0==n&&0==t||this.moveByPx(n,t);else{var r=this.getViewPortPxFromLonLat(this.getCachedCenter());n=r.add(n,t),(this.dragging||!n.equals(r))&&(r=this.getLonLatFromViewPortPx(n),i.animate?this.panTo(r):(this.moveTo(r),this.dragging&&(this.dragging=!1,this.events.triggerEvent("moveend"))))}},panTo:function(n){var t;if(this.panTween&&this.getExtent().scale(this.panRatio).containsLonLat(n)){if(t=this.getCachedCenter(),!n.equals(t)){var t=this.getPixelFromLonLat(t),i=this.getPixelFromLonLat(n),r=0,u=0;this.panTween.start({x:0,y:0},{x:i.x-t.x,y:i.y-t.y},this.panDuration,{callbacks:{eachStep:OpenLayers.Function.bind(function(n){this.moveByPx(n.x-r,n.y-u),r=Math.round(n.x),u=Math.round(n.y)},this),done:OpenLayers.Function.bind(function(){this.moveTo(n),this.dragging=!1,this.events.triggerEvent("moveend")},this)}})}}else this.setCenter(n)},setCenter:function(n,t,i,r){this.panTween&&this.panTween.stop(),this.zoomTween&&this.zoomTween.stop(),this.moveTo(n,t,{dragging:i,forceZoomChange:r})},moveByPx:function(n,t){var i=this.size.w/2,r=this.size.h/2,u=i+n,o=r+t,s=this.baseLayer.wrapDateLine,f=0,e=0;if(this.restrictedExtent&&(f=i,e=r,s=!1),n=s||u<=this.maxPx.x-f&&u>=this.minPx.x+f?Math.round(n):0,t=o<=this.maxPx.y-e&&o>=this.minPx.y+e?Math.round(t):0,n||t){for(this.dragging||(this.dragging=!0,this.events.triggerEvent("movestart")),this.center=null,n&&(this.layerContainerOriginPx.x-=n,this.minPx.x-=n,this.maxPx.x-=n),t&&(this.layerContainerOriginPx.y-=t,this.minPx.y-=t,this.maxPx.y-=t),this.applyTransform(),r=0,u=this.layers.length;r<u;++r)i=this.layers[r],i.visibility&&(i===this.baseLayer||i.inRange)&&(i.moveByPx(n,t),i.events.triggerEvent("move"));this.events.triggerEvent("move")}},adjustZoom:function(n){var r,i,t,u;if(this.baseLayer&&this.baseLayer.wrapDateLine&&(r=this.baseLayer.resolutions,i=this.getMaxExtent().getWidth()/this.size.w,this.getResolutionForZoom(n)>i))if(this.fractionalZoom)n=this.getZoomForResolution(i);else for(t=n|0,u=r.length;t<u;++t)if(r[t]<=i){n=t;break}return n},getMinZoom:function(){return this.adjustZoom(0)},moveTo:function(n,t,i){var e,u,r,f;if(null==n||n instanceof OpenLayers.LonLat||(n=new OpenLayers.LonLat(n)),i||(i={}),null!=t&&(t=parseFloat(t),this.fractionalZoom||(t=Math.round(t))),e=t,t=this.adjustZoom(t),t!==e&&(n=this.getCenter()),e=i.dragging||this.dragging,u=i.forceZoomChange,this.getCachedCenter()||this.isValidLonLat(n)||(n=this.maxExtent.getCenterLonLat(),this.center=n.clone()),null!=this.restrictedExtent&&(null==n&&(n=this.center),null==t&&(t=this.getZoom()),r=this.getResolutionForZoom(t),r=this.calculateBounds(n,r),this.restrictedExtent.containsBounds(r)||(f=this.restrictedExtent.getCenterLonLat(),r.getWidth()>this.restrictedExtent.getWidth()?n=new OpenLayers.LonLat(f.lon,n.lat):r.left<this.restrictedExtent.left?n=n.add(this.restrictedExtent.left-r.left,0):r.right>this.restrictedExtent.right&&(n=n.add(this.restrictedExtent.right-r.right,0)),r.getHeight()>this.restrictedExtent.getHeight()?n=new OpenLayers.LonLat(n.lon,f.lat):r.bottom<this.restrictedExtent.bottom?n=n.add(0,this.restrictedExtent.bottom-r.bottom):r.top>this.restrictedExtent.top&&(n=n.add(0,this.restrictedExtent.top-r.top)))),u=u||this.isValidZoomLevel(t)&&t!=this.getZoom(),r=this.isValidLonLat(n)&&!n.equals(this.center),u||r||e){if(e||this.events.triggerEvent("movestart",{zoomChanged:u}),r&&(!u&&this.center&&this.centerLayerContainer(n),this.center=n.clone()),n=u?this.getResolutionForZoom(t):this.getResolution(),u||null==this.layerContainerOrigin){this.layerContainerOrigin=this.getCachedCenter(),this.layerContainerOriginPx.x=0,this.layerContainerOriginPx.y=0,this.applyTransform();var r=this.getMaxExtent({restricted:!0}),o=r.getCenterLonLat(),f=this.center.lon-o.lon,o=o.lat-this.center.lat,s=Math.round(r.getWidth()/n),h=Math.round(r.getHeight()/n);this.minPx={x:(this.size.w-s)/2-f/n,y:(this.size.h-h)/2-o/n},this.maxPx={x:this.minPx.x+Math.round(r.getWidth()/n),y:this.minPx.y+Math.round(r.getHeight()/n)}}for(u&&(this.zoom=t,this.resolution=n),n=this.getExtent(),this.baseLayer.visibility&&(this.baseLayer.moveTo(n,u,i.dragging),i.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:u})),n=this.baseLayer.getExtent(),t=this.layers.length-1;0<=t;--t)r=this.layers[t],r===this.baseLayer||r.isBaseLayer||(f=r.calculateInRange(),r.inRange!=f&&((r.inRange=f)||r.display(!1),this.events.triggerEvent("changelayer",{layer:r,property:"visibility"})),f&&r.visibility&&(r.moveTo(n,u,i.dragging),i.dragging||r.events.triggerEvent("moveend",{zoomChanged:u})));if(this.events.triggerEvent("move"),e||this.events.triggerEvent("moveend"),u){for(t=0,i=this.popups.length;t<i;t++)this.popups[t].updatePosition();this.events.triggerEvent("zoomend")}}},centerLayerContainer:function(n){var t=this.getViewPortPxFromLonLat(this.layerContainerOrigin),r=this.getViewPortPxFromLonLat(n),i,u;null!=t&&null!=r&&(i=this.layerContainerOriginPx.x,n=this.layerContainerOriginPx.y,u=Math.round(t.x-r.x),t=Math.round(t.y-r.y),this.applyTransform(this.layerContainerOriginPx.x=u,this.layerContainerOriginPx.y=t),i-=u,n-=t,this.minPx.x-=i,this.maxPx.x-=i,this.minPx.y-=n,this.maxPx.y-=n)},isValidZoomLevel:function(n){return null!=n&&0<=n&&n<this.getNumZoomLevels()},isValidLonLat:function(n){var t=!1;return null!=n&&(t=this.getMaxExtent(),t=t.containsLonLat(n,{worldBounds:this.baseLayer.wrapDateLine&&t})),t},getProjection:function(){var n=this.getProjectionObject();return n?n.getCode():null},getProjectionObject:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.projection),n},getMaxResolution:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.maxResolution),n},getMaxExtent:function(n){var t=null;return n&&n.restricted&&this.restrictedExtent?t=this.restrictedExtent:null!=this.baseLayer&&(t=this.baseLayer.maxExtent),t},getNumZoomLevels:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.numZoomLevels),n},getExtent:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.getExtent()),n},getResolution:function(){var n=null;return null!=this.baseLayer?n=this.baseLayer.getResolution():!0===this.allOverlays&&0<this.layers.length&&(n=this.layers[0].getResolution()),n},getUnits:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.units),n},getScale:function(){var n=null;return null!=this.baseLayer&&(n=this.getResolution(),n=OpenLayers.Util.getScaleFromResolution(n,this.baseLayer.units)),n},getZoomForExtent:function(n,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForExtent(n,t)),i},getResolutionForZoom:function(n){var t=null;return this.baseLayer&&(t=this.baseLayer.getResolutionForZoom(n)),t},getZoomForResolution:function(n,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForResolution(n,t)),i},zoomTo:function(n,t){var i=this;if(i.isValidZoomLevel(n))if(i.baseLayer.wrapDateLine&&(n=i.adjustZoom(n)),i.zoomTween){var f=i.getResolution(),r=i.getResolutionForZoom(n),u={scale:1},f={scale:f/r};i.zoomTween.playing&&i.zoomTween.duration<3*i.zoomDuration?i.zoomTween.finish={scale:i.zoomTween.finish.scale*f.scale}:(t||(r=i.getSize(),t={x:r.w/2,y:r.h/2}),i.zoomTween.start(u,f,i.zoomDuration,{minFrameRate:50,callbacks:{eachStep:function(n){var r=i.layerContainerOriginPx;n=n.scale,i.applyTransform(r.x+((n-1)*(r.x-t.x)|0),r.y+((n-1)*(r.y-t.y)|0),n)},done:function(n){i.applyTransform(),n=i.getResolution()/n.scale;var r=i.getZoomForResolution(n,!0);i.moveTo(i.getZoomTargetCenter(t,n),r,!0)}}}))}else u=t?i.getZoomTargetCenter(t,i.getResolutionForZoom(n)):null,i.setCenter(u,n)},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(n,t){n instanceof OpenLayers.Bounds||(n=new OpenLayers.Bounds(n));var i=n.getCenterLonLat();if(this.baseLayer.wrapDateLine){for(i=this.getMaxExtent(),n=n.clone();n.right<n.left;)n.right+=i.getWidth();i=n.getCenterLonLat().wrapDateLine(i)}this.setCenter(i,this.getZoomForExtent(n,t))},zoomToMaxExtent:function(n){n=this.getMaxExtent({restricted:n?n.restricted:!0}),this.zoomToExtent(n)},zoomToScale:function(n,t){var i=OpenLayers.Util.getResolutionFromScale(n,this.baseLayer.units),u=this.size.w*i/2,i=this.size.h*i/2,r=this.getCachedCenter(),u=new OpenLayers.Bounds(r.lon-u,r.lat-i,r.lon+u,r.lat+i);this.zoomToExtent(u,t)},getLonLatFromViewPortPx:function(n){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getLonLatFromViewPortPx(n)),t},getViewPortPxFromLonLat:function(n){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getViewPortPxFromLonLat(n)),t},getZoomTargetCenter:function(n,t){var u=null,i=this.getSize(),f=i.w/2-n.x,i=n.y-i.h/2,r=this.getLonLatFromPixel(n);return r&&(u=new OpenLayers.LonLat(r.lon+f*t,r.lat+i*t)),u},getLonLatFromPixel:function(n){return this.getLonLatFromViewPortPx(n)},getPixelFromLonLat:function(n){return n=this.getViewPortPxFromLonLat(n),n.x=Math.round(n.x),n.y=Math.round(n.y),n},getGeodesicPixelSize:function(n){var i=n?this.getLonLatFromPixel(n):this.getCachedCenter()||new OpenLayers.LonLat(0,0),t=this.getResolution();n=i.add(-t/2,0);var u=i.add(t/2,0),f=i.add(0,-t/2),i=i.add(0,t/2),t=new OpenLayers.Projection("EPSG:4326"),r=this.getProjectionObject()||t;return r.equals(t)||(n.transform(r,t),u.transform(r,t),f.transform(r,t),i.transform(r,t)),new OpenLayers.Size(OpenLayers.Util.distVincenty(n,u),OpenLayers.Util.distVincenty(f,i))},getViewPortPxFromLayerPx:function(n){var t=null;return null!=n&&(t=n.add(this.layerContainerOriginPx.x,this.layerContainerOriginPx.y)),t},getLayerPxFromViewPortPx:function(n){var t=null;return null!=n&&(t=n.add(-this.layerContainerOriginPx.x,-this.layerContainerOriginPx.y),isNaN(t.x)||isNaN(t.y))&&(t=null),t},getLonLatFromLayerPx:function(n){return n=this.getViewPortPxFromLayerPx(n),this.getLonLatFromViewPortPx(n)},getLayerPxFromLonLat:function(n){return n=this.getPixelFromLonLat(n),this.getLayerPxFromViewPortPx(n)},applyTransform:function(n,t,i){var e,o,s;i=i||1,e=this.layerContainerOriginPx,o=1!==i,n=n||e.x,t=t||e.y;var f=this.layerContainerDiv.style,u=this.applyTransform.transform,r=this.applyTransform.template;void 0===u&&(u=OpenLayers.Util.vendorPrefix.style("transform"),this.applyTransform.transform=u)&&(s=OpenLayers.Element.getStyle(this.viewPortDiv,OpenLayers.Util.vendorPrefix.css("transform")),s&&"none"===s||(r=["translate3d(",",0) ","scale3d(",",1)"],f[u]=[r[0],"0,0",r[1]].join("")),r&&~f[u].indexOf(r[0])||(r=["translate(",") ","scale(",")"]),this.applyTransform.template=r),null===u||"translate3d("!==r[0]&&!0!==o?(f.left=n+"px",f.top=t+"px",null!==u&&(f[u]="")):(!0===o&&"translate("===r[0]&&(n-=e.x,t-=e.y,f.left=e.x+"px",f.top=e.y+"px"),f[u]=[r[0],n,"px,",t,"px",r[1],r[2],i,",",i,r[3]].join(""))},CLASS_NAME:"OpenLayers.Map"}),OpenLayers.Map.TILE_WIDTH=256,OpenLayers.Map.TILE_HEIGHT=256,OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:!1,evt:null,touch:!1,initialize:function(n,t,i){OpenLayers.Util.extend(this,i),this.control=n,this.callbacks=t,(n=this.map||n.map)&&this.setMap(n),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(n){this.map=n},checkModifiers:function(n){return null==this.keyMask?!0:((n.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(n.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(n.altKey?OpenLayers.Handler.MOD_ALT:0)|(n.metaKey?OpenLayers.Handler.MOD_META:0))==this.keyMask},activate:function(){if(this.active)return!1;for(var t=OpenLayers.Events.prototype.BROWSER_EVENTS,n=0,i=t.length;n<i;n++)this[t[n]]&&this.register(t[n],this[t[n]]);return this.active=!0},deactivate:function(){if(!this.active)return!1;for(var t=OpenLayers.Events.prototype.BROWSER_EVENTS,n=0,i=t.length;n<i;n++)this[t[n]]&&this.unregister(t[n],this[t[n]]);return this.active=this.touch=!1,!0},startTouch:function(){if(!this.touch){this.touch=!0;for(var t="mousedown mouseup mousemove click dblclick mouseout".split(" "),n=0,i=t.length;n<i;n++)this[t[n]]&&this.unregister(t[n],this[t[n]])}},callback:function(n,t){n&&this.callbacks[n]&&this.callbacks[n].apply(this.control,t)},register:function(n,t){this.map.events.registerPriority(n,this,t),this.map.events.registerPriority(n,this,this.setEvent)},unregister:function(n,t){this.map.events.unregister(n,this,t),this.map.events.unregister(n,this,this.setEvent)},setEvent:function(n){return this.evt=n,!0},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.Handler.MOD_META=8,OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:!0,double:!1,pixelTolerance:0,dblclickTolerance:13,stopSingle:!1,stopDouble:!1,timerId:null,down:null,last:null,first:null,rightclickTimerId:null,touchstart:function(n){return this.startTouch(),this.down=this.getEventInfo(n),this.last=this.getEventInfo(n),!0},touchmove:function(n){return this.last=this.getEventInfo(n),!0},touchend:function(n){return this.down&&(n.xy=this.last.xy,n.lastTouches=this.last.touches,this.handleSingle(n),this.down=null),!0},mousedown:function(n){return this.down=this.getEventInfo(n),this.last=this.getEventInfo(n),!0},mouseup:function(n){var t=!0;return this.checkModifiers(n)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(n)&&(t=this.rightclick(n)),t},rightclick:function(n){if(this.passesTolerance(n)){if(null!=this.rightclickTimerId)return this.clearTimer(),this.callback("dblrightclick",[n]),!this.stopDouble;n=this.double?OpenLayers.Util.extend({},n):this.callback("rightclick",[n]),n=OpenLayers.Function.bind(this.delayedRightCall,this,n),this.rightclickTimerId=window.setTimeout(n,this.delay)}return!this.stopSingle},delayedRightCall:function(n){this.rightclickTimerId=null,n&&this.callback("rightclick",[n])},click:function(n){return this.last||(this.last=this.getEventInfo(n)),this.handleSingle(n),!this.stopSingle},dblclick:function(n){return this.handleDouble(n),!this.stopDouble},handleDouble:function(n){this.passesDblclickTolerance(n)&&(this.double&&this.callback("dblclick",[n]),this.clearTimer())},handleSingle:function(n){this.passesTolerance(n)&&(null!=this.timerId?(this.last.touches&&1===this.last.touches.length&&(this.double&&OpenLayers.Event.preventDefault(n),this.handleDouble(n)),this.last.touches&&2===this.last.touches.length||this.clearTimer()):(this.first=this.getEventInfo(n),n=this.single?OpenLayers.Util.extend({},n):null,this.queuePotentialClick(n)))},queuePotentialClick:function(n){this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,n),this.delay)},passesTolerance:function(n){var t=!0,i;if(null!=this.pixelTolerance&&this.down&&this.down.xy&&(t=this.pixelTolerance>=this.down.xy.distanceTo(n.xy))&&this.touch&&this.down.touches.length===this.last.touches.length)for(n=0,i=this.down.touches.length;n<i;++n)if(this.getTouchDistance(this.down.touches[n],this.last.touches[n])>this.pixelTolerance){t=!1;break}return t},getTouchDistance:function(n,t){return Math.sqrt(Math.pow(n.clientX-t.clientX,2)+Math.pow(n.clientY-t.clientY,2))},passesDblclickTolerance:function(n){return n=!0,this.down&&this.first&&(n=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance),n},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null),null!=this.rightclickTimerId&&(window.clearTimeout(this.rightclickTimerId),this.rightclickTimerId=null)},delayedCall:function(n){this.timerId=null,n&&this.callback("click",[n])},getEventInfo:function(n){var i,r,u,t;if(n.touches)for(r=n.touches.length,i=Array(r),t=0;t<r;t++)u=n.touches[t],i[t]={clientX:u.olClientX,clientY:u.olClientY};return{xy:n.xy,touches:i}},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),this.last=this.first=this.down=null,n=!0),n},CLASS_NAME:"OpenLayers.Handler.Click"}),OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!0,dragging:!1,last:null,start:null,lastMoveEvt:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:!1,documentEvents:null,initialize:function(){if(OpenLayers.Handler.prototype.initialize.apply(this,arguments),!0===this.documentDrag){var r=this;this._docMove=function(n){r.mousemove({xy:{x:n.clientX,y:n.clientY},element:document})},this._docUp=function(n){r.mouseup({xy:{x:n.clientX,y:n.clientY}})}}},dragstart:function(n){var t=!0;return this.dragging=!1,this.checkModifiers(n)&&(OpenLayers.Event.isLeftClick(n)||OpenLayers.Event.isSingleTouch(n))?(this.started=!0,this.last=this.start=n.xy,OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown"),this.down(n),this.callback("down",[n.xy]),OpenLayers.Event.preventDefault(n),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart?document.onselectstart:OpenLayers.Function.True),document.onselectstart=OpenLayers.Function.False,t=!this.stopDown):(this.started=!1,this.last=this.start=null),t},dragmove:function(n){return this.lastMoveEvt=n,!this.started||this.timeoutId||n.xy.x==this.last.x&&n.xy.y==this.last.y||(!0===this.documentDrag&&this.documentEvents&&(n.element===document?(this.adjustXY(n),this.setEvent(n)):this.removeDocumentEvents()),0<this.interval&&(this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)),this.dragging=!0,this.move(n),this.callback("move",[n.xy]),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart,document.onselectstart=OpenLayers.Function.False),this.last=n.xy),!0},dragend:function(n){if(this.started){!0===this.documentDrag&&this.documentEvents&&(this.adjustXY(n),this.removeDocumentEvents());var t=this.start!=this.last;this.dragging=this.started=!1,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown"),this.up(n),this.callback("up",[n.xy]),t&&this.callback("done",[n.xy]),document.onselectstart=this.oldOnselectstart}return!0},down:function(){},move:function(){},up:function(){},out:function(){},mousedown:function(n){return this.dragstart(n)},touchstart:function(n){return this.startTouch(),this.dragstart(n)},mousemove:function(n){return this.dragmove(n)},touchmove:function(n){return this.dragmove(n)},removeTimeout:function(){this.timeoutId=null,this.dragging&&this.mousemove(this.lastMoveEvt)},mouseup:function(n){return this.dragend(n)},touchend:function(n){return n.xy=this.last,this.dragend(n)},mouseout:function(n){if(this.started&&OpenLayers.Util.mouseLeft(n,this.map.viewPortDiv))if(!0===this.documentDrag)this.addDocumentEvents();else{var t=this.start!=this.last;this.dragging=this.started=!1,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown"),this.out(n),this.callback("out",[]),t&&this.callback("done",[n.xy]),document.onselectstart&&(document.onselectstart=this.oldOnselectstart)}return!0},click:function(){return this.start==this.last},activate:function(){var n=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.dragging=!1,n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.dragging=this.started=!1,this.last=this.start=null,n=!0,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")),n},adjustXY:function(n){var t=OpenLayers.Util.pagePosition(this.map.viewPortDiv);n.xy.x-=t[0],n.xy.y-=t[1]},addDocumentEvents:function(){OpenLayers.Element.addClass(document.body,"olDragDown"),this.documentEvents=!0,OpenLayers.Event.observe(document,"mousemove",this._docMove),OpenLayers.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown"),this.documentEvents=!1,OpenLayers.Event.stopObserving(document,"mousemove",this._docMove),OpenLayers.Event.stopObserving(document,"mouseup",this._docUp)},CLASS_NAME:"OpenLayers.Handler.Drag"}),OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:{w:180,h:90},layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:!1,handlers:null,resolutionFactor:1,maximized:!1,maximizeTitle:"",minimizeTitle:"",initialize:function(n){this.layers=[],this.handlers={},OpenLayers.Control.prototype.initialize.apply(this,[n])},destroy:function(){this.mapDiv&&(this.handlers.click&&this.handlers.click.destroy(),this.handlers.drag&&this.handlers.drag.destroy(),this.ovmap&&this.ovmap.viewPortDiv.removeChild(this.extentRectangle),this.extentRectangle=null,this.rectEvents&&(this.rectEvents.destroy(),this.rectEvents=null),this.ovmap&&(this.ovmap.destroy(),this.ovmap=null),this.element.removeChild(this.mapDiv),this.mapDiv=null,this.div.removeChild(this.element),this.element=null,this.maximizeDiv&&(this.div.removeChild(this.maximizeDiv),this.maximizeDiv=null),this.minimizeDiv&&(this.div.removeChild(this.minimizeDiv),this.minimizeDiv=null),this.map.events.un({buttonclick:this.onButtonClick,moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments))},draw:function(){if(OpenLayers.Control.prototype.draw.apply(this,arguments),0===this.layers.length)if(this.map.baseLayer)this.layers=[this.map.baseLayer.clone()];else return this.map.events.register("changebaselayer",this,this.baseLayerDraw),this.div;if(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=1e3,this.extentRectangle.className=this.displayClass+"ExtentRectangle",this.element.appendChild(this.mapDiv),this.div.appendChild(this.element),this.outsideViewport)this.element.style.display="";else{this.div.className+=" "+this.displayClass+"Container";var n=OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,null,n,"absolute"),this.maximizeDiv.style.display="none",this.maximizeDiv.className=this.displayClass+"MaximizeButton olButton",this.maximizeTitle&&(this.maximizeDiv.title=this.maximizeTitle),this.div.appendChild(this.maximizeDiv),n=OpenLayers.Util.getImageLocation("layer-switcher-minimize.png"),this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,null,n,"absolute"),this.minimizeDiv.style.display="none",this.minimizeDiv.className=this.displayClass+"MinimizeButton olButton",this.minimizeTitle&&(this.minimizeDiv.title=this.minimizeTitle),this.div.appendChild(this.minimizeDiv),this.minimizeControl()}this.map.getExtent()&&this.update();this.map.events.on({buttonclick:this.onButtonClick,moveend:this.update,scope:this});return this.maximized&&this.maximizeControl(),this.div},baseLayerDraw:function(){this.draw(),this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(n){var i=this.handlers.drag.last.x-n.x,t=this.handlers.drag.last.y-n.y,r,u;if(0!=i||0!=t){r=this.rectPxBounds.top,u=this.rectPxBounds.left,n=Math.abs(this.rectPxBounds.getHeight());var f=this.rectPxBounds.getWidth(),t=Math.max(0,r-t),t=Math.min(t,this.ovmap.size.h-this.hComp-n),i=Math.max(0,u-i),i=Math.min(i,this.ovmap.size.w-this.wComp-f);this.setRectPxBounds(new OpenLayers.Bounds(i,t+n,i+f,t))}},mapDivClick:function(n){var r=this.rectPxBounds.getCenterPixel(),t=n.xy.x-r.x,i=n.xy.y-r.y,u=this.rectPxBounds.top,f=this.rectPxBounds.left;n=Math.abs(this.rectPxBounds.getHeight()),r=this.rectPxBounds.getWidth(),i=Math.max(0,u+i),i=Math.min(i,this.ovmap.size.h-n),t=Math.max(0,f+t),t=Math.min(t,this.ovmap.size.w-r),this.setRectPxBounds(new OpenLayers.Bounds(t,i+n,t+r,i)),this.updateMapToRect()},onButtonClick:function(n){n.buttonElement===this.minimizeDiv?this.minimizeControl():n.buttonElement===this.maximizeDiv&&this.maximizeControl()},maximizeControl:function(n){this.element.style.display="",this.showToggle(!1),null!=n&&OpenLayers.Event.stop(n)},minimizeControl:function(n){this.element.style.display="none",this.showToggle(!0),null!=n&&OpenLayers.Event.stop(n)},showToggle:function(n){this.maximizeDiv&&(this.maximizeDiv.style.display=n?"":"none"),this.minimizeDiv&&(this.minimizeDiv.style.display=n?"none":"")},update:function(){null==this.ovmap&&this.createMap(),!this.autoPan&&this.isSuitableOverview()||this.updateOverview(),this.updateRectToMap()},isSuitableOverview:function(){var t=this.map.getExtent(),n=this.map.getMaxExtent(),t=new OpenLayers.Bounds(Math.max(t.left,n.left),Math.max(t.bottom,n.bottom),Math.min(t.right,n.right),Math.min(t.top,n.top));return this.ovmap.getProjection()!=this.map.getProjection()&&(t=t.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())),n=this.ovmap.getResolution()/this.map.getResolution(),n>this.minRatio&&n<=this.maxRatio&&this.ovmap.getExtent().containsBounds(t)},updateOverview:function(){var n=this.map.getResolution(),t=this.ovmap.getResolution(),i=t/n;i>this.maxRatio?t=this.minRatio*n:i<=this.minRatio&&(t=this.maxRatio*n),this.ovmap.getProjection()!=this.map.getProjection()?(n=this.map.center.clone(),n.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())):n=this.map.center,this.ovmap.setCenter(n,this.ovmap.getZoomForResolution(t*this.resolutionFactor)),this.updateRectToMap()},createMap:function(){var n=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:!1},this.mapOptions),t;this.ovmap=new OpenLayers.Map(this.mapDiv,n),this.ovmap.viewPortDiv.appendChild(this.extentRectangle),OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy),this.ovmap.addLayers(this.layers),this.ovmap.zoomToMaxExtent(),this.wComp=(this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width")))?this.wComp:2,this.hComp=(this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width")))?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:!0,double:!1,stopSingle:!0,stopDouble:!0,pixelTolerance:1,map:this.ovmap}),this.handlers.click.activate(),this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,!0),this.rectEvents.register("mouseover",this,function(){this.handlers.drag.active||this.map.dragging||this.handlers.drag.activate()}),this.rectEvents.register("mouseout",this,function(){this.handlers.drag.dragging||this.handlers.drag.deactivate()}),this.ovmap.getProjection()!=this.map.getProjection()&&(n=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,t=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units,this.resolutionFactor=n&&t?OpenLayers.INCHES_PER_UNIT[n]/OpenLayers.INCHES_PER_UNIT[t]:1)},updateRectToMap:function(){var n;n=this.ovmap.getProjection()!=this.map.getProjection()?this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()):this.map.getExtent(),(n=this.getRectBoundsFromMapBounds(n))&&this.setRectPxBounds(n)},updateMapToRect:function(){var n=this.getMapBoundsFromRectBounds(this.rectPxBounds);this.ovmap.getProjection()!=this.map.getProjection()&&(n=n.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())),this.map.panTo(n.getCenterLonLat())},setRectPxBounds:function(n){var i=Math.max(n.top,0),r=Math.max(n.left,0),f=Math.min(n.top+Math.abs(n.getHeight()),this.ovmap.size.h-this.hComp),t,u;n=Math.min(n.left+n.getWidth(),this.ovmap.size.w-this.wComp),t=Math.max(n-r,0),u=Math.max(f-i,0),t<this.minRectSize||u<this.minRectSize?(this.extentRectangle.className=this.displayClass+this.minRectDisplayClass,t=r+t/2-this.minRectSize/2,this.extentRectangle.style.top=Math.round(i+u/2-this.minRectSize/2)+"px",this.extentRectangle.style.left=Math.round(t)+"px",this.extentRectangle.style.height=this.minRectSize+"px",this.extentRectangle.style.width=this.minRectSize+"px"):(this.extentRectangle.className=this.displayClass+"ExtentRectangle",this.extentRectangle.style.top=Math.round(i)+"px",this.extentRectangle.style.left=Math.round(r)+"px",this.extentRectangle.style.height=Math.round(u)+"px",this.extentRectangle.style.width=Math.round(t)+"px"),this.rectPxBounds=new OpenLayers.Bounds(Math.round(r),Math.round(f),Math.round(n),Math.round(i))},getRectBoundsFromMapBounds:function(n){var t=this.getOverviewPxFromLonLat({lon:n.left,lat:n.bottom}),i;return n=this.getOverviewPxFromLonLat({lon:n.right,lat:n.top}),i=null,t&&n&&(i=new OpenLayers.Bounds(t.x,t.y,n.x,n.y)),i},getMapBoundsFromRectBounds:function(n){var t=this.getLonLatFromOverviewPx({x:n.left,y:n.bottom});return n=this.getLonLatFromOverviewPx({x:n.right,y:n.top}),new OpenLayers.Bounds(t.lon,t.lat,n.lon,n.lat)},getLonLatFromOverviewPx:function(n){var t=this.ovmap.size,i=this.ovmap.getResolution(),r=this.ovmap.getExtent().getCenterLonLat();return{lon:r.lon+(n.x-t.w/2)*i,lat:r.lat-(n.y-t.h/2)*i}},getOverviewPxFromLonLat:function(n){var i=this.ovmap.getResolution(),t=this.ovmap.getExtent();if(t)return{x:Math.round(1/i*(n.lon-t.left)),y:Math.round(1/i*(t.top-n.lat))}},CLASS_NAME:"OpenLayers.Control.OverviewMap"}),OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:1,alwaysInRange:null,RESOLUTION_PROPERTIES:"scales resolutions maxScale minScale maxResolution minResolution numZoomLevels maxZoomLevel".split(" "),events:null,map:null,isBaseLayer:!1,alpha:!1,displayInLayerSwitcher:!0,visibility:!0,attribution:null,inRange:!1,imageSize: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:!1,wrapDateLine:!1,metadata:null,initialize:function(n,t){if(this.metadata={},t=OpenLayers.Util.extend({},t),null!=this.alwaysInRange&&(t.alwaysInRange=this.alwaysInRange),this.addOptions(t),this.name=n,null==this.id&&(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.eventListeners instanceof Object))this.events.on(this.eventListeners)},destroy:function(n){null==n&&(n=!0),null!=this.map&&this.map.removeLayer(this,n),this.options=this.div=this.name=this.map=this.projection=null,this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy()),this.events=this.eventListeners=null},clone:function(n){return null==n&&(n=new OpenLayers.Layer(this.name,this.getOptions())),OpenLayers.Util.applyDefaults(n,this),n.map=null,n},getOptions:function(){var t={},n;for(n in this.options)t[n]=this[n];return t},setName:function(n){n!=this.name&&(this.name=n,null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"name"}))},addOptions:function(n,t){if(null==this.options&&(this.options={}),n&&("string"==typeof n.projection&&(n.projection=new OpenLayers.Projection(n.projection)),n.projection&&OpenLayers.Util.applyDefaults(n,OpenLayers.Projection.defaults[n.projection.getCode()]),!n.maxExtent||n.maxExtent instanceof OpenLayers.Bounds||(n.maxExtent=new OpenLayers.Bounds(n.maxExtent)),!n.minExtent||n.minExtent instanceof OpenLayers.Bounds||(n.minExtent=new OpenLayers.Bounds(n.minExtent))),OpenLayers.Util.extend(this.options,n),OpenLayers.Util.extend(this,n),this.projection&&this.projection.getUnits()&&(this.units=this.projection.getUnits()),this.map){var r=this.map.getResolution(),u=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]),i;for(i in n)if(n.hasOwnProperty(i)&&0<=OpenLayers.Util.indexOf(u,i)){this.initResolutions(),t&&this.map.baseLayer===this&&(this.map.setCenter(this.map.getCenter(),this.map.getZoomForResolution(r),!1,!0),this.map.events.triggerEvent("changebaselayer",{layer:this}));break}}},onMapResize:function(){},redraw:function(){var t=!1,n;return this.map&&(this.inRange=this.calculateInRange(),n=this.getExtent(),n&&this.inRange&&this.visibility&&(this.moveTo(n,!0,!1),this.events.triggerEvent("moveend",{zoomChanged:!0}),t=!0)),t},moveTo:function(n){n=this.visibility,this.isBaseLayer||(n=n&&this.inRange),this.display(n)},moveByPx:function(){},setMap:function(n){null==this.map&&(this.map=n,this.maxExtent=this.maxExtent||this.map.maxExtent,this.minExtent=this.minExtent||this.map.minExtent,this.projection=this.projection||this.map.projection,"string"==typeof this.projection&&(this.projection=new OpenLayers.Projection(this.projection)),this.units=this.projection.getUnits()||this.units||this.map.units,this.initResolutions(),this.isBaseLayer||(this.inRange=this.calculateInRange(),this.div.style.display=this.visibility&&this.inRange?"":"none"),this.setTileSize())},afterAdd:function(){},removeMap:function(){},getImageSize:function(){return this.imageSize||this.tileSize},setTileSize:function(n){this.tileSize=n=n?n:this.tileSize?this.tileSize:this.map.getTileSize(),this.gutter&&(this.imageSize=new OpenLayers.Size(n.w+2*this.gutter,n.h+2*this.gutter))},getVisibility:function(){return this.visibility},setVisibility:function(n){n!=this.visibility&&(this.visibility=n,this.display(n),this.redraw(),null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"}),this.events.triggerEvent("visibilitychanged"))},display:function(n){n!=("none"!=this.div.style.display)&&(this.div.style.display=n&&this.calculateInRange()?"block":"none")},calculateInRange:function(){var n=!1;return this.alwaysInRange?n=!0:this.map&&(n=this.map.getResolution(),n=n>=this.minResolution&&n<=this.maxResolution),n},setIsBaseLayer:function(n){n!=this.isBaseLayer&&(this.isBaseLayer=n,null!=this.map&&this.map.events.triggerEvent("changebaselayer",{layer:this}))},initResolutions:function(){for(var i,n={},e=!0,u,f,t=0,r=this.RESOLUTION_PROPERTIES.length;t<r;t++)i=this.RESOLUTION_PROPERTIES[t],n[i]=this.options[i],e&&this.options[i]&&(e=!1);if(null==this.options.alwaysInRange&&(this.alwaysInRange=e),null==n.resolutions&&(n.resolutions=this.resolutionsFromScales(n.scales)),null==n.resolutions&&(n.resolutions=this.calculateResolutions(n)),null==n.resolutions){for(t=0,r=this.RESOLUTION_PROPERTIES.length;t<r;t++)i=this.RESOLUTION_PROPERTIES[t],n[i]=null!=this.options[i]?this.options[i]:this.map[i];null==n.resolutions&&(n.resolutions=this.resolutionsFromScales(n.scales)),null==n.resolutions&&(n.resolutions=this.calculateResolutions(n))}if(this.options.maxResolution&&"auto"!==this.options.maxResolution&&(u=this.options.maxResolution),this.options.minScale&&(u=OpenLayers.Util.getResolutionFromScale(this.options.minScale,this.units)),this.options.minResolution&&"auto"!==this.options.minResolution&&(f=this.options.minResolution),this.options.maxScale&&(f=OpenLayers.Util.getResolutionFromScale(this.options.maxScale,this.units)),n.resolutions&&(n.resolutions.sort(function(n,t){return t-n}),u||(u=n.resolutions[0]),f||(f=n.resolutions[n.resolutions.length-1])),this.resolutions=n.resolutions){for(r=this.resolutions.length,this.scales=Array(r),t=0;t<r;t++)this.scales[t]=OpenLayers.Util.getScaleFromResolution(this.resolutions[t],this.units);this.numZoomLevels=r}(this.minResolution=f)&&(this.maxScale=OpenLayers.Util.getScaleFromResolution(f,this.units)),(this.maxResolution=u)&&(this.minScale=OpenLayers.Util.getScaleFromResolution(u,this.units))},resolutionsFromScales:function(n){if(null!=n){var i,t,r;for(r=n.length,i=Array(r),t=0;t<r;t++)i[t]=OpenLayers.Util.getResolutionFromScale(n[t],this.units);return i}},calculateResolutions:function(n){var t,r,i=n.maxResolution,f,u;if(null!=n.minScale?i=OpenLayers.Util.getResolutionFromScale(n.minScale,this.units):"auto"==i&&null!=this.maxExtent&&(t=this.map.getSize(),r=this.maxExtent.getWidth()/t.w,t=this.maxExtent.getHeight()/t.h,i=Math.max(r,t)),r=n.minResolution,null!=n.maxScale?r=OpenLayers.Util.getResolutionFromScale(n.maxScale,this.units):"auto"==n.minResolution&&null!=this.minExtent&&(t=this.map.getSize(),r=this.minExtent.getWidth()/t.w,t=this.minExtent.getHeight()/t.h,r=Math.max(r,t)),"number"!=typeof i&&"number"!=typeof r&&null!=this.maxExtent&&(i=this.map.getTileSize(),i=Math.max(this.maxExtent.getWidth()/i.w,this.maxExtent.getHeight()/i.h)),t=n.maxZoomLevel,n=n.numZoomLevels,"number"==typeof r&&"number"==typeof i&&void 0===n?n=Math.floor(Math.log(i/r)/Math.log(2))+1:void 0===n&&null!=t&&(n=t+1),!("number"!=typeof n||0>=n||"number"!=typeof i&&"number"!=typeof r)){if(t=Array(n),f=2,"number"==typeof r&&"number"==typeof i&&(f=Math.pow(i/r,1/(n-1))),"number"==typeof i)for(u=0;u<n;u++)t[u]=i/Math.pow(f,u);else for(u=0;u<n;u++)t[n-1-u]=r*Math.pow(f,u);return t}},getResolution:function(){var n=this.map.getZoom();return this.getResolutionForZoom(n)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(n,t){var i=this.map.getSize(),i=Math.max(n.getWidth()/i.w,n.getHeight()/i.h);return this.getZoomForResolution(i,t)},getDataExtent:function(){},getResolutionForZoom:function(n){if(n=Math.max(0,Math.min(n,this.resolutions.length-1)),this.map.fractionalZoom){var t=Math.floor(n),i=Math.ceil(n);n=this.resolutions[t]-(n-t)*(this.resolutions[t]-this.resolutions[i])}else n=this.resolutions[Math.round(n)];return n},getZoomForResolution:function(n,t){var i,e;if(this.map.fractionalZoom){var r=0,u=this.resolutions[r],o=this.resolutions[this.resolutions.length-1],f;for(i=0,e=this.resolutions.length;i<e;++i)if(f=this.resolutions[i],f>=n&&(u=f,r=i),f<=n){o=f;break}i=u-o,i=0<i?r+(u-n)/i:r}else{for(u=Number.POSITIVE_INFINITY,i=0,e=this.resolutions.length;i<e;i++)if(t){if(r=Math.abs(this.resolutions[i]-n),r>u)break;u=r}else if(this.resolutions[i]<n)break;i=Math.max(0,i-1)}return i},getLonLatFromViewPortPx:function(n){var i=null,t=this.map;if(null!=n&&t.minPx){var i=t.getResolution(),r=t.getMaxExtent({restricted:!0}),i=new OpenLayers.LonLat((n.x-t.minPx.x)*i+r.left,(t.minPx.y-n.y)*i+r.top);this.wrapDateLine&&(i=i.wrapDateLine(this.maxExtent))}return i},getViewPortPxFromLonLat:function(n,t){var i=null;return null!=n&&(t=t||this.map.getResolution(),i=this.map.calculateBounds(null,t),i=new OpenLayers.Pixel(1/t*(n.lon-i.left),1/t*(i.top-n.lat))),i},setOpacity:function(n){var u,r;if(n!=this.opacity){this.opacity=n;for(var i=this.div.childNodes,t=0,f=i.length;t<f;++t)u=i[t].firstChild||i[t],r=i[t].lastChild,r&&"iframe"===r.nodeName.toLowerCase()&&(u=r.parentNode),OpenLayers.Util.modifyDOMElement(u,null,null,null,null,null,null,n);null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(n){this.div.style.zIndex=n},adjustBounds:function(n){if(this.gutter){var t=this.gutter*this.map.getResolution();n=new OpenLayers.Bounds(n.left-t,n.bottom-t,n.right+t,n.top+t)}return this.wrapDateLine&&(t={rightTolerance:this.getResolution(),leftTolerance:this.getResolution()},n=n.wrapDateLine(this.maxExtent,t)),n},CLASS_NAME:"OpenLayers.Layer"}),OpenLayers.Layer.SphericalMercator={getExtent:function(){var n=null;return n=this.sphericalMercator?this.map.calculateBounds():OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)},getLonLatFromViewPortPx:function(){return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this,arguments)},getViewPortPxFromLonLat:function(){return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this,arguments)},initMercatorParameters:function(){this.RESOLUTIONS=[];for(var n=0;n<=this.MAX_ZOOM_LEVEL;++n)this.RESOLUTIONS[n]=156543.03390625/Math.pow(2,n);this.units="m",this.projection=this.projection||"EPSG:900913"},forwardMercator:function(){var n=new OpenLayers.Projection("EPSG:4326"),t=new OpenLayers.Projection("EPSG:900913");return function(i,r){var u=OpenLayers.Projection.transform({x:i,y:r},n,t);return new OpenLayers.LonLat(u.x,u.y)}}(),inverseMercator:function(){var n=new OpenLayers.Projection("EPSG:4326"),t=new OpenLayers.Projection("EPSG:900913");return function(i,r){var u=OpenLayers.Projection.transform({x:i,y:r},t,n);return new OpenLayers.LonLat(u.x,u.y)}}()},OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:!0,isBaseLayer:!0,isFixed:!0,pane:null,mapObject:null,initialize:function(){OpenLayers.Layer.prototype.initialize.apply(this,arguments),null==this.pane&&(this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane"))},destroy:function(){this.pane=this.mapObject=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(){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%","msie"==OpenLayers.BROWSER_NAME&&(this.pane.style.background="url("+OpenLayers.Util.getImageLocation("blank.gif")+")"),this.isFixed?this.map.viewPortDiv.appendChild(this.pane):this.map.layerContainerDiv.appendChild(this.pane),this.loadMapObject(),null==this.mapObject&&this.loadWarningMessage()},removeMap:function(){this.pane&&this.pane.parentNode&&this.pane.parentNode.removeChild(this.pane),OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var n=this.map.getSize(),t=Math.min(n.w,300),i=Math.min(n.h,200),t=new OpenLayers.Size(t,i),n=new OpenLayers.Pixel(n.w/2,n.h/2).add(-t.w/2,-t.h/2),n=OpenLayers.Util.createDiv(this.name+"_warning",n,t,null,null,null,"auto");n.style.padding="7px",n.style.backgroundColor="yellow",n.innerHTML=this.getWarningHTML(),this.div.appendChild(n)},getWarningHTML:function(){return""},display:function(){OpenLayers.Layer.prototype.display.apply(this,arguments),this.pane.style.display=this.div.style.display},setZIndex:function(){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments),this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveByPx:function(n,t){OpenLayers.Layer.prototype.moveByPx.apply(this,arguments),this.dragPanMapObject?this.dragPanMapObject(n,-t):this.moveTo(this.map.getCachedCenter())},moveTo:function(n,t,i){var r,u;if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),null!=this.mapObject&&(r=this.map.getCenter(),u=this.map.getZoom(),null!=r)){var f=this.getMapObjectCenter(),f=this.getOLLonLatFromMapObjectLonLat(f),e=this.getMapObjectZoom(),e=this.getOLZoomFromMapObjectZoom(e);r.equals(f)&&u==e||(!t&&f&&this.dragPanMapObject&&this.smoothDragPan?(u=this.map.getViewPortPxFromLonLat(f),r=this.map.getViewPortPxFromLonLat(r),this.dragPanMapObject(r.x-u.x,u.y-r.y)):(r=this.getMapObjectLonLatFromOLLonLat(r),u=this.getMapObjectZoomFromOLZoom(u),this.setMapObjectCenter(r,u,i)))}},getLonLatFromViewPortPx:function(n){var t=null;return null!=this.mapObject&&null!=this.getMapObjectCenter()&&(n=this.getMapObjectPixelFromOLPixel(n),n=this.getMapObjectLonLatFromMapObjectPixel(n),t=this.getOLLonLatFromMapObjectLonLat(n)),t},getViewPortPxFromLonLat:function(n){var t=null;return null!=this.mapObject&&null!=this.getMapObjectCenter()&&(n=this.getMapObjectLonLatFromOLLonLat(n),n=this.getMapObjectPixelFromMapObjectLonLat(n),t=this.getOLPixelFromMapObjectPixel(n)),t},getOLLonLatFromMapObjectLonLat:function(n){var t=null;return null!=n&&(t=this.getLongitudeFromMapObjectLonLat(n),n=this.getLatitudeFromMapObjectLonLat(n),t=new OpenLayers.LonLat(t,n)),t},getMapObjectLonLatFromOLLonLat:function(n){var t=null;return null!=n&&(t=this.getMapObjectLonLatFromLonLat(n.lon,n.lat)),t},getOLPixelFromMapObjectPixel:function(n){var t=null;return null!=n&&(t=this.getXFromMapObjectPixel(n),n=this.getYFromMapObjectPixel(n),t=new OpenLayers.Pixel(t,n)),t},getMapObjectPixelFromOLPixel:function(n){var t=null;return null!=n&&(t=this.getMapObjectPixelFromXY(n.x,n.y)),t},CLASS_NAME:"OpenLayers.Layer.EventPane"}),OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){for(var i,t=["minZoomLevel","maxZoomLevel","numZoomLevels"],n=0,r=t.length;n<r;n++)i=t[n],this[i]=null!=this.options[i]?this.options[i]:this.map[i];if((null==this.minZoomLevel||this.minZoomLevel<this.MIN_ZOOM_LEVEL)&&(this.minZoomLevel=this.MIN_ZOOM_LEVEL),t=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1,n=null==this.options.numZoomLevels&&null!=this.options.maxZoomLevel||null==this.numZoomLevels&&null!=this.maxZoomLevel?this.maxZoomLevel-this.minZoomLevel+1:this.numZoomLevels,this.numZoomLevels=null!=n?Math.min(n,t):t,this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1,null!=this.RESOLUTIONS){for(t=0,this.resolutions=[],n=this.minZoomLevel;n<=this.maxZoomLevel;n++)this.resolutions[t++]=this.RESOLUTIONS[n];this.maxResolution=this.resolutions[0],this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getResolution.apply(this,arguments);var i=null,n=this.map.getSize(),t=this.getExtent();return null!=n&&null!=t&&(i=Math.max(t.getWidth()/n.w,t.getHeight()/n.h)),i},getExtent:function(){var n=this.map.getSize(),t=this.getLonLatFromViewPortPx({x:0,y:0}),n=this.getLonLatFromViewPortPx({x:n.w,y:n.h});return null!=t&&null!=n?new OpenLayers.Bounds(t.lon,n.lat,n.lon,t.lat):null},getZoomForResolution:function(){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);var t=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(t)},getOLZoomFromMapObjectZoom:function(n){var t=null;return null!=n&&(t=n-this.minZoomLevel,this.map.baseLayer!==this&&(t=this.map.baseLayer.getZoomForResolution(this.getResolutionForZoom(t)))),t},getMapObjectZoomFromOLZoom:function(n){var t=null;return null!=n&&(t=n+this.minZoomLevel,this.map.baseLayer!==this&&(t=this.getZoomForResolution(this.map.baseLayer.getResolutionForZoom(t)))),t},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"}),OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:21,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,21457672119140622e-21,10728836059570311e-21,536441802978515e-20,268220901489257e-20,13411045074462891e-22,67055225372314453e-23],type:null,wrapDateLine:!0,sphericalMercator:!1,version:null,initialize:function(n,t){t=t||{},t.version||(t.version="function"==typeof GMap2?"2":"3");var i=OpenLayers.Layer.Google["v"+t.version.replace(/\./g,"_")];if(i)OpenLayers.Util.applyDefaults(t,i);else throw"Unsupported Google Maps API version: "+t.version;OpenLayers.Util.applyDefaults(t,i.DEFAULTS),t.maxExtent&&(t.maxExtent=t.maxExtent.clone()),OpenLayers.Layer.EventPane.prototype.initialize.apply(this,[n,t]),OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,[n,t]),this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},clone:function(){return new OpenLayers.Layer.Google(this.name,this.getOptions())},setVisibility:function(){var t=null==this.opacity?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments),this.setOpacity(t)},display:function(n){this._dragging||this.setGMapVisibility(n),OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments)},moveTo:function(n,t,i){this._dragging=i,OpenLayers.Layer.EventPane.prototype.moveTo.apply(this,arguments),delete this._dragging},setOpacity:function(n){if(n!==this.opacity&&(null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"}),this.opacity=n),this.getVisibility()){var t=this.getMapContainer();OpenLayers.Util.modifyDOMElement(t,null,null,null,null,null,null,n)}},destroy:function(){if(this.map){this.setGMapVisibility(!1);var n=OpenLayers.Layer.Google.cache[this.map.id];n&&1>=n.count&&this.removeGMapElements()}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var t=OpenLayers.Layer.Google.cache[this.map.id],n;t&&(n=this.mapObject&&this.getMapContainer(),n&&n.parentNode&&n.parentNode.removeChild(n),(n=t.termsOfUse)&&n.parentNode&&n.parentNode.removeChild(n),(t=t.poweredBy)&&t.parentNode&&t.parentNode.removeChild(t),this.mapObject&&window.google&&google.maps&&google.maps.event&&google.maps.event.clearListeners&&google.maps.event.clearListeners(this.mapObject,"tilesloaded"))},removeMap:function(n){this.visibility&&this.mapObject&&this.setGMapVisibility(!1);var t=OpenLayers.Layer.Google.cache[n.id];t&&(1>=t.count?(this.removeGMapElements(),delete OpenLayers.Layer.Google.cache[n.id]):--t.count),delete this.termsOfUse,delete this.poweredBy,delete this.mapObject,delete this.dragObject,OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(n){var t=null;return null!=n&&(t=n.getSouthWest(),n=n.getNorthEast(),this.sphericalMercator?(t=this.forwardMercator(t.lng(),t.lat()),n=this.forwardMercator(n.lng(),n.lat())):(t=new OpenLayers.LonLat(t.lng(),t.lat()),n=new OpenLayers.LonLat(n.lng(),n.lat())),t=new OpenLayers.Bounds(t.lon,t.lat,n.lon,n.lat)),t},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getLongitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.lng(),n.lat()).lon:n.lng()},getLatitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.lng(),n.lat()).lat:n.lat()},getXFromMapObjectPixel:function(n){return n.x},getYFromMapObjectPixel:function(n){return n.y},CLASS_NAME:"OpenLayers.Layer.Google"}),OpenLayers.Layer.Google.cache={},OpenLayers.Layer.Google.v2={termsOfUse:null,poweredBy:null,dragObject:null,loadMapObject:function(){var u,t,i,n,r;if(this.type||(this.type=G_NORMAL_MAP),n=OpenLayers.Layer.Google.cache[this.map.id],n)u=n.mapObject,t=n.termsOfUse,i=n.poweredBy,++n.count;else{n=this.map.viewPortDiv,r=document.createElement("div"),r.id=this.map.id+"_GMap2Container",r.style.position="absolute",r.style.width="100%",r.style.height="100%",n.appendChild(r);try{u=new GMap2(r),t=r.lastChild,n.appendChild(t),t.style.zIndex="1100",t.style.right="",t.style.bottom="",t.className="olLayerGoogleCopyright",i=r.lastChild,n.appendChild(i),i.style.zIndex="1100",i.style.right="",i.style.bottom="",i.className="olLayerGooglePoweredBy gmnoprint"}catch(f){throw f;}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:u,termsOfUse:t,poweredBy:i,count:1}}this.mapObject=u,this.termsOfUse=t,this.poweredBy=i,-1===OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)&&this.mapObject.addMapType(this.type),"function"==typeof u.getDragObject?this.dragObject=u.getDragObject():this.dragPanMapObject=null,!1===this.isBaseLayer&&this.setGMapVisibility("none"!==this.div.style.display)},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded())this.mapObject.checkResize();else{if(!this._resized)var n=this,t=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(t),delete n._resized,n.mapObject.checkResize(),n.moveTo(n.map.getCenter(),n.map.getZoom())});this._resized=!0}},setGMapVisibility:function(n){var t=OpenLayers.Layer.Google.cache[this.map.id],i;t&&(i=this.mapObject.getContainer(),!0===n?(this.mapObject.setMapType(this.type),i.style.display="",this.termsOfUse.style.left="",this.termsOfUse.style.display="",this.poweredBy.style.display="",t.displayed=this.id):(t.displayed===this.id&&delete t.displayed,t.displayed||(i.style.display="none",this.termsOfUse.style.display="none",this.termsOfUse.style.left="-9999px",this.poweredBy.style.display="none")))},getMapContainer:function(){return this.mapObject.getContainer()},getMapObjectBoundsFromOLBounds:function(n){var t=null;return null!=n&&(t=this.sphericalMercator?this.inverseMercator(n.bottom,n.left):new OpenLayers.LonLat(n.bottom,n.left),n=this.sphericalMercator?this.inverseMercator(n.top,n.right):new OpenLayers.LonLat(n.top,n.right),t=new GLatLngBounds(new GLatLng(t.lat,t.lon),new GLatLng(n.lat,n.lon))),t},setMapObjectCenter:function(n,t){this.mapObject.setCenter(n,t)},dragPanMapObject:function(n,t){this.dragObject.moveBy(new GSize(-n,t))},getMapObjectLonLatFromMapObjectPixel:function(n){return this.mapObject.fromContainerPixelToLatLng(n)},getMapObjectPixelFromMapObjectLonLat:function(n){return this.mapObject.fromLatLngToContainerPixel(n)},getMapObjectZoomFromMapObjectBounds:function(n){return this.mapObject.getBoundsZoomLevel(n)},getMapObjectLonLatFromLonLat:function(n,t){var i;return this.sphericalMercator?(i=this.inverseMercator(n,t),i=new GLatLng(i.lat,i.lon)):i=new GLatLng(t,n),i},getMapObjectPixelFromXY:function(n,t){return new GPoint(n,t)}},OpenLayers.Format.WFST=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Format.WFST.DEFAULTS);var t=OpenLayers.Format.WFST["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFST version: "+n.version;return new t(n)},OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"},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",ows:"http://www.opengis.net/ows"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:!0,xy:!0,stateName:null,initialize:function(n){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,[n])},getSrsName:function(n,t){var i=t&&t.srsName;return i||(i=n&&n.layer?n.layer.projection.getCode():this.srsName),i},read:function(n,t){t=t||{},OpenLayers.Util.applyDefaults(t,{output:"features"}),"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var i={};return n&&this.readNode(n,i,!0),i.features&&"features"===t.output&&(i=i.features),i},readers:{wfs:{FeatureCollection:function(n,t){t.features=[],this.readChildNodes(n,t)}}},write:function(n,t){var i=this.writeNode("wfs:Transaction",{features:n,options:t}),r=this.schemaLocationAttr();return r&&this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",r),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{wfs:{GetFeature:function(n){var i=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,handle:n&&n.handle,outputFormat:n&&n.outputFormat,maxFeatures:n&&n.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(n)}}),t,r;if("string"==typeof this.featureType)this.writeNode("Query",n,i);else for(t=0,r=this.featureType.length;t<r;t++)n.featureType=this.featureType[t],this.writeNode("Query",n,i);return i},Transaction:function(n){var e,f;n=n||{};var t=n.options||{},r=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version,handle:t.handle}}),i,u=n.features;if(u){for(!0===t.multi&&OpenLayers.Util.extend(this.geometryTypes,{"OpenLayers.Geometry.Point":"MultiPoint","OpenLayers.Geometry.LineString":!0===this.multiCurve?"MultiCurve":"MultiLineString","OpenLayers.Geometry.Polygon":!0===this.multiSurface?"MultiSurface":"MultiPolygon"}),n=0,i=u.length;n<i;++n)f=u[n],(e=this.stateName[f.state])&&this.writeNode(e,{feature:f,options:t},r);!0===t.multi&&this.setGeometryTypes()}if(t.nativeElements)for(n=0,i=t.nativeElements.length;n<i;++n)this.writeNode("wfs:Native",t.nativeElements[n],r);return r},Native:function(n){return this.createElementNSPlus("wfs:Native",{attributes:{vendorId:n.vendorId,safeToIgnore:n.safeToIgnore},value:n.value})},Insert:function(n){var t=n.feature;return n=n.options,n=this.createElementNSPlus("wfs:Insert",{attributes:{handle:n&&n.handle}}),this.srsName=this.getSrsName(t),this.writeNode("feature:_typeName",t,n),n},Update:function(n){var t=n.feature,i,r;n=n.options,n=this.createElementNSPlus("wfs:Update",{attributes:{handle:n&&n.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}}),this.featureNS&&n.setAttribute("xmlns:"+this.featurePrefix,this.featureNS),i=t.modified,null===this.geometryName||i&&void 0===i.geometry||(this.srsName=this.getSrsName(t),this.writeNode("Property",{name:this.geometryName,value:t.geometry},n));for(r in t.attributes)void 0===t.attributes[r]||i&&i.attributes&&(!i.attributes||void 0===i.attributes[r])||this.writeNode("Property",{name:r,value:t.attributes[r]},n);return this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[t.fid]}),n),n},Property:function(n){var t=this.createElementNSPlus("wfs:Property");return this.writeNode("Name",n.name,t),null!==n.value&&this.writeNode("Value",n.value,t),t},Name:function(n){return this.createElementNSPlus("wfs:Name",{value:n})},Value:function(n){var t;return n instanceof OpenLayers.Geometry?(t=this.createElementNSPlus("wfs:Value"),n=this.writeNode("feature:_geometry",n).firstChild,t.appendChild(n)):t=this.createElementNSPlus("wfs:Value",{value:n}),t},Delete:function(n){var t=n.feature;return n=n.options,n=this.createElementNSPlus("wfs:Delete",{attributes:{handle:n&&n.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}}),this.featureNS&&n.setAttribute("xmlns:"+this.featurePrefix,this.featureNS),this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[t.fid]}),n),n}}},schemaLocationAttr:function(n){var t,r,i;n=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},n),t=OpenLayers.Util.extend({},this.schemaLocations),n.schema&&(t[n.featurePrefix]=n.schema),n=[];for(i in t)(r=this.namespaces[i])&&n.push(r+" "+t[i]);return n.join(" ")||void 0},setFilterProperty:function(n){if(n.filters)for(var t=0,i=n.filters.length;t<i;++t)OpenLayers.Format.WFST.v1.prototype.setFilterProperty.call(this,n.filters[t]);else n instanceof OpenLayers.Filter.Spatial&&!n.property&&(n.property=this.geometryName)},CLASS_NAME:"OpenLayers.Format.WFST.v1"}),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:!1,multiCurve:!0,surface:!1,multiSurface:!0,initialize:function(n){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[n])},readers:{gml:OpenLayers.Util.applyDefaults({_inherit:function(n,t,i){(n=parseInt(n.getAttribute("srsDimension"),10)||i&&i.srsDimension)&&(t.srsDimension=n)},featureMembers:function(n,t){this.readChildNodes(n,t)},Curve:function(n,t){var i={points:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.LineString(i.points))},segments:function(n,t){this.readChildNodes(n,t)},LineStringSegment:function(n,t){var i={};this.readChildNodes(n,i),i.points&&Array.prototype.push.apply(t.points,i.points)},pos:function(n,t){var i=this.getChildValue(n).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace),i=this.xy?new OpenLayers.Geometry.Point(i[0],i[1],i[2]):new OpenLayers.Geometry.Point(i[1],i[0],i[2]);t.points=[i]},posList:function(n,t){for(var r=this.getChildValue(n).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace),u=t.srsDimension||parseInt(n.getAttribute("srsDimension")||n.getAttribute("dimension"),10)||2,f,e,o,s=Array(r.length/u),i=0,h=r.length;i<h;i+=u)f=r[i],e=r[i+1],o=2==u?void 0:r[i+2],s[i/u]=this.xy?new OpenLayers.Geometry.Point(f,e,o):new OpenLayers.Geometry.Point(e,f,o);t.points=s},Surface:function(n,t){this.readChildNodes(n,t)},patches:function(n,t){this.readChildNodes(n,t)},PolygonPatch:function(n,t){this.readers.gml.Polygon.apply(this,[n,t])},exterior:function(n,t){var i={};this.readChildNodes(n,i),t.outer=i.components[0]},interior:function(n,t){var i={};this.readChildNodes(n,i),t.inner.push(i.components[0])},MultiCurve:function(n,t){var i={components:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),0<i.components.length&&(t.components=[new OpenLayers.Geometry.MultiLineString(i.components)])},curveMember:function(n,t){this.readChildNodes(n,t)},MultiSurface:function(n,t){var i={components:[]};this.readers.gml._inherit.apply(this,[n,i,t]),this.readChildNodes(n,i),0<i.components.length&&(t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)])},surfaceMember:function(n,t){this.readChildNodes(n,t)},surfaceMembers:function(n,t){this.readChildNodes(n,t)},pointMembers:function(n,t){this.readChildNodes(n,t)},lineStringMembers:function(n,t){this.readChildNodes(n,t)},polygonMembers:function(n,t){this.readChildNodes(n,t)},geometryMembers:function(n,t){this.readChildNodes(n,t)},Envelope:function(n,t){var i={points:Array(2)},r;this.readChildNodes(n,i),t.components||(t.components=[]),r=i.points[0],i=i.points[1],t.components.push(new OpenLayers.Bounds(r.x,r.y,i.x,i.y))},lowerCorner:function(n,t){var i={};this.readers.gml.pos.apply(this,[n,i]),t.points[0]=i.points[0]},upperCorner:function(n,t){var i={};this.readers.gml.pos.apply(this,[n,i]),t.points[1]=i.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(n){var t;return t=OpenLayers.Util.isArray(n)?"featureMembers":"featureMember",n=this.writeNode("gml:"+t,n),this.setAttributeNS(n,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[n])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(n){for(var i=this.createElementNSPlus("gml:featureMembers"),t=0,r=n.length;t<r;++t)this.writeNode("feature:_typeName",n[t],i);return i},Point:function(n){var t=this.createElementNSPlus("gml:Point");return this.writeNode("pos",n,t),t},pos:function(n){return this.createElementNSPlus("gml:pos",{value:this.xy?n.x+" "+n.y:n.y+" "+n.x})},LineString:function(n){var t=this.createElementNSPlus("gml:LineString");return this.writeNode("posList",n.components,t),t},Curve:function(n){var t=this.createElementNSPlus("gml:Curve");return this.writeNode("segments",n,t),t},segments:function(n){var t=this.createElementNSPlus("gml:segments");return this.writeNode("LineStringSegment",n,t),t},LineStringSegment:function(n){var t=this.createElementNSPlus("gml:LineStringSegment");return this.writeNode("posList",n.components,t),t},posList:function(n){for(var r=n.length,u=Array(r),t,i=0;i<r;++i)t=n[i],u[i]=this.xy?t.x+" "+t.y:t.y+" "+t.x;return this.createElementNSPlus("gml:posList",{value:u.join(" ")})},Surface:function(n){var t=this.createElementNSPlus("gml:Surface");return this.writeNode("patches",n,t),t},patches:function(n){var t=this.createElementNSPlus("gml:patches");return this.writeNode("PolygonPatch",n,t),t},PolygonPatch:function(n){var i=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}}),t,r;for(this.writeNode("exterior",n.components[0],i),t=1,r=n.components.length;t<r;++t)this.writeNode("interior",n.components[t],i);return i},Polygon:function(n){var i=this.createElementNSPlus("gml:Polygon"),t,r;for(this.writeNode("exterior",n.components[0],i),t=1,r=n.components.length;t<r;++t)this.writeNode("interior",n.components[t],i);return i},exterior:function(n){var t=this.createElementNSPlus("gml:exterior");return this.writeNode("LinearRing",n,t),t},interior:function(n){var t=this.createElementNSPlus("gml:interior");return this.writeNode("LinearRing",n,t),t},LinearRing:function(n){var t=this.createElementNSPlus("gml:LinearRing");return this.writeNode("posList",n.components,t),t},MultiCurve:function(n){var i=this.createElementNSPlus("gml:MultiCurve"),t,r;for(n=n.components||[n],t=0,r=n.length;t<r;++t)this.writeNode("curveMember",n[t],i);return i},curveMember:function(n){var t=this.createElementNSPlus("gml:curveMember");return this.curve?this.writeNode("Curve",n,t):this.writeNode("LineString",n,t),t},MultiSurface:function(n){var i=this.createElementNSPlus("gml:MultiSurface"),t,r;for(n=n.components||[n],t=0,r=n.length;t<r;++t)this.writeNode("surfaceMember",n[t],i);return i},surfaceMember:function(n){var t=this.createElementNSPlus("gml:surfaceMember");return this.surface?this.writeNode("Surface",n,t):this.writeNode("Polygon",n,t),t},Envelope:function(n){var t=this.createElementNSPlus("gml:Envelope");return this.writeNode("lowerCorner",n,t),this.writeNode("upperCorner",n,t),this.srsName&&t.setAttribute("srsName",this.srsName),t},lowerCorner:function(n){return this.createElementNSPlus("gml:lowerCorner",{value:this.xy?n.left+" "+n.bottom:n.bottom+" "+n.left})},upperCorner:function(n){return this.createElementNSPlus("gml:upperCorner",{value:this.xy?n.right+" "+n.top:n.top+" "+n.right})}},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":!0===this.curve?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":!1===this.multiCurve?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":!0===this.surface?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":!1===this.multiSurface?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"}),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(n){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[n])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(n,t){var i=n.getAttribute("matchCase"),i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsNotEqualTo:function(n,t){var i=n.getAttribute("matchCase"),i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(n,i),t.filters.push(i)},PropertyIsLike:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(n,i);var r=n.getAttribute("wildCard"),u=n.getAttribute("singleChar"),f=n.getAttribute("escapeChar");i.value2regex(r,u,f),t.filters.push(i)}},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(n){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:n.matchCase}});return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsNotEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:n.matchCase}});return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsLike:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{matchCase:n.matchCase,wildCard:"*",singleChar:".",escapeChar:"!"}});return this.writeNode("PropertyName",n,t),this.writeNode("Literal",n.regex2value(),t),t},BBOX:function(n){var t=this.createElementNSPlus("ogc:BBOX"),i;return n.property&&this.writeNode("PropertyName",n,t),i=this.writeNode("gml:Envelope",n.value),n.projection&&i.setAttribute("srsName",n.projection),t.appendChild(i),t},SortBy:function(n){for(var i=this.createElementNSPlus("ogc:SortBy"),t=0,r=n.length;t<r;t++)this.writeNode("ogc:SortProperty",n[t],i);return i},SortProperty:function(n){var t=this.createElementNSPlus("ogc:SortProperty");return this.writeNode("ogc:PropertyName",n,t),this.writeNode("ogc:SortOrder","DESC"==n.order?"DESC":"ASC",t),t},SortOrder:function(n){return this.createElementNSPlus("ogc:SortOrder",{value:n})}},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(n,t){var i=this.createElementNSPlus("ogc:"+t),r;return this.writeNode("PropertyName",n,i),n.value instanceof OpenLayers.Filter.Function?this.writeNode("Function",n.value,i):(r=n.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",n.value).firstChild:this.writeNode("gml:Envelope",n.value),n.projection&&r.setAttribute("srsName",n.projection),i.appendChild(r)),i},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_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(n){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[n]),OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[n])},readNode:function(){return OpenLayers.Format.GML.v3.prototype.readNode.apply(this,arguments)},readers:{wfs:OpenLayers.Util.applyDefaults({FeatureCollection:function(n,t){t.numberOfFeatures=parseInt(n.getAttribute("numberOfFeatures")),OpenLayers.Format.WFST.v1.prototype.readers.wfs.FeatureCollection.apply(this,arguments)},TransactionResponse:function(n,t){t.insertIds=[],t.success=!1,this.readChildNodes(n,t)},TransactionSummary:function(n,t){t.success=!0},InsertResults:function(n,t){this.readChildNodes(n,t)},Feature:function(n,t){var i={fids:[]};this.readChildNodes(n,i),t.insertIds.push(i.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,ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows},writers:{wfs:OpenLayers.Util.applyDefaults({GetFeature:function(n){var t=OpenLayers.Format.WFST.v1.prototype.writers.wfs.GetFeature.apply(this,arguments);return n&&this.setAttributes(t,{resultType:n.resultType,startIndex:n.startIndex,count:n.count}),t},Query:function(n){var i,t,r;if(n=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},n),t=n.featurePrefix,i=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(t?t+":":"")+n.featureType,srsName:n.srsName}}),n.featureNS&&i.setAttribute("xmlns:"+t,n.featureNS),n.propertyNames)for(t=0,r=n.propertyNames.length;t<r;t++)this.writeNode("wfs:PropertyName",{property:n.propertyNames[t]},i);return n.filter&&(OpenLayers.Format.WFST.v1_1_0.prototype.setFilterProperty.call(this,n.filter),this.writeNode("ogc:Filter",n.filter,i)),i},PropertyName:function(n){return this.createElementNSPlus("wfs:PropertyName",{value:n.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.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",CLASS_NAME:"OpenLayers.Format.WFSCapabilities"}),OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{wfs:"http://www.opengis.net/wfs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows"},errorProperty:"featureTypeList",defaultPrefix:"wfs",read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{wfs:{WFS_Capabilities:function(n,t){this.readChildNodes(n,t)},FeatureTypeList:function(n,t){t.featureTypeList={featureTypes:[]},this.readChildNodes(n,t.featureTypeList)},FeatureType:function(n,t){var i={};this.readChildNodes(n,i),t.featureTypes.push(i)},Name:function(n,t){var i=this.getChildValue(n);i&&(i=i.split(":"),t.name=i.pop(),0<i.length&&(t.featureNS=this.lookupNamespaceURI(n,i[0])))},Title:function(n,t){var i=this.getChildValue(n);i&&(t.title=i)},Abstract:function(n,t){var i=this.getChildValue(n);i&&(t.abstract=i)}}},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"}),OpenLayers.Format.EncodedPolyline=OpenLayers.Class(OpenLayers.Format,{geometryType:"linestring",initialize:function(n){OpenLayers.Format.prototype.initialize.apply(this,[n])},read:function(n){var t,u,f;if("linestring"==this.geometryType)t=OpenLayers.Geometry.LineString;else if("linearring"==this.geometryType)t=OpenLayers.Geometry.LinearRing;else if("multipoint"==this.geometryType)t=OpenLayers.Geometry.MultiPoint;else if("point"!=this.geometryType&&"polygon"!=this.geometryType)return null;n=this.decodeDeltas(n,2);for(var e=n.length,i=[],r=0;r+1<e;)u=n[r++],f=n[r++],i.push(new OpenLayers.Geometry.Point(f,u));return"point"==this.geometryType?new OpenLayers.Feature.Vector(i[0]):"polygon"==this.geometryType?new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(i)])):new OpenLayers.Feature.Vector(new t(i))},decode:function(n,t,i){var r,u,f,e;for(n=this.decodeDeltas(n,t,i||1e5),i=n.length,r=[],u=0;u+(t-1)<i;){for(f=[],e=0;e<t;++e)f.push(n[u++]);r.push(f)}return r},write:function(n){var t,r;if(n=(n.constructor==Array?n[0]:n).geometry,t=n.CLASS_NAME.split(".")[2].toLowerCase(),"point"==t)n=Array(n);else if("linestring"==t||"linearring"==t||"multipoint"==t)n=n.components;else if("polygon"==t)n=n.components[0].components;else return null;for(var t=[],u=n.length,i=0;i<u;++i)r=n[i],t.push(r.y),t.push(r.x);return this.encodeDeltas(t,2)},encode:function(n,t,i){var e,r;i=i||1e5;for(var f=[],o=n.length,u=0;u<o;++u)for(e=n[u],r=0;r<t;++r)f.push(e[r]);return this.encodeDeltas(f,t,i)},encodeDeltas:function(n,t,i){for(var f=Array(t),o,u,e,s,r=0;r<t;++r)f[r]=0;for(o=n.length,u=0;u<o;)for(r=0;r<t;++r,++u)e=n[u],s=e-f[r],f[r]=e,n[u]=s;return this.encodeFloats(n,i||1e5)},decodeDeltas:function(n,t,i){for(var f=Array(t),u,r=0;r<t;++r)f[r]=0;for(n=this.decodeFloats(n,i||1e5),i=n.length,u=0;u<i;)for(r=0;r<t;++r,++u)f[r]+=n[u],n[u]=f[r];return n},encodeFloats:function(n,t){for(var r=t||1e5,u=n.length,i=0;i<u;++i)n[i]=Math.round(n[i]*r);return this.encodeSignedIntegers(n)},decodeFloats:function(n,t){for(var u=t||1e5,i=this.decodeSignedIntegers(n),f=i.length,r=0;r<f;++r)i[r]/=u;return i},encodeSignedIntegers:function(n){for(var r,i,u=n.length,t=0;t<u;++t)r=n[t],i=r<<1,0>r&&(i=~i),n[t]=i;return this.encodeUnsignedIntegers(n)},decodeSignedIntegers:function(n){var r,t,i;for(n=this.decodeUnsignedIntegers(n),r=n.length,t=0;t<r;++t)i=n[t],n[t]=i&1?~(i>>1):i>>1;return n},encodeUnsignedIntegers:function(n){for(var i="",r=n.length,t=0;t<r;++t)i+=this.encodeUnsignedInteger(n[t]);return i},decodeUnsignedIntegers:function(n){for(var u,f=[],t=0,i=0,e=n.length,r=0;r<e;++r)u=n.charCodeAt(r)-63,t=t|(u&31)<<i,32>u?(f.push(t),i=t=0):i+=5;return f},encodeFloat:function(n,t){return n=Math.round(n*(t||1e5)),this.encodeSignedInteger(n)},decodeFloat:function(n,t){return this.decodeSignedInteger(n)/(t||1e5)},encodeSignedInteger:function(n){var t=n<<1;return 0>n&&(t=~t),this.encodeUnsignedInteger(t)},decodeSignedInteger:function(n){return n=this.decodeUnsignedInteger(n),n&1?~(n>>1):n>>1},encodeUnsignedInteger:function(n){for(var t,i="";32<=n;)t=(32|n&31)+63,i+=String.fromCharCode(t),n>>=5;return i+=String.fromCharCode(n+63)},decodeUnsignedInteger:function(n){for(var i,r=0,u=0,f=n.length,t=0;t<f;++t){if(i=n.charCodeAt(t)-63,r=r|(i&31)<<u,32>i)break;u+=5}return r},CLASS_NAME:"OpenLayers.Format.EncodedPolyline"}),OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,autoActivate:!0,defaultControl:null,saveState:!1,allowDepress:!1,activeState:null,initialize:function(n){OpenLayers.Control.prototype.initialize.apply(this,[n]),this.controls=[],this.activeState={}},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onButtonClick),OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var n,t=this.controls.length-1;0<=t;t--)n=this.controls[t],n.events&&n.events.un({activate:this.iconOn,deactivate:this.iconOff}),n.panel_div=null;this.activeState=null},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var n,t=0,i=this.controls.length;t<i;t++)n=this.controls[t],(n===this.defaultControl||this.saveState&&this.activeState[n.id])&&n.activate();return!0===this.saveState&&(this.defaultControl=null),this.redraw(),!0}return!1},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var n,t=0,i=this.controls.length;t<i;t++)n=this.controls[t],this.activeState[n.id]=n.deactivate();return this.redraw(),!0}return!1},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.outsideViewport?(this.events.attachToElement(this.div),this.events.register("buttonclick",this,this.onButtonClick)):this.map.events.register("buttonclick",this,this.onButtonClick),this.addControlsToMap(this.controls),this.div},redraw:function(){for(var t,n=this.div.childNodes.length-1;0<=n;n--)this.div.removeChild(this.div.childNodes[n]);if(this.div.innerHTML="",this.active)for(n=0,t=this.controls.length;n<t;n++)this.div.appendChild(this.controls[n].panel_div)},activateControl:function(n){if(!this.active)return!1;if(n.type==OpenLayers.Control.TYPE_BUTTON)n.trigger();else if(n.type==OpenLayers.Control.TYPE_TOGGLE)n.active?n.deactivate():n.activate();else if(this.allowDepress&&n.active)n.deactivate();else{for(var t,i=0,r=this.controls.length;i<r;i++)t=this.controls[i],t==n||t.type!==OpenLayers.Control.TYPE_TOOL&&null!=t.type||t.deactivate();n.activate()}},addControls:function(n){var r,u,t,i;for(OpenLayers.Util.isArray(n)||(n=[n]),this.controls=this.controls.concat(n),r=0,u=n.length;r<u;r++)t=n[r],i=this.createControlMarkup(t),OpenLayers.Element.addClass(i,t.displayClass+"ItemInactive"),OpenLayers.Element.addClass(i,"olButton"),""==t.title||i.title||(i.title=t.title),t.panel_div=i;this.map&&(this.addControlsToMap(n),this.redraw())},createControlMarkup:function(){return document.createElement("div")},addControlsToMap:function(n){for(var t,i=0,r=n.length;i<r;i++)t=n[i],!0===t.autoActivate?(t.autoActivate=!1,this.map.addControl(t),t.autoActivate=!0):(this.map.addControl(t),t.deactivate()),t.events.on({activate:this.iconOn,deactivate:this.iconOff})},iconOn:function(){var n=this.panel_div;n.className=n.className.replace(RegExp("\\b("+this.displayClass+"Item)Inactive\\b"),"$1Active")},iconOff:function(){var n=this.panel_div;n.className=n.className.replace(RegExp("\\b("+this.displayClass+"Item)Active\\b"),"$1Inactive")},onButtonClick:function(n){var i=this.controls,t;for(n=n.buttonElement,t=i.length-1;0<=t;--t)if(i[t].panel_div===n){this.activateControl(i[t]);break}},getControlsBy:function(n,t){var i="function"==typeof t.test;return OpenLayers.Array.filter(this.controls,function(r){return r[n]==t||i&&t.test(r[n])})},getControlsByName:function(n){return this.getControlsBy("name",n)},getControlsByClass:function(n){return this.getControlsBy("CLASS_NAME",n)},CLASS_NAME:"OpenLayers.Control.Panel"}),OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"}),OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"}),OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"}),OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomToMaxExtent()},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"}),OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(n){OpenLayers.Control.Panel.prototype.initialize.apply(this,[n]),this.addControls([new OpenLayers.Control.ZoomIn,new OpenLayers.Control.ZoomToMaxExtent,new OpenLayers.Control.ZoomOut])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"}),OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:!1,initialize:function(n,t,i,r){OpenLayers.Layer.prototype.initialize.apply(this,[n,r]),this.url=t,this.params||(this.params=OpenLayers.Util.extend({},i))},destroy:function(){this.params=this.url=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.prototype.clone.apply(this,[n])},setUrl:function(n){this.url=n},mergeNewParams:function(n){return this.params=OpenLayers.Util.extend(this.params,n),n=this.redraw(),null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"params"}),n},redraw:function(n){return n?this.mergeNewParams({_olSalt:Math.random()}):OpenLayers.Layer.prototype.redraw.apply(this,[])},selectUrl:function(n,t){for(var i=1,r=0,u=n.length;r<u;r++)i=i*n.charCodeAt(r)*this.URL_HASH_FACTOR,i-=Math.floor(i);return t[Math.floor(i*t.length)]},getFullRequestString:function(n,t){var i=t||this.url,r=OpenLayers.Util.extend({},this.params),r=OpenLayers.Util.extend(r,n),u=OpenLayers.Util.getParameterString(r),f;OpenLayers.Util.isArray(i)&&(i=this.selectUrl(u,i)),u=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(i));for(f in r)f.toUpperCase()in u&&delete r[f];return u=OpenLayers.Util.getParameterString(r),OpenLayers.Util.urlAppend(i,u)},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"}),OpenLayers.Tile=OpenLayers.Class({events:null,eventListeners:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:!1,initialize:function(n,t,i,r,u,f){if(this.layer=n,this.position=t.clone(),this.setBounds(i),this.url=r,u&&(this.size=u.clone()),this.id=OpenLayers.Util.createUniqueID("Tile_"),OpenLayers.Util.extend(this,f),this.events=new OpenLayers.Events(this),this.eventListeners instanceof Object)this.events.on(this.eventListeners)},unload:function(){this.isLoading&&(this.isLoading=!1,this.events.triggerEvent("unload"))},destroy:function(){this.position=this.size=this.bounds=this.layer=null,this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=this.eventListeners=null},draw:function(n){n||this.clear();var t=this.shouldDraw();return t&&!n&&!1===this.events.triggerEvent("beforedraw")&&(t=null),t},shouldDraw:function(){var t=!1,i=this.layer.maxExtent,n;return i&&(n=this.layer.map,n=n.baseLayer.wrapDateLine&&n.getMaxExtent(),this.bounds.intersectsBounds(i,{inclusive:!1,worldBounds:n})&&(t=!0)),t||this.layer.displayOutsideMaxExtent},setBounds:function(n){if(n=n.clone(),this.layer.map.baseLayer.wrapDateLine){var i=this.layer.map.getMaxExtent(),t=this.layer.map.getResolution();n=n.wrapDateLine(i,{leftTolerance:t,rightTolerance:t})}this.bounds=n},moveTo:function(n,t,i){null==i&&(i=!0),this.setBounds(n),this.position=t.clone(),i&&this.draw()},clear:function(){},CLASS_NAME:"OpenLayers.Tile"}),OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,imageReloadAttempts:null,layerAlphaHack:null,asyncRequestId:null,maxGetUrlLength:null,canvasContext:null,crossOriginKeyword:null,initialize:function(n,t,i,r){OpenLayers.Tile.prototype.initialize.apply(this,arguments),this.url=r,this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack(),(null!=this.maxGetUrlLength||this.layer.gutter||this.layerAlphaHack)&&(this.frame=document.createElement("div"),this.frame.style.position="absolute",this.frame.style.overflow="hidden"),null!=this.maxGetUrlLength&&OpenLayers.Util.extend(this,OpenLayers.Tile.Image.IFrame)},destroy:function(){this.imgDiv&&(this.clear(),this.frame=this.imgDiv=null),this.asyncRequestId=null,OpenLayers.Tile.prototype.destroy.apply(this,arguments)},draw:function(){var n=OpenLayers.Tile.prototype.draw.apply(this,arguments);return n?(this.layer!=this.layer.map.baseLayer&&this.layer.reproject&&(this.bounds=this.getBoundsFromBaseLayer(this.position)),this.isLoading?this._loadEvent="reload":(this.isLoading=!0,this._loadEvent="loadstart"),this.renderTile(),this.positionTile()):!1===n&&this.unload(),n},renderTile:function(){if(this.layer.async){var n=this.asyncRequestId=(this.asyncRequestId||0)+1;this.layer.getURLasync(this.bounds,function(t){n==this.asyncRequestId&&(this.url=t,this.initImage())},this)}else this.url=this.layer.getURL(this.bounds),this.initImage()},positionTile:function(){var n=this.getTile().style,i=this.frame?this.size:this.layer.getImageSize(this.bounds),t=1;this.layer instanceof OpenLayers.Layer.Grid&&(t=this.layer.getServerResolution()/this.layer.map.getResolution()),n.left=this.position.x+"px",n.top=this.position.y+"px",n.width=Math.round(t*i.w)+"px",n.height=Math.round(t*i.h)+"px"},clear:function(){var n,t;OpenLayers.Tile.prototype.clear.apply(this,arguments),n=this.imgDiv,n&&(t=this.getTile(),t.parentNode===this.layer.div&&this.layer.div.removeChild(t),this.setImgSrc(),!0===this.layerAlphaHack&&(n.style.filter=""),OpenLayers.Element.removeClass(n,"olImageLoadError")),this.canvasContext=null},getImage:function(){var n,t,i;return this.imgDiv||(this.imgDiv=OpenLayers.Tile.Image.IMAGE.cloneNode(!1),n=this.imgDiv.style,this.frame&&(t=0,i=0,this.layer.gutter&&(t=this.layer.gutter/this.layer.tileSize.w*100,i=this.layer.gutter/this.layer.tileSize.h*100),n.left=-t+"%",n.top=-i+"%",n.width=2*t+100+"%",n.height=2*i+100+"%"),n.visibility="hidden",n.opacity=0,1>this.layer.opacity&&(n.filter="alpha(opacity="+100*this.layer.opacity+")"),n.position="absolute",this.layerAlphaHack&&(n.paddingTop=n.height,n.height="0",n.width="100%"),this.frame&&this.frame.appendChild(this.imgDiv)),this.imgDiv},setImage:function(n){this.imgDiv=n},initImage:function(){if(this.url||this.imgDiv){this.events.triggerEvent("beforeload"),this.layer.div.appendChild(this.getTile()),this.events.triggerEvent(this._loadEvent);var n=this.getImage(),t=n.getAttribute("src")||"";this.url&&OpenLayers.Util.isEquivalentUrl(t,this.url)?this._loadTimeout=window.setTimeout(OpenLayers.Function.bind(this.onImageLoad,this),0):(this.stopLoading(),this.crossOriginKeyword&&n.removeAttribute("crossorigin"),OpenLayers.Event.observe(n,"load",OpenLayers.Function.bind(this.onImageLoad,this)),OpenLayers.Event.observe(n,"error",OpenLayers.Function.bind(this.onImageError,this)),this.imageReloadAttempts=0,this.setImgSrc(this.url))}else this.isLoading=!1},setImgSrc:function(n){var t=this.imgDiv;n?(t.style.visibility="hidden",t.style.opacity=0,this.crossOriginKeyword&&("data:"!==n.substr(0,5)?t.setAttribute("crossorigin",this.crossOriginKeyword):t.removeAttribute("crossorigin")),t.src=n):(this.stopLoading(),this.imgDiv=null,t.parentNode&&t.parentNode.removeChild(t))},getTile:function(){return this.frame?this.frame:this.getImage()},createBackBuffer:function(){if(this.imgDiv&&!this.isLoading){var n;return this.frame?(n=this.frame.cloneNode(!1),n.appendChild(this.imgDiv)):n=this.imgDiv,this.imgDiv=null,n}},onImageLoad:function(){var n=this.imgDiv;this.stopLoading(),n.style.visibility="inherit",n.style.opacity=this.layer.opacity,this.isLoading=!1,this.canvasContext=null,this.events.triggerEvent("loadend"),!0===this.layerAlphaHack&&(n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+n.src+"', sizingMethod='scale')")},onImageError:function(){var n=this.imgDiv;null!=n.src&&(this.imageReloadAttempts++,this.imageReloadAttempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS?this.setImgSrc(this.layer.getURL(this.bounds)):(OpenLayers.Element.addClass(n,"olImageLoadError"),this.events.triggerEvent("loaderror"),this.onImageLoad()))},stopLoading:function(){OpenLayers.Event.stopObservingElement(this.imgDiv),window.clearTimeout(this._loadTimeout),delete this._loadTimeout},getCanvasContext:function(){if(OpenLayers.CANVAS_SUPPORTED&&this.imgDiv&&!this.isLoading){if(!this.canvasContext){var n=document.createElement("canvas");n.width=this.size.w,n.height=this.size.h,this.canvasContext=n.getContext("2d"),this.canvasContext.drawImage(this.imgDiv,0,0)}return this.canvasContext}},CLASS_NAME:"OpenLayers.Tile.Image"}),OpenLayers.Tile.Image.IMAGE=function(){var n=new Image;return n.className="olTileImage",n.galleryImg="no",n}(),OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,tileClass:OpenLayers.Tile.Image,grid:null,singleTile:!1,ratio:1.5,buffer:0,transitionEffect:"resize",numLoadingTiles:0,serverResolutions:null,loading:!1,backBuffer:null,gridResolution:null,backBufferResolution:null,backBufferLonLat:null,backBufferTimerId:null,removeBackBufferDelay:null,className:null,gridLayout:null,rowSign:null,transitionendEvents:["transitionend","webkitTransitionEnd","otransitionend","oTransitionEnd"],initialize:function(){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments),this.grid=[],this._removeBackBuffer=OpenLayers.Function.bind(this.removeBackBuffer,this),this.initProperties(),this.rowSign="t"===this.tileOriginCorner.substr(0,1)?1:-1},initProperties:function(){void 0===this.options.removeBackBufferDelay&&(this.removeBackBufferDelay=this.singleTile?0:2500),void 0===this.options.className&&(this.className=this.singleTile?"olLayerGridSingleTile":"olLayerGrid")},setMap:function(n){OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this,n),OpenLayers.Element.addClass(this.div,this.className)},removeMap:function(){this.removeBackBuffer()},destroy:function(){this.removeBackBuffer(),this.clearGrid(),this.tileSize=this.grid=null,OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){var n,i;if(this.grid){for(n=0,i=this.grid.length;n<i;n++)for(var r=this.grid[n],t=0,u=r.length;t<u;t++)this.destroyTile(r[t]);this.grid=[],this.gridLayout=this.gridResolution=null}},addOptions:function(n){var i=void 0!==n.singleTile&&n.singleTile!==this.singleTile;OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this,arguments),this.map&&i&&(this.initProperties(),this.clearGrid(),this.tileSize=this.options.tileSize,this.setTileSize(),this.moveTo(null,!0))},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[n]),null!=this.tileSize&&(n.tileSize=this.tileSize.clone()),n.grid=[],n.gridResolution=null,n.backBuffer=null,n.backBufferTimerId=null,n.loading=!1,n.numLoadingTiles=0,n},moveTo:function(n,t,i){if(OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments),n=n||this.map.getExtent(),null!=n){var u=!this.grid.length||t,f=this.getTilesBounds(),r=this.map.getResolution();this.getServerResolution(r),this.singleTile?!u&&(i||f.containsBounds(n))||(t&&"resize"!==this.transitionEffect&&this.removeBackBuffer(),t&&"resize"!==this.transitionEffect||this.applyBackBuffer(r),this.initSingleTile(n)):(u=u||!f.intersectsBounds(n,{worldBounds:this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent()}))?(!t||"resize"!==this.transitionEffect&&this.gridResolution!==r||this.applyBackBuffer(r),this.initGriddedTiles(n)):this.moveGriddedTiles()}},getTileData:function(n){var o=null,i=n.lon,u=n.lat,f=this.grid.length,r;if(this.map&&f){r=this.map.getResolution(),n=this.tileSize.w;var s=this.tileSize.h,e=this.grid[0][0].bounds,t=e.left,e=e.top;if(i<t&&this.map.baseLayer.wrapDateLine)var h=this.map.getMaxExtent().getWidth(),c=Math.ceil((t-i)/h),i=i+h*c;i=(i-t)/(r*n),u=(e-u)/(r*s),r=Math.floor(i),t=Math.floor(u),0<=t&&t<f&&(f=this.grid[t][r])&&(o={tile:f,i:Math.floor((i-r)*n),j:Math.floor((u-t)*s)})}return o},destroyTile:function(n){this.removeTileMonitoringHooks(n),n.destroy()},getServerResolution:function(n){var u=Number.POSITIVE_INFINITY,t,i,r,f;if(n=n||this.map.getResolution(),this.serverResolutions&&-1===OpenLayers.Util.indexOf(this.serverResolutions,n)){for(t=this.serverResolutions.length-1;0<=t;t--){if(r=this.serverResolutions[t],i=Math.abs(r-n),i>u)break;u=i,f=r}n=f}return n},getServerZoom:function(){var n=this.getServerResolution();return this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,n):this.map.getZoomForResolution(n)+(this.zoomOffset||0)},applyBackBuffer:function(n){var i,r;if(null!==this.backBufferTimerId&&this.removeBackBuffer(),i=this.backBuffer,!i){if(i=this.createBackBuffer(),!i)return;n===this.gridResolution?this.div.insertBefore(i,this.div.firstChild):this.map.baseLayer.div.parentNode.insertBefore(i,this.map.baseLayer.div),this.backBuffer=i,r=this.grid[0][0].bounds,this.backBufferLonLat={lon:r.left,lat:r.top},this.backBufferResolution=this.gridResolution}for(var r=this.backBufferResolution/n,f=i.childNodes,t,u=f.length-1;0<=u;--u)t=f[u],t.style.top=(r*t._i*t._h|0)+"px",t.style.left=(r*t._j*t._w|0)+"px",t.style.width=Math.round(r*t._w)+"px",t.style.height=Math.round(r*t._h)+"px";n=this.getViewPortPxFromLonLat(this.backBufferLonLat,n),r=this.map.layerContainerOriginPx.y,i.style.left=Math.round(n.x-this.map.layerContainerOriginPx.x)+"px",i.style.top=Math.round(n.y-r)+"px"},createBackBuffer:function(){var i,n,f,r,e,u,t;if(0<this.grid.length)for(i=document.createElement("div"),i.id=this.div.id+"_bb",i.className="olBackBuffer",i.style.position="absolute",n=this.map,i.style.zIndex="resize"===this.transitionEffect?this.getZIndex()-1:n.Z_INDEX_BASE.BaseLayer-(n.getNumLayers()-n.getLayerIndex(this)),n=0,f=this.grid.length;n<f;n++)for(r=0,e=this.grid[n].length;r<e;r++)u=this.grid[n][r],t=this.grid[n][r].createBackBuffer(),t&&(t._i=n,t._j=r,t._w=u.size.w,t._h=u.size.h,t.id=u.id+"_bb",i.appendChild(t));return i},removeBackBuffer:function(){if(this._transitionElement){for(var n=this.transitionendEvents.length-1;0<=n;--n)OpenLayers.Event.stopObserving(this._transitionElement,this.transitionendEvents[n],this._removeBackBuffer);delete this._transitionElement}this.backBuffer&&(this.backBuffer.parentNode&&this.backBuffer.parentNode.removeChild(this.backBuffer),this.backBufferResolution=this.backBuffer=null,null!==this.backBufferTimerId&&(window.clearTimeout(this.backBufferTimerId),this.backBufferTimerId=null))},moveByPx:function(){this.singleTile||this.moveGriddedTiles()},setTileSize:function(n){this.singleTile&&(n=this.map.getSize(),n.h=parseInt(n.h*this.ratio,10),n.w=parseInt(n.w*this.ratio,10)),OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[n])},getTilesBounds:function(){var n=null,t=this.grid.length;if(t)var n=this.grid[t-1][0].bounds,t=this.grid[0].length*n.getWidth(),i=this.grid.length*n.getHeight(),n=new OpenLayers.Bounds(n.left,n.bottom,n.left+t,n.bottom+i);return n},initSingleTile:function(n){this.events.triggerEvent("retile");var t=n.getCenterLonLat(),i=n.getWidth()*this.ratio;n=n.getHeight()*this.ratio,t=new OpenLayers.Bounds(t.lon-i/2,t.lat-n/2,t.lon+i/2,t.lat+n/2),i=this.map.getLayerPxFromLonLat({lon:t.left,lat:t.top}),this.grid.length||(this.grid[0]=[]),(n=this.grid[0][0])?n.moveTo(t,i):(n=this.addTile(t,i),this.addTileMonitoringHooks(n),n.draw(),this.grid[0][0]=n),this.removeExcessTiles(1,1),this.gridResolution=this.getServerResolution()},calculateGridLayout:function(n,t,i){var u=i*this.tileSize.w,f,r;return i*=this.tileSize.h,f=Math.floor((n.left-t.lon)/u)-this.buffer,r=this.rowSign,n=Math[~r?"floor":"ceil"](r*(t.lat-n.top+i)/i)-this.buffer*r,{tilelon:u,tilelat:i,startcol:f,startrow:n}},getTileOrigin:function(){var n=this.tileOrigin;if(!n)var n=this.getMaxExtent(),t={tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]}[this.tileOriginCorner],n=new OpenLayers.LonLat(n[t[0]],n[t[1]]);return n},getTileBoundsForGridIndex:function(n,t){var r=this.getTileOrigin(),i=this.gridLayout,f=i.tilelon,e=i.tilelat,o=i.startcol,i=i.startrow,u=this.rowSign;return new OpenLayers.Bounds(r.lon+(o+t)*f,r.lat-(i+n*u)*e*u,r.lon+(o+t+1)*f,r.lat-(i+(n-1)*u)*e*u)},initGriddedTiles:function(n){var s,u,i,r,f;this.events.triggerEvent("retile");var l=this.map.getSize(),v=this.getTileOrigin(),e=this.map.getResolution(),t=this.getServerResolution(),c=e/t,e=this.tileSize.w/c,c=this.tileSize.h/c,y=Math.ceil(l.h/c)+2*this.buffer+1,l=Math.ceil(l.w/e)+2*this.buffer+1;this.gridLayout=t=this.calculateGridLayout(n,v,t);var v=t.tilelon,p=t.tilelat,t=this.map.layerContainerOriginPx.x,a=this.map.layerContainerOriginPx.y,i=this.getTileBoundsForGridIndex(0,0),h=this.map.getViewPortPxFromLonLat(new OpenLayers.LonLat(i.left,i.top));h.x=Math.round(h.x)-t,h.y=Math.round(h.y)-a;var t=[],a=this.map.getCenter(),o=0;do{s=this.grid[o],s||(s=[],this.grid.push(s)),u=0;do i=this.getTileBoundsForGridIndex(o,u),r=h.clone(),r.x+=u*Math.round(e),r.y+=o*Math.round(c),f=s[u],f?f.moveTo(i,r,!1):(f=this.addTile(i,r),this.addTileMonitoringHooks(f),s.push(f)),r=i.getCenterLonLat(),t.push({tile:f,distance:Math.pow(r.lon-a.lon,2)+Math.pow(r.lat-a.lat,2)}),u+=1;while(i.right<=n.right+v*this.buffer||u<l);o+=1}while(i.bottom>=n.bottom-p*this.buffer||o<y);for(this.removeExcessTiles(o,u),this.gridResolution=e=this.getServerResolution(),t.sort(function(n,t){return n.distance-t.distance}),n=0,e=t.length;n<e;++n)t[n].tile.draw()},getMaxExtent:function(){return this.maxExtent},addTile:function(n,t){var i=new this.tileClass(this,t,n,null,this.tileSize,this.tileOptions);return this.events.triggerEvent("addtile",{tile:i}),i},addTileMonitoringHooks:function(n){n.onLoadStart=function(){!1===this.loading&&(this.loading=!0,this.events.triggerEvent("loadstart")),this.events.triggerEvent("tileloadstart",{tile:n}),this.numLoadingTiles++,!this.singleTile&&this.backBuffer&&this.gridResolution===this.backBufferResolution&&OpenLayers.Element.addClass(n.getTile(),"olTileReplacing")},n.onLoadEnd=function(t){var i,r;if(this.numLoadingTiles--,t="unload"===t.type,this.events.triggerEvent("tileloaded",{tile:n,aborted:t}),this.singleTile||t||!this.backBuffer||this.gridResolution!==this.backBufferResolution||(i=n.getTile(),"none"===OpenLayers.Element.getStyle(i,"display")&&(r=document.getElementById(n.id+"_bb"),r&&r.parentNode.removeChild(r)),OpenLayers.Element.removeClass(i,"olTileReplacing")),0===this.numLoadingTiles){if(this.backBuffer)if(0===this.backBuffer.childNodes.length)this.removeBackBuffer();else{for(this._transitionElement=t?this.div.lastChild:n.imgDiv,t=this.transitionendEvents,i=t.length-1;0<=i;--i)OpenLayers.Event.observe(this._transitionElement,t[i],this._removeBackBuffer);this.backBufferTimerId=window.setTimeout(this._removeBackBuffer,this.removeBackBufferDelay)}this.loading=!1,this.events.triggerEvent("loadend")}},n.onLoadError=function(){this.events.triggerEvent("tileerror",{tile:n})};n.events.on({loadstart:n.onLoadStart,loadend:n.onLoadEnd,unload:n.onLoadEnd,loaderror:n.onLoadError,scope:this})},removeTileMonitoringHooks:function(n){n.unload(),n.events.un({loadstart:n.onLoadStart,loadend:n.onLoadEnd,unload:n.onLoadEnd,loaderror:n.onLoadError,scope:this})},moveGriddedTiles:function(){for(var t=this.buffer+1;;){var i=this.grid[0][0],r=i.position.x+this.map.layerContainerOriginPx.x,i=i.position.y+this.map.layerContainerOriginPx.y,n=this.getServerResolution()/this.map.getResolution(),n={w:Math.round(this.tileSize.w*n),h:Math.round(this.tileSize.h*n)};if(r>-n.w*(t-1))this.shiftColumn(!0,n);else if(r<-n.w*t)this.shiftColumn(!1,n);else if(i>-n.h*(t-1))this.shiftRow(!0,n);else if(i<-n.h*t)this.shiftRow(!1,n);else break}},shiftRow:function(n,t){var r=this.grid,e=n?0:r.length-1,o=n?-1:1,s,f;this.gridLayout.startrow+=o*this.rowSign;for(var h=r[e],u=r[n?"pop":"shift"](),i=0,c=u.length;i<c;i++)s=u[i],f=h[i].position.clone(),f.y+=t.h*o,s.moveTo(this.getTileBoundsForGridIndex(e,i),f);r[n?"unshift":"push"](u)},shiftColumn:function(n,t){var r=this.grid,f=n?0:r[0].length-1,e=n?-1:1,i,o;for(this.gridLayout.startcol+=e,i=0,o=r.length;i<o;i++){var u=r[i],s=u[f].position.clone(),h=u[n?"pop":"shift"]();s.x+=t.w*e,h.moveTo(this.getTileBoundsForGridIndex(i,f),s),u[n?"unshift":"push"](h)}},removeExcessTiles:function(n,t){for(var i,u,r,f;this.grid.length>n;)for(r=this.grid.pop(),i=0,u=r.length;i<u;i++)f=r[i],this.destroyTile(f);for(i=0,u=this.grid.length;i<u;i++)for(;this.grid[i].length>t;)r=this.grid[i],f=r.pop(),this.destroyTile(f)},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(n){var t=this.maxExtent,i=this.getResolution(),r=i*this.tileSize.w,i=i*this.tileSize.h,u=this.getLonLatFromViewPortPx(n);return n=t.left+r*Math.floor((u.lon-t.left)/r),t=t.bottom+i*Math.floor((u.lat-t.bottom)/i),new OpenLayers.Bounds(n,t,n+r,t+i)},CLASS_NAME:"OpenLayers.Layer.Grid"}),OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:"antialiasing blockout font fontcolor fontsize fontstyle glowing interval outline printmode shadow transparency".split(" "),request:null,response:null,initialize:function(n){if(this.request=new OpenLayers.Format.ArcXML.Request,this.response=new OpenLayers.Format.ArcXML.Response,n)if("feature"==n.requesttype){this.request.get_image=null;var t=this.request.get_feature.query;this.addCoordSys(t.featurecoordsys,n.featureCoordSys),this.addCoordSys(t.filtercoordsys,n.filterCoordSys),n.polygon?(t.isspatial=!0,t.spatialfilter.polygon=n.polygon):n.envelope&&(t.isspatial=!0,t.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0},this.parseEnvelope(t.spatialfilter.envelope,n.envelope))}else"image"==n.requesttype?(this.request.get_feature=null,t=this.request.get_image.properties,this.parseEnvelope(t.envelope,n.envelope),this.addLayers(t.layerlist,n.layers),this.addImageSize(t.imagesize,n.tileSize),this.addCoordSys(t.featurecoordsys,n.featureCoordSys),this.addCoordSys(t.filtercoordsys,n.filterCoordSys)):this.request=null;OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},parseEnvelope:function(n,t){t&&4==t.length&&(n.minx=t[0],n.miny=t[1],n.maxx=t[2],n.maxy=t[3])},addLayers:function(n,t){for(var i=0,r=t.length;i<r;i++)n.push(t[i])},addImageSize:function(n,t){null!==t&&(n.width=t.w,n.height=t.h,n.printwidth=t.w,n.printheight=t.h)},addCoordSys:function(n,t){"string"==typeof t?(n.id=parseInt(t),n.string=t):"object"==typeof t&&null!==t.proj&&(n.id=t.proj.srsProjNumber,n.string=t.proj.srsCode)},iserror:function(n){var t=null;return n?(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]),n=n.documentElement.getElementsByTagName("ERROR"),t=null!==n&&0<n.length):t=""!==this.response.error,t},read:function(n){var t,i,r;if("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),t=null,n&&n.documentElement&&(t="ARCXML"==n.documentElement.nodeName?n.documentElement:n.documentElement.getElementsByTagName("ARCXML")[0]),!t||"parsererror"===t.firstChild.nodeName){try{i=n.firstChild.nodeValue,r=n.firstChild.childNodes[1].firstChild.nodeValue}catch(u){}throw{message:"Error parsing the ArcXML request",error:i,source:r};}return this.parseResponse(t)},write:function(n){var e,o,t,i,u,r,f;if(n||(n=this.request),e=this.createElementNS("","ARCXML"),e.setAttribute("version","1.1"),o=this.createElementNS("","REQUEST"),null!=n.get_image){if(t=this.createElementNS("","GET_IMAGE"),o.appendChild(t),i=this.createElementNS("","PROPERTIES"),t.appendChild(i),n=n.get_image.properties,null!=n.featurecoordsys&&(t=this.createElementNS("","FEATURECOORDSYS"),i.appendChild(t),0===n.featurecoordsys.id?t.setAttribute("string",n.featurecoordsys.string):t.setAttribute("id",n.featurecoordsys.id)),null!=n.filtercoordsys&&(t=this.createElementNS("","FILTERCOORDSYS"),i.appendChild(t),0===n.filtercoordsys.id?t.setAttribute("string",n.filtercoordsys.string):t.setAttribute("id",n.filtercoordsys.id)),null!=n.envelope&&(t=this.createElementNS("","ENVELOPE"),i.appendChild(t),t.setAttribute("minx",n.envelope.minx),t.setAttribute("miny",n.envelope.miny),t.setAttribute("maxx",n.envelope.maxx),t.setAttribute("maxy",n.envelope.maxy)),t=this.createElementNS("","IMAGESIZE"),i.appendChild(t),t.setAttribute("height",n.imagesize.height),t.setAttribute("width",n.imagesize.width),(n.imagesize.height!=n.imagesize.printheight||n.imagesize.width!=n.imagesize.printwidth)&&(t.setAttribute("printheight",n.imagesize.printheight),t.setArrtibute("printwidth",n.imagesize.printwidth)),null!=n.background&&(t=this.createElementNS("","BACKGROUND"),i.appendChild(t),t.setAttribute("color",n.background.color.r+","+n.background.color.g+","+n.background.color.b),null!==n.background.transcolor&&t.setAttribute("transcolor",n.background.transcolor.r+","+n.background.transcolor.g+","+n.background.transcolor.b)),null!=n.layerlist&&0<n.layerlist.length)for(t=this.createElementNS("","LAYERLIST"),i.appendChild(t),i=0;i<n.layerlist.length;i++){if(u=this.createElementNS("","LAYERDEF"),t.appendChild(u),u.setAttribute("id",n.layerlist[i].id),u.setAttribute("visible",n.layerlist[i].visible),"object"==typeof n.layerlist[i].query){if(r=n.layerlist[i].query,0>r.where.length)continue;f=null,f="boolean"==typeof r.spatialfilter&&r.spatialfilter?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY"),f.setAttribute("where",r.where),"number"==typeof r.accuracy&&0<r.accuracy&&f.setAttribute("accuracy",r.accuracy),"number"==typeof r.featurelimit&&2e3>r.featurelimit&&f.setAttribute("featurelimit",r.featurelimit),"string"==typeof r.subfields&&"#ALL#"!=r.subfields&&f.setAttribute("subfields",r.subfields),"string"==typeof r.joinexpression&&0<r.joinexpression.length&&f.setAttribute("joinexpression",r.joinexpression),"string"==typeof r.jointables&&0<r.jointables.length&&f.setAttribute("jointables",r.jointables),u.appendChild(f)}"object"==typeof n.layerlist[i].renderer&&this.addRenderer(u,n.layerlist[i].renderer)}}else null!=n.get_feature&&(t=this.createElementNS("","GET_FEATURES"),t.setAttribute("outputmode","newxml"),t.setAttribute("checkesc","true"),n.get_feature.geometry?t.setAttribute("geometry",n.get_feature.geometry):t.setAttribute("geometry","false"),n.get_feature.compact&&t.setAttribute("compact",n.get_feature.compact),"number"==n.get_feature.featurelimit&&t.setAttribute("featurelimit",n.get_feature.featurelimit),t.setAttribute("globalenvelope","true"),o.appendChild(t),null!=n.get_feature.layer&&0<n.get_feature.layer.length&&(i=this.createElementNS("","LAYER"),i.setAttribute("id",n.get_feature.layer),t.appendChild(i)),n=n.get_feature.query,null!=n&&(i=null,i=n.isspatial?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY"),t.appendChild(i),"number"==typeof n.accuracy&&i.setAttribute("accuracy",n.accuracy),null!=n.featurecoordsys&&(t=this.createElementNS("","FEATURECOORDSYS"),0==n.featurecoordsys.id?t.setAttribute("string",n.featurecoordsys.string):t.setAttribute("id",n.featurecoordsys.id),i.appendChild(t)),null!=n.filtercoordsys&&(t=this.createElementNS("","FILTERCOORDSYS"),0===n.filtercoordsys.id?t.setAttribute("string",n.filtercoordsys.string):t.setAttribute("id",n.filtercoordsys.id),i.appendChild(t)),0<n.buffer&&(t=this.createElementNS("","BUFFER"),t.setAttribute("distance",n.buffer),i.appendChild(t)),n.isspatial&&(t=this.createElementNS("","SPATIALFILTER"),t.setAttribute("relation",n.spatialfilter.relation),i.appendChild(t),n.spatialfilter.envelope?(u=this.createElementNS("","ENVELOPE"),u.setAttribute("minx",n.spatialfilter.envelope.minx),u.setAttribute("miny",n.spatialfilter.envelope.miny),u.setAttribute("maxx",n.spatialfilter.envelope.maxx),u.setAttribute("maxy",n.spatialfilter.envelope.maxy),t.appendChild(u)):"object"==typeof n.spatialfilter.polygon&&t.appendChild(this.writePolygonGeometry(n.spatialfilter.polygon))),null!=n.where&&0<n.where.length&&i.setAttribute("where",n.where)));return e.appendChild(o),OpenLayers.Format.XML.prototype.write.apply(this,[e])},addGroupRenderer:function(n,t){var r=this.createElementNS("","GROUPRENDERER"),i;for(n.appendChild(r),i=0;i<t.length;i++)this.addRenderer(r,t[i])},addRenderer:function(n,t){if(OpenLayers.Util.isArray(t))this.addGroupRenderer(n,t);else{var i=this.createElementNS("",t.type.toUpperCase()+"RENDERER");n.appendChild(i),"VALUEMAPRENDERER"==i.tagName?this.addValueMapRenderer(i,t):"VALUEMAPLABELRENDERER"==i.tagName?this.addValueMapLabelRenderer(i,t):"SIMPLELABELRENDERER"==i.tagName?this.addSimpleLabelRenderer(i,t):"SCALEDEPENDENTRENDERER"==i.tagName&&this.addScaleDependentRenderer(i,t)}},addScaleDependentRenderer:function(n,t){"string"!=typeof t.lower&&"number"!=typeof t.lower||n.setAttribute("lower",t.lower),"string"!=typeof t.upper&&"number"!=typeof t.upper||n.setAttribute("upper",t.upper),this.addRenderer(n,t.renderer)},addValueMapLabelRenderer:function(n,t){var f,s,i,r,u,e;if(n.setAttribute("lookupfield",t.lookupfield),n.setAttribute("labelfield",t.labelfield),"object"==typeof t.exacts)for(f=0,s=t.exacts.length;f<s;f++)if(i=t.exacts[f],r=this.createElementNS("","EXACT"),"string"==typeof i.value&&r.setAttribute("value",i.value),"string"==typeof i.label&&r.setAttribute("label",i.label),"string"==typeof i.method&&r.setAttribute("method",i.method),n.appendChild(r),"object"==typeof i.symbol&&(u=null,"text"==i.symbol.type&&(u=this.createElementNS("","TEXTSYMBOL")),null!=u)){for(var h=this.fontStyleKeys,o=0,c=h.length;o<c;o++)e=h[o],i.symbol[e]&&u.setAttribute(e,i.symbol[e]);r.appendChild(u)}},addValueMapRenderer:function(n,t){var f,e,i,u,r;if(n.setAttribute("lookupfield",t.lookupfield),"object"==typeof t.ranges)for(f=0,e=t.ranges.length;f<e;f++)i=t.ranges[f],u=this.createElementNS("","RANGE"),u.setAttribute("lower",i.lower),u.setAttribute("upper",i.upper),n.appendChild(u),"object"==typeof i.symbol&&(r=null,"simplepolygon"==i.symbol.type&&(r=this.createElementNS("","SIMPLEPOLYGONSYMBOL")),null!=r&&("string"==typeof i.symbol.boundarycolor&&r.setAttribute("boundarycolor",i.symbol.boundarycolor),"string"==typeof i.symbol.fillcolor&&r.setAttribute("fillcolor",i.symbol.fillcolor),"number"==typeof i.symbol.filltransparency&&r.setAttribute("filltransparency",i.symbol.filltransparency),u.appendChild(r)));else if("object"==typeof t.exacts)for(f=0,e=t.exacts.length;f<e;f++)i=t.exacts[f],u=this.createElementNS("","EXACT"),"string"==typeof i.value&&u.setAttribute("value",i.value),"string"==typeof i.label&&u.setAttribute("label",i.label),"string"==typeof i.method&&u.setAttribute("method",i.method),n.appendChild(u),"object"==typeof i.symbol&&(r=null,"simplemarker"==i.symbol.type&&(r=this.createElementNS("","SIMPLEMARKERSYMBOL")),null!=r&&("string"==typeof i.symbol.antialiasing&&r.setAttribute("antialiasing",i.symbol.antialiasing),"string"==typeof i.symbol.color&&r.setAttribute("color",i.symbol.color),"string"==typeof i.symbol.outline&&r.setAttribute("outline",i.symbol.outline),"string"==typeof i.symbol.overlap&&r.setAttribute("overlap",i.symbol.overlap),"string"==typeof i.symbol.shadow&&r.setAttribute("shadow",i.symbol.shadow),"number"==typeof i.symbol.transparency&&r.setAttribute("transparency",i.symbol.transparency),"string"==typeof i.symbol.usecentroid&&r.setAttribute("usecentroid",i.symbol.usecentroid),"number"==typeof i.symbol.width&&r.setAttribute("width",i.symbol.width),u.appendChild(r)))},addSimpleLabelRenderer:function(n,t){var i,o,e;n.setAttribute("field",t.field);for(var u="featureweight howmanylabels labelbufferratio labelpriorities labelweight linelabelposition rotationalangles".split(" "),r=0,f=u.length;r<f;r++)i=u[r],t[i]&&n.setAttribute(i,t[i]);if("text"==t.symbol.type)for(o=t.symbol,e=this.createElementNS("","TEXTSYMBOL"),n.appendChild(e),u=this.fontStyleKeys,r=0,f=u.length;r<f;r++)i=u[r],o[i]&&e.setAttribute(i,t[i])},writePolygonGeometry:function(n){var u,t;if(!(n instanceof OpenLayers.Geometry.Polygon))throw{message:"Cannot write polygon geometry to ArcXML with an "+n.CLASS_NAME+" object.",geometry:n};for(var f=this.createElementNS("","POLYGON"),i=0,s=n.components.length;i<s;i++){for(var e=n.components[i],o=this.createElementNS("","RING"),r=0,h=e.components.length;r<h;r++)u=e.components[r],t=this.createElementNS("","POINT"),t.setAttribute("x",u.x),t.setAttribute("y",u.y),o.appendChild(t);f.appendChild(o)}return f},parseResponse:function(n){var i,t,r,e,o,h,s;if("string"==typeof n&&(n=(new OpenLayers.Format.XML).read(n)),i=new OpenLayers.Format.ArcXML.Response,t=n.getElementsByTagName("ERROR"),null!=t&&0<t.length)i.error=this.getChildValue(t,"Unknown error.");else{if(t=n.getElementsByTagName("RESPONSE"),null==t||0==t.length)return i.error="No RESPONSE tag found in ArcXML response.",i;if(r=t[0].firstChild.nodeName,"#text"==r&&(r=t[0].firstChild.nextSibling.nodeName),"IMAGE"==r)t=n.getElementsByTagName("ENVELOPE"),n=n.getElementsByTagName("OUTPUT"),null==t||0==t.length?i.error="No ENVELOPE tag found in ArcXML response.":null==n||0==n.length?i.error="No OUTPUT tag found in ArcXML response.":(t=this.parseAttributes(t[0]),r=this.parseAttributes(n[0]),i.image="string"==typeof r.type?{envelope:t,output:{type:r.type,data:this.getChildValue(n[0])}}:{envelope:t,output:r});else if("FEATURES"==r){if(n=t[0].getElementsByTagName("FEATURES"),t=n[0].getElementsByTagName("FEATURECOUNT"),i.features.featurecount=t[0].getAttribute("count"),0<i.features.featurecount)for(t=n[0].getElementsByTagName("ENVELOPE"),i.features.envelope=this.parseAttributes(t[0],"number"),n=n[0].getElementsByTagName("FEATURE"),t=0;t<n.length;t++){for(var r=new OpenLayers.Feature.Vector,u=n[t].getElementsByTagName("FIELD"),f=0;f<u.length;f++)e=u[f].getAttribute("name"),o=u[f].getAttribute("value"),r.attributes[e]=o;if(u=n[t].getElementsByTagName("POLYGON"),0<u.length){for(u=u[0].getElementsByTagName("RING"),f=[],e=0;e<u.length;e++){for(o=[],o.push(this.parsePointGeometry(u[e])),h=u[e].getElementsByTagName("HOLE"),s=0;s<h.length;s++)o.push(this.parsePointGeometry(h[s]));f.push(new OpenLayers.Geometry.Polygon(o))}r.geometry=1==f.length?f[0]:new OpenLayers.Geometry.MultiPolygon(f)}i.features.feature.push(r)}}else i.error="Unidentified response type."}return i},parseAttributes:function(n,t){for(var r={},i=0;i<n.attributes.length;i++)r[n.attributes[i].nodeName]="number"==t?parseFloat(n.attributes[i].nodeValue):n.attributes[i].nodeValue;return r},parsePointGeometry:function(n){var i=[],t=n.getElementsByTagName("COORDS"),r;if(0<t.length)for(n=this.getChildValue(t[0]),n=n.split(/;/),t=0;t<n.length;t++)r=n[t].split(/ /),i.push(new OpenLayers.Geometry.Point(r[0],r[1]));else if(n=n.getElementsByTagName("POINT"),0<n.length)for(t=0;t<n.length;t++)i.push(new OpenLayers.Geometry.Point(parseFloat(n[t].getAttribute("x")),parseFloat(n[t].getAttribute("y"))));return new OpenLayers.Geometry.LinearRing(i)},CLASS_NAME:"OpenLayers.Format.ArcXML"}),OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(){return OpenLayers.Util.extend(this,{get_image:{properties:{background:null,draw:!0,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:!1},layerlist:[],output:{baseurl:"",legendbaseurl:"",legendname:"",legendpath:"",legendurl:"",name:"",path:"",type:"jpg",url:""}}},get_feature:{layer:"",query:{isspatial:!1,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:[]})},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"}),OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(){return OpenLayers.Util.extend(this,{image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""})},CLASS_NAME:"OpenLayers.Format.ArcXML.Response"}),OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:!0,name:"ArcIMS",isBaseLayer:!0,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:!0,async:!0,name:"ArcIMS"},initialize:function(n,t,i){this.tileSize=new OpenLayers.Size(512,512),this.params=OpenLayers.Util.applyDefaults({ServiceName:i.serviceName},this.DEFAULT_PARAMS),this.options=OpenLayers.Util.applyDefaults(i,this.DEFAULT_OPTIONS),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n,t,this.params,i]),this.transparent&&(this.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.format&&(this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png")),null===this.options.layers&&(this.options.layers=[])},getURL:function(n){var t="";return n=this.adjustBounds(n),n=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:n.toArray(),tileSize:this.tileSize})),n=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:n.write(),async:!1}),null!=n&&(t=n.responseXML,t&&t.documentElement||(t=n.responseText),t=(new OpenLayers.Format.ArcXML).read(t),t=this.getUrlOrImage(t.image.output)),t},getURLasync:function(n,t,i){n=this.adjustBounds(n),n=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:n.toArray(),tileSize:this.tileSize})),OpenLayers.Request.POST({url:this.getFullRequestString(),async:!0,data:n.write(),callback:function(n){var r=n.responseXML;r&&r.documentElement||(r=n.responseText),n=(new OpenLayers.Format.ArcXML).read(r),t.call(i,this.getUrlOrImage(n.image.output))},scope:this})},getUrlOrImage:function(n){var t="";return n.url?t=n.url:n.data&&(t="data:image/"+n.type+";base64,"+n.data),t},setLayerQuery:function(n,t){for(var i=0;i<this.options.layers.length;i++)if(n==this.options.layers[i].id){this.options.layers[i].query=t;return}this.options.layers.push({id:n,visible:!0,query:t})},getFeatureInfo:function(n,t,i){var f=i.buffer||1,e=i.callback||function(){},o=i.scope||window,u={},r;OpenLayers.Util.extend(u,this.options),u.requesttype="feature",n instanceof OpenLayers.LonLat?(u.polygon=null,u.envelope=[n.lon-f,n.lat-f,n.lon+f,n.lat+f]):n instanceof OpenLayers.Geometry.Polygon&&(u.envelope=null,u.polygon=n),r=new OpenLayers.Format.ArcXML(u),OpenLayers.Util.extend(r.request.get_feature,i),r.request.get_feature.layer=t.id,"number"==typeof t.query.accuracy?r.request.get_feature.query.accuracy=t.query.accuracy:(n=this.map.getCenter(),i=this.map.getViewPortPxFromLonLat(n),i.x++,i=this.map.getLonLatFromPixel(i),r.request.get_feature.query.accuracy=i.lon-n.lon),r.request.get_feature.query.where=t.query.where,r.request.get_feature.query.spatialfilter.relation="area_intersection",OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:r.write(),callback:function(n){n=r.parseResponse(n.responseText),r.iserror()?e.call(o,null):e.call(o,n.features)}})},clone:function(n){return null==n&&(n=new OpenLayers.Layer.ArcIMS(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},CLASS_NAME:"OpenLayers.Layer.ArcIMS"}),OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y),OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onButtonClick),this.removeButtons(),this.position=this.buttons=null,OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.map.events.register("buttonclick",this,this.onButtonClick)},draw:function(n){OpenLayers.Control.prototype.draw.apply(this,arguments),n=this.position,this.buttons=[];var t={w:18,h:18},i=new OpenLayers.Pixel(n.x+t.w/2,n.y);return this._addButton("panup","north-mini.png",i,t),n.y=i.y+t.h,this._addButton("panleft","west-mini.png",n,t),this._addButton("panright","east-mini.png",n.add(t.w,0),t),this._addButton("pandown","south-mini.png",i.add(0,2*t.h),t),this._addButton("zoomin","zoom-plus-mini.png",i.add(0,3*t.h+5),t),this._addButton("zoomworld","zoom-world-mini.png",i.add(0,4*t.h+5),t),this._addButton("zoomout","zoom-minus-mini.png",i.add(0,5*t.h+5),t),this.div},_addButton:function(n,t,i,r){return t=OpenLayers.Util.getImageLocation(t),i=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+n,i,r,t,"absolute"),i.style.cursor="pointer",this.div.appendChild(i),i.action=n,i.className="olButton",this.buttons.push(i),i},_removeButton:function(n){this.div.removeChild(n),OpenLayers.Util.removeItem(this.buttons,n)},removeButtons:function(){for(var n=this.buttons.length-1;0<=n;--n)this._removeButton(this.buttons[n])},onButtonClick:function(n){switch(n.buttonElement.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()}},getSlideFactor:function(n){return this.slideRatio?this.map.getSize()[n]*this.slideRatio:this.slideFactor},CLASS_NAME:"OpenLayers.Control.PanZoom"}),OpenLayers.Control.PanZoom.X=4,OpenLayers.Control.PanZoom.Y=4,OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoombarDiv:null,zoomWorldIcon:!1,panIcons:!0,forceFixedZoomLevel:!1,mouseDragStart:null,deltaY:null,zoomStart:null,destroy:function(){this._removeZoomBar(),this.map.events.un({changebaselayer:this.redraw,updatesize:this.redraw,scope:this}),OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments),delete this.mouseDragStart,delete this.zoomStart},setMap:function(){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.on({changebaselayer:this.redraw,updatesize:this.redraw,scope:this})},redraw:function(){null!=this.div&&(this.removeButtons(),this._removeZoomBar()),this.draw()},draw:function(n){var t,i,r;return OpenLayers.Control.prototype.draw.apply(this,arguments),n=this.position.clone(),this.buttons=[],t={w:18,h:18},this.panIcons?(i=new OpenLayers.Pixel(n.x+t.w/2,n.y),r=t.w,this.zoomWorldIcon&&(i=new OpenLayers.Pixel(n.x+t.w,n.y)),this._addButton("panup","north-mini.png",i,t),n.y=i.y+t.h,this._addButton("panleft","west-mini.png",n,t),this.zoomWorldIcon&&(this._addButton("zoomworld","zoom-world-mini.png",n.add(t.w,0),t),r*=2),this._addButton("panright","east-mini.png",n.add(r,0),t),this._addButton("pandown","south-mini.png",i.add(0,2*t.h),t),this._addButton("zoomin","zoom-plus-mini.png",i.add(0,3*t.h+5),t),i=this._addZoomBar(i.add(0,4*t.h+5)),this._addButton("zoomout","zoom-minus-mini.png",i,t)):(this._addButton("zoomin","zoom-plus-mini.png",n,t),i=this._addZoomBar(n.add(0,t.h)),this._addButton("zoomout","zoom-minus-mini.png",i,t),this.zoomWorldIcon&&(i=i.add(0,t.h+3),this._addButton("zoomworld","zoom-world-mini.png",i,t))),this.div},_addZoomBar:function(n){var u=OpenLayers.Util.getImageLocation("slider.png"),t=this.id+"_"+this.map.id,f=this.map.getMinZoom(),i=this.map.getNumZoomLevels()-1-this.map.getZoom(),i=OpenLayers.Util.createAlphaImageDiv(t,n.add(-1,i*this.zoomStopHeight),{w:20,h:9},u,"absolute");i.style.cursor="move",this.slider=i,this.sliderEvents=new OpenLayers.Events(this,i,null,!0,{includeXY:!0});this.sliderEvents.on({touchstart:this.zoomBarDown,touchmove:this.zoomBarDrag,touchend:this.zoomBarUp,mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp});var r={w:this.zoomStopWidth,h:this.zoomStopHeight*(this.map.getNumZoomLevels()-f)},u=OpenLayers.Util.getImageLocation("zoombar.png"),t=null;return OpenLayers.Util.alphaHack()?(t=this.id+"_"+this.map.id,t=OpenLayers.Util.createAlphaImageDiv(t,n,{w:r.w,h:this.zoomStopHeight},u,"absolute",null,"crop"),t.style.height=r.h+"px"):t=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,n,r,u),t.style.cursor="pointer",t.className="olButton",this.zoombarDiv=t,this.div.appendChild(t),this.startTop=parseInt(t.style.top),this.div.appendChild(i),this.map.events.register("zoomend",this,this.moveZoomBar),n=n.add(0,this.zoomStopHeight*(this.map.getNumZoomLevels()-f))},_removeZoomBar:function(){this.sliderEvents.un({touchstart:this.zoomBarDown,touchmove:this.zoomBarDrag,touchend:this.zoomBarUp,mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp}),this.sliderEvents.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)},onButtonClick:function(n){if(OpenLayers.Control.PanZoom.prototype.onButtonClick.apply(this,arguments),n.buttonElement===this.zoombarDiv){var t=n.buttonXY.y/this.zoomStopHeight;(this.forceFixedZoomLevel||!this.map.fractionalZoom)&&(t=Math.floor(t)),t=this.map.getNumZoomLevels()-1-t,t=Math.min(Math.max(t,0),this.map.getNumZoomLevels()-1),this.map.zoomTo(t)}},passEventToSlider:function(n){this.sliderEvents.handleBrowserEvent(n)},zoomBarDown:function(n){(OpenLayers.Event.isLeftClick(n)||OpenLayers.Event.isSingleTouch(n))&&(this.map.events.on({touchmove:this.passEventToSlider,mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this}),this.mouseDragStart=n.xy.clone(),this.zoomStart=n.xy.clone(),this.div.style.cursor="move",this.zoombarDiv.offsets=null,OpenLayers.Event.stop(n))},zoomBarDrag:function(n){if(null!=this.mouseDragStart){var t=this.mouseDragStart.y-n.xy.y,i=OpenLayers.Util.pagePosition(this.zoombarDiv);0<n.clientY-i[1]&&n.clientY-i[1]<parseInt(this.zoombarDiv.style.height)-2&&(t=parseInt(this.slider.style.top)-t,this.slider.style.top=t+"px",this.mouseDragStart=n.xy.clone()),this.deltaY=this.zoomStart.y-n.xy.y,OpenLayers.Event.stop(n)}},zoomBarUp:function(n){if((OpenLayers.Event.isLeftClick(n)||"touchend"===n.type)&&this.mouseDragStart){this.div.style.cursor="",this.map.events.un({touchmove:this.passEventToSlider,mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var t=this.map.zoom;!this.forceFixedZoomLevel&&this.map.fractionalZoom?(t+=this.deltaY/this.zoomStopHeight,t=Math.min(Math.max(t,0),this.map.getNumZoomLevels()-1)):(t+=this.deltaY/this.zoomStopHeight,t=Math.max(Math.round(t),0)),this.map.zoomTo(t),this.zoomStart=this.mouseDragStart=null,this.deltaY=0,OpenLayers.Event.stop(n)}},moveZoomBar:function(){var n=(this.map.getNumZoomLevels()-1-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=n+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"}),OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},readers:{wfs:OpenLayers.Util.applyDefaults({DefaultSRS:function(n,t){var i=this.getChildValue(n);i&&(t.srs=i)}},OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs),ows:OpenLayers.Format.OWSCommon.v1.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"}),OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!0,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(n,t,i,r,u){this.url=t,this.maxExtent=this.extent=i,this.size=r,OpenLayers.Layer.prototype.initialize.apply(this,[n,u]),this.aspectRatio=this.extent.getHeight()/this.size.h/(this.extent.getWidth()/this.size.w)},destroy:function(){this.tile&&(this.removeTileMonitoringHooks(this.tile),this.tile.destroy(),this.tile=null),OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.getOptions())),n=OpenLayers.Layer.prototype.clone.apply(this,[n])},setMap:function(){null==this.options.maxResolution&&(this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w),OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(n,t){var r,u;OpenLayers.Layer.prototype.moveTo.apply(this,arguments),r=null==this.tile,(t||r)&&(this.setTileSize(),u=this.map.getLayerPxFromLonLat({lon:this.extent.left,lat:this.extent.top}),r?(this.tile=new OpenLayers.Tile.Image(this,u,this.extent,null,this.tileSize),this.addTileMonitoringHooks(this.tile)):(this.tile.size=this.tileSize.clone(),this.tile.position=u.clone()),this.tile.draw())},setTileSize:function(){var n=this.extent.getWidth()/this.map.getResolution(),t=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(n,t)},addTileMonitoringHooks:function(n){n.onLoadStart=function(){this.events.triggerEvent("loadstart")},n.events.register("loadstart",this,n.onLoadStart),n.onLoadEnd=function(){this.events.triggerEvent("loadend")},n.events.register("loadend",this,n.onLoadEnd),n.events.register("unload",this,n.onLoadEnd)},removeTileMonitoringHooks:function(n){n.unload(),n.events.un({loadstart:n.onLoadStart,loadend:n.onLoadEnd,unload:n.onLoadEnd,scope:this})},setUrl:function(n){this.url=n,this.tile.draw()},getURL:function(){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"}),OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:!0,autoDestroy:!0,initialize:function(n){OpenLayers.Util.extend(this,n),this.options=n,this.active=!1},destroy:function(){this.deactivate(),this.options=this.layer=null},setLayer:function(n){this.layer=n},activate:function(){return this.active?!1:this.active=!0},deactivate:function(){return this.active?(this.active=!1,!0):!1},CLASS_NAME:"OpenLayers.Strategy"}),OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{events:null,auto:!1,timer:null,initialize:function(n){OpenLayers.Strategy.prototype.initialize.apply(this,[n]),this.events=new OpenLayers.Events(this)},activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);if(n&&this.auto)if("number"==typeof this.auto)this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),1e3*this.auto);else this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this});return n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&this.auto&&("number"==typeof this.auto?window.clearInterval(this.timer):this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})),n},triggerSave:function(n){var t=n.feature;t.state!==OpenLayers.State.INSERT&&t.state!==OpenLayers.State.UPDATE&&t.state!==OpenLayers.State.DELETE||this.save([n.feature])},save:function(n){var u,f;if(n||(n=this.layer.features),this.events.triggerEvent("start",{features:n}),u=this.layer.projection,f=this.layer.map.getProjectionObject(),!f.equals(u)){for(var e=n.length,o=Array(e),t,i,r=0;r<e;++r)t=n[r],i=t.clone(),i.fid=t.fid,i.state=t.state,t.url&&(i.url=t.url),i._original=t,i.geometry.transform(f,u),o[r]=i;n=o}this.layer.protocol.commit(n,{callback:this.onCommit,scope:this})},onCommit:function(n){var u={response:n};if(n.success()){for(var f=n.reqFeatures,t,i=[],o=n.insertIds||[],e=0,r=0,s=f.length;r<s;++r)(t=f[r],t=t._original||t,n=t.state)&&(n==OpenLayers.State.DELETE?i.push(t):n==OpenLayers.State.INSERT&&(t.fid=o[e],++e),t.state=null);0<i.length&&this.layer.destroyFeatures(i),this.events.triggerEvent("success",u)}else this.events.triggerEvent("fail",u)},CLASS_NAME:"OpenLayers.Strategy.Save"}),OpenLayers.Events.featureclick=OpenLayers.Class({cache:null,map:null,provides:["featureclick","nofeatureclick","featureover","featureout"],initialize:function(n){if(this.target=n,n.object instanceof OpenLayers.Map)this.setMap(n.object);else if(n.object instanceof OpenLayers.Layer.Vector)n.object.map?this.setMap(n.object.map):n.object.events.register("added",this,function(){this.setMap(n.object.map)});else throw"Listeners for '"+this.provides.join("', '")+"' events can only be registered for OpenLayers.Layer.Vector or OpenLayers.Map instances";for(var t=this.provides.length-1;0<=t;--t)n.extensions[this.provides[t]]=!0},setMap:function(n){this.map=n,this.cache={},n.events.register("mousedown",this,this.start,{extension:!0}),n.events.register("mouseup",this,this.onClick,{extension:!0}),n.events.register("touchstart",this,this.start,{extension:!0}),n.events.register("touchmove",this,this.cancel,{extension:!0}),n.events.register("touchend",this,this.onClick,{extension:!0}),n.events.register("mousemove",this,this.onMousemove,{extension:!0})},start:function(n){this.startEvt=n},cancel:function(){delete this.startEvt},onClick:function(n){if(this.startEvt&&("touchend"===n.type||OpenLayers.Event.isLeftClick(n))){n=this.getFeatures(this.startEvt),delete this.startEvt;for(var r,i,f={},t=0,u=n.length;t<u&&(r=n[t],i=r.layer,f[i.id]=!0,r=this.triggerEvent("featureclick",{feature:r}),!1!==r);++t);for(t=0,u=this.map.layers.length;t<u;++t)i=this.map.layers[t],i instanceof OpenLayers.Layer.Vector&&!f[i.id]&&this.triggerEvent("nofeatureclick",{layer:i})}},onMousemove:function(n){var e,t,i,f,r,u;for(delete this.startEvt,r=this.getFeatures(n),e={},n=[],i=0,f=r.length;i<f;++i)t=r[i],e[t.id]=t,this.cache[t.id]||n.push(t);r=[];for(u in this.cache)t=this.cache[u],t.layer&&t.layer.map?e[t.id]||r.push(t):delete this.cache[u];for(i=0,f=n.length;i<f&&(t=n[i],this.cache[t.id]=t,u=this.triggerEvent("featureover",{feature:t}),!1!==u);++i);for(i=0,f=r.length;i<f&&(t=r[i],delete this.cache[t.id],u=this.triggerEvent("featureout",{feature:t}),!1!==u);++i);},triggerEvent:function(n,t){var r=t.feature?t.feature.layer:t.layer,i=this.target.object;if(i instanceof OpenLayers.Map||i===r)return this.target.triggerEvent(n,t)},getFeatures:function(n){for(var s=n.clientX,h=n.clientY,e=[],o=[],u=[],i,r,f,t=this.map.layers.length-1;0<=t;--t)if(i=this.map.layers[t],"none"!==i.div.style.display)if(i.renderer instanceof OpenLayers.Renderer.Elements){if(i instanceof OpenLayers.Layer.Vector)for(r=document.elementFromPoint(s,h);r&&r._featureId;)(f=i.getFeatureById(r._featureId))?(e.push(f),r.style.display="none",o.push(r),r=document.elementFromPoint(s,h)):r=!1;u.push(i),i.div.style.display="none"}else i.renderer instanceof OpenLayers.Renderer.Canvas&&(f=i.renderer.getFeatureIdFromEvent(n))&&(e.push(f),u.push(i));for(t=0,n=o.length;t<n;++t)o[t].style.display="";for(t=u.length-1;0<=t;--t)u[t].div.style.display="block";return e},destroy:function(){for(var n=this.provides.length-1;0<=n;--n)delete this.target.extensions[this.provides[n]];this.map.events.un({mousemove:this.onMousemove,mousedown:this.start,mouseup:this.onClick,touchstart:this.start,touchmove:this.cancel,touchend:this.onClick,scope:this}),delete this.cache,delete this.map,delete this.target}}),OpenLayers.Events.nofeatureclick=OpenLayers.Events.featureclick,OpenLayers.Events.featureover=OpenLayers.Events.featureclick,OpenLayers.Events.featureout=OpenLayers.Events.featureclick,OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{defaultDesc:"No description available",extractWaypoints:!0,extractTracks:!0,extractRoutes:!0,extractAttributes:!0,namespaces:{gpx:"http://www.topografix.com/GPX/1/1",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",creator:"OpenLayers",initialize:function(n){this.externalProjection=new OpenLayers.Projection("EPSG:4326"),OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var u,i,s;if("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),u=[],this.extractTracks)for(var t=n.getElementsByTagName("trk"),r=0,f=t.length;r<f;r++){i={},this.extractAttributes&&(i=this.parseAttributes(t[r]));for(var e=this.getElementsByTagNameNS(t[r],t[r].namespaceURI,"trkseg"),o=0,h=e.length;o<h;o++)s=this.extractSegment(e[o],"trkpt"),u.push(new OpenLayers.Feature.Vector(s,i))}if(this.extractRoutes)for(f=n.getElementsByTagName("rte"),t=0,r=f.length;t<r;t++)i={},this.extractAttributes&&(i=this.parseAttributes(f[t])),e=this.extractSegment(f[t],"rtept"),u.push(new OpenLayers.Feature.Vector(e,i));if(this.extractWaypoints)for(n=n.getElementsByTagName("wpt"),t=0,f=n.length;t<f;t++)i={},this.extractAttributes&&(i=this.parseAttributes(n[t])),r=new OpenLayers.Geometry.Point(n[t].getAttribute("lon"),n[t].getAttribute("lat")),u.push(new OpenLayers.Feature.Vector(r,i));if(this.internalProjection&&this.externalProjection)for(i=0,n=u.length;i<n;i++)u[i].geometry.transform(this.externalProjection,this.internalProjection);return u},extractSegment:function(n,t){for(var r=this.getElementsByTagNameNS(n,n.namespaceURI,t),u=[],i=0,f=r.length;i<f;i++)u.push(new OpenLayers.Geometry.Point(r[i].getAttribute("lon"),r[i].getAttribute("lat")));return new OpenLayers.Geometry.LineString(u)},parseAttributes:function(n){var r={},t,i;for(n=n.firstChild;n;)1==n.nodeType&&n.firstChild&&(t=n.firstChild,3==t.nodeType||4==t.nodeType)&&(i=n.prefix?n.nodeName.split(":")[1]:n.nodeName,"trkseg"!=i&&"rtept"!=i&&(r[i]=t.nodeValue)),n=n.nextSibling;return r},write:function(n,t){var i,r,u;for(n=OpenLayers.Util.isArray(n)?n:[n],i=this.createElementNS(this.namespaces.gpx,"gpx"),i.setAttribute("version","1.1"),i.setAttribute("creator",this.creator),this.setAttributes(i,{"xsi:schemaLocation":this.schemaLocation}),t&&"object"==typeof t&&i.appendChild(this.buildMetadataNode(t)),r=0,u=n.length;r<u;r++)i.appendChild(this.buildFeatureNode(n[r]));return OpenLayers.Format.XML.prototype.write.apply(this,[i])},buildMetadataNode:function(n){for(var t,r,u=["name","desc","author"],f=this.createElementNS(this.namespaces.gpx,"metadata"),i=0;i<u.length;i++)t=u[i],n[t]&&(r=this.createElementNS(this.namespaces.gpx,t),r.appendChild(this.createTextNode(n[t])),f.appendChild(r));return f},buildFeatureNode:function(n){var t=n.geometry,t=t.clone(),i,r;if(this.internalProjection&&this.externalProjection&&t.transform(this.internalProjection,this.externalProjection),"OpenLayers.Geometry.Point"==t.CLASS_NAME)return i=this.buildWptNode(t),this.appendAttributesNode(i,n),i;for(i=this.createElementNS(this.namespaces.gpx,"trk"),this.appendAttributesNode(i,n),n=this.buildTrkSegNode(t),n=OpenLayers.Util.isArray(n)?n:[n],t=0,r=n.length;t<r;t++)i.appendChild(n[t]);return i},buildTrkSegNode:function(n){var i,t,r,u;if("OpenLayers.Geometry.LineString"==n.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==n.CLASS_NAME){for(i=this.createElementNS(this.namespaces.gpx,"trkseg"),t=0,r=n.components.length;t<r;t++)u=n.components[t],i.appendChild(this.buildTrkPtNode(u));return i}for(i=[],t=0,r=n.components.length;t<r;t++)i.push(this.buildTrkSegNode(n.components[t]));return i},buildTrkPtNode:function(n){var t=this.createElementNS(this.namespaces.gpx,"trkpt");return t.setAttribute("lon",n.x),t.setAttribute("lat",n.y),t},buildWptNode:function(n){var t=this.createElementNS(this.namespaces.gpx,"wpt");return t.setAttribute("lon",n.x),t.setAttribute("lat",n.y),t},appendAttributesNode:function(n,t){var i=this.createElementNS(this.namespaces.gpx,"name");i.appendChild(this.createTextNode(t.attributes.name||t.id)),n.appendChild(i),i=this.createElementNS(this.namespaces.gpx,"desc"),i.appendChild(this.createTextNode(t.attributes.description||this.defaultDesc)),n.appendChild(i)},CLASS_NAME:"OpenLayers.Format.GPX"}),OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g},namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},readers:{xsd:{schema:function(n,t){var f=[],s={},i,e,r,u,o;for(this.readChildNodes(n,{complexTypes:f,customTypes:s}),r=n.attributes,i=0,e=r.length;i<e;++i)u=r[i],o=u.name,0===o.indexOf("xmlns")?this.setNamespace(o.split(":")[1]||"",u.value):t[o]=u.value;for(t.featureTypes=f,t.targetPrefix=this.namespaceAlias[t.targetNamespace],i=0,e=f.length;i<e;++i)r=f[i],u=s[r.typeName],s[r.typeName]&&(r.typeName=u.name)},complexType:function(n,t){var i={typeName:n.getAttribute("name")};this.readChildNodes(n,i),t.complexTypes.push(i)},complexContent:function(n,t){this.readChildNodes(n,t)},extension:function(n,t){this.readChildNodes(n,t)},sequence:function(n,t){var i={elements:[]};this.readChildNodes(n,i),t.properties=i.elements},element:function(n,t){var i,r,f,u,e;if(t.elements){for(r={},i=n.attributes,u=0,e=i.length;u<e;++u)f=i[u],r[f.name]=f.value;i=r.type,i||(i={},this.readChildNodes(n,i),r.restriction=i,r.type=i.base),r.localType=(i.base||i).split(":").pop(),t.elements.push(r),this.readChildNodes(n,r)}t.complexTypes&&(i=n.getAttribute("type"),r=i.split(":").pop(),t.customTypes[r]={name:n.getAttribute("name"),type:i})},annotation:function(n,t){t.annotation={},this.readChildNodes(n,t.annotation)},appinfo:function(n,t){t.appinfo||(t.appinfo=[]),t.appinfo.push(this.getChildValue(n))},documentation:function(n,t){t.documentation||(t.documentation=[]);var i=this.getChildValue(n);t.documentation.push({lang:n.getAttribute("xml:lang"),textContent:i.replace(this.regExes.trimSpace,"")})},simpleType:function(n,t){this.readChildNodes(n,t)},restriction:function(n,t){t.base=n.getAttribute("base"),this.readRestriction(n,t)}}},readRestriction:function(n,t){for(var f=n.childNodes,i,r,u=0,e=f.length;u<e;++u)i=f[u],1==i.nodeType&&(r=i.nodeName.split(":").pop(),i=i.getAttribute("value"),t[r]?("string"==typeof t[r]&&(t[r]=[t[r]]),t[r].push(i)):t[r]=i)},read:function(n){var t,i;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement),t={},"ExceptionReport"===n.nodeName.split(":").pop()?(i=new OpenLayers.Format.OGCExceptionReport,t.error=i.read(n)):this.readNode(n,t),t},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"}),OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:!1,size:null,resolution:null,map:null,featureDx:0,initialize:function(n,t){this.container=OpenLayers.Util.getElement(n),OpenLayers.Util.extend(this,t)},destroy:function(){this.map=this.resolution=this.size=this.extent=this.container=null},supported:function(){return!1},setExtent:function(n,t){if(this.extent=n.clone(),this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var i=n.getWidth()/this.map.getExtent().getWidth();n=n.scale(1/i),this.extent=n.wrapDateLine(this.map.getMaxExtent()).scale(i)}return t&&(this.resolution=null),!0},setSize:function(n){this.size=n.clone(),this.resolution=null},getResolution:function(){return this.resolution=this.resolution||this.map.getResolution()},drawFeature:function(n,t){var i,r;if(null==t&&(t=n.style),n.geometry&&(i=n.geometry.getBounds(),i)){if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(r=this.map.getMaxExtent()),i.intersectsBounds(this.extent,{worldBounds:r})?this.calculateFeatureDx(i,r):t={display:"none"},i=this.drawGeometry(n.geometry,t,n.id),"none"!=t.display&&t.label&&!1!==i){if(r=n.geometry.getCentroid(),t.labelXOffset||t.labelYOffset){var f=isNaN(t.labelXOffset)?0:t.labelXOffset,e=isNaN(t.labelYOffset)?0:t.labelYOffset,u=this.getResolution();r.move(f*u,e*u)}this.drawText(n.id,t,r)}else this.removeText(n.id);return i}},calculateFeatureDx:function(n,t){if(this.featureDx=0,t){var i=t.getWidth();this.featureDx=Math.round(((n.left+n.right)/2-(this.extent.left+this.extent.right)/2)/i)*i}},drawGeometry:function(){},drawText:function(){},removeText:function(){},clear:function(){},getFeatureIdFromEvent:function(){},eraseFeatures:function(n){var t,r,i;for(OpenLayers.Util.isArray(n)||(n=[n]),t=0,r=n.length;t<r;++t)i=n[t],this.eraseGeometry(i.geometry,i.id),this.removeText(i.id)},eraseGeometry:function(){},moveRoot:function(){},getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(n){var t=OpenLayers.Util.extend({},OpenLayers.Renderer.defaultSymbolizer);return!1===n.stroke&&(delete t.strokeWidth,delete t.strokeColor),!1===n.fill&&delete t.fillColor,OpenLayers.Util.extend(t,n),t},CLASS_NAME:"OpenLayers.Renderer"}),OpenLayers.Renderer.defaultSymbolizer={fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1,pointRadius:0,labelAlign:"cm"},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.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{hitDetection:!0,hitOverflow:0,canvas:null,features:null,pendingRedraw:!1,cachedSymbolBounds:{},initialize:function(){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.hitDetection&&(this.hitCanvas=document.createElement("canvas"),this.hitContext=this.hitCanvas.getContext("2d"))},setExtent:function(){return OpenLayers.Renderer.prototype.setExtent.apply(this,arguments),!1},eraseGeometry:function(n,t){this.eraseFeatures(this.features[t][0])},supported:function(){return OpenLayers.CANVAS_SUPPORTED},setSize:function(n){this.size=n.clone();var t=this.root;t.style.width=n.w+"px",t.style.height=n.h+"px",t.width=n.w,t.height=n.h,this.resolution=null,this.hitDetection&&(t=this.hitCanvas,t.style.width=n.w+"px",t.style.height=n.h+"px",t.width=n.w,t.height=n.h)},drawFeature:function(n,t){var i,r;return n.geometry&&(t=this.applyDefaultSymbolizer(t||n.style),i=n.geometry.getBounds(),this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(r=this.map.getMaxExtent()),r=i&&i.intersectsBounds(this.extent,{worldBounds:r}),(i="none"!==t.display&&!!i&&r)?this.features[n.id]=[n,t]:delete this.features[n.id],this.pendingRedraw=!0),this.pendingRedraw&&!this.locked&&(this.redraw(),this.pendingRedraw=!1),i},drawGeometry:function(n,t,i){var r=n.CLASS_NAME;if("OpenLayers.Geometry.Collection"==r||"OpenLayers.Geometry.MultiPoint"==r||"OpenLayers.Geometry.MultiLineString"==r||"OpenLayers.Geometry.MultiPolygon"==r)for(r=0;r<n.components.length;r++)this.drawGeometry(n.components[r],t,i);else switch(n.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(n,t,i);break;case"OpenLayers.Geometry.LineString":this.drawLineString(n,t,i);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(n,t,i);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(n,t,i)}},drawExternalGraphic:function(n,t,i){var f=new Image,e=t.title||t.graphicTitle;e&&(f.title=e);var r=t.graphicWidth||t.graphicHeight,u=t.graphicHeight||t.graphicWidth,r=r?r:2*t.pointRadius,u=u?u:2*t.pointRadius,o=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*r),s=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*u),h=t.graphicOpacity||t.fillOpacity;f.onload=OpenLayers.Function.bind(function(){var e;if(this.features[i]){var t=this.getLocalXY(n),c=t[0],t=t[1];if(!isNaN(c)&&!isNaN(t)){var c=c+o|0,t=t+s|0,l=this.canvas;l.globalAlpha=h,e=OpenLayers.Renderer.Canvas.drawImageScaleFactor||(OpenLayers.Renderer.Canvas.drawImageScaleFactor=/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1),l.drawImage(f,c*e,t*e,r*e,u*e),this.hitDetection&&(this.setHitContextStyle("fill",i),this.hitContext.fillRect(c,t,r,u))}}},this),f.src=t.externalGraphic},drawNamedSymbol:function(n,t,i){var r,f,e,o,u;if(e=Math.PI/180,u=OpenLayers.Renderer.symbol[t.graphicName],!u)throw Error(t.graphicName+" is not a valid symbol name");if(!(!u.length||2>u.length||(n=this.getLocalXY(n),f=n[0],o=n[1],isNaN(f)||isNaN(o)))){if(this.canvas.lineCap="round",this.canvas.lineJoin="round",this.hitDetection&&(this.hitContext.lineCap="round",this.hitContext.lineJoin="round"),t.graphicName in this.cachedSymbolBounds)r=this.cachedSymbolBounds[t.graphicName];else{for(r=new OpenLayers.Bounds,n=0;n<u.length;n+=2)r.extend(new OpenLayers.LonLat(u[n],u[n+1]));this.cachedSymbolBounds[t.graphicName]=r}if(this.canvas.save(),this.hitDetection&&this.hitContext.save(),this.canvas.translate(f,o),this.hitDetection&&this.hitContext.translate(f,o),n=e*t.rotation,isNaN(n)||(this.canvas.rotate(n),this.hitDetection&&this.hitContext.rotate(n)),e=2*t.pointRadius/Math.max(r.getWidth(),r.getHeight()),this.canvas.scale(e,e),this.hitDetection&&this.hitContext.scale(e,e),n=r.getCenterLonLat().lon,r=r.getCenterLonLat().lat,this.canvas.translate(-n,-r),this.hitDetection&&this.hitContext.translate(-n,-r),o=t.strokeWidth,t.strokeWidth=o/e,!1!==t.fill){for(this.setCanvasStyle("fill",t),this.canvas.beginPath(),n=0;n<u.length;n+=2)r=u[n],f=u[n+1],0==n&&this.canvas.moveTo(r,f),this.canvas.lineTo(r,f);if(this.canvas.closePath(),this.canvas.fill(),this.hitDetection){for(this.setHitContextStyle("fill",i,t),this.hitContext.beginPath(),n=0;n<u.length;n+=2)r=u[n],f=u[n+1],0==n&&this.canvas.moveTo(r,f),this.hitContext.lineTo(r,f);this.hitContext.closePath(),this.hitContext.fill()}}if(!1!==t.stroke){for(this.setCanvasStyle("stroke",t),this.canvas.beginPath(),n=0;n<u.length;n+=2)r=u[n],f=u[n+1],0==n&&this.canvas.moveTo(r,f),this.canvas.lineTo(r,f);if(this.canvas.closePath(),this.canvas.stroke(),this.hitDetection){for(this.setHitContextStyle("stroke",i,t,e),this.hitContext.beginPath(),n=0;n<u.length;n+=2)r=u[n],f=u[n+1],0==n&&this.hitContext.moveTo(r,f),this.hitContext.lineTo(r,f);this.hitContext.closePath(),this.hitContext.stroke()}}t.strokeWidth=o,this.canvas.restore(),this.hitDetection&&this.hitContext.restore(),this.setCanvasStyle("reset")}},setCanvasStyle:function(n,t){"fill"===n?(this.canvas.globalAlpha=t.fillOpacity,this.canvas.fillStyle=t.fillColor):"stroke"===n?(this.canvas.globalAlpha=t.strokeOpacity,this.canvas.strokeStyle=t.strokeColor,this.canvas.lineWidth=t.strokeWidth):(this.canvas.globalAlpha=0,this.canvas.lineWidth=1)},featureIdToHex:function(n){n=Number(n.split("_").pop())+1,16777216<=n&&(this.hitOverflow=n-16777215,n=n%16777216+1),n="000000"+n.toString(16);var t=n.length;return n="#"+n.substring(t-6,t)},setHitContextStyle:function(n,t,i,r){t=this.featureIdToHex(t),"fill"==n?(this.hitContext.globalAlpha=1,this.hitContext.fillStyle=t):"stroke"==n?(this.hitContext.globalAlpha=1,this.hitContext.strokeStyle=t,"undefined"==typeof r?this.hitContext.lineWidth=i.strokeWidth+2:isNaN(r)||(this.hitContext.lineWidth=i.strokeWidth+2/r)):(this.hitContext.globalAlpha=0,this.hitContext.lineWidth=1)},drawPoint:function(n,t,i){var r,u,f;!1!==t.graphic&&(t.externalGraphic?this.drawExternalGraphic(n,t,i):t.graphicName&&"circle"!=t.graphicName?this.drawNamedSymbol(n,t,i):(r=this.getLocalXY(n),n=r[0],r=r[1],isNaN(n)||isNaN(r)||(u=2*Math.PI,f=t.pointRadius,!1!==t.fill&&(this.setCanvasStyle("fill",t),this.canvas.beginPath(),this.canvas.arc(n,r,f,0,u,!0),this.canvas.fill(),this.hitDetection&&(this.setHitContextStyle("fill",i,t),this.hitContext.beginPath(),this.hitContext.arc(n,r,f,0,u,!0),this.hitContext.fill())),!1!==t.stroke&&(this.setCanvasStyle("stroke",t),this.canvas.beginPath(),this.canvas.arc(n,r,f,0,u,!0),this.canvas.stroke(),this.hitDetection&&(this.setHitContextStyle("stroke",i,t),this.hitContext.beginPath(),this.hitContext.arc(n,r,f,0,u,!0),this.hitContext.stroke()),this.setCanvasStyle("reset")))))},drawLineString:function(n,t,i){t=OpenLayers.Util.applyDefaults({fill:!1},t),this.drawLinearRing(n,t,i)},drawLinearRing:function(n,t,i){!1!==t.fill&&(this.setCanvasStyle("fill",t),this.renderPath(this.canvas,n,t,i,"fill"),this.hitDetection&&(this.setHitContextStyle("fill",i,t),this.renderPath(this.hitContext,n,t,i,"fill"))),!1!==t.stroke&&(this.setCanvasStyle("stroke",t),this.renderPath(this.canvas,n,t,i,"stroke"),this.hitDetection&&(this.setHitContextStyle("stroke",i,t),this.renderPath(this.hitContext,n,t,i,"stroke"))),this.setCanvasStyle("reset")},renderPath:function(n,t,i,r,u){t=t.components,i=t.length,n.beginPath(),r=this.getLocalXY(t[0]);var f=r[1];if(!isNaN(r[0])&&!isNaN(f)){for(n.moveTo(r[0],r[1]),r=1;r<i;++r)f=this.getLocalXY(t[r]),n.lineTo(f[0],f[1]);"fill"===u?n.fill():n.stroke()}},drawPolygon:function(n,t,i){var u,r;for(n=n.components,u=n.length,this.drawLinearRing(n[0],t,i),r=1;r<u;++r)this.canvas.globalCompositeOperation="destination-out",this.hitDetection&&(this.hitContext.globalCompositeOperation="destination-out"),this.drawLinearRing(n[r],OpenLayers.Util.applyDefaults({stroke:!1,fillOpacity:1},t),i),this.canvas.globalCompositeOperation="source-over",this.hitDetection&&(this.hitContext.globalCompositeOperation="source-over"),this.drawLinearRing(n[r],OpenLayers.Util.applyDefaults({fill:!1},t),i)},drawText:function(n,t){var u=this.getLocalXY(n),i,o,s,h;this.setCanvasStyle("reset"),this.canvas.fillStyle=t.fontColor,this.canvas.globalAlpha=t.fontOpacity||1;var r=[t.fontStyle?t.fontStyle:"normal","normal",t.fontWeight?t.fontWeight:"normal",t.fontSize?t.fontSize:"1em",t.fontFamily?t.fontFamily:"sans-serif"].join(" "),f=t.label.split("\n"),e=f.length;if(this.canvas.fillText)for(this.canvas.font=r,this.canvas.textAlign=OpenLayers.Renderer.Canvas.LABEL_ALIGN[t.labelAlign[0]]||"center",this.canvas.textBaseline=OpenLayers.Renderer.Canvas.LABEL_ALIGN[t.labelAlign[1]]||"middle",i=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[1]],null==i&&(i=-.5),r=this.canvas.measureText("Mg").height||this.canvas.measureText("xx").width,u[1]+=r*i*(e-1),i=0;i<e;i++)t.labelOutlineWidth&&(this.canvas.save(),this.canvas.globalAlpha=t.labelOutlineOpacity||t.fontOpacity||1,this.canvas.strokeStyle=t.labelOutlineColor,this.canvas.lineWidth=t.labelOutlineWidth,this.canvas.strokeText(f[i],u[0],u[1]+r*i+1),this.canvas.restore()),this.canvas.fillText(f[i],u[0],u[1]+r*i);else if(this.canvas.mozDrawText)for(this.canvas.mozTextStyle=r,o=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[0]],null==o&&(o=-.5),i=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[1]],null==i&&(i=-.5),r=this.canvas.mozMeasureText("xx"),u[1]+=r*(1+i*e),i=0;i<e;i++)s=u[0]+o*this.canvas.mozMeasureText(f[i]),h=u[1]+i*r,this.canvas.translate(s,h),this.canvas.mozDrawText(f[i]),this.canvas.translate(-s,-h);this.setCanvasStyle("reset")},getLocalXY:function(n){var t=this.getResolution(),i=this.extent;return[(n.x-this.featureDx)/t+-i.left/t,i.top/t-n.y/t]},clear:function(){var n=this.root.height,t=this.root.width;this.canvas.clearRect(0,0,t,n),this.features={},this.hitDetection&&this.hitContext.clearRect(0,0,t,n)},getFeatureIdFromEvent:function(n){var t;if(this.hitDetection&&"none"!==this.root.style.display&&!this.map.dragging&&(n=n.xy,n=this.hitContext.getImageData(n.x|0,n.y|0,1,1).data,255===n[3]&&(n=n[2]+256*(n[1]+256*n[0])))){n="OpenLayers_Feature_Vector_"+(n-1+this.hitOverflow);try{t=this.features[n][0]}catch(i){}}return t},eraseFeatures:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var t=0;t<n.length;++t)delete this.features[n[t].id];this.redraw()},redraw:function(){var n,t,r,u,f,i;if(!this.locked){t=this.root.height,n=this.root.width,this.canvas.clearRect(0,0,n,t),this.hitDetection&&this.hitContext.clearRect(0,0,n,t),t=[],f=this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent();for(i in this.features)this.features.hasOwnProperty(i)&&(n=this.features[i][0],r=n.geometry,this.calculateFeatureDx(r.getBounds(),f),u=this.features[i][1],this.drawGeometry(r,u,n.id),u.label&&t.push([n,u]));for(n=0,r=t.length;n<r;++n)i=t[n],this.drawText(i[0].geometry.getCentroid(),i[1])}},CLASS_NAME:"OpenLayers.Renderer.Canvas"}),OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right",t:"top",b:"bottom"},OpenLayers.Renderer.Canvas.LABEL_FACTOR={l:0,r:-1,t:0,b:-1},OpenLayers.Renderer.Canvas.drawImageScaleFactor=null,OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:!1,interestingTagsExclude:null,areaTags:null,initialize:function(n){var t={interestingTagsExclude:"source source_ref source:ref history attribution created_by".split(" "),areaTags:"area building leisure tourism ruins historic landuse military natural sport".split(" ")},t=OpenLayers.Util.extend(t,n),i={};for(n=0;n<t.interestingTagsExclude.length;n++)i[t.interestingTagsExclude[n]]=!0;for(t.interestingTagsExclude=i,i={},n=0;n<t.areaTags.length;n++)i[t.areaTags[n]]=!0;t.areaTags=i,this.externalProjection=new OpenLayers.Projection("EPSG:4326"),OpenLayers.Format.XML.prototype.initialize.apply(this,[t])},read:function(n){var e,t,u,i,o,s;for("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),e=this.getNodes(n),t=this.getWays(n),n=Array(t.length),u=0;u<t.length;u++){for(var r=Array(t[u].nodes.length),h=this.isWayArea(t[u])?1:0,f=0;f<t[u].nodes.length;f++)i=e[t[u].nodes[f]],o=new OpenLayers.Geometry.Point(i.lon,i.lat),o.osm_id=parseInt(t[u].nodes[f]),r[f]=o,i.used=!0;i=null,i=h?new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(r)):new OpenLayers.Geometry.LineString(r),this.internalProjection&&this.externalProjection&&i.transform(this.externalProjection,this.internalProjection),r=new OpenLayers.Feature.Vector(i,t[u].tags),r.osm_id=parseInt(t[u].id),r.fid="way."+r.osm_id,n[u]=r}for(s in e){if(i=e[s],!i.used||this.checkTags){if(t=null,this.checkTags){if(t=this.getTags(i.node,!0),i.used&&!t[1])continue;t=t[0]}else t=this.getTags(i.node);r=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(i.lon,i.lat),t),this.internalProjection&&this.externalProjection&&r.geometry.transform(this.externalProjection,this.internalProjection),r.osm_id=parseInt(s),r.fid="node."+r.osm_id,n.push(r)}i.node=null}return n},getNodes:function(n){var r,i,t,u;for(n=n.getElementsByTagName("node"),r={},i=0;i<n.length;i++)t=n[i],u=t.getAttribute("id"),r[u]={lat:t.getAttribute("lat"),lon:t.getAttribute("lon"),node:t};return r},getWays:function(n){var f,u,t,i,r;for(n=n.getElementsByTagName("way"),f=[],u=0;u<n.length;u++){for(t=n[u],i={id:t.getAttribute("id")},i.tags=this.getTags(t),t=t.getElementsByTagName("nd"),i.nodes=Array(t.length),r=0;r<t.length;r++)i.nodes[r]=t[r].getAttribute("ref");f.push(i)}return f},getTags:function(n,t){for(var f,r=n.getElementsByTagName("tag"),u={},e=!1,i=0;i<r.length;i++)f=r[i].getAttribute("k"),u[f]=r[i].getAttribute("v"),t&&(this.interestingTagsExclude[f]||(e=!0));return t?[u,e]:u},isWayArea:function(n){var t=!1,i=!1,r;if(n.nodes[0]==n.nodes[n.nodes.length-1]&&(t=!0),this.checkTags)for(r in n.tags)if(this.areaTags[r]){i=!0;break}return t&&(this.checkTags?i:!0)},write:function(n){var t,i,u,r;for(OpenLayers.Util.isArray(n)||(n=[n]),this.osm_id=1,this.created_nodes={},t=this.createElementNS(null,"osm"),t.setAttribute("version","0.5"),t.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER),i=n.length-1;0<=i;i--)for(u=this.createFeatureNodes(n[i]),r=0;r<u.length;r++)t.appendChild(u[r]);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureNodes:function(n){var i=[],t=n.geometry.CLASS_NAME,t=t.substring(t.lastIndexOf(".")+1),t=t.toLowerCase();return(t=this.createXML[t])&&(i=t.apply(this,[n])),i},createXML:{point:function(n){var i=null,r=n.geometry?n.geometry:n,u,t;return this.internalProjection&&this.externalProjection&&(r=r.clone(),r.transform(this.internalProjection,this.externalProjection)),u=!1,n.osm_id?(i=n.osm_id,this.created_nodes[i]&&(u=!0)):(i=-this.osm_id,this.osm_id++),t=u?this.created_nodes[i]:this.createElementNS(null,"node"),this.created_nodes[i]=t,t.setAttribute("id",i),t.setAttribute("lon",r.x),t.setAttribute("lat",r.y),n.attributes&&this.serializeTags(n,t),this.setState(n,t),u?[]:[t]},linestring:function(n){var i,f=[],e=n.geometry,r,t,u;for(n.osm_id?i=n.osm_id:(i=-this.osm_id,this.osm_id++),r=this.createElementNS(null,"way"),r.setAttribute("id",i),i=0;i<e.components.length;i++)t=this.createXML.point.apply(this,[e.components[i]]),t.length?(t=t[0],u=t.getAttribute("id"),f.push(t)):(u=e.components[i].osm_id,t=this.created_nodes[u]),this.setState(n,t),t=this.createElementNS(null,"nd"),t.setAttribute("ref",u),r.appendChild(t);return this.serializeTags(n,r),f.push(r),f},polygon:function(n){var t=OpenLayers.Util.extend({area:"yes"},n.attributes),t=new OpenLayers.Feature.Vector(n.geometry.components[0],t);return t.osm_id=n.osm_id,this.createXML.linestring.apply(this,[t])}},serializeTags:function(n,t){var r,i;for(r in n.attributes)i=this.createElementNS(null,"tag"),i.setAttribute("k",r),i.setAttribute("v",n.attributes[r]),t.appendChild(i)},setState:function(n,t){if(n.state){var i=null;switch(n.state){case OpenLayers.State.UPDATE:case OpenLayers.State.DELETE:i="delete"}i&&t.setAttribute("action",i)}},CLASS_NAME:"OpenLayers.Format.OSM"}),OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,observeElement:null,initialize:function(){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)){this.observeElement=this.observeElement||document;for(var n=0,t=this.KEY_EVENTS.length;n<t;n++)OpenLayers.Event.observe(this.observeElement,this.KEY_EVENTS[n],this.eventListener);return!0}return!1},deactivate:function(){var n=!1,t;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(n=0,t=this.KEY_EVENTS.length;n<t;n++)OpenLayers.Event.stopObserving(this.observeElement,this.KEY_EVENTS[n],this.eventListener);n=!0}return n},handleKeyEvent:function(n){this.checkModifiers(n)&&this.callback(n.type,[n])},CLASS_NAME:"OpenLayers.Handler.Keyboard"}),OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{documentDrag:!1,geometryTypes:null,clickout:!0,toggle:!0,standalone:!1,layer:null,feature:null,vertex:null,vertices:null,virtualVertices:null,handlers:null,deleteCodes:null,virtualStyle:null,vertexRenderIntent:null,mode:null,createVertices:!0,modified:!1,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(n,t){t=t||{},this.layer=n,this.vertices=[],this.virtualVertices=[],this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer(null,t.vertexRenderIntent)),this.virtualStyle.fillOpacity=.3,this.virtualStyle.strokeOpacity=.3,this.deleteCodes=[46,68],this.mode=OpenLayers.Control.ModifyFeature.RESHAPE,OpenLayers.Control.prototype.initialize.apply(this,[t]),OpenLayers.Util.isArray(this.deleteCodes)||(this.deleteCodes=[this.deleteCodes]);var i={documentDrag:this.documentDrag,stopDown:!1};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,{keydown:this.handleKeypress}),drag:new OpenLayers.Handler.Drag(this,{down:function(n){this.vertex=null,(n=this.layer.getFeatureFromEvent(this.handlers.drag.evt))?this.dragStart(n):this.clickout&&(this._unselect=this.feature)},move:function(n){delete this._unselect,this.vertex&&this.dragVertex(this.vertex,n)},up:function(){this.handlers.drag.stopDown=!1,this._unselect&&(this.unselectFeature(this._unselect),delete this._unselect)},done:function(){this.vertex&&this.dragComplete(this.vertex)}},i)}},destroy:function(){this.map&&this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),this.layer=null,OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});return this.handlers.keyboard.activate()&&this.handlers.drag.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){var n=!1;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.moveLayerBack(),this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),this.layer.removeFeatures(this.vertices,{silent:!0}),this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.vertices=[],this.handlers.drag.deactivate(),this.handlers.keyboard.deactivate(),(n=this.feature)&&n.geometry&&n.layer&&this.unselectFeature(n),n=!0),n},beforeSelectFeature:function(n){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:n})},selectFeature:function(n){if(!(this.feature===n||this.geometryTypes&&-1==OpenLayers.Util.indexOf(this.geometryTypes,n.geometry.CLASS_NAME))){!1!==this.beforeSelectFeature(n)&&(this.feature&&this.unselectFeature(this.feature),this.feature=n,this.layer.selectedFeatures.push(n),this.layer.drawFeature(n,"select"),this.modified=!1,this.resetVertices(),this.onModificationStart(this.feature));var t=n.modified;!n.geometry||t&&t.geometry||(this._originalGeometry=n.geometry.clone())}},unselectFeature:function(n){this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[],this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),delete this.dragHandle),this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),delete this.radiusHandle),this.layer.drawFeature(this.feature,"default"),this.feature=null,OpenLayers.Util.removeItem(this.layer.selectedFeatures,n);this.onModificationEnd(n);this.layer.events.triggerEvent("afterfeaturemodified",{feature:n,modified:this.modified}),this.modified=!1},dragStart:function(n){var t="OpenLayers.Geometry.Point"==n.geometry.CLASS_NAME;this.standalone||(n._sketch||!t)&&n._sketch||(this.toggle&&this.feature===n&&(this._unselect=n),this.selectFeature(n)),(n._sketch||t)&&(this.vertex=n,this.handlers.drag.stopDown=!0)},dragVertex:function(n,t){var r=this.map.getLonLatFromViewPortPx(t),i=n.geometry;i.move(r.lon-i.x,r.lat-i.y),this.modified=!0,"OpenLayers.Geometry.Point"==this.feature.geometry.CLASS_NAME?this.layer.events.triggerEvent("vertexmodified",{vertex:n.geometry,feature:this.feature,pixel:t}):(n._index?(n.geometry.parent.addComponent(n.geometry,n._index),delete n._index,OpenLayers.Util.removeItem(this.virtualVertices,n),this.vertices.push(n)):n==this.dragHandle?(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null)):n!==this.radiusHandle&&this.layer.events.triggerEvent("vertexmodified",{vertex:n.geometry,feature:this.feature,pixel:t}),0<this.virtualVertices.length&&(this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.layer.drawFeature(this.feature,this.standalone?void 0:"select")),this.layer.drawFeature(n)},dragComplete:function(){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,this.modified&&this._originalGeometry)){var n=this.feature;n.modified=OpenLayers.Util.extend(n.modified,{geometry:this._originalGeometry}),delete this._originalGeometry}},resetVertices:function(){0<this.vertices.length&&(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[]),0<this.virtualVertices.length&&(this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),this.dragHandle=null),this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null),this.feature&&"OpenLayers.Geometry.Point"!=this.feature.geometry.CLASS_NAME&&(this.mode&OpenLayers.Control.ModifyFeature.DRAG&&this.collectDragHandle(),this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE)&&this.collectRadiusHandle(),this.mode&OpenLayers.Control.ModifyFeature.RESHAPE&&(this.mode&OpenLayers.Control.ModifyFeature.RESIZE||this.collectVertices()))},handleKeypress:function(n){var t=n.keyCode;this.feature&&-1!=OpenLayers.Util.indexOf(this.deleteCodes,t)&&(t=this.layer.getFeatureFromEvent(this.handlers.drag.evt))&&-1!=OpenLayers.Util.indexOf(this.vertices,t)&&!this.handlers.drag.dragging&&t.geometry.parent&&(t.geometry.parent.removeComponent(t.geometry),this.layer.events.triggerEvent("vertexremoved",{vertex:t.geometry,feature:this.feature,pixel:n.xy}),this.layer.drawFeature(this.feature,this.standalone?void 0:"select"),this.modified=!0,this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent("featuremodified",{feature:this.feature}))},collectVertices:function(){function t(i){var u,r,f,e;if("OpenLayers.Geometry.Point"==i.CLASS_NAME)r=new OpenLayers.Feature.Vector(i),r._sketch=!0,r.renderIntent=n.vertexRenderIntent,n.vertices.push(r);else{for(f=i.components.length,"OpenLayers.Geometry.LinearRing"==i.CLASS_NAME&&(f-=1),u=0;u<f;++u)r=i.components[u],"OpenLayers.Geometry.Point"==r.CLASS_NAME?(r=new OpenLayers.Feature.Vector(r),r._sketch=!0,r.renderIntent=n.vertexRenderIntent,n.vertices.push(r)):t(r);if(n.createVertices&&"OpenLayers.Geometry.MultiPoint"!=i.CLASS_NAME)for(u=0,f=i.components.length;u<f-1;++u)r=i.components[u],e=i.components[u+1],"OpenLayers.Geometry.Point"==r.CLASS_NAME&&"OpenLayers.Geometry.Point"==e.CLASS_NAME&&(r=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point((r.x+e.x)/2,(r.y+e.y)/2),null,n.virtualStyle),r.geometry.parent=i,r._index=u+1,r._sketch=!0,n.virtualVertices.push(r))}}this.vertices=[],this.virtualVertices=[];var n=this;t.call(this,this.feature.geometry),this.layer.addFeatures(this.virtualVertices,{silent:!0}),this.layer.addFeatures(this.vertices,{silent:!0})},collectDragHandle:function(){var t=this.feature.geometry,n=t.getBounds().getCenterLonLat(),n=new OpenLayers.Geometry.Point(n.lon,n.lat),i=new OpenLayers.Feature.Vector(n);n.move=function(n,i){OpenLayers.Geometry.Point.prototype.move.call(this,n,i),t.move(n,i)},i._sketch=!0,this.dragHandle=i,this.dragHandle.renderIntent=this.vertexRenderIntent,this.layer.addFeatures([this.dragHandle],{silent:!0})},collectRadiusHandle:function(){var r=this.feature.geometry,n=r.getBounds(),i=n.getCenterLonLat(),t=new OpenLayers.Geometry.Point(i.lon,i.lat),n=new OpenLayers.Geometry.Point(n.right,n.bottom),i=new OpenLayers.Feature.Vector(n),u=this.mode&OpenLayers.Control.ModifyFeature.RESIZE,f=this.mode&OpenLayers.Control.ModifyFeature.RESHAPE,e=this.mode&OpenLayers.Control.ModifyFeature.ROTATE;n.move=function(n,i){var a;OpenLayers.Geometry.Point.prototype.move.call(this,n,i);var h=this.x-t.x,o=this.y-t.y,s=h-n,c=o-i;if(e){var l=Math.atan2(c,s),l=Math.atan2(o,h)-l,l=180/Math.PI*l;r.rotate(l,t)}u&&(f?(o/=c,a=h/s/o):(s=Math.sqrt(s*s+c*c),o=Math.sqrt(h*h+o*o)/s),r.resize(o,t,a))},i._sketch=!0,this.radiusHandle=i,this.radiusHandle.renderIntent=this.vertexRenderIntent,this.layer.addFeatures([this.radiusHandle],{silent:!0})},setMap:function(n){this.handlers.drag.setMap(n),OpenLayers.Control.prototype.setMap.apply(this,arguments)},handleMapEvents:function(n){"removelayer"!=n.type&&"order"!=n.property||this.moveLayerToTop()},moveLayerToTop:function(){var n=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(n)},moveLayerBack:function(){var n=this.layer.getZIndex()-1;n>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(n):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},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.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,sphericalMercator:!1,zoomOffset:0,serverResolutions:null,initialize:function(n,t,i){(i&&i.sphericalMercator||this.sphericalMercator)&&(i=OpenLayers.Util.extend({projection:"EPSG:900913",numZoomLevels:19},i)),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n||this.name,t||this.url,{},i])},clone:function(n){return null==n&&(n=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){n=this.getXYZ(n);var t=this.url;return OpenLayers.Util.isArray(t)&&(t=this.selectUrl(""+n.x+n.y+n.z,t)),OpenLayers.String.format(t,n)},getXYZ:function(n){var t=this.getServerResolution(),r=Math.round((n.left-this.maxExtent.left)/(t*this.tileSize.w)),i;return n=Math.round((this.maxExtent.top-n.top)/(t*this.tileSize.h)),t=this.getServerZoom(),this.wrapDateLine&&(i=Math.pow(2,t),r=(r%i+i)%i),{x:r,y:n,z:t}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.XYZ"}),OpenLayers.Layer.Bing=OpenLayers.Class(OpenLayers.Layer.XYZ,{key:null,serverResolutions:[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.9396191406249,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.49622619628906,305.74811309814453,152.87405654907226,76.437028274536132,38.218514137268066,19.109257068634033,9.5546285343170165,4.7773142671585083,2.3886571335792541,1.1943285667896271,.59716428339481353,.29858214169740677,.14929107084870338,.074645535424351692],attributionTemplate:'<span class="olBingAttribution ${type}"><div><a target="_blank" href="http://www.bing.com/maps/"><img src="${logo}" /><\/a><\/div>${copyrights}<a style="white-space: nowrap" target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use<\/a><\/span>',metadata:null,protocolRegex:/^http:/i,type:"Road",culture:"en-US",metadataParams:null,tileOptions:null,protocol:~window.location.href.indexOf("http")?"":"http:",initialize:function(n){n=OpenLayers.Util.applyDefaults({sphericalMercator:!0},n),OpenLayers.Layer.XYZ.prototype.initialize.apply(this,[n.name||"Bing "+(n.type||this.type),null,n]),this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options.tileOptions),this.loadMetadata()},loadMetadata:function(){this._callbackId="_callback_"+this.id.replace(/\./g,"_"),window[this._callbackId]=OpenLayers.Function.bind(OpenLayers.Layer.Bing.processMetadata,this);var t=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams),t=this.protocol+"//dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(t),n=document.createElement("script");n.type="text/javascript",n.src=t,n.id=this._callbackId,document.getElementsByTagName("head")[0].appendChild(n)},initLayer:function(){var n=this.metadata.resourceSets[0].resources[0],i=n.imageUrl.replace("{quadkey}","${quadkey}"),i=i.replace("{culture}",this.culture),i=i.replace(this.protocolRegex,this.protocol),t;for(this.url=[],t=0;t<n.imageUrlSubdomains.length;++t)this.url.push(i.replace("{subdomain}",n.imageUrlSubdomains[t]));this.addOptions({maxResolution:Math.min(this.serverResolutions[n.zoomMin],this.maxResolution||Number.POSITIVE_INFINITY),numZoomLevels:Math.min(n.zoomMax+1-n.zoomMin,this.numZoomLevels)},!0),this.isBaseLayer||this.redraw(),this.updateAttribution()},getURL:function(n){var t,i,f;if(this.url){t=this.getXYZ(n),n=t.x;for(var e=t.y,t=t.z,r=[],u=t;0<u;--u)i="0",f=1<<u-1,0!=(n&f)&&i++,0!=(e&f)&&(i++,i++),r.push(i);return r=r.join(""),n=this.selectUrl(""+n+e+t,this.url),OpenLayers.String.format(n,{quadkey:r})}},updateAttribution:function(){var n=this.metadata;if(n.resourceSets&&this.map&&this.map.center){for(var f=n.resourceSets[0].resources[0],l=this.map.getExtent().transform(this.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326")),e=f.imageryProviders||[],o=OpenLayers.Util.indexOf(this.serverResolutions,this.getServerResolution()),f="",t,i,s,h,r,u=0,c=e.length;u<c;++u)for(t=e[u],i=0,s=t.coverageAreas.length;i<s;++i)r=t.coverageAreas[i],h=OpenLayers.Bounds.fromArray(r.bbox,!0),l.intersectsBounds(h)&&o<=r.zoomMax&&o>=r.zoomMin&&(f+=t.attribution+" ");n=n.brandLogoUri.replace(this.protocolRegex,this.protocol),this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(),logo:n,copyrights:f}),this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"attribution"})}},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments),this.map.events.register("moveend",this,this.updateAttribution)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Bing(this.options)),n=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[n])},destroy:function(){this.map&&this.map.events.unregister("moveend",this,this.updateAttribution),OpenLayers.Layer.XYZ.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.Bing"}),OpenLayers.Layer.Bing.processMetadata=function(n){this.metadata=n,this.initLayer(),n=document.getElementById(this._callbackId),n.parentNode.removeChild(n),window[this._callbackId]=void 0,delete this._callbackId},OpenLayers.Format.SOSGetFeatureOfInterest=OpenLayers.Class(OpenLayers.Format.XML,{VERSION:"1.0.0",namespaces:{sos:"http://www.opengis.net/sos/1.0",gml:"http://www.opengis.net/gml",sa:"http://www.opengis.net/sampling/1.0",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosAll.xsd",defaultPrefix:"sos",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(n){var i,r,u,t;for("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement),i={features:[]},this.readNode(n,i),n=[],r=0,u=i.features.length;r<u;r++)t=i.features[r],this.internalProjection&&this.externalProjection&&t.components[0]&&t.components[0].transform(this.externalProjection,this.internalProjection),t=new OpenLayers.Feature.Vector(t.components[0],t.attributes),n.push(t);return n},readers:{sa:{SamplingPoint:function(n,t){if(!t.attributes){var i={attributes:{}};t.features.push(i),t=i}t.attributes.id=this.getAttributeNS(n,this.namespaces.gml,"id"),this.readChildNodes(n,t)},position:function(n,t){this.readChildNodes(n,t)}},gml:OpenLayers.Util.applyDefaults({FeatureCollection:function(n,t){this.readChildNodes(n,t)},featureMember:function(n,t){var i={attributes:{}};t.features.push(i),this.readChildNodes(n,i)},name:function(n,t){t.attributes.name=this.getChildValue(n)},pos:function(n,t){this.externalProjection||(this.externalProjection=new OpenLayers.Projection(n.getAttribute("srsName"))),OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[n,t])}},OpenLayers.Format.GML.v3.prototype.readers.gml)},writers:{sos:{GetFeatureOfInterest:function(n){for(var i=this.createElementNSPlus("GetFeatureOfInterest",{attributes:{version:this.VERSION,service:"SOS","xsi:schemaLocation":this.schemaLocation}}),t=0,r=n.fois.length;t<r;t++)this.writeNode("FeatureOfInterestId",{foi:n.fois[t]},i);return i},FeatureOfInterestId:function(n){return this.createElementNSPlus("FeatureOfInterestId",{value:n.foi})}}},CLASS_NAME:"OpenLayers.Format.SOSGetFeatureOfInterest"}),OpenLayers.Format.SOSGetObservation=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows",gml:"http://www.opengis.net/gml",sos:"http://www.opengis.net/sos/1.0",ogc:"http://www.opengis.net/ogc",om:"http://www.opengis.net/om/1.0",sa:"http://www.opengis.net/sampling/1.0",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd",defaultPrefix:"sos",read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={measurements:[],observations:[]};return this.readNode(n,t),t},write:function(n){return n=this.writeNode("sos:GetObservation",n),n.setAttribute("xmlns:om",this.namespaces.om),n.setAttribute("xmlns:ogc",this.namespaces.ogc),this.setAttributeNS(n,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[n])},readers:{om:{ObservationCollection:function(n,t){t.id=this.getAttributeNS(n,this.namespaces.gml,"id"),this.readChildNodes(n,t)},member:function(n,t){this.readChildNodes(n,t)},Measurement:function(n,t){var i={};t.measurements.push(i),this.readChildNodes(n,i)},Observation:function(n,t){var i={};t.observations.push(i),this.readChildNodes(n,i)},samplingTime:function(n,t){var i={};t.samplingTime=i,this.readChildNodes(n,i)},observedProperty:function(n,t){t.observedProperty=this.getAttributeNS(n,this.namespaces.xlink,"href"),this.readChildNodes(n,t)},procedure:function(n,t){t.procedure=this.getAttributeNS(n,this.namespaces.xlink,"href"),this.readChildNodes(n,t)},featureOfInterest:function(n,t){var i={features:[]},u;t.fois=[],t.fois.push(i),this.readChildNodes(n,i);for(var f=[],r=0,e=i.features.length;r<e;r++)u=i.features[r],f.push(new OpenLayers.Feature.Vector(u.components[0],u.attributes));i.features=f},result:function(n,t){var i={};t.result=i,""!==this.getChildValue(n)?(i.value=this.getChildValue(n),i.uom=n.getAttribute("uom")):this.readChildNodes(n,i)}},sa:OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.sa,gml:OpenLayers.Util.applyDefaults({TimeInstant:function(n,t){var i={};t.timeInstant=i,this.readChildNodes(n,i)},timePosition:function(n,t){t.timePosition=this.getChildValue(n)}},OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.gml)},writers:{sos:{GetObservation:function(n){var t=this.createElementNSPlus("GetObservation",{attributes:{version:this.VERSION,service:"SOS"}}),i,r;this.writeNode("offering",n,t),n.eventTime&&this.writeNode("eventTime",n,t);for(i in n.procedures)this.writeNode("procedure",n.procedures[i],t);for(r in n.observedProperties)this.writeNode("observedProperty",n.observedProperties[r],t);return n.foi&&this.writeNode("featureOfInterest",n.foi,t),this.writeNode("responseFormat",n,t),n.resultModel&&this.writeNode("resultModel",n,t),n.responseMode&&this.writeNode("responseMode",n,t),t},featureOfInterest:function(n){var t=this.createElementNSPlus("featureOfInterest");return this.writeNode("ObjectID",n.objectId,t),t},ObjectID:function(n){return this.createElementNSPlus("ObjectID",{value:n})},responseFormat:function(n){return this.createElementNSPlus("responseFormat",{value:n.responseFormat})},procedure:function(n){return this.createElementNSPlus("procedure",{value:n})},offering:function(n){return this.createElementNSPlus("offering",{value:n.offering})},observedProperty:function(n){return this.createElementNSPlus("observedProperty",{value:n})},eventTime:function(n){var t=this.createElementNSPlus("eventTime");return"latest"===n.eventTime&&this.writeNode("ogc:TM_Equals",n,t),t},resultModel:function(n){return this.createElementNSPlus("resultModel",{value:n.resultModel})},responseMode:function(n){return this.createElementNSPlus("responseMode",{value:n.responseMode})}},ogc:{TM_Equals:function(n){var t=this.createElementNSPlus("ogc:TM_Equals");return this.writeNode("ogc:PropertyName",{property:"urn:ogc:data:time:iso8601"},t),"latest"===n.eventTime&&this.writeNode("gml:TimeInstant",{value:"latest"},t),t},PropertyName:function(n){return this.createElementNSPlus("ogc:PropertyName",{value:n.property})}},gml:{TimeInstant:function(n){var t=this.createElementNSPlus("gml:TimeInstant");return this.writeNode("gml:timePosition",n,t),t},timePosition:function(n){return this.createElementNSPlus("gml:timePosition",{value:n.value})}}},CLASS_NAME:"OpenLayers.Format.SOSGetObservation"}),OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,interval:0,maxDelta:Number.POSITIVE_INFINITY,delta:0,cumulative:!0,initialize:function(){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(n){var f,t,r,o,e,s;if(this.map&&this.checkModifiers(n)){for(var t=!1,u=!1,r=!1,i=OpenLayers.Event.element(n);null!=i&&!r&&!t;){if(!t)try{t=(f=i.currentStyle?i.currentStyle.overflow:document.defaultView.getComputedStyle(i,null).getPropertyValue("overflow"))&&"auto"==f||"scroll"==f}catch(h){}if(!u&&(u=OpenLayers.Element.hasClass(i,"olScrollable"),!u))for(r=0,o=this.map.layers.length;r<o;r++)if(e=this.map.layers[r],i==e.div||i==e.pane){u=!0;break}r=i==this.map.div,i=i.parentNode}!t&&r&&(u&&((t=0,n.wheelDelta?(t=n.wheelDelta,0==t%160&&(t*=.75),t/=120):n.detail&&(t=-(n.detail/Math.abs(n.detail))),this.delta+=t,window.clearTimeout(this._timeoutId),this.interval&&Math.abs(this.delta)<this.maxDelta)?(s=OpenLayers.Util.extend({},n),this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(s)},this),this.interval)):this.wheelZoom(n)),OpenLayers.Event.stop(n))}},wheelZoom:function(n){var t=this.delta;this.delta=0,t&&(n.xy=this.map.events.getMousePosition(n),0>t?this.callback("down",[n,this.cumulative?Math.max(-this.maxDelta,t):-1]):this.callback("up",[n,this.cumulative?Math.min(this.maxDelta,t):1]))},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var t=this.wheelListener;return OpenLayers.Event.observe(window,"DOMMouseScroll",t),OpenLayers.Event.observe(window,"mousewheel",t),OpenLayers.Event.observe(document,"mousewheel",t),!0}return!1},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var t=this.wheelListener;return OpenLayers.Event.stopObserving(window,"DOMMouseScroll",t),OpenLayers.Event.stopObserving(window,"mousewheel",t),OpenLayers.Event.stopObserving(document,"mousewheel",t),!0}return!1},CLASS_NAME:"OpenLayers.Handler.MouseWheel"}),OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:"1.0.0",srsNameInQuery:!1,schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"},initialize:function(n){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[n]),OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[n])},readNode:function(){return OpenLayers.Format.GML.v2.prototype.readNode.apply(this,arguments)},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(n,t){t.insertIds=[],t.success=!1,this.readChildNodes(n,t)},InsertResult:function(n,t){var i={fids:[]};this.readChildNodes(n,i),t.insertIds=t.insertIds.concat(i.fids)},TransactionResult:function(n,t){this.readChildNodes(n,t)},Status:function(n,t){this.readChildNodes(n,t)},SUCCESS:function(n,t){t.success=!0}},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(n){var i,t,r;if(n=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName,srsNameInQuery:this.srsNameInQuery},n),t=n.featurePrefix,i=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(t?t+":":"")+n.featureType}}),n.srsNameInQuery&&n.srsName&&i.setAttribute("srsName",n.srsName),n.featureNS&&i.setAttribute("xmlns:"+t,n.featureNS),n.propertyNames)for(t=0,r=n.propertyNames.length;t<r;t++)this.writeNode("ogc:PropertyName",{property:n.propertyNames[t]},i);return n.filter&&(this.setFilterProperty(n.filter),this.writeNode("ogc:Filter",n.filter,i)),i}},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.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(n){this.compare=n?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER,this.clear()},insert:function(n){var u,i,t,r;for(this.exists(n)&&this.remove(n),u=n.id,this.determineZIndex(n),i=-1,t=this.order.length;1<t-i;)r=parseInt((i+t)/2),0<this.compare(this,n,OpenLayers.Util.getElement(this.order[r]))?i=r:t=r;return this.order.splice(t,0,u),this.indices[u]=this.getZIndex(n),this.getNextElement(t)},remove:function(n){n=n.id;var t=OpenLayers.Util.indexOf(this.order,n);0<=t&&(this.order.splice(t,1),delete this.indices[n],this.maxZIndex=0<this.order.length?this.indices[this.order[this.order.length-1]]:0)},clear:function(){this.order=[],this.indices={},this.maxZIndex=0},exists:function(n){return null!=this.indices[n.id]},getZIndex:function(n){return n._style.graphicZIndex},determineZIndex:function(n){var t=n._style.graphicZIndex;null==t?(t=this.maxZIndex,n._style.graphicZIndex=t):t>this.maxZIndex&&(this.maxZIndex=t)},getNextElement:function(n){if(n+=1,n<this.order.length){var t=OpenLayers.Util.getElement(this.order[n]);return void 0==t&&(t=this.getNextElement(n)),t}return null},CLASS_NAME:"OpenLayers.ElementsIndexer"}),OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(n,t,i){t=n.getZIndex(t);var r=0;return i&&(n=n.getZIndex(i),r=t-n),r},Z_ORDER_DRAWING_ORDER:function(n,t,i){return n=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(n,t,i),i&&0==n&&(n=1),n},Z_ORDER_Y_ORDER:function(n,t,i){return n=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(n,t,i),i&&0===n&&(t=i._boundsBottom-t._boundsBottom,n=0===t?1:t),n}},OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,xOffset:0,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",LABEL_OUTLINE_SUFFIX:"_outline",initialize:function(n,t){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),t&&(t.zIndexing||t.yOrdering)&&(this.indexer=new OpenLayers.ElementsIndexer(t.yOrdering))},destroy:function(){this.clear(),this.xmlns=this.root=this.rendererRoot=null,OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var t,n=this.vectorRoot;if(n)for(;t=n.firstChild;)n.removeChild(t);if(n=this.textRoot)for(;t=n.firstChild;)n.removeChild(t);this.indexer&&this.indexer.clear()},setExtent:function(n,t){var u=OpenLayers.Renderer.prototype.setExtent.apply(this,arguments),f=this.getResolution(),r,i;return this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(i=n.getWidth()/this.map.getExtent().getWidth(),n=n.scale(1/i),i=this.map.getMaxExtent(),i.right>n.left&&i.right<n.right?r=!0:i.left>n.left&&i.left<n.right&&(r=!1),(r!==this.rightOfDateLine||t)&&(u=!1,this.xOffset=!0===r?i.getWidth()/f:0),this.rightOfDateLine=r),u},getNodeType:function(){},drawGeometry:function(n,t,i){var r=n.CLASS_NAME,u=!0,f;if("OpenLayers.Geometry.Collection"==r||"OpenLayers.Geometry.MultiPoint"==r||"OpenLayers.Geometry.MultiLineString"==r||"OpenLayers.Geometry.MultiPolygon"==r){for(r=0,f=n.components.length;r<f;r++)u=this.drawGeometry(n.components[r],t,i)&&u;return u}return r=u=!1,"none"!=t.display&&(t.backgroundGraphic?this.redrawBackgroundNode(n.id,n,t,i):r=!0,u=this.redrawNode(n.id,n,t,i)),!1==u&&(t=document.getElementById(n.id))&&(t._style.backgroundGraphic&&(r=!0),t.parentNode.removeChild(t)),r&&(t=document.getElementById(n.id+this.BACKGROUND_ID_SUFFIX))&&t.parentNode.removeChild(t),u},redrawNode:function(n,t,i,r){return(i=this.applyDefaultSymbolizer(i),n=this.nodeFactory(n,this.getNodeType(t,i)),n._featureId=r,n._boundsBottom=t.getBounds().bottom,n._geometryClass=t.CLASS_NAME,n._style=i,t=this.drawGeometryNode(n,t,i),!1===t)?!1:(n=t.node,this.indexer?(i=this.indexer.insert(n))?this.vectorRoot.insertBefore(n,i):this.vectorRoot.appendChild(n):n.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(n),this.postDraw(n),t.complete)},redrawBackgroundNode:function(n,t,i){return i=OpenLayers.Util.extend({},i),i.externalGraphic=i.backgroundGraphic,i.graphicXOffset=i.backgroundXOffset,i.graphicYOffset=i.backgroundYOffset,i.graphicZIndex=i.backgroundGraphicZIndex,i.graphicWidth=i.backgroundWidth||i.graphicWidth,i.graphicHeight=i.backgroundHeight||i.graphicHeight,i.backgroundGraphic=null,i.backgroundXOffset=null,i.backgroundYOffset=null,i.backgroundGraphicZIndex=null,this.redrawNode(n+this.BACKGROUND_ID_SUFFIX,t,i,null)},drawGeometryNode:function(n,t,i){i=i||n._style;var u={isFilled:void 0===i.fill?!0:i.fill,isStroked:void 0===i.stroke?!!i.strokeWidth:i.stroke},r;switch(t.CLASS_NAME){case"OpenLayers.Geometry.Point":!1===i.graphic&&(u.isFilled=!1,u.isStroked=!1),r=this.drawPoint(n,t);break;case"OpenLayers.Geometry.LineString":u.isFilled=!1,r=this.drawLineString(n,t);break;case"OpenLayers.Geometry.LinearRing":r=this.drawLinearRing(n,t);break;case"OpenLayers.Geometry.Polygon":r=this.drawPolygon(n,t);break;case"OpenLayers.Geometry.Rectangle":r=this.drawRectangle(n,t)}return n._options=u,!1!=r?{node:this.setStyle(n,i,u,t),complete:r}:!1},postDraw:function(){},drawPoint:function(){},drawLineString:function(){},drawLinearRing:function(){},drawPolygon:function(){},drawRectangle:function(){},drawCircle:function(){},removeText:function(n){var t=document.getElementById(n+this.LABEL_ID_SUFFIX);t&&this.textRoot.removeChild(t),(n=document.getElementById(n+this.LABEL_OUTLINE_SUFFIX))&&this.textRoot.removeChild(n)},getFeatureIdFromEvent:function(n){var t=n.target,i=t&&t.correspondingUseElement;return(i?i:t||n.srcElement)._featureId},eraseGeometry:function(n,t){if("OpenLayers.Geometry.MultiPoint"==n.CLASS_NAME||"OpenLayers.Geometry.MultiLineString"==n.CLASS_NAME||"OpenLayers.Geometry.MultiPolygon"==n.CLASS_NAME||"OpenLayers.Geometry.Collection"==n.CLASS_NAME)for(var i=0,r=n.components.length;i<r;i++)this.eraseGeometry(n.components[i],t);else(i=OpenLayers.Util.getElement(n.id))&&i.parentNode&&(i.geometry&&(i.geometry.destroy(),i.geometry=null),i.parentNode.removeChild(i),this.indexer&&this.indexer.remove(i),i._style.backgroundGraphic&&(i=OpenLayers.Util.getElement(n.id+this.BACKGROUND_ID_SUFFIX))&&i.parentNode&&i.parentNode.removeChild(i))},nodeFactory:function(n,t){var i=OpenLayers.Util.getElement(n);return i?this.nodeTypeCompare(i,t)||(i.parentNode.removeChild(i),i=this.nodeFactory(n,t)):i=this.createNode(t,n),i},nodeTypeCompare:function(){},createNode:function(){},moveRoot:function(n){var t=this.root;n.root.parentNode==this.rendererRoot&&(t=n.root),t.parentNode.removeChild(t),n.rendererRoot.appendChild(t)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(n){return"circle"!=n&&!!n},CLASS_NAME:"OpenLayers.Renderer.Elements"}),OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,getParameters:function(n){n=n||window.location.href;var t=OpenLayers.Util.getParameters(n),i=n.indexOf("#");return 0<i&&(n="?"+n.substring(i+1,n.length),OpenLayers.Util.extend(t,OpenLayers.Util.getParameters(n))),t},setMap:function(){var t,r,i;for(OpenLayers.Control.prototype.setMap.apply(this,arguments),t=0,r=this.map.controls.length;t<r;t++)if(i=this.map.controls[t],i!=this&&"OpenLayers.Control.ArgParser"==i.CLASS_NAME){i.displayProjection!=this.displayProjection&&(this.displayProjection=i.displayProjection);break}t==this.map.controls.length&&(t=this.getParameters(),t.layers&&(this.layers=t.layers,this.map.events.register("addlayer",this,this.configureLayers),this.configureLayers()),t.lat&&t.lon&&(this.center=new OpenLayers.LonLat(parseFloat(t.lon),parseFloat(t.lat)),t.zoom&&(this.zoom=parseFloat(t.zoom)),this.map.events.register("changebaselayer",this,this.setCenter),this.setCenter()))},setCenter:function(){this.map.baseLayer&&(this.map.events.unregister("changebaselayer",this,this.setCenter),this.displayProjection&&this.center.transform(this.displayProjection,this.map.getProjectionObject()),this.map.setCenter(this.center,this.zoom))},configureLayers:function(){var n,r,i,t;if(this.layers.length==this.map.layers.length)for(this.map.events.unregister("addlayer",this,this.configureLayers),n=0,r=this.layers.length;n<r;n++)i=this.map.layers[n],t=this.layers.charAt(n),"B"==t?this.map.setBaseLayer(i):"T"!=t&&"F"!=t||i.setVisibility("T"==t)},CLASS_NAME:"OpenLayers.Control.ArgParser"}),OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,anchor:!1,base:"",displayProjection:null,initialize:function(n,t,i){null===n||"object"!=typeof n||OpenLayers.Util.isElement(n)?(OpenLayers.Control.prototype.initialize.apply(this,[i]),this.element=OpenLayers.Util.getElement(n),this.base=t||document.location.href):(this.base=document.location.href,OpenLayers.Control.prototype.initialize.apply(this,[n]),null!=this.element&&(this.element=OpenLayers.Util.getElement(this.element)))},destroy:function(){this.element&&this.element.parentNode==this.div&&(this.div.removeChild(this.element),this.element=null),this.map&&this.map.events.unregister("moveend",this,this.updateLink),OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(){var t,r,i;for(OpenLayers.Control.prototype.setMap.apply(this,arguments),t=0,r=this.map.controls.length;t<r;t++)if(i=this.map.controls[t],i.CLASS_NAME==this.argParserClass.CLASS_NAME){i.displayProjection!=this.displayProjection&&(this.displayProjection=i.displayProjection);break}t==this.map.controls.length&&this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||this.anchor||(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});return this.updateLink(),this.div},updateLink:function(){var t=this.anchor?"#":"?",n=this.base,i=null;-1!=n.indexOf("#")&&!1==this.anchor&&(i=n.substring(n.indexOf("#"),n.length)),-1!=n.indexOf(t)&&(n=n.substring(0,n.indexOf(t))),n=n.split("#")[0]+t+OpenLayers.Util.getParameterString(this.createParams()),i&&(n+=i),this.anchor&&!this.element?window.location.href=n:this.element.href=n},createParams:function(n,t,i){var r,u;if(n=n||this.map.getCenter(),r=OpenLayers.Util.getParameters(this.base),n)for(r.zoom=t||this.map.getZoom(),t=n.lat,n=n.lon,this.displayProjection&&(t=OpenLayers.Projection.transform({x:n,y:t},this.map.getProjectionObject(),this.displayProjection),n=t.x,t=t.y),r.lat=Math.round(1e5*t)/1e5,r.lon=Math.round(1e5*n)/1e5,i=i||this.map.layers,r.layers="",n=0,t=i.length;n<t;n++)u=i[n],r.layers=u.isBaseLayer?r.layers+(u==this.map.baseLayer?"B":"0"):r.layers+(u.getVisibility()?"T":"F");return r},CLASS_NAME:"OpenLayers.Control.Permalink"}),OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",layername:null,type:null,isBaseLayer:!0,tileOrigin:null,serverResolutions:null,zoomOffset:0,initialize:function(n,t,i){var r=[];r.push(n,t,{},i),OpenLayers.Layer.Grid.prototype.initialize.apply(this,r)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.TMS(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){n=this.adjustBounds(n);var t=this.getServerResolution(),i=Math.round((n.left-this.tileOrigin.lon)/(t*this.tileSize.w));return n=Math.round((n.bottom-this.tileOrigin.lat)/(t*this.tileSize.h)),t=this.getServerZoom(),i=this.serviceVersion+"/"+this.layername+"/"+t+"/"+i+"/"+n+"."+this.type,n=this.url,OpenLayers.Util.isArray(n)&&(n=this.selectUrl(i,n)),n+i},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.TMS"}),OpenLayers.Format.WCSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",CLASS_NAME:"OpenLayers.Format.WCSCapabilities"}),OpenLayers.Format.WCSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g,splitSpace:/\s+/},defaultPrefix:"wcs",read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1"}),OpenLayers.Format.WCSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1,{namespaces:{wcs:"http://www.opengis.net/wcs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows"},errorProperty:"service",readers:{wcs:{WCS_Capabilities:function(n,t){this.readChildNodes(n,t)},Service:function(n,t){t.service={},this.readChildNodes(n,t.service)},name:function(n,t){t.name=this.getChildValue(n)},label:function(n,t){t.label=this.getChildValue(n)},keywords:function(n,t){t.keywords=[],this.readChildNodes(n,t.keywords)},keyword:function(n,t){t.push(this.getChildValue(n))},responsibleParty:function(n,t){t.responsibleParty={},this.readChildNodes(n,t.responsibleParty)},individualName:function(n,t){t.individualName=this.getChildValue(n)},organisationName:function(n,t){t.organisationName=this.getChildValue(n)},positionName:function(n,t){t.positionName=this.getChildValue(n)},contactInfo:function(n,t){t.contactInfo={},this.readChildNodes(n,t.contactInfo)},phone:function(n,t){t.phone={},this.readChildNodes(n,t.phone)},voice:function(n,t){t.voice=this.getChildValue(n)},facsimile:function(n,t){t.facsimile=this.getChildValue(n)},address:function(n,t){t.address={},this.readChildNodes(n,t.address)},deliveryPoint:function(n,t){t.deliveryPoint=this.getChildValue(n)},city:function(n,t){t.city=this.getChildValue(n)},postalCode:function(n,t){t.postalCode=this.getChildValue(n)},country:function(n,t){t.country=this.getChildValue(n)},electronicMailAddress:function(n,t){t.electronicMailAddress=this.getChildValue(n)},fees:function(n,t){t.fees=this.getChildValue(n)},accessConstraints:function(n,t){t.accessConstraints=this.getChildValue(n)},ContentMetadata:function(n,t){t.contentMetadata=[],this.readChildNodes(n,t.contentMetadata)},CoverageOfferingBrief:function(n,t){var i={};this.readChildNodes(n,i),t.push(i)},name:function(n,t){t.name=this.getChildValue(n)},label:function(n,t){t.label=this.getChildValue(n)},lonLatEnvelope:function(n,t){var i=this.getElementsByTagNameNS(n,"http://www.opengis.net/gml","pos"),r,u;2==i.length&&(r={},u={},OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[i[0],r]),OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[i[1],u]),t.lonLatEnvelope={},t.lonLatEnvelope.srsName=n.getAttribute("srsName"),t.lonLatEnvelope.min=r.points[0],t.lonLatEnvelope.max=u.points[0])}}},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1_0_0"}),OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:!1,activate:function(){var n=OpenLayers.Strategy.prototype.activate.apply(this,arguments);if(n)if(this.layer.events.on({refresh:this.load,scope:this}),!0==this.layer.visibility||this.preload)this.load();else this.layer.events.on({visibilitychanged:this.load,scope:this});return n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this}),n},load:function(n){var t=this.layer;t.events.triggerEvent("loadstart",{filter:t.filter}),t.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,filter:t.filter,scope:this},n)),t.events.un({visibilitychanged:this.load,scope:this})},merge:function(n){var i=this.layer,t,u,f,e,r,o;if(i.destroyFeatures(),t=n.features,t&&0<t.length){if(u=i.projection,f=i.map.getProjectionObject(),!f.equals(u))for(r=0,o=t.length;r<o;++r)(e=t[r].geometry)&&e.transform(u,f);i.addFeatures(t)}i.events.triggerEvent("loadend",{response:n})},CLASS_NAME:"OpenLayers.Strategy.Fixed"}),OpenLayers.Control.Zoom=OpenLayers.Class(OpenLayers.Control,{zoomInText:"+",zoomInId:"olZoomInLink",zoomOutText:"−",zoomOutId:"olZoomOutLink",draw:function(){var t=OpenLayers.Control.prototype.draw.apply(this),n=this.getOrCreateLinks(t),r=n.zoomIn,n=n.zoomOut,i=this.map.events;return n.parentNode!==t&&(i=this.events,i.attachToElement(n.parentNode)),i.register("buttonclick",this,this.onZoomClick),this.zoomInLink=r,this.zoomOutLink=n,t},getOrCreateLinks:function(n){var t=document.getElementById(this.zoomInId),i=document.getElementById(this.zoomOutId);return t||(t=document.createElement("a"),t.href="#zoomIn",t.appendChild(document.createTextNode(this.zoomInText)),t.className="olControlZoomIn",n.appendChild(t)),OpenLayers.Element.addClass(t,"olButton"),i||(i=document.createElement("a"),i.href="#zoomOut",i.appendChild(document.createTextNode(this.zoomOutText)),i.className="olControlZoomOut",n.appendChild(i)),OpenLayers.Element.addClass(i,"olButton"),{zoomIn:t,zoomOut:i}},onZoomClick:function(n){n=n.buttonElement,n===this.zoomInLink?this.map.zoomIn():n===this.zoomOutLink&&this.map.zoomOut()},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onZoomClick),delete this.zoomInLink,delete this.zoomOutLink,OpenLayers.Control.prototype.destroy.apply(this)},CLASS_NAME:"OpenLayers.Control.Zoom"}),OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:!0,initialize:function(n,t){if(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"])},n instanceof OpenLayers.Style)this.styles["default"]=n,this.styles.select=n,this.styles.temporary=n,this.styles["delete"]=n;else if("object"==typeof n)for(var i in n)if(n[i]instanceof OpenLayers.Style)this.styles[i]=n[i];else if("object"==typeof n[i])this.styles[i]=new OpenLayers.Style(n[i]);else{this.styles["default"]=new OpenLayers.Style(n),this.styles.select=new OpenLayers.Style(n),this.styles.temporary=new OpenLayers.Style(n),this.styles["delete"]=new OpenLayers.Style(n);break}OpenLayers.Util.extend(this,t)},destroy:function(){for(var n in this.styles)this.styles[n].destroy();this.styles=null},createSymbolizer:function(n,t){n||(n=new OpenLayers.Feature.Vector),this.styles[t]||(t="default"),n.renderIntent=t;var i={};return this.extendDefault&&"default"!=t&&(i=this.styles["default"].createSymbolizer(n)),OpenLayers.Util.extend(i,this.styles[t].createSymbolizer(n))},addUniqueValueRules:function(n,t,i,r){var f=[],u;for(u in i)f.push(new OpenLayers.Rule({symbolizer:i[u],context:r,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:t,value:u})}));this.styles[n].addRules(f)},CLASS_NAME:"OpenLayers.StyleMap"}),OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,isFixed:!1,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:!0,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:!1,ratio:1,initialize:function(){if(OpenLayers.Layer.prototype.initialize.apply(this,arguments),this.renderer&&this.renderer.supported()||this.assignRenderer(),this.renderer&&this.renderer.supported()||(this.renderer=null,this.displayError()),this.styleMap||(this.styleMap=new OpenLayers.StyleMap),this.features=[],this.selectedFeatures=[],this.unrenderedFeatures={},this.strategies)for(var i=0,r=this.strategies.length;i<r;i++)this.strategies[i].setLayer(this)},destroy:function(){if(this.strategies){for(var t,n=0,i=this.strategies.length;n<i;n++)t=this.strategies[n],t.autoDestroy&&t.destroy();this.strategies=null}this.protocol&&(this.protocol.autoDestroy&&this.protocol.destroy(),this.protocol=null),this.destroyFeatures(),this.unrenderedFeatures=this.selectedFeatures=this.features=null,this.renderer&&this.renderer.destroy(),this.drawn=this.geometryType=this.renderer=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(n){null==n&&(n=new OpenLayers.Layer.Vector(this.name,this.getOptions())),n=OpenLayers.Layer.prototype.clone.apply(this,[n]);for(var i=this.features,r=i.length,u=Array(r),t=0;t<r;++t)u[t]=i[t].clone();return n.features=u,n},refresh:function(n){this.calculateInRange()&&this.visibility&&this.events.triggerEvent("refresh",n)},assignRenderer:function(){for(var n,t=0,i=this.renderers.length;t<i;t++)if(n=this.renderers[t],(n="function"==typeof n?n:OpenLayers.Renderer[n])&&n.prototype.supported()){this.renderer=new n(this.div,this.rendererOptions);break}},displayError:function(){this.reportError&&OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))},setMap:function(){if(OpenLayers.Layer.prototype.setMap.apply(this,arguments),this.renderer){this.renderer.map=this.map;var t=this.map.getSize();t.w*=this.ratio,t.h*=this.ratio,this.renderer.setSize(t)}else this.map.removeLayer(this)},afterAdd:function(){if(this.strategies)for(var t,n=0,i=this.strategies.length;n<i;n++)t=this.strategies[n],t.autoActivate&&t.activate()},removeMap:function(n){if(this.drawn=!1,this.strategies)for(var t=0,i=this.strategies.length;t<i;t++)n=this.strategies[t],n.autoActivate&&n.deactivate()},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);var n=this.map.getSize();n.w*=this.ratio,n.h*=this.ratio,this.renderer.setSize(n)},moveTo:function(n,t,i){var r,f;if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),r=!0,!i){this.renderer.root.style.visibility="hidden";var r=this.map.getSize(),u=r.w,r=r.h,u=u/2*this.ratio-u/2,r=r/2*this.ratio-r/2,u=u+this.map.layerContainerOriginPx.x,u=-Math.round(u),r=r+this.map.layerContainerOriginPx.y,r=-Math.round(r);if(this.div.style.left=u+"px",this.div.style.top=r+"px",u=this.map.getExtent().scale(this.ratio),r=this.renderer.setExtent(u,t),this.renderer.root.style.visibility="visible",!0===OpenLayers.IS_GECKO&&(this.div.scrollLeft=this.div.scrollLeft),!t&&r)for(f in this.unrenderedFeatures)u=this.unrenderedFeatures[f],this.drawFeature(u)}if(!this.drawn||t||!r)for(this.drawn=!0,f=0,r=this.features.length;f<r;f++)this.renderer.locked=f!==r-1,u=this.features[f],this.drawFeature(u)},display:function(){OpenLayers.Layer.prototype.display.apply(this,arguments);var t=this.div.style.display;t!=this.renderer.root.style.display&&(this.renderer.root.style.display=t)},addFeatures:function(n,t){var r,u,i;if(OpenLayers.Util.isArray(n)||(n=[n]),r=!t||!t.silent,r){if(u={features:n},!1===this.events.triggerEvent("beforefeaturesadded",u))return;n=u.features}for(var u=[],f=0,e=n.length;f<e;f++){if(this.renderer.locked=f!=n.length-1?!0:!1,i=n[f],this.geometryType&&!(i.geometry instanceof this.geometryType))throw new TypeError("addFeatures: component should be an "+this.geometryType.prototype.CLASS_NAME);if(i.layer=this,!i.style&&this.style&&(i.style=OpenLayers.Util.extend({},this.style)),r){if(!1===this.events.triggerEvent("beforefeatureadded",{feature:i}))continue;this.preFeatureInsert(i)}u.push(i),this.features.push(i),this.drawFeature(i),r&&(this.events.triggerEvent("featureadded",{feature:i}),this.onFeatureInsert(i))}r&&this.events.triggerEvent("featuresadded",{features:u})},removeFeatures:function(n,t){var u,r,i;if(n&&0!==n.length){if(n===this.features)return this.removeAllFeatures(t);for(OpenLayers.Util.isArray(n)||(n=[n]),n===this.selectedFeatures&&(n=n.slice()),u=!t||!t.silent,u&&this.events.triggerEvent("beforefeaturesremoved",{features:n}),r=n.length-1;0<=r;r--)this.renderer.locked=0!=r&&n[r-1].geometry?!0:!1,i=n[r],delete this.unrenderedFeatures[i.id],u&&this.events.triggerEvent("beforefeatureremoved",{feature:i}),this.features=OpenLayers.Util.removeItem(this.features,i),i.layer=null,i.geometry&&this.renderer.eraseFeatures(i),-1!=OpenLayers.Util.indexOf(this.selectedFeatures,i)&&OpenLayers.Util.removeItem(this.selectedFeatures,i),u&&this.events.triggerEvent("featureremoved",{feature:i});u&&this.events.triggerEvent("featuresremoved",{features:n})}},removeAllFeatures:function(n){var t,i,r;for(n=!n||!n.silent,t=this.features,n&&this.events.triggerEvent("beforefeaturesremoved",{features:t}),r=t.length-1;0<=r;r--)i=t[r],n&&this.events.triggerEvent("beforefeatureremoved",{feature:i}),i.layer=null,n&&this.events.triggerEvent("featureremoved",{feature:i});this.renderer.clear(),this.features=[],this.unrenderedFeatures={},this.selectedFeatures=[],n&&this.events.triggerEvent("featuresremoved",{features:t})},destroyFeatures:function(n,t){if(void 0==n&&(n=this.features),n){this.removeFeatures(n,t);for(var i=n.length-1;0<=i;i--)n[i].destroy()}},drawFeature:function(n,t){if(this.drawn){if("object"!=typeof t){t||n.state!==OpenLayers.State.DELETE||(t="delete");var i=t||n.renderIntent;(t=n.style||this.style)||(t=this.styleMap.createSymbolizer(n,i))}i=this.renderer.drawFeature(n,t),!1===i||null===i?this.unrenderedFeatures[n.id]=n:delete this.unrenderedFeatures[n.id]}},eraseFeatures:function(n){this.renderer.eraseFeatures(n)},getFeatureFromEvent:function(n){if(!this.renderer)throw Error("getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.");var t=null;return(n=this.renderer.getFeatureIdFromEvent(n))&&(t="string"==typeof n?this.getFeatureById(n):n),t},getFeatureBy:function(n,t){for(var r=null,i=0,u=this.features.length;i<u;++i)if(this.features[i][n]==t){r=this.features[i];break}return r},getFeatureById:function(n){return this.getFeatureBy("id",n)},getFeatureByFid:function(n){return this.getFeatureBy("fid",n)},getFeaturesByAttribute:function(n,t){for(var i,f=this.features.length,u=[],r=0;r<f;r++)(i=this.features[r])&&i.attributes&&i.attributes[n]===t&&u.push(i);return u},onFeatureInsert:function(){},preFeatureInsert:function(){},getDataExtent:function(){var n=null,t=this.features;if(t&&0<t.length)for(var r=null,i=0,u=t.length;i<u;i++)(r=t[i].geometry)&&(null===n&&(n=new OpenLayers.Bounds),n.extend(r.getBounds()));return n},CLASS_NAME:"OpenLayers.Layer.Vector"}),OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,styleFrom:null,addNodes:function(n,t){var o;if(2>n.length)throw Error("At least two point features have to be added to create a line from");for(var e=Array(n.length-1),u,f,i,r=0,s=n.length;r<s;r++){if(u=n[r],i=u.geometry,i){if("OpenLayers.Geometry.Point"!=i.CLASS_NAME)throw new TypeError("Only features with point geometries are supported.");}else i=u.lonlat,i=new OpenLayers.Geometry.Point(i.lon,i.lat);0<r&&(u=null!=this.dataFrom?n[r+this.dataFrom].data||n[r+this.dataFrom].attributes:null,o=null!=this.styleFrom?n[r+this.styleFrom].style:null,f=new OpenLayers.Geometry.LineString([f,i]),e[r-1]=new OpenLayers.Feature.Vector(f,u,o)),f=i}this.addFeatures(e,t)},CLASS_NAME:"OpenLayers.Layer.PointTrack"}),OpenLayers.Layer.PointTrack.SOURCE_NODE=-1,OpenLayers.Layer.PointTrack.TARGET_NODE=0,OpenLayers.Layer.PointTrack.dataFrom={SOURCE_NODE:-1,TARGET_NODE:0},OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:!0,defaultFilter:null,initialize:function(n){n=n||{},OpenLayers.Util.extend(this,n),this.options=n},mergeWithDefaultFilter:function(n){return n&&this.defaultFilter?new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,n]}):n||this.defaultFilter||void 0},destroy:function(){this.format=this.options=null},read:function(n){n=n||{},n.filter=this.mergeWithDefaultFilter(n.filter)},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(){},createCallback:function(n,t,i){return OpenLayers.Function.bind(function(){n.apply(this,[t,i])},this)},CLASS_NAME:"OpenLayers.Protocol"}),OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:!0,features:null,data:null,reqFeatures:null,priv:null,error:null,initialize:function(n){OpenLayers.Util.extend(this,n)},success:function(){return 0<this.code},CLASS_NAME:"OpenLayers.Protocol.Response"}),OpenLayers.Protocol.Response.SUCCESS=1,OpenLayers.Protocol.Response.FAILURE=0,OpenLayers.Protocol.WFS=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Protocol.WFS.DEFAULTS);var t=OpenLayers.Protocol.WFS["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFS version: "+n.version;return new t(n)},OpenLayers.Protocol.WFS.fromWMSLayer=function(n,t){var i,r;return i=n.params.LAYERS,i=(OpenLayers.Util.isArray(i)?i[0]:i).split(":"),1<i.length&&(r=i[0]),i=i.pop(),r={url:n.url,featureType:i,featurePrefix:r,srsName:n.projection&&n.projection.getCode()||n.map&&n.map.getProjectionObject().getCode(),version:"1.1.0"},new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(t,r))},OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"},OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,markers:null,drawn:!1,initialize:function(){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(n){if(n!=this.opacity){this.opacity=n,n=0;for(var t=this.markers.length;n<t;n++)this.markers[n].setOpacity(this.opacity)}},moveTo:function(n,t){if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),t||!this.drawn){for(var r=0,u=this.markers.length;r<u;r++)this.drawMarker(this.markers[r]);this.drawn=!0}},addMarker:function(n){this.markers.push(n),1>this.opacity&&n.setOpacity(this.opacity),this.map&&this.map.getExtent()&&(n.map=this.map,this.drawMarker(n))},removeMarker:function(n){this.markers&&this.markers.length&&(OpenLayers.Util.removeItem(this.markers,n),n.erase())},clearMarkers:function(){if(null!=this.markers)for(;0<this.markers.length;)this.removeMarker(this.markers[0])},drawMarker:function(n){var t=this.map.getLayerPxFromLonLat(n.lonlat);null==t?n.display(!1):n.isDrawn()?n.icon&&n.icon.moveTo(t):(n=n.draw(t),this.div.appendChild(n))},getDataExtent:function(){var t=null;if(this.markers&&0<this.markers.length)for(var t=new OpenLayers.Bounds,n=0,i=this.markers.length;n<i;n++)t.extend(this.markers[n].lonlat);return t},CLASS_NAME:"OpenLayers.Layer.Markers"}),OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control.Button,{slideFactor:50,slideRatio:null,direction:null,initialize:function(n,t){this.direction=n,this.CLASS_NAME+=this.direction,OpenLayers.Control.prototype.initialize.apply(this,[t])},trigger:function(){if(this.map){var n=OpenLayers.Function.bind(function(n){return this.slideRatio?this.map.getSize()[n]*this.slideRatio:this.slideFactor},this);switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-n("h"));break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,n("h"));break;case OpenLayers.Control.Pan.WEST:this.map.pan(-n("w"),0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(n("w"),0)}}},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.Format.CSWGetDomain=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Format.CSWGetDomain.DEFAULTS);var t=OpenLayers.Format.CSWGetDomain["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSWGetDomain version: "+n.version;return new t(n)},OpenLayers.Format.CSWGetDomain.DEFAULTS={version:"2.0.2"},OpenLayers.Format.CSWGetDomain.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",csw:"http://www.opengis.net/cat/csw/2.0.2"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",PropertyName:null,ParameterName:null,read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{csw:{GetDomainResponse:function(n,t){this.readChildNodes(n,t)},DomainValues:function(n,t){OpenLayers.Util.isArray(t.DomainValues)||(t.DomainValues=[]);for(var r=n.attributes,u={},i=0,f=r.length;i<f;++i)u[r[i].name]=r[i].nodeValue;this.readChildNodes(n,u),t.DomainValues.push(u)},PropertyName:function(n,t){t.PropertyName=this.getChildValue(n)},ParameterName:function(n,t){t.ParameterName=this.getChildValue(n)},ListOfValues:function(n,t){OpenLayers.Util.isArray(t.ListOfValues)||(t.ListOfValues=[]),this.readChildNodes(n,t.ListOfValues)},Value:function(n,t){for(var r=n.attributes,u={},i=0,f=r.length;i<f;++i)u[r[i].name]=r[i].nodeValue;u.value=this.getChildValue(n),t.push({Value:u})},ConceptualScheme:function(n,t){t.ConceptualScheme={},this.readChildNodes(n,t.ConceptualScheme)},Name:function(n,t){t.Name=this.getChildValue(n)},Document:function(n,t){t.Document=this.getChildValue(n)},Authority:function(n,t){t.Authority=this.getChildValue(n)},RangeOfValues:function(n,t){t.RangeOfValues={},this.readChildNodes(n,t.RangeOfValues)},MinValue:function(n,t){for(var r=n.attributes,u={},i=0,f=r.length;i<f;++i)u[r[i].name]=r[i].nodeValue;u.value=this.getChildValue(n),t.MinValue=u},MaxValue:function(n,t){for(var r=n.attributes,u={},i=0,f=r.length;i<f;++i)u[r[i].name]=r[i].nodeValue;u.value=this.getChildValue(n),t.MaxValue=u}}},write:function(n){return n=this.writeNode("csw:GetDomain",n),OpenLayers.Format.XML.prototype.write.apply(this,[n])},writers:{csw:{GetDomain:function(n){var t=this.createElementNSPlus("csw:GetDomain",{attributes:{service:"CSW",version:this.version}});return n.PropertyName||this.PropertyName?this.writeNode("csw:PropertyName",n.PropertyName||this.PropertyName,t):(n.ParameterName||this.ParameterName)&&this.writeNode("csw:ParameterName",n.ParameterName||this.ParameterName,t),this.readChildNodes(t,n),t},PropertyName:function(n){return this.createElementNSPlus("csw:PropertyName",{value:n})},ParameterName:function(n){return this.createElementNSPlus("csw:ParameterName",{value:n})}}},CLASS_NAME:"OpenLayers.Format.CSWGetDomain.v2_0_2"}),OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{read:function(n){return(new OpenLayers.Format.ArcXML).read(n).features.feature}}),OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{DEFAULTS:{tolerance:10,node:!0,edge:!0,vertex:!0},greedy:!0,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(n){OpenLayers.Control.prototype.initialize.apply(this,[n]),this.options=n||{},this.options.layer&&this.setLayer(this.options.layer),n=OpenLayers.Util.extend({},this.options.defaults),this.defaults=OpenLayers.Util.applyDefaults(n,this.DEFAULTS),this.setTargets(this.options.targets),0===this.targets.length&&this.layer&&this.addTargetLayer(this.layer),this.geoToleranceCache={}},setLayer:function(n){this.active?(this.deactivate(),this.layer=n,this.activate()):this.layer=n},setTargets:function(n){if(this.targets=[],n&&n.length)for(var t,i=0,r=n.length;i<r;++i)t=n[i],t instanceof OpenLayers.Layer.Vector?this.addTargetLayer(t):this.addTarget(t)},addTargetLayer:function(n){this.addTarget({layer:n})},addTarget:function(n){n=OpenLayers.Util.applyDefaults(n,this.defaults),n.nodeTolerance=n.nodeTolerance||n.tolerance,n.vertexTolerance=n.vertexTolerance||n.tolerance,n.edgeTolerance=n.edgeTolerance||n.tolerance,this.targets.push(n)},removeTargetLayer:function(n){for(var t,i=this.targets.length-1;0<=i;--i)t=this.targets[i],t.layer===n&&this.removeTarget(t)},removeTarget:function(n){return OpenLayers.Util.removeItem(this.targets,n)},activate:function(){var n=OpenLayers.Control.prototype.activate.call(this);if(n&&this.layer&&this.layer.events)this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this});return n},deactivate:function(){var n=OpenLayers.Control.prototype.deactivate.call(this);return n&&this.layer&&this.layer.events&&this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this}),this.point=this.feature=null,n},onSketchModified:function(n){this.feature=n.feature,this.considerSnapping(n.vertex,n.vertex)},onVertexModified:function(n){this.feature=n.feature;var t=this.layer.map.getLonLatFromViewPortPx(n.pixel);this.considerSnapping(n.vertex,new OpenLayers.Geometry.Point(t.lon,t.lat))},considerSnapping:function(n,t){for(var i={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null},u=!1,r,f,e=0,o=this.targets.length;e<o;++e)if(f=this.targets[e],r=this.testTarget(f,t))if(this.greedy){i=r,i.target=f,u=!0;break}else(r.rank<i.rank||r.rank===i.rank&&r.dist<i.dist)&&(i=r,i.target=f,u=!0);u&&(!1!==this.events.triggerEvent("beforesnap",{point:n,x:i.x,y:i.y,distance:i.dist,layer:i.target.layer,snapType:this.precedence[i.rank]})?(n.x=i.x,n.y=i.y,this.point=n,this.events.triggerEvent("snap",{point:n,snapType:this.precedence[i.rank],layer:i.target.layer,distance:i.dist})):u=!1),this.point&&!u&&(n.x=t.x,n.y=t.y,this.point=null,this.events.triggerEvent("unsnap",{point:n}))},testTarget:function(n,t){var i=this.layer.map.getResolution(),e,w,c,b;if("minResolution"in n&&i<n.minResolution||"maxResolution"in n&&i>=n.maxResolution)return null;for(var i={node:this.getGeoTolerance(n.nodeTolerance,i),vertex:this.getGeoTolerance(n.vertexTolerance,i),edge:this.getGeoTolerance(n.edgeTolerance,i)},y=Math.max(i.node,i.vertex,i.edge),r={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY},l=!1,p=n.layer.features,u,s,o,h,f,a,k=this.precedence.length,d=new OpenLayers.LonLat(t.x,t.y),v=0,g=p.length;v<g;++v)if(u=p[v],u!==this.feature&&!u._sketch&&u.state!==OpenLayers.State.DELETE&&(!n.filter||n.filter.evaluate(u))&&u.atPoint(d,y,y))for(e=0,w=Math.min(r.rank+1,k);e<w;++e)if(s=this.precedence[e],n[s])if("edge"===s){if(o=u.geometry.distanceTo(t,{details:!0}),f=o.distance,f<=i[s]&&f<r.dist){r={rank:e,dist:f,x:o.x0,y:o.y0},l=!0;break}}else{for(o=u.geometry.getVertices("node"===s),a=!1,c=0,b=o.length;c<b;++c)h=o[c],f=h.distanceTo(t),f<=i[s]&&(e<r.rank||e===r.rank&&f<r.dist)&&(r={rank:e,dist:f,x:h.x,y:h.y},a=l=!0);if(a)break}return l?r:null},getGeoTolerance:function(n,t){t!==this.resolution&&(this.resolution=t,this.geoToleranceCache={});var i=this.geoToleranceCache[n];return void 0===i&&(i=n*t,this.geoToleranceCache[n]=i),i},destroy:function(){this.active&&this.deactivate(),delete this.layer,delete this.targets,OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"}),OpenLayers.Format.OWSCommon.v1_1_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1,{namespaces:{ows:"http://www.opengis.net/ows/1.1",xlink:"http://www.w3.org/1999/xlink"},readers:{ows:OpenLayers.Util.applyDefaults({ExceptionReport:function(n,t){t.exceptionReport={version:n.getAttribute("version"),language:n.getAttribute("xml:lang"),exceptions:[]},this.readChildNodes(n,t.exceptionReport)},AllowedValues:function(n,t){t.allowedValues={},this.readChildNodes(n,t.allowedValues)},AnyValue:function(n,t){t.anyValue=!0},DataType:function(n,t){t.dataType=this.getChildValue(n)},Range:function(n,t){t.range={},this.readChildNodes(n,t.range)},MinimumValue:function(n,t){t.minValue=this.getChildValue(n)},MaximumValue:function(n,t){t.maxValue=this.getChildValue(n)},Identifier:function(n,t){t.identifier=this.getChildValue(n)},SupportedCRS:function(n,t){t.supportedCRS=this.getChildValue(n)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Util.applyDefaults({Range:function(n){var t=this.createElementNSPlus("ows:Range",{attributes:{"ows:rangeClosure":n.closure}});return this.writeNode("ows:MinimumValue",n.minValue,t),this.writeNode("ows:MaximumValue",n.maxValue,t),t},MinimumValue:function(n){return this.createElementNSPlus("ows:MinimumValue",{value:n})},MaximumValue:function(n){return this.createElementNSPlus("ows:MaximumValue",{value:n})},Value:function(n){return this.createElementNSPlus("ows:Value",{value:n})}},OpenLayers.Format.OWSCommon.v1.prototype.writers.ows)},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1_1_0"}),OpenLayers.Format.WCSGetCoverage=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows/1.1",wcs:"http://www.opengis.net/wcs/1.1",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.1.2",schemaLocation:"http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1/wcsGetCoverage.xsd",write:function(n){return n=this.writeNode("wcs:GetCoverage",n),this.setAttributeNS(n,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[n])},writers:{wcs:{GetCoverage:function(n){var t=this.createElementNSPlus("wcs:GetCoverage",{attributes:{version:n.version||this.VERSION,service:"WCS"}});return this.writeNode("ows:Identifier",n.identifier,t),this.writeNode("wcs:DomainSubset",n.domainSubset,t),this.writeNode("wcs:Output",n.output,t),t},DomainSubset:function(n){var t=this.createElementNSPlus("wcs:DomainSubset",{});return this.writeNode("ows:BoundingBox",n.boundingBox,t),n.temporalSubset&&this.writeNode("wcs:TemporalSubset",n.temporalSubset,t),t},TemporalSubset:function(n){for(var i=this.createElementNSPlus("wcs:TemporalSubset",{}),t=0,r=n.timePeriods.length;t<r;++t)this.writeNode("wcs:TimePeriod",n.timePeriods[t],i);return i},TimePeriod:function(n){var t=this.createElementNSPlus("wcs:TimePeriod",{});return this.writeNode("wcs:BeginPosition",n.begin,t),this.writeNode("wcs:EndPosition",n.end,t),n.resolution&&this.writeNode("wcs:TimeResolution",n.resolution,t),t},BeginPosition:function(n){return this.createElementNSPlus("wcs:BeginPosition",{value:n})},EndPosition:function(n){return this.createElementNSPlus("wcs:EndPosition",{value:n})},TimeResolution:function(n){return this.createElementNSPlus("wcs:TimeResolution",{value:n})},Output:function(n){var t=this.createElementNSPlus("wcs:Output",{attributes:{format:n.format,store:n.store}});return n.gridCRS&&this.writeNode("wcs:GridCRS",n.gridCRS,t),t},GridCRS:function(n){var t=this.createElementNSPlus("wcs:GridCRS",{});return this.writeNode("wcs:GridBaseCRS",n.baseCRS,t),n.type&&this.writeNode("wcs:GridType",n.type,t),n.origin&&this.writeNode("wcs:GridOrigin",n.origin,t),this.writeNode("wcs:GridOffsets",n.offsets,t),n.CS&&this.writeNode("wcs:GridCS",n.CS,t),t},GridBaseCRS:function(n){return this.createElementNSPlus("wcs:GridBaseCRS",{value:n})},GridOrigin:function(n){return this.createElementNSPlus("wcs:GridOrigin",{value:n})},GridType:function(n){return this.createElementNSPlus("wcs:GridType",{value:n})},GridOffsets:function(n){return this.createElementNSPlus("wcs:GridOffsets",{value:n})},GridCS:function(n){return this.createElementNSPlus("wcs:GridCS",{value:n})}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.WCSGetCoverage"}),OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",profile:null,CLASS_NAME:"OpenLayers.Format.WMSCapabilities"}),OpenLayers.Format.WMSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{wms:"http://www.opengis.net/wms",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"wms",read:function(n){var i,t;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),i=n,n&&9==n.nodeType&&(n=n.documentElement),t={},this.readNode(n,t),void 0===t.service&&(n=new OpenLayers.Format.OGCExceptionReport,t.error=n.read(i)),t},readers:{wms:{Service:function(n,t){t.service={},this.readChildNodes(n,t.service)},Name:function(n,t){t.name=this.getChildValue(n)},Title:function(n,t){t.title=this.getChildValue(n)},Abstract:function(n,t){t.abstract=this.getChildValue(n)},BoundingBox:function(n){var r={},i;return r.bbox=[parseFloat(n.getAttribute("minx")),parseFloat(n.getAttribute("miny")),parseFloat(n.getAttribute("maxx")),parseFloat(n.getAttribute("maxy"))],i={x:parseFloat(n.getAttribute("resx")),y:parseFloat(n.getAttribute("resy"))},isNaN(i.x)&&isNaN(i.y)||(r.res=i),r},OnlineResource:function(n,t){t.href=this.getAttributeNS(n,this.namespaces.xlink,"href")},ContactInformation:function(n,t){t.contactInformation={},this.readChildNodes(n,t.contactInformation)},ContactPersonPrimary:function(n,t){t.personPrimary={},this.readChildNodes(n,t.personPrimary)},ContactPerson:function(n,t){t.person=this.getChildValue(n)},ContactOrganization:function(n,t){t.organization=this.getChildValue(n)},ContactPosition:function(n,t){t.position=this.getChildValue(n)},ContactAddress:function(n,t){t.contactAddress={},this.readChildNodes(n,t.contactAddress)},AddressType:function(n,t){t.type=this.getChildValue(n)},Address:function(n,t){t.address=this.getChildValue(n)},City:function(n,t){t.city=this.getChildValue(n)},StateOrProvince:function(n,t){t.stateOrProvince=this.getChildValue(n)},PostCode:function(n,t){t.postcode=this.getChildValue(n)},Country:function(n,t){t.country=this.getChildValue(n)},ContactVoiceTelephone:function(n,t){t.phone=this.getChildValue(n)},ContactFacsimileTelephone:function(n,t){t.fax=this.getChildValue(n)},ContactElectronicMailAddress:function(n,t){t.email=this.getChildValue(n)},Fees:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.fees=i)},AccessConstraints:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.accessConstraints=i)},Capability:function(n,t){t.capability={nestedLayers:[],layers:[]},this.readChildNodes(n,t.capability)},Request:function(n,t){t.request={},this.readChildNodes(n,t.request)},GetCapabilities:function(n,t){t.getcapabilities={formats:[]},this.readChildNodes(n,t.getcapabilities)},Format:function(n,t){OpenLayers.Util.isArray(t.formats)?t.formats.push(this.getChildValue(n)):t.format=this.getChildValue(n)},DCPType:function(n,t){this.readChildNodes(n,t)},HTTP:function(n,t){this.readChildNodes(n,t)},Get:function(n,t){t.get={},this.readChildNodes(n,t.get),t.href||(t.href=t.get.href)},Post:function(n,t){t.post={},this.readChildNodes(n,t.post),t.href||(t.href=t.get.href)},GetMap:function(n,t){t.getmap={formats:[]},this.readChildNodes(n,t.getmap)},GetFeatureInfo:function(n,t){t.getfeatureinfo={formats:[]},this.readChildNodes(n,t.getfeatureinfo)},Exception:function(n,t){t.exception={formats:[]},this.readChildNodes(n,t.exception)},Layer:function(n,t){var i,e;t.capability?(e=t.capability,i=t):e=t;var u=n.getAttributeNode("queryable"),f=u&&u.specified?n.getAttribute("queryable"):null,o=(u=n.getAttributeNode("cascaded"))&&u.specified?n.getAttribute("cascaded"):null,u=(u=n.getAttributeNode("opaque"))&&u.specified?n.getAttribute("opaque"):null,h=n.getAttribute("noSubsets"),c=n.getAttribute("fixedWidth"),l=n.getAttribute("fixedHeight"),r=i||{},s=OpenLayers.Util.extend;i={nestedLayers:[],styles:i?[].concat(i.styles):[],srs:i?s({},r.srs):{},metadataURLs:[],bbox:i?s({},r.bbox):{},llbbox:r.llbbox,dimensions:i?s({},r.dimensions):{},authorityURLs:i?s({},r.authorityURLs):{},identifiers:{},keywords:[],queryable:f&&""!==f?"1"===f||"true"===f:r.queryable||!1,cascaded:null!==o?parseInt(o):r.cascaded||0,opaque:u?"1"===u||"true"===u:r.opaque||!1,noSubsets:null!==h?"1"===h||"true"===h:r.noSubsets||!1,fixedWidth:null!=c?parseInt(c):r.fixedWidth||0,fixedHeight:null!=l?parseInt(l):r.fixedHeight||0,minScale:r.minScale,maxScale:r.maxScale,attribution:r.attribution},t.nestedLayers.push(i),i.capability=e,this.readChildNodes(n,i),delete i.capability,i.name&&(f=i.name.split(":"),o=e.request,u=o.getfeatureinfo,0<f.length&&(i.prefix=f[0]),e.layers.push(i),void 0===i.formats&&(i.formats=o.getmap.formats),void 0===i.infoFormats&&u&&(i.infoFormats=u.formats))},Attribution:function(n,t){t.attribution={},this.readChildNodes(n,t.attribution)},LogoURL:function(n,t){t.logo={width:n.getAttribute("width"),height:n.getAttribute("height")},this.readChildNodes(n,t.logo)},Style:function(n,t){var i={};t.styles.push(i),this.readChildNodes(n,i)},LegendURL:function(n,t){var i={width:n.getAttribute("width"),height:n.getAttribute("height")};t.legend=i,this.readChildNodes(n,i)},MetadataURL:function(n,t){var i={type:n.getAttribute("type")};t.metadataURLs.push(i),this.readChildNodes(n,i)},DataURL:function(n,t){t.dataURL={},this.readChildNodes(n,t.dataURL)},FeatureListURL:function(n,t){t.featureListURL={},this.readChildNodes(n,t.featureListURL)},AuthorityURL:function(n,t){var r=n.getAttribute("name"),i={};this.readChildNodes(n,i),t.authorityURLs[r]=i.href},Identifier:function(n,t){var i=n.getAttribute("authority");t.identifiers[i]=this.getChildValue(n)},KeywordList:function(n,t){this.readChildNodes(n,t)},SRS:function(n,t){t.srs[this.getChildValue(n)]=!0}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1"}),OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMT_MS_Capabilities:function(n,t){this.readChildNodes(n,t)},Keyword:function(n,t){t.keywords&&t.keywords.push(this.getChildValue(n))},DescribeLayer:function(n,t){t.describelayer={formats:[]},this.readChildNodes(n,t.describelayer)},GetLegendGraphic:function(n,t){t.getlegendgraphic={formats:[]},this.readChildNodes(n,t.getlegendgraphic)},GetStyles:function(n,t){t.getstyles={formats:[]},this.readChildNodes(n,t.getstyles)},PutStyles:function(n,t){t.putstyles={formats:[]},this.readChildNodes(n,t.putstyles)},UserDefinedSymbolization:function(n,t){var i={supportSLD:1==parseInt(n.getAttribute("SupportSLD")),userLayer:1==parseInt(n.getAttribute("UserLayer")),userStyle:1==parseInt(n.getAttribute("UserStyle")),remoteWFS:1==parseInt(n.getAttribute("RemoteWFS"))};t.userSymbols=i},LatLonBoundingBox:function(n,t){t.llbbox=[parseFloat(n.getAttribute("minx")),parseFloat(n.getAttribute("miny")),parseFloat(n.getAttribute("maxx")),parseFloat(n.getAttribute("maxy"))]},BoundingBox:function(n,t){var i=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[n,t]);i.srs=n.getAttribute("SRS"),t.bbox[i.srs]=i},ScaleHint:function(n,t){var i=n.getAttribute("min"),r=n.getAttribute("max"),u=Math.pow(2,.5),f=OpenLayers.INCHES_PER_UNIT.m;0!=i&&(t.maxScale=parseFloat((i/u*f*OpenLayers.DOTS_PER_INCH).toPrecision(13))),r!=Number.POSITIVE_INFINITY&&(t.minScale=parseFloat((r/u*f*OpenLayers.DOTS_PER_INCH).toPrecision(13)))},Dimension:function(n,t){var i={name:n.getAttribute("name").toLowerCase(),units:n.getAttribute("units"),unitsymbol:n.getAttribute("unitSymbol")};t.dimensions[i.name]=i},Extent:function(n,t){var i=n.getAttribute("name").toLowerCase(),r;i in t.dimensions&&(i=t.dimensions[i],i.nearestVal="1"===n.getAttribute("nearestValue"),i.multipleVal="1"===n.getAttribute("multipleValues"),i.current="1"===n.getAttribute("current"),i["default"]=n.getAttribute("default")||"",r=this.getChildValue(n),i.values=r.split(","))}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1"}),OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.0",readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(n,t){for(var r=this.getChildValue(n).split(/ +/),i=0,u=r.length;i<u;i++)t.srs[r[i]]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"}),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,readFormat:null,readOptions:null,initialize:function(n){OpenLayers.Protocol.prototype.initialize.apply(this,[n]),n.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))),!n.geometryName&&1<parseFloat(this.format.version)&&this.setGeometryName(null)},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(n){OpenLayers.Protocol.prototype.read.apply(this,arguments),n=OpenLayers.Util.extend({},n),OpenLayers.Util.applyDefaults(n,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",n)]);return t.priv=OpenLayers.Request.POST({url:n.url,callback:this.createCallback(this.handleRead,t,n),params:n.params,headers:n.headers,data:i}),t},setFeatureType:function(n){this.featureType=n,this.format.featureType=n},setGeometryName:function(n){this.geometryName=n,this.format.geometryName=n},handleRead:function(n,t){if(t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options),t.callback){var i=n.priv;200<=i.status&&300>i.status?(i=this.parseResponse(i,t.readOptions))&&!1!==i.success?(t.readOptions&&"object"==t.readOptions.output?OpenLayers.Util.extend(n,i):n.features=i,n.code=OpenLayers.Protocol.Response.SUCCESS):(n.code=OpenLayers.Protocol.Response.FAILURE,n.error=i):n.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,n)}},parseResponse:function(n,t){var i=n.responseXML,r;return(i&&i.documentElement||(i=n.responseText),!i||0>=i.length)?null:(i=null!==this.readFormat?this.readFormat.read(i):this.format.read(i,t),this.featureNS||(r=this.readFormat||this.format,this.featureNS=r.featureNS,r.autoConfig=!1,this.geometryName||this.setGeometryName(r.geometryName)),i)},commit:function(n,t){t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:n});return i.priv=OpenLayers.Request.POST({url:t.url,headers:t.headers,data:this.format.write(n,t),callback:this.createCallback(this.handleCommit,i,t)}),i},handleCommit:function(n,t){if(t.callback){var i=n.priv,r=i.responseXML;r&&r.documentElement||(r=i.responseText),i=this.format.read(r)||{},n.insertIds=i.insertIds||[],i.success?n.code=OpenLayers.Protocol.Response.SUCCESS:(n.code=OpenLayers.Protocol.Response.FAILURE,n.error=i),t.callback.call(t.scope,n)}},filterDelete:function(n,t){var i,r,u;return t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options),new OpenLayers.Protocol.Response({requestType:"commit"}),i=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}}),r=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(t.featureNS?this.featurePrefix+":":"")+t.featureType}}),t.featureNS&&r.setAttribute("xmlns:"+this.featurePrefix,t.featureNS),u=this.format.writeNode("ogc:Filter",n),r.appendChild(u),i.appendChild(r),i=OpenLayers.Format.XML.prototype.write.apply(this.format,[i]),OpenLayers.Request.POST({url:this.url,callback:t.callback||function(){},data:i})},abort:function(n){n&&n.priv.abort()},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"}),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},touchstart:{"in":"click",out:"clickout"}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:!0,stopDown:!0,stopUp:!1,initialize:function(n,t,i,r){OpenLayers.Handler.prototype.initialize.apply(this,[n,i,r]),this.layer=t},touchstart:function(n){return this.startTouch(),OpenLayers.Event.isMultiTouch(n)?!0:this.mousedown(n)},touchmove:function(n){OpenLayers.Event.preventDefault(n)},mousedown:function(n){return(OpenLayers.Event.isLeftClick(n)||OpenLayers.Event.isSingleTouch(n))&&(this.down=n.xy),this.handle(n)?!this.stopDown:!0},mouseup:function(n){return this.up=n.xy,this.handle(n)?!this.stopUp:!0},click:function(n){return this.handle(n)?!this.stopClick:!0},mousemove:function(n){return!this.callbacks.over&&!this.callbacks.out?!0:(this.handle(n),!0)},dblclick:function(n){return!this.handle(n)},geometryTypeMatches:function(n){return null==this.geometryTypes||-1<OpenLayers.Util.indexOf(this.geometryTypes,n.geometry.CLASS_NAME)},handle:function(n){this.feature&&!this.feature.layer&&(this.feature=null);var t=n.type,u=!1,i=!!this.feature,r="click"==t||"dblclick"==t||"touchstart"==t;return(this.feature=this.layer.getFeatureFromEvent(n))&&!this.feature.layer&&(this.feature=null),this.lastFeature&&!this.lastFeature.layer&&(this.lastFeature=null),this.feature?("touchstart"===t&&OpenLayers.Event.preventDefault(n),n=this.feature!=this.lastFeature,this.geometryTypeMatches(this.feature)?(i&&n?(this.lastFeature&&this.triggerCallback(t,"out",[this.lastFeature]),this.triggerCallback(t,"in",[this.feature])):i&&!r||this.triggerCallback(t,"in",[this.feature]),this.lastFeature=this.feature,u=!0):(this.lastFeature&&(i&&n||r)&&this.triggerCallback(t,"out",[this.lastFeature]),this.feature=null)):this.lastFeature&&(i||r)&&this.triggerCallback(t,"out",[this.lastFeature]),u},triggerCallback:function(n,t,i){(t=this.EVENTMAP[n][t])&&("click"==n&&this.up&&this.down?(Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2))<=this.clickTolerance&&this.callback(t,i),this.up=this.down=null):this.callback(t,i))},activate:function(){var n=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.moveLayerBack(),this.up=this.down=this.lastFeature=this.feature=null,this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),n=!0),n},handleMapEvents:function(n){"removelayer"!=n.type&&"order"!=n.property||this.moveLayerToTop()},moveLayerToTop:function(){var n=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(n)},moveLayerBack:function(){var n=this.layer.getZIndex()-1;n>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(n):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Handler.Feature"}),OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:!1,layers:null,display:function(){},getFeatureFromEvent:function(n){for(var i=this.layers,r,t=0;t<i.length;t++)if(r=i[t].getFeatureFromEvent(n))return r},setMap:function(n){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments),this.collectRoots(),n.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(n){n.events.unregister("changelayer",this,this.handleChangeLayer),this.resetRoots(),OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){for(var n,t=0;t<this.map.layers.length;++t)n=this.map.layers[t],-1!=OpenLayers.Util.indexOf(this.layers,n)&&n.renderer.moveRoot(this.renderer)},resetRoots:function(){for(var n,t=0;t<this.layers.length;++t)n=this.layers[t],this.renderer&&n.renderer.getRenderLayerId()==this.id&&this.renderer.moveRoot(n.renderer)},handleChangeLayer:function(n){var t=n.layer;"order"==n.property&&-1!=OpenLayers.Util.indexOf(this.layers,t)&&(this.resetRoots(),this.collectRoots())},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"}),OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:!1,clickout:!0,toggle:!1,hover:!1,highlightOnly:!1,box:!1,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),null===this.scope&&(this.scope=this),this.initLayer(n);var i={click:this.clickFeature,clickout:this.clickoutFeature};this.hover&&(i.over=this.overFeature,i.out=this.outFeature),this.callbacks=OpenLayers.Util.extend(i,this.callbacks),this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})},this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"}))},initLayer:function(n){OpenLayers.Util.isArray(n)?(this.layers=n,this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:n})):this.layer=n},destroy:function(){this.active&&this.layers&&this.map.removeLayer(this.layer),OpenLayers.Control.prototype.destroy.apply(this,arguments),this.layers&&this.layer.destroy()},activate:function(){return this.active||(this.layers&&this.map.addLayer(this.layer),this.handlers.feature.activate(),this.box&&this.handlers.box&&this.handlers.box.activate()),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.active&&(this.handlers.feature.deactivate(),this.handlers.box&&this.handlers.box.deactivate(),this.layers&&this.map.removeLayer(this.layer)),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(n){for(var f=this.layers||[this.layer],t,u,i,r=0;r<f.length;++r)if(t=f[r],i=0,null!=t.selectedFeatures)for(;t.selectedFeatures.length>i;)u=t.selectedFeatures[i],n&&n.except==u?++i:this.unselect(u)},clickFeature:function(n){this.hover||(-1<OpenLayers.Util.indexOf(n.layer.selectedFeatures,n)?this.toggleSelect()?this.unselect(n):this.multipleSelect()||this.unselectAll({except:n}):(this.multipleSelect()||this.unselectAll({except:n}),this.select(n)))},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(){!this.hover&&this.clickout&&this.unselectAll()},overFeature:function(n){var t=n.layer;this.hover&&(this.highlightOnly?this.highlight(n):-1==OpenLayers.Util.indexOf(t.selectedFeatures,n)&&this.select(n))},outFeature:function(n){if(this.hover)if(this.highlightOnly){if(n._lastHighlighter==this.id)if(n._prevHighlighter&&n._prevHighlighter!=this.id){delete n._lastHighlighter;var t=this.map.getControl(n._prevHighlighter);t&&t.highlight(n)}else this.unhighlight(n)}else this.unselect(n)},highlight:function(n){var t=n.layer;!1!==this.events.triggerEvent("beforefeaturehighlighted",{feature:n})&&(n._prevHighlighter=n._lastHighlighter,n._lastHighlighter=this.id,t.drawFeature(n,this.selectStyle||this.renderIntent),this.events.triggerEvent("featurehighlighted",{feature:n}))},unhighlight:function(n){var t=n.layer;void 0==n._prevHighlighter?delete n._lastHighlighter:(n._prevHighlighter!=this.id&&(n._lastHighlighter=n._prevHighlighter),delete n._prevHighlighter),t.drawFeature(n,n.style||n.layer.style||"default"),this.events.triggerEvent("featureunhighlighted",{feature:n})},select:function(n){var i=this.onBeforeSelect.call(this.scope,n),t=n.layer;!1!==i&&(i=t.events.triggerEvent("beforefeatureselected",{feature:n}),!1!==i&&(t.selectedFeatures.push(n),this.highlight(n),this.handlers.feature.lastFeature||(this.handlers.feature.lastFeature=t.selectedFeatures[0]),t.events.triggerEvent("featureselected",{feature:n}),this.onSelect.call(this.scope,n)))},unselect:function(n){var t=n.layer;this.unhighlight(n),OpenLayers.Util.removeItem(t.selectedFeatures,n),t.events.triggerEvent("featureunselected",{feature:n}),this.onUnselect.call(this.scope,n)},selectBox:function(n){var i,r,u,f,e,o,t;if(n instanceof OpenLayers.Bounds){for(i=this.map.getLonLatFromPixel({x:n.left,y:n.bottom}),n=this.map.getLonLatFromPixel({x:n.right,y:n.top}),i=new OpenLayers.Bounds(i.lon,i.lat,n.lon,n.lat),this.multipleSelect()||this.unselectAll(),n=this.multiple,this.multiple=!0,r=this.layers||[this.layer],this.events.triggerEvent("boxselectionstart",{layers:r}),f=0;f<r.length;++f)for(u=r[f],e=0,o=u.features.length;e<o;++e)t=u.features[e],t.getVisibility()&&(null==this.geometryTypes||-1<OpenLayers.Util.indexOf(this.geometryTypes,t.geometry.CLASS_NAME))&&i.toGeometry().intersects(t.geometry)&&-1==OpenLayers.Util.indexOf(u.selectedFeatures,t)&&this.select(t);this.multiple=n,this.events.triggerEvent("boxselectionend",{layers:r})}},setMap:function(n){this.handlers.feature.setMap(n),this.box&&this.handlers.box.setMap(n),OpenLayers.Control.prototype.setMap.apply(this,arguments)},setLayer:function(n){var t=this.active;this.unselectAll(),this.deactivate(),this.layers&&(this.layer.destroy(),this.layers=null),this.initLayer(n),this.handlers.feature.layer=this.layer,t&&this.activate()},CLASS_NAME:"OpenLayers.Control.SelectFeature"}),OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:!1,citeCompliant:!1,mouseDown:!1,stoppedDown:null,lastDown:null,lastUp:null,persist:!1,stopDown:!1,stopUp:!1,layerOptions:null,pixelTolerance:5,lastTouchPx:null,initialize:function(n,t,i){i&&i.layerOptions&&i.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!1;var n=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions);return this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,n),this.map.addLayer(this.layer),!0},createFeature:function(n){n=this.layer.getLonLatFromViewPortPx(n),n=new OpenLayers.Geometry.Point(n.lon,n.lat),this.point=new OpenLayers.Feature.Vector(n),this.callback("create",[this.point.geometry,this.point]),this.point.geometry.clearBounds(),this.layer.addFeatures([this.point],{silent:!0})},deactivate:function(){return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)?(this.cancel(),null!=this.layer.map&&(this.destroyFeature(!0),this.layer.destroy(!1)),this.layer=null,!0):!1},destroyFeature:function(n){this.layer&&(n||!this.persist)&&this.layer.destroyFeatures(),this.point=null},destroyPersistedFeature:function(){var n=this.layer;n&&1<n.features.length&&this.layer.features[0].destroy()},finalize:function(n){this.mouseDown=!1,this.lastTouchPx=this.lastUp=this.lastDown=null,this.callback(n?"cancel":"done",[this.geometryClone()]),this.destroyFeature(n)},cancel:function(){this.finalize(!0)},click:function(n){return OpenLayers.Event.stop(n),!1},dblclick:function(n){return OpenLayers.Event.stop(n),!1},modifyFeature:function(n){this.point||this.createFeature(n),n=this.layer.getLonLatFromViewPortPx(n),this.point.geometry.x=n.lon,this.point.geometry.y=n.lat,this.callback("modify",[this.point.geometry,this.point,!1]),this.point.geometry.clearBounds(),this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var n=this.point&&this.point.geometry;return n&&this.multi&&(n=new OpenLayers.Geometry.MultiPoint([n])),n},geometryClone:function(){var n=this.getGeometry();return n&&n.clone()},mousedown:function(n){return this.down(n)},touchstart:function(n){return this.startTouch(),this.lastTouchPx=n.xy,this.down(n)},mousemove:function(n){return this.move(n)},touchmove:function(n){return this.lastTouchPx=n.xy,this.move(n)},mouseup:function(n){return this.up(n)},touchend:function(n){return n.xy=this.lastTouchPx,this.up(n)},down:function(n){return this.mouseDown=!0,this.lastDown=n.xy,this.touch||this.modifyFeature(n.xy),this.stoppedDown=this.stopDown,!this.stopDown},move:function(n){return this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(n.xy),!0},up:function(n){return(this.mouseDown=!1,this.stoppedDown=this.stopDown,!this.checkModifiers(n)||this.lastUp&&this.lastUp.equals(n.xy)||!this.lastDown||!this.passesTolerance(this.lastDown,n.xy,this.pixelTolerance))?!0:(this.touch&&this.modifyFeature(n.xy),this.persist&&this.destroyPersistedFeature(),this.lastUp=n.xy,this.finalize(),!this.stopUp)},mouseout:function(n){OpenLayers.Util.mouseLeft(n,this.map.viewPortDiv)&&(this.stoppedDown=this.stopDown,this.mouseDown=!1)},passesTolerance:function(n,t,i){var r=!0;return null!=i&&n&&t&&n.distanceTo(t)>i&&(r=!1),r},CLASS_NAME:"OpenLayers.Handler.Point"}),OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,maxVertices:null,doubleTouchTolerance:20,freehand:!1,freehandToggle:"shiftKey",timerId:null,redoStack:null,createFeature:function(n){n=this.layer.getLonLatFromViewPortPx(n),n=new OpenLayers.Geometry.Point(n.lon,n.lat),this.point=new OpenLayers.Feature.Vector(n),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:!0})},destroyFeature:function(n){OpenLayers.Handler.Point.prototype.destroyFeature.call(this,n),this.line=null},destroyPersistedFeature:function(){var n=this.layer;n&&2<n.features.length&&this.layer.features[0].destroy()},removePoint:function(){this.point&&this.layer.removeFeatures([this.point])},addPoint:function(n){this.layer.removeFeatures([this.point]),n=this.layer.getLonLatFromViewPortPx(n),this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(n.lon,n.lat)),this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length),this.layer.addFeatures([this.point]),this.callback("point",[this.point.geometry,this.getGeometry()]),this.callback("modify",[this.point.geometry,this.getSketch()]),this.drawFeature(),delete this.redoStack},insertXY:function(n,t){this.line.geometry.addComponent(new OpenLayers.Geometry.Point(n,t),this.getCurrentPointIndex()),this.drawFeature(),delete this.redoStack},insertDeltaXY:function(n,t){var i=this.getCurrentPointIndex()-1,i=this.line.geometry.components[i];!i||isNaN(i.x)||isNaN(i.y)||this.insertXY(i.x+n,i.y+t)},insertDirectionLength:function(n,t){n*=Math.PI/180;var i=t*Math.cos(n),r=t*Math.sin(n);this.insertDeltaXY(i,r)},insertDeflectionLength:function(n,t){var i=this.getCurrentPointIndex()-1;if(0<i){var r=this.line.geometry.components[i],i=this.line.geometry.components[i-1],r=Math.atan2(r.y-i.y,r.x-i.x);this.insertDirectionLength(180*r/Math.PI+n,t)}},getCurrentPointIndex:function(){return this.line.geometry.components.length-1},undo:function(){var t=this.line.geometry,n=t.components,i=this.getCurrentPointIndex()-1,r=n[i],u=t.removeComponent(r);return u&&(this.touch&&0<i&&(n=t.components,t=n[i-1],i=this.getCurrentPointIndex(),n=n[i],n.x=t.x,n.y=t.y),this.redoStack||(this.redoStack=[]),this.redoStack.push(r),this.drawFeature()),u},redo:function(){var n=this.redoStack&&this.redoStack.pop();return n&&(this.line.geometry.addComponent(n,this.getCurrentPointIndex()),this.drawFeature()),!!n},freehandMode:function(n){return this.freehandToggle&&n[this.freehandToggle]?!this.freehand:this.freehand},modifyFeature:function(n,t){this.line||this.createFeature(n);var i=this.layer.getLonLatFromViewPortPx(n);this.point.geometry.x=i.lon,this.point.geometry.y=i.lat,this.callback("modify",[this.point.geometry,this.getSketch(),t]),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 n=this.line&&this.line.geometry;return n&&this.multi&&(n=new OpenLayers.Geometry.MultiLineString([n])),n},touchstart:function(n){return this.timerId&&this.passesTolerance(this.lastTouchPx,n.xy,this.doubleTouchTolerance)?(this.finishGeometry(),window.clearTimeout(this.timerId),this.timerId=null,!1):(this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null),this.timerId=window.setTimeout(OpenLayers.Function.bind(function(){this.timerId=null},this),300),OpenLayers.Handler.Point.prototype.touchstart.call(this,n))},down:function(n){var t=this.stopDown;return this.freehandMode(n)&&(t=!0,this.touch&&(this.modifyFeature(n.xy,!!this.lastUp),OpenLayers.Event.stop(n))),this.touch||this.lastDown&&this.passesTolerance(this.lastDown,n.xy,this.pixelTolerance)||this.modifyFeature(n.xy,!!this.lastUp),this.mouseDown=!0,this.lastDown=n.xy,this.stoppedDown=t,!t},move:function(n){return this.stoppedDown&&this.freehandMode(n)?(this.persist&&this.destroyPersistedFeature(),this.maxVertices&&this.line&&this.line.geometry.components.length===this.maxVertices?(this.removePoint(),this.finalize()):this.addPoint(n.xy),!1):(this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(n.xy,!!this.lastUp),!0)},up:function(n){return!this.mouseDown||this.lastUp&&this.lastUp.equals(n.xy)||(this.stoppedDown&&this.freehandMode(n)?(this.persist&&this.destroyPersistedFeature(),this.removePoint(),this.finalize()):this.passesTolerance(this.lastDown,n.xy,this.pixelTolerance)&&(this.touch&&this.modifyFeature(n.xy),null==this.lastUp&&this.persist&&this.destroyPersistedFeature(),this.addPoint(n.xy),this.lastUp=n.xy,this.line.geometry.components.length===this.maxVertices+1&&this.finishGeometry())),this.stoppedDown=this.stopDown,this.mouseDown=!1,!this.stopUp},finishGeometry:function(){this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length-1]),this.removePoint(),this.finalize()},dblclick:function(n){return this.freehandMode(n)||this.finishGeometry(),!1},CLASS_NAME:"OpenLayers.Handler.Path"}),OpenLayers.Spherical=OpenLayers.Spherical||{},OpenLayers.Spherical.DEFAULT_RADIUS=6378137,OpenLayers.Spherical.computeDistanceBetween=function(n,t,i){i=i||OpenLayers.Spherical.DEFAULT_RADIUS;var r=Math.sin(Math.PI*(t.lon-n.lon)/360),u=Math.sin(Math.PI*(t.lat-n.lat)/360);return n=u*u+r*r*Math.cos(Math.PI*n.lat/180)*Math.cos(Math.PI*t.lat/180),2*i*Math.atan2(Math.sqrt(n),Math.sqrt(1-n))},OpenLayers.Spherical.computeHeading=function(n,t){var i=Math.sin(Math.PI*(n.lon-t.lon)/180)*Math.cos(Math.PI*t.lat/180),r=Math.cos(Math.PI*n.lat/180)*Math.sin(Math.PI*t.lat/180)-Math.sin(Math.PI*n.lat/180)*Math.cos(Math.PI*t.lat/180)*Math.cos(Math.PI*(n.lon-t.lon)/180);return 180*Math.atan2(i,r)/Math.PI},OpenLayers.Control.CacheWrite=OpenLayers.Class(OpenLayers.Control,{layers:null,imageFormat:"image/png",quotaRegEx:/quota/i,setMap:function(n){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var i=this.layers||n.layers,t=i.length-1;0<=t;--t)this.addLayer({layer:i[t]});if(!this.layers)n.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})},addLayer:function(n){n.layer.events.on({tileloadstart:this.makeSameOrigin,tileloaded:this.onTileLoaded,scope:this})},removeLayer:function(n){n.layer.events.un({tileloadstart:this.makeSameOrigin,tileloaded:this.onTileLoaded,scope:this})},makeSameOrigin:function(n){if(this.active&&(n=n.tile,n instanceof OpenLayers.Tile.Image&&!n.crossOriginKeyword&&"data:"!==n.url.substr(0,5))){var t=OpenLayers.Request.makeSameOrigin(n.url,OpenLayers.ProxyHost);OpenLayers.Control.CacheWrite.urlMap[t]=n.url,n.url=t}},onTileLoaded:function(n){this.active&&!n.aborted&&n.tile instanceof OpenLayers.Tile.Image&&"data:"!==n.tile.url.substr(0,5)&&(this.cache({tile:n.tile}),delete OpenLayers.Control.CacheWrite.urlMap[n.tile.url])},cache:function(n){if(window.localStorage){n=n.tile;try{var t=n.getCanvasContext();t&&window.localStorage.setItem("olCache_"+(OpenLayers.Control.CacheWrite.urlMap[n.url]||n.url),t.canvas.toDataURL(this.imageFormat))}catch(i){(t=i.name||i.message)&&this.quotaRegEx.test(t)?this.events.triggerEvent("cachefull",{tile:n}):OpenLayers.Console.error(i.toString())}}},destroy:function(){if(this.layers||this.map)for(var t=this.layers||this.map.layers,n=t.length-1;0<=n;--n)this.removeLayer({layer:t[n]});this.map&&this.map.events.un({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.CacheWrite"}),OpenLayers.Control.CacheWrite.clearCache=function(){if(window.localStorage)for(var t,n=window.localStorage.length-1;0<=n;--n)t=window.localStorage.key(n),"olCache_"===t.substr(0,8)&&window.localStorage.removeItem(t)},OpenLayers.Control.CacheWrite.urlMap={},OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{slideFactor:50,slideRatio:null,initialize:function(n){OpenLayers.Control.Panel.prototype.initialize.apply(this,[n]),n={slideFactor:this.slideFactor,slideRatio:this.slideRatio},this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,n),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,n),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,n),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,n)])},CLASS_NAME:"OpenLayers.Control.PanPanel"}),OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",template:"${layers}",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});return this.updateAttribution(),this.div},updateAttribution:function(){var i=[],t,r,n;if(this.map&&this.map.layers){for(t=0,r=this.map.layers.length;t<r;t++)n=this.map.layers[t],n.attribution&&n.getVisibility()&&-1===OpenLayers.Util.indexOf(i,n.attribution)&&i.push(n.attribution);this.div.innerHTML=OpenLayers.String.format(this.template,{layers:i.join(this.separator)})}},CLASS_NAME:"OpenLayers.Control.Attribution"}),OpenLayers.Kinetic=OpenLayers.Class({threshold:0,deceleration:.0035,nbPoints:100,delay:200,points:void 0,timerId:void 0,initialize:function(n){OpenLayers.Util.extend(this,n)},begin:function(){OpenLayers.Animation.stop(this.timerId),this.timerId=void 0,this.points=[]},update:function(n){this.points.unshift({xy:n,tick:+new Date}),this.points.length>this.nbPoints&&this.points.pop()},end:function(n){for(var r,i=+new Date,t=0,f=this.points.length,u;t<f;t++){if(u=this.points[t],i-u.tick>this.delay)break;r=u}if(r&&(t=+new Date-r.tick,i=Math.sqrt(Math.pow(n.x-r.xy.x,2)+Math.pow(n.y-r.xy.y,2)),t=i/t,!(0==t||t<this.threshold)))return i=Math.asin((n.y-r.xy.y)/i),r.xy.x<=n.x&&(i=Math.PI-i),{speed:t,theta:i}},move:function(n,t){var i=n.speed,f=Math.cos(n.theta),e=-Math.sin(n.theta),o=+new Date,r=0,u=0;this.timerId=OpenLayers.Animation.start(OpenLayers.Function.bind(function(){if(null!=this.timerId){var n=+new Date-o,s=-this.deceleration*Math.pow(n,2)/2+i*n,c=s*f,s=s*e,h,l;h=!1,0>=-this.deceleration*n+i&&(OpenLayers.Animation.stop(this.timerId),this.timerId=null,h=!0),n=c-r,l=s-u,r=c,u=s,t(n,l,h)}},this))},CLASS_NAME:"OpenLayers.Kinetic"}),OpenLayers.Format.WPSExecute=OpenLayers.Class(OpenLayers.Format.XML,OpenLayers.Format.Filter.v1_1_0,{namespaces:{ows:"http://www.opengis.net/ows/1.1",gml:"http://www.opengis.net/gml",wps:"http://www.opengis.net/wps/1.0.0",wfs:"http://www.opengis.net/wfs",ogc:"http://www.opengis.net/ogc",wcs:"http://www.opengis.net/wcs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",schemaLocationAttr:function(){},write:function(n){var t;return window.ActiveXObject?this.xmldom=t=new ActiveXObject("Microsoft.XMLDOM"):t=document.implementation.createDocument("","",null),n=this.writeNode("wps:Execute",n,t),this.setAttributeNS(n,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},writers:{wps:{Execute:function(n){var t=this.createElementNSPlus("wps:Execute",{attributes:{version:this.VERSION,service:"WPS"}});return this.writeNode("ows:Identifier",n.identifier,t),this.writeNode("wps:DataInputs",n.dataInputs,t),this.writeNode("wps:ResponseForm",n.responseForm,t),t},ResponseForm:function(n){var t=this.createElementNSPlus("wps:ResponseForm",{});return n.rawDataOutput&&this.writeNode("wps:RawDataOutput",n.rawDataOutput,t),n.responseDocument&&this.writeNode("wps:ResponseDocument",n.responseDocument,t),t},ResponseDocument:function(n){var i=this.createElementNSPlus("wps:ResponseDocument",{attributes:{storeExecuteResponse:n.storeExecuteResponse,lineage:n.lineage,status:n.status}}),t,r;if(n.outputs)for(t=0,r=n.outputs.length;t<r;t++)this.writeNode("wps:Output",n.outputs[t],i);return i},Output:function(n){var t=this.createElementNSPlus("wps:Output",{attributes:{asReference:n.asReference,mimeType:n.mimeType,encoding:n.encoding,schema:n.schema}});return this.writeNode("ows:Identifier",n.identifier,t),this.writeNode("ows:Title",n.title,t),this.writeNode("ows:Abstract",n.abstract,t),t},RawDataOutput:function(n){var t=this.createElementNSPlus("wps:RawDataOutput",{attributes:{mimeType:n.mimeType,encoding:n.encoding,schema:n.schema}});return this.writeNode("ows:Identifier",n.identifier,t),t},DataInputs:function(n){for(var i=this.createElementNSPlus("wps:DataInputs",{}),t=0,r=n.length;t<r;++t)this.writeNode("wps:Input",n[t],i);return i},Input:function(n){var t=this.createElementNSPlus("wps:Input",{});return this.writeNode("ows:Identifier",n.identifier,t),n.title&&this.writeNode("ows:Title",n.title,t),n.data&&this.writeNode("wps:Data",n.data,t),n.reference&&this.writeNode("wps:Reference",n.reference,t),n.boundingBoxData&&this.writeNode("wps:BoundingBoxData",n.boundingBoxData,t),t},Data:function(n){var t=this.createElementNSPlus("wps:Data",{});return n.literalData?this.writeNode("wps:LiteralData",n.literalData,t):n.complexData?this.writeNode("wps:ComplexData",n.complexData,t):n.boundingBoxData&&this.writeNode("ows:BoundingBox",n.boundingBoxData,t),t},LiteralData:function(n){return this.createElementNSPlus("wps:LiteralData",{attributes:{uom:n.uom},value:n.value})},ComplexData:function(n){var t=this.createElementNSPlus("wps:ComplexData",{attributes:{mimeType:n.mimeType,encoding:n.encoding,schema:n.schema}}),i=n.value;return"string"==typeof i?t.appendChild(this.getXMLDoc().createCDATASection(n.value)):t.appendChild(i),t},Reference:function(n){var t=this.createElementNSPlus("wps:Reference",{attributes:{mimeType:n.mimeType,"xlink:href":n.href,method:n.method,encoding:n.encoding,schema:n.schema}});return n.body&&this.writeNode("wps:Body",n.body,t),t},BoundingBoxData:function(n,t){this.writers.ows.BoundingBox.apply(this,[n,t,"wps:BoundingBoxData"])},Body:function(n){var t=this.createElementNSPlus("wps:Body",{});return n.wcs?this.writeNode("wcs:GetCoverage",n.wcs,t):n.wfs?(this.featureType=n.wfs.featureType,this.version=n.wfs.version,this.writeNode("wfs:GetFeature",n.wfs,t)):this.writeNode("wps:Execute",n,t),t}},wcs:OpenLayers.Format.WCSGetCoverage.prototype.writers.wcs,wfs:OpenLayers.Format.WFST.v1_1_0.prototype.writers.wfs,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc,ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},readers:{wps:{ExecuteResponse:function(n,t){t.executeResponse={lang:n.getAttribute("lang"),statusLocation:n.getAttribute("statusLocation"),serviceInstance:n.getAttribute("serviceInstance"),service:n.getAttribute("service")},this.readChildNodes(n,t.executeResponse)},Process:function(n,t){t.process={},this.readChildNodes(n,t.process)},Status:function(n,t){t.status={creationTime:n.getAttribute("creationTime")},this.readChildNodes(n,t.status)},ProcessSucceeded:function(n,t){t.processSucceeded=!0},ProcessOutputs:function(n,t){t.processOutputs=[],this.readChildNodes(n,t.processOutputs)},Output:function(n,t){var i={};this.readChildNodes(n,i),t.push(i)},Reference:function(n,t){t.reference={href:n.getAttribute("href"),mimeType:n.getAttribute("mimeType"),encoding:n.getAttribute("encoding"),schema:n.getAttribute("schema")}},Data:function(n,t){t.data={},this.readChildNodes(n,t)},LiteralData:function(n,t){t.literalData={dataType:n.getAttribute("dataType"),uom:n.getAttribute("uom"),value:this.getChildValue(n)}},ComplexData:function(n,t){if(t.complexData={mimeType:n.getAttribute("mimeType"),schema:n.getAttribute("schema"),encoding:n.getAttribute("encoding"),value:""},this.isSimpleContent(n))for(var i=n.firstChild;i;i=i.nextSibling)switch(i.nodeType){case 3:case 4:t.complexData.value+=i.nodeValue}else for(i=n.firstChild;i;i=i.nextSibling)1==i.nodeType&&(t.complexData.value=i)},BoundingBox:function(n,t){t.boundingBoxData={dimensions:n.getAttribute("dimensions"),crs:n.getAttribute("crs")},this.readChildNodes(n,t.boundingBoxData)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSExecute"}),OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:!0,initialize:function(n,t,i){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[n,i]),this.location=t,this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments),this.clearFeatures(),this.features=null},loadRSS:function(){this.loaded||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this}),this.loaded=!0)},moveTo:function(){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),this.visibility&&!this.loaded&&this.loadRSS()},parseData:function(n){var u=n.responseXML,s,r,t,i;if(u&&u.documentElement||(u=OpenLayers.Format.XML.prototype.read(n.responseText)),this.useFeedTitle){n=null;try{n=u.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(h){n=u.getElementsByTagName("title")[0].firstChild.nodeValue}n&&this.setName(n)}for(n={},OpenLayers.Util.extend(n,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(n.externalProjection=this.projection,n.internalProjection=this.map.getProjectionObject()),u=new OpenLayers.Format.GeoRSS(n).read(u),n=0,s=u.length;n<s;n++)if(r={},t=u[n],t.geometry){var f=t.attributes.title?t.attributes.title:"Untitled",e=t.attributes.description?t.attributes.description:"No description.",o=t.attributes.link?t.attributes.link:"",t=t.geometry.getBounds().getCenterLonLat();r.icon=null==this.icon?OpenLayers.Marker.defaultIcon():this.icon.clone(),r.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120),(f||e)&&(r.title=f,r.description=e,i='<div class="olLayerGeoRSSClose">[x]<\/div>',i=i+'<div class="olLayerGeoRSSTitle">',o&&(i+='<a class="link" href="'+o+'" target="_blank">'),i+=f,o&&(i+="<\/a>"),i+="<\/div>",i+='<div style="" class="olLayerGeoRSSDescription">',i+=e,i+="<\/div>",r.popupContentHTML=i),t=new OpenLayers.Feature(this,t,r),this.features.push(t),r=t.createMarker(),r.events.register("click",t,this.markerClick),this.addMarker(r)}this.events.triggerEvent("loadend")},markerClick:function(n){var t=this==this.layer.selectedFeature,i,r;for(this.layer.selectedFeature=t?null:this,i=0,r=this.layer.map.popups.length;i<r;i++)this.layer.map.removePopup(this.layer.map.popups[i]);t||(t=this.createPopup(),OpenLayers.Event.observe(t.div,"click",OpenLayers.Function.bind(function(){for(var n=0,t=this.layer.map.popups.length;n<t;n++)this.layer.map.removePopup(this.layer.map.popups[n])},this)),this.layer.map.addPopup(t)),OpenLayers.Event.stop(n)},clearFeatures:function(){if(null!=this.features)for(;0<this.features.length;){var n=this.features[0];OpenLayers.Util.removeItem(this.features,n),n.destroy()}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"}),OpenLayers.Format.WMSCapabilities.v1_3=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMS_Capabilities:function(n,t){this.readChildNodes(n,t)},LayerLimit:function(n,t){t.layerLimit=parseInt(this.getChildValue(n))},MaxWidth:function(n,t){t.maxWidth=parseInt(this.getChildValue(n))},MaxHeight:function(n,t){t.maxHeight=parseInt(this.getChildValue(n))},BoundingBox:function(n,t){var i=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[n,t]);i.srs=n.getAttribute("CRS"),t.bbox[i.srs]=i},CRS:function(n,t){this.readers.wms.SRS.apply(this,[n,t])},EX_GeographicBoundingBox:function(n,t){t.llbbox=[],this.readChildNodes(n,t.llbbox)},westBoundLongitude:function(n,t){t[0]=this.getChildValue(n)},eastBoundLongitude:function(n,t){t[2]=this.getChildValue(n)},southBoundLatitude:function(n,t){t[1]=this.getChildValue(n)},northBoundLatitude:function(n,t){t[3]=this.getChildValue(n)},MinScaleDenominator:function(n,t){t.maxScale=parseFloat(this.getChildValue(n)).toPrecision(16)},MaxScaleDenominator:function(n,t){t.minScale=parseFloat(this.getChildValue(n)).toPrecision(16)},Dimension:function(n,t){var i={name:n.getAttribute("name").toLowerCase(),units:n.getAttribute("units"),unitsymbol:n.getAttribute("unitSymbol"),nearestVal:"1"===n.getAttribute("nearestValue"),multipleVal:"1"===n.getAttribute("multipleValues"),"default":n.getAttribute("default")||"",current:"1"===n.getAttribute("current"),values:this.getChildValue(n).split(",")};t.dimensions[i.name]=i},Keyword:function(n,t){var i={value:this.getChildValue(n),vocabulary:n.getAttribute("vocabulary")};t.keywords&&t.keywords.push(i)}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms),sld:{UserDefinedSymbolization:function(n,t){this.readers.wms.UserDefinedSymbolization.apply(this,[n,t]),t.userSymbols.inlineFeature=1==parseInt(n.getAttribute("InlineFeature")),t.userSymbols.remoteWCS=1==parseInt(n.getAttribute("RemoteWCS"))},DescribeLayer:function(n,t){this.readers.wms.DescribeLayer.apply(this,[n,t])},GetLegendGraphic:function(n,t){this.readers.wms.GetLegendGraphic.apply(this,[n,t])}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3"}),OpenLayers.Format.SOSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.SOSCapabilities"}),OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"},isBaseLayer:!0,encodeBBOX:!1,noMagic:!1,yx:{},initialize:function(n,t,i,r){var u=[];i=OpenLayers.Util.upperCaseObject(i),1.3<=parseFloat(i.VERSION)&&!i.EXCEPTIONS&&(i.EXCEPTIONS="INIMAGE"),u.push(n,t,i,r),OpenLayers.Layer.Grid.prototype.initialize.apply(this,u),OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)),!this.noMagic&&this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase()&&(null!=r&&r.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"))},clone:function(n){return null==n&&(n=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},reverseAxisOrder:function(){var n=this.projection.getCode();return 1.3<=parseFloat(this.params.VERSION)&&!!(this.yx[n]||OpenLayers.Projection.defaults[n]&&OpenLayers.Projection.defaults[n].yx)},getURL:function(n){n=this.adjustBounds(n);var i=this.getImageSize(),t={},r=this.reverseAxisOrder();return t.BBOX=this.encodeBBOX?n.toBBOX(null,r):n.toArray(r),t.WIDTH=i.w,t.HEIGHT=i.h,this.getFullRequestString(t)},mergeNewParams:function(n){return n=[OpenLayers.Util.upperCaseObject(n)],OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,n)},getFullRequestString:function(n){var i=this.map.getProjectionObject(),i=this.projection&&this.projection.equals(i)?this.projection.getCode():i.getCode(),i="none"==i?null:i;return 1.3<=parseFloat(this.params.VERSION)?this.params.CRS=i:this.params.SRS=i,"boolean"==typeof this.params.TRANSPARENT&&(n.TRANSPARENT=this.params.TRANSPARENT?"TRUE":"FALSE"),OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"}),OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(n){n=this.adjustBounds(n);var t=this.map.getResolution(),i=Math.round(1e4*this.map.getScale())/1e4,r=Math.round(n.left/t);return n=-Math.round(n.top/t),this.getFullRequestString({t:n,l:r,s:i})},calculateGridLayout:function(n,t,i){return t=i*this.tileSize.w,i*=this.tileSize.h,{tilelon:t,tilelat:i,startcol:Math.floor(n.left/t)-this.buffer,startrow:Math.floor(n.top/i)+this.buffer}},getTileBoundsForGridIndex:function(n,t){this.getTileOrigin();var i=this.gridLayout,r=i.tilelon,u=i.tilelat,f=(i.startcol+t)*r,i=(i.startrow-n)*u;return new OpenLayers.Bounds(f,i,f+r,i+u)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n]),null!=this.tileSize&&(n.tileSize=this.tileSize.clone()),n.grid=[],n},getTileBounds:function(n){var t=this.getResolution(),r=t*this.tileSize.w,t=t*this.tileSize.h,i=this.getLonLatFromViewPortPx(n);return n=r*Math.floor(i.lon/r),i=t*Math.floor(i.lat/t),new OpenLayers.Bounds(n,i,n+r,i+t)},CLASS_NAME:"OpenLayers.Layer.KaMap"}),OpenLayers.Format.WMC=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"1.1.0",layerToContext:function(n){var t=this.getParser(),r={queryable:n.queryable,visibility:n.visibility,name:n.params.LAYERS,title:n.name,abstract:n.metadata.abstract,dataURL:n.metadata.dataURL,metadataURL:n.metadataURL,server:{version:n.params.VERSION,url:n.url},maxExtent:n.maxExtent,transparent:n.params.TRANSPARENT,numZoomLevels:n.numZoomLevels,units:n.units,isBaseLayer:n.isBaseLayer,opacity:1==n.opacity?void 0:n.opacity,displayInLayerSwitcher:n.displayInLayerSwitcher,singleTile:n.singleTile,tileSize:n.singleTile||!n.tileSize?void 0:{width:n.tileSize.w,height:n.tileSize.h},minScale:n.options.resolutions||n.options.scales||n.options.maxResolution||n.options.minScale?n.minScale:void 0,maxScale:n.options.resolutions||n.options.scales||n.options.minResolution||n.options.maxScale?n.maxScale:void 0,formats:[],styles:[],srs:n.srs,dimensions:n.dimensions},i,u,f;if(n.metadata.servertitle&&(r.server.title=n.metadata.servertitle),n.metadata.formats&&0<n.metadata.formats.length)for(i=0,u=n.metadata.formats.length;i<u;i++)f=n.metadata.formats[i],r.formats.push({value:f.value,current:f.value==n.params.FORMAT});else r.formats.push({value:n.params.FORMAT,current:!0});if(n.metadata.styles&&0<n.metadata.styles.length)for(i=0,u=n.metadata.styles.length;i<u;i++)t=n.metadata.styles[i],t.current=t.href==n.params.SLD||t.body==n.params.SLD_BODY||t.name==n.params.STYLES?!0:!1,r.styles.push(t);else r.styles.push({href:n.params.SLD,body:n.params.SLD_BODY,name:n.params.STYLES||t.defaultStyleName,title:t.defaultStyleTitle,current:!0});return r},toContext:function(n){var t={},r=n.layers,i,u;if("OpenLayers.Map"==n.CLASS_NAME?(i=n.metadata||{},t.size=n.getSize(),t.bounds=n.getExtent(),t.projection=n.projection,t.title=n.title,t.keywords=i.keywords,t.abstract=i.abstract,t.logo=i.logo,t.descriptionURL=i.descriptionURL,t.contactInformation=i.contactInformation,t.maxExtent=n.maxExtent):(OpenLayers.Util.applyDefaults(t,n),void 0!=t.layers&&delete t.layers),void 0==t.layersContext&&(t.layersContext=[]),void 0!=r&&OpenLayers.Util.isArray(r))for(n=0,i=r.length;n<i;n++)u=r[n],u instanceof OpenLayers.Layer.WMS&&t.layersContext.push(this.layerToContext(u));return t},CLASS_NAME:"OpenLayers.Format.WMC"}),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(n){var t=null;if(null==n)t=this.namespaces[this.defaultPrefix];else for(t in this.namespaces)if(this.namespaces[t]==n)break;return t},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"Default",initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n=n.documentElement,this.rootPrefix=n.prefix;var t={version:n.getAttribute("version")};return this.runChildNodes(t,n),t},runChildNodes:function(n,t){for(var f=t.childNodes,i,r,e,u=0,o=f.length;u<o;++u)i=f[u],1==i.nodeType&&(r=this.getNamespacePrefix(i.namespaceURI),e=i.nodeName.split(":").pop(),(r=this["read_"+r+"_"+e])&&r.apply(this,[n,i]))},read_wmc_General:function(n,t){this.runChildNodes(n,t)},read_wmc_BoundingBox:function(n,t){n.projection=t.getAttribute("SRS"),n.bounds=new OpenLayers.Bounds(t.getAttribute("minx"),t.getAttribute("miny"),t.getAttribute("maxx"),t.getAttribute("maxy"))},read_wmc_LayerList:function(n,t){n.layersContext=[],this.runChildNodes(n,t)},read_wmc_Layer:function(n,t){var i={visibility:"1"!=t.getAttribute("hidden"),queryable:"1"==t.getAttribute("queryable"),formats:[],styles:[],metadata:{}};this.runChildNodes(i,t),n.layersContext.push(i)},read_wmc_Extension:function(n,t){this.runChildNodes(n,t)},read_ol_units:function(n,t){n.units=this.getChildValue(t)},read_ol_maxExtent:function(n,t){var i=new OpenLayers.Bounds(t.getAttribute("minx"),t.getAttribute("miny"),t.getAttribute("maxx"),t.getAttribute("maxy"));n.maxExtent=i},read_ol_transparent:function(n,t){n.transparent=this.getChildValue(t)},read_ol_numZoomLevels:function(n,t){n.numZoomLevels=parseInt(this.getChildValue(t))},read_ol_opacity:function(n,t){n.opacity=parseFloat(this.getChildValue(t))},read_ol_singleTile:function(n,t){n.singleTile="true"==this.getChildValue(t)},read_ol_tileSize:function(n,t){var i={width:t.getAttribute("width"),height:t.getAttribute("height")};n.tileSize=i},read_ol_isBaseLayer:function(n,t){n.isBaseLayer="true"==this.getChildValue(t)},read_ol_displayInLayerSwitcher:function(n,t){n.displayInLayerSwitcher="true"==this.getChildValue(t)},read_wmc_Server:function(n,t){n.version=t.getAttribute("version"),n.url=this.getOnlineResource_href(t),n.metadata.servertitle=t.getAttribute("title")},read_wmc_FormatList:function(n,t){this.runChildNodes(n,t)},read_wmc_Format:function(n,t){var i={value:this.getChildValue(t)};"1"==t.getAttribute("current")&&(i.current=!0),n.formats.push(i)},read_wmc_StyleList:function(n,t){this.runChildNodes(n,t)},read_wmc_Style:function(n,t){var i={};this.runChildNodes(i,t),"1"==t.getAttribute("current")&&(i.current=!0),n.styles.push(i)},read_wmc_SLD:function(n,t){this.runChildNodes(n,t)},read_sld_StyledLayerDescriptor:function(n,t){var i=OpenLayers.Format.XML.prototype.write.apply(this,[t]);n.body=i},read_sld_FeatureTypeStyle:function(n,t){var i=OpenLayers.Format.XML.prototype.write.apply(this,[t]);n.body=i},read_wmc_OnlineResource:function(n,t){n.href=this.getAttributeNS(t,this.namespaces.xlink,"href")},read_wmc_Name:function(n,t){var i=this.getChildValue(t);i&&(n.name=i)},read_wmc_Title:function(n,t){var i=this.getChildValue(t);i&&(n.title=i)},read_wmc_MetadataURL:function(n,t){n.metadataURL=this.getOnlineResource_href(t)},read_wmc_KeywordList:function(n,t){n.keywords=[],this.runChildNodes(n.keywords,t)},read_wmc_Keyword:function(n,t){n.push(this.getChildValue(t))},read_wmc_Abstract:function(n,t){var i=this.getChildValue(t);i&&(n.abstract=i)},read_wmc_LogoURL:function(n,t){n.logo={width:t.getAttribute("width"),height:t.getAttribute("height"),format:t.getAttribute("format"),href:this.getOnlineResource_href(t)}},read_wmc_DescriptionURL:function(n,t){n.descriptionURL=this.getOnlineResource_href(t)},read_wmc_ContactInformation:function(n,t){var i={};this.runChildNodes(i,t),n.contactInformation=i},read_wmc_ContactPersonPrimary:function(n,t){var i={};this.runChildNodes(i,t),n.personPrimary=i},read_wmc_ContactPerson:function(n,t){var i=this.getChildValue(t);i&&(n.person=i)},read_wmc_ContactOrganization:function(n,t){var i=this.getChildValue(t);i&&(n.organization=i)},read_wmc_ContactPosition:function(n,t){var i=this.getChildValue(t);i&&(n.position=i)},read_wmc_ContactAddress:function(n,t){var i={};this.runChildNodes(i,t),n.contactAddress=i},read_wmc_AddressType:function(n,t){var i=this.getChildValue(t);i&&(n.type=i)},read_wmc_Address:function(n,t){var i=this.getChildValue(t);i&&(n.address=i)},read_wmc_City:function(n,t){var i=this.getChildValue(t);i&&(n.city=i)},read_wmc_StateOrProvince:function(n,t){var i=this.getChildValue(t);i&&(n.stateOrProvince=i)},read_wmc_PostCode:function(n,t){var i=this.getChildValue(t);i&&(n.postcode=i)},read_wmc_Country:function(n,t){var i=this.getChildValue(t);i&&(n.country=i)},read_wmc_ContactVoiceTelephone:function(n,t){var i=this.getChildValue(t);i&&(n.phone=i)},read_wmc_ContactFacsimileTelephone:function(n,t){var i=this.getChildValue(t);i&&(n.fax=i)},read_wmc_ContactElectronicMailAddress:function(n,t){var i=this.getChildValue(t);i&&(n.email=i)},read_wmc_DataURL:function(n,t){n.dataURL=this.getOnlineResource_href(t)},read_wmc_LegendURL:function(n,t){var i={width:t.getAttribute("width"),height:t.getAttribute("height"),format:t.getAttribute("format"),href:this.getOnlineResource_href(t)};n.legend=i},read_wmc_DimensionList:function(n,t){n.dimensions={},this.runChildNodes(n.dimensions,t)},read_wmc_Dimension:function(n,t){var i={name:t.getAttribute("name").toLowerCase(),units:t.getAttribute("units")||"",unitSymbol:t.getAttribute("unitSymbol")||"",userValue:t.getAttribute("userValue")||"",nearestValue:"1"===t.getAttribute("nearestValue"),multipleValues:"1"===t.getAttribute("multipleValues"),current:"1"===t.getAttribute("current"),"default":t.getAttribute("default")||""},r=this.getChildValue(t);i.values=r.split(","),n[i.name]=i},write:function(n,t){var i=this.createElementDefaultNS("ViewContext");return this.setAttributes(i,{version:this.VERSION,id:t&&"string"==typeof t.id?t.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")}),this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),i.appendChild(this.write_wmc_General(n)),i.appendChild(this.write_wmc_LayerList(n)),OpenLayers.Format.XML.prototype.write.apply(this,[i])},createElementDefaultNS:function(n,t,i){return n=this.createElementNS(this.namespaces[this.defaultPrefix],n),t&&n.appendChild(this.createTextNode(t)),i&&this.setAttributes(n,i),n},setAttributes:function(n,t){var i,r;for(r in t)i=t[r].toString(),i.match(/[A-Z]/)?this.setAttributeNS(n,null,r,i):n.setAttribute(r,i)},write_wmc_General:function(n){var t=this.createElementDefaultNS("General"),i;return n.size&&t.appendChild(this.createElementDefaultNS("Window",null,{width:n.size.w,height:n.size.h})),i=n.bounds,t.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:i.left.toPrecision(18),miny:i.bottom.toPrecision(18),maxx:i.right.toPrecision(18),maxy:i.top.toPrecision(18),SRS:n.projection})),t.appendChild(this.createElementDefaultNS("Title",n.title)),n.keywords&&t.appendChild(this.write_wmc_KeywordList(n.keywords)),n.abstract&&t.appendChild(this.createElementDefaultNS("Abstract",n.abstract)),n.logo&&t.appendChild(this.write_wmc_URLType("LogoURL",n.logo.href,n.logo)),n.descriptionURL&&t.appendChild(this.write_wmc_URLType("DescriptionURL",n.descriptionURL)),n.contactInformation&&t.appendChild(this.write_wmc_ContactInformation(n.contactInformation)),t.appendChild(this.write_ol_MapExtension(n)),t},write_wmc_KeywordList:function(n){for(var i=this.createElementDefaultNS("KeywordList"),t=0,r=n.length;t<r;t++)i.appendChild(this.createElementDefaultNS("Keyword",n[t]));return i},write_wmc_ContactInformation:function(n){var t=this.createElementDefaultNS("ContactInformation");return n.personPrimary&&t.appendChild(this.write_wmc_ContactPersonPrimary(n.personPrimary)),n.position&&t.appendChild(this.createElementDefaultNS("ContactPosition",n.position)),n.contactAddress&&t.appendChild(this.write_wmc_ContactAddress(n.contactAddress)),n.phone&&t.appendChild(this.createElementDefaultNS("ContactVoiceTelephone",n.phone)),n.fax&&t.appendChild(this.createElementDefaultNS("ContactFacsimileTelephone",n.fax)),n.email&&t.appendChild(this.createElementDefaultNS("ContactElectronicMailAddress",n.email)),t},write_wmc_ContactPersonPrimary:function(n){var t=this.createElementDefaultNS("ContactPersonPrimary");return n.person&&t.appendChild(this.createElementDefaultNS("ContactPerson",n.person)),n.organization&&t.appendChild(this.createElementDefaultNS("ContactOrganization",n.organization)),t},write_wmc_ContactAddress:function(n){var t=this.createElementDefaultNS("ContactAddress");return n.type&&t.appendChild(this.createElementDefaultNS("AddressType",n.type)),n.address&&t.appendChild(this.createElementDefaultNS("Address",n.address)),n.city&&t.appendChild(this.createElementDefaultNS("City",n.city)),n.stateOrProvince&&t.appendChild(this.createElementDefaultNS("StateOrProvince",n.stateOrProvince)),n.postcode&&t.appendChild(this.createElementDefaultNS("PostCode",n.postcode)),n.country&&t.appendChild(this.createElementDefaultNS("Country",n.country)),t},write_ol_MapExtension:function(n){var i=this.createElementDefaultNS("Extension"),t;return(n=n.maxExtent)&&(t=this.createElementNS(this.namespaces.ol,"ol:maxExtent"),this.setAttributes(t,{minx:n.left.toPrecision(18),miny:n.bottom.toPrecision(18),maxx:n.right.toPrecision(18),maxy:n.top.toPrecision(18)}),i.appendChild(t)),i},write_wmc_LayerList:function(n){for(var i=this.createElementDefaultNS("LayerList"),t=0,r=n.layersContext.length;t<r;++t)i.appendChild(this.write_wmc_Layer(n.layersContext[t]));return i},write_wmc_Layer:function(n){var t=this.createElementDefaultNS("Layer",null,{queryable:n.queryable?"1":"0",hidden:n.visibility?"0":"1"});return t.appendChild(this.write_wmc_Server(n)),t.appendChild(this.createElementDefaultNS("Name",n.name)),t.appendChild(this.createElementDefaultNS("Title",n.title)),n.abstract&&t.appendChild(this.createElementDefaultNS("Abstract",n.abstract)),n.dataURL&&t.appendChild(this.write_wmc_URLType("DataURL",n.dataURL)),n.metadataURL&&t.appendChild(this.write_wmc_URLType("MetadataURL",n.metadataURL)),t},write_wmc_LayerExtension:function(n){var i=this.createElementDefaultNS("Extension"),t=n.maxExtent,r=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(r,{minx:t.left.toPrecision(18),miny:t.bottom.toPrecision(18),maxx:t.right.toPrecision(18),maxy:t.top.toPrecision(18)}),i.appendChild(r),n.tileSize&&!n.singleTile&&(t=this.createElementNS(this.namespaces.ol,"ol:tileSize"),this.setAttributes(t,n.tileSize),i.appendChild(t));for(var t="transparent numZoomLevels units isBaseLayer opacity displayInLayerSwitcher singleTile".split(" "),u=0,f=t.length;u<f;++u)(r=this.createOLPropertyNode(n,t[u]))&&i.appendChild(r);return i},createOLPropertyNode:function(n,t){var i=null;return null!=n[t]&&(i=this.createElementNS(this.namespaces.ol,"ol:"+t),i.appendChild(this.createTextNode(n[t].toString()))),i},write_wmc_Server:function(n){n=n.server;var t=this.createElementDefaultNS("Server"),i={service:"OGC:WMS",version:n.version};return n.title&&(i.title=n.title),this.setAttributes(t,i),t.appendChild(this.write_wmc_OnlineResource(n.url)),t},write_wmc_URLType:function(n,t,i){if(n=this.createElementDefaultNS(n),n.appendChild(this.write_wmc_OnlineResource(t)),i){t=["width","height","format"];for(var r=0;r<t.length;r++)t[r]in i&&n.setAttribute(t[r],i[t[r]])}return n},write_wmc_DimensionList:function(n){var u=this.createElementDefaultNS("DimensionList"),f,i,t,r;for(f in n.dimensions){i={},t=n.dimensions[f];for(r in t)i[r]="boolean"==typeof t[r]?Number(t[r]):t[r];t="",i.values&&(t=i.values.join(","),delete i.values),u.appendChild(this.createElementDefaultNS("Dimension",t,i))}return u},write_wmc_FormatList:function(n){for(var t,r=this.createElementDefaultNS("FormatList"),i=0,u=n.formats.length;i<u;i++)t=n.formats[i],r.appendChild(this.createElementDefaultNS("Format",t.value,t.current&&!0==t.current?{current:"1"}:null));return r},write_wmc_StyleList:function(n){var f=this.createElementDefaultNS("StyleList"),i,u,e,t,r;if((n=n.styles)&&OpenLayers.Util.isArray(n))for(u=0,e=n.length;u<e;u++)t=n[u],r=this.createElementDefaultNS("Style",null,t.current&&!0==t.current?{current:"1"}:null),t.href?(i=this.createElementDefaultNS("SLD"),t.name&&i.appendChild(this.createElementDefaultNS("Name",t.name)),t.title&&i.appendChild(this.createElementDefaultNS("Title",t.title)),t.legend&&i.appendChild(this.write_wmc_URLType("LegendURL",t.legend.href,t.legend)),t=this.write_wmc_OnlineResource(t.href),i.appendChild(t),r.appendChild(i)):t.body?(i=this.createElementDefaultNS("SLD"),t.name&&i.appendChild(this.createElementDefaultNS("Name",t.name)),t.title&&i.appendChild(this.createElementDefaultNS("Title",t.title)),t.legend&&i.appendChild(this.write_wmc_URLType("LegendURL",t.legend.href,t.legend)),t=OpenLayers.Format.XML.prototype.read.apply(this,[t.body]).documentElement,i.ownerDocument&&i.ownerDocument.importNode&&(t=i.ownerDocument.importNode(t,!0)),i.appendChild(t),r.appendChild(i)):(r.appendChild(this.createElementDefaultNS("Name",t.name)),r.appendChild(this.createElementDefaultNS("Title",t.title)),t.abstract&&r.appendChild(this.createElementDefaultNS("Abstract",t.abstract)),t.legend&&r.appendChild(this.write_wmc_URLType("LegendURL",t.legend.href,t.legend))),f.appendChild(r);return f},write_wmc_OnlineResource:function(n){var t=this.createElementDefaultNS("OnlineResource");return this.setAttributeNS(t,this.namespaces.xlink,"xlink:type","simple"),this.setAttributeNS(t,this.namespaces.xlink,"xlink:href",n),t},getOnlineResource_href:function(n){var t={};return n=n.getElementsByTagName("OnlineResource"),0<n.length&&this.read_wmc_OnlineResource(t,n[0]),t.href},CLASS_NAME:"OpenLayers.Format.WMC.v1"}),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(n){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[n])},read_sld_MinScaleDenominator:function(n,t){var i=parseFloat(this.getChildValue(t));0<i&&(n.maxScale=i)},read_sld_MaxScaleDenominator:function(n,t){n.minScale=parseFloat(this.getChildValue(t))},read_wmc_SRS:function(n,t){"srs"in n||(n.srs={}),n.srs[this.getChildValue(t)]=!0},write_wmc_Layer:function(n){var t=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[n]),i,r;if(n.maxScale&&(i=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator"),i.appendChild(this.createTextNode(n.maxScale.toPrecision(16))),t.appendChild(i)),n.minScale&&(i=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator"),i.appendChild(this.createTextNode(n.minScale.toPrecision(16))),t.appendChild(i)),n.srs)for(r in n.srs)t.appendChild(this.createElementDefaultNS("SRS",r));return t.appendChild(this.write_wmc_FormatList(n)),t.appendChild(this.write_wmc_StyleList(n)),n.dimensions&&t.appendChild(this.write_wmc_DimensionList(n)),t.appendChild(this.write_wmc_LayerExtension(n)),t},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"}),OpenLayers.Format.XLS=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",stringifyOutput:!0,CLASS_NAME:"OpenLayers.Format.XLS"}),OpenLayers.Format.XLS.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xls:"http://www.opengis.net/xls",gml:"http://www.opengis.net/gml",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},xy:!0,defaultPrefix:"xls",schemaLocation:null,read:function(n,t){OpenLayers.Util.applyDefaults(t,this.options);var i={};return this.readChildNodes(n,i),i},readers:{xls:{XLS:function(n,t){t.version=n.getAttribute("version"),this.readChildNodes(n,t)},Response:function(n,t){this.readChildNodes(n,t)},GeocodeResponse:function(n,t){t.responseLists=[],this.readChildNodes(n,t)},GeocodeResponseList:function(n,t){var i={features:[],numberOfGeocodedAddresses:parseInt(n.getAttribute("numberOfGeocodedAddresses"))};t.responseLists.push(i),this.readChildNodes(n,i)},GeocodedAddress:function(n,t){var i=new OpenLayers.Feature.Vector;t.features.push(i),this.readChildNodes(n,i),i.geometry=i.components[0]},GeocodeMatchCode:function(n,t){t.attributes.matchCode={accuracy:parseFloat(n.getAttribute("accuracy")),matchType:n.getAttribute("matchType")}},Address:function(n,t){var i={countryCode:n.getAttribute("countryCode"),addressee:n.getAttribute("addressee"),street:[],place:[]};t.attributes.address=i,this.readChildNodes(n,i)},freeFormAddress:function(n,t){t.freeFormAddress=this.getChildValue(n)},StreetAddress:function(n,t){this.readChildNodes(n,t)},Building:function(n,t){t.building={number:n.getAttribute("number"),subdivision:n.getAttribute("subdivision"),buildingName:n.getAttribute("buildingName")}},Street:function(n,t){t.street.push(this.getChildValue(n))},Place:function(n,t){t.place[n.getAttribute("type")]=this.getChildValue(n)},PostalCode:function(n,t){t.postalCode=this.getChildValue(n)}},gml:OpenLayers.Format.GML.v3.prototype.readers.gml},write:function(n){return this.writers.xls.XLS.apply(this,[n])},writers:{xls:{XLS:function(n){var t=this.createElementNSPlus("xls:XLS",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});return this.writeNode("RequestHeader",n.header,t),this.writeNode("Request",n,t),t},RequestHeader:function(){return this.createElementNSPlus("xls:RequestHeader")},Request:function(n){var t=this.createElementNSPlus("xls:Request",{attributes:{methodName:"GeocodeRequest",requestID:n.requestID||"",version:this.VERSION}});return this.writeNode("GeocodeRequest",n.addresses,t),t},GeocodeRequest:function(n){for(var i=this.createElementNSPlus("xls:GeocodeRequest"),t=0,r=n.length;t<r;t++)this.writeNode("Address",n[t],i);return i},Address:function(n){var t=this.createElementNSPlus("xls:Address",{attributes:{countryCode:n.countryCode}});return n.freeFormAddress?this.writeNode("freeFormAddress",n.freeFormAddress,t):(n.street&&this.writeNode("StreetAddress",n,t),n.municipality&&this.writeNode("Municipality",n.municipality,t),n.countrySubdivision&&this.writeNode("CountrySubdivision",n.countrySubdivision,t),n.postalCode&&this.writeNode("PostalCode",n.postalCode,t)),t},freeFormAddress:function(n){return this.createElementNSPlus("freeFormAddress",{value:n})},StreetAddress:function(n){var i=this.createElementNSPlus("xls:StreetAddress"),t,r;for(n.building&&this.writeNode(i,"Building",n.building),n=n.street,OpenLayers.Util.isArray(n)||(n=[n]),t=0,r=n.length;t<r;t++)this.writeNode("Street",n[t],i);return i},Building:function(n){return this.createElementNSPlus("xls:Building",{attributes:{number:n.number,subdivision:n.subdivision,buildingName:n.buildingName}})},Street:function(n){return this.createElementNSPlus("xls:Street",{value:n})},Municipality:function(n){return this.createElementNSPlus("xls:Place",{attributes:{type:"Municipality"},value:n})},CountrySubdivision:function(n){return this.createElementNSPlus("xls:Place",{attributes:{type:"CountrySubdivision"},value:n})},PostalCode:function(n){return this.createElementNSPlus("xls:PostalCode",{value:n})}}},CLASS_NAME:"OpenLayers.Format.XLS.v1"}),OpenLayers.Format.XLS.v1_1_0=OpenLayers.Class(OpenLayers.Format.XLS.v1,{VERSION:"1.1",schemaLocation:"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.1.0/LocationUtilityService.xsd",CLASS_NAME:"OpenLayers.Format.XLS.v1_1_0"}),OpenLayers.Format.XLS.v1_1=OpenLayers.Format.XLS.v1_1_0,OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15e3,translationParameters:null,symbolMetrics:null,initialize:function(){this.supported()&&(OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.translationParameters={x:0,y:0},this.symbolMetrics={})},supported:function(){return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG","1.1")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))},inValidRange:function(n,t,i){return n+=i?0:this.translationParameters.x,t+=i?0:this.translationParameters.y,n>=-this.MAX_PIXEL&&n<=this.MAX_PIXEL&&t>=-this.MAX_PIXEL&&t<=this.MAX_PIXEL},setExtent:function(n,t){var u=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),r=this.getResolution(),i=-n.left/r,r=n.top/r;return t?(this.left=i,this.top=r,this.rendererRoot.setAttributeNS(null,"viewBox","0 0 "+this.size.w+" "+this.size.h),this.translate(this.xOffset,0),!0):((i=this.translate(i-this.left+this.xOffset,r-this.top))||this.setExtent(n,!0),u&&i)},translate:function(n,t){if(this.inValidRange(n,t,!0)){var i="";return(n||t)&&(i="translate("+n+","+t+")"),this.root.setAttributeNS(null,"transform",i),this.translationParameters={x:n,y:t},!0}return!1},setSize:function(){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(n,t){var i=null;switch(n.CLASS_NAME){case"OpenLayers.Geometry.Point":i=t.externalGraphic?"image":this.isComplexSymbol(t.graphicName)?"svg":"circle";break;case"OpenLayers.Geometry.Rectangle":i="rect";break;case"OpenLayers.Geometry.LineString":i="polyline";break;case"OpenLayers.Geometry.LinearRing":i="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":i="path"}return i},setStyle:function(n,t,i){var r,f,u;if(t=t||n._style,i=i||n._options,f=t.title||t.graphicTitle,f&&(n.setAttributeNS(null,"title",f),r=n.getElementsByTagName("title"),0<r.length?r[0].firstChild.textContent=f:(r=this.nodeFactory(null,"title"),r.textContent=f,n.appendChild(r))),r=parseFloat(n.getAttributeNS(null,"r")),f=1,"OpenLayers.Geometry.Point"==n._geometryClass&&r){if(n.style.visibility="",!1===t.graphic)n.style.visibility="hidden";else if(t.externalGraphic){u=this.getPosition(n),t.graphicWidth&&t.graphicHeight&&n.setAttributeNS(null,"preserveAspectRatio","none");var r=t.graphicWidth||t.graphicHeight,o=t.graphicHeight||t.graphicWidth,r=r?r:2*t.pointRadius,o=o?o:2*t.pointRadius,e=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*o),s=t.graphicOpacity||t.fillOpacity;n.setAttributeNS(null,"x",(u.x+(void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*r))).toFixed()),n.setAttributeNS(null,"y",(u.y+e).toFixed()),n.setAttributeNS(null,"width",r),n.setAttributeNS(null,"height",o),n.setAttributeNS(this.xlinkns,"xlink:href",t.externalGraphic),n.setAttributeNS(null,"style","opacity: "+s),n.onclick=OpenLayers.Event.preventDefault}else if(this.isComplexSymbol(t.graphicName)){var r=3*t.pointRadius,o=2*r,h=this.importSymbol(t.graphicName);u=this.getPosition(n),f=3*this.symbolMetrics[h.id][0]/o,e=n.parentNode,s=n.nextSibling,e&&e.removeChild(n),n.firstChild&&n.removeChild(n.firstChild),n.appendChild(h.firstChild.cloneNode(!0)),n.setAttributeNS(null,"viewBox",h.getAttributeNS(null,"viewBox")),n.setAttributeNS(null,"width",o),n.setAttributeNS(null,"height",o),n.setAttributeNS(null,"x",u.x-r),n.setAttributeNS(null,"y",u.y-r),s?e.insertBefore(n,s):e&&e.appendChild(n)}else n.setAttributeNS(null,"r",t.pointRadius);r=t.rotation,(void 0!==r||void 0!==n._rotation)&&u&&(n._rotation=r,r|=0,"svg"!==n.nodeName?n.setAttributeNS(null,"transform","rotate("+r+" "+u.x+" "+u.y+")"):(u=this.symbolMetrics[h.id],n.firstChild.setAttributeNS(null,"transform","rotate("+r+" "+u[1]+" "+u[2]+")")))}return i.isFilled?(n.setAttributeNS(null,"fill",t.fillColor),n.setAttributeNS(null,"fill-opacity",t.fillOpacity)):n.setAttributeNS(null,"fill","none"),i.isStroked?(n.setAttributeNS(null,"stroke",t.strokeColor),n.setAttributeNS(null,"stroke-opacity",t.strokeOpacity),n.setAttributeNS(null,"stroke-width",t.strokeWidth*f),n.setAttributeNS(null,"stroke-linecap",t.strokeLinecap||"round"),n.setAttributeNS(null,"stroke-linejoin","round"),t.strokeDashstyle&&n.setAttributeNS(null,"stroke-dasharray",this.dashStyle(t,f))):n.setAttributeNS(null,"stroke","none"),t.pointerEvents&&n.setAttributeNS(null,"pointer-events",t.pointerEvents),null!=t.cursor&&n.setAttributeNS(null,"cursor",t.cursor),n},dashStyle:function(n,t){var i=n.strokeWidth*t,r=n.strokeDashstyle;switch(r){case"solid":return"none";case"dot":return[1,4*i].join();case"dash":return[4*i,4*i].join();case"dashdot":return[4*i,4*i,1,4*i].join();case"longdash":return[8*i,4*i].join();case"longdashdot":return[8*i,4*i,1,4*i].join();default:return OpenLayers.String.trim(r).replace(/\s+/g,",")}},createNode:function(n,t){var i=document.createElementNS(this.xmlns,n);return t&&i.setAttributeNS(null,"id",t),i},nodeTypeCompare:function(n,t){return t==n.nodeName},createRenderRoot:function(){var n=this.nodeFactory(this.container.id+"_svgRoot","svg");return n.style.display="block",n},createRoot:function(n){return this.nodeFactory(this.container.id+n,"g")},createDefs:function(){var n=this.nodeFactory(this.container.id+"_defs","defs");return this.rendererRoot.appendChild(n),n},drawPoint:function(n,t){return this.drawCircle(n,t,1)},drawCircle:function(n,t,i){var r=this.getResolution(),u=(t.x-this.featureDx)/r+this.left;return t=this.top-t.y/r,this.inValidRange(u,t)?(n.setAttributeNS(null,"cx",u),n.setAttributeNS(null,"cy",t),n.setAttributeNS(null,"r",i),n):!1},drawLineString:function(n,t){var i=this.getComponentsString(t.components);return i.path?(n.setAttributeNS(null,"points",i.path),i.complete?n:null):!1},drawLinearRing:function(n,t){var i=this.getComponentsString(t.components);return i.path?(n.setAttributeNS(null,"points",i.path),i.complete?n:null):!1},drawPolygon:function(n,t){for(var i="",e=!0,r=!0,u,o,f=0,s=t.components.length;f<s;f++)i+=" M",u=this.getComponentsString(t.components[f].components," "),(o=u.path)?(i+=" "+o,r=u.complete&&r):e=!1;return e?(n.setAttributeNS(null,"d",i+" z"),n.setAttributeNS(null,"fill-rule","evenodd"),r?n:null):!1},drawRectangle:function(n,t){var i=this.getResolution(),r=(t.x-this.featureDx)/i+this.left,u=this.top-t.y/i;return this.inValidRange(r,u)?(n.setAttributeNS(null,"x",r),n.setAttributeNS(null,"y",u),n.setAttributeNS(null,"width",t.width/i),n.setAttributeNS(null,"height",t.height/i),n):!1},drawText:function(n,t,i){var s=!!t.labelOutlineWidth,u,h,c,e,f,l;s&&(u=OpenLayers.Util.extend({},t),u.fontColor=u.labelOutlineColor,u.fontStrokeColor=u.labelOutlineColor,u.fontStrokeWidth=t.labelOutlineWidth,t.labelOutlineOpacity&&(u.fontOpacity=t.labelOutlineOpacity),delete u.labelOutlineWidth,this.drawText(n,u,i));var r=this.getResolution(),u=(i.x-this.featureDx)/r+this.left,o=i.y/r-this.top,s=s?this.LABEL_OUTLINE_SUFFIX:this.LABEL_ID_SUFFIX,r=this.nodeFactory(n+s,"text");for(r.setAttributeNS(null,"x",u),r.setAttributeNS(null,"y",-o),t.fontColor&&r.setAttributeNS(null,"fill",t.fontColor),t.fontStrokeColor&&r.setAttributeNS(null,"stroke",t.fontStrokeColor),t.fontStrokeWidth&&r.setAttributeNS(null,"stroke-width",t.fontStrokeWidth),t.fontOpacity&&r.setAttributeNS(null,"opacity",t.fontOpacity),t.fontFamily&&r.setAttributeNS(null,"font-family",t.fontFamily),t.fontSize&&r.setAttributeNS(null,"font-size",t.fontSize),t.fontWeight&&r.setAttributeNS(null,"font-weight",t.fontWeight),t.fontStyle&&r.setAttributeNS(null,"font-style",t.fontStyle),!0===t.labelSelect?(r.setAttributeNS(null,"pointer-events","visible"),r._featureId=n):r.setAttributeNS(null,"pointer-events","none"),o=t.labelAlign||OpenLayers.Renderer.defaultSymbolizer.labelAlign,r.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[o[0]]||"middle"),!0===OpenLayers.IS_GECKO&&r.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[o[1]]||"central"),h=t.label.split("\n"),c=h.length;r.childNodes.length>c;)r.removeChild(r.lastChild);for(e=0;e<c;e++)f=this.nodeFactory(n+s+"_tspan_"+e,"tspan"),!0===t.labelSelect&&(f._featureId=n,f._geometry=i,f._geometryClass=i.CLASS_NAME),!1===OpenLayers.IS_GECKO&&f.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[o[1]]||"-35%"),f.setAttribute("x",u),0==e?(l=OpenLayers.Renderer.SVG.LABEL_VFACTOR[o[1]],null==l&&(l=-.5),f.setAttribute("dy",l*(c-1)+"em")):f.setAttribute("dy","1em"),f.textContent=""===h[e]?" ":h[e],f.parentNode||r.appendChild(f);r.parentNode||this.textRoot.appendChild(r)},getComponentsString:function(n,t){for(var o=[],f=!0,e=n.length,u=[],r,i=0;i<e;i++)r=n[i],o.push(r),(r=this.getShortString(r))?u.push(r):(0<i&&this.getShortString(n[i-1])&&u.push(this.clipLine(n[i],n[i-1])),i<e-1&&this.getShortString(n[i+1])&&u.push(this.clipLine(n[i],n[i+1])),f=!1);return{path:u.join(t||","),complete:f}},clipLine:function(n,t){if(t.equals(n))return"";var i=this.getResolution(),u=this.MAX_PIXEL-this.translationParameters.x,f=this.MAX_PIXEL-this.translationParameters.y,e=(t.x-this.featureDx)/i+this.left,o=this.top-t.y/i,r=(n.x-this.featureDx)/i+this.left,i=this.top-n.y/i,s;return(r<-u||r>u)&&(s=(i-o)/(r-e),r=0>r?-u:u,i=o+(r-e)*s),(i<-f||i>f)&&(s=(r-e)/(i-o),i=0>i?-f:f,r=e+(i-o)*s),r+","+i},getShortString:function(n){var t=this.getResolution(),i=(n.x-this.featureDx)/t+this.left;return n=this.top-n.y/t,this.inValidRange(i,n)?i+","+n:!1},getPosition:function(n){return{x:parseFloat(n.getAttributeNS(null,"cx")),y:parseFloat(n.getAttributeNS(null,"cy"))}},importSymbol:function(n){var u,t,i,r;if(this.defs||(this.defs=this.createDefs()),u=this.container.id+"-"+n,t=document.getElementById(u),null!=t)return t;if(i=OpenLayers.Renderer.symbol[n],!i)throw Error(n+" is not a valid symbol name");n=this.nodeFactory(u,"symbol"),r=this.nodeFactory(null,"polygon"),n.appendChild(r);for(var t=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),s=[],f,e,o=0;o<i.length;o+=2)f=i[o],e=i[o+1],t.left=Math.min(t.left,f),t.bottom=Math.min(t.bottom,e),t.right=Math.max(t.right,f),t.top=Math.max(t.top,e),s.push(f,",",e);return r.setAttributeNS(null,"points",s.join(" ")),i=t.getWidth(),r=t.getHeight(),n.setAttributeNS(null,"viewBox",[t.left-i,t.bottom-r,3*i,3*r].join(" ")),this.symbolMetrics[u]=[Math.max(i,r),t.getCenterLonLat().lon,t.getCenterLonLat().lat],this.defs.appendChild(n),n},getFeatureIdFromEvent:function(n){var t=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments);return t||(t=n.target,t=t.parentNode&&t!=this.rendererRoot?t.parentNode._featureId:void 0),t},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.SVG.LABEL_VFACTOR={t:0,b:-1},OpenLayers.Renderer.SVG.preventDefault=function(n){OpenLayers.Event.preventDefault(n)},OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"}),OpenLayers.Format.WMSDescribeLayer.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(n){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));for(var s=n.documentElement.childNodes,i={layerDescriptions:[]},t,r,e=0;e<s.length;++e)if(t=s[e],r=t.nodeName,"LayerDescription"==r){r=t.getAttribute("name");var u="",f="",o="";t.getAttribute("owsType")?(u=t.getAttribute("owsType"),f=t.getAttribute("owsURL")):""!=t.getAttribute("wfs")?(u="WFS",f=t.getAttribute("wfs")):""!=t.getAttribute("wcs")&&(u="WCS",f=t.getAttribute("wcs")),t=t.getElementsByTagName("Query"),0<t.length&&((o=t[0].getAttribute("typeName"))||(o=t[0].getAttribute("typename"))),t={layerName:r,owsType:u,owsURL:f,typeName:o},i.layerDescriptions.push(t),i.length=i.layerDescriptions.length,i[i.length-1]=t}else if("ServiceException"==r)return{error:(new OpenLayers.Format.OGCExceptionReport).read(n)};return i},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1_1"}),OpenLayers.Format.WMSDescribeLayer.v1_1_0=OpenLayers.Format.WMSDescribeLayer.v1_1_1,OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.eTop||(this.eTop=document.createElement("div"),this.eTop.className=this.displayClass+"Top",this.div.appendChild(this.eTop),this.eTop.style.visibility=""==this.topOutUnits||""==this.topInUnits?"hidden":"visible",this.eBottom=document.createElement("div"),this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),this.eBottom.style.visibility=""==this.bottomOutUnits||""==this.bottomInUnits?"hidden":"visible"),this.map.events.register("moveend",this,this.update),this.update(),this.div},getBarLen:function(n){var t=parseInt(Math.log(n)/Math.log(10)),t=Math.pow(10,t);return n=parseInt(n/t),(5<n?5:2<n?2:1)*t},update:function(){var u=this.map.getResolution(),i,r;if(u){var e=this.map.getUnits(),n=OpenLayers.INCHES_PER_UNIT,t=this.maxWidth*u*n[e],f=1;!0===this.geodesic&&(f=(this.map.getGeodesicPixelSize().w||1e-6)*this.maxWidth/(t/n.km),t*=f),1e5<t?(i=this.topOutUnits,r=this.bottomOutUnits):(i=this.topInUnits,r=this.bottomInUnits);var s=t/n[i],h=t/n[r],t=this.getBarLen(s),o=this.getBarLen(h),s=t/n[e]*n[i],h=o/n[e]*n[r],e=s/u/f,u=h/u/f;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(u)+"px",this.eBottom.innerHTML=o+" "+r),"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(e)+"px",this.eTop.innerHTML=t+" "+i)}},CLASS_NAME:"OpenLayers.Control.ScaleLine"}),OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(n,t,i,r){this.url=n,this.size=t||{w:20,h:20},this.offset=i||{x:-(this.size.w/2),y:-(this.size.h/2)},this.calculateOffset=r,n=OpenLayers.Util.createUniqueID("OL_Icon_"),this.imageDiv=OpenLayers.Util.createAlphaImageDiv(n)},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(n){null!=n&&(this.size=n),this.draw()},setUrl:function(n){null!=n&&(this.url=n),this.draw()},draw:function(n){return OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute"),this.moveTo(n),this.imageDiv},erase:function(){null!=this.imageDiv&&null!=this.imageDiv.parentNode&&OpenLayers.Element.remove(this.imageDiv)},setOpacity:function(n){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,n)},moveTo:function(n){null!=n&&(this.px=n),null!=this.imageDiv&&(null==this.px?this.display(!1):(this.calculateOffset&&(this.offset=this.calculateOffset(this.size)),OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,{x:this.px.x+this.offset.x,y:this.px.y+this.offset.y})))},display:function(n){this.imageDiv.style.display=n?"":"none"},isDrawn:function(){return this.imageDiv&&this.imageDiv.parentNode&&11!=this.imageDiv.parentNode.nodeType},CLASS_NAME:"OpenLayers.Icon"}),OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(n,t){this.lonlat=n;var i=t?t:OpenLayers.Marker.defaultIcon();null==this.icon?this.icon=i:(this.icon.url=i.url,this.icon.size=i.size,this.icon.offset=i.offset,this.icon.calculateOffset=i.calculateOffset),this.events=new OpenLayers.Events(this,this.icon.imageDiv)},destroy:function(){this.erase(),this.map=null,this.events.destroy(),this.events=null,null!=this.icon&&(this.icon.destroy(),this.icon=null)},draw:function(n){return this.icon.draw(n)},erase:function(){null!=this.icon&&this.icon.erase()},moveTo:function(n){null!=n&&null!=this.icon&&this.icon.moveTo(n),this.lonlat=this.map.getLonLatFromLayerPx(n)},isDrawn:function(){return this.icon&&this.icon.isDrawn()},onScreen:function(){var n=!1;return this.map&&(n=this.map.getExtent().containsLonLat(this.lonlat)),n},inflate:function(n){this.icon&&this.icon.setSize({w:this.icon.size.w*n,h:this.icon.size.h*n})},setOpacity:function(n){this.icon.setOpacity(n)},setUrl:function(n){this.icon.setUrl(n)},display:function(n){this.icon.display(n)},CLASS_NAME:"OpenLayers.Marker"}),OpenLayers.Marker.defaultIcon=function(){return new OpenLayers.Icon(OpenLayers.Util.getImageLocation("marker.png"),{w:21,h:25},{x:-10.5,y:-25})},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:!1,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:!1,fixPadding:function(){"number"==typeof this.padding&&(this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding))},panMapIfOutOfView:!1,keepInMap:!1,closeOnMove:!1,map:null,initialize:function(n,t,i,r,u,f){null==n&&(n=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")),this.id=n,this.lonlat=t,this.contentSize=null!=i?i:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT),null!=r&&(this.contentHTML=r),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,this.groupDiv=OpenLayers.Util.createDiv(this.id+"_GroupDiv",null,null,null,"relative",null,"hidden"),n=this.div.id+"_contentDiv",this.contentDiv=OpenLayers.Util.createDiv(n,null,this.contentSize.clone(),null,"relative"),this.contentDiv.className=this.contentDisplayClass,this.groupDiv.appendChild(this.contentDiv),this.div.appendChild(this.groupDiv),u&&this.addCloseBox(f),this.registerEvents()},destroy:function(){this.border=this.opacity=this.backgroundColor=this.contentHTML=this.size=this.lonlat=this.id=null,this.closeOnMove&&this.map&&this.map.events.unregister("movestart",this,this.hide),this.events.destroy(),this.events=null,this.closeDiv&&(OpenLayers.Event.stopObservingElement(this.closeDiv),this.groupDiv.removeChild(this.closeDiv)),this.closeDiv=null,this.div.removeChild(this.groupDiv),this.groupDiv=null,null!=this.map&&this.map.removePopup(this),this.panMapIfOutOfView=this.padding=this.maxSize=this.minSize=this.autoSize=this.div=this.map=null},draw:function(n){return null==n&&null!=this.lonlat&&null!=this.map&&(n=this.map.getLayerPxFromLonLat(this.lonlat)),this.closeOnMove&&this.map.events.register("movestart",this,this.hide),this.disableFirefoxOverflowHack||"firefox"!=OpenLayers.BROWSER_NAME||(this.map.events.register("movestart",this,function(){var n=document.defaultView.getComputedStyle(this.contentDiv,null).getPropertyValue("overflow");"hidden"!=n&&(this.contentDiv._oldOverflow=n,this.contentDiv.style.overflow="hidden")}),this.map.events.register("moveend",this,function(){var n=this.contentDiv._oldOverflow;n&&(this.contentDiv.style.overflow=n,this.contentDiv._oldOverflow=null)})),this.moveTo(n),this.autoSize||this.size||this.setSize(this.contentSize),this.setBackgroundColor(),this.setOpacity(),this.setBorder(),this.setContentHTML(),this.panMapIfOutOfView&&this.panIntoView(),this.div},updatePosition:function(){if(this.lonlat&&this.map){var n=this.map.getLayerPxFromLonLat(this.lonlat);n&&this.moveTo(n)}},moveTo:function(n){null!=n&&null!=this.div&&(this.div.style.left=n.x+"px",this.div.style.top=n.y+"px")},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){this.visible()?this.hide():this.show()},show:function(){this.div.style.display="",this.panMapIfOutOfView&&this.panIntoView()},hide:function(){this.div.style.display="none"},setSize:function(n){var u,i;this.size=n.clone();var t=this.getContentDivPadding(),i=t.left+t.right,r=t.top+t.bottom;this.fixPadding(),i+=this.padding.left+this.padding.right,r+=this.padding.top+this.padding.bottom,this.closeDiv&&(u=parseInt(this.closeDiv.style.width),i=i+(u+t.right)),this.size.w+=i,this.size.h+=r,"msie"==OpenLayers.BROWSER_NAME&&(this.contentSize.w+=t.left+t.right,this.contentSize.h+=t.bottom+t.top),null!=this.div&&(this.div.style.width=this.size.w+"px",this.div.style.height=this.size.h+"px"),null!=this.contentDiv&&(this.contentDiv.style.width=n.w+"px",this.contentDiv.style.height=n.h+"px")},updateSize:function(){var i="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"<\/div>",u=this.map?this.map.div:document.body,n=OpenLayers.Util.getRenderedDimensions(i,null,{displayClass:this.displayClass,containerElement:u}),t=this.getSafeContentSize(n),r=null;t.equals(n)?r=n:(n={w:t.w<n.w?t.w:null,h:t.h<n.h?t.h:null},n.w&&n.h?r=t:(i=OpenLayers.Util.getRenderedDimensions(i,n,{displayClass:this.contentDisplayClass,containerElement:u}),"hidden"!=OpenLayers.Element.getStyle(this.contentDiv,"overflow")&&i.equals(t)&&(t=OpenLayers.Util.getScrollbarWidth(),n.w?i.h+=t:i.w+=t),r=this.getSafeContentSize(i))),this.setSize(r)},setBackgroundColor:function(n){void 0!=n&&(this.backgroundColor=n),null!=this.div&&(this.div.style.backgroundColor=this.backgroundColor)},setOpacity:function(n){void 0!=n&&(this.opacity=n),null!=this.div&&(this.div.style.opacity=this.opacity,this.div.style.filter="alpha(opacity="+100*this.opacity+")")},setBorder:function(n){void 0!=n&&(this.border=n),null!=this.div&&(this.div.style.border=this.border)},setContentHTML:function(n){null!=n&&(this.contentHTML=n),null!=this.contentDiv&&null!=this.contentHTML&&this.contentHTML!=this.contentDiv.innerHTML&&(this.contentDiv.innerHTML=this.contentHTML,this.autoSize&&(this.registerImageListeners(),this.updateSize()))},registerImageListeners:function(){for(var n,r=function(){null!==this.popup.id&&(this.popup.updateSize(),this.popup.visible()&&this.popup.panMapIfOutOfView&&this.popup.panIntoView(),OpenLayers.Event.stopObserving(this.img,"load",this.img._onImgLoad))},i=this.contentDiv.getElementsByTagName("img"),t=0,u=i.length;t<u;t++)n=i[t],(0==n.width||0==n.height)&&(n._onImgLoad=OpenLayers.Function.bind(r,{popup:this,img:n}),OpenLayers.Event.observe(n,"load",n._onImgLoad))},getSafeContentSize:function(n){var t,u;n=n.clone();var i=this.getContentDivPadding(),u=i.left+i.right,r=i.top+i.bottom;if(this.fixPadding(),u+=this.padding.left+this.padding.right,r+=this.padding.top+this.padding.bottom,this.closeDiv&&(t=parseInt(this.closeDiv.style.width),u=u+(t+i.right)),this.minSize&&(n.w=Math.max(n.w,this.minSize.w-u),n.h=Math.max(n.h,this.minSize.h-r)),this.maxSize&&(n.w=Math.min(n.w,this.maxSize.w-u),n.h=Math.min(n.h,this.maxSize.h-r)),this.map&&this.map.size){if(t=i=0,this.keepInMap&&!this.panMapIfOutOfView)switch(t=this.map.getPixelFromLonLat(this.lonlat),this.relativePosition){case"tr":i=t.x,t=this.map.size.h-t.y;break;case"tl":i=this.map.size.w-t.x,t=this.map.size.h-t.y;break;case"bl":i=this.map.size.w-t.x,t=t.y;break;case"br":i=t.x,t=t.y;break;default:i=t.x,t=this.map.size.h-t.y}r=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-r-t,n.w=Math.min(n.w,this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-u-i),n.h=Math.min(n.h,r)}return n},getContentDivPadding:function(){var n=this._contentDivPadding;return n||(null==this.div.parentNode&&(this.div.style.display="none",document.body.appendChild(this.div)),this._contentDivPadding=n=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.div.parentNode==document.body&&(document.body.removeChild(this.div),this.div.style.display="")),n},addCloseBox:function(n){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,{w:17,h:17}),this.closeDiv.className="olPopupCloseBox";var t=this.getContentDivPadding();this.closeDiv.style.right=t.right+"px",this.closeDiv.style.top=t.top+"px",this.groupDiv.appendChild(this.closeDiv),n=n||function(n){this.hide(),OpenLayers.Event.stop(n)},OpenLayers.Event.observe(this.closeDiv,"touchend",OpenLayers.Function.bindAsEventListener(n,this)),OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(n,this))},panIntoView:function(){var i=this.map.getSize(),n=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top))),t=n.clone();n.x<this.map.paddingForPopups.left?t.x=this.map.paddingForPopups.left:n.x+this.size.w>i.w-this.map.paddingForPopups.right&&(t.x=i.w-this.map.paddingForPopups.right-this.size.w),n.y<this.map.paddingForPopups.top?t.y=this.map.paddingForPopups.top:n.y+this.size.h>i.h-this.map.paddingForPopups.bottom&&(t.y=i.h-this.map.paddingForPopups.bottom-this.size.h),this.map.pan(n.x-t.x,n.y-t.y)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,!0);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,touchstart:function(n){OpenLayers.Event.stop(n,!0)},scope:this})},onmousedown:function(n){this.mousedown=!0,OpenLayers.Event.stop(n,!0)},onmousemove:function(n){this.mousedown&&OpenLayers.Event.stop(n,!0)},onmouseup:function(n){this.mousedown&&(this.mousedown=!1,OpenLayers.Event.stop(n,!0))},onclick:function(n){OpenLayers.Event.stop(n,!0)},onmouseout:function(){this.mousedown=!1},ondblclick:function(n){OpenLayers.Event.stop(n,!0)},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.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:!1,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);if(n)this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this});return n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})),n},cacheFeatures:function(n){this.paging||(this.clearCache(),this.features=n.features,this.pageNext(n))},clearCache:function(){if(this.features)for(var n=0;n<this.features.length;++n)this.features[n].destroy();this.num=this.features=null},pageCount:function(){return Math.ceil((this.features?this.features.length:0)/this.length)},pageNum:function(){return this.num},pageLength:function(n){return n&&0<n&&(this.length=n),this.length},pageNext:function(n){var t=!1;return this.features&&(null===this.num&&(this.num=-1),t=this.page((this.num+1)*this.length,n)),t},pagePrevious:function(){var n=!1;return this.features&&(null===this.num&&(this.num=this.pageCount()),n=this.page((this.num-1)*this.length)),n},page:function(n,t){var i=!1,r;return this.features&&0<=n&&n<this.features.length&&(r=Math.floor(n/this.length),r!=this.num&&(this.paging=!0,i=this.features.slice(n,n+this.length),this.layer.removeFeatures(this.layer.features),this.num=r,t&&t.features?t.features=i:this.layer.addFeatures(i),this.paging=!1,i=!0)),i},CLASS_NAME:"OpenLayers.Strategy.Paging"}),OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:!0,anchor:null,initialize:function(n,t,i,r,u,f,e){OpenLayers.Popup.prototype.initialize.apply(this,[n,t,i,r,f,e]),this.anchor=null!=u?u:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.relativePosition=this.anchor=null,OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition(),OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(n){var t=this.relativePosition;this.relativePosition=this.calculateRelativePosition(n),OpenLayers.Popup.prototype.moveTo.call(this,this.calculateNewPx(n)),this.relativePosition!=t&&this.updateRelativePosition()},setSize:function(){if(OpenLayers.Popup.prototype.setSize.apply(this,arguments),this.lonlat&&this.map){var t=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(t)}},calculateRelativePosition:function(n){return n=this.map.getLonLatFromLayerPx(n),n=this.map.getExtent().determineQuadrant(n),OpenLayers.Bounds.oppositeQuadrant(n)},updateRelativePosition:function(){},calculateNewPx:function(n){n=n.offset(this.anchor.offset);var i=this.size||this.contentSize,t="t"==this.relativePosition.charAt(0);return n.y+=t?-i.h:this.anchor.size.h,t="l"==this.relativePosition.charAt(1),n.x+=t?-i.w:this.anchor.size.w,n},CLASS_NAME:"OpenLayers.Popup.Anchored"}),OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:!1,positionBlocks:null,blocks:null,fixedRelativePosition:!1,initialize:function(n,t,i,r,u,f){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments),this.fixedRelativePosition&&(this.updateRelativePosition(),this.calculateRelativePosition=function(){return this.relativePosition}),this.contentDiv.style.position="absolute",this.contentDiv.style.zIndex=1,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(){var t,n;for(this.isAlphaImage=this.imageSize=this.imageSrc=null,this.fixedRelativePosition=!1,this.positionBlocks=null,t=0;t<this.blocks.length;t++)n=this.blocks[t],n.image&&n.div.removeChild(n.image),n.image=null,n.div&&this.groupDiv.removeChild(n.div),n.div=null;this.blocks=null,OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(){},setBorder:function(){},setOpacity:function(){},setSize:function(){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments),this.updateBlocks()},updateRelativePosition:function(){if(this.padding=this.positionBlocks[this.relativePosition].padding,this.closeDiv){var n=this.getContentDivPadding();this.closeDiv.style.right=n.right+this.padding.right+"px",this.closeDiv.style.top=n.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(){var t=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);return t=t.offset(this.positionBlocks[this.relativePosition].offset)},createBlocks:function(){var i,n,t;this.blocks=[],i=null;for(n in this.positionBlocks){i=n;break}for(i=this.positionBlocks[i],n=0;n<i.blocks.length;n++)t={},this.blocks.push(t),t.div=OpenLayers.Util.createDiv(this.id+"_FrameDecorationDiv_"+n,null,null,null,"absolute",null,"hidden",null),t.image=(this.isAlphaImage?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage)(this.id+"_FrameDecorationImg_"+n,null,this.imageSize,this.imageSrc,"absolute",null,null,null),t.div.appendChild(t.image),this.groupDiv.appendChild(t.div)},updateBlocks:function(){var r,i;if(this.blocks||this.createBlocks(),this.size&&this.relativePosition){for(r=this.positionBlocks[this.relativePosition],i=0;i<r.blocks.length;i++){var n=r.blocks[i],t=this.blocks[i],u=n.anchor.left,f=n.anchor.bottom,e=n.anchor.right,o=n.anchor.top,s=isNaN(n.size.w)?this.size.w-(e+u):n.size.w,h=isNaN(n.size.h)?this.size.h-(f+o):n.size.h;t.div.style.width=(0>s?0:s)+"px",t.div.style.height=(0>h?0:h)+"px",t.div.style.left=null!=u?u+"px":"",t.div.style.bottom=null!=f?f+"px":"",t.div.style.right=null!=e?e+"px":"",t.div.style.top=null!=o?o+"px":"",t.image.style.left=n.position.x+"px",t.image.style.top=n.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.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxOffsets:null,initialize:function(){OpenLayers.Handler.prototype.initialize.apply(this,arguments),this.dragHandler=new OpenLayers.Handler.Drag(this,{down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox},{keyMask:this.keyMask})},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments),this.dragHandler&&(this.dragHandler.destroy(),this.dragHandler=null)},setMap:function(n){OpenLayers.Handler.prototype.setMap.apply(this,arguments),this.dragHandler&&this.dragHandler.setMap(n)},startBox:function(){this.callback("start",[]),this.zoomBox=OpenLayers.Util.createDiv("zoomBox",{x:-9999,y:-9999}),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(n){var i=this.dragHandler.start.x,r=this.dragHandler.start.y,u=Math.abs(i-n.x),f=Math.abs(r-n.y),t=this.getBoxOffsets();this.zoomBox.style.width=u+t.width+1+"px",this.zoomBox.style.height=f+t.height+1+"px",this.zoomBox.style.left=(n.x<i?i-u-t.left:i-t.left)+"px",this.zoomBox.style.top=(n.y<r?r-f-t.top:r-t.top)+"px"},endBox:function(n){var t,i,r,u;5<Math.abs(this.dragHandler.start.x-n.x)||5<Math.abs(this.dragHandler.start.y-n.y)?(i=this.dragHandler.start,t=Math.min(i.y,n.y),r=Math.max(i.y,n.y),u=Math.min(i.x,n.x),n=Math.max(i.x,n.x),t=new OpenLayers.Bounds(u,r,n,t)):t=this.dragHandler.start.clone(),this.removeBox(),this.callback("done",[t])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox),this.boxOffsets=this.zoomBox=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){return OpenLayers.Handler.prototype.activate.apply(this,arguments)?(this.dragHandler.activate(),!0):!1},deactivate:function(){return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)?(this.dragHandler.deactivate()&&this.zoomBox&&this.removeBox(),!0):!1},getBoxOffsets:function(){var n,t;if(!this.boxOffsets){n=document.createElement("div"),n.style.position="absolute",n.style.border="1px solid black",n.style.width="3px",document.body.appendChild(n),t=3==n.clientWidth,document.body.removeChild(n);var n=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width")),i=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width")),r=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width")),u=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"));this.boxOffsets={left:n,right:i,top:r,bottom:u,width:!1===t?n+i:0,height:!1===t?r+u:0}}return this.boxOffsets},CLASS_NAME:"OpenLayers.Handler.Box"}),OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:!1,keyMask:null,alwaysZoom:!1,zoomOnClick:!0,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(n){var t,e,f;if(n instanceof OpenLayers.Bounds){if(e=n.getCenterPixel(),this.out){t=Math.min(this.map.size.h/(n.bottom-n.top),this.map.size.w/(n.right-n.left));var i=this.map.getExtent(),r=this.map.getLonLatFromPixel(e),u=r.lon-i.getWidth()/2*t;n=r.lon+i.getWidth()/2*t,f=r.lat-i.getHeight()/2*t,t=r.lat+i.getHeight()/2*t,t=new OpenLayers.Bounds(u,f,n,t)}else u=this.map.getLonLatFromPixel({x:n.left,y:n.bottom}),n=this.map.getLonLatFromPixel({x:n.right,y:n.top}),t=new OpenLayers.Bounds(u.lon,u.lat,n.lon,n.lat);u=this.map.getZoom(),f=this.map.getSize(),n=f.w/2,f=f.h/2,t=this.map.getZoomForExtent(t),i=this.map.getResolution(),r=this.map.getResolutionForZoom(t),i==r?this.map.setCenter(this.map.getLonLatFromPixel(e)):this.map.zoomTo(t,{x:(i*e.x-r*n)/(i-r),y:(i*e.y-r*f)/(i-r)}),u==this.map.getZoom()&&!0==this.alwaysZoom&&this.map.zoomTo(u+(this.out?-1:1))}else this.zoomOnClick&&(this.out?this.map.zoomTo(this.map.getZoom()-1,n):this.map.zoomTo(this.map.getZoom()+1,n))},CLASS_NAME:"OpenLayers.Control.ZoomBox"}),OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:!1,interval:0,documentDrag:!1,kinetic:null,enableKinetic:!0,kineticInterval:10,draw:function(){if(this.enableKinetic&&OpenLayers.Kinetic){var n={interval:this.kineticInterval};"object"==typeof this.enableKinetic&&(n=OpenLayers.Util.extend(n,this.enableKinetic)),this.kinetic=new OpenLayers.Kinetic(n)}this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone,down:this.panMapStart},{interval:this.interval,documentDrag:this.documentDrag})},panMapStart:function(){this.kinetic&&this.kinetic.begin()},panMap:function(n){this.kinetic&&this.kinetic.update(n),this.panned=!0,this.map.pan(this.handler.last.x-n.x,this.handler.last.y-n.y,{dragging:!0,animate:!1})},panMapDone:function(n){var t,i;this.panned&&(t=null,this.kinetic&&(t=this.kinetic.end(n)),this.map.pan(this.handler.last.x-n.x,this.handler.last.y-n.y,{dragging:!!t,animate:!1}),t&&(i=this,this.kinetic.move(t,function(n,t,r){i.map.pan(n,t,{dragging:!r,animate:!1})})),this.panned=!1)},CLASS_NAME:"OpenLayers.Control.DragPan"}),OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,documentDrag:!1,zoomBox:null,zoomBoxEnabled:!0,zoomWheelEnabled:!0,mouseWheelOptions:null,handleRightClicks:!1,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,autoActivate:!0,initialize:function(){this.handlers={},OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate(),this.dragPan&&this.dragPan.destroy(),this.dragPan=null,this.zoomBox&&this.zoomBox.destroy(),this.zoomBox=null,this.pinchZoom&&this.pinchZoom.destroy(),this.pinchZoom=null,OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return this.dragPan.activate(),this.zoomWheelEnabled&&this.handlers.wheel.activate(),this.handlers.click.activate(),this.zoomBoxEnabled&&this.zoomBox.activate(),this.pinchZoom&&this.pinchZoom.activate(),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.pinchZoom&&this.pinchZoom.deactivate(),this.zoomBox.deactivate(),this.dragPan.deactivate(),this.handlers.click.deactivate(),this.handlers.wheel.deactivate(),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){this.handleRightClicks&&(this.map.viewPortDiv.oncontextmenu=OpenLayers.Function.False),this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.defaultClick,dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick},{double:!0,stopDouble:!0}),this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions)),this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask}),this.dragPan.draw(),this.zoomBox.draw(),this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},OpenLayers.Util.extend(this.map.fractionalZoom?{}:{cumulative:!1,interval:50,maxDelta:6},this.mouseWheelOptions)),OpenLayers.Control.PinchZoom&&(this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions)))},defaultClick:function(n){n.lastTouches&&2==n.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(n){this.map.zoomTo(this.map.zoom+1,n.xy)},defaultDblRightClick:function(n){this.map.zoomTo(this.map.zoom-1,n.xy)},wheelChange:function(n,t){this.map.fractionalZoom||(t=Math.round(t));var r=this.map.getZoom(),i;i=Math.max(r+t,0),i=Math.min(i,this.map.getNumZoomLevels()),i!==r&&this.map.zoomTo(i,n.xy)},wheelUp:function(n,t){this.wheelChange(n,t||1)},wheelDown:function(n,t){this.wheelChange(n,t||-1)},disableZoomBox:function(){this.zoomBoxEnabled=!1,this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=!0,this.active&&this.zoomBox.activate()},disableZoomWheel:function(){this.zoomWheelEnabled=!1,this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=!0,this.active&&this.handlers.wheel.activate()},CLASS_NAME:"OpenLayers.Control.Navigation"}),OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,multi:!1,featureAdded:function(){},initialize:function(n,t,i){OpenLayers.Control.prototype.initialize.apply(this,[i]),this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(n,t){this.layer.events.triggerEvent("sketchmodified",{vertex:n,feature:t})},create:function(n,t){this.layer.events.triggerEvent("sketchstarted",{vertex:n,feature:t})}},this.callbacks),this.layer=n,this.handlerOptions=this.handlerOptions||{},this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{renderers:n.renderers,rendererOptions:n.rendererOptions}),"multi"in this.handlerOptions||(this.handlerOptions.multi=this.multi),(n=this.layer.styleMap&&this.layer.styleMap.styles.temporary)&&(this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":n})})),this.handler=new t(this,this.callbacks,this.handlerOptions)},drawFeature:function(n){n=new OpenLayers.Feature.Vector(n),!1!==this.layer.events.triggerEvent("sketchcomplete",{feature:n})&&(n.state=OpenLayers.State.INSERT,this.layer.addFeatures([n]),this.featureAdded(n),this.events.triggerEvent("featureadded",{feature:n}))},insertXY:function(n,t){this.handler&&this.handler.line&&this.handler.insertXY(n,t)},insertDeltaXY:function(n,t){this.handler&&this.handler.line&&this.handler.insertDeltaXY(n,t)},insertDirectionLength:function(n,t){this.handler&&this.handler.line&&this.handler.insertDirectionLength(n,t)},insertDeflectionLength:function(n,t){this.handler&&this.handler.line&&this.handler.insertDeflectionLength(n,t)},undo:function(){return this.handler.undo&&this.handler.undo()},redo:function(){return this.handler.redo&&this.handler.redo()},finishSketch:function(){this.handler.finishGeometry()},cancel:function(){this.handler.cancel()},CLASS_NAME:"OpenLayers.Control.DrawFeature"}),OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{holeModifier:null,drawingHole:!1,polygon:null,createFeature:function(n){n=this.layer.getLonLatFromViewPortPx(n),n=new OpenLayers.Geometry.Point(n.lon,n.lat),this.point=new OpenLayers.Feature.Vector(n),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:!0})},addPoint:function(){if(!this.drawingHole&&this.holeModifier&&this.evt&&this.evt[this.holeModifier])for(var t=this.point.geometry,u=this.control.layer.features,i,r=u.length-1;0<=r;--r)if(i=u[r].geometry,(i instanceof OpenLayers.Geometry.Polygon||i instanceof OpenLayers.Geometry.MultiPolygon)&&i.intersects(t)){t=u[r],this.control.layer.removeFeatures([t],{silent:!0}),this.control.layer.events.registerPriority("sketchcomplete",this,this.finalizeInteriorRing),this.control.layer.events.registerPriority("sketchmodified",this,this.enforceTopology),t.geometry.addComponent(this.line.geometry),this.polygon=t,this.drawingHole=!0;break}OpenLayers.Handler.Path.prototype.addPoint.apply(this,arguments)},getCurrentPointIndex:function(){return this.line.geometry.components.length-2},enforceTopology:function(n){n=n.vertex;var t=this.line.geometry.components;this.polygon.geometry.intersects(n)||(t=t[t.length-3],n.x=t.x,n.y=t.y)},finishGeometry:function(){this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length-2]),this.removePoint(),this.finalize()},finalizeInteriorRing:function(){var r=this.line.geometry,t=0!==r.getArea(),i,n;if(t){for(i=this.polygon.geometry.components,n=i.length-2;0<=n;--n)if(r.intersects(i[n])){t=!1;break}if(t)n:for(n=i.length-2;0<n;--n)for(var f=i[n].components,u=0,e=f.length;u<e;++u)if(r.containsPoint(f[u])){t=!1;break n}}return t?this.polygon.state!==OpenLayers.State.INSERT&&(this.polygon.state=OpenLayers.State.UPDATE):this.polygon.geometry.removeComponent(r),this.restoreFeature(),!1},cancel:function(){return this.drawingHole&&(this.polygon.geometry.removeComponent(this.line.geometry),this.restoreFeature(!0)),OpenLayers.Handler.Path.prototype.cancel.apply(this,arguments)},restoreFeature:function(n){this.control.layer.events.unregister("sketchcomplete",this,this.finalizeInteriorRing),this.control.layer.events.unregister("sketchmodified",this,this.enforceTopology),this.layer.removeFeatures([this.polygon],{silent:!0}),this.control.layer.addFeatures([this.polygon],{silent:!0}),this.drawingHole=!1,n||this.control.layer.events.triggerEvent("sketchcomplete",{feature:this.polygon})},destroyFeature:function(n){OpenLayers.Handler.Path.prototype.destroyFeature.call(this,n),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 n=this.polygon&&this.polygon.geometry;return n&&this.multi&&(n=new OpenLayers.Geometry.MultiPolygon([n])),n},CLASS_NAME:"OpenLayers.Handler.Polygon"}),OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{citeCompliant:!1,initialize:function(n,t){OpenLayers.Control.Panel.prototype.initialize.apply(this,[t]),this.addControls([new OpenLayers.Control.Navigation]);var i=[new OpenLayers.Control.DrawFeature(n,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint",handlerOptions:{citeCompliant:this.citeCompliant}}),new OpenLayers.Control.DrawFeature(n,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath",handlerOptions:{citeCompliant:this.citeCompliant}}),new OpenLayers.Control.DrawFeature(n,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon",handlerOptions:{citeCompliant:this.citeCompliant}})];this.addControls(i)},draw:function(){var n=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return null===this.defaultControl&&(this.defaultControl=this.controls[0]),n},CLASS_NAME:"OpenLayers.Control.EditingToolbar"}),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,read:function(n){var t,i;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),t=n.documentElement,t&&(i=this["read_"+t.nodeName],n=i?i.call(this,t):new OpenLayers.Format.GML(this.options?this.options:{}).read(n)),n},read_msGMLOutput:function(n){var e=[],u,o,t,i,f;if(n=this.getSiblingNodesByTagCriteria(n,this.layerIdentifier))for(u=0,o=n.length;u<o;++u)if(t=n[u],i=t.nodeName,t.prefix&&(i=i.split(":")[1]),i=i.replace(this.layerIdentifier,""),t=this.getSiblingNodesByTagCriteria(t,this.featureIdentifier))for(f=0;f<t.length;f++){var r=t[f],s=this.parseGeometry(r),r=this.parseAttributes(r),r=new OpenLayers.Feature.Vector(s.geometry,r,null);r.bounds=s.bounds,r.type=i,e.push(r)}return e},read_FeatureInfoResponse:function(n){var o=[],u,s,i;for(n=this.getElementsByTagNameNS(n,"*","FIELDS"),u=0,s=n.length;u<s;u++){var r=n[u],e={},t,f=r.attributes.length;if(0<f)for(t=0;t<f;t++)i=r.attributes[t],e[i.nodeName]=i.nodeValue;else for(r=r.childNodes,t=0,f=r.length;t<f;++t)i=r[t],3!=i.nodeType&&(e[i.getAttribute("name")]=i.getAttribute("value"));o.push(new OpenLayers.Feature.Vector(null,e,null))}return o},getSiblingNodesByTagCriteria:function(n,t){var u=[],e,r,o,i,f;if(n&&n.hasChildNodes())for(e=n.childNodes,o=e.length,f=0;f<o;f++){for(i=e[f];i&&1!=i.nodeType;)i=i.nextSibling,f++;r=i?i.nodeName:"",0<r.length&&-1<r.indexOf(t)?u.push(i):(r=this.getSiblingNodesByTagCriteria(i,t),0<r.length&&(0==u.length?u=r:u.push(r)))}return u},parseAttributes:function(n){var u={},f,r,t,i;if(1==n.nodeType)for(n=n.childNodes,f=n.length,r=0;r<f;++r)i=n[r],1==i.nodeType&&(t=i.childNodes,i=i.prefix?i.nodeName.split(":")[1]:i.nodeName,0==t.length?u[i]=null:1==t.length&&(t=t[0],3==t.nodeType||4==t.nodeType)&&(t=t.nodeValue.replace(this.regExes.trimSpace,""),u[i]=t));return u},parseGeometry:function(n){this.gmlFormat||(this.gmlFormat=new OpenLayers.Format.GML),n=this.gmlFormat.parseFeature(n);var t,i=null;return n&&(t=n.geometry&&n.geometry.clone(),i=n.bounds&&n.bounds.clone(),n.destroy()),{geometry:t,bounds:i}},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"}),OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:!1,nativeJSON:function(){return!(!window.JSON||"function"!=typeof JSON.parse||"function"!=typeof JSON.stringify)}(),read:function(a,b){var c,d;if(this.nativeJSON)c=JSON.parse(a,b);else try{/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))&&(c=eval("("+a+")"),"function"==typeof b)&&(d=function(n,t){if(t&&"object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(t[i]=d(i,t[i]));return b(n,t)},c=d("",c))}catch(e){}return this.keepData&&(this.data=c),c},write:function(n,t){this.pretty=!!t;var i=null,r=typeof n;if(this.serialize[r])try{i=!this.pretty&&this.nativeJSON?JSON.stringify(n):this.serialize[r].apply(this,[n])}catch(u){OpenLayers.Console.error("Trouble serializing: "+u)}return i},writeIndent:function(){var t=[],n;if(this.pretty)for(n=0;n<this.level;++n)t.push(this.indent);return t.join("")},writeNewline:function(){return this.pretty?this.newline:""},writeSpace:function(){return this.pretty?this.space:""},serialize:{object:function(n){var t,i,r,u,f;if(null==n)return"null";if(n.constructor==Date)return this.serialize.date.apply(this,[n]);if(n.constructor==Array)return this.serialize.array.apply(this,[n]);t=["{"],this.level+=1,f=!1;for(i in n)n.hasOwnProperty(i)&&(r=OpenLayers.Format.JSON.prototype.write.apply(this,[i,this.pretty]),u=OpenLayers.Format.JSON.prototype.write.apply(this,[n[i],this.pretty]),null!=r&&null!=u&&(f&&t.push(","),t.push(this.writeNewline(),this.writeIndent(),r,":",this.writeSpace(),u),f=!0));return this.level-=1,t.push(this.writeNewline(),this.writeIndent(),"}"),t.join("")},array:function(n){var r,i=["["],t,u;for(this.level+=1,t=0,u=n.length;t<u;++t)r=OpenLayers.Format.JSON.prototype.write.apply(this,[n[t],this.pretty]),null!=r&&(0<t&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),r));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(n){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(n)?'"'+n.replace(/([\x00-\x1f\\"])/g,function(n,i){var r=t[i];return r?r:(r=i.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))})+'"':'"'+n+'"'},number:function(n){return isFinite(n)?String(n):"null"},boolean:function(n){return String(n)},date:function(n){function t(n){return 10>n?"0"+n:n}return'"'+n.getFullYear()+"-"+t(n.getMonth()+1)+"-"+t(n.getDate())+"T"+t(n.getHours())+":"+t(n.getMinutes())+":"+t(n.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"}),OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:!1,read:function(n,t,i){var f;t=t?t:"FeatureCollection";var r=null,u=null,u="string"==typeof n?OpenLayers.Format.JSON.prototype.read.apply(this,[n,i]):n;if(u){if("string"!=typeof u.type)OpenLayers.Console.error("Bad GeoJSON - no type: "+n);else if(this.isValidType(u,t))switch(t){case"Geometry":try{r=this.parseGeometry(u)}catch(e){OpenLayers.Console.error(e)}break;case"Feature":try{r=this.parseFeature(u),r.type="Feature"}catch(o){OpenLayers.Console.error(o)}break;case"FeatureCollection":switch(r=[],u.type){case"Feature":try{r.push(this.parseFeature(u))}catch(s){r=null,OpenLayers.Console.error(s)}break;case"FeatureCollection":for(n=0,t=u.features.length;n<t;++n)try{r.push(this.parseFeature(u.features[n]))}catch(h){r=null,OpenLayers.Console.error(h)}break;default:try{f=this.parseGeometry(u),r.push(new OpenLayers.Feature.Vector(f))}catch(c){r=null,OpenLayers.Console.error(c)}}}}else OpenLayers.Console.error("Bad JSON: "+n);return r},isValidType:function(n,t){var i=!1;switch(t){case"Geometry":-1==OpenLayers.Util.indexOf("Point MultiPoint LineString MultiLineString Polygon MultiPolygon Box GeometryCollection".split(" "),n.type)?OpenLayers.Console.error("Unsupported geometry type: "+n.type):i=!0;break;case"FeatureCollection":i=!0;break;default:n.type==t?i=!0:OpenLayers.Console.error("Cannot convert types from "+n.type+" to "+t)}return i},parseFeature:function(n){var t,r,i;r=n.properties?n.properties:{},i=n.geometry&&n.geometry.bbox||n.bbox;try{t=this.parseGeometry(n.geometry)}catch(u){throw u;}return t=new OpenLayers.Feature.Vector(t,r),i&&(t.bounds=OpenLayers.Bounds.fromArray(i)),n.id&&(t.fid=n.id),t},parseGeometry:function(n){var t,i,r;if(null==n)return null;if(i=!1,"GeometryCollection"==n.type){if(!OpenLayers.Util.isArray(n.geometries))throw"GeometryCollection must have geometries array: "+n;for(t=n.geometries.length,i=Array(t),r=0;r<t;++r)i[r]=this.parseGeometry.apply(this,[n.geometries[r]]);t=new OpenLayers.Geometry.Collection(i),i=!0}else{if(!OpenLayers.Util.isArray(n.coordinates))throw"Geometry must have coordinates array: "+n;if(!this.parseCoords[n.type.toLowerCase()])throw"Unsupported geometry type: "+n.type;try{t=this.parseCoords[n.type.toLowerCase()].apply(this,[n.coordinates])}catch(u){throw u;}}return this.internalProjection&&this.externalProjection&&!i&&t.transform(this.externalProjection,this.internalProjection),t},parseCoords:{point:function(n){if(!1==this.ignoreExtraDims&&2!=n.length)throw"Only 2D points are supported: "+n;return new OpenLayers.Geometry.Point(n[0],n[1])},multipoint:function(n){for(var i=[],r=null,t=0,u=n.length;t<u;++t){try{r=this.parseCoords.point.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.MultiPoint(i)},linestring:function(n){for(var i=[],r=null,t=0,u=n.length;t<u;++t){try{r=this.parseCoords.point.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.LineString(i)},multilinestring:function(n){for(var i=[],r=null,t=0,u=n.length;t<u;++t){try{r=this.parseCoords.linestring.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.MultiLineString(i)},polygon:function(n){for(var i=[],r,u,t=0,f=n.length;t<f;++t){try{u=this.parseCoords.linestring.apply(this,[n[t]])}catch(e){throw e;}r=new OpenLayers.Geometry.LinearRing(u.components),i.push(r)}return new OpenLayers.Geometry.Polygon(i)},multipolygon:function(n){for(var i=[],r=null,t=0,u=n.length;t<u;++t){try{r=this.parseCoords.polygon.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.MultiPolygon(i)},box:function(n){if(2!=n.length)throw"GeoJSON box coordinates must have 2 elements";return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(n[0][0],n[0][1]),new OpenLayers.Geometry.Point(n[1][0],n[0][1]),new OpenLayers.Geometry.Point(n[1][0],n[1][1]),new OpenLayers.Geometry.Point(n[0][0],n[1][1]),new OpenLayers.Geometry.Point(n[0][0],n[0][1])])])}},write:function(n,t){var i={type:null},f,r,u;if(OpenLayers.Util.isArray(n))for(i.type="FeatureCollection",f=n.length,i.features=Array(f),r=0;r<f;++r){if(u=n[r],!u instanceof OpenLayers.Feature.Vector)throw"FeatureCollection only supports collections of features: "+u;i.features[r]=this.extract.feature.apply(this,[u])}else 0==n.CLASS_NAME.indexOf("OpenLayers.Geometry")?i=this.extract.geometry.apply(this,[n]):n instanceof OpenLayers.Feature.Vector&&(i=this.extract.feature.apply(this,[n]),n.layer&&n.layer.projection&&(i.crs=this.createCRSObject(n)));return OpenLayers.Format.JSON.prototype.write.apply(this,[i,t])},createCRSObject:function(n){n=n.layer.projection.toString();var t={};return n.match(/epsg:/i)&&(n=parseInt(n.substring(n.indexOf(":")+1)),t=4326==n?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+n}}),t},extract:{feature:function(n){var t=this.extract.geometry.apply(this,[n.geometry]),t={type:"Feature",properties:n.attributes,geometry:t};return null!=n.fid&&(t.id=n.fid),t},geometry:function(n){if(null==n)return null;this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection));var t=n.CLASS_NAME.split(".")[2];return n=this.extract[t.toLowerCase()].apply(this,[n]),"Collection"==t?{type:"GeometryCollection",geometries:n}:{type:t,coordinates:n}},point:function(n){return[n.x,n.y]},multipoint:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push(this.extract.point.apply(this,[n.components[t]]));return i},linestring:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push(this.extract.point.apply(this,[n.components[t]]));return i},multilinestring:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push(this.extract.linestring.apply(this,[n.components[t]]));return i},polygon:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push(this.extract.linestring.apply(this,[n.components[t]]));return i},multipolygon:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push(this.extract.polygon.apply(this,[n.components[t]]));return i},collection:function(n){for(var i=n.components.length,r=Array(i),t=0;t<i;++t)r[t]=this.extract.geometry.apply(this,[n.components[t]]);return r}},CLASS_NAME:"OpenLayers.Format.GeoJSON"}),OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);return n&&(this.layer.events.on({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this}),this.update()),n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&this.layer.events.un({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this}),n},update:function(n){var t=this.getMapBounds();null!==t&&(n&&n.force||this.layer.visibility&&this.layer.calculateInRange()&&this.invalidBounds(t))&&(this.calculateBounds(t),this.resolution=this.layer.map.getResolution(),this.triggerRead(n))},getMapBounds:function(){if(null===this.layer.map)return null;var n=this.layer.map.getExtent();return n&&!this.layer.projection.equals(this.layer.map.getProjectionObject())&&(n=n.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)),n},invalidBounds:function(n){return n||(n=this.getMapBounds()),n=!this.bounds||!this.bounds.containsBounds(n),!n&&this.resFactor&&(n=this.resolution/this.layer.map.getResolution(),n=n>=this.resFactor||n<=1/this.resFactor),n},calculateBounds:function(n){n||(n=this.getMapBounds());var t=n.getCenterLonLat(),i=n.getWidth()*this.ratio;n=n.getHeight()*this.ratio,this.bounds=new OpenLayers.Bounds(t.lon-i/2,t.lat-n/2,t.lon+i/2,t.lat+n/2)},triggerRead:function(n){!this.response||n&&!0===n.noAbort||(this.layer.protocol.abort(this.response),this.layer.events.triggerEvent("loadend"));var t={filter:this.createFilter()};this.layer.events.triggerEvent("loadstart",t),this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:t.filter,callback:this.merge,scope:this},n))},createFilter:function(){var n=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});return this.layer.filter&&(n=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,n]})),n},merge:function(n){var t,r,u,f,i,e;if(this.layer.destroyFeatures(),n.success()){if(t=n.features,t&&0<t.length){if(r=this.layer.projection,u=this.layer.map.getProjectionObject(),!u.equals(r))for(i=0,e=t.length;i<e;++i)(f=t[i].geometry)&&f.transform(r,u);this.layer.addFeatures(t)}}else this.bounds=null;this.response=null,this.layer.events.triggerEvent("loadend",{response:n})},CLASS_NAME:"OpenLayers.Strategy.BBOX"}),OpenLayers.Format.SLD.v1_0_0_GeoServer=OpenLayers.Class(OpenLayers.Format.SLD.v1_0_0,{version:"1.0.0",profile:"GeoServer",readers:OpenLayers.Util.applyDefaults({sld:OpenLayers.Util.applyDefaults({Priority:function(n,t){var i=this.readers.ogc._expression.call(this,n);i&&(t.priority=i)},VendorOption:function(n,t){t.vendorOptions||(t.vendorOptions={}),t.vendorOptions[n.getAttribute("name")]=this.getChildValue(n)},TextSymbolizer:function(n,t){OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld.TextSymbolizer.apply(this,arguments);var i=this.multipleSymbolizers?t.symbolizers[t.symbolizers.length-1]:t.symbolizer.Text;void 0===i.graphic&&(i.graphic=!1)}},OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.readers),writers:OpenLayers.Util.applyDefaults({sld:OpenLayers.Util.applyDefaults({Priority:function(n){return this.writers.sld._OGCExpression.call(this,"sld:Priority",n)},VendorOption:function(n){return this.createElementNSPlus("sld:VendorOption",{attributes:{name:n.name},value:n.value})},TextSymbolizer:function(n){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.TextSymbolizer.apply(this,arguments);return!1!==n.graphic&&(n.externalGraphic||n.graphicName)&&this.writeNode("Graphic",n,t),"priority"in n&&this.writeNode("Priority",n.priority,t),this.addVendorOptions(t,n)},PointSymbolizer:function(n){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PointSymbolizer.apply(this,arguments);return this.addVendorOptions(t,n)},LineSymbolizer:function(n){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.LineSymbolizer.apply(this,arguments);return this.addVendorOptions(t,n)},PolygonSymbolizer:function(n){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PolygonSymbolizer.apply(this,arguments);return this.addVendorOptions(t,n)}},OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.writers),addVendorOptions:function(n,t){if(t.vendorOptions)for(var i in t.vendorOptions)this.writeNode("VendorOption",{name:i,value:t.vendorOptions[i]},n);return n},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0_GeoServer"}),OpenLayers.Protocol.CSW=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Protocol.CSW.DEFAULTS);var t=OpenLayers.Protocol.CSW["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSW version: "+n.version;return new t(n)},OpenLayers.Protocol.CSW.DEFAULTS={version:"2.0.2"},OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.1.0",initialize:function(){OpenLayers.Protocol.WFS.v1.prototype.initialize.apply(this,arguments),this.outputFormat&&!this.readFormat&&("gml2"==this.outputFormat.toLowerCase()?this.readFormat=new OpenLayers.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName}):"json"==this.outputFormat.toLowerCase()&&(this.readFormat=new OpenLayers.Format.GeoJSON))},CLASS_NAME:"OpenLayers.Protocol.WFS.v1_1_0"}),OpenLayers.Format.WMTSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",yx:{"urn:ogc:def:crs:EPSG::4326":!0},createLayer:function(n,t){var a,f,w,e,v,c,y,s,l,p,i,o;if(!("layer"in t))throw Error("Missing property 'layer' in configuration.");for(var u=n.contents,r,i=0,o=u.layers.length;i<o;++i)if(u.layers[i].identifier===t.layer){r=u.layers[i];break}if(!r)throw Error("Layer not found");if(a=t.format,!a&&r.formats&&r.formats.length&&(a=r.formats[0]),t.matrixSet?f=u.tileMatrixSets[t.matrixSet]:1<=r.tileMatrixSetLinks.length&&(f=u.tileMatrixSets[r.tileMatrixSetLinks[0].tileMatrixSet]),!f)throw Error("matrixSet not found");for(i=0,o=r.styles.length;i<o&&(w=r.styles[i],!w.isDefault);++i);for(u=t.requestEncoding,!u&&(u="KVP",n.operationsMetadata.GetTile.dcp.http)&&(e=n.operationsMetadata.GetTile.dcp.http,e.get[0].constraints&&(e=e.get[0].constraints.GetEncoding.allowedValues,e.KVP||!e.REST&&!e.RESTful||(u="REST"))),e=[],v=t.params||{},delete t.params,c=0,y=r.dimensions.length;c<y;c++)s=r.dimensions[c],e.push(s.identifier),v.hasOwnProperty(s.identifier)||(v[s.identifier]=s["default"]);var c=t.projection||f.supportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"),y=t.units||("EPSG:4326"===c?"degrees":"m"),s=[],h;for(h in f.matrixIds)f.matrixIds.hasOwnProperty(h)&&s.push(.00028*f.matrixIds[h].scaleDenominator/OpenLayers.METERS_PER_INCH/OpenLayers.INCHES_PER_UNIT[y]);if("REST"===u&&r.resourceUrls)for(h=[],o=0,l=r.resourceUrls.length;o<l;++o)i=r.resourceUrls[o],i.format===a&&"tile"===i.resourceType&&h.push(i.template);else for(l=n.operationsMetadata.GetTile.dcp.http.get,h=[],i=0,o=l.length;i<o;i++)p=l[i].constraints,(!p||p&&p.GetEncoding.allowedValues[u])&&h.push(l[i].url);return new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults(t,{url:h,requestEncoding:u,name:r.title,style:w.identifier,format:a,matrixIds:f.matrixIds,matrixSet:f.identifier,projection:c,units:y,resolutions:!1===t.isBaseLayer?void 0:s,serverResolutions:s,tileFullExtent:f.bounds,dimensions:e,params:v}))},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities"}),OpenLayers.Layer.Google.v3={DEFAULTS:{sphericalMercator:!0,projection:"EPSG:900913"},animationEnabled:!0,loadMapObject:function(){this.type||(this.type=google.maps.MapTypeId.ROADMAP);var t,n=OpenLayers.Layer.Google.cache[this.map.id];n?(t=n.mapObject,++n.count):(t=this.map.getCenter(),n=document.createElement("div"),n.className="olForeignContainer",n.style.width="100%",n.style.height="100%",t=new google.maps.Map(n,{center:t?new google.maps.LatLng(t.lat,t.lon):new google.maps.LatLng(0,0),zoom:this.map.getZoom()||0,mapTypeId:this.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,streetViewControl:!1}),n=document.createElement("div"),n.style.width="100%",n.style.height="100%",t.controls[google.maps.ControlPosition.TOP_LEFT].push(n),n={googleControl:n,mapObject:t,count:1},OpenLayers.Layer.Google.cache[this.map.id]=n),this.mapObject=t,this.setGMapVisibility(this.visibility)},onMapResize:function(){this.visibility&&google.maps.event.trigger(this.mapObject,"resize")},setGMapVisibility:function(n){var r=OpenLayers.Layer.Google.cache[this.map.id],t=this.map,f;if(r){for(var o=this.type,i=t.layers,u,e=i.length-1;0<=e;--e)if(u=i[e],u instanceof OpenLayers.Layer.Google&&!0===u.visibility&&!0===u.inRange){o=u.type,n=!0;break}i=this.mapObject.getDiv(),!0===n?(i.parentNode!==t.div&&(r.rendered?(t.div.appendChild(i),r.googleControl.appendChild(t.viewPortDiv),google.maps.event.trigger(this.mapObject,"resize")):(f=this,google.maps.event.addListenerOnce(this.mapObject,"tilesloaded",function(){r.rendered=!0,f.setGMapVisibility(f.getVisibility()),f.moveTo(f.map.getCenter())}))),this.mapObject.setMapTypeId(o)):r.googleControl.hasChildNodes()&&(t.div.appendChild(t.viewPortDiv),t.div.removeChild(i))}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(n){var t=null;return null!=n&&(t=this.sphericalMercator?this.inverseMercator(n.bottom,n.left):new OpenLayers.LonLat(n.bottom,n.left),n=this.sphericalMercator?this.inverseMercator(n.top,n.right):new OpenLayers.LonLat(n.top,n.right),t=new google.maps.LatLngBounds(new google.maps.LatLng(t.lat,t.lon),new google.maps.LatLng(n.lat,n.lon))),t},getMapObjectLonLatFromMapObjectPixel:function(n){var t=this.map.getSize(),r=this.getLongitudeFromMapObjectLonLat(this.mapObject.center),u=this.getLatitudeFromMapObjectLonLat(this.mapObject.center),i=this.map.getResolution();return n=new OpenLayers.LonLat(r+(n.x-t.w/2)*i,u-(n.y-t.h/2)*i),this.wrapDateLine&&(n=n.wrapDateLine(this.maxExtent)),this.getMapObjectLonLatFromLonLat(n.lon,n.lat)},getMapObjectPixelFromMapObjectLonLat:function(n){var r=this.getLongitudeFromMapObjectLonLat(n),t,i;return n=this.getLatitudeFromMapObjectLonLat(n),t=this.map.getResolution(),i=this.map.getExtent(),this.getMapObjectPixelFromXY(1/t*(r-i.left),1/t*(i.top-n))},setMapObjectCenter:function(n,t){if(!1===this.animationEnabled&&t!=this.mapObject.zoom){var i=this.getMapContainer();google.maps.event.addListenerOnce(this.mapObject,"idle",function(){i.style.visibility=""}),i.style.visibility="hidden"}this.mapObject.setOptions({center:n,zoom:t})},getMapObjectZoomFromMapObjectBounds:function(n){return this.mapObject.getBoundsZoomLevel(n)},getMapObjectLonLatFromLonLat:function(n,t){var i;return this.sphericalMercator?(i=this.inverseMercator(n,t),i=new google.maps.LatLng(i.lat,i.lon)):i=new google.maps.LatLng(t,n),i},getMapObjectPixelFromXY:function(n,t){return new google.maps.Point(n,t)}},OpenLayers.Format.WPSDescribeProcess=OpenLayers.Class(OpenLayers.Format.XML,{VERSION:"1.0.0",namespaces:{wps:"http://www.opengis.net/wps/1.0.0",ows:"http://www.opengis.net/ows/1.1",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",defaultPrefix:"wps",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{wps:{ProcessDescriptions:function(n,t){t.processDescriptions={},this.readChildNodes(n,t.processDescriptions)},ProcessDescription:function(n,t){var i={processVersion:this.getAttributeNS(n,this.namespaces.wps,"processVersion"),statusSupported:"true"===n.getAttribute("statusSupported"),storeSupported:"true"===n.getAttribute("storeSupported")};this.readChildNodes(n,i),t[i.identifier]=i},DataInputs:function(n,t){t.dataInputs=[],this.readChildNodes(n,t.dataInputs)},ProcessOutputs:function(n,t){t.processOutputs=[],this.readChildNodes(n,t.processOutputs)},Output:function(n,t){var i={};this.readChildNodes(n,i),t.push(i)},ComplexOutput:function(n,t){t.complexOutput={},this.readChildNodes(n,t.complexOutput)},LiteralOutput:function(n,t){t.literalOutput={},this.readChildNodes(n,t.literalOutput)},Input:function(n,t){var i={maxOccurs:parseInt(n.getAttribute("maxOccurs")),minOccurs:parseInt(n.getAttribute("minOccurs"))};this.readChildNodes(n,i),t.push(i)},BoundingBoxData:function(n,t){t.boundingBoxData={},this.readChildNodes(n,t.boundingBoxData)},CRS:function(n,t){t.CRSs||(t.CRSs={}),t.CRSs[this.getChildValue(n)]=!0},LiteralData:function(n,t){t.literalData={},this.readChildNodes(n,t.literalData)},ComplexData:function(n,t){t.complexData={},this.readChildNodes(n,t.complexData)},Default:function(n,t){t["default"]={},this.readChildNodes(n,t["default"])},Supported:function(n,t){t.supported={},this.readChildNodes(n,t.supported)},Format:function(n,t){var i={};this.readChildNodes(n,i),t.formats||(t.formats={}),t.formats[i.mimeType]=!0},MimeType:function(n,t){t.mimeType=this.getChildValue(n)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSDescribeProcess"}),OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(n){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,[n])},read:function(n){var t,i;if(n=n.replace(/[\n\r]/g," "),(i=this.regExes.typeStr.exec(n))&&(n=i[1].toLowerCase(),i=i[2],this.parse[n]&&(t=this.parse[n].apply(this,[i])),this.internalProjection&&this.externalProjection))if(t&&"OpenLayers.Feature.Vector"==t.CLASS_NAME)t.geometry.transform(this.externalProjection,this.internalProjection);else if(t&&"geometrycollection"!=n&&"object"==typeof t)for(n=0,i=t.length;n<i;n++)t[n].geometry.transform(this.externalProjection,this.internalProjection);return t},write:function(n){var u,i,t,r,f;for(n.constructor==Array?i=!0:(n=[n],i=!1),t=[],i&&t.push("GEOMETRYCOLLECTION("),r=0,f=n.length;r<f;++r)i&&0<r&&t.push(","),u=n[r].geometry,t.push(this.extractGeometry(u));return i&&t.push(")"),t.join("")},extractGeometry:function(n){var t=n.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?(this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection)),("collection"==t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[n])+")"):null},extract:{point:function(n){return n.x+" "+n.y},multipoint:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push("("+this.extract.point.apply(this,[n.components[t]])+")");return i.join(",")},linestring:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push(this.extract.point.apply(this,[n.components[t]]));return i.join(",")},multilinestring:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push("("+this.extract.linestring.apply(this,[n.components[t]])+")");return i.join(",")},polygon:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push("("+this.extract.linestring.apply(this,[n.components[t]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push("("+this.extract.polygon.apply(this,[n.components[t]])+")");return i.join(",")},collection:function(n){for(var i=[],t=0,r=n.components.length;t<r;++t)i.push(this.extractGeometry.apply(this,[n.components[t]]));return i.join(",")}},parse:{point:function(n){return n=OpenLayers.String.trim(n).split(this.regExes.spaces),new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(n[0],n[1]))},multipoint:function(n){for(var i=OpenLayers.String.trim(n).split(","),r=[],t=0,u=i.length;t<u;++t)n=i[t].replace(this.regExes.trimParens,"$1"),r.push(this.parse.point.apply(this,[n]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(r))},linestring:function(n){n=OpenLayers.String.trim(n).split(",");for(var i=[],t=0,r=n.length;t<r;++t)i.push(this.parse.point.apply(this,[n[t]]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(i))},multilinestring:function(n){for(var i=OpenLayers.String.trim(n).split(this.regExes.parenComma),r=[],t=0,u=i.length;t<u;++t)n=i[t].replace(this.regExes.trimParens,"$1"),r.push(this.parse.linestring.apply(this,[n]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(r))},polygon:function(n){var t;n=OpenLayers.String.trim(n).split(this.regExes.parenComma);for(var r=[],i=0,u=n.length;i<u;++i)t=n[i].replace(this.regExes.trimParens,"$1"),t=this.parse.linestring.apply(this,[t]).geometry,t=new OpenLayers.Geometry.LinearRing(t.components),r.push(t);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(r))},multipolygon:function(n){for(var i=OpenLayers.String.trim(n).split(this.regExes.doubleParenComma),r=[],t=0,u=i.length;t<u;++t)n=i[t].replace(this.regExes.trimParens,"$1"),r.push(this.parse.polygon.apply(this,[n]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(r))},geometrycollection:function(n){n=n.replace(/,\s*([A-Za-z])/g,"|$1"),n=OpenLayers.String.trim(n).split("|");for(var i=[],t=0,r=n.length;t<r;++t)i.push(OpenLayers.Format.WKT.prototype.read.apply(this,[n[t]]));return i}},CLASS_NAME:"OpenLayers.Format.WKT"}),OpenLayers.WPSProcess=OpenLayers.Class({client:null,server:null,identifier:null,description:null,localWPS:"http://geoserver/wps",formats:null,chained:0,executeCallbacks:null,initialize:function(n){OpenLayers.Util.extend(this,n),this.executeCallbacks=[],this.formats={"application/wkt":new OpenLayers.Format.WKT,"application/json":new OpenLayers.Format.GeoJSON}},describe:function(n){if(n=n||{},this.description){if(n.callback){var t=this.description;window.setTimeout(function(){n.callback.call(n.scope,t)},0)}}else this.client.describeProcess(this.server,this.identifier,function(t){this.description||this.parseDescription(t),n.callback&&n.callback.call(n.scope,this.description)},this)},configure:function(n){return this.describe({callback:function(){for(var r=this.description,f=n.inputs,i,t=0,u=r.dataInputs.length;t<u;++t)i=r.dataInputs[t],this.setInputData(i,f[i.identifier]);n.callback&&n.callback.call(n.scope)},scope:this}),this},execute:function(n){this.configure({inputs:n.inputs,callback:function(){var t=this,i=this.getOutputIndex(t.description.processOutputs,n.output);t.setResponseForm({outputIndex:i}),function r(){OpenLayers.Util.removeItem(t.executeCallbacks,r),0!==t.chained?t.executeCallbacks.push(r):OpenLayers.Request.POST({url:t.client.servers[t.server].url,data:(new OpenLayers.Format.WPSExecute).write(t.description),success:function(r){var u=t.findMimeType(t.description.processOutputs[i].complexOutput.supported.formats);r=t.formats[u].read(r.responseText),r instanceof OpenLayers.Feature.Vector&&(r=[r]),n.success&&(u={},u[n.output||"result"]=r,n.success.call(n.scope,u))},scope:t})}()},scope:this})},output:function(n){return new OpenLayers.WPSProcess.ChainLink({process:this,output:n})},parseDescription:function(n){n=this.client.servers[this.server],this.description=(new OpenLayers.Format.WPSDescribeProcess).read(n.processDescription[this.identifier]).processDescriptions[this.identifier]},setInputData:function(n,t){if(delete n.data,delete n.reference,t instanceof OpenLayers.WPSProcess.ChainLink)++this.chained,n.reference={method:"POST",href:t.process.server===this.server?this.localWPS:this.client.servers[t.process.server].url},t.process.describe({callback:function(){--this.chained,this.chainProcess(n,t)},scope:this});else{n.data={};var i=n.complexData;i?(i=this.findMimeType(i.supported.formats),n.data.complexData={mimeType:i,value:this.formats[i].write(this.toFeatures(t))}):n.data.literalData={value:t}}},setResponseForm:function(n){n=n||{};var t=this.description.processOutputs[n.outputIndex||0];this.description.responseForm={rawDataOutput:{identifier:t.identifier,mimeType:this.findMimeType(t.complexOutput.supported.formats,n.supportedFormats)}}},getOutputIndex:function(n,t){var r,i;if(t){for(i=n.length-1;0<=i;--i)if(n[i].identifier===t){r=i;break}}else r=0;return r},chainProcess:function(n,t){var r=this.getOutputIndex(t.process.description.processOutputs,t.output),i;for(n.reference.mimeType=this.findMimeType(n.complexData.supported.formats,t.process.description.processOutputs[r].complexOutput.supported.formats),i={},i[n.reference.mimeType]=!0,t.process.setResponseForm({outputIndex:r,supportedFormats:i}),n.reference.body=t.process.description;0<this.executeCallbacks.length;)this.executeCallbacks[0]()},toFeatures:function(n){var u=OpenLayers.Util.isArray(n);u||(n=[n]);for(var r=Array(n.length),t,i=0,f=n.length;i<f;++i)t=n[i],r[i]=t instanceof OpenLayers.Feature.Vector?t:new OpenLayers.Feature.Vector(t);return u?r:r[0]},findMimeType:function(n,t){t=t||this.formats;for(var i in n)if(i in t)return i},CLASS_NAME:"OpenLayers.WPSProcess"}),OpenLayers.WPSProcess.ChainLink=OpenLayers.Class({process:null,output:null,initialize:function(n){OpenLayers.Util.extend(this,n)},CLASS_NAME:"OpenLayers.WPSProcess.ChainLink"}),OpenLayers.WPSClient=OpenLayers.Class({servers:null,version:"1.0.0",lazy:!1,events:null,initialize:function(n){OpenLayers.Util.extend(this,n),this.events=new OpenLayers.Events(this),this.servers={};for(var t in n.servers)this.servers[t]="string"==typeof n.servers[t]?{url:n.servers[t],version:this.version,processDescription:{}}:n.servers[t]},execute:function(n){this.getProcess(n.server,n.process).execute({inputs:n.inputs,success:n.success,scope:n.scope})},getProcess:function(n,t){var i=new OpenLayers.WPSProcess({client:this,server:n,identifier:t});return this.lazy||i.describe(),i},describeProcess:function(n,t,i,r){var u=this.servers[n];u.processDescription[t]?window.setTimeout(function(){i.call(r,u.processDescription[t])},0):t in u.processDescription?this.events.register("describeprocess",this,function f(n){n.identifier===t&&(this.events.unregister("describeprocess",this,f),i.call(r,n.raw))}):(u.processDescription[t]=null,OpenLayers.Request.GET({url:u.url,params:{SERVICE:"WPS",VERSION:u.version,REQUEST:"DescribeProcess",IDENTIFIER:t},success:function(n){u.processDescription[t]=n.responseText,this.events.triggerEvent("describeprocess",{identifier:t,raw:n.responseText})},scope:this}))},destroy:function(){this.events.destroy(),this.servers=this.events=null},CLASS_NAME:"OpenLayers.WPSClient"}),OpenLayers.Format.CSWGetRecords.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{csw:"http://www.opengis.net/cat/csw/2.0.2",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",gmd:"http://www.isotc211.org/2005/gmd",geonet:"http://www.fao.org/geonetwork",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",requestId:null,resultType:null,outputFormat:null,outputSchema:null,startPosition:null,maxRecords:null,DistributedSearch:null,ResponseHandler:null,Query:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{csw:{GetRecordsResponse:function(n,t){t.records=[],this.readChildNodes(n,t);var i=this.getAttributeNS(n,"","version");""!=i&&(t.version=i)},RequestId:function(n,t){t.RequestId=this.getChildValue(n)},SearchStatus:function(n,t){t.SearchStatus={};var i=this.getAttributeNS(n,"","timestamp");""!=i&&(t.SearchStatus.timestamp=i)},SearchResults:function(n,t){this.readChildNodes(n,t);for(var r=n.attributes,u={},i=0,f=r.length;i<f;++i)u[r[i].name]="numberOfRecordsMatched"==r[i].name||"numberOfRecordsReturned"==r[i].name||"nextRecord"==r[i].name?parseInt(r[i].nodeValue):r[i].nodeValue;t.SearchResults=u},SummaryRecord:function(n,t){var i={type:"SummaryRecord"};this.readChildNodes(n,i),t.records.push(i)},BriefRecord:function(n,t){var i={type:"BriefRecord"};this.readChildNodes(n,i),t.records.push(i)},DCMIRecord:function(n,t){var i={type:"DCMIRecord"};this.readChildNodes(n,i),t.records.push(i)},Record:function(n,t){var i={type:"Record"};this.readChildNodes(n,i),t.records.push(i)},"*":function(n,t){var i=n.localName||n.nodeName.split(":").pop();t[i]=this.getChildValue(n)}},geonet:{info:function(n,t){var i={};this.readChildNodes(n,i),t.gninfo=i}},dc:{"*":function(n,t){var u=n.localName||n.nodeName.split(":").pop();OpenLayers.Util.isArray(t[u])||(t[u]=[]);for(var i={},f=n.attributes,r=0,e=f.length;r<e;++r)i[f[r].name]=f[r].nodeValue;i.value=this.getChildValue(n),""!=i.value&&t[u].push(i)}},dct:{"*":function(n,t){var i=n.localName||n.nodeName.split(":").pop();OpenLayers.Util.isArray(t[i])||(t[i]=[]),t[i].push(this.getChildValue(n))}},ows:OpenLayers.Util.applyDefaults({BoundingBox:function(n,t){t.bounds&&(t.BoundingBox=[{crs:t.projection,value:[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top]}],delete t.projection,delete t.bounds),OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows.BoundingBox.apply(this,arguments)}},OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows)},write:function(n){return n=this.writeNode("csw:GetRecords",n),n.setAttribute("xmlns:gmd",this.namespaces.gmd),OpenLayers.Format.XML.prototype.write.apply(this,[n])},writers:{csw:{GetRecords:function(n){var t,i,r,u;if(n||(n={}),t=this.createElementNSPlus("csw:GetRecords",{attributes:{service:"CSW",version:this.version,requestId:n.requestId||this.requestId,resultType:n.resultType||this.resultType,outputFormat:n.outputFormat||this.outputFormat,outputSchema:n.outputSchema||this.outputSchema,startPosition:n.startPosition||this.startPosition,maxRecords:n.maxRecords||this.maxRecords}}),(n.DistributedSearch||this.DistributedSearch)&&this.writeNode("csw:DistributedSearch",n.DistributedSearch||this.DistributedSearch,t),i=n.ResponseHandler||this.ResponseHandler,OpenLayers.Util.isArray(i)&&0<i.length)for(r=0,u=i.length;r<u;r++)this.writeNode("csw:ResponseHandler",i[r],t);return this.writeNode("Query",n.Query||this.Query,t),t},DistributedSearch:function(n){return this.createElementNSPlus("csw:DistributedSearch",{attributes:{hopCount:n.hopCount}})},ResponseHandler:function(n){return this.createElementNSPlus("csw:ResponseHandler",{value:n.value})},Query:function(n){var t,i,r,u;if(n||(n={}),t=this.createElementNSPlus("csw:Query",{attributes:{typeNames:n.typeNames||"csw:Record"}}),i=n.ElementName,OpenLayers.Util.isArray(i)&&0<i.length)for(r=0,u=i.length;r<u;r++)this.writeNode("csw:ElementName",i[r],t);else this.writeNode("csw:ElementSetName",n.ElementSetName||{value:"summary"},t);return n.Constraint&&this.writeNode("csw:Constraint",n.Constraint,t),n.SortBy&&this.writeNode("ogc:SortBy",n.SortBy,t),t},ElementName:function(n){return this.createElementNSPlus("csw:ElementName",{value:n.value})},ElementSetName:function(n){return this.createElementNSPlus("csw:ElementSetName",{attributes:{typeNames:n.typeNames},value:n.value})},Constraint:function(n){var t=this.createElementNSPlus("csw:Constraint",{attributes:{version:n.version}}),i;return n.Filter?(i=new OpenLayers.Format.Filter({version:n.version}),t.appendChild(i.write(n.Filter))):n.CqlText&&(n=this.createElementNSPlus("CqlText",{value:n.CqlText.value}),t.appendChild(n)),t}},ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.CSWGetRecords.v2_0_2"}),OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(n,t,i){this.bounds=n,this.div=OpenLayers.Util.createDiv(),this.div.style.overflow="hidden",this.events=new OpenLayers.Events(this,this.div),this.setBorder(t,i)},destroy:function(){this.div=this.bounds=null,OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(n,t){n||(n="red"),t||(t=2),this.div.style.border=t+"px solid "+n},draw:function(n,t){return OpenLayers.Util.modifyDOMElement(this.div,null,n,t),this.div},onScreen:function(){var n=!1;return this.map&&(n=this.map.getExtent().containsBounds(this.bounds,!0,!0)),n},display:function(n){this.div.style.display=n?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"}),OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:!0,initialize:function(n){n=n||{},!1!==n.extractStyles&&(n.defaultStyle={externalGraphic:OpenLayers.Util.getImageLocation("marker.png"),graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5}),OpenLayers.Format.prototype.initialize.apply(this,[n])},read:function(n){var r,c,h,i,o;for(n=n.split("\n"),c=[],h=0;h<n.length-1;h++)if(i=n[h].replace(/^\s*/,"").replace(/\s*$/,""),"#"!=i.charAt(0))if(r){for(var i=i.split("\t"),e=new OpenLayers.Geometry.Point(0,0),s={},u=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null,f=!1,t=0;t<i.length;t++)i[t]&&("point"==r[t]?(f=i[t].split(","),e.y=parseFloat(f[0]),e.x=parseFloat(f[1]),f=!0):"lat"==r[t]?(e.y=parseFloat(i[t]),f=!0):"lon"==r[t]?(e.x=parseFloat(i[t]),f=!0):"title"==r[t]?s.title=i[t]:"image"==r[t]||"icon"==r[t]&&u?u.externalGraphic=i[t]:"iconSize"==r[t]&&u?(o=i[t].split(","),u.graphicWidth=parseFloat(o[0]),u.graphicHeight=parseFloat(o[1])):"iconOffset"==r[t]&&u?(o=i[t].split(","),u.graphicXOffset=parseFloat(o[0]),u.graphicYOffset=parseFloat(o[1])):"description"==r[t]?s.description=i[t]:"overflow"==r[t]?s.overflow=i[t]:s[r[t]]=i[t]);f&&(this.internalProjection&&this.externalProjection&&e.transform(this.externalProjection,this.internalProjection),i=new OpenLayers.Feature.Vector(e,s,u),c.push(i))}else r=i.split("\t");return c},CLASS_NAME:"OpenLayers.Format.Text"}),OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments),this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments),this.clearFeatures(),this.features=null},loadText:function(){this.loaded||null==this.location||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:function(){this.events.triggerEvent("loadend")},scope:this}),this.loaded=!0)},moveTo:function(){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),this.visibility&&!this.loaded&&this.loadText()},parseData:function(n){var r,e,i,t,u,f,o;for(n=n.responseText,r={},OpenLayers.Util.extend(r,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(r.externalProjection=this.projection,r.internalProjection=this.map.getProjectionObject()),n=new OpenLayers.Format.Text(r).read(n),r=0,e=n.length;r<e;r++)i={},t=n[r],u=new OpenLayers.LonLat(t.geometry.x,t.geometry.y),t.style.graphicWidth&&t.style.graphicHeight&&(f=new OpenLayers.Size(t.style.graphicWidth,t.style.graphicHeight)),void 0!==t.style.graphicXOffset&&void 0!==t.style.graphicYOffset&&(o=new OpenLayers.Pixel(t.style.graphicXOffset,t.style.graphicYOffset)),null!=t.style.externalGraphic?i.icon=new OpenLayers.Icon(t.style.externalGraphic,f,o):(i.icon=OpenLayers.Marker.defaultIcon(),null!=f&&i.icon.setSize(f)),null!=t.attributes.title&&null!=t.attributes.description&&(i.popupContentHTML="<h2>"+t.attributes.title+"<\/h2><p>"+t.attributes.description+"<\/p>"),i.overflow=t.attributes.overflow||"auto",i=new OpenLayers.Feature(this,u,i),this.features.push(i),u=i.createMarker(),null!=t.attributes.title&&null!=t.attributes.description&&u.events.register("click",i,this.markerClick),this.addMarker(u);this.events.triggerEvent("loadend")},markerClick:function(n){var i=this==this.layer.selectedFeature,t,r;for(this.layer.selectedFeature=i?null:this,t=0,r=this.layer.map.popups.length;t<r;t++)this.layer.map.removePopup(this.layer.map.popups[t]);i||this.layer.map.addPopup(this.createPopup()),OpenLayers.Event.stop(n)},clearFeatures:function(){if(null!=this.features)for(;0<this.features.length;){var n=this.features[0];OpenLayers.Util.removeItem(this.features,n),n.destroy()}},CLASS_NAME:"OpenLayers.Layer.Text"}),OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,geodesic:!1,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.element=OpenLayers.Util.getElement(n)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.element=document.createElement("div"),this.div.appendChild(this.element)),this.map.events.register("moveend",this,this.updateScale),this.updateScale(),this.div},updateScale:function(){var n;if(!0===this.geodesic){if(!this.map.getUnits())return;n=OpenLayers.INCHES_PER_UNIT,n=(this.map.getGeodesicPixelSize().w||1e-6)*n.km*OpenLayers.DOTS_PER_INCH}else n=this.map.getScale();n&&(n=9500<=n&&95e4>=n?Math.round(n/1e3)+"K":95e4<=n?Math.round(n/1e6)+"M":Math.round(n),this.element.innerHTML=OpenLayers.i18n("Scale = 1 : ${scaleDenom}",{scaleDenom:n}))},CLASS_NAME:"OpenLayers.Control.Scale"}),OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",layerOptions:null,persist:!1,irregular:!1,citeCompliant:!1,angle:null,fixedRadius:!1,feature:null,layer:null,origin:null,initialize:function(n,t,i){i&&i.layerOptions&&i.layerOptions.styleMap||(this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})),OpenLayers.Handler.Drag.prototype.initialize.apply(this,[n,t,i]),this.options=i?i:{}},setOptions:function(n){OpenLayers.Util.extend(this.options,n),OpenLayers.Util.extend(this,n)},activate:function(){var n=!1;return OpenLayers.Handler.Drag.prototype.activate.apply(this,arguments)&&(n=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions),this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,n),this.map.addLayer(this.layer),n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)&&(this.dragging&&this.cancel(),null!=this.layer.map&&(this.layer.destroy(!1),this.feature&&this.feature.destroy()),this.feature=this.layer=null,n=!0),n},down:function(n){this.fixedRadius=!!this.radius,n=this.layer.getLonLatFromViewPortPx(n.xy),this.origin=new OpenLayers.Geometry.Point(n.lon,n.lat),(!this.fixedRadius||this.irregular)&&(this.radius=this.map.getResolution()),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:!0}),this.layer.drawFeature(this.feature,this.style)},move:function(n){var t=this.layer.getLonLatFromViewPortPx(n.xy),t=new OpenLayers.Geometry.Point(t.lon,t.lat),i;this.irregular?(n=Math.sqrt(2)*Math.abs(t.y-this.origin.y)/2,this.radius=Math.max(this.map.getResolution()/2,n)):this.fixedRadius?this.origin=t:(this.calculateAngle(t,n),this.radius=Math.max(this.map.getResolution()/2,t.distanceTo(this.origin))),this.modifyGeometry(),this.irregular&&(n=t.x-this.origin.x,t=t.y-this.origin.y,i=0==t?n/(this.radius*Math.sqrt(2)):n/t,this.feature.geometry.resize(1,this.origin,i),this.feature.geometry.move(n/2,t/2)),this.layer.drawFeature(this.feature,this.style)},up:function(n){this.finalize(),this.start==this.last&&this.callback("done",[n.xy])},out:function(){this.finalize()},createGeometry:function(){this.angle=Math.PI*(1/this.sides-.5),this.snapAngle&&(this.angle+=Math.PI/180*this.snapAngle),this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var i,t,r=this.feature.geometry.components[0],n;for(r.components.length!=this.sides+1&&(this.createGeometry(),r=this.feature.geometry.components[0]),n=0;n<this.sides;++n)t=r.components[n],i=this.angle+2*n*Math.PI/this.sides,t.x=this.origin.x+this.radius*Math.cos(i),t.y=this.origin.y+this.radius*Math.sin(i),t.clearBounds()},calculateAngle:function(n,t){var r=Math.atan2(n.y-this.origin.y,n.x-this.origin.x),i;this.snapAngle&&this.snapToggle&&!t[this.snapToggle]?(i=Math.PI/180*this.snapAngle,this.angle=Math.round(r/i)*i):this.angle=r},cancel:function(){this.callback("cancel",null),this.finalize()},finalize:function(){this.origin=null,this.radius=this.options.radius},clear:function(){this.layer&&(this.layer.renderer.clear(),this.layer.destroyFeatures())},callback:function(n){this.callbacks[n]&&this.callbacks[n].apply(this.control,[this.feature.geometry.clone()]),this.persist||"done"!=n&&"cancel"!=n||this.clear()},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"}),OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,useHttpTile:!1,singleTile:!1,useOverlay:!1,useAsyncOverlay:!0,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300,300),tileOriginCorner:"tl",initialize:function(n,t,i,r){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments),(null==r||null==r.isBaseLayer)&&(this.isBaseLayer="true"!=this.transparent&&!0!=this.transparent),r&&null!=r.useOverlay&&(this.useOverlay=r.useOverlay),this.singleTile?this.useOverlay?(OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS),this.useAsyncOverlay||(this.params.version="1.0.0")):OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS):(this.useHttpTile?OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS):OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS),this.setTileSize(this.defaultSize))},clone:function(n){return null==n&&(n=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){var t,i;return t=n.getCenterLonLat(),i=this.map.getSize(),this.singleTile?(n={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:i.h*this.ratio,setdisplaywidth:i.w*this.ratio,setviewcenterx:t.lon,setviewcentery:t.lat,setviewscale:this.map.getScale()},this.useOverlay&&!this.useAsyncOverlay&&(t={},t=OpenLayers.Util.extend(t,n),t.operation="GETVISIBLEMAPEXTENT",t.version="1.0.0",t.session=this.params.session,t.mapName=this.params.mapName,t.format="text/xml",t=this.getFullRequestString(t),OpenLayers.Request.GET({url:t,async:!1})),t=this.getFullRequestString(n)):(i=this.map.getResolution(),t=Math.floor((n.left-this.maxExtent.left)/i),t=Math.round(t/this.tileSize.w),n=Math.floor((this.maxExtent.top-n.top)/i),n=Math.round(n/this.tileSize.h),t=this.useHttpTile?this.getImageFilePath({tilecol:t,tilerow:n,scaleindex:this.resolutions.length-this.map.zoom-1}):this.getFullRequestString({tilecol:t,tilerow:n,scaleindex:this.resolutions.length-this.map.zoom-1})),t},getFullRequestString:function(n,t){var r=null==t?this.url:t;"object"==typeof r&&(r=r[Math.floor(Math.random()*r.length)]);var u=r,i=OpenLayers.Util.extend({},this.params),i=OpenLayers.Util.extend(i,n),f=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(r)),e;for(e in i)e.toUpperCase()in f&&delete i[e];return i=OpenLayers.Util.getParameterString(i),i=i.replace(/,/g,"+"),""!=i&&(f=r.charAt(r.length-1),u="&"==f||"?"==f?u+i:-1==r.indexOf("?")?u+("?"+i):u+("&"+i)),u},getImageFilePath:function(n,t){var u=null==t?this.url:t,i,r;return"object"==typeof u&&(u=u[Math.floor(Math.random()*u.length)]),i="",r="",0>n.tilerow&&(i="-"),i=0==n.tilerow?i+"0":i+Math.floor(Math.abs(n.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder,0>n.tilecol&&(r="-"),r=0==n.tilecol?r+"0":r+Math.floor(Math.abs(n.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder,i="/S"+Math.floor(n.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+i+"/C"+r+"/"+n.tilerow%this.params.tileRowsPerFolder+"_"+n.tilecol%this.params.tileColumnsPerFolder+"."+this.params.format,this.params.querystring&&(i+="?"+this.params.querystring),u+i},CLASS_NAME:"OpenLayers.Layer.MapGuide"}),OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{callbacks:null,displaySystem:"metric",geodesic:!1,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:!1,immediate:!1,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]);var i={done:this.measureComplete,point:this.measurePartial};this.immediate&&(i.modify=this.measureImmediate),this.callbacks=OpenLayers.Util.extend(i,this.callbacks),this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions),this.handler=new n(this,this.callbacks,this.handlerOptions)},deactivate:function(){return this.cancelDelay(),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},cancel:function(){this.cancelDelay(),this.handler.cancel()},setImmediate:function(n){(this.immediate=n)?this.callbacks.modify=this.measureImmediate:delete this.callbacks.modify},updateHandler:function(n,t){var i=this.active;i&&this.deactivate(),this.handler=new n(this,this.callbacks,t),i&&this.activate()},measureComplete:function(n){this.cancelDelay(),this.measure(n,"measure")},measurePartial:function(n,t){this.cancelDelay(),t=t.clone(),this.handler.freehandMode(this.handler.evt)?this.measure(t,"measurepartial"):this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.delayedTrigger=null,this.measure(t,"measurepartial")},this),this.partialDelay)},measureImmediate:function(n,t,i){i&&!this.handler.freehandMode(this.handler.evt)&&(this.cancelDelay(),this.measure(t.geometry,"measurepartial"))},cancelDelay:function(){null!==this.delayedTrigger&&(window.clearTimeout(this.delayedTrigger),this.delayedTrigger=null)},measure:function(n,t){var i,r;-1<n.CLASS_NAME.indexOf("LineString")?(i=this.getBestLength(n),r=1):(i=this.getBestArea(n),r=2),this.events.triggerEvent(t,{measure:i[0],units:i[1],order:r,geometry:n})},getBestArea:function(n){for(var u=this.displaySystemUnits[this.displaySystem],t,i,r=0,f=u.length;r<f&&!(t=u[r],i=this.getArea(n,t),1<i);++r);return[i,t]},getArea:function(n,t){var i,r,u;return this.geodesic?(i=n.getGeodesicArea(this.map.getProjectionObject()),r="m"):(i=n.getArea(),r=this.map.getUnits()),u=OpenLayers.INCHES_PER_UNIT[t],u&&(i*=Math.pow(OpenLayers.INCHES_PER_UNIT[r]/u,2)),i},getBestLength:function(n){for(var u=this.displaySystemUnits[this.displaySystem],t,i,r=0,f=u.length;r<f&&!(t=u[r],i=this.getLength(n,t),1<i);++r);return[i,t]},getLength:function(n,t){var i,r,u;return this.geodesic?(i=n.getGeodesicLength(this.map.getProjectionObject()),r="m"):(i=n.getLength(),r=this.map.getUnits()),u=OpenLayers.INCHES_PER_UNIT[t],u&&(i*=OpenLayers.INCHES_PER_UNIT[r]/u),i},CLASS_NAME:"OpenLayers.Control.Measure"}),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(n){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[n])},read_wmc_SRS:function(n,t){var i=this.getChildValue(t);"object"!=typeof n.projections&&(n.projections={});for(var i=i.split(/ +/),r=0,u=i.length;r<u;r++)n.projections[i[r]]=!0},write_wmc_Layer:function(n){var t=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[n]),i,r;if(n.srs){i=[];for(r in n.srs)i.push(r);t.appendChild(this.createElementDefaultNS("SRS",i.join(" ")))}t.appendChild(this.write_wmc_FormatList(n)),t.appendChild(this.write_wmc_StyleList(n)),n.dimensions&&t.appendChild(this.write_wmc_DimensionList(n)),t.appendChild(this.write_wmc_LayerExtension(n))},CLASS_NAME:"OpenLayers.Format.WMC.v1_0_0"}),OpenLayers.Format.WMTSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1_1_0,{version:"1.0.0",namespaces:{ows:"http://www.opengis.net/ows/1.1",wmts:"http://www.opengis.net/wmts/1.0",xlink:"http://www.w3.org/1999/xlink"},yx:null,defaultPrefix:"wmts",initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]),this.options=n,n=OpenLayers.Util.extend({},OpenLayers.Format.WMTSCapabilities.prototype.yx),this.yx=OpenLayers.Util.extend(n,this.yx)},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t.version=this.version,t},readers:{wmts:{Capabilities:function(n,t){this.readChildNodes(n,t)},Contents:function(n,t){t.contents={},t.contents.layers=[],t.contents.tileMatrixSets={},this.readChildNodes(n,t.contents)},Layer:function(n,t){var i={styles:[],formats:[],dimensions:[],tileMatrixSetLinks:[],layers:[]};this.readChildNodes(n,i),t.layers.push(i)},Style:function(n,t){var i={};i.isDefault="true"===n.getAttribute("isDefault"),this.readChildNodes(n,i),t.styles.push(i)},Format:function(n,t){t.formats.push(this.getChildValue(n))},TileMatrixSetLink:function(n,t){var i={};this.readChildNodes(n,i),t.tileMatrixSetLinks.push(i)},TileMatrixSet:function(n,t){if(t.layers){var i={matrixIds:[]};this.readChildNodes(n,i),t.tileMatrixSets[i.identifier]=i}else t.tileMatrixSet=this.getChildValue(n)},TileMatrix:function(n,t){var i={supportedCRS:t.supportedCRS};this.readChildNodes(n,i),t.matrixIds.push(i)},ScaleDenominator:function(n,t){t.scaleDenominator=parseFloat(this.getChildValue(n))},TopLeftCorner:function(n,t){var i=this.getChildValue(n).split(" "),r;t.supportedCRS&&(r=t.supportedCRS.replace(/urn:ogc:def:crs:(\w+):.+:(\w+)$/,"urn:ogc:def:crs:$1::$2"),r=!!this.yx[r]),t.topLeftCorner=r?new OpenLayers.LonLat(i[1],i[0]):new OpenLayers.LonLat(i[0],i[1])},TileWidth:function(n,t){t.tileWidth=parseInt(this.getChildValue(n))},TileHeight:function(n,t){t.tileHeight=parseInt(this.getChildValue(n))},MatrixWidth:function(n,t){t.matrixWidth=parseInt(this.getChildValue(n))},MatrixHeight:function(n,t){t.matrixHeight=parseInt(this.getChildValue(n))},ResourceURL:function(n,t){t.resourceUrl=t.resourceUrl||{};var i=n.getAttribute("resourceType");t.resourceUrls||(t.resourceUrls=[]),i=t.resourceUrl[i]={format:n.getAttribute("format"),template:n.getAttribute("template"),resourceType:i},t.resourceUrls.push(i)},WSDL:function(n,t){t.wsdl={},t.wsdl.href=n.getAttribute("xlink:href")},ServiceMetadataURL:function(n,t){t.serviceMetadataUrl={},t.serviceMetadataUrl.href=n.getAttribute("xlink:href")},LegendURL:function(n,t){t.legend={},t.legend.href=n.getAttribute("xlink:href"),t.legend.format=n.getAttribute("format")},Dimension:function(n,t){var i={values:[]};this.readChildNodes(n,i),t.dimensions.push(i)},Default:function(n,t){t["default"]=this.getChildValue(n)},Value:function(n,t){t.values.push(this.getChildValue(n))}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities.v1_0_0"}),OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:!0,lzd:null,zoomLevels:null,initialize:function(n,t,i,r,u,f){this.lzd=i,this.zoomLevels=r,i=[],i.push(n,t,u,f),OpenLayers.Layer.Grid.prototype.initialize.apply(this,i),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getZoom:function(){var n=this.map.getZoom();return this.map.getMaxExtent(),n-=Math.log(this.maxResolution/(this.lzd/512))/Math.log(2)},getURL:function(n){n=this.adjustBounds(n);var r=this.getZoom(),t=this.map.getMaxExtent(),i=this.lzd/Math.pow(2,this.getZoom()),u=Math.floor((n.left-t.left)/i);return n=Math.floor((n.bottom-t.bottom)/i),this.map.getResolution()<=this.lzd/512&&this.getZoom()<=this.zoomLevels?this.getFullRequestString({L:r,X:u,Y:n}):OpenLayers.Util.getImageLocation("blank.gif")},CLASS_NAME:"OpenLayers.Layer.WorldWind"}),OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:!0,panMapIfOutOfView:!0,imageSize:new OpenLayers.Size(1276,736),isAlphaImage:!1,fixedRelativePosition:!1,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(-1238,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(-1238,-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(-1238,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(-1238,-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(-1238,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(-1238,-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(-1238,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(-1238,-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(1200,660),initialize:function(){this.imageSrc=OpenLayers.Util.getImageLocation("cloud-popup-relative.png"),OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments),this.contentDiv.className=this.contentDisplayClass},CLASS_NAME:"OpenLayers.Popup.FramedCloud"}),OpenLayers.Format.SOSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.SOSCapabilities,{namespaces:{ows:"http://www.opengis.net/ows/1.1",sos:"http://www.opengis.net/sos/1.0",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]),this.options=n},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{gml:OpenLayers.Util.applyDefaults({name:function(n,t){t.name=this.getChildValue(n)},TimePeriod:function(n,t){t.timePeriod={},this.readChildNodes(n,t.timePeriod)},beginPosition:function(n,t){t.beginPosition=this.getChildValue(n)},endPosition:function(n,t){t.endPosition=this.getChildValue(n)}},OpenLayers.Format.GML.v3.prototype.readers.gml),sos:{Capabilities:function(n,t){this.readChildNodes(n,t)},Contents:function(n,t){t.contents={},this.readChildNodes(n,t.contents)},ObservationOfferingList:function(n,t){t.offeringList={},this.readChildNodes(n,t.offeringList)},ObservationOffering:function(n,t){var i=this.getAttributeNS(n,this.namespaces.gml,"id");t[i]={procedures:[],observedProperties:[],featureOfInterestIds:[],responseFormats:[],resultModels:[],responseModes:[]},this.readChildNodes(n,t[i])},time:function(n,t){t.time={},this.readChildNodes(n,t.time)},procedure:function(n,t){t.procedures.push(this.getAttributeNS(n,this.namespaces.xlink,"href"))},observedProperty:function(n,t){t.observedProperties.push(this.getAttributeNS(n,this.namespaces.xlink,"href"))},featureOfInterest:function(n,t){t.featureOfInterestIds.push(this.getAttributeNS(n,this.namespaces.xlink,"href"))},responseFormat:function(n,t){t.responseFormats.push(this.getChildValue(n))},resultModel:function(n,t){t.resultModels.push(this.getChildValue(n))},responseMode:function(n,t){t.responseModes.push(this.getChildValue(n))}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.SOSCapabilities.v1_0_0"}),OpenLayers.Handler.Pinch=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!1,pinching:!1,last:null,start:null,touchstart:function(n){var t=!0;if(this.pinching=!1,OpenLayers.Event.isMultiTouch(n))this.started=!0,this.last=this.start={distance:this.getDistance(n.touches),delta:0,scale:1},this.callback("start",[n,this.start]),t=!this.stopDown;else{if(this.started)return!1;this.started=!1,this.last=this.start=null}return OpenLayers.Event.preventDefault(n),t},touchmove:function(n){if(this.started&&OpenLayers.Event.isMultiTouch(n)){this.pinching=!0;var t=this.getPinchData(n);this.callback("move",[n,t]),this.last=t,OpenLayers.Event.stop(n)}else if(this.started)return!1;return!0},touchend:function(n){return this.started&&!OpenLayers.Event.isMultiTouch(n)?(this.pinching=this.started=!1,this.callback("done",[n,this.start,this.last]),this.last=this.start=null,!1):!0},activate:function(){var n=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.pinching=!1,n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.pinching=this.started=!1,this.last=this.start=null,n=!0),n},getDistance:function(n){var t=n[0];return n=n[1],Math.sqrt(Math.pow(t.olClientX-n.olClientX,2)+Math.pow(t.olClientY-n.olClientY,2))},getPinchData:function(n){return n=this.getDistance(n.touches),{distance:n,delta:this.last.distance-n,scale:n/this.start.distance}},CLASS_NAME:"OpenLayers.Handler.Pinch"}),OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(n){OpenLayers.Control.Panel.prototype.initialize.apply(this,[n]),this.addControls([new OpenLayers.Control.Navigation,new OpenLayers.Control.ZoomBox])},draw:function(){var n=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return null===this.defaultControl&&(this.defaultControl=this.controls[0]),n},CLASS_NAME:"OpenLayers.Control.NavToolbar"}),OpenLayers.Control.PinchZoom=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,pinchOrigin:null,currentCenter:null,autoActivate:!0,preserveCenter:!1,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments),this.handler=new OpenLayers.Handler.Pinch(this,{start:this.pinchStart,move:this.pinchMove,done:this.pinchDone},this.handlerOptions)},pinchStart:function(n){var i=this.preserveCenter?this.map.getPixelFromLonLat(this.map.getCenter()):n.xy;this.currentCenter=this.pinchOrigin=i},pinchMove:function(n,t){var u=t.scale,i=this.map.layerContainerOriginPx,r=this.pinchOrigin,f=this.preserveCenter?this.map.getPixelFromLonLat(this.map.getCenter()):n.xy,e=Math.round(i.x+f.x-r.x+(u-1)*(i.x-r.x)),i=Math.round(i.y+f.y-r.y+(u-1)*(i.y-r.y));this.map.applyTransform(e,i,u),this.currentCenter=f},pinchDone:function(n,t,i){if(this.map.applyTransform(),n=this.map.getZoomForResolution(this.map.getResolution()/i.scale,!0),n!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){t=this.map.getResolutionForZoom(n),i=this.map.getLonLatFromPixel(this.pinchOrigin);var r=this.currentCenter,u=this.map.getSize();i.lon+=t*(u.w/2-r.x),i.lat-=t*(u.h/2-r.y),this.map.div.clientWidth=this.map.div.clientWidth,this.map.setCenter(i,n)}},CLASS_NAME:"OpenLayers.Control.PinchZoom"}),OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",url:["http://a.tile.openstreetmap.org/${z}/${x}/${y}.png","http://b.tile.openstreetmap.org/${z}/${x}/${y}.png","http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"],attribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap<\/a> contributors",sphericalMercator:!0,wrapDateLine:!0,tileOptions:null,initialize:function(){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments),this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options&&this.options.tileOptions)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[n])},CLASS_NAME:"OpenLayers.Layer.OSM"}),OpenLayers.Strategy.Refresh=OpenLayers.Class(OpenLayers.Strategy,{force:!1,interval:0,timer:null,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);return n&&(!0===this.layer.visibility&&this.start(),this.layer.events.on({visibilitychanged:this.reset,scope:this})),n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&(this.stop(),this.layer.events.un({visibilitychanged:this.reset,scope:this})),n},reset:function(){!0===this.layer.visibility?this.start():this.stop()},start:function(){this.interval&&"number"==typeof this.interval&&0<this.interval&&(this.timer=window.setInterval(OpenLayers.Function.bind(this.refresh,this),this.interval))},refresh:function(){this.layer&&this.layer.refresh&&"function"==typeof this.layer.refresh&&this.layer.refresh({force:this.force})},stop:function(){null!==this.timer&&(window.clearInterval(this.timer),this.timer=null)},CLASS_NAME:"OpenLayers.Strategy.Refresh"}),OpenLayers.Control.Geolocate=OpenLayers.Class(OpenLayers.Control,{geolocation:null,available:"geolocation"in navigator,bind:!0,watch:!1,geolocationOptions:null,destroy:function(){this.deactivate(),OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return this.available&&!this.geolocation&&(this.geolocation=navigator.geolocation),this.geolocation?OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.watch?this.watchId=this.geolocation.watchPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions):this.getCurrentLocation(),!0):!1:(this.events.triggerEvent("locationuncapable"),!1)},deactivate:function(){return this.active&&null!==this.watchId&&this.geolocation.clearWatch(this.watchId),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},geolocate:function(n){var t=new OpenLayers.LonLat(n.coords.longitude,n.coords.latitude).transform(new OpenLayers.Projection("EPSG:4326"),this.map.getProjectionObject());this.bind&&this.map.setCenter(t),this.events.triggerEvent("locationupdated",{position:n,point:new OpenLayers.Geometry.Point(t.lon,t.lat)})},getCurrentLocation:function(){return!this.active||this.watch?!1:(this.geolocation.getCurrentPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions),!0)},failure:function(n){this.events.triggerEvent("locationfailed",{error:n})},CLASS_NAME:"OpenLayers.Control.Geolocate"}),OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:!0,initialize:function(n,t,i,r){var u=[];i=OpenLayers.Util.upperCaseObject(i),u.push(n,t,i,r),OpenLayers.Layer.Grid.prototype.initialize.apply(this,u),OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)),this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase()&&(null!=r&&r.isBaseLayer||(this.isBaseLayer=!1),"jpg"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"))},clone:function(n){return null==n&&(n=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){var t,i;n=this.adjustBounds(n);var t=this.projection.getCode().split(":"),t=t[t.length-1],r=this.getImageSize();if(n={BBOX:n.toBBOX(),SIZE:r.w+","+r.h,F:"image",BBOXSR:t,IMAGESR:t},this.layerDefs){t=[];for(i in this.layerDefs)this.layerDefs.hasOwnProperty(i)&&this.layerDefs[i]&&(t.push(i),t.push(":"),t.push(this.layerDefs[i]),t.push(";"));0<t.length&&(n.LAYERDEFS=t.join(""))}return this.getFullRequestString(n)},setLayerFilter:function(n,t){this.layerDefs||(this.layerDefs={}),t?this.layerDefs[n]=t:delete this.layerDefs[n]},clearLayerFilter:function(n){n?delete this.layerDefs[n]:delete this.layerDefs},mergeNewParams:function(n){return n=[OpenLayers.Util.upperCaseObject(n)],OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,n)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"}),OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:!1,px:null,timerId:null,mousemove:function(n){return this.passesTolerance(n.xy)&&(this.clearTimer(),this.callback("move",[n]),this.px=n.xy,n=OpenLayers.Util.extend({},n),this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,n),this.delay)),!this.stopMove},mouseout:function(n){return OpenLayers.Util.mouseLeft(n,this.map.viewPortDiv)&&(this.clearTimer(),this.callback("move",[n])),!0},passesTolerance:function(n){var t=!0;return this.pixelTolerance&&this.px&&Math.sqrt(Math.pow(this.px.x-n.x,2)+Math.pow(this.px.y-n.y,2))<this.pixelTolerance&&(t=!1),t},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null)},delayedCall:function(n){this.callback("pause",[n])},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),n=!0),n},CLASS_NAME:"OpenLayers.Handler.Hover"}),OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:!1,click:!0,single:!0,clickout:!0,toggle:!1,clickTolerance:5,hover:!1,box:!1,maxFeatures:10,features:null,hoverFeature:null,handlers:null,hoverResponse:null,filterType:OpenLayers.Filter.Spatial.BBOX,initialize:function(n){n.handlerOptions=n.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[n]),this.features={},this.handlers={},this.click&&(this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectClick},this.handlerOptions.click||{})),this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"}))),this.hover&&(this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250,pixelTolerance:2})))},activate:function(){if(!this.active)for(var n in this.handlers)this.handlers[n].activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active)for(var n in this.handlers)this.handlers[n].deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},selectClick:function(n){var t=this.pixelToBounds(n.xy);this.setModifiers(n),this.request(t,{single:this.single})},selectBox:function(n){var t;if(n instanceof OpenLayers.Bounds)t=this.map.getLonLatFromPixel({x:n.left,y:n.bottom}),n=this.map.getLonLatFromPixel({x:n.right,y:n.top}),t=new OpenLayers.Bounds(t.lon,t.lat,n.lon,n.lat);else{if(this.click)return;t=this.pixelToBounds(n)}this.setModifiers(this.handlers.box.dragHandler.evt),this.request(t)},selectHover:function(n){n=this.pixelToBounds(n.xy),this.request(n,{single:!0,hover:!0})},cancelHover:function(){this.hoverResponse&&(this.protocol.abort(this.hoverResponse),this.hoverResponse=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"))},request:function(n,t){t=t||{};var i=new OpenLayers.Filter.Spatial({type:this.filterType,value:n});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait"),i=this.protocol.read({maxFeatures:!0==t.single?this.maxFeatures:void 0,filter:i,callback:function(i){i.success()&&(i.features.length?!0==t.single?this.selectBestFeature(i.features,n.getCenterLonLat(),t):this.select(i.features):t.hover?this.hoverSelect():(this.events.triggerEvent("clickout"),this.clickout&&this.unselectAll())),OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this}),!0==t.hover&&(this.hoverResponse=i)},selectBestFeature:function(n,t,i){if(i=i||{},n.length){t=new OpenLayers.Geometry.Point(t.lon,t.lat);for(var r,u,f,e=Number.MAX_VALUE,o=0;o<n.length&&!(r=n[o],r.geometry&&(f=t.distanceTo(r.geometry,{edge:!1}),f<e&&(e=f,u=r,0==e)));++o);!0==i.hover?this.hoverSelect(u):this.select(u||n)}},setModifiers:function(n){this.modifiers={multiple:this.multiple||this.multipleKey&&n[this.multipleKey],toggle:this.toggle||this.toggleKey&&n[this.toggleKey]}},select:function(n){var i;if(this.modifiers.multiple||this.modifiers.toggle||this.unselectAll(),OpenLayers.Util.isArray(n)||(n=[n]),i=this.events.triggerEvent("beforefeaturesselected",{features:n}),!1!==i){for(var u=[],t,r=0,f=n.length;r<f;++r)t=n[r],this.features[t.fid||t.id]?this.modifiers.toggle&&this.unselect(this.features[t.fid||t.id]):(i=this.events.triggerEvent("beforefeatureselected",{feature:t}),!1!==i&&(this.features[t.fid||t.id]=t,u.push(t),this.events.triggerEvent("featureselected",{feature:t})));this.events.triggerEvent("featuresselected",{features:u})}},hoverSelect:function(n){var t=n?n.fid||n.id:null,i=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;i&&i!=t&&(this.events.triggerEvent("outfeature",{feature:this.hoverFeature}),this.hoverFeature=null),t&&t!=i&&(this.events.triggerEvent("hoverfeature",{feature:n}),this.hoverFeature=n)},unselect:function(n){delete this.features[n.fid||n.id],this.events.triggerEvent("featureunselected",{feature:n})},unselectAll:function(){for(var n in this.features)this.unselect(this.features[n])},setMap:function(n){for(var t in this.handlers)this.handlers[t].setMap(n);OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(n){var t=n.add(-this.clickTolerance/2,this.clickTolerance/2);return n=n.add(this.clickTolerance/2,-this.clickTolerance/2),t=this.map.getLonLatFromPixel(t),n=this.map.getLonLatFromPixel(n),new OpenLayers.Bounds(t.lon,t.lat,n.lon,n.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"}),OpenLayers.Format.QueryStringFilter=function(){function t(n){return n=n.replace(/%/g,"\\%"),n=n.replace(/\\\\\.(\*)?/g,function(n,t){return t?n:"\\\\_"}),n=n.replace(/\\\\\.\*/g,"\\\\%"),n=n.replace(/(\\)?\.(\*)?/g,function(n,t,i){return t||i?n:"_"}),n=n.replace(/(\\)?\.\*/g,function(n,t){return t?n:"%"}),n=n.replace(/\\\./g,"."),n=n.replace(/(\\)?\\\*/g,function(n,t){return t?n:"*"})}var n={};return n[OpenLayers.Filter.Comparison.EQUAL_TO]="eq",n[OpenLayers.Filter.Comparison.NOT_EQUAL_TO]="ne",n[OpenLayers.Filter.Comparison.LESS_THAN]="lt",n[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO]="lte",n[OpenLayers.Filter.Comparison.GREATER_THAN]="gt",n[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO]="gte",n[OpenLayers.Filter.Comparison.LIKE]="ilike",OpenLayers.Class(OpenLayers.Format,{wildcarded:!1,srsInBBOX:!1,write:function(i,r){var u,f;r=r||{},u=i.CLASS_NAME,u=u.substring(u.lastIndexOf(".")+1);switch(u){case"Spatial":switch(i.type){case OpenLayers.Filter.Spatial.BBOX:r.bbox=i.value.toArray(),this.srsInBBOX&&i.projection&&r.bbox.push(i.projection.getCode());break;case OpenLayers.Filter.Spatial.DWITHIN:r.tolerance=i.distance;case OpenLayers.Filter.Spatial.WITHIN:r.lon=i.value.x,r.lat=i.value.y;break;default:OpenLayers.Console.warn("Unknown spatial filter type "+i.type)}break;case"Comparison":u=n[i.type],void 0!==u?(f=i.value,i.type==OpenLayers.Filter.Comparison.LIKE&&(f=t(f),this.wildcarded&&(f="%"+f+"%")),r[i.property+"__"+u]=f,r.queryable=r.queryable||[],r.queryable.push(i.property)):OpenLayers.Console.warn("Unknown comparison filter type "+i.type);break;case"Logical":if(i.type===OpenLayers.Filter.Logical.AND)for(u=0,f=i.filters.length;u<f;u++)r=this.write(i.filters[u],r);else OpenLayers.Console.warn("Unsupported logical filter type "+i.type);break;default:OpenLayers.Console.warn("Unknown filter type "+u)}return r},CLASS_NAME:"OpenLayers.Format.QueryStringFilter"})}(),OpenLayers.Format.WCSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1,{namespaces:{wcs:"http://www.opengis.net/wcs/1.1",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows/1.1"},errorProperty:"operationsMetadata",readers:{wcs:OpenLayers.Util.applyDefaults({Capabilities:function(n,t){this.readChildNodes(n,t)},Contents:function(n,t){t.contentMetadata=[],this.readChildNodes(n,t.contentMetadata)},CoverageSummary:function(n,t){var i={};this.readChildNodes(n,i),t.push(i)},Identifier:function(n,t){t.identifier=this.getChildValue(n)},Title:function(n,t){t.title=this.getChildValue(n)},Abstract:function(n,t){t.abstract=this.getChildValue(n)},SupportedCRS:function(n,t){var i=this.getChildValue(n);i&&(t.supportedCRS||(t.supportedCRS=[]),t.supportedCRS.push(i))},SupportedFormat:function(n,t){var i=this.getChildValue(n);i&&(t.supportedFormat||(t.supportedFormat=[]),t.supportedFormat.push(i))}},OpenLayers.Format.WCSCapabilities.v1.prototype.readers.wcs),ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1_1_0"}),OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,emptyString:null,lastXy:null,displayProjection:null,destroy:function(){this.deactivate(),OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.map.events.register("mousemove",this,this.redraw),this.map.events.register("mouseout",this,this.reset),this.redraw(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.map.events.unregister("mousemove",this,this.redraw),this.map.events.unregister("mouseout",this,this.reset),this.element.innerHTML="",!0):!1},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.div.left="",this.div.top="",this.element=this.div),this.div},redraw:function(n){var t;null==n?this.reset():null==this.lastXy||Math.abs(n.xy.x-this.lastXy.x)>this.granularity||Math.abs(n.xy.y-this.lastXy.y)>this.granularity?this.lastXy=n.xy:(t=this.map.getLonLatFromPixel(n.xy))&&(this.displayProjection&&t.transform(this.map.getProjectionObject(),this.displayProjection),this.lastXy=n.xy,n=this.formatOutput(t),n!=this.element.innerHTML&&(this.element.innerHTML=n))},reset:function(){null!=this.emptyString&&(this.element.innerHTML=this.emptyString)},formatOutput:function(n){var t=parseInt(this.numDigits);return this.prefix+n.lon.toFixed(t)+this.separator+n.lat.toFixed(t)+this.suffix},CLASS_NAME:"OpenLayers.Control.MousePosition"}),OpenLayers.Tile.UTFGrid=OpenLayers.Class(OpenLayers.Tile,{url:null,utfgridResolution:2,json:null,format:null,destroy:function(){this.clear(),OpenLayers.Tile.prototype.destroy.apply(this,arguments)},draw:function(){var t=OpenLayers.Tile.prototype.draw.apply(this,arguments),n;return t?(this.isLoading?(this.abortLoading(),this.events.triggerEvent("reload")):(this.isLoading=!0,this.events.triggerEvent("loadstart")),this.url=this.layer.getURL(this.bounds),this.layer.useJSONP)?(n=new OpenLayers.Protocol.Script({url:this.url,callback:function(n){this.isLoading=!1,this.events.triggerEvent("loadend"),this.json=n.data},scope:this}),n.read(),this.request=n):this.request=OpenLayers.Request.GET({url:this.url,callback:function(n){this.isLoading=!1,this.events.triggerEvent("loadend"),200===n.status&&this.parseData(n.responseText)},scope:this}):this.unload(),t},abortLoading:function(){this.request&&(this.request.abort(),delete this.request),this.isLoading=!1},getFeatureInfo:function(n,t){var r=null,i;return this.json&&(i=this.getFeatureId(n,t),null!==i&&(r={id:i,data:this.json.data[i]})),r},getFeatureId:function(n,t){var r=null;if(this.json){var i=this.utfgridResolution,i=this.json.grid[Math.floor(t/i)].charCodeAt(Math.floor(n/i)),i=this.indexFromCharCode(i),u=this.json.keys;!isNaN(i)&&i in u&&(r=u[i])}return r},indexFromCharCode:function(n){return 93<=n&&n--,35<=n&&n--,n-32},parseData:function(n){this.format||(this.format=new OpenLayers.Format.JSON),this.json=this.format.read(n)},clear:function(){this.json=null},CLASS_NAME:"OpenLayers.Tile.UTFGrid"}),OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,autoActivate:!0,clearOnDeactivate:!1,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:!1,initialize:function(n){OpenLayers.Control.prototype.initialize.apply(this,[n]),this.registry=OpenLayers.Util.extend({moveend:this.getState},this.registry),n={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"},OpenLayers.Util.extend(n,this.previousOptions),this.previous=new OpenLayers.Control.Button(n),n={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"},OpenLayers.Util.extend(n,this.nextOptions),this.next=new OpenLayers.Control.Button(n),this.clear()},onPreviousChange:function(n){n&&!this.previous.active?this.previous.activate():!n&&this.previous.active&&this.previous.deactivate()},onNextChange:function(n){n&&!this.next.active?this.next.activate():!n&&this.next.active&&this.next.deactivate()},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this),this.previous.destroy(),this.next.destroy(),this.deactivate();for(var n in this)this[n]=null},setMap:function(n){this.map=n,this.next.setMap(n),this.previous.setMap(n)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments),this.next.draw(),this.previous.draw()},previousTrigger:function(){var t=this.previousStack.shift(),n=this.previousStack.shift();return void 0!=n?(this.nextStack.unshift(t),this.previousStack.unshift(n),this.restoring=!0,this.restore(n),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)):this.previousStack.unshift(t),n},nextTrigger:function(){var n=this.nextStack.shift();return void 0!=n&&(this.previousStack.unshift(n),this.restoring=!0,this.restore(n),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)),n},clear:function(){this.previousStack=[],this.previous.deactivate(),this.nextStack=[],this.next.deactivate()},getState:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution(),projection:this.map.getProjectionObject(),units:this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units}},restore:function(n){var i,t,r;this.map.getProjectionObject()==n.projection?(t=this.map.getZoomForResolution(n.resolution),i=n.center):(i=n.center.clone(),i.transform(n.projection,this.map.getProjectionObject()),t=n.units,r=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,t=this.map.getZoomForResolution((t&&r?OpenLayers.INCHES_PER_UNIT[t]/OpenLayers.INCHES_PER_UNIT[r]:1)*n.resolution)),this.map.setCenter(i,t)},setListeners:function(){this.listeners={};for(var n in this.registry)this.listeners[n]=OpenLayers.Function.bind(function(){if(!this.restoring){var t=this.registry[n].apply(this,arguments);if(this.previousStack.unshift(t),1<this.previousStack.length)this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);this.previousStack.length>this.limit+1&&this.previousStack.pop(),0<this.nextStack.length&&(this.nextStack=[],this.onNextChange(null,0))}return!0},this)},activate:function(){var t=!1,n;if(this.map&&OpenLayers.Control.prototype.activate.apply(this)){null==this.listeners&&this.setListeners();for(n in this.listeners)this.map.events.register(n,this,this.listeners[n]);t=!0,0==this.previousStack.length&&this.initStack()}return t},initStack:function(){this.map.getCenter()&&this.listeners.moveend()},deactivate:function(){var t=!1,n;if(this.map&&OpenLayers.Control.prototype.deactivate.apply(this)){for(n in this.listeners)this.map.events.unregister(n,this,this.listeners[n]);this.clearOnDeactivate&&this.clear(),t=!0}return t},CLASS_NAME:"OpenLayers.Control.NavigationHistory"}),OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,updateWithPOST:!1,deleteWithPOST:!1,wildcarded:!1,srsInBBOX:!1,initialize:function(n){if(n=n||{},this.params={},this.headers={},OpenLayers.Protocol.prototype.initialize.apply(this,arguments),!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var t=new OpenLayers.Format.QueryStringFilter({wildcarded:this.wildcarded,srsInBBOX:this.srsInBBOX});this.filterToParams=function(n,i){return t.write(n,i)}}},destroy:function(){this.headers=this.params=null,OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(n){OpenLayers.Protocol.prototype.read.apply(this,arguments),n=n||{},n.params=OpenLayers.Util.applyDefaults(n.params,this.options.params),n=OpenLayers.Util.applyDefaults(n,this.options),n.filter&&this.filterToParams&&(n.params=this.filterToParams(n.filter,n.params));var i=void 0!==n.readWithPOST?n.readWithPOST:this.readWithPOST,t=new OpenLayers.Protocol.Response({requestType:"read"});return i?(i=n.headers||{},i["Content-Type"]="application/x-www-form-urlencoded",t.priv=OpenLayers.Request.POST({url:n.url,callback:this.createCallback(this.handleRead,t,n),data:OpenLayers.Util.getParameterString(n.params),headers:i})):t.priv=OpenLayers.Request.GET({url:n.url,callback:this.createCallback(this.handleRead,t,n),params:n.params,headers:n.headers}),t},handleRead:function(n,t){this.handleResponse(n,t)},create:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({reqFeatures:n,requestType:"create"});return i.priv=OpenLayers.Request.POST({url:t.url,callback:this.createCallback(this.handleCreate,i,t),headers:t.headers,data:this.format.write(n)}),i},handleCreate:function(n,t){this.handleResponse(n,t)},update:function(n,t){var r,i;return t=t||{},r=t.url||n.url||this.options.url+"/"+n.fid,t=OpenLayers.Util.applyDefaults(t,this.options),i=new OpenLayers.Protocol.Response({reqFeatures:n,requestType:"update"}),i.priv=OpenLayers.Request[this.updateWithPOST?"POST":"PUT"]({url:r,callback:this.createCallback(this.handleUpdate,i,t),headers:t.headers,data:this.format.write(n)}),i},handleUpdate:function(n,t){this.handleResponse(n,t)},"delete":function(n,t){var i;t=t||{},i=t.url||n.url||this.options.url+"/"+n.fid,t=OpenLayers.Util.applyDefaults(t,this.options);var r=new OpenLayers.Protocol.Response({reqFeatures:n,requestType:"delete"}),u=this.deleteWithPOST?"POST":"DELETE",i={url:i,callback:this.createCallback(this.handleDelete,r,t),headers:t.headers};return this.deleteWithPOST&&(i.data=this.format.write(n)),r.priv=OpenLayers.Request[u](i),r},handleDelete:function(n,t){this.handleResponse(n,t)},handleResponse:function(n,t){var i=n.priv;t.callback&&(200<=i.status&&300>i.status?("delete"!=n.requestType&&(n.features=this.parseFeatures(i)),n.code=OpenLayers.Protocol.Response.SUCCESS):n.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,n))},parseFeatures:function(n){var t=n.responseXML;return t&&t.documentElement||(t=n.responseText),!t||0>=t.length?null:this.format.read(t)},commit:function(n,t){function a(n){for(var i=n.features?n.features.length:0,r=Array(i),t=0;t<i;++t)r[t]=n.features[t].fid;s.insertIds=r,e.apply(this,[n])}function e(n){this.callUserCallback(n,t),o=o&&n.success(),h++,h>=y&&t.callback&&(s.code=o?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE,t.callback.apply(t.scope,[s]))}t=OpenLayers.Util.applyDefaults(t,this.options);var f=[],h=0,u={};u[OpenLayers.State.INSERT]=[],u[OpenLayers.State.UPDATE]=[],u[OpenLayers.State.DELETE]=[];for(var i,c,l=[],r=0,v=n.length;r<v;++r)(i=n[r],c=u[i.state])&&(c.push(i),l.push(i));var y=(0<u[OpenLayers.State.INSERT].length?1:0)+u[OpenLayers.State.UPDATE].length+u[OpenLayers.State.DELETE].length,o=!0,s=new OpenLayers.Protocol.Response({reqFeatures:l});for(i=u[OpenLayers.State.INSERT],0<i.length&&f.push(this.create(i,OpenLayers.Util.applyDefaults({callback:a,scope:this},t.create))),i=u[OpenLayers.State.UPDATE],r=i.length-1;0<=r;--r)f.push(this.update(i[r],OpenLayers.Util.applyDefaults({callback:e,scope:this},t.update)));for(i=u[OpenLayers.State.DELETE],r=i.length-1;0<=r;--r)f.push(this["delete"](i[r],OpenLayers.Util.applyDefaults({callback:e,scope:this},t["delete"])));return f},abort:function(n){n&&n.priv.abort()},callUserCallback:function(n,t){var i=t[n.requestType];i&&i.callback&&i.callback.call(i.scope,n)},CLASS_NAME:"OpenLayers.Protocol.HTTP"}),OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:!1,resolution:null,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);if(n)this.layer.events.on({beforefeaturesadded:this.cacheFeatures,featuresremoved:this.clearCache,moveend:this.cluster,scope:this});return n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,featuresremoved:this.clearCache,moveend:this.cluster,scope:this})),n},cacheFeatures:function(n){var t=!0;return this.clustering||(this.clearCache(),this.features=n.features,this.cluster(),t=!1),t},clearCache:function(){this.clustering||(this.features=null)},cluster:function(n){var i,r,u,t,f;if((!n||n.zoomChanged)&&this.features&&(n=this.layer.map.getResolution(),n!=this.resolution||!this.clustersExist())){for(this.resolution=n,n=[],t=0;t<this.features.length;++t)if(i=this.features[t],i.geometry){for(r=!1,f=n.length-1;0<=f;--f)if(u=n[f],this.shouldCluster(u,i)){this.addToCluster(u,i),r=!0;break}r||n.push(this.createCluster(this.features[t]))}if(this.clustering=!0,this.layer.removeAllFeatures(),this.clustering=!1,0<n.length){if(1<this.threshold)for(i=n.slice(),n=[],t=0,u=i.length;t<u;++t)r=i[t],r.attributes.count<this.threshold?Array.prototype.push.apply(n,r.cluster):n.push(r);this.clustering=!0,this.layer.addFeatures(n),this.clustering=!1}this.clusters=n}},clustersExist:function(){var t=!1,n;if(this.clusters&&0<this.clusters.length&&this.clusters.length==this.layer.features.length)for(t=!0,n=0;n<this.clusters.length;++n)if(this.clusters[n]!=this.layer.features[n]){t=!1;break}return t},shouldCluster:function(n,t){var i=n.geometry.getBounds().getCenterLonLat(),r=t.geometry.getBounds().getCenterLonLat();return Math.sqrt(Math.pow(i.lon-r.lon,2)+Math.pow(i.lat-r.lat,2))/this.resolution<=this.distance},addToCluster:function(n,t){n.cluster.push(t),n.attributes.count+=1},createCluster:function(n){var t=n.geometry.getBounds().getCenterLonLat(),t=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat),{count:1});return t.cluster=[n],t},CLASS_NAME:"OpenLayers.Strategy.Cluster"}),OpenLayers.Strategy.Filter=OpenLayers.Class(OpenLayers.Strategy,{filter:null,cache:null,caching:!1,activate:function(){var n=OpenLayers.Strategy.prototype.activate.apply(this,arguments);return n&&(this.cache=[],this.layer.events.on({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this})),n},deactivate:function(){return this.cache=null,this.layer&&this.layer.events&&this.layer.events.un({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this}),OpenLayers.Strategy.prototype.deactivate.apply(this,arguments)},handleAdd:function(n){var r,t,i,u;if(!this.caching&&this.filter)for(r=n.features,n.features=[],i=0,u=r.length;i<u;++i)t=r[i],this.filter.evaluate(t)?n.features.push(t):this.cache.push(t)},handleRemove:function(){this.caching||(this.cache=[])},setFilter:function(n){this.filter=n,n=this.cache,this.cache=[],this.handleAdd({features:this.layer.features}),0<this.cache.length&&(this.caching=!0,this.layer.removeFeatures(this.cache.slice()),this.caching=!1),0<n.length&&(n={features:n},this.handleAdd(n),0<n.features.length&&(this.caching=!0,this.layer.addFeatures(n.features),this.caching=!1))},CLASS_NAME:"OpenLayers.Strategy.Filter"}),OpenLayers.Protocol.SOS=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Protocol.SOS.DEFAULTS);var t=OpenLayers.Protocol.SOS["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported SOS version: "+n.version;return new t(n)},OpenLayers.Protocol.SOS.DEFAULTS={version:"1.0.0"},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:!1,createGeometryFromItem:function(n){var i=this.getElementsByTagNameNS(n,this.georssns,"point"),t=this.getElementsByTagNameNS(n,this.geons,"lat"),r=this.getElementsByTagNameNS(n,this.geons,"long"),u=this.getElementsByTagNameNS(n,this.georssns,"line"),e=this.getElementsByTagNameNS(n,this.georssns,"polygon"),o=this.getElementsByTagNameNS(n,this.georssns,"where"),f;if(n=this.getElementsByTagNameNS(n,this.georssns,"box"),0<i.length||0<t.length&&0<r.length)0<i.length?(t=OpenLayers.String.trim(i[0].firstChild.nodeValue).split(/\s+/),2!=t.length&&(t=OpenLayers.String.trim(i[0].firstChild.nodeValue).split(/\s*,\s*/))):t=[parseFloat(t[0].firstChild.nodeValue),parseFloat(r[0].firstChild.nodeValue)],f=new OpenLayers.Geometry.Point(t[1],t[0]);else if(0<u.length){for(t=OpenLayers.String.trim(this.getChildValue(u[0])).split(/\s+/),r=[],u=0,e=t.length;u<e;u+=2)i=new OpenLayers.Geometry.Point(t[u+1],t[u]),r.push(i);f=new OpenLayers.Geometry.LineString(r)}else if(0<e.length){for(t=OpenLayers.String.trim(this.getChildValue(e[0])).split(/\s+/),r=[],u=0,e=t.length;u<e;u+=2)i=new OpenLayers.Geometry.Point(t[u+1],t[u]),r.push(i);f=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(r)])}else 0<o.length?(this.gmlParser||(this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})),f=this.gmlParser.parseFeature(o[0]).geometry):0<n.length&&(t=OpenLayers.String.trim(n[0].firstChild.nodeValue).split(/\s+/),r=[],3<t.length&&(i=new OpenLayers.Geometry.Point(t[1],t[0]),r.push(i),i=new OpenLayers.Geometry.Point(t[1],t[2]),r.push(i),i=new OpenLayers.Geometry.Point(t[3],t[2]),r.push(i),i=new OpenLayers.Geometry.Point(t[3],t[0]),r.push(i),i=new OpenLayers.Geometry.Point(t[1],t[0]),r.push(i)),f=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(r)]));return f&&this.internalProjection&&this.externalProjection&&f.transform(this.externalProjection,this.internalProjection),f},createFeatureFromItem:function(n){var t=this.createGeometryFromItem(n),r=this._getChildValue(n,"*","title",this.featureTitle),u=this._getChildValue(n,"*","description",this._getChildValue(n,"*","content",this._getChildValue(n,"*","summary",this.featureDescription))),i=this._getChildValue(n,"*","link");if(!i)try{i=this.getElementsByTagNameNS(n,"*","link")[0].getAttribute("href")}catch(f){i=null}return n=this._getChildValue(n,"*","id",null),t=new OpenLayers.Feature.Vector(t,{title:r,description:u,link:i}),t.fid=n,t},_getChildValue:function(n,t,i,r){return(n=this.getElementsByTagNameNS(n,t,i))&&n[0]&&n[0].firstChild&&n[0].firstChild.nodeValue?this.getChildValue(n[0]):void 0==r?"":r},read:function(n){var t,r,i;for("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),t=null,t=this.getElementsByTagNameNS(n,"*","item"),0==t.length&&(t=this.getElementsByTagNameNS(n,"*","entry")),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=this.createFeatureFromItem(t[i]);return r},write:function(n){var t,i,r;if(OpenLayers.Util.isArray(n))for(t=this.createElementNS(this.rssns,"rss"),i=0,r=n.length;i<r;i++)t.appendChild(this.createFeatureXML(n[i]));else t=this.createFeatureXML(n);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(n){var f=this.buildGeometryNode(n.geometry),u=this.createElementNS(this.rssns,"item"),r=this.createElementNS(this.rssns,"title"),t,i;r.appendChild(this.createTextNode(n.attributes.title?n.attributes.title:"")),t=this.createElementNS(this.rssns,"description"),t.appendChild(this.createTextNode(n.attributes.description?n.attributes.description:"")),u.appendChild(r),u.appendChild(t),n.attributes.link&&(r=this.createElementNS(this.rssns,"link"),r.appendChild(this.createTextNode(n.attributes.link)),u.appendChild(r));for(i in n.attributes)"link"!=i&&"title"!=i&&"description"!=i&&(r=this.createTextNode(n.attributes[i]),t=i,-1!=i.search(":")&&(t=i.split(":")[1]),t=this.createElementNS(this.featureNS,"feature:"+t),t.appendChild(r),u.appendChild(t));return u.appendChild(f),u},buildGeometryNode:function(n){this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection));var t;if("OpenLayers.Geometry.Polygon"==n.CLASS_NAME)t=this.createElementNS(this.georssns,"georss:polygon"),t.appendChild(this.buildCoordinatesNode(n.components[0]));else if("OpenLayers.Geometry.LineString"==n.CLASS_NAME)t=this.createElementNS(this.georssns,"georss:line"),t.appendChild(this.buildCoordinatesNode(n));else if("OpenLayers.Geometry.Point"==n.CLASS_NAME)t=this.createElementNS(this.georssns,"georss:point"),t.appendChild(this.buildCoordinatesNode(n));else throw"Couldn't parse "+n.CLASS_NAME;return t},buildCoordinatesNode:function(n){var t=null,r,i;if(n.components&&(t=n.components),t){for(n=t.length,r=Array(n),i=0;i<n;i++)r[i]=t[i].y+" "+t[i].x;t=r.join(" ")}else t=n.y+" "+n.x;return this.createTextNode(t)},CLASS_NAME:"OpenLayers.Format.GeoRSS"}),OpenLayers.Format.WPSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.WPSCapabilities"}),OpenLayers.Format.WPSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows/1.1",wps:"http://www.opengis.net/wps/1.0.0",xlink:"http://www.w3.org/1999/xlink"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{wps:{Capabilities:function(n,t){this.readChildNodes(n,t)},ProcessOfferings:function(n,t){t.processOfferings={},this.readChildNodes(n,t.processOfferings)},Process:function(n,t){var i={processVersion:this.getAttributeNS(n,this.namespaces.wps,"processVersion")};this.readChildNodes(n,i),t[i.identifier]=i},Languages:function(n,t){t.languages=[],this.readChildNodes(n,t.languages)},Default:function(n,t){var i={isDefault:!0};this.readChildNodes(n,i),t.push(i)},Supported:function(n,t){var i={};this.readChildNodes(n,i),t.push(i)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSCapabilities.v1_0_0"}),OpenLayers.Control.TouchNavigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,clickHandlerOptions:null,documentDrag:!1,autoActivate:!0,initialize:function(){this.handlers={},OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate(),this.dragPan&&this.dragPan.destroy(),this.dragPan=null,this.pinchZoom&&(this.pinchZoom.destroy(),delete this.pinchZoom),OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.dragPan.activate(),this.handlers.click.activate(),this.pinchZoom.activate(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.dragPan.deactivate(),this.handlers.click.deactivate(),this.pinchZoom.deactivate(),!0):!1},draw:function(){var n={click:this.defaultClick,dblclick:this.defaultDblClick},t=OpenLayers.Util.extend({double:!0,stopDouble:!0,pixelTolerance:2},this.clickHandlerOptions);this.handlers.click=new OpenLayers.Handler.Click(this,n,t),this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions)),this.dragPan.draw(),this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions))},defaultClick:function(n){n.lastTouches&&2==n.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(n){this.map.zoomTo(this.map.zoom+1,n.xy)},CLASS_NAME:"OpenLayers.Control.TouchNavigation"}),OpenLayers.Console.warn("OpenLayers.Rico is deprecated"),OpenLayers.Rico=OpenLayers.Rico||{},OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(n,t,i){this.rgb={r:n,g:t,b:i}},setRed:function(n){this.rgb.r=n},setGreen:function(n){this.rgb.g=n},setBlue:function(n){this.rgb.b=n},setHue:function(n){var t=this.asHSB();t.h=n,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setSaturation:function(n){var t=this.asHSB();t.s=n,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setBrightness:function(n){var t=this.asHSB();t.b=n,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},darken:function(n){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.max(t.b-n,0))},brighten:function(n){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.min(t.b+n,1))},blend:function(n){this.rgb.r=Math.floor((this.rgb.r+n.rgb.r)/2),this.rgb.g=Math.floor((this.rgb.g+n.rgb.g)/2),this.rgb.b=Math.floor((this.rgb.b+n.rgb.b)/2)},isBright:function(){return this.asHSB(),.5<this.asHSB().b},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(n){var i,t;if(4==n.length)for(i=n,n="#",t=1;4>t;t++)n+=i.charAt(t)+i.charAt(t);return 0==n.indexOf("#")&&(n=n.substring(1)),i=n.substring(0,2),t=n.substring(2,4),n=n.substring(4,6),new OpenLayers.Rico.Color(parseInt(i,16),parseInt(t,16),parseInt(n,16))},OpenLayers.Rico.Color.createColorFromBackground=function(n){var t=OpenLayers.Element.getStyle(OpenLayers.Util.getElement(n),"backgroundColor");return"transparent"==t&&n.parentNode?OpenLayers.Rico.Color.createColorFromBackground(n.parentNode):null==t?new OpenLayers.Rico.Color(255,255,255):0==t.indexOf("rgb(")?(n=t.substring(4,t.length-1).split(","),new OpenLayers.Rico.Color(parseInt(n[0]),parseInt(n[1]),parseInt(n[2]))):0==t.indexOf("#")?OpenLayers.Rico.Color.createFromHex(t):new OpenLayers.Rico.Color(255,255,255)},OpenLayers.Rico.Color.HSBtoRGB=function(n,t,i){var r=0,u=0,f=0;if(0==t)f=u=r=parseInt(255*i+.5);else{n=6*(n-Math.floor(n));var s=n-Math.floor(n),e=i*(1-t),o=i*(1-t*s);t=i*(1-t*(1-s));switch(parseInt(n)){case 0:r=255*i+.5,u=255*t+.5,f=255*e+.5;break;case 1:r=255*o+.5,u=255*i+.5,f=255*e+.5;break;case 2:r=255*e+.5,u=255*i+.5,f=255*t+.5;break;case 3:r=255*e+.5,u=255*o+.5,f=255*i+.5;break;case 4:r=255*t+.5,u=255*e+.5,f=255*i+.5;break;case 5:r=255*i+.5,u=255*e+.5,f=255*o+.5}}return{r:parseInt(r),g:parseInt(u),b:parseInt(f)}},OpenLayers.Rico.Color.RGBtoHSB=function(n,t,i){var f,r=n>t?n:t,u,e,o;return i>r&&(r=i),u=n<t?n:t,i<u&&(u=i),f=0!=r?(r-u)/r:0,0==f?n=0:(e=(r-n)/(r-u),o=(r-t)/(r-u),i=(r-i)/(r-u),n=(n==r?i-o:t==r?2+e-i:4+o-e)/6,0>n&&(n+=1)),{h:n,s:f,b:r/255}},OpenLayers.Style2=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,initialize:function(n){OpenLayers.Util.extend(this,n),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var n=0,t=this.rules.length;n<t;n++)this.rules[n].destroy();delete this.rules},clone:function(){var t=OpenLayers.Util.extend({},this),n,i;if(this.rules)for(t.rules=[],n=0,i=this.rules.length;n<i;++n)t.rules.push(this.rules[n].clone());return new OpenLayers.Style2(t)},CLASS_NAME:"OpenLayers.Style2"}),OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{drawMarker:function(n){var t=this.map.getLayerPxFromLonLat({lon:n.bounds.left,lat:n.bounds.top}),i=this.map.getLayerPxFromLonLat({lon:n.bounds.right,lat:n.bounds.bottom});null==i||null==t?n.display(!1):(t=n.draw(t,{w:Math.max(1,i.x-t.x),h:Math.max(1,i.y-t.y)}),n.drawn||(this.div.appendChild(t),n.drawn=!0))},removeMarker:function(n){OpenLayers.Util.removeItem(this.markers,n),null!=n.div&&n.div.parentNode==this.div&&this.div.removeChild(n.div)},CLASS_NAME:"OpenLayers.Layer.Boxes"}),OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{readers:{wfs:OpenLayers.Util.applyDefaults({Service:function(n,t){t.service={},this.readChildNodes(n,t.service)},Fees:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.fees=i)},AccessConstraints:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.accessConstraints=i)},OnlineResource:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.onlineResource=i)},Keywords:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.keywords=i.split(", "))},Capability:function(n,t){t.capability={},this.readChildNodes(n,t.capability)},Request:function(n,t){t.request={},this.readChildNodes(n,t.request)},GetFeature:function(n,t){t.getfeature={href:{},formats:[]},this.readChildNodes(n,t.getfeature)},ResultFormat:function(n,t){for(var u=n.childNodes,i,r=0;r<u.length;r++)i=u[r],1==i.nodeType&&t.formats.push(i.nodeName)},DCPType:function(n,t){this.readChildNodes(n,t)},HTTP:function(n,t){this.readChildNodes(n,t.href)},Get:function(n,t){t.get=n.getAttribute("onlineResource")},Post:function(n,t){t.post=n.getAttribute("onlineResource")},SRS:function(n,t){var i=this.getChildValue(n);i&&(t.srs=i)}},OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs)},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"}),OpenLayers.Layer.PointGrid=OpenLayers.Class(OpenLayers.Layer.Vector,{dx:null,dy:null,ratio:1.5,maxFeatures:250,rotation:0,origin:null,gridBounds:null,initialize:function(n){n=n||{},OpenLayers.Layer.Vector.prototype.initialize.apply(this,[n.name,n])},setMap:function(n){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments),n.events.register("moveend",this,this.onMoveEnd)},removeMap:function(n){n.events.unregister("moveend",this,this.onMoveEnd),OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},setRatio:function(n){this.ratio=n,this.updateGrid(!0)},setMaxFeatures:function(n){this.maxFeatures=n,this.updateGrid(!0)},setSpacing:function(n,t){this.dx=n,this.dy=t||n,this.updateGrid(!0)},setOrigin:function(n){this.origin=n,this.updateGrid(!0)},getOrigin:function(){return this.origin||(this.origin=this.map.getExtent().getCenterLonLat()),this.origin},setRotation:function(n){this.rotation=n,this.updateGrid(!0)},onMoveEnd:function(){this.updateGrid()},getViewBounds:function(){var n=this.map.getExtent();if(this.rotation){var t=this.getOrigin(),t=new OpenLayers.Geometry.Point(t.lon,t.lat),n=n.toGeometry();n.rotate(-this.rotation,t),n=n.getBounds()}return n},updateGrid:function(n){var t,i,h,e;if(n||this.invalidBounds()){t=this.getViewBounds(),i=this.getOrigin(),n=new OpenLayers.Geometry.Point(i.lon,i.lat);var r=t.getWidth(),u=t.getHeight(),h=r/u,o=Math.sqrt(this.dx*this.dy*this.maxFeatures/h),r=Math.min(r*this.ratio,o*h),u=Math.min(u*this.ratio,o),t=t.getCenterLonLat();this.gridBounds=new OpenLayers.Bounds(t.lon-r/2,t.lat-u/2,t.lon+r/2,t.lat+u/2);for(var t=Math.floor(u/this.dy),r=Math.floor(r/this.dx),u=i.lon+this.dx*Math.ceil((this.gridBounds.left-i.lon)/this.dx),i=i.lat+this.dy*Math.ceil((this.gridBounds.bottom-i.lat)/this.dy),o=Array(t*r),f,s=0;s<r;++s)for(h=u+s*this.dx,e=0;e<t;++e)f=i+e*this.dy,f=new OpenLayers.Geometry.Point(h,f),this.rotation&&f.rotate(this.rotation,n),o[s*t+e]=new OpenLayers.Feature.Vector(f);this.destroyFeatures(this.features,{silent:!0}),this.addFeatures(o,{silent:!0})}},invalidBounds:function(){return!this.gridBounds||!this.gridBounds.containsBounds(this.getViewBounds())},CLASS_NAME:"OpenLayers.Layer.PointGrid"}),OpenLayers.Layer.Zoomify=OpenLayers.Class(OpenLayers.Layer.Grid,{size:null,isBaseLayer:!0,standardTileSize:256,tileOriginCorner:"tl",numberOfTiers:0,tileCountUpToTier:null,tierSizeInTiles:null,tierImageSize:null,initialize:function(n,t,i,r){this.initializeZoomify(i),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n,t,i,{},r])},initializeZoomify:function(n){var t=n.clone();for(this.size=n.clone(),n=new OpenLayers.Size(Math.ceil(t.w/this.standardTileSize),Math.ceil(t.h/this.standardTileSize)),this.tierSizeInTiles=[n],this.tierImageSize=[t];t.w>this.standardTileSize||t.h>this.standardTileSize;)t=new OpenLayers.Size(Math.floor(t.w/2),Math.floor(t.h/2)),n=new OpenLayers.Size(Math.ceil(t.w/this.standardTileSize),Math.ceil(t.h/this.standardTileSize)),this.tierSizeInTiles.push(n),this.tierImageSize.push(t);for(this.tierSizeInTiles.reverse(),this.tierImageSize.reverse(),this.numberOfTiers=this.tierSizeInTiles.length,t=[1],this.tileCountUpToTier=[0],n=1;n<this.numberOfTiers;n++)t.unshift(Math.pow(2,n)),this.tileCountUpToTier.push(this.tierSizeInTiles[n-1].w*this.tierSizeInTiles[n-1].h+this.tileCountUpToTier[n-1]);this.serverResolutions||(this.serverResolutions=t)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments),this.tileCountUpToTier.length=0,this.tierSizeInTiles.length=0,this.tierImageSize.length=0},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Zoomify(this.name,this.url,this.size,this.options)),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){n=this.adjustBounds(n);var t=this.getServerResolution(),i=Math.round((n.left-this.tileOrigin.lon)/(t*this.tileSize.w));return n=Math.round((this.tileOrigin.lat-n.top)/(t*this.tileSize.h)),t=this.getZoomForResolution(t),i="TileGroup"+Math.floor((i+n*this.tierSizeInTiles[t].w+this.tileCountUpToTier[t])/256)+"/"+t+"-"+i+"-"+n+".jpg",t=this.url,OpenLayers.Util.isArray(t)&&(t=this.selectUrl(i,t)),t+i},getImageSize:function(){if(0<arguments.length){var t=this.adjustBounds(arguments[0]),n=this.getServerResolution(),u=Math.round((t.left-this.tileOrigin.lon)/(n*this.tileSize.w)),t=Math.round((this.tileOrigin.lat-t.top)/(n*this.tileSize.h)),n=this.getZoomForResolution(n),i=this.standardTileSize,r=this.standardTileSize;return u==this.tierSizeInTiles[n].w-1&&(i=this.tierImageSize[n].w%this.standardTileSize),t==this.tierSizeInTiles[n].h-1&&(r=this.tierImageSize[n].h%this.standardTileSize),new OpenLayers.Size(i,r)}return this.tileSize},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.top)},CLASS_NAME:"OpenLayers.Layer.Zoomify"}),OpenLayers.Layer.WMTS=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,version:"1.0.0",requestEncoding:"KVP",url:null,layer:null,matrixSet:null,style:null,format:"image/jpeg",tileOrigin:null,tileFullExtent:null,formatSuffix:null,matrixIds:null,dimensions:null,params:null,zoomOffset:0,serverResolutions:null,formatSuffixMap:{"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"},matrix:null,initialize:function(n){var i={url:!0,layer:!0,style:!0,matrixSet:!0},t;for(t in i)if(!(t in n))throw Error("Missing property '"+t+"' in layer configuration.");if(n.params=OpenLayers.Util.upperCaseObject(n.params),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n.name,n.url,n.params,n]),this.formatSuffix||(this.formatSuffix=this.formatSuffixMap[this.format]||this.format.split("/").pop()),this.matrixIds&&(n=this.matrixIds.length)&&"string"==typeof this.matrixIds[0])for(i=this.matrixIds,this.matrixIds=Array(n),t=0;t<n;++t)this.matrixIds[t]={identifier:i[t]}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments)},updateMatrixProperties:function(){(this.matrix=this.getMatrix())&&(this.matrix.topLeftCorner&&(this.tileOrigin=this.matrix.topLeftCorner),this.matrix.tileWidth&&this.matrix.tileHeight&&(this.tileSize=new OpenLayers.Size(this.matrix.tileWidth,this.matrix.tileHeight)),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.top)),this.tileFullExtent||(this.tileFullExtent=this.maxExtent))},moveTo:function(n,t){return!t&&this.matrix||this.updateMatrixProperties(),OpenLayers.Layer.Grid.prototype.moveTo.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.WMTS(this.options)),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getIdentifier:function(){return this.getServerZoom()},getMatrix:function(){var n;if(this.matrixIds&&0!==this.matrixIds.length)if("scaleDenominator"in this.matrixIds[0])for(var u=OpenLayers.METERS_PER_INCH*OpenLayers.INCHES_PER_UNIT[this.units]*this.getServerResolution()/.00028,r=Number.POSITIVE_INFINITY,i,t=0,f=this.matrixIds.length;t<f;++t)i=Math.abs(1-this.matrixIds[t].scaleDenominator/u),i<r&&(r=i,n=this.matrixIds[t]);else n=this.matrixIds[this.getIdentifier()];else n={identifier:this.getIdentifier()};return n},getTileInfo:function(n){var t=this.getServerResolution(),r=(n.lon-this.tileOrigin.lon)/(t*this.tileSize.w),i;return n=(this.tileOrigin.lat-n.lat)/(t*this.tileSize.h),t=Math.floor(r),i=Math.floor(n),{col:t,row:i,i:Math.floor((r-t)*this.tileSize.w),j:Math.floor((n-i)*this.tileSize.h)}},getURL:function(n){var t,f,i,r,u;if(n=this.adjustBounds(n),i="",!this.tileFullExtent||this.tileFullExtent.intersectsBounds(n))if(n=n.getCenterLonLat(),t=this.getTileInfo(n),n=this.dimensions,i=OpenLayers.Util.isArray(this.url)?this.selectUrl([this.version,this.style,this.matrixSet,this.matrix.identifier,t.row,t.col].join(),this.url):this.url,"REST"===this.requestEncoding.toUpperCase())if(f=this.params,-1!==i.indexOf("{")){if(i=i.replace(/\{/g,"${"),t={style:this.style,Style:this.style,TileMatrixSet:this.matrixSet,TileMatrix:this.matrix.identifier,TileRow:t.row,TileCol:t.col},n)for(u=n.length-1;0<=u;--u)r=n[u],t[r]=f[r.toUpperCase()];i=OpenLayers.String.format(i,t)}else{if(r=this.version+"/"+this.layer+"/"+this.style+"/",n)for(u=0;u<n.length;u++)f[n[u]]&&(r=r+f[n[u]]+"/");r=r+this.matrixSet+"/"+this.matrix.identifier+"/"+t.row+"/"+t.col+"."+this.formatSuffix,i.match(/\/$/)||(i+="/"),i+=r}else"KVP"===this.requestEncoding.toUpperCase()&&(f={SERVICE:"WMTS",REQUEST:"GetTile",VERSION:this.version,LAYER:this.layer,STYLE:this.style,TILEMATRIXSET:this.matrixSet,TILEMATRIX:this.matrix.identifier,TILEROW:t.row,TILECOL:t.col,FORMAT:this.format},i=OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,[f]));return i},mergeNewParams:function(n){if("KVP"===this.requestEncoding.toUpperCase())return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,[OpenLayers.Util.upperCaseObject(n)])},CLASS_NAME:"OpenLayers.Layer.WMTS"}),OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(n,t,i,r){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS),(null==r||null==r.isBaseLayer)&&(this.isBaseLayer="true"!=this.params.transparent&&!0!=this.params.transparent)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){n=this.adjustBounds(n),n=[n.left,n.bottom,n.right,n.top];var t=this.getImageSize();return this.getFullRequestString({mapext:n,imgext:n,map_size:[t.w,t.h],imgx:t.w/2,imgy:t.h/2,imgxy:[t.w,t.h]})},getFullRequestString:function(n,t){var u=null==t?this.url:t,i=OpenLayers.Util.extend({},this.params),i=OpenLayers.Util.extend(i,n),r=OpenLayers.Util.getParameterString(i),f;OpenLayers.Util.isArray(u)&&(u=this.selectUrl(r,u)),r=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(u));for(f in i)f.toUpperCase()in r&&delete i[f];return r=OpenLayers.Util.getParameterString(i),i=u,r=r.replace(/,/g,"+"),""!=r&&(f=u.charAt(u.length-1),i="&"==f||"?"==f?i+r:-1==u.indexOf("?")?i+("?"+r):i+("&"+r)),i},CLASS_NAME:"OpenLayers.Layer.MapServer"}),OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(){if(this.supported()){if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);for(var r=document.createStyleSheet(),i="shape rect oval fill stroke imagedata group textbox".split(" "),t=0,u=i.length;t<u;t++)r.addRule("olv\\:"+i[t],"behavior: url(#default#VML); position: absolute; display: inline-block;")}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments)}},supported:function(){return!!document.namespaces},setExtent:function(n,t){var f=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),i=this.getResolution(),r=n.left/i|0,i=n.top/i-this.size.h|0;t||!this.offset?(this.offset={x:r,y:i},i=r=0):(r-=this.offset.x,i-=this.offset.y),this.root.coordorigin=r-this.xOffset+" "+i;for(var r=[this.root,this.vectorRoot,this.textRoot],u=0,e=r.length;u<e;++u)i=r[u],i.coordsize=this.size.w+" "+this.size.h;return this.root.style.flip="y",f},setSize:function(){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);for(var r=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],u=this.size.w+"px",f=this.size.h+"px",t,i=0,e=r.length;i<e;++i)t=r[i],t.style.width=u,t.style.height=f},getNodeType:function(n,t){var i=null;switch(n.CLASS_NAME){case"OpenLayers.Geometry.Point":i=t.externalGraphic?"olv:rect":this.isComplexSymbol(t.graphicName)?"olv:shape":"olv:oval";break;case"OpenLayers.Geometry.Rectangle":i="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":i="olv:shape"}return i},setStyle:function(n,t,i,r){var e,f;if(t=t||n._style,i=i||n._options,e=t.fillColor,f=t.title||t.graphicTitle,f&&(n.title=f),"OpenLayers.Geometry.Point"===n._geometryClass)if(t.externalGraphic){i.isFilled=!0;var e=t.graphicWidth||t.graphicHeight,f=t.graphicHeight||t.graphicWidth,e=e?e:2*t.pointRadius,f=f?f:2*t.pointRadius,o=this.getResolution(),u=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*e),s=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*f);n.style.left=((r.x-this.featureDx)/o-this.offset.x+u|0)+"px",n.style.top=(r.y/o-this.offset.y-(s+f)|0)+"px",n.style.width=e+"px",n.style.height=f+"px",n.style.flip="y",e="none",i.isStroked=!1}else this.isComplexSymbol(t.graphicName)?(f=this.importSymbol(t.graphicName),n.path=f.path,n.coordorigin=f.left+","+f.bottom,f=f.size,n.coordsize=f+","+f,this.drawCircle(n,r,t.pointRadius),n.style.flip="y"):this.drawCircle(n,r,t.pointRadius);return i.isFilled?n.fillcolor=e:n.filled="false",r=n.getElementsByTagName("fill"),r=0==r.length?null:r[0],i.isFilled?(r||(r=this.createNode("olv:fill",n.id+"_fill")),r.opacity=t.fillOpacity,"OpenLayers.Geometry.Point"===n._geometryClass&&t.externalGraphic&&(t.graphicOpacity&&(r.opacity=t.graphicOpacity),r.src=t.externalGraphic,r.type="frame",t.graphicWidth&&t.graphicHeight||(r.aspect="atmost")),r.parentNode!=n&&n.appendChild(r)):r&&n.removeChild(r),e=t.rotation,(void 0!==e||void 0!==n._rotation)&&(n._rotation=e,t.externalGraphic?(this.graphicRotate(n,u,s,t),r.opacity=0):"OpenLayers.Geometry.Point"===n._geometryClass&&(n.style.rotation=e||0)),u=n.getElementsByTagName("stroke"),u=0==u.length?null:u[0],i.isStroked?(u||(u=this.createNode("olv:stroke",n.id+"_stroke"),n.appendChild(u)),u.on=!0,u.color=t.strokeColor,u.weight=t.strokeWidth+"px",u.opacity=t.strokeOpacity,u.endcap="butt"==t.strokeLinecap?"flat":t.strokeLinecap||"round",t.strokeDashstyle&&(u.dashstyle=this.dashStyle(t))):(n.stroked=!1,u&&(u.on=!1)),"inherit"!=t.cursor&&null!=t.cursor&&(n.style.cursor=t.cursor),n},graphicRotate:function(n,t,i,r){var f,h,s,e,c,u,o;r=r||n._style,f=r.rotation||0,r.graphicWidth&&r.graphicHeight?(s=Math.max(r.graphicWidth,r.graphicHeight),h=r.graphicWidth/r.graphicHeight,e=Math.round(r.graphicWidth||s*h),c=Math.round(r.graphicHeight||s),n.style.width=e+"px",n.style.height=c+"px",u=document.getElementById(n.id+"_image"),u||(u=this.createNode("olv:imagedata",n.id+"_image"),n.appendChild(u)),u.style.width=e+"px",u.style.height=c+"px",u.src=r.externalGraphic,u.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')",u=f*Math.PI/180,f=Math.sin(u),u=Math.cos(u),f="progid:DXImageTransform.Microsoft.Matrix(M11="+u+",M12="+-f+",M21="+f+",M22="+u+",SizingMethod='auto expand')\n",(u=r.graphicOpacity||r.fillOpacity)&&1!=u&&(f+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+u+")\n"),n.style.filter=f,f=new OpenLayers.Geometry.Point(-t,-i),e=new OpenLayers.Bounds(0,0,e,c).toGeometry(),e.rotate(r.rotation,f),e=e.getBounds(),n.style.left=Math.round(parseInt(n.style.left)+e.left)+"px",n.style.top=Math.round(parseInt(n.style.top)-e.bottom)+"px"):(o=new Image,o.onreadystatechange=OpenLayers.Function.bind(function(){("complete"==o.readyState||"interactive"==o.readyState)&&(h=o.width/o.height,s=Math.max(2*r.pointRadius,r.graphicWidth||0,r.graphicHeight||0),t*=h,r.graphicWidth=s*h,r.graphicHeight=s,this.graphicRotate(n,t,i,r))},this),o.src=r.externalGraphic)},postDraw:function(n){n.style.visibility="visible";var t=n._style.fillColor,i=n._style.strokeColor;"none"==t&&n.fillcolor!=t&&(n.fillcolor=t),"none"==i&&n.strokecolor!=i&&(n.strokecolor=i)},setNodeDimension:function(n,t){var i=t.getBounds(),r;i&&(r=this.getResolution(),i=new OpenLayers.Bounds((i.left-this.featureDx)/r-this.offset.x|0,i.bottom/r-this.offset.y|0,(i.right-this.featureDx)/r-this.offset.x|0,i.top/r-this.offset.y|0),n.style.left=i.left+"px",n.style.top=i.top+"px",n.style.width=i.getWidth()+"px",n.style.height=i.getHeight()+"px",n.coordorigin=i.left+" "+i.top,n.coordsize=i.getWidth()+" "+i.getHeight())},dashStyle:function(n){n=n.strokeDashstyle;switch(n){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return n;default:return n=n.split(/[ ,]/),2==n.length?1*n[0]>=2*n[1]?"longdash":1==n[0]||1==n[1]?"dot":"dash":4==n.length?1*n[0]>=2*n[1]?"longdashdot":"dashdot":"solid"}},createNode:function(n,t){var i=document.createElement(n);return t&&(i.id=t),i.unselectable="on",i.onselectstart=OpenLayers.Function.False,i},nodeTypeCompare:function(n,t){var u=t,r=u.indexOf(":"),i;return-1!=r&&(u=u.substr(r+1)),i=n.nodeName,r=i.indexOf(":"),-1!=r&&(i=i.substr(r+1)),u==i},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(n){return this.nodeFactory(this.container.id+n,"olv:group")},drawPoint:function(n,t){return this.drawCircle(n,t,1)},drawCircle:function(n,t,i){if(!isNaN(t.x)&&!isNaN(t.y)){var r=this.getResolution();return n.style.left=((t.x-this.featureDx)/r-this.offset.x|0)-i+"px",n.style.top=(t.y/r-this.offset.y|0)-i+"px",t=2*i,n.style.width=t+"px",n.style.height=t+"px",n}return!1},drawLineString:function(n,t){return this.drawLine(n,t,!1)},drawLinearRing:function(n,t){return this.drawLine(n,t,!0)},drawLine:function(n,t,i){this.setNodeDimension(n,t);for(var f=this.getResolution(),e=t.components.length,o=Array(e),r,s,u=0;u<e;u++)r=t.components[u],s=(r.x-this.featureDx)/f-this.offset.x|0,r=r.y/f-this.offset.y|0,o[u]=" "+s+","+r+" l ";return t=i?" x e":" e",n.path="m"+o.join("")+t,n},drawPolygon:function(n,t){this.setNodeDimension(n,t);for(var l=this.getResolution(),r=[],c,o,s,h,u,a,f,i,e=0,v=t.components.length;e<v;e++){for(r.push("m"),c=t.components[e].components,o=0===e,h=s=null,u=0,a=c.length;u<a;u++)f=c[u],i=(f.x-this.featureDx)/l-this.offset.x|0,f=f.y/l-this.offset.y|0,i=" "+i+","+f,r.push(i),0==u&&r.push(" l"),o||(s?s!=i&&(h?h!=i&&(o=!0):h=i):s=i);r.push(o?" x ":" ")}return r.push("e"),n.path=r.join(""),n},drawRectangle:function(n,t){var i=this.getResolution();return n.style.left=((t.x-this.featureDx)/i-this.offset.x|0)+"px",n.style.top=(t.y/i-this.offset.y|0)+"px",n.style.width=(t.width/i|0)+"px",n.style.height=(t.height/i|0)+"px",n},drawText:function(n,t,i){var u=this.nodeFactory(n+this.LABEL_ID_SUFFIX,"olv:rect"),r=this.nodeFactory(n+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox"),f=this.getResolution();u.style.left=((i.x-this.featureDx)/f-this.offset.x|0)+"px",u.style.top=(i.y/f-this.offset.y|0)+"px",u.style.flip="y",r.innerText=t.label,"inherit"!=t.cursor&&null!=t.cursor&&(r.style.cursor=t.cursor),t.fontColor&&(r.style.color=t.fontColor),t.fontOpacity&&(r.style.filter="alpha(opacity="+100*t.fontOpacity+")"),t.fontFamily&&(r.style.fontFamily=t.fontFamily),t.fontSize&&(r.style.fontSize=t.fontSize),t.fontWeight&&(r.style.fontWeight=t.fontWeight),t.fontStyle&&(r.style.fontStyle=t.fontStyle),!0===t.labelSelect&&(u._featureId=n,r._featureId=n,r._geometry=i,r._geometryClass=i.CLASS_NAME),r.style.whiteSpace="nowrap",r.inset="1px,0px,0px,0px",u.parentNode||(u.appendChild(r),this.textRoot.appendChild(u)),t=t.labelAlign||"cm",1==t.length&&(t+="m"),n=r.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[t.substr(0,1)],r=r.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[t.substr(1,1)],u.style.left=parseInt(u.style.left)-n-1+"px",u.style.top=parseInt(u.style.top)+r+"px"},moveRoot:function(n){var t=this.map.getLayer(n.container.id);t instanceof OpenLayers.Layer.Vector.RootContainer&&(t=this.map.getLayer(this.container.id)),t&&t.renderer.clear(),OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments),t&&t.redraw()},importSymbol:function(n){var e=this.container.id+"-"+n,i=this.symbolCache[e],t,r,u,f;if(i)return i;if(i=OpenLayers.Renderer.symbol[n],!i)throw Error(n+" is not a valid symbol name");for(n=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),t=["m"],r=0;r<i.length;r+=2)u=i[r],f=i[r+1],n.left=Math.min(n.left,u),n.bottom=Math.min(n.bottom,f),n.right=Math.max(n.right,u),n.top=Math.max(n.top,f),t.push(u),t.push(f),0==r&&t.push("l");return t.push("x e"),i=t.join(" "),t=(n.getWidth()-n.getHeight())/2,0<t?(n.bottom-=t,n.top+=t):(n.left+=t,n.right-=t),i={path:i,size:n.getWidth(),left:n.left,bottom:n.bottom},this.symbolCache[e]=i},CLASS_NAME:"OpenLayers.Renderer.VML"}),OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:.5,r:1,t:0,m:.5,b:1},OpenLayers.Control.CacheRead=OpenLayers.Class(OpenLayers.Control,{fetchEvent:"tileloadstart",layers:null,autoActivate:!0,setMap:function(n){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var i=this.layers||n.layers,t=i.length-1;0<=t;--t)this.addLayer({layer:i[t]});if(!this.layers)n.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})},addLayer:function(n){n.layer.events.register(this.fetchEvent,this,this.fetch)},removeLayer:function(n){n.layer.events.unregister(this.fetchEvent,this,this.fetch)},fetch:function(n){if(this.active&&window.localStorage&&n.tile instanceof OpenLayers.Tile.Image){var i=n.tile,t=i.url;!i.layer.crossOriginKeyword&&OpenLayers.ProxyHost&&0===t.indexOf(OpenLayers.ProxyHost)&&(t=OpenLayers.Control.CacheWrite.urlMap[t]),(t=window.localStorage.getItem("olCache_"+t))&&(i.url=t,"tileerror"===n.type&&i.setImgSrc(t))}},destroy:function(){if(this.layers||this.map)for(var t=this.layers||this.map.layers,n=t.length-1;0<=n;--n)this.removeLayer({layer:t[n]});this.map&&this.map.events.un({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.CacheRead"}),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.Control.WMTSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,requestEncoding:"KVP",drillDown:!1,maxFeatures:10,clickCallback:"click",layers:null,queryVisible:!0,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handler:null,hoverRequest:null,pending:0,initialize:function(n){n=n||{},n.handlerOptions=n.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[n]),this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(n.formatOptions)),!0===this.drillDown&&(this.hover=!1),this.hover?this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250})):(n={},n[this.clickCallback]=this.getInfoForClick,this.handler=new OpenLayers.Handler.Click(this,n,this.handlerOptions.click||{}))},getInfoForClick:function(n){this.request(n.xy,{})},getInfoForHover:function(n){this.request(n.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(--this.pending,0>=this.pending&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0),this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var i=this.layers||this.map.layers,r=[],n,t=i.length-1;0<=t&&(n=i[t],!(n instanceof OpenLayers.Layer.WMTS&&n.requestEncoding===this.requestEncoding)||this.queryVisible&&!n.getVisibility()||(r.push(n),this.drillDown&&!this.hover));--t);return r},buildRequestOptions:function(n,t){var i=this.map.getLonLatFromPixel(t),r=n.getURL(new OpenLayers.Bounds(i.lon,i.lat,i.lon,i.lat)),r=OpenLayers.Util.getParameters(r),i=n.getTileInfo(i);return OpenLayers.Util.extend(r,{service:"WMTS",version:n.version,request:"GetFeatureInfo",infoFormat:this.infoFormat,i:i.i,j:i.j}),OpenLayers.Util.applyDefaults(r,this.vendorParams),{url:OpenLayers.Util.isArray(n.url)?n.url[0]:n.url,params:OpenLayers.Util.upperCaseObject(r),callback:function(i){this.handleResponse(t,i,n)},scope:this}},request:function(n,t){var r,i,f,u,e;if(t=t||{},r=this.findLayers(),0<r.length){for(u=0,e=r.length;u<e;u++)f=r[u],i=this.events.triggerEvent("beforegetfeatureinfo",{xy:n,layer:f}),!1!==i&&(++this.pending,i=this.buildRequestOptions(f,n),i=OpenLayers.Request.GET(i),!0===t.hover&&(this.hoverRequest=i));0<this.pending&&OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(n,t,i){var r,u,f;if(--this.pending,0>=this.pending&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0),t.status&&(200>t.status||300<=t.status))this.events.triggerEvent("exception",{xy:n,request:t,layer:i});else{r=t.responseXML,r&&r.documentElement||(r=t.responseText);try{u=this.format.read(r)}catch(e){f=!0,this.events.triggerEvent("exception",{xy:n,request:t,error:e,layer:i})}f||this.events.triggerEvent("getfeatureinfo",{text:t.responseText,features:u,request:t,xy:n,layer:i})}},CLASS_NAME:"OpenLayers.Control.WMTSGetFeatureInfo"}),OpenLayers.Protocol.CSW.v2_0_2=OpenLayers.Class(OpenLayers.Protocol,{formatOptions:null,initialize:function(n){OpenLayers.Protocol.prototype.initialize.apply(this,[n]),n.format||(this.format=new OpenLayers.Format.CSWGetRecords.v2_0_2(OpenLayers.Util.extend({},this.formatOptions)))},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(n){n=OpenLayers.Util.extend({},n),OpenLayers.Util.applyDefaults(n,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.format.write(n.params||n);return t.priv=OpenLayers.Request.POST({url:n.url,callback:this.createCallback(this.handleRead,t,n),params:n.params,headers:n.headers,data:i}),t},handleRead:function(n,t){if(t.callback){var i=n.priv;200<=i.status&&300>i.status?(n.data=this.parseData(i),n.code=OpenLayers.Protocol.Response.SUCCESS):n.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,n)}},parseData:function(n){var t=n.responseXML;return t&&t.documentElement||(t=n.responseText),!t||0>=t.length?null:this.format.read(t)},CLASS_NAME:"OpenLayers.Protocol.CSW.v2_0_2"}),OpenLayers.Control.SLDSelect=OpenLayers.Class(OpenLayers.Control,{clearOnDeactivate:!1,layers:null,callbacks:null,selectionSymbolizer:{Polygon:{fillColor:"#FF0000",stroke:!1},Line:{strokeColor:"#FF0000",strokeWidth:2},Point:{graphicName:"square",fillColor:"#FF0000",pointRadius:5}},layerOptions:null,sketchStyle:null,wfsCache:{},layerCache:{},initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.callbacks=OpenLayers.Util.extend({done:this.select,click:this.select},this.callbacks),this.handlerOptions=this.handlerOptions||{},this.layerOptions=OpenLayers.Util.applyDefaults(this.layerOptions,{displayInLayerSwitcher:!1,tileOptions:{maxGetUrlLength:2048}}),this.sketchStyle&&(this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":this.sketchStyle})})),this.handler=new n(this,this.callbacks,this.handlerOptions)},destroy:function(){for(var n in this.layerCache)delete this.layerCache[n];for(n in this.wfsCache)delete this.wfsCache[n];OpenLayers.Control.prototype.destroy.apply(this,arguments)},coupleLayerVisiblity:function(n){this.setVisibility(n.object.getVisibility())},createSelectionLayer:function(n){var t;if(this.layerCache[n.id])t=this.layerCache[n.id];else{if(t=new OpenLayers.Layer.WMS(n.name,n.url,n.params,OpenLayers.Util.applyDefaults(this.layerOptions,n.getOptions())),this.layerCache[n.id]=t,!1===this.layerOptions.displayInLayerSwitcher)n.events.on({visibilitychanged:this.coupleLayerVisiblity,scope:t});this.map.addLayer(t)}return t},createSLD:function(n,t,i){for(var f,u,e,o={version:"1.0.0",namedLayers:{}},s=(""+n.params.LAYERS).split(","),r=0,h=s.length;r<h;r++)f=s[r],o.namedLayers[f]={name:f,userStyles:[]},u=this.selectionSymbolizer,e=i[r],0<=e.type.indexOf("Polygon")?u={Polygon:this.selectionSymbolizer.Polygon}:0<=e.type.indexOf("LineString")?u={Line:this.selectionSymbolizer.Line}:0<=e.type.indexOf("Point")&&(u={Point:this.selectionSymbolizer.Point}),o.namedLayers[f].userStyles.push({name:"default",rules:[new OpenLayers.Rule({symbolizer:u,filter:t[r],maxScaleDenominator:n.options.minScale})]});return new OpenLayers.Format.SLD({srsName:this.map.getProjection()}).write(o)},parseDescribeLayer:function(n){var r=new OpenLayers.Format.WMSDescribeLayer,t=n.responseXML;t&&t.documentElement||(t=n.responseText),n=r.read(t);for(var r=[],t=null,i=0,u=n.length;i<u;i++)"WFS"==n[i].owsType&&(r.push(n[i].typeName),t=n[i].owsURL);OpenLayers.Request.GET({url:t,params:{SERVICE:"WFS",TYPENAME:r.toString(),REQUEST:"DescribeFeatureType",VERSION:"1.0.0"},callback:function(n){var i=new OpenLayers.Format.WFSDescribeFeatureType,t=n.responseXML;t&&t.documentElement||(t=n.responseText),n=i.read(t),this.control.wfsCache[this.layer.id]=n,this.control._queue&&this.control.applySelection()},scope:this})},getGeometryAttributes:function(n){var f=[],i,e,u,t;for(n=this.wfsCache[n.id],i=0,e=n.featureTypes.length;i<e;i++)for(var o=n.featureTypes[i].properties,r=0,s=o.length;r<s;r++)u=o[r],t=u.type,(0<=t.indexOf("LineString")||0<=t.indexOf("GeometryAssociationType")||0<=t.indexOf("GeometryPropertyType")||0<=t.indexOf("Point")||0<=t.indexOf("Polygon"))&&f.push(u);return f},activate:function(){var i=OpenLayers.Control.prototype.activate.call(this),t,r,n;if(i)for(t=0,r=this.layers.length;t<r;t++)n=this.layers[t],n&&!this.wfsCache[n.id]&&OpenLayers.Request.GET({url:n.url,params:{SERVICE:"WMS",VERSION:n.params.VERSION,LAYERS:n.params.LAYERS,REQUEST:"DescribeLayer"},callback:this.parseDescribeLayer,scope:{layer:n,control:this}});return i},deactivate:function(){var u=OpenLayers.Control.prototype.deactivate.call(this),t,f,n,r,i;if(u)for(t=0,f=this.layers.length;t<f;t++)n=this.layers[t],n&&!0===this.clearOnDeactivate&&(r=this.layerCache,i=r[n.id],i&&(n.events.un({visibilitychanged:this.coupleLayerVisiblity,scope:i}),i.destroy(),delete r[n.id]));return u},setLayers:function(n){this.active?(this.deactivate(),this.layers=n,this.activate()):this.layers=n},createFilter:function(n,t){var i=null;return this.handler instanceof OpenLayers.Handler.RegularPolygon?i=!0===this.handler.irregular?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:n.name,value:t.getBounds()}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):this.handler instanceof OpenLayers.Handler.Polygon?i=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):this.handler instanceof OpenLayers.Handler.Path?i=0<=n.type.indexOf("Point")?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:n.name,distance:.01*this.map.getExtent().getWidth(),distanceUnits:this.map.getUnits(),value:t}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):this.handler instanceof OpenLayers.Handler.Click&&(i=0<=n.type.indexOf("Polygon")?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:n.name,distance:.01*this.map.getExtent().getWidth(),distanceUnits:this.map.getUnits(),value:t})),i},select:function(n){this._queue=function(){for(var i,o,u=0,s=this.layers.length;u<s;u++){for(var t=this.layers[u],f=this.getGeometryAttributes(t),e=[],r=0,h=f.length;r<h;r++)i=f[r],null!==i&&(n instanceof OpenLayers.Geometry||(o=this.map.getLonLatFromPixel(n.xy),n=new OpenLayers.Geometry.Point(o.lon,o.lat)),i=this.createFilter(i,n),null!==i&&e.push(i));r=this.createSelectionLayer(t),this.events.triggerEvent("selected",{layer:t,filters:e}),t=this.createSLD(t,e,f),r.mergeNewParams({SLD_BODY:t}),delete this._queue}},this.applySelection()},applySelection:function(){for(var t=!0,n=0,i=this.layers.length;n<i;n++)if(!this.wfsCache[this.layers[n].id]){t=!1;break}t&&this._queue.call(this)},CLASS_NAME:"OpenLayers.Control.SLDSelect"}),OpenLayers.Control.Graticule=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,intervals:[45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],displayInLayerSwitcher:!0,visible:!0,numPoints:50,targetSize:200,layerName:null,labelled:!0,labelFormat:"dm",lineSymbolizer:{strokeColor:"#333",strokeWidth:1,strokeOpacity:.5},labelSymbolizer:{},gratLayer:null,initialize:function(n){n=n||{},n.layerName=n.layerName||OpenLayers.i18n("Graticule"),OpenLayers.Control.prototype.initialize.apply(this,[n]),this.labelSymbolizer.stroke=!1,this.labelSymbolizer.fill=!1,this.labelSymbolizer.label="${label}",this.labelSymbolizer.labelAlign="${labelAlign}",this.labelSymbolizer.labelXOffset="${xOffset}",this.labelSymbolizer.labelYOffset="${yOffset}"},destroy:function(){this.deactivate(),OpenLayers.Control.prototype.destroy.apply(this,arguments),this.gratLayer&&(this.gratLayer.destroy(),this.gratLayer=null)},draw:function(){if(OpenLayers.Control.prototype.draw.apply(this,arguments),!this.gratLayer){var n=new OpenLayers.Style({},{rules:[new OpenLayers.Rule({symbolizer:{Point:this.labelSymbolizer,Line:this.lineSymbolizer}})]});this.gratLayer=new OpenLayers.Layer.Vector(this.layerName,{styleMap:new OpenLayers.StyleMap({"default":n}),visibility:this.visible,displayInLayerSwitcher:this.displayInLayerSwitcher})}return this.div},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.map.addLayer(this.gratLayer),this.map.events.register("moveend",this,this.update),this.update(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.map.events.unregister("moveend",this,this.update),this.map.removeLayer(this.gratLayer),!0):!1},update:function(){var c=this.map.getExtent(),e,t,h;if(c){this.gratLayer.destroyFeatures();var l=new OpenLayers.Projection("EPSG:4326"),o=this.map.getProjectionObject(),i=this.map.getResolution();o.proj&&"longlat"==o.proj.projName&&(this.numPoints=1),e=this.map.getCenter(),t=new OpenLayers.Pixel(e.lon,e.lat),OpenLayers.Projection.transform(t,o,l);for(var e=this.targetSize*i,e=e*e,u,i=0;i<this.intervals.length;++i){u=this.intervals[i];var n=u/2,f=t.offset({x:-n,y:-n}),n=t.offset({x:n,y:n});if(OpenLayers.Projection.transform(f,l,o),OpenLayers.Projection.transform(n,l,o),(f.x-n.x)*(f.x-n.x)+(f.y-n.y)*(f.y-n.y)<=e)break}t.x=Math.floor(t.x/u)*u,t.y=Math.floor(t.y/u)*u;var i=0,e=[t.clone()],n=t.clone(),r;do n=n.offset({x:0,y:u}),r=OpenLayers.Projection.transform(n.clone(),l,o),e.unshift(n);while(c.containsPixel(r)&&1e3>++i);n=t.clone();do n=n.offset({x:0,y:-u}),r=OpenLayers.Projection.transform(n.clone(),l,o),e.push(n);while(c.containsPixel(r)&&1e3>++i);i=0,f=[t.clone()],n=t.clone();do n=n.offset({x:-u,y:0}),r=OpenLayers.Projection.transform(n.clone(),l,o),f.unshift(n);while(c.containsPixel(r)&&1e3>++i);n=t.clone();do n=n.offset({x:u,y:0}),r=OpenLayers.Projection.transform(n.clone(),l,o),f.push(n);while(c.containsPixel(r)&&1e3>++i);for(u=[],i=0;i<f.length;++i){r=f[i].x;for(var t=[],s=null,a=Math.min(e[0].y,90),n=Math.max(e[e.length-1].y,-90),v=(a-n)/this.numPoints,a=n,n=0;n<=this.numPoints;++n)h=new OpenLayers.Geometry.Point(r,a),h.transform(l,o),t.push(h),a+=v,h.y>=c.bottom&&!s&&(s=h);this.labelled&&(s=new OpenLayers.Geometry.Point(s.x,c.bottom),r={value:r,label:this.labelled?OpenLayers.Util.getFormattedLonLat(r,"lon",this.labelFormat):"",labelAlign:"cb",xOffset:0,yOffset:2},this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(s,r))),t=new OpenLayers.Geometry.LineString(t),u.push(new OpenLayers.Feature.Vector(t))}for(n=0;n<e.length;++n)if(a=e[n].y,!(-90>a||90<a)){for(t=[],i=f[0].x,v=(f[f.length-1].x-i)/this.numPoints,r=i,s=null,i=0;i<=this.numPoints;++i)h=new OpenLayers.Geometry.Point(r,a),h.transform(l,o),t.push(h),r+=v,h.x<c.right&&(s=h);this.labelled&&(s=new OpenLayers.Geometry.Point(c.right,s.y),r={value:a,label:this.labelled?OpenLayers.Util.getFormattedLonLat(a,"lat",this.labelFormat):"",labelAlign:"rb",xOffset:-2,yOffset:2},this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(s,r))),t=new OpenLayers.Geometry.LineString(t),u.push(new OpenLayers.Feature.Vector(t))}this.gratLayer.addFeatures(u)}},CLASS_NAME:"OpenLayers.Control.Graticule"}),OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(){},onDrag:function(){},onComplete:function(){},onEnter:function(){},onLeave:function(){},documentDrag:!1,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.layer=n,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),{documentDrag:this.documentDrag}),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},clickFeature:function(n){this.handlers.feature.touch&&!this.over&&this.overFeature(n)&&(this.handlers.drag.dragstart(this.handlers.feature.evt),this.handlers.drag.stopDown=!1)},clickoutFeature:function(n){this.handlers.feature.touch&&this.over&&(this.outFeature(n),this.handlers.drag.stopDown=!0)},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(){return this.handlers.drag.deactivate(),this.handlers.feature.deactivate(),this.feature=null,this.dragging=!1,this.lastPixel=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(n){var t=!1;return this.handlers.drag.dragging?this.over=this.feature.id==n.id?!0:!1:(this.feature=n,this.handlers.drag.activate(),this.over=t=!0,OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onEnter(n)),t},downFeature:function(n){this.lastPixel=n;this.onStart(this.feature,n)},moveFeature:function(n){var t=this.map.getResolution();this.feature.geometry.move(t*(n.x-this.lastPixel.x),t*(this.lastPixel.y-n.y)),this.layer.drawFeature(this.feature),this.lastPixel=n;this.onDrag(this.feature,n)},upFeature:function(){this.over||this.handlers.drag.deactivate()},doneDragging:function(n){this.onComplete(this.feature,n)},outFeature:function(n){this.handlers.drag.dragging?this.feature.id==n.id&&(this.over=!1):(this.over=!1,this.handlers.drag.deactivate(),OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onLeave(n),this.feature=null)},cancel:function(){this.handlers.drag.deactivate(),this.over=!1},setMap:function(n){this.handlers.drag.setMap(n),this.handlers.feature.setMap(n),OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"}),OpenLayers.Console.warn("OpenLayers.Rico is deprecated"),OpenLayers.Rico=OpenLayers.Rico||{},OpenLayers.Rico.Corner={round:function(n,t){var i,r;n=OpenLayers.Util.getElement(n),this._setOptions(t),i=this.options.color,"fromElement"==this.options.color&&(i=this._background(n)),r=this.options.bgColor,"fromParent"==this.options.bgColor&&(r=this._background(n.offsetParent)),this._roundCornersImpl(n,i,r)},changeColor:function(n,t){n.style.backgroundColor=t;for(var r=n.parentNode.getElementsByTagName("span"),i=0;i<r.length;i++)r[i].style.backgroundColor=t},changeOpacity:function(n,t){var u="alpha(opacity="+100*t+")",r,i;for(n.style.opacity=t,n.style.filter=u,r=n.parentNode.getElementsByTagName("span"),i=0;i<r.length;i++)r[i].style.opacity=t,r[i].style.filter=u},reRound:function(n,t){var i=n.parentNode.childNodes[2];n.parentNode.removeChild(n.parentNode.childNodes[0]),n.parentNode.removeChild(i),this.round(n.parentNode,t)},_roundCornersImpl:function(n,t,i){this.options.border&&this._renderBorder(n,i),this._isTopRounded()&&this._roundTopCorners(n,t,i),this._isBottomRounded()&&this._roundBottomCorners(n,t,i)},_renderBorder:function(n,t){var i="1px solid "+this._borderColor(t);n.innerHTML="<div "+("style='border-left: "+i+";"+("border-right: "+i)+"'")+">"+n.innerHTML+"<\/div>"},_roundTopCorners:function(n,t,i){for(var u=this._createCorner(i),r=0;r<this.options.numSlices;r++)u.appendChild(this._createCornerSlice(t,i,r,"top"));n.style.paddingTop=0,n.insertBefore(u,n.firstChild)},_roundBottomCorners:function(n,t,i){for(var u=this._createCorner(i),r=this.options.numSlices-1;0<=r;r--)u.appendChild(this._createCornerSlice(t,i,r,"bottom"));n.style.paddingBottom=0,n.appendChild(u)},_createCorner:function(n){var t=document.createElement("div");return t.style.backgroundColor=this._isTransparent()?"transparent":n,t},_createCornerSlice:function(n,t,i,r){var f=document.createElement("span"),u=f.style;return u.backgroundColor=n,u.display="block",u.height="1px",u.overflow="hidden",u.fontSize="1px",n=this._borderColor(n,t),this.options.border&&0==i?(u.borderTopStyle="solid",u.borderTopWidth="1px",u.borderLeftWidth="0px",u.borderRightWidth="0px",u.borderBottomWidth="0px",u.height="0px",u.borderColor=n):n&&(u.borderColor=n,u.borderStyle="solid",u.borderWidth="0px 1px"),this.options.compact||i!=this.options.numSlices-1||(u.height="2px"),this._setMargin(f,i,r),this._setBorder(f,i,r),f},_setOptions:function(n){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:!0,border:!1,compact:!1},OpenLayers.Util.extend(this.options,n||{}),this.options.numSlices=this.options.compact?2:4,this._isTransparent()&&(this.options.blend=!1)},_whichSideTop:function(){return this._hasString(this.options.corners,"all","top")||0<=this.options.corners.indexOf("tl")&&0<=this.options.corners.indexOf("tr")?"":0<=this.options.corners.indexOf("tl")?"left":0<=this.options.corners.indexOf("tr")?"right":""},_whichSideBottom:function(){return this._hasString(this.options.corners,"all","bottom")||0<=this.options.corners.indexOf("bl")&&0<=this.options.corners.indexOf("br")?"":0<=this.options.corners.indexOf("bl")?"left":0<=this.options.corners.indexOf("br")?"right":""},_borderColor:function(n,t){return"transparent"==n?t:this.options.border?this.options.border:this.options.blend?this._blend(t,n):""},_setMargin:function(n,t,i){t=this._marginSize(t),i="top"==i?this._whichSideTop():this._whichSideBottom(),"left"==i?(n.style.marginLeft=t+"px",n.style.marginRight="0px"):"right"==i?(n.style.marginRight=t+"px",n.style.marginLeft="0px"):(n.style.marginLeft=t+"px",n.style.marginRight=t+"px")},_setBorder:function(n,t,i){t=this._borderSize(t),i="top"==i?this._whichSideTop():this._whichSideBottom(),"left"==i?(n.style.borderLeftWidth=t+"px",n.style.borderRightWidth="0px"):"right"==i?(n.style.borderRightWidth=t+"px",n.style.borderLeftWidth="0px"):(n.style.borderLeftWidth=t+"px",n.style.borderRightWidth=t+"px"),!1!=this.options.border&&(n.style.borderLeftWidth=t+"px",n.style.borderRightWidth=t+"px")},_marginSize:function(n){if(this._isTransparent())return 0;var t=[5,3,2,1],i=[3,2,1,0],r=[2,1],u=[1,0];return this.options.compact&&this.options.blend?u[n]:this.options.compact?r[n]:this.options.blend?i[n]:t[n]},_borderSize:function(n){var t=[5,3,2,1],i=[2,1,1,1],r=[1,0],u=[0,2,0,0];return this.options.compact&&(this.options.blend||this._isTransparent())?1:this.options.compact?r[n]:this.options.blend?i[n]:this.options.border?u[n]:this._isTransparent()?t[n]:0},_hasString:function(n){for(var t=1;t<arguments.length;t++)if(0<=n.indexOf(arguments[t]))return!0;return!1},_blend:function(n,t){var i=OpenLayers.Rico.Color.createFromHex(n);return i.blend(OpenLayers.Rico.Color.createFromHex(t)),i},_background:function(n){try{return OpenLayers.Rico.Color.createColorFromBackground(n).asHex()}catch(t){return"#ffffff"}},_isTransparent:function(){return"transparent"==this.options.color},_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(n){return 1==n.childNodes.length&&3==n.childNodes[0].nodeType}},OpenLayers.Layer.UTFGrid=OpenLayers.Class(OpenLayers.Layer.XYZ,{isBaseLayer:!1,projection:new OpenLayers.Projection("EPSG:900913"),useJSONP:!1,tileClass:OpenLayers.Tile.UTFGrid,initialize:function(n){OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n.name,n.url,{},n]),this.tileOptions=OpenLayers.Util.extend({utfgridResolution:this.utfgridResolution},this.tileOptions)},createBackBuffer:function(){},clone:function(n){return null==n&&(n=new OpenLayers.Layer.UTFGrid(this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getFeatureInfo:function(n){var t=null;return(n=this.getTileData(n))&&n.tile&&(t=n.tile.getFeatureInfo(n.i,n.j)),t},getFeatureId:function(n){var t=null;return n=this.getTileData(n),n.tile&&(t=n.tile.getFeatureId(n.i,n.j)),t},CLASS_NAME:"OpenLayers.Layer.UTFGrid"}),OpenLayers.TileManager=OpenLayers.Class({cacheSize:256,tilesPerFrame:2,frameDelay:16,moveDelay:100,zoomDelay:200,maps:null,tileQueueId:null,tileQueue:null,tileCache:null,tileCacheIndex:null,initialize:function(n){OpenLayers.Util.extend(this,n),this.maps=[],this.tileQueueId={},this.tileQueue={},this.tileCache={},this.tileCacheIndex=[]},addMap:function(n){if(!this._destroyed&&OpenLayers.Layer.Grid){this.maps.push(n),this.tileQueue[n.id]=[];for(var t=0,i=n.layers.length;t<i;++t)this.addLayer({layer:n.layers[t]});n.events.on({move:this.move,zoomend:this.zoomEnd,changelayer:this.changeLayer,addlayer:this.addLayer,preremovelayer:this.removeLayer,scope:this})}},removeMap:function(n){if(!this._destroyed&&OpenLayers.Layer.Grid){if(window.clearTimeout(this.tileQueueId[n.id]),n.layers)for(var t=0,i=n.layers.length;t<i;++t)this.removeLayer({layer:n.layers[t]});n.events&&n.events.un({move:this.move,zoomend:this.zoomEnd,changelayer:this.changeLayer,addlayer:this.addLayer,preremovelayer:this.removeLayer,scope:this}),delete this.tileQueue[n.id],delete this.tileQueueId[n.id],OpenLayers.Util.removeItem(this.maps,n)}},move:function(n){this.updateTimeout(n.object,this.moveDelay,!0)},zoomEnd:function(n){this.updateTimeout(n.object,this.zoomDelay)},changeLayer:function(n){"visibility"!==n.property&&"params"!==n.property||this.updateTimeout(n.object,0)},addLayer:function(n){if(n=n.layer,n instanceof OpenLayers.Layer.Grid){n.events.on({addtile:this.addTile,retile:this.clearTileQueue,scope:this});for(var r,t,i=n.grid.length-1;0<=i;--i)for(r=n.grid[i].length-1;0<=r;--r)t=n.grid[i][r],this.addTile({tile:t}),t.url&&!t.imgDiv&&this.manageTileCache({object:t})}},removeLayer:function(n){if(n=n.layer,n instanceof OpenLayers.Layer.Grid&&(this.clearTileQueue({object:n}),n.events&&n.events.un({addtile:this.addTile,retile:this.clearTileQueue,scope:this}),n.grid))for(var i,r,t=n.grid.length-1;0<=t;--t)for(i=n.grid[t].length-1;0<=i;--i)r=n.grid[t][i],this.unloadTile({object:r})},updateTimeout:function(n,t,i){window.clearTimeout(this.tileQueueId[n.id]);var r=this.tileQueue[n.id];(!i||r.length)&&(this.tileQueueId[n.id]=window.setTimeout(OpenLayers.Function.bind(function(){this.drawTilesFromQueue(n),r.length&&this.updateTimeout(n,this.frameDelay)},this),t))},addTile:function(n){if(n.tile instanceof OpenLayers.Tile.Image)n.tile.events.on({beforedraw:this.queueTileDraw,beforeload:this.manageTileCache,loadend:this.addToCache,unload:this.unloadTile,scope:this});else this.removeLayer({layer:n.tile.layer})},unloadTile:function(n){n=n.object,n.events.un({beforedraw:this.queueTileDraw,beforeload:this.manageTileCache,loadend:this.addToCache,unload:this.unloadTile,scope:this}),OpenLayers.Util.removeItem(this.tileQueue[n.layer.map.id],n)},queueTileDraw:function(n){n=n.object;var t=!1,i=n.layer,u=i.getURL(n.bounds),r=this.tileCache[u];return r&&"olTileImage"!==r.className&&(delete this.tileCache[u],OpenLayers.Util.removeItem(this.tileCacheIndex,u),r=null),i.url&&(i.async||!r)&&(t=this.tileQueue[i.map.id],~OpenLayers.Util.indexOf(t,n)||t.push(n),t=!0),!t},drawTilesFromQueue:function(n){var t=this.tileQueue[n.id],i=this.tilesPerFrame;for(n=n.zoomTween&&n.zoomTween.playing;!n&&t.length&&i;)t.shift().draw(!0),--i},manageTileCache:function(n){n=n.object;var t=this.tileCache[n.url];t&&(t.parentNode&&OpenLayers.Element.hasClass(t.parentNode,"olBackBuffer")&&(t.parentNode.removeChild(t),t.id=null),t.parentNode||(t.style.visibility="hidden",t.style.opacity=0,n.setImage(t),OpenLayers.Util.removeItem(this.tileCacheIndex,n.url),this.tileCacheIndex.push(n.url)))},addToCache:function(n){n=n.object,this.tileCache[n.url]||OpenLayers.Element.hasClass(n.imgDiv,"olImageLoadError")||(this.tileCacheIndex.length>=this.cacheSize&&(delete this.tileCache[this.tileCacheIndex[0]],this.tileCacheIndex.shift()),this.tileCache[n.url]=n.imgDiv,this.tileCacheIndex.push(n.url))},clearTileQueue:function(n){n=n.object;for(var i=this.tileQueue[n.map.id],t=i.length-1;0<=t;--t)i[t].layer===n&&i.splice(t,1)},destroy:function(){for(var n=this.maps.length-1;0<=n;--n)this.removeMap(this.maps[n]);this.tileCacheIndex=this.tileCache=this.tileQueueId=this.tileQueue=this.maps=null,this._destroyed=!0}}),OpenLayers.Protocol.Script=OpenLayers.Class(OpenLayers.Protocol,{url:null,params:null,callback:null,callbackTemplate:"OpenLayers.Protocol.Script.registry.${id}",callbackKey:"callback",callbackPrefix:"",scope:null,format:null,pendingRequests:null,srsInBBOX:!1,initialize:function(n){if(n=n||{},this.params={},this.pendingRequests={},OpenLayers.Protocol.prototype.initialize.apply(this,arguments),this.format||(this.format=new OpenLayers.Format.GeoJSON),!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var t=new OpenLayers.Format.QueryStringFilter({srsInBBOX:this.srsInBBOX});this.filterToParams=function(n,i){return t.write(n,i)}}},read:function(n){OpenLayers.Protocol.prototype.read.apply(this,arguments),n=OpenLayers.Util.applyDefaults(n,this.options),n.params=OpenLayers.Util.applyDefaults(n.params,this.options.params),n.filter&&this.filterToParams&&(n.params=this.filterToParams(n.filter,n.params));var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.createRequest(n.url,n.params,OpenLayers.Function.bind(function(i){t.data=i,this.handleRead(t,n)},this));return t.priv=i,t},createRequest:function(n,t,i){i=OpenLayers.Protocol.Script.register(i);var r=OpenLayers.String.format(this.callbackTemplate,{id:i});return t=OpenLayers.Util.extend({},t),t[this.callbackKey]=this.callbackPrefix+r,n=OpenLayers.Util.urlAppend(n,OpenLayers.Util.getParameterString(t)),t=document.createElement("script"),t.type="text/javascript",t.src=n,t.id="OpenLayers_Protocol_Script_"+i,this.pendingRequests[t.id]=t,document.getElementsByTagName("head")[0].appendChild(t),t},destroyRequest:function(n){OpenLayers.Protocol.Script.unregister(n.id.split("_").pop()),delete this.pendingRequests[n.id],n.parentNode&&n.parentNode.removeChild(n)},handleRead:function(n,t){this.handleResponse(n,t)},handleResponse:function(n,t){t.callback&&(n.data?(n.features=this.parseFeatures(n.data),n.code=OpenLayers.Protocol.Response.SUCCESS):n.code=OpenLayers.Protocol.Response.FAILURE,this.destroyRequest(n.priv),t.callback.call(t.scope,n))},parseFeatures:function(n){return this.format.read(n)},abort:function(n){if(n)this.destroyRequest(n.priv);else for(var t in this.pendingRequests)this.destroyRequest(this.pendingRequests[t])},destroy:function(){this.abort(),delete this.params,delete this.format,OpenLayers.Protocol.prototype.destroy.apply(this)},CLASS_NAME:"OpenLayers.Protocol.Script"}),function(){var n=OpenLayers.Protocol.Script,t=0;n.registry={},n.register=function(i){var r="c"+ ++t;return n.registry[r]=function(){i.apply(this,arguments)},r},n.unregister=function(t){delete n.registry[t]}}(),OpenLayers.Control.TransformFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,layer:null,preserveAspectRatio:!1,rotate:!0,feature:null,renderIntent:"temporary",rotationHandleSymbolizer:null,box:null,center:null,scale:1,ratio:1,rotation:0,handles:null,rotationHandles:null,dragControl:null,irregular:!1,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.layer=n,this.rotationHandleSymbolizer||(this.rotationHandleSymbolizer={stroke:!1,pointRadius:10,fillOpacity:0,cursor:"pointer"}),this.createBox(),this.createControl()},activate:function(){var n=!1;return OpenLayers.Control.prototype.activate.apply(this,arguments)&&(this.dragControl.activate(),this.layer.addFeatures([this.box]),this.rotate&&this.layer.addFeatures(this.rotationHandles),this.layer.addFeatures(this.handles),n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.layer.removeFeatures(this.handles),this.rotate&&this.layer.removeFeatures(this.rotationHandles),this.layer.removeFeatures([this.box]),this.dragControl.deactivate(),n=!0),n},setMap:function(n){this.dragControl.setMap(n),OpenLayers.Control.prototype.setMap.apply(this,arguments)},setFeature:function(n,t){var i,u,r;t=OpenLayers.Util.applyDefaults(t,{rotation:0,scale:1,ratio:1}),i=this.rotation,u=this.center,OpenLayers.Util.extend(this,t),!1!==this.events.triggerEvent("beforesetfeature",{feature:n})&&(this.feature=n,this.activate(),this._setfeature=!0,r=this.feature.geometry.getBounds(),this.box.move(r.getCenterLonLat()),this.box.geometry.rotate(-i,u),this._angle=0,this.rotation?(i=n.geometry.clone(),i.rotate(-this.rotation,this.center),i=new OpenLayers.Feature.Vector(i.getBounds().toGeometry()),i.geometry.rotate(this.rotation,this.center),this.box.geometry.rotate(this.rotation,this.center),this.box.move(i.geometry.getBounds().getCenterLonLat()),i=i.geometry.components[0].components[0].getBounds().getCenterLonLat()):i=new OpenLayers.LonLat(r.left,r.bottom),this.handles[0].move(i),delete this._setfeature,this.events.triggerEvent("setfeature",{feature:n}))},unsetFeature:function(){this.active?this.deactivate():(this.feature=null,this.rotation=0,this.ratio=this.scale=1)},createBox:function(){var n=this;this.center=new OpenLayers.Geometry.Point(0,0),this.box=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(-1,-1),new OpenLayers.Geometry.Point(0,-1),new OpenLayers.Geometry.Point(1,-1),new OpenLayers.Geometry.Point(1,0),new OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(0,1),new OpenLayers.Geometry.Point(-1,1),new OpenLayers.Geometry.Point(-1,0),new OpenLayers.Geometry.Point(-1,-1)]),null,"string"==typeof this.renderIntent?null:this.renderIntent),this.box.geometry.move=function(t,i){n._moving=!0,OpenLayers.Geometry.LineString.prototype.move.apply(this,arguments),n.center.move(t,i),delete n._moving};for(var s=function(n,t){OpenLayers.Geometry.Point.prototype.move.apply(this,arguments),this._rotationHandle&&this._rotationHandle.geometry.move(n,t),this._handle.geometry.move(n,t)},h=function(n,t,i){OpenLayers.Geometry.Point.prototype.resize.apply(this,arguments),this._rotationHandle&&this._rotationHandle.geometry.resize(n,t,i),this._handle.geometry.resize(n,t,i)},c=function(n,t){OpenLayers.Geometry.Point.prototype.rotate.apply(this,arguments),this._rotationHandle&&this._rotationHandle.geometry.rotate(n,t),this._handle.geometry.rotate(n,t)},l=function(t,i){var s=this.x,h=this.y;if(OpenLayers.Geometry.Point.prototype.move.call(this,t,i),!n._moving){var r=n.dragControl.handlers.drag.evt,l=!(!n._setfeature&&n.preserveAspectRatio)&&!(r&&r.shiftKey),f=new OpenLayers.Geometry.Point(s,h),r=n.center;this.rotate(-n.rotation,r),f.rotate(-n.rotation,r);var e=this.x-r.x,u=this.y-r.y,o=e-(this.x-f.x),c=u-(this.y-f.y);n.irregular&&!n._setfeature&&(e-=(this.x-f.x)/2,u-=(this.y-f.y)/2),this.x=s,this.y=h,f=1,l?(u=1e-5>Math.abs(c)?1:u/c,f=(1e-5>Math.abs(o)?1:e/o)/u):(o=Math.sqrt(o*o+c*c),u=Math.sqrt(e*e+u*u)/o),n._moving=!0,n.box.geometry.rotate(-n.rotation,r),delete n._moving,n.box.geometry.resize(u,r,f),n.box.geometry.rotate(n.rotation,r),n.transformFeature({scale:u,ratio:f}),n.irregular&&!n._setfeature&&(e=r.clone(),e.x+=1e-5>Math.abs(s-r.x)?0:this.x-s,e.y+=1e-5>Math.abs(h-r.y)?0:this.y-h,n.box.geometry.move(this.x-s,this.y-h),n.transformFeature({center:e}))}},a=function(t,i){var r=this.x,s=this.y;if(OpenLayers.Geometry.Point.prototype.move.call(this,t,i),!n._moving){var u=n.dragControl.handlers.drag.evt,u=u&&u.shiftKey?45:1,f=n.center,e=this.x-f.x,o=this.y-f.y;this.x=r,this.y=s,r=Math.atan2(o-i,e-t),r=Math.atan2(o,e)-r,r*=180/Math.PI,n._angle=(n._angle+r)%360,r=n.rotation%u,(Math.abs(n._angle)>=u||0!==r)&&(r=Math.round(n._angle/u)*u-r,n._angle=0,n.box.geometry.rotate(r,f),n.transformFeature({rotation:r}))}},f=Array(8),e=Array(4),t,r,u,o="sw s se e ne n nw w".split(" "),i=0;8>i;++i)t=this.box.geometry.components[i],r=new OpenLayers.Feature.Vector(t.clone(),{role:o[i]+"-resize"},"string"==typeof this.renderIntent?null:this.renderIntent),0==i%2&&(u=new OpenLayers.Feature.Vector(t.clone(),{role:o[i]+"-rotate"},"string"==typeof this.rotationHandleSymbolizer?null:this.rotationHandleSymbolizer),u.geometry.move=a,t._rotationHandle=u,e[i/2]=u),t.move=s,t.resize=h,t.rotate=c,r.geometry.move=l,t._handle=r,f[i]=r;this.rotationHandles=e,this.handles=f},createControl:function(){var n=this;this.dragControl=new OpenLayers.Control.DragFeature(this.layer,{documentDrag:!0,moveFeature:function(){this.feature===n.feature&&(this.feature=n.box),OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,arguments)},onDrag:function(t){t===n.box&&n.transformFeature({center:n.center})},onStart:function(t){var u=!n.geometryTypes||-1!==OpenLayers.Util.indexOf(n.geometryTypes,t.geometry.CLASS_NAME),r=OpenLayers.Util.indexOf(n.handles,t),r=r+OpenLayers.Util.indexOf(n.rotationHandles,t);t!==n.feature&&t!==n.box&&-2==r&&u&&n.setFeature(t)},onComplete:function(){n.events.triggerEvent("transformcomplete",{feature:n.feature})}})},drawHandles:function(){for(var t=this.layer,n=0;8>n;++n)this.rotate&&0==n%2&&t.drawFeature(this.rotationHandles[n/2],this.rotationHandleSymbolizer),t.drawFeature(this.handles[n],this.renderIntent)},transformFeature:function(n){var u;if(!this._setfeature&&(this.scale*=n.scale||1,this.ratio*=n.ratio||1,u=this.rotation,this.rotation=(this.rotation+(n.rotation||0))%360,!1!==this.events.triggerEvent("beforetransform",n))){var t=this.feature,i=t.geometry,r=this.center;i.rotate(-u,r),n.scale||n.ratio?i.resize(n.scale,r,n.ratio):n.center&&t.move(n.center.getBounds().getCenterLonLat()),i.rotate(this.rotation,r),this.layer.drawFeature(t),t.toState(OpenLayers.State.UPDATE),this.events.triggerEvent("transform",n)}this.layer.drawFeature(this.box,this.renderIntent),this.drawHandles()},destroy:function(){for(var n,t=0;8>t;++t)n=this.box.geometry.components[t],n._handle.destroy(),n._handle=null,n._rotationHandle&&n._rotationHandle.destroy(),n._rotationHandle=null;this.rotationHandles=this.rotationHandleSymbolizer=this.handles=this.feature=this.center=null,this.box.destroy(),this.layer=this.box=null,this.dragControl.destroy(),this.dragControl=null,OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.TransformFeature"}),OpenLayers.Layer.ArcGISCache=OpenLayers.Class(OpenLayers.Layer.XYZ,{url:null,tileOrigin:null,tileSize:new OpenLayers.Size(256,256),useArcGISServer:!0,type:"png",useScales:!1,overrideDPI:!1,initialize:function(){var r,s,f,o,u,e;if(OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments),this.resolutions&&(this.serverResolutions=this.resolutions,this.maxExtent=this.getMaxExtentForResolution(this.resolutions[0])),this.layerInfo&&(r=this.layerInfo,f=new OpenLayers.Bounds(r.fullExtent.xmin,r.fullExtent.ymin,r.fullExtent.xmax,r.fullExtent.ymax),this.projection="EPSG:"+r.spatialReference.wkid,this.sphericalMercator=102100==r.spatialReference.wkid,this.units="esriFeet"==r.units?"ft":"m",r.tileInfo)){this.tileSize=new OpenLayers.Size(r.tileInfo.width||r.tileInfo.cols,r.tileInfo.height||r.tileInfo.rows),this.tileOrigin=new OpenLayers.LonLat(r.tileInfo.origin.x,r.tileInfo.origin.y),s=new OpenLayers.Geometry.Point(f.left,f.top),f=new OpenLayers.Geometry.Point(f.right,f.bottom),this.useScales?this.scales=[]:this.resolutions=[],this.lods=[];for(o in r.tileInfo.lods)r.tileInfo.lods.hasOwnProperty(o)&&(u=r.tileInfo.lods[o],this.useScales?this.scales.push(u.scale):this.resolutions.push(u.resolution),e=this.getContainingTileCoords(s,u.resolution),u.startTileCol=e.x,u.startTileRow=e.y,e=this.getContainingTileCoords(f,u.resolution),u.endTileCol=e.x,u.endTileRow=e.y,this.lods.push(u));this.maxExtent=this.calculateMaxExtentWithLOD(this.lods[0]),this.serverResolutions=this.resolutions,this.overrideDPI&&r.tileInfo.dpi&&(OpenLayers.DOTS_PER_INCH=r.tileInfo.dpi)}},getContainingTileCoords:function(n,t){return new OpenLayers.Pixel(Math.max(Math.floor((n.x-this.tileOrigin.lon)/(this.tileSize.w*t)),0),Math.max(Math.floor((this.tileOrigin.lat-n.y)/(this.tileSize.h*t)),0))},calculateMaxExtentWithLOD:function(n){var t=this.tileOrigin.lon+n.startTileCol*this.tileSize.w*n.resolution,i=this.tileOrigin.lat-n.startTileRow*this.tileSize.h*n.resolution;return new OpenLayers.Bounds(t,i-(n.endTileRow-n.startTileRow+1)*this.tileSize.h*n.resolution,t+(n.endTileCol-n.startTileCol+1)*this.tileSize.w*n.resolution,i)},calculateMaxExtentWithExtent:function(n,t){var i=new OpenLayers.Geometry.Point(n.left,n.top),r=new OpenLayers.Geometry.Point(n.right,n.bottom),i=this.getContainingTileCoords(i,t),r=this.getContainingTileCoords(r,t);return this.calculateMaxExtentWithLOD({resolution:t,startTileCol:i.x,startTileRow:i.y,endTileCol:r.x,endTileRow:r.y})},getUpperLeftTileCoord:function(n){var t=new OpenLayers.Geometry.Point(this.maxExtent.left,this.maxExtent.top);return this.getContainingTileCoords(t,n)},getLowerRightTileCoord:function(n){var t=new OpenLayers.Geometry.Point(this.maxExtent.right,this.maxExtent.bottom);return this.getContainingTileCoords(t,n)},getMaxExtentForResolution:function(n){var t=this.getUpperLeftTileCoord(n),i=this.getLowerRightTileCoord(n),r=this.tileOrigin.lon+t.x*this.tileSize.w*n,u=this.tileOrigin.lat-t.y*this.tileSize.h*n;return new OpenLayers.Bounds(r,u-(i.y-t.y+1)*this.tileSize.h*n,r+(i.x-t.x+1)*this.tileSize.w*n,u)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.ArcGISCache(this.name,this.url,this.options)),OpenLayers.Layer.XYZ.prototype.clone.apply(this,[n])},initGriddedTiles:function(){delete this._tileOrigin,OpenLayers.Layer.XYZ.prototype.initGriddedTiles.apply(this,arguments)},getMaxExtent:function(){var n=this.map.getResolution();return this.maxExtent=this.getMaxExtentForResolution(n)},getTileOrigin:function(){if(!this._tileOrigin){var n=this.getMaxExtent();this._tileOrigin=new OpenLayers.LonLat(n.left,n.bottom)}return this._tileOrigin},getURL:function(n){var t=this.getResolution(),i=this.tileOrigin.lon+t*this.tileSize.w/2,r=this.tileOrigin.lat-t*this.tileSize.h/2,u;if(n=n.getCenterLonLat(),i=Math.round(Math.abs((n.lon-i)/(t*this.tileSize.w))),r=Math.round(Math.abs((r-n.lat)/(t*this.tileSize.h))),n=this.map.getZoom(),this.lods){if(t=this.lods[this.map.getZoom()],i<t.startTileCol||i>t.endTileCol||r<t.startTileRow||r>t.endTileRow)return null}else if(u=this.getUpperLeftTileCoord(t),t=this.getLowerRightTileCoord(t),i<u.x||i>=t.x||r<u.y||r>=t.y)return null;return t=this.url,u=""+i+r+n,OpenLayers.Util.isArray(t)&&(t=this.selectUrl(u,t)),this.useArcGISServer?t+="/tile/${z}/${y}/${x}":(i="C"+OpenLayers.Number.zeroPad(i,8,16),r="R"+OpenLayers.Number.zeroPad(r,8,16),n="L"+OpenLayers.Number.zeroPad(n,2,10),t=t+"/${z}/${y}/${x}."+this.type),t=OpenLayers.String.format(t,{x:i,y:r,z:n}),OpenLayers.Util.urlAppend(t,OpenLayers.Util.getParameterString(this.params))},CLASS_NAME:"OpenLayers.Layer.ArcGISCache"}),OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,drillDown:!1,maxFeatures:10,clickCallback:"click",output:"features",layers:null,queryVisible:!1,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handler:null,hoverRequest:null,initialize:function(n){n=n||{},n.handlerOptions=n.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[n]),this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(n.formatOptions)),!0===this.drillDown&&(this.hover=!1),this.hover?this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250})):(n={},n[this.clickCallback]=this.getInfoForClick,this.handler=new OpenLayers.Handler.Click(this,n,this.handlerOptions.click||{}))},getInfoForClick:function(n){this.events.triggerEvent("beforegetfeatureinfo",{xy:n.xy}),OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait"),this.request(n.xy,{})},getInfoForHover:function(n){this.events.triggerEvent("beforegetfeatureinfo",{xy:n.xy}),this.request(n.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var r=this.layers||this.map.layers,u=[],n,t,i=r.length-1;0<=i;--i)n=r[i],n instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||n.getVisibility())&&(t=OpenLayers.Util.isArray(n.url)?n.url[0]:n.url,!1!==this.drillDown||this.url||(this.url=t),(!0===this.drillDown||this.urlMatches(t))&&u.push(n));return u},urlMatches:function(n){var i=OpenLayers.Util.isEquivalentUrl(this.url,n),t,r;if(!i&&this.layerUrls)for(t=0,r=this.layerUrls.length;t<r;++t)if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[t],n)){i=!0;break}return i},buildWMSOptions:function(n,t,i,r){for(var f=[],o=[],u=0,e=t.length;u<e;u++)null!=t[u].params.LAYERS&&(f=f.concat(t[u].params.LAYERS),o=o.concat(this.getStyleNames(t[u])));return t=t[0],u=this.map.getProjection(),(e=t.projection)&&e.equals(this.map.getProjectionObject())&&(u=e.getCode()),r=OpenLayers.Util.extend({service:"WMS",version:t.params.VERSION,request:"GetFeatureInfo",exceptions:t.params.EXCEPTIONS,bbox:this.map.getExtent().toBBOX(null,t.reverseAxisOrder()),feature_count:this.maxFeatures,height:this.map.getSize().h,width:this.map.getSize().w,format:r,info_format:t.params.INFO_FORMAT||this.infoFormat},1.3<=parseFloat(t.params.VERSION)?{crs:u,i:parseInt(i.x),j:parseInt(i.y)}:{srs:u,x:parseInt(i.x),y:parseInt(i.y)}),0!=f.length&&(r=OpenLayers.Util.extend({layers:f,query_layers:f,styles:o},r)),OpenLayers.Util.applyDefaults(r,this.vendorParams),{url:n,params:OpenLayers.Util.upperCaseObject(r),callback:function(t){this.handleResponse(i,t,n)},scope:this}},getStyleNames:function(n){return n.params.STYLES?n.params.STYLES:OpenLayers.Util.isArray(n.params.LAYERS)?Array(n.params.LAYERS.length):n.params.LAYERS.replace(/[^,]/g,"")},request:function(n,t){var i=this.findLayers(),r,f;if(0==i.length)this.events.triggerEvent("nogetfeatureinfo"),OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait");else if(t=t||{},!1===this.drillDown)i=this.buildWMSOptions(this.url,i,n,i[0].params.FORMAT),r=OpenLayers.Request.GET(i),!0===t.hover&&(this.hoverRequest=r);else{this._numRequests=this._requestCount=0,this.features=[];for(var r={},u,e=0,o=i.length;e<o;e++)f=i[e],u=OpenLayers.Util.isArray(f.url)?f.url[0]:f.url,u in r?r[u].push(f):(this._numRequests++,r[u]=[f]);for(u in r)i=r[u],i=this.buildWMSOptions(u,i,n,i[0].params.FORMAT),OpenLayers.Request.GET(i)}},triggerGetFeatureInfo:function(n,t,i){this.events.triggerEvent("getfeatureinfo",{text:n.responseText,features:i,request:n,xy:t}),OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},handleResponse:function(n,t,i){var r=t.responseXML;r&&r.documentElement||(r=t.responseText),r=this.format.read(r),!1===this.drillDown?this.triggerGetFeatureInfo(t,n,r):(this._requestCount++,this._features="object"===this.output?(this._features||[]).concat({url:i,features:r}):(this._features||[]).concat(r),this._requestCount===this._numRequests&&(this.triggerGetFeatureInfo(t,n,this._features.concat()),delete this._features,delete this._requestCount,delete this._numRequests))},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"}),OpenLayers.Format.WMSCapabilities.v1_3_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_3,{version:"1.3.0",CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3_0"}),OpenLayers.Format.WFS=OpenLayers.Class(OpenLayers.Format.GML,{layer:null,wfsns:"http://www.opengis.net/wfs",ogcns:"http://www.opengis.net/ogc",initialize:function(n,t){OpenLayers.Format.GML.prototype.initialize.apply(this,[n]),this.layer=t,this.layer.featureNS&&(this.featureNS=this.layer.featureNS),this.layer.options.geometry_column&&(this.geometryName=this.layer.options.geometry_column),this.layer.options.typename&&(this.featureName=this.layer.options.typename)},write:function(n){var i=this.createElementNS(this.wfsns,"wfs:Transaction"),t;for(i.setAttribute("version","1.0.0"),i.setAttribute("service","WFS"),t=0;t<n.length;t++)switch(n[t].state){case OpenLayers.State.INSERT:i.appendChild(this.insert(n[t]));break;case OpenLayers.State.UPDATE:i.appendChild(this.update(n[t]));break;case OpenLayers.State.DELETE:i.appendChild(this.remove(n[t]))}return OpenLayers.Format.XML.prototype.write.apply(this,[i])},createFeatureXML:function(n){var i=this.buildGeometryNode(n.geometry),u=this.createElementNS(this.featureNS,"feature:"+this.geometryName),r,t;u.appendChild(i),i=this.createElementNS(this.featureNS,"feature:"+this.featureName),i.appendChild(u);for(r in n.attributes)u=this.createTextNode(n.attributes[r]),t=r,-1!=r.search(":")&&(t=r.split(":")[1]),t=this.createElementNS(this.featureNS,"feature:"+t),t.appendChild(u),i.appendChild(t);return i},insert:function(n){var t=this.createElementNS(this.wfsns,"wfs:Insert");return t.appendChild(this.createFeatureXML(n)),t},update:function(n){var r,u;n.fid||OpenLayers.Console.userError(OpenLayers.i18n("noFID")),r=this.createElementNS(this.wfsns,"wfs:Update"),r.setAttribute("typeName",this.featurePrefix+":"+this.featureName),r.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var i=this.createElementNS(this.wfsns,"wfs:Property"),t=this.createElementNS(this.wfsns,"wfs:Name"),f=this.createTextNode(this.geometryName);t.appendChild(f),i.appendChild(t),t=this.createElementNS(this.wfsns,"wfs:Value"),f=this.buildGeometryNode(n.geometry),n.layer&&f.setAttribute("srsName",n.layer.projection.getCode()),t.appendChild(f),i.appendChild(t),r.appendChild(i);for(u in n.attributes)i=this.createElementNS(this.wfsns,"wfs:Property"),t=this.createElementNS(this.wfsns,"wfs:Name"),t.appendChild(this.createTextNode(u)),i.appendChild(t),t=this.createElementNS(this.wfsns,"wfs:Value"),t.appendChild(this.createTextNode(n.attributes[u])),i.appendChild(t),r.appendChild(i);return i=this.createElementNS(this.ogcns,"ogc:Filter"),u=this.createElementNS(this.ogcns,"ogc:FeatureId"),u.setAttribute("fid",n.fid),i.appendChild(u),r.appendChild(i),r},remove:function(n){var t,i,r;return n.fid?(t=this.createElementNS(this.wfsns,"wfs:Delete"),t.setAttribute("typeName",this.featurePrefix+":"+this.featureName),t.setAttribute("xmlns:"+this.featurePrefix,this.featureNS),i=this.createElementNS(this.ogcns,"ogc:Filter"),r=this.createElementNS(this.ogcns,"ogc:FeatureId"),r.setAttribute("fid",n.fid),i.appendChild(r),t.appendChild(i),t):(OpenLayers.Console.userError(OpenLayers.i18n("noFID")),!1)},destroy:function(){this.layer=null},CLASS_NAME:"OpenLayers.Format.WFS"}),OpenLayers.Control.UTFGrid=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,layers:null,defaultHandlerOptions:{delay:300,pixelTolerance:4,stopMove:!1,single:!0,double:!1,stopSingle:!1,stopDouble:!1},handlerMode:"click",setHandler:function(n){this.handlerMode=n,this.resetHandler()},resetHandler:function(){return this.handler&&(this.handler.deactivate(),this.handler.destroy(),this.handler=null),"hover"==this.handlerMode?this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.reset},this.handlerOptions):"click"==this.handlerMode?this.handler=new OpenLayers.Handler.Click(this,{click:this.handleEvent},this.handlerOptions):"move"==this.handlerMode&&(this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.handleEvent},this.handlerOptions)),this.handler?!0:!1},initialize:function(n){n=n||{},n.handlerOptions=n.handlerOptions||this.defaultHandlerOptions,OpenLayers.Control.prototype.initialize.apply(this,[n]),this.resetHandler()},handleEvent:function(n){var t,i;if(null==n)this.reset();else if(t=this.map.getLonLatFromPixel(n.xy),t&&(i=this.findLayers(),0<i.length)){for(var f={},r,e,u=0,o=i.length;u<o;u++)r=i[u],e=OpenLayers.Util.indexOf(this.map.layers,r),f[e]=r.getFeatureInfo(t);this.callback(f,t,n.xy)}},callback:function(){},reset:function(){this.callback(null)},findLayers:function(){for(var i=this.layers||this.map.layers,r=[],n,t=i.length-1;0<=t;--t)n=i[t],n instanceof OpenLayers.Layer.UTFGrid&&r.push(n);return r},CLASS_NAME:"OpenLayers.Control.UTFGrid"}),OpenLayers.Format.CQL=function(){function o(n){function r(){var u=f.pop(),n,e;switch(u.type){case"LOGICAL":return n=r(),e=r(),new OpenLayers.Filter.Logical({filters:[e,n],type:i[u.text.toUpperCase()]});case"NOT":return u=r(),new OpenLayers.Filter.Logical({filters:[u],type:OpenLayers.Filter.Logical.NOT});case"BETWEEN":return f.pop(),e=r(),u=r(),n=r(),new OpenLayers.Filter.Comparison({property:n,lowerBoundary:u,upperBoundary:e,type:OpenLayers.Filter.Comparison.BETWEEN});case"COMPARISON":return e=r(),n=r(),new OpenLayers.Filter.Comparison({property:n,value:e,type:t[u.text.toUpperCase()]});case"IS_NULL":return n=r(),new OpenLayers.Filter.Comparison({property:n,type:t[u.text.toUpperCase()]});case"VALUE":return(n=u.text.match(/^'(.*)'$/))?n[1].replace(/''/g,"'"):Number(u.text);case"SPATIAL":switch(u.text.toUpperCase()){case"BBOX":var u=r(),n=r(),e=r(),o=r(),s=r();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:s,value:OpenLayers.Bounds.fromArray([o,e,n,u])});case"INTERSECTS":return e=r(),n=r(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n,value:e});case"WITHIN":return e=r(),n=r(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.WITHIN,property:n,value:e});case"CONTAINS":return e=r(),n=r(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.CONTAINS,property:n,value:e});case"DWITHIN":return u=r(),e=r(),n=r(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,value:e,property:n,distance:Number(u)})}case"GEOMETRY":return OpenLayers.Geometry.fromWKT(u.text);default:return u.text}}for(var o,s,u=[],f=[];n.length;){o=n.shift();switch(o.type){case"PROPERTY":case"GEOMETRY":case"VALUE":f.push(o);break;case"COMPARISON":case"BETWEEN":case"IS_NULL":case"LOGICAL":for(s=e[o.type];0<u.length&&e[u[u.length-1].type]<=s;)f.push(u.pop());u.push(o);break;case"SPATIAL":case"NOT":case"LPAREN":u.push(o);break;case"RPAREN":for(;0<u.length&&"LPAREN"!=u[u.length-1].type;)f.push(u.pop());u.pop(),0<u.length&&"SPATIAL"==u[u.length-1].type&&f.push(u.pop());case"COMMA":case"END":break;default:throw Error("Unknown token type "+o.type);}}for(;0<u.length;)f.push(u.pop());if(n=r(),0<f.length){for(n="Remaining tokens after building AST: \n",u=f.length-1;0<=u;u--)n+=f[u].type+": "+f[u].text+"\n";throw Error(n);}return n}var u={PROPERTY:/^[_a-zA-Z]\w*/,COMPARISON:/^(=|<>|<=|<|>=|>|LIKE)/i,IS_NULL:/^IS NULL/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('([^']|'')*'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/,RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(n){var t=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(n),r,i;if(t){if(r=n.length,t=n.indexOf("(",t[0].length),-1<t)for(i=1;t<r&&0<i;)switch(t++,n.charAt(t)){case"(":i++;break;case")":i--}return[n.substr(0,t+1)]}},END:/^$/},s={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON","BETWEEN","COMMA","IS_NULL"],BETWEEN:["VALUE"],IS_NULL:["END"],COMPARISON:["VALUE"],COMMA:["GEOMETRY","VALUE","PROPERTY"],VALUE:["LOGICAL","COMMA","RPAREN","END"],SPATIAL:["LPAREN"],LOGICAL:["NOT","VALUE","SPATIAL","PROPERTY","LPAREN"],NOT:["PROPERTY","LPAREN"],GEOMETRY:["COMMA","RPAREN"]},t={"=":OpenLayers.Filter.Comparison.EQUAL_TO,"<>":OpenLayers.Filter.Comparison.NOT_EQUAL_TO,"<":OpenLayers.Filter.Comparison.LESS_THAN,"<=":OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,">":OpenLayers.Filter.Comparison.GREATER_THAN,">=":OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,LIKE:OpenLayers.Filter.Comparison.LIKE,BETWEEN:OpenLayers.Filter.Comparison.BETWEEN,"IS NULL":OpenLayers.Filter.Comparison.IS_NULL},r={},i={AND:OpenLayers.Filter.Logical.AND,OR:OpenLayers.Filter.Logical.OR},f={},e={RPAREN:3,LOGICAL:2,COMPARISON:1},n;for(n in t)t.hasOwnProperty(n)&&(r[t[n]]=n);for(n in i)i.hasOwnProperty(n)&&(f[i[n]]=n);return OpenLayers.Class(OpenLayers.Format,{read:function(n){var f=n,t,i,e,h;n=[],i=["NOT","GEOMETRY","SPATIAL","PROPERTY","LPAREN"];do{n:{t=i;for(var r=void 0,i=void 0,c=t.length,r=0;r<c;r++)if(i=t[r],e=f,h=u[i],e=h instanceof RegExp?h.exec(e):h(e)){t=e[0],f=f.substr(t.length).replace(/^\s*/,""),t={type:i,text:t,remainder:f};break n}for(n="ERROR: In parsing: ["+f+"], expected one of: ",r=0;r<c;r++)i=t[r],n+="\n    "+i+": "+u[i];throw Error(n);}if(f=t.remainder,i=s[t.type],"END"!=t.type&&!i)throw Error("No follows list for "+t.type);n.push(t)}while("END"!=t.type);return n=o(n),this.keepData&&(this.data=n),n},write:function(n){if(n instanceof OpenLayers.Geometry)return n.toString();switch(n.CLASS_NAME){case"OpenLayers.Filter.Spatial":switch(n.type){case OpenLayers.Filter.Spatial.BBOX:return"BBOX("+n.property+","+n.value.toBBOX()+")";case OpenLayers.Filter.Spatial.DWITHIN:return"DWITHIN("+n.property+", "+this.write(n.value)+", "+n.distance+")";case OpenLayers.Filter.Spatial.WITHIN:return"WITHIN("+n.property+", "+this.write(n.value)+")";case OpenLayers.Filter.Spatial.INTERSECTS:return"INTERSECTS("+n.property+", "+this.write(n.value)+")";case OpenLayers.Filter.Spatial.CONTAINS:return"CONTAINS("+n.property+", "+this.write(n.value)+")";default:throw Error("Unknown spatial filter type: "+n.type);}case"OpenLayers.Filter.Logical":if(n.type==OpenLayers.Filter.Logical.NOT)return"NOT ("+this.write(n.filters[0])+")";for(var t="(",u=!0,i=0;i<n.filters.length;i++)u?u=!1:t+=") "+f[n.type]+" (",t+=this.write(n.filters[i]);return t+")";case"OpenLayers.Filter.Comparison":return n.type==OpenLayers.Filter.Comparison.BETWEEN?n.property+" BETWEEN "+this.write(n.lowerBoundary)+" AND "+this.write(n.upperBoundary):null!==n.value?n.property+" "+r[n.type]+" "+this.write(n.value):n.property+" "+r[n.type];case void 0:if("string"==typeof n)return"'"+n.replace(/'/g,"''")+"'";if("number"==typeof n)return String(n);default:throw Error("Can't encode: "+n.CLASS_NAME+" "+n);}},CLASS_NAME:"OpenLayers.Format.CQL"})}(),OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{layer:null,source:null,sourceOptions:null,tolerance:null,edge:!0,deferDelete:!1,mutual:!0,targetFilter:null,sourceFilter:null,handler:null,initialize:function(n){OpenLayers.Control.prototype.initialize.apply(this,[n]),this.options=n||{},this.options.source&&this.setSource(this.options.source)},setSource:function(n){this.active?(this.deactivate(),this.handler&&(this.handler.destroy(),delete this.handler),this.source=n,this.activate()):this.source=n},activate:function(){var n=OpenLayers.Control.prototype.activate.call(this);if(n)if(this.source){if(this.source.events)this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}else this.handler||(this.handler=new OpenLayers.Handler.Path(this,{done:function(n){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(n)})}},{layerOptions:this.sourceOptions})),this.handler.activate();return n},deactivate:function(){var n=OpenLayers.Control.prototype.deactivate.call(this);return n&&this.source&&this.source.events&&this.source.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this}),n},onSketchComplete:function(n){return this.feature=null,!this.considerSplit(n.feature)},afterFeatureModified:function(n){n.modified&&"function"==typeof n.feature.geometry.split&&(this.feature=n.feature,this.considerSplit(n.feature))},removeByGeometry:function(n,t){for(var i=0,r=n.length;i<r;++i)if(n[i].geometry===t){n.splice(i,1);break}},isEligible:function(n){return n.geometry?n.state!==OpenLayers.State.DELETE&&"function"==typeof n.geometry.split&&this.feature!==n&&(!this.targetFilter||this.targetFilter.evaluate(n.attributes)):!1},considerSplit:function(n){var y=!1,f=!1,h,c;if(!this.sourceFilter||this.sourceFilter.evaluate(n.attributes)){for(var l=this.layer&&this.layer.features||[],t,e,s=[],a=[],w=this.layer===this.source&&this.mutual,b={edge:this.edge,tolerance:this.tolerance,mutual:w},u=[n.geometry],o,r,p,i=0,v=l.length;i<v;++i)if(o=l[i],this.isEligible(o)){for(r=[o.geometry],h=0;h<u.length;++h)for(p=u[h],c=0;c<r.length;++c)(t=r[c],p.getBounds().intersectsBounds(t.getBounds())&&(t=p.split(t,b)))&&(e=this.events.triggerEvent("beforesplit",{source:n,target:o}),!1!==e&&(w&&(e=t[0],1<e.length&&(e.unshift(h,1),Array.prototype.splice.apply(u,e),h+=e.length-3),t=t[1]),1<t.length&&(t.unshift(c,1),Array.prototype.splice.apply(r,t),c+=t.length-3)));r&&1<r.length&&(this.geomsToFeatures(o,r),this.events.triggerEvent("split",{original:o,features:r}),Array.prototype.push.apply(s,r),a.push(o),f=!0)}if(u&&1<u.length&&(this.geomsToFeatures(n,u),this.events.triggerEvent("split",{original:n,features:u}),Array.prototype.push.apply(s,u),a.push(n),y=!0),y||f){if(this.deferDelete){for(l=[],i=0,v=a.length;i<v;++i)f=a[i],f.state===OpenLayers.State.INSERT?l.push(f):(f.state=OpenLayers.State.DELETE,this.layer.drawFeature(f));for(this.layer.destroyFeatures(l,{silent:!0}),i=0,v=s.length;i<v;++i)s[i].state=OpenLayers.State.INSERT}else this.layer.destroyFeatures(a,{silent:!0});this.layer.addFeatures(s,{silent:!0}),this.events.triggerEvent("aftersplit",{source:n,features:s})}}return y},geomsToFeatures:function(n,t){var u=n.clone(),r,i,f;for(delete u.geometry,i=0,f=t.length;i<f;++i)r=u.clone(),r.geometry=t[i],r.state=OpenLayers.State.INSERT,t[i]=r},destroy:function(){this.active&&this.deactivate(),OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"}),OpenLayers.Protocol.SOS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol,{fois:null,formatOptions:null,initialize:function(n){OpenLayers.Protocol.prototype.initialize.apply(this,[n]),n.format||(this.format=new OpenLayers.Format.SOSGetFeatureOfInterest(this.formatOptions))},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(n){n=OpenLayers.Util.extend({},n),OpenLayers.Util.applyDefaults(n,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.format,i=OpenLayers.Format.XML.prototype.write.apply(i,[i.writeNode("sos:GetFeatureOfInterest",{fois:this.fois})]);return t.priv=OpenLayers.Request.POST({url:n.url,callback:this.createCallback(this.handleRead,t,n),data:i}),t},handleRead:function(n,t){if(t.callback){var i=n.priv;200<=i.status&&300>i.status?(n.features=this.parseFeatures(i),n.code=OpenLayers.Protocol.Response.SUCCESS):n.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,n)}},parseFeatures:function(n){var t=n.responseXML;return t&&t.documentElement||(t=n.responseText),!t||0>=t.length?null:this.format.read(t)},CLASS_NAME:"OpenLayers.Protocol.SOS.v1_0_0"}),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(){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments),this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||this.DEFAULT_FORMAT]},getURL:function(n){n=this.adjustBounds(n);var i=this.map.getResolution(),r=Math.round(1e4*this.map.getScale())/1e4,t=Math.round(n.left/i);n=-Math.round(n.top/i);var i=Math.floor(t/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w,u=Math.floor(n/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h,r=["/",this.params.map,"/",r,"/",this.params.g.replace(/\s/g,"_"),"/def/t",u,"/l",i,"/t",n,"l",t,".",this.extension],t=this.url;return OpenLayers.Util.isArray(t)&&(t=this.selectUrl(r.join(""),t)),t+r.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"}),OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,format:"image/png",serverResolutions:null,initialize:function(n,t,i,r){this.layername=i,OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n,t,{},r]),this.extension=this.format.split("/")[1].toLowerCase(),this.extension="jpg"==this.extension?"jpeg":this.extension},clone:function(n){return null==n&&(n=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){var t=this.getServerResolution(),r=this.maxExtent,u=this.tileSize,i=Math.round((n.left-r.left)/(t*u.w));return n=Math.round((n.bottom-r.bottom)/(t*u.h)),t=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,t):this.map.getZoom(),i=[this.layername,OpenLayers.Number.zeroPad(t,2),OpenLayers.Number.zeroPad(parseInt(i/1e6),3),OpenLayers.Number.zeroPad(parseInt(i/1e3)%1e3,3),OpenLayers.Number.zeroPad(parseInt(i)%1e3,3),OpenLayers.Number.zeroPad(parseInt(n/1e6),3),OpenLayers.Number.zeroPad(parseInt(n/1e3)%1e3,3),OpenLayers.Number.zeroPad(parseInt(n)%1e3,3)+"."+this.extension].join("/"),t=this.url,OpenLayers.Util.isArray(t)&&(t=this.selectUrl(i,t)),t="/"==t.charAt(t.length-1)?t:t+"/",t+i},CLASS_NAME:"OpenLayers.Layer.TileCache"}),OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.1",readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(n,t){t.srs[this.getChildValue(n)]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1"}),OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1_1,{version:"1.1.1",profile:"WMSC",readers:{wms:OpenLayers.Util.applyDefaults({VendorSpecificCapabilities:function(n,t){t.vendorSpecific={tileSets:[]},this.readChildNodes(n,t.vendorSpecific)},TileSet:function(n,t){var i={srs:{},bbox:{},resolutions:[]};this.readChildNodes(n,i),t.tileSets.push(i)},Resolutions:function(n,t){for(var r=this.getChildValue(n).split(" "),i=0,u=r.length;i<u;i++)""!=r[i]&&t.resolutions.push(parseFloat(r[i]))},Width:function(n,t){t.width=parseInt(this.getChildValue(n))},Height:function(n,t){t.height=parseInt(this.getChildValue(n))},Layers:function(n,t){t.layers=this.getChildValue(n)},Styles:function(n,t){t.styles=this.getChildValue(n)}},OpenLayers.Format.WMSCapabilities.v1_1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC"}),OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:!0,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments),this.layerStates=[]},destroy:function(){this.clearLayersArray("base"),this.clearLayersArray("data"),this.map.events.un({buttonclick:this.onButtonClick,addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this}),this.events.unregister("buttonclick",this,this.onButtonClick),OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(){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});this.outsideViewport?(this.events.attachToElement(this.div),this.events.register("buttonclick",this,this.onButtonClick)):this.map.events.register("buttonclick",this,this.onButtonClick)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this),this.loadContents(),this.outsideViewport||this.minimizeControl(),this.redraw(),this.div},onButtonClick:function(n){n=n.buttonElement,n===this.minimizeDiv?this.minimizeControl():n===this.maximizeDiv?this.maximizeControl():n._layerSwitcher===this.id&&(n["for"]&&(n=document.getElementById(n["for"])),n.disabled||("radio"==n.type?(n.checked=!0,this.map.setBaseLayer(this.map.getLayer(n._layer))):(n.checked=!n.checked,this.updateMap())))},clearLayersArray:function(n){this[n+"LayersDiv"].innerHTML="",this[n+"Layers"]=[]},checkRedraw:function(){var n,r,t,i;if(!this.layerStates.length||this.map.layers.length!=this.layerStates.length)return!0;for(n=0,r=this.layerStates.length;n<r;n++)if(t=this.layerStates[n],i=this.map.layers[n],t.name!=i.name||t.inRange!=i.inRange||t.id!=i.id||t.visibility!=i.visibility)return!0;return!1},redraw:function(){var u,e,n,r;if(!this.checkRedraw())return this.div;this.clearLayersArray("base"),this.clearLayersArray("data");var s=!1,h=!1,f=this.map.layers.length;for(this.layerStates=Array(f),u=0;u<f;u++)n=this.map.layers[u],this.layerStates[u]={name:n.name,visibility:n.visibility,inRange:n.inRange,id:n.id};for(e=this.map.layers.slice(),this.ascending||e.reverse(),u=0,f=e.length;u<f;u++)if(n=e[u],r=n.isBaseLayer,n.displayInLayerSwitcher){r?h=!0:s=!0;var i=r?n==this.map.baseLayer:n.getVisibility(),t=document.createElement("input"),o=OpenLayers.Util.createUniqueID(this.id+"_input_");t.id=o,t.name=r?this.id+"_baseLayers":n.name,t.type=r?"radio":"checkbox",t.value=n.name,t.checked=i,t.defaultChecked=i,t.className="olButton",t._layer=n.id,t._layerSwitcher=this.id,r||n.inRange||(t.disabled=!0),i=document.createElement("label"),i["for"]=t.id,OpenLayers.Element.addClass(i,"labelSpan olButton"),i._layer=n.id,i._layerSwitcher=this.id,r||n.inRange||(i.style.color="gray"),i.innerHTML=n.name,i.style.verticalAlign=r?"bottom":"baseline",o=document.createElement("br"),(r?this.baseLayers:this.dataLayers).push({layer:n,inputElem:t,labelSpan:i}),n=r?this.baseLayersDiv:this.dataLayersDiv,n.appendChild(t),n.appendChild(i),n.appendChild(o)}return this.dataLbl.style.display=s?"":"none",this.baseLbl.style.display=h?"":"none",this.div},updateMap:function(){for(var t,n=0,i=this.baseLayers.length;n<i;n++)t=this.baseLayers[n],t.inputElem.checked&&this.map.setBaseLayer(t.layer,!1);for(n=0,i=this.dataLayers.length;n<i;n++)t=this.dataLayers[n],t.layer.setVisibility(t.inputElem.checked)},maximizeControl:function(n){this.div.style.width="",this.div.style.height="",this.showControls(!1),null!=n&&OpenLayers.Event.stop(n)},minimizeControl:function(n){this.div.style.width="0px",this.div.style.height="0px",this.showControls(!0),null!=n&&OpenLayers.Event.stop(n)},showControls:function(n){this.maximizeDiv.style.display=n?"":"none",this.minimizeDiv.style.display=n?"none":"",this.layersDiv.style.display=n?"none":""},loadContents:function(){this.layersDiv=document.createElement("div"),this.layersDiv.id=this.id+"_layersDiv",OpenLayers.Element.addClass(this.layersDiv,"layersDiv"),this.baseLbl=document.createElement("div"),this.baseLbl.innerHTML=OpenLayers.i18n("Base Layer"),OpenLayers.Element.addClass(this.baseLbl,"baseLbl"),this.baseLayersDiv=document.createElement("div"),OpenLayers.Element.addClass(this.baseLayersDiv,"baseLayersDiv"),this.dataLbl=document.createElement("div"),this.dataLbl.innerHTML=OpenLayers.i18n("Overlays"),OpenLayers.Element.addClass(this.dataLbl,"dataLbl"),this.dataLayersDiv=document.createElement("div"),OpenLayers.Element.addClass(this.dataLayersDiv,"dataLayersDiv"),this.ascending?(this.layersDiv.appendChild(this.baseLbl),this.layersDiv.appendChild(this.baseLayersDiv),this.layersDiv.appendChild(this.dataLbl),this.layersDiv.appendChild(this.dataLayersDiv)):(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);var n=OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,null,n,"absolute"),OpenLayers.Element.addClass(this.maximizeDiv,"maximizeDiv olButton"),this.maximizeDiv.style.display="none",this.div.appendChild(this.maximizeDiv),n=OpenLayers.Util.getImageLocation("layer-switcher-minimize.png"),this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,null,n,"absolute"),OpenLayers.Element.addClass(this.minimizeDiv,"minimizeDiv olButton"),this.minimizeDiv.style.display="none",this.div.appendChild(this.minimizeDiv)},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"}),OpenLayers.Tile.Image.IFrame={useIFrame:null,blankImageUrl:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAQAIBRAA7",draw:function(){if(OpenLayers.Tile.Image.prototype.shouldDraw.call(this)){var n=this.layer.getURL(this.bounds),t=this.useIFrame;this.useIFrame=null!==this.maxGetUrlLength&&!this.layer.async&&n.length>this.maxGetUrlLength,n=t&&!this.useIFrame,t=!t&&this.useIFrame,(n||t)&&(this.imgDiv&&this.imgDiv.parentNode===this.frame&&this.frame.removeChild(this.imgDiv),this.imgDiv=null,n&&this.frame.removeChild(this.frame.firstChild))}return OpenLayers.Tile.Image.prototype.draw.apply(this,arguments)},getImage:function(){if(!0===this.useIFrame){if(!this.frame.childNodes.length){var t=document.createElement("div"),n=t.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex=1,n.backgroundImage="url("+this.blankImageUrl+")",this.frame.appendChild(t)}return t=this.id+"_iFrame",9>parseFloat(navigator.appVersion.split("MSIE")[1])?(n=document.createElement('<iframe name="'+t+'">'),n.style.backgroundColor="#FFFFFF",n.style.filter="chroma(color=#FFFFFF)"):(n=document.createElement("iframe"),n.style.backgroundColor="transparent",n.name=t),n.scrolling="no",n.marginWidth="0px",n.marginHeight="0px",n.frameBorder="0",n.style.position="absolute",n.style.width="100%",n.style.height="100%",1>this.layer.opacity&&OpenLayers.Util.modifyDOMElement(n,null,null,null,null,null,null,this.layer.opacity),this.frame.appendChild(n),this.imgDiv=n}return OpenLayers.Tile.Image.prototype.getImage.apply(this,arguments)},createRequestForm:function(){var t=document.createElement("form"),n,i,r;t.method="POST",n=this.layer.params._OLSALT,n=(n?n+"_":"")+this.bounds.toBBOX(),t.action=OpenLayers.Util.urlAppend(this.layer.url,n),t.target=this.id+"_iFrame",this.layer.getImageSize(),n=OpenLayers.Util.getParameters(this.url);for(r in n)i=document.createElement("input"),i.type="hidden",i.name=r,i.value=n[r],t.appendChild(i);return t},setImgSrc:function(n){if(!0===this.useIFrame)if(n){var t=this.createRequestForm();this.frame.appendChild(t),t.submit(),this.frame.removeChild(t)}else this.imgDiv.parentNode===this.frame&&(this.frame.removeChild(this.imgDiv),this.imgDiv=null);else OpenLayers.Tile.Image.prototype.setImgSrc.apply(this,arguments)},onImageLoad:function(){OpenLayers.Tile.Image.prototype.onImageLoad.apply(this,arguments),!0===this.useIFrame&&(this.imgDiv.style.opacity=1,this.frame.style.opacity=this.layer.opacity)},createBackBuffer:function(){var n;return!1===this.useIFrame&&(n=OpenLayers.Tile.Image.prototype.createBackBuffer.call(this)),n}},OpenLayers.Format.Atom=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{atom:"http://www.w3.org/2005/Atom",georss:"http://www.georss.org/georss"},feedTitle:"untitled",defaultEntryTitle:"untitled",gmlParser:null,xy:!1,read:function(n){return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),this.parseFeatures(n)},write:function(n){var t,i,r;if(OpenLayers.Util.isArray(n))for(t=this.createElementNSPlus("atom:feed"),t.appendChild(this.createElementNSPlus("atom:title",{value:this.feedTitle})),i=0,r=n.length;i<r;i++)t.appendChild(this.buildEntryNode(n[i]));else t=this.buildEntryNode(n);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},buildContentNode:function(n){var t=this.createElementNSPlus("atom:content",{attributes:{type:n.type||null}});if(n.src)t.setAttribute("src",n.src);else if("text"==n.type||null==n.type)t.appendChild(this.createTextNode(n.value));else if("html"==n.type){if("string"!=typeof n.value)throw"HTML content must be in form of an escaped string";t.appendChild(this.createTextNode(n.value))}else"xhtml"==n.type?t.appendChild(n.value):"xhtml"==n.type||n.type.match(/(\+|\/)xml$/)?t.appendChild(n.value):t.appendChild(this.createTextNode(n.value));return t},buildEntryNode:function(n){var e=n.attributes,t=e.atom||{},r=this.createElementNSPlus("atom:entry");if(t.authors)for(var f=OpenLayers.Util.isArray(t.authors)?t.authors:[t.authors],i=0,o=f.length;i<o;i++)r.appendChild(this.buildPersonConstructNode("author",f[i]));if(t.categories)for(var f=OpenLayers.Util.isArray(t.categories)?t.categories:[t.categories],u,i=0,o=f.length;i<o;i++)u=f[i],r.appendChild(this.createElementNSPlus("atom:category",{attributes:{term:u.term,scheme:u.scheme||null,label:u.label||null}}));if(t.content&&r.appendChild(this.buildContentNode(t.content)),t.contributors)for(f=OpenLayers.Util.isArray(t.contributors)?t.contributors:[t.contributors],i=0,o=f.length;i<o;i++)r.appendChild(this.buildPersonConstructNode("contributor",f[i]));if(n.fid&&r.appendChild(this.createElementNSPlus("atom:id",{value:n.fid})),t.links)for(f=OpenLayers.Util.isArray(t.links)?t.links:[t.links],i=0,o=f.length;i<o;i++)u=f[i],r.appendChild(this.createElementNSPlus("atom:link",{attributes:{href:u.href,rel:u.rel||null,type:u.type||null,hreflang:u.hreflang||null,title:u.title||null,length:u.length||null}}));return t.published&&r.appendChild(this.createElementNSPlus("atom:published",{value:t.published})),t.rights&&r.appendChild(this.createElementNSPlus("atom:rights",{value:t.rights})),(t.summary||e.description)&&r.appendChild(this.createElementNSPlus("atom:summary",{value:t.summary||e.description})),r.appendChild(this.createElementNSPlus("atom:title",{value:t.title||e.title||this.defaultEntryTitle})),t.updated&&r.appendChild(this.createElementNSPlus("atom:updated",{value:t.updated})),n.geometry&&(e=this.createElementNSPlus("georss:where"),e.appendChild(this.buildGeometryNode(n.geometry)),r.appendChild(e)),r},initGmlParser:function(){this.gmlParser=new OpenLayers.Format.GML.v3({xy:this.xy,featureNS:"http://example.com#feature",internalProjection:this.internalProjection,externalProjection:this.externalProjection})},buildGeometryNode:function(n){return this.gmlParser||this.initGmlParser(),this.gmlParser.writeNode("feature:_geometry",n).firstChild},buildPersonConstructNode:function(n,t){var r=["uri","email"],u=this.createElementNSPlus("atom:"+n),i,f;for(u.appendChild(this.createElementNSPlus("atom:name",{value:t.name})),i=0,f=r.length;i<f;i++)t[r[i]]&&u.appendChild(this.createElementNSPlus("atom:"+r[i],{value:t[r[i]]}));return u},getFirstChildValue:function(n,t,i,r){return(n=this.getElementsByTagNameNS(n,t,i))&&0<n.length?this.getChildValue(n[0],r):r},parseFeature:function(n){var i={},t=null,r=null,e=null,u=this.namespaces.atom,f,h,o,c;for(this.parsePersonConstructs(n,"author",i),r=this.getElementsByTagNameNS(n,u,"category"),0<r.length&&(i.categories=[]),f=0,h=r.length;f<h;f++)t={},t.term=r[f].getAttribute("term"),(e=r[f].getAttribute("scheme"))&&(t.scheme=e),(e=r[f].getAttribute("label"))&&(t.label=e),i.categories.push(t);r=this.getElementsByTagNameNS(n,u,"content"),0<r.length&&(t={},(e=r[0].getAttribute("type"))&&(t.type=e),(e=r[0].getAttribute("src"))?t.src=e:(t.value="text"==t.type||"html"==t.type||null==t.type?this.getFirstChildValue(n,u,"content",null):"xhtml"==t.type||t.type.match(/(\+|\/)xml$/)?this.getChildEl(r[0]):this.getFirstChildValue(n,u,"content",null),i.content=t)),this.parsePersonConstructs(n,"contributor",i),i.id=this.getFirstChildValue(n,u,"id",null),r=this.getElementsByTagNameNS(n,u,"link"),0<r.length&&(i.links=Array(r.length));for(var s=["rel","type","hreflang","title","length"],f=0,h=r.length;f<h;f++){for(t={},t.href=r[f].getAttribute("href"),o=0,c=s.length;o<c;o++)(e=r[f].getAttribute(s[o]))&&(t[s[o]]=e);i.links[f]=t}return(t=this.getFirstChildValue(n,u,"published",null))&&(i.published=t),(t=this.getFirstChildValue(n,u,"rights",null))&&(i.rights=t),(t=this.getFirstChildValue(n,u,"summary",null))&&(i.summary=t),i.title=this.getFirstChildValue(n,u,"title",null),i.updated=this.getFirstChildValue(n,u,"updated",null),t={title:i.title,description:i.summary,atom:i},n=this.parseLocations(n)[0],n=new OpenLayers.Feature.Vector(n,t),n.fid=i.id,n},parseFeatures:function(n){var i=[],t=this.getElementsByTagNameNS(n,this.namespaces.atom,"entry"),r;for(0==t.length&&(t=[n]),n=0,r=t.length;n<r;n++)i.push(this.parseFeature(t[n]));return i},parseLocations:function(n){var h=this.namespaces.georss,r={components:[]},i=this.getElementsByTagNameNS(n,h,"where"),e,s,o,t,u,f,c;if(i&&0<i.length)for(this.gmlParser||this.initGmlParser(),t=0,u=i.length;t<u;t++)this.gmlParser.readChildNodes(i[t],r);if(r=r.components,(i=this.getElementsByTagNameNS(n,h,"point"))&&0<i.length)for(t=0,u=i.length;t<u;t++)e=OpenLayers.String.trim(i[t].firstChild.nodeValue).split(/\s+/),2!=e.length&&(e=OpenLayers.String.trim(i[t].firstChild.nodeValue).split(/\s*,\s*/)),r.push(new OpenLayers.Geometry.Point(e[1],e[0]));if(s=this.getElementsByTagNameNS(n,h,"line"),s&&0<s.length)for(t=0,u=s.length;t<u;t++){for(i=OpenLayers.String.trim(s[t].firstChild.nodeValue).split(/\s+/),o=[],f=0,c=i.length;f<c;f+=2)e=new OpenLayers.Geometry.Point(i[f+1],i[f]),o.push(e);r.push(new OpenLayers.Geometry.LineString(o))}if((n=this.getElementsByTagNameNS(n,h,"polygon"))&&0<n.length)for(t=0,u=n.length;t<u;t++){for(i=OpenLayers.String.trim(n[t].firstChild.nodeValue).split(/\s+/),o=[],f=0,c=i.length;f<c;f+=2)e=new OpenLayers.Geometry.Point(i[f+1],i[f]),o.push(e);r.push(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(o)]))}if(this.internalProjection&&this.externalProjection)for(t=0,u=r.length;t<u;t++)r[t]&&r[t].transform(this.externalProjection,this.internalProjection);return r},parsePersonConstructs:function(n,t,i){var e=[],o=this.namespaces.atom,f,r,c,h;n=this.getElementsByTagNameNS(n,o,t);for(var s=["uri","email"],u=0,l=n.length;u<l;u++){for(f={},f.name=this.getFirstChildValue(n[u],o,"name",null),r=0,c=s.length;r<c;r++)h=this.getFirstChildValue(n[u],o,s[r],null),h&&(f[s[r]]=h);e.push(f)}0<e.length&&(i[t+"s"]=e)},CLASS_NAME:"OpenLayers.Format.Atom"}),OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,slideFactor:75,observeElement:null,draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress},{observeElement:this.observeElement||document})},defaultKeyPress:function(n){var t,i=!0;if(t=OpenLayers.Event.element(n),!t||"INPUT"!=t.tagName&&"TEXTAREA"!=t.tagName&&"SELECT"!=t.tagName){switch(n.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:t=this.map.getSize(),this.map.pan(0,-.75*t.h);break;case 34:t=this.map.getSize(),this.map.pan(0,.75*t.h);break;case 35:t=this.map.getSize(),this.map.pan(.75*t.w,0);break;case 36:t=this.map.getSize(),this.map.pan(-.75*t.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;default:i=!1}i&&OpenLayers.Event.stop(n)}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"}),$(function(){var n="/Scripts/Common/Openlayers/",t=n+"theme/default/style.css",i=n+"img/";$("<link>").appendTo("head").attr({type:"text/css",rel:"stylesheet"}).attr("href",t),OpenLayers.ImgPath=i})