var OpenLayers={VERSION_NUMBER:"Release 2.12",singleFile:true,_getScriptLocation:(function(){var F=new RegExp("(^|(.*?\\/))(OpenLayers[^\\/]*?\\.js)(\\?|$)"),E=document.getElementsByTagName("script"),G,B,C="";for(var D=0,A=E.length;D<A;D++){G=E[D].getAttribute("src");if(G){B=G.match(F);if(B){C=B[1];break}}}return(function(){return C})})(),ImgPath:""};OpenLayers.Class=function(){var A=arguments.length;var E=arguments[0];var D=arguments[A-1];var G=typeof D.initialize=="function"?D.initialize:function(){E.prototype.initialize.apply(this,arguments)};if(A>1){var B=[G,E].concat(Array.prototype.slice.call(arguments).slice(1,A-1),D);OpenLayers.inherit.apply(null,B)}else{G.prototype=D}return G};OpenLayers.inherit=function(H,E){var D=function(){};D.prototype=E.prototype;H.prototype=new D;var B,A,G;for(B=2,A=arguments.length;B<A;B++){G=arguments[B];if(typeof G==="function"){G=G.prototype}OpenLayers.Util.extend(H.prototype,G)}};OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.extend=function(A,E){A=A||{};if(E){for(var D in E){var C=E[D];if(C!==undefined){A[D]=C}}var B=typeof window.Event=="function"&&E instanceof window.Event;if(!B&&E.hasOwnProperty&&E.hasOwnProperty("toString")){A.toString=E.toString}}return A};OpenLayers.String={startsWith:function(B,A){return(B.indexOf(A)==0)},contains:function(B,A){return(B.indexOf(A)!=-1)},trim:function(A){return A.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(F){var D=F.split("-");var B=D[0];for(var C=1,A=D.length;C<A;C++){var E=D[C];B+=E.charAt(0).toUpperCase()+E.substring(1)}return B},format:function(D,C,A){if(!C){C=window}var B=function(I,E){var H;var G=E.split(/\.+/);for(var F=0;F<G.length;F++){if(F==0){H=C}H=H[G[F]]}if(typeof H=="function"){H=A?H.apply(null,A):H()}if(typeof H=="undefined"){return"undefined"}else{return H}};return D.replace(OpenLayers.String.tokenRegEx,B)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(A){return OpenLayers.String.numberRegEx.test(A)},numericIf:function(A){return OpenLayers.String.isNumeric(A)?parseFloat(A):A}};OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(A,C){var B=0;if(C>0){B=parseFloat(A.toPrecision(C))}return B},format:function(C,A,G,I){A=(typeof A!="undefined")?A:0;G=(typeof G!="undefined")?G:OpenLayers.Number.thousandsSeparator;I=(typeof I!="undefined")?I:OpenLayers.Number.decimalSeparator;if(A!=null){C=parseFloat(C.toFixed(A))}var B=C.toString().split(".");if(B.length==1&&A==null){A=0}var D=B[0];if(G){var E=/(-?[0-9]+)([0-9]{3})/;while(E.test(D)){D=D.replace(E,"$1"+G+"$2")}}var F;if(A==0){F=D}else{var H=B.length>1?B[1]:"0";if(A!=null){H=H+new Array(A-H.length+1).join("0")}F=D+I+H}return F}};OpenLayers.Function={bind:function(C,B){var A=Array.prototype.slice.apply(arguments,[2]);return function(){var D=A.concat(Array.prototype.slice.apply(arguments,[0]));return C.apply(B,D)}},bindAsEventListener:function(B,A){return function(C){return B.call(A,C||window.event)}},False:function(){return false},True:function(){return true},Void:function(){}};OpenLayers.Array={filter:function(G,F,B){var D=[];if(Array.prototype.filter){D=G.filter(F,B)}else{var A=G.length;if(typeof F!="function"){throw new TypeError()}for(var C=0;C<A;C++){if(C in G){var E=G[C];if(F.call(B,E,C,G)){D.push(E)}}}}return D}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(D,A,B,C){if(OpenLayers.Util.isArray(D)){C=D[3];B=D[2];A=D[1];D=D[0]}if(D!=null){this.left=OpenLayers.Util.toFloat(D)}if(A!=null){this.bottom=OpenLayers.Util.toFloat(A)}if(B!=null){this.right=OpenLayers.Util.toFloat(B)}if(C!=null){this.top=OpenLayers.Util.toFloat(C)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(B){var A=false;if(B!=null){A=((this.left==B.left)&&(this.right==B.right)&&(this.top==B.top)&&(this.bottom==B.bottom))}return A},toString:function(){return[this.left,this.bottom,this.right,this.top].join(",")},toArray:function(A){if(A===true){return[this.bottom,this.left,this.top,this.right]}else{return[this.left,this.bottom,this.right,this.top]}},toBBOX:function(B,E){if(B==null){B=6}var G=Math.pow(10,B);var F=Math.round(this.left*G)/G;var D=Math.round(this.bottom*G)/G;var C=Math.round(this.right*G)/G;var A=Math.round(this.top*G)/G;if(E===true){return D+","+F+","+A+","+C}else{return F+","+D+","+C+","+A}},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return(this.right-this.left)},getHeight:function(){return(this.top-this.bottom)},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat){this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)}return this.centerLonLat},scale:function(E,C){if(C==null){C=this.getCenterLonLat()}var A,H;if(C.CLASS_NAME=="OpenLayers.LonLat"){A=C.lon;H=C.lat}else{A=C.x;H=C.y}var G=(this.left-A)*E+A;var B=(this.bottom-H)*E+H;var D=(this.right-A)*E+A;var F=(this.top-H)*E+H;return new OpenLayers.Bounds(G,B,D,F)},add:function(A,B){if((A==null)||(B==null)){throw new TypeError("Bounds.add cannot receive null values")}return new OpenLayers.Bounds(this.left+A,this.bottom+B,this.right+A,this.top+B)},extend:function(A){var B=null;if(A){switch(A.CLASS_NAME){case"OpenLayers.LonLat":B=new OpenLayers.Bounds(A.lon,A.lat,A.lon,A.lat);break;case"OpenLayers.Geometry.Point":B=new OpenLayers.Bounds(A.x,A.y,A.x,A.y);break;case"OpenLayers.Bounds":B=A;break}if(B){this.centerLonLat=null;if((this.left==null)||(B.left<this.left)){this.left=B.left}if((this.bottom==null)||(B.bottom<this.bottom)){this.bottom=B.bottom}if((this.right==null)||(B.right>this.right)){this.right=B.right}if((this.top==null)||(B.top>this.top)){this.top=B.top}}}},containsLonLat:function(F,C){if(typeof C==="boolean"){C={inclusive:C}}C=C||{};var D=this.contains(F.lon,F.lat,C.inclusive),E=C.worldBounds;if(E&&!D){var G=E.getWidth();var A=(E.left+E.right)/2;var B=Math.round((F.lon-A)/G);D=this.containsLonLat({lon:F.lon-B*G,lat:F.lat},{inclusive:C.inclusive})}return D},containsPixel:function(B,A){return this.contains(B.x,B.y,A)},contains:function(B,D,A){if(A==null){A=true}if(B==null||D==null){return false}B=OpenLayers.Util.toFloat(B);D=OpenLayers.Util.toFloat(D);var C=false;if(A){C=((B>=this.left)&&(B<=this.right)&&(D>=this.bottom)&&(D<=this.top))}else{C=((B>this.left)&&(B<this.right)&&(D>this.bottom)&&(D<this.top))}return C},intersectsBounds:function(A,M){if(typeof M==="boolean"){M={inclusive:M}}M=M||{};if(M.worldBounds){var L=this.wrapDateLine(M.worldBounds);A=A.wrapDateLine(M.worldBounds)}else{L=this}if(M.inclusive==null){M.inclusive=true}var H=false;var I=(L.left==A.right||L.right==A.left||L.top==A.bottom||L.bottom==A.top);if(M.inclusive||!I){var J=(((A.bottom>=L.bottom)&&(A.bottom<=L.top))||((L.bottom>=A.bottom)&&(L.bottom<=A.top)));var K=(((A.top>=L.bottom)&&(A.top<=L.top))||((L.top>A.bottom)&&(L.top<A.top)));var D=(((A.left>=L.left)&&(A.left<=L.right))||((L.left>=A.left)&&(L.left<=A.right)));var C=(((A.right>=L.left)&&(A.right<=L.right))||((L.right>=A.left)&&(L.right<=A.right)));H=((J||K)&&(D||C))}if(M.worldBounds&&!H){var G=M.worldBounds;var B=G.getWidth();var F=!G.containsBounds(L);var E=!G.containsBounds(A);if(F&&!E){A=A.add(-B,0);H=L.intersectsBounds(A,{inclusive:M.inclusive})}else{if(E&&!F){L=L.add(-B,0);H=A.intersectsBounds(L,{inclusive:M.inclusive})}}}return H},containsBounds:function(G,B,A){if(B==null){B=false}if(A==null){A=true}var C=this.contains(G.left,G.bottom,A);var D=this.contains(G.right,G.bottom,A);var F=this.contains(G.left,G.top,A);var E=this.contains(G.right,G.top,A);return(B)?(C||D||F||E):(C&&D&&F&&E)},determineQuadrant:function(C){var B="";var A=this.getCenterLonLat();B+=(C.lat<A.lat)?"b":"t";B+=(C.lon<A.lon)?"l":"r";return B},transform:function(D,B){this.centerLonLat=null;var E=OpenLayers.Projection.transform({x:this.left,y:this.bottom},D,B);var A=OpenLayers.Projection.transform({x:this.right,y:this.bottom},D,B);var C=OpenLayers.Projection.transform({x:this.left,y:this.top},D,B);var F=OpenLayers.Projection.transform({x:this.right,y:this.top},D,B);this.left=Math.min(E.x,C.x);this.bottom=Math.min(E.y,A.y);this.right=Math.max(A.x,F.x);this.top=Math.max(C.y,F.y);return this},wrapDateLine:function(A,C){C=C||{};var E=C.leftTolerance||0;var B=C.rightTolerance||0;var G=this.clone();if(A){var D=A.getWidth();while(G.left<A.left&&G.right-B<=A.left){G=G.add(D,0)}while(G.left+E>=A.right&&G.right>A.right){G=G.add(-D,0)}var F=G.left+E;if(F<A.right&&F>A.left&&G.right-B>A.right){G=G.add(-D,0)}}return G},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(C,B){var A=C.split(",");return OpenLayers.Bounds.fromArray(A,B)};OpenLayers.Bounds.fromArray=function(B,A){return A===true?new OpenLayers.Bounds(B[1],B[0],B[3],B[2]):new OpenLayers.Bounds(B[0],B[1],B[2],B[3])};OpenLayers.Bounds.fromSize=function(A){return new OpenLayers.Bounds(0,A.h,A.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(A){var B="";B+=(A.charAt(0)=="t")?"b":"t";B+=(A.charAt(1)=="l")?"r":"l";return B};OpenLayers.Element={visible:function(A){return OpenLayers.Util.getElement(A).style.display!="none"},toggle:function(){for(var C=0,A=arguments.length;C<A;C++){var B=OpenLayers.Util.getElement(arguments[C]);var D=OpenLayers.Element.visible(B)?"none":"";B.style.display=D}},remove:function(A){A=OpenLayers.Util.getElement(A);A.parentNode.removeChild(A)},getHeight:function(A){A=OpenLayers.Util.getElement(A);return A.offsetHeight},hasClass:function(B,A){var C=B.className;return(!!C&&new RegExp("(^|\\s)"+A+"(\\s|$)").test(C))},addClass:function(B,A){if(!OpenLayers.Element.hasClass(B,A)){B.className+=(B.className?" ":"")+A}return B},removeClass:function(B,A){var C=B.className;if(C){B.className=OpenLayers.String.trim(C.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," "))}return B},toggleClass:function(B,A){if(OpenLayers.Element.hasClass(B,A)){OpenLayers.Element.removeClass(B,A)}else{OpenLayers.Element.addClass(B,A)}return B},getStyle:function(C,D){C=OpenLayers.Util.getElement(C);var E=null;if(C&&C.style){E=C.style[OpenLayers.String.camelize(D)];if(!E){if(document.defaultView&&document.defaultView.getComputedStyle){var B=document.defaultView.getComputedStyle(C,null);E=B?B.getPropertyValue(D):null}else{if(C.currentStyle){E=C.currentStyle[OpenLayers.String.camelize(D)]}}}var A=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(A,D)!=-1)&&(OpenLayers.Element.getStyle(C,"position")=="static")){E="auto"}}return E=="auto"?null:E}};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(B,A){if(OpenLayers.Util.isArray(B)){A=B[1];B=B[0]}this.lon=OpenLayers.Util.toFloat(B);this.lat=OpenLayers.Util.toFloat(A)},toString:function(){return("lon="+this.lon+",lat="+this.lat)},toShortString:function(){return(this.lon+", "+this.lat)},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(B,A){if((B==null)||(A==null)){throw new TypeError("LonLat.add cannot receive null values")}return new OpenLayers.LonLat(this.lon+OpenLayers.Util.toFloat(B),this.lat+OpenLayers.Util.toFloat(A))},equals:function(B){var A=false;if(B!=null){A=((this.lon==B.lon&&this.lat==B.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(B.lon)&&isNaN(B.lat)))}return A},transform:function(C,B){var A=OpenLayers.Projection.transform({x:this.lon,y:this.lat},C,B);this.lon=A.x;this.lat=A.y;return this},wrapDateLine:function(A){var B=this.clone();if(A){while(B.lon<A.left){B.lon+=A.getWidth()}while(B.lon>A.right){B.lon-=A.getWidth()}}return B},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(B){var A=B.split(",");return new OpenLayers.LonLat(A[0],A[1])};OpenLayers.LonLat.fromArray=function(A){var B=OpenLayers.Util.isArray(A),D=B&&A[0],C=B&&A[1];return new OpenLayers.LonLat(D,C)};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(A,B){this.x=parseFloat(A);this.y=parseFloat(B)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(A){var B=false;if(A!=null){B=((this.x==A.x&&this.y==A.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(A.x)&&isNaN(A.y)))}return B},distanceTo:function(A){return Math.sqrt(Math.pow(this.x-A.x,2)+Math.pow(this.y-A.y,2))},add:function(A,B){if((A==null)||(B==null)){throw new TypeError("Pixel.add cannot receive null values")}return new OpenLayers.Pixel(this.x+A,this.y+B)},offset:function(A){var B=this.clone();if(A){B=this.add(A.x,A.y)}return B},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(A,B){this.w=parseFloat(A);this.h=parseFloat(B)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(B){var A=false;if(B!=null){A=((this.w==B.w&&this.h==B.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(B.w)&&isNaN(B.h)))}return A},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(A){alert(A)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){var B=document.getElementsByTagName("script");for(var C=0,A=B.length;C<A;++C){if(B[C].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}}})();OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(B){var D;if(!B){B=(OpenLayers.BROWSER_NAME=="msie")?navigator.userLanguage:navigator.language}var C=B.split("-");C[0]=C[0].toLowerCase();if(typeof OpenLayers.Lang[C[0]]=="object"){D=C[0]}if(C[1]){var A=C[0]+"-"+C[1].toUpperCase();if(typeof OpenLayers.Lang[A]=="object"){D=A}}if(!D){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+C.join("-")+" dictionary, falling back to default language");D=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=D},translate:function(B,A){var D=OpenLayers.Lang[OpenLayers.Lang.getCode()];var C=D&&D[B];if(!C){C=B}if(A){C=OpenLayers.String.format(C,A)}return C}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.getElement=function(){var D=[];for(var C=0,A=arguments.length;C<A;C++){var B=arguments[C];if(typeof B=="string"){B=document.getElementById(B)}if(arguments.length==1){return B}D.push(B)}return D};OpenLayers.Util.isElement=function(A){return !!(A&&A.nodeType===1)};OpenLayers.Util.isArray=function(A){return(Object.prototype.toString.call(A)==="[object Array]")};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.removeItem=function(C,B){for(var A=C.length-1;A>=0;A--){if(C[A]==B){C.splice(A,1)}}return C};OpenLayers.Util.indexOf=function(D,C){if(typeof D.indexOf=="function"){return D.indexOf(C)}else{for(var B=0,A=D.length;B<A;B++){if(D[B]==C){return B}}return -1}};OpenLayers.Util.modifyDOMElement=function(E,H,D,F,A,C,G,B){if(H){E.id=H}if(D){E.style.left=D.x+"px";E.style.top=D.y+"px"}if(F){E.style.width=F.w+"px";E.style.height=F.h+"px"}if(A){E.style.position=A}if(C){E.style.border=C}if(G){E.style.overflow=G}if(parseFloat(B)>=0&&parseFloat(B)<1){E.style.filter="alpha(opacity="+(B*100)+")";E.style.opacity=B}else{if(parseFloat(B)==1){E.style.filter="";E.style.opacity=""}}};OpenLayers.Util.createDiv=function(A,I,H,F,E,C,B,G){var D=document.createElement("div");if(F){D.style.backgroundImage="url("+F+")"}if(!A){A=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!E){E="absolute"}OpenLayers.Util.modifyDOMElement(D,A,I,H,E,C,B,G);return D};OpenLayers.Util.createImage=function(A,I,H,E,D,C,F,J){var B=document.createElement("img");if(!A){A=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!D){D="relative"}OpenLayers.Util.modifyDOMElement(B,A,I,H,D,C,null,F);if(J){B.style.display="none";function G(){B.style.display="";OpenLayers.Event.stopObservingElement(B)}OpenLayers.Event.observe(B,"load",G);OpenLayers.Event.observe(B,"error",G)}B.style.alt=A;B.galleryImg="no";if(E){B.src=E}return B};OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var D=navigator.appVersion.split("MSIE");var A=parseFloat(D[1]);var B=false;try{B=!!(document.body.filters)}catch(C){}OpenLayers.Util.alphaHackNeeded=(B&&(A>=5.5)&&(A<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(A,B,J,I,G,F,C,D,H){OpenLayers.Util.modifyDOMElement(A,B,J,I,F,null,null,H);var E=A.childNodes[0];if(G){E.src=G}OpenLayers.Util.modifyDOMElement(E,A.id+"_innerImage",null,I,"relative",C);if(OpenLayers.Util.alphaHack()){if(A.style.display!="none"){A.style.display="inline-block"}if(D==null){D="scale"}A.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E.src+"', sizingMethod='"+D+"')";if(parseFloat(A.style.opacity)>=0&&parseFloat(A.style.opacity)<1){A.style.filter+=" alpha(opacity="+A.style.opacity*100+")"}E.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(B,J,I,G,F,C,D,H,K){var A=OpenLayers.Util.createDiv();var E=OpenLayers.Util.createImage(null,null,null,null,null,null,null,K);E.className="olAlphaImg";A.appendChild(E);OpenLayers.Util.modifyAlphaImageDiv(A,B,J,I,G,F,C,D,H);return A};OpenLayers.Util.upperCaseObject=function(B){var A={};for(var C in B){A[C.toUpperCase()]=B[C]}return A};OpenLayers.Util.applyDefaults=function(D,C){D=D||{};var B=typeof window.Event=="function"&&C instanceof window.Event;for(var A in C){if(D[A]===undefined||(!B&&C.hasOwnProperty&&C.hasOwnProperty(A)&&!D.hasOwnProperty(A))){D[A]=C[A]}}if(!B&&C&&C.hasOwnProperty&&C.hasOwnProperty("toString")&&!D.hasOwnProperty("toString")){D.toString=C.toString}return D};OpenLayers.Util.getParameterString=function(C){var B=[];for(var H in C){var G=C[H];if((G!=null)&&(typeof G!="function")){var D;if(typeof G=="object"&&G.constructor==Array){var E=[];var I;for(var A=0,F=G.length;A<F;A++){I=G[A];E.push(encodeURIComponent((I===null||I===undefined)?"":I))}D=E.join(",")}else{D=encodeURIComponent(G)}B.push(encodeURIComponent(H)+"="+D)}}return B.join("&")};OpenLayers.Util.urlAppend=function(A,B){var D=A;if(B){var C=(A+" ").split(/[?&]/);D+=(C.pop()===" "?B:C.length?"&"+B:"?"+B)}return D};OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.getImageLocation=function(A){return OpenLayers.Util.getImagesLocation()+A};OpenLayers.Util.Try=function(){var D=null;for(var C=0,A=arguments.length;C<A;C++){var B=arguments[C];try{D=B();break}catch(E){}}return D};OpenLayers.Util.getXmlNodeValue=function(A){var B=null;OpenLayers.Util.Try(function(){B=A.text;if(!B){B=A.textContent}if(!B){B=A.firstChild.nodeValue}},function(){B=A.textContent});return B};OpenLayers.Util.mouseLeft=function(A,C){var B=(A.relatedTarget)?A.relatedTarget:A.toElement;while(B!=C&&B!=null){B=B.parentNode}return(B!=C)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(B,A){if(A==null){A=OpenLayers.Util.DEFAULT_PRECISION}if(typeof B!=="number"){B=parseFloat(B)}return A===0?B:parseFloat(B.toPrecision(A))};OpenLayers.Util.rad=function(A){return A*Math.PI/180};OpenLayers.Util.deg=function(A){return A*180/Math.PI};OpenLayers.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563};OpenLayers.Util.distVincenty=function(F,E){var J=OpenLayers.Util.VincentyConstants;var l=J.a,k=J.b,g=J.f;var N=OpenLayers.Util.rad(E.lon-F.lon);var j=Math.atan((1-g)*Math.tan(OpenLayers.Util.rad(F.lat)));var i=Math.atan((1-g)*Math.tan(OpenLayers.Util.rad(E.lat)));var M=Math.sin(j),H=Math.cos(j);var K=Math.sin(i),G=Math.cos(i);var R=N,O=2*Math.PI;var Q=20;while(Math.abs(R-O)>1e-12&&--Q>0){var Y=Math.sin(R),D=Math.cos(R);var m=Math.sqrt((G*Y)*(G*Y)+(H*K-M*G*D)*(H*K-M*G*D));if(m==0){return 0}var c=M*K+H*G*D;var X=Math.atan2(m,c);var I=Math.asin(H*G*Y/m);var e=Math.cos(I)*Math.cos(I);var P=c-2*M*K/e;var U=g/16*e*(4+g*(4-3*e));O=R;R=N+(1-U)*g*Math.sin(I)*(X+U*m*(P+U*c*(-1+2*P*P)))}if(Q==0){return NaN}var T=e*(l*l-k*k)/(k*k);var W=1+T/16384*(4096+T*(-768+T*(320-175*T)));var V=T/1024*(256+T*(-128+T*(74-47*T)));var Z=V*m*(P+V/4*(c*(-1+2*P*P)-V/6*P*(-3+4*m*m)*(-3+4*P*P)));var S=k*W*(X-Z);var h=S.toFixed(3)/1000;return h};OpenLayers.Util.destinationVincenty=function(M,n,c){var P=OpenLayers.Util;var I=P.VincentyConstants;var o=I.a,m=I.b,i=I.f;var l=M.lon;var G=M.lat;var R=c;var Z=P.rad(n);var e=Math.sin(Z);var H=Math.cos(Z);var d=(1-i)*Math.tan(P.rad(G));var D=1/Math.sqrt((1+d*d)),J=d*D;var Q=Math.atan2(d,H);var X=D*e;var h=1-X*X;var T=h*(o*o-m*m)/(m*m);var W=1+T/16384*(4096+T*(-768+T*(320-175*T)));var U=T/1024*(256+T*(-128+T*(74-47*T)));var V=R/(m*W),j=2*Math.PI;while(Math.abs(V-j)>1e-12){var N=Math.cos(2*Q+V);var p=Math.sin(V);var g=Math.cos(V);var Y=U*p*(N+U/4*(g*(-1+2*N*N)-U/6*N*(-3+4*p*p)*(-3+4*N*N)));j=V;V=R/(m*W)+Y}var k=J*p-D*g*H;var E=Math.atan2(J*g+D*p*H,(1-i)*Math.sqrt(X*X+k*k));var O=Math.atan2(p*e,D*g-J*p*H);var S=i/16*h*(4+i*(4-3*h));var K=O-(1-S)*i*X*(V+S*p*(N+S*g*(-1+2*N*N)));var F=Math.atan2(X,-k);return new OpenLayers.LonLat(l+P.deg(K),P.deg(E))};OpenLayers.Util.getParameters=function(B){B=(B===null||B===undefined)?window.location.href:B;var A="";if(OpenLayers.String.contains(B,"?")){var C=B.indexOf("?")+1;var F=OpenLayers.String.contains(B,"#")?B.indexOf("#"):B.length;A=B.substring(C,F)}var L={};var D=A.split(/[&;]/);for(var H=0,I=D.length;H<I;++H){var G=D[H].split("=");if(G[0]){var K=G[0];try{K=decodeURIComponent(K)}catch(E){K=unescape(K)}var J=(G[1]||"").replace(/\+/g," ");try{J=decodeURIComponent(J)}catch(E){J=unescape(J)}J=J.split(",");if(J.length==1){J=J[0]}L[K]=J}}return L};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(A){if(A==null){A="id_"}OpenLayers.Util.lastSeqID+=1;return A+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.METERS_PER_INCH=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(B){var A=(B>1)?(1/B):B;return A};OpenLayers.Util.getResolutionFromScale=function(D,A){var B;if(D){if(A==null){A="degrees"}var C=OpenLayers.Util.normalizeScale(D);B=1/(C*OpenLayers.INCHES_PER_UNIT[A]*OpenLayers.DOTS_PER_INCH)}return B};OpenLayers.Util.getScaleFromResolution=function(B,A){if(A==null){A="degrees"}var C=B*OpenLayers.INCHES_PER_UNIT[A]*OpenLayers.DOTS_PER_INCH;return C};OpenLayers.Util.pagePosition=function(D){var I=[0,0];var H=OpenLayers.Util.getViewportElement();if(!D||D==window||D==H){return I}var F=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&OpenLayers.Element.getStyle(D,"position")=="absolute"&&(D.style.top==""||D.style.left=="");var J=null;var G;if(D.getBoundingClientRect){G=D.getBoundingClientRect();var B=H.scrollTop;var C=H.scrollLeft;I[0]=G.left+C;I[1]=G.top+B}else{if(document.getBoxObjectFor&&!F){G=document.getBoxObjectFor(D);var A=document.getBoxObjectFor(H);I[0]=G.screenX-A.screenX;I[1]=G.screenY-A.screenY}else{I[0]=D.offsetLeft;I[1]=D.offsetTop;J=D.offsetParent;if(J!=D){while(J){I[0]+=J.offsetLeft;I[1]+=J.offsetTop;J=J.offsetParent}}var E=OpenLayers.BROWSER_NAME;if(E=="opera"||(E=="safari"&&OpenLayers.Element.getStyle(D,"position")=="absolute")){I[1]-=document.body.offsetTop}J=D.offsetParent;while(J&&J!=document.body){I[0]-=J.scrollLeft;if(E!="opera"||J.tagName!="TR"){I[1]-=J.scrollTop}J=J.offsetParent}}}return I};OpenLayers.Util.getViewportElement=function(){var A=arguments.callee.viewportElement;if(A==undefined){A=(OpenLayers.BROWSER_NAME=="msie"&&document.compatMode!="CSS1Compat")?document.body:document.documentElement;arguments.callee.viewportElement=A}return A};OpenLayers.Util.isEquivalentUrl=function(F,E,C){C=C||{};OpenLayers.Util.applyDefaults(C,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var B=OpenLayers.Util.createUrlObject(F,C);var A=OpenLayers.Util.createUrlObject(E,C);for(var D in B){if(D!=="args"){if(B[D]!=A[D]){return false}}}for(var D in B.args){if(B.args[D]!=A.args[D]){return false}delete A.args[D]}for(var D in A.args){return false}return true};OpenLayers.Util.createUrlObject=function(B,J){J=J||{};if(!(/^\w+:\/\//).test(B)){var F=window.location;var D=F.port?":"+F.port:"";var G=F.protocol+"//"+F.host.split(":").shift()+D;if(B.indexOf("/")===0){B=G+B}else{var E=F.pathname.split("/");E.pop();B=G+E.join("/")+"/"+B}}if(J.ignoreCase){B=B.toLowerCase()}var H=document.createElement("a");H.href=B;var C={};C.host=H.host.split(":").shift();C.protocol=H.protocol;if(J.ignorePort80){C.port=(H.port=="80"||H.port=="0")?"":H.port}else{C.port=(H.port==""||H.port=="0")?"80":H.port}C.hash=(J.ignoreHash||H.hash==="#")?"":H.hash;var A=H.search;if(!A){var I=B.indexOf("?");A=(I!=-1)?B.substr(I):""}C.args=OpenLayers.Util.getParameters(A);C.pathname=(H.pathname.charAt(0)=="/")?H.pathname:"/"+H.pathname;return C};OpenLayers.Util.removeTail=function(B){var C=null;var A=B.indexOf("?");var D=B.indexOf("#");if(A==-1){C=(D!=-1)?B.substr(0,D):B}else{C=(D!=-1)?B.substr(0,Math.min(A,D)):B.substr(0,A)}return C};OpenLayers.IS_GECKO=(function(){var A=navigator.userAgent.toLowerCase();return A.indexOf("webkit")==-1&&A.indexOf("gecko")!=-1})();OpenLayers.CANVAS_SUPPORTED=(function(){var A=document.createElement("canvas");return !!(A.getContext&&A.getContext("2d"))})();OpenLayers.BROWSER_NAME=(function(){var A="";var B=navigator.userAgent.toLowerCase();if(B.indexOf("opera")!=-1){A="opera"}else{if(B.indexOf("msie")!=-1){A="msie"}else{if(B.indexOf("safari")!=-1){A="safari"}else{if(B.indexOf("mozilla")!=-1){if(B.indexOf("firefox")!=-1){A="firefox"}else{A="mozilla"}}}}}return A})();OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME};OpenLayers.Util.getRenderedDimensions=function(B,L,M){var J,E;var A=document.createElement("div");A.style.visibility="hidden";var K=(M&&M.containerElement)?M.containerElement:document.body;var N=false;var G=null;var I=K;while(I&&I.tagName.toLowerCase()!="body"){var H=OpenLayers.Element.getStyle(I,"position");if(H=="absolute"){N=true;break}else{if(H&&H!="static"){break}}I=I.parentNode}if(N&&(K.clientHeight===0||K.clientWidth===0)){G=document.createElement("div");G.style.visibility="hidden";G.style.position="absolute";G.style.overflow="visible";G.style.width=document.body.clientWidth+"px";G.style.height=document.body.clientHeight+"px";G.appendChild(A)}A.style.position="absolute";if(L){if(L.w){J=L.w;A.style.width=J+"px"}else{if(L.h){E=L.h;A.style.height=E+"px"}}}if(M&&M.displayClass){A.className=M.displayClass}var F=document.createElement("div");F.innerHTML=B;F.style.overflow="visible";if(F.childNodes){for(var D=0,C=F.childNodes.length;D<C;D++){if(!F.childNodes[D].style){continue}F.childNodes[D].style.overflow="visible"}}A.appendChild(F);if(G){K.appendChild(G)}else{K.appendChild(A)}if(!J){J=parseInt(F.scrollWidth);A.style.width=J+"px"}if(!E){E=parseInt(F.scrollHeight)}A.removeChild(F);if(G){G.removeChild(A);K.removeChild(G)}else{K.removeChild(A)}return new OpenLayers.Size(J,E)};OpenLayers.Util.getScrollbarWidth=function(){var C=OpenLayers.Util._scrollbarWidth;if(C==null){var E=null;var D=null;var A=0;var B=0;E=document.createElement("div");E.style.position="absolute";E.style.top="-1000px";E.style.left="-1000px";E.style.width="100px";E.style.height="50px";E.style.overflow="hidden";D=document.createElement("div");D.style.width="100%";D.style.height="200px";E.appendChild(D);document.body.appendChild(E);A=D.offsetWidth;E.style.overflow="scroll";B=D.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(A-B);C=OpenLayers.Util._scrollbarWidth}return C};OpenLayers.Util.getFormattedLonLat=function(H,B,E){if(!E){E="dms"}H=(H+540)%360-180;var D=Math.abs(H);var I=Math.floor(D);var A=(D-I)/(1/60);var C=A;A=Math.floor(A);var G=(C-A)/(1/60);G=Math.round(G*10);G/=10;if(G>=60){G-=60;A+=1;if(A>=60){A-=60;I+=1}}if(I<10){I="0"+I}var F=I+"\u00B0";if(E.indexOf("dm")>=0){if(A<10){A="0"+A}F+=A+"'";if(E.indexOf("dms")>=0){if(G<10){G="0"+G}F+=G+'"'}}if(B=="lon"){F+=H<0?OpenLayers.i18n("W"):OpenLayers.i18n("E")}else{F+=H<0?OpenLayers.i18n("S"):OpenLayers.i18n("N")}return F};OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:false,initialize:function(A){OpenLayers.Util.extend(this,A);this.options=A},destroy:function(){},read:function(A){throw new Error("Read not implemented.")},write:function(A){throw new 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(A){if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}OpenLayers.Format.prototype.initialize.apply(this,[A]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var B in this.namespaces){this.namespaceAlias[this.namespaces[B]]=B}},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(A,B){this.namespaces[A]=B;this.namespaceAlias[B]=A},read:function(C){var A=C.indexOf("<");if(A>0){C=C.substring(A)}var B=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var D;if(window.ActiveXObject&&!this.xmldom){D=new ActiveXObject("Microsoft.XMLDOM")}else{D=this.xmldom}D.loadXML(C);return D}),this),function(){return new DOMParser().parseFromString(C,"text/xml")},function(){var D=new XMLHttpRequest();D.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(C),false);if(D.overrideMimeType){D.overrideMimeType("text/xml")}D.send(null);return D.responseXML});if(this.keepData){this.data=B}return B},write:function(B){var C;if(this.xmldom){C=B.xml}else{var A=new XMLSerializer();if(B.nodeType==1){var D=document.implementation.createDocument("","",null);if(D.importNode){B=D.importNode(B,true)}D.appendChild(B);C=A.serializeToString(D)}else{C=A.serializeToString(B)}}return C},createElementNS:function(C,A){var B;if(this.xmldom){if(typeof C=="string"){B=this.xmldom.createNode(1,A,C)}else{B=this.xmldom.createNode(1,A,"")}}else{B=document.createElementNS(C,A)}return B},createTextNode:function(B){var A;if(typeof B!=="string"){B=String(B)}if(this.xmldom){A=this.xmldom.createTextNode(B)}else{A=document.createTextNode(B)}return A},getElementsByTagNameNS:function(E,D,C){var A=[];if(E.getElementsByTagNameNS){A=E.getElementsByTagNameNS(D,C)}else{var B=E.getElementsByTagName("*");var I,F;for(var G=0,H=B.length;G<H;++G){I=B[G];F=(I.prefix)?(I.prefix+":"+C):C;if((C=="*")||(F==I.nodeName)){if((D=="*")||(D==I.namespaceURI)){A.push(I)}}}}return A},getAttributeNodeNS:function(C,B,A){var I=null;if(C.getAttributeNodeNS){I=C.getAttributeNodeNS(B,A)}else{var E=C.attributes;var H,D;for(var F=0,G=E.length;F<G;++F){H=E[F];if(H.namespaceURI==B){D=(H.prefix)?(H.prefix+":"+A):A;if(D==H.nodeName){I=H;break}}}}return I},getAttributeNS:function(E,D,A){var B="";if(E.getAttributeNS){B=E.getAttributeNS(D,A)||""}else{var C=this.getAttributeNodeNS(E,D,A);if(C){B=C.nodeValue}}return B},getChildValue:function(A,C){var B=C||"";if(A){for(var D=A.firstChild;D;D=D.nextSibling){switch(D.nodeType){case 3:case 4:B+=D.nodeValue}}}return B},isSimpleContent:function(A){var C=true;for(var B=A.firstChild;B;B=B.nextSibling){if(B.nodeType===1){C=false;break}}return C},contentType:function(C){var E=false,B=false;var A=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var D=C.firstChild;D;D=D.nextSibling){switch(D.nodeType){case 1:B=true;break;case 8:break;default:E=true}if(B&&E){break}}if(B&&E){A=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(B){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(E){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return A},hasAttributeNS:function(C,B,A){var D=false;if(C.hasAttributeNS){D=C.hasAttributeNS(B,A)}else{D=!!this.getAttributeNodeNS(C,B,A)}return D},setAttributeNS:function(D,C,A,E){if(D.setAttributeNS){D.setAttributeNS(C,A,E)}else{if(this.xmldom){if(C){var B=D.ownerDocument.createNode(2,A,C);B.nodeValue=E;D.setAttributeNode(B)}else{D.setAttribute(A,E)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(B,A){A=A||{};var D=A.uri||this.namespaces[A.prefix];if(!D){var F=B.indexOf(":");D=this.namespaces[B.substring(0,F)]}if(!D){D=this.namespaces[this.defaultPrefix]}var C=this.createElementNS(D,B);if(A.attributes){this.setAttributes(C,A.attributes)}var E=A.value;if(E!=null){C.appendChild(this.createTextNode(E))}return C},setAttributes:function(C,E){var D,B;for(var A in E){if(E[A]!=null&&E[A].toString){D=E[A].toString();B=this.namespaces[A.substring(0,A.indexOf(":"))]||null;this.setAttributeNS(C,B,A,D)}}},readNode:function(C,E){if(!E){E={}}var D=this.readers[C.namespaceURI?this.namespaceAlias[C.namespaceURI]:this.defaultPrefix];if(D){var B=C.localName||C.nodeName.split(":").pop();var A=D[B]||D["*"];if(A){A.apply(this,[C,E])}}return E},readChildNodes:function(D,E){if(!E){E={}}var C=D.childNodes;var F;for(var B=0,A=C.length;B<A;++B){F=C[B];if(F.nodeType==1){this.readNode(F,E)}}return E},writeNode:function(A,F,D){var E,C;var B=A.indexOf(":");if(B>0){E=A.substring(0,B);C=A.substring(B+1)}else{if(D){E=this.namespaceAlias[D.namespaceURI]}else{E=this.defaultPrefix}C=A}var G=this.writers[E][C].apply(this,[F]);if(D){D.appendChild(G)}return G},getChildEl:function(C,A,B){return C&&this.getThisOrNextEl(C.firstChild,A,B)},getNextEl:function(C,A,B){return C&&this.getThisOrNextEl(C.nextSibling,A,B)},getThisOrNextEl:function(D,A,C){outer:for(var B=D;B;B=B.nextSibling){switch(B.nodeType){case 1:if((!A||A===(B.localName||B.nodeName.split(":").pop()))&&(!C||C===B.namespaceURI)){break outer}B=null;break outer;case 3:if(/^\s*$/.test(B.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:B=null;break outer}}return B||null},lookupNamespaceURI:function(E,F){var D=null;if(E){if(E.lookupNamespaceURI){D=E.lookupNamespaceURI(F)}else{outer:switch(E.nodeType){case 1:if(E.namespaceURI!==null&&E.prefix===F){D=E.namespaceURI;break outer}var B=E.attributes.length;if(B){var A;for(var C=0;C<B;++C){A=E.attributes[C];if(A.prefix==="xmlns"&&A.name==="xmlns:"+F){D=A.value||null;break outer}else{if(A.name==="xmlns"&&F===null){D=A.value||null;break outer}}}}D=this.lookupNamespaceURI(E.parentNode,F);break outer;case 2:D=this.lookupNamespaceURI(E.ownerElement,F);break outer;case 9:D=this.lookupNamespaceURI(E.documentElement,F);break outer;case 6:case 12:case 10:case 11:break outer;default:D=this.lookupNamespaceURI(E.parentNode,F);break outer}}}return D},getXMLDoc:function(){if(!OpenLayers.Format.XML.document&&!this.xmldom){if(document.implementation&&document.implementation.createDocument){OpenLayers.Format.XML.document=document.implementation.createDocument("","",null)}else{if(!this.xmldom&&window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}}}return 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={toISOString:(function(){if("toISOString" in Date.prototype){return function(B){return B.toISOString()}}else{function A(C,B){var D=C+"";while(D.length<B){D="0"+D}return D}return function(B){var C;if(isNaN(B.getTime())){C="Invalid Date"}else{C=B.getUTCFullYear()+"-"+A(B.getUTCMonth()+1,2)+"-"+A(B.getUTCDate(),2)+"T"+A(B.getUTCHours(),2)+":"+A(B.getUTCMinutes(),2)+":"+A(B.getUTCSeconds(),2)+"."+A(B.getUTCMilliseconds(),3)+"Z"}return C}}})(),parse:function(J){var B;var H=J.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/);if(H&&(H[1]||H[7])){var K=parseInt(H[1],10)||0;var I=(parseInt(H[2],10)-1)||0;var M=parseInt(H[3],10)||1;B=new Date(Date.UTC(K,I,M));var L=H[7];if(L){var N=parseInt(H[4],10);var D=parseInt(H[5],10);var A=parseFloat(H[6]);var O=A|0;var C=Math.round(1000*(A-O));B.setUTCHours(N,D,O,C);if(L!=="Z"){var G=parseInt(L,10);var F=parseInt(H[8],10)||0;var E=-1000*(60*(G*60)+F*60);B=new Date(B.getTime()+E)}}}else{B=new Date("invalid")}return B}};OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:null,popup:null,initialize:function(A,C,B){this.layer=A;this.lonlat=C;this.data=(B!=null)?B:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)}}if(this.layer!=null&&this.marker!=null){this.layer.removeMarker(this.marker)}this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null}if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null}},onScreen:function(){var B=false;if((this.layer!=null)&&(this.layer.map!=null)){var A=this.layer.map.getExtent();B=A.containsLonLat(this.lonlat)}return B},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)}return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(B){if(this.lonlat!=null){if(!this.popup){var A=(this.marker)?this.marker.icon:null;var C=this.popupClass?this.popupClass:OpenLayers.Popup.Anchored;this.popup=new C(this.id+"_popup",this.lonlat,this.data.popupSize,this.data.popupContentHTML,A,B)}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow}this.popup.feature=this}return this.popup},destroyPopup:function(){if(this.popup){this.popup.feature=null;this.popup.destroy();this.popup=null}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.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(C,A,B){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,A]);this.lonlat=null;this.geometry=C?C:null;this.state=null;this.attributes={};if(A){this.attributes=OpenLayers.Util.extend(this.attributes,A)}this.style=B?B:null},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null}this.geometry=null;this.modified=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(D){var C=false;if(this.layer&&this.layer.map){var A=this.layer.map.getExtent();if(D){var B=this.geometry.getBounds();C=A.intersectsBounds(B)}else{var E=A.toGeometry();C=E.intersects(this.geometry)}}return C},getVisibility:function(){return !(this.style&&this.style.display=="none"||!this.layer||this.layer&&this.layer.styleMap&&this.layer.styleMap.createSymbolizer(this,this.renderIntent).display=="none"||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(B,D,C){var A=false;if(this.geometry){A=this.geometry.atPoint(B,D,C)}return A},destroyPopup:function(){},move:function(A){if(!this.layer||!this.geometry.move){return undefined}var B;if(A.CLASS_NAME=="OpenLayers.LonLat"){B=this.layer.getViewPortPxFromLonLat(A)}else{B=A}var D=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var C=this.layer.map.getResolution();this.geometry.move(C*(B.x-D.x),C*(D.y-B.y));this.layer.drawFeature(this);return D},toState:function(A){if(A==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=A;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(A==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=A;break}}else{if(A==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=A;break}}else{if(A==OpenLayers.State.UNKNOWN){this.state=A}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",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.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(A){if(A){this.bounds=A.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(B){var A=this.getBounds();if(!A){this.setBounds(B)}else{this.bounds.extend(B)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(B,A){},getVertices:function(A){},atPoint:function(E,H,F){var C=false;var D=this.getBounds();if((D!=null)&&(E!=null)){var B=(H!=null)?H:0;var A=(F!=null)?F:0;var G=new OpenLayers.Bounds(this.bounds.left-B,this.bounds.bottom-A,this.bounds.right+B,this.bounds.top+A);C=G.containsLonLat(E)}return C},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){var A;if(OpenLayers.Format&&OpenLayers.Format.WKT){A=OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))}else{A=Object.prototype.toString.call(this)}return A},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(F){var D;if(OpenLayers.Format&&OpenLayers.Format.WKT){var G=OpenLayers.Geometry.fromWKT.format;if(!G){G=new OpenLayers.Format.WKT();OpenLayers.Geometry.fromWKT.format=G}var B=G.read(F);if(B instanceof OpenLayers.Feature.Vector){D=B.geometry}else{if(OpenLayers.Util.isArray(B)){var A=B.length;var E=new Array(A);for(var C=0;C<A;++C){E[C]=B[C].geometry}D=new OpenLayers.Geometry.Collection(E)}}}return D};OpenLayers.Geometry.segmentsIntersect=function(A,b,B){var O=B&&B.point;var T=B&&B.tolerance;var E=false;var V=A.x1-b.x1;var Z=A.y1-b.y1;var L=A.x2-A.x1;var S=A.y2-A.y1;var P=b.y2-b.y1;var I=b.x2-b.x1;var X=(P*L)-(I*S);var D=(I*Z)-(P*V);var C=(L*Z)-(S*V);if(X==0){if(D==0&&C==0){E=true}}else{var Y=D/X;var W=C/X;if(Y>=0&&Y<=1&&W>=0&&W<=1){if(!O){E=true}else{var G=A.x1+(Y*L);var F=A.y1+(Y*S);E=new OpenLayers.Geometry.Point(G,F)}}}if(T){var N;if(E){if(O){var K=[A,b];var U,G,F;outer:for(var R=0;R<2;++R){U=K[R];for(var Q=1;Q<3;++Q){G=U["x"+Q];F=U["y"+Q];N=Math.sqrt(Math.pow(G-E.x,2)+Math.pow(F-E.y,2));if(N<T){E.x=G;E.y=F;break outer}}}}}else{var K=[A,b];var M,a,G,F,J,H;outer:for(var R=0;R<2;++R){M=K[R];a=K[(R+1)%2];for(var Q=1;Q<3;++Q){J={x:M["x"+Q],y:M["y"+Q]};H=OpenLayers.Geometry.distanceToSegment(J,a);if(H.distance<T){if(O){E=new OpenLayers.Geometry.Point(J.x,J.y)}else{E=true}break outer}}}}}return E};OpenLayers.Geometry.distanceToSegment=function(K,D){var C=K.x;var J=K.y;var B=D.x1;var I=D.y1;var A=D.x2;var F=D.y2;var M=A-B;var L=F-I;var H=((M*(C-B))+(L*(J-I)))/(Math.pow(M,2)+Math.pow(L,2));var G,E;if(H<=0){G=B;E=I}else{if(H>=1){G=A;E=F}else{G=B+H*M;E=I+H*L}}return{distance:Math.sqrt(Math.pow(G-C,2)+Math.pow(E-J,2)),x:G,y:E}};OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(A,B){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(A);this.y=parseFloat(B)},clone:function(A){if(A==null){A=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(A,this);return A},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(F,J){var D=!(J&&J.edge===false);var A=D&&J&&J.details;var B,E,H,C,G,I;if(F instanceof OpenLayers.Geometry.Point){E=this.x;H=this.y;C=F.x;G=F.y;B=Math.sqrt(Math.pow(E-C,2)+Math.pow(H-G,2));I=!A?B:{x0:E,y0:H,x1:C,y1:G,distance:B}}else{I=F.distanceTo(this,J);if(A){I={x0:I.x1,y0:I.y1,x1:I.x0,y1:I.y0,distance:I.distance}}}return I},equals:function(A){var B=false;if(A!=null){B=((this.x==A.x&&this.y==A.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(A.x)&&isNaN(A.y)))}return B},toShortString:function(){return(this.x+", "+this.y)},move:function(A,B){this.x=this.x+A;this.y=this.y+B;this.clearBounds()},rotate:function(D,B){D*=Math.PI/180;var A=this.distanceTo(B);var C=D+Math.atan2(this.y-B.y,this.x-B.x);this.x=B.x+(A*Math.cos(C));this.y=B.y+(A*Math.sin(C));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(C,A,B){B=(B==undefined)?1:B;this.x=A.x+(C*B*(this.x-A.x));this.y=A.y+(C*(this.y-A.y));this.clearBounds();return this},intersects:function(B){var A=false;if(B.CLASS_NAME=="OpenLayers.Geometry.Point"){A=this.equals(B)}else{A=B.intersects(this)}return A},transform:function(B,A){if((B&&A)){OpenLayers.Projection.transform(this,B,A);this.bounds=null}return this},getVertices:function(A){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(A){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(A!=null){this.addComponents(A)}},destroy:function(){this.components.length=0;this.components=null;OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var B=[];for(var C=0,A=this.components.length;C<A;C++){B.push(this.components[C].toShortString())}return B.join(",")},calculateBounds:function(){this.bounds=null;var D=new OpenLayers.Bounds();var C=this.components;if(C){for(var B=0,A=C.length;B<A;B++){D.extend(C[B].getBounds())}}if(D.left!=null&&D.bottom!=null&&D.right!=null&&D.top!=null){this.setBounds(D)}},addComponents:function(C){if(!(OpenLayers.Util.isArray(C))){C=[C]}for(var B=0,A=C.length;B<A;B++){this.addComponent(C[B])}},addComponent:function(B,A){var D=false;if(B){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,B.CLASS_NAME)>-1)){if(A!=null&&(A<this.components.length)){var E=this.components.slice(0,A);var C=this.components.slice(A,this.components.length);E.push(B);this.components=E.concat(C)}else{this.components.push(B)}B.parent=this;this.clearBounds();D=true}}return D},removeComponents:function(B){var C=false;if(!(OpenLayers.Util.isArray(B))){B=[B]}for(var A=B.length-1;A>=0;--A){C=this.removeComponent(B[A])||C}return C},removeComponent:function(A){OpenLayers.Util.removeItem(this.components,A);this.clearBounds();return true},getLength:function(){var C=0;for(var B=0,A=this.components.length;B<A;B++){C+=this.components[B].getLength()}return C},getArea:function(){var C=0;for(var B=0,A=this.components.length;B<A;B++){C+=this.components[B].getArea()}return C},getGeodesicArea:function(B){var D=0;for(var C=0,A=this.components.length;C<A;C++){D+=this.components[C].getGeodesicArea(B)}return D},getCentroid:function(G){if(!G){return this.components.length&&this.components[0].getCentroid()}var K=this.components.length;if(!K){return false}var B=[];var C=[];var D=0;var H=Number.MAX_VALUE;var L;for(var J=0;J<K;++J){L=this.components[J];var E=L.getArea();var F=L.getCentroid(true);if(isNaN(E)||isNaN(F.x)||isNaN(F.y)){continue}B.push(E);D+=E;H=(E<H&&E>0)?E:H;C.push(F)}K=B.length;if(D===0){for(var J=0;J<K;++J){B[J]=1}D=B.length}else{for(var J=0;J<K;++J){B[J]/=H}D/=H}var I=0,A=0,F,E;for(var J=0;J<K;++J){F=C[J];E=B[J];I+=F.x*E;A+=F.y*E}return new OpenLayers.Geometry.Point(I/D,A/D)},getGeodesicLength:function(B){var D=0;for(var C=0,A=this.components.length;C<A;C++){D+=this.components[C].getGeodesicLength(B)}return D},move:function(B,D){for(var C=0,A=this.components.length;C<A;C++){this.components[C].move(B,D)}},rotate:function(D,B){for(var C=0,A=this.components.length;C<A;++C){this.components[C].rotate(D,B)}},resize:function(D,A,C){for(var B=0;B<this.components.length;++B){this.components[B].resize(D,A,C)}return this},distanceTo:function(H,I){var C=!(I&&I.edge===false);var A=C&&I&&I.details;var J,D,B;var E=Number.POSITIVE_INFINITY;for(var F=0,G=this.components.length;F<G;++F){J=this.components[F].distanceTo(H,I);B=A?J.distance:J;if(B<E){E=B;D=J;if(E==0){break}}}return D},equals:function(D){var B=true;if(!D||!D.CLASS_NAME||(this.CLASS_NAME!=D.CLASS_NAME)){B=false}else{if(!(OpenLayers.Util.isArray(D.components))||(D.components.length!=this.components.length)){B=false}else{for(var C=0,A=this.components.length;C<A;++C){if(!this.components[C].equals(D.components[C])){B=false;break}}}}return B},transform:function(E,C){if(E&&C){for(var D=0,A=this.components.length;D<A;D++){var B=this.components[D];B.transform(E,C)}this.bounds=null}return this},intersects:function(D){var B=false;for(var C=0,A=this.components.length;C<A;++C){B=D.intersects(this.components[C]);if(B){break}}return B},getVertices:function(B){var C=[];for(var D=0,A=this.components.length;D<A;++D){Array.prototype.push.apply(C,this.components[D].getVertices(B))}return C},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],addPoint:function(A,B){this.addComponent(A,B)},removePoint:function(A){this.removeComponent(A)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],getLength:function(){var C=0;if(this.components&&(this.components.length>1)){for(var B=1,A=this.components.length;B<A;B++){C+=this.components[B-1].distanceTo(this.components[B])}}return C},getGeodesicLength:function(B){var E=this;if(B){var C=new OpenLayers.Projection("EPSG:4326");if(!C.equals(B)){E=this.clone().transform(B,C)}}var F=0;if(E.components&&(E.components.length>1)){var H,G;for(var D=1,A=E.components.length;D<A;D++){H=E.components[D-1];G=E.components[D];F+=OpenLayers.Util.distVincenty({lon:H.x,lat:H.y},{lon:G.x,lat:G.y})}}return F*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{removeComponent:function(A){var B=this.components&&(this.components.length>2);if(B){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}return B},intersects:function(K){var C=false;var J=K.CLASS_NAME;if(J=="OpenLayers.Geometry.LineString"||J=="OpenLayers.Geometry.LinearRing"||J=="OpenLayers.Geometry.Point"){var N=this.getSortedSegments();var L;if(J=="OpenLayers.Geometry.Point"){L=[{x1:K.x,y1:K.y,x2:K.x,y2:K.y}]}else{L=K.getSortedSegments()}var Q,G,E,A,P,O,D,B;outer:for(var H=0,I=N.length;H<I;++H){Q=N[H];G=Q.x1;E=Q.x2;A=Q.y1;P=Q.y2;inner:for(var F=0,M=L.length;F<M;++F){O=L[F];if(O.x1>E){break}if(O.x2<G){continue}D=O.y1;B=O.y2;if(Math.min(D,B)>Math.max(A,P)){continue}if(Math.max(D,B)<Math.min(A,P)){continue}if(OpenLayers.Geometry.segmentsIntersect(Q,O)){C=true;break outer}}}}else{C=K.intersects(this)}return C},getSortedSegments:function(){var A=this.components.length-1;var B=new Array(A),E,D;for(var C=0;C<A;++C){E=this.components[C];D=this.components[C+1];if(E.x<D.x){B[C]={x1:E.x,y1:E.y,x2:D.x,y2:D.y}}else{B[C]={x1:D.x,y1:D.y,x2:E.x,y2:E.y}}}function F(H,G){return H.x1-G.x1}return B.sort(F)},splitWithSegment:function(Q,B){var C=!(B&&B.edge===false);var N=B&&B.tolerance;var A=[];var S=this.getVertices();var M=[];var U=[];var H=false;var E,D,K;var I,P,T;var F={point:true,tolerance:N};var G=null;for(var L=0,J=S.length-2;L<=J;++L){E=S[L];M.push(E.clone());D=S[L+1];T={x1:E.x,y1:E.y,x2:D.x,y2:D.y};K=OpenLayers.Geometry.segmentsIntersect(Q,T,F);if(K instanceof OpenLayers.Geometry.Point){if((K.x===Q.x1&&K.y===Q.y1)||(K.x===Q.x2&&K.y===Q.y2)||K.equals(E)||K.equals(D)){P=true}else{P=false}if(P||C){if(!K.equals(U[U.length-1])){U.push(K.clone())}if(L===0){if(K.equals(E)){continue}}if(K.equals(D)){continue}H=true;if(!K.equals(E)){M.push(K)}A.push(new OpenLayers.Geometry.LineString(M));M=[K.clone()]}}}if(H){M.push(D.clone());A.push(new OpenLayers.Geometry.LineString(M))}if(U.length>0){var O=Q.x1<Q.x2?1:-1;var R=Q.y1<Q.y2?1:-1;G={lines:A,points:U.sort(function(W,V){return(O*W.x-O*V.x)||(R*W.y-R*V.y)})}}return G},split:function(U,B){var K=null;var D=B&&B.mutual;var I,E,J,C;if(U instanceof OpenLayers.Geometry.LineString){var T=this.getVertices();var G,F,S,H,A,M;var P=[];J=[];for(var Q=0,L=T.length-2;Q<=L;++Q){G=T[Q];F=T[Q+1];S={x1:G.x,y1:G.y,x2:F.x,y2:F.y};C=C||[U];if(D){P.push(G.clone())}for(var O=0;O<C.length;++O){H=C[O].splitWithSegment(S,B);if(H){A=H.lines;if(A.length>0){A.unshift(O,1);Array.prototype.splice.apply(C,A);O+=A.length-2}if(D){for(var N=0,R=H.points.length;N<R;++N){M=H.points[N];if(!M.equals(G)){P.push(M);J.push(new OpenLayers.Geometry.LineString(P));if(M.equals(F)){P=[]}else{P=[M.clone()]}}}}}}}if(D&&J.length>0&&P.length>0){P.push(F.clone());J.push(new OpenLayers.Geometry.LineString(P))}}else{K=U.splitWith(this,B)}if(C&&C.length>1){E=true}else{C=[]}if(J&&J.length>1){I=true}else{J=[]}if(E||I){if(D){K=[J,C]}else{K=C}}return K},splitWith:function(B,A){return B.split(this,A)},getVertices:function(A){var B;if(A===true){B=[this.components[0],this.components[this.components.length-1]]}else{if(A===false){B=this.components.slice(1,this.components.length-1)}else{B=this.components.slice()}}return B},distanceTo:function(H,G){var I=!(G&&G.edge===false);var X=I&&G&&G.details;var O,E={};var R=Number.POSITIVE_INFINITY;if(H instanceof OpenLayers.Geometry.Point){var P=this.getSortedSegments();var N=H.x;var M=H.y;var V;for(var T=0,U=P.length;T<U;++T){V=P[T];O=OpenLayers.Geometry.distanceToSegment(H,V);if(O.distance<R){R=O.distance;E=O;if(R===0){break}}else{if(V.x2>N&&((M>V.y1&&M<V.y2)||(M<V.y1&&M>V.y2))){break}}}if(X){E={distance:E.distance,x0:E.x,y0:E.y,x1:N,y1:M}}else{E=E.distance}}else{if(H instanceof OpenLayers.Geometry.LineString){var D=this.getSortedSegments();var C=H.getSortedSegments();var B,A,L,W,F;var K=C.length;var J={point:true};outer:for(var T=0,U=D.length;T<U;++T){B=D[T];W=B.x1;F=B.y1;for(var S=0;S<K;++S){A=C[S];L=OpenLayers.Geometry.segmentsIntersect(B,A,J);if(L){R=0;E={distance:0,x0:L.x,y0:L.y,x1:L.x,y1:L.y};break outer}else{O=OpenLayers.Geometry.distanceToSegment({x:W,y:F},A);if(O.distance<R){R=O.distance;E={distance:R,x0:W,y0:F,x1:O.x,y1:O.y}}}}}if(!X){E=E.distance}if(R!==0){if(B){O=H.distanceTo(new OpenLayers.Geometry.Point(B.x2,B.y2),G);var Q=X?O.distance:O;if(Q<R){if(X){E={distance:R,x0:O.x1,y0:O.y1,x1:O.x0,y1:O.y0}}else{E=Q}}}}}else{E=H.distanceTo(this,G);if(X){E={distance:E.distance,x0:E.x1,y0:E.y1,x1:E.x0,y1:E.y0}}}}return E},simplify:function(H){if(this&&this!==null){var J=this.getVertices();if(J.length<3){return this}var D=function(L,K){return(L-K)};var C=function(N,Q,O,K){var P=0;var M=0;for(var L=Q,R;L<O;L++){R=B(N[Q],N[O],N[L]);if(R>P){P=R;M=L}}if(P>K&&M!=Q){E.push(M);C(N,Q,M,K);C(N,M,O,K)}};var B=function(O,N,L){var P=Math.abs(0.5*(O.x*N.y+N.x*L.y+L.x*O.y-N.x*O.y-L.x*N.y-O.x*L.y));var M=Math.sqrt(Math.pow(O.x-N.x,2)+Math.pow(O.y-N.y,2));var K=P/M*2;return K};var F=0;var I=J.length-1;var E=[];E.push(F);E.push(I);while(J[F].equals(J[I])){I--;E.push(I)}C(J,F,I,H);var A=[];E.sort(D);for(var G=0;G<E.length;G++){A.push(J[E[G]])}return new OpenLayers.Geometry.LineString(A)}else{return this}},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],addComponent:function(A,B){var C=false;var D=this.components.pop();if(B!=null||!A.equals(D)){C=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var E=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[E]);return C},removeComponent:function(A){var B=this.components&&(this.components.length>3);if(B){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var C=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[C])}return B},move:function(B,D){for(var C=0,A=this.components.length;C<A-1;C++){this.components[C].move(B,D)}},rotate:function(D,B){for(var C=0,A=this.components.length;C<A-1;++C){this.components[C].rotate(D,B)}},resize:function(E,B,D){for(var C=0,A=this.components.length;C<A-1;++C){this.components[C].resize(E,B,D)}return this},transform:function(E,C){if(E&&C){for(var D=0,A=this.components.length;D<A-1;D++){var B=this.components[D];B.transform(E,C)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var F=0;var E=0;for(var C=0;C<this.components.length-1;C++){var B=this.components[C];var H=this.components[C+1];F+=(B.x+H.x)*(B.x*H.y-H.x*B.y);E+=(B.y+H.y)*(B.x*H.y-H.x*B.y)}var D=-1*this.getArea();var A=F/(6*D);var G=E/(6*D);return new OpenLayers.Geometry.Point(A,G)}else{return null}},getArea:function(){var E=0;if(this.components&&(this.components.length>2)){var D=0;for(var C=0,B=this.components.length;C<B-1;C++){var A=this.components[C];var F=this.components[C+1];D+=(A.x+F.x)*(F.y-A.y)}E=-D/2}return E},getGeodesicArea:function(B){var D=this;if(B){var C=new OpenLayers.Projection("EPSG:4326");if(!C.equals(B)){D=this.clone().transform(B,C)}}var F=0;var A=D.components&&D.components.length;if(A>2){var H,G;for(var E=0;E<A-1;E++){H=D.components[E];G=D.components[E+1];F+=OpenLayers.Util.rad(G.x-H.x)*(2+Math.sin(OpenLayers.Util.rad(H.y))+Math.sin(OpenLayers.Util.rad(G.y)))}F=F*6378137*6378137/2}return F},containsPoint:function(L){var R=OpenLayers.Number.limitSigDigs;var K=14;var J=R(L.x,K);var I=R(L.y,K);function Q(W,T,V,S,U){return(W-U)*((S-T)/(U-V))+S}var A=this.components.length-1;var G,F,P,D,N,B,E,C;var H=0;for(var M=0;M<A;++M){G=this.components[M];P=R(G.x,K);D=R(G.y,K);F=this.components[M+1];N=R(F.x,K);B=R(F.y,K);if(D==B){if(I==D){if(P<=N&&(J>=P&&J<=N)||P>=N&&(J<=P&&J>=N)){H=-1;break}}continue}E=R(Q(I,P,D,N,B),K);if(E==J){if(D<B&&(I>=D&&I<=B)||D>B&&(I<=D&&I>=B)){H=-1;break}}if(E<=J){continue}if(P!=N&&(E<Math.min(P,N)||E>Math.max(P,N))){continue}if(D<B&&(I>=D&&I<B)||D>B&&(I<D&&I>=B)){++H}}var O=(H==-1)?1:!!(H&1);return O},intersects:function(D){var B=false;if(D.CLASS_NAME=="OpenLayers.Geometry.Point"){B=this.containsPoint(D)}else{if(D.CLASS_NAME=="OpenLayers.Geometry.LineString"){B=D.intersects(this)}else{if(D.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){B=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[D])}else{for(var C=0,A=D.components.length;C<A;++C){B=D.components[C].intersects(this);if(B){break}}}}}return B},getVertices:function(A){return(A===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],getArea:function(){var C=0;if(this.components&&(this.components.length>0)){C+=Math.abs(this.components[0].getArea());for(var B=1,A=this.components.length;B<A;B++){C-=Math.abs(this.components[B].getArea())}}return C},getGeodesicArea:function(B){var D=0;if(this.components&&(this.components.length>0)){D+=Math.abs(this.components[0].getGeodesicArea(B));for(var C=1,A=this.components.length;C<A;C++){D-=Math.abs(this.components[C].getGeodesicArea(B))}}return D},containsPoint:function(A){var E=this.components.length;var C=false;if(E>0){C=this.components[0].containsPoint(A);if(C!==1){if(C&&E>1){var D;for(var B=1;B<E;++B){D=this.components[B].containsPoint(A);if(D){if(D===1){C=1}else{C=false}break}}}}}return C},intersects:function(E){var B=false;var D,A;if(E.CLASS_NAME=="OpenLayers.Geometry.Point"){B=this.containsPoint(E)}else{if(E.CLASS_NAME=="OpenLayers.Geometry.LineString"||E.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(D=0,A=this.components.length;D<A;++D){B=E.intersects(this.components[D]);if(B){break}}if(!B){for(D=0,A=E.components.length;D<A;++D){B=this.containsPoint(E.components[D]);if(B){break}}}}else{for(D=0,A=E.components.length;D<A;++D){B=this.intersects(E.components[D]);if(B){break}}}}if(!B&&E.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var C=this.components[0];for(D=0,A=C.components.length;D<A;++D){B=E.containsPoint(C.components[D]);if(B){break}}}return B},distanceTo:function(D,B){var C=!(B&&B.edge===false);var A;if(!C&&this.intersects(D)){A=0}else{A=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[D,B])}return A},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(I,F,B,K){var C=Math.PI*((1/B)-(1/2));if(K){C+=(K/180)*Math.PI}var A,H,G;var J=[];for(var E=0;E<B;++E){A=C+(E*2*Math.PI/B);H=I.x+(F*Math.cos(A));G=I.y+(F*Math.sin(A));J.push(new OpenLayers.Geometry.Point(H,G))}var D=new OpenLayers.Geometry.LinearRing(J);return new OpenLayers.Geometry.Polygon([D])};OpenLayers.Event={observers:false,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(A){return A.target||A.srcElement},isSingleTouch:function(A){return A.touches&&A.touches.length==1},isMultiTouch:function(A){return A.touches&&A.touches.length>1},isLeftClick:function(A){return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)))},isRightClick:function(A){return(((A.which)&&(A.which==3))||((A.button)&&(A.button==2)))},stop:function(B,A){if(!A){if(B.preventDefault){B.preventDefault()}else{B.returnValue=false}}if(B.stopPropagation){B.stopPropagation()}else{B.cancelBubble=true}},findElement:function(C,B){var A=OpenLayers.Event.element(C);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A},observe:function(B,D,C,A){var E=OpenLayers.Util.getElement(B);A=A||false;if(D=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||E.attachEvent)){D="keydown"}if(!this.observers){this.observers={}}if(!E._eventCacheID){var F="eventCacheID_";if(E.id){F=E.id+"_"+F}E._eventCacheID=OpenLayers.Util.createUniqueID(F)}var G=E._eventCacheID;if(!this.observers[G]){this.observers[G]=[]}this.observers[G].push({element:E,name:D,observer:C,useCapture:A});if(E.addEventListener){E.addEventListener(D,C,A)}else{if(E.attachEvent){E.attachEvent("on"+D,C)}}},stopObservingElement:function(A){var B=OpenLayers.Util.getElement(A);var C=B._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[C])},_removeElementObservers:function(E){if(E){for(var B=E.length-1;B>=0;B--){var C=E[B];var A=new Array(C.element,C.name,C.observer,C.useCapture);var D=OpenLayers.Event.stopObserving.apply(this,A)}}},stopObserving:function(H,A,G,B){B=B||false;var F=OpenLayers.Util.getElement(H);var D=F._eventCacheID;if(A=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||F.detachEvent){A="keydown"}}var J=false;var C=OpenLayers.Event.observers[D];if(C){var E=0;while(!J&&E<C.length){var I=C[E];if((I.name==A)&&(I.observer==G)&&(I.useCapture==B)){C.splice(E,1);if(C.length==0){delete OpenLayers.Event.observers[D]}J=true;break}E++}}if(J){if(F.removeEventListener){F.removeEventListener(A,G,B)}else{if(F&&F.detachEvent){F.detachEvent("on"+A,G)}}}return J},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var A in OpenLayers.Event.observers){var B=OpenLayers.Event.observers[A];OpenLayers.Event._removeElementObservers.apply(this,[B])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown"],listeners:null,object:null,element:null,eventHandler:null,fallThrough:null,includeXY:false,extensions:null,extensionCount:null,clearMouseListener:null,initialize:function(B,C,E,D,A){OpenLayers.Util.extend(this,A);this.object=B;this.fallThrough=D;this.listeners={};this.extensions={};this.extensionCount={};if(C!=null){this.attachToElement(C)}},destroy:function(){for(var A in this.extensions){if(typeof this.extensions[A]!=="boolean"){this.extensions[A].destroy()}}this.extensions=null;if(this.element){OpenLayers.Event.stopObservingElement(this.element);if(this.element.hasScrollEvent){OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)}}this.element=null;this.listeners=null;this.object=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(A){},attachToElement:function(C){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}else{this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this)}this.element=C;for(var B=0,A=this.BROWSER_EVENTS.length;B<A;B++){OpenLayers.Event.observe(C,this.BROWSER_EVENTS[B],this.eventHandler)}OpenLayers.Event.observe(C,"dragstart",OpenLayers.Event.stop)},on:function(A){for(var B in A){if(B!="scope"&&A.hasOwnProperty(B)){this.register(B,A.scope,A[B])}}},register:function(C,F,D,A){if(C in OpenLayers.Events&&!this.extensions[C]){this.extensions[C]=new OpenLayers.Events[C](this)}if(D!=null){if(F==null){F=this.object}var B=this.listeners[C];if(!B){B=[];this.listeners[C]=B;this.extensionCount[C]=0}var E={obj:F,func:D};if(A){B.splice(this.extensionCount[C],0,E);if(typeof A==="object"&&A.extension){this.extensionCount[C]++}}else{B.push(E)}}},registerPriority:function(A,C,B){this.register(A,C,B,true)},un:function(A){for(var B in A){if(B!="scope"&&A.hasOwnProperty(B)){this.unregister(B,A.scope,A[B])}}},unregister:function(D,F,E){if(F==null){F=this.object}var C=this.listeners[D];if(C!=null){for(var B=0,A=C.length;B<A;B++){if(C[B].obj==F&&C[B].func==E){C.splice(B,1);break}}}},remove:function(A){if(this.listeners[A]!=null){this.listeners[A]=[]}},triggerEvent:function(E,B){var D=this.listeners[E];if(!D||D.length==0){return undefined}if(B==null){B={}}B.object=this.object;B.element=this.element;if(!B.type){B.type=E}D=D.slice();var F;for(var C=0,A=D.length;C<A;C++){var G=D[C];F=G.func.apply(G.obj,[B]);if((F!=undefined)&&(F==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(B,true)}return F},handleBrowserEvent:function(I){var E=I.type,F=this.listeners[E];if(!F||F.length==0){return }var C=I.touches;if(C&&C[0]){var H=0;var G=0;var D=C.length;var B;for(var A=0;A<D;++A){B=C[A];H+=B.clientX;G+=B.clientY}I.clientX=H/D;I.clientY=G/D}if(this.includeXY){I.xy=this.getMousePosition(I)}this.triggerEvent(E,I)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;var A=document.body;if(A&&!((A.scrollTop!=0||A.scrollLeft!=0)&&navigator.userAgent.match(/iPhone/i))){this.element.offsets=null}},getMousePosition:function(A){if(!this.includeXY){this.clearMouseCache()}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",this.clearMouseListener);this.element.hasScrollEvent=true}}if(!this.element.scrolls){var B=OpenLayers.Util.getViewportElement();this.element.scrolls=[B.scrollLeft,B.scrollTop]}if(!this.element.lefttop){this.element.lefttop=[(document.documentElement.clientLeft||0),(document.documentElement.clientTop||0)]}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element)}return new OpenLayers.Pixel((A.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(A.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.ProxyHost="";OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new OpenLayers.Events(this),makeSameOrigin:function(B,C){var F=B.indexOf("http")!==0;var G=!F&&B.match(this.URL_SPLIT_REGEX);if(G){var A=window.location;F=G[1]==A.protocol&&G[3]==A.hostname;var D=G[4],E=A.port;if(D!=80&&D!=""||E!="80"&&E!=""){F=F&&D==E}}if(!F){if(C){if(typeof C=="function"){B=C(B)}else{B=C+encodeURIComponent(B)}}else{OpenLayers.Console.warn(OpenLayers.i18n("proxyNeeded"),{url:B})}}return B},issue:function(B){var D=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});B=OpenLayers.Util.applyDefaults(B,D);var G=false,E;for(E in B.headers){if(B.headers.hasOwnProperty(E)){if(E.toLowerCase()==="x-requested-with"){G=true}}}if(G===false){B.headers["X-Requested-With"]="XMLHttpRequest"}var C=new OpenLayers.Request.XMLHttpRequest();var A=OpenLayers.Util.urlAppend(B.url,OpenLayers.Util.getParameterString(B.params||{}));A=OpenLayers.Request.makeSameOrigin(A,B.proxy);C.open(B.method,A,B.async,B.user,B.password);for(var F in B.headers){C.setRequestHeader(F,B.headers[F])}var I=this.events;var H=this;C.onreadystatechange=function(){if(C.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var J=I.triggerEvent("complete",{request:C,config:B,requestUrl:A});if(J!==false){H.runCallbacks({request:C,config:B,requestUrl:A})}}};if(B.async===false){C.send(B.data)}else{window.setTimeout(function(){if(C.readyState!==0){C.send(B.data)}},0)}return C},runCallbacks:function(D){var E=D.request;var C=D.config;var A=(C.scope)?OpenLayers.Function.bind(C.callback,C.scope):C.callback;var F;if(C.success){F=(C.scope)?OpenLayers.Function.bind(C.success,C.scope):C.success}var B;if(C.failure){B=(C.scope)?OpenLayers.Function.bind(C.failure,C.scope):C.failure}if(OpenLayers.Util.createUrlObject(C.url).protocol=="file:"&&E.responseText){E.status=200}A(E);if(!E.status||(E.status>=200&&E.status<300)){this.events.triggerEvent("success",D);if(F){F(E)}}if(E.status&&(E.status<200||E.status>=300)){this.events.triggerEvent("failure",D);if(B){B(E)}}},GET:function(A){A=OpenLayers.Util.extend(A,{method:"GET"});return OpenLayers.Request.issue(A)},POST:function(A){A=OpenLayers.Util.extend(A,{method:"POST"});A.headers=A.headers?A.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(A.headers))){A.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(A)},PUT:function(A){A=OpenLayers.Util.extend(A,{method:"PUT"});A.headers=A.headers?A.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(A.headers))){A.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(A)},DELETE:function(A){A=OpenLayers.Util.extend(A,{method:"DELETE"});return OpenLayers.Request.issue(A)},HEAD:function(A){A=OpenLayers.Util.extend(A,{method:"HEAD"});return OpenLayers.Request.issue(A)},OPTIONS:function(A){A=OpenLayers.Util.extend(A,{method:"OPTIONS"});return OpenLayers.Request.issue(A)}};(function(){var G=window.XMLHttpRequest;var A=!!window.controllers,J=window.document.all&&!window.opera,K=J&&window.navigator.userAgent.match(/MSIE 7.0/);function D(){this._object=G&&!K?new G:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function C(){return new D}C.prototype=D.prototype;if(A&&G.wrapped){C.wrapped=G.wrapped}C.UNSENT=0;C.OPENED=1;C.HEADERS_RECEIVED=2;C.LOADING=3;C.DONE=4;C.prototype.readyState=C.UNSENT;C.prototype.responseText="";C.prototype.responseXML=null;C.prototype.status=0;C.prototype.statusText="";C.prototype.priority="NORMAL";C.prototype.onreadystatechange=null;C.onreadystatechange=null;C.onopen=null;C.onsend=null;C.onabort=null;C.prototype.open=function(O,R,N,S,M){delete this._headers;if(arguments.length<3){N=true}this._async=N;var Q=this,P=this.readyState,L;if(J&&N){L=function(){if(P!=C.DONE){E(Q);Q.abort()}};window.attachEvent("onunload",L)}if(C.onopen){C.onopen.apply(this,arguments)}if(arguments.length>4){this._object.open(O,R,N,S,M)}else{if(arguments.length>3){this._object.open(O,R,N,S)}else{this._object.open(O,R,N)}}this.readyState=C.OPENED;B(this);this._object.onreadystatechange=function(){if(A&&!N){return }Q.readyState=Q._object.readyState;H(Q);if(Q._aborted){Q.readyState=C.UNSENT;return }if(Q.readyState==C.DONE){delete Q._data;E(Q);if(J&&N){window.detachEvent("onunload",L)}}if(P!=Q.readyState){B(Q)}P=Q.readyState}};function F(L){L._object.send(L._data);if(A&&!L._async){L.readyState=C.OPENED;H(L);while(L.readyState<C.DONE){L.readyState++;B(L);if(L._aborted){return }}}}C.prototype.send=function(L){if(C.onsend){C.onsend.apply(this,arguments)}if(!arguments.length){L=null}if(L&&L.nodeType){L=window.XMLSerializer?new window.XMLSerializer().serializeToString(L):L.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._data=L;F(this)};C.prototype.abort=function(){if(C.onabort){C.onabort.apply(this,arguments)}if(this.readyState>C.UNSENT){this._aborted=true}this._object.abort();E(this);this.readyState=C.UNSENT;delete this._data};C.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};C.prototype.getResponseHeader=function(L){return this._object.getResponseHeader(L)};C.prototype.setRequestHeader=function(L,M){if(!this._headers){this._headers={}}this._headers[L]=M;return this._object.setRequestHeader(L,M)};C.prototype.addEventListener=function(O,N,M){for(var L=0,P;P=this._listeners[L];L++){if(P[0]==O&&P[1]==N&&P[2]==M){return }}this._listeners.push([O,N,M])};C.prototype.removeEventListener=function(O,N,M){for(var L=0,P;P=this._listeners[L];L++){if(P[0]==O&&P[1]==N&&P[2]==M){break}}if(P){this._listeners.splice(L,1)}};C.prototype.dispatchEvent=function(M){var N={type:M.type,target:this,currentTarget:this,eventPhase:2,bubbles:M.bubbles,cancelable:M.cancelable,timeStamp:M.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};if(N.type=="readystatechange"&&this.onreadystatechange){(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[N])}for(var L=0,O;O=this._listeners[L];L++){if(O[0]==N.type&&!O[2]){(O[1].handleEvent||O[1]).apply(this,[N])}}};C.prototype.toString=function(){return"[object XMLHttpRequest]"};C.toString=function(){return"[XMLHttpRequest]"};function B(L){if(C.onreadystatechange){C.onreadystatechange.apply(L)}L.dispatchEvent({type:"readystatechange",bubbles:false,cancelable:false,timeStamp:new Date+0})}function I(N){var M=N.responseXML,L=N.responseText;if(J&&L&&M&&!M.documentElement&&N.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){M=new window.ActiveXObject("Microsoft.XMLDOM");M.async=false;M.validateOnParse=false;M.loadXML(L)}if(M){if((J&&M.parseError!=0)||!M.documentElement||(M.documentElement&&M.documentElement.tagName=="parsererror")){return null}}return M}function H(L){try{L.responseText=L._object.responseText}catch(M){}try{L.responseXML=I(L._object)}catch(M){}try{L.status=L._object.status}catch(M){}try{L.statusText=L._object.statusText}catch(M){}}function E(L){L._object.onreadystatechange=new window.Function}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(L,M){if(!M){M=[]}L.__func=this;L.__func(M[0],M[1],M[2],M[3],M[4]);delete L.__func}}OpenLayers.Request.XMLHttpRequest=C})();OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(B,A){OpenLayers.Util.extend(this,A);this.projCode=B;if(window.Proj4js){this.proj=new Proj4js.Proj(B)}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(A){var E=A,B=false;if(E){if(!(E instanceof OpenLayers.Projection)){E=new OpenLayers.Projection(E)}if(window.Proj4js&&this.proj.defData&&E.proj.defData){B=this.proj.defData.replace(this.titleRegEx,"")==E.proj.defData.replace(this.titleRegEx,"")}else{if(E.getCode){var C=this.getCode(),D=E.getCode();B=C==D||!!OpenLayers.Projection.transforms[C]&&OpenLayers.Projection.transforms[C][D]===OpenLayers.Projection.nullTransform}}}return B},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:true},"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(D,C,B){if(B===OpenLayers.Projection.nullTransform){var A=OpenLayers.Projection.defaults[D];if(A&&!OpenLayers.Projection.defaults[C]){OpenLayers.Projection.defaults[C]=A}}if(!OpenLayers.Projection.transforms[D]){OpenLayers.Projection.transforms[D]={}}OpenLayers.Projection.transforms[D][C]=B};OpenLayers.Projection.transform=function(A,E,B){if(E&&B){if(!(E instanceof OpenLayers.Projection)){E=new OpenLayers.Projection(E)}if(!(B instanceof OpenLayers.Projection)){B=new OpenLayers.Projection(B)}if(E.proj&&B.proj){A=Proj4js.transform(E.proj,B.proj,A)}else{var D=E.getCode();var F=B.getCode();var C=OpenLayers.Projection.transforms;if(C[D]&&C[D][F]){C[D][F](A)}}}return A};OpenLayers.Projection.nullTransform=function(A){return A};(function(){var E=20037508.34;function G(H){H.x=180*H.x/E;H.y=180/Math.PI*(2*Math.atan(Math.exp((H.y/E)*Math.PI))-Math.PI/2);return H}function B(H){H.x=H.x*E/180;H.y=Math.log(Math.tan((90+H.y)*Math.PI/360))/Math.PI*E;return H}function F(I,H){var P=OpenLayers.Projection.addTransform;var O=OpenLayers.Projection.nullTransform;var L,M,J,N,K;for(L=0,M=H.length;L<M;++L){J=H[L];P(I,J,B);P(J,I,G);for(K=L+1;K<M;++K){N=H[K];P(J,N,O);P(N,J,O)}}}var A=["EPSG:900913","EPSG:3857","EPSG:102113","EPSG:102100"],D=["CRS:84","urn:ogc:def:crs:EPSG:6.6:4326","EPSG:4326"],C;for(C=A.length-1;C>=0;--C){F(A[C],D)}for(C=D.length-1;C>=0;--C){F(D[C],A)}})();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:true,kvpAttributes:false,extractStyles:false,extractTracks:false,trackAttributes:null,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(A){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g),kmlColor:(/(\w{2})(\w{2})(\w{2})(\w{2})/),kmlIconPalette:(/root:\/\/icons\/palette-(\d+)(\.\w+)/),straightBracket:(/\$\[(.*?)\]/g)};this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(B){this.features=[];this.styles={};this.fetched={};var A={depth:0,styleBaseUrl:this.styleBaseUrl};return this.parseData(B,A)},parseData:function(G,C){if(typeof G=="string"){G=OpenLayers.Format.XML.prototype.read.apply(this,[G])}var E=["Link","NetworkLink","Style","StyleMap","Placemark"];for(var D=0,A=E.length;D<A;++D){var F=E[D];var B=this.getElementsByTagNameNS(G,"*",F);if(B.length==0){continue}switch(F.toLowerCase()){case"link":case"networklink":this.parseLinks(B,C);break;case"style":if(this.extractStyles){this.parseStyles(B,C)}break;case"stylemap":if(this.extractStyles){this.parseStyleMaps(B,C)}break;case"placemark":this.parseFeatures(B,C);break}}return this.features},parseLinks:function(C,D){if(D.depth>=this.maxDepth){return false}var G=OpenLayers.Util.extend({},D);G.depth++;for(var E=0,A=C.length;E<A;E++){var B=this.parseProperty(C[E],"*","href");if(B&&!this.fetched[B]){this.fetched[B]=true;var F=this.fetchLink(B);if(F){this.parseData(F,G)}}}},fetchLink:function(A){var B=OpenLayers.Request.GET({url:A,async:false});if(B){return B.responseText}},parseStyles:function(B,C){for(var E=0,A=B.length;E<A;E++){var F=this.parseStyle(B[E]);if(F){var D=(C.styleBaseUrl||"")+"#"+F.id;this.styles[D]=F}}},parseKmlColor:function(B){var A=null;if(B){var C=B.match(this.regExes.kmlColor);if(C){A={color:"#"+C[4]+C[3]+C[2],opacity:parseInt(C[1],16)/255}}}return A},parseStyle:function(V){var d={};var P=["LineStyle","PolyStyle","IconStyle","BalloonStyle","LabelStyle"];var E,J,g,G,D;for(var a=0,c=P.length;a<c;++a){E=P[a];J=this.getElementsByTagNameNS(V,"*",E)[0];if(!J){continue}switch(E.toLowerCase()){case"linestyle":var C=this.parseProperty(J,"*","color");var X=this.parseKmlColor(C);if(X){d.strokeColor=X.color;d.strokeOpacity=X.opacity}var U=this.parseProperty(J,"*","width");if(U){d.strokeWidth=U}break;case"polystyle":var C=this.parseProperty(J,"*","color");var X=this.parseKmlColor(C);if(X){d.fillOpacity=X.opacity;d.fillColor=X.color}var Y=this.parseProperty(J,"*","fill");if(Y=="0"){d.fillColor="none"}var H=this.parseProperty(J,"*","outline");if(H=="0"){d.strokeWidth="0"}break;case"iconstyle":var k=parseFloat(this.parseProperty(J,"*","scale")||1);var U=32*k;var S=32*k;var j=this.getElementsByTagNameNS(J,"*","Icon")[0];if(j){var Z=this.parseProperty(j,"*","href");if(Z){var O=this.parseProperty(j,"*","w");var b=this.parseProperty(j,"*","h");var F="http://maps.google.com/mapfiles/kml";if(OpenLayers.String.startsWith(Z,F)&&!O&&!b){O=64;b=64;k=k/2}O=O||b;b=b||O;if(O){U=parseInt(O)*k}if(b){S=parseInt(b)*k}var B=Z.match(this.regExes.kmlIconPalette);if(B){var e=B[1];var R=B[2];var N=this.parseProperty(j,"*","x");var M=this.parseProperty(j,"*","y");var L=N?N/32:0;var K=M?(7-M/32):7;var I=K*8+L;Z="http://maps.google.com/mapfiles/kml/pal"+e+"/icon"+I+R}d.graphicOpacity=1;d.externalGraphic=Z}}var Q=this.getElementsByTagNameNS(J,"*","hotSpot")[0];if(Q){var N=parseFloat(Q.getAttribute("x"));var M=parseFloat(Q.getAttribute("y"));var W=Q.getAttribute("xunits");if(W=="pixels"){d.graphicXOffset=-N*k}else{if(W=="insetPixels"){d.graphicXOffset=-U+(N*k)}else{if(W=="fraction"){d.graphicXOffset=-U*N}}}var f=Q.getAttribute("yunits");if(f=="pixels"){d.graphicYOffset=-S+(M*k)+1}else{if(f=="insetPixels"){d.graphicYOffset=-(M*k)+1}else{if(f=="fraction"){d.graphicYOffset=-S*(1-M)+1}}}}d.graphicWidth=U;d.graphicHeight=S;break;case"balloonstyle":var A=OpenLayers.Util.getXmlNodeValue(J);if(A){d.balloonStyle=A.replace(this.regExes.straightBracket,"${$1}")}break;case"labelstyle":var C=this.parseProperty(J,"*","color");var X=this.parseKmlColor(C);if(X){d.fontColor=X.color;d.fontOpacity=X.opacity}break;default:}}if(!d.strokeColor&&d.fillColor){d.strokeColor=d.fillColor}var T=V.getAttribute("id");if(T&&d){d.id=T}return d},parseStyleMaps:function(A,L){for(var G=0,H=A.length;G<H;G++){var D=A[G];var C=this.getElementsByTagNameNS(D,"*","Pair");var B=D.getAttribute("id");for(var F=0,K=C.length;F<K;F++){var E=C[F];var J=this.parseProperty(E,"*","key");var I=this.parseProperty(E,"*","styleUrl");if(I&&J=="normal"){this.styles[(L.styleBaseUrl||"")+"#"+B]=this.styles[(L.styleBaseUrl||"")+I]}}}},parseFeatures:function(B,L){var F=[];for(var G=0,H=B.length;G<H;G++){var C=B[G];var K=this.parseFeature.apply(this,[C]);if(K){if(this.extractStyles&&K.attributes&&K.attributes.styleUrl){K.style=this.getStyle(K.attributes.styleUrl,L)}if(this.extractStyles){var J=this.getElementsByTagNameNS(C,"*","Style")[0];if(J){var E=this.parseStyle(J);if(E){K.style=OpenLayers.Util.extend(K.style,E)}}}if(this.extractTracks){var I=this.getElementsByTagNameNS(C,this.namespaces.gx,"Track");if(I&&I.length>0){var D=I[0];var A={features:[],feature:K};this.readNode(D,A);if(A.features.length>0){F.push.apply(F,A.features)}}}else{F.push(K)}}else{throw"Bad Placemark: "+G}}this.features=this.features.concat(F)},readers:{kml:{when:function(B,A){A.whens.push(OpenLayers.Date.parse(this.getChildValue(B)))},_trackPointAttribute:function(C,A){var B=C.nodeName.split(":").pop();A.attributes[B].push(this.getChildValue(C))}},gx:{Track:function(C,B){var E={whens:[],points:[],angles:[]};if(this.trackAttributes){var A;E.attributes={};for(var F=0,K=this.trackAttributes.length;F<K;++F){A=this.trackAttributes[F];E.attributes[A]=[];if(!(A in this.readers.kml)){this.readers.kml[A]=this.readers.kml._trackPointAttribute}}}this.readChildNodes(C,E);if(E.whens.length!==E.points.length){throw new Error("gx:Track with unequal number of when ("+E.whens.length+") and gx:coord ("+E.points.length+") elements.")}var I=E.angles.length>0;if(I&&E.whens.length!==E.angles.length){throw new Error("gx:Track with unequal number of when ("+E.whens.length+") and gx:angles ("+E.angles.length+") elements.")}var L,J,H;for(var F=0,K=E.whens.length;F<K;++F){L=B.feature.clone();L.fid=B.feature.fid||B.feature.id;J=E.points[F];L.geometry=J;if("z" in J){L.attributes.altitude=J.z}if(this.internalProjection&&this.externalProjection){L.geometry.transform(this.externalProjection,this.internalProjection)}if(this.trackAttributes){for(var D=0,G=this.trackAttributes.length;D<G;++D){L.attributes[A]=E.attributes[this.trackAttributes[D]][F]}}L.attributes.when=E.whens[F];L.attributes.trackId=B.feature.id;if(I){H=E.angles[F];L.attributes.heading=parseFloat(H[0]);L.attributes.tilt=parseFloat(H[1]);L.attributes.roll=parseFloat(H[2])}B.features.push(L)}},coord:function(C,B){var E=this.getChildValue(C);var D=E.replace(this.regExes.trimSpace,"").split(/\s+/);var A=new OpenLayers.Geometry.Point(D[0],D[1]);if(D.length>2){A.z=parseFloat(D[2])}B.points.push(A)},angles:function(B,A){var D=this.getChildValue(B);var C=D.replace(this.regExes.trimSpace,"").split(/\s+/);A.angles.push(C)}}},parseFeature:function(B){var C=["MultiGeometry","Polygon","LineString","Point"];var I,E,J,A;for(var G=0,H=C.length;G<H;++G){I=C[G];this.internalns=B.namespaceURI?B.namespaceURI:this.kmlns;E=this.getElementsByTagNameNS(B,this.internalns,I);if(E.length>0){var A=this.parseGeometry[I.toLowerCase()];if(A){J=A.apply(this,[E[0]]);if(this.internalProjection&&this.externalProjection){J.transform(this.externalProjection,this.internalProjection)}}else{throw new TypeError("Unsupported geometry type: "+I)}break}}var F;if(this.extractAttributes){F=this.parseAttributes(B)}var K=new OpenLayers.Feature.Vector(J,F);var D=B.getAttribute("id")||B.getAttribute("name");if(D!=null){K.fid=D}return K},getStyle:function(B,A){var C=OpenLayers.Util.removeTail(B);var F=OpenLayers.Util.extend({},A);F.depth++;F.styleBaseUrl=C;if(!this.styles[B]&&!OpenLayers.String.startsWith(B,"#")&&F.depth<=this.maxDepth&&!this.fetched[C]){var E=this.fetchLink(C);if(E){this.parseData(E,F)}}var D=OpenLayers.Util.extend({},this.styles[B]);return D},parseGeometry:{point:function(D){var C=this.getElementsByTagNameNS(D,this.internalns,"coordinates");var E=[];if(C.length>0){var B=C[0].firstChild.nodeValue;B=B.replace(this.regExes.removeSpace,"");E=B.split(",")}var A=null;if(E.length>1){if(E.length==2){E[2]=null}A=new OpenLayers.Geometry.Point(E[0],E[1],E[2])}else{throw"Bad coordinate string: "+B}return A},linestring:function(C,E){var D=this.getElementsByTagNameNS(C,this.internalns,"coordinates");var K=null;if(D.length>0){var B=this.getChildValue(D[0]);B=B.replace(this.regExes.trimSpace,"");B=B.replace(this.regExes.trimComma,",");var A=B.split(this.regExes.splitSpace);var H=A.length;var J=new Array(H);var I,G;for(var F=0;F<H;++F){I=A[F].split(",");G=I.length;if(G>1){if(I.length==2){I[2]=null}J[F]=new OpenLayers.Geometry.Point(I[0],I[1],I[2])}else{throw"Bad LineString point coordinates: "+A[F]}}if(H){if(E){K=new OpenLayers.Geometry.LinearRing(J)}else{K=new OpenLayers.Geometry.LineString(J)}}else{throw"Bad LineString coordinates: "+B}}return K},polygon:function(F){var C=this.getElementsByTagNameNS(F,this.internalns,"LinearRing");var G=C.length;var E=new Array(G);if(G>0){var B;for(var D=0,A=C.length;D<A;++D){B=this.parseGeometry.linestring.apply(this,[C[D],true]);if(B){E[D]=B}else{throw"Bad LinearRing geometry: "+D}}}return new OpenLayers.Geometry.Polygon(E)},multigeometry:function(E){var H,G;var F=[];var C=E.childNodes;for(var B=0,A=C.length;B<A;++B){H=C[B];if(H.nodeType==1){var D=(H.prefix)?H.nodeName.split(":")[1]:H.nodeName;var G=this.parseGeometry[D.toLowerCase()];if(G){F.push(G.apply(this,[H]))}}}return new OpenLayers.Geometry.Collection(F)}},parseAttributes:function(D){var F={};var H=D.getElementsByTagName("ExtendedData");if(H.length){F=this.parseExtendedData(H[0])}var B,M,L;var C=D.childNodes;for(var I=0,J=C.length;I<J;++I){B=C[I];if(B.nodeType==1){M=B.childNodes;if(M.length>=1&&M.length<=3){var L;switch(M.length){case 1:L=M[0];break;case 2:var G=M[0];var E=M[1];L=(G.nodeType==3||G.nodeType==4)?G:E;break;case 3:default:L=M[1];break}if(L.nodeType==3||L.nodeType==4){var A=(B.prefix)?B.nodeName.split(":")[1]:B.nodeName;var K=OpenLayers.Util.getXmlNodeValue(L);if(K){K=K.replace(this.regExes.trimSpace,"");F[A]=K}}}}}return F},parseExtendedData:function(B){var D={};var F,H,E,J;var C=B.getElementsByTagName("Data");for(F=0,H=C.length;F<H;F++){E=C[F];J=E.getAttribute("name");var G={};var K=E.getElementsByTagName("value");if(K.length){G.value=this.getChildValue(K[0])}if(this.kvpAttributes){D[J]=G.value}else{var A=E.getElementsByTagName("displayName");if(A.length){G.displayName=this.getChildValue(A[0])}D[J]=G}}var I=B.getElementsByTagName("SimpleData");for(F=0,H=I.length;F<H;F++){var G={};E=I[F];J=E.getAttribute("name");G.value=this.getChildValue(E);if(this.kvpAttributes){D[J]=G.value}else{G.displayName=J;D[J]=G}}return D},parseProperty:function(C,D,B){var E;var A=this.getElementsByTagNameNS(C,D,B);try{E=OpenLayers.Util.getXmlNodeValue(A[0])}catch(F){E=null}return E},write:function(D){if(!(OpenLayers.Util.isArray(D))){D=[D]}var B=this.createElementNS(this.kmlns,"kml");var E=this.createFolderXML();for(var C=0,A=D.length;C<A;++C){E.appendChild(this.createPlacemarkXML(D[C]))}B.appendChild(E);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},createFolderXML:function(){var C=this.createElementNS(this.kmlns,"Folder");if(this.foldersName){var E=this.createElementNS(this.kmlns,"name");var D=this.createTextNode(this.foldersName);E.appendChild(D);C.appendChild(E)}if(this.foldersDesc){var A=this.createElementNS(this.kmlns,"description");var B=this.createTextNode(this.foldersDesc);A.appendChild(B);C.appendChild(A)}return C},createPlacemarkXML:function(E){var H=this.createElementNS(this.kmlns,"name");var C=E.style&&E.style.label?E.style.label:E.attributes.name||E.id;H.appendChild(this.createTextNode(C));var D=this.createElementNS(this.kmlns,"description");var G=E.attributes.description||this.placemarksDesc;D.appendChild(this.createTextNode(G));var B=this.createElementNS(this.kmlns,"Placemark");if(E.fid!=null){B.setAttribute("id",E.fid)}B.appendChild(H);B.appendChild(D);var A=this.buildGeometryNode(E.geometry);B.appendChild(A);if(E.attributes){var F=this.buildExtendedData(E.attributes);if(F){B.appendChild(F)}}return B},buildGeometryNode:function(E){var C=E.CLASS_NAME;var B=C.substring(C.lastIndexOf(".")+1);var A=this.buildGeometry[B.toLowerCase()];var D=null;if(A){D=A.apply(this,[E])}return D},buildGeometry:{point:function(B){var A=this.createElementNS(this.kmlns,"Point");A.appendChild(this.buildCoordinatesNode(B));return A},multipoint:function(A){return this.buildGeometry.collection.apply(this,[A])},linestring:function(B){var A=this.createElementNS(this.kmlns,"LineString");A.appendChild(this.buildCoordinatesNode(B));return A},multilinestring:function(A){return this.buildGeometry.collection.apply(this,[A])},linearring:function(B){var A=this.createElementNS(this.kmlns,"LinearRing");A.appendChild(this.buildCoordinatesNode(B));return A},polygon:function(H){var B=this.createElementNS(this.kmlns,"Polygon");var G=H.components;var E,F,D;for(var C=0,A=G.length;C<A;++C){D=(C==0)?"outerBoundaryIs":"innerBoundaryIs";E=this.createElementNS(this.kmlns,D);F=this.buildGeometry.linearring.apply(this,[G[C]]);E.appendChild(F);B.appendChild(E)}return B},multipolygon:function(A){return this.buildGeometry.collection.apply(this,[A])},collection:function(D){var B=this.createElementNS(this.kmlns,"MultiGeometry");var E;for(var C=0,A=D.components.length;C<A;++C){E=this.buildGeometryNode.apply(this,[D.components[C]]);if(E){B.appendChild(E)}}return B}},buildCoordinatesNode:function(E){var A=this.createElementNS(this.kmlns,"coordinates");var I;var H=E.components;if(H){var G;var F=H.length;var C=new Array(F);for(var D=0;D<F;++D){G=H[D];C[D]=this.buildCoordinates(G)}I=C.join(" ")}else{I=this.buildCoordinates(E)}var B=this.createTextNode(I);A.appendChild(B);return A},buildCoordinates:function(A){if(this.internalProjection&&this.externalProjection){A=A.clone();A.transform(this.internalProjection,this.externalProjection)}return A.x+","+A.y},buildExtendedData:function(B){var D=this.createElementNS(this.kmlns,"ExtendedData");for(var C in B){if(B[C]&&C!="name"&&C!="description"&&C!="styleUrl"){var F=this.createElementNS(this.kmlns,"Data");F.setAttribute("name",C);var E=this.createElementNS(this.kmlns,"value");if(typeof B[C]=="object"){if(B[C].value){E.appendChild(this.createTextNode(B[C].value))}if(B[C].displayName){var A=this.createElementNS(this.kmlns,"displayName");A.appendChild(this.getXMLDoc().createCDATASection(B[C].displayName));F.appendChild(A)}}else{E.appendChild(this.createTextNode(B[C]))}F.appendChild(E);D.appendChild(F)}}if(this.isSimpleContent(D)){return null}else{return D}},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],split:function(K,P){var G=null;var O=P&&P.mutual;var L,A,N,J,B;var E=[];var M=[K];for(var F=0,H=this.components.length;F<H;++F){A=this.components[F];J=false;for(var D=0;D<M.length;++D){L=A.split(M[D],P);if(L){if(O){N=L[0];for(var C=0,I=N.length;C<I;++C){if(C===0&&E.length){E[E.length-1].addComponent(N[C])}else{E.push(new OpenLayers.Geometry.MultiLineString([N[C]]))}}J=true;L=L[1]}if(L.length){L.unshift(D,1);Array.prototype.splice.apply(M,L);break}}}if(!J){if(E.length){E[E.length-1].addComponent(A.clone())}else{E=[new OpenLayers.Geometry.MultiLineString(A.clone())]}}}if(E&&E.length>1){J=true}else{E=[]}if(M&&M.length>1){B=true}else{M=[]}if(J||B){if(O){G=[E,M]}else{G=M}}return G},splitWith:function(K,P){var G=null;var O=P&&P.mutual;var L,C,N,J,A,E,M;if(K instanceof OpenLayers.Geometry.LineString){M=[];E=[K];for(var F=0,H=this.components.length;F<H;++F){A=false;C=this.components[F];for(var D=0;D<E.length;++D){L=E[D].split(C,P);if(L){if(O){N=L[0];if(N.length){N.unshift(D,1);Array.prototype.splice.apply(E,N);D+=N.length-2}L=L[1];if(L.length===0){L=[C.clone()]}}for(var B=0,I=L.length;B<I;++B){if(B===0&&M.length){M[M.length-1].addComponent(L[B])}else{M.push(new OpenLayers.Geometry.MultiLineString([L[B]]))}}A=true}}if(!A){if(M.length){M[M.length-1].addComponent(C.clone())}else{M=[new OpenLayers.Geometry.MultiLineString([C.clone()])]}}}}else{G=K.split(this)}if(E&&E.length>1){J=true}else{E=[]}if(M&&M.length>1){A=true}else{M=[]}if(J||A){if(O){G=[E,M]}else{G=M}}return G},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:true,xy:true,initialize:function(A){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(D){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var E=this.getElementsByTagNameNS(D.documentElement,this.gmlns,this.featureName);var C=[];for(var B=0;B<E.length;B++){var A=this.parseFeature(E[B]);if(A){C.push(A)}}return C},parseFeature:function(D){var E=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"];var O,H,P,C;for(var K=0;K<E.length;++K){O=E[K];H=this.getElementsByTagNameNS(D,this.gmlns,O);if(H.length>0){C=this.parseGeometry[O.toLowerCase()];if(C){P=C.apply(this,[H[0]]);if(this.internalProjection&&this.externalProjection){P.transform(this.externalProjection,this.internalProjection)}}else{throw new TypeError("Unsupported geometry type: "+O)}break}}var B;var J=this.getElementsByTagNameNS(D,this.gmlns,"Box");for(K=0;K<J.length;++K){var N=J[K];var M=this.parseGeometry.box.apply(this,[N]);var L=N.parentNode;var G=L.localName||L.nodeName.split(":").pop();if(G==="boundedBy"){B=M}else{P=M.toGeometry()}}var I;if(this.extractAttributes){I=this.parseAttributes(D)}var Q=new OpenLayers.Feature.Vector(P,I);Q.bounds=B;Q.gml={featureType:D.firstChild.nodeName.split(":")[1],featureNS:D.firstChild.namespaceURI,featureNSPrefix:D.firstChild.prefix};var A=D.firstChild;var F;while(A){if(A.nodeType==1){F=A.getAttribute("fid")||A.getAttribute("id");if(F){break}}A=A.nextSibling}Q.fid=F;return Q},parseGeometry:{point:function(D){var B,A;var E=[];var B=this.getElementsByTagNameNS(D,this.gmlns,"pos");if(B.length>0){A=B[0].firstChild.nodeValue;A=A.replace(this.regExes.trimSpace,"");E=A.split(this.regExes.splitSpace)}if(E.length==0){B=this.getElementsByTagNameNS(D,this.gmlns,"coordinates");if(B.length>0){A=B[0].firstChild.nodeValue;A=A.replace(this.regExes.removeSpace,"");E=A.split(",")}}if(E.length==0){B=this.getElementsByTagNameNS(D,this.gmlns,"coord");if(B.length>0){var F=this.getElementsByTagNameNS(B[0],this.gmlns,"X");var C=this.getElementsByTagNameNS(B[0],this.gmlns,"Y");if(F.length>0&&C.length>0){E=[F[0].firstChild.nodeValue,C[0].firstChild.nodeValue]}}}if(E.length==2){E[2]=null}if(this.xy){return new OpenLayers.Geometry.Point(E[0],E[1],E[2])}else{return new OpenLayers.Geometry.Point(E[1],E[0],E[2])}},multipoint:function(E){var B=this.getElementsByTagNameNS(E,this.gmlns,"Point");var D=[];if(B.length>0){var A;for(var C=0;C<B.length;++C){A=this.parseGeometry.point.apply(this,[B[C]]);if(A){D.push(A)}}}return new OpenLayers.Geometry.MultiPoint(D)},linestring:function(C,E){var D,B;var L=[];var M=[];D=this.getElementsByTagNameNS(C,this.gmlns,"posList");if(D.length>0){B=this.getChildValue(D[0]);B=B.replace(this.regExes.trimSpace,"");L=B.split(this.regExes.splitSpace);var H=parseInt(D[0].getAttribute("dimension"));var F,K,J,I;for(var G=0;G<L.length/H;++G){F=G*H;K=L[F];J=L[F+1];I=(H==2)?null:L[F+2];if(this.xy){M.push(new OpenLayers.Geometry.Point(K,J,I))}else{M.push(new OpenLayers.Geometry.Point(J,K,I))}}}if(L.length==0){D=this.getElementsByTagNameNS(C,this.gmlns,"coordinates");if(D.length>0){B=this.getChildValue(D[0]);B=B.replace(this.regExes.trimSpace,"");B=B.replace(this.regExes.trimComma,",");var A=B.split(this.regExes.splitSpace);for(var G=0;G<A.length;++G){L=A[G].split(",");if(L.length==2){L[2]=null}if(this.xy){M.push(new OpenLayers.Geometry.Point(L[0],L[1],L[2]))}else{M.push(new OpenLayers.Geometry.Point(L[1],L[0],L[2]))}}}}var N=null;if(M.length!=0){if(E){N=new OpenLayers.Geometry.LinearRing(M)}else{N=new OpenLayers.Geometry.LineString(M)}}return N},multilinestring:function(E){var B=this.getElementsByTagNameNS(E,this.gmlns,"LineString");var D=[];if(B.length>0){var A;for(var C=0;C<B.length;++C){A=this.parseGeometry.linestring.apply(this,[B[C]]);if(A){D.push(A)}}}return new OpenLayers.Geometry.MultiLineString(D)},polygon:function(E){var B=this.getElementsByTagNameNS(E,this.gmlns,"LinearRing");var D=[];if(B.length>0){var A;for(var C=0;C<B.length;++C){A=this.parseGeometry.linestring.apply(this,[B[C],true]);if(A){D.push(A)}}}return new OpenLayers.Geometry.Polygon(D)},multipolygon:function(E){var A=this.getElementsByTagNameNS(E,this.gmlns,"Polygon");var D=[];if(A.length>0){var C;for(var B=0;B<A.length;++B){C=this.parseGeometry.polygon.apply(this,[A[B]]);if(C){D.push(C)}}}return new OpenLayers.Geometry.MultiPolygon(D)},envelope:function(B){var E=[];var A;var F;var J=this.getElementsByTagNameNS(B,this.gmlns,"lowerCorner");if(J.length>0){var H=[];if(J.length>0){A=J[0].firstChild.nodeValue;A=A.replace(this.regExes.trimSpace,"");H=A.split(this.regExes.splitSpace)}if(H.length==2){H[2]=null}if(this.xy){var D=new OpenLayers.Geometry.Point(H[0],H[1],H[2])}else{var D=new OpenLayers.Geometry.Point(H[1],H[0],H[2])}}var G=this.getElementsByTagNameNS(B,this.gmlns,"upperCorner");if(G.length>0){var H=[];if(G.length>0){A=G[0].firstChild.nodeValue;A=A.replace(this.regExes.trimSpace,"");H=A.split(this.regExes.splitSpace)}if(H.length==2){H[2]=null}if(this.xy){var I=new OpenLayers.Geometry.Point(H[0],H[1],H[2])}else{var I=new OpenLayers.Geometry.Point(H[1],H[0],H[2])}}if(D&&I){E.push(new OpenLayers.Geometry.Point(D.x,D.y));E.push(new OpenLayers.Geometry.Point(I.x,D.y));E.push(new OpenLayers.Geometry.Point(I.x,I.y));E.push(new OpenLayers.Geometry.Point(D.x,I.y));E.push(new OpenLayers.Geometry.Point(D.x,D.y));var C=new OpenLayers.Geometry.LinearRing(E);F=new OpenLayers.Geometry.Polygon([C])}return F},box:function(E){var C=this.getElementsByTagNameNS(E,this.gmlns,"coordinates");var B;var F,A=null,D=null;if(C.length>0){B=C[0].firstChild.nodeValue;F=B.split(" ");if(F.length==2){A=F[0].split(",");D=F[1].split(",")}}if(A!==null&&D!==null){return new OpenLayers.Bounds(parseFloat(A[0]),parseFloat(A[1]),parseFloat(D[0]),parseFloat(D[1]))}}},parseAttributes:function(E){var F={};var A=E.firstChild;var D,G,C,J,I,B,H;while(A){if(A.nodeType==1){D=A.childNodes;for(G=0;G<D.length;++G){C=D[G];if(C.nodeType==1){J=C.childNodes;if(J.length==1){I=J[0];if(I.nodeType==3||I.nodeType==4){B=(C.prefix)?C.nodeName.split(":")[1]:C.nodeName;H=I.nodeValue.replace(this.regExes.trimSpace,"");F[B]=H}}else{F[C.nodeName.split(":").pop()]=null}}}break}A=A.nextSibling}return F},write:function(C){if(!(OpenLayers.Util.isArray(C))){C=[C]}var B=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName);for(var A=0;A<C.length;A++){B.appendChild(this.createFeatureXML(C[A]))}return OpenLayers.Format.XML.prototype.write.apply(this,[B])},createFeatureXML:function(J){var H=J.geometry;var E=this.buildGeometryNode(H);var I=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);I.appendChild(E);var A=this.createElementNS(this.gmlns,"gml:"+this.featureName);var K=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);var C=J.fid||J.id;K.setAttribute("fid",C);K.appendChild(I);for(var G in J.attributes){var F=this.createTextNode(J.attributes[G]);var D=G.substring(G.lastIndexOf(":")+1);var B=this.createElementNS(this.featureNS,this.featurePrefix+":"+D);B.appendChild(F);K.appendChild(B)}A.appendChild(K);return A},buildGeometryNode:function(D){if(this.externalProjection&&this.internalProjection){D=D.clone();D.transform(this.internalProjection,this.externalProjection)}var C=D.CLASS_NAME;var B=C.substring(C.lastIndexOf(".")+1);var A=this.buildGeometry[B.toLowerCase()];return A.apply(this,[D])},buildGeometry:{point:function(B){var A=this.createElementNS(this.gmlns,"gml:Point");A.appendChild(this.buildCoordinatesNode(B));return A},multipoint:function(F){var D=this.createElementNS(this.gmlns,"gml:MultiPoint");var C=F.components;var B,E;for(var A=0;A<C.length;A++){B=this.createElementNS(this.gmlns,"gml:pointMember");E=this.buildGeometry.point.apply(this,[C[A]]);B.appendChild(E);D.appendChild(B)}return D},linestring:function(B){var A=this.createElementNS(this.gmlns,"gml:LineString");A.appendChild(this.buildCoordinatesNode(B));return A},multilinestring:function(F){var D=this.createElementNS(this.gmlns,"gml:MultiLineString");var A=F.components;var C,E;for(var B=0;B<A.length;++B){C=this.createElementNS(this.gmlns,"gml:lineStringMember");E=this.buildGeometry.linestring.apply(this,[A[B]]);C.appendChild(E);D.appendChild(C)}return D},linearring:function(B){var A=this.createElementNS(this.gmlns,"gml:LinearRing");A.appendChild(this.buildCoordinatesNode(B));return A},polygon:function(G){var D=this.createElementNS(this.gmlns,"gml:Polygon");var F=G.components;var C,E,B;for(var A=0;A<F.length;++A){B=(A==0)?"outerBoundaryIs":"innerBoundaryIs";C=this.createElementNS(this.gmlns,"gml:"+B);E=this.buildGeometry.linearring.apply(this,[F[A]]);C.appendChild(E);D.appendChild(C)}return D},multipolygon:function(F){var D=this.createElementNS(this.gmlns,"gml:MultiPolygon");var A=F.components;var E,B;for(var C=0;C<A.length;++C){E=this.createElementNS(this.gmlns,"gml:polygonMember");B=this.buildGeometry.polygon.apply(this,[A[C]]);E.appendChild(B);D.appendChild(E)}return D},bounds:function(B){var A=this.createElementNS(this.gmlns,"gml:Box");A.appendChild(this.buildCoordinatesNode(B));return A}},buildCoordinatesNode:function(F){var A=this.createElementNS(this.gmlns,"gml:coordinates");A.setAttribute("decimal",".");A.setAttribute("cs",",");A.setAttribute("ts"," ");var E=[];if(F instanceof OpenLayers.Bounds){E.push(F.left+","+F.bottom);E.push(F.right+","+F.top)}else{var C=(F.components)?F.components:[F];for(var B=0;B<C.length;B++){E.push(C[B].x+","+C[B].y)}}var D=this.createTextNode(E.join(" "));A.appendChild(D);return A},CLASS_NAME:"OpenLayers.Format.GML"});if(!OpenLayers.Format.GML){OpenLayers.Format.GML={}}OpenLayers.Format.GML.Base=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs"},defaultPrefix:"gml",schemaLocation:null,featureType:null,featureNS:null,geometryName:"geometry",extractAttributes:true,srsName:null,xy:true,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g),featureMember:(/^(.*:)?featureMembers?$/)},initialize:function(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A]);this.setGeometryTypes();if(A&&A.featureNS){this.setNamespace("feature",A.featureNS)}this.singleFeatureType=!A||(typeof A.featureType==="string")},read:function(E){if(typeof E=="string"){E=OpenLayers.Format.XML.prototype.read.apply(this,[E])}if(E&&E.nodeType==9){E=E.documentElement}var C=[];this.readNode(E,{features:C},true);if(C.length==0){var D=this.getElementsByTagNameNS(E,this.namespaces.gml,"featureMember");if(D.length){for(var B=0,A=D.length;B<A;++B){this.readNode(D[B],{features:C},true)}}else{var D=this.getElementsByTagNameNS(E,this.namespaces.gml,"featureMembers");if(D.length){this.readNode(D[0],{features:C},true)}}}return C},readNode:function(A,B,C){if(C===true&&this.autoConfig===true){this.featureType=null;delete this.namespaceAlias[this.featureNS];delete this.namespaces.feature;this.featureNS=null}if(!this.featureNS&&(!(A.prefix in this.namespaces)&&A.parentNode.namespaceURI==this.namespaces.gml&&this.regExes.featureMember.test(A.parentNode.nodeName))){this.featureType=A.nodeName.split(":").pop();this.setNamespace("feature",A.namespaceURI);this.featureNS=A.namespaceURI;this.autoConfig=true}return OpenLayers.Format.XML.prototype.readNode.apply(this,[A,B])},readers:{gml:{featureMember:function(A,B){this.readChildNodes(A,B)},featureMembers:function(A,B){this.readChildNodes(A,B)},name:function(A,B){B.name=this.getChildValue(A)},boundedBy:function(B,C){var A={};this.readChildNodes(B,A);if(A.components&&A.components.length>0){C.bounds=A.components[0]}},Point:function(B,A){var C={points:[]};this.readChildNodes(B,C);if(!A.components){A.components=[]}A.components.push(C.points[0])},coordinates:function(E,G){var H=this.getChildValue(E).replace(this.regExes.trimSpace,"");H=H.replace(this.regExes.trimComma,",");var A=H.split(this.regExes.splitSpace);var F;var D=A.length;var C=new Array(D);for(var B=0;B<D;++B){F=A[B].split(",");if(this.xy){C[B]=new OpenLayers.Geometry.Point(F[0],F[1],F[2])}else{C[B]=new OpenLayers.Geometry.Point(F[1],F[0],F[2])}}G.points=C},coord:function(A,B){var C={};this.readChildNodes(A,C);if(!B.points){B.points=[]}B.points.push(new OpenLayers.Geometry.Point(C.x,C.y,C.z))},X:function(A,B){B.x=this.getChildValue(A)},Y:function(A,B){B.y=this.getChildValue(A)},Z:function(A,B){B.z=this.getChildValue(A)},MultiPoint:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.MultiPoint(C.components)]},pointMember:function(A,B){this.readChildNodes(A,B)},LineString:function(B,A){var C={};this.readChildNodes(B,C);if(!A.components){A.components=[]}A.components.push(new OpenLayers.Geometry.LineString(C.points))},MultiLineString:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.MultiLineString(C.components)]},lineStringMember:function(A,B){this.readChildNodes(A,B)},Polygon:function(B,A){var C={outer:null,inner:[]};this.readChildNodes(B,C);C.inner.unshift(C.outer);if(!A.components){A.components=[]}A.components.push(new OpenLayers.Geometry.Polygon(C.inner))},LinearRing:function(B,C){var A={};this.readChildNodes(B,A);C.components=[new OpenLayers.Geometry.LinearRing(A.points)]},MultiPolygon:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.MultiPolygon(C.components)]},polygonMember:function(A,B){this.readChildNodes(A,B)},GeometryCollection:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.Collection(C.components)]},geometryMember:function(A,B){this.readChildNodes(A,B)}},feature:{"*":function(C,D){var A;var B=C.localName||C.nodeName.split(":").pop();if(D.features){if(!this.singleFeatureType&&(OpenLayers.Util.indexOf(this.featureType,B)!==-1)){A="_typeName"}else{if(B===this.featureType){A="_typeName"}}}else{if(C.childNodes.length==0||(C.childNodes.length==1&&C.firstChild.nodeType==3)){if(this.extractAttributes){A="_attribute"}}else{A="_geometry"}}if(A){this.readers.feature[A].apply(this,[C,D])}},_typeName:function(C,D){var A={components:[],attributes:{}};this.readChildNodes(C,A);if(A.name){A.attributes.name=A.name}var B=new OpenLayers.Feature.Vector(A.components[0],A.attributes);if(!this.singleFeatureType){B.type=C.nodeName.split(":").pop();B.namespace=C.namespaceURI}var E=C.getAttribute("fid")||this.getAttributeNS(C,this.namespaces.gml,"id");if(E){B.fid=E}if(this.internalProjection&&this.externalProjection&&B.geometry){B.geometry.transform(this.externalProjection,this.internalProjection)}if(A.bounds){B.bounds=A.bounds}D.features.push(B)},_geometry:function(A,B){if(!this.geometryName){this.geometryName=A.nodeName.split(":").pop()}this.readChildNodes(A,B)},_attribute:function(B,D){var A=B.localName||B.nodeName.split(":").pop();var C=this.getChildValue(B);D.attributes[A]=C}},wfs:{FeatureCollection:function(A,B){this.readChildNodes(A,B)}}},write:function(C){var B;if(OpenLayers.Util.isArray(C)){B="featureMembers"}else{B="featureMember"}var A=this.writeNode("gml:"+B,C);this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[A])},writers:{gml:{featureMember:function(A){var B=this.createElementNSPlus("gml:featureMember");this.writeNode("feature:_typeName",A,B);return B},MultiPoint:function(E){var D=this.createElementNSPlus("gml:MultiPoint");var C=E.components||[E];for(var A=0,B=C.length;A<B;++A){this.writeNode("pointMember",C[A],D)}return D},pointMember:function(B){var A=this.createElementNSPlus("gml:pointMember");this.writeNode("Point",B,A);return A},MultiLineString:function(E){var D=this.createElementNSPlus("gml:MultiLineString");var C=E.components||[E];for(var A=0,B=C.length;A<B;++A){this.writeNode("lineStringMember",C[A],D)}return D},lineStringMember:function(B){var A=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",B,A);return A},MultiPolygon:function(E){var D=this.createElementNSPlus("gml:MultiPolygon");var C=E.components||[E];for(var A=0,B=C.length;A<B;++A){this.writeNode("polygonMember",C[A],D)}return D},polygonMember:function(B){var A=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",B,A);return A},GeometryCollection:function(D){var C=this.createElementNSPlus("gml:GeometryCollection");for(var B=0,A=D.components.length;B<A;++B){this.writeNode("geometryMember",D.components[B],C)}return C},geometryMember:function(B){var A=this.createElementNSPlus("gml:geometryMember");var C=this.writeNode("feature:_geometry",B);A.appendChild(C.firstChild);return A}},feature:{_typeName:function(B){var C=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:B.fid}});if(B.geometry){this.writeNode("feature:_geometry",B.geometry,C)}for(var A in B.attributes){var D=B.attributes[A];if(D!=null){this.writeNode("feature:_attribute",{name:A,value:D},C)}}return C},_geometry:function(C){if(this.externalProjection&&this.internalProjection){C=C.clone().transform(this.internalProjection,this.externalProjection)}var B=this.createElementNSPlus("feature:"+this.geometryName);var A=this.geometryTypes[C.CLASS_NAME];var D=this.writeNode("gml:"+A,C,B);if(this.srsName){D.setAttribute("srsName",this.srsName)}return B},_attribute:function(A){return this.createElementNSPlus("feature:"+A.name,{value:A.value})}},wfs:{FeatureCollection:function(C){var D=this.createElementNSPlus("wfs:FeatureCollection");for(var B=0,A=C.length;B<A;++B){this.writeNode("gml:featureMember",C[B],D)}return D}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"});OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",initialize:function(A){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[A])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(B,A){var C={};this.readChildNodes(B,C);A.outer=C.components[0]},innerBoundaryIs:function(B,A){var C={};this.readChildNodes(B,C);A.inner.push(C.components[0])},Box:function(D,B){var E={};this.readChildNodes(D,E);if(!B.components){B.components=[]}var C=E.points[0];var A=E.points[1];B.components.push(new OpenLayers.Bounds(C.x,C.y,A.x,A.y))}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(C){var B;if(OpenLayers.Util.isArray(C)){B="wfs:FeatureCollection"}else{B="gml:featureMember"}var A=this.writeNode(B,C);this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[A])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(B){var A=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[B],A);return A},coordinates:function(D){var C=D.length;var E=new Array(C);var A;for(var B=0;B<C;++B){A=D[B];if(this.xy){E[B]=A.x+","+A.y}else{E[B]=A.y+","+A.x}if(A.z!=undefined){E[B]+=","+A.z}}return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:(C==1)?E[0]:E.join(" ")})},LineString:function(B){var A=this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",B.components,A);return A},Polygon:function(C){var B=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",C.components[0],B);for(var A=1;A<C.components.length;++A){this.writeNode("innerBoundaryIs",C.components[A],B)}return B},outerBoundaryIs:function(A){var B=this.createElementNSPlus("gml:outerBoundaryIs");this.writeNode("LinearRing",A,B);return B},innerBoundaryIs:function(A){var B=this.createElementNSPlus("gml:innerBoundaryIs");this.writeNode("LinearRing",A,B);return B},LinearRing:function(A){var B=this.createElementNSPlus("gml:LinearRing");this.writeNode("coordinates",A.components,B);return B},Box:function(B){var A=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:B.left,y:B.bottom},{x:B.right,y:B.top}],A);if(this.srsName){A.setAttribute("srsName",this.srsName)}return A}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},CLASS_NAME:"OpenLayers.Format.GML.v2"});OpenLayers.Style=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(B,A){OpenLayers.Util.extend(this,A);this.rules=[];if(A&&A.rules){this.addRules(A.rules)}this.setDefaultStyle(B||OpenLayers.Feature.Vector.style["default"]);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var B=0,A=this.rules.length;B<A;B++){this.rules[B].destroy();this.rules[B]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(J){var A=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),J);var I=this.rules;var H,B;var C=[];var F=false;for(var D=0,E=I.length;D<E;D++){H=I[D];var G=H.evaluate(J);if(G){if(H instanceof OpenLayers.Rule&&H.elseFilter){C.push(H)}else{F=true;this.applySymbolizer(H,A,J)}}}if(F==false&&C.length>0){F=true;for(var D=0,E=C.length;D<E;D++){this.applySymbolizer(C[D],A,J)}}if(I.length>0&&F==false){A.display="none"}if(A.label!=null&&typeof A.label!=="string"){A.label=String(A.label)}return A},applySymbolizer:function(F,D,B){var A=B.geometry?this.getSymbolizerPrefix(B.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var C=F.symbolizer[A]||F.symbolizer;if(this.defaultsPerSymbolizer===true){var E=this.defaultStyle;OpenLayers.Util.applyDefaults(C,{pointRadius:E.pointRadius});if(C.stroke===true||C.graphic===true){OpenLayers.Util.applyDefaults(C,{strokeWidth:E.strokeWidth,strokeColor:E.strokeColor,strokeOpacity:E.strokeOpacity,strokeDashstyle:E.strokeDashstyle,strokeLinecap:E.strokeLinecap})}if(C.fill===true||C.graphic===true){OpenLayers.Util.applyDefaults(C,{fillColor:E.fillColor,fillOpacity:E.fillOpacity})}if(C.graphic===true){OpenLayers.Util.applyDefaults(C,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}}return this.createLiterals(OpenLayers.Util.extend(D,C),B)},createLiterals:function(D,C){var B=OpenLayers.Util.extend({},C.attributes||C.data);OpenLayers.Util.extend(B,this.context);for(var A in this.propertyStyles){D[A]=OpenLayers.Style.createLiteral(D[A],B,C,A)}return D},findPropertyStyles:function(){var D={};var F=this.defaultStyle;this.addPropertyStyles(D,F);var H=this.rules;var E,G;for(var C=0,A=H.length;C<A;C++){E=H[C].symbolizer;for(var B in E){G=E[B];if(typeof G=="object"){this.addPropertyStyles(D,G)}else{this.addPropertyStyles(D,E);break}}}return D},addPropertyStyles:function(B,C){var D;for(var A in C){D=C[A];if(typeof D=="string"&&D.match(/\$\{\w+\}/)){B[A]=true}}return B},addRules:function(A){Array.prototype.push.apply(this.rules,A);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(A){this.defaultStyle=A;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(D){var C=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var B=0,A=C.length;B<A;B++){if(D.CLASS_NAME.indexOf(C[B])!=-1){return C[B]}}},clone:function(){var B=OpenLayers.Util.extend({},this);if(this.rules){B.rules=[];for(var C=0,A=this.rules.length;C<A;++C){B.rules.push(this.rules[C].clone())}}B.context=this.context&&OpenLayers.Util.extend({},this.context);var D=OpenLayers.Util.extend({},this.defaultStyle);return new OpenLayers.Style(D,B)},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(D,B,A,C){if(typeof D=="string"&&D.indexOf("${")!=-1){D=OpenLayers.String.format(D,B,[A,C]);D=(isNaN(D)||!D)?D:parseFloat(D)}return D};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:false,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(A){this.symbolizer={};OpenLayers.Util.extend(this,A);if(this.symbolizers){delete this.symbolizer}this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var A in this.symbolizer){this.symbolizer[A]=null}this.symbolizer=null;delete this.symbolizers},evaluate:function(C){var B=this.getContext(C);var A=true;if(this.minScaleDenominator||this.maxScaleDenominator){var D=C.layer.map.getScale()}if(this.minScaleDenominator){A=D>=OpenLayers.Style.createLiteral(this.minScaleDenominator,B)}if(A&&this.maxScaleDenominator){A=D<OpenLayers.Style.createLiteral(this.maxScaleDenominator,B)}if(A&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){A=this.filter.evaluate(C)}else{A=this.filter.evaluate(B)}}return A},getContext:function(B){var A=this.context;if(!A){A=B.attributes||B.data}if(typeof this.context=="function"){A=this.context(B)}return A},clone:function(){var B=OpenLayers.Util.extend({},this);if(this.symbolizers){var A=this.symbolizers.length;B.symbolizers=new Array(A);for(var D=0;D<A;++D){B.symbolizers[D]=this.symbolizers[D].clone()}}else{B.symbolizer={};var F,E;for(var C in this.symbolizer){F=this.symbolizer[C];E=typeof F;if(E==="object"){B.symbolizer[C]=OpenLayers.Util.extend({},F)}else{if(E==="string"){B.symbolizer[C]=F}}}}B.filter=this.filter&&this.filter.clone();B.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(B)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.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(C){var A;if(typeof C=="string"){C=OpenLayers.Format.XML.prototype.read.apply(this,[C])}var B=C.documentElement;var D={exceptionReport:null};if(B){this.readChildNodes(C,D);if(D.exceptionReport===null){D=new OpenLayers.Format.OWSCommon().read(C)}}return D},readers:{ogc:{ServiceExceptionReport:function(A,B){B.exceptionReport={exceptions:[]};this.readChildNodes(A,B.exceptionReport)},ServiceException:function(B,C){var A={code:B.getAttribute("code"),locator:B.getAttribute("locator"),text:this.getChildValue(B)};C.exceptions.push(A)}}},CLASS_NAME:"OpenLayers.Format.OGCExceptionReport"});OpenLayers.Format.XML.VersionedOGC=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:null,version:null,profile:null,errorProperty:null,name:null,stringifyOutput:false,parser:null,initialize:function(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A]);var B=this.CLASS_NAME;this.name=B.substring(B.lastIndexOf(".")+1)},getVersion:function(B,C){var A;if(B){A=this.version;if(!A){A=B.getAttribute("version");if(!A){A=this.defaultVersion}}}else{A=(C&&C.version)||this.version||this.defaultVersion}return A},getParser:function(A){A=A||this.defaultVersion;var B=this.profile?"_"+this.profile:"";if(!this.parser||this.parser.VERSION!=A){var C=OpenLayers.Format[this.name]["v"+A.replace(/\./g,"_")+B];if(!C){throw"Can't find a "+this.name+" parser for version "+A+B}this.parser=new C(this.options)}return this.parser},write:function(D,C){var B=this.getVersion(null,C);this.parser=this.getParser(B);var A=this.parser.write(D,C);if(this.stringifyOutput===false){return A}else{return OpenLayers.Format.XML.prototype.write.apply(this,[A])}},read:function(D,C){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var B=D.documentElement;var A=this.getVersion(B);this.parser=this.getParser(A);var F=this.parser.read(D,C);if(this.errorProperty!==null&&F[this.errorProperty]===undefined){var E=new OpenLayers.Format.OGCExceptionReport();F.error=E.read(D)}F.version=A;return F},CLASS_NAME:"OpenLayers.Format.XML.VersionedOGC"});OpenLayers.Filter=OpenLayers.Class({initialize:function(A){OpenLayers.Util.extend(this,A)},destroy:function(){},evaluate:function(A){return true},clone:function(){return null},toString:function(){var A;if(OpenLayers.Format&&OpenLayers.Format.CQL){A=OpenLayers.Format.CQL.prototype.write(this)}else{A=Object.prototype.toString.call(this)}return A},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,type:"FID",initialize:function(A){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[A])},evaluate:function(C){for(var B=0,A=this.fids.length;B<A;B++){var D=C.fid||C.id;if(D==this.fids[B]){return true}}return false},clone:function(){var A=new OpenLayers.Filter.FeatureId();OpenLayers.Util.extend(A,this);A.fids=this.fids.slice();return A},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(A){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[A])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(C){var B,A;switch(this.type){case OpenLayers.Filter.Logical.AND:for(B=0,A=this.filters.length;B<A;B++){if(this.filters[B].evaluate(C)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(B=0,A=this.filters.length;B<A;B++){if(this.filters[B].evaluate(C)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(C))}return undefined},clone:function(){var C=[];for(var B=0,A=this.filters.length;B<A;++B){C.push(this.filters[B].clone())}return new OpenLayers.Filter.Logical({type:this.type,filters:C})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:true,lowerBoundary:null,upperBoundary:null,initialize:function(A){OpenLayers.Filter.prototype.initialize.apply(this,[A]);if(this.type===OpenLayers.Filter.Comparison.LIKE&&A.matchCase===undefined){this.matchCase=null}},evaluate:function(C){if(C instanceof OpenLayers.Feature.Vector){C=C.attributes}var A=false;var B=C[this.property];var E;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:E=this.value;if(!this.matchCase&&typeof B=="string"&&typeof E=="string"){A=(B.toUpperCase()==E.toUpperCase())}else{A=(B==E)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:E=this.value;if(!this.matchCase&&typeof B=="string"&&typeof E=="string"){A=(B.toUpperCase()!=E.toUpperCase())}else{A=(B!=E)}break;case OpenLayers.Filter.Comparison.LESS_THAN:A=B<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:A=B>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:A=B<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:A=B>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:A=(B>=this.lowerBoundary)&&(B<=this.upperBoundary);break;case OpenLayers.Filter.Comparison.LIKE:var D=new RegExp(this.value,"gi");A=D.test(B);break}return A},value2regex:function(C,B,A){if(C=="."){throw new Error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison")}C=C?C:"*";B=B?B:".";A=A?A:"!";this.value=this.value.replace(new RegExp("\\"+A+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+B,"g"),".");this.value=this.value.replace(new RegExp("\\"+C,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+C);this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+B);return this.value},regex2value:function(){var A=this.value;A=A.replace(/!/g,"!!");A=A.replace(/(\\)?\\\./g,function(C,B){return B?C:"!."});A=A.replace(/(\\)?\\\*/g,function(C,B){return B?C:"!*"});A=A.replace(/\\\\/g,"\\");A=A.replace(/\.\*/g,"*");return A},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison(),this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,evaluate:function(C){var A=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(C.geometry){var B=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){B=this.value.toGeometry()}if(C.geometry.intersects(B)){A=true}}break;default:throw new Error("evaluate is not implemented for this filter type.")}return A},clone:function(){var A=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(A)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{profile:null,defaultVersion:"1.0.0",stringifyOutput:true,namedLayersAsArray:false,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(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(A){var B={};this.readers.ogc.Filter.apply(this,[A,B]);return B.filter},readers:{ogc:{_expression:function(A){var C,B="";for(var D=A.firstChild;D;D=D.nextSibling){switch(D.nodeType){case 1:C=this.readNode(D);if(C.property){B+="${"+C.property+"}"}else{if(C.value!==undefined){B+=C.value}}break;case 3:case 4:B+=D.nodeValue}}return B},Filter:function(B,A){var C={fids:[],filters:[]};this.readChildNodes(B,C);if(C.fids.length>0){A.filter=new OpenLayers.Filter.FeatureId({fids:C.fids})}else{if(C.filters.length>0){A.filter=C.filters[0]}}},FeatureId:function(A,B){var C=A.getAttribute("fid");if(C){B.fids.push(C)}},And:function(B,C){var A=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(B,A);C.filters.push(A)},Or:function(B,C){var A=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(B,A);C.filters.push(A)},Not:function(B,C){var A=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(B,A);C.filters.push(A)},PropertyIsLessThan:function(B,C){var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(B,A);C.filters.push(A)},PropertyIsGreaterThan:function(B,C){var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(B,A);C.filters.push(A)},PropertyIsLessThanOrEqualTo:function(B,C){var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(B,A);C.filters.push(A)},PropertyIsGreaterThanOrEqualTo:function(B,C){var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(B,A);C.filters.push(A)},PropertyIsBetween:function(B,C){var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(B,A);C.filters.push(A)},Literal:function(A,B){B.value=OpenLayers.String.numericIf(this.getChildValue(A))},PropertyName:function(B,A){A.property=this.getChildValue(B)},LowerBoundary:function(B,A){A.lowerBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,B))},UpperBoundary:function(B,A){A.upperBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,B))},Intersects:function(A,B){this.readSpatial(A,B,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(A,B){this.readSpatial(A,B,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(A,B){this.readSpatial(A,B,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(A,B){this.readSpatial(A,B,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(A,B){B.distance=parseInt(this.getChildValue(A));B.distanceUnits=A.getAttribute("units")},Function:function(A,B){return }}},readSpatial:function(C,D,B){var A=new OpenLayers.Filter.Spatial({type:B});this.readChildNodes(C,A);A.value=A.components[0];delete A.components;D.filters.push(A)},writeOgcExpression:function(B,A){if(B instanceof OpenLayers.Filter.Function){var C=this.writeNode("Function",B,A);A.appendChild(C)}else{this.writeNode("Literal",B,A)}return A},write:function(A){return this.writers.ogc.Filter.apply(this,[A])},writeFeatureIdNodes:function(C,D){for(var A=0,B=C.fids.length;A<B;++A){this.writeNode("FeatureId",C.fids[A],D)}},writers:{ogc:{Filter:function(A){var B=this.createElementNSPlus("ogc:Filter");if(A.type==="FID"){OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this,A,B)}else{this.writeNode(this.getFilterType(A),A,B)}return B},FeatureId:function(A){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:A}})},And:function(D){var E=this.createElementNSPlus("ogc:And");var C;for(var A=0,B=D.filters.length;A<B;++A){C=D.filters[A];if(C.type==="FID"){OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this,C,E)}else{this.writeNode(this.getFilterType(C),C,E)}}return E},Or:function(D){var E=this.createElementNSPlus("ogc:Or");var C;for(var A=0,B=D.filters.length;A<B;++A){C=D.filters[A];if(C.type==="FID"){OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this,C,E)}else{this.writeNode(this.getFilterType(C),C,E)}}return E},Not:function(B){var C=this.createElementNSPlus("ogc:Not");var A=B.filters[0];if(A.type==="FID"){OpenLayers.Format.Filter.v1.prototype.writeFeatureIdNodes.call(this,A,C)}else{this.writeNode(this.getFilterType(A),A,C)}return C},PropertyIsLessThan:function(A){var B=this.createElementNSPlus("ogc:PropertyIsLessThan");this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsGreaterThan:function(A){var B=this.createElementNSPlus("ogc:PropertyIsGreaterThan");this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsLessThanOrEqualTo:function(A){var B=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsGreaterThanOrEqualTo:function(A){var B=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsBetween:function(A){var B=this.createElementNSPlus("ogc:PropertyIsBetween");this.writeNode("PropertyName",A,B);this.writeNode("LowerBoundary",A,B);this.writeNode("UpperBoundary",A,B);return B},PropertyName:function(A){return this.createElementNSPlus("ogc:PropertyName",{value:A.property})},Literal:function(A){return this.createElementNSPlus("ogc:Literal",{value:A})},LowerBoundary:function(A){var B=this.createElementNSPlus("ogc:LowerBoundary");this.writeOgcExpression(A.lowerBoundary,B);return B},UpperBoundary:function(A){var B=this.createElementNSPlus("ogc:UpperBoundary");this.writeNode("Literal",A.upperBoundary,B);return B},INTERSECTS:function(A){return this.writeSpatial(A,"Intersects")},WITHIN:function(A){return this.writeSpatial(A,"Within")},CONTAINS:function(A){return this.writeSpatial(A,"Contains")},DWITHIN:function(A){var B=this.writeSpatial(A,"DWithin");this.writeNode("Distance",A,B);return B},Distance:function(A){return this.createElementNSPlus("ogc:Distance",{attributes:{units:A.distanceUnits},value:A.distance})},Function:function(C){var D=this.createElementNSPlus("ogc:Function",{attributes:{name:C.name}});var E=C.params;for(var B=0,A=E.length;B<A;B++){this.writeOgcExpression(E[B],D)}return D}}},getFilterType:function(A){var B=this.filterMap[A.type];if(!B){throw"Filter writing not supported for rule type: "+A.type}return B},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"FeatureId"},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(A){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[A])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(B,C){var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(B,A);C.filters.push(A)},PropertyIsNotEqualTo:function(B,C){var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(B,A);C.filters.push(A)},PropertyIsLike:function(D,E){var C=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(D,C);var F=D.getAttribute("wildCard");var B=D.getAttribute("singleChar");var A=D.getAttribute("escape");C.value2regex(F,B,A);E.filters.push(C)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(A){var B=this.createElementNSPlus("ogc:PropertyIsEqualTo");this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsNotEqualTo:function(A){var B=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsLike:function(A){var B=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});this.writeNode("PropertyName",A,B);this.writeNode("Literal",A.regex2value(),B);return B},BBOX:function(A){var C=this.createElementNSPlus("ogc:BBOX");A.property&&this.writeNode("PropertyName",A,C);var B=this.writeNode("gml:Box",A.value,C);if(A.projection){B.setAttribute("srsName",A.projection)}return C}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},writeSpatial:function(B,A){var C=this.createElementNSPlus("ogc:"+A);this.writeNode("PropertyName",B,C);if(B.value instanceof OpenLayers.Filter.Function){this.writeNode("Function",B.value,C)}else{var D;if(B.value instanceof OpenLayers.Geometry){D=this.writeNode("feature:_geometry",B.value).firstChild}else{D=this.writeNode("gml:Box",B.value)}if(B.projection){D.setAttribute("srsName",B.projection)}C.appendChild(D)}return C},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"});OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(A){OpenLayers.Util.extend(this,A)},clone:function(){var Type=eval(this.CLASS_NAME);return new Type(OpenLayers.Util.extend({},this))},CLASS_NAME:"OpenLayers.Symbolizer"});OpenLayers.Symbolizer.Point=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(A){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Point"});OpenLayers.Symbolizer.Line=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(A){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Line"});OpenLayers.Symbolizer.Polygon=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(A){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Polygon"});OpenLayers.Symbolizer.Text=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(A){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Text"});OpenLayers.Symbolizer.Raster=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(A){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:false,featureTypeCounter:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,graphicName:"square"},read:function(C,A){A=OpenLayers.Util.applyDefaults(A,this.options);var B={namedLayers:A.namedLayersAsArray===true?[]:{}};this.readChildNodes(C,B);return B},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(A,B){B.version=A.getAttribute("version");this.readChildNodes(A,B)},Name:function(A,B){B.name=this.getChildValue(A)},Title:function(A,B){B.title=this.getChildValue(A)},Abstract:function(A,B){B.description=this.getChildValue(A)},NamedLayer:function(D,E){var C={userStyles:[],namedStyles:[]};this.readChildNodes(D,C);for(var B=0,A=C.userStyles.length;B<A;++B){C.userStyles[B].layerName=C.name}if(OpenLayers.Util.isArray(E.namedLayers)){E.namedLayers.push(C)}else{E.namedLayers[C.name]=C}},NamedStyle:function(B,A){A.namedStyles.push(this.getChildName(B.firstChild))},UserStyle:function(C,A){var D={defaultsPerSymbolizer:true,rules:[]};this.featureTypeCounter=-1;this.readChildNodes(C,D);var B;if(this.multipleSymbolizers){delete D.defaultsPerSymbolizer;B=new OpenLayers.Style2(D)}else{B=new OpenLayers.Style(this.defaultSymbolizer,D)}A.userStyles.push(B)},IsDefault:function(B,A){if(this.getChildValue(B)=="1"){A.isDefault=true}},FeatureTypeStyle:function(B,A){++this.featureTypeCounter;var C={rules:this.multipleSymbolizers?A.rules:[]};this.readChildNodes(B,C);if(!this.multipleSymbolizers){A.rules=C.rules}},Rule:function(B,D){var A;if(this.multipleSymbolizers){A={symbolizers:[]}}var C=new OpenLayers.Rule(A);this.readChildNodes(B,C);D.rules.push(C)},ElseFilter:function(A,B){B.elseFilter=true},MinScaleDenominator:function(A,B){B.minScaleDenominator=parseFloat(this.getChildValue(A))},MaxScaleDenominator:function(A,B){B.maxScaleDenominator=parseFloat(this.getChildValue(A))},TextSymbolizer:function(B,C){var A={};this.readChildNodes(B,A);if(this.multipleSymbolizers){A.zIndex=this.featureTypeCounter;C.symbolizers.push(new OpenLayers.Symbolizer.Text(A))}else{C.symbolizer.Text=OpenLayers.Util.applyDefaults(A,C.symbolizer.Text)}},LabelPlacement:function(B,A){this.readChildNodes(B,A)},PointPlacement:function(E,D){var B={};this.readChildNodes(E,B);B.labelRotation=B.rotation;delete B.rotation;var C,A=D.labelAnchorPointX,F=D.labelAnchorPointY;if(A<=1/3){C="l"}else{if(A>1/3&&A<2/3){C="c"}else{if(A>=2/3){C="r"}}}if(F<=1/3){C+="b"}else{if(F>1/3&&F<2/3){C+="m"}else{if(F>=2/3){C+="t"}}}B.labelAlign=C;OpenLayers.Util.applyDefaults(D,B)},AnchorPoint:function(B,A){this.readChildNodes(B,A)},AnchorPointX:function(C,B){var A=this.readers.ogc._expression.call(this,C);if(A){B.labelAnchorPointX=A}},AnchorPointY:function(C,B){var A=this.readers.ogc._expression.call(this,C);if(A){B.labelAnchorPointY=A}},Displacement:function(B,A){this.readChildNodes(B,A)},DisplacementX:function(C,B){var A=this.readers.ogc._expression.call(this,C);if(A){B.labelXOffset=A}},DisplacementY:function(C,A){var B=this.readers.ogc._expression.call(this,C);if(B){A.labelYOffset=B}},LinePlacement:function(B,A){this.readChildNodes(B,A)},PerpendicularOffset:function(B,A){var C=this.readers.ogc._expression.call(this,B);if(C){A.labelPerpendicularOffset=C}},Label:function(B,A){var C=this.readers.ogc._expression.call(this,B);if(C){A.label=C}},Font:function(B,A){this.readChildNodes(B,A)},Halo:function(B,A){var C={};this.readChildNodes(B,C);A.haloRadius=C.haloRadius;A.haloColor=C.fillColor;A.haloOpacity=C.fillOpacity},Radius:function(C,B){var A=this.readers.ogc._expression.call(this,C);if(A!=null){B.haloRadius=A}},RasterSymbolizer:function(B,C){var A={};this.readChildNodes(B,A);if(this.multipleSymbolizers){A.zIndex=this.featureTypeCounter;C.symbolizers.push(new OpenLayers.Symbolizer.Raster(A))}else{C.symbolizer.Raster=OpenLayers.Util.applyDefaults(A,C.symbolizer.Raster)}},Geometry:function(A,B){B.geometry={};this.readChildNodes(A,B.geometry)},ColorMap:function(B,A){A.colorMap=[];this.readChildNodes(B,A.colorMap)},ColorMapEntry:function(B,A){var C=B.getAttribute("quantity");var D=B.getAttribute("opacity");A.push({color:B.getAttribute("color"),quantity:C!==null?parseFloat(C):undefined,label:B.getAttribute("label")||undefined,opacity:D!==null?parseFloat(D):undefined})},LineSymbolizer:function(B,C){var A={};this.readChildNodes(B,A);if(this.multipleSymbolizers){A.zIndex=this.featureTypeCounter;C.symbolizers.push(new OpenLayers.Symbolizer.Line(A))}else{C.symbolizer.Line=OpenLayers.Util.applyDefaults(A,C.symbolizer.Line)}},PolygonSymbolizer:function(B,C){var A={fill:false,stroke:false};if(!this.multipleSymbolizers){A=C.symbolizer.Polygon||A}this.readChildNodes(B,A);if(this.multipleSymbolizers){A.zIndex=this.featureTypeCounter;C.symbolizers.push(new OpenLayers.Symbolizer.Polygon(A))}else{C.symbolizer.Polygon=A}},PointSymbolizer:function(B,C){var A={fill:false,stroke:false,graphic:false};if(!this.multipleSymbolizers){A=C.symbolizer.Point||A}this.readChildNodes(B,A);if(this.multipleSymbolizers){A.zIndex=this.featureTypeCounter;C.symbolizers.push(new OpenLayers.Symbolizer.Point(A))}else{C.symbolizer.Point=A}},Stroke:function(B,A){A.stroke=true;this.readChildNodes(B,A)},Fill:function(B,A){A.fill=true;this.readChildNodes(B,A)},CssParameter:function(C,B){var A=C.getAttribute("name");var E=this.cssMap[A];if(B.label){if(A==="fill"){E="fontColor"}else{if(A==="fill-opacity"){E="fontOpacity"}}}if(E){var D=this.readers.ogc._expression.call(this,C);if(D){B[E]=D}}},Graphic:function(C,I){I.graphic=true;var A={};this.readChildNodes(C,A);var F=["stroke","strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fill","fillColor","fillOpacity","graphicName","rotation","graphicFormat"];var B,H;for(var D=0,E=F.length;D<E;++D){B=F[D];H=A[B];if(H!=undefined){I[B]=H}}if(A.opacity!=undefined){I.graphicOpacity=A.opacity}if(A.size!=undefined){var G=A.size/2;if(isNaN(G)){I.graphicWidth=A.size}else{I.pointRadius=A.size/2}}if(A.href!=undefined){I.externalGraphic=A.href}if(A.rotation!=undefined){I.rotation=A.rotation}},ExternalGraphic:function(A,B){this.readChildNodes(A,B)},Mark:function(A,B){this.readChildNodes(A,B)},WellKnownName:function(A,B){B.graphicName=this.getChildValue(A)},Opacity:function(B,C){var A=this.readers.ogc._expression.call(this,B);if(A){C.opacity=A}},Size:function(B,C){var A=this.readers.ogc._expression.call(this,B);if(A){C.size=A}},Rotation:function(B,C){var A=this.readers.ogc._expression.call(this,B);if(A){C.rotation=A}},OnlineResource:function(A,B){B.href=this.getAttributeNS(A,this.namespaces.xlink,"href")},Format:function(A,B){B.graphicFormat=this.getChildValue(A)}}},OpenLayers.Format.Filter.v1_0_0.prototype.readers),cssMap:{stroke:"strokeColor","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-dasharray":"strokeDashstyle",fill:"fillColor","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","font-weight":"fontWeight","font-style":"fontStyle"},getCssProperty:function(A){var B=null;for(var C in this.cssMap){if(this.cssMap[C]==A){B=C;break}}return B},getGraphicFormat:function(A){var D,C;for(var B in this.graphicFormats){if(this.graphicFormats[B].test(A)){D=B;break}}return D||this.defaultGraphicFormat},defaultGraphicFormat:"image/png",graphicFormats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(A){return this.writers.sld.StyledLayerDescriptor.apply(this,[A])},writers:OpenLayers.Util.applyDefaults({sld:{_OGCExpression:function(H,F){var E=this.createElementNSPlus(H);var G=typeof F=="string"?F.split("${"):[F];E.appendChild(this.createTextNode(G[0]));var D,C;for(var B=1,A=G.length;B<A;B++){D=G[B];C=D.indexOf("}");if(C>0){this.writeNode("ogc:PropertyName",{property:D.substring(0,C)},E);E.appendChild(this.createTextNode(D.substring(++C)))}else{E.appendChild(this.createTextNode("${"+D))}}return E},StyledLayerDescriptor:function(E){var B=this.createElementNSPlus("sld:StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});B.setAttribute("xmlns:ogc",this.namespaces.ogc);B.setAttribute("xmlns:gml",this.namespaces.gml);if(E.name){this.writeNode("Name",E.name,B)}if(E.title){this.writeNode("Title",E.title,B)}if(E.description){this.writeNode("Abstract",E.description,B)}if(OpenLayers.Util.isArray(E.namedLayers)){for(var D=0,A=E.namedLayers.length;D<A;++D){this.writeNode("NamedLayer",E.namedLayers[D],B)}}else{for(var C in E.namedLayers){this.writeNode("NamedLayer",E.namedLayers[C],B)}}return B},Name:function(A){return this.createElementNSPlus("sld:Name",{value:A})},Title:function(A){return this.createElementNSPlus("sld:Title",{value:A})},Abstract:function(A){return this.createElementNSPlus("sld:Abstract",{value:A})},NamedLayer:function(C){var D=this.createElementNSPlus("sld:NamedLayer");this.writeNode("Name",C.name,D);if(C.namedStyles){for(var B=0,A=C.namedStyles.length;B<A;++B){this.writeNode("NamedStyle",C.namedStyles[B],D)}}if(C.userStyles){for(var B=0,A=C.userStyles.length;B<A;++B){this.writeNode("UserStyle",C.userStyles[B],D)}}return D},NamedStyle:function(A){var B=this.createElementNSPlus("sld:NamedStyle");this.writeNode("Name",A,B);return B},UserStyle:function(B){var D=this.createElementNSPlus("sld:UserStyle");if(B.name){this.writeNode("Name",B.name,D)}if(B.title){this.writeNode("Title",B.title,D)}if(B.description){this.writeNode("Abstract",B.description,D)}if(B.isDefault){this.writeNode("IsDefault",B.isDefault,D)}if(this.multipleSymbolizers&&B.rules){var K={0:[]};var C=[0];var J,A,N,I,H;for(var F=0,M=B.rules.length;F<M;++F){J=B.rules[F];if(J.symbolizers){A={};for(var E=0,G=J.symbolizers.length;E<G;++E){N=J.symbolizers[E];I=N.zIndex;if(!(I in A)){H=J.clone();H.symbolizers=[];A[I]=H}A[I].symbolizers.push(N.clone())}for(I in A){if(!(I in K)){C.push(I);K[I]=[]}K[I].push(A[I])}}else{K[0].push(J.clone())}}C.sort();var L;for(var F=0,M=C.length;F<M;++F){L=K[C[F]];if(L.length>0){H=B.clone();H.rules=K[C[F]];this.writeNode("FeatureTypeStyle",H,D)}}}else{this.writeNode("FeatureTypeStyle",B,D)}return D},IsDefault:function(A){return this.createElementNSPlus("sld:IsDefault",{value:(A)?"1":"0"})},FeatureTypeStyle:function(C){var D=this.createElementNSPlus("sld:FeatureTypeStyle");for(var B=0,A=C.rules.length;B<A;++B){this.writeNode("Rule",C.rules[B],D)}return D},Rule:function(H){var G=this.createElementNSPlus("sld:Rule");if(H.name){this.writeNode("Name",H.name,G)}if(H.title){this.writeNode("Title",H.title,G)}if(H.description){this.writeNode("Abstract",H.description,G)}if(H.elseFilter){this.writeNode("ElseFilter",null,G)}else{if(H.filter){this.writeNode("ogc:Filter",H.filter,G)}}if(H.minScaleDenominator!=undefined){this.writeNode("MinScaleDenominator",H.minScaleDenominator,G)}if(H.maxScaleDenominator!=undefined){this.writeNode("MaxScaleDenominator",H.maxScaleDenominator,G)}var F,E;if(this.multipleSymbolizers&&H.symbolizers){var E;for(var C=0,D=H.symbolizers.length;C<D;++C){E=H.symbolizers[C];F=E.CLASS_NAME.split(".").pop();this.writeNode(F+"Symbolizer",E,G)}}else{var B=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var C=0,A=B.length;C<A;++C){F=B[C];E=H.symbolizer[F];if(E){this.writeNode(F+"Symbolizer",E,G)}}}return G},ElseFilter:function(){return this.createElementNSPlus("sld:ElseFilter")},MinScaleDenominator:function(A){return this.createElementNSPlus("sld:MinScaleDenominator",{value:A})},MaxScaleDenominator:function(A){return this.createElementNSPlus("sld:MaxScaleDenominator",{value:A})},LineSymbolizer:function(A){var B=this.createElementNSPlus("sld:LineSymbolizer");this.writeNode("Stroke",A,B);return B},Stroke:function(A){var B=this.createElementNSPlus("sld:Stroke");if(A.strokeColor!=undefined){this.writeNode("CssParameter",{symbolizer:A,key:"strokeColor"},B)}if(A.strokeOpacity!=undefined){this.writeNode("CssParameter",{symbolizer:A,key:"strokeOpacity"},B)}if(A.strokeWidth!=undefined){this.writeNode("CssParameter",{symbolizer:A,key:"strokeWidth"},B)}if(A.strokeDashstyle!=undefined&&A.strokeDashstyle!=="solid"){this.writeNode("CssParameter",{symbolizer:A,key:"strokeDashstyle"},B)}if(A.strokeLinecap!=undefined){this.writeNode("CssParameter",{symbolizer:A,key:"strokeLinecap"},B)}return B},CssParameter:function(A){return this.createElementNSPlus("sld:CssParameter",{attributes:{name:this.getCssProperty(A.key)},value:A.symbolizer[A.key]})},TextSymbolizer:function(A){var B=this.createElementNSPlus("sld:TextSymbolizer");if(A.label!=null){this.writeNode("Label",A.label,B)}if(A.fontFamily!=null||A.fontSize!=null||A.fontWeight!=null||A.fontStyle!=null){this.writeNode("Font",A,B)}if(A.labelAnchorPointX!=null||A.labelAnchorPointY!=null||A.labelAlign!=null||A.labelXOffset!=null||A.labelYOffset!=null||A.labelRotation!=null||A.labelPerpendicularOffset!=null){this.writeNode("LabelPlacement",A,B)}if(A.haloRadius!=null||A.haloColor!=null||A.haloOpacity!=null){this.writeNode("Halo",A,B)}if(A.fontColor!=null||A.fontOpacity!=null){this.writeNode("Fill",{fillColor:A.fontColor,fillOpacity:A.fontOpacity},B)}return B},LabelPlacement:function(A){var B=this.createElementNSPlus("sld:LabelPlacement");if((A.labelAnchorPointX!=null||A.labelAnchorPointY!=null||A.labelAlign!=null||A.labelXOffset!=null||A.labelYOffset!=null||A.labelRotation!=null)&&A.labelPerpendicularOffset==null){this.writeNode("PointPlacement",A,B)}if(A.labelPerpendicularOffset!=null){this.writeNode("LinePlacement",A,B)}return B},LinePlacement:function(A){var B=this.createElementNSPlus("sld:LinePlacement");this.writeNode("PerpendicularOffset",A.labelPerpendicularOffset,B);return B},PerpendicularOffset:function(A){return this.createElementNSPlus("sld:PerpendicularOffset",{value:A})},PointPlacement:function(A){var B=this.createElementNSPlus("sld:PointPlacement");if(A.labelAnchorPointX!=null||A.labelAnchorPointY!=null||A.labelAlign!=null){this.writeNode("AnchorPoint",A,B)}if(A.labelXOffset!=null||A.labelYOffset!=null){this.writeNode("Displacement",A,B)}if(A.labelRotation!=null){this.writeNode("Rotation",A.labelRotation,B)}return B},AnchorPoint:function(B){var C=this.createElementNSPlus("sld:AnchorPoint");var A=B.labelAnchorPointX,F=B.labelAnchorPointY;if(A!=null){this.writeNode("AnchorPointX",A,C)}if(F!=null){this.writeNode("AnchorPointY",F,C)}if(A==null&&F==null){var E=B.labelAlign.substr(0,1),D=B.labelAlign.substr(1,1);if(E==="l"){A=0}else{if(E==="c"){A=0.5}else{if(E==="r"){A=1}}}if(D==="b"){F=0}else{if(D==="m"){F=0.5}else{if(D==="t"){F=1}}}this.writeNode("AnchorPointX",A,C);this.writeNode("AnchorPointY",F,C)}return C},AnchorPointX:function(A){return this.createElementNSPlus("sld:AnchorPointX",{value:A})},AnchorPointY:function(A){return this.createElementNSPlus("sld:AnchorPointY",{value:A})},Displacement:function(A){var B=this.createElementNSPlus("sld:Displacement");if(A.labelXOffset!=null){this.writeNode("DisplacementX",A.labelXOffset,B)}if(A.labelYOffset!=null){this.writeNode("DisplacementY",A.labelYOffset,B)}return B},DisplacementX:function(A){return this.createElementNSPlus("sld:DisplacementX",{value:A})},DisplacementY:function(A){return this.createElementNSPlus("sld:DisplacementY",{value:A})},Font:function(A){var B=this.createElementNSPlus("sld:Font");if(A.fontFamily){this.writeNode("CssParameter",{symbolizer:A,key:"fontFamily"},B)}if(A.fontSize){this.writeNode("CssParameter",{symbolizer:A,key:"fontSize"},B)}if(A.fontWeight){this.writeNode("CssParameter",{symbolizer:A,key:"fontWeight"},B)}if(A.fontStyle){this.writeNode("CssParameter",{symbolizer:A,key:"fontStyle"},B)}return B},Label:function(A){return this.writers.sld._OGCExpression.call(this,"sld:Label",A)},Halo:function(A){var B=this.createElementNSPlus("sld:Halo");if(A.haloRadius){this.writeNode("Radius",A.haloRadius,B)}if(A.haloColor||A.haloOpacity){this.writeNode("Fill",{fillColor:A.haloColor,fillOpacity:A.haloOpacity},B)}return B},Radius:function(A){return this.createElementNSPlus("sld:Radius",{value:A})},RasterSymbolizer:function(A){var B=this.createElementNSPlus("sld:RasterSymbolizer");if(A.geometry){this.writeNode("Geometry",A.geometry,B)}if(A.opacity){this.writeNode("Opacity",A.opacity,B)}if(A.colorMap){this.writeNode("ColorMap",A.colorMap,B)}return B},Geometry:function(B){var A=this.createElementNSPlus("sld:Geometry");if(B.property){this.writeNode("ogc:PropertyName",B,A)}return A},ColorMap:function(B){var D=this.createElementNSPlus("sld:ColorMap");for(var C=0,A=B.length;C<A;++C){this.writeNode("ColorMapEntry",B[C],D)}return D},ColorMapEntry:function(B){var C=this.createElementNSPlus("sld:ColorMapEntry");var A=B;C.setAttribute("color",A.color);A.opacity!==undefined&&C.setAttribute("opacity",parseFloat(A.opacity));A.quantity!==undefined&&C.setAttribute("quantity",parseFloat(A.quantity));A.label!==undefined&&C.setAttribute("label",A.label);return C},PolygonSymbolizer:function(A){var B=this.createElementNSPlus("sld:PolygonSymbolizer");if(A.fill!==false){this.writeNode("Fill",A,B)}if(A.stroke!==false){this.writeNode("Stroke",A,B)}return B},Fill:function(A){var B=this.createElementNSPlus("sld:Fill");if(A.fillColor){this.writeNode("CssParameter",{symbolizer:A,key:"fillColor"},B)}if(A.fillOpacity!=null){this.writeNode("CssParameter",{symbolizer:A,key:"fillOpacity"},B)}return B},PointSymbolizer:function(A){var B=this.createElementNSPlus("sld:PointSymbolizer");this.writeNode("Graphic",A,B);return B},Graphic:function(A){var B=this.createElementNSPlus("sld:Graphic");if(A.externalGraphic!=undefined){this.writeNode("ExternalGraphic",A,B)}else{this.writeNode("Mark",A,B)}if(A.graphicOpacity!=undefined){this.writeNode("Opacity",A.graphicOpacity,B)}if(A.pointRadius!=undefined){this.writeNode("Size",A.pointRadius*2,B)}else{if(A.graphicWidth!=undefined){this.writeNode("Size",A.graphicWidth,B)}}if(A.rotation!=undefined){this.writeNode("Rotation",A.rotation,B)}return B},ExternalGraphic:function(A){var B=this.createElementNSPlus("sld:ExternalGraphic");this.writeNode("OnlineResource",A.externalGraphic,B);var C=A.graphicFormat||this.getGraphicFormat(A.externalGraphic);this.writeNode("Format",C,B);return B},Mark:function(A){var B=this.createElementNSPlus("sld:Mark");if(A.graphicName){this.writeNode("WellKnownName",A.graphicName,B)}if(A.fill!==false){this.writeNode("Fill",A,B)}if(A.stroke!==false){this.writeNode("Stroke",A,B)}return B},WellKnownName:function(A){return this.createElementNSPlus("sld:WellKnownName",{value:A})},Opacity:function(A){return this.createElementNSPlus("sld:Opacity",{value:A})},Size:function(A){return this.writers.sld._OGCExpression.call(this,"sld:Size",A)},Rotation:function(A){return this.createElementNSPlus("sld:Rotation",{value:A})},OnlineResource:function(A){return this.createElementNSPlus("sld:OnlineResource",{attributes:{"xlink:type":"simple","xlink:href":A}})},Format:function(A){return this.createElementNSPlus("sld:Format",{value:A})}}},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(D,B){var C=OpenLayers.Format.XML.VersionedOGC.prototype.read.apply(this,arguments);var E;if(B&&B.map){this.context=C;if(B.map instanceof OpenLayers.Map){E=this.mergeContextToMap(C,B.map)}else{var A=B.map;if(OpenLayers.Util.isElement(A)||typeof A=="string"){A={div:A}}E=this.contextToMap(C,A)}}else{E=C}return E},getLayerFromContext:function(G){var C,F;var I={queryable:G.queryable,visibility:G.visibility,maxExtent:G.maxExtent,metadata:OpenLayers.Util.applyDefaults(G.metadata,{styles:G.styles,formats:G.formats,"abstract":G["abstract"],dataURL:G.dataURL}),numZoomLevels:G.numZoomLevels,units:G.units,isBaseLayer:G.isBaseLayer,opacity:G.opacity,displayInLayerSwitcher:G.displayInLayerSwitcher,singleTile:G.singleTile,tileSize:(G.tileSize)?new OpenLayers.Size(G.tileSize.width,G.tileSize.height):undefined,minScale:G.minScale||G.maxScaleDenominator,maxScale:G.maxScale||G.minScaleDenominator,srs:G.srs,dimensions:G.dimensions,metadataURL:G.metadataURL};if(this.layerOptions){OpenLayers.Util.applyDefaults(I,this.layerOptions)}var B={layers:G.name,transparent:G.transparent,version:G.version};if(G.formats&&G.formats.length>0){B.format=G.formats[0].value;for(C=0,F=G.formats.length;C<F;C++){var H=G.formats[C];if(H.current==true){B.format=H.value;break}}}if(G.styles&&G.styles.length>0){for(C=0,F=G.styles.length;C<F;C++){var A=G.styles[C];if(A.current==true){if(A.href){B.sld=A.href}else{if(A.body){B.sld_body=A.body}else{B.styles=A.name}}break}}}if(this.layerParams){OpenLayers.Util.applyDefaults(B,this.layerParams)}var D=null;var E=G.service;if(E==OpenLayers.Format.Context.serviceTypes.WFS){I.strategies=[new OpenLayers.Strategy.BBOX()];I.protocol=new OpenLayers.Protocol.WFS({url:G.url,featurePrefix:G.name.split(":")[0],featureType:G.name.split(":").pop()});D=new OpenLayers.Layer.Vector(G.title||G.name,I)}else{if(E==OpenLayers.Format.Context.serviceTypes.KML){I.strategies=[new OpenLayers.Strategy.Fixed()];I.protocol=new OpenLayers.Protocol.HTTP({url:G.url,format:new OpenLayers.Format.KML()});D=new OpenLayers.Layer.Vector(G.title||G.name,I)}else{if(E==OpenLayers.Format.Context.serviceTypes.GML){I.strategies=[new OpenLayers.Strategy.Fixed()];I.protocol=new OpenLayers.Protocol.HTTP({url:G.url,format:new OpenLayers.Format.GML()});D=new OpenLayers.Layer.Vector(G.title||G.name,I)}else{if(G.features){D=new OpenLayers.Layer.Vector(G.title||G.name,I);D.addFeatures(G.features)}else{if(G.categoryLayer!==true){D=new OpenLayers.Layer.WMS(G.title||G.name,G.url,B,I)}}}}}return D},getLayersFromContext:function(D){var E=[];for(var C=0,A=D.length;C<A;C++){var B=this.getLayerFromContext(D[C]);if(B!==null){E.push(B)}}return E},contextToMap:function(C,A){A=OpenLayers.Util.applyDefaults({maxExtent:C.maxExtent,projection:C.projection,units:C.units},A);if(A.maxExtent){A.maxResolution=A.maxExtent.getWidth()/OpenLayers.Map.TILE_WIDTH}var B={contactInformation:C.contactInformation,"abstract":C["abstract"],keywords:C.keywords,logo:C.logo,descriptionURL:C.descriptionURL};A.metadata=B;var D=new OpenLayers.Map(A);D.addLayers(this.getLayersFromContext(C.layersContext));D.setCenter(C.bounds.getCenterLonLat(),D.getZoomForExtent(C.bounds,true));return D},mergeContextToMap:function(A,B){B.addLayers(this.getLayersFromContext(A.layersContext));return B},write:function(B,A){B=this.toContext(B);return 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(B,C){var A=OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this,arguments);if(A==="0.3.0"){A=this.defaultVersion}return A},toContext:function(B){var A={};if(B.CLASS_NAME=="OpenLayers.Map"){A.bounds=B.getExtent();A.maxExtent=B.maxExtent;A.projection=B.projection;A.size=B.getSize();A.layers=B.layers}return A},CLASS_NAME:"OpenLayers.Format.OWSContext"});OpenLayers.Format.OWSCommon=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",getVersion:function(B,C){var A=this.version;if(!A){var D=B.getAttribute("xmlns:ows");if(D&&D.substring(D.lastIndexOf("/")+1)==="1.1"){A="1.1.0"}if(!A){A=this.defaultVersion}}return A},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(B,A){A=OpenLayers.Util.applyDefaults(A,this.options);var C={};this.readChildNodes(B,C);return C},readers:{ows:{Exception:function(B,C){var A={code:B.getAttribute("exceptionCode"),locator:B.getAttribute("locator"),texts:[]};C.exceptions.push(A);this.readChildNodes(B,A)},ExceptionText:function(B,A){var C=this.getChildValue(B);A.texts.push(C)},ServiceIdentification:function(A,B){B.serviceIdentification={};this.readChildNodes(A,B.serviceIdentification)},Title:function(A,B){B.title=this.getChildValue(A)},Abstract:function(A,B){B["abstract"]=this.getChildValue(A)},Keywords:function(A,B){B.keywords={};this.readChildNodes(A,B.keywords)},Keyword:function(B,A){A[this.getChildValue(B)]=true},ServiceType:function(A,B){B.serviceType={codeSpace:A.getAttribute("codeSpace"),value:this.getChildValue(A)}},ServiceTypeVersion:function(A,B){B.serviceTypeVersion=this.getChildValue(A)},Fees:function(A,B){B.fees=this.getChildValue(A)},AccessConstraints:function(A,B){B.accessConstraints=this.getChildValue(A)},ServiceProvider:function(A,B){B.serviceProvider={};this.readChildNodes(A,B.serviceProvider)},ProviderName:function(A,B){B.providerName=this.getChildValue(A)},ProviderSite:function(A,B){B.providerSite=this.getAttributeNS(A,this.namespaces.xlink,"href")},ServiceContact:function(A,B){B.serviceContact={};this.readChildNodes(A,B.serviceContact)},IndividualName:function(B,A){A.individualName=this.getChildValue(B)},PositionName:function(B,A){A.positionName=this.getChildValue(B)},ContactInfo:function(B,A){A.contactInfo={};this.readChildNodes(B,A.contactInfo)},Phone:function(B,A){A.phone={};this.readChildNodes(B,A.phone)},Voice:function(B,A){A.voice=this.getChildValue(B)},Address:function(B,A){A.address={};this.readChildNodes(B,A.address)},DeliveryPoint:function(B,A){A.deliveryPoint=this.getChildValue(B)},City:function(B,A){A.city=this.getChildValue(B)},AdministrativeArea:function(B,A){A.administrativeArea=this.getChildValue(B)},PostalCode:function(B,A){A.postalCode=this.getChildValue(B)},Country:function(B,A){A.country=this.getChildValue(B)},ElectronicMailAddress:function(B,A){A.electronicMailAddress=this.getChildValue(B)},Role:function(B,A){A.role=this.getChildValue(B)},OperationsMetadata:function(A,B){B.operationsMetadata={};this.readChildNodes(A,B.operationsMetadata)},Operation:function(C,B){var A=C.getAttribute("name");B[A]={};this.readChildNodes(C,B[A])},DCP:function(B,A){A.dcp={};this.readChildNodes(B,A.dcp)},HTTP:function(B,A){A.http={};this.readChildNodes(B,A.http)},Get:function(B,A){if(!A.get){A.get=[]}var C={url:this.getAttributeNS(B,this.namespaces.xlink,"href")};this.readChildNodes(B,C);A.get.push(C)},Post:function(B,A){if(!A.post){A.post=[]}var C={url:this.getAttributeNS(B,this.namespaces.xlink,"href")};this.readChildNodes(B,C);A.post.push(C)},Parameter:function(C,A){if(!A.parameters){A.parameters={}}var B=C.getAttribute("name");A.parameters[B]={};this.readChildNodes(C,A.parameters[B])},Constraint:function(B,C){if(!C.constraints){C.constraints={}}var A=B.getAttribute("name");C.constraints[A]={};this.readChildNodes(B,C.constraints[A])},Value:function(A,B){B[this.getChildValue(A)]=true},OutputFormat:function(A,B){B.formats.push({value:this.getChildValue(A)});this.readChildNodes(A,B)},WGS84BoundingBox:function(B,C){var A={};A.crs=B.getAttribute("crs");if(C.BoundingBox){C.BoundingBox.push(A)}else{C.projection=A.crs;A=C}this.readChildNodes(B,A)},BoundingBox:function(A,B){this.readers.ows["WGS84BoundingBox"].apply(this,[A,B])},LowerCorner:function(B,C){var D=this.getChildValue(B).replace(this.regExes.trimSpace,"");D=D.replace(this.regExes.trimComma,",");var A=D.split(this.regExes.splitSpace);C.left=A[0];C.bottom=A[1]},UpperCorner:function(B,C){var D=this.getChildValue(B).replace(this.regExes.trimSpace,"");D=D.replace(this.regExes.trimComma,",");var A=D.split(this.regExes.splitSpace);C.right=A[0];C.top=A[1];C.bounds=new OpenLayers.Bounds(C.left,C.bottom,C.right,C.top);delete C.left;delete C.bottom;delete C.right;delete C.top},Language:function(A,B){B.language=this.getChildValue(A)}}},writers:{ows:{BoundingBox:function(A){var B=this.createElementNSPlus("ows:BoundingBox",{attributes:{crs:A.projection}});this.writeNode("ows:LowerCorner",A,B);this.writeNode("ows:UpperCorner",A,B);return B},LowerCorner:function(A){var B=this.createElementNSPlus("ows:LowerCorner",{value:A.bounds.left+" "+A.bounds.bottom});return B},UpperCorner:function(A){var B=this.createElementNSPlus("ows:UpperCorner",{value:A.bounds.right+" "+A.bounds.top});return B},Identifier:function(A){var B=this.createElementNSPlus("ows:Identifier",{value:A});return B},Title:function(B){var A=this.createElementNSPlus("ows:Title",{value:B});return A},Abstract:function(A){var B=this.createElementNSPlus("ows:Abstract",{value:A});return B},OutputFormat:function(B){var A=this.createElementNSPlus("ows:OutputFormat",{value:B});return A}}},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(A,B){B.success=false;B.exceptionReport={version:A.getAttribute("version"),language:A.getAttribute("language"),exceptions:[]};this.readChildNodes(A,B.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:true,xy:true,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(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A]);OpenLayers.Format.GML.v2.prototype.setGeometryTypes.call(this)},setNestingPath:function(B){if(B.layersContext){for(var C=0,A=B.layersContext.length;C<A;C++){var F=B.layersContext[C];var D=[];var E=B.title||"";if(B.metadata&&B.metadata.nestingPath){D=B.metadata.nestingPath.slice()}if(E!=""){D.push(E)}F.metadata.nestingPath=D;if(F.layersContext){this.setNestingPath(F)}}}},decomposeNestingPath:function(B){var A=[];if(OpenLayers.Util.isArray(B)){var C=B.slice();while(C.length>0){A.push(C.slice());C.pop()}A.reverse()}return A},read:function(B){if(typeof B=="string"){B=OpenLayers.Format.XML.prototype.read.apply(this,[B])}if(B&&B.nodeType==9){B=B.documentElement}var A={};this.readNode(B,A);this.setNestingPath({layersContext:A.layersContext});var C=[];this.processLayer(C,A);delete A.layersContext;A.layersContext=C;return A},processLayer:function(B,E){if(E.layersContext){for(var D=0,A=E.layersContext.length;D<A;D++){var C=E.layersContext[D];B.push(C);if(C.layersContext){this.processLayer(B,C)}}}},write:function(D,C){var B="OWSContext";this.nestingLayerLookup={};C=C||{};OpenLayers.Util.applyDefaults(C,D);var A=this.writeNode(B,C);this.nestingLayerLookup=null;this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[A])},readers:{kml:{Document:function(A,B){B.features=new OpenLayers.Format.KML({kmlns:this.namespaces.kml,extractStyles:true}).read(A)}},owc:{OWSContext:function(A,B){this.readChildNodes(A,B)},General:function(A,B){this.readChildNodes(A,B)},ResourceList:function(A,B){this.readChildNodes(A,B)},Layer:function(A,C){var B={metadata:{},visibility:(A.getAttribute("hidden")!="1"),queryable:(A.getAttribute("queryable")=="1"),opacity:((A.getAttribute("opacity")!=null)?parseFloat(A.getAttribute("opacity")):null),name:A.getAttribute("name"),categoryLayer:(A.getAttribute("name")==null),formats:[],styles:[]};if(!C.layersContext){C.layersContext=[]}C.layersContext.push(B);this.readChildNodes(A,B)},InlineGeometry:function(B,D){D.features=[];var C=this.getElementsByTagNameNS(B,this.namespaces.gml,"featureMember");var A;if(C.length>=1){A=C[0]}if(A&&A.firstChild){var E=(A.firstChild.nextSibling)?A.firstChild.nextSibling:A.firstChild;this.setNamespace("feature",E.namespaceURI);this.featureType=E.localName||E.nodeName.split(":").pop();this.readChildNodes(B,D)}},Server:function(A,B){if((!B.service&&!B.version)||(B.service!=OpenLayers.Format.Context.serviceTypes.WMS)){B.service=A.getAttribute("service");B.version=A.getAttribute("version");this.readChildNodes(A,B)}},Name:function(A,B){B.name=this.getChildValue(A);this.readChildNodes(A,B)},Title:function(A,B){B.title=this.getChildValue(A);this.readChildNodes(A,B)},StyleList:function(A,B){this.readChildNodes(A,B.styles)},Style:function(B,C){var A={};C.push(A);this.readChildNodes(B,A)},LegendURL:function(B,C){var A={};C.legend=A;this.readChildNodes(B,A)},OnlineResource:function(A,B){B.url=this.getAttributeNS(A,this.namespaces.xlink,"href");this.readChildNodes(A,B)}},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(A){var B=this.createElementNSPlus("OWSContext",{attributes:{version:this.VERSION,id:A.id||OpenLayers.Util.createUniqueID("OpenLayers_OWSContext_")}});this.writeNode("General",A,B);this.writeNode("ResourceList",A,B);return B},General:function(A){var B=this.createElementNSPlus("General");this.writeNode("ows:BoundingBox",A,B);this.writeNode("ows:Title",A.title||"OpenLayers OWSContext",B);return B},ResourceList:function(C){var F=this.createElementNSPlus("ResourceList");for(var E=0,B=C.layers.length;E<B;E++){var D=C.layers[E];var A=this.decomposeNestingPath(D.metadata.nestingPath);this.writeNode("_Layer",{layer:D,subPaths:A},F)}return F},Server:function(A){var B=this.createElementNSPlus("Server",{attributes:{version:A.version,service:A.service}});this.writeNode("OnlineResource",A,B);return B},OnlineResource:function(A){var B=this.createElementNSPlus("OnlineResource",{attributes:{"xlink:href":A.url}});return B},InlineGeometry:function(C){var D=this.createElementNSPlus("InlineGeometry");this.writeNode("gml:boundedBy",C.getDataExtent(),D);for(var B=0,A=C.features.length;B<A;B++){this.writeNode("gml:featureMember",C.features[B],D)}return D},StyleList:function(D){var C=this.createElementNSPlus("StyleList");for(var B=0,A=D.length;B<A;B++){this.writeNode("Style",D[B],C)}return C},Style:function(A){var B=this.createElementNSPlus("Style");this.writeNode("Name",A,B);this.writeNode("Title",A,B);if(A.legend){this.writeNode("LegendURL",A,B)}return B},Name:function(B){var A=this.createElementNSPlus("Name",{value:B.name});return A},Title:function(B){var A=this.createElementNSPlus("Title",{value:B.title});return A},LegendURL:function(A){var B=this.createElementNSPlus("LegendURL");this.writeNode("OnlineResource",A.legend,B);return B},_WMS:function(A){var B=this.createElementNSPlus("Layer",{attributes:{name:A.params.LAYERS,queryable:A.queryable?"1":"0",hidden:A.visibility?"0":"1",opacity:A.hasOwnProperty("opacity")?A.opacity:null}});this.writeNode("ows:Title",A.name,B);this.writeNode("ows:OutputFormat",A.params.FORMAT,B);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WMS,version:A.params.VERSION,url:A.url},B);if(A.metadata.styles&&A.metadata.styles.length>0){this.writeNode("StyleList",A.metadata.styles,B)}return B},_Layer:function(B){var C,G,D,F;C=B.layer;G=B.subPaths;D=null;F=null;if(G.length>0){var E=G[0].join("/");var A=E.lastIndexOf("/");D=this.nestingLayerLookup[E];F=(A>0)?E.substring(A+1,E.length):E;if(!D){D=this.createElementNSPlus("Layer");this.writeNode("ows:Title",F,D);this.nestingLayerLookup[E]=D}B.subPaths.shift();this.writeNode("_Layer",B,D);return D}else{if(C instanceof OpenLayers.Layer.WMS){D=this.writeNode("_WMS",C)}else{if(C instanceof OpenLayers.Layer.Vector){if(C.protocol instanceof OpenLayers.Protocol.WFS.v1){D=this.writeNode("_WFS",C)}else{if(C.protocol instanceof OpenLayers.Protocol.HTTP){if(C.protocol.format instanceof OpenLayers.Format.GML){C.protocol.format.version="2.1.2";D=this.writeNode("_GML",C)}else{if(C.protocol.format instanceof OpenLayers.Format.KML){C.protocol.format.version="2.2";D=this.writeNode("_KML",C)}}}else{this.setNamespace("feature",this.featureNS);D=this.writeNode("_InlineGeometry",C)}}}}if(C.options.maxScale){this.writeNode("sld:MinScaleDenominator",C.options.maxScale,D)}if(C.options.minScale){this.writeNode("sld:MaxScaleDenominator",C.options.minScale,D)}this.nestingLayerLookup[C.name]=D;return D}},_WFS:function(A){var B=this.createElementNSPlus("Layer",{attributes:{name:A.protocol.featurePrefix+":"+A.protocol.featureType,hidden:A.visibility?"0":"1"}});this.writeNode("ows:Title",A.name,B);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WFS,version:A.protocol.version,url:A.protocol.url},B);return B},_InlineGeometry:function(A){var B=this.createElementNSPlus("Layer",{attributes:{name:this.featureType,hidden:A.visibility?"0":"1"}});this.writeNode("ows:Title",A.name,B);this.writeNode("InlineGeometry",A,B);return B},_GML:function(A){var B=this.createElementNSPlus("Layer");this.writeNode("ows:Title",A.name,B);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.GML,url:A.protocol.url,version:A.protocol.format.version},B);return B},_KML:function(A){var B=this.createElementNSPlus("Layer");this.writeNode("ows:Title",A.name,B);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.KML,version:A.protocol.format.version,url:A.protocol.url},B);return B}},gml:OpenLayers.Util.applyDefaults({boundedBy:function(B){var A=this.createElementNSPlus("gml:boundedBy");this.writeNode("gml:Box",B,A);return A}},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(B){B=OpenLayers.Util.applyDefaults(B,OpenLayers.Format.CSWGetRecords.DEFAULTS);var A=OpenLayers.Format.CSWGetRecords["v"+B.version.replace(/\./g,"_")];if(!A){throw"Unsupported CSWGetRecords version: "+B.version}return new A(B)};OpenLayers.Format.CSWGetRecords.DEFAULTS={version:"2.0.2"};OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",autoActivate:false,active:null,handler:null,eventListeners:null,events:null,initialize:function(A){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,A);this.events=new OpenLayers.Events(this);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.handlers){for(var A in this.handlers){if(this.handlers.hasOwnProperty(A)&&typeof this.handlers[A].destroy=="function"){this.handlers[A].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}this.div=null},setMap:function(A){this.map=A;if(this.handler){this.handler.setMap(A)}},draw:function(A){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=OpenLayers.Function.False}if(this.title!=""){this.div.title=this.title}}if(A!=null){this.position=A.clone()}this.moveTo(this.position);return this.div},moveTo:function(A){if((A!=null)&&(this.div!=null)){this.div.style.left=A.x+"px";this.div.style.top=A.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;if(this.map){OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;if(this.map){OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("deactivate");return true}return false},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Events.buttonclick=OpenLayers.Class({target:null,events:["mousedown","mouseup","click","dblclick","touchstart","touchmove","touchend","keydown"],startRegEx:/^mousedown|touchstart$/,cancelRegEx:/^touchmove$/,completeRegEx:/^mouseup|touchend$/,initialize:function(B){this.target=B;for(var A=this.events.length-1;A>=0;--A){this.target.register(this.events[A],this,this.buttonClick,{extension:true})}},destroy:function(){for(var A=this.events.length-1;A>=0;--A){this.target.unregister(this.events[A],this,this.buttonClick)}delete this.target},getPressedButton:function(B){var C=3,A;do{if(OpenLayers.Element.hasClass(B,"olButton")){A=B;break}B=B.parentNode}while(--C>0&&B);return A},buttonClick:function(B){var A=true,D=OpenLayers.Event.element(B);if(D&&(OpenLayers.Event.isLeftClick(B)||!~B.type.indexOf("mouse"))){var C=this.getPressedButton(D);if(C){if(B.type==="keydown"){switch(B.keyCode){case OpenLayers.Event.KEY_RETURN:case OpenLayers.Event.KEY_SPACE:this.target.triggerEvent("buttonclick",{buttonElement:C});OpenLayers.Event.stop(B);A=false;break}}else{if(this.startEvt){if(this.completeRegEx.test(B.type)){var E=OpenLayers.Util.pagePosition(C);this.target.triggerEvent("buttonclick",{buttonElement:C,buttonXY:{x:this.startEvt.clientX-E[0],y:this.startEvt.clientY-E[1]}})}if(this.cancelRegEx.test(B.type)){delete this.startEvt}OpenLayers.Event.stop(B);A=false}}if(this.startRegEx.test(B.type)){this.startEvt=B;OpenLayers.Event.stop(B);A=false}}else{delete this.startEvt}}return A}});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:false,handlers:null,resolutionFactor:1,maximized:false,initialize:function(A){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[A])},destroy:function(){if(!this.mapDiv){return }if(this.handlers.click){this.handlers.click.destroy()}if(this.handlers.drag){this.handlers.drag.destroy()}this.ovmap&&this.ovmap.viewPortDiv.removeChild(this.extentRectangle);this.extentRectangle=null;if(this.rectEvents){this.rectEvents.destroy();this.rectEvents=null}if(this.ovmap){this.ovmap.destroy();this.ovmap=null}this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeChild(this.element);this.element=null;if(this.maximizeDiv){this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null}if(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(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(this.layers.length===0){if(this.map.baseLayer){var B=this.map.baseLayer.clone();this.layers=[B]}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div}}this.element=document.createElement("div");this.element.className=this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var A=LMI.Urls.getImg("mapping/layer-switcher-maximize.png");this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,null,A,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton olButton";this.div.appendChild(this.maximizeDiv);var A=LMI.Urls.getImg("mapping/layer-switcher-minimize.png");this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,null,A,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton olButton";this.div.appendChild(this.minimizeDiv);this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.on({buttonclick:this.onButtonClick,moveend:this.update,scope:this});if(this.maximized){this.maximizeControl()}return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(I){var D=this.handlers.drag.last.x-I.x;var B=this.handlers.drag.last.y-I.y;if(D!=0||B!=0){var G=this.rectPxBounds.top;var A=this.rectPxBounds.left;var E=Math.abs(this.rectPxBounds.getHeight());var C=this.rectPxBounds.getWidth();var F=Math.max(0,(G-B));F=Math.min(F,this.ovmap.size.h-this.hComp-E);var H=Math.max(0,(A-D));H=Math.min(H,this.ovmap.size.w-this.wComp-C);this.setRectPxBounds(new OpenLayers.Bounds(H,F+E,H+C,F))}},mapDivClick:function(I){var B=this.rectPxBounds.getCenterPixel();var E=I.xy.x-B.x;var D=I.xy.y-B.y;var G=this.rectPxBounds.top;var C=this.rectPxBounds.left;var J=Math.abs(this.rectPxBounds.getHeight());var A=this.rectPxBounds.getWidth();var F=Math.max(0,(G+D));F=Math.min(F,this.ovmap.size.h-J);var H=Math.max(0,(C+E));H=Math.min(H,this.ovmap.size.w-A);this.setRectPxBounds(new OpenLayers.Bounds(H,F+J,H+A,F));this.updateMapToRect()},onButtonClick:function(A){if(A.buttonElement===this.minimizeDiv){this.minimizeControl()}else{if(A.buttonElement===this.maximizeDiv){this.maximizeControl()}}},maximizeControl:function(A){this.element.style.display="";this.showToggle(false);if(A!=null){OpenLayers.Event.stop(A)}},minimizeControl:function(A){this.element.style.display="none";this.showToggle(true);if(A!=null){OpenLayers.Event.stop(A)}},showToggle:function(A){this.maximizeDiv.style.display=A?"":"none";this.minimizeDiv.style.display=A?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var B=this.map.getExtent();var A=this.map.maxExtent;var C=new OpenLayers.Bounds(Math.max(B.left,A.left),Math.max(B.bottom,A.bottom),Math.min(B.right,A.right),Math.min(B.top,A.top));if(this.ovmap.getProjection()!=this.map.getProjection()){C=C.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var D=this.ovmap.getResolution()/this.map.getResolution();return((D>this.minRatio)&&(D<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(C)))},updateOverview:function(){var C=this.map.getResolution();var B=this.ovmap.getResolution();var D=B/C;if(D>this.maxRatio){B=this.minRatio*C}else{if(D<=this.minRatio){B=this.maxRatio*C}}var A;if(this.ovmap.getProjection()!=this.map.getProjection()){A=this.map.center.clone();A.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{A=this.map.center}this.ovmap.setCenter(A,this.ovmap.getZoomForResolution(B*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var B=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,B);this.ovmap.viewPortDiv.appendChild(this.extentRectangle);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:true,"double":false,stopSingle:true,stopDouble:true,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(D){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(D){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var C=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var A=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=C&&A?OpenLayers.INCHES_PER_UNIT[C]/OpenLayers.INCHES_PER_UNIT[A]:1}},updateRectToMap:function(){var B;if(this.ovmap.getProjection()!=this.map.getProjection()){B=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{B=this.map.getExtent()}var A=this.getRectBoundsFromMapBounds(B);if(A){this.setRectPxBounds(A)}},updateMapToRect:function(){var A=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){A=A.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(A.getCenterLonLat())},setRectPxBounds:function(D){var G=Math.max(D.top,0);var E=Math.max(D.left,0);var B=Math.min(D.top+Math.abs(D.getHeight()),this.ovmap.size.h-this.hComp);var H=Math.min(D.left+D.getWidth(),this.ovmap.size.w-this.wComp);var C=Math.max(H-E,0);var I=Math.max(B-G,0);if(C<this.minRectSize||I<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var F=E+(C/2)-(this.minRectSize/2);var A=G+(I/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(A)+"px";this.extentRectangle.style.left=Math.round(F)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(G)+"px";this.extentRectangle.style.left=Math.round(E)+"px";this.extentRectangle.style.height=Math.round(I)+"px";this.extentRectangle.style.width=Math.round(C)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(E),Math.round(B),Math.round(H),Math.round(G))},getRectBoundsFromMapBounds:function(C){var B=this.getOverviewPxFromLonLat({lon:C.left,lat:C.bottom});var A=this.getOverviewPxFromLonLat({lon:C.right,lat:C.top});var D=null;if(B&&A){D=new OpenLayers.Bounds(B.x,B.y,A.x,A.y)}return D},getMapBoundsFromRectBounds:function(B){var A=this.getLonLatFromOverviewPx({x:B.left,y:B.bottom});var C=this.getLonLatFromOverviewPx({x:B.right,y:B.top});return new OpenLayers.Bounds(A.lon,A.lat,C.lon,C.lat)},getLonLatFromOverviewPx:function(F){var E=this.ovmap.size;var D=this.ovmap.getResolution();var B=this.ovmap.getExtent().getCenterLonLat();var C=F.x-(E.w/2);var A=F.y-(E.h/2);return{lon:B.lon+C*D,lat:B.lat-A*D}},getOverviewPxFromLonLat:function(C){var A=this.ovmap.getResolution();var B=this.ovmap.getExtent();if(B){return{x:Math.round(1/A*(C.lon-B.left)),y:Math.round(1/A*(B.top-C.lat))}}},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Animation=(function(F){var C=!!(F.requestAnimationFrame||F.webkitRequestAnimationFrame||F.mozRequestAnimationFrame||F.oRequestAnimationFrame||F.msRequestAnimationFrame);var E=(function(){var H=F.requestAnimationFrame||F.webkitRequestAnimationFrame||F.mozRequestAnimationFrame||F.oRequestAnimationFrame||F.msRequestAnimationFrame||function(J,I){F.setTimeout(J,16)};return function(J,I){H.apply(F,[J,I])}})();var B=0;var A={};function G(L,I,H){I=I>0?I:Number.POSITIVE_INFINITY;var K=++B;var J=+new Date;A[K]=function(){if(A[K]&&+new Date-J<=I){L();if(A[K]){E(A[K],H)}}else{delete A[K]}};E(A[K],H);return K}function D(H){delete A[H]}return{isNative:C,requestFrame:E,start:G,stop:D}})(window);OpenLayers.Tween=OpenLayers.Class({easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,animationId:null,playing:false,initialize:function(A){this.easing=(A)?A:OpenLayers.Easing.Expo.easeOut},start:function(C,B,D,A){this.playing=true;this.begin=C;this.finish=B;this.duration=D;this.callbacks=A.callbacks;this.time=0;OpenLayers.Animation.stop(this.animationId);this.animationId=null;if(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(){if(!this.playing){return }if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)}OpenLayers.Animation.stop(this.animationId);this.animationId=null;this.playing=false},play:function(){var D={};for(var B in this.begin){var A=this.begin[B];var C=this.finish[B];if(A==null||C==null||isNaN(A)||isNaN(C)){throw new TypeError("invalid value for Tween")}var E=C-A;D[B]=this.easing.apply(this,[this.time,A,E,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,D)}if(this.time>this.duration){this.stop()}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(B,A,D,C){return D*B/C+A},easeOut:function(B,A,D,C){return D*B/C+A},easeInOut:function(B,A,D,C){return D*B/C+A},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(B,A,D,C){return(B==0)?A:D*Math.pow(2,10*(B/C-1))+A},easeOut:function(B,A,D,C){return(B==C)?A+D:D*(-Math.pow(2,-10*B/C)+1)+A},easeInOut:function(B,A,D,C){if(B==0){return A}if(B==C){return A+D}if((B/=C/2)<1){return D/2*Math.pow(2,10*(B-1))+A}return D/2*(-Math.pow(2,-10*--B)+2)+A},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(B,A,D,C){return D*(B/=C)*B+A},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A},easeInOut:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A}return -D/2*((--B)*(B-2)-1)+A},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},id:null,fractionalZoom:false,events:null,allOverlays:false,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,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:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,minPx:null,maxPx:null,initialize:function(B,I){if(arguments.length===1&&typeof B==="object"){I=B;B=I&&I.div}this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);OpenLayers.Util.extend(this,I);var A=this.projection instanceof OpenLayers.Projection?this.projection.projCode:this.projection;OpenLayers.Util.applyDefaults(this,OpenLayers.Projection.defaults[A]);if(this.maxExtent&&!(this.maxExtent instanceof OpenLayers.Bounds)){this.maxExtent=new OpenLayers.Bounds(this.maxExtent)}if(this.minExtent&&!(this.minExtent instanceof OpenLayers.Bounds)){this.minExtent=new OpenLayers.Bounds(this.minExtent)}if(this.restrictedExtent&&!(this.restrictedExtent instanceof OpenLayers.Bounds)){this.restrictedExtent=new OpenLayers.Bounds(this.restrictedExtent)}if(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(B);if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}OpenLayers.Element.addClass(this.div,"olMap");var D=this.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(D,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:true});D=this.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(D);this.layerContainerDiv.style.width="100px";this.layerContainerDiv.style.height="100px";this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(parseFloat(navigator.appVersion.split("MSIE")[1])<9){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var E=true;var C=document.getElementsByTagName("link");for(var F=0,G=C.length;F<G;++F){if(OpenLayers.Util.isEquivalentUrl(C.item(F).href,this.theme)){E=false;break}}if(E){var H=document.createElement("link");H.setAttribute("rel","stylesheet");H.setAttribute("type","text/css");H.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(H)}}if(this.controls==null){this.controls=[];if(OpenLayers.Control!=null){if(OpenLayers.Control.Navigation){this.controls.push(new OpenLayers.Control.Navigation())}else{if(OpenLayers.Control.TouchNavigation){this.controls.push(new OpenLayers.Control.TouchNavigation())}}if(OpenLayers.Control.Zoom){this.controls.push(new OpenLayers.Control.Zoom())}else{if(OpenLayers.Control.PanZoom){this.controls.push(new OpenLayers.Control.PanZoom())}}if(OpenLayers.Control.ArgParser){this.controls.push(new OpenLayers.Control.ArgParser())}if(OpenLayers.Control.Attribution){this.controls.push(new OpenLayers.Control.Attribution())}}}for(var F=0,G=this.controls.length;F<G;F++){this.addControlToMap(this.controls[F])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy);if(I&&I.layers){delete this.center;this.addLayers(I.layers);if(I.center&&!this.getCenter()){this.setCenter(I.center,I.zoom)}}},getViewport:function(){return this.viewPortDiv},render:function(A){this.div=OpenLayers.Util.getElement(A);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 false}if(this.panTween){this.panTween.stop();this.panTween=null}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)}else{this.events.unregister("resize",this,this.updateSize)}this.paddingForPopups=null;if(this.controls!=null){for(var A=this.controls.length-1;A>=0;--A){this.controls[A].destroy()}this.controls=null}if(this.layers!=null){for(var A=this.layers.length-1;A>=0;--A){this.layers[A].destroy(false)}this.layers=null}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)}this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null}this.events.destroy();this.events=null;this.options=null},setOptions:function(A){var B=this.minPx&&A.restrictedExtent!=this.restrictedExtent;OpenLayers.Util.extend(this,A);B&&this.moveTo(this.getCachedCenter(),this.zoom,{forceZoomChange:true})},getTileSize:function(){return this.tileSize},getBy:function(E,C,A){var D=(typeof A.test=="function");var B=OpenLayers.Array.filter(this[E],function(F){return F[C]==A||(D&&A.test(F[C]))});return B},getLayersBy:function(B,A){return this.getBy("layers",B,A)},getLayersByName:function(A){return this.getLayersBy("name",A)},getLayersByClass:function(A){return this.getLayersBy("CLASS_NAME",A)},getControlsBy:function(B,A){return this.getBy("controls",B,A)},getControlsByClass:function(A){return this.getControlsBy("CLASS_NAME",A)},getLayer:function(E){var B=null;for(var D=0,A=this.layers.length;D<A;D++){var C=this.layers[D];if(C.id==E){B=C;break}}return B},setLayerZIndex:function(B,A){B.setZIndex(this.Z_INDEX_BASE[B.isBaseLayer?"BaseLayer":"Overlay"]+A*5)},resetLayersZIndex:function(){for(var C=0,A=this.layers.length;C<A;C++){var B=this.layers[C];this.setLayerZIndex(B,C)}},addLayer:function(C){for(var B=0,A=this.layers.length;B<A;B++){if(this.layers[B]==C){return false}}if(this.events.triggerEvent("preaddlayer",{layer:C})===false){return false}if(this.allOverlays){C.isBaseLayer=false}C.div.className="olLayerDiv";C.div.style.overflow="";this.setLayerZIndex(C,this.layers.length);if(C.isFixed){this.viewPortDiv.appendChild(C.div)}else{this.layerContainerDiv.appendChild(C.div)}this.layers.push(C);C.setMap(this);if(C.isBaseLayer||(this.allOverlays&&!this.baseLayer)){if(this.baseLayer==null){this.setBaseLayer(C)}else{C.setVisibility(false)}}else{C.redraw()}this.events.triggerEvent("addlayer",{layer:C});C.events.triggerEvent("added",{map:this,layer:C});C.afterAdd();return true},addLayers:function(C){for(var B=0,A=C.length;B<A;B++){this.addLayer(C[B])}},removeLayer:function(C,E){if(this.events.triggerEvent("preremovelayer",{layer:C})===false){return }if(E==null){E=true}if(C.isFixed){this.viewPortDiv.removeChild(C.div)}else{this.layerContainerDiv.removeChild(C.div)}OpenLayers.Util.removeItem(this.layers,C);C.removeMap(this);C.map=null;if(this.baseLayer==C){this.baseLayer=null;if(E){for(var B=0,A=this.layers.length;B<A;B++){var D=this.layers[B];if(D.isBaseLayer||this.allOverlays){this.setBaseLayer(D);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:C});C.events.triggerEvent("removed",{map:this,layer:C})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(A){return OpenLayers.Util.indexOf(this.layers,A)},setLayerIndex:function(D,B){var E=this.getLayerIndex(D);if(B<0){B=0}else{if(B>this.layers.length){B=this.layers.length}}if(E!=B){this.layers.splice(E,1);this.layers.splice(B,0,D);for(var C=0,A=this.layers.length;C<A;C++){this.setLayerZIndex(this.layers[C],C)}this.events.triggerEvent("changelayer",{layer:D,property:"order"});if(this.allOverlays){if(B===0){this.setBaseLayer(D)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(B,C){var A=this.getLayerIndex(B)+C;this.setLayerIndex(B,A)},setBaseLayer:function(C){if(C!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,C)!=-1){var A=this.getCachedCenter();var D=OpenLayers.Util.getResolutionFromScale(this.getScale(),C.units);if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=C;if(!this.allOverlays||this.baseLayer.visibility){this.baseLayer.setVisibility(true);if(this.baseLayer.inRange===false){this.baseLayer.redraw()}}if(A!=null){var B=this.getZoomForResolution(D||this.resolution,true);this.setCenter(A,B,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(B,A){this.controls.push(B);this.addControlToMap(B,A)},addControls:function(B,G){var E=(arguments.length===1)?[]:G;for(var D=0,A=B.length;D<A;D++){var F=B[D];var C=(E[D])?E[D]:null;this.addControl(F,C)}},addControlToMap:function(B,A){B.outsideViewport=(B.div!=null);if(this.displayProjection&&!B.displayProjection){B.displayProjection=this.displayProjection}B.setMap(this);var C=B.draw(A);if(C){if(!B.outsideViewport){C.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(C)}}if(B.autoActivate){B.activate()}},getControl:function(E){var B=null;for(var C=0,A=this.controls.length;C<A;C++){var D=this.controls[C];if(D.id==E){B=D;break}}return B},removeControl:function(A){if((A)&&(A==this.getControl(A.id))){if(A.div&&(A.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(A.div)}OpenLayers.Util.removeItem(this.controls,A)}},addPopup:function(A,D){if(D){for(var B=this.popups.length-1;B>=0;--B){this.removePopup(this.popups[B])}}A.map=this;this.popups.push(A);var C=A.draw();if(C){C.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(C)}},removePopup:function(A){OpenLayers.Util.removeItem(this.popups,A);if(A.div){try{this.layerContainerDiv.removeChild(A.div)}catch(B){}}A.map=null},getSize:function(){var A=null;if(this.size!=null){A=this.size.clone()}return A},updateSize:function(){var C=this.getCurrentSize();if(C&&!isNaN(C.h)&&!isNaN(C.w)){this.events.clearMouseCache();var F=this.getSize();if(F==null){this.size=F=C}if(!C.equals(F)){this.size=C;for(var D=0,B=this.layers.length;D<B;D++){this.layers[D].onMapResize()}var A=this.getCachedCenter();if(this.baseLayer!=null&&A!=null){var E=this.getZoom();this.zoom=null;this.setCenter(A,E)}}}},getCurrentSize:function(){var A=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(A.w==0&&A.h==0||isNaN(A.w)&&isNaN(A.h)){A.w=this.div.offsetWidth;A.h=this.div.offsetHeight}if(A.w==0&&A.h==0||isNaN(A.w)&&isNaN(A.h)){A.w=parseInt(this.div.style.width);A.h=parseInt(this.div.style.height)}return A},calculateBounds:function(A,B){var C=null;if(A==null){A=this.getCachedCenter()}if(B==null){B=this.getResolution()}if((A!=null)&&(B!=null)){var D=(this.size.w*B)/2;var E=(this.size.h*B)/2;C=new OpenLayers.Bounds(A.lon-D,A.lat-E,A.lon+D,A.lat+E)}return C},getCenter:function(){var A=null;var B=this.getCachedCenter();if(B){A=B.clone()}return A},getCachedCenter:function(){if(!this.center&&this.size){this.center=this.getLonLatFromViewPortPx({x:this.size.w/2,y:this.size.h/2})}return this.center},getZoom:function(){return this.zoom},pan:function(D,C,E){E=OpenLayers.Util.applyDefaults(E,{animate:true,dragging:false});if(E.dragging){if(D!=0||C!=0){this.moveByPx(D,C)}}else{var F=this.getViewPortPxFromLonLat(this.getCachedCenter());var B=F.add(D,C);if(this.dragging||!B.equals(F)){var A=this.getLonLatFromViewPortPx(B);if(E.animate){this.panTo(A)}else{this.moveTo(A);if(this.dragging){this.dragging=false;this.events.triggerEvent("moveend")}}}}},panTo:function(D){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(D)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var A=this.getCachedCenter();if(D.equals(A)){return }var F=this.getPixelFromLonLat(A);var E=this.getPixelFromLonLat(D);var B={x:E.x-F.x,y:E.y-F.y};var C={x:0,y:0};this.panTween.start({x:0,y:0},B,this.panDuration,{callbacks:{eachStep:OpenLayers.Function.bind(function(H){var G=H.x-C.x,I=H.y-C.y;this.moveByPx(G,I);C.x=Math.round(H.x);C.y=Math.round(H.y)},this),done:OpenLayers.Function.bind(function(G){this.moveTo(D);this.dragging=false;this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(D)}},setCenter:function(C,A,B,D){this.panTween&&this.panTween.stop();this.moveTo(C,A,{dragging:B,forceZoomChange:D})},moveByPx:function(L,K){var F=this.size.w/2;var A=this.size.h/2;var I=F+L;var H=A+K;var B=this.baseLayer.wrapDateLine;var J=0;var G=0;if(this.restrictedExtent){J=F;G=A;B=false}L=B||I<=this.maxPx.x-J&&I>=this.minPx.x+J?Math.round(L):0;K=H<=this.maxPx.y-G&&H>=this.minPx.y+G?Math.round(K):0;if(L||K){if(!this.dragging){this.dragging=true;this.events.triggerEvent("movestart")}this.center=null;if(L){this.layerContainerDiv.style.left=parseInt(this.layerContainerDiv.style.left)-L+"px";this.minPx.x-=L;this.maxPx.x-=L}if(K){this.layerContainerDiv.style.top=parseInt(this.layerContainerDiv.style.top)-K+"px";this.minPx.y-=K;this.maxPx.y-=K}var D,C,E;for(C=0,E=this.layers.length;C<E;++C){D=this.layers[C];if(D.visibility&&(D===this.baseLayer||D.inRange)){D.moveByPx(L,K);D.events.triggerEvent("move")}}this.events.triggerEvent("move")}},adjustZoom:function(F){var C,A=this.baseLayer.resolutions,B=this.getMaxExtent().getWidth()/this.size.w;if(this.getResolutionForZoom(F)>B){for(var D=F|0,E=A.length;D<E;++D){if(A[D]<=B){F=D;break}}}return F},moveTo:function(H,B,E){if(H!=null&&!(H instanceof OpenLayers.LonLat)){H=new OpenLayers.LonLat(H)}if(!E){E={}}if(B!=null){B=parseFloat(B);if(!this.fractionalZoom){B=Math.round(B)}}if(this.baseLayer.wrapDateLine){var L=B;B=this.adjustZoom(B);if(B!==L){H=this.getCenter()}}var O=E.dragging||this.dragging;var J=E.forceZoomChange;if(!this.getCachedCenter()&&!this.isValidLonLat(H)){H=this.maxExtent.getCenterLonLat();this.center=H.clone()}if(this.restrictedExtent!=null){if(H==null){H=this.center}if(B==null){B=this.getZoom()}var P=this.getResolutionForZoom(B);var M=this.calculateBounds(H,P);if(!this.restrictedExtent.containsBounds(M)){var V=this.restrictedExtent.getCenterLonLat();if(M.getWidth()>this.restrictedExtent.getWidth()){H=new OpenLayers.LonLat(V.lon,H.lat)}else{if(M.left<this.restrictedExtent.left){H=H.add(this.restrictedExtent.left-M.left,0)}else{if(M.right>this.restrictedExtent.right){H=H.add(this.restrictedExtent.right-M.right,0)}}}if(M.getHeight()>this.restrictedExtent.getHeight()){H=new OpenLayers.LonLat(H.lon,V.lat)}else{if(M.bottom<this.restrictedExtent.bottom){H=H.add(0,this.restrictedExtent.bottom-M.bottom)}else{if(M.top>this.restrictedExtent.top){H=H.add(0,this.restrictedExtent.top-M.top)}}}}}var K=J||((this.isValidZoomLevel(B))&&(B!=this.getZoom()));var G=(this.isValidLonLat(H))&&(!H.equals(this.center));if(K||G||O){O||this.events.triggerEvent("movestart");if(G){if(!K&&this.center){this.centerLayerContainer(H)}this.center=H.clone()}var W=K?this.getResolutionForZoom(B):this.getResolution();if(K||this.layerContainerOrigin==null){this.layerContainerOrigin=this.getCachedCenter();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px";var N=this.getMaxExtent({restricted:true});var D=N.getCenterLonLat();var I=this.center.lon-D.lon;var C=D.lat-this.center.lat;var T=Math.round(N.getWidth()/W);var S=Math.round(N.getHeight()/W);this.minPx={x:(this.size.w-T)/2-I/W,y:(this.size.h-S)/2-C/W};this.maxPx={x:this.minPx.x+Math.round(N.getWidth()/W),y:this.minPx.y+Math.round(N.getHeight()/W)}}if(K){this.zoom=B;this.resolution=W}var F=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(F,K,E.dragging);E.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:K})}F=this.baseLayer.getExtent();for(var Q=this.layers.length-1;Q>=0;--Q){var U=this.layers[Q];if(U!==this.baseLayer&&!U.isBaseLayer){var A=U.calculateInRange();if(U.inRange!=A){U.inRange=A;if(!A){U.display(false)}this.events.triggerEvent("changelayer",{layer:U,property:"visibility"})}if(A&&U.visibility){U.moveTo(F,K,E.dragging);E.dragging||U.events.triggerEvent("moveend",{zoomChanged:K})}}}this.events.triggerEvent("move");O||this.events.triggerEvent("moveend");if(K){for(var Q=0,R=this.popups.length;Q<R;Q++){this.popups[Q].updatePosition()}this.events.triggerEvent("zoomend")}}},centerLayerContainer:function(C){var D=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var G=this.getViewPortPxFromLonLat(C);if((D!=null)&&(G!=null)){var A=parseInt(this.layerContainerDiv.style.left);var B=parseInt(this.layerContainerDiv.style.top);var F=Math.round(D.x-G.x);var E=Math.round(D.y-G.y);this.layerContainerDiv.style.left=F+"px";this.layerContainerDiv.style.top=E+"px";var I=A-F;var H=B-E;this.minPx.x-=I;this.maxPx.x-=I;this.minPx.y-=H;this.maxPx.y-=H}},isValidZoomLevel:function(A){return((A!=null)&&(A>=0)&&(A<this.getNumZoomLevels()))},isValidLonLat:function(D){var C=false;if(D!=null){var A=this.getMaxExtent();var B=this.baseLayer.wrapDateLine&&A;C=A.containsLonLat(D,{worldBounds:B})}return C},getProjection:function(){var A=this.getProjectionObject();return A?A.getCode():null},getProjectionObject:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.projection}return A},getMaxResolution:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.maxResolution}return A},getMaxExtent:function(B){var A=null;if(B&&B.restricted&&this.restrictedExtent){A=this.restrictedExtent}else{if(this.baseLayer!=null){A=this.baseLayer.maxExtent}}return A},getNumZoomLevels:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.numZoomLevels}return A},getExtent:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getExtent()}return A},getResolution:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getResolution()}else{if(this.allOverlays===true&&this.layers.length>0){A=this.layers[0].getResolution()}}return A},getUnits:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.units}return A},getScale:function(){var C=null;if(this.baseLayer!=null){var B=this.getResolution();var A=this.baseLayer.units;C=OpenLayers.Util.getScaleFromResolution(B,A)}return C},getZoomForExtent:function(C,B){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getZoomForExtent(C,B)}return A},getResolutionForZoom:function(B){var A=null;if(this.baseLayer){A=this.baseLayer.getResolutionForZoom(B)}return A},getZoomForResolution:function(A,C){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getZoomForResolution(A,C)}return B},zoomTo:function(A){if(this.isValidZoomLevel(A)){this.setCenter(null,A)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(D,C){if(!(D instanceof OpenLayers.Bounds)){D=new OpenLayers.Bounds(D)}var B=D.getCenterLonLat();if(this.baseLayer.wrapDateLine){var A=this.getMaxExtent();D=D.clone();while(D.right<D.left){D.right+=A.getWidth()}B=D.getCenterLonLat().wrapDateLine(A)}this.setCenter(B,this.getZoomForExtent(D,C))},zoomToMaxExtent:function(C){var B=(C)?C.restricted:true;var A=this.getMaxExtent({restricted:B});this.zoomToExtent(A)},zoomToScale:function(G,D){var B=OpenLayers.Util.getResolutionFromScale(G,this.baseLayer.units);var E=(this.size.w*B)/2;var F=(this.size.h*B)/2;var A=this.getCachedCenter();var C=new OpenLayers.Bounds(A.lon-E,A.lat-F,A.lon+E,A.lat+F);this.zoomToExtent(C,D)},getLonLatFromViewPortPx:function(A){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getLonLatFromViewPortPx(A)}return B},getViewPortPxFromLonLat:function(B){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getViewPortPxFromLonLat(B)}return A},getLonLatFromPixel:function(A){return this.getLonLatFromViewPortPx(A)},getPixelFromLonLat:function(B){var A=this.getViewPortPxFromLonLat(B);A.x=Math.round(A.x);A.y=Math.round(A.y);return A},getGeodesicPixelSize:function(G){var D=G?this.getLonLatFromPixel(G):(this.getCachedCenter()||new OpenLayers.LonLat(0,0));var E=this.getResolution();var C=D.add(-E/2,0);var I=D.add(E/2,0);var B=D.add(0,-E/2);var F=D.add(0,E/2);var H=new OpenLayers.Projection("EPSG:4326");var A=this.getProjectionObject()||H;if(!A.equals(H)){C.transform(A,H);I.transform(A,H);B.transform(A,H);F.transform(A,H)}return new OpenLayers.Size(OpenLayers.Util.distVincenty(C,I),OpenLayers.Util.distVincenty(B,F))},getViewPortPxFromLayerPx:function(D){var C=null;if(D!=null){var B=parseInt(this.layerContainerDiv.style.left);var A=parseInt(this.layerContainerDiv.style.top);C=D.add(B,A)}return C},getLayerPxFromViewPortPx:function(C){var D=null;if(C!=null){var B=-parseInt(this.layerContainerDiv.style.left);var A=-parseInt(this.layerContainerDiv.style.top);D=C.add(B,A);if(isNaN(D.x)||isNaN(D.y)){D=null}}return D},getLonLatFromLayerPx:function(A){A=this.getViewPortPxFromLayerPx(A);return this.getLonLatFromViewPortPx(A)},getLayerPxFromLonLat:function(B){var A=this.getPixelFromLonLat(B);return this.getLayerPxFromViewPortPx(A)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:1,alwaysInRange:null,RESOLUTION_PROPERTIES:["scales","resolutions","maxScale","minScale","maxResolution","minResolution","numZoomLevels","maxZoomLevel"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,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:false,wrapDateLine:false,metadata:null,initialize:function(B,A){this.metadata={};this.addOptions(A);this.name=B;if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLayers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.div.dir="ltr";this.events=new OpenLayers.Events(this,this.div);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}}},destroy:function(A){if(A==null){A=true}if(this.map!=null){this.map.removeLayer(this,A)}this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},clone:function(A){if(A==null){A=new OpenLayers.Layer(this.name,this.getOptions())}OpenLayers.Util.applyDefaults(A,this);A.map=null;return A},getOptions:function(){var A={};for(var B in this.options){A[B]=this[B]}return A},setName:function(A){if(A!=this.name){this.name=A;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(E,A){if(this.options==null){this.options={}}if(E){if(typeof E.projection=="string"){E.projection=new OpenLayers.Projection(E.projection)}if(E.projection){OpenLayers.Util.applyDefaults(E,OpenLayers.Projection.defaults[E.projection.getCode()])}if(E.maxExtent&&!(E.maxExtent instanceof OpenLayers.Bounds)){E.maxExtent=new OpenLayers.Bounds(E.maxExtent)}if(E.minExtent&&!(E.minExtent instanceof OpenLayers.Bounds)){E.minExtent=new OpenLayers.Bounds(E.minExtent)}}OpenLayers.Util.extend(this.options,E);OpenLayers.Util.extend(this,E);if(this.projection&&this.projection.getUnits()){this.units=this.projection.getUnits()}if(this.map){var B=this.map.getResolution();var C=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]);for(var D in E){if(E.hasOwnProperty(D)&&OpenLayers.Util.indexOf(C,D)>=0){this.initResolutions();if(A&&this.map.baseLayer===this){this.map.setCenter(this.map.getCenter(),this.map.getZoomForResolution(B),false,true);this.map.events.triggerEvent("changebaselayer",{layer:this})}break}}}},onMapResize:function(){},redraw:function(){var B=false;if(this.map){this.inRange=this.calculateInRange();var C=this.getExtent();if(C&&this.inRange&&this.visibility){var A=true;this.moveTo(C,A,false);this.events.triggerEvent("moveend",{zoomChanged:A});B=true}}return B},moveTo:function(B,A,C){var D=this.visibility;if(!this.isBaseLayer){D=D&&this.inRange}this.display(D)},moveByPx:function(B,A){},setMap:function(B){if(this.map==null){this.map=B;this.maxExtent=this.maxExtent||this.map.maxExtent;this.minExtent=this.minExtent||this.map.minExtent;this.projection=this.projection||this.map.projection;if(typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var A=((this.visibility)&&(this.inRange));this.div.style.display=A?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(A){},getImageSize:function(A){return(this.imageSize||this.tileSize)},setTileSize:function(A){var B=(A)?A:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=B;if(this.gutter){this.imageSize=new OpenLayers.Size(B.w+(2*this.gutter),B.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(A){if(A!=this.visibility){this.visibility=A;this.display(A);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(A){if(A!=(this.div.style.display!="none")){this.div.style.display=(A&&this.calculateInRange())?"block":"none"}},calculateInRange:function(){var B=false;if(this.alwaysInRange){B=true}else{if(this.map){var A=this.map.getResolution();B=((A>=this.minResolution)&&(A<=this.maxResolution))}}return B},setIsBaseLayer:function(A){if(A!=this.isBaseLayer){this.isBaseLayer=A;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var E,A,H;var F={},D=true;for(E=0,A=this.RESOLUTION_PROPERTIES.length;E<A;E++){H=this.RESOLUTION_PROPERTIES[E];F[H]=this.options[H];if(D&&this.options[H]){D=false}}if(this.alwaysInRange==null){this.alwaysInRange=D}if(F.resolutions==null){F.resolutions=this.resolutionsFromScales(F.scales)}if(F.resolutions==null){F.resolutions=this.calculateResolutions(F)}if(F.resolutions==null){for(E=0,A=this.RESOLUTION_PROPERTIES.length;E<A;E++){H=this.RESOLUTION_PROPERTIES[E];F[H]=this.options[H]!=null?this.options[H]:this.map[H]}if(F.resolutions==null){F.resolutions=this.resolutionsFromScales(F.scales)}if(F.resolutions==null){F.resolutions=this.calculateResolutions(F)}}var C;if(this.options.maxResolution&&this.options.maxResolution!=="auto"){C=this.options.maxResolution}if(this.options.minScale){C=OpenLayers.Util.getResolutionFromScale(this.options.minScale,this.units)}var B;if(this.options.minResolution&&this.options.minResolution!=="auto"){B=this.options.minResolution}if(this.options.maxScale){B=OpenLayers.Util.getResolutionFromScale(this.options.maxScale,this.units)}if(F.resolutions){F.resolutions.sort(function(J,I){return(I-J)});if(!C){C=F.resolutions[0]}if(!B){var G=F.resolutions.length-1;B=F.resolutions[G]}}this.resolutions=F.resolutions;if(this.resolutions){A=this.resolutions.length;this.scales=new Array(A);for(E=0;E<A;E++){this.scales[E]=OpenLayers.Util.getScaleFromResolution(this.resolutions[E],this.units)}this.numZoomLevels=A}this.minResolution=B;if(B){this.maxScale=OpenLayers.Util.getScaleFromResolution(B,this.units)}this.maxResolution=C;if(C){this.minScale=OpenLayers.Util.getScaleFromResolution(C,this.units)}},resolutionsFromScales:function(D){if(D==null){return }var B,C,A;A=D.length;B=new Array(A);for(C=0;C<A;C++){B[C]=OpenLayers.Util.getResolutionFromScale(D[C],this.units)}return B},calculateResolutions:function(J){var K,I,G;var L=J.maxResolution;if(J.minScale!=null){L=OpenLayers.Util.getResolutionFromScale(J.minScale,this.units)}else{if(L=="auto"&&this.maxExtent!=null){K=this.map.getSize();I=this.maxExtent.getWidth()/K.w;G=this.maxExtent.getHeight()/K.h;L=Math.max(I,G)}}var F=J.minResolution;if(J.maxScale!=null){F=OpenLayers.Util.getResolutionFromScale(J.maxScale,this.units)}else{if(J.minResolution=="auto"&&this.minExtent!=null){K=this.map.getSize();I=this.minExtent.getWidth()/K.w;G=this.minExtent.getHeight()/K.h;F=Math.max(I,G)}}if(typeof L!=="number"&&typeof F!=="number"&&this.maxExtent!=null){var M=this.map.getTileSize();L=Math.max(this.maxExtent.getWidth()/M.w,this.maxExtent.getHeight()/M.h)}var A=J.maxZoomLevel;var B=J.numZoomLevels;if(typeof F==="number"&&typeof L==="number"&&B===undefined){var H=L/F;B=Math.floor(Math.log(H)/Math.log(2))+1}else{if(B===undefined&&A!=null){B=A+1}}if(typeof B!=="number"||B<=0||(typeof L!=="number"&&typeof F!=="number")){return }var D=new Array(B);var C=2;if(typeof F=="number"&&typeof L=="number"){C=Math.pow((L/F),(1/(B-1)))}var E;if(typeof L==="number"){for(E=0;E<B;E++){D[E]=L/Math.pow(C,E)}}else{for(E=0;E<B;E++){D[B-1-E]=F*Math.pow(C,E)}}return D},getResolution:function(){var A=this.map.getZoom();return this.getResolutionForZoom(A)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(B,C){var D=this.map.getSize();var A=Math.max(B.getWidth()/D.w,B.getHeight()/D.h);return this.getZoomForResolution(A,C)},getDataExtent:function(){},getResolutionForZoom:function(C){C=Math.max(0,Math.min(C,this.resolutions.length-1));var B;if(this.map.fractionalZoom){var A=Math.floor(C);var D=Math.ceil(C);B=this.resolutions[A]-((C-A)*(this.resolutions[A]-this.resolutions[D]))}else{B=this.resolutions[Math.round(C)]}return B},getZoomForResolution:function(E,B){var M,F,G;if(this.map.fractionalZoom){var J=0;var C=this.resolutions.length-1;var D=this.resolutions[J];var A=this.resolutions[C];var I;for(F=0,G=this.resolutions.length;F<G;++F){I=this.resolutions[F];if(I>=E){D=I;J=F}if(I<=E){A=I;C=F;break}}var H=D-A;if(H>0){M=J+((D-E)/H)}else{M=J}}else{var K;var L=Number.POSITIVE_INFINITY;for(F=0,G=this.resolutions.length;F<G;F++){if(B){K=Math.abs(this.resolutions[F]-E);if(K>L){break}L=K}else{if(this.resolutions[F]<E){break}}}M=Math.max(0,F-1)}return M},getLonLatFromViewPortPx:function(B){var D=null;var F=this.map;if(B!=null&&F.minPx){var C=F.getResolution();var A=F.getMaxExtent({restricted:true});var G=(B.x-F.minPx.x)*C+A.left;var E=(F.minPx.y-B.y)*C+A.top;D=new OpenLayers.LonLat(G,E);if(this.wrapDateLine){D=D.wrapDateLine(this.maxExtent)}}return D},getViewPortPxFromLonLat:function(D,A){var B=null;if(D!=null){A=A||this.map.getResolution();var C=this.map.calculateBounds(null,A);B=new OpenLayers.Pixel((1/A*(D.lon-C.left)),(1/A*(C.top-D.lat)))}return B},setOpacity:function(B){if(B!=this.opacity){this.opacity=B;var F=this.div.childNodes;for(var D=0,A=F.length;D<A;++D){var C=F[D].firstChild||F[D];var E=F[D].lastChild;if(E&&E.nodeName.toLowerCase()==="iframe"){C=E.parentNode}OpenLayers.Util.modifyDOMElement(C,null,null,null,null,null,null,B)}if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(A){this.div.style.zIndex=A},adjustBounds:function(B){if(this.gutter){var A=this.gutter*this.map.getResolution();B=new OpenLayers.Bounds(B.left-A,B.bottom-A,B.right+A,B.top+A)}if(this.wrapDateLine){var C={rightTolerance:this.getResolution(),leftTolerance:this.getResolution()};B=B.wrapDateLine(this.maxExtent,C)}return B},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var A=null;if(this.sphericalMercator){A=this.map.calculateBounds()}else{A=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return A},getLonLatFromViewPortPx:function(A){return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this,arguments)},getViewPortPxFromLonLat:function(A){return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this,arguments)},initMercatorParameters:function(){this.RESOLUTIONS=[];var A=156543.03390625;for(var B=0;B<=this.MAX_ZOOM_LEVEL;++B){this.RESOLUTIONS[B]=A/Math.pow(2,B)}this.units="m";this.projection=this.projection||"EPSG:900913"},forwardMercator:(function(){var A=new OpenLayers.Projection("EPSG:4326");var B=new OpenLayers.Projection("EPSG:900913");return function(E,D){var C=OpenLayers.Projection.transform({x:E,y:D},A,B);return new OpenLayers.LonLat(C.x,C.y)}})(),inverseMercator:(function(){var A=new OpenLayers.Projection("EPSG:4326");var B=new OpenLayers.Projection("EPSG:900913");return function(D,E){var C=OpenLayers.Projection.transform({x:D,y:E},B,A);return new OpenLayers.LonLat(C.x,C.y)}})()};OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(B,A){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(this.pane==null){this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")}},destroy:function(){this.mapObject=null;this.pane=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(A){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(OpenLayers.BROWSER_NAME=="msie"){this.pane.style.background="url("+OpenLayers.Util.getImageLocation("blank.gif")+")"}if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane)}else{this.map.layerContainerDiv.appendChild(this.pane)}this.loadMapObject();if(this.mapObject==null){this.loadWarningMessage()}},removeMap:function(A){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane)}OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var G=this.map.getSize();var A=Math.min(G.w,300);var E=Math.min(G.h,200);var B=new OpenLayers.Size(A,E);var D=new OpenLayers.Pixel(G.w/2,G.h/2);var C=D.add(-B.w/2,-B.h/2);var F=OpenLayers.Util.createDiv(this.name+"_warning",C,B,null,null,null,"auto");F.style.padding="7px";F.style.backgroundColor="yellow";F.innerHTML=this.getWarningHTML();this.div.appendChild(F)},getWarningHTML:function(){return""},display:function(A){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(A){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveByPx:function(B,A){OpenLayers.Layer.prototype.moveByPx.apply(this,arguments);if(this.dragPanMapObject){this.dragPanMapObject(B,-A)}else{this.moveTo(this.map.getCachedCenter())}},moveTo:function(C,D,J){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var E=this.map.getCenter();var G=this.map.getZoom();if(E!=null){var F=this.getMapObjectCenter();var B=this.getOLLonLatFromMapObjectLonLat(F);var H=this.getMapObjectZoom();var M=this.getOLZoomFromMapObjectZoom(H);if(!(E.equals(B))||G!=M){if(!D&&B&&this.dragPanMapObject&&this.smoothDragPan){var I=this.map.getViewPortPxFromLonLat(B);var K=this.map.getViewPortPxFromLonLat(E);this.dragPanMapObject(K.x-I.x,I.y-K.y)}else{var A=this.getMapObjectLonLatFromOLLonLat(E);var L=this.getMapObjectZoomFromOLZoom(G);this.setMapObjectCenter(A,L,J)}}}}},getLonLatFromViewPortPx:function(A){var B=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var D=this.getMapObjectPixelFromOLPixel(A);var C=this.getMapObjectLonLatFromMapObjectPixel(D);B=this.getOLLonLatFromMapObjectLonLat(C)}return B},getViewPortPxFromLonLat:function(B){var A=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var D=this.getMapObjectLonLatFromOLLonLat(B);var C=this.getMapObjectPixelFromMapObjectLonLat(D);A=this.getOLPixelFromMapObjectPixel(C)}return A},getOLLonLatFromMapObjectLonLat:function(D){var A=null;if(D!=null){var C=this.getLongitudeFromMapObjectLonLat(D);var B=this.getLatitudeFromMapObjectLonLat(D);A=new OpenLayers.LonLat(C,B)}return A},getMapObjectLonLatFromOLLonLat:function(A){var B=null;if(A!=null){B=this.getMapObjectLonLatFromLonLat(A.lon,A.lat)}return B},getOLPixelFromMapObjectPixel:function(D){var B=null;if(D!=null){var A=this.getXFromMapObjectPixel(D);var C=this.getYFromMapObjectPixel(D);B=new OpenLayers.Pixel(A,C)}return B},getMapObjectPixelFromOLPixel:function(A){var B=null;if(A!=null){B=this.getMapObjectPixelFromXY(A.x,A.y)}return B},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var C=["minZoomLevel","maxZoomLevel","numZoomLevels"];for(var B=0,A=C.length;B<A;B++){var F=C[B];this[F]=(this.options[F]!=null)?this.options[F]:this.map[F]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var G;var E=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){G=this.maxZoomLevel-this.minZoomLevel+1}else{G=this.numZoomLevels}if(G!=null){this.numZoomLevels=Math.min(G,E)}else{this.numZoomLevels=E}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var D=0;this.resolutions=[];for(var B=this.minZoomLevel;B<=this.maxZoomLevel;B++){this.resolutions[D++]=this.RESOLUTIONS[B]}this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getResolution.apply(this,arguments)}else{var A=null;var C=this.map.getSize();var B=this.getExtent();if((C!=null)&&(B!=null)){A=Math.max(B.getWidth()/C.w,B.getHeight()/C.h)}return A}},getExtent:function(){var C=this.map.getSize();var A=this.getLonLatFromViewPortPx({x:0,y:0});var B=this.getLonLatFromViewPortPx({x:C.w,y:C.h});if((A!=null)&&(B!=null)){return new OpenLayers.Bounds(A.lon,B.lat,B.lon,A.lat)}else{return null}},getZoomForResolution:function(A){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)}else{var B=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(B)}},getOLZoomFromMapObjectZoom:function(A){var B=null;if(A!=null){B=A-this.minZoomLevel;if(this.map.baseLayer!==this){B=this.map.baseLayer.getZoomForResolution(this.getResolutionForZoom(B))}}return B},getMapObjectZoomFromOLZoom:function(A){var B=null;if(A!=null){B=A+this.minZoomLevel;if(this.map.baseLayer!==this){B=this.getZoomForResolution(this.map.baseLayer.getResolutionForZoom(B))}}return B},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,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031,0.00000536441802978515,0.00000268220901489257,0.000001341104507446289,6.705522537231445e-7],type:null,wrapDateLine:true,sphericalMercator:false,version:null,initialize:function(C,B){B=B||{};if(!B.version){B.version=typeof GMap2==="function"?"2":"3"}var A=OpenLayers.Layer.Google["v"+B.version.replace(/\./g,"_")];if(A){OpenLayers.Util.applyDefaults(B,A)}else{throw"Unsupported Google Maps API version: "+B.version}OpenLayers.Util.applyDefaults(B,A.DEFAULTS);if(B.maxExtent){B.maxExtent=B.maxExtent.clone()}OpenLayers.Layer.EventPane.prototype.initialize.apply(this,[C,B]);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,[C,B]);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},clone:function(){return new OpenLayers.Layer.Google(this.name,this.getOptions())},setVisibility:function(B){var A=this.opacity==null?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments);this.setOpacity(A)},display:function(A){if(!this._dragging){this.setGMapVisibility(A)}OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments)},moveTo:function(B,A,C){this._dragging=C;OpenLayers.Layer.EventPane.prototype.moveTo.apply(this,arguments);delete this._dragging},setOpacity:function(B){if(B!==this.opacity){if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}this.opacity=B}if(this.getVisibility()){var A=this.getMapContainer();OpenLayers.Util.modifyDOMElement(A,null,null,null,null,null,null,B)}},destroy:function(){if(this.map){this.setGMapVisibility(false);var A=OpenLayers.Layer.Google.cache[this.map.id];if(A&&A.count<=1){this.removeGMapElements()}}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var D=OpenLayers.Layer.Google.cache[this.map.id];if(D){var B=this.mapObject&&this.getMapContainer();if(B&&B.parentNode){B.parentNode.removeChild(B)}var C=D.termsOfUse;if(C&&C.parentNode){C.parentNode.removeChild(C)}var A=D.poweredBy;if(A&&A.parentNode){A.parentNode.removeChild(A)}}},removeMap:function(B){if(this.visibility&&this.mapObject){this.setGMapVisibility(false)}var A=OpenLayers.Layer.Google.cache[B.id];if(A){if(A.count<=1){this.removeGMapElements();delete OpenLayers.Layer.Google.cache[B.id]}else{--A.count}}delete this.termsOfUse;delete this.poweredBy;delete this.mapObject;delete this.dragObject;OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(B){var C=null;if(B!=null){var A=B.getSouthWest();var D=B.getNorthEast();if(this.sphericalMercator){A=this.forwardMercator(A.lng(),A.lat());D=this.forwardMercator(D.lng(),D.lat())}else{A=new OpenLayers.LonLat(A.lng(),A.lat());D=new OpenLayers.LonLat(D.lng(),D.lat())}C=new OpenLayers.Bounds(A.lon,A.lat,D.lon,D.lat)}return C},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getLongitudeFromMapObjectLonLat:function(A){return this.sphericalMercator?this.forwardMercator(A.lng(),A.lat()).lon:A.lng()},getLatitudeFromMapObjectLonLat:function(B){var A=this.sphericalMercator?this.forwardMercator(B.lng(),B.lat()).lat:B.lat();return A},getXFromMapObjectPixel:function(A){return A.x},getYFromMapObjectPixel:function(A){return A.y},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Google.cache={};OpenLayers.Layer.Google.v2={termsOfUse:null,poweredBy:null,dragObject:null,loadMapObject:function(){if(!this.type){this.type=G_NORMAL_MAP}var F,D,A;var C=OpenLayers.Layer.Google.cache[this.map.id];if(C){F=C.mapObject;D=C.termsOfUse;A=C.poweredBy;++C.count}else{var B=this.map.viewPortDiv;var G=document.createElement("div");G.id=this.map.id+"_GMap2Container";G.style.position="absolute";G.style.width="100%";G.style.height="100%";B.appendChild(G);try{F=new GMap2(G);D=G.lastChild;B.appendChild(D);D.style.zIndex="1100";D.style.right="";D.style.bottom="";D.className="olLayerGoogleCopyright";A=G.lastChild;B.appendChild(A);A.style.zIndex="1100";A.style.right="";A.style.bottom="";A.className="olLayerGooglePoweredBy gmnoprint"}catch(E){throw (E)}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:F,termsOfUse:D,poweredBy:A,count:1}}this.mapObject=F;this.termsOfUse=D;this.poweredBy=A;if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)===-1){this.mapObject.addMapType(this.type)}if(typeof F.getDragObject=="function"){this.dragObject=F.getDragObject()}else{this.dragPanMapObject=null}if(this.isBaseLayer===false){this.setGMapVisibility(this.div.style.display!=="none")}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize()}else{if(!this._resized){var A=this;var B=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(B);delete A._resized;A.mapObject.checkResize();A.moveTo(A.map.getCenter(),A.map.getZoom())})}this._resized=true}},setGMapVisibility:function(C){var B=OpenLayers.Layer.Google.cache[this.map.id];if(B){var A=this.mapObject.getContainer();if(C===true){this.mapObject.setMapType(this.type);A.style.display="";this.termsOfUse.style.left="";this.termsOfUse.style.display="";this.poweredBy.style.display="";B.displayed=this.id}else{if(B.displayed===this.id){delete B.displayed}if(!B.displayed){A.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(C){var B=null;if(C!=null){var A=this.sphericalMercator?this.inverseMercator(C.bottom,C.left):new OpenLayers.LonLat(C.bottom,C.left);var D=this.sphericalMercator?this.inverseMercator(C.top,C.right):new OpenLayers.LonLat(C.top,C.right);B=new GLatLngBounds(new GLatLng(A.lat,A.lon),new GLatLng(D.lat,D.lon))}return B},setMapObjectCenter:function(A,B){this.mapObject.setCenter(A,B)},dragPanMapObject:function(B,A){this.dragObject.moveBy(new GSize(-B,A))},getMapObjectLonLatFromMapObjectPixel:function(A){return this.mapObject.fromContainerPixelToLatLng(A)},getMapObjectPixelFromMapObjectLonLat:function(A){return this.mapObject.fromLatLngToContainerPixel(A)},getMapObjectZoomFromMapObjectBounds:function(A){return this.mapObject.getBoundsZoomLevel(A)},getMapObjectLonLatFromLonLat:function(D,B){var C;if(this.sphericalMercator){var A=this.inverseMercator(D,B);C=new GLatLng(A.lat,A.lon)}else{C=new GLatLng(B,D)}return C},getMapObjectPixelFromXY:function(A,B){return new GPoint(A,B)}};OpenLayers.Format.WFST=function(B){B=OpenLayers.Util.applyDefaults(B,OpenLayers.Format.WFST.DEFAULTS);var A=OpenLayers.Format.WFST["v"+B.version.replace(/\./g,"_")];if(!A){throw"Unsupported WFST version: "+B.version}return new A(B)};OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"};OpenLayers.Format.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:true,xy:true,stateName:null,initialize:function(A){this.stateName={};this.stateName[OpenLayers.State.INSERT]="wfs:Insert";this.stateName[OpenLayers.State.UPDATE]="wfs:Update";this.stateName[OpenLayers.State.DELETE]="wfs:Delete";OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},getSrsName:function(C,B){var A=B&&B.srsName;if(!A){if(C&&C.layer){A=C.layer.projection.getCode()}else{A=this.srsName}}return A},read:function(B,A){A=A||{};OpenLayers.Util.applyDefaults(A,{output:"features"});if(typeof B=="string"){B=OpenLayers.Format.XML.prototype.read.apply(this,[B])}if(B&&B.nodeType==9){B=B.documentElement}var C={};if(B){this.readNode(B,C,true)}if(C.features&&A.output==="features"){C=C.features}return C},readers:{wfs:{FeatureCollection:function(A,B){B.features=[];this.readChildNodes(A,B)}}},write:function(B,A){var C=this.writeNode("wfs:Transaction",{features:B,options:A});var D=this.schemaLocationAttr();if(D){this.setAttributeNS(C,this.namespaces.xsi,"xsi:schemaLocation",D)}return OpenLayers.Format.XML.prototype.write.apply(this,[C])},writers:{wfs:{GetFeature:function(B){var D=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,handle:B&&B.handle,outputFormat:B&&B.outputFormat,maxFeatures:B&&B.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(B)}});if(typeof this.featureType=="string"){this.writeNode("Query",B,D)}else{for(var C=0,A=this.featureType.length;C<A;C++){B.featureType=this.featureType[C];this.writeNode("Query",B,D)}}return D},Transaction:function(H){H=H||{};var C=H.options||{};var G=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version,handle:C.handle}});var E,A;var F=H.features;if(F){if(C.multi===true){OpenLayers.Util.extend(this.geometryTypes,{"OpenLayers.Geometry.Point":"MultiPoint","OpenLayers.Geometry.LineString":(this.multiCurve===true)?"MultiCurve":"MultiLineString","OpenLayers.Geometry.Polygon":(this.multiSurface===true)?"MultiSurface":"MultiPolygon"})}var B,D;for(E=0,A=F.length;E<A;++E){D=F[E];B=this.stateName[D.state];if(B){this.writeNode(B,{feature:D,options:C},G)}}if(C.multi===true){this.setGeometryTypes()}}if(C.nativeElements){for(E=0,A=C.nativeElements.length;E<A;++E){this.writeNode("wfs:Native",C.nativeElements[E],G)}}return G},Native:function(B){var A=this.createElementNSPlus("wfs:Native",{attributes:{vendorId:B.vendorId,safeToIgnore:B.safeToIgnore},value:B.value});return A},Insert:function(D){var B=D.feature;var A=D.options;var C=this.createElementNSPlus("wfs:Insert",{attributes:{handle:A&&A.handle}});this.srsName=this.getSrsName(B);this.writeNode("feature:_typeName",B,C);return C},Update:function(F){var D=F.feature;var B=F.options;var E=this.createElementNSPlus("wfs:Update",{attributes:{handle:B&&B.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){E.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}var A=D.modified;if(this.geometryName!==null&&(!A||A.geometry!==undefined)){this.srsName=this.getSrsName(D);this.writeNode("Property",{name:this.geometryName,value:D.geometry},E)}for(var C in D.attributes){if(D.attributes[C]!==undefined&&(!A||!A.attributes||(A.attributes&&A.attributes[C]!==undefined))){this.writeNode("Property",{name:C,value:D.attributes[C]},E)}}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[D.fid]}),E);return E},Property:function(B){var A=this.createElementNSPlus("wfs:Property");this.writeNode("Name",B.name,A);if(B.value!==null){this.writeNode("Value",B.value,A)}return A},Name:function(A){return this.createElementNSPlus("wfs:Name",{value:A})},Value:function(C){var B;if(C instanceof OpenLayers.Geometry){B=this.createElementNSPlus("wfs:Value");var A=this.writeNode("feature:_geometry",C).firstChild;B.appendChild(A)}else{B=this.createElementNSPlus("wfs:Value",{value:C})}return B},Delete:function(D){var B=D.feature;var A=D.options;var C=this.createElementNSPlus("wfs:Delete",{attributes:{handle:A&&A.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){C.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[B.fid]}),C);return C}}},schemaLocationAttr:function(A){A=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},A);var F=OpenLayers.Util.extend({},this.schemaLocations);if(A.schema){F[A.featurePrefix]=A.schema}var E=[];var C;for(var B in F){C=this.namespaces[B];if(C){E.push(C+" "+F[B])}}var D=E.join(" ")||undefined;return D},setFilterProperty:function(C){if(C.filters){for(var B=0,A=C.filters.length;B<A;++B){OpenLayers.Format.WFST.v1.prototype.setFilterProperty.call(this,C.filters[B])}}else{if(C instanceof OpenLayers.Filter.Spatial&&!C.property){C.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:false,multiCurve:true,surface:false,multiSurface:true,initialize:function(A){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[A])},readers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(A,B){this.readChildNodes(A,B)},Curve:function(B,A){var C={points:[]};this.readChildNodes(B,C);if(!A.components){A.components=[]}A.components.push(new OpenLayers.Geometry.LineString(C.points))},segments:function(A,B){this.readChildNodes(A,B)},LineStringSegment:function(B,A){var C={};this.readChildNodes(B,C);if(C.points){Array.prototype.push.apply(A.points,C.points)}},pos:function(B,D){var E=this.getChildValue(B).replace(this.regExes.trimSpace,"");var C=E.split(this.regExes.splitSpace);var A;if(this.xy){A=new OpenLayers.Geometry.Point(C[0],C[1],C[2])}else{A=new OpenLayers.Geometry.Point(C[1],C[0],C[2])}D.points=[A]},posList:function(A,D){var H=this.getChildValue(A).replace(this.regExes.trimSpace,"");var K=H.split(this.regExes.splitSpace);var E=parseInt(A.getAttribute("dimension"))||2;var B,L,J,G;var I=K.length/E;var M=new Array(I);for(var C=0,F=K.length;C<F;C+=E){L=K[C];J=K[C+1];G=(E==2)?undefined:K[C+2];if(this.xy){M[C/E]=new OpenLayers.Geometry.Point(L,J,G)}else{M[C/E]=new OpenLayers.Geometry.Point(J,L,G)}}D.points=M},Surface:function(A,B){this.readChildNodes(A,B)},patches:function(A,B){this.readChildNodes(A,B)},PolygonPatch:function(A,B){this.readers.gml.Polygon.apply(this,[A,B])},exterior:function(B,A){var C={};this.readChildNodes(B,C);A.outer=C.components[0]},interior:function(B,A){var C={};this.readChildNodes(B,C);A.inner.push(C.components[0])},MultiCurve:function(B,A){var C={components:[]};this.readChildNodes(B,C);if(C.components.length>0){A.components=[new OpenLayers.Geometry.MultiLineString(C.components)]}},curveMember:function(A,B){this.readChildNodes(A,B)},MultiSurface:function(B,A){var C={components:[]};this.readChildNodes(B,C);if(C.components.length>0){A.components=[new OpenLayers.Geometry.MultiPolygon(C.components)]}},surfaceMember:function(A,B){this.readChildNodes(A,B)},surfaceMembers:function(A,B){this.readChildNodes(A,B)},pointMembers:function(A,B){this.readChildNodes(A,B)},lineStringMembers:function(A,B){this.readChildNodes(A,B)},polygonMembers:function(A,B){this.readChildNodes(A,B)},geometryMembers:function(A,B){this.readChildNodes(A,B)},Envelope:function(D,B){var E={points:new Array(2)};this.readChildNodes(D,E);if(!B.components){B.components=[]}var C=E.points[0];var A=E.points[1];B.components.push(new OpenLayers.Bounds(C.x,C.y,A.x,A.y))},lowerCorner:function(B,A){var C={};this.readers.gml.pos.apply(this,[B,C]);A.points[0]=C.points[0]},upperCorner:function(B,A){var C={};this.readers.gml.pos.apply(this,[B,C]);A.points[1]=C.points[0]}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(C){var B;if(OpenLayers.Util.isArray(C)){B="featureMembers"}else{B="featureMember"}var A=this.writeNode("gml:"+B,C);this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[A])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(C){var D=this.createElementNSPlus("gml:featureMembers");for(var B=0,A=C.length;B<A;++B){this.writeNode("feature:_typeName",C[B],D)}return D},Point:function(B){var A=this.createElementNSPlus("gml:Point");this.writeNode("pos",B,A);return A},pos:function(A){var B=(this.xy)?(A.x+" "+A.y):(A.y+" "+A.x);return this.createElementNSPlus("gml:pos",{value:B})},LineString:function(B){var A=this.createElementNSPlus("gml:LineString");this.writeNode("posList",B.components,A);return A},Curve:function(B){var A=this.createElementNSPlus("gml:Curve");this.writeNode("segments",B,A);return A},segments:function(B){var A=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",B,A);return A},LineStringSegment:function(B){var A=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",B.components,A);return A},posList:function(D){var B=D.length;var E=new Array(B);var A;for(var C=0;C<B;++C){A=D[C];if(this.xy){E[C]=A.x+" "+A.y}else{E[C]=A.y+" "+A.x}}return this.createElementNSPlus("gml:posList",{value:E.join(" ")})},Surface:function(B){var A=this.createElementNSPlus("gml:Surface");this.writeNode("patches",B,A);return A},patches:function(B){var A=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",B,A);return A},PolygonPatch:function(D){var C=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",D.components[0],C);for(var B=1,A=D.components.length;B<A;++B){this.writeNode("interior",D.components[B],C)}return C},Polygon:function(D){var C=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",D.components[0],C);for(var B=1,A=D.components.length;B<A;++B){this.writeNode("interior",D.components[B],C)}return C},exterior:function(A){var B=this.createElementNSPlus("gml:exterior");this.writeNode("LinearRing",A,B);return B},interior:function(A){var B=this.createElementNSPlus("gml:interior");this.writeNode("LinearRing",A,B);return B},LinearRing:function(A){var B=this.createElementNSPlus("gml:LinearRing");this.writeNode("posList",A.components,B);return B},MultiCurve:function(E){var D=this.createElementNSPlus("gml:MultiCurve");var C=E.components||[E];for(var B=0,A=C.length;B<A;++B){this.writeNode("curveMember",C[B],D)}return D},curveMember:function(B){var A=this.createElementNSPlus("gml:curveMember");if(this.curve){this.writeNode("Curve",B,A)}else{this.writeNode("LineString",B,A)}return A},MultiSurface:function(E){var D=this.createElementNSPlus("gml:MultiSurface");var C=E.components||[E];for(var B=0,A=C.length;B<A;++B){this.writeNode("surfaceMember",C[B],D)}return D},surfaceMember:function(A){var B=this.createElementNSPlus("gml:surfaceMember");if(this.surface){this.writeNode("Surface",A,B)}else{this.writeNode("Polygon",A,B)}return B},Envelope:function(B){var A=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",B,A);this.writeNode("upperCorner",B,A);if(this.srsName){A.setAttribute("srsName",this.srsName)}return A},lowerCorner:function(A){var B=(this.xy)?(A.left+" "+A.bottom):(A.bottom+" "+A.left);return this.createElementNSPlus("gml:lowerCorner",{value:B})},upperCorner:function(A){var B=(this.xy)?(A.right+" "+A.top):(A.top+" "+A.right);return this.createElementNSPlus("gml:upperCorner",{value:B})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":(this.curve===true)?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":(this.multiCurve===false)?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":(this.surface===true)?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":(this.multiSurface===false)?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"});OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(A){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[A])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(B,D){var C=B.getAttribute("matchCase");var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!(C==="false"||C==="0")});this.readChildNodes(B,A);D.filters.push(A)},PropertyIsNotEqualTo:function(B,D){var C=B.getAttribute("matchCase");var A=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!(C==="false"||C==="0")});this.readChildNodes(B,A);D.filters.push(A)},PropertyIsLike:function(D,E){var C=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(D,C);var F=D.getAttribute("wildCard");var B=D.getAttribute("singleChar");var A=D.getAttribute("escapeChar");C.value2regex(F,B,A);E.filters.push(C)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(A){var B=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:A.matchCase}});this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsNotEqualTo:function(A){var B=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:A.matchCase}});this.writeNode("PropertyName",A,B);this.writeOgcExpression(A.value,B);return B},PropertyIsLike:function(A){var B=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{matchCase:A.matchCase,wildCard:"*",singleChar:".",escapeChar:"!"}});this.writeNode("PropertyName",A,B);this.writeNode("Literal",A.regex2value(),B);return B},BBOX:function(A){var C=this.createElementNSPlus("ogc:BBOX");A.property&&this.writeNode("PropertyName",A,C);var B=this.writeNode("gml:Envelope",A.value);if(A.projection){B.setAttribute("srsName",A.projection)}C.appendChild(B);return C},SortBy:function(D){var C=this.createElementNSPlus("ogc:SortBy");for(var B=0,A=D.length;B<A;B++){this.writeNode("ogc:SortProperty",D[B],C)}return C},SortProperty:function(B){var A=this.createElementNSPlus("ogc:SortProperty");this.writeNode("ogc:PropertyName",B,A);this.writeNode("ogc:SortOrder",(B.order=="DESC")?"DESC":"ASC",A);return A},SortOrder:function(B){var A=this.createElementNSPlus("ogc:SortOrder",{value:B});return A}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature},writeSpatial:function(B,A){var C=this.createElementNSPlus("ogc:"+A);this.writeNode("PropertyName",B,C);if(B.value instanceof OpenLayers.Filter.Function){this.writeNode("Function",B.value,C)}else{var D;if(B.value instanceof OpenLayers.Geometry){D=this.writeNode("feature:_geometry",B.value).firstChild}else{D=this.writeNode("gml:Envelope",B.value)}if(B.projection){D.setAttribute("srsName",B.projection)}C.appendChild(D)}return C},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"});OpenLayers.Format.WFST.v1_1_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0,OpenLayers.Format.WFST.v1,{version:"1.1.0",schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"},initialize:function(A){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[A]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[A])},readNode:function(A,B,C){return OpenLayers.Format.GML.v3.prototype.readNode.apply(this,[A,B])},readers:{wfs:OpenLayers.Util.applyDefaults({FeatureCollection:function(A,B){B.numberOfFeatures=parseInt(A.getAttribute("numberOfFeatures"));OpenLayers.Format.WFST.v1.prototype.readers.wfs["FeatureCollection"].apply(this,arguments)},TransactionResponse:function(A,B){B.insertIds=[];B.success=false;this.readChildNodes(A,B)},TransactionSummary:function(A,B){B.success=true},InsertResults:function(A,B){this.readChildNodes(A,B)},Feature:function(B,A){var C={fids:[]};this.readChildNodes(B,C);A.insertIds.push(C.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc,ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows},writers:{wfs:OpenLayers.Util.applyDefaults({GetFeature:function(A){var B=OpenLayers.Format.WFST.v1.prototype.writers.wfs["GetFeature"].apply(this,arguments);A&&this.setAttributes(B,{resultType:A.resultType,startIndex:A.startIndex,count:A.count});return B},Query:function(B){B=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},B);var E=B.featurePrefix;var D=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(E?E+":":"")+B.featureType,srsName:B.srsName}});if(B.featureNS){D.setAttribute("xmlns:"+E,B.featureNS)}if(B.propertyNames){for(var C=0,A=B.propertyNames.length;C<A;C++){this.writeNode("wfs:PropertyName",{property:B.propertyNames[C]},D)}}if(B.filter){OpenLayers.Format.WFST.v1_1_0.prototype.setFilterProperty.call(this,B.filter);this.writeNode("ogc:Filter",B.filter,D)}return D},PropertyName:function(A){return this.createElementNSPlus("wfs:PropertyName",{value:A.property})}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_1_0"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,nativeJSON:(function(){return !!(window.JSON&&typeof JSON.parse=="function"&&typeof JSON.stringify=="function")})(),read:function(json,filter){var object;if(this.nativeJSON){object=JSON.parse(json,filter)}else{try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}}}catch(e){}}if(this.keepData){this.data=object}return object},write:function(E,C){this.pretty=!!C;var A=null;var B=typeof E;if(this.serialize[B]){try{A=(!this.pretty&&this.nativeJSON)?JSON.stringify(E):this.serialize[B].apply(this,[E])}catch(D){OpenLayers.Console.error("Trouble serializing: "+D)}}return A},writeIndent:function(){var B=[];if(this.pretty){for(var A=0;A<this.level;++A){B.push(this.indent)}}return B.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{object:function(C){if(C==null){return"null"}if(C.constructor==Date){return this.serialize.date.apply(this,[C])}if(C.constructor==Array){return this.serialize.array.apply(this,[C])}var F=["{"];this.level+=1;var D,B,E;var A=false;for(D in C){if(C.hasOwnProperty(D)){B=OpenLayers.Format.JSON.prototype.write.apply(this,[D,this.pretty]);E=OpenLayers.Format.JSON.prototype.write.apply(this,[C[D],this.pretty]);if(B!=null&&E!=null){if(A){F.push(",")}F.push(this.writeNewline(),this.writeIndent(),B,":",this.writeSpace(),E);A=true}}}this.level-=1;F.push(this.writeNewline(),this.writeIndent(),"}");return F.join("")},array:function(E){var C;var D=["["];this.level+=1;for(var B=0,A=E.length;B<A;++B){C=OpenLayers.Format.JSON.prototype.write.apply(this,[E[B],this.pretty]);if(C!=null){if(B>0){D.push(",")}D.push(this.writeNewline(),this.writeIndent(),C)}}this.level-=1;D.push(this.writeNewline(),this.writeIndent(),"]");return D.join("")},string:function(B){var A={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(/["\\\x00-\x1f]/.test(B)){return'"'+B.replace(/([\x00-\x1f\\"])/g,function(D,C){var E=A[C];if(E){return E}E=C.charCodeAt();return"\\u00"+Math.floor(E/16).toString(16)+(E%16).toString(16)})+'"'}return'"'+B+'"'},number:function(A){return isFinite(A)?String(A):"null"},"boolean":function(A){return String(A)},date:function(A){function B(C){return(C<10)?"0"+C:C}return'"'+A.getFullYear()+"-"+B(A.getMonth()+1)+"-"+B(A.getDate())+"T"+B(A.getHours())+":"+B(A.getMinutes())+":"+B(A.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",errorProperty:"service",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"},defaultPrefix:"wfs",read:function(C){if(typeof C=="string"){C=OpenLayers.Format.XML.prototype.read.apply(this,[C])}var B=C;if(C&&C.nodeType==9){C=C.documentElement}var A={};this.readNode(C,A);return A},readers:{wfs:{WFS_Capabilities:function(A,B){this.readChildNodes(A,B)},FeatureTypeList:function(B,A){A.featureTypeList={featureTypes:[]};this.readChildNodes(B,A.featureTypeList)},FeatureType:function(C,A){var B={};this.readChildNodes(C,B);A.featureTypes.push(B)},Name:function(B,D){var A=this.getChildValue(B);if(A){var C=A.split(":");D.name=C.pop();if(C.length>0){D.featureNS=this.lookupNamespaceURI(B,C[0])}}},Title:function(A,B){var C=this.getChildValue(A);if(C){B.title=C}},Abstract:function(B,C){var A=this.getChildValue(B);if(A){C["abstract"]=A}}}},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"});OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,autoActivate:true,defaultControl:null,saveState:false,allowDepress:false,activeState:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.controls=[];this.activeState={}},destroy:function(){if(this.map){this.map.events.unregister("buttonclick",this,this.onButtonClick)}OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var A,B=this.controls.length-1;B>=0;B--){A=this.controls[B];if(A.events){A.events.un({activate:this.iconOn,deactivate:this.iconOff})}A.panel_div=null}this.activeState=null},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){var C;for(var B=0,A=this.controls.length;B<A;B++){C=this.controls[B];if(C===this.defaultControl||(this.saveState&&this.activeState[C.id])){C.activate()}}if(this.saveState===true){this.defaultControl=null}this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){var C;for(var B=0,A=this.controls.length;B<A;B++){C=this.controls[B];this.activeState[C.id]=C.deactivate()}this.redraw();return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(this.outsideViewport){this.events.attachToElement(this.div);this.events.register("buttonclick",this,this.onButtonClick)}else{this.map.events.register("buttonclick",this,this.onButtonClick)}this.addControlsToMap(this.controls);return this.div},redraw:function(){for(var B=this.div.childNodes.length,C=B-1;C>=0;C--){this.div.removeChild(this.div.childNodes[C])}this.div.innerHTML="";if(this.active){for(var C=0,A=this.controls.length;C<A;C++){this.div.appendChild(this.controls[C].panel_div)}}},activateControl:function(C){if(!this.active){return false}if(C.type==OpenLayers.Control.TYPE_BUTTON){C.trigger();return }if(C.type==OpenLayers.Control.TYPE_TOGGLE){if(C.active){C.deactivate()}else{C.activate()}return }if(this.allowDepress&&C.active){C.deactivate()}else{var D;for(var B=0,A=this.controls.length;B<A;B++){D=this.controls[B];if(D!=C&&(D.type===OpenLayers.Control.TYPE_TOOL||D.type==null)){D.deactivate()}}C.activate()}},addControls:function(B){if(!(OpenLayers.Util.isArray(B))){B=[B]}this.controls=this.controls.concat(B);for(var D=0,A=B.length;D<A;D++){var E=B[D],C=this.createControlMarkup(E);OpenLayers.Element.addClass(C,E.displayClass+"ItemInactive");OpenLayers.Element.addClass(C,"olButton");if(E.title!=""&&!C.title){C.title=E.title}E.panel_div=C}if(this.map){this.addControlsToMap(B);this.redraw()}},createControlMarkup:function(A){return document.createElement("div")},addControlsToMap:function(B){var D;for(var C=0,A=B.length;C<A;C++){D=B[C];if(D.autoActivate===true){D.autoActivate=false;this.map.addControl(D);D.autoActivate=true}else{this.map.addControl(D);D.deactivate()}D.events.on({activate:this.iconOn,deactivate:this.iconOff})}},iconOn:function(){var B=this.panel_div;var A=new RegExp("\\b("+this.displayClass+"Item)Inactive\\b");B.className=B.className.replace(A,"$1Active")},iconOff:function(){var B=this.panel_div;var A=new RegExp("\\b("+this.displayClass+"Item)Active\\b");B.className=B.className.replace(A,"$1Inactive")},onButtonClick:function(A){var B=this.controls,D=A.buttonElement;for(var C=B.length-1;C>=0;--C){if(B[C].panel_div===D){this.activateControl(B[C]);break}}},getControlsBy:function(C,A){var D=(typeof A.test=="function");var B=OpenLayers.Array.filter(this.controls,function(E){return E[C]==A||(D&&A.test(E[C]))});return B},getControlsByName:function(A){return this.getControlsBy("name",A)},getControlsByClass:function(A){return this.getControlsBy("CLASS_NAME",A)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){this.map.zoomToMaxExtent()}},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(A){OpenLayers.Control.Panel.prototype.initialize.apply(this,[A]);this.addControls([new OpenLayers.Control.ZoomIn(),new OpenLayers.Control.ZoomToMaxExtent(),new OpenLayers.Control.ZoomOut()])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(C,B,D,A){OpenLayers.Layer.prototype.initialize.apply(this,[C,A]);this.url=B;if(!this.params){this.params=OpenLayers.Util.extend({},D)}},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(A){if(A==null){A=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())}A=OpenLayers.Layer.prototype.clone.apply(this,[A]);return A},setUrl:function(A){this.url=A},mergeNewParams:function(B){this.params=OpenLayers.Util.extend(this.params,B);var A=this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"params"})}return A},redraw:function(A){if(A){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(E,D){var C=1;for(var B=0,A=E.length;B<A;B++){C*=E.charCodeAt(B)*this.URL_HASH_FACTOR;C-=Math.floor(C)}return D[Math.floor(C*D.length)]},getFullRequestString:function(G,D){var B=D||this.url;var F=OpenLayers.Util.extend({},this.params);F=OpenLayers.Util.extend(F,G);var E=OpenLayers.Util.getParameterString(F);if(OpenLayers.Util.isArray(B)){B=this.selectUrl(E,B)}var A=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(B));for(var C in F){if(C.toUpperCase() in A){delete F[C]}}E=OpenLayers.Util.getParameterString(F);return OpenLayers.Util.urlAppend(B,E)},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:false,initialize:function(E,A,F,C,D,B){this.layer=E;this.position=A.clone();this.setBounds(F);this.url=C;if(D){this.size=D.clone()}this.id=OpenLayers.Util.createUniqueID("Tile_");OpenLayers.Util.extend(this,B);this.events=new OpenLayers.Events(this);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}},unload:function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("unload")}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.eventListeners=null;this.events=null},draw:function(B){if(!B){this.clear()}var A=this.shouldDraw();if(A&&!B){A=this.events.triggerEvent("beforedraw")!==false}return A},shouldDraw:function(){var B=false,A=this.layer.maxExtent;if(A){var D=this.layer.map;var C=D.baseLayer.wrapDateLine&&D.getMaxExtent();if(this.bounds.intersectsBounds(A,{inclusive:false,worldBounds:C})){B=true}}return B||this.layer.displayOutsideMaxExtent},setBounds:function(C){C=C.clone();if(this.layer.map.baseLayer.wrapDateLine){var B=this.layer.map.getMaxExtent(),A=this.layer.map.getResolution();C=C.wrapDateLine(B,{leftTolerance:A,rightTolerance:A})}this.bounds=C},moveTo:function(B,A,C){if(C==null){C=true}this.setBounds(B);this.position=A.clone();if(C){this.draw()}},clear:function(A){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,imageReloadAttempts:null,layerAlphaHack:null,asyncRequestId:null,blankImageUrl:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAQAIBRAA7",maxGetUrlLength:null,canvasContext:null,crossOriginKeyword:null,initialize:function(E,A,F,C,D,B){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=C;this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack();if(this.maxGetUrlLength!=null||this.layer.gutter||this.layerAlphaHack){this.frame=document.createElement("div");this.frame.style.position="absolute";this.frame.style.overflow="hidden"}if(this.maxGetUrlLength!=null){OpenLayers.Util.extend(this,OpenLayers.Tile.Image.IFrame)}},destroy:function(){if(this.imgDiv){this.clear();this.imgDiv=null;this.frame=null}this.asyncRequestId=null;OpenLayers.Tile.prototype.destroy.apply(this,arguments)},draw:function(){var A=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(A){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}if(this.isLoading){this._loadEvent="reload"}else{this.isLoading=true;this._loadEvent="loadstart"}this.positionTile();this.renderTile()}else{this.unload()}return A},renderTile:function(){this.layer.div.appendChild(this.getTile());if(this.layer.async){var A=this.asyncRequestId=(this.asyncRequestId||0)+1;this.layer.getURLasync(this.bounds,function(B){if(A==this.asyncRequestId){this.url=B;this.initImage()}},this)}else{this.url=this.layer.getURL(this.bounds);this.initImage()}},positionTile:function(){var B=this.getTile().style,A=this.frame?this.size:this.layer.getImageSize(this.bounds);B.left=this.position.x+"%";B.top=this.position.y+"%";B.width=A.w+"%";B.height=A.h+"%"},clear:function(){OpenLayers.Tile.prototype.clear.apply(this,arguments);var A=this.imgDiv;if(A){OpenLayers.Event.stopObservingElement(A);var B=this.getTile();if(B.parentNode===this.layer.div){this.layer.div.removeChild(B)}this.setImgSrc();if(this.layerAlphaHack===true){A.style.filter=""}OpenLayers.Element.removeClass(A,"olImageLoadError")}this.canvasContext=null},getImage:function(){if(!this.imgDiv){this.imgDiv=document.createElement("img");this.imgDiv.className="olTileImage";this.imgDiv.galleryImg="no";var A=this.imgDiv.style;if(this.frame){var C=0,B=0;if(this.layer.gutter){C=this.layer.gutter/this.layer.tileSize.w*100;B=this.layer.gutter/this.layer.tileSize.h*100}A.left=-C+"%";A.top=-B+"%";A.width=(2*C+100)+"%";A.height=(2*B+100)+"%"}A.visibility="hidden";A.opacity=0;if(this.layer.opacity<1){A.filter="alpha(opacity="+(this.layer.opacity*100)+")"}A.position="absolute";if(this.layerAlphaHack){A.paddingTop=A.height;A.height="0";A.width="100%"}if(this.frame){this.frame.appendChild(this.imgDiv)}}return this.imgDiv},initImage:function(){this.events.triggerEvent(this._loadEvent);var A=this.getImage();if(this.url&&A.getAttribute("src")==this.url){this.onImageLoad()}else{var B=OpenLayers.Function.bind(function(){OpenLayers.Event.stopObservingElement(A);OpenLayers.Event.observe(A,"load",OpenLayers.Function.bind(this.onImageLoad,this));OpenLayers.Event.observe(A,"error",OpenLayers.Function.bind(this.onImageError,this));this.imageReloadAttempts=0;this.setImgSrc(this.url)},this);if(A.getAttribute("src")==this.blankImageUrl){B()}else{OpenLayers.Event.observe(A,"load",B);OpenLayers.Event.observe(A,"error",B);if(this.crossOriginKeyword){A.removeAttribute("crossorigin")}A.src=this.blankImageUrl}}},setImgSrc:function(B){var A=this.imgDiv;A.style.visibility="hidden";A.style.opacity=0;if(B){if(this.crossOriginKeyword){if(B.substr(0,5)!=="data:"){A.setAttribute("crossorigin",this.crossOriginKeyword)}else{A.removeAttribute("crossorigin")}}A.src=B}},getTile:function(){return this.frame?this.frame:this.getImage()},createBackBuffer:function(){if(!this.imgDiv||this.isLoading){return }var A;if(this.frame){A=this.frame.cloneNode(false);A.appendChild(this.imgDiv)}else{A=this.imgDiv}this.imgDiv=null;return A},onImageLoad:function(){var B=this.imgDiv;OpenLayers.Event.stopObservingElement(B);B.style.visibility="inherit";B.style.opacity=this.layer.opacity;this.isLoading=false;this.canvasContext=null;this.events.triggerEvent("loadend");if(parseFloat(navigator.appVersion.split("MSIE")[1])<7&&this.layer&&this.layer.div){var C=document.createElement("span");C.style.display="none";var A=this.layer.div;A.appendChild(C);window.setTimeout(function(){C.parentNode===A&&C.parentNode.removeChild(C)},0)}if(this.layerAlphaHack===true){B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B.src+"', sizingMethod='scale')"}},onImageError:function(){var A=this.imgDiv;if(A.src!=null){this.imageReloadAttempts++;if(this.imageReloadAttempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){this.setImgSrc(this.layer.getURL(this.bounds))}else{OpenLayers.Element.addClass(A,"olImageLoadError");this.events.triggerEvent("loaderror");this.onImageLoad()}}},getCanvasContext:function(){if(OpenLayers.CANVAS_SUPPORTED&&this.imgDiv&&!this.isLoading){if(!this.canvasContext){var A=document.createElement("canvas");A.width=this.size.w;A.height=this.size.h;this.canvasContext=A.getContext("2d");this.canvasContext.drawImage(this.imgDiv,0,0)}return this.canvasContext}},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,tileClass:OpenLayers.Tile.Image,grid:null,singleTile:false,ratio:1.5,buffer:0,transitionEffect:null,numLoadingTiles:0,tileLoadingDelay:85,serverResolutions:null,moveTimerId:null,deferMoveGriddedTiles:null,tileQueueId:null,tileQueue:null,loading:false,backBuffer:null,gridResolution:null,backBufferResolution:null,backBufferLonLat:null,backBufferTimerId:null,removeBackBufferDelay:null,className:null,initialize:function(C,B,D,A){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.grid=[];this.tileQueue=[];if(this.removeBackBufferDelay===null){this.removeBackBufferDelay=this.singleTile?0:2500}if(this.className===null){this.className=this.singleTile?"olLayerGridSingleTile":"olLayerGrid"}if(!OpenLayers.Animation.isNative){this.deferMoveGriddedTiles=OpenLayers.Function.bind(function(){this.moveGriddedTiles(true);this.moveTimerId=null},this)}},setMap:function(A){OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this,A);OpenLayers.Element.addClass(this.div,this.className)},removeMap:function(A){if(this.moveTimerId!==null){window.clearTimeout(this.moveTimerId);this.moveTimerId=null}this.clearTileQueue();if(this.backBufferTimerId!==null){window.clearTimeout(this.backBufferTimerId);this.backBufferTimerId=null}},destroy:function(){this.removeBackBuffer();this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){this.clearTileQueue();if(this.grid){for(var F=0,B=this.grid.length;F<B;F++){var E=this.grid[F];for(var C=0,A=E.length;C<A;C++){var D=E[C];this.destroyTile(D)}}this.grid=[];this.gridResolution=null}},clone:function(A){if(A==null){A=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions())}A=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[A]);if(this.tileSize!=null){A.tileSize=this.tileSize.clone()}A.grid=[];A.gridResolution=null;A.backBuffer=null;A.backBufferTimerId=null;A.tileQueue=[];A.tileQueueId=null;A.loading=false;A.moveTimerId=null;return A},moveTo:function(F,B,G){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);F=F||this.map.getExtent();if(F!=null){var E=!this.grid.length||B;var D=this.getTilesBounds();var C=this.map.getResolution();var A=this.getServerResolution(C);if(this.singleTile){if(E||(!G&&!D.containsBounds(F))){if(B&&this.transitionEffect!=="resize"){this.removeBackBuffer()}if(!B||this.transitionEffect==="resize"){this.applyBackBuffer(A)}this.initSingleTile(F)}}else{E=E||!D.intersectsBounds(F,{worldBounds:this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent()});if(C!==A){F=this.map.calculateBounds(null,A);if(E){var H=A/C;this.transformDiv(H)}}else{this.div.style.width="100%";this.div.style.height="100%";this.div.style.left="0%";this.div.style.top="0%"}if(E){if(B&&this.transitionEffect==="resize"){this.applyBackBuffer(A)}this.initGriddedTiles(F)}else{this.moveGriddedTiles()}}}},getTileData:function(M){var Q=null,N=M.lon,L=M.lat,D=this.grid.length;if(this.map&&D){var R=this.map.getResolution(),A=this.tileSize.w,K=this.tileSize.h,J=this.grid[0][0].bounds,E=J.left,O=J.top;if(N<E){if(this.map.baseLayer.wrapDateLine){var B=this.map.getMaxExtent().getWidth();var C=Math.ceil((E-N)/B);N+=B*C}}var H=(N-E)/(R*A);var F=(O-L)/(R*K);var G=Math.floor(H);var I=Math.floor(F);if(I>=0&&I<D){var P=this.grid[I][G];if(P){Q={tile:P,i:Math.floor((H-G)*A),j:Math.floor((F-I)*K)}}}}return Q},queueTileDraw:function(A){var B=A.object;if(!~OpenLayers.Util.indexOf(this.tileQueue,B)){this.tileQueue.push(B)}if(!this.tileQueueId){this.tileQueueId=OpenLayers.Animation.start(OpenLayers.Function.bind(this.drawTileFromQueue,this),null,this.div)}return false},drawTileFromQueue:function(){if(this.tileQueue.length===0){this.clearTileQueue()}else{this.tileQueue.shift().draw(true)}},clearTileQueue:function(){OpenLayers.Animation.stop(this.tileQueueId);this.tileQueueId=null;this.tileQueue=[]},destroyTile:function(A){this.removeTileMonitoringHooks(A);A.destroy()},getServerResolution:function(B){B=B||this.map.getResolution();if(this.serverResolutions&&OpenLayers.Util.indexOf(this.serverResolutions,B)===-1){var C,A;for(C=this.serverResolutions.length-1;C>=0;C--){A=this.serverResolutions[C];if(A>B){B=A;break}}if(C===-1){throw"no appropriate resolution in serverResolutions"}}return B},getServerZoom:function(){var A=this.getServerResolution();return this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,A):this.map.getZoomForResolution(A)+(this.zoomOffset||0)},transformDiv:function(E){this.div.style.width=100*E+"%";this.div.style.height=100*E+"%";var B=this.map.getSize();var D=parseInt(this.map.layerContainerDiv.style.left,10);var C=parseInt(this.map.layerContainerDiv.style.top,10);var A=(D-(B.w/2))*(E-1);var F=(C-(B.h/2))*(E-1);this.div.style.left=A+"%";this.div.style.top=F+"%"},getResolutionScale:function(){return parseInt(this.div.style.width,10)/100},applyBackBuffer:function(D){if(this.backBufferTimerId!==null){this.removeBackBuffer()}var C=this.backBuffer;if(!C){C=this.createBackBuffer();if(!C){return }this.div.insertBefore(C,this.div.firstChild);this.backBuffer=C;var B=this.grid[0][0].bounds;this.backBufferLonLat={lon:B.left,lat:B.top};this.backBufferResolution=this.gridResolution}var G=C.style;var F=this.backBufferResolution/D;G.width=100*F+"%";G.height=100*F+"%";var A=this.getViewPortPxFromLonLat(this.backBufferLonLat,D);var H=parseInt(this.map.layerContainerDiv.style.left,10);var E=parseInt(this.map.layerContainerDiv.style.top,10);C.style.left=Math.round(A.x-H)+"%";C.style.top=Math.round(A.y-E)+"%"},createBackBuffer:function(){var C;if(this.grid.length>0){C=document.createElement("div");C.id=this.div.id+"_bb";C.className="olBackBuffer";C.style.position="absolute";C.style.width="100%";C.style.height="100%";for(var E=0,B=this.grid.length;E<B;E++){for(var D=0,A=this.grid[E].length;D<A;D++){var F=this.grid[E][D].createBackBuffer();if(!F){continue}F.style.top=(E*this.tileSize.h)+"%";F.style.left=(D*this.tileSize.w)+"%";C.appendChild(F)}}}return C},removeBackBuffer:function(){if(this.backBuffer){this.div.removeChild(this.backBuffer);this.backBuffer=null;this.backBufferResolution=null;if(this.backBufferTimerId!==null){window.clearTimeout(this.backBufferTimerId);this.backBufferTimerId=null}}},moveByPx:function(B,A){if(!this.singleTile){this.moveGriddedTiles()}},setTileSize:function(A){if(this.singleTile){A=this.map.getSize();A.h=parseInt(A.h*this.ratio);A.w=parseInt(A.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[A])},getTilesBounds:function(){var D=null;var C=this.grid.length;if(C){var E=this.grid[C-1][0].bounds,B=this.grid[0].length*E.getWidth(),A=this.grid.length*E.getHeight();D=new OpenLayers.Bounds(E.left,E.bottom,E.left+B,E.bottom+A)}return D},initSingleTile:function(E){this.clearTileQueue();var A=E.getCenterLonLat();var G=E.getWidth()*this.ratio;var B=E.getHeight()*this.ratio;var F=new OpenLayers.Bounds(A.lon-(G/2),A.lat-(B/2),A.lon+(G/2),A.lat+(B/2));var C=this.map.getLayerPxFromLonLat({lon:F.left,lat:F.top});if(!this.grid.length){this.grid[0]=[]}var D=this.grid[0][0];if(!D){D=this.addTile(F,C);this.addTileMonitoringHooks(D);D.draw();this.grid[0][0]=D}else{D.moveTo(F,C)}this.removeExcessTiles(1,1);this.gridResolution=this.getServerResolution()},calculateGridLayout:function(A,N,E){var K=E*this.tileSize.w;var C=E*this.tileSize.h;var I=A.left-N.lon;var L=Math.floor(I/K)-this.buffer;var J=I/K-L;var F=-J*this.tileSize.w;var M=N.lon+L*K;var B=A.top-(N.lat+C);var H=Math.ceil(B/C)+this.buffer;var O=H-B/C;var D=-O*this.tileSize.h;var G=N.lat+H*C;return{tilelon:K,tilelat:C,tileoffsetlon:M,tileoffsetlat:G,tileoffsetx:F,tileoffsety:D}},getTileOrigin:function(){var B=this.tileOrigin;if(!B){var C=this.getMaxExtent();var A=({tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]})[this.tileOriginCorner];B=new OpenLayers.LonLat(C[A[0]],C[A[1]])}return B},initGriddedTiles:function(I){this.clearTileQueue();var G=this.map.getSize();var X=Math.ceil(G.h/this.tileSize.h)+Math.max(1,2*this.buffer);var a=Math.ceil(G.w/this.tileSize.w)+Math.max(1,2*this.buffer);var d=this.getTileOrigin();var R=this.getServerResolution();var Q=this.calculateGridLayout(I,d,R);var F=Math.round(Q.tileoffsetx);var C=Math.round(Q.tileoffsety);var K=Q.tileoffsetlon;var N=Q.tileoffsetlat;var E=Q.tilelon;var J=Q.tilelat;var W=F;var Z=K;var V=0;var A=parseInt(this.map.layerContainerDiv.style.left);var T=parseInt(this.map.layerContainerDiv.style.top);var Y=[],b=this.map.getCenter();do{var H=this.grid[V++];if(!H){H=[];this.grid.push(H)}K=Z;F=W;var D=0;do{var B=new OpenLayers.Bounds(K,N,K+E,N+J);var M=F;M-=A;var L=C;L-=T;var P=new OpenLayers.Pixel(M,L);var c=H[D++];if(!c){c=this.addTile(B,P);this.addTileMonitoringHooks(c);H.push(c)}else{c.moveTo(B,P,false)}var S=B.getCenterLonLat();Y.push({tile:c,distance:Math.pow(S.lon-b.lon,2)+Math.pow(S.lat-b.lat,2)});K+=E;F+=this.tileSize.w}while((K<=I.right+E*this.buffer)||D<a);N-=J;C+=this.tileSize.h}while((N>=I.bottom-J*this.buffer)||V<X);this.removeExcessTiles(V,D);this.gridResolution=this.getServerResolution();Y.sort(function(f,e){return f.distance-e.distance});for(var U=0,O=Y.length;U<O;++U){Y[U].tile.draw()}},getMaxExtent:function(){return this.maxExtent},addTile:function(C,A){var B=new this.tileClass(this,A,C,null,this.tileSize,this.tileOptions);B.events.register("beforedraw",this,this.queueTileDraw);return B},addTileMonitoringHooks:function(A){A.onLoadStart=function(){if(this.loading===false){this.loading=true;this.events.triggerEvent("loadstart")}this.events.triggerEvent("tileloadstart",{tile:A});this.numLoadingTiles++};A.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded",{tile:A});if(this.tileQueue.length===0&&this.numLoadingTiles===0){this.loading=false;this.events.triggerEvent("loadend");if(this.backBuffer){this.backBufferTimerId=window.setTimeout(OpenLayers.Function.bind(this.removeBackBuffer,this),this.removeBackBufferDelay)}}};A.onLoadError=function(){this.events.triggerEvent("tileerror",{tile:A})};A.events.on({loadstart:A.onLoadStart,loadend:A.onLoadEnd,unload:A.onLoadEnd,loaderror:A.onLoadError,scope:this})},removeTileMonitoringHooks:function(A){A.unload();A.events.un({loadstart:A.onLoadStart,loadend:A.onLoadEnd,unload:A.onLoadEnd,loaderror:A.onLoadError,scope:this})},moveGriddedTiles:function(B){if(!B&&!OpenLayers.Animation.isNative){if(this.moveTimerId!=null){window.clearTimeout(this.moveTimerId)}this.moveTimerId=window.setTimeout(this.deferMoveGriddedTiles,this.tileLoadingDelay);return }var A=this.buffer||1;var E=this.getResolutionScale();while(true){var D={x:(this.grid[0][0].position.x*E)+parseInt(this.div.style.left,10)+parseInt(this.map.layerContainerDiv.style.left),y:(this.grid[0][0].position.y*E)+parseInt(this.div.style.top,10)+parseInt(this.map.layerContainerDiv.style.top)};var C={w:this.tileSize.w*E,h:this.tileSize.h*E};if(D.x>-C.w*(A-1)){this.shiftColumn(true)}else{if(D.x<-C.w*A){this.shiftColumn(false)}else{if(D.y>-C.h*(A-1)){this.shiftRow(true)}else{if(D.y<-C.h*A){this.shiftRow(false)}else{break}}}}}},shiftRow:function(M){var C=(M)?0:(this.grid.length-1);var B=this.grid;var F=B[C];var E=this.getServerResolution();var H=(M)?-this.tileSize.h:this.tileSize.h;var G=E*-H;var L=(M)?B.pop():B.shift();for(var I=0,K=F.length;I<K;I++){var D=F[I];var A=D.bounds.clone();var J=D.position.clone();A.bottom=A.bottom+G;A.top=A.top+G;J.y=J.y+H;L[I].moveTo(A,J)}if(M){B.unshift(L)}else{B.push(L)}},shiftColumn:function(L){var D=(L)?-this.tileSize.w:this.tileSize.w;var C=this.getServerResolution();var J=C*D;for(var E=0,G=this.grid.length;E<G;E++){var K=this.grid[E];var I=(L)?0:(K.length-1);var B=K[I];var A=B.bounds.clone();var F=B.position.clone();A.left=A.left+J;A.right=A.right+J;F.x=F.x+D;var H=L?this.grid[E].pop():this.grid[E].shift();H.moveTo(A,F);if(L){K.unshift(H)}else{K.push(H)}}},removeExcessTiles:function(E,C){var B,A;while(this.grid.length>E){var F=this.grid.pop();for(B=0,A=F.length;B<A;B++){var D=F[B];this.destroyTile(D)}}for(B=0,A=this.grid.length;B<A;B++){while(this.grid[B].length>C){var F=this.grid[B];var D=F.pop();this.destroyTile(D)}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(D){var C=this.maxExtent;var F=this.getResolution();var E=F*this.tileSize.w;var B=F*this.tileSize.h;var H=this.getLonLatFromViewPortPx(D);var A=C.left+(E*Math.floor((H.lon-C.left)/E));var G=C.bottom+(B*Math.floor((H.lat-C.bottom)/B));return new OpenLayers.Bounds(A,G,A+E,G+B)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:["antialiasing","blockout","font","fontcolor","fontsize","fontstyle","glowing","interval","outline","printmode","shadow","transparency"],request:null,response:null,initialize:function(A){this.request=new OpenLayers.Format.ArcXML.Request();this.response=new OpenLayers.Format.ArcXML.Response();if(A){if(A.requesttype=="feature"){this.request.get_image=null;var C=this.request.get_feature.query;this.addCoordSys(C.featurecoordsys,A.featureCoordSys);this.addCoordSys(C.filtercoordsys,A.filterCoordSys);if(A.polygon){C.isspatial=true;C.spatialfilter.polygon=A.polygon}else{if(A.envelope){C.isspatial=true;C.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0};this.parseEnvelope(C.spatialfilter.envelope,A.envelope)}}}else{if(A.requesttype=="image"){this.request.get_feature=null;var B=this.request.get_image.properties;this.parseEnvelope(B.envelope,A.envelope);this.addLayers(B.layerlist,A.layers);this.addImageSize(B.imagesize,A.tileSize);this.addCoordSys(B.featurecoordsys,A.featureCoordSys);this.addCoordSys(B.filtercoordsys,A.filterCoordSys)}else{this.request=null}}}OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},parseEnvelope:function(B,A){if(A&&A.length==4){B.minx=A[0];B.miny=A[1];B.maxx=A[2];B.maxy=A[3]}},addLayers:function(D,C){for(var B=0,A=C.length;B<A;B++){D.push(C[B])}},addImageSize:function(B,A){if(A!==null){B.width=A.w;B.height=A.h;B.printwidth=A.w;B.printheight=A.h}},addCoordSys:function(A,B){if(typeof B=="string"){A.id=parseInt(B);A.string=B}else{if(typeof B=="object"&&B.proj!==null){A.id=B.proj.srsProjNumber;A.string=B.proj.srsCode}else{A=B}}},iserror:function(C){var A=null;if(!C){A=(this.response.error!=="")}else{C=OpenLayers.Format.XML.prototype.read.apply(this,[C]);var B=C.documentElement.getElementsByTagName("ERROR");A=(B!==null&&B.length>0)}return A},read:function(F){if(typeof F=="string"){F=OpenLayers.Format.XML.prototype.read.apply(this,[F])}var A=null;if(F&&F.documentElement){if(F.documentElement.nodeName=="ARCXML"){A=F.documentElement}else{A=F.documentElement.getElementsByTagName("ARCXML")[0]}}if(!A||A.firstChild.nodeName==="parsererror"){var C,E;try{C=F.firstChild.nodeValue;E=F.firstChild.childNodes[1].firstChild.nodeValue}catch(D){}throw {message:"Error parsing the ArcXML request",error:C,source:E}}var B=this.parseResponse(A);return B},write:function(C){if(!C){C=this.request}var Q=this.createElementNS("","ARCXML");Q.setAttribute("version","1.1");var H=this.createElementNS("","REQUEST");if(C.get_image!=null){var K=this.createElementNS("","GET_IMAGE");H.appendChild(K);var J=this.createElementNS("","PROPERTIES");K.appendChild(J);var B=C.get_image.properties;if(B.featurecoordsys!=null){var O=this.createElementNS("","FEATURECOORDSYS");J.appendChild(O);if(B.featurecoordsys.id===0){O.setAttribute("string",B.featurecoordsys.string)}else{O.setAttribute("id",B.featurecoordsys.id)}}if(B.filtercoordsys!=null){var M=this.createElementNS("","FILTERCOORDSYS");J.appendChild(M);if(B.filtercoordsys.id===0){M.setAttribute("string",B.filtercoordsys.string)}else{M.setAttribute("id",B.filtercoordsys.id)}}if(B.envelope!=null){var U=this.createElementNS("","ENVELOPE");J.appendChild(U);U.setAttribute("minx",B.envelope.minx);U.setAttribute("miny",B.envelope.miny);U.setAttribute("maxx",B.envelope.maxx);U.setAttribute("maxy",B.envelope.maxy)}var S=this.createElementNS("","IMAGESIZE");J.appendChild(S);S.setAttribute("height",B.imagesize.height);S.setAttribute("width",B.imagesize.width);if(B.imagesize.height!=B.imagesize.printheight||B.imagesize.width!=B.imagesize.printwidth){S.setAttribute("printheight",B.imagesize.printheight);S.setArrtibute("printwidth",B.imagesize.printwidth)}if(B.background!=null){var A=this.createElementNS("","BACKGROUND");J.appendChild(A);A.setAttribute("color",B.background.color.r+","+B.background.color.g+","+B.background.color.b);if(B.background.transcolor!==null){A.setAttribute("transcolor",B.background.transcolor.r+","+B.background.transcolor.g+","+B.background.transcolor.b)}}if(B.layerlist!=null&&B.layerlist.length>0){var G=this.createElementNS("","LAYERLIST");J.appendChild(G);for(var P=0;P<B.layerlist.length;P++){var N=this.createElementNS("","LAYERDEF");G.appendChild(N);N.setAttribute("id",B.layerlist[P].id);N.setAttribute("visible",B.layerlist[P].visible);if(typeof B.layerlist[P].query=="object"){var F=B.layerlist[P].query;if(F.where.length<0){continue}var X=null;if(typeof F.spatialfilter=="boolean"&&F.spatialfilter){X=this.createElementNS("","SPATIALQUERY")}else{X=this.createElementNS("","QUERY")}X.setAttribute("where",F.where);if(typeof F.accuracy=="number"&&F.accuracy>0){X.setAttribute("accuracy",F.accuracy)}if(typeof F.featurelimit=="number"&&F.featurelimit<2000){X.setAttribute("featurelimit",F.featurelimit)}if(typeof F.subfields=="string"&&F.subfields!="#ALL#"){X.setAttribute("subfields",F.subfields)}if(typeof F.joinexpression=="string"&&F.joinexpression.length>0){X.setAttribute("joinexpression",F.joinexpression)}if(typeof F.jointables=="string"&&F.jointables.length>0){X.setAttribute("jointables",F.jointables)}N.appendChild(X)}if(typeof B.layerlist[P].renderer=="object"){this.addRenderer(N,B.layerlist[P].renderer)}}}}else{if(C.get_feature!=null){var K=this.createElementNS("","GET_FEATURES");K.setAttribute("outputmode","newxml");K.setAttribute("checkesc","true");if(C.get_feature.geometry){K.setAttribute("geometry",C.get_feature.geometry)}else{K.setAttribute("geometry","false")}if(C.get_feature.compact){K.setAttribute("compact",C.get_feature.compact)}if(C.get_feature.featurelimit=="number"){K.setAttribute("featurelimit",C.get_feature.featurelimit)}K.setAttribute("globalenvelope","true");H.appendChild(K);if(C.get_feature.layer!=null&&C.get_feature.layer.length>0){var V=this.createElementNS("","LAYER");V.setAttribute("id",C.get_feature.layer);K.appendChild(V)}var R=C.get_feature.query;if(R!=null){var T=null;if(R.isspatial){T=this.createElementNS("","SPATIALQUERY")}else{T=this.createElementNS("","QUERY")}K.appendChild(T);if(typeof R.accuracy=="number"){T.setAttribute("accuracy",R.accuracy)}if(R.featurecoordsys!=null){var E=this.createElementNS("","FEATURECOORDSYS");if(R.featurecoordsys.id==0){E.setAttribute("string",R.featurecoordsys.string)}else{E.setAttribute("id",R.featurecoordsys.id)}T.appendChild(E)}if(R.filtercoordsys!=null){var D=this.createElementNS("","FILTERCOORDSYS");if(R.filtercoordsys.id===0){D.setAttribute("string",R.filtercoordsys.string)}else{D.setAttribute("id",R.filtercoordsys.id)}T.appendChild(D)}if(R.buffer>0){var L=this.createElementNS("","BUFFER");L.setAttribute("distance",R.buffer);T.appendChild(L)}if(R.isspatial){var I=this.createElementNS("","SPATIALFILTER");I.setAttribute("relation",R.spatialfilter.relation);T.appendChild(I);if(R.spatialfilter.envelope){var W=this.createElementNS("","ENVELOPE");W.setAttribute("minx",R.spatialfilter.envelope.minx);W.setAttribute("miny",R.spatialfilter.envelope.miny);W.setAttribute("maxx",R.spatialfilter.envelope.maxx);W.setAttribute("maxy",R.spatialfilter.envelope.maxy);I.appendChild(W)}else{if(typeof R.spatialfilter.polygon=="object"){I.appendChild(this.writePolygonGeometry(R.spatialfilter.polygon))}}}if(R.where!=null&&R.where.length>0){T.setAttribute("where",R.where)}}}}Q.appendChild(H);return OpenLayers.Format.XML.prototype.write.apply(this,[Q])},addGroupRenderer:function(B,A){var E=this.createElementNS("","GROUPRENDERER");B.appendChild(E);for(var C=0;C<A.length;C++){var D=A[C];this.addRenderer(E,D)}},addRenderer:function(C,B){if(OpenLayers.Util.isArray(B)){this.addGroupRenderer(C,B)}else{var A=this.createElementNS("",B.type.toUpperCase()+"RENDERER");C.appendChild(A);if(A.tagName=="VALUEMAPRENDERER"){this.addValueMapRenderer(A,B)}else{if(A.tagName=="VALUEMAPLABELRENDERER"){this.addValueMapLabelRenderer(A,B)}else{if(A.tagName=="SIMPLELABELRENDERER"){this.addSimpleLabelRenderer(A,B)}else{if(A.tagName=="SCALEDEPENDENTRENDERER"){this.addScaleDependentRenderer(A,B)}}}}}},addScaleDependentRenderer:function(A,B){if(typeof B.lower=="string"||typeof B.lower=="number"){A.setAttribute("lower",B.lower)}if(typeof B.upper=="string"||typeof B.upper=="number"){A.setAttribute("upper",B.upper)}this.addRenderer(A,B.renderer)},addValueMapLabelRenderer:function(H,G){H.setAttribute("lookupfield",G.lookupfield);H.setAttribute("labelfield",G.labelfield);if(typeof G.exacts=="object"){for(var A=0,J=G.exacts.length;A<J;A++){var E=G.exacts[A];var D=this.createElementNS("","EXACT");if(typeof E.value=="string"){D.setAttribute("value",E.value)}if(typeof E.label=="string"){D.setAttribute("label",E.label)}if(typeof E.method=="string"){D.setAttribute("method",E.method)}H.appendChild(D);if(typeof E.symbol=="object"){var B=null;if(E.symbol.type=="text"){B=this.createElementNS("","TEXTSYMBOL")}if(B!=null){var K=this.fontStyleKeys;for(var C=0,F=K.length;C<F;C++){var I=K[C];if(E.symbol[I]){B.setAttribute(I,E.symbol[I])}}D.appendChild(B)}}}}},addValueMapRenderer:function(J,I){J.setAttribute("lookupfield",I.lookupfield);if(typeof I.ranges=="object"){for(var A=0,B=I.ranges.length;A<B;A++){var G=I.ranges[A];var E=this.createElementNS("","RANGE");E.setAttribute("lower",G.lower);E.setAttribute("upper",G.upper);J.appendChild(E);if(typeof G.symbol=="object"){var D=null;if(G.symbol.type=="simplepolygon"){D=this.createElementNS("","SIMPLEPOLYGONSYMBOL")}if(D!=null){if(typeof G.symbol.boundarycolor=="string"){D.setAttribute("boundarycolor",G.symbol.boundarycolor)}if(typeof G.symbol.fillcolor=="string"){D.setAttribute("fillcolor",G.symbol.fillcolor)}if(typeof G.symbol.filltransparency=="number"){D.setAttribute("filltransparency",G.symbol.filltransparency)}E.appendChild(D)}}}}else{if(typeof I.exacts=="object"){for(var C=0,K=I.exacts.length;C<K;C++){var H=I.exacts[C];var F=this.createElementNS("","EXACT");if(typeof H.value=="string"){F.setAttribute("value",H.value)}if(typeof H.label=="string"){F.setAttribute("label",H.label)}if(typeof H.method=="string"){F.setAttribute("method",H.method)}J.appendChild(F);if(typeof H.symbol=="object"){var D=null;if(H.symbol.type=="simplemarker"){D=this.createElementNS("","SIMPLEMARKERSYMBOL")}if(D!=null){if(typeof H.symbol.antialiasing=="string"){D.setAttribute("antialiasing",H.symbol.antialiasing)}if(typeof H.symbol.color=="string"){D.setAttribute("color",H.symbol.color)}if(typeof H.symbol.outline=="string"){D.setAttribute("outline",H.symbol.outline)}if(typeof H.symbol.overlap=="string"){D.setAttribute("overlap",H.symbol.overlap)}if(typeof H.symbol.shadow=="string"){D.setAttribute("shadow",H.symbol.shadow)}if(typeof H.symbol.transparency=="number"){D.setAttribute("transparency",H.symbol.transparency)}if(typeof H.symbol.usecentroid=="string"){D.setAttribute("usecentroid",H.symbol.usecentroid)}if(typeof H.symbol.width=="number"){D.setAttribute("width",H.symbol.width)}F.appendChild(D)}}}}}},addSimpleLabelRenderer:function(F,H){F.setAttribute("field",H.field);var E=["featureweight","howmanylabels","labelbufferratio","labelpriorities","labelweight","linelabelposition","rotationalangles"];for(var D=0,A=E.length;D<A;D++){var C=E[D];if(H[C]){F.setAttribute(C,H[C])}}if(H.symbol.type=="text"){var G=H.symbol;var B=this.createElementNS("","TEXTSYMBOL");F.appendChild(B);var E=this.fontStyleKeys;for(var D=0,A=E.length;D<A;D++){var C=E[D];if(G[C]){B.setAttribute(C,H[C])}}}},writePolygonGeometry:function(G){if(!(G instanceof OpenLayers.Geometry.Polygon)){throw {message:"Cannot write polygon geometry to ArcXML with an "+G.CLASS_NAME+" object.",geometry:G}}var B=this.createElementNS("","POLYGON");for(var E=0,C=G.components.length;E<C;E++){var A=G.components[E];var I=this.createElementNS("","RING");for(var D=0,J=A.components.length;D<J;D++){var H=A.components[D];var F=this.createElementNS("","POINT");F.setAttribute("x",H.x);F.setAttribute("y",H.y);I.appendChild(F)}B.appendChild(I)}return B},parseResponse:function(Z){if(typeof Z=="string"){var N=new OpenLayers.Format.XML();Z=N.read(Z)}var A=new OpenLayers.Format.ArcXML.Response();var a=Z.getElementsByTagName("ERROR");if(a!=null&&a.length>0){A.error=this.getChildValue(a,"Unknown error.")}else{var R=Z.getElementsByTagName("RESPONSE");if(R==null||R.length==0){A.error="No RESPONSE tag found in ArcXML response.";return A}var Q=R[0].firstChild.nodeName;if(Q=="#text"){Q=R[0].firstChild.nextSibling.nodeName}if(Q=="IMAGE"){var C=Z.getElementsByTagName("ENVELOPE");var W=Z.getElementsByTagName("OUTPUT");if(C==null||C.length==0){A.error="No ENVELOPE tag found in ArcXML response."}else{if(W==null||W.length==0){A.error="No OUTPUT tag found in ArcXML response."}else{var U=this.parseAttributes(C[0]);var V=this.parseAttributes(W[0]);if(typeof V.type=="string"){A.image={envelope:U,output:{type:V.type,data:this.getChildValue(W[0])}}}else{A.image={envelope:U,output:V}}}}}else{if(Q=="FEATURES"){var I=R[0].getElementsByTagName("FEATURES");var P=I[0].getElementsByTagName("FEATURECOUNT");A.features.featurecount=P[0].getAttribute("count");if(A.features.featurecount>0){var D=I[0].getElementsByTagName("ENVELOPE");A.features.envelope=this.parseAttributes(D[0],typeof (0));var X=I[0].getElementsByTagName("FEATURE");for(var M=0;M<X.length;M++){var H=new OpenLayers.Feature.Vector();var S=X[M].getElementsByTagName("FIELD");for(var F=0;F<S.length;F++){var G=S[F].getAttribute("name");var K=S[F].getAttribute("value");H.attributes[G]=K}var T=X[M].getElementsByTagName("POLYGON");if(T.length>0){var J=T[0].getElementsByTagName("RING");var E=[];for(var O=0;O<J.length;O++){var Y=[];Y.push(this.parsePointGeometry(J[O]));var L=J[O].getElementsByTagName("HOLE");for(var B=0;B<L.length;B++){Y.push(this.parsePointGeometry(L[B]))}L=null;E.push(new OpenLayers.Geometry.Polygon(Y));Y=null}J=null;if(E.length==1){H.geometry=E[0]}else{H.geometry=new OpenLayers.Geometry.MultiPolygon(E)}}A.features.feature.push(H)}}}else{A.error="Unidentified response type."}}}return A},parseAttributes:function(D,C){var B={};for(var A=0;A<D.attributes.length;A++){if(C=="number"){B[D.attributes[A].nodeName]=parseFloat(D.attributes[A].nodeValue)}else{B[D.attributes[A].nodeName]=D.attributes[A].nodeValue}}return B},parsePointGeometry:function(D){var B=[];var E=D.getElementsByTagName("COORDS");if(E.length>0){var F=this.getChildValue(E[0]);F=F.split(/;/);for(var H=0;H<F.length;H++){var G=F[H].split(/ /);B.push(new OpenLayers.Geometry.Point(G[0],G[1]))}E=null}else{var A=D.getElementsByTagName("POINT");if(A.length>0){for(var C=0;C<A.length;C++){B.push(new OpenLayers.Geometry.Point(parseFloat(A[C].getAttribute("x")),parseFloat(A[C].getAttribute("y"))))}}A=null}return new OpenLayers.Geometry.LinearRing(B)},CLASS_NAME:"OpenLayers.Format.ArcXML"});OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(B){var A={get_image:{properties:{background:null,draw:true,envelope:{minx:0,miny:0,maxx:0,maxy:0},featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},imagesize:{height:0,width:0,dpi:96,printheight:0,printwidth:0,scalesymbols:false},layerlist:[],output:{baseurl:"",legendbaseurl:"",legendname:"",legendpath:"",legendurl:"",name:"",path:"",type:"jpg",url:""}}},get_feature:{layer:"",query:{isspatial:false,featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},buffer:0,where:"",spatialfilter:{relation:"envelope_intersection",envelope:null}}},environment:{separators:{cs:" ",ts:";"}},layer:[],workspaces:[]};return OpenLayers.Util.extend(this,A)},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"});OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(B){var A={image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""};return OpenLayers.Util.extend(this,A)},CLASS_NAME:"OpenLayers.Format.ArcXML.Response"});OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:true,name:"ArcIMS",isBaseLayer:true,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:true,async:true,name:"ArcIMS"},initialize:function(C,B,A){this.tileSize=new OpenLayers.Size(512,512);this.params=OpenLayers.Util.applyDefaults({ServiceName:A.serviceName},this.DEFAULT_PARAMS);this.options=OpenLayers.Util.applyDefaults(A,this.DEFAULT_OPTIONS);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[C,B,this.params,A]);if(this.transparent){if(!this.isBaseLayer){this.isBaseLayer=false}if(this.format=="image/jpeg"){this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}if(this.options.layers===null){this.options.layers=[]}},getURL:function(D){var A="";D=this.adjustBounds(D);var C=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:D.toArray(),tileSize:this.tileSize}));var B=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:C.write(),async:false});if(B!=null){var F=B.responseXML;if(!F||!F.documentElement){F=B.responseText}var E=new OpenLayers.Format.ArcXML();var G=E.read(F);A=this.getUrlOrImage(G.image.output)}return A},getURLasync:function(C,D,A){C=this.adjustBounds(C);var B=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:C.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(),async:true,data:B.write(),callback:function(E){var G=E.responseXML;if(!G||!G.documentElement){G=E.responseText}var F=new OpenLayers.Format.ArcXML();var H=F.read(G);D.call(A,this.getUrlOrImage(H.image.output))},scope:this})},getUrlOrImage:function(A){var B="";if(A.url){B=A.url}else{if(A.data){B="data:image/"+A.type+";base64,"+A.data}}return B},setLayerQuery:function(C,A){for(var B=0;B<this.options.layers.length;B++){if(C==this.options.layers[B].id){this.options.layers[B].query=A;return }}this.options.layers.push({id:C,visible:true,query:A})},getFeatureInfo:function(H,F,K){var B=K.buffer||1;var I=K.callback||function(){};var J=K.scope||window;var A={};OpenLayers.Util.extend(A,this.options);A.requesttype="feature";if(H instanceof OpenLayers.LonLat){A.polygon=null;A.envelope=[H.lon-B,H.lat-B,H.lon+B,H.lat+B]}else{if(H instanceof OpenLayers.Geometry.Polygon){A.envelope=null;A.polygon=H}}var E=new OpenLayers.Format.ArcXML(A);OpenLayers.Util.extend(E.request.get_feature,K);E.request.get_feature.layer=F.id;if(typeof F.query.accuracy=="number"){E.request.get_feature.query.accuracy=F.query.accuracy}else{var G=this.map.getCenter();var D=this.map.getViewPortPxFromLonLat(G);D.x++;var C=this.map.getLonLatFromPixel(D);E.request.get_feature.query.accuracy=C.lon-G.lon}E.request.get_feature.query.where=F.query.where;E.request.get_feature.query.spatialfilter.relation="area_intersection";OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:E.write(),callback:function(M){var L=E.parseResponse(M.responseText);if(!E.iserror()){I.call(J,L.features)}else{I.call(J,null)}}})},clone:function(A){if(A==null){A=new OpenLayers.Layer.ArcIMS(this.name,this.url,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},CLASS_NAME:"OpenLayers.Layer.ArcIMS"});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(A,B){B.exceptionReport={version:A.getAttribute("version"),language:A.getAttribute("xml:lang"),exceptions:[]};this.readChildNodes(A,B.exceptionReport)},AllowedValues:function(A,B){B.allowedValues={};this.readChildNodes(A,B.allowedValues)},AnyValue:function(A,B){B.anyValue=true},DataType:function(A,B){B.dataType=this.getChildValue(A)},Range:function(A,B){B.range={};this.readChildNodes(A,B.range)},MinimumValue:function(B,A){A.minValue=this.getChildValue(B)},MaximumValue:function(B,A){A.maxValue=this.getChildValue(B)},Identifier:function(A,B){B.identifier=this.getChildValue(A)},SupportedCRS:function(A,B){B.supportedCRS=this.getChildValue(A)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Util.applyDefaults({Range:function(A){var B=this.createElementNSPlus("ows:Range",{attributes:{"ows:rangeClosure":A.closure}});this.writeNode("ows:MinimumValue",A.minValue,B);this.writeNode("ows:MaximumValue",A.maxValue,B);return B},MinimumValue:function(B){var A=this.createElementNSPlus("ows:MinimumValue",{value:B});return A},MaximumValue:function(B){var A=this.createElementNSPlus("ows:MaximumValue",{value:B});return A},Value:function(B){var A=this.createElementNSPlus("ows:Value",{value:B});return A}},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(A){var B=this.writeNode("wcs:GetCoverage",A);this.setAttributeNS(B,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},writers:{wcs:{GetCoverage:function(A){var B=this.createElementNSPlus("wcs:GetCoverage",{attributes:{version:A.version||this.VERSION,service:"WCS"}});this.writeNode("ows:Identifier",A.identifier,B);this.writeNode("wcs:DomainSubset",A.domainSubset,B);this.writeNode("wcs:Output",A.output,B);return B},DomainSubset:function(A){var B=this.createElementNSPlus("wcs:DomainSubset",{});this.writeNode("ows:BoundingBox",A.boundingBox,B);if(A.temporalSubset){this.writeNode("wcs:TemporalSubset",A.temporalSubset,B)}return B},TemporalSubset:function(D){var C=this.createElementNSPlus("wcs:TemporalSubset",{});for(var B=0,A=D.timePeriods.length;B<A;++B){this.writeNode("wcs:TimePeriod",D.timePeriods[B],C)}return C},TimePeriod:function(A){var B=this.createElementNSPlus("wcs:TimePeriod",{});this.writeNode("wcs:BeginPosition",A.begin,B);this.writeNode("wcs:EndPosition",A.end,B);if(A.resolution){this.writeNode("wcs:TimeResolution",A.resolution,B)}return B},BeginPosition:function(A){var B=this.createElementNSPlus("wcs:BeginPosition",{value:A});return B},EndPosition:function(A){var B=this.createElementNSPlus("wcs:EndPosition",{value:A});return B},TimeResolution:function(A){var B=this.createElementNSPlus("wcs:TimeResolution",{value:A});return B},Output:function(A){var B=this.createElementNSPlus("wcs:Output",{attributes:{format:A.format,store:A.store}});if(A.gridCRS){this.writeNode("wcs:GridCRS",A.gridCRS,B)}return B},GridCRS:function(A){var B=this.createElementNSPlus("wcs:GridCRS",{});this.writeNode("wcs:GridBaseCRS",A.baseCRS,B);if(A.type){this.writeNode("wcs:GridType",A.type,B)}if(A.origin){this.writeNode("wcs:GridOrigin",A.origin,B)}this.writeNode("wcs:GridOffsets",A.offsets,B);if(A.CS){this.writeNode("wcs:GridCS",A.CS,B)}return B},GridBaseCRS:function(A){return this.createElementNSPlus("wcs:GridBaseCRS",{value:A})},GridOrigin:function(A){return this.createElementNSPlus("wcs:GridOrigin",{value:A})},GridType:function(A){return this.createElementNSPlus("wcs:GridType",{value:A})},GridOffsets:function(A){return this.createElementNSPlus("wcs:GridOffsets",{value:A})},GridCS:function(A){return this.createElementNSPlus("wcs:GridCS",{value:A})}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.WCSGetCoverage"});OpenLayers.Format.WPSExecute=OpenLayers.Class(OpenLayers.Format.XML,{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(A){return undefined},write:function(A){var C;if(window.ActiveXObject){C=new ActiveXObject("Microsoft.XMLDOM");this.xmldom=C}else{C=document.implementation.createDocument("","",null)}var B=this.writeNode("wps:Execute",A,C);this.setAttributeNS(B,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},writers:{wps:{Execute:function(A){var B=this.createElementNSPlus("wps:Execute",{attributes:{version:this.VERSION,service:"WPS"}});this.writeNode("ows:Identifier",A.identifier,B);this.writeNode("wps:DataInputs",A.dataInputs,B);this.writeNode("wps:ResponseForm",A.responseForm,B);return B},ResponseForm:function(A){var B=this.createElementNSPlus("wps:ResponseForm",{});if(A.rawDataOutput){this.writeNode("wps:RawDataOutput",A.rawDataOutput,B)}if(A.responseDocument){this.writeNode("wps:ResponseDocument",A.responseDocument,B)}return B},ResponseDocument:function(A){var B=this.createElementNSPlus("wps:ResponseDocument",{attributes:{storeExecuteResponse:A.storeExecuteResponse,lineage:A.lineage,status:A.status}});if(A.output){this.writeNode("wps:Output",A.output,B)}return B},Output:function(A){var B=this.createElementNSPlus("wps:Output",{attributes:{asReference:A.asReference}});this.writeNode("ows:Identifier",A.identifier,B);this.writeNode("ows:Title",A.title,B);this.writeNode("ows:Abstract",A["abstract"],B);return B},RawDataOutput:function(A){var B=this.createElementNSPlus("wps:RawDataOutput",{attributes:{mimeType:A.mimeType}});this.writeNode("ows:Identifier",A.identifier,B);return B},DataInputs:function(A){var D=this.createElementNSPlus("wps:DataInputs",{});for(var B=0,C=A.length;B<C;++B){this.writeNode("wps:Input",A[B],D)}return D},Input:function(A){var B=this.createElementNSPlus("wps:Input",{});this.writeNode("ows:Identifier",A.identifier,B);if(A.title){this.writeNode("ows:Title",A.title,B)}if(A.data){this.writeNode("wps:Data",A.data,B)}if(A.reference){this.writeNode("wps:Reference",A.reference,B)}return B},Data:function(B){var A=this.createElementNSPlus("wps:Data",{});if(B.literalData){this.writeNode("wps:LiteralData",B.literalData,A)}else{if(B.complexData){this.writeNode("wps:ComplexData",B.complexData,A)}}return A},LiteralData:function(B){var A=this.createElementNSPlus("wps:LiteralData",{attributes:{uom:B.uom},value:B.value});return A},ComplexData:function(A){var B=this.createElementNSPlus("wps:ComplexData",{attributes:{mimeType:A.mimeType,encoding:A.encoding,schema:A.schema}});var C=A.value;if(typeof C==="string"){B.appendChild(this.getXMLDoc().createCDATASection(A.value))}else{B.appendChild(C)}return B},Reference:function(A){var B=this.createElementNSPlus("wps:Reference",{attributes:{mimeType:A.mimeType,"xlink:href":A.href,method:A.method,encoding:A.encoding,schema:A.schema}});if(A.body){this.writeNode("wps:Body",A.body,B)}return B},Body:function(A){var B=this.createElementNSPlus("wps:Body",{});if(A.wcs){this.writeNode("wcs:GetCoverage",A.wcs,B)}else{if(A.wfs){this.featureType=A.wfs.featureType;this.version=A.wfs.version;this.writeNode("wfs:GetFeature",A.wfs,B)}else{this.writeNode("wps:Execute",A,B)}}return B}},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},CLASS_NAME:"OpenLayers.Format.WPSExecute"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(A){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.map){this.map.events.unregister("buttonclick",this,this.onButtonClick)}this.removeButtons();this.buttons=null;this.position=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(A){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("buttonclick",this,this.onButtonClick)},draw:function(B){OpenLayers.Control.prototype.draw.apply(this,arguments);B=this.position;this.buttons=[];var C={w:18,h:18};var A=new OpenLayers.Pixel(B.x+C.w/2,B.y);this._addButton("panup","north-mini.png",A,C);B.y=A.y+C.h;this._addButton("panleft","west-mini.png",B,C);this._addButton("panright","east-mini.png",B.add(C.w,0),C);this._addButton("pandown","south-mini.png",A.add(0,C.h*2),C);this._addButton("zoomin","zoom-plus-mini.png",A.add(0,C.h*3+5),C);this._addButton("zoomworld","zoom-world-mini.png",A.add(0,C.h*4+5),C);this._addButton("zoomout","zoom-minus-mini.png",A.add(0,C.h*5+5),C);return this.div},_addButton:function(F,A,E,D){var C=OpenLayers.Util.getImageLocation(A);var B=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+F,E,D,C,"absolute");B.style.cursor="pointer";this.div.appendChild(B);B.action=F;B.className="olButton";this.buttons.push(B);return B},_removeButton:function(A){this.div.removeChild(A);OpenLayers.Util.removeItem(this.buttons,A)},removeButtons:function(){for(var A=this.buttons.length-1;A>=0;--A){this._removeButton(this.buttons[A])}},onButtonClick:function(A){var B=A.buttonElement;switch(B.action){case"panup":this.map.pan(0,-this.getSlideFactor("h"));break;case"pandown":this.map.pan(0,this.getSlideFactor("h"));break;case"panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case"panright":this.map.pan(this.getSlideFactor("w"),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break}},getSlideFactor:function(A){return this.slideRatio?this.map.getSize()[A]*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:false,panIcons:true,forceFixedZoomLevel:false,mouseDragStart:null,deltaY:null,zoomStart:null,destroy:function(){this._removeZoomBar();this.map.events.un({changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);delete this.mouseDragStart;delete this.zoomStart},setMap:function(A){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){if(this.div!=null){this.removeButtons();this._removeZoomBar()}this.draw()},draw:function(B){OpenLayers.Control.prototype.draw.apply(this,arguments);B=this.position.clone();this.buttons=[];var D={w:18,h:18};if(this.panIcons){var A=new OpenLayers.Pixel(B.x+D.w/2,B.y);var C=D.w;if(this.zoomWorldIcon){A=new OpenLayers.Pixel(B.x+D.w,B.y)}this._addButton("panup","north-mini.png",A,D);B.y=A.y+D.h;this._addButton("panleft","west-mini.png",B,D);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",B.add(D.w,0),D);C*=2}this._addButton("panright","east-mini.png",B.add(C,0),D);this._addButton("pandown","south-mini.png",A.add(0,D.h*2),D);this._addButton("zoomin","zoom-plus-mini.png",A.add(0,D.h*3+5),D);A=this._addZoomBar(A.add(0,D.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",A,D)}else{this._addButton("zoomin","zoom-plus-mini.png",B,D);A=this._addZoomBar(B.add(0,D.h));this._addButton("zoomout","zoom-minus-mini.png",A,D);if(this.zoomWorldIcon){A=A.add(0,D.h+3);this._addButton("zoomworld","zoom-world-mini.png",A,D)}}return this.div},_addZoomBar:function(A){var E=OpenLayers.Util.getImageLocation("slider.png");var G=this.id+"_"+this.map.id;var B=this.map.getNumZoomLevels()-1-this.map.getZoom();var C=OpenLayers.Util.createAlphaImageDiv(G,A.add(-1,B*this.zoomStopHeight),{w:20,h:9},E,"absolute");C.style.cursor="move";this.slider=C;this.sliderEvents=new OpenLayers.Events(this,C,null,true,{includeXY:true});this.sliderEvents.on({touchstart:this.zoomBarDown,touchmove:this.zoomBarDrag,touchend:this.zoomBarUp,mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp});var D={w:this.zoomStopWidth,h:this.zoomStopHeight*this.map.getNumZoomLevels()};var E=OpenLayers.Util.getImageLocation("zoombar.png");var F=null;if(OpenLayers.Util.alphaHack()){var G=this.id+"_"+this.map.id;F=OpenLayers.Util.createAlphaImageDiv(G,A,{w:D.w,h:this.zoomStopHeight},E,"absolute",null,"crop");F.style.height=D.h+"px"}else{F=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,A,D,E)}F.style.cursor="pointer";F.className="olButton";this.zoombarDiv=F;this.div.appendChild(F);this.startTop=parseInt(F.style.top);this.div.appendChild(C);this.map.events.register("zoomend",this,this.moveZoomBar);A=A.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return A},_removeZoomBar:function(){this.sliderEvents.un({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(A){OpenLayers.Control.PanZoom.prototype.onButtonClick.apply(this,arguments);if(A.buttonElement===this.zoombarDiv){var C=A.buttonXY.y/this.zoomStopHeight;if(this.forceFixedZoomLevel||!this.map.fractionalZoom){C=Math.floor(C)}var B=(this.map.getNumZoomLevels()-1)-C;B=Math.min(Math.max(B,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(B)}},passEventToSlider:function(A){this.sliderEvents.handleBrowserEvent(A)},zoomBarDown:function(A){if(!OpenLayers.Event.isLeftClick(A)&&!OpenLayers.Event.isSingleTouch(A)){return }this.map.events.on({touchmove:this.passEventToSlider,mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=A.xy.clone();this.zoomStart=A.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(A)},zoomBarDrag:function(B){if(this.mouseDragStart!=null){var A=this.mouseDragStart.y-B.xy.y;var D=OpenLayers.Util.pagePosition(this.zoombarDiv);if((B.clientY-D[1])>0&&(B.clientY-D[1])<parseInt(this.zoombarDiv.style.height)-2){var C=parseInt(this.slider.style.top)-A;this.slider.style.top=C+"px";this.mouseDragStart=B.xy.clone()}this.deltaY=this.zoomStart.y-B.xy.y;OpenLayers.Event.stop(B)}},zoomBarUp:function(A){if(!OpenLayers.Event.isLeftClick(A)&&A.type!=="touchend"){return }if(this.mouseDragStart){this.div.style.cursor="";this.map.events.un({touchmove:this.passEventToSlider,mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var B=this.map.zoom;if(!this.forceFixedZoomLevel&&this.map.fractionalZoom){B+=this.deltaY/this.zoomStopHeight;B=Math.min(Math.max(B,0),this.map.getNumZoomLevels()-1)}else{B+=this.deltaY/this.zoomStopHeight;B=Math.max(Math.round(B),0)}this.map.zoomTo(B);this.mouseDragStart=null;this.zoomStart=null;this.deltaY=0;OpenLayers.Event.stop(A)}},moveZoomBar:function(){var A=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=A+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.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(B,C){var A=this.getChildValue(B);if(A){C.srs=A}}},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:true,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(C,B,E,D,A){this.url=B;this.extent=E;this.maxExtent=E;this.size=D;OpenLayers.Layer.prototype.initialize.apply(this,[C,A]);this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.extent.getWidth()/this.size.w)},destroy:function(){if(this.tile){this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null}OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(A){if(A==null){A=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.getOptions())}A=OpenLayers.Layer.prototype.clone.apply(this,[A]);return A},setMap:function(A){if(this.options.maxResolution==null){this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w}OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(D,A,E){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var B=(this.tile==null);if(A||B){this.setTileSize();var C=this.map.getLayerPxFromLonLat({lon:this.extent.left,lat:this.extent.top});if(B){this.tile=new OpenLayers.Tile.Image(this,C,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=C.clone()}this.tile.draw()}},setTileSize:function(){var B=this.extent.getWidth()/this.map.getResolution();var A=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(B,A)},addTileMonitoringHooks:function(A){A.onLoadStart=function(){this.events.triggerEvent("loadstart")};A.events.register("loadstart",this,A.onLoadStart);A.onLoadEnd=function(){this.events.triggerEvent("loadend")};A.events.register("loadend",this,A.onLoadEnd);A.events.register("unload",this,A.onLoadEnd)},removeTileMonitoringHooks:function(A){A.unload();A.events.un({loadstart:A.onLoadStart,loadend:A.onLoadEnd,unload:A.onLoadEnd,scope:this})},setUrl:function(A){this.url=A;this.tile.draw()},getURL:function(A){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(A){OpenLayers.Util.extend(this,A);this.options=A;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(A){this.layer=A},activate:function(){if(!this.active){this.active=true;return true}return false},deactivate:function(){if(this.active){this.active=false;return true}return false},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{events:null,auto:false,timer:null,initialize:function(A){OpenLayers.Strategy.prototype.initialize.apply(this,[A]);this.events=new OpenLayers.Events(this)},activate:function(){var A=OpenLayers.Strategy.prototype.activate.call(this);if(A){if(this.auto){if(typeof this.auto==="number"){this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),this.auto*1000)}else{this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return A},deactivate:function(){var A=OpenLayers.Strategy.prototype.deactivate.call(this);if(A){if(this.auto){if(typeof this.auto==="number"){window.clearInterval(this.timer)}else{this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return A},triggerSave:function(B){var A=B.feature;if(A.state===OpenLayers.State.INSERT||A.state===OpenLayers.State.UPDATE||A.state===OpenLayers.State.DELETE){this.save([B.feature])}},save:function(D){if(!D){D=this.layer.features}this.events.triggerEvent("start",{features:D});var F=this.layer.projection;var C=this.layer.map.getProjectionObject();if(!C.equals(F)){var A=D.length;var E=new Array(A);var H,G;for(var B=0;B<A;++B){H=D[B];G=H.clone();G.fid=H.fid;G.state=H.state;if(H.url){G.url=H.url}G._original=H;G.geometry.transform(C,F);E[B]=G}D=E}this.layer.protocol.commit(D,{callback:this.onCommit,scope:this})},onCommit:function(D){var I={response:D};if(D.success()){var B=D.reqFeatures;var A,J;var C=[];var H=D.insertIds||[];var E=0;for(var F=0,G=B.length;F<G;++F){J=B[F];J=J._original||J;A=J.state;if(A){if(A==OpenLayers.State.DELETE){C.push(J)}else{if(A==OpenLayers.State.INSERT){J.fid=H[E];++E}}J.state=null}}if(C.length>0){this.layer.destroyFeatures(C)}this.events.triggerEvent("success",I)}else{this.events.triggerEvent("fail",I)}},CLASS_NAME:"OpenLayers.Strategy.Save"});OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{defaultDesc:"No description available",extractWaypoints:true,extractTracks:true,extractRoutes:true,extractAttributes:true,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(A){this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(S){if(typeof S=="string"){S=OpenLayers.Format.XML.prototype.read.apply(this,[S])}var C=[];if(this.extractTracks){var O=S.getElementsByTagName("trk");for(var N=0,P=O.length;N<P;N++){var I={};if(this.extractAttributes){I=this.parseAttributes(O[N])}var G=this.getElementsByTagNameNS(O[N],O[N].namespaceURI,"trkseg");for(var M=0,F=G.length;M<F;M++){var H=this.extractSegment(G[M],"trkpt");C.push(new OpenLayers.Feature.Vector(H,I))}}}if(this.extractRoutes){var A=S.getElementsByTagName("rte");for(var L=0,K=A.length;L<K;L++){var I={};if(this.extractAttributes){I=this.parseAttributes(A[L])}var R=this.extractSegment(A[L],"rtept");C.push(new OpenLayers.Feature.Vector(R,I))}}if(this.extractWaypoints){var B=S.getElementsByTagName("wpt");for(var J=0,P=B.length;J<P;J++){var I={};if(this.extractAttributes){I=this.parseAttributes(B[J])}var E=new OpenLayers.Geometry.Point(B[J].getAttribute("lon"),B[J].getAttribute("lat"));C.push(new OpenLayers.Feature.Vector(E,I))}}if(this.internalProjection&&this.externalProjection){for(var Q=0,D=C.length;Q<D;Q++){C[Q].geometry.transform(this.externalProjection,this.internalProjection)}}return C},extractSegment:function(E,F){var D=this.getElementsByTagNameNS(E,E.namespaceURI,F);var B=[];for(var C=0,A=D.length;C<A;C++){B.push(new OpenLayers.Geometry.Point(D[C].getAttribute("lon"),D[C].getAttribute("lat")))}return new OpenLayers.Geometry.LineString(B)},parseAttributes:function(C){var A={};var E=C.firstChild,D,B;while(E){if(E.nodeType==1&&E.firstChild){D=E.firstChild;if(D.nodeType==3||D.nodeType==4){B=(E.prefix)?E.nodeName.split(":")[1]:E.nodeName;if(B!="trkseg"&&B!="rtept"){A[B]=D.nodeValue}}}E=E.nextSibling}return A},write:function(D,C){D=OpenLayers.Util.isArray(D)?D:[D];var E=this.createElementNS(this.namespaces.gpx,"gpx");E.setAttribute("version","1.1");E.setAttribute("creator",this.creator);this.setAttributes(E,{"xsi:schemaLocation":this.schemaLocation});if(C&&typeof C=="object"){E.appendChild(this.buildMetadataNode(C))}for(var B=0,A=D.length;B<A;B++){E.appendChild(this.buildFeatureNode(D[B]))}return OpenLayers.Format.XML.prototype.write.apply(this,[E])},buildMetadataNode:function(C){var B=["name","desc","author"],E=this.createElementNSPlus("gpx:metadata");for(var A=0;A<B.length;A++){var D=B[A];if(C[D]){var F=this.createElementNSPlus("gpx:"+D);F.appendChild(this.createTextNode(C[D]));E.appendChild(F)}}return E},buildFeatureNode:function(D){var G=D.geometry;G=G.clone();if(this.internalProjection&&this.externalProjection){G.transform(this.internalProjection,this.externalProjection)}if(G.CLASS_NAME=="OpenLayers.Geometry.Point"){var F=this.buildWptNode(G);this.appendAttributesNode(F,D);return F}else{var B=this.createElementNSPlus("gpx:trk");this.appendAttributesNode(B,D);var E=this.buildTrkSegNode(G);E=OpenLayers.Util.isArray(E)?E:[E];for(var C=0,A=E.length;C<A;C++){B.appendChild(E[C])}return B}},buildTrkSegNode:function(F){var E,D,B,A,C;if(F.CLASS_NAME=="OpenLayers.Geometry.LineString"||F.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){E=this.createElementNSPlus("gpx:trkseg");for(D=0,B=F.components.length;D<B;D++){A=F.components[D];E.appendChild(this.buildTrkPtNode(A))}return E}else{C=[];for(D=0,B=F.components.length;D<B;D++){C.push(this.buildTrkSegNode(F.components[D]))}return C}},buildTrkPtNode:function(A){var B=this.createElementNSPlus("gpx:trkpt");B.setAttribute("lon",A.x);B.setAttribute("lat",A.y);return B},buildWptNode:function(B){var A=this.createElementNSPlus("gpx:wpt");A.setAttribute("lon",B.x);A.setAttribute("lat",B.y);return A},appendAttributesNode:function(C,B){var A=this.createElementNSPlus("gpx:name");A.appendChild(this.createTextNode(B.attributes.name||B.id));C.appendChild(A);var D=this.createElementNSPlus("gpx:desc");D.appendChild(this.createTextNode(B.attributes.description||this.defaultDesc));C.appendChild(D)},CLASS_NAME:"OpenLayers.Format.GPX"});OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},readers:{xsd:{schema:function(D,I){var E=[];var B={};var F={complexTypes:E,customTypes:B};this.readChildNodes(D,F);var G=D.attributes;var K,A;for(var H=0,J=G.length;H<J;++H){K=G[H];A=K.name;if(A.indexOf("xmlns")==0){this.setNamespace(A.split(":")[1]||"",K.value)}else{I[A]=K.value}}I.featureTypes=E;I.targetPrefix=this.namespaceAlias[I.targetNamespace];var L,C;for(var H=0,J=E.length;H<J;++H){L=E[H];C=B[L.typeName];if(B[L.typeName]){L.typeName=C.name}}},complexType:function(B,C){var A={typeName:B.getAttribute("name")};this.readChildNodes(B,A);C.complexTypes.push(A)},complexContent:function(A,B){this.readChildNodes(A,B)},extension:function(A,B){this.readChildNodes(A,B)},sequence:function(A,B){var C={elements:[]};this.readChildNodes(A,C);B.properties=C.elements},element:function(A,C){if(C.elements){var D={};var B=A.attributes;var G;for(var E=0,F=B.length;E<F;++E){G=B[E];D[G.name]=G.value}var H=D.type;if(!H){H={};this.readChildNodes(A,H);D.restriction=H;D.type=H.base}var J=H.base||H;D.localType=J.split(":").pop();C.elements.push(D)}if(C.complexTypes){var H=A.getAttribute("type");var I=H.split(":").pop();C.customTypes[I]={name:A.getAttribute("name"),type:H}}},simpleType:function(A,B){this.readChildNodes(A,B)},restriction:function(A,B){B.base=A.getAttribute("base");this.readRestriction(A,B)}}},readRestriction:function(D,F){var C=D.childNodes;var H,G,E;for(var B=0,A=C.length;B<A;++B){H=C[B];if(H.nodeType==1){G=H.nodeName.split(":").pop();E=H.getAttribute("value");if(!F[G]){F[G]=E}else{if(typeof F[G]=="string"){F[G]=[F[G]]}F[G].push(E)}}}},read:function(B){if(typeof B=="string"){B=OpenLayers.Format.XML.prototype.read.apply(this,[B])}if(B&&B.nodeType==9){B=B.documentElement}var A={};this.readNode(B,A);return A},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,featureDx:0,initialize:function(A,B){this.container=OpenLayers.Util.getElement(A);OpenLayers.Util.extend(this,B)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(B,C){this.extent=B.clone();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var A=B.getWidth()/this.map.getExtent().getWidth(),B=B.scale(1/A);this.extent=B.wrapDateLine(this.map.getMaxExtent()).scale(A)}if(C){this.resolution=null}return true},setSize:function(A){this.size=A.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(I,B){if(B==null){B=I.style}if(I.geometry){var A=I.geometry.getBounds();if(A){var H;if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){H=this.map.getMaxExtent()}if(!A.intersectsBounds(this.extent,{worldBounds:H})){B={display:"none"}}else{this.calculateFeatureDx(A,H)}var C=this.drawGeometry(I.geometry,B,I.id);if(B.display!="none"&&B.label&&C!==false){var G=I.geometry.getCentroid();if(B.labelXOffset||B.labelYOffset){var E=isNaN(B.labelXOffset)?0:B.labelXOffset;var D=isNaN(B.labelYOffset)?0:B.labelYOffset;var F=this.getResolution();G.move(E*F,D*F)}this.drawText(I.id,B,G)}else{this.removeText(I.id)}return C}}},calculateFeatureDx:function(E,D){this.featureDx=0;if(D){var F=D.getWidth(),B=(this.extent.left+this.extent.right)/2,C=(E.left+E.right)/2,A=Math.round((C-B)/F);this.featureDx=A*F}},drawGeometry:function(C,A,B){},drawText:function(C,B,A){},removeText:function(A){},clear:function(){},getFeatureIdFromEvent:function(A){},eraseFeatures:function(D){if(!(OpenLayers.Util.isArray(D))){D=[D]}for(var C=0,A=D.length;C<A;++C){var B=D[C];this.eraseGeometry(B.geometry,B.id);this.removeText(B.id)}},eraseGeometry:function(B,A){},moveRoot:function(A){},getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(B){var A=OpenLayers.Util.extend({},OpenLayers.Renderer.defaultSymbolizer);if(B.stroke===false){delete A.strokeWidth;delete A.strokeColor}if(B.fill===false){delete A.fillColor}OpenLayers.Util.extend(A,B);return A},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:true,hitOverflow:0,canvas:null,features:null,pendingRedraw:false,cachedSymbolBounds:{},initialize:function(A,B){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={};if(this.hitDetection){this.hitCanvas=document.createElement("canvas");this.hitContext=this.hitCanvas.getContext("2d")}},setExtent:function(){OpenLayers.Renderer.prototype.setExtent.apply(this,arguments);return false},eraseGeometry:function(B,A){this.eraseFeatures(this.features[A][0])},supported:function(){return OpenLayers.CANVAS_SUPPORTED},setSize:function(B){this.size=B.clone();var A=this.root;A.style.width=B.w+"px";A.style.height=B.h+"px";A.width=B.w;A.height=B.h;this.resolution=null;if(this.hitDetection){var C=this.hitCanvas;C.style.width=B.w+"px";C.style.height=B.h+"px";C.width=B.w;C.height=B.h}},drawFeature:function(A,B){var F;if(A.geometry){B=this.applyDefaultSymbolizer(B||A.style);var E=A.geometry.getBounds();var D;if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){D=this.map.getMaxExtent()}var C=E&&E.intersectsBounds(this.extent,{worldBounds:D});F=(B.display!=="none")&&!!E&&C;if(F){this.features[A.id]=[A,B]}else{delete (this.features[A.id])}this.pendingRedraw=true}if(this.pendingRedraw&&!this.locked){this.redraw();this.pendingRedraw=false}return F},drawGeometry:function(E,C,D){var B=E.CLASS_NAME;if((B=="OpenLayers.Geometry.Collection")||(B=="OpenLayers.Geometry.MultiPoint")||(B=="OpenLayers.Geometry.MultiLineString")||(B=="OpenLayers.Geometry.MultiPolygon")){for(var A=0;A<E.components.length;A++){this.drawGeometry(E.components[A],C,D)}return }switch(E.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(E,C,D);break;case"OpenLayers.Geometry.LineString":this.drawLineString(E,C,D);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(E,C,D);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(E,C,D);break;default:break}},drawExternalGraphic:function(I,A,D){var E=new Image();if(A.graphicTitle){E.title=A.graphicTitle}var B=A.graphicWidth||A.graphicHeight;var J=A.graphicHeight||A.graphicWidth;B=B?B:A.pointRadius*2;J=J?J:A.pointRadius*2;var G=(A.graphicXOffset!=undefined)?A.graphicXOffset:-(0.5*B);var C=(A.graphicYOffset!=undefined)?A.graphicYOffset:-(0.5*J);var F=A.graphicOpacity||A.fillOpacity;var H=function(){if(!this.features[D]){return }var N=this.getLocalXY(I);var Q=N[0];var O=N[1];if(!isNaN(Q)&&!isNaN(O)){var K=(Q+G)|0;var P=(O+C)|0;var L=this.canvas;L.globalAlpha=F;var M=OpenLayers.Renderer.Canvas.drawImageScaleFactor||(OpenLayers.Renderer.Canvas.drawImageScaleFactor=/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1);L.drawImage(E,K*M,P*M,B*M,J*M);if(this.hitDetection){this.setHitContextStyle("fill",D);this.hitContext.fillRect(K,P,B,J)}}};E.onload=OpenLayers.Function.bind(H,this);E.src=A.externalGraphic},drawNamedSymbol:function(L,B,H){var M,K,G,F,I,A,C,E;var J;var N=Math.PI/180;var D=OpenLayers.Renderer.symbol[B.graphicName];if(!D){throw new Error(B.graphicName+" is not a valid symbol name")}if(!D.length||D.length<2){return }var Q=this.getLocalXY(L);var P=Q[0];var O=Q[1];if(isNaN(P)||isNaN(O)){return }this.canvas.lineCap="round";this.canvas.lineJoin="round";if(this.hitDetection){this.hitContext.lineCap="round";this.hitContext.lineJoin="round"}if(B.graphicName in this.cachedSymbolBounds){A=this.cachedSymbolBounds[B.graphicName]}else{A=new OpenLayers.Bounds();for(I=0;I<D.length;I+=2){A.extend(new OpenLayers.LonLat(D[I],D[I+1]))}this.cachedSymbolBounds[B.graphicName]=A}this.canvas.save();if(this.hitDetection){this.hitContext.save()}this.canvas.translate(P,O);if(this.hitDetection){this.hitContext.translate(P,O)}E=N*B.rotation;if(!isNaN(E)){this.canvas.rotate(E);if(this.hitDetection){this.hitContext.rotate(E)}}C=2*B.pointRadius/Math.max(A.getWidth(),A.getHeight());this.canvas.scale(C,C);if(this.hitDetection){this.hitContext.scale(C,C)}G=A.getCenterLonLat().lon;F=A.getCenterLonLat().lat;this.canvas.translate(-G,-F);if(this.hitDetection){this.hitContext.translate(-G,-F)}J=B.strokeWidth;B.strokeWidth=J/C;if(B.fill!==false){this.setCanvasStyle("fill",B);this.canvas.beginPath();for(I=0;I<D.length;I=I+2){M=D[I];K=D[I+1];if(I==0){this.canvas.moveTo(M,K)}this.canvas.lineTo(M,K)}this.canvas.closePath();this.canvas.fill();if(this.hitDetection){this.setHitContextStyle("fill",H,B);this.hitContext.beginPath();for(I=0;I<D.length;I=I+2){M=D[I];K=D[I+1];if(I==0){this.canvas.moveTo(M,K)}this.hitContext.lineTo(M,K)}this.hitContext.closePath();this.hitContext.fill()}}if(B.stroke!==false){this.setCanvasStyle("stroke",B);this.canvas.beginPath();for(I=0;I<D.length;I=I+2){M=D[I];K=D[I+1];if(I==0){this.canvas.moveTo(M,K)}this.canvas.lineTo(M,K)}this.canvas.closePath();this.canvas.stroke();if(this.hitDetection){this.setHitContextStyle("stroke",H,B,C);this.hitContext.beginPath();for(I=0;I<D.length;I=I+2){M=D[I];K=D[I+1];if(I==0){this.hitContext.moveTo(M,K)}this.hitContext.lineTo(M,K)}this.hitContext.closePath();this.hitContext.stroke()}}B.strokeWidth=J;this.canvas.restore();if(this.hitDetection){this.hitContext.restore()}this.setCanvasStyle("reset")},setCanvasStyle:function(B,A){if(B==="fill"){this.canvas.globalAlpha=A.fillOpacity;this.canvas.fillStyle=A.fillColor}else{if(B==="stroke"){this.canvas.globalAlpha=A.strokeOpacity;this.canvas.strokeStyle=A.strokeColor;this.canvas.lineWidth=A.strokeWidth}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}}},featureIdToHex:function(C){var D=Number(C.split("_").pop())+1;if(D>=16777216){this.hitOverflow=D-16777215;D=D%16777216+1}var B="000000"+D.toString(16);var A=B.length;B="#"+B.substring(A-6,A);return B},setHitContextStyle:function(B,E,A,D){var C=this.featureIdToHex(E);if(B=="fill"){this.hitContext.globalAlpha=1;this.hitContext.fillStyle=C}else{if(B=="stroke"){this.hitContext.globalAlpha=1;this.hitContext.strokeStyle=C;if(typeof D==="undefined"){this.hitContext.lineWidth=A.strokeWidth+2}else{if(!isNaN(D)){this.hitContext.lineWidth=A.strokeWidth+2/D}}}else{this.hitContext.globalAlpha=0;this.hitContext.lineWidth=1}}},drawPoint:function(G,C,F){if(C.graphic!==false){if(C.externalGraphic){this.drawExternalGraphic(G,C,F)}else{if(C.graphicName&&(C.graphicName!="circle")){this.drawNamedSymbol(G,C,F)}else{var D=this.getLocalXY(G);var H=D[0];var E=D[1];if(!isNaN(H)&&!isNaN(E)){var B=Math.PI*2;var A=C.pointRadius;if(C.fill!==false){this.setCanvasStyle("fill",C);this.canvas.beginPath();this.canvas.arc(H,E,A,0,B,true);this.canvas.fill();if(this.hitDetection){this.setHitContextStyle("fill",F,C);this.hitContext.beginPath();this.hitContext.arc(H,E,A,0,B,true);this.hitContext.fill()}}if(C.stroke!==false){this.setCanvasStyle("stroke",C);this.canvas.beginPath();this.canvas.arc(H,E,A,0,B,true);this.canvas.stroke();if(this.hitDetection){this.setHitContextStyle("stroke",F,C);this.hitContext.beginPath();this.hitContext.arc(H,E,A,0,B,true);this.hitContext.stroke()}this.setCanvasStyle("reset")}}}}}},drawLineString:function(C,A,B){A=OpenLayers.Util.applyDefaults({fill:false},A);this.drawLinearRing(C,A,B)},drawLinearRing:function(C,A,B){if(A.fill!==false){this.setCanvasStyle("fill",A);this.renderPath(this.canvas,C,A,B,"fill");if(this.hitDetection){this.setHitContextStyle("fill",B,A);this.renderPath(this.hitContext,C,A,B,"fill")}}if(A.stroke!==false){this.setCanvasStyle("stroke",A);this.renderPath(this.canvas,C,A,B,"stroke");if(this.hitDetection){this.setHitContextStyle("stroke",B,A);this.renderPath(this.hitContext,C,A,B,"stroke")}}this.setCanvasStyle("reset")},renderPath:function(C,J,A,E,H){var F=J.components;var G=F.length;C.beginPath();var B=this.getLocalXY(F[0]);var K=B[0];var I=B[1];if(!isNaN(K)&&!isNaN(I)){C.moveTo(B[0],B[1]);for(var D=1;D<G;++D){var L=this.getLocalXY(F[D]);C.lineTo(L[0],L[1])}if(H==="fill"){C.fill()}else{C.stroke()}}},drawPolygon:function(F,C,E){var D=F.components;var A=D.length;this.drawLinearRing(D[0],C,E);for(var B=1;B<A;++B){this.canvas.globalCompositeOperation="destination-out";if(this.hitDetection){this.hitContext.globalCompositeOperation="destination-out"}this.drawLinearRing(D[B],OpenLayers.Util.applyDefaults({stroke:false,fillOpacity:1},C),E);this.canvas.globalCompositeOperation="source-over";if(this.hitDetection){this.hitContext.globalCompositeOperation="source-over"}this.drawLinearRing(D[B],OpenLayers.Util.applyDefaults({fill:false},C),E)}},drawText:function(K,A){var L=this.getLocalXY(K);this.setCanvasStyle("reset");this.canvas.fillStyle=A.fontColor;this.canvas.globalAlpha=A.fontOpacity||1;var D=[A.fontStyle?A.fontStyle:"normal","normal",A.fontWeight?A.fontWeight:"normal",A.fontSize?A.fontSize:"1em",A.fontFamily?A.fontFamily:"sans-serif"].join(" ");var C=A.label.split("\n");var F=C.length;if(this.canvas.fillText){this.canvas.font=D;this.canvas.textAlign=OpenLayers.Renderer.Canvas.LABEL_ALIGN[A.labelAlign[0]]||"center";this.canvas.textBaseline=OpenLayers.Renderer.Canvas.LABEL_ALIGN[A.labelAlign[1]]||"middle";var I=OpenLayers.Renderer.Canvas.LABEL_FACTOR[A.labelAlign[1]];if(I==null){I=-0.5}var J=this.canvas.measureText("Mg").height||this.canvas.measureText("xx").width;L[1]+=J*I*(F-1);for(var E=0;E<F;E++){if(A.labelOutlineWidth){this.canvas.save();this.canvas.strokeStyle=A.labelOutlineColor;this.canvas.lineWidth=A.labelOutlineWidth;this.canvas.strokeText(C[E],L[0],L[1]+(J*E)+1);this.canvas.restore()}this.canvas.fillText(C[E],L[0],L[1]+(J*E))}}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=D;var B=OpenLayers.Renderer.Canvas.LABEL_FACTOR[A.labelAlign[0]];if(B==null){B=-0.5}var I=OpenLayers.Renderer.Canvas.LABEL_FACTOR[A.labelAlign[1]];if(I==null){I=-0.5}var J=this.canvas.mozMeasureText("xx");L[1]+=J*(1+(I*F));for(var E=0;E<F;E++){var H=L[0]+(B*this.canvas.mozMeasureText(C[E]));var G=L[1]+(E*J);this.canvas.translate(H,G);this.canvas.mozDrawText(C[E]);this.canvas.translate(-H,-G)}}}this.setCanvasStyle("reset")},getLocalXY:function(B){var C=this.getResolution();var D=this.extent;var A=((B.x-this.featureDx)/C+(-D.left/C));var E=((D.top/C)-B.y/C);return[A,E]},clear:function(){var A=this.root.height;var B=this.root.width;this.canvas.clearRect(0,0,B,A);this.features={};if(this.hitDetection){this.hitContext.clearRect(0,0,B,A)}},getFeatureIdFromEvent:function(G){var C,I;if(this.hitDetection&&this.root.style.display!=="none"){if(!this.map.dragging){var H=G.xy;var F=H.x|0;var E=H.y|0;var D=this.hitContext.getImageData(F,E,1,1).data;if(D[3]===255){var A=D[2]+(256*(D[1]+(256*D[0])));if(A){C="OpenLayers.Feature.Vector_"+(A-1+this.hitOverflow);try{I=this.features[C][0]}catch(B){}}}}}return I},eraseFeatures:function(B){if(!(OpenLayers.Util.isArray(B))){B=[B]}for(var A=0;A<B.length;++A){delete this.features[B[A].id]}this.redraw()},redraw:function(){if(!this.locked){var I=this.root.height;var C=this.root.width;this.canvas.clearRect(0,0,C,I);if(this.hitDetection){this.hitContext.clearRect(0,0,C,I)}var F=[];var K,G,A;var H=(this.map.baseLayer&&this.map.baseLayer.wrapDateLine)&&this.map.getMaxExtent();for(var B in this.features){if(!this.features.hasOwnProperty(B)){continue}K=this.features[B][0];G=K.geometry;this.calculateFeatureDx(G.getBounds(),H);A=this.features[B][1];this.drawGeometry(G,A,K.id);if(A.label){F.push([K,A])}}var J;for(var D=0,E=F.length;D<E;++D){J=F[D];this.drawText(J[0].geometry.getCentroid(),J[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:false,interestingTagsExclude:null,areaTags:null,initialize:function(A){var D={interestingTagsExclude:["source","source_ref","source:ref","history","attribution","created_by"],areaTags:["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]};D=OpenLayers.Util.extend(D,A);var E={};for(var B=0;B<D.interestingTagsExclude.length;B++){E[D.interestingTagsExclude[B]]=true}D.interestingTagsExclude=E;var C={};for(var B=0;B<D.areaTags.length;B++){C[D.areaTags[B]]=true}D.areaTags=C;this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[D])},read:function(L){if(typeof L=="string"){L=OpenLayers.Format.XML.prototype.read.apply(this,[L])}var B=this.getNodes(L);var M=this.getWays(L);var G=new Array(M.length);for(var F=0;F<M.length;F++){var J=new Array(M[F].nodes.length);var A=this.isWayArea(M[F])?1:0;for(var E=0;E<M[F].nodes.length;E++){var C=B[M[F].nodes[E]];var K=new OpenLayers.Geometry.Point(C.lon,C.lat);K.osm_id=parseInt(M[F].nodes[E]);J[E]=K;C.used=true}var I=null;if(A){I=new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(J))}else{I=new OpenLayers.Geometry.LineString(J)}if(this.internalProjection&&this.externalProjection){I.transform(this.externalProjection,this.internalProjection)}var H=new OpenLayers.Feature.Vector(I,M[F].tags);H.osm_id=parseInt(M[F].id);H.fid="way."+H.osm_id;G[F]=H}for(var D in B){var C=B[D];if(!C.used||this.checkTags){var O=null;if(this.checkTags){var N=this.getTags(C.node,true);if(C.used&&!N[1]){continue}O=N[0]}else{O=this.getTags(C.node)}var H=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(C.lon,C.lat),O);if(this.internalProjection&&this.externalProjection){H.geometry.transform(this.externalProjection,this.internalProjection)}H.osm_id=parseInt(D);H.fid="node."+H.osm_id;G.push(H)}C.node=null}return G},getNodes:function(E){var D=E.getElementsByTagName("node");var A={};for(var B=0;B<D.length;B++){var C=D[B];var F=C.getAttribute("id");A[F]={lat:C.getAttribute("lat"),lon:C.getAttribute("lon"),node:C}}return A},getWays:function(G){var F=G.getElementsByTagName("way");var H=[];for(var D=0;D<F.length;D++){var B=F[D];var C={id:B.getAttribute("id")};C.tags=this.getTags(B);var E=B.getElementsByTagName("nd");C.nodes=new Array(E.length);for(var A=0;A<E.length;A++){C.nodes[A]=E[A].getAttribute("ref")}H.push(C)}return H},getTags:function(E,G){var A=E.getElementsByTagName("tag");var C={};var F=false;for(var B=0;B<A.length;B++){var D=A[B].getAttribute("k");C[D]=A[B].getAttribute("v");if(G){if(!this.interestingTagsExclude[D]){F=true}}}return G?[C,F]:C},isWayArea:function(B){var A=false;var D=false;if(B.nodes[0]==B.nodes[B.nodes.length-1]){A=true}if(this.checkTags){for(var C in B.tags){if(this.areaTags[C]){D=true;break}}}return A&&(this.checkTags?D:true)},write:function(D){if(!(OpenLayers.Util.isArray(D))){D=[D]}this.osm_id=1;this.created_nodes={};var E=this.createElementNS(null,"osm");E.setAttribute("version","0.5");E.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var C=D.length-1;C>=0;C--){var A=this.createFeatureNodes(D[C]);for(var B=0;B<A.length;B++){E.appendChild(A[B])}}return OpenLayers.Format.XML.prototype.write.apply(this,[E])},createFeatureNodes:function(C){var B=[];var E=C.geometry.CLASS_NAME;var D=E.substring(E.lastIndexOf(".")+1);D=D.toLowerCase();var A=this.createXML[D];if(A){B=A.apply(this,[C])}return B},createXML:{point:function(A){var E=null;var C=A.geometry?A.geometry:A;if(this.internalProjection&&this.externalProjection){C=C.clone();C.transform(this.internalProjection,this.externalProjection)}var D=false;if(A.osm_id){E=A.osm_id;if(this.created_nodes[E]){D=true}}else{E=-this.osm_id;this.osm_id++}if(D){B=this.created_nodes[E]}else{var B=this.createElementNS(null,"node")}this.created_nodes[E]=B;B.setAttribute("id",E);B.setAttribute("lon",C.x);B.setAttribute("lat",C.y);if(A.attributes){this.serializeTags(A,B)}this.setState(A,B);return D?[]:[B]},linestring:function(I){var B;var A=[];var F=I.geometry;if(I.osm_id){B=I.osm_id}else{B=-this.osm_id;this.osm_id++}var H=this.createElementNS(null,"way");H.setAttribute("id",B);for(var D=0;D<F.components.length;D++){var C=this.createXML.point.apply(this,[F.components[D]]);if(C.length){C=C[0];var G=C.getAttribute("id");A.push(C)}else{G=F.components[D].osm_id;C=this.created_nodes[G]}this.setState(I,C);var E=this.createElementNS(null,"nd");E.setAttribute("ref",G);H.appendChild(E)}this.serializeTags(I,H);A.push(H);return A},polygon:function(B){var A=OpenLayers.Util.extend({area:"yes"},B.attributes);var C=new OpenLayers.Feature.Vector(B.geometry.components[0],A);C.osm_id=B.osm_id;return this.createXML.linestring.apply(this,[C])}},serializeTags:function(C,D){for(var B in C.attributes){var A=this.createElementNS(null,"tag");A.setAttribute("k",B);A.setAttribute("v",C.attributes[B]);D.appendChild(A)}},setState:function(A,B){if(A.state){var C=null;switch(A.state){case OpenLayers.State.UPDATE:C="modify";case OpenLayers.State.DELETE:C="delete"}if(C){B.setAttribute("action",C)}}},CLASS_NAME:"OpenLayers.Format.OSM"});OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(D,B,A){OpenLayers.Util.extend(this,A);this.control=D;this.callbacks=B;var C=this.map||D.map;if(C){this.setMap(C)}this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(A){this.map=A},checkModifiers:function(A){if(this.keyMask==null){return true}var B=(A.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(A.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(A.altKey?OpenLayers.Handler.MOD_ALT:0);return(B==this.keyMask)},activate:function(){if(this.active){return false}var C=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var B=0,A=C.length;B<A;B++){if(this[C[B]]){this.register(C[B],this[C[B]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var C=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var B=0,A=C.length;B<A;B++){if(this[C[B]]){this.unregister(C[B],this[C[B]])}}this.active=false;return true},callback:function(B,A){if(B&&this.callbacks[B]){this.callbacks[B].apply(this.control,A)}},register:function(A,B){this.map.events.registerPriority(A,this,B);this.map.events.registerPriority(A,this,this.setEvent)},unregister:function(A,B){this.map.events.unregister(A,this,B);this.map.events.unregister(A,this,this.setEvent)},setEvent:function(A){this.evt=A;return true},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,touch:false,last:null,start:null,lastMoveEvt:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:false,documentEvents:null,initialize:function(D,C,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.documentDrag===true){var B=this;this._docMove=function(E){B.mousemove({xy:{x:E.clientX,y:E.clientY},element:document})};this._docUp=function(E){B.mouseup({xy:{x:E.clientX,y:E.clientY}})}}},dragstart:function(B){var A=true;this.dragging=false;if(this.checkModifiers(B)&&(OpenLayers.Event.isLeftClick(B)||OpenLayers.Event.isSingleTouch(B))){this.started=true;this.start=B.xy;this.last=B.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(B);this.callback("down",[B.xy]);OpenLayers.Event.stop(B);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart?document.onselectstart:OpenLayers.Function.True}document.onselectstart=OpenLayers.Function.False;A=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return A},dragmove:function(A){this.lastMoveEvt=A;if(this.started&&!this.timeoutId&&(A.xy.x!=this.last.x||A.xy.y!=this.last.y)){if(this.documentDrag===true&&this.documentEvents){if(A.element===document){this.adjustXY(A);this.setEvent(A)}else{this.removeDocumentEvents()}}if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(A);this.callback("move",[A.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=OpenLayers.Function.False}this.last=A.xy}return true},dragend:function(B){if(this.started){if(this.documentDrag===true&&this.documentEvents){this.adjustXY(B);this.removeDocumentEvents()}var A=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(B);this.callback("up",[B.xy]);if(A){this.callback("done",[B.xy])}document.onselectstart=this.oldOnselectstart}return true},down:function(A){},move:function(A){},up:function(A){},out:function(A){},mousedown:function(A){return this.dragstart(A)},touchstart:function(A){if(!this.touch){this.touch=true;this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,scope:this})}return this.dragstart(A)},mousemove:function(A){return this.dragmove(A)},touchmove:function(A){return this.dragmove(A)},removeTimeout:function(){this.timeoutId=null;if(this.dragging){this.mousemove(this.lastMoveEvt)}},mouseup:function(A){return this.dragend(A)},touchend:function(A){A.xy=this.last;return this.dragend(A)},mouseout:function(B){if(this.started&&OpenLayers.Util.mouseLeft(B,this.map.viewPortDiv)){if(this.documentDrag===true){this.addDocumentEvents()}else{var A=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(B);this.callback("out",[]);if(A){this.callback("done",[B.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}}return true},click:function(A){return(this.start==this.last)},activate:function(){var A=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;A=true}return A},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.touch=false;this.started=false;this.dragging=false;this.start=null;this.last=null;A=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return A},adjustXY:function(A){var B=OpenLayers.Util.pagePosition(this.map.viewPortDiv);A.xy.x-=B[0];A.xy.y-=B[1]},addDocumentEvents:function(){OpenLayers.Element.addClass(document.body,"olDragDown");this.documentEvents=true;OpenLayers.Event.observe(document,"mousemove",this._docMove);OpenLayers.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown");this.documentEvents=false;OpenLayers.Event.stopObserving(document,"mousemove",this._docMove);OpenLayers.Event.stopObserving(document,"mouseup",this._docUp)},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null},touchstart:{"in":"click",out:"clickout"}},feature:null,lastFeature:null,down:null,up:null,touch:false,clickTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:false,initialize:function(D,B,C,A){OpenLayers.Handler.prototype.initialize.apply(this,[D,C,A]);this.layer=B},touchstart:function(A){if(!this.touch){this.touch=true;this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,dblclick:this.dblclick,scope:this})}return OpenLayers.Event.isMultiTouch(A)?true:this.mousedown(A)},touchmove:function(A){OpenLayers.Event.stop(A)},mousedown:function(A){if(OpenLayers.Event.isLeftClick(A)||OpenLayers.Event.isSingleTouch(A)){this.down=A.xy}return this.handle(A)?!this.stopDown:true},mouseup:function(A){this.up=A.xy;return this.handle(A)?!this.stopUp:true},click:function(A){return this.handle(A)?!this.stopClick:true},mousemove:function(A){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(A);return true},dblclick:function(A){return !this.handle(A)},geometryTypeMatches:function(A){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,A.geometry.CLASS_NAME)>-1},handle:function(A){if(this.feature&&!this.feature.layer){this.feature=null}var C=A.type;var F=false;var E=!!(this.feature);var D=(C=="click"||C=="dblclick"||C=="touchstart");this.feature=this.layer.getFeatureFromEvent(A);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){if(C==="touchstart"){OpenLayers.Event.stop(A)}var B=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(E&&B){if(this.lastFeature){this.triggerCallback(C,"out",[this.lastFeature])}this.triggerCallback(C,"in",[this.feature])}else{if(!E||D){this.triggerCallback(C,"in",[this.feature])}}this.lastFeature=this.feature;F=true}else{if(this.lastFeature&&(E&&B||D)){this.triggerCallback(C,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(E||D)){this.triggerCallback(C,"out",[this.lastFeature])}}return F},triggerCallback:function(D,E,B){var C=this.EVENTMAP[D][E];if(C){if(D=="click"&&this.up&&this.down){var A=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(A<=this.clickTolerance){this.callback(C,B)}}else{this.callback(C,B)}}},activate:function(){var A=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});A=true}return A},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();this.feature=null;this.lastFeature=null;this.down=null;this.up=null;this.touch=false;this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});A=true}return A},handleMapEvents:function(A){if(A.type=="removelayer"||A.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var A=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(A)},moveLayerBack:function(){var A=this.layer.getZIndex()-1;if(A>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(A)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(B,A){},onDrag:function(B,A){},onComplete:function(B,A){},onEnter:function(A){},onLeave:function(A){},documentDrag:false,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.layer=B;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{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(A){if(this.handlers.feature.touch&&!this.over&&this.overFeature(A)){this.handlers.drag.dragstart(this.handlers.feature.evt);this.handlers.drag.stopDown=false}},clickoutFeature:function(A){if(this.handlers.feature.touch&&this.over){this.outFeature(A);this.handlers.drag.stopDown=true}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(B){var A=false;if(!this.handlers.drag.dragging){this.feature=B;this.handlers.drag.activate();A=true;this.over=true;OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over");this.onEnter(B)}else{if(this.feature.id==B.id){this.over=true}else{this.over=false}}return A},downFeature:function(A){this.lastPixel=A;this.onStart(this.feature,A)},moveFeature:function(A){var B=this.map.getResolution();this.feature.geometry.move(B*(A.x-this.lastPixel.x),B*(this.lastPixel.y-A.y));this.layer.drawFeature(this.feature);this.lastPixel=A;this.onDrag(this.feature,A)},upFeature:function(A){if(!this.over){this.handlers.drag.deactivate()}},doneDragging:function(A){this.onComplete(this.feature,A)},outFeature:function(A){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");this.onLeave(A);this.feature=null}else{if(this.feature.id==A.id){this.over=false}}},cancel:function(){this.handlers.drag.deactivate();this.over=false},setMap:function(A){this.handlers.drag.setMap(A);this.handlers.feature.setMap(A);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(C,A){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(C instanceof OpenLayers.Style){this.styles["default"]=C;this.styles.select=C;this.styles.temporary=C;this.styles["delete"]=C}else{if(typeof C=="object"){for(var B in C){if(C[B] instanceof OpenLayers.Style){this.styles[B]=C[B]}else{if(typeof C[B]=="object"){this.styles[B]=new OpenLayers.Style(C[B])}else{this.styles["default"]=new OpenLayers.Style(C);this.styles.select=new OpenLayers.Style(C);this.styles.temporary=new OpenLayers.Style(C);this.styles["delete"]=new OpenLayers.Style(C);break}}}}}OpenLayers.Util.extend(this,A)},destroy:function(){for(var A in this.styles){this.styles[A].destroy()}this.styles=null},createSymbolizer:function(B,C){if(!B){B=new OpenLayers.Feature.Vector()}if(!this.styles[C]){C="default"}B.renderIntent=C;var A={};if(this.extendDefault&&C!="default"){A=this.styles["default"].createSymbolizer(B)}return OpenLayers.Util.extend(A,this.styles[C].createSymbolizer(B))},addUniqueValueRules:function(B,D,F,A){var E=[];for(var C in F){E.push(new OpenLayers.Rule({symbolizer:F[C],context:A,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:D,value:C})}))}this.styles[B].addRules(E)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,isFixed:false,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,ratio:1,initialize:function(C,B){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var D=0,A=this.strategies.length;D<A;D++){this.strategies[D].setLayer(this)}}},destroy:function(){if(this.strategies){var C,B,A;for(B=0,A=this.strategies.length;B<A;B++){C=this.strategies[B];if(C.autoDestroy){C.destroy()}}this.strategies=null}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()}this.protocol=null}this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;if(this.renderer){this.renderer.destroy()}this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(E){if(E==null){E=new OpenLayers.Layer.Vector(this.name,this.getOptions())}E=OpenLayers.Layer.prototype.clone.apply(this,[E]);var C=this.features;var A=C.length;var D=new Array(A);for(var B=0;B<A;++B){D[B]=C[B].clone()}E.features=D;return E},refresh:function(A){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",A)}},assignRenderer:function(){for(var C=0,A=this.renderers.length;C<A;C++){var B=this.renderers[C];var D=(typeof B=="function")?B:OpenLayers.Renderer[B];if(D&&D.prototype.supported()){this.renderer=new D(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(B){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.renderer){this.map.removeLayer(this)}else{this.renderer.map=this.map;var A=this.map.getSize();A.w=A.w*this.ratio;A.h=A.h*this.ratio;this.renderer.setSize(A)}},afterAdd:function(){if(this.strategies){var C,B,A;for(B=0,A=this.strategies.length;B<A;B++){C=this.strategies[B];if(C.autoActivate){C.activate()}}}},removeMap:function(C){this.drawn=false;if(this.strategies){var D,B,A;for(B=0,A=this.strategies.length;B<A;B++){D=this.strategies[B];if(D.autoActivate){D.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);var A=this.map.getSize();A.w=A.w*this.ratio;A.h=A.h*this.ratio;this.renderer.setSize(A)},moveTo:function(A,B,K){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var C=true;if(!K){this.renderer.root.style.visibility="hidden";var J=this.map.getSize(),H=J.w,F=J.h,E=(H/2*this.ratio)-H/2,D=(F/2*this.ratio)-F/2;E+=parseInt(this.map.layerContainerDiv.style.left,10);E=-Math.round(E);D+=parseInt(this.map.layerContainerDiv.style.top,10);D=-Math.round(D);this.div.style.left=E+"px";this.div.style.top=D+"px";var L=this.map.getExtent().scale(this.ratio);C=this.renderer.setExtent(L,B);this.renderer.root.style.visibility="visible";if(OpenLayers.IS_GECKO===true){this.div.scrollLeft=this.div.scrollLeft}if(!B&&C){for(var G in this.unrenderedFeatures){var M=this.unrenderedFeatures[G];this.drawFeature(M)}}}if(!this.drawn||B||!C){this.drawn=true;var M;for(var G=0,I=this.features.length;G<I;G++){this.renderer.locked=(G!==(I-1));M=this.features[G];this.drawFeature(M)}}},display:function(A){OpenLayers.Layer.prototype.display.apply(this,arguments);var B=this.div.style.display;if(B!=this.renderer.root.style.display){this.renderer.root.style.display=B}},addFeatures:function(B,I){if(!(OpenLayers.Util.isArray(B))){B=[B]}var G=!I||!I.silent;if(G){var A={features:B};var F=this.events.triggerEvent("beforefeaturesadded",A);if(F===false){return }B=A.features}var D=[];for(var C=0,E=B.length;C<E;C++){if(C!=(B.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var H=B[C];if(this.geometryType&&!(H.geometry instanceof this.geometryType)){throw new TypeError("addFeatures: component should be an "+this.geometryType.prototype.CLASS_NAME)}H.layer=this;if(!H.style&&this.style){H.style=OpenLayers.Util.extend({},this.style)}if(G){if(this.events.triggerEvent("beforefeatureadded",{feature:H})===false){continue}this.preFeatureInsert(H)}D.push(H);this.features.push(H);this.drawFeature(H);if(G){this.events.triggerEvent("featureadded",{feature:H});this.onFeatureInsert(H)}}if(G){this.events.triggerEvent("featuresadded",{features:D})}},removeFeatures:function(E,A){if(!E||E.length===0){return }if(E===this.features){return this.removeAllFeatures(A)}if(!(OpenLayers.Util.isArray(E))){E=[E]}if(E===this.selectedFeatures){E=E.slice()}var D=!A||!A.silent;if(D){this.events.triggerEvent("beforefeaturesremoved",{features:E})}for(var C=E.length-1;C>=0;C--){if(C!=0&&E[C-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var B=E[C];delete this.unrenderedFeatures[B.id];if(D){this.events.triggerEvent("beforefeatureremoved",{feature:B})}this.features=OpenLayers.Util.removeItem(this.features,B);B.layer=null;if(B.geometry){this.renderer.eraseFeatures(B)}if(OpenLayers.Util.indexOf(this.selectedFeatures,B)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,B)}if(D){this.events.triggerEvent("featureremoved",{feature:B})}}if(D){this.events.triggerEvent("featuresremoved",{features:E})}},removeAllFeatures:function(A){var D=!A||!A.silent;var E=this.features;if(D){this.events.triggerEvent("beforefeaturesremoved",{features:E})}var C;for(var B=E.length-1;B>=0;B--){C=E[B];if(D){this.events.triggerEvent("beforefeatureremoved",{feature:C})}C.layer=null;if(D){this.events.triggerEvent("featureremoved",{feature:C})}}this.renderer.clear();this.features=[];this.unrenderedFeatures={};this.selectedFeatures=[];if(D){this.events.triggerEvent("featuresremoved",{features:E})}},destroyFeatures:function(D,A){var C=(D==undefined);if(C){D=this.features}if(D){this.removeFeatures(D,A);for(var B=D.length-1;B>=0;B--){D[B].destroy()}}},drawFeature:function(A,B){if(!this.drawn){return }if(typeof B!="object"){if(!B&&A.state===OpenLayers.State.DELETE){B="delete"}var C=B||A.renderIntent;B=A.style||this.style;if(!B){B=this.styleMap.createSymbolizer(A,C)}}var D=this.renderer.drawFeature(A,B);if(D===false||D===null){this.unrenderedFeatures[A.id]=A}else{delete this.unrenderedFeatures[A.id]}},eraseFeatures:function(A){this.renderer.eraseFeatures(A)},getFeatureFromEvent:function(A){if(!this.renderer){throw new 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 B=null;var C=this.renderer.getFeatureIdFromEvent(A);if(C){if(typeof C==="string"){B=this.getFeatureById(C)}else{B=C}}return B},getFeatureBy:function(E,D){var C=null;for(var B=0,A=this.features.length;B<A;++B){if(this.features[B][E]==D){C=this.features[B];break}}return C},getFeatureById:function(A){return this.getFeatureBy("id",A)},getFeatureByFid:function(A){return this.getFeatureBy("fid",A)},getFeaturesByAttribute:function(D,E){var C,B,A=this.features.length,F=[];for(C=0;C<A;C++){B=this.features[C];if(B&&B.attributes){if(B.attributes[D]===E){F.push(B)}}}return F},onFeatureInsert:function(A){},preFeatureInsert:function(A){},getDataExtent:function(){var B=null;var D=this.features;if(D&&(D.length>0)){var E=null;for(var C=0,A=D.length;C<A;C++){E=D[C].geometry;if(E){if(B===null){B=new OpenLayers.Bounds()}B.extend(E.getBounds())}}}return B},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:false,layers:null,display:function(){},getFeatureFromEvent:function(A){var D=this.layers;var C;for(var B=0;B<D.length;B++){C=D[B].getFeatureFromEvent(A);if(C){return C}}},setMap:function(A){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();A.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(A){A.events.unregister("changelayer",this,this.handleChangeLayer);this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){var B;for(var A=0;A<this.map.layers.length;++A){B=this.map.layers[A];if(OpenLayers.Util.indexOf(this.layers,B)!=-1){B.renderer.moveRoot(this.renderer)}}},resetRoots:function(){var B;for(var A=0;A<this.layers.length;++A){B=this.layers[A];if(this.renderer&&B.renderer.getRenderLayerId()==this.id){this.renderer.moveRoot(B.renderer)}}},handleChangeLayer:function(A){var B=A.layer;if(A.property=="order"&&OpenLayers.Util.indexOf(this.layers,B)!=-1){this.resetRoots();this.collectRoots()}},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,highlightOnly:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(C,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);if(this.scope===null){this.scope=this}this.initLayer(C);var B={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){B.over=this.overFeature;B.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(B,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},initLayer:function(A){if(OpenLayers.Util.isArray(A)){this.layers=A;this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:A})}else{this.layer=A}},destroy:function(){if(this.active&&this.layers){this.map.removeLayer(this.layer)}OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.layers){this.layer.destroy()}},activate:function(){if(!this.active){if(this.layers){this.map.addLayer(this.layer)}this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}if(this.layers){this.map.removeLayer(this.layer)}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(B){var F=this.layers||[this.layer];var E,D;for(var A=0;A<F.length;++A){E=F[A];for(var C=E.selectedFeatures.length-1;C>=0;--C){D=E.selectedFeatures[C];if(!B||B.except!=D){this.unselect(D)}}}},clickFeature:function(A){if(!this.hover){var B=(OpenLayers.Util.indexOf(A.layer.selectedFeatures,A)>-1);if(B){if(this.toggleSelect()){this.unselect(A)}else{if(!this.multipleSelect()){this.unselectAll({except:A})}}}else{if(!this.multipleSelect()){this.unselectAll({except:A})}this.select(A)}}},multipleSelect:function(){return this.multiple||(this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey])},toggleSelect:function(){return this.toggle||(this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey])},clickoutFeature:function(A){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(B){var A=B.layer;if(this.hover){if(this.highlightOnly){this.highlight(B)}else{if(OpenLayers.Util.indexOf(A.selectedFeatures,B)==-1){this.select(B)}}}},outFeature:function(A){if(this.hover){if(this.highlightOnly){if(A._lastHighlighter==this.id){if(A._prevHighlighter&&A._prevHighlighter!=this.id){delete A._lastHighlighter;var B=this.map.getControl(A._prevHighlighter);if(B){B.highlight(A)}}else{this.unhighlight(A)}}}else{this.unselect(A)}}},highlight:function(C){var B=C.layer;var A=this.events.triggerEvent("beforefeaturehighlighted",{feature:C});if(A!==false){C._prevHighlighter=C._lastHighlighter;C._lastHighlighter=this.id;var D=this.selectStyle||this.renderIntent;B.drawFeature(C,D);this.events.triggerEvent("featurehighlighted",{feature:C})}},unhighlight:function(B){var A=B.layer;if(B._prevHighlighter==undefined){delete B._lastHighlighter}else{if(B._prevHighlighter==this.id){delete B._prevHighlighter}else{B._lastHighlighter=B._prevHighlighter;delete B._prevHighlighter}}A.drawFeature(B,B.style||B.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:B})},select:function(C){var A=this.onBeforeSelect.call(this.scope,C);var B=C.layer;if(A!==false){A=B.events.triggerEvent("beforefeatureselected",{feature:C});if(A!==false){B.selectedFeatures.push(C);this.highlight(C);if(!this.handlers.feature.lastFeature){this.handlers.feature.lastFeature=B.selectedFeatures[0]}B.events.triggerEvent("featureselected",{feature:C});this.onSelect.call(this.scope,C)}}},unselect:function(B){var A=B.layer;this.unhighlight(B);OpenLayers.Util.removeItem(A.selectedFeatures,B);A.events.triggerEvent("featureunselected",{feature:B});this.onUnselect.call(this.scope,B)},selectBox:function(E){if(E instanceof OpenLayers.Bounds){var H=this.map.getLonLatFromPixel({x:E.left,y:E.bottom});var J=this.map.getLonLatFromPixel({x:E.right,y:E.top});var A=new OpenLayers.Bounds(H.lon,H.lat,J.lon,J.lat);if(!this.multipleSelect()){this.unselectAll()}var I=this.multiple;this.multiple=true;var D=this.layers||[this.layer];this.events.triggerEvent("boxselectionstart",{layers:D});var F;for(var B=0;B<D.length;++B){F=D[B];for(var C=0,G=F.features.length;C<G;++C){var K=F.features[C];if(!K.getVisibility()){continue}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,K.geometry.CLASS_NAME)>-1){if(A.toGeometry().intersects(K.geometry)){if(OpenLayers.Util.indexOf(F.selectedFeatures,K)==-1){this.select(K)}}}}}this.multiple=I;this.events.triggerEvent("boxselectionend",{layers:D})}},setMap:function(A){this.handlers.feature.setMap(A);if(this.box){this.handlers.box.setMap(A)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},setLayer:function(B){var A=this.active;this.unselectAll();this.deactivate();if(this.layers){this.layer.destroy();this.layers=null}this.initLayer(B);this.handlers.feature.layer=this.layer;if(A){this.activate()}},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,observeElement:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.observeElement=this.observeElement||document;for(var B=0,A=this.KEY_EVENTS.length;B<A;B++){OpenLayers.Event.observe(this.observeElement,this.KEY_EVENTS[B],this.eventListener)}return true}else{return false}},deactivate:function(){var C=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var B=0,A=this.KEY_EVENTS.length;B<A;B++){OpenLayers.Event.stopObserving(this.observeElement,this.KEY_EVENTS[B],this.eventListener)}C=true}return C},handleKeyEvent:function(A){if(this.checkModifiers(A)){this.callback(A.type,[A])}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,standalone:false,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,vertexRenderIntent:null,mode:null,createVertices:true,modified:false,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(D,C){C=C||{};this.layer=D;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer(null,C.vertexRenderIntent));this.virtualStyle.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[C]);if(!(OpenLayers.Util.isArray(this.deleteCodes))){this.deleteCodes=[this.deleteCodes]}var F=this;var A={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};if(this.standalone===false){this.selectControl=new OpenLayers.Control.SelectFeature(D,A)}var B={geometryTypes:["OpenLayers.Geometry.Point"],onStart:function(H,G){F.dragStart.apply(F,[H,G])},onDrag:function(H,G){F.dragVertex.apply(F,[H,G])},onComplete:function(G){F.dragComplete.apply(F,[G])},featureCallbacks:{over:function(G){if(F.standalone!==true||G._sketch||F.feature===G){F.dragControl.overFeature.apply(F.dragControl,[G])}}}};this.dragControl=new OpenLayers.Control.DragFeature(D,B);var E={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,E)}},destroy:function(){this.layer=null;this.standalone||this.selectControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return((this.standalone||this.selectControl.activate())&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){var C=false;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.vertices,{silent:true});this.layer.removeFeatures(this.virtualVertices,{silent:true});this.vertices=[];this.dragControl.deactivate();var A=this.feature;var B=A&&A.geometry&&A.layer;if(this.standalone===false){if(B){this.selectControl.unselect.apply(this.selectControl,[A])}this.selectControl.deactivate()}else{if(B){this.unselectFeature(A)}}this.handlers.keyboard.deactivate();C=true}return C},beforeSelectFeature:function(A){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:A})},selectFeature:function(B){if(!this.standalone||this.beforeSelectFeature(B)!==false){this.feature=B;this.modified=false;this.resetVertices();this.dragControl.activate();this.onModificationStart(this.feature)}var A=B.modified;if(B.geometry&&!(A&&A.geometry)){this._originalGeometry=B.geometry.clone()}},unselectFeature:function(A){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[];if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});delete this.dragHandle}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});delete this.radiusHandle}this.feature=null;this.dragControl.deactivate();this.onModificationEnd(A);this.layer.events.triggerEvent("afterfeaturemodified",{feature:A,modified:this.modified});this.modified=false},dragStart:function(B,A){if(B!=this.feature&&!B.geometry.parent&&B!=this.dragHandle&&B!=this.radiusHandle){if(this.standalone===false&&this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature])}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,B.geometry.CLASS_NAME)!=-1){this.standalone||this.selectControl.clickFeature.apply(this.selectControl,[B]);this.dragControl.overFeature.apply(this.dragControl,[B]);this.dragControl.lastPixel=A;this.dragControl.handlers.drag.started=true;this.dragControl.handlers.drag.start=A;this.dragControl.handlers.drag.last=A}}},dragVertex:function(B,A){this.modified=true;if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=B){this.feature=B}this.layer.events.triggerEvent("vertexmodified",{vertex:B.geometry,feature:this.feature,pixel:A})}else{if(B._index){B.geometry.parent.addComponent(B.geometry,B._index);delete B._index;OpenLayers.Util.removeItem(this.virtualVertices,B);this.vertices.push(B)}else{if(B==this.dragHandle){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}}else{if(B!==this.radiusHandle){this.layer.events.triggerEvent("vertexmodified",{vertex:B.geometry,feature:this.feature,pixel:A})}}}if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}this.layer.drawFeature(this.feature,this.standalone?undefined:this.selectControl.renderIntent)}this.layer.drawFeature(B)},dragComplete:function(A){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE){this.feature.state=OpenLayers.State.UPDATE;if(this.modified&&this._originalGeometry){var A=this.feature;A.modified=OpenLayers.Util.extend(A.modified,{geometry:this._originalGeometry});delete this._originalGeometry}}},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature)}if(this.vertices.length>0){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[]}if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});this.dragHandle=null}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle()}if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle()}if(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE){if(!(this.mode&OpenLayers.Control.ModifyFeature.RESIZE)){this.collectVertices()}}}},handleKeypress:function(A){var B=A.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,B)!=-1){var C=this.dragControl.feature;if(C&&OpenLayers.Util.indexOf(this.vertices,C)!=-1&&!this.dragControl.handlers.drag.dragging&&C.geometry.parent){C.geometry.parent.removeComponent(C.geometry);this.layer.events.triggerEvent("vertexremoved",{vertex:C.geometry,feature:this.feature,pixel:A.xy});this.layer.drawFeature(this.feature,this.standalone?undefined:this.selectControl.renderIntent);this.modified=true;this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})}}},collectVertices:function(){this.vertices=[];this.virtualVertices=[];var A=this;function B(H){var D,E,I,F;if(H.CLASS_NAME=="OpenLayers.Geometry.Point"){E=new OpenLayers.Feature.Vector(H);E._sketch=true;E.renderIntent=A.vertexRenderIntent;A.vertices.push(E)}else{var C=H.components.length;if(H.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){C-=1}for(D=0;D<C;++D){I=H.components[D];if(I.CLASS_NAME=="OpenLayers.Geometry.Point"){E=new OpenLayers.Feature.Vector(I);E._sketch=true;E.renderIntent=A.vertexRenderIntent;A.vertices.push(E)}else{B(I)}}if(A.createVertices&&H.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(D=0,F=H.components.length;D<F-1;++D){var L=H.components[D];var M=H.components[D+1];if(L.CLASS_NAME=="OpenLayers.Geometry.Point"&&M.CLASS_NAME=="OpenLayers.Geometry.Point"){var J=(L.x+M.x)/2;var G=(L.y+M.y)/2;var K=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(J,G),null,A.virtualStyle);K.geometry.parent=H;K._index=D+1;K._sketch=true;A.virtualVertices.push(K)}}}}}B.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var D=this.feature.geometry;var A=D.getBounds().getCenterLonLat();var C=new OpenLayers.Geometry.Point(A.lon,A.lat);var B=new OpenLayers.Feature.Vector(C);C.move=function(E,F){OpenLayers.Geometry.Point.prototype.move.call(this,E,F);D.move(E,F)};B._sketch=true;this.dragHandle=B;this.dragHandle.renderIntent=this.vertexRenderIntent;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var H=this.feature.geometry;var A=H.getBounds();var B=A.getCenterLonLat();var I=new OpenLayers.Geometry.Point(B.lon,B.lat);var G=new OpenLayers.Geometry.Point(A.right,A.bottom);var F=new OpenLayers.Feature.Vector(G);var C=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var E=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var D=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);G.move=function(T,S){OpenLayers.Geometry.Point.prototype.move.call(this,T,S);var U=this.x-I.x;var P=this.y-I.y;var V=U-T;var Q=P-S;if(D){var K=Math.atan2(Q,V);var J=Math.atan2(P,U);var N=J-K;N*=180/Math.PI;H.rotate(N,I)}if(C){var M,R;if(E){M=P/Q;R=(U/V)/M}else{var O=Math.sqrt((V*V)+(Q*Q));var L=Math.sqrt((U*U)+(P*P));M=L/O}H.resize(M,I,R)}};F._sketch=true;this.radiusHandle=F;this.radiusHandle.renderIntent=this.vertexRenderIntent;this.layer.addFeatures([this.radiusHandle],{silent:true})},setMap:function(A){this.standalone||this.selectControl.setMap(A);this.dragControl.setMap(A);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,sphericalMercator:false,zoomOffset:0,serverResolutions:null,initialize:function(C,B,A){if(A&&A.sphericalMercator||this.sphericalMercator){A=OpenLayers.Util.extend({projection:"EPSG:900913",numZoomLevels:19},A)}OpenLayers.Layer.Grid.prototype.initialize.apply(this,[C||this.name,B||this.url,{},A])},clone:function(A){if(A==null){A=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(D){var A=this.getXYZ(D);var B=this.url;if(OpenLayers.Util.isArray(B)){var C=""+A.x+A.y+A.z;B=this.selectUrl(C,B)}return OpenLayers.String.format(B,A)},getXYZ:function(D){var C=this.getServerResolution();var A=Math.round((D.left-this.maxExtent.left)/(C*this.tileSize.w));var F=Math.round((this.maxExtent.top-D.top)/(C*this.tileSize.h));var E=this.getServerZoom();if(this.wrapDateLine){var B=Math.pow(2,E);A=((A%B)+B)%B}return{x:A,y:F,z:E}},setMap:function(A){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.Bing=OpenLayers.Class(OpenLayers.Layer.XYZ,{key:null,serverResolutions:[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,0.5971642833948135,0.29858214169740677,0.14929107084870338,0.07464553542435169],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,type:"Road",culture:"en-US",metadataParams:null,tileOptions:null,initialize:function(C){C=OpenLayers.Util.applyDefaults({sphericalMercator:true},C);var B=C.name||"Bing "+(C.type||this.type);var A=[B,null,C];OpenLayers.Layer.XYZ.prototype.initialize.apply(this,A);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 C=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams);var B="http://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(C);var A=document.createElement("script");A.type="text/javascript";A.src=B;A.id=this._callbackId;document.getElementsByTagName("head")[0].appendChild(A)},initLayer:function(){var C=this.metadata.resourceSets[0].resources[0];var A=C.imageUrl.replace("{quadkey}","${quadkey}");A=A.replace("{culture}",this.culture);this.url=[];for(var B=0;B<C.imageUrlSubdomains.length;++B){this.url.push(A.replace("{subdomain}",C.imageUrlSubdomains[B]))}this.addOptions({maxResolution:Math.min(this.serverResolutions[C.zoomMin],this.maxResolution||Number.POSITIVE_INFINITY),numZoomLevels:Math.min(C.zoomMax+1-C.zoomMin,this.numZoomLevels)},true)},getURL:function(A){if(!this.url){return }var G=this.getXYZ(A),J=G.x,H=G.y,F=G.z;var C=[];for(var D=F;D>0;--D){var I="0";var K=1<<(D-1);if((J&K)!=0){I++}if((H&K)!=0){I++;I++}C.push(I)}var E=C.join("");var B=this.selectUrl(""+J+H+F,this.url);return OpenLayers.String.format(B,{quadkey:E})},updateAttribution:function(){var G=this.metadata;if(!G.resourceSets||!this.map||!this.map.center){return }var F=G.resourceSets[0].resources[0];var M=this.map.getExtent().transform(this.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var C=F.imageryProviders,L=OpenLayers.Util.indexOf(this.serverResolutions,this.getServerResolution()),A="",H,D,K,B,E,J,I;for(D=0,K=C.length;D<K;++D){H=C[D];for(B=0,E=H.coverageAreas.length;B<E;++B){I=H.coverageAreas[B];J=OpenLayers.Bounds.fromArray(I.bbox,true);if(M.intersectsBounds(J)&&L<=I.zoomMax&&L>=I.zoomMin){A+=H.attribution+" "}}}this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(),logo:G.brandLogoUri,copyrights:A});this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"attribution"})},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments);this.updateAttribution();this.map.events.register("moveend",this,this.updateAttribution)},clone:function(A){if(A==null){A=new OpenLayers.Layer.Bing(this.options)}A=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[A]);return A},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(B){this.metadata=B;this.initLayer();var A=document.getElementById(this._callbackId);A.parentNode.removeChild(A);window[this._callbackId]=undefined;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(F){if(typeof F=="string"){F=OpenLayers.Format.XML.prototype.read.apply(this,[F])}if(F&&F.nodeType==9){F=F.documentElement}var G={features:[]};this.readNode(F,G);var E=[];for(var D=0,A=G.features.length;D<A;D++){var B=G.features[D];if(this.internalProjection&&this.externalProjection&&B.components[0]){B.components[0].transform(this.externalProjection,this.internalProjection)}var C=new OpenLayers.Feature.Vector(B.components[0],B.attributes);E.push(C)}return E},readers:{sa:{SamplingPoint:function(B,C){if(!C.attributes){var A={attributes:{}};C.features.push(A);C=A}C.attributes.id=this.getAttributeNS(B,this.namespaces.gml,"id");this.readChildNodes(B,C)},position:function(A,B){this.readChildNodes(A,B)}},gml:OpenLayers.Util.applyDefaults({FeatureCollection:function(A,B){this.readChildNodes(A,B)},featureMember:function(B,C){var A={attributes:{}};C.features.push(A);this.readChildNodes(B,A)},name:function(A,B){B.attributes.name=this.getChildValue(A)},pos:function(A,B){if(!this.externalProjection){this.externalProjection=new OpenLayers.Projection(A.getAttribute("srsName"))}OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[A,B])}},OpenLayers.Format.GML.v3.prototype.readers.gml)},writers:{sos:{GetFeatureOfInterest:function(B){var D=this.createElementNSPlus("GetFeatureOfInterest",{attributes:{version:this.VERSION,service:"SOS","xsi:schemaLocation":this.schemaLocation}});for(var C=0,A=B.fois.length;C<A;C++){this.writeNode("FeatureOfInterestId",{foi:B.fois[C]},D)}return D},FeatureOfInterestId:function(A){var B=this.createElementNSPlus("FeatureOfInterestId",{value:A.foi});return B}}},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(A){if(typeof A=="string"){A=OpenLayers.Format.XML.prototype.read.apply(this,[A])}if(A&&A.nodeType==9){A=A.documentElement}var B={measurements:[],observations:[]};this.readNode(A,B);return B},write:function(A){var B=this.writeNode("sos:GetObservation",A);B.setAttribute("xmlns:om",this.namespaces.om);B.setAttribute("xmlns:ogc",this.namespaces.ogc);this.setAttributeNS(B,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},readers:{om:{ObservationCollection:function(A,B){B.id=this.getAttributeNS(A,this.namespaces.gml,"id");this.readChildNodes(A,B)},member:function(A,B){this.readChildNodes(A,B)},Measurement:function(B,C){var A={};C.measurements.push(A);this.readChildNodes(B,A)},Observation:function(B,C){var A={};C.observations.push(A);this.readChildNodes(B,A)},samplingTime:function(B,A){var C={};A.samplingTime=C;this.readChildNodes(B,C)},observedProperty:function(B,A){A.observedProperty=this.getAttributeNS(B,this.namespaces.xlink,"href");this.readChildNodes(B,A)},procedure:function(B,A){A.procedure=this.getAttributeNS(B,this.namespaces.xlink,"href");this.readChildNodes(B,A)},featureOfInterest:function(G,B){var F={features:[]};B.fois=[];B.fois.push(F);this.readChildNodes(G,F);var E=[];for(var D=0,A=F.features.length;D<A;D++){var C=F.features[D];E.push(new OpenLayers.Feature.Vector(C.components[0],C.attributes))}F.features=E},result:function(C,B){var A={};B.result=A;if(this.getChildValue(C)!==""){A.value=this.getChildValue(C);A.uom=C.getAttribute("uom")}else{this.readChildNodes(C,A)}}},sa:OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.sa,gml:OpenLayers.Util.applyDefaults({TimeInstant:function(A,B){var C={};B.timeInstant=C;this.readChildNodes(A,C)},timePosition:function(A,B){B.timePosition=this.getChildValue(A)}},OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.gml)},writers:{sos:{GetObservation:function(B){var D=this.createElementNSPlus("GetObservation",{attributes:{version:this.VERSION,service:"SOS"}});this.writeNode("offering",B,D);if(B.eventTime){this.writeNode("eventTime",B,D)}for(var C in B.procedures){this.writeNode("procedure",B.procedures[C],D)}for(var A in B.observedProperties){this.writeNode("observedProperty",B.observedProperties[A],D)}if(B.foi){this.writeNode("featureOfInterest",B.foi,D)}this.writeNode("responseFormat",B,D);if(B.resultModel){this.writeNode("resultModel",B,D)}if(B.responseMode){this.writeNode("responseMode",B,D)}return D},featureOfInterest:function(A){var B=this.createElementNSPlus("featureOfInterest");this.writeNode("ObjectID",A.objectId,B);return B},ObjectID:function(A){return this.createElementNSPlus("ObjectID",{value:A})},responseFormat:function(A){return this.createElementNSPlus("responseFormat",{value:A.responseFormat})},procedure:function(A){return this.createElementNSPlus("procedure",{value:A})},offering:function(A){return this.createElementNSPlus("offering",{value:A.offering})},observedProperty:function(A){return this.createElementNSPlus("observedProperty",{value:A})},eventTime:function(A){var B=this.createElementNSPlus("eventTime");if(A.eventTime==="latest"){this.writeNode("ogc:TM_Equals",A,B)}return B},resultModel:function(A){return this.createElementNSPlus("resultModel",{value:A.resultModel})},responseMode:function(A){return this.createElementNSPlus("responseMode",{value:A.responseMode})}},ogc:{TM_Equals:function(A){var B=this.createElementNSPlus("ogc:TM_Equals");this.writeNode("ogc:PropertyName",{property:"urn:ogc:data:time:iso8601"},B);if(A.eventTime==="latest"){this.writeNode("gml:TimeInstant",{value:"latest"},B)}return B},PropertyName:function(A){return this.createElementNSPlus("ogc:PropertyName",{value:A.property})}},gml:{TimeInstant:function(A){var B=this.createElementNSPlus("gml:TimeInstant");this.writeNode("gml:timePosition",A,B);return B},timePosition:function(A){var B=this.createElementNSPlus("gml:timePosition",{value:A.value});return B}}},CLASS_NAME:"OpenLayers.Format.SOSGetObservation"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,interval:0,delta:0,cumulative:true,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(I){if(!this.map||!this.checkModifiers(I)){return }var F=false;var K=false;var E=false;var B=OpenLayers.Event.element(I);while((B!=null)&&!E&&!F){if(!F){try{if(B.currentStyle){C=B.currentStyle.overflow}else{var A=document.defaultView.getComputedStyle(B,null);var C=A.getPropertyValue("overflow")}F=(C&&(C=="auto")||(C=="scroll"))}catch(D){}}if(!K){for(var G=0,H=this.map.layers.length;G<H;G++){if(B==this.map.layers[G].div||B==this.map.layers[G].pane){K=true;break}}}E=(B==this.map.div);B=B.parentNode}if(!F&&E){if(K){var J=0;if(!I){I=window.event}if(I.wheelDelta){J=I.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){J=-J}}else{if(I.detail){J=-I.detail/3}}this.delta=this.delta+J;if(this.interval){window.clearTimeout(this._timeoutId);this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(I)},this),this.interval)}else{this.wheelZoom(I)}}OpenLayers.Event.stop(I)}},wheelZoom:function(A){var B=this.delta;this.delta=0;if(B){if(this.mousePosition){A.xy=this.mousePosition}if(!A.xy){A.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(B<0){this.callback("down",[A,this.cumulative?B:-1])}else{this.callback("up",[A,this.cumulative?B:1])}}},mousemove:function(A){this.mousePosition=A.xy},activate:function(A){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var B=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",B);OpenLayers.Event.observe(window,"mousewheel",B);OpenLayers.Event.observe(document,"mousewheel",B);return true}else{return false}},deactivate:function(A){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var B=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",B);OpenLayers.Event.stopObserving(window,"mousewheel",B);OpenLayers.Event.stopObserving(document,"mousewheel",B);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:"1.0.0",srsNameInQuery:false,schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"},initialize:function(A){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[A]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[A])},readNode:function(A,B,C){return OpenLayers.Format.GML.v2.prototype.readNode.apply(this,[A,B])},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(A,B){B.insertIds=[];B.success=false;this.readChildNodes(A,B)},InsertResult:function(B,A){var C={fids:[]};this.readChildNodes(B,C);A.insertIds.push(C.fids[0])},TransactionResult:function(A,B){this.readChildNodes(A,B)},Status:function(A,B){this.readChildNodes(A,B)},SUCCESS:function(A,B){B.success=true}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(B){B=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName,srsNameInQuery:this.srsNameInQuery},B);var E=B.featurePrefix;var D=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(E?E+":":"")+B.featureType}});if(B.srsNameInQuery&&B.srsName){D.setAttribute("srsName",B.srsName)}if(B.featureNS){D.setAttribute("xmlns:"+E,B.featureNS)}if(B.propertyNames){for(var C=0,A=B.propertyNames.length;C<A;C++){this.writeNode("ogc:PropertyName",{property:B.propertyNames[C]},D)}}if(B.filter){this.setFilterProperty(B.filter);this.writeNode("ogc:Filter",B.filter,D)}return D}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_0_0"});OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(A){this.compare=A?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.clear()},insert:function(C){if(this.exists(C)){this.remove(C)}var F=C.id;this.determineZIndex(C);var D=-1;var E=this.order.length;var A;while(E-D>1){A=parseInt((D+E)/2);var B=this.compare(this,C,OpenLayers.Util.getElement(this.order[A]));if(B>0){D=A}else{E=A}}this.order.splice(E,0,F);this.indices[F]=this.getZIndex(C);return this.getNextElement(E)},remove:function(B){var D=B.id;var A=OpenLayers.Util.indexOf(this.order,D);if(A>=0){this.order.splice(A,1);delete this.indices[D];if(this.order.length>0){var C=this.order[this.order.length-1];this.maxZIndex=this.indices[C]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(A){return(this.indices[A.id]!=null)},getZIndex:function(A){return A._style.graphicZIndex},determineZIndex:function(A){var B=A._style.graphicZIndex;if(B==null){B=this.maxZIndex;A._style.graphicZIndex=B}else{if(B>this.maxZIndex){this.maxZIndex=B}}},getNextElement:function(B){var A=B+1;if(A<this.order.length){var C=OpenLayers.Util.getElement(this.order[A]);if(C==undefined){C=this.getNextElement(A)}return C}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(E,D,B){var A=E.getZIndex(D);var F=0;if(B){var C=E.getZIndex(B);F=A-C}return F},Z_ORDER_DRAWING_ORDER:function(C,B,A){var D=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(C,B,A);if(A&&D==0){D=1}return D},Z_ORDER_Y_ORDER:function(D,C,B){var E=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(D,C,B);if(B&&E===0){var A=B._boundsBottom-C._boundsBottom;E=(A===0)?1:A}return E}};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(A,B){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot);this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);if(B&&(B.zIndexing||B.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(B.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var B;var A=this.vectorRoot;if(A){while(B=A.firstChild){A.removeChild(B)}}A=this.textRoot;if(A){while(B=A.firstChild){A.removeChild(B)}}if(this.indexer){this.indexer.clear()}},setExtent:function(E,G){var C=OpenLayers.Renderer.prototype.setExtent.apply(this,arguments);var B=this.getResolution();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var A,D=E.getWidth()/this.map.getExtent().getWidth(),E=E.scale(1/D),F=this.map.getMaxExtent();if(F.right>E.left&&F.right<E.right){A=true}else{if(F.left>E.left&&F.left<E.right){A=false}}if(A!==this.rightOfDateLine||G){C=false;this.xOffset=A===true?F.getWidth()/B:0}this.rightOfDateLine=A}return C},getNodeType:function(B,A){},drawGeometry:function(I,A,D){var H=I.CLASS_NAME;var C=true;if((H=="OpenLayers.Geometry.Collection")||(H=="OpenLayers.Geometry.MultiPoint")||(H=="OpenLayers.Geometry.MultiLineString")||(H=="OpenLayers.Geometry.MultiPolygon")){for(var F=0,G=I.components.length;F<G;F++){C=this.drawGeometry(I.components[F],A,D)&&C}return C}C=false;var E=false;if(A.display!="none"){if(A.backgroundGraphic){this.redrawBackgroundNode(I.id,I,A,D)}else{E=true}C=this.redrawNode(I.id,I,A,D)}if(C==false){var B=document.getElementById(I.id);if(B){if(B._style.backgroundGraphic){E=true}B.parentNode.removeChild(B)}}if(E){var B=document.getElementById(I.id+this.BACKGROUND_ID_SUFFIX);if(B){B.parentNode.removeChild(B)}}return C},redrawNode:function(G,F,B,E){B=this.applyDefaultSymbolizer(B);var C=this.nodeFactory(G,this.getNodeType(F,B));C._featureId=E;C._boundsBottom=F.getBounds().bottom;C._geometryClass=F.CLASS_NAME;C._style=B;var A=this.drawGeometryNode(C,F,B);if(A===false){return false}C=A.node;if(this.indexer){var D=this.indexer.insert(C);if(D){this.vectorRoot.insertBefore(C,D)}else{this.vectorRoot.appendChild(C)}}else{if(C.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(C)}}this.postDraw(C);return A.complete},redrawBackgroundNode:function(E,D,B,C){var A=OpenLayers.Util.extend({},B);A.externalGraphic=A.backgroundGraphic;A.graphicXOffset=A.backgroundXOffset;A.graphicYOffset=A.backgroundYOffset;A.graphicZIndex=A.backgroundGraphicZIndex;A.graphicWidth=A.backgroundWidth||A.graphicWidth;A.graphicHeight=A.backgroundHeight||A.graphicHeight;A.backgroundGraphic=null;A.backgroundXOffset=null;A.backgroundYOffset=null;A.backgroundGraphicZIndex=null;return this.redrawNode(E+this.BACKGROUND_ID_SUFFIX,D,A,null)},drawGeometryNode:function(C,E,B){B=B||C._style;var A={isFilled:B.fill===undefined?true:B.fill,isStroked:B.stroke===undefined?!!B.strokeWidth:B.stroke};var D;switch(E.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.graphic===false){A.isFilled=false;A.isStroked=false}D=this.drawPoint(C,E);break;case"OpenLayers.Geometry.LineString":A.isFilled=false;D=this.drawLineString(C,E);break;case"OpenLayers.Geometry.LinearRing":D=this.drawLinearRing(C,E);break;case"OpenLayers.Geometry.Polygon":D=this.drawPolygon(C,E);break;case"OpenLayers.Geometry.Rectangle":D=this.drawRectangle(C,E);break;default:break}C._options=A;if(D!=false){return{node:this.setStyle(C,B,A,E),complete:D}}else{return false}},postDraw:function(A){},drawPoint:function(A,B){},drawLineString:function(A,B){},drawLinearRing:function(A,B){},drawPolygon:function(A,B){},drawRectangle:function(A,B){},drawCircle:function(A,B){},removeText:function(C){var A=document.getElementById(C+this.LABEL_ID_SUFFIX);if(A){this.textRoot.removeChild(A)}var B=document.getElementById(C+this.LABEL_OUTLINE_SUFFIX);if(B){this.textRoot.removeChild(B)}},getFeatureIdFromEvent:function(A){var D=A.target;var B=D&&D.correspondingUseElement;var C=B?B:(D||A.srcElement);return C._featureId},eraseGeometry:function(G,F){if((G.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(G.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(G.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(G.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var D=0,A=G.components.length;D<A;D++){this.eraseGeometry(G.components[D],F)}}else{var C=OpenLayers.Util.getElement(G.id);if(C&&C.parentNode){if(C.geometry){C.geometry.destroy();C.geometry=null}C.parentNode.removeChild(C);if(this.indexer){this.indexer.remove(C)}if(C._style.backgroundGraphic){var B=G.id+this.BACKGROUND_ID_SUFFIX;var E=OpenLayers.Util.getElement(B);if(E&&E.parentNode){E.parentNode.removeChild(E)}}}}},nodeFactory:function(C,A){var B=OpenLayers.Util.getElement(C);if(B){if(!this.nodeTypeCompare(B,A)){B.parentNode.removeChild(B);B=this.nodeFactory(C,A)}}else{B=this.createNode(A,C)}return B},nodeTypeCompare:function(B,A){},createNode:function(A,B){},moveRoot:function(B){var A=this.root;if(B.root.parentNode==this.rendererRoot){A=B.root}A.parentNode.removeChild(A);B.rendererRoot.appendChild(A)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(A){return(A!="circle")&&!!A},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,getParameters:function(B){B=B||window.location.href;var C=OpenLayers.Util.getParameters(B);var A=B.indexOf("#");if(A>0){B="?"+B.substring(A+1,B.length);OpenLayers.Util.extend(C,OpenLayers.Util.getParameters(B))}return C},setMap:function(E){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var C=0,A=this.map.controls.length;C<A;C++){var D=this.map.controls[C];if((D!=this)&&(D.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(D.displayProjection!=this.displayProjection){this.displayProjection=D.displayProjection}break}}if(C==this.map.controls.length){var B=this.getParameters();if(B.layers){this.layers=B.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(B.lat&&B.lon){this.center=new OpenLayers.LonLat(parseFloat(B.lon),parseFloat(B.lat));if(B.zoom){this.zoom=parseFloat(B.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var C=0,A=this.layers.length;C<A;C++){var B=this.map.layers[C];var D=this.layers.charAt(C);if(D=="B"){this.map.setBaseLayer(B)}else{if((D=="T")||(D=="F")){B.setVisibility(D=="T")}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,anchor:false,base:"",displayProjection:null,initialize:function(B,C,A){if(B!==null&&typeof B=="object"&&!OpenLayers.Util.isElement(B)){A=B;this.base=document.location.href;OpenLayers.Control.prototype.initialize.apply(this,[A]);if(this.element!=null){this.element=OpenLayers.Util.getElement(this.element)}}else{OpenLayers.Control.prototype.initialize.apply(this,[A]);this.element=OpenLayers.Util.getElement(B);this.base=C||document.location.href}},destroy:function(){if(this.element&&this.element.parentNode==this.div){this.div.removeChild(this.element);this.element=null}if(this.map){this.map.events.unregister("moveend",this,this.updateLink)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(D){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var B=0,A=this.map.controls.length;B<A;B++){var C=this.map.controls[B];if(C.CLASS_NAME==this.argParserClass.CLASS_NAME){if(C.displayProjection!=this.displayProjection){this.displayProjection=C.displayProjection}break}}if(B==this.map.controls.length){this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element&&!this.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});this.updateLink();return this.div},updateLink:function(){var B=this.anchor?"#":"?";var A=this.base;if(A.indexOf(B)!=-1){A=A.substring(0,A.indexOf(B))}A+=B+OpenLayers.Util.getParameterString(this.createParams());if(this.anchor&&!this.element){window.location.href=A}else{this.element.href=A}},createParams:function(A,J,E){A=A||this.map.getCenter();var D=OpenLayers.Util.getParameters(this.base);if(A){D.zoom=J||this.map.getZoom();var I=A.lat;var B=A.lon;if(this.displayProjection){var C=OpenLayers.Projection.transform({x:B,y:I},this.map.getProjectionObject(),this.displayProjection);B=C.x;I=C.y}D.lat=Math.round(I*100000)/100000;D.lon=Math.round(B*100000)/100000;E=E||this.map.layers;D.layers="";for(var F=0,H=E.length;F<H;F++){var G=E[F];if(G.isBaseLayer){D.layers+=(G==this.map.baseLayer)?"B":"0"}else{D.layers+=(G.getVisibility())?"T":"F"}}}return D},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",layername:null,type:null,isBaseLayer:true,tileOrigin:null,serverResolutions:null,zoomOffset:0,initialize:function(D,C,B){var A=[];A.push(D,C,{},B);OpenLayers.Layer.Grid.prototype.initialize.apply(this,A)},clone:function(A){if(A==null){A=new OpenLayers.Layer.TMS(this.name,this.url,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(D){D=this.adjustBounds(D);var C=this.getServerResolution();var A=Math.round((D.left-this.tileOrigin.lon)/(C*this.tileSize.w));var G=Math.round((D.bottom-this.tileOrigin.lat)/(C*this.tileSize.h));var F=this.getServerZoom();var E=this.serviceVersion+"/"+this.layername+"/"+F+"/"+A+"/"+G+"."+this.type;var B=this.url;if(OpenLayers.Util.isArray(B)){B=this.selectUrl(E,B)}return B+E},setMap:function(A){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.TMS"});OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:false,activate:function(){if(OpenLayers.Strategy.prototype.activate.apply(this,arguments)){this.layer.events.on({refresh:this.load,scope:this});if(this.layer.visibility==true||this.preload){this.load()}else{this.layer.events.on({visibilitychanged:this.load,scope:this})}return true}return false},deactivate:function(){var A=OpenLayers.Strategy.prototype.deactivate.call(this);if(A){this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this})}return A},load:function(A){var B=this.layer;B.events.triggerEvent("loadstart");B.protocol.read(OpenLayers.Util.applyDefaults({callback:OpenLayers.Function.bind(this.merge,this,B.map.getProjectionObject()),filter:B.filter},A));B.events.un({visibilitychanged:this.load,scope:this})},merge:function(F,G){var D=this.layer;D.destroyFeatures();var E=G.features;if(E&&E.length>0){if(!F.equals(D.projection)){var C;for(var B=0,A=E.length;B<A;++B){C=E[B].geometry;if(C){C.transform(D.projection,F)}}}D.addFeatures(E)}D.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Control.Zoom=OpenLayers.Class(OpenLayers.Control,{zoomInText:"+",zoomInId:"olZoomInLink",zoomOutText:"-",zoomOutId:"olZoomOutLink",draw:function(){var E=OpenLayers.Control.prototype.draw.apply(this),B=this.getOrCreateLinks(E),D=B.zoomIn,A=B.zoomOut,C=this.map.events;if(A.parentNode!==E){C=this.events;C.attachToElement(A.parentNode)}C.register("buttonclick",this,this.onZoomClick);this.zoomInLink=D;this.zoomOutLink=A;return E},getOrCreateLinks:function(B){var C=document.getElementById(this.zoomInId),A=document.getElementById(this.zoomOutId);if(!C){C=document.createElement("a");C.href="#zoomIn";C.appendChild(document.createTextNode(this.zoomInText));C.className="olControlZoomIn";B.appendChild(C)}OpenLayers.Element.addClass(C,"olButton");if(!A){A=document.createElement("a");A.href="#zoomOut";A.appendChild(document.createTextNode(this.zoomOutText));A.className="olControlZoomOut";B.appendChild(A)}OpenLayers.Element.addClass(A,"olButton");return{zoomIn:C,zoomOut:A}},onZoomClick:function(A){var B=A.buttonElement;if(B===this.zoomInLink){this.map.zoomIn()}else{if(B===this.zoomOutLink){this.map.zoomOut()}}},destroy:function(){if(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.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,styleFrom:null,addNodes:function(G,K){if(G.length<2){throw new Error("At least two point features have to be added to create a line from")}var L=new Array(G.length-1);var H,B,I;for(var D=0,F=G.length;D<F;D++){H=G[D];I=H.geometry;if(!I){var E=H.lonlat;I=new OpenLayers.Geometry.Point(E.lon,E.lat)}else{if(I.CLASS_NAME!="OpenLayers.Geometry.Point"){throw new TypeError("Only features with point geometries are supported.")}}if(D>0){var C=(this.dataFrom!=null)?(G[D+this.dataFrom].data||G[D+this.dataFrom].attributes):null;var A=(this.styleFrom!=null)?(G[D+this.styleFrom].style):null;var J=new OpenLayers.Geometry.LineString([B,I]);L[D-1]=new OpenLayers.Feature.Vector(J,C,A)}B=I}this.addFeatures(L,K)},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:true,defaultFilter:null,initialize:function(A){A=A||{};OpenLayers.Util.extend(this,A);this.options=A},mergeWithDefaultFilter:function(B){var A;if(B&&this.defaultFilter){A=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,B]})}else{A=B||this.defaultFilter||undefined}return A},destroy:function(){this.options=null;this.format=null},read:function(A){A=A||{};A.filter=this.mergeWithDefaultFilter(A.filter)},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(A){},createCallback:function(C,A,B){return OpenLayers.Function.bind(function(){C.apply(this,[A,B])},this)},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,data:null,reqFeatures:null,priv:null,error:null,initialize:function(A){OpenLayers.Util.extend(this,A)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Protocol.WFS=function(B){B=OpenLayers.Util.applyDefaults(B,OpenLayers.Protocol.WFS.DEFAULTS);var A=OpenLayers.Protocol.WFS["v"+B.version.replace(/\./g,"_")];if(!A){throw"Unsupported WFS version: "+B.version}return new A(B)};OpenLayers.Protocol.WFS.fromWMSLayer=function(D,C){var A,E;var G=D.params.LAYERS;var F=(OpenLayers.Util.isArray(G)?G[0]:G).split(":");if(F.length>1){E=F[0]}A=F.pop();var B={url:D.url,featureType:A,featurePrefix:E,srsName:D.projection&&D.projection.getCode()||D.map&&D.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(C,B))};OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"};OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(B,A){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(B){if(B!=this.opacity){this.opacity=B;for(var C=0,A=this.markers.length;C<A;C++){this.markers[C].setOpacity(this.opacity)}}},moveTo:function(D,B,E){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(B||!this.drawn){for(var C=0,A=this.markers.length;C<A;C++){this.drawMarker(this.markers[C])}this.drawn=true}},addMarker:function(A){this.markers.push(A);if(this.opacity<1){A.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){A.map=this.map;this.drawMarker(A)}},removeMarker:function(A){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,A);A.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(A){var B=this.map.getLayerPxFromLonLat(A.lonlat);if(B==null){A.display(false)}else{if(!A.isDrawn()){var C=A.draw(B);this.div.appendChild(C)}else{if(A.icon){A.icon.moveTo(B)}}}},getDataExtent:function(){var B=null;if(this.markers&&(this.markers.length>0)){var B=new OpenLayers.Bounds();for(var D=0,A=this.markers.length;D<A;D++){var C=this.markers[D];B.extend(C.lonlat)}}return B},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(B,A){this.direction=B;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[A])},trigger:function(){var A=OpenLayers.Function.bind(function(B){return this.slideRatio?this.map.getSize()[B]*this.slideRatio:this.slideFactor},this);switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-A("h"));break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,A("h"));break;case OpenLayers.Control.Pan.WEST:this.map.pan(-A("w"),0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(A("w"),0);break}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";OpenLayers.Format.CSWGetDomain=function(B){B=OpenLayers.Util.applyDefaults(B,OpenLayers.Format.CSWGetDomain.DEFAULTS);var A=OpenLayers.Format.CSWGetDomain["v"+B.version.replace(/\./g,"_")];if(!A){throw"Unsupported CSWGetDomain version: "+B.version}return new A(B)};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(A){if(typeof A=="string"){A=OpenLayers.Format.XML.prototype.read.apply(this,[A])}if(A&&A.nodeType==9){A=A.documentElement}var B={};this.readNode(A,B);return B},readers:{csw:{GetDomainResponse:function(A,B){this.readChildNodes(A,B)},DomainValues:function(D,E){if(!(OpenLayers.Util.isArray(E.DomainValues))){E.DomainValues=[]}var B=D.attributes;var F={};for(var C=0,A=B.length;C<A;++C){F[B[C].name]=B[C].nodeValue}this.readChildNodes(D,F);E.DomainValues.push(F)},PropertyName:function(A,B){B.PropertyName=this.getChildValue(A)},ParameterName:function(A,B){B.ParameterName=this.getChildValue(A)},ListOfValues:function(A,B){if(!(OpenLayers.Util.isArray(B.ListOfValues))){B.ListOfValues=[]}this.readChildNodes(A,B.ListOfValues)},Value:function(D,F){var B=D.attributes;var E={};for(var C=0,A=B.length;C<A;++C){E[B[C].name]=B[C].nodeValue}E.value=this.getChildValue(D);F.push({Value:E})},ConceptualScheme:function(A,B){B.ConceptualScheme={};this.readChildNodes(A,B.ConceptualScheme)},Name:function(A,B){B.Name=this.getChildValue(A)},Document:function(A,B){B.Document=this.getChildValue(A)},Authority:function(A,B){B.Authority=this.getChildValue(A)},RangeOfValues:function(A,B){B.RangeOfValues={};this.readChildNodes(A,B.RangeOfValues)},MinValue:function(D,F){var B=D.attributes;var E={};for(var C=0,A=B.length;C<A;++C){E[B[C].name]=B[C].nodeValue}E.value=this.getChildValue(D);F.MinValue=E},MaxValue:function(D,F){var B=D.attributes;var E={};for(var C=0,A=B.length;C<A;++C){E[B[C].name]=B[C].nodeValue}E.value=this.getChildValue(D);F.MaxValue=E}}},write:function(A){var B=this.writeNode("csw:GetDomain",A);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},writers:{csw:{GetDomain:function(A){var B=this.createElementNSPlus("csw:GetDomain",{attributes:{service:"CSW",version:this.version}});if(A.PropertyName||this.PropertyName){this.writeNode("csw:PropertyName",A.PropertyName||this.PropertyName,B)}else{if(A.ParameterName||this.ParameterName){this.writeNode("csw:ParameterName",A.ParameterName||this.ParameterName,B)}}this.readChildNodes(B,A);return B},PropertyName:function(B){var A=this.createElementNSPlus("csw:PropertyName",{value:B});return A},ParameterName:function(B){var A=this.createElementNSPlus("csw:ParameterName",{value:B});return A}}},CLASS_NAME:"OpenLayers.Format.CSWGetDomain.v2_0_2"});OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{read:function(C){var B=new OpenLayers.Format.ArcXML();var A=B.read(C);return A.features.feature}});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{DEFAULTS:{tolerance:10,node:true,edge:true,vertex:true},greedy:true,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.options=A||{};if(this.options.layer){this.setLayer(this.options.layer)}var B=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(B,this.DEFAULTS);this.setTargets(this.options.targets);if(this.targets.length===0&&this.layer){this.addTargetLayer(this.layer)}this.geoToleranceCache={}},setLayer:function(A){if(this.active){this.deactivate();this.layer=A;this.activate()}else{this.layer=A}},setTargets:function(B){this.targets=[];if(B&&B.length){var D;for(var C=0,A=B.length;C<A;++C){D=B[C];if(D instanceof OpenLayers.Layer.Vector){this.addTargetLayer(D)}else{this.addTarget(D)}}}},addTargetLayer:function(A){this.addTarget({layer:A})},addTarget:function(A){A=OpenLayers.Util.applyDefaults(A,this.defaults);A.nodeTolerance=A.nodeTolerance||A.tolerance;A.vertexTolerance=A.vertexTolerance||A.tolerance;A.edgeTolerance=A.edgeTolerance||A.tolerance;this.targets.push(A)},removeTargetLayer:function(B){var C;for(var A=this.targets.length-1;A>=0;--A){C=this.targets[A];if(C.layer===B){this.removeTarget(C)}}},removeTarget:function(A){return OpenLayers.Util.removeItem(this.targets,A)},activate:function(){var A=OpenLayers.Control.prototype.activate.call(this);if(A){if(this.layer&&this.layer.events){this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}return A},deactivate:function(){var A=OpenLayers.Control.prototype.deactivate.call(this);if(A){if(this.layer&&this.layer.events){this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}this.feature=null;this.point=null;return A},onSketchModified:function(A){this.feature=A.feature;this.considerSnapping(A.vertex,A.vertex)},onVertexModified:function(A){this.feature=A.feature;var B=this.layer.map.getLonLatFromViewPortPx(A.pixel);this.considerSnapping(A.vertex,new OpenLayers.Geometry.Point(B.lon,B.lat))},considerSnapping:function(H,D){var A={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null};var C=false;var I,F;for(var B=0,E=this.targets.length;B<E;++B){F=this.targets[B];I=this.testTarget(F,D);if(I){if(this.greedy){A=I;A.target=F;C=true;break}else{if((I.rank<A.rank)||(I.rank===A.rank&&I.dist<A.dist)){A=I;A.target=F;C=true}}}}if(C){var G=this.events.triggerEvent("beforesnap",{point:H,x:A.x,y:A.y,distance:A.dist,layer:A.target.layer,snapType:this.precedence[A.rank]});if(G!==false){H.x=A.x;H.y=A.y;this.point=H;this.events.triggerEvent("snap",{point:H,snapType:this.precedence[A.rank],layer:A.target.layer,distance:A.dist})}else{C=false}}if(this.point&&!C){H.x=D.x;H.y=D.y;this.point=null;this.events.triggerEvent("unsnap",{point:H})}},testTarget:function(W,F){var O=this.layer.map.getResolution();if("minResolution" in W){if(O<W.minResolution){return null}}if("maxResolution" in W){if(O>=W.maxResolution){return null}}var U={node:this.getGeoTolerance(W.nodeTolerance,O),vertex:this.getGeoTolerance(W.vertexTolerance,O),edge:this.getGeoTolerance(W.edgeTolerance,O)};var G=Math.max(U.node,U.vertex,U.edge);var H={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY};var E=false;var C=W.layer.features;var B,A,D,V,L,M,K;var J=this.precedence.length;var I=new OpenLayers.LonLat(F.x,F.y);for(var S=0,T=C.length;S<T;++S){B=C[S];if(B!==this.feature&&!B._sketch&&B.state!==OpenLayers.State.DELETE&&(!W.filter||W.filter.evaluate(B))){if(B.atPoint(I,G,G)){for(var R=0,N=Math.min(H.rank+1,J);R<N;++R){A=this.precedence[R];if(W[A]){if(A==="edge"){L=B.geometry.distanceTo(F,{details:true});M=L.distance;if(M<=U[A]&&M<H.dist){H={rank:R,dist:M,x:L.x0,y:L.y0};E=true;break}}else{D=B.geometry.getVertices(A==="node");K=false;for(var Q=0,P=D.length;Q<P;++Q){V=D[Q];M=V.distanceTo(F);if(M<=U[A]&&(R<H.rank||(R===H.rank&&M<H.dist))){H={rank:R,dist:M,x:V.x,y:V.y};E=true;K=true}}if(K){break}}}}}}}return E?H:null},getGeoTolerance:function(A,B){if(B!==this.resolution){this.resolution=B;this.geoToleranceCache={}}var C=this.geoToleranceCache[A];if(C===undefined){C=A*B;this.geoToleranceCache[A]=C}return C},destroy:function(){if(this.active){this.deactivate()}delete this.layer;delete this.targets;OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"});OpenLayers.Format.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(C){if(typeof C=="string"){C=OpenLayers.Format.XML.prototype.read.apply(this,[C])}var B=C;if(C&&C.nodeType==9){C=C.documentElement}var A={};this.readNode(C,A);if(A.service===undefined){var D=new OpenLayers.Format.OGCExceptionReport();A.error=D.read(B)}return A},readers:{wms:{Service:function(A,B){B.service={};this.readChildNodes(A,B.service)},Name:function(A,B){B.name=this.getChildValue(A)},Title:function(A,B){B.title=this.getChildValue(A)},Abstract:function(A,B){B["abstract"]=this.getChildValue(A)},BoundingBox:function(B,C){var D={};D.bbox=[parseFloat(B.getAttribute("minx")),parseFloat(B.getAttribute("miny")),parseFloat(B.getAttribute("maxx")),parseFloat(B.getAttribute("maxy"))];var A={x:parseFloat(B.getAttribute("resx")),y:parseFloat(B.getAttribute("resy"))};if(!(isNaN(A.x)&&isNaN(A.y))){D.res=A}return D},OnlineResource:function(A,B){B.href=this.getAttributeNS(A,this.namespaces.xlink,"href")},ContactInformation:function(A,B){B.contactInformation={};this.readChildNodes(A,B.contactInformation)},ContactPersonPrimary:function(A,B){B.personPrimary={};this.readChildNodes(A,B.personPrimary)},ContactPerson:function(A,B){B.person=this.getChildValue(A)},ContactOrganization:function(A,B){B.organization=this.getChildValue(A)},ContactPosition:function(A,B){B.position=this.getChildValue(A)},ContactAddress:function(A,B){B.contactAddress={};this.readChildNodes(A,B.contactAddress)},AddressType:function(A,B){B.type=this.getChildValue(A)},Address:function(A,B){B.address=this.getChildValue(A)},City:function(A,B){B.city=this.getChildValue(A)},StateOrProvince:function(A,B){B.stateOrProvince=this.getChildValue(A)},PostCode:function(A,B){B.postcode=this.getChildValue(A)},Country:function(A,B){B.country=this.getChildValue(A)},ContactVoiceTelephone:function(A,B){B.phone=this.getChildValue(A)},ContactFacsimileTelephone:function(A,B){B.fax=this.getChildValue(A)},ContactElectronicMailAddress:function(A,B){B.email=this.getChildValue(A)},Fees:function(B,C){var A=this.getChildValue(B);if(A&&A.toLowerCase()!="none"){C.fees=A}},AccessConstraints:function(A,B){var C=this.getChildValue(A);if(C&&C.toLowerCase()!="none"){B.accessConstraints=C}},Capability:function(A,B){B.capability={nestedLayers:[],layers:[]};this.readChildNodes(A,B.capability)},Request:function(A,B){B.request={};this.readChildNodes(A,B.request)},GetCapabilities:function(A,B){B.getcapabilities={formats:[]};this.readChildNodes(A,B.getcapabilities)},Format:function(A,B){if(OpenLayers.Util.isArray(B.formats)){B.formats.push(this.getChildValue(A))}else{B.format=this.getChildValue(A)}},DCPType:function(A,B){this.readChildNodes(A,B)},HTTP:function(A,B){this.readChildNodes(A,B)},Get:function(A,B){B.get={};this.readChildNodes(A,B.get);if(!B.href){B.href=B.get.href}},Post:function(A,B){B.post={};this.readChildNodes(A,B.post);if(!B.href){B.href=B.get.href}},GetMap:function(A,B){B.getmap={formats:[]};this.readChildNodes(A,B.getmap)},GetFeatureInfo:function(A,B){B.getfeatureinfo={formats:[]};this.readChildNodes(A,B.getfeatureinfo)},Exception:function(A,B){B.exception={formats:[]};this.readChildNodes(A,B.exception)},Layer:function(C,I){var E,B;if(I.capability){B=I.capability;E=I}else{B=I}var Q=C.getAttributeNode("queryable");var D=(Q&&Q.specified)?C.getAttribute("queryable"):null;Q=C.getAttributeNode("cascaded");var M=(Q&&Q.specified)?C.getAttribute("cascaded"):null;Q=C.getAttributeNode("opaque");var J=(Q&&Q.specified)?C.getAttribute("opaque"):null;var O=C.getAttribute("noSubsets");var A=C.getAttribute("fixedWidth");var L=C.getAttribute("fixedHeight");var P=E||{},N=OpenLayers.Util.extend;var K={nestedLayers:[],styles:E?[].concat(E.styles):[],srs:E?N({},P.srs):{},metadataURLs:[],bbox:E?N({},P.bbox):{},llbbox:P.llbbox,dimensions:E?N({},P.dimensions):{},authorityURLs:E?N({},P.authorityURLs):{},identifiers:{},keywords:[],queryable:(D&&D!=="")?(D==="1"||D==="true"):(P.queryable||false),cascaded:(M!==null)?parseInt(M):(P.cascaded||0),opaque:J?(J==="1"||J==="true"):(P.opaque||false),noSubsets:(O!==null)?(O==="1"||O==="true"):(P.noSubsets||false),fixedWidth:(A!=null)?parseInt(A):(P.fixedWidth||0),fixedHeight:(L!=null)?parseInt(L):(P.fixedHeight||0),minScale:P.minScale,maxScale:P.maxScale,attribution:P.attribution};I.nestedLayers.push(K);K.capability=B;this.readChildNodes(C,K);delete K.capability;if(K.name){var H=K.name.split(":"),G=B.request,F=G.getfeatureinfo;if(H.length>0){K.prefix=H[0]}B.layers.push(K);if(K.formats===undefined){K.formats=G.getmap.formats}if(K.infoFormats===undefined&&F){K.infoFormats=F.formats}}},Attribution:function(A,B){B.attribution={};this.readChildNodes(A,B.attribution)},LogoURL:function(A,B){B.logo={width:A.getAttribute("width"),height:A.getAttribute("height")};this.readChildNodes(A,B.logo)},Style:function(B,C){var A={};C.styles.push(A);this.readChildNodes(B,A)},LegendURL:function(B,C){var A={width:B.getAttribute("width"),height:B.getAttribute("height")};C.legend=A;this.readChildNodes(B,A)},MetadataURL:function(A,B){var C={type:A.getAttribute("type")};B.metadataURLs.push(C);this.readChildNodes(A,C)},DataURL:function(A,B){B.dataURL={};this.readChildNodes(A,B.dataURL)},FeatureListURL:function(A,B){B.featureListURL={};this.readChildNodes(A,B.featureListURL)},AuthorityURL:function(B,D){var A=B.getAttribute("name");var C={};this.readChildNodes(B,C);D.authorityURLs[A]=C.href},Identifier:function(A,C){var B=A.getAttribute("authority");C.identifiers[B]=this.getChildValue(A)},KeywordList:function(A,B){this.readChildNodes(A,B)},SRS:function(A,B){B.srs[this.getChildValue(A)]=true}}},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(A,B){this.readChildNodes(A,B)},Keyword:function(A,B){if(B.keywords){B.keywords.push(this.getChildValue(A))}},DescribeLayer:function(A,B){B.describelayer={formats:[]};this.readChildNodes(A,B.describelayer)},GetLegendGraphic:function(A,B){B.getlegendgraphic={formats:[]};this.readChildNodes(A,B.getlegendgraphic)},GetStyles:function(A,B){B.getstyles={formats:[]};this.readChildNodes(A,B.getstyles)},PutStyles:function(A,B){B.putstyles={formats:[]};this.readChildNodes(A,B.putstyles)},UserDefinedSymbolization:function(A,B){var C={supportSLD:parseInt(A.getAttribute("SupportSLD"))==1,userLayer:parseInt(A.getAttribute("UserLayer"))==1,userStyle:parseInt(A.getAttribute("UserStyle"))==1,remoteWFS:parseInt(A.getAttribute("RemoteWFS"))==1};B.userSymbols=C},LatLonBoundingBox:function(A,B){B.llbbox=[parseFloat(A.getAttribute("minx")),parseFloat(A.getAttribute("miny")),parseFloat(A.getAttribute("maxx")),parseFloat(A.getAttribute("maxy"))]},BoundingBox:function(A,B){var C=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[A,B]);C.srs=A.getAttribute("SRS");B.bbox[C.srs]=C},ScaleHint:function(E,F){var D=E.getAttribute("min");var A=E.getAttribute("max");var C=Math.pow(2,0.5);var B=OpenLayers.INCHES_PER_UNIT.m;F.maxScale=parseFloat(((D/C)*B*OpenLayers.DOTS_PER_INCH).toPrecision(13));F.minScale=parseFloat(((A/C)*B*OpenLayers.DOTS_PER_INCH).toPrecision(13))},Dimension:function(B,D){var A=B.getAttribute("name").toLowerCase();var C={name:A,units:B.getAttribute("units"),unitsymbol:B.getAttribute("unitSymbol")};D.dimensions[C.name]=C},Extent:function(D,E){var B=D.getAttribute("name").toLowerCase();if(B in E.dimensions){var C=E.dimensions[B];C.nearestVal=D.getAttribute("nearestValue")==="1";C.multipleVal=D.getAttribute("multipleValues")==="1";C.current=D.getAttribute("current")==="1";C["default"]=D.getAttribute("default")||"";var A=this.getChildValue(D);C.values=A.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(E,F){var D=this.getChildValue(E);var B=D.split(/ +/);for(var C=0,A=B.length;C<A;C++){F.srs[B[C]]=true}}},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(A){OpenLayers.Protocol.prototype.initialize.apply(this,[A]);if(!A.format){this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))}if(!A.geometryName&&parseFloat(this.format.version)>1){this.setGeometryName(null)}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy()}this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(B){OpenLayers.Protocol.prototype.read.apply(this,arguments);B=OpenLayers.Util.extend({},B);OpenLayers.Util.applyDefaults(B,this.options||{});var A=new OpenLayers.Protocol.Response({requestType:"read"});var C=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",B)]);A.priv=OpenLayers.Request.POST({url:B.url,callback:this.createCallback(this.handleRead,A,B),params:B.params,headers:B.headers,data:C});return A},setFeatureType:function(A){this.featureType=A;this.format.featureType=A},setGeometryName:function(A){this.geometryName=A;this.format.geometryName=A},handleRead:function(B,C){C=OpenLayers.Util.extend({},C);OpenLayers.Util.applyDefaults(C,this.options);if(C.callback){var D=B.priv;if(D.status>=200&&D.status<300){var A=this.parseResponse(D,C.readOptions);if(A&&A.success!==false){if(C.readOptions&&C.readOptions.output=="object"){OpenLayers.Util.extend(B,A)}else{B.features=A}B.code=OpenLayers.Protocol.Response.SUCCESS}else{B.code=OpenLayers.Protocol.Response.FAILURE;B.error=A}}else{B.code=OpenLayers.Protocol.Response.FAILURE}C.callback.call(C.scope,B)}},parseResponse:function(C,B){var E=C.responseXML;if(!E||!E.documentElement){E=C.responseText}if(!E||E.length<=0){return null}var A=(this.readFormat!==null)?this.readFormat.read(E):this.format.read(E,B);if(!this.featureNS){var D=this.readFormat||this.format;this.featureNS=D.featureNS;D.autoConfig=false;if(!this.geometryName){this.setGeometryName(D.geometryName)}}return A},commit:function(C,B){B=OpenLayers.Util.extend({},B);OpenLayers.Util.applyDefaults(B,this.options);var A=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:C});A.priv=OpenLayers.Request.POST({url:B.url,headers:B.headers,data:this.format.write(C,B),callback:this.createCallback(this.handleCommit,A,B)});return A},handleCommit:function(A,B){if(B.callback){var C=A.priv;var D=C.responseXML;if(!D||!D.documentElement){D=C.responseText}var E=this.format.read(D)||{};A.insertIds=E.insertIds||[];if(E.success){A.code=OpenLayers.Protocol.Response.SUCCESS}else{A.code=OpenLayers.Protocol.Response.FAILURE;A.error=E}B.callback.call(B.scope,A)}},filterDelete:function(E,C){C=OpenLayers.Util.extend({},C);OpenLayers.Util.applyDefaults(C,this.options);var B=new OpenLayers.Protocol.Response({requestType:"commit"});var A=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});var D=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(C.featureNS?this.featurePrefix+":":"")+C.featureType}});if(C.featureNS){D.setAttribute("xmlns:"+this.featurePrefix,C.featureNS)}var G=this.format.writeNode("ogc:Filter",E);D.appendChild(G);A.appendChild(D);var F=OpenLayers.Format.XML.prototype.write.apply(this.format,[A]);return OpenLayers.Request.POST({url:this.url,callback:C.callback||function(){},data:F})},abort:function(A){if(A){A.priv.abort()}},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,citeCompliant:false,mouseDown:false,stoppedDown:null,lastDown:null,lastUp:null,persist:false,stopDown:false,stopUp:false,layerOptions:null,pixelTolerance:5,touch:false,lastTouchPx:null,initialize:function(C,B,A){if(!(A&&A.layerOptions&&A.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var A=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,A);this.map.addLayer(this.layer);return true},createFeature:function(A){var B=this.layer.getLonLatFromViewPortPx(A);var C=new OpenLayers.Geometry.Point(B.lon,B.lat);this.point=new OpenLayers.Feature.Vector(C);this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}this.cancel();if(this.layer.map!=null){this.destroyFeature(true);this.layer.destroy(false)}this.layer=null;this.touch=false;return true},destroyFeature:function(A){if(this.layer&&(A||!this.persist)){this.layer.destroyFeatures()}this.point=null},destroyPersistedFeature:function(){var A=this.layer;if(A&&A.features.length>1){this.layer.features[0].destroy()}},finalize:function(B){var A=B?"cancel":"done";this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.lastTouchPx=null;this.callback(A,[this.geometryClone()]);this.destroyFeature(B)},cancel:function(){this.finalize(true)},click:function(A){OpenLayers.Event.stop(A);return false},dblclick:function(A){OpenLayers.Event.stop(A);return false},modifyFeature:function(A){if(!this.point){this.createFeature(A)}var B=this.layer.getLonLatFromViewPortPx(A);this.point.geometry.x=B.lon;this.point.geometry.y=B.lat;this.callback("modify",[this.point.geometry,this.point,false]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var A=this.point&&this.point.geometry;if(A&&this.multi){A=new OpenLayers.Geometry.MultiPoint([A])}return A},geometryClone:function(){var A=this.getGeometry();return A&&A.clone()},mousedown:function(A){return this.down(A)},touchstart:function(A){if(!this.touch){this.touch=true;this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,dblclick:this.dblclick,scope:this})}this.lastTouchPx=A.xy;return this.down(A)},mousemove:function(A){return this.move(A)},touchmove:function(A){this.lastTouchPx=A.xy;return this.move(A)},mouseup:function(A){return this.up(A)},touchend:function(A){A.xy=this.lastTouchPx;return this.up(A)},down:function(A){this.mouseDown=true;this.lastDown=A.xy;if(!this.touch){this.modifyFeature(A.xy)}this.stoppedDown=this.stopDown;return !this.stopDown},move:function(A){if(!this.touch&&(!this.mouseDown||this.stoppedDown)){this.modifyFeature(A.xy)}return true},up:function(A){this.mouseDown=false;this.stoppedDown=this.stopDown;if(!this.checkModifiers(A)){return true}if(this.lastUp&&this.lastUp.equals(A.xy)){return true}if(this.lastDown&&this.passesTolerance(this.lastDown,A.xy,this.pixelTolerance)){if(this.touch){this.modifyFeature(A.xy)}if(this.persist){this.destroyPersistedFeature()}this.lastUp=A.xy;this.finalize();return !this.stopUp}else{return true}},mouseout:function(A){if(OpenLayers.Util.mouseLeft(A,this.map.viewPortDiv)){this.stoppedDown=this.stopDown;this.mouseDown=false}},passesTolerance:function(E,D,A){var B=true;if(A!=null&&E&&D){var C=E.distanceTo(D);if(C>A){B=false}}return B},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,maxVertices:null,doubleTouchTolerance:20,freehand:false,freehandToggle:"shiftKey",timerId:null,redoStack:null,createFeature:function(A){var B=this.layer.getLonLatFromViewPortPx(A);var C=new OpenLayers.Geometry.Point(B.lon,B.lat);this.point=new OpenLayers.Feature.Vector(C);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(A){OpenLayers.Handler.Point.prototype.destroyFeature.call(this,A);this.line=null},destroyPersistedFeature:function(){var A=this.layer;if(A&&A.features.length>2){this.layer.features[0].destroy()}},removePoint:function(){if(this.point){this.layer.removeFeatures([this.point])}},addPoint:function(A){this.layer.removeFeatures([this.point]);var B=this.layer.getLonLatFromViewPortPx(A);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(B.lon,B.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.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(A,B){this.line.geometry.addComponent(new OpenLayers.Geometry.Point(A,B),this.getCurrentPointIndex());this.drawFeature();delete this.redoStack},insertDeltaXY:function(B,A){var C=this.getCurrentPointIndex()-1;var D=this.line.geometry.components[C];if(D&&!isNaN(D.x)&&!isNaN(D.y)){this.insertXY(D.x+B,D.y+A)}},insertDirectionLength:function(D,C){D*=Math.PI/180;var B=C*Math.cos(D);var A=C*Math.sin(D);this.insertDeltaXY(B,A)},insertDeflectionLength:function(C,B){var D=this.getCurrentPointIndex()-1;if(D>0){var E=this.line.geometry.components[D];var F=this.line.geometry.components[D-1];var A=Math.atan2(E.y-F.y,E.x-F.x);this.insertDirectionLength((A*180/Math.PI)+C,B)}},getCurrentPointIndex:function(){return this.line.geometry.components.length-1},undo:function(){var E=this.line.geometry;var B=E.components;var A=this.getCurrentPointIndex()-1;var D=B[A];var C=E.removeComponent(D);if(C){if(!this.redoStack){this.redoStack=[]}this.redoStack.push(D);this.drawFeature()}return C},redo:function(){var A=this.redoStack&&this.redoStack.pop();if(A){this.line.geometry.addComponent(A,this.getCurrentPointIndex());this.drawFeature()}return !!A},freehandMode:function(A){return(this.freehandToggle&&A[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(B,A){if(!this.line){this.createFeature(B)}var C=this.layer.getLonLatFromViewPortPx(B);this.point.geometry.x=C.lon;this.point.geometry.y=C.lat;this.callback("modify",[this.point.geometry,this.getSketch(),A]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var A=this.line&&this.line.geometry;if(A&&this.multi){A=new OpenLayers.Geometry.MultiLineString([A])}return A},touchstart:function(A){if(this.timerId&&this.passesTolerance(this.lastTouchPx,A.xy,this.doubleTouchTolerance)){this.finishGeometry();window.clearTimeout(this.timerId);this.timerId=null;return false}else{if(this.timerId){window.clearTimeout(this.timerId);this.timerId=null}this.timerId=window.setTimeout(OpenLayers.Function.bind(function(){this.timerId=null},this),300);return OpenLayers.Handler.Point.prototype.touchstart.call(this,A)}},down:function(A){var B=this.stopDown;if(this.freehandMode(A)){B=true;if(this.touch){this.modifyFeature(A.xy,!!this.lastUp);OpenLayers.Event.stop(A)}}if(!this.touch&&(!this.lastDown||!this.passesTolerance(this.lastDown,A.xy,this.pixelTolerance))){this.modifyFeature(A.xy,!!this.lastUp)}this.mouseDown=true;this.lastDown=A.xy;this.stoppedDown=B;return !B},move:function(A){if(this.stoppedDown&&this.freehandMode(A)){if(this.persist){this.destroyPersistedFeature()}if(this.maxVertices&&this.line&&this.line.geometry.components.length===this.maxVertices){this.removePoint();this.finalize()}else{this.addPoint(A.xy)}return false}if(!this.touch&&(!this.mouseDown||this.stoppedDown)){this.modifyFeature(A.xy,!!this.lastUp)}return true},up:function(A){if(this.mouseDown&&(!this.lastUp||!this.lastUp.equals(A.xy))){if(this.stoppedDown&&this.freehandMode(A)){if(this.persist){this.destroyPersistedFeature()}this.removePoint();this.finalize()}else{if(this.passesTolerance(this.lastDown,A.xy,this.pixelTolerance)){if(this.touch){this.modifyFeature(A.xy)}if(this.lastUp==null&&this.persist){this.destroyPersistedFeature()}this.addPoint(A.xy);this.lastUp=A.xy;if(this.line.geometry.components.length===this.maxVertices+1){this.finishGeometry()}}}}this.stoppedDown=this.stopDown;this.mouseDown=false;return !this.stopUp},finishGeometry:function(){var A=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[A]);this.removePoint();this.finalize()},dblclick:function(A){if(!this.freehandMode(A)){this.finishGeometry()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Spherical=OpenLayers.Spherical||{};OpenLayers.Spherical.DEFAULT_RADIUS=6378137;OpenLayers.Spherical.computeDistanceBetween=function(G,F,A){var E=A||OpenLayers.Spherical.DEFAULT_RADIUS;var D=Math.sin(Math.PI*(F.lon-G.lon)/360);var C=Math.sin(Math.PI*(F.lat-G.lat)/360);var B=C*C+D*D*Math.cos(Math.PI*G.lat/180)*Math.cos(Math.PI*F.lat/180);return 2*E*Math.atan2(Math.sqrt(B),Math.sqrt(1-B))};OpenLayers.Spherical.computeHeading=function(D,C){var B=Math.sin(Math.PI*(D.lon-C.lon)/180)*Math.cos(Math.PI*C.lat/180);var A=Math.cos(Math.PI*D.lat/180)*Math.sin(Math.PI*C.lat/180)-Math.sin(Math.PI*D.lat/180)*Math.cos(Math.PI*C.lat/180)*Math.cos(Math.PI*(D.lon-C.lon)/180);return 180*Math.atan2(B,A)/Math.PI};OpenLayers.Control.CacheWrite=OpenLayers.Class(OpenLayers.Control,{layers:null,imageFormat:"image/png",quotaRegEx:(/quota/i),setMap:function(C){OpenLayers.Control.prototype.setMap.apply(this,arguments);var A,B=this.layers||C.layers;for(A=B.length-1;A>=0;--A){this.addLayer({layer:B[A]})}if(!this.layers){C.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})}},addLayer:function(A){A.layer.events.on({tileloadstart:this.makeSameOrigin,tileloaded:this.cache,scope:this})},removeLayer:function(A){A.layer.events.un({tileloadstart:this.makeSameOrigin,tileloaded:this.cache,scope:this})},makeSameOrigin:function(A){if(this.active){var C=A.tile;if(C instanceof OpenLayers.Tile.Image&&!C.crossOriginKeyword&&C.url.substr(0,5)!=="data:"){var B=OpenLayers.Request.makeSameOrigin(C.url,OpenLayers.ProxyHost);OpenLayers.Control.CacheWrite.urlMap[B]=C.url;C.url=B}}},cache:function(G){if(this.active&&window.localStorage){var C=G.tile;if(C instanceof OpenLayers.Tile.Image&&C.url.substr(0,5)!=="data:"){try{var A=C.getCanvasContext();if(A){var D=OpenLayers.Control.CacheWrite.urlMap;var B=D[C.url]||C.url;window.localStorage.setItem("olCache_"+B,A.canvas.toDataURL(this.imageFormat));delete D[C.url]}}catch(F){var E=F.name||F.message;if(E&&this.quotaRegEx.test(E)){this.events.triggerEvent("cachefull",{tile:C})}else{OpenLayers.Console.error(F.toString())}}}}},destroy:function(){if(this.layers||this.map){var A,B=this.layers||this.map.layers;for(A=B.length-1;A>=0;--A){this.removeLayer({layer:B[A]})}}if(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){return }var B,A;for(B=window.localStorage.length-1;B>=0;--B){A=window.localStorage.key(B);if(A.substr(0,8)==="olCache_"){window.localStorage.removeItem(A)}}};OpenLayers.Control.CacheWrite.urlMap={};OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{slideFactor:50,slideRatio:null,initialize:function(A){OpenLayers.Control.Panel.prototype.initialize.apply(this,[A]);var A={slideFactor:this.slideFactor,slideRatio:this.slideRatio};this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,A),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,A),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,A),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,A)])},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});this.updateAttribution();return this.div},updateAttribution:function(){var D=[];if(this.map&&this.map.layers){for(var C=0,A=this.map.layers.length;C<A;C++){var B=this.map.layers[C];if(B.attribution&&B.getVisibility()){if(OpenLayers.Util.indexOf(D,B.attribution)===-1){D.push(B.attribution)}}}this.div.innerHTML=OpenLayers.String.format(this.template,{layers:D.join(this.separator)})}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Kinetic=OpenLayers.Class({threshold:0,deceleration:0.0035,nbPoints:100,delay:200,points:undefined,timerId:undefined,initialize:function(A){OpenLayers.Util.extend(this,A)},begin:function(){OpenLayers.Animation.stop(this.timerId);this.timerId=undefined;this.points=[]},update:function(A){this.points.unshift({xy:A,tick:new Date().getTime()});if(this.points.length>this.nbPoints){this.points.pop()}},end:function(J){var I,A=new Date().getTime();for(var F=0,E=this.points.length,H;F<E;F++){H=this.points[F];if(A-H.tick>this.delay){break}I=H}if(!I){return }var D=new Date().getTime()-I.tick;var G=Math.sqrt(Math.pow(J.x-I.xy.x,2)+Math.pow(J.y-I.xy.y,2));var C=G/D;if(C==0||C<this.threshold){return }var B=Math.asin((J.y-I.xy.y)/G);if(I.xy.x<=J.x){B=Math.PI-B}return{speed:C,theta:B}},move:function(C,I){var H=C.speed;var F=Math.cos(C.theta);var E=-Math.sin(C.theta);var D=new Date().getTime();var B=0;var A=0;var G=function(){if(this.timerId==null){return }var M=new Date().getTime()-D;var N=(-this.deceleration*Math.pow(M,2))/2+H*M;var J=N*F;var O=N*E;var L={};L.end=false;var K=-this.deceleration*M+H;if(K<=0){OpenLayers.Animation.stop(this.timerId);this.timerId=null;L.end=true}L.x=J-B;L.y=O-A;B=J;A=O;I(L.x,L.y,L.end)};this.timerId=OpenLayers.Animation.start(OpenLayers.Function.bind(G,this))},CLASS_NAME:"OpenLayers.Kinetic"});OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:true,initialize:function(C,A,B){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[C,B]);this.location=A;this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadRSS:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this});this.loaded=true}},moveTo:function(C,A,B){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadRSS()}},parseData:function(I){var M=I.responseXML;if(!M||!M.documentElement){M=OpenLayers.Format.XML.prototype.read(I.responseText)}if(this.useFeedTitle){var A=null;try{A=M.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(H){A=M.getElementsByTagName("title")[0].firstChild.nodeValue}if(A){this.setName(A)}}var Q={};OpenLayers.Util.extend(Q,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){Q.externalProjection=this.projection;Q.internalProjection=this.map.getProjectionObject()}var N=new OpenLayers.Format.GeoRSS(Q);var B=N.read(M);for(var F=0,G=B.length;F<G;F++){var E={};var P=B[F];if(!P.geometry){continue}var K=P.attributes.title?P.attributes.title:"Untitled";var O=P.attributes.description?P.attributes.description:"No description.";var J=P.attributes.link?P.attributes.link:"";var L=P.geometry.getBounds().getCenterLonLat();E.icon=this.icon==null?OpenLayers.Marker.defaultIcon():this.icon.clone();E.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120);if(K||O){E.title=K;E.description=O;var C='<div class="olLayerGeoRSSClose">[x]</div>';C+='<div class="olLayerGeoRSSTitle">';if(J){C+='<a class="link" href="'+J+'" target="_blank">'}C+=K;if(J){C+="</a>"}C+="</div>";C+='<div style="" class="olLayerGeoRSSDescription">';C+=O;C+="</div>";E.popupContentHTML=C}var P=new OpenLayers.Feature(this,L,E);this.features.push(P);var D=P.createMarker();D.events.register("click",P,this.markerClick);this.addMarker(D)}this.events.triggerEvent("loadend")},markerClick:function(C){var E=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!E)?this:null;for(var D=0,A=this.layer.map.popups.length;D<A;D++){this.layer.map.removePopup(this.layer.map.popups[D])}if(!E){var B=this.createPopup();OpenLayers.Event.observe(B.div,"click",OpenLayers.Function.bind(function(){for(var G=0,F=this.layer.map.popups.length;G<F;G++){this.layer.map.removePopup(this.layer.map.popups[G])}},this));this.layer.map.addPopup(B)}OpenLayers.Event.stop(C)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var A=this.features[0];OpenLayers.Util.removeItem(this.features,A);A.destroy()}}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Format.WMSCapabilities.v1_3=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMS_Capabilities:function(A,B){this.readChildNodes(A,B)},LayerLimit:function(A,B){B.layerLimit=parseInt(this.getChildValue(A))},MaxWidth:function(A,B){B.maxWidth=parseInt(this.getChildValue(A))},MaxHeight:function(A,B){B.maxHeight=parseInt(this.getChildValue(A))},BoundingBox:function(A,B){var C=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[A,B]);C.srs=A.getAttribute("CRS");B.bbox[C.srs]=C},CRS:function(A,B){this.readers.wms.SRS.apply(this,[A,B])},EX_GeographicBoundingBox:function(A,B){B.llbbox=[];this.readChildNodes(A,B.llbbox)},westBoundLongitude:function(A,B){B[0]=this.getChildValue(A)},eastBoundLongitude:function(A,B){B[2]=this.getChildValue(A)},southBoundLatitude:function(A,B){B[1]=this.getChildValue(A)},northBoundLatitude:function(A,B){B[3]=this.getChildValue(A)},MinScaleDenominator:function(A,B){B.maxScale=parseFloat(this.getChildValue(A)).toPrecision(16)},MaxScaleDenominator:function(A,B){B.minScale=parseFloat(this.getChildValue(A)).toPrecision(16)},Dimension:function(B,D){var A=B.getAttribute("name").toLowerCase();var C={name:A,units:B.getAttribute("units"),unitsymbol:B.getAttribute("unitSymbol"),nearestVal:B.getAttribute("nearestValue")==="1",multipleVal:B.getAttribute("multipleValues")==="1","default":B.getAttribute("default")||"",current:B.getAttribute("current")==="1",values:this.getChildValue(B).split(",")};D.dimensions[C.name]=C},Keyword:function(B,C){var A={value:this.getChildValue(B),vocabulary:B.getAttribute("vocabulary")};if(C.keywords){C.keywords.push(A)}}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms),sld:{UserDefinedSymbolization:function(A,B){this.readers.wms.UserDefinedSymbolization.apply(this,[A,B]);B.userSymbols.inlineFeature=parseInt(A.getAttribute("InlineFeature"))==1;B.userSymbols.remoteWCS=parseInt(A.getAttribute("RemoteWCS"))==1},DescribeLayer:function(A,B){this.readers.wms.DescribeLayer.apply(this,[A,B])},GetLegendGraphic:function(A,B){this.readers.wms.GetLegendGraphic.apply(this,[A,B])}}},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:true,encodeBBOX:false,noMagic:false,yx:{},initialize:function(D,C,E,B){var A=[];E=OpenLayers.Util.upperCaseObject(E);if(parseFloat(E.VERSION)>=1.3&&!E.EXCEPTIONS){E.EXCEPTIONS="INIMAGE"}A.push(D,C,E,B);OpenLayers.Layer.Grid.prototype.initialize.apply(this,A);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((B==null)||(!B.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}},clone:function(A){if(A==null){A=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},reverseAxisOrder:function(){var A=this.projection.getCode();return parseFloat(this.params.VERSION)>=1.3&&!!(this.yx[A]||OpenLayers.Projection.defaults[A].yx)},getURL:function(C){C=this.adjustBounds(C);var D=this.getImageSize();var E={};var B=this.reverseAxisOrder();E.BBOX=this.encodeBBOX?C.toBBOX(null,B):C.toArray(B);E.WIDTH=D.w;E.HEIGHT=D.h;var A=this.getFullRequestString(E);return A},mergeNewParams:function(C){var B=OpenLayers.Util.upperCaseObject(C);var A=[B];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,A)},getFullRequestString:function(E,C){var B=this.map.getProjectionObject();var A=this.projection&&this.projection.equals(B)?this.projection.getCode():B.getCode();var D=(A=="none")?null:A;if(parseFloat(this.params.VERSION)>=1.3){this.params.CRS=D}else{this.params.SRS=D}if(typeof this.params.TRANSPARENT=="boolean"){E.TRANSPARENT=this.params.TRANSPARENT?"TRUE":"FALSE"}return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(C,B,D,A){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(C){C=this.adjustBounds(C);var D=this.map.getResolution();var E=Math.round((this.map.getScale()*10000))/10000;var B=Math.round(C.left/D);var A=-Math.round(C.top/D);return this.getFullRequestString({t:A,l:B,s:E})},calculateGridLayout:function(A,N,E){var K=E*this.tileSize.w;var C=E*this.tileSize.h;var I=A.left;var L=Math.floor(I/K)-this.buffer;var J=I/K-L;var F=-J*this.tileSize.w;var M=L*K;var B=A.top;var H=Math.ceil(B/C)+this.buffer;var O=H-B/C;var D=-(O+1)*this.tileSize.h;var G=H*C;return{tilelon:K,tilelat:C,tileoffsetlon:M,tileoffsetlat:G,tileoffsetx:F,tileoffsety:D}},clone:function(A){if(A==null){A=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);if(this.tileSize!=null){A.tileSize=this.tileSize.clone()}A.grid=[];return A},getTileBounds:function(C){var E=this.getResolution();var D=E*this.tileSize.w;var B=E*this.tileSize.h;var G=this.getLonLatFromViewPortPx(C);var A=D*Math.floor(G.lon/D);var F=B*Math.floor(G.lat/B);return new OpenLayers.Bounds(A,F,A+D,F+B)},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Format.WMC=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"1.1.0",layerToContext:function(C){var G=this.getParser();var E={queryable:C.queryable,visibility:C.visibility,name:C.params.LAYERS,title:C.name,"abstract":C.metadata["abstract"],dataURL:C.metadata.dataURL,metadataURL:C.metadataURL,server:{version:C.params.VERSION,url:C.url},maxExtent:C.maxExtent,transparent:C.params.TRANSPARENT,numZoomLevels:C.numZoomLevels,units:C.units,isBaseLayer:C.isBaseLayer,opacity:C.opacity==1?undefined:C.opacity,displayInLayerSwitcher:C.displayInLayerSwitcher,singleTile:C.singleTile,tileSize:(C.singleTile||!C.tileSize)?undefined:{width:C.tileSize.w,height:C.tileSize.h},minScale:(C.options.resolutions||C.options.scales||C.options.maxResolution||C.options.minScale)?C.minScale:undefined,maxScale:(C.options.resolutions||C.options.scales||C.options.minResolution||C.options.maxScale)?C.maxScale:undefined,formats:[],styles:[],srs:C.srs,dimensions:C.dimensions};if(C.metadata.servertitle){E.server.title=C.metadata.servertitle}if(C.metadata.formats&&C.metadata.formats.length>0){for(var B=0,A=C.metadata.formats.length;B<A;B++){var F=C.metadata.formats[B];E.formats.push({value:F.value,current:(F.value==C.params.FORMAT)})}}else{E.formats.push({value:C.params.FORMAT,current:true})}if(C.metadata.styles&&C.metadata.styles.length>0){for(var B=0,A=C.metadata.styles.length;B<A;B++){var D=C.metadata.styles[B];if((D.href==C.params.SLD)||(D.body==C.params.SLD_BODY)||(D.name==C.params.STYLES)){D.current=true}else{D.current=false}E.styles.push(D)}}else{E.styles.push({href:C.params.SLD,body:C.params.SLD_BODY,name:C.params.STYLES||G.defaultStyleName,title:G.defaultStyleTitle,current:true})}return E},toContext:function(G){var E={};var F=G.layers;if(G.CLASS_NAME=="OpenLayers.Map"){var D=G.metadata||{};E.size=G.getSize();E.bounds=G.getExtent();E.projection=G.projection;E.title=G.title;E.keywords=D.keywords;E["abstract"]=D["abstract"];E.logo=D.logo;E.descriptionURL=D.descriptionURL;E.contactInformation=D.contactInformation;E.maxExtent=G.maxExtent}else{OpenLayers.Util.applyDefaults(E,G);if(E.layers!=undefined){delete (E.layers)}}if(E.layersContext==undefined){E.layersContext=[]}if(F!=undefined&&OpenLayers.Util.isArray(F)){for(var C=0,A=F.length;C<A;C++){var B=F[C];if(B instanceof OpenLayers.Layer.WMS){E.layersContext.push(this.layerToContext(B))}}}return E},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(A){var B=null;if(A==null){B=this.namespaces[this.defaultPrefix]}else{for(B in this.namespaces){if(this.namespaces[B]==A){break}}}return B},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"Default",initialize:function(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(C){if(typeof C=="string"){C=OpenLayers.Format.XML.prototype.read.apply(this,[C])}var A=C.documentElement;this.rootPrefix=A.prefix;var B={version:A.getAttribute("version")};this.runChildNodes(B,A);return B},runChildNodes:function(E,D){var B=D.childNodes;var A,C,G,I;for(var F=0,H=B.length;F<H;++F){A=B[F];if(A.nodeType==1){G=this.getNamespacePrefix(A.namespaceURI);I=A.nodeName.split(":").pop();C=this["read_"+G+"_"+I];if(C){C.apply(this,[E,A])}}}},read_wmc_General:function(A,B){this.runChildNodes(A,B)},read_wmc_BoundingBox:function(A,B){A.projection=B.getAttribute("SRS");A.bounds=new OpenLayers.Bounds(B.getAttribute("minx"),B.getAttribute("miny"),B.getAttribute("maxx"),B.getAttribute("maxy"))},read_wmc_LayerList:function(A,B){A.layersContext=[];this.runChildNodes(A,B)},read_wmc_Layer:function(A,B){var C={visibility:(B.getAttribute("hidden")!="1"),queryable:(B.getAttribute("queryable")=="1"),formats:[],styles:[],metadata:{}};this.runChildNodes(C,B);A.layersContext.push(C)},read_wmc_Extension:function(B,A){this.runChildNodes(B,A)},read_ol_units:function(B,A){B.units=this.getChildValue(A)},read_ol_maxExtent:function(C,B){var A=new OpenLayers.Bounds(B.getAttribute("minx"),B.getAttribute("miny"),B.getAttribute("maxx"),B.getAttribute("maxy"));C.maxExtent=A},read_ol_transparent:function(B,A){B.transparent=this.getChildValue(A)},read_ol_numZoomLevels:function(B,A){B.numZoomLevels=parseInt(this.getChildValue(A))},read_ol_opacity:function(B,A){B.opacity=parseFloat(this.getChildValue(A))},read_ol_singleTile:function(B,A){B.singleTile=(this.getChildValue(A)=="true")},read_ol_tileSize:function(B,A){var C={width:A.getAttribute("width"),height:A.getAttribute("height")};B.tileSize=C},read_ol_isBaseLayer:function(B,A){B.isBaseLayer=(this.getChildValue(A)=="true")},read_ol_displayInLayerSwitcher:function(B,A){B.displayInLayerSwitcher=(this.getChildValue(A)=="true")},read_wmc_Server:function(B,A){B.version=A.getAttribute("version");B.url=this.getOnlineResource_href(A);B.metadata.servertitle=A.getAttribute("title")},read_wmc_FormatList:function(B,A){this.runChildNodes(B,A)},read_wmc_Format:function(B,A){var C={value:this.getChildValue(A)};if(A.getAttribute("current")=="1"){C.current=true}B.formats.push(C)},read_wmc_StyleList:function(B,A){this.runChildNodes(B,A)},read_wmc_Style:function(C,B){var A={};this.runChildNodes(A,B);if(B.getAttribute("current")=="1"){A.current=true}C.styles.push(A)},read_wmc_SLD:function(A,B){this.runChildNodes(A,B)},read_sld_StyledLayerDescriptor:function(C,B){var A=OpenLayers.Format.XML.prototype.write.apply(this,[B]);C.body=A},read_sld_FeatureTypeStyle:function(C,B){var A=OpenLayers.Format.XML.prototype.write.apply(this,[B]);C.body=A},read_wmc_OnlineResource:function(B,A){B.href=this.getAttributeNS(A,this.namespaces.xlink,"href")},read_wmc_Name:function(C,B){var A=this.getChildValue(B);if(A){C.name=A}},read_wmc_Title:function(B,A){var C=this.getChildValue(A);if(C){B.title=C}},read_wmc_MetadataURL:function(B,A){B.metadataURL=this.getOnlineResource_href(A)},read_wmc_KeywordList:function(A,B){A.keywords=[];this.runChildNodes(A.keywords,B)},read_wmc_Keyword:function(A,B){A.push(this.getChildValue(B))},read_wmc_Abstract:function(C,B){var A=this.getChildValue(B);if(A){C["abstract"]=A}},read_wmc_LogoURL:function(A,B){A.logo={width:B.getAttribute("width"),height:B.getAttribute("height"),format:B.getAttribute("format"),href:this.getOnlineResource_href(B)}},read_wmc_DescriptionURL:function(A,B){A.descriptionURL=this.getOnlineResource_href(B)},read_wmc_ContactInformation:function(C,B){var A={};this.runChildNodes(A,B);C.contactInformation=A},read_wmc_ContactPersonPrimary:function(B,C){var A={};this.runChildNodes(A,C);B.personPrimary=A},read_wmc_ContactPerson:function(B,C){var A=this.getChildValue(C);if(A){B.person=A}},read_wmc_ContactOrganization:function(B,C){var A=this.getChildValue(C);if(A){B.organization=A}},read_wmc_ContactPosition:function(B,C){var A=this.getChildValue(C);if(A){B.position=A}},read_wmc_ContactAddress:function(A,B){var C={};this.runChildNodes(C,B);A.contactAddress=C},read_wmc_AddressType:function(C,B){var A=this.getChildValue(B);if(A){C.type=A}},read_wmc_Address:function(C,B){var A=this.getChildValue(B);if(A){C.address=A}},read_wmc_City:function(C,A){var B=this.getChildValue(A);if(B){C.city=B}},read_wmc_StateOrProvince:function(C,A){var B=this.getChildValue(A);if(B){C.stateOrProvince=B}},read_wmc_PostCode:function(C,B){var A=this.getChildValue(B);if(A){C.postcode=A}},read_wmc_Country:function(C,A){var B=this.getChildValue(A);if(B){C.country=B}},read_wmc_ContactVoiceTelephone:function(A,C){var B=this.getChildValue(C);if(B){A.phone=B}},read_wmc_ContactFacsimileTelephone:function(A,C){var B=this.getChildValue(C);if(B){A.fax=B}},read_wmc_ContactElectronicMailAddress:function(A,C){var B=this.getChildValue(C);if(B){A.email=B}},read_wmc_DataURL:function(B,A){B.dataURL=this.getOnlineResource_href(A)},read_wmc_LegendURL:function(B,C){var A={width:C.getAttribute("width"),height:C.getAttribute("height"),format:C.getAttribute("format"),href:this.getOnlineResource_href(C)};B.legend=A},read_wmc_DimensionList:function(B,A){B.dimensions={};this.runChildNodes(B.dimensions,A)},read_wmc_Dimension:function(D,C){var B=C.getAttribute("name").toLowerCase();var E={name:B,units:C.getAttribute("units")||"",unitSymbol:C.getAttribute("unitSymbol")||"",userValue:C.getAttribute("userValue")||"",nearestValue:C.getAttribute("nearestValue")==="1",multipleValues:C.getAttribute("multipleValues")==="1",current:C.getAttribute("current")==="1","default":C.getAttribute("default")||""};var A=this.getChildValue(C);E.values=A.split(",");D[E.name]=E},write:function(C,B){var A=this.createElementDefaultNS("ViewContext");this.setAttributes(A,{version:this.VERSION,id:(B&&typeof B.id=="string")?B.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")});this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);A.appendChild(this.write_wmc_General(C));A.appendChild(this.write_wmc_LayerList(C));return OpenLayers.Format.XML.prototype.write.apply(this,[A])},createElementDefaultNS:function(C,B,A){var D=this.createElementNS(this.namespaces[this.defaultPrefix],C);if(B){D.appendChild(this.createTextNode(B))}if(A){this.setAttributes(D,A)}return D},setAttributes:function(B,D){var C;for(var A in D){C=D[A].toString();if(C.match(/[A-Z]/)){this.setAttributeNS(B,null,A,C)}else{B.setAttribute(A,C)}}},write_wmc_General:function(A){var C=this.createElementDefaultNS("General");if(A.size){C.appendChild(this.createElementDefaultNS("Window",null,{width:A.size.w,height:A.size.h}))}var B=A.bounds;C.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:B.left.toPrecision(18),miny:B.bottom.toPrecision(18),maxx:B.right.toPrecision(18),maxy:B.top.toPrecision(18),SRS:A.projection}));C.appendChild(this.createElementDefaultNS("Title",A.title));if(A.keywords){C.appendChild(this.write_wmc_KeywordList(A.keywords))}if(A["abstract"]){C.appendChild(this.createElementDefaultNS("Abstract",A["abstract"]))}if(A.logo){C.appendChild(this.write_wmc_URLType("LogoURL",A.logo.href,A.logo))}if(A.descriptionURL){C.appendChild(this.write_wmc_URLType("DescriptionURL",A.descriptionURL))}if(A.contactInformation){C.appendChild(this.write_wmc_ContactInformation(A.contactInformation))}C.appendChild(this.write_ol_MapExtension(A));return C},write_wmc_KeywordList:function(C){var D=this.createElementDefaultNS("KeywordList");for(var B=0,A=C.length;B<A;B++){D.appendChild(this.createElementDefaultNS("Keyword",C[B]))}return D},write_wmc_ContactInformation:function(A){var B=this.createElementDefaultNS("ContactInformation");if(A.personPrimary){B.appendChild(this.write_wmc_ContactPersonPrimary(A.personPrimary))}if(A.position){B.appendChild(this.createElementDefaultNS("ContactPosition",A.position))}if(A.contactAddress){B.appendChild(this.write_wmc_ContactAddress(A.contactAddress))}if(A.phone){B.appendChild(this.createElementDefaultNS("ContactVoiceTelephone",A.phone))}if(A.fax){B.appendChild(this.createElementDefaultNS("ContactFacsimileTelephone",A.fax))}if(A.email){B.appendChild(this.createElementDefaultNS("ContactElectronicMailAddress",A.email))}return B},write_wmc_ContactPersonPrimary:function(A){var B=this.createElementDefaultNS("ContactPersonPrimary");if(A.person){B.appendChild(this.createElementDefaultNS("ContactPerson",A.person))}if(A.organization){B.appendChild(this.createElementDefaultNS("ContactOrganization",A.organization))}return B},write_wmc_ContactAddress:function(B){var A=this.createElementDefaultNS("ContactAddress");if(B.type){A.appendChild(this.createElementDefaultNS("AddressType",B.type))}if(B.address){A.appendChild(this.createElementDefaultNS("Address",B.address))}if(B.city){A.appendChild(this.createElementDefaultNS("City",B.city))}if(B.stateOrProvince){A.appendChild(this.createElementDefaultNS("StateOrProvince",B.stateOrProvince))}if(B.postcode){A.appendChild(this.createElementDefaultNS("PostCode",B.postcode))}if(B.country){A.appendChild(this.createElementDefaultNS("Country",B.country))}return A},write_ol_MapExtension:function(B){var D=this.createElementDefaultNS("Extension");var C=B.maxExtent;if(C){var A=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(A,{minx:C.left.toPrecision(18),miny:C.bottom.toPrecision(18),maxx:C.right.toPrecision(18),maxy:C.top.toPrecision(18)});D.appendChild(A)}return D},write_wmc_LayerList:function(C){var D=this.createElementDefaultNS("LayerList");for(var B=0,A=C.layersContext.length;B<A;++B){D.appendChild(this.write_wmc_Layer(C.layersContext[B]))}return D},write_wmc_Layer:function(A){var B=this.createElementDefaultNS("Layer",null,{queryable:A.queryable?"1":"0",hidden:A.visibility?"0":"1"});B.appendChild(this.write_wmc_Server(A));B.appendChild(this.createElementDefaultNS("Name",A.name));B.appendChild(this.createElementDefaultNS("Title",A.title));if(A["abstract"]){B.appendChild(this.createElementDefaultNS("Abstract",A["abstract"]))}if(A.dataURL){B.appendChild(this.write_wmc_URLType("DataURL",A.dataURL))}if(A.metadataURL){B.appendChild(this.write_wmc_URLType("MetadataURL",A.metadataURL))}return B},write_wmc_LayerExtension:function(B){var D=this.createElementDefaultNS("Extension");var A=B.maxExtent;var H=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(H,{minx:A.left.toPrecision(18),miny:A.bottom.toPrecision(18),maxx:A.right.toPrecision(18),maxy:A.top.toPrecision(18)});D.appendChild(H);if(B.tileSize&&!B.singleTile){var I=this.createElementNS(this.namespaces.ol,"ol:tileSize");this.setAttributes(I,B.tileSize);D.appendChild(I)}var G=["transparent","numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"];var C;for(var E=0,F=G.length;E<F;++E){C=this.createOLPropertyNode(B,G[E]);if(C){D.appendChild(C)}}return D},createOLPropertyNode:function(B,C){var A=null;if(B[C]!=null){A=this.createElementNS(this.namespaces.ol,"ol:"+C);A.appendChild(this.createTextNode(B[C].toString()))}return A},write_wmc_Server:function(B){var D=B.server;var C=this.createElementDefaultNS("Server");var A={service:"OGC:WMS",version:D.version};if(D.title){A.title=D.title}this.setAttributes(C,A);C.appendChild(this.write_wmc_OnlineResource(D.url));return C},write_wmc_URLType:function(F,B,A){var E=this.createElementDefaultNS(F);E.appendChild(this.write_wmc_OnlineResource(B));if(A){var D=["width","height","format"];for(var C=0;C<D.length;C++){if(D[C] in A){E.setAttribute(D[C],A[D[C]])}}}return E},write_wmc_DimensionList:function(E){var F=this.createElementDefaultNS("DimensionList");var D={name:true,units:true,unitSymbol:true,userValue:true};for(var H in E.dimensions){var B={};var G=E.dimensions[H];for(var C in G){if(typeof G[C]=="boolean"){B[C]=Number(G[C])}else{B[C]=G[C]}}var A="";if(B.values){A=B.values.join(",");delete B.values}F.appendChild(this.createElementDefaultNS("Dimension",A,B))}return F},write_wmc_FormatList:function(C){var D=this.createElementDefaultNS("FormatList");for(var B=0,A=C.formats.length;B<A;B++){var E=C.formats[B];D.appendChild(this.createElementDefaultNS("Format",E.value,(E.current&&E.current==true)?{current:"1"}:null))}return D},write_wmc_StyleList:function(E){var C=this.createElementDefaultNS("StyleList");var J=E.styles;if(J&&OpenLayers.Util.isArray(J)){var A;for(var D=0,F=J.length;D<F;D++){var K=J[D];var B=this.createElementDefaultNS("Style",null,(K.current&&K.current==true)?{current:"1"}:null);if(K.href){A=this.createElementDefaultNS("SLD");if(K.name){A.appendChild(this.createElementDefaultNS("Name",K.name))}if(K.title){A.appendChild(this.createElementDefaultNS("Title",K.title))}if(K.legend){A.appendChild(this.write_wmc_URLType("LegendURL",K.legend.href,K.legend))}var G=this.write_wmc_OnlineResource(K.href);A.appendChild(G);B.appendChild(A)}else{if(K.body){A=this.createElementDefaultNS("SLD");if(K.name){A.appendChild(this.createElementDefaultNS("Name",K.name))}if(K.title){A.appendChild(this.createElementDefaultNS("Title",K.title))}if(K.legend){A.appendChild(this.write_wmc_URLType("LegendURL",K.legend.href,K.legend))}var H=OpenLayers.Format.XML.prototype.read.apply(this,[K.body]);var I=H.documentElement;if(A.ownerDocument&&A.ownerDocument.importNode){I=A.ownerDocument.importNode(I,true)}A.appendChild(I);B.appendChild(A)}else{B.appendChild(this.createElementDefaultNS("Name",K.name));B.appendChild(this.createElementDefaultNS("Title",K.title));if(K["abstract"]){B.appendChild(this.createElementDefaultNS("Abstract",K["abstract"]))}if(K.legend){B.appendChild(this.write_wmc_URLType("LegendURL",K.legend.href,K.legend))}}}C.appendChild(B)}}return C},write_wmc_OnlineResource:function(A){var B=this.createElementDefaultNS("OnlineResource");this.setAttributeNS(B,this.namespaces.xlink,"xlink:type","simple");this.setAttributeNS(B,this.namespaces.xlink,"xlink:href",A);return B},getOnlineResource_href:function(C){var B={};var A=C.getElementsByTagName("OnlineResource");if(A.length>0){this.read_wmc_OnlineResource(B,A[0])}return B.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(A){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[A])},read_sld_MinScaleDenominator:function(C,B){var A=parseFloat(this.getChildValue(B));if(A>0){C.maxScale=A}},read_sld_MaxScaleDenominator:function(B,A){B.minScale=parseFloat(this.getChildValue(A))},read_wmc_SRS:function(B,A){if(!("srs" in B)){B.srs={}}B.srs[this.getChildValue(A)]=true},write_wmc_Layer:function(C){var D=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[C]);if(C.maxScale){var E=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");E.appendChild(this.createTextNode(C.maxScale.toPrecision(16)));D.appendChild(E)}if(C.minScale){var A=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator");A.appendChild(this.createTextNode(C.minScale.toPrecision(16)));D.appendChild(A)}if(C.srs){for(var B in C.srs){D.appendChild(this.createElementDefaultNS("SRS",B))}}D.appendChild(this.write_wmc_FormatList(C));D.appendChild(this.write_wmc_StyleList(C));if(C.dimensions){D.appendChild(this.write_wmc_DimensionList(C))}D.appendChild(this.write_wmc_LayerExtension(C));return D},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Format.XLS=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",stringifyOutput:true,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:true,defaultPrefix:"xls",schemaLocation:null,read:function(C,A){A=OpenLayers.Util.applyDefaults(A,this.options);var B={};this.readChildNodes(C,B);return B},readers:{xls:{XLS:function(B,A){A.version=B.getAttribute("version");this.readChildNodes(B,A)},Response:function(B,A){this.readChildNodes(B,A)},GeocodeResponse:function(B,A){A.responseLists=[];this.readChildNodes(B,A)},GeocodeResponseList:function(C,B){var A={features:[],numberOfGeocodedAddresses:parseInt(C.getAttribute("numberOfGeocodedAddresses"))};B.responseLists.push(A);this.readChildNodes(C,A)},GeocodedAddress:function(C,B){var A=new OpenLayers.Feature.Vector();B.features.push(A);this.readChildNodes(C,A);A.geometry=A.components[0]},GeocodeMatchCode:function(B,A){A.attributes.matchCode={accuracy:parseFloat(B.getAttribute("accuracy")),matchType:B.getAttribute("matchType")}},Address:function(C,B){var A={countryCode:C.getAttribute("countryCode"),addressee:C.getAttribute("addressee"),street:[],place:[]};B.attributes.address=A;this.readChildNodes(C,A)},freeFormAddress:function(B,A){A.freeFormAddress=this.getChildValue(B)},StreetAddress:function(B,A){this.readChildNodes(B,A)},Building:function(B,A){A.building={number:B.getAttribute("number"),subdivision:B.getAttribute("subdivision"),buildingName:B.getAttribute("buildingName")}},Street:function(B,A){A.street.push(this.getChildValue(B))},Place:function(B,A){A.place[B.getAttribute("type")]=this.getChildValue(B)},PostalCode:function(B,A){A.postalCode=this.getChildValue(B)}},gml:OpenLayers.Format.GML.v3.prototype.readers.gml},write:function(A){return this.writers.xls.XLS.apply(this,[A])},writers:{xls:{XLS:function(B){var A=this.createElementNSPlus("xls:XLS",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});this.writeNode("RequestHeader",B.header,A);this.writeNode("Request",B,A);return A},RequestHeader:function(A){return this.createElementNSPlus("xls:RequestHeader")},Request:function(B){var A=this.createElementNSPlus("xls:Request",{attributes:{methodName:"GeocodeRequest",requestID:B.requestID||"",version:this.VERSION}});this.writeNode("GeocodeRequest",B.addresses,A);return A},GeocodeRequest:function(D){var C=this.createElementNSPlus("xls:GeocodeRequest");for(var B=0,A=D.length;B<A;B++){this.writeNode("Address",D[B],C)}return C},Address:function(A){var B=this.createElementNSPlus("xls:Address",{attributes:{countryCode:A.countryCode}});if(A.freeFormAddress){this.writeNode("freeFormAddress",A.freeFormAddress,B)}else{if(A.street){this.writeNode("StreetAddress",A,B)}if(A.municipality){this.writeNode("Municipality",A.municipality,B)}if(A.countrySubdivision){this.writeNode("CountrySubdivision",A.countrySubdivision,B)}if(A.postalCode){this.writeNode("PostalCode",A.postalCode,B)}}return B},freeFormAddress:function(A){return this.createElementNSPlus("freeFormAddress",{value:A})},StreetAddress:function(B){var D=this.createElementNSPlus("xls:StreetAddress");if(B.building){this.writeNode(D,"Building",B.building)}var E=B.street;if(!(OpenLayers.Util.isArray(E))){E=[E]}for(var C=0,A=E.length;C<A;C++){this.writeNode("Street",E[C],D)}return D},Building:function(A){return this.createElementNSPlus("xls:Building",{attributes:{number:A.number,subdivision:A.subdivision,buildingName:A.buildingName}})},Street:function(A){return this.createElementNSPlus("xls:Street",{value:A})},Municipality:function(A){return this.createElementNSPlus("xls:Place",{attributes:{type:"Municipality"},value:A})},CountrySubdivision:function(A){return this.createElementNSPlus("xls:Place",{attributes:{type:"CountrySubdivision"},value:A})},PostalCode:function(A){return this.createElementNSPlus("xls:PostalCode",{value:A})}}},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:15000,translationParameters:null,symbolMetrics:null,initialize:function(A){if(!this.supported()){return }OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.symbolMetrics={}},supported:function(){var A="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(A+"SVG","1.1")||document.implementation.hasFeature(A+"BasicStructure","1.1")))},inValidRange:function(A,E,B){var D=A+(B?0:this.translationParameters.x);var C=E+(B?0:this.translationParameters.y);return(D>=-this.MAX_PIXEL&&D<=this.MAX_PIXEL&&C>=-this.MAX_PIXEL&&C<=this.MAX_PIXEL)},setExtent:function(C,E){var B=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var A=this.getResolution(),G=-C.left/A,F=C.top/A;if(E){this.left=G;this.top=F;var D="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",D);this.translate(this.xOffset,0);return true}else{var H=this.translate(G-this.left+this.xOffset,F-this.top);if(!H){this.setExtent(C,true)}return B&&H}},translate:function(A,C){if(!this.inValidRange(A,C,true)){return false}else{var B="";if(A||C){B="translate("+A+","+C+")"}this.root.setAttributeNS(null,"transform",B);this.translationParameters={x:A,y:C};return true}},setSize:function(A){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(C,B){var A=null;switch(C.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.externalGraphic){A="image"}else{if(this.isComplexSymbol(B.graphicName)){A="svg"}else{A="circle"}}break;case"OpenLayers.Geometry.Rectangle":A="rect";break;case"OpenLayers.Geometry.LineString":A="polyline";break;case"OpenLayers.Geometry.LinearRing":A="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":A="path";break;default:break}return A},setStyle:function(P,S,B){S=S||P._style;B=B||P._options;var K=parseFloat(P.getAttributeNS(null,"r"));var J=1;var D;if(P._geometryClass=="OpenLayers.Geometry.Point"&&K){P.style.visibility="";if(S.graphic===false){P.style.visibility="hidden"}else{if(S.externalGraphic){D=this.getPosition(P);if(S.graphicTitle){P.setAttributeNS(null,"title",S.graphicTitle);var O=P.getElementsByTagName("title");if(O.length>0){O[0].firstChild.textContent=S.graphicTitle}else{var F=this.nodeFactory(null,"title");F.textContent=S.graphicTitle;P.appendChild(F)}}if(S.graphicWidth&&S.graphicHeight){P.setAttributeNS(null,"preserveAspectRatio","none")}var N=S.graphicWidth||S.graphicHeight;var M=S.graphicHeight||S.graphicWidth;N=N?N:S.pointRadius*2;M=M?M:S.pointRadius*2;var T=(S.graphicXOffset!=undefined)?S.graphicXOffset:-(0.5*N);var G=(S.graphicYOffset!=undefined)?S.graphicYOffset:-(0.5*M);var A=S.graphicOpacity||S.fillOpacity;P.setAttributeNS(null,"x",(D.x+T).toFixed());P.setAttributeNS(null,"y",(D.y+G).toFixed());P.setAttributeNS(null,"width",N);P.setAttributeNS(null,"height",M);P.setAttributeNS(this.xlinkns,"href",S.externalGraphic);P.setAttributeNS(null,"style","opacity: "+A);P.onclick=OpenLayers.Renderer.SVG.preventDefault}else{if(this.isComplexSymbol(S.graphicName)){var C=S.pointRadius*3;var L=C*2;var E=this.importSymbol(S.graphicName);D=this.getPosition(P);J=this.symbolMetrics[E.id][0]*3/L;var H=P.parentNode;var I=P.nextSibling;if(H){H.removeChild(P)}P.firstChild&&P.removeChild(P.firstChild);P.appendChild(E.firstChild.cloneNode(true));P.setAttributeNS(null,"viewBox",E.getAttributeNS(null,"viewBox"));P.setAttributeNS(null,"width",L);P.setAttributeNS(null,"height",L);P.setAttributeNS(null,"x",D.x-C);P.setAttributeNS(null,"y",D.y-C);if(I){H.insertBefore(P,I)}else{if(H){H.appendChild(P)}}}else{P.setAttributeNS(null,"r",S.pointRadius)}}}var R=S.rotation;if((R!==undefined||P._rotation!==undefined)&&D){P._rotation=R;R|=0;if(P.nodeName!=="svg"){P.setAttributeNS(null,"transform","rotate("+R+" "+D.x+" "+D.y+")")}else{var Q=this.symbolMetrics[E.id];P.firstChild.setAttributeNS(null,"transform","rotate("+R+" "+Q[1]+" "+Q[2]+")")}}}if(B.isFilled){P.setAttributeNS(null,"fill",S.fillColor);P.setAttributeNS(null,"fill-opacity",S.fillOpacity)}else{P.setAttributeNS(null,"fill","none")}if(B.isStroked){P.setAttributeNS(null,"stroke",S.strokeColor);P.setAttributeNS(null,"stroke-opacity",S.strokeOpacity);P.setAttributeNS(null,"stroke-width",S.strokeWidth*J);P.setAttributeNS(null,"stroke-linecap",S.strokeLinecap||"round");P.setAttributeNS(null,"stroke-linejoin","round");S.strokeDashstyle&&P.setAttributeNS(null,"stroke-dasharray",this.dashStyle(S,J))}else{P.setAttributeNS(null,"stroke","none")}if(S.pointerEvents){P.setAttributeNS(null,"pointer-events",S.pointerEvents)}if(S.cursor!=null){P.setAttributeNS(null,"cursor",S.cursor)}return P},dashStyle:function(C,B){var A=C.strokeWidth*B;var D=C.strokeDashstyle;switch(D){case"solid":return"none";case"dot":return[1,4*A].join();case"dash":return[4*A,4*A].join();case"dashdot":return[4*A,4*A,1,4*A].join();case"longdash":return[8*A,4*A].join();case"longdashdot":return[8*A,4*A,1,4*A].join();default:return OpenLayers.String.trim(D).replace(/\s+/g,",")}},createNode:function(A,C){var B=document.createElementNS(this.xmlns,A);if(C){B.setAttributeNS(null,"id",C)}return B},nodeTypeCompare:function(B,A){return(A==B.nodeName)},createRenderRoot:function(){var A=this.nodeFactory(this.container.id+"_svgRoot","svg");A.style.display="block";return A},createRoot:function(A){return this.nodeFactory(this.container.id+A,"g")},createDefs:function(){var A=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(A);return A},drawPoint:function(A,B){return this.drawCircle(A,B,1)},drawCircle:function(D,E,B){var C=this.getResolution();var A=((E.x-this.featureDx)/C+this.left);var F=(this.top-E.y/C);if(this.inValidRange(A,F)){D.setAttributeNS(null,"cx",A);D.setAttributeNS(null,"cy",F);D.setAttributeNS(null,"r",B);return D}else{return false}},drawLineString:function(B,C){var A=this.getComponentsString(C.components);if(A.path){B.setAttributeNS(null,"points",A.path);return(A.complete?B:null)}else{return false}},drawLinearRing:function(B,C){var A=this.getComponentsString(C.components);if(A.path){B.setAttributeNS(null,"points",A.path);return(A.complete?B:null)}else{return false}},drawPolygon:function(B,G){var F="";var H=true;var A=true;var C,I;for(var D=0,E=G.components.length;D<E;D++){F+=" M";C=this.getComponentsString(G.components[D].components," ");I=C.path;if(I){F+=" "+I;A=C.complete&&A}else{H=false}}F+=" z";if(H){B.setAttributeNS(null,"d",F);B.setAttributeNS(null,"fill-rule","evenodd");return A?B:null}else{return false}},drawRectangle:function(C,D){var B=this.getResolution();var A=((D.x-this.featureDx)/B+this.left);var E=(this.top-D.y/B);if(this.inValidRange(A,E)){C.setAttributeNS(null,"x",A);C.setAttributeNS(null,"y",E);C.setAttributeNS(null,"width",D.width/B);C.setAttributeNS(null,"height",D.height/B);return C}else{return false}},drawText:function(F,B,O){var A=(!!B.labelOutlineWidth);if(A){var K=OpenLayers.Util.extend({},B);K.fontColor=K.labelOutlineColor;K.fontStrokeColor=K.labelOutlineColor;K.fontStrokeWidth=B.labelOutlineWidth;delete K.labelOutlineWidth;this.drawText(F,K,O)}var C=this.getResolution();var N=((O.x-this.featureDx)/C+this.left);var J=(O.y/C-this.top);var P=(A)?this.LABEL_OUTLINE_SUFFIX:this.LABEL_ID_SUFFIX;var M=this.nodeFactory(F+P,"text");M.setAttributeNS(null,"x",N);M.setAttributeNS(null,"y",-J);if(B.fontColor){M.setAttributeNS(null,"fill",B.fontColor)}if(B.fontStrokeColor){M.setAttributeNS(null,"stroke",B.fontStrokeColor)}if(B.fontStrokeWidth){M.setAttributeNS(null,"stroke-width",B.fontStrokeWidth)}if(B.fontOpacity){M.setAttributeNS(null,"opacity",B.fontOpacity)}if(B.fontFamily){M.setAttributeNS(null,"font-family",B.fontFamily)}if(B.fontSize){M.setAttributeNS(null,"font-size",B.fontSize)}if(B.fontWeight){M.setAttributeNS(null,"font-weight",B.fontWeight)}if(B.fontStyle){M.setAttributeNS(null,"font-style",B.fontStyle)}if(B.labelSelect===true){M.setAttributeNS(null,"pointer-events","visible");M._featureId=F}else{M.setAttributeNS(null,"pointer-events","none")}var H=B.labelAlign||OpenLayers.Renderer.defaultSymbolizer.labelAlign;M.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[H[0]]||"middle");if(OpenLayers.IS_GECKO===true){M.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[H[1]]||"central")}var D=B.label.split("\n");var G=D.length;while(M.childNodes.length>G){M.removeChild(M.lastChild)}for(var E=0;E<G;E++){var I=this.nodeFactory(F+P+"_tspan_"+E,"tspan");if(B.labelSelect===true){I._featureId=F;I._geometry=O;I._geometryClass=O.CLASS_NAME}if(OpenLayers.IS_GECKO===false){I.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[H[1]]||"-35%")}I.setAttribute("x",N);if(E==0){var L=OpenLayers.Renderer.SVG.LABEL_VFACTOR[H[1]];if(L==null){L=-0.5}I.setAttribute("dy",(L*(G-1))+"em")}else{I.setAttribute("dy","1em")}I.textContent=(D[E]==="")?" ":D[E];if(!I.parentNode){M.appendChild(I)}}if(!M.parentNode){this.textRoot.appendChild(M)}},getComponentsString:function(D,C){var F=[];var A=true;var E=D.length;var I=[];var G,H;for(var B=0;B<E;B++){H=D[B];F.push(H);G=this.getShortString(H);if(G){I.push(G)}else{if(B>0){if(this.getShortString(D[B-1])){I.push(this.clipLine(D[B],D[B-1]))}}if(B<E-1){if(this.getShortString(D[B+1])){I.push(this.clipLine(D[B],D[B+1]))}}A=false}}return{path:I.join(C||","),complete:A}},clipLine:function(E,H){if(H.equals(E)){return""}var F=this.getResolution();var B=this.MAX_PIXEL-this.translationParameters.x;var A=this.MAX_PIXEL-this.translationParameters.y;var D=(H.x-this.featureDx)/F+this.left;var J=this.top-H.y/F;var C=(E.x-this.featureDx)/F+this.left;var I=this.top-E.y/F;var G;if(C<-B||C>B){G=(I-J)/(C-D);C=C<0?-B:B;I=J+(C-D)*G}if(I<-A||I>A){G=(C-D)/(I-J);I=I<0?-A:A;C=D+(I-J)*G}return C+","+I},getShortString:function(B){var C=this.getResolution();var A=((B.x-this.featureDx)/C+this.left);var D=(this.top-B.y/C);if(this.inValidRange(A,D)){return A+","+D}else{return false}},getPosition:function(A){return({x:parseFloat(A.getAttributeNS(null,"cx")),y:parseFloat(A.getAttributeNS(null,"cy"))})},importSymbol:function(F){if(!this.defs){this.defs=this.createDefs()}var B=this.container.id+"-"+F;var C=document.getElementById(B);if(C!=null){return C}var E=OpenLayers.Renderer.symbol[F];if(!E){throw new Error(F+" is not a valid symbol name")}var H=this.nodeFactory(B,"symbol");var D=this.nodeFactory(null,"polygon");H.appendChild(D);var M=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var K=[];var J,I;for(var G=0;G<E.length;G=G+2){J=E[G];I=E[G+1];M.left=Math.min(M.left,J);M.bottom=Math.min(M.bottom,I);M.right=Math.max(M.right,J);M.top=Math.max(M.top,I);K.push(J,",",I)}D.setAttributeNS(null,"points",K.join(" "));var A=M.getWidth();var L=M.getHeight();var N=[M.left-A,M.bottom-L,A*3,L*3];H.setAttributeNS(null,"viewBox",N.join(" "));this.symbolMetrics[B]=[Math.max(A,L),M.getCenterLonLat().lon,M.getCenterLonLat().lat];this.defs.appendChild(H);return H},getFeatureIdFromEvent:function(A){var C=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments);if(!C){var B=A.target;C=B.parentNode&&B!=this.rendererRoot?B.parentNode._featureId:undefined}return C},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(A){A.preventDefault&&A.preventDefault()};OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",getVersion:function(B,C){var A=OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this,arguments);if(A=="1.1.1"||A=="1.1.0"){A="1.1"}return A},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"});OpenLayers.Format.WMSDescribeLayer.v1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(A){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[A])},read:function(D){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var I=D.documentElement;var B=I.childNodes;var F=[];var A,L;for(var E=0;E<B.length;++E){A=B[E];L=A.nodeName;if(L=="LayerDescription"){var G=A.getAttribute("name");var K="";var C="";var J="";if(A.getAttribute("owsType")){K=A.getAttribute("owsType");C=A.getAttribute("owsURL")}else{if(A.getAttribute("wfs")!=""){K="WFS";C=A.getAttribute("wfs")}else{if(A.getAttribute("wcs")!=""){K="WCS";C=A.getAttribute("wcs")}}}var H=A.getElementsByTagName("Query");if(H.length>0){J=H[0].getAttribute("typeName");if(!J){J=H[0].getAttribute("typename")}}F.push({layerName:G,owsType:K,owsURL:C,typeName:J})}}return F},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:false,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,keepInMap:false,closeOnMove:false,map:null,initialize:function(G,C,F,B,E,D){if(G==null){G=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=G;this.lonlat=C;this.contentSize=(F!=null)?F:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(B!=null){this.contentHTML=B}this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;var A=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(A,null,null,null,"relative",null,"hidden");var G=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(G,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(E){this.addCloseBox(D)}this.registerEvents()},destroy:function(){this.id=null;this.lonlat=null;this.size=null;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null;if(this.closeOnMove&&this.map){this.map.events.unregister("movestart",this,this.hide)}this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv)}this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this)}this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;this.padding=null;this.panMapIfOutOfView=null},draw:function(A){if(A==null){if((this.lonlat!=null)&&(this.map!=null)){A=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(!this.disableFirefoxOverflowHack&&OpenLayers.BROWSER_NAME=="firefox"){this.map.events.register("movestart",this,function(){var B=document.defaultView.getComputedStyle(this.contentDiv,null);var C=B.getPropertyValue("overflow");if(C!="hidden"){this.contentDiv._oldOverflow=C;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var B=this.contentDiv._oldOverflow;if(B){this.contentDiv.style.overflow=B;this.contentDiv._oldOverflow=null}})}this.moveTo(A);if(!this.autoSize&&!this.size){this.setSize(this.contentSize)}this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView()}return this.div},updatePosition:function(){if((this.lonlat)&&(this.map)){var A=this.map.getLayerPxFromLonLat(this.lonlat);if(A){this.moveTo(A)}}},moveTo:function(A){if((A!=null)&&(this.div!=null)){this.div.style.left=A.x+"px";this.div.style.top=A.y+"px"}},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){if(this.visible()){this.hide()}else{this.show()}},show:function(){this.div.style.display="";if(this.panMapIfOutOfView){this.panIntoView()}},hide:function(){this.div.style.display="none"},setSize:function(C){this.size=C.clone();var B=this.getContentDivPadding();var A=B.left+B.right;var E=B.top+B.bottom;this.fixPadding();A+=this.padding.left+this.padding.right;E+=this.padding.top+this.padding.bottom;if(this.closeDiv){var D=parseInt(this.closeDiv.style.width);A+=D+B.right}this.size.w+=A;this.size.h+=E;if(OpenLayers.BROWSER_NAME=="msie"){this.contentSize.w+=B.left+B.right;this.contentSize.h+=B.bottom+B.top}if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}if(this.contentDiv!=null){this.contentDiv.style.width=C.w+"px";this.contentDiv.style.height=C.h+"px"}},updateSize:function(){var E="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var H=(this.map)?this.map.div:document.body;var I=OpenLayers.Util.getRenderedDimensions(E,null,{displayClass:this.displayClass,containerElement:H});var G=this.getSafeContentSize(I);var F=null;if(G.equals(I)){F=I}else{var B={w:(G.w<I.w)?G.w:null,h:(G.h<I.h)?G.h:null};if(B.w&&B.h){F=G}else{var D=OpenLayers.Util.getRenderedDimensions(E,B,{displayClass:this.contentDisplayClass,containerElement:H});var C=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((C!="hidden")&&(D.equals(G))){var A=OpenLayers.Util.getScrollbarWidth();if(B.w){D.h+=A}else{D.w+=A}}F=this.getSafeContentSize(D)}}this.setSize(F)},setBackgroundColor:function(A){if(A!=undefined){this.backgroundColor=A}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(A){if(A!=undefined){this.opacity=A}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(A){if(A!=undefined){this.border=A}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(A){if(A!=null){this.contentHTML=A}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var F=function(){if(this.popup.id===null){return }this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var B=this.contentDiv.getElementsByTagName("img");for(var E=0,A=B.length;E<A;E++){var C=B[E];if(C.width==0||C.height==0){var D={popup:this,img:C};C._onImgLoad=OpenLayers.Function.bind(F,D);OpenLayers.Event.observe(C,"load",C._onImgLoad)}}},getSafeContentSize:function(K){var D=K.clone();var I=this.getContentDivPadding();var J=I.left+I.right;var G=I.top+I.bottom;this.fixPadding();J+=this.padding.left+this.padding.right;G+=this.padding.top+this.padding.bottom;if(this.closeDiv){var C=parseInt(this.closeDiv.style.width);J+=C+I.right}if(this.minSize){D.w=Math.max(D.w,(this.minSize.w-J));D.h=Math.max(D.h,(this.minSize.h-G))}if(this.maxSize){D.w=Math.min(D.w,(this.maxSize.w-J));D.h=Math.min(D.h,(this.maxSize.h-G))}if(this.map&&this.map.size){var F=0,E=0;if(this.keepInMap&&!this.panMapIfOutOfView){var H=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":F=H.x;E=this.map.size.h-H.y;break;case"tl":F=this.map.size.w-H.x;E=this.map.size.h-H.y;break;case"bl":F=this.map.size.w-H.x;E=H.y;break;case"br":F=H.x;E=H.y;break;default:F=H.x;E=this.map.size.h-H.y;break}}var A=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-G-E;var B=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-J-F;D.w=Math.min(D.w,B);D.h=Math.min(D.h,A)}return D},getContentDivPadding:function(){var A=this._contentDivPadding;if(!A){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}A=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));this._contentDivPadding=A;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return A},addCloseBox:function(C){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,{w:17,h:17});this.closeDiv.className="olPopupCloseBox";var B=this.getContentDivPadding();this.closeDiv.style.right=B.right+"px";this.closeDiv.style.top=B.top+"px";this.groupDiv.appendChild(this.closeDiv);var A=C||function(D){this.hide();OpenLayers.Event.stop(D)};OpenLayers.Event.observe(this.closeDiv,"touchend",OpenLayers.Function.bindAsEventListener(A,this));OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(A,this))},panIntoView:function(){var E=this.map.getSize();var D=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var C=D.clone();if(D.x<this.map.paddingForPopups.left){C.x=this.map.paddingForPopups.left}else{if((D.x+this.size.w)>(E.w-this.map.paddingForPopups.right)){C.x=E.w-this.map.paddingForPopups.right-this.size.w}}if(D.y<this.map.paddingForPopups.top){C.y=this.map.paddingForPopups.top}else{if((D.y+this.size.h)>(E.h-this.map.paddingForPopups.bottom)){C.y=E.h-this.map.paddingForPopups.bottom-this.size.h}}var B=D.x-C.x;var A=D.y-C.y;this.map.pan(B,A)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);function A(B){OpenLayers.Event.stop(B,true)}this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,touchstart:A,scope:this})},onmousedown:function(A){this.mousedown=true;OpenLayers.Event.stop(A,true)},onmousemove:function(A){if(this.mousedown){OpenLayers.Event.stop(A,true)}},onmouseup:function(A){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(A,true)}},onclick:function(A){OpenLayers.Event.stop(A,true)},onmouseout:function(A){this.mousedown=false},ondblclick:function(A){OpenLayers.Event.stop(A,true)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:false,draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var A=this.topInUnits.length;this.div.appendChild(this.eTop);if((this.topOutUnits=="")||(this.topInUnits=="")){this.eTop.style.visibility="hidden"}else{this.eTop.style.visibility="visible"}this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+"Bottom";this.div.appendChild(this.eBottom);if((this.bottomOutUnits=="")||(this.bottomInUnits=="")){this.eBottom.style.visibility="hidden"}else{this.eBottom.style.visibility="visible"}}this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(B){var D=parseInt(Math.log(B)/Math.log(10));var A=Math.pow(10,D);var C=parseInt(B/A);var E;if(C>5){E=5}else{if(C>2){E=2}else{E=1}}return E*A},update:function(){var J=this.map.getResolution();if(!J){return }var O=this.map.getUnits();var E=OpenLayers.INCHES_PER_UNIT;var L=this.maxWidth*J*E[O];var N=1;if(this.geodesic===true){var B=(this.map.getGeodesicPixelSize().w||0.000001)*this.maxWidth;var F=L/E.km;N=B/F;L*=N}var A;var D;if(L>100000){A=this.topOutUnits;D=this.bottomOutUnits}else{A=this.topInUnits;D=this.bottomInUnits}var H=L/E[A];var K=L/E[D];var I=this.getBarLen(H);var G=this.getBarLen(K);H=I/E[O]*E[A];K=G/E[O]*E[D];var C=H/J/N;var M=K/J/N;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(M)+"px";this.eBottom.innerHTML=G+" "+D}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(C)+"px";this.eTop.innerHTML=I+" "+A}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(A,B,D,C){this.url=A;this.size=B||{w:20,h:20};this.offset=D||{x:-(this.size.w/2),y:-(this.size.h/2)};this.calculateOffset=C;var E=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(E)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(A){if(A!=null){this.size=A}this.draw()},setUrl:function(A){if(A!=null){this.url=A}this.draw()},draw:function(A){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(A);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(A){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,A)},moveTo:function(A){if(A!=null){this.px=A}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,{x:this.px.x+this.offset.x,y:this.px.y+this.offset.y})}}},display:function(A){this.imageDiv.style.display=(A)?"":"none"},isDrawn:function(){var A=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return A},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(C,B){this.lonlat=C;var A=(B)?B:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=A}else{this.icon.url=A.url;this.icon.size=A.size;this.icon.offset=A.offset;this.icon.calculateOffset=A.calculateOffset}this.events=new OpenLayers.Events(this,this.icon.imageDiv)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null}},draw:function(A){return this.icon.draw(A)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(A){if((A!=null)&&(this.icon!=null)){this.icon.moveTo(A)}this.lonlat=this.map.getLonLatFromLayerPx(A)},isDrawn:function(){var A=(this.icon&&this.icon.isDrawn());return A},onScreen:function(){var B=false;if(this.map){var A=this.map.getExtent();B=A.containsLonLat(this.lonlat)}return B},inflate:function(A){if(this.icon){this.icon.setSize({w:this.icon.size.w*A,h:this.icon.size.h*A})}},setOpacity:function(A){this.icon.setOpacity(A)},setUrl:function(A){this.icon.setUrl(A)},display:function(A){this.icon.display(A)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){return new OpenLayers.Icon(OpenLayers.Util.getImageLocation("marker.png"),{w:21,h:25},{x:-10.5,y:-25})};OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:false,read:function(I,G,A){G=(G)?G:"FeatureCollection";var D=null;var C=null;if(typeof I=="string"){C=OpenLayers.Format.JSON.prototype.read.apply(this,[I,A])}else{C=I}if(!C){OpenLayers.Console.error("Bad JSON: "+I)}else{if(typeof (C.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+I)}else{if(this.isValidType(C,G)){switch(G){case"Geometry":try{D=this.parseGeometry(C)}catch(B){OpenLayers.Console.error(B)}break;case"Feature":try{D=this.parseFeature(C);D.type="Feature"}catch(B){OpenLayers.Console.error(B)}break;case"FeatureCollection":D=[];switch(C.type){case"Feature":try{D.push(this.parseFeature(C))}catch(B){D=null;OpenLayers.Console.error(B)}break;case"FeatureCollection":for(var E=0,F=C.features.length;E<F;++E){try{D.push(this.parseFeature(C.features[E]))}catch(B){D=null;OpenLayers.Console.error(B)}}break;default:try{var H=this.parseGeometry(C);D.push(new OpenLayers.Feature.Vector(H))}catch(B){D=null;OpenLayers.Console.error(B)}}break}}}}return D},isValidType:function(C,A){var B=false;switch(A){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],C.type)==-1){OpenLayers.Console.error("Unsupported geometry type: "+C.type)}else{B=true}break;case"FeatureCollection":B=true;break;default:if(C.type==A){B=true}else{OpenLayers.Console.error("Cannot convert types from "+C.type+" to "+A)}}return B},parseFeature:function(D){var B,F,A,E;A=(D.properties)?D.properties:{};E=(D.geometry&&D.geometry.bbox)||D.bbox;try{F=this.parseGeometry(D.geometry)}catch(C){throw C}B=new OpenLayers.Feature.Vector(F,A);if(E){B.bounds=OpenLayers.Bounds.fromArray(E)}if(D.id){B.fid=D.id}return B},parseGeometry:function(E){if(E==null){return null}var G,F=false;if(E.type=="GeometryCollection"){if(!(OpenLayers.Util.isArray(E.geometries))){throw"GeometryCollection must have geometries array: "+E}var B=E.geometries.length;var D=new Array(B);for(var A=0;A<B;++A){D[A]=this.parseGeometry.apply(this,[E.geometries[A]])}G=new OpenLayers.Geometry.Collection(D);F=true}else{if(!(OpenLayers.Util.isArray(E.coordinates))){throw"Geometry must have coordinates array: "+E}if(!this.parseCoords[E.type.toLowerCase()]){throw"Unsupported geometry type: "+E.type}try{G=this.parseCoords[E.type.toLowerCase()].apply(this,[E.coordinates])}catch(C){throw C}}if(this.internalProjection&&this.externalProjection&&!F){G.transform(this.externalProjection,this.internalProjection)}return G},parseCoords:{point:function(A){if(this.ignoreExtraDims==false&&A.length!=2){throw"Only 2D points are supported: "+A}return new OpenLayers.Geometry.Point(A[0],A[1])},multipoint:function(F){var C=[];var E=null;for(var B=0,A=F.length;B<A;++B){try{E=this.parseCoords.point.apply(this,[F[B]])}catch(D){throw D}C.push(E)}return new OpenLayers.Geometry.MultiPoint(C)},linestring:function(F){var C=[];var E=null;for(var B=0,A=F.length;B<A;++B){try{E=this.parseCoords.point.apply(this,[F[B]])}catch(D){throw D}C.push(E)}return new OpenLayers.Geometry.LineString(C)},multilinestring:function(F){var C=[];var B=null;for(var D=0,A=F.length;D<A;++D){try{B=this.parseCoords.linestring.apply(this,[F[D]])}catch(E){throw E}C.push(B)}return new OpenLayers.Geometry.MultiLineString(C)},polygon:function(G){var F=[];var E,B;for(var C=0,A=G.length;C<A;++C){try{B=this.parseCoords.linestring.apply(this,[G[C]])}catch(D){throw D}E=new OpenLayers.Geometry.LinearRing(B.components);F.push(E)}return new OpenLayers.Geometry.Polygon(F)},multipolygon:function(F){var B=[];var E=null;for(var C=0,A=F.length;C<A;++C){try{E=this.parseCoords.polygon.apply(this,[F[C]])}catch(D){throw D}B.push(E)}return new OpenLayers.Geometry.MultiPolygon(B)},box:function(A){if(A.length!=2){throw"GeoJSON box coordinates must have 2 elements"}return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(A[0][0],A[0][1]),new OpenLayers.Geometry.Point(A[1][0],A[0][1]),new OpenLayers.Geometry.Point(A[1][0],A[1][1]),new OpenLayers.Geometry.Point(A[0][0],A[1][1]),new OpenLayers.Geometry.Point(A[0][0],A[0][1])])])}},write:function(E,D){var A={type:null};if(OpenLayers.Util.isArray(E)){A.type="FeatureCollection";var G=E.length;A.features=new Array(G);for(var C=0;C<G;++C){var B=E[C];if(!B instanceof OpenLayers.Feature.Vector){var F="FeatureCollection only supports collections of features: "+B;throw F}A.features[C]=this.extract.feature.apply(this,[B])}}else{if(E.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){A=this.extract.geometry.apply(this,[E])}else{if(E instanceof OpenLayers.Feature.Vector){A=this.extract.feature.apply(this,[E]);if(E.layer&&E.layer.projection){A.crs=this.createCRSObject(E)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[A,D])},createCRSObject:function(B){var C=B.layer.projection.toString();var A={};if(C.match(/epsg:/i)){var D=parseInt(C.substring(C.indexOf(":")+1));if(D==4326){A={type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{A={type:"name",properties:{name:"EPSG:"+D}}}}return A},extract:{feature:function(C){var B=this.extract.geometry.apply(this,[C.geometry]);var A={type:"Feature",properties:C.attributes,geometry:B};if(C.fid!=null){A.id=C.fid}return A},geometry:function(D){if(D==null){return null}if(this.internalProjection&&this.externalProjection){D=D.clone();D.transform(this.internalProjection,this.externalProjection)}var A=D.CLASS_NAME.split(".")[2];var C=this.extract[A.toLowerCase()].apply(this,[D]);var B;if(A=="Collection"){B={type:"GeometryCollection",geometries:C}}else{B={type:A,coordinates:C}}return B},point:function(A){return[A.x,A.y]},multipoint:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push(this.extract.point.apply(this,[C.components[B]]))}return D},linestring:function(B){var D=[];for(var C=0,A=B.components.length;C<A;++C){D.push(this.extract.point.apply(this,[B.components[C]]))}return D},multilinestring:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push(this.extract.linestring.apply(this,[C.components[B]]))}return D},polygon:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push(this.extract.linestring.apply(this,[C.components[B]]))}return D},multipolygon:function(D){var C=[];for(var B=0,A=D.components.length;B<A;++B){C.push(this.extract.polygon.apply(this,[D.components[B]]))}return C},collection:function(C){var A=C.components.length;var D=new Array(A);for(var B=0;B<A;++B){D[B]=this.extract.geometry.apply(this,[C.components[B]])}return D}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:false,activate:function(){var A=OpenLayers.Strategy.prototype.activate.call(this);if(A){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this})}return A},deactivate:function(){var A=OpenLayers.Strategy.prototype.deactivate.call(this);if(A){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})}return A},cacheFeatures:function(A){if(!this.paging){this.clearCache();this.features=A.features;this.pageNext(A)}},clearCache:function(){if(this.features){for(var A=0;A<this.features.length;++A){this.features[A].destroy()}}this.features=null;this.num=null},pageCount:function(){var A=this.features?this.features.length:0;return Math.ceil(A/this.length)},pageNum:function(){return this.num},pageLength:function(A){if(A&&A>0){this.length=A}return this.length},pageNext:function(A){var B=false;if(this.features){if(this.num===null){this.num=-1}var C=(this.num+1)*this.length;B=this.page(C,A)}return B},pagePrevious:function(){var A=false;if(this.features){if(this.num===null){this.num=this.pageCount()}var B=(this.num-1)*this.length;A=this.page(B)}return A},page:function(E,C){var D=false;if(this.features){if(E>=0&&E<this.features.length){var A=Math.floor(E/this.length);if(A!=this.num){this.paging=true;var B=this.features.slice(E,E+this.length);this.layer.removeFeatures(this.layer.features);this.num=A;if(C&&C.features){C.features=B}else{this.layer.addFeatures(B)}this.paging=false;D=true}}}return D},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(H,D,G,C,B,F,E){var A=[H,D,G,C,F,E];OpenLayers.Popup.prototype.initialize.apply(this,A);this.anchor=(B!=null)?B:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null;this.relativePosition=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(C){var B=this.relativePosition;this.relativePosition=this.calculateRelativePosition(C);var D=this.calculateNewPx(C);var A=new Array(D);OpenLayers.Popup.prototype.moveTo.apply(this,A);if(this.relativePosition!=B){this.updateRelativePosition()}},setSize:function(B){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var A=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(A)}},calculateRelativePosition:function(B){var D=this.map.getLonLatFromLayerPx(B);var C=this.map.getExtent();var A=C.determineQuadrant(D);return OpenLayers.Bounds.oppositeQuadrant(A)},updateRelativePosition:function(){},calculateNewPx:function(B){var E=B.offset(this.anchor.offset);var A=this.size||this.contentSize;var D=(this.relativePosition.charAt(0)=="t");E.y+=(D)?-A.h:this.anchor.size.h;var C=(this.relativePosition.charAt(1)=="l");E.x+=(C)?-A.w:this.anchor.size.w;return E},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,initialize:function(G,C,F,B,A,E,D){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePosition){this.updateRelativePosition();this.calculateRelativePosition=function(H){return this.relativePosition}}this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(E){this.closeDiv.style.zIndex=1}this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePosition=false;this.positionBlocks=null;for(var A=0;A<this.blocks.length;A++){var B=this.blocks[A];if(B.image){B.div.removeChild(B.image)}B.image=null;if(B.div){this.groupDiv.removeChild(B.div)}B.div=null}this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(A){},setBorder:function(){},setOpacity:function(A){},setSize:function(A){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var A=this.getContentDivPadding();this.closeDiv.style.right=A.right+this.padding.right+"px";this.closeDiv.style.top=A.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(A){var B=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);B=B.offset(this.positionBlocks[this.relativePosition].offset);return B},createBlocks:function(){this.blocks=[];var F=null;for(var E in this.positionBlocks){F=E;break}var A=this.positionBlocks[F];for(var D=0;D<A.blocks.length;D++){var H={};this.blocks.push(H);var B=this.id+"_FrameDecorationDiv_"+D;H.div=OpenLayers.Util.createDiv(B,null,null,null,"absolute",null,"hidden",null);var C=this.id+"_FrameDecorationImg_"+D;var G=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;H.image=G(C,null,this.imageSize,this.imageSrc,"absolute",null,null,null);H.div.appendChild(H.image);this.groupDiv.appendChild(H.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var G=this.positionBlocks[this.relativePosition];for(var E=0;E<G.blocks.length;E++){var B=G.blocks[E];var D=this.blocks[E];var C=B.anchor.left;var H=B.anchor.bottom;var A=B.anchor.right;var J=B.anchor.top;var I=(isNaN(B.size.w))?this.size.w-(A+C):B.size.w;var F=(isNaN(B.size.h))?this.size.h-(H+J):B.size.h;D.div.style.width=(I<0?0:I)+"px";D.div.style.height=(F<0?0:F)+"px";D.div.style.left=(C!=null)?C+"px":"";D.div.style.bottom=(H!=null)?H+"px":"";D.div.style.right=(A!=null)?A+"px":"";D.div.style.top=(J!=null)?J+"px":"";D.image.style.left=B.position.x+"px";D.image.style.top=B.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(C,B,A){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);if(this.dragHandler){this.dragHandler.destroy();this.dragHandler=null}},setMap:function(A){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(A)}},startBox:function(A){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(E){var D=this.dragHandler.start.x;var B=this.dragHandler.start.y;var C=Math.abs(D-E.x);var A=Math.abs(B-E.y);var F=this.getBoxOffsets();this.zoomBox.style.width=(C+F.width+1)+"px";this.zoomBox.style.height=(A+F.height+1)+"px";this.zoomBox.style.left=(E.x<D?D-C-F.left:D-F.left)+"px";this.zoomBox.style.top=(E.y<B?B-A-F.top:B-F.top)+"px"},endBox:function(B){var A;if(Math.abs(this.dragHandler.start.x-B.x)>5||Math.abs(this.dragHandler.start.y-B.y)>5){var G=this.dragHandler.start;var F=Math.min(G.y,B.y);var C=Math.max(G.y,B.y);var E=Math.min(G.x,B.x);var D=Math.max(G.x,B.x);A=new OpenLayers.Bounds(E,C,D,F)}else{A=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[A])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxOffsets=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){if(this.dragHandler.deactivate()){if(this.zoomBox){this.removeBox()}}return true}else{return false}},getBoxOffsets:function(){if(!this.boxOffsets){var D=document.createElement("div");D.style.position="absolute";D.style.border="1px solid black";D.style.width="3px";document.body.appendChild(D);var A=D.clientWidth==3;document.body.removeChild(D);var F=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"));var C=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"));var E=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"));var B=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"));this.boxOffsets={left:F,right:C,top:E,bottom:B,width:A===false?F+C:0,height:A===false?E+B:0}}return this.boxOffsets},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,keyMask:null,alwaysZoom:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(H){if(H instanceof OpenLayers.Bounds){var B;if(!this.out){var I=this.map.getLonLatFromPixel({x:H.left,y:H.bottom});var M=this.map.getLonLatFromPixel({x:H.right,y:H.top});B=new OpenLayers.Bounds(I.lon,I.lat,M.lon,M.lat)}else{var G=Math.abs(H.right-H.left);var J=Math.abs(H.top-H.bottom);var E=Math.min((this.map.size.h/J),(this.map.size.w/G));var N=this.map.getExtent();var A=this.map.getLonLatFromPixel(H.getCenterPixel());var C=A.lon-(N.getWidth()/2)*E;var F=A.lon+(N.getWidth()/2)*E;var L=A.lat-(N.getHeight()/2)*E;var D=A.lat+(N.getHeight()/2)*E;B=new OpenLayers.Bounds(C,L,F,D)}var K=this.map.getZoom();this.map.zoomToExtent(B);if(K==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(K+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(H),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(H),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:1,documentDrag:false,kinetic:null,enableKinetic:false,kineticInterval:10,draw:function(){if(this.enableKinetic){var A={interval:this.kineticInterval};if(typeof this.enableKinetic==="object"){A=OpenLayers.Util.extend(A,this.enableKinetic)}this.kinetic=new OpenLayers.Kinetic(A)}this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone,down:this.panMapStart},{interval:this.interval,documentDrag:this.documentDrag})},panMapStart:function(){if(this.kinetic){this.kinetic.begin()}},panMap:function(A){if(this.kinetic){this.kinetic.update(A)}this.panned=true;this.map.pan(this.handler.last.x-A.x,this.handler.last.y-A.y,{dragging:true,animate:false})},panMapDone:function(C){if(this.panned){var B=null;if(this.kinetic){B=this.kinetic.end(C)}this.map.pan(this.handler.last.x-C.x,this.handler.last.y-C.y,{dragging:!!B,animate:false});if(B){var A=this;this.kinetic.move(B,function(D,F,E){A.map.pan(D,F,{dragging:!E,animate:false})})}this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,dblclickTolerance:13,stopSingle:false,stopDouble:false,timerId:null,touch:false,down:null,last:null,first:null,rightclickTimerId:null,touchstart:function(A){if(!this.touch){this.unregisterMouseListeners();this.touch=true}this.down=this.getEventInfo(A);this.last=this.getEventInfo(A);return true},touchmove:function(A){this.last=this.getEventInfo(A);return true},touchend:function(A){if(this.down){A.xy=this.last.xy;A.lastTouches=this.last.touches;this.handleSingle(A);this.down=null}return true},unregisterMouseListeners:function(){this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,click:this.click,dblclick:this.dblclick,scope:this})},mousedown:function(A){this.down=this.getEventInfo(A);this.last=this.getEventInfo(A);return true},mouseup:function(B){var A=true;if(this.checkModifiers(B)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(B)){A=this.rightclick(B)}return A},rightclick:function(B){if(this.passesTolerance(B)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[B]);return !this.stopDouble}else{var A=this["double"]?OpenLayers.Util.extend({},B):this.callback("rightclick",[B]);var C=OpenLayers.Function.bind(this.delayedRightCall,this,A);this.rightclickTimerId=window.setTimeout(C,this.delay)}}return !this.stopSingle},delayedRightCall:function(A){this.rightclickTimerId=null;if(A){this.callback("rightclick",[A])}},click:function(A){if(!this.last){this.last=this.getEventInfo(A)}this.handleSingle(A);return !this.stopSingle},dblclick:function(A){this.handleDouble(A);return !this.stopDouble},handleDouble:function(A){if(this.passesDblclickTolerance(A)){if(this["double"]){this.callback("dblclick",[A])}this.clearTimer()}},handleSingle:function(B){if(this.passesTolerance(B)){if(this.timerId!=null){if(this.last.touches&&this.last.touches.length===1){if(this["double"]){OpenLayers.Event.stop(B)}this.handleDouble(B)}if(!this.last.touches||this.last.touches.length!==2){this.clearTimer()}}else{this.first=this.getEventInfo(B);var A=this.single?OpenLayers.Util.extend({},B):null;this.queuePotentialClick(A)}}},queuePotentialClick:function(A){this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,A),this.delay)},passesTolerance:function(A){var D=true;if(this.pixelTolerance!=null&&this.down&&this.down.xy){D=this.pixelTolerance>=this.down.xy.distanceTo(A.xy);if(D&&this.touch&&this.down.touches.length===this.last.touches.length){for(var B=0,C=this.down.touches.length;B<C;++B){if(this.getTouchDistance(this.down.touches[B],this.last.touches[B])>this.pixelTolerance){D=false;break}}}}return D},getTouchDistance:function(B,A){return Math.sqrt(Math.pow(B.clientX-A.clientX,2)+Math.pow(B.clientY-A.clientY,2))},passesDblclickTolerance:function(A){var B=true;if(this.down&&this.first){B=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance}return B},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}if(this.rightclickTimerId!=null){window.clearTimeout(this.rightclickTimerId);this.rightclickTimerId=null}},delayedCall:function(A){this.timerId=null;if(A){this.callback("click",[A])}},getEventInfo:function(B){var D;if(B.touches){var A=B.touches.length;D=new Array(A);var E;for(var C=0;C<A;C++){E=B.touches[C];D[C]={clientX:E.clientX,clientY:E.clientY}}}return{xy:B.xy,touches:D}},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;this.first=null;this.last=null;this.touch=false;A=true}return A},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,documentDrag:false,zoomBox:null,zoomBoxEnabled:true,zoomWheelEnabled:true,mouseWheelOptions:null,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,autoActivate:true,initialize:function(A){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy()}this.zoomBox=null;if(this.pinchZoom){this.pinchZoom.destroy()}this.pinchZoom=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate()}this.handlers.click.activate();if(this.zoomBoxEnabled){this.zoomBox.activate()}if(this.pinchZoom){this.pinchZoom.activate()}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.pinchZoom){this.pinchZoom.deactivate()}this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks){this.map.viewPortDiv.oncontextmenu=OpenLayers.Function.False}var A={click:this.defaultClick,dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var B={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,A,B);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},this.mouseWheelOptions);if(OpenLayers.Control.PinchZoom){this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions))}},defaultClick:function(A){if(A.lastTouches&&A.lastTouches.length==2){this.map.zoomOut()}},defaultDblClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);this.map.setCenter(A,this.map.zoom+1)},defaultDblRightClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);this.map.setCenter(A,this.map.zoom-1)},wheelChange:function(I,C){var H=this.map.getZoom();var F=this.map.getZoom()+Math.round(C);F=Math.max(F,0);F=Math.min(F,this.map.getNumZoomLevels());if(F===H){return }var J=this.map.getSize();var E=J.w/2-I.xy.x;var D=I.xy.y-J.h/2;var G=this.map.baseLayer.getResolutionForZoom(F);var A=this.map.getLonLatFromPixel(I.xy);var B=new OpenLayers.LonLat(A.lon+E*G,A.lat+D*G);this.map.setCenter(B,F)},wheelUp:function(A,B){this.wheelChange(A,B||1)},wheelDown:function(A,B){this.wheelChange(A,B||-1)},disableZoomBox:function(){this.zoomBoxEnabled=false;this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=true;if(this.active){this.zoomBox.activate()}},disableZoomWheel:function(){this.zoomWheelEnabled=false;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=true;if(this.active){this.handlers.wheel.activate()}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,multi:false,featureAdded:function(){},handlerOptions:null,initialize:function(B,C,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(F,E){this.layer.events.triggerEvent("sketchmodified",{vertex:F,feature:E})},create:function(F,E){this.layer.events.triggerEvent("sketchstarted",{vertex:F,feature:E})}},this.callbacks);this.layer=B;this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{renderers:B.renderers,rendererOptions:B.rendererOptions});if(!("multi" in this.handlerOptions)){this.handlerOptions.multi=this.multi}var D=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(D){this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":D})})}this.handler=new C(this,this.callbacks,this.handlerOptions)},drawFeature:function(C){var A=new OpenLayers.Feature.Vector(C);var B=this.layer.events.triggerEvent("sketchcomplete",{feature:A});if(B!==false){A.state=OpenLayers.State.INSERT;this.layer.addFeatures([A]);this.featureAdded(A);this.events.triggerEvent("featureadded",{feature:A})}},insertXY:function(A,B){if(this.handler&&this.handler.line){this.handler.insertXY(A,B)}},insertDeltaXY:function(B,A){if(this.handler&&this.handler.line){this.handler.insertDeltaXY(B,A)}},insertDirectionLength:function(B,A){if(this.handler&&this.handler.line){this.handler.insertDirectionLength(B,A)}},insertDeflectionLength:function(B,A){if(this.handler&&this.handler.line){this.handler.insertDeflectionLength(B,A)}},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:false,polygon:null,createFeature:function(A){var B=this.layer.getLonLatFromViewPortPx(A);var C=new OpenLayers.Geometry.Point(B.lon,B.lat);this.point=new OpenLayers.Feature.Vector(C);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:true})},addPoint:function(A){if(!this.drawingHole&&this.holeModifier&&this.evt&&this.evt[this.holeModifier]){var F=this.point.geometry;var E=this.control.layer.features;var D,C;for(var B=E.length-1;B>=0;--B){D=E[B].geometry;if((D instanceof OpenLayers.Geometry.Polygon||D instanceof OpenLayers.Geometry.MultiPolygon)&&D.intersects(F)){C=E[B];this.control.layer.removeFeatures([C],{silent:true});this.control.layer.events.registerPriority("sketchcomplete",this,this.finalizeInteriorRing);this.control.layer.events.registerPriority("sketchmodified",this,this.enforceTopology);C.geometry.addComponent(this.line.geometry);this.polygon=C;this.drawingHole=true;break}}}OpenLayers.Handler.Path.prototype.addPoint.apply(this,arguments)},getCurrentPointIndex:function(){return this.line.geometry.components.length-2},enforceTopology:function(D){var A=D.vertex;var C=this.line.geometry.components;if(!this.polygon.geometry.intersects(A)){var B=C[C.length-3];A.x=B.x;A.y=B.y}},finishGeometry:function(){var A=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[A]);this.removePoint();this.finalize()},finalizeInteriorRing:function(){var C=this.line.geometry;var B=(C.getArea()!==0);if(B){var H=this.polygon.geometry.components;for(var D=H.length-2;D>=0;--D){if(C.intersects(H[D])){B=false;break}}if(B){var G;outer:for(var D=H.length-2;D>0;--D){var E=H[D].components;for(var A=0,F=E.length;A<F;++A){if(C.containsPoint(E[A])){B=false;break outer}}}}}if(B){if(this.polygon.state!==OpenLayers.State.INSERT){this.polygon.state=OpenLayers.State.UPDATE}}else{this.polygon.geometry.removeComponent(C)}this.restoreFeature();return false},cancel:function(){if(this.drawingHole){this.polygon.geometry.removeComponent(this.line.geometry);this.restoreFeature(true)}return OpenLayers.Handler.Path.prototype.cancel.apply(this,arguments)},restoreFeature:function(A){this.control.layer.events.unregister("sketchcomplete",this,this.finalizeInteriorRing);this.control.layer.events.unregister("sketchmodified",this,this.enforceTopology);this.layer.removeFeatures([this.polygon],{silent:true});this.control.layer.addFeatures([this.polygon],{silent:true});this.drawingHole=false;if(!A){this.control.layer.events.triggerEvent("sketchcomplete",{feature:this.polygon})}},destroyFeature:function(A){OpenLayers.Handler.Path.prototype.destroyFeature.call(this,A);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var A=this.polygon&&this.polygon.geometry;if(A&&this.multi){A=new OpenLayers.Geometry.MultiPolygon([A])}return A},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{citeCompliant:false,initialize:function(C,B){OpenLayers.Control.Panel.prototype.initialize.apply(this,[B]);this.addControls([new OpenLayers.Control.Navigation()]);var A=[new OpenLayers.Control.DrawFeature(C,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint",handlerOptions:{citeCompliant:this.citeCompliant}}),new OpenLayers.Control.DrawFeature(C,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath",handlerOptions:{citeCompliant:this.citeCompliant}}),new OpenLayers.Control.DrawFeature(C,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon",handlerOptions:{citeCompliant:this.citeCompliant}})];this.addControls(A)},draw:function(){var A=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);if(this.defaultControl===null){this.defaultControl=this.controls[0]}return A},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(E){var A;if(typeof E=="string"){E=OpenLayers.Format.XML.prototype.read.apply(this,[E])}var B=E.documentElement;if(B){var C=this;var D=this["read_"+B.nodeName];if(D){A=D.call(this,B)}else{A=new OpenLayers.Format.GML((this.options?this.options:{})).read(E)}}else{A=E}return A},read_msGMLOutput:function(H){var E=[];var B=this.getSiblingNodesByTagCriteria(H,this.layerIdentifier);if(B){for(var I=0,L=B.length;I<L;++I){var C=B[I];var J=C.nodeName;if(C.prefix){J=J.split(":")[1]}var J=J.replace(this.layerIdentifier,"");var K=this.getSiblingNodesByTagCriteria(C,this.featureIdentifier);if(K){for(var G=0;G<K.length;G++){var A=K[G];var D=this.parseGeometry(A);var F=this.parseAttributes(A);var M=new OpenLayers.Feature.Vector(D.geometry,F,null);M.bounds=D.bounds;M.type=J;E.push(M)}}}}return E},read_FeatureInfoResponse:function(H){var E=[];var J=this.getElementsByTagNameNS(H,"*","FIELDS");for(var I=0,K=J.length;I<K;I++){var B=J[I];var L=null;var G={};var F;var M=B.attributes.length;if(M>0){for(F=0;F<M;F++){var C=B.attributes[F];G[C.nodeName]=C.nodeValue}}else{var A=B.childNodes;for(F=0,M=A.length;F<M;++F){var D=A[F];if(D.nodeType!=3){G[D.getAttribute("name")]=D.getAttribute("value")}}}E.push(new OpenLayers.Feature.Vector(L,G,null))}return E},getSiblingNodesByTagCriteria:function(F,I){var A=[];var C,E,D,G,B;if(F&&F.hasChildNodes()){C=F.childNodes;D=C.length;for(var H=0;H<D;H++){B=C[H];while(B&&B.nodeType!=1){B=B.nextSibling;H++}E=(B?B.nodeName:"");if(E.length>0&&E.indexOf(I)>-1){A.push(B)}else{G=this.getSiblingNodesByTagCriteria(B,I);if(G.length>0){(A.length==0)?A=G:A.push(G)}}}}return A},parseAttributes:function(E){var F={};if(E.nodeType==1){var C=E.childNodes;var D=C.length;for(var G=0;G<D;++G){var B=C[G];if(B.nodeType==1){var J=B.childNodes;var A=(B.prefix)?B.nodeName.split(":")[1]:B.nodeName;if(J.length==0){F[A]=null}else{if(J.length==1){var I=J[0];if(I.nodeType==3||I.nodeType==4){var H=I.nodeValue.replace(this.regExes.trimSpace,"");F[A]=H}}}}}}return F},parseGeometry:function(C){if(!this.gmlFormat){this.gmlFormat=new OpenLayers.Format.GML()}var A=this.gmlFormat.parseFeature(C);var D,B=null;if(A){D=A.geometry&&A.geometry.clone();B=A.bounds&&A.bounds.clone();A.destroy()}return{geometry:D,bounds:B}},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"});OpenLayers.Console.warn("OpenLayers.Rico is deprecated");OpenLayers.Rico=OpenLayers.Rico||{};OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(C,B,A){this.rgb={r:C,g:B,b:A}},setRed:function(A){this.rgb.r=A},setGreen:function(A){this.rgb.g=A},setBlue:function(A){this.rgb.b=A},setHue:function(B){var A=this.asHSB();A.h=B;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,A.b)},setSaturation:function(B){var A=this.asHSB();A.s=B;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,A.b)},setBrightness:function(A){var B=this.asHSB();B.b=A;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(B.h,B.s,B.b)},darken:function(B){var A=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,Math.max(A.b-B,0))},brighten:function(B){var A=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,Math.min(A.b+B,1))},blend:function(A){this.rgb.r=Math.floor((this.rgb.r+A.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+A.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+A.rgb.b)/2)},isBright:function(){var A=this.asHSB();return this.asHSB().b>0.5},isDark:function(){return !this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}});OpenLayers.Rico.Color.createFromHex=function(D){if(D.length==4){var B=D;var D="#";for(var C=1;C<4;C++){D+=(B.charAt(C)+B.charAt(C))}}if(D.indexOf("#")==0){D=D.substring(1)}var F=D.substring(0,2);var E=D.substring(2,4);var A=D.substring(4,6);return new OpenLayers.Rico.Color(parseInt(F,16),parseInt(E,16),parseInt(A,16))};OpenLayers.Rico.Color.createColorFromBackground=function(D){var B=OpenLayers.Element.getStyle(OpenLayers.Util.getElement(D),"backgroundColor");if(B=="transparent"&&D.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(D.parentNode)}if(B==null){return new OpenLayers.Rico.Color(255,255,255)}if(B.indexOf("rgb(")==0){var A=B.substring(4,B.length-1);var C=A.split(",");return new OpenLayers.Rico.Color(parseInt(C[0]),parseInt(C[1]),parseInt(C[2]))}else{if(B.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(B)}else{return new OpenLayers.Rico.Color(255,255,255)}}};OpenLayers.Rico.Color.HSBtoRGB=function(G,E,I){var C=0;var D=0;var J=0;if(E==0){C=parseInt(I*255+0.5);D=C;J=C}else{var F=(G-Math.floor(G))*6;var H=F-Math.floor(F);var B=I*(1-E);var A=I*(1-E*H);var K=I*(1-(E*(1-H)));switch(parseInt(F)){case 0:C=(I*255+0.5);D=(K*255+0.5);J=(B*255+0.5);break;case 1:C=(A*255+0.5);D=(I*255+0.5);J=(B*255+0.5);break;case 2:C=(B*255+0.5);D=(I*255+0.5);J=(K*255+0.5);break;case 3:C=(B*255+0.5);D=(A*255+0.5);J=(I*255+0.5);break;case 4:C=(K*255+0.5);D=(B*255+0.5);J=(I*255+0.5);break;case 5:C=(I*255+0.5);D=(B*255+0.5);J=(A*255+0.5);break}}return{r:parseInt(C),g:parseInt(D),b:parseInt(J)}};OpenLayers.Rico.Color.RGBtoHSB=function(A,E,J){var F;var D;var I;var K=(A>E)?A:E;if(J>K){K=J}var G=(A<E)?A:E;if(J<G){G=J}I=K/255;if(K!=0){D=(K-G)/K}else{D=0}if(D==0){F=0}else{var B=(K-A)/(K-G);var H=(K-E)/(K-G);var C=(K-J)/(K-G);if(A==K){F=C-H}else{if(E==K){F=2+B-C}else{F=4+H-B}}F=F/6;if(F<0){F=F+1}}return{h:F,s:D,b:I}};OpenLayers.Console.warn("OpenLayers.Rico is deprecated");OpenLayers.Rico=OpenLayers.Rico||{};OpenLayers.Rico.Corner={round:function(D,B){D=OpenLayers.Util.getElement(D);this._setOptions(B);var A=this.options.color;if(this.options.color=="fromElement"){A=this._background(D)}var C=this.options.bgColor;if(this.options.bgColor=="fromParent"){C=this._background(D.offsetParent)}this._roundCornersImpl(D,A,C)},changeColor:function(C,B){C.style.backgroundColor=B;var A=C.parentNode.getElementsByTagName("span");for(var D=0;D<A.length;D++){A[D].style.backgroundColor=B}},changeOpacity:function(C,F){var D=F;var A="alpha(opacity="+F*100+")";C.style.opacity=D;C.style.filter=A;var B=C.parentNode.getElementsByTagName("span");for(var E=0;E<B.length;E++){B[E].style.opacity=D;B[E].style.filter=A}},reRound:function(D,C){var B=D.parentNode.childNodes[0];var A=D.parentNode.childNodes[2];D.parentNode.removeChild(B);D.parentNode.removeChild(A);this.round(D.parentNode,C)},_roundCornersImpl:function(C,A,B){if(this.options.border){this._renderBorder(C,B)}if(this._isTopRounded()){this._roundTopCorners(C,A,B)}if(this._isBottomRounded()){this._roundBottomCorners(C,A,B)}},_renderBorder:function(D,E){var B="1px solid "+this._borderColor(E);var A="border-left: "+B;var F="border-right: "+B;var C="style='"+A+";"+F+"'";D.innerHTML="<div "+C+">"+D.innerHTML+"</div>"},_roundTopCorners:function(C,A,E){var D=this._createCorner(E);for(var B=0;B<this.options.numSlices;B++){D.appendChild(this._createCornerSlice(A,E,B,"top"))}C.style.paddingTop=0;C.insertBefore(D,C.firstChild)},_roundBottomCorners:function(C,A,E){var D=this._createCorner(E);for(var B=(this.options.numSlices-1);B>=0;B--){D.appendChild(this._createCornerSlice(A,E,B,"bottom"))}C.style.paddingBottom=0;C.appendChild(D)},_createCorner:function(B){var A=document.createElement("div");A.style.backgroundColor=(this._isTransparent()?"transparent":B);return A},_createCornerSlice:function(C,D,G,A){var E=document.createElement("span");var B=E.style;B.backgroundColor=C;B.display="block";B.height="1px";B.overflow="hidden";B.fontSize="1px";var F=this._borderColor(C,D);if(this.options.border&&G==0){B.borderTopStyle="solid";B.borderTopWidth="1px";B.borderLeftWidth="0px";B.borderRightWidth="0px";B.borderBottomWidth="0px";B.height="0px";B.borderColor=F}else{if(F){B.borderColor=F;B.borderStyle="solid";B.borderWidth="0px 1px"}}if(!this.options.compact&&(G==(this.options.numSlices-1))){B.height="2px"}this._setMargin(E,G,A);this._setBorder(E,G,A);return E},_setOptions:function(A){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,A||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else{if(this.options.corners.indexOf("tr")>=0){return"right"}}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else{if(this.options.corners.indexOf("br")>=0){return"right"}}return""},_borderColor:function(A,B){if(A=="transparent"){return B}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(B,A)}else{return""}}}},_setMargin:function(D,E,B){var C=this._marginSize(E);var A=B=="top"?this._whichSideTop():this._whichSideBottom();if(A=="left"){D.style.marginLeft=C+"px";D.style.marginRight="0px"}else{if(A=="right"){D.style.marginRight=C+"px";D.style.marginLeft="0px"}else{D.style.marginLeft=C+"px";D.style.marginRight=C+"px"}}},_setBorder:function(D,E,B){var C=this._borderSize(E);var A=B=="top"?this._whichSideTop():this._whichSideBottom();if(A=="left"){D.style.borderLeftWidth=C+"px";D.style.borderRightWidth="0px"}else{if(A=="right"){D.style.borderRightWidth=C+"px";D.style.borderLeftWidth="0px"}else{D.style.borderLeftWidth=C+"px";D.style.borderRightWidth=C+"px"}}if(this.options.border!=false){D.style.borderLeftWidth=C+"px";D.style.borderRightWidth=C+"px"}},_marginSize:function(E){if(this._isTransparent()){return 0}var D=[5,3,2,1];var A=[3,2,1,0];var C=[2,1];var B=[1,0];if(this.options.compact&&this.options.blend){return B[E]}else{if(this.options.compact){return C[E]}else{if(this.options.blend){return A[E]}else{return D[E]}}}},_borderSize:function(E){var D=[5,3,2,1];var B=[2,1,1,1];var A=[1,0];var C=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else{if(this.options.compact){return A[E]}else{if(this.options.blend){return B[E]}else{if(this.options.border){return C[E]}else{if(this._isTransparent()){return D[E]}}}}}return 0},_hasString:function(B){for(var A=1;A<arguments.length;A++){if(B.indexOf(arguments[A])>=0){return true}}return false},_blend:function(C,A){var B=OpenLayers.Rico.Color.createFromHex(C);B.blend(OpenLayers.Rico.Color.createFromHex(A));return B},_background:function(A){try{return OpenLayers.Rico.Color.createColorFromBackground(A).asHex()}catch(B){return"#ffffff"}},_isTransparent:function(){return this.options.color=="transparent"},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(A){return A.childNodes.length==1&&A.childNodes[0].nodeType==3}};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(G,C,F,B,A,E,D){OpenLayers.Console.warn("AnchoredBubble is deprecated");this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)},draw:function(A){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(A){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(A){if(A!=undefined){this.backgroundColor=A}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(A){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,A);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(A){this.border=0},setRicoCorners:function(){var A=this.getCornersToRound(this.relativePosition);var B={corners:A,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,B);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,B);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var A=["tl","tr","bl","br"];var B=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(A,B);return A.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,activate:function(){var A=OpenLayers.Strategy.prototype.activate.call(this);if(A){this.layer.events.on({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this});this.update()}return A},deactivate:function(){var A=OpenLayers.Strategy.prototype.deactivate.call(this);if(A){this.layer.events.un({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this})}return A},update:function(B){var A=this.getMapBounds();if(A!==null&&((B&&B.force)||(this.layer.visibility&&this.layer.calculateInRange()&&this.invalidBounds(A)))){this.calculateBounds(A);this.resolution=this.layer.map.getResolution();this.triggerRead(B)}},getMapBounds:function(){if(this.layer.map===null){return null}var A=this.layer.map.getExtent();if(A&&!this.layer.projection.equals(this.layer.map.getProjectionObject())){A=A.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)}return A},invalidBounds:function(A){if(!A){A=this.getMapBounds()}var C=!this.bounds||!this.bounds.containsBounds(A);if(!C&&this.resFactor){var B=this.resolution/this.layer.map.getResolution();C=(B>=this.resFactor||B<=(1/this.resFactor))}return C},calculateBounds:function(B){if(!B){B=this.getMapBounds()}var A=B.getCenterLonLat();var D=B.getWidth()*this.ratio;var C=B.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(A.lon-(D/2),A.lat-(C/2),A.lon+(D/2),A.lat+(C/2))},triggerRead:function(A){if(this.response&&!(A&&A.noAbort===true)){this.layer.protocol.abort(this.response);this.layer.events.triggerEvent("loadend")}this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:this.createFilter(),callback:this.merge,scope:this},A))},createFilter:function(){var A=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){A=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,A]})}return A},merge:function(G){this.layer.destroyFeatures();var E=G.features;if(E&&E.length>0){var F=this.layer.projection;var D=this.layer.map.getProjectionObject();if(!D.equals(F)){var C;for(var B=0,A=E.length;B<A;++B){C=E[B].geometry;if(C){C.transform(F,D)}}}this.layer.addFeatures(E)}this.response=null;this.layer.events.triggerEvent("loadend")},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(A,C){var B=this.readers.ogc._expression.call(this,A);if(B){C.priority=B}},VendorOption:function(A,B){if(!B.vendorOptions){B.vendorOptions={}}B.vendorOptions[A.getAttribute("name")]=this.getChildValue(A)}},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(A){return this.writers.sld._OGCExpression.call(this,"sld:Priority",A)},VendorOption:function(A){return this.createElementNSPlus("sld:VendorOption",{attributes:{name:A.name},value:A.value})},TextSymbolizer:function(B){var A=OpenLayers.Format.SLD.v1_0_0.prototype.writers;var C=A.sld["TextSymbolizer"].apply(this,arguments);if(B.graphic!==false&&(B.externalGraphic||B.graphicName)){this.writeNode("Graphic",B,C)}if("priority" in B){this.writeNode("Priority",B.priority,C)}return this.addVendorOptions(C,B)},PointSymbolizer:function(B){var A=OpenLayers.Format.SLD.v1_0_0.prototype.writers;var C=A.sld["PointSymbolizer"].apply(this,arguments);return this.addVendorOptions(C,B)},LineSymbolizer:function(B){var A=OpenLayers.Format.SLD.v1_0_0.prototype.writers;var C=A.sld["LineSymbolizer"].apply(this,arguments);return this.addVendorOptions(C,B)},PolygonSymbolizer:function(B){var A=OpenLayers.Format.SLD.v1_0_0.prototype.writers;var C=A.sld["PolygonSymbolizer"].apply(this,arguments);return this.addVendorOptions(C,B)}},OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.writers),addVendorOptions:function(D,C){var A=C.vendorOptions;if(A){for(var B in C.vendorOptions){this.writeNode("VendorOption",{name:B,value:C.vendorOptions[B]},D)}}return D},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0_GeoServer"});OpenLayers.Protocol.CSW=function(B){B=OpenLayers.Util.applyDefaults(B,OpenLayers.Protocol.CSW.DEFAULTS);var A=OpenLayers.Protocol.CSW["v"+B.version.replace(/\./g,"_")];if(!A){throw"Unsupported CSW version: "+B.version}return new A(B)};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(A){OpenLayers.Protocol.WFS.v1.prototype.initialize.apply(this,arguments);if(this.outputFormat&&!this.readFormat){if(this.outputFormat.toLowerCase()=="gml2"){this.readFormat=new OpenLayers.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName})}else{if(this.outputFormat.toLowerCase()=="json"){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":true},createLayer:function(E,F){var J;var K={layer:true,matrixSet:true};for(var C in K){if(!(C in F)){throw new Error("Missing property '"+C+"' in layer configuration.")}}var G=E.contents;var D=G.tileMatrixSets[F.matrixSet];var I=G.layers;var B;for(var H=0,L=G.layers.length;H<L;++H){if(G.layers[H].identifier===F.layer){B=G.layers[H];break}}if(B&&D){var A;for(var H=0,L=B.styles.length;H<L;++H){A=B.styles[H];if(A.isDefault){break}}J=new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults(F,{url:F.requestEncoding==="REST"&&B.resourceUrl?B.resourceUrl.tile.template:E.operationsMetadata.GetTile.dcp.http.get[0].url,name:B.title,style:A.identifier,matrixIds:D.matrixIds,tileFullExtent:D.bounds}))}return J},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities"});OpenLayers.Layer.Google.v3={DEFAULTS:{sphericalMercator:true,projection:"EPSG:900913"},animationEnabled:true,loadMapObject:function(){if(!this.type){this.type=google.maps.MapTypeId.ROADMAP}var D;var C=OpenLayers.Layer.Google.cache[this.map.id];if(C){D=C.mapObject;++C.count}else{var B=this.map.viewPortDiv;var E=document.createElement("div");E.id=this.map.id+"_GMapContainer";E.style.position="absolute";E.style.width="100%";E.style.height="100%";B.appendChild(E);var A=this.map.getCenter();D=new google.maps.Map(E,{center:A?new google.maps.LatLng(A.lat,A.lon):new google.maps.LatLng(0,0),zoom:this.map.getZoom()||0,mapTypeId:this.type,disableDefaultUI:true,keyboardShortcuts:false,draggable:false,disableDoubleClickZoom:true,scrollwheel:false,streetViewControl:false});C={mapObject:D,count:1};OpenLayers.Layer.Google.cache[this.map.id]=C;this.repositionListener=google.maps.event.addListenerOnce(D,"center_changed",OpenLayers.Function.bind(this.repositionMapElements,this))}this.mapObject=D;this.setGMapVisibility(this.visibility)},repositionMapElements:function(){google.maps.event.trigger(this.mapObject,"resize");var F=this.mapObject.getDiv().firstChild;if(!F||F.childNodes.length<3){this.repositionTimer=window.setTimeout(OpenLayers.Function.bind(this.repositionMapElements,this),250);return false}var D=OpenLayers.Layer.Google.cache[this.map.id];var B=this.map.viewPortDiv;for(var E=F.children.length-1;E>=0;--E){if(F.children[E].style.zIndex==1000001){var C=F.children[E];B.appendChild(C);C.style.zIndex="1100";C.style.bottom="";C.className="olLayerGoogleCopyright olLayerGoogleV3";C.style.display="";D.termsOfUse=C}else{if(F.children[E].style.zIndex==1000000){var A=F.children[E];B.appendChild(A);A.style.zIndex="1100";A.style.bottom="";A.className="olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";A.style.display="";D.poweredBy=A}else{if(F.children[E].style.zIndex==10000002){B.appendChild(F.children[E])}}}}this.setGMapVisibility(this.visibility)},onMapResize:function(){if(this.visibility){google.maps.event.trigger(this.mapObject,"resize")}else{var A=OpenLayers.Layer.Google.cache[this.map.id];if(!A.resized){var B=this;google.maps.event.addListenerOnce(this.mapObject,"tilesloaded",function(){google.maps.event.trigger(B.mapObject,"resize");B.moveTo(B.map.getCenter(),B.map.getZoom());delete A.resized})}A.resized=true}},setGMapVisibility:function(G){var B=OpenLayers.Layer.Google.cache[this.map.id];if(B){var E=this.type;var F=this.map.layers;var D;for(var C=F.length-1;C>=0;--C){D=F[C];if(D instanceof OpenLayers.Layer.Google&&D.visibility===true&&D.inRange===true){E=D.type;G=true;break}}var A=this.mapObject.getDiv();if(G===true){this.mapObject.setMapTypeId(E);A.style.left="";if(B.termsOfUse&&B.termsOfUse.style){B.termsOfUse.style.left="";B.termsOfUse.style.display="";B.poweredBy.style.display=""}B.displayed=this.id}else{delete B.displayed;A.style.left="-9999px";if(B.termsOfUse&&B.termsOfUse.style){B.termsOfUse.style.display="none";B.termsOfUse.style.left="-9999px";B.poweredBy.style.display="none"}}}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(C){var B=null;if(C!=null){var A=this.sphericalMercator?this.inverseMercator(C.bottom,C.left):new OpenLayers.LonLat(C.bottom,C.left);var D=this.sphericalMercator?this.inverseMercator(C.top,C.right):new OpenLayers.LonLat(C.top,C.right);B=new google.maps.LatLngBounds(new google.maps.LatLng(A.lat,A.lon),new google.maps.LatLng(D.lat,D.lon))}return B},getMapObjectLonLatFromMapObjectPixel:function(H){var B=this.map.getSize();var F=this.getLongitudeFromMapObjectLonLat(this.mapObject.center);var D=this.getLatitudeFromMapObjectLonLat(this.mapObject.center);var A=this.map.getResolution();var G=H.x-(B.w/2);var E=H.y-(B.h/2);var C=new OpenLayers.LonLat(F+G*A,D-E*A);if(this.wrapDateLine){C=C.wrapDateLine(this.maxExtent)}return this.getMapObjectLonLatFromLonLat(C.lon,C.lat)},getMapObjectPixelFromMapObjectLonLat:function(E){var D=this.getLongitudeFromMapObjectLonLat(E);var C=this.getLatitudeFromMapObjectLonLat(E);var A=this.map.getResolution();var B=this.map.getExtent();return this.getMapObjectPixelFromXY((1/A*(D-B.left)),(1/A*(B.top-C)))},setMapObjectCenter:function(A,C){if(this.animationEnabled===false&&C!=this.mapObject.zoom){var B=this.getMapContainer();google.maps.event.addListenerOnce(this.mapObject,"idle",function(){B.style.visibility=""});B.style.visibility="hidden"}this.mapObject.setOptions({center:A,zoom:C})},getMapObjectZoomFromMapObjectBounds:function(A){return this.mapObject.getBoundsZoomLevel(A)},getMapObjectLonLatFromLonLat:function(D,B){var C;if(this.sphericalMercator){var A=this.inverseMercator(D,B);C=new google.maps.LatLng(A.lat,A.lon)}else{C=new google.maps.LatLng(B,D)}return C},getMapObjectPixelFromXY:function(A,B){return new google.maps.Point(A,B)},destroy:function(){if(this.repositionListener){google.maps.event.removeListener(this.repositionListener)}if(this.repositionTimer){window.clearTimeout(this.repositionTimer)}OpenLayers.Layer.Google.prototype.destroy.apply(this,arguments)}};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(A){if(typeof A=="string"){A=OpenLayers.Format.XML.prototype.read.apply(this,[A])}if(A&&A.nodeType==9){A=A.documentElement}var B={};this.readNode(A,B);return B},readers:{wps:{ProcessDescriptions:function(A,B){B.processDescriptions={};this.readChildNodes(A,B.processDescriptions)},ProcessDescription:function(C,A){var D=this.getAttributeNS(C,this.namespaces.wps,"processVersion");var B={processVersion:D,statusSupported:(C.getAttribute("statusSupported")==="true"),storeSupported:(C.getAttribute("storeSupported")==="true")};this.readChildNodes(C,B);A[B.identifier]=B},DataInputs:function(B,A){A.dataInputs=[];this.readChildNodes(B,A.dataInputs)},ProcessOutputs:function(B,A){A.processOutputs=[];this.readChildNodes(B,A.processOutputs)},Output:function(C,B){var A={};this.readChildNodes(C,A);B.push(A)},ComplexOutput:function(B,A){A.complexOutput={};this.readChildNodes(B,A.complexOutput)},Input:function(C,B){var A={maxOccurs:parseInt(C.getAttribute("maxOccurs")),minOccurs:parseInt(C.getAttribute("minOccurs"))};this.readChildNodes(C,A);B.push(A)},BoundingBoxData:function(B,A){A.boundingBoxData={};this.readChildNodes(B,A.boundingBoxData)},CRS:function(A,B){if(!B.CRSs){B.CRSs={}}B.CRSs[this.getChildValue(A)]=true},LiteralData:function(B,A){A.literalData={};this.readChildNodes(B,A.literalData)},ComplexData:function(B,A){A.complexData={};this.readChildNodes(B,A.complexData)},Default:function(B,A){A["default"]={};this.readChildNodes(B,A["default"])},Supported:function(B,A){A.supported={};this.readChildNodes(B,A.supported)},Format:function(A,C){var B={};this.readChildNodes(A,B);if(!C.formats){C.formats={}}C.formats[B.mimeType]=true},MimeType:function(A,B){B.mimeType=this.getChildValue(A)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSDescribeProcess"});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(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(A){if(typeof A=="string"){A=OpenLayers.Format.XML.prototype.read.apply(this,[A])}if(A&&A.nodeType==9){A=A.documentElement}var B={};this.readNode(A,B);return B},readers:{csw:{GetRecordsResponse:function(B,C){C.records=[];this.readChildNodes(B,C);var A=this.getAttributeNS(B,"","version");if(A!=""){C.version=A}},RequestId:function(A,B){B.RequestId=this.getChildValue(A)},SearchStatus:function(A,C){C.SearchStatus={};var B=this.getAttributeNS(A,"","timestamp");if(B!=""){C.SearchStatus.timestamp=B}},SearchResults:function(D,E){this.readChildNodes(D,E);var B=D.attributes;var F={};for(var C=0,A=B.length;C<A;++C){if((B[C].name=="numberOfRecordsMatched")||(B[C].name=="numberOfRecordsReturned")||(B[C].name=="nextRecord")){F[B[C].name]=parseInt(B[C].nodeValue)}else{F[B[C].name]=B[C].nodeValue}}E.SearchResults=F},SummaryRecord:function(B,C){var A={type:"SummaryRecord"};this.readChildNodes(B,A);C.records.push(A)},BriefRecord:function(B,C){var A={type:"BriefRecord"};this.readChildNodes(B,A);C.records.push(A)},DCMIRecord:function(B,C){var A={type:"DCMIRecord"};this.readChildNodes(B,A);C.records.push(A)},Record:function(B,C){var A={type:"Record"};this.readChildNodes(B,A);C.records.push(A)},"*":function(B,C){var A=B.localName||B.nodeName.split(":").pop();C[A]=this.getChildValue(B)}},geonet:{info:function(B,C){var A={};this.readChildNodes(B,A);C.gninfo=A}},dc:{"*":function(F,G){var D=F.localName||F.nodeName.split(":").pop();if(!(OpenLayers.Util.isArray(G[D]))){G[D]=[]}var C={};var B=F.attributes;for(var E=0,A=B.length;E<A;++E){C[B[E].name]=B[E].nodeValue}C.value=this.getChildValue(F);if(C.value!=""){G[D].push(C)}}},dct:{"*":function(B,C){var A=B.localName||B.nodeName.split(":").pop();if(!(OpenLayers.Util.isArray(C[A]))){C[A]=[]}C[A].push(this.getChildValue(B))}},ows:OpenLayers.Util.applyDefaults({BoundingBox:function(A,B){if(B.bounds){B.BoundingBox=[{crs:B.projection,value:[B.bounds.left,B.bounds.bottom,B.bounds.right,B.bounds.top]}];delete B.projection;delete B.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(A){var B=this.writeNode("csw:GetRecords",A);B.setAttribute("xmlns:gmd",this.namespaces.gmd);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},writers:{csw:{GetRecords:function(B){if(!B){B={}}var E=this.createElementNSPlus("csw:GetRecords",{attributes:{service:"CSW",version:this.version,requestId:B.requestId||this.requestId,resultType:B.resultType||this.resultType,outputFormat:B.outputFormat||this.outputFormat,outputSchema:B.outputSchema||this.outputSchema,startPosition:B.startPosition||this.startPosition,maxRecords:B.maxRecords||this.maxRecords}});if(B.DistributedSearch||this.DistributedSearch){this.writeNode("csw:DistributedSearch",B.DistributedSearch||this.DistributedSearch,E)}var D=B.ResponseHandler||this.ResponseHandler;if(OpenLayers.Util.isArray(D)&&D.length>0){for(var C=0,A=D.length;C<A;C++){this.writeNode("csw:ResponseHandler",D[C],E)}}this.writeNode("Query",B.Query||this.Query,E);return E},DistributedSearch:function(A){var B=this.createElementNSPlus("csw:DistributedSearch",{attributes:{hopCount:A.hopCount}});return B},ResponseHandler:function(A){var B=this.createElementNSPlus("csw:ResponseHandler",{value:A.value});return B},Query:function(B){if(!B){B={}}var E=this.createElementNSPlus("csw:Query",{attributes:{typeNames:B.typeNames||"csw:Record"}});var D=B.ElementName;if(OpenLayers.Util.isArray(D)&&D.length>0){for(var C=0,A=D.length;C<A;C++){this.writeNode("csw:ElementName",D[C],E)}}else{this.writeNode("csw:ElementSetName",B.ElementSetName||{value:"summary"},E)}if(B.Constraint){this.writeNode("csw:Constraint",B.Constraint,E)}if(B.SortBy){this.writeNode("ogc:SortBy",B.SortBy,E)}return E},ElementName:function(A){var B=this.createElementNSPlus("csw:ElementName",{value:A.value});return B},ElementSetName:function(A){var B=this.createElementNSPlus("csw:ElementSetName",{attributes:{typeNames:A.typeNames},value:A.value});return B},Constraint:function(A){var B=this.createElementNSPlus("csw:Constraint",{attributes:{version:A.version}});if(A.Filter){var C=new OpenLayers.Format.Filter({version:A.version});B.appendChild(C.write(A.Filter))}else{if(A.CqlText){var D=this.createElementNSPlus("CqlText",{value:A.CqlText.value});B.appendChild(D)}}return B}},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(B,C,A){this.bounds=B;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div);this.setBorder(C,A)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(A,B){if(!A){A="red"}if(!B){B=2}this.div.style.border=B+"px solid "+A},draw:function(A,B){OpenLayers.Util.modifyDOMElement(this.div,null,A,B);return this.div},onScreen:function(){var B=false;if(this.map){var A=this.map.getExtent();B=A.containsBounds(this.bounds,true,true)}return B},display:function(A){this.div.style.display=(A)?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:true,initialize:function(A){A=A||{};if(A.extractStyles!==false){A.defaultStyle={externalGraphic:OpenLayers.Util.getImageLocation("marker.png"),graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5}}OpenLayers.Format.prototype.initialize.apply(this,[A])},read:function(J){var A=J.split("\n");var B;var G=[];for(var T=0;T<(A.length-1);T++){var S=A[T].replace(/^\s*/,"").replace(/\s*$/,"");if(S.charAt(0)!="#"){if(!B){B=S.split("\t")}else{var L=S.split("\t");var D=new OpenLayers.Geometry.Point(0,0);var H={};var P=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null;var Q,R,C,N;var K=false;for(var I=0;I<L.length;I++){if(L[I]){if(B[I]=="point"){var O=L[I].split(",");D.y=parseFloat(O[0]);D.x=parseFloat(O[1]);K=true}else{if(B[I]=="lat"){D.y=parseFloat(L[I]);K=true}else{if(B[I]=="lon"){D.x=parseFloat(L[I]);K=true}else{if(B[I]=="title"){H.title=L[I]}else{if(B[I]=="image"||B[I]=="icon"&&P){P.externalGraphic=L[I]}else{if(B[I]=="iconSize"&&P){var M=L[I].split(",");P.graphicWidth=parseFloat(M[0]);P.graphicHeight=parseFloat(M[1])}else{if(B[I]=="iconOffset"&&P){var F=L[I].split(",");P.graphicXOffset=parseFloat(F[0]);P.graphicYOffset=parseFloat(F[1])}else{if(B[I]=="description"){H.description=L[I]}else{if(B[I]=="overflow"){H.overflow=L[I]}else{H[B[I]]=L[I]}}}}}}}}}}}if(K){if(this.internalProjection&&this.externalProjection){D.transform(this.externalProjection,this.internalProjection)}var E=new OpenLayers.Feature.Vector(D,H,P);G.push(E)}}}}return G},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(B,A){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadText:function(){if(!this.loaded){if(this.location!=null){var A=function(B){this.events.triggerEvent("loadend")};this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:A,scope:this});this.loaded=true}}},moveTo:function(C,A,B){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadText()}},parseData:function(J){var L=J.responseText;var N={};OpenLayers.Util.extend(N,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){N.externalProjection=this.projection;N.internalProjection=this.map.getProjectionObject()}var B=new OpenLayers.Format.Text(N);var C=B.read(L);for(var G=0,H=C.length;G<H;G++){var F={};var M=C[G];var K;var I,D;K=new OpenLayers.LonLat(M.geometry.x,M.geometry.y);if(M.style.graphicWidth&&M.style.graphicHeight){I=new OpenLayers.Size(M.style.graphicWidth,M.style.graphicHeight)}if(M.style.graphicXOffset!==undefined&&M.style.graphicYOffset!==undefined){D=new OpenLayers.Pixel(M.style.graphicXOffset,M.style.graphicYOffset)}if(M.style.externalGraphic!=null){F.icon=new OpenLayers.Icon(M.style.externalGraphic,I,D)}else{F.icon=OpenLayers.Marker.defaultIcon();if(I!=null){F.icon.setSize(I)}}if((M.attributes.title!=null)&&(M.attributes.description!=null)){F.popupContentHTML="<h2>"+M.attributes.title+"</h2><p>"+M.attributes.description+"</p>"}F.overflow=M.attributes.overflow||"auto";var A=new OpenLayers.Feature(this,K,F);this.features.push(A);var E=A.createMarker();if((M.attributes.title!=null)&&(M.attributes.description!=null)){E.events.register("click",A,this.markerClick)}this.addMarker(E)}this.events.triggerEvent("loadend")},markerClick:function(B){var D=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!D)?this:null;for(var C=0,A=this.layer.map.popups.length;C<A;C++){this.layer.map.removePopup(this.layer.map.popups[C])}if(!D){this.layer.map.addPopup(this.createPopup())}OpenLayers.Event.stop(B)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var A=this.features[0];OpenLayers.Util.removeItem(this.features,A);A.destroy()}}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",layerOptions:null,persist:false,irregular:false,citeCompliant:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(C,B,A){if(!(A&&A.layerOptions&&A.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.Drag.prototype.initialize.apply(this,[C,B,A]);this.options=(A)?A:{}},setOptions:function(A){OpenLayers.Util.extend(this.options,A);OpenLayers.Util.extend(this,A)},activate:function(){var A=false;if(OpenLayers.Handler.Drag.prototype.activate.apply(this,arguments)){var B=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,B);this.map.addLayer(this.layer);A=true}return A},deactivate:function(){var A=false;if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel()}if(this.layer.map!=null){this.layer.destroy(false);if(this.feature){this.feature.destroy()}}this.layer=null;this.feature=null;A=true}return A},down:function(A){this.fixedRadius=!!(this.radius);var B=this.layer.getLonLatFromViewPortPx(A.xy);this.origin=new OpenLayers.Geometry.Point(B.lon,B.lat);if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution()}if(this.persist){this.clear()}this.feature=new OpenLayers.Feature.Vector();this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature],{silent:true});this.layer.drawFeature(this.feature,this.style)},move:function(C){var F=this.layer.getLonLatFromViewPortPx(C.xy);var A=new OpenLayers.Geometry.Point(F.lon,F.lat);if(this.irregular){var G=Math.sqrt(2)*Math.abs(A.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,G)}else{if(this.fixedRadius){this.origin=A}else{this.calculateAngle(A,C);this.radius=Math.max(this.map.getResolution()/2,A.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var D=A.x-this.origin.x;var B=A.y-this.origin.y;var E;if(B==0){E=D/(this.radius*Math.sqrt(2))}else{E=D/B}this.feature.geometry.resize(1,this.origin,E);this.feature.geometry.move(D/2,B/2)}this.layer.drawFeature(this.feature,this.style)},up:function(A){this.finalize();if(this.start==this.last){this.callback("done",[A.xy])}},out:function(A){this.finalize()},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180)}this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var D,A;var B=this.feature.geometry.components[0];if(B.components.length!=(this.sides+1)){this.createGeometry();B=this.feature.geometry.components[0]}for(var C=0;C<this.sides;++C){A=B.components[C];D=this.angle+(C*2*Math.PI/this.sides);A.x=this.origin.x+(this.radius*Math.cos(D));A.y=this.origin.y+(this.radius*Math.sin(D));A.clearBounds()}},calculateAngle:function(A,B){var D=Math.atan2(A.y-this.origin.y,A.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!B[this.snapToggle])){var C=(Math.PI/180)*this.snapAngle;this.angle=Math.round(D/C)*C}else{this.angle=D}},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){if(this.layer){this.layer.renderer.clear();this.layer.destroyFeatures()}},callback:function(B,A){if(this.callbacks[B]){this.callbacks[B].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(B=="done"||B=="cancel")){this.clear()}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Control.SLDSelect=OpenLayers.Class(OpenLayers.Control,{clearOnDeactivate:false,layers:null,callbacks:null,selectionSymbolizer:{Polygon:{fillColor:"#FF0000",stroke:false},Line:{strokeColor:"#FF0000",strokeWidth:2},Point:{graphicName:"square",fillColor:"#FF0000",pointRadius:5}},layerOptions:null,handlerOptions:null,sketchStyle:null,wfsCache:{},layerCache:{},initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);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:false,tileOptions:{maxGetUrlLength:2048}});if(this.sketchStyle){this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":this.sketchStyle})})}this.handler=new B(this,this.callbacks,this.handlerOptions)},destroy:function(){for(var A in this.layerCache){delete this.layerCache[A]}for(var A in this.wfsCache){delete this.wfsCache[A]}OpenLayers.Control.prototype.destroy.apply(this,arguments)},coupleLayerVisiblity:function(A){this.setVisibility(A.object.getVisibility())},createSelectionLayer:function(B){var A;if(!this.layerCache[B.id]){A=new OpenLayers.Layer.WMS(B.name,B.url,B.params,OpenLayers.Util.applyDefaults(this.layerOptions,B.getOptions()));this.layerCache[B.id]=A;if(this.layerOptions.displayInLayerSwitcher===false){B.events.on({visibilitychanged:this.coupleLayerVisiblity,scope:A})}this.map.addLayer(A)}else{A=this.layerCache[B.id]}return A},createSLD:function(F,D,G){var A={version:"1.0.0",namedLayers:{}};var I=[F.params.LAYERS].join(",").split(",");for(var E=0,H=I.length;E<H;E++){var B=I[E];A.namedLayers[B]={name:B,userStyles:[]};var K=this.selectionSymbolizer;var J=G[E];if(J.type.indexOf("Polygon")>=0){K={Polygon:this.selectionSymbolizer.Polygon}}else{if(J.type.indexOf("LineString")>=0){K={Line:this.selectionSymbolizer.Line}}else{if(J.type.indexOf("Point")>=0){K={Point:this.selectionSymbolizer.Point}}}}var C=D[E];A.namedLayers[B].userStyles.push({name:"default",rules:[new OpenLayers.Rule({symbolizer:K,filter:C,maxScaleDenominator:F.options.minScale})]})}return new OpenLayers.Format.SLD({srsName:this.map.getProjection()}).write(A)},parseDescribeLayer:function(C){var G=new OpenLayers.Format.WMSDescribeLayer();var H=C.responseXML;if(!H||!H.documentElement){H=C.responseText}var B=G.read(H);var F=[];var A=null;for(var D=0,E=B.length;D<E;D++){if(B[D].owsType=="WFS"){F.push(B[D].typeName);A=B[D].owsURL}}var I={url:A,params:{SERVICE:"WFS",TYPENAME:F.toString(),REQUEST:"DescribeFeatureType",VERSION:"1.0.0"},callback:function(K){var M=new OpenLayers.Format.WFSDescribeFeatureType();var L=K.responseXML;if(!L||!L.documentElement){L=K.responseText}var J=M.read(L);this.control.wfsCache[this.layer.id]=J;this.control._queue&&this.control.applySelection()},scope:this};OpenLayers.Request.GET(I)},getGeometryAttributes:function(D){var K=[];var A=this.wfsCache[D.id];for(var C=0,E=A.featureTypes.length;C<E;C++){var H=A.featureTypes[C];var F=H.properties;for(var B=0,J=F.length;B<J;B++){var I=F[B];var G=I.type;if((G.indexOf("LineString")>=0)||(G.indexOf("GeometryAssociationType")>=0)||(G.indexOf("GeometryPropertyType")>=0)||(G.indexOf("Point")>=0)||(G.indexOf("Polygon")>=0)){K.push(I)}}}return K},activate:function(){var B=OpenLayers.Control.prototype.activate.call(this);if(B){for(var E=0,A=this.layers.length;E<A;E++){var D=this.layers[E];if(D&&!this.wfsCache[D.id]){var C={url:D.url,params:{SERVICE:"WMS",VERSION:D.params.VERSION,LAYERS:D.params.LAYERS,REQUEST:"DescribeLayer"},callback:this.parseDescribeLayer,scope:{layer:D,control:this}};OpenLayers.Request.GET(C)}}}return B},deactivate:function(){var F=OpenLayers.Control.prototype.deactivate.call(this);if(F){for(var E=0,A=this.layers.length;E<A;E++){var D=this.layers[E];if(D&&this.clearOnDeactivate===true){var C=this.layerCache;var B=C[D.id];if(B){D.events.un({visibilitychanged:this.coupleLayerVisiblity,scope:B});B.destroy();delete C[D.id]}}}}return F},setLayers:function(A){if(this.active){this.deactivate();this.layers=A;this.activate()}else{this.layers=A}},createFilter:function(A,C){var B=null;if(this.handler instanceof OpenLayers.Handler.RegularPolygon){if(this.handler.irregular===true){B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:A.name,value:C.getBounds()})}else{B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:A.name,value:C})}}else{if(this.handler instanceof OpenLayers.Handler.Polygon){B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:A.name,value:C})}else{if(this.handler instanceof OpenLayers.Handler.Path){if(A.type.indexOf("Point")>=0){B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:A.name,distance:this.map.getExtent().getWidth()*0.01,distanceUnits:this.map.getUnits(),value:C})}else{B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:A.name,value:C})}}else{if(this.handler instanceof OpenLayers.Handler.Click){if(A.type.indexOf("Polygon")>=0){B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:A.name,value:C})}else{B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:A.name,distance:this.map.getExtent().getWidth()*0.01,distanceUnits:this.map.getUnits(),value:C})}}}}}return B},select:function(A){this._queue=function(){for(var G=0,J=this.layers.length;G<J;G++){var H=this.layers[G];var I=this.getGeometryAttributes(H);var D=[];for(var F=0,L=I.length;F<L;F++){var M=I[F];if(M!==null){if(!(A instanceof OpenLayers.Geometry)){var K=this.map.getLonLatFromPixel(A.xy);A=new OpenLayers.Geometry.Point(K.lon,K.lat)}var C=this.createFilter(M,A);if(C!==null){D.push(C)}}}var E=this.createSelectionLayer(H);var B=this.createSLD(H,D,I);this.events.triggerEvent("selected",{layer:H,filters:D});E.mergeNewParams({SLD_BODY:B});delete this._queue}};this.applySelection()},applySelection:function(){var C=true;for(var B=0,A=this.layers.length;B<A;B++){if(!this.wfsCache[this.layers[B].id]){C=false;break}}C&&this._queue.call(this)},CLASS_NAME:"OpenLayers.Control.SLDSelect"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,geodesic:false,initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.element=OpenLayers.Util.getElement(B)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.element=document.createElement("div");this.div.appendChild(this.element)}this.map.events.register("moveend",this,this.updateScale);this.updateScale();return this.div},updateScale:function(){var C;if(this.geodesic===true){var A=this.map.getUnits();if(!A){return }var B=OpenLayers.INCHES_PER_UNIT;C=(this.map.getGeodesicPixelSize().w||0.000001)*B.km*OpenLayers.DOTS_PER_INCH}else{C=this.map.getScale()}if(!C){return }if(C>=9500&&C<=950000){C=Math.round(C/1000)+"K"}else{if(C>=950000){C=Math.round(C/1000000)+"M"}else{C=Math.round(C)}}this.element.innerHTML=OpenLayers.i18n("Scale = 1 : ${scaleDenom}",{scaleDenom:C})},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,useHttpTile:false,singleTile:false,useOverlay:false,useAsyncOverlay:true,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300,300),tileOriginCorner:"tl",initialize:function(C,B,D,A){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(A==null||A.isBaseLayer==null){this.isBaseLayer=((this.transparent!="true")&&(this.transparent!=true))}if(A&&A.useOverlay!=null){this.useOverlay=A.useOverlay}if(this.singleTile){if(this.useOverlay){OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS);if(!this.useAsyncOverlay){this.params.version="1.0.0"}}else{OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS)}}else{if(this.useHttpTile){OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS)}else{OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS)}this.setTileSize(this.defaultSize)}},clone:function(A){if(A==null){A=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(A){var D;var B=A.getCenterLonLat();var H=this.map.getSize();if(this.singleTile){var E={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:H.h*this.ratio,setdisplaywidth:H.w*this.ratio,setviewcenterx:B.lon,setviewcentery:B.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var I={};I=OpenLayers.Util.extend(I,E);I.operation="GETVISIBLEMAPEXTENT";I.version="1.0.0";I.session=this.params.session;I.mapName=this.params.mapName;I.format="text/xml";D=this.getFullRequestString(I);OpenLayers.Request.GET({url:D,async:false})}D=this.getFullRequestString(E)}else{var G=this.map.getResolution();var F=Math.floor((A.left-this.maxExtent.left)/G);F=Math.round(F/this.tileSize.w);var C=Math.floor((this.maxExtent.top-A.top)/G);C=Math.round(C/this.tileSize.h);if(this.useHttpTile){D=this.getImageFilePath({tilecol:F,tilerow:C,scaleindex:this.resolutions.length-this.map.zoom-1})}else{D=this.getFullRequestString({tilecol:F,tilerow:C,scaleindex:this.resolutions.length-this.map.zoom-1})}}return D},getFullRequestString:function(F,E){var B=(E==null)?this.url:E;if(typeof B=="object"){B=B[Math.floor(Math.random()*B.length)]}var I=B;var G=OpenLayers.Util.extend({},this.params);G=OpenLayers.Util.extend(G,F);var D=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(B));for(var H in G){if(H.toUpperCase() in D){delete G[H]}}var A=OpenLayers.Util.getParameterString(G);A=A.replace(/,/g,"+");if(A!=""){var C=B.charAt(B.length-1);if((C=="&")||(C=="?")){I+=A}else{if(B.indexOf("?")==-1){I+="?"+A}else{I+="&"+A}}}return I},getImageFilePath:function(G,E){var C=(E==null)?this.url:E;if(typeof C=="object"){C=C[Math.floor(Math.random()*C.length)]}var B=C;var D="";var F="";if(G.tilerow<0){D="-"}if(G.tilerow==0){D+="0"}else{D+=Math.floor(Math.abs(G.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(G.tilecol<0){F="-"}if(G.tilecol==0){F+="0"}else{F+=Math.floor(Math.abs(G.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var A="/S"+Math.floor(G.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+D+"/C"+F+"/"+(G.tilerow%this.params.tileRowsPerFolder)+"_"+(G.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){A+="?"+this.params.querystring}B+=A;return B},calculateGridLayout:function(A,N,E){var K=E*this.tileSize.w;var C=E*this.tileSize.h;var I=A.left-N.lon;var L=Math.floor(I/K)-this.buffer;var J=I/K-L;var F=-J*this.tileSize.w;var M=N.lon+L*K;var B=N.lat-A.top+C;var H=Math.floor(B/C)-this.buffer;var O=H-B/C;var D=O*this.tileSize.h;var G=N.lat-C*H;return{tilelon:K,tilelat:C,tileoffsetlon:M,tileoffsetlat:G,tileoffsetx:F,tileoffsety:D}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:false,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:false,immediate:false,initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);var C={done:this.measureComplete,point:this.measurePartial};if(this.immediate){C.modify=this.measureImmediate}this.callbacks=OpenLayers.Util.extend(C,this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new B(this,this.callbacks,this.handlerOptions)},deactivate:function(){this.cancelDelay();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},cancel:function(){this.cancelDelay();this.handler.cancel()},setImmediate:function(A){this.immediate=A;if(this.immediate){this.callbacks.modify=this.measureImmediate}else{delete this.callbacks.modify}},updateHandler:function(B,A){var C=this.active;if(C){this.deactivate()}this.handler=new B(this,this.callbacks,A);if(C){this.activate()}},measureComplete:function(A){this.cancelDelay();this.measure(A,"measure")},measurePartial:function(A,B){this.cancelDelay();B=B.clone();if(this.handler.freehandMode(this.handler.evt)){this.measure(B,"measurepartial")}else{this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.delayedTrigger=null;this.measure(B,"measurepartial")},this),this.partialDelay)}},measureImmediate:function(A,C,B){if(B&&!this.handler.freehandMode(this.handler.evt)){this.cancelDelay();this.measure(C.geometry,"measurepartial")}},cancelDelay:function(){if(this.delayedTrigger!==null){window.clearTimeout(this.delayedTrigger);this.delayedTrigger=null}},measure:function(D,B){var C,A;if(D.CLASS_NAME.indexOf("LineString")>-1){C=this.getBestLength(D);A=1}else{C=this.getBestArea(D);A=2}this.events.triggerEvent(B,{measure:C[0],units:C[1],order:A,geometry:D})},getBestArea:function(F){var B=this.displaySystemUnits[this.displaySystem];var E,D;for(var C=0,A=B.length;C<A;++C){E=B[C];D=this.getArea(F,E);if(D>1){break}}return[D,E]},getArea:function(F,A){var B,C;if(this.geodesic){B=F.getGeodesicArea(this.map.getProjectionObject());C="m"}else{B=F.getArea();C=this.map.getUnits()}var E=OpenLayers.INCHES_PER_UNIT[A];if(E){var D=OpenLayers.INCHES_PER_UNIT[C];B*=Math.pow((D/E),2)}return B},getBestLength:function(F){var B=this.displaySystemUnits[this.displaySystem];var E,D;for(var C=0,A=B.length;C<A;++C){E=B[C];D=this.getLength(F,E);if(D>1){break}}return[D,E]},getLength:function(F,A){var B,C;if(this.geodesic){B=F.getGeodesicLength(this.map.getProjectionObject());C="m"}else{B=F.getLength();C=this.map.getUnits()}var E=OpenLayers.INCHES_PER_UNIT[A];if(E){var D=OpenLayers.INCHES_PER_UNIT[C];B*=(D/E)}return B},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(A){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[A])},read_wmc_SRS:function(F,E){var D=this.getChildValue(E);if(typeof F.projections!="object"){F.projections={}}var B=D.split(/ +/);for(var C=0,A=B.length;C<A;C++){F.projections[B[C]]=true}},write_wmc_Layer:function(B){var C=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[B]);if(B.srs){var D=[];for(var A in B.srs){D.push(A)}C.appendChild(this.createElementDefaultNS("SRS",D.join(" ")))}C.appendChild(this.write_wmc_FormatList(B));C.appendChild(this.write_wmc_StyleList(B));if(B.dimensions){C.appendChild(this.write_wmc_DimensionList(B))}C.appendChild(this.write_wmc_LayerExtension(B))},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(B){OpenLayers.Format.XML.prototype.initialize.apply(this,[B]);this.options=B;var A=OpenLayers.Util.extend({},OpenLayers.Format.WMTSCapabilities.prototype.yx);this.yx=OpenLayers.Util.extend(A,this.yx)},read:function(B){if(typeof B=="string"){B=OpenLayers.Format.XML.prototype.read.apply(this,[B])}if(B&&B.nodeType==9){B=B.documentElement}var A={};this.readNode(B,A);A.version=this.version;return A},readers:{wmts:{Capabilities:function(A,B){this.readChildNodes(A,B)},Contents:function(A,B){B.contents={};B.contents.layers=[];B.contents.tileMatrixSets={};this.readChildNodes(A,B.contents)},Layer:function(B,C){var A={styles:[],formats:[],dimensions:[],tileMatrixSetLinks:[]};A.layers=[];this.readChildNodes(B,A);C.layers.push(A)},Style:function(B,C){var A={};A.isDefault=(B.getAttribute("isDefault")==="true");this.readChildNodes(B,A);C.styles.push(A)},Format:function(A,B){B.formats.push(this.getChildValue(A))},TileMatrixSetLink:function(B,C){var A={};this.readChildNodes(B,A);C.tileMatrixSetLinks.push(A)},TileMatrixSet:function(B,C){if(C.layers){var A={matrixIds:[]};this.readChildNodes(B,A);C.tileMatrixSets[A.identifier]=A}else{C.tileMatrixSet=this.getChildValue(B)}},TileMatrix:function(B,C){var A={supportedCRS:C.supportedCRS};this.readChildNodes(B,A);C.matrixIds.push(A)},ScaleDenominator:function(A,B){B.scaleDenominator=parseFloat(this.getChildValue(A))},TopLeftCorner:function(D,F){var C=this.getChildValue(D);var E=C.split(" ");var A;if(F.supportedCRS){var B=F.supportedCRS.replace(/urn:ogc:def:crs:(\w+):.+:(\w+)$/,"urn:ogc:def:crs:$1::$2");A=!!this.yx[B]}if(A){F.topLeftCorner=new OpenLayers.LonLat(E[1],E[0])}else{F.topLeftCorner=new OpenLayers.LonLat(E[0],E[1])}},TileWidth:function(A,B){B.tileWidth=parseInt(this.getChildValue(A))},TileHeight:function(A,B){B.tileHeight=parseInt(this.getChildValue(A))},MatrixWidth:function(A,B){B.matrixWidth=parseInt(this.getChildValue(A))},MatrixHeight:function(A,B){B.matrixHeight=parseInt(this.getChildValue(A))},ResourceURL:function(A,B){B.resourceUrl=B.resourceUrl||{};B.resourceUrl[A.getAttribute("resourceType")]={format:A.getAttribute("format"),template:A.getAttribute("template")}},WSDL:function(A,B){B.wsdl={};B.wsdl.href=A.getAttribute("xlink:href")},ServiceMetadataURL:function(A,B){B.serviceMetadataUrl={};B.serviceMetadataUrl.href=A.getAttribute("xlink:href")},LegendURL:function(A,B){B.legend={};B.legend.href=A.getAttribute("xlink:href");B.legend.format=A.getAttribute("format")},Dimension:function(A,C){var B={values:[]};this.readChildNodes(A,B);C.dimensions.push(B)},Default:function(A,B){B["default"]=this.getChildValue(A)},Value:function(A,B){B.values.push(this.getChildValue(A))}},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:true,lzd:null,zoomLevels:null,initialize:function(D,C,E,G,F,B){this.lzd=E;this.zoomLevels=G;var A=[];A.push(D,C,F,B);OpenLayers.Layer.Grid.prototype.initialize.apply(this,A);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getZoom:function(){var B=this.map.getZoom();var A=this.map.getMaxExtent();B=B-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2);return B},getURL:function(E){E=this.adjustBounds(E);var D=this.getZoom();var B=this.map.getMaxExtent();var C=this.lzd/Math.pow(2,this.getZoom());var A=Math.floor((E.left-B.left)/C);var F=Math.floor((E.bottom-B.bottom)/C);if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return this.getFullRequestString({L:D,X:A,Y:F})}else{return OpenLayers.Util.getImageLocation("blank.gif")}},CLASS_NAME:"OpenLayers.Layer.WorldWind"});OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(1276,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-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(G,C,F,B,A,E,D){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(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A]);this.options=A},read:function(B){if(typeof B=="string"){B=OpenLayers.Format.XML.prototype.read.apply(this,[B])}if(B&&B.nodeType==9){B=B.documentElement}var A={};this.readNode(B,A);return A},readers:{gml:OpenLayers.Util.applyDefaults({name:function(A,B){B.name=this.getChildValue(A)},TimePeriod:function(A,B){B.timePeriod={};this.readChildNodes(A,B.timePeriod)},beginPosition:function(B,A){A.beginPosition=this.getChildValue(B)},endPosition:function(B,A){A.endPosition=this.getChildValue(B)}},OpenLayers.Format.GML.v3.prototype.readers.gml),sos:{Capabilities:function(A,B){this.readChildNodes(A,B)},Contents:function(A,B){B.contents={};this.readChildNodes(A,B.contents)},ObservationOfferingList:function(B,A){A.offeringList={};this.readChildNodes(B,A.offeringList)},ObservationOffering:function(B,A){var C=this.getAttributeNS(B,this.namespaces.gml,"id");A[C]={procedures:[],observedProperties:[],featureOfInterestIds:[],responseFormats:[],resultModels:[],responseModes:[]};this.readChildNodes(B,A[C])},time:function(A,B){B.time={};this.readChildNodes(A,B.time)},procedure:function(A,B){B.procedures.push(this.getAttributeNS(A,this.namespaces.xlink,"href"))},observedProperty:function(A,B){B.observedProperties.push(this.getAttributeNS(A,this.namespaces.xlink,"href"))},featureOfInterest:function(A,B){B.featureOfInterestIds.push(this.getAttributeNS(A,this.namespaces.xlink,"href"))},responseFormat:function(A,B){B.responseFormats.push(this.getChildValue(A))},resultModel:function(A,B){B.resultModels.push(this.getChildValue(A))},responseMode:function(A,B){B.responseModes.push(this.getChildValue(A))}},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:false,stopDown:false,pinching:false,last:null,start:null,touchstart:function(B){var A=true;this.pinching=false;if(OpenLayers.Event.isMultiTouch(B)){this.started=true;this.last=this.start={distance:this.getDistance(B.touches),delta:0,scale:1};this.callback("start",[B,this.start]);A=!this.stopDown}else{this.started=false;this.start=null;this.last=null}OpenLayers.Event.stop(B);return A},touchmove:function(A){if(this.started&&OpenLayers.Event.isMultiTouch(A)){this.pinching=true;var B=this.getPinchData(A);this.callback("move",[A,B]);this.last=B;OpenLayers.Event.stop(A)}return true},touchend:function(A){if(this.started){this.started=false;this.pinching=false;this.callback("done",[A,this.start,this.last]);this.start=null;this.last=null}return true},activate:function(){var A=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.pinching=false;A=true}return A},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.pinching=false;this.start=null;this.last=null;A=true}return A},getDistance:function(C){var B=C[0];var A=C[1];return Math.sqrt(Math.pow(B.clientX-A.clientX,2)+Math.pow(B.clientY-A.clientY,2))},getPinchData:function(A){var C=this.getDistance(A.touches);var B=C/this.start.distance;return{distance:C,delta:this.last.distance-C,scale:B}},CLASS_NAME:"OpenLayers.Handler.Pinch"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(A){OpenLayers.Control.Panel.prototype.initialize.apply(this,[A]);this.addControls([new OpenLayers.Control.Navigation(),new OpenLayers.Control.ZoomBox()])},draw:function(){var A=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);if(this.defaultControl===null){this.defaultControl=this.controls[0]}return A},CLASS_NAME:"OpenLayers.Control.NavToolbar"});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:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>",sphericalMercator:true,wrapDateLine:true,tileOptions:null,initialize:function(C,B,A){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments);this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options&&this.options.tileOptions)},clone:function(A){if(A==null){A=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions())}A=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[A]);return A},CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Strategy.Refresh=OpenLayers.Class(OpenLayers.Strategy,{force:false,interval:0,timer:null,activate:function(){var A=OpenLayers.Strategy.prototype.activate.call(this);if(A){if(this.layer.visibility===true){this.start()}this.layer.events.on({visibilitychanged:this.reset,scope:this})}return A},deactivate:function(){var A=OpenLayers.Strategy.prototype.deactivate.call(this);if(A){this.stop()}return A},reset:function(){if(this.layer.visibility===true){this.start()}else{this.stop()}},start:function(){if(this.interval&&typeof this.interval==="number"&&this.interval>0){this.timer=window.setInterval(OpenLayers.Function.bind(this.refresh,this),this.interval)}},refresh:function(){if(this.layer&&this.layer.refresh&&typeof this.layer.refresh=="function"){this.layer.refresh({force:this.force})}},stop:function(){if(this.timer!==null){window.clearInterval(this.timer);this.timer=null}},CLASS_NAME:"OpenLayers.Strategy.Refresh"});OpenLayers.Control.Geolocate=OpenLayers.Class(OpenLayers.Control,{geolocation:navigator.geolocation,bind:true,watch:false,geolocationOptions:null,destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){if(!this.geolocation){this.events.triggerEvent("locationuncapable");return false}if(OpenLayers.Control.prototype.activate.apply(this,arguments)){if(this.watch){this.watchId=this.geolocation.watchPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions)}else{this.getCurrentLocation()}return true}return false},deactivate:function(){if(this.active&&this.watchId!==null){this.geolocation.clearWatch(this.watchId)}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},geolocate:function(B){var A=new OpenLayers.LonLat(B.coords.longitude,B.coords.latitude).transform(new OpenLayers.Projection("EPSG:4326"),this.map.getProjectionObject());if(this.bind){this.map.setCenter(A)}this.events.triggerEvent("locationupdated",{position:B,point:new OpenLayers.Geometry.Point(A.lon,A.lat)})},getCurrentLocation:function(){if(!this.active||this.watch){return false}this.geolocation.getCurrentPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions);return true},failure:function(A){this.events.triggerEvent("locationfailed",{error:A})},CLASS_NAME:"OpenLayers.Control.Geolocate"});OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:true,initialize:function(D,C,E,B){var A=[];E=OpenLayers.Util.upperCaseObject(E);A.push(D,C,E,B);OpenLayers.Layer.Grid.prototype.initialize.apply(this,A);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((B==null)||(!B.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="jpg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"}}},clone:function(A){if(A==null){A=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(E){E=this.adjustBounds(E);var D=this.projection.getCode().split(":");var C=D[D.length-1];var G=this.getImageSize();var H={BBOX:E.toBBOX(),SIZE:G.w+","+G.h,F:"image",BBOXSR:C,IMAGESR:C};if(this.layerDefs){var F=[];var A;for(A in this.layerDefs){if(this.layerDefs.hasOwnProperty(A)){if(this.layerDefs[A]){F.push(A);F.push(":");F.push(this.layerDefs[A]);F.push(";")}}}if(F.length>0){H.LAYERDEFS=F.join("")}}var B=this.getFullRequestString(H);return B},setLayerFilter:function(B,A){if(!this.layerDefs){this.layerDefs={}}if(A){this.layerDefs[B]=A}else{delete this.layerDefs[B]}},clearLayerFilter:function(A){if(A){delete this.layerDefs[A]}else{delete this.layerDefs}},mergeNewParams:function(C){var B=OpenLayers.Util.upperCaseObject(C);var A=[B];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,A)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(A){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[A])},read:function(F){var E,D,H;F=F.replace(/[\n\r]/g," ");var G=this.regExes.typeStr.exec(F);if(G){D=G[1].toLowerCase();H=G[2];if(this.parse[D]){E=this.parse[D].apply(this,[H])}if(this.internalProjection&&this.externalProjection){if(E&&E.CLASS_NAME=="OpenLayers.Feature.Vector"){E.geometry.transform(this.externalProjection,this.internalProjection)}else{if(E&&D!="geometrycollection"&&typeof E=="object"){for(var C=0,A=E.length;C<A;C++){var B=E[C];B.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return E},write:function(A){var F,I,H,D,B;if(A.constructor==Array){F=A;B=true}else{F=[A];B=false}var C=[];if(B){C.push("GEOMETRYCOLLECTION(")}for(var E=0,G=F.length;E<G;++E){if(B&&E>0){C.push(",")}I=F[E].geometry;C.push(this.extractGeometry(I))}if(B){C.push(")")}return C.join("")},extractGeometry:function(D){var B=D.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[B]){return null}if(this.internalProjection&&this.externalProjection){D=D.clone();D.transform(this.internalProjection,this.externalProjection)}var A=B=="collection"?"GEOMETRYCOLLECTION":B.toUpperCase();var C=A+"("+this.extract[B].apply(this,[D])+")";return C},extract:{point:function(A){return A.x+" "+A.y},multipoint:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push("("+this.extract.point.apply(this,[C.components[B]])+")")}return D.join(",")},linestring:function(B){var D=[];for(var C=0,A=B.components.length;C<A;++C){D.push(this.extract.point.apply(this,[B.components[C]]))}return D.join(",")},multilinestring:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push("("+this.extract.linestring.apply(this,[C.components[B]])+")")}return D.join(",")},polygon:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push("("+this.extract.linestring.apply(this,[C.components[B]])+")")}return D.join(",")},multipolygon:function(D){var C=[];for(var B=0,A=D.components.length;B<A;++B){C.push("("+this.extract.polygon.apply(this,[D.components[B]])+")")}return C.join(",")},collection:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push(this.extractGeometry.apply(this,[C.components[B]]))}return D.join(",")}},parse:{point:function(B){var A=OpenLayers.String.trim(B).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(A[0],A[1]))},multipoint:function(F){var B;var D=OpenLayers.String.trim(F).split(",");var E=[];for(var C=0,A=D.length;C<A;++C){B=D[C].replace(this.regExes.trimParens,"$1");E.push(this.parse.point.apply(this,[B]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(E))},linestring:function(E){var C=OpenLayers.String.trim(E).split(",");var D=[];for(var B=0,A=C.length;B<A;++B){D.push(this.parse.point.apply(this,[C[B]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(D))},multilinestring:function(F){var C;var B=OpenLayers.String.trim(F).split(this.regExes.parenComma);var E=[];for(var D=0,A=B.length;D<A;++D){C=B[D].replace(this.regExes.trimParens,"$1");E.push(this.parse.linestring.apply(this,[C]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(E))},polygon:function(H){var C,B,F;var G=OpenLayers.String.trim(H).split(this.regExes.parenComma);var E=[];for(var D=0,A=G.length;D<A;++D){C=G[D].replace(this.regExes.trimParens,"$1");B=this.parse.linestring.apply(this,[C]).geometry;F=new OpenLayers.Geometry.LinearRing(B.components);E.push(F)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(E))},multipolygon:function(F){var D;var B=OpenLayers.String.trim(F).split(this.regExes.doubleParenComma);var E=[];for(var C=0,A=B.length;C<A;++C){D=B[C].replace(this.regExes.trimParens,"$1");E.push(this.parse.polygon.apply(this,[D]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(E))},geometrycollection:function(E){E=E.replace(/,\s*([A-Za-z])/g,"|$1");var D=OpenLayers.String.trim(E).split("|");var C=[];for(var B=0,A=D.length;B<A;++B){C.push(OpenLayers.Format.WKT.prototype.read.apply(this,[D[B]]))}return C}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,mousemove:function(A){if(this.passesTolerance(A.xy)){this.clearTimer();this.callback("move",[A]);this.px=A.xy;A=OpenLayers.Util.extend({},A);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,A),this.delay)}return !this.stopMove},mouseout:function(A){if(OpenLayers.Util.mouseLeft(A,this.map.viewPortDiv)){this.clearTimer();this.callback("move",[A])}return true},passesTolerance:function(B){var C=true;if(this.pixelTolerance&&this.px){var A=Math.sqrt(Math.pow(this.px.x-B.x,2)+Math.pow(this.px.y-B.y,2));if(A<this.pixelTolerance){C=false}}return C},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(A){this.callback("pause",[A])},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();A=true}return A},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:false,click:true,single:true,clickout:true,toggle:false,clickTolerance:5,hover:false,box:false,maxFeatures:10,features:null,hoverFeature:null,handlerOptions:null,handlers:null,hoverResponse:null,filterType:OpenLayers.Filter.Spatial.BBOX,initialize:function(A){A.handlerOptions=A.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[A]);this.features={};this.handlers={};if(this.click){this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectClick},this.handlerOptions.click||{})}if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"}))}if(this.hover){this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250,pixelTolerance:2}))}},activate:function(){if(!this.active){for(var A in this.handlers){this.handlers[A].activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){for(var A in this.handlers){this.handlers[A].deactivate()}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},selectClick:function(A){var B=this.pixelToBounds(A.xy);this.setModifiers(A);this.request(B,{single:this.single})},selectBox:function(A){var C;if(A instanceof OpenLayers.Bounds){var D=this.map.getLonLatFromPixel({x:A.left,y:A.bottom});var B=this.map.getLonLatFromPixel({x:A.right,y:A.top});C=new OpenLayers.Bounds(D.lon,D.lat,B.lon,B.lat)}else{if(this.click){return }C=this.pixelToBounds(A)}this.setModifiers(this.handlers.box.dragHandler.evt);this.request(C)},selectHover:function(A){var B=this.pixelToBounds(A.xy);this.request(B,{single:true,hover:true})},cancelHover:function(){if(this.hoverResponse){this.protocol.abort(this.hoverResponse);this.hoverResponse=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")}},request:function(D,B){B=B||{};var C=new OpenLayers.Filter.Spatial({type:this.filterType,value:D});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var A=this.protocol.read({maxFeatures:B.single==true?this.maxFeatures:undefined,filter:C,callback:function(E){if(E.success()){if(E.features.length){if(B.single==true){this.selectBestFeature(E.features,D.getCenterLonLat(),B)}else{this.select(E.features)}}else{if(B.hover){this.hoverSelect()}else{this.events.triggerEvent("clickout");if(this.clickout){this.unselectAll()}}}}OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});if(B.hover==true){this.hoverResponse=A}},selectBestFeature:function(B,A,I){I=I||{};if(B.length){var G=new OpenLayers.Geometry.Point(A.lon,A.lat);var H,D,E;var F=Number.MAX_VALUE;for(var C=0;C<B.length;++C){H=B[C];if(H.geometry){E=G.distanceTo(H.geometry,{edge:false});if(E<F){F=E;D=H;if(F==0){break}}}}if(I.hover==true){this.hoverSelect(D)}else{this.select(D||B)}}},setModifiers:function(A){this.modifiers={multiple:this.multiple||(this.multipleKey&&A[this.multipleKey]),toggle:this.toggle||(this.toggleKey&&A[this.toggleKey])}},select:function(E){if(!this.modifiers.multiple&&!this.modifiers.toggle){this.unselectAll()}if(!(OpenLayers.Util.isArray(E))){E=[E]}var B=this.events.triggerEvent("beforefeaturesselected",{features:E});if(B!==false){var F=[];var D;for(var C=0,A=E.length;C<A;++C){D=E[C];if(this.features[D.fid||D.id]){if(this.modifiers.toggle){this.unselect(this.features[D.fid||D.id])}}else{B=this.events.triggerEvent("beforefeatureselected",{feature:D});if(B!==false){this.features[D.fid||D.id]=D;F.push(D);this.events.triggerEvent("featureselected",{feature:D})}}}this.events.triggerEvent("featuresselected",{features:F})}},hoverSelect:function(A){var C=A?A.fid||A.id:null;var B=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;if(B&&B!=C){this.events.triggerEvent("outfeature",{feature:this.hoverFeature});this.hoverFeature=null}if(C&&C!=B){this.events.triggerEvent("hoverfeature",{feature:A});this.hoverFeature=A}},unselect:function(A){delete this.features[A.fid||A.id];this.events.triggerEvent("featureunselected",{feature:A})},unselectAll:function(){for(var A in this.features){this.unselect(this.features[A])}},setMap:function(B){for(var A in this.handlers){this.handlers[A].setMap(B)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(B){var E=B.add(-this.clickTolerance/2,this.clickTolerance/2);var A=B.add(this.clickTolerance/2,-this.clickTolerance/2);var C=this.map.getLonLatFromPixel(E);var D=this.map.getLonLatFromPixel(A);return new OpenLayers.Bounds(C.lon,C.lat,D.lon,D.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Format.QueryStringFilter=(function(){var B={};B[OpenLayers.Filter.Comparison.EQUAL_TO]="eq";B[OpenLayers.Filter.Comparison.NOT_EQUAL_TO]="ne";B[OpenLayers.Filter.Comparison.LESS_THAN]="lt";B[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO]="lte";B[OpenLayers.Filter.Comparison.GREATER_THAN]="gt";B[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO]="gte";B[OpenLayers.Filter.Comparison.LIKE]="ilike";function A(C){C=C.replace(/%/g,"\\%");C=C.replace(/\\\\\.(\*)?/g,function(E,D){return D?E:"\\\\_"});C=C.replace(/\\\\\.\*/g,"\\\\%");C=C.replace(/(\\)?\.(\*)?/g,function(E,D,F){return D||F?E:"_"});C=C.replace(/(\\)?\.\*/g,function(E,D){return D?E:"%"});C=C.replace(/\\\./g,".");C=C.replace(/(\\)?\\\*/g,function(E,D){return D?E:"*"});return C}return OpenLayers.Class(OpenLayers.Format,{wildcarded:false,srsInBBOX:false,write:function(F,I){I=I||{};var E=F.CLASS_NAME;var G=E.substring(E.lastIndexOf(".")+1);switch(G){case"Spatial":switch(F.type){case OpenLayers.Filter.Spatial.BBOX:I.bbox=F.value.toArray();if(this.srsInBBOX&&F.projection){I.bbox.push(F.projection.getCode())}break;case OpenLayers.Filter.Spatial.DWITHIN:I.tolerance=F.distance;case OpenLayers.Filter.Spatial.WITHIN:I.lon=F.value.x;I.lat=F.value.y;break;default:OpenLayers.Console.warn("Unknown spatial filter type "+F.type)}break;case"Comparison":var J=B[F.type];if(J!==undefined){var H=F.value;if(F.type==OpenLayers.Filter.Comparison.LIKE){H=A(H);if(this.wildcarded){H="%"+H+"%"}}I[F.property+"__"+J]=H;I.queryable=I.queryable||[];I.queryable.push(F.property)}else{OpenLayers.Console.warn("Unknown comparison filter type "+F.type)}break;case"Logical":if(F.type===OpenLayers.Filter.Logical.AND){for(var D=0,C=F.filters.length;D<C;D++){I=this.write(F.filters[D],I)}}else{OpenLayers.Console.warn("Unsupported logical filter type "+F.type)}break;default:OpenLayers.Console.warn("Unknown filter type "+G)}return I},CLASS_NAME:"OpenLayers.Format.QueryStringFilter"})})();OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{autoActivate:true,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(){if(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();return true}else{return false}},deactivate:function(){if(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="";return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}return this.div},redraw:function(A){var C;if(A==null){this.reset();return }else{if(this.lastXy==null||Math.abs(A.xy.x-this.lastXy.x)>this.granularity||Math.abs(A.xy.y-this.lastXy.y)>this.granularity){this.lastXy=A.xy;return }C=this.map.getLonLatFromPixel(A.xy);if(!C){return }if(this.displayProjection){C.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=A.xy}var B=this.formatOutput(C);if(B!=this.element.innerHTML){this.element.innerHTML=B}},reset:function(A){if(this.emptyString!=null){this.element.innerHTML=this.emptyString}},formatOutput:function(B){var C=parseInt(this.numDigits);var A=this.prefix+B.lon.toFixed(C)+this.separator+B.lat.toFixed(C)+this.suffix;return A},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 B=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(B){if(this.isLoading){this.abortLoading();this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}this.url=this.layer.getURL(this.bounds);if(this.layer.useJSONP){var A=new OpenLayers.Protocol.Script({url:this.url,callback:function(C){this.isLoading=false;this.events.triggerEvent("loadend");this.json=C.data},scope:this});A.read();this.request=A}else{this.request=OpenLayers.Request.GET({url:this.url,callback:function(C){this.isLoading=false;this.events.triggerEvent("loadend");if(C.status===200){this.parseData(C.responseText)}},scope:this})}}else{this.unload()}return B},abortLoading:function(){if(this.request){this.request.abort();delete this.request}this.isLoading=false},getFeatureInfo:function(B,A){var C=null;if(this.json){var D=this.getFeatureId(B,A);if(D!==null){C={id:D,data:this.json.data[D]}}}return C},getFeatureId:function(E,D){var A=null;if(this.json){var C=this.utfgridResolution;var I=Math.floor(D/C);var B=Math.floor(E/C);var G=this.json.grid[I].charCodeAt(B);var F=this.indexFromCharCode(G);var H=this.json.keys;if(!isNaN(F)&&(F in H)){A=H[F]}}return A},indexFromCharCode:function(A){if(A>=93){A--}if(A>=35){A--}return A-32},parseData:function(A){if(!this.format){this.format=new OpenLayers.Format.JSON()}this.json=this.format.read(A)},clear:function(){this.json=null},CLASS_NAME:"OpenLayers.Tile.UTFGrid"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,autoActivate:true,clearOnDeactivate:false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.registry=OpenLayers.Util.extend({moveend:this.getState},this.registry);var B={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(B,this.previousOptions);this.previous=new OpenLayers.Control.Button(B);var C={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(C,this.nextOptions);this.next=new OpenLayers.Control.Button(C);this.clear()},onPreviousChange:function(B,A){if(B&&!this.previous.active){this.previous.activate()}else{if(!B&&this.previous.active){this.previous.deactivate()}}},onNextChange:function(B,A){if(B&&!this.next.active){this.next.activate()}else{if(!B&&this.next.active){this.next.deactivate()}}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var A in this){this[A]=null}},setMap:function(A){this.map=A;this.next.setMap(A);this.previous.setMap(A)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw()},previousTrigger:function(){var B=this.previousStack.shift();var A=this.previousStack.shift();if(A!=undefined){this.nextStack.unshift(B);this.previousStack.unshift(A);this.restoring=true;this.restore(A);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}else{this.previousStack.unshift(B)}return A},nextTrigger:function(){var A=this.nextStack.shift();if(A!=undefined){this.previousStack.unshift(A);this.restoring=true;this.restore(A);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}return A},clear:function(){this.previousStack=[];this.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(E){var A,D;if(this.map.getProjectionObject()==E.projection){D=this.map.getZoomForResolution(E.resolution);A=E.center}else{A=E.center.clone();A.transform(E.projection,this.map.getProjectionObject());var F=E.units;var B=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var C=F&&B?OpenLayers.INCHES_PER_UNIT[F]/OpenLayers.INCHES_PER_UNIT[B]:1;D=this.map.getZoomForResolution(C*E.resolution)}this.map.setCenter(A,D)},setListeners:function(){this.listeners={};for(var A in this.registry){this.listeners[A]=OpenLayers.Function.bind(function(){if(!this.restoring){var B=this.registry[A].apply(this,arguments);this.previousStack.unshift(B);if(this.previousStack.length>1){this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}if(this.previousStack.length>(this.limit+1)){this.previousStack.pop()}if(this.nextStack.length>0){this.nextStack=[];this.onNextChange(null,0)}}return true},this)}},activate:function(){var A=false;if(this.map){if(OpenLayers.Control.prototype.activate.apply(this)){if(this.listeners==null){this.setListeners()}for(var B in this.listeners){this.map.events.register(B,this,this.listeners[B])}A=true;if(this.previousStack.length==0){this.initStack()}}}return A},initStack:function(){if(this.map.getCenter()){this.listeners.moveend()}},deactivate:function(){var B=false;if(this.map){if(OpenLayers.Control.prototype.deactivate.apply(this)){for(var A in this.listeners){this.map.events.unregister(A,this,this.listeners[A])}if(this.clearOnDeactivate){this.clear()}B=true}}return B},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,updateWithPOST:false,deleteWithPOST:false,wildcarded:false,srsInBBOX:false,initialize:function(A){A=A||{};this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments);if(!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var B=new OpenLayers.Format.QueryStringFilter({wildcarded:this.wildcarded,srsInBBOX:this.srsInBBOX});this.filterToParams=function(C,D){return B.write(C,D)}}},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(A){OpenLayers.Protocol.prototype.read.apply(this,arguments);A=A||{};A.params=OpenLayers.Util.applyDefaults(A.params,this.options.params);A=OpenLayers.Util.applyDefaults(A,this.options);if(A.filter&&this.filterToParams){A.params=this.filterToParams(A.filter,A.params)}var B=(A.readWithPOST!==undefined)?A.readWithPOST:this.readWithPOST;var D=new OpenLayers.Protocol.Response({requestType:"read"});if(B){var C=A.headers||{};C["Content-Type"]="application/x-www-form-urlencoded";D.priv=OpenLayers.Request.POST({url:A.url,callback:this.createCallback(this.handleRead,D,A),data:OpenLayers.Util.getParameterString(A.params),headers:C})}else{D.priv=OpenLayers.Request.GET({url:A.url,callback:this.createCallback(this.handleRead,D,A),params:A.params,headers:A.headers})}return D},handleRead:function(B,A){this.handleResponse(B,A)},create:function(B,A){A=OpenLayers.Util.applyDefaults(A,this.options);var C=new OpenLayers.Protocol.Response({reqFeatures:B,requestType:"create"});C.priv=OpenLayers.Request.POST({url:A.url,callback:this.createCallback(this.handleCreate,C,A),headers:A.headers,data:this.format.write(B)});return C},handleCreate:function(B,A){this.handleResponse(B,A)},update:function(C,B){B=B||{};var A=B.url||C.url||this.options.url+"/"+C.fid;B=OpenLayers.Util.applyDefaults(B,this.options);var D=new OpenLayers.Protocol.Response({reqFeatures:C,requestType:"update"});var E=this.updateWithPOST?"POST":"PUT";D.priv=OpenLayers.Request[E]({url:A,callback:this.createCallback(this.handleUpdate,D,B),headers:B.headers,data:this.format.write(C)});return D},handleUpdate:function(B,A){this.handleResponse(B,A)},"delete":function(D,C){C=C||{};var B=C.url||D.url||this.options.url+"/"+D.fid;C=OpenLayers.Util.applyDefaults(C,this.options);var E=new OpenLayers.Protocol.Response({reqFeatures:D,requestType:"delete"});var F=this.deleteWithPOST?"POST":"DELETE";var A={url:B,callback:this.createCallback(this.handleDelete,E,C),headers:C.headers};if(this.deleteWithPOST){A.data=this.format.write(D)}E.priv=OpenLayers.Request[F](A);return E},handleDelete:function(B,A){this.handleResponse(B,A)},handleResponse:function(C,A){var B=C.priv;if(A.callback){if(B.status>=200&&B.status<300){if(C.requestType!="delete"){C.features=this.parseFeatures(B)}C.code=OpenLayers.Protocol.Response.SUCCESS}else{C.code=OpenLayers.Protocol.Response.FAILURE}A.callback.call(A.scope,C)}},parseFeatures:function(A){var B=A.responseXML;if(!B||!B.documentElement){B=A.responseText}if(!B||B.length<=0){return null}return this.format.read(B)},commit:function(B,P){P=OpenLayers.Util.applyDefaults(P,this.options);var D=[],L=0;var J={};J[OpenLayers.State.INSERT]=[];J[OpenLayers.State.UPDATE]=[];J[OpenLayers.State.DELETE]=[];var O,K,C=[];for(var E=0,I=B.length;E<I;++E){O=B[E];K=J[O.state];if(K){K.push(O);C.push(O)}}var G=(J[OpenLayers.State.INSERT].length>0?1:0)+J[OpenLayers.State.UPDATE].length+J[OpenLayers.State.DELETE].length;var N=true;var A=new OpenLayers.Protocol.Response({reqFeatures:C});function H(R){var Q=R.features?R.features.length:0;var T=new Array(Q);for(var S=0;S<Q;++S){T[S]=R.features[S].fid}A.insertIds=T;M.apply(this,[R])}function M(Q){this.callUserCallback(Q,P);N=N&&Q.success();L++;if(L>=G){if(P.callback){A.code=N?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;P.callback.apply(P.scope,[A])}}}var F=J[OpenLayers.State.INSERT];if(F.length>0){D.push(this.create(F,OpenLayers.Util.applyDefaults({callback:H,scope:this},P.create)))}F=J[OpenLayers.State.UPDATE];for(var E=F.length-1;E>=0;--E){D.push(this.update(F[E],OpenLayers.Util.applyDefaults({callback:M,scope:this},P.update)))}F=J[OpenLayers.State.DELETE];for(var E=F.length-1;E>=0;--E){D.push(this["delete"](F[E],OpenLayers.Util.applyDefaults({callback:M,scope:this},P["delete"])))}return D},abort:function(A){if(A){A.priv.abort()}},callUserCallback:function(C,A){var B=A[C.requestType];if(B&&B.callback){B.callback.call(B.scope,C)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:false,resolution:null,activate:function(){var A=OpenLayers.Strategy.prototype.activate.call(this);if(A){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return A},deactivate:function(){var A=OpenLayers.Strategy.prototype.deactivate.call(this);if(A){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return A},cacheFeatures:function(B){var A=true;if(!this.clustering){this.clearCache();this.features=B.features;this.cluster();A=false}return A},clearCache:function(){this.features=null},cluster:function(A){if((!A||A.zoomChanged)&&this.features){var C=this.layer.map.getResolution();if(C!=this.resolution||!this.clustersExist()){this.resolution=C;var H=[];var K,B,I;for(var E=0;E<this.features.length;++E){K=this.features[E];if(K.geometry){B=false;for(var D=H.length-1;D>=0;--D){I=H[D];if(this.shouldCluster(I,K)){this.addToCluster(I,K);B=true;break}}if(!B){H.push(this.createCluster(this.features[E]))}}}this.layer.removeAllFeatures();if(H.length>0){if(this.threshold>1){var G=H.slice();H=[];var J;for(var E=0,F=G.length;E<F;++E){J=G[E];if(J.attributes.count<this.threshold){Array.prototype.push.apply(H,J.cluster)}else{H.push(J)}}}this.clustering=true;this.layer.addFeatures(H);this.clustering=false}this.clusters=H}}},clustersExist:function(){var B=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){B=true;for(var A=0;A<this.clusters.length;++A){if(this.clusters[A]!=this.layer.features[A]){B=false;break}}}return B},shouldCluster:function(A,B){var E=A.geometry.getBounds().getCenterLonLat();var C=B.geometry.getBounds().getCenterLonLat();var D=(Math.sqrt(Math.pow((E.lon-C.lon),2)+Math.pow((E.lat-C.lat),2))/this.resolution);return(D<=this.distance)},addToCluster:function(A,B){A.cluster.push(B);A.attributes.count+=1},createCluster:function(C){var B=C.geometry.getBounds().getCenterLonLat();var A=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(B.lon,B.lat),{count:1});A.cluster=[C];return A},CLASS_NAME:"OpenLayers.Strategy.Cluster"});OpenLayers.Strategy.Filter=OpenLayers.Class(OpenLayers.Strategy,{filter:null,cache:null,caching:false,activate:function(){var A=OpenLayers.Strategy.prototype.activate.apply(this,arguments);if(A){this.cache=[];this.layer.events.on({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this})}return A},deactivate:function(){this.cache=null;if(this.layer&&this.layer.events){this.layer.events.un({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this})}return OpenLayers.Strategy.prototype.deactivate.apply(this,arguments)},handleAdd:function(E){if(!this.caching&&this.filter){var D=E.features;E.features=[];var B;for(var A=0,C=D.length;A<C;++A){B=D[A];if(this.filter.evaluate(B)){E.features.push(B)}else{this.cache.push(B)}}}},handleRemove:function(A){if(!this.caching){this.cache=[]}},setFilter:function(A){this.filter=A;var C=this.cache;this.cache=[];this.handleAdd({features:this.layer.features});if(this.cache.length>0){this.caching=true;this.layer.removeFeatures(this.cache.slice());this.caching=false}if(C.length>0){var B={features:C};this.handleAdd(B);if(B.features.length>0){this.caching=true;this.layer.addFeatures(B.features);this.caching=false}}},CLASS_NAME:"OpenLayers.Strategy.Filter"});OpenLayers.Protocol.SOS=function(B){B=OpenLayers.Util.applyDefaults(B,OpenLayers.Protocol.SOS.DEFAULTS);var A=OpenLayers.Protocol.SOS["v"+B.version.replace(/\./g,"_")];if(!A){throw"Unsupported SOS version: "+B.version}return new A(B)};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:false,createGeometryFromItem:function(M){var L=this.getElementsByTagNameNS(M,this.georssns,"point");var G=this.getElementsByTagNameNS(M,this.geons,"lat");var A=this.getElementsByTagNameNS(M,this.geons,"long");var O=this.getElementsByTagNameNS(M,this.georssns,"line");var J=this.getElementsByTagNameNS(M,this.georssns,"polygon");var C=this.getElementsByTagNameNS(M,this.georssns,"where");var D=this.getElementsByTagNameNS(M,this.georssns,"box");if(L.length>0||(G.length>0&&A.length>0)){var K;if(L.length>0){K=OpenLayers.String.trim(L[0].firstChild.nodeValue).split(/\s+/);if(K.length!=2){K=OpenLayers.String.trim(L[0].firstChild.nodeValue).split(/\s*,\s*/)}}else{K=[parseFloat(G[0].firstChild.nodeValue),parseFloat(A[0].firstChild.nodeValue)]}var H=new OpenLayers.Geometry.Point(K[1],K[0])}else{if(O.length>0){var I=OpenLayers.String.trim(this.getChildValue(O[0])).split(/\s+/);var E=[];var L;for(var B=0,F=I.length;B<F;B+=2){L=new OpenLayers.Geometry.Point(I[B+1],I[B]);E.push(L)}H=new OpenLayers.Geometry.LineString(E)}else{if(J.length>0){var I=OpenLayers.String.trim(this.getChildValue(J[0])).split(/\s+/);var E=[];var L;for(var B=0,F=I.length;B<F;B+=2){L=new OpenLayers.Geometry.Point(I[B+1],I[B]);E.push(L)}H=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(E)])}else{if(C.length>0){if(!this.gmlParser){this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})}var N=this.gmlParser.parseFeature(C[0]);H=N.geometry}else{if(D.length>0){var I=OpenLayers.String.trim(D[0].firstChild.nodeValue).split(/\s+/);var E=[];var L;if(I.length>3){L=new OpenLayers.Geometry.Point(I[1],I[0]);E.push(L);L=new OpenLayers.Geometry.Point(I[1],I[2]);E.push(L);L=new OpenLayers.Geometry.Point(I[3],I[2]);E.push(L);L=new OpenLayers.Geometry.Point(I[3],I[0]);E.push(L);L=new OpenLayers.Geometry.Point(I[1],I[0]);E.push(L)}H=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(E)])}}}}}if(H&&this.internalProjection&&this.externalProjection){H.transform(this.externalProjection,this.internalProjection)}return H},createFeatureFromItem:function(H){var D=this.createGeometryFromItem(H);var F=this._getChildValue(H,"*","title",this.featureTitle);var G=this._getChildValue(H,"*","description",this._getChildValue(H,"*","content",this._getChildValue(H,"*","summary",this.featureDescription)));var E=this._getChildValue(H,"*","link");if(!E){try{E=this.getElementsByTagNameNS(H,"*","link")[0].getAttribute("href")}catch(C){E=null}}var A=this._getChildValue(H,"*","id",null);var B={title:F,description:G,link:E};var I=new OpenLayers.Feature.Vector(D,B);I.fid=A;return I},_getChildValue:function(D,B,C,F){var E;var A=this.getElementsByTagNameNS(D,B,C);if(A&&A[0]&&A[0].firstChild&&A[0].firstChild.nodeValue){E=this.getChildValue(A[0])}else{E=(F==undefined)?"":F}return E},read:function(E){if(typeof E=="string"){E=OpenLayers.Format.XML.prototype.read.apply(this,[E])}var A=null;A=this.getElementsByTagNameNS(E,"*","item");if(A.length==0){A=this.getElementsByTagNameNS(E,"*","entry")}var C=A.length;var D=new Array(C);for(var B=0;B<C;B++){D[B]=this.createFeatureFromItem(A[B])}return D},write:function(C){var D;if(OpenLayers.Util.isArray(C)){D=this.createElementNS(this.rssns,"rss");for(var B=0,A=C.length;B<A;B++){D.appendChild(this.createFeatureXML(C[B]))}}else{D=this.createFeatureXML(C)}return OpenLayers.Format.XML.prototype.write.apply(this,[D])},createFeatureXML:function(J){var F=this.buildGeometryNode(J.geometry);var A=this.createElementNS(this.rssns,"item");var D=this.createElementNS(this.rssns,"title");D.appendChild(this.createTextNode(J.attributes.title?J.attributes.title:""));var B=this.createElementNS(this.rssns,"description");B.appendChild(this.createTextNode(J.attributes.description?J.attributes.description:""));A.appendChild(D);A.appendChild(B);if(J.attributes.link){var H=this.createElementNS(this.rssns,"link");H.appendChild(this.createTextNode(J.attributes.link));A.appendChild(H)}for(var I in J.attributes){if(I=="link"||I=="title"||I=="description"){continue}var G=this.createTextNode(J.attributes[I]);var E=I;if(I.search(":")!=-1){E=I.split(":")[1]}var C=this.createElementNS(this.featureNS,"feature:"+E);C.appendChild(G);A.appendChild(C)}A.appendChild(F);return A},buildGeometryNode:function(B){if(this.internalProjection&&this.externalProjection){B=B.clone();B.transform(this.internalProjection,this.externalProjection)}var A;if(B.CLASS_NAME=="OpenLayers.Geometry.Polygon"){A=this.createElementNS(this.georssns,"georss:polygon");A.appendChild(this.buildCoordinatesNode(B.components[0]))}else{if(B.CLASS_NAME=="OpenLayers.Geometry.LineString"){A=this.createElementNS(this.georssns,"georss:line");A.appendChild(this.buildCoordinatesNode(B))}else{if(B.CLASS_NAME=="OpenLayers.Geometry.Point"){A=this.createElementNS(this.georssns,"georss:point");A.appendChild(this.buildCoordinatesNode(B))}else{throw"Couldn't parse "+B.CLASS_NAME}}}return A},buildCoordinatesNode:function(F){var C=null;if(F.components){C=F.components}var E;if(C){var B=C.length;var D=new Array(B);for(var A=0;A<B;A++){D[A]=C[A].y+" "+C[A].x}E=D.join(" ")}else{E=F.y+" "+F.x}return this.createTextNode(E)},CLASS_NAME:"OpenLayers.Format.GeoRSS"});OpenLayers.Format.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(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(B){if(typeof B=="string"){B=OpenLayers.Format.XML.prototype.read.apply(this,[B])}if(B&&B.nodeType==9){B=B.documentElement}var A={};this.readNode(B,A);return A},readers:{wps:{Capabilities:function(A,B){this.readChildNodes(A,B)},ProcessOfferings:function(A,B){B.processOfferings={};this.readChildNodes(A,B.processOfferings)},Process:function(B,A){var D=this.getAttributeNS(B,this.namespaces.wps,"processVersion");var C={processVersion:D};this.readChildNodes(B,C);A[C.identifier]=C},Languages:function(A,B){B.languages=[];this.readChildNodes(A,B.languages)},Default:function(A,B){var C={isDefault:true};this.readChildNodes(A,C);B.push(C)},Supported:function(A,B){var C={};this.readChildNodes(A,C);B.push(C)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSCapabilities.v1_0_0"});OpenLayers.Control.PinchZoom=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,containerCenter:null,pinchOrigin:null,currentCenter:null,autoActivate:true,initialize:function(A){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)},activate:function(){var A=OpenLayers.Control.prototype.activate.apply(this,arguments);if(A){this.map.events.on({moveend:this.updateContainerCenter,scope:this});this.updateContainerCenter()}return A},deactivate:function(){var A=OpenLayers.Control.prototype.deactivate.apply(this,arguments);if(this.map&&this.map.events){this.map.events.un({moveend:this.updateContainerCenter,scope:this})}return A},updateContainerCenter:function(){var A=this.map.layerContainerDiv;this.containerCenter={x:parseInt(A.style.left,10)+50,y:parseInt(A.style.top,10)+50}},pinchStart:function(A,B){this.pinchOrigin=A.xy;this.currentCenter=A.xy},pinchMove:function(B,H){var G=H.scale;var E=this.containerCenter;var D=this.pinchOrigin;var F=B.xy;var C=Math.round((F.x-D.x)+(G-1)*(E.x-D.x));var A=Math.round((F.y-D.y)+(G-1)*(E.y-D.y));this.applyTransform("translate("+C+"px, "+A+"px) scale("+G+")");this.currentCenter=F},applyTransform:function(A){var B=this.map.layerContainerDiv.style;B["-webkit-transform"]=A;B["-moz-transform"]=A},pinchDone:function(B,H,G){this.applyTransform("");var F=this.map.getZoomForResolution(this.map.getResolution()/G.scale,true);if(F!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){var D=this.map.getResolutionForZoom(F);var A=this.map.getLonLatFromPixel(this.pinchOrigin);var C=this.currentCenter;var E=this.map.getSize();A.lon+=D*((E.w/2)-C.x);A.lat-=D*((E.h/2)-C.y);this.map.div.clientWidth=this.map.div.clientWidth;this.map.setCenter(A,F)}},CLASS_NAME:"OpenLayers.Control.PinchZoom"});OpenLayers.Control.TouchNavigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,clickHandlerOptions:null,documentDrag:false,autoActivate:true,initialize:function(A){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.pinchZoom){this.pinchZoom.destroy();delete this.pinchZoom}OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){this.dragPan.activate();this.handlers.click.activate();this.pinchZoom.activate();return true}return false},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.dragPan.deactivate();this.handlers.click.deactivate();this.pinchZoom.deactivate();return true}return false},draw:function(){var A={click:this.defaultClick,dblclick:this.defaultDblClick};var B=OpenLayers.Util.extend({"double":true,stopDouble:true,pixelTolerance:2},this.clickHandlerOptions);this.handlers.click=new OpenLayers.Handler.Click(this,A,B);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions));this.dragPan.draw();this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions))},defaultClick:function(A){if(A.lastTouches&&A.lastTouches.length==2){this.map.zoomOut()}},defaultDblClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);this.map.setCenter(A,this.map.zoom+1)},CLASS_NAME:"OpenLayers.Control.TouchNavigation"});OpenLayers.Style2=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,initialize:function(A){OpenLayers.Util.extend(this,A);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var B=0,A=this.rules.length;B<A;B++){this.rules[B].destroy()}delete this.rules},clone:function(){var B=OpenLayers.Util.extend({},this);if(this.rules){B.rules=[];for(var C=0,A=this.rules.length;C<A;++C){B.rules.push(this.rules[C].clone())}}return new OpenLayers.Style2(B)},CLASS_NAME:"OpenLayers.Style2"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{drawMarker:function(A){var D=this.map.getLayerPxFromLonLat({lon:A.bounds.left,lat:A.bounds.top});var C=this.map.getLayerPxFromLonLat({lon:A.bounds.right,lat:A.bounds.bottom});if(C==null||D==null){A.display(false)}else{var B=A.draw(D,{w:Math.max(1,C.x-D.x),h:Math.max(1,C.y-D.y)});if(!A.drawn){this.div.appendChild(B);A.drawn=true}}},removeMarker:function(A){OpenLayers.Util.removeItem(this.markers,A);if((A.div!=null)&&(A.div.parentNode==this.div)){this.div.removeChild(A.div)}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{readers:{wfs:OpenLayers.Util.applyDefaults({Service:function(B,A){A.service={};this.readChildNodes(B,A.service)},Fees:function(C,A){var B=this.getChildValue(C);if(B&&B.toLowerCase()!="none"){A.fees=B}},AccessConstraints:function(B,A){var C=this.getChildValue(B);if(C&&C.toLowerCase()!="none"){A.accessConstraints=C}},OnlineResource:function(C,A){var B=this.getChildValue(C);if(B&&B.toLowerCase()!="none"){A.onlineResource=B}},Keywords:function(C,A){var B=this.getChildValue(C);if(B&&B.toLowerCase()!="none"){A.keywords=B.split(", ")}},Capability:function(B,A){A.capability={};this.readChildNodes(B,A.capability)},Request:function(A,B){B.request={};this.readChildNodes(A,B.request)},GetFeature:function(B,A){A.getfeature={href:{},formats:[]};this.readChildNodes(B,A.getfeature)},ResultFormat:function(D,E){var C=D.childNodes;var B;for(var A=0;A<C.length;A++){B=C[A];if(B.nodeType==1){E.formats.push(B.nodeName)}}},DCPType:function(A,B){this.readChildNodes(A,B)},HTTP:function(A,B){this.readChildNodes(A,B.href)},Get:function(A,B){B.get=A.getAttribute("onlineResource")},Post:function(A,B){B.post=A.getAttribute("onlineResource")},SRS:function(B,C){var A=this.getChildValue(B);if(A){C.srs=A}}},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(A){A=A||{};OpenLayers.Layer.Vector.prototype.initialize.apply(this,[A.name,A])},setMap:function(A){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);A.events.register("moveend",this,this.onMoveEnd)},removeMap:function(A){A.events.unregister("moveend",this,this.onMoveEnd);OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},setRatio:function(A){this.ratio=A;this.updateGrid(true)},setMaxFeatures:function(A){this.maxFeatures=A;this.updateGrid(true)},setSpacing:function(B,A){this.dx=B;this.dy=A||B;this.updateGrid(true)},setOrigin:function(A){this.origin=A;this.updateGrid(true)},getOrigin:function(){if(!this.origin){this.origin=this.map.getExtent().getCenterLonLat()}return this.origin},setRotation:function(A){this.rotation=A;this.updateGrid(true)},onMoveEnd:function(){this.updateGrid()},getViewBounds:function(){var D=this.map.getExtent();if(this.rotation){var A=this.getOrigin();var B=new OpenLayers.Geometry.Point(A.lon,A.lat);var C=D.toGeometry();C.rotate(-this.rotation,B);D=C.getBounds()}return D},updateGrid:function(C){if(C||this.invalidBounds()){var G=this.getViewBounds();var V=this.getOrigin();var P=new OpenLayers.Geometry.Point(V.lon,V.lat);var D=G.getWidth();var O=G.getHeight();var A=D/O;var M=Math.sqrt(this.dx*this.dy*this.maxFeatures/A);var S=M*A;var T=Math.min(D*this.ratio,S);var L=Math.min(O*this.ratio,M);var U=G.getCenterLonLat();this.gridBounds=new OpenLayers.Bounds(U.lon-(T/2),U.lat-(L/2),U.lon+(T/2),U.lat+(L/2));var J=Math.floor(L/this.dy);var K=Math.floor(T/this.dx);var B=V.lon+(this.dx*Math.ceil((this.gridBounds.left-V.lon)/this.dx));var E=V.lat+(this.dy*Math.ceil((this.gridBounds.bottom-V.lat)/this.dy));var F=new Array(J*K);var I,H,N;for(var R=0;R<K;++R){I=B+(R*this.dx);for(var Q=0;Q<J;++Q){H=E+(Q*this.dy);N=new OpenLayers.Geometry.Point(I,H);if(this.rotation){N.rotate(this.rotation,P)}F[(R*J)+Q]=new OpenLayers.Feature.Vector(N)}}this.destroyFeatures(this.features,{silent:true});this.addFeatures(F,{silent:true})}},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:true,standardTileSize:256,tileOriginCorner:"tl",numberOfTiers:0,tileCountUpToTier:null,tierSizeInTiles:null,tierImageSize:null,initialize:function(C,B,D,A){this.initializeZoomify(D);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[C,B,D,{},A])},initializeZoomify:function(C){var D=C.clone();var A=new OpenLayers.Size(Math.ceil(D.w/this.standardTileSize),Math.ceil(D.h/this.standardTileSize));this.tierSizeInTiles=[A];this.tierImageSize=[D];while(D.w>this.standardTileSize||D.h>this.standardTileSize){D=new OpenLayers.Size(Math.floor(D.w/2),Math.floor(D.h/2));A=new OpenLayers.Size(Math.ceil(D.w/this.standardTileSize),Math.ceil(D.h/this.standardTileSize));this.tierSizeInTiles.push(A);this.tierImageSize.push(D)}this.tierSizeInTiles.reverse();this.tierImageSize.reverse();this.numberOfTiers=this.tierSizeInTiles.length;this.tileCountUpToTier=[0];for(var B=1;B<this.numberOfTiers;B++){this.tileCountUpToTier.push(this.tierSizeInTiles[B-1].w*this.tierSizeInTiles[B-1].h+this.tileCountUpToTier[B-1])}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);this.tileCountUpToTier.length=0;this.tierSizeInTiles.length=0;this.tierImageSize.length=0},clone:function(A){if(A==null){A=new OpenLayers.Layer.Zoomify(this.name,this.url,this.size,this.options)}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(D){D=this.adjustBounds(D);var C=this.map.getResolution();var A=Math.round((D.left-this.tileOrigin.lon)/(C*this.tileSize.w));var H=Math.round((this.tileOrigin.lat-D.top)/(C*this.tileSize.h));var G=this.map.getZoom();var F=A+H*this.tierSizeInTiles[G].w+this.tileCountUpToTier[G];var E="TileGroup"+Math.floor((F)/256)+"/"+G+"-"+A+"-"+H+".jpg";var B=this.url;if(OpenLayers.Util.isArray(B)){B=this.selectUrl(E,B)}return B+E},getImageSize:function(){if(arguments.length>0){var E=this.adjustBounds(arguments[0]);var C=this.map.getResolution();var A=Math.round((E.left-this.tileOrigin.lon)/(C*this.tileSize.w));var G=Math.round((this.tileOrigin.lat-E.top)/(C*this.tileSize.h));var F=this.map.getZoom();var B=this.standardTileSize;var D=this.standardTileSize;if(A==this.tierSizeInTiles[F].w-1){var B=this.tierImageSize[F].w%this.standardTileSize}if(G==this.tierSizeInTiles[F].h-1){var D=this.tierImageSize[F].h%this.standardTileSize}return(new OpenLayers.Size(B,D))}else{return this.tileSize}},setMap:function(A){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.top)},calculateGridLayout:function(A,N,E){var K=E*this.tileSize.w;var C=E*this.tileSize.h;var I=A.left-N.lon;var L=Math.floor(I/K)-this.buffer;var J=I/K-L;var F=-J*this.tileSize.w;var M=N.lon+L*K;var B=N.lat-A.top+C;var H=Math.floor(B/C)-this.buffer;var O=H-B/C;var D=O*this.tileSize.h;var G=N.lat-C*H;return{tilelon:K,tilelat:C,tileoffsetlon:M,tileoffsetlat:G,tileoffsetx:F,tileoffsety:D}},CLASS_NAME:"OpenLayers.Layer.Zoomify"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(C,B,D,A){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(A==null||A.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(A){if(A==null){A=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(C){C=this.adjustBounds(C);var B=[C.left,C.bottom,C.right,C.top];var D=this.getImageSize();var A=this.getFullRequestString({mapext:B,imgext:B,map_size:[D.w,D.h],imgx:D.w/2,imgy:D.h/2,imgxy:[D.w,D.h]});return A},getFullRequestString:function(F,E){var B=(E==null)?this.url:E;var G=OpenLayers.Util.extend({},this.params);G=OpenLayers.Util.extend(G,F);var A=OpenLayers.Util.getParameterString(G);if(OpenLayers.Util.isArray(B)){B=this.selectUrl(A,B)}var D=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(B));for(var H in G){if(H.toUpperCase() in D){delete G[H]}}A=OpenLayers.Util.getParameterString(G);var I=B;A=A.replace(/,/g,"+");if(A!=""){var C=B.charAt(B.length-1);if((C=="&")||(C=="?")){I+=A}else{if(B.indexOf("?")==-1){I+="?"+A}else{I+="&"+A}}}return 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(B){if(!this.supported()){return }if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var E=document.createStyleSheet();var C=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var D=0,A=C.length;D<A;D++){E.addRule("olv\\:"+C[D],"behavior: url(#default#VML); position: absolute; display: inline-block;")}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments)},supported:function(){return !!(document.namespaces)},setExtent:function(J,B){var A=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var D=this.getResolution();var C=(J.left/D)|0;var H=(J.top/D-this.size.h)|0;if(B||!this.offset){this.offset={x:C,y:H};C=0;H=0}else{C=C-this.offset.x;H=H-this.offset.y}var L=(C-this.xOffset)+" "+H;this.root.coordorigin=L;var I=[this.root,this.vectorRoot,this.textRoot];var G;for(var E=0,F=I.length;E<F;++E){G=I[E];var K=this.size.w+" "+this.size.h;G.coordsize=K}this.root.style.flip="y";return A},setSize:function(F){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var D=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var C=this.size.w+"px";var G=this.size.h+"px";var B;for(var E=0,A=D.length;E<A;++E){B=D[E];B.style.width=C;B.style.height=G}},getNodeType:function(C,B){var A=null;switch(C.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.externalGraphic){A="olv:rect"}else{if(this.isComplexSymbol(B.graphicName)){A="olv:shape"}else{A="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":A="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":A="olv:shape";break;default:break}return A},setStyle:function(E,B,Q,K){B=B||E._style;Q=Q||E._options;var C=B.fillColor;if(E._geometryClass==="OpenLayers.Geometry.Point"){if(B.externalGraphic){Q.isFilled=true;if(B.graphicTitle){E.title=B.graphicTitle}var D=B.graphicWidth||B.graphicHeight;var L=B.graphicHeight||B.graphicWidth;D=D?D:B.pointRadius*2;L=L?L:B.pointRadius*2;var G=this.getResolution();var I=(B.graphicXOffset!=undefined)?B.graphicXOffset:-(0.5*D);var F=(B.graphicYOffset!=undefined)?B.graphicYOffset:-(0.5*L);E.style.left=((((K.x-this.featureDx)/G-this.offset.x)+I)|0)+"px";E.style.top=(((K.y/G-this.offset.y)-(F+L))|0)+"px";E.style.width=D+"px";E.style.height=L+"px";E.style.flip="y";C="none";Q.isStroked=false}else{if(this.isComplexSymbol(B.graphicName)){var A=this.importSymbol(B.graphicName);E.path=A.path;E.coordorigin=A.left+","+A.bottom;var P=A.size;E.coordsize=P+","+P;this.drawCircle(E,K,B.pointRadius);E.style.flip="y"}else{this.drawCircle(E,K,B.pointRadius)}}}if(Q.isFilled){E.fillcolor=C}else{E.filled="false"}var J=E.getElementsByTagName("fill");var O=(J.length==0)?null:J[0];if(!Q.isFilled){if(O){E.removeChild(O)}}else{if(!O){O=this.createNode("olv:fill",E.id+"_fill")}O.opacity=B.fillOpacity;if(E._geometryClass==="OpenLayers.Geometry.Point"&&B.externalGraphic){if(B.graphicOpacity){O.opacity=B.graphicOpacity}O.src=B.externalGraphic;O.type="frame";if(!(B.graphicWidth&&B.graphicHeight)){O.aspect="atmost"}}if(O.parentNode!=E){E.appendChild(O)}}var N=B.rotation;if((N!==undefined||E._rotation!==undefined)){E._rotation=N;if(B.externalGraphic){this.graphicRotate(E,I,F,B);O.opacity=0}else{if(E._geometryClass==="OpenLayers.Geometry.Point"){E.style.rotation=N||0}}}var H=E.getElementsByTagName("stroke");var M=(H.length==0)?null:H[0];if(!Q.isStroked){E.stroked=false;if(M){M.on=false}}else{if(!M){M=this.createNode("olv:stroke",E.id+"_stroke");E.appendChild(M)}M.on=true;M.color=B.strokeColor;M.weight=B.strokeWidth+"px";M.opacity=B.strokeOpacity;M.endcap=B.strokeLinecap=="butt"?"flat":(B.strokeLinecap||"round");if(B.strokeDashstyle){M.dashstyle=this.dashStyle(B)}}if(B.cursor!="inherit"&&B.cursor!=null){E.style.cursor=B.cursor}return E},graphicRotate:function(N,R,E,Q){var Q=Q||N._style;var O=Q.rotation||0;var A,J;if(!(Q.graphicWidth&&Q.graphicHeight)){var S=new Image();S.onreadystatechange=OpenLayers.Function.bind(function(){if(S.readyState=="complete"||S.readyState=="interactive"){A=S.width/S.height;J=Math.max(Q.pointRadius*2,Q.graphicWidth||0,Q.graphicHeight||0);R=R*A;Q.graphicWidth=J*A;Q.graphicHeight=J;this.graphicRotate(N,R,E,Q)}},this);S.src=Q.externalGraphic;return }else{J=Math.max(Q.graphicWidth,Q.graphicHeight);A=Q.graphicWidth/Q.graphicHeight}var M=Math.round(Q.graphicWidth||J*A);var K=Math.round(Q.graphicHeight||J);N.style.width=M+"px";N.style.height=K+"px";var L=document.getElementById(N.id+"_image");if(!L){L=this.createNode("olv:imagedata",N.id+"_image");N.appendChild(L)}L.style.width=M+"px";L.style.height=K+"px";L.src=Q.externalGraphic;L.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var F=O*Math.PI/180;var H=Math.sin(F);var D=Math.cos(F);var G="progid:DXImageTransform.Microsoft.Matrix(M11="+D+",M12="+(-H)+",M21="+H+",M22="+D+",SizingMethod='auto expand')\n";var B=Q.graphicOpacity||Q.fillOpacity;if(B&&B!=1){G+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+B+")\n"}N.style.filter=G;var P=new OpenLayers.Geometry.Point(-R,-E);var C=new OpenLayers.Bounds(0,0,M,K).toGeometry();C.rotate(Q.rotation,P);var I=C.getBounds();N.style.left=Math.round(parseInt(N.style.left)+I.left)+"px";N.style.top=Math.round(parseInt(N.style.top)-I.bottom)+"px"},postDraw:function(A){A.style.visibility="visible";var C=A._style.fillColor;var B=A._style.strokeColor;if(C=="none"&&A.fillcolor!=C){A.fillcolor=C}if(B=="none"&&A.strokecolor!=B){A.strokecolor=B}},setNodeDimension:function(B,E){var D=E.getBounds();if(D){var A=this.getResolution();var C=new OpenLayers.Bounds(((D.left-this.featureDx)/A-this.offset.x)|0,(D.bottom/A-this.offset.y)|0,((D.right-this.featureDx)/A-this.offset.x)|0,(D.top/A-this.offset.y)|0);B.style.left=C.left+"px";B.style.top=C.top+"px";B.style.width=C.getWidth()+"px";B.style.height=C.getHeight()+"px";B.coordorigin=C.left+" "+C.top;B.coordsize=C.getWidth()+" "+C.getHeight()}},dashStyle:function(A){var C=A.strokeDashstyle;switch(C){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return C;default:var B=C.split(/[ ,]/);if(B.length==2){if(1*B[0]>=2*B[1]){return"longdash"}return(B[0]==1||B[1]==1)?"dot":"dash"}else{if(B.length==4){return(1*B[0]>=2*B[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(A,C){var B=document.createElement(A);if(C){B.id=C}B.unselectable="on";B.onselectstart=OpenLayers.Function.False;return B},nodeTypeCompare:function(C,B){var D=B;var A=D.indexOf(":");if(A!=-1){D=D.substr(A+1)}var E=C.nodeName;A=E.indexOf(":");if(A!=-1){E=E.substr(A+1)}return(D==E)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(A){return this.nodeFactory(this.container.id+A,"olv:group")},drawPoint:function(A,B){return this.drawCircle(A,B,1)},drawCircle:function(D,E,A){if(!isNaN(E.x)&&!isNaN(E.y)){var B=this.getResolution();D.style.left=((((E.x-this.featureDx)/B-this.offset.x)|0)-A)+"px";D.style.top=(((E.y/B-this.offset.y)|0)-A)+"px";var C=A*2;D.style.width=C+"px";D.style.height=C+"px";return D}return false},drawLineString:function(A,B){return this.drawLine(A,B,false)},drawLinearRing:function(A,B){return this.drawLine(A,B,true)},drawLine:function(B,J,G){this.setNodeDimension(B,J);var C=this.getResolution();var A=J.components.length;var E=new Array(A);var H,K,I;for(var F=0;F<A;F++){H=J.components[F];K=((H.x-this.featureDx)/C-this.offset.x)|0;I=(H.y/C-this.offset.y)|0;E[F]=" "+K+","+I+" l "}var D=(G)?" x e":" e";B.path="m"+E.join("")+D;return B},drawPolygon:function(C,K){this.setNodeDimension(C,K);var D=this.getResolution();var P=[];var E,I,M,A,G,B,F,O,H,N,L,J;for(E=0,I=K.components.length;E<I;E++){P.push("m");M=K.components[E].components;A=(E===0);G=null;B=null;for(F=0,O=M.length;F<O;F++){H=M[F];L=((H.x-this.featureDx)/D-this.offset.x)|0;J=(H.y/D-this.offset.y)|0;N=" "+L+","+J;P.push(N);if(F==0){P.push(" l")}if(!A){if(!G){G=N}else{if(G!=N){if(!B){B=N}else{if(B!=N){A=true}}}}}}P.push(A?" x ":" ")}P.push("e");C.path=P.join("");return C},drawRectangle:function(B,C){var A=this.getResolution();B.style.left=(((C.x-this.featureDx)/A-this.offset.x)|0)+"px";B.style.top=((C.y/A-this.offset.y)|0)+"px";B.style.width=((C.width/A)|0)+"px";B.style.height=((C.height/A)|0)+"px";return B},drawText:function(D,A,H){var G=this.nodeFactory(D+this.LABEL_ID_SUFFIX,"olv:rect");var F=this.nodeFactory(D+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var C=this.getResolution();G.style.left=(((H.x-this.featureDx)/C-this.offset.x)|0)+"px";G.style.top=((H.y/C-this.offset.y)|0)+"px";G.style.flip="y";F.innerText=A.label;if(A.cursor!="inherit"&&A.cursor!=null){F.style.cursor=A.cursor}if(A.fontColor){F.style.color=A.fontColor}if(A.fontOpacity){F.style.filter="alpha(opacity="+(A.fontOpacity*100)+")"}if(A.fontFamily){F.style.fontFamily=A.fontFamily}if(A.fontSize){F.style.fontSize=A.fontSize}if(A.fontWeight){F.style.fontWeight=A.fontWeight}if(A.fontStyle){F.style.fontStyle=A.fontStyle}if(A.labelSelect===true){G._featureId=D;F._featureId=D;F._geometry=H;F._geometryClass=H.CLASS_NAME}F.style.whiteSpace="nowrap";F.inset="1px,0px,0px,0px";if(!G.parentNode){G.appendChild(F);this.textRoot.appendChild(G)}var E=A.labelAlign||"cm";if(E.length==1){E+="m"}var I=F.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[E.substr(0,1)]);var B=F.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[E.substr(1,1)]);G.style.left=parseInt(G.style.left)-I-1+"px";G.style.top=parseInt(G.style.top)+B+"px"},moveRoot:function(B){var A=this.map.getLayer(B.container.id);if(A instanceof OpenLayers.Layer.Vector.RootContainer){A=this.map.getLayer(this.container.id)}A&&A.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);A&&A.redraw()},importSymbol:function(D){var B=this.container.id+"-"+D;var A=this.symbolCache[B];if(A){return A}var C=OpenLayers.Renderer.symbol[D];if(!C){throw new Error(D+" is not a valid symbol name")}var J=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var E=["m"];for(var F=0;F<C.length;F=F+2){var H=C[F];var G=C[F+1];J.left=Math.min(J.left,H);J.bottom=Math.min(J.bottom,G);J.right=Math.max(J.right,H);J.top=Math.max(J.top,G);E.push(H);E.push(G);if(F==0){E.push("l")}}E.push("x e");var K=E.join(" ");var I=(J.getWidth()-J.getHeight())/2;if(I>0){J.bottom=J.bottom-I;J.top=J.top+I}else{J.left=J.left+I;J.right=J.right-I}A={path:K,size:J.getWidth(),left:J.left,bottom:J.bottom};this.symbolCache[B]=A;return A},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};OpenLayers.Control.CacheRead=OpenLayers.Class(OpenLayers.Control,{fetchEvent:"tileloadstart",layers:null,autoActivate:true,setMap:function(C){OpenLayers.Control.prototype.setMap.apply(this,arguments);var A,B=this.layers||C.layers;for(A=B.length-1;A>=0;--A){this.addLayer({layer:B[A]})}if(!this.layers){C.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})}},addLayer:function(A){A.layer.events.register(this.fetchEvent,this,this.fetch)},removeLayer:function(A){A.layer.events.unregister(this.fetchEvent,this,this.fetch)},fetch:function(B){if(this.active&&window.localStorage&&B.tile instanceof OpenLayers.Tile.Image){var D=B.tile,C=D.url;if(!D.layer.crossOriginKeyword&&OpenLayers.ProxyHost&&C.indexOf(OpenLayers.ProxyHost)===0){C=OpenLayers.Control.CacheWrite.urlMap[C]}var A=window.localStorage.getItem("olCache_"+C);if(A){D.url=A;if(B.type==="tileerror"){D.setImgSrc(A)}}}},destroy:function(){if(this.layers||this.map){var A,B=this.layers||this.map.layers;for(A=B.length-1;A>=0;--A){this.removeLayer({layer:B[A]})}}if(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:false,requestEncoding:"KVP",drillDown:false,maxFeatures:10,clickCallback:"click",layers:null,queryVisible:true,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,pending:0,initialize:function(A){A=A||{};A.handlerOptions=A.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[A]);if(!this.format){this.format=new OpenLayers.Format.WMSGetFeatureInfo(A.formatOptions)}if(this.drillDown===true){this.hover=false}if(this.hover){this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}))}else{var B={};B[this.clickCallback]=this.getInfoForClick;this.handler=new OpenLayers.Handler.Click(this,B,this.handlerOptions.click||{})}},getInfoForClick:function(A){this.request(A.xy,{})},getInfoForHover:function(A){this.request(A.xy,{hover:true})},cancelHover:function(){if(this.hoverRequest){--this.pending;if(this.pending<=0){OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait");this.pending=0}this.hoverRequest.abort();this.hoverRequest=null}},findLayers:function(){var C=this.layers||this.map.layers;var D=[];var B;for(var A=C.length-1;A>=0;--A){B=C[A];if(B instanceof OpenLayers.Layer.WMTS&&B.requestEncoding===this.requestEncoding&&(!this.queryVisible||B.getVisibility())){D.push(B);if(!this.drillDown||this.hover){break}}}return D},buildRequestOptions:function(B,C){var F=this.map.getLonLatFromPixel(C);var E=B.getURL(new OpenLayers.Bounds(F.lon,F.lat,F.lon,F.lat));var D=OpenLayers.Util.getParameters(E);var A=B.getTileInfo(F);OpenLayers.Util.extend(D,{service:"WMTS",version:B.version,request:"GetFeatureInfo",infoFormat:this.infoFormat,i:A.i,j:A.j});OpenLayers.Util.applyDefaults(D,this.vendorParams);return{url:OpenLayers.Util.isArray(B.url)?B.url[0]:B.url,params:OpenLayers.Util.upperCaseObject(D),callback:function(G){this.handleResponse(C,G,B)},scope:this}},request:function(H,I){I=I||{};var C=this.findLayers();if(C.length>0){var G,E;for(var D=0,F=C.length;D<F;D++){E=C[D];G=this.events.triggerEvent("beforegetfeatureinfo",{xy:H,layer:E});if(G!==false){++this.pending;var A=this.buildRequestOptions(E,H);var B=OpenLayers.Request.GET(A);if(I.hover===true){this.hoverRequest=B}}}if(this.pending>0){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait")}}},handleResponse:function(G,E,B){--this.pending;if(this.pending<=0){OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait");this.pending=0}if(E.status&&(E.status<200||E.status>=300)){this.events.triggerEvent("exception",{xy:G,request:E,layer:B})}else{var F=E.responseXML;if(!F||!F.documentElement){F=E.responseText}var D,C;try{D=this.format.read(F)}catch(A){C=true;this.events.triggerEvent("exception",{xy:G,request:E,error:A,layer:B})}if(!C){this.events.triggerEvent("getfeatureinfo",{text:E.responseText,features:D,request:E,xy:G,layer:B})}}},CLASS_NAME:"OpenLayers.Control.WMTSGetFeatureInfo"});OpenLayers.Protocol.CSW.v2_0_2=OpenLayers.Class(OpenLayers.Protocol,{formatOptions:null,initialize:function(A){OpenLayers.Protocol.prototype.initialize.apply(this,[A]);if(!A.format){this.format=new OpenLayers.Format.CSWGetRecords.v2_0_2(OpenLayers.Util.extend({},this.formatOptions))}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy()}this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(B){B=OpenLayers.Util.extend({},B);OpenLayers.Util.applyDefaults(B,this.options||{});var A=new OpenLayers.Protocol.Response({requestType:"read"});var C=this.format.write(B.params);A.priv=OpenLayers.Request.POST({url:B.url,callback:this.createCallback(this.handleRead,A,B),params:B.params,headers:B.headers,data:C});return A},handleRead:function(A,B){if(B.callback){var C=A.priv;if(C.status>=200&&C.status<300){A.data=this.parseData(C);A.code=OpenLayers.Protocol.Response.SUCCESS}else{A.code=OpenLayers.Protocol.Response.FAILURE}B.callback.call(B.scope,A)}},parseData:function(A){var B=A.responseXML;if(!B||!B.documentElement){B=A.responseText}if(!B||B.length<=0){return null}return this.format.read(B)},CLASS_NAME:"OpenLayers.Protocol.CSW.v2_0_2"});OpenLayers.Control.Graticule=OpenLayers.Class(OpenLayers.Control,{autoActivate:true,intervals:[45,30,20,10,5,2,1,0.5,0.2,0.1,0.05,0.01,0.005,0.002,0.001],displayInLayerSwitcher:true,visible:true,numPoints:50,targetSize:200,layerName:null,labelled:true,labelFormat:"dm",lineSymbolizer:{strokeColor:"#333",strokeWidth:1,strokeOpacity:0.5},labelSymbolizer:{},gratLayer:null,initialize:function(A){A=A||{};A.layerName=A.layerName||OpenLayers.i18n("Graticule");OpenLayers.Control.prototype.initialize.apply(this,[A]);this.labelSymbolizer.stroke=false;this.labelSymbolizer.fill=false;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);if(this.gratLayer){this.gratLayer.destroy();this.gratLayer=null}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.gratLayer){var A=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":A}),visibility:this.visible,displayInLayerSwitcher:this.displayInLayerSwitcher})}return this.div},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){this.map.addLayer(this.gratLayer);this.map.events.register("moveend",this,this.update);this.update();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.map.events.unregister("moveend",this,this.update);this.map.removeLayer(this.gratLayer);return true}else{return false}},update:function(){var I=this.map.getExtent();if(!I){return }this.gratLayer.destroyFeatures();var J=new OpenLayers.Projection("EPSG:4326");var e=this.map.getProjectionObject();var G=this.map.getResolution();if(e.proj&&e.proj.projName=="longlat"){this.numPoints=1}var h=this.map.getCenter();var a=new OpenLayers.Pixel(h.lon,h.lat);OpenLayers.Projection.transform(a,e,J);var V=this.targetSize*G;V*=V;var N;for(var Z=0;Z<this.intervals.length;++Z){N=this.intervals[Z];var f=N/2;var D=a.offset({x:-f,y:-f});var B=a.offset({x:f,y:f});OpenLayers.Projection.transform(D,J,e);OpenLayers.Projection.transform(B,J,e);var E=(D.x-B.x)*(D.x-B.x)+(D.y-B.y)*(D.y-B.y);if(E<=V){break}}a.x=Math.floor(a.x/N)*N;a.y=Math.floor(a.y/N)*N;var Y=0;var O=[a.clone()];var M=a.clone();var W;do{M=M.offset({x:0,y:N});W=OpenLayers.Projection.transform(M.clone(),J,e);O.unshift(M)}while(I.containsPixel(W)&&++Y<1000);M=a.clone();do{M=M.offset({x:0,y:-N});W=OpenLayers.Projection.transform(M.clone(),J,e);O.push(M)}while(I.containsPixel(W)&&++Y<1000);Y=0;var T=[a.clone()];M=a.clone();do{M=M.offset({x:-N,y:0});W=OpenLayers.Projection.transform(M.clone(),J,e);T.unshift(M)}while(I.containsPixel(W)&&++Y<1000);M=a.clone();do{M=M.offset({x:N,y:0});W=OpenLayers.Projection.transform(M.clone(),J,e);T.push(M)}while(I.containsPixel(W)&&++Y<1000);var A=[];for(var Z=0;Z<T.length;++Z){var F=T[Z].x;var S=[];var g=null;var b=Math.min(O[0].y,90);var L=Math.max(O[O.length-1].y,-90);var C=(b-L)/this.numPoints;var H=L;for(var X=0;X<=this.numPoints;++X){var c=new OpenLayers.Geometry.Point(F,H);c.transform(J,e);S.push(c);H+=C;if(c.y>=I.bottom&&!g){g=c}}if(this.labelled){var Q=new OpenLayers.Geometry.Point(g.x,I.bottom);var d={value:F,label:this.labelled?OpenLayers.Util.getFormattedLonLat(F,"lon",this.labelFormat):"",labelAlign:"cb",xOffset:0,yOffset:2};this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(Q,d))}var R=new OpenLayers.Geometry.LineString(S);A.push(new OpenLayers.Feature.Vector(R))}for(var X=0;X<O.length;++X){H=O[X].y;if(H<-90||H>90){continue}var S=[];var U=T[0].x;var P=T[T.length-1].x;var K=(P-U)/this.numPoints;var F=U;var g=null;for(var Z=0;Z<=this.numPoints;++Z){var c=new OpenLayers.Geometry.Point(F,H);c.transform(J,e);S.push(c);F+=K;if(c.x<I.right){g=c}}if(this.labelled){var Q=new OpenLayers.Geometry.Point(I.right,g.y);var d={value:H,label:this.labelled?OpenLayers.Util.getFormattedLonLat(H,"lat",this.labelFormat):"",labelAlign:"rb",xOffset:-2,yOffset:2};this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(Q,d))}var R=new OpenLayers.Geometry.LineString(S);A.push(new OpenLayers.Feature.Vector(R))}this.gratLayer.addFeatures(A)},CLASS_NAME:"OpenLayers.Control.Graticule"});OpenLayers.Layer.UTFGrid=OpenLayers.Class(OpenLayers.Layer.XYZ,{isBaseLayer:false,projection:new OpenLayers.Projection("EPSG:900913"),useJSONP:false,tileClass:OpenLayers.Tile.UTFGrid,initialize:function(A){OpenLayers.Layer.Grid.prototype.initialize.apply(this,[A.name,A.url,{},A]);this.tileOptions=OpenLayers.Util.extend({utfgridResolution:this.utfgridResolution},this.tileOptions)},clone:function(A){if(A==null){A=new OpenLayers.Layer.UTFGrid(this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getFeatureInfo:function(B){var C=null;var A=this.getTileData(B);if(A.tile){C=A.tile.getFeatureInfo(A.i,A.j)}return C},getFeatureId:function(A){var C=null;var B=this.getTileData(A);if(B.tile){C=B.tile.getFeatureId(B.i,B.j)}return C},CLASS_NAME:"OpenLayers.Layer.UTFGrid"});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:false,initialize:function(A){A=A||{};this.params={};this.pendingRequests={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments);if(!this.format){this.format=new OpenLayers.Format.GeoJSON()}if(!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var B=new OpenLayers.Format.QueryStringFilter({srsInBBOX:this.srsInBBOX});this.filterToParams=function(C,D){return B.write(C,D)}}},read:function(B){OpenLayers.Protocol.prototype.read.apply(this,arguments);B=OpenLayers.Util.applyDefaults(B,this.options);B.params=OpenLayers.Util.applyDefaults(B.params,this.options.params);if(B.filter&&this.filterToParams){B.params=this.filterToParams(B.filter,B.params)}var A=new OpenLayers.Protocol.Response({requestType:"read"});var C=this.createRequest(B.url,B.params,OpenLayers.Function.bind(function(D){A.data=D;this.handleRead(A,B)},this));A.priv=C;return A},createRequest:function(C,E,G){var F=OpenLayers.Protocol.Script.register(G);var B=OpenLayers.String.format(this.callbackTemplate,{id:F});E=OpenLayers.Util.extend({},E);E[this.callbackKey]=this.callbackPrefix+B;C=OpenLayers.Util.urlAppend(C,OpenLayers.Util.getParameterString(E));var A=document.createElement("script");A.type="text/javascript";A.src=C;A.id="OpenLayers_Protocol_Script_"+F;this.pendingRequests[A.id]=A;var D=document.getElementsByTagName("head")[0];D.appendChild(A);return A},destroyRequest:function(A){OpenLayers.Protocol.Script.unregister(A.id.split("_").pop());delete this.pendingRequests[A.id];if(A.parentNode){A.parentNode.removeChild(A)}},handleRead:function(A,B){this.handleResponse(A,B)},handleResponse:function(A,B){if(B.callback){if(A.data){A.features=this.parseFeatures(A.data);A.code=OpenLayers.Protocol.Response.SUCCESS}else{A.code=OpenLayers.Protocol.Response.FAILURE}this.destroyRequest(A.priv);B.callback.call(B.scope,A)}},parseFeatures:function(A){return this.format.read(A)},abort:function(A){if(A){this.destroyRequest(A.priv)}else{for(var B in this.pendingRequests){this.destroyRequest(this.pendingRequests[B])}}},destroy:function(){this.abort();delete this.params;delete this.format;OpenLayers.Protocol.prototype.destroy.apply(this)},CLASS_NAME:"OpenLayers.Protocol.Script"});(function(){var B=OpenLayers.Protocol.Script;var A=0;B.registry={};B.register=function(D){var C="c"+(++A);B.registry[C]=function(){D.apply(this,arguments)};return C};B.unregister=function(C){delete B.registry[C]}})();OpenLayers.Control.TransformFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,layer:null,preserveAspectRatio:false,rotate:true,feature:null,renderIntent:"temporary",rotationHandleSymbolizer:null,box:null,center:null,scale:1,ratio:1,rotation:0,handles:null,rotationHandles:null,dragControl:null,irregular:false,initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.layer=B;if(!this.rotationHandleSymbolizer){this.rotationHandleSymbolizer={stroke:false,pointRadius:10,fillOpacity:0,cursor:"pointer"}}this.createBox();this.createControl()},activate:function(){var A=false;if(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);A=true}return A},deactivate:function(){var A=false;if(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();A=true}return A},setMap:function(A){this.dragControl.setMap(A);OpenLayers.Control.prototype.setMap.apply(this,arguments)},setFeature:function(I,C){C=OpenLayers.Util.applyDefaults(C,{rotation:0,scale:1,ratio:1});var E=this.rotation;var A=this.center;OpenLayers.Util.extend(this,C);var J=this.events.triggerEvent("beforesetfeature",{feature:I});if(J===false){return }this.feature=I;this.activate();this._setfeature=true;var B=this.feature.geometry.getBounds();this.box.move(B.getCenterLonLat());this.box.geometry.rotate(-E,A);this._angle=0;var F;if(this.rotation){var G=I.geometry.clone();G.rotate(-this.rotation,this.center);var D=new OpenLayers.Feature.Vector(G.getBounds().toGeometry());D.geometry.rotate(this.rotation,this.center);this.box.geometry.rotate(this.rotation,this.center);this.box.move(D.geometry.getBounds().getCenterLonLat());var H=D.geometry.components[0].components[0];F=H.getBounds().getCenterLonLat()}else{F=new OpenLayers.LonLat(B.left,B.bottom)}this.handles[0].move(F);delete this._setfeature;this.events.triggerEvent("setfeature",{feature:I})},unsetFeature:function(){if(this.active){this.deactivate()}else{this.feature=null;this.rotation=0;this.scale=1;this.ratio=1}},createBox:function(){var F=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,typeof this.renderIntent=="string"?null:this.renderIntent);this.box.geometry.move=function(N,O){F._moving=true;OpenLayers.Geometry.LineString.prototype.move.apply(this,arguments);F.center.move(N,O);delete F._moving};var A=function(N,O){OpenLayers.Geometry.Point.prototype.move.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.move(N,O);this._handle.geometry.move(N,O)};var M=function(P,N,O){OpenLayers.Geometry.Point.prototype.resize.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.resize(P,N,O);this._handle.geometry.resize(P,N,O)};var K=function(O,N){OpenLayers.Geometry.Point.prototype.rotate.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.rotate(O,N);this._handle.geometry.rotate(O,N)};var H=function(U,S){var T=this.x,R=this.y;OpenLayers.Geometry.Point.prototype.move.call(this,U,S);if(F._moving){return }var Y=F.dragControl.handlers.drag.evt;var X=!F._setfeature&&F.preserveAspectRatio;var a=!X&&!(Y&&Y.shiftKey);var b=new OpenLayers.Geometry.Point(T,R);var Z=F.center;this.rotate(-F.rotation,Z);b.rotate(-F.rotation,Z);var O=this.x-Z.x;var V=this.y-Z.y;var P=O-(this.x-b.x);var W=V-(this.y-b.y);if(F.irregular&&!F._setfeature){O-=(this.x-b.x)/2;V-=(this.y-b.y)/2}this.x=T;this.y=R;var e,Q=1;if(a){e=Math.abs(W)<0.00001?1:V/W;Q=(Math.abs(P)<0.00001?1:(O/P))/e}else{var d=Math.sqrt((P*P)+(W*W));var c=Math.sqrt((O*O)+(V*V));e=c/d}F._moving=true;F.box.geometry.rotate(-F.rotation,Z);delete F._moving;F.box.geometry.resize(e,Z,Q);F.box.geometry.rotate(F.rotation,Z);F.transformFeature({scale:e,ratio:Q});if(F.irregular&&!F._setfeature){var N=Z.clone();N.x+=Math.abs(T-Z.x)<0.00001?0:(this.x-T);N.y+=Math.abs(R-Z.y)<0.00001?0:(this.y-R);F.box.geometry.move(this.x-T,this.y-R);F.transformFeature({center:N})}};var C=function(V,T){var b=this.x,Y=this.y;OpenLayers.Geometry.Point.prototype.move.call(this,V,T);if(F._moving){return }var Z=F.dragControl.handlers.drag.evt;var U=(Z&&Z.shiftKey)?45:1;var S=F.center;var X=this.x-S.x;var Q=this.y-S.y;var a=X-V;var R=Q-T;this.x=b;this.y=Y;var O=Math.atan2(R,a);var N=Math.atan2(Q,X);var P=N-O;P*=180/Math.PI;F._angle=(F._angle+P)%360;var W=F.rotation%U;if(Math.abs(F._angle)>=U||W!==0){P=Math.round(F._angle/U)*U-W;F._angle=0;F.box.geometry.rotate(P,S);F.transformFeature({rotation:P})}};var L=new Array(8);var I=new Array(4);var J,G,B;var E=["sw","s","se","e","ne","n","nw","w"];for(var D=0;D<8;++D){J=this.box.geometry.components[D];G=new OpenLayers.Feature.Vector(J.clone(),{role:E[D]+"-resize"},typeof this.renderIntent=="string"?null:this.renderIntent);if(D%2==0){B=new OpenLayers.Feature.Vector(J.clone(),{role:E[D]+"-rotate"},typeof this.rotationHandleSymbolizer=="string"?null:this.rotationHandleSymbolizer);B.geometry.move=C;J._rotationHandle=B;I[D/2]=B}J.move=A;J.resize=M;J.rotate=K;G.geometry.move=H;J._handle=G;L[D]=G}this.rotationHandles=I;this.handles=L},createControl:function(){var A=this;this.dragControl=new OpenLayers.Control.DragFeature(this.layer,{documentDrag:true,moveFeature:function(B){if(this.feature===A.feature){this.feature=A.box}OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,arguments)},onDrag:function(C,B){if(C===A.box){A.transformFeature({center:A.center})}},onStart:function(E,C){var B=!A.geometryTypes||OpenLayers.Util.indexOf(A.geometryTypes,E.geometry.CLASS_NAME)!==-1;var D=OpenLayers.Util.indexOf(A.handles,E);D+=OpenLayers.Util.indexOf(A.rotationHandles,E);if(E!==A.feature&&E!==A.box&&D==-2&&B){A.setFeature(E)}},onComplete:function(C,B){A.events.triggerEvent("transformcomplete",{feature:A.feature})}})},drawHandles:function(){var B=this.layer;for(var A=0;A<8;++A){if(this.rotate&&A%2===0){B.drawFeature(this.rotationHandles[A/2],this.rotationHandleSymbolizer)}B.drawFeature(this.handles[A],this.renderIntent)}},transformFeature:function(E){if(!this._setfeature){this.scale*=(E.scale||1);this.ratio*=(E.ratio||1);var B=this.rotation;this.rotation=(this.rotation+(E.rotation||0))%360;if(this.events.triggerEvent("beforetransform",E)!==false){var D=this.feature;var C=D.geometry;var A=this.center;C.rotate(-B,A);if(E.scale||E.ratio){C.resize(E.scale,A,E.ratio)}else{if(E.center){D.move(E.center.getBounds().getCenterLonLat())}}C.rotate(this.rotation,A);this.layer.drawFeature(D);D.toState(OpenLayers.State.UPDATE);this.events.triggerEvent("transform",E)}}this.layer.drawFeature(this.box,this.renderIntent);this.drawHandles()},destroy:function(){var B;for(var A=0;A<8;++A){B=this.box.geometry.components[A];B._handle.destroy();B._handle=null;B._rotationHandle&&B._rotationHandle.destroy();B._rotationHandle=null}this.center=null;this.feature=null;this.handles=null;this.rotationHandleSymbolizer=null;this.rotationHandles=null;this.box.destroy();this.box=null;this.layer=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:true,type:"png",useScales:false,overrideDPI:false,initialize:function(B,C,K){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments);if(this.resolutions){this.serverResolutions=this.resolutions;this.maxExtent=this.getMaxExtentForResolution(this.resolutions[0])}if(this.layerInfo){var E=this.layerInfo;var G=new OpenLayers.Bounds(E.fullExtent.xmin,E.fullExtent.ymin,E.fullExtent.xmax,E.fullExtent.ymax);this.projection="EPSG:"+E.spatialReference.wkid;this.sphericalMercator=(E.spatialReference.wkid==102100);this.units=(E.units=="esriFeet")?"ft":"m";if(!!E.tileInfo){this.tileSize=new OpenLayers.Size(E.tileInfo.width||E.tileInfo.cols,E.tileInfo.height||E.tileInfo.rows);this.tileOrigin=new OpenLayers.LonLat(E.tileInfo.origin.x,E.tileInfo.origin.y);var A=new OpenLayers.Geometry.Point(G.left,G.top);var I=new OpenLayers.Geometry.Point(G.right,G.bottom);if(this.useScales){this.scales=[]}else{this.resolutions=[]}this.lods=[];for(var J in E.tileInfo.lods){if(E.tileInfo.lods.hasOwnProperty(J)){var H=E.tileInfo.lods[J];if(this.useScales){this.scales.push(H.scale)}else{this.resolutions.push(H.resolution)}var D=this.getContainingTileCoords(A,H.resolution);H.startTileCol=D.x;H.startTileRow=D.y;var F=this.getContainingTileCoords(I,H.resolution);H.endTileCol=F.x;H.endTileRow=F.y;this.lods.push(H)}}this.maxExtent=this.calculateMaxExtentWithLOD(this.lods[0]);this.serverResolutions=this.resolutions;if(this.overrideDPI&&E.tileInfo.dpi){OpenLayers.DOTS_PER_INCH=E.tileInfo.dpi}}}},getContainingTileCoords:function(A,B){return new OpenLayers.Pixel(Math.max(Math.floor((A.x-this.tileOrigin.lon)/(this.tileSize.w*B)),0),Math.max(Math.floor((this.tileOrigin.lat-A.y)/(this.tileSize.h*B)),0))},calculateMaxExtentWithLOD:function(F){var C=(F.endTileCol-F.startTileCol)+1;var B=(F.endTileRow-F.startTileRow)+1;var A=this.tileOrigin.lon+(F.startTileCol*this.tileSize.w*F.resolution);var E=A+(C*this.tileSize.w*F.resolution);var D=this.tileOrigin.lat-(F.startTileRow*this.tileSize.h*F.resolution);var G=D-(B*this.tileSize.h*F.resolution);return new OpenLayers.Bounds(A,G,E,D)},calculateMaxExtentWithExtent:function(E,D){var C=new OpenLayers.Geometry.Point(E.left,E.top);var B=new OpenLayers.Geometry.Point(E.right,E.bottom);var G=this.getContainingTileCoords(C,D);var A=this.getContainingTileCoords(B,D);var F={resolution:D,startTileCol:G.x,startTileRow:G.y,endTileCol:A.x,endTileRow:A.y};return this.calculateMaxExtentWithLOD(F)},getUpperLeftTileCoord:function(B){var A=new OpenLayers.Geometry.Point(this.maxExtent.left,this.maxExtent.top);return this.getContainingTileCoords(A,B)},getLowerRightTileCoord:function(B){var A=new OpenLayers.Geometry.Point(this.maxExtent.right,this.maxExtent.bottom);return this.getContainingTileCoords(A,B)},getMaxExtentForResolution:function(G){var C=this.getUpperLeftTileCoord(G);var F=this.getLowerRightTileCoord(G);var H=(F.x-C.x)+1;var I=(F.y-C.y)+1;var E=this.tileOrigin.lon+(C.x*this.tileSize.w*G);var B=E+(H*this.tileSize.w*G);var A=this.tileOrigin.lat-(C.y*this.tileSize.h*G);var D=A-(I*this.tileSize.h*G);return new OpenLayers.Bounds(E,D,B,A)},clone:function(A){if(A==null){A=new OpenLayers.Layer.ArcGISCache(this.name,this.url,this.options)}return OpenLayers.Layer.XYZ.prototype.clone.apply(this,[A])},getMaxExtent:function(){var A=this.map.getResolution();return this.maxExtent=this.getMaxExtentForResolution(A)},getTileOrigin:function(){var A=this.getMaxExtent();return new OpenLayers.LonLat(A.left,A.bottom)},getURL:function(A){var I=this.getResolution();var F=(this.tileOrigin.lon+(I*this.tileSize.w/2));var E=(this.tileOrigin.lat-(I*this.tileSize.h/2));var B=A.getCenterLonLat();var M={x:B.lon,y:B.lat};var L=(Math.round(Math.abs((B.lon-F)/(I*this.tileSize.w))));var K=(Math.round(Math.abs((E-B.lat)/(I*this.tileSize.h))));var J=this.map.getZoom();if(this.lods){var H=this.lods[this.map.getZoom()];if((L<H.startTileCol||L>H.endTileCol)||(K<H.startTileRow||K>H.endTileRow)){return null}}else{var D=this.getUpperLeftTileCoord(I);var G=this.getLowerRightTileCoord(I);if((L<D.x||L>=G.x)||(K<D.y||K>=G.y)){return null}}var C=this.url;var N=""+L+K+J;if(OpenLayers.Util.isArray(C)){C=this.selectUrl(N,C)}if(this.useArcGISServer){C=C+"/tile/${z}/${y}/${x}"}else{L="C"+this.zeroPad(L,8,16);K="R"+this.zeroPad(K,8,16);J="L"+this.zeroPad(J,2,16);C=C+"/${z}/${y}/${x}."+this.type}C=OpenLayers.String.format(C,{x:L,y:K,z:J});return OpenLayers.Util.urlAppend(C,OpenLayers.Util.getParameterString(this.params))},zeroPad:function(B,A,C){var D=B.toString(C||10);while(D.length<A){D="0"+D}return D},CLASS_NAME:"OpenLayers.Layer.ArcGISCache"});OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:false,drillDown:false,maxFeatures:10,clickCallback:"click",output:"features",layers:null,queryVisible:false,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,initialize:function(A){A=A||{};A.handlerOptions=A.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[A]);if(!this.format){this.format=new OpenLayers.Format.WMSGetFeatureInfo(A.formatOptions)}if(this.drillDown===true){this.hover=false}if(this.hover){this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}))}else{var B={};B[this.clickCallback]=this.getInfoForClick;this.handler=new OpenLayers.Handler.Click(this,B,this.handlerOptions.click||{})}},getInfoForClick:function(A){this.events.triggerEvent("beforegetfeatureinfo",{xy:A.xy});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");this.request(A.xy,{})},getInfoForHover:function(A){this.events.triggerEvent("beforegetfeatureinfo",{xy:A.xy});this.request(A.xy,{hover:true})},cancelHover:function(){if(this.hoverRequest){this.hoverRequest.abort();this.hoverRequest=null}},findLayers:function(){var D=this.layers||this.map.layers;var E=[];var C,A;for(var B=D.length-1;B>=0;--B){C=D[B];if(C instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||C.getVisibility())){A=OpenLayers.Util.isArray(C.url)?C.url[0]:C.url;if(this.drillDown===false&&!this.url){this.url=A}if(this.drillDown===true||this.urlMatches(A)){E.push(C)}}}return E},urlMatches:function(B){var D=OpenLayers.Util.isEquivalentUrl(this.url,B);if(!D&&this.layerUrls){for(var C=0,A=this.layerUrls.length;C<A;++C){if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[C],B)){D=true;break}}}return D},buildWMSOptions:function(B,E,C,K){var I=[],L=[];for(var F=0,H=E.length;F<H;F++){if(E[F].params.LAYERS!=null){I=I.concat(E[F].params.LAYERS);L=L.concat(this.getStyleNames(E[F]))}}var A=E[0];var G=this.map.getProjection();var J=A.projection;if(J&&J.equals(this.map.getProjectionObject())){G=J.getCode()}var D=OpenLayers.Util.extend({service:"WMS",version:A.params.VERSION,request:"GetFeatureInfo",exceptions:A.params.EXCEPTIONS,bbox:this.map.getExtent().toBBOX(null,A.reverseAxisOrder()),feature_count:this.maxFeatures,height:this.map.getSize().h,width:this.map.getSize().w,format:K,info_format:A.params.INFO_FORMAT||this.infoFormat},(parseFloat(A.params.VERSION)>=1.3)?{crs:G,i:parseInt(C.x),j:parseInt(C.y)}:{srs:G,x:parseInt(C.x),y:parseInt(C.y)});if(I.length!=0){D=OpenLayers.Util.extend({layers:I,query_layers:I,styles:L},D)}OpenLayers.Util.applyDefaults(D,this.vendorParams);return{url:B,params:OpenLayers.Util.upperCaseObject(D),callback:function(M){this.handleResponse(C,M,B)},scope:this}},getStyleNames:function(B){var A;if(B.params.STYLES){A=B.params.STYLES}else{if(OpenLayers.Util.isArray(B.params.LAYERS)){A=new Array(B.params.LAYERS.length)}else{A=B.params.LAYERS.replace(/[^,]/g,"")}}return A},request:function(B,L){var D=this.findLayers();if(D.length==0){this.events.triggerEvent("nogetfeatureinfo");OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait");return }L=L||{};if(this.drillDown===false){var J=this.buildWMSOptions(this.url,D,B,D[0].params.FORMAT);var C=OpenLayers.Request.GET(J);if(L.hover===true){this.hoverRequest=C}}else{this._requestCount=0;this._numRequests=0;this.features=[];var I={},A;for(var E=0,H=D.length;E<H;E++){var F=D[E];var G,K=false;A=OpenLayers.Util.isArray(F.url)?F.url[0]:F.url;if(A in I){I[A].push(F)}else{this._numRequests++;I[A]=[F]}}var D;for(var A in I){D=I[A];var J=this.buildWMSOptions(A,D,B,D[0].params.FORMAT);OpenLayers.Request.GET(J)}}},triggerGetFeatureInfo:function(B,C,A){this.events.triggerEvent("getfeatureinfo",{text:B.responseText,features:A,request:B,xy:C});OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},handleResponse:function(E,C,A){var D=C.responseXML;if(!D||!D.documentElement){D=C.responseText}var B=this.format.read(D);if(this.drillDown===false){this.triggerGetFeatureInfo(C,E,B)}else{this._requestCount++;if(this.output==="object"){this._features=(this._features||[]).concat({url:A,features:B})}else{this._features=(this._features||[]).concat(B)}if(this._requestCount===this._numRequests){this.triggerGetFeatureInfo(C,E,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(A,B){OpenLayers.Format.GML.prototype.initialize.apply(this,[A]);this.layer=B;if(this.layer.featureNS){this.featureNS=this.layer.featureNS}if(this.layer.options.geometry_column){this.geometryName=this.layer.options.geometry_column}if(this.layer.options.typename){this.featureName=this.layer.options.typename}},write:function(B){var C=this.createElementNS(this.wfsns,"wfs:Transaction");C.setAttribute("version","1.0.0");C.setAttribute("service","WFS");for(var A=0;A<B.length;A++){switch(B[A].state){case OpenLayers.State.INSERT:C.appendChild(this.insert(B[A]));break;case OpenLayers.State.UPDATE:C.appendChild(this.update(B[A]));break;case OpenLayers.State.DELETE:C.appendChild(this.remove(B[A]));break}}return OpenLayers.Format.XML.prototype.write.apply(this,[C])},createFeatureXML:function(F){var C=this.buildGeometryNode(F.geometry);var G=this.createElementNS(this.featureNS,"feature:"+this.geometryName);G.appendChild(C);var B=this.createElementNS(this.featureNS,"feature:"+this.featureName);B.appendChild(G);for(var A in F.attributes){var H=this.createTextNode(F.attributes[A]);var D=A;if(A.search(":")!=-1){D=A.split(":")[1]}var E=this.createElementNS(this.featureNS,"feature:"+D);E.appendChild(H);B.appendChild(E)}return B},insert:function(B){var A=this.createElementNS(this.wfsns,"wfs:Insert");A.appendChild(this.createFeatureXML(B));return A},update:function(J){if(!J.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"))}var F=this.createElementNS(this.wfsns,"wfs:Update");F.setAttribute("typeName",this.featurePrefix+":"+this.featureName);F.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var H=this.createElementNS(this.wfsns,"wfs:Property");var A=this.createElementNS(this.wfsns,"wfs:Name");var C=this.createTextNode(this.geometryName);A.appendChild(C);H.appendChild(A);var I=this.createElementNS(this.wfsns,"wfs:Value");var D=this.buildGeometryNode(J.geometry);if(J.layer){D.setAttribute("srsName",J.layer.projection.getCode())}I.appendChild(D);H.appendChild(I);F.appendChild(H);for(var E in J.attributes){H=this.createElementNS(this.wfsns,"wfs:Property");A=this.createElementNS(this.wfsns,"wfs:Name");A.appendChild(this.createTextNode(E));H.appendChild(A);I=this.createElementNS(this.wfsns,"wfs:Value");I.appendChild(this.createTextNode(J.attributes[E]));H.appendChild(I);F.appendChild(H)}var G=this.createElementNS(this.ogcns,"ogc:Filter");var B=this.createElementNS(this.ogcns,"ogc:FeatureId");B.setAttribute("fid",J.fid);G.appendChild(B);F.appendChild(G);return F},remove:function(B){if(!B.fid){OpenLayers.Console.userError(OpenLayers.i18n("noFID"));return false}var A=this.createElementNS(this.wfsns,"wfs:Delete");A.setAttribute("typeName",this.featurePrefix+":"+this.featureName);A.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var C=this.createElementNS(this.ogcns,"ogc:Filter");var D=this.createElementNS(this.ogcns,"ogc:FeatureId");D.setAttribute("fid",B.fid);C.appendChild(D);A.appendChild(C);return A},destroy:function(){this.layer=null},CLASS_NAME:"OpenLayers.Format.WFS"});OpenLayers.Control.UTFGrid=OpenLayers.Class(OpenLayers.Control,{autoActivate:true,layers:null,defaultHandlerOptions:{delay:300,pixelTolerance:4,stopMove:false,single:true,"double":false,stopSingle:false,stopDouble:false},handlerMode:"click",setHandler:function(A){this.handlerMode=A;this.resetHandler()},resetHandler:function(){if(this.handler){this.handler.deactivate();this.handler.destroy();this.handler=null}if(this.handlerMode=="hover"){this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.reset},this.handlerOptions)}else{if(this.handlerMode=="click"){this.handler=new OpenLayers.Handler.Click(this,{click:this.handleEvent},this.handlerOptions)}else{if(this.handlerMode=="move"){this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.handleEvent},this.handlerOptions)}}}if(this.handler){return true}else{return false}},initialize:function(A){A=A||{};A.handlerOptions=A.handlerOptions||this.defaultHandlerOptions;OpenLayers.Control.prototype.initialize.apply(this,[A]);this.resetHandler()},handleEvent:function(C){if(C==null){this.reset();return }var D=this.map.getLonLatFromPixel(C.xy);if(!D){return }var H=this.findLayers();if(H.length>0){var G={};var F,B;for(var E=0,A=H.length;E<A;E++){F=H[E];B=OpenLayers.Util.indexOf(this.map.layers,F);G[B]=F.getFeatureInfo(D)}this.callback(G,D,C.xy)}},callback:function(A){},reset:function(A){this.callback(null)},findLayers:function(){var C=this.layers||this.map.layers;var D=[];var B;for(var A=C.length-1;A>=0;--A){B=C[A];if(B instanceof OpenLayers.Layer.UTFGrid){D.push(B)}}return D},CLASS_NAME:"OpenLayers.Control.UTFGrid"});OpenLayers.Format.CQL=(function(){var J=["PROPERTY","COMPARISON","VALUE","LOGICAL"],E={PROPERTY:/^[_a-zA-Z]\w*/,COMPARISON:/^(=|<>|<=|<|>=|>|LIKE)/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('\w+'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/,RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(R){var P=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(R);if(P){var O=R.length;var N=R.indexOf("(",P[0].length);if(N>-1){var Q=1;while(N<O&&Q>0){N++;switch(R.charAt(N)){case"(":Q++;break;case")":Q--;break;default:}}}return[R.substr(0,N+1)]}},END:/^$/},I={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON","BETWEEN","COMMA"],BETWEEN:["VALUE"],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"]},G={"=":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},D={},M={AND:OpenLayers.Filter.Logical.AND,OR:OpenLayers.Filter.Logical.OR},B={},A={RPAREN:3,LOGICAL:2,COMPARISON:1};var H;for(H in G){if(G.hasOwnProperty(H)){D[G[H]]=H}}for(H in M){if(M.hasOwnProperty(H)){B[M[H]]=H}}function C(O,N){if(N instanceof RegExp){return N.exec(O)}else{return N(O)}}function F(W,U){var P,O,T=U.length;for(P=0;P<T;P++){O=U[P];var S=E[O];var Q=C(W,S);if(Q){var R=Q[0];var V=W.substr(R.length).replace(/^\s*/,"");return{type:O,text:R,remainder:V}}}var N="ERROR: In parsing: ["+W+"], expected one of: ";for(P=0;P<T;P++){O=U[P];N+="\n    "+O+": "+E[O]}throw new Error(N)}function L(Q){var O=[];var N,P=["NOT","GEOMETRY","SPATIAL","PROPERTY","LPAREN"];do{N=F(Q,P);Q=N.remainder;P=I[N.type];if(N.type!="END"&&!P){throw new Error("No follows list for "+N.type)}O.push(N)}while(N.type!="END");return O}function K(S){var R=[],T=[];while(S.length){var U=S.shift();switch(U.type){case"PROPERTY":case"GEOMETRY":case"VALUE":T.push(U);break;case"COMPARISON":case"BETWEEN":case"LOGICAL":var N=A[U.type];while(R.length>0&&(A[R[R.length-1].type]<=N)){T.push(R.pop())}R.push(U);break;case"SPATIAL":case"NOT":case"LPAREN":R.push(U);break;case"RPAREN":while(R.length>0&&(R[R.length-1].type!="LPAREN")){T.push(R.pop())}R.pop();if(R.length>0&&R[R.length-1].type=="SPATIAL"){T.push(R.pop())}case"COMMA":case"END":break;default:throw new Error("Unknown token type "+U.type)}}while(R.length>0){T.push(R.pop())}function O(){var j=T.pop();switch(j.type){case"LOGICAL":var b=O(),Y=O();return new OpenLayers.Filter.Logical({filters:[Y,b],type:M[j.text.toUpperCase()]});case"NOT":var a=O();return new OpenLayers.Filter.Logical({filters:[a],type:OpenLayers.Filter.Logical.NOT});case"BETWEEN":var Z,e,h;T.pop();e=O();Z=O();h=O();return new OpenLayers.Filter.Comparison({property:h,lowerBoundary:Z,upperBoundary:e,type:OpenLayers.Filter.Comparison.BETWEEN});case"COMPARISON":var f=O(),h=O();return new OpenLayers.Filter.Comparison({property:h,value:f,type:G[j.text.toUpperCase()]});case"VALUE":if((/^'.*'$/).test(j.text)){return j.text.substr(1,j.text.length-2)}else{return Number(j.text)}case"SPATIAL":switch(j.text.toUpperCase()){case"BBOX":var c=O(),d=O(),g=O(),i=O(),X=O();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:X,value:OpenLayers.Bounds.fromArray([i,g,d,c])});case"INTERSECTS":var f=O(),h=O();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:h,value:f});case"WITHIN":var f=O(),h=O();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.WITHIN,property:h,value:f});case"CONTAINS":var f=O(),h=O();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.CONTAINS,property:h,value:f});case"DWITHIN":var W=O(),f=O(),h=O();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,value:f,property:h,distance:Number(W)})}case"GEOMETRY":return OpenLayers.Geometry.fromWKT(j.text);default:return j.text}}var V=O();if(T.length>0){var P="Remaining tokens after building AST: \n";for(var Q=T.length-1;Q>=0;Q--){P+=T[Q].type+": "+T[Q].text+"\n"}throw new Error(P)}return V}return OpenLayers.Class(OpenLayers.Format,{read:function(O){var N=K(L(O));if(this.keepData){this.data=N}return N},write:function(P){if(P instanceof OpenLayers.Geometry){return P.toString()}switch(P.CLASS_NAME){case"OpenLayers.Filter.Spatial":switch(P.type){case OpenLayers.Filter.Spatial.BBOX:return"BBOX("+P.property+","+P.value.toBBOX()+")";case OpenLayers.Filter.Spatial.DWITHIN:return"DWITHIN("+P.property+", "+this.write(P.value)+", "+P.distance+")";case OpenLayers.Filter.Spatial.WITHIN:return"WITHIN("+P.property+", "+this.write(P.value)+")";case OpenLayers.Filter.Spatial.INTERSECTS:return"INTERSECTS("+P.property+", "+this.write(P.value)+")";case OpenLayers.Filter.Spatial.CONTAINS:return"CONTAINS("+P.property+", "+this.write(P.value)+")";default:throw new Error("Unknown spatial filter type: "+P.type)}case"OpenLayers.Filter.Logical":if(P.type==OpenLayers.Filter.Logical.NOT){return"NOT ("+this.write(P.filters[0])+")"}else{var O="(";var Q=true;for(var N=0;N<P.filters.length;N++){if(Q){Q=false}else{O+=") "+B[P.type]+" ("}O+=this.write(P.filters[N])}return O+")"}case"OpenLayers.Filter.Comparison":if(P.type==OpenLayers.Filter.Comparison.BETWEEN){return P.property+" BETWEEN "+this.write(P.lowerBoundary)+" AND "+this.write(P.upperBoundary)}else{return P.property+" "+D[P.type]+" "+this.write(P.value)}case undefined:if(typeof P==="string"){return"'"+P+"'"}else{if(typeof P==="number"){return String(P)}}default:throw new Error("Can't encode: "+P.CLASS_NAME+" "+P)}},CLASS_NAME:"OpenLayers.Format.CQL"})})();OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{layer:null,source:null,sourceOptions:null,tolerance:null,edge:true,deferDelete:false,mutual:true,targetFilter:null,sourceFilter:null,handler:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,[A]);this.options=A||{};if(this.options.source){this.setSource(this.options.source)}},setSource:function(A){if(this.active){this.deactivate();if(this.handler){this.handler.destroy();delete this.handler}this.source=A;this.activate()}else{this.source=A}},activate:function(){var A=OpenLayers.Control.prototype.activate.call(this);if(A){if(!this.source){if(!this.handler){this.handler=new OpenLayers.Handler.Path(this,{done:function(B){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(B)})}},{layerOptions:this.sourceOptions})}this.handler.activate()}else{if(this.source.events){this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}}return A},deactivate:function(){var A=OpenLayers.Control.prototype.deactivate.call(this);if(A){if(this.source&&this.source.events){this.layer.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}return A},onSketchComplete:function(A){this.feature=null;return !this.considerSplit(A.feature)},afterFeatureModified:function(B){if(B.modified){var A=B.feature;if(typeof A.geometry.split==="function"){this.feature=B.feature;this.considerSplit(B.feature)}}},removeByGeometry:function(C,D){for(var B=0,A=C.length;B<A;++B){if(C[B].geometry===D){C.splice(B,1);break}}},isEligible:function(A){if(!A.geometry){return false}else{return(A.state!==OpenLayers.State.DELETE)&&(typeof A.geometry.split==="function")&&(this.feature!==A)&&(!this.targetFilter||this.targetFilter.evaluate(A.attributes))}},considerSplit:function(C){var H=false;var F=false;if(!this.sourceFilter||this.sourceFilter.evaluate(C.attributes)){var G=this.layer&&this.layer.features||[];var V,M,A;var J=[],U=[];var D=(this.layer===this.source)&&this.mutual;var B={edge:this.edge,tolerance:this.tolerance,mutual:D};var I=[C.geometry];var L,E;var O,N;for(var S=0,T=G.length;S<T;++S){L=G[S];if(this.isEligible(L)){E=[L.geometry];for(var R=0;R<I.length;++R){O=I[R];for(var P=0;P<E.length;++P){V=E[P];if(O.getBounds().intersectsBounds(V.getBounds())){M=O.split(V,B);if(M){A=this.events.triggerEvent("beforesplit",{source:C,target:L});if(A!==false){if(D){N=M[0];if(N.length>1){N.unshift(R,1);Array.prototype.splice.apply(I,N);R+=N.length-3}M=M[1]}if(M.length>1){M.unshift(P,1);Array.prototype.splice.apply(E,M);P+=M.length-3}}}}}}if(E&&E.length>1){this.geomsToFeatures(L,E);this.events.triggerEvent("split",{original:L,features:E});Array.prototype.push.apply(J,E);U.push(L);F=true}}}if(I&&I.length>1){this.geomsToFeatures(C,I);this.events.triggerEvent("split",{original:C,features:I});Array.prototype.push.apply(J,I);U.push(C);H=true}if(H||F){if(this.deferDelete){var K,Q=[];for(var S=0,T=U.length;S<T;++S){K=U[S];if(K.state===OpenLayers.State.INSERT){Q.push(K)}else{K.state=OpenLayers.State.DELETE;this.layer.drawFeature(K)}}this.layer.destroyFeatures(Q,{silent:true});for(var S=0,T=J.length;S<T;++S){J[S].state=OpenLayers.State.INSERT}}else{this.layer.destroyFeatures(U,{silent:true})}this.layer.addFeatures(J,{silent:true});this.events.triggerEvent("aftersplit",{source:C,features:J})}}return H},geomsToFeatures:function(C,D){var F=C.clone();delete F.geometry;var E;for(var B=0,A=D.length;B<A;++B){E=F.clone();E.geometry=D[B];E.state=OpenLayers.State.INSERT;D[B]=E}},destroy:function(){if(this.active){this.deactivate()}OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"});OpenLayers.Layer.WMTS=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,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(C){var F={url:true,layer:true,style:true,matrixSet:true};for(var G in F){if(!(G in C)){throw new Error("Missing property '"+G+"' in layer configuration.")}}C.params=OpenLayers.Util.upperCaseObject(C.params);var B=[C.name,C.url,C.params,C];OpenLayers.Layer.Grid.prototype.initialize.apply(this,B);if(!this.formatSuffix){this.formatSuffix=this.formatSuffixMap[this.format]||this.format.split("/").pop()}if(this.matrixIds){var A=this.matrixIds.length;if(A&&typeof this.matrixIds[0]==="string"){var E=this.matrixIds;this.matrixIds=new Array(A);for(var D=0;D<A;++D){this.matrixIds[D]={identifier:E[D]}}}}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.updateMatrixProperties()},updateMatrixProperties:function(){this.matrix=this.getMatrix();if(this.matrix){if(this.matrix.topLeftCorner){this.tileOrigin=this.matrix.topLeftCorner}if(this.matrix.tileWidth&&this.matrix.tileHeight){this.tileSize=new OpenLayers.Size(this.matrix.tileWidth,this.matrix.tileHeight)}if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.top)}if(!this.tileFullExtent){this.tileFullExtent=this.maxExtent}}},moveTo:function(B,A,C){if(A||!this.matrix){this.updateMatrixProperties()}return OpenLayers.Layer.Grid.prototype.moveTo.apply(this,arguments)},clone:function(A){if(A==null){A=new OpenLayers.Layer.WMTS(this.options)}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getIdentifier:function(){return this.getServerZoom()},getMatrix:function(){var B;if(!this.matrixIds||this.matrixIds.length===0){B={identifier:this.getIdentifier()}}else{if("scaleDenominator" in this.matrixIds[0]){var A=OpenLayers.METERS_PER_INCH*OpenLayers.INCHES_PER_UNIT[this.units]*this.getServerResolution()/0.00028;var E=Number.POSITIVE_INFINITY;var F;for(var C=0,D=this.matrixIds.length;C<D;++C){F=Math.abs(1-(this.matrixIds[C].scaleDenominator/A));if(F<E){E=F;B=this.matrixIds[C]}}}else{B=this.matrixIds[this.getIdentifier()]}}return B},getTileInfo:function(F){var B=this.getServerResolution();var D=(F.lon-this.tileOrigin.lon)/(B*this.tileSize.w);var C=(this.tileOrigin.lat-F.lat)/(B*this.tileSize.h);var A=Math.floor(D);var E=Math.floor(C);return{col:A,row:E,i:Math.floor((D-A)*this.tileSize.w),j:Math.floor((C-E)*this.tileSize.h)}},getURL:function(A){A=this.adjustBounds(A);var D="";if(!this.tileFullExtent||this.tileFullExtent.intersectsBounds(A)){var C=A.getCenterLonLat();var F=this.getTileInfo(C);var J=this.matrix.identifier;var B=this.dimensions,G;if(this.requestEncoding.toUpperCase()==="REST"){G=this.params;if(typeof this.url==="string"&&this.url.indexOf("{")!==-1){var K=this.url.replace(/\{/g,"${");var E={style:this.style,Style:this.style,TileMatrixSet:this.matrixSet,TileMatrix:this.matrix.identifier,TileRow:F.row,TileCol:F.col};if(B){var H,I;for(I=B.length-1;I>=0;--I){H=B[I];E[H]=G[H.toUpperCase()]}}D=OpenLayers.String.format(K,E)}else{var L=this.version+"/"+this.layer+"/"+this.style+"/";if(B){for(var I=0;I<B.length;I++){if(G[B[I]]){L=L+G[B[I]]+"/"}}}L=L+this.matrixSet+"/"+this.matrix.identifier+"/"+F.row+"/"+F.col+"."+this.formatSuffix;if(OpenLayers.Util.isArray(this.url)){D=this.selectUrl(L,this.url)}else{D=this.url}if(!D.match(/\/$/)){D=D+"/"}D=D+L}}else{if(this.requestEncoding.toUpperCase()==="KVP"){G={SERVICE:"WMTS",REQUEST:"GetTile",VERSION:this.version,LAYER:this.layer,STYLE:this.style,TILEMATRIXSET:this.matrixSet,TILEMATRIX:this.matrix.identifier,TILEROW:F.row,TILECOL:F.col,FORMAT:this.format};D=OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,[G])}}}return D},mergeNewParams:function(A){if(this.requestEncoding.toUpperCase()==="KVP"){return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,[OpenLayers.Util.upperCaseObject(A)])}},CLASS_NAME:"OpenLayers.Layer.WMTS"});OpenLayers.Protocol.SOS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol,{fois:null,formatOptions:null,initialize:function(A){OpenLayers.Protocol.prototype.initialize.apply(this,[A]);if(!A.format){this.format=new OpenLayers.Format.SOSGetFeatureOfInterest(this.formatOptions)}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy()}this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(B){B=OpenLayers.Util.extend({},B);OpenLayers.Util.applyDefaults(B,this.options||{});var A=new OpenLayers.Protocol.Response({requestType:"read"});var D=this.format;var C=OpenLayers.Format.XML.prototype.write.apply(D,[D.writeNode("sos:GetFeatureOfInterest",{fois:this.fois})]);A.priv=OpenLayers.Request.POST({url:B.url,callback:this.createCallback(this.handleRead,A,B),data:C});return A},handleRead:function(A,B){if(B.callback){var C=A.priv;if(C.status>=200&&C.status<300){A.features=this.parseFeatures(C);A.code=OpenLayers.Protocol.Response.SUCCESS}else{A.code=OpenLayers.Protocol.Response.FAILURE}B.callback.call(B.scope,A)}},parseFeatures:function(A){var B=A.responseXML;if(!B||!B.documentElement){B=A.responseText}if(!B||B.length<=0){return null}return this.format.read(B)},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(C,B,D,A){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments);this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||this.DEFAULT_FORMAT]},getURL:function(A){A=this.adjustBounds(A);var F=this.map.getResolution();var E=Math.round((this.map.getScale()*10000))/10000;var D=Math.round(A.left/F);var C=-Math.round(A.top/F);var I=Math.floor(D/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w;var H=Math.floor(C/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h;var G=["/",this.params.map,"/",E,"/",this.params.g.replace(/\s/g,"_"),"/def/t",H,"/l",I,"/t",C,"l",D,".",this.extension];var B=this.url;if(OpenLayers.Util.isArray(B)){B=this.selectUrl(G.join(""),B)}return B+G.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,format:"image/png",serverResolutions:null,initialize:function(C,B,D,A){this.layername=D;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[C,B,{},A]);this.extension=this.format.split("/")[1].toLowerCase();this.extension=(this.extension=="jpg")?"jpeg":this.extension},clone:function(A){if(A==null){A=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.getOptions())}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(B){var F=this.getServerResolution();var G=this.maxExtent;var K=this.tileSize;var A=Math.round((B.left-G.left)/(F*K.w));var J=Math.round((B.bottom-G.bottom)/(F*K.h));var H=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,F):this.map.getZoom();function E(O,N){O=String(O);var L=[];for(var M=0;M<N;++M){L.push("0")}return L.join("").substring(0,N-O.length)+O}var D=[this.layername,E(H,2),E(parseInt(A/1000000),3),E((parseInt(A/1000)%1000),3),E((parseInt(A)%1000),3),E(parseInt(J/1000000),3),E((parseInt(J/1000)%1000),3),E((parseInt(J)%1000),3)+"."+this.extension];var I=D.join("/");var C=this.url;if(OpenLayers.Util.isArray(C)){C=this.selectUrl(I,C)}C=(C.charAt(C.length-1)=="/")?C:C+"/";return C+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(A,B){B.srs[this.getChildValue(A)]=true}},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(A,B){B.vendorSpecific={tileSets:[]};this.readChildNodes(A,B.vendorSpecific)},TileSet:function(B,A){var C={srs:{},bbox:{},resolutions:[]};this.readChildNodes(B,C);A.tileSets.push(C)},Resolutions:function(D,E){var C=this.getChildValue(D).split(" ");for(var B=0,A=C.length;B<A;B++){if(C[B]!=""){E.resolutions.push(parseFloat(C[B]))}}},Width:function(A,B){B.width=parseInt(this.getChildValue(A))},Height:function(A,B){B.height=parseInt(this.getChildValue(A))},Layers:function(A,B){B.layers=this.getChildValue(A)},Styles:function(A,B){B.styles=this.getChildValue(A)}},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,{roundedCorner:false,roundedCornerColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[];if(this.roundedCorner){OpenLayers.Console.warn("roundedCorner option is deprecated")}},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(A){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});if(this.outsideViewport){this.events.attachToElement(this.div);this.events.register("buttonclick",this,this.onButtonClick)}else{this.map.events.register("buttonclick",this,this.onButtonClick)}},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl()}this.redraw();return this.div},onButtonClick:function(A){var B=A.buttonElement;if(B===this.minimizeDiv){this.minimizeControl()}else{if(B===this.maximizeDiv){this.maximizeControl()}else{if(B._layerSwitcher===this.id){if(B["for"]){B=document.getElementById(B["for"])}if(!B.disabled){if(B.type=="radio"){B.checked=true;this.map.setBaseLayer(this.map.getLayer(B._layer))}else{B.checked=!B.checked;this.updateMap()}}}}}},clearLayersArray:function(A){this[A+"LayersDiv"].innerHTML="";this[A+"Layers"]=[]},checkRedraw:function(){var E=false;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){E=true}else{for(var C=0,A=this.layerStates.length;C<A;C++){var D=this.layerStates[C];var B=this.map.layers[C];if((D.name!=B.name)||(D.inRange!=B.inRange)||(D.id!=B.id)||(D.visibility!=B.visibility)){E=true;break}}}return E},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var C=false;var K=false;var G=this.map.layers.length;this.layerStates=new Array(G);for(var E=0;E<G;E++){var F=this.map.layers[E];this.layerStates[E]={name:F.name,visibility:F.visibility,inRange:F.inRange,id:F.id}}var D=this.map.layers.slice();if(!this.ascending){D.reverse()}for(var E=0,G=D.length;E<G;E++){var F=D[E];var H=F.isBaseLayer;if(F.displayInLayerSwitcher){if(H){K=true}else{C=true}var J=(H)?(F==this.map.baseLayer):F.getVisibility();var I=document.createElement("input");I.id=this.id+"_input_"+F.name;I.name=(H)?this.id+"_baseLayers":F.name;I.type=(H)?"radio":"checkbox";I.value=F.name;I.checked=J;I.defaultChecked=J;I.className="olButton";I._layer=F.id;I._layerSwitcher=this.id;if(!H&&!F.inRange){I.disabled=true}var A=document.createElement("label");A["for"]=I.id;OpenLayers.Element.addClass(A,"labelSpan olButton");A._layer=F.id;A._layerSwitcher=this.id;if(!H&&!F.inRange){A.style.color="gray"}A.innerHTML=F.name;A.style.verticalAlign=(H)?"bottom":"baseline";var M=document.createElement("br");var L=(H)?this.baseLayers:this.dataLayers;L.push({layer:F,inputElem:I,labelSpan:A});var B=(H)?this.baseLayersDiv:this.dataLayersDiv;B.appendChild(I);B.appendChild(A);B.appendChild(M)}}this.dataLbl.style.display=(C)?"":"none";this.baseLbl.style.display=(K)?"":"none";return this.div},updateMap:function(){for(var B=0,A=this.baseLayers.length;B<A;B++){var C=this.baseLayers[B];if(C.inputElem.checked){this.map.setBaseLayer(C.layer,false)}}for(var B=0,A=this.dataLayers.length;B<A;B++){var C=this.dataLayers[B];C.layer.setVisibility(C.inputElem.checked)}},maximizeControl:function(A){this.div.style.width="";this.div.style.height="";this.showControls(false);if(A!=null){OpenLayers.Event.stop(A)}},minimizeControl:function(A){this.div.style.width="0px";this.div.style.height="0px";this.showControls(true);if(A!=null){OpenLayers.Event.stop(A)}},showControls:function(A){this.maximizeDiv.style.display=A?"":"none";this.minimizeDiv.style.display=A?"none":"";this.layersDiv.style.display=A?"none":""},loadContents:function(){this.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");if(this.ascending){this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv);this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv)}else{this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv);this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv)}this.div.appendChild(this.layersDiv);if(this.roundedCorner){OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.roundedCornerColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75)}var A=LMI.Urls.getImg("mapping/layer-switcher-maximize.png");this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,null,A,"absolute");OpenLayers.Element.addClass(this.maximizeDiv,"maximizeDiv olButton");this.maximizeDiv.style.display="none";this.div.appendChild(this.maximizeDiv);var A=LMI.Urls.getImg("mapping/layer-switcher-minimize.png");this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,null,A,"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,draw:function(){var A=OpenLayers.Tile.Image.prototype.shouldDraw.call(this);if(A){var B=this.layer.getURL(this.bounds);var E=this.useIFrame;this.useIFrame=this.maxGetUrlLength!==null&&!this.layer.async&&B.length>this.maxGetUrlLength;var D=E&&!this.useIFrame;var C=!E&&this.useIFrame;if(D||C){if(this.imgDiv&&this.imgDiv.parentNode===this.frame){this.frame.removeChild(this.imgDiv)}this.imgDiv=null;if(D){this.blankImageUrl=this._blankImageUrl;this.frame.removeChild(this.frame.firstChild)}else{this._blankImageUrl=this.blankImageUrl;this.blankImageUrl="about:blank"}}}return OpenLayers.Tile.Image.prototype.draw.apply(this,arguments)},getImage:function(){if(this.useIFrame===true){if(!this.frame.childNodes.length){var C=document.createElement("div"),B=C.style;B.position="absolute";B.width="100%";B.height="100%";B.zIndex=1;B.backgroundImage="url("+this._blankImageUrl+")";this.frame.appendChild(C)}var D=this.id+"_iFrame",A;if(parseFloat(navigator.appVersion.split("MSIE")[1])<9){A=document.createElement('<iframe name="'+D+'">');A.style.backgroundColor="#FFFFFF";A.style.filter="chroma(color=#FFFFFF)"}else{A=document.createElement("iframe");A.style.backgroundColor="transparent";A.name=D}A.scrolling="no";A.marginWidth="0px";A.marginHeight="0px";A.frameBorder="0";A.style.position="absolute";A.style.width="100%";A.style.height="100%";if(this.layer.opacity<1){OpenLayers.Util.modifyDOMElement(A,null,null,null,null,null,null,this.layer.opacity)}this.frame.appendChild(A);this.imgDiv=A;return A}else{return OpenLayers.Tile.Image.prototype.getImage.apply(this,arguments)}},createRequestForm:function(){var B=document.createElement("form");B.method="POST";var F=this.layer.params._OLSALT;F=(F?F+"_":"")+this.bounds.toBBOX();B.action=OpenLayers.Util.urlAppend(this.layer.url,F);B.target=this.id+"_iFrame";var C=this.layer.getImageSize(),E=OpenLayers.Util.getParameters(this.url),D;for(var A in E){D=document.createElement("input");D.type="hidden";D.name=A;D.value=E[A];B.appendChild(D)}return B},setImgSrc:function(A){if(this.useIFrame===true){if(A){var B=this.createRequestForm();this.frame.appendChild(B);B.submit();this.frame.removeChild(B)}else{if(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);if(this.useIFrame===true){this.imgDiv.style.opacity=1;this.frame.style.opacity=this.layer.opacity}},createBackBuffer:function(){var A;if(this.useIFrame===false){A=OpenLayers.Tile.Image.prototype.createBackBuffer.call(this)}return A}};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:false,read:function(A){if(typeof A=="string"){A=OpenLayers.Format.XML.prototype.read.apply(this,[A])}return this.parseFeatures(A)},write:function(C){var D;if(OpenLayers.Util.isArray(C)){D=this.createElementNSPlus("atom:feed");D.appendChild(this.createElementNSPlus("atom:title",{value:this.feedTitle}));for(var A=0,B=C.length;A<B;A++){D.appendChild(this.buildEntryNode(C[A]))}}else{D=this.buildEntryNode(C)}return OpenLayers.Format.XML.prototype.write.apply(this,[D])},buildContentNode:function(B){var A=this.createElementNSPlus("atom:content",{attributes:{type:B.type||null}});if(B.src){A.setAttribute("src",B.src)}else{if(B.type=="text"||B.type==null){A.appendChild(this.createTextNode(B.value))}else{if(B.type=="html"){if(typeof B.value!="string"){throw"HTML content must be in form of an escaped string"}A.appendChild(this.createTextNode(B.value))}else{if(B.type=="xhtml"){A.appendChild(B.value)}else{if(B.type=="xhtml"||B.type.match(/(\+|\/)xml$/)){A.appendChild(B.value)}else{A.appendChild(this.createTextNode(B.value))}}}}}return A},buildEntryNode:function(M){var C=M.attributes;var I=C.atom||{};var J=this.createElementNSPlus("atom:entry");if(I.authors){var H=OpenLayers.Util.isArray(I.authors)?I.authors:[I.authors];for(var D=0,L=H.length;D<L;D++){J.appendChild(this.buildPersonConstructNode("author",H[D]))}}if(I.categories){var E=OpenLayers.Util.isArray(I.categories)?I.categories:[I.categories];var A;for(var D=0,L=E.length;D<L;D++){A=E[D];J.appendChild(this.createElementNSPlus("atom:category",{attributes:{term:A.term,scheme:A.scheme||null,label:A.label||null}}))}}if(I.content){J.appendChild(this.buildContentNode(I.content))}if(I.contributors){var F=OpenLayers.Util.isArray(I.contributors)?I.contributors:[I.contributors];for(var D=0,L=F.length;D<L;D++){J.appendChild(this.buildPersonConstructNode("contributor",F[D]))}}if(M.fid){J.appendChild(this.createElementNSPlus("atom:id",{value:M.fid}))}if(I.links){var K=OpenLayers.Util.isArray(I.links)?I.links:[I.links];var G;for(var D=0,L=K.length;D<L;D++){G=K[D];J.appendChild(this.createElementNSPlus("atom:link",{attributes:{href:G.href,rel:G.rel||null,type:G.type||null,hreflang:G.hreflang||null,title:G.title||null,length:G.length||null}}))}}if(I.published){J.appendChild(this.createElementNSPlus("atom:published",{value:I.published}))}if(I.rights){J.appendChild(this.createElementNSPlus("atom:rights",{value:I.rights}))}if(I.summary||C.description){J.appendChild(this.createElementNSPlus("atom:summary",{value:I.summary||C.description}))}J.appendChild(this.createElementNSPlus("atom:title",{value:I.title||C.title||this.defaultEntryTitle}));if(I.updated){J.appendChild(this.createElementNSPlus("atom:updated",{value:I.updated}))}if(M.geometry){var B=this.createElementNSPlus("georss:where");B.appendChild(this.buildGeometryNode(M.geometry));J.appendChild(B)}return J},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(B){if(!this.gmlParser){this.initGmlParser()}var A=this.gmlParser.writeNode("feature:_geometry",B);return A.firstChild},buildPersonConstructNode:function(B,F){var D=["uri","email"];var A=this.createElementNSPlus("atom:"+B);A.appendChild(this.createElementNSPlus("atom:name",{value:F.name}));for(var C=0,E=D.length;C<E;C++){if(F[D[C]]){A.appendChild(this.createElementNSPlus("atom:"+D[C],{value:F[D[C]]}))}}return A},getFirstChildValue:function(D,B,C,F){var E;var A=this.getElementsByTagNameNS(D,B,C);if(A&&A.length>0){E=this.getChildValue(A[0],F)}else{E=F}return E},parseFeature:function(D){var K={};var L=null;var A=null;var I=null;var B=this.namespaces.atom;this.parsePersonConstructs(D,"author",K);A=this.getElementsByTagNameNS(D,B,"category");if(A.length>0){K.categories=[]}for(var G=0,M=A.length;G<M;G++){L={};L.term=A[G].getAttribute("term");I=A[G].getAttribute("scheme");if(I){L.scheme=I}I=A[G].getAttribute("label");if(I){L.label=I}K.categories.push(L)}A=this.getElementsByTagNameNS(D,B,"content");if(A.length>0){L={};I=A[0].getAttribute("type");if(I){L.type=I}I=A[0].getAttribute("src");if(I){L.src=I}else{if(L.type=="text"||L.type=="html"||L.type==null){L.value=this.getFirstChildValue(D,B,"content",null)}else{if(L.type=="xhtml"||L.type.match(/(\+|\/)xml$/)){L.value=this.getChildEl(A[0])}else{L.value=this.getFirstChildValue(D,B,"content",null)}}K.content=L}}this.parsePersonConstructs(D,"contributor",K);K.id=this.getFirstChildValue(D,B,"id",null);A=this.getElementsByTagNameNS(D,B,"link");if(A.length>0){K.links=new Array(A.length)}var C=["rel","type","hreflang","title","length"];for(var G=0,M=A.length;G<M;G++){L={};L.href=A[G].getAttribute("href");for(var E=0,H=C.length;E<H;E++){I=A[G].getAttribute(C[E]);if(I){L[C[E]]=I}}K.links[G]=L}L=this.getFirstChildValue(D,B,"published",null);if(L){K.published=L}L=this.getFirstChildValue(D,B,"rights",null);if(L){K.rights=L}L=this.getFirstChildValue(D,B,"summary",null);if(L){K.summary=L}K.title=this.getFirstChildValue(D,B,"title",null);K.updated=this.getFirstChildValue(D,B,"updated",null);var F={title:K.title,description:K.summary,atom:K};var J=this.parseLocations(D)[0];var N=new OpenLayers.Feature.Vector(J,F);N.fid=K.id;return N},parseFeatures:function(E){var D=[];var A=this.getElementsByTagNameNS(E,this.namespaces.atom,"entry");if(A.length==0){A=[E]}for(var B=0,C=A.length;B<C;B++){D.push(this.parseFeature(A[B]))}return D},parseLocations:function(C){var A=this.namespaces.georss;var I={components:[]};var F=this.getElementsByTagNameNS(C,A,"where");if(F&&F.length>0){if(!this.gmlParser){this.initGmlParser()}for(var E=0,N=F.length;E<N;E++){this.gmlParser.readChildNodes(F[E],I)}}var H=I.components;var L=this.getElementsByTagNameNS(C,A,"point");if(L&&L.length>0){for(var E=0,N=L.length;E<N;E++){var P=OpenLayers.String.trim(L[E].firstChild.nodeValue).split(/\s+/);if(P.length!=2){P=OpenLayers.String.trim(L[E].firstChild.nodeValue).split(/\s*,\s*/)}H.push(new OpenLayers.Geometry.Point(P[1],P[0]))}}var O=this.getElementsByTagNameNS(C,A,"line");if(O&&O.length>0){var K;var B;var M;for(var E=0,N=O.length;E<N;E++){K=OpenLayers.String.trim(O[E].firstChild.nodeValue).split(/\s+/);M=[];for(var D=0,G=K.length;D<G;D+=2){B=new OpenLayers.Geometry.Point(K[D+1],K[D]);M.push(B)}H.push(new OpenLayers.Geometry.LineString(M))}}var J=this.getElementsByTagNameNS(C,A,"polygon");if(J&&J.length>0){var K;var B;var M;for(var E=0,N=J.length;E<N;E++){K=OpenLayers.String.trim(J[E].firstChild.nodeValue).split(/\s+/);M=[];for(var D=0,G=K.length;D<G;D+=2){B=new OpenLayers.Geometry.Point(K[D+1],K[D]);M.push(B)}H.push(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(H)]))}}if(this.internalProjection&&this.externalProjection){for(var E=0,N=H.length;E<N;E++){if(H[E]){H[E].transform(this.externalProjection,this.internalProjection)}}}return H},parsePersonConstructs:function(D,A,G){var K=[];var C=this.namespaces.atom;var B=this.getElementsByTagNameNS(D,C,A);var E=["uri","email"];for(var H=0,M=B.length;H<M;H++){var L={};L.name=this.getFirstChildValue(B[H],C,"name",null);for(var F=0,I=E.length;F<I;F++){var J=this.getFirstChildValue(B[H],C,E[F],null);if(J){L[E[F]]=J}}K.push(L)}if(K.length>0){G[A+"s"]=K}},CLASS_NAME:"OpenLayers.Format.Atom"});OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{autoActivate:true,slideFactor:75,observeElement:null,draw:function(){var A=this.observeElement||document;this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress},{observeElement:A})},defaultKeyPress:function(A){var B,C=true;switch(A.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:B=this.map.getSize();this.map.pan(0,-0.75*B.h);break;case 34:B=this.map.getSize();this.map.pan(0,0.75*B.h);break;case 35:B=this.map.getSize();this.map.pan(0.75*B.w,0);break;case 36:B=this.map.getSize();this.map.pan(-0.75*B.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut();break;default:C=false}if(C){OpenLayers.Event.stop(A)}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});function DSMapObject_Iterator(A,B){this.coll=A;this.pos=(B?B:0)}function DSMapObject_HasNext(){if(this.coll&&(this.pos+1)<=this.coll.order.length){return true}this.pos=0;return false}function DSMapObject_Next(){return(this.coll.objects[this.coll.order[this.pos++]])}function DSMapObject_GetId(){return this.coll.order[this.pos-1]}function DSMapObject_SetIteratorOffset(A){this.pos=A}function DSMapObject_GetIteratorOffset(){return this.pos}function DSMapObject_Add(A){this.objects[this.currIdx]=A;this.order.push(this.currIdx);return this.currIdx++}function DSMapObject_Remove(C){var B,A;if(this.objects[C]){delete this.objects[C];for(B=0,A=this.order.length;B<A;++B){if(this.order[B]===C){this.order.splice(B,1)}}return true}return false}function DSMapObject_RemoveAll(){this.objects={};this.order=[];this.currPos=this.currIdx=0}function DSMapObject_GetByIndex(A){return this.objects[this.order[A]]}function DSMapObject_GetById(A){return this.objects[A]?this.objects[A]:null}function DSMapObject_Size(){return this.order.length}function DSMapObject_GetByProperty(A,C){for(var B=0;B<this.order.length;++B){if(this.objects[this.order[B]].getProperty(A)===C){return this.objects[this.order[B]]}}return null}function DSMapObject_GetIdsByProperty(A,D){var B,C=[];for(B=0;B<this.order.length;++B){if(this.objects[this.order[B]].getProperty(A)===D){C.push(this.order[B])}}return C}function DSMapObject_Collection(){this.objects={};this.order=[];this.currPos=this.currIdx=0}DSMapObject_Collection.prototype.add=DSMapObject_Add;DSMapObject_Collection.prototype.remove=DSMapObject_Remove;DSMapObject_Collection.prototype.getById=DSMapObject_GetById;DSMapObject_Collection.prototype.getByIndex=DSMapObject_GetByIndex;DSMapObject_Collection.prototype.size=DSMapObject_Size;DSMapObject_Collection.prototype.getByProperty=DSMapObject_GetByProperty;DSMapObject_Collection.prototype.getIdsByProperty=DSMapObject_GetIdsByProperty;DSMapObject_Collection.prototype.removeAll=DSMapObject_RemoveAll;DSMapObject_Iterator.prototype.next=DSMapObject_Next;DSMapObject_Iterator.prototype.getId=DSMapObject_GetId;DSMapObject_Iterator.prototype.hasNext=DSMapObject_HasNext;DSMapObject_Iterator.prototype.setOffset=DSMapObject_SetIteratorOffset;DSMapObject_Iterator.prototype.getOffset=DSMapObject_GetIteratorOffset;LMI.Mapping={};LMI.Mapping.Point=(function(){function A(C,B){this.init(C,B)}YAHOO.lang.extend(A,OpenLayers.LonLat,{init:function(C,B){this.lng=B;A.superclass.initialize.call(this,B,C)},add:function(){var B=A.superclass.add.apply(this,arguments);this.lng=this.lon;return B},transform:function(){A.superclass.transform.apply(this,arguments);this.lng=this.lon}});return A})();LMI.Mapping.Map=(function(){var F=YAHOO.util,B=F.Dom,E=LMI.Lang.forEach,G=LMI.Element,D=G.getOne,A=G.getAll;function C(H,I){this.init(H,I)}YAHOO.lang.extend(C,OpenLayers.Map,{init:function(H,J){var I=D(H);if(!I){throw new Error('Map: unable to find container: "'+H+'"')}B.addClass(I,"dsMap");this.initOptions(J);OpenLayers.ImgPath=this.getOption("imageBase");this.locale=this.getOption("defaultLocale");C.superclass.initialize.call(this,YAHOO.lang.merge(this.getBaseLayerMapOptions(),{div:I,controls:[],theme:null,paddingForPopups:this.getOption("paddingForPopups")}));this.viewport=this.viewPortDiv;this.objects=new DSMapObject_Collection();this.addLayer(this.getBaseLayer());this.markersLayer=new OpenLayers.Layer.Markers("Markers");this.markersLayer.displayInLayerSwitcher=false;this.addLayer(this.markersLayer);if(this.getOption("enableScales")){this.addControl(new OpenLayers.Control.ScaleLine())}if(this.getOption("printable")){this.initPrintability()}this.initEvents("zoom","recenter","resize");this.events.register("zoomend",this,function(){this.triggerEvent("zoom",this.getEventObject(),this)});this.events.register("moveend",this,function(){this.triggerEvent("recenter",this.getEventObject(),this)})},getCenterPoint:function(){var H=this.getCenter();if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){H.transform(this.getProjectionObject(),this.displayProjection)}return new LMI.Mapping.Point(H.lat,H.lon)},centerAndZoom:function(H,I){if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){H.transform(this.displayProjection,this.getProjectionObject())}this.setCenter(H,I)},getEventObject:function(){var H={};H.zoomLevel=this.getZoom();H.center=this.getCenter();return H},bestFit:function(H,O){var J=[],K,N,M,I,L;O=O||this.objects;I=new DSMapObject_Iterator(O);while(I.hasNext()){N=I.next();if(!N.isIncludedInBestFit()){continue}M=N.getBoundingBox();if(M){J.push(M.lower,M.upper)}else{if(N.lonlat){J.push(N.lonlat)}}}if(J.length===0){if(this.getOption("defaultLat")&&this.getOption("defaultLng")&&this.getOption("emptyZoom")){L=new OpenLayers.LonLat(this.getOption("defaultLng"),this.getOption("defaultLat"));if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){L.transform(this.displayProjection,this.getProjectionObject())}this.setCenter(L,this.getOption("emptyZoom"))}}else{if(J.length===1){K=N.getProperty("zoomLevel");if(!K){K=this.getOption("singleZoom")}this.setCenter(J[0],K)}else{M=this.markersLayer.getDataExtent().scale(1.1);K=this.getZoomForExtent(M);if(K>this.getOption("closestZoomForBestFit")){K=this.getOption("closestZoomForBestFit")}this.setCenter(M.getCenterLonLat(),K)}}},initOptions:function(H){this.options=LMI.Lang.mergeObjects({},C.Defaults);if("config" in C){LMI.Lang.mergeObjects(this.options,C.config)}LMI.Lang.mergeObjects(this.options,H)},setLocale:function(H){this.locale=H},setOption:function(H,I){this.options[H]=I},getOption:function(H){return this.options[H]||""},getPointByXY:function(I,J){var H=this.getLonLatFromPixel(new OpenLayers.Pixel(I,J));if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){H.transform(this.getProjectionObject(),this.displayProjection)}return H},addObject:function(I){var J=this.objects.add(I),H=I.point.clone();if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){I.lonlat=H.transform(this.displayProjection,this.getProjectionObject())}this.markersLayer.addMarker(I);I.add(this);return J},batchAddObjects:function(J){var I,H;this.removeLayer(this.markersLayer,false);for(I=0,H=J.length;I<H;++I){this.addObject(J[I])}this.addLayer(this.markersLayer)},removeObject:function(K){var L=-1,I,H,J;if(typeof K==="object"){I=new DSMapObject_Iterator(this.objects);while(I.hasNext()){H=I.next();if(H===K){L=I.getId();break}}}else{L=K}J=this.objects.getById(L);if(J){J.remove(this);this.markersLayer.removeMarker(J);this.objects.remove(L)}},batchRemoveObjects:function(J){var I,H;this.removeLayer(this.markersLayer,false);for(I=0,H=J.length;I<H;++I){this.removeObject(J[I])}this.addLayer(this.markersLayer)},getZoomLevel:function(){return this.getZoom()},setZoomLevel:function(H){this.zoomTo(H)},getBaseLayer:function(){return null},getBaseLayerMapOptions:function(){return null},getExtentInGeoCoords:function(){var I=this.getExtent(),H=I.toArray(),J=new OpenLayers.LonLat(H[0],H[1]),K=new OpenLayers.LonLat(H[2],H[3]);if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){J.transform(this.getProjectionObject(),this.displayProjection);K.transform(this.getProjectionObject(),this.displayProjection)}return new OpenLayers.Bounds(J.lon,J.lat,K.lon,K.lat)},initPrintability:function(){var J=G.create("canvas"),P=this.viewPortDiv,O=this,H,Q,K,I,N,L,R=1,S,M;if(!!J.getContext){B.addClass(this.div,"dsPrintableMap");H=B.generateId(J);G.create("style",D("head"),{type:"text/css",text:"#"+H+" {display:none;position:relative;}@media print { #"+H+" { display: block; } }"});J.id=H;J.className="dsMapComposite";P.appendChild(J);Q=J.getContext("2d");M=function(T){return !T.mapObject?T.div:T.mapObject.getDiv()};S=function(W){var T=0,X=0,V,U;if(W.mapObject&&!YAHOO.env.ua.gecko){V=W.mapObject.getDiv().childNodes[0].childNodes[0].childNodes[0];if(YAHOO.env.ua.webkit){U=B.getStyle(V,"-webkit-transform").match(/(-)?(\d)+/g)}else{if(YAHOO.env.ua.ie&&YAHOO.env.ua.ie>=9){U=V.style.msTransform.match(/(-)?(\d)+/g)}}T=parseInt(U[4],10);X=parseInt(U[5],10)}return{offsetX:T,offsetY:X}};K=function(){I=P.offsetWidth;R=1;if(I>630){R=630/I;I=630}J.width=I;J.height=Math.round(P.offsetHeight*R);J.style.zIndex=parseInt(O.layerContainerDiv.style.zIndex,10)+1;E(O.layers,function(T){if(T.getVisibility()){var U=S(T);N=U.offsetX;L=U.offsetY;E(A("img,canvas",M(T)),function(V){var W=V,Y=0,X=0;if(!B.hasClass(V.parentNode,"screenOnly")){while(W&&W!==P){Y+=W.offsetLeft;X+=W.offsetTop;W=W.offsetParent}Q.drawImage(V,Math.floor((Y+N)*R),Math.floor((X+L)*R),Math.floor(R*V.offsetWidth),Math.floor(R*V.offsetHeight))}})}})};setInterval(K,2000)}},getLLPoint:function(){var H=this.getExtent().toArray(),I=new LMI.Mapping.Point(H[1],H[0]);if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){I.transform(this.getProjectionObject(),this.displayProjection)}return I},getURPoint:function(){var H=this.getExtent().toArray(),I=new LMI.Mapping.Point(H[3],H[2]);if(this.displayProjection&&this.displayProjection.getCode()!==this.getProjectionObject().getCode()){I.transform(this.getProjectionObject(),this.displayProjection)}return I}});LMI.Lang.importFunctions(C,LMI.Event);return C})();LMI.Mapping.Map.Defaults={singleZoom:14,emptyZoom:5,closestZoomForBestFit:15,defaultLat:39.73926,defaultLng:-104.98478,defaultLocale:"",printable:false,enableScales:true,imageBase:"img/",pixelUrl:"img/pixel_trans.gif",paddingForPopups:new OpenLayers.Bounds(100,10,275,95)};OpenLayers.Util.getImagesLocation=function(){return""};(function(){var A=LMI.Mapping.Map.prototype,B=LMI.Strings.getString;A.getBaseLayer=function(){return new OpenLayers.Layer.Google(B("js.map.control.map"),{numZoomLevels:20,sphericalMercator:true,isBaseLayer:true})};A.getBaseLayerMapOptions=function(){return{projection:new OpenLayers.Projection("EPSG:900913"),displayProjection:new OpenLayers.Projection("EPSG:4326"),units:"m",maxResolution:156543.0339,maxExtent:new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)}}})();(function(){var C=OpenLayers.Layer.Google,B=C.prototype,A=B.loadMapObject;B.loadMapObject=function(){A.call(this);var D=this.termsOfUse,E=document.createElement("div");D.parentNode.insertBefore(E,D);E.appendChild(D);this.termsOfUse=E}})();LMI.Mapping.MapObject=(function(){function A(B,C){this.init(B,C)}YAHOO.lang.extend(A,OpenLayers.Marker,{init:function(B,C){this.setPoint(B);this.properties={};this.setIncludedInBestFit(true);A.superclass.initialize.call(this,B,C);this.element=C.imageDiv;this.initEvents("click","mouseout","mouseover","add","remove")},setPoint:function(B){this.point=B},getPoint:function(){return this.point},getBoundingBox:function(){if("boundingBox" in this){return this.boundingBox}return null},setXOffset:function(B){this.xOffset=B},getXOffset:function(){if("xOffset" in this){return this.xOffset}return 0},setYOffset:function(B){this.yOffset=B},getYOffset:function(){if("yOffset" in this){return this.yOffset}return 0},setZOffset:function(B){this.zOffset=B},getZOffset:function(){if("zOffset" in this){return this.zOffset}return 0},setProperty:function(B,C){this.properties[B]=C},setProperties:function(){var B,C;if(typeof arguments[0]==="object"){C=arguments[0];for(B in C){if(C.hasOwnProperty(B)){this.setProperty(B,C[B])}}}else{C=arguments.length;for(B=0;B<C;++B){this.properties[arguments[B]]=arguments[++B]}}return this},getProperty:function(B){return(B&&B in this.properties?this.properties[B]:"")},setIncludedInBestFit:function(B){this.includedInBestFit=!!B},isIncludedInBestFit:function(){return this.includedInBestFit},setZIndex:function(B){this.icon.imageDiv.style.zIndex=B},add:function(B){this.shownOnMap=true;this.map=B;this.triggerEvent("add",{map:B},this)},update:function(B){},remove:function(B){this.triggerEvent("remove",{map:B},this);this.shownOnMap=false;this.map=null}});LMI.Lang.importFunctions(A,LMI.Event);A.prototype._addEventListener=A.prototype.addEventListener;A.prototype.addEventListener=function(B,D){var C;if(B==="click"||B==="mouseout"||B==="mouseover"){if(B==="click"){YAHOO.util.Dom.setStyle(this.icon.imageDiv,"cursor","pointer")}if(this.getListeners(B).length===0){C=this;YAHOO.util.Event.on(this.icon.imageDiv,B,function(E){C.triggerEvent(B,E,C)})}}return this._addEventListener(B,D)};A.prototype.bindEvent=function(C,F,D,B){var E=function(G,H){D.call(F,G,H,B)};return this.addEventListener(C,E)};return A})();LMI.Mapping.Icon=(function(){function A(B,C){this.init(B,C)}YAHOO.lang.extend(A,LMI.Mapping.MapObject,{init:function(B,E){this.option=E;var C=new OpenLayers.Size(this.getWidth(),this.getHeight()),D=new OpenLayers.Icon(this.getRecommendedIconSrc(),C,null,this.calculateOffset);A.superclass.init.call(this,B,D)},calculateOffset:function(B){return new OpenLayers.Pixel(-B.w,-B.h)},getWidth:function(){return 24},getHeight:function(){return 27},getRecommendedIconSrc:function(){return LMI.Mapping.IconUrls["default"]}});return A})();(function(){var A=LMI.Mapping.Icon.prototype;A.calculateOffset=function(B){return new OpenLayers.Pixel(-12,-31)};A.getWidth=function(){if(LMI.Data.site==="rca"){return 41}return 36};A.getHeight=function(){if(LMI.Data.site==="rca"){return 30}return 31}})();LMI.Mapping.DSIcon=(function(){var B=LMI.Element;function A(D,C){this.init(D,C)}YAHOO.lang.extend(A,LMI.Mapping.Icon,{init:function(E,C){var D=new LMI.Mapping.Point(E.latitude,E.longitude);this.option=C;this.createLabelElement();A.superclass.init.call(this,D,C);if(E){this.setListing(E)}},setListing:function(D){var C=this;LMI.Lang.forEach(["name","streetAddress"],function(E){if(E in D){C.setProperty(E,D[E])}})},getRecommendedIconSrc:function(){return LMI.Urls.getImg(LMI.Data.Urls.defaultIcon)},update:function(){A.superclass.update.apply(this,arguments);if(this.labelElement){this.labelElement.style.left=this.element.style.left;this.labelElement.style.top=this.element.style.top;this.labelElement.style.zIndex=this.element.style.zIndex}},createLabelElement:function(){if(!this.labelElement&&this.option){this.labelElement=LMI.Element.create("div",null,{text:this.option,className:"DSIconLabel"})}},add:function(){A.superclass.add.apply(this,arguments);if(this.labelElement){this.element.appendChild(this.labelElement)}},remove:function(){A.superclass.remove.apply(this,arguments);if(this.labelElement){this.element.removeChild(this.labelElement)}}});return A})();LMI.Mapping.CenterIcon=(function(){function A(C,D){var B=new LMI.Mapping.Point(C.latitude,C.longitude);this.init(B,D)}YAHOO.lang.extend(A,LMI.Mapping.Icon,{getRecommendedIconSrc:function(){return this.option?LMI.Urls.getImg("mapping/map_node_faded_star.png"):LMI.Urls.getImg("mapping/map_node_red_star.png")}});return A})();(function(){var A=LMI.Mapping.CenterIcon.prototype;A.getRecommendedIconSrc=function(){return LMI.Mapping.IconUrls.center}})();LMI.Mapping.InteractiveMap=(function(){var D=YAHOO.util,A=D.Event,B=D.Dom,E=LMI.Strings.getString;function C(F,G){this.init(F,G)}C.Defaults={enableOverview:true,enableResize:true,overviewWidth:150,overviewHeight:150,popupLayerZindex:1100,zoomWheelEnabled:true};YAHOO.lang.extend(C,LMI.Mapping.Map,{init:function(){var G=YAHOO.env.ua.ie,F,H;C.superclass.init.apply(this,arguments);LMI.Data.map=this;this.initTouchEvents();this.animationDuration=1;this.sliders=[];if(this.getOption("enableResize")){if(G&&G<7){this.div.style.overflow="hidden"}A.on(window,"resize",this.resizeLayers,this,true)}if(this.getOption("enableOverview")){F=new OpenLayers.Control.OverviewMap({mapOptions:this.getBaseLayerMapOptions(),layers:[this.getBaseLayer()],autoPan:true,size:new OpenLayers.Size(110,110)});this.addControl(F);F.maximizeControl()}this.previewing=false;this.previewAnimation=null;this.Z_INDEX_BASE.PopupLayer=this.getOption("popupLayerZindex");H=this.div.id+"_OpenLayers_Popup_Container";this.popupContainerDiv=OpenLayers.Util.createDiv(H);this.popupContainerDiv.style.zIndex=this.Z_INDEX_BASE.PopupLayer-1;this.viewPortDiv.appendChild(this.popupContainerDiv);this.events.register("move",this,function(){this.popupContainerDiv.style.left=this.layerContainerDiv.style.left;this.popupContainerDiv.style.top=this.layerContainerDiv.style.top})},initOptions:function(F){var G=LMI.Lang.mergeObjects({},C.Defaults);LMI.Lang.mergeObjects(G,F);C.superclass.initOptions.call(this,G)},resizeLayers:function(){var F={oldWidth:this.getSize().w,oldHeight:this.getSize().h,zoomLevel:this.getZoomLevel()};this.updateSize();if(F.oldWidth!==this.getSize().w||F.oldHeight!==this.getSize().h){F.center=this.getCenter();F.newWidth=this.getSize().w;F.newHeight=this.getSize().h;this.triggerEvent("resize",F,this)}},addControls:function(G){if(!G){G=LMI.Mapping.DefaultControls({zoomWheelEnabled:this.getOption("zoomWheelEnabled")})}if(YAHOO.lang.isArray(G)){var F=this;LMI.Lang.forEach(G,function(H){F.addControls(H)})}else{C.superclass.addControl.apply(this,arguments)}},addPopup:function(F,I){var G,H;if(I){for(G=this.popups.length-1;G>=0;--G){this.removePopup(this.popups[G])}}F.map=this;this.popups.push(F);H=F.draw();if(H){H.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.popupContainerDiv.appendChild(H)}},removePopup:function(F){OpenLayers.Util.removeItem(this.popups,F);if(F.div){try{this.popupContainerDiv.removeChild(F.div)}catch(G){}}F.map=null},touchStart:function(J){var I=[],G,L,H=A.getTarget(J),F,K;this.touchMoves=0;this.startTouches=null;if(H.tagName.toLowerCase()!=="a"){F=B.getAncestorByTagName(F,"a")}else{F=H}if(!F){if(H.tagName.toLowerCase()!=="div"){K=B.getAncestorByTagName(H,"div")}else{K=H}if(!K||(K.id.match(/^OL_Icon/)===null&&K.id.match(/^OpenLayers.Control/)===null&&!B.hasClass(K,"widgetWrapper")&&!B.hasClass(K,"popup")&&!B.getAncestorByClassName(K,"olPopup"))){if(J.touches.length>0){L=J.touches[0];I.push({pageX:L.pageX,pageY:L.pageY})}if(J.touches.length>1){L=J.touches[1];I.push({pageX:L.pageX,pageY:L.pageY})}this.startTouches={touches:I,time:(new Date()).getTime()};A.stopEvent(J)}}},touchMove:function(F){if(this.startTouches!==null&&F.touches.length===1){this.pan((this.startTouches.touches[0].pageX-F.touches[0].pageX),(this.startTouches.touches[0].pageY-F.touches[0].pageY),{animate:false})}this.touchMoves++;this.previousMoveTouches={touches:F.touches,time:(new Date()).getTime()};A.stopEvent(F)},touchEnd:function(H){if(this.startTouches!==null){if(this.previousPanStart!==null&&Math.abs(this.startTouches.touches[0].pageX-this.previousPanStart.touches[0].pageX)<30&&Math.abs(this.startTouches.touches[0].pageY-this.previousPanStart.touches[0].pageY)<30&&this.startTouches.time-this.previousPanStart.time<500&&this.touchMoves===0){this.zoomIn()}else{if(this.previousMoveTouches!==null&&this.previousMoveTouches.touches.length===2){var G=this.startTouches.touches,F=this.previousMoveTouches.touches;if(Math.abs(G[0].pageX-G[1].pageX)<Math.abs(F[0].pageX-F[1].pageX)||Math.abs(G[0].pageY-G[1].pageY)<Math.abs(F[0].pageY-F[1].pageY)){this.zoomIn()}else{if(Math.abs(G[0].pageX-G[1].pageX)>Math.abs(F[0].pageX-F[1].pageX)||Math.abs(G[0].pageY-G[1].pageY)>Math.abs(F[0].pageY-F[1].pageY)){this.zoomOut()}}}}}this.previousPanStart=this.startTouches;this.startTouches=null;this.previousMoveTouches=null;A.stopEvent(H)},initTouchEvents:function(){this.startTouches=null;this.previousPanStart=null;this.touchMoves=0;this.previousMoveTouches=null;A.on(this.div,"touchstart",this.touchStart,this,true);A.on(this.div,"touchmove",this.touchMove,this,true);A.on(this.div,"touchend",this.touchEnd,this,true)}});return C})();LMI.Mapping.DSMap=(function(){var B=LMI.Strings.getString,A=function(D,C){this.init(D,C)};A.Defaults={overviewWidth:110,overviewHeight:110,contextMenuItems:LMI.Lang.mergeObjects([],LMI.Mapping.InteractiveMap.Defaults.contextMenuItems)};A.contextAddLocation=function(C,E,D){LMI.Mapping.NewLocPoi.createFromPageXY(D,D.contextMenuOpenX,D.contextMenuOpenY)};A.Defaults.contextMenuItems.push({text:B("js.map.contextmenu.add.custom.loc"),className:"map_cm_addLocation",onclick:{fn:A.contextAddLocation}});YAHOO.lang.extend(A,LMI.Mapping.InteractiveMap,{initOptions:function(C){var D,E=A.Defaults;if(C){for(D in C){if(C.hasOwnProperty(D)){E[D]=C[D]}}}A.superclass.initOptions.call(this,E)},addControls:function(C){C=C||LMI.Mapping.DefaultControls({zoomWheelEnabled:this.getOption("zoomWheelEnabled")});A.superclass.addControls.call(this,C);if(this.overviewMap){this.overviewMap.addEventListener("expand",function(){LMI.MyList.setVisitorPreference(null,"overview_map_collapsed",false)});this.overviewMap.addEventListener("collapse",function(){LMI.MyList.setVisitorPreference(null,"overview_map_collapsed",true)})}}});return A})();LMI.Mapping.PanZoomBar=(function(){function A(B,C){this.initialize.apply(this,arguments)}YAHOO.lang.extend(A,OpenLayers.Control.PanZoomBar,{initialize:function(C,B){this.imageBase=C||"";this.zoomStopHeight=7;this.zoomStopWidth=19;A.superclass.initialize.call(this,B)},draw:function(B){var D=new OpenLayers.Pixel(5,2),C=this.imageBase;OpenLayers.Control.prototype.draw.apply(this,arguments);this.buttons=[];this._addButton("background",LMI.Urls.get(C+"map_pan_background.png"),D,new OpenLayers.Size(60,60));this._addButton("panup",LMI.Urls.get(C+"map_pan_n.png"),D.add(19,0),new OpenLayers.Size(22,16));this._addButton("panleft",LMI.Urls.get(C+"map_pan_w.png"),D.add(0,16),new OpenLayers.Size(19,22));this._addButton("panright",LMI.Urls.get(C+"map_pan_e.png"),D.add(41,16),new OpenLayers.Size(19,22));this._addButton("pandown",LMI.Urls.get(C+"map_pan_s.png"),D.add(19,37),new OpenLayers.Size(22,22));this._addButton("bestfit",LMI.Urls.get(C+"map_pan_center.png"),D.add(19,16),new OpenLayers.Size(22,22));this._addButton("zoomin",LMI.Urls.get(C+"map_zoom_in.png"),D.add(21,66),new OpenLayers.Size(19,26));if(!this.excludeZoomBar){D=this._addZoomBar(D.add(21,91))}else{D=D.add(21,92)}this._addButton("zoomout",LMI.Urls.get(C+"map_zoom_out.png"),D,new OpenLayers.Size(19,26));return this.div},_addZoomBar:function(B){var F=OpenLayers.Util.getImagesLocation()+this.imageBase,H=this.id+"_"+this.map.id,C=this.map.getNumZoomLevels()-1-this.map.getZoom(),D=OpenLayers.Util.createAlphaImageDiv(H,B.add(0,C*this.zoomStopHeight),new OpenLayers.Size(19,13),LMI.Urls.get(F+"map_zoom_thumb.png"),"absolute"),E=new OpenLayers.Size(),G=null;D.className="dsMapDraggable";this.slider=D;this.sliderEvents=new OpenLayers.Events(this,D,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});E.h=this.zoomStopHeight*this.map.getNumZoomLevels()+6;E.w=this.zoomStopWidth;if(OpenLayers.Util.alphaHack()){G=OpenLayers.Util.createAlphaImageDiv(H,B,new OpenLayers.Size(E.w,this.zoomStopHeight),LMI.Urls.get(F+"map_zoom_slider.png"),"absolute",null,"crop");G.style.height=E.h+"px"}else{G=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,B,E,LMI.Urls.get(F+"map_zoom_slider.png"))}G.style.cursor="pointer";this.zoombarDiv=G;this.divEvents=new OpenLayers.Events(this,G,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(G);this.startTop=parseInt(G.style.top,10);this.div.appendChild(D);this.map.events.register("zoomend",this,this.moveZoomBar);B=B.add(0,E.h);return B},buttonDown:function(B){A.superclass.buttonDown.apply(this,arguments);if(this.action==="bestfit"){this.map.bestFit()}},destroy:function(){if(!this.excludeZoomBar){this._removeZoomBar()}this.map.events.un({changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)}});return A})();LMI.Mapping.TileSwitcher=(function(){var D;function F(){return D.getBaseLayer().name}function B(){}function C(){var G=null;if(LMI.Data.selectedTileSet){G=LMI.Data.selectedTileSet}else{if(LMI.Data.sessionPreferences&&"map_default_tileset" in LMI.Data.sessionPreferences){G=LMI.Data.sessionPreferences.map_default_tileset}}return G}function A(){var G=new LMI.Mapping.LayerSwitcher(),I=LMI.Data.tileSets,H=C();D.addControl(G);if(I){D.addLayers(I)}if(H&&H!==F()){G.switchLayer(H)}}function E(G){D=G;A();D.events.register("changelayer",null,B)}return{init:E,getActiveTileSetName:F}})();LMI.Mapping.LayerSwitcher=(function(){var E=LMI.Element,D=YAHOO.util,B=D.Dom,A=D.Event;function C(){this.initialize.apply(this,arguments)}YAHOO.lang.extend(C,OpenLayers.Control.LayerSwitcher,{ignoreEvent:function(F){OpenLayers.Event.stop(F)},mouseDown:function(F){this.isMouseDown=true;this.ignoreEvent(F)},mouseUp:function(F){if(this.isMouseDown){this.isMouseDown=false;this.ignoreEvent(F)}},loadContents:function(){this.div=E.create("ul",null,{className:"linkList horizontalLinkList mapTilesLinks"});OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);this.maximizeDiv=this.minimizeDiv=E.create("div")},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var F=false,P=false,L=this.map.layers.length,H,I,J,M,G,O,K=this,Q,N;this.layerStates=[];for(I=0;I<L;I++){J=this.map.layers[I];this.layerStates[I]={name:J.name,visibility:J.visibility,inRange:J.inRange,id:J.id}}H=this.map.layers.slice();if(!this.ascending){H.reverse()}for(I=0,L=H.length;I<L;I++){J=H[I];M=J.isBaseLayer;if(J.displayInLayerSwitcher){if(M){P=true}else{F=true}G=(M)?(J===this.map.baseLayer):J.getVisibility();O=G?"selected":"";if(!M&&!J.inRange){O+=" disabled"}N=E.create("li",this.div,{className:J.name,children:[{tag:"a",href:"#",text:J.name,events:{click:this.getClickHandler()},className:O}]});Q=(M)?this.baseLayers:this.dataLayers;Q.push({layer:J,element:N})}}return this.div},getClickHandler:function(){var F=this;return function(G){A.stopEvent(G);F.switchLayer.call(F,this.parentNode.className)}},switchLayer:function(H){var K,G,J,I,F=this.map.layers.length;for(J=0;J<F;J++){I=this.map.layers[J];if(I.name===H){break}}K=E.getOne("."+H+" a",this.div);if(!B.hasClass(K,"disabled")){G=E.getAll("a",this.div);J=G.length;while(J--){if(B.hasClass(G[J],"selected")){B.removeClass(G[J],"selected");break}}B.addClass(K,"selected");I.map.setBaseLayer(I)}},updateMap:function(){var F=this.baseLayers.length,H,G;while(F--){H=this.baseLayers[F];G=E.getOne("."+H.name+" a",this.div);if(B.hasClass(G,"selected")){this.map.setBaseLayer(H.layer,false)}}F=this.dataLayers.length;while(F--){H=this.dataLayers[F];G=E.getOne("."+H.name+" a",this.div);H.layer.setVisibility(B.hasClass(G,"selected"))}},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();this.redraw();return this.div},clearLayersArray:function(H){var I=this[H+"Layers"],G,F;if(I){F=I.length;while(F--){G=I[F];E.destroy(G.element)}}this[H+"Layers"]=[]}});return C})();LMI.Mapping.DefaultControls=function(B){var D=LMI.Mapping,A=LMI.Data.mapOptions.imageBase+"large_controls/",C=false;if(B&&"zoomWheelEnabled" in B){C=B.zoomWheelEnabled}return[new D.PanZoomBar(A),new OpenLayers.Control.Navigation({zoomWheelEnabled:C}),new OpenLayers.Control.DragPan()]};LMI.Mapping.FlyoutFactory=(function(){var A=YAHOO.lang.hasOwnProperty;function B(){this.init()}B.prototype={init:function(){this.contents={"default":B.defaultFlyoutContent,ambig:B.defaultAmbigContent};this.styles={"default":{creator:LMI.DefaultFlyoutStyle.getStyle,xOffset:3,yOffset:8,zOffset:5}}},clone:function(){var D,C,E=new LMI.Mapping.FlyoutFactory();for(D in this.contents){if(A(this.contents,D)){E.contents[D]=this.contents[D]}}for(D in this.styles){if(A(this.styles,D)){E.styles[D]={};for(C in this.styles[D]){if(A(this.styles[D],C)){E.styles[D][C]=this.styles[D][C]}}}}return E},addContentCreator:function(D,C){this.contents[D]=C},addStyle:function(F,E,C){var D={creator:E};this.styles[F]=D},getFlyout:function(C,H,F,E){F=F||"default";E=E||"default";var G=this.contents[F](H),D=this.styles[E];return new LMI.Mapping.Flyout(C,D.creator(G,H,F),H)}};return B})();LMI.Mapping.Flyout=(function(){var A=YAHOO.util.Dom;function B(C,D){this.initialize.apply(this,arguments)}YAHOO.lang.extend(B,OpenLayers.Popup.Anchored,{autoSize:true,panMapIfOutOfView:true,initialize:function(C,D,E){this.content=D;OpenLayers.Popup.COLOR="transparent";B.superclass.initialize.call(this,null,C,null,null,E.icon,false);A.setStyle(this.groupDiv,"overflow","visible")},setContentHTML:function(){this.setContent()},setContent:function(C){if(C){this.content=C}if((this.contentDiv!==null)&&(this.content!==null)){this.contentDiv.appendChild(this.content);if(this.autoSize){this.registerImageListeners();this.updateSize()}}},calculateRelativePosition:function(C){return"br"},setOpacity:function(C){if(C!==undefined){this.opacity=C}if(this.opacity>=1){if(this.div!==null){this.div.style.opacity="";this.div.style.filter=""}}else{B.superclass.setOpacity.apply(this,arguments)}},onclick:function(C){}});return B})();LMI.DefaultContentCreator=(function(){var A=YAHOO.util.Event,D=LMI.Element,C=LMI.Strings.getString,B={};B.getLocInfoElement=function(J){var E=J.getProperty("listing"),F=J.getProperty("name"),H=J.getProperty("prettyDetailsUrl"),G=D.create("div",null,{className:"flyoutTop"}),I;if(F){if(E){if(LMI.Data.state.pageType===J.getProperty("listingSource").toUpperCase()){I=D.create("a",G,{text:F,href:LMI.Urls.get("detailssearch.ds")+"?detailsListingId="+J.getProperty("id"),className:"fn flyoutName detailsLink"})}else{I=D.create("a",G,{text:F,href:H,className:"fn flyoutName"})}A.on(I,"click",function(K){if(LMI.Data.state.pageType==="YELLOW"){LMI.Omniture.listingClickThrough(this,J.getProperty("id"),J.getProperty("categoryId"))}})}else{D.create("span",G,{text:F,className:"fn flyoutName"})}}else{D.create("span",G,{text:C("js.no.flyout.name"),className:"fn flyoutName"})}return G};B.getAddressElement=function(H){var G,I,E=D.create("div",null,{className:"locInfo"}),F;I=H.getProperty("phoneNumber");if(I){D.create("span",E,{className:"tel",text:I})}F=D.create("div",null,{className:"adr"});I=H.getProperty("streetAddress");if(I){D.create("div",F,{text:I,className:"street-address"})}G=H.getProperty("state");if(G){if(I){D.create("text",F,{text:", "})}}I=H.getProperty("state");if(I){if(G){D.create("text",F,{text:", "})}D.create("span",F,{text:I,className:"region"})}E.appendChild(F);return E};B.getLinksElement=function(F){var H=D.create("ul",null,{className:"linkList"}),G=F.getProperty("id"),E=F.getProperty("categoryId");if(F.getProperty("listing")){D.create("li",H,{children:[{tag:"a",text:C("js.getdirs"),href:LMI.Urls.get("displaydirections.ds")+"?dirsListingId="+G,className:"directions",events:{click:function(I){if(LMI.Data.state.pageType==="YELLOW"){LMI.Omniture.listingClickThrough(this,G,E)}}}}]});D.create("li",H,{children:[{tag:"a",text:C("js.inplacespc"),href:LMI.Urls.get("displaymywww.ds"),className:"inlist"}]})}else{if(F.getProperty("id")){D.create("li",H,{children:[{tag:"a",text:C("js.map.saved.location.edit"),id:"edit_"+G,href:"#",events:{click:function(I){F.showFlyout("edit");A.stopEvent(I)}}}]});D.create("li",H,{children:[{tag:"a",text:C("js.map.saved.location.remove"),id:"delete_"+G,href:"#",events:{click:function(I){var J=this.id.replace("delete_","");LMI.Data.form.setVar("savedLocationIds",J);LMI.Data.form.go(LMI.Urls.get("removemyplaces.ds"));A.stopEvent(I)}}}]})}}return H};B.getContent=function(F){var G,E=D.create("div");E.appendChild(B.getLocInfoElement(F));E.appendChild(B.getAddressElement(F));G=B.getLinksElement(F);E.appendChild(G);return E};return B})();LMI.AmbigContentCreator=(function(){var A=YAHOO.util.Event,C=LMI.Element,B={};B.getContent=function(G){var H,E,L,F,J=C.create("div",null,{className:"ambigContents"}),K,I,D;C.create("div",J,{className:"flyoutTop",children:[{tag:"span",text:LMI.Strings.getString("js.multimatches")+":",className:"flyoutName"}]});H=C.create("ul",J);LMI.Lang.forEach([G].concat(G.collisions),function(N,M){E=N.getProperty("name")||N.getProperty("displayValue");F=N.getProperty("id");D=N.getProperty("prettyDetailsUrl");I=M===0?"first":"";if(N.getProperty("featuredStatus")){I+=" "+N.getProperty("featuredStatus")}C.create("li",H,{className:I,children:[{tag:"a",text:E,href:D?LMI.Urls.get(D):"#",id:F,events:{click:function(O){G.hideFlyout();N.showFlyout();A.stopEvent(O)}}}]})});return J};return B})();LMI.DefaultFlyoutStyle=(function(){var E=LMI.Element,C=E.create,D=E.getOne,B=YAHOO.util.Dom;function A(K,G,N){var L="img/mapping/",J,H,Q="flyout_pointer.png",P=G.getProperty("featuredStatus"),F="",M,I,O;M=[{tag:"img",src:LMI.Urls.get(L+Q),alt:"",className:"flyoutPointer"}];if(LMI.Data.site==="rca"){if(P==="featured"){if(N!=="ambig"){M=[{tag:"div",className:"flyoutPointerArrow"},{tag:"div",className:"flyoutPointerArrow flyoutPointerInner"}]}}}H=[{tag:"img",src:LMI.Urls.get(L+"flyout_close.png"),alt:"",className:"flyoutClose",events:{click:function(){if(G){G.hideFlyout()}},touchend:function(){if(G){G.hideFlyout()}}}},{tag:"div",className:"content",children:[{tag:"img",src:LMI.Urls.get(L+"flyout_print.gif"),className:"printonly",alt:""}]}];for(I=0,O=M.length;I<O;I++){H.push(M[I])}if("listing" in G&&G.listing.newConstruction){F=" newCon"}J=C("div",null,{className:"flyout"+F,id:"LMIMapFlyout",children:H});if(K){D("div.content",J).appendChild(K)}return J}return{getStyle:A}}());LMI.Mapping.FlyoutProvider=(function(){var B=new DSMapObject_Collection();function C(G,F,N,H){var R=G.icon.imageDiv,P=F.icon.imageDiv,L=G.getWidth()/2,I=F.getWidth()/2,M=G.getHeight()/2,K=F.getHeight()/2,E=parseInt(R.style.left,10)+L,S=parseInt(R.style.top,10)+M,D=parseInt(P.style.left,10)+I,Q=parseInt(P.style.top,10)+K,O=(L+I)-Math.abs(D-E),J=(M+K)-Math.abs(Q-S);if(!N){N=0}if(!H){H=0}return(O>N&&J>H)}function A(){}A.prototype={initFlyout:function(){this.flyouts={};this.bindEvent("click",this,this.flyoutClickHandler);this.bindEvent("add",this,this.flyoutAddHandler);this.bindEvent("remove",this,this.flyoutRemoveHandler);this.events.register("touchstart",this,this.flyoutClickHandler)},findCollisions:function(){var E,D=new DSMapObject_Iterator(B);this.collisions=[];while(D.hasNext()){E=D.next();if(E!==this&&E.icon.imageDiv&&C(this,E,(E.getWidth()/3),(E.getHeight()/3))){this.collisions.push(E)}}},flyoutAddHandler:function(){this._flyoutCollectionId=B.add(this)},flyoutRemoveHandler:function(){this.hideFlyout();this.flyouts={};B.remove(this._flyoutCollectionId);this._flyoutCollectionId=null},flyoutClickHandler:function(D){if(this.getActiveFlyout()){this.hideFlyout()}else{this.findCollisions();if(this.collisions.length){this.showFlyout("ambig")}else{this.showFlyout("default")}}YAHOO.util.Event.stopEvent(D)},showFlyout:function(H,G){var I,D,F,E;F=LMI.Mapping.FlyoutCollection.getAllFlyouts();for(E in F){if(F[E]){F[E].hideFlyout()}}H=H||"default";if(!(H in this.flyouts)){D=this.flyoutPoint||this.point;D=D.clone();if(this.map.displayProjection&&this.map.displayProjection.getCode()!==this.map.getProjectionObject().getCode()){D.transform(this.map.displayProjection,this.map.getProjectionObject())}I=this.flyouts[H]={type:H,id:null,flyout:this.getFlyoutFactory().getFlyout(D,this,H,G)}}else{I=this.flyouts[H]}I.id=I.flyout.id;this.map.addPopup(I.flyout,true);LMI.Mapping.FlyoutCollection.addFlyout(this)},hideFlyout:function(){var D=this.getActiveFlyout();if(D){LMI.Mapping.FlyoutCollection.removeFlyout(this);this.map.removePopup(D.flyout);D.id=null}},getActiveFlyout:function(){var E,D;for(D in this.flyouts){if(this.flyouts.hasOwnProperty(D)){E=this.flyouts[D];if(typeof E==="object"&&E.id){return E}}}return null}};return A})();LMI.Mapping.FlyoutCollection=(function(){var D={};function A(E){D[E._flyoutCollectionId]=E}function B(E){delete D[E._flyoutCollectionId]}function C(){return D}return{addFlyout:A,removeFlyout:B,getAllFlyouts:C}})();LMI.Mapping.DSPoi=(function(){var A=YAHOO.util.Event,C=LMI.Element;function B(E,D){this.init(E,D)}YAHOO.lang.extend(B,LMI.Mapping.Icon,{init:function(F,D){var E=new LMI.Mapping.Point(F.latitude,F.longitude);B.superclass.init.call(this,E,D);this.setListing(F);this.initFlyout()},getRecommendedIconSrc:function(){return LMI.Mapping.IconUrls["default"]},setListing:function(F){var E=this,D=["id","name","note","city","state","listing","inList","categoryId","displayValue","prettyDetailsUrl"];LMI.Lang.forEach(D,function(G){if(G in F){E.setProperty(G,F[G])}});if("geocodePrecision" in F&&F.geocodePrecision){this.setProperty("geocodePrecision",F.geocodePrecision.name)}if("streetAddress" in F){this.setProperty("streetAddress",F.streetAddress)}else{if("address" in F){this.setProperty("streetAddress",F.address)}}if("urls" in F&&F.urls.length){this.setProperty("url",F.urls[0].value)}if("phoneNumbers" in F&&F.phoneNumbers.length){this.setProperty("phoneNumber",F.phoneNumbers[0].value)}if("emailAddresses" in F&&F.emailAddresses.length){this.setProperty("email",F.emailAddresses[0].value)}if("listingSource" in F&&F.listingSource.name){this.setProperty("listingSource",F.listingSource.name)}},getFlyoutFactory:function(){return B.flyoutFactory}});YAHOO.lang.augment(B,LMI.Mapping.FlyoutProvider);B.flyoutFactory=new LMI.Mapping.FlyoutFactory();B.flyoutFactory.addContentCreator("default",LMI.DefaultContentCreator.getContent);B.flyoutFactory.addContentCreator("ambig",LMI.AmbigContentCreator.getContent);return B})();(function(){var A=LMI.Strings.getString;if(typeof google.maps.MapTypeId.HYBRID!=="undefined"){LMI.Data.tileSets=[new OpenLayers.Layer.Google(A("js.map.control.hybrid"),{type:google.maps.MapTypeId.HYBRID,numZoomLevels:20,sphericalMercator:true,isBaseLayer:true}),new OpenLayers.Layer.Google(A("js.map.control.satellite"),{type:google.maps.MapTypeId.SATELLITE,numZoomLevels:20,sphericalMercator:true,isBaseLayer:true}),new OpenLayers.Layer.Google(A("js.map.control.terrain"),{type:google.maps.MapTypeId.TERRAIN,numZoomLevels:20,sphericalMercator:true,isBaseLayer:true})]}})();