var OpenLayers={VERSION_NUMBER:"Release 2.13.1",singleFile:!0,_getScriptLocation:function(){for(var a=/(^|(.*?\/))(OpenLayers[^\/]*?\.js)(\?|$)/,b=document.getElementsByTagName("script"),c,d="",e=0,f=b.length;e<f;e++)if(c=b[e].getAttribute("src"))if(c=c.match(a)){d=c[1];break}return function(){return d}}(),ImgPath:""};
OpenLayers.String={startsWith:function(a,b){return 0==a.indexOf(b)},contains:function(a,b){return-1!=a.indexOf(b)},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(a){for(var a=a.split("-"),b=a[0],c=1,d=a.length;c<d;c++)var e=a[c],b=b+(e.charAt(0).toUpperCase()+e.substring(1));return b},format:function(a,b,c){b||(b=window);return a.replace(OpenLayers.String.tokenRegEx,function(a,e){for(var f,g=e.split(/\.+/),h=0;h<g.length;h++){0==h&&(f=b);if(void 0===f)break;
f=f[g[h]]}"function"==typeof f&&(f=c?f.apply(null,c):f());return"undefined"==typeof f?"undefined":f})},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)},numericIf:function(a,b){var c=a;!0===b&&null!=a&&a.replace&&(a=a.replace(/^\s*|\s*$/g,""));return OpenLayers.String.isNumeric(a)?parseFloat(a):c}};
OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(a,b){var c=0;0<b&&(c=parseFloat(a.toPrecision(b)));return c},format:function(a,b,c,d){b="undefined"!=typeof b?b:0;c="undefined"!=typeof c?c:OpenLayers.Number.thousandsSeparator;d="undefined"!=typeof d?d:OpenLayers.Number.decimalSeparator;null!=b&&(a=parseFloat(a.toFixed(b)));var e=a.toString().split(".");1==e.length&&null==b&&(b=0);a=e[0];if(c)for(var f=/(-?[0-9]+)([0-9]{3})/;f.test(a);)a=a.replace(f,"$1"+c+"$2");
0==b?b=a:(c=1<e.length?e[1]:"0",null!=b&&(c+=Array(b-c.length+1).join("0")),b=a+d+c);return b},zeroPad:function(a,b,c){for(a=a.toString(c||10);a.length<b;)a="0"+a;return a}};
OpenLayers.Function={bind:function(a,b){var c=Array.prototype.slice.apply(arguments,[2]);return function(){var d=c.concat(Array.prototype.slice.apply(arguments,[0]));return a.apply(b,d)}},bindAsEventListener:function(a,b){return function(c){return a.call(b,c||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}};
OpenLayers.Array={filter:function(a,b,c){var d=[];if(Array.prototype.filter)d=a.filter(b,c);else{var e=a.length;if("function"!=typeof b)throw new TypeError;for(var f=0;f<e;f++)if(f in a){var g=a[f];b.call(c,g,f,a)&&d.push(g)}}return d}};
OpenLayers.Class=function(){var a=arguments.length,b=arguments[0],c=arguments[a-1],d="function"==typeof c.initialize?c.initialize:function(){b.prototype.initialize.apply(this,arguments)};1<a?(a=[d,b].concat(Array.prototype.slice.call(arguments).slice(1,a-1),c),OpenLayers.inherit.apply(null,a)):d.prototype=c;return d};
OpenLayers.inherit=function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;var d,e;for(c=2,d=arguments.length;c<d;c++){e=arguments[c];if("function"===typeof e)e=e.prototype;OpenLayers.Util.extend(a.prototype,e)}};OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.extend=function(a,b){a=a||{};if(b){for(var c in b){var d=b[c];void 0!==d&&(a[c]=d)}if(!("function"==typeof window.Event&&b instanceof window.Event)&&b.hasOwnProperty&&b.hasOwnProperty("toString"))a.toString=b.toString}return a};
OpenLayers.Date={dateRegEx:/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,toISOString:function(){return"toISOString"in Date.prototype?function(a){return a.toISOString()}:function(a){return isNaN(a.getTime())?"Invalid Date":a.getUTCFullYear()+"-"+OpenLayers.Number.zeroPad(a.getUTCMonth()+1,2)+"-"+OpenLayers.Number.zeroPad(a.getUTCDate(),2)+"T"+OpenLayers.Number.zeroPad(a.getUTCHours(),2)+":"+OpenLayers.Number.zeroPad(a.getUTCMinutes(),
2)+":"+OpenLayers.Number.zeroPad(a.getUTCSeconds(),2)+"."+OpenLayers.Number.zeroPad(a.getUTCMilliseconds(),3)+"Z"}}(),parse:function(a){var b;if((a=a.match(this.dateRegEx))&&(a[1]||a[7])){b=parseInt(a[1],10)||0;var c=parseInt(a[2],10)-1||0,d=parseInt(a[3],10)||1;b=new Date(Date.UTC(b,c,d));if(c=a[7]){var d=parseInt(a[4],10),e=parseInt(a[5],10),f=parseFloat(a[6]),g=f|0,f=Math.round(1E3*(f-g));b.setUTCHours(d,e,g,f);"Z"!==c&&(c=parseInt(c,10),a=parseInt(a[8],10)||0,b=new Date(b.getTime()+-1E3*(60*60*
c+60*a)))}}else b=new Date("invalid");return b}};
OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(a,b,c,d){OpenLayers.Util.isArray(a)&&(d=a[3],c=a[2],b=a[1],a=a[0]);if(null!=a)this.left=OpenLayers.Util.toFloat(a);if(null!=b)this.bottom=OpenLayers.Util.toFloat(b);if(null!=c)this.right=OpenLayers.Util.toFloat(c);if(null!=d)this.top=OpenLayers.Util.toFloat(d)},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(a){var b=!1;null!=
a&&(b=this.left==a.left&&this.right==a.right&&this.top==a.top&&this.bottom==a.bottom);return b},toString:function(){return[this.left,this.bottom,this.right,this.top].join()},toArray:function(a){return!0===a?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]},toBBOX:function(a,b){null==a&&(a=6);var c=Math.pow(10,a),d=Math.round(this.left*c)/c,e=Math.round(this.bottom*c)/c,f=Math.round(this.right*c)/c,c=Math.round(this.top*c)/c;return!0===b?e+","+d+","+c+","+f:d+
","+e+","+f+","+c},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return this.right-this.left},getHeight:function(){return this.top-this.bottom},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},
getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat)this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2);return this.centerLonLat},scale:function(a,b){null==b&&(b=this.getCenterLonLat());var c,d;"OpenLayers.LonLat"==b.CLASS_NAME?(c=b.lon,d=b.lat):(c=b.x,d=b.y);return new OpenLayers.Bounds((this.left-c)*a+c,(this.bottom-d)*a+d,(this.right-c)*a+c,(this.top-d)*
a+d)},add:function(a,b){if(null==a||null==b)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){if(a)switch(a.CLASS_NAME){case "OpenLayers.LonLat":this.extendXY(a.lon,a.lat);break;case "OpenLayers.Geometry.Point":this.extendXY(a.x,a.y);break;case "OpenLayers.Bounds":this.centerLonLat=null;if(null==this.left||a.left<this.left)this.left=a.left;if(null==this.bottom||a.bottom<this.bottom)this.bottom=
a.bottom;if(null==this.right||a.right>this.right)this.right=a.right;if(null==this.top||a.top>this.top)this.top=a.top}},extendXY:function(a,b){this.centerLonLat=null;if(null==this.left||a<this.left)this.left=a;if(null==this.bottom||b<this.bottom)this.bottom=b;if(null==this.right||a>this.right)this.right=a;if(null==this.top||b>this.top)this.top=b},containsLonLat:function(a,b){"boolean"===typeof b&&(b={inclusive:b});var b=b||{},c=this.contains(a.lon,a.lat,b.inclusive),d=b.worldBounds;d&&!c&&(c=d.getWidth(),
d=Math.round((a.lon-(d.left+d.right)/2)/c),c=this.containsLonLat({lon:a.lon-d*c,lat:a.lat},{inclusive:b.inclusive}));return c},containsPixel:function(a,b){return this.contains(a.x,a.y,b)},contains:function(a,b,c){null==c&&(c=!0);if(null==a||null==b)return!1;var a=OpenLayers.Util.toFloat(a),b=OpenLayers.Util.toFloat(b),d=!1;return d=c?a>=this.left&&a<=this.right&&b>=this.bottom&&b<=this.top:a>this.left&&a<this.right&&b>this.bottom&&b<this.top},intersectsBounds:function(a,b){"boolean"===typeof b&&(b=
{inclusive:b});b=b||{};if(b.worldBounds)var c=this.wrapDateLine(b.worldBounds),a=a.wrapDateLine(b.worldBounds);else c=this;if(null==b.inclusive)b.inclusive=!0;var d=!1,e=c.left==a.right||c.right==a.left||c.top==a.bottom||c.bottom==a.top;if(b.inclusive||!e)var d=a.top>=c.bottom&&a.top<=c.top||c.top>a.bottom&&c.top<a.top,e=a.left>=c.left&&a.left<=c.right||c.left>=a.left&&c.left<=a.right,f=a.right>=c.left&&a.right<=c.right||c.right>=a.left&&c.right<=a.right,d=(a.bottom>=c.bottom&&a.bottom<=c.top||c.bottom>=
a.bottom&&c.bottom<=a.top||d)&&(e||f);if(b.worldBounds&&!d){var g=b.worldBounds,e=g.getWidth(),f=!g.containsBounds(c),g=!g.containsBounds(a);f&&!g?(a=a.add(-e,0),d=c.intersectsBounds(a,{inclusive:b.inclusive})):g&&!f&&(c=c.add(-e,0),d=a.intersectsBounds(c,{inclusive:b.inclusive}))}return d},containsBounds:function(a,b,c){null==b&&(b=!1);null==c&&(c=!0);var d=this.contains(a.left,a.bottom,c),e=this.contains(a.right,a.bottom,c),f=this.contains(a.left,a.top,c),a=this.contains(a.right,a.top,c);return b?
d||e||f||a:d&&e&&f&&a},determineQuadrant:function(a){var b="",c=this.getCenterLonLat(),b=b+(a.lat<c.lat?"b":"t");return b+=a.lon<c.lon?"l":"r"},transform:function(a,b){this.centerLonLat=null;var c=OpenLayers.Projection.transform({x:this.left,y:this.bottom},a,b),d=OpenLayers.Projection.transform({x:this.right,y:this.bottom},a,b),e=OpenLayers.Projection.transform({x:this.left,y:this.top},a,b),f=OpenLayers.Projection.transform({x:this.right,y:this.top},a,b);this.left=Math.min(c.x,e.x);this.bottom=Math.min(c.y,
d.y);this.right=Math.max(d.x,f.x);this.top=Math.max(e.y,f.y);return this},wrapDateLine:function(a,b){var b=b||{},c=b.leftTolerance||0,d=b.rightTolerance||0,e=this.clone();if(a){for(var f=a.getWidth();e.left<a.left&&e.right-d<=a.left;)e=e.add(f,0);for(;e.left+c>=a.right&&e.right>a.right;)e=e.add(-f,0);c=e.left+c;c<a.right&&c>a.left&&e.right-d>a.right&&(e=e.add(-f,0))}return e},CLASS_NAME:"OpenLayers.Bounds"});
OpenLayers.Bounds.fromString=function(a,b){var c=a.split(",");return OpenLayers.Bounds.fromArray(c,b)};OpenLayers.Bounds.fromArray=function(a,b){return!0===b?new OpenLayers.Bounds(a[1],a[0],a[3],a[2]):new OpenLayers.Bounds(a[0],a[1],a[2],a[3])};OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b;b=""+("t"==a.charAt(0)?"b":"t");return b+="l"==a.charAt(1)?"r":"l"};
OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(a,b){OpenLayers.Util.isArray(a)&&(b=a[1],a=a[0]);this.lon=OpenLayers.Util.toFloat(a);this.lat=OpenLayers.Util.toFloat(b)},toString:function(){return"lon="+this.lon+",lat="+this.lat},toShortString:function(){return this.lon+", "+this.lat},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(a,b){if(null==a||null==b)throw new TypeError("LonLat.add cannot receive null values");return new OpenLayers.LonLat(this.lon+
OpenLayers.Util.toFloat(a),this.lat+OpenLayers.Util.toFloat(b))},equals:function(a){var b=!1;null!=a&&(b=this.lon==a.lon&&this.lat==a.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(a.lon)&&isNaN(a.lat));return b},transform:function(a,b){var c=OpenLayers.Projection.transform({x:this.lon,y:this.lat},a,b);this.lon=c.x;this.lat=c.y;return this},wrapDateLine:function(a){var b=this.clone();if(a){for(;b.lon<a.left;)b.lon+=a.getWidth();for(;b.lon>a.right;)b.lon-=a.getWidth()}return b},CLASS_NAME:"OpenLayers.LonLat"});
OpenLayers.LonLat.fromString=function(a){a=a.split(",");return new OpenLayers.LonLat(a[0],a[1])};OpenLayers.LonLat.fromArray=function(a){var b=OpenLayers.Util.isArray(a);return new OpenLayers.LonLat(b&&a[0],b&&a[1])};
OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return"x="+this.x+",y="+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=!1;null!=a&&(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(null==a||null==b)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();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(a){var b=!1;null!=a&&(b=this.w==a.w&&this.h==a.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(a.w)&&isNaN(a.h));return b},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(){for(var a=document.getElementsByTagName("script"),b=0,c=a.length;b<c;++b)if(-1!=a[b].src.indexOf("firebug.js")&&console){OpenLayers.Util.extend(OpenLayers.Console,console);break}})();
OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){OpenLayers.Lang.code||OpenLayers.Lang.setCode();return OpenLayers.Lang.code},setCode:function(a){var b;a||(a="msie"==OpenLayers.BROWSER_NAME?navigator.userLanguage:navigator.language);a=a.split("-");a[0]=a[0].toLowerCase();"object"==typeof OpenLayers.Lang[a[0]]&&(b=a[0]);if(a[1]){var c=a[0]+"-"+a[1].toUpperCase();"object"==typeof OpenLayers.Lang[c]&&(b=c)}if(!b)OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+a.join("-")+" dictionary, falling back to default language"),
b=OpenLayers.Lang.defaultCode;OpenLayers.Lang.code=b},translate:function(a,b){var c=OpenLayers.Lang[OpenLayers.Lang.getCode()];(c=c&&c[a])||(c=a);b&&(c=OpenLayers.String.format(c,b));return c}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.getElement=function(){for(var a=[],b=0,c=arguments.length;b<c;b++){var d=arguments[b];"string"==typeof d&&(d=document.getElementById(d));if(1==arguments.length)return d;a.push(d)}return a};
OpenLayers.Util.isElement=function(a){return!!(a&&1===a.nodeType)};OpenLayers.Util.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};OpenLayers.Util.removeItem=function(a,b){for(var c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1);return a};OpenLayers.Util.indexOf=function(a,b){if("function"==typeof a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;c++)if(a[c]==b)return c;return-1};OpenLayers.Util.dotless=/\./g;
OpenLayers.Util.modifyDOMElement=function(a,b,c,d,e,f,g,h){if(b)a.id=b.replace(OpenLayers.Util.dotless,"_");if(c)a.style.left=c.x+"px",a.style.top=c.y+"px";if(d)a.style.width=d.w+"px",a.style.height=d.h+"px";if(e)a.style.position=e;if(f)a.style.border=f;if(g)a.style.overflow=g;if(0<=parseFloat(h)&&1>parseFloat(h))a.style.filter="alpha(opacity="+100*h+")",a.style.opacity=h;else if(1==parseFloat(h))a.style.filter="",a.style.opacity=""};
OpenLayers.Util.createDiv=function(a,b,c,d,e,f,g,h){var j=document.createElement("div");if(d)j.style.backgroundImage="url("+d+")";a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="absolute");OpenLayers.Util.modifyDOMElement(j,a,b,c,e,f,g,h);return j};
OpenLayers.Util.createImage=function(a,b,c,d,e,f,g,h){var j=document.createElement("img");a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="relative");OpenLayers.Util.modifyDOMElement(j,a,b,c,e,f,null,g);if(h)j.style.display="none",b=function(){j.style.display="";OpenLayers.Event.stopObservingElement(j)},OpenLayers.Event.observe(j,"load",b),OpenLayers.Event.observe(j,"error",b);j.style.alt=a;j.galleryImg="no";if(d)j.src=d;return j};OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;
OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(null==OpenLayers.Util.alphaHackNeeded){var a=navigator.appVersion.split("MSIE"),a=parseFloat(a[1]),b=!1;try{b=!!document.body.filters}catch(c){}OpenLayers.Util.alphaHackNeeded=b&&5.5<=a&&7>a}return OpenLayers.Util.alphaHackNeeded};
OpenLayers.Util.modifyAlphaImageDiv=function(a,b,c,d,e,f,g,h,j){OpenLayers.Util.modifyDOMElement(a,b,c,d,f,null,null,j);b=a.childNodes[0];if(e)b.src=e;OpenLayers.Util.modifyDOMElement(b,a.id+"_innerImage",null,d,"relative",g);if(OpenLayers.Util.alphaHack()){if("none"!=a.style.display)a.style.display="inline-block";null==h&&(h="scale");a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.src+"', sizingMethod='"+h+"')";0<=parseFloat(a.style.opacity)&&1>parseFloat(a.style.opacity)&&
(a.style.filter+=" alpha(opacity="+100*a.style.opacity+")");b.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(a,b,c,d,e,f,g,h,j){var k=OpenLayers.Util.createDiv(),j=OpenLayers.Util.createImage(null,null,null,null,null,null,null,j);j.className="olAlphaImg";k.appendChild(j);OpenLayers.Util.modifyAlphaImageDiv(k,a,b,c,d,e,f,g,h);return k};OpenLayers.Util.upperCaseObject=function(a){var b={},c;for(c in a)b[c.toUpperCase()]=a[c];return b};
OpenLayers.Util.applyDefaults=function(a,b){var a=a||{},c="function"==typeof window.Event&&b instanceof window.Event,d;for(d in b)if(void 0===a[d]||!c&&b.hasOwnProperty&&b.hasOwnProperty(d)&&!a.hasOwnProperty(d))a[d]=b[d];if(!c&&b&&b.hasOwnProperty&&b.hasOwnProperty("toString")&&!a.hasOwnProperty("toString"))a.toString=b.toString;return a};
OpenLayers.Util.getParameterString=function(a){var b=[],c;for(c in a){var d=a[c];if(null!=d&&"function"!=typeof d){if("object"==typeof d&&d.constructor==Array){for(var e=[],f,g=0,h=d.length;g<h;g++)f=d[g],e.push(encodeURIComponent(null===f||void 0===f?"":f));d=e.join(",")}else d=encodeURIComponent(d);b.push(encodeURIComponent(c)+"="+d)}}return b.join("&")};OpenLayers.Util.urlAppend=function(a,b){var c=a;if(b)var d=(a+" ").split(/[?&]/),c=c+(" "===d.pop()?b:d.length?"&"+b:"?"+b);return c};
OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+"img/"};OpenLayers.Util.getImageLocation=function(a){return OpenLayers.Util.getImagesLocation()+a};OpenLayers.Util.Try=function(){for(var a=null,b=0,c=arguments.length;b<c;b++){var d=arguments[b];try{a=d();break}catch(e){}}return a};
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,b){for(var c=a.relatedTarget?a.relatedTarget:a.toElement;c!=b&&null!=c;)c=c.parentNode;return c!=b};OpenLayers.Util.DEFAULT_PRECISION=14;
OpenLayers.Util.toFloat=function(a,b){if(null==b)b=OpenLayers.Util.DEFAULT_PRECISION;"number"!==typeof a&&(a=parseFloat(a));return 0===b?a:parseFloat(a.toPrecision(b))};OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.deg=function(a){return 180*a/Math.PI};OpenLayers.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563};
OpenLayers.Util.distVincenty=function(a,b){for(var c=OpenLayers.Util.VincentyConstants,d=c.a,e=c.b,c=c.f,f=OpenLayers.Util.rad(b.lon-a.lon),g=Math.atan((1-c)*Math.tan(OpenLayers.Util.rad(a.lat))),h=Math.atan((1-c)*Math.tan(OpenLayers.Util.rad(b.lat))),j=Math.sin(g),g=Math.cos(g),k=Math.sin(h),h=Math.cos(h),l=f,n=2*Math.PI,m=20;1.0E-12<Math.abs(l-n)&&0<--m;){var o=Math.sin(l),q=Math.cos(l),r=Math.sqrt(h*o*h*o+(g*k-j*h*q)*(g*k-j*h*q));if(0==r)return 0;var q=j*k+g*h*q,s=Math.atan2(r,q),t=Math.asin(g*
h*o/r),u=Math.cos(t)*Math.cos(t),o=q-2*j*k/u,w=c/16*u*(4+c*(4-3*u)),n=l,l=f+(1-w)*c*Math.sin(t)*(s+w*r*(o+w*q*(-1+2*o*o)))}if(0==m)return NaN;d=u*(d*d-e*e)/(e*e);c=d/1024*(256+d*(-128+d*(74-47*d)));return(e*(1+d/16384*(4096+d*(-768+d*(320-175*d))))*(s-c*r*(o+c/4*(q*(-1+2*o*o)-c/6*o*(-3+4*r*r)*(-3+4*o*o))))).toFixed(3)/1E3};
OpenLayers.Util.destinationVincenty=function(a,b,c){for(var d=OpenLayers.Util,e=d.VincentyConstants,f=e.a,g=e.b,h=e.f,e=a.lon,a=a.lat,j=d.rad(b),b=Math.sin(j),j=Math.cos(j),a=(1-h)*Math.tan(d.rad(a)),k=1/Math.sqrt(1+a*a),l=a*k,n=Math.atan2(a,j),a=k*b,m=1-a*a,f=m*(f*f-g*g)/(g*g),o=1+f/16384*(4096+f*(-768+f*(320-175*f))),q=f/1024*(256+f*(-128+f*(74-47*f))),f=c/(g*o),r=2*Math.PI;1.0E-12<Math.abs(f-r);)var s=Math.cos(2*n+f),t=Math.sin(f),u=Math.cos(f),w=q*t*(s+q/4*(u*(-1+2*s*s)-q/6*s*(-3+4*t*t)*(-3+4*
s*s))),r=f,f=c/(g*o)+w;c=l*t-k*u*j;g=Math.atan2(l*u+k*t*j,(1-h)*Math.sqrt(a*a+c*c));b=Math.atan2(t*b,k*u-l*t*j);j=h/16*m*(4+h*(4-3*m));s=b-(1-j)*h*a*(f+j*t*(s+j*u*(-1+2*s*s)));Math.atan2(a,-c);return new OpenLayers.LonLat(e+d.deg(s),d.deg(g))};
OpenLayers.Util.getParameters=function(a,b){var b=b||{},a=null===a||void 0===a?window.location.href:a,c="";if(OpenLayers.String.contains(a,"?"))var d=a.indexOf("?")+1,c=OpenLayers.String.contains(a,"#")?a.indexOf("#"):a.length,c=a.substring(d,c);for(var d={},c=c.split(/[&;]/),e=0,f=c.length;e<f;++e){var g=c[e].split("=");if(g[0]){var h=g[0];try{h=decodeURIComponent(h)}catch(j){h=unescape(h)}g=(g[1]||"").replace(/\+/g," ");try{g=decodeURIComponent(g)}catch(k){g=unescape(g)}!1!==b.splitArgs&&(g=g.split(","));
1==g.length&&(g=g[0]);d[h]=g}}return d};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(a){a=null==a?"id_":a.replace(OpenLayers.Util.dotless,"_");OpenLayers.Util.lastSeqID+=1;return a+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.37,km:39370,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;
OpenLayers.METERS_PER_INCH=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:2.54E-5/OpenLayers.METERS_PER_INCH,Mil:2.54E-8/OpenLayers.METERS_PER_INCH,
Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1E3/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":5E4/OpenLayers.METERS_PER_INCH,"150kilometers":15E4/OpenLayers.METERS_PER_INCH});
OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1E3,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:100*OpenLayers.INCHES_PER_UNIT.Meter,km:1E3*OpenLayers.INCHES_PER_UNIT.Meter,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,
"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(a){return 1<a?1/a:a};OpenLayers.Util.getResolutionFromScale=function(a,b){var c;a&&(null==b&&(b="degrees"),c=1/(OpenLayers.Util.normalizeScale(a)*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH));return c};
OpenLayers.Util.getScaleFromResolution=function(a,b){null==b&&(b="degrees");return a*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH};
OpenLayers.Util.pagePosition=function(a){var b=[0,0],c=OpenLayers.Util.getViewportElement();if(!a||a==window||a==c)return b;var d=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&"absolute"==OpenLayers.Element.getStyle(a,"position")&&(""==a.style.top||""==a.style.left),e=null;if(a.getBoundingClientRect)a=a.getBoundingClientRect(),e=window.pageYOffset||c.scrollTop,b[0]=a.left+(window.pageXOffset||c.scrollLeft),b[1]=a.top+e;else if(document.getBoxObjectFor&&!d)a=document.getBoxObjectFor(a),c=document.getBoxObjectFor(c),
b[0]=a.screenX-c.screenX,b[1]=a.screenY-c.screenY;else{b[0]=a.offsetLeft;b[1]=a.offsetTop;e=a.offsetParent;if(e!=a)for(;e;)b[0]+=e.offsetLeft,b[1]+=e.offsetTop,e=e.offsetParent;c=OpenLayers.BROWSER_NAME;if("opera"==c||"safari"==c&&"absolute"==OpenLayers.Element.getStyle(a,"position"))b[1]-=document.body.offsetTop;for(e=a.offsetParent;e&&e!=document.body;){b[0]-=e.scrollLeft;if("opera"!=c||"TR"!=e.tagName)b[1]-=e.scrollTop;e=e.offsetParent}}return b};
OpenLayers.Util.getViewportElement=function(){var a=arguments.callee.viewportElement;if(void 0==a)a="msie"==OpenLayers.BROWSER_NAME&&"CSS1Compat"!=document.compatMode?document.body:document.documentElement,arguments.callee.viewportElement=a;return a};
OpenLayers.Util.isEquivalentUrl=function(a,b,c){c=c||{};OpenLayers.Util.applyDefaults(c,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0,splitArgs:!1});var a=OpenLayers.Util.createUrlObject(a,c),b=OpenLayers.Util.createUrlObject(b,c),d;for(d in a)if("args"!==d&&a[d]!=b[d])return!1;for(d in a.args){if(a.args[d]!=b.args[d])return!1;delete b.args[d]}for(d in b.args)return!1;return!0};
OpenLayers.Util.createUrlObject=function(a,b){b=b||{};if(!/^\w+:\/\//.test(a)){var c=window.location,d=c.port?":"+c.port:"",d=c.protocol+"//"+c.host.split(":").shift()+d;0===a.indexOf("/")?a=d+a:(c=c.pathname.split("/"),c.pop(),a=d+c.join("/")+"/"+a)}b.ignoreCase&&(a=a.toLowerCase());c=document.createElement("a");c.href=a;d={};d.host=c.host.split(":").shift();d.protocol=c.protocol;d.port=b.ignorePort80?"80"==c.port||"0"==c.port?"":c.port:""==c.port||"0"==c.port?"80":c.port;d.hash=b.ignoreHash||"#"===
c.hash?"":c.hash;var e=c.search;e||(e=a.indexOf("?"),e=-1!=e?a.substr(e):"");d.args=OpenLayers.Util.getParameters(e,{splitArgs:b.splitArgs});d.pathname="/"==c.pathname.charAt(0)?c.pathname:"/"+c.pathname;return d};OpenLayers.Util.removeTail=function(a){var b=null,b=a.indexOf("?"),c=a.indexOf("#");return b=-1==b?-1!=c?a.substr(0,c):a:-1!=c?a.substr(0,Math.min(b,c)):a.substr(0,b)};OpenLayers.IS_GECKO=function(){var a=navigator.userAgent.toLowerCase();return-1==a.indexOf("webkit")&&-1!=a.indexOf("gecko")}();
OpenLayers.CANVAS_SUPPORTED=function(){var a=document.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))}();OpenLayers.BROWSER_NAME=function(){var a="",b=navigator.userAgent.toLowerCase();-1!=b.indexOf("opera")?a="opera":-1!=b.indexOf("msie")?a="msie":-1!=b.indexOf("safari")?a="safari":-1!=b.indexOf("mozilla")&&(a=-1!=b.indexOf("firefox")?"firefox":"mozilla");return a}();OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME};
OpenLayers.Util.getRenderedDimensions=function(a,b,c){var d,e,f=document.createElement("div");f.style.visibility="hidden";for(var g=c&&c.containerElement?c.containerElement:document.body,h=!1,j=null,k=g;k&&"body"!=k.tagName.toLowerCase();){var l=OpenLayers.Element.getStyle(k,"position");if("absolute"==l){h=!0;break}else if(l&&"static"!=l)break;k=k.parentNode}if(h&&(0===g.clientHeight||0===g.clientWidth))j=document.createElement("div"),j.style.visibility="hidden",j.style.position="absolute",j.style.overflow=
"visible",j.style.width=document.body.clientWidth+"px",j.style.height=document.body.clientHeight+"px",j.appendChild(f);f.style.position="absolute";if(b)if(b.w)d=b.w,f.style.width=d+"px";else if(b.h)e=b.h,f.style.height=e+"px";if(c&&c.displayClass)f.className=c.displayClass;b=document.createElement("div");b.innerHTML=a;b.style.overflow="visible";if(b.childNodes){a=0;for(c=b.childNodes.length;a<c;a++)if(b.childNodes[a].style)b.childNodes[a].style.overflow="visible"}f.appendChild(b);j?g.appendChild(j):
g.appendChild(f);if(!d)d=parseInt(b.scrollWidth),f.style.width=d+"px";e||(e=parseInt(b.scrollHeight));f.removeChild(b);j?(j.removeChild(f),g.removeChild(j)):g.removeChild(f);return new OpenLayers.Size(d,e)};
OpenLayers.Util.getScrollbarWidth=function(){var a=OpenLayers.Util._scrollbarWidth;if(null==a){var b=null,c=null,b=a=0,b=document.createElement("div");b.style.position="absolute";b.style.top="-1000px";b.style.left="-1000px";b.style.width="100px";b.style.height="50px";b.style.overflow="hidden";c=document.createElement("div");c.style.width="100%";c.style.height="200px";b.appendChild(c);document.body.appendChild(b);a=c.offsetWidth;b.style.overflow="scroll";b=c.offsetWidth;document.body.removeChild(document.body.lastChild);
OpenLayers.Util._scrollbarWidth=a-b;a=OpenLayers.Util._scrollbarWidth}return a};
OpenLayers.Util.getFormattedLonLat=function(a,b,c){c||(c="dms");var a=(a+540)%360-180,d=Math.abs(a),e=Math.floor(d),f=d=(d-e)/(1/60),d=Math.floor(d),f=Math.round(10*((f-d)/(1/60))),f=f/10;60<=f&&(f-=60,d+=1,60<=d&&(d-=60,e+=1));10>e&&(e="0"+e);e+="\u00b0";0<=c.indexOf("dm")&&(10>d&&(d="0"+d),e+=d+"'",0<=c.indexOf("dms")&&(10>f&&(f="0"+f),e+=f+'"'));return e="lon"==b?e+(0>a?OpenLayers.i18n("W"):OpenLayers.i18n("E")):e+(0>a?OpenLayers.i18n("S"):OpenLayers.i18n("N"))};
OpenLayers.Element={visible:function(a){return"none"!=OpenLayers.Util.getElement(a).style.display},toggle:function(){for(var a=0,b=arguments.length;a<b;a++){var c=OpenLayers.Util.getElement(arguments[a]),d=OpenLayers.Element.visible(c)?"none":"";c.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(a,b){var c=a.className;return!!c&&RegExp("(^|\\s)"+b+"(\\s|$)").test(c)},
addClass:function(a,b){OpenLayers.Element.hasClass(a,b)||(a.className+=(a.className?" ":"")+b);return a},removeClass:function(a,b){var c=a.className;if(c)a.className=OpenLayers.String.trim(c.replace(RegExp("(^|\\s+)"+b+"(\\s+|$)")," "));return a},toggleClass:function(a,b){OpenLayers.Element.hasClass(a,b)?OpenLayers.Element.removeClass(a,b):OpenLayers.Element.addClass(a,b);return a},getStyle:function(a,b){var a=OpenLayers.Util.getElement(a),c=null;if(a&&a.style){c=a.style[OpenLayers.String.camelize(b)];
c||(document.defaultView&&document.defaultView.getComputedStyle?c=(c=document.defaultView.getComputedStyle(a,null))?c.getPropertyValue(b):null:a.currentStyle&&(c=a.currentStyle[OpenLayers.String.camelize(b)]));var d=["left","top","right","bottom"];window.opera&&-1!=OpenLayers.Util.indexOf(d,b)&&"static"==OpenLayers.Element.getStyle(a,"position")&&(c="auto")}return"auto"==c?null:c}};OpenLayers.Util=OpenLayers.Util||{};
OpenLayers.Util.vendorPrefix=function(){function a(a){return!a?null:a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()}).replace(/^ms-/,"-ms-")}function b(a,b){if(void 0===g[b]){var c,e=0,f=d.length,m="undefined"!==typeof a.cssText;for(g[b]=null;e<f;e++)if((c=d[e])?(m||(c=c.toLowerCase()),c=c+b.charAt(0).toUpperCase()+b.slice(1)):c=b,void 0!==a[c]){g[b]=c;break}}return g[b]}function c(a){return b(e,a)}var d=["","O","ms","Moz","Webkit"],e=document.createElement("div").style,f={},g={};return{css:function(b){if(void 0===
f[b]){var d=b.replace(/(-[\s\S])/g,function(a){return a.charAt(1).toUpperCase()}),d=c(d);f[b]=a(d)}return f[b]},js:b,style:c,cssCache:f,jsCache:g}}();
OpenLayers.Event={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(a){return a.target||a.srcElement},isSingleTouch:function(a){return a.touches&&1==a.touches.length},isMultiTouch:function(a){return a.touches&&1<a.touches.length},isLeftClick:function(a){return a.which&&1==a.which||a.button&&1==a.button},isRightClick:function(a){return a.which&&3==a.which||a.button&&2==a.button},stop:function(a,
b){b||OpenLayers.Event.preventDefault(a);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},findElement:function(a,b){for(var c=OpenLayers.Event.element(a);c.parentNode&&(!c.tagName||c.tagName.toUpperCase()!=b.toUpperCase());)c=c.parentNode;return c},observe:function(a,b,c,d){a=OpenLayers.Util.getElement(a);d=d||!1;if("keypress"==b&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent))b="keydown";
if(!this.observers)this.observers={};if(!a._eventCacheID){var e="eventCacheID_";a.id&&(e=a.id+"_"+e);a._eventCacheID=OpenLayers.Util.createUniqueID(e)}e=a._eventCacheID;this.observers[e]||(this.observers[e]=[]);this.observers[e].push({element:a,name:b,observer:c,useCapture:d});a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},stopObservingElement:function(a){a=OpenLayers.Util.getElement(a)._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[a])},
_removeElementObservers:function(a){if(a)for(var b=a.length-1;0<=b;b--){var c=a[b];OpenLayers.Event.stopObserving.apply(this,[c.element,c.name,c.observer,c.useCapture])}},stopObserving:function(a,b,c,d){var d=d||!1,a=OpenLayers.Util.getElement(a),e=a._eventCacheID;if("keypress"==b&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.detachEvent))b="keydown";var f=!1,g=OpenLayers.Event.observers[e];if(g)for(var h=0;!f&&h<g.length;){var j=g[h];if(j.name==b&&j.observer==c&&j.useCapture==d){g.splice(h,
1);0==g.length&&delete OpenLayers.Event.observers[e];f=!0;break}h++}f&&(a.removeEventListener?a.removeEventListener(b,c,d):a&&a.detachEvent&&a.detachEvent("on"+b,c));return f},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers)OpenLayers.Event._removeElementObservers.apply(this,[OpenLayers.Event.observers[a]]);OpenLayers.Event.observers=!1}},CLASS_NAME:"OpenLayers.Event"};
OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,!1);
OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:"mouseover,mouseout,mousedown,mouseup,mousemove,click,dblclick,rightclick,dblrightclick,resize,focus,blur,touchstart,touchmove,touchend,keydown".split(","),listeners:null,object:null,element:null,eventHandler:null,fallThrough:null,includeXY:!1,extensions:null,extensionCount:null,clearMouseListener:null,initialize:function(a,b,c,d,e){OpenLayers.Util.extend(this,e);this.object=a;this.fallThrough=d;this.listeners={};this.extensions={};this.extensionCount=
{};this._msTouches=[];null!=b&&this.attachToElement(b)},destroy:function(){for(var a in this.extensions)"boolean"!==typeof this.extensions[a]&&this.extensions[a].destroy();this.extensions=null;this.element&&(OpenLayers.Event.stopObservingElement(this.element),this.element.hasScrollEvent&&OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener));this.eventHandler=this.fallThrough=this.object=this.listeners=this.element=null},addEventType:function(){},attachToElement:function(a){this.element?
OpenLayers.Event.stopObservingElement(this.element):(this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this));this.element=a;for(var b=!!window.navigator.msMaxTouchPoints,c,d=0,e=this.BROWSER_EVENTS.length;d<e;d++)c=this.BROWSER_EVENTS[d],OpenLayers.Event.observe(a,c,this.eventHandler),b&&0===c.indexOf("touch")&&this.addMsTouchListener(a,c,this.eventHandler);OpenLayers.Event.observe(a,"dragstart",
OpenLayers.Event.stop)},on:function(a){for(var b in a)"scope"!=b&&a.hasOwnProperty(b)&&this.register(b,a.scope,a[b])},register:function(a,b,c,d){a in OpenLayers.Events&&!this.extensions[a]&&(this.extensions[a]=new OpenLayers.Events[a](this));if(null!=c){if(null==b)b=this.object;var e=this.listeners[a];e||(e=[],this.listeners[a]=e,this.extensionCount[a]=0);b={obj:b,func:c};d?(e.splice(this.extensionCount[a],0,b),"object"===typeof d&&d.extension&&this.extensionCount[a]++):e.push(b)}},registerPriority:function(a,
b,c){this.register(a,b,c,!0)},un:function(a){for(var b in a)"scope"!=b&&a.hasOwnProperty(b)&&this.unregister(b,a.scope,a[b])},unregister:function(a,b,c){if(null==b)b=this.object;a=this.listeners[a];if(null!=a)for(var d=0,e=a.length;d<e;d++)if(a[d].obj==b&&a[d].func==c){a.splice(d,1);break}},remove:function(a){null!=this.listeners[a]&&(this.listeners[a]=[])},triggerEvent:function(a,b){var c=this.listeners[a];if(c&&0!=c.length){null==b&&(b={});b.object=this.object;b.element=this.element;if(!b.type)b.type=
a;for(var c=c.slice(),d,e=0,f=c.length;e<f&&!(d=c[e],d=d.func.apply(d.obj,[b]),void 0!=d&&!1==d);e++);this.fallThrough||OpenLayers.Event.stop(b,!0);return d}},handleBrowserEvent:function(a){var b=a.type,c=this.listeners[b];if(c&&0!=c.length){if((c=a.touches)&&c[0]){for(var d=0,e=0,f=c.length,g,h=0;h<f;++h)g=this.getTouchClientXY(c[h]),d+=g.clientX,e+=g.clientY;a.clientX=d/f;a.clientY=e/f}if(this.includeXY)a.xy=this.getMousePosition(a);this.triggerEvent(b,a)}},getTouchClientXY:function(a){var b=window.olMockWin||
window,c=b.pageXOffset,b=b.pageYOffset,d=a.clientX,e=a.clientY;if(0===a.pageY&&Math.floor(e)>Math.floor(a.pageY)||0===a.pageX&&Math.floor(d)>Math.floor(a.pageX))d-=c,e-=b;else if(e<a.pageY-b||d<a.pageX-c)d=a.pageX-c,e=a.pageY-b;a.olClientX=d;a.olClientY=e;return{clientX:d,clientY:e}},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(a){if(this.includeXY){if(!this.element.hasScrollEvent)OpenLayers.Event.observe(window,
"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0}else this.clearMouseCache();if(!this.element.scrolls){var b=OpenLayers.Util.getViewportElement();this.element.scrolls=[window.pageXOffset||b.scrollLeft,window.pageYOffset||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])},addMsTouchListener:function(a,b,c){function d(a){c(OpenLayers.Util.applyDefaults({stopPropagation:function(){for(var a=e.length-1;0<=a;--a)e[a].stopPropagation()},preventDefault:function(){for(var a=e.length-1;0<=a;--a)e[a].preventDefault()},type:b},a))}var e=this._msTouches;switch(b){case "touchstart":return this.addMsTouchListenerStart(a,b,d);
case "touchend":return this.addMsTouchListenerEnd(a,b,d);case "touchmove":return this.addMsTouchListenerMove(a,b,d);default:throw"Unknown touch event type";}},addMsTouchListenerStart:function(a,b,c){var d=this._msTouches;OpenLayers.Event.observe(a,"MSPointerDown",function(a){for(var b=!1,g=0,h=d.length;g<h;++g)if(d[g].pointerId==a.pointerId){b=!0;break}b||d.push(a);a.touches=d.slice();c(a)});OpenLayers.Event.observe(a,"MSPointerUp",function(a){for(var b=0,c=d.length;b<c;++b)if(d[b].pointerId==a.pointerId){d.splice(b,
1);break}})},addMsTouchListenerMove:function(a,b,c){var d=this._msTouches;OpenLayers.Event.observe(a,"MSPointerMove",function(a){if(!(a.pointerType==a.MSPOINTER_TYPE_MOUSE&&0==a.buttons||1==d.length&&d[0].pageX==a.pageX&&d[0].pageY==a.pageY)){for(var b=0,g=d.length;b<g;++b)if(d[b].pointerId==a.pointerId){d[b]=a;break}a.touches=d.slice();c(a)}})},addMsTouchListenerEnd:function(a,b,c){var d=this._msTouches;OpenLayers.Event.observe(a,"MSPointerUp",function(a){for(var b=0,g=d.length;b<g;++b)if(d[b].pointerId==
a.pointerId){d.splice(b,1);break}a.touches=d.slice();c(a)})},CLASS_NAME:"OpenLayers.Events"});
OpenLayers.Animation=function(a){var b=OpenLayers.Util.vendorPrefix.js(a,"requestAnimationFrame"),c=!!b,d=function(){var c=a[b]||function(b){a.setTimeout(b,16)};return function(b,d){c.apply(a,[b,d])}}(),e=0,f={};return{isNative:c,requestFrame:d,start:function(a,b,c){var b=0<b?b:Number.POSITIVE_INFINITY,k=++e,l=+new Date;f[k]=function(){f[k]&&+new Date-l<=b?(a(),f[k]&&d(f[k],c)):delete f[k]};d(f[k],c);return k},stop:function(a){delete f[a]}}}(window);
OpenLayers.Tween=OpenLayers.Class({easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,minFrameRate:null,startTime:null,animationId:null,playing:!1,initialize:function(a){this.easing=a?a:OpenLayers.Easing.Expo.easeOut},start:function(a,b,c,d){this.playing=!0;this.begin=a;this.finish=b;this.duration=c;this.callbacks=d.callbacks;this.minFrameRate=d.minFrameRate||30;this.time=0;this.startTime=(new Date).getTime();OpenLayers.Animation.stop(this.animationId);this.animationId=null;
this.callbacks&&this.callbacks.start&&this.callbacks.start.call(this,this.begin);this.animationId=OpenLayers.Animation.start(OpenLayers.Function.bind(this.play,this))},stop:function(){if(this.playing)this.callbacks&&this.callbacks.done&&this.callbacks.done.call(this,this.finish),OpenLayers.Animation.stop(this.animationId),this.animationId=null,this.playing=!1},play:function(){var a={},b;for(b in this.begin){var c=this.begin[b],d=this.finish[b];if(null==c||null==d||isNaN(c)||isNaN(d))throw new TypeError("invalid value for Tween");
a[b]=this.easing.apply(this,[this.time,c,d-c,this.duration])}this.time++;this.callbacks&&this.callbacks.eachStep&&((new Date).getTime()-this.startTime)/this.time<=1E3/this.minFrameRate&&this.callbacks.eachStep.call(this,a);this.time>this.duration&&this.stop()},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(a,b,c,d){return c*a/d+b},easeOut:function(a,b,c,d){return c*a/d+b},easeInOut:function(a,b,c,d){return c*a/d+b},CLASS_NAME:"OpenLayers.Easing.Linear"};
OpenLayers.Easing.Expo={easeIn:function(a,b,c,d){return 0==a?b:c*Math.pow(2,10*(a/d-1))+b},easeOut:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},easeInOut:function(a,b,c,d){return 0==a?b:a==d?b+c:1>(a/=d/2)?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},CLASS_NAME:"OpenLayers.Easing.Expo"};
OpenLayers.Easing.Quad={easeIn:function(a,b,c,d){return c*(a/=d)*a+b},easeOut:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOut:function(a,b,c,d){return 1>(a/=d/2)?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},CLASS_NAME:"OpenLayers.Easing.Quad"};
OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(a,b){OpenLayers.Util.extend(this,b);this.projCode=a;if("object"==typeof Proj4js)this.proj=new Proj4js.Proj(a)},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(a){var b=!1;a&&(a instanceof OpenLayers.Projection||(a=new OpenLayers.Projection(a)),"object"==
typeof Proj4js&&this.proj.defData&&a.proj.defData?b=this.proj.defData.replace(this.titleRegEx,"")==a.proj.defData.replace(this.titleRegEx,""):a.getCode&&(b=this.getCode(),a=a.getCode(),b=b==a||!!OpenLayers.Projection.transforms[b]&&OpenLayers.Projection.transforms[b][a]===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:!0},"CRS:84":{units:"degrees",maxExtent:[-180,-90,180,90]},"EPSG:900913":{units:"m",maxExtent:[-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7]}};
OpenLayers.Projection.addTransform=function(a,b,c){if(c===OpenLayers.Projection.nullTransform){var d=OpenLayers.Projection.defaults[a];d&&!OpenLayers.Projection.defaults[b]&&(OpenLayers.Projection.defaults[b]=d)}OpenLayers.Projection.transforms[a]||(OpenLayers.Projection.transforms[a]={});OpenLayers.Projection.transforms[a][b]=c};
OpenLayers.Projection.transform=function(a,b,c){if(b&&c)if(b instanceof OpenLayers.Projection||(b=new OpenLayers.Projection(b)),c instanceof OpenLayers.Projection||(c=new OpenLayers.Projection(c)),b.proj&&c.proj)a=Proj4js.transform(b.proj,c.proj,a);else{var b=b.getCode(),c=c.getCode(),d=OpenLayers.Projection.transforms;if(d[b]&&d[b][c])d[b][c](a)}return a};OpenLayers.Projection.nullTransform=function(a){return a};
(function(){function a(a){a.x=180*a.x/d;a.y=180/Math.PI*(2*Math.atan(Math.exp(a.y/d*Math.PI))-Math.PI/2);return a}function b(a){a.x=a.x*d/180;var b=Math.log(Math.tan((90+a.y)*Math.PI/360))/Math.PI*d;a.y=Math.max(-2.003750834E7,Math.min(b,2.003750834E7));return a}function c(c,d){var e=OpenLayers.Projection.addTransform,f=OpenLayers.Projection.nullTransform,g,m,o,q,r;for(g=0,m=d.length;g<m;++g){o=d[g];e(c,o,b);e(o,c,a);for(r=g+1;r<m;++r)q=d[r],e(o,q,f),e(q,o,f)}}var d=2.003750834E7,e=["EPSG:900913",
"EPSG:3857","EPSG:102113","EPSG:102100"],f=["CRS:84","urn:ogc:def:crs:EPSG:6.6:4326","EPSG:4326"],g;for(g=e.length-1;0<=g;--g)c(e[g],f);for(g=f.length-1;0<=g;--g)c(f[g],e)})();
OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1E3},id:null,fractionalZoom:!1,events:null,allOverlays:!1,div:null,dragging:!1,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,options:null,tileSize:null,projection:"EPSG:4326",units:null,resolutions:null,maxResolution:null,minResolution:null,maxScale:null,minScale:null,
maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:!1,autoUpdateSize:!0,eventListeners:null,panTween:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,zoomTween:null,zoomMethod:OpenLayers.Easing.Quad.easeOut,zoomDuration:20,paddingForPopups:null,layerContainerOriginPx:null,minPx:null,maxPx:null,initialize:function(a,b){1===arguments.length&&"object"===typeof a&&(a=(b=a)&&b.div);this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,
OpenLayers.Map.TILE_HEIGHT);this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";this.options=OpenLayers.Util.extend({},b);OpenLayers.Util.extend(this,b);OpenLayers.Util.applyDefaults(this,OpenLayers.Projection.defaults[this.projection instanceof OpenLayers.Projection?this.projection.projCode:this.projection]);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(a);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 c=this.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(c,null,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPortDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendChild(this.viewPortDiv);this.events=new OpenLayers.Events(this,this.viewPortDiv,null,this.fallThrough,{includeXY:!0});
if(OpenLayers.TileManager&&null!==this.tileManager){if(!(this.tileManager instanceof OpenLayers.TileManager))this.tileManager=new OpenLayers.TileManager(this.tileManager);this.tileManager.addMap(this)}c=this.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(c);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.layerContainerOriginPx={x:0,y:0};this.applyTransform();this.viewPortDiv.appendChild(this.layerContainerDiv);this.updateSize();if(this.eventListeners instanceof
Object)this.events.on(this.eventListeners);if(!0===this.autoUpdateSize)this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this),OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy);if(this.theme){for(var c=!0,d=document.getElementsByTagName("link"),e=0,f=d.length;e<f;++e)if(OpenLayers.Util.isEquivalentUrl(d.item(e).href,this.theme)){c=!1;break}c&&(c=document.createElement("link"),c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("href",this.theme),
document.getElementsByTagName("head")[0].appendChild(c))}if(null==this.controls)this.controls=[],null!=OpenLayers.Control&&(OpenLayers.Control.Navigation?this.controls.push(new OpenLayers.Control.Navigation):OpenLayers.Control.TouchNavigation&&this.controls.push(new OpenLayers.Control.TouchNavigation),OpenLayers.Control.Zoom?this.controls.push(new OpenLayers.Control.Zoom):OpenLayers.Control.PanZoom&&this.controls.push(new OpenLayers.Control.PanZoom),OpenLayers.Control.ArgParser&&this.controls.push(new OpenLayers.Control.ArgParser),
OpenLayers.Control.Attribution&&this.controls.push(new OpenLayers.Control.Attribution));e=0;for(f=this.controls.length;e<f;e++)this.addControlToMap(this.controls[e]);this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy);b&&b.layers&&(delete this.center,delete this.zoom,this.addLayers(b.layers),b.center&&!this.getCenter()&&this.setCenter(b.center,b.zoom));if(this.panMethod)this.panTween=new OpenLayers.Tween(this.panMethod);
if(this.zoomMethod&&this.applyTransform.transform)this.zoomTween=new OpenLayers.Tween(this.zoomMethod)},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!1;if(this.panTween)this.panTween.stop(),
this.panTween=null;if(this.zoomTween)this.zoomTween.stop(),this.zoomTween=null;OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;this.updateSizeDestroy&&OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy);this.paddingForPopups=null;if(null!=this.controls){for(var a=this.controls.length-1;0<=a;--a)this.controls[a].destroy();this.controls=null}if(null!=this.layers){for(a=this.layers.length-1;0<=a;--a)this.layers[a].destroy(!1);this.layers=
null}this.viewPortDiv&&this.viewPortDiv.parentNode&&this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.viewPortDiv=null;if(this.tileManager)this.tileManager.removeMap(this),this.tileManager=null;if(this.eventListeners)this.events.un(this.eventListeners),this.eventListeners=null;this.events.destroy();this.options=this.events=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:!0})},getTileSize:function(){return this.tileSize},getBy:function(a,b,c){var d="function"==typeof c.test;return OpenLayers.Array.filter(this[a],function(a){return a[b]==c||d&&c.test(a[b])})},getLayersBy:function(a,b){return this.getBy("layers",a,b)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(a,b){return this.getBy("controls",a,b)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",
a)},getLayer:function(a){for(var b=null,c=0,d=this.layers.length;c<d;c++){var e=this.layers[c];if(e.id==a){b=e;break}}return b},setLayerZIndex:function(a,b){a.setZIndex(this.Z_INDEX_BASE[a.isBaseLayer?"BaseLayer":"Overlay"]+5*b)},resetLayersZIndex:function(){for(var a=0,b=this.layers.length;a<b;a++)this.setLayerZIndex(this.layers[a],a)},addLayer:function(a){for(var b=0,c=this.layers.length;b<c;b++)if(this.layers[b]==a)return!1;if(!1===this.events.triggerEvent("preaddlayer",{layer:a}))return!1;if(this.allOverlays)a.isBaseLayer=
!1;a.div.className="olLayerDiv";a.div.style.overflow="";this.setLayerZIndex(a,this.layers.length);a.isFixed?this.viewPortDiv.appendChild(a.div):this.layerContainerDiv.appendChild(a.div);this.layers.push(a);a.setMap(this);a.isBaseLayer||this.allOverlays&&!this.baseLayer?null==this.baseLayer?this.setBaseLayer(a):a.setVisibility(!1):a.redraw();this.events.triggerEvent("addlayer",{layer:a});a.events.triggerEvent("added",{map:this,layer:a});a.afterAdd();return!0},addLayers:function(a){for(var b=0,c=a.length;b<
c;b++)this.addLayer(a[b])},removeLayer:function(a,b){if(!1!==this.events.triggerEvent("preremovelayer",{layer:a})){null==b&&(b=!0);a.isFixed?this.viewPortDiv.removeChild(a.div):this.layerContainerDiv.removeChild(a.div);OpenLayers.Util.removeItem(this.layers,a);a.removeMap(this);a.map=null;if(this.baseLayer==a&&(this.baseLayer=null,b))for(var c=0,d=this.layers.length;c<d;c++){var e=this.layers[c];if(e.isBaseLayer||this.allOverlays){this.setBaseLayer(e);break}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",
{layer:a});a.events.triggerEvent("removed",{map:this,layer:a})}},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(a,b){var c=this.getLayerIndex(a);if(0>b)b=0;else if(b>this.layers.length)b=this.layers.length;if(c!=b){this.layers.splice(c,1);this.layers.splice(b,0,a);for(var c=0,d=this.layers.length;c<d;c++)this.setLayerZIndex(this.layers[c],c);this.events.triggerEvent("changelayer",{layer:a,property:"order"});
this.allOverlays&&(0===b?this.setBaseLayer(a):this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0]))}},raiseLayer:function(a,b){var c=this.getLayerIndex(a)+b;this.setLayerIndex(a,c)},setBaseLayer:function(a){if(a!=this.baseLayer&&-1!=OpenLayers.Util.indexOf(this.layers,a)){var b=this.getCachedCenter(),c=OpenLayers.Util.getResolutionFromScale(this.getScale(),a.units);null!=this.baseLayer&&!this.allOverlays&&this.baseLayer.setVisibility(!1);this.baseLayer=a;if(!this.allOverlays||this.baseLayer.visibility)this.baseLayer.setVisibility(!0),
!1===this.baseLayer.inRange&&this.baseLayer.redraw();null!=b&&(a=this.getZoomForResolution(c||this.resolution,!0),this.setCenter(b,a,!1,!0));this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}},addControl:function(a,b){this.controls.push(a);this.addControlToMap(a,b)},addControls:function(a,b){for(var c=1===arguments.length?[]:b,d=0,e=a.length;d<e;d++)this.addControl(a[d],c[d]?c[d]:null)},addControlToMap:function(a,b){a.outsideViewport=null!=a.div;if(this.displayProjection&&!a.displayProjection)a.displayProjection=
this.displayProjection;a.setMap(this);var c=a.draw(b);if(c&&!a.outsideViewport)c.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length,this.viewPortDiv.appendChild(c);a.autoActivate&&a.activate()},getControl:function(a){for(var b=null,c=0,d=this.controls.length;c<d;c++){var e=this.controls[c];if(e.id==a){b=e;break}}return b},removeControl:function(a){a&&a==this.getControl(a.id)&&(a.div&&a.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(a.div),OpenLayers.Util.removeItem(this.controls,
a))},addPopup:function(a,b){if(b)for(var c=this.popups.length-1;0<=c;--c)this.removePopup(this.popups[c]);a.map=this;this.popups.push(a);if(c=a.draw())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;null!=this.size&&(a=this.size.clone());return a},updateSize:function(){var a=this.getCurrentSize();
if(a&&!isNaN(a.h)&&!isNaN(a.w)){this.events.clearMouseCache();var b=this.getSize();if(null==b)this.size=b=a;if(!a.equals(b)){this.size=a;a=0;for(b=this.layers.length;a<b;a++)this.layers[a].onMapResize();a=this.getCachedCenter();if(null!=this.baseLayer&&null!=a)b=this.getZoom(),this.zoom=null,this.setCenter(a,b)}}this.events.triggerEvent("updatesize")},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(0==a.w&&0==a.h||isNaN(a.w)&&isNaN(a.h))a.w=this.div.offsetWidth,
a.h=this.div.offsetHeight;if(0==a.w&&0==a.h||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;null==a&&(a=this.getCachedCenter());null==b&&(b=this.getResolution());if(null!=a&&null!=b)var c=this.size.w*b/2,d=this.size.h*b/2,c=new OpenLayers.Bounds(a.lon-c,a.lat-d,a.lon+c,a.lat+d);return c},getCenter:function(){var a=null,b=this.getCachedCenter();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(a,b,c){c=OpenLayers.Util.applyDefaults(c,{animate:!0,dragging:!1});if(c.dragging)(0!=a||0!=b)&&this.moveByPx(a,b);else{var d=this.getViewPortPxFromLonLat(this.getCachedCenter()),a=d.add(a,b);if(this.dragging||!a.equals(d))if(d=this.getLonLatFromViewPortPx(a),c.animate)this.panTo(d);else if(this.moveTo(d),this.dragging)this.dragging=!1,this.events.triggerEvent("moveend")}},
panTo:function(a){if(this.panTween&&this.getExtent().scale(this.panRatio).containsLonLat(a)){var b=this.getCachedCenter();if(!a.equals(b)){var b=this.getPixelFromLonLat(b),c=this.getPixelFromLonLat(a),d=0,e=0;this.panTween.start({x:0,y:0},{x:c.x-b.x,y:c.y-b.y},this.panDuration,{callbacks:{eachStep:OpenLayers.Function.bind(function(a){this.moveByPx(a.x-d,a.y-e);d=Math.round(a.x);e=Math.round(a.y)},this),done:OpenLayers.Function.bind(function(){this.moveTo(a);this.dragging=!1;this.events.triggerEvent("moveend")},
this)}})}}else this.setCenter(a)},setCenter:function(a,b,c,d){this.panTween&&this.panTween.stop();this.zoomTween&&this.zoomTween.stop();this.moveTo(a,b,{dragging:c,forceZoomChange:d})},moveByPx:function(a,b){var c=this.size.w/2,d=this.size.h/2,e=c+a,f=d+b,g=this.baseLayer.wrapDateLine,h=0,j=0;this.restrictedExtent&&(h=c,j=d,g=!1);a=g||e<=this.maxPx.x-h&&e>=this.minPx.x+h?Math.round(a):0;b=f<=this.maxPx.y-j&&f>=this.minPx.y+j?Math.round(b):0;if(a||b){if(!this.dragging)this.dragging=!0,this.events.triggerEvent("movestart");
this.center=null;a&&(this.layerContainerOriginPx.x-=a,this.minPx.x-=a,this.maxPx.x-=a);b&&(this.layerContainerOriginPx.y-=b,this.minPx.y-=b,this.maxPx.y-=b);this.applyTransform();for(d=0,e=this.layers.length;d<e;++d)if(c=this.layers[d],c.visibility&&(c===this.baseLayer||c.inRange))c.moveByPx(a,b),c.events.triggerEvent("move");this.events.triggerEvent("move")}},adjustZoom:function(a){if(this.baseLayer&&this.baseLayer.wrapDateLine){var b=this.baseLayer.resolutions,c=this.getMaxExtent().getWidth()/this.size.w;
if(this.getResolutionForZoom(a)>c)if(this.fractionalZoom)a=this.getZoomForResolution(c);else for(var d=a|0,e=b.length;d<e;++d)if(b[d]<=c){a=d;break}}return a},getMinZoom:function(){return this.adjustZoom(0)},moveTo:function(a,b,c){null!=a&&!(a instanceof OpenLayers.LonLat)&&(a=new OpenLayers.LonLat(a));c||(c={});null!=b&&(b=parseFloat(b),this.fractionalZoom||(b=Math.round(b)));var d=b,b=this.adjustZoom(b);b!==d&&(a=this.getCenter());var d=c.dragging||this.dragging,e=c.forceZoomChange;if(!this.getCachedCenter()&&
!this.isValidLonLat(a))a=this.maxExtent.getCenterLonLat(),this.center=a.clone();if(null!=this.restrictedExtent){if(null==a)a=this.center;null==b&&(b=this.getZoom());var f=this.getResolutionForZoom(b),f=this.calculateBounds(a,f);if(!this.restrictedExtent.containsBounds(f)){var g=this.restrictedExtent.getCenterLonLat();f.getWidth()>this.restrictedExtent.getWidth()?a=new OpenLayers.LonLat(g.lon,a.lat):f.left<this.restrictedExtent.left?a=a.add(this.restrictedExtent.left-f.left,0):f.right>this.restrictedExtent.right&&
(a=a.add(this.restrictedExtent.right-f.right,0));f.getHeight()>this.restrictedExtent.getHeight()?a=new OpenLayers.LonLat(a.lon,g.lat):f.bottom<this.restrictedExtent.bottom?a=a.add(0,this.restrictedExtent.bottom-f.bottom):f.top>this.restrictedExtent.top&&(a=a.add(0,this.restrictedExtent.top-f.top))}}e=e||this.isValidZoomLevel(b)&&b!=this.getZoom();f=this.isValidLonLat(a)&&!a.equals(this.center);if(e||f||d){d||this.events.triggerEvent("movestart",{zoomChanged:e});if(f)!e&&this.center&&this.centerLayerContainer(a),
this.center=a.clone();a=e?this.getResolutionForZoom(b):this.getResolution();if(e||null==this.layerContainerOrigin){this.layerContainerOrigin=this.getCachedCenter();this.layerContainerOriginPx.x=0;this.layerContainerOriginPx.y=0;this.applyTransform();var f=this.getMaxExtent({restricted:!0}),h=f.getCenterLonLat(),g=this.center.lon-h.lon,h=h.lat-this.center.lat,j=Math.round(f.getWidth()/a),k=Math.round(f.getHeight()/a);this.minPx={x:(this.size.w-j)/2-g/a,y:(this.size.h-k)/2-h/a};this.maxPx={x:this.minPx.x+
Math.round(f.getWidth()/a),y:this.minPx.y+Math.round(f.getHeight()/a)}}if(e)this.zoom=b,this.resolution=a;a=this.getExtent();this.baseLayer.visibility&&(this.baseLayer.moveTo(a,e,c.dragging),c.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:e}));a=this.baseLayer.getExtent();for(b=this.layers.length-1;0<=b;--b)if(f=this.layers[b],f!==this.baseLayer&&!f.isBaseLayer){g=f.calculateInRange();if(f.inRange!=g)(f.inRange=g)||f.display(!1),this.events.triggerEvent("changelayer",{layer:f,
property:"visibility"});g&&f.visibility&&(f.moveTo(a,e,c.dragging),c.dragging||f.events.triggerEvent("moveend",{zoomChanged:e}))}this.events.triggerEvent("move");d||this.events.triggerEvent("moveend");if(e){b=0;for(c=this.popups.length;b<c;b++)this.popups[b].updatePosition();this.events.triggerEvent("zoomend")}}},centerLayerContainer:function(a){var b=this.getViewPortPxFromLonLat(this.layerContainerOrigin),c=this.getViewPortPxFromLonLat(a);if(null!=b&&null!=c){var d=this.layerContainerOriginPx.x,
a=this.layerContainerOriginPx.y,e=Math.round(b.x-c.x),b=Math.round(b.y-c.y);this.applyTransform(this.layerContainerOriginPx.x=e,this.layerContainerOriginPx.y=b);d-=e;a-=b;this.minPx.x-=d;this.maxPx.x-=d;this.minPx.y-=a;this.maxPx.y-=a}},isValidZoomLevel:function(a){return null!=a&&0<=a&&a<this.getNumZoomLevels()},isValidLonLat:function(a){var b=!1;null!=a&&(b=this.getMaxExtent(),b=b.containsLonLat(a,{worldBounds:this.baseLayer.wrapDateLine&&b}));return b},getProjection:function(){var a=this.getProjectionObject();
return a?a.getCode():null},getProjectionObject:function(){var a=null;if(null!=this.baseLayer)a=this.baseLayer.projection;return a},getMaxResolution:function(){var a=null;if(null!=this.baseLayer)a=this.baseLayer.maxResolution;return a},getMaxExtent:function(a){var b=null;if(a&&a.restricted&&this.restrictedExtent)b=this.restrictedExtent;else if(null!=this.baseLayer)b=this.baseLayer.maxExtent;return b},getNumZoomLevels:function(){var a=null;if(null!=this.baseLayer)a=this.baseLayer.numZoomLevels;return a},
getExtent:function(){var a=null;null!=this.baseLayer&&(a=this.baseLayer.getExtent());return a},getResolution:function(){var a=null;null!=this.baseLayer?a=this.baseLayer.getResolution():!0===this.allOverlays&&0<this.layers.length&&(a=this.layers[0].getResolution());return a},getUnits:function(){var a=null;if(null!=this.baseLayer)a=this.baseLayer.units;return a},getScale:function(){var a=null;null!=this.baseLayer&&(a=this.getResolution(),a=OpenLayers.Util.getScaleFromResolution(a,this.baseLayer.units));
return a},getZoomForExtent:function(a,b){var c=null;null!=this.baseLayer&&(c=this.baseLayer.getZoomForExtent(a,b));return c},getResolutionForZoom:function(a){var b=null;this.baseLayer&&(b=this.baseLayer.getResolutionForZoom(a));return b},getZoomForResolution:function(a,b){var c=null;null!=this.baseLayer&&(c=this.baseLayer.getZoomForResolution(a,b));return c},zoomTo:function(a,b){var c=this;if(c.isValidZoomLevel(a))if(c.baseLayer.wrapDateLine&&(a=c.adjustZoom(a)),c.zoomTween){var d=c.getResolution(),
e=c.getResolutionForZoom(a),f={scale:1},d={scale:d/e};c.zoomTween.playing&&c.zoomTween.duration<3*c.zoomDuration?c.zoomTween.finish={scale:c.zoomTween.finish.scale*d.scale}:(b||(e=c.getSize(),b={x:e.w/2,y:e.h/2}),c.zoomTween.start(f,d,c.zoomDuration,{minFrameRate:50,callbacks:{eachStep:function(a){var d=c.layerContainerOriginPx,a=a.scale;c.applyTransform(d.x+((a-1)*(d.x-b.x)|0),d.y+((a-1)*(d.y-b.y)|0),a)},done:function(a){c.applyTransform();var a=c.getResolution()/a.scale,d=c.getZoomForResolution(a,
!0);c.moveTo(c.getZoomTargetCenter(b,a),d,!0)}}}))}else f=b?c.getZoomTargetCenter(b,c.getResolutionForZoom(a)):null,c.setCenter(f,a)},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(a,b){a instanceof OpenLayers.Bounds||(a=new OpenLayers.Bounds(a));var c=a.getCenterLonLat();if(this.baseLayer.wrapDateLine){c=this.getMaxExtent();for(a=a.clone();a.right<a.left;)a.right+=c.getWidth();c=a.getCenterLonLat().wrapDateLine(c)}this.setCenter(c,
this.getZoomForExtent(a,b))},zoomToMaxExtent:function(a){this.zoomToExtent(this.getMaxExtent({restricted:a?a.restricted:!0}))},zoomToScale:function(a,b){var c=OpenLayers.Util.getResolutionFromScale(a,this.baseLayer.units),d=this.size.w*c/2,c=this.size.h*c/2,e=this.getCachedCenter();this.zoomToExtent(new OpenLayers.Bounds(e.lon-d,e.lat-c,e.lon+d,e.lat+c),b)},getLonLatFromViewPortPx:function(a){var b=null;null!=this.baseLayer&&(b=this.baseLayer.getLonLatFromViewPortPx(a));return b},getViewPortPxFromLonLat:function(a){var b=
null;null!=this.baseLayer&&(b=this.baseLayer.getViewPortPxFromLonLat(a));return b},getZoomTargetCenter:function(a,b){var c=null,d=this.getSize(),e=d.w/2-a.x,d=a.y-d.h/2,f=this.getLonLatFromPixel(a);f&&(c=new OpenLayers.LonLat(f.lon+e*b,f.lat+d*b));return c},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(a){a=this.getViewPortPxFromLonLat(a);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getGeodesicPixelSize:function(a){var b=a?this.getLonLatFromPixel(a):
this.getCachedCenter()||new OpenLayers.LonLat(0,0),c=this.getResolution(),a=b.add(-c/2,0),d=b.add(c/2,0),e=b.add(0,-c/2),b=b.add(0,c/2),c=new OpenLayers.Projection("EPSG:4326"),f=this.getProjectionObject()||c;f.equals(c)||(a.transform(f,c),d.transform(f,c),e.transform(f,c),b.transform(f,c));return new OpenLayers.Size(OpenLayers.Util.distVincenty(a,d),OpenLayers.Util.distVincenty(e,b))},getViewPortPxFromLayerPx:function(a){var b=null;null!=a&&(b=a.add(this.layerContainerOriginPx.x,this.layerContainerOriginPx.y));
return b},getLayerPxFromViewPortPx:function(a){var b=null;if(null!=a&&(b=a.add(-this.layerContainerOriginPx.x,-this.layerContainerOriginPx.y),isNaN(b.x)||isNaN(b.y)))b=null;return b},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(a){return this.getLayerPxFromViewPortPx(this.getPixelFromLonLat(a))},applyTransform:function(a,b,c){var c=c||1,d=this.layerContainerOriginPx,e=1!==c,a=a||d.x,b=b||d.y,f=this.layerContainerDiv.style,
g=this.applyTransform.transform,h=this.applyTransform.template;if(void 0===g&&(g=OpenLayers.Util.vendorPrefix.style("transform"),this.applyTransform.transform=g)){var j=OpenLayers.Element.getStyle(this.viewPortDiv,OpenLayers.Util.vendorPrefix.css("transform"));if(!j||"none"!==j)h=["translate3d(",",0) ","scale3d(",",1)"],f[g]=[h[0],"0,0",h[1]].join("");if(!h||!~f[g].indexOf(h[0]))h=["translate(",") ","scale(",")"];this.applyTransform.template=h}if(null!==g&&("translate3d("===h[0]||!0===e)){if(!0===
e&&"translate("===h[0])a-=d.x,b-=d.y,f.left=d.x+"px",f.top=d.y+"px";f[g]=[h[0],a,"px,",b,"px",h[1],h[2],c,",",c,h[3]].join("")}else f.left=a+"px",f.top=b+"px",null!==g&&(f[g]="")},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;
OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:null,popup:null,initialize:function(a,b,c){this.layer=a;this.lonlat=b;this.data=null!=c?c:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){null!=this.layer&&null!=this.layer.map&&null!=this.popup&&this.layer.map.removePopup(this.popup);null!=this.layer&&null!=this.marker&&this.layer.removeMarker(this.marker);this.data=this.lonlat=this.id=this.layer=null;if(null!=this.marker)this.destroyMarker(this.marker),
this.marker=null;if(null!=this.popup)this.destroyPopup(this.popup),this.popup=null},onScreen:function(){var a=!1;null!=this.layer&&null!=this.layer.map&&(a=this.layer.map.getExtent().containsLonLat(this.lonlat));return a},createMarker:function(){if(null!=this.lonlat)this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon);return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(a){if(null!=this.lonlat){if(!this.popup)this.popup=new (this.popupClass?this.popupClass:
OpenLayers.Popup.Anchored)(this.id+"_popup",this.lonlat,this.data.popupSize,this.data.popupContentHTML,this.marker?this.marker.icon:null,a);if(null!=this.data.overflow)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(a,b,c){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,b]);this.lonlat=null;this.geometry=a?a:null;this.state=null;this.attributes={};if(b)this.attributes=OpenLayers.Util.extend(this.attributes,b);this.style=c?c:null},destroy:function(){if(this.layer)this.layer.removeFeatures(this),this.layer=
null;this.modified=this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(a){var b=!1;this.layer&&this.layer.map&&(b=this.layer.map.getExtent(),a?(a=this.geometry.getBounds(),b=b.intersectsBounds(a)):b=b.toGeometry().intersects(this.geometry));return b},getVisibility:function(){return!(this.style&&"none"==this.style.display||!this.layer||
this.layer&&this.layer.styleMap&&"none"==this.layer.styleMap.createSymbolizer(this,this.renderIntent).display||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(a,b,c){var d=!1;this.geometry&&(d=this.geometry.atPoint(a,b,c));return d},destroyPopup:function(){},move:function(a){if(this.layer&&this.geometry.move){var a="OpenLayers.LonLat"==a.CLASS_NAME?this.layer.getViewPortPxFromLonLat(a):a,
b=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),c=this.layer.map.getResolution();this.geometry.move(c*(a.x-b.x),c*(b.y-a.y));this.layer.drawFeature(this);return b}},toState:function(a){if(a==OpenLayers.State.UPDATE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=a}else if(a==OpenLayers.State.INSERT)switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=a}else if(a==OpenLayers.State.DELETE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=
a}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.Style=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:!1,propertyStyles:null,initialize:function(a,b){OpenLayers.Util.extend(this,b);this.rules=[];b&&b.rules&&this.addRules(b.rules);this.setDefaultStyle(a||OpenLayers.Feature.Vector.style["default"]);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a=0,b=this.rules.length;a<b;a++)this.rules[a].destroy(),
this.rules[a]=null;this.defaultStyle=this.rules=null},createSymbolizer:function(a){for(var b=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),a),c=this.rules,d,e=[],f=!1,g=0,h=c.length;g<h;g++)d=c[g],d.evaluate(a)&&(d instanceof OpenLayers.Rule&&d.elseFilter?e.push(d):(f=!0,this.applySymbolizer(d,b,a)));if(!1==f&&0<e.length){f=!0;g=0;for(h=e.length;g<h;g++)this.applySymbolizer(e[g],b,a)}if(0<c.length&&!1==f)b.display="none";if(null!=b.label&&"string"!==
typeof b.label)b.label=""+b.label;return b},applySymbolizer:function(a,b,c){var d=c.geometry?this.getSymbolizerPrefix(c.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0],a=a.symbolizer[d]||a.symbolizer;if(!0===this.defaultsPerSymbolizer)d=this.defaultStyle,OpenLayers.Util.applyDefaults(a,{pointRadius:d.pointRadius}),(!0===a.stroke||!0===a.graphic)&&OpenLayers.Util.applyDefaults(a,{strokeWidth:d.strokeWidth,strokeColor:d.strokeColor,strokeOpacity:d.strokeOpacity,strokeDashstyle:d.strokeDashstyle,strokeLinecap:d.strokeLinecap}),
(!0===a.fill||!0===a.graphic)&&OpenLayers.Util.applyDefaults(a,{fillColor:d.fillColor,fillOpacity:d.fillOpacity}),!0===a.graphic&&OpenLayers.Util.applyDefaults(a,{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(b,a),c)},createLiterals:function(a,b){var c=OpenLayers.Util.extend({},b.attributes||b.data);OpenLayers.Util.extend(c,this.context);for(var d in this.propertyStyles)a[d]=OpenLayers.Style.createLiteral(a[d],c,b,d);return a},findPropertyStyles:function(){var a={};this.addPropertyStyles(a,this.defaultStyle);for(var b=this.rules,c,d,e=0,f=b.length;e<f;e++){c=b[e].symbolizer;for(var g in c)if(d=c[g],"object"==typeof d)this.addPropertyStyles(a,d);else{this.addPropertyStyles(a,
c);break}}return a},addPropertyStyles:function(a,b){var c,d;for(d in b)c=b[d],"string"==typeof c&&c.match(/\$\{\w+\}/)&&(a[d]=!0);return a},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(a){for(var b=OpenLayers.Style.SYMBOLIZER_PREFIXES,c=0,d=b.length;c<d;c++)if(-1!=a.CLASS_NAME.indexOf(b[c]))return b[c]},clone:function(){var a=
OpenLayers.Util.extend({},this);if(this.rules){a.rules=[];for(var b=0,c=this.rules.length;b<c;++b)a.rules.push(this.rules[b].clone())}a.context=this.context&&OpenLayers.Util.extend({},this.context);b=OpenLayers.Util.extend({},this.defaultStyle);return new OpenLayers.Style(b,a)},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(a,b,c,d){"string"==typeof a&&-1!=a.indexOf("${")&&(a=OpenLayers.String.format(a,b,[c,d]),a=isNaN(a)||!a?a:parseFloat(a));return a};
OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text","Raster"];
OpenLayers.Rule=OpenLayers.Class({id:null,name:null,title:null,description:null,context:null,filter:null,elseFilter:!1,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);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(a){var b=
this.getContext(a),c=!0;if(this.minScaleDenominator||this.maxScaleDenominator)var d=a.layer.map.getScale();this.minScaleDenominator&&(c=d>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b));c&&this.maxScaleDenominator&&(c=d<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b));c&&this.filter&&(c="OpenLayers.Filter.FeatureId"==this.filter.CLASS_NAME?this.filter.evaluate(a):this.filter.evaluate(b));return c},getContext:function(a){var b=this.context;b||(b=a.attributes||a.data);"function"==
typeof this.context&&(b=this.context(a));return b},clone:function(){var a=OpenLayers.Util.extend({},this);if(this.symbolizers){var b=this.symbolizers.length;a.symbolizers=Array(b);for(var c=0;c<b;++c)a.symbolizers[c]=this.symbolizers[c].clone()}else{a.symbolizer={};for(var d in this.symbolizer)b=this.symbolizer[d],c=typeof b,"object"===c?a.symbolizer[d]=OpenLayers.Util.extend({},b):"string"===c&&(a.symbolizer[d]=b)}a.filter=this.filter&&this.filter.clone();a.context=this.context&&OpenLayers.Util.extend({},
this.context);return new OpenLayers.Rule(a)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(a){OpenLayers.Util.extend(this,a)},clone:function(){return new (eval(this.CLASS_NAME))(OpenLayers.Util.extend({},this))},CLASS_NAME:"OpenLayers.Symbolizer"});OpenLayers.Symbolizer.Point=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(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.Style2=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a=0,b=this.rules.length;a<b;a++)this.rules[a].destroy();delete this.rules},clone:function(){var a=OpenLayers.Util.extend({},this);if(this.rules){a.rules=[];for(var b=0,c=this.rules.length;b<c;++b)a.rules.push(this.rules[b].clone())}return new OpenLayers.Style2(a)},
CLASS_NAME:"OpenLayers.Style2"});
OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:!1,displayClass:"",title:"",autoActivate:!1,active:null,handlerOptions:null,handler:null,eventListeners:null,events:null,initialize:function(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(null==this.id)this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+
"_")},destroy:function(){if(this.events)this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=null;this.eventListeners=null;if(this.handler)this.handler.destroy(),this.handler=null;if(this.handlers){for(var a in this.handlers)this.handlers.hasOwnProperty(a)&&"function"==typeof this.handlers[a].destroy&&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;this.handler&&
this.handler.setMap(a)},draw:function(a){if(null==this.div){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(null!=a)this.position=a.clone();this.moveTo(this.position);return this.div},moveTo:function(a){if(null!=a&&null!=this.div)this.div.style.left=a.x+"px",this.div.style.top=
a.y+"px"},activate:function(){if(this.active)return!1;this.handler&&this.handler.activate();this.active=!0;this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active");this.events.triggerEvent("activate");return!0},deactivate:function(){return this.active?(this.handler&&this.handler.deactivate(),this.active=!1,this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("deactivate"),
!0):!1},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;
OpenLayers.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 a=[];if(this.map&&this.map.layers){for(var b=0,c=this.map.layers.length;b<c;b++){var d=this.map.layers[b];d.attribution&&d.getVisibility()&&-1===OpenLayers.Util.indexOf(a,d.attribution)&&a.push(d.attribution)}this.div.innerHTML=OpenLayers.String.format(this.template,{layers:a.join(this.separator)})}},CLASS_NAME:"OpenLayers.Control.Attribution"});
OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,multi:!1,featureAdded:function(){},initialize:function(a,b,c){OpenLayers.Control.prototype.initialize.apply(this,[c]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(a,b){this.layer.events.triggerEvent("sketchmodified",{vertex:a,feature:b})},create:function(a,b){this.layer.events.triggerEvent("sketchstarted",{vertex:a,feature:b})}},this.callbacks);this.layer=a;this.handlerOptions=
this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{renderers:a.renderers,rendererOptions:a.rendererOptions});if(!("multi"in this.handlerOptions))this.handlerOptions.multi=this.multi;if(a=this.layer.styleMap&&this.layer.styleMap.styles.temporary)this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":a})});this.handler=new b(this,this.callbacks,
this.handlerOptions)},drawFeature:function(a){a=new OpenLayers.Feature.Vector(a);if(!1!==this.layer.events.triggerEvent("sketchcomplete",{feature:a}))a.state=OpenLayers.State.INSERT,this.layer.addFeatures([a]),this.featureAdded(a),this.events.triggerEvent("featureadded",{feature:a})},insertXY:function(a,b){this.handler&&this.handler.line&&this.handler.insertXY(a,b)},insertDeltaXY:function(a,b){this.handler&&this.handler.line&&this.handler.insertDeltaXY(a,b)},insertDirectionLength:function(a,b){this.handler&&
this.handler.line&&this.handler.insertDirectionLength(a,b)},insertDeflectionLength:function(a,b){this.handler&&this.handler.line&&this.handler.insertDeflectionLength(a,b)},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.Events.buttonclick=OpenLayers.Class({target:null,events:"mousedown,mouseup,click,dblclick,touchstart,touchmove,touchend,keydown".split(","),startRegEx:/^mousedown|touchstart$/,cancelRegEx:/^touchmove$/,completeRegEx:/^mouseup|touchend$/,initialize:function(a){this.target=a;for(a=this.events.length-1;0<=a;--a)this.target.register(this.events[a],this,this.buttonClick,{extension:!0})},destroy:function(){for(var a=this.events.length-1;0<=a;--a)this.target.unregister(this.events[a],this,this.buttonClick);
delete this.target},getPressedButton:function(a){var b=3,c;do{if(OpenLayers.Element.hasClass(a,"olButton")){c=a;break}a=a.parentNode}while(0<--b&&a);return c},ignore:function(a){var b=3,c=!1;do{if("a"===a.nodeName.toLowerCase()){c=!0;break}a=a.parentNode}while(0<--b&&a);return c},buttonClick:function(a){var b=!0,c=OpenLayers.Event.element(a);if(c&&(OpenLayers.Event.isLeftClick(a)||!~a.type.indexOf("mouse")))if(c=this.getPressedButton(c)){if("keydown"===a.type)switch(a.keyCode){case OpenLayers.Event.KEY_RETURN:case OpenLayers.Event.KEY_SPACE:this.target.triggerEvent("buttonclick",
{buttonElement:c}),OpenLayers.Event.stop(a),b=!1}else if(this.startEvt){if(this.completeRegEx.test(a.type)){var b=OpenLayers.Util.pagePosition(c),d=OpenLayers.Util.getViewportElement(),e=window.pageYOffset||d.scrollTop;b[0]-=window.pageXOffset||d.scrollLeft;b[1]-=e;this.target.triggerEvent("buttonclick",{buttonElement:c,buttonXY:{x:this.startEvt.clientX-b[0],y:this.startEvt.clientY-b[1]}})}this.cancelRegEx.test(a.type)&&delete this.startEvt;OpenLayers.Event.stop(a);b=!1}if(this.startRegEx.test(a.type))this.startEvt=
a,OpenLayers.Event.stop(a),b=!1}else b=!this.ignore(OpenLayers.Event.element(a)),delete this.startEvt;return b}});
OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,autoActivate:!0,defaultControl:null,saveState:!1,allowDepress:!1,activeState:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.controls=[];this.activeState={}},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onButtonClick);OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var a,b=this.controls.length-1;0<=b;b--)a=this.controls[b],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)){for(var a,b=0,c=this.controls.length;b<c;b++)a=this.controls[b],(a===this.defaultControl||this.saveState&&this.activeState[a.id])&&a.activate();if(!0===this.saveState)this.defaultControl=null;this.redraw();return!0}return!1},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var a,
b=0,c=this.controls.length;b<c;b++)a=this.controls[b],this.activeState[a.id]=a.deactivate();this.redraw();return!0}return!1},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.outsideViewport?(this.events.attachToElement(this.div),this.events.register("buttonclick",this,this.onButtonClick)):this.map.events.register("buttonclick",this,this.onButtonClick);this.addControlsToMap(this.controls);return this.div},redraw:function(){for(var a=this.div.childNodes.length-1;0<=a;a--)this.div.removeChild(this.div.childNodes[a]);
this.div.innerHTML="";if(this.active)for(var a=0,b=this.controls.length;a<b;a++)this.div.appendChild(this.controls[a].panel_div)},activateControl:function(a){if(!this.active)return!1;if(a.type==OpenLayers.Control.TYPE_BUTTON)a.trigger();else if(a.type==OpenLayers.Control.TYPE_TOGGLE)a.active?a.deactivate():a.activate();else if(this.allowDepress&&a.active)a.deactivate();else{for(var b,c=0,d=this.controls.length;c<d;c++)b=this.controls[c],b!=a&&(b.type===OpenLayers.Control.TYPE_TOOL||null==b.type)&&
b.deactivate();a.activate()}},addControls:function(a){OpenLayers.Util.isArray(a)||(a=[a]);this.controls=this.controls.concat(a);for(var b=0,c=a.length;b<c;b++){var d=a[b],e=this.createControlMarkup(d);OpenLayers.Element.addClass(e,d.displayClass+"ItemInactive");OpenLayers.Element.addClass(e,"olButton");if(""!=d.title&&!e.title)e.title=d.title;d.panel_div=e}this.map&&(this.addControlsToMap(a),this.redraw())},createControlMarkup:function(){return document.createElement("div")},addControlsToMap:function(a){for(var b,
c=0,d=a.length;c<d;c++)b=a[c],!0===b.autoActivate?(b.autoActivate=!1,this.map.addControl(b),b.autoActivate=!0):(this.map.addControl(b),b.deactivate()),b.events.on({activate:this.iconOn,deactivate:this.iconOff})},iconOn:function(){var a=this.panel_div;a.className=a.className.replace(RegExp("\\b("+this.displayClass+"Item)Inactive\\b"),"$1Active")},iconOff:function(){var a=this.panel_div;a.className=a.className.replace(RegExp("\\b("+this.displayClass+"Item)Active\\b"),"$1Inactive")},onButtonClick:function(a){for(var b=
this.controls,a=a.buttonElement,c=b.length-1;0<=c;--c)if(b[c].panel_div===a){this.activateControl(b[c]);break}},getControlsBy:function(a,b){var c="function"==typeof b.test;return OpenLayers.Array.filter(this.controls,function(d){return d[a]==b||c&&b.test(d[a])})},getControlsByName:function(a){return this.getControlsBy("name",a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},CLASS_NAME:"OpenLayers.Control.Panel"});
OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});
OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomToMaxExtent()},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(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.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:!1,evt:null,touch:!1,initialize:function(a,b,c){OpenLayers.Util.extend(this,c);this.control=a;this.callbacks=b;(a=this.map||a.map)&&this.setMap(a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){return null==this.keyMask?!0:((a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT:
0)|(a.metaKey?OpenLayers.Handler.MOD_META:0))==this.keyMask},activate:function(){if(this.active)return!1;for(var a=OpenLayers.Events.prototype.BROWSER_EVENTS,b=0,c=a.length;b<c;b++)this[a[b]]&&this.register(a[b],this[a[b]]);return this.active=!0},deactivate:function(){if(!this.active)return!1;for(var a=OpenLayers.Events.prototype.BROWSER_EVENTS,b=0,c=a.length;b<c;b++)this[a[b]]&&this.unregister(a[b],this[a[b]]);this.active=this.touch=!1;return!0},startTouch:function(){if(!this.touch){this.touch=!0;
for(var a="mousedown,mouseup,mousemove,click,dblclick,mouseout".split(","),b=0,c=a.length;b<c;b++)this[a[b]]&&this.unregister(a[b],this[a[b]])}},callback:function(a,b){a&&this.callbacks[a]&&this.callbacks[a].apply(this.control,b)},register:function(a,b){this.map.events.registerPriority(a,this,b);this.map.events.registerPriority(a,this,this.setEvent)},unregister:function(a,b){this.map.events.unregister(a,this,b);this.map.events.unregister(a,this,this.setEvent)},setEvent:function(a){this.evt=a;return!0},
destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Handler.MOD_META=8;
OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!0,dragging:!1,last:null,start:null,lastMoveEvt:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:!1,documentEvents:null,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(!0===this.documentDrag){var d=this;this._docMove=function(a){d.mousemove({xy:{x:a.clientX,y:a.clientY},element:document})};this._docUp=function(a){d.mouseup({xy:{x:a.clientX,y:a.clientY}})}}},
dragstart:function(a){var b=!0;this.dragging=!1;if(this.checkModifiers(a)&&(OpenLayers.Event.isLeftClick(a)||OpenLayers.Event.isSingleTouch(a))){this.started=!0;this.last=this.start=a.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(a);this.callback("down",[a.xy]);OpenLayers.Event.preventDefault(a);if(!this.oldOnselectstart)this.oldOnselectstart=document.onselectstart?document.onselectstart:OpenLayers.Function.True;document.onselectstart=OpenLayers.Function.False;b=!this.stopDown}else this.started=
!1,this.last=this.start=null;return b},dragmove:function(a){this.lastMoveEvt=a;if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)){!0===this.documentDrag&&this.documentEvents&&(a.element===document?(this.adjustXY(a),this.setEvent(a)):this.removeDocumentEvents());if(0<this.interval)this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval);this.dragging=!0;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!0},dragend:function(a){if(this.started){!0===this.documentDrag&&this.documentEvents&&(this.adjustXY(a),this.removeDocumentEvents());var b=this.start!=this.last;this.dragging=this.started=!1;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(a);this.callback("up",[a.xy]);b&&this.callback("done",[a.xy]);document.onselectstart=this.oldOnselectstart}return!0},down:function(){},move:function(){},
up:function(){},out:function(){},mousedown:function(a){return this.dragstart(a)},touchstart:function(a){this.startTouch();return this.dragstart(a)},mousemove:function(a){return this.dragmove(a)},touchmove:function(a){return this.dragmove(a)},removeTimeout:function(){this.timeoutId=null;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(a){if(this.started&&OpenLayers.Util.mouseLeft(a,
this.map.viewPortDiv))if(!0===this.documentDrag)this.addDocumentEvents();else{var b=this.start!=this.last;this.dragging=this.started=!1;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(a);this.callback("out",[]);b&&this.callback("done",[a.xy]);if(document.onselectstart)document.onselectstart=this.oldOnselectstart}return!0},click:function(){return this.start==this.last},activate:function(){var a=!1;if(OpenLayers.Handler.prototype.activate.apply(this,arguments))this.dragging=
!1,a=!0;return a},deactivate:function(){var a=!1;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments))this.dragging=this.started=!1,this.last=this.start=null,a=!0,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=!0;OpenLayers.Event.observe(document,"mousemove",
this._docMove);OpenLayers.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown");this.documentEvents=!1;OpenLayers.Event.stopObserving(document,"mousemove",this._docMove);OpenLayers.Event.stopObserving(document,"mouseup",this._docUp)},CLASS_NAME:"OpenLayers.Handler.Drag"});
OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxOffsets:null,initialize:function(a,b,c){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);this.dragHandler&&this.dragHandler.setMap(a)},startBox:function(){this.callback("start",[]);this.zoomBox=OpenLayers.Util.createDiv("zoomBox",{x:-9999,y:-9999});this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(a){var b=this.dragHandler.start.x,
c=this.dragHandler.start.y,d=Math.abs(b-a.x),e=Math.abs(c-a.y),f=this.getBoxOffsets();this.zoomBox.style.width=d+f.width+1+"px";this.zoomBox.style.height=e+f.height+1+"px";this.zoomBox.style.left=(a.x<b?b-d-f.left:b-f.left)+"px";this.zoomBox.style.top=(a.y<c?c-e-f.top:c-f.top)+"px"},endBox:function(a){var b;if(5<Math.abs(this.dragHandler.start.x-a.x)||5<Math.abs(this.dragHandler.start.y-a.y)){var c=this.dragHandler.start;b=Math.min(c.y,a.y);var d=Math.max(c.y,a.y),e=Math.min(c.x,a.x),a=Math.max(c.x,
a.x);b=new OpenLayers.Bounds(e,d,a,b)}else b=this.dragHandler.start.clone();this.removeBox();this.callback("done",[b])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.boxOffsets=this.zoomBox=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){return OpenLayers.Handler.prototype.activate.apply(this,arguments)?(this.dragHandler.activate(),!0):!1},deactivate:function(){return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)?
(this.dragHandler.deactivate()&&this.zoomBox&&this.removeBox(),!0):!1},getBoxOffsets:function(){if(!this.boxOffsets){var a=document.createElement("div");a.style.position="absolute";a.style.border="1px solid black";a.style.width="3px";document.body.appendChild(a);var b=3==a.clientWidth;document.body.removeChild(a);var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width")),c=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width")),d=parseInt(OpenLayers.Element.getStyle(this.zoomBox,
"border-top-width")),e=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"));this.boxOffsets={left:a,right:c,top:d,bottom:e,width:!1===b?a+c:0,height:!1===b?d+e:0}}return this.boxOffsets},CLASS_NAME:"OpenLayers.Handler.Box"});
OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:!1,keyMask:null,alwaysZoom:!1,zoomOnClick:!0,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(a){if(a instanceof OpenLayers.Bounds){var b,c=a.getCenterPixel();if(this.out){b=Math.min(this.map.size.h/(a.bottom-a.top),this.map.size.w/(a.right-a.left));var d=this.map.getExtent(),e=this.map.getLonLatFromPixel(c),f=e.lon-d.getWidth()/
2*b,a=e.lon+d.getWidth()/2*b,g=e.lat-d.getHeight()/2*b;b=e.lat+d.getHeight()/2*b;b=new OpenLayers.Bounds(f,g,a,b)}else f=this.map.getLonLatFromPixel({x:a.left,y:a.bottom}),a=this.map.getLonLatFromPixel({x:a.right,y:a.top}),b=new OpenLayers.Bounds(f.lon,f.lat,a.lon,a.lat);f=this.map.getZoom();g=this.map.getSize();a=g.w/2;g=g.h/2;b=this.map.getZoomForExtent(b);d=this.map.getResolution();e=this.map.getResolutionForZoom(b);d==e?this.map.setCenter(this.map.getLonLatFromPixel(c)):this.map.zoomTo(b,{x:(d*
c.x-e*a)/(d-e),y:(d*c.y-e*g)/(d-e)});f==this.map.getZoom()&&!0==this.alwaysZoom&&this.map.zoomTo(f+(this.out?-1:1))}else this.zoomOnClick&&(this.out?this.map.zoomTo(this.map.getZoom()-1,a):this.map.zoomTo(this.map.getZoom()+1,a))},CLASS_NAME:"OpenLayers.Control.ZoomBox"});
OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:!1,interval:0,documentDrag:!1,kinetic:null,enableKinetic:!0,kineticInterval:10,draw:function(){if(this.enableKinetic&&OpenLayers.Kinetic){var a={interval:this.kineticInterval};"object"===typeof this.enableKinetic&&(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(){this.kinetic&&this.kinetic.begin()},panMap:function(a){this.kinetic&&this.kinetic.update(a);this.panned=!0;this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:!0,animate:!1})},panMapDone:function(a){if(this.panned){var b=null;this.kinetic&&(b=this.kinetic.end(a));this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:!!b,animate:!1});if(b){var c=this;this.kinetic.move(b,function(a,b,
f){c.map.pan(a,b,{dragging:!f,animate:!1})})}this.panned=!1}},CLASS_NAME:"OpenLayers.Control.DragPan"});
OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,interval:0,maxDelta:Number.POSITIVE_INFINITY,delta:0,cumulative:!0,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(a){if(this.map&&this.checkModifiers(a)){for(var b=
!1,c=!1,d=!1,e=OpenLayers.Event.element(a);null!=e&&!d&&!b;){if(!b)try{var f,b=(f=e.currentStyle?e.currentStyle.overflow:document.defaultView.getComputedStyle(e,null).getPropertyValue("overflow"))&&"auto"==f||"scroll"==f}catch(g){}if(!c&&(c=OpenLayers.Element.hasClass(e,"olScrollable"),!c))for(var d=0,h=this.map.layers.length;d<h;d++){var j=this.map.layers[d];if(e==j.div||e==j.pane){c=!0;break}}d=e==this.map.div;e=e.parentNode}if(!b&&d){if(c)if(b=0,a.wheelDelta?(b=a.wheelDelta,0===b%160&&(b*=0.75),
b/=120):a.detail&&(b=-(a.detail/Math.abs(a.detail))),this.delta+=b,window.clearTimeout(this._timeoutId),this.interval&&Math.abs(this.delta)<this.maxDelta){var k=OpenLayers.Util.extend({},a);this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(k)},this),this.interval)}else this.wheelZoom(a);OpenLayers.Event.stop(a)}}},wheelZoom:function(a){var b=this.delta;this.delta=0;if(b)a.xy=this.map.events.getMousePosition(a),0>b?this.callback("down",[a,this.cumulative?Math.max(-this.maxDelta,
b):-1]):this.callback("up",[a,this.cumulative?Math.min(this.maxDelta,b):1])},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!0}return!1},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!0}return!1},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});
OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:!0,"double":!1,pixelTolerance:0,dblclickTolerance:13,stopSingle:!1,stopDouble:!1,timerId:null,down:null,last:null,first:null,rightclickTimerId:null,touchstart:function(a){this.startTouch();this.down=this.getEventInfo(a);this.last=this.getEventInfo(a);return!0},touchmove:function(a){this.last=this.getEventInfo(a);return!0},touchend:function(a){if(this.down)a.xy=this.last.xy,a.lastTouches=this.last.touches,this.handleSingle(a),
this.down=null;return!0},mousedown:function(a){this.down=this.getEventInfo(a);this.last=this.getEventInfo(a);return!0},mouseup:function(a){var b=!0;this.checkModifiers(a)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(a)&&(b=this.rightclick(a));return b},rightclick:function(a){if(this.passesTolerance(a)){if(null!=this.rightclickTimerId)return this.clearTimer(),this.callback("dblrightclick",[a]),!this.stopDouble;a=this["double"]?OpenLayers.Util.extend({},a):this.callback("rightclick",
[a]);a=OpenLayers.Function.bind(this.delayedRightCall,this,a);this.rightclickTimerId=window.setTimeout(a,this.delay)}return!this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;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){this.passesDblclickTolerance(a)&&(this["double"]&&this.callback("dblclick",
[a]),this.clearTimer())},handleSingle:function(a){if(this.passesTolerance(a))null!=this.timerId?(this.last.touches&&1===this.last.touches.length&&(this["double"]&&OpenLayers.Event.preventDefault(a),this.handleDouble(a)),(!this.last.touches||2!==this.last.touches.length)&&this.clearTimer()):(this.first=this.getEventInfo(a),this.queuePotentialClick(this.single?OpenLayers.Util.extend({},a):null))},queuePotentialClick:function(a){this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,
this,a),this.delay)},passesTolerance:function(a){var b=!0;if(null!=this.pixelTolerance&&this.down&&this.down.xy&&(b=this.pixelTolerance>=this.down.xy.distanceTo(a.xy))&&this.touch&&this.down.touches.length===this.last.touches.length)for(var a=0,c=this.down.touches.length;a<c;++a)if(this.getTouchDistance(this.down.touches[a],this.last.touches[a])>this.pixelTolerance){b=!1;break}return b},getTouchDistance:function(a,b){return Math.sqrt(Math.pow(a.clientX-b.clientX,2)+Math.pow(a.clientY-b.clientY,2))},
passesDblclickTolerance:function(){var a=!0;this.down&&this.first&&(a=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance);return a},clearTimer:function(){if(null!=this.timerId)window.clearTimeout(this.timerId),this.timerId=null;if(null!=this.rightclickTimerId)window.clearTimeout(this.rightclickTimerId),this.rightclickTimerId=null},delayedCall:function(a){this.timerId=null;a&&this.callback("click",[a])},getEventInfo:function(a){var b;if(a.touches){var c=a.touches.length;b=Array(c);for(var d,
e=0;e<c;e++)d=a.touches[e],b[e]={clientX:d.olClientX,clientY:d.olClientY}}return{xy:a.xy,touches:b}},deactivate:function(){var a=!1;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments))this.clearTimer(),this.last=this.first=this.down=null,a=!0;return a},CLASS_NAME:"OpenLayers.Handler.Click"});
OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,documentDrag:!1,zoomBox:null,zoomBoxEnabled:!0,zoomWheelEnabled:!0,mouseWheelOptions:null,handleRightClicks:!1,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,autoActivate:!0,initialize:function(a){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();this.dragPan&&this.dragPan.destroy();this.dragPan=null;
this.zoomBox&&this.zoomBox.destroy();this.zoomBox=null;this.pinchZoom&&this.pinchZoom.destroy();this.pinchZoom=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();this.zoomWheelEnabled&&this.handlers.wheel.activate();this.handlers.click.activate();this.zoomBoxEnabled&&this.zoomBox.activate();this.pinchZoom&&this.pinchZoom.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){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;this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.defaultClick,dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick},{"double":!0,stopDouble:!0});this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,
documentDrag:this.documentDrag},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},OpenLayers.Util.extend(this.map.fractionalZoom?{}:{cumulative:!1,interval:50,maxDelta:6},this.mouseWheelOptions));if(OpenLayers.Control.PinchZoom)this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},
this.pinchZoomOptions))},defaultClick:function(a){a.lastTouches&&2==a.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(a){this.map.zoomTo(this.map.zoom+1,a.xy)},defaultDblRightClick:function(a){this.map.zoomTo(this.map.zoom-1,a.xy)},wheelChange:function(a,b){this.map.fractionalZoom||(b=Math.round(b));var c=this.map.getZoom(),d;d=Math.max(c+b,0);d=Math.min(d,this.map.getNumZoomLevels());d!==c&&this.map.zoomTo(d,a.xy)},wheelUp:function(a,b){this.wheelChange(a,b||1)},wheelDown:function(a,
b){this.wheelChange(a,b||-1)},disableZoomBox:function(){this.zoomBoxEnabled=!1;this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=!0;this.active&&this.zoomBox.activate()},disableZoomWheel:function(){this.zoomWheelEnabled=!1;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=!0;this.active&&this.handlers.wheel.activate()},CLASS_NAME:"OpenLayers.Control.Navigation"});
OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control.Button,{slideFactor:50,slideRatio:null,direction:null,initialize:function(a,b){this.direction=a;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[b])},trigger:function(){if(this.map){var a=OpenLayers.Function.bind(function(a){return this.slideRatio?this.map.getSize()[a]*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)}}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";
OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{slideFactor:50,slideRatio:null,initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);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.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop)this.eTop=document.createElement("div"),this.eTop.className=this.displayClass+"Top",this.div.appendChild(this.eTop),this.eTop.style.visibility=""==this.topOutUnits||""==this.topInUnits?"hidden":"visible",this.eBottom=document.createElement("div"),
this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),this.eBottom.style.visibility=""==this.bottomOutUnits||""==this.bottomInUnits?"hidden":"visible";this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(a){var b=parseInt(Math.log(a)/Math.log(10)),b=Math.pow(10,b),a=parseInt(a/b);return(5<a?5:2<a?2:1)*b},update:function(){var a=this.map.getResolution();if(a){var b=this.map.getUnits(),c=OpenLayers.INCHES_PER_UNIT,d=this.maxWidth*
a*c[b],e=1;!0===this.geodesic&&(e=(this.map.getGeodesicPixelSize().w||1.0E-6)*this.maxWidth/(d/c.km),d*=e);var f,g;1E5<d?(f=this.topOutUnits,g=this.bottomOutUnits):(f=this.topInUnits,g=this.bottomInUnits);var h=d/c[f],j=d/c[g],d=this.getBarLen(h),k=this.getBarLen(j),h=d/c[b]*c[f],j=k/c[b]*c[g],b=h/a/e,a=j/a/e;if("visible"==this.eBottom.style.visibility)this.eBottom.style.width=Math.round(a)+"px",this.eBottom.innerHTML=k+" "+g;if("visible"==this.eTop.style.visibility)this.eTop.style.width=Math.round(b)+
"px",this.eTop.innerHTML=d+" "+f}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});
OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null},touchstart:{"in":"click",out:"clickout"}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:!0,stopDown:!0,stopUp:!1,initialize:function(a,b,c,d){OpenLayers.Handler.prototype.initialize.apply(this,[a,c,d]);this.layer=
b},touchstart:function(a){this.startTouch();return OpenLayers.Event.isMultiTouch(a)?!0:this.mousedown(a)},touchmove:function(a){OpenLayers.Event.preventDefault(a)},mousedown:function(a){if(OpenLayers.Event.isLeftClick(a)||OpenLayers.Event.isSingleTouch(a))this.down=a.xy;return this.handle(a)?!this.stopDown:!0},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:!0},click:function(a){return this.handle(a)?!this.stopClick:!0},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out)return!0;
this.handle(a);return!0},dblclick:function(a){return!this.handle(a)},geometryTypeMatches:function(a){return null==this.geometryTypes||-1<OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)},handle:function(a){if(this.feature&&!this.feature.layer)this.feature=null;var b=a.type,c=!1,d=!!this.feature,e="click"==b||"dblclick"==b||"touchstart"==b;if((this.feature=this.layer.getFeatureFromEvent(a))&&!this.feature.layer)this.feature=null;if(this.lastFeature&&!this.lastFeature.layer)this.lastFeature=
null;this.feature?("touchstart"===b&&OpenLayers.Event.preventDefault(a),a=this.feature!=this.lastFeature,this.geometryTypeMatches(this.feature)?(d&&a?(this.lastFeature&&this.triggerCallback(b,"out",[this.lastFeature]),this.triggerCallback(b,"in",[this.feature])):(!d||e)&&this.triggerCallback(b,"in",[this.feature]),this.lastFeature=this.feature,c=!0):(this.lastFeature&&(d&&a||e)&&this.triggerCallback(b,"out",[this.lastFeature]),this.feature=null)):this.lastFeature&&(d||e)&&this.triggerCallback(b,"out",
[this.lastFeature]);return c},triggerCallback:function(a,b,c){if(b=this.EVENTMAP[a][b])"click"==a&&this.up&&this.down?(Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2))<=this.clickTolerance&&this.callback(b,c),this.up=this.down=null):this.callback(b,c)},activate:function(){var a=!1;OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),a=!0);
return a},deactivate:function(){var a=!1;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments))this.moveLayerBack(),this.up=this.down=this.lastFeature=this.feature=null,this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),a=!0;return a},handleMapEvents:function(a){("removelayer"==a.type||"order"==a.property)&&this.moveLayerToTop()},moveLayerToTop:function(){this.layer.setZIndex(Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+
1)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;a>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(a):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Handler.Feature"});
OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:1,alwaysInRange:null,RESOLUTION_PROPERTIES:"scales,resolutions,maxScale,minScale,maxResolution,minResolution,numZoomLevels,maxZoomLevel".split(","),events:null,map:null,isBaseLayer:!1,alpha:!1,displayInLayerSwitcher:!0,visibility:!0,attribution:null,inRange:!1,imageSize:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,
numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:!1,wrapDateLine:!1,metadata:null,initialize:function(a,b){this.metadata={};b=OpenLayers.Util.extend({},b);if(null!=this.alwaysInRange)b.alwaysInRange=this.alwaysInRange;this.addOptions(b);this.name=a;if(null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"),this.div=OpenLayers.Util.createDiv(this.id),this.div.style.width="100%",this.div.style.height="100%",this.div.dir="ltr",this.events=new OpenLayers.Events(this,
this.div),this.eventListeners instanceof Object))this.events.on(this.eventListeners)},destroy:function(a){null==a&&(a=!0);null!=this.map&&this.map.removeLayer(this,a);this.options=this.div=this.name=this.map=this.projection=null;this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy());this.events=this.eventListeners=null},clone:function(a){null==a&&(a=new OpenLayers.Layer(this.name,this.getOptions()));OpenLayers.Util.applyDefaults(a,this);a.map=null;return a},
getOptions:function(){var a={},b;for(b in this.options)a[b]=this[b];return a},setName:function(a){if(a!=this.name)this.name=a,null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})},addOptions:function(a,b){if(null==this.options)this.options={};if(a){if("string"==typeof a.projection)a.projection=new OpenLayers.Projection(a.projection);a.projection&&OpenLayers.Util.applyDefaults(a,OpenLayers.Projection.defaults[a.projection.getCode()]);if(a.maxExtent&&!(a.maxExtent instanceof
OpenLayers.Bounds))a.maxExtent=new OpenLayers.Bounds(a.maxExtent);if(a.minExtent&&!(a.minExtent instanceof OpenLayers.Bounds))a.minExtent=new OpenLayers.Bounds(a.minExtent)}OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a);if(this.projection&&this.projection.getUnits())this.units=this.projection.getUnits();if(this.map){var c=this.map.getResolution(),d=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]),e;for(e in a)if(a.hasOwnProperty(e)&&0<=OpenLayers.Util.indexOf(d,
e)){this.initResolutions();b&&this.map.baseLayer===this&&(this.map.setCenter(this.map.getCenter(),this.map.getZoomForResolution(c),!1,!0),this.map.events.triggerEvent("changebaselayer",{layer:this}));break}}},onMapResize:function(){},redraw:function(){var a=!1;if(this.map){this.inRange=this.calculateInRange();var b=this.getExtent();b&&this.inRange&&this.visibility&&(this.moveTo(b,!0,!1),this.events.triggerEvent("moveend",{zoomChanged:!0}),a=!0)}return a},moveTo:function(){var a=this.visibility;this.isBaseLayer||
(a=a&&this.inRange);this.display(a)},moveByPx:function(){},setMap:function(a){if(null==this.map){this.map=a;this.maxExtent=this.maxExtent||this.map.maxExtent;this.minExtent=this.minExtent||this.map.minExtent;this.projection=this.projection||this.map.projection;if("string"==typeof this.projection)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(),
this.div.style.display=this.visibility&&this.inRange?"":"none";this.setTileSize()}},afterAdd:function(){},removeMap:function(){},getImageSize:function(){return this.imageSize||this.tileSize},setTileSize:function(a){this.tileSize=a=a?a:this.tileSize?this.tileSize:this.map.getTileSize();if(this.gutter)this.imageSize=new OpenLayers.Size(a.w+2*this.gutter,a.h+2*this.gutter)},getVisibility:function(){return this.visibility},setVisibility:function(a){if(a!=this.visibility)this.visibility=a,this.display(a),
this.redraw(),null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"}),this.events.triggerEvent("visibilitychanged")},display:function(a){if(a!=("none"!=this.div.style.display))this.div.style.display=a&&this.calculateInRange()?"block":"none"},calculateInRange:function(){var a=!1;this.alwaysInRange?a=!0:this.map&&(a=this.map.getResolution(),a=a>=this.minResolution&&a<=this.maxResolution);return a},setIsBaseLayer:function(a){if(a!=this.isBaseLayer)this.isBaseLayer=
a,null!=this.map&&this.map.events.triggerEvent("changebaselayer",{layer:this})},initResolutions:function(){var a,b,c,d={},e=!0;for(a=0,b=this.RESOLUTION_PROPERTIES.length;a<b;a++)c=this.RESOLUTION_PROPERTIES[a],d[c]=this.options[c],e&&this.options[c]&&(e=!1);if(null==this.options.alwaysInRange)this.alwaysInRange=e;if(null==d.resolutions)d.resolutions=this.resolutionsFromScales(d.scales);if(null==d.resolutions)d.resolutions=this.calculateResolutions(d);if(null==d.resolutions){for(a=0,b=this.RESOLUTION_PROPERTIES.length;a<
b;a++)c=this.RESOLUTION_PROPERTIES[a],d[c]=null!=this.options[c]?this.options[c]:this.map[c];if(null==d.resolutions)d.resolutions=this.resolutionsFromScales(d.scales);if(null==d.resolutions)d.resolutions=this.calculateResolutions(d)}var f;if(this.options.maxResolution&&"auto"!==this.options.maxResolution)f=this.options.maxResolution;this.options.minScale&&(f=OpenLayers.Util.getResolutionFromScale(this.options.minScale,this.units));var g;if(this.options.minResolution&&"auto"!==this.options.minResolution)g=
this.options.minResolution;this.options.maxScale&&(g=OpenLayers.Util.getResolutionFromScale(this.options.maxScale,this.units));d.resolutions&&(d.resolutions.sort(function(a,b){return b-a}),f||(f=d.resolutions[0]),g||(g=d.resolutions[d.resolutions.length-1]));if(this.resolutions=d.resolutions){b=this.resolutions.length;this.scales=Array(b);for(a=0;a<b;a++)this.scales[a]=OpenLayers.Util.getScaleFromResolution(this.resolutions[a],this.units);this.numZoomLevels=b}if(this.minResolution=g)this.maxScale=
OpenLayers.Util.getScaleFromResolution(g,this.units);if(this.maxResolution=f)this.minScale=OpenLayers.Util.getScaleFromResolution(f,this.units)},resolutionsFromScales:function(a){if(null!=a){var b,c,d;d=a.length;b=Array(d);for(c=0;c<d;c++)b[c]=OpenLayers.Util.getResolutionFromScale(a[c],this.units);return b}},calculateResolutions:function(a){var b,c,d=a.maxResolution;null!=a.minScale?d=OpenLayers.Util.getResolutionFromScale(a.minScale,this.units):"auto"==d&&null!=this.maxExtent&&(b=this.map.getSize(),
c=this.maxExtent.getWidth()/b.w,b=this.maxExtent.getHeight()/b.h,d=Math.max(c,b));c=a.minResolution;null!=a.maxScale?c=OpenLayers.Util.getResolutionFromScale(a.maxScale,this.units):"auto"==a.minResolution&&null!=this.minExtent&&(b=this.map.getSize(),c=this.minExtent.getWidth()/b.w,b=this.minExtent.getHeight()/b.h,c=Math.max(c,b));"number"!==typeof d&&"number"!==typeof c&&null!=this.maxExtent&&(d=this.map.getTileSize(),d=Math.max(this.maxExtent.getWidth()/d.w,this.maxExtent.getHeight()/d.h));b=a.maxZoomLevel;
a=a.numZoomLevels;"number"===typeof c&&"number"===typeof d&&void 0===a?a=Math.floor(Math.log(d/c)/Math.log(2))+1:void 0===a&&null!=b&&(a=b+1);if(!("number"!==typeof a||0>=a||"number"!==typeof d&&"number"!==typeof c)){b=Array(a);var e=2;"number"==typeof c&&"number"==typeof d&&(e=Math.pow(d/c,1/(a-1)));var f;if("number"===typeof d)for(f=0;f<a;f++)b[f]=d/Math.pow(e,f);else for(f=0;f<a;f++)b[a-1-f]=c*Math.pow(e,f);return b}},getResolution:function(){return this.getResolutionForZoom(this.map.getZoom())},
getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(a,b){var c=this.map.getSize();return this.getZoomForResolution(Math.max(a.getWidth()/c.w,a.getHeight()/c.h),b)},getDataExtent:function(){},getResolutionForZoom:function(a){a=Math.max(0,Math.min(a,this.resolutions.length-1));if(this.map.fractionalZoom)var b=Math.floor(a),c=Math.ceil(a),a=this.resolutions[b]-(a-b)*(this.resolutions[b]-this.resolutions[c]);else a=this.resolutions[Math.round(a)];return a},getZoomForResolution:function(a,
b){var c,d;if(this.map.fractionalZoom){var e=0,f=this.resolutions[e],g=this.resolutions[this.resolutions.length-1],h;for(c=0,d=this.resolutions.length;c<d;++c)if(h=this.resolutions[c],h>=a&&(f=h,e=c),h<=a){g=h;break}c=f-g;c=0<c?e+(f-a)/c:e}else{f=Number.POSITIVE_INFINITY;for(c=0,d=this.resolutions.length;c<d;c++)if(b){e=Math.abs(this.resolutions[c]-a);if(e>f)break;f=e}else if(this.resolutions[c]<a)break;c=Math.max(0,c-1)}return c},getLonLatFromViewPortPx:function(a){var b=null,c=this.map;if(null!=
a&&c.minPx){var b=c.getResolution(),d=c.getMaxExtent({restricted:!0}),b=new OpenLayers.LonLat((a.x-c.minPx.x)*b+d.left,(c.minPx.y-a.y)*b+d.top);this.wrapDateLine&&(b=b.wrapDateLine(this.maxExtent))}return b},getViewPortPxFromLonLat:function(a,b){var c=null;null!=a&&(b=b||this.map.getResolution(),c=this.map.calculateBounds(null,b),c=new OpenLayers.Pixel(1/b*(a.lon-c.left),1/b*(c.top-a.lat)));return c},setOpacity:function(a){if(a!=this.opacity){this.opacity=a;for(var b=this.div.childNodes,c=0,d=b.length;c<
d;++c){var e=b[c].firstChild||b[c],f=b[c].lastChild;if(f&&"iframe"===f.nodeName.toLowerCase())e=f.parentNode;OpenLayers.Util.modifyDOMElement(e,null,null,null,null,null,null,a)}null!=this.map&&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(a){if(this.gutter)var b=this.gutter*this.map.getResolution(),a=new OpenLayers.Bounds(a.left-b,a.bottom-b,a.right+
b,a.top+b);this.wrapDateLine&&(b={rightTolerance:this.getResolution(),leftTolerance:this.getResolution()},a=a.wrapDateLine(this.maxExtent,b));return a},CLASS_NAME:"OpenLayers.Layer"});
OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:!1,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.map=this.resolution=this.size=this.extent=this.container=null},supported:function(){return!1},setExtent:function(a,b){this.extent=a.clone();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var c=a.getWidth()/this.map.getExtent().getWidth(),
a=a.scale(1/c);this.extent=a.wrapDateLine(this.map.getMaxExtent()).scale(c)}if(b)this.resolution=null;return!0},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){return this.resolution=this.resolution||this.map.getResolution()},drawFeature:function(a,b){if(null==b)b=a.style;if(a.geometry){var c=a.geometry.getBounds();if(c){var d;this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(d=this.map.getMaxExtent());c.intersectsBounds(this.extent,{worldBounds:d})?this.calculateFeatureDx(c,
d):b={display:"none"};c=this.drawGeometry(a.geometry,b,a.id);if("none"!=b.display&&b.label&&!1!==c){d=a.geometry.getCentroid();if(b.labelXOffset||b.labelYOffset){var e=isNaN(b.labelXOffset)?0:b.labelXOffset,f=isNaN(b.labelYOffset)?0:b.labelYOffset,g=this.getResolution();d.move(e*g,f*g)}this.drawText(a.id,b,d)}else this.removeText(a.id);return c}}},calculateFeatureDx:function(a,b){this.featureDx=0;if(b){var c=b.getWidth();this.featureDx=Math.round(((a.left+a.right)/2-(this.extent.left+this.extent.right)/
2)/c)*c}},drawGeometry:function(){},drawText:function(){},removeText:function(){},clear:function(){},getFeatureIdFromEvent:function(){},eraseFeatures:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=0,c=a.length;b<c;++b){var d=a[b];this.eraseGeometry(d.geometry,d.id);this.removeText(d.id)}},eraseGeometry:function(){},moveRoot:function(){},getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(a){var b=OpenLayers.Util.extend({},OpenLayers.Renderer.defaultSymbolizer);
!1===a.stroke&&(delete b.strokeWidth,delete b.strokeColor);!1===a.fill&&delete b.fillColor;OpenLayers.Util.extend(b,a);return b},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.StyleMap=OpenLayers.Class({styles:null,extendDefault:!0,initialize:function(a,b){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(a instanceof OpenLayers.Style)this.styles["default"]=a,this.styles.select=a,this.styles.temporary=a,this.styles["delete"]=
a;else if("object"==typeof a)for(var c in a)if(a[c]instanceof OpenLayers.Style)this.styles[c]=a[c];else if("object"==typeof a[c])this.styles[c]=new OpenLayers.Style(a[c]);else{this.styles["default"]=new OpenLayers.Style(a);this.styles.select=new OpenLayers.Style(a);this.styles.temporary=new OpenLayers.Style(a);this.styles["delete"]=new OpenLayers.Style(a);break}OpenLayers.Util.extend(this,b)},destroy:function(){for(var a in this.styles)this.styles[a].destroy();this.styles=null},createSymbolizer:function(a,
b){a||(a=new OpenLayers.Feature.Vector);this.styles[b]||(b="default");a.renderIntent=b;var c={};this.extendDefault&&"default"!=b&&(c=this.styles["default"].createSymbolizer(a));return OpenLayers.Util.extend(c,this.styles[b].createSymbolizer(a))},addUniqueValueRules:function(a,b,c,d){var e=[],f;for(f in c)e.push(new OpenLayers.Rule({symbolizer:c[f],context:d,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:b,value:f})}));this.styles[a].addRules(e)},CLASS_NAME:"OpenLayers.StyleMap"});
OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,isFixed:!1,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:!0,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:!1,ratio:1,initialize:function(a,b){OpenLayers.Layer.prototype.initialize.apply(this,arguments);(!this.renderer||!this.renderer.supported())&&this.assignRenderer();if(!this.renderer||
!this.renderer.supported())this.renderer=null,this.displayError();if(!this.styleMap)this.styleMap=new OpenLayers.StyleMap;this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies)for(var c=0,d=this.strategies.length;c<d;c++)this.strategies[c].setLayer(this)},destroy:function(){if(this.strategies){var a,b,c;for(b=0,c=this.strategies.length;b<c;b++)a=this.strategies[b],a.autoDestroy&&a.destroy();this.strategies=null}if(this.protocol)this.protocol.autoDestroy&&this.protocol.destroy(),
this.protocol=null;this.destroyFeatures();this.unrenderedFeatures=this.selectedFeatures=this.features=null;this.renderer&&this.renderer.destroy();this.drawn=this.geometryType=this.renderer=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){null==a&&(a=new OpenLayers.Layer.Vector(this.name,this.getOptions()));for(var a=OpenLayers.Layer.prototype.clone.apply(this,[a]),b=this.features,c=b.length,d=Array(c),e=0;e<c;++e)d[e]=b[e].clone();a.features=d;return a},refresh:function(a){this.calculateInRange()&&
this.visibility&&this.events.triggerEvent("refresh",a)},assignRenderer:function(){for(var a=0,b=this.renderers.length;a<b;a++){var c=this.renderers[a];if((c="function"==typeof c?c:OpenLayers.Renderer[c])&&c.prototype.supported()){this.renderer=new c(this.div,this.rendererOptions);break}}},displayError:function(){this.reportError&&OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,
arguments);if(this.renderer){this.renderer.map=this.map;var b=this.map.getSize();b.w*=this.ratio;b.h*=this.ratio;this.renderer.setSize(b)}else this.map.removeLayer(this)},afterAdd:function(){if(this.strategies){var a,b,c;for(b=0,c=this.strategies.length;b<c;b++)a=this.strategies[b],a.autoActivate&&a.activate()}},removeMap:function(){this.drawn=!1;if(this.strategies){var a,b,c;for(b=0,c=this.strategies.length;b<c;b++)a=this.strategies[b],a.autoActivate&&a.deactivate()}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,
arguments);var a=this.map.getSize();a.w*=this.ratio;a.h*=this.ratio;this.renderer.setSize(a)},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var d=!0;if(!c){this.renderer.root.style.visibility="hidden";var d=this.map.getSize(),e=d.w,d=d.h,e=e/2*this.ratio-e/2,d=d/2*this.ratio-d/2,e=e+this.map.layerContainerOriginPx.x,e=-Math.round(e),d=d+this.map.layerContainerOriginPx.y,d=-Math.round(d);this.div.style.left=e+"px";this.div.style.top=d+"px";d=this.renderer.setExtent(this.map.getExtent().scale(this.ratio),
b);this.renderer.root.style.visibility="visible";if(!0===OpenLayers.IS_GECKO)this.div.scrollLeft=this.div.scrollLeft;if(!b&&d)for(var f in this.unrenderedFeatures)e=this.unrenderedFeatures[f],this.drawFeature(e)}if(!this.drawn||b||!d){this.drawn=!0;f=0;for(d=this.features.length;f<d;f++)this.renderer.locked=f!==d-1,e=this.features[f],this.drawFeature(e)}},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(a,b){OpenLayers.Util.isArray(a)||(a=[a]);var c=!b||!b.silent;if(c){var d={features:a};if(!1===this.events.triggerEvent("beforefeaturesadded",d))return;a=d.features}for(var d=[],e=0,f=a.length;e<f;e++){this.renderer.locked=e!=a.length-1?!0:!1;var g=a[e];if(this.geometryType&&!(g.geometry instanceof this.geometryType))throw new TypeError("addFeatures: component should be an "+this.geometryType.prototype.CLASS_NAME);g.layer=this;if(!g.style&&this.style)g.style=OpenLayers.Util.extend({},
this.style);if(c){if(!1===this.events.triggerEvent("beforefeatureadded",{feature:g}))continue;this.preFeatureInsert(g)}d.push(g);this.features.push(g);this.drawFeature(g);c&&(this.events.triggerEvent("featureadded",{feature:g}),this.onFeatureInsert(g))}c&&this.events.triggerEvent("featuresadded",{features:d})},removeFeatures:function(a,b){if(a&&0!==a.length){if(a===this.features)return this.removeAllFeatures(b);OpenLayers.Util.isArray(a)||(a=[a]);a===this.selectedFeatures&&(a=a.slice());var c=!b||
!b.silent;c&&this.events.triggerEvent("beforefeaturesremoved",{features:a});for(var d=a.length-1;0<=d;d--){this.renderer.locked=0!=d&&a[d-1].geometry?!0:!1;var e=a[d];delete this.unrenderedFeatures[e.id];c&&this.events.triggerEvent("beforefeatureremoved",{feature:e});this.features=OpenLayers.Util.removeItem(this.features,e);e.layer=null;e.geometry&&this.renderer.eraseFeatures(e);-1!=OpenLayers.Util.indexOf(this.selectedFeatures,e)&&OpenLayers.Util.removeItem(this.selectedFeatures,e);c&&this.events.triggerEvent("featureremoved",
{feature:e})}c&&this.events.triggerEvent("featuresremoved",{features:a})}},removeAllFeatures:function(a){var a=!a||!a.silent,b=this.features;a&&this.events.triggerEvent("beforefeaturesremoved",{features:b});for(var c,d=b.length-1;0<=d;d--)c=b[d],a&&this.events.triggerEvent("beforefeatureremoved",{feature:c}),c.layer=null,a&&this.events.triggerEvent("featureremoved",{feature:c});this.renderer.clear();this.features=[];this.unrenderedFeatures={};this.selectedFeatures=[];a&&this.events.triggerEvent("featuresremoved",
{features:b})},destroyFeatures:function(a,b){if(void 0==a)a=this.features;if(a){this.removeFeatures(a,b);for(var c=a.length-1;0<=c;c--)a[c].destroy()}},drawFeature:function(a,b){if(this.drawn){if("object"!=typeof b){!b&&a.state===OpenLayers.State.DELETE&&(b="delete");var c=b||a.renderIntent;(b=a.style||this.style)||(b=this.styleMap.createSymbolizer(a,c))}c=this.renderer.drawFeature(a,b);!1===c||null===c?this.unrenderedFeatures[a.id]=a:delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},
getFeatureFromEvent:function(a){if(!this.renderer)throw Error("getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.");var b=null;(a=this.renderer.getFeatureIdFromEvent(a))&&(b="string"===typeof a?this.getFeatureById(a):a);return b},getFeatureBy:function(a,b){for(var c=null,d=0,e=this.features.length;d<e;++d)if(this.features[d][a]==b){c=this.features[d];break}return c},getFeatureById:function(a){return this.getFeatureBy("id",
a)},getFeatureByFid:function(a){return this.getFeatureBy("fid",a)},getFeaturesByAttribute:function(a,b){var c,d,e=this.features.length,f=[];for(c=0;c<e;c++)(d=this.features[c])&&d.attributes&&d.attributes[a]===b&&f.push(d);return f},onFeatureInsert:function(){},preFeatureInsert:function(){},getDataExtent:function(){var a=null,b=this.features;if(b&&0<b.length)for(var c=null,d=0,e=b.length;d<e;d++)if(c=b[d].geometry)null===a&&(a=new OpenLayers.Bounds),a.extend(c.getBounds());return a},CLASS_NAME:"OpenLayers.Layer.Vector"});
OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:!1,layers:null,display:function(){},getFeatureFromEvent:function(a){for(var b=this.layers,c,d=0;d<b.length;d++)if(c=b[d].getFeatureFromEvent(a))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(){for(var a,b=0;b<this.map.layers.length;++b)a=this.map.layers[b],-1!=OpenLayers.Util.indexOf(this.layers,a)&&a.renderer.moveRoot(this.renderer)},resetRoots:function(){for(var a,b=0;b<this.layers.length;++b)a=this.layers[b],this.renderer&&a.renderer.getRenderLayerId()==this.id&&this.renderer.moveRoot(a.renderer)},handleChangeLayer:function(a){var b=a.layer;"order"==a.property&&-1!=OpenLayers.Util.indexOf(this.layers,
b)&&(this.resetRoots(),this.collectRoots())},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});
OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:!1,clickout:!0,toggle:!1,hover:!1,highlightOnly:!1,box:!1,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);if(null===this.scope)this.scope=this;this.initLayer(a);var c=
{click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover)c.over=this.overFeature,c.out=this.outFeature;this.callbacks=OpenLayers.Util.extend(c,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){OpenLayers.Util.isArray(a)?(this.layers=a,this.layer=
new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:a})):this.layer=a},destroy:function(){this.active&&this.layers&&this.map.removeLayer(this.layer);OpenLayers.Control.prototype.destroy.apply(this,arguments);this.layers&&this.layer.destroy()},activate:function(){this.active||(this.layers&&this.map.addLayer(this.layer),this.handlers.feature.activate(),this.box&&this.handlers.box&&this.handlers.box.activate());return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.active&&
(this.handlers.feature.deactivate(),this.handlers.box&&this.handlers.box.deactivate(),this.layers&&this.map.removeLayer(this.layer));return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(a){var b=this.layers||[this.layer],c,d,e,f;for(e=0;e<b.length;++e)if(c=b[e],f=0,null!=c.selectedFeatures)for(;c.selectedFeatures.length>f;)d=c.selectedFeatures[f],!a||a.except!=d?this.unselect(d):++f},clickFeature:function(a){this.hover||(-1<OpenLayers.Util.indexOf(a.layer.selectedFeatures,
a)?this.toggleSelect()?this.unselect(a):this.multipleSelect()||this.unselectAll({except:a}):(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(){!this.hover&&this.clickout&&this.unselectAll()},overFeature:function(a){var b=
a.layer;this.hover&&(this.highlightOnly?this.highlight(a):-1==OpenLayers.Util.indexOf(b.selectedFeatures,a)&&this.select(a))},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);b&&b.highlight(a)}else this.unhighlight(a)}else this.unselect(a)},highlight:function(a){var b=a.layer;if(!1!==this.events.triggerEvent("beforefeaturehighlighted",
{feature:a}))a._prevHighlighter=a._lastHighlighter,a._lastHighlighter=this.id,b.drawFeature(a,this.selectStyle||this.renderIntent),this.events.triggerEvent("featurehighlighted",{feature:a})},unhighlight:function(a){var b=a.layer;if(void 0==a._prevHighlighter)delete a._lastHighlighter;else{if(a._prevHighlighter!=this.id)a._lastHighlighter=a._prevHighlighter;delete a._prevHighlighter}b.drawFeature(a,a.style||a.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:a})},select:function(a){var b=
this.onBeforeSelect.call(this.scope,a),c=a.layer;if(!1!==b&&(b=c.events.triggerEvent("beforefeatureselected",{feature:a}),!1!==b)){c.selectedFeatures.push(a);this.highlight(a);if(!this.handlers.feature.lastFeature)this.handlers.feature.lastFeature=c.selectedFeatures[0];c.events.triggerEvent("featureselected",{feature:a});this.onSelect.call(this.scope,a)}},unselect:function(a){var b=a.layer;this.unhighlight(a);OpenLayers.Util.removeItem(b.selectedFeatures,a);b.events.triggerEvent("featureunselected",
{feature:a});this.onUnselect.call(this.scope,a)},selectBox:function(a){if(a instanceof OpenLayers.Bounds){var b=this.map.getLonLatFromPixel({x:a.left,y:a.bottom}),a=this.map.getLonLatFromPixel({x:a.right,y:a.top}),b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat);this.multipleSelect()||this.unselectAll();a=this.multiple;this.multiple=!0;var c=this.layers||[this.layer];this.events.triggerEvent("boxselectionstart",{layers:c});for(var d,e=0;e<c.length;++e){d=c[e];for(var f=0,g=d.features.length;f<g;++f){var h=
d.features[f];h.getVisibility()&&(null==this.geometryTypes||-1<OpenLayers.Util.indexOf(this.geometryTypes,h.geometry.CLASS_NAME))&&b.toGeometry().intersects(h.geometry)&&-1==OpenLayers.Util.indexOf(d.selectedFeatures,h)&&this.select(h)}}this.multiple=a;this.events.triggerEvent("boxselectionend",{layers:c})}},setMap:function(a){this.handlers.feature.setMap(a);this.box&&this.handlers.box.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},setLayer:function(a){var b=this.active;this.unselectAll();
this.deactivate();if(this.layers)this.layer.destroy(),this.layers=null;this.initLayer(a);this.handlers.feature.layer=this.layer;b&&this.activate()},CLASS_NAME:"OpenLayers.Control.SelectFeature"});
OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,observeElement:null,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,
arguments)){this.observeElement=this.observeElement||document;for(var a=0,b=this.KEY_EVENTS.length;a<b;a++)OpenLayers.Event.observe(this.observeElement,this.KEY_EVENTS[a],this.eventListener);return!0}return!1},deactivate:function(){var a=!1;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var a=0,b=this.KEY_EVENTS.length;a<b;a++)OpenLayers.Event.stopObserving(this.observeElement,this.KEY_EVENTS[a],this.eventListener);a=!0}return a},handleKeyEvent:function(a){this.checkModifiers(a)&&
this.callback(a.type,[a])},CLASS_NAME:"OpenLayers.Handler.Keyboard"});
OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{documentDrag:!1,geometryTypes:null,clickout:!0,toggle:!0,standalone:!1,layer:null,feature:null,vertex:null,vertices:null,virtualVertices:null,handlers:null,deleteCodes:null,virtualStyle:null,vertexRenderIntent:null,mode:null,createVertices:!0,modified:!1,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(a,b){b=b||{};this.layer=a;this.vertices=
[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer(null,b.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,[b]);if(!OpenLayers.Util.isArray(this.deleteCodes))this.deleteCodes=[this.deleteCodes];var c={documentDrag:this.documentDrag,stopDown:!1};this.handlers=
{keyboard:new OpenLayers.Handler.Keyboard(this,{keydown:this.handleKeypress}),drag:new OpenLayers.Handler.Drag(this,{down:function(){this.vertex=null;var a=this.layer.getFeatureFromEvent(this.handlers.drag.evt);if(a)this.dragStart(a);else if(this.clickout)this._unselect=this.feature},move:function(a){delete this._unselect;this.vertex&&this.dragVertex(this.vertex,a)},up:function(){this.handlers.drag.stopDown=!1;this._unselect&&(this.unselectFeature(this._unselect),delete this._unselect)},done:function(){this.vertex&&
this.dragComplete(this.vertex)}},c)}},destroy:function(){this.map&&this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});return this.handlers.keyboard.activate()&&this.handlers.drag.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},
deactivate:function(){var a=!1;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments))this.moveLayerBack(),this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),this.layer.removeFeatures(this.vertices,{silent:!0}),this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.vertices=[],this.handlers.drag.deactivate(),this.handlers.keyboard.deactivate(),(a=this.feature)&&a.geometry&&a.layer&&this.unselectFeature(a),a=!0;return a},beforeSelectFeature:function(a){return this.layer.events.triggerEvent("beforefeaturemodified",
{feature:a})},selectFeature:function(a){if(!(this.feature===a||this.geometryTypes&&-1==OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME))){if(!1!==this.beforeSelectFeature(a))this.feature&&this.unselectFeature(this.feature),this.feature=a,this.layer.selectedFeatures.push(a),this.layer.drawFeature(a,"select"),this.modified=!1,this.resetVertices(),this.onModificationStart(this.feature);var b=a.modified;if(a.geometry&&(!b||!b.geometry))this._originalGeometry=a.geometry.clone()}},unselectFeature:function(a){this.layer.removeFeatures(this.vertices,
{silent:!0});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:!0});this.virtualVertices=[];this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),delete this.dragHandle);this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),delete this.radiusHandle);this.layer.drawFeature(this.feature,"default");this.feature=null;OpenLayers.Util.removeItem(this.layer.selectedFeatures,a);this.onModificationEnd(a);this.layer.events.triggerEvent("afterfeaturemodified",
{feature:a,modified:this.modified});this.modified=!1},dragStart:function(a){var b="OpenLayers.Geometry.Point"==a.geometry.CLASS_NAME;if(!this.standalone&&(!a._sketch&&b||!a._sketch)){if(this.toggle&&this.feature===a)this._unselect=a;this.selectFeature(a)}if(a._sketch||b)this.vertex=a,this.handlers.drag.stopDown=!0},dragVertex:function(a,b){var c=this.map.getLonLatFromViewPortPx(b),d=a.geometry;d.move(c.lon-d.x,c.lat-d.y);this.modified=!0;if("OpenLayers.Geometry.Point"==this.feature.geometry.CLASS_NAME)this.layer.events.triggerEvent("vertexmodified",
{vertex:a.geometry,feature:this.feature,pixel:b});else{if(a._index)a.geometry.parent.addComponent(a.geometry,a._index),delete a._index,OpenLayers.Util.removeItem(this.virtualVertices,a),this.vertices.push(a);else if(a==this.dragHandle){if(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.radiusHandle)this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null}else a!==this.radiusHandle&&this.layer.events.triggerEvent("vertexmodified",{vertex:a.geometry,
feature:this.feature,pixel:b});if(0<this.virtualVertices.length)this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[];this.layer.drawFeature(this.feature,this.standalone?void 0:"select")}this.layer.drawFeature(a)},dragComplete:function(){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=
OpenLayers.State.DELETE&&(this.feature.state=OpenLayers.State.UPDATE,this.modified&&this._originalGeometry)){var a=this.feature;a.modified=OpenLayers.Util.extend(a.modified,{geometry:this._originalGeometry});delete this._originalGeometry}},resetVertices:function(){if(0<this.vertices.length)this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[];if(0<this.virtualVertices.length)this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[];if(this.dragHandle)this.layer.destroyFeatures([this.dragHandle],
{silent:!0}),this.dragHandle=null;if(this.radiusHandle)this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null;this.feature&&"OpenLayers.Geometry.Point"!=this.feature.geometry.CLASS_NAME&&(this.mode&OpenLayers.Control.ModifyFeature.DRAG&&this.collectDragHandle(),this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE)&&this.collectRadiusHandle(),this.mode&OpenLayers.Control.ModifyFeature.RESHAPE&&(this.mode&OpenLayers.Control.ModifyFeature.RESIZE||
this.collectVertices()))},handleKeypress:function(a){var b=a.keyCode;if(this.feature&&-1!=OpenLayers.Util.indexOf(this.deleteCodes,b)&&(b=this.layer.getFeatureFromEvent(this.handlers.drag.evt))&&-1!=OpenLayers.Util.indexOf(this.vertices,b)&&!this.handlers.drag.dragging&&b.geometry.parent)b.geometry.parent.removeComponent(b.geometry),this.layer.events.triggerEvent("vertexremoved",{vertex:b.geometry,feature:this.feature,pixel:a.xy}),this.layer.drawFeature(this.feature,this.standalone?void 0:"select"),
this.modified=!0,this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},collectVertices:function(){function a(c){var d,e,f;if("OpenLayers.Geometry.Point"==c.CLASS_NAME)e=new OpenLayers.Feature.Vector(c),e._sketch=!0,e.renderIntent=b.vertexRenderIntent,b.vertices.push(e);else{f=c.components.length;"OpenLayers.Geometry.LinearRing"==c.CLASS_NAME&&(f-=1);for(d=0;d<f;++d)e=c.components[d],"OpenLayers.Geometry.Point"==
e.CLASS_NAME?(e=new OpenLayers.Feature.Vector(e),e._sketch=!0,e.renderIntent=b.vertexRenderIntent,b.vertices.push(e)):a(e);if(b.createVertices&&"OpenLayers.Geometry.MultiPoint"!=c.CLASS_NAME)for(d=0,f=c.components.length;d<f-1;++d){e=c.components[d];var g=c.components[d+1];if("OpenLayers.Geometry.Point"==e.CLASS_NAME&&"OpenLayers.Geometry.Point"==g.CLASS_NAME)e=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point((e.x+g.x)/2,(e.y+g.y)/2),null,b.virtualStyle),e.geometry.parent=c,e._index=d+
1,e._sketch=!0,b.virtualVertices.push(e)}}}this.vertices=[];this.virtualVertices=[];var b=this;a.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:!0});this.layer.addFeatures(this.vertices,{silent:!0})},collectDragHandle:function(){var a=this.feature.geometry,b=a.getBounds().getCenterLonLat(),b=new OpenLayers.Geometry.Point(b.lon,b.lat),c=new OpenLayers.Feature.Vector(b);b.move=function(b,c){OpenLayers.Geometry.Point.prototype.move.call(this,b,c);a.move(b,c)};c._sketch=
!0;this.dragHandle=c;this.dragHandle.renderIntent=this.vertexRenderIntent;this.layer.addFeatures([this.dragHandle],{silent:!0})},collectRadiusHandle:function(){var a=this.feature.geometry,b=a.getBounds(),c=b.getCenterLonLat(),d=new OpenLayers.Geometry.Point(c.lon,c.lat),b=new OpenLayers.Geometry.Point(b.right,b.bottom),c=new OpenLayers.Feature.Vector(b),e=this.mode&OpenLayers.Control.ModifyFeature.RESIZE,f=this.mode&OpenLayers.Control.ModifyFeature.RESHAPE,g=this.mode&OpenLayers.Control.ModifyFeature.ROTATE;
b.move=function(b,c){OpenLayers.Geometry.Point.prototype.move.call(this,b,c);var k=this.x-d.x,l=this.y-d.y,n=k-b,m=l-c;if(g){var o=Math.atan2(m,n),o=Math.atan2(l,k)-o,o=o*(180/Math.PI);a.rotate(o,d)}if(e){var q;f?(l/=m,q=k/n/l):(n=Math.sqrt(n*n+m*m),l=Math.sqrt(k*k+l*l)/n);a.resize(l,d,q)}};c._sketch=!0;this.radiusHandle=c;this.radiusHandle.renderIntent=this.vertexRenderIntent;this.layer.addFeatures([this.radiusHandle],{silent:!0})},setMap:function(a){this.handlers.drag.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,
arguments)},handleMapEvents:function(a){("removelayer"==a.type||"order"==a.property)&&this.moveLayerToTop()},moveLayerToTop:function(){this.layer.setZIndex(Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;a>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(a):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;
OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;
OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,autoActivate:!0,clearOnDeactivate:!1,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:!1,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.registry=OpenLayers.Util.extend({moveend:this.getState},this.registry);a={trigger:OpenLayers.Function.bind(this.previousTrigger,
this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(a,this.previousOptions);this.previous=new OpenLayers.Control.Button(a);a={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(a,this.nextOptions);this.next=new OpenLayers.Control.Button(a);this.clear()},onPreviousChange:function(a){a&&!this.previous.active?this.previous.activate():!a&&this.previous.active&&this.previous.deactivate()},
onNextChange:function(a){a&&!this.next.active?this.next.activate():!a&&this.next.active&&this.next.deactivate()},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var a in this)this[a]=null},setMap:function(a){this.map=a;this.next.setMap(a);this.previous.setMap(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw()},previousTrigger:function(){var a=this.previousStack.shift(),
b=this.previousStack.shift();void 0!=b?(this.nextStack.unshift(a),this.previousStack.unshift(b),this.restoring=!0,this.restore(b),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)):this.previousStack.unshift(a);return b},nextTrigger:function(){var a=this.nextStack.shift();if(void 0!=a)this.previousStack.unshift(a),this.restoring=!0,this.restore(a),this.restoring=!1,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(a){var b,c;if(this.map.getProjectionObject()==
a.projection)c=this.map.getZoomForResolution(a.resolution),b=a.center;else{b=a.center.clone();b.transform(a.projection,this.map.getProjectionObject());c=a.units;var d=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;c=this.map.getZoomForResolution((c&&d?OpenLayers.INCHES_PER_UNIT[c]/OpenLayers.INCHES_PER_UNIT[d]:1)*a.resolution)}this.map.setCenter(b,c)},setListeners:function(){this.listeners={};for(var a in this.registry)this.listeners[a]=OpenLayers.Function.bind(function(){if(!this.restoring){this.previousStack.unshift(this.registry[a].apply(this,
arguments));if(1<this.previousStack.length)this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);this.previousStack.length>this.limit+1&&this.previousStack.pop();if(0<this.nextStack.length)this.nextStack=[],this.onNextChange(null,0)}return!0},this)},activate:function(){var a=!1;if(this.map&&OpenLayers.Control.prototype.activate.apply(this)){null==this.listeners&&this.setListeners();for(var b in this.listeners)this.map.events.register(b,this,this.listeners[b]);a=!0;0==this.previousStack.length&&
this.initStack()}return a},initStack:function(){this.map.getCenter()&&this.listeners.moveend()},deactivate:function(){var a=!1;if(this.map&&OpenLayers.Control.prototype.deactivate.apply(this)){for(var b in this.listeners)this.map.events.unregister(b,this,this.listeners[b]);this.clearOnDeactivate&&this.clear();a=!0}return a},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});
OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{callbacks:null,displaySystem:"metric",geodesic:!1,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:!1,immediate:!1,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);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 a(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)?this.callbacks.modify=this.measureImmediate:delete this.callbacks.modify},updateHandler:function(a,b){var c=this.active;c&&this.deactivate();
this.handler=new a(this,this.callbacks,b);c&&this.activate()},measureComplete:function(a){this.cancelDelay();this.measure(a,"measure")},measurePartial:function(a,b){this.cancelDelay();b=b.clone();this.handler.freehandMode(this.handler.evt)?this.measure(b,"measurepartial"):this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.delayedTrigger=null;this.measure(b,"measurepartial")},this),this.partialDelay)},measureImmediate:function(a,b,c){c&&!this.handler.freehandMode(this.handler.evt)&&
(this.cancelDelay(),this.measure(b.geometry,"measurepartial"))},cancelDelay:function(){if(null!==this.delayedTrigger)window.clearTimeout(this.delayedTrigger),this.delayedTrigger=null},measure:function(a,b){var c,d;-1<a.CLASS_NAME.indexOf("LineString")?(c=this.getBestLength(a),d=1):(c=this.getBestArea(a),d=2);this.events.triggerEvent(b,{measure:c[0],units:c[1],order:d,geometry:a})},getBestArea:function(a){for(var b=this.displaySystemUnits[this.displaySystem],c,d,e=0,f=b.length;e<f&&!(c=b[e],d=this.getArea(a,
c),1<d);++e);return[d,c]},getArea:function(a,b){var c,d;this.geodesic?(c=a.getGeodesicArea(this.map.getProjectionObject()),d="m"):(c=a.getArea(),d=this.map.getUnits());var e=OpenLayers.INCHES_PER_UNIT[b];e&&(c*=Math.pow(OpenLayers.INCHES_PER_UNIT[d]/e,2));return c},getBestLength:function(a){for(var b=this.displaySystemUnits[this.displaySystem],c,d,e=0,f=b.length;e<f&&!(c=b[e],d=this.getLength(a,c),1<d);++e);return[d,c]},getLength:function(a,b){var c,d;this.geodesic?(c=a.getGeodesicLength(this.map.getProjectionObject()),
d="m"):(c=a.getLength(),d=this.map.getUnits());var e=OpenLayers.INCHES_PER_UNIT[b];e&&(c*=OpenLayers.INCHES_PER_UNIT[d]/e);return c},CLASS_NAME:"OpenLayers.Control.Measure"});
OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:!1,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){OpenLayers.Util.mouseLeft(a,this.map.viewPortDiv)&&(this.clearTimer(),this.callback("move",[a]));return!0},
passesTolerance:function(a){var b=!0;this.pixelTolerance&&this.px&&Math.sqrt(Math.pow(this.px.x-a.x,2)+Math.pow(this.px.y-a.y,2))<this.pixelTolerance&&(b=!1);return b},clearTimer:function(){if(null!=this.timerId)window.clearTimeout(this.timerId),this.timerId=null},delayedCall:function(a){this.callback("pause",[a])},deactivate:function(){var a=!1;OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),a=!0);return a},CLASS_NAME:"OpenLayers.Handler.Hover"});
(function(){function a(){this._object=f&&!j?new f:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function b(){return new a}function c(a){b.onreadystatechange&&b.onreadystatechange.apply(a);a.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function d(a){try{a.responseText=a._object.responseText}catch(b){}try{var c=a._object,d=c.responseXML,e=c.responseText;if(h&&e&&d&&!d.documentElement&&c.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/))d=
new window.ActiveXObject("Microsoft.XMLDOM"),d.async=!1,d.validateOnParse=!1,d.loadXML(e);a.responseXML=d&&(h&&0!=d.parseError||!d.documentElement||d.documentElement&&"parsererror"==d.documentElement.tagName)?null:d}catch(f){}try{a.status=a._object.status}catch(g){}try{a.statusText=a._object.statusText}catch(j){}}function e(a){a._object.onreadystatechange=new window.Function}var f=window.XMLHttpRequest,g=!!window.controllers,h=window.document.all&&!window.opera,j=h&&window.navigator.userAgent.match(/MSIE 7.0/);
b.prototype=a.prototype;if(g&&f.wrapped)b.wrapped=f.wrapped;b.UNSENT=0;b.OPENED=1;b.HEADERS_RECEIVED=2;b.LOADING=3;b.DONE=4;b.prototype.readyState=b.UNSENT;b.prototype.responseText="";b.prototype.responseXML=null;b.prototype.status=0;b.prototype.statusText="";b.prototype.priority="NORMAL";b.prototype.onreadystatechange=null;b.onreadystatechange=null;b.onopen=null;b.onsend=null;b.onabort=null;b.prototype.open=function(a,f,j,m,o){delete this._headers;3>arguments.length&&(j=!0);this._async=j;var q=this,
r=this.readyState,s;h&&j&&(s=function(){r!=b.DONE&&(e(q),q.abort())},window.attachEvent("onunload",s));b.onopen&&b.onopen.apply(this,arguments);4<arguments.length?this._object.open(a,f,j,m,o):3<arguments.length?this._object.open(a,f,j,m):this._object.open(a,f,j);this.readyState=b.OPENED;c(this);this._object.onreadystatechange=function(){if(!g||j)q.readyState=q._object.readyState,d(q),q._aborted?q.readyState=b.UNSENT:(q.readyState==b.DONE&&(delete q._data,e(q),h&&j&&window.detachEvent("onunload",s)),
r!=q.readyState&&c(q),r=q.readyState)}};b.prototype.send=function(a){b.onsend&&b.onsend.apply(this,arguments);arguments.length||(a=null);a&&a.nodeType&&(a=window.XMLSerializer?(new window.XMLSerializer).serializeToString(a):a.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml"));this._data=a;this._object.send(this._data);if(g&&!this._async){this.readyState=b.OPENED;for(d(this);this.readyState<b.DONE&&!(this.readyState++,c(this),this._aborted););}};b.prototype.abort=
function(){b.onabort&&b.onabort.apply(this,arguments);if(this.readyState>b.UNSENT)this._aborted=!0;this._object.abort();e(this);this.readyState=b.UNSENT;delete this._data};b.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};b.prototype.getResponseHeader=function(a){return this._object.getResponseHeader(a)};b.prototype.setRequestHeader=function(a,b){if(!this._headers)this._headers={};this._headers[a]=b;return this._object.setRequestHeader(a,b)};b.prototype.addEventListener=
function(a,b,c){for(var d=0,e;e=this._listeners[d];d++)if(e[0]==a&&e[1]==b&&e[2]==c)return;this._listeners.push([a,b,c])};b.prototype.removeEventListener=function(a,b,c){for(var d=0,e;(e=this._listeners[d])&&!(e[0]==a&&e[1]==b&&e[2]==c);d++);e&&this._listeners.splice(d,1)};b.prototype.dispatchEvent=function(a){a={type:a.type,target:this,currentTarget:this,eventPhase:2,bubbles:a.bubbles,cancelable:a.cancelable,timeStamp:a.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};
"readystatechange"==a.type&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[a]);for(var b=0,c;c=this._listeners[b];b++)c[0]==a.type&&!c[2]&&(c[1].handleEvent||c[1]).apply(this,[a])};b.prototype.toString=function(){return"[object XMLHttpRequest]"};b.toString=function(){return"[XMLHttpRequest]"};if(!window.Function.prototype.apply)window.Function.prototype.apply=function(a,b){b||(b=[]);a.__func=this;a.__func(b[0],b[1],b[2],b[3],b[4]);delete a.__func};
if(!OpenLayers.Request)OpenLayers.Request={};OpenLayers.Request.XMLHttpRequest=b})();OpenLayers.ProxyHost="";if(!OpenLayers.Request)OpenLayers.Request={};
OpenLayers.Util.extend(OpenLayers.Request,{DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:!0,user:void 0,password:void 0,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new OpenLayers.Events(this),makeSameOrigin:function(a,b){var c=0!==a.indexOf("http"),d=!c&&a.match(this.URL_SPLIT_REGEX);if(d){var e=window.location,c=d[1]==e.protocol&&d[3]==
e.hostname,d=d[4],e=e.port;if(80!=d&&""!=d||"80"!=e&&""!=e)c=c&&d==e}c||b&&(a="function"==typeof b?b(a):b+encodeURIComponent(a));return a},issue:function(a){var b=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost}),a=a||{};a.headers=a.headers||{};a=OpenLayers.Util.applyDefaults(a,b);a.headers=OpenLayers.Util.applyDefaults(a.headers,b.headers);var b=!1,c;for(c in a.headers)a.headers.hasOwnProperty(c)&&"x-requested-with"===c.toLowerCase()&&(b=!0);!1===b&&(a.headers["X-Requested-With"]=
"XMLHttpRequest");var d=new OpenLayers.Request.XMLHttpRequest,e=OpenLayers.Util.urlAppend(a.url,OpenLayers.Util.getParameterString(a.params||{})),e=OpenLayers.Request.makeSameOrigin(e,a.proxy);d.open(a.method,e,a.async,a.user,a.password);for(var f in a.headers)d.setRequestHeader(f,a.headers[f]);var g=this.events,h=this;d.onreadystatechange=function(){d.readyState==OpenLayers.Request.XMLHttpRequest.DONE&&!1!==g.triggerEvent("complete",{request:d,config:a,requestUrl:e})&&h.runCallbacks({request:d,config:a,
requestUrl:e})};!1===a.async?d.send(a.data):window.setTimeout(function(){0!==d.readyState&&d.send(a.data)},0);return d},runCallbacks:function(a){var b=a.request,c=a.config,d=c.scope?OpenLayers.Function.bind(c.callback,c.scope):c.callback,e;c.success&&(e=c.scope?OpenLayers.Function.bind(c.success,c.scope):c.success);var f;c.failure&&(f=c.scope?OpenLayers.Function.bind(c.failure,c.scope):c.failure);if("file:"==OpenLayers.Util.createUrlObject(c.url).protocol&&b.responseText)b.status=200;d(b);if(!b.status||
200<=b.status&&300>b.status)this.events.triggerEvent("success",a),e&&e(b);if(b.status&&(200>b.status||300<=b.status))this.events.triggerEvent("failure",a),f&&f(b)},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:{};"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:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}});
OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(){throw Error("Read not implemented.");},write:function(){throw Error("Write not implemented.");},CLASS_NAME:"OpenLayers.Format"});
OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(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(a){var b=a.indexOf("<");0<b&&(a=a.substring(b));b=OpenLayers.Util.Try(OpenLayers.Function.bind(function(){var b;b=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom;b.loadXML(a);return b},this),function(){return(new DOMParser).parseFromString(a,"text/xml")},function(){var b=new XMLHttpRequest;b.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(a),!1);b.overrideMimeType&&
b.overrideMimeType("text/xml");b.send(null);return b.responseXML});if(this.keepData)this.data=b;return b},write:function(a){if(this.xmldom)a=a.xml;else{var b=new XMLSerializer;if(1==a.nodeType){var c=document.implementation.createDocument("","",null);c.importNode&&(a=c.importNode(a,!0));c.appendChild(a);a=b.serializeToString(c)}else a=b.serializeToString(a)}return a},createElementNS:function(a,b){return this.xmldom?"string"==typeof a?this.xmldom.createNode(1,b,a):this.xmldom.createNode(1,b,""):document.createElementNS(a,
b)},createDocumentFragment:function(){return this.xmldom?this.xmldom.createDocumentFragment():document.createDocumentFragment()},createTextNode:function(a){"string"!==typeof a&&(a=""+a);return this.xmldom?this.xmldom.createTextNode(a):document.createTextNode(a)},getElementsByTagNameNS:function(a,b,c){var d=[];if(a.getElementsByTagNameNS)d=a.getElementsByTagNameNS(b,c);else for(var a=a.getElementsByTagName("*"),e,f,g=0,h=a.length;g<h;++g)if(e=a[g],f=e.prefix?e.prefix+":"+c:c,"*"==c||f==e.nodeName)("*"==
b||b==e.namespaceURI)&&d.push(e);return d},getAttributeNodeNS:function(a,b,c){var d=null;if(a.getAttributeNodeNS)d=a.getAttributeNodeNS(b,c);else for(var a=a.attributes,e,f,g=0,h=a.length;g<h;++g)if(e=a[g],e.namespaceURI==b&&(f=e.prefix?e.prefix+":"+c:c,f==e.nodeName)){d=e;break}return d},getAttributeNS:function(a,b,c){var d="";if(a.getAttributeNS)d=a.getAttributeNS(b,c)||"";else if(a=this.getAttributeNodeNS(a,b,c))d=a.nodeValue;return d},getChildValue:function(a,b){var c=b||"";if(a)for(var d=a.firstChild;d;d=
d.nextSibling)switch(d.nodeType){case 3:case 4:c+=d.nodeValue}return c},isSimpleContent:function(a){for(var b=!0,a=a.firstChild;a;a=a.nextSibling)if(1===a.nodeType){b=!1;break}return b},contentType:function(a){for(var b=!1,c=!1,d=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY,a=a.firstChild;a;a=a.nextSibling){switch(a.nodeType){case 1:c=!0;break;case 8:break;default:b=!0}if(c&&b)break}if(c&&b)d=OpenLayers.Format.XML.CONTENT_TYPE.MIXED;else{if(c)return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX;if(b)return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}return d},
hasAttributeNS:function(a,b,c){var d=!1;return d=a.hasAttributeNS?a.hasAttributeNS(b,c):!!this.getAttributeNodeNS(a,b,c)},setAttributeNS:function(a,b,c,d){if(a.setAttributeNS)a.setAttributeNS(b,c,d);else if(this.xmldom)b?(b=a.ownerDocument.createNode(2,c,b),b.nodeValue=d,a.setAttributeNode(b)):a.setAttribute(c,d);else throw"setAttributeNS not implemented";},createElementNSPlus:function(a,b){var b=b||{},c=b.uri||this.namespaces[b.prefix];c||(c=a.indexOf(":"),c=this.namespaces[a.substring(0,c)]);c||
(c=this.namespaces[this.defaultPrefix]);c=this.createElementNS(c,a);b.attributes&&this.setAttributes(c,b.attributes);var d=b.value;null!=d&&c.appendChild(this.createTextNode(d));return c},setAttributes:function(a,b){var c,d,e;for(e in b)null!=b[e]&&b[e].toString&&(c=b[e].toString(),d=this.namespaces[e.substring(0,e.indexOf(":"))]||null,this.setAttributeNS(a,d,e,c))},readNode:function(a,b){b||(b={});var c=this.readers[a.namespaceURI?this.namespaceAlias[a.namespaceURI]:this.defaultPrefix];if(c){var d=
a.localName||a.nodeName.split(":").pop();(c=c[d]||c["*"])&&c.apply(this,[a,b])}return b},readChildNodes:function(a,b){b||(b={});for(var c=a.childNodes,d,e=0,f=c.length;e<f;++e)d=c[e],1==d.nodeType&&this.readNode(d,b);return b},writeNode:function(a,b,c){var d,e=a.indexOf(":");0<e?(d=a.substring(0,e),a=a.substring(e+1)):d=c?this.namespaceAlias[c.namespaceURI]:this.defaultPrefix;b=this.writers[d][a].apply(this,[b]);c&&c.appendChild(b);return b},getChildEl:function(a,b,c){return a&&this.getThisOrNextEl(a.firstChild,
b,c)},getNextEl:function(a,b,c){return a&&this.getThisOrNextEl(a.nextSibling,b,c)},getThisOrNextEl:function(a,b,c){a:for(;a;a=a.nextSibling)switch(a.nodeType){case 1:if((!b||b===(a.localName||a.nodeName.split(":").pop()))&&(!c||c===a.namespaceURI))break a;a=null;break a;case 3:if(/^\s*$/.test(a.nodeValue))break;case 4:case 6:case 12:case 10:case 11:a=null;break a}return a||null},lookupNamespaceURI:function(a,b){var c=null;if(a)if(a.lookupNamespaceURI)c=a.lookupNamespaceURI(b);else a:switch(a.nodeType){case 1:if(null!==
a.namespaceURI&&a.prefix===b){c=a.namespaceURI;break a}if(c=a.attributes.length)for(var d,e=0;e<c;++e)if(d=a.attributes[e],"xmlns"===d.prefix&&d.name==="xmlns:"+b){c=d.value||null;break a}else if("xmlns"===d.name&&null===b){c=d.value||null;break a}c=this.lookupNamespaceURI(a.parentNode,b);break a;case 2:c=this.lookupNamespaceURI(a.ownerElement,b);break a;case 9:c=this.lookupNamespaceURI(a.documentElement,b);break a;case 6:case 12:case 10:case 11:break a;default:c=this.lookupNamespaceURI(a.parentNode,
b)}return c},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.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(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=a.documentElement;if(b)var c=this["read_"+b.nodeName],a=c?c.call(this,b):(new OpenLayers.Format.GML(this.options?this.options:{})).read(a);return a},read_msGMLOutput:function(a){var b=
[];if(a=this.getSiblingNodesByTagCriteria(a,this.layerIdentifier))for(var c=0,d=a.length;c<d;++c){var e=a[c],f=e.nodeName;e.prefix&&(f=f.split(":")[1]);f=f.replace(this.layerIdentifier,"");if(e=this.getSiblingNodesByTagCriteria(e,this.featureIdentifier))for(var g=0;g<e.length;g++){var h=e[g],j=this.parseGeometry(h),h=this.parseAttributes(h),h=new OpenLayers.Feature.Vector(j.geometry,h,null);h.bounds=j.bounds;h.type=f;b.push(h)}}return b},read_FeatureInfoResponse:function(a){for(var b=[],a=this.getElementsByTagNameNS(a,
"*","FIELDS"),c=0,d=a.length;c<d;c++){var e=a[c],f={},g,h=e.attributes.length;if(0<h)for(g=0;g<h;g++){var j=e.attributes[g];f[j.nodeName]=j.nodeValue}else{e=e.childNodes;for(g=0,h=e.length;g<h;++g)j=e[g],3!=j.nodeType&&(f[j.getAttribute("name")]=j.getAttribute("value"))}b.push(new OpenLayers.Feature.Vector(null,f,null))}return b},getSiblingNodesByTagCriteria:function(a,b){var c=[],d,e,f,g;if(a&&a.hasChildNodes()){d=a.childNodes;f=d.length;for(var h=0;h<f;h++){for(g=d[h];g&&1!=g.nodeType;)g=g.nextSibling,
h++;e=g?g.nodeName:"";0<e.length&&-1<e.indexOf(b)?c.push(g):(e=this.getSiblingNodesByTagCriteria(g,b),0<e.length&&(0==c.length?c=e:c.push(e)))}}return c},parseAttributes:function(a){var b={};if(1==a.nodeType)for(var a=a.childNodes,c=a.length,d=0;d<c;++d){var e=a[d];if(1==e.nodeType){var f=e.childNodes,e=e.prefix?e.nodeName.split(":")[1]:e.nodeName;if(0==f.length)b[e]=null;else if(1==f.length&&(f=f[0],3==f.nodeType||4==f.nodeType))f=f.nodeValue.replace(this.regExes.trimSpace,""),b[e]=f}}return b},
parseGeometry:function(a){if(!this.gmlFormat)this.gmlFormat=new OpenLayers.Format.GML;var a=this.gmlFormat.parseFeature(a),b,c=null;a&&(b=a.geometry&&a.geometry.clone(),c=a.bounds&&a.bounds.clone(),a.destroy());return{geometry:b,bounds:c}},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"});
OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,drillDown:!1,maxFeatures:10,clickCallback:"click",output:"features",layers:null,queryVisible:!1,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handler:null,hoverRequest:null,initialize:function(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(!0===this.drillDown)this.hover=!1;this.hover?this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250})):(a={},a[this.clickCallback]=this.getInfoForClick,this.handler=new OpenLayers.Handler.Click(this,a,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:!0})},cancelHover:function(){if(this.hoverRequest)this.hoverRequest.abort(),this.hoverRequest=null},findLayers:function(){for(var a=this.layers||this.map.layers,b=[],c,d,e=a.length-1;0<=e;--e)if(c=a[e],c instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||c.getVisibility())){d=OpenLayers.Util.isArray(c.url)?c.url[0]:c.url;if(!1===this.drillDown&&!this.url)this.url=d;(!0===this.drillDown||
this.urlMatches(d))&&b.push(c)}return b},urlMatches:function(a){var b=OpenLayers.Util.isEquivalentUrl(this.url,a);if(!b&&this.layerUrls)for(var c=0,d=this.layerUrls.length;c<d;++c)if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[c],a)){b=!0;break}return b},buildWMSOptions:function(a,b,c,d){for(var e=[],f=[],g=0,h=b.length;g<h;g++)null!=b[g].params.LAYERS&&(e=e.concat(b[g].params.LAYERS),f=f.concat(this.getStyleNames(b[g])));b=b[0];g=this.map.getProjection();(h=b.projection)&&h.equals(this.map.getProjectionObject())&&
(g=h.getCode());d=OpenLayers.Util.extend({service:"WMS",version:b.params.VERSION,request:"GetFeatureInfo",exceptions:b.params.EXCEPTIONS,bbox:this.map.getExtent().toBBOX(null,b.reverseAxisOrder()),feature_count:this.maxFeatures,height:this.map.getSize().h,width:this.map.getSize().w,format:d,info_format:b.params.INFO_FORMAT||this.infoFormat},1.3<=parseFloat(b.params.VERSION)?{crs:g,i:parseInt(c.x),j:parseInt(c.y)}:{srs:g,x:parseInt(c.x),y:parseInt(c.y)});0!=e.length&&(d=OpenLayers.Util.extend({layers:e,
query_layers:e,styles:f},d));OpenLayers.Util.applyDefaults(d,this.vendorParams);return{url:a,params:OpenLayers.Util.upperCaseObject(d),callback:function(b){this.handleResponse(c,b,a)},scope:this}},getStyleNames:function(a){return a.params.STYLES?a.params.STYLES:OpenLayers.Util.isArray(a.params.LAYERS)?Array(a.params.LAYERS.length):a.params.LAYERS.replace(/[^,]/g,"")},request:function(a,b){var c=this.findLayers();if(0==c.length)this.events.triggerEvent("nogetfeatureinfo"),OpenLayers.Element.removeClass(this.map.viewPortDiv,
"olCursorWait");else if(b=b||{},!1===this.drillDown){var c=this.buildWMSOptions(this.url,c,a,c[0].params.FORMAT),d=OpenLayers.Request.GET(c);if(!0===b.hover)this.hoverRequest=d}else{this._numRequests=this._requestCount=0;this.features=[];for(var d={},e,f=0,g=c.length;f<g;f++){var h=c[f];e=OpenLayers.Util.isArray(h.url)?h.url[0]:h.url;e in d?d[e].push(h):(this._numRequests++,d[e]=[h])}for(e in d)c=d[e],c=this.buildWMSOptions(e,c,a,c[0].params.FORMAT),OpenLayers.Request.GET(c)}},triggerGetFeatureInfo:function(a,
b,c){this.events.triggerEvent("getfeatureinfo",{text:a.responseText,features:c,request:a,xy:b});OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},handleResponse:function(a,b,c){var d=b.responseXML;if(!d||!d.documentElement)d=b.responseText;d=this.format.read(d);!1===this.drillDown?this.triggerGetFeatureInfo(b,a,d):(this._requestCount++,this._features="object"===this.output?(this._features||[]).concat({url:c,features:d}):(this._features||[]).concat(d),this._requestCount===this._numRequests&&
(this.triggerGetFeatureInfo(b,a,this._features.concat()),delete this._features,delete this._requestCount,delete this._numRequests))},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"});
OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.bounds=this.id=null},clone:function(){return new OpenLayers.Geometry},setBounds:function(a){if(a)this.bounds=a.clone()},clearBounds:function(){this.bounds=null;this.parent&&this.parent.clearBounds()},extendBounds:function(a){this.getBounds()?this.bounds.extend(a):this.setBounds(a)},getBounds:function(){null==this.bounds&&this.calculateBounds();
return this.bounds},calculateBounds:function(){},distanceTo:function(){},getVertices:function(){},atPoint:function(a,b,c){var d=!1;null!=this.getBounds()&&null!=a&&(b=null!=b?b:0,c=null!=c?c:0,d=(new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-c,this.bounds.right+b,this.bounds.top+c)).containsLonLat(a));return d},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.WKT?OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this)):
Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(a){var b;if(OpenLayers.Format&&OpenLayers.Format.WKT){var c=OpenLayers.Geometry.fromWKT.format;if(!c)c=new OpenLayers.Format.WKT,OpenLayers.Geometry.fromWKT.format=c;a=c.read(a);if(a instanceof OpenLayers.Feature.Vector)b=a.geometry;else if(OpenLayers.Util.isArray(a)){b=a.length;for(var c=Array(b),d=0;d<b;++d)c[d]=a[d].geometry;b=new OpenLayers.Geometry.Collection(c)}}return b};
OpenLayers.Geometry.segmentsIntersect=function(a,b,c){var d=c&&c.point,c=c&&c.tolerance,e=!1,f=a.x1-b.x1,g=a.y1-b.y1,h=a.x2-a.x1,j=a.y2-a.y1,k=b.y2-b.y1,l=b.x2-b.x1,n=k*h-l*j,k=l*g-k*f,g=h*g-j*f;0==n?0==k&&0==g&&(e=!0):(f=k/n,n=g/n,0<=f&&1>=f&&0<=n&&1>=n&&(d?(h=a.x1+f*h,n=a.y1+f*j,e=new OpenLayers.Geometry.Point(h,n)):e=!0));if(c)if(e){if(d){a=[a,b];b=0;a:for(;2>b;++b){f=a[b];for(j=1;3>j;++j)if(h=f["x"+j],n=f["y"+j],d=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(n-e.y,2)),d<c){e.x=h;e.y=n;break a}}}}else{a=
[a,b];b=0;a:for(;2>b;++b){h=a[b];n=a[(b+1)%2];for(j=1;3>j;++j)if(f={x:h["x"+j],y:h["y"+j]},g=OpenLayers.Geometry.distanceToSegment(f,n),g.distance<c){e=d?new OpenLayers.Geometry.Point(f.x,f.y):!0;break a}}}return e};OpenLayers.Geometry.distanceToSegment=function(a,b){var c=OpenLayers.Geometry.distanceSquaredToSegment(a,b);c.distance=Math.sqrt(c.distance);return c};
OpenLayers.Geometry.distanceSquaredToSegment=function(a,b){var c=a.x,d=a.y,e=b.x1,f=b.y1,g=b.x2,h=b.y2,j=g-e,k=h-f,l=(j*(c-e)+k*(d-f))/(Math.pow(j,2)+Math.pow(k,2));0>=l||(1<=l?(e=g,f=h):(e+=l*j,f+=l*k));return{distance:Math.pow(e-c,2)+Math.pow(f-d,2),x:e,y:f,along:l}};
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){null==a&&(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(a,b){var c=!(b&&!1===b.edge)&&b&&b.details,d,e,f,g,h;a instanceof
OpenLayers.Geometry.Point?(e=this.x,f=this.y,g=a.x,h=a.y,d=Math.sqrt(Math.pow(e-g,2)+Math.pow(f-h,2)),d=!c?d:{x0:e,y0:f,x1:g,y1:h,distance:d}):(d=a.distanceTo(this,b),c&&(d={x0:d.x1,y0:d.y1,x1:d.x0,y1:d.y0,distance:d.distance}));return d},equals:function(a){var b=!1;null!=a&&(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+=a;this.y+=b;this.clearBounds()},rotate:function(a,b){var a=
a*(Math.PI/180),c=this.distanceTo(b),d=a+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+c*Math.cos(d);this.y=b.y+c*Math.sin(d);this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(a,b,c){this.x=b.x+a*(void 0==c?1:c)*(this.x-b.x);this.y=b.y+a*(this.y-b.y);this.clearBounds();return this},intersects:function(a){var b=!1;return b="OpenLayers.Geometry.Point"==a.CLASS_NAME?this.equals(a):a.intersects(this)},transform:function(a,b){if(a&&b)OpenLayers.Projection.transform(this,
a,b),this.bounds=null;return this},getVertices:function(){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});
OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:!1,citeCompliant:!1,mouseDown:!1,stoppedDown:null,lastDown:null,lastUp:null,persist:!1,stopDown:!1,stopUp:!1,layerOptions:null,pixelTolerance:5,lastTouchPx:null,initialize:function(a,b,c){if(!c||!c.layerOptions||!c.layerOptions.styleMap)this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,
arguments))return!1;var a=OpenLayers.Util.extend({displayInLayerSwitcher:!1,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!0},createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();
this.layer.addFeatures([this.point],{silent:!0})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments))return!1;this.cancel();null!=this.layer.map&&(this.destroyFeature(!0),this.layer.destroy(!1));this.layer=null;return!0},destroyFeature:function(a){this.layer&&(a||!this.persist)&&this.layer.destroyFeatures();this.point=null},destroyPersistedFeature:function(){var a=this.layer;a&&1<a.features.length&&this.layer.features[0].destroy()},finalize:function(a){this.mouseDown=
!1;this.lastTouchPx=this.lastUp=this.lastDown=null;this.callback(a?"cancel":"done",[this.geometryClone()]);this.destroyFeature(a)},cancel:function(){this.finalize(!0)},click:function(a){OpenLayers.Event.stop(a);return!1},dblclick:function(a){OpenLayers.Event.stop(a);return!1},modifyFeature:function(a){this.point||this.createFeature(a);a=this.layer.getLonLatFromViewPortPx(a);this.point.geometry.x=a.lon;this.point.geometry.y=a.lat;this.callback("modify",[this.point.geometry,this.point,!1]);this.point.geometry.clearBounds();
this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.point&&this.point.geometry;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){this.startTouch();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=!0;this.lastDown=a.xy;this.touch||this.modifyFeature(a.xy);this.stoppedDown=this.stopDown;return!this.stopDown},move:function(a){!this.touch&&(!this.mouseDown||this.stoppedDown)&&this.modifyFeature(a.xy);return!0},up:function(a){this.mouseDown=!1;this.stoppedDown=this.stopDown;return this.checkModifiers(a)&&(!this.lastUp||!this.lastUp.equals(a.xy))&&
this.lastDown&&this.passesTolerance(this.lastDown,a.xy,this.pixelTolerance)?(this.touch&&this.modifyFeature(a.xy),this.persist&&this.destroyPersistedFeature(),this.lastUp=a.xy,this.finalize(),!this.stopUp):!0},mouseout:function(a){if(OpenLayers.Util.mouseLeft(a,this.map.viewPortDiv))this.stoppedDown=this.stopDown,this.mouseDown=!1},passesTolerance:function(a,b,c){var d=!0;null!=c&&a&&b&&a.distanceTo(b)>c&&(d=!1);return d},CLASS_NAME:"OpenLayers.Handler.Point"});
OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];null!=a&&this.addComponents(a)},destroy:function(){this.components.length=0;this.components=null;OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},clone:function(){for(var a=eval("new "+this.CLASS_NAME+"()"),b=0,c=this.components.length;b<c;b++)a.addComponent(this.components[b].clone());
OpenLayers.Util.applyDefaults(a,this);return a},getComponentsString:function(){for(var a=[],b=0,c=this.components.length;b<c;b++)a.push(this.components[b].toShortString());return a.join(",")},calculateBounds:function(){this.bounds=null;var a=new OpenLayers.Bounds,b=this.components;if(b)for(var c=0,d=b.length;c<d;c++)a.extend(b[c].getBounds());null!=a.left&&null!=a.bottom&&null!=a.right&&null!=a.top&&this.setBounds(a)},addComponents:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=0,c=a.length;b<
c;b++)this.addComponent(a[b])},addComponent:function(a,b){var c=!1;if(a&&(null==this.componentTypes||-1<OpenLayers.Util.indexOf(this.componentTypes,a.CLASS_NAME))){if(null!=b&&b<this.components.length){var c=this.components.slice(0,b),d=this.components.slice(b,this.components.length);c.push(a);this.components=c.concat(d)}else this.components.push(a);a.parent=this;this.clearBounds();c=!0}return c},removeComponents:function(a){var b=!1;OpenLayers.Util.isArray(a)||(a=[a]);for(var c=a.length-1;0<=c;--c)b=
this.removeComponent(a[c])||b;return b},removeComponent:function(a){OpenLayers.Util.removeItem(this.components,a);this.clearBounds();return!0},getLength:function(){for(var a=0,b=0,c=this.components.length;b<c;b++)a+=this.components[b].getLength();return a},getArea:function(){for(var a=0,b=0,c=this.components.length;b<c;b++)a+=this.components[b].getArea();return a},getGeodesicArea:function(a){for(var b=0,c=0,d=this.components.length;c<d;c++)b+=this.components[c].getGeodesicArea(a);return b},getCentroid:function(a){if(!a)return this.components.length&&
this.components[0].getCentroid();a=this.components.length;if(!a)return!1;for(var b=[],c=[],d=0,e=Number.MAX_VALUE,f,g=0;g<a;++g){f=this.components[g];var h=f.getArea();f=f.getCentroid(!0);!isNaN(h)&&!isNaN(f.x)&&!isNaN(f.y)&&(b.push(h),d+=h,e=h<e&&0<h?h:e,c.push(f))}a=b.length;if(0===d){for(g=0;g<a;++g)b[g]=1;d=b.length}else{for(g=0;g<a;++g)b[g]/=e;d/=e}for(var j=e=0,g=0;g<a;++g)f=c[g],h=b[g],e+=f.x*h,j+=f.y*h;return new OpenLayers.Geometry.Point(e/d,j/d)},getGeodesicLength:function(a){for(var b=
0,c=0,d=this.components.length;c<d;c++)b+=this.components[c].getGeodesicLength(a);return b},move:function(a,b){for(var c=0,d=this.components.length;c<d;c++)this.components[c].move(a,b)},rotate:function(a,b){for(var c=0,d=this.components.length;c<d;++c)this.components[c].rotate(a,b)},resize:function(a,b,c){for(var d=0;d<this.components.length;++d)this.components[d].resize(a,b,c);return this},distanceTo:function(a,b){for(var c=!(b&&!1===b.edge)&&b&&b.details,d,e,f,g=Number.POSITIVE_INFINITY,h=0,j=this.components.length;h<
j&&!(d=this.components[h].distanceTo(a,b),f=c?d.distance:d,f<g&&(g=f,e=d,0==g));++h);return e},equals:function(a){var b=!0;if(!a||!a.CLASS_NAME||this.CLASS_NAME!=a.CLASS_NAME)b=!1;else if(!OpenLayers.Util.isArray(a.components)||a.components.length!=this.components.length)b=!1;else for(var c=0,d=this.components.length;c<d;++c)if(!this.components[c].equals(a.components[c])){b=!1;break}return b},transform:function(a,b){if(a&&b){for(var c=0,d=this.components.length;c<d;c++)this.components[c].transform(a,
b);this.bounds=null}return this},intersects:function(a){for(var b=!1,c=0,d=this.components.length;c<d&&!(b=a.intersects(this.components[c]));++c);return b},getVertices:function(a){for(var b=[],c=0,d=this.components.length;c<d;++c)Array.prototype.push.apply(b,this.components[c].getVertices(a));return b},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 a=0;if(this.components&&1<this.components.length)for(var b=1,c=this.components.length;b<c;b++)a+=this.components[b-1].distanceTo(this.components[b]);return a},getGeodesicLength:function(a){var b=this;if(a){var c=new OpenLayers.Projection("EPSG:4326");c.equals(a)||(b=this.clone().transform(a,c))}a=0;if(b.components&&1<b.components.length)for(var d,e=1,f=b.components.length;e<
f;e++)c=b.components[e-1],d=b.components[e],a+=OpenLayers.Util.distVincenty({lon:c.x,lat:c.y},{lon:d.x,lat:d.y});return 1E3*a},CLASS_NAME:"OpenLayers.Geometry.Curve"});
OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{removeComponent:function(a){var b=this.components&&2<this.components.length;b&&OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);return b},intersects:function(a){var b=!1,c=a.CLASS_NAME;if("OpenLayers.Geometry.LineString"==c||"OpenLayers.Geometry.LinearRing"==c||"OpenLayers.Geometry.Point"==c){var d=this.getSortedSegments(),a="OpenLayers.Geometry.Point"==c?[{x1:a.x,y1:a.y,x2:a.x,y2:a.y}]:a.getSortedSegments(),
e,f,g,h,j,k,l,n=0,m=d.length;a:for(;n<m;++n){c=d[n];e=c.x1;f=c.x2;g=c.y1;h=c.y2;var o=0,q=a.length;for(;o<q;++o){j=a[o];if(j.x1>f)break;if(!(j.x2<e)&&(k=j.y1,l=j.y2,!(Math.min(k,l)>Math.max(g,h))&&!(Math.max(k,l)<Math.min(g,h))&&OpenLayers.Geometry.segmentsIntersect(c,j))){b=!0;break a}}}}else b=a.intersects(this);return b},getSortedSegments:function(){for(var a=this.components.length-1,b=Array(a),c,d,e=0;e<a;++e)c=this.components[e],d=this.components[e+1],b[e]=c.x<d.x?{x1:c.x,y1:c.y,x2:d.x,y2:d.y}:
{x1:d.x,y1:d.y,x2:c.x,y2:c.y};return b.sort(function(a,b){return a.x1-b.x1})},splitWithSegment:function(a,b){for(var c=!(b&&!1===b.edge),d=b&&b.tolerance,e=[],f=this.getVertices(),g=[],h=[],j=!1,k,l,n,m={point:!0,tolerance:d},o=null,q=0,r=f.length-2;q<=r;++q)if(d=f[q],g.push(d.clone()),k=f[q+1],l={x1:d.x,y1:d.y,x2:k.x,y2:k.y},l=OpenLayers.Geometry.segmentsIntersect(a,l,m),l instanceof OpenLayers.Geometry.Point&&((n=l.x===a.x1&&l.y===a.y1||l.x===a.x2&&l.y===a.y2||l.equals(d)||l.equals(k)?!0:!1)||c))l.equals(h[h.length-
1])||h.push(l.clone()),!(0===q&&l.equals(d))&&!l.equals(k)&&(j=!0,l.equals(d)||g.push(l),e.push(new OpenLayers.Geometry.LineString(g)),g=[l.clone()]);j&&(g.push(k.clone()),e.push(new OpenLayers.Geometry.LineString(g)));if(0<h.length)var s=a.x1<a.x2?1:-1,t=a.y1<a.y2?1:-1,o={lines:e,points:h.sort(function(a,b){return s*a.x-s*b.x||t*a.y-t*b.y})};return o},split:function(a,b){var c=null,d=b&&b.mutual,e,f,g,h;if(a instanceof OpenLayers.Geometry.LineString){var j=this.getVertices(),k,l,n,m,o,q=[];g=[];
for(var r=0,s=j.length-2;r<=s;++r){k=j[r];l=j[r+1];n={x1:k.x,y1:k.y,x2:l.x,y2:l.y};h=h||[a];d&&q.push(k.clone());for(var t=0;t<h.length;++t)if(m=h[t].splitWithSegment(n,b))if(o=m.lines,0<o.length&&(o.unshift(t,1),Array.prototype.splice.apply(h,o),t+=o.length-2),d)for(var u=0,w=m.points.length;u<w;++u)o=m.points[u],o.equals(k)||(q.push(o),g.push(new OpenLayers.Geometry.LineString(q)),q=o.equals(l)?[]:[o.clone()])}d&&0<g.length&&0<q.length&&(q.push(l.clone()),g.push(new OpenLayers.Geometry.LineString(q)))}else c=
a.splitWith(this,b);h&&1<h.length?f=!0:h=[];g&&1<g.length?e=!0:g=[];if(f||e)c=d?[g,h]:h;return c},splitWith:function(a,b){return a.split(this,b)},getVertices:function(a){return!0===a?[this.components[0],this.components[this.components.length-1]]:!1===a?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(a,b){var c=!(b&&!1===b.edge)&&b&&b.details,d,e={},f=Number.POSITIVE_INFINITY;if(a instanceof OpenLayers.Geometry.Point){for(var g=this.getSortedSegments(),
h=a.x,j=a.y,k,l=0,n=g.length;l<n;++l)if(k=g[l],d=OpenLayers.Geometry.distanceToSegment(a,k),d.distance<f){if(f=d.distance,e=d,0===f)break}else if(k.x2>h&&(j>k.y1&&j<k.y2||j<k.y1&&j>k.y2))break;e=c?{distance:e.distance,x0:e.x,y0:e.y,x1:h,y1:j}:e.distance}else if(a instanceof OpenLayers.Geometry.LineString){var g=this.getSortedSegments(),h=a.getSortedSegments(),m,o,q=h.length,r={point:!0},l=0,n=g.length;a:for(;l<n;++l){j=g[l];k=j.x1;o=j.y1;for(var s=0;s<q;++s)if(d=h[s],m=OpenLayers.Geometry.segmentsIntersect(j,
d,r)){f=0;e={distance:0,x0:m.x,y0:m.y,x1:m.x,y1:m.y};break a}else if(d=OpenLayers.Geometry.distanceToSegment({x:k,y:o},d),d.distance<f)f=d.distance,e={distance:f,x0:k,y0:o,x1:d.x,y1:d.y}}if(!c)e=e.distance;0!==f&&j&&(d=a.distanceTo(new OpenLayers.Geometry.Point(j.x2,j.y2),b),l=c?d.distance:d,l<f&&(e=c?{distance:f,x0:d.x1,y0:d.y1,x1:d.x0,y1:d.y0}:l))}else e=a.distanceTo(this,b),c&&(e={distance:e.distance,x0:e.x1,y0:e.y1,x1:e.x0,y1:e.y0});return e},simplify:function(a){if(this&&null!==this){var b=this.getVertices();
if(3>b.length)return this;var c=function(a,b,d,j){for(var k=0,l=0,n=b,m;n<d;n++){m=a[b];var o=a[d],q=a[n],q=Math.abs(0.5*(m.x*o.y+o.x*q.y+q.x*m.y-o.x*m.y-q.x*o.y-m.x*q.y));m=Math.sqrt(Math.pow(m.x-o.x,2)+Math.pow(m.y-o.y,2));m=2*(q/m);m>k&&(k=m,l=n)}k>j&&l!=b&&(e.push(l),c(a,b,l,j),c(a,l,d,j))},d=b.length-1,e=[];e.push(0);for(e.push(d);b[0].equals(b[d]);)d--,e.push(d);c(b,0,d,a);a=[];e.sort(function(a,b){return a-b});for(d=0;d<e.length;d++)a.push(b[e[d]]);return new OpenLayers.Geometry.LineString(a)}return this},
CLASS_NAME:"OpenLayers.Geometry.LineString"});
OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,maxVertices:null,doubleTouchTolerance:20,freehand:!1,freehandToggle:"shiftKey",timerId:null,redoStack:null,createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);
this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:!0})},destroyFeature:function(a){OpenLayers.Handler.Point.prototype.destroyFeature.call(this,a);this.line=null},destroyPersistedFeature:function(){var a=this.layer;a&&2<a.features.length&&this.layer.features[0].destroy()},removePoint:function(){this.point&&this.layer.removeFeatures([this.point])},addPoint:function(a){this.layer.removeFeatures([this.point]);a=this.layer.getLonLatFromViewPortPx(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a.lon,
a.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(a,b){var c=this.line.geometry.components[this.getCurrentPointIndex()-
1];c&&!isNaN(c.x)&&!isNaN(c.y)&&this.insertXY(c.x+a,c.y+b)},insertDirectionLength:function(a,b){var a=a*(Math.PI/180),c=b*Math.cos(a),d=b*Math.sin(a);this.insertDeltaXY(c,d)},insertDeflectionLength:function(a,b){var c=this.getCurrentPointIndex()-1;if(0<c){var d=this.line.geometry.components[c],c=this.line.geometry.components[c-1];this.insertDirectionLength(180*Math.atan2(d.y-c.y,d.x-c.x)/Math.PI+a,b)}},getCurrentPointIndex:function(){return this.line.geometry.components.length-1},undo:function(){var a=
this.line.geometry,b=a.components,c=this.getCurrentPointIndex()-1,d=b[c],e=a.removeComponent(d);if(e){if(this.touch&&0<c)b=a.components,a=b[c-1],c=this.getCurrentPointIndex(),b=b[c],b.x=a.x,b.y=a.y;if(!this.redoStack)this.redoStack=[];this.redoStack.push(d);this.drawFeature()}return e},redo:function(){var a=this.redoStack&&this.redoStack.pop();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(a,b){this.line||this.createFeature(a);var c=this.layer.getLonLatFromViewPortPx(a);this.point.geometry.x=c.lon;this.point.geometry.y=c.lat;this.callback("modify",[this.point.geometry,this.getSketch(),b]);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;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))return this.finishGeometry(),window.clearTimeout(this.timerId),this.timerId=null,!1;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;this.freehandMode(a)&&(b=!0,this.touch&&(this.modifyFeature(a.xy,!!this.lastUp),OpenLayers.Event.stop(a)));!this.touch&&(!this.lastDown||!this.passesTolerance(this.lastDown,a.xy,this.pixelTolerance))&&this.modifyFeature(a.xy,!!this.lastUp);this.mouseDown=!0;this.lastDown=a.xy;this.stoppedDown=b;return!b},move:function(a){if(this.stoppedDown&&this.freehandMode(a))return this.persist&&this.destroyPersistedFeature(),this.maxVertices&&this.line&&this.line.geometry.components.length===
this.maxVertices?(this.removePoint(),this.finalize()):this.addPoint(a.xy),!1;!this.touch&&(!this.mouseDown||this.stoppedDown)&&this.modifyFeature(a.xy,!!this.lastUp);return!0},up:function(a){if(this.mouseDown&&(!this.lastUp||!this.lastUp.equals(a.xy)))if(this.stoppedDown&&this.freehandMode(a))this.persist&&this.destroyPersistedFeature(),this.removePoint(),this.finalize();else if(this.passesTolerance(this.lastDown,a.xy,this.pixelTolerance))this.touch&&this.modifyFeature(a.xy),null==this.lastUp&&this.persist&&
this.destroyPersistedFeature(),this.addPoint(a.xy),this.lastUp=a.xy,this.line.geometry.components.length===this.maxVertices+1&&this.finishGeometry();this.stoppedDown=this.stopDown;this.mouseDown=!1;return!this.stopUp},finishGeometry:function(){this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length-1]);this.removePoint();this.finalize()},dblclick:function(a){this.freehandMode(a)||this.finishGeometry();return!1},CLASS_NAME:"OpenLayers.Handler.Path"});
OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],addComponent:function(a,b){var c=!1,d=this.components.pop();if(null!=b||!a.equals(d))c=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments);OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]);return c},removeComponent:function(a){var b=this.components&&3<this.components.length;b&&(this.components.pop(),OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,
arguments),OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]));return b},move:function(a,b){for(var c=0,d=this.components.length;c<d-1;c++)this.components[c].move(a,b)},rotate:function(a,b){for(var c=0,d=this.components.length;c<d-1;++c)this.components[c].rotate(a,b)},resize:function(a,b,c){for(var d=0,e=this.components.length;d<e-1;++d)this.components[d].resize(a,b,c);return this},transform:function(a,b){if(a&&b){for(var c=0,d=this.components.length;c<d-1;c++)this.components[c].transform(a,
b);this.bounds=null}return this},getCentroid:function(){if(this.components){var a=this.components.length;if(0<a&&2>=a)return this.components[0].clone();if(2<a){var b=0,c=0,d=this.components[0].x,e=this.components[0].y,f=-1*this.getArea();if(0!=f){for(var g=0;g<a-1;g++)var h=this.components[g],j=this.components[g+1],b=b+(h.x+j.x-2*d)*((h.x-d)*(j.y-e)-(j.x-d)*(h.y-e)),c=c+(h.y+j.y-2*e)*((h.x-d)*(j.y-e)-(j.x-d)*(h.y-e));b=d+b/(6*f);a=e+c/(6*f)}else{for(g=0;g<a-1;g++)b+=this.components[g].x,c+=this.components[g].y;
b/=a-1;a=c/(a-1)}return new OpenLayers.Geometry.Point(b,a)}return null}},getArea:function(){var a=0;if(this.components&&2<this.components.length){for(var b=a=0,c=this.components.length;b<c-1;b++)var d=this.components[b],e=this.components[b+1],a=a+(d.x+e.x)*(e.y-d.y);a=-a/2}return a},getGeodesicArea:function(a){var b=this;if(a){var c=new OpenLayers.Projection("EPSG:4326");c.equals(a)||(b=this.clone().transform(a,c))}a=0;c=b.components&&b.components.length;if(2<c){for(var d,e,f=0;f<c-1;f++)d=b.components[f],
e=b.components[f+1],a+=OpenLayers.Util.rad(e.x-d.x)*(2+Math.sin(OpenLayers.Util.rad(d.y))+Math.sin(OpenLayers.Util.rad(e.y)));a=40680631590769*a/2}return a},containsPoint:function(a){for(var b=OpenLayers.Number.limitSigDigs,c=b(a.x,14),a=b(a.y,14),d=this.components.length-1,e,f,g,h,j,k=0,l=0;l<d;++l)if(e=this.components[l],g=b(e.x,14),e=b(e.y,14),f=this.components[l+1],h=b(f.x,14),f=b(f.y,14),e==f){if(a==e&&(g<=h&&c>=g&&c<=h||g>=h&&c<=g&&c>=h)){k=-1;break}}else{j=b((a-f)*((h-g)/(f-e))+h,14);if(j==
c&&(e<f&&a>=e&&a<=f||e>f&&a<=e&&a>=f)){k=-1;break}j<=c||g!=h&&(j<Math.min(g,h)||j>Math.max(g,h))||(e<f&&a>=e&&a<f||e>f&&a<e&&a>=f)&&++k}return-1==k?1:!!(k&1)},intersects:function(a){var b=!1;if("OpenLayers.Geometry.Point"==a.CLASS_NAME)b=this.containsPoint(a);else if("OpenLayers.Geometry.LineString"==a.CLASS_NAME)b=a.intersects(this);else if("OpenLayers.Geometry.LinearRing"==a.CLASS_NAME)b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[a]);else for(var c=0,d=a.components.length;c<
d&&!(b=a.components[c].intersects(this));++c);return b},getVertices:function(a){return!0===a?[]: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 a=0;if(this.components&&0<this.components.length)for(var a=a+Math.abs(this.components[0].getArea()),b=1,c=this.components.length;b<c;b++)a-=Math.abs(this.components[b].getArea());return a},getGeodesicArea:function(a){var b=0;if(this.components&&0<this.components.length)for(var b=b+Math.abs(this.components[0].getGeodesicArea(a)),c=1,d=this.components.length;c<
d;c++)b-=Math.abs(this.components[c].getGeodesicArea(a));return b},containsPoint:function(a){var b=this.components.length,c=!1;if(0<b&&(c=this.components[0].containsPoint(a),1!==c&&c&&1<b))for(var d,e=1;e<b;++e)if(d=this.components[e].containsPoint(a)){c=1===d?1:!1;break}return c},intersects:function(a){var b=!1,c,d;if("OpenLayers.Geometry.Point"==a.CLASS_NAME)b=this.containsPoint(a);else if("OpenLayers.Geometry.LineString"==a.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==a.CLASS_NAME){for(c=0,d=
this.components.length;c<d&&!(b=a.intersects(this.components[c]));++c);if(!b)for(c=0,d=a.components.length;c<d&&!(b=this.containsPoint(a.components[c]));++c);}else for(c=0,d=a.components.length;c<d&&!(b=this.intersects(a.components[c]));++c);if(!b&&"OpenLayers.Geometry.Polygon"==a.CLASS_NAME){var e=this.components[0];for(c=0,d=e.components.length;c<d&&!(b=a.containsPoint(e.components[c]));++c);}return b},distanceTo:function(a,b){return b&&!1===b.edge&&this.intersects(a)?0:OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,
[a,b])},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(a,b,c,d){var e=Math.PI*(1/c-0.5);d&&(e+=d/180*Math.PI);for(var f,g=[],h=0;h<c;++h)f=e+2*h*Math.PI/c,d=a.x+b*Math.cos(f),f=a.y+b*Math.sin(f),g.push(new OpenLayers.Geometry.Point(d,f));a=new OpenLayers.Geometry.LinearRing(g);return new OpenLayers.Geometry.Polygon([a])};
OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{holeModifier:null,drawingHole:!1,polygon:null,createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,
this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:!0})},addPoint:function(a){if(!this.drawingHole&&this.holeModifier&&this.evt&&this.evt[this.holeModifier])for(var b=this.point.geometry,c=this.control.layer.features,d,e=c.length-1;0<=e;--e)if(d=c[e].geometry,(d instanceof OpenLayers.Geometry.Polygon||d instanceof OpenLayers.Geometry.MultiPolygon)&&d.intersects(b)){b=c[e];this.control.layer.removeFeatures([b],{silent:!0});this.control.layer.events.registerPriority("sketchcomplete",
this,this.finalizeInteriorRing);this.control.layer.events.registerPriority("sketchmodified",this,this.enforceTopology);b.geometry.addComponent(this.line.geometry);this.polygon=b;this.drawingHole=!0;break}OpenLayers.Handler.Path.prototype.addPoint.apply(this,arguments)},getCurrentPointIndex:function(){return this.line.geometry.components.length-2},enforceTopology:function(a){var a=a.vertex,b=this.line.geometry.components;if(!this.polygon.geometry.intersects(a))b=b[b.length-3],a.x=b.x,a.y=b.y},finishGeometry:function(){this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length-
2]);this.removePoint();this.finalize()},finalizeInteriorRing:function(){var a=this.line.geometry,b=0!==a.getArea();if(b){for(var c=this.polygon.geometry.components,d=c.length-2;0<=d;--d)if(a.intersects(c[d])){b=!1;break}if(b){d=c.length-2;a:for(;0<d;--d)for(var e=c[d].components,f=0,g=e.length;f<g;++f)if(a.containsPoint(e[f])){b=!1;break a}}}if(b){if(this.polygon.state!==OpenLayers.State.INSERT)this.polygon.state=OpenLayers.State.UPDATE}else this.polygon.geometry.removeComponent(a);this.restoreFeature();
return!1},cancel:function(){this.drawingHole&&(this.polygon.geometry.removeComponent(this.line.geometry),this.restoreFeature(!0));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:!0});this.control.layer.addFeatures([this.polygon],{silent:!0});
this.drawingHole=!1;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;a&&this.multi&&(a=new OpenLayers.Geometry.MultiPolygon([a]));return a},
CLASS_NAME:"OpenLayers.Handler.Polygon"});
OpenLayers.Kinetic=OpenLayers.Class({threshold:0,deceleration:0.0035,nbPoints:100,delay:200,points:void 0,timerId:void 0,initialize:function(a){OpenLayers.Util.extend(this,a)},begin:function(){OpenLayers.Animation.stop(this.timerId);this.timerId=void 0;this.points=[]},update:function(a){this.points.unshift({xy:a,tick:(new Date).getTime()});this.points.length>this.nbPoints&&this.points.pop()},end:function(a){for(var b,c=(new Date).getTime(),d=0,e=this.points.length,f;d<e;d++){f=this.points[d];if(c-
f.tick>this.delay)break;b=f}if(b&&(d=(new Date).getTime()-b.tick,c=Math.sqrt(Math.pow(a.x-b.xy.x,2)+Math.pow(a.y-b.xy.y,2)),d=c/d,!(0==d||d<this.threshold)))return c=Math.asin((a.y-b.xy.y)/c),b.xy.x<=a.x&&(c=Math.PI-c),{speed:d,theta:c}},move:function(a,b){var c=a.speed,d=Math.cos(a.theta),e=-Math.sin(a.theta),f=(new Date).getTime(),g=0,h=0;this.timerId=OpenLayers.Animation.start(OpenLayers.Function.bind(function(){if(null!=this.timerId){var a=(new Date).getTime()-f,k=-this.deceleration*Math.pow(a,
2)/2+c*a,l=k*d,k=k*e,n,m;n=!1;if(0>=-this.deceleration*a+c)OpenLayers.Animation.stop(this.timerId),this.timerId=null,n=!0;a=l-g;m=k-h;g=l;h=k;b(a,m,n)}},this))},CLASS_NAME:"OpenLayers.Kinetic"});
OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],split:function(a,b){for(var c=null,d=b&&b.mutual,e,f,g,h,j=[],k=[a],l=0,n=this.components.length;l<n;++l){f=this.components[l];g=!1;for(var m=0;m<k.length;++m)if(e=f.split(k[m],b)){if(d){g=e[0];for(var o=0,q=g.length;o<q;++o)0===o&&j.length?j[j.length-1].addComponent(g[o]):j.push(new OpenLayers.Geometry.MultiLineString([g[o]]));g=!0;e=e[1]}if(e.length){e.unshift(m,
1);Array.prototype.splice.apply(k,e);break}}g||(j.length?j[j.length-1].addComponent(f.clone()):j=[new OpenLayers.Geometry.MultiLineString(f.clone())])}j&&1<j.length?g=!0:j=[];k&&1<k.length?h=!0:k=[];if(g||h)c=d?[j,k]:k;return c},splitWith:function(a,b){var c=null,d=b&&b.mutual,e,f,g,h,j,k;if(a instanceof OpenLayers.Geometry.LineString){k=[];j=[a];for(var l=0,n=this.components.length;l<n;++l){g=!1;f=this.components[l];for(var m=0;m<j.length;++m)if(e=j[m].split(f,b)){d&&(g=e[0],g.length&&(g.unshift(m,
1),Array.prototype.splice.apply(j,g),m+=g.length-2),e=e[1],0===e.length&&(e=[f.clone()]));g=0;for(var o=e.length;g<o;++g)0===g&&k.length?k[k.length-1].addComponent(e[g]):k.push(new OpenLayers.Geometry.MultiLineString([e[g]]));g=!0}g||(k.length?k[k.length-1].addComponent(f.clone()):k=[new OpenLayers.Geometry.MultiLineString([f.clone()])])}}else c=a.split(this);j&&1<j.length?h=!0:j=[];k&&1<k.length?g=!0:k=[];if(h||g)c=d?[j,k]:k;return c},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});
OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});
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(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b={exceptionReport:null};a.documentElement&&(this.readChildNodes(a,b),null===b.exceptionReport&&(b=(new OpenLayers.Format.OWSCommon).read(a)));return b},readers:{ogc:{ServiceExceptionReport:function(a,
b){b.exceptionReport={exceptions:[]};this.readChildNodes(a,b.exceptionReport)},ServiceException:function(a,b){var c={code:a.getAttribute("code"),locator:a.getAttribute("locator"),text:this.getChildValue(a)};b.exceptions.push(c)}}},CLASS_NAME:"OpenLayers.Format.OGCExceptionReport"});
OpenLayers.Format.XML.VersionedOGC=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:null,version:null,profile:null,allowFallback:!1,name:null,stringifyOutput:!1,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);a=this.CLASS_NAME;this.name=a.substring(a.lastIndexOf(".")+1)},getVersion:function(a,b){var c;if(a){if(c=this.version,!c&&(c=a.getAttribute("version"),!c))c=this.defaultVersion}else c=b&&b.version||this.version||this.defaultVersion;return c},
getParser:function(a){var a=a||this.defaultVersion,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&&(""!==b&&this.allowFallback&&(b="",c=OpenLayers.Format[this.name]["v"+a.replace(/\./g,"_")]),!c))throw"Can't find a "+this.name+" parser for version "+a+b;this.parser=new c(this.options)}return this.parser},write:function(a,b){this.parser=this.getParser(this.getVersion(null,b));var c=this.parser.write(a,
b);return!1===this.stringifyOutput?c:OpenLayers.Format.XML.prototype.write.apply(this,[c])},read:function(a,b){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var c=this.getVersion(a.documentElement);this.parser=this.getParser(c);var d=this.parser.read(a,b),e=this.parser.errorProperty||null;if(null!==e&&void 0===d[e])e=new OpenLayers.Format.OGCExceptionReport,d.error=e.read(a);d.version=c;return d},CLASS_NAME:"OpenLayers.Format.XML.VersionedOGC"});
OpenLayers.Filter=OpenLayers.Class({initialize:function(a){OpenLayers.Util.extend(this,a)},destroy:function(){},evaluate:function(){return!0},clone:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.CQL?OpenLayers.Format.CQL.prototype.write(this):Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Filter"});
OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,type:"FID",initialize:function(a){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(a){for(var b=0,c=this.fids.length;b<c;b++)if((a.fid||a.id)==this.fids[b])return!0;return!1},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(a){var b,c;switch(this.type){case OpenLayers.Filter.Logical.AND:for(b=0,c=this.filters.length;b<c;b++)if(!1==this.filters[b].evaluate(a))return!1;return!0;case OpenLayers.Filter.Logical.OR:for(b=0,c=this.filters.length;b<
c;b++)if(!0==this.filters[b].evaluate(a))return!0;return!1;case OpenLayers.Filter.Logical.NOT:return!this.filters[0].evaluate(a)}},clone:function(){for(var a=[],b=0,c=this.filters.length;b<c;++b)a.push(this.filters[b].clone());return new OpenLayers.Filter.Logical({type:this.type,filters:a})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";
OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:!0,lowerBoundary:null,upperBoundary:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a]);if(this.type===OpenLayers.Filter.Comparison.LIKE&&void 0===a.matchCase)this.matchCase=null},evaluate:function(a){if(a instanceof OpenLayers.Feature.Vector)a=a.attributes;var b=!1,a=a[this.property];switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:b=this.value;
b=!this.matchCase&&"string"==typeof a&&"string"==typeof b?a.toUpperCase()==b.toUpperCase():a==b;break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:b=this.value;b=!this.matchCase&&"string"==typeof a&&"string"==typeof b?a.toUpperCase()!=b.toUpperCase():a!=b;break;case OpenLayers.Filter.Comparison.LESS_THAN:b=a<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:b=a>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:b=a<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:b=
a>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:b=a>=this.lowerBoundary&&a<=this.upperBoundary;break;case OpenLayers.Filter.Comparison.LIKE:b=RegExp(this.value,"gi").test(a);break;case OpenLayers.Filter.Comparison.IS_NULL:b=null===a}return b},value2regex:function(a,b,c){if("."==a)throw Error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison");a=a?a:"*";b=b?b:".";this.value=this.value.replace(RegExp("\\"+(c?c:"!")+"(.|$)","g"),"\\$1");this.value=this.value.replace(RegExp("\\"+
b,"g"),".");this.value=this.value.replace(RegExp("\\"+a,"g"),".*");this.value=this.value.replace(RegExp("\\\\.\\*","g"),"\\"+a);return this.value=this.value.replace(RegExp("\\\\\\.","g"),"\\"+b)},regex2value:function(){var a=this.value,a=a.replace(/!/g,"!!"),a=a.replace(/(\\)?\\\./g,function(a,c){return c?a:"!."}),a=a.replace(/(\\)?\\\*/g,function(a,c){return c?a:"!*"}),a=a.replace(/\\\\/g,"\\");return a=a.replace(/\.\*/g,"*")},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison,
this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.Comparison.IS_NULL="NULL";
OpenLayers.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){for(var b="",c=a.firstChild;c;c=
c.nextSibling)switch(c.nodeType){case 1:a=this.readNode(c);a.property?b+="${"+a.property+"}":void 0!==a.value&&(b+=a.value);break;case 3:case 4:b+=c.nodeValue}return b},Filter:function(a,b){var c={fids:[],filters:[]};this.readChildNodes(a,c);if(0<c.fids.length)b.filter=new OpenLayers.Filter.FeatureId({fids:c.fids});else if(0<c.filters.length)b.filter=c.filters[0]},FeatureId:function(a,b){var c=a.getAttribute("fid");c&&b.fids.push(c)},And:function(a,b){var c=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});
this.readChildNodes(a,c);b.filters.push(c)},Or:function(a,b){var c=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(a,c);b.filters.push(c)},Not:function(a,b){var c=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLessThan:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsGreaterThan:function(a,
b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLessThanOrEqualTo:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsGreaterThanOrEqualTo:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)},
PropertyIsBetween:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(a,c);b.filters.push(c)},Literal:function(a,b){b.value=OpenLayers.String.numericIf(this.getChildValue(a),!0)},PropertyName:function(a,b){b.property=this.getChildValue(a)},LowerBoundary:function(a,b){b.lowerBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,a),!0)},UpperBoundary:function(a,b){b.upperBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,
a),!0)},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(){},PropertyIsNull:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.IS_NULL});
this.readChildNodes(a,c);b.filters.push(c)}}},readSpatial:function(a,b,c){c=new OpenLayers.Filter.Spatial({type:c});this.readChildNodes(a,c);c.value=c.components[0];delete c.components;b.filters.push(c)},encodeLiteral:function(a){a instanceof Date&&(a=OpenLayers.Date.toISOString(a));return a},writeOgcExpression:function(a,b){a instanceof OpenLayers.Filter.Function?this.writeNode("Function",a,b):this.writeNode("Literal",a,b);return b},write:function(a){return this.writers.ogc.Filter.apply(this,[a])},
writers:{ogc:{Filter:function(a){var b=this.createElementNSPlus("ogc:Filter");this.writeNode(this.getFilterType(a),a,b);return b},_featureIds:function(a){for(var b=this.createDocumentFragment(),c=0,d=a.fids.length;c<d;++c)this.writeNode("ogc:FeatureId",a.fids[c],b);return b},FeatureId:function(a){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:a}})},And:function(a){for(var b=this.createElementNSPlus("ogc:And"),c,d=0,e=a.filters.length;d<e;++d)c=a.filters[d],this.writeNode(this.getFilterType(c),
c,b);return b},Or:function(a){for(var b=this.createElementNSPlus("ogc:Or"),c,d=0,e=a.filters.length;d<e;++d)c=a.filters[d],this.writeNode(this.getFilterType(c),c,b);return b},Not:function(a){var b=this.createElementNSPlus("ogc:Not"),a=a.filters[0];this.writeNode(this.getFilterType(a),a,b);return b},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:(this.encodeLiteral||OpenLayers.Format.Filter.v1.prototype.encodeLiteral)(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(a){for(var b=this.createElementNSPlus("ogc:Function",{attributes:{name:a.name}}),a=a.params,c=0,d=a.length;c<d;c++)this.writeOgcExpression(a[c],b);return b},PropertyIsNull:function(a){var b=this.createElementNSPlus("ogc:PropertyIsNull");this.writeNode("PropertyName",a,b);return b}}},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",NULL:"PropertyIsNull",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"_featureIds"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});
OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.umn.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"features",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.opengis.net/gml",extractAttributes:!0,xy:!0,initialize:function(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(a){"string"==
typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));for(var a=this.getElementsByTagNameNS(a.documentElement,this.gmlns,this.featureName),b=[],c=0;c<a.length;c++){var d=this.parseFeature(a[c]);d&&b.push(d)}return b},parseFeature:function(a){for(var b="MultiPolygon,Polygon,MultiLineString,LineString,MultiPoint,Point,Envelope".split(","),c,d,e,f=0;f<b.length;++f)if(c=b[f],d=this.getElementsByTagNameNS(a,this.gmlns,c),0<d.length){if(e=this.parseGeometry[c.toLowerCase()])e=e.apply(this,
[d[0]]),this.internalProjection&&this.externalProjection&&e.transform(this.externalProjection,this.internalProjection);else throw new TypeError("Unsupported geometry type: "+c);break}var g;c=this.getElementsByTagNameNS(a,this.gmlns,"Box");for(f=0;f<c.length;++f)b=c[f],d=this.parseGeometry.box.apply(this,[b]),b=b.parentNode,"boundedBy"===(b.localName||b.nodeName.split(":").pop())?g=d:e=d.toGeometry();var h;this.extractAttributes&&(h=this.parseAttributes(a));h=new OpenLayers.Feature.Vector(e,h);h.bounds=
g;h.gml={featureType:a.firstChild.nodeName.split(":")[1],featureNS:a.firstChild.namespaceURI,featureNSPrefix:a.firstChild.prefix};for(var a=a.firstChild,j;a&&!(1==a.nodeType&&(j=a.getAttribute("fid")||a.getAttribute("id")));)a=a.nextSibling;h.fid=j;return h},parseGeometry:{point:function(a){var b,c;c=[];b=this.getElementsByTagNameNS(a,this.gmlns,"pos");if(0<b.length)c=b[0].firstChild.nodeValue,c=c.replace(this.regExes.trimSpace,""),c=c.split(this.regExes.splitSpace);if(0==c.length&&(b=this.getElementsByTagNameNS(a,
this.gmlns,"coordinates"),0<b.length))c=b[0].firstChild.nodeValue,c=c.replace(this.regExes.removeSpace,""),c=c.split(",");0==c.length&&(b=this.getElementsByTagNameNS(a,this.gmlns,"coord"),0<b.length&&(a=this.getElementsByTagNameNS(b[0],this.gmlns,"X"),b=this.getElementsByTagNameNS(b[0],this.gmlns,"Y"),0<a.length&&0<b.length&&(c=[a[0].firstChild.nodeValue,b[0].firstChild.nodeValue])));2==c.length&&(c[2]=null);return this.xy?new OpenLayers.Geometry.Point(c[0],c[1],c[2]):new OpenLayers.Geometry.Point(c[1],
c[0],c[2])},multipoint:function(a){var a=this.getElementsByTagNameNS(a,this.gmlns,"Point"),b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.point.apply(this,[a[d]]))&&b.push(c);return new OpenLayers.Geometry.MultiPoint(b)},linestring:function(a,b){var c,d;d=[];var e=[];c=this.getElementsByTagNameNS(a,this.gmlns,"posList");if(0<c.length){d=this.getChildValue(c[0]);d=d.replace(this.regExes.trimSpace,"");d=d.split(this.regExes.splitSpace);var f=parseInt(c[0].getAttribute("dimension")),
g,h,j;for(c=0;c<d.length/f;++c)g=c*f,h=d[g],j=d[g+1],g=2==f?null:d[g+2],this.xy?e.push(new OpenLayers.Geometry.Point(h,j,g)):e.push(new OpenLayers.Geometry.Point(j,h,g))}if(0==d.length&&(c=this.getElementsByTagNameNS(a,this.gmlns,"coordinates"),0<c.length)){d=this.getChildValue(c[0]);d=d.replace(this.regExes.trimSpace,"");d=d.replace(this.regExes.trimComma,",");f=d.split(this.regExes.splitSpace);for(c=0;c<f.length;++c)d=f[c].split(","),2==d.length&&(d[2]=null),this.xy?e.push(new OpenLayers.Geometry.Point(d[0],
d[1],d[2])):e.push(new OpenLayers.Geometry.Point(d[1],d[0],d[2]))}d=null;0!=e.length&&(d=b?new OpenLayers.Geometry.LinearRing(e):new OpenLayers.Geometry.LineString(e));return d},multilinestring:function(a){var a=this.getElementsByTagNameNS(a,this.gmlns,"LineString"),b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.linestring.apply(this,[a[d]]))&&b.push(c);return new OpenLayers.Geometry.MultiLineString(b)},polygon:function(a){var a=this.getElementsByTagNameNS(a,this.gmlns,"LinearRing"),
b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.linestring.apply(this,[a[d],!0]))&&b.push(c);return new OpenLayers.Geometry.Polygon(b)},multipolygon:function(a){var a=this.getElementsByTagNameNS(a,this.gmlns,"Polygon"),b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.polygon.apply(this,[a[d]]))&&b.push(c);return new OpenLayers.Geometry.MultiPolygon(b)},envelope:function(a){var b=[],c,d,e=this.getElementsByTagNameNS(a,this.gmlns,"lowerCorner");if(0<e.length){c=
[];if(0<e.length)c=e[0].firstChild.nodeValue,c=c.replace(this.regExes.trimSpace,""),c=c.split(this.regExes.splitSpace);2==c.length&&(c[2]=null);var f=this.xy?new OpenLayers.Geometry.Point(c[0],c[1],c[2]):new OpenLayers.Geometry.Point(c[1],c[0],c[2])}a=this.getElementsByTagNameNS(a,this.gmlns,"upperCorner");if(0<a.length){c=[];if(0<a.length)c=a[0].firstChild.nodeValue,c=c.replace(this.regExes.trimSpace,""),c=c.split(this.regExes.splitSpace);2==c.length&&(c[2]=null);var g=this.xy?new OpenLayers.Geometry.Point(c[0],
c[1],c[2]):new OpenLayers.Geometry.Point(c[1],c[0],c[2])}f&&g&&(b.push(new OpenLayers.Geometry.Point(f.x,f.y)),b.push(new OpenLayers.Geometry.Point(g.x,f.y)),b.push(new OpenLayers.Geometry.Point(g.x,g.y)),b.push(new OpenLayers.Geometry.Point(f.x,g.y)),b.push(new OpenLayers.Geometry.Point(f.x,f.y)),b=new OpenLayers.Geometry.LinearRing(b),d=new OpenLayers.Geometry.Polygon([b]));return d},box:function(a){var b=this.getElementsByTagNameNS(a,this.gmlns,"coordinates"),c=a=null;if(0<b.length)b=b[0].firstChild.nodeValue,
b=b.split(" "),2==b.length&&(a=b[0].split(","),c=b[1].split(","));if(null!==a&&null!==c)return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(c[0]),parseFloat(c[1]))}},parseAttributes:function(a){for(var b={},a=a.firstChild,c,d,e;a;){if(1==a.nodeType){a=a.childNodes;for(c=0;c<a.length;++c)if(d=a[c],1==d.nodeType)if(e=d.childNodes,1==e.length){if(e=e[0],3==e.nodeType||4==e.nodeType)d=d.prefix?d.nodeName.split(":")[1]:d.nodeName,e=e.nodeValue.replace(this.regExes.trimSpace,""),b[d]=
e}else b[d.nodeName.split(":").pop()]=null;break}a=a.nextSibling}return b},write:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName),c=0;c<a.length;c++)b.appendChild(this.createFeatureXML(a[c]));return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(a){var b=this.buildGeometryNode(a.geometry),c=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);c.appendChild(b);
var b=this.createElementNS(this.gmlns,"gml:"+this.featureName),d=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);d.setAttribute("fid",a.fid||a.id);d.appendChild(c);for(var e in a.attributes){var c=this.createTextNode(a.attributes[e]),f=this.createElementNS(this.featureNS,this.featurePrefix+":"+e.substring(e.lastIndexOf(":")+1));f.appendChild(c);d.appendChild(f)}b.appendChild(d);return b},buildGeometryNode:function(a){this.externalProjection&&this.internalProjection&&(a=
a.clone(),a.transform(this.internalProjection,this.externalProjection));var b=a.CLASS_NAME;return this.buildGeometry[b.substring(b.lastIndexOf(".")+1).toLowerCase()].apply(this,[a])},buildGeometry:{point:function(a){var b=this.createElementNS(this.gmlns,"gml:Point");b.appendChild(this.buildCoordinatesNode(a));return b},multipoint:function(a){for(var b=this.createElementNS(this.gmlns,"gml:MultiPoint"),a=a.components,c,d,e=0;e<a.length;e++)c=this.createElementNS(this.gmlns,"gml:pointMember"),d=this.buildGeometry.point.apply(this,
[a[e]]),c.appendChild(d),b.appendChild(c);return b},linestring:function(a){var b=this.createElementNS(this.gmlns,"gml:LineString");b.appendChild(this.buildCoordinatesNode(a));return b},multilinestring:function(a){for(var b=this.createElementNS(this.gmlns,"gml:MultiLineString"),a=a.components,c,d,e=0;e<a.length;++e)c=this.createElementNS(this.gmlns,"gml:lineStringMember"),d=this.buildGeometry.linestring.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c);return b},linearring:function(a){var b=this.createElementNS(this.gmlns,
"gml:LinearRing");b.appendChild(this.buildCoordinatesNode(a));return b},polygon:function(a){for(var b=this.createElementNS(this.gmlns,"gml:Polygon"),a=a.components,c,d,e=0;e<a.length;++e)c=0==e?"outerBoundaryIs":"innerBoundaryIs",c=this.createElementNS(this.gmlns,"gml:"+c),d=this.buildGeometry.linearring.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c);return b},multipolygon:function(a){for(var b=this.createElementNS(this.gmlns,"gml:MultiPolygon"),a=a.components,c,d,e=0;e<a.length;++e)c=this.createElementNS(this.gmlns,
"gml:polygonMember"),d=this.buildGeometry.polygon.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c);return b},bounds:function(a){var b=this.createElementNS(this.gmlns,"gml:Box");b.appendChild(this.buildCoordinatesNode(a));return b}},buildCoordinatesNode:function(a){var b=this.createElementNS(this.gmlns,"gml:coordinates");b.setAttribute("decimal",".");b.setAttribute("cs",",");b.setAttribute("ts"," ");var c=[];if(a instanceof OpenLayers.Bounds)c.push(a.left+","+a.bottom),c.push(a.right+","+a.top);
else for(var a=a.components?a.components:[a],d=0;d<a.length;d++)c.push(a[d].x+","+a[d].y);c=this.createTextNode(c.join(" "));b.appendChild(c);return b},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:!0,srsName:null,xy:!0,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,featureMember:/^(.*:)?featureMembers?$/},
initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.setGeometryTypes();a&&a.featureNS&&this.setNamespace("feature",a.featureNS);this.singleFeatureType=!a||"string"===typeof a.featureType},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));if(a&&9==a.nodeType)a=a.documentElement;var b=[];this.readNode(a,{features:b},!0);if(0==b.length){var c=this.getElementsByTagNameNS(a,this.namespaces.gml,"featureMember");if(c.length)for(var a=
0,d=c.length;a<d;++a)this.readNode(c[a],{features:b},!0);else c=this.getElementsByTagNameNS(a,this.namespaces.gml,"featureMembers"),c.length&&this.readNode(c[0],{features:b},!0)}return b},readNode:function(a,b,c){if(!0===c&&!0===this.autoConfig)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=!0;return OpenLayers.Format.XML.prototype.readNode.apply(this,[a,b])},readers:{gml:{_inherit:function(){},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(a,b){var c={};this.readChildNodes(a,c);if(c.components&&0<c.components.length)b.bounds=c.components[0]},
Point:function(a,b){var c={points:[]};this.readChildNodes(a,c);if(!b.components)b.components=[];b.components.push(c.points[0])},coordinates:function(a,b){for(var c=this.getChildValue(a).replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),c=c.split(this.regExes.splitSpace),d,e=c.length,f=Array(e),g=0;g<e;++g)d=c[g].split(","),f[g]=this.xy?new OpenLayers.Geometry.Point(d[0],d[1],d[2]):new OpenLayers.Geometry.Point(d[1],d[0],d[2]);b.points=f},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(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.MultiPoint(c.components)]},pointMember:function(a,b){this.readChildNodes(a,b)},LineString:function(a,b){var c={};this.readers.gml._inherit.apply(this,
[a,c,b]);this.readChildNodes(a,c);if(!b.components)b.components=[];b.components.push(new OpenLayers.Geometry.LineString(c.points))},MultiLineString:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.MultiLineString(c.components)]},lineStringMember:function(a,b){this.readChildNodes(a,b)},Polygon:function(a,b){var c={outer:null,inner:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);
c.inner.unshift(c.outer);if(!b.components)b.components=[];b.components.push(new OpenLayers.Geometry.Polygon(c.inner))},LinearRing:function(a,b){var c={};this.readers.gml._inherit.apply(this,[a,c]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.LinearRing(c.points)]},MultiPolygon:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.MultiPolygon(c.components)]},polygonMember:function(a,b){this.readChildNodes(a,
b)},GeometryCollection:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.Collection(c.components)]},geometryMember:function(a,b){this.readChildNodes(a,b)}},feature:{"*":function(a,b){var c,d=a.localName||a.nodeName.split(":").pop();b.features?!this.singleFeatureType&&-1!==OpenLayers.Util.indexOf(this.featureType,d)?c="_typeName":d===this.featureType&&(c="_typeName"):0==a.childNodes.length||1==a.childNodes.length&&
3==a.firstChild.nodeType?this.extractAttributes&&(c="_attribute"):c="_geometry";c&&this.readers.feature[c].apply(this,[a,b])},_typeName:function(a,b){var c={components:[],attributes:{}};this.readChildNodes(a,c);if(c.name)c.attributes.name=c.name;var d=new OpenLayers.Feature.Vector(c.components[0],c.attributes);if(!this.singleFeatureType)d.type=a.nodeName.split(":").pop(),d.namespace=a.namespaceURI;var e=a.getAttribute("fid")||this.getAttributeNS(a,this.namespaces.gml,"id");if(e)d.fid=e;this.internalProjection&&
this.externalProjection&&d.geometry&&d.geometry.transform(this.externalProjection,this.internalProjection);if(c.bounds)d.bounds=c.bounds;b.features.push(d)},_geometry:function(a,b){if(!this.geometryName)this.geometryName=a.nodeName.split(":").pop();this.readChildNodes(a,b)},_attribute:function(a,b){var c=a.localName||a.nodeName.split(":").pop(),d=this.getChildValue(a);b.attributes[c]=d}},wfs:{FeatureCollection:function(a,b){this.readChildNodes(a,b)}}},write:function(a){a=this.writeNode("gml:"+(OpenLayers.Util.isArray(a)?
"featureMembers":"featureMember"),a);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(a){for(var b=this.createElementNSPlus("gml:MultiPoint"),a=a.components||[a],c=0,d=a.length;c<d;++c)this.writeNode("pointMember",a[c],b);return b},pointMember:function(a){var b=
this.createElementNSPlus("gml:pointMember");this.writeNode("Point",a,b);return b},MultiLineString:function(a){for(var b=this.createElementNSPlus("gml:MultiLineString"),a=a.components||[a],c=0,d=a.length;c<d;++c)this.writeNode("lineStringMember",a[c],b);return b},lineStringMember:function(a){var b=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",a,b);return b},MultiPolygon:function(a){for(var b=this.createElementNSPlus("gml:MultiPolygon"),a=a.components||[a],c=0,d=a.length;c<
d;++c)this.writeNode("polygonMember",a[c],b);return b},polygonMember:function(a){var b=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",a,b);return b},GeometryCollection:function(a){for(var b=this.createElementNSPlus("gml:GeometryCollection"),c=0,d=a.components.length;c<d;++c)this.writeNode("geometryMember",a.components[c],b);return b},geometryMember:function(a){var b=this.createElementNSPlus("gml:geometryMember"),a=this.writeNode("feature:_geometry",a);b.appendChild(a.firstChild);
return b}},feature:{_typeName:function(a){var b=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:a.fid}});a.geometry&&this.writeNode("feature:_geometry",a.geometry,b);for(var c in a.attributes){var d=a.attributes[c];null!=d&&this.writeNode("feature:_attribute",{name:c,value:d},b)}return b},_geometry:function(a){this.externalProjection&&this.internalProjection&&(a=a.clone().transform(this.internalProjection,this.externalProjection));var b=this.createElementNSPlus("feature:"+this.geometryName),
a=this.writeNode("gml:"+this.geometryTypes[a.CLASS_NAME],a,b);this.srsName&&a.setAttribute("srsName",this.srsName);return b},_attribute:function(a){return this.createElementNSPlus("feature:"+a.name,{value:a.value})}},wfs:{FeatureCollection:function(a){for(var b=this.createElementNSPlus("wfs:FeatureCollection"),c=0,d=a.length;c<d;++c)this.writeNode("gml:featureMember",a[c],b);return b}}},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(a,b){var c={};this.readChildNodes(a,c);b.outer=c.components[0]},innerBoundaryIs:function(a,b){var c={};this.readChildNodes(a,c);b.inner.push(c.components[0])},Box:function(a,b){var c=
{};this.readChildNodes(a,c);if(!b.components)b.components=[];var d=c.points[0],c=c.points[1];b.components.push(new OpenLayers.Bounds(d.x,d.y,c.x,c.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(a){a=this.writeNode(OpenLayers.Util.isArray(a)?"wfs:FeatureCollection":"gml:featureMember",a);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(a){var b=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[a],b);return b},coordinates:function(a){for(var b=a.length,c=Array(b),d,e=0;e<b;++e)d=a[e],c[e]=this.xy?d.x+","+d.y:d.y+","+d.x,void 0!=d.z&&(c[e]+=","+d.z);return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:1==b?c[0]:c.join(" ")})},LineString:function(a){var b=
this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",a.components,b);return b},Polygon:function(a){var b=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",a.components[0],b);for(var c=1;c<a.components.length;++c)this.writeNode("innerBoundaryIs",a.components[c],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(a){var b=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:a.left,y:a.bottom},{x:a.right,y:a.top}],b);this.srsName&&b.setAttribute("srsName",this.srsName);return b}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},
CLASS_NAME:"OpenLayers.Format.GML.v2"});
OpenLayers.Format.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(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsNotEqualTo:function(a,
b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLike:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(a,c);var d=a.getAttribute("wildCard"),e=a.getAttribute("singleChar"),f=a.getAttribute("escape");c.value2regex(d,e,f);b.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 b=this.createElementNSPlus("ogc:BBOX");a.property&&this.writeNode("PropertyName",a,b);var c=this.writeNode("gml:Box",a.value,b);a.projection&&c.setAttribute("srsName",a.projection);return b}},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(a,b){var c=this.createElementNSPlus("ogc:"+b);this.writeNode("PropertyName",a,c);if(a.value instanceof OpenLayers.Filter.Function)this.writeNode("Function",a.value,c);else{var d;d=a.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",a.value).firstChild:this.writeNode("gml:Box",a.value);a.projection&&d.setAttribute("srsName",a.projection);c.appendChild(d)}return c},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"});
OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:!1,multiCurve:!0,surface:!1,multiSurface:!0,initialize:function(a){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[a])},readers:{gml:OpenLayers.Util.applyDefaults({_inherit:function(a,b,c){if(a=parseInt(a.getAttribute("srsDimension"),10)||c&&c.srsDimension)b.srsDimension=a},featureMembers:function(a,
b){this.readChildNodes(a,b)},Curve:function(a,b){var c={points:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);if(!b.components)b.components=[];b.components.push(new OpenLayers.Geometry.LineString(c.points))},segments:function(a,b){this.readChildNodes(a,b)},LineStringSegment:function(a,b){var c={};this.readChildNodes(a,c);c.points&&Array.prototype.push.apply(b.points,c.points)},pos:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace),
c=this.xy?new OpenLayers.Geometry.Point(c[0],c[1],c[2]):new OpenLayers.Geometry.Point(c[1],c[0],c[2]);b.points=[c]},posList:function(a,b){for(var c=this.getChildValue(a).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace),d=b.srsDimension||parseInt(a.getAttribute("srsDimension")||a.getAttribute("dimension"),10)||2,e,f,g,h=Array(c.length/d),j=0,k=c.length;j<k;j+=d)e=c[j],f=c[j+1],g=2==d?void 0:c[j+2],h[j/d]=this.xy?new OpenLayers.Geometry.Point(e,f,g):new OpenLayers.Geometry.Point(f,
e,g);b.points=h},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(a,b){var c={};this.readChildNodes(a,c);b.outer=c.components[0]},interior:function(a,b){var c={};this.readChildNodes(a,c);b.inner.push(c.components[0])},MultiCurve:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);if(0<c.components.length)b.components=
[new OpenLayers.Geometry.MultiLineString(c.components)]},curveMember:function(a,b){this.readChildNodes(a,b)},MultiSurface:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);if(0<c.components.length)b.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(a,b){var c={points:Array(2)};this.readChildNodes(a,c);if(!b.components)b.components=[];var d=c.points[0],c=c.points[1];b.components.push(new OpenLayers.Bounds(d.x,d.y,c.x,c.y))},lowerCorner:function(a,b){var c={};this.readers.gml.pos.apply(this,[a,c]);b.points[0]=c.points[0]},upperCorner:function(a,b){var c={};this.readers.gml.pos.apply(this,
[a,c]);b.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(a){a=this.writeNode("gml:"+(OpenLayers.Util.isArray(a)?"featureMembers":"featureMember"),a);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(a){for(var b=
this.createElementNSPlus("gml:featureMembers"),c=0,d=a.length;c<d;++c)this.writeNode("feature:_typeName",a[c],b);return b},Point:function(a){var b=this.createElementNSPlus("gml:Point");this.writeNode("pos",a,b);return b},pos:function(a){return this.createElementNSPlus("gml:pos",{value:this.xy?a.x+" "+a.y:a.y+" "+a.x})},LineString:function(a){var b=this.createElementNSPlus("gml:LineString");this.writeNode("posList",a.components,b);return b},Curve:function(a){var b=this.createElementNSPlus("gml:Curve");
this.writeNode("segments",a,b);return b},segments:function(a){var b=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",a,b);return b},LineStringSegment:function(a){var b=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",a.components,b);return b},posList:function(a){for(var b=a.length,c=Array(b),d,e=0;e<b;++e)d=a[e],c[e]=this.xy?d.x+" "+d.y:d.y+" "+d.x;return this.createElementNSPlus("gml:posList",{value:c.join(" ")})},Surface:function(a){var b=this.createElementNSPlus("gml:Surface");
this.writeNode("patches",a,b);return b},patches:function(a){var b=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",a,b);return b},PolygonPatch:function(a){var b=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",a.components[0],b);for(var c=1,d=a.components.length;c<d;++c)this.writeNode("interior",a.components[c],b);return b},Polygon:function(a){var b=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",a.components[0],
b);for(var c=1,d=a.components.length;c<d;++c)this.writeNode("interior",a.components[c],b);return b},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(a){for(var b=this.createElementNSPlus("gml:MultiCurve"),
a=a.components||[a],c=0,d=a.length;c<d;++c)this.writeNode("curveMember",a[c],b);return b},curveMember:function(a){var b=this.createElementNSPlus("gml:curveMember");this.curve?this.writeNode("Curve",a,b):this.writeNode("LineString",a,b);return b},MultiSurface:function(a){for(var b=this.createElementNSPlus("gml:MultiSurface"),a=a.components||[a],c=0,d=a.length;c<d;++c)this.writeNode("surfaceMember",a[c],b);return b},surfaceMember:function(a){var b=this.createElementNSPlus("gml:surfaceMember");this.surface?
this.writeNode("Surface",a,b):this.writeNode("Polygon",a,b);return b},Envelope:function(a){var b=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",a,b);this.writeNode("upperCorner",a,b);this.srsName&&b.setAttribute("srsName",this.srsName);return b},lowerCorner:function(a){return this.createElementNSPlus("gml:lowerCorner",{value:this.xy?a.left+" "+a.bottom:a.bottom+" "+a.left})},upperCorner:function(a){return this.createElementNSPlus("gml:upperCorner",{value:this.xy?a.right+" "+
a.top:a.top+" "+a.right})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":!0===this.curve?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":!1===this.multiCurve?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":!0===
this.surface?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":!1===this.multiSurface?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"});
OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(a){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[a])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(a,b){var c=a.getAttribute("matchCase"),c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!("false"===c||"0"===c)});this.readChildNodes(a,
c);b.filters.push(c)},PropertyIsNotEqualTo:function(a,b){var c=a.getAttribute("matchCase"),c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!("false"===c||"0"===c)});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLike:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(a,c);var d=a.getAttribute("wildCard"),e=a.getAttribute("singleChar"),f=a.getAttribute("escapeChar");c.value2regex(d,e,
f);b.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 b=this.createElementNSPlus("ogc:BBOX");a.property&&this.writeNode("PropertyName",a,b);var c=this.writeNode("gml:Envelope",
a.value);a.projection&&c.setAttribute("srsName",a.projection);b.appendChild(c);return b},SortBy:function(a){for(var b=this.createElementNSPlus("ogc:SortBy"),c=0,d=a.length;c<d;c++)this.writeNode("ogc:SortProperty",a[c],b);return b},SortProperty:function(a){var b=this.createElementNSPlus("ogc:SortProperty");this.writeNode("ogc:PropertyName",a,b);this.writeNode("ogc:SortOrder","DESC"==a.order?"DESC":"ASC",b);return b},SortOrder:function(a){return this.createElementNSPlus("ogc:SortOrder",{value: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(a,b){var c=this.createElementNSPlus("ogc:"+b);this.writeNode("PropertyName",a,c);if(a.value instanceof OpenLayers.Filter.Function)this.writeNode("Function",a.value,c);else{var d;d=a.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",a.value).firstChild:this.writeNode("gml:Envelope",a.value);a.projection&&
d.setAttribute("srsName",a.projection);c.appendChild(d)}return c},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"});OpenLayers.Format.OWSCommon=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",getVersion:function(a){var b=this.version;if(!b&&((a=a.getAttribute("xmlns:ows"))&&"1.1"===a.substring(a.lastIndexOf("/")+1)&&(b="1.1.0"),!b))b=this.defaultVersion;return b},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(a,b){OpenLayers.Util.applyDefaults(b,this.options);var c={};this.readChildNodes(a,c);return c},readers:{ows:{Exception:function(a,b){var c={code:a.getAttribute("exceptionCode"),locator:a.getAttribute("locator"),texts:[]};b.exceptions.push(c);this.readChildNodes(a,c)},ExceptionText:function(a,b){var c=this.getChildValue(a);b.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(a,b){b[this.getChildValue(a)]=!0},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(a,
b){b.individualName=this.getChildValue(a)},PositionName:function(a,b){b.positionName=this.getChildValue(a)},ContactInfo:function(a,b){b.contactInfo={};this.readChildNodes(a,b.contactInfo)},Phone:function(a,b){b.phone={};this.readChildNodes(a,b.phone)},Voice:function(a,b){b.voice=this.getChildValue(a)},Address:function(a,b){b.address={};this.readChildNodes(a,b.address)},DeliveryPoint:function(a,b){b.deliveryPoint=this.getChildValue(a)},City:function(a,b){b.city=this.getChildValue(a)},AdministrativeArea:function(a,
b){b.administrativeArea=this.getChildValue(a)},PostalCode:function(a,b){b.postalCode=this.getChildValue(a)},Country:function(a,b){b.country=this.getChildValue(a)},ElectronicMailAddress:function(a,b){b.electronicMailAddress=this.getChildValue(a)},Role:function(a,b){b.role=this.getChildValue(a)},OperationsMetadata:function(a,b){b.operationsMetadata={};this.readChildNodes(a,b.operationsMetadata)},Operation:function(a,b){var c=a.getAttribute("name");b[c]={};this.readChildNodes(a,b[c])},DCP:function(a,
b){b.dcp={};this.readChildNodes(a,b.dcp)},HTTP:function(a,b){b.http={};this.readChildNodes(a,b.http)},Get:function(a,b){if(!b.get)b.get=[];var c={url:this.getAttributeNS(a,this.namespaces.xlink,"href")};this.readChildNodes(a,c);b.get.push(c)},Post:function(a,b){if(!b.post)b.post=[];var c={url:this.getAttributeNS(a,this.namespaces.xlink,"href")};this.readChildNodes(a,c);b.post.push(c)},Parameter:function(a,b){if(!b.parameters)b.parameters={};var c=a.getAttribute("name");b.parameters[c]={};this.readChildNodes(a,
b.parameters[c])},Constraint:function(a,b){if(!b.constraints)b.constraints={};var c=a.getAttribute("name");b.constraints[c]={};this.readChildNodes(a,b.constraints[c])},Value:function(a,b){b[this.getChildValue(a)]=!0},OutputFormat:function(a,b){b.formats.push({value:this.getChildValue(a)});this.readChildNodes(a,b)},WGS84BoundingBox:function(a,b){var c={};c.crs=a.getAttribute("crs");b.BoundingBox?b.BoundingBox.push(c):(b.projection=c.crs,c=b);this.readChildNodes(a,c)},BoundingBox:function(a,b){this.readers.ows.WGS84BoundingBox.apply(this,
[a,b])},LowerCorner:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),c=c.split(this.regExes.splitSpace);b.left=c[0];b.bottom=c[1]},UpperCorner:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),c=c.split(this.regExes.splitSpace);b.right=c[0];b.top=c[1];b.bounds=new OpenLayers.Bounds(b.left,b.bottom,b.right,b.top);delete b.left;delete b.bottom;delete b.right;delete b.top},
Language:function(a,b){b.language=this.getChildValue(a)}}},writers:{ows:{BoundingBox:function(a,b){var c=this.createElementNSPlus(b||"ows:BoundingBox",{attributes:{crs:a.projection}});this.writeNode("ows:LowerCorner",a,c);this.writeNode("ows:UpperCorner",a,c);return c},LowerCorner:function(a){return this.createElementNSPlus("ows:LowerCorner",{value:a.bounds.left+" "+a.bounds.bottom})},UpperCorner:function(a){return this.createElementNSPlus("ows:UpperCorner",{value:a.bounds.right+" "+a.bounds.top})},
Identifier:function(a){return this.createElementNSPlus("ows:Identifier",{value:a})},Title:function(a){return this.createElementNSPlus("ows:Title",{value:a})},Abstract:function(a){return this.createElementNSPlus("ows:Abstract",{value:a})},OutputFormat:function(a){return this.createElementNSPlus("ows:OutputFormat",{value: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=!1;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.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"});
OpenLayers.Format.WMSDescribeLayer.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(a){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[a])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));for(var b=a.documentElement.childNodes,c={layerDescriptions:[]},d,e,f=0;f<b.length;++f)if(d=b[f],e=d.nodeName,"LayerDescription"==e){e=d.getAttribute("name");var g="",h="",j="";d.getAttribute("owsType")?(g=d.getAttribute("owsType"),
h=d.getAttribute("owsURL")):""!=d.getAttribute("wfs")?(g="WFS",h=d.getAttribute("wfs")):""!=d.getAttribute("wcs")&&(g="WCS",h=d.getAttribute("wcs"));d=d.getElementsByTagName("Query");0<d.length&&((j=d[0].getAttribute("typeName"))||(j=d[0].getAttribute("typename")));d={layerName:e,owsType:g,owsURL:h,typeName:j};c.layerDescriptions.push(d);c.length=c.layerDescriptions.length;c[c.length-1]=d}else if("ServiceException"==e)return{error:(new OpenLayers.Format.OGCExceptionReport).read(a)};return c},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1_1"});
OpenLayers.Format.WMSDescribeLayer.v1_1_0=OpenLayers.Format.WMSDescribeLayer.v1_1_1;
OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g},namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},readers:{xsd:{schema:function(a,b){var c=[],d={},e,f;this.readChildNodes(a,{complexTypes:c,customTypes:d});var g=a.attributes,h,j;for(e=0,f=g.length;e<f;++e)h=g[e],j=h.name,0===j.indexOf("xmlns")?this.setNamespace(j.split(":")[1]||"",h.value):b[j]=h.value;b.featureTypes=c;b.targetPrefix=this.namespaceAlias[b.targetNamespace];for(e=0,
f=c.length;e<f;++e)if(g=c[e],h=d[g.typeName],d[g.typeName])g.typeName=h.name},complexType:function(a,b){var c={typeName:a.getAttribute("name")};this.readChildNodes(a,c);b.complexTypes.push(c)},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,b){var c;if(b.elements){var d={};c=a.attributes;for(var e,f=0,g=c.length;f<g;++f)e=c[f],d[e.name]=
e.value;c=d.type;if(!c)c={},this.readChildNodes(a,c),d.restriction=c,d.type=c.base;d.localType=(c.base||c).split(":").pop();b.elements.push(d);this.readChildNodes(a,d)}b.complexTypes&&(c=a.getAttribute("type"),d=c.split(":").pop(),b.customTypes[d]={name:a.getAttribute("name"),type:c})},annotation:function(a,b){b.annotation={};this.readChildNodes(a,b.annotation)},appinfo:function(a,b){if(!b.appinfo)b.appinfo=[];b.appinfo.push(this.getChildValue(a))},documentation:function(a,b){if(!b.documentation)b.documentation=
[];var c=this.getChildValue(a);b.documentation.push({lang:a.getAttribute("xml:lang"),textContent:c.replace(this.regExes.trimSpace,"")})},simpleType:function(a,b){this.readChildNodes(a,b)},restriction:function(a,b){b.base=a.getAttribute("base");this.readRestriction(a,b)}}},readRestriction:function(a,b){for(var c=a.childNodes,d,e,f=0,g=c.length;f<g;++f)d=c[f],1==d.nodeType&&(e=d.nodeName.split(":").pop(),d=d.getAttribute("value"),b[e]?("string"==typeof b[e]&&(b[e]=[b[e]]),b[e].push(d)):b[e]=d)},read:function(a){"string"==
typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));if(a&&9==a.nodeType)a=a.documentElement;var b={};if("ExceptionReport"===a.nodeName.split(":").pop()){var c=new OpenLayers.Format.OGCExceptionReport;b.error=c.read(a)}else this.readNode(a,b);return b},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});
OpenLayers.Format.WFST=function(a){var a=OpenLayers.Util.applyDefaults(a,OpenLayers.Format.WFST.DEFAULTS),b=OpenLayers.Format.WFST["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported WFST version: "+a.version;return new b(a)};OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"};
OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,evaluate:function(a){var b=!1;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(a.geometry){var c=this.value;"OpenLayers.Bounds"==this.value.CLASS_NAME&&(c=this.value.toGeometry());a.geometry.intersects(c)&&(b=!0)}break;default:throw Error("evaluate is not implemented for this filter type.");}return b},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.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs",gml:"http://www.opengis.net/gml",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:!0,xy:!0,stateName:null,initialize:function(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(a,b){var c=b&&b.srsName;c||(c=a&&a.layer?a.layer.projection.getCode():this.srsName);return c},read:function(a,b){b=b||{};OpenLayers.Util.applyDefaults(b,{output:"features"});"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));if(a&&9==a.nodeType)a=a.documentElement;var c={};a&&this.readNode(a,c,!0);if(c.features&&"features"===b.output)c=
c.features;return c},readers:{wfs:{FeatureCollection:function(a,b){b.features=[];this.readChildNodes(a,b)}}},write:function(a,b){var c=this.writeNode("wfs:Transaction",{features:a,options:b}),d=this.schemaLocationAttr();d&&this.setAttributeNS(c,this.namespaces.xsi,"xsi:schemaLocation",d);return OpenLayers.Format.XML.prototype.write.apply(this,[c])},writers:{wfs:{GetFeature:function(a){var b=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,handle:a&&a.handle,
outputFormat:a&&a.outputFormat,maxFeatures:a&&a.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(a)}});if("string"==typeof this.featureType)this.writeNode("Query",a,b);else for(var c=0,d=this.featureType.length;c<d;c++)a.featureType=this.featureType[c],this.writeNode("Query",a,b);return b},Transaction:function(a){var a=a||{},b=a.options||{},c=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version,handle:b.handle}}),d,e=a.features;if(e){!0===b.multi&&OpenLayers.Util.extend(this.geometryTypes,
{"OpenLayers.Geometry.Point":"MultiPoint","OpenLayers.Geometry.LineString":!0===this.multiCurve?"MultiCurve":"MultiLineString","OpenLayers.Geometry.Polygon":!0===this.multiSurface?"MultiSurface":"MultiPolygon"});var f,g;for(a=0,d=e.length;a<d;++a)g=e[a],(f=this.stateName[g.state])&&this.writeNode(f,{feature:g,options:b},c);!0===b.multi&&this.setGeometryTypes()}if(b.nativeElements)for(a=0,d=b.nativeElements.length;a<d;++a)this.writeNode("wfs:Native",b.nativeElements[a],c);return c},Native:function(a){return this.createElementNSPlus("wfs:Native",
{attributes:{vendorId:a.vendorId,safeToIgnore:a.safeToIgnore},value:a.value})},Insert:function(a){var b=a.feature,a=a.options,a=this.createElementNSPlus("wfs:Insert",{attributes:{handle:a&&a.handle}});this.srsName=this.getSrsName(b);this.writeNode("feature:_typeName",b,a);return a},Update:function(a){var b=a.feature,a=a.options,a=this.createElementNSPlus("wfs:Update",{attributes:{handle:a&&a.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});this.featureNS&&a.setAttribute("xmlns:"+
this.featurePrefix,this.featureNS);var c=b.modified;if(null!==this.geometryName&&(!c||void 0!==c.geometry))this.srsName=this.getSrsName(b),this.writeNode("Property",{name:this.geometryName,value:b.geometry},a);for(var d in b.attributes)void 0!==b.attributes[d]&&(!c||!c.attributes||c.attributes&&void 0!==c.attributes[d])&&this.writeNode("Property",{name:d,value:b.attributes[d]},a);this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[b.fid]}),a);return a},Property:function(a){var b=this.createElementNSPlus("wfs:Property");
this.writeNode("Name",a.name,b);null!==a.value&&this.writeNode("Value",a.value,b);return b},Name:function(a){return this.createElementNSPlus("wfs:Name",{value:a})},Value:function(a){var b;a instanceof OpenLayers.Geometry?(b=this.createElementNSPlus("wfs:Value"),a=this.writeNode("feature:_geometry",a).firstChild,b.appendChild(a)):b=this.createElementNSPlus("wfs:Value",{value:a});return b},Delete:function(a){var b=a.feature,a=a.options,a=this.createElementNSPlus("wfs:Delete",{attributes:{handle:a&&
a.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});this.featureNS&&a.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[b.fid]}),a);return a}}},schemaLocationAttr:function(a){var a=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},a),b=OpenLayers.Util.extend({},this.schemaLocations);if(a.schema)b[a.featurePrefix]=a.schema;var a=[],c,d;for(d in b)(c=this.namespaces[d])&&
a.push(c+" "+b[d]);return a.join(" ")||void 0},setFilterProperty:function(a){if(a.filters)for(var b=0,c=a.filters.length;b<c;++b)OpenLayers.Format.WFST.v1.prototype.setFilterProperty.call(this,a.filters[b]);else if(a instanceof OpenLayers.Filter.Spatial&&!a.property)a.property=this.geometryName},CLASS_NAME:"OpenLayers.Format.WFST.v1"});
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,arguments)},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=!1;this.readChildNodes(a,b)},TransactionSummary:function(a,b){b.success=!0},InsertResults:function(a,b){this.readChildNodes(a,b)},Feature:function(a,b){var c={fids:[]};this.readChildNodes(a,c);b.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(a){var a=OpenLayers.Util.extend({featureNS:this.featureNS,
featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},a),b=a.featurePrefix,c=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b?b+":":"")+a.featureType,srsName:a.srsName}});a.featureNS&&c.setAttribute("xmlns:"+b,a.featureNS);if(a.propertyNames)for(var b=0,d=a.propertyNames.length;b<d;b++)this.writeNode("wfs:PropertyName",{property:a.propertyNames[b]},c);a.filter&&(OpenLayers.Format.WFST.v1_1_0.prototype.setFilterProperty.call(this,a.filter),this.writeNode("ogc:Filter",
a.filter,c));return c},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.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(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=a;if(a&&9==a.nodeType)a=a.documentElement;var c={};this.readNode(a,c);if(void 0===c.service)a=new OpenLayers.Format.OGCExceptionReport,c.error=a.read(b);return c},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(a){var b={};b.bbox=[parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny")),parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))];a={x:parseFloat(a.getAttribute("resx")),y:parseFloat(a.getAttribute("resy"))};if(!isNaN(a.x)||!isNaN(a.y))b.res=
a;return b},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(a,b){var c=this.getChildValue(a);if(c&&"none"!=c.toLowerCase())b.fees=c},AccessConstraints:function(a,b){var c=this.getChildValue(a);if(c&&"none"!=c.toLowerCase())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){OpenLayers.Util.isArray(b.formats)?b.formats.push(this.getChildValue(a)):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(a,b){var c,d;b.capability?(d=b.capability,c=b):d=b;var e=a.getAttributeNode("queryable"),f=e&&e.specified?a.getAttribute("queryable"):null,g=(e=a.getAttributeNode("cascaded"))&&e.specified?a.getAttribute("cascaded"):null,e=(e=a.getAttributeNode("opaque"))&&e.specified?
a.getAttribute("opaque"):null,h=a.getAttribute("noSubsets"),j=a.getAttribute("fixedWidth"),k=a.getAttribute("fixedHeight"),l=c||{},n=OpenLayers.Util.extend;c={nestedLayers:[],styles:c?[].concat(c.styles):[],srs:c?n({},l.srs):{},metadataURLs:[],bbox:c?n({},l.bbox):{},llbbox:l.llbbox,dimensions:c?n({},l.dimensions):{},authorityURLs:c?n({},l.authorityURLs):{},identifiers:{},keywords:[],queryable:f&&""!==f?"1"===f||"true"===f:l.queryable||!1,cascaded:null!==g?parseInt(g):l.cascaded||0,opaque:e?"1"===
e||"true"===e:l.opaque||!1,noSubsets:null!==h?"1"===h||"true"===h:l.noSubsets||!1,fixedWidth:null!=j?parseInt(j):l.fixedWidth||0,fixedHeight:null!=k?parseInt(k):l.fixedHeight||0,minScale:l.minScale,maxScale:l.maxScale,attribution:l.attribution};b.nestedLayers.push(c);c.capability=d;this.readChildNodes(a,c);delete c.capability;if(c.name){f=c.name.split(":");g=d.request;e=g.getfeatureinfo;if(0<f.length)c.prefix=f[0];d.layers.push(c);if(void 0===c.formats)c.formats=g.getmap.formats;if(void 0===c.infoFormats&&
e)c.infoFormats=e.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(a,b){var c={};b.styles.push(c);this.readChildNodes(a,c)},LegendURL:function(a,b){var c={width:a.getAttribute("width"),height:a.getAttribute("height")};b.legend=c;this.readChildNodes(a,c)},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(a,b){var c=a.getAttribute("name"),d={};this.readChildNodes(a,d);b.authorityURLs[c]=d.href},Identifier:function(a,b){var c=a.getAttribute("authority");b.identifiers[c]=this.getChildValue(a)},KeywordList:function(a,b){this.readChildNodes(a,b)},SRS:function(a,b){b.srs[this.getChildValue(a)]=!0}}},
CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1"});
OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMT_MS_Capabilities:function(a,b){this.readChildNodes(a,b)},Keyword:function(a,b){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:1==parseInt(a.getAttribute("SupportSLD")),userLayer:1==parseInt(a.getAttribute("UserLayer")),userStyle:1==parseInt(a.getAttribute("UserStyle")),remoteWFS:1==parseInt(a.getAttribute("RemoteWFS"))};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(a,b){var c=a.getAttribute("min"),d=a.getAttribute("max"),e=Math.pow(2,0.5),f=OpenLayers.INCHES_PER_UNIT.m;if(0!=c)b.maxScale=parseFloat((c/e*f*OpenLayers.DOTS_PER_INCH).toPrecision(13));if(d!=Number.POSITIVE_INFINITY)b.minScale=parseFloat((d/e*
f*OpenLayers.DOTS_PER_INCH).toPrecision(13))},Dimension:function(a,b){var c={name:a.getAttribute("name").toLowerCase(),units:a.getAttribute("units"),unitsymbol:a.getAttribute("unitSymbol")};b.dimensions[c.name]=c},Extent:function(a,b){var c=a.getAttribute("name").toLowerCase();if(c in b.dimensions){c=b.dimensions[c];c.nearestVal="1"===a.getAttribute("nearestValue");c.multipleVal="1"===a.getAttribute("multipleValues");c.current="1"===a.getAttribute("current");c["default"]=a.getAttribute("default")||
"";var d=this.getChildValue(a);c.values=d.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(a,b){for(var c=this.getChildValue(a).split(/ +/),d=0,e=c.length;d<e;d++)b.srs[c[d]]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"});
OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.1",readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(a,b){b.srs[this.getChildValue(a)]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1"});
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(a,b){var c={name:a.getAttribute("name").toLowerCase(),units:a.getAttribute("units"),unitsymbol:a.getAttribute("unitSymbol"),nearestVal:"1"===a.getAttribute("nearestValue"),multipleVal:"1"===a.getAttribute("multipleValues"),"default":a.getAttribute("default")||"",current:"1"===a.getAttribute("current"),values:this.getChildValue(a).split(",")};b.dimensions[c.name]=c},Keyword:function(a,
b){var c={value:this.getChildValue(a),vocabulary:a.getAttribute("vocabulary")};b.keywords&&b.keywords.push(c)}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms),sld:{UserDefinedSymbolization:function(a,b){this.readers.wms.UserDefinedSymbolization.apply(this,[a,b]);b.userSymbols.inlineFeature=1==parseInt(a.getAttribute("InlineFeature"));b.userSymbols.remoteWCS=1==parseInt(a.getAttribute("RemoteWCS"))},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.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.GeoRSS=OpenLayers.Class(OpenLayers.Format.XML,{rssns:"http://backend.userland.com/rss2",featureNS:"http://mapserver.gis.umn.edu/mapserver",georssns:"http://www.georss.org/georss",geons:"http://www.w3.org/2003/01/geo/wgs84_pos#",featureTitle:"Untitled",featureDescription:"No Description",gmlParser:null,xy:!1,createGeometryFromItem:function(a){var b=this.getElementsByTagNameNS(a,this.georssns,"point"),c=this.getElementsByTagNameNS(a,this.geons,"lat"),d=this.getElementsByTagNameNS(a,
this.geons,"long"),e=this.getElementsByTagNameNS(a,this.georssns,"line"),f=this.getElementsByTagNameNS(a,this.georssns,"polygon"),g=this.getElementsByTagNameNS(a,this.georssns,"where"),a=this.getElementsByTagNameNS(a,this.georssns,"box");if(0<b.length||0<c.length&&0<d.length){0<b.length?(c=OpenLayers.String.trim(b[0].firstChild.nodeValue).split(/\s+/),2!=c.length&&(c=OpenLayers.String.trim(b[0].firstChild.nodeValue).split(/\s*,\s*/))):c=[parseFloat(c[0].firstChild.nodeValue),parseFloat(d[0].firstChild.nodeValue)];
var h=new OpenLayers.Geometry.Point(c[1],c[0])}else if(0<e.length){c=OpenLayers.String.trim(this.getChildValue(e[0])).split(/\s+/);d=[];e=0;for(f=c.length;e<f;e+=2)b=new OpenLayers.Geometry.Point(c[e+1],c[e]),d.push(b);h=new OpenLayers.Geometry.LineString(d)}else if(0<f.length){c=OpenLayers.String.trim(this.getChildValue(f[0])).split(/\s+/);d=[];e=0;for(f=c.length;e<f;e+=2)b=new OpenLayers.Geometry.Point(c[e+1],c[e]),d.push(b);h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)])}else if(0<
g.length){if(!this.gmlParser)this.gmlParser=new OpenLayers.Format.GML({xy:this.xy});h=this.gmlParser.parseFeature(g[0]).geometry}else 0<a.length&&(c=OpenLayers.String.trim(a[0].firstChild.nodeValue).split(/\s+/),d=[],3<c.length&&(b=new OpenLayers.Geometry.Point(c[1],c[0]),d.push(b),b=new OpenLayers.Geometry.Point(c[1],c[2]),d.push(b),b=new OpenLayers.Geometry.Point(c[3],c[2]),d.push(b),b=new OpenLayers.Geometry.Point(c[3],c[0]),d.push(b),b=new OpenLayers.Geometry.Point(c[1],c[0]),d.push(b)),h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)]));
h&&this.internalProjection&&this.externalProjection&&h.transform(this.externalProjection,this.internalProjection);return h},createFeatureFromItem:function(a){var b=this.createGeometryFromItem(a),c=this._getChildValue(a,"*","title",this.featureTitle),d=this._getChildValue(a,"*","description",this._getChildValue(a,"*","content",this._getChildValue(a,"*","summary",this.featureDescription))),e=this._getChildValue(a,"*","link");if(!e)try{e=this.getElementsByTagNameNS(a,"*","link")[0].getAttribute("href")}catch(f){e=
null}a=this._getChildValue(a,"*","id",null);b=new OpenLayers.Feature.Vector(b,{title:c,description:d,link:e});b.fid=a;return b},_getChildValue:function(a,b,c,d){return(a=this.getElementsByTagNameNS(a,b,c))&&a[0]&&a[0].firstChild&&a[0].firstChild.nodeValue?this.getChildValue(a[0]):void 0==d?"":d},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=null,b=this.getElementsByTagNameNS(a,"*","item");0==b.length&&(b=this.getElementsByTagNameNS(a,"*","entry"));
for(var a=b.length,c=Array(a),d=0;d<a;d++)c[d]=this.createFeatureFromItem(b[d]);return c},write:function(a){var b;if(OpenLayers.Util.isArray(a)){b=this.createElementNS(this.rssns,"rss");for(var c=0,d=a.length;c<d;c++)b.appendChild(this.createFeatureXML(a[c]))}else b=this.createFeatureXML(a);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(a){var b=this.buildGeometryNode(a.geometry),c=this.createElementNS(this.rssns,"item"),d=this.createElementNS(this.rssns,"title");
d.appendChild(this.createTextNode(a.attributes.title?a.attributes.title:""));var e=this.createElementNS(this.rssns,"description");e.appendChild(this.createTextNode(a.attributes.description?a.attributes.description:""));c.appendChild(d);c.appendChild(e);a.attributes.link&&(d=this.createElementNS(this.rssns,"link"),d.appendChild(this.createTextNode(a.attributes.link)),c.appendChild(d));for(var f in a.attributes)"link"==f||"title"==f||"description"==f||(d=this.createTextNode(a.attributes[f]),e=f,-1!=
f.search(":")&&(e=f.split(":")[1]),e=this.createElementNS(this.featureNS,"feature:"+e),e.appendChild(d),c.appendChild(e));c.appendChild(b);return c},buildGeometryNode:function(a){this.internalProjection&&this.externalProjection&&(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));var b;if("OpenLayers.Geometry.Polygon"==a.CLASS_NAME)b=this.createElementNS(this.georssns,"georss:polygon"),b.appendChild(this.buildCoordinatesNode(a.components[0]));else if("OpenLayers.Geometry.LineString"==
a.CLASS_NAME)b=this.createElementNS(this.georssns,"georss:line"),b.appendChild(this.buildCoordinatesNode(a));else if("OpenLayers.Geometry.Point"==a.CLASS_NAME)b=this.createElementNS(this.georssns,"georss:point"),b.appendChild(this.buildCoordinatesNode(a));else throw"Couldn't parse "+a.CLASS_NAME;return b},buildCoordinatesNode:function(a){var b=null;if(a.components)b=a.components;if(b){for(var a=b.length,c=Array(a),d=0;d<a;d++)c[d]=b[d].y+" "+b[d].x;b=c.join(" ")}else b=a.y+" "+a.x;return this.createTextNode(b)},
CLASS_NAME:"OpenLayers.Format.GeoRSS"});
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(a,b){var c={srs:{},bbox:{},resolutions:[]};this.readChildNodes(a,c);b.tileSets.push(c)},Resolutions:function(a,b){for(var c=this.getChildValue(a).split(" "),d=0,e=c.length;d<e;d++)""!=c[d]&&b.resolutions.push(parseFloat(c[d]))},
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.Format.QueryStringFilter=function(){function a(a){a=a.replace(/%/g,"\\%");a=a.replace(/\\\\\.(\*)?/g,function(a,b){return b?a:"\\\\_"});a=a.replace(/\\\\\.\*/g,"\\\\%");a=a.replace(/(\\)?\.(\*)?/g,function(a,b,c){return b||c?a:"_"});a=a.replace(/(\\)?\.\*/g,function(a,b){return b?a:"%"});a=a.replace(/\\\./g,".");return a=a.replace(/(\\)?\\\*/g,function(a,b){return b?a:"*"})}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";return OpenLayers.Class(OpenLayers.Format,{wildcarded:!1,srsInBBOX:!1,write:function(c,d){var d=d||{},e=c.CLASS_NAME,e=e.substring(e.lastIndexOf(".")+1);switch(e){case "Spatial":switch(c.type){case OpenLayers.Filter.Spatial.BBOX:d.bbox=c.value.toArray();this.srsInBBOX&&c.projection&&
d.bbox.push(c.projection.getCode());break;case OpenLayers.Filter.Spatial.DWITHIN:d.tolerance=c.distance;case OpenLayers.Filter.Spatial.WITHIN:d.lon=c.value.x;d.lat=c.value.y;break;default:OpenLayers.Console.warn("Unknown spatial filter type "+c.type)}break;case "Comparison":e=b[c.type];if(void 0!==e){var f=c.value;c.type==OpenLayers.Filter.Comparison.LIKE&&(f=a(f),this.wildcarded&&(f="%"+f+"%"));d[c.property+"__"+e]=f;d.queryable=d.queryable||[];d.queryable.push(c.property)}else OpenLayers.Console.warn("Unknown comparison filter type "+
c.type);break;case "Logical":if(c.type===OpenLayers.Filter.Logical.AND){e=0;for(f=c.filters.length;e<f;e++)d=this.write(c.filters[e],d)}else OpenLayers.Console.warn("Unsupported logical filter type "+c.type);break;default:OpenLayers.Console.warn("Unknown filter type "+e)}return d},CLASS_NAME:"OpenLayers.Format.QueryStringFilter"})}();
OpenLayers.Format.TMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultPrefix:"tms",readers:{tms:{Services:function(a,b){b.services=[];this.readChildNodes(a,b)},TileMapService:function(a,b){b.services?b.services.push({service:"TMS",version:a.getAttribute("version"),title:a.getAttribute("title"),href:a.getAttribute("href")}):this.readChildNodes(a,b)},TileMaps:function(a,b){b.tileMaps=[];this.readChildNodes(a,b)},TileMap:function(a,b){b.tileMaps?b.tileMaps.push({href:a.getAttribute("href"),
srs:a.getAttribute("srs"),title:a.getAttribute("title"),profile:a.getAttribute("profile")}):(b.version=a.getAttribute("version"),b.tileMapService=a.getAttribute("tilemapservice"),this.readChildNodes(a,b))},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b["abstract"]=this.getChildValue(a)},SRS:function(a,b){b.srs=this.getChildValue(a)},BoundingBox:function(a,b){b.bbox=new OpenLayers.Bounds(a.getAttribute("minx"),a.getAttribute("miny"),a.getAttribute("maxx"),a.getAttribute("maxy"))},
Origin:function(a,b){b.origin=new OpenLayers.LonLat(a.getAttribute("x"),a.getAttribute("y"))},TileFormat:function(a,b){b.tileFormat={width:parseInt(a.getAttribute("width"),10),height:parseInt(a.getAttribute("height"),10),mimeType:a.getAttribute("mime-type"),extension:a.getAttribute("extension")}},TileSets:function(a,b){b.tileSets=[];this.readChildNodes(a,b)},TileSet:function(a,b){b.tileSets.push({href:a.getAttribute("href"),unitsPerPixel:parseFloat(a.getAttribute("units-per-pixel")),order:parseInt(a.getAttribute("order"),
10)})},TileMapServerError:function(a,b){b.error=!0},Message:function(a,b){b.message=this.getChildValue(a)}}},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));if(a&&9==a.nodeType)a=a.documentElement;var b={};this.readNode(a,b);return b},CLASS_NAME:"OpenLayers.Format.TMSCapabilities"});
OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:!1,nativeJSON:function(){return!(!window.JSON||!("function"==typeof JSON.parse&&"function"==typeof JSON.stringify))}(),read:function(a,b){var c;if(this.nativeJSON)c=JSON.parse(a,b);else try{if(/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))&&(c=eval("("+a+")"),"function"===
typeof b)){var d=function(a,c){if(c&&"object"===typeof c)for(var e in c)c.hasOwnProperty(e)&&(c[e]=d(e,c[e]));return b(a,c)};c=d("",c)}}catch(e){}if(this.keepData)this.data=c;return c},write:function(a,b){this.pretty=!!b;var c=null,d=typeof a;if(this.serialize[d])try{c=!this.pretty&&this.nativeJSON?JSON.stringify(a):this.serialize[d].apply(this,[a])}catch(e){OpenLayers.Console.error("Trouble serializing: "+e)}return c},writeIndent:function(){var a=[];if(this.pretty)for(var b=0;b<this.level;++b)a.push(this.indent);
return a.join("")},writeNewline:function(){return this.pretty?this.newline:""},writeSpace:function(){return this.pretty?this.space:""},serialize:{object:function(a){if(null==a)return"null";if(a.constructor==Date)return this.serialize.date.apply(this,[a]);if(a.constructor==Array)return this.serialize.array.apply(this,[a]);var b=["{"];this.level+=1;var c,d,e,f=!1;for(c in a)a.hasOwnProperty(c)&&(d=OpenLayers.Format.JSON.prototype.write.apply(this,[c,this.pretty]),e=OpenLayers.Format.JSON.prototype.write.apply(this,
[a[c],this.pretty]),null!=d&&null!=e&&(f&&b.push(","),b.push(this.writeNewline(),this.writeIndent(),d,":",this.writeSpace(),e),f=!0));this.level-=1;b.push(this.writeNewline(),this.writeIndent(),"}");return b.join("")},array:function(a){var b,c=["["];this.level+=1;for(var d=0,e=a.length;d<e;++d)b=OpenLayers.Format.JSON.prototype.write.apply(this,[a[d],this.pretty]),null!=b&&(0<d&&c.push(","),c.push(this.writeNewline(),this.writeIndent(),b));this.level-=1;c.push(this.writeNewline(),this.writeIndent(),
"]");return c.join("")},string:function(a){var b={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(a)?'"'+a.replace(/([\x00-\x1f\\"])/g,function(a,d){var e=b[d];if(e)return e;e=d.charCodeAt();return"\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)})+'"':'"'+a+'"'},number:function(a){return isFinite(a)?""+a:"null"},"boolean":function(a){return""+a},date:function(a){function b(a){return 10>a?"0"+a:a}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.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:!1,read:function(a,b,c){var b=b?b:"FeatureCollection",d=null,e=null;if(e="string"==typeof a?OpenLayers.Format.JSON.prototype.read.apply(this,[a,c]):a)if("string"!=typeof e.type)OpenLayers.Console.error("Bad GeoJSON - no type: "+a);else{if(this.isValidType(e,b))switch(b){case "Geometry":try{d=this.parseGeometry(e)}catch(f){OpenLayers.Console.error(f)}break;case "Feature":try{d=this.parseFeature(e),d.type="Feature"}catch(g){OpenLayers.Console.error(g)}break;
case "FeatureCollection":switch(d=[],e.type){case "Feature":try{d.push(this.parseFeature(e))}catch(h){d=null,OpenLayers.Console.error(h)}break;case "FeatureCollection":a=0;for(b=e.features.length;a<b;++a)try{d.push(this.parseFeature(e.features[a]))}catch(j){d=null,OpenLayers.Console.error(j)}break;default:try{var k=this.parseGeometry(e);d.push(new OpenLayers.Feature.Vector(k))}catch(l){d=null,OpenLayers.Console.error(l)}}}}else OpenLayers.Console.error("Bad JSON: "+a);return d},isValidType:function(a,
b){var c=!1;switch(b){case "Geometry":-1==OpenLayers.Util.indexOf("Point,MultiPoint,LineString,MultiLineString,Polygon,MultiPolygon,Box,GeometryCollection".split(","),a.type)?OpenLayers.Console.error("Unsupported geometry type: "+a.type):c=!0;break;case "FeatureCollection":c=!0;break;default:a.type==b?c=!0:OpenLayers.Console.error("Cannot convert types from "+a.type+" to "+b)}return c},parseFeature:function(a){var b,c,d;c=a.properties?a.properties:{};d=a.geometry&&a.geometry.bbox||a.bbox;try{b=this.parseGeometry(a.geometry)}catch(e){throw e;
}b=new OpenLayers.Feature.Vector(b,c);if(d)b.bounds=OpenLayers.Bounds.fromArray(d);if(a.id)b.fid=a.id;return b},parseGeometry:function(a){if(null==a)return null;var b,c=!1;if("GeometryCollection"==a.type){if(!OpenLayers.Util.isArray(a.geometries))throw"GeometryCollection must have geometries array: "+a;b=a.geometries.length;for(var c=Array(b),d=0;d<b;++d)c[d]=this.parseGeometry.apply(this,[a.geometries[d]]);b=new OpenLayers.Geometry.Collection(c);c=!0}else{if(!OpenLayers.Util.isArray(a.coordinates))throw"Geometry must have coordinates array: "+
a;if(!this.parseCoords[a.type.toLowerCase()])throw"Unsupported geometry type: "+a.type;try{b=this.parseCoords[a.type.toLowerCase()].apply(this,[a.coordinates])}catch(e){throw e;}}this.internalProjection&&this.externalProjection&&!c&&b.transform(this.externalProjection,this.internalProjection);return b},parseCoords:{point:function(a){if(!1==this.ignoreExtraDims&&2!=a.length)throw"Only 2D points are supported: "+a;return new OpenLayers.Geometry.Point(a[0],a[1])},multipoint:function(a){for(var b=[],
c=null,d=0,e=a.length;d<e;++d){try{c=this.parseCoords.point.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.MultiPoint(b)},linestring:function(a){for(var b=[],c=null,d=0,e=a.length;d<e;++d){try{c=this.parseCoords.point.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.LineString(b)},multilinestring:function(a){for(var b=[],c=null,d=0,e=a.length;d<e;++d){try{c=this.parseCoords.linestring.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.MultiLineString(b)},
polygon:function(a){for(var b=[],c,d,e=0,f=a.length;e<f;++e){try{d=this.parseCoords.linestring.apply(this,[a[e]])}catch(g){throw g;}c=new OpenLayers.Geometry.LinearRing(d.components);b.push(c)}return new OpenLayers.Geometry.Polygon(b)},multipolygon:function(a){for(var b=[],c=null,d=0,e=a.length;d<e;++d){try{c=this.parseCoords.polygon.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.MultiPolygon(b)},box:function(a){if(2!=a.length)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(a,b){var c={type:null};if(OpenLayers.Util.isArray(a)){c.type="FeatureCollection";var d=a.length;c.features=Array(d);for(var e=0;e<d;++e){var f=a[e];if(!f instanceof OpenLayers.Feature.Vector)throw"FeatureCollection only supports collections of features: "+
f;c.features[e]=this.extract.feature.apply(this,[f])}}else if(0==a.CLASS_NAME.indexOf("OpenLayers.Geometry"))c=this.extract.geometry.apply(this,[a]);else if(a instanceof OpenLayers.Feature.Vector&&(c=this.extract.feature.apply(this,[a]),a.layer&&a.layer.projection))c.crs=this.createCRSObject(a);return OpenLayers.Format.JSON.prototype.write.apply(this,[c,b])},createCRSObject:function(a){var a=a.layer.projection.toString(),b={};a.match(/epsg:/i)&&(a=parseInt(a.substring(a.indexOf(":")+1)),b=4326==a?
{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+a}});return b},extract:{feature:function(a){var b=this.extract.geometry.apply(this,[a.geometry]),b={type:"Feature",properties:a.attributes,geometry:b};if(null!=a.fid)b.id=a.fid;return b},geometry:function(a){if(null==a)return null;this.internalProjection&&this.externalProjection&&(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));var b=a.CLASS_NAME.split(".")[2],a=this.extract[b.toLowerCase()].apply(this,
[a]);return"Collection"==b?{type:"GeometryCollection",geometries:a}:{type:b,coordinates:a}},point:function(a){return[a.x,a.y]},multipoint:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.point.apply(this,[a.components[c]]));return b},linestring:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.point.apply(this,[a.components[c]]));return b},multilinestring:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.linestring.apply(this,
[a.components[c]]));return b},polygon:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.linestring.apply(this,[a.components[c]]));return b},multipolygon:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.polygon.apply(this,[a.components[c]]));return b},collection:function(a){for(var b=a.components.length,c=Array(b),d=0;d<b;++d)c[d]=this.extract.geometry.apply(this,[a.components[d]]);return c}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});
OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{profile:null,defaultVersion:"1.0.0",stringifyOutput:!0,namedLayersAsArray:!1,CLASS_NAME:"OpenLayers.Format.SLD"});
OpenLayers.Format.SLD.v1=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,{namespaces:{sld:"http://www.opengis.net/sld",ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"sld",schemaLocation:null,multipleSymbolizers:!1,featureTypeCounter:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,
graphicName:"square"},read:function(a,b){var b=OpenLayers.Util.applyDefaults(b,this.options),c={namedLayers:!0===b.namedLayersAsArray?[]:{}};this.readChildNodes(a,c);return c},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(a,b){var c=
{userStyles:[],namedStyles:[]};this.readChildNodes(a,c);for(var d=0,e=c.userStyles.length;d<e;++d)c.userStyles[d].layerName=c.name;OpenLayers.Util.isArray(b.namedLayers)?b.namedLayers.push(c):b.namedLayers[c.name]=c},NamedStyle:function(a,b){b.namedStyles.push(this.getChildName(a.firstChild))},UserStyle:function(a,b){var c={defaultsPerSymbolizer:!0,rules:[]};this.featureTypeCounter=-1;this.readChildNodes(a,c);this.multipleSymbolizers?(delete c.defaultsPerSymbolizer,c=new OpenLayers.Style2(c)):c=new OpenLayers.Style(this.defaultSymbolizer,
c);b.userStyles.push(c)},IsDefault:function(a,b){if("1"==this.getChildValue(a))b.isDefault=!0},FeatureTypeStyle:function(a,b){++this.featureTypeCounter;var c={rules:this.multipleSymbolizers?b.rules:[]};this.readChildNodes(a,c);if(!this.multipleSymbolizers)b.rules=c.rules},Rule:function(a,b){var c;this.multipleSymbolizers&&(c={symbolizers:[]});c=new OpenLayers.Rule(c);this.readChildNodes(a,c);b.rules.push(c)},ElseFilter:function(a,b){b.elseFilter=!0},MinScaleDenominator:function(a,b){b.minScaleDenominator=
parseFloat(this.getChildValue(a))},MaxScaleDenominator:function(a,b){b.maxScaleDenominator=parseFloat(this.getChildValue(a))},TextSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Text(c))):b.symbolizer.Text=OpenLayers.Util.applyDefaults(c,b.symbolizer.Text)},LabelPlacement:function(a,b){this.readChildNodes(a,b)},PointPlacement:function(a,b){var c={};this.readChildNodes(a,c);c.labelRotation=
c.rotation;delete c.rotation;var d,e=b.labelAnchorPointX,f=b.labelAnchorPointY;e<=1/3?d="l":e>1/3&&e<2/3?d="c":e>=2/3&&(d="r");f<=1/3?d+="b":f>1/3&&f<2/3?d+="m":f>=2/3&&(d+="t");c.labelAlign=d;OpenLayers.Util.applyDefaults(b,c)},AnchorPoint:function(a,b){this.readChildNodes(a,b)},AnchorPointX:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.labelAnchorPointX=c},AnchorPointY:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.labelAnchorPointY=c},Displacement:function(a,
b){this.readChildNodes(a,b)},DisplacementX:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.labelXOffset=c},DisplacementY:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.labelYOffset=c},LinePlacement:function(a,b){this.readChildNodes(a,b)},PerpendicularOffset:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.labelPerpendicularOffset=c},Label:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.label=c},Font:function(a,b){this.readChildNodes(a,
b)},Halo:function(a,b){var c={};this.readChildNodes(a,c);b.haloRadius=c.haloRadius;b.haloColor=c.fillColor;b.haloOpacity=c.fillOpacity},Radius:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(null!=c)b.haloRadius=c},RasterSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Raster(c))):b.symbolizer.Raster=OpenLayers.Util.applyDefaults(c,b.symbolizer.Raster)},Geometry:function(a,
b){b.geometry={};this.readChildNodes(a,b.geometry)},ColorMap:function(a,b){b.colorMap=[];this.readChildNodes(a,b.colorMap)},ColorMapEntry:function(a,b){var c=a.getAttribute("quantity"),d=a.getAttribute("opacity");b.push({color:a.getAttribute("color"),quantity:null!==c?parseFloat(c):void 0,label:a.getAttribute("label")||void 0,opacity:null!==d?parseFloat(d):void 0})},LineSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Line(c))):
b.symbolizer.Line=OpenLayers.Util.applyDefaults(c,b.symbolizer.Line)},PolygonSymbolizer:function(a,b){var c={fill:!1,stroke:!1};this.multipleSymbolizers||(c=b.symbolizer.Polygon||c);this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Polygon(c))):b.symbolizer.Polygon=c},PointSymbolizer:function(a,b){var c={fill:!1,stroke:!1,graphic:!1};this.multipleSymbolizers||(c=b.symbolizer.Point||c);this.readChildNodes(a,c);this.multipleSymbolizers?
(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Point(c))):b.symbolizer.Point=c},Stroke:function(a,b){b.stroke=!0;this.readChildNodes(a,b)},Fill:function(a,b){b.fill=!0;this.readChildNodes(a,b)},CssParameter:function(a,b){var c=a.getAttribute("name"),d=this.cssMap[c];b.label&&("fill"===c?d="fontColor":"fill-opacity"===c&&(d="fontOpacity"));d&&(c=this.readers.ogc._expression.call(this,a))&&(b[d]=c)},Graphic:function(a,b){b.graphic=!0;var c={};this.readChildNodes(a,c);
for(var d="stroke,strokeColor,strokeWidth,strokeOpacity,strokeLinecap,fill,fillColor,fillOpacity,graphicName,rotation,graphicFormat".split(","),e,f,g=0,h=d.length;g<h;++g)e=d[g],f=c[e],void 0!=f&&(b[e]=f);if(void 0!=c.opacity)b.graphicOpacity=c.opacity;if(void 0!=c.size)isNaN(c.size/2)?b.graphicWidth=c.size:b.pointRadius=c.size/2;if(void 0!=c.href)b.externalGraphic=c.href;if(void 0!=c.rotation)b.rotation=c.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(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.opacity=c},Size:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.size=c},Rotation:function(a,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.rotation=c},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,c;for(c in this.cssMap)if(this.cssMap[c]==a){b=c;break}return b},getGraphicFormat:function(a){var b,c;for(c in this.graphicFormats)if(this.graphicFormats[c].test(a)){b=
c;break}return b||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(a,b){var c=this.createElementNSPlus(a),d="string"==typeof b?b.split("${"):[b];c.appendChild(this.createTextNode(d[0]));for(var e,f,g=1,h=d.length;g<h;g++)e=d[g],f=e.indexOf("}"),0<f?(this.writeNode("ogc:PropertyName",
{property:e.substring(0,f)},c),c.appendChild(this.createTextNode(e.substring(++f)))):c.appendChild(this.createTextNode("${"+e));return c},StyledLayerDescriptor:function(a){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);a.name&&this.writeNode("Name",a.name,b);a.title&&this.writeNode("Title",a.title,b);a.description&&
this.writeNode("Abstract",a.description,b);if(OpenLayers.Util.isArray(a.namedLayers))for(var c=0,d=a.namedLayers.length;c<d;++c)this.writeNode("NamedLayer",a.namedLayers[c],b);else for(c in a.namedLayers)this.writeNode("NamedLayer",a.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(a){var b=
this.createElementNSPlus("sld:NamedLayer");this.writeNode("Name",a.name,b);if(a.namedStyles)for(var c=0,d=a.namedStyles.length;c<d;++c)this.writeNode("NamedStyle",a.namedStyles[c],b);if(a.userStyles){c=0;for(d=a.userStyles.length;c<d;++c)this.writeNode("UserStyle",a.userStyles[c],b)}return b},NamedStyle:function(a){var b=this.createElementNSPlus("sld:NamedStyle");this.writeNode("Name",a,b);return b},UserStyle:function(a){var b=this.createElementNSPlus("sld:UserStyle");a.name&&this.writeNode("Name",
a.name,b);a.title&&this.writeNode("Title",a.title,b);a.description&&this.writeNode("Abstract",a.description,b);a.isDefault&&this.writeNode("IsDefault",a.isDefault,b);if(this.multipleSymbolizers&&a.rules){for(var c={"0":[]},d=[0],e,f,g,h,j,k=0,l=a.rules.length;k<l;++k)if(e=a.rules[k],e.symbolizers){f={};for(var n=0,m=e.symbolizers.length;n<m;++n){g=e.symbolizers[n];h=g.zIndex;if(!(h in f))j=e.clone(),j.symbolizers=[],f[h]=j;f[h].symbolizers.push(g.clone())}for(h in f)h in c||(d.push(h),c[h]=[]),c[h].push(f[h])}else c[0].push(e.clone());
d.sort();k=0;for(l=d.length;k<l;++k)if(e=c[d[k]],0<e.length)j=a.clone(),j.rules=c[d[k]],this.writeNode("FeatureTypeStyle",j,b)}else this.writeNode("FeatureTypeStyle",a,b);return b},IsDefault:function(a){return this.createElementNSPlus("sld:IsDefault",{value:a?"1":"0"})},FeatureTypeStyle:function(a){for(var b=this.createElementNSPlus("sld:FeatureTypeStyle"),c=0,d=a.rules.length;c<d;++c)this.writeNode("Rule",a.rules[c],b);return b},Rule:function(a){var b=this.createElementNSPlus("sld:Rule");a.name&&
this.writeNode("Name",a.name,b);a.title&&this.writeNode("Title",a.title,b);a.description&&this.writeNode("Abstract",a.description,b);a.elseFilter?this.writeNode("ElseFilter",null,b):a.filter&&this.writeNode("ogc:Filter",a.filter,b);void 0!=a.minScaleDenominator&&this.writeNode("MinScaleDenominator",a.minScaleDenominator,b);void 0!=a.maxScaleDenominator&&this.writeNode("MaxScaleDenominator",a.maxScaleDenominator,b);var c,d;if(this.multipleSymbolizers&&a.symbolizers)for(var e=0,f=a.symbolizers.length;e<
f;++e)d=a.symbolizers[e],c=d.CLASS_NAME.split(".").pop(),this.writeNode(c+"Symbolizer",d,b);else for(var f=OpenLayers.Style.SYMBOLIZER_PREFIXES,e=0,g=f.length;e<g;++e)c=f[e],(d=a.symbolizer[c])&&this.writeNode(c+"Symbolizer",d,b);return b},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");void 0!=a.strokeColor&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeColor"},b);void 0!=a.strokeOpacity&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeOpacity"},b);void 0!=a.strokeWidth&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeWidth"},b);void 0!=a.strokeDashstyle&&"solid"!==
a.strokeDashstyle&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeDashstyle"},b);void 0!=a.strokeLinecap&&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");null!=a.label&&this.writeNode("Label",a.label,b);(null!=a.fontFamily||null!=a.fontSize||
null!=a.fontWeight||null!=a.fontStyle)&&this.writeNode("Font",a,b);(null!=a.labelAnchorPointX||null!=a.labelAnchorPointY||null!=a.labelAlign||null!=a.labelXOffset||null!=a.labelYOffset||null!=a.labelRotation||null!=a.labelPerpendicularOffset)&&this.writeNode("LabelPlacement",a,b);(null!=a.haloRadius||null!=a.haloColor||null!=a.haloOpacity)&&this.writeNode("Halo",a,b);(null!=a.fontColor||null!=a.fontOpacity)&&this.writeNode("Fill",{fillColor:a.fontColor,fillOpacity:a.fontOpacity},b);return b},LabelPlacement:function(a){var b=
this.createElementNSPlus("sld:LabelPlacement");(null!=a.labelAnchorPointX||null!=a.labelAnchorPointY||null!=a.labelAlign||null!=a.labelXOffset||null!=a.labelYOffset||null!=a.labelRotation)&&null==a.labelPerpendicularOffset&&this.writeNode("PointPlacement",a,b);null!=a.labelPerpendicularOffset&&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");(null!=a.labelAnchorPointX||null!=a.labelAnchorPointY||null!=a.labelAlign)&&this.writeNode("AnchorPoint",a,b);(null!=a.labelXOffset||null!=a.labelYOffset)&&this.writeNode("Displacement",a,b);null!=a.labelRotation&&this.writeNode("Rotation",a.labelRotation,b);return b},AnchorPoint:function(a){var b=this.createElementNSPlus("sld:AnchorPoint"),c=a.labelAnchorPointX,d=a.labelAnchorPointY;null!=c&&this.writeNode("AnchorPointX",
c,b);null!=d&&this.writeNode("AnchorPointY",d,b);if(null==c&&null==d){var e=a.labelAlign.substr(0,1),a=a.labelAlign.substr(1,1);"l"===e?c=0:"c"===e?c=0.5:"r"===e&&(c=1);"b"===a?d=0:"m"===a?d=0.5:"t"===a&&(d=1);this.writeNode("AnchorPointX",c,b);this.writeNode("AnchorPointY",d,b)}return b},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");
null!=a.labelXOffset&&this.writeNode("DisplacementX",a.labelXOffset,b);null!=a.labelYOffset&&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");a.fontFamily&&this.writeNode("CssParameter",{symbolizer:a,key:"fontFamily"},b);a.fontSize&&this.writeNode("CssParameter",
{symbolizer:a,key:"fontSize"},b);a.fontWeight&&this.writeNode("CssParameter",{symbolizer:a,key:"fontWeight"},b);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");a.haloRadius&&this.writeNode("Radius",a.haloRadius,b);(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");a.geometry&&this.writeNode("Geometry",a.geometry,b);a.opacity&&this.writeNode("Opacity",a.opacity,b);a.colorMap&&this.writeNode("ColorMap",a.colorMap,b);return b},Geometry:function(a){var b=this.createElementNSPlus("sld:Geometry");a.property&&this.writeNode("ogc:PropertyName",a,b);return b},ColorMap:function(a){for(var b=this.createElementNSPlus("sld:ColorMap"),
c=0,d=a.length;c<d;++c)this.writeNode("ColorMapEntry",a[c],b);return b},ColorMapEntry:function(a){var b=this.createElementNSPlus("sld:ColorMapEntry");b.setAttribute("color",a.color);void 0!==a.opacity&&b.setAttribute("opacity",parseFloat(a.opacity));void 0!==a.quantity&&b.setAttribute("quantity",parseFloat(a.quantity));void 0!==a.label&&b.setAttribute("label",a.label);return b},PolygonSymbolizer:function(a){var b=this.createElementNSPlus("sld:PolygonSymbolizer");!1!==a.fill&&this.writeNode("Fill",
a,b);!1!==a.stroke&&this.writeNode("Stroke",a,b);return b},Fill:function(a){var b=this.createElementNSPlus("sld:Fill");a.fillColor&&this.writeNode("CssParameter",{symbolizer:a,key:"fillColor"},b);null!=a.fillOpacity&&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");void 0!=a.externalGraphic?
this.writeNode("ExternalGraphic",a,b):this.writeNode("Mark",a,b);void 0!=a.graphicOpacity&&this.writeNode("Opacity",a.graphicOpacity,b);void 0!=a.pointRadius?this.writeNode("Size",2*a.pointRadius,b):void 0!=a.graphicWidth&&this.writeNode("Size",a.graphicWidth,b);void 0!=a.rotation&&this.writeNode("Rotation",a.rotation,b);return b},ExternalGraphic:function(a){var b=this.createElementNSPlus("sld:ExternalGraphic");this.writeNode("OnlineResource",a.externalGraphic,b);this.writeNode("Format",a.graphicFormat||
this.getGraphicFormat(a.externalGraphic),b);return b},Mark:function(a){var b=this.createElementNSPlus("sld:Mark");a.graphicName&&this.writeNode("WellKnownName",a.graphicName,b);!1!==a.fill&&this.writeNode("Fill",a,b);!1!==a.stroke&&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.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(a){var b,c,a=a.replace(/[\n\r]/g," ");if(c=this.regExes.typeStr.exec(a))if(a=c[1].toLowerCase(),c=c[2],this.parse[a]&&(b=this.parse[a].apply(this,[c])),this.internalProjection&&this.externalProjection)if(b&&
"OpenLayers.Feature.Vector"==b.CLASS_NAME)b.geometry.transform(this.externalProjection,this.internalProjection);else if(b&&"geometrycollection"!=a&&"object"==typeof b){a=0;for(c=b.length;a<c;a++)b[a].geometry.transform(this.externalProjection,this.internalProjection)}return b},write:function(a){var b,c;a.constructor==Array?c=!0:(a=[a],c=!1);var d=[];c&&d.push("GEOMETRYCOLLECTION(");for(var e=0,f=a.length;e<f;++e)c&&0<e&&d.push(","),b=a[e].geometry,d.push(this.extractGeometry(b));c&&d.push(")");return d.join("")},
extractGeometry:function(a){var b=a.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[b])return null;this.internalProjection&&this.externalProjection&&(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));return("collection"==b?"GEOMETRYCOLLECTION":b.toUpperCase())+"("+this.extract[b].apply(this,[a])+")"},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.point.apply(this,[a.components[c]])+
")");return b.join(",")},linestring:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.point.apply(this,[a.components[c]]));return b.join(",")},multilinestring:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")");return b.join(",")},polygon:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")");return b.join(",")},multipolygon:function(a){for(var b=
[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.polygon.apply(this,[a.components[c]])+")");return b.join(",")},collection:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extractGeometry.apply(this,[a.components[c]]));return b.join(",")}},parse:{point:function(a){a=OpenLayers.String.trim(a).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0],a[1]))},multipoint:function(a){for(var b=OpenLayers.String.trim(a).split(","),
c=[],d=0,e=b.length;d<e;++d)a=b[d].replace(this.regExes.trimParens,"$1"),c.push(this.parse.point.apply(this,[a]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(c))},linestring:function(a){for(var a=OpenLayers.String.trim(a).split(","),b=[],c=0,d=a.length;c<d;++c)b.push(this.parse.point.apply(this,[a[c]]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(b))},multilinestring:function(a){for(var b=OpenLayers.String.trim(a).split(this.regExes.parenComma),
c=[],d=0,e=b.length;d<e;++d)a=b[d].replace(this.regExes.trimParens,"$1"),c.push(this.parse.linestring.apply(this,[a]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(c))},polygon:function(a){for(var b,a=OpenLayers.String.trim(a).split(this.regExes.parenComma),c=[],d=0,e=a.length;d<e;++d)b=a[d].replace(this.regExes.trimParens,"$1"),b=this.parse.linestring.apply(this,[b]).geometry,b=new OpenLayers.Geometry.LinearRing(b.components),c.push(b);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(c))},
multipolygon:function(a){for(var b=OpenLayers.String.trim(a).split(this.regExes.doubleParenComma),c=[],d=0,e=b.length;d<e;++d)a=b[d].replace(this.regExes.trimParens,"$1"),c.push(this.parse.polygon.apply(this,[a]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(c))},geometrycollection:function(a){for(var a=a.replace(/,\s*([A-Za-z])/g,"|$1"),a=OpenLayers.String.trim(a).split("|"),b=[],c=0,d=a.length;c<d;++c)b.push(OpenLayers.Format.WKT.prototype.read.apply(this,[a[c]]));
return b}},CLASS_NAME:"OpenLayers.Format.WKT"});
OpenLayers.Format.CQL=function(){function a(a){function b(){var a=e.pop();switch(a.type){case "LOGICAL":var c=b(),g=b();return new OpenLayers.Filter.Logical({filters:[g,c],type:f[a.text.toUpperCase()]});case "NOT":return a=b(),new OpenLayers.Filter.Logical({filters:[a],type:OpenLayers.Filter.Logical.NOT});case "BETWEEN":return e.pop(),g=b(),a=b(),c=b(),new OpenLayers.Filter.Comparison({property:c,lowerBoundary:a,upperBoundary:g,type:OpenLayers.Filter.Comparison.BETWEEN});case "COMPARISON":return g=
b(),c=b(),new OpenLayers.Filter.Comparison({property:c,value:g,type:d[a.text.toUpperCase()]});case "IS_NULL":return c=b(),new OpenLayers.Filter.Comparison({property:c,type:d[a.text.toUpperCase()]});case "VALUE":return(c=a.text.match(/^'(.*)'$/))?c[1].replace(/''/g,"'"):Number(a.text);case "SPATIAL":switch(a.text.toUpperCase()){case "BBOX":var a=b(),c=b(),g=b(),h=b(),j=b();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:j,value:OpenLayers.Bounds.fromArray([h,g,c,
a])});case "INTERSECTS":return g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:c,value:g});case "WITHIN":return g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.WITHIN,property:c,value:g});case "CONTAINS":return g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.CONTAINS,property:c,value:g});case "DWITHIN":return a=b(),g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,value:g,
property:c,distance:Number(a)})}case "GEOMETRY":return OpenLayers.Geometry.fromWKT(a.text);default:return a.text}}for(var c=[],e=[];a.length;){var g=a.shift();switch(g.type){case "PROPERTY":case "GEOMETRY":case "VALUE":e.push(g);break;case "COMPARISON":case "BETWEEN":case "IS_NULL":case "LOGICAL":for(var j=h[g.type];0<c.length&&h[c[c.length-1].type]<=j;)e.push(c.pop());c.push(g);break;case "SPATIAL":case "NOT":case "LPAREN":c.push(g);break;case "RPAREN":for(;0<c.length&&"LPAREN"!=c[c.length-1].type;)e.push(c.pop());
c.pop();0<c.length&&"SPATIAL"==c[c.length-1].type&&e.push(c.pop());case "COMMA":case "END":break;default:throw Error("Unknown token type "+g.type);}}for(;0<c.length;)e.push(c.pop());a=b();if(0<e.length){a="Remaining tokens after building AST: \n";for(c=e.length-1;0<=c;c--)a+=e[c].type+": "+e[c].text+"\n";throw Error(a);}return a}var b={PROPERTY:/^[_a-zA-Z]\w*/,COMPARISON:/^(=|<>|<=|<|>=|>|LIKE)/i,IS_NULL:/^IS NULL/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('([^']|'')*'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/,
RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(a){var b=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(a);if(b){var c=a.length,b=a.indexOf("(",b[0].length);if(-1<b)for(var d=1;b<c&&0<d;)switch(b++,a.charAt(b)){case "(":d++;break;case ")":d--}return[a.substr(0,b+1)]}},END:/^$/},c={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON",
"BETWEEN","COMMA","IS_NULL"],BETWEEN:["VALUE"],IS_NULL:["END"],COMPARISON:["VALUE"],COMMA:["GEOMETRY","VALUE","PROPERTY"],VALUE:["LOGICAL","COMMA","RPAREN","END"],SPATIAL:["LPAREN"],LOGICAL:["NOT","VALUE","SPATIAL","PROPERTY","LPAREN"],NOT:["PROPERTY","LPAREN"],GEOMETRY:["COMMA","RPAREN"]},d={"=":OpenLayers.Filter.Comparison.EQUAL_TO,"<>":OpenLayers.Filter.Comparison.NOT_EQUAL_TO,"<":OpenLayers.Filter.Comparison.LESS_THAN,"<=":OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,">":OpenLayers.Filter.Comparison.GREATER_THAN,
">=":OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,LIKE:OpenLayers.Filter.Comparison.LIKE,BETWEEN:OpenLayers.Filter.Comparison.BETWEEN,"IS NULL":OpenLayers.Filter.Comparison.IS_NULL},e={},f={AND:OpenLayers.Filter.Logical.AND,OR:OpenLayers.Filter.Logical.OR},g={},h={RPAREN:3,LOGICAL:2,COMPARISON:1},j;for(j in d)d.hasOwnProperty(j)&&(e[d[j]]=j);for(j in f)f.hasOwnProperty(j)&&(g[f[j]]=j);return OpenLayers.Class(OpenLayers.Format,{read:function(d){var e=d,d=[],f,g=["NOT","GEOMETRY","SPATIAL",
"PROPERTY","LPAREN"];do{a:{f=g;for(var h=void 0,g=void 0,j=f.length,h=0;h<j;h++){var g=f[h],r=b[g]instanceof RegExp?b[g].exec(e):(0,b[g])(e);if(r){f=r[0];e=e.substr(f.length).replace(/^\s*/,"");f={type:g,text:f,remainder:e};break a}}d="ERROR: In parsing: ["+e+"], expected one of: ";for(h=0;h<j;h++)g=f[h],d+="\n    "+g+": "+b[g];throw Error(d);}e=f.remainder;g=c[f.type];if("END"!=f.type&&!g)throw Error("No follows list for "+f.type);d.push(f)}while("END"!=f.type);d=a(d);if(this.keepData)this.data=
d;return d},write:function(a){if(a instanceof OpenLayers.Geometry)return a.toString();switch(a.CLASS_NAME){case "OpenLayers.Filter.Spatial":switch(a.type){case OpenLayers.Filter.Spatial.BBOX:return"BBOX("+a.property+","+a.value.toBBOX()+")";case OpenLayers.Filter.Spatial.DWITHIN:return"DWITHIN("+a.property+", "+this.write(a.value)+", "+a.distance+")";case OpenLayers.Filter.Spatial.WITHIN:return"WITHIN("+a.property+", "+this.write(a.value)+")";case OpenLayers.Filter.Spatial.INTERSECTS:return"INTERSECTS("+
a.property+", "+this.write(a.value)+")";case OpenLayers.Filter.Spatial.CONTAINS:return"CONTAINS("+a.property+", "+this.write(a.value)+")";default:throw Error("Unknown spatial filter type: "+a.type);}case "OpenLayers.Filter.Logical":if(a.type==OpenLayers.Filter.Logical.NOT)return"NOT ("+this.write(a.filters[0])+")";for(var b="(",c=!0,d=0;d<a.filters.length;d++)c?c=!1:b+=") "+g[a.type]+" (",b+=this.write(a.filters[d]);return b+")";case "OpenLayers.Filter.Comparison":return a.type==OpenLayers.Filter.Comparison.BETWEEN?
a.property+" BETWEEN "+this.write(a.lowerBoundary)+" AND "+this.write(a.upperBoundary):null!==a.value?a.property+" "+e[a.type]+" "+this.write(a.value):a.property+" "+e[a.type];case void 0:if("string"===typeof a)return"'"+a.replace(/'/g,"''")+"'";if("number"===typeof a)return""+a;default:throw Error("Can't encode: "+a.CLASS_NAME+" "+a);}},CLASS_NAME:"OpenLayers.Format.CQL"})}();
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,b){var c=this.readers.ogc._expression.call(this,a);if(c)b.priority=c},VendorOption:function(a,b){if(!b.vendorOptions)b.vendorOptions={};b.vendorOptions[a.getAttribute("name")]=this.getChildValue(a)},TextSymbolizer:function(a,b){OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld.TextSymbolizer.apply(this,
arguments);var c=this.multipleSymbolizers?b.symbolizers[b.symbolizers.length-1]:b.symbolizer.Text;if(void 0===c.graphic)c.graphic=!1}},OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.readers),writers:OpenLayers.Util.applyDefaults({sld:OpenLayers.Util.applyDefaults({Priority:function(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(a){var b=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.TextSymbolizer.apply(this,arguments);!1!==a.graphic&&(a.externalGraphic||a.graphicName)&&this.writeNode("Graphic",a,b);"priority"in a&&this.writeNode("Priority",a.priority,b);return this.addVendorOptions(b,a)},PointSymbolizer:function(a){return this.addVendorOptions(OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PointSymbolizer.apply(this,arguments),a)},LineSymbolizer:function(a){return this.addVendorOptions(OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.LineSymbolizer.apply(this,
arguments),a)},PolygonSymbolizer:function(a){return this.addVendorOptions(OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PolygonSymbolizer.apply(this,arguments),a)}},OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.writers),addVendorOptions:function(a,b){if(b.vendorOptions)for(var c in b.vendorOptions)this.writeNode("VendorOption",{name:c,value:b.vendorOptions[c]},a);return a},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0_GeoServer"});
OpenLayers.Format.CSWGetRecords=function(a){var a=OpenLayers.Util.applyDefaults(a,OpenLayers.Format.CSWGetRecords.DEFAULTS),b=OpenLayers.Format.CSWGetRecords["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported CSWGetRecords version: "+a.version;return new b(a)};OpenLayers.Format.CSWGetRecords.DEFAULTS={version:"2.0.2"};
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){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));if(a&&9==a.nodeType)a=a.documentElement;var b={};this.readNode(a,b);return b},
readers:{csw:{GetRecordsResponse:function(a,b){b.records=[];this.readChildNodes(a,b);var c=this.getAttributeNS(a,"","version");if(""!=c)b.version=c},RequestId:function(a,b){b.RequestId=this.getChildValue(a)},SearchStatus:function(a,b){b.SearchStatus={};var c=this.getAttributeNS(a,"","timestamp");if(""!=c)b.SearchStatus.timestamp=c},SearchResults:function(a,b){this.readChildNodes(a,b);for(var c=a.attributes,d={},e=0,f=c.length;e<f;++e)d[c[e].name]="numberOfRecordsMatched"==c[e].name||"numberOfRecordsReturned"==
c[e].name||"nextRecord"==c[e].name?parseInt(c[e].nodeValue):c[e].nodeValue;b.SearchResults=d},SummaryRecord:function(a,b){var c={type:"SummaryRecord"};this.readChildNodes(a,c);b.records.push(c)},BriefRecord:function(a,b){var c={type:"BriefRecord"};this.readChildNodes(a,c);b.records.push(c)},DCMIRecord:function(a,b){var c={type:"DCMIRecord"};this.readChildNodes(a,c);b.records.push(c)},Record:function(a,b){var c={type:"Record"};this.readChildNodes(a,c);b.records.push(c)},"*":function(a,b){var c=a.localName||
a.nodeName.split(":").pop();b[c]=this.getChildValue(a)}},geonet:{info:function(a,b){var c={};this.readChildNodes(a,c);b.gninfo=c}},dc:{"*":function(a,b){var c=a.localName||a.nodeName.split(":").pop();OpenLayers.Util.isArray(b[c])||(b[c]=[]);for(var d={},e=a.attributes,f=0,g=e.length;f<g;++f)d[e[f].name]=e[f].nodeValue;d.value=this.getChildValue(a);""!=d.value&&b[c].push(d)}},dct:{"*":function(a,b){var c=a.localName||a.nodeName.split(":").pop();OpenLayers.Util.isArray(b[c])||(b[c]=[]);b[c].push(this.getChildValue(a))}},
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){a=this.writeNode("csw:GetRecords",a);a.setAttribute("xmlns:gmd",this.namespaces.gmd);return OpenLayers.Format.XML.prototype.write.apply(this,
[a])},writers:{csw:{GetRecords:function(a){a||(a={});var b=this.createElementNSPlus("csw:GetRecords",{attributes:{service:"CSW",version:this.version,requestId:a.requestId||this.requestId,resultType:a.resultType||this.resultType,outputFormat:a.outputFormat||this.outputFormat,outputSchema:a.outputSchema||this.outputSchema,startPosition:a.startPosition||this.startPosition,maxRecords:a.maxRecords||this.maxRecords}});if(a.DistributedSearch||this.DistributedSearch)this.writeNode("csw:DistributedSearch",
a.DistributedSearch||this.DistributedSearch,b);var c=a.ResponseHandler||this.ResponseHandler;if(OpenLayers.Util.isArray(c)&&0<c.length)for(var d=0,e=c.length;d<e;d++)this.writeNode("csw:ResponseHandler",c[d],b);this.writeNode("Query",a.Query||this.Query,b);return b},DistributedSearch:function(a){return this.createElementNSPlus("csw:DistributedSearch",{attributes:{hopCount:a.hopCount}})},ResponseHandler:function(a){return this.createElementNSPlus("csw:ResponseHandler",{value:a.value})},Query:function(a){a||
(a={});var b=this.createElementNSPlus("csw:Query",{attributes:{typeNames:a.typeNames||"csw:Record"}}),c=a.ElementName;if(OpenLayers.Util.isArray(c)&&0<c.length)for(var d=0,e=c.length;d<e;d++)this.writeNode("csw:ElementName",c[d],b);else this.writeNode("csw:ElementSetName",a.ElementSetName||{value:"summary"},b);a.Constraint&&this.writeNode("csw:Constraint",a.Constraint,b);a.SortBy&&this.writeNode("ogc:SortBy",a.SortBy,b);return b},ElementName:function(a){return this.createElementNSPlus("csw:ElementName",
{value:a.value})},ElementSetName:function(a){return this.createElementNSPlus("csw:ElementSetName",{attributes:{typeNames:a.typeNames},value:a.value})},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 a.CqlText&&(a=this.createElementNSPlus("CqlText",{value:a.CqlText.value}),b.appendChild(a));return b}},ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},
CLASS_NAME:"OpenLayers.Format.CSWGetRecords.v2_0_2"});
OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:!1,initialize:function(a,b,c,d){OpenLayers.Layer.prototype.initialize.apply(this,[a,d]);this.url=b;if(!this.params)this.params=OpenLayers.Util.extend({},c)},destroy:function(){this.params=this.url=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){null==a&&(a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions()));
return a=OpenLayers.Layer.prototype.clone.apply(this,[a])},setUrl:function(a){this.url=a},mergeNewParams:function(a){this.params=OpenLayers.Util.extend(this.params,a);a=this.redraw();null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"params"});return a},redraw:function(a){return a?this.mergeNewParams({_olSalt:Math.random()}):OpenLayers.Layer.prototype.redraw.apply(this,[])},selectUrl:function(a,b){for(var c=1,d=0,e=a.length;d<e;d++)c*=a.charCodeAt(d)*this.URL_HASH_FACTOR,
c-=Math.floor(c);return b[Math.floor(c*b.length)]},getFullRequestString:function(a,b){var c=b||this.url,d=OpenLayers.Util.extend({},this.params),d=OpenLayers.Util.extend(d,a),e=OpenLayers.Util.getParameterString(d);OpenLayers.Util.isArray(c)&&(c=this.selectUrl(e,c));var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),f;for(f in d)f.toUpperCase()in e&&delete d[f];e=OpenLayers.Util.getParameterString(d);return OpenLayers.Util.urlAppend(c,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:!1,initialize:function(a,b,c,d,e,f){this.layer=a;this.position=b.clone();this.setBounds(c);this.url=d;if(e)this.size=e.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");OpenLayers.Util.extend(this,f);this.events=new OpenLayers.Events(this);if(this.eventListeners instanceof Object)this.events.on(this.eventListeners)},unload:function(){if(this.isLoading)this.isLoading=
!1,this.events.triggerEvent("unload")},destroy:function(){this.position=this.size=this.bounds=this.layer=null;this.eventListeners&&this.events.un(this.eventListeners);this.events.destroy();this.events=this.eventListeners=null},draw:function(a){a||this.clear();var b=this.shouldDraw();b&&!a&&!1===this.events.triggerEvent("beforedraw")&&(b=null);return b},shouldDraw:function(){var a=!1,b=this.layer.maxExtent;if(b){var c=this.layer.map,c=c.baseLayer.wrapDateLine&&c.getMaxExtent();this.bounds.intersectsBounds(b,
{inclusive:!1,worldBounds:c})&&(a=!0)}return a||this.layer.displayOutsideMaxExtent},setBounds:function(a){a=a.clone();if(this.layer.map.baseLayer.wrapDateLine)var b=this.layer.map.getMaxExtent(),c=this.layer.map.getResolution(),a=a.wrapDateLine(b,{leftTolerance:c,rightTolerance:c});this.bounds=a},moveTo:function(a,b,c){null==c&&(c=!0);this.setBounds(a);this.position=b.clone();c&&this.draw()},clear:function(){},CLASS_NAME:"OpenLayers.Tile"});
OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,imageReloadAttempts:null,layerAlphaHack:null,asyncRequestId:null,maxGetUrlLength:null,canvasContext:null,crossOriginKeyword:null,initialize:function(a,b,c,d,e,f){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=d;this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack();if(null!=this.maxGetUrlLength||this.layer.gutter||this.layerAlphaHack)this.frame=document.createElement("div"),this.frame.style.position=
"absolute",this.frame.style.overflow="hidden";null!=this.maxGetUrlLength&&OpenLayers.Util.extend(this,OpenLayers.Tile.Image.IFrame)},destroy:function(){if(this.imgDiv)this.clear(),this.frame=this.imgDiv=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);this.isLoading?
this._loadEvent="reload":(this.isLoading=!0,this._loadEvent="loadstart");this.renderTile();this.positionTile()}else!1===a&&this.unload();return a},renderTile:function(){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 a=this.getTile().style,b=this.frame?this.size:this.layer.getImageSize(this.bounds),
c=1;this.layer instanceof OpenLayers.Layer.Grid&&(c=this.layer.getServerResolution()/this.layer.map.getResolution());a.left=this.position.x+"px";a.top=this.position.y+"px";a.width=Math.round(c*b.w)+"px";a.height=Math.round(c*b.h)+"px"},clear:function(){OpenLayers.Tile.prototype.clear.apply(this,arguments);var a=this.imgDiv;if(a){var b=this.getTile();b.parentNode===this.layer.div&&this.layer.div.removeChild(b);this.setImgSrc();if(!0===this.layerAlphaHack)a.style.filter="";OpenLayers.Element.removeClass(a,
"olImageLoadError")}this.canvasContext=null},getImage:function(){if(!this.imgDiv){this.imgDiv=OpenLayers.Tile.Image.IMAGE.cloneNode(!1);var a=this.imgDiv.style;if(this.frame){var b=0,c=0;this.layer.gutter&&(b=100*(this.layer.gutter/this.layer.tileSize.w),c=100*(this.layer.gutter/this.layer.tileSize.h));a.left=-b+"%";a.top=-c+"%";a.width=2*b+100+"%";a.height=2*c+100+"%"}a.visibility="hidden";a.opacity=0;if(1>this.layer.opacity)a.filter="alpha(opacity="+100*this.layer.opacity+")";a.position="absolute";
if(this.layerAlphaHack)a.paddingTop=a.height,a.height="0",a.width="100%";this.frame&&this.frame.appendChild(this.imgDiv)}return this.imgDiv},setImage:function(a){this.imgDiv=a},initImage:function(){if(!this.url&&!this.imgDiv)this.isLoading=!1;else{this.events.triggerEvent("beforeload");this.layer.div.appendChild(this.getTile());this.events.triggerEvent(this._loadEvent);var a=this.getImage(),b=a.getAttribute("src")||"";this.url&&OpenLayers.Util.isEquivalentUrl(b,this.url)?this._loadTimeout=window.setTimeout(OpenLayers.Function.bind(this.onImageLoad,
this),0):(this.stopLoading(),this.crossOriginKeyword&&a.removeAttribute("crossorigin"),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))}},setImgSrc:function(a){var b=this.imgDiv;a?(b.style.visibility="hidden",b.style.opacity=0,this.crossOriginKeyword&&("data:"!==a.substr(0,5)?b.setAttribute("crossorigin",this.crossOriginKeyword):
b.removeAttribute("crossorigin")),b.src=a):(this.stopLoading(),this.imgDiv=null,b.parentNode&&b.parentNode.removeChild(b))},getTile:function(){return this.frame?this.frame:this.getImage()},createBackBuffer:function(){if(this.imgDiv&&!this.isLoading){var a;this.frame?(a=this.frame.cloneNode(!1),a.appendChild(this.imgDiv)):a=this.imgDiv;this.imgDiv=null;return a}},onImageLoad:function(){var a=this.imgDiv;this.stopLoading();a.style.visibility="inherit";a.style.opacity=this.layer.opacity;this.isLoading=
!1;this.canvasContext=null;this.events.triggerEvent("loadend");if(!0===this.layerAlphaHack)a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"', sizingMethod='scale')"},onImageError:function(){var a=this.imgDiv;null!=a.src&&(this.imageReloadAttempts++,this.imageReloadAttempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS?this.setImgSrc(this.layer.getURL(this.bounds)):(OpenLayers.Element.addClass(a,"olImageLoadError"),this.events.triggerEvent("loaderror"),this.onImageLoad()))},stopLoading:function(){OpenLayers.Event.stopObservingElement(this.imgDiv);
window.clearTimeout(this._loadTimeout);delete this._loadTimeout},getCanvasContext:function(){if(OpenLayers.CANVAS_SUPPORTED&&this.imgDiv&&!this.isLoading){if(!this.canvasContext){var 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.Tile.Image.IMAGE=function(){var a=new Image;a.className="olTileImage";a.galleryImg="no";return a}();
OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,tileClass:OpenLayers.Tile.Image,grid:null,singleTile:!1,ratio:1.5,buffer:0,transitionEffect:"resize",numLoadingTiles:0,serverResolutions:null,loading:!1,backBuffer:null,gridResolution:null,backBufferResolution:null,backBufferLonLat:null,backBufferTimerId:null,removeBackBufferDelay:null,className:null,gridLayout:null,rowSign:null,transitionendEvents:["transitionend",
"webkitTransitionEnd","otransitionend","oTransitionEnd"],initialize:function(a,b,c,d){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.grid=[];this._removeBackBuffer=OpenLayers.Function.bind(this.removeBackBuffer,this);this.initProperties();this.rowSign="t"===this.tileOriginCorner.substr(0,1)?1:-1},initProperties:function(){if(void 0===this.options.removeBackBufferDelay)this.removeBackBufferDelay=this.singleTile?0:2500;if(void 0===this.options.className)this.className=
this.singleTile?"olLayerGridSingleTile":"olLayerGrid"},setMap:function(a){OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this,a);OpenLayers.Element.addClass(this.div,this.className)},removeMap:function(){this.removeBackBuffer()},destroy:function(){this.removeBackBuffer();this.clearGrid();this.tileSize=this.grid=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var a=0,b=this.grid.length;a<b;a++)for(var c=this.grid[a],d=0,e=c.length;d<
e;d++)this.destroyTile(c[d]);this.grid=[];this.gridLayout=this.gridResolution=null}},addOptions:function(a,b){var c=void 0!==a.singleTile&&a.singleTile!==this.singleTile;OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this,arguments);if(this.map&&c)this.initProperties(),this.clearGrid(),this.tileSize=this.options.tileSize,this.setTileSize(),this.moveTo(null,!0)},clone:function(a){null==a&&(a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions()));a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,
[a]);if(null!=this.tileSize)a.tileSize=this.tileSize.clone();a.grid=[];a.gridResolution=null;a.backBuffer=null;a.backBufferTimerId=null;a.loading=!1;a.numLoadingTiles=0;return a},moveTo:function(a,b,c){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);a=a||this.map.getExtent();if(null!=a){var d=!this.grid.length||b,e=this.getTilesBounds(),f=this.map.getResolution();this.getServerResolution(f);if(this.singleTile){if(d||!c&&!e.containsBounds(a))b&&"resize"!==this.transitionEffect&&
this.removeBackBuffer(),(!b||"resize"===this.transitionEffect)&&this.applyBackBuffer(f),this.initSingleTile(a)}else(d=d||!e.intersectsBounds(a,{worldBounds:this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent()}))?(b&&("resize"===this.transitionEffect||this.gridResolution===f)&&this.applyBackBuffer(f),this.initGriddedTiles(a)):this.moveGriddedTiles()}},getTileData:function(a){var b=null,c=a.lon,d=a.lat,e=this.grid.length;if(this.map&&e){var f=this.map.getResolution(),a=this.tileSize.w,g=this.tileSize.h,
h=this.grid[0][0].bounds,j=h.left,h=h.top;if(c<j&&this.map.baseLayer.wrapDateLine)var k=this.map.getMaxExtent().getWidth(),l=Math.ceil((j-c)/k),c=c+k*l;c=(c-j)/(f*a);d=(h-d)/(f*g);f=Math.floor(c);j=Math.floor(d);0<=j&&j<e&&(e=this.grid[j][f])&&(b={tile:e,i:Math.floor((c-f)*a),j:Math.floor((d-j)*g)})}return b},destroyTile:function(a){this.removeTileMonitoringHooks(a);a.destroy()},getServerResolution:function(a){var b=Number.POSITIVE_INFINITY,a=a||this.map.getResolution();if(this.serverResolutions&&
-1===OpenLayers.Util.indexOf(this.serverResolutions,a)){var c,d,e,f;for(c=this.serverResolutions.length-1;0<=c;c--){e=this.serverResolutions[c];d=Math.abs(e-a);if(d>b)break;b=d;f=e}a=f}return a},getServerZoom:function(){var a=this.getServerResolution();return this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,a):this.map.getZoomForResolution(a)+(this.zoomOffset||0)},applyBackBuffer:function(a){null!==this.backBufferTimerId&&this.removeBackBuffer();var b=this.backBuffer;if(!b){b=
this.createBackBuffer();if(!b)return;a===this.gridResolution?this.div.insertBefore(b,this.div.firstChild):this.map.baseLayer.div.parentNode.insertBefore(b,this.map.baseLayer.div);this.backBuffer=b;var c=this.grid[0][0].bounds;this.backBufferLonLat={lon:c.left,lat:c.top};this.backBufferResolution=this.gridResolution}for(var c=this.backBufferResolution/a,d=b.childNodes,e,f=d.length-1;0<=f;--f)e=d[f],e.style.top=(c*e._i*e._h|0)+"px",e.style.left=(c*e._j*e._w|0)+"px",e.style.width=Math.round(c*e._w)+
"px",e.style.height=Math.round(c*e._h)+"px";a=this.getViewPortPxFromLonLat(this.backBufferLonLat,a);c=this.map.layerContainerOriginPx.y;b.style.left=Math.round(a.x-this.map.layerContainerOriginPx.x)+"px";b.style.top=Math.round(a.y-c)+"px"},createBackBuffer:function(){var a;if(0<this.grid.length){a=document.createElement("div");a.id=this.div.id+"_bb";a.className="olBackBuffer";a.style.position="absolute";var b=this.map;a.style.zIndex="resize"===this.transitionEffect?this.getZIndex()-1:b.Z_INDEX_BASE.BaseLayer-
(b.getNumLayers()-b.getLayerIndex(this));for(var b=0,c=this.grid.length;b<c;b++)for(var d=0,e=this.grid[b].length;d<e;d++){var f=this.grid[b][d],g=this.grid[b][d].createBackBuffer();if(g)g._i=b,g._j=d,g._w=f.size.w,g._h=f.size.h,g.id=f.id+"_bb",a.appendChild(g)}}return a},removeBackBuffer:function(){if(this._transitionElement){for(var a=this.transitionendEvents.length-1;0<=a;--a)OpenLayers.Event.stopObserving(this._transitionElement,this.transitionendEvents[a],this._removeBackBuffer);delete this._transitionElement}if(this.backBuffer&&
(this.backBuffer.parentNode&&this.backBuffer.parentNode.removeChild(this.backBuffer),this.backBufferResolution=this.backBuffer=null,null!==this.backBufferTimerId))window.clearTimeout(this.backBufferTimerId),this.backBufferTimerId=null},moveByPx:function(){this.singleTile||this.moveGriddedTiles()},setTileSize:function(a){if(this.singleTile)a=this.map.getSize(),a.h=parseInt(a.h*this.ratio,10),a.w=parseInt(a.w*this.ratio,10);OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])},getTilesBounds:function(){var a=
null,b=this.grid.length;if(b)var a=this.grid[b-1][0].bounds,b=this.grid[0].length*a.getWidth(),c=this.grid.length*a.getHeight(),a=new OpenLayers.Bounds(a.left,a.bottom,a.left+b,a.bottom+c);return a},initSingleTile:function(a){this.events.triggerEvent("retile");var b=a.getCenterLonLat(),c=a.getWidth()*this.ratio,a=a.getHeight()*this.ratio,b=new OpenLayers.Bounds(b.lon-c/2,b.lat-a/2,b.lon+c/2,b.lat+a/2),c=this.map.getLayerPxFromLonLat({lon:b.left,lat:b.top});this.grid.length||(this.grid[0]=[]);(a=this.grid[0][0])?
a.moveTo(b,c):(a=this.addTile(b,c),this.addTileMonitoringHooks(a),a.draw(),this.grid[0][0]=a);this.removeExcessTiles(1,1);this.gridResolution=this.getServerResolution()},calculateGridLayout:function(a,b,c){var d=c*this.tileSize.w,c=c*this.tileSize.h,e=Math.floor((a.left-b.lon)/d)-this.buffer,f=this.rowSign,a=Math[~f?"floor":"ceil"](f*(b.lat-a.top+c)/c)-this.buffer*f;return{tilelon:d,tilelat:c,startcol:e,startrow:a}},getTileOrigin:function(){var a=this.tileOrigin;if(!a)var a=this.getMaxExtent(),b=
{tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]}[this.tileOriginCorner],a=new OpenLayers.LonLat(a[b[0]],a[b[1]]);return a},getTileBoundsForGridIndex:function(a,b){var c=this.getTileOrigin(),d=this.gridLayout,e=d.tilelon,f=d.tilelat,g=d.startcol,d=d.startrow,h=this.rowSign;return new OpenLayers.Bounds(c.lon+(g+b)*e,c.lat-(d+a*h)*f*h,c.lon+(g+b+1)*e,c.lat-(d+(a-1)*h)*f*h)},initGriddedTiles:function(a){this.events.triggerEvent("retile");var b=this.map.getSize(),c=this.getTileOrigin(),
d=this.map.getResolution(),e=this.getServerResolution(),f=d/e,d=this.tileSize.w/f,f=this.tileSize.h/f,g=Math.ceil(b.h/f)+2*this.buffer+1,b=Math.ceil(b.w/d)+2*this.buffer+1;this.gridLayout=e=this.calculateGridLayout(a,c,e);var c=e.tilelon,h=e.tilelat,e=this.map.layerContainerOriginPx.x,j=this.map.layerContainerOriginPx.y,k=this.getTileBoundsForGridIndex(0,0),l=this.map.getViewPortPxFromLonLat(new OpenLayers.LonLat(k.left,k.top));l.x=Math.round(l.x)-e;l.y=Math.round(l.y)-j;var e=[],j=this.map.getCenter(),
n=0;do{var m=this.grid[n];m||(m=[],this.grid.push(m));var o=0;do{var k=this.getTileBoundsForGridIndex(n,o),q=l.clone();q.x+=o*Math.round(d);q.y+=n*Math.round(f);var r=m[o];r?r.moveTo(k,q,!1):(r=this.addTile(k,q),this.addTileMonitoringHooks(r),m.push(r));q=k.getCenterLonLat();e.push({tile:r,distance:Math.pow(q.lon-j.lon,2)+Math.pow(q.lat-j.lat,2)});o+=1}while(k.right<=a.right+c*this.buffer||o<b);n+=1}while(k.bottom>=a.bottom-h*this.buffer||n<g);this.removeExcessTiles(n,o);this.gridResolution=d=this.getServerResolution();
e.sort(function(a,b){return a.distance-b.distance});a=0;for(d=e.length;a<d;++a)e[a].tile.draw()},getMaxExtent:function(){return this.maxExtent},addTile:function(a,b){var c=new this.tileClass(this,b,a,null,this.tileSize,this.tileOptions);this.events.triggerEvent("addtile",{tile:c});return c},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(!1===this.loading)this.loading=!0,this.events.triggerEvent("loadstart");this.events.triggerEvent("tileloadstart",{tile:a});this.numLoadingTiles++;
!this.singleTile&&this.backBuffer&&this.gridResolution===this.backBufferResolution&&OpenLayers.Element.addClass(a.getTile(),"olTileReplacing")};a.onLoadEnd=function(b){this.numLoadingTiles--;b="unload"===b.type;this.events.triggerEvent("tileloaded",{tile:a,aborted:b});if(!this.singleTile&&!b&&this.backBuffer&&this.gridResolution===this.backBufferResolution){var c=a.getTile();if("none"===OpenLayers.Element.getStyle(c,"display")){var d=document.getElementById(a.id+"_bb");d&&d.parentNode.removeChild(d)}OpenLayers.Element.removeClass(c,
"olTileReplacing")}if(0===this.numLoadingTiles){if(this.backBuffer)if(0===this.backBuffer.childNodes.length)this.removeBackBuffer();else{this._transitionElement=b?this.div.lastChild:a.imgDiv;b=this.transitionendEvents;for(c=b.length-1;0<=c;--c)OpenLayers.Event.observe(this._transitionElement,b[c],this._removeBackBuffer);this.backBufferTimerId=window.setTimeout(this._removeBackBuffer,this.removeBackBufferDelay)}this.loading=!1;this.events.triggerEvent("loadend")}};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(){for(var a=this.buffer+1;;){var b=this.grid[0][0],c=b.position.x+this.map.layerContainerOriginPx.x,b=b.position.y+this.map.layerContainerOriginPx.y,d=this.getServerResolution()/this.map.getResolution(),
d={w:Math.round(this.tileSize.w*d),h:Math.round(this.tileSize.h*d)};if(c>-d.w*(a-1))this.shiftColumn(!0,d);else if(c<-d.w*a)this.shiftColumn(!1,d);else if(b>-d.h*(a-1))this.shiftRow(!0,d);else if(b<-d.h*a)this.shiftRow(!1,d);else break}},shiftRow:function(a,b){var c=this.grid,d=a?0:c.length-1,e=a?-1:1,f=this.gridLayout;f.startrow+=e*this.rowSign;for(var f=c[d],g=c[a?"pop":"shift"](),h=0,j=g.length;h<j;h++){var k=g[h],l=f[h].position.clone();l.y+=b.h*e;k.moveTo(this.getTileBoundsForGridIndex(d,h),
l)}c[a?"unshift":"push"](g)},shiftColumn:function(a,b){var c=this.grid,d=a?0:c[0].length-1,e=a?-1:1,f=this.gridLayout;f.startcol+=e;for(var f=0,g=c.length;f<g;f++){var h=c[f],j=h[d].position.clone(),k=h[a?"pop":"shift"]();j.x+=b.w*e;k.moveTo(this.getTileBoundsForGridIndex(f,d),j);h[a?"unshift":"push"](k)}},removeExcessTiles:function(a,b){for(var c,d;this.grid.length>a;){var e=this.grid.pop();for(c=0,d=e.length;c<d;c++){var f=e[c];this.destroyTile(f)}}for(c=0,d=this.grid.length;c<d;c++)for(;this.grid[c].length>
b;)e=this.grid[c],f=e.pop(),this.destroyTile(f)},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(a){var b=this.maxExtent,c=this.getResolution(),d=c*this.tileSize.w,c=c*this.tileSize.h,e=this.getLonLatFromViewPortPx(a),a=b.left+d*Math.floor((e.lon-b.left)/d),b=b.bottom+c*Math.floor((e.lat-b.bottom)/c);return new OpenLayers.Bounds(a,b,a+d,b+c)},CLASS_NAME:"OpenLayers.Layer.Grid"});
OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"},isBaseLayer:!0,encodeBBOX:!1,noMagic:!1,yx:{},initialize:function(a,b,c,d){var e=[],c=OpenLayers.Util.upperCaseObject(c);if(1.3<=parseFloat(c.VERSION)&&!c.EXCEPTIONS)c.EXCEPTIONS="INIMAGE";e.push(a,b,c,d);OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
if(!this.noMagic&&this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase()){if(null==d||!d.isBaseLayer)this.isBaseLayer=!1;if("image/jpeg"==this.params.FORMAT)this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}},clone:function(a){null==a&&(a=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},reverseAxisOrder:function(){var a=this.projection.getCode();return 1.3<=parseFloat(this.params.VERSION)&&
!!(this.yx[a]||OpenLayers.Projection.defaults[a]&&OpenLayers.Projection.defaults[a].yx)},getURL:function(a){var a=this.adjustBounds(a),b=this.getImageSize(),c={},d=this.reverseAxisOrder();c.BBOX=this.encodeBBOX?a.toBBOX(null,d):a.toArray(d);c.WIDTH=b.w;c.HEIGHT=b.h;return this.getFullRequestString(c)},mergeNewParams:function(a){a=[OpenLayers.Util.upperCaseObject(a)];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},getFullRequestString:function(a,b){var c=this.map.getProjectionObject(),
c=this.projection&&this.projection.equals(c)?this.projection.getCode():c.getCode(),c="none"==c?null:c;1.3<=parseFloat(this.params.VERSION)?this.params.CRS=c:this.params.SRS=c;if("boolean"==typeof this.params.TRANSPARENT)a.TRANSPARENT=this.params.TRANSPARENT?"TRUE":"FALSE";return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});
OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,attribution:"&copy; ",sphericalMercator:!1,zoomOffset:0,serverResolutions:null,initialize:function(a,b,c){if(c&&c.sphericalMercator||this.sphericalMercator)c=OpenLayers.Util.extend({projection:"EPSG:900913",numZoomLevels:19},c);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a||this.name,b||this.url,{},c])},clone:function(a){null==a&&(a=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,
[a])},getURL:function(a){var a=this.getXYZ(a),b=this.url;OpenLayers.Util.isArray(b)&&(b=this.selectUrl(""+a.x+a.y+a.z,b));return OpenLayers.String.format(b,a)},getXYZ:function(a){var b=this.getServerResolution(),c=Math.round((a.left-this.maxExtent.left)/(b*this.tileSize.w)),a=Math.round((this.maxExtent.top-a.top)/(b*this.tileSize.h)),b=this.getServerZoom();if(this.wrapDateLine)var d=Math.pow(2,b),c=(c%d+d)%d;return{x:c,y:a,z:b}},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,protocolRegex:/^http:/i,type:"Road",culture:"en-US",metadataParams:null,tileOptions:null,protocol:~window.location.href.indexOf("http")?"":"http:",initialize:function(a){a=OpenLayers.Util.applyDefaults({sphericalMercator:!0},a);OpenLayers.Layer.XYZ.prototype.initialize.apply(this,[a.name||"Bing "+(a.type||this.type),null,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 a=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams),a=this.protocol+"//dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(a),b=document.createElement("script");b.type="text/javascript";b.src=a;b.id=this._callbackId;document.getElementsByTagName("head")[0].appendChild(b)},
initLayer:function(){var a=this.metadata.resourceSets[0].resources[0],b=a.imageUrl.replace("{quadkey}","${quadkey}"),b=b.replace("{culture}",this.culture),b=b.replace(this.protocolRegex,this.protocol);this.url=[];for(var c=0;c<a.imageUrlSubdomains.length;++c)this.url.push(b.replace("{subdomain}",a.imageUrlSubdomains[c]));this.addOptions({maxResolution:Math.min(this.serverResolutions[a.zoomMin],this.maxResolution||Number.POSITIVE_INFINITY),numZoomLevels:Math.min(a.zoomMax+1-a.zoomMin,this.numZoomLevels)},
!0);this.isBaseLayer||this.redraw();this.updateAttribution()},getURL:function(a){if(this.url){for(var b=this.getXYZ(a),a=b.x,c=b.y,b=b.z,d=[],e=b;0<e;--e){var f="0",g=1<<e-1;0!=(a&g)&&f++;0!=(c&g)&&(f++,f++);d.push(f)}d=d.join("");a=this.selectUrl(""+a+c+b,this.url);return OpenLayers.String.format(a,{quadkey:d})}},updateAttribution:function(){var a=this.metadata;if(a.resourceSets&&this.map&&this.map.center){var b=a.resourceSets[0].resources[0],c=this.map.getExtent().transform(this.map.getProjectionObject(),
new OpenLayers.Projection("EPSG:4326")),d=b.imageryProviders||[],e=OpenLayers.Util.indexOf(this.serverResolutions,this.getServerResolution()),b="",f,g,h,j,k,l,n;for(g=0,h=d.length;g<h;++g){f=d[g];for(j=0,k=f.coverageAreas.length;j<k;++j)n=f.coverageAreas[j],l=OpenLayers.Bounds.fromArray(n.bbox,!0),c.intersectsBounds(l)&&e<=n.zoomMax&&e>=n.zoomMin&&(b+=f.attribution+" ")}a=a.brandLogoUri.replace(this.protocolRegex,this.protocol);this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(),
logo:a,copyrights:b});this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"attribution"})}},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.updateAttribution)},clone:function(a){null==a&&(a=new OpenLayers.Layer.Bing(this.options));return a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[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(a){this.metadata=a;this.initLayer();a=document.getElementById(this._callbackId);a.parentNode.removeChild(a);window[this._callbackId]=void 0;delete this._callbackId};
OpenLayers.Layer.SphericalMercator={getExtent:function(){var a=null;return a=this.sphericalMercator?this.map.calculateBounds():OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)},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=[];for(var a=0;a<=this.MAX_ZOOM_LEVEL;++a)this.RESOLUTIONS[a]=
156543.03390625/Math.pow(2,a);this.units="m";this.projection=this.projection||"EPSG:900913"},forwardMercator:function(){var a=new OpenLayers.Projection("EPSG:4326"),b=new OpenLayers.Projection("EPSG:900913");return function(c,d){var e=OpenLayers.Projection.transform({x:c,y:d},a,b);return new OpenLayers.LonLat(e.x,e.y)}}(),inverseMercator:function(){var a=new OpenLayers.Projection("EPSG:4326"),b=new OpenLayers.Projection("EPSG:900913");return function(c,d){var e=OpenLayers.Projection.transform({x:c,
y:d},b,a);return new OpenLayers.LonLat(e.x,e.y)}}()};
OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:!0,isBaseLayer:!0,isFixed:!0,pane:null,mapObject:null,initialize:function(a,b){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(null==this.pane)this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")},destroy:function(){this.pane=this.mapObject=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(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("msie"==OpenLayers.BROWSER_NAME)this.pane.style.background="url("+OpenLayers.Util.getImageLocation("blank.gif")+")";this.isFixed?this.map.viewPortDiv.appendChild(this.pane):this.map.layerContainerDiv.appendChild(this.pane);this.loadMapObject();null==this.mapObject&&this.loadWarningMessage()},removeMap:function(a){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 a=this.map.getSize(),b=Math.min(a.w,300),c=Math.min(a.h,200),b=new OpenLayers.Size(b,c),a=(new OpenLayers.Pixel(a.w/2,a.h/2)).add(-b.w/2,-b.h/2),a=OpenLayers.Util.createDiv(this.name+"_warning",a,b,null,null,null,"auto");a.style.padding="7px";a.style.backgroundColor="yellow";a.innerHTML=this.getWarningHTML();this.div.appendChild(a)},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(a,b){OpenLayers.Layer.prototype.moveByPx.apply(this,arguments);this.dragPanMapObject?this.dragPanMapObject(a,-b):this.moveTo(this.map.getCachedCenter())},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this,
arguments);if(null!=this.mapObject){var d=this.map.getCenter(),e=this.map.getZoom();if(null!=d){var f=this.getOLLonLatFromMapObjectLonLat(this.getMapObjectCenter()),g=this.getOLZoomFromMapObjectZoom(this.getMapObjectZoom());if(!d.equals(f)||e!=g)!b&&f&&this.dragPanMapObject&&this.smoothDragPan?(e=this.map.getViewPortPxFromLonLat(f),d=this.map.getViewPortPxFromLonLat(d),this.dragPanMapObject(d.x-e.x,e.y-d.y)):(d=this.getMapObjectLonLatFromOLLonLat(d),e=this.getMapObjectZoomFromOLZoom(e),this.setMapObjectCenter(d,
e,c))}}},getLonLatFromViewPortPx:function(a){var b=null;null!=this.mapObject&&null!=this.getMapObjectCenter()&&(b=this.getOLLonLatFromMapObjectLonLat(this.getMapObjectLonLatFromMapObjectPixel(this.getMapObjectPixelFromOLPixel(a))));return b},getViewPortPxFromLonLat:function(a){var b=null;null!=this.mapObject&&null!=this.getMapObjectCenter()&&(b=this.getOLPixelFromMapObjectPixel(this.getMapObjectPixelFromMapObjectLonLat(this.getMapObjectLonLatFromOLLonLat(a))));return b},getOLLonLatFromMapObjectLonLat:function(a){var b=
null;null!=a&&(b=this.getLongitudeFromMapObjectLonLat(a),a=this.getLatitudeFromMapObjectLonLat(a),b=new OpenLayers.LonLat(b,a));return b},getMapObjectLonLatFromOLLonLat:function(a){var b=null;null!=a&&(b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat));return b},getOLPixelFromMapObjectPixel:function(a){var b=null;null!=a&&(b=this.getXFromMapObjectPixel(a),a=this.getYFromMapObjectPixel(a),b=new OpenLayers.Pixel(b,a));return b},getMapObjectPixelFromOLPixel:function(a){var b=null;null!=a&&(b=this.getMapObjectPixelFromXY(a.x,
a.y));return b},CLASS_NAME:"OpenLayers.Layer.EventPane"});
OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){for(var a=["minZoomLevel","maxZoomLevel","numZoomLevels"],b=0,c=a.length;b<c;b++){var d=a[b];this[d]=null!=this.options[d]?this.options[d]:this.map[d]}if(null==this.minZoomLevel||this.minZoomLevel<this.MIN_ZOOM_LEVEL)this.minZoomLevel=this.MIN_ZOOM_LEVEL;a=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;b=null==this.options.numZoomLevels&&null!=this.options.maxZoomLevel||null==this.numZoomLevels&&null!=this.maxZoomLevel?
this.maxZoomLevel-this.minZoomLevel+1:this.numZoomLevels;this.numZoomLevels=null!=b?Math.min(b,a):a;this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(null!=this.RESOLUTIONS){a=0;this.resolutions=[];for(b=this.minZoomLevel;b<=this.maxZoomLevel;b++)this.resolutions[a++]=this.RESOLUTIONS[b];this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getResolution.apply(this,
arguments);var a=null,b=this.map.getSize(),c=this.getExtent();null!=b&&null!=c&&(a=Math.max(c.getWidth()/b.w,c.getHeight()/b.h));return a},getExtent:function(){var a=this.map.getSize(),b=this.getLonLatFromViewPortPx({x:0,y:0}),a=this.getLonLatFromViewPortPx({x:a.w,y:a.h});return null!=b&&null!=a?new OpenLayers.Bounds(b.lon,a.lat,a.lon,b.lat):null},getZoomForResolution:function(a){return null!=this.resolutions?OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments):this.getZoomForExtent(OpenLayers.Layer.prototype.getExtent.apply(this,
[]))},getOLZoomFromMapObjectZoom:function(a){var b=null;null!=a&&(b=a-this.minZoomLevel,this.map.baseLayer!==this&&(b=this.map.baseLayer.getZoomForResolution(this.getResolutionForZoom(b))));return b},getMapObjectZoomFromOLZoom:function(a){var b=null;null!=a&&(b=a+this.minZoomLevel,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,6.866455078125E-4,3.4332275390625E-4,1.71661376953125E-4,8.58306884765625E-5,4.291534423828125E-5,2.145767211914062E-5,1.072883605957031E-5,5.36441802978515E-6,2.68220901489257E-6,1.341104507446289E-6,6.705522537231445E-7],
type:null,wrapDateLine:!0,sphericalMercator:!1,version:null,initialize:function(a,b){b=b||{};if(!b.version)b.version="function"===typeof GMap2?"2":"3";var c=OpenLayers.Layer.Google["v"+b.version.replace(/\./g,"_")];if(c)OpenLayers.Util.applyDefaults(b,c);else throw"Unsupported Google Maps API version: "+b.version;OpenLayers.Util.applyDefaults(b,c.DEFAULTS);if(b.maxExtent)b.maxExtent=b.maxExtent.clone();OpenLayers.Layer.EventPane.prototype.initialize.apply(this,[a,b]);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,
[a,b]);this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},clone:function(){return new OpenLayers.Layer.Google(this.name,this.getOptions())},setVisibility:function(a){var b=null==this.opacity?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments);this.setOpacity(b)},display:function(a){this._dragging||this.setGMapVisibility(a);OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments)},moveTo:function(a,
b,c){this._dragging=c;OpenLayers.Layer.EventPane.prototype.moveTo.apply(this,arguments);delete this._dragging},setOpacity:function(a){if(a!==this.opacity)null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"}),this.opacity=a;if(this.getVisibility()){var b=this.getMapContainer();OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,a)}},destroy:function(){if(this.map){this.setGMapVisibility(!1);var a=OpenLayers.Layer.Google.cache[this.map.id];a&&1>=a.count&&
this.removeGMapElements()}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var a=OpenLayers.Layer.Google.cache[this.map.id];if(a){var b=this.mapObject&&this.getMapContainer();b&&b.parentNode&&b.parentNode.removeChild(b);(b=a.termsOfUse)&&b.parentNode&&b.parentNode.removeChild(b);(a=a.poweredBy)&&a.parentNode&&a.parentNode.removeChild(a);this.mapObject&&window.google&&google.maps&&google.maps.event&&google.maps.event.clearListeners&&google.maps.event.clearListeners(this.mapObject,
"tilesloaded")}},removeMap:function(a){this.visibility&&this.mapObject&&this.setGMapVisibility(!1);var b=OpenLayers.Layer.Google.cache[a.id];b&&(1>=b.count?(this.removeGMapElements(),delete OpenLayers.Layer.Google.cache[a.id]):--b.count);delete this.termsOfUse;delete this.poweredBy;delete this.mapObject;delete this.dragObject;OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(a){var b=null;null!=a&&(b=a.getSouthWest(),a=a.getNorthEast(),this.sphericalMercator?
(b=this.forwardMercator(b.lng(),b.lat()),a=this.forwardMercator(a.lng(),a.lat())):(b=new OpenLayers.LonLat(b.lng(),b.lat()),a=new OpenLayers.LonLat(a.lng(),a.lat())),b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat));return b},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(a){return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lat:a.lat()},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 a,b,c,d=OpenLayers.Layer.Google.cache[this.map.id];if(d)a=d.mapObject,b=d.termsOfUse,c=d.poweredBy,++d.count;else{var d=this.map.viewPortDiv,e=document.createElement("div");e.id=this.map.id+"_GMap2Container";e.style.position="absolute";e.style.width="100%";e.style.height="100%";d.appendChild(e);try{a=new GMap2(e),b=e.lastChild,d.appendChild(b),b.style.zIndex=
"1100",b.style.right="",b.style.bottom="",b.className="olLayerGoogleCopyright",c=e.lastChild,d.appendChild(c),c.style.zIndex="1100",c.style.right="",c.style.bottom="",c.className="olLayerGooglePoweredBy gmnoprint"}catch(f){throw f;}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:a,termsOfUse:b,poweredBy:c,count:1}}this.mapObject=a;this.termsOfUse=b;this.poweredBy=c;-1===OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)&&this.mapObject.addMapType(this.type);"function"==typeof a.getDragObject?
this.dragObject=a.getDragObject():this.dragPanMapObject=null;!1===this.isBaseLayer&&this.setGMapVisibility("none"!==this.div.style.display)},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded())this.mapObject.checkResize();else{if(!this._resized)var a=this,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=!0}},setGMapVisibility:function(a){var b=OpenLayers.Layer.Google.cache[this.map.id];
if(b){var c=this.mapObject.getContainer();if(!0===a)this.mapObject.setMapType(this.type),c.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,!b.displayed)c.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(a){var b=
null;null!=a&&(b=this.sphericalMercator?this.inverseMercator(a.bottom,a.left):new OpenLayers.LonLat(a.bottom,a.left),a=this.sphericalMercator?this.inverseMercator(a.top,a.right):new OpenLayers.LonLat(a.top,a.right),b=new GLatLngBounds(new GLatLng(b.lat,b.lon),new GLatLng(a.lat,a.lon)));return b},setMapObjectCenter:function(a,b){this.mapObject.setCenter(a,b)},dragPanMapObject:function(a,b){this.dragObject.moveBy(new GSize(-a,b))},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(a,b){var c;this.sphericalMercator?(c=this.inverseMercator(a,b),c=new GLatLng(c.lat,c.lon)):c=new GLatLng(b,a);return c},getMapObjectPixelFromXY:function(a,b){return new GPoint(a,b)}};
OpenLayers.Layer.Google.v3={DEFAULTS:{sphericalMercator:!0,projection:"EPSG:900913"},animationEnabled:!0,loadMapObject:function(){if(!this.type)this.type=google.maps.MapTypeId.ROADMAP;var a,b=OpenLayers.Layer.Google.cache[this.map.id];b?(a=b.mapObject,++b.count):(a=this.map.getCenter(),b=document.createElement("div"),b.className="olForeignContainer",b.style.width="100%",b.style.height="100%",a=new google.maps.Map(b,{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:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,streetViewControl:!1}),b=document.createElement("div"),b.style.width="100%",b.style.height="100%",a.controls[google.maps.ControlPosition.TOP_LEFT].push(b),b={googleControl:b,mapObject:a,count:1},OpenLayers.Layer.Google.cache[this.map.id]=b);this.mapObject=a;this.setGMapVisibility(this.visibility)},onMapResize:function(){this.visibility&&google.maps.event.trigger(this.mapObject,"resize")},
setGMapVisibility:function(a){var b=OpenLayers.Layer.Google.cache[this.map.id],c=this.map;if(b){for(var d=this.type,e=c.layers,f,g=e.length-1;0<=g;--g)if(f=e[g],f instanceof OpenLayers.Layer.Google&&!0===f.visibility&&!0===f.inRange){d=f.type;a=!0;break}e=this.mapObject.getDiv();if(!0===a){if(e.parentNode!==c.div)if(b.rendered)c.div.appendChild(e),b.googleControl.appendChild(c.viewPortDiv),google.maps.event.trigger(this.mapObject,"resize");else{var h=this;google.maps.event.addListenerOnce(this.mapObject,
"tilesloaded",function(){b.rendered=!0;h.setGMapVisibility(h.getVisibility());h.moveTo(h.map.getCenter())})}this.mapObject.setMapTypeId(d)}else b.googleControl.hasChildNodes()&&(c.div.appendChild(c.viewPortDiv),c.div.removeChild(e))}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(a){var b=null;null!=a&&(b=this.sphericalMercator?this.inverseMercator(a.bottom,a.left):new OpenLayers.LonLat(a.bottom,a.left),a=this.sphericalMercator?this.inverseMercator(a.top,
a.right):new OpenLayers.LonLat(a.top,a.right),b=new google.maps.LatLngBounds(new google.maps.LatLng(b.lat,b.lon),new google.maps.LatLng(a.lat,a.lon)));return b},getMapObjectLonLatFromMapObjectPixel:function(a){var b=this.map.getSize(),c=this.getLongitudeFromMapObjectLonLat(this.mapObject.center),d=this.getLatitudeFromMapObjectLonLat(this.mapObject.center),e=this.map.getResolution(),a=new OpenLayers.LonLat(c+(a.x-b.w/2)*e,d-(a.y-b.h/2)*e);this.wrapDateLine&&(a=a.wrapDateLine(this.maxExtent));return this.getMapObjectLonLatFromLonLat(a.lon,
a.lat)},getMapObjectPixelFromMapObjectLonLat:function(a){var b=this.getLongitudeFromMapObjectLonLat(a),a=this.getLatitudeFromMapObjectLonLat(a),c=this.map.getResolution(),d=this.map.getExtent();return this.getMapObjectPixelFromXY(1/c*(b-d.left),1/c*(d.top-a))},setMapObjectCenter:function(a,b){if(!1===this.animationEnabled&&b!=this.mapObject.zoom){var c=this.getMapContainer();google.maps.event.addListenerOnce(this.mapObject,"idle",function(){c.style.visibility=""});c.style.visibility="hidden"}this.mapObject.setOptions({center:a,
zoom:b})},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getMapObjectLonLatFromLonLat:function(a,b){var c;this.sphericalMercator?(c=this.inverseMercator(a,b),c=new google.maps.LatLng(c.lat,c.lon)):c=new google.maps.LatLng(b,a);return c},getMapObjectPixelFromXY:function(a,b){return new google.maps.Point(a,b)}};
OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",url:["http://a.tile.openstreetmap.org/${z}/${x}/${y}.png","http://b.tile.openstreetmap.org/${z}/${x}/${y}.png","http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"],attribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",sphericalMercator:!0,wrapDateLine:!0,tileOptions:null,initialize:function(a,b,c){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments);this.tileOptions=
OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options&&this.options.tileOptions)},clone:function(a){null==a&&(a=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a])},CLASS_NAME:"OpenLayers.Layer.OSM"});
OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",layername:null,type:null,isBaseLayer:!0,tileOrigin:null,serverResolutions:null,zoomOffset:0,initialize:function(a,b,c){var d=[];d.push(a,b,{},c);OpenLayers.Layer.Grid.prototype.initialize.apply(this,d)},clone:function(a){null==a&&(a=new OpenLayers.Layer.TMS(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){var a=this.adjustBounds(a),b=this.getServerResolution(),
c=Math.round((a.left-this.tileOrigin.lon)/(b*this.tileSize.w)),a=Math.round((a.bottom-this.tileOrigin.lat)/(b*this.tileSize.h)),c=this.serviceVersion+"/"+this.layername+"/"+this.getServerZoom()+"/"+c+"/"+a+"."+this.type,a=this.url;OpenLayers.Util.isArray(a)&&(a=this.selectUrl(c,a));return a+c},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin)this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)},CLASS_NAME:"OpenLayers.Layer.TMS"});
OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:!0,initialize:function(a,b,c,d){var e=[],c=OpenLayers.Util.upperCaseObject(c);e.push(a,b,c,d);OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase()){if(null==d||!d.isBaseLayer)this.isBaseLayer=!1;if("jpg"==
this.params.FORMAT)this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"}},clone:function(a){null==a&&(a=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){var a=this.adjustBounds(a),b=this.projection.getCode().split(":"),b=b[b.length-1],c=this.getImageSize(),a={BBOX:a.toBBOX(),SIZE:c.w+","+c.h,F:"image",BBOXSR:b,IMAGESR:b};if(this.layerDefs){var b=[],d;for(d in this.layerDefs)this.layerDefs.hasOwnProperty(d)&&
this.layerDefs[d]&&(b.push(d),b.push(":"),b.push(this.layerDefs[d]),b.push(";"));0<b.length&&(a.LAYERDEFS=b.join(""))}return this.getFullRequestString(a)},setLayerFilter:function(a,b){if(!this.layerDefs)this.layerDefs={};b?this.layerDefs[a]=b:delete this.layerDefs[a]},clearLayerFilter:function(a){a?delete this.layerDefs[a]:delete this.layerDefs},mergeNewParams:function(a){a=[OpenLayers.Util.upperCaseObject(a)];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});
OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:!0,defaultFilter:null,initialize:function(a){a=a||{};OpenLayers.Util.extend(this,a);this.options=a},mergeWithDefaultFilter:function(a){return a&&this.defaultFilter?new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,a]}):a||this.defaultFilter||void 0},destroy:function(){this.format=this.options=null},read:function(a){a=a||{};a.filter=this.mergeWithDefaultFilter(a.filter)},create:function(){},
update:function(){},"delete":function(){},commit:function(){},abort:function(){},createCallback:function(a,b,c){return OpenLayers.Function.bind(function(){a.apply(this,[b,c])},this)},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:!0,features:null,data:null,reqFeatures:null,priv:null,error:null,initialize:function(a){OpenLayers.Util.extend(this,a)},success:function(){return 0<this.code},CLASS_NAME:"OpenLayers.Protocol.Response"});
OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;
OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,updateWithPOST:!1,deleteWithPOST:!1,wildcarded:!1,srsInBBOX:!1,initialize:function(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(a,d){return b.write(a,d)}}},destroy:function(){this.headers=this.params=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=void 0!==a.readWithPOST?a.readWithPOST:this.readWithPOST,c=new OpenLayers.Protocol.Response({requestType:"read"});
b?(b=a.headers||{},b["Content-Type"]="application/x-www-form-urlencoded",c.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,c,a),data:OpenLayers.Util.getParameterString(a.params),headers:b})):c.priv=OpenLayers.Request.GET({url:a.url,callback:this.createCallback(this.handleRead,c,a),params:a.params,headers:a.headers});return c},handleRead:function(a,b){this.handleResponse(a,b)},create:function(a,b){var b=OpenLayers.Util.applyDefaults(b,this.options),c=new OpenLayers.Protocol.Response({reqFeatures:a,
requestType:"create"});c.priv=OpenLayers.Request.POST({url:b.url,callback:this.createCallback(this.handleCreate,c,b),headers:b.headers,data:this.format.write(a)});return c},handleCreate:function(a,b){this.handleResponse(a,b)},update:function(a,b){var b=b||{},c=b.url||a.url||this.options.url+"/"+a.fid,b=OpenLayers.Util.applyDefaults(b,this.options),d=new OpenLayers.Protocol.Response({reqFeatures:a,requestType:"update"});d.priv=OpenLayers.Request[this.updateWithPOST?"POST":"PUT"]({url:c,callback:this.createCallback(this.handleUpdate,
d,b),headers:b.headers,data:this.format.write(a)});return d},handleUpdate:function(a,b){this.handleResponse(a,b)},"delete":function(a,b){var b=b||{},c=b.url||a.url||this.options.url+"/"+a.fid,b=OpenLayers.Util.applyDefaults(b,this.options),d=new OpenLayers.Protocol.Response({reqFeatures:a,requestType:"delete"}),e=this.deleteWithPOST?"POST":"DELETE",c={url:c,callback:this.createCallback(this.handleDelete,d,b),headers:b.headers};if(this.deleteWithPOST)c.data=this.format.write(a);d.priv=OpenLayers.Request[e](c);
return d},handleDelete:function(a,b){this.handleResponse(a,b)},handleResponse:function(a,b){var c=a.priv;if(b.callback){if(200<=c.status&&300>c.status){if("delete"!=a.requestType)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;return!b||0>=b.length?null:this.format.read(b)},commit:function(a,b){function c(a){for(var b=
a.features?a.features.length:0,c=Array(b),e=0;e<b;++e)c[e]=a.features[e].fid;q.insertIds=c;d.apply(this,[a])}function d(a){this.callUserCallback(a,b);o=o&&a.success();f++;if(f>=m&&b.callback)q.code=o?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE,b.callback.apply(b.scope,[q])}var b=OpenLayers.Util.applyDefaults(b,this.options),e=[],f=0,g={};g[OpenLayers.State.INSERT]=[];g[OpenLayers.State.UPDATE]=[];g[OpenLayers.State.DELETE]=[];for(var h,j,k=[],l=0,n=a.length;l<n;++l)if(h=
a[l],j=g[h.state])j.push(h),k.push(h);var m=(0<g[OpenLayers.State.INSERT].length?1:0)+g[OpenLayers.State.UPDATE].length+g[OpenLayers.State.DELETE].length,o=!0,q=new OpenLayers.Protocol.Response({reqFeatures:k});h=g[OpenLayers.State.INSERT];0<h.length&&e.push(this.create(h,OpenLayers.Util.applyDefaults({callback:c,scope:this},b.create)));h=g[OpenLayers.State.UPDATE];for(l=h.length-1;0<=l;--l)e.push(this.update(h[l],OpenLayers.Util.applyDefaults({callback:d,scope:this},b.update)));h=g[OpenLayers.State.DELETE];
for(l=h.length-1;0<=l;--l)e.push(this["delete"](h[l],OpenLayers.Util.applyDefaults({callback:d,scope:this},b["delete"])));return e},abort:function(a){a&&a.priv.abort()},callUserCallback:function(a,b){var c=b[a.requestType];c&&c.callback&&c.callback.call(c.scope,a)},CLASS_NAME:"OpenLayers.Protocol.HTTP"});
OpenLayers.Protocol.WFS=function(a){var a=OpenLayers.Util.applyDefaults(a,OpenLayers.Protocol.WFS.DEFAULTS),b=OpenLayers.Protocol.WFS["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported WFS version: "+a.version;return new b(a)};
OpenLayers.Protocol.WFS.fromWMSLayer=function(a,b){var c,d;c=a.params.LAYERS;c=(OpenLayers.Util.isArray(c)?c[0]:c).split(":");1<c.length&&(d=c[0]);c=c.pop();d={url:a.url,featureType:c,featurePrefix:d,srsName:a.projection&&a.projection.getCode()||a.map&&a.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(b,d))};OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.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));!a.geometryName&&1<parseFloat(this.format.version)&&this.setGeometryName(null)},destroy:function(){this.options&&!this.options.format&&this.format.destroy();this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(a){OpenLayers.Protocol.prototype.read.apply(this,arguments);a=OpenLayers.Util.extend({},a);OpenLayers.Util.applyDefaults(a,this.options||{});var b=new OpenLayers.Protocol.Response({requestType:"read"}),
c=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",a)]);b.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,b,a),params:a.params,headers:a.headers,data:c});return b},setFeatureType:function(a){this.featureType=a;this.format.featureType=a},setGeometryName:function(a){this.geometryName=a;this.format.geometryName=a},handleRead:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);if(b.callback){var c=
a.priv;200<=c.status&&300>c.status?(c=this.parseResponse(c,b.readOptions))&&!1!==c.success?(b.readOptions&&"object"==b.readOptions.output?OpenLayers.Util.extend(a,c):a.features=c,a.code=OpenLayers.Protocol.Response.SUCCESS):(a.code=OpenLayers.Protocol.Response.FAILURE,a.error=c):a.code=OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},parseResponse:function(a,b){var c=a.responseXML;if(!c||!c.documentElement)c=a.responseText;if(!c||0>=c.length)return null;c=null!==this.readFormat?this.readFormat.read(c):
this.format.read(c,b);if(!this.featureNS){var d=this.readFormat||this.format;this.featureNS=d.featureNS;d.autoConfig=!1;this.geometryName||this.setGeometryName(d.geometryName)}return c},commit:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);var c=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:a});c.priv=OpenLayers.Request.POST({url:b.url,headers:b.headers,data:this.format.write(a,b),callback:this.createCallback(this.handleCommit,c,b)});
return c},handleCommit:function(a,b){if(b.callback){var c=a.priv,d=c.responseXML;if(!d||!d.documentElement)d=c.responseText;c=this.format.read(d)||{};a.insertIds=c.insertIds||[];c.success?a.code=OpenLayers.Protocol.Response.SUCCESS:(a.code=OpenLayers.Protocol.Response.FAILURE,a.error=c);b.callback.call(b.scope,a)}},filterDelete:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);new OpenLayers.Protocol.Response({requestType:"commit"});var c=this.format.createElementNSPlus("wfs:Transaction",
{attributes:{service:"WFS",version:this.version}}),d=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(b.featureNS?this.featurePrefix+":":"")+b.featureType}});b.featureNS&&d.setAttribute("xmlns:"+this.featurePrefix,b.featureNS);var e=this.format.writeNode("ogc:Filter",a);d.appendChild(e);c.appendChild(d);c=OpenLayers.Format.XML.prototype.write.apply(this.format,[c]);return OpenLayers.Request.POST({url:this.url,callback:b.callback||function(){},data:c})},abort:function(a){a&&a.priv.abort()},
CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});
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("gml2"==this.outputFormat.toLowerCase())this.readFormat=new OpenLayers.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName});else if("json"==this.outputFormat.toLowerCase())this.readFormat=new OpenLayers.Format.GeoJSON},CLASS_NAME:"OpenLayers.Protocol.WFS.v1_1_0"});
OpenLayers.Protocol.CSW=function(a){var a=OpenLayers.Util.applyDefaults(a,OpenLayers.Protocol.CSW.DEFAULTS),b=OpenLayers.Protocol.CSW["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported CSW version: "+a.version;return new b(a)};OpenLayers.Protocol.CSW.DEFAULTS={version:"2.0.2"};
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(){this.options&&!this.options.format&&this.format.destroy();this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(a){a=OpenLayers.Util.extend({},a);OpenLayers.Util.applyDefaults(a,
this.options||{});var b=new OpenLayers.Protocol.Response({requestType:"read"}),c=this.format.write(a.params||a);b.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,b,a),params:a.params,headers:a.headers,data:c});return b},handleRead:function(a,b){if(b.callback){var c=a.priv;200<=c.status&&300>c.status?(a.data=this.parseData(c),a.code=OpenLayers.Protocol.Response.SUCCESS):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;return!b||0>=b.length?null:this.format.read(b)},CLASS_NAME:"OpenLayers.Protocol.CSW.v2_0_2"});
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(a){this.exists(a)&&this.remove(a);var b=a.id;this.determineZIndex(a);for(var c=-1,d=this.order.length,e;1<d-c;)e=parseInt((c+d)/2),0<this.compare(this,a,OpenLayers.Util.getElement(this.order[e]))?c=e:d=e;this.order.splice(d,
0,b);this.indices[b]=this.getZIndex(a);return this.getNextElement(d)},remove:function(a){var a=a.id,b=OpenLayers.Util.indexOf(this.order,a);if(0<=b)this.order.splice(b,1),delete this.indices[a],this.maxZIndex=0<this.order.length?this.indices[this.order[this.order.length-1]]:0},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return null!=this.indices[a.id]},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;
if(null==b)b=this.maxZIndex,a._style.graphicZIndex=b;else if(b>this.maxZIndex)this.maxZIndex=b},getNextElement:function(a){a+=1;if(a<this.order.length){var b=OpenLayers.Util.getElement(this.order[a]);void 0==b&&(b=this.getNextElement(a));return b}return null},CLASS_NAME:"OpenLayers.ElementsIndexer"});
OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(a,b,c){var b=a.getZIndex(b),d=0;c&&(a=a.getZIndex(c),d=b-a);return d},Z_ORDER_DRAWING_ORDER:function(a,b,c){a=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);c&&0==a&&(a=1);return a},Z_ORDER_Y_ORDER:function(a,b,c){a=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);c&&0===a&&(b=c._boundsBottom-b._boundsBottom,a=0===b?1:b);return a}};
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.xmlns=this.root=this.rendererRoot=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var a,b=this.vectorRoot;if(b)for(;a=b.firstChild;)b.removeChild(a);if(b=this.textRoot)for(;a=b.firstChild;)b.removeChild(a);this.indexer&&
this.indexer.clear()},setExtent:function(a,b){var c=OpenLayers.Renderer.prototype.setExtent.apply(this,arguments),d=this.getResolution();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var e,f=a.getWidth()/this.map.getExtent().getWidth(),a=a.scale(1/f),f=this.map.getMaxExtent();f.right>a.left&&f.right<a.right?e=!0:f.left>a.left&&f.left<a.right&&(e=!1);if(e!==this.rightOfDateLine||b)c=!1,this.xOffset=!0===e?f.getWidth()/d:0;this.rightOfDateLine=e}return c},getNodeType:function(){},drawGeometry:function(a,
b,c){var d=a.CLASS_NAME,e=!0;if("OpenLayers.Geometry.Collection"==d||"OpenLayers.Geometry.MultiPoint"==d||"OpenLayers.Geometry.MultiLineString"==d||"OpenLayers.Geometry.MultiPolygon"==d){for(var d=0,f=a.components.length;d<f;d++)e=this.drawGeometry(a.components[d],b,c)&&e;return e}d=e=!1;"none"!=b.display&&(b.backgroundGraphic?this.redrawBackgroundNode(a.id,a,b,c):d=!0,e=this.redrawNode(a.id,a,b,c));if(!1==e&&(b=document.getElementById(a.id)))b._style.backgroundGraphic&&(d=!0),b.parentNode.removeChild(b);
d&&(b=document.getElementById(a.id+this.BACKGROUND_ID_SUFFIX))&&b.parentNode.removeChild(b);return e},redrawNode:function(a,b,c,d){c=this.applyDefaultSymbolizer(c);a=this.nodeFactory(a,this.getNodeType(b,c));a._featureId=d;a._boundsBottom=b.getBounds().bottom;a._geometryClass=b.CLASS_NAME;a._style=c;b=this.drawGeometryNode(a,b,c);if(!1===b)return!1;a=b.node;this.indexer?(c=this.indexer.insert(a))?this.vectorRoot.insertBefore(a,c):this.vectorRoot.appendChild(a):a.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(a);
this.postDraw(a);return b.complete},redrawBackgroundNode:function(a,b,c){c=OpenLayers.Util.extend({},c);c.externalGraphic=c.backgroundGraphic;c.graphicXOffset=c.backgroundXOffset;c.graphicYOffset=c.backgroundYOffset;c.graphicZIndex=c.backgroundGraphicZIndex;c.graphicWidth=c.backgroundWidth||c.graphicWidth;c.graphicHeight=c.backgroundHeight||c.graphicHeight;c.backgroundGraphic=null;c.backgroundXOffset=null;c.backgroundYOffset=null;c.backgroundGraphicZIndex=null;return this.redrawNode(a+this.BACKGROUND_ID_SUFFIX,
b,c,null)},drawGeometryNode:function(a,b,c){var c=c||a._style,d={isFilled:void 0===c.fill?!0:c.fill,isStroked:void 0===c.stroke?!!c.strokeWidth:c.stroke},e;switch(b.CLASS_NAME){case "OpenLayers.Geometry.Point":if(!1===c.graphic)d.isFilled=!1,d.isStroked=!1;e=this.drawPoint(a,b);break;case "OpenLayers.Geometry.LineString":d.isFilled=!1;e=this.drawLineString(a,b);break;case "OpenLayers.Geometry.LinearRing":e=this.drawLinearRing(a,b);break;case "OpenLayers.Geometry.Polygon":e=this.drawPolygon(a,b);break;
case "OpenLayers.Geometry.Rectangle":e=this.drawRectangle(a,b)}a._options=d;return!1!=e?{node:this.setStyle(a,c,d,b),complete:e}:!1},postDraw:function(){},drawPoint:function(){},drawLineString:function(){},drawLinearRing:function(){},drawPolygon:function(){},drawRectangle:function(){},drawCircle:function(){},removeText:function(a){var b=document.getElementById(a+this.LABEL_ID_SUFFIX);b&&this.textRoot.removeChild(b);(a=document.getElementById(a+this.LABEL_OUTLINE_SUFFIX))&&this.textRoot.removeChild(a)},
getFeatureIdFromEvent:function(a){var b=a.target,c=b&&b.correspondingUseElement;return(c?c:b||a.srcElement)._featureId},eraseGeometry:function(a,b){if("OpenLayers.Geometry.MultiPoint"==a.CLASS_NAME||"OpenLayers.Geometry.MultiLineString"==a.CLASS_NAME||"OpenLayers.Geometry.MultiPolygon"==a.CLASS_NAME||"OpenLayers.Geometry.Collection"==a.CLASS_NAME)for(var c=0,d=a.components.length;c<d;c++)this.eraseGeometry(a.components[c],b);else if((c=OpenLayers.Util.getElement(a.id))&&c.parentNode){if(c.geometry)c.geometry.destroy(),
c.geometry=null;c.parentNode.removeChild(c);this.indexer&&this.indexer.remove(c);c._style.backgroundGraphic&&(c=OpenLayers.Util.getElement(a.id+this.BACKGROUND_ID_SUFFIX))&&c.parentNode&&c.parentNode.removeChild(c)}},nodeFactory:function(a,b){var c=OpenLayers.Util.getElement(a);c?this.nodeTypeCompare(c,b)||(c.parentNode.removeChild(c),c=this.nodeFactory(a,b)):c=this.createNode(b,a);return c},nodeTypeCompare:function(){},createNode:function(){},moveRoot:function(a){var b=this.root;if(a.root.parentNode==
this.rendererRoot)b=a.root;b.parentNode.removeChild(b);a.rendererRoot.appendChild(b)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(a){return"circle"!=a&&!!a},CLASS_NAME:"OpenLayers.Renderer.Elements"});
OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15E3,translationParameters:null,symbolMetrics:null,initialize:function(a){if(this.supported())OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.translationParameters={x:0,y:0},this.symbolMetrics={}},supported:function(){return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG",
"1.1")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))},inValidRange:function(a,b,c){a+=c?0:this.translationParameters.x;b+=c?0:this.translationParameters.y;return a>=-this.MAX_PIXEL&&a<=this.MAX_PIXEL&&b>=-this.MAX_PIXEL&&b<=this.MAX_PIXEL},setExtent:function(a,b){var c=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),d=this.getResolution(),e=-a.left/d,d=a.top/d;if(b)return this.left=e,this.top=d,this.rendererRoot.setAttributeNS(null,
"viewBox","0 0 "+this.size.w+" "+this.size.h),this.translate(this.xOffset,0),!0;(e=this.translate(e-this.left+this.xOffset,d-this.top))||this.setExtent(a,!0);return c&&e},translate:function(a,b){if(this.inValidRange(a,b,!0)){var c="";if(a||b)c="translate("+a+","+b+")";this.root.setAttributeNS(null,"transform",c);this.translationParameters={x:a,y:b};return!0}return!1},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(a,b){var c=null;switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":c=b.externalGraphic?"image":this.isComplexSymbol(b.graphicName)?"svg":"circle";break;case "OpenLayers.Geometry.Rectangle":c="rect";break;case "OpenLayers.Geometry.LineString":c="polyline";break;case "OpenLayers.Geometry.LinearRing":c="polygon";break;case "OpenLayers.Geometry.Polygon":case "OpenLayers.Geometry.Curve":c="path"}return c},setStyle:function(a,
b,c){var b=b||a._style,c=c||a._options,d=b.title||b.graphicTitle;if(d){a.setAttributeNS(null,"title",d);var e=a.getElementsByTagName("title");0<e.length?e[0].firstChild.textContent=d:(e=this.nodeFactory(null,"title"),e.textContent=d,a.appendChild(e))}var e=parseFloat(a.getAttributeNS(null,"r")),d=1,f;if("OpenLayers.Geometry.Point"==a._geometryClass&&e){a.style.visibility="";if(!1===b.graphic)a.style.visibility="hidden";else if(b.externalGraphic){f=this.getPosition(a);b.graphicWidth&&b.graphicHeight&&
a.setAttributeNS(null,"preserveAspectRatio","none");var e=b.graphicWidth||b.graphicHeight,g=b.graphicHeight||b.graphicWidth,e=e?e:2*b.pointRadius,g=g?g:2*b.pointRadius,h=void 0!=b.graphicYOffset?b.graphicYOffset:-(0.5*g),j=b.graphicOpacity||b.fillOpacity;a.setAttributeNS(null,"x",(f.x+(void 0!=b.graphicXOffset?b.graphicXOffset:-(0.5*e))).toFixed());a.setAttributeNS(null,"y",(f.y+h).toFixed());a.setAttributeNS(null,"width",e);a.setAttributeNS(null,"height",g);a.setAttributeNS(this.xlinkns,"xlink:href",
b.externalGraphic);a.setAttributeNS(null,"style","opacity: "+j);a.onclick=OpenLayers.Event.preventDefault}else if(this.isComplexSymbol(b.graphicName)){var e=3*b.pointRadius,g=2*e,k=this.importSymbol(b.graphicName);f=this.getPosition(a);d=3*this.symbolMetrics[k.id][0]/g;h=a.parentNode;j=a.nextSibling;h&&h.removeChild(a);a.firstChild&&a.removeChild(a.firstChild);a.appendChild(k.firstChild.cloneNode(!0));a.setAttributeNS(null,"viewBox",k.getAttributeNS(null,"viewBox"));a.setAttributeNS(null,"width",
g);a.setAttributeNS(null,"height",g);a.setAttributeNS(null,"x",f.x-e);a.setAttributeNS(null,"y",f.y-e);j?h.insertBefore(a,j):h&&h.appendChild(a)}else a.setAttributeNS(null,"r",b.pointRadius);e=b.rotation;if((void 0!==e||void 0!==a._rotation)&&f)a._rotation=e,e|=0,"svg"!==a.nodeName?a.setAttributeNS(null,"transform","rotate("+e+" "+f.x+" "+f.y+")"):(f=this.symbolMetrics[k.id],a.firstChild.setAttributeNS(null,"transform","rotate("+e+" "+f[1]+" "+f[2]+")"))}c.isFilled?(a.setAttributeNS(null,"fill",b.fillColor),
a.setAttributeNS(null,"fill-opacity",b.fillOpacity)):a.setAttributeNS(null,"fill","none");c.isStroked?(a.setAttributeNS(null,"stroke",b.strokeColor),a.setAttributeNS(null,"stroke-opacity",b.strokeOpacity),a.setAttributeNS(null,"stroke-width",b.strokeWidth*d),a.setAttributeNS(null,"stroke-linecap",b.strokeLinecap||"round"),a.setAttributeNS(null,"stroke-linejoin","round"),b.strokeDashstyle&&a.setAttributeNS(null,"stroke-dasharray",this.dashStyle(b,d))):a.setAttributeNS(null,"stroke","none");b.pointerEvents&&
a.setAttributeNS(null,"pointer-events",b.pointerEvents);null!=b.cursor&&a.setAttributeNS(null,"cursor",b.cursor);return a},dashStyle:function(a,b){var c=a.strokeWidth*b,d=a.strokeDashstyle;switch(d){case "solid":return"none";case "dot":return[1,4*c].join();case "dash":return[4*c,4*c].join();case "dashdot":return[4*c,4*c,1,4*c].join();case "longdash":return[8*c,4*c].join();case "longdashdot":return[8*c,4*c,1,4*c].join();default:return OpenLayers.String.trim(d).replace(/\s+/g,",")}},createNode:function(a,
b){var c=document.createElementNS(this.xmlns,a);b&&c.setAttributeNS(null,"id",b);return c},nodeTypeCompare:function(a,b){return b==a.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(a,b,c){var d=this.getResolution(),e=(b.x-this.featureDx)/d+this.left,b=this.top-b.y/d;return this.inValidRange(e,b)?(a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",b),a.setAttributeNS(null,"r",c),a):!1},drawLineString:function(a,b){var c=this.getComponentsString(b.components);return c.path?(a.setAttributeNS(null,"points",c.path),c.complete?a:null):!1},drawLinearRing:function(a,b){var c=this.getComponentsString(b.components);return c.path?(a.setAttributeNS(null,
"points",c.path),c.complete?a:null):!1},drawPolygon:function(a,b){for(var c="",d=!0,e=!0,f,g,h=0,j=b.components.length;h<j;h++)c+=" M",f=this.getComponentsString(b.components[h].components," "),(g=f.path)?(c+=" "+g,e=f.complete&&e):d=!1;return d?(a.setAttributeNS(null,"d",c+" z"),a.setAttributeNS(null,"fill-rule","evenodd"),e?a:null):!1},drawRectangle:function(a,b){var c=this.getResolution(),d=(b.x-this.featureDx)/c+this.left,e=this.top-b.y/c;return this.inValidRange(d,e)?(a.setAttributeNS(null,"x",
d),a.setAttributeNS(null,"y",e),a.setAttributeNS(null,"width",b.width/c),a.setAttributeNS(null,"height",b.height/c),a):!1},drawText:function(a,b,c){var d=!!b.labelOutlineWidth;if(d){var e=OpenLayers.Util.extend({},b);e.fontColor=e.labelOutlineColor;e.fontStrokeColor=e.labelOutlineColor;e.fontStrokeWidth=b.labelOutlineWidth;if(b.labelOutlineOpacity)e.fontOpacity=b.labelOutlineOpacity;delete e.labelOutlineWidth;this.drawText(a,e,c)}var f=this.getResolution(),e=(c.x-this.featureDx)/f+this.left,g=c.y/
f-this.top,d=d?this.LABEL_OUTLINE_SUFFIX:this.LABEL_ID_SUFFIX,f=this.nodeFactory(a+d,"text");f.setAttributeNS(null,"x",e);f.setAttributeNS(null,"y",-g);b.fontColor&&f.setAttributeNS(null,"fill",b.fontColor);b.fontStrokeColor&&f.setAttributeNS(null,"stroke",b.fontStrokeColor);b.fontStrokeWidth&&f.setAttributeNS(null,"stroke-width",b.fontStrokeWidth);b.fontOpacity&&f.setAttributeNS(null,"opacity",b.fontOpacity);b.fontFamily&&f.setAttributeNS(null,"font-family",b.fontFamily);b.fontSize&&f.setAttributeNS(null,
"font-size",b.fontSize);b.fontWeight&&f.setAttributeNS(null,"font-weight",b.fontWeight);b.fontStyle&&f.setAttributeNS(null,"font-style",b.fontStyle);!0===b.labelSelect?(f.setAttributeNS(null,"pointer-events","visible"),f._featureId=a):f.setAttributeNS(null,"pointer-events","none");g=b.labelAlign||OpenLayers.Renderer.defaultSymbolizer.labelAlign;f.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[g[0]]||"middle");!0===OpenLayers.IS_GECKO&&f.setAttributeNS(null,"dominant-baseline",
OpenLayers.Renderer.SVG.LABEL_ALIGN[g[1]]||"central");for(var h=b.label.split("\n"),j=h.length;f.childNodes.length>j;)f.removeChild(f.lastChild);for(var k=0;k<j;k++){var l=this.nodeFactory(a+d+"_tspan_"+k,"tspan");if(!0===b.labelSelect)l._featureId=a,l._geometry=c,l._geometryClass=c.CLASS_NAME;!1===OpenLayers.IS_GECKO&&l.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[g[1]]||"-35%");l.setAttribute("x",e);if(0==k){var n=OpenLayers.Renderer.SVG.LABEL_VFACTOR[g[1]];null==n&&
(n=-0.5);l.setAttribute("dy",n*(j-1)+"em")}else l.setAttribute("dy","1em");l.textContent=""===h[k]?" ":h[k];l.parentNode||f.appendChild(l)}f.parentNode||this.textRoot.appendChild(f)},getComponentsString:function(a,b){for(var c=[],d=!0,e=a.length,f=[],g,h=0;h<e;h++)g=a[h],c.push(g),(g=this.getShortString(g))?f.push(g):(0<h&&this.getShortString(a[h-1])&&f.push(this.clipLine(a[h],a[h-1])),h<e-1&&this.getShortString(a[h+1])&&f.push(this.clipLine(a[h],a[h+1])),d=!1);return{path:f.join(b||","),complete:d}},
clipLine:function(a,b){if(b.equals(a))return"";var c=this.getResolution(),d=this.MAX_PIXEL-this.translationParameters.x,e=this.MAX_PIXEL-this.translationParameters.y,f=(b.x-this.featureDx)/c+this.left,g=this.top-b.y/c,h=(a.x-this.featureDx)/c+this.left,c=this.top-a.y/c,j;if(h<-d||h>d)j=(c-g)/(h-f),h=0>h?-d:d,c=g+(h-f)*j;if(c<-e||c>e)j=(h-f)/(c-g),c=0>c?-e:e,h=f+(c-g)*j;return h+","+c},getShortString:function(a){var b=this.getResolution(),c=(a.x-this.featureDx)/b+this.left,a=this.top-a.y/b;return this.inValidRange(c,
a)?c+","+a:!1},getPosition:function(a){return{x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))}},importSymbol:function(a){if(!this.defs)this.defs=this.createDefs();var b=this.container.id+"-"+a,c=document.getElementById(b);if(null!=c)return c;var d=OpenLayers.Renderer.symbol[a];if(!d)throw Error(a+" is not a valid symbol name");var a=this.nodeFactory(b,"symbol"),e=this.nodeFactory(null,"polygon");a.appendChild(e);for(var c=new OpenLayers.Bounds(Number.MAX_VALUE,
Number.MAX_VALUE,0,0),f=[],g,h,j=0;j<d.length;j+=2)g=d[j],h=d[j+1],c.left=Math.min(c.left,g),c.bottom=Math.min(c.bottom,h),c.right=Math.max(c.right,g),c.top=Math.max(c.top,h),f.push(g,",",h);e.setAttributeNS(null,"points",f.join(" "));d=c.getWidth();e=c.getHeight();a.setAttributeNS(null,"viewBox",[c.left-d,c.bottom-e,3*d,3*e].join(" "));this.symbolMetrics[b]=[Math.max(d,e),c.getCenterLonLat().lon,c.getCenterLonLat().lat];this.defs.appendChild(a);return a},getFeatureIdFromEvent:function(a){var b=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,
arguments);if(!b)b=a.target,b=b.parentNode&&b!=this.rendererRoot?b.parentNode._featureId:void 0;return b},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){OpenLayers.Event.preventDefault(a)};
OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(a){if(this.supported()){if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);for(var b=document.createStyleSheet(),c="shape,rect,oval,fill,stroke,imagedata,group,textbox".split(","),d=0,e=c.length;d<e;d++)b.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(a,b){var c=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),d=this.getResolution(),e=a.left/d|0,d=a.top/d-this.size.h|0;b||!this.offset?(this.offset={x:e,y:d},d=e=0):(e-=this.offset.x,d-=this.offset.y);this.root.coordorigin=e-this.xOffset+" "+d;for(var e=[this.root,this.vectorRoot,this.textRoot],f=0,g=e.length;f<g;++f)d=e[f],d.coordsize=this.size.w+" "+this.size.h;this.root.style.flip="y";return c},
setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);for(var b=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],c=this.size.w+"px",d=this.size.h+"px",e,f=0,g=b.length;f<g;++f)e=b[f],e.style.width=c,e.style.height=d},getNodeType:function(a,b){var c=null;switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":c=b.externalGraphic?"olv:rect":this.isComplexSymbol(b.graphicName)?"olv:shape":"olv:oval";break;case "OpenLayers.Geometry.Rectangle":c="olv:rect";break;case "OpenLayers.Geometry.LineString":case "OpenLayers.Geometry.LinearRing":case "OpenLayers.Geometry.Polygon":case "OpenLayers.Geometry.Curve":c=
"olv:shape"}return c},setStyle:function(a,b,c,d){var b=b||a._style,c=c||a._options,e=b.fillColor,f=b.title||b.graphicTitle;if(f)a.title=f;if("OpenLayers.Geometry.Point"===a._geometryClass)if(b.externalGraphic){c.isFilled=!0;var e=b.graphicWidth||b.graphicHeight,f=b.graphicHeight||b.graphicWidth,e=e?e:2*b.pointRadius,f=f?f:2*b.pointRadius,g=this.getResolution(),h=void 0!=b.graphicXOffset?b.graphicXOffset:-(0.5*e),j=void 0!=b.graphicYOffset?b.graphicYOffset:-(0.5*f);a.style.left=((d.x-this.featureDx)/
g-this.offset.x+h|0)+"px";a.style.top=(d.y/g-this.offset.y-(j+f)|0)+"px";a.style.width=e+"px";a.style.height=f+"px";a.style.flip="y";e="none";c.isStroked=!1}else this.isComplexSymbol(b.graphicName)?(f=this.importSymbol(b.graphicName),a.path=f.path,a.coordorigin=f.left+","+f.bottom,f=f.size,a.coordsize=f+","+f,this.drawCircle(a,d,b.pointRadius),a.style.flip="y"):this.drawCircle(a,d,b.pointRadius);c.isFilled?a.fillcolor=e:a.filled="false";d=a.getElementsByTagName("fill");d=0==d.length?null:d[0];if(c.isFilled){d||
(d=this.createNode("olv:fill",a.id+"_fill"));d.opacity=b.fillOpacity;if("OpenLayers.Geometry.Point"===a._geometryClass&&b.externalGraphic){if(b.graphicOpacity)d.opacity=b.graphicOpacity;d.src=b.externalGraphic;d.type="frame";if(!b.graphicWidth||!b.graphicHeight)d.aspect="atmost"}d.parentNode!=a&&a.appendChild(d)}else d&&a.removeChild(d);e=b.rotation;if(void 0!==e||void 0!==a._rotation)if(a._rotation=e,b.externalGraphic)this.graphicRotate(a,h,j,b),d.opacity=0;else if("OpenLayers.Geometry.Point"===
a._geometryClass)a.style.rotation=e||0;h=a.getElementsByTagName("stroke");h=0==h.length?null:h[0];if(c.isStroked){if(h||(h=this.createNode("olv:stroke",a.id+"_stroke"),a.appendChild(h)),h.on=!0,h.color=b.strokeColor,h.weight=b.strokeWidth+"px",h.opacity=b.strokeOpacity,h.endcap="butt"==b.strokeLinecap?"flat":b.strokeLinecap||"round",b.strokeDashstyle)h.dashstyle=this.dashStyle(b)}else if(a.stroked=!1,h)h.on=!1;if("inherit"!=b.cursor&&null!=b.cursor)a.style.cursor=b.cursor;return a},graphicRotate:function(a,
b,c,d){var d=d||a._style,e=d.rotation||0,f,g;if(!d.graphicWidth||!d.graphicHeight){var h=new Image;h.onreadystatechange=OpenLayers.Function.bind(function(){if("complete"==h.readyState||"interactive"==h.readyState)f=h.width/h.height,g=Math.max(2*d.pointRadius,d.graphicWidth||0,d.graphicHeight||0),b*=f,d.graphicWidth=g*f,d.graphicHeight=g,this.graphicRotate(a,b,c,d)},this);h.src=d.externalGraphic}else{g=Math.max(d.graphicWidth,d.graphicHeight);f=d.graphicWidth/d.graphicHeight;var j=Math.round(d.graphicWidth||
g*f),k=Math.round(d.graphicHeight||g);a.style.width=j+"px";a.style.height=k+"px";var l=document.getElementById(a.id+"_image");l||(l=this.createNode("olv:imagedata",a.id+"_image"),a.appendChild(l));l.style.width=j+"px";l.style.height=k+"px";l.src=d.externalGraphic;l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";l=e*Math.PI/180;e=Math.sin(l);l=Math.cos(l);e="progid:DXImageTransform.Microsoft.Matrix(M11="+l+",M12="+-e+",M21="+e+",M22="+l+",SizingMethod='auto expand')\n";
(l=d.graphicOpacity||d.fillOpacity)&&1!=l&&(e+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+l+")\n");a.style.filter=e;e=new OpenLayers.Geometry.Point(-b,-c);j=(new OpenLayers.Bounds(0,0,j,k)).toGeometry();j.rotate(d.rotation,e);j=j.getBounds();a.style.left=Math.round(parseInt(a.style.left)+j.left)+"px";a.style.top=Math.round(parseInt(a.style.top)-j.bottom)+"px"}},postDraw:function(a){a.style.visibility="visible";var b=a._style.fillColor,c=a._style.strokeColor;if("none"==b&&a.fillcolor!=
b)a.fillcolor=b;if("none"==c&&a.strokecolor!=c)a.strokecolor=c},setNodeDimension:function(a,b){var c=b.getBounds();if(c){var d=this.getResolution(),c=new OpenLayers.Bounds((c.left-this.featureDx)/d-this.offset.x|0,c.bottom/d-this.offset.y|0,(c.right-this.featureDx)/d-this.offset.x|0,c.top/d-this.offset.y|0);a.style.left=c.left+"px";a.style.top=c.top+"px";a.style.width=c.getWidth()+"px";a.style.height=c.getHeight()+"px";a.coordorigin=c.left+" "+c.top;a.coordsize=c.getWidth()+" "+c.getHeight()}},dashStyle:function(a){a=
a.strokeDashstyle;switch(a){case "solid":case "dot":case "dash":case "dashdot":case "longdash":case "longdashdot":return a;default:return a=a.split(/[ ,]/),2==a.length?1*a[0]>=2*a[1]?"longdash":1==a[0]||1==a[1]?"dot":"dash":4==a.length?1*a[0]>=2*a[1]?"longdashdot":"dashdot":"solid"}},createNode:function(a,b){var c=document.createElement(a);if(b)c.id=b;c.unselectable="on";c.onselectstart=OpenLayers.Function.False;return c},nodeTypeCompare:function(a,b){var c=b,d=c.indexOf(":");-1!=d&&(c=c.substr(d+
1));var e=a.nodeName,d=e.indexOf(":");-1!=d&&(e=e.substr(d+1));return c==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(a,b,c){if(!isNaN(b.x)&&!isNaN(b.y)){var d=this.getResolution();a.style.left=((b.x-this.featureDx)/d-this.offset.x|0)-c+"px";a.style.top=(b.y/d-this.offset.y|0)-c+"px";b=2*c;a.style.width=
b+"px";a.style.height=b+"px";return a}return!1},drawLineString:function(a,b){return this.drawLine(a,b,!1)},drawLinearRing:function(a,b){return this.drawLine(a,b,!0)},drawLine:function(a,b,c){this.setNodeDimension(a,b);for(var d=this.getResolution(),e=b.components.length,f=Array(e),g,h,j=0;j<e;j++)g=b.components[j],h=(g.x-this.featureDx)/d-this.offset.x|0,g=g.y/d-this.offset.y|0,f[j]=" "+h+","+g+" l ";a.path="m"+f.join("")+(c?" x e":" e");return a},drawPolygon:function(a,b){this.setNodeDimension(a,
b);var c=this.getResolution(),d=[],e,f,g,h,j,k,l,n,m,o;for(e=0,f=b.components.length;e<f;e++){d.push("m");g=b.components[e].components;h=0===e;k=j=null;for(l=0,n=g.length;l<n;l++)m=g[l],o=(m.x-this.featureDx)/c-this.offset.x|0,m=m.y/c-this.offset.y|0,o=" "+o+","+m,d.push(o),0==l&&d.push(" l"),h||(j?j!=o&&(k?k!=o&&(h=!0):k=o):j=o);d.push(h?" x ":" ")}d.push("e");a.path=d.join("");return a},drawRectangle:function(a,b){var c=this.getResolution();a.style.left=((b.x-this.featureDx)/c-this.offset.x|0)+
"px";a.style.top=(b.y/c-this.offset.y|0)+"px";a.style.width=(b.width/c|0)+"px";a.style.height=(b.height/c|0)+"px";return a},drawText:function(a,b,c){var d=this.nodeFactory(a+this.LABEL_ID_SUFFIX,"olv:rect"),e=this.nodeFactory(a+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox"),f=this.getResolution();d.style.left=((c.x-this.featureDx)/f-this.offset.x|0)+"px";d.style.top=(c.y/f-this.offset.y|0)+"px";d.style.flip="y";e.innerText=b.label;if("inherit"!=b.cursor&&null!=b.cursor)e.style.cursor=b.cursor;if(b.fontColor)e.style.color=
b.fontColor;if(b.fontOpacity)e.style.filter="alpha(opacity="+100*b.fontOpacity+")";if(b.fontFamily)e.style.fontFamily=b.fontFamily;if(b.fontSize)e.style.fontSize=b.fontSize;if(b.fontWeight)e.style.fontWeight=b.fontWeight;if(b.fontStyle)e.style.fontStyle=b.fontStyle;if(!0===b.labelSelect)d._featureId=a,e._featureId=a,e._geometry=c,e._geometryClass=c.CLASS_NAME;e.style.whiteSpace="nowrap";e.inset="1px,0px,0px,0px";d.parentNode||(d.appendChild(e),this.textRoot.appendChild(d));b=b.labelAlign||"cm";1==
b.length&&(b+="m");a=e.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[b.substr(0,1)];e=e.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[b.substr(1,1)];d.style.left=parseInt(d.style.left)-a-1+"px";d.style.top=parseInt(d.style.top)+e+"px"},moveRoot:function(a){var b=this.map.getLayer(a.container.id);b instanceof OpenLayers.Layer.Vector.RootContainer&&(b=this.map.getLayer(this.container.id));b&&b.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);b&&b.redraw()},
importSymbol:function(a){var b=this.container.id+"-"+a,c=this.symbolCache[b];if(c)return c;c=OpenLayers.Renderer.symbol[a];if(!c)throw Error(a+" is not a valid symbol name");for(var a=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),d=["m"],e=0;e<c.length;e+=2){var f=c[e],g=c[e+1];a.left=Math.min(a.left,f);a.bottom=Math.min(a.bottom,g);a.right=Math.max(a.right,f);a.top=Math.max(a.top,g);d.push(f);d.push(g);0==e&&d.push("l")}d.push("x e");c=d.join(" ");d=(a.getWidth()-a.getHeight())/2;
0<d?(a.bottom-=d,a.top+=d):(a.left+=d,a.right-=d);c={path:c,size:a.getWidth(),left:a.left,bottom:a.bottom};return this.symbolCache[b]=c},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.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{hitDetection:!0,hitOverflow:0,canvas:null,features:null,pendingRedraw:!1,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!1},eraseGeometry:function(a,b){this.eraseFeatures(this.features[b][0])},supported:function(){return OpenLayers.CANVAS_SUPPORTED},setSize:function(a){this.size=a.clone();var b=this.root;b.style.width=a.w+"px";b.style.height=a.h+"px";b.width=a.w;b.height=a.h;this.resolution=null;if(this.hitDetection)b=this.hitCanvas,b.style.width=a.w+"px",b.style.height=a.h+"px",b.width=a.w,b.height=a.h},drawFeature:function(a,
b){var c;if(a.geometry){b=this.applyDefaultSymbolizer(b||a.style);c=a.geometry.getBounds();var d;this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(d=this.map.getMaxExtent());d=c&&c.intersectsBounds(this.extent,{worldBounds:d});(c="none"!==b.display&&!!c&&d)?this.features[a.id]=[a,b]:delete this.features[a.id];this.pendingRedraw=!0}if(this.pendingRedraw&&!this.locked)this.redraw(),this.pendingRedraw=!1;return c},drawGeometry:function(a,b,c){var d=a.CLASS_NAME;if("OpenLayers.Geometry.Collection"==
d||"OpenLayers.Geometry.MultiPoint"==d||"OpenLayers.Geometry.MultiLineString"==d||"OpenLayers.Geometry.MultiPolygon"==d)for(d=0;d<a.components.length;d++)this.drawGeometry(a.components[d],b,c);else switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":this.drawPoint(a,b,c);break;case "OpenLayers.Geometry.LineString":this.drawLineString(a,b,c);break;case "OpenLayers.Geometry.LinearRing":this.drawLinearRing(a,b,c);break;case "OpenLayers.Geometry.Polygon":this.drawPolygon(a,b,c)}},drawExternalGraphic:function(a,
b,c){var d=new Image,e=b.title||b.graphicTitle;if(e)d.title=e;var f=b.graphicWidth||b.graphicHeight,g=b.graphicHeight||b.graphicWidth,f=f?f:2*b.pointRadius,g=g?g:2*b.pointRadius,h=void 0!=b.graphicXOffset?b.graphicXOffset:-(0.5*f),j=void 0!=b.graphicYOffset?b.graphicYOffset:-(0.5*g),k=b.graphicOpacity||b.fillOpacity;d.onload=OpenLayers.Function.bind(function(){if(this.features[c]){var b=this.getLocalXY(a),e=b[0],b=b[1];if(!isNaN(e)&&!isNaN(b)){var e=e+h|0,b=b+j|0,m=this.canvas;m.globalAlpha=k;var o=
OpenLayers.Renderer.Canvas.drawImageScaleFactor||(OpenLayers.Renderer.Canvas.drawImageScaleFactor=/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1);m.drawImage(d,e*o,b*o,f*o,g*o);this.hitDetection&&(this.setHitContextStyle("fill",c),this.hitContext.fillRect(e,b,f,g))}}},this);d.src=b.externalGraphic},drawNamedSymbol:function(a,b,c){var d,e,f,g;f=Math.PI/180;var h=OpenLayers.Renderer.symbol[b.graphicName];if(!h)throw Error(b.graphicName+" is not a valid symbol name");
if(h.length&&!(2>h.length)&&(a=this.getLocalXY(a),e=a[0],g=a[1],!isNaN(e)&&!isNaN(g))){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)d=this.cachedSymbolBounds[b.graphicName];else{d=new OpenLayers.Bounds;for(a=0;a<h.length;a+=2)d.extend(new OpenLayers.LonLat(h[a],h[a+1]));this.cachedSymbolBounds[b.graphicName]=d}this.canvas.save();this.hitDetection&&this.hitContext.save();
this.canvas.translate(e,g);this.hitDetection&&this.hitContext.translate(e,g);a=f*b.rotation;isNaN(a)||(this.canvas.rotate(a),this.hitDetection&&this.hitContext.rotate(a));f=2*b.pointRadius/Math.max(d.getWidth(),d.getHeight());this.canvas.scale(f,f);this.hitDetection&&this.hitContext.scale(f,f);a=d.getCenterLonLat().lon;d=d.getCenterLonLat().lat;this.canvas.translate(-a,-d);this.hitDetection&&this.hitContext.translate(-a,-d);g=b.strokeWidth;b.strokeWidth=g/f;if(!1!==b.fill){this.setCanvasStyle("fill",
b);this.canvas.beginPath();for(a=0;a<h.length;a+=2)d=h[a],e=h[a+1],0==a&&this.canvas.moveTo(d,e),this.canvas.lineTo(d,e);this.canvas.closePath();this.canvas.fill();if(this.hitDetection){this.setHitContextStyle("fill",c,b);this.hitContext.beginPath();for(a=0;a<h.length;a+=2)d=h[a],e=h[a+1],0==a&&this.canvas.moveTo(d,e),this.hitContext.lineTo(d,e);this.hitContext.closePath();this.hitContext.fill()}}if(!1!==b.stroke){this.setCanvasStyle("stroke",b);this.canvas.beginPath();for(a=0;a<h.length;a+=2)d=h[a],
e=h[a+1],0==a&&this.canvas.moveTo(d,e),this.canvas.lineTo(d,e);this.canvas.closePath();this.canvas.stroke();if(this.hitDetection){this.setHitContextStyle("stroke",c,b,f);this.hitContext.beginPath();for(a=0;a<h.length;a+=2)d=h[a],e=h[a+1],0==a&&this.hitContext.moveTo(d,e),this.hitContext.lineTo(d,e);this.hitContext.closePath();this.hitContext.stroke()}}b.strokeWidth=g;this.canvas.restore();this.hitDetection&&this.hitContext.restore();this.setCanvasStyle("reset")}},setCanvasStyle:function(a,b){"fill"===
a?(this.canvas.globalAlpha=b.fillOpacity,this.canvas.fillStyle=b.fillColor):"stroke"===a?(this.canvas.globalAlpha=b.strokeOpacity,this.canvas.strokeStyle=b.strokeColor,this.canvas.lineWidth=b.strokeWidth):(this.canvas.globalAlpha=0,this.canvas.lineWidth=1)},featureIdToHex:function(a){a=Number(a.split("_").pop())+1;if(16777216<=a)this.hitOverflow=a-16777215,a=a%16777216+1;var a="000000"+a.toString(16),b=a.length;return a="#"+a.substring(b-6,b)},setHitContextStyle:function(a,b,c,d){b=this.featureIdToHex(b);
if("fill"==a)this.hitContext.globalAlpha=1,this.hitContext.fillStyle=b;else if("stroke"==a)if(this.hitContext.globalAlpha=1,this.hitContext.strokeStyle=b,"undefined"===typeof d)this.hitContext.lineWidth=c.strokeWidth+2;else{if(!isNaN(d))this.hitContext.lineWidth=c.strokeWidth+2/d}else this.hitContext.globalAlpha=0,this.hitContext.lineWidth=1},drawPoint:function(a,b,c){if(!1!==b.graphic)if(b.externalGraphic)this.drawExternalGraphic(a,b,c);else if(b.graphicName&&"circle"!=b.graphicName)this.drawNamedSymbol(a,
b,c);else{var d=this.getLocalXY(a),a=d[0],d=d[1];if(!isNaN(a)&&!isNaN(d)){var e=2*Math.PI,f=b.pointRadius;!1!==b.fill&&(this.setCanvasStyle("fill",b),this.canvas.beginPath(),this.canvas.arc(a,d,f,0,e,!0),this.canvas.fill(),this.hitDetection&&(this.setHitContextStyle("fill",c,b),this.hitContext.beginPath(),this.hitContext.arc(a,d,f,0,e,!0),this.hitContext.fill()));!1!==b.stroke&&(this.setCanvasStyle("stroke",b),this.canvas.beginPath(),this.canvas.arc(a,d,f,0,e,!0),this.canvas.stroke(),this.hitDetection&&
(this.setHitContextStyle("stroke",c,b),this.hitContext.beginPath(),this.hitContext.arc(a,d,f,0,e,!0),this.hitContext.stroke()),this.setCanvasStyle("reset"))}}},drawLineString:function(a,b,c){b=OpenLayers.Util.applyDefaults({fill:!1},b);this.drawLinearRing(a,b,c)},drawLinearRing:function(a,b,c){!1!==b.fill&&(this.setCanvasStyle("fill",b),this.renderPath(this.canvas,a,b,c,"fill"),this.hitDetection&&(this.setHitContextStyle("fill",c,b),this.renderPath(this.hitContext,a,b,c,"fill")));!1!==b.stroke&&(this.setCanvasStyle("stroke",
b),this.renderPath(this.canvas,a,b,c,"stroke"),this.hitDetection&&(this.setHitContextStyle("stroke",c,b),this.renderPath(this.hitContext,a,b,c,"stroke")));this.setCanvasStyle("reset")},renderPath:function(a,b,c,d,e){b=b.components;c=b.length;a.beginPath();var d=this.getLocalXY(b[0]),f=d[1];if(!isNaN(d[0])&&!isNaN(f)){a.moveTo(d[0],d[1]);for(d=1;d<c;++d)f=this.getLocalXY(b[d]),a.lineTo(f[0],f[1]);"fill"===e?a.fill():a.stroke()}},drawPolygon:function(a,b,c){var a=a.components,d=a.length;this.drawLinearRing(a[0],
b,c);for(var e=1;e<d;++e){this.canvas.globalCompositeOperation="destination-out";if(this.hitDetection)this.hitContext.globalCompositeOperation="destination-out";this.drawLinearRing(a[e],OpenLayers.Util.applyDefaults({stroke:!1,fillOpacity:1},b),c);this.canvas.globalCompositeOperation="source-over";if(this.hitDetection)this.hitContext.globalCompositeOperation="source-over";this.drawLinearRing(a[e],OpenLayers.Util.applyDefaults({fill:!1},b),c)}},drawText:function(a,b){var c=this.getLocalXY(a);this.setCanvasStyle("reset");
this.canvas.fillStyle=b.fontColor;this.canvas.globalAlpha=b.fontOpacity||1;var d=[b.fontStyle?b.fontStyle:"normal","normal",b.fontWeight?b.fontWeight:"normal",b.fontSize?b.fontSize:"1em",b.fontFamily?b.fontFamily:"sans-serif"].join(" "),e=b.label.split("\n"),f=e.length;if(this.canvas.fillText){this.canvas.font=d;this.canvas.textAlign=OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[0]]||"center";this.canvas.textBaseline=OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[1]]||"middle";var g=OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[1]];
null==g&&(g=-0.5);d=this.canvas.measureText("Mg").height||this.canvas.measureText("xx").width;c[1]+=d*g*(f-1);for(g=0;g<f;g++){if(b.labelOutlineWidth)this.canvas.save(),this.canvas.globalAlpha=b.labelOutlineOpacity||b.fontOpacity||1,this.canvas.strokeStyle=b.labelOutlineColor,this.canvas.lineWidth=b.labelOutlineWidth,this.canvas.strokeText(e[g],c[0],c[1]+d*g+1),this.canvas.restore();this.canvas.fillText(e[g],c[0],c[1]+d*g)}}else if(this.canvas.mozDrawText){this.canvas.mozTextStyle=d;var h=OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[0]];
null==h&&(h=-0.5);g=OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[1]];null==g&&(g=-0.5);d=this.canvas.mozMeasureText("xx");c[1]+=d*(1+g*f);for(g=0;g<f;g++){var j=c[0]+h*this.canvas.mozMeasureText(e[g]),k=c[1]+g*d;this.canvas.translate(j,k);this.canvas.mozDrawText(e[g]);this.canvas.translate(-j,-k)}}this.setCanvasStyle("reset")},getLocalXY:function(a){var b=this.getResolution(),c=this.extent;return[(a.x-this.featureDx)/b+-c.left/b,c.top/b-a.y/b]},clear:function(){var a=this.root.height,b=this.root.width;
this.canvas.clearRect(0,0,b,a);this.features={};this.hitDetection&&this.hitContext.clearRect(0,0,b,a)},getFeatureIdFromEvent:function(a){var b;if(this.hitDetection&&"none"!==this.root.style.display&&!this.map.dragging&&(a=a.xy,a=this.hitContext.getImageData(a.x|0,a.y|0,1,1).data,255===a[3]&&(a=a[2]+256*(a[1]+256*a[0])))){a="OpenLayers_Feature_Vector_"+(a-1+this.hitOverflow);try{b=this.features[a][0]}catch(c){}}return b},eraseFeatures:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=0;b<a.length;++b)delete this.features[a[b].id];
this.redraw()},redraw:function(){if(!this.locked){var a=this.root.height,b=this.root.width;this.canvas.clearRect(0,0,b,a);this.hitDetection&&this.hitContext.clearRect(0,0,b,a);var a=[],c,d,e=this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent(),f;for(f in this.features)if(this.features.hasOwnProperty(f))b=this.features[f][0],c=b.geometry,this.calculateFeatureDx(c.getBounds(),e),d=this.features[f][1],this.drawGeometry(c,d,b.id),d.label&&a.push([b,d]);b=0;for(c=a.length;b<c;++b)f=
a[b],this.drawText(f[0].geometry.getCentroid(),f[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.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:!0,autoDestroy:!0,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a;this.active=!1},destroy:function(){this.deactivate();this.options=this.layer=null},setLayer:function(a){this.layer=a},activate:function(){return!this.active?this.active=!0:!1},deactivate:function(){return this.active?(this.active=!1,!0):!1},CLASS_NAME:"OpenLayers.Strategy"});
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);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);a&&this.layer.events.un({moveend:this.update,refresh:this.update,visibilitychanged:this.update,
scope:this});return a},update:function(a){var b=this.getMapBounds();if(null!==b&&(a&&a.force||this.layer.visibility&&this.layer.calculateInRange()&&this.invalidBounds(b)))this.calculateBounds(b),this.resolution=this.layer.map.getResolution(),this.triggerRead(a)},getMapBounds:function(){if(null===this.layer.map)return null;var a=this.layer.map.getExtent();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){a||(a=this.getMapBounds());a=!this.bounds||!this.bounds.containsBounds(a);!a&&this.resFactor&&(a=this.resolution/this.layer.map.getResolution(),a=a>=this.resFactor||a<=1/this.resFactor);return a},calculateBounds:function(a){a||(a=this.getMapBounds());var b=a.getCenterLonLat(),c=a.getWidth()*this.ratio,a=a.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(b.lon-c/2,b.lat-a/2,b.lon+c/2,b.lat+a/2)},triggerRead:function(a){this.response&&!(a&&!0===a.noAbort)&&
(this.layer.protocol.abort(this.response),this.layer.events.triggerEvent("loadend"));var b={filter:this.createFilter()};this.layer.events.triggerEvent("loadstart",b);this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:b.filter,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});this.layer.filter&&(a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,
filters:[this.layer.filter,a]}));return a},merge:function(a){this.layer.destroyFeatures();if(a.success()){var b=a.features;if(b&&0<b.length){var c=this.layer.projection,d=this.layer.map.getProjectionObject();if(!d.equals(c))for(var e,f=0,g=b.length;f<g;++f)(e=b[f].geometry)&&e.transform(c,d);this.layer.addFeatures(b)}}else this.bounds=null;this.response=null;this.layer.events.triggerEvent("loadend",{response:a})},CLASS_NAME:"OpenLayers.Strategy.BBOX"});
OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:!1,activate:function(){var a=OpenLayers.Strategy.prototype.activate.apply(this,arguments);if(a)if(this.layer.events.on({refresh:this.load,scope:this}),!0==this.layer.visibility||this.preload)this.load();else this.layer.events.on({visibilitychanged:this.load,scope:this});return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);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",{filter:b.filter});b.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,filter:b.filter,scope:this},a));b.events.un({visibilitychanged:this.load,scope:this})},merge:function(a){var b=this.layer;b.destroyFeatures();var c=a.features;if(c&&0<c.length){var d=b.projection,e=b.map.getProjectionObject();if(!e.equals(d))for(var f,g=0,h=c.length;g<h;++g)(f=c[g].geometry)&&f.transform(d,e);b.addFeatures(c)}b.events.triggerEvent("loadend",
{response:a})},CLASS_NAME:"OpenLayers.Strategy.Fixed"});Ext.namespace("GeoExt.data");GeoExt.data.LayerRecord=Ext.data.Record.create([{name:"layer"},{name:"title",type:"string",mapping:"name"}]);GeoExt.data.LayerRecord.prototype.getLayer=function(){return this.get("layer")};
GeoExt.data.LayerRecord.prototype.setLayer=function(a){if(a!==this.data.layer){this.dirty=!0;if(!this.modified)this.modified={};if(void 0===this.modified.layer)this.modified.layer=this.data.layer;this.data.layer=a;this.editing||this.afterEdit()}};GeoExt.data.LayerRecord.prototype.clone=function(a){var b=this.getLayer()&&this.getLayer().clone();return new this.constructor(Ext.applyIf({layer:b},this.data),a||b.id)};
GeoExt.data.LayerRecord.create=function(a){var b=Ext.extend(GeoExt.data.LayerRecord,{}),c=b.prototype;c.fields=new Ext.util.MixedCollection(!1,function(a){return a.name});GeoExt.data.LayerRecord.prototype.fields.each(function(a){c.fields.add(a)});if(a)for(var d=0,e=a.length;d<e;d++)c.fields.add(new Ext.data.Field(a[d]));b.getField=function(a){return c.fields.get(a)};return b};Ext.namespace("GeoExt.data");
GeoExt.data.AttributeStoreMixin=function(){return{constructor:function(a){a=a||{};arguments.callee.superclass.constructor.call(this,Ext.apply(a,{proxy:a.proxy||(!a.data?new Ext.data.HttpProxy({url:a.url,disableCaching:!1,method:"GET"}):void 0),reader:new GeoExt.data.AttributeReader(a,a.fields||["name","type","restriction",{name:"nillable",type:"boolean"},"annotation"])}));this.feature&&this.bind()},bind:function(){this.on({update:this.onUpdate,load:this.onLoad,add:this.onAdd,scope:this});var a=[];
this.each(function(b){a.push(b)});this.updateFeature(a)},onUpdate:function(a,b){this.updateFeature([b])},onLoad:function(a,b,c){(!c||!0!==c.add)&&this.updateFeature(b)},onAdd:function(a,b){this.updateFeature(b)},updateFeature:function(a){var b=this.feature,c=b.layer,d,e,f,g,h,j;for(d=0,e=a.length;d<e;d++)f=a[d],g=f.get("name"),h=f.get("value"),f=b.attributes[g],f!==h&&(j=!0);if(j&&c&&c.events&&!1!==c.events.triggerEvent("beforefeaturemodified",{feature:b})){for(d=0,e=a.length;d<e;d++)f=a[d],g=f.get("name"),
h=f.get("value"),"xsd:date"==f.get("type")&&h instanceof Date&&(h=h.format("Y-m-d")),b.attributes[g]=h;c.events.triggerEvent("featuremodified",{feature:b});c.drawFeature(b)}}}};GeoExt.data.AttributeStore=Ext.extend(Ext.data.Store,GeoExt.data.AttributeStoreMixin());Ext.namespace("GeoExt.data");GeoExt.data.AttributeReader=function(a,b){a=a||{};if(!a.format)a.format=new OpenLayers.Format.WFSDescribeFeatureType;GeoExt.data.AttributeReader.superclass.constructor.call(this,a,b||a.fields);a.feature&&this.recordType.prototype.fields.add(new Ext.data.Field("value"))};
Ext.extend(GeoExt.data.AttributeReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b||!b.documentElement)b=a.responseText;return this.readRecords(b)},readRecords:function(a){if(!(a instanceof Array)){a=this.meta.format.read(a);if(a.error)throw new Ext.data.DataReader.Error("invalid-response",a.error);a=a.featureTypes[0].properties}for(var b=this.meta.feature,c=this.recordType,d=c.prototype.fields,e=d.length,f,g,h,j,k,l=[],n=0,m=a.length;n<m;++n){j=!1;f=a[n];g={};for(var o=0;o<e;++o){k=
d.items[o];h=k.name;k=k.convert(f[h]);if(this.ignoreAttribute(h,k)){j=!0;break}g[h]=k}if(b)k=b.attributes[g.name],void 0!==k&&(this.ignoreAttribute("value",k)?j=!0:g.value=k);j||(l[l.length]=new c(g))}return{success:!0,records:l,totalRecords:l.length}},ignoreAttribute:function(a,b){var c=!1;if(this.meta.ignore&&this.meta.ignore[a]){var d=this.meta.ignore[a];"string"==typeof d?c=d===b:d instanceof Array?c=-1<d.indexOf(b):d instanceof RegExp&&(c=d.test(b))}return c}});Ext.namespace("GeoExt","GeoExt.data");
GeoExt.data.ProtocolProxy=function(a){Ext.apply(this,a);GeoExt.data.ProtocolProxy.superclass.constructor.apply(this,arguments)};
Ext.extend(GeoExt.data.ProtocolProxy,Ext.data.DataProxy,{protocol:null,abortPrevious:!0,setParamsAsOptions:!1,response:null,load:function(a,b,c,d,e){!1!==this.fireEvent("beforeload",this,a)?(b=OpenLayers.Function.bind(this.loadResponse,this,{params:a||{},request:{callback:c,scope:d,arg:e},reader:b}),this.abortPrevious&&this.abortRequest(),a={params:a,callback:b,scope:this},Ext.applyIf(a,e),!0===this.setParamsAsOptions&&(Ext.applyIf(a,a.params),delete a.params),this.response=this.protocol.read(a)):
c.call(d||this,null,e,!1)},abortRequest:function(){if(this.response)this.protocol.abort(this.response),this.response=null},loadResponse:function(a,b){if(b.success()){var c;try{c=a.reader.read(b)}catch(d){this.fireEvent("loadexception",this,a,b,d);this.fireEvent("exception",this,"response",null,a,b,d);a.request.callback.call(a.request.scope,null,a.request.arg,!1);return}this.fireEvent("load",this,a,a.request.arg);a.request.callback.call(a.request.scope,c,a.request.arg,!0)}else this.fireEvent("loadexception",
this,a,b),a.request.callback.call(a.request.scope,null,a.request.arg,!1)}});Ext.namespace("GeoExt.data");
GeoExt.data.FeatureStoreMixin=function(){return{layer:null,reader:null,featureFilter:null,constructor:function(a){a=a||{};a.reader=a.reader||new GeoExt.data.FeatureReader({},a.fields);var b=a.layer;delete a.layer;if(a.features)a.data=a.features;delete a.features;var c={initDir:a.initDir};delete a.initDir;arguments.callee.superclass.constructor.call(this,a);b&&this.bind(b,c)},bind:function(a,b){if(!this.layer){this.layer=a;var b=b||{},c=b.initDir;void 0==b.initDir&&(c=GeoExt.data.FeatureStore.LAYER_TO_STORE|
GeoExt.data.FeatureStore.STORE_TO_LAYER);var d=a.features.slice(0);if(c&GeoExt.data.FeatureStore.STORE_TO_LAYER)for(var e=this.getRange(),f=e.length-1;0<=f;f--)this.layer.addFeatures([e[f].getFeature()]);c&GeoExt.data.FeatureStore.LAYER_TO_STORE&&this.loadData(d,!0);a.events.on({featuresadded:this.onFeaturesAdded,featuresremoved:this.onFeaturesRemoved,featuremodified:this.onFeatureModified,scope:this});this.on({load:this.onLoad,clear:this.onClear,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,
scope:this})}},unbind:function(){if(this.layer)this.layer.events.un({featuresadded:this.onFeaturesAdded,featuresremoved:this.onFeaturesRemoved,featuremodified:this.onFeatureModified,scope:this}),this.un("load",this.onLoad,this),this.un("clear",this.onClear,this),this.un("add",this.onAdd,this),this.un("remove",this.onRemove,this),this.un("update",this.onUpdate,this),this.layer=null},getRecordFromFeature:function(a){return this.getByFeature(a)||null},getByFeature:function(a){var b;if(a.state!==OpenLayers.State.INSERT)b=
this.getById(a.id);else{var c=this.findBy(function(b){return b.getFeature()===a});-1<c&&(b=this.getAt(c))}return b},onFeaturesAdded:function(a){if(!this._adding){var b=a=a.features;if(this.featureFilter){var b=[],c,d,e;c=0;for(d=a.length;c<d;c++)e=a[c],!1!==this.featureFilter.evaluate(e)&&b.push(e)}this._adding=!0;this.loadData(b,!0);delete this._adding}},onFeaturesRemoved:function(a){if(!this._removing){var a=a.features,b,c;for(c=a.length-1;0<=c;c--)if(b=a[c],b=this.getByFeature(b),void 0!==b)this._removing=
!0,this.remove(b),delete this._removing}},onFeatureModified:function(a){if(!this._updating){var a=a.feature,b=this.getByFeature(a);if(void 0!==b){b.beginEdit();var c=a.attributes;if(c)for(var d=this.recordType.prototype.fields,e=0,f=d.length;e<f;e++){var g=d.items[e],h=g.mapping||g.name;h in c&&b.set(g.name,g.convert(c[h]))}b.set("state",a.state);b.set("fid",a.fid);b.setFeature(a);this._updating=!0;b.endEdit();delete this._updating}}},addFeaturesToLayer:function(a){var b,c,d;d=Array(c=a.length);for(b=
0;b<c;b++)d[b]=a[b].getFeature();if(0<d.length)this._adding=!0,this.layer.addFeatures(d),delete this._adding},onLoad:function(a,b,c){if(!c||!0!==c.add)this._removing=!0,this.layer.removeFeatures(this.layer.features),delete this._removing,this.addFeaturesToLayer(b)},onClear:function(){this._removing=!0;this.layer.removeFeatures(this.layer.features);delete this._removing},onAdd:function(a,b){this._adding||this.addFeaturesToLayer(b)},onRemove:function(a,b){if(!this._removing&&null!=this.layer.getFeatureById(b.getFeature().id))this._removing=
!0,this.layer.removeFeatures([b.getFeature()]),delete this._removing},onUpdate:function(a,b){if(!this._updating){var c=(new GeoExt.data.FeatureRecord).fields,d=b.getFeature();if(d.state!==OpenLayers.State.INSERT)d.state=OpenLayers.State.UPDATE;if(b.fields&&!1!==this.layer.events.triggerEvent("beforefeaturemodified",{feature:d})){var e=d.attributes;b.fields.each(function(a){var d=a.mapping||a.name;c.containsKey(d)||(e[d]=b.get(a.name))});this._updating=!0;this.layer.events.triggerEvent("featuremodified",
{feature:d});delete this._updating;null!=this.layer.getFeatureById(d.id)&&this.layer.drawFeature(d)}}},destroy:function(){this.unbind();GeoExt.data.FeatureStore.superclass.destroy.call(this)}}};GeoExt.data.FeatureStore=Ext.extend(Ext.data.Store,new GeoExt.data.FeatureStoreMixin);GeoExt.data.FeatureStore.LAYER_TO_STORE=1;GeoExt.data.FeatureStore.STORE_TO_LAYER=2;Ext.namespace("GeoExt","GeoExt.data");
GeoExt.data.FeatureReader=function(a,b){a=a||{};b instanceof Function||(b=GeoExt.data.FeatureRecord.create(b||a.fields||{}));GeoExt.data.FeatureReader.superclass.constructor.call(this,a,b)};
Ext.extend(GeoExt.data.FeatureReader,Ext.data.DataReader,{totalRecords:null,read:function(a){return this.readRecords(a.features)},readRecords:function(a){var b=[];if(a){var c=this.recordType,d=c.prototype.fields,e,f,g,h,j,k,l,n;for(e=0,f=a.length;e<f;e++){j=a[e];k={};if(j.attributes)for(g=0,h=d.length;g<h;g++){l=d.items[g];if(/[\[\.]/.test(l.mapping))try{n=(new Function("obj","return obj."+l.mapping))(j.attributes)}catch(m){n=l.defaultValue}else n=j.attributes[l.mapping||l.name]||l.defaultValue;l.convert&&
(n=l.convert(n,j));k[l.name]=n}k.feature=j;k.state=j.state;k.fid=j.fid;b[b.length]=new c(k,j.state===OpenLayers.State.INSERT?void 0:j.id)}}return{records:b,totalRecords:null!=this.totalRecords?this.totalRecords:b.length}}});Ext.namespace("GeoExt.data");GeoExt.data.FeatureRecord=Ext.data.Record.create([{name:"feature"},{name:"state"},{name:"fid"}]);GeoExt.data.FeatureRecord.prototype.getFeature=function(){return this.get("feature")};
GeoExt.data.FeatureRecord.prototype.setFeature=function(a){if(a!==this.data.feature){this.dirty=!0;if(!this.modified)this.modified={};if(void 0===this.modified.feature)this.modified.feature=this.data.feature;this.data.feature=a;this.editing||this.afterEdit()}};
GeoExt.data.FeatureRecord.create=function(a){var b=Ext.extend(GeoExt.data.FeatureRecord,{}),c=b.prototype;c.fields=new Ext.util.MixedCollection(!1,function(a){return a.name});GeoExt.data.FeatureRecord.prototype.fields.each(function(a){c.fields.add(a)});if(a)for(var d=0,e=a.length;d<e;d++)c.fields.add(new Ext.data.Field(a[d]));b.getField=function(a){return c.fields.get(a)};return b};Ext.namespace("GeoExt.data");
GeoExt.data.CSWRecordsReader=function(a,b){a=a||{};if(!a.format)a.format=new OpenLayers.Format.CSWGetRecords;if(!a.root)a.root="records";GeoExt.data.CSWRecordsReader.superclass.constructor.call(this,a,b)};
Ext.extend(GeoExt.data.CSWRecordsReader,Ext.data.JsonReader,{read:function(a){var b=a.data;if(!b&&(b=a.responseXML,!b||!b.documentElement))b=a.responseText;return this.readRecords(b)},readRecords:function(a){if("string"===typeof a||a.nodeType)a=this.meta.format.read(a);if(!1===a.success)throw new Ext.data.DataReader.Error("invalid-response",a);var b=GeoExt.data.CSWRecordsReader.superclass.readRecords.call(this,a);Ext.each(b.records,function(a){for(var b in a.data){var e=a.data[b];if(e instanceof Array)for(var f=
0,g=e.length;f<g;++f)if(e[f]instanceof Object){var h=0,j;for(j in e[f])e[f].hasOwnProperty(j)&&h++;if(1===h&&e[f].value)e[f]=e[f].value}}});if(a.SearchResults)b.totalRecords=a.SearchResults.numberOfRecordsMatched;return b}});Ext.namespace("GeoExt.data");
GeoExt.data.WMSDescribeLayerReader=function(a,b){a=a||{};if(!a.format)a.format=new OpenLayers.Format.WMSDescribeLayer;"function"!==typeof b&&(b=Ext.data.Record.create(b||a.fields||[{name:"owsType",type:"string"},{name:"owsURL",type:"string"},{name:"typeName",type:"string"}]));GeoExt.data.WMSDescribeLayerReader.superclass.constructor.call(this,a,b)};
Ext.extend(GeoExt.data.WMSDescribeLayerReader,Ext.data.DataReader,{read:function(a){var b=a.responseXML;if(!b||!b.documentElement)b=a.responseText;return this.readRecords(b)},readRecords:function(a){if("string"===typeof a||a.nodeType)a=this.meta.format.read(a);if(a.error)throw new Ext.data.DataReader.Error("invalid-response",a.error);for(var b=[],c,d=0,e=a.length;d<e;d++)(c=a[d])&&b.push(new this.recordType(c));return{totalRecords:b.length,success:!0,records:b}}});Ext.namespace("GeoExt.plugins");
GeoExt.plugins.PrintPageField=Ext.extend(Ext.util.Observable,{printPage:null,target:null,constructor:function(a){this.initialConfig=a;Ext.apply(this,a);GeoExt.plugins.PrintPageField.superclass.constructor.apply(this,arguments)},init:function(a){this.target=a;var b={beforedestroy:this.onBeforeDestroy,scope:this};b[a instanceof Ext.form.ComboBox?"select":a instanceof Ext.form.Checkbox?"check":"valid"]=this.onFieldChange;a.on(b);this.printPage.on({change:this.onPageChange,scope:this});this.printPage.printProvider.on({layoutchange:this.onLayoutChange,
scope:this});this.setValue(this.printPage)},onFieldChange:function(a,b){var c=this.printPage.printProvider,d=a.getValue();this._updating=!0;a.store===c.scales||"scale"===a.name?this.printPage.setScale(b):"rotation"==a.name?!isNaN(d)&&this.printPage.setRotation(d):this.printPage.customParams[a.name]=d;delete this._updating},onPageChange:function(a){this._updating||this.setValue(a)},onLayoutChange:function(a,b){var c=this.target;"rotation"==c.name&&c.setDisabled(!b.get("rotation"))},setValue:function(a){var b=
this.target;b.suspendEvents();b.store===a.printProvider.scales||"scale"===b.name?a.scale&&b.setValue(a.scale.get(b.displayField)):"rotation"==b.name&&b.setValue(a.rotation);b.resumeEvents()},onBeforeDestroy:function(){this.target.un("beforedestroy",this.onBeforeDestroy,this);this.target.un("select",this.onFieldChange,this);this.target.un("valid",this.onFieldChange,this);this.printPage.un("change",this.onPageChange,this);this.printPage.printProvider.un("layoutchange",this.onLayoutChange,this)}});
Ext.preg("gx_printpagefield",GeoExt.plugins.PrintPageField);Ext.namespace("GeoExt.plugins");
GeoExt.plugins.PrintProviderField=Ext.extend(Ext.util.Observable,{target:null,constructor:function(a){this.initialConfig=a;Ext.apply(this,a);GeoExt.plugins.PrintProviderField.superclass.constructor.apply(this,arguments)},init:function(a){this.target=a;var b={scope:this,render:this.onRender,beforedestroy:this.onBeforeDestroy};a instanceof Ext.form.ComboBox?b.select=this.onFieldChange:a instanceof Ext.form.Checkbox?b.check=this.onFieldChange:b.valid=this.onFieldChange;a.on(b)},onRender:function(a){var b=
this.printProvider||a.ownerCt.printProvider;a.store===b.layouts?(a.setValue(b.layout.get(a.displayField)),b.on({layoutchange:this.onProviderChange,scope:this})):a.store===b.dpis?(a.setValue(b.dpi.get(a.displayField)),b.on({dpichange:this.onProviderChange,scope:this})):a.store===b.outputFormats?b.outputFormat?(a.setValue(b.outputFormat.get(a.displayField)),b.on({outputformatchange:this.onProviderChange,scope:this})):(a.setValue(b.defaultOutputFormatName),a.disable()):void 0===a.initialConfig.value&&
a.setValue(b.customParams[a.name])},onFieldChange:function(a,b){var c=this.printProvider||a.ownerCt.printProvider,d=a.getValue();this._updating=!0;if(b)switch(a.store){case c.layouts:c.setLayout(b);break;case c.dpis:c.setDpi(b);break;case c.outputFormats:c.setOutputFormat(b);break;default:var e=a.name||a.valueField;e&&(c.customParams[e]=d)}else c.customParams[a.name]=d;delete this._updating},onProviderChange:function(a,b){this._updating||this.target.setValue(b.get(this.target.displayField))},onBeforeDestroy:function(){var a=
this.target;a.un("beforedestroy",this.onBeforeDestroy,this);a.un("render",this.onRender,this);a.un("select",this.onFieldChange,this);a.un("valid",this.onFieldChange,this);a.un("check",this.onFieldChange,this);a=this.printProvider||a.ownerCt.printProvider;a.un("layoutchange",this.onProviderChange,this);a.un("dpichange",this.onProviderChange,this);a.un("outputformatchange",this.onProviderChange,this)}});Ext.preg("gx_printproviderfield",GeoExt.plugins.PrintProviderField);Ext.namespace("GeoExt.plugins");
GeoExt.plugins.TreeNodeComponent=Ext.extend(Ext.util.Observable,{constructor:function(a){Ext.apply(this.initialConfig,Ext.apply({},a));Ext.apply(this,a);GeoExt.plugins.TreeNodeComponent.superclass.constructor.apply(this,arguments)},init:function(a){a.on({rendernode:this.onRenderNode,beforedestroy:this.onBeforeDestroy,scope:this})},onRenderNode:function(a){var b=a.attributes.component||this.component;if(!a.rendered&&b){var c=Ext.DomHelper.append(a.ui.elNode,[{tag:"div"}]);"function"==typeof b?b=b(a,
c):"object"==typeof b&&"function"==typeof b.fn&&(b=b.fn.apply(b.scope,[a,c]));"object"==typeof b&&"string"==typeof b.xtype&&(b=Ext.ComponentMgr.create(b));if(b instanceof Ext.Component)b.render(c),a.component=b}},onBeforeDestroy:function(a){a.un("rendernode",this.onRenderNode,this);a.un("beforedestroy",this.onBeforeDestroy,this)}});Ext.preg("gx_treenodecomponent",GeoExt.plugins.TreeNodeComponent);Ext.namespace("GeoExt");
GeoExt.Action=Ext.extend(Ext.Action,{control:null,activateOnEnable:!1,deactivateOnDisable:!1,map:null,uScope:null,uHandler:null,uToggleHandler:null,uCheckHandler:null,constructor:function(a){this.uScope=a.scope;this.uHandler=a.handler;this.uToggleHandler=a.toggleHandler;this.uCheckHandler=a.checkHandler;a.scope=this;a.handler=this.pHandler;a.toggleHandler=this.pToggleHandler;a.checkHandler=this.pCheckHandler;var b=this.control=a.control;delete a.control;this.activateOnEnable=!!a.activateOnEnable;
delete a.activateOnEnable;this.deactivateOnDisable=!!a.deactivateOnDisable;delete a.deactivateOnDisable;if(b){a.map&&(a.map.addControl(b),delete a.map);(a.pressed||a.checked)&&b.map&&b.activate();if(b.active)a.pressed=!0,a.checked=!0;b.events.on({activate:this.onCtrlActivate,deactivate:this.onCtrlDeactivate,scope:this})}arguments.callee.superclass.constructor.call(this,a)},pHandler:function(a){var b=this.control;b&&b.type==OpenLayers.Control.TYPE_BUTTON&&b.trigger();this.uHandler&&this.uHandler.apply(this.uScope,
arguments)},pToggleHandler:function(a,b){this.changeControlState(b);this.uToggleHandler&&this.uToggleHandler.apply(this.uScope,arguments)},pCheckHandler:function(a,b){this.changeControlState(b);this.uCheckHandler&&this.uCheckHandler.apply(this.uScope,arguments)},changeControlState:function(a){if(a){if(!this._activating)this._activating=!0,this.control.activate(),this.initialConfig.pressed=!0,this.initialConfig.checked=!0,this._activating=!1}else if(!this._deactivating)this._deactivating=!0,this.control.deactivate(),
this.initialConfig.pressed=!1,this._deactivating=this.initialConfig.checked=!1},onCtrlActivate:function(){this.control.type==OpenLayers.Control.TYPE_BUTTON?this.enable():(this.safeCallEach("toggle",[!0]),this.safeCallEach("setChecked",[!0]))},onCtrlDeactivate:function(){this.control.type==OpenLayers.Control.TYPE_BUTTON?this.disable():(this.safeCallEach("toggle",[!1]),this.safeCallEach("setChecked",[!1]))},safeCallEach:function(a,b){for(var c=this.items,d=0,e=c.length;d<e;d++)c[d][a]&&(c[d].rendered?
c[d][a].apply(c[d],b):c[d].on({render:c[d][a].createDelegate(c[d],b),single:!0}))},setDisabled:function(a){!a&&this.activateOnEnable&&this.control&&!this.control.active&&this.control.activate();a&&this.deactivateOnDisable&&this.control&&this.control.active&&this.control.deactivate();return GeoExt.Action.superclass.setDisabled.apply(this,arguments)}});Ext.namespace("GeoExt.tree");
GeoExt.tree.LayerContainer=Ext.extend(Ext.tree.AsyncTreeNode,{text:"Layers",constructor:function(a){a=Ext.applyIf(a||{},{text:this.text});this.loader=a.loader instanceof GeoExt.tree.LayerLoader?a.loader:new GeoExt.tree.LayerLoader(Ext.applyIf(a.loader||{},{store:a.layerStore}));GeoExt.tree.LayerContainer.superclass.constructor.call(this,a)},recordIndexToNodeIndex:function(a){for(var b=this.loader.store,c=this.childNodes.length,d=-1,e=b.getCount()-1;0<=e&&!(!0===this.loader.filter(b.getAt(e))&&(++d,
a===e||d>c-1));--e);return d},destroy:function(){delete this.layerStore;GeoExt.tree.LayerContainer.superclass.destroy.apply(this,arguments)}});Ext.tree.TreePanel.nodeTypes.gx_layercontainer=GeoExt.tree.LayerContainer;Ext.namespace("GeoExt.tree");GeoExt.tree.LayerLoader=function(a){Ext.apply(this,a);this.addEvents("beforeload","load");this.iconCls={};GeoExt.tree.LayerLoader.superclass.constructor.call(this)};
Ext.extend(GeoExt.tree.LayerLoader,Ext.util.Observable,{store:null,filter:function(a){return!0==a.getLayer().displayInLayerSwitcher},baseAttrs:null,uiProviders:null,load:function(a,b){if(this.fireEvent("beforeload",this,a)){for(this.removeStoreHandlers();a.firstChild;)a.removeChild(a.firstChild);if(!this.uiProviders)this.uiProviders=a.getOwnerTree().getLoader().uiProviders;if(!this.store)this.store=GeoExt.MapPanel.guess().layers;this.store.each(function(b){this.addLayerNode(a,b)},this);this.addStoreHandlers(a);
"function"==typeof b&&b();this.fireEvent("load",this,a)}},onStoreAdd:function(a,b,c,d){if(!this._reordering){a=d.recordIndexToNodeIndex(c+b.length-1);for(c=0;c<b.length;++c)this.addLayerNode(d,b[c],a)}},onStoreRemove:function(a,b,c,d){this._reordering||this.removeLayerNode(d,b)},addLayerNode:function(a,b,c){c=c||0;!0===this.filter(b)&&(b=this.createNode({nodeType:"gx_layer",layer:b.getLayer(),layerStore:this.store,iconCls:this.iconCls[b.id]}),(c=a.item(c))?a.insertBefore(b,c):a.appendChild(b),b.on("move",
this.onChildMove,this))},removeLayerNode:function(a,b){if(!0===this.filter(b)){var c=a.findChildBy(function(a){return a.layer==b.getLayer()});c&&(c.un("move",this.onChildMove,this),c.remove(),a.reload())}},onChildMove:function(a,b,c,d,e){this._reordering=!0;a=this.store.getByLayer(b.layer);delete c.loader.iconCls[a.id];if(d instanceof GeoExt.tree.LayerContainer&&this.store===d.loader.store){d.loader._reordering=!0;d.loader.iconCls[a.id]=b.attributes.iconCls;this.store.remove(a);var f;if(1<d.childNodes.length){var g=
0===e?e+1:e-1;f=this.store.findBy(function(a){return d.childNodes[g].layer===a.getLayer()});0===e&&f++}else if(c.parentNode===d.parentNode){var h=d;do h=h.previousSibling;while(h&&!(h instanceof GeoExt.tree.LayerContainer&&h.lastChild));if(h)f=this.store.findBy(function(a){return h.lastChild.layer===a.getLayer()});else{var j=d;do j=j.nextSibling;while(j&&!(j instanceof GeoExt.tree.LayerContainer&&j.firstChild));j&&(f=this.store.findBy(function(a){return j.firstChild.layer===a.getLayer()}));f++}}void 0!==
f?(this.store.insert(f,[a]),window.setTimeout(function(){d.reload();c.reload()})):this.store.insert(oldRecordIndex,[a]);delete d.loader._reordering}delete this._reordering},addStoreHandlers:function(a){if(!this._storeHandlers){this._storeHandlers={add:this.onStoreAdd.createDelegate(this,[a],!0),remove:this.onStoreRemove.createDelegate(this,[a],!0)};for(var b in this._storeHandlers)this.store.on(b,this._storeHandlers[b],this)}},removeStoreHandlers:function(){if(this._storeHandlers){for(var a in this._storeHandlers)this.store.un(a,
this._storeHandlers[a],this);delete this._storeHandlers}},createNode:function(a){this.baseAttrs&&Ext.apply(a,this.baseAttrs);if("string"==typeof a.uiProvider)a.uiProvider=this.uiProviders[a.uiProvider]||eval(a.uiProvider);a.nodeType=a.nodeType||"gx_layer";return new Ext.tree.TreePanel.nodeTypes[a.nodeType](a)},destroy:function(){this.removeStoreHandlers();this.iconCls=null}});Ext.namespace("GeoExt.tree");
GeoExt.tree.LayerNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{constructor:function(a){GeoExt.tree.LayerNodeUI.superclass.constructor.apply(this,arguments)},render:function(a){var b=this.node.attributes;if(void 0===b.checked)b.checked=this.node.layer.getVisibility();if(void 0===b.disabled&&this.node.autoDisable)this.node.disabled=!1===this.node.layer.inRange||!this.node.layer.calculateInRange();GeoExt.tree.LayerNodeUI.superclass.render.apply(this,arguments);var c=this.checkbox;if(b.checkedGroup)b=Ext.DomHelper.insertAfter(c,
['<input type="radio" name="',b.checkedGroup,'_checkbox" class="',c.className,c.checked?'" checked="checked"':"",'"></input>'].join("")),b.defaultChecked=c.defaultChecked,Ext.get(c).remove(),this.checkbox=b;this.enforceOneVisible()},onClick:function(a){a.getTarget(".x-tree-node-cb",1)?this.toggleCheck(this.isChecked()):GeoExt.tree.LayerNodeUI.superclass.onClick.apply(this,arguments)},toggleCheck:function(a){a=void 0===a?!this.isChecked():a;GeoExt.tree.LayerNodeUI.superclass.toggleCheck.call(this,
a);this.enforceOneVisible()},enforceOneVisible:function(){var a=this.node.attributes,b=a.checkedGroup;if(b&&"gx_baselayer"!==b){var c=this.node.layer,d=this.node.getOwnerTree().getChecked(),e=0;Ext.each(d,function(d){var g=d.layer;!d.hidden&&d.attributes.checkedGroup===b&&(e++,g!=c&&a.checked&&g.setVisibility(!1))});0===e&&!1==a.checked&&c.setVisibility(!0)}},appendDDGhost:function(a){var b=this.elNode.cloneNode(!0),c=Ext.DomQuery.select("input[type='radio']",b);Ext.each(c,function(a){a.name+="_clone"});
a.appendChild(b)}});
GeoExt.tree.LayerNode=Ext.extend(Ext.tree.AsyncTreeNode,{layer:null,autoDisable:null,layerStore:null,constructor:function(a){a.leaf=a.leaf||!(a.children||a.loader);if(!a.iconCls&&!a.children)a.iconCls="gx-tree-layer-icon";if(a.loader&&!(a.loader instanceof Ext.tree.TreeLoader))a.loader=new GeoExt.tree.LayerParamLoader(a.loader);this.defaultUI=this.defaultUI||GeoExt.tree.LayerNodeUI;Ext.apply(this,{layer:a.layer,layerStore:a.layerStore,autoDisable:a.autoDisable});if(a.text)this.fixedText=!0;GeoExt.tree.LayerNode.superclass.constructor.apply(this,
arguments)},render:function(a){var b=this.layer instanceof OpenLayers.Layer&&this.layer;if(!b){if(!this.layerStore||"auto"==this.layerStore)this.layerStore=GeoExt.MapPanel.guess().layers;var c=this.layerStore.findBy(function(a){return a.get("title")==this.layer},this);-1!=c&&(b=this.layerStore.getAt(c).getLayer())}if(!this.rendered||!b){c=this.getUI();if(b){this.layer=b;if(b.isBaseLayer)this.draggable=!1,Ext.applyIf(this.attributes,{checkedGroup:"gx_baselayer"});this.autoDisable=!(!1===this.autoDisable||
this.layer.isBaseLayer||this.layer.alwaysInRange);if(!this.text)this.text=b.name;c.show();this.addVisibilityEventHandlers()}else c.hide();this.layerStore instanceof GeoExt.data.LayerStore&&this.addStoreEventHandlers(b)}GeoExt.tree.LayerNode.superclass.render.apply(this,arguments)},addVisibilityEventHandlers:function(){this.layer.events.on({visibilitychanged:this.onLayerVisibilityChanged,scope:this});this.on({checkchange:this.onCheckChange,scope:this});this.autoDisable&&(this.layer.map?this.layer.map.events.register("moveend",
this,this.onMapMoveend):this.layer.events.register("added",this,function b(){this.layer.events.unregister("added",this,b);this.layer.map.events.register("moveend",this,this.onMapMoveend)}))},onLayerVisibilityChanged:function(){this._visibilityChanging||this.getUI().toggleCheck(this.layer.getVisibility())},onCheckChange:function(a,b){if(b!=this.layer.getVisibility()){this._visibilityChanging=!0;var c=this.layer;b&&c.isBaseLayer&&c.map?c.map.setBaseLayer(c):c.setVisibility(b);delete this._visibilityChanging}},
onMapMoveend:function(){this.autoDisable&&(!1===this.layer.inRange?this.disable():this.enable())},addStoreEventHandlers:function(){this.layerStore.on({add:this.onStoreAdd,remove:this.onStoreRemove,update:this.onStoreUpdate,scope:this})},onStoreAdd:function(a,b){for(var c,d=0;d<b.length;++d)if(c=b[d].getLayer(),this.layer==c){this.getUI().show();break}else if(this.layer==c.name){this.render();break}},onStoreRemove:function(a,b){this.layer==b.getLayer()&&this.getUI().hide()},onStoreUpdate:function(a,
b){var c=b.getLayer();!this.fixedText&&this.layer==c&&this.text!==c.name&&this.setText(c.name)},destroy:function(){var a=this.layer;a instanceof OpenLayers.Layer&&(a.map&&a.map.events.unregister("moveend",this,this.onMapMoveend),a.events.un({visibilitychanged:this.onLayerVisibilityChanged,scope:this}));delete this.layer;if(a=this.layerStore)a.un("add",this.onStoreAdd,this),a.un("remove",this.onStoreRemove,this),a.un("update",this.onStoreUpdate,this);delete this.layerStore;this.un("checkchange",this.onCheckChange,
this);GeoExt.tree.LayerNode.superclass.destroy.apply(this,arguments)}});Ext.tree.TreePanel.nodeTypes.gx_layer=GeoExt.tree.LayerNode;Ext.namespace("GeoExt.tree");
GeoExt.tree.BaseLayerContainer=Ext.extend(GeoExt.tree.LayerContainer,{text:"Base Layer",constructor:function(a){a=Ext.applyIf(a||{},{text:this.text,loader:{}});a.loader=Ext.applyIf(a.loader,{baseAttrs:Ext.applyIf(a.loader.baseAttrs||{},{iconCls:"gx-tree-baselayer-icon",checkedGroup:"baselayer"}),filter:function(a){a=a.getLayer();return!0===a.displayInLayerSwitcher&&!0===a.isBaseLayer}});GeoExt.tree.BaseLayerContainer.superclass.constructor.call(this,a)}});
Ext.tree.TreePanel.nodeTypes.gx_baselayercontainer=GeoExt.tree.BaseLayerContainer;Ext.namespace("GeoExt.tree");GeoExt.tree.OverlayLayerContainer=Ext.extend(GeoExt.tree.LayerContainer,{text:"Overlays",constructor:function(a){a=Ext.applyIf(a||{},{text:this.text});a.loader=Ext.applyIf(a.loader||{},{filter:function(a){a=a.getLayer();return!0===a.displayInLayerSwitcher&&!1===a.isBaseLayer}});GeoExt.tree.OverlayLayerContainer.superclass.constructor.call(this,a)}});
Ext.tree.TreePanel.nodeTypes.gx_overlaylayercontainer=GeoExt.tree.OverlayLayerContainer;Ext.namespace("GeoExt.tree");
GeoExt.tree.TreeNodeUIEventMixin=function(){return{constructor:function(a){a.addEvents("rendernode","rawclicknode");this.superclass=arguments.callee.superclass;this.superclass.constructor.apply(this,arguments)},render:function(a){this.rendered||(this.superclass.render.apply(this,arguments),this.fireEvent("rendernode",this.node))},onClick:function(a){!1!==this.fireEvent("rawclicknode",this.node,a)&&this.superclass.onClick.apply(this,arguments)}}};Ext.namespace("GeoExt.grid");
GeoExt.grid.FeatureSelectionModelMixin=function(){return{autoActivateControl:!0,layerFromStore:!0,selectControl:null,bound:!1,superclass:null,selectedFeatures:[],autoPanMapOnSelection:!1,constructor:function(a){a=a||{};if(a.selectControl instanceof OpenLayers.Control.SelectFeature){if(!a.singleSelect){var b=a.selectControl;a.singleSelect=!(b.multiple||b.multipleKey)}}else if(a.layer instanceof OpenLayers.Layer.Vector)this.selectControl=this.createSelectControl(a.layer,a.selectControl),delete a.layer,
delete a.selectControl;if(a.autoPanMapOnSelection)this.autoPanMapOnSelection=!0,delete a.autoPanMapOnSelection;this.superclass=arguments.callee.superclass;this.superclass.constructor.call(this,a)},initEvents:function(){this.superclass.initEvents.call(this);if(this.layerFromStore){var a=this.grid.getStore()&&this.grid.getStore().layer;if(a&&!(this.selectControl instanceof OpenLayers.Control.SelectFeature))this.selectControl=this.createSelectControl(a,this.selectControl)}this.selectControl&&this.bind(this.selectControl)},
createSelectControl:function(a,b){var b=b||{},b=OpenLayers.Util.extend({toggle:!0,multipleKey:(void 0!==b.singleSelect?b.singleSelect:this.singleSelect)?null:Ext.isMac?"metaKey":"ctrlKey"},b),c=new OpenLayers.Control.SelectFeature(a,b);a.map.addControl(c);return c},bind:function(a,b){if(!this.bound){b=b||{};this.selectControl=a;if(a instanceof OpenLayers.Layer.Vector)this.selectControl=this.createSelectControl(a,b.controlConfig);this.autoActivateControl&&this.selectControl.activate();for(var c=this.getLayers(),
d=0,e=c.length;d<e;d++)c[d].events.on({featureselected:this.featureSelected,featureunselected:this.featureUnselected,scope:this});this.on("rowselect",this.rowSelected,this);this.on("rowdeselect",this.rowDeselected,this);this.bound=!0}return this.selectControl},unbind:function(){var a=this.selectControl;if(this.bound){for(var b=this.getLayers(),c=0,d=b.length;c<d;c++)b[c].events.un({featureselected:this.featureSelected,featureunselected:this.featureUnselected,scope:this});this.un("rowselect",this.rowSelected,
this);this.un("rowdeselect",this.rowDeselected,this);this.autoActivateControl&&a.deactivate();this.selectControl=null;this.bound=!1}return a},featureSelected:function(a){if(!this._selecting){var b=this.grid.store.findBy(function(b){return b.getFeature()==a.feature});if(-1!=b&&!this.isSelected(b))this._selecting=!0,this.selectRow(b,!this.singleSelect),this._selecting=!1,this.grid.getView().focusRow(b)}},featureUnselected:function(a){if(!this._selecting){var b=this.grid.store.findBy(function(b){return b.getFeature()==
a.feature});if(-1!=b&&this.isSelected(b))this._selecting=!0,this.deselectRow(b),this._selecting=!1,this.grid.getView().focusRow(b)}},rowSelected:function(a,b,c){a=c.getFeature();if(!this._selecting&&a){for(var b=this.getLayers(),c=0,d=b.length;c<d;c++)if(-1==b[c].selectedFeatures.indexOf(a)){this._selecting=!0;this.selectControl.select(a);this._selecting=!1;this.selectedFeatures.push(a);break}this.autoPanMapOnSelection&&this.recenterToSelectionExtent()}},rowDeselected:function(a,b,c){a=c.getFeature();
if(!this._selecting&&a){for(var b=this.getLayers(),c=0,d=b.length;c<d;c++)if(-1!=b[c].selectedFeatures.indexOf(a)){this._selecting=!0;this.selectControl.unselect(a);this._selecting=!1;OpenLayers.Util.removeItem(this.selectedFeatures,a);break}this.autoPanMapOnSelection&&0<this.selectedFeatures.length&&this.recenterToSelectionExtent()}},getLayers:function(){return this.selectControl.layers||[this.selectControl.layer]},recenterToSelectionExtent:function(){var a=this.selectControl.map,b=this.getSelectionExtent();
a.getZoomForExtent(b,!1)>a.getZoom()?a.setCenter(b.getCenterLonLat()):a.zoomToExtent(b)},getSelectionExtent:function(){var a=null,b=this.selectedFeatures;if(b&&0<b.length)for(var c=null,d=0,e=b.length;d<e;d++)if(c=b[d].geometry)null===a&&(a=new OpenLayers.Bounds),a.extend(c.getBounds());return a}}};GeoExt.grid.FeatureSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,new GeoExt.grid.FeatureSelectionModelMixin);Ext.namespace("GeoExt");
GeoExt.Popup=Ext.extend(Ext.Window,{anchored:!0,map:null,panIn:!0,unpinnable:!0,location:null,insideViewport:null,animCollapse:!1,draggable:!1,shadow:!1,popupCls:"gx-popup",ancCls:null,anchorPosition:"auto",initComponent:function(){if(this.map instanceof GeoExt.MapPanel)this.map=this.map.map;if(!this.map&&this.location instanceof OpenLayers.Feature.Vector&&this.location.layer)this.map=this.location.layer.map;if(this.location instanceof OpenLayers.Feature.Vector)this.location=this.location.geometry;
if(this.location instanceof OpenLayers.Geometry){if("function"==typeof this.location.getCentroid)this.location=this.location.getCentroid();this.location=this.location.getBounds().getCenterLonLat()}else if(this.location instanceof OpenLayers.Pixel)this.location=this.map.getLonLatFromViewPortPx(this.location);if(!(this.location instanceof OpenLayers.LonLat))this.anchored=!1;var a=this.map.getExtent();if(a&&this.location)this.insideViewport=a.containsLonLat(this.location);this.anchored?(this.addAnchorEvents(),
this.elements+=",anc"):this.unpinnable=!1;this.baseCls=this.popupCls+" "+this.baseCls;GeoExt.Popup.superclass.initComponent.call(this)},onRender:function(a,b){GeoExt.Popup.superclass.onRender.call(this,a,b);this.anchored?(this.ancCls=this.popupCls+"-anc",this.createElement("anc",this.el.dom)):this.makeDraggable()},initTools:function(){this.unpinnable&&this.addTool({id:"unpin",handler:this.unanchorPopup.createDelegate(this,[])});GeoExt.Popup.superclass.initTools.call(this)},show:function(){GeoExt.Popup.superclass.show.apply(this,
arguments);this.anchored&&(this.position(),this.panIn&&!this._mapMove&&this.panIntoView())},maximize:function(){!this.maximized&&this.anc&&this.unanchorPopup();GeoExt.Popup.superclass.maximize.apply(this,arguments)},setSize:function(a,b){if(this.anc){var c=this.anc.getSize();"object"==typeof a?(b=a.height-c.height,a=a.width):isNaN(b)||(b-=c.height)}GeoExt.Popup.superclass.setSize.call(this,a,b)},position:function(){var a=this;if(!0===a._mapMove)a.insideViewport=a.map.getExtent().containsLonLat(a.location),
a.insideViewport!==a.isVisible()&&a.setVisible(a.insideViewport);if(a.isVisible()){var b=a.map.getPixelFromLonLat(a.location),c=Ext.fly(a.map.div).getBox(!0),d=b.y+c.y,e=b.x+c.x,f=a.el.getSize(),g=a.anc.getSize(),h=a.anchorPosition;if(-1<h.indexOf("right")||b.x>c.width/2){a.anc.addClass("right");var j=a.el.getX(!0)+f.width-a.anc.getX(!0)-g.width,e=e-(f.width-j-g.width/2)}else a.anc.removeClass("right"),j=a.anc.getLeft(!0),e-=j+g.width/2;-1<h.indexOf("bottom")||b.y>c.height/2?(a.anc.removeClass("top"),
d-=f.height+g.height):(a.anc.addClass("top"),d+=g.height);a.setPagePosition(e,d);window.setTimeout(function(){a.el.dom&&a.setPagePosition(e,d)},0)}},makeDraggable:function(){this.draggable=!0;this.header.addClass("x-window-draggable");this.dd=new Ext.Window.DD(this)},unanchorPopup:function(){this.removeAnchorEvents();this.makeDraggable();this.anc.remove();this.anc=null;this.tools.unpin.hide()},panIntoView:function(){var a=Ext.fly(this.map.div).getBox(!0),b=this.getPosition(!0);b[0]-=a.x;b[1]-=a.y;
var a=[a.width,a.height],c=this.getSize(),d=[b[0],b[1]],e=this.map.paddingForPopups;b[0]<e.left?d[0]=e.left:b[0]+c.width>a[0]-e.right&&(d[0]=a[0]-e.right-c.width);b[1]<e.top?d[1]=e.top:b[1]+c.height>a[1]-e.bottom&&(d[1]=a[1]-e.bottom-c.height);this.map.pan(b[0]-d[0],b[1]-d[1])},onMapMove:function(){if(!this.hidden||!this.insideViewport)this._mapMove=!0,this.position(),delete this._mapMove},addAnchorEvents:function(){this.map.events.on({move:this.onMapMove,scope:this});this.on({resize:this.position,
collapse:this.position,expand:this.position,scope:this})},removeAnchorEvents:function(){this.map.events.un({move:this.onMapMove,scope:this});this.un("resize",this.position,this);this.un("collapse",this.position,this);this.un("expand",this.position,this)},beforeDestroy:function(){this.anchored&&this.removeAnchorEvents();GeoExt.Popup.superclass.beforeDestroy.call(this)}});Ext.reg("gx_popup",GeoExt.Popup);Ext.namespace("GeoExt");
GeoExt.MapPanel=Ext.extend(Ext.Panel,{map:null,layers:null,center:null,zoom:null,extent:null,prettyStateKeys:!1,stateEvents:"aftermapmove,afterlayervisibilitychange,afterlayeropacitychange,afterlayerorderchange,afterlayernamechange,afterlayeradd,afterlayerremove".split(","),initComponent:function(){if(!(this.map instanceof OpenLayers.Map))this.map=new OpenLayers.Map(Ext.applyIf(this.map||{},{allOverlays:!0,fallThrough:!0}));var a=this.layers;if(!a||a instanceof Array)this.layers=new GeoExt.data.LayerStore({layers:a,
map:0<this.map.layers.length?this.map:null});if("string"==typeof this.center)this.center=OpenLayers.LonLat.fromString(this.center);else if(this.center instanceof Array)this.center=new OpenLayers.LonLat(this.center[0],this.center[1]);if("string"==typeof this.extent)this.extent=OpenLayers.Bounds.fromString(this.extent);else if(this.extent instanceof Array)this.extent=OpenLayers.Bounds.fromArray(this.extent);GeoExt.MapPanel.superclass.initComponent.call(this);this.addEvents("aftermapmove","afterlayervisibilitychange",
"afterlayeropacitychange","afterlayerorderchange","afterlayernamechange","afterlayeradd","afterlayerremove");this.map.events.on({moveend:this.onMoveend,changelayer:this.onChangelayer,addlayer:this.onAddlayer,removelayer:this.onRemovelayer,scope:this});this.on("afterlayout",function(){"function"===typeof this.map.getViewport&&this.items.each(function(a){"function"===typeof a.addToMapPanel&&a.getEl().appendTo(this.map.getViewport())},this)},this)},onMoveend:function(){this.fireEvent("aftermapmove")},
onChangelayer:function(a){a.property&&("visibility"===a.property?this.fireEvent("afterlayervisibilitychange"):"order"===a.property?this.fireEvent("afterlayerorderchange"):"name"===a.property?this.fireEvent("afterlayernamechange"):"opacity"===a.property&&this.fireEvent("afterlayeropacitychange"))},onAddlayer:function(){this.fireEvent("afterlayeradd")},onRemovelayer:function(){this.fireEvent("afterlayerremove")},applyState:function(a){if("x"in a&&"y"in a)this.center=new OpenLayers.LonLat(a.x,a.y);if("zoom"in
a)this.zoom=a.zoom;var b,c,d,e,f,g=this.map.layers;for(b=0,c=g.length;b<c;b++)d=g[b],e=this.prettyStateKeys?d.name:d.id,f=a["visibility_"+e],void 0!==f&&(f=/^true$/i.test(f),d.isBaseLayer?f&&this.map.setBaseLayer(d):d.setVisibility(f)),e=a["opacity_"+e],void 0!==e&&d.setOpacity(e)},getState:function(){var a;if(this.map){a=(a=this.map.getCenter())?{x:a.lon,y:a.lat,zoom:this.map.getZoom()}:{};var b,c,d,e,f=this.map.layers;for(b=0,c=f.length;b<c;b++)d=f[b],e=this.prettyStateKeys?d.name:d.id,a["visibility_"+
e]=d.getVisibility(),a["opacity_"+e]=null==d.opacity?1:d.opacity;return a}},updateMapSize:function(){this.map&&this.map.updateSize()},renderMap:function(){var a=this.map;a.render(this.body.dom);this.layers.bind(a);if(0<a.layers.length)this.setInitialExtent();else this.layers.on("add",this.setInitialExtent,this,{single:!0})},setInitialExtent:function(){var a=this.map;this.center||null!=this.zoom?a.setCenter(this.center,this.zoom):this.extent?a.zoomToExtent(this.extent):a.zoomToMaxExtent()},afterRender:function(){GeoExt.MapPanel.superclass.afterRender.apply(this,
arguments);this.ownerCt?(this.ownerCt.on("move",this.updateMapSize,this),this.ownerCt.on({afterlayout:this.afterLayout,scope:this})):this.renderMap()},afterLayout:function(){var a=this.getInnerWidth()-this.body.getBorderWidth("lr"),b=this.getInnerHeight()-this.body.getBorderWidth("tb");0<a&&0<b&&(this.ownerCt.un("afterlayout",this.afterLayout,this),this.renderMap())},onResize:function(){GeoExt.MapPanel.superclass.onResize.apply(this,arguments);this.updateMapSize()},onBeforeAdd:function(a){"function"===
typeof a.addToMapPanel&&a.addToMapPanel(this);GeoExt.MapPanel.superclass.onBeforeAdd.apply(this,arguments)},remove:function(a,b){"function"===typeof a.removeFromMapPanel&&a.removeFromMapPanel(this);GeoExt.MapPanel.superclass.remove.apply(this,arguments)},beforeDestroy:function(){this.ownerCt&&this.ownerCt.un("move",this.updateMapSize,this);this.map&&this.map.events&&this.map.events.un({moveend:this.onMoveend,changelayer:this.onChangelayer,addlayer:this.onAddlayer,removelayer:this.onRemovelayer,scope:this});
(!this.initialConfig.map||!(this.initialConfig.map instanceof OpenLayers.Map))&&this.map&&this.map.destroy&&this.map.destroy();delete this.map;GeoExt.MapPanel.superclass.beforeDestroy.apply(this,arguments)}});GeoExt.MapPanel.guess=function(){return Ext.ComponentMgr.all.find(function(a){return a instanceof GeoExt.MapPanel})};Ext.reg("gx_mappanel",GeoExt.MapPanel);Ext.namespace("GeoExt");
GeoExt.ZoomSlider=Ext.extend(Ext.slider.SingleSlider,{map:null,baseCls:"gx-zoomslider",aggressive:!1,updating:!1,initComponent:function(){GeoExt.ZoomSlider.superclass.initComponent.call(this);if(this.map){if(this.map instanceof GeoExt.MapPanel)this.map=this.map.map;this.bind(this.map)}if(!0===this.aggressive)this.on("change",this.changeHandler,this);else this.on("changecomplete",this.changeHandler,this);this.on("beforedestroy",this.unbind,this)},onRender:function(){GeoExt.ZoomSlider.superclass.onRender.apply(this,
arguments);this.el.addClass(this.baseCls)},afterRender:function(){Ext.slider.SingleSlider.superclass.afterRender.apply(this,arguments);this.update()},addToMapPanel:function(a){this.on({render:function(){var b=this.getEl();b.setStyle({position:"absolute",zIndex:a.map.Z_INDEX_BASE.Control});b.on({mousedown:this.stopMouseEvents,click:this.stopMouseEvents})},afterrender:function(){this.bind(a.map)},scope:this})},stopMouseEvents:function(a){a.stopEvent()},removeFromMapPanel:function(){var a=this.getEl();
a.un("mousedown",this.stopMouseEvents,this);a.un("click",this.stopMouseEvents,this);this.unbind()},bind:function(a){this.map=a;this.map.events.on({zoomend:this.onZoomEnd,updatesize:this.initZoomValues,changebaselayer:this.initZoomValues,scope:this});this.initZoomValues()},onZoomEnd:function(){this.update()},unbind:function(){this.map&&this.map.events&&this.map.events.un({zoomend:this.onZoomEnd,updatesize:this.initZoomValues,changebaselayer:this.initZoomValues,scope:this})},initZoomValues:function(){var a=
this.map.baseLayer;if(a){if(void 0===this.initialConfig.minValue){var b=this.map.getMinZoom?this.map.getMinZoom():0;this.minValue=Math.max(b,a.minZoomLevel||0)}if(void 0===this.initialConfig.maxValue)this.maxValue=null==a.minZoomLevel?a.numZoomLevels-1:a.maxZoomLevel;this.update(!0)}},getZoom:function(){return this.getValue()},getScale:function(){return OpenLayers.Util.getScaleFromResolution(this.map.getResolutionForZoom(this.getValue()),this.map.getUnits())},getResolution:function(){return this.map.getResolutionForZoom(this.getValue())},
changeHandler:function(){this.map&&!this.updating&&this.map.zoomTo(this.getValue())},update:function(a){if(this.rendered&&this.map){this.updating=!0;if(a)this.thumbs[0].value=null;this.setValue(this.map.getZoom());this.updating=!1}}});Ext.reg("gx_zoomslider",GeoExt.ZoomSlider);Ext.namespace("GeoExt.data");
GeoExt.data.LayerStoreMixin=function(){return{map:null,reader:null,constructor:function(a){a=a||{};a.reader=a.reader||new GeoExt.data.LayerReader({},a.fields);delete a.fields;var b=a.map instanceof GeoExt.MapPanel?a.map.map:a.map;delete a.map;if(a.layers)a.data=a.layers;delete a.layers;var c={initDir:a.initDir};delete a.initDir;arguments.callee.superclass.constructor.call(this,a);this.addEvents("bind");b&&this.bind(b,c)},bind:function(a,b){if(!this.map){this.map=a;var b=b||{},c=b.initDir;void 0==
b.initDir&&(c=GeoExt.data.LayerStore.MAP_TO_STORE|GeoExt.data.LayerStore.STORE_TO_MAP);var d=a.layers.slice(0);c&GeoExt.data.LayerStore.STORE_TO_MAP&&this.each(function(a){this.map.addLayer(a.getLayer())},this);c&GeoExt.data.LayerStore.MAP_TO_STORE&&this.loadData(d,!0);a.events.on({changelayer:this.onChangeLayer,addlayer:this.onAddLayer,removelayer:this.onRemoveLayer,scope:this});this.on({load:this.onLoad,clear:this.onClear,add:this.onAdd,remove:this.onRemove,update:this.onUpdate,scope:this});this.data.on({replace:this.onReplace,
scope:this});this.fireEvent("bind",this,a)}},unbind:function(){if(this.map)this.map.events.un({changelayer:this.onChangeLayer,addlayer:this.onAddLayer,removelayer:this.onRemoveLayer,scope:this}),this.un("load",this.onLoad,this),this.un("clear",this.onClear,this),this.un("add",this.onAdd,this),this.un("remove",this.onRemove,this),this.data.un("replace",this.onReplace,this),this.map=null},onChangeLayer:function(a){var b=a.layer,c=this.findBy(function(a){return a.getLayer()===b});if(-1<c){var d=this.getAt(c);
if("order"===a.property){if(!this._adding&&!this._removing&&(a=this.map.getLayerIndex(b),a!==c))this._removing=!0,this.remove(d),delete this._removing,this._adding=!0,this.insert(a,[d]),delete this._adding}else"name"===a.property?d.set("title",b.name):this.fireEvent("update",this,d,Ext.data.Record.EDIT)}},onAddLayer:function(a){if(!this._adding)a=a.layer,this._adding=!0,this.loadData([a],!0),delete this._adding},onRemoveLayer:function(a){if(this.map.unloadDestroy){if(!this._removing)a=a.layer,this._removing=
!0,this.remove(this.getById(a.id)),delete this._removing}else this.unbind()},onLoad:function(a,b,c){Ext.isArray(b)||(b=[b]);if(c&&!c.add){this._removing=!0;for(a=this.map.layers.length-1;0<=a;a--)this.map.removeLayer(this.map.layers[a]);delete this._removing;a=b.length;if(0<a){for(var c=Array(a),d=0;d<a;d++)c[d]=b[d].getLayer();this._adding=!0;this.map.addLayers(c);delete this._adding}}},onClear:function(){this._removing=!0;for(var a=this.map.layers.length-1;0<=a;a--)this.map.removeLayer(this.map.layers[a]);
delete this._removing},onAdd:function(a,b,c){if(!this._adding){this._adding=!0;for(var d=b.length-1;0<=d;--d)a=b[d].getLayer(),this.map.addLayer(a),c!==this.map.layers.length-1&&this.map.setLayerIndex(a,c);delete this._adding}},onRemove:function(a,b){if(!this._removing&&null!=this.map.getLayer(b.getLayer().id))this._removing=!0,this.removeMapLayer(b),delete this._removing},onUpdate:function(a,b,c){c===Ext.data.Record.EDIT&&b.modified&&b.modified.title&&(a=b.getLayer(),b=b.get("title"),b!==a.name&&
a.setName(b))},removeMapLayer:function(a){this.map.removeLayer(a.getLayer())},onReplace:function(a,b){this.removeMapLayer(b)},getByLayer:function(a){var b=this.findBy(function(b){return b.getLayer()===a});if(-1<b)return this.getAt(b)},destroy:function(){this.unbind();GeoExt.data.LayerStore.superclass.destroy.call(this)}}};GeoExt.data.LayerStore=Ext.extend(Ext.data.Store,new GeoExt.data.LayerStoreMixin);GeoExt.data.LayerStore.MAP_TO_STORE=1;GeoExt.data.LayerStore.STORE_TO_MAP=2;
Ext.namespace("GeoExt","GeoExt.data");GeoExt.data.LayerReader=function(a,b){a=a||{};b instanceof Function||(b=GeoExt.data.LayerRecord.create(b||a.fields||{}));GeoExt.data.LayerReader.superclass.constructor.call(this,a,b)};
Ext.extend(GeoExt.data.LayerReader,Ext.data.DataReader,{totalRecords:null,readRecords:function(a){var b=[];if(a){var c=this.recordType,d=c.prototype.fields,e,f,g,h,j,k,l,n;for(e=0,f=a.length;e<f;e++){j=a[e];k={};for(g=0,h=d.length;g<h;g++)l=d.items[g],n=j[l.mapping||l.name]||l.defaultValue,n=l.convert(n),k[l.name]=n;k.layer=j;b[b.length]=new c(k,j.id)}}return{records:b,totalRecords:null!=this.totalRecords?this.totalRecords:b.length}}});Ext.namespace("GeoExt.data");
GeoExt.data.ScaleStore=Ext.extend(Ext.data.Store,{map:null,constructor:function(a){var b=a.map instanceof GeoExt.MapPanel?a.map.map:a.map;delete a.map;a=Ext.applyIf(a,{reader:new Ext.data.JsonReader({},["level","resolution","scale"])});GeoExt.data.ScaleStore.superclass.constructor.call(this,a);b&&this.bind(b)},bind:function(a){this.map=a instanceof GeoExt.MapPanel?a.map:a;this.map.events.register("changebaselayer",this,this.populateFromMap);this.map.baseLayer?this.populateFromMap():this.map.events.register("addlayer",
this,this.populateOnAdd)},unbind:function(){this.map&&(this.map.events.unregister("addlayer",this,this.populateOnAdd),this.map.events.unregister("changebaselayer",this,this.populateFromMap),delete this.map)},populateOnAdd:function(a){a.layer.isBaseLayer&&(this.populateFromMap(),this.map.events.unregister("addlayer",this,this.populateOnAdd))},populateFromMap:function(){for(var a=[],b=this.map.baseLayer.resolutions,c=this.map.baseLayer.units,d=b.length-1;0<=d;d--){var e=b[d];a.push({level:d,resolution:e,
scale:OpenLayers.Util.getScaleFromResolution(e,c)})}this.loadData(a)},destroy:function(){this.unbind();GeoExt.data.ScaleStore.superclass.destroy.apply(this,arguments)}});Ext.namespace("GeoExt.data");
GeoExt.data.PrintProviderBase=Ext.extend(Ext.util.Observable,{url:null,capabilities:null,method:"POST",encoding:document.charset||document.characterSet||"UTF-8",timeout:3E4,customParams:null,scales:null,dpis:null,outputFormats:null,outputFormatsEnabled:!1,layouts:null,dpi:null,layout:null,outputFormat:null,defaultOutputFormatName:"pdf",attributes:null,typesAttributes:null,constructor:function(a){this.initialConfig=a;Ext.apply(this,a);Ext.apply(this.encoders.layers,this.encodersOverride.layers);Ext.apply(this.encoders.legends,
this.encodersOverride.legends);Ext.applyIf(this,{attributes:[],typesAttributes:{}});if(!this.customParams)this.customParams={};this.addEvents("loadcapabilities","layoutchange","dpichange","outputformatchange","beforeprint","print","printexception","invalidspec","beforeencodelayer","encodelayer","beforedownload","beforeencodelegend");GeoExt.data.PrintProviderBase.superclass.constructor.apply(this,arguments);this.buildStores();a.capabilities?this.loadStores():(this.url.split("/").pop()&&(this.url+=
"/"),this.autoLoad&&this.loadCapabilities())},setLayout:function(a){this.layout=a;this.fireEvent("layoutchange",this,a)},setDpi:function(a){this.dpi=a;this.fireEvent("dpichange",this,a)},setOutputFormat:function(a){this.outputFormat=a;this.fireEvent("outputformatchange",this,a)},download:function(a){if(!1!==this.fireEvent("beforedownload",this,a))Ext.isOpera?window.open(a):window.location.href=a;this.fireEvent("print",this,a)},loadCapabilities:function(){if(this.url){var a=this.getCapabilitiesURL();
Ext.Ajax.request({url:a,method:"GET",disableCaching:!1,success:function(a){this.capabilities=Ext.decode(a.responseText);this.loadStores()},params:this.baseParams,scope:this})}},encodeLayer:function(a,b){var c,d;for(d in this.encoders.layers)if(OpenLayers.Layer[d]&&a instanceof OpenLayers.Layer[d]){if(!1===this.fireEvent("beforeencodelayer",this,a))return;c=this.encoders.layers[d].call(this,a,b);this.fireEvent("encodelayer",this,a,c);break}return c&&c.type?c:null},validatePrintOptions:function(){return!0},
print:function(a,b,c,d){if(a instanceof GeoExt.MapPanel)a=a.map;b=b instanceof Array?b:[b];c=c||{};if(!1!==this.fireEvent("beforeprint",this,a,b,c)&&this.validatePrintOptions(b)){var e=new OpenLayers.Bounds;Ext.each(b,function(b){e.extend(b.calculateEnclosingPageBounds(b.scale,a.getUnits()))});var f=b[0].feature.layer,g=a.layers.concat();g.remove(a.baseLayer);g.unshift(a.baseLayer);var h=[];Ext.each(g,function(a){a!==f&&!0===a.getVisibility()&&(a=this.encodeLayer(a,e))&&h.push(a)},this);(g=GeoExt.data.MapFishPrintv3Provider&&
this instanceof GeoExt.data.MapFishPrintv3Provider)&&h.reverse();var j=null;c.overview&&(j=[],Ext.each(c.overview.layers,function(a){(a=this.encodeLayer(a,e))&&j.push(a)},this),g&&j.reverse());var k=void 0;if(c.legend&&!0===this.fireEvent("beforeencodelegend",this,c.legend))k=[],c=c.legend,(g=c.rendered)||(c=c.cloneConfig({renderTo:document.body,hidden:!0})),c.items&&c.items.each(function(a){if(!a.hidden){var c=this.encoders.legends[a.getXType()];k=k.concat(c.call(this,a,b[0].scale.get("value")))}},
this),g||c.destroy();this.requestPrint(a,b,h,j,k,d)}},getAbsoluteUrl:function(a){var a=encodeURI(a),b;Ext.isIE6||Ext.isIE7||Ext.isIE8?(b=document.createElement("<a href='"+a+"'/>"),b.style.display="none",document.body.appendChild(b),b.href=b.href,document.body.removeChild(b)):(b=document.createElement("a"),b.href=a);return decodeURI(b.href)},encoders:{features:{GeoJsonWithStyle:function(a,b){var c={},d=[],e=new OpenLayers.Format.JSON,f=new OpenLayers.Format.GeoJSON,g=1,h={};Ext.each(a.features,function(j){var k=
j.style||a.style||a.styleMap.createSymbolizer(j,j.renderIntent);if("none"!=k.display&&j.geometry){if(j.geometry instanceof OpenLayers.Geometry.Point){if(!b.contains(j.geometry.x,j.geometry.y))return}else if(!j.geometry.bounds||!b.toGeometry().intersects(j.geometry.bounds.toGeometry()))return;var l=e.write(k),n=h[l],m=n;n||(h[l]=m=g++,c[m]=k.externalGraphic?Ext.applyIf({externalGraphic:this.getAbsoluteUrl(k.externalGraphic)},k):k);j=f.extract.feature.call(f,j);j.properties=OpenLayers.Util.extend({_gx_style:m},
j.properties);d.push(j)}},this);return{styles:c,geoJson:{type:"FeatureCollection",features:d}}}},layers:{_Layer:function(a){var b={};if(a.options&&a.options.maxScale)b.minScaleDenominator=a.options.maxScale;if(a.options&&a.options.minScale)b.maxScaleDenominator=a.options.minScale;return b},_HTTPRequest:function(a){var b=this.encoders.layers._Layer.call(this,a);return Ext.apply(b,{baseURL:this.getAbsoluteUrl(a.url instanceof Array?a.url[0]:a.url),opacity:null!=a.opacity?a.opacity:1})}},legends:{gx_wmslegend:function(a,
b){for(var c=this.encoders.legends.base.call(this,a),d=[],e=1,f=a.items.getCount();e<f;++e){var g=a.items.get(e).url;if(!0===a.useScaleParameter&&-1!=g.toLowerCase().indexOf("request=getlegendgraphic")){var g=g.split("?"),h=Ext.urlDecode(g[1]);h.SCALE=b;g=g[0]+"?"+Ext.urlEncode(h)}d.push(this.getAbsoluteUrl(g))}c[0].classes[0]={name:"",icons:d};return c},gx_wmtslegend:function(a){return this.encoders.legends.gx_urllegend.call(this,a)},gx_urllegend:function(a){var b=this.encoders.legends.base.call(this,
a);b[0].classes.push({name:"",icon:this.getAbsoluteUrl(a.items.get(1).url)});return b},base:function(a){return[{name:a.getLabel(),classes:[]}]}}},encodersOverride:{layers:{},legends:{}},supportProgress:function(){return!1},setAttributes:function(a){this.attributes=a;this.typesAttributes={};Ext.each(a,function(a){this.typesAttributes[a.type]||(this.typesAttributes[a.type]=[]);this.typesAttributes[a.type].push(a)},this)},getAttributes:function(){return this.attributes},getAttributesByType:function(a){return this.typesAttributes[a]}});
Ext.namespace("GeoExt.data");
GeoExt.data.PrintProvider=Ext.extend(GeoExt.data.PrintProviderBase,{constructor:function(a){GeoExt.data.PrintProvider.superclass.constructor.apply(this,arguments);a.attributes&&this.setAttributes(a.attributes)},buildStores:function(){this.scales=new Ext.data.JsonStore({root:"scales",sortInfo:{field:"value",direction:"DESC"},fields:["name",{name:"value",type:"float"}]});this.dpis=new Ext.data.JsonStore({root:"dpis",fields:["name",{name:"value",type:"float"}]});if(!0===this.outputFormatsEnabled)this.outputFormats=
new Ext.data.JsonStore({root:"outputFormats",sortInfo:{field:"name",direction:"ASC"},fields:["name"]});this.layouts=new Ext.data.JsonStore({root:"layouts",fields:["name",{name:"size",mapping:"map"},{name:"rotation",type:"boolean"}]});this.attributes=new Ext.data.JsonStore({root:"attributes",fields:["name","type"]})},getCapabilitiesURL:function(){return this.url+"info.json"},loadStores:function(){this.scales.loadData(this.capabilities);this.dpis.loadData(this.capabilities);this.layouts.loadData(this.capabilities);
this.setLayout(this.layouts.getAt(0));this.setDpi(this.dpis.getAt(0));if(this.outputFormatsEnabled&&this.capabilities.outputFormats){this.outputFormats.loadData(this.capabilities);var a=this.outputFormats.find("name",this.defaultOutputFormatName);this.setOutputFormat(-1<a?this.outputFormats.getAt(a):this.outputFormats.getAt(0))}this.fireEvent("loadcapabilities",this,this.capabilities)},requestPrint:function(a,b,c,d,e){a=Ext.apply({units:a.getUnits(),srs:a.baseLayer.projection.getCode(),layout:this.layout.get("name"),
dpi:this.dpi.get("value"),outputFormat:this.outputFormat?this.outputFormat.get("name"):this.defaultOutputFormatName},this.customParams);a.layers=c;if(d)a.overviewLayers=d;var f=[];Ext.each(b,function(a){f.push(Ext.apply({center:[a.center.lon,a.center.lat],scale:a.scale.get("value"),rotation:a.rotation},a.customParams))},this);a.pages=f;if(e)a.legends=e;"GET"===this.method?this.download(Ext.urlAppend(this.capabilities.printURL,"spec="+encodeURIComponent(Ext.encode(a)))):Ext.Ajax.request({url:this.capabilities.createURL,
timeout:this.timeout,jsonData:a,headers:{"Content-Type":"application/json; charset="+this.encoding},success:function(a){this.download(Ext.decode(a.responseText).getURL)},failure:function(a){this.fireEvent("printexception",this,a)},params:this.baseParams,scope:this})},encodersOverride:{layers:{WMS:function(a){var b=this.encoders.layers._HTTPRequest.call(this,a);b.singleTile=a.singleTile;Ext.apply(b,{type:"WMS",layers:(""+a.params.LAYERS).split(","),format:a.params.FORMAT,styles:(""+a.params.STYLES).split(","),
singleTile:a.singleTile});var c,d;for(d in a.params)if(c=d.toLowerCase(),null!=a.params[d]&&!a.DEFAULT_PARAMS[c]&&-1=="layers,styles,width,height,srs".indexOf(c)){if(!b.customParams)b.customParams={};b.customParams[d]=a.params[d]}return b},OSM:function(a){a=this.encoders.layers.TileCache.call(this,a);return Ext.apply(a,{type:"OSM",baseURL:a.baseURL.substr(0,a.baseURL.indexOf("$")),extension:"png"})},TMS:function(a){var b=this.encoders.layers.TileCache.call(this,a);return Ext.apply(b,{type:"TMS",format:a.type})},
TileCache:function(a){var b=this.encoders.layers._HTTPRequest.call(this,a);return Ext.apply(b,{type:"TileCache",layer:a.layername,maxExtent:a.maxExtent.toArray(),tileSize:[a.tileSize.w,a.tileSize.h],extension:a.extension,resolutions:a.serverResolutions||a.resolutions})},WMTS:function(a){var b=this.encoders.layers._HTTPRequest.call(this,a);b.baseURL=encodeURI(b.baseURL);b=Ext.apply(b,{type:"WMTS",layer:a.layer,version:a.version,requestEncoding:a.requestEncoding,style:a.style,dimensions:a.dimensions,
params:a.params,matrixSet:a.matrixSet});if(a.matrixIds){if("KVP"==a.requestEncoding)b.format=a.format;b.matrixIds=[];Ext.each(a.matrixIds,function(c){b.matrixIds.push({identifier:c.identifier,matrixSize:[c.matrixWidth,c.matrixHeight],resolution:2.8E-4*c.scaleDenominator/OpenLayers.METERS_PER_INCH/OpenLayers.INCHES_PER_UNIT[a.units],tileSize:[c.tileWidth,c.tileHeight],topLeftCorner:[c.topLeftCorner.lon,c.topLeftCorner.lat]})});return b}return Ext.apply(b,{formatSuffix:a.formatSuffix,tileOrigin:[a.tileOrigin.lon,
a.tileOrigin.lat],tileSize:[a.tileSize.w,a.tileSize.h],maxExtent:a.maxExtent.toArray(),zoomOffset:a.zoomOffset,resolutions:a.serverResolutions||a.resolutions})},KaMapCache:function(a){var b=this.encoders.layers.KaMap.call(this,a);return Ext.apply(b,{type:"KaMapCache",group:a.params.g,metaTileWidth:a.params.metaTileSize.w,metaTileHeight:a.params.metaTileSize.h})},KaMap:function(a){var b=this.encoders.layers._HTTPRequest.call(this,a);return Ext.apply(b,{type:"KaMap",map:a.params.map,extension:a.params.i,
group:a.params.g||"",maxExtent:a.maxExtent.toArray(),tileSize:[a.tileSize.w,a.tileSize.h],resolutions:a.serverResolutions||a.resolutions})},Markers:function(a,b){for(var c=[],d=0,e=a.markers.length;d<e;d++){var f=a.markers[d],g=new OpenLayers.Geometry.Point(f.lonlat.lon,f.lonlat.lat),f=new OpenLayers.Feature.Vector(g,{},{externalGraphic:f.icon.url,graphicWidth:f.icon.size.w,graphicHeight:f.icon.size.h,graphicXOffset:f.icon.offset.x,graphicYOffset:f.icon.offset.y});c.push(f)}d=new OpenLayers.Layer.Vector(a.name);
d.addFeatures(c);c=this.encoders.layers.Vector.call(this,d,b);d.destroy();return c},Image:function(a){var b=this.encoders.layers._Layer.call(this,a);return Ext.apply(b,{type:"Image",baseURL:this.getAbsoluteUrl(a.getURL(a.extent)),opacity:null!=a.opacity?a.opacity:1,extent:a.extent.toArray(),pixelSize:[a.size.w,a.size.h],name:a.name})},Vector:function(a,b){var c=this.encoders.features.GeoJsonWithStyle.call(this,a,b);if(0!==!c.geoJson.features.length)return Ext.apply(c,this.encoders.layers._Layer.call(this,
a)),Ext.apply(c,{type:"Vector",styleProperty:"_gx_style",name:a.name,opacity:null!=a.opacity?a.opacity:1})}},legends:{}}});Ext.namespace("GeoExt.data");
GeoExt.data.PrintPage=Ext.extend(Ext.util.Observable,{printProvider:null,feature:null,center:null,scale:null,rotation:0,customParams:null,constructor:function(a){this.initialConfig=a;Ext.apply(this,a);if(!this.customParams)this.customParams={};this.addEvents("change");GeoExt.data.PrintPage.superclass.constructor.apply(this,arguments);this.feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(-1,-1),new OpenLayers.Geometry.Point(1,
-1),new OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(-1,1)])]));if(this.printProvider.capabilities)this.setScale(this.printProvider.scales.getAt(0));else this.printProvider.on({loadcapabilities:function(){this.setScale(this.printProvider.scales.getAt(0))},scope:this,single:!0});this.printProvider.on({layoutchange:this.onLayoutChange,scope:this})},getPrintExtent:function(a){a=a instanceof GeoExt.MapPanel?a.map:a;return this.calculatePageBounds(this.scale,a.getUnits())},setScale:function(a,
b){var c=this.calculatePageBounds(a,b).toGeometry(),d=this.rotation;0!=d&&c.rotate(-d,c.getCentroid());this.updateFeature(c,{scale:a})},setCenter:function(a){var b=this.feature.geometry,c=b.getBounds().getCenterLonLat();b.move(a.lon-c.lon,a.lat-c.lat);this.updateFeature(b,{center:a})},setRotation:function(a,b){if(b||!0===this.printProvider.layout.get("rotation")){var c=this.feature.geometry;c.rotate(this.rotation-a,c.getCentroid());this.updateFeature(c,{rotation:a})}},fit:function(a,b){var b=b||{},
c=a,d;if(a instanceof GeoExt.MapPanel)c=a.map;else if(a instanceof OpenLayers.Feature.Vector)c=a.layer.map,d=a.geometry.getBounds();if(!d&&(d=c.getExtent(),!d))return;this._updating=!0;var e=d.getCenterLonLat();this.setCenter(e);var f=c.getUnits(),g=this.printProvider.scales.getAt(0),h=Number.POSITIVE_INFINITY,j=d.getWidth(),k=d.getHeight();this.printProvider.scales.each(function(a){var c=this.calculatePageBounds(a,f);if("closest"==b.mode)c=Math.abs(c.getWidth()-j)+Math.abs(c.getHeight()-k),c<h&&
(h=c,g=a);else{if((c="screen"==b.mode?!d.containsBounds(c):c.containsBounds(d))||"screen"==b.mode&&!c)g=a;return c}},this);this.setScale(g,f);delete this._updating;this.updateFeature(this.feature.geometry,{center:e,scale:g})},updateFeature:function(a,b){var c=this.feature,d=c.geometry!==a;a.id=c.geometry.id;c.geometry=a;if(!this._updating){for(var e in b)b[e]===this[e]?delete b[e]:(this[e]=b[e],d=!0);Ext.apply(this,b);c.layer&&c.layer.drawFeature(c);d&&this.fireEvent("change",this,b)}},calculatePageBounds:function(a,
b){var c=a.get("value"),d=this.feature,e=this.feature.geometry.getBounds().getCenterLonLat(),f=this.printProvider.layout.get("size"),b=b||d.layer&&d.layer.map&&d.layer.map.getUnits()||"dd",g=OpenLayers.INCHES_PER_UNIT[b],d=f.width/72/g*c/2,c=f.height/72/g*c/2;return new OpenLayers.Bounds(e.lon-d,e.lat-c,e.lon+d,e.lat+c)},calculateEnclosingPageBounds:function(a,b){var c=this.calculatePageBounds(a,b);if(0!=this.rotation){var d=c.toGeometry(),c=c.getCenterLonLat();d.rotate(this.rotation,new OpenLayers.Geometry.Point(c.lon,
c.lat));d.calculateBounds();c=d.getBounds()}return c},onLayoutChange:function(){!1===this.printProvider.layout.get("rotation")&&this.setRotation(0,!0);this.scale&&this.setScale(this.scale)},destroy:function(){this.printProvider.un("layoutchange",this.onLayoutChange,this)}});Ext.namespace("GeoExt.data");
GeoExt.data.WMSCapabilitiesReader=function(a,b){a=a||{};if(!a.format)a.format=new OpenLayers.Format.WMSCapabilities;"function"!==typeof b&&(b=GeoExt.data.LayerRecord.create(b||a.fields||[{name:"name",type:"string"},{name:"title",type:"string"},{name:"abstract",type:"string"},{name:"queryable",type:"boolean"},{name:"opaque",type:"boolean"},{name:"noSubsets",type:"boolean"},{name:"cascaded",type:"int"},{name:"fixedWidth",type:"int"},{name:"fixedHeight",type:"int"},{name:"minScale",type:"float"},{name:"maxScale",
type:"float"},{name:"prefix",type:"string"},{name:"formats"},{name:"styles"},{name:"srs"},{name:"dimensions"},{name:"bbox"},{name:"llbbox"},{name:"attribution"},{name:"keywords"},{name:"identifiers"},{name:"authorityURLs"},{name:"metadataURLs"},{name:"infoFormats"}]));GeoExt.data.WMSCapabilitiesReader.superclass.constructor.call(this,a,b)};
Ext.extend(GeoExt.data.WMSCapabilitiesReader,Ext.data.DataReader,{attributionCls:"gx-attribution",read:function(a){var b=a.responseXML;if(!b||!b.documentElement)b=a.responseText;return this.readRecords(b)},serviceExceptionFormat:function(a){return-1<OpenLayers.Util.indexOf(a,"application/vnd.ogc.se_inimage")?"application/vnd.ogc.se_inimage":-1<OpenLayers.Util.indexOf(a,"application/vnd.ogc.se_xml")?"application/vnd.ogc.se_xml":a[0]},imageFormat:function(a){var b=a.formats;return a.opaque&&-1<OpenLayers.Util.indexOf(b,
"image/jpeg")?"image/jpeg":-1<OpenLayers.Util.indexOf(b,"image/png")?"image/png":-1<OpenLayers.Util.indexOf(b,"image/png; mode=24bit")?"image/png; mode=24bit":-1<OpenLayers.Util.indexOf(b,"image/gif")?"image/gif":b[0]},imageTransparent:function(a){return void 0==a.opaque||!a.opaque},readRecords:function(a){if("string"===typeof a||a.nodeType)a=this.meta.format.read(a);if(a.error)throw new Ext.data.DataReader.Error("invalid-response",a.error);var b=a.version,c=a.capability||{},a=c.request&&c.request.getmap&&
c.request.getmap.href,d=c.layers,c=this.serviceExceptionFormat(c.exception?c.exception.formats:[]),e=[];if(a&&d)for(var f=this.recordType.prototype.fields,g,h,j,k,l=0,n=d.length;l<n;l++)if(g=d[l],g.name){h={};for(var m=0,o=f.length;m<o;m++)j=f.items[m],k=g[j.mapping||j.name]||j.defaultValue,k=j.convert(k),h[j.name]=k;j={attribution:g.attribution?this.meta.rawAttribution?g.attribution:this.attributionMarkup(g.attribution):void 0,minScale:g.minScale,maxScale:g.maxScale};this.meta.layerOptions&&Ext.apply(j,
this.meta.layerOptions);k={layers:g.name,exceptions:c,format:this.imageFormat(g),transparent:this.imageTransparent(g),version:b};this.meta.layerParams&&Ext.apply(k,this.meta.layerParams);h.layer=new OpenLayers.Layer.WMS(g.title||g.name,a,k,j);e.push(new this.recordType(h,h.layer.id))}return{totalRecords:e.length,success:!0,records:e}},attributionMarkup:function(a){var b=[];a.logo&&b.push("<img class='"+this.attributionCls+"-image' width='"+a.logo.width+"' height='"+a.logo.height+"' src='"+a.logo.href+
"' />");a.title&&b.push("<span class='"+this.attributionCls+"-title'>"+a.title+"</span>");if(a.href)for(var c=0;c<b.length;c++)b[c]="<a class='"+this.attributionCls+"-link' href="+a.href+">"+b[c]+"</a>";return b.join(" ")}});Ext.namespace("GeoExt.data");
GeoExt.data.WMSCapabilitiesStore=function(a){a=a||{};GeoExt.data.WMSCapabilitiesStore.superclass.constructor.call(this,Ext.apply(a,{proxy:a.proxy||(!a.data?new Ext.data.HttpProxy({url:a.url,disableCaching:!1,method:"GET"}):void 0),reader:new GeoExt.data.WMSCapabilitiesReader(a,a.fields)}))};Ext.extend(GeoExt.data.WMSCapabilitiesStore,Ext.data.Store);Ext.namespace("GeoExt.data");
GeoExt.data.WMSDescribeLayerStore=function(a){a=a||{};GeoExt.data.WMSDescribeLayerStore.superclass.constructor.call(this,Ext.apply(a,{proxy:a.proxy||(!a.data?new Ext.data.HttpProxy({url:a.url,disableCaching:!1,method:"GET"}):void 0),reader:new GeoExt.data.WMSDescribeLayerReader(a,a.fields)}))};Ext.extend(GeoExt.data.WMSDescribeLayerStore,Ext.data.Store);Ext.namespace("GeoExt.form");
GeoExt.form.toFilter=function(a,b,c){a instanceof Ext.form.FormPanel&&(a=a.getForm());var d=[],a=a.getValues(!1),e;for(e in a){var f=e.split("__"),g=a[e],h;1<f.length&&void 0!==(h=GeoExt.form.toFilter.FILTER_MAP[f[1]])?e=f[0]:h=OpenLayers.Filter.Comparison.EQUAL_TO;if(h===OpenLayers.Filter.Comparison.LIKE)switch(c){case GeoExt.form.ENDS_WITH:g=".*"+g;break;case GeoExt.form.STARTS_WITH:g+=".*";break;case GeoExt.form.CONTAINS:g=".*"+g+".*"}d.push(new OpenLayers.Filter.Comparison({type:h,value:g,property:e}))}return 1==
d.length&&b!=OpenLayers.Filter.Logical.NOT?d[0]:new OpenLayers.Filter.Logical({type:b||OpenLayers.Filter.Logical.AND,filters:d})};GeoExt.form.toFilter.FILTER_MAP={eq:OpenLayers.Filter.Comparison.EQUAL_TO,ne:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,lt:OpenLayers.Filter.Comparison.LESS_THAN,le:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,gt:OpenLayers.Filter.Comparison.GREATER_THAN,ge:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,like:OpenLayers.Filter.Comparison.LIKE};
GeoExt.form.ENDS_WITH=1;GeoExt.form.STARTS_WITH=2;GeoExt.form.CONTAINS=3;
GeoExt.form.recordToField=function(a,b){var b=b||{},c=a.get("type");if("object"===typeof c&&c.xtype)return c;var c=c.split(":").pop(),d,e=a.get("name"),f=a.get("restriction")||{},g=a.get("nillable")||!1,h=a.get("label"),j=b.labelTpl;j?h=(j instanceof Ext.Template?j:new Ext.XTemplate(j)).apply(a.data):null==h&&(h=e);e={name:e,labelStyle:g?"":null!=b.mandatoryFieldLabelStyle?b.mandatoryFieldLabelStyle:"font-weight:bold;"};j=GeoExt.form.recordToField.REGEXES;f.enumeration?d=Ext.apply({xtype:"combo",
fieldLabel:h,mode:"local",forceSelection:!0,triggerAction:"all",editable:!1,store:f.enumeration},e):c.match(j.text)?(c=void 0!==f.maxLength?parseFloat(f.maxLength):void 0,f=void 0!==f.minLength?parseFloat(f.minLength):void 0,d=Ext.apply({xtype:c>=b.minTextAreaMaxLength?"textarea":"textfield",fieldLabel:h,maxLength:c,minLength:f},e)):c.match(j["int"])||c.match(j["float"])?(d=void 0!==f.maxInclusive?parseFloat(f.maxInclusive):void 0,f=void 0!==f.minInclusive?parseFloat(f.minInclusive):void 0,d=Ext.apply({xtype:g?
"numberornullfield":"numberfield",allowDecimals:j["float"].test(c),decimalPrecision:-1,allowNegative:!j.positive.test(c),fieldLabel:h,maxValue:d,minValue:f},e)):c.match(j["boolean"])?(d=Ext.apply({xtype:"checkbox"},e),d[b.checkboxLabelProperty||"boxLabel"]=h):c.match(j.date)&&(d=Ext.apply({xtype:"datefield",fieldLabel:h,format:"date"==c?"Y-m-d":"c"},e));return d};
GeoExt.form.recordToField.REGEXES={text:/^(string|text|character)$/i,"int":RegExp("^(integer|long|int|short|byte|nonPositiveInteger|negativeInteger|nonNegativeInteger|positiveInteger|unsignedLong|unsignedInt|unsignedShort|unsignedByte)$","i"),"float":/^(float|double|decimal|number|real)$/i,positive:/^(nonNegativeInteger|positiveInteger|unsignedLong|unsignedInt|unsignedShort|unsignedByte)$/i,"boolean":/^(boolean)$/i,date:/^(date|dateTime)$/i};
GeoExt.form.NumberOrNullField=Ext.extend(Ext.form.NumberField,{getValue:function(){value=GeoExt.form.NumberOrNullField.superclass.getValue.apply(this,arguments);return""===value?null:value}});Ext.reg("numberornullfield",GeoExt.form.NumberOrNullField);Ext.namespace("GeoExt");
GeoExt.LegendPanel=Ext.extend(Ext.Panel,{dynamic:!0,layerStore:null,preferredTypes:null,filter:function(){return!0},onRender:function(){GeoExt.LegendPanel.superclass.onRender.apply(this,arguments);if(!this.layerStore)this.layerStore=GeoExt.MapPanel.guess().layers;this.layerStore.each(function(a){this.addLegend(a)},this);if(this.dynamic)this.layerStore.on({add:this.onStoreAdd,remove:this.onStoreRemove,clear:this.onStoreClear,scope:this})},recordIndexToPanelIndex:function(a){for(var b=this.layerStore,
c=-1,d=this.items?this.items.length:0,e,f,g=b.getCount()-1;0<=g&&!(e=b.getAt(g),f=e.getLayer(),e=GeoExt.LayerLegend.getTypes(e),f.displayInLayerSwitcher&&0<e.length&&!0!==b.getAt(g).get("hideInLegend")&&(++c,a===g||c>d-1));--g);return c},getIdForLayer:function(a){return this.id+"-"+a.id},onStoreAdd:function(a,b,c){for(var a=this.recordIndexToPanelIndex(c+b.length-1),c=0,d=b.length;c<d;c++)this.addLegend(b[c],a);this.doLayout()},onStoreRemove:function(a,b){this.removeLegend(b)},removeLegend:function(a){if(this.items&&
(a=this.getComponent(this.getIdForLayer(a.getLayer()))))this.remove(a,!0),this.doLayout()},onStoreClear:function(){this.removeAllLegends()},removeAllLegends:function(){this.removeAll(!0);this.doLayout()},addLegend:function(a,b){if(!0===this.filter(a)){var c=a.getLayer(),b=b||0,d=GeoExt.LayerLegend.getTypes(a,this.preferredTypes);c.displayInLayerSwitcher&&!a.get("hideInLegend")&&0<d.length&&this.insert(b,{xtype:d[0],id:this.getIdForLayer(c),layerRecord:a,hidden:!(!c.map&&c.visibility||c.getVisibility()&&
c.calculateInRange())})}},onDestroy:function(){this.layerStore&&(this.layerStore.un("add",this.onStoreAdd,this),this.layerStore.un("remove",this.onStoreRemove,this),this.layerStore.un("clear",this.onStoreClear,this));GeoExt.LegendPanel.superclass.onDestroy.apply(this,arguments)}});Ext.reg("gx_legendpanel",GeoExt.LegendPanel);Ext.namespace("GeoExt");
GeoExt.LayerLegend=Ext.extend(Ext.Container,{layerRecord:null,showTitle:!0,legendTitle:null,labelCls:null,layerStore:null,initComponent:function(){GeoExt.LayerLegend.superclass.initComponent.call(this);this.autoEl={};this.add({xtype:"label",html:this.getLayerTitle(this.layerRecord),cls:"x-form-item x-form-item-label"+(this.labelCls?" "+this.labelCls:"")});if(this.layerRecord&&this.layerRecord.store)this.layerStore=this.layerRecord.store,this.layerStore.on("update",this.onStoreUpdate,this),this.layerStore.on("add",
this.onStoreAdd,this),this.layerStore.on("remove",this.onStoreRemove,this)},getLabel:function(){var a=this.items.get(0);return a.rendered?a.el.dom.innerHTML:a.html},onStoreRemove:function(){},onStoreAdd:function(){},onStoreUpdate:function(a,b){if(b===this.layerRecord&&0<this.items.getCount()){var c=b.getLayer();this.setVisible(c.getVisibility()&&c.calculateInRange()&&c.displayInLayerSwitcher&&!b.get("hideInLegend"));this.update()}},update:function(){var a=this.getLayerTitle(this.layerRecord),b=this.items.itemAt(0);
b instanceof Ext.form.Label&&this.getLabel()!==a&&b.setText(a,!1)},getLayerTitle:function(a){var b=this.legendTitle||"";this.showTitle&&!b&&a&&!a.get("hideTitle")&&(b=a.get("title")||a.get("name")||a.getLayer().name||"");return b},beforeDestroy:function(){this.layerStore&&(this.layerStore.un("update",this.onStoreUpdate,this),this.layerStore.un("remove",this.onStoreRemove,this),this.layerStore.un("add",this.onStoreAdd,this));GeoExt.LayerLegend.superclass.beforeDestroy.apply(this,arguments)},onDestroy:function(){this.layerStore=
this.layerRecord=null;GeoExt.LayerLegend.superclass.onDestroy.apply(this,arguments)}});GeoExt.LayerLegend.getTypes=function(a,b){var c=(b||[]).concat(),d=[],e,f;for(f in GeoExt.LayerLegend.types)e=GeoExt.LayerLegend.types[f].supports(a),0<e?-1==c.indexOf(f)&&d.push({type:f,score:e}):c.remove(f);d.sort(function(a,b){return a.score<b.score?1:a.score==b.score?0:-1});e=d.length;f=Array(e);for(var g=0;g<e;++g)f[g]=d[g].type;return c.concat(f)};GeoExt.LayerLegend.supports=function(){};
GeoExt.LayerLegend.types={};Ext.namespace("GeoExt");
GeoExt.LegendImage=Ext.extend(Ext.BoxComponent,{url:null,defaultImgSrc:null,imgCls:null,noImgCls:"gx-legend-noimage",initComponent:function(){GeoExt.LegendImage.superclass.initComponent.call(this);if(null===this.defaultImgSrc)this.defaultImgSrc=Ext.BLANK_IMAGE_URL;this.autoEl={tag:"img","class":this.imgCls?this.imgCls+" "+this.noImgCls:this.noImgCls,src:this.defaultImgSrc}},getImgEl:function(){return this.getEl()},setUrl:function(a){this.url=a;var b=this.getImgEl();if(b)b.un("load",this.onImageLoad,
this),b.on("load",this.onImageLoad,this,{single:!0}),b.un("error",this.onImageLoadError,this),b.on("error",this.onImageLoadError,this,{single:!0}),b.dom.src=a},onRender:function(a,b){GeoExt.LegendImage.superclass.onRender.call(this,a,b);this.url&&this.setUrl(this.url)},onDestroy:function(){var a=this.getImgEl();a&&(a.un("load",this.onImageLoad,this),a.un("error",this.onImageLoadError,this));GeoExt.LegendImage.superclass.onDestroy.apply(this,arguments)},onImageLoadError:function(){var a=this.getImgEl();
a.addClass(this.noImgCls);a.dom.src=this.defaultImgSrc},onImageLoad:function(){var a=this.getImgEl();OpenLayers.Util.isEquivalentUrl(a.dom.src,this.defaultImgSrc)||a.removeClass(this.noImgCls)}});Ext.reg("gx_legendimage",GeoExt.LegendImage);Ext.namespace("GeoExt");
GeoExt.PrintMapPanel=Ext.extend(GeoExt.MapPanel,{sourceMap:null,printProvider:null,printPage:null,previewScales:null,center:null,zoom:null,extent:null,currentZoom:null,initComponent:function(){if(this.sourceMap instanceof GeoExt.MapPanel)this.sourceMap=this.sourceMap.map;if(!this.map)this.map={};Ext.applyIf(this.map,{projection:this.sourceMap.getProjection(),maxExtent:this.sourceMap.getMaxExtent(),maxResolution:this.sourceMap.getMaxResolution(),units:this.sourceMap.getUnits()});if(!(this.printProvider instanceof
GeoExt.data.PrintProvider))this.printProvider=new GeoExt.data.PrintProvider(this.printProvider);this.printPage=new GeoExt.data.PrintPage({printProvider:this.printProvider});this.previewScales=new Ext.data.Store;this.previewScales.add(this.printProvider.scales.getRange());this.layers=[];Ext.each(this.sourceMap.layers,function(a){if(!0===a.getVisibility())if(a instanceof OpenLayers.Layer.Vector){for(var b=a.features,c=Array(b.length),a=new OpenLayers.Layer.Vector(a.name),d=0,e=b.length;d<e;++d)c[d]=
b[d].clone();a.addFeatures(c,{silent:!0});this.layers.push(a)}else this.layers.push(a.clone())},this);this.extent=this.sourceMap.getExtent();GeoExt.PrintMapPanel.superclass.initComponent.call(this)},bind:function(){this.printPage.on("change",this.fitZoom,this);this.printProvider.on("layoutchange",this.syncSize,this);this.map.events.register("moveend",this,this.updatePage);this.printPage.fit(this.sourceMap);!0===this.initialConfig.limitScales&&(this.on("resize",this.calculatePreviewScales,this),this.calculatePreviewScales())},
afterRender:function(){GeoExt.PrintMapPanel.superclass.afterRender.apply(this,arguments);this.syncSize();if(this.ownerCt)this.ownerCt.on({afterlayout:{fn:this.bind,scope:this,single:!0}});else this.bind()},adjustSize:function(a,b){var c=this.printProvider.layout.get("size"),c=c.width/c.height,d=this.ownerCt,e=d&&d.autoWidth?0:a||this.initialConfig.width,d=d&&d.autoHeight?0:b||this.initialConfig.height;e?(b=e/c,d&&b>d?(b=d,a=b*c):a=e):d&&(a=d*c,b=d);return{width:a,height:b}},fitZoom:function(){if(!this._updating&&
this.printPage.scale){this._updating=!0;var a=this.printPage.getPrintExtent(this.map);this.currentZoom=this.map.getZoomForExtent(a);this.map.zoomToExtent(a);delete this._updating}},updatePage:function(){if(!this._updating){var a=this.map.getZoom();this._updating=!0;a===this.currentZoom?this.printPage.setCenter(this.map.getCenter()):this.printPage.fit(this.map);delete this._updating;this.currentZoom=a}},calculatePreviewScales:function(){this.previewScales.removeAll();this.printPage.suspendEvents();
var a=this.printPage.scale,b=this.map.getSize(),c={},d=[];this.printProvider.scales.each(function(a){this.printPage.setScale(a);var e=this.printPage.getPrintExtent(this.map),f=this.map.getZoomForExtent(e),e=Math.max(e.getWidth()/b.w,e.getHeight()/b.h),k=this.map.getResolutionForZoom(f),e=Math.abs(e-k);if(!(f in c)||c[f].diff>e)c[f]={rec:a,diff:e},-1==d.indexOf(f)&&d.push(f)},this);for(var e=0,f=d.length;e<f;++e)this.previewScales.add(c[d[e]].rec);a&&this.printPage.setScale(a);this.printPage.resumeEvents();
a&&0<this.previewScales.getCount()&&(e=this.previewScales.getAt(0),f=this.previewScales.getAt(this.previewScales.getCount()-1),a.get("value")<f.get("value")?this.printPage.setScale(f):a.get("value")>e.get("value")&&this.printPage.setScale(e));this.fitZoom()},print:function(a){this.printProvider.print(this.map,[this.printPage],a)},beforeDestroy:function(){this.map.events.unregister("moveend",this,this.updatePage);this.printPage.un("change",this.fitZoom,this);this.printProvider.un("layoutchange",this.syncSize,
this);GeoExt.PrintMapPanel.superclass.beforeDestroy.apply(this,arguments)}});Ext.reg("gx_printmappanel",GeoExt.PrintMapPanel);Ext.namespace("GeoExt");
GeoExt.WMSLegend=Ext.extend(GeoExt.LayerLegend,{defaultStyleIsFirst:!0,useScaleParameter:!0,baseParams:null,itemXType:"gx_legendimage",initComponent:function(){GeoExt.WMSLegend.superclass.initComponent.call(this);var a=this.layerRecord.getLayer();this._noMap=!a.map;a.events.register("moveend",this,this.onLayerMoveend);this.update()},onLayerMoveend:function(a){if(!0===a.zoomChanged&&!0===this.useScaleParameter||this._noMap)delete this._noMap,this.update()},getLegendUrl:function(a,b){var c=this.layerRecord,
d,e=c&&c.get("styles"),c=c.getLayer(),b=b||(""+c.params.LAYERS).split(","),f=c.params.STYLES&&(""+c.params.STYLES).split(","),g=b.indexOf(a),h=f&&f[g];e&&0<e.length&&(h?Ext.each(e,function(a){d=a.name==h&&a.legend&&a.legend.href;return!d}):!f&&!c.params.SLD&&!c.params.SLD_BODY&&(Ext.each(e,function(b){d=b.layerName==a&&b.legend&&b.legend.href;return!d}),!d&&!0===this.defaultStyleIsFirst&&(d=e[0].legend&&e[0].legend.href)),d&&(d=decodeURIComponent(d)));d||(d=c.getFullRequestString({REQUEST:"GetLegendGraphic",
WIDTH:null,HEIGHT:null,EXCEPTIONS:"application/vnd.ogc.se_xml",LAYER:a,LAYERS:null,STYLE:""!==h?h:null,STYLES:null,SRS:null,FORMAT:null,TIME:null}));e=Ext.apply({},this.baseParams);if(c.params._OLSALT)e._OLSALT=c.params._OLSALT;e=Ext.urlEncode(e);f=/([&\?]?)format=[^&]*&?/i;f.test(e)&&f.test(d)&&(d=d.replace(f,"$1"));d=OpenLayers.Util.urlAppend(d,e);-1!=d.toLowerCase().indexOf("request=getlegendgraphic")&&(-1==d.toLowerCase().indexOf("format=")&&(d=Ext.urlAppend(d,"FORMAT=image%2Fgif")),!0===this.useScaleParameter&&
(c=c.map.getScale(),d=Ext.urlAppend(d,"SCALE="+c)));return d},update:function(){var a=this.layerRecord.getLayer();if(a&&a.map){GeoExt.WMSLegend.superclass.update.apply(this,arguments);var a=(""+a.params.LAYERS).split(",").reverse(),b=this.items.find(function(a){return a.isXType("label")});this.items.each(function(a){a!=b&&(this.remove(a),a.destroy())},this);var c,d,e;for(d=0,e=a.length;d<e;d++)c=a[d],(!this.items||!this.getComponent(c))&&this.add({xtype:this.itemXType,url:this.getLegendUrl(c,a),itemId:c});
this.doLayout()}},beforeDestroy:function(){if(!0===this.useScaleParameter){var a=this.layerRecord.getLayer();a&&a.events&&a.events.unregister("moveend",this,this.onLayerMoveend)}GeoExt.WMSLegend.superclass.beforeDestroy.apply(this,arguments)}});GeoExt.WMSLegend.supports=function(a){return a.getLayer()instanceof OpenLayers.Layer.WMS?1:0};GeoExt.LayerLegend.types.gx_wmslegend=GeoExt.WMSLegend;Ext.reg("gx_wmslegend",GeoExt.WMSLegend);Ext.namespace("GeoExt");
GeoExt.VectorLegend=Ext.extend(GeoExt.LayerLegend,{layerRecord:null,layer:null,rules:null,symbolType:null,untitledPrefix:"Untitled ",clickableSymbol:!1,clickableTitle:!1,selectOnClick:!1,enableDD:!1,bodyBorder:!1,feature:null,selectedRule:null,currentScaleDenominator:null,initComponent:function(){GeoExt.VectorLegend.superclass.initComponent.call(this);if(this.layerRecord&&(this.layer=this.layerRecord.getLayer(),this.layer.map))this.map=this.layer.map,this.currentScaleDenominator=this.layer.map.getScale(),
this.layer.map.events.on({zoomend:this.onMapZoom,scope:this});if(!this.symbolType)if(this.feature)this.symbolType=this.symbolTypeFromFeature(this.feature);else if(this.layer)if(0<this.layer.features.length){for(var a,b=0,c=this.layer.features.length;b<c;b++)if(null!==this.layer.features[b].geometry){a=this.layer.features[b].clone();break}a.attributes={};this.feature=a;this.symbolType=this.symbolTypeFromFeature(this.feature)}else this.layer.events.on({featuresadded:this.onFeaturesAdded,scope:this});
this.layer&&this.feature&&!this.rules&&this.setRules();this.rulesContainer=new Ext.Container({autoEl:{}});this.add(this.rulesContainer);this.addEvents("titleclick","symbolclick","ruleclick","ruleselected","ruleunselected","rulemoved");this.update()},onMapZoom:function(){this.setCurrentScaleDenominator(this.layer.map.getScale())},symbolTypeFromFeature:function(a){return(a=a.geometry.CLASS_NAME.match(/Point|Line|Polygon/))&&a[0]||"Point"},onFeaturesAdded:function(a){for(var b=0,c=a.features.length;b<
c;++b)if(null!==a.features[b].geometry){this.layer.events.un({featuresadded:this.onFeaturesAdded,scope:this});a=a.features[b].clone();a.attributes={};this.feature=a;this.symbolType=this.symbolTypeFromFeature(this.feature);this.rules||this.setRules();this.update();break}},setRules:function(){var a=this.layer.styleMap&&this.layer.styleMap.styles["default"];a||(a=new OpenLayers.Style);this.rules=0===a.rules.length?[new OpenLayers.Rule({title:a.title,symbolizer:a.createSymbolizer(this.feature)})]:a.rules},
setCurrentScaleDenominator:function(a){if(a!==this.currentScaleDenominator)this.currentScaleDenominator=a,this.update()},getRuleEntry:function(a){return this.rulesContainer.items.get(this.rules.indexOf(a))},addRuleEntry:function(a,b){this.rulesContainer.add(this.createRuleEntry(a));b||this.doLayout()},removeRuleEntry:function(a,b){var c=this.getRuleEntry(a);c&&(this.rulesContainer.remove(c),b||this.doLayout())},selectRuleEntry:function(a){var b=a!=this.selectedRule;this.selectedRule&&this.unselect();
if(b)this.getRuleEntry(a).body.addClass("x-grid3-row-selected"),this.selectedRule=a,this.fireEvent("ruleselected",this,a)},unselect:function(){this.rulesContainer.items.each(function(a,b){if(this.rules[b]==this.selectedRule)a.body.removeClass("x-grid3-row-selected"),this.selectedRule=null,this.fireEvent("ruleunselected",this,this.rules[b])},this)},createRuleEntry:function(a){var b=!0;null!=this.currentScaleDenominator&&(a.minScaleDenominator&&(b=b&&this.currentScaleDenominator>=a.minScaleDenominator),
a.maxScaleDenominator&&(b=b&&this.currentScaleDenominator<a.maxScaleDenominator));return{xtype:"panel",layout:"column",border:!1,hidden:!b,bodyStyle:this.selectOnClick?{cursor:"pointer"}:void 0,defaults:{border:!1},items:[this.createRuleRenderer(a),this.createRuleTitle(a)],listeners:{render:function(b){this.selectOnClick&&b.getEl().on({click:function(){this.selectRuleEntry(a)},scope:this});!0==this.enableDD&&this.addDD(b)},scope:this}}},createRuleRenderer:function(a){var b=[this.symbolType,"Point",
"Line","Polygon"],c,d,e,f,g=a.symbolizers;if(g){var h;e=0;f=b.length;a:for(;e<f;++e)if(c=b[e],h=OpenLayers.Symbolizer[c])for(var j=0,k=g.length;j<k;++j)if(g[j]instanceof h){d=!0;break a}}else{g=a.symbolizer;for(e=0,f=b.length;e<f;++e)if(c=b[e],g[c]){g=g[c];d=!0;break}g=[g]}return{xtype:"gx_renderer",labelText:"Ab",symbolType:d?c:this.symbolType,symbolizers:g,style:this.clickableSymbol?{cursor:"pointer"}:void 0,listeners:{click:function(){this.clickableSymbol&&(this.fireEvent("symbolclick",this,a),
this.fireEvent("ruleclick",this,a))},scope:this}}},createRuleTitle:function(a){return{cls:"x-form-item",style:"padding: 0.2em 0.5em 0;",bodyStyle:Ext.applyIf({background:"transparent"},this.clickableTitle?{cursor:"pointer"}:void 0),html:this.getRuleTitle(a),listeners:{render:function(b){this.clickableTitle&&b.getEl().on({click:function(){this.fireEvent("titleclick",this,a);this.fireEvent("ruleclick",this,a)},scope:this})},scope:this}}},addDD:function(a){var b=a.ownerCt,c=this;new Ext.dd.DragSource(a.getEl(),
{ddGroup:b.id,onDragOut:function(a,b){var c=Ext.getCmp(b);c.removeClass("gx-ruledrag-insert-above");c.removeClass("gx-ruledrag-insert-below");return Ext.dd.DragZone.prototype.onDragOut.apply(this,arguments)},onDragEnter:function(c,e){var f=Ext.getCmp(e),g,h=b.items.indexOf(a),j=b.items.indexOf(f);h>j?g="gx-ruledrag-insert-above":h<j&&(g="gx-ruledrag-insert-below");g&&f.addClass(g);return Ext.dd.DragZone.prototype.onDragEnter.apply(this,arguments)},onDragDrop:function(d,e){c.moveRule(b.items.indexOf(a),
b.items.indexOf(Ext.getCmp(e)));return Ext.dd.DragZone.prototype.onDragDrop.apply(this,arguments)},getDragData:function(a){if(a=a.getTarget(".x-column-inner")){var b=a.cloneNode(!0);b.id=Ext.id();return{sourceEl:a,repairXY:Ext.fly(a).getXY(),ddel:b}}}});new Ext.dd.DropTarget(a.getEl(),{ddGroup:b.id,notifyDrop:function(){return!0}})},update:function(){GeoExt.VectorLegend.superclass.update.apply(this,arguments);var a,b;if(this.symbolType&&this.rules){if(this.rulesContainer.items)for(a=this.rulesContainer.items.length-
1;0<=a;--a)b=this.rulesContainer.getComponent(a),this.rulesContainer.remove(b,!0);for(a=0,b=this.rules.length;a<b;++a)this.addRuleEntry(this.rules[a],!0);this.doLayout();this.selectedRule&&this.getRuleEntry(this.selectedRule).body.addClass("x-grid3-row-selected")}},updateRuleEntry:function(a){var b=this.getRuleEntry(a);b&&(b.removeAll(),b.add(this.createRuleRenderer(a)),b.add(this.createRuleTitle(a)),b.doLayout())},moveRule:function(a,b){var c=this.rules[a];this.rules.splice(a,1);this.rules.splice(b,
0,c);this.update();this.fireEvent("rulemoved",this,c)},getRuleTitle:function(a){var b=a.title||a.name||"";!b&&this.untitledPrefix&&(b=this.untitledPrefix+(this.rules.indexOf(a)+1));return b},beforeDestroy:function(){this.layer&&(this.layer.events&&this.layer.events.un({featuresadded:this.onFeaturesAdded,scope:this}),this.layer.map&&this.layer.map.events&&this.layer.map.events.un({zoomend:this.onMapZoom,scope:this}));delete this.layer;delete this.map;delete this.rules;GeoExt.VectorLegend.superclass.beforeDestroy.apply(this,
arguments)},onStoreRemove:function(a,b){b.getLayer()===this.layer&&this.map&&this.map.events&&this.map.events.un({zoomend:this.onMapZoom,scope:this})},onStoreAdd:function(a,b){for(var c=0,d=b.length;c<d;c++)if(b[c].getLayer()===this.layer&&this.layer.map&&this.layer.map.events)this.layer.map.events.on({zoomend:this.onMapZoom,scope:this})}});GeoExt.VectorLegend.supports=function(a){return a.getLayer()instanceof OpenLayers.Layer.Vector?1:0};GeoExt.LayerLegend.types.gx_vectorlegend=GeoExt.VectorLegend;
Ext.reg("gx_vectorlegend",GeoExt.VectorLegend);Ext.namespace("GeoExt");
GeoExt.FeatureRenderer=Ext.extend(Ext.BoxComponent,{feature:void 0,symbolizers:[OpenLayers.Feature.Vector.style["default"]],symbolType:"Polygon",labelText:null,resolution:1,minWidth:20,minHeight:20,renderers:["SVG","VML","Canvas"],rendererOptions:null,pointFeature:void 0,lineFeature:void 0,polygonFeature:void 0,textFeature:void 0,renderer:null,initComponent:function(){GeoExt.FeatureRenderer.superclass.initComponent.apply(this,arguments);Ext.applyIf(this,{pointFeature:new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(0,
0)),lineFeature:new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(-8,-3),new OpenLayers.Geometry.Point(-3,3),new OpenLayers.Geometry.Point(3,-3),new OpenLayers.Geometry.Point(8,3)])),polygonFeature:new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(-8,-4),new OpenLayers.Geometry.Point(-6,-6),new OpenLayers.Geometry.Point(6,-6),new OpenLayers.Geometry.Point(8,-4),new OpenLayers.Geometry.Point(8,
4),new OpenLayers.Geometry.Point(6,6),new OpenLayers.Geometry.Point(-6,6),new OpenLayers.Geometry.Point(-8,4)])])),textFeature:new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(0,0))});this.feature||this.setFeature(null,{draw:!1});this.addEvents("click")},initCustomEvents:function(){this.clearCustomEvents();this.el.on("click",this.onClick,this)},clearCustomEvents:function(){this.el&&this.el.removeAllListeners&&this.el.removeAllListeners()},onClick:function(){this.fireEvent("click",this)},
onRender:function(a,b){if(!this.el)this.el=document.createElement("div"),this.el.id=this.getId();(!this.renderer||!this.renderer.supported())&&this.assignRenderer();this.renderer.map={getResolution:function(){return this.resolution}.createDelegate(this)};GeoExt.FeatureRenderer.superclass.onRender.apply(this,arguments);this.drawFeature()},afterRender:function(){GeoExt.FeatureRenderer.superclass.afterRender.apply(this,arguments);this.initCustomEvents()},onResize:function(a,b){this.setRendererDimensions();
GeoExt.FeatureRenderer.superclass.onResize.apply(this,arguments)},setRendererDimensions:function(){var a=this.feature.geometry.getBounds(),b=a.getWidth(),c=a.getHeight(),d=this.initialConfig.resolution;d||(d=Math.max(b/this.width||0,c/this.height||0)||1);this.resolution=d;var b=Math.max(this.width||this.minWidth,b/d),c=Math.max(this.height||this.minHeight,c/d),a=a.getCenterPixel(),e=b*d/2,d=c*d/2,d=new OpenLayers.Bounds(a.x-e,a.y-d,a.x+e,a.y+d);this.renderer.setSize(new OpenLayers.Size(Math.round(b),
Math.round(c)));this.renderer.setExtent(d,!0)},assignRenderer:function(){for(var a=0,b=this.renderers.length;a<b;++a){var c=OpenLayers.Renderer[this.renderers[a]];if(c&&c.prototype.supported()){this.renderer=new c(this.el,this.rendererOptions);break}}},setSymbolizers:function(a,b){this.symbolizers=a;(!b||b.draw)&&this.drawFeature()},setSymbolType:function(a,b){this.symbolType=a;this.setFeature(null,b)},setFeature:function(a,b){this.feature=a||this[this.symbolType.toLowerCase()+"Feature"];(!b||b.draw)&&
this.drawFeature()},drawFeature:function(){this.renderer.clear();this.setRendererDimensions();for(var a,b,c=0,d=this.symbolizers.length;c<d;++c){a=this.symbolizers[c];b=this.feature;if(a instanceof OpenLayers.Symbolizer){a=a.clone();if(OpenLayers.Symbolizer.Text&&a instanceof OpenLayers.Symbolizer.Text&&!1===a.graphic)a.fill=a.stroke=!1;this.initialConfig.feature||(b=a.CLASS_NAME.split(".").pop().toLowerCase(),b=this[b+"Feature"])}else a=Ext.apply({},a);if(void 0!==a.label&&null!==this.labelText)a.label=
this.labelText;this.renderer.drawFeature(b.clone(),a)}},update:function(a){a=a||{};a.feature?this.setFeature(a.feature,{draw:!1}):a.symbolType&&this.setSymbolType(a.symbolType,{draw:!1});a.symbolizers&&this.setSymbolizers(a.symbolizers,{draw:!1});this.drawFeature()},beforeDestroy:function(){this.clearCustomEvents();this.renderer&&this.renderer.destroy()}});Ext.reg("gx_renderer",GeoExt.FeatureRenderer);Ext.namespace("GeoExt");
GeoExt.LayerOpacitySlider=Ext.extend(Ext.slider.SingleSlider,{layer:null,complementaryLayer:null,delay:5,changeVisibilityDelay:5,aggressive:!1,changeVisibility:!1,value:null,inverse:!1,constructor:function(a){if(a.layer){this.layer=this.getLayer(a.layer);this.bind();this.complementaryLayer=this.getLayer(a.complementaryLayer);if(void 0!==a.inverse)this.inverse=a.inverse;a.value=void 0!==a.value?a.value:this.getOpacityValue(this.layer);delete a.layer;delete a.complementaryLayer}GeoExt.LayerOpacitySlider.superclass.constructor.call(this,
a)},bind:function(){if(this.layer&&this.layer.map)this.layer.map.events.on({changelayer:this.update,scope:this})},unbind:function(){this.layer&&this.layer.map&&this.layer.map.events&&this.layer.map.events.un({changelayer:this.update,scope:this})},update:function(a){"opacity"===a.property&&a.layer==this.layer&&!this._settingOpacity&&this.setValue(this.getOpacityValue(this.layer))},setLayer:function(a){this.unbind();this.layer=this.getLayer(a);this.setValue(this.getOpacityValue(a));this.bind()},getOpacityValue:function(a){a=
a&&null!==a.opacity?parseInt(a.opacity*(this.maxValue-this.minValue)):this.maxValue;!0===this.inverse&&(a=this.maxValue-this.minValue-a);return a},getLayer:function(a){if(a instanceof OpenLayers.Layer)return a;if(a instanceof GeoExt.data.LayerRecord)return a.getLayer()},initComponent:function(){GeoExt.LayerOpacitySlider.superclass.initComponent.call(this);this.changeVisibility&&this.layer&&(0==this.layer.opacity||!1===this.inverse&&this.value==this.minValue||!0===this.inverse&&this.value==this.maxValue)&&
this.layer.setVisibility(!1);this.complementaryLayer&&(this.layer&&1==this.layer.opacity||!1===this.inverse&&this.value==this.maxValue||!0===this.inverse&&this.value==this.minValue)&&this.complementaryLayer.setVisibility(!1);if(!0===this.aggressive)this.on("change",this.changeLayerOpacity,this,{buffer:this.delay});else this.on("changecomplete",this.changeLayerOpacity,this);if(!0===this.changeVisibility)this.on("change",this.changeLayerVisibility,this,{buffer:this.changeVisibilityDelay});if(this.complementaryLayer)this.on("change",
this.changeComplementaryLayerVisibility,this,{buffer:this.changeVisibilityDelay});this.on("beforedestroy",this.unbind,this)},changeLayerOpacity:function(a,b){if(this.layer)b/=this.maxValue-this.minValue,!0===this.inverse&&(b=1-b),this._settingOpacity=!0,this.layer.setOpacity(b),delete this._settingOpacity},changeLayerVisibility:function(a,b){var c=this.layer.getVisibility();!1===this.inverse&&b==this.minValue||!0===this.inverse&&b==this.maxValue&&!0===c?this.layer.setVisibility(!1):(!1===this.inverse&&
b>this.minValue||!0===this.inverse&&b<this.maxValue&&!1==c)&&this.layer.setVisibility(!0)},changeComplementaryLayerVisibility:function(a,b){var c=this.complementaryLayer.getVisibility();!1===this.inverse&&b==this.maxValue||!0===this.inverse&&b==this.minValue&&!0===c?this.complementaryLayer.setVisibility(!1):(!1===this.inverse&&b<this.maxValue||!0===this.inverse&&b>this.minValue&&!1==c)&&this.complementaryLayer.setVisibility(!0)},addToMapPanel:function(a){this.on({render:function(){var b=this.getEl();
b.setStyle({position:"absolute",zIndex:a.map.Z_INDEX_BASE.Control});b.on({mousedown:this.stopMouseEvents,click:this.stopMouseEvents})},scope:this})},removeFromMapPanel:function(){this.getEl().un({mousedown:this.stopMouseEvents,click:this.stopMouseEvents,scope:this});this.unbind()},stopMouseEvents:function(a){a.stopEvent()}});Ext.reg("gx_opacityslider",GeoExt.LayerOpacitySlider);Ext.namespace("GeoExt");
GeoExt.SliderTip=Ext.extend(Ext.slider.Tip,{hover:!0,minWidth:10,offsets:[0,-10],dragging:!1,init:function(a){GeoExt.SliderTip.superclass.init.apply(this,arguments);if(this.hover)a.on("render",this.registerThumbListeners,this);this.slider=a},registerThumbListeners:function(){for(var a,b,c=0,d=this.slider.thumbs.length;c<d;++c)a=this.slider.thumbs[c],b=a.tracker.el,function(a,b){b.on({mouseover:function(b){this.onSlide(this.slider,b,a);this.dragging=!1},mouseout:function(){this.dragging||this.hide.apply(this,
arguments)},scope:this})}.apply(this,[a,b])},onSlide:function(a,b,c){this.dragging=!0;return GeoExt.SliderTip.superclass.onSlide.apply(this,arguments)}});Ext.namespace("GeoExt");GeoExt.LayerOpacitySliderTip=Ext.extend(GeoExt.SliderTip,{template:"<div>{opacity}%</div>",compiledTemplate:null,init:function(a){this.compiledTemplate=new Ext.Template(this.template);GeoExt.LayerOpacitySliderTip.superclass.init.call(this,a)},getText:function(a){return this.compiledTemplate.apply({opacity:a.value})}});Ext.namespace("GeoExt");
GeoExt.ZoomSliderTip=Ext.extend(GeoExt.SliderTip,{template:"<div>Zoom Level: {zoom}</div><div>Resolution: {resolution}</div><div>Scale: 1 : {scale}</div>",compiledTemplate:null,init:function(a){this.compiledTemplate=new Ext.Template(this.template);GeoExt.ZoomSliderTip.superclass.init.call(this,a)},getText:function(a){return this.compiledTemplate.apply({zoom:a.value,resolution:this.slider.getResolution(),scale:Math.round(this.slider.getScale())})}});Ext.namespace("GeoExt.ux");
GeoExt.ux.PrintPreview=Ext.extend(Ext.Container,{paperSizeText:"Paper size:",resolutionText:"Resolution:",printText:"Print",emptyTitleText:"Enter map title here.",includeLegendText:"Include legend?",emptyCommentText:"Enter comments here.",creatingPdfText:"Creating PDF...",printProvider:null,sourceMap:null,printMapPanel:null,mapTitleField:"mapTitle",commentField:"comment",legend:null,includeLegend:!1,mapTitle:null,comment:null,addMapOverlay:!0,busyMask:null,form:null,autoEl:"center",cls:"x-panel-body x-panel-body-noheader",
initComponent:function(){var a={sourceMap:this.sourceMap,printProvider:this.printProvider};if(this.printMapPanel){if(!(this.printMapPanel instanceof GeoExt.PrintMapPanel))a.xtype="gx_printmappanel",this.printMapPanel=new GeoExt.PrintMapPanel(Ext.applyIf(this.printMapPanel,a))}else this.printMapPanel=new GeoExt.PrintMapPanel(a);this.sourceMap=this.printMapPanel.sourceMap;this.printProvider=this.printMapPanel.printProvider;this.form=this.createForm();if(!this.items)this.items=[];this.items.push(this.createToolbar(),
{xtype:"container",cls:"gx-printpreview",autoHeight:this.autoHeight,autoWidth:this.autoWidth,items:[this.form,this.printMapPanel]});GeoExt.ux.PrintPreview.superclass.initComponent.call(this);this.addMapOverlay&&this.printMapPanel.add(this.createMapOverlay());this.printMapPanel.on({resize:this.updateSize,scope:this});this.on({render:function(){if(!this.busyMask)this.busyMask=new Ext.LoadMask(this.getEl(),{msg:this.creatingPdfText});this.printProvider.on({beforeprint:this.busyMask.show,print:this.busyMask.hide,
printexception:this.busyMask.hide,scope:this.busyMask})},scope:this})},createToolbar:function(){var a=[];1<this.printProvider.layouts.getCount()&&a.push(this.paperSizeText,{xtype:"combo",width:98,plugins:new GeoExt.plugins.PrintProviderField({printProvider:this.printProvider}),store:this.printProvider.layouts,displayField:"name",typeAhead:!0,mode:"local",forceSelection:!0,triggerAction:"all",selectOnFocus:!0},"&nbsp;");1<this.printProvider.dpis.getCount()&&a.push(this.resolutionText,{xtype:"combo",
width:62,plugins:new GeoExt.plugins.PrintProviderField({printProvider:this.printProvider}),store:this.printProvider.dpis,displayField:"name",tpl:'<tpl for="."><div class="x-combo-list-item">{name} dpi</div></tpl>',typeAhead:!0,mode:"local",forceSelection:!0,triggerAction:"all",selectOnFocus:!0,setValue:function(a){a=parseInt(a)+" dpi";Ext.form.ComboBox.prototype.setValue.apply(this,arguments)}},"&nbsp;");a.push("->",{text:this.printText,iconCls:"icon-print",handler:function(){this.printMapPanel.print(this.includeLegend&&
{legend:this.legend})},scope:this});return{xtype:"toolbar",items:a}},createForm:function(){var a={xtype:"textfield",name:this.mapTitleField,value:this.mapTitle,emptyText:this.emptyTitleText,margins:"0 5 0 0",flex:1,anchor:"100%",hideLabel:!0,plugins:new GeoExt.plugins.PrintProviderField({printProvider:this.printProvider})};if(this.legend)var b=new Ext.form.Checkbox({name:"legend",checked:this.includeLegend,boxLabel:this.includeLegendText,hideLabel:!0,ctCls:"gx-item-nowrap",handler:function(a,b){this.includeLegend=
b},scope:this});return new Ext.form.FormPanel({autoHeight:!0,border:!1,defaults:{anchor:"100%"},items:[this.legend?{xtype:"container",layout:"hbox",cls:"x-form-item",items:[a,b]}:a,{xtype:"textarea",name:this.commentField,value:this.comment,emptyText:this.emptyCommentText,hideLabel:!0,plugins:new GeoExt.plugins.PrintProviderField({printProvider:this.printProvider})}]})},createMapOverlay:function(){var a=this.printMapPanel.map,b=new OpenLayers.Control.ScaleLine({geodesic:!(a.getProjectionObject()||
new OpenLayers.Projection(a.projection||"EPSG:4326")).equals("EPSG:4326")});a.addControl(b);b.activate();return new Ext.Panel({cls:"gx-map-overlay",layout:"column",width:235,bodyStyle:"padding:5px",items:[{xtype:"box",el:b.div,width:b.maxWidth},{xtype:"container",layout:"form",style:"padding: .2em 5px 0 0;",columnWidth:1,cls:"x-small-editor x-form-item",items:{xtype:"combo",name:"scale",anchor:"100%",hideLabel:!0,store:this.printMapPanel.previewScales,displayField:"name",typeAhead:!0,mode:"local",
forceSelection:!0,triggerAction:"all",selectOnFocus:!0,getListParent:function(){return this.el.up(".x-window")||document.body},plugins:new GeoExt.plugins.PrintPageField({printPage:this.printMapPanel.printPage})}},{xtype:"box",autoEl:{tag:"div",cls:"gx-northarrow"}}],listeners:{render:function(){function a(b){b.stopPropagation()}this.getEl().on({click:a,dblclick:a,mousedown:a})}}})},updateSize:function(){this.suspendEvents();var a=this.printMapPanel.getWidth();this.form.setWidth(a);this.form.items.get(0).setWidth(a);
var b=this.initialConfig.minWidth||0;this.items.get(0).setWidth(this.form.ownerCt.el.getPadding("lr")+Math.max(a,b));(a=this.ownerCt)&&a instanceof Ext.Window&&this.ownerCt.syncShadow();this.resumeEvents()},beforeDestroy:function(){this.busyMask&&(this.printProvider.un("beforeprint",this.busyMask.show,this.busyMask),this.printProvider.un("print",this.busyMask.hide,this.busyMask));this.printMapPanel.un("resize",this.updateSize,this);GeoExt.ux.PrintPreview.superclass.beforeDestroy.apply(this,arguments)}});
Ext.reg("gxux_printpreview",GeoExt.ux.PrintPreview);
(function(){var a=function(a,c){return function(d){c&&c[a]&&c[a].call(c.scope||window,Ext.applyIf({argument:c.argument},d))}};Ext.apply(Ext.lib.Ajax,{request:function(b,c,d,e,f){var f=f||{},b=b||f.method,g=f.headers;if(f.xmlData){if(!g||!g["Content-Type"])g=g||{},g["Content-Type"]="text/xml";b=b||"POST";e=f.xmlData}else if(f.jsonData){if(!g||!g["Content-Type"])g=g||{},g["Content-Type"]="application/json";b=b||"POST";e="object"==typeof f.jsonData?Ext.encode(f.jsonData):f.jsonData}if(b&&"post"==b.toLowerCase()&&
(f.form||f.params)&&(!g||!g["Content-Type"]))g=g||{},g["Content-Type"]="application/x-www-form-urlencoded";return OpenLayers.Request.issue({success:a("success",d),failure:a("failure",d),method:b,headers:g,data:e,url:c})},isCallInProgress:function(){return!0},abort:function(a){a.abort()}})})();(function(){Ext.util.Observable.observeClass(Ext.form.TextField);Ext.form.TextField.on("specialkey",function(a,b){a.hasFocus&&b.getKey()===b.ENTER&&a.blur.defer(10,a)})})();Ext.namespace("gxp");
gxp.util={_uniqueNames:{},getOGCExceptionText:function(a){var b;a&&a.exceptions?(b=[],Ext.each(a.exceptions,function(a){Ext.each(a.texts,function(a){b.push(a)})}),b=b.join("\n")):b="Unknown error (no exception report).";return b},dispatch:function(a,b,c){function d(){++g;g===f&&b.call(c,h)}function e(b){window.setTimeout(function(){a[b].apply(c,[d,h])})}for(var b=b||Ext.emptyFn,c=c||this,f=a.length,g=0,h={},j=0;j<f;++j)e(j)},uniqueName:function(a,b){var b=b||" ",c=RegExp(b+"[0-9]*$"),d=a.replace(c,
""),c=c.exec(a),c=void 0!==this._uniqueNames[d]?this._uniqueNames[d]:c instanceof Array?Number(c[0]):void 0,e=d;void 0!==c&&(c++,e+=b+c);this._uniqueNames[d]=c||0;return e},getAbsoluteUrl:function(a){var b;Ext.isIE6||Ext.isIE7||Ext.isIE8?(b=document.createElement("<a href='"+a+"'/>"),b.style.display="none",document.body.appendChild(b),b.href=b.href,document.body.removeChild(b)):(b=document.createElement("a"),b.href=a);return b.href},throttle:function(){var a=function(a,c,d){var e,f,g,h,j=function(){a.apply(d||
this,g);e=(new Date).getTime()};return function(){f=(new Date).getTime()-e;g=arguments;clearTimeout(h);!e||f>=c?j():h=setTimeout(j,c-f)}};return function(b,c,d){return a(b,c,d)}}(),md5:function(){function a(a){return String.fromCharCode(a&255)+String.fromCharCode(a>>>8&255)+String.fromCharCode(a>>>16&255)+String.fromCharCode(a>>>24&255)}function b(a){for(;0>a;)a+=4294967296;for(;4294967295<a;)a-=4294967296;return a}var c=[0,3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,
4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,
4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745],d=[[function(a,b,c){return a&b|~a&c},[[0,7,1],[1,12,2],[2,17,3],[3,22,4],[4,7,5],[5,12,6],[6,17,7],[7,22,8],[8,7,9],[9,12,10],[10,17,11],[11,22,12],[12,7,13],[13,12,14],[14,17,15],[15,22,16]]],[function(a,b,c){return a&c|b&~c},[[1,5,17],[6,9,18],[11,14,19],[0,20,20],[5,5,21],[10,9,22],[15,14,23],[4,20,24],[9,5,25],[14,9,26],[3,14,27],[8,20,28],[13,5,29],[2,9,30],[7,14,31],[12,20,32]]],[function(a,
b,c){return a^b^c},[[5,4,33],[8,11,34],[11,16,35],[14,23,36],[1,4,37],[4,11,38],[7,16,39],[10,23,40],[13,4,41],[0,11,42],[3,16,43],[6,23,44],[9,4,45],[12,11,46],[15,16,47],[2,23,48]]],[function(a,b,c){return b^(a|~c)},[[0,6,49],[7,10,50],[14,15,51],[5,21,52],[12,6,53],[3,10,54],[10,15,55],[1,21,56],[8,6,57],[15,10,58],[6,15,59],[13,21,60],[4,6,61],[11,10,62],[2,15,63],[9,21,64]]]];return function(e){var f,g,h,j,k,l,n,m,o,q,r;f=[1732584193,4023233417,2562383102,271733878];g=e.length;h=g&63;j=56>h?
56-h:120-h;if(0<j){e+="\u0080";for(h=0;h<j-1;h++)e+="\x00"}e+=a(8*g);e+=a(0);g+=j+8;j=[0,1,2,3];k=[16];l=[4];for(q=0;q<g;q+=64){for(h=0,o=q;16>h;h++,o+=4)k[h]=e.charCodeAt(o)|e.charCodeAt(o+1)<<8|e.charCodeAt(o+2)<<16|e.charCodeAt(o+3)<<24;for(h=0;4>h;h++)l[h]=f[h];for(h=0;4>h;h++){n=d[h][0];m=d[h][1];for(o=0;16>o;o++){r=k;var s=l,t=m[o],u=void 0,w=void 0,z=void 0,x=void 0,v=void 0,y=void 0,A=void 0,z=v=void 0,u=j[0],w=j[1],z=j[2],x=j[3],v=t[0],y=t[1],A=t[2],z=n(s[w],s[z],s[x]),v=s[u]+z+r[v]+c[A],
v=b(v),v=v<<y|v>>>32-y,v=v+s[w];s[u]=b(v);r=j[0];j[0]=j[3];j[3]=j[2];j[2]=j[1];j[1]=r}}for(h=0;4>h;h++)f[h]+=l[h],f[h]=b(f[h])}h=a(f[0])+a(f[1])+a(f[2])+a(f[3]);f="";for(e=0;16>e;e++)g=h.charCodeAt(e),f+="0123456789abcdef".charAt(g>>4&15),f+="0123456789abcdef".charAt(g&15);return f}}()};Ext.namespace("gxp.data");
gxp.data.WFSProtocolProxy=Ext.extend(GeoExt.data.ProtocolProxy,{setFilter:function(a){this.protocol.filter=a;this.protocol.options.filter=a},constructor:function(a){Ext.applyIf(a,{version:"1.1.0"});if(!(this.protocol&&this.protocol instanceof OpenLayers.Protocol))a.protocol=new OpenLayers.Protocol.WFS(Ext.apply({version:a.version,srsName:a.srsName,url:a.url,featureType:a.featureType,featureNS:a.featureNS,geometryName:a.geometryName,schema:a.schema,filter:a.filter,maxFeatures:a.maxFeatures,multi:a.multi},
a.protocol));gxp.data.WFSProtocolProxy.superclass.constructor.apply(this,arguments)},doRequest:function(a,b,c,d,e,f,g){delete c.xaction;if(a===Ext.data.Api.actions.read)this.load(c,d,e,f,g);else{b instanceof Array||(b=[b]);var h=Array(b.length),j;Ext.each(b,function(a,b){h[b]=a.getFeature();j=h[b];j.modified=Ext.apply(j.modified||{},{attributes:Ext.apply(j.modified&&j.modified.attributes||{},a.modified)})},this);var k={action:a,records:b,callback:e,scope:f},a={callback:function(a){this.onProtocolCommit(a,
k)},scope:this};Ext.applyIf(a,c);this.protocol.commit(h,a)}},onProtocolCommit:function(a,b){if(a.success()){var c=a.reqFeatures,d,e,f=[],g=a.insertIds||[],h,j,k=0;for(h=0,j=c.length;h<j;++h)if(e=c[h],d=e.state){if(d==OpenLayers.State.DELETE)f.push(e);else if(d==OpenLayers.State.INSERT)e.fid=g[k],++k;else if(e.modified)e.modified={};e.state=null}for(h=0,j=f.length;h<j;++h)e=f[h],e.layer&&e.layer.destroyFeatures([e]);j=c.length;d=Array(j);for(h=0;h<j;++h){e=c[h];d[h]={id:e.id,feature:e,state:null};
var f=b.records[h].fields,l;for(l in e.attributes)f.containsKey(l)&&(d[h][l]=e.attributes[l])}b.callback.call(b.scope,d,a.priv,!0)}else c=a.priv,200<=c.status&&300>c.status?this.fireEvent("exception",this,"remote",b.action,b,a.error,b.records):this.fireEvent("exception",this,"response",b.action,b,c),b.callback.call(b.scope,[],c,!1)}});Ext.namespace("gxp.data");
gxp.data.WFSFeatureStore=Ext.extend(GeoExt.data.FeatureStore,{setOgcFilter:function(a){this.proxy.setFilter(a)},constructor:function(a){if(!(a.proxy&&a.proxy instanceof GeoExt.data.ProtocolProxy))a.proxy=new gxp.data.WFSProtocolProxy(Ext.apply({srsName:a.srsName,url:a.url,featureType:a.featureType,featureNS:a.featureNS,geometryName:a.geometryName,schema:a.schema,filter:a.ogcFilter,maxFeatures:a.maxFeatures,multi:a.multi},a.proxy));if(!a.writer)a.writer=new Ext.data.DataWriter({write:Ext.emptyFn});
gxp.data.WFSFeatureStore.superclass.constructor.apply(this,arguments);this.reader.extractValues=function(a){return this.readRecords([a.feature]).records[0].data}.createDelegate(this.reader);this.reader.meta.idProperty="id";this.reader.getId=function(a){return a.id}}});Ext.namespace("gxp.menu");
gxp.menu.LayerMenu=Ext.extend(Ext.menu.Menu,{layerText:"Layer",layers:null,initComponent:function(){gxp.menu.LayerMenu.superclass.initComponent.apply(this,arguments);this.layers.on("add",this.onLayerAdd,this);this.onLayerAdd()},onRender:function(a,b){gxp.menu.LayerMenu.superclass.onRender.apply(this,arguments)},beforeDestroy:function(){this.layers&&this.layers.on&&this.layers.un("add",this.onLayerAdd,this);delete this.layers;gxp.menu.LayerMenu.superclass.beforeDestroy.apply(this,arguments)},onLayerAdd:function(){this.removeAll();
this.add({iconCls:"gxp-layer-visibility",text:this.layerText,canActivate:!1},"-");this.layers.each(function(a){if(a.getLayer().displayInLayerSwitcher){var b=new Ext.menu.CheckItem({text:a.get("title"),checked:a.getLayer().getVisibility(),group:a.get("group"),listeners:{checkchange:function(b,d){a.getLayer().setVisibility(d)}}});2<this.items.getCount()?this.insert(2,b):this.add(b)}},this)}});Ext.reg("gxp_layermenu",gxp.menu.LayerMenu);Ext.namespace("gxp");
gxp.CrumbPanel=Ext.extend(Ext.TabPanel,{widths:null,enableTabScroll:!0,initComponent:function(){gxp.CrumbPanel.superclass.initComponent.apply(this,arguments);this.widths={}},onBeforeAdd:function(a){gxp.CrumbPanel.superclass.onBeforeAdd.apply(this,arguments);if(a.shortTitle)a.title=a.shortTitle},onAdd:function(a){gxp.CrumbPanel.superclass.onAdd.apply(this,arguments);this.setActiveTab(this.items.getCount()-1);a.on("hide",this.onCmpHide,this);a.getEl().dom.style.display=""},onRemove:function(a){gxp.CrumbPanel.superclass.onRemove.apply(this,
arguments);a.un("hide",this.onCmpHide,this);var b=this.widths[this.get(this.items.getCount()-1).id];b&&b<this.getWidth()&&(this.setWidth(b),this.ownerCt&&this.ownerCt.syncSize());a.getEl().dom.style.display="none";this.activeTab.doLayout()},onRender:function(a){if(!this.initialConfig.itemTpl)this.itemTpl=new Ext.Template('<li class="{cls} gxp-crumb" id="{id}"><div class="gxp-crumb-separator">\u00bb</div>','<a class="x-tab-right" href="#"><em class="x-tab-left">','<span class="x-tab-strip-inner"><span class="x-tab-strip-text {iconCls}">{text}</span></span>',
"</em></a></li>");gxp.CrumbPanel.superclass.onRender.apply(this,arguments);this.getEl().down("div").addClass("gxp-crumbpanel-header")},onCmpHide:function(a){var b=this.items.getCount()-1;this.items.indexOf(a)===b&&this.setActiveTab(this.get(--b))},setActiveTab:function(a){var b;Ext.isNumber(a)?(b=a,a=this.get(b)):b=this.items.indexOf(a);if(~b){var c,d;for(d=this.items.getCount()-1;d>b;--d)c=this.get(d),this.remove(c,"hide"!==c.closeAction)}c=a.initialConfig.minWidth||a.initialConfig.width;d=this.getWidth();
c>d&&(this.widths[this.get(b-1).id]=d,this.setWidth(c),this.ownerCt&&this.ownerCt.syncSize());gxp.CrumbPanel.superclass.setActiveTab.apply(this,arguments)}});Ext.reg("gxp_crumbpanel",gxp.CrumbPanel);Ext.namespace("gxp");
gxp.LayerUploadPanel=Ext.extend(Ext.FormPanel,{titleLabel:"Title",titleEmptyText:"Layer title",abstractLabel:"Description",abstractEmptyText:"Layer description",fileLabel:"Data",fieldEmptyText:"Browse for data archive...",uploadText:"Upload",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"Uploading your data...",invalidFileExtensionText:"File extension must be one of: ",optionsText:"Options",workspaceLabel:"Workspace",workspaceEmptyText:"Default workspace",
dataStoreLabel:"Store",dataStoreEmptyText:"Choose a store",dataStoreNewText:"Create new store",crsLabel:"CRS",crsEmptyText:"Coordinate Reference System ID",invalidCrsText:"CRS identifier should be an EPSG code (e.g. EPSG:4326)",fileUpload:!0,validFileExtensions:".zip,.tif,.tiff,.gz,.tar.bz2,.tar,.tgz,.tbz2".split(","),defaultDataStore:null,constructor:function(a){a.errorReader={read:a.handleUploadResponse||this.handleUploadResponse.createDelegate(this)};gxp.LayerUploadPanel.superclass.constructor.call(this,
a)},selectedWorkspace:null,initComponent:function(){this.items=[{xtype:"textfield",name:"title",fieldLabel:this.titleLabel,emptyText:this.titleEmptyText,allowBlank:!0},{xtype:"textarea",name:"abstract",fieldLabel:this.abstractLabel,emptyText:this.abstractEmptyText,allowBlank:!0},{xtype:"fileuploadfield",id:"file",anchor:"90%",emptyText:this.fieldEmptyText,fieldLabel:this.fileLabel,name:"file",buttonText:"",buttonCfg:{iconCls:"gxp-icon-filebrowse"},listeners:{fileselected:function(a,b){a.setValue(b.split(/[/\\]/).pop())}},
validator:this.fileNameValidator.createDelegate(this)},{xtype:"fieldset",ref:"optionsFieldset",title:this.optionsText,checkboxToggle:!0,collapsed:!0,hidden:void 0!=this.workspace&&void 0!=this.store&&void 0!=this.crs,hideMode:"offsets",defaults:{anchor:"97%"},items:[this.createWorkspacesCombo(),this.createDataStoresCombo(),{xtype:"textfield",name:"nativeCRS",fieldLabel:this.crsLabel,emptyText:this.crsEmptyText,allowBlank:!0,regex:/^epsg:\d+$/i,regexText:this.invalidCrsText}],listeners:{collapse:function(a){a.items.each(function(a){a.reset()})}}}];
this.buttons=[{text:this.uploadText,handler:function(){var a=this.getForm();if(a.isValid()){var b=a.getFieldValues(),c={"import":{}};if(b.workspace)c["import"].targetWorkspace={workspace:{name:b.workspace}};if(Ext.isEmpty(b.store)&&this.defaultDataStore)c["import"].targetStore={dataStore:{name:this.defaultDataStore}};else if(!Ext.isEmpty(b.store)&&b.store!==this.dataStoreNewText)c["import"].targetStore={dataStore:{name:b.store}};Ext.Ajax.request({url:this.getUploadUrl(),method:"POST",jsonData:c,success:function(b){this._import=
b.getResponseHeader("Location");this.optionsFieldset.expand();a.submit({url:this._import+"/tasks?expand=all",waitMsg:this.waitMsgText,waitMsgTarget:!0,reset:!0,scope:this})},scope:this})}},scope:this}];this.addEvents("workspaceselected","datastoreselected","uploadcomplete");this.getDefaultDataStore("default");gxp.LayerUploadPanel.superclass.initComponent.call(this)},fileNameValidator:function(a){for(var b=!1,c,d=0,e=this.validFileExtensions.length;d<e;++d)if(c=this.validFileExtensions[d],a.slice(-c.length).toLowerCase()===
c){b=!0;break}return b||this.invalidFileExtensionText+"<br/>"+this.validFileExtensions.join(", ")},createWorkspacesCombo:function(){return{xtype:"combo",name:"workspace",ref:"../workspace",fieldLabel:this.workspaceLabel,store:new Ext.data.JsonStore({url:this.getWorkspacesUrl(),autoLoad:!0,root:"workspaces.workspace",fields:["name","href"]}),displayField:"name",valueField:"name",mode:"local",allowBlank:!0,triggerAction:"all",forceSelection:!0,listeners:{select:function(a,b){this.getDefaultDataStore(b.get("name"));
this.fireEvent("workspaceselected",this,b)},scope:this}}},createDataStoresCombo:function(){var a=new Ext.data.JsonStore({autoLoad:!1,root:"dataStores.dataStore",fields:["name","href"]});this.on({workspaceselected:function(d,e){c.reset();var f=e.get("href");a.removeAll();a.proxy=new Ext.data.HttpProxy({url:f.split(".json").shift()+"/datastores.json"});a.proxy.on("loadexception",b,this);a.load()},scope:this});var b=function(){var c=new a.recordType({name:this.dataStoreNewText});a.insert(0,c);a.proxy&&
a.proxy.un("loadexception",b,this)};a.on("load",b,this);var c=new Ext.form.ComboBox({name:"store",ref:"../dataStore",emptyText:this.dataStoreEmptyText,fieldLabel:this.dataStoreLabel,store:a,displayField:"name",valueField:"name",mode:"local",allowBlank:!0,triggerAction:"all",forceSelection:!0,listeners:{select:function(a,b){this.fireEvent("datastoreselected",this,b)},scope:this}});return c},getDefaultDataStore:function(a){Ext.Ajax.request({url:this.url+"/workspaces/"+a+"/datastores/default.json",callback:function(b,
c,d){this.defaultDataStore=null;if(200===d.status&&(b=Ext.decode(d.responseText),"default"===a&&b.dataStore&&b.dataStore.workspace&&(this.workspace.setValue(b.dataStore.workspace.name),this.fireEvent("workspaceselected",this,new this.workspace.store.recordType({name:b.dataStore.workspace.name,href:b.dataStore.workspace.href}))),b.dataStore&&!0===b.dataStore.enabled&&!/file/i.test(b.dataStore.type)))this.defaultDataStore=b.dataStore.name,this.dataStore.setValue(this.defaultDataStore)},scope:this})},
getUploadUrl:function(){return this.url+"/imports"},getWorkspacesUrl:function(){return this.url+"/workspaces.json"},handleUploadResponse:function(a){var b=this.parseResponseText(a.responseText),c,d,e,f,a=this.getForm().getFieldValues(),g=!!b;if(b)if("string"===typeof b)g=!1,e=b;else if(d=b.tasks||[b.task],0===d.length)g=!1,e="Upload contains no suitable files.";else for(f=d.length-1;0<=f;--f)(b=d[f])?"NO_FORMAT"===b.state?(g=!1,e="Upload contains no suitable files."):"NO_CRS"===b.state&&!a.nativeCRS&&
(g=!1,e="Coordinate Reference System (CRS) of source file "+b.data.file+" could not be determined. Please specify manually."):(g=!1,e="Unknown upload error");g?(a.title||a["abstract"]||a.nativeCRS)&&d[0].target.dataStore?(this.waitMsg=new Ext.LoadMask((this.ownerCt||this).getEl(),{msg:this.processingUploadText}),this.waitMsg.show(),Ext.Ajax.request({method:"PUT",url:d[0].layer.href,jsonData:{title:a.title||void 0,"abstract":a["abstract"]||void 0,srs:a.nativeCRS||void 0},success:this.finishUpload,
failure:function(a){this.waitMsg&&this.waitMsg.hide();var b=[];try{var c=Ext.decode(a.responseText);if(c.errors)for(var d=0,e=c.errors.length;d<e;++d)b.push({id:~c.errors[d].indexOf("SRS")?"nativeCRS":"file",msg:c.errors[d]})}catch(f){b.push({id:"file",msg:a.responseText})}this.getForm().markInvalid(b)},scope:this})):this.finishUpload():c=[{data:{id:"file",msg:e||this.uploadFailedText}}];return{success:!1,records:c}},finishUpload:function(){Ext.Ajax.request({method:"POST",url:this._import,failure:this.handleFailure,
success:this.handleUploadSuccess,scope:this})},parseResponseText:function(a){var b;try{b=Ext.decode(a)}catch(c){if(a=a.match(/^\s*<pre[^>]*>(.*)<\/pre>\s*/))try{b=Ext.decode(a[1])}catch(d){b=a[1]}}return b},handleUploadSuccess:function(){Ext.Ajax.request({method:"GET",url:this._import+"?expand=all",failure:this.handleFailure,success:function(a){this.waitMsg&&this.waitMsg.hide();this.getForm().reset();var b=Ext.decode(a.responseText);window.setTimeout(function(){this.fireEvent("uploadcomplete",this,
b);delete this._import}.bind(this),250)},scope:this})},handleFailure:function(a){a&&1223===a.status?this.handleUploadSuccess(a):(this.waitMsg&&this.waitMsg.hide(),this.getForm().markInvalid([{file:this.uploadFailedText}]))}});Ext.reg("gxp_layeruploadpanel",gxp.LayerUploadPanel);Ext.namespace("gxp");
gxp.FilterBuilder=Ext.extend(Ext.Container,{builderTypeNames:["any","all","none","not all"],allowedBuilderTypes:null,allowBlank:!1,caseInsensitiveMatch:!1,preComboText:"Match",postComboText:"of the following:",cls:"gxp-filterbuilder",builderType:null,childFilterContainer:null,customizeFilterOnInit:!0,addConditionText:"add condition",addGroupText:"add group",removeConditionText:"remove condition",allowGroups:!0,initComponent:function(){Ext.applyIf(this,{defaultBuilderType:gxp.FilterBuilder.ANY_OF});
if(this.customizeFilterOnInit)this.filter=this.customizeFilter(this.filter);this.builderType=this.getBuilderType();this.items=[{xtype:"container",layout:"form",ref:"form",defaults:{anchor:"100%"},hideLabels:!0,items:[{xtype:"compositefield",style:"padding-left: 2px",items:[{xtype:"label",style:"padding-top: 0.3em",text:this.preComboText},this.createBuilderTypeCombo(),{xtype:"label",style:"padding-top: 0.3em",text:this.postComboText}]},this.createChildFiltersPanel(),{xtype:"toolbar",items:this.createToolBar()}]}];
this.addEvents("change");gxp.FilterBuilder.superclass.initComponent.call(this)},createToolBar:function(){var a=[{text:this.addConditionText,iconCls:"add",handler:function(){this.addCondition()},scope:this}];this.allowGroups&&a.push({text:this.addGroupText,iconCls:"add",handler:function(){this.addCondition(!0)},scope:this});return a},getFilter:function(){var a;this.filter&&(a=this.filter.clone(),a instanceof OpenLayers.Filter.Logical&&(a=this.cleanFilter(a)));return a},cleanFilter:function(a){if(a instanceof
OpenLayers.Filter.Logical)if(a.type!==OpenLayers.Filter.Logical.NOT&&1===a.filters.length)a=this.cleanFilter(a.filters[0]);else for(var b,c=0,d=a.filters.length;c<d;++c)if(b=a.filters[c],b instanceof OpenLayers.Filter.Logical)if(b=this.cleanFilter(b))a.filters[c]=b;else{a=b;break}else{if(!b||null===b.type||null===b.property||null===b[a.type===OpenLayers.Filter.Comparison.BETWEEN?"lowerBoundary":"value"]){a=!1;break}}else if(!a||null===a.type||null===a.property||null===a[a.type===OpenLayers.Filter.Comparison.BETWEEN?
"lowerBoundary":"value"])a=!1;return a},customizeFilter:function(a){if(a){var a=this.cleanFilter(a),b,c,d;switch(a.type){case OpenLayers.Filter.Logical.AND:case OpenLayers.Filter.Logical.OR:if(!a.filters||0===a.filters.length)a.filters=[this.createDefaultFilter()];else for(c=0,d=a.filters.length;c<d;++c)b=a.filters[c],b instanceof OpenLayers.Filter.Logical&&(a.filters[c]=this.customizeFilter(b));a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR,filters:[a]});break;case OpenLayers.Filter.Logical.NOT:if(!a.filters||
0===a.filters.length)a.filters=[new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR,filters:[this.createDefaultFilter()]})];else if(b=a.filters[0],b instanceof OpenLayers.Filter.Logical)if(b.type!==OpenLayers.Filter.Logical.NOT){var e;for(c=0,d=b.filters.length;c<d;++c)e=b.filters[c],e instanceof OpenLayers.Filter.Logical&&(b.filters[c]=this.customizeFilter(e))}else a=b.filters&&0<b.filters.length?this.customizeFilter(b.filters[0]):this.wrapFilter(this.createDefaultFilter());else a.filters=
[new OpenLayers.Filter.Logical({type:this.defaultBuilderType===gxp.FilterBuilder.NOT_ALL_OF?OpenLayers.Filter.Logical.AND:OpenLayers.Filter.Logical.OR,filters:[b]})];break;default:a=this.wrapFilter(a)}}else a=this.wrapFilter(this.createDefaultFilter());return a},createDefaultFilter:function(){return new OpenLayers.Filter.Comparison({matchCase:!this.caseInsensitiveMatch})},wrapFilter:function(a){return new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR,filters:[new OpenLayers.Filter.Logical({type:this.defaultBuilderType===
gxp.FilterBuilder.ALL_OF?OpenLayers.Filter.Logical.AND:OpenLayers.Filter.Logical.OR,filters:[a]})]})},addCondition:function(a){var b,c;a?(c="gxp_filterbuilder",b=this.wrapFilter(this.createDefaultFilter())):(c="gxp_filterfield",b=this.createDefaultFilter());this.childFilterContainer.add(this.newRow({xtype:c,filter:b,columnWidth:1,attributes:this.attributes,allowBlank:a?void 0:this.allowBlank,customizeFilterOnInit:a&&!1,caseInsensitiveMatch:this.caseInsensitiveMatch,listeners:{change:function(){this.fireEvent("change",
this)},scope:this}}));this.filter.filters[0].filters.push(b);this.childFilterContainer.doLayout()},removeCondition:function(a,b){var c=this.filter.filters[0].filters;0<c.length&&(c.remove(b),this.childFilterContainer.remove(a,!0));0===c.length&&this.addCondition();this.fireEvent("change",this)},createBuilderTypeCombo:function(){for(var a=this.allowedBuilderTypes||[gxp.FilterBuilder.ANY_OF,gxp.FilterBuilder.ALL_OF,gxp.FilterBuilder.NONE_OF],b=a.length,c=Array(b),d,e=0;e<b;++e)d=a[e],c[e]=[d,this.builderTypeNames[d]];
return{xtype:"combo",store:new Ext.data.SimpleStore({data:c,fields:["value","name"]}),value:this.builderType,ref:"../../builderTypeCombo",displayField:"name",valueField:"value",triggerAction:"all",mode:"local",listeners:{select:function(a,b){this.changeBuilderType(b.get("value"));this.fireEvent("change",this)},scope:this},width:60}},changeBuilderType:function(a){if(a!==this.builderType){this.builderType=a;var b=this.filter.filters[0];switch(a){case gxp.FilterBuilder.ANY_OF:this.filter.type=OpenLayers.Filter.Logical.OR;
b.type=OpenLayers.Filter.Logical.OR;break;case gxp.FilterBuilder.ALL_OF:this.filter.type=OpenLayers.Filter.Logical.OR;b.type=OpenLayers.Filter.Logical.AND;break;case gxp.FilterBuilder.NONE_OF:this.filter.type=OpenLayers.Filter.Logical.NOT;b.type=OpenLayers.Filter.Logical.OR;break;case gxp.FilterBuilder.NOT_ALL_OF:this.filter.type=OpenLayers.Filter.Logical.NOT,b.type=OpenLayers.Filter.Logical.AND}}},createChildFiltersPanel:function(){this.childFilterContainer=new Ext.Container;for(var a=this.filter.filters[0].filters,
b,c=0,d=a.length;c<d;++c){b=a[c];var e={xtype:"gxp_filterfield",allowBlank:this.allowBlank,columnWidth:1,filter:b,attributes:this.attributes,listeners:{change:function(){this.fireEvent("change",this)},scope:this}};this.childFilterContainer.add(this.newRow(Ext.applyIf(b instanceof OpenLayers.Filter.Logical?{xtype:"gxp_filterbuilder"}:{xtype:"container",layout:"form",hideLabels:!0,items:e},e)))}return this.childFilterContainer},newRow:function(a){var b=new Ext.Container({layout:"column",items:[{xtype:"container",
width:28,height:26,style:"padding-left: 2px",items:{xtype:"button",tooltip:this.removeConditionText,iconCls:"delete",handler:function(){this.removeCondition(b,a.filter)},scope:this}},a]});return b},getBuilderType:function(){var a=this.defaultBuilderType;if(this.filter){var b=this.filter.filters[0];if(this.filter.type===OpenLayers.Filter.Logical.NOT)switch(b.type){case OpenLayers.Filter.Logical.OR:a=gxp.FilterBuilder.NONE_OF;break;case OpenLayers.Filter.Logical.AND:a=gxp.FilterBuilder.NOT_ALL_OF}else switch(b.type){case OpenLayers.Filter.Logical.OR:a=
gxp.FilterBuilder.ANY_OF;break;case OpenLayers.Filter.Logical.AND:a=gxp.FilterBuilder.ALL_OF}}return a},setFilter:function(a){this.filter=this.customizeFilter(a);this.changeBuilderType(this.getBuilderType());this.builderTypeCombo.setValue(this.builderType);this.form.remove(this.childFilterContainer);this.form.insert(1,this.createChildFiltersPanel());this.form.doLayout();this.fireEvent("change",this)}});gxp.FilterBuilder.ANY_OF=0;gxp.FilterBuilder.ALL_OF=1;gxp.FilterBuilder.NONE_OF=2;
gxp.FilterBuilder.NOT_ALL_OF=3;Ext.reg("gxp_filterbuilder",gxp.FilterBuilder);Ext.namespace("gxp");
gxp.WMSLayerPanel=Ext.extend(Ext.TabPanel,{layerRecord:null,source:null,styling:!0,sameOriginStyling:!0,rasterStyling:!1,transparent:null,editableStyles:!1,activeTab:0,border:!1,imageFormats:/png|gif|jpe?g/i,aboutText:"About",titleText:"Title",attributionText:"Attribution",nameText:"Name",descriptionText:"Description",displayText:"Display",opacityText:"Opacity",formatText:"Tile format",infoFormatText:"Info format",infoFormatEmptyText:"Select a format",transparentText:"Transparent",cacheText:"Caching",
cacheFieldText:"Use cached tiles",stylesText:"Available Styles",displayOptionsText:"Display options",queryText:"Limit with filters",scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile",initComponent:function(){this.cqlFormat=new OpenLayers.Format.CQL;this.source&&this.source.getSchema(this.layerRecord,
function(a){if(!1!==a){var c=this.layerRecord.getLayer().params.CQL_FILTER;this.filterBuilder=new gxp.FilterBuilder({filter:c&&this.cqlFormat.read(c),allowGroups:!1,listeners:{afterrender:function(){this.filterBuilder.cascade(function(a){"toolbar"===a.getXType()&&(a.addText(this.cqlPrefixText),a.addButton({text:this.cqlText,handler:this.switchToCQL,scope:this}))},this)},change:function(a){var a=a.getFilter(),b=null;!1!==a&&(b=this.cqlFormat.write(a));this.layerRecord.getLayer().mergeNewParams({CQL_FILTER:b})},
scope:this},attributes:a});this.filterFieldset.add(this.filterBuilder);this.filterFieldset.doLayout()}},this);this.addEvents("change");this.items=[this.createAboutPanel(),this.createDisplayPanel()];if(this.styling&&gxp.WMSStylesDialog&&this.layerRecord.get("styles")){var a=this.layerRecord.get("restUrl");a||(a=(this.source||this.layerRecord.get("layer")).url.split("?").shift().replace(/\/(wms|ows)\/?$/,"/rest"));this.editableStyles=this.sameOriginStyling?"/"===a.charAt(0):!0;this.items.push(this.createStylesPanel(a))}gxp.WMSLayerPanel.superclass.initComponent.call(this)},
switchToCQL:function(){var a=this.filterBuilder.getFilter(),b="";!1!==a&&(b=this.cqlFormat.write(a));this.filterBuilder.hide();this.cqlField.setValue(b);this.cqlField.show();this.cqlToolbar.show()},switchToFilterBuilder:function(){var a=null;try{a=this.cqlFormat.read(this.cqlField.getValue())}catch(b){}this.cqlField.hide();this.cqlToolbar.hide();this.filterBuilder.show();null!==a&&this.filterBuilder.setFilter(a)},createStylesPanel:function(a){a=gxp.WMSStylesDialog.createGeoServerStylerConfig(this.layerRecord,
a);!0===this.rasterStyling&&a.plugins.push({ptype:"gxp_wmsrasterstylesdialog"});var b=this.ownerCt;if(!(b.ownerCt instanceof Ext.Window))a.dialogCls=Ext.Panel,a.showDlg=function(a){a.layout="fit";a.autoHeight=!1;b.add(a)};return Ext.apply(a,{title:this.stylesText,style:"padding: 10px",editable:!1})},createAboutPanel:function(){return{title:this.aboutText,bodyStyle:{padding:"10px"},defaults:{border:!1},items:[{layout:"form",labelWidth:70,items:[{xtype:"textfield",fieldLabel:this.titleText,anchor:"99%",
value:this.layerRecord.get("title"),listeners:{change:function(a){this.layerRecord.set("title",a.getValue());this.layerRecord.commit();this.fireEvent("change")},scope:this}},{xtype:"textfield",fieldLabel:this.nameText,anchor:"99%",value:this.layerRecord.get("name"),readOnly:!0},{xtype:"textfield",fieldLabel:this.attributionText,anchor:"99%",listeners:{change:function(a){var b=this.layerRecord.getLayer();b.attribution=a.getValue();b.map.events.triggerEvent("changelayer",{layer:b,property:"attribution"});
this.fireEvent("change")},scope:this},value:this.layerRecord.getLayer().attribution}]},{layout:"form",labelAlign:"top",items:[{xtype:"textarea",fieldLabel:this.descriptionText,grow:!0,growMax:150,anchor:"99%",value:this.layerRecord.get("abstract"),readOnly:!0}]}]}},onFormatChange:function(a){var b=this.layerRecord.getLayer(),a=a.getValue();b.mergeNewParams({format:a});b=this.transparentCb;if("image/jpeg"==a)this.transparent=b.getValue(),b.setValue(!1);else if(null!==this.transparent)b.setValue(this.transparent),
this.transparent=null;b.setDisabled("image/jpeg"==a);this.fireEvent("change")},addScaleOptions:function(a,b){a.alwaysInRange=null;a.addOptions(b);a.display();a.redraw()},createDisplayPanel:function(){var a=this.layerRecord,b=a.getLayer(),c=b.opacity;null==c&&(c=1);var d=[],c=b.params.FORMAT.toLowerCase();Ext.each(a.get("formats"),function(a){this.imageFormats.test(a)&&d.push(a.toLowerCase())},this);-1===d.indexOf(c)&&d.push(c);var e=b.params.TRANSPARENT;return{title:this.displayText,layout:"form",
bodyStyle:{padding:"10px"},defaults:{labelWidth:70},items:[{xtype:"fieldset",title:this.displayOptionsText,items:[{xtype:"gx_opacityslider",name:"opacity",anchor:"99%",isFormField:!0,fieldLabel:this.opacityText,listeners:{change:function(){this.fireEvent("change")},scope:this},layer:this.layerRecord},{xtype:"compositefield",fieldLabel:this.formatText,anchor:"99%",items:[{xtype:"combo",width:90,listWidth:150,store:d,value:c,mode:"local",triggerAction:"all",editable:!1,listeners:{select:this.onFormatChange,
scope:this}},{xtype:"checkbox",ref:"../../../transparentCb",checked:"true"===e||!0===e,listeners:{check:function(a,c){b.mergeNewParams({transparent:c?"true":"false"});this.fireEvent("change")},scope:this}},{xtype:"label",cls:"gxp-layerproperties-label",text:this.transparentText}]},{xtype:"compositefield",fieldLabel:this.singleTileText,anchor:"99%",items:[{xtype:"checkbox",checked:this.layerRecord.get("layer").singleTile,listeners:{check:function(a,c){b.addOptions({singleTile:c});this.fireEvent("change")},
scope:this}},{xtype:"label",cls:"gxp-layerproperties-label",text:this.singleTileFieldText}]},{xtype:"compositefield",anchor:"99%",hidden:null==this.layerRecord.get("layer").params.TILED,fieldLabel:this.cacheText,items:[{xtype:"checkbox",checked:!0===this.layerRecord.get("layer").params.TILED,listeners:{check:function(a,b){this.layerRecord.get("layer").mergeNewParams({TILED:b});this.fireEvent("change")},scope:this}},{xtype:"label",cls:"gxp-layerproperties-label",text:this.cacheFieldText}]},{xtype:"combo",
fieldLabel:this.infoFormatText,emptyText:this.infoFormatEmptyText,store:a.get("infoFormats"),value:a.get("infoFormat"),hidden:void 0===a.get("infoFormats"),mode:"local",listWidth:150,triggerAction:"all",editable:!1,anchor:"99%",listeners:{select:function(b){b=b.getValue();a.set("infoFormat",b);this.fireEvent("change")}},scope:this}]},{xtype:"fieldset",title:this.queryText,hideLabels:!0,ref:"../filterFieldset",listeners:{expand:function(){this.layerRecord.getLayer().mergeNewParams({CQL_FILTER:this.cqlFilter})},
collapse:function(){this.cqlFilter=this.layerRecord.getLayer().params.CQL_FILTER;this.layerRecord.getLayer().mergeNewParams({CQL_FILTER:null})},scope:this},hidden:null===this.source,checkboxToggle:!0,collapsed:!this.layerRecord.getLayer().params.CQL_FILTER,items:[{xtype:"textarea",value:this.layerRecord.getLayer().params.CQL_FILTER,grow:!0,anchor:"99%",width:"100%",growMax:100,ref:"../../cqlField",hidden:!0}],buttons:[{ref:"../../../cqlToolbar",hidden:!0,text:this.switchToFilterBuilderText,handler:this.switchToFilterBuilder,
scope:this}]},{xtype:"fieldset",title:this.scaleText,listeners:{expand:function(){var a=this.layerRecord.getLayer();(void 0!==this.minScale||void 0!==this.maxScale)&&this.addScaleOptions(a,{minScale:this.maxScale,maxScale:this.minScale})},collapse:function(){var a=this.layerRecord.getLayer();this.minScale=a.options.maxScale;this.maxScale=a.options.minScale;this.addScaleOptions(a,{minScale:null,maxScale:null})},scope:this},checkboxToggle:!0,collapsed:null==this.layerRecord.getLayer().options.maxScale&&
null==this.layerRecord.getLayer().options.minScale,items:[{xtype:"compositefield",fieldLabel:this.minScaleText,items:[{xtype:"label",text:"1:",cls:"gxp-layerproperties-label"},{xtype:"numberfield",anchor:"99%",width:"85%",listeners:{change:function(a){a={maxScale:parseInt(a.getValue())};this.addScaleOptions(this.layerRecord.getLayer(),a)},scope:this},value:this.layerRecord.getLayer().options.maxScale}]},{xtype:"compositefield",fieldLabel:this.maxScaleText,items:[{xtype:"label",text:"1:",cls:"gxp-layerproperties-label"},
{xtype:"numberfield",anchor:"99%",width:"85%",listeners:{change:function(a){a={minScale:parseInt(a.getValue())};this.addScaleOptions(this.layerRecord.getLayer(),a)},scope:this},value:this.layerRecord.getLayer().options.minScale}]}]}]}}});Ext.reg("gxp_wmslayerpanel",gxp.WMSLayerPanel);Ext.namespace("gxp");
gxp.GoogleEarthPanel=Ext.extend(Ext.Panel,{HORIZONTAL_FIELD_OF_VIEW:30*Math.PI/180,map:null,mapPanel:null,layers:null,earth:null,projection:null,layerCache:null,initComponent:function(){this.addEvents("beforeadd","pluginfailure","pluginready");gxp.GoogleEarthPanel.superclass.initComponent.call(this);var a=this.mapPanel;a&&!(a instanceof GeoExt.MapPanel)&&(a=Ext.getCmp(a));if(!a)throw Error("Could not get map panel from config: "+this.mapPanel);this.map=a.map;this.layers=a.layers;this.projection=new OpenLayers.Projection("EPSG:4326");
this.on("render",this.onRenderEvent,this);this.on("show",this.onShowEvent,this);this.on("hide",function(){null!=this.earth&&this.updateMap();this.body.dom.innerHTML="";this.earth=null},this)},onEarthReady:function(a){this.earth=a;void 0===this.flyToSpeed?this.earth.getOptions().setFlyToSpeed(this.earth.SPEED_TELEPORT):null!==this.flyToSpeed&&this.earth.getOptions().setFlyToSpeed(this.flyToSpeed);this.resetCamera();this.setExtent(this.map.getExtent());this.earth.getNavigationControl().setVisibility(this.earth.VISIBILITY_SHOW);
a=this.earth.getNavigationControl().getScreenXY();a.setXUnits(this.earth.UNITS_PIXELS);a.setYUnits(this.earth.UNITS_INSET_PIXELS);this.earth.getWindow().setVisibility(!0);this.layers.each(function(a){this.addLayer(a)},this);this.layers.on("remove",this.updateLayers,this);this.layers.on("update",this.updateLayers,this);this.layers.on("add",this.updateLayers,this);this.fireEvent("pluginready",this.earth)},onRenderEvent:function(){var a=this.ownerCt&&this.ownerCt.layout instanceof Ext.layout.CardLayout;
if(!this.hidden&&!a)this.onShowEvent()},onShowEvent:function(){if(this.rendered){var a=function(a){return a*(Math.PI/180)},b=function(){this.pixelOrigin_=new google.maps.Point(128,128);this.pixelsPerLonDegree_=256/360;this.pixelsPerLonRadian_=256/(2*Math.PI)};b.prototype.fromLatLngToPoint=function(b,c){var d=c||new google.maps.Point(0,0),e=this.pixelOrigin_;d.x=e.x+b.lng()*this.pixelsPerLonDegree_;var f;f=Math.sin(a(b.lat()));f=Math.max(f,-0.9999);f=Math.min(f,0.9999);d.y=e.y+0.5*Math.log((1+f)/(1-
f))*-this.pixelsPerLonRadian_;return d};b.prototype.fromDivPixelToLatLng=function(a,b){var c=this.pixelOrigin_,d=Math.pow(2,b),e=(a.x/d-c.x)/this.pixelsPerLonDegree_,c=2*Math.atan(Math.exp((a.y/d-c.y)/-this.pixelsPerLonRadian_))-Math.PI/2;return new google.maps.LatLng(c/(Math.PI/180),e)};b.prototype.fromDivPixelToSphericalMercator=function(b,c){var d=this.fromDivPixelToLatLng(b,c),e=6378137*a(d.lng()),d=a(d.lat()),d=3189068.5*Math.log((1+Math.sin(d))/(1-Math.sin(d)));return new google.maps.Point(e,
d)};this.layerCache={};var c=this.map,d=this.map.center.clone();d.transform(this.map.projection,"EPSG:4326");var d=new google.maps.Map(this.body.dom,{center:{lat:d.lat,lng:d.lon},zoom:this.map.zoom},this.onEarthReady.createDelegate(this),function(a){this.fireEvent("pluginfailure",this,a)}.createDelegate(this)),e;for(e in c.layers)if(c.layers[e].url&&"string"==typeof c.layers[e].url&&c.layers[e].url.match(/wms/i)){var f=c.layers[e],g=new google.maps.ImageMapType({name:f.name,getTileUrl:function(a,
c){var d=new google.maps.Point(256*a.x,256*(a.y+1)),e=new google.maps.Point(256*(a.x+1),256*a.y),g=new b,d=g.fromDivPixelToSphericalMercator(d,c),m=g.fromDivPixelToSphericalMercator(e,c),e=d.y,d=d.x,g=m.y,m=m.x;m<d&&(m=Math.abs(m));var o=f.url,o=o+"&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1"+("&LAYERS="+f.params.LAYERS),o=o+("&STYLES="+f.params.STYLES),o=o+("&FORMAT="+f.params.FORMAT);return o+"&TILED=true&TRANSPARENT=true&SRS=EPSG:900913"+("&BBOX="+(d+","+e+","+m+","+g))+"&WIDTH=256&HEIGHT=256"},
tileSize:new google.maps.Size(256,256),isPng:!0});d.overlayMapTypes.push(g)}}},beforeDestroy:function(){this.layers.un("remove",this.updateLayers,this);this.layers.un("update",this.updateLayers,this);this.layers.un("add",this.updateLayers,this);gxp.GoogleEarthPanel.superclass.beforeDestroy.call(this)},updateLayers:function(){if(this.earth){for(var a=this.earth.getFeatures(),b=a.getFirstChild();null!=b;)a.removeChild(b),b=a.getFirstChild();this.layers.each(function(a){this.addLayer(a)},this)}},addLayer:function(a,
b){var c=a.getLayer(),d=c&&c.url;if(this.earth&&c instanceof OpenLayers.Layer.WMS&&"string"==typeof d&&!1!==this.fireEvent("beforeadd",a)){var e=c.id;if(this.layerCache[e])d=this.layerCache[e];else{var f=this.earth.createLink("kl_"+e),d=d.replace(/\?.*/,""),g=c.params;f.setHref(d+("/kml?mode=refresh&layers="+g.LAYERS+"&styles="+g.STYLES));d=this.earth.createNetworkLink("nl_"+e);d.setName(e);d.set(f,!1,!1);this.layerCache[e]=d}d.setVisibility(c.getVisibility());void 0!==b&&b<this.earth.getFeatures().getChildNodes().getLength()?
this.earth.getFeatures().insertBefore(this.earth.getFeatures().getChildNodes().item(b)):this.earth.getFeatures().appendChild(d)}},setExtent:function(a){var a=a.transform(this.map.getProjectionObject(),this.projection),b=a.getCenterLonLat(),a=this.getExtentWidth(a)/(2*Math.tan(this.HORIZONTAL_FIELD_OF_VIEW)),c=this.earth.getView().copyAsLookAt(this.earth.ALTITUDE_RELATIVE_TO_GROUND);c.setLatitude(b.lat);c.setLongitude(b.lon);c.setRange(a);this.earth.getView().setAbstractView(c)},resetCamera:function(){var a=
this.earth.getView().copyAsCamera(this.earth.ALTITUDE_RELATIVE_TO_GROUND);a.setRoll(0);a.setHeading(0);a.setTilt(0);this.earth.getView().setAbstractView(a)},getExtent:function(){var a=this.earth.getView().getViewportGlobeBounds();return new OpenLayers.Bounds(a.getWest(),a.getSouth(),a.getEast(),a.getNorth())},updateMap:function(){var a=this.earth.getView().copyAsLookAt(this.earth.ALTITUDE_RELATIVE_TO_GROUND),b=this.reprojectToMap(new OpenLayers.LonLat(a.getLongitude(),a.getLatitude()));this.map.zoomToExtent(this.reprojectToMap(this.getExtent()),
!0);this.map.setCenter(b);var a=2*a.getRange()*Math.tan(this.HORIZONTAL_FIELD_OF_VIEW),c=this.map.getResolutionForZoom(this.map.getZoom()+1),d=this.map.getExtent(),b=new OpenLayers.Bounds(b.lon-this.map.getSize().w/2*c,b.lat+this.map.getSize().h/2*c,b.lon+this.map.getSize().w/2*c,b.lat-this.map.getSize().h/2*c),d=Math.abs(this.getExtentWidth(d)-a);Math.abs(this.getExtentWidth(b)-a)<d&&this.map.zoomTo(this.map.getZoom()+1)},getExtentWidth:function(a){var b=a.getCenterLonLat(),c=new OpenLayers.LonLat(a.left,
b.lat),a=new OpenLayers.LonLat(a.right,b.lat);return 1E3*OpenLayers.Util.distVincenty(c,a)},reprojectToGE:function(a){return a.clone().transform(this.map.getProjectionObject(),this.projection)},reprojectToMap:function(a){return a.clone().transform(this.projection,this.map.getProjectionObject())}});Ext.reg("gxp_googleearthpanel",gxp.GoogleEarthPanel);Ext.namespace("gxp");
gxp.Viewer=Ext.extend(Ext.util.Observable,{defaultToolType:"gxp_tool",tools:null,selectedLayer:null,authenticate:null,saveErrorText:"Trouble saving: ",constructor:function(a){this.addEvents("ready","beforecreateportal","portalready","beforelayerselectionchange","layerselectionchange","featureedit","authorizationchange","beforesave","beforedelete","save","beforehashchange","delete");Ext.apply(this,{layerSources:{},portalItems:[]});this.createLayerRecordQueue=[];(a.loadConfig||this.loadConfig).call(this,
a,this.applyConfig);gxp.Viewer.superclass.constructor.apply(this,arguments)},selectLayer:function(a){var a=a||null,b=!1;if(!1!==this.fireEvent("beforelayerselectionchange",a))b=!0,this.selectedLayer&&this.selectedLayer.set("selected",!1),(this.selectedLayer=a)&&this.selectedLayer.set("selected",!0),this.fireEvent("layerselectionchange",a);return b},loadConfig:function(a){this.applyConfig(a)},applyConfig:function(a){this.initialConfig=Ext.apply({},a);Ext.apply(this,this.initialConfig);this.load()},
load:function(){if(this.proxy)OpenLayers.ProxyHost=this.proxy;this.initMapPanel();this.initTools();var a=[],b;for(b in this.sources)a.push(this.createSourceLoader(b));a.push(function(a){Ext.onReady(function(){this.initPortal();a()},this)});gxp.util.dispatch(a,this.activate,this)},createSourceLoader:function(a){return function(b){var c=this.sources[a];c.projection=this.initialConfig.map.projection;this.addLayerSource({id:a,config:c,callback:b,fallback:function(){b()},scope:this})}},addLayerSource:function(a){var b=
a.id||Ext.id(null,"gxp-source-"),c,d=a.config;d.id=b;try{c=Ext.ComponentMgr.createPlugin(d,this.defaultSourceType)}catch(e){throw Error("Could not create new source plugin with ptype: "+a.config.ptype);}c.on({ready:{fn:function(){(a.callback||Ext.emptyFn).call(a.scope||this,b)},scope:this,single:!0},failure:{fn:function(){var c=a.fallback||Ext.emptyFn;delete this.layerSources[b];c.apply(a.scope||this,arguments)},scope:this,single:!0}});this.layerSources[b]=c;c.init(this);return c},initMapPanel:function(){var a=
Ext.apply({},this.initialConfig.map),b={},c={wrapDateLine:void 0!==a.wrapDateLine?a.wrapDateLine:!0,minZoomLevel:a.minZoomLevel,maxZoomLevel:a.maxZoomLevel,maxResolution:a.maxResolution,numZoomLevels:a.numZoomLevels,displayInLayerSwitcher:!1};if(this.initialConfig.map)for(var d="theme,controls,resolutions,projection,units,maxExtent,restrictedExtent,maxResolution,numZoomLevels,panMethod".split(","),e,f=d.length-1;0<=f;--f)e=d[f],e in a&&(b[e]=a[e],delete a[e]);this.mapPanel=Ext.ComponentMgr.create(Ext.applyIf({xtype:a.xtype||
"gx_mappanel",map:Ext.applyIf({theme:b.theme||null,controls:b.controls||[new OpenLayers.Control.Navigation({zoomWheelOptions:{interval:250},dragPanOptions:{enableKinetic:!0}}),new OpenLayers.Control.PanPanel,new OpenLayers.Control.ZoomPanel,new OpenLayers.Control.Attribution],maxExtent:b.maxExtent&&OpenLayers.Bounds.fromArray(b.maxExtent),restrictedExtent:b.restrictedExtent&&OpenLayers.Bounds.fromArray(b.restrictedExtent),numZoomLevels:b.numZoomLevels||20},b),center:a.center&&new OpenLayers.LonLat(a.center[0],
a.center[1]),resolutions:a.resolutions,forceInitialExtent:!0,layers:[new OpenLayers.Layer(null,c)],items:this.mapItems,plugins:this.mapPlugins,tbar:a.tbar||new Ext.Toolbar({hidden:!0})},a));this.mapPanel.getTopToolbar().on({afterlayout:this.mapPanel.map.updateSize,show:this.mapPanel.map.updateSize,hide:this.mapPanel.map.updateSize,scope:this.mapPanel.map});this.mapPanel.layers.on({add:function(a,b){for(var c,d=b.length-1;0<=d;d--)c=b[d],!0===c.get("selected")&&this.selectLayer(c)},remove:function(a,
b){!0===b.get("selected")&&this.selectLayer()},scope:this})},initTools:function(){this.tools={};if(this.initialConfig.tools&&0<this.initialConfig.tools.length)for(var a,b=0,c=this.initialConfig.tools.length;b<c;b++){try{a=Ext.ComponentMgr.createPlugin(this.initialConfig.tools[b],this.defaultToolType)}catch(d){throw Error("Could not create tool plugin with ptype: "+this.initialConfig.tools[b].ptype);}a.init(this)}},initPortal:function(){var a=Ext.apply({},this.portalConfig);if(0===this.portalItems.length)this.mapPanel.region=
"center",this.portalItems.push(this.mapPanel);this.fireEvent("beforecreateportal");this.portal=Ext.ComponentMgr.create(Ext.applyIf(a,{layout:"fit",hideBorders:!0,items:{layout:"border",deferredRender:!1,items:this.portalItems}}),a.renderTo?"panel":"viewport");this.fireEvent("portalready")},activate:function(){Ext.QuickTips.init();this.addLayers();this.checkLayerRecordQueue();this.fireEvent("ready")},addLayers:function(){var a=this.initialConfig.map;if(a&&a.layers){for(var b,c,d=[],e=[],f=0;f<a.layers.length;++f)b=
a.layers[f],(c=this.layerSources[b.source])?(b=c.createLayerRecord(b))&&("background"===b.get("group")?d.push(b):e.push(b)):window.console&&console.warn("Non-existing source '"+b.source+"' referenced in layer config.");a=this.mapPanel;d=d.concat(e);d.length&&a.layers.add(d)}},getLayerRecordFromMap:function(a){var b=null;this.mapPanel&&this.mapPanel.layers.each(function(c){if(c.get("source")==a.source&&c.get("name")==a.name)return b=c,!1});return b},createLayerRecord:function(a,b,c){this.createLayerRecordQueue.push({config:a,
callback:b,scope:c});this.checkLayerRecordQueue()},checkLayerRecordQueue:function(){for(var a,b,c,d,e=[],f=0,g=this.createLayerRecordQueue.length;f<g;++f)d=!1,a=this.createLayerRecordQueue[f],b=a.config.source,b in this.layerSources&&(b=this.layerSources[b],(c=b.createLayerRecord(a.config))?(function(a,b){window.setTimeout(function(){a.callback.call(a.scope,b)},0)}(a,c),d=!0):b.lazy&&b.store.load({callback:this.checkLayerRecordQueue,scope:this})),d||e.push(a);this.createLayerRecordQueue=e},getSource:function(a){return a&&
this.layerSources[a.get("source")]},getState:function(){var a=Ext.apply({},this.initialConfig),b=this.mapPanel.map.getCenter();Ext.apply(a.map,{center:[b.lon,b.lat],zoom:this.mapPanel.map.zoom,layers:[]});var c={};this.mapPanel.layers.each(function(b){var e=b.getLayer();if(e.displayInLayerSwitcher&&!(e instanceof OpenLayers.Layer.Vector)){var f=b.get("source"),g=this.layerSources[f];g?(a.map.layers.push(g.getConfigForRecord(b)),c[f]||(c[f]=g.getState())):window.console&&console.warn("Could not find source type (e.g gxp_wmssource) for layer '"+
e.name+"' and layer id '"+e.id+"'.")}},this);Ext.apply(this.sources,c);a.tools=[];Ext.iterate(this.tools,function(b,c){c.getState!=gxp.plugins.Tool.prototype.getState&&a.tools.push(c.getState())});return a},isAuthorized:function(a){var b=!0;if(this.authorizedRoles){b=!1;a||(a="ROLE_ADMINISTRATOR");Ext.isArray(a)||(a=[a]);for(var c=a.length-1;0<=c;--c)if(~this.authorizedRoles.indexOf(a[c])){b=!0;break}}return b},setAuthorizedRoles:function(a){this.authorizedRoles=a;this.fireEvent("authorizationchange")},
cancelAuthentication:function(){this._authFn&&this.un("authorizationchange",this._authFn,this);this.fireEvent("authorizationchange")},isAuthenticated:function(){return!this.authorizedRoles||0<this.authorizedRoles.length},doAuthorized:function(a,b,c){this.isAuthorized(a)||!this.authenticate?window.setTimeout(function(){b.call(c)},0):(this.authenticate(),this._authFn=function(){delete this._authFn;this.doAuthorized(a,b,c,!0)},this.on("authorizationchange",this._authFn,this,{single:!0}))},save:function(a,
b){var c=Ext.util.JSON.encode(this.getState()),d,e;this.id?(d="PUT",e="../maps/"+this.id):(d="POST",e="../maps/");c={method:d,url:e,data:c};!1!==this.fireEvent("beforesave",c,a)&&OpenLayers.Request.issue(Ext.apply(c,{callback:function(c){this.handleSave(c);a&&a.call(b||this,c)},scope:this}))},deleteMap:function(a,b){if(this.id){var c={method:"DELETE",url:"../maps/"+this.id};!1!==this.fireEvent("beforedelete",c,a)&&OpenLayers.Request.issue(Ext.apply(c,{callback:function(c){this.handleSave(c,!0);a&&
a.call(b||this,c)},scope:this}))}},handleSave:function(a,b){if(200==a.status){var c=Ext.util.JSON.decode(a.responseText).id;if(c&&!b){this.id=c;var d="#maps/"+c;if(!1!==this.fireEvent("beforehashchange",d))window.location.hash=d;this.fireEvent("save",this.id)}if(b){c=this.id;delete this.id;if(!1!==this.fireEvent("beforehashchange",d))window.location.hash="";this.fireEvent("delete",c)}}else window.console&&console.warn(this.saveErrorText+a.responseText)},save:function(a,b){var c=Ext.util.JSON.encode(this.getState()),
d,e;this.id?(d="PUT",e="../maps/"+this.id):(d="POST",e="../maps/");c={method:d,url:e,data:c};!1!==this.fireEvent("beforesave",c,a)&&OpenLayers.Request.issue(Ext.apply(c,{callback:function(c){this.handleSave(c);a&&a.call(b||this,c)},scope:this}))},handleSave:function(a){if(200==a.status){if(a=Ext.util.JSON.decode(a.responseText).id){this.id=a;a="#maps/"+a;if(!1!==this.fireEvent("beforehashchange",a))window.location.hash=a;this.fireEvent("save",this.id)}}else window.console&&console.warn(this.saveErrorText+
a.responseText)},destroy:function(){this.mapPanel.destroy();this.portal&&this.portal.destroy()}});(function(){OpenLayers.DOTS_PER_INCH=25.4/0.28})();Ext.namespace("gxp");
gxp.EmbedMapDialog=Ext.extend(Ext.Container,{url:null,url:null,publishMessage:"Your map is ready to be published to the web! Simply copy the following HTML to embed the map in your website:",heightLabel:"Height",widthLabel:"Width",mapSizeLabel:"Map Size",miniSizeLabel:"Mini",smallSizeLabel:"Small",premiumSizeLabel:"Premium",largeSizeLabel:"Large",snippetArea:null,heightField:null,widthField:null,initComponent:function(){Ext.apply(this,this.getConfig());gxp.EmbedMapDialog.superclass.initComponent.call(this)},
getIframeHTML:function(){return this.snippetArea.getValue()},updateSnippet:function(){this.snippetArea.setValue('<iframe style="border: none;" height="'+this.heightField.getValue()+'" width="'+this.widthField.getValue()+'" src="'+gxp.util.getAbsoluteUrl(this.url)+'"></iframe>');!0===this.snippetArea.isVisible()&&this.snippetArea.focus(!0,100)},getConfig:function(){this.snippetArea=new Ext.form.TextArea({height:70,selectOnFocus:!0,readOnly:!0});var a={change:this.updateSnippet,specialkey:function(a,
c){c.getKey()==c.ENTER&&this.updateSnippet()},scope:this};this.heightField=new Ext.form.NumberField({width:50,value:400,listeners:a});this.widthField=new Ext.form.NumberField({width:50,value:600,listeners:a});return{border:!1,defaults:{border:!1,cls:"gxp-export-section",xtype:"container",layout:"fit"},items:[{items:[new Ext.Container({layout:"column",defaults:{border:!1,xtype:"box"},items:[{autoEl:{cls:"gxp-field-label",html:this.mapSizeLabel}},new Ext.form.ComboBox({editable:!1,width:75,store:new Ext.data.SimpleStore({fields:["name",
"height","width"],data:[[this.miniSizeLabel,100,100],[this.smallSizeLabel,200,300],[this.largeSizeLabel,400,600],[this.premiumSizeLabel,600,800]]}),triggerAction:"all",displayField:"name",value:this.largeSizeLabel,mode:"local",listeners:{select:function(a,c){this.widthField.setValue(c.get("width"));this.heightField.setValue(c.get("height"));this.updateSnippet()},scope:this}}),{autoEl:{cls:"gxp-field-label",html:this.heightLabel}},this.heightField,{autoEl:{cls:"gxp-field-label",html:this.widthLabel}},
this.widthField]})]},{xtype:"box",autoEl:{tag:"p",html:this.publishMessage}},{items:[this.snippetArea]}],listeners:{afterrender:this.updateSnippet,scope:this}}}});Ext.reg("gxp_embedmapdialog",gxp.EmbedMapDialog);Ext.namespace("gxp");
gxp.RulePanel=Ext.extend(Ext.TabPanel,{fonts:void 0,symbolType:"Point",rule:null,attributes:null,nestedFilters:!0,minScaleDenominatorLimit:1.577757414193268E9*Math.pow(0.5,19)*OpenLayers.DOTS_PER_INCH/256,maxScaleDenominatorLimit:1.577757414193268E9*OpenLayers.DOTS_PER_INCH/256,scaleLevels:20,scaleSliderTemplate:"{scaleType} Scale 1:{scale}",modifyScaleTipContext:Ext.emptyFn,classifyEnabled:!1,labelFeaturesText:"Label Features",labelsText:"Labels",basicText:"Basic",advancedText:"Advanced",limitByScaleText:"Limit by scale",
limitByConditionText:"Limit by condition",symbolText:"Symbol",nameText:"Name",initComponent:function(){Ext.applyIf(this,{plain:!0,border:!1});if(this.rule){if(!this.initialConfig.symbolType)this.symbolType=this.getSymbolTypeFromRule(this.rule)||this.symbolType}else this.rule=new OpenLayers.Rule({name:this.uniqueRuleName()});this.activeTab=0;this.textSymbolizer=new gxp.TextSymbolizer({symbolizer:this.getTextSymbolizer(),attributes:this.attributes,fonts:this.fonts,listeners:{change:function(){this.fireEvent("change",
this,this.rule)},scope:this}});this.scaleLimitPanel=new gxp.ScaleLimitPanel({maxScaleDenominator:this.rule.maxScaleDenominator||void 0,limitMaxScaleDenominator:!!this.rule.maxScaleDenominator,maxScaleDenominatorLimit:this.maxScaleDenominatorLimit,minScaleDenominator:this.rule.minScaleDenominator||void 0,limitMinScaleDenominator:!!this.rule.minScaleDenominator,minScaleDenominatorLimit:this.minScaleDenominatorLimit,scaleLevels:this.scaleLevels,scaleSliderTemplate:this.scaleSliderTemplate,modifyScaleTipContext:this.modifyScaleTipContext,
listeners:{change:function(a,b,c){this.rule.minScaleDenominator=b;this.rule.maxScaleDenominator=c;this.fireEvent("change",this,this.rule)},scope:this}});this.filterBuilder=new gxp.FilterBuilder({allowGroups:this.nestedFilters,filter:this.rule&&this.rule.filter&&this.rule.filter.clone(),attributes:this.attributes,listeners:{change:function(a){this.rule.filter=a.getFilter();this.fireEvent("change",this,this.rule)},scope:this}});this.items=[{title:this.labelsText,autoScroll:!0,bodyStyle:{padding:"10px"},
items:[{xtype:"fieldset",title:this.labelFeaturesText,autoHeight:!0,checkboxToggle:!0,collapsed:!this.hasTextSymbolizer(),items:[this.textSymbolizer],listeners:{collapse:function(){OpenLayers.Util.removeItem(this.rule.symbolizers,this.getTextSymbolizer());this.fireEvent("change",this,this.rule)},expand:function(){this.setTextSymbolizer(this.textSymbolizer.symbolizer);this.fireEvent("change",this,this.rule)},scope:this}}]}];if(this.getSymbolTypeFromRule(this.rule)||this.symbolType)this.items=[{title:this.basicText,
autoScroll:!0,items:[this.createHeaderPanel(),this.createSymbolizerPanel(),this.createClassificationPanel()]},this.items[0],{title:this.advancedText,defaults:{style:{margin:"7px"}},autoScroll:!0,items:[{xtype:"fieldset",title:this.limitByScaleText,checkboxToggle:!0,collapsed:!(this.rule&&(this.rule.minScaleDenominator||this.rule.maxScaleDenominator)),autoHeight:!0,items:[this.scaleLimitPanel],listeners:{collapse:function(){delete this.rule.minScaleDenominator;delete this.rule.maxScaleDenominator;
this.fireEvent("change",this,this.rule)},expand:function(){var a=this.getActiveTab();this.activeTab=null;this.setActiveTab(a);a=!1;if(this.scaleLimitPanel.limitMinScaleDenominator)this.rule.minScaleDenominator=this.scaleLimitPanel.minScaleDenominator,a=!0;if(this.scaleLimitPanel.limitMaxScaleDenominator)this.rule.maxScaleDenominator=this.scaleLimitPanel.maxScaleDenominator,a=!0;a&&this.fireEvent("change",this,this.rule)},scope:this}},{xtype:"fieldset",title:this.limitByConditionText,checkboxToggle:!0,
hidden:this.classifyEnabled,collapsed:!(this.rule&&this.rule.filter),autoHeight:!0,items:[this.filterBuilder],listeners:{collapse:function(){delete this.rule.filter;this.fireEvent("change",this,this.rule)},expand:function(){this.rule.filter=this.filterBuilder.getFilter();this.fireEvent("change",this,this.rule)},scope:this}}]}];this.items[0].autoHeight=!0;this.addEvents("change");this.on({tabchange:function(a,b){b.doLayout()},afterRender:function(){this.classifyEnabled&&Ext.getCmp(Ext.get(this.items.items[0].items.items[1].id).child("[name=color]").id).setVisible(!1)},
scope:this});gxp.RulePanel.superclass.initComponent.call(this)},hasTextSymbolizer:function(){for(var a,b,c=0,d=this.rule.symbolizers.length;c<d;++c)if(a=this.rule.symbolizers[c],a instanceof OpenLayers.Symbolizer.Text){b=a;break}return b},getTextSymbolizer:function(){var a=this.hasTextSymbolizer();a||(a=new OpenLayers.Symbolizer.Text({graphic:!1}));return a},setTextSymbolizer:function(a){for(var b,c=0,d=this.rule.symbolizers.length;c<d;++c)if(candidate=this.rule.symbolizers[c],this.rule.symbolizers[c]instanceof
OpenLayers.Symbolizer.Text){this.rule.symbolizers[c]=a;b=!0;break}b||this.rule.symbolizers.push(a)},uniqueRuleName:function(){return OpenLayers.Util.createUniqueID("rule_")},createHeaderPanel:function(){this.symbolizerSwatch=new GeoExt.FeatureRenderer({symbolType:this.symbolType,isFormField:!0,fieldLabel:this.symbolText});return{xtype:"form",border:!1,labelAlign:"top",defaults:{border:!1},style:{padding:"0.3em 0 0 1em"},items:[{layout:"column",defaults:{border:!1,style:{"padding-right":"1em"}},items:[{layout:"form",
width:150,items:[{xtype:"textfield",hidden:this.classifyEnabled,fieldLabel:this.nameText,anchor:"95%",value:this.rule&&(this.rule.title||this.rule.name||""),listeners:{change:function(a,b){this.rule.title=b;this.fireEvent("change",this,this.rule)},scope:this}}]},{layout:"form",width:70,items:[this.symbolizerSwatch]}]}]}},createSymbolizerPanel:function(){var a,b,c=OpenLayers.Symbolizer[this.symbolType],d=!1;if(c){for(var e=0,f=this.rule.symbolizers.length;e<f;++e)if(a=this.rule.symbolizers[e],a instanceof
c){d=!0;b=a;break}b||(b=new c({fill:!1,stroke:!1}))}else throw Error("Appropriate symbolizer type not included in build: "+this.symbolType);this.symbolizerSwatch.setSymbolizers([b],{draw:this.symbolizerSwatch.rendered});a={xtype:"gxp_"+this.symbolType.toLowerCase()+"symbolizer",symbolizer:b,bodyStyle:{padding:"10px"},border:!1,labelWidth:70,defaults:{labelWidth:70},listeners:{change:function(a){this.symbolizerSwatch.setSymbolizers([a],{draw:this.symbolizerSwatch.rendered});d||(this.rule.symbolizers.push(a),
d=!0);this.fireEvent("change",this,this.rule)},scope:this}};if("Point"===this.symbolType&&this.pointGraphics)a.pointGraphics=this.pointGraphics;return a},createClassificationPanel:function(){this.classifyEnabled&&(this.rule.classify=!0);return new gxp.ClassificationPanel({bodyStyle:{padding:"10px"},border:!1,labelWidth:70,defaults:{labelWidth:70},hidden:!this.classifyEnabled,rulePanel:this})},getSymbolTypeFromRule:function(a){for(var b,c,d=0,e=a.symbolizers.length;d<e;++d)if(b=a.symbolizers[d],!(b instanceof
OpenLayers.Symbolizer.Text)){c=b.CLASS_NAME.split(".").pop();break}return c}});Ext.reg("gxp_rulepanel",gxp.RulePanel);Ext.namespace("gxp");
gxp.ClassificationPanel=Ext.extend(Ext.Panel,{hidden:!1,rulePanel:null,customRamp:"Custom",classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",rampOrangeText:"Orange",rampJetText:"Blue-Red",rampGrayText:"Gray",rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",colorEndText:"End Color",colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",
methodJenksText:"Jenks Natural Breaks",selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",reverseColorsText:"Reverse colors",initComponent:function(){var a;this.rulePanel.colorManager&&(a=[new this.rulePanel.colorManager]);var b=new Ext.Panel({hidden:!0,layout:"form",bodyStyle:{padding:"10px"},border:!1,labelWidth:70,defaults:{labelWidth:70},
items:[{xtype:"gxp_colorfield",id:"choropleth_color_start",name:"color_start",fieldLabel:this.colorStartText,emptyText:OpenLayers.Renderer.defaultSymbolizer.strokeColor,value:this.startColor,defaultBackground:this.startColor,plugins:a,listeners:{valid:function(a){this.rulePanel.rule[a.name]=a.getValue()},scope:this}},{xtype:"gxp_colorfield",id:"choropleth_color_end",name:"color_end",fieldLabel:this.colorEndText,emptyText:OpenLayers.Renderer.defaultSymbolizer.strokeColor,value:this.endColor,defaultBackground:this.endColor,
plugins:a,listeners:{valid:function(a){this.rulePanel.rule[a.name]=a.getValue()},scope:this}}]}),c=new Ext.ux.form.SpinnerField({fieldLabel:this.classNumberText,id:"choropleth_classes",minValue:2,name:"intervals",defaultValue:5,width:110,listeners:{change:function(a,b){this.rulePanel.rule[c.name]=b},scope:this}});this.rulePanel.rule[c.name]=c.defaultValue;a=new Ext.form.ComboBox({id:"choropleth_colorramp",name:"ramp",fieldLabel:this.colorRampText,store:new Ext.data.ArrayStore({id:0,fields:["colorramp",
"label"],data:[["Blue",this.rampBlueText],["Red",this.rampRedText],["Orange",this.rampOrangeText],["Jet",this.rampJetText],["Gray",this.rampGrayText],["Random",this.rampRandomText],["Custom",this.rampCustomText]]}),mode:"local",width:110,displayField:"label",valueField:"colorramp",editable:!1,emptyText:this.selectColorText,triggerAction:"all",disabled:!1,listeners:{select:function(a){b.setVisible(a.value==this.customRamp);switch(a.value){case "Blue":this.rulePanel.rule.color_start="#f7fbff";this.rulePanel.rule.color_end=
"#08306b";this.rulePanel.rule[a.name]=this.customRamp;break;case "Red":this.rulePanel.rule.color_start="#fff5f0";this.rulePanel.rule.color_end="#67000d";this.rulePanel.rule[a.name]=this.customRamp;break;case "Orange":this.rulePanel.rule.color_start="#fff5eb";this.rulePanel.rule.color_end="#f16913";this.rulePanel.rule[a.name]=this.customRamp;break;case "Jet":this.rulePanel.rule[a.name]="Jet";break;default:this.rulePanel.rule.color_mid="",this.rulePanel.rule[a.name]=a.value}},scope:this}});var d=new Ext.form.ComboBox({id:"choropleth_method",
name:"method",fieldLabel:this.methodText,store:new Ext.data.ArrayStore({id:0,mode:"local",autoDestroy:!0,storeId:"method_array_store",fields:["value","label"],data:[["uniqueInterval",this.methodUniqueText],["quantile",this.methodQuantileText],["equalInterval",this.methodEqualText],["jenks",this.methodJenksText]]}),displayField:"label",valueField:"value",mode:"local",width:110,editable:!1,emptyText:this.selectMethodText,triggerAction:"all",disabled:!1,listeners:{select:function(a){c.setDisabled("uniqueInterval"==
a.value);this.rulePanel.rule[a.name]=a.value},scope:this}});this.items=[{xtype:"fieldset",title:this.classifyText,labelWidth:85,style:"margin-bottom: 0;",items:[new Ext.form.ComboBox({id:"choropleth_attribute",name:"attribute",fieldLabel:this.attributeText,store:this.rulePanel.attributes,displayField:"name",valueField:"name",triggerAction:"all",mode:"local",width:110,editable:!1,emptyText:this.selectAttributeText,disabled:!1,listeners:{select:function(a,b,c){this.rulePanel.rule[a.name]=a.value;d.clearValue();
for(var b=d.getStore(),h=0,j=b.data.length;h<j;h++)b.getAt(h).disabled="xsd:string"==a.getStore().getAt(c).get("type")?"uniqueInterval"!=b.getAt(h).get("value"):!1;b.loadData("xsd:string"==a.getStore().getAt(c).get("type")?[["uniqueInterval",this.methodUniqueText]]:[["uniqueInterval",this.methodUniqueText],["quantile",this.methodQuantileText],["equalInterval",this.methodEqualText],["jenks",this.methodJenksText]])},scope:this}}),d,c,a,{xtype:"checkbox",name:"reverse",checked:!1,ctCls:"x-checkbox-inline",
hideLabel:!0,labelSeparator:"",labelStyle:"display:inline;",boxLabel:this.reverseColorsText,handler:function(a){this.rulePanel.rule.reverse=a.checked},scope:this},b,{xtype:"button",name:"apply",text:this.generateRulesText,fieldLabel:"&nbsp;",style:"margin-top:10px;",labelSeparator:"",handler:function(){this.rulePanel.fireEvent("change",this.rulePanel,this.rulePanel.rule)},scope:this}]}];gxp.ClassificationPanel.superclass.initComponent.call(this)}});Ext.reg("gxp_classificationpanel",gxp.ClassificationPanel);
Ext.namespace("gxp");
gxp.StylePropertiesDialog=Ext.extend(Ext.Container,{titleText:"General",nameFieldText:"Name",titleFieldText:"Title",abstractFieldText:"Abstract",userStyle:null,initComponent:function(){Ext.applyIf(this,{layout:"form",items:[{xtype:"fieldset",title:this.titleText,labelWidth:75,defaults:{xtype:"textfield",anchor:"100%",listeners:{change:function(a,b){this.userStyle[a.name]=b;this.fireEvent("change",this,this.userStyle)},scope:this}},items:[{xtype:this.initialConfig.nameEditable?"textfield":"displayfield",
fieldLabel:this.nameFieldText,name:"name",value:this.userStyle.name,maskRe:/[A-Za-z0-9_]/},{fieldLabel:this.titleFieldText,name:"title",value:this.userStyle.title},{xtype:"textarea",fieldLabel:this.abstractFieldText,name:"description",value:this.userStyle.description}]}]});this.addEvents("change");gxp.StylePropertiesDialog.superclass.initComponent.apply(this,arguments)}});Ext.reg("gxp_stylepropertiesdialog",gxp.StylePropertiesDialog);
OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc.Literal=function(a,b){b.value=this.getChildValue(a)};Ext.namespace("gxp");
gxp.WMSStylesDialog=Ext.extend(Ext.Container,{addStyleText:"Add",addStyleTip:"Add a new style",chooseStyleText:"Choose style",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes",deleteStyleText:"Remove",deleteStyleTip:"Delete the selected style",editStyleText:"Edit",editStyleTip:"Edit the selected style",duplicateStyleText:"Duplicate",duplicateStyleTip:"Duplicate the selected style",addRuleText:"Add",addRuleTip:"Add a new rule",newRuleText:"New Rule",deleteRuleText:"Remove",
deleteRuleTip:"Delete the selected rule",editRuleText:"Edit",editRuleTip:"Edit the selected rule",duplicateRuleText:"Duplicate",duplicateRuleTip:"Duplicate the selected rule",cancelText:"Cancel",saveText:"Save",styleWindowTitle:"User Style: {0}",ruleWindowTitle:"Style Rule: {0}",stylesFieldsetTitle:"Styles",rulesFieldsetTitle:"Rules",errorTitle:"Error saving style",errorMsg:"There was an error saving the style back to the server.",layerRecord:null,layerDescription:null,symbolType:null,stylesStore:null,
selectedStyle:null,selectedRule:null,editable:!0,modified:!1,dialogCls:Ext.Window,classifyEnabled:!1,initComponent:function(){this.addEvents("ready","modified","styleselected","beforesaved","saved");Ext.applyIf(this,{layout:"form",disabled:!0,items:[{xtype:"fieldset",title:this.stylesFieldsetTitle,labelWidth:85,style:"margin-bottom: 0;"},{xtype:"toolbar",style:"border-width: 0 1px 1px 1px; margin-bottom: 10px;",items:[{xtype:"button",iconCls:"add",text:this.addStyleText,tooltip:this.addStyleTip,handler:this.addStyle,
scope:this},{xtype:"button",iconCls:"delete",text:this.deleteStyleText,tooltip:this.deleteStyleTip,handler:function(){this.stylesStore.remove(this.selectedStyle)},scope:this},{xtype:"button",iconCls:"edit",text:this.editStyleText,tooltip:this.editStyleTip,handler:function(){this.editStyle()},scope:this},{xtype:"button",iconCls:"duplicate",text:this.duplicateStyleText,tooltip:this.duplicateStyleTip,handler:function(){var a=this.selectedStyle,b=a.get("userStyle").clone();b.isDefault=!1;b.name=this.newStyleName();
var c=this.stylesStore;c.add(new c.recordType({name:b.name,title:b.title,"abstract":b.description,userStyle:b}));this.editStyle(a)},scope:this}]}]});this.createStylesStore();this.on({beforesaved:function(){this._saving=!0},saved:function(){delete this._saving},savefailed:function(){Ext.Msg.show({title:this.errorTitle,msg:this.errorMsg,icon:Ext.MessageBox.ERROR,buttons:{ok:!0}});delete this._saving},render:function(){gxp.util.dispatch([this.getStyles],function(){this.enable()},this)},scope:this});
gxp.WMSStylesDialog.superclass.initComponent.apply(this,arguments)},addStyle:function(){if(this._ready){var a=this.selectedStyle,b=this.stylesStore,c=new OpenLayers.Style(null,{name:this.newStyleName(),rules:[this.createRule()]});b.add(new b.recordType({name:c.name,userStyle:c}));this.editStyle(a)}else this.on("ready",this.addStyle,this)},editStyle:function(a){var b=this.selectedStyle.get("userStyle"),c=new this.dialogCls(Ext.apply({bbar:["->",{text:this.cancelText,iconCls:"cancel",handler:function(){c.propertiesDialog.userStyle=
b;c.destroy();if(a)this._cancelling=!0,this.stylesStore.remove(this.selectedStyle),this.changeStyle(a,{updateCombo:!0,markModified:!0}),delete this._cancelling},scope:this},{text:this.saveText,iconCls:"save",handler:function(){c.destroy()}}]},{title:String.format(this.styleWindowTitle,b.title||b.name),shortTitle:b.title||b.name,bodyBorder:!1,autoHeight:!0,width:300,modal:!0,items:{border:!1,items:{xtype:"gxp_stylepropertiesdialog",ref:"../propertiesDialog",userStyle:b.clone(),nameEditable:!1,style:"padding: 10px;",
classifyEnabled:this.classifyEnabled&&!this.isRaster&&this.editable}},listeners:{beforedestroy:function(){this.selectedStyle.set("userStyle",c.propertiesDialog.userStyle)},scope:this}}));this.showDlg(c)},getAttributeStore:function(){return new GeoExt.data.AttributeStore({url:this.layerDescription.owsURL,baseParams:{SERVICE:this.layerDescription.owsType,REQUEST:"DescribeFeatureType",TYPENAME:this.layerDescription.typeName},method:"GET",disableCaching:!1})},classifyStyleRules:function(){for(var a=this.selectedStyle.get("userStyle"),
b=a.rules[0],c=[],d=0,e=a.rules.length;d<e;d++)c[d]=a.rules[d].clone();var f=new this.dialogCls({title:String.format(this.ruleWindowTitle,b.title||b.name||this.newRuleText),shortTitle:b.title||b.name||this.newRuleText,layout:"fit",width:320,height:450,modal:!0,items:[{xtype:"gxp_rulepanel",ref:"rulePanel",symbolType:this.symbolType,rule:b,fonts:this.fonts,classifyEnabled:!0,attributes:this.getAttributeStore(),autoScroll:!0,border:!1,defaults:{autoHeight:!0,hideMode:"offsets"},listeners:{change:this.classifyRules,
tabchange:function(){f instanceof Ext.Window&&f.syncShadow()},scope:this}}],bbar:["->",{text:this.cancelText,iconCls:"cancel",handler:function(){a.rules=c;this.afterRuleChange();this.selectedStyle.set("userStyle",a);f.destroy()},scope:this},{text:this.saveText,iconCls:"save",handler:function(){f.destroy()}}]});this.showDlg(f)},createSLD:function(a){var a=a||{},b={version:"1.0.0",namedLayers:{}},c=this.layerRecord.get("name");b.namedLayers[c]={name:c,userStyles:[]};this.stylesStore.each(function(d){(!a.userStyles||
-1!==a.userStyles.indexOf(d.get("name")))&&b.namedLayers[c].userStyles.push(d.get("userStyle"))});return(new OpenLayers.Format.SLD({multipleSymbolizers:!0,profile:"GeoServer"})).write(b)},saveStyles:function(a){!0===this.modified&&this.fireEvent("beforesaved",this,a)},updateStyleRemoveButton:function(){var a=this.selectedStyle&&this.selectedStyle.get("userStyle");this.items.get(1).items.get(1).setDisabled(!a||1>=this.stylesStore.getCount()||!0===a.isDefault)},updateRuleRemoveButton:function(){this.getComponent("rulestoolbar").items.get(1).setDisabled(!this.selectedRule||
2>this.getComponent("rulesfieldset").items.get(0).rules.length)},createRule:function(){return new OpenLayers.Rule({symbolizers:[new OpenLayers.Symbolizer[this.symbolType]]})},addRulesFieldSet:function(){var a=new Ext.form.FieldSet({itemId:"rulesfieldset",title:this.rulesFieldsetTitle,autoScroll:!0,style:"margin-bottom: 0;",hideMode:"offsets",hidden:!0}),b=new Ext.Toolbar({style:"border-width: 0 1px 1px 1px;",hidden:!0,itemId:"rulestoolbar",items:[{xtype:"button",iconCls:"add",text:this.addRuleText,
tooltip:this.addRuleTip,handler:this.addRule,scope:this},{xtype:"button",iconCls:"delete",text:this.deleteRuleText,tooltip:this.deleteRuleTip,handler:this.removeRule,scope:this,disabled:!0},{xtype:"button",iconCls:"edit",text:this.editRuleText,toolitp:this.editRuleTip,handler:function(){this.layerDescription?this.editRule():this.describeLayer(this.editRule)},scope:this,disabled:!0},{xtype:"button",iconCls:"duplicate",text:this.duplicateRuleText,tip:this.duplicateRuleTip,handler:this.duplicateRule,
scope:this,disabled:!0}]});this.add(a,b);this.doLayout();return a},addRule:function(){var a=this.getComponent("rulesfieldset").items.get(0);this.selectedStyle.get("userStyle").rules.push(this.createRule());a.update();this.selectedStyle.store.afterEdit(this.selectedStyle);this.updateRuleRemoveButton()},removeRule:function(){var a=this.selectedRule;this.getComponent("rulesfieldset").items.get(0).unselect();this.selectedStyle.get("userStyle").rules.remove(a);this.afterRuleChange()},duplicateRule:function(){var a=
this.getComponent("rulesfieldset").items.get(0),b=this.selectedRule.clone();this.selectedStyle.get("userStyle").rules.push(b);a.update();this.selectedStyle.store.afterEdit(this.selectedStyle);this.updateRuleRemoveButton()},editRule:function(){var a=this.selectedRule,b=a.clone(),c=new this.dialogCls({title:String.format(this.ruleWindowTitle,a.title||a.name||this.newRuleText),shortTitle:a.title||a.name||this.newRuleText,layout:"fit",width:320,height:450,modal:!0,items:[{xtype:"gxp_rulepanel",ref:"rulePanel",
symbolType:this.symbolType,rule:a,attributes:this.getAttributeStore(),autoScroll:!0,border:!1,defaults:{autoHeight:!0,hideMode:"offsets"},listeners:{change:this.saveRule,tabchange:function(){c instanceof Ext.Window&&c.syncShadow()},scope:this}}],bbar:["->",{text:this.cancelText,iconCls:"cancel",handler:function(){this.saveRule(c.rulePanel,b);c.destroy()},scope:this},{text:this.saveText,iconCls:"save",handler:function(){c.destroy()}}]});this.showDlg(c)},classifyRules:function(a,b){var c=this.selectedStyle.get("userStyle"),
d=this.layerRecord.getLayer(),e=this.layerRecord.get("restUrl");e||(e=d.url.split("?").shift().replace(/\/(wms|ows)\/?$/,"/rest"));var f=b.attribute&&b.method&&b.intervals&&b.ramp&&("Custom"==b.ramp?b.color_start&&b.color_end:!0),d=d.params.LAYERS;0<=d.indexOf(":")&&(d=d.split(":")[1]);f&&Ext.Ajax.request({url:e+"/sldservice/"+d+"/classify.xml",params:{attribute:b.attribute,method:b.method,intervals:b.intervals,ramp:b.ramp,startColor:b.color_start,endColor:b.color_end,reverse:b.reverse},method:"GET",
disableCaching:!1,success:function(a){for(var d=[],e=new OpenLayers.Format.Filter.v1_1_0,f=new OpenLayers.Format.XML,a=f.getElementsByTagNameNS(f.read(a.responseText).documentElement,"*","Rule"),l=0,n=a.length;l<n;l++){var m=b.clone(),o=f.getElementsByTagNameNS(a[l],"*","Title")[0];m.title=o.textContent||o.text;o=f.getElementsByTagNameNS(a[l],"*","CssParameter")[0];"fill"===o.attributes.getNamedItem("name").value?m.symbolizers[0].fillColor=o.textContent||o.text:m.symbolizers[0].strokeColor=o.textContent||
o.text;m.filter=e.read(f.getElementsByTagNameNS(a[l],"*","Filter")[0]);d.push(m);this.afterRuleChange(m)}c.rules=d},failure:function(){},callback:null,scope:this})},saveRule:function(a,b){var c=this.selectedStyle;this.getComponent("rulesfieldset").items.get(0);var c=c.get("userStyle"),d=c.rules.indexOf(this.selectedRule);c.rules[d]=b;this.afterRuleChange(b)},afterRuleChange:function(a){this.getComponent("rulesfieldset").items.get(0);this.selectedRule=a;this.selectedStyle.store.afterEdit(this.selectedStyle)},
setRulesFieldSetVisible:function(a){this.items.get(3).setVisible(a&&this.editable);this.getComponent("rulesfieldset").setVisible(a);this.doLayout()},parseSLD:function(a){var b=a.responseXML;if(!b||!b.documentElement)b=(new OpenLayers.Format.XML).read(a.responseText);var a=this.layerRecord.getLayer().params,c=this.initialConfig.styleName||a.STYLES;if(c)this.selectedStyle=this.stylesStore.getAt(this.stylesStore.findExact("name",c));var d=new OpenLayers.Format.SLD({profile:"GeoServer",multipleSymbolizers:!0});
try{var e=d.read(b).namedLayers[a.LAYERS].userStyles,f;if(a.SLD_BODY)f=d.read(a.SLD_BODY).namedLayers[a.LAYERS].userStyles,Array.prototype.push.apply(e,f);this.stylesStore.removeAll();this.selectedStyle=null;for(var g,h,j,k,b=0,l=e.length;b<l;++b){g=e[b];j=this.stylesStore.findExact("name",g.name);-1!==j&&this.stylesStore.removeAt(j);h=new this.stylesStore.recordType({name:g.name,title:g.title,"abstract":g.description,userStyle:g});h.phantom=!1;this.stylesStore.add(h);if(!this.selectedStyle&&(c===
g.name||!c&&!0===g.isDefault))this.selectedStyle=h;!0===g.isDefault&&(k=h)}if(!this.selectedStyle)this.selectedStyle=k;this.addRulesFieldSet();this.createLegend(this.selectedStyle.get("userStyle").rules);this.stylesStoreReady();a.SLD_BODY&&this.markModified();this.editable?this.enableClassification():this.setupNonEditable()}catch(n){window.console&&console.warn(n.message),this.setupNonEditable()}},createLegend:function(a){var b=OpenLayers.Symbolizer.Raster;if(b&&a[0]&&a[0].symbolizers[0]instanceof
b)throw Error("Raster symbolizers are not supported.");this.addVectorLegend(a)},setupNonEditable:function(){this.editable=!1;this.items.get(1).hide();(this.getComponent("rulesfieldset")||this.addRulesFieldSet()).add(this.createLegendImage());this.doLayout();this.getComponent("rulestoolbar").hide();this.stylesStoreReady()},stylesStoreReady:function(){this.stylesStore.commitChanges();this.stylesStore.on({load:function(){this.addStylesCombo();this.updateStyleRemoveButton()},add:function(a,b,c){this.updateStyleRemoveButton();
b=this.items.get(0).items.get(0);this.markModified();b.fireEvent("select",b,a.getAt(c),c);b.setValue(this.selectedStyle.get("name"))},remove:function(a,b,c){if(!this._cancelling)this._removing=!0,b=Math.min(c,a.getCount()-1),this.updateStyleRemoveButton(),c=this.items.get(0).items.get(0),this.markModified(),c.fireEvent("select",c,a.getAt(b),b),c.setValue(this.selectedStyle.get("name")),delete this._removing},update:function(a,b){var c=b.get("userStyle");Ext.apply(b.data,{name:c.name,title:c.title||
c.name,"abstract":c.description});this.changeStyle(b,{updateCombo:!0,markModified:!0})},scope:this});this.stylesStore.fireEvent("load",this.stylesStore,this.stylesStore.getRange());this._ready=!0;this.fireEvent("ready")},markModified:function(){if(!1===this.modified)this.modified=!0;this._saving||this.fireEvent("modified",this,this.selectedStyle.get("name"))},createStylesStore:function(){var a=this.layerRecord.get("styles")||[];this.stylesStore=new Ext.data.JsonStore({data:{styles:a},idProperty:"name",
root:"styles",fields:["name","title","abstract","legend","userStyle"],listeners:{add:function(a,c){for(var d,e=c.length-1;0<=e;--e)d=c[e],a.suspendEvents(),d.get("title")||d.set("title",d.get("name")),a.resumeEvents()}}})},getStyles:function(a){var b=this.layerRecord.getLayer();if(!0===this.editable){var c=b.params.VERSION;1.1<parseFloat(c)&&(c="1.1.1");Ext.Ajax.request({url:b.url,params:{SERVICE:"WMS",VERSION:c,REQUEST:"GetStyles",LAYERS:""+b.params.LAYERS},method:"GET",disableCaching:!1,success:this.parseSLD,
failure:this.setupNonEditable,callback:a,scope:this})}else this.setupNonEditable()},enableClassification:function(){if(!this.isRaster){var a=this.layerRecord.getLayer().params.LAYERS;0<=a.indexOf(":")&&(a=a.split(":")[1]);var b=this.getLayerRestUrl(this.layerRecord);Ext.Ajax.request({url:b+"/sldservice/"+a+"/attributes.xml",method:"GET",disableCaching:!1,success:function(a){if(a.responseXML)this.classifyEnabled=!0,this.insert(2,new Ext.Toolbar({cls:"x-center-toolbar",buttonAlign:"center",items:[{text:this.classifyStyleText,
tooltip:this.classifyStyleTip,iconCls:"gradient",handler:function(){this.layerDescription?this.classifyStyleRules():this.describeLayer(this.classifyStyleRules)},scope:this}]})),this.doLayout()},failure:function(){},scope:this})}},describeLayer:function(a){if(this.layerDescription)window.setTimeout(function(){a.call(this)},0);else{var b=this.layerRecord.getLayer(),c=b.params.VERSION;1.1<parseFloat(c)&&(c="1.1.1");Ext.Ajax.request({url:b.url,params:{SERVICE:"WMS",VERSION:c,REQUEST:"DescribeLayer",LAYERS:""+
b.params.LAYERS},method:"GET",disableCaching:!1,success:function(a){this.layerDescription=(new OpenLayers.Format.WMSDescribeLayer).read(a.responseXML&&a.responseXML.documentElement?a.responseXML:a.responseText)[0]},callback:a,scope:this})}},addStylesCombo:function(){var a=this.stylesStore,a=new Ext.form.ComboBox(Ext.apply({fieldLabel:this.chooseStyleText,store:a,editable:!1,displayField:"title",valueField:"name",value:this.selectedStyle?this.selectedStyle.get("title"):this.layerRecord.getLayer().params.STYLES||
"default",disabled:!a.getCount(),mode:"local",typeAhead:!0,triggerAction:"all",forceSelection:!0,anchor:"100%",listeners:{select:function(a,c){this.changeStyle(c);!c.phantom&&!this._removing&&this.fireEvent("styleselected",this,c.get("name"))},scope:this}},this.initialConfig.stylesComboOptions));this.items.get(0).add(a);this.doLayout()},createLegendImage:function(){var a=new GeoExt.WMSLegend({showTitle:!1,layerRecord:this.layerRecord,autoScroll:!0,defaults:{listeners:{render:function(b){b.getEl().on({load:function(c,
d){d.getAttribute("src")!=b.defaultImgSrc&&(this.setRulesFieldSetVisible(!0),250<b.getEl().getHeight()&&a.setHeight(250))},error:function(){this.setRulesFieldSetVisible(!1)},scope:this})},scope:this}}});return a},changeStyle:function(a,b){var b=b||{},c=this.getComponent("rulesfieldset").items.get(0);this.selectedStyle=a;this.updateStyleRemoveButton();a.get("name");if(!0===this.editable){var d=a.get("userStyle"),e=c.rules.indexOf(this.selectedRule);c.ownerCt.remove(c);this.createLegend(d.rules,{selectedRuleIndex:e})}!0===
b.updateCombo&&(this.items.get(0).items.get(0).setValue(d.name),!0===b.markModified&&this.markModified())},addVectorLegend:function(a,b){b=Ext.applyIf(b||{},{enableDD:!0});this.symbolType=b.symbolType;if(!this.symbolType){var c=["Point","Line","Polygon"];highest=0;for(var d=a[0].symbolizers,e,f=d.length-1;0<=f;f--)e=d[f].CLASS_NAME.split(".").pop(),highest=Math.max(highest,c.indexOf(e));this.symbolType=c[highest]}var g=this.getComponent("rulesfieldset").add({xtype:"gx_vectorlegend",showTitle:!1,height:10<
a.length?250:void 0,autoScroll:10<a.length,rules:a,symbolType:this.symbolType,selectOnClick:!0,enableDD:b.enableDD,listeners:{ruleselected:function(a,b){this.selectedRule=b;var c=this.getComponent("rulestoolbar").items;this.updateRuleRemoveButton();c.get(2).enable();c.get(3).enable()},ruleunselected:function(){this.selectedRule=null;var a=this.getComponent("rulestoolbar").items;a.get(1).disable();a.get(2).disable();a.get(3).disable()},rulemoved:function(){this.markModified()},afterlayout:function(){null!==
this.selectedRule&&null===g.selectedRule&&-1!==g.rules.indexOf(this.selectedRule)&&g.selectRuleEntry(this.selectedRule)},scope:this}});this.setRulesFieldSetVisible(!0);return g},newStyleName:function(){var a=this.layerRecord.get("name");return a.split(":").pop()+"_"+gxp.util.md5(a+new Date+Math.random()).substr(0,8)},showDlg:function(a){a.show()},getLayerRestUrl:function(a,b){b||(b=a.get("restUrl"));b||(b=a.getLayer().url.split("?").shift().replace(/\/(wms|ows)\/?$/,"/rest"));return b}});
gxp.WMSStylesDialog.createGeoServerStylerConfig=function(a,b){var c=a.getLayer(),b=this.prototype.getLayerRestUrl(a,b);return{xtype:"gxp_wmsstylesdialog",layerRecord:a,plugins:[{ptype:"gxp_geoserverstylewriter",baseUrl:b}],listeners:{styleselected:function(a,b){c.mergeNewParams({styles:b})},modified:function(a){a.saveStyles()},saved:function(a,b){c.mergeNewParams({_olSalt:Math.random(),styles:b})},scope:this}}};
OpenLayers.Renderer.defaultSymbolizer={fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,graphicName:"square",fontColor:"#000000",fontSize:10,haloColor:"#FFFFFF",haloOpacity:1,haloRadius:1,labelAlign:"cm"};Ext.reg("gxp_wmsstylesdialog",gxp.WMSStylesDialog);Ext.namespace("gxp");
gxp.ScaleLimitPanel=Ext.extend(Ext.Panel,{maxScaleDenominatorLimit:1.577757414193268E9*OpenLayers.DOTS_PER_INCH/256,limitMaxScaleDenominator:!0,maxScaleDenominator:void 0,minScaleDenominatorLimit:1.577757414193268E9*Math.pow(0.5,19)*OpenLayers.DOTS_PER_INCH/256,limitMinScaleDenominator:!0,minScaleDenominator:void 0,scaleLevels:20,scaleSliderTemplate:"{scaleType} Scale 1:{scale}",modifyScaleTipContext:Ext.emptyFn,scaleFactor:null,changing:!1,border:!1,maxScaleLimitText:"Max scale limit",minScaleLimitText:"Min scale limit",
initComponent:function(){this.layout="column";this.defaults={border:!1,bodyStyle:"margin: 0 5px;"};this.bodyStyle={padding:"5px"};this.scaleSliderTemplate=new Ext.Template(this.scaleSliderTemplate);Ext.applyIf(this,{minScaleDenominator:this.minScaleDenominatorLimit,maxScaleDenominator:this.maxScaleDenominatorLimit});this.scaleFactor=Math.pow(this.maxScaleDenominatorLimit/this.minScaleDenominatorLimit,1/(this.scaleLevels-1));this.scaleSlider=new Ext.Slider({vertical:!0,height:100,values:[0,100],listeners:{changecomplete:function(a){this.updateScaleValues(a)},
render:function(a){a.thumbs[0].el.setVisible(this.limitMaxScaleDenominator);a.thumbs[1].el.setVisible(this.limitMinScaleDenominator);a.setDisabled(!this.limitMinScaleDenominator&&!this.limitMaxScaleDenominator)},scope:this},plugins:[new gxp.slider.Tip({getText:function(a){var b=a.slider.thumbs.indexOf(a),a={scale:""+this.sliderValuesToScale([a.value])[0],zoom:(a.value*(this.scaleLevels/100)).toFixed(1),type:0===b?"Max":"Min",scaleType:0===b?"Min":"Max"};this.modifyScaleTipContext(this,a);return this.scaleSliderTemplate.apply(a)}.createDelegate(this)})]});
this.maxScaleDenominatorInput=new Ext.form.NumberField({allowNegative:!1,width:100,fieldLabel:"1",value:Math.round(this.maxScaleDenominator),disabled:!this.limitMaxScaleDenominator,validator:function(a){return!this.limitMinScaleDenominator||a>this.minScaleDenominator}.createDelegate(this),listeners:{valid:function(a){var a=Number(a.getValue()),b=Math.round(this.maxScaleDenominatorLimit);if(a<b&&a>this.minScaleDenominator)this.maxScaleDenominator=a,this.updateSliderValues()},change:function(a){var b=
Number(a.getValue()),c=Math.round(this.maxScaleDenominatorLimit);b>c?a.setValue(c):b<this.minScaleDenominator?a.setValue(this.minScaleDenominator):(this.maxScaleDenominator=b,this.updateSliderValues())},scope:this}});this.minScaleDenominatorInput=new Ext.form.NumberField({allowNegative:!1,width:100,fieldLabel:"1",value:Math.round(this.minScaleDenominator),disabled:!this.limitMinScaleDenominator,validator:function(a){return!this.limitMaxScaleDenominator||a<this.maxScaleDenominator}.createDelegate(this),
listeners:{valid:function(a){var a=Number(a.getValue()),b=Math.round(this.minScaleDenominatorLimit);if(a>b&&a<this.maxScaleDenominator)this.minScaleDenominator=a,this.updateSliderValues()},change:function(a){var b=Number(a.getValue()),c=Math.round(this.minScaleDenominatorLimit);b<c?a.setValue(c):b>this.maxScaleDenominator?a.setValue(this.maxScaleDenominator):(this.minScaleDenominator=b,this.updateSliderValues())},scope:this}});this.items=[this.scaleSlider,{xtype:"panel",layout:"form",defaults:{border:!1},
items:[{labelWidth:90,layout:"form",width:150,items:[{xtype:"checkbox",checked:!!this.limitMinScaleDenominator,fieldLabel:this.maxScaleLimitText,listeners:{check:function(a,b){this.limitMinScaleDenominator=b;var c=this.scaleSlider;c.setValue(1,100);c.thumbs[1].el.setVisible(b);this.minScaleDenominatorInput.setDisabled(!b);this.updateScaleValues(c);c.setDisabled(!this.limitMinScaleDenominator&&!this.limitMaxScaleDenominator)},scope:this}}]},{labelWidth:10,layout:"form",items:[this.minScaleDenominatorInput]},
{labelWidth:90,layout:"form",items:[{xtype:"checkbox",checked:!!this.limitMaxScaleDenominator,fieldLabel:this.minScaleLimitText,listeners:{check:function(a,b){this.limitMaxScaleDenominator=b;var c=this.scaleSlider;c.setValue(0,0);c.thumbs[0].el.setVisible(b);this.maxScaleDenominatorInput.setDisabled(!b);this.updateScaleValues(c);c.setDisabled(!this.limitMinScaleDenominator&&!this.limitMaxScaleDenominator)},scope:this}}]},{labelWidth:10,layout:"form",items:[this.maxScaleDenominatorInput]}]}];this.addEvents("change");
gxp.ScaleLimitPanel.superclass.initComponent.call(this)},updateScaleValues:function(a){if(!this.changing){var b=a.getValues(),c=!1;!this.limitMaxScaleDenominator&&0<b[0]&&(b[0]=0,c=!0);!this.limitMinScaleDenominator&&100>b[1]&&(b[1]=100,c=!0);c?(a.setValue(0,b[0]),a.setValue(1,b[1])):(b=this.sliderValuesToScale(b),a=b[0],b=b[1],this.changing=!0,this.minScaleDenominatorInput.setValue(b),this.maxScaleDenominatorInput.setValue(a),this.changing=!1,this.fireEvent("change",this,this.limitMinScaleDenominator?
b:void 0,this.limitMaxScaleDenominator?a:void 0))}},updateSliderValues:function(){if(!this.changing){var a=this.minScaleDenominator,b=this.maxScaleDenominator,c=this.scaleToSliderValues([b,a]);this.changing=!0;this.scaleSlider.setValue(0,c[0]);this.scaleSlider.setValue(1,c[1]);this.changing=!1;this.fireEvent("change",this,this.limitMinScaleDenominator?a:void 0,this.limitMaxScaleDenominator?b:void 0)}},sliderValuesToScale:function(a){var b=100/(this.scaleLevels-1);return[Math.round(Math.pow(this.scaleFactor,
(100-a[0])/b)*this.minScaleDenominatorLimit),Math.round(Math.pow(this.scaleFactor,(100-a[1])/b)*this.minScaleDenominatorLimit)]},scaleToSliderValues:function(a){var b=100/(this.scaleLevels-1);return[100-b*Math.log(a[0]/this.minScaleDenominatorLimit)/Math.log(this.scaleFactor),100-b*Math.log(a[1]/this.minScaleDenominatorLimit)/Math.log(this.scaleFactor)]}});Ext.reg("gxp_scalelimitpanel",gxp.ScaleLimitPanel);Ext.namespace("gxp");
gxp.ScaleOverlay=Ext.extend(Ext.Panel,{map:null,zoomLevelText:"Zoom level",initComponent:function(){gxp.ScaleOverlay.superclass.initComponent.call(this);this.cls="map-overlay";if(this.map){if(this.map instanceof GeoExt.MapPanel)this.map=this.map.map;this.bind(this.map)}this.on("beforedestroy",this.unbind,this)},addToMapPanel:function(a){this.on({afterrender:function(){this.bind(a.map)},scope:this})},stopMouseEvents:function(a){a.stopEvent()},removeFromMapPanel:function(){var a=this.getEl();a.un("mousedown",
this.stopMouseEvents,this);a.un("click",this.stopMouseEvents,this);this.unbind()},addScaleLine:function(){var a=new Ext.BoxComponent({autoEl:{tag:"div",cls:"olControlScaleLine overlay-element overlay-scaleline"}});this.on("afterlayout",function(){a.getEl().dom.style.position="relative";a.getEl().dom.style.display="inline";this.getEl().on("click",this.stopMouseEvents,this);this.getEl().on("mousedown",this.stopMouseEvents,this)},this);a.on("render",function(){var b=new OpenLayers.Control.ScaleLine({geodesic:!0,
div:a.getEl().dom});this.map.addControl(b);b.activate()},this);this.add(a)},handleZoomEnd:function(){var a=this.zoomStore.queryBy(function(a){return this.map.getZoom()==a.data.level},this);0<a.length?(a=a.items[0],this.zoomSelector.setValue("1 : "+parseInt(a.data.scale,10))):this.zoomSelector.rendered&&this.zoomSelector.clearValue()},addScaleCombo:function(){this.zoomStore=new GeoExt.data.ScaleStore({map:this.map});this.zoomSelector=new Ext.form.ComboBox({emptyText:this.zoomLevelText,tpl:'<tpl for="."><div class="x-combo-list-item">1 : {[parseInt(values.scale)]}</div></tpl>',
editable:!1,triggerAction:"all",mode:"local",store:this.zoomStore,width:110});this.zoomSelector.on({click:this.stopMouseEvents,mousedown:this.stopMouseEvents,select:function(a,b){this.map.zoomTo(b.data.level)},scope:this});this.map.events.register("zoomend",this,this.handleZoomEnd);this.add(new Ext.Panel({items:[this.zoomSelector],cls:"overlay-element overlay-scalechooser",border:!1}))},bind:function(a){this.map=a;this.addScaleLine();this.addScaleCombo();this.doLayout()},unbind:function(){this.map&&
this.map.events&&this.map.events.unregister("zoomend",this,this.handleZoomEnd);this.zoomSelector=this.zoomStore=null}});Ext.reg("gxp_scaleoverlay",gxp.ScaleOverlay);Ext.namespace("gxp.plugins");
gxp.plugins.SchemaAnnotations={getAnnotationsFromSchema:function(a){var b=null,a=a.get("annotation");if(void 0!==a){var b={},c=GeoExt.Lang.locale.split("-").shift(),d,e;for(d=0,e=a.appinfo.length;d<e;++d){var f=Ext.decode(a.appinfo[d]);if(f.title&&f.title[c]){b.label=f.title[c];break}}for(d=0,e=a.documentation.length;d<e;++d)if(a.documentation[d].lang===c){b.helpText=a.documentation[d].textContent;break}}return b}};Ext.namespace("gxp.plugins");
gxp.plugins.FeatureEditorGrid=Ext.extend(Ext.grid.PropertyGrid,{ptype:"gxp_editorgrid",xtype:"gxp_editorgrid",feature:null,schema:null,fields:null,excludeFields:null,propertyNames:null,readOnly:null,border:!1,initComponent:function(){if(!this.dateFormat)this.dateFormat=Ext.form.DateField.prototype.format;if(!this.timeFormat)this.timeFormat=Ext.form.TimeField.prototype.format;this.customRenderers=this.customRenderers||{};this.customEditors=this.customEditors||{};var a=this.feature,b;if(this.fields){b=
{};for(var c=0,d=this.fields.length;c<d;++c)b[this.fields[c]]=a.attributes[this.fields[c]]}else b=a.attributes;if(!this.excludeFields)this.excludeFields=[];if(this.schema){var e=this.fields?this.fields.join(",").toUpperCase().split(","):[];this.schema.each(function(c){var d=c.get("type");if(!d.match(/^[^:]*:?((Multi)?(Point|Line|Polygon|Curve|Surface|Geometry))/)){var f=c.get("name");this.fields&&-1==e.indexOf(f.toUpperCase())&&this.excludeFields.push(f);var k=a.attributes[f],l=GeoExt.form.recordToField(c);
if((c=this.getAnnotationsFromSchema(c))&&c.label)this.propertyNames=this.propertyNames||{},this.propertyNames[f]=c.label;var n;if("string"==typeof k){var m;switch(d.split(":").pop()){case "date":m=this.dateFormat;l.editable=!1;break;case "dateTime":if(!m)m=this.dateFormat+" "+this.timeFormat,l.editable=!0;l.format=m;n={startedit:function(a,b){if(!(b instanceof Date)){var c=Date.parseDate(b.replace(/Z$/,""),"c");c&&this.setValue(c)}}};this.customRenderers[f]=function(){return function(a){var b=a;"string"==
typeof a&&(b=Date.parseDate(a.replace(/Z$/,""),"c"));return b?b.format(m):a}}();break;case "boolean":n={startedit:function(a,b){this.setValue(Boolean(b))}}}}this.customEditors[f]=new Ext.grid.GridEditor({field:Ext.create(l),listeners:n});b[f]=k}},this);a.attributes=b}this.source=b;var f=this.excludeFields.length?this.excludeFields.join(",").toUpperCase().split(","):[];this.viewConfig={forceFit:!0,getRowClass:function(a){if(-1!==f.indexOf(a.get("name").toUpperCase()))return"x-hide-nosize"}};this.listeners=
{beforeedit:function(){return this.featureEditor&&this.featureEditor.editing},propertychange:function(){this.featureEditor&&this.featureEditor.setFeatureState(this.featureEditor.getDirtyState())},scope:this};c=Ext.data.Store.prototype.sort;Ext.data.Store.prototype.sort=function(){};gxp.plugins.FeatureEditorGrid.superclass.initComponent.apply(this,arguments);Ext.data.Store.prototype.sort=c;this.propStore.isEditableValue=function(){return!0}},init:function(a){this.featureEditor=a;this.featureEditor.on("canceledit",
this.onCancelEdit,this);this.featureEditor.add(this);this.featureEditor.doLayout()},destroy:function(){if(this.featureEditor)this.featureEditor.un("canceledit",this.onCancelEdit,this),this.featureEditor=null;gxp.plugins.FeatureEditorGrid.superclass.destroy.call(this)},onCancelEdit:function(a,b){b&&this.setSource(b.attributes)}});Ext.override(gxp.plugins.FeatureEditorGrid,gxp.plugins.SchemaAnnotations);Ext.preg(gxp.plugins.FeatureEditorGrid.prototype.ptype,gxp.plugins.FeatureEditorGrid);
Ext.reg(gxp.plugins.FeatureEditorGrid.prototype.xtype,gxp.plugins.FeatureEditorGrid);Ext.namespace("gxp");
gxp.FeatureEditPopup=Ext.extend(GeoExt.Popup,{closeMsgTitle:"Save Changes?",closeMsg:"This feature has unsaved changes. Would you like to save your changes?",deleteMsgTitle:"Delete Feature?",deleteMsg:"Are you sure you want to delete this feature?",editButtonText:"Edit",editButtonTooltip:"Make this feature editable",deleteButtonText:"Delete",deleteButtonTooltip:"Delete this feature",cancelButtonText:"Cancel",cancelButtonTooltip:"Stop editing, discard changes",saveButtonText:"Save",saveButtonTooltip:"Save changes",
layout:"fit",feature:null,schema:null,readOnly:!1,allowDelete:!1,editing:!1,editorPluginConfig:{ptype:"gxp_editorgrid"},modifyControl:null,geometry:null,attributes:null,cancelButton:null,saveButton:null,editButton:null,deleteButton:null,initComponent:function(){var b;this.addEvents("startedit","stopedit","beforefeaturemodified","featuremodified","canceledit","cancelclose");var a=this.feature;if(a instanceof GeoExt.data.FeatureRecord)b=this.feature=a.getFeature(),a=b;if(!this.location)this.location=
a;this.anchored=!this.editing;if(!this.title&&a.fid)this.title=a.fid;this.editButton=new Ext.Button({text:this.editButtonText,tooltip:this.editButtonTooltip,iconCls:"edit",handler:this.startEditing,scope:this});this.deleteButton=new Ext.Button({text:this.deleteButtonText,tooltip:this.deleteButtonTooltip,iconCls:"delete",hidden:!this.allowDelete,handler:this.deleteFeature,scope:this});this.cancelButton=new Ext.Button({text:this.cancelButtonText,tooltip:this.cancelButtonTooltip,iconCls:"cancel",hidden:!0,
handler:function(){this.stopEditing(!1)},scope:this});this.saveButton=new Ext.Button({text:this.saveButtonText,tooltip:this.saveButtonTooltip,iconCls:"save",hidden:!0,handler:function(){this.stopEditing(!0)},scope:this});this.plugins=[Ext.apply({feature:a,schema:this.schema,fields:this.fields,excludeFields:this.excludeFields,propertyNames:this.propertyNames,readOnly:this.readOnly},this.editorPluginConfig)];this.bbar=new Ext.Toolbar({hidden:this.readOnly,items:[this.editButton,this.deleteButton,this.saveButton,
this.cancelButton]});gxp.FeatureEditPopup.superclass.initComponent.call(this);this.on({show:function(){if(this.editing)this.editing=null,this.startEditing()},beforeclose:function(){if(this.editing){if(this.feature.state===this.getDirtyState())return Ext.Msg.show({title:this.closeMsgTitle,msg:this.closeMsg,buttons:Ext.Msg.YESNOCANCEL,fn:function(a){a&&"cancel"!==a?(this.stopEditing("yes"===a),this.close()):this.fireEvent("cancelclose",this)},scope:this,icon:Ext.MessageBox.QUESTION,animEl:this.getEl()}),
!1;this.stopEditing(!1)}},scope:this})},getDirtyState:function(){return this.feature.state===OpenLayers.State.INSERT?this.feature.state:OpenLayers.State.UPDATE},startEditing:function(){if(!this.editing)this.fireEvent("startedit",this),this.editing=!0,this.anc&&this.unanchorPopup(),this.editButton.hide(),this.deleteButton.hide(),this.saveButton.show(),this.cancelButton.show(),this.geometry=this.feature.geometry&&this.feature.geometry.clone(),this.attributes=Ext.apply({},this.feature.attributes),this.modifyControl=
new OpenLayers.Control.ModifyFeature(this.feature.layer,{standalone:!0,vertexRenderIntent:this.vertexRenderIntent}),this.feature.layer.map.addControl(this.modifyControl),this.modifyControl.activate(),this.feature.geometry&&this.modifyControl.selectFeature(this.feature)},stopEditing:function(a){if(this.editing){this.fireEvent("stopedit",this);this.modifyControl.deactivate();this.modifyControl.destroy();var b=this.feature;if(b.state===this.getDirtyState())if(!0===a){this.fireEvent("beforefeaturemodified",
this,b);if(this.schema){var c,d;for(d in b.attributes)c=this.schema.getAt(this.schema.findExact("name",d)),a=b.attributes[d],a instanceof Date&&(c=c.get("type").split(":").pop(),b.attributes[d]=a.format("date"==c?"Y-m-d":"c"))}this.fireEvent("featuremodified",this,b)}else b.state===OpenLayers.State.INSERT?(this.editing=!1,b.layer&&b.layer.destroyFeatures([b]),this.fireEvent("canceledit",this,null),this.close()):(d=b.layer,d.drawFeature(b,{display:"none"}),b.geometry=this.geometry,b.attributes=this.attributes,
this.setFeatureState(null),d.drawFeature(b),this.fireEvent("canceledit",this,b));this.isDestroyed||(this.cancelButton.hide(),this.saveButton.hide(),this.editButton.show(),this.allowDelete&&this.deleteButton.show());this.editing=!1}},deleteFeature:function(){Ext.Msg.show({title:this.deleteMsgTitle,msg:this.deleteMsg,buttons:Ext.Msg.YESNO,fn:function(a){"yes"===a&&(this.setFeatureState(OpenLayers.State.DELETE),this.fireEvent("featuremodified",this,this.feature),this.close())},scope:this,icon:Ext.MessageBox.QUESTION,
animEl:this.getEl()})},setFeatureState:function(a){this.feature.state=a;(a=this.feature.layer)&&a.events.triggerEvent("featuremodified",{feature:this.feature})}});Ext.reg("gxp_featureeditpopup",gxp.FeatureEditPopup);Ext.namespace("gxp.plugins");
gxp.plugins.FormFieldHelp=Ext.extend(Object,{ptype:"gxp_formfieldhelp",helpText:null,dismissDelay:5E3,constructor:function(a){Ext.apply(this,a)},init:function(a){this.target=a;a.on("render",this.showHelp,this)},showHelp:function(){var a;a=this.target.label?this.target.label:this.target.getEl();Ext.QuickTips.register({target:a,dismissDelay:this.dismissDelay,text:this.helpText})}});Ext.preg(gxp.plugins.FormFieldHelp.prototype.ptype,gxp.plugins.FormFieldHelp);Ext.namespace("gxp");
gxp.TextSymbolizer=Ext.extend(Ext.Panel,{fonts:void 0,symbolizer:null,defaultSymbolizer:null,attributes:null,colorManager:null,haloCache:null,border:!1,layout:"form",labelValuesText:"Label values",haloText:"Halo",sizeText:"Size",priorityText:"Priority",labelOptionsText:"Label options",autoWrapText:"Auto wrap",followLineText:"Follow line",maxDisplacementText:"Maximum displacement",repeatText:"Repeat",forceLeftToRightText:"Force left to right",groupText:"Grouping",spaceAroundText:"Space around",labelAllGroupText:"Label all segments in line group",
maxAngleDeltaText:"Maximum angle delta",conflictResolutionText:"Conflict resolution",goodnessOfFitText:"Goodness of fit",polygonAlignText:"Polygon alignment",graphicResizeText:"Graphic resize",graphicMarginText:"Graphic margin",graphicTitle:"Graphic",fontColorTitle:"Font color and opacity",positioningText:"Label positioning",anchorPointText:"Anchor point",displacementXText:"Displacement (X-direction)",displacementYText:"Displacement (Y-direction)",perpendicularOffsetText:"Perpendicular offset",priorityHelp:"The higher the value of the specified field, the sooner the label will be drawn (which makes it win in the conflict resolution game)",
autoWrapHelp:"Wrap labels that exceed a certain length in pixels",followLineHelp:"Should the label follow the geometry of the line?",maxDisplacementHelp:"Maximum displacement in pixels if label position is busy",repeatHelp:"Repeat labels after a certain number of pixels",forceLeftToRightHelp:"Labels are usually flipped to make them readable. If the character happens to be a directional arrow then this is not desirable",groupHelp:"Grouping works by collecting all features with the same label text, then choosing a representative geometry for the group. Road data is a classic example to show why grouping is useful. It is usually desirable to display only a single label for all of 'Main Street', not a label for every block of 'Main Street.'",
spaceAroundHelp:"Overlapping and Separating Labels. By default GeoServer will not render labels 'on top of each other'. By using the spaceAround option you can either allow labels to overlap, or add extra space around labels. The value supplied for the option is a positive or negative size in pixels. Using the default value of 0, the bounding box of a label cannot overlap the bounding box of another label.",labelAllGroupHelp:"The labelAllGroup option makes sure that all of the segments in a line group are labeled instead of just the longest one.",
conflictResolutionHelp:"By default labels are subjected to conflict resolution, meaning the renderer will not allow any label to overlap with a label that has been drawn already. Setting this parameter to false pull the label out of the conflict resolution game, meaning the label will be drawn even if it overlaps with other labels, and other labels drawn after it won\u2019t mind overlapping with it.",goodnessOfFitHelp:"Geoserver will remove labels if they are a particularly bad fit for the geometry they are labeling. For Polygons: the label is sampled approximately at every letter. The distance from these points to the polygon is determined and each sample votes based on how close it is to the polygon. The default value is 0.5.",
graphic_resizeHelp:"Specifies a mode for resizing label graphics (such as highway shields) to fit the text of the label. The default mode, \u2018none\u2019, never modifies the label graphic. In stretch mode, GeoServer will resize the graphic to exactly surround the label text, possibly modifying the image\u2019s aspect ratio. In proportional mode, GeoServer will expand the image to be large enough to surround the text while preserving its original aspect ratio.",maxAngleDeltaHelp:"Designed to use used in conjuection with followLine, the maxAngleDelta option sets the maximum angle, in degrees, between two subsequent characters in a curved label. Large angles create either visually disconnected words or overlapping characters. It is advised not to use angles larger than 30.",
polygonAlignHelp:"GeoServer normally tries to place horizontal labels within a polygon, and give up in case the label position is busy or if the label does not fit enough in the polygon. This options allows GeoServer to try alternate rotations for the labels. Possible options: the default value, only the rotation manually specified in the <Rotation> tag will be used (manual), If the label does not fit horizontally and the polygon is taller than wider the vertical alignement will also be tried (ortho), If the label does not fit horizontally the minimum bounding rectangle will be computed and a label aligned to it will be tried out as well (mbr).",
graphic_marginHelp:"Similar to the margin shorthand property in CSS for HTML, its interpretation varies depending on how many margin values are provided: 1 = use that margin length on all sides of the label 2 = use the first for top & bottom margins and the second for left & right margins. 3 = use the first for the top margin, second for left & right margins, third for the bottom margin. 4 = use the first for the top margin, second for the right margin, third for the bottom margin, and fourth for the left margin.",
initComponent:function(){if(!this.symbolizer)this.symbolizer={};Ext.applyIf(this.symbolizer,this.defaultSymbolizer);if(!this.symbolizer.vendorOptions)this.symbolizer.vendorOptions={};this.haloCache={};this.attributes.on("load",this.showHideGeometryOptions,this);this.attributes.load();var a={xtype:"combo",fieldLabel:this.labelValuesText,store:this.attributes,mode:"local",lastQuery:"",editable:!1,triggerAction:"all",allowBlank:!1,displayField:"name",valueField:"name",value:this.symbolizer.label&&this.symbolizer.label.replace(/^\${(.*)}$/,
"$1"),listeners:{select:function(a,c){this.symbolizer.label="${"+c.get("name")+"}";this.fireEvent("change",this.symbolizer)},scope:this},width:120};this.attributesComboConfig=this.attributesComboConfig||{};Ext.applyIf(this.attributesComboConfig,a);this.labelWidth=80;this.items=[this.attributesComboConfig,{cls:"x-html-editor-tb",style:"background: transparent; border: none; padding: 0 0em 0.5em;",xtype:"toolbar",items:[{xtype:"gxp_fontcombo",fonts:this.fonts||void 0,width:110,value:this.symbolizer.fontFamily,
listeners:{select:function(a,c){this.symbolizer.fontFamily=c.get("field1");this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"tbtext",text:this.sizeText+": "},{xtype:"numberfield",allowNegative:!1,emptyText:OpenLayers.Renderer.defaultSymbolizer.fontSize,value:this.symbolizer.fontSize,width:30,listeners:{change:function(a,c){c=parseFloat(c);isNaN(c)?delete this.symbolizer.fontSize:this.symbolizer.fontSize=c;this.fireEvent("change",this.symbolizer)},scope:this}},{enableToggle:!0,cls:"x-btn-icon",
iconCls:"x-edit-bold",pressed:"bold"===this.symbolizer.fontWeight,listeners:{toggle:function(a,c){this.symbolizer.fontWeight=c?"bold":"normal";this.fireEvent("change",this.symbolizer)},scope:this}},{enableToggle:!0,cls:"x-btn-icon",iconCls:"x-edit-italic",pressed:"italic"===this.symbolizer.fontStyle,listeners:{toggle:function(a,c){this.symbolizer.fontStyle=c?"italic":"normal";this.fireEvent("change",this.symbolizer)},scope:this}}]},{xtype:"gxp_fillsymbolizer",fillText:this.fontColorTitle,symbolizer:this.symbolizer,
colorProperty:"fontColor",opacityProperty:"fontOpacity",checkboxToggle:!1,autoHeight:!0,width:213,labelWidth:70,plugins:this.colorManager&&[new this.colorManager],listeners:{change:function(){this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"fieldset",title:this.graphicTitle,checkboxToggle:!0,hideMode:"offsets",collapsed:!(this.symbolizer.fillColor||this.symbolizer.fillOpacity||this.symbolizer.vendorOptions["graphic-resize"]||this.symbolizer.vendorOptions["graphic-margin"]),labelWidth:70,
items:[{xtype:"gxp_pointsymbolizer",symbolizer:this.symbolizer,listeners:{change:function(a){a.graphic=!!a.graphicName||!!a.externalGraphic;this.fireEvent("change",this.symbolizer)},scope:this},border:!1,labelWidth:70},this.createVendorSpecificField({name:"graphic-resize",xtype:"combo",store:["none","stretch","proportional"],mode:"local",listeners:{select:function(a){"none"===a.getValue()?this.graphicMargin.hide():(Ext.isEmpty(this.graphicMargin.getValue())&&(this.graphicMargin.setValue(0),this.symbolizer.vendorOptions["graphic-margin"]=
0),this.graphicMargin.show())},scope:this},width:100,triggerAction:"all",fieldLabel:this.graphicResizeText}),this.createVendorSpecificField({name:"graphic-margin",ref:"../graphicMargin",hidden:"stretch"!==this.symbolizer.vendorOptions["graphic-resize"]&&"proportional"!==this.symbolizer.vendorOptions["graphic-resize"],width:100,fieldLabel:this.graphicMarginText,xtype:"textfield"})],listeners:{collapse:function(){this.graphicCache={externalGraphic:this.symbolizer.externalGraphic,fillColor:this.symbolizer.fillColor,
fillOpacity:this.symbolizer.fillOpacity,graphicName:this.symbolizer.graphicName,pointRadius:this.symbolizer.pointRadius,rotation:this.symbolizer.rotation,strokeColor:this.symbolizer.strokeColor,strokeWidth:this.symbolizer.strokeWidth,strokeDashStyle:this.symbolizer.strokeDashStyle};delete this.symbolizer.externalGraphic;delete this.symbolizer.fillColor;delete this.symbolizer.fillOpacity;delete this.symbolizer.graphicName;delete this.symbolizer.pointRadius;delete this.symbolizer.rotation;delete this.symbolizer.strokeColor;
delete this.symbolizer.strokeWidth;delete this.symbolizer.strokeDashStyle;this.fireEvent("change",this.symbolizer)},expand:function(){Ext.apply(this.symbolizer,this.graphicCache);this.doLayout();this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"fieldset",title:this.haloText,checkboxToggle:!0,collapsed:!(this.symbolizer.haloRadius||this.symbolizer.haloColor||this.symbolizer.haloOpacity),autoHeight:!0,labelWidth:50,items:[{xtype:"numberfield",fieldLabel:this.sizeText,anchor:"89%",allowNegative:!1,
emptyText:OpenLayers.Renderer.defaultSymbolizer.haloRadius,value:this.symbolizer.haloRadius,listeners:{change:function(a,c){c=parseFloat(c);isNaN(c)?delete this.symbolizer.haloRadius:this.symbolizer.haloRadius=c;this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"gxp_fillsymbolizer",symbolizer:{fillColor:"haloColor"in this.symbolizer?this.symbolizer.haloColor:OpenLayers.Renderer.defaultSymbolizer.haloColor,fillOpacity:"haloOpacity"in this.symbolizer?this.symbolizer.haloOpacity:100*OpenLayers.Renderer.defaultSymbolizer.haloOpacity},
defaultColor:OpenLayers.Renderer.defaultSymbolizer.haloColor,checkboxToggle:!1,width:190,labelWidth:60,plugins:this.colorManager&&[new this.colorManager],listeners:{change:function(a){this.symbolizer.haloColor=a.fillColor;this.symbolizer.haloOpacity=a.fillOpacity;this.fireEvent("change",this.symbolizer)},scope:this}}],listeners:{collapse:function(){this.haloCache={haloRadius:this.symbolizer.haloRadius,haloColor:this.symbolizer.haloColor,haloOpacity:this.symbolizer.haloOpacity};delete this.symbolizer.haloRadius;
delete this.symbolizer.haloColor;delete this.symbolizer.haloOpacity;this.fireEvent("change",this.symbolizer)},expand:function(){Ext.apply(this.symbolizer,this.haloCache);this.doLayout();this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"fieldset",collapsed:!(this.symbolizer.labelAlign||this.symbolizer.vendorOptions.polygonAlign||this.symbolizer.labelXOffset||this.symbolizer.labelYOffset||this.symbolizer.labelPerpendicularOffset),title:this.positioningText,checkboxToggle:!0,autoHeight:!0,
labelWidth:75,defaults:{width:100},items:[this.createField(Ext.applyIf({fieldLabel:this.anchorPointText,geometryTypes:["POINT"],value:this.symbolizer.labelAlign||"lb",store:[["lt","Left-top"],["ct","Center-top"],["rt","Right-top"],["lm","Left-center"],["cm","Center"],["rm","Right-center"],["lb","Left-bottom"],["cb","Center-bottom"],["rb","Right-bottom"]],listeners:{select:function(a){this.symbolizer.labelAlign=a.getValue();delete this.symbolizer.labelAnchorPointX;delete this.symbolizer.labelAnchorPointY;
this.fireEvent("change",this.symbolizer)},scope:this}},this.attributesComboConfig)),this.createField({xtype:"numberfield",geometryTypes:["POINT"],fieldLabel:this.displacementXText,value:this.symbolizer.labelXOffset,listeners:{change:function(a,c){this.symbolizer.labelXOffset=c;this.fireEvent("change",this.symbolizer)},scope:this}}),this.createField({xtype:"numberfield",geometryTypes:["POINT"],fieldLabel:this.displacementYText,value:this.symbolizer.labelYOffset,listeners:{change:function(a,c){this.symbolizer.labelYOffset=
c;this.fireEvent("change",this.symbolizer)},scope:this}}),this.createField({xtype:"numberfield",geometryTypes:["LINE"],fieldLabel:this.perpendicularOffsetText,value:this.symbolizer.labelPerpendicularOffset,listeners:{change:function(a,c){Ext.isEmpty(c)?delete this.symbolizer.labelPerpendicularOffset:this.symbolizer.labelPerpendicularOffset=c;this.fireEvent("change",this.symbolizer)},scope:this}}),this.createVendorSpecificField({name:"polygonAlign",geometryTypes:["POLYGON"],xtype:"combo",mode:"local",
value:this.symbolizer.vendorOptions.polygonAlign||"manual",triggerAction:"all",store:["manual","ortho","mbr"],fieldLabel:this.polygonAlignText})]},{xtype:"fieldset",title:this.priorityText,checkboxToggle:!0,collapsed:!this.symbolizer.priority,autoHeight:!0,labelWidth:50,items:[Ext.applyIf({fieldLabel:this.priorityText,value:this.symbolizer.priority&&this.symbolizer.priority.replace(/^\${(.*)}$/,"$1"),allowBlank:!0,name:"priority",plugins:[{ptype:"gxp_formfieldhelp",dismissDelay:2E4,helpText:this.priorityHelp}],
listeners:{select:function(a,c){this.symbolizer[a.name]="${"+c.get("name")+"}";this.fireEvent("change",this.symbolizer)},scope:this}},this.attributesComboConfig)]},{xtype:"fieldset",title:this.labelOptionsText,checkboxToggle:!0,collapsed:!(this.symbolizer.vendorOptions.autoWrap||this.symbolizer.vendorOptions.followLine||this.symbolizer.vendorOptions.maxAngleDelta||this.symbolizer.vendorOptions.maxDisplacement||this.symbolizer.vendorOptions.repeat||this.symbolizer.vendorOptions.forceLeftToRight||this.symbolizer.vendorOptions.group||
this.symbolizer.vendorOptions.spaceAround||this.symbolizer.vendorOptions.labelAllGroup||this.symbolizer.vendorOptions.conflictResolution||this.symbolizer.vendorOptions.goodnessOfFit||this.symbolizer.vendorOptions.polygonAlign),autoHeight:!0,labelWidth:80,defaults:{width:100},items:[this.createVendorSpecificField({name:"autoWrap",allowBlank:!1,fieldLabel:this.autoWrapText}),this.createVendorSpecificField({name:"followLine",geometryTypes:["LINE"],xtype:"checkbox",listeners:{check:function(a,c){c?this.maxAngleDelta.show():
this.maxAngleDelta.hide()},scope:this},fieldLabel:this.followLineText}),this.createVendorSpecificField({name:"maxAngleDelta",ref:"../maxAngleDelta",hidden:null==this.symbolizer.vendorOptions.followLine,geometryTypes:["LINE"],fieldLabel:this.maxAngleDeltaText}),this.createVendorSpecificField({name:"maxDisplacement",fieldLabel:this.maxDisplacementText}),this.createVendorSpecificField({name:"repeat",geometryTypes:["LINE"],fieldLabel:this.repeatText}),this.createVendorSpecificField({name:"forceLeftToRight",
xtype:"checkbox",geometryTypes:["LINE"],fieldLabel:this.forceLeftToRightText}),this.createVendorSpecificField({name:"group",listeners:{check:function(a,c){"LINE"===this.geometryType&&(!1===c?this.labelAllGroup.hide():this.labelAllGroup.show())},scope:this},xtype:"checkbox",yesno:!0,fieldLabel:this.groupText}),this.createVendorSpecificField({name:"labelAllGroup",ref:"../labelAllGroup",geometryTypes:["LINE"],hidden:"yes"!==this.symbolizer.vendorOptions.group,xtype:"checkbox",fieldLabel:this.labelAllGroupText}),
this.createVendorSpecificField({name:"conflictResolution",xtype:"checkbox",listeners:{check:function(a,c){c?this.spaceAround.show():this.spaceAround.hide()},scope:this},fieldLabel:this.conflictResolutionText}),this.createVendorSpecificField({name:"spaceAround",hidden:!0!==this.symbolizer.vendorOptions.conflictResolution,allowNegative:!0,ref:"../spaceAround",fieldLabel:this.spaceAroundText}),this.createVendorSpecificField({name:"goodnessOfFit",geometryTypes:["POLYGON"],fieldLabel:this.goodnessOfFitText})]}];
this.addEvents("change");gxp.TextSymbolizer.superclass.initComponent.call(this)},createField:function(a){var b=Ext.ComponentMgr.create(a);if(a.geometryTypes)this.on("geometrytype",function(c){-1===a.geometryTypes.indexOf(c)&&b.hide()});return b},createVendorSpecificField:function(a){var b=function(b,c){Ext.isEmpty(c)?delete this.symbolizer.vendorOptions[a.name]:this.symbolizer.vendorOptions[a.name]=!0===a.yesno?!0==c?"yes":"no":c;this.fireEvent("change",this.symbolizer)},c=Ext.ComponentMgr.create(Ext.applyIf(a,
{xtype:"numberfield",allowNegative:!1,value:a.value||this.symbolizer.vendorOptions[a.name],checked:!0===a.yesno?"yes"===this.symbolizer.vendorOptions[a.name]:this.symbolizer.vendorOptions[a.name],plugins:[{ptype:"gxp_formfieldhelp",dismissDelay:2E4,helpText:this[a.name.replace(/-/g,"_")+"Help"]}]}));c.on("change",b,this);c.on("check",b,this);if(a.geometryTypes)this.on("geometrytype",function(b){-1===a.geometryTypes.indexOf(b)&&c.hide()});return c},showHideGeometryOptions:function(){var a=/gml:((Multi)?(Point|Line|Polygon|Curve|Surface|Geometry)).*/,
b=/gml:((Multi)?(Polygon|Surface)).*/,c=/gml:((Multi)?(Point)).*/,d=/gml:((Multi)?(Line|Curve|Surface)).*/,e=null;this.attributes.each(function(f){f=f.get("type");a.exec(f)&&(b.exec(f)?e="POLYGON":c.exec(f)?e="POINT":d.exec(f)&&(e="LINE"))},this);if(null!==e)this.geometryType=e,this.fireEvent("geometrytype",e)}});Ext.reg("gxp_textsymbolizer",gxp.TextSymbolizer);Ext.namespace("gxp");
gxp.FillSymbolizer=Ext.extend(Ext.FormPanel,{symbolizer:null,colorProperty:"fillColor",opacityProperty:"fillOpacity",colorManager:null,checkboxToggle:!0,defaultColor:null,border:!1,fillText:"Fill",colorText:"Color",opacityText:"Opacity",initComponent:function(){if(!this.symbolizer)this.symbolizer={};var a;this.colorManager&&(a=[new this.colorManager]);var b=100;this.opacityProperty in this.symbolizer?b=100*this.symbolizer[this.opacityProperty]:OpenLayers.Renderer.defaultSymbolizer[this.opacityProperty]&&
(b=100*OpenLayers.Renderer.defaultSymbolizer[this.opacityProperty]);this.items=[{xtype:"fieldset",title:this.fillText,autoHeight:!0,checkboxToggle:this.checkboxToggle,collapsed:!0===this.checkboxToggle&&!1===this.symbolizer.fill,hideMode:"offsets",defaults:{width:100},items:[{xtype:"gxp_colorfield",fieldLabel:this.colorText,name:"color",emptyText:OpenLayers.Renderer.defaultSymbolizer[this.colorProperty],value:this.symbolizer[this.colorProperty],defaultBackground:this.defaultColor||OpenLayers.Renderer.defaultSymbolizer[this.colorProperty],
plugins:a,listeners:{valid:function(a){var a=a.getValue(),b=this.symbolizer[this.colorProperty]!=a;this.symbolizer[this.colorProperty]=a;b&&this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"slider",fieldLabel:this.opacityText,name:"opacity",values:[b],isFormField:!0,listeners:{changecomplete:function(a,b){this.symbolizer[this.opacityProperty]=b/100;this.fireEvent("change",this.symbolizer)},scope:this},plugins:[new GeoExt.SliderTip({getText:function(a){return a.value+"%"}})]}],listeners:{collapse:function(){if(!1!==
this.symbolizer.fill)this.symbolizer.fill=!1,this.fireEvent("change",this.symbolizer)},expand:function(){this.symbolizer.fill=!0;this.fireEvent("change",this.symbolizer)},scope:this}}];this.addEvents("change");gxp.FillSymbolizer.superclass.initComponent.call(this)}});Ext.reg("gxp_fillsymbolizer",gxp.FillSymbolizer);Ext.namespace("gxp");
gxp.PolygonSymbolizer=Ext.extend(Ext.Panel,{symbolizer:null,initComponent:function(){this.items=[{xtype:"gxp_fillsymbolizer",symbolizer:this.symbolizer,listeners:{change:function(){this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"gxp_strokesymbolizer",symbolizer:this.symbolizer,listeners:{change:function(){this.fireEvent("change",this.symbolizer)},scope:this}}];this.addEvents("change");gxp.PolygonSymbolizer.superclass.initComponent.call(this)}});Ext.reg("gxp_polygonsymbolizer",gxp.PolygonSymbolizer);
Ext.namespace("gxp");
gxp.StrokeSymbolizer=Ext.extend(Ext.FormPanel,{solidStrokeName:"solid",dashStrokeName:"dash",dotStrokeName:"dot",titleText:"Stroke",styleText:"Style",colorText:"Color",widthText:"Width",opacityText:"Opacity",symbolizer:null,colorManager:null,checkboxToggle:!0,defaultColor:null,dashStyles:null,border:!1,initComponent:function(){this.dashStyles=this.dashStyles||[["solid",this.solidStrokeName],["4 4",this.dashStrokeName],["2 4",this.dotStrokeName]];if(!this.symbolizer)this.symbolizer={};var a;this.colorManager&&
(a=[new this.colorManager]);this.items=[{xtype:"fieldset",title:this.titleText,autoHeight:!0,checkboxToggle:this.checkboxToggle,collapsed:!0===this.checkboxToggle&&!1===this.symbolizer.stroke,hideMode:"offsets",defaults:{width:100},items:[{xtype:"combo",name:"style",fieldLabel:this.styleText,store:new Ext.data.SimpleStore({data:this.dashStyles,fields:["value","display"]}),displayField:"display",valueField:"value",value:this.getDashArray(this.symbolizer.strokeDashstyle)||OpenLayers.Renderer.defaultSymbolizer.strokeDashstyle,
mode:"local",allowBlank:!0,triggerAction:"all",editable:!1,listeners:{select:function(a,c){this.symbolizer.strokeDashstyle=c.get("value");this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"gxp_colorfield",name:"color",fieldLabel:this.colorText,emptyText:OpenLayers.Renderer.defaultSymbolizer.strokeColor,value:this.symbolizer.strokeColor,defaultBackground:this.defaultColor||OpenLayers.Renderer.defaultSymbolizer.strokeColor,plugins:a,listeners:{valid:function(a){var a=a.getValue(),c=this.symbolizer.strokeColor!=
a;this.symbolizer.strokeColor=a;c&&this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"numberfield",name:"width",fieldLabel:this.widthText,allowNegative:!1,emptyText:OpenLayers.Renderer.defaultSymbolizer.strokeWidth,value:this.symbolizer.strokeWidth,listeners:{change:function(a,c){c=parseFloat(c);isNaN(c)?delete this.symbolizer.strokeWidth:this.symbolizer.strokeWidth=c;this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"slider",name:"opacity",fieldLabel:this.opacityText,values:[100*
("strokeOpacity"in this.symbolizer?this.symbolizer.strokeOpacity:OpenLayers.Renderer.defaultSymbolizer.strokeOpacity)],isFormField:!0,listeners:{changecomplete:function(a,c){this.symbolizer.strokeOpacity=c/100;this.fireEvent("change",this.symbolizer)},scope:this},plugins:[new GeoExt.SliderTip({getText:function(a){return a.value+"%"}})]}],listeners:{collapse:function(){if(!1!==this.symbolizer.stroke)this.symbolizer.stroke=!1,this.fireEvent("change",this.symbolizer)},expand:function(){this.symbolizer.stroke=
!0;this.fireEvent("change",this.symbolizer)},scope:this}}];this.addEvents("change");gxp.StrokeSymbolizer.superclass.initComponent.call(this)},getDashArray:function(a){var b;a&&(a=a.split(/\s+/),a=a[0]/a[1],isNaN(a)||(b=1<=a?"4 4":"2 4"));return b}});Ext.reg("gxp_strokesymbolizer",gxp.StrokeSymbolizer);Ext.namespace("gxp");
gxp.LineSymbolizer=Ext.extend(Ext.Panel,{symbolizer:null,initComponent:function(){this.items=[{xtype:"gxp_strokesymbolizer",symbolizer:this.symbolizer,listeners:{change:function(){this.fireEvent("change",this.symbolizer)},scope:this}}];this.addEvents("change");gxp.LineSymbolizer.superclass.initComponent.call(this)}});Ext.reg("gxp_linesymbolizer",gxp.LineSymbolizer);Ext.namespace("gxp");
gxp.PointSymbolizer=Ext.extend(Ext.Panel,{symbolizer:null,graphicCircleText:"circle",graphicSquareText:"square",graphicTriangleText:"triangle",graphicStarText:"star",graphicCrossText:"cross",graphicXText:"x",graphicExternalText:"external",urlText:"URL",opacityText:"opacity",symbolText:"Symbol",sizeText:"Size",rotationText:"Rotation",pointGraphics:null,colorManager:null,external:null,layout:"form",initComponent:function(){if(!this.symbolizer)this.symbolizer={};if(!this.pointGraphics)this.pointGraphics=
[{display:this.graphicCircleText,value:"circle",mark:!0},{display:this.graphicSquareText,value:"square",mark:!0},{display:this.graphicTriangleText,value:"triangle",mark:!0},{display:this.graphicStarText,value:"star",mark:!0},{display:this.graphicCrossText,value:"cross",mark:!0},{display:this.graphicXText,value:"x",mark:!0},{display:this.graphicExternalText}];this.external=!!this.symbolizer.externalGraphic;this.markPanel=new Ext.Panel({border:!1,collapsed:this.external,layout:"form",items:[{xtype:"gxp_fillsymbolizer",
symbolizer:this.symbolizer,labelWidth:this.labelWidth,labelAlign:this.labelAlign,colorManager:this.colorManager,listeners:{change:function(){this.fireEvent("change",this.symbolizer)},scope:this}},{xtype:"gxp_strokesymbolizer",symbolizer:this.symbolizer,labelWidth:this.labelWidth,labelAlign:this.labelAlign,colorManager:this.colorManager,listeners:{change:function(){this.fireEvent("change",this.symbolizer)},scope:this}}]});this.urlField=new Ext.form.TextField({name:"url",fieldLabel:this.urlText,value:this.symbolizer.externalGraphic,
hidden:!this.external,listeners:{change:function(a,b){this.symbolizer.externalGraphic=b;this.fireEvent("change",this.symbolizer)},scope:this},width:100});this.graphicPanel=new Ext.Panel({border:!1,collapsed:!this.external,layout:"form",items:[this.urlField,{xtype:"slider",name:"opacity",fieldLabel:this.opacityText,value:[null==this.symbolizer.graphicOpacity?100:100*this.symbolizer.graphicOpacity],isFormField:!0,listeners:{changecomplete:function(a,b){this.symbolizer.graphicOpacity=b/100;this.fireEvent("change",
this.symbolizer)},scope:this},plugins:[new GeoExt.SliderTip({getText:function(a){return a.value+"%"}})],width:100}]});this.items=[{xtype:"combo",name:"mark",fieldLabel:this.symbolText,store:new Ext.data.JsonStore({data:{root:this.pointGraphics},root:"root",fields:["value","display","preview",{name:"mark",type:"boolean"}]}),value:this.external?0:this.symbolizer.graphicName,displayField:"display",valueField:"value",tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item gx-pointsymbolizer-mark-item"><tpl if="preview"><img src="{preview}" alt="{display}"/></tpl><span>{display}</span></div></tpl>'),
mode:"local",allowBlank:!1,triggerAction:"all",editable:!1,listeners:{select:function(a,b){var c=b.get("mark"),d=b.get("value");if(c){if(this.external)this.external=!1,delete this.symbolizer.externalGraphic,this.updateGraphicDisplay();this.symbolizer.graphicName=d}else if(d?(this.urlField.hide(),this.symbolizer.externalGraphic=d):this.urlField.show(),!this.external)this.external=!0,c=this.urlField.getValue(),Ext.isEmpty(c)||(this.symbolizer.externalGraphic=c),delete this.symbolizer.graphicName,this.updateGraphicDisplay();
this.fireEvent("change",this.symbolizer)},scope:this},width:100},{xtype:"textfield",name:"size",fieldLabel:this.sizeText,value:this.symbolizer.pointRadius&&2*this.symbolizer.pointRadius,listeners:{change:function(a,b){this.symbolizer.pointRadius=b/2;this.fireEvent("change",this.symbolizer)},scope:this},width:100},{xtype:"textfield",name:"rotation",fieldLabel:this.rotationText,value:this.symbolizer.rotation,listeners:{change:function(a,b){this.symbolizer.rotation=b;this.fireEvent("change",this.symbolizer)},
scope:this},width:100},this.markPanel,this.graphicPanel];this.addEvents("change");gxp.PointSymbolizer.superclass.initComponent.call(this)},updateGraphicDisplay:function(){this.external?(this.markPanel.collapse(),this.graphicPanel.expand()):(this.graphicPanel.collapse(),this.markPanel.expand())}});Ext.reg("gxp_pointsymbolizer",gxp.PointSymbolizer);Ext.namespace("gxp.form");
gxp.form.FilterField=Ext.extend(Ext.form.CompositeField,{lowerBoundaryTip:"lower boundary",upperBoundaryTip:"upper boundary",caseInsensitiveMatch:!1,filter:null,attributes:null,attributesComboConfig:null,initComponent:function(){if(!this.filter)this.filter=this.createDefaultFilter();var a="remote",b=new GeoExt.data.AttributeStore;if(this.attributes)0!=this.attributes.getCount()?(a="local",this.attributes.each(function(a){/gml:((Multi)?(Point|Line|Polygon|Curve|Surface|Geometry)).*/.exec(a.get("type"))||
b.add([a])})):b=this.attributes;a={xtype:"combo",store:b,editable:"local"==a,typeAhead:!0,forceSelection:!0,mode:a,triggerAction:"all",ref:"property",allowBlank:this.allowBlank,displayField:"name",valueField:"name",value:this.filter.property,listeners:{select:function(a,b){this.items.get(1).enable();this.filter.property=b.get("name");this.fireEvent("change",this.filter,this)},blur:function(a){var b=a.store.findExact("name",a.getValue());-1!=b?a.fireEvent("select",a,a.store.getAt(b)):null!=a.startValue&&
a.setValue(a.startValue)},scope:this},width:120};this.attributesComboConfig=this.attributesComboConfig||{};Ext.applyIf(this.attributesComboConfig,a);this.items=this.createFilterItems();this.addEvents("change");gxp.form.FilterField.superclass.initComponent.call(this)},validateValue:function(){return this.filter.type===OpenLayers.Filter.Comparison.BETWEEN?null!==this.filter.property&&null!==this.filter.upperBoundary&&null!==this.filter.lowerBoundary:null!==this.filter.property&&null!==this.filter.value&&
null!==this.filter.type},createDefaultFilter:function(){return new OpenLayers.Filter.Comparison({matchCase:!this.caseInsensitiveMatch})},createFilterItems:function(){var a=this.filter.type===OpenLayers.Filter.Comparison.BETWEEN;return[this.attributesComboConfig,Ext.applyIf({xtype:"gxp_comparisoncombo",ref:"type",disabled:null==this.filter.property,allowBlank:this.allowBlank,value:this.filter.type,listeners:{select:function(a,c){this.items.get(2).enable();this.items.get(3).enable();this.items.get(4).enable();
this.setFilterType(c.get("value"));this.fireEvent("change",this.filter,this)},scope:this}},this.comparisonComboConfig),{xtype:"textfield",disabled:null==this.filter.type,hidden:a,ref:"value",value:this.filter.value,width:50,grow:!0,growMin:50,anchor:"100%",allowBlank:this.allowBlank,listeners:{change:function(a,c){this.filter.value=c;this.fireEvent("change",this.filter,this)},scope:this}},{xtype:"textfield",disabled:null==this.filter.type,hidden:!a,value:this.filter.lowerBoundary,tooltip:this.lowerBoundaryTip,
grow:!0,growMin:30,ref:"lowerBoundary",anchor:"100%",allowBlank:this.allowBlank,listeners:{change:function(a,c){this.filter.lowerBoundary=c;this.fireEvent("change",this.filter,this)},render:function(a){Ext.QuickTips.register({target:a.getEl(),text:this.lowerBoundaryTip})},autosize:function(a,c){a.setWidth(c);a.ownerCt.doLayout()},scope:this}},{xtype:"textfield",disabled:null==this.filter.type,hidden:!a,grow:!0,growMin:30,ref:"upperBoundary",value:this.filter.upperBoundary,allowBlank:this.allowBlank,
listeners:{change:function(a,c){this.filter.upperBoundary=c;this.fireEvent("change",this.filter,this)},render:function(a){Ext.QuickTips.register({target:a.getEl(),text:this.upperBoundaryTip})},scope:this}}]},setFilterType:function(a){this.filter.type=a;a===OpenLayers.Filter.Comparison.BETWEEN?(this.items.get(2).hide(),this.items.get(3).show(),this.items.get(4).show()):(this.items.get(2).show(),this.items.get(3).hide(),this.items.get(4).hide());this.doLayout()},setFilter:function(a){var b=this.filter.type;
this.filter=a;b!==a.type&&this.setFilterType(a.type);this.property.setValue(a.property);this.type.setValue(a.type);a.type===OpenLayers.Filter.Comparison.BETWEEN?(this.lowerBoundary.setValue(a.lowerBoundary),this.upperBoundary.setValue(a.upperBoundary)):this.value.setValue(a.value);this.fireEvent("change",this.filter,this)}});Ext.reg("gxp_filterfield",gxp.form.FilterField);Ext.namespace("gxp.form");
gxp.form.ComparisonComboBox=Ext.extend(Ext.form.ComboBox,{allowedTypes:[[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.LIKE,"like"],[OpenLayers.Filter.Comparison.BETWEEN,"between"]],allowBlank:!1,mode:"local",typeAhead:!0,
forceSelection:!0,triggerAction:"all",width:50,editable:!0,initComponent:function(){var a={displayField:"name",valueField:"value",store:new Ext.data.SimpleStore({data:this.allowedTypes,fields:["value","name"]}),value:void 0===this.value?this.allowedTypes[0][0]:this.value,listeners:{blur:function(){var a=this.store.findExact("value",this.getValue());-1!=a?this.fireEvent("select",this,this.store.getAt(a)):null!=this.startValue&&this.setValue(this.startValue)}}};Ext.applyIf(this,a);gxp.form.ComparisonComboBox.superclass.initComponent.call(this)}});
Ext.reg("gxp_comparisoncombo",gxp.form.ComparisonComboBox);Ext.namespace("gxp.form");
gxp.form.ColorField=Ext.extend(Ext.form.TextField,{cssColors:{aqua:"#00FFFF",black:"#000000",blue:"#0000FF",fuchsia:"#FF00FF",gray:"#808080",green:"#008000",lime:"#00FF00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#FF0000",silver:"#C0C0C0",teal:"#008080",white:"#FFFFFF",yellow:"#FFFF00"},defaultBackground:"#ffffff",initComponent:function(){if(this.value)this.value=this.hexToColor(this.value);gxp.form.ColorField.superclass.initComponent.call(this);this.on({render:this.colorField,
valid:this.colorField,scope:this})},isDark:function(a){var b=!1;if(a)var b=parseInt(a.substring(1,3),16)/255,c=parseInt(a.substring(3,5),16)/255,a=parseInt(a.substring(5,7),16)/255,b=0.5>0.299*b+0.587*c+0.144*a;return b},colorField:function(){var a=this.colorToHex(this.getValue())||this.defaultBackground;this.getEl().setStyle({background:a,color:this.isDark(a)?"#ffffff":"#000000"})},getHexValue:function(){return this.colorToHex(gxp.form.ColorField.superclass.getValue.apply(this,arguments))},getValue:function(){var a=
this.getHexValue(),b=this.initialConfig.value;a===this.hexToColor(b)&&(a=b);return a},setValue:function(a){gxp.form.ColorField.superclass.setValue.apply(this,[this.hexToColor(a)])},colorToHex:function(a){return!a?a:a.match(/^#[0-9a-f]{6}$/i)?a:this.cssColors[a.toLowerCase()]||null},hexToColor:function(a){if(!a)return a;for(var b in this.cssColors)if(this.cssColors[b]==a.toUpperCase()){a=b;break}return a}});Ext.reg("gxp_colorfield",gxp.form.ColorField);Ext.namespace("gxp.form");
gxp.form.FontComboBox=Ext.extend(Ext.form.ComboBox,{fonts:"Serif,SansSerif,Arial,Courier New,Tahoma,Times New Roman,Verdana".split(","),defaultFont:"Serif",allowBlank:!1,mode:"local",triggerAction:"all",editable:!1,initComponent:function(){var a=this.fonts||gxp.form.FontComboBox.prototype.fonts,b=this.defaultFont;-1===a.indexOf(this.defaultFont)&&(b=a[0]);a={displayField:"field1",valueField:"field1",store:a,value:b,tpl:new Ext.XTemplate('<tpl for="."><div class="x-combo-list-item"><span style="font-family: {field1};">{field1}</span></div></tpl>')};
Ext.applyIf(this,a);gxp.form.FontComboBox.superclass.initComponent.call(this)}});Ext.reg("gxp_fontcombo",gxp.form.FontComboBox);Ext.namespace("gxp.grid");
gxp.grid.FeatureGrid=Ext.extend(Ext.grid.GridPanel,{map:null,ignoreFields:null,includeFields:null,layer:null,columnsSortable:!0,columnMenuDisabled:!1,initComponent:function(){this.ignoreFields=["feature","state","fid"].concat(this.ignoreFields);if(this.store){if(this.cm=this.createColumnModel(this.store),this.map)this.layer=new OpenLayers.Layer.Vector(this.id+"_layer"),this.map.addLayer(this.layer)}else this.store=new Ext.data.Store,this.cm=new Ext.grid.ColumnModel({columns:[]});if(this.layer)this.sm=
this.sm||new GeoExt.grid.FeatureSelectionModel({layerFromStore:!1,layer:this.layer}),this.store instanceof GeoExt.data.FeatureStore&&this.store.bind(this.layer);if(!this.dateFormat)this.dateFormat=Ext.form.DateField.prototype.format;if(!this.timeFormat)this.timeFormat=Ext.form.TimeField.prototype.format;gxp.grid.FeatureGrid.superclass.initComponent.call(this)},onDestroy:function(){this.initialConfig&&this.initialConfig.map&&!this.initialConfig.layer&&(this.layer.destroy(),delete this.layer);gxp.grid.FeatureGrid.superclass.onDestroy.apply(this,
arguments)},setStore:function(a,b){if(b)this.schema=b;a?(this.store instanceof GeoExt.data.FeatureStore&&this.store.unbind(),this.layer&&(this.layer.destroyFeatures(),a.bind(this.layer)),this.reconfigure(a,this.createColumnModel(a))):this.reconfigure(new Ext.data.Store,new Ext.grid.ColumnModel({columns:[]}))},getColumns:function(a){function b(a){return function(b){var c=b;"string"==typeof b&&(c=Date.parseDate(b.replace(/Z$/,""),"c"));return c?c.format(a):b}}var c=[],d=this.customEditors||{},e=this.customRenderers||
{},f,g,h,j,k;(this.schema||a.fields).each(function(a){if(this.schema)switch(f=a.get("name"),g=a.get("type").split(":").pop(),j=null,g){case "date":j=this.dateFormat;break;case "datetime":j=j?j:this.dateFormat+" "+this.timeFormat;h=void 0;k=b(j);break;case "boolean":h="booleancolumn";break;case "string":h="gridcolumn";break;default:h="numbercolumn"}else f=a.name;if(-1===this.ignoreFields.indexOf(f)&&(null===this.includeFields||0<=this.includeFields.indexOf(f)))c.push(Ext.apply({dataIndex:f,hidden:this.fieldVisibility?
!this.fieldVisibility[f]:!1,header:this.propertyNames?this.propertyNames[f]||f:f,sortable:this.columnsSortable,menuDisabled:this.columnMenuDisabled,xtype:h,editor:d[f]||{xtype:"textfield"},format:j,renderer:e[f]||(h?void 0:k)},this.columnConfig?this.columnConfig[f]:null))},this);return c},createColumnModel:function(a){a=this.getColumns(a);return new Ext.grid.ColumnModel(a)}});Ext.reg("gxp_featuregrid",gxp.grid.FeatureGrid);Ext.namespace("gxp.slider");
gxp.slider.Tip=Ext.extend(Ext.slider.Tip,{hover:!0,dragging:!1,init:function(a){if(this.hover)a.on("render",this.registerThumbListeners,this);this.slider=a;gxp.slider.Tip.superclass.init.apply(this,arguments)},registerThumbListeners:function(){for(var a=0,b=this.slider.thumbs.length;a<b;++a)this.slider.thumbs[a].el.on({mouseover:this.createHoverListener(a),mouseout:function(){this.dragging||this.hide.apply(this,arguments)},scope:this})},createHoverListener:function(a){return function(){this.onSlide(this.slider,
{},this.slider.thumbs[a]);this.dragging=!1}.createDelegate(this)},onSlide:function(a,b,c){this.dragging=!0;gxp.slider.Tip.superclass.onSlide.apply(this,arguments)}});Ext.namespace("gxp");
gxp.NewSourceDialog=Ext.extend(Ext.Panel,{title:"Add New Server...",cancelText:"Cancel",addServerText:"Add Server",invalidURLText:"Enter a valid URL to a WMS/TMS/REST endpoint (e.g. http://example.com/geoserver/wms)",contactingServerText:"Contacting Server...",bodyStyle:"padding: 0px",error:null,initComponent:function(){this.addEvents("urlselected");this.urlTextField=new Ext.form.TextField({fieldLabel:"URL",allowBlank:!1,width:240,msgTarget:"under",validator:this.urlValidator.createDelegate(this),
listeners:{specialkey:function(a,b){b.getKey()===b.ENTER&&this.addServer()},scope:this}});this.form=new Ext.form.FormPanel({items:[{xtype:"combo",width:240,name:"type",fieldLabel:"Type",value:"WMS",mode:"local",triggerAction:"all",store:[["WMS","Web Map Service (WMS)"],["TMS","Tiled Map Service (TMS)"],["REST","ArcGIS REST Service (REST)"]]},this.urlTextField],border:!1,labelWidth:30,bodyStyle:"padding: 5px",autoWidth:!0,autoHeight:!0,listeners:{afterrender:function(){this.urlTextField.focus(!1,!0)},
scope:this}});this.bbar=[new Ext.Button({text:this.cancelText,handler:this.hide,scope:this}),new Ext.Toolbar.Fill,new Ext.Button({text:this.addServerText,iconCls:"add",handler:this.addServer,scope:this})];this.items=this.form;gxp.NewSourceDialog.superclass.initComponent.call(this);this.form.on("render",function(){this.loadMask=new Ext.LoadMask(this.form.getEl(),{msg:this.contactingServerText})},this);this.on({hide:this.reset,removed:this.reset,scope:this});this.on("urlselected",function(a,b){this.setLoading();
this.addSource(b,this.hide,function(){this.setError(this.sourceLoadFailureMessage)},this)},this)},addServer:function(){this.error=null;this.urlTextField.validate()&&this.fireEvent("urlselected",this,this.urlTextField.getValue(),this.form.getForm().findField("type").getValue())},reset:function(){this.error=null;this.urlTextField.reset();this.loadMask.hide()},urlRegExp:/^(http(s)?:)?\/\/([\w%]+:[\w%]+@)?([^@\/:]+)(:\d+)?\//i,urlValidator:function(a){a=this.urlRegExp.test(a)?!this.error||this.error:
this.invalidURLText;this.error=null;return a},setLoading:function(){this.loadMask.show()},setError:function(a){this.loadMask.hide();this.error=a;this.urlTextField.validate()},addSource:function(){}});Ext.reg("gxp_newsourcedialog",gxp.NewSourceDialog);Ext.namespace("gxp.plugins");
gxp.plugins.LayerSource=Ext.extend(Ext.util.Observable,{store:null,lazy:!1,hidden:!1,title:"",constructor:function(a){this.initialConfig=a;Ext.apply(this,a);this.addEvents("ready","failure");gxp.plugins.LayerSource.superclass.constructor.apply(this,arguments)},init:function(a){this.target=a;this.createStore()},getMapProjection:function(){var a=this.target.mapPanel.map.projection;return this.target.mapPanel.map.getProjectionObject()||a&&new OpenLayers.Projection(a)||new OpenLayers.Projection("EPSG:4326")},
getProjection:function(a){var a=a.getLayer(),b=this.getMapProjection();return(a.projection?a.projection instanceof OpenLayers.Projection?a.projection:new OpenLayers.Projection(a.projection):b).equals(b)?b:null},createStore:function(){this.fireEvent("ready",this)},createLayerRecord:function(){},getConfigForRecord:function(a){var b=a.getLayer();return{source:a.get("source"),name:a.get("name"),title:a.get("title"),visibility:b.getVisibility(),opacity:b.opacity||void 0,group:a.get("group"),fixed:a.get("fixed"),
selected:a.get("selected")}},getState:function(){return Ext.apply({},this.initialConfig)}});Ext.namespace("gxp.plugins");
gxp.plugins.Tool=Ext.extend(Ext.util.Observable,{ptype:"gxp_tool",autoActivate:!0,actionTarget:"map.tbar",showButtonText:!1,output:null,constructor:function(a){this.initialConfig=a||{};this.active=!1;Ext.apply(this,a);if(!this.id)this.id=Ext.id();this.output=[];this.addEvents("activate","deactivate");gxp.plugins.Tool.superclass.constructor.apply(this,arguments)},init:function(a){a.tools[this.id]=this;this.target=a;this.autoActivate&&this.activate();this.target.on("portalready",this.addActions,this)},
activate:function(){if(!1===this.active)return this.active=!0,this.fireEvent("activate",this),!0},deactivate:function(){if(!0===this.active)return this.active=!1,this.fireEvent("deactivate",this),!0},getContainer:function(a){var b,c;b=a.split(".");if(c=b[0])if("map"==c)a=this.target.mapPanel;else{if(a=Ext.getCmp(c)||this.target.portal[c],!a)throw Error("Can't find component with id: "+c);}else a=this.target.portal;if(b=1<b.length&&b[1])a=(c={tbar:"getTopToolbar",bbar:"getBottomToolbar",fbar:"getFooterToolbar"}[b])?
a[c]():a[b];return a},addActions:function(a){a=a||this.actions;if(!a||null===this.actionTarget)this.removeOutput(),this.addOutput(this.outputConfig);else{var b=this.actionTarget instanceof Array?this.actionTarget:[this.actionTarget],a=a instanceof Array?a:[a],c,d,e,f,g,h,j=null;for(e=b.length-1;0<=e;--e){if(c=b[e]){if(c instanceof Object)j=c.index,c=c.target;h=this.getContainer(c)}for(f=0,g=a.length;f<g;++f){if(!(a[f]instanceof Ext.Action||a[f]instanceof Ext.Component))if((d=Ext.getCmp(a[f]))&&(a[f]=
d),"string"!=typeof a[f]){if(f==this.defaultAction)a[f].pressed=!0;a[f]=new Ext.Action(a[f])}c=a[f];if(f==this.defaultAction&&c instanceof GeoExt.Action)c.isDisabled()?c.activateOnEnable=!0:c.control.activate();if(h){this.showButtonText&&c.setText(c.initialConfig.buttonText);h instanceof Ext.menu.Menu?c=Ext.apply(new Ext.menu.CheckItem(c),{text:c.initialConfig.menuText,group:c.initialConfig.toggleGroup,groupClass:null}):h instanceof Ext.Toolbar||(c=new Ext.Button(c));var k=null===j?h.add(c):h.insert(j,
c);c=c instanceof Ext.Button?c:k;null!==j&&(j+=1);if(null!=this.outputAction&&f==this.outputAction)c.on("click",function(){d?this.outputTarget?d.show():d.ownerCt.ownerCt.show():d=this.addOutput()},this)}}h&&(h.isVisible()?h.doLayout():h instanceof Ext.menu.Menu||h.show())}return this.actions=a}},addOutput:function(a){if(a||this.outputConfig){var a=a||{},b=this.outputTarget;b?(b=this.getContainer(b),a instanceof Ext.Component||Ext.apply(a,this.outputConfig)):(b=this.outputConfig||{},b=(new Ext.Window(Ext.apply({hideBorders:!0,
shadow:!1,closeAction:"hide",autoHeight:!b.height,layout:b.height?"fit":void 0,items:[{defaults:Ext.applyIf({autoHeight:!b.height&&!(b.defaults&&b.defaults.height)},b.defaults)}]},b))).show().items.get(0));if(b)return a=b.add(a),a.on("removed",function(a){this.output.remove(a)},this,{single:!0}),a instanceof Ext.Window?a.show():b.doLayout(),this.output.push(a),a;a=this.ptype;window.console&&console.error("Failed to create output for plugin with ptype: "+a)}},removeOutput:function(){for(var a,b=this.output.length-
1;0<=b;--b)if(a=this.output[b],this.outputTarget)if(a.ownerCt){if(a.ownerCt.remove(a),a.ownerCt instanceof Ext.Window)a.ownerCt[a.ownerCt.closeAction]()}else a.remove();else a.findParentBy(function(a){return a instanceof Ext.Window}).close();this.output=[]},getState:function(){return Ext.apply({},this.initialConfig)}});Ext.preg(gxp.plugins.Tool.prototype.ptype,gxp.plugins.Tool);Ext.namespace("gxp.plugins");
gxp.plugins.FeedGetFeatureInfo=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_getfeedfeatureinfo",init:function(a){gxp.plugins.FeedGetFeatureInfo.superclass.init.apply(this,arguments);this.target.mapPanel.layers.on({add:this.addLayer,remove:this.removeLayer,scope:this})},addLayer:function(a,b){for(var c=0,d=b.length;c<d;++c){var e=b[c],f=this.target.getSource(e),e=e.getLayer();if(f instanceof gxp.plugins.FeedSource)null==this.target.selectControl?(this.target.selectControl=new OpenLayers.Control.SelectFeature(e,
{clickout:!0,listeners:{clickoutFeature:function(){}},scope:this}),this.target.mapPanel.map.addControl(this.target.selectControl)):(f=this.target.selectControl.layers?this.target.selectControl.layers:this.target.selectControl.layer?[this.target.selectControl.layer]:[],f.push(e),this.target.selectControl.setLayer(f))}this.target.selectControl&&this.target.selectControl.activate()},removeLayer:function(a,b){b.length||(b=[b]);for(var c=0,d=b.length;c<d;++c){var e=b[c].getLayer(),f=this.target.selectControl;
if(null!=f)if(f.layers)for(var g=0;g<f.layers.length;g++){var h=f.layers;f.layers[g].id===e.id&&(h.splice(g,1),f.setLayer(h))}else null!=f.layer&&e.id===f.layer.id&&f.setLayer([])}}});Ext.preg(gxp.plugins.FeedGetFeatureInfo.prototype.ptype,gxp.plugins.FeedGetFeatureInfo);Ext.namespace("gxp.plugins");
gxp.plugins.FeedSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_feedsource",title:"Feed Source",format:"OpenLayers.Format.GeoRSS",popupTemplate:'<a target="_blank" href="{link}">{description}</a>',fixed:!0,createLayerRecord:function(a){var b=new OpenLayers.Layer.Vector(a.name,{projection:"projection"in a?a.projection:"EPSG:4326",visibility:"visibility"in a?a.visibility:!0,strategies:[this.fixed?new OpenLayers.Strategy.Fixed:new OpenLayers.Strategy.BBOX({resFactor:1,ratio:1})],protocol:new OpenLayers.Protocol.HTTP({url:this.url,
params:a.params,format:this.getFormat(a)}),styleMap:this.getStyleMap(a)});this.configureInfoPopup(b);var c=GeoExt.data.LayerRecord.create([{name:"name",type:"string"},{name:"source",type:"string"},{name:"group",type:"string"},{name:"fixed",type:"boolean"},{name:"selected",type:"boolean"},{name:"visibility",type:"boolean"},{name:"format",type:"string"},{name:"defaultStyle"},{name:"selectStyle"},{name:"params"}]),d="format"in a?a.format:this.format;return new c({layer:b,name:a.name,source:a.source,
group:a.group,fixed:"fixed"in a?a.fixed:!1,selected:"selected"in a?a.selected:!1,params:"params"in a?a.params:{},visibility:"visibility"in a?a.visibility:!1,format:d instanceof String?d:null,defaultStyle:"defaultStyle"in a?a.defaultStyle:{},selectStyle:"selectStyle"in a?a.selectStyle:{}},b.id)},getConfigForRecord:function(a){var b=gxp.plugins.FeedSource.superclass.getConfigForRecord.apply(this,arguments);return Ext.apply(b,{name:a.get("name"),group:a.get("group"),fixed:a.get("fixed"),selected:a.get("selected"),
params:a.get("params"),visibility:a.getLayer().getVisibility(),format:a.get("format"),defaultStyle:a.getLayer().styleMap.styles["default"].defaultStyle,selectStyle:a.getLayer().styleMap.styles.select.defaultStyle})},getFormat:function(a){var b=window,a="format"in a?a.format:this.format;if("string"==typeof a||a instanceof String){for(var a=a.split("."),c=0,d=a.length;c<d&&!(b=b[a[c]],!b);++c);if(b&&b.prototype&&b.prototype.initialize)return a=function(){b.prototype.initialize.apply(this)},a.prototype=
b.prototype,new a}else return a},configureInfoPopup:function(a){var b=new Ext.XTemplate(this.popupTemplate);a.events.on({featureselected:function(a){a=a.feature;if(this.target.selectControl)this.target.selectControl.popup&&this.target.selectControl.popup.close(),this.target.selectControl.popup=new GeoExt.Popup({title:a.attributes.title,closeAction:"destroy",location:a,html:b.apply(a.attributes)}),this.target.selectControl.popup.show()},featureunselected:function(){this.target.selectControl&&this.target.selectControl.popup&&
this.target.selectControl.popup.close()},scope:this})},getStyleMap:function(a){return new OpenLayers.StyleMap({"default":new OpenLayers.Style("defaultStyle"in a?a.defaultStyle:{graphicName:"circle",pointRadius:5,fillOpacity:0.7,fillColor:"Red"},{title:a.name}),select:new OpenLayers.Style("selectStyle"in a?a.selectStyle:{graphicName:"circle",pointRadius:10,fillOpacity:1,fillColor:"Yellow"})})}});Ext.preg(gxp.plugins.FeedSource.prototype.ptype,gxp.plugins.FeedSource);Ext.namespace("gxp.plugins");
gxp.plugins.PicasaFeedSource=Ext.extend(gxp.plugins.FeedSource,{ptype:"gxp_picasasource",url:"http://picasaweb.google.com/data/feed/base/all?thumbsize=160c&",format:"OpenLayers.Format.Picasa",title:"Picasa Photos",pointRadius:14,popupTemplate:'<tpl for="."><a target="_blank" href="{link}"><img  title="{title}" src="{thumbnail}"/></a></tpl>',fixed:!1,createLayerRecord:function(a){Ext.isEmpty(a.params["max-results"])&&(a.params["max-results"]=50);a.url=this.url;this.format=new OpenLayers.Format.GeoRSS({createFeatureFromItem:function(a){var b=
OpenLayers.Format.GeoRSS.prototype.createFeatureFromItem.apply(this,arguments);b.attributes.thumbnail=this.getElementsByTagNameNS(a,"http://search.yahoo.com/mrss/","thumbnail")[0].getAttribute("url");b.attributes.content=OpenLayers.Util.getXmlNodeValue(this.getElementsByTagNameNS(a,"*","summary")[0]);return b}});var b=gxp.plugins.PicasaFeedSource.superclass.createLayerRecord.apply(this,arguments);b.getLayer().protocol.filterToParams=function(a,b){if(a.type===OpenLayers.Filter.Spatial.BBOX){var e=
a.value.toArray();b.bbox=[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]}return b};return b},configureInfoPopup:function(a){var b=new Ext.XTemplate(this.popupTemplate);a.events.on({featureselected:function(a){a=a.feature;null!=this.target.selectControl.popup&&this.target.selectControl.popup.close();var d=document.createElement("div");d.innerHTML=a.attributes.content;d={link:d.getElementsByTagName("a")[0].getAttribute("href"),title:a.attributes.title,thumbnail:a.attributes.thumbnail};
this.target.selectControl.popup=new GeoExt.Popup({title:a.attributes.title,closeAction:"destroy",location:a,width:175,height:200,html:b.apply(d)});this.target.selectControl.popup.show()},featureunselected:function(){this.target.selectControl&&this.target.selectControl.popup&&this.target.selectControl.popup.close()},scope:this})},getStyleMap:function(){return new OpenLayers.StyleMap({"default":new OpenLayers.Style({externalGraphic:"${thumbnail}",pointRadius:this.pointRadius},{title:this.title}),select:new OpenLayers.Style({pointRadius:this.pointRadius+
5})})}});Ext.preg(gxp.plugins.PicasaFeedSource.prototype.ptype,gxp.plugins.PicasaFeedSource);Ext.namespace("gxp.plugins");
gxp.plugins.YouTubeFeedSource=Ext.extend(gxp.plugins.FeedSource,{ptype:"gxp_youtubesource",url:"http://gdata.youtube.com/feeds/api/videos?v=2&prettyprint=true&",format:"OpenLayers.Format.YouTube",title:"Youtube Videos",pointRadius:24,popupTemplate:'<tpl for="."><a target="_blank" href="{link}"><img height="180"  width="240" title="{title}" src="{thumbnail}"/></a></tpl>',fixed:!1,createLayerRecord:function(a){a.params["max-results"]=Ext.isEmpty(a.params["max-results"])?50:Math.min(a.params["max-results"],
50);a.url=this.url;this.format=new OpenLayers.Format.GeoRSS({createFeatureFromItem:function(a){var b=OpenLayers.Format.GeoRSS.prototype.createFeatureFromItem.apply(this,arguments);b.attributes.thumbnail=this.getElementsByTagNameNS(a,"http://search.yahoo.com/mrss/","thumbnail")[4].getAttribute("url");b.attributes.content=OpenLayers.Util.getXmlNodeValue(this.getElementsByTagNameNS(a,"*","summary")[0]);return b}});var b=gxp.plugins.YouTubeFeedSource.superclass.createLayerRecord.apply(this,arguments);
b.getLayer().protocol.filterToParams=function(a,b){if(a.type===OpenLayers.Filter.Spatial.BBOX){var e=a.value,f=e.getCenterLonLat(),e=Math.min(2*((6378.137*e.right/180/3.1415926-6378.137*e.left/180/3.1415926)/2),1E3);Ext.apply(b,{location:""+f.lat+","+f.lon,"location-radius":e+"km"})}return b};return b},configureInfoPopup:function(a){var b=new Ext.XTemplate(this.popupTemplate);a.events.on({featureselected:function(a){a=a.feature;null!=this.target.selectControl.popup&&this.target.selectControl.popup.close();
this.target.selectControl.popup=new GeoExt.Popup({title:a.attributes.title,location:a,width:240,height:220,closeAction:"destroy",html:b.apply(a.attributes)});this.target.selectControl.popup.show()},featureunselected:function(){this.target.selectControl&&this.target.selectControl.popup&&this.target.selectControl.popup.close()},scope:this})},getStyleMap:function(){return new OpenLayers.StyleMap({"default":new OpenLayers.Style({externalGraphic:"${thumbnail}",pointRadius:24},{title:this.title}),select:new OpenLayers.Style({pointRadius:this.pointRadius+
5})})}});Ext.preg(gxp.plugins.YouTubeFeedSource.prototype.ptype,gxp.plugins.YouTubeFeedSource);Ext.namespace("gxp");
gxp.FeedSourceDialog=Ext.extend(Ext.Container,{feedTypeText:"Source",addPicasaText:"Picasa Photos",addYouTubeText:"YouTube Videos",addRSSText:"GeoRSS Feed",addFeedText:"Add to Map",addTitleText:"Title",keywordText:"Keyword",doneText:"Done",titleText:"Add Feeds",maxResultsText:"Max Items",width:300,autoHeight:!0,closeAction:"destroy",initComponent:function(){this.addEvents("addfeed");if(!this.feedTypes)this.feedTypes=[[gxp.plugins.PicasaFeedSource.ptype,this.addPicasaText],[gxp.plugins.YouTubeFeedSource.ptype,
this.addYouTubeText],[gxp.plugins.FeedSource.ptype,this.addRSSText]];var a=new Ext.data.ArrayStore({fields:["type","name"],data:this.feedTypes}),b=new Ext.form.ComboBox({store:a,fieldLabel:this.feedTypeText,displayField:"name",valueField:"type",typeAhead:!0,width:180,mode:"local",triggerAction:"all",emptyText:"Select a feed source...",selectOnFocus:!0,listeners:{select:function(a){a.value==gxp.plugins.FeedSource.ptype?(c.show(),d.hide(),f.hide(),g.show()):(c.hide(),d.show(),f.show(),g.hide());h.setDisabled(null==
a.value)},scope:this}}),c=new Ext.form.TextField({fieldLabel:"URL",allowBlank:!1,width:180,msgTarget:"right",validator:this.urlValidator.createDelegate(this)}),d=new Ext.form.TextField({fieldLabel:this.keywordText,allowBlank:!0,hidden:!0,width:180,msgTarget:"right"}),e=new Ext.form.TextField({fieldLabel:this.addTitleText,allowBlank:!0,width:180,msgTarget:"right"}),f=new Ext.form.ComboBox({fieldLabel:this.maxResultsText,hidden:!0,hiddenName:"max-results",store:new Ext.data.ArrayStore({fields:["max-results"],
data:[[10],[25],[50],[100]]}),displayField:"max-results",mode:"local",triggerAction:"all",emptyText:"Choose number...",labelWidth:70,width:180,defaults:{labelWidth:70,width:180}}),g=new gxp.PointSymbolizer({bodyStyle:{padding:"10px"},width:280,border:!1,hidden:!0,labelWidth:70,defaults:{labelWidth:70},symbolizer:{pointGraphics:"circle",pointRadius:"5"}});g.find("name","rotation")[0].hidden=!0;if("Point"===this.symbolType&&this.pointGraphics)cfg.pointGraphics=this.pointGraphics;var h=new Ext.Button({text:this.addFeedText,
iconCls:"gxp-icon-addlayers",disabled:!0,handler:function(){var a=b.getValue(),h={name:e.getValue()};if("gxp_feedsource"!=a)h.params={q:d.getValue(),"max-results":f.getValue()};else{h.url=c.getValue();var l=g.symbolizer;h.defaultStyle={};h.selectStyle={};Ext.apply(h.defaultStyle,l);Ext.apply(h.selectStyle,l);Ext.apply(h.selectStyle,{fillColor:"Yellow",pointRadius:parseInt(l.pointRadius)+2})}this.fireEvent("addfeed",a,h)},scope:this}),a=["->",h,new Ext.Button({text:this.doneText,handler:function(){this.hide()},
scope:this})];this.items=this.panel=new Ext.Panel({bbar:a,autoScroll:!0,items:[b,e,c,d,f,g],layout:"form",border:!1,labelWidth:100,bodyStyle:"padding: 5px",autoWidth:!0,autoHeight:!0});gxp.FeedSourceDialog.superclass.initComponent.call(this)},urlRegExp:/^(http(s)?:)?\/\/([\w%]+:[\w%]+@)?([^@\/:]+)(:\d+)?\//i,urlValidator:function(a){a=this.urlRegExp.test(a)?!this.error||this.error:this.invalidURLText;this.error=null;return a}});Ext.reg("gxp_feedsourcedialog",gxp.FeedSourceDialog);Ext.namespace("gxp.form");
gxp.form.CSWFilterField=Ext.extend(Ext.form.CompositeField,{clearTooltip:"Clear the filter for this category",emptyText:"Select filter",property:null,map:null,type:OpenLayers.Filter.Comparison.EQUAL_TO,name:null,comboFieldLabel:null,comboStoreData:null,target:null,getFilter:function(){return"BoundingBox"===this.property?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:this.property,projection:"EPSG:4326",value:this.map.getExtent().transform(this.map.getProjectionObject(),
new OpenLayers.Projection("EPSG:4326"))}):new OpenLayers.Filter.Comparison({type:this.type,property:this.property,value:this.combo.getValue()})},initComponent:function(){this.items=[{ref:"combo",xtype:"combo",fieldLabel:this.comboFieldLabel,store:new Ext.data.ArrayStore({fields:["id","value"],data:this.comboStoreData}),displayField:"value",valueField:"id",mode:"local",listeners:{select:function(){this.filter&&this.target.removeFilter(this.filter);this.filter=this.getFilter();this.target.addFilter(this.filter);
return!1},scope:this},emptyText:this.emptyText,triggerAction:"all"},{xtype:"button",iconCls:"gxp-icon-removelayers",tooltip:this.clearTooltip,handler:function(){this.target.removeFilter(this.filter);this.hide()},scope:this}];this.hidden=!0;gxp.form.CSWFilterField.superclass.initComponent.apply(this,arguments)},destroy:function(){this.map=this.target=this.filter=null;gxp.form.CSWFilterField.superclass.destroy.call(this)}});Ext.reg("gxp_cswfilterfield",gxp.form.CSWFilterField);Ext.namespace("gxp");
gxp.CatalogueSearchPanel=Ext.extend(Ext.Panel,{border:!1,maxRecords:10,map:null,selectedSource:null,sources:null,searchFieldEmptyText:"Search",searchButtonText:"Search",addTooltip:"Create filter",addMapTooltip:"Add to map",advancedTitle:"Advanced",datatypeLabel:"Data type",extentLabel:"Spatial extent",categoryLabel:"Category",datasourceLabel:"Data source",filterLabel:"Filter search by",removeSourceTooltip:"Switch back to original source",initComponent:function(){var a=this;this.addEvents("addlayer");
this.filters=[];var b=[],c;for(c in this.sources)b.push([c,this.sources[c].title]);if(1<=b.length)this.selectedSource=b[0][0];c=[["datatype","data type"],["extent","spatial extent"],["category","category"]];1<b.length&&c.push(["csw","data source"]);this.sources[this.selectedSource].store.on("loadexception",function(a,b,c,g){c.success()&&Ext.Msg.show({title:g.message,msg:gxp.util.getOGCExceptionText(g.arg.exceptionReport),icon:Ext.MessageBox.ERROR,buttons:Ext.MessageBox.OK})});this.items=[{xtype:"form",
border:!1,ref:"form",hideLabels:!0,autoHeight:!0,style:"margin-left: 5px; margin-right: 5px; margin-bottom: 5px; margin-top: 5px",items:[{xtype:"compositefield",items:[{xtype:"textfield",emptyText:this.searchFieldEmptyText,ref:"../../search",name:"search",listeners:{specialkey:function(a,b){b.getKey()==b.ENTER&&this.performQuery()},scope:this},width:250},{xtype:"button",text:this.searchButtonText,handler:this.performQuery,scope:this}]},{xtype:"fieldset",collapsible:!0,collapsed:!0,hideLabels:!1,hidden:!0,
title:this.advancedTitle,items:[{xtype:"gxp_cswfilterfield",name:"datatype",property:"apiso:Type",comboFieldLabel:this.datatypeLabel,comboStoreData:[["dataset","Dataset"],["datasetcollection","Dataset collection"],["application","Application"],["service","Service"]],target:this},{xtype:"gxp_cswfilterfield",name:"extent",property:"BoundingBox",map:this.map,comboFieldLabel:this.extentLabel,comboStoreData:[["map","spatial extent of the map"]],target:this},{xtype:"gxp_cswfilterfield",name:"category",
property:"apiso:TopicCategory",comboFieldLabel:this.categoryLabel,comboStoreData:[["farming","Farming"],["biota","Biota"],["boundaries","Boundaries"],["climatologyMeteorologyAtmosphere","Climatology/Meteorology/Atmosphere"],["economy","Economy"],["elevation","Elevation"],["environment","Environment"],["geoscientificinformation","Geoscientific Information"],["health","Health"],["imageryBaseMapsEarthCover","Imagery/Base Maps/Earth Cover"],["intelligenceMilitary","Intelligence/Military"],["inlandWaters",
"Inland Waters"],["location","Location"],["oceans","Oceans"],["planningCadastre","Planning Cadastre"],["society","Society"],["structure","Structure"],["transportation","Transportation"],["utilitiesCommunications","Utilities/Communications"]],target:this},{xtype:"compositefield",id:"csw",ref:"../../cswCompositeField",hidden:!0,items:[{xtype:"combo",ref:"../../../sourceCombo",fieldLabel:this.datasourceLabel,store:new Ext.data.ArrayStore({fields:["id","value"],data:b}),displayField:"value",valueField:"id",
mode:"local",listeners:{select:function(a){this.setSource(a.getValue())},render:function(){this.sourceCombo.setValue(this.selectedSource)},scope:this},triggerAction:"all"},{xtype:"button",iconCls:"gxp-icon-removelayers",tooltip:this.removeSourceTooltip,handler:function(){this.setSource(this.initialConfig.selectedSource);this.sourceCombo.setValue(this.initialConfig.selectedSource);this.cswCompositeField.hide()},scope:this}]},{xtype:"compositefield",items:[{xtype:"combo",fieldLabel:this.filterLabel,
store:new Ext.data.ArrayStore({fields:["id","value"],data:c}),displayField:"value",valueField:"id",mode:"local",triggerAction:"all"},{xtype:"button",iconCls:"gxp-icon-addlayers",tooltip:this.addTooltip,handler:function(a){a.ownerCt.items.each(function(a){if("combo"===a.getXType()){var b=a.getValue();a.clearValue();(a=this.form.getForm().findField(b))&&a.show()}},this)},scope:this}]}]},{xtype:"grid",width:"100%",anchor:"99%",viewConfig:{scrollOffset:0,forceFit:!0},border:!1,ref:"../grid",bbar:new Ext.PagingToolbar({listeners:{beforechange:function(b,
c){var f=a.sources[a.selectedSource].getPagingStart();c.startPosition&&(c.startPosition+=f)}},onLoad:function(b,c,f){var g=a.sources[a.selectedSource].getPagingStart();this.rendered?(b=this.getParams(),this.cursor=f.params&&f.params[b.start]?f.params[b.start]-g:0,f=this.getPageData(),g=f.activePage,b=f.pages,this.afterTextItem.setText(String.format(this.afterPageText,f.pages)),this.inputItem.setValue(g),this.first.setDisabled(1==g),this.prev.setDisabled(1==g),this.next.setDisabled(g==b),this.last.setDisabled(g==
b),this.refresh.enable(),this.updateInfo(),this.fireEvent("change",this,f)):this.dsLoaded=[b,c,f]},paramNames:this.sources[this.selectedSource].getPagingParamNames(),store:this.sources[this.selectedSource].store,pageSize:this.maxRecords}),loadMask:!0,hideHeaders:!0,store:this.sources[this.selectedSource].store,columns:[{id:"title",xtype:"templatecolumn",tpl:new Ext.XTemplate("<b>{title}</b><br/>{abstract}"),sortable:!0},{xtype:"actioncolumn",width:30,items:[{getClass:function(a,b,c){if(!1!==this.findWMS(c.get("URI"))||
!1!==this.findWMS(c.get("references")))return"gxp-icon-addlayers"},tooltip:this.addMapTooltip,handler:function(a,b){this.addLayer(this.grid.store.getAt(b))},scope:this}]}],autoExpandColumn:"title",autoHeight:!0}]}];gxp.CatalogueSearchPanel.superclass.initComponent.apply(this,arguments)},destroy:function(){this.map=this.sources=null;gxp.CatalogueSearchPanel.superclass.destroy.call(this)},setSource:function(a){this.selectedSource=a;a=this.sources[a].store;this.grid.reconfigure(a,this.grid.getColumnModel());
this.grid.getBottomToolbar().bindStore(a)},performQuery:function(){this.sources[this.selectedSource].filter({queryString:this.search.getValue(),limit:this.maxRecords,filters:this.filters})},addFilter:function(a){this.filters.push(a)},removeFilter:function(a){this.filters.remove(a)},findWMS:function(a){var b=["OGC:WMS-1.1.1-HTTP-GET-MAP","OGC:WMS"],c=null,d=null,e,f,g;for(e=0,f=a.length;e<f;++e)if(g=a[e],g.protocol&&-1!==b.indexOf(g.protocol.toUpperCase())&&g.value&&g.name){c=g.value;d=g.name;break}if(null===
c)for(e=0,f=a.length;e<f;++e)if(g=a[e],b=g.value?g.value:g,0<b.toLowerCase().indexOf("service=wms")){a=OpenLayers.Util.createUrlObject(b);c=a.protocol+"//"+a.host+":"+a.port+a.pathname;d=a.args.layers;break}return null!==c&&null!==d?{url:c,name:d}:!1},addLayer:function(a){var b=a.get("URI"),c=a.get("bounds"),d=c.left,e=c.right,f=c.bottom,g=c.top,c=Math.min(d,e),d=Math.max(d,e),e=Math.min(f,g),f=Math.max(f,g),b=this.findWMS(b);!1===b&&(b=this.findWMS(a.get("references")));!1!==b&&this.fireEvent("addlayer",
this,this.selectedSource,Ext.apply({title:a.get("title")[0],bbox:[c,e,d,f],srs:"EPSG:4326",projection:a.get("projection")},b))}});Ext.reg("gxp_cataloguesearchpanel",gxp.CatalogueSearchPanel);Ext.namespace("gxp.plugins");
gxp.plugins.Legend=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_legend",menuText:"Legend",tooltip:"Show Legend",actionTarget:null,constructor:function(a){gxp.plugins.Legend.superclass.constructor.apply(this,arguments);if(!this.outputConfig)this.outputConfig={width:300,height:400};Ext.applyIf(this.outputConfig,{title:this.menuText})},addActions:function(){return gxp.plugins.Legend.superclass.addActions.apply(this,[[{menuText:this.menuText,iconCls:"gxp-icon-legend",tooltip:this.tooltip,handler:function(){this.removeOutput();
this.addOutput(this.outputConfig)},scope:this}]])},getLegendPanel:function(){return this.output[0]},addOutput:function(a){return gxp.plugins.Legend.superclass.addOutput.call(this,Ext.apply({xtype:"gx_legendpanel",ascending:!1,border:!1,hideMode:"offsets",layerStore:this.target.mapPanel.layers,defaults:{cls:"gxp-legend-item"}},a))}});Ext.preg(gxp.plugins.Legend.prototype.ptype,gxp.plugins.Legend);Ext.namespace("gxp.plugins");
gxp.plugins.Print=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_print",printService:null,printCapabilities:null,customParams:null,includeLegend:!1,menuText:"Print Map",tooltip:"Print Map",buttonText:"Print",notAllNotPrintableText:"Not All Layers Can Be Printed",nonePrintableText:"None of your current map layers can be printed",previewText:"Print Preview",openInNewWindow:!1,constructor:function(a){gxp.plugins.Print.superclass.constructor.apply(this,arguments)},addActions:function(){if(null!==this.printService||
null!=this.printCapabilities){var a=new GeoExt.data.PrintProvider({capabilities:this.printCapabilities,url:this.printService,customParams:this.customParams,autoLoad:!1,listeners:{beforedownload:function(a,b){if(!0===this.openInNewWindow)return window.open(b),!1},beforeencodelegend:function(a,b,c){if(c&&"gxp_layermanager"===c.ptype){var d=[];(c=c.output)&&c[0]&&c[0].getRootNode().cascade(function(a){if(a.component&&!a.component.hidden){var a=a.component,c=this.encoders.legends[a.getXType()];d=d.concat(c.call(this,
a,b.pages[0].scale))}},a);b.legends=d;return!1}},beforeprint:function(){d.items.get(0).printMapPanel.layers.each(function(a){var a=a.get("layer").params,b;for(b in a)a[b]instanceof Array&&(a[b]=a[b].join(","))})},loadcapabilities:function(){if(c)c.initialConfig.disabled=!1,c.enable()},print:function(){try{d.close()}catch(a){}},printException:function(a,b){this.target.displayXHRTrouble&&this.target.displayXHRTrouble(b)},scope:this}}),b=gxp.plugins.Print.superclass.addActions.call(this,[{menuText:this.menuText,
buttonText:this.buttonText,tooltip:this.tooltip,iconCls:"gxp-icon-print",disabled:null!==this.printCapabilities?!1:!0,handler:function(){if(0<g().length){var a=j.call(this);k.call(this);return a}Ext.Msg.alert(this.notAllNotPrintableText,this.nonePrintableText)},scope:this,listeners:{render:function(){a.loadCapabilities()}}}]),c=b[0].items[0],d,e=function(){if(d){try{d.items.first().printMapPanel.printPage.destroy()}catch(a){}d=null}},f=this.target.mapPanel,g=function(){var a=[];f.layers.each(function(b){b=
b.getLayer();h(b)&&a.push(b)});return a},h=function(a){return!0===a.getVisibility()&&(a instanceof OpenLayers.Layer.WMS||a instanceof OpenLayers.Layer.OSM)},j=function(){var b=null;if(!0===this.includeLegend){var c,g;for(c in this.target.tools)if(g=this.target.tools[c],"gxp_legend"===g.ptype){b=g.getLegendPanel();break}if(null===b)for(c in this.target.tools)if(g=this.target.tools[c],"gxp_layermanager"===g.ptype){b=g;break}}return d=new Ext.Window({title:this.previewText,modal:!0,border:!1,autoHeight:!0,
resizable:!1,width:360,items:[new GeoExt.ux.PrintPreview({minWidth:336,mapTitle:this.target.about&&this.target.about.title,comment:this.target.about&&this.target.about["abstract"],printMapPanel:{autoWidth:!0,height:Math.min(420,Ext.get(document.body).getHeight()-150),limitScales:!0,map:Ext.applyIf({controls:[new OpenLayers.Control.Navigation({zoomWheelEnabled:!1,zoomBoxEnabled:!1}),new OpenLayers.Control.PanPanel,new OpenLayers.Control.ZoomPanel,new OpenLayers.Control.Attribution],eventListeners:{preaddlayer:function(a){return h(a.layer)}}},
f.initialConfig.map),items:[{xtype:"gx_zoomslider",vertical:!0,height:100,aggressive:!0}],listeners:{afterlayout:function(){d.setWidth(Math.max(360,this.getWidth()+24));d.center()}}},printProvider:a,includeLegend:this.includeLegend,legend:b,sourceMap:f})],listeners:{beforedestroy:e}})},k=function(){d.show();d.setWidth(0);var a=0;d.items.get(0).items.get(0).items.each(function(b){b.getEl()&&(a+=b.getWidth())});d.setWidth(Math.max(d.items.get(0).printMapPanel.getWidth(),a+20));d.center()};return b}}});
Ext.preg(gxp.plugins.Print.prototype.ptype,gxp.plugins.Print);Ext.namespace("gxp.plugins");
gxp.plugins.StyleWriter=Ext.extend(Ext.util.Observable,{deletedStyles:null,constructor:function(a){this.initialConfig=a;Ext.apply(this,a);this.deletedStyles=[];gxp.plugins.StyleWriter.superclass.constructor.apply(this,arguments)},init:function(a){this.target=a;a.stylesStore.on({remove:function(a,c){var d=c.get("name");c.get("name")===d&&this.deletedStyles.push(d)},scope:this});a.on({beforesaved:this.write,scope:this})},write:function(a){a.stylesStore.commitChanges();a.fireEvent("saved",a,a.selectedStyle.get("name"))}});
Ext.namespace("gxp.plugins");
gxp.plugins.GeoServerStyleWriter=Ext.extend(gxp.plugins.StyleWriter,{baseUrl:"/geoserver/rest",constructor:function(a){this.initialConfig=a;Ext.apply(this,a);gxp.plugins.GeoServerStyleWriter.superclass.constructor.apply(this,arguments)},write:function(a){delete this._failed;var a=a||{},b=[],c=this.target.stylesStore;c.each(function(a){(a.phantom||-1!==c.modified.indexOf(a))&&this.writeStyle(a,b)},this);var d=function(){var b=this.target;if(!0!==this._failed){this.deleteStyles();for(var c=this.target.stylesStore.getModifiedRecords(),
d=c.length-1;0<=d;--d)c[d].phantom=!1;b.stylesStore.commitChanges();a.success&&a.success.call(a.scope);b.fireEvent("saved",b,b.selectedStyle.get("name"))}else b.fireEvent("savefailed",b,b.selectedStyle.get("name"))};0<b.length?gxp.util.dispatch(b,function(){this.assignStyles(a.defaultStyle,d)},this):this.assignStyles(a.defaultStyle,d)},writeStyle:function(a,b){var c=a.get("userStyle").name,d=this.target.layerRecord.get("name");0<=d.indexOf(":")&&(d=d.split(":")[1]);b.push(function(b){Ext.Ajax.request({method:!0===
a.phantom?"POST":"PUT",url:this.baseUrl+"/styles"+(!0===a.phantom?"":"/"+c+".xml"),headers:{"Content-Type":"application/vnd.ogc.sld+xml"},xmlData:this.target.createSLD({userStyles:[c]}),failure:function(){this._failed=!0;b.call(this)},success:!0===a.phantom?function(){Ext.Ajax.request({method:"POST",url:this.baseUrl+"/layers/"+d+"/styles.json",jsonData:{style:{name:c}},failure:function(){this._failed=!0;b.call(this)},success:b,scope:this})}:b,scope:this})})},assignStyles:function(a,b){var c=[];this.target.stylesStore.each(function(b){!a&&
!0===b.get("userStyle").isDefault&&(a=b.get("name"));b.get("name")!==a&&-1===this.deletedStyles.indexOf(b.id)&&c.push({name:b.get("name")})},this);Ext.Ajax.request({method:"PUT",url:this.baseUrl+"/layers/"+this.target.layerRecord.get("name")+".json",jsonData:{layer:{defaultStyle:{name:a},styles:0<c.length?{style:c}:{},enabled:!0}},success:b,failure:function(){this._failed=!0;b.call(this)},scope:this})},deleteStyles:function(){for(var a=0,b=this.deletedStyles.length;a<b;++a)Ext.Ajax.request({method:"DELETE",
url:this.baseUrl+"/styles/"+this.deletedStyles[a]+"?purge=true"});this.deletedStyles=[]}});Ext.preg("gxp_geoserverstylewriter",gxp.plugins.GeoServerStyleWriter);Ext.namespace("gxp.plugins");
gxp.plugins.WMSRasterStylesDialog={isRaster:null,init:function(a){Ext.apply(a,gxp.plugins.WMSRasterStylesDialog)},createRule:function(){var a=[new OpenLayers.Symbolizer[this.isRaster?"Raster":this.symbolType]];return new OpenLayers.Rule({symbolizers:a})},addRule:function(){var a=this.getComponent("rulesfieldset").items.get(0);this.isRaster?(a.rules.push(this.createPseudoRule()),1==a.rules.length&&a.rules.push(this.createPseudoRule()),this.savePseudoRules()):(this.selectedStyle.get("userStyle").rules.push(this.createRule()),
a.update(),this.selectedStyle.store.afterEdit(this.selectedStyle));this.updateRuleRemoveButton()},removeRule:function(){if(this.isRaster){var a=this.getComponent("rulesfieldset").items.get(0),b=this.selectedRule;a.unselect();a.rules.remove(b);1==a.rules.length&&a.rules.remove(a.rules[0]);this.savePseudoRules()}else gxp.WMSStylesDialog.prototype.removeRule.apply(this,arguments)},duplicateRule:function(){var a=this.getComponent("rulesfieldset").items.get(0);if(this.isRaster)a.rules.push(this.createPseudoRule({quantity:this.selectedRule.name,
label:this.selectedRule.title,color:this.selectedRule.symbolizers[0].fillColor,opacity:this.selectedRule.symbolizers[0].fillOpacity})),this.savePseudoRules();else{var b=this.selectedRule.clone();b.name=gxp.util.uniqueName((b.title||b.name)+" (copy)");delete b.title;this.selectedStyle.get("userStyle").rules.push(b);a.update()}this.updateRuleRemoveButton()},editRule:function(){this.isRaster?this.editPseudoRule():gxp.WMSStylesDialog.prototype.editRule.apply(this,arguments)},editPseudoRule:function(){var a=
this.selectedRule,b=new Ext.Window({title:"Color Map Entry: "+a.name,width:340,autoHeight:!0,modal:!0,items:[{bodyStyle:"padding-top: 5px",border:!1,defaults:{autoHeight:!0,hideMode:"offsets"},items:[{xtype:"form",border:!1,labelAlign:"top",defaults:{border:!1},style:{padding:"0.3em 0 0 1em"},items:[{layout:"column",defaults:{border:!1,style:{"padding-right":"1em"}},items:[{layout:"form",width:70,items:[{xtype:"numberfield",anchor:"95%",value:a.name,allowBlank:!1,fieldLabel:"Quantity",validator:function(b){for(var c=
this.getComponent("rulesfieldset").items.get(0).rules,f=c.length-1;0<=f;f--)if(a!==c[f]&&c[f].name==b)return"Quantity "+b+" is already defined";return!0},listeners:{valid:function(a){this.selectedRule.name=""+a.getValue();this.savePseudoRules()},scope:this}}]},{layout:"form",width:130,items:[{xtype:"textfield",fieldLabel:"Label",anchor:"95%",value:a.title,listeners:{valid:function(a){this.selectedRule.title=a.getValue();this.savePseudoRules()},scope:this}}]},{layout:"form",width:70,items:[new GeoExt.FeatureRenderer({symbolType:this.symbolType,
symbolizers:[a.symbolizers[0]],isFormField:!0,fieldLabel:"Appearance"})]}]}]},{xtype:"gxp_polygonsymbolizer",symbolizer:a.symbolizers[0],bodyStyle:{padding:"10px"},border:!1,labelWidth:70,defaults:{labelWidth:70},listeners:{change:function(a){var c=b.findByType(GeoExt.FeatureRenderer)[0];c.setSymbolizers([a],{draw:c.rendered});this.selectedRule.symbolizers[0]=a;this.savePseudoRules()},scope:this}}]}]}),c=b.findByType("gxp_strokesymbolizer")[0];c.ownerCt.remove(c);b.show()},savePseudoRules:function(){var a=
this.selectedStyle,b=this.getComponent("rulesfieldset").items.get(0),a=a.get("userStyle"),b=b.rules;b.sort(function(a,b){var c=parseFloat(a.name),d=parseFloat(b.name);return c===d?0:c<d?-1:1});a=a.rules[0].symbolizers[0];a.colorMap=0<b.length?Array(b.length):void 0;for(var c,d=0,e=b.length;d<e;++d)c=b[d],a.colorMap[d]={quantity:parseFloat(c.name),label:c.title||void 0,color:c.symbolizers[0].fillColor||void 0,opacity:!1==c.symbolizers[0].fill?0:c.symbolizers[0].fillOpacity};this.afterRuleChange(this.selectedRule)},
createLegend:function(a,b){var c=OpenLayers.Symbolizer.Raster;c&&a[0]&&a[0].symbolizers[0]instanceof c?(this.getComponent("rulesfieldset").setTitle("Color Map Entries"),this.isRaster=!0,this.addRasterLegend(a,b)):(this.isRaster=!1,this.addVectorLegend(a))},addRasterLegend:function(a,b){for(var b=b||{},c=a[0].symbolizers[0].colorMap||[],d=[],e=0,f=c.length;e<f;e++)d.push(this.createPseudoRule(c[e]));this.selectedRule=null!=b.selectedRuleIndex?d[b.selectedRuleIndex]:null;return this.addVectorLegend(d,
{symbolType:"Polygon",enableDD:!1})},createPseudoRule:function(a){var b=-1;if(!a){var c=this.getComponent("rulesfieldset");if(c.items){rules=c.items.get(0).rules;for(c=rules.length-1;0<=c;c--)b=Math.max(b,parseFloat(rules[c].name))}}a=Ext.applyIf(a||{},{quantity:++b,color:"#000000",opacity:1});return new OpenLayers.Rule({title:a.label,name:""+a.quantity,symbolizers:[new OpenLayers.Symbolizer.Polygon({fillColor:a.color,fillOpacity:a.opacity,stroke:!1,fill:0!==a.opacity})]})},updateRuleRemoveButton:function(){this.getComponent("rulestoolbar").items.get(1).setDisabled(!this.selectedRule||
!1===this.isRaster&&1>=this.getComponent("rulesfieldset").items.get(0).rules.length)}};Ext.preg("gxp_wmsrasterstylesdialog",gxp.plugins.WMSRasterStylesDialog);Ext.namespace("gxp.plugins");
gxp.plugins.Styler=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_styler",menuText:"Edit Styles",tooltip:"Manage layer styles",roles:["ROLE_ADMINISTRATOR"],sameOriginStyling:!0,rasterStyling:!1,requireDescribeLayer:!0,constructor:function(a){gxp.plugins.Styler.superclass.constructor.apply(this,arguments);if(!this.outputConfig)this.outputConfig={autoHeight:!0,width:265};Ext.applyIf(this.outputConfig,{closeAction:"close"})},init:function(a){gxp.plugins.Styler.superclass.init.apply(this,arguments);this.target.on("authorizationchange",
this.enableOrDisable,this)},destroy:function(){this.target.un("authorizationchange",this.enableOrDisable,this);gxp.plugins.Styler.superclass.destroy.apply(this,arguments)},enableOrDisable:function(){this.target&&null!==this.target.selectedLayer&&this.handleLayerChange(this.target.selectedLayer)},addActions:function(){var a=gxp.plugins.Styler.superclass.addActions.apply(this,[{menuText:this.menuText,iconCls:"gxp-icon-palette",disabled:!0,tooltip:this.tooltip,handler:function(){this.target.doAuthorized(this.roles,
this.addOutput,this)},scope:this}]);this.launchAction=a[0];this.target.on({layerselectionchange:this.handleLayerChange,scope:this});return a},handleLayerChange:function(a){this.launchAction.disable();if(a){var b=this.target.getSource(a);b instanceof gxp.plugins.WMSSource&&b.describeLayer(a,function(b){this.checkIfStyleable(a,b)},this)}},checkIfStyleable:function(a,b){if(b){var c=["WFS"];!0===this.rasterStyling&&c.push("WCS")}if(b?-1!==c.indexOf(b.get("owsType")):!this.requireDescribeLayer){var c=
!1,c=this.target.layerSources[a.get("source")],d;d=(d=a.get("restUrl"))?d+"/styles":c.url.split("?").shift().replace(/\/(wms|ows)\/?$/,"/rest/styles");if(this.sameOriginStyling){if(c="/"===d.charAt(0),this.target.authenticate&&c){this.launchAction.enable();return}}else c=!0;c&&this.target.isAuthorized()&&this.enableActionIfAvailable(d+"?raw=true")}},enableActionIfAvailable:function(a){Ext.Ajax.request({method:"PUT",url:a,callback:function(a,c,d){this.launchAction.setDisabled(405!==d.status)},scope:this})},
addOutput:function(a){var a=a||{},b=this.target.selectedLayer;this.outputConfig.title=(this.initialConfig.outputConfig||{}).title||this.menuText+": "+b.get("title");this.outputConfig.shortTitle=b.get("title");Ext.apply(a,gxp.WMSStylesDialog.createGeoServerStylerConfig(b));!0===this.rasterStyling&&a.plugins.push({ptype:"gxp_wmsrasterstylesdialog"});Ext.applyIf(a,{style:"padding: 10px"});var c=gxp.plugins.Styler.superclass.addOutput.call(this,a);if(!(c.ownerCt.ownerCt instanceof Ext.Window))c.dialogCls=
Ext.Panel,c.showDlg=function(a){a.layout="fit";a.autoHeight=!1;c.ownerCt.add(a)};c.stylesStore.on("load",function(){!this.outputTarget&&c.ownerCt.ownerCt instanceof Ext.Window&&c.ownerCt.ownerCt.center()})}});Ext.preg(gxp.plugins.Styler.prototype.ptype,gxp.plugins.Styler);Ext.namespace("gxp.plugins");
gxp.plugins.GoogleSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_googlesource",timeout:7E3,title:"Google Layers",roadmapAbstract:"Show street map",satelliteAbstract:"Show satellite imagery",hybridAbstract:"Show imagery with street names",terrainAbstract:"Show street map with terrain",otherParams:"sensor=false",constructor:function(a){this.config=a;gxp.plugins.GoogleSource.superclass.constructor.apply(this,arguments)},createStore:function(){gxp.plugins.GoogleSource.loader.onLoad({otherParams:this.otherParams,
timeout:this.timeout,callback:this.syncCreateStore,errback:function(){delete this.store;this.fireEvent("failure",this,"The Google Maps script failed to load within the provided timeout ("+this.timeout/1E3+" s).")},scope:this})},syncCreateStore:function(){var a={ROADMAP:{"abstract":this.roadmapAbstract,MAX_ZOOM_LEVEL:20},SATELLITE:{"abstract":this.satelliteAbstract},HYBRID:{"abstract":this.hybridAbstract},TERRAIN:{"abstract":this.terrainAbstract,MAX_ZOOM_LEVEL:15}},b=[],c,d;for(c in a)d=google.maps.MapTypeId[c],
b.push(new OpenLayers.Layer.Google("Google "+d.replace(/\w/,function(a){return a.toUpperCase()}),{type:d,typeName:c,MAX_ZOOM_LEVEL:a[c].MAX_ZOOM_LEVEL,maxExtent:new OpenLayers.Bounds(-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7),restrictedExtent:new OpenLayers.Bounds(-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7),projection:this.projection}));this.store=new GeoExt.data.LayerStore({layers:b,fields:[{name:"source",type:"string"},{name:"name",type:"string",mapping:"typeName"},
{name:"abstract",type:"string"},{name:"group",type:"string",defaultValue:"background"},{name:"fixed",type:"boolean",defaultValue:!0},{name:"selected",type:"boolean"}]});this.store.each(function(b){b.set("abstract",a[b.get("name")]["abstract"])});this.fireEvent("ready",this)},createLayerRecord:function(a){var b,c=function(b){return b.get("name")===a.name};if(-1==this.target.mapPanel.layers.findBy(c)){b=this.store.getAt(this.store.findBy(c)).clone();c=b.getLayer();a.title&&(c.setName(a.title),b.set("title",
a.title));if("visibility"in a)c.visibility=a.visibility;b.set("selected",a.selected||!1);b.set("source",a.source);b.set("name",a.name);"group"in a&&b.set("group",a.group);b.commit()}return b}});
gxp.plugins.GoogleSource.loader=new (Ext.extend(Ext.util.Observable,{ready:!(!window.google||!google.maps),loading:!1,constructor:function(){this.addEvents("ready","failure");return Ext.util.Observable.prototype.constructor.apply(this,arguments)},onScriptLoad:function(){var a=gxp.plugins.GoogleSource.loader;if(!a.ready)a.ready=!0,a.loading=!1,a.fireEvent("ready")},onLoad:function(a){if(this.ready)window.setTimeout(function(){a.callback.call(a.scope)},0);else if(this.loading)this.on({ready:a.callback,
failure:a.errback||Ext.emptyFn,scope:a.scope});else this.loadScript(a)},loadScript:function(a){function b(){document.getElementsByTagName("head")[0].appendChild(d)}var c={autoload:Ext.encode({modules:[{name:"maps",version:3.3,nocss:"true",callback:"gxp.plugins.GoogleSource.loader.onScriptLoad",other_params:a.otherParams}]})},d=document.createElement("script");d.src="//www.google.com/jsapi?"+Ext.urlEncode(c);var e=a.errback||Ext.emptyFn,c=a.timeout||gxp.plugins.GoogleSource.prototype.timeout;window.setTimeout(function(){if(!gxp.plugins.GoogleSource.loader.ready)this.ready=
this.loading=!1,document.getElementsByTagName("head")[0].removeChild(d),e.call(a.scope),this.fireEvent("failure"),this.purgeListeners()}.createDelegate(this),c);this.on({ready:a.callback,scope:a.scope});this.loading=!0;if(document.body)b();else Ext.onReady(b)}}));Ext.preg(gxp.plugins.GoogleSource.prototype.ptype,gxp.plugins.GoogleSource);Ext.namespace("gxp.plugins");
gxp.plugins.GoogleEarth=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_googleearth",timeout:7E3,menuText:"3D Viewer",tooltip:"Switch to 3D Viewer",tooltipMap:"Switch back to normal map view",constructor:function(a){gxp.plugins.GoogleEarth.superclass.constructor.apply(this,arguments)},addActions:function(){return gxp.plugins.GoogleEarth.superclass.addActions.apply(this,[[{menuText:this.menuText,enableToggle:!0,iconCls:"gxp-icon-googleearth",tooltip:this.tooltip,toggleHandler:function(a,b){this.actions[0].each(function(a){a.toggle&&
a.toggle(!1,!0)});this.togglePanelDisplay(b)},scope:this}]])},togglePanelDisplay:function(a){var b=this.target.mapPanel.ownerCt,c=b&&b.getLayout();if(c&&c instanceof Ext.layout.CardLayout)if(!0===a)gxp.plugins.GoogleEarth.loader.onLoad({callback:function(){c.setActiveItem(1);this.actions[0].enable();this.actions[0].items[0].setTooltip(this.tooltipMap);this.actions[0].each(function(a){a.toggle&&a.toggle(!0,!0)})},scope:this});else c.setActiveItem(0),this.actions[0].items[0].setTooltip(this.tooltip)},
getHost:function(){return window.location.host.split(":").shift()+":"+(window.location.port||"80")}});
gxp.plugins.GoogleEarth.loader=new (Ext.extend(Ext.util.Observable,{ready:!(!window.google||!window.google.maps),loading:!1,constructor:function(){this.addEvents("ready","failure");return Ext.util.Observable.prototype.constructor.apply(this,arguments)},onScriptLoad:function(){var a=gxp.plugins.GoogleEarth.loader;if(!a.ready)a.ready=!0,a.loading=!1,a.fireEvent("ready")},onLoad:function(a){if(this.ready)window.setTimeout(function(){a.callback.call(a.scope)},0);else if(this.loading)this.on({ready:a.callback,
failure:a.errback||Ext.emptyFn,scope:a.scope});else this.loadScript(a)},loadScript:function(a){function b(){document.getElementsByTagName("head")[0].appendChild(d)}window.google&&delete google.loader;var c={autoload:Ext.encode({modules:[{name:"maps",version:3,other_params:"sensor=false",callback:"gxp.plugins.GoogleEarth.loader.onScriptLoad"}]})},d=document.createElement("script");d.src="//www.google.com/jsapi?"+Ext.urlEncode(c);c=a.timeout||gxp.plugins.GoogleSource.prototype.timeout;window.setTimeout(function(){gxp.plugins.GoogleEarth.loader.ready||
(this.fireEvent("failure"),this.unload())}.createDelegate(this),c);this.on({ready:a.callback,failure:a.errback||Ext.emptyFn,scope:a.scope});this.loading=!0;if(document.body)b();else Ext.onReady(b);this.script=d},unload:function(){this.purgeListeners();this.script&&(document.getElementsByTagName("head")[0].removeChild(this.script),delete this.script);this.ready=this.loading=!1;delete google.loader;delete google.maps}}));Ext.preg(gxp.plugins.GoogleEarth.prototype.ptype,gxp.plugins.GoogleEarth);Ext.namespace("gxp.plugins");
gxp.plugins.OLSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_olsource",createLayerRecord:function(a){var b,c=window;b=a.type.split(".");for(var d=0,e=b.length;d<e&&!(c=c[b[d]],!c);++d);if(c&&c.prototype&&c.prototype.initialize){b=function(){c.prototype.initialize.apply(this,a.args)};b.prototype=c.prototype;b=new b;if("visibility"in a)b.visibility=a.visibility;if("attribution"in a)b.attribution=a.attribution;b=new (GeoExt.data.LayerRecord.create([{name:"name",type:"string"},{name:"source",type:"string"},
{name:"group",type:"string"},{name:"fixed",type:"boolean"},{name:"selected",type:"boolean"},{name:"type",type:"string"},{name:"attribution",type:"string"},{name:"queryable",type:"boolean"},{name:"args"}]))({layer:b,title:b.name,name:a.name||b.name,source:a.source,group:a.group,fixed:"fixed"in a?a.fixed:!1,selected:"selected"in a?a.selected:!1,queryable:"queryable"in a?a.queryable:!1,type:a.type,args:a.args,attribution:"attribution"in a?a.attribution:void 0,properties:"properties"in a?a.properties:
void 0},b.id)}else throw Error("Cannot construct OpenLayers layer from given type: "+a.type);return b},getConfigForRecord:function(a){var b=gxp.plugins.OLSource.superclass.getConfigForRecord.apply(this,arguments);a.getLayer();return Ext.apply(b,{type:a.get("type"),args:a.get("args"),attribution:a.get("attribution")})}});Ext.preg(gxp.plugins.OLSource.prototype.ptype,gxp.plugins.OLSource);
(function(){function a(a){var c=this.meta.format;if("string"===typeof a||a.nodeType){var a=c.read(a),d=c.read;c.read=function(){c.read=d;return a}}this.raw=a}Ext.intercept(GeoExt.data.WMSCapabilitiesReader.prototype,"readRecords",a);GeoExt.data.AttributeReader&&Ext.intercept(GeoExt.data.AttributeReader.prototype,"readRecords",a)})();Ext.namespace("gxp.plugins");
gxp.plugins.WMSSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_wmssource",baseParams:null,format:null,describeLayerStore:null,describedLayers:null,schemaCache:null,ready:!1,requiredProperties:["title","bbox"],constructor:function(a){if(a&&!0===a.forceLazy)a.requiredProperties=[],delete a.forceLazy,window.console&&console.warn("Deprecated config option 'forceLazy: true' for layer source '"+a.id+"'. Use 'requiredProperties: []' instead.");gxp.plugins.WMSSource.superclass.constructor.apply(this,
arguments);if(!this.format)this.format=new OpenLayers.Format.WMSCapabilities({keepData:!0})},init:function(a){gxp.plugins.WMSSource.superclass.init.apply(this,arguments);this.target.on("authorizationchange",this.onAuthorizationChange,this)},onAuthorizationChange:function(){if(!0!==this.disabled&&this.store&&"/"===this.url.charAt(0)){var a=this.store.lastOptions||{params:{}};Ext.apply(a.params,{_dc:Math.random()});this.store.reload(a)}},destroy:function(){this.target.un("authorizationchange",this.onAuthorizationChange,
this);gxp.plugins.WMSSource.superclass.destroy.apply(this,arguments)},isLazy:function(){var a=!0,b=this.target.initialConfig.map;if(b&&b.layers)for(var c,d=0,e=b.layers.length;d<e&&!(c=b.layers[d],c.source===this.id&&(a=this.layerConfigComplete(c),!1===a));++d);return a},layerConfigComplete:function(a){var b=!0;if(!Ext.isObject(a.capability))for(var c=this.requiredProperties,d=c.length-1;0<=d&&!(b=!!a[c[d]],!1===b);--d);return b},createStore:function(){var a=this.baseParams||{SERVICE:"WMS",REQUEST:"GetCapabilities"};
if(this.version)a.VERSION=this.version;var b=this.isLazy();this.store=new GeoExt.data.WMSCapabilitiesStore({url:this.trimUrl(this.url,a),baseParams:a,format:this.format,autoLoad:!b,layerParams:{exceptions:null},listeners:{load:function(){if(!this.store.reader.raw||!this.store.reader.raw.service)this.fireEvent("failure",this,"Invalid capabilities document.");else{if(!this.title)this.title=this.store.reader.raw.service.title;this.ready?this.lazy=!1:(this.ready=!0,this.fireEvent("ready",this))}delete this.format.data},
exception:function(a,b,e,f,g,h){delete this.store;a="";"response"===b?"string"==typeof h?b=h:(b="Invalid response from server.",(a=this.format&&this.format.data)&&a.parseError&&(b+="  "+a.parseError.reason+" - line: "+a.parseError.line),g=g.status,a=200<=g&&300>g?gxp.util.getOGCExceptionText(h&&h.arg&&h.arg.exceptionReport):"Status: "+g):(b="Trouble creating layer store from response.",a="Unable to handle response.");this.fireEvent("failure",this,b,a);delete this.format.data},scope:this}});if(b)this.lazy=
b,this.ready=!0,this.fireEvent("ready",this)},trimUrl:function(a,b){var c=OpenLayers.Util.getParameters(a),b=OpenLayers.Util.upperCaseObject(b),d=0,e;for(e in c)++d,e.toUpperCase()in b&&(--d,delete c[e]);return a.split("?").shift()+(d?"?"+OpenLayers.Util.getParameterString(c):"")},createLazyLayerRecord:function(a){var a=Ext.apply({},a),b=a.srs||this.target.map.projection;a.srs={};a.srs[b]=!0;var c=a.bbox||this.target.map.maxExtent||OpenLayers.Projection.defaults[b].maxExtent;a.bbox={};a.bbox[b]={bbox:c};
c=this.store&&this.store instanceof GeoExt.data.WMSCapabilitiesStore?new this.store.recordType(a):new GeoExt.data.LayerRecord(a);c.setLayer(new OpenLayers.Layer.WMS(a.title||a.name,a.url||this.url,{layers:a.name,transparent:"transparent"in a?a.transparent:!0,cql_filter:a.cql_filter,format:a.format},{projection:b,eventListeners:{tileloaded:this.countAlive,tileerror:this.countAlive,scope:this}}));c.json=a;return c},countAlive:function(a){if(!("_alive"in a.object.metadata))a.object.metadata._alive=0,
a.object.events.register("loadend",this,this.removeDeadLayer);a.object.metadata._alive+="tileerror"==a.type?-1:1},removeDeadLayer:function(a){a.object.events.un({tileloaded:this.countAlive,tileerror:this.countAlive,loadend:this.removeDeadLayer,scope:this});0===a.object.metadata._alive&&(this.target.mapPanel.map.removeLayer(a.object),window.console&&console.debug("Unavailable layer "+a.object.name+" removed."));delete a.object.metadata._alive},createLayerRecord:function(a){var b,c,d=this.store.findExact("name",
a.name);-1<d?c=this.store.getAt(d):Ext.isObject(a.capability)?c=this.store.reader.readRecords({capability:{request:{getmap:{href:this.trimUrl(this.url,this.baseParams)}},layers:[a.capability]}}).records[0]:this.layerConfigComplete(a)&&(c=this.createLazyLayerRecord(a));if(c){b=c.getLayer().clone();var d=this.getMapProjection(),e=this.getProjection(c);e&&b.addOptions({projection:e});var e=(e||d).getCode(),f=c.get("bbox"),g;if(f&&f[e])g=OpenLayers.Bounds.fromArray(f[e].bbox,b.reverseAxisOrder());else if(e=
c.get("llbbox"))e[0]=Math.max(e[0],-180),e[1]=Math.max(e[1],-90),e[2]=Math.min(e[2],180),e[3]=Math.min(e[3],90),g=OpenLayers.Bounds.fromArray(e).transform("EPSG:4326",d);b.mergeNewParams(Ext.applyIf({STYLES:a.styles,FORMAT:a.format,TRANSPARENT:a.transparent,CQL_FILTER:a.cql_filter},a.params));d=!1;"tiled"in a?d=!a.tiled:c.data.dimensions&&c.data.dimensions.time&&(d=!0);b.setName(a.title||b.name);b.addOptions({attribution:b.attribution||a.attribution,maxExtent:g,restrictedExtent:g,singleTile:d,ratio:a.ratio||
1,visibility:"visibility"in a?a.visibility:!0,opacity:"opacity"in a?a.opacity:1,buffer:"buffer"in a?a.buffer:1,dimensions:c.data.dimensions,transitionEffect:d?"resize":null,minScale:a.minscale,maxScale:a.maxscale});g=Ext.applyIf({title:b.name,group:a.group,infoFormat:a.infoFormat,getFeatureInfo:a.getFeatureInfo,source:a.source,properties:"gxp_wmslayerpanel",fixed:a.fixed,selected:"selected"in a?a.selected:!1,restUrl:this.restUrl,layer:b},c.data);var h=[{name:"source",type:"string"},{name:"group",
type:"string"},{name:"properties",type:"string"},{name:"fixed",type:"boolean"},{name:"selected",type:"boolean"},{name:"restUrl",type:"string"},{name:"infoFormat",type:"string"},{name:"getFeatureInfo"}];c.fields.each(function(a){h.push(a)});b=new (GeoExt.data.LayerRecord.create(h))(g,b.id);b.json=a}else window.console&&0<this.store.getCount()&&void 0!==a.name&&console.warn("Could not create layer record for layer '"+a.name+"'. Check if the layer is found in the WMS GetCapabilities response.");return b},
getProjection:function(a){var b=this.getMapProjection(),c=b,a=a.get("srs");if(!a[b.getCode()]){var c=null,d,e;for(e in a)if((d=new OpenLayers.Projection(e)).equals(b)){c=d;break}}return c},initDescribeLayerStore:function(){var a=this.store.reader.raw;this.lazy&&(a={capability:{request:{describelayer:{href:this.url}}},version:this.version||"1.1.1"});var b=a.capability.request.describelayer;if(b)a=a.version,1.1<parseFloat(a)&&(a="1.1.1"),a={SERVICE:"WMS",VERSION:a,REQUEST:"DescribeLayer"},this.describeLayerStore=
new GeoExt.data.WMSDescribeLayerStore({url:this.trimUrl(b.href,a),baseParams:a})},describeLayer:function(a,b,c){function d(a){window.setTimeout(function(){b.call(c,a)},0)}this.describeLayerStore||this.initDescribeLayerStore();if(this.describeLayerStore){if(!this.describedLayers)this.describedLayers={};var e=a.getLayer().params.LAYERS,a=function(){for(var a=Ext.isArray(arguments[1])?arguments[1]:arguments[0],d,g,l=a.length-1;0<=l;l--){d=a[l];g=d.get("layerName");if(g==e){this.describeLayerStore.un("load",
arguments.callee,this);this.describedLayers[g]=!0;b.call(c,d);return}"function"==typeof this.describedLayers[g]&&(d=this.describedLayers[g],this.describeLayerStore.un("load",d,this),d.apply(this,arguments))}delete f[e];b.call(c,!1)},f=this.describedLayers,g;if(f[e])if(-1==(g=this.describeLayerStore.findExact("layerName",e)))this.describeLayerStore.on("load",a,this);else d(this.describeLayerStore.getAt(g));else f[e]=a,this.describeLayerStore.load({params:{LAYERS:e},add:!0,callback:a,scope:this})}else d(!1)},
fetchSchema:function(a,b,c,d){var e=this.schemaCache[b];if(e)if(0==e.getCount())e.on("load",function(){c.call(d,e)},this,{single:!0});else c.call(d,e);else e=new GeoExt.data.AttributeStore({url:a,baseParams:{SERVICE:"WFS",VERSION:"1.1.0",REQUEST:"DescribeFeatureType",TYPENAME:b},autoLoad:!0,listeners:{load:function(){c.call(d,e)},scope:this}}),this.schemaCache[b]=e},getSchema:function(a,b,c){if(!this.schemaCache)this.schemaCache={};this.describeLayer(a,function(d){if(d&&"WFS"==d.get("owsType")){var e=
d.get("typeName");this.fetchSchema(d.get("owsURL"),e,b,c)}else d?b.call(c,!1):this.fetchSchema(this.url,a.get("name"),b,c)},this)},getWFSProtocol:function(a,b,c){this.getSchema(a,function(d){var e=!1;if(d){var f,g=/gml:((Multi)?(Point|Line|Polygon|Curve|Surface|Geometry)).*/;d.each(function(a){g.exec(a.get("type"))&&(f=a.get("name"))},this);e=new OpenLayers.Protocol.WFS({version:"1.1.0",srsName:a.getLayer().projection.getCode(),url:d.url,featureType:d.reader.raw.featureTypes[0].typeName,featureNS:d.reader.raw.targetNamespace,
geometryName:f})}b.call(c,e,d,a)},this)},getConfigForRecord:function(a){var b=Ext.applyIf(gxp.plugins.WMSSource.superclass.getConfigForRecord.apply(this,arguments),a.json),c=a.getLayer(),d=c.params,e=c.options,f=b.name,g=this.store.reader.raw;if(g)for(var g=g.capability.layers,h=g.length-1;0<=h;--h)if(g[h].name===f){b.capability=Ext.apply({},g[h]);f={};f[c.projection.getCode()]=!0;b.capability.srs=f;break}if(!b.capability){if(c.maxExtent)b.bbox=c.maxExtent.toArray();b.srs=c.projection.getCode()}return Ext.apply(b,
{format:d.FORMAT,styles:d.STYLES,tiled:!e.singleTile,transparent:d.TRANSPARENT,cql_filter:d.CQL_FILTER,minscale:e.minScale,maxscale:e.maxScale,infoFormat:a.get("infoFormat"),attribution:c.attribution})},disable:function(){this.disabled=!0},getState:function(){var a=gxp.plugins.WMSSource.superclass.getState.apply(this,arguments);return Ext.applyIf(a,{title:this.title})}});Ext.preg(gxp.plugins.WMSSource.prototype.ptype,gxp.plugins.WMSSource);Ext.namespace("gxp.plugins");
gxp.plugins.CatalogueSource=Ext.extend(gxp.plugins.WMSSource,{url:null,yx:null,title:null,lazy:!0,hidden:!0,proxyOptions:null,describeLayer:function(a,b,c){a=new (Ext.data.Record.create([{name:"owsType",type:"string"},{name:"owsURL",type:"string"},{name:"typeName",type:"string"}]))({owsType:"WFS",owsURL:a.get("url"),typeName:a.get("name")});b.call(c,a)},destroy:function(){this.store&&this.store.destroy();this.store=null;gxp.plugins.CatalogueSource.superclass.destroy.apply(this,arguments)}});Ext.namespace("gxp.plugins");
gxp.plugins.CSWCatalogueSource=Ext.extend(gxp.plugins.CatalogueSource,{ptype:"gxp_cataloguesource",createStore:function(){this.store=new Ext.data.Store({proxy:new GeoExt.data.ProtocolProxy(Ext.apply({setParamsAsOptions:!0,protocol:new OpenLayers.Protocol.CSW({url:this.url})},this.proxyOptions||{})),reader:new GeoExt.data.CSWRecordsReader({fields:"title,abstract,URI,bounds,projection,references".split(",")})});gxp.plugins.LayerSource.prototype.createStore.apply(this,arguments)},getPagingStart:function(){return 1},
getPagingParamNames:function(){return{start:"startPosition",limit:"maxRecords"}},getFullFilter:function(a,b){var c=[];void 0!==a&&c.push(a);c=c.concat(b);return 1>=c.length?c[0]:new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:c})},filter:function(a){var b=void 0;""!==a.queryString&&(b=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE,matchCase:!1,property:"csw:AnyText",value:"*"+a.queryString+"*"}));var c={resultType:"results",maxRecords:a.limit,Query:{typeNames:"gmd:MD_Metadata",
ElementSetName:{value:"full"}}},a=this.getFullFilter(b,a.filters);void 0!==a&&Ext.apply(c.Query,{Constraint:{version:"1.1.0",Filter:a}});Ext.apply(this.store.baseParams,c);this.store.load()},createLayerRecord:function(a){a.queryable=!0;return gxp.plugins.CSWCatalogueSource.superclass.createLayerRecord.apply(this,arguments)}});Ext.preg(gxp.plugins.CSWCatalogueSource.prototype.ptype,gxp.plugins.CSWCatalogueSource);Ext.namespace("gxp.plugins");
gxp.plugins.LayerTree=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_layertree",shortTitle:"Layers",rootNodeText:"Layers",overlayNodeText:"Overlays",baseNodeText:"Base Layers",groups:null,defaultGroup:"default",treeNodeUI:null,constructor:function(a){gxp.plugins.LayerTree.superclass.constructor.apply(this,arguments);if(!this.groups)this.groups={"default":this.overlayNodeText,background:{title:this.baseNodeText,exclusive:!0}};if(!this.treeNodeUI)this.treeNodeUI=Ext.extend(GeoExt.tree.LayerNodeUI,new GeoExt.tree.TreeNodeUIEventMixin)},
addOutput:function(a){a=Ext.apply(this.createOutputConfig(),a||{});a=gxp.plugins.LayerTree.superclass.addOutput.call(this,a);a.on({contextmenu:this.handleTreeContextMenu,beforemovenode:this.handleBeforeMoveNode,scope:this});return a},createOutputConfig:function(){var a=new Ext.tree.TreeNode({text:this.rootNodeText,expanded:!0,isTarget:!1,allowDrop:!1}),b;if(this.initialConfig.loader&&this.initialConfig.loader.baseAttrs)b=this.initialConfig.loader.baseAttrs;var c=this.defaultGroup,d=this,e,f,g;for(g in this.groups)e=
"string"==typeof this.groups[g]?{title:this.groups[g]}:this.groups[g],f=e.exclusive,a.appendChild(new GeoExt.tree.LayerContainer(Ext.apply({text:e.title,iconCls:"gxp-folder",expanded:!0,group:g==this.defaultGroup?void 0:g,loader:new GeoExt.tree.LayerLoader({baseAttrs:f?Ext.apply({checkedGroup:Ext.isString(f)?f:g},b):b,store:this.target.mapPanel.layers,filter:function(a){return function(b){return(b.get("group")||c)==a&&!0==b.getLayer().displayInLayerSwitcher}}(g),createNode:function(a){d.configureLayerNode(this,
a);return GeoExt.tree.LayerLoader.prototype.createNode.apply(this,arguments)}}),singleClickExpand:!0,allowDrag:!1,listeners:{append:function(a,b){b.expand()}}},e)));return{xtype:"treepanel",root:a,rootVisible:!1,shortTitle:this.shortTitle,border:!1,enableDD:!0,selModel:new Ext.tree.DefaultSelectionModel({listeners:{beforeselect:this.handleBeforeSelect,scope:this}}),contextMenu:new Ext.menu.Menu({items:[]})}},configureLayerNode:function(a,b){b.uiProvider=this.treeNodeUI;var c=b.layer,d=b.layerStore;
if(c&&d){var e=d.getAt(d.findBy(function(a){return a.getLayer()===c}));if(e){b.qtip=e.get("abstract");if(!e.get("queryable")&&!b.iconCls)b.iconCls="gxp-tree-rasterlayer-icon";if(e.get("fixed"))b.allowDrag=!1;b.listeners={rendernode:function(a){e===this.target.selectedLayer&&a.select();this.target.on("layerselectionchange",function(b){!this.selectionChanging&&b===e&&a.select()},this)},scope:this}}}},handleBeforeSelect:function(a,b){var c=!0,d=b&&b.layer,e;if(d)c=b.layerStore,e=c.getAt(c.findBy(function(a){return a.getLayer()===
d}));this.selectionChanging=!0;c=this.target.selectLayer(e);this.selectionChanging=!1;return c},handleTreeContextMenu:function(a,b){if(a&&a.layer){a.select();var c=a.getOwnerTree();if(c.getSelectionModel().getSelectedNode()===a)c=c.contextMenu,c.contextNode=a,0<c.items.getCount()&&c.showAt(b.getXY())}},handleBeforeMoveNode:function(a,b,c,d){if(c!==d)a=d.loader.store,c=a.findBy(function(a){return a.getLayer()===b.layer}),a.getAt(c).set("group",d.attributes.group)}});
Ext.preg(gxp.plugins.LayerTree.prototype.ptype,gxp.plugins.LayerTree);Ext.namespace("gxp.plugins");
gxp.plugins.GeoNodeCatalogueSource=Ext.extend(gxp.plugins.CatalogueSource,{ptype:"gxp_geonodecataloguesource",rootProperty:"results",baseParams:null,fields:[{name:"title",convert:function(a){return[a]}},{name:"abstract",mapping:"description"},{name:"bounds",mapping:"bbox",convert:function(a){return{left:a.minx,right:a.maxx,bottom:a.miny,top:a.maxy}}},{name:"URI",mapping:"links",convert:function(a){var b=[],c;for(c in a)b.push({value:a[c].url});return b}}],createStore:function(){this.store=new Ext.data.Store({proxy:new Ext.data.HttpProxy(Ext.apply({url:this.url,
method:"GET"},this.proxyOptions||{})),baseParams:Ext.apply({type:"layer"},this.baseParams),reader:new Ext.data.JsonReader({root:this.rootProperty},this.fields)});gxp.plugins.LayerSource.prototype.createStore.apply(this,arguments)},getPagingStart:function(){return 0},getPagingParamNames:function(){return{start:"startIndex",limit:"limit"}},filter:function(a){var b=void 0;if(void 0!==a.filters)for(var c=0,d=a.filters.length;c<d;++c){var e=a.filters[c];if(e instanceof OpenLayers.Filter.Spatial){b=e.value.toBBOX();
break}}Ext.apply(this.store.baseParams,{q:a.queryString});void 0!==a.limit&&Ext.apply(this.store.baseParams,{limit:a.limit});void 0!==b?Ext.apply(this.store.baseParams,{bbox:b}):delete this.store.baseParams.bbox;this.store.load()},createLayerRecord:function(a){a.restUrl=this.restUrl;a.queryable=!0;return gxp.plugins.GeoNodeCatalogueSource.superclass.createLayerRecord.apply(this,arguments)}});Ext.preg(gxp.plugins.GeoNodeCatalogueSource.prototype.ptype,gxp.plugins.GeoNodeCatalogueSource);
Ext.ns("gxp.data","gxp.plugins");
gxp.data.TMSCapabilitiesReader=Ext.extend(Ext.data.DataReader,{constructor:function(a,b){a=a||{};if(!a.format)a.format=new OpenLayers.Format.TMSCapabilities;"function"!==typeof b&&(b=GeoExt.data.LayerRecord.create(b||a.fields||[{name:"name",type:"string"},{name:"title",type:"string"},{name:"tileMapUrl",type:"string"}]));gxp.data.TMSCapabilitiesReader.superclass.constructor.call(this,a,b)},read:function(a){var b=a.responseXML;if(!b||!b.documentElement)b=a.responseText;return this.readRecords(b)},readRecords:function(a){var b=
[],c,d,e;if("string"===typeof a||a.nodeType)if(this.raw=a=this.meta.format.read(a),a.tileMaps)for(c=0,d=a.tileMaps.length;c<d;++c){var f=a.tileMaps[c];e=new OpenLayers.Projection(f.srs);if(this.meta.mapProjection.equals(e)){e=f.href;var g=e.substring(e.indexOf(this.meta.version+"/")+6);b.push(new this.recordType({layer:new OpenLayers.Layer.TMS(f.title,-1!==this.meta.baseUrl.indexOf(this.meta.version)?this.meta.baseUrl.replace(this.meta.version+"/",""):this.meta.baseUrl,{layername:g}),title:f.title,
name:f.title,tileMapUrl:e}))}}else if(a.tileSets&&(e=new OpenLayers.Projection(a.srs),this.meta.mapProjection.equals(e))){f=[];for(c=0,d=a.tileSets.length;c<d;++c)f.push(a.tileSets[c].unitsPerPixel);e=this.meta.baseUrl;c=e.substring(e.indexOf(this.meta.version)+this.meta.version.length+1,e.lastIndexOf("/"));b.push(new this.recordType({layer:new OpenLayers.Layer.TMS(a.title,a.tileMapService.replace("/"+this.meta.version,""),{serverResolutions:f,type:a.tileFormat.extension,layername:c}),title:a.title,
name:a.title,tileMapUrl:this.meta.baseUrl}))}return{totalRecords:b.length,success:!0,records:b}}});
gxp.plugins.TMSSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_tmssource",version:"1.0.0",constructor:function(a){gxp.plugins.TMSSource.superclass.constructor.apply(this,arguments);this.format=new OpenLayers.Format.TMSCapabilities;"/"!==this.url.slice(-1)&&(this.url+="/")},createStore:function(){this.store=new Ext.data.Store({autoLoad:!0,listeners:{load:function(){this.title=this.store.reader.raw.title;this.fireEvent("ready",this)},exception:function(){this.fireEvent("failure",this,"Trouble creating TMS layer store from response.",
"Unable to handle response.")},scope:this},proxy:new Ext.data.HttpProxy({url:-1===this.url.indexOf(this.version)?this.url+this.version:this.url,disableCaching:!1,method:"GET"}),reader:new gxp.data.TMSCapabilitiesReader({baseUrl:this.url,version:this.version,mapProjection:this.getMapProjection()})})},createLayerRecord:function(a,b,c){var d=this.store.findExact("name",a.name);if(-1<d){var d=this.store.getAt(d),e=d.getLayer();if(null!==e.serverResolutions)return d;Ext.Ajax.request({url:d.get("tileMapUrl"),
success:function(d){for(var g=[],d=this.format.read(d.responseText),h=0,j=d.tileSets.length;h<j;++h)g.push(d.tileSets[h].unitsPerPixel);e.addOptions({serverResolutions:g,type:d.tileFormat.extension});this.target.createLayerRecord({source:this.id,name:a.name},b,c)},scope:this})}}});Ext.preg(gxp.plugins.TMSSource.prototype.ptype,gxp.plugins.TMSSource);Ext.namespace("gxp.plugins");
gxp.plugins.ArcRestSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_arcrestsource",requiredProperties:["name"],constructor:function(a){this.config=a;gxp.plugins.ArcRestSource.superclass.constructor.apply(this,arguments)},createStore:function(){var a=this.url.split("?")[0],b=this,c=function(c){var f=Ext.decode(c.responseText),g=b.getArcProjection(f.spatialReference.wkid),h=[];if(null!=g)for(c=0;c<f.layers.length;c++){var j=f.layers[c];h.push(new OpenLayers.Layer.ArcGIS93Rest(j.name,a+"/export",
{layers:"show:"+j.id,TRANSPARENT:!0},{isBaseLayer:!1,ratio:1,displayInLayerSwitcher:!0,visibility:!0,projection:g,queryable:f.capabilities&&f.capabilities.Identify}))}else d(c);b.title=f.documentInfo.Title;b.store=new GeoExt.data.LayerStore({layers:h,fields:[{name:"source",type:"string"},{name:"name",type:"string",mapping:"name"},{name:"layerid",type:"string"},{name:"group",type:"string",defaultValue:this.title},{name:"fixed",type:"boolean",defaultValue:!0},{name:"tiled",type:"boolean",defaultValue:!0},
{name:"queryable",type:"boolean",defaultValue:!0},{name:"selected",type:"boolean"}]});b.fireEvent("ready",b)},d=function(){Ext.Msg.alert("No ArcGIS Layers","Could not find any compatible layers  at "+b.config.url);b.fireEvent("failure",b)};(this.lazy=this.isLazy())?this.fireEvent("ready"):Ext.Ajax.request({url:a,params:{f:"json",pretty:"false",keepPostParams:"true"},method:"POST",success:c,failure:d})},isLazy:function(){var a=!0,b=!1,c=this.target.initialConfig.map;if(c&&c.layers)for(var d,e=0,f=
c.layers.length;e<f&&!(d=c.layers[e],d.source===this.id&&(b=!0,a=this.layerConfigComplete(d),!1===a));++e);return a&&b},layerConfigComplete:function(a){for(var b=!0,c=this.requiredProperties,d=c.length-1;0<=d&&!(b=!!a[c[d]],!1===b);--d);return b},createLayerRecord:function(a){var b,c;c=function(b){return b.get("name")===a.name};var d=this.lazy||this.store&&-1<this.store.findBy(c);if(-1==this.target.mapPanel.layers.findBy(c)&&d){b=!this.lazy&&-1<this.store.findBy(c)?this.store.getAt(this.store.findBy(c)).clone():
this.createLazyLayerRecord(a);c=b.getLayer();a.title&&(c.setName(a.title),b.set("title",a.title));if("visibility"in a)c.visibility=a.visibility;if("opacity"in a)c.opacity=a.opacity;if("format"in a)c.params.FORMAT=a.format,b.set("format",a.format);c=!1;"tiled"in a&&(c=!a.tiled);b.set("tiled",!c);b.set("selected",a.selected||!1);b.set("queryable",a.queryable||!0);b.set("source",a.source);b.set("name",a.name);b.set("layerid",a.layerid);b.set("properties","gxp_wmslayerpanel");"group"in a&&b.set("group",
a.group);b.commit()}return b},getArcProjection:function(a){var b=this.getMapProjection(),c=b,a="EPSG:"+a+"";if(a!==b.getCode()&&(c=null,(p=new OpenLayers.Projection(a)).equals(b)))c=p;return c},createLazyLayerRecord:function(a){var b=a.srs||this.target.map.projection;a.srs={};a.srs[b]=!0;var c=a.bbox||this.target.map.maxExtent||OpenLayers.Projection.defaults[b].maxExtent;a.bbox={};a.bbox[b]={bbox:c};c=new GeoExt.data.LayerRecord(a);c.set("name",a.name);c.set("layerid",a.layerid||"show:0");c.set("format",
a.format||"png");c.set("tiled","tiled"in a?a.tiled:!0);c.setLayer(new OpenLayers.Layer.ArcGIS93Rest(a.name,this.url.split("?")[0]+"/export",{layers:a.layerid,TRANSPARENT:!0,FORMAT:"format"in a?a.format:"png"},{isBaseLayer:!1,displayInLayerSwitcher:!0,projection:b,singleTile:"tiled"in a?!a.tiled:!1,queryable:"queryable"in a?a.queryable:!1}));return c},getConfigForRecord:function(a){var b=a.getLayer();return{source:a.get("source"),name:a.get("name"),title:a.get("title"),tiled:a.get("tiled"),visibility:b.getVisibility(),
layerid:b.params.LAYERS,format:b.params.FORMAT,opacity:b.opacity||void 0,group:a.get("group"),fixed:a.get("fixed"),selected:a.get("selected")}}});Ext.preg(gxp.plugins.ArcRestSource.prototype.ptype,gxp.plugins.ArcRestSource);Ext.namespace("gxp.plugins");
gxp.plugins.FeatureManager=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_featuremanager",maxFeatures:100,paging:!0,pagingType:null,autoZoomPage:!1,autoSetLayer:!0,autoLoadFeatures:!1,layerRecord:null,featureStore:null,hitCountProtocol:null,featureLayer:null,schema:null,geometryType:null,toolsShowingLayer:null,selectStyle:null,style:null,pages:null,page:null,numberOfFeatures:null,numPages:null,pageIndex:null,constructor:function(a){this.addEvents("beforequery","query","beforelayerchange","layerchange","beforesetpage",
"setpage","beforeclearfeatures","clearfeatures","beforesave","exception");if(a&&!a.pagingType)this.pagingType=gxp.plugins.FeatureManager.QUADTREE_PAGING;if(a&&a.layer)this.autoSetLayer=!1;gxp.plugins.FeatureManager.superclass.constructor.apply(this,arguments)},init:function(a){gxp.plugins.FeatureManager.superclass.init.apply(this,arguments);this.toolsShowingLayer={};this.style={all:new OpenLayers.Style(null,{rules:[new OpenLayers.Rule({symbolizer:this.initialConfig.symbolizer||{Point:{pointRadius:4,
graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},Line:{strokeWidth:4,strokeOpacity:1,strokeColor:"#ff9933"},Polygon:{strokeWidth:2,strokeOpacity:1,strokeColor:"#ff6633",fillColor:"white",fillOpacity:0.3}}})]}),selected:new OpenLayers.Style(null,{rules:[new OpenLayers.Rule({symbolizer:{display:"none"}})]})};this.featureLayer=new OpenLayers.Layer.Vector(this.id,{displayInLayerSwitcher:!1,visibility:!1,styleMap:new OpenLayers.StyleMap({select:Ext.applyIf(Ext.apply({display:""},
this.selectStyle),OpenLayers.Feature.Vector.style.select),vertex:this.style.all},{extendDefault:!1})});this.target.on({ready:function(){this.target.mapPanel.map.addLayer(this.featureLayer)},scope:this});this.on({beforedestroy:function(){this.target.mapPanel.map.removeLayer(this.featureLayer)},scope:this})},activate:function(){if(gxp.plugins.FeatureManager.superclass.activate.apply(this,arguments)){if(this.autoSetLayer)this.target.on("beforelayerselectionchange",this.setLayer,this);this.layer&&this.target.createLayerRecord(Ext.apply({},
this.layer),this.setLayer,this);this.on("layerchange",this.setSchema,this);return!0}},deactivate:function(){if(gxp.plugins.FeatureManager.superclass.deactivate.apply(this,arguments))return this.autoSetLayer&&this.target.un("beforelayerselectionchange",this.setLayer,this),this.un("layerchange",this.setSchema,this),this.setLayer(),!0},getPageExtent:function(){return this.pagingType===gxp.plugins.FeatureManager.QUADTREE_PAGING?this.page.extent:this.featureStore.layer.getDataExtent()},setLayer:function(a){var b=
this.fireEvent("beforelayerchange",this,a);if(!1!==b){if(a){var c=a.getLayer().projection;this.featureLayer.projection=null!==c?c:this.target.mapPanel.map.getProjectionObject()}if(a!==this.layerRecord)this.clearFeatureStore(),(this.layerRecord=a)?!0===this.autoLoadFeatures?this.loadFeatures():this.setFeatureStore():this.fireEvent("layerchange",this,null)}return b},setSchema:function(a,b,c){this.schema=c},showLayer:function(a,b){this.toolsShowingLayer[a]=b||"all";this.setLayerDisplay()},hideLayer:function(a){delete this.toolsShowingLayer[a];
this.setLayerDisplay()},setLayerDisplay:function(){var a=this.visible(),b=this.target.mapPanel.map;a?(a=this.style[a],a!==this.featureLayer.styleMap.styles["default"]&&(this.featureLayer.styleMap.styles["default"]=a,this.featureLayer.redraw()),this.featureLayer.setVisibility(!0),b.events.on({addlayer:this.raiseLayer,scope:this})):this.featureLayer.map&&(this.featureLayer.setVisibility(!1),b.events.un({addlayer:this.raiseLayer,scope:this}))},visible:function(){var a=!1,b;for(b in this.toolsShowingLayer)"all"!=
a&&(a=this.toolsShowingLayer[b]);return a},raiseLayer:function(){var a=this.featureLayer&&this.featureLayer.map;a&&a.setLayerIndex(this.featureLayer,a.layers.length)},loadFeatures:function(a,b,c){if(!1!==this.fireEvent("beforequery",this,a,b,c)){this.filter=a;this.pages=null;if(b){var d=this;d._activeQuery&&d.un("query",d._activeQuery);this.on("query",d._activeQuery=function(a,f){delete d._activeQuery;this.un("query",arguments.callee,this);f.getCount();0==f.getCount()?b.call(c,[]):this.featureLayer.events.register("featuresadded",
this,function(a){this.featureLayer.events.unregister("featuresadded",this,arguments.callee);b.call(c,a.features)})},this,{single:!0})}this.featureStore?(this.featureStore.setOgcFilter(a),this.paging?this.setPage():this.featureStore.load()):(this.paging&&this.on("layerchange",function(a,b,c){c&&(this.un("layerchange",arguments.callee,this),this.setPage())},this),this.setFeatureStore(a,!this.paging))}},clearFeatures:function(){var a=this.featureStore;if(a&&!1!==this.fireEvent("beforeclearfeatures",
this))a.removeAll(),this.fireEvent("clearfeatures",this),a=a.proxy,a.abortRequest(),a.protocol.response&&a.protocol.response.abort()},getProjection:function(a){var b=this.target.mapPanel.map.getProjectionObject();(a=a.getLayer().projection)&&a.equals(b)&&(b=a);return b},setFeatureStore:function(a,b){var c=this.layerRecord,d=this.target.getSource(c);d&&d instanceof gxp.plugins.WMSSource?d.getSchema(c,function(d){if(!1===d)this.clearFeatureStore();else{var f=[],g,h=/gml:((Multi)?(Point|Line|Polygon|Curve|Surface|Geometry)).*/,
j={"xsd:boolean":"boolean","xsd:int":"int","xsd:integer":"int","xsd:short":"int","xsd:long":"int","xsd:date":"date","xsd:string":"string","xsd:float":"float","xsd:double":"float"};d.each(function(a){var b=h.exec(a.get("type"));if(b)g=a.get("name"),this.geometryType=b[1];else{b=j[a.get("type")];a={name:a.get("name"),type:j[b]};if("date"==b)a.dateFormat="Y-m-d\\Z";f.push(a)}},this);var k={srsName:this.getProjection(c).getCode(),url:d.url,featureType:d.reader.raw.featureTypes[0].typeName,featureNS:d.reader.raw.targetNamespace,
geometryName:g};this.hitCountProtocol=new OpenLayers.Protocol.WFS(Ext.apply({version:"1.1.0",readOptions:{output:"object"},resultType:"hits",filter:a},k));this.featureStore=new gxp.data.WFSFeatureStore(Ext.apply({fields:f,proxy:{protocol:{outputFormat:this.format,multi:this.multi}},maxFeatures:this.maxFeatures,layer:this.featureLayer,ogcFilter:a,autoLoad:b,autoSave:!1,listeners:{beforewrite:function(a,b,c,d){this.fireEvent("beforesave",this,a,d.params)},write:function(){this.redrawMatchingLayers(c)},
load:function(a){this.fireEvent("query",this,a,this.filter)},scope:this}},k))}this.fireEvent("layerchange",this,c,d)},this):(this.clearFeatureStore(),this.fireEvent("layerchange",this,c,!1))},redrawMatchingLayers:function(a){var b=a.get("name"),c=a.get("source");this.target.mapPanel.layers.each(function(a){a.get("source")===c&&a.get("name")===b&&a.getLayer().redraw(!0)})},clearFeatureStore:function(){if(this.featureStore)this.featureStore.removeAll(),this.featureStore.unbind(),this.featureStore.destroy(),
this.geometryType=this.featureStore=this.numberOfFeatures=null},processPage:function(a,b,c,d){var b=b||{},e=b.lonLat?null:b.index,f=b.next,g=this.pages,h=this.pages.indexOf(a);this.setPageFilter(a);var j=f?h==(g.indexOf(f)||g.length)-1:!0,k=b.lonLat?a.extent.containsLonLat(b.lonLat):!0;k&&a.numFeatures&&a.numFeatures<=this.maxFeatures?c.call(this,a):k&&(h==e||j)&&this.hitCountProtocol.read({callback:function(h){var j=e,k=b.lonLat;f&&(j=(g.indexOf(f)||g.length)-1);!j&&k&&a.extent.containsLonLat(k)&&
(j=g.indexOf(a));a.numFeatures=h.numberOfFeatures;this.page||(a.numFeatures>this.maxFeatures?this.createLeaf(a,Ext.applyIf({index:j,next:f},b),c,d):0==a.numFeatures&&1<g.length?(g.remove(a),!1===b.allowEmpty&&this.setPage({index:e%this.pages.length,allowEmpty:!1})):this.pages.indexOf(a)==j&&c.call(this,a))},scope:this})},createLeaf:function(a,b,c,d){b=b||{};this.layerRecord.getLayer();var e=this.pages.indexOf(a);this.pages.remove(a);for(var f=a.extent,g=f.getCenterLonLat(),a=[f.left,g.lon,f.left,
g.lon],h=[g.lat,g.lat,f.bottom,f.bottom],j=[g.lon,f.right,g.lon,f.right],f=[f.top,f.top,g.lat,g.lat],k,g=3;0<=g;--g)k={extent:new OpenLayers.Bounds(a[g],h[g],j[g],f[g])},this.pages.splice(e,0,k),this.processPage(k,b,c,d)},getPagingExtent:function(a){var b=this.layerRecord.getLayer(),c=this.getSpatialFilter();if((a=c?c.value:this.target.mapPanel.map[a]())&&b.maxExtent&&a.containsBounds(b.maxExtent))a=b.maxExtent;return a},getSpatialFilter:function(){var a;if(this.filter instanceof OpenLayers.Filter.Spatial&&
this.filter.type===OpenLayers.Filter.Spatial.BBOX)a=this.filter;else if(this.filter instanceof OpenLayers.Filter.Logical&&this.filter.type===OpenLayers.Filter.Logical.AND)for(var b,c=this.filter.filters.length-1;0<=c;--c)if(b=this.filter.filters[c],b instanceof OpenLayers.Filter.Spatial&&b.type===OpenLayers.Filter.Spatial.BBOX){a=b;break}return a},setPageFilter:function(a){a.extent?(a=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:this.featureStore.geometryName,value:a.extent}),
a=this.filter?new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.filter,a]}):a):a=this.filter;this.featureStore.setOgcFilter(a);this.hitCountProtocol.filter=a;return this.hitCountProtocol.options.filter=a},nextPage:function(a,b){var c;this.pagingType===gxp.plugins.FeatureManager.QUADTREE_PAGING?(c=this.page,this.page=null,c=(this.pages.indexOf(c)+1)%this.pages.length):c=this.pageIndex+1%this.numPages;this.setPage({index:c,allowEmpty:!1},a,b)},previousPage:function(a){var b;
this.pagingType===gxp.plugins.FeatureManager.QUADTREE_PAGING?(b=this.pages.indexOf(this.page)-1,0>b&&(b=this.pages.length-1)):(b=this.pageIndex-1,0>b&&(b=this.numPages-1));this.setPage({index:b,allowEmpty:!1,next:this.page},a)},setPage:function(a,b,c){if(this.pagingType===gxp.plugins.FeatureManager.QUADTREE_PAGING)if(this.filter instanceof OpenLayers.Filter.FeatureId)this.featureStore.load({callback:function(){b&&b.call(c)}});else{if(!1!==this.fireEvent("beforesetpage",this,a,b,c)){if(!a){var d=this.getPagingExtent("getExtent"),
d=new OpenLayers.LonLat(d.left,d.top),e=this.target.mapPanel.map.getMaxExtent();e.containsLonLat(d,!0)||(d=new OpenLayers.LonLat(e.left,e.top));a={lonLat:d,allowEmpty:!1}}a.index=a.index||0;if("last"==a.index)a.index=this.pages.length-1,a.next=this.pages[0];this.page=null;if(this.pages){if(a.lonLat)for(d=this.pages.length-1;0<=d;--d)if(this.pages[d].extent.containsLonLat(a.lonLat)){a.index=d;break}}else this.layerRecord.getLayer(),this.pages=[{extent:this.getPagingExtent("getMaxExtent")}],a.index=
0;this.processPage(this.pages[a.index],a,function(d){var e=this.target.mapPanel.map;this.page=d;this.setPageFilter(d);this.autoZoomPage&&!e.getExtent().containsLonLat(d.extent.getCenterLonLat())&&e.zoomToExtent(d.extent);e=this.pages.indexOf(this.page);this.fireEvent("setpage",this,a,b,c,e,this.pages.length);this.featureStore.load({callback:function(){b&&b.call(c,d)}})},this)}}else if(!1!==this.fireEvent("beforesetpage",this,a,b,c))if(a){if(null!=a.index)this.pageIndex="last"===a.index?this.numPages-
1:"first"===a.index?0:a.index,d=this.pageIndex*this.maxFeatures,this.fireEvent("setpage",this,a,b,c,this.pageIndex,this.numPages),this.featureStore.load({startIndex:d,callback:function(){b&&b.call(c)}})}else this.hitCountProtocol.read({filter:this.filter,callback:function(d){this.numberOfFeatures=d.numberOfFeatures;this.numPages=Math.ceil(this.numberOfFeatures/this.maxFeatures);this.pageIndex=0;this.fireEvent("setpage",this,a,b,c,this.pageIndex,this.numPages);this.featureStore.load({output:"object",
callback:function(){b&&b.call(c)}})},scope:this})}});gxp.plugins.FeatureManager.QUADTREE_PAGING=0;gxp.plugins.FeatureManager.WFS_PAGING=1;Ext.preg(gxp.plugins.FeatureManager.prototype.ptype,gxp.plugins.FeatureManager);Ext.namespace("gxp.plugins");
gxp.plugins.ClickableFeatures=Ext.extend(gxp.plugins.Tool,{featureManager:null,autoLoadFeature:!1,autoLoadedFeature:null,toleranceParameters:["BUFFER","RADIUS"],constructor:function(a){if(a&&"autoLoadFeatures"in a)a.autoLoadFeature=a.autoLoadFeatures,delete a.autoLoadFeatures,window.console&&console.warn("Deprecated config option 'autoLoadFeatures' for ptype: '"+a.ptype+"'. Use 'autoLoadFeature' instead.");gxp.plugins.ClickableFeatures.superclass.constructor.apply(this,[a])},noFeatureClick:function(a){if(!this.selectControl)this.selectControl=
new OpenLayers.Control.SelectFeature(this.target.tools[this.featureManager].featureLayer,this.initialConfig.controlOptions);var b=this.target.mapPanel.map.getLonLatFromPixel(a.xy),c=this.target.tools[this.featureManager],d=c.page;if(!("all"==c.visible()&&c.paging&&d&&d.extent.containsLonLat(b))&&(b=c.layerRecord&&c.layerRecord.getLayer())){var e=this.target.mapPanel.map,d=e.getSize(),d=Ext.applyIf({REQUEST:"GetFeatureInfo",BBOX:e.getExtent().toBBOX(),WIDTH:d.w,HEIGHT:d.h,X:parseInt(a.xy.x),Y:parseInt(a.xy.y),
QUERY_LAYERS:b.params.LAYERS,INFO_FORMAT:"application/vnd.ogc.gml",EXCEPTIONS:"application/vnd.ogc.se_xml",FEATURE_COUNT:1},b.params);if("number"===typeof this.tolerance)for(var f=0,g=this.toleranceParameters.length;f<g;++f)d[this.toleranceParameters[f]]=this.tolerance;e=e.getProjectionObject();(f=b.projection)&&f.equals(e)&&(e=f);1.3<=parseFloat(b.params.VERSION)?d.CRS=e.getCode():d.SRS=e.getCode();new GeoExt.data.FeatureStore({fields:{},proxy:new GeoExt.data.ProtocolProxy({protocol:new OpenLayers.Protocol.HTTP({url:"string"===
typeof b.url?b.url:b.url[0],params:d,format:new OpenLayers.Format.WMSGetFeatureInfo})}),autoLoad:!0,listeners:{load:function(b,d){if(0<d.length){var e=d[0].get("fid"),f=new OpenLayers.Filter.FeatureId({fids:[e]}),g=function(){c.loadFeatures(f,function(a){if(a.length)this.autoLoadedFeature=a[0],this.select(a[0])},this)}.createDelegate(this),m=c.featureLayer.getFeatureByFid(e);m?this.select(m):c.paging&&c.pagingType===gxp.plugins.FeatureManager.QUADTREE_PAGING?(m=this.target.mapPanel.map.getLonLatFromPixel(a.xy),
c.setPage({lonLat:m},function(){var a=c.featureLayer.getFeatureByFid(e);a?this.select(a):!0===this.autoLoadFeature&&g()},this)):g()}},scope:this}})}},select:function(a){this.selectControl.unselectAll();this.selectControl.select(a)}});Ext.namespace("gxp.plugins");
gxp.plugins.FeatureEditor=Ext.extend(gxp.plugins.ClickableFeatures,{ptype:"gxp_featureeditor",commitMessage:!1,splitButton:null,iconClsAdd:"gxp-icon-addfeature",closeOnSave:!1,supportAbstractGeometry:!1,supportNoGeometry:!1,iconClsEdit:"gxp-icon-editfeature",exceptionTitle:"Save Failed",exceptionText:"Trouble saving features",pointText:"Point",lineText:"Line",polygonText:"Polygon",noGeometryText:"Event",commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:",createFeatureActionTip:"Create a new feature",
createFeatureActionText:"Create",editFeatureActionTip:"Edit existing feature",editFeatureActionText:"Modify",splitButtonText:"Edit",splitButtonTooltip:"Edit features on selected WMS layer",outputTarget:"map",snappingAgent:null,readOnly:!1,modifyOnly:!1,createOnly:!1,showSelectedOnly:!0,roles:["ROLE_ADMINISTRATOR"],createAction:null,editAction:null,activeIndex:0,drawControl:null,popup:null,schema:null,constructor:function(a){this.addEvents("layereditable","featureeditable");gxp.plugins.FeatureEditor.superclass.constructor.apply(this,
arguments)},init:function(a){gxp.plugins.FeatureEditor.superclass.init.apply(this,arguments);this.target.on("authorizationchange",this.onAuthorizationChange,this)},destroy:function(){this.target.un("authorizationchange",this.onAuthorizationChange,this);gxp.plugins.FeatureEditor.superclass.destroy.apply(this,arguments)},onAuthorizationChange:function(){this.target.isAuthorized(this.roles)||(this.selectControl.deactivate(),this.drawControl.deactivate());this.enableOrDisable()},addActions:function(){function a(a,
d){var f=Array.prototype.slice.call(arguments);f.splice(0,2);if(!e&&b&&!b.isDestroyed){if(b.editing){var g=function(){e=!0;h.call(this);"setLayer"===d?this.target.selectLayer(f[0]):"clearFeatures"===d?window.setTimeout(function(){a[d].call(a)}):a[d].apply(a,f)},h=function(){c.featureStore.un("write",g,this);b.un("canceledit",g,this);b.un("cancelclose",h,this)};c.featureStore.on("write",g,this);b.on({canceledit:g,cancelclose:h,scope:this});b.close()}return!b.editing}e=!1}var b,c=this.getFeatureManager(),
d=c.featureLayer,e=!1;c.on({beforequery:a.createDelegate(this,"loadFeatures",1),beforelayerchange:a.createDelegate(this,"setLayer",1),beforesetpage:a.createDelegate(this,"setPage",1),beforeclearfeatures:a.createDelegate(this,"clearFeatures",1),scope:this});this.drawControl=new OpenLayers.Control.DrawFeature(d,OpenLayers.Handler.Point,{eventListeners:{featureadded:function(a){if(!0===this.autoLoadFeature)this.autoLoadedFeature=a.feature},activate:function(){this.target.doAuthorized(this.roles,function(){c.showLayer(this.id,
this.showSelectedOnly&&"selected")},this)},deactivate:function(){c.hideLayer(this.id)},scope:this}});this.selectControl=new OpenLayers.Control.SelectFeature(d,{clickout:!1,multipleKey:"fakeKey",eventListeners:{activate:function(){this.target.doAuthorized(this.roles,function(){(!0===this.autoLoadFeature||c.paging)&&this.target.mapPanel.map.events.register("click",this,this.noFeatureClick);c.showLayer(this.id,this.showSelectedOnly&&"selected");this.selectControl.unselectAll(b&&b.editing&&{except:b.feature})},
this)},deactivate:function(){(!0===this.autoLoadFeature||c.paging)&&this.target.mapPanel.map.events.unregister("click",this,this.noFeatureClick);if(b){if(b.editing)b.on("cancelclose",function(){this.selectControl.activate()},this,{single:!0});b.on("close",function(){c.hideLayer(this.id)},this,{single:!0});b.close()}else c.hideLayer(this.id)},scope:this}});d.events.on({beforefeatureremoved:function(a){this.popup&&a.feature===this.popup.feature&&this.selectControl.unselect(a.feature)},featureunselected:function(a){(a=
a.feature)&&this.fireEvent("featureeditable",this,a,!1);a&&a.geometry&&b&&!b.hidden&&b.close()},beforefeatureselected:function(){if(b)return!b.editing},featureselected:function(a){var d=a.feature;d&&this.fireEvent("featureeditable",this,d,!0);var e=c.featureStore;if(!0===this._forcePopupForNoGeometry||this.selectControl.active&&null!==d.geometry)!1===this.readOnly&&(this.selectControl.deactivate(),c.showLayer(this.id,this.showSelectedOnly&&"selected")),b=this.addOutput({xtype:"gxp_featureeditpopup",
collapsible:!0,feature:e.getByFeature(d),vertexRenderIntent:"vertex",readOnly:this.readOnly,fields:this.fields,excludeFields:this.excludeFields,editing:d.state===OpenLayers.State.INSERT,schema:this.schema,allowDelete:!0,width:200,height:250}),b.on({close:function(){!1===this.readOnly&&this.selectControl.activate();d.layer&&-1!==d.layer.selectedFeatures.indexOf(d)&&this.selectControl.unselect(d);if(d===this.autoLoadedFeature)d.layer&&d.layer.removeFeatures([a.feature]),this.autoLoadedFeature=null},
featuremodified:function(a,b){e.on({beforewrite:{fn:function(a,b,c,d){if(!0===this.commitMessage)d.params.handle=this._commitMsg,delete this._commitMsg},single:!0},beforesave:{fn:function(){a&&a.isVisible()&&a.disable();if(!0===this.commitMessage&&!this._commitMsg){var b=arguments.callee;Ext.Msg.show({prompt:!0,title:this.commitTitle,msg:this.commitText,buttons:Ext.Msg.OK,fn:function(a,c){if("ok"===a)this._commitMsg=c,e.un("beforesave",b,this),e.save()},scope:this,multiline:!0});return!1}},single:!0!==
this.commitMessage},write:{fn:function(){a&&(a.isVisible()&&a.enable(),this.closeOnSave&&a.close());var b=c.layerRecord;this.target.fireEvent("featureedit",c,{name:b.get("name"),source:b.get("source")})},single:!0},exception:{fn:function(b,d,f,g,h,j){b=this.exceptionText;"remote"===d?h.exceptionReport&&(b=gxp.util.getOGCExceptionText(h.exceptionReport)):b="Status: "+h.status;c.fireEvent("exception",c,h.exceptionReport||{},b,j);!1===c.hasListener("exception")&&!1===e.hasListener("exception")&&Ext.Msg.show({title:this.exceptionTitle,
msg:b,icon:Ext.MessageBox.ERROR,buttons:{ok:!0}});a&&a.isVisible()&&(a.enable(),a.startEditing())},single:!0},scope:this});if(b.state===OpenLayers.State.DELETE)e._removing=!0,e.remove(e.getRecordFromFeature(b)),delete e._removing;e.save()},canceledit:function(){e.commitChanges()},scope:this}),this.popup=b},sketchcomplete:function(){c.featureLayer.events.register("featuresadded",this,function(a){c.featureLayer.events.unregister("featuresadded",this,arguments.callee);this.drawControl.deactivate();this.selectControl.activate();
this.selectControl.select(a.features[0])})},scope:this});var f=this.toggleGroup||Ext.id(),g=[],h={tooltip:this.createFeatureActionTip,menuText:this.initialConfig.createFeatureActionText,text:this.initialConfig.createFeatureActionText,iconCls:this.iconClsAdd,disabled:!0,hidden:this.modifyOnly||this.readOnly,toggleGroup:f,group:f,groupClass:null,enableToggle:!0,allowDepress:!0,control:this.drawControl,deactivateOnDisable:!0,map:this.target.mapPanel.map,listeners:{checkchange:this.onItemCheckchange,
scope:this}};if(!0===this.supportAbstractGeometry){var j=[];!0===this.supportNoGeometry&&j.push(new Ext.menu.CheckItem({text:this.noGeometryText,iconCls:"gxp-icon-event",groupClass:null,group:f,listeners:{checkchange:function(a,b){if(!0===b){var c=new OpenLayers.Feature.Vector(null);c.state=OpenLayers.State.INSERT;d.addFeatures([c]);this._forcePopupForNoGeometry=!0;d.events.triggerEvent("featureselected",{feature:c});delete this._forcePopupForNoGeometry}this.createAction.items[0]instanceof Ext.menu.CheckItem?
this.createAction.items[0].setChecked(!1):this.createAction.items[0].toggle(!1)},scope:this}}));var k=function(a,b,c){!0===b&&this.setHandler(c,!1);this.createAction.items[0]instanceof Ext.menu.CheckItem?this.createAction.items[0].setChecked(b):this.createAction.items[0].toggle(b)};j.push(new Ext.menu.CheckItem({groupClass:null,text:this.pointText,group:f,iconCls:"gxp-icon-point",listeners:{checkchange:k.createDelegate(this,[OpenLayers.Handler.Point],2)}}),new Ext.menu.CheckItem({groupClass:null,
text:this.lineText,group:f,iconCls:"gxp-icon-line",listeners:{checkchange:k.createDelegate(this,[OpenLayers.Handler.Path],2)}}),new Ext.menu.CheckItem({groupClass:null,text:this.polygonText,group:f,iconCls:"gxp-icon-polygon",listeners:{checkchange:k.createDelegate(this,[OpenLayers.Handler.Polygon],2)}}));g.push(new GeoExt.Action(Ext.apply(h,{menu:new Ext.menu.Menu({items:j})})))}else g.push(new GeoExt.Action(h));g.push(new GeoExt.Action({tooltip:this.editFeatureActionTip,text:this.initialConfig.editFeatureActionText,
menuText:this.initialConfig.editFeatureActionText,iconCls:this.iconClsEdit,disabled:!0,toggleGroup:f,group:f,groupClass:null,hidden:this.createOnly,enableToggle:!0,allowDepress:!0,control:this.selectControl,deactivateOnDisable:!0,map:this.target.mapPanel.map,listeners:{checkchange:this.onItemCheckchange,scope:this}}));this.createAction=g[0];this.editAction=g[1];if(this.splitButton)this.splitButton=new Ext.SplitButton({menu:{items:[Ext.apply(new Ext.menu.CheckItem(g[0]),{text:this.createFeatureActionText}),
Ext.apply(new Ext.menu.CheckItem(g[1]),{text:this.editFeatureActionText})]},disabled:!0,buttonText:this.splitButtonText,tooltip:this.splitButtonTooltip,iconCls:this.iconClsAdd,enableToggle:!0,toggleGroup:this.toggleGroup,allowDepress:!0,handler:function(a){a.pressed&&a.menu.items.itemAt(this.activeIndex).setChecked(!0)},scope:this,listeners:{toggle:function(a,b){b||a.menu.items.each(function(a){a.setChecked(!1)})},render:function(a){Ext.ButtonToggleMgr.register(a)}}}),g=[this.splitButton];g=gxp.plugins.FeatureEditor.superclass.addActions.call(this,
g);c.on("layerchange",this.onLayerChange,this);(f=this.getSnappingAgent())&&f.registerEditor(this);return g},onItemCheckchange:function(a,b){if(this.splitButton)this.activeIndex=a.ownerCt.items.indexOf(a),this.splitButton.toggle(b),b&&this.splitButton.setIconClass(a.iconCls)},getFeatureManager:function(){var a=this.target.tools[this.featureManager];if(!a)throw Error("Unable to access feature manager by id: "+this.featureManager);return a},getSnappingAgent:function(){var a,b=this.snappingAgent;if(b&&
(a=this.target.tools[b],!a))throw Error("Unable to locate snapping agent with id: "+b);return a},setHandler:function(a,b){var c=this.drawControl,d=c.active;d&&c.deactivate();c.handler.destroy();c.handler=new a(c,c.callbacks,Ext.apply(c.handlerOptions,{multi:b}));d&&c.activate()},enableOrDisable:function(){var a=!this.schema;this.splitButton&&this.splitButton.setDisabled(a);this.createAction.setDisabled(a);this.editAction.setDisabled(a);return a},onLayerChange:function(a,b,c){this.schema=c;if(this.enableOrDisable())this.fireEvent("layereditable",
this,b,!1);else{var c=this.createAction,d={Point:OpenLayers.Handler.Point,Line:OpenLayers.Handler.Path,Curve:OpenLayers.Handler.Path,Polygon:OpenLayers.Handler.Polygon,Surface:OpenLayers.Handler.Polygon},e=a.geometryType&&a.geometryType.replace("Multi","");(d=e&&d[e])?(this.setHandler(d,e!=a.geometryType),c.enable()):!0===this.supportAbstractGeometry&&a.geometryType&&"Geometry"===a.geometryType?c.enable():c.disable();this.fireEvent("layereditable",this,b,!0)}},select:function(a){this.selectControl.unselectAll(this.popup&&
this.popup.editing&&{except:this.popup.feature});this.selectControl.select(a)}});Ext.preg(gxp.plugins.FeatureEditor.prototype.ptype,gxp.plugins.FeatureEditor);Ext.namespace("gxp.plugins");
gxp.plugins.FeatureGrid=Ext.extend(gxp.plugins.ClickableFeatures,{ptype:"gxp_featuregrid",schema:null,showTotalResults:!1,alwaysDisplayOnMap:!1,displayMode:"all",autoExpand:!1,autoCollapse:!1,selectOnMap:!1,displayFeatureText:"Display on map",firstPageTip:"First page",previousPageTip:"Previous page",zoomPageExtentTip:"Zoom to page extent",nextPageTip:"Next page",lastPageTip:"Last page",totalMsg:"Features {1} to {2} of {0}",displayTotalResults:function(){var a=this.target.tools[this.featureManager];
!0===this.showTotalResults&&this.displayItem.setText(null!==a.numberOfFeatures?String.format(this.totalMsg,a.numberOfFeatures,a.pageIndex*a.maxFeatures+Math.min(a.numberOfFeatures,1),Math.min((a.pageIndex+1)*a.maxFeatures,a.numberOfFeatures)):"")},addOutput:function(a){function b(){var a=c.schema,b=["feature","state","fid"];a&&a.each(function(a){0==a.get("type").indexOf("gml:")&&b.push(a.get("name"))});f.ignoreFields=b;f.setStore(c.featureStore,a);c.featureStore||(c.paging&&(f.lastPageButton.disable(),
f.nextPageButton.disable(),f.firstPageButton.disable(),f.prevPageButton.disable(),f.zoomToPageButton.disable()),this.displayTotalResults())}var c=this.target.tools[this.featureManager],d=this.target.mapPanel.map,e;this.selectControl=new OpenLayers.Control.SelectFeature(c.featureLayer,this.initialConfig.controlOptions);if(this.selectOnMap){if(this.autoLoadFeature||c.paging&&c.pagingType===gxp.plugins.FeatureManager.QUADTREE_PAGING)this.selectControl.events.on({activate:function(){d.events.register("click",
this,this.noFeatureClick)},deactivate:function(){d.events.unregister("click",this,this.noFeatureClick)},scope:this});d.addControl(this.selectControl);e={selectControl:this.selectControl}}else e={selectControl:this.selectControl,singleSelect:!1,autoActivateControl:!1,listeners:{beforerowselect:function(){if(window.event&&"contextmenu"==window.event.type||this.selectControl.active||c.featureStore.getModifiedRecords().length)return!1},scope:this}};this.displayItem=new Ext.Toolbar.TextItem({});var a=
Ext.apply({xtype:"gxp_featuregrid",border:!1,sm:new GeoExt.grid.FeatureSelectionModel(e),autoScroll:!0,columnMenuDisabled:!!c.paging,bbar:(c.paging?[{iconCls:"x-tbar-page-first",ref:"../firstPageButton",tooltip:this.firstPageTip,disabled:!0,handler:function(){c.setPage({index:0})}},{iconCls:"x-tbar-page-prev",ref:"../prevPageButton",tooltip:this.previousPageTip,disabled:!0,handler:function(){c.previousPage()}},{iconCls:"gxp-icon-zoom-to",ref:"../zoomToPageButton",tooltip:this.zoomPageExtentTip,disabled:!0,
hidden:c.pagingType!==gxp.plugins.FeatureManager.QUADTREE_PAGING||c.autoZoomPage,handler:function(){var a=c.getPageExtent();null!==a&&d.zoomToExtent(a)}},{iconCls:"x-tbar-page-next",ref:"../nextPageButton",tooltip:this.nextPageTip,disabled:!0,handler:function(){c.nextPage()}},{iconCls:"x-tbar-page-last",ref:"../lastPageButton",tooltip:this.lastPageTip,disabled:!0,handler:function(){c.setPage({index:"last"})}},{xtype:"tbspacer",width:10},this.displayItem]:[]).concat(["->"].concat(!this.alwaysDisplayOnMap?
[{text:this.displayFeatureText,enableToggle:!0,toggleHandler:function(a,b){this.selectOnMap&&this.selectControl[b?"activate":"deactivate"]();c[b?"showLayer":"hideLayer"](this.id,this.displayMode)},scope:this}]:[])),contextMenu:new Ext.menu.Menu({items:[]})},a||{}),f=gxp.plugins.FeatureGrid.superclass.addOutput.call(this,a);f.on({added:function(a,b){function d(){this.displayTotalResults();this.selectOnMap&&this.selectControl.deactivate();this.autoCollapse&&"function"==typeof b.collapse&&b.collapse()}
c.on({query:function(a,c){c&&c.getCount()?(this.displayTotalResults(),this.selectOnMap&&this.selectControl.activate(),this.autoExpand&&"function"==typeof b.expand&&b.expand()):d.call(this)},layerchange:d,clearfeatures:d,scope:this})},contextmenu:function(a){if(0<f.contextMenu.items.getCount()){var b=f.getView().findRowIndex(a.getTarget());!1!==b&&(f.getSelectionModel().selectRow(b),f.contextMenu.showAt(a.getXY()),a.stopEvent())}},scope:this});(this.alwaysDisplayOnMap||!0===this.selectOnMap&&"selected"===
this.displayMode)&&c.showLayer(this.id,this.displayMode);c.paging&&c.on({beforesetpage:function(){f.zoomToPageButton.disable()},setpage:function(a,b,c,d,e,n){a=0<n;f.zoomToPageButton.setDisabled(!a);b=a&&0!==e;f.firstPageButton.setDisabled(!b);f.prevPageButton.setDisabled(!b);e=a&&e!==n-1;f.lastPageButton.setDisabled(!e);f.nextPageButton.setDisabled(!e)},scope:this});c.featureStore&&b.call(this);c.on("layerchange",b,this);return f}});Ext.preg(gxp.plugins.FeatureGrid.prototype.ptype,gxp.plugins.FeatureGrid);
Ext.namespace("gxp.plugins");
gxp.plugins.BingSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_bingsource",title:"Bing Layers",roadTitle:"Bing Roads",aerialTitle:"Bing Aerial",labeledAerialTitle:"Bing Aerial With Labels",apiKey:null,createStore:function(){if(!this.apiKey)throw this.fireEvent("failure",this,"No apiKey configured for the Bing source."),Error("You need to provide an apiKey for the Bing source to work.");var a=[new OpenLayers.Layer.Bing({key:this.apiKey,name:this.roadTitle,type:"Road",buffer:1,transitionEffect:"resize"}),
new OpenLayers.Layer.Bing({key:this.apiKey,name:this.aerialTitle,type:"Aerial",buffer:1,transitionEffect:"resize"}),new OpenLayers.Layer.Bing({key:this.apiKey,name:this.labeledAerialTitle,type:"AerialWithLabels",buffer:1,transitionEffect:"resize"})];this.store=new GeoExt.data.LayerStore({layers:a,fields:[{name:"source",type:"string"},{name:"name",type:"string",mapping:"type"},{name:"abstract",type:"string",mapping:"attribution"},{name:"group",type:"string",defaultValue:"background"},{name:"fixed",
type:"boolean",defaultValue:!0},{name:"selected",type:"boolean"}]});this.store.each(function(a){a.set("group","background")});this.fireEvent("ready",this)},createLayerRecord:function(a){var b,c=this.store.findExact("name",a.name);if(-1<c){b=this.store.getAt(c).copy(Ext.data.Record.id({}));c=b.getLayer().clone();a.title&&(c.setName(a.title),b.set("title",a.title));if("visibility"in a)c.visibility=a.visibility;b.set("selected",a.selected||!1);b.set("source",a.source);b.set("name",a.name);"group"in a&&
b.set("group",a.group);b.data.layer=c;b.commit()}return b}});Ext.preg(gxp.plugins.BingSource.prototype.ptype,gxp.plugins.BingSource);Ext.namespace("gxp.plugins");
gxp.plugins.OSMSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_osmsource",title:"OpenStreetMap Layers",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Data CC-By-SA by <a href='http://openstreetmap.org/' target='_blank'>OpenStreetMap</a>",createStore:function(){var a={projection:"EPSG:900913",maxExtent:new OpenLayers.Bounds(-2.00375083392E7,-2.00375083392E7,2.00375083392E7,2.00375083392E7),maxResolution:156543.03390625,
numZoomLevels:19,units:"m",buffer:1,transitionEffect:"resize"},a=[new OpenLayers.Layer.OSM("OpenStreetMap",["//a.tile.openstreetmap.org/${z}/${x}/${y}.png","//b.tile.openstreetmap.org/${z}/${x}/${y}.png","//c.tile.openstreetmap.org/${z}/${x}/${y}.png"],OpenLayers.Util.applyDefaults({attribution:this.mapnikAttribution,type:"mapnik"},a))];this.store=new GeoExt.data.LayerStore({layers:a,fields:[{name:"source",type:"string"},{name:"name",type:"string",mapping:"type"},{name:"abstract",type:"string",mapping:"attribution"},
{name:"group",type:"string",defaultValue:"background"},{name:"fixed",type:"boolean",defaultValue:!0},{name:"selected",type:"boolean"}]});this.store.each(function(a){a.set("group","background")});this.fireEvent("ready",this)},createLayerRecord:function(a){var b,c=this.store.findExact("name",a.name);if(-1<c){b=this.store.getAt(c).copy(Ext.data.Record.id({}));c=b.getLayer().clone();a.title&&(c.setName(a.title),b.set("title",a.title));if("visibility"in a)c.visibility=a.visibility;b.set("selected",a.selected||
!1);b.set("source",a.source);b.set("name",a.name);"group"in a&&b.set("group",a.group);b.data.layer=c;b.commit()}return b}});Ext.preg(gxp.plugins.OSMSource.prototype.ptype,gxp.plugins.OSMSource);Ext.namespace("gxp.plugins");
gxp.plugins.XYZLayerSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_xyzlayersource",title:"Tiled Layer",tileStreamLayerName:"Tiled Layer",tileStreamLayerURL:"http://tileStreamLayerURL/${z}/${x}/${y}.png",tileStreamLayerMaxZoom:19,tileStreamLayerAttribution:"&copy;",createStore:function(){var a={sphericalMercator:!0,wrapDateLine:!0,projection:"EPSG:900913",maxExtent:new OpenLayers.Bounds(-2.00375083392E7,-2.00375083392E7,2.00375083392E7,2.00375083392E7),maxResolution:156543.03390625,numZoomLevels:19,
units:"m",buffer:1,transitionEffect:"resize"},a=[new OpenLayers.Layer.XYZ(this.tileStreamLayerName,[this.tileStreamLayerURL],OpenLayers.Util.applyDefaults({attribution:this.tileStreamLayerAttribution,layername:this.tileStreamLayerName,numZoomLevels:this.tileStreamLayerMaxZoom},a))];this.store=new GeoExt.data.LayerStore({layers:a,fields:[{name:"source",type:"string"},{name:"name",type:"string",mapping:"type"},{name:"abstract",type:"string",mapping:"attribution"},{name:"group",type:"string",defaultValue:"background"},
{name:"fixed",type:"boolean",defaultValue:!0},{name:"selected",type:"boolean"}]});this.store.each(function(a){a.set("group","background")});this.fireEvent("ready",this)},createLayerRecord:function(a){var b=this.store.getAt(0).copy(Ext.data.Record.id({})),c=b.getLayer().clone();a.title&&(c.setName(a.title),b.set("title",a.title));if("visibility"in a)c.visibility=a.visibility;if("tileStreamLayerName"in a)c.name=a.tileStreamLayerName,c.layername=a.tileStreamLayerName;if("tileStreamLayerURL"in a)c.url=
[a.tileStreamLayerURL];if("tileStreamLayerMaxZoom"in a)c.numZoomLevels=a.tileStreamLayerMaxZoom;if("tileStreamLayerAttribution"in a)c.attribution=a.tileStreamLayerAttribution;b.set("selected",a.selected||!1);b.set("source",a.source);b.set("name",a.name);"group"in a&&b.set("group",a.group);b.data.layer=c;b.commit();return b}});Ext.preg(gxp.plugins.XYZLayerSource.prototype.ptype,gxp.plugins.XYZLayerSource);Ext.namespace("gxp.plugins");
gxp.plugins.MapBoxSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_mapboxsource",title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",
naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldGlassTitle:"World Glass",worldPrintTitle:"World Print",createStore:function(){for(var a={projection:"EPSG:900913",numZoomLevels:19,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],buffer:1},b=[{name:"blue-marble-topo-bathy-jan",numZoomLevels:9},{name:"blue-marble-topo-bathy-jul",numZoomLevels:9},{name:"blue-marble-topo-jan",numZoomLevels:9},{name:"blue-marble-topo-jul",numZoomLevels:9},{name:"control-room",numZoomLevels:9},{name:"geography-class",numZoomLevels:9},{name:"natural-earth-hypso",numZoomLevels:7},{name:"natural-earth-hypso-bathy",numZoomLevels:7},
{name:"natural-earth-1",numZoomLevels:7},{name:"natural-earth-2",numZoomLevels:7},{name:"world-dark",numZoomLevels:12},{name:"world-light",numZoomLevels:12},{name:"world-glass",numZoomLevels:11},{name:"world-print",numZoomLevels:10}],c=b.length,d=Array(c),e,f=0;f<c;++f)e=b[f],d[f]=new OpenLayers.Layer.TMS(this[OpenLayers.String.camelize(e.name)+"Title"],["//a.tiles.mapbox.com/mapbox/","//b.tiles.mapbox.com/mapbox/","//c.tiles.mapbox.com/mapbox/","//d.tiles.mapbox.com/mapbox/"],OpenLayers.Util.applyDefaults({attribution:/^world/.test(name)?
"<a href='http://mapbox.com'>MapBox</a> | Some Data &copy; OSM CC-BY-SA | <a href='http://mapbox.com/tos'>Terms of Service</a>":"<a href='http://mapbox.com'>MapBox</a> | <a href='http://mapbox.com/tos'>Terms of Service</a>",type:"png",tileOrigin:new OpenLayers.LonLat(-2.003750834E7,-2.003750834E7),layername:e.name,"abstract":'<div class="thumb-mapbox thumb-mapbox-'+e.name+'"></div>',numZoomLevels:e.numZoomLevels},a));this.store=new GeoExt.data.LayerStore({layers:d,fields:[{name:"source",type:"string"},
{name:"name",type:"string",mapping:"layername"},{name:"abstract",type:"string"},{name:"group",type:"string"},{name:"fixed",type:"boolean"},{name:"selected",type:"boolean"}]});this.fireEvent("ready",this)},createLayerRecord:function(a){var b,c=this.store.findExact("name",a.name);if(-1<c){b=this.store.getAt(c).copy(Ext.data.Record.id({}));c=b.getLayer().clone();a.title&&(c.setName(a.title),b.set("title",a.title));if("visibility"in a)c.visibility=a.visibility;b.set("selected",a.selected||!1);b.set("source",
a.source);b.set("name",a.name);"group"in a&&b.set("group",a.group);b.data.layer=c;b.commit()}return b}});Ext.preg(gxp.plugins.MapBoxSource.prototype.ptype,gxp.plugins.MapBoxSource);Ext.namespace("gxp.plugins");
gxp.plugins.MapQuestSource=Ext.extend(gxp.plugins.LayerSource,{ptype:"gxp_mapquestsource",title:"MapQuest Layers",osmAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
naipTitle:"MapQuest Imagery",createStore:function(){var a={projection:"EPSG:900913",maxExtent:new OpenLayers.Bounds(-2.00375083392E7,-2.00375083392E7,2.00375083392E7,2.00375083392E7),maxResolution:156543.03390625,numZoomLevels:19,units:"m",buffer:1,transitionEffect:"resize",tileOptions:{crossOriginKeyword:null}},a=[new OpenLayers.Layer.OSM(this.osmTitle,["http://otile1.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png","http://otile2.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png","http://otile3.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png",
"http://otile4.mqcdn.com/tiles/1.0.0/map/${z}/${x}/${y}.png"],OpenLayers.Util.applyDefaults({attribution:this.osmAttribution,type:"osm"},a)),new OpenLayers.Layer.OSM(this.naipTitle,["http://otile1.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png","http://otile2.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png","http://otile3.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png","http://otile4.mqcdn.com/tiles/1.0.0/sat/${z}/${x}/${y}.png"],OpenLayers.Util.applyDefaults({attribution:this.naipAttribution,type:"naip"},
a))];this.store=new GeoExt.data.LayerStore({layers:a,fields:[{name:"source",type:"string"},{name:"name",type:"string",mapping:"type"},{name:"abstract",type:"string",mapping:"attribution"},{name:"group",type:"string",defaultValue:"background"},{name:"fixed",type:"boolean",defaultValue:!0},{name:"selected",type:"boolean"}]});this.store.each(function(a){a.set("group","background")});this.fireEvent("ready",this)},createLayerRecord:function(a){var b,c=this.store.findExact("name",a.name);if(-1<c){b=this.store.getAt(c).copy(Ext.data.Record.id({}));
c=b.getLayer().clone();a.title&&(c.setName(a.title),b.set("title",a.title));if("visibility"in a)c.visibility=a.visibility;b.set("selected",a.selected||!1);b.set("source",a.source);b.set("name",a.name);"group"in a&&b.set("group",a.group);b.data.layer=c;b.commit()}return b}});Ext.preg(gxp.plugins.MapQuestSource.prototype.ptype,gxp.plugins.MapQuestSource);Ext.namespace("gxp.plugins");
gxp.plugins.QueryForm=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_queryform",featureManager:null,autoHide:!1,schema:null,queryActionText:"Query",cancelButtonText:"Cancel",queryMenuText:"Query layer",queryActionTip:"Query the selected layer",queryByLocationText:"Query by current map extent",queryByAttributesText:"Query by attributes",queryMsg:"Querying...",noFeaturesTitle:"No Match",noFeaturesMessage:"Your query did not return any results.",outputAction:0,autoExpand:null,addActions:function(a){!this.initialConfig.actions&&
!a&&(a=[{text:this.queryActionText,menuText:this.queryMenuText,iconCls:"gxp-icon-find",tooltip:this.queryActionTip,disabled:!0,toggleGroup:this.toggleGroup,enableToggle:!0,allowDepress:!0,toggleHandler:function(a,c){if(this.autoExpand&&0<this.output.length){var d=Ext.getCmp(this.autoExpand);d[c?"expand":"collapse"]();c?(d.expand(),d.ownerCt&&d.ownerCt instanceof Ext.Panel&&d.ownerCt.expand()):this.target.tools[this.featureManager].loadFeatures()}},scope:this}]);this.actions=gxp.plugins.QueryForm.superclass.addActions.apply(this,
a);if(null!==this.actionTarget&&this.actions)this.target.tools[this.featureManager].on("layerchange",function(a,c,d){for(a=this.actions.length-1;0<=a;--a)this.actions[a].setDisabled(!d)},this)},addOutput:function(a){var b=this.target.tools[this.featureManager],a=Ext.apply({border:!1,bodyStyle:"padding: 10px",layout:"form",width:320,autoScroll:!0,items:[{xtype:"fieldset",ref:"spatialFieldset",title:this.queryByLocationText,anchor:"97%",style:"margin-bottom:0; border-left-color:transparent; border-right-color:transparent; border-width:1px 1px 0 1px; padding-bottom:0",
checkboxToggle:!0},{xtype:"fieldset",ref:"attributeFieldset",title:this.queryByAttributesText,anchor:"97%",style:"margin-bottom:0",checkboxToggle:!0}],bbar:["->",{text:this.cancelButtonText,iconCls:"cancel",handler:function(){var a=this.outputTarget?c.ownerCt:c.ownerCt.ownerCt;a&&a instanceof Ext.Window&&a.hide();g(b,b.layerRecord,b.schema);b.loadFeatures()}},{text:this.queryActionText,iconCls:"gxp-icon-find",handler:function(){var a=[];!0!==c.spatialFieldset.collapsed&&a.push(new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,
property:b.featureStore.geometryName,value:this.target.mapPanel.map.getExtent()}));if(!0!==c.attributeFieldset.collapsed){var d=c.filterBuilder.getFilter();d&&a.push(d)}b.loadFeatures(1<a.length?new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:a}):a[0])},scope:this}]},a||{}),c=gxp.plugins.QueryForm.superclass.addOutput.call(this,a),d=null,e=!0;if(this.autoExpand){var d=Ext.getCmp(this.autoExpand),f=function(){e&&(d.un("expand",f),d.un("collapse",f),d=null);e=!0};d.on({expand:f,
collapse:f})}var g=function(a,b,f){c.attributeFieldset.removeAll();c.setDisabled(!f);d&&(e=!1,d[f?"expand":"collapse"](),f&&d&&d.ownerCt&&d.ownerCt instanceof Ext.Panel&&d.ownerCt.expand());f?(c.attributeFieldset.add({xtype:"gxp_filterbuilder",ref:"../filterBuilder",attributes:f,allowBlank:!0,allowGroups:!1}),c.spatialFieldset.expand(),c.attributeFieldset.expand()):(c.attributeFieldset.rendered&&c.attributeFieldset.collapse(),c.spatialFieldset.rendered&&c.spatialFieldset.collapse());c.attributeFieldset.doLayout()};
b.on("layerchange",g);g(b,b.layerRecord,b.schema);b.on({beforequery:function(){(new Ext.LoadMask(c.getEl(),{store:b.featureStore,msg:this.queryMsg})).show()},query:function(a,b){if(b&&null!==this.target.tools[this.featureManager].featureStore&&(b.getCount()||Ext.Msg.show({title:this.noFeaturesTitle,msg:this.noFeaturesMessage,buttons:Ext.Msg.OK,icon:Ext.Msg.INFO}),this.autoHide)){var d=this.outputTarget?c.ownerCt:c.ownerCt.ownerCt;d instanceof Ext.Window&&d.hide()}},scope:this});return c}});
Ext.preg(gxp.plugins.QueryForm.prototype.ptype,gxp.plugins.QueryForm);Ext.namespace("gxp.plugins");
gxp.plugins.WMSCSource=Ext.extend(gxp.plugins.WMSSource,{ptype:"gxp_wmscsource",version:"1.1.1",constructor:function(a){a.baseParams={SERVICE:"WMS",REQUEST:"GetCapabilities",TILED:!0};if(!a.format)this.format=new OpenLayers.Format.WMSCapabilities({keepData:!0,profile:"WMSC",allowFallback:!0});gxp.plugins.WMSCSource.superclass.constructor.apply(this,arguments)},createLayerRecord:function(a){var b=gxp.plugins.WMSCSource.superclass.createLayerRecord.apply(this,arguments);if(b){var c,d;if(this.store.reader.raw)c=
this.store.reader.raw.capability;var e=c&&c.vendorSpecific?c.vendorSpecific.tileSets:a.capability&&a.capability.tileSets;c=b.get("layer");if(e)for(var f=this.getProjection(b)||this.getMapProjection(),g=0,h=e.length;g<h;g++){var j=e[g];if(j.layers===c.params.LAYERS){var k;for(d in j.srs){k=new OpenLayers.Projection(d);break}if(f.equals(k)){d=j.bbox[d].bbox;c.projection=k;c.addOptions({resolutions:j.resolutions,tileSize:new OpenLayers.Size(j.width,j.height),tileOrigin:new OpenLayers.LonLat(d[0],d[1])});
break}}}else if(this.lazy&&(k=a.tileSize,d=a.tileOrigin,c.addOptions({resolutions:a.resolutions,tileSize:k?new OpenLayers.Size(k[0],k[1]):void 0,tileOrigin:d?OpenLayers.LonLat.fromArray(d):void 0}),!d&&(this.target.map.maxExtent?k=this.target.map.maxExtent:(d=a.srs||this.target.map.projection,k=OpenLayers.Projection.defaults[d].maxExtent),k)))c.tileOrigin=OpenLayers.LonLat.fromArray(k);c.params.TILED=!1!==a.cached&&!0;return b}},getConfigForRecord:function(a){var b=gxp.plugins.WMSCSource.superclass.getConfigForRecord.apply(this,
arguments),c=b.name,d,e=a.getLayer();if(b.capability&&this.store.reader.raw){d=this.store.reader.raw.capability;var f=d.vendorSpecific&&d.vendorSpecific.tileSets;if(f)for(var g=f.length-1;0<=g;--g)if(d=f[g],d.layers===c&&d.srs[e.projection]){b.capability.tileSets=[d];break}}if(!b.capability||!b.capability.tileSets){if(c=e.options.tileSize)b.tileSize=[c.w,c.h];b.tileOrigin=e.options.tileOrigin;b.resolutions=e.options.resolutions}return Ext.applyIf(b,{cached:!!e.params.TILED})}});
Ext.preg(gxp.plugins.WMSCSource.prototype.ptype,gxp.plugins.WMSCSource);Ext.namespace("gxp.plugins");
gxp.plugins.ZoomToExtent=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_zoomtoextent",menuText:"Zoom To Max Extent",tooltip:"Zoom To Max Extent",extent:null,closest:!0,iconCls:"gxp-icon-zoomtoextent",closest:!0,constructor:function(a){gxp.plugins.ZoomToExtent.superclass.constructor.apply(this,arguments);if(this.extent instanceof Array)this.extent=OpenLayers.Bounds.fromArray(this.extent)},addActions:function(){return gxp.plugins.ZoomToExtent.superclass.addActions.apply(this,[{text:this.buttonText,menuText:this.menuText,
iconCls:this.iconCls,tooltip:this.tooltip,handler:function(){var a=this.target.mapPanel.map,b="function"==typeof this.extent?this.extent():this.extent;if(!b)for(var c,d=0,e=a.layers.length;d<e;++d)c=a.layers[d],c.getVisibility()&&(c=c.restrictedExtent||c.maxExtent,b?b.extend(c):c&&(b=c.clone()));b&&((d=a.restrictedExtent||a.maxExtent)&&(b=new OpenLayers.Bounds(Math.max(b.left,d.left),Math.max(b.bottom,d.bottom),Math.min(b.right,d.right),Math.min(b.top,d.top))),a.zoomToExtent(b,this.closest))},scope:this}])}});
Ext.preg(gxp.plugins.ZoomToExtent.prototype.ptype,gxp.plugins.ZoomToExtent);Ext.namespace("gxp.plugins");
gxp.plugins.NavigationHistory=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_navigationhistory",previousMenuText:"Zoom To Previous Extent",nextMenuText:"Zoom To Next Extent",previousTooltip:"Zoom To Previous Extent",nextTooltip:"Zoom To Next Extent",constructor:function(a){gxp.plugins.NavigationHistory.superclass.constructor.apply(this,arguments)},addActions:function(){var a=new OpenLayers.Control.NavigationHistory;this.target.mapPanel.map.addControl(a);a=[new GeoExt.Action({menuText:this.previousMenuText,
iconCls:"gxp-icon-zoom-previous",tooltip:this.previousTooltip,disabled:!0,control:a.previous}),new GeoExt.Action({menuText:this.nextMenuText,iconCls:"gxp-icon-zoom-next",tooltip:this.nextTooltip,disabled:!0,control:a.next})];return gxp.plugins.NavigationHistory.superclass.addActions.apply(this,[a])}});Ext.preg(gxp.plugins.NavigationHistory.prototype.ptype,gxp.plugins.NavigationHistory);Ext.namespace("gxp.plugins");
gxp.plugins.Zoom=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_zoom",zoomMenuText:"Zoom Box",zoomInMenuText:"Zoom In",zoomOutMenuText:"Zoom Out",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"Zoom in",zoomOutTooltip:"Zoom out",constructor:function(a){gxp.plugins.Zoom.superclass.constructor.apply(this,arguments)},addActions:function(){var a=[{menuText:this.zoomInMenuText,iconCls:"gxp-icon-zoom-in",tooltip:this.zoomInTooltip,handler:function(){this.target.mapPanel.map.zoomIn()},scope:this},{menuText:this.zoomOutMenuText,
iconCls:"gxp-icon-zoom-out",tooltip:this.zoomOutTooltip,handler:function(){this.target.mapPanel.map.zoomOut()},scope:this}];this.showZoomBoxAction&&a.unshift(new GeoExt.Action({menuText:this.zoomText,iconCls:"gxp-icon-zoom",tooltip:this.zoomTooltip,control:new OpenLayers.Control.ZoomBox(this.controlOptions),map:this.target.mapPanel.map,enableToggle:!0,allowDepress:!1,toggleGroup:this.toggleGroup}));return gxp.plugins.Zoom.superclass.addActions.apply(this,[a])}});
Ext.preg(gxp.plugins.Zoom.prototype.ptype,gxp.plugins.Zoom);Ext.namespace("gxp.plugins");
gxp.plugins.Measure=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_measure",outputTarget:"map",buttonText:"Measure",lengthMenuText:"Length",areaMenuText:"Area",lengthTooltip:"Measure length",areaTooltip:"Measure area",measureTooltip:"Measure",constructor:function(a){gxp.plugins.Measure.superclass.constructor.apply(this,arguments)},destroy:function(){this.button=null;gxp.plugins.Measure.superclass.destroy.apply(this,arguments)},createMeasureControl:function(a,b){var c=new OpenLayers.StyleMap({"default":new OpenLayers.Style(null,
{rules:[new OpenLayers.Rule({symbolizer:{Point:{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},Line:{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},Polygon:{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}}})]})}),d=function(){f&&f.destroy()},e=function(a){var b=a.measure,c=a.units;h.displaySystem="english";var d=-1<a.geometry.CLASS_NAME.indexOf("LineString")?
h.getBestLength(a.geometry):h.getBestArea(a.geometry),e=d[0],d=d[1];h.displaySystem="metric";a=2==a.order?"<sup>2</sup>":"";return b.toFixed(2)+" "+c+a+"<br>"+e.toFixed(2)+" "+d+a},f,g=Ext.apply({},this.initialConfig.controlOptions);Ext.applyIf(g,{geodesic:!0,persist:!0,handlerOptions:{layerOptions:{styleMap:c}},eventListeners:{measurepartial:function(a){d();f=this.addOutput({xtype:"tooltip",html:e(a),title:b,autoHide:!1,closable:!0,draggable:!1,mouseOffset:[0,0],showDelay:1,listeners:{hide:d}});
if(0<a.measure){var a=h.handler.lastUp,c=this.target.mapPanel.getPosition();f.targetXY=[c[0]+a.x,c[1]+a.y];f.show()}},deactivate:d,scope:this}});var h=new OpenLayers.Control.Measure(a,g);return h},addActions:function(){this.activeIndex=0;this.button=new Ext.SplitButton({iconCls:"gxp-icon-measure-length",tooltip:this.measureTooltip,buttonText:this.buttonText,enableToggle:!0,toggleGroup:this.toggleGroup,allowDepress:!0,handler:function(a){a.pressed&&a.menu.items.itemAt(this.activeIndex).setChecked(!0)},
scope:this,listeners:{toggle:function(a,b){b||a.menu.items.each(function(a){a.setChecked(!1)})},render:function(a){Ext.ButtonToggleMgr.register(a)}},menu:new Ext.menu.Menu({items:[new Ext.menu.CheckItem(new GeoExt.Action({text:this.lengthMenuText,iconCls:"gxp-icon-measure-length",toggleGroup:this.toggleGroup,group:this.toggleGroup,listeners:{checkchange:function(a,b){this.activeIndex=0;this.button.toggle(b);b&&this.button.setIconClass(a.iconCls)},scope:this},map:this.target.mapPanel.map,control:this.createMeasureControl(OpenLayers.Handler.Path,
this.lengthTooltip)})),new Ext.menu.CheckItem(new GeoExt.Action({text:this.areaMenuText,iconCls:"gxp-icon-measure-area",toggleGroup:this.toggleGroup,group:this.toggleGroup,allowDepress:!1,listeners:{checkchange:function(a,b){this.activeIndex=1;this.button.toggle(b);b&&this.button.setIconClass(a.iconCls)},scope:this},map:this.target.mapPanel.map,control:this.createMeasureControl(OpenLayers.Handler.Polygon,this.areaTooltip)}))]})});return gxp.plugins.Measure.superclass.addActions.apply(this,[this.button])}});
Ext.preg(gxp.plugins.Measure.prototype.ptype,gxp.plugins.Measure);Ext.namespace("gxp.plugins");
gxp.plugins.WMSGetFeatureInfo=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_wmsgetfeatureinfo",outputTarget:"map",popupCache:null,infoActionTip:"Get Feature Info",popupTitle:"Feature Info",buttonText:"Identify",format:"html",constructor:function(a){this.geoJSONFormat=new OpenLayers.Format.GeoJSON;gxp.plugins.WMSGetFeatureInfo.superclass.constructor.apply(this,arguments)},addActions:function(){var a;this.popupCache={};var b=gxp.plugins.WMSGetFeatureInfo.superclass.addActions.call(this,[{tooltip:this.infoActionTip,
iconCls:"gxp-icon-getfeatureinfo",buttonText:this.buttonText,toggleGroup:this.toggleGroup,enableToggle:!0,allowDepress:!0,toggleHandler:function(b,c){for(var d=0,h=a.length;d<h;d++)c?a[d].activate():a[d].deactivate()}}]),c=this.actions[0].items[0];a=[];var d=function(){for(var b=this.target.mapPanel.layers.queryBy(function(a){return a.get("queryable")}),d=this.target.mapPanel.map,g,h=0,j=a.length;h<j;h++)g=a[h],g.deactivate(),g.destroy();a=[];b.each(function(b){var e=b.getLayer(),g=Ext.apply({},this.vendorParams),
h;if(this.layerParams)for(var j=this.layerParams.length-1;0<=j;--j)h=this.layerParams[j].toUpperCase(),g[h]=e.params[h];var q=b.get("infoFormat");void 0===q&&(q="html"==this.format?"text/html":"application/vnd.ogc.gml");e=new OpenLayers.Control.WMSGetFeatureInfo(Ext.applyIf({url:e.url,queryVisible:!0,layers:[e],infoFormat:q,vendorParams:g,eventListeners:{getfeatureinfo:function(a){var c=b.get("title")||b.get("name");if("text/html"==q){var d=a.text.match(/<body[^>]*>([\s\S]*)<\/body>/);d&&!d[1].match(/^\s*$/)&&
this.displayPopup(a,c,d[1])}else if("text/plain"==q)this.displayPopup(a,c,"<pre>"+a.text+"</pre>");else if(a.features&&0<a.features.length)this.displayPopup(a,c,null,b.get("getFeatureInfo"));else if("application/json"===q&&a.text)a.features=this.geoJSONFormat.read(a.text),a.features&&0<a.features.length&&this.displayPopup(a,c,null,b.get("getFeatureInfo"))},scope:this}},this.controlOptions));d.addControl(e);a.push(e);c.pressed&&e.activate()},this)};this.target.mapPanel.layers.on("update",d,this);this.target.mapPanel.layers.on("add",
d,this);this.target.mapPanel.layers.on("remove",d,this);return b},displayPopup:function(a,b,c,d){var e,f=a.xy.x+"."+a.xy.y,d=d||{};f in this.popupCache?e=this.popupCache[f]:(e=this.addOutput({xtype:"gx_popup",title:this.popupTitle,layout:"accordion",fill:!1,autoScroll:!0,location:a.xy,map:this.target.mapPanel,width:250,height:300,defaults:{layout:"fit",autoScroll:!0,autoHeight:!0,autoWidth:!0,collapsible:!0}}),e.on({close:function(a){return function(){delete this.popupCache[a]}}(f),scope:this}),this.popupCache[f]=
e);a=a.features;f=[];if(!c&&a)for(var g=0,h=a.length;g<h;++g)c=a[g],f.push(Ext.apply({xtype:"gxp_editorgrid",readOnly:!0,listeners:{beforeedit:function(){return!1}},title:c.fid?c.fid:b,feature:c,fields:d.fields,propertyNames:d.propertyNames},this.itemConfig));else c&&f.push(Ext.apply({title:b,html:c},this.itemConfig));e.add(f);e.doLayout()}});Ext.preg(gxp.plugins.WMSGetFeatureInfo.prototype.ptype,gxp.plugins.WMSGetFeatureInfo);Ext.namespace("gxp.plugins");
gxp.plugins.Navigation=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_navigation",menuText:"Pan Map",tooltip:"Pan Map",constructor:function(a){gxp.plugins.Navigation.superclass.constructor.apply(this,arguments)},addActions:function(){var a;this.controlOptions?(this.controlOptions=this.controlOptions||{},Ext.applyIf(this.controlOptions,{dragPanOptions:{enableKinetic:!0}}),a=new OpenLayers.Control.Navigation(this.controlOptions)):(candidates=this.target.mapPanel.map.getControlsByClass("OpenLayers.Control.Navigation"),
candidates.length&&(a=candidates[0]));a=[new GeoExt.Action({tooltip:this.tooltip,menuText:this.menuText,iconCls:"gxp-icon-pan",enableToggle:!0,pressed:!0,allowDepress:!1,control:a,map:a.map?null:this.target.mapPanel.map,toggleGroup:this.toggleGroup})];return gxp.plugins.Navigation.superclass.addActions.apply(this,[a])}});Ext.preg(gxp.plugins.Navigation.prototype.ptype,gxp.plugins.Navigation);Ext.namespace("gxp.plugins");
gxp.plugins.LayerManager=Ext.extend(gxp.plugins.LayerTree,{ptype:"gxp_layermanager",baseNodeText:"Base Maps",createOutputConfig:function(){var a=gxp.plugins.LayerManager.superclass.createOutputConfig.apply(this,arguments);Ext.applyIf(a,Ext.apply({cls:"gxp-layermanager-tree",lines:!1,useArrows:!0,plugins:[{ptype:"gx_treenodecomponent"}]},this.treeConfig));return a},configureLayerNode:function(a,b){gxp.plugins.LayerManager.superclass.configureLayerNode.apply(this,arguments);var c;OpenLayers.Layer.WMS&&
b.layer instanceof OpenLayers.Layer.WMS?c="gx_wmslegend":OpenLayers.Layer.Vector&&b.layer instanceof OpenLayers.Layer.Vector&&(c="gx_vectorlegend");if(c){var d;if(a&&a.baseAttrs&&a.baseAttrs.baseParams)d=a.baseAttrs.baseParams;Ext.apply(b,{component:{xtype:c,hidden:!b.layer.getVisibility(),baseParams:Ext.apply({transparent:!0,format:"image/png",legend_options:"fontAntiAliasing:true;fontSize:11;fontName:Arial"},d),layerRecord:this.target.mapPanel.layers.getByLayer(b.layer),showTitle:!1,cls:"legend"}})}}});
Ext.preg(gxp.plugins.LayerManager.prototype.ptype,gxp.plugins.LayerManager);Ext.namespace("gxp.plugins");
gxp.plugins.AddLayers=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_addlayers",addActionMenuText:"Add layers",findActionMenuText:"Find layers",addFeedActionMenuText:"Add feeds",addActionTip:"Add layers",addServerText:"Add a New Server",addButtonText:"Add layers",untitledText:"Untitled",addLayerSourceErrorText:"Error getting {type} capabilities ({msg}).\nPlease check the url and try again.",availableLayersText:"Available Layers",searchText:"Search for layers",expanderTemplateText:"<p><b>Abstract:</b> {abstract}</p>",
panelTitleText:"Title",layerSelectionText:"View available data from:",doneText:"Done",uploadRoles:["ROLE_ADMINISTRATOR"],uploadText:"Upload layers",relativeUploadOnly:!0,startSourceId:null,catalogSourceKey:null,selectedSource:null,addServerId:null,constructor:function(a){this.addEvents("sourceselected");gxp.plugins.AddLayers.superclass.constructor.apply(this,arguments)},addActions:function(){var a={tooltip:this.addActionTip,text:this.addActionText,menuText:this.addActionMenuText,disabled:!0,iconCls:"gxp-icon-addlayers"},
b;if(this.initialConfig.search||this.uploadSource){var c=[new Ext.menu.Item({iconCls:"gxp-icon-addlayers",text:this.addActionMenuText,handler:this.showCapabilitiesGrid,scope:this})];if(this.initialConfig.search&&this.initialConfig.search.selectedSource&&this.target.sources[this.initialConfig.search.selectedSource]){var d=new Ext.menu.Item({iconCls:"gxp-icon-addlayers",text:this.findActionMenuText,handler:this.showCatalogueSearch,scope:this});c.push(d);Ext.Ajax.request({method:"GET",url:this.target.sources[this.initialConfig.search.selectedSource].url,
callback:function(a,b){!1===b&&(this.target.layerSources[this.initialConfig.search.selectedSource].disable(),d.hide())},scope:this})}this.initialConfig.feeds&&c.push(new Ext.menu.Item({iconCls:"gxp-icon-addlayers",text:this.addFeedActionMenuText,handler:this.showFeedDialog,scope:this}));this.uploadSource&&(b=this.createUploadButton(Ext.menu.Item))&&c.push(b);a=Ext.apply(a,{menu:new Ext.menu.Menu({items:c})})}else a=Ext.apply(a,{handler:this.showCapabilitiesGrid,scope:this});var e=gxp.plugins.AddLayers.superclass.addActions.apply(this,
[a]);this.target.on("ready",function(){if(this.uploadSource){var a=this.target.layerSources[this.uploadSource];a?this.setSelectedSource(a):(delete this.uploadSource,b&&b.hide())}e[0].enable()},this);return e},showCatalogueSearch:function(){var a=this.initialConfig.search.selectedSource,b={},c=!1,d;for(d in this.target.layerSources){var e=this.target.layerSources[d];e instanceof gxp.plugins.CatalogueSource&&(c={},c[d]=e,Ext.apply(b,c),c=!0)}if(!1===c)window.console&&window.console.debug("No catalogue source specified");
else return a=gxp.plugins.AddLayers.superclass.addOutput.apply(this,[{sources:b,title:this.searchText,height:300,width:315,selectedSource:a,xtype:"gxp_cataloguesearchpanel",map:this.target.mapPanel.map}]),a.on({addlayer:function(a,b,c){var a=this.target.layerSources[b],d=OpenLayers.Bounds.fromArray(c.bbox,a.yx&&!0===a.yx[c.projection]),e=this.target.mapPanel.map.getProjection(),d=d.transform(c.srs,e);c.srs=e;c.bbox=d.toArray();c.source=null!==this.initialConfig.catalogSourceKey?this.initialConfig.catalogSourceKey:
b;this.target.mapPanel.layers.add(a.createLayerRecord(c));d&&this.target.mapPanel.map.zoomToExtent(d)},scope:this}),(b=a.findParentByType("window"))&&b.center(),a},showCapabilitiesGrid:function(){this.capGrid?this.capGrid instanceof Ext.Window||this.addOutput(this.capGrid):this.initCapGrid();this.capGrid.show()},showFeedDialog:function(){if(!this.feedDialog){var a=this.outputTarget?Ext.Panel:Ext.Window;this.feedDialog=new a(Ext.apply({closeAction:"hide",autoScroll:!0,title:this.addFeedActionMenuText,
items:[{xtype:"gxp_feedsourcedialog",target:this.target,listeners:{addfeed:function(a,c){var d={config:{ptype:a}};if(c.url)d.config.url=c.url;d=this.target.addLayerSource(d);c.source=d.id;this.target.mapPanel.layers.add([d.createLayerRecord(c)]);this.feedDialog.hide()},scope:this}}]},this.initialConfig.outputConfig));a===Ext.Panel&&this.addOutput(this.feedDialog)}this.feedDialog instanceof Ext.Window||this.addOutput(this.feedDialog);this.feedDialog.show()},initCapGrid:function(){function a(){function a(b){d&&
d.push(b);e--;0===e&&this.addLayers(d)}for(var b=this.selectedSource,c=h.getSelectionModel().getSelections(),d=[],e=c.length,f=0,g=c.length;f<g;++f){var j=b.createLayerRecord({name:c[f].get("name"),source:b.id},a,this);j&&a.call(this,j)}}var b,c=[],d=this.target,e;for(e in d.layerSources)b=d.layerSources[e],b.store&&!b.hidden&&c.push([e,b.title||e,b.url]);var f=new Ext.data.ArrayStore({fields:["id","title","url"],data:c});e=this.createExpander();var g=0;null!==this.startSourceId&&f.each(function(a){a.get("id")===
this.startSourceId&&(g=f.indexOf(a))},this);b=this.target.layerSources[c[g][0]];var h=new Ext.grid.GridPanel({store:b.store,autoScroll:!0,autoExpandColumn:"title",plugins:[e],loadMask:!0,colModel:new Ext.grid.ColumnModel([e,{id:"title",header:this.panelTitleText,dataIndex:"title",sortable:!0},{header:"Id",dataIndex:"name",width:120,sortable:!0}]),listeners:{rowdblclick:a,scope:this}}),j=new Ext.form.ComboBox({ref:"../../sourceComboBox",width:165,store:f,valueField:"id",displayField:"title",tpl:'<tpl for="."><div ext:qtip="{url}" class="x-combo-list-item">{title}</div></tpl>',
triggerAction:"all",editable:!1,allowBlank:!1,forceSelection:!0,mode:"local",value:c[g][0],listeners:{select:function(a,b){var c=b.get("id");c===this.addServerId?(l.outputTarget?l.addOutput(k):(new Ext.Window({title:gxp.NewSourceDialog.prototype.title,modal:!0,hideBorders:!0,width:300,items:k})).show(),j.reset()):(c=this.target.layerSources[c],h.reconfigure(c.store,h.getColumnModel()),h.getView().focusRow(0),this.setSelectedSource(c),function(){a.triggerBlur();a.el.blur()}.defer(100))},focus:function(a){d.proxy&&
a.reset()},scope:this}});b=null;if(this.target.proxy||1<c.length)b=new Ext.Container({cls:"gxp-addlayers-sourceselect",items:[new Ext.Toolbar.TextItem({text:this.layerSelectionText}),j]}),b=[b];if(this.target.proxy)this.addServerId=Ext.id(),f.loadData([[this.addServerId,this.addServerText+"..."]],!0);var k={xtype:"gxp_newsourcedialog",header:!1,listeners:{hide:function(a){this.outputTarget||a.ownerCt.hide()},urlselected:function(a,b,c){a.setLoading();var d;switch(c){case "TMS":d="gxp_tmssource";break;
case "REST":d="gxp_arcrestsource";break;default:d="gxp_wmscsource"}this.target.addLayerSource({config:{url:b,ptype:d},callback:function(b){b=new f.recordType({id:b,title:this.target.layerSources[b].title||this.untitledText});f.insert(0,[b]);j.onSelect(b,0);a.hide()},fallback:function(b,d){a.setError((new Ext.Template(this.addLayerSourceErrorText)).apply({type:c,msg:d}))},scope:this})},scope:this}},l=this;e={xtype:"container",region:"center",layout:"fit",hideBorders:!0,items:[h]};this.instructionsText&&
e.items.push({xtype:"box",autoHeight:!0,autoEl:{tag:"p",cls:"x-form-item",style:"padding-left: 5px; padding-right: 5px"},html:this.instructionsText});var n=["->",new Ext.Button({text:this.addButtonText,iconCls:"gxp-icon-addlayers",handler:a,scope:this}),new Ext.Button({text:this.doneText,handler:function(){this.capGrid.hide()},scope:this})],m;this.uploadSource||(m=this.createUploadButton())&&n.unshift(m);m=this.outputTarget?Ext.Panel:Ext.Window;this.capGrid=new m(Ext.apply({title:this.availableLayersText,
closeAction:"hide",layout:"border",height:300,width:315,modal:!0,items:e,tbar:b,bbar:n,listeners:{hide:function(){h.getSelectionModel().clearSelections()},show:function(){null===this.selectedSource?this.setSelectedSource(this.target.layerSources[c[g][0]]):this.setSelectedSource(this.selectedSource)},scope:this}},this.initialConfig.outputConfig));m===Ext.Panel&&this.addOutput(this.capGrid)},addLayers:function(a,b){for(var c=this.selectedSource,d=this.target.mapPanel.layers,e,f,g,h=0,j=a.length;h<j;++h)if(f=
c.createLayerRecord({name:a[h].get("name"),source:c.id})||a[h])g=f.getLayer(),g.maxExtent&&(e?e.extend(f.getLayer().maxExtent):e=f.getLayer().maxExtent.clone()),"background"===f.get("group")?d.insert(1,[f]):d.add([f]);e&&this.target.mapPanel.map.zoomToExtent(e);if(1===a.length&&f&&(this.target.selectLayer(f),b&&this.postUploadAction)){var k,c=this.postUploadAction;if(!Ext.isString(c))k=c.outputConfig,c=c.plugin;this.target.tools[c].addOutput(k)}},setSelectedSource:function(a){this.selectedSource=
a;this.fireEvent("sourceselected",this,a);this.capGrid&&a.lazy&&a.store.load({callback:function(){var a=this.capGrid.sourceComboBox,c=a.store,d=a.valueField,e=c.findExact(d,a.getValue()),e=c.getAt(e),f=this.target.layerSources[e.get("id")];f?f.title!==e.get("title")&&!Ext.isEmpty(f.title)&&(e.set("title",f.title),a.setValue(e.get(d))):c.remove(e)}.createDelegate(this)})},createUploadButton:function(a){var a=a||Ext.Button,b,c=this.initialConfig.upload||!!this.initialConfig.uploadSource,d;if(c){"boolean"===
typeof c&&(c={});b=new a({text:this.uploadText,iconCls:"gxp-icon-filebrowse",hidden:!this.uploadSource,handler:function(){this.target.doAuthorized(this.uploadRoles,function(){var a=new gxp.LayerUploadPanel(Ext.apply({title:this.outputTarget?this.uploadText:void 0,url:d,width:300,border:!1,bodyStyle:"padding: 10px 10px 0 10px;",labelWidth:65,autoScroll:!0,defaults:{anchor:"99%",allowBlank:!1,msgTarget:"side"},listeners:{uploadcomplete:function(a,c){for(var d=c["import"].tasks,e,f={},g=0,q=d.length;g<
q;++g){e=d[g];if("ERROR"===e.state){Ext.Msg.alert(e.layer.originalName,e.errorMessage);return}var r;if(e.target.dataStore)r=e.target.dataStore.workspace.name;else if(e.target.coverageStore)r=e.target.coverageStore.workspace.name;f[r+":"+e.layer.name]=!0}this.selectedSource.store.load({params:{_dc:Math.random()},callback:function(){var a,b;this.capGrid&&this.capGrid.isVisible()&&(a=this.capGrid.get(0).get(0),b=a.getSelectionModel(),b.clearSelections());var c=[],d=0;this.selectedSource.store.each(function(a,
b){a.get("name")in f&&(d=b,c.push(a))});a?window.setTimeout(function(){b.selectRecords(c);a.getView().focusRow(d)},100):this.addLayers(c,!0)},scope:this});this.outputTarget?a.hide():b.close()},scope:this}},c)),b;this.outputTarget?this.addOutput(a):(b=new Ext.Window({title:this.uploadText,modal:!0,resizable:!1,items:[a]}),b.show())},this)},scope:this});var e={},f=function(a,b,c){a in e?window.setTimeout(function(){b.call(c,e[a])},0):Ext.Ajax.request({url:a,disableCaching:!1,callback:function(d,f,n){d=
n.status;e[a]=d;b.call(c,d)}})};this.on({sourceselected:function(a,c){b[this.uploadSource?"show":"hide"]();this.isEligibleForUpload(c)&&(d=this.getGeoServerRestUrl(c.url),this.target.isAuthorized()&&f(d+"/imports",function(a){b.setVisible(200===a)},this))},scope:this})}return b},getGeoServerRestUrl:function(a){a=a.split("/");a.pop();a.push("rest");return a.join("/")},isEligibleForUpload:function(a){return a.url&&(this.relativeUploadOnly?"/"===a.url.charAt(0):!0)&&-1===(this.nonUploadSources||[]).indexOf(a.id)},
createExpander:function(){return new Ext.grid.RowExpander({tpl:new Ext.Template(this.expanderTemplateText)})}});Ext.preg(gxp.plugins.AddLayers.prototype.ptype,gxp.plugins.AddLayers);Ext.namespace("gxp.plugins");
gxp.plugins.RemoveLayer=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_removelayer",removeMenuText:"Remove layer",removeActionTip:"Remove layer",addActions:function(){var a,b=gxp.plugins.RemoveLayer.superclass.addActions.apply(this,[{menuText:this.removeMenuText,iconCls:"gxp-icon-removelayers",disabled:!0,tooltip:this.removeActionTip,handler:function(){var b=a;b&&this.target.mapPanel.layers.remove(b)},scope:this}]),c=b[0];this.target.on("layerselectionchange",function(b){a=b;c.setDisabled(1>=this.target.mapPanel.layers.getCount()||
!b)},this);var d=function(b){c.setDisabled(!a||1>=b.getCount())};this.target.mapPanel.layers.on({add:d,remove:d});return b}});Ext.preg(gxp.plugins.RemoveLayer.prototype.ptype,gxp.plugins.RemoveLayer);Ext.namespace("gxp.plugins");
gxp.plugins.LayerProperties=Ext.extend(gxp.plugins.Tool,{ptype:"gxp_layerproperties",menuText:"Layer Properties",toolTip:"Layer Properties",constructor:function(a){gxp.plugins.LayerProperties.superclass.constructor.apply(this,arguments);if(!this.outputConfig)this.outputConfig={width:325,autoHeight:!0}},addActions:function(){var a=gxp.plugins.LayerProperties.superclass.addActions.apply(this,[{menuText:this.menuText,iconCls:"gxp-icon-layerproperties",disabled:!0,tooltip:this.toolTip,handler:function(){this.removeOutput();
this.addOutput()},scope:this}]),b=a[0];this.target.on("layerselectionchange",function(a){b.setDisabled(!a||!a.get("properties"))},this);return a},addOutput:function(a){var a=a||{},b=this.target.selectedLayer;this.outputConfig.title=(this.initialConfig.outputConfig||{}).title||this.menuText+": "+b.get("title");this.outputConfig.shortTitle=b.get("title");var c=b.get("properties")||"gxp_layerpanel",d=this.layerPanelConfig;d&&d[c]&&Ext.apply(a,d[c]);a=gxp.plugins.LayerProperties.superclass.addOutput.call(this,
Ext.apply({xtype:c,authorized:this.target.isAuthorized(),layerRecord:b,source:this.target.getSource(b),defaults:{style:"padding: 10px",autoHeight:this.outputConfig.autoHeight}},a));a.on({added:function(a){if(!this.outputTarget)a.on("afterrender",function(){a.ownerCt.ownerCt.center()},this,{single:!0})},scope:this});return a}});Ext.preg(gxp.plugins.LayerProperties.prototype.ptype,gxp.plugins.LayerProperties);Ext.namespace("gxp.plugins");
gxp.plugins.ZoomToLayerExtent=Ext.extend(gxp.plugins.ZoomToExtent,{ptype:"gxp_zoomtolayerextent",menuText:"Zoom to layer extent",tooltip:"Zoom to layer extent",iconCls:"gxp-icon-zoom-to",destroy:function(){this.selectedRecord=null;gxp.plugins.ZoomToLayerExtent.superclass.destroy.apply(this,arguments)},extent:function(){var a=this.selectedRecord.getLayer(),b;OpenLayers.Layer.Vector&&(b=a instanceof OpenLayers.Layer.Vector&&a.getDataExtent());return a.restrictedExtent||b||a.maxExtent||map.maxExtent},
addActions:function(){var a=gxp.plugins.ZoomToLayerExtent.superclass.addActions.apply(this,arguments);a[0].disable();this.target.on("layerselectionchange",function(b){this.selectedRecord=b;a[0].setDisabled(!b||!b.get("layer"))},this);return a}});Ext.preg(gxp.plugins.ZoomToLayerExtent.prototype.ptype,gxp.plugins.ZoomToLayerExtent);Ext.namespace("gxp.plugins");
gxp.plugins.ZoomToSelectedFeatures=Ext.extend(gxp.plugins.ZoomToExtent,{ptype:"gxp_zoomtoselectedfeatures",menuText:"Zoom to selected features",tooltip:"Zoom to selected features",closest:!1,layer:null,iconCls:"gxp-icon-zoom-to",extent:function(){for(var a,b,c=this.target.tools[this.featureManager].featureLayer.selectedFeatures,d=c.length-1;0<=d;--d)if(b=c[d].geometry)b=b.getBounds(),a?a.extend(b):a=b.clone();return a},addActions:function(){function a(){this.layer&&this.layer.events.un(c);if(this.layer=
d.featureLayer)this.layer.events.on(c)}var b=gxp.plugins.ZoomToSelectedFeatures.superclass.addActions.apply(this,arguments);b[0].disable();var c={featureselected:function(a){b[0].isDisabled()&&null!==a.feature.geometry&&b[0].enable()},featureunselected:function(){0===this.layer.selectedFeatures.length&&b[0].disable()},scope:this},d=this.target.tools[this.featureManager];this.target.on("layerselectionchange",a);d.on("query",function(){b[0].disable()});a.call(this);return b}});
Ext.preg(gxp.plugins.ZoomToSelectedFeatures.prototype.ptype,gxp.plugins.ZoomToSelectedFeatures);Ext.ns("Ext.ux.grid");
Ext.ux.grid.BufferView=Ext.extend(Ext.grid.GridView,{rowHeight:19,borderHeight:2,scrollDelay:100,cacheSize:20,cleanDelay:500,initTemplates:function(){Ext.ux.grid.BufferView.superclass.initTemplates.call(this);var a=this.templates;a.rowHolder=new Ext.Template('<div class="x-grid3-row {alt}" style="{tstyle}"></div>');a.rowHolder.disableFormats=!0;a.rowHolder.compile();a.rowBody=new Ext.Template('<table class="x-grid3-row-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr>",
this.enableRowBody?'<tr class="x-grid3-row-body-tr" style="{bodyStyle}"><td colspan="{cols}" class="x-grid3-body-cell" tabIndex="0" hidefocus="on"><div class="x-grid3-row-body">{body}</div></td></tr>':"","</tbody></table>");a.rowBody.disableFormats=!0;a.rowBody.compile()},getStyleRowHeight:function(){return Ext.isBorderBox?this.rowHeight+this.borderHeight:this.rowHeight},getCalculatedRowHeight:function(){return this.rowHeight+this.borderHeight},getVisibleRowCount:function(){var a=this.getCalculatedRowHeight(),
b=this.scroller.dom.clientHeight;return 1>b?0:Math.ceil(b/a)},getVisibleRows:function(){var a=this.getVisibleRowCount(),b=this.scroller.dom.scrollTop,b=0===b?0:Math.floor(b/this.getCalculatedRowHeight())-1;return{first:Math.max(b,0),last:Math.min(b+a+2,this.ds.getCount()-1)}},doRender:function(a,b,c,d,e,f,g){for(var h=this.templates,j=h.cell,k=h.row,l=h.rowBody,n=e-1,m=this.getStyleRowHeight(),o=this.getVisibleRows(),q=[],r,s={},t={tstyle:"width:"+this.getTotalWidth()+";height:"+m+"px;"},u,w=0,z=
b.length;w<z;w++){u=b[w];var m=[],x=w+d,v=x>=o.first&&x<=o.last;if(v)for(var y=0;y<e;y++){r=a[y];s.id=r.id;s.css=0===y?"x-grid3-cell-first ":y==n?"x-grid3-cell-last ":"";s.attr=s.cellAttr="";s.value=r.renderer(u.data[r.name],s,u,x,y,c);s.style=r.style;if(void 0===s.value||""===s.value)s.value="&#160;";u.dirty&&"undefined"!==typeof u.modified[r.name]&&(s.css+=" x-grid3-dirty-cell");m[m.length]=j.apply(s)}r=[];f&&0===(x+1)%2&&(r[0]="x-grid3-row-alt");u.dirty&&(r[1]=" x-grid3-dirty-row");t.cols=e;this.getRowClass&&
(r[2]=this.getRowClass(u,x,t,c));t.alt=r.join(" ");t.cells=m.join("");q[q.length]=!v?h.rowHolder.apply(t):g?l.apply(t):k.apply(t)}return q.join("")},isRowRendered:function(a){return(a=this.getRow(a))&&0<a.childNodes.length},syncScroll:function(){Ext.ux.grid.BufferView.superclass.syncScroll.apply(this,arguments);this.update()},update:function(){if(this.scrollDelay){if(!this.renderTask)this.renderTask=new Ext.util.DelayedTask(this.doUpdate,this);this.renderTask.delay(this.scrollDelay)}else this.doUpdate()},
onRemove:function(a,b,c,d){Ext.ux.grid.BufferView.superclass.onRemove.apply(this,arguments);!0!==d&&this.update()},doUpdate:function(){if(0<this.getVisibleRowCount()){for(var a=this.grid,b=a.colModel,c=a.store,d=this.getColumnData(),e=this.getVisibleRows(),f,g=e.first;g<=e.last;g++)if(!this.isRowRendered(g)&&(f=this.getRow(g))){var h=this.doRender(d,[c.getAt(g)],c,g,b.getColumnCount(),a.stripeRows,!0);f.innerHTML=h}this.clean()}},clean:function(){if(!this.cleanTask)this.cleanTask=new Ext.util.DelayedTask(this.doClean,
this);this.cleanTask.delay(this.cleanDelay)},doClean:function(){if(0<this.getVisibleRowCount()){var a=this.getVisibleRows();a.first-=this.cacheSize;a.last+=this.cacheSize;var b=0,c=this.getRows();0>=a.first&&(b=a.last+1);for(var d=this.ds.getCount();b<d;b++)if((b<a.first||b>a.last)&&c[b].innerHTML)c[b].innerHTML=""}},removeTask:function(a){var b=this[a];b&&b.cancel&&(b.cancel(),this[a]=null)},destroy:function(){this.removeTask("cleanTask");this.removeTask("renderTask");Ext.ux.grid.BufferView.superclass.destroy.call(this)},
layout:function(){Ext.ux.grid.BufferView.superclass.layout.call(this);this.update()}});Ext.ns("Ext.ux.layout");Ext.ux.layout.CenterLayout=Ext.extend(Ext.layout.FitLayout,{setItemSize:function(a,b){this.container.addClass("ux-layout-center");a.addClass("ux-layout-center-item");if(a&&0<b.height){if(a.width)b.width=a.width;a.setSize(b)}}});Ext.Container.LAYOUTS["ux.center"]=Ext.ux.layout.CenterLayout;Ext.ns("Ext.ux.grid");
Ext.ux.grid.CheckColumn=Ext.extend(Ext.grid.Column,{processEvent:function(a,b,c,d,e){if("mousedown"==a){var f=c.store.getAt(d);f.set(this.dataIndex,!f.data[this.dataIndex]);return!1}return Ext.grid.ActionColumn.superclass.processEvent.apply(this,arguments)},renderer:function(a,b){b.css+=" x-grid3-check-col-td";return String.format('<div class="x-grid3-check-col{0}">&#160;</div>',a?"-on":"")},init:Ext.emptyFn});Ext.preg("checkcolumn",Ext.ux.grid.CheckColumn);Ext.grid.CheckColumn=Ext.ux.grid.CheckColumn;
Ext.grid.Column.types.checkcolumn=Ext.ux.grid.CheckColumn;Ext.ns("Ext.ux.grid");
Ext.ux.grid.ColumnHeaderGroup=Ext.extend(Ext.util.Observable,{constructor:function(a){this.config=a},init:function(a){Ext.applyIf(a.colModel,this.config);Ext.apply(a.getView(),this.viewConfig)},viewConfig:{initTemplates:function(){this.constructor.prototype.initTemplates.apply(this,arguments);var a=this.templates||{};if(!a.gcell)a.gcell=new Ext.XTemplate('<td class="x-grid3-hd x-grid3-gcell x-grid3-td-{id} ux-grid-hd-group-row-{row} {cls}" style="{style}">','<div {tooltip} class="x-grid3-hd-inner x-grid3-hd-{id}" unselectable="on" style="{istyle}">',
this.grid.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"","{value}</div></td>");this.templates=a;this.hrowRe=/ux-grid-hd-group-row-(\d+)/},renderHeaders:function(){for(var a=this.templates,b=[],c=this.cm,d=c.rows,e="width:"+this.getTotalWidth()+";",f=0,g=d.length;f<g;f++){for(var h=d[f],j=[],k=0,l=0,n=h.length;k<n;k++){var m=h[k];m.colspan=m.colspan||1;var o=this.getColumnId(m.dataIndex?c.findColumnIndex(m.dataIndex):l),q=Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupStyle.call(this,m,
l);j[k]=a.gcell.apply({cls:"ux-grid-hd-group-cell",id:o,row:f,style:"width:"+q.width+";"+(q.hidden?"display:none;":"")+(m.align?"text-align:"+m.align+";":""),tooltip:m.tooltip?(Ext.QuickTips.isEnabled()?"ext:qtip":"title")+'="'+m.tooltip+'"':"",istyle:"right"==m.align?"padding-right:16px":"",btn:this.grid.enableHdMenu&&m.header,value:m.header||"&nbsp;"});l+=m.colspan}b[f]=a.header.apply({tstyle:e,cells:j.join("")})}b.push(this.constructor.prototype.renderHeaders.apply(this,arguments));return b.join("")},
onColumnWidthUpdated:function(){this.constructor.prototype.onColumnWidthUpdated.apply(this,arguments);Ext.ux.grid.ColumnHeaderGroup.prototype.updateGroupStyles.call(this)},onAllColumnWidthsUpdated:function(){this.constructor.prototype.onAllColumnWidthsUpdated.apply(this,arguments);Ext.ux.grid.ColumnHeaderGroup.prototype.updateGroupStyles.call(this)},onColumnHiddenUpdated:function(){this.constructor.prototype.onColumnHiddenUpdated.apply(this,arguments);Ext.ux.grid.ColumnHeaderGroup.prototype.updateGroupStyles.call(this)},
getHeaderCell:function(a){return this.mainHd.query(this.cellSelector)[a]},findHeaderCell:function(a){return a?this.fly(a).findParent("td.x-grid3-hd",this.cellSelectorDepth):!1},findHeaderIndex:function(a){return(a=this.findHeaderCell(a))?this.getCellIndex(a):!1},updateSortIcon:function(a,b){var c=this.sortClasses;this.mainHd.select(this.cellSelector).removeClass(c).item(a).addClass(c["DESC"==b?1:0])},handleHdDown:function(a,b){var c=Ext.get(b);if(c.hasClass("x-grid3-hd-btn")){a.stopEvent();var d=
this.findHeaderCell(b);Ext.fly(d).addClass("x-grid3-hd-menu-open");this.hdCtxIndex=c=this.getCellIndex(d);var e=this.hmenu.items,f=this.cm;e.get("asc").setDisabled(!f.isSortable(c));e.get("desc").setDisabled(!f.isSortable(c));this.hmenu.on("hide",function(){Ext.fly(d).removeClass("x-grid3-hd-menu-open")},this,{single:!0});this.hmenu.show(b,"tl-bl?")}else(c.hasClass("ux-grid-hd-group-cell")||Ext.fly(b).up(".ux-grid-hd-group-cell"))&&a.stopEvent()},handleHdMove:function(a){var b=this.findHeaderCell(this.activeHdRef);
if(b&&!this.headersDisabled&&!Ext.fly(b).hasClass("ux-grid-hd-group-cell")){var c=this.splitHandleWidth||5,d=this.activeHdRegion,a=a.getPageX(),b=b.style,e="";if(!1!==this.grid.enableColumnResize)if(a-d.left<=c&&this.cm.isResizable(this.activeHdIndex-1))e=Ext.isAir?"move":Ext.isWebKit?"e-resize":"col-resize";else if(d.right-a<=(!this.activeHdBtn?c:2)&&this.cm.isResizable(this.activeHdIndex))e=Ext.isAir?"move":Ext.isWebKit?"w-resize":"col-resize";b.cursor=e}},handleHdOver:function(a,b){var c=this.findHeaderCell(b);
if(c&&!this.headersDisabled){this.activeHdRef=b;this.activeHdIndex=this.getCellIndex(c);var d=this.fly(c);this.activeHdRegion=d.getRegion();if(!this.cm.isMenuDisabled(this.activeHdIndex)&&!d.hasClass("ux-grid-hd-group-cell")&&(d.addClass("x-grid3-hd-over"),this.activeHdBtn=d.child(".x-grid3-hd-btn")))this.activeHdBtn.dom.style.height=c.firstChild.offsetHeight-1+"px"}},handleHdOut:function(a,b){var c=this.findHeaderCell(b);if(c&&(!Ext.isIE||!a.within(c,!0)))this.activeHdRef=null,this.fly(c).removeClass("x-grid3-hd-over"),
c.style.cursor=""},handleHdMenuClick:function(a){var b=this.hdCtxIndex,c=this.cm,d=this.ds,e=a.getItemId();switch(e){case "asc":d.sort(c.getDataIndex(b),"ASC");break;case "desc":d.sort(c.getDataIndex(b),"DESC");break;default:if("group-"==e.substr(0,6)){for(var b=e.split("-"),f=parseInt(b[1],10),d=parseInt(b[2],10),g=this.cm.rows[f],h,b=f=0,j=g.length;b<j;b++){h=g[b];if(d>=f&&d<f+h.colspan)break;f+=h.colspan}if(a.checked){d=c.getColumnsBy(this.isHideableColumn,this).length;b=f;for(j=f+h.colspan;b<
j;b++)c.isHidden(b)||d--;if(1>d)return this.onDenyColumnHide(),!1}b=f;for(j=f+h.colspan;b<j;b++)!0!==c.config[b].fixed&&!1!==c.config[b].hideable&&c.setHidden(b,a.checked)}else if("col-"==e.substr(0,4)&&(b=c.getIndexById(e.substr(4)),-1!=b)){if(a.checked&&1>=c.getColumnsBy(this.isHideableColumn,this).length)return this.onDenyColumnHide(),!1;c.setHidden(b,a.checked)}if("group-"==e.substr(0,6)||"col-"==e.substr(0,4)){a.checked=!a.checked;if(a.menu){var k=function(b){b.items.each(function(b){b.disabled||
(b.setChecked(a.checked,!1),b.menu&&k(b.menu))})};k(a.menu)}for(var c=a,l;(c=c.parentMenu)&&c.parentMenu&&!(!(l=c.parentMenu.items.get(c.getItemId()))||!l.setChecked);){e=0<=c.items.findIndexBy(function(a){return a.checked});l.setChecked(e,!0)}a.checked=!a.checked}}return!0},beforeColMenuShow:function(){var a=this.cm,b=this.cm.rows;this.colMenu.removeAll();for(var c=0,d=a.getColumnCount();c<d;c++){var e=this.colMenu,f=a.getColumnHeader(c),g=[];if(!0!==a.config[c].fixed&&!1!==a.config[c].hideable){for(var h=
0,j=b.length;h<j;h++){for(var k=b[h],l,n=0,m=0,o=k.length;m<o;m++){l=k[m];if(c>=n&&c<n+l.colspan)break;n+=l.colspan}if(l&&l.header)if(a.hierarchicalColMenu){k="group-"+h+"-"+n;m=(m=e.items?e.getComponent(k):null)?m.menu:null;if(!m){m=new Ext.menu.Menu({itemId:k});m.on("itemclick",this.handleHdMenuClick,this);for(var o=!1,q=!0,r=n,n=n+l.colspan;r<n;r++)a.isHidden(r)||(o=!0),!1!==a.config[r].hideable&&(q=!1);e.add({itemId:k,text:l.header,menu:m,hideOnClick:!1,checked:o,disabled:q})}e=m}else g.push(l.header)}g.push(f);
e.add(new Ext.menu.CheckItem({itemId:"col-"+a.getColumnId(c),text:g.join(" "),checked:!a.isHidden(c),hideOnClick:!1,disabled:!1===a.config[c].hideable}))}}},afterRenderUI:function(){this.constructor.prototype.afterRenderUI.apply(this,arguments);Ext.apply(this.columnDrop,Ext.ux.grid.ColumnHeaderGroup.prototype.columnDropConfig);Ext.apply(this.splitZone,Ext.ux.grid.ColumnHeaderGroup.prototype.splitZoneConfig)}},splitZoneConfig:{allowHeaderDrag:function(a){return!a.getTarget(null,null,!0).hasClass("ux-grid-hd-group-cell")}},
columnDropConfig:{getTargetFromEvent:function(a){return this.view.findHeaderCell(Ext.lib.Event.getTarget(a))},positionIndicator:function(a,b,c){a=Ext.ux.grid.ColumnHeaderGroup.prototype.getDragDropData.call(this,a,b,c);if(!1===a)return!1;b=a.px+this.proxyOffsets[0];this.proxyTop.setLeftTop(b,a.r.top+this.proxyOffsets[1]);this.proxyTop.show();this.proxyBottom.setLeftTop(b,a.r.bottom);this.proxyBottom.show();return a.pt},onNodeDrop:function(a,b,c,d){b=d.header;if(b!=a){a=Ext.ux.grid.ColumnHeaderGroup.prototype.getDragDropData.call(this,
b,a,c);if(!1===a)return!1;for(var c=this.grid.colModel,b=a.oldIndex<a.newIndex,d=c.rows,e=a.row,f=d.length;e<f;e++){for(var g=d[e],h=g.length,j=0,k=1,l=h,n=0,m=0;n<h;n++){var o=g[n];a.oldIndex>=m&&a.oldIndex<m+o.colspan&&(j=n);a.oldIndex+a.colspan-1>=m&&a.oldIndex+a.colspan-1<m+o.colspan&&(k=n-j+1);a.newIndex>=m&&a.newIndex<m+o.colspan&&(l=n);m+=o.colspan}h=g.splice(j,k);d[e]=g.splice(0,l-(b?k:0)).concat(h).concat(g)}for(d=0;d<a.colspan;d++)e=a.oldIndex+(b?0:d),f=a.newIndex+(b?-1:d),c.moveColumn(e,
f),this.grid.fireEvent("columnmove",e,f);return!0}return!1}},getGroupStyle:function(a,b){for(var c=0,d=!0,e=b,f=b+a.colspan;e<f;e++)this.cm.isHidden(e)||(d=this.cm.getColumnWidth(e),"number"==typeof d&&(c+=d),d=!1);return{width:(Ext.isBorderBox||Ext.isWebKit&&!Ext.isSafari2?c:Math.max(c-this.borderWidth,0))+"px",hidden:d}},updateGroupStyles:function(a){for(var b=this.mainHd.query(".x-grid3-header-offset > table"),c=this.getTotalWidth(),d=this.cm.rows,e=0;e<b.length;e++)if(b[e].style.width=c,e<d.length)for(var f=
b[e].firstChild.firstChild.childNodes,g=0,h=0;g<f.length;g++){var j=d[e][g];if("number"!=typeof a||a>=h&&a<h+j.colspan){var k=Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupStyle.call(this,j,h);f[g].style.width=k.width;f[g].style.display=k.hidden?"none":""}h+=j.colspan}},getGroupRowIndex:function(a){return a&&(a=a.className.match(this.hrowRe))&&a[1]?parseInt(a[1],10):this.cm.rows.length},getGroupSpan:function(a,b){if(0>a)return{col:0,colspan:this.cm.getColumnCount()};var c=this.cm.rows[a];if(c){for(var d=
0,e=0,f=c.length;d<f;d++){var g=c[d];if(b>=e&&b<e+g.colspan)return{col:e,colspan:g.colspan};e+=g.colspan}return{col:e,colspan:0}}return{col:b,colspan:1}},getDragDropData:function(a,b,c){if(a.parentNode!=b.parentNode)return!1;var d=this.grid.colModel,e=Ext.lib.Event.getPageX(c),c=Ext.lib.Dom.getRegion(b.firstChild),f;c.right-e<=(c.right-c.left)/2?(e=c.right+this.view.borderWidth,f="after"):(e=c.left,f="before");var g=this.view.getCellIndex(a),b=this.view.getCellIndex(b);if(d.isFixed(b))return!1;a=
Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupRowIndex.call(this.view,a);d=Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupSpan.call(this.view,a,g);b=Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupSpan.call(this.view,a,b);g=d.col;b=b.col+("after"==f?b.colspan:0);if(b>=d.col&&b<=d.col+d.colspan)return!1;var h=Ext.ux.grid.ColumnHeaderGroup.prototype.getGroupSpan.call(this.view,a-1,g);return b<h.col||b>h.col+h.colspan?!1:{r:c,px:e,pt:f,row:a,oldIndex:g,newIndex:b,colspan:d.colspan}}});Ext.ns("Ext.ux.tree");
Ext.ux.tree.ColumnTree=Ext.extend(Ext.tree.TreePanel,{lines:!1,borderWidth:Ext.isBorderBox?0:2,cls:"x-column-tree",onRender:function(){Ext.tree.ColumnTree.superclass.onRender.apply(this,arguments);this.headers=this.header.createChild({cls:"x-tree-headers"});for(var a=this.columns,b,c=0,d=0,e=a.length;d<e;d++)b=a[d],c+=b.width,this.headers.createChild({cls:"x-tree-hd "+(b.cls?b.cls+"-hd":""),cn:{cls:"x-tree-hd-text",html:b.header},style:"width:"+(b.width-this.borderWidth)+"px;"});this.headers.createChild({cls:"x-clear"});
this.headers.setWidth(c+19);this.innerCt.setWidth(c)}});Ext.reg("columntree",Ext.ux.tree.ColumnTree);Ext.tree.ColumnTree=Ext.ux.tree.ColumnTree;
Ext.ux.tree.ColumnNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{focus:Ext.emptyFn,renderElements:function(a,b,c,d){this.indentMarkup=a.parentNode?a.parentNode.ui.getChildIndent():"";for(var e=a.getOwnerTree(),f=e.columns,e=e.borderWidth,g=f[0],h=['<li class="x-tree-node"><div ext:tree-node-id="',a.id,'" class="x-tree-node-el x-tree-node-leaf ',b.cls,'">','<div class="x-tree-col" style="width:',g.width-e,'px;">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow">',
'<img src="',b.icon||this.emptyIcon,'" class="x-tree-node-icon',b.icon?" x-tree-node-inline-icon":"",b.iconCls?" "+b.iconCls:"",'" unselectable="on">','<a hidefocus="on" class="x-tree-node-anchor" href="',b.href?b.href:"#",'" tabIndex="1" ',b.hrefTarget?' target="'+b.hrefTarget+'"':"",">",'<span unselectable="on">',a.text||(g.renderer?g.renderer(b[g.dataIndex],a,b):b[g.dataIndex]),"</span></a>","</div>"],j=1,k=f.length;j<k;j++)g=f[j],h.push('<div class="x-tree-col ',g.cls?g.cls:"",'" style="width:',
g.width-e,'px;">','<div class="x-tree-col-text">',g.renderer?g.renderer(b[g.dataIndex],a,b):b[g.dataIndex],"</div>","</div>");h.push('<div class="x-clear"></div></div>','<ul class="x-tree-node-ct" style="display:none;"></ul>',"</li>");this.wrap=!0!==d&&a.nextSibling&&a.nextSibling.ui.getEl()?Ext.DomHelper.insertHtml("beforeBegin",a.nextSibling.ui.getEl(),h.join("")):Ext.DomHelper.insertHtml("beforeEnd",c,h.join(""));this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1];a=this.elNode.firstChild.childNodes;
this.indentNode=a[0];this.ecNode=a[1];this.iconNode=a[2];this.anchor=a[3];this.textNode=a[3].firstChild}});Ext.tree.ColumnNodeUI=Ext.ux.tree.ColumnNodeUI;
Ext.DataView.LabelEditor=Ext.extend(Ext.Editor,{alignment:"tl-tl",hideEl:!1,cls:"x-small-editor",shim:!1,completeOnEnter:!0,cancelOnEsc:!0,labelSelector:"span.x-editable",constructor:function(a,b){Ext.DataView.LabelEditor.superclass.constructor.call(this,b||new Ext.form.TextField({allowBlank:!1,growMin:90,growMax:240,grow:!0,selectOnFocus:!0}),a)},init:function(a){this.view=a;a.on("render",this.initEditor,this);this.on("complete",this.onSave,this)},initEditor:function(){this.view.on({scope:this,containerclick:this.doBlur,
click:this.doBlur});this.view.getEl().on("mousedown",this.onMouseDown,this,{delegate:this.labelSelector})},doBlur:function(){this.editing&&this.field.blur()},onMouseDown:function(a,b){if(!a.ctrlKey&&!a.shiftKey){var c=this.view.findItemFromChild(b);a.stopEvent();c=this.view.store.getAt(this.view.indexOf(c));this.startEdit(b,c.data[this.dataIndex]);this.activeRecord=c}else a.preventDefault()},onSave:function(a,b){this.activeRecord.set(this.dataIndex,b)}});
Ext.DataView.DragSelector=function(a){function b(){n=[];j.all.each(function(a){n[n.length]=a.getRegion()});m=j.el.getRegion()}function c(){return!1}function d(a){return!q||a.target==j.el.dom}function e(){j.on("containerclick",c,j,{single:!0});k?(k.dom.parentNode!==j.el.dom&&j.el.dom.appendChild(k.dom),k.setDisplayed("block")):k=j.el.createChild({cls:"x-view-selector"});b();j.clearSelections()}function f(){var a=l.startXY,b=l.getXY(),c=Math.min(a[0],b[0]),d=Math.min(a[1],b[1]),e=Math.abs(a[0]-b[0]),
a=Math.abs(a[1]-b[1]);o.left=c;o.top=d;o.right=c+e;o.bottom=d+a;o.constrainTo(m);k.setRegion(o);c=0;for(d=n.length;c<d;c++)if(e=n[c],(a=o.intersect(e))&&!e.selected)e.selected=!0,j.select(c,!0);else if(!a&&e.selected)e.selected=!1,j.deselect(c)}function g(){Ext.isIE||j.un("containerclick",c,j);k&&k.setDisplayed(!1)}function h(a){l=new Ext.dd.DragTracker({onBeforeStart:d,onStart:e,onDrag:f,onEnd:g});l.initEl(a.el)}var a=a||{},j,k,l,n,m,o=new Ext.lib.Region(0,0,0,0),q=!0===a.dragSafe;this.init=function(a){j=
a;j.on("render",h)}};Ext.ns("Ext.ux.form");
Ext.ux.form.FileUploadField=Ext.extend(Ext.form.TextField,{buttonText:"Browse...",buttonOnly:!1,buttonOffset:3,readOnly:!0,autoSize:Ext.emptyFn,initComponent:function(){Ext.ux.form.FileUploadField.superclass.initComponent.call(this);this.addEvents("fileselected")},onRender:function(a,b){Ext.ux.form.FileUploadField.superclass.onRender.call(this,a,b);this.wrap=this.el.wrap({cls:"x-form-field-wrap x-form-file-wrap"});this.el.addClass("x-form-file-text");this.el.dom.removeAttribute("name");this.createFileInput();
var c=Ext.applyIf(this.buttonCfg||{},{text:this.buttonText});this.button=new Ext.Button(Ext.apply(c,{renderTo:this.wrap,cls:"x-form-file-btn"+(c.iconCls?" x-btn-icon":"")}));this.buttonOnly&&(this.el.hide(),this.wrap.setWidth(this.button.getEl().getWidth()));this.bindListeners();this.resizeEl=this.positionEl=this.wrap},bindListeners:function(){this.fileInput.on({scope:this,mouseenter:function(){this.button.addClass(["x-btn-over","x-btn-focus"])},mouseleave:function(){this.button.removeClass(["x-btn-over",
"x-btn-focus","x-btn-click"])},mousedown:function(){this.button.addClass("x-btn-click")},mouseup:function(){this.button.removeClass(["x-btn-over","x-btn-focus","x-btn-click"])},change:function(){var a=this.fileInput.dom.value;this.setValue(a);this.fireEvent("fileselected",this,a)}})},createFileInput:function(){this.fileInput=this.wrap.createChild({id:this.getFileInputId(),name:this.name||this.getId(),cls:"x-form-file",tag:"input",type:"file",size:1})},reset:function(){this.rendered&&(this.fileInput.remove(),
this.createFileInput(),this.bindListeners());Ext.ux.form.FileUploadField.superclass.reset.call(this)},getFileInputId:function(){return this.id+"-file"},onResize:function(a,b){Ext.ux.form.FileUploadField.superclass.onResize.call(this,a,b);this.wrap.setWidth(a);this.buttonOnly||(a=this.wrap.getWidth()-this.button.getEl().getWidth()-this.buttonOffset,this.el.setWidth(a))},onDestroy:function(){Ext.ux.form.FileUploadField.superclass.onDestroy.call(this);Ext.destroy(this.fileInput,this.button,this.wrap)},
onDisable:function(){Ext.ux.form.FileUploadField.superclass.onDisable.call(this);this.doDisable(!0)},onEnable:function(){Ext.ux.form.FileUploadField.superclass.onEnable.call(this);this.doDisable(!1)},doDisable:function(a){this.fileInput.dom.disabled=a;this.button.setDisabled(a)},preFocus:Ext.emptyFn,alignErrorIcon:function(){this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])}});Ext.reg("fileuploadfield",Ext.ux.form.FileUploadField);Ext.form.FileUploadField=Ext.ux.form.FileUploadField;
Ext.ux.GMapPanel=Ext.extend(Ext.Panel,{initComponent:function(){Ext.applyIf(this,{plain:!0,zoomLevel:3,yaw:180,pitch:0,zoom:0,gmapType:"map",border:!1});Ext.ux.GMapPanel.superclass.initComponent.call(this)},afterRender:function(){var a=this.ownerCt.getSize();Ext.applyIf(this,a);Ext.ux.GMapPanel.superclass.afterRender.call(this);if("map"===this.gmapType)this.gmap=new GMap2(this.body.dom);if("panorama"===this.gmapType)this.gmap=new GStreetviewPanorama(this.body.dom);"object"==typeof this.addControl&&
"map"===this.gmapType&&this.gmap.addControl(this.addControl);if("object"===typeof this.setCenter){if("string"===typeof this.setCenter.geoCodeAddr)this.geoCodeLookup(this.setCenter.geoCodeAddr);else{if("map"===this.gmapType){var b=new GLatLng(this.setCenter.lat,this.setCenter.lng);this.gmap.setCenter(b,this.zoomLevel)}"object"===typeof this.setCenter.marker&&"object"===typeof b&&this.addMarker(b,this.setCenter.marker,this.setCenter.marker.clear)}"panorama"===this.gmapType&&this.gmap.setLocationAndPOV(new GLatLng(this.setCenter.lat,
this.setCenter.lng),{yaw:this.yaw,pitch:this.pitch,zoom:this.zoom})}GEvent.bind(this.gmap,"load",this,function(){this.onMapReady()})},onMapReady:function(){this.addMarkers(this.markers);this.addMapControls();this.addOptions()},onResize:function(a,b){"object"==typeof this.getMap()&&this.gmap.checkResize();Ext.ux.GMapPanel.superclass.onResize.call(this,a,b)},setSize:function(a,b,c){"object"==typeof this.getMap()&&this.gmap.checkResize();Ext.ux.GMapPanel.superclass.setSize.call(this,a,b,c)},getMap:function(){return this.gmap},
getCenter:function(){return this.getMap().getCenter()},getCenterLatLng:function(){var a=this.getCenter();return{lat:a.lat(),lng:a.lng()}},addMarkers:function(a){if(Ext.isArray(a))for(var b=0;b<a.length;b++)this.addMarker(new GLatLng(a[b].lat,a[b].lng),a[b].marker,!1,a[b].setCenter,a[b].listeners)},addMarker:function(a,b,c,d,e){Ext.applyIf(b,G_DEFAULT_ICON);!0===c&&this.getMap().clearOverlays();!0===d&&this.getMap().setCenter(a,this.zoomLevel);a=new GMarker(a,b);if("object"===typeof e)for(evt in e)GEvent.bind(a,
evt,this,e[evt]);this.getMap().addOverlay(a)},addMapControls:function(){if("map"===this.gmapType)if(Ext.isArray(this.mapControls))for(i=0;i<this.mapControls.length;i++)this.addMapControl(this.mapControls[i]);else"string"===typeof this.mapControls?this.addMapControl(this.mapControls):"object"===typeof this.mapControls&&this.getMap().addControl(this.mapControls)},addMapControl:function(a){a=window[a];"function"===typeof a&&this.getMap().addControl(new a)},addOptions:function(){if(Ext.isArray(this.mapConfOpts))for(i=
0;i<this.mapConfOpts.length;i++)this.addOption(this.mapConfOpts[i]);else"string"===typeof this.mapConfOpts&&this.addOption(this.mapConfOpts)},addOption:function(a){if("function"===typeof this.getMap()[a])this.getMap()[a]()},geoCodeLookup:function(a){this.geocoder=new GClientGeocoder;this.geocoder.getLocations(a,this.addAddressToMap.createDelegate(this))},addAddressToMap:function(a){!a||200!=a.Status.code?Ext.MessageBox.alert("Error","Code "+a.Status.code+" Error Returned"):(place=a.Placemark[0],addressinfo=
place.AddressDetails,accuracy=addressinfo.Accuracy,0===accuracy?Ext.MessageBox.alert("Unable to Locate Address","Unable to Locate the Address you provided"):7>accuracy?Ext.MessageBox.alert("Address Accuracy","The address provided has a low accuracy.<br><br>Level "+accuracy+" Accuracy (8 = Exact Match, 1 = Vague Match)"):(point=new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]),"object"===typeof this.setCenter.marker&&"object"===typeof point&&this.addMarker(point,this.setCenter.marker,
this.setCenter.marker.clear,!0,this.setCenter.listeners)))}});Ext.reg("gmappanel",Ext.ux.GMapPanel);Ext.namespace("Ext.ux.grid");
Ext.ux.grid.GridFilters=Ext.extend(Ext.util.Observable,{autoReload:!0,filterCls:"ux-filtered-column",local:!1,menuFilterText:"Filters",paramPrefix:"filter",showMenu:!0,stateId:void 0,updateBuffer:500,constructor:function(a){a=a||{};this.deferredUpdate=new Ext.util.DelayedTask(this.reload,this);this.filters=new Ext.util.MixedCollection;this.filters.getKey=function(a){return a?a.dataIndex:null};this.addFilters(a.filters);delete a.filters;Ext.apply(this,a)},init:function(a){if(a instanceof Ext.grid.GridPanel)if(this.grid=
a,this.bindStore(this.grid.getStore(),!0),0==this.filters.getCount()&&this.addFilters(this.grid.getColumnModel()),this.grid.filters=this,this.grid.addEvents({filterupdate:!0}),a.on({scope:this,beforestaterestore:this.applyState,beforestatesave:this.saveState,beforedestroy:this.destroy,reconfigure:this.onReconfigure}),a.rendered)this.onRender();else a.on({scope:this,single:!0,render:this.onRender});else if(a instanceof Ext.PagingToolbar)this.toolbar=a},applyState:function(a,b){var c,d;this.applyingState=
!0;this.clearFilters();if(b.filters)for(c in b.filters)if(d=this.filters.get(c))d.setValue(b.filters[c]),d.setActive(!0);this.deferredUpdate.cancel();this.local&&this.reload();delete this.applyingState;delete b.filters},saveState:function(a,b){var c={};this.filters.each(function(a){a.active&&(c[a.dataIndex]=a.getValue())});return b.filters=c},onRender:function(){this.grid.getView().on("refresh",this.onRefresh,this);this.createMenu()},destroy:function(){this.removeAll();this.purgeListeners();if(this.filterMenu)Ext.menu.MenuMgr.unregister(this.filterMenu),
this.filterMenu.destroy(),this.filterMenu=this.menu.menu=null},removeAll:function(){this.filters&&(Ext.destroy.apply(Ext,this.filters.items),this.filters.clear())},bindStore:function(a,b){!b&&this.store&&(this.local?a.un("load",this.onLoad,this):a.un("beforeload",this.onBeforeLoad,this));if(a)if(this.local)a.on("load",this.onLoad,this);else a.on("beforeload",this.onBeforeLoad,this);this.store=a},onReconfigure:function(){this.bindStore(this.grid.getStore());this.store.clearFilter();this.removeAll();
this.addFilters(this.grid.getColumnModel());this.updateColumnHeadings()},createMenu:function(){var a=this.grid.getView().hmenu;if(this.showMenu&&a)this.sep=a.addSeparator(),this.filterMenu=new Ext.menu.Menu({id:this.grid.id+"-filters-menu"}),this.menu=a.add({checked:!1,itemId:"filters",text:this.menuFilterText,menu:this.filterMenu}),this.menu.on({scope:this,checkchange:this.onCheckChange,beforecheckchange:this.onBeforeCheck}),a.on("beforeshow",this.onMenu,this);this.updateColumnHeadings()},getMenuFilter:function(){var a=
this.grid.getView();return!a||void 0===a.hdCtxIndex?null:this.filters.get(a.cm.config[a.hdCtxIndex].dataIndex)},onMenu:function(){var a=this.getMenuFilter();if(a)this.menu.menu=a.menu,this.menu.setChecked(a.active,!1),this.menu.setDisabled(!0===a.disabled);this.menu.setVisible(void 0!==a);this.sep.setVisible(void 0!==a)},onCheckChange:function(a,b){this.getMenuFilter().setActive(b)},onBeforeCheck:function(a,b){return!b||this.getMenuFilter().isActivatable()},onStateChange:function(a,b){"serialize"!==
a&&(b==this.getMenuFilter()&&this.menu.setChecked(b.active,!1),(this.autoReload||this.local)&&!this.applyingState&&this.deferredUpdate.delay(this.updateBuffer),this.updateColumnHeadings(),this.applyingState||this.grid.saveState(),this.grid.fireEvent("filterupdate",this,b))},onBeforeLoad:function(a,b){b.params=b.params||{};this.cleanParams(b.params);var c=this.buildQuery(this.getFilterData());Ext.apply(b.params,c)},onLoad:function(a){a.filterBy(this.getRecordFilter())},onRefresh:function(){this.updateColumnHeadings()},
updateColumnHeadings:function(){var a=this.grid.getView(),b,c,d;if(a.mainHd)for(b=0,c=a.cm.config.length;b<c;b++)d=this.getFilter(a.cm.config[b].dataIndex),Ext.fly(a.getHeaderCell(b))[d&&d.active?"addClass":"removeClass"](this.filterCls)},reload:function(){if(this.local)this.grid.store.clearFilter(!0),this.grid.store.filterBy(this.getRecordFilter());else{var a,b=this.grid.store;this.deferredUpdate.cancel();if(this.toolbar)a=b.paramNames.start,b.lastOptions&&b.lastOptions.params&&b.lastOptions.params[a]&&
(b.lastOptions.params[a]=0);b.reload()}},getRecordFilter:function(){var a=[],b,c;this.filters.each(function(b){b.active&&a.push(b)});b=a.length;return function(d){for(c=0;c<b;c++)if(!a[c].validateRecord(d))return!1;return!0}},addFilter:function(a){var b=this.getFilterClass(a.type),a=a.menu?a:new b(a);this.filters.add(a);Ext.util.Observable.capture(a,this.onStateChange,this);return a},addFilters:function(a){if(a){var b,c,d,e=!1,f;if(a instanceof Ext.grid.ColumnModel)a=a.config,e=!0;for(b=0,c=a.length;b<
c;b++){if(e){if(f=a[b].dataIndex,d=a[b].filter||a[b].filterable)d=!0===d?{}:d,Ext.apply(d,{dataIndex:f}),d.type=d.type||this.store.fields.get(f).type.type}else d=a[b];d&&this.addFilter(d)}}},getFilter:function(a){return this.filters.get(a)},clearFilters:function(){this.filters.each(function(a){a.setActive(!1)})},getFilterData:function(){var a=[],b,c;this.filters.each(function(d){if(d.active){var e=[].concat(d.serialize());for(b=0,c=e.length;b<c;b++)a.push({field:d.dataIndex,data:e[b]})}});return a},
buildQuery:function(a){var b={},c,d,e,f,g=a.length;if(this.encode){f=[];for(c=0;c<g;c++)d=a[c],f.push(Ext.apply({},{field:d.field},d.data));0<f.length&&(b[this.paramPrefix]=Ext.util.JSON.encode(f))}else for(c=0;c<g;c++)for(f in d=a[c],e=[this.paramPrefix,"[",c,"]"].join(""),b[e+"[field]"]=d.field,e+="[data]",d.data)b[[e,"[",f,"]"].join("")]=d.data[f];return b},cleanParams:function(a){if(this.encode)delete a[this.paramPrefix];else{var b,c;b=RegExp("^"+this.paramPrefix+"[[0-9]+]");for(c in a)b.test(c)&&
delete a[c]}},getFilterClass:function(a){switch(a){case "auto":a="string";break;case "int":case "float":a="numeric";break;case "bool":a="boolean"}return Ext.ux.grid.filter[a.substr(0,1).toUpperCase()+a.substr(1)+"Filter"]}});Ext.preg("gridfilters",Ext.ux.grid.GridFilters);Ext.namespace("Ext.ux.grid.filter");
Ext.ux.grid.filter.Filter=Ext.extend(Ext.util.Observable,{active:!1,dataIndex:null,menu:null,updateBuffer:500,constructor:function(a){Ext.apply(this,a);this.addEvents("activate","deactivate","serialize","update");Ext.ux.grid.filter.Filter.superclass.constructor.call(this);this.menu=new Ext.menu.Menu;this.init(a);a&&a.value&&(this.setValue(a.value),this.setActive(!1!==a.active,!0),delete a.value)},destroy:function(){this.menu&&this.menu.destroy();this.purgeListeners()},init:Ext.emptyFn,getValue:Ext.emptyFn,
setValue:Ext.emptyFn,isActivatable:function(){return!0},getSerialArgs:Ext.emptyFn,validateRecord:function(){return!0},serialize:function(){var a=this.getSerialArgs();this.fireEvent("serialize",a,this);return a},fireUpdate:function(){this.active&&this.fireEvent("update",this);this.setActive(this.isActivatable())},setActive:function(a,b){if(this.active!=a)this.active=a,!0!==b&&this.fireEvent(a?"activate":"deactivate",this)}});
Ext.ux.grid.filter.BooleanFilter=Ext.extend(Ext.ux.grid.filter.Filter,{defaultValue:!1,yesText:"Yes",noText:"No",init:function(){var a=Ext.id();this.options=[new Ext.menu.CheckItem({text:this.yesText,group:a,checked:!0===this.defaultValue}),new Ext.menu.CheckItem({text:this.noText,group:a,checked:!1===this.defaultValue})];this.menu.add(this.options[0],this.options[1]);for(a=0;a<this.options.length;a++)this.options[a].on("click",this.fireUpdate,this),this.options[a].on("checkchange",this.fireUpdate,
this)},getValue:function(){return this.options[0].checked},setValue:function(a){this.options[a?0:1].setChecked(!0)},getSerialArgs:function(){return{type:"boolean",value:this.getValue()}},validateRecord:function(a){return a.get(this.dataIndex)==this.getValue()}});
Ext.ux.grid.filter.DateFilter=Ext.extend(Ext.ux.grid.filter.Filter,{afterText:"After",beforeText:"Before",compareMap:{before:"lt",after:"gt",on:"eq"},dateFormat:"m/d/Y",menuItems:["before","after","-","on"],menuItemCfgs:{selectOnFocus:!0,width:125},onText:"On",pickerOpts:{},init:function(){var a,b,c,d,e,f;a=Ext.apply(this.pickerOpts,{minDate:this.minDate,maxDate:this.maxDate,format:this.dateFormat,listeners:{scope:this,select:this.onMenuSelect}});this.fields={};for(b=0,c=this.menuItems.length;b<c;b++){d=
this.menuItems[b];if("-"!==d)e={itemId:"range-"+d,text:this[d+"Text"],menu:new Ext.menu.DateMenu(Ext.apply(a,{itemId:d})),listeners:{scope:this,checkchange:this.onCheckChange}},f=Ext.menu.CheckItem,d=this.fields[d]=new f(e);this.menu.add(d)}},onCheckChange:function(){this.setActive(this.isActivatable());this.fireEvent("update",this)},onInputKeyUp:function(a,b){b.getKey()==b.RETURN&&a.isValid()&&(b.stopEvent(),this.menu.hide(!0))},onMenuSelect:function(a,b){var c=this.fields,d=this.fields[a.itemId];
d.setChecked(!0);d==c.on?(c.before.setChecked(!1,!0),c.after.setChecked(!1,!0)):(c.on.setChecked(!1,!0),d==c.after&&c.before.menu.picker.value<b?c.before.setChecked(!1,!0):d==c.before&&c.after.menu.picker.value>b&&c.after.setChecked(!1,!0));this.fireEvent("update",this)},getValue:function(){var a,b={};for(a in this.fields)this.fields[a].checked&&(b[a]=this.fields[a].menu.picker.getValue());return b},setValue:function(a,b){for(var c in this.fields)a[c]?(this.fields[c].menu.picker.setValue(a[c]),this.fields[c].setChecked(!0)):
b||this.fields[c].setChecked(!1);this.fireEvent("update",this)},isActivatable:function(){for(var a in this.fields)if(this.fields[a].checked)return!0;return!1},getSerialArgs:function(){var a=[],b;for(b in this.fields)this.fields[b].checked&&a.push({type:"date",comparison:this.compareMap[b],value:this.getFieldValue(b).format(this.dateFormat)});return a},getFieldValue:function(a){return this.fields[a].menu.picker.getValue()},getPicker:function(a){return this.fields[a].menu.picker},validateRecord:function(a){var b,
c=a.get(this.dataIndex);if(!Ext.isDate(c))return!1;c=c.clearTime(!0).getTime();for(b in this.fields)if(this.fields[b].checked&&(a=this.getFieldValue(b).clearTime(!0).getTime(),"before"==b&&a<=c||"after"==b&&a>=c||"on"==b&&a!=c))return!1;return!0}});
Ext.ux.grid.filter.ListFilter=Ext.extend(Ext.ux.grid.filter.Filter,{phpMode:!1,init:function(a){this.dt=new Ext.util.DelayedTask(this.fireUpdate,this);this.menu&&this.menu.destroy();this.menu=new Ext.ux.menu.ListMenu(a);this.menu.on("checkchange",this.onCheckChange,this)},getValue:function(){return this.menu.getSelected()},setValue:function(a){this.menu.setSelected(a);this.fireEvent("update",this)},isActivatable:function(){return 0<this.getValue().length},getSerialArgs:function(){return{type:"list",
value:this.phpMode?this.getValue().join(","):this.getValue()}},onCheckChange:function(){this.dt.delay(this.updateBuffer)},validateRecord:function(a){return-1<this.getValue().indexOf(a.get(this.dataIndex))}});
Ext.ux.grid.filter.NumericFilter=Ext.extend(Ext.ux.grid.filter.Filter,{fieldCls:Ext.form.NumberField,iconCls:{gt:"ux-rangemenu-gt",lt:"ux-rangemenu-lt",eq:"ux-rangemenu-eq"},menuItemCfgs:{emptyText:"Enter Filter Text...",selectOnFocus:!0,width:125},menuItems:["lt","gt","-","eq"],init:function(a){this.menu&&this.menu.destroy();this.menu=new Ext.ux.menu.RangeMenu(Ext.apply(a,{fieldCfg:this.fieldCfg||{},fieldCls:this.fieldCls,fields:this.fields||{},iconCls:this.iconCls,menuItemCfgs:this.menuItemCfgs,
menuItems:this.menuItems,updateBuffer:this.updateBuffer}));this.menu.on("update",this.fireUpdate,this)},getValue:function(){return this.menu.getValue()},setValue:function(a){this.menu.setValue(a)},isActivatable:function(){var a=this.getValue();for(key in a)if(void 0!==a[key])return!0;return!1},getSerialArgs:function(){var a,b=[],c=this.menu.getValue();for(a in c)b.push({type:"numeric",comparison:a,value:c[a]});return b},validateRecord:function(a){var a=a.get(this.dataIndex),b=this.getValue();return void 0!==
b.eq&&a!=b.eq||void 0!==b.lt&&a>=b.lt||void 0!==b.gt&&a<=b.gt?!1:!0}});
Ext.ux.grid.filter.StringFilter=Ext.extend(Ext.ux.grid.filter.Filter,{iconCls:"ux-gridfilter-text-icon",emptyText:"Enter Filter Text...",selectOnFocus:!0,width:125,init:function(a){Ext.applyIf(a,{enableKeyEvents:!0,iconCls:this.iconCls,listeners:{scope:this,keyup:this.onInputKeyUp}});this.inputItem=new Ext.form.TextField(a);this.menu.add(this.inputItem);this.updateTask=new Ext.util.DelayedTask(this.fireUpdate,this)},getValue:function(){return this.inputItem.getValue()},setValue:function(a){this.inputItem.setValue(a);
this.fireEvent("update",this)},isActivatable:function(){return 0<this.inputItem.getValue().length},getSerialArgs:function(){return{type:"string",value:this.getValue()}},validateRecord:function(a){a=a.get(this.dataIndex);return"string"!=typeof a?0===this.getValue().length:-1<a.toLowerCase().indexOf(this.getValue().toLowerCase())},onInputKeyUp:function(a,b){b.getKey()==b.RETURN&&a.isValid()?(b.stopEvent(),this.menu.hide(!0)):this.updateTask.delay(this.updateBuffer)}});Ext.namespace("Ext.ux.menu");
Ext.ux.menu.ListMenu=Ext.extend(Ext.menu.Menu,{labelField:"text",loadingText:"Loading...",loadOnShow:!0,single:!1,constructor:function(a){this.selected=[];this.addEvents("checkchange");Ext.ux.menu.ListMenu.superclass.constructor.call(this,a=a||{});if(!a.store&&a.options){for(var b=[],c=0,d=a.options.length;c<d;c++){var e=a.options[c];switch(Ext.type(e)){case "array":b.push(e);break;case "object":b.push([e.id,e[this.labelField]]);break;case "string":b.push([e,e])}}this.store=new Ext.data.Store({reader:new Ext.data.ArrayReader({id:0},
["id",this.labelField]),data:b,listeners:{load:this.onLoad,scope:this}});this.loaded=!0}else this.add({text:this.loadingText,iconCls:"loading-indicator"}),this.store.on("load",this.onLoad,this)},destroy:function(){this.store&&this.store.destroy();Ext.ux.menu.ListMenu.superclass.destroy.call(this)},show:function(){var a=null;return function(){0===arguments.length?Ext.ux.menu.ListMenu.superclass.show.apply(this,a):(a=arguments,this.loadOnShow&&!this.loaded&&this.store.load(),Ext.ux.menu.ListMenu.superclass.show.apply(this,
arguments))}}(),onLoad:function(a,b){var c=this.isVisible();this.hide(!1);this.removeAll(!0);for(var d=this.single?Ext.id():null,e=0,f=b.length;e<f;e++){var g=new Ext.menu.CheckItem({text:b[e].get(this.labelField),group:d,checked:-1<this.selected.indexOf(b[e].id),hideOnClick:!1});g.itemId=b[e].id;g.on("checkchange",this.checkChange,this);this.add(g)}this.loaded=!0;c&&this.show();this.fireEvent("load",this,b)},getSelected:function(){return this.selected},setSelected:function(a){a=this.selected=[].concat(a);
this.loaded&&this.items.each(function(b){b.setChecked(!1,!0);for(var c=0,d=a.length;c<d;c++)b.itemId==a[c]&&b.setChecked(!0,!0)},this)},checkChange:function(a,b){var c=[];this.items.each(function(a){a.checked&&c.push(a.itemId)},this);this.selected=c;this.fireEvent("checkchange",a,b)}});Ext.ns("Ext.ux.menu");
Ext.ux.menu.RangeMenu=Ext.extend(Ext.menu.Menu,{constructor:function(a){Ext.ux.menu.RangeMenu.superclass.constructor.call(this,a);this.addEvents("update");this.updateTask=new Ext.util.DelayedTask(this.fireUpdate,this);var b,c,d,e;for(a=0,b=this.menuItems.length;a<b;a++)c=this.menuItems[a],"-"!==c&&(d={itemId:"range-"+c,enableKeyEvents:!0,iconCls:this.iconCls[c]||"no-icon",listeners:{scope:this,keyup:this.onInputKeyUp}},Ext.apply(d,Ext.applyIf(this.fields[c]||{},this.fieldCfg[c]),this.menuItemCfgs),
e=d.fieldCls||this.fieldCls,c=this.fields[c]=new e(d)),this.add(c)},fireUpdate:function(){this.fireEvent("update",this)},getValue:function(){var a={},b,c;for(b in this.fields)c=this.fields[b],c.isValid()&&0<(""+c.getValue()).length&&(a[b]=c.getValue());return a},setValue:function(a){for(var b in this.fields)this.fields[b].setValue(void 0!==a[b]?a[b]:"");this.fireEvent("update",this)},onInputKeyUp:function(a,b){b.getKey()==b.RETURN&&a.isValid()?(b.stopEvent(),this.hide(!0)):(a==this.fields.eq?(this.fields.gt&&
this.fields.gt.setValue(null),this.fields.lt&&this.fields.lt.setValue(null)):this.fields.eq.setValue(null),this.updateTask.delay(this.updateBuffer))}});Ext.ns("Ext.ux.grid");
Ext.ux.grid.GroupSummary=Ext.extend(Ext.util.Observable,{constructor:function(a){Ext.apply(this,a);Ext.ux.grid.GroupSummary.superclass.constructor.call(this)},init:function(a){var b;this.grid=a;b=this.view=a.getView(),a=b;a.doGroupEnd=this.doGroupEnd.createDelegate(this);a.afterMethod("onColumnWidthUpdated",this.doWidth,this);a.afterMethod("onAllColumnWidthsUpdated",this.doAllWidths,this);a.afterMethod("onColumnHiddenUpdated",this.doHidden,this);a.afterMethod("onUpdate",this.doUpdate,this);a.afterMethod("onRemove",
this.doRemove,this);if(!this.rowTpl)this.rowTpl=new Ext.Template('<div class="x-grid3-summary-row" style="{tstyle}">','<table class="x-grid3-summary-table" border="0" cellspacing="0" cellpadding="0" style="{tstyle}">',"<tbody><tr>{cells}</tr></tbody>","</table></div>"),this.rowTpl.disableFormats=!0;this.rowTpl.compile();if(!this.cellTpl)this.cellTpl=new Ext.Template('<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} {css}" style="{style}">','<div class="x-grid3-cell-inner x-grid3-col-{id}" unselectable="on">{value}</div>',
"</td>"),this.cellTpl.disableFormats=!0;this.cellTpl.compile()},toggleSummaries:function(a){var b=this.grid.getGridEl();b&&(void 0===a&&(a=b.hasClass("x-grid-hide-summary")),b[a?"removeClass":"addClass"]("x-grid-hide-summary"))},renderSummary:function(a,b){for(var b=b||this.view.getColumnData(),c=this.grid.getColumnModel().config,d=[],e,f={},g,h=b.length-1,j=0,k=b.length;j<k;j++){e=b[j];g=c[j];f.id=e.id;f.style=e.style;f.css=0==j?"x-grid3-cell-first ":j==h?"x-grid3-cell-last ":"";f.value=g.summaryType||
g.summaryRenderer?(g.summaryRenderer||e.renderer)(a.data[e.name],f,a):"";if(void 0==f.value||""===f.value)f.value="&#160;";d[d.length]=this.cellTpl.apply(f)}return this.rowTpl.apply({tstyle:"width:"+this.view.getTotalWidth()+";",cells:d.join("")})},calculate:function(a,b){for(var c={},d,e,f=this.grid.getColumnModel().config,g,h=0,j=a.length;h<j;h++){d=a[h];for(var k=0,l=b.length;k<l;k++)e=b[k],g=f[k],g.summaryType&&(c[e.name]=Ext.ux.grid.GroupSummary.Calculations[g.summaryType](c[e.name]||0,d,e.name,
c))}return c},doGroupEnd:function(a,b,c){b=this.calculate(b.rs,c);a.push("</div>",this.renderSummary({data:b},c),"</div>")},doWidth:function(a,b,c){if(this.isGrouped())for(var d=this.view.getGroups(),e=d.length,f=0,g;f<e;++f)g=d[f].childNodes[2],g.style.width=c,g.firstChild.style.width=c,g.firstChild.rows[0].childNodes[a].style.width=b},doAllWidths:function(a,b){if(this.isGrouped())for(var c=this.view.getGroups(),d=c.length,e=0,f,g,h=a.length;e<d;e++){f=c[e].childNodes[2];f.style.width=b;f.firstChild.style.width=
b;g=f.firstChild.rows[0].childNodes;for(f=0;f<h;f++)g[f].style.width=a[f]}},doHidden:function(a,b,c){if(this.isGrouped())for(var d=this.view.getGroups(),e=d.length,f=0,g=b?"none":"";f<e;f++)b=d[f].childNodes[2],b.style.width=c,b.firstChild.style.width=c,b.firstChild.rows[0].childNodes[a].style.display=g},isGrouped:function(){return!Ext.isEmpty(this.grid.getStore().groupField)},refreshSummary:function(a){return this.refreshSummaryById(this.view.getGroupId(a))},getSummaryNode:function(a){return(a=Ext.fly(a,
"_gsummary"))?a.down(".x-grid3-summary-row",!0):null},refreshSummaryById:function(a){var b=Ext.getDom(a);if(!b)return!1;var c=[];this.grid.getStore().each(function(b){b._groupId==a&&(c[c.length]=b)});var d=this.view.getColumnData(),d=this.renderSummary({data:this.calculate(c,d)},d),e=this.getSummaryNode(a);e&&b.removeChild(e);Ext.DomHelper.append(b,d);return!0},doUpdate:function(a,b){this.refreshSummaryById(b._groupId)},doRemove:function(a,b,c,d){d||this.refreshSummaryById(b._groupId)},showSummaryMsg:function(a,
b){var c=this.getSummaryNode(this.view.getGroupId(a));if(c)c.innerHTML='<div class="x-grid3-summary-msg">'+b+"</div>"}});Ext.grid.GroupSummary=Ext.ux.grid.GroupSummary;
Ext.ux.grid.GroupSummary.Calculations={sum:function(a,b,c){return a+(b.data[c]||0)},count:function(a,b,c,d){return d[c+"count"]?++d[c+"count"]:d[c+"count"]=1},max:function(a,b,c,d){a=b.data[c];b=void 0===d[c+"max"]?d[c+"max"]=a:d[c+"max"];return a>b?d[c+"max"]=a:b},min:function(a,b,c,d){a=b.data[c];b=void 0===d[c+"min"]?d[c+"min"]=a:d[c+"min"];return a<b?d[c+"min"]=a:b},average:function(a,b,c,d){var e;a=d[c+"count"]?++d[c+"count"]:d[c+"count"]=1;e=d[c+"total"]=(d[c+"total"]||0)+(b.data[c]||0),b=e;
return 0===b?0:b/a}};Ext.grid.GroupSummary.Calculations=Ext.ux.grid.GroupSummary.Calculations;
Ext.ux.grid.HybridSummary=Ext.extend(Ext.ux.grid.GroupSummary,{calculate:function(a,b){var c=this.view.getGroupField();return this.getSummaryData(a[0].data[c])||Ext.ux.grid.HybridSummary.superclass.calculate.call(this,a,b)},updateSummaryData:function(a,b,c){var d=this.grid.getStore().reader.jsonData;if(!d.summaryData)d.summaryData={};d.summaryData[a]=b;c||this.refreshSummary(a)},getSummaryData:function(a){var b=this.grid.getStore().reader,c=b.jsonData,d=b.recordType.prototype.fields;return c&&c.summaryData&&
(a=c.summaryData[a])?b.extractValues(a,d.items,d.length):null}});Ext.grid.HybridSummary=Ext.ux.grid.HybridSummary;
Ext.ux.GroupTab=Ext.extend(Ext.Container,{mainItem:0,expanded:!0,deferredRender:!0,activeTab:null,idDelimiter:"__",headerAsText:!1,frame:!1,hideBorders:!0,initComponent:function(a){Ext.apply(this,a);this.frame=!1;Ext.ux.GroupTab.superclass.initComponent.call(this);this.addEvents("activate","deactivate","changemainitem","beforetabchange","tabchange");this.setLayout(new Ext.layout.CardLayout({deferredRender:this.deferredRender}));if(!this.stack)this.stack=Ext.TabPanel.AccessStack();this.initItems();
this.on("beforerender",function(){this.groupEl=this.ownerCt.getGroupEl(this)},this);this.on("add",this.onAdd,this,{target:this});this.on("remove",this.onRemove,this,{target:this});void 0!==this.mainItem&&(a="object"==typeof this.mainItem?this.mainItem:this.items.get(this.mainItem),delete this.mainItem,this.setMainItem(a))},setActiveTab:function(a){a=this.getComponent(a);if(!a)return!1;if(!this.rendered)return this.activeTab=a,!0;if(this.activeTab!=a&&!1!==this.fireEvent("beforetabchange",this,a,this.activeTab)){if(this.activeTab&&
this.activeTab!=this.mainItem){var b=this.getTabEl(this.activeTab);b&&Ext.fly(b).removeClass("x-grouptabs-strip-active")}b=this.getTabEl(a);Ext.fly(b).addClass("x-grouptabs-strip-active");this.activeTab=a;this.stack.add(a);this.layout.setActiveItem(a);this.layoutOnTabChange&&a.doLayout&&a.doLayout();this.scrolling&&this.scrollToTab(a,this.animScroll);this.fireEvent("tabchange",this,a);return!0}return!1},getTabEl:function(a){return a==this.mainItem?this.groupEl:Ext.TabPanel.prototype.getTabEl.call(this,
a)},onRender:function(a,b){Ext.ux.GroupTab.superclass.onRender.call(this,a,b);this.strip=Ext.fly(this.groupEl).createChild({tag:"ul",cls:"x-grouptabs-sub"});this.tooltip=new Ext.ToolTip({target:this.groupEl,delegate:"a.x-grouptabs-text",trackMouse:!0,renderTo:document.body,listeners:{beforeshow:function(a){var b=a.triggerElement.parentNode===this.mainItem.tabEl?this.mainItem:this.findById(a.triggerElement.parentNode.id.split(this.idDelimiter)[1]);if(!b.tabTip)return!1;a.body.dom.innerHTML=b.tabTip},
scope:this}});if(!this.itemTpl){var c=new Ext.Template('<li class="{cls}" id="{id}">','<a onclick="return false;" class="x-grouptabs-text {iconCls}">{text}</a>',"</li>");c.disableFormats=!0;c.compile();Ext.ux.GroupTab.prototype.itemTpl=c}this.items.each(this.initTab,this)},afterRender:function(){Ext.ux.GroupTab.superclass.afterRender.call(this);if(void 0!==this.activeTab){var a="object"==typeof this.activeTab?this.activeTab:this.items.get(this.activeTab);delete this.activeTab;this.setActiveTab(a)}},
initTab:function(a,b){var c=this.strip.dom.childNodes[b],d=Ext.TabPanel.prototype.getTemplateArgs.call(this,a);if(a===this.mainItem)a.tabEl=this.groupEl,d.cls+=" x-grouptabs-main-item";c=c?this.itemTpl.insertBefore(c,d):this.itemTpl.append(this.strip,d);a.tabEl=a.tabEl||c;a.on("disable",this.onItemDisabled,this);a.on("enable",this.onItemEnabled,this);a.on("titlechange",this.onItemTitleChanged,this);a.on("iconchange",this.onItemIconChanged,this);a.on("beforeshow",this.onBeforeShowItem,this)},setMainItem:function(a){if((a=
this.getComponent(a))&&!1!==this.fireEvent("changemainitem",this,a,this.mainItem))this.mainItem=a},getMainItem:function(){return this.mainItem||null},onBeforeShowItem:function(a){if(a!=this.activeTab)return this.setActiveTab(a),!1},onAdd:function(a,b,c){this.rendered&&this.initTab.call(this,b,c)},onRemove:function(a,b){Ext.destroy(Ext.get(this.getTabEl(b)));this.stack.remove(b);b.un("disable",this.onItemDisabled,this);b.un("enable",this.onItemEnabled,this);b.un("titlechange",this.onItemTitleChanged,
this);b.un("iconchange",this.onItemIconChanged,this);b.un("beforeshow",this.onBeforeShowItem,this);if(b==this.activeTab){var c=this.stack.next();c?this.setActiveTab(c):0<this.items.getCount()?this.setActiveTab(0):this.activeTab=null}},onBeforeAdd:function(a){if(a.events?this.items.containsKey(a.getItemId())&&a:this.items.get(a))return this.setActiveTab(a),!1;Ext.TabPanel.superclass.onBeforeAdd.apply(this,arguments);var b=a.elements;a.elements=b?b.replace(",header",""):b;a.border=!0===a.border},onItemDisabled:Ext.TabPanel.prototype.onItemDisabled,
onItemEnabled:Ext.TabPanel.prototype.onItemEnabled,onItemTitleChanged:function(a){var b=this.getTabEl(a);if(b)Ext.fly(b).child("a.x-grouptabs-text",!0).innerHTML=a.title},onItemIconChanged:function(a,b,c){(a=this.getTabEl(a))&&Ext.fly(a).child("a.x-grouptabs-text").replaceClass(c,b)},beforeDestroy:function(){Ext.TabPanel.prototype.beforeDestroy.call(this);this.tooltip.destroy()}});Ext.reg("grouptab",Ext.ux.GroupTab);Ext.ns("Ext.ux");
Ext.ux.GroupTabPanel=Ext.extend(Ext.TabPanel,{tabPosition:"left",alternateColor:!1,alternateCls:"x-grouptabs-panel-alt",defaultType:"grouptab",deferredRender:!1,activeGroup:null,initComponent:function(){Ext.ux.GroupTabPanel.superclass.initComponent.call(this);this.addEvents("beforegroupchange","groupchange");this.elements="body,header";this.stripTarget="header";this.tabPosition="right"==this.tabPosition?"right":"left";this.addClass("x-grouptabs-panel");this.tabStyle&&""!=this.tabStyle&&this.addClass("x-grouptabs-panel-"+
this.tabStyle);this.alternateColor&&this.addClass(this.alternateCls);this.on("beforeadd",function(a,b,c){this.initGroup(b,c)});this.items.each(function(a){a.on("tabchange",function(a){this.fireEvent("tabchange",this,a.activeTab)},this)},this)},initEvents:function(){this.mon(this.strip,"mousedown",this.onStripMouseDown,this)},onRender:function(a,b){Ext.TabPanel.superclass.onRender.call(this,a,b);if(this.plain){var c="top"==this.tabPosition?"header":"footer";this[c].addClass("x-tab-panel-"+c+"-plain")}this.stripWrap=
this[this.stripTarget].createChild({cls:"x-tab-strip-wrap ",cn:{tag:"ul",cls:"x-grouptabs-strip x-grouptabs-tab-strip-"+this.tabPosition}});this.strip=new Ext.Element(this.stripWrap.dom.firstChild);this.header.addClass("x-grouptabs-panel-header");this.bwrap.addClass("x-grouptabs-bwrap");this.body.addClass("x-tab-panel-body-"+this.tabPosition+" x-grouptabs-panel-body");if(!this.groupTpl)c=new Ext.Template('<li class="{cls}" id="{id}">','<a class="x-grouptabs-expand" onclick="return false;"></a>','<a class="x-grouptabs-text {iconCls}" href="#" onclick="return false;">',
"<span>{text}</span></a>","</li>"),c.disableFormats=!0,c.compile(),Ext.ux.GroupTabPanel.prototype.groupTpl=c;this.items.each(this.initGroup,this)},afterRender:function(){Ext.ux.GroupTabPanel.superclass.afterRender.call(this);this.tabJoint=Ext.fly(this.body.dom.parentNode).createChild({cls:"x-tab-joint"});this.addClass("x-tab-panel-"+this.tabPosition);this.header.setWidth(this.tabWidth);if(void 0!==this.activeGroup){var a="object"==typeof this.activeGroup?this.activeGroup:this.items.get(this.activeGroup);
delete this.activeGroup;this.setActiveGroup(a);a.setActiveTab(a.getMainItem())}},getGroupEl:Ext.TabPanel.prototype.getTabEl,findTargets:function(a){var b=null,c=a.getTarget("li",this.strip);return c&&(b=this.findById(c.id.split(this.idDelimiter)[1]),b.disabled)?{expand:null,item:null,el:null}:{expand:a.getTarget(".x-grouptabs-expand",this.strip),isGroup:!a.getTarget("ul.x-grouptabs-sub",this.strip),item:b,el:c}},onStripMouseDown:function(a){0==a.button&&(a.preventDefault(),a=this.findTargets(a),a.expand?
this.toggleGroup(a.el):a.item&&(a.isGroup?a.item.setActiveTab(a.item.getMainItem()):a.item.ownerCt.setActiveTab(a.item)))},expandGroup:function(a){a.isXType&&(a=this.getGroupEl(a));Ext.fly(a).addClass("x-grouptabs-expanded");this.syncTabJoint()},toggleGroup:function(a){a.isXType&&(a=this.getGroupEl(a));Ext.fly(a).toggleClass("x-grouptabs-expanded");this.syncTabJoint()},collapseGroup:function(a){a.isXType&&(a=this.getGroupEl(a));Ext.fly(a).removeClass("x-grouptabs-expanded");this.syncTabJoint()},syncTabJoint:function(a){if(this.tabJoint)if(a=
a||this.getGroupEl(this.activeGroup)){this.tabJoint.setHeight(Ext.fly(a).getHeight()-2);var b=Ext.isGecko2?0:1;"left"==this.tabPosition?this.tabJoint.alignTo(a,"tl-tr",[-2,b]):this.tabJoint.alignTo(a,"tr-tl",[1,b])}else this.tabJoint.hide()},getActiveTab:function(){return!this.activeGroup?null:this.activeGroup.getTabEl(this.activeGroup.activeTab)||null},onResize:function(){Ext.ux.GroupTabPanel.superclass.onResize.apply(this,arguments);this.syncTabJoint()},createCorner:function(a,b){return Ext.fly(a).createChild({cls:"x-grouptabs-corner x-grouptabs-corner-"+
b})},initGroup:function(a,b){var c=this.strip.dom.childNodes[b],d=this.getTemplateArgs(a);0===b&&(d.cls+=" x-tab-first");d.cls+=" x-grouptabs-main";d.text=a.getMainItem().title;var c=c?this.groupTpl.insertBefore(c,d):this.groupTpl.append(this.strip,d),d=this.createCorner(c,"top-"+this.tabPosition),e=this.createCorner(c,"bottom-"+this.tabPosition);a.tabEl=c;a.expanded&&this.expandGroup(c);if(Ext.isIE6||Ext.isIE&&!Ext.isStrict)e.setLeft("-10px"),e.setBottom("-5px"),d.setLeft("-10px"),d.setTop("-5px");
this.mon(a,{scope:this,changemainitem:this.onGroupChangeMainItem,beforetabchange:this.onGroupBeforeTabChange})},setActiveGroup:function(a){a=this.getComponent(a);if(!a)return!1;if(!this.rendered)return this.activeGroup=a,!0;if(this.activeGroup!=a&&!1!==this.fireEvent("beforegroupchange",this,a,this.activeGroup)){if(this.activeGroup){this.activeGroup.activeTab=null;var b=this.getGroupEl(this.activeGroup);b&&Ext.fly(b).removeClass("x-grouptabs-strip-active")}b=this.getGroupEl(a);Ext.fly(b).addClass("x-grouptabs-strip-active");
this.activeGroup=a;this.stack.add(a);this.layout.setActiveItem(a);this.syncTabJoint(b);this.fireEvent("groupchange",this,a);return!0}return!1},onGroupBeforeTabChange:function(a,b,c){(a!==this.activeGroup||b!==c)&&this.strip.select(".x-grouptabs-sub > li.x-grouptabs-strip-active",!0).removeClass("x-grouptabs-strip-active");this.expandGroup(this.getGroupEl(a));if(a!==this.activeGroup)return this.setActiveGroup(a)},getFrameHeight:function(){var a=this.el.getFrameWidth("tb");return a+=(this.tbar?this.tbar.getHeight():
0)+(this.bbar?this.bbar.getHeight():0)},adjustBodyWidth:function(a){return a-this.tabWidth}});Ext.reg("grouptabpanel",Ext.ux.GroupTabPanel);
Ext.ux.form.ItemSelector=Ext.extend(Ext.form.Field,{hideNavIcons:!1,imagePath:"",iconUp:"up2.gif",iconDown:"down2.gif",iconLeft:"left2.gif",iconRight:"right2.gif",iconTop:"top2.gif",iconBottom:"bottom2.gif",drawUpIcon:!0,drawDownIcon:!0,drawLeftIcon:!0,drawRightIcon:!0,drawTopIcon:!0,drawBotIcon:!0,delimiter:",",bodyStyle:null,border:!1,defaultAutoCreate:{tag:"div"},multiselects:null,initComponent:function(){Ext.ux.form.ItemSelector.superclass.initComponent.call(this);this.addEvents({rowdblclick:!0,
change:!0})},onRender:function(a,b){Ext.ux.form.ItemSelector.superclass.onRender.call(this,a,b);var c=[{legend:"Available",draggable:!0,droppable:!0,width:100,height:100},{legend:"Selected",droppable:!0,draggable:!0,width:100,height:100}];this.fromMultiselect=new Ext.ux.form.MultiSelect(Ext.applyIf(this.multiselects[0],c[0]));this.fromMultiselect.on("dblclick",this.onRowDblClick,this);this.toMultiselect=new Ext.ux.form.MultiSelect(Ext.applyIf(this.multiselects[1],c[1]));this.toMultiselect.on("dblclick",
this.onRowDblClick,this);c=new Ext.Panel({bodyStyle:this.bodyStyle,border:this.border,layout:"table",layoutConfig:{columns:3}});c.add(this.fromMultiselect);var d=new Ext.Panel({header:!1});c.add(d);c.add(this.toMultiselect);c.render(this.el);d.el.down("."+d.bwrapCls).remove();""!=this.imagePath&&"/"!=this.imagePath.charAt(this.imagePath.length-1)&&(this.imagePath+="/");this.iconUp=this.imagePath+(this.iconUp||"up2.gif");this.iconDown=this.imagePath+(this.iconDown||"down2.gif");this.iconLeft=this.imagePath+
(this.iconLeft||"left2.gif");this.iconRight=this.imagePath+(this.iconRight||"right2.gif");this.iconTop=this.imagePath+(this.iconTop||"top2.gif");this.iconBottom=this.imagePath+(this.iconBottom||"bottom2.gif");d=d.getEl();this.toTopIcon=d.createChild({tag:"img",src:this.iconTop,style:{cursor:"pointer",margin:"2px"}});d.createChild({tag:"br"});this.upIcon=d.createChild({tag:"img",src:this.iconUp,style:{cursor:"pointer",margin:"2px"}});d.createChild({tag:"br"});this.addIcon=d.createChild({tag:"img",
src:this.iconRight,style:{cursor:"pointer",margin:"2px"}});d.createChild({tag:"br"});this.removeIcon=d.createChild({tag:"img",src:this.iconLeft,style:{cursor:"pointer",margin:"2px"}});d.createChild({tag:"br"});this.downIcon=d.createChild({tag:"img",src:this.iconDown,style:{cursor:"pointer",margin:"2px"}});d.createChild({tag:"br"});this.toBottomIcon=d.createChild({tag:"img",src:this.iconBottom,style:{cursor:"pointer",margin:"2px"}});this.toTopIcon.on("click",this.toTop,this);this.upIcon.on("click",
this.up,this);this.downIcon.on("click",this.down,this);this.toBottomIcon.on("click",this.toBottom,this);this.addIcon.on("click",this.fromTo,this);this.removeIcon.on("click",this.toFrom,this);if(!this.drawUpIcon||this.hideNavIcons)this.upIcon.dom.style.display="none";if(!this.drawDownIcon||this.hideNavIcons)this.downIcon.dom.style.display="none";if(!this.drawLeftIcon||this.hideNavIcons)this.addIcon.dom.style.display="none";if(!this.drawRightIcon||this.hideNavIcons)this.removeIcon.dom.style.display=
"none";if(!this.drawTopIcon||this.hideNavIcons)this.toTopIcon.dom.style.display="none";if(!this.drawBotIcon||this.hideNavIcons)this.toBottomIcon.dom.style.display="none";c.body.first();this.el.setWidth(c.body.first().getWidth());c.body.removeClass();this.hiddenName=this.name;this.hiddenField=this.el.createChild({tag:"input",type:"hidden",value:"",name:this.name})},doLayout:function(){this.rendered&&(this.fromMultiselect.fs.doLayout(),this.toMultiselect.fs.doLayout())},afterRender:function(){Ext.ux.form.ItemSelector.superclass.afterRender.call(this);
this.toStore=this.toMultiselect.store;this.toStore.on("add",this.valueChanged,this);this.toStore.on("remove",this.valueChanged,this);this.toStore.on("load",this.valueChanged,this);this.valueChanged(this.toStore)},toTop:function(){var a=this.toMultiselect.view.getSelectedIndexes(),b=[];if(0<a.length){a.sort();for(var c=0;c<a.length;c++)record=this.toMultiselect.view.store.getAt(a[c]),b.push(record);a=[];for(c=b.length-1;-1<c;c--)record=b[c],this.toMultiselect.view.store.remove(record),this.toMultiselect.view.store.insert(0,
record),a.push(b.length-1-c)}this.toMultiselect.view.refresh();this.toMultiselect.view.select(a)},toBottom:function(){var a=this.toMultiselect.view.getSelectedIndexes(),b=[];if(0<a.length){a.sort();for(var c=0;c<a.length;c++)record=this.toMultiselect.view.store.getAt(a[c]),b.push(record);a=[];for(c=0;c<b.length;c++)record=b[c],this.toMultiselect.view.store.remove(record),this.toMultiselect.view.store.add(record),a.push(this.toMultiselect.view.store.getCount()-(b.length-c))}this.toMultiselect.view.refresh();
this.toMultiselect.view.select(a)},up:function(){var a=null,b=this.toMultiselect.view.getSelectedIndexes();b.sort();var c=[];if(0<b.length){for(var d=0;d<b.length;d++)a=this.toMultiselect.view.store.getAt(b[d]),0<=b[d]-1&&(this.toMultiselect.view.store.remove(a),this.toMultiselect.view.store.insert(b[d]-1,a),c.push(b[d]-1));this.toMultiselect.view.refresh();this.toMultiselect.view.select(c)}},down:function(){var a=null,b=this.toMultiselect.view.getSelectedIndexes();b.sort();b.reverse();var c=[];if(0<
b.length){for(var d=0;d<b.length;d++)a=this.toMultiselect.view.store.getAt(b[d]),b[d]+1<this.toMultiselect.view.store.getCount()&&(this.toMultiselect.view.store.remove(a),this.toMultiselect.view.store.insert(b[d]+1,a),c.push(b[d]+1));this.toMultiselect.view.refresh();this.toMultiselect.view.select(c)}},fromTo:function(){var a=this.fromMultiselect.view.getSelectedIndexes(),b=[];if(0<a.length){for(var c=0;c<a.length;c++)record=this.fromMultiselect.view.store.getAt(a[c]),b.push(record);this.allowDup||
(a=[]);for(c=0;c<b.length;c++)if(record=b[c],this.allowDup){var d=new Ext.data.Record;record.id=d.id;delete d;this.toMultiselect.view.store.add(record)}else this.fromMultiselect.view.store.remove(record),this.toMultiselect.view.store.add(record),a.push(this.toMultiselect.view.store.getCount()-1)}this.toMultiselect.view.refresh();this.fromMultiselect.view.refresh();(b=this.toMultiselect.store.sortInfo)&&this.toMultiselect.store.sort(b.field,b.direction);this.toMultiselect.view.select(a)},toFrom:function(){var a=
this.toMultiselect.view.getSelectedIndexes(),b=[];if(0<a.length){for(var c=0;c<a.length;c++)record=this.toMultiselect.view.store.getAt(a[c]),b.push(record);a=[];for(c=0;c<b.length;c++)record=b[c],this.toMultiselect.view.store.remove(record),this.allowDup||(this.fromMultiselect.view.store.add(record),a.push(this.fromMultiselect.view.store.getCount()-1))}this.fromMultiselect.view.refresh();this.toMultiselect.view.refresh();(b=this.fromMultiselect.store.sortInfo)&&this.fromMultiselect.store.sort(b.field,
b.direction);this.fromMultiselect.view.select(a)},valueChanged:function(a){for(var b=null,c=[],d=0;d<a.getCount();d++)b=a.getAt(d),c.push(b.get(this.toMultiselect.valueField));this.hiddenField.dom.value=c.join(this.delimiter);this.fireEvent("change",this,this.getValue(),this.hiddenField.dom.value)},getValue:function(){return this.hiddenField.dom.value},onRowDblClick:function(a,b,c,d){a==this.toMultiselect.view?this.toFrom():a==this.fromMultiselect.view&&this.fromTo();return this.fireEvent("rowdblclick",
a,b,c,d)},reset:function(){range=this.toMultiselect.store.getRange();this.toMultiselect.store.removeAll();this.fromMultiselect.store.add(range);var a=this.fromMultiselect.store.sortInfo;a&&this.fromMultiselect.store.sort(a.field,a.direction);this.valueChanged(this.toMultiselect.store)}});Ext.reg("itemselector",Ext.ux.form.ItemSelector);Ext.ux.ItemSelector=Ext.ux.form.ItemSelector;Ext.ns("Ext.ux.grid");
Ext.ux.grid.LockingGridView=Ext.extend(Ext.grid.GridView,{lockText:"Lock",unlockText:"Unlock",rowBorderWidth:1,lockedBorderWidth:1,syncHeights:!1,initTemplates:function(){var a=this.templates||{};if(!a.masterTpl)a.masterTpl=new Ext.Template('<div class="x-grid3" hidefocus="true">','<div class="x-grid3-locked">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset" style="{lstyle}">{lockedHeader}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body" style="{lstyle}">{lockedBody}</div><div class="x-grid3-scroll-spacer"></div></div>',
"</div>",'<div class="x-grid3-viewport x-grid3-unlocked">','<div class="x-grid3-header"><div class="x-grid3-header-inner"><div class="x-grid3-header-offset" style="{ostyle}">{header}</div></div><div class="x-clear"></div></div>','<div class="x-grid3-scroller"><div class="x-grid3-body" style="{bstyle}">{body}</div><a href="#" class="x-grid3-focus" tabIndex="-1"></a></div>',"</div>",'<div class="x-grid3-resize-marker">&#160;</div>','<div class="x-grid3-resize-proxy">&#160;</div>',"</div>");this.templates=
a;Ext.ux.grid.LockingGridView.superclass.initTemplates.call(this)},getEditorParent:function(){return this.el.dom},initElements:function(){var a=Ext.get(this.grid.getGridEl().dom.firstChild),b=a.child("div.x-grid3-locked"),c=b.child("div.x-grid3-header"),d=b.child("div.x-grid3-scroller"),e=a.child("div.x-grid3-viewport"),f=e.child("div.x-grid3-header"),g=e.child("div.x-grid3-scroller");this.grid.hideHeaders&&(c.setDisplayed(!1),f.setDisplayed(!1));this.forceFit&&g.setStyle("overflow-x","hidden");Ext.apply(this,
{el:a,mainWrap:e,mainHd:f,innerHd:f.dom.firstChild,scroller:g,mainBody:g.child("div.x-grid3-body"),focusEl:g.child("a"),resizeMarker:a.child("div.x-grid3-resize-marker"),resizeProxy:a.child("div.x-grid3-resize-proxy"),lockedWrap:b,lockedHd:c,lockedScroller:d,lockedBody:d.child("div.x-grid3-body"),lockedInnerHd:c.child("div.x-grid3-header-inner",!0)});this.focusEl.swallowEvent("click",!0)},getLockedRows:function(){return this.hasRows()?this.lockedBody.dom.childNodes:[]},getLockedRow:function(a){return this.getLockedRows()[a]},
getCell:function(a,b){var c=this.cm.getLockedCount();return b<c?this.getLockedRow(a).getElementsByTagName("td")[b]:Ext.ux.grid.LockingGridView.superclass.getCell.call(this,a,b-c)},getHeaderCell:function(a){var b=this.cm.getLockedCount();return a<b?this.lockedHd.dom.getElementsByTagName("td")[a]:Ext.ux.grid.LockingGridView.superclass.getHeaderCell.call(this,a-b)},addRowClass:function(a,b){var c=this.getLockedRow(a);c&&this.fly(c).addClass(b);Ext.ux.grid.LockingGridView.superclass.addRowClass.call(this,
a,b)},removeRowClass:function(a,b){var c=this.getLockedRow(a);c&&this.fly(c).removeClass(b);Ext.ux.grid.LockingGridView.superclass.removeRowClass.call(this,a,b)},removeRow:function(a){Ext.removeNode(this.getLockedRow(a));Ext.ux.grid.LockingGridView.superclass.removeRow.call(this,a)},removeRows:function(a,b){for(var c=this.lockedBody.dom,d=a;d<=b;d++)Ext.removeNode(c.childNodes[a]);Ext.ux.grid.LockingGridView.superclass.removeRows.call(this,a,b)},syncScroll:function(a){this.lockedScroller.dom.scrollTop=
this.scroller.dom.scrollTop;Ext.ux.grid.LockingGridView.superclass.syncScroll.call(this,a)},updateSortIcon:function(a,b){var c=this.sortClasses,d=this.lockedHd.select("td").removeClass(c),e=this.mainHd.select("td").removeClass(c),f=this.cm.getLockedCount(),c=c["DESC"==b?1:0];a<f?d.item(a).addClass(c):e.item(a-f).addClass(c)},updateAllColumnWidths:function(){var a=this.getTotalWidth(),b=this.cm.getColumnCount(),c=this.getLockedWidth(),d=this.cm.getLockedCount(),e=[],f,g;this.updateLockedWidth();for(g=
0;g<b;g++)e[g]=this.getColumnWidth(g),this.getHeaderCell(g).style.width=e[g];var h=this.getLockedRows(),j=this.getRows(),k,l;for(g=0,f=j.length;g<f;g++){k=h[g];k.style.width=c;if(k.firstChild){k.firstChild.style.width=c;k=k.firstChild.rows[0];for(l=0;l<d;l++)k.childNodes[l].style.width=e[l]}k=j[g];k.style.width=a;if(k.firstChild){k.firstChild.style.width=a;k=k.firstChild.rows[0];for(l=d;l<b;l++)k.childNodes[l-d].style.width=e[l]}}this.onAllColumnWidthsUpdated(e,a);this.syncHeaderHeight()},updateColumnWidth:function(a){var b=
this.getColumnWidth(a),c=this.cm.getLockedCount(),d,e,f;this.updateLockedWidth();a<c?(d=this.getLockedRows(),e=this.getLockedWidth(),c=a):(d=this.getRows(),e=this.getTotalWidth(),c=a-c);this.getHeaderCell(a).style.width=b;for(var g=0,h=d.length;g<h;g++)if(f=d[g],f.style.width=e,f.firstChild)f.firstChild.style.width=e,f.firstChild.rows[0].childNodes[c].style.width=b;this.onColumnWidthUpdated(a,b,this.getTotalWidth());this.syncHeaderHeight()},updateColumnHidden:function(a,b){var c=this.cm.getLockedCount(),
d,e,f,g=b?"none":"";this.updateLockedWidth();a<c?(d=this.getLockedRows(),e=this.getLockedWidth(),c=a):(d=this.getRows(),e=this.getTotalWidth(),c=a-c);this.getHeaderCell(a).style.display=g;for(var h=0,j=d.length;h<j;h++)if(f=d[h],f.style.width=e,f.firstChild)f.firstChild.style.width=e,f.firstChild.rows[0].childNodes[c].style.display=g;this.onColumnHiddenUpdated(a,b,this.getTotalWidth());delete this.lastViewWidth;this.layout()},doRender:function(a,b,c,d,e,f){for(var g=this.templates,h=g.cell,g=g.row,
j=e-1,k="width:"+this.getTotalWidth()+";",l="width:"+this.getLockedWidth()+";",n=[],m=[],o,q,r,s={},t={},u,w=0,z=b.length;w<z;w++){u=b[w];o=[];q=[];for(var x=w+d,v=0;v<e;v++){r=a[v];s.id=r.id;s.css=(0===v?"x-grid3-cell-first ":v==j?"x-grid3-cell-last ":"")+(this.cm.config[v].cellCls?" "+this.cm.config[v].cellCls:"");s.attr=s.cellAttr="";s.value=r.renderer(u.data[r.name],s,u,x,v,c);s.style=r.style;if(Ext.isEmpty(s.value))s.value="&#160;";this.markDirty&&u.dirty&&Ext.isDefined(u.modified[r.name])&&
(s.css+=" x-grid3-dirty-cell");r.locked?q[q.length]=h.apply(s):o[o.length]=h.apply(s)}r=[];f&&0===(x+1)%2&&(r[0]="x-grid3-row-alt");u.dirty&&(r[1]=" x-grid3-dirty-row");t.cols=e;this.getRowClass&&(r[2]=this.getRowClass(u,x,t,c));t.alt=r.join(" ");t.cells=o.join("");t.tstyle=k;n[n.length]=g.apply(t);t.cells=q.join("");t.tstyle=l;m[m.length]=g.apply(t)}return[n.join(""),m.join("")]},processRows:function(a,b){if(this.ds&&!(1>this.ds.getCount())){for(var c=this.getRows(),d=this.getLockedRows(),e,f,b=
b||!this.grid.stripeRows,a=a||0,g=0,h=c.length;g<h;++g){e=c[g];f=d[g];e.rowIndex=g;f.rowIndex=g;if(!b)e.className=e.className.replace(this.rowClsRe," "),f.className=f.className.replace(this.rowClsRe," "),0===(g+1)%2&&(e.className+=" x-grid3-row-alt",f.className+=" x-grid3-row-alt");this.syncRowHeights(e,f)}0===a&&(Ext.fly(c[0]).addClass(this.firstRowCls),Ext.fly(d[0]).addClass(this.firstRowCls));Ext.fly(c[c.length-1]).addClass(this.lastRowCls);Ext.fly(d[d.length-1]).addClass(this.lastRowCls)}},syncRowHeights:function(a,
b){if(this.syncHeights){var c=Ext.get(a),d=Ext.get(b),e=c.getHeight(),f=d.getHeight();e>f?d.setHeight(e):f>e&&c.setHeight(f)}},afterRender:function(){if(this.ds&&this.cm){var a=this.renderRows()||["&#160;","&#160;"];this.mainBody.dom.innerHTML=a[0];this.lockedBody.dom.innerHTML=a[1];this.processRows(0,!0);!0!==this.deferEmptyText&&this.applyEmptyText();this.grid.fireEvent("viewready",this.grid)}},renderUI:function(){var a=this.templates,b=this.renderHeaders(),c=a.body.apply({rows:"&#160;"});return a.masterTpl.apply({body:c,
header:b[0],ostyle:"width:"+this.getOffsetWidth()+";",bstyle:"width:"+this.getTotalWidth()+";",lockedBody:c,lockedHeader:b[1],lstyle:"width:"+this.getLockedWidth()+";"})},afterRenderUI:function(){var a=this.grid;this.initElements();Ext.fly(this.innerHd).on("click",this.handleHdDown,this);Ext.fly(this.lockedInnerHd).on("click",this.handleHdDown,this);this.mainHd.on({scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.lockedHd.on({scope:this,mouseover:this.handleHdOver,
mouseout:this.handleHdOut,mousemove:this.handleHdMove});this.scroller.on("scroll",this.syncScroll,this);if(!1!==a.enableColumnResize)this.splitZone=new Ext.grid.GridView.SplitDragZone(a,this.mainHd.dom),this.splitZone.setOuterHandleElId(Ext.id(this.lockedHd.dom)),this.splitZone.setOuterHandleElId(Ext.id(this.mainHd.dom));if(a.enableColumnMove)this.columnDrag=new Ext.grid.GridView.ColumnDragZone(a,this.innerHd),this.columnDrag.setOuterHandleElId(Ext.id(this.lockedInnerHd)),this.columnDrag.setOuterHandleElId(Ext.id(this.innerHd)),
this.columnDrop=new Ext.grid.HeaderDropZone(a,this.mainHd.dom);if(!1!==a.enableHdMenu){this.hmenu=new Ext.menu.Menu({id:a.id+"-hctx"});this.hmenu.add({itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});!1!==this.grid.enableColLock&&this.hmenu.add("-",{itemId:"lock",text:this.lockText,cls:"xg-hmenu-lock"},{itemId:"unlock",text:this.unlockText,cls:"xg-hmenu-unlock"});if(!1!==a.enableColumnHide)this.colMenu=new Ext.menu.Menu({id:a.id+
"-hcols-menu"}),this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick}),this.hmenu.add("-",{itemId:"columns",hideOnClick:!1,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"});this.hmenu.on("itemclick",this.handleHdMenuClick,this)}a.trackMouseOver&&(this.mainBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut}),this.lockedBody.on({scope:this,mouseover:this.onRowOver,mouseout:this.onRowOut}));if(a.enableDragDrop||a.enableDrag)this.dragZone=
new Ext.grid.GridDragZone(a,{ddGroup:a.ddGroup||"GridDD"});this.updateHeaderSortState()},layout:function(){if(this.mainBody){var a=this.grid,b=a.getGridEl().getSize(!0),c=b.width;if(a.hideHeaders||!(20>c||20>b.height)){this.syncHeaderHeight();if(a.autoHeight){if(this.scroller.dom.style.overflow="visible",this.lockedScroller.dom.style.overflow="visible",Ext.isWebKit)this.scroller.dom.style.position="static",this.lockedScroller.dom.style.position="static"}else{this.el.setSize(b.width,b.height);var a=
this.mainHd.getHeight(),d=b.height-a}this.updateLockedWidth();if(this.forceFit){if(this.lastViewWidth!=c)this.fitColumns(!1,!1),this.lastViewWidth=c}else this.autoExpand(),this.syncHeaderScroll();this.onLayout(c,d)}}},getOffsetWidth:function(){return this.cm.getTotalWidth()-this.cm.getTotalLockedWidth()+this.getScrollOffset()+"px"},renderHeaders:function(){for(var a=this.cm,b=this.templates,c=b.hcell,d=[],e=[],f={},g=a.getColumnCount(),h=g-1,j=0;j<g;j++)f.id=a.getColumnId(j),f.value=a.getColumnHeader(j)||
"",f.style=this.getColumnStyle(j,!0),f.tooltip=this.getColumnTooltip(j),f.css=(0===j?"x-grid3-cell-first ":j==h?"x-grid3-cell-last ":"")+(a.config[j].headerCls?" "+a.config[j].headerCls:""),"right"==a.config[j].align?f.istyle="padding-right:16px":delete f.istyle,a.isLocked(j)?e[e.length]=c.apply(f):d[d.length]=c.apply(f);return[b.header.apply({cells:d.join(""),tstyle:"width:"+this.getTotalWidth()+";"}),b.header.apply({cells:e.join(""),tstyle:"width:"+this.getLockedWidth()+";"})]},updateHeaders:function(){var a=
this.renderHeaders();this.innerHd.firstChild.innerHTML=a[0];this.innerHd.firstChild.style.width=this.getOffsetWidth();this.innerHd.firstChild.firstChild.style.width=this.getTotalWidth();this.lockedInnerHd.firstChild.innerHTML=a[1];a=this.getLockedWidth();this.lockedInnerHd.firstChild.style.width=a;this.lockedInnerHd.firstChild.firstChild.style.width=a},getResolvedXY:function(a){if(!a)return null;var b=a.cell,a=a.row;return b?Ext.fly(b).getXY():[this.scroller.getX(),Ext.fly(a).getY()]},syncFocusEl:function(a,
b,c){Ext.ux.grid.LockingGridView.superclass.syncFocusEl.call(this,a,b,b<this.cm.getLockedCount()?!1:c)},ensureVisible:function(a,b,c){return Ext.ux.grid.LockingGridView.superclass.ensureVisible.call(this,a,b,b<this.cm.getLockedCount()?!1:c)},insertRows:function(a,b,c,d){a=a.getCount()-1;if(!d&&0===b&&c>=a)this.refresh();else{d||this.fireEvent("beforerowsinserted",this,b,c);var e=this.renderRows(b,c),f=this.getRow(b);f?(0===b&&this.removeRowClass(0,this.firstRowCls),Ext.DomHelper.insertHtml("beforeBegin",
f,e[0]),f=this.getLockedRow(b),Ext.DomHelper.insertHtml("beforeBegin",f,e[1])):(this.removeRowClass(a-1,this.lastRowCls),Ext.DomHelper.insertHtml("beforeEnd",this.mainBody.dom,e[0]),Ext.DomHelper.insertHtml("beforeEnd",this.lockedBody.dom,e[1]));if(d){if(0===b||b>=a)this.addRowClass(b,0===b?this.firstRowCls:this.lastRowCls)}else this.fireEvent("rowsinserted",this,b,c),this.processRows(b)}this.syncFocusEl(b)},getColumnStyle:function(a,b){var c=!b?this.cm.config[a].cellStyle||this.cm.config[a].css||
"":this.cm.config[a].headerStyle||"",c=c+("width:"+this.getColumnWidth(a)+";");this.cm.isHidden(a)&&(c+="display:none;");var d=this.cm.config[a].align;d&&(c+="text-align:"+d+";");return c},getLockedWidth:function(){return this.cm.getTotalLockedWidth()+"px"},getTotalWidth:function(){return this.cm.getTotalWidth()-this.cm.getTotalLockedWidth()+"px"},getColumnData:function(){for(var a=[],b=this.cm,c=b.getColumnCount(),d=0;d<c;d++){var e=b.getDataIndex(d);a[d]={name:!Ext.isDefined(e)?this.ds.fields.get(d).name:
e,renderer:b.getRenderer(d),scope:b.getRendererScope(d),id:b.getColumnId(d),style:this.getColumnStyle(d),locked:b.isLocked(d)}}return a},renderBody:function(){var a=this.renderRows()||["&#160;","&#160;"];return[this.templates.body.apply({rows:a[0]}),this.templates.body.apply({rows:a[1]})]},refreshRow:function(a){var b=this.ds,c=this.cm.getColumnCount(),d=this.getColumnData(),e=c-1,f=["x-grid3-row"],g={tstyle:String.format("width: {0};",this.getTotalWidth())},h={tstyle:String.format("width: {0};",
this.getLockedWidth())},j=[],k=[],l=this.templates.cell,n,m,o,q;Ext.isNumber(a)?(n=a,a=b.getAt(n)):n=b.indexOf(a);if(a&&!(0>n)){for(q=0;q<c;q++){m=d[q];o=0==q?"x-grid3-cell-first":q==e?"x-grid3-cell-last ":"";o={id:m.id,style:m.style,css:o,attr:"",cellAttr:""};o.value=m.renderer.call(m.scope,a.data[m.name],o,a,n,q,b);if(Ext.isEmpty(o.value))o.value=" ";this.markDirty&&a.dirty&&"undefined"!=typeof a.modified[m.name]&&(o.css+=" x-grid3-dirty-cell");m.locked?k[q]=l.apply(o):j[q]=l.apply(o)}d=this.getRow(n);
d.className="";e=this.getLockedRow(n);e.className="";this.grid.stripeRows&&0===(n+1)%2&&f.push("x-grid3-row-alt");if(this.getRowClass)g.cols=c,f.push(this.getRowClass(a,n,g,b));this.fly(d).addClass(f).setStyle(g.tstyle);g.cells=j.join("");d.innerHTML=this.templates.rowInner.apply(g);this.fly(e).addClass(f).setStyle(h.tstyle);h.cells=k.join("");e.innerHTML=this.templates.rowInner.apply(h);e.rowIndex=n;this.syncRowHeights(d,e);this.fireEvent("rowupdated",this,n,a)}},refresh:function(a){this.fireEvent("beforerefresh",
this);this.grid.stopEditing(!0);var b=this.renderBody();this.mainBody.update(b[0]).setWidth(this.getTotalWidth());this.lockedBody.update(b[1]).setWidth(this.getLockedWidth());!0===a&&(this.updateHeaders(),this.updateHeaderSortState());this.processRows(0,!0);this.layout();this.applyEmptyText();this.fireEvent("refresh",this)},onDenyColumnLock:function(){},initData:function(a,b){this.cm&&this.cm.un("columnlockchange",this.onColumnLock,this);Ext.ux.grid.LockingGridView.superclass.initData.call(this,a,
b);if(this.cm)this.cm.on("columnlockchange",this.onColumnLock,this)},onColumnLock:function(){this.refresh(!0)},handleHdMenuClick:function(a){var b=this.hdCtxIndex,c=this.cm,d=a.getItemId(),e=c.getLockedCount();switch(d){case "lock":if(c.getColumnCount(!0)<=e+1){this.onDenyColumnLock();return}c.setLocked(b,!0,e!=b);e!=b&&(c.moveColumn(b,e),this.grid.fireEvent("columnmove",b,e));break;case "unlock":e-1!=b?(c.setLocked(b,!1,!0),c.moveColumn(b,e-1),this.grid.fireEvent("columnmove",b,e-1)):c.setLocked(b,
!1);break;default:return Ext.ux.grid.LockingGridView.superclass.handleHdMenuClick.call(this,a)}return!0},handleHdDown:function(a,b){Ext.ux.grid.LockingGridView.superclass.handleHdDown.call(this,a,b);if(!1!==this.grid.enableColLock&&Ext.fly(b).hasClass("x-grid3-hd-btn")){var c=this.getCellIndex(this.findHeaderCell(b)),d=this.hmenu.items,e=this.cm;d.get("lock").setDisabled(e.isLocked(c));d.get("unlock").setDisabled(!e.isLocked(c))}},syncHeaderHeight:function(){var a=Ext.fly(this.innerHd).child("tr",
!0),b=Ext.fly(this.lockedInnerHd).child("tr",!0);a.style.height="auto";b.style.height="auto";var c=Math.max(b.offsetHeight,a.offsetHeight)+"px";a.style.height=c;b.style.height=c},updateLockedWidth:function(){var a=this.cm.getTotalLockedWidth(),b=this.cm.getTotalWidth()-a,c=this.grid.getGridEl().getSize(!0),d=Ext.isBorderBox?0:this.lockedBorderWidth,e=Ext.isBorderBox?0:this.rowBorderWidth,f=Math.max(c.width-a-d-e,0)+"px",g=this.getScrollOffset();if(!this.grid.autoHeight)c=Math.max(c.height-this.mainHd.getHeight(),
0)+"px",this.lockedScroller.dom.style.height=c,this.scroller.dom.style.height=c;this.lockedWrap.dom.style.width=a+e+"px";this.scroller.dom.style.width=f;this.mainWrap.dom.style.left=a+d+e+"px";if(this.innerHd)this.lockedInnerHd.firstChild.style.width=a+"px",this.lockedInnerHd.firstChild.firstChild.style.width=a+"px",this.innerHd.style.width=f,this.innerHd.firstChild.style.width=b+e+g+"px",this.innerHd.firstChild.firstChild.style.width=b+"px";if(this.mainBody)this.lockedBody.dom.style.width=a+e+"px",
this.mainBody.dom.style.width=b+e+"px"}});
Ext.ux.grid.LockingColumnModel=Ext.extend(Ext.grid.ColumnModel,{isLocked:function(a){return!0===this.config[a].locked},setLocked:function(a,b,c){if(this.isLocked(a)!=b)this.config[a].locked=b,c||this.fireEvent("columnlockchange",this,a,b)},getTotalLockedWidth:function(){for(var a=0,b=0,c=this.config.length;b<c;b++)this.isLocked(b)&&!this.isHidden(b)&&(a+=this.getColumnWidth(b));return a},getLockedCount:function(){for(var a=this.config.length,b=0;b<a;b++)if(!this.isLocked(b))return b;return a},moveColumn:function(a,
b){var c=this.isLocked(a),d=this.isLocked(b);a<b&&c&&!d?this.setLocked(a,!1,!0):a>b&&!c&&d&&this.setLocked(a,!0,!0);Ext.ux.grid.LockingColumnModel.superclass.moveColumn.apply(this,arguments)}});Ext.ns("Ext.ux.form");
Ext.ux.form.MultiSelect=Ext.extend(Ext.form.Field,{ddReorder:!1,appendOnly:!1,width:100,height:100,displayField:0,valueField:1,allowBlank:!0,minSelections:0,maxSelections:Number.MAX_VALUE,blankText:Ext.form.TextField.prototype.blankText,minSelectionsText:"Minimum {0} item(s) required",maxSelectionsText:"Maximum {0} item(s) allowed",delimiter:",",cls:"ux-form-multiselect",defaultAutoCreate:{tag:"div"},initComponent:function(){Ext.ux.form.MultiSelect.superclass.initComponent.call(this);Ext.isArray(this.store)?
(Ext.isArray(this.store[0])?(this.store=new Ext.data.ArrayStore({fields:["value","text"],data:this.store}),this.valueField="value"):(this.store=new Ext.data.ArrayStore({fields:["text"],data:this.store,expandData:!0}),this.valueField="text"),this.displayField="text"):this.store=Ext.StoreMgr.lookup(this.store);this.addEvents({dblclick:!0,click:!0,change:!0,drop:!0})},onRender:function(a,b){Ext.ux.form.MultiSelect.superclass.onRender.call(this,a,b);var c=this.fs=new Ext.form.FieldSet({renderTo:this.el,
title:this.legend,height:this.height,width:this.width,style:"padding:0;",tbar:this.tbar});c.body.addClass("ux-mselect");this.view=new Ext.ListView({selectedClass:"ux-mselect-selected",multiSelect:!0,store:this.store,columns:[{header:"Value",width:1,dataIndex:this.displayField}],hideHeaders:!0});c.add(this.view);this.view.on("click",this.onViewClick,this);this.view.on("beforeclick",this.onViewBeforeClick,this);this.view.on("dblclick",this.onViewDblClick,this);this.hiddenName=this.name||Ext.id();this.hiddenField=
this.el.createChild({tag:"input",type:"hidden",value:"",name:this.hiddenName});this.hiddenField.dom.disabled=this.hiddenName!=this.name;c.doLayout()},afterRender:function(){Ext.ux.form.MultiSelect.superclass.afterRender.call(this);if(this.ddReorder&&!this.dragGroup&&!this.dropGroup)this.dragGroup=this.dropGroup="MultiselectDD-"+Ext.id();if(this.draggable||this.dragGroup)this.dragZone=new Ext.ux.form.MultiSelect.DragZone(this,{ddGroup:this.dragGroup});if(this.droppable||this.dropGroup)this.dropZone=
new Ext.ux.form.MultiSelect.DropZone(this,{ddGroup:this.dropGroup})},onViewClick:function(a,b,c,d){this.fireEvent("change",this,this.getValue(),this.hiddenField.dom.value);this.hiddenField.dom.value=this.getValue();this.fireEvent("click",this,d);this.validate()},onViewBeforeClick:function(){if(this.disabled||this.readOnly)return!1},onViewDblClick:function(a,b,c,d){return this.fireEvent("dblclick",a,b,c,d)},getValue:function(a){var b=[],c=this.view.getSelectedIndexes();if(0==c.length)return"";for(var d=
0;d<c.length;d++)b.push(this.store.getAt(c[d]).get(null!=a?a:this.valueField));return b.join(this.delimiter)},setValue:function(a){var b,c=[];this.view.clearSelections();this.hiddenField.dom.value="";if(a&&""!=a){Ext.isArray(a)||(a=a.split(this.delimiter));for(var d=0;d<a.length;d++)b=this.view.store.indexOf(this.view.store.query(this.valueField,RegExp("^"+a[d]+"$","i")).itemAt(0)),c.push(b);this.view.select(c);this.hiddenField.dom.value=this.getValue();this.validate()}},reset:function(){this.setValue("")},
getRawValue:function(a){a=this.getValue(a);return a=a.length?a.split(this.delimiter):[]},setRawValue:function(a){setValue(a)},validateValue:function(a){if(1>a.length){if(this.allowBlank)return this.clearInvalid(),!0;this.markInvalid(this.blankText);return!1}if(a.length<this.minSelections)return this.markInvalid(String.format(this.minSelectionsText,this.minSelections)),!1;return a.length>this.maxSelections?(this.markInvalid(String.format(this.maxSelectionsText,this.maxSelections)),!1):!0},disable:function(){this.disabled=
!0;this.hiddenField.dom.disabled=!0;this.fs.disable()},enable:function(){this.disabled=!1;this.hiddenField.dom.disabled=!1;this.fs.enable()},destroy:function(){Ext.destroy(this.fs,this.dragZone,this.dropZone);Ext.ux.form.MultiSelect.superclass.destroy.call(this)}});Ext.reg("multiselect",Ext.ux.form.MultiSelect);Ext.ux.Multiselect=Ext.ux.form.MultiSelect;
Ext.ux.form.MultiSelect.DragZone=function(a,b){this.ms=a;this.view=a.view;var c=b.ddGroup||"MultiselectDD",d;Ext.isArray(c)?d=c.shift():(d=c,c=null);Ext.ux.form.MultiSelect.DragZone.superclass.constructor.call(this,this.ms.fs.body,{containerScroll:!0,ddGroup:d});this.setDraggable(c)};
Ext.extend(Ext.ux.form.MultiSelect.DragZone,Ext.dd.DragZone,{onInitDrag:function(a,b){var c=Ext.get(this.dragData.ddel.cloneNode(!0));this.proxy.update(c.dom);c.setWidth(c.child("em").getWidth());this.onStartDrag(a,b);return!0},collectSelection:function(a){a.repairXY=Ext.fly(this.view.getSelectedNodes()[0]).getXY();var b=0;this.view.store.each(function(){if(this.view.isSelected(b)){var c=this.view.getNode(b),d=c.cloneNode(!0);d.id=Ext.id();a.ddel.appendChild(d);a.records.push(this.view.store.getAt(b));
a.viewNodes.push(c)}b++},this)},onEndDrag:function(){var a=Ext.get(this.dragData.ddel);a&&a.hasClass("multi-proxy")&&a.remove()},getDragData:function(a){var b=this.view.findItemFromChild(a.getTarget());if(b){!this.view.isSelected(b)&&!a.ctrlKey&&!a.shiftKey&&(this.view.select(b),this.ms.setValue(this.ms.getValue()));if(0==this.view.getSelectionCount()||a.ctrlKey||a.shiftKey)return!1;a={sourceView:this.view,viewNodes:[],records:[]};if(1==this.view.getSelectionCount()){var b=this.view.getSelectedIndexes()[0],
c=this.view.getNode(b);a.viewNodes.push(a.ddel=c);a.records.push(this.view.store.getAt(b));a.repairXY=Ext.fly(c).getXY()}else a.ddel=document.createElement("div"),a.ddel.className="multi-proxy",this.collectSelection(a);return a}return!1},getRepairXY:function(){return this.dragData.repairXY},setDraggable:function(a){a&&(Ext.isArray(a)?Ext.each(a,this.setDraggable,this):this.addToGroup(a))}});
Ext.ux.form.MultiSelect.DropZone=function(a,b){this.ms=a;this.view=a.view;var c=b.ddGroup||"MultiselectDD",d;Ext.isArray(c)?d=c.shift():(d=c,c=null);Ext.ux.form.MultiSelect.DropZone.superclass.constructor.call(this,this.ms.fs.body,{containerScroll:!0,ddGroup:d});this.setDroppable(c)};
Ext.extend(Ext.ux.form.MultiSelect.DropZone,Ext.dd.DropZone,{getTargetFromEvent:function(a){return a.getTarget()},getDropPoint:function(a,b){if(b==this.ms.fs.body.dom)return"below";var c=Ext.lib.Dom.getY(b),c=c+(c+b.offsetHeight-c)/2;return Ext.lib.Event.getPageY(a)<=c?"above":"below"},isValidDropPoint:function(a,b,c){if(!c.viewNodes||1!=c.viewNodes.length)return!0;c=c.viewNodes[0];return c==b||"below"==a&&b.nextSibling==c||"above"==a&&b.previousSibling==c?!1:!0},onNodeEnter:function(){return!1},
onNodeOver:function(a,b,c,d){var e=this.dropNotAllowed,b=this.getDropPoint(c,a,b);if(this.isValidDropPoint(b,a,d)){if(this.ms.appendOnly)return"x-tree-drop-ok-below";if(b&&("above"==b?(e=a.previousSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-above",d="x-view-drag-insert-above"):(e=a.nextSibling?"x-tree-drop-ok-between":"x-tree-drop-ok-below",d="x-view-drag-insert-below"),this.lastInsertClass!=d))Ext.fly(a).replaceClass(this.lastInsertClass,d),this.lastInsertClass=d}return e},onNodeOut:function(a){this.removeDropIndicators(a)},
onNodeDrop:function(a,b,c,d){if(!1===this.ms.fireEvent("drop",this,a,b,c,d))return!1;c=this.getDropPoint(c,a,b);a!=this.ms.fs.body.dom&&(a=this.view.findItemFromChild(a));this.ms.appendOnly?insertAt=this.view.store.getCount():(insertAt=a==this.ms.fs.body.dom?this.view.store.getCount()-1:this.view.indexOf(a),"below"==c&&insertAt++);b=!1;if(d.sourceView==this.view){"below"==c?d.viewNodes[0]==a&&d.viewNodes.shift():d.viewNodes[d.viewNodes.length-1]==a&&d.viewNodes.pop();if(!d.viewNodes.length)return!1;
insertAt>this.view.store.indexOf(d.records[0])&&(b="down",insertAt--)}for(a=0;a<d.records.length;a++)c=d.records[a],d.sourceView&&d.sourceView.store.remove(c),this.view.store.insert("down"==b?insertAt:insertAt++,c),(c=this.view.store.sortInfo)&&this.view.store.sort(c.field,c.direction);return!0},removeDropIndicators:function(a){if(a)Ext.fly(a).removeClass(["x-view-drag-insert-above","x-view-drag-insert-left","x-view-drag-insert-right","x-view-drag-insert-below"]),this.lastInsertClass="_noclass"},
setDroppable:function(a){a&&(Ext.isArray(a)?Ext.each(a,this.setDroppable,this):this.addToGroup(a))}});if(!Array.prototype.map)Array.prototype.map=function(a,b){var c=this.length;if("function"!=typeof a)throw new TypeError;for(var d=Array(c),e=0;e<c;e++)e in this&&(d[e]=a.call(b,this[e],e,this));return d};Ext.ns("Ext.ux.data");
Ext.ux.data.PagingMemoryProxy=Ext.extend(Ext.data.MemoryProxy,{constructor:function(a){Ext.ux.data.PagingMemoryProxy.superclass.constructor.call(this);this.data=a},doRequest:function(a,b,c,d,e,f,g){var c=c||{},h;try{h=d.readRecords(this.data)}catch(j){this.fireEvent("loadexception",this,g,null,j);e.call(f,null,g,!1);return}if(void 0!==c.filter)h.records=h.records.filter(function(a){return"object"==typeof a?(""+a.data[c.filterCol||0]).match(c.filter)?!0:!1:(""+a).match(c.filter)?!0:!1}),h.totalRecords=
h.records.length;if(void 0!==c.sort){var k="DESC"==(""+c.dir).toUpperCase()?-1:1;h.records.sort(function(a,b){var d=0,d="object"==typeof a?(a.data[c.sort]>b.data[c.sort]?1:a.data[c.sort]<b.data[c.sort]?-1:0)*k:(a>b?1:a<b?-1:0)*k;0==d&&(d=a.index<b.index?-1:1);return d})}if(void 0!==c.start&&void 0!==c.limit)h.records=h.records.slice(c.start,c.start+c.limit);e.call(f,h,g,!0)}});Ext.data.PagingMemoryProxy=Ext.ux.data.PagingMemoryProxy;
Ext.ux.PanelResizer=Ext.extend(Ext.util.Observable,{minHeight:0,maxHeight:1E7,constructor:function(a){Ext.apply(this,a);this.events={};Ext.ux.PanelResizer.superclass.constructor.call(this,a)},init:function(a){this.panel=a;-1==this.panel.elements.indexOf("footer")&&(a.elements+=",footer");a.on("render",this.onRender,this)},onRender:function(a){this.handle=a.footer.createChild({cls:"x-panel-resize"});this.tracker=new Ext.dd.DragTracker({onStart:this.onDragStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),
onEnd:this.onDragEnd.createDelegate(this),tolerance:3,autoStart:300});this.tracker.initEl(this.handle);a.on("beforedestroy",this.tracker.destroy,this.tracker)},onDragStart:function(a){this.dragging=!0;this.startHeight=this.panel.el.getHeight();this.fireEvent("dragstart",this,a)},onDrag:function(a){this.panel.setHeight((this.startHeight-this.tracker.getOffset()[1]).constrain(this.minHeight,this.maxHeight));this.fireEvent("drag",this,a)},onDragEnd:function(a){this.dragging=!1;this.fireEvent("dragend",
this,a)}});Ext.preg("panelresizer",Ext.ux.PanelResizer);
Ext.ux.Portal=Ext.extend(Ext.Panel,{layout:"column",autoScroll:!0,cls:"x-portal",defaultType:"portalcolumn",initComponent:function(){Ext.ux.Portal.superclass.initComponent.call(this);this.addEvents({validatedrop:!0,beforedragover:!0,dragover:!0,beforedrop:!0,drop:!0})},initEvents:function(){Ext.ux.Portal.superclass.initEvents.call(this);this.dd=new Ext.ux.Portal.DropZone(this,this.dropConfig)},beforeDestroy:function(){this.dd&&this.dd.unreg();Ext.ux.Portal.superclass.beforeDestroy.call(this)}});
Ext.reg("portal",Ext.ux.Portal);
Ext.ux.Portal.DropZone=Ext.extend(Ext.dd.DropTarget,{constructor:function(a,b){this.portal=a;Ext.dd.ScrollManager.register(a.body);Ext.ux.Portal.DropZone.superclass.constructor.call(this,a.bwrap.dom,b);a.body.ddScrollConfig=this.ddScrollConfig},ddScrollConfig:{vthresh:50,hthresh:-1,animate:!0,increment:200},createEvent:function(a,b,c,d,e,f){return{portal:this.portal,panel:c.panel,columnIndex:d,column:e,position:f,data:c,source:a,rawEvent:b,status:this.dropAllowed}},notifyOver:function(a,b,c){var d=
b.getXY(),e=this.portal,f=a.proxy;if(!this.grid)this.grid=this.getGrid();var g=e.body.dom.clientWidth;if(this.lastCW){if(this.lastCW!=g)this.lastCW=g,e.doLayout(),this.grid=this.getGrid()}else this.lastCW=g;for(var g=0,h=this.grid.columnX,j=!1,k=h.length;g<k;g++)if(d[0]<h[g].x+h[g].w){j=!0;break}j||g--;for(var l,h=!1,j=0,n=e.items.itemAt(g),m=n.items.items,o=!1,k=m.length;j<k;j++){l=m[j];var q=l.el.getHeight();if(0===q)o=!0;else if(l.el.getY()+q/2>d[1]){h=!0;break}}j=(h&&l?j:n.items.getCount())+(o?
-1:0);a=this.createEvent(a,b,c,g,n,j);if(!1!==e.fireEvent("validatedrop",a)&&!1!==e.fireEvent("beforedragover",a))f.getProxy().setWidth("auto"),l?f.moveProxy(l.el.dom.parentNode,h?l.el.dom:null):f.moveProxy(n.el.dom,null),this.lastPos={c:n,col:g,p:o||h&&l?j:!1},this.scrollPos=e.body.getScroll(),e.fireEvent("dragover",a);return a.status},notifyOut:function(){delete this.grid},notifyDrop:function(a,b,c){delete this.grid;if(this.lastPos){var d=this.lastPos.c,e=this.lastPos.p,f=a.panel,b=this.createEvent(a,
b,c,this.lastPos.col,d,!1!==e?e:d.items.getCount());if(!1!==this.portal.fireEvent("validatedrop",b)&&!1!==this.portal.fireEvent("beforedrop",b)){a.proxy.getProxy().remove();f.el.dom.parentNode.removeChild(a.panel.el.dom);!1!==e?d.insert(e,f):d.add(f);d.doLayout();this.portal.fireEvent("drop",b);var g=this.scrollPos.top;if(g){var h=this.portal.body.dom;setTimeout(function(){h.scrollTop=g},10)}}delete this.lastPos}},getGrid:function(){var a=this.portal.bwrap.getBox();a.columnX=[];this.portal.items.each(function(b){a.columnX.push({x:b.el.getX(),
w:b.el.getWidth()})});return a},unreg:function(){Ext.dd.ScrollManager.unregister(this.portal.body);Ext.ux.Portal.DropZone.superclass.unreg.call(this)}});Ext.ux.PortalColumn=Ext.extend(Ext.Container,{layout:"anchor",defaultType:"portlet",cls:"x-portal-column"});Ext.reg("portalcolumn",Ext.ux.PortalColumn);Ext.ux.Portlet=Ext.extend(Ext.Panel,{anchor:"100%",frame:!0,collapsible:!0,draggable:!0,cls:"x-portlet"});Ext.reg("portlet",Ext.ux.Portlet);
Ext.ux.ProgressBarPager=Ext.extend(Object,{progBarWidth:225,defaultText:"Loading...",defaultAnimCfg:{duration:1,easing:"bounceOut"},constructor:function(a){a&&Ext.apply(this,a)},init:function(a){if(a.displayInfo)this.parent=a,a.items.indexOf(a.displayItem),a.remove(a.displayItem,!0),this.progressBar=new Ext.ProgressBar({text:this.defaultText,width:this.progBarWidth,animate:this.defaultAnimCfg}),a.displayItem=this.progressBar,a.add(a.displayItem),a.doLayout(),Ext.apply(a,this.parentOverrides),this.progressBar.on("render",
function(a){a.mon(a.getEl().applyStyles("cursor:pointer"),"click",this.handleProgressBarClick,this)},this,{single:!0})},handleProgressBarClick:function(a){var b=this.parent,c=b.displayItem,d=this.progressBar.getBox(),a=a.getXY()[0]-d.x,d=Math.ceil(b.store.getTotalCount()/b.pageSize),c=Math.ceil(a/(c.width/d));b.changePage(c)},parentOverrides:{updateInfo:function(){if(this.displayItem){var a=this.store.getCount(),b=this.getPageData(),c=this.readPage(b),a=0==a?this.emptyMsg:String.format(this.displayMsg,
this.cursor+1,this.cursor+a,this.store.getTotalCount()),c=b.activePage;this.displayItem.updateProgress(c/b.pages,a,this.animate||this.defaultAnimConfig)}}}});Ext.preg("progressbarpager",Ext.ux.ProgressBarPager);Ext.ns("Ext.ux.grid");
Ext.ux.grid.RowEditor=Ext.extend(Ext.Panel,{floating:!0,shadow:!1,layout:"hbox",cls:"x-small-editor",buttonAlign:"center",baseCls:"x-row-editor",elements:"header,footer,body",frameWidth:5,buttonPad:3,clicksToEdit:"auto",monitorValid:!0,focusDelay:250,errorSummary:!0,saveText:"Save",cancelText:"Cancel",commitChangesText:"You need to commit or cancel your changes",errorText:"Errors",defaults:{normalWidth:!0},initComponent:function(){Ext.ux.grid.RowEditor.superclass.initComponent.call(this);this.addEvents("beforeedit",
"canceledit","validateedit","afteredit")},init:function(a){this.ownerCt=this.grid=a;if(2===this.clicksToEdit)a.on("rowdblclick",this.onRowDblClick,this);else if(a.on("rowclick",this.onRowClick,this),Ext.isIE)a.on("rowdblclick",this.onRowDblClick,this);a.getStore().on("remove",function(){this.stopEditing(!1)},this);a.on({scope:this,keydown:this.onGridKey,columnresize:this.verifyLayout,columnmove:this.refreshFields,reconfigure:this.refreshFields,beforedestroy:this.beforedestroy,destroy:this.destroy,
bodyscroll:{buffer:250,fn:this.positionButtons}});a.getColumnModel().on("hiddenchange",this.verifyLayout,this,{delay:1});a.getView().on("refresh",this.stopEditing.createDelegate(this,[]))},beforedestroy:function(){this.stopMonitoring();this.grid.getStore().un("remove",this.onStoreRemove,this);this.stopEditing(!1);Ext.destroy(this.btns,this.tooltip)},refreshFields:function(){this.initFields();this.verifyLayout()},isDirty:function(){var a;this.items.each(function(b){if(""+this.values[b.id]!==""+b.getValue())return a=
!0,!1},this);return a},startEditing:function(a,b){if(this.editing&&this.isDirty())this.showTooltip(this.commitChangesText);else if(Ext.isObject(a)&&(a=this.grid.getStore().indexOf(a)),!1!==this.fireEvent("beforeedit",this,a)){this.editing=!0;var c=this.grid,d=c.getView(),e=d.getRow(a),f=c.store.getAt(a);this.record=f;this.rowIndex=a;this.values={};this.rendered||this.render(d.getEditorParent());this.setSize(Ext.fly(e).getWidth());this.initialized||this.initFields();for(var c=c.getColumnModel(),d=
this.items.items,g,h,j=0,k=c.getColumnCount();j<k;j++)h=this.preEditValue(f,c.getDataIndex(j)),g=d[j],g.setValue(h),this.values[g.id]=Ext.isEmpty(h)?"":h;this.verifyLayout(!0);this.isVisible()?this.el.setXY(Ext.fly(e).getXY(),{duration:0.15}):this.setPagePosition(Ext.fly(e).getXY());this.isVisible()||this.show().doLayout();!1!==b&&this.doFocus.defer(this.focusDelay,this)}},stopEditing:function(a){this.editing=!1;if(this.isVisible())if(!1===a||!this.isValid())this.hide(),this.fireEvent("canceledit",
this,!1===a);else{for(var a={},b=this.record,c=!1,d=this.grid.colModel,e=this.items.items,f=0,g=d.getColumnCount();f<g;f++)if(!d.isHidden(f)){var h=d.getDataIndex(f);if(!Ext.isEmpty(h)){var j=b.data[h],k=this.postEditValue(e[f].getValue(),j,b,h);""+j!==""+k&&(a[h]=k,c=!0)}}c&&!1!==this.fireEvent("validateedit",this,a,b,this.rowIndex)?(b.beginEdit(),Ext.iterate(a,function(a,c){b.set(a,c)}),b.endEdit(),this.fireEvent("afteredit",this,a,b,this.rowIndex)):this.fireEvent("canceledit",this,!1);this.hide()}},
verifyLayout:function(a){if(this.el&&(this.isVisible()||!0===a)){a=this.grid.getView().getRow(this.rowIndex);this.setSize(Ext.fly(a).getWidth(),Ext.isIE?Ext.fly(a).getHeight()+9:void 0);for(var a=this.grid.colModel,b=this.items.items,c=0,d=a.getColumnCount();c<d;c++)if(a.isHidden(c))b[c].hide();else{var e=0,e=c===d-1?e+3:e+1;b[c].show();b[c].setWidth(a.getColumnWidth(c)-e)}this.doLayout();this.positionButtons()}},slideHide:function(){this.hide()},initFields:function(){var a=this.grid.getColumnModel(),
b=Ext.layout.ContainerLayout.prototype.parseMargins;this.removeAll(!1);for(var c=0,d=a.getColumnCount();c<d;c++){var e=a.getColumnAt(c),f=e.getEditor();f||(f=e.displayEditor||new Ext.form.DisplayField);f.margins=0==c?b("0 1 2 1"):c==d-1?b("0 0 2 1"):Ext.isIE?b("0 0 2 0"):b("0 1 2 0");f.setWidth(a.getColumnWidth(c));f.column=e;f.ownerCt!==this&&(f.on("focus",this.ensureVisible,this),f.on("specialkey",this.onKey,this));this.insert(c,f)}this.initialized=!0},onKey:function(a,b){b.getKey()===b.ENTER&&
(this.stopEditing(!0),b.stopPropagation())},onGridKey:function(a){if(a.getKey()===a.ENTER&&!this.isVisible()){var b=this.grid.getSelectionModel().getSelected();b&&(this.startEditing(this.grid.store.indexOf(b)),a.stopPropagation())}},ensureVisible:function(a){this.isVisible()&&this.grid.getView().ensureVisible(this.rowIndex,this.grid.colModel.getIndexById(a.column.id),!0)},onRowClick:function(a,b,c){if("auto"==this.clicksToEdit&&(a=this.lastClickIndex,this.lastClickIndex=b,a!=b&&!this.isVisible()))return;
this.startEditing(b,!1);this.doFocus.defer(this.focusDelay,this,[c.getPoint()])},onRowDblClick:function(a,b,c){this.startEditing(b,!1);this.doFocus.defer(this.focusDelay,this,[c.getPoint()])},onRender:function(){Ext.ux.grid.RowEditor.superclass.onRender.apply(this,arguments);this.el.swallowEvent(["keydown","keyup","keypress"]);this.btns=new Ext.Panel({baseCls:"x-plain",cls:"x-btns",elements:"body",layout:"table",width:2*this.minButtonWidth+2*this.frameWidth+4*this.buttonPad,items:[{ref:"saveBtn",
itemId:"saveBtn",xtype:"button",text:this.saveText,width:this.minButtonWidth,handler:this.stopEditing.createDelegate(this,[!0])},{xtype:"button",text:this.cancelText,width:this.minButtonWidth,handler:this.stopEditing.createDelegate(this,[!1])}]});this.btns.render(this.bwrap)},afterRender:function(){Ext.ux.grid.RowEditor.superclass.afterRender.apply(this,arguments);this.positionButtons();this.monitorValid&&this.startMonitoring()},onShow:function(){this.monitorValid&&this.startMonitoring();Ext.ux.grid.RowEditor.superclass.onShow.apply(this,
arguments)},onHide:function(){Ext.ux.grid.RowEditor.superclass.onHide.apply(this,arguments);this.stopMonitoring();this.grid.getView().focusRow(this.rowIndex)},positionButtons:function(){if(this.btns){var a=this.grid,b=this.el.dom.clientHeight,c=a.getView().scroller.dom.scrollLeft,d=this.btns.getWidth();this.btns.el.shift({left:Math.min(a.getWidth(),a.getColumnModel().getTotalWidth())/2-d/2+c,top:b-2,stopFx:!0,duration:0.2})}},preEditValue:function(a,b){var c=a.data[b];return this.autoEncode&&"string"===
typeof c?Ext.util.Format.htmlDecode(c):c},postEditValue:function(a){return this.autoEncode&&"string"==typeof a?Ext.util.Format.htmlEncode(a):a},doFocus:function(a){if(this.isVisible()){var b=0,c=this.grid.getColumnModel();a&&(b=this.getTargetColumnIndex(a));for(var b=b||0,d=c.getColumnCount();b<d;b++)if(a=c.getColumnAt(b),!a.hidden&&a.getEditor()){a.getEditor().focus();break}}},getTargetColumnIndex:function(a){for(var b=this.grid,c=b.view,a=a.left,b=b.colModel.config,d=0,e=!1,f;f=b[d];d++)if(!f.hidden&&
Ext.fly(c.getHeaderCell(d)).getRegion().right>=a){e=d;break}return e},startMonitoring:function(){if(!this.bound&&this.monitorValid)this.bound=!0,Ext.TaskMgr.start({run:this.bindHandler,interval:this.monitorPoll||200,scope:this})},stopMonitoring:function(){this.bound=!1;this.tooltip&&this.tooltip.hide()},isValid:function(){var a=!0;this.items.each(function(b){if(!b.isValid(!0))return a=!1});return a},bindHandler:function(){if(!this.bound)return!1;var a=this.isValid();!a&&this.errorSummary&&this.showTooltip(this.getErrorText().join(""));
this.btns.saveBtn.setDisabled(!a);this.fireEvent("validation",this,a)},lastVisibleColumn:function(){for(var a=this.items.getCount()-1,b;0<=a;a--)if(b=this.items.items[a],!b.hidden)return b},showTooltip:function(a){var b=this.tooltip;if(!b)b=this.tooltip=new Ext.ToolTip({maxWidth:600,cls:"errorTip",width:300,title:this.errorText,autoHide:!1,anchor:"left",anchorToTarget:!0,mouseOffset:[40,0]});var c=this.grid.getView(),d=parseInt(this.el.dom.style.top,10),c=c.scroller.dom.scrollTop,e=this.el.getHeight();
d+e>=c?(b.initTarget(this.lastVisibleColumn().getEl()),b.rendered||(b.show(),b.hide()),b.body.update(a),b.doAutoWidth(20),b.show()):b.rendered&&b.hide()},getErrorText:function(){var a=["<ul>"];this.items.each(function(b){b.isValid(!0)||a.push("<li>",b.getActiveError(),"</li>")});a.push("</ul>");return a}});Ext.preg("roweditor",Ext.ux.grid.RowEditor);Ext.ns("Ext.ux.grid");
Ext.ux.grid.RowExpander=Ext.extend(Ext.util.Observable,{expandOnEnter:!0,expandOnDblClick:!0,header:"",width:20,sortable:!1,fixed:!0,hideable:!1,menuDisabled:!0,dataIndex:"",id:"expander",lazyRender:!0,enableCaching:!0,constructor:function(a){Ext.apply(this,a);this.addEvents({beforeexpand:!0,expand:!0,beforecollapse:!0,collapse:!0});Ext.ux.grid.RowExpander.superclass.constructor.call(this);if(this.tpl){if("string"==typeof this.tpl)this.tpl=new Ext.Template(this.tpl);this.tpl.compile()}this.state=
{};this.bodyContent={}},getRowClass:function(a,b,c){c.cols-=1;var d=this.bodyContent[a.id];!d&&!this.lazyRender&&(d=this.getBodyContent(a,b));if(d)c.body=d;return this.state[a.id]?"x-grid3-row-expanded":"x-grid3-row-collapsed"},init:function(a){this.grid=a;var b=a.getView();b.getRowClass=this.getRowClass.createDelegate(this);b.enableRowBody=!0;a.on("render",this.onRender,this);a.on("destroy",this.onDestroy,this)},onRender:function(){var a=this.grid;a.getView().mainBody.on("mousedown",this.onMouseDown,
this,{delegate:".x-grid3-row-expander"});if(this.expandOnEnter)this.keyNav=new Ext.KeyNav(this.grid.getGridEl(),{enter:this.onEnter,scope:this});if(this.expandOnDblClick)a.on("rowdblclick",this.onRowDblClick,this)},onDestroy:function(){this.keyNav&&(this.keyNav.disable(),delete this.keyNav);var a=this.grid.getView().mainBody;a&&a.un("mousedown",this.onMouseDown,this)},onRowDblClick:function(a,b){this.toggleRow(b)},onEnter:function(){for(var a=this.grid,b=a.getSelectionModel().getSelections(),c=0,
d=b.length;c<d;c++)this.toggleRow(a.getStore().indexOf(b[c]))},getBodyContent:function(a){if(!this.enableCaching)return this.tpl.apply(a.data);var b=this.bodyContent[a.id];b||(b=this.tpl.apply(a.data),this.bodyContent[a.id]=b);return b},onMouseDown:function(a){a.stopEvent();this.toggleRow(a.getTarget(".x-grid3-row"))},renderer:function(a,b){b.cellAttr='rowspan="2"';return'<div class="x-grid3-row-expander">&#160;</div>'},beforeExpand:function(a,b,c){if(!1!==this.fireEvent("beforeexpand",this,a,b,c)){if(this.tpl&&
this.lazyRender)b.innerHTML=this.getBodyContent(a,c);return!0}return!1},toggleRow:function(a){"number"==typeof a&&(a=this.grid.view.getRow(a));this[Ext.fly(a).hasClass("x-grid3-row-collapsed")?"expandRow":"collapseRow"](a)},expandRow:function(a){"number"==typeof a&&(a=this.grid.view.getRow(a));var b=this.grid.store.getAt(a.rowIndex),c=Ext.DomQuery.selectNode("tr:nth(2) div.x-grid3-row-body",a);this.beforeExpand(b,c,a.rowIndex)&&(this.state[b.id]=!0,Ext.fly(a).replaceClass("x-grid3-row-collapsed",
"x-grid3-row-expanded"),this.fireEvent("expand",this,b,c,a.rowIndex))},collapseRow:function(a){"number"==typeof a&&(a=this.grid.view.getRow(a));var b=this.grid.store.getAt(a.rowIndex),c=Ext.fly(a).child("tr:nth(1) div.x-grid3-row-body",!0);!1!==this.fireEvent("beforecollapse",this,b,c,a.rowIndex)&&(this.state[b.id]=!1,Ext.fly(a).replaceClass("x-grid3-row-expanded","x-grid3-row-collapsed"),this.fireEvent("collapse",this,b,c,a.rowIndex))}});Ext.preg("rowexpander",Ext.ux.grid.RowExpander);
Ext.grid.RowExpander=Ext.ux.grid.RowExpander;Ext.ns("Ext.ux.layout");
Ext.ux.layout.RowLayout=Ext.extend(Ext.layout.ContainerLayout,{monitorResize:!0,type:"row",allowContainerRemove:!1,isValidParent:function(a){return this.innerCt&&a.getPositionEl().dom.parentNode==this.innerCt.dom},getLayoutTargetSize:function(){var a=this.container.getLayoutTarget(),b;a&&(b=a.getViewSize(),Ext.isIE&&Ext.isStrict&&0==b.height&&(b=a.getStyleSize()),b.width-=a.getPadding("lr"),b.height-=a.getPadding("tb"));return b},renderAll:function(a,b){if(!this.innerCt)this.innerCt=b.createChild({cls:"x-column-inner"}),
this.innerCt.createChild({cls:"x-clear"});Ext.layout.ColumnLayout.superclass.renderAll.call(this,a,this.innerCt)},onLayout:function(a,b){var c=a.items.items,d=c.length,e,f,g,h=[];this.renderAll(a,b);var j=this.getLayoutTargetSize();if(!(1>j.width&&1>j.height)){var k=e=j.height;this.innerCt.setSize({height:e});for(g=0;g<d;g++)e=c[g],f=e.getPositionEl().getMargins("tb"),h[g]=f,e.rowHeight||(k-=e.getHeight()+f);k=0>k?0:k;for(g=0;g<d;g++)e=c[g],f=h[g],e.rowHeight&&e.setSize({height:Math.floor(e.rowHeight*
k)-f});if(Ext.isIE&&b.getStyle("overflow")&&"hidden"!=g&&!this.adjustmentPass&&this.getLayoutTargetSize().width!=j.width)this.adjustmentPass=!0,this.onLayout(a,b);delete this.adjustmentPass}}});Ext.Container.LAYOUTS["ux.row"]=Ext.ux.layout.RowLayout;Ext.ns("Ext.ux.form");
Ext.ux.form.SearchField=Ext.extend(Ext.form.TwinTriggerField,{initComponent:function(){Ext.ux.form.SearchField.superclass.initComponent.call(this);this.on("specialkey",function(a,b){if(b.getKey()==b.ENTER)this.onTrigger2Click()},this)},validationEvent:!1,validateOnBlur:!1,trigger1Class:"x-form-clear-trigger",trigger2Class:"x-form-search-trigger",hideTrigger1:!0,width:180,hasSearch:!1,paramName:"query",onTrigger1Click:function(){if(this.hasSearch)this.el.dom.value="",this.store.baseParams=this.store.baseParams||
{},this.store.baseParams[this.paramName]="",this.store.reload({params:{start:0}}),this.triggers[0].hide(),this.hasSearch=!1},onTrigger2Click:function(){var a=this.getRawValue();if(1>a.length)this.onTrigger1Click();else this.store.baseParams=this.store.baseParams||{},this.store.baseParams[this.paramName]=a,this.store.reload({params:{start:0}}),this.hasSearch=!0,this.triggers[0].show()}});Ext.ns("Ext.ux.form");
Ext.ux.form.SelectBox=Ext.extend(Ext.form.ComboBox,{constructor:function(a){this.searchResetDelay=1E3;a=a||{};a=Ext.apply(a||{},{editable:!1,forceSelection:!0,rowHeight:!1,lastSearchTerm:!1,triggerAction:"all",mode:"local"});Ext.ux.form.SelectBox.superclass.constructor.apply(this,arguments);this.lastSelectedIndex=this.selectedIndex||0},initEvents:function(){Ext.ux.form.SelectBox.superclass.initEvents.apply(this,arguments);this.el.on("keydown",this.keySearch,this,!0);this.cshTask=new Ext.util.DelayedTask(this.clearSearchHistory,
this)},keySearch:function(a){var b=a.getKey(),c=String.fromCharCode(b),d=0;if(this.store.getCount()){switch(b){case Ext.EventObject.HOME:a.stopEvent();this.selectFirst();return;case Ext.EventObject.END:a.stopEvent();this.selectLast();return;case Ext.EventObject.PAGEDOWN:this.selectNextPage();a.stopEvent();return;case Ext.EventObject.PAGEUP:this.selectPrevPage();a.stopEvent();return}if(!(a.hasModifier()&&!a.shiftKey||a.isNavKeyPress()||a.isSpecialKey())){if(this.lastSearchTerm==c)d=this.lastSelectedIndex;
this.search(this.displayField,c,d);this.cshTask.delay(this.searchResetDelay)}}},onRender:function(a,b){this.store.on("load",this.calcRowsPerPage,this);Ext.ux.form.SelectBox.superclass.onRender.apply(this,arguments);"local"==this.mode&&(this.initList(),this.calcRowsPerPage())},onSelect:function(a,b,c){if(!1!==this.fireEvent("beforeselect",this,a,b))this.setValue(a.data[this.valueField||this.displayField]),c||this.collapse(),this.lastSelectedIndex=b+1,this.fireEvent("select",this,a,b)},afterRender:function(){Ext.ux.form.SelectBox.superclass.afterRender.apply(this,
arguments);Ext.isWebKit&&this.el.swallowEvent("mousedown",!0);this.el.unselectable();this.innerList.unselectable();this.trigger.unselectable();this.innerList.on("mouseup",function(a,b){if(!(b.id&&b.id==this.innerList.id))this.onViewClick()},this);this.mun(this.view,"containerclick",this.onViewClick,this);this.mun(this.view,"click",this.onViewClick,this);this.innerList.on("mouseover",function(a,b){if(!(b.id&&b.id==this.innerList.id))this.lastSelectedIndex=this.view.getSelectedIndexes()[0]+1,this.cshTask.delay(this.searchResetDelay)},
this);this.trigger.un("click",this.onTriggerClick,this);this.trigger.on("mousedown",function(a){a.preventDefault();this.onTriggerClick()},this);this.on("collapse",function(){Ext.getDoc().un("mouseup",this.collapseIf,this)},this,!0);this.on("expand",function(){Ext.getDoc().on("mouseup",this.collapseIf,this)},this,!0)},clearSearchHistory:function(){this.lastSelectedIndex=0;this.lastSearchTerm=!1},selectFirst:function(){this.focusAndSelect(this.store.data.first())},selectLast:function(){this.focusAndSelect(this.store.data.last())},
selectPrevPage:function(){this.rowHeight&&this.focusAndSelect(this.store.getAt(Math.max(this.selectedIndex-this.rowsPerPage,0)))},selectNextPage:function(){this.rowHeight&&this.focusAndSelect(this.store.getAt(Math.min(this.selectedIndex+this.rowsPerPage,this.store.getCount()-1)))},search:function(a,b,c){a=a||this.displayField;this.lastSearchTerm=b;var d=this.store.find.apply(this.store,arguments);-1!==d&&this.focusAndSelect(d)},focusAndSelect:function(a){a=Ext.isNumber(a)?a:this.store.indexOf(a);
this.select(a,this.isExpanded());this.onSelect(this.store.getAt(a),a,this.isExpanded())},calcRowsPerPage:function(){this.store.getCount()?(this.rowHeight=Ext.fly(this.view.getNode(0)).getHeight(),this.rowsPerPage=this.maxHeight/this.rowHeight):this.rowHeight=!1}});Ext.reg("selectbox",Ext.ux.form.SelectBox);Ext.ux.SelectBox=Ext.ux.form.SelectBox;
Ext.ux.SlidingPager=Ext.extend(Object,{init:function(a){var b=a.items.indexOf(a.inputItem);Ext.each(a.items.getRange(b-2,b+2),function(a){a.hide()});var c=new Ext.Slider({width:114,minValue:1,maxValue:1,plugins:new Ext.slider.Tip({getText:function(a){return String.format("Page <b>{0}</b> of <b>{1}</b>",a.value,a.slider.maxValue)}}),listeners:{changecomplete:function(b,c){a.changePage(c)}}});a.insert(b+1,c);a.on({change:function(a,b){c.setMaxValue(b.pages);c.setValue(b.activePage)}})}});Ext.ns("Ext.ux.form");
Ext.ux.form.SpinnerField=Ext.extend(Ext.form.NumberField,{actionMode:"wrap",deferHeight:!0,autoSize:Ext.emptyFn,onBlur:Ext.emptyFn,adjustSize:Ext.BoxComponent.prototype.adjustSize,constructor:function(a){var b=Ext.copyTo({},a,"incrementValue,alternateIncrementValue,accelerate,defaultValue,triggerClass,splitterClass"),b=this.spinner=new Ext.ux.Spinner(b),b=a.plugins?Ext.isArray(a.plugins)?a.plugins.push(b):[a.plugins,b]:b;Ext.ux.form.SpinnerField.superclass.constructor.call(this,Ext.apply(a,{plugins:b}))},
getResizeEl:function(){return this.wrap},getPositionEl:function(){return this.wrap},alignErrorIcon:function(){this.wrap&&this.errorIcon.alignTo(this.wrap,"tl-tr",[2,0])},validateBlur:function(){return!0}});Ext.reg("spinnerfield",Ext.ux.form.SpinnerField);Ext.form.SpinnerField=Ext.ux.form.SpinnerField;
Ext.ux.Spinner=Ext.extend(Ext.util.Observable,{incrementValue:1,alternateIncrementValue:5,triggerClass:"x-form-spinner-trigger",splitterClass:"x-form-spinner-splitter",alternateKey:Ext.EventObject.shiftKey,defaultValue:0,accelerate:!1,constructor:function(a){Ext.ux.Spinner.superclass.constructor.call(this,a);Ext.apply(this,a);this.mimicing=!1},init:function(a){this.field=a;a.afterMethod("onRender",this.doRender,this);a.afterMethod("onEnable",this.doEnable,this);a.afterMethod("onDisable",this.doDisable,
this);a.afterMethod("afterRender",this.doAfterRender,this);a.afterMethod("onResize",this.doResize,this);a.afterMethod("onFocus",this.doFocus,this);a.beforeMethod("onDestroy",this.doDestroy,this)},doRender:function(){var a=this.el=this.field.getEl(),b=this.field;b.wrap?this.wrap=b.wrap.addClass("x-form-field-wrap"):b.wrap=this.wrap=a.wrap({cls:"x-form-field-wrap"});this.trigger=this.wrap.createChild({tag:"img",src:Ext.BLANK_IMAGE_URL,cls:"x-form-trigger "+this.triggerClass});b.width||this.wrap.setWidth(a.getWidth()+
this.trigger.getWidth());this.splitter=this.wrap.createChild({tag:"div",cls:this.splitterClass,style:"width:13px; height:2px;"});this.splitter.setRight(Ext.isIE?1:2).setTop(10).show();this.proxy=this.trigger.createProxy("",this.splitter,!0);this.proxy.addClass("x-form-spinner-proxy");this.proxy.setStyle("left","0px");this.proxy.setSize(14,1);this.proxy.hide();this.dd=new Ext.dd.DDProxy(this.splitter.dom.id,"SpinnerDrag",{dragElId:this.proxy.id});this.initTrigger();this.initSpinner()},doAfterRender:function(){var a;
if(Ext.isIE&&this.el.getY()!=(a=this.trigger.getY()))this.el.position(),this.el.setY(a)},doEnable:function(){if(this.wrap)this.disabled=!1,this.wrap.removeClass(this.field.disabledClass)},doDisable:function(){if(this.wrap)this.disabled=!0,this.wrap.addClass(this.field.disabledClass),this.el.removeClass(this.field.disabledClass)},doResize:function(a){"number"==typeof a&&this.el.setWidth(a-this.trigger.getWidth());this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth())},doFocus:function(){if(!this.mimicing)this.wrap.addClass("x-trigger-wrap-focus"),
this.mimicing=!0,Ext.get(Ext.isIE?document.body:document).on("mousedown",this.mimicBlur,this,{delay:10}),this.el.on("keydown",this.checkTab,this)},checkTab:function(a){a.getKey()==a.TAB&&this.triggerBlur()},mimicBlur:function(a){!this.wrap.contains(a.target)&&this.field.validateBlur(a)&&this.triggerBlur()},triggerBlur:function(){this.mimicing=!1;Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this);this.el.un("keydown",this.checkTab,this);this.field.beforeBlur();this.wrap.removeClass("x-trigger-wrap-focus");
this.field.onBlur.call(this.field)},initTrigger:function(){this.trigger.addClassOnOver("x-form-trigger-over");this.trigger.addClassOnClick("x-form-trigger-click")},initSpinner:function(){this.field.addEvents({spin:!0,spinup:!0,spindown:!0});this.keyNav=new Ext.KeyNav(this.el,{up:function(a){a.preventDefault();this.onSpinUp()},down:function(a){a.preventDefault();this.onSpinDown()},pageUp:function(a){a.preventDefault();this.onSpinUpAlternate()},pageDown:function(a){a.preventDefault();this.onSpinDownAlternate()},
scope:this});this.repeater=new Ext.util.ClickRepeater(this.trigger,{accelerate:this.accelerate});this.field.mon(this.repeater,"click",this.onTriggerClick,this,{preventDefault:!0});this.field.mon(this.trigger,{mouseover:this.onMouseOver,mouseout:this.onMouseOut,mousemove:this.onMouseMove,mousedown:this.onMouseDown,mouseup:this.onMouseUp,scope:this,preventDefault:!0});this.field.mon(this.wrap,"mousewheel",this.handleMouseWheel,this);this.dd.setXConstraint(0,0,10);this.dd.setYConstraint(1500,1500,10);
this.dd.endDrag=this.endDrag.createDelegate(this);this.dd.startDrag=this.startDrag.createDelegate(this);this.dd.onDrag=this.onDrag.createDelegate(this)},onMouseOver:function(){if(!this.disabled){var a=this.getMiddle();this.tmpHoverClass=Ext.EventObject.getPageY()<a?"x-form-spinner-overup":"x-form-spinner-overdown";this.trigger.addClass(this.tmpHoverClass)}},onMouseOut:function(){this.trigger.removeClass(this.tmpHoverClass)},onMouseMove:function(){if(!this.disabled){var a=this.getMiddle();Ext.EventObject.getPageY()>
a&&"x-form-spinner-overup"==this.tmpHoverClass||Ext.EventObject.getPageY()}},onMouseDown:function(){if(!this.disabled){var a=this.getMiddle();this.tmpClickClass=Ext.EventObject.getPageY()<a?"x-form-spinner-clickup":"x-form-spinner-clickdown";this.trigger.addClass(this.tmpClickClass)}},onMouseUp:function(){this.trigger.removeClass(this.tmpClickClass)},onTriggerClick:function(){if(!this.disabled&&!this.el.dom.readOnly){var a=this.getMiddle();this["onSpin"+(Ext.EventObject.getPageY()<a?"Up":"Down")]()}},
getMiddle:function(){var a=this.trigger.getTop(),b=this.trigger.getHeight();return a+b/2},isSpinnable:function(){return this.disabled||this.el.dom.readOnly?(Ext.EventObject.preventDefault(),!1):!0},handleMouseWheel:function(a){if(!1!=this.wrap.hasClass("x-trigger-wrap-focus")){var b=a.getWheelDelta();0<b?(this.onSpinUp(),a.stopEvent()):0>b&&(this.onSpinDown(),a.stopEvent())}},startDrag:function(){this.proxy.show();this._previousY=Ext.fly(this.dd.getDragEl()).getTop()},endDrag:function(){this.proxy.hide()},
onDrag:function(){if(!this.disabled){var a=Ext.fly(this.dd.getDragEl()).getTop(),b="";this._previousY>a&&(b="Up");this._previousY<a&&(b="Down");if(""!=b)this["onSpin"+b]();this._previousY=a}},onSpinUp:function(){if(!1!=this.isSpinnable())if(!0==Ext.EventObject.shiftKey)this.onSpinUpAlternate();else this.spin(!1,!1),this.field.fireEvent("spin",this),this.field.fireEvent("spinup",this)},onSpinDown:function(){if(!1!=this.isSpinnable())if(!0==Ext.EventObject.shiftKey)this.onSpinDownAlternate();else this.spin(!0,
!1),this.field.fireEvent("spin",this),this.field.fireEvent("spindown",this)},onSpinUpAlternate:function(){!1!=this.isSpinnable()&&(this.spin(!1,!0),this.field.fireEvent("spin",this),this.field.fireEvent("spinup",this))},onSpinDownAlternate:function(){!1!=this.isSpinnable()&&(this.spin(!0,!0),this.field.fireEvent("spin",this),this.field.fireEvent("spindown",this))},spin:function(a,b){var c=parseFloat(this.field.getValue()),d=!0==b?this.alternateIncrementValue:this.incrementValue;!0==a?c-=d:c+=d;c=
isNaN(c)?this.defaultValue:c;c=this.fixBoundries(c);this.field.setRawValue(c)},fixBoundries:function(a){if(void 0!=this.field.minValue&&a<this.field.minValue)a=this.field.minValue;if(void 0!=this.field.maxValue&&a>this.field.maxValue)a=this.field.maxValue;return this.fixPrecision(a)},fixPrecision:function(a){var b=isNaN(a);return!this.field.allowDecimals||-1==this.field.decimalPrecision||b||!a?b?"":a:parseFloat(parseFloat(a).toFixed(this.field.decimalPrecision))},doDestroy:function(){this.trigger&&
this.trigger.remove();this.wrap&&(this.wrap.remove(),delete this.field.wrap);this.splitter&&this.splitter.remove();if(this.dd)this.dd.unreg(),this.dd=null;this.proxy&&this.proxy.remove();this.repeater&&this.repeater.purgeListeners();this.mimicing&&Ext.get(Ext.isIE?document.body:document).un("mousedown",this.mimicBlur,this)}});Ext.form.Spinner=Ext.ux.Spinner;Ext.ux.Spotlight=function(a){Ext.apply(this,a)};
Ext.ux.Spotlight.prototype={active:!1,animate:!0,duration:0.25,easing:"easeNone",animated:!1,createElements:function(){var a=Ext.getBody();this.right=a.createChild({cls:"x-spotlight"});this.left=a.createChild({cls:"x-spotlight"});this.top=a.createChild({cls:"x-spotlight"});this.bottom=a.createChild({cls:"x-spotlight"});this.all=new Ext.CompositeElement([this.right,this.left,this.top,this.bottom])},show:function(a,b,c){this.animated?this.show.defer(50,this,[a,b,c]):(this.el=Ext.get(a),this.right||
this.createElements(),this.active?this.applyBounds(!1,!1,!1,b,c):(this.all.setDisplayed(""),this.applyBounds(!0,!1),this.active=!0,Ext.EventManager.onWindowResize(this.syncSize,this),this.applyBounds(!1,this.animate,!1,b,c)))},hide:function(a,b){this.animated?this.hide.defer(50,this,[a,b]):(Ext.EventManager.removeResizeListener(this.syncSize,this),this.applyBounds(!0,this.animate,!0,a,b))},doHide:function(){this.active=!1;this.all.setDisplayed(!1)},syncSize:function(){this.applyBounds(!1,!1)},applyBounds:function(a,
b,c,d,e){var f=this.el.getRegion(),g=Ext.lib.Dom.getViewWidth(!0),h=Ext.lib.Dom.getViewHeight(!0),j=0,k=!1;if(b)k={callback:function(){j++;if(4==j)this.animated=!1,c&&this.doHide(),Ext.callback(d,e,[this])},scope:this,duration:this.duration,easing:this.easing},this.animated=!0;this.right.setBounds(f.right,a?h:f.top,g-f.right,a?0:h-f.top,k);this.left.setBounds(0,0,f.left,a?0:f.bottom,k);this.top.setBounds(a?g:f.left,0,a?0:g-f.left,f.top,k);this.bottom.setBounds(0,f.bottom,a?0:f.right,h-f.bottom,k);
b||(c&&this.doHide(),d&&Ext.callback(d,e,[this]))},destroy:function(){this.doHide();Ext.destroy(this.right,this.left,this.top,this.bottom);delete this.el;delete this.all}};Ext.Spotlight=Ext.ux.Spotlight;
Ext.ux.StatusBar=Ext.extend(Ext.Toolbar,{cls:"x-statusbar",busyIconCls:"x-status-busy",busyText:"Loading...",autoClear:5E3,emptyText:"&nbsp;",activeThreadId:0,initComponent:function(){"right"==this.statusAlign&&(this.cls+=" x-status-right");Ext.ux.StatusBar.superclass.initComponent.call(this)},afterRender:function(){Ext.ux.StatusBar.superclass.afterRender.call(this);var a="right"==this.statusAlign;this.currIconCls=this.iconCls||this.defaultIconCls;this.statusEl=new Ext.Toolbar.TextItem({cls:"x-status-text "+
(this.currIconCls||""),text:this.text||this.defaultText||""});a?(this.add("->"),this.add(this.statusEl)):(this.insert(0,this.statusEl),this.insert(1,"->"));this.doLayout()},setStatus:function(a){a=a||{};"string"==typeof a&&(a={text:a});void 0!==a.text&&this.setText(a.text);void 0!==a.iconCls&&this.setIcon(a.iconCls);if(a.clear){var a=a.clear,b=this.autoClear,c={useDefaults:!0,anim:!0};if("object"==typeof a){if(a=Ext.applyIf(a,c),a.wait)b=a.wait}else"number"==typeof a?(b=a,a=c):"boolean"==typeof a&&
(a=c);a.threadId=this.activeThreadId;this.clearStatus.defer(b,this,[a])}return this},clearStatus:function(a){a=a||{};if(a.threadId&&a.threadId!==this.activeThreadId)return this;var b=a.useDefaults?this.defaultText:this.emptyText,c=a.useDefaults?this.defaultIconCls?this.defaultIconCls:"":"";a.anim?this.statusEl.el.fadeOut({remove:!1,useDisplay:!0,scope:this,callback:function(){this.setStatus({text:b,iconCls:c});this.statusEl.el.show()}}):(this.statusEl.hide(),this.setStatus({text:b,iconCls:c}),this.statusEl.show());
return this},setText:function(a){this.activeThreadId++;this.text=a||"";this.rendered&&this.statusEl.setText(this.text);return this},getText:function(){return this.text},setIcon:function(a){this.activeThreadId++;a=a||"";if(this.rendered){if(this.currIconCls)this.statusEl.removeClass(this.currIconCls),this.currIconCls=null;if(0<a.length)this.statusEl.addClass(a),this.currIconCls=a}else this.currIconCls=a;return this},showBusy:function(a){"string"==typeof a&&(a={text:a});a=Ext.applyIf(a||{},{text:this.busyText,
iconCls:this.busyIconCls});return this.setStatus(a)}});Ext.reg("statusbar",Ext.ux.StatusBar);
Ext.ux.TabCloseMenu=Ext.extend(Object,{closeTabText:"Close Tab",closeOtherTabsText:"Close Other Tabs",showCloseAll:!0,closeAllTabsText:"Close All Tabs",constructor:function(a){Ext.apply(this,a||{})},init:function(a){this.tabs=a;a.on({scope:this,contextmenu:this.onContextMenu,destroy:this.destroy})},destroy:function(){Ext.destroy(this.menu);delete this.menu;delete this.tabs;delete this.active},onContextMenu:function(a,b,c){this.active=b;var d=this.createMenu(),e=!0,f=!0,g=d.getComponent("closeall");
d.getComponent("close").setDisabled(!b.closable);a.items.each(function(){if(this.closable&&(e=!1,this!=b))return f=!1});d.getComponent("closeothers").setDisabled(f);g&&g.setDisabled(e);c.stopEvent();d.showAt(c.getPoint())},createMenu:function(){if(!this.menu){var a=[{itemId:"close",text:this.closeTabText,scope:this,handler:this.onClose}];this.showCloseAll&&a.push("-");a.push({itemId:"closeothers",text:this.closeOtherTabsText,scope:this,handler:this.onCloseOthers});this.showCloseAll&&a.push({itemId:"closeall",
text:this.closeAllTabsText,scope:this,handler:this.onCloseAll});this.menu=new Ext.menu.Menu({items:a})}return this.menu},onClose:function(){this.tabs.remove(this.active)},onCloseOthers:function(){this.doClose(!0)},onCloseAll:function(){this.doClose(!1)},doClose:function(a){var b=[];this.tabs.items.each(function(c){c.closable&&(!a||c!=this.active)&&b.push(c)},this);Ext.each(b,function(a){this.tabs.remove(a)},this)}});Ext.preg("tabclosemenu",Ext.ux.TabCloseMenu);Ext.ns("Ext.ux.grid");
Ext.ux.grid.TableGrid=function(a,b){b=b||{};Ext.apply(this,b);for(var c=b.fields||[],d=b.columns||[],a=Ext.get(a),e=a.insertSibling(),f=[],g=[],h=a.query("thead th"),j=0,k;k=h[j];j++){var l=k.innerHTML,n="tcol-"+j;f.push(Ext.applyIf(c[j]||{},{name:n,mapping:"td:nth("+(j+1)+")/@innerHTML"}));g.push(Ext.applyIf(d[j]||{},{header:l,dataIndex:n,width:k.offsetWidth,tooltip:k.title,sortable:!0}))}c=new Ext.data.Store({reader:new Ext.data.XmlReader({record:"tbody tr"},f)});c.loadData(a.dom);g=new Ext.grid.ColumnModel(g);
b.width||b.height?e.setSize(b.width||"auto",b.height||"auto"):e.setWidth(a.getWidth());!1!==b.remove&&a.remove();Ext.applyIf(this,{ds:c,cm:g,sm:new Ext.grid.RowSelectionModel,autoHeight:!0,autoWidth:!1});Ext.ux.grid.TableGrid.superclass.constructor.call(this,e,{})};Ext.extend(Ext.ux.grid.TableGrid,Ext.grid.GridPanel);Ext.grid.TableGrid=Ext.ux.grid.TableGrid;Ext.ns("Ext.ux");
Ext.ux.TabScrollerMenu=Ext.extend(Object,{pageSize:10,maxText:15,menuPrefixText:"Items",constructor:function(a){a=a||{};Ext.apply(this,a)},init:function(a){Ext.apply(a,this.parentOverrides);a.tabScrollerMenu=this;var b=this;a.on({render:{scope:a,single:!0,fn:function(){var c=a.createScrollers.createSequence(b.createPanelsMenu,this);a.createScrollers=c}}})},createPanelsMenu:function(){var a=this.stripWrap.dom.offsetHeight;Ext.fly(this.header.dom.firstChild).applyStyles({right:"18px"});Ext.get(this.strip.dom.parentNode).applyStyles({"margin-right":"36px"});
var b=this.header.insertFirst({cls:"x-tab-tabmenu-right"});b.setHeight(a);b.addClassOnOver("x-tab-tabmenu-over");b.on("click",this.showTabsMenu,this);this.scrollLeft.show=this.scrollLeft.show.createSequence(function(){b.show()});this.scrollLeft.hide=this.scrollLeft.hide.createSequence(function(){b.hide()})},getPageSize:function(){return this.pageSize},setPageSize:function(a){this.pageSize=a},getMaxText:function(){return this.maxText},setMaxText:function(a){this.maxText=a},getMenuPrefixText:function(){return this.menuPrefixText},
setMenuPrefixText:function(a){this.menuPrefixText=a},parentOverrides:{showTabsMenu:function(a){if(this.tabsMenu)this.tabsMenu.destroy(),this.un("destroy",this.tabsMenu.destroy,this.tabsMenu),this.tabsMenu=null;this.tabsMenu=new Ext.menu.Menu;this.on("destroy",this.tabsMenu.destroy,this.tabsMenu);this.generateTabMenuItems();a=Ext.get(a.getTarget()).getXY();a[1]+=24;this.tabsMenu.showAt(a)},generateTabMenuItems:function(){var a=this.getActiveTab(),b=this.items.getCount(),c=this.tabScrollerMenu.getPageSize();
if(b>c){for(var d=Math.floor(b/c),e=b%c,f=0;f<d;f++){for(var g=(f+1)*c,h=[],j=0;j<c;j++){index=j+g-c;var k=this.items.get(index);h.push(this.autoGenMenuItem(k))}this.tabsMenu.add({text:this.tabScrollerMenu.getMenuPrefixText()+" "+(g-c+1)+" - "+g,menu:h})}if(0<e){c*=d;h=[];for(f=c;f<b;f++)k=this.items.get(f),h.push(this.autoGenMenuItem(k));this.tabsMenu.add({text:this.tabScrollerMenu.menuPrefixText+" "+(c+1)+" - "+(c+h.length),menu:h})}}else this.items.each(function(b){b.id!=a.id&&!b.hidden&&this.tabsMenu.add(this.autoGenMenuItem(b))},
this)},autoGenMenuItem:function(a){var b=this.tabScrollerMenu.getMaxText();return{text:Ext.util.Format.ellipsis(a.title,b),handler:this.showTabFromMenu,scope:this,disabled:a.disabled,tabToShow:a,iconCls:a.iconCls}},showTabFromMenu:function(a){this.setActiveTab(a.tabToShow)}}});Ext.reg("tabscrollermenu",Ext.ux.TabScrollerMenu);Ext.ns("Ext.ux.tree");
Ext.ux.tree.XmlTreeLoader=Ext.extend(Ext.tree.TreeLoader,{XML_NODE_ELEMENT:1,XML_NODE_TEXT:3,processResponse:function(a,b,c){var d=a.responseXML,d=d.documentElement||d;try{b.beginUpdate(),b.appendChild(this.parseXml(d)),b.endUpdate(),this.runCallback(c,scope||b,[b])}catch(e){this.handleFailure(a)}},parseXml:function(a){var b=[];Ext.each(a.childNodes,function(a){if(a.nodeType==this.XML_NODE_ELEMENT){var d=this.createNode(a);if(0<a.childNodes.length)a=this.parseXml(a),"string"==typeof a?d.attributes.innerText=
a:d.appendChild(a);b.push(d)}else if(a.nodeType==this.XML_NODE_TEXT&&(d=a.nodeValue.trim(),0<d.length))return b=d},this);return b},createNode:function(a){var b={tagName:a.tagName};Ext.each(a.attributes,function(a){b[a.nodeName]=a.nodeValue});this.processAttributes(b);return Ext.ux.tree.XmlTreeLoader.superclass.createNode.call(this,b)},processAttributes:Ext.emptyFn});Ext.ux.XmlTreeLoader=Ext.ux.tree.XmlTreeLoader;
Ext.ux.ValidationStatus=Ext.extend(Ext.Component,{errorIconCls:"x-status-error",errorListCls:"x-status-error-list",validIconCls:"x-status-valid",showText:"The form has errors (click for details...)",hideText:"Click again to hide the error list",submitText:"Saving...",init:function(a){a.on("render",function(){this.statusBar=a;this.monitor=!0;this.errors=new Ext.util.MixedCollection;this.listAlign="right"==a.statusAlign?"br-tr?":"bl-tl?";if(this.form){this.form=Ext.getCmp(this.form).getForm();this.startMonitoring();
this.form.on("beforeaction",function(a,b){if("submit"==b.type)this.monitor=!1},this);var b=function(){this.monitor=!0};this.form.on("actioncomplete",b,this);this.form.on("actionfailed",b,this)}},this,{single:!0});a.on({scope:this,afterlayout:{single:!0,fn:function(){a.statusEl.getEl().on("click",this.onStatusClick,this,{buffer:200})}},beforedestroy:{single:!0,fn:this.onDestroy}})},startMonitoring:function(){this.form.items.each(function(a){a.on("invalid",this.onFieldValidation,this);a.on("valid",
this.onFieldValidation,this)},this)},stopMonitoring:function(){this.form.items.each(function(a){a.un("invalid",this.onFieldValidation,this);a.un("valid",this.onFieldValidation,this)},this)},onDestroy:function(){this.stopMonitoring();this.statusBar.statusEl.un("click",this.onStatusClick,this);Ext.ux.ValidationStatus.superclass.onDestroy.call(this)},onFieldValidation:function(a,b){if(!this.monitor)return!1;b?this.errors.add(a.id,{field:a,msg:b}):this.errors.removeKey(a.id);this.updateErrorList();0<
this.errors.getCount()?this.statusBar.getText()!=this.showText&&this.statusBar.setStatus({text:this.showText,iconCls:this.errorIconCls}):this.statusBar.clearStatus().setIcon(this.validIconCls)},updateErrorList:function(){if(0<this.errors.getCount()){var a="<ul>";this.errors.each(function(b){a+='<li id="x-err-'+b.field.id+'"><a href="#">'+b.msg+"</a></li>"},this);this.getMsgEl().update(a+"</ul>")}else this.getMsgEl().update("")},getMsgEl:function(){if(!this.msgEl)this.msgEl=Ext.DomHelper.append(Ext.getBody(),
{cls:this.errorListCls+" x-hide-offsets"},!0),this.msgEl.on("click",function(a){if(a=a.getTarget("li",10,!0))Ext.getCmp(a.id.split("x-err-")[1]).focus(),this.hideErrors()},this,{stopEvent:!0});return this.msgEl},showErrors:function(){this.updateErrorList();this.getMsgEl().alignTo(this.statusBar.getEl(),this.listAlign).slideIn("b",{duration:0.3,easing:"easeOut"});this.statusBar.setText(this.hideText);this.form.getEl().on("click",this.hideErrors,this,{single:!0})},hideErrors:function(){var a=this.getMsgEl();
a.isVisible()&&(a.slideOut("b",{duration:0.2,easing:"easeIn"}),this.statusBar.setText(this.showText));this.form.getEl().un("click",this.hideErrors,this)},onStatusClick:function(){this.getMsgEl().isVisible()?this.hideErrors():0<this.errors.getCount()&&this.showErrors()}});
(function(){Ext.override(Ext.list.Column,{init:function(){var a=Ext.data.Types,b=this.sortType;if(this.type){if(Ext.isString(this.type))this.type=Ext.data.Types[this.type.toUpperCase()]||a.AUTO}else this.type=a.AUTO;if(Ext.isString(b))this.sortType=Ext.data.SortTypes[b];else if(Ext.isEmpty(b))this.sortType=this.type.sortType}});Ext.tree.Column=Ext.extend(Ext.list.Column,{});Ext.tree.NumberColumn=Ext.extend(Ext.list.NumberColumn,{});Ext.tree.DateColumn=Ext.extend(Ext.list.DateColumn,{});Ext.tree.BooleanColumn=
Ext.extend(Ext.list.BooleanColumn,{});Ext.reg("tgcolumn",Ext.tree.Column);Ext.reg("tgnumbercolumn",Ext.tree.NumberColumn);Ext.reg("tgdatecolumn",Ext.tree.DateColumn);Ext.reg("tgbooleancolumn",Ext.tree.BooleanColumn)})();
Ext.ux.tree.TreeGridNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:!0,renderElements:function(a,b,c,d){var e=a.getOwnerTree(),f=e.columns,g=f[0],h,j,k;this.indentMarkup=a.parentNode?a.parentNode.ui.getChildIndent():"";j=['<tbody class="x-tree-node">','<tr ext:tree-node-id="',a.id,'" class="x-tree-node-el x-tree-node-leaf ',b.cls,'">','<td class="x-treegrid-col">','<span class="x-tree-node-indent">',this.indentMarkup,"</span>",'<img src="',this.emptyIcon,'" class="x-tree-ec-icon x-tree-elbow" />',
'<img src="',b.icon||this.emptyIcon,'" class="x-tree-node-icon',b.icon?" x-tree-node-inline-icon":"",b.iconCls?" "+b.iconCls:"",'" unselectable="on" />','<a hidefocus="on" class="x-tree-node-anchor" href="',b.href?b.href:"#",'" tabIndex="1" ',b.hrefTarget?' target="'+b.hrefTarget+'"':"",">",'<span unselectable="on">',g.tpl?g.tpl.apply(b):b[g.dataIndex]||g.text,"</span></a>","</td>"];for(h=1,k=f.length;h<k;h++)g=f[h],j.push('<td class="x-treegrid-col ',g.cls?g.cls:"",'">','<div unselectable="on" class="x-treegrid-text"',
g.align?' style="text-align: '+g.align+';"':"",">",g.tpl?g.tpl.apply(b):b[g.dataIndex],"</div>","</td>");j.push('</tr><tr class="x-tree-node-ct"><td colspan="',f.length,'">','<table class="x-treegrid-node-ct-table" cellpadding="0" cellspacing="0" style="table-layout: fixed; display: none; width: ',e.innerCt.getWidth(),'px;"><colgroup>');for(h=0,k=f.length;h<k;h++)j.push('<col style="width: ',f[h].hidden?0:f[h].width,'px;" />');j.push("</colgroup></table></td></tr></tbody>");this.wrap=!0!==d&&a.nextSibling&&
a.nextSibling.ui.getEl()?Ext.DomHelper.insertHtml("beforeBegin",a.nextSibling.ui.getEl(),j.join("")):Ext.DomHelper.insertHtml("beforeEnd",c,j.join(""));this.elNode=this.wrap.childNodes[0];this.ctNode=this.wrap.childNodes[1].firstChild.firstChild;a=this.elNode.firstChild.childNodes;this.indentNode=a[0];this.ecNode=a[1];this.iconNode=a[2];this.anchor=a[3];this.textNode=a[3].firstChild},animExpand:function(a){this.ctNode.style.display="";Ext.ux.tree.TreeGridNodeUI.superclass.animExpand.call(this,a)}});
Ext.ux.tree.TreeGridRootNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{isTreeGridNodeUI:!0,render:function(){if(!this.rendered)this.wrap=this.ctNode=this.node.ownerTree.innerCt.dom,this.node.expanded=!0;if(Ext.isWebKit){var a=this.ctNode;a.style.tableLayout=null;(function(){a.style.tableLayout="fixed"}).defer(1)}},destroy:function(){this.elNode&&Ext.dd.Registry.unregister(this.elNode.id);delete this.node},collapse:Ext.emptyFn,expand:Ext.emptyFn});
Ext.tree.ColumnResizer=Ext.extend(Ext.util.Observable,{minWidth:14,constructor:function(a){Ext.apply(this,a);Ext.tree.ColumnResizer.superclass.constructor.call(this)},init:function(a){this.tree=a;a.on("render",this.initEvents,this)},initEvents:function(a){a.mon(a.innerHd,"mousemove",this.handleHdMove,this);this.tracker=new Ext.dd.DragTracker({onBeforeStart:this.onBeforeStart.createDelegate(this),onStart:this.onStart.createDelegate(this),onDrag:this.onDrag.createDelegate(this),onEnd:this.onEnd.createDelegate(this),
tolerance:3,autoStart:300});this.tracker.initEl(a.innerHd);a.on("beforedestroy",this.tracker.destroy,this.tracker)},handleHdMove:function(a){var b=a.getPageX(),c=a.getTarget(".x-treegrid-hd",3,!0);if(c){var d=c.getRegion(),a=c.dom.style,e=c.dom.parentNode;if(5>=b-d.left&&c.dom!==e.firstChild){for(b=c.dom.previousSibling;b&&Ext.fly(b).hasClass("x-treegrid-hd-hidden");)b=b.previousSibling;if(b)this.activeHd=Ext.get(b),a.cursor=Ext.isWebKit?"e-resize":"col-resize"}else if(5>=d.right-b){for(b=c.dom;b&&
Ext.fly(b).hasClass("x-treegrid-hd-hidden");)b=b.previousSibling;if(b)this.activeHd=Ext.get(b),a.cursor=Ext.isWebKit?"w-resize":"col-resize"}else delete this.activeHd,a.cursor=""}},onBeforeStart:function(){this.dragHd=this.activeHd;return!!this.dragHd},onStart:function(){this.dragHeadersDisabled=this.tree.headersDisabled;this.tree.headersDisabled=!0;this.proxy=this.tree.body.createChild({cls:"x-treegrid-resizer"});this.proxy.setHeight(this.tree.body.getHeight());var a=this.tracker.getXY()[0];this.hdX=
this.dragHd.getX();this.hdIndex=this.tree.findHeaderIndex(this.dragHd);this.proxy.setX(this.hdX);this.proxy.setWidth(a-this.hdX);this.maxWidth=this.tree.outerCt.getWidth()-this.tree.innerBody.translatePoints(this.hdX).left},onDrag:function(){this.proxy.setWidth((this.tracker.getXY()[0]-this.hdX).constrain(this.minWidth,this.maxWidth))},onEnd:function(){var a=this.proxy.getWidth(),b=this.tree,c=this.dragHeadersDisabled;this.proxy.remove();delete this.dragHd;b.columns[this.hdIndex].width=a;b.updateColumnWidths();
setTimeout(function(){b.headersDisabled=c},100)}});Ext.ns("Ext.ux.tree");
Ext.ux.tree.TreeGridSorter=Ext.extend(Ext.tree.TreeSorter,{sortClasses:["sort-asc","sort-desc"],sortAscText:"Sort Ascending",sortDescText:"Sort Descending",constructor:function(a,b){Ext.isObject(b)||(b={property:a.columns[0].dataIndex||"text",folderSort:!0});Ext.ux.tree.TreeGridSorter.superclass.constructor.apply(this,arguments);this.tree=a;a.on("headerclick",this.onHeaderClick,this);a.ddAppendOnly=!0;var c=this;this.defaultSortFn=function(a,b){var f=c.dir&&"desc"==c.dir.toLowerCase(),g=c.property||
"text",h=c.sortType,j=!0===c.caseSensitive,k=c.leafAttr||"leaf",l=a.attributes,n=b.attributes;if(c.folderSort){if(l[k]&&!n[k])return 1;if(!l[k]&&n[k])return-1}k=l[g];g=n[g];n=h?h(k):j?k:k.toUpperCase();v2=h?h(g):j?g:g.toUpperCase();return n<v2?f?1:-1:n>v2?f?-1:1:0};a.on("afterrender",this.onAfterTreeRender,this,{single:!0});a.on("headermenuclick",this.onHeaderMenuClick,this)},onAfterTreeRender:function(){this.tree.hmenu&&this.tree.hmenu.insert(0,{itemId:"asc",text:this.sortAscText,cls:"xg-hmenu-sort-asc"},
{itemId:"desc",text:this.sortDescText,cls:"xg-hmenu-sort-desc"});this.updateSortIcon(0,"asc")},onHeaderMenuClick:function(a,b,c){if("asc"===b||"desc"===b)return this.onHeaderClick(a,null,c),!1},onHeaderClick:function(a,b,c){if(a&&!this.tree.headersDisabled){var d=this;d.property=a.dataIndex;d.dir=a.dir="desc"===a.dir?"asc":"desc";d.sortType=a.sortType;Ext.isBoolean(a.caseSensitive);d.sortFn=a.sortFn||this.defaultSortFn;this.tree.root.cascade(function(a){a.isLeaf()||d.updateSort(d.tree,a)});this.updateSortIcon(c,
a.dir)}},updateSortIcon:function(a,b){var c=this.sortClasses;this.tree.innerHd.select("td").removeClass(c).item(a).addClass(c["desc"==b?1:0])}});Ext.ux.tree.TreeGridLoader=Ext.extend(Ext.tree.TreeLoader,{createNode:function(a){if(!a.uiProvider)a.uiProvider=Ext.ux.tree.TreeGridNodeUI;return Ext.tree.TreeLoader.prototype.createNode.call(this,a)}});
Ext.ux.tree.TreeGrid=Ext.extend(Ext.tree.TreePanel,{rootVisible:!1,useArrows:!0,lines:!1,borderWidth:Ext.isBorderBox?0:2,cls:"x-treegrid",columnResize:!0,enableSort:!0,reserveScrollOffset:!0,enableHdMenu:!0,columnsText:"Columns",initComponent:function(){if(!this.root)this.root=new Ext.tree.AsyncTreeNode({text:"Root"});var a=this.loader;a?Ext.isObject(a)&&!a.load&&(a=new Ext.ux.tree.TreeGridLoader(a)):a=new Ext.ux.tree.TreeGridLoader({dataUrl:this.dataUrl,requestMethod:this.requestMethod,store:this.store});
this.loader=a;Ext.ux.tree.TreeGrid.superclass.initComponent.call(this);this.initColumns();if(this.enableSort)this.treeGridSorter=new Ext.ux.tree.TreeGridSorter(this,this.enableSort);if(this.columnResize)this.colResizer=new Ext.tree.ColumnResizer(this.columnResize),this.colResizer.init(this);if(!this.internalTpl)this.internalTpl=new Ext.XTemplate('<div class="x-grid3-header">','<div class="x-treegrid-header-inner">','<div class="x-grid3-header-offset">','<table style="table-layout: fixed;" cellspacing="0" cellpadding="0" border="0"><colgroup><tpl for="columns"><col /></tpl></colgroup>',
'<thead><tr class="x-grid3-hd-row">','<tpl for="columns">','<td class="x-grid3-hd x-grid3-cell x-treegrid-hd" style="text-align: {align};" id="',this.id,'-xlhd-{#}">','<div class="x-grid3-hd-inner x-treegrid-hd-inner" unselectable="on">',this.enableHdMenu?'<a class="x-grid3-hd-btn" href="#"></a>':"",'{header}<img class="x-grid3-sort-icon" src="',Ext.BLANK_IMAGE_URL,'" />',"</div>","</td></tpl>","</tr></thead>","</table>","</div></div>","</div>",'<div class="x-treegrid-root-node">','<table class="x-treegrid-root-table" cellpadding="0" cellspacing="0" style="table-layout: fixed;"></table>',
"</div>");if(!this.colgroupTpl)this.colgroupTpl=new Ext.XTemplate('<colgroup><tpl for="columns"><col style="width: {width}px"/></tpl></colgroup>')},initColumns:function(){var a=this.columns,b=a.length,c=[],d,e;for(d=0;d<b;d++){e=a[d];if(!e.isColumn)e.xtype=e.xtype?/^tg/.test(e.xtype)?e.xtype:"tg"+e.xtype:"tgcolumn",e=Ext.create(e);e.init(this);c.push(e);if(!1!==this.enableSort&&!1!==e.sortable)this.enableSort=e.sortable=!0}this.columns=c},onRender:function(){Ext.tree.TreePanel.superclass.onRender.apply(this,
arguments);this.el.addClass("x-treegrid");this.outerCt=this.body.createChild({cls:"x-tree-root-ct x-treegrid-ct "+(this.useArrows?"x-tree-arrows":this.lines?"x-tree-lines":"x-tree-no-lines")});this.internalTpl.overwrite(this.outerCt,{columns:this.columns});this.mainHd=Ext.get(this.outerCt.dom.firstChild);this.innerHd=Ext.get(this.mainHd.dom.firstChild);this.innerBody=Ext.get(this.outerCt.dom.lastChild);this.innerCt=Ext.get(this.innerBody.dom.firstChild);this.colgroupTpl.insertFirst(this.innerCt,{columns:this.columns});
if(this.hideHeaders)this.el.child(".x-grid3-header").setDisplayed("none");else if(!1!==this.enableHdMenu){this.hmenu=new Ext.menu.Menu({id:this.id+"-hctx"});if(!1!==this.enableColumnHide)this.colMenu=new Ext.menu.Menu({id:this.id+"-hcols-menu"}),this.colMenu.on({scope:this,beforeshow:this.beforeColMenuShow,itemclick:this.handleHdMenuClick}),this.hmenu.add({itemId:"columns",hideOnClick:!1,text:this.columnsText,menu:this.colMenu,iconCls:"x-cols-icon"});this.hmenu.on("itemclick",this.handleHdMenuClick,
this)}},setRootNode:function(a){a.attributes.uiProvider=Ext.ux.tree.TreeGridRootNodeUI;a=Ext.ux.tree.TreeGrid.superclass.setRootNode.call(this,a);this.innerCt&&this.colgroupTpl.insertFirst(this.innerCt,{columns:this.columns});return a},clearInnerCt:function(){if(Ext.isIE)for(var a=this.innerCt.dom;a.firstChild;)a.removeChild(a.firstChild);else Ext.ux.tree.TreeGrid.superclass.clearInnerCt.call(this)},initEvents:function(){Ext.ux.tree.TreeGrid.superclass.initEvents.apply(this,arguments);this.mon(this.innerBody,
"scroll",this.syncScroll,this);this.mon(this.innerHd,"click",this.handleHdDown,this);this.mon(this.mainHd,{scope:this,mouseover:this.handleHdOver,mouseout:this.handleHdOut})},onResize:function(a,b){Ext.ux.tree.TreeGrid.superclass.onResize.apply(this,arguments);var c=this.innerBody.dom,d=this.innerHd.dom;if(c){if(Ext.isNumber(b))c.style.height=this.body.getHeight(!0)-d.offsetHeight+"px";if(Ext.isNumber(a)){var e=Ext.num(this.scrollOffset,Ext.getScrollBarWidth());if(this.reserveScrollOffset||10<c.offsetWidth-
c.clientWidth)this.setScrollOffset(e);else{var f=this;setTimeout(function(){f.setScrollOffset(10<c.offsetWidth-c.clientWidth?e:0)},10)}}}},updateColumnWidths:function(){var a=this.columns,b=a.length,c=this.outerCt.query("colgroup"),d=c.length,e,f,g,h;for(g=0;g<b;g++){e=a[g];for(h=0;h<d;h++)f=c[h],f.childNodes[g].style.width=(e.hidden?0:e.width)+"px"}for(g=0,c=this.innerHd.query("td"),len=c.length;g<len;g++)e=Ext.fly(c[g]),a[g]&&a[g].hidden?e.addClass("x-treegrid-hd-hidden"):e.removeClass("x-treegrid-hd-hidden");
a=this.getTotalColumnWidth();Ext.fly(this.innerHd.dom.firstChild).setWidth(a+(this.scrollOffset||0));this.outerCt.select("table").setWidth(a);this.syncHeaderScroll()},getVisibleColumns:function(){var a=[],b=this.columns,c=b.length,d;for(d=0;d<c;d++)b[d].hidden||a.push(b[d]);return a},getTotalColumnWidth:function(){for(var a=0,b=0,c=this.getVisibleColumns(),d=c.length;b<d;b++)a+=c[b].width;return a},setScrollOffset:function(a){this.scrollOffset=a;this.updateColumnWidths()},handleHdDown:function(a,
b){var c=a.getTarget(".x-treegrid-hd");if(c&&Ext.fly(b).hasClass("x-grid3-hd-btn")){var d=this.hmenu.items,e=this.columns,f=this.findHeaderIndex(c),e=e[f];a.stopEvent();Ext.fly(c).addClass("x-grid3-hd-menu-open");this.hdCtxIndex=f;this.fireEvent("headerbuttonclick",d,e,c,f);this.hmenu.on("hide",function(){Ext.fly(c).removeClass("x-grid3-hd-menu-open")},this,{single:!0});this.hmenu.show(b,"tl-bl?")}else c&&(f=this.findHeaderIndex(c),this.fireEvent("headerclick",this.columns[f],c,f))},handleHdOver:function(a,
b){var c=a.getTarget(".x-treegrid-hd");if(c&&!this.headersDisabled){index=this.findHeaderIndex(c);this.activeHdRef=b;this.activeHdIndex=index;var d=Ext.get(c);this.activeHdRegion=d.getRegion();d.addClass("x-grid3-hd-over");if(this.activeHdBtn=d.child(".x-grid3-hd-btn"))this.activeHdBtn.dom.style.height=c.firstChild.offsetHeight-1+"px"}},handleHdOut:function(a){var b=a.getTarget(".x-treegrid-hd");if(b&&(!Ext.isIE||!a.within(b,!0)))this.activeHdRef=null,Ext.fly(b).removeClass("x-grid3-hd-over"),b.style.cursor=
""},findHeaderIndex:function(a){for(var a=a.dom||a,b=a.parentNode.childNodes,c=0,d;d=b[c];c++)if(d==a)return c;return-1},beforeColMenuShow:function(){var a=this.columns,b=a.length,c,d;this.colMenu.removeAll();for(c=1;c<b;c++)d=a[c],!1!==d.hideable&&this.colMenu.add(new Ext.menu.CheckItem({itemId:"col-"+c,text:d.header,checked:!d.hidden,hideOnClick:!1,disabled:!1===d.hideable}))},handleHdMenuClick:function(a){var b=this.hdCtxIndex,c=a.getItemId();!1!==this.fireEvent("headermenuclick",this.columns[b],
c,b)&&(b=c.substr(4),0<b&&this.columns[b]&&this.setColumnVisible(b,!a.checked));return!0},setColumnVisible:function(a,b){this.columns[a].hidden=!b;this.updateColumnWidths()},scrollToTop:function(){this.innerBody.dom.scrollTop=0;this.innerBody.dom.scrollLeft=0},syncScroll:function(){this.syncHeaderScroll();var a=this.innerBody.dom;this.fireEvent("bodyscroll",a.scrollLeft,a.scrollTop)},syncHeaderScroll:function(){var a=this.innerBody.dom;this.innerHd.dom.scrollLeft=a.scrollLeft;this.innerHd.dom.scrollLeft=
a.scrollLeft},registerNode:function(a){Ext.ux.tree.TreeGrid.superclass.registerNode.call(this,a);if(!a.uiProvider&&!a.isRoot&&!a.ui.isTreeGridNodeUI)a.ui=new Ext.ux.tree.TreeGridNodeUI(a)}});Ext.reg("treegrid",Ext.ux.tree.TreeGrid);Ext.namespace("Ext.ux");Ext.ux.ColorPicker=function(a){a.bodyStyle={padding:"3px"};Ext.ux.ColorPicker.superclass.constructor.call(this,a);this.initialize(a)};
Ext.extend(Ext.ux.ColorPicker,Ext.util.Observable,{HCHARS:"0123456789ABCDEF",initialize:function(a){this.events={};this.config=this.config||a;this.config.captions=this.config.captions||{};this.config.pickerHotPoint=this.config.pickerHotPoint||{x:3,y:3};this._HSV={h:0,s:100,v:100};this._RGB={r:255,g:255,b:255};this._HEX="000000";this.lastXYRgb={x:0,y:0};this.lastYHue=0;this.domElement=this.config.renderTo||Ext.DomHelper.append(document.body,{},!0);this.domElement.addClass("x-cp-panel");this.cpCreateDomObjects();
this.config.hidePanel&&this.formContainer.hide();this.rgbPicker.on("mousedown",this.rgbPickerClick.createDelegate(this),this);this.huePicker.on("mousedown",this.huePickerClick.createDelegate(this),this);this.wsColorContainer.on("mousedown",this.setColorFromWebsafe.createDelegate(this),this);this.inColorContainer.on("mousedown",this.setColorFromInvert.createDelegate(this),this);Ext.getCmp("redValue"+this.domElement.id).on("change",this.changeRGBField.createDelegate(this));Ext.getCmp("greenValue"+this.domElement.id).on("change",
this.changeRGBField.createDelegate(this));Ext.getCmp("blueValue"+this.domElement.id).on("change",this.changeRGBField.createDelegate(this));Ext.getCmp("hueValue"+this.domElement.id).on("change",this.changeHSVField.createDelegate(this));Ext.getCmp("saturationValue"+this.domElement.id).on("change",this.changeHSVField.createDelegate(this));Ext.getCmp("brightnessValue"+this.domElement.id).on("change",this.changeHSVField.createDelegate(this));Ext.getCmp("colorValue"+this.domElement.id).on("change",this.changeHexaField.createDelegate(this));
Ext.getCmp("redValue"+this.domElement.id).on("specialkey",this.changeRGBField.createDelegate(this));Ext.getCmp("greenValue"+this.domElement.id).on("specialkey",this.changeRGBField.createDelegate(this));Ext.getCmp("blueValue"+this.domElement.id).on("specialkey",this.changeRGBField.createDelegate(this));Ext.getCmp("hueValue"+this.domElement.id).on("specialkey",this.changeHSVField.createDelegate(this));Ext.getCmp("saturationValue"+this.domElement.id).on("specialkey",this.changeHSVField.createDelegate(this));
Ext.getCmp("brightnessValue"+this.domElement.id).on("specialkey",this.changeHSVField.createDelegate(this));Ext.getCmp("colorValue"+this.domElement.id).on({specialkey:function(a,c){c.getKey()===c.ENTER&&this.changeHexaField(a,a.getValue())},scope:this});this.checkConfig();this.addEvents({pickcolor:!0,changergb:!0,changehsv:!0,changehexa:!0})},cpCreateDomObjects:function(){this.rgbPicker=Ext.DomHelper.append(this.domElement,{tag:"div",cls:"x-cp-rgb-msk"},!0);this.rgbPointer=Ext.DomHelper.append(this.rgbPicker,
{tag:"div",cls:"x-cp-rgb-picker"},!0);this.rgbPointer.setXY([this.rgbPicker.getLeft()-this.config.pickerHotPoint.x,this.rgbPicker.getTop()-this.config.pickerHotPoint.y]);this.huePicker=Ext.DomHelper.append(this.domElement,{tag:"div",cls:"x-cp-hue-msk"},!0);this.huePointer=Ext.DomHelper.append(this.huePicker,{tag:"div",cls:"x-cp-hue-picker"},!0);this.huePointer.setXY([this.huePicker.getLeft()+this.huePointer.getWidth()/2+1,this.huePicker.getTop()-this.config.pickerHotPoint.y]);this.formContainer=Ext.DomHelper.append(Ext.DomHelper.append(this.domElement,
{tag:"div",cls:"x-cp-control-container x-unselectable"},!0),{tag:"div",cls:"x-cp-rgb-container x-unselectable",style:"clear:both"},!0);this.colorContainer=Ext.DomHelper.append(this.formContainer,{cls:"x-cp-coloro-container x-unselectable"},!0).update(this.config.captions.color||"Color");this.form=new Ext.FormPanel({frame:!0,width:"auto",height:227,cls:"x-cp-form",labelWidth:12,items:[{xtype:"fieldset",title:"RGB",autoHeight:!0,style:"padding: 2px",defaultType:"numberfield",items:[{fieldLabel:"Red",
id:"redValue"+this.domElement.id},{fieldLabel:"Green",id:"greenValue"+this.domElement.id},{fieldLabel:"Blue",id:"blueValue"+this.domElement.id}]},{xtype:"fieldset",title:"HSV",autoHeight:!0,style:"padding: 2px",defaultType:"numberfield",items:[{fieldLabel:"Hue",id:"hueValue"+this.domElement.id},{fieldLabel:"Satur.",id:"saturationValue"+this.domElement.id},{fieldLabel:"Bright.",id:"brightnessValue"+this.domElement.id}]},{xtype:"fieldset",title:"Color",autoHeight:!0,style:"padding: 2px",defaultType:"textfield",
items:[{fieldLabel:"Color",id:"colorValue"+this.domElement.id}]}]});this.form.render(this.formContainer);var a=Ext.DomHelper.append(this.form.body,{cls:"x-cp-colors-container x-unselectable"},!0);this.wsColorContainer=Ext.DomHelper.append(a,{cls:"x-cp-color-container x-unselectable"},!0).update(this.config.captions.websafe||"Websafe");this.inColorContainer=Ext.DomHelper.append(a,{cls:"x-cp-color-container x-unselectable"},!0).update(this.config.captions.inverse||"Inverse");Ext.DomHelper.append(a,
{tag:"div",style:"height:0px;border:none;clear:both;font-size:1px;"});this.form.render(this.formContainer);Ext.DomHelper.append(this.domElement,{tag:"div",style:"height:0px;border:none;clear:both;font-size:1px;"})},realToDec:function(a){return Math.min(255,Math.round(256*a))},hsvToRgb:function(a,b,c){if(a instanceof Array)return this.hsvToRgb.call(this,a[0],a[1],a[2]);var d,e,f,g,h,j;g=Math.floor(a/60%6);h=a/60-g;a=c*(1-b);j=c*(1-h*b);b=c*(1-(1-h)*b);switch(g){case 0:d=c;e=b;f=a;break;case 1:d=j;
e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=j;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c,e=a,f=j}return[this.realToDec(d),this.realToDec(e),this.realToDec(f)]},rgbToHsv:function(a,b,c){if(a instanceof Array)return this.rgbToHsv.call(this,a[0],a[1],a[2]);var a=a/255,b=b/255,c=c/255,d,e,f,g;d=Math.min(Math.min(a,b),c);e=Math.max(Math.max(a,b),c);f=e-d;switch(e){case d:g=0;break;case a:g=60*(b-c)/f;b<c&&(g+=360);break;case b:g=60*(c-a)/f+120;break;case c:g=60*(a-b)/f+240}return[Math.round(g),
0===e?0:1-d/e,e]},rgbToHex:function(a,b,c){return a instanceof Array?this.rgbToHex.call(this,a[0],a[1],a[2]):this.decToHex(a)+this.decToHex(b)+this.decToHex(c)},decToHex:function(a){a=parseInt(a,10);a=!isNaN(a)?a:0;a=255<a||0>a?0:a;return this.HCHARS.charAt((a-a%16)/16)+this.HCHARS.charAt(a%16)},getHCharPos:function(a){return this.HCHARS.indexOf(a.toUpperCase())},hexToDec:function(a){a=a.split("");return 16*this.getHCharPos(a[0])+this.getHCharPos(a[1])},hexToRgb:function(a){return[this.hexToDec(a.substr(0,
2)),this.hexToDec(a.substr(2,2)),this.hexToDec(a.substr(4,2))]},checkSafeNumber:function(a){if(!isNaN(a)){var a=Math.min(Math.max(0,a),255),b,c;for(b=0;256>b;b+=51)if(c=b+51,a>=b&&a<=c)return 25<a-b?c:b}return a},websafe:function(a,b,c){return a instanceof Array?this.websafe.call(this,a[0],a[1],a[2]):[this.checkSafeNumber(a),this.checkSafeNumber(b),this.checkSafeNumber(c)]},invert:function(a,b,c){return a instanceof Array?this.invert.call(this,a[0],a[1],a[2]):[255-a,255-b,255-c]},getHue:function(a){a=
360-Math.round(360*((this.huePicker.getHeight()-a)/this.huePicker.getHeight()));return 360===a?0:a},getHPos:function(a){return a*(this.huePicker.getHeight()/360)},getSaturation:function(a){return a/this.rgbPicker.getWidth()},getSPos:function(a){return a*this.rgbPicker.getWidth()},getValue:function(a){return(this.rgbPicker.getHeight()-a)/this.rgbPicker.getHeight()},getVPos:function(a){return this.rgbPicker.getHeight()-a*this.rgbPicker.getHeight()},updateColorsFromRGBPicker:function(){this._HSV={h:this._HSV.h,
s:this.getSaturation(this.lastXYRgb.x),v:this.getValue(this.lastXYRgb.y)}},updateColorsFromHUEPicker:function(){this._HSV.h=this.getHue(this.lastYHue);var a=this.hsvToRgb(this._HSV.h,1,1),a=this.rgbToHex(a[0],a[1],a[2]);this.rgbPicker.setStyle({backgroundColor:"#"+a})},updateColorsFromRGBFields:function(){var a=this.rgbToHsv(Ext.getCmp("redValue"+this.domElement.id).getValue(),Ext.getCmp("greenValue"+this.domElement.id).getValue(),Ext.getCmp("blueValue"+this.domElement.id).getValue());this._HSV={h:a[0],
s:a[1],v:a[2]}},updateColorsFromHexaField:function(){var a=this.hexToRgb(this._HEX);this._RGB={r:a[0],g:a[1],b:a[2]};a=this.rgbToHsv(a[0],a[1],a[2]);this._HSV={h:a[0],s:a[1],v:a[2]}},updateColorsFromHSVFields:function(){var a=this.hsvToRgb(this._HSV.h,this._HSV.s,this._HSV.v);this._RGB={r:a[0],g:a[1],b:a[2]}},updateRGBFromHSV:function(){var a=this.hsvToRgb(this._HSV.h,this._HSV.s,this._HSV.v);this._RGB={r:a[0],g:a[1],b:a[2]}},updateInputFields:function(){Ext.getCmp("redValue"+this.domElement.id).setValue(this._RGB.r);
Ext.getCmp("greenValue"+this.domElement.id).setValue(this._RGB.g);Ext.getCmp("blueValue"+this.domElement.id).setValue(this._RGB.b);Ext.getCmp("hueValue"+this.domElement.id).setValue(this._HSV.h);Ext.getCmp("saturationValue"+this.domElement.id).setValue(Math.round(100*this._HSV.s));Ext.getCmp("brightnessValue"+this.domElement.id).setValue(Math.round(100*this._HSV.v));Ext.getCmp("colorValue"+this.domElement.id).setValue(this._HEX)},updateColor:function(){this._HEX=this.rgbToHex(this._RGB.r,this._RGB.g,
this._RGB.b);this.colorContainer.setStyle({backgroundColor:"#"+this._HEX});this.colorContainer.set({title:"#"+this._HEX});var a=this.rgbToHex(this.websafe(this._RGB.r,this._RGB.g,this._RGB.b));this.wsColorContainer.setStyle({backgroundColor:"#"+a});this.wsColorContainer.set({title:"#"+a});this.wsColorContainer.setStyle({color:"#"+this.rgbToHex(this.invert(this.websafe(this._RGB.r,this._RGB.g,this._RGB.b)))});a=this.rgbToHex(this.invert(this._RGB.r,this._RGB.g,this._RGB.b));this.inColorContainer.setStyle({backgroundColor:"#"+
a});this.inColorContainer.setStyle({color:"#"+this._HEX});this.inColorContainer.set({title:"#"+a});this.colorContainer.setStyle({color:"#"+a});this.updateInputFields();this.fireEvent("pickcolor",this,this._HEX)},updatePickers:function(){this.lastXYRgb={x:this.getSPos(this._HSV.s),y:this.getVPos(this._HSV.v)};this.rgbPointer.setXY([this.lastXYRgb.x-this.config.pickerHotPoint.x+this.rgbPicker.getLeft(),this.lastXYRgb.y-this.config.pickerHotPoint.y+this.rgbPicker.getTop()],this.config.animate);this.lastYHue=
this.getHPos(this._HSV.h);this.huePointer.setXY([this.huePicker.getLeft()+this.huePointer.getWidth()/2+1,this.lastYHue+this.huePicker.getTop()-this.config.pickerHotPoint.y],this.config.animate);var a=this.hsvToRgb(this._HSV.h,1,1),a=this.rgbToHex(a[0],a[1],a[2]);this.rgbPicker.setStyle({backgroundColor:"#"+a})},rgbPickerClick:function(a){this.lastXYRgb={x:a.getPageX()-this.rgbPicker.getLeft(),y:a.getPageY()-this.rgbPicker.getTop()};this.rgbPointer.setXY([a.getPageX()-this.config.pickerHotPoint.x,
a.getPageY()-this.config.pickerHotPoint.y],this.config.animate);this.updateColorsFromRGBPicker();this.updateRGBFromHSV();this.updateColor()},huePickerClick:function(a){this.lastYHue=a.getPageY()-this.huePicker.getTop();this.huePointer.setY([a.getPageY()-3],this.config.animate);this.updateColorsFromHUEPicker();this.updateRGBFromHSV();this.updateColor()},changeRGBField:function(a,b){b instanceof String||(b=a.getValue());0>b&&(b=0);255<b&&(b=255);if(a==Ext.getCmp("redValue"+this.domElement.id))this._RGB.r=
b;else if(a==Ext.getCmp("greenValue"+this.domElement.id))this._RGB.g=b;else if(a==Ext.getCmp("blueValue"+this.domElement.id))this._RGB.b=b;this.updateColorsFromRGBFields();this.updateColor();this.updatePickers();this.fireEvent("changergb",this,this._RGB)},changeHSVField:function(a,b){b instanceof String||(b=a.getValue());if(a==Ext.getCmp("hueValue"+this.domElement.id))0>b&&(b=0),360<b&&(b=360),this._HSV.h=b;else if(0>b&&(b=0),100<b&&(b=100),a==Ext.getCmp("saturationValue"+this.domElement.id))this._HSV.s=
b/100;else if(a==Ext.getCmp("brightnessValue"+this.domElement.id))this._HSV.v=b/100;this.updateColorsFromHSVFields();this.updateColor();this.updatePickers();this.fireEvent("changehsv",this,this._HSV)},changeHexaField:function(a,b){b=b.trim().substring(0,6);3===b.length&&(b=b[0]+b[0]+b[1]+b[1]+b[2]+b[2]);b.match(/^[0-9a-f]{6}$/i)||(b="000000");this._HEX=b;this.updateColorsFromHexaField();this.updateColor();this.updatePickers();this.fireEvent("changehexa",this,this._HEX)},setColorFromWebsafe:function(){this.setColor(this.wsColorContainer.getColor("backgroundColor",
"",""))},setColorFromInvert:function(){this.setColor(this.inColorContainer.getColor("backgroundColor","",""))},checkConfig:function(){this.config&&(this.config.color?this.setColor(this.config.color):this.config.hsv?this.setHSV(this.config.hsv):this.config.rgb&&this.setRGB(this.config.rgb))},setColor:function(a){a=this.hexToRgb(a);this._RGB={r:a[0],g:a[1],b:a[2]};a=this.rgbToHsv(a);this._HSV={h:a[0],s:a[1],v:a[2]};this.updateColor();this.updatePickers()},setRGB:function(a){this._RGB=a;a=this.rgbToHsv(a.r,
a.g,a.b);this._HSV={h:a[0],s:a[1],v:a[2]};this.updateColor();this.updatePickers()},setHSV:function(a){this._HSV={h:a.h,s:a.s/100,v:a.v/100};a=this.hsvToRgb(a.h,a.s/100,a.v/100);this._RGB={r:a[0],g:a[1],b:a[2]};this.updateColor();this.updatePickers()},getColor:function(a){return(a?"":"#")+this._HEX},getRGB:function(){return this._RGB},getHSV:function(){return this._HSV},setPanelVisible:function(a,b){return this.formContainer.setVisible(a,b)},isPanelVisible:function(){return this.formContainer.isDisplayed()},
showPicker:function(){this.domElement.show()},hidePicker:function(){this.domElement.hide()}});Ext.ux.ColorPanel=function(a){this.config=a;this.config.renderTo=this.config.renderTo||Ext.DomHelper.append(document.body,{},!0);Ext.ux.ColorPanel.superclass.constructor.call(this,a);this.domElement=Ext.get(this.config.renderTo);this.render(this.domElement);this.config.renderTo=this.body;this.initialize(this.config);this.getEl().addClass("x-cp-panel");this.domElement.removeClass("x-cp-panel");this.body.setStyle({padding:"5px"})};
Ext.extend(Ext.ux.ColorPanel,Ext.Panel);Ext.applyIf(Ext.ux.ColorPanel.prototype,Ext.ux.ColorPicker.prototype);
Ext.ux.ColorDialog=function(a){this.config=a;this.config.resizable=!1;this.config.renderTo=this.config.renderTo||Ext.DomHelper.append(document.body,{},!0);Ext.ux.ColorDialog.superclass.constructor.call(this,a);this.domElement=Ext.get(this.config.renderTo);this.render(this.domElement);this.config.renderTo=this.body;this.initialize(this.config);this.body.addClass("x-cp-panel");this.body.setStyle({padding:"5px"});this.setSize(398,300)};Ext.extend(Ext.ux.ColorDialog,Ext.Window);
Ext.applyIf(Ext.ux.ColorDialog.prototype,Ext.ux.ColorPicker.prototype);Ext.namespace("Styler");Styler.ColorManager=function(a){Ext.apply(this,a)};
Ext.apply(Styler.ColorManager.prototype,{field:null,init:function(a){this.register(a)},destroy:function(){this.field&&this.unregister(this.field)},register:function(a){this.field&&this.unregister(this.field);this.field=a;a.on({focus:this.fieldFocus,destroy:this.destroy,scope:this})},unregister:function(a){a.un("focus",this.fieldFocus,this);a.un("destroy",this.destroy,this);Styler.ColorManager.picker&&a==this.field&&Styler.ColorManager.picker.un("pickcolor",this.setFieldValue,this);this.field=null},
fieldFocus:function(){if(!Styler.ColorManager.pickerWin)Styler.ColorManager.picker=new Ext.ux.ColorPanel({hidePanel:!1,autoHeight:!1}),Styler.ColorManager.pickerWin=new Ext.Window({title:"Color Picker",layout:"fit",closeAction:"hide",width:405,height:300,plain:!0,items:Styler.ColorManager.picker});Styler.ColorManager.picker.purgeListeners();this.setPickerValue();Styler.ColorManager.picker.on({pickcolor:this.setFieldValue,scope:this});Styler.ColorManager.pickerWin.show()},setFieldValue:function(a,
b){this.field.isVisible()&&this.field.setValue("#"+b)},setPickerValue:function(){var a=this.field;(a=a.getHexValue?a.getHexValue():a.getValue())&&Styler.ColorManager.picker.setColor(a.substring(1))}});(function(){Ext.util.Observable.observeClass(gxp.form.ColorField);gxp.form.ColorField.on({render:function(a){(new Styler.ColorManager).register(a)}})})();Styler.ColorManager.picker=null;Styler.ColorManager.pickerWin=null;Ext.USE_NATIVE_JSON=!0;
Ext.override(Ext.dd.DragTracker,{onMouseMove:function(a){if(this.active&&Ext.isIE&&!Ext.isIE9&&!a.browserEvent.button)a.preventDefault(),this.onMouseUp(a);else{a.preventDefault();var b=a.getXY(),c=this.startXY;this.lastXY=b;if(!this.active)if(Math.abs(c[0]-b[0])>this.tolerance||Math.abs(c[1]-b[1])>this.tolerance)this.triggerStart(a);else return;this.fireEvent("mousemove",this,a);this.onDrag(a);this.fireEvent("drag",this,a)}}});
(function(){Ext.preg("gx_wmssource",gxp.plugins.WMSSource);Ext.preg("gx_olsource",gxp.plugins.OLSource);Ext.preg("gx_googlesource",gxp.plugins.GoogleSource);Ext.preg("gx_bingsource",gxp.plugins.BingSource);Ext.preg("gx_osmsource",gxp.plugins.OSMSource);Ext.preg("gxp_layertree",gxp.plugins.LayerManager)})();
var GeoExplorer=Ext.extend(gxp.Viewer,{zoomSliderText:"<div>Zoom Level: {zoom}</div><div>Scale: 1:{scale}</div>",loadConfigErrorText:"Trouble reading saved configuration: <br />",loadConfigErrorDefaultText:"Server Error.",xhrTroubleText:"Communication Trouble: Status ",layersText:"Layers",titleText:"Title",bookmarkText:"Bookmark URL",permakinkText:"Permalink",appInfoText:"GeoExplorer",aboutText:"About GeoExplorer",mapInfoText:"Map Info",descriptionText:"Description",contactText:"Contact",aboutThisMapText:"About this Map",
mapPanel:null,constructor:function(a){this.mapItems=[{xtype:"gxp_scaleoverlay"},{xtype:"gx_zoomslider",vertical:!0,height:100,plugins:new GeoExt.ZoomSliderTip({template:this.zoomSliderText})}];a.viewerTools=[{hidden:!0,actions:["layerchooser"],checked:!0},{hidden:!0,actions:["-"],checked:!0},{leaf:!0,text:gxp.plugins.Print.prototype.tooltip,ptype:"gxp_print",iconCls:"gxp-icon-print",customParams:{outputFilename:"GeoExplorer-print"},printService:a.printService,checked:!0},{leaf:!0,text:gxp.plugins.Navigation.prototype.tooltip,
checked:!0,iconCls:"gxp-icon-pan",ptype:"gxp_navigation",toggleGroup:"navigation"},{leaf:!0,text:gxp.plugins.WMSGetFeatureInfo.prototype.infoActionTip,checked:!0,iconCls:"gxp-icon-getfeatureinfo",ptype:"gxp_wmsgetfeatureinfo",format:"grid",toggleGroup:"interaction"},{leaf:!0,text:gxp.plugins.Measure.prototype.measureTooltip,checked:!0,iconCls:"gxp-icon-measure-length",ptype:"gxp_measure",controlOptions:{immediate:!0},toggleGroup:"interaction"},{leaf:!0,text:gxp.plugins.Zoom.prototype.zoomInTooltip+
" / "+gxp.plugins.Zoom.prototype.zoomOutTooltip,checked:!0,iconCls:"gxp-icon-zoom-in",ptype:"gxp_zoom"},{leaf:!0,text:gxp.plugins.NavigationHistory.prototype.previousTooltip+" / "+gxp.plugins.NavigationHistory.prototype.nextTooltip,checked:!0,iconCls:"gxp-icon-zoom-previous",ptype:"gxp_navigationhistory"},{leaf:!0,text:gxp.plugins.ZoomToExtent.prototype.tooltip,checked:!0,iconCls:gxp.plugins.ZoomToExtent.prototype.iconCls,ptype:"gxp_zoomtoextent"},{leaf:!0,text:gxp.plugins.Legend.prototype.tooltip,
checked:!0,iconCls:"gxp-icon-legend",ptype:"gxp_legend"},{leaf:!0,text:gxp.plugins.GoogleEarth.prototype.tooltip,checked:!0,iconCls:"gxp-icon-googleearth",ptype:"gxp_googleearth"},{hidden:!0,actions:["->"],checked:!0},{hidden:!0,actions:["aboutbutton"],checked:!0}];GeoExplorer.superclass.constructor.apply(this,arguments)},loadConfig:function(a){var b=window.location.hash.substr(1),c=b.match(/^maps\/(\d+)$/);if(c)this.id=Number(c[1]),OpenLayers.Request.GET({url:"../"+b,success:function(b){b=Ext.util.JSON.decode(b.responseText);
delete b.tools;this.applyConfig(Ext.applyIf(b,a))},failure:function(b){var c;try{c=Ext.util.JSON.decode(b.responseText)}catch(d){}var e=this.loadConfigErrorText,e=c&&c.error?e+c.error:e+this.loadConfigErrorDefaultText;this.on({ready:function(){this.displayXHRTrouble(e,b.status)},scope:this});delete this.id;window.location.hash="";this.applyConfig(a)},scope:this});else{if(b=Ext.urlDecode(document.location.search.substr(1))){b.q&&(c=Ext.util.JSON.decode(b.q),Ext.apply(a,c));if(b.layers)for(var c=b.layers.split(/\s*,\s*/),
d=0,e=c.length;d<e;++d)a.map.layers.push({source:"local",name:c[d],visibility:!0,bbox:b.lazy&&b.bbox?b.bbox.split(","):void 0});if(b.bbox)delete a.map.zoom,delete a.map.center,a.map.extent=b.bbox.split(/\s*,\s*/);if(b.lazy&&a.sources.local)a.sources.local.requiredProperties=[]}this.applyConfig(a)}},displayXHRTrouble:function(a,b){Ext.Msg.show({title:this.xhrTroubleText+b,msg:a,icon:Ext.MessageBox.WARNING})},initPortal:function(){this.createTools();GeoExplorer.superclass.initPortal.apply(this,arguments)},
createTools:function(){new Ext.Button({id:"aboutbutton",text:this.appInfoText,iconCls:"icon-geoexplorer",handler:this.displayAppInfo,scope:this})},showUrl:function(){var a=new Ext.Window({title:this.bookmarkText,layout:"form",labelAlign:"top",modal:!0,bodyStyle:"padding: 5px",width:300,items:[{xtype:"textfield",fieldLabel:this.permakinkText,readOnly:!0,anchor:"100%",selectOnFocus:!0,value:window.location.href}]});a.show();a.items.first().selectText()},getBookmark:function(){var a=Ext.apply(OpenLayers.Util.getParameters(),
{q:Ext.util.JSON.encode(this.getState())});return document.location.href.split("?").shift()+"?"+Ext.urlEncode(a)},displayAppInfo:function(){var a=new Ext.Panel({title:this.appInfoText,html:"<iframe style='border: none; height: 100%; width: 100%' src='../about.html' frameborder='0' border='0'><a target='_blank' href='../about.html'>"+this.aboutText+"</a> </iframe>"}),b=Ext.applyIf(this.about,{title:"","abstract":"",contact:""}),b=new Ext.Panel({title:this.mapInfoText,html:'<div class="gx-info-panel"><h2>'+
this.titleText+"</h2><p>"+b.title+"</p><h2>"+this.descriptionText+"</h2><p>"+b["abstract"]+"</p> <h2>"+this.contactText+"</h2><p>"+b.contact+"</p></div>",height:"auto",width:"auto"}),a=new Ext.TabPanel({activeTab:0,items:[b,a]});(new Ext.Window({title:this.aboutThisMapText,modal:!0,layout:"fit",width:300,height:300,items:[a]})).show()},getState:function(){var a=GeoExplorer.superclass.getState.apply(this,arguments);delete a.tools;return a}});
GeoExplorer.Composer=Ext.extend(GeoExplorer,{cookieParamName:"geoexplorer-user",mapText:"Map",saveMapText:"Save map",exportMapText:"Export map",toolsTitle:"Choose tools to include in the toolbar:",previewText:"Preview",backText:"Back",nextText:"Next",loginText:"Login",logoutText:"Logout, {user}",loginErrorText:"Invalid username or password.",userFieldText:"User",passwordFieldText:"Password",saveErrorText:"Trouble saving: ",tableText:"Table",queryText:"Query",constructor:function(a){if(401===a.authStatus)this.authorizedRoles=
[];else if(404!==a.authStatus)this.authorizedRoles=["ROLE_ADMINISTRATOR"];delete a.authStatus;a.tools=[{ptype:"gxp_layermanager",outputConfig:{id:"layers",tbar:[],autoScroll:!0},outputTarget:"tree"},{ptype:"gxp_addlayers",actionTarget:"layers.tbar",outputTarget:"tree",uploadSource:"local",postUploadAction:{plugin:"layerproperties",outputConfig:{activeTab:2}}},{ptype:"gxp_removelayer",actionTarget:["layers.tbar","layers.contextMenu"]},{ptype:"gxp_layerproperties",id:"layerproperties",outputConfig:{defaults:{autoScroll:!0},
width:320},actionTarget:["layers.tbar","layers.contextMenu"],outputTarget:"tree"},{ptype:"gxp_styler",id:"styler",outputConfig:{autoScroll:!0,width:320},actionTarget:["layers.tbar","layers.contextMenu"],outputTarget:"tree"},{ptype:"gxp_zoomtolayerextent",actionTarget:{target:"layers.contextMenu",index:0}},{ptype:"gxp_googleearth",actionTarget:["map.tbar","globe.tbar"]},{ptype:"gxp_navigation",toggleGroup:"navigation"},{ptype:"gxp_zoom",toggleGroup:"navigation",showZoomBoxAction:!0,controlOptions:{zoomOnClick:!1}},
{ptype:"gxp_navigationhistory"},{ptype:"gxp_zoomtoextent"},{actions:["aboutbutton"],actionTarget:"paneltbar"},{actions:["-"],actionTarget:"paneltbar"},{actions:["mapmenu"],actionTarget:"paneltbar"},{ptype:"gxp_print",customParams:{outputFilename:"GeoExplorer-print"},printService:a.printService,actionTarget:"paneltbar",showButtonText:!0},{actions:["-"],actionTarget:"paneltbar"},{ptype:"gxp_wmsgetfeatureinfo",format:"grid",toggleGroup:"interaction",showButtonText:!0,actionTarget:"paneltbar"},{ptype:"gxp_featuremanager",
id:"querymanager",selectStyle:{cursor:""},autoLoadFeatures:!0,maxFeatures:50,paging:!0,pagingType:gxp.plugins.FeatureManager.WFS_PAGING},{ptype:"gxp_queryform",featureManager:"querymanager",autoExpand:"query",actionTarget:"paneltbar",outputTarget:"query"},{ptype:"gxp_featuregrid",featureManager:"querymanager",showTotalResults:!0,autoLoadFeature:!1,alwaysDisplayOnMap:!0,controlOptions:{multiple:!0},displayMode:"selected",outputTarget:"table",outputConfig:{id:"featuregrid",columnsSortable:!1}},{ptype:"gxp_zoomtoselectedfeatures",
featureManager:"querymanager",actionTarget:["featuregrid.contextMenu","featuregrid.bbar"]},{ptype:"gxp_measure",toggleGroup:"interaction",controlOptions:{immediate:!0},showButtonText:!0,actionTarget:"paneltbar"},{ptype:"gxp_featuremanager",id:"featuremanager",maxFeatures:20,paging:!1},{ptype:"gxp_featureeditor",featureManager:"featuremanager",autoLoadFeature:!0,splitButton:!0,showButtonText:!0,toggleGroup:"interaction",actionTarget:"paneltbar"},{actions:["->"],actionTarget:"paneltbar"},{actions:["loginbutton"],
actionTarget:"paneltbar"}];GeoExplorer.Composer.superclass.constructor.apply(this,arguments)},loadConfig:function(a){GeoExplorer.Composer.superclass.loadConfig.apply(this,arguments);var b=Ext.urlDecode(document.location.search.substr(1));if(b&&b.styler){for(var c=a.map.layers.length-1;0<=c;--c)delete a.map.layers[c].selected;a.map.layers.push({source:"local",name:b.styler,selected:!0,bbox:b.lazy&&b.bbox?b.bbox.split(","):void 0});this.on("layerselectionchange",function(a){var c=this.tools.styler;
(a=a.getLayer().maxExtent)&&!b.bbox&&this.mapPanel.map.zoomToExtent(a);this.doAuthorized(c.roles,c.addOutput,c)},this,{single:!0})}},setCookieValue:function(a,b){document.cookie=a+"="+escape(b)},clearCookieValue:function(a){document.cookie=a+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"},getCookieValue:function(a){var b,c,d,e=document.cookie.split(";");for(b=0;b<e.length;b++)if(c=e[b].substr(0,e[b].indexOf("=")),d=e[b].substr(e[b].indexOf("=")+1),c=c.replace(/^\s+|\s+$/g,""),c==a)return unescape(d);
return null},logout:function(){this.clearCookieValue("JSESSIONID");this.clearCookieValue(this.cookieParamName);this.setAuthorizedRoles([]);Ext.getCmp("paneltbar").items.each(function(a){!0===a.needsAuthorization&&a.disable()});this.showLogin()},authenticate:function(){function a(){b.buttons[0].disable();b.getForm().submit({success:function(a){Ext.getCmp("paneltbar").items.each(function(a){!0===a.needsAuthorization&&a.enable()});a=a.findField("username").getValue();this.setCookieValue(this.cookieParamName,
a);this.setAuthorizedRoles(["ROLE_ADMINISTRATOR"]);this.showLogout(a);c.un("beforedestroy",this.cancelAuthentication,this);c.close()},failure:function(a){this.authorizedRoles=[];b.buttons[0].enable();a.markInvalid({username:this.loginErrorText,password:this.loginErrorText})},scope:this})}var b=new Ext.FormPanel({url:"../login/",frame:!0,labelWidth:60,defaultType:"textfield",errorReader:{read:function(a){var b=!1,c=[];200===a.status?b=!0:c=[{data:{id:"username",msg:this.loginErrorText}},{data:{id:"password",
msg:this.loginErrorText}}];return{success:b,records:c}}},items:[{fieldLabel:this.userFieldText,name:"username",allowBlank:!1,listeners:{render:function(){this.focus(!0,100)}}},{fieldLabel:this.passwordFieldText,name:"password",inputType:"password",allowBlank:!1}],buttons:[{text:this.loginText,formBind:!0,handler:a,scope:this}],keys:[{key:[Ext.EventObject.ENTER],handler:a,scope:this}]}),c=new Ext.Window({title:this.loginText,layout:"fit",width:235,height:130,plain:!0,border:!1,modal:!0,items:[b],listeners:{beforedestroy:this.cancelAuthentication,
scope:this}});c.show()},applyLoginState:function(a,b,c,d){var e=Ext.getCmp("loginbutton");e.setIconClass(a);e.setText(b);e.setHandler(c,d)},showLogin:function(){this.applyLoginState("login",this.loginText,this.authenticate,this)},showLogout:function(a){var b=this.logout;this.applyLoginState("logout",(new Ext.Template(this.logoutText)).applyTemplate({user:a}),b,this)},initPortal:function(){var a=new gxp.CrumbPanel({id:"tree",region:"west",width:320,split:!0,collapsible:!0,collapseMode:"mini",hideCollapseTool:!0,
header:!1}),b=new Ext.Panel({region:"south",id:"south",height:220,border:!1,split:!0,collapsible:!0,collapseMode:"mini",collapsed:!0,hideCollapseTool:!0,header:!1,layout:"border",items:[{region:"center",id:"table",title:this.tableText,layout:"fit"},{region:"west",width:320,id:"query",title:this.queryText,split:!0,collapsible:!0,collapseMode:"mini",collapsed:!0,hideCollapseTool:!0,layout:"fit"}]}),c=new Ext.Toolbar({disabled:!0,id:"paneltbar",items:[]});this.on("ready",function(){var a=c.items.filterBy(function(a){return a.initialConfig&&
a.initialConfig.disabled});c.enable();a.each(function(a){a.disable()})});var d=new gxp.GoogleEarthPanel({mapPanel:this.mapPanel,id:"globe",tbar:[],listeners:{beforeadd:function(a){return"background"!==a.get("group")}}}),e=[];d.on("show",function(){e.length=0;c.items.each(function(a){a.disabled&&e.push(a)});c.disable();for(var a in this.tools){var b=this.tools[a];"map"===b.outputTarget&&b.removeOutput()}if(a=(a=Ext.getCmp("tree"))&&a.getTopToolbar())a.items.each(function(a){a.disabled&&e.push(a)}),
a.disable()},this);d.on("hide",function(){c.enable();var a=Ext.getCmp("tree");(a=a&&a.getTopToolbar())&&a.enable();for(var a=0,b=e.length;a<b;++a)e[a].disable()},this);this.mapPanelContainer=new Ext.Panel({layout:"card",region:"center",defaults:{border:!1},items:[this.mapPanel,d],activeItem:0});this.portalItems=[{region:"center",layout:"border",tbar:c,items:[this.mapPanelContainer,a,b]}];GeoExplorer.Composer.superclass.initPortal.apply(this,arguments)},createTools:function(){GeoExplorer.Composer.superclass.createTools.apply(this,
arguments);new Ext.Button({id:"loginbutton"});if(this.authorizedRoles)if(0===this.authorizedRoles.length)this.showLogin();else{var a=this.getCookieValue(this.cookieParamName);null===a&&(a="unknown");this.showLogout(a)}new Ext.Button({id:"mapmenu",text:this.mapText,iconCls:"icon-map",menu:new Ext.menu.Menu({items:[{text:this.exportMapText,handler:function(){this.doAuthorized(["ROLE_ADMINISTRATOR"],function(){this.save(this.showEmbedWindow)},this)},scope:this,iconCls:"icon-export"},{text:this.saveMapText,
handler:function(){this.doAuthorized(["ROLE_ADMINISTRATOR"],function(){this.save(this.showUrl)},this)},scope:this,iconCls:"icon-save"}]})})},openPreview:function(a){a=new Ext.Window({title:this.previewText,layout:"fit",resizable:!1,items:[{border:!1,html:a.getIframeHTML()}]});a.show();var a=a.items.get(0).body,b=a.dom.firstChild,c=new Ext.LoadMask(a);c.show();Ext.get(b).on("load",function(){c.hide()})},showEmbedWindow:function(){var a=new Ext.tree.TreePanel({title:this.toolsTitle,autoScroll:!0,root:{nodeType:"async",
expanded:!0,children:this.viewerTools},rootVisible:!1,id:"geobuilder-0"}),b=function(a){var b=Ext.getCmp("geobuilder-wizard-panel").getLayout(),c=b.activeItem.id.split("geobuilder-")[1],c=parseInt(c,10)+a;b.setActiveItem(c);Ext.getCmp("wizard-prev").setDisabled(0==c);Ext.getCmp("wizard-next").setDisabled(1==c);1==a&&this.save()},c=new gxp.EmbedMapDialog({id:"geobuilder-1",url:"../viewer/#maps/"+this.id}),a={id:"geobuilder-wizard-panel",border:!1,layout:"card",activeItem:0,defaults:{border:!1,hideMode:"offsets"},
bbar:[{id:"preview",text:this.previewText,handler:function(){this.save(this.openPreview.createDelegate(this,[c]))},scope:this},"->",{id:"wizard-prev",text:this.backText,handler:b.createDelegate(this,[-1]),scope:this,disabled:!0},{id:"wizard-next",text:this.nextText,handler:b.createDelegate(this,[1]),scope:this}],items:[a,c]};(new Ext.Window({layout:"fit",width:500,height:300,title:this.exportMapText,items:[a]})).show()}});Ext.namespace("GeoExplorer");
GeoExplorer.Viewer=Ext.extend(GeoExplorer,{applyConfig:function(a){for(var b=a.viewerTools||this.viewerTools,c=[],d,e=0,f=b.length;e<f;e++)if(d=b[e],!0===d.checked){var g="checked,iconCls,id,leaf,loader,text".split(","),h;for(h in g)delete d[g[h]];d=Ext.applyIf({actionTarget:"paneltbar"},d);c.push(d)}a.tools=c;GeoExplorer.Viewer.superclass.applyConfig.call(this,a)},initPortal:function(){this.toolbar=new Ext.Toolbar({disabled:!0,id:"paneltbar"});this.on("ready",function(){this.toolbar.enable()},this);
this.mapPanelContainer=new Ext.Panel({layout:"card",region:"center",defaults:{border:!1},items:[this.mapPanel,new gxp.GoogleEarthPanel({mapPanel:this.mapPanel,listeners:{beforeadd:function(a){return"background"!==a.get("group")}}})],activeItem:0});this.portalItems=[{region:"center",layout:"border",tbar:this.toolbar,items:[this.mapPanelContainer]}];GeoExplorer.Viewer.superclass.initPortal.apply(this,arguments)},createTools:function(){GeoExplorer.Viewer.superclass.createTools.apply(this,arguments);
Ext.getCmp("aboutbutton").setText(null).setIconClass("icon-about");new Ext.Button({id:"layerchooser",tooltip:"Layer Switcher",iconCls:"icon-layer-switcher",menu:new gxp.menu.LayerMenu({layers:this.mapPanel.layers})})}});Ext.namespace("GeoExt");
GeoExt.Lang=new (Ext.extend(Ext.util.Observable,{locale:navigator.language||navigator.userLanguage,dict:null,constructor:function(){this.addEvents("localize");this.dict={};Ext.util.Observable.constructor.apply(this,arguments)},add:function(a,b){var c=this.dict[a];if(c)for(var d in b)c[d]=Ext.apply(c[d]||{},b[d]);else this.dict[a]=Ext.apply({},b);!a||a===this.locale?this.set(a):0===this.locale.indexOf(a+"-")&&this.set(this.locale)},set:function(a){for(var b=a?a.split("-"):[],c="",d={},e,f=0,g=b.length;f<
g;++f)if(c+=(c&&"-"||"")+b[f],c in this.dict){e=this.dict[c];for(var h in e)h in d?Ext.apply(d[h],e[h]):d[h]=Ext.apply({},e[h])}for(h in d){b=window;c=h.split(".");e=!1;f=0;for(g=c.length;f<g;++f){var j=c[f];if(j in b)b=b[j];else{e=!0;break}}e||Ext.apply(b,d[h])}this.locale=a;this.fireEvent("localize",a)}}));
GeoExt.Lang.add("ca",{"GeoExplorer.prototype":{zoomSliderText:"<div>Grau de detall: {zoom}</div><div>Escala: 1:{scale}</div>",loadConfigErrorText:"Problemes llegint la configuraci\u00f3 desada: <br />",loadConfigErrorDefaultText:"Error del servidor.",xhrTroubleText:"Problemes de comunicaci\u00f3. Estat ",layersText:"Capes",titleText:"T\u00edtol",bookmarkText:"URL del marcador",permakinkText:"Enlla\u00e7 permanent",appInfoText:"GeoExplorer",aboutText:"Quant a GeoExplorer",mapInfoText:"Informaci\u00f3 del mapa",
descriptionText:"Descripci\u00f3",contactText:"Contacte",aboutThisMapText:"Quant a aquest mapa"},"GeoExplorer.Composer.prototype":{mapText:"Mapa",tableText:"Table",queryText:"Query",exportMapText:"Exporta el Mapa",saveMapText:"Desa el Mapa",saveErrorText:"Problemes desant: ",toolsTitle:"Escolliu els elements que desitgeu incloure a la barra d'eines:",previewText:"Vista pr\u00e8via",backText:"Anterior",nextText:"Seg\u00fcent",loginText:"Login",loginErrorText:"Invalid username or password.",userFieldText:"User",
passwordFieldText:"Password"}});
GeoExt.Lang.add("de",{"GeoExplorer.prototype":{zoomSliderText:"<div>Zoomstufe: {zoom}</div><div>Ma\u00dfstab: 1:{scale}</div>",loadConfigErrorText:"Gespeicherte Konfiguration kann nicht gelesen werden: <br />",loadConfigErrorDefaultText:"Server Fehler.",xhrTroubleText:"Kommunikationsfehler: Status ",layersText:"Layer",titleText:"Titel",zoomLevelText:"Zoomstufe",bookmarkText:"Bookmark URL",permakinkText:"Permalink",appInfoText:"GeoExplorer",aboutText:"\u00dcber GeoExplorer",mapInfoText:"Karteninfo",
descriptionText:"Beschreibung",contactText:"Kontakt",aboutThisMapText:"\u00dcber diese Karte"},"GeoExplorer.Composer.prototype":{mapText:"Karte",tableText:"Tabelle",queryText:"Abfrage",exportMapText:"Karte ver\u00f6ffentlichen",saveMapText:"Karte speichern",saveErrorText:"Beim Speichern ist ein Problem aufgetreten: ",toolsTitle:"Werkzeuge, die in der Werkzeugleiste zur Verf\u00fcgung stehen sollen:",previewText:"Vorschau",backText:"Zur\u00fcck",nextText:"Weiter",loginText:"Login",loginErrorText:"Ung\u00fcltiger Benutzername oder ung\u00fcltiges Kennwort.",
userFieldText:"Benutzer",passwordFieldText:"Kennwort"}});
GeoExt.Lang.add("en",{"GeoExplorer.prototype":{zoomSliderText:"<div>Zoom Level: {zoom}</div><div>Scale: 1:{scale}</div>",loadConfigErrorText:"Trouble reading saved configuration: <br />",loadConfigErrorDefaultText:"Server Error.",xhrTroubleText:"Communication Trouble: Status ",layersText:"Layers",titleText:"Title",zoomLevelText:"Zoom level",bookmarkText:"Bookmark URL",permakinkText:"Permalink",appInfoText:"GeoExplorer",aboutText:"About GeoExplorer",mapInfoText:"Map info",descriptionText:"Description",
contactText:"Contact",aboutThisMapText:"About this map"},"GeoExplorer.Composer.prototype":{mapText:"Map",tableText:"Table",queryText:"Query",exportMapText:"Publish map",saveMapText:"Save map",saveErrorText:"Trouble saving: ",toolsTitle:"Choose tools to include in the toolbar:",previewText:"Preview",backText:"Back",nextText:"Next",loginText:"Login",loginErrorText:"Invalid username or password.",userFieldText:"User",passwordFieldText:"Password"}});
GeoExt.Lang.add("es",{"GeoExplorer.prototype":{zoomSliderText:"<div>Nivel de detalle: {zoom}</div><div>Escala: 1:{scale}</div>",loadConfigErrorText:"Problemas leyendo la configuraci\u00f3n guardada: <br />",loadConfigErrorDefaultText:"Error del servidor.",xhrTroubleText:"Problemas de comunicaci\u00f3n: Estado ",layersText:"Capas",titleText:"T\u00edtulo",bookmarkText:"URL del marcador",permakinkText:"Enlace permanente",appInfoText:"GeoExplorer",aboutText:"Acerca de GeoExplorer",mapInfoText:"Informaci\u00f3n del mapa",
descriptionText:"Descripci\u00f3n",contactText:"Contacto",aboutThisMapText:"Acerca de este mapa"},"GeoExplorer.Composer.prototype":{mapText:"Mapa",tableText:"Table",queryText:"Query",exportMapText:"Exportar Mapa",saveMapText:"Guardar Mapa",saveErrorText:"Problemas guardando: ",toolsTitle:"Escoja los elementos que desea incluir en la barra de herramientas:",previewText:"Vista previa",backText:"Anterior",nextText:"Siguiente",loginText:"Login",loginErrorText:"Invalid username or password.",userFieldText:"User",
passwordFieldText:"Password"}});
GeoExt.Lang.add("fr",{"GeoExplorer.prototype":{zoomSliderText:"<div> Niveau de zoom: {zoom}</div><div Echelle: 1:{scale}</div>",loadConfigErrorText:"Difficult\u00e9 \u00e0 lire configuration enregistr\u00e9e: <br>",loadConfigErrorDefaultText:"Erreur du serveur.",xhrTroubleText:"Trouble de la communication: \u00e9tat",layersText:"Layers",titleText:"Titre",bookmarkText:"Mettre en favori URL",permakinkText:"Permalink",appInfoText:"GeoExplorer",aboutText:"\u00c0 propos de GeoExplorer",mapInfoText:"Info carte",
descriptionText:"Description",contactText:"Contact",aboutThisMapText:"\u00c0 propos de cette carte"},"GeoExplorer.Composer.prototype":{mapText:"Carte",tableText:"Table",queryText:"Query",exportMapText:"Carte Export",saveMapText:"Enregistrez la carte",saveErrorText:"Sauver Trouble:",toolsTitle:"Choose tools to include in the toolbar:",previewText:"Preview",backText:"Back",nextText:"Next",loginText:"Login",loginErrorText:"Invalid username or password.",userFieldText:"User",passwordFieldText:"Password"}});
GeoExt.Lang.add("ca",{"gxp.menu.LayerMenu.prototype":{layerText:"Capa"},"gxp.plugins.AddLayers.prototype":{addActionMenuText:"Afegeix Capes",addActionTip:"Afegeix Capes",addServerText:"Afegeix servidor",addButtonText:"Afegeix Capes",untitledText:"Sense T\u00edtol",addLayerSourceErrorText:"Error obtenint les capabilities del WMS ({msg}).\nSi us plau, comproveu la URL i torneu-ho a intentar.",availableLayersText:"Capes disponibles",expanderTemplateText:"<p><b>Resum:</b> {abstract}</p>",panelTitleText:"T\u00edtol",
layerSelectionText:"Veure dades disponibles de:",doneText:"Fet",uploadText:"Puja dades",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},"gxp.plugins.BingSource.prototype":{title:"Capes Bing",roadTitle:"Bing Carrerer",aerialTitle:"Bing Fotografia A\u00e8ria",labeledAerialTitle:"Bing Fotografia A\u00e8ria amb Etiquetes"},"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",createFeatureActionTip:"Crea nou element",
editFeatureActionTip:"Edita element existent",commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:"},"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"Mostra al mapa",firstPageTip:"Primera p\u00e0gina",previousPageTip:"P\u00e0gina anterior",zoomPageExtentTip:"Ajusta vista a l'extensi\u00f3 de la p\u00e0gina",nextPageTip:"P\u00e0gina seg\u00fcent",lastPageTip:"P\u00e0gina anterior",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{menuText:"Vista 3D",
tooltip:"Vista 3D"},"gxp.plugins.GoogleSource.prototype":{title:"Capes Google",roadmapAbstract:"Mostra carrerer",satelliteAbstract:"Mostra imatges de sat\u00e8l\u00b7lit",hybridAbstract:"Mostra imatges amb noms de carrer",terrainAbstract:"Mostra carrerer amb terreny"},"gxp.plugins.LayerProperties.prototype":{menuText:"Propietats de la capa",toolTip:"Propietats de la capa"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Capes",rootNodeText:"Capes",overlayNodeText:"Capes addicionals",baseNodeText:"Capa base"},
"gxp.plugins.LayerManager.prototype":{baseNodeText:"Capa base"},"gxp.plugins.Legend.prototype":{menuText:"Mostra Llegenda",tooltip:"Mostra Llegenda"},"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"Loading Map..."},"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",
controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldPrintTitle:"World Print"},"gxp.plugins.Measure.prototype":{buttonText:"Mesura",lengthMenuText:"Longitud",areaMenuText:"\u00c0rea",lengthTooltip:"Mesura Longitud",areaTooltip:"Mesura \u00c0rea",
measureTooltip:"Mesura"},"gxp.plugins.Navigation.prototype":{menuText:"Despla\u00e7a mapa",tooltip:"Despla\u00e7a mapa"},"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Vista anterior",nextMenuText:"Vista seg\u00fcent",previousTooltip:"Vista anterior",nextTooltip:"Vista seg\u00fcent"},"gxp.plugins.OSMSource.prototype":{title:"Capes OpenStreetMap",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Daded CC-By-SA de <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},
"gxp.plugins.Print.prototype":{buttonText:"Imprimeix",menuText:"Imprimeix mapa",tooltip:"Imprimeix mapa",previewText:"Vista pr\u00e8via",notAllNotPrintableText:"No es poden imprimir totes les capes",nonePrintableText:"No es pot imprimir cap de les capes del mapa"},"gxp.plugins.MapQuestSource.prototype":{title:"MapQuest Layers",osmAttribution:"Tessel\u00b7les cortesia de <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Tessel\u00b7les cortesia de <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",naipTitle:"MapQuest Imatge"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Consulta",queryMenuText:"Consulta layer",queryActionTip:"Consulta la capa sel\u00b7leccionada",queryByLocationText:"Query by current map extent",queryByAttributesText:"Consulta per atributs",queryMsg:"Consultant...",
cancelButtonText:"Cancel\u00b7la",noFeaturesTitle:"Sense coincid\u00e8ncies",noFeaturesMessage:"La vostra consulta no ha produ\u00eft resultats."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Elimina Capa",removeActionTip:"Elimina Capa"},"gxp.plugins.Styler.prototype":{menuText:"Edita Estils",tooltip:"Gestiona els estils de les capes"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"Consulta elements",popupTitle:"Informaci\u00f3 dels elements"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",
zoomInMenuText:"Apropa",zoomOutMenuText:"Allunya",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"Apropa",zoomOutTooltip:"Allunya"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Mostra l'extensi\u00f3 total",tooltip:"Mostra l'extensi\u00f3 total"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Mostra tota la capa",tooltip:"Mostra tota la capa"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Mostra tota la capa",tooltip:"Mostra tota la capa"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Mostra els elements seleccionats",
tooltip:"Mostra els elements seleccionats"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"Desitgeu desar els canvis?",closeMsg:"Els canvis en aquest element no s'han desat. Desitja desar-los?",deleteMsgTitle:"Desitgeu esborrar l'element?",deleteMsg:"Esteu segurs de voler esborrar aquest element?",editButtonText:"Edita",editButtonTooltip:"Fes que aquest element sigui editable",deleteButtonText:"Esborra",deleteButtonTooltip:"Esborra aquest element",cancelButtonText:"Cancel\u00b7la",cancelButtonTooltip:"Deixa d'editar, descarta els canvis",
saveButtonText:"Desa",saveButtonTooltip:"Desa els canvis"},"gxp.FillSymbolizer.prototype":{fillText:"Farcit",colorText:"Color",opacityText:"Opacitat"},"gxp.FilterBuilder.prototype":{builderTypeNames:["alguna de","totes","cap de","no totes"],preComboText:"Acompleix",postComboText:"les condicions seg\u00fcents:",addConditionText:"afegeix condici\u00f3",addGroupText:"afegeix grup",removeConditionText:"treu condici\u00f3"},"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Nom",titleHeaderText:"T\u00edtol",
queryableHeaderText:"Consultable",layerSelectionLabel:"Llista les capes de:",layerAdditionLabel:"o afegeix un altre servidor.",expanderTemplateText:"<p><b>Resum:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"cercle",graphicSquareText:"quadrat",graphicTriangleText:"triangle",graphicStarText:"estrella",graphicCrossText:"creu",graphicXText:"x",graphicExternalText:"extern",urlText:"URL",opacityText:"opacitat",symbolText:"S\u00edmbol",sizeText:"Mides",rotationText:"Gir"},"gxp.QueryPanel.prototype":{queryByLocationText:"Consulta per lloc",
currentTextText:"Vista actual",queryByAttributesText:"Consulta per atributs",layerText:"Capa"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} Escala 1:{scale}",labelFeaturesText:"Etiqueta elements",labelsText:"Etiquetes",basicText:"B\u00e0sic",advancedText:"Avan\u00e7at",limitByScaleText:"Restringeix per escala",limitByConditionText:"Restringeix per condici\u00f3",symbolText:"S\u00edmbol",nameText:"Nom"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} Escala 1:{scale}",
minScaleLimitText:"Escala m\u00ednima",maxScaleLimitText:"Escala m\u00e0xima"},"gxp.StrokeSymbolizer.prototype":{solidStrokeName:"continu",dashStrokeName:"guions",dotStrokeName:"punts",titleText:"Tra\u00e7",styleText:"Estil",colorText:"Color",widthText:"Amplada",opacityText:"Opacitad"},"gxp.StylePropertiesDialog.prototype":{titleText:"General",nameFieldText:"Nom",titleFieldText:"T\u00edtol",abstractFieldText:"Resum"},"gxp.TextSymbolizer.prototype":{labelValuesText:"Etiquetatge",haloText:"Halo",sizeText:"Mida"},
"gxp.WMSLayerPanel.prototype":{attributionText:"Attribution",aboutText:"Quant a",titleText:"T\u00edtol",nameText:"Nom",descriptionText:"Descripci\u00f3",displayText:"Mostra",opacityText:"Opacitat",formatText:"Format",transparentText:"Transparent",cacheText:"Cach\u00e9",cacheFieldText:"Utiliza la versi\u00f3 en cach\u00e9",stylesText:"Estils disponibles",infoFormatText:"Info format",infoFormatEmptyText:"Select a format",displayOptionsText:"Display options",queryText:"Limit with filters",scaleText:"Limit by scale",
minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"Ja podeu incloure el vostre mapa a altres webs! Simplement copieu el seg\u00fcent codi HTML all\u00e0 on desitgeu incrustar-ho:",heightLabel:"Al\u00e7\u00e0ria",widthLabel:"Amplada",mapSizeLabel:"Mida",miniSizeLabel:"M\u00ednima",
smallSizeLabel:"Petita",premiumSizeLabel:"Premium",largeSizeLabel:"Gran"},"gxp.WMSStylesDialog.prototype":{addStyleText:"Afegeix",addStyleTip:"Afegeix nou estil",chooseStyleText:"Escull estil",deleteStyleText:"Treu",deleteStyleTip:"Esborra l'estil sel\u00b7leccionat",editStyleText:"Canvia",editStyleTip:"Edita l'estil sel\u00b7leccionat",duplicateStyleText:"Clona",duplicateStyleTip:"Duplica l'estil sel\u00b7leccionat",addRuleText:"Afegeix",addRuleTip:"Afegeix nova regla",newRuleText:"Nova regla",deleteRuleText:"Treu",
deleteRuleTip:"Esborra la regla sel\u00b7leccionada",editRuleText:"Edita",editRuleTip:"Edita la regla sel\u00b7leccionada",duplicateRuleText:"Clona",duplicateRuleTip:"Duplica la regla sel\u00b7leccionada",cancelText:"Cancel\u00b7la",saveText:"Desa",styleWindowTitle:"Estil: {0}",ruleWindowTitle:"Regla: {0}",stylesFieldsetTitle:"Estils",rulesFieldsetTitle:"Regles",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},"gxp.LayerUploadPanel.prototype":{titleLabel:"T\u00edtol",
titleEmptyText:"T\u00edtol de la capa",abstractLabel:"Descripci\u00f3",abstractEmptyText:"Descripci\u00f3 de la capa",fileLabel:"Dades",fieldEmptyText:"Navegueu per les dades...",uploadText:"Puja",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"Pugeu les vostres dades...",invalidFileExtensionText:"L'extensi\u00f3 del fitxer ha de ser alguna d'aquestes: ",optionsText:"Opcions",workspaceLabel:"Espai de treball",workspaceEmptyText:"Espai de treball per defecte",
dataStoreLabel:"Magatzem",dataStoreEmptyText:"Create new store",defaultDataStoreEmptyText:"Magatzem de dades per defecte"},"gxp.NewSourceDialog.prototype":{title:"Afegeix Servidor...",cancelText:"Cancel\u00b7la",addServerText:"Afegeix Servidor",invalidURLText:"Enter a valid URL to a WMS endpoint (e.g. http://example.com/geoserver/wms)",contactingServerText:"Connectant amb el Servidor..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Escala"},"gxp.Viewer.prototype":{saveErrorText:"Problemes desant: "},
"gxp.FeedSourceDialog.prototype":{feedTypeText:"Font",addPicasaText:"Picasa fotos",addYouTubeText:"YouTube Videos",addRSSText:"Feed GeoRSS Un altre",addFeedText:"Afegeix a Mapa",addTitleText:"T\u00edtol",keywordText:"Paraula clau",doneText:"Fet",titleText:"Afegir Feeds",maxResultsText:"Productes Max"}});
GeoExt.Lang.add("de",{"gxp.menu.LayerMenu.prototype":{layerText:"Layer"},"gxp.plugins.AddLayers.prototype":{addActionMenuText:"Layer hinzuf\u00fcgen",addActionTip:"Layer hinzuf\u00fcgen",addServerText:"Server hinzuf\u00fcgen",addButtonText:"Layer hinzuf\u00fcgen",untitledText:"ohne Titel",addLayerSourceErrorText:"Fehler beim Abfragen der WMS Capabilities ({msg}).\nBitte URL pr\u00fcfen und erneut versuchen.",availableLayersText:"verf\u00fcgbare Layer",expanderTemplateText:"<p><b>Kurzbeschreibung:</b> {abstract}</p>",
panelTitleText:"Titel",layerSelectionText:"Verf\u00fcgbare Daten anzeigen von:",doneText:"Fertig",uploadText:"Daten hochladen",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},"gxp.plugins.BingSource.prototype":{title:"Bing Layer",roadTitle:"Bing Strassen",aerialTitle:"Bing Luftbilder",labeledAerialTitle:"Bing Luftbilder mit Beschriftung"},"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Editieren",createFeatureActionText:"Erzeugen",editFeatureActionText:"Bearbeiten",createFeatureActionTip:"neues Objekt erstellen",
editFeatureActionTip:"bestehendes Objekt bearbeiten",commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:"},"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"auf der Karte darstellen",firstPageTip:"erste Seite",previousPageTip:"vorherige Seite",zoomPageExtentTip:"Zoom zur max. Ausdehnung",nextPageTip:"n\u00e4chste Seite",lastPageTip:"letzte Seite",totalMsg:"{1} bis {2} von {0} Datens\u00e4tzen"},"gxp.plugins.GoogleEarth.prototype":{menuText:"3D Viewer",tooltip:"zum 3D Viewer wechseln"},
"gxp.plugins.GoogleSource.prototype":{title:"Google Layers",roadmapAbstract:"Strassenkarte zeigen",satelliteAbstract:"Luftbilder zeigen",hybridAbstract:"Luftbilder mit Strassennamen zeigen",terrainAbstract:"Strassenkarte mit Gel\u00e4nde zeigen"},"gxp.plugins.LayerProperties.prototype":{menuText:"Layer Eigenschaften",toolTip:"Layer Eigenschaften"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Layer",rootNodeText:"Layer",overlayNodeText:"\u00fcberlagernde Layer",baseNodeText:"Basiskarten"},"gxp.plugins.LayerManager.prototype":{baseNodeText:"Basiskarte"},
"gxp.plugins.Legend.prototype":{menuText:"Legende zeigen",tooltip:"Legende zeigen"},"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"Karte laden..."},"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",controlRoomTitle:"Control Room",
geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldPrintTitle:"World Print"},"gxp.plugins.Measure.prototype":{buttonText:"Messen",lengthMenuText:"L\u00e4nge",areaMenuText:"Fl\u00e4che",lengthTooltip:"L\u00e4nge messen",areaTooltip:"Fl\u00e4che messen",measureTooltip:"Messen"},
"gxp.plugins.Navigation.prototype":{menuText:"Kartenausschnitt verschieben",tooltip:"Kartenausschnitt verschieben"},"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Kartenausschnitt zur\u00fcck",nextMenuText:"Kartenausschnitt vorw\u00e4rts",previousTooltip:"Vorherigen Kartenausschnitt anzeigen",nextTooltip:"N\u00e4chsten Kartenausschnit anzeigen"},"gxp.plugins.OSMSource.prototype":{title:"OpenStreetMap Layer",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",
osmarenderAttribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},"gxp.plugins.Print.prototype":{buttonText:"Drucken",menuText:"Karte drucken",tooltip:"Karte drucken",previewText:"Druckansicht",notAllNotPrintableText:"Es k\u00f6nnen nicht alle Layer gedruckt werden.",nonePrintableText:"Keiner der aktuellen Kartenlayer kann gedruckt werden."},"gxp.plugins.MapQuestSource.prototype":{title:"MapQuest Layers",osmAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",naipTitle:"MapQuest Imagery"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Abfrage",queryMenuText:"Abfrage Layer",queryActionTip:"selektierten Layer abfragen",queryByLocationText:"Abfrage nach aktuellem Kartenauscchnitt",queryByAttributesText:"Attributabfrage",queryMsg:"Abfrage wird ausgef\u00fchrt",
cancelButtonText:"Abbrechen",noFeaturesTitle:"keine \u00dcbereinstimmung",noFeaturesMessage:"Ihre Abfrage liefert keine Resultate."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Layer l\u00f6schen",removeActionTip:"Layer l\u00f6schen"},"gxp.plugins.Styler.prototype":{menuText:"Style bearbeiten",tooltip:"Layer Styles verwalten"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Objektinformation",infoActionTip:"Objektinformation abfragen",popupTitle:"Objektinformation"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",
zoomInMenuText:"Vergr\u00f6ssern",zoomOutMenuText:"Verkleinern",zoomTooltip:"Box aufziehen zum Zoomen",zoomInTooltip:"Vergr\u00f6ssern",zoomOutTooltip:"Verkleinern"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Maximale Ausdehnung",tooltip:"Maximale Ausdehnung anzeigen"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Auf Layer zoomen",tooltip:"Auf Layer zoomen"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Auf Layer zoomen",tooltip:"Auf Layer zoomen"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Auf selektierte Objekte zoomen",
tooltip:"Auf selektierte Objekte zoomen"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"\u00c4nderung speichern?",closeMsg:"Ungespeicherte \u00c4nderungen. M\u00f6chten Sie die \u00c4nderungen speichern?",deleteMsgTitle:"Objekt l\u00f6schen?",deleteMsg:"Sind Sie sicher, dass Sie dieses Objekt l\u00f6schen m\u00f6chten?",editButtonText:"Bearbeiten",editButtonTooltip:"Objekt editieren",deleteButtonText:"L\u00f6schen",deleteButtonTooltip:"Objekt l\u00f6schen",cancelButtonText:"Abbrechen",cancelButtonTooltip:"Bearbeitung beenden, \u00c4nderungen verwerfen.",
saveButtonText:"Speichern",saveButtonTooltip:"\u00c4nderungen speichern"},"gxp.FillSymbolizer.prototype":{fillText:"F\u00fcllung",colorText:"Farbe",opacityText:"Transparenz"},"gxp.FilterBuilder.prototype":{builderTypeNames:["beliebige","alle","keine","nicht alle"],preComboText:"Match",postComboText:"der folgenden:",addConditionText:"Bedingung hinzuf\u00fcgen",addGroupText:"Gruppe hinzuf\u00fcgen",removeConditionText:"Bedingung entfernen"},"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Name",
titleHeaderText:"Titel",queryableHeaderText:"abfragbar",layerSelectionLabel:"Verf\u00fcgbare Daten anzeigen von:",layerAdditionLabel:"oder neuen Server hinzuf\u00fcgen.",expanderTemplateText:"<p><b>Kurzbeschreibung:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"Kreis",graphicSquareText:"Rechteck",graphicTriangleText:"Dreieck",graphicStarText:"Stern",graphicCrossText:"Kreuz",graphicXText:"x",graphicExternalText:"extern",urlText:"URL",opacityText:"Transparenz",symbolText:"Symbol",
sizeText:"Gr\u00f6sse",rotationText:"Rotation"},"gxp.QueryPanel.prototype":{queryByLocationText:"lagebezogene Abfrage",currentTextText:"aktuelle Ausdehnung",queryByAttributesText:"Attributabfrage",layerText:"Layer"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} Massstab 1:{scale}",labelFeaturesText:"Objekte beschriften",labelsText:"Beschriftung",basicText:"Basic",advancedText:"Erweitert",limitByScaleText:"Massstabsbeschr\u00e4nkung",limitByConditionText:"Einschr\u00e4nkung durch Bedingung",
symbolText:"Symbol",nameText:"Name"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} Massstab 1:{scale}",minScaleLimitText:"Minimale Massstabsgrenze",maxScaleLimitText:"Maximale Massstabsgrenze"},"gxp.StrokeSymbolizer.prototype":{solidStrokeName:"ausgezogen",dashStrokeName:"gestrichelt",dotStrokeName:"gepunktet",titleText:"Linie",styleText:"Style",colorText:"Farbe",widthText:"Breite",opacityText:"Transparenz"},"gxp.StylePropertiesDialog.prototype":{titleText:"Allgemein",nameFieldText:"Name",
titleFieldText:"Titel",abstractFieldText:"Kurzbeschreibung"},"gxp.TextSymbolizer.prototype":{labelValuesText:"Label values",haloText:"Halo",sizeText:"Gr\u00f6sse"},"gxp.WMSLayerPanel.prototype":{attributionText:"Attribution",aboutText:"\u00dcber",titleText:"Titel",nameText:"Name",descriptionText:"Beschreibung",displayText:"Anzeige",opacityText:"Transparenz",formatText:"Format",transparentText:"transparent",cacheText:"Cache",cacheFieldText:"Version aus dem Cache ben\u00fctzen",stylesText:"Verf\u00fcgbare Styles",
infoFormatText:"Info Format",infoFormatEmptyText:"Format ausw\u00e4hlen",displayOptionsText:"Display options",queryText:"Limit with filters",scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"Ihre Karte ist f\u00fcr die Publikation im Web bereit. Kopieren Sie einfach den folgenden HTML-Code, um die Karte in Ihre Webseite einzubinden:",
heightLabel:"H\u00f6he",widthLabel:"Breite",mapSizeLabel:"Kartengr\u00f6sse",miniSizeLabel:"Mini",smallSizeLabel:"Klein",premiumSizeLabel:"Premium",largeSizeLabel:"Gross"},"gxp.WMSStylesDialog.prototype":{addStyleText:"Hinzuf\u00fcgen",addStyleTip:"neuen Style hinzuf\u00fcgen",chooseStyleText:"Style ausw\u00e4hlen",deleteStyleText:"L\u00f6schen",deleteStyleTip:"selektierten Style l\u00f6schen",editStyleText:"Bearbeiten",editStyleTip:"selektierten Style bearbeiten",duplicateStyleText:"Duplizieren",
duplicateStyleTip:"selektierten Style duplizieren",addRuleText:"Hinzuf\u00fcgen",addRuleTip:"neue Regel hinzuf\u00fcgen",newRuleText:"neue Regel",deleteRuleText:"Entfernen",deleteRuleTip:"selektierte Regel l\u00f6schen",editRuleText:"Bearbeiten",editRuleTip:"selektierte Regel bearbeiten",duplicateRuleText:"Duplizieren",duplicateRuleTip:"selektierte Regel duplizieren",cancelText:"Abbrechen",saveText:"Speichern",styleWindowTitle:"User Style: {0}",ruleWindowTitle:"Style Regel: {0}",stylesFieldsetTitle:"Styles",
rulesFieldsetTitle:"Regeln",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},"gxp.LayerUploadPanel.prototype":{titleLabel:"Titel",titleEmptyText:"Layertitel",abstractLabel:"Beschreibung",abstractEmptyText:"Layerbeschreibung",fileLabel:"Daten",fieldEmptyText:"Datenarchiv durchsuchen...",uploadText:"Hochladen",uploadFailedText:"Hochladen fehlgeschlagen",processingUploadText:"Upload wird bearbeitet",waitMsgText:"Ihre Daten werden hochgeladen...",invalidFileExtensionText:"Dateierweiterung muss eine sein von: ",
optionsText:"Optionen",workspaceLabel:"Workspace",workspaceEmptyText:"Standard Workspace",dataStoreLabel:"Store",dataStoreEmptyText:"Neuen Store erzeugen",defaultDataStoreEmptyText:"Default Datastore"},"gxp.NewSourceDialog.prototype":{title:"neuen Server hinzuf\u00fcgen...",cancelText:"Abbrechen",addServerText:"Server hinzuf\u00fcgen",invalidURLText:"F\u00fcgen Sie eine g\u00fcltige URL zu einem WMS ein (z.B. http://example.com/geoserver/wms)",contactingServerText:"Server wird kontaktiert..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Zoomstufe"},
"gxp.Viewer.prototype":{saveErrorText:"Beim Speichern ist ein Problem aufgetreten: "},"gxp.FeedSourceDialog.prototype":{feedTypeText:"Source",addPicasaText:"Picasa Fotos",addYouTubeText:"YouTube Videos",addRSSText:"Andere GeoRSS Feed",addFeedText:"zur Karte hinzuf\u00fcgen",addTitleText:"Titel",keywordText:"Keyword",doneText:"Fertig",titleText:"Add-Feeds",maxResultsText:"Max Items"}});
GeoExt.Lang.add("el",{"gxp.menu.LayerMenu.prototype":{layerText:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1"},"gxp.plugins.AddLayers.prototype":{addActionMenuText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2",addActionTip:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2",addServerText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03ad\u03bd\u03b1 \u039d\u03ad\u03bf \u0394\u03b9\u03b1\u03ba\u03bf\u03bc\u03b9\u03c3\u03c4\u03ae",
addButtonText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2",untitledText:"\u03a7\u03c9\u03c1\u03af\u03c2 \u03c4\u03af\u03c4\u03bb\u03bf",addLayerSourceErrorText:"\u03a3\u03c6\u03ac\u03bb\u03bc\u03b1 \u03c3\u03c4\u03b7\u03bd \u03b1\u03bd\u03ac\u03ba\u03c4\u03b7\u03c3\u03b7 \u03b4\u03c5\u03bd\u03b1\u03c4\u03bf\u03c4\u03ae\u03c4\u03c9\u03bd WMS ({msg}).\n\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03bb\u03ad\u03b3\u03be\u03c4\u03b5 \u03c4\u03bf url \u03ba\u03b1\u03b9 \u03b4\u03bf\u03ba\u03b9\u03bc\u03ac\u03c3\u03c4\u03b5 \u03be\u03b1\u03bd\u03ac.",
availableLayersText:"\u0394\u03b9\u03b1\u03b8\u03ad\u03c3\u03b9\u03bc\u03b5\u03c2 \u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2",expanderTemplateText:"<p><b>\u03a0\u03b5\u03c1\u03af\u03bb\u03b7\u03c8\u03b7:</b> {abstract}</p>",panelTitleText:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",layerSelectionText:"\u0394\u03b5\u03af\u03c4\u03b5 \u03b4\u03b9\u03b1\u03b8\u03ad\u03c3\u03b9\u03bc\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b1\u03c0\u03cc:",doneText:"\u039f\u03bb\u03bf\u03ba\u03bb\u03b7\u03c1\u03ce\u03b8\u03b7\u03ba\u03b5",
uploadText:"\u0391\u03bd\u03b5\u03b2\u03ac\u03c3\u03c4\u03b5 \u0394\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},"gxp.plugins.BingSource.prototype":{title:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2 Bing",roadTitle:"\u0394\u03c1\u03cc\u03bc\u03bf\u03b9 Bing",aerialTitle:"\u0395\u03bd\u03b1\u03ad\u03c1\u03b9\u03b5\u03c2 Bing",labeledAerialTitle:"\u0395\u03bd\u03b1\u03ad\u03c1\u03b9\u03b5\u03c2 Bing \u03bc\u03b5 \u0395\u03c4\u03b9\u03ba\u03ad\u03c4\u03b5\u03c2"},
"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",createFeatureActionTip:"\u0394\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03c3\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03bd\u03ad\u03bf \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc",editFeatureActionTip:"\u03a4\u03c1\u03bf\u03c0\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03c4\u03b5 \u03c5\u03c0\u03ac\u03c1\u03c7\u03bf\u03bd \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc",
commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:"},"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03c3\u03c4\u03bf\u03bd \u03c7\u03ac\u03c1\u03c4\u03b7",firstPageTip:"\u03a0\u03c1\u03ce\u03c4\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1",previousPageTip:"\u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1",zoomPageExtentTip:"\u0396\u03bf\u03c5\u03bc \u03c3\u03c4\u03bf \u03b5\u03cd\u03c1\u03bf\u03c2 \u03c4\u03b7\u03c2 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1\u03c2",
nextPageTip:"\u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03b7 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1",nextPageTip:"\u03a4\u03b5\u03bb\u03b5\u03c5\u03c4\u03b1\u03af\u03b1 \u03c3\u03b5\u03bb\u03af\u03b4\u03b1",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{apiKeyPrompt:"\u03a0\u03b1\u03c1\u03b1\u03ba\u03b1\u03bb\u03ce \u03b5\u03b9\u03c3\u03ac\u03b3\u03b5\u03c4\u03b5 \u03c4\u03bf Google API \u03ba\u03bb\u03b5\u03b9\u03b4\u03af \u03b3\u03b9\u03b1 ",menuText:"3D \u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae",
tooltip:"\u0391\u03bb\u03bb\u03ac\u03be\u03c4\u03b5 \u03c3\u03b5 3D \u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae"},"gxp.plugins.GoogleSource.prototype":{title:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2 Google",roadmapAbstract:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03bf\u03b4\u03b9\u03ba\u03bf\u03cd \u03c7\u03ac\u03c1\u03c4\u03b7",satelliteAbstract:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03c9\u03bd \u03b1\u03c0\u03cc \u03b4\u03bf\u03c1\u03c5\u03c6\u03cc\u03c1\u03bf",
hybridAbstract:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03b5\u03b9\u03ba\u03cc\u03bd\u03c9\u03bd \u03bc\u03b5 \u03bf\u03bd\u03cc\u03bc\u03b1\u03c4\u03b1 \u03bf\u03b4\u03ce\u03bd",terrainAbstract:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03bf\u03b4\u03b9\u03ba\u03bf\u03cd \u03c7\u03ac\u03c1\u03c4\u03b7 \u03bc\u03b5 \u03b1\u03bd\u03ac\u03b3\u03bb\u03c5\u03c6\u03bf \u03b5\u03b4\u03ac\u03c6\u03bf\u03c5\u03c2"},"gxp.plugins.LayerProperties.prototype":{menuText:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 \u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2",
toolTip:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2 \u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2"},"gxp.plugins.LayerTree.prototype":{rootNodeText:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2",overlayNodeText:"\u0395\u03c0\u03b9\u03c3\u03c4\u03c1\u03ce\u03bc\u03b1\u03c4\u03b1",baseNodeText:"\u03a5\u03c0\u03cc\u03b2\u03b1\u03b8\u03c1\u03b1"},"gxp.plugins.Legend.prototype":{menuText:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03a5\u03c0\u03bf\u03bc\u03bd\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2",
tooltip:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae \u03a5\u03c0\u03bf\u03bc\u03bd\u03ae\u03bc\u03b1\u03c4\u03bf\u03c2"},"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"\u03a6\u03cc\u03c1\u03c4\u03c9\u03c3\u03b7 \u03a7\u03ac\u03c1\u03c4\u03b7..."},"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",
blueMarbleTopoJulTitle:"Blue Marble Topography (July)",controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldPrintTitle:"World Print"},"gxp.plugins.Measure.prototype":{buttonText:"\u039c\u03ad\u03c4\u03c1\u03bf",lengthMenuText:"\u0391\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7",
areaMenuText:"\u0395\u03bc\u03b2\u03b1\u03b4\u03cc\u03bd",lengthTooltip:"\u03a5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03c4\u03b5 \u03b1\u03c0\u03cc\u03c3\u03c4\u03b1\u03c3\u03b7",areaTooltip:"\u03a5\u03c0\u03bf\u03bb\u03bf\u03b3\u03af\u03c3\u03c4\u03b5 \u03b5\u03bc\u03b2\u03b1\u03b4\u03cc\u03bd",measureTooltip:"\u039c\u03ad\u03c4\u03c1\u03bf"},"gxp.plugins.Navigation.prototype":{menuText:"\u039c\u03b5\u03c4\u03b1\u03ba\u03b9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03a7\u03ac\u03c1\u03c4\u03b7",tooltip:"\u039c\u03b5\u03c4\u03b1\u03ba\u03b9\u03bd\u03ae\u03c3\u03c4\u03b5 \u03a7\u03ac\u03c1\u03c4\u03b7"},
"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"\u0396\u03bf\u03c5\u03bc \u03a3\u03c4\u03bf \u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf \u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf",nextMenuText:"\u0396\u03bf\u03c5\u03bc \u03a3\u03c4\u03bf \u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf \u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf",previousTooltip:"\u0396\u03bf\u03c5\u03bc \u03a3\u03c4\u03bf \u03a0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf \u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf",
nextTooltip:"\u0396\u03bf\u03c5\u03bc \u03a3\u03c4\u03bf \u0395\u03c0\u03cc\u03bc\u03b5\u03bd\u03bf \u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf"},"gxp.plugins.OSMSource.prototype":{title:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2 OpenStreetMap",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"\u0394\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},
"gxp.plugins.Print.prototype":{buttonText:"\u0395\u03ba\u03c4\u03cd\u03c0\u03c9\u03c3\u03b7",menuText:"\u0395\u03ba\u03c4\u03cd\u03c0\u03c9\u03c3\u03b7 \u03a7\u03ac\u03c1\u03c4\u03b7",tooltip:"\u0395\u03ba\u03c4\u03cd\u03c0\u03c9\u03c3\u03b7 \u03a7\u03ac\u03c1\u03c4\u03b7",previewText:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03c3\u03ba\u03cc\u03c0\u03b7\u03c3\u03b7 \u0395\u03ba\u03c4\u03cd\u03c0\u03c9\u03c3\u03b7\u03c2",notAllNotPrintableText:"\u0394\u03b5\u03bd \u039c\u03c0\u03bf\u03c1\u03bf\u03cd\u03bd \u039d\u03b1 \u0395\u03ba\u03c4\u03c5\u03c0\u03c9\u03b8\u03bf\u03cd\u03bd \u038c\u03bb\u03b5\u03c2 \u039f\u03b9 \u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2",
nonePrintableText:"\u039a\u03b1\u03bc\u03af\u03b1 \u03b1\u03c0\u03cc \u03c4\u03b9\u03c2 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2 \u03c4\u03bf\u03c5 \u03c4\u03c1\u03ad\u03c7\u03bf\u03bd\u03c4\u03bf\u03c2 \u03c7\u03ac\u03c1\u03c4\u03b7 \u03b4\u03b5\u03bd \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03b5\u03ba\u03c4\u03c5\u03c0\u03c9\u03b8\u03b5\u03af"},"gxp.plugins.MapQuestSource.prototype":{title:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b5\u03c2 MapQuest",osmAttribution:"\u03a0\u03bb\u03b1\u03ba\u03af\u03b4\u03b9\u03b1 \u03a0\u03c1\u03bf\u03c3\u03c6\u03bf\u03c1\u03ac \u03a4\u03c9\u03bd <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
osmTitle:"MapQuest OpenStreetMap",naipAttribution:"\u03a0\u03bb\u03b1\u03ba\u03af\u03b4\u03b9\u03b1 \u03a0\u03c1\u03bf\u03c3\u03c6\u03bf\u03c1\u03ac \u03a4\u03c9\u03bd of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",naipTitle:"\u0395\u03b9\u03ba\u03cc\u03bd\u03b5\u03c2 MapQuest"},"gxp.plugins.QueryForm.prototype":{queryActionText:"\u0395\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7",queryMenuText:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1 \u03b5\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7\u03c2",
queryActionTip:"\u039a\u03ac\u03bd\u03c4\u03b5 \u03b5\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7 \u03c3\u03c4\u03b7\u03bd \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03b7 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1",queryByLocationText:"Query by current map extent",queryByAttributesText:"\u0395\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7 \u03b2\u03ac\u03c3\u03b5\u03b9 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ce\u03bd",queryMsg:"\u0393\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03b5\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7...",
cancelButtonText:"\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7",noFeaturesTitle:"\u039a\u03b1\u03bd\u03ad\u03bd\u03b1 \u0391\u03c0\u03bf\u03c4\u03ad\u03bb\u03b5\u03c3\u03bc\u03b1",noFeaturesMessage:"\u0397 \u03b5\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7 \u03c3\u03b1\u03c2 \u03b4\u03b5\u03bd \u03b5\u03c0\u03ad\u03c3\u03c4\u03c1\u03b5\u03c8\u03b5 \u03b1\u03c0\u03bf\u03c4\u03b5\u03bb\u03ad\u03c3\u03bc\u03b1\u03c4\u03b1."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"\u039a\u03b1\u03c4\u03ac\u03c1\u03b3\u03b7\u03c3\u03b7 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2",
removeActionTip:"\u039a\u03b1\u03c4\u03ac\u03c1\u03b3\u03b7\u03c3\u03b7 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2"},"gxp.plugins.Styler.prototype":{menuText:"\u0395\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03a3\u03c4\u03c5\u03bb",tooltip:"\u0395\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c3\u03c4\u03c5\u03bb \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"\u03a0\u03ac\u03c1\u03c4\u03b5 \u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03a7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03bf\u03cd",
popupTitle:"\u03a0\u03bb\u03b7\u03c1\u03bf\u03c6\u03bf\u03c1\u03af\u03b5\u03c2 \u03a7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03bf\u03cd"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",zoomInMenuText:"\u0396\u03bf\u03c5\u03bc \u039c\u03ad\u03c3\u03b1",zoomOutMenuText:"\u0396\u03bf\u03c5\u03bc \u0388\u03be\u03c9",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"\u0396\u03bf\u03c5\u03bc \u039c\u03ad\u03c3\u03b1",zoomOutTooltip:"\u0396\u03bf\u03c5\u03bc \u0388\u03be\u03c9"},
"gxp.plugins.ZoomToExtent.prototype":{menuText:"\u0396\u03bf\u03c5\u03bc \u03a3\u03c4\u03bf \u039c\u03ad\u03b3\u03b9\u03c3\u03c4\u03bf \u0395\u03cd\u03c1\u03bf\u03c2",tooltip:"\u0396\u03bf\u03c5\u03bc \u03a3\u03c4\u03bf \u039c\u03ad\u03b3\u03b9\u03c3\u03c4\u03bf \u0395\u03cd\u03c1\u03bf\u03c2"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"\u0396\u03bf\u03c5\u03bc \u03c3\u03c4\u03bf \u03b5\u03cd\u03c1\u03bf\u03c2 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2",tooltip:"\u0396\u03bf\u03c5\u03bc \u03c3\u03c4\u03bf \u03b5\u03cd\u03c1\u03bf\u03c2 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2"},
"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"\u0396\u03bf\u03c5\u03bc \u03c3\u03c4\u03bf \u03b5\u03cd\u03c1\u03bf\u03c2 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2",tooltip:"\u0396\u03bf\u03c5\u03bc \u03c3\u03c4\u03bf \u03b5\u03cd\u03c1\u03bf\u03c2 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"\u0396\u03bf\u03c5\u03bc \u03c3\u03c4\u03b1 \u03c3\u03c5\u03b3\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03b1 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ac",
tooltip:"\u0396\u03bf\u03c5\u03bc \u03c3\u03c4\u03b1 \u03c3\u03c5\u03b3\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03b1 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ac"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u0391\u03bb\u03bb\u03b1\u03b3\u03ce\u03bd;",closeMsg:"\u0391\u03c5\u03c4\u03cc \u03c4\u03bf \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03ad\u03c7\u03b5\u03b9 \u03c4\u03c1\u03bf\u03c0\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03b5\u03b9\u03c2 \u03c0\u03bf\u03c5 \u03b4\u03b5\u03bd \u03ad\u03c7\u03bf\u03c5\u03bd \u03b1\u03c0\u03bf\u03b8\u03b7\u03ba\u03b5\u03c5\u03c4\u03b5\u03af. \u0398\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03c6\u03c5\u03bb\u03ac\u03be\u03b5\u03c4\u03b5 \u03c4\u03b9\u03c2 \u03b1\u03bb\u03bb\u03b1\u03b3\u03ad\u03c2 \u03c3\u03b1\u03c2;",
deleteMsgTitle:"\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae \u03a7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03bf\u03cd",deleteMsg:"\u0395\u03af\u03c3\u03c4\u03b5 \u03c3\u03af\u03b3\u03bf\u03c5\u03c1\u03bf\u03b9 \u03bf\u03c4\u03b9 \u03b8\u03ad\u03bb\u03b5\u03c4\u03b5 \u03bd\u03b1 \u03b4\u03b9\u03b1\u03b3\u03c1\u03ac\u03c8\u03b5\u03c4\u03b5 \u03c4\u03bf \u03c3\u03c5\u03b3\u03ba\u03b5\u03ba\u03c1\u03b9\u03bc\u03ad\u03bd\u03bf \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc",
editButtonText:"\u03a4\u03c1\u03bf\u03c0\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7",editButtonTooltip:"\u039a\u03ac\u03bd\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc \u03c4\u03c1\u03bf\u03c0\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03b9\u03bc\u03bf",deleteButtonText:"\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae",deleteButtonTooltip:"\u0394\u03b9\u03b1\u03b3\u03c1\u03ac\u03c8\u03c4\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03cc",
cancelButtonText:"\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7",cancelButtonTooltip:"\u03a3\u03c4\u03b1\u03bc\u03b1\u03c4\u03ae\u03c3\u03c4\u03b5 \u03c4\u03b7\u03bd \u03c4\u03c1\u03bf\u03c0\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b7, \u03b1\u03c0\u03bf\u03c1\u03c1\u03af\u03c0\u03c4\u03bf\u03bd\u03c4\u03b1\u03c2 \u03bf\u03c0\u03bf\u03b9\u03b5\u03c3\u03b4\u03ae\u03c0\u03bf\u03c4\u03b5 \u03b1\u03bb\u03bb\u03b1\u03b3\u03ad\u03c2",saveButtonText:"\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7",
saveButtonTooltip:"\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7 \u03b1\u03bb\u03bb\u03b1\u03b3\u03ce\u03bd"},"gxp.FillSymbolizer.prototype":{fillText:"\u0393\u03ad\u03bc\u03b9\u03c3\u03bc\u03b1",colorText:"\u03a7\u03c1\u03ce\u03bc\u03b1",opacityText:"\u0391\u03b4\u03b9\u03b1\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1"},"gxp.FilterBuilder.prototype":{builderTypeNames:["\u03bf\u03c0\u03bf\u03b9\u03bf\u03b4\u03ae\u03c0\u03bf\u03c4\u03b5","\u03cc\u03bb\u03b1","\u03ba\u03b1\u03bd\u03ad\u03bd\u03b1",
"\u03cc\u03c7\u03b9 \u03cc\u03bb\u03b1"],preComboText:"\u03a4\u03b1\u03cd\u03c4\u03b9\u03c3\u03b7",postComboText:"\u03c4\u03c9\u03bd \u03b1\u03ba\u03cc\u03bb\u03bf\u03c5\u03b8\u03c9\u03bd:",addConditionText:"\u03c0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u03c3\u03c5\u03bd\u03b8\u03ae\u03ba\u03b7\u03c2",addGroupText:"\u03c0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u03bf\u03bc\u03ac\u03b4\u03b1\u03c2",removeConditionText:"\u03ba\u03b1\u03c4\u03ac\u03c1\u03b3\u03b7\u03c3\u03b7 \u03c3\u03c5\u03bd\u03b8\u03ae\u03ba\u03b7\u03c2"},
"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"\u038c\u03bd\u03bf\u03bc\u03b1",titleHeaderText:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",queryableHeaderText:"\u039c\u03c0\u03bf\u03c1\u03bf\u03cd\u03bd \u03bd\u03b1 \u03b3\u03af\u03bd\u03bf\u03c5\u03bd \u03b5\u03c0\u03b5\u03c1\u03c9\u03c4\u03ae\u03c3\u03b5\u03b9\u03c2",layerSelectionLabel:"\u0394\u03b5\u03af\u03c4\u03b5 \u03b4\u03b9\u03b1\u03b8\u03ad\u03c3\u03b9\u03bc\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b1\u03c0\u03cc:",
layerAdditionLabel:"\u03ae \u03c0\u03c1\u03bf\u03c3\u03b8\u03ad\u03c3\u03c4\u03b5 \u03bd\u03ad\u03bf \u03b4\u03b9\u03b1\u03ba\u03bf\u03bc\u03b9\u03c3\u03c4\u03ae.",expanderTemplateText:"<p><b>\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"\u03ba\u03cd\u03ba\u03bb\u03bf\u03c2",graphicSquareText:"\u03c4\u03b5\u03c4\u03c1\u03ac\u03b3\u03c9\u03bd\u03bf",graphicTriangleText:"\u03c4\u03c1\u03af\u03b3\u03c9\u03bd\u03bf",graphicStarText:"\u03b1\u03c3\u03c4\u03ad\u03c1\u03b9",
graphicCrossText:"\u03c3\u03c4\u03b1\u03c5\u03c1\u03cc\u03c2",graphicXText:"\u03c7",graphicExternalText:"\u03b5\u03be\u03c9\u03c4\u03b5\u03c1\u03b9\u03ba\u03cc",urlText:"URL",opacityText:"\u03b1\u03b4\u03b9\u03b1\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1",symbolText:"\u03a3\u03cd\u03bc\u03b2\u03bf\u03bb\u03bf",sizeText:"\u0395\u03cd\u03c1\u03bf\u03c2",rotationText:"\u03a0\u03b5\u03c1\u03b9\u03c3\u03c4\u03c1\u03bf\u03c6\u03ae"},"gxp.QueryPanel.prototype":{queryByLocationText:"\u0395\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7 \u03b2\u03ac\u03c3\u03b5\u03b9 \u03c4\u03bf\u03c0\u03bf\u03b8\u03b5\u03c3\u03af\u03b1\u03c2",
currentTextText:"\u03a4\u03c1\u03ad\u03c7\u03bf\u03bd \u03b5\u03cd\u03c1\u03bf\u03c2",queryByAttributesText:"\u0395\u03c0\u03b5\u03c1\u03ce\u03c4\u03b7\u03c3\u03b7 \u03b2\u03ac\u03c3\u03b5\u03b9 \u03c7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ce\u03bd",layerText:"\u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} \u039a\u03bb\u03af\u03bc\u03b1\u03ba\u03b1 1:{scale}",labelFeaturesText:"\u03a7\u03b1\u03c1\u03b1\u03ba\u03c4\u03b7\u03c1\u03b9\u03c3\u03c4\u03b9\u03ba\u03ac \u0395\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2",
labelsText:"\u0395\u03c4\u03b9\u03ba\u03ad\u03c4\u03b5\u03c2",basicText:"\u0391\u03c0\u03bb\u03ae",advancedText:"\u03a0\u03c1\u03bf\u03b7\u03b3\u03bc\u03ad\u03bd\u03b7",limitByScaleText:"\u03a0\u03b5\u03c1\u03b9\u03bf\u03c1\u03b9\u03c3\u03bc\u03cc\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9 \u03ba\u03bb\u03af\u03bc\u03b1\u03ba\u03b1\u03c2",limitByConditionText:"\u03a0\u03b5\u03c1\u03b9\u03bf\u03c1\u03b9\u03c3\u03bc\u03cc\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9 \u03c3\u03c5\u03bd\u03b8\u03ae\u03ba\u03b7\u03c2",
symbolText:"\u03a3\u03cd\u03bc\u03b2\u03bf\u03bb\u03bf",nameText:"\u038c\u03bd\u03bf\u03bc\u03b1"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} \u039a\u03bb\u03af\u03bc\u03b1\u03ba\u03b1 1:{scale}",minScaleLimitText:"\u038c\u03c1\u03b9\u03bf \u03b5\u03bb\u03ac\u03c7\u03b9\u03c3\u03c4\u03b7\u03c2 \u03ba\u03bb\u03af\u03bc\u03b1\u03ba\u03b1\u03c2",maxScaleLimitText:"\u038c\u03c1\u03b9\u03bf \u03bc\u03ad\u03b3\u03b9\u03c3\u03c4\u03b7\u03c2 \u03ba\u03bb\u03af\u03bc\u03b1\u03ba\u03b1\u03c2"},
"gxp.StrokeSymbolizer.prototype":{solidStrokeName:"\u03c3\u03c5\u03bc\u03c0\u03b1\u03b3\u03ae\u03c2",dashStrokeName:"\u03bc\u03b5 \u03c0\u03b1\u03cd\u03bb\u03b5\u03c2",dotStrokeName:"\u03bc\u03b5 \u03ba\u03bf\u03c5\u03ba\u03af\u03b4\u03b5\u03c2",titleText:"\u03a0\u03ad\u03c1\u03b1\u03c3\u03bc\u03b1",styleText:"\u03a3\u03c4\u03cd\u03bb\u03bf",colorText:"\u03a7\u03c1\u03ce\u03bc\u03b1",widthText:"\u03a0\u03bb\u03ac\u03c4\u03bf\u03c2",opacityText:"\u0391\u03b4\u03b9\u03b1\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1"},
"gxp.StylePropertiesDialog.prototype":{titleText:"\u0393\u03b5\u03bd\u03b9\u03ba\u03ac",nameFieldText:"\u038c\u03bd\u03bf\u03bc\u03b1",titleFieldText:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",abstractFieldText:"\u03a0\u03b5\u03c1\u03af\u03bb\u03b7\u03c8\u03b7"},"gxp.TextSymbolizer.prototype":{labelValuesText:"\u03a4\u03b9\u03bc\u03ad\u03c2 \u03b5\u03c4\u03b9\u03ba\u03ad\u03c4\u03b1\u03c2",haloText:"\u03a6\u03c9\u03c4\u03bf\u03c3\u03c4\u03ad\u03c6\u03b1\u03bd\u03bf",sizeText:"\u039c\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2"},
"gxp.WMSLayerPanel.prototype":{aboutText:"\u03a3\u03c7\u03b5\u03c4\u03b9\u03ba\u03ac \u03bc\u03b5",titleText:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",nameText:"\u038c\u03bd\u03bf\u03bc\u03b1",descriptionText:"\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae",displayText:"\u03a0\u03c1\u03bf\u03b2\u03bf\u03bb\u03ae",opacityText:"\u0391\u03b4\u03b9\u03b1\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1",formatText:"\u03a4\u03cd\u03c0\u03bf\u03c2",transparentText:"\u0394\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2",
cacheText:"Cache",cacheFieldText:"\u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03af\u03b7\u03c3\u03b5 \u03c4\u03b7\u03bd cached \u03ad\u03ba\u03b4\u03bf\u03c3\u03b7",stylesText:"\u0394\u03b9\u03b1\u03b8\u03ad\u03c3\u03b9\u03bc\u03b5\u03c2 \u03a3\u03c4\u03c5\u03bb",infoFormatText:"Info format",infoFormatEmptyText:"Select a format",displayOptionsText:"Display options",queryText:"Limit with filters",scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",
cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"\u039f \u03c7\u03ac\u03c1\u03c4\u03b7\u03c2 \u03c3\u03b1\u03c2 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03c4\u03bf\u03b9\u03bc\u03bf\u03c2 \u03bd\u03b1 \u03b4\u03b7\u03bc\u03bf\u03c3\u03b9\u03b5\u03c5\u03c4\u03b5\u03af \u03c3\u03c4\u03bf \u03b4\u03b9\u03b1\u03b4\u03af\u03ba\u03c4\u03c5\u03bf! \u0391\u03c0\u03bb\u03ac \u03b1\u03bd\u03c4\u03b9\u03b3\u03c1\u03ac\u03c8\u03c4\u03b5 \u03c4\u03bf\u03bd \u03b1\u03ba\u03cc\u03bb\u03bf\u03c5\u03b8\u03bf HTML \u03ba\u03ce\u03b4\u03b9\u03ba\u03b1 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03b5\u03bd\u03c3\u03c9\u03bc\u03b1\u03c4\u03ce\u03c3\u03b5\u03c4\u03b5 \u03c4\u03bf\u03bd \u03c7\u03ac\u03c1\u03c4\u03b7 \u03c3\u03c4\u03b7\u03bd \u03b9\u03c3\u03c4\u03bf\u03c3\u03b5\u03bb\u03af\u03b4\u03b1 \u03c3\u03b1\u03c2:",
heightLabel:"\u038e\u03c8\u03bf\u03c2",widthLabel:"\u03a0\u03bb\u03ac\u03c4\u03bf\u03c2",mapSizeLabel:"\u039c\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2 \u03a7\u03ac\u03c1\u03c4\u03b7",miniSizeLabel:"\u039c\u03b9\u03ba\u03c1\u03bf\u03b3\u03c1\u03b1\u03c6\u03af\u03b1",smallSizeLabel:"\u039c\u03b9\u03ba\u03c1\u03cc",premiumSizeLabel:"\u0395\u03be\u03b1\u03b9\u03c1\u03b5\u03c4\u03b9\u03ba\u03ac \u03c0\u03bf\u03b9\u03bf\u03c4\u03b9\u03ba\u03cc",largeSizeLabel:"\u039c\u03b5\u03b3\u03ac\u03bb\u03bf\u03c2"},"gxp.WMSStylesDialog.prototype":{addStyleText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7",
addStyleTip:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u03bd\u03ad\u03bf\u03c5 \u03c3\u03c4\u03c5\u03bb",chooseStyleText:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ae \u03c3\u03c4\u03c5\u03bb",deleteStyleText:"\u0391\u03c6\u03b1\u03af\u03c1\u03b5\u03c3\u03b7",deleteStyleTip:"\u0394\u03b9\u03b1\u03b3\u03c1\u03b1\u03c6\u03ae \u03c4\u03bf\u03c5 \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf\u03c5 \u03c3\u03c4\u03c5\u03bb",editStyleText:"\u0395\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1",
editStyleTip:"\u0395\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1 \u03c4\u03bf\u03c5 \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf\u03c5 \u03c3\u03c4\u03c5\u03bb",duplicateStyleText:"\u0394\u03b9\u03c0\u03bb\u03cc\u03c4\u03c5\u03c0\u03bf",duplicateStyleTip:"\u03a6\u03c4\u03b9\u03ac\u03be\u03c4\u03b5 \u03b4\u03b9\u03c0\u03bb\u03cc\u03c4\u03c5\u03c0\u03bf \u03c4\u03bf\u03c5 \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf\u03c5 \u03c3\u03c4\u03cd\u03bb",addRuleText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7",
addRuleTip:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u03bd\u03ad\u03bf\u03c5 \u03ba\u03b1\u03bd\u03cc\u03bd\u03b1",newRuleText:"\u039d\u03ad\u03bf\u03c2 \u039a\u03b1\u03bd\u03cc\u03bd\u03b1\u03c2",deleteRuleText:"\u0391\u03c6\u03b1\u03af\u03c1\u03b5\u03c3\u03b7",deleteRuleTip:"\u0394\u03b9\u03b1\u03b3\u03c1\u03ac\u03c8\u03c4\u03b5 \u03c4\u03bf\u03bd \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf \u03ba\u03b1\u03bd\u03cc\u03bd\u03b1",editRuleText:"\u0395\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1",
editRuleTip:"\u0395\u03c0\u03b5\u03be\u03b5\u03c1\u03b3\u03b1\u03c3\u03c4\u03b5\u03af\u03c4\u03b5 \u03c4\u03bf\u03bd \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf \u03ba\u03b1\u03bd\u03cc\u03bd\u03b1",duplicateRuleText:"\u0394\u03b9\u03c0\u03bb\u03cc\u03c4\u03c5\u03c0\u03bf",duplicateRuleTip:"\u03a6\u03c4\u03b9\u03ac\u03be\u03c4\u03b5 \u03b4\u03b9\u03c0\u03bb\u03cc\u03c4\u03c5\u03c0\u03bf \u03c4\u03bf\u03c5 \u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf\u03c5 \u03ba\u03b1\u03bd\u03cc\u03bd\u03b1",
cancelText:"\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7",saveText:"\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b5\u03c5\u03c3\u03b7",styleWindowTitle:"\u03a3\u03c4\u03c5\u03bb \u03a7\u03c1\u03ae\u03c3\u03c4\u03b7: {0}",ruleWindowTitle:"\u039a\u03b1\u03bd\u03cc\u03bd\u03b5\u03c2 \u03a3\u03c4\u03c5\u03bb: {0}",stylesFieldsetTitle:"\u03a3\u03c4\u03c5\u03bb",rulesFieldsetTitle:"\u039a\u03b1\u03bd\u03cc\u03bd\u03b5\u03c2",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},
"gxp.LayerUploadPanel.prototype":{titleLabel:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",titleEmptyText:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2 \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2",abstractLabel:"\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae",abstractEmptyText:"\u03a0\u03b5\u03c1\u03b9\u03b3\u03c1\u03b1\u03c6\u03ae \u03b5\u03c0\u03b9\u03c6\u03ac\u03bd\u03b5\u03b9\u03b1\u03c2",fileLabel:"\u0394\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1",fieldEmptyText:"\u0392\u03c1\u03b5\u03af\u03c4\u03b5 \u03c4\u03bf \u03bc\u03bf\u03bd\u03bf\u03c0\u03ac\u03c4\u03b9 \u03b3\u03b9\u03b1 \u03ad\u03bd\u03b1 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd...",
uploadText:"\u0391\u03bd\u03ad\u03b2\u03b1\u03c3\u03bc\u03b1",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"\u03a4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03c3\u03b1\u03c2 \u03b1\u03bd\u03b5\u03b2\u03b1\u03af\u03bd\u03bf\u03c5\u03bd...",invalidFileExtensionText:"\u039f \u03c4\u03cd\u03c0\u03bf\u03c2 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b5\u03af\u03bd\u03b1\u03b9 \u03ad\u03bd\u03b1\u03c2 \u03b1\u03c0\u03cc \u03c4\u03bf\u03c5\u03c2: ",
optionsText:"\u0395\u03c0\u03b9\u03bb\u03bf\u03b3\u03ad\u03c2",workspaceLabel:"\u03a7\u03ce\u03c1\u03bf\u03c2 \u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2",workspaceEmptyText:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03bf\u03c2 \u03c7\u03ce\u03c1\u03bf\u03c2 \u03b5\u03c1\u03b3\u03b1\u03c3\u03af\u03b1\u03c2",dataStoreLabel:"\u0391\u03c0\u03bf\u03b8\u03ae\u03ba\u03b7",dataStoreEmptyText:"Create new store",defaultDataStoreEmptyText:"\u03a0\u03c1\u03bf\u03b5\u03c0\u03b9\u03bb\u03b5\u03b3\u03bc\u03ad\u03bd\u03b7 \u03b1\u03c0\u03bf\u03b8\u03ae\u03ba\u03b7"},
"gxp.NewSourceWindow.prototype":{title:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u039d\u03ad\u03bf\u03c5 \u0394\u03b9\u03b1\u03ba\u03bf\u03bc\u03b9\u03c3\u03c4\u03ae...",cancelText:"\u0391\u03ba\u03cd\u03c1\u03c9\u03c3\u03b7",addServerText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u0394\u03b9\u03b1\u03ba\u03bf\u03bc\u03b9\u03c3\u03c4\u03ae",invalidURLText:"\u0395\u03af\u03c3\u03b1\u03b3\u03b5\u03c4\u03b5 \u03ad\u03bd\u03b1 \u03ad\u03b3\u03ba\u03c5\u03c1\u03bf URL \u03b3\u03b9\u03b1 \u03ad\u03bd\u03b1 WMS endpoint (e.g. http://example.com/geoserver/wms)",
contactingServerText:"\u0395\u03c0\u03b9\u03ba\u03bf\u03b9\u03bd\u03c9\u03bd\u03af\u03b1 \u03bc\u03b5 \u0394\u03b9\u03b1\u03ba\u03bf\u03bc\u03b9\u03c3\u03c4\u03ae..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"\u0395\u03c0\u03af\u03c0\u03b5\u03b4\u03bf \u03b6\u03bf\u03c5\u03bc"},"gxp.Viewer.prototype":{saveErrorText:"Trouble saving: "},"gxp.FeedSourceDialog.prototype":{feedTypeText:"\u03a0\u03b7\u03b3\u03ae",addPicasaText:"\u03a6\u03c9\u03c4\u03bf\u03b3\u03c1\u03b1\u03c6\u03af\u03b5\u03c2 Picasa",
addYouTubeText:"YouTube \u03b2\u03af\u03bd\u03c4\u03b5\u03bf",addRSSText:"\u0386\u03bb\u03bb\u03b1 Feed GeoRSS",addFeedText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u03c3\u03c4\u03bf \u03c7\u03ac\u03c1\u03c4\u03b7",addTitleText:"\u03a4\u03af\u03c4\u03bb\u03bf\u03c2",keywordText:"\u039b\u03ad\u03be\u03b7-\u03ba\u03bb\u03b5\u03b9\u03b4\u03af",doneText:"Done",titleText:"\u03a0\u03c1\u03bf\u03c3\u03b8\u03ae\u03ba\u03b7 \u03c1\u03bf\u03ae\u03c2",maxResultsText:"Max \u0395\u03af\u03b4\u03b7"},
"gxp.ClassificationPanel.prototype":{classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",rampOrangeText:"Orange",rampJetText:"Blue-Red",rampGrayText:"Gray",rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",colorEndText:"End Color",colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",methodJenksText:"Jenks Natural Breaks",
selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",reverseColorsText:"Reverse colors"}});
GeoExt.Lang.add("en",{"gxp.menu.LayerMenu.prototype":{layerText:"Layer"},"gxp.plugins.AddLayers.prototype":{addActionMenuText:"Add layers",addActionTip:"Add layers",addServerText:"Add a New Server",addButtonText:"Add layers",untitledText:"Untitled",addLayerSourceErrorText:"Error getting WMS capabilities ({msg}).\nPlease check the url and try again.",availableLayersText:"Available Layers",expanderTemplateText:"<p><b>Abstract:</b> {abstract}</p>",panelTitleText:"Title",layerSelectionText:"View available data from:",
doneText:"Done",uploadText:"Upload layers",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},"gxp.plugins.BingSource.prototype":{title:"Bing Layers",roadTitle:"Bing Roads",aerialTitle:"Bing Aerial",labeledAerialTitle:"Bing Aerial With Labels"},"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",createFeatureActionTip:"Create a new feature",editFeatureActionTip:"Edit existing feature",commitTitle:"Commit message",
commitText:"Please enter a commit message for this edit:"},"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"Display on map",firstPageTip:"First page",previousPageTip:"Previous page",zoomPageExtentTip:"Zoom to page extent",nextPageTip:"Next page",lastPageTip:"Last page",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{menuText:"3D Viewer",tooltip:"Switch to 3D Viewer"},"gxp.plugins.GoogleSource.prototype":{title:"Google Layers",roadmapAbstract:"Show street map",satelliteAbstract:"Show satellite imagery",
hybridAbstract:"Show imagery with street names",terrainAbstract:"Show street map with terrain"},"gxp.plugins.LayerProperties.prototype":{menuText:"Layer Properties",toolTip:"Layer Properties"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Layers",rootNodeText:"Layers",overlayNodeText:"Overlays",baseNodeText:"Base Layers"},"gxp.plugins.LayerManager.prototype":{baseNodeText:"Base Maps"},"gxp.plugins.Legend.prototype":{menuText:"Show legend",tooltip:"Show legend"},"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"Loading map..."},
"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",
naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldPrintTitle:"World Print"},"gxp.plugins.Measure.prototype":{buttonText:"Measure",lengthMenuText:"Length",areaMenuText:"Area",lengthTooltip:"Measure length",areaTooltip:"Measure area",measureTooltip:"Measure"},"gxp.plugins.Navigation.prototype":{menuText:"Pan map",tooltip:"Pan map"},"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Zoom to previous extent",
nextMenuText:"Zoom to next extent",previousTooltip:"Zoom to previous extent",nextTooltip:"Zoom to next extent"},"gxp.plugins.OSMSource.prototype":{title:"OpenStreetMap Layers",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},"gxp.plugins.Print.prototype":{buttonText:"Print",menuText:"Print map",tooltip:"Print map",previewText:"Print Preview",notAllNotPrintableText:"Not All Layers Can Be Printed",
nonePrintableText:"None of your current map layers can be printed"},"gxp.plugins.MapQuestSource.prototype":{title:"MapQuest Layers",osmAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
naipTitle:"MapQuest Imagery"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Query",queryMenuText:"Query layer",queryActionTip:"Query the selected layer",queryByLocationText:"Query by current map extent",queryByAttributesText:"Query by attributes",queryMsg:"Querying...",cancelButtonText:"Cancel",noFeaturesTitle:"No Match",noFeaturesMessage:"Your query did not return any results."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Remove layer",removeActionTip:"Remove layer"},"gxp.plugins.Styler.prototype":{menuText:"Layer Styles",
tooltip:"Layer Styles"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"Get Feature Info",popupTitle:"Feature Info"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom box",zoomInMenuText:"Zoom in",zoomOutMenuText:"Zoom out",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"Zoom in",zoomOutTooltip:"Zoom out"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Zoom to max extent",tooltip:"Zoom to max extent"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Zoom to layer extent",
tooltip:"Zoom to layer extent"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Zoom to layer extent",tooltip:"Zoom to layer extent"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Zoom to selected features",tooltip:"Zoom to selected features"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"Save Changes?",closeMsg:"This feature has unsaved changes. Would you like to save your changes?",deleteMsgTitle:"Delete Feature?",deleteMsg:"Are you sure you want to delete this feature?",editButtonText:"Edit",
editButtonTooltip:"Make this feature editable",deleteButtonText:"Delete",deleteButtonTooltip:"Delete this feature",cancelButtonText:"Cancel",cancelButtonTooltip:"Stop editing, discard changes",saveButtonText:"Save",saveButtonTooltip:"Save changes"},"gxp.FillSymbolizer.prototype":{fillText:"Fill",colorText:"Color",opacityText:"Opacity"},"gxp.FilterBuilder.prototype":{builderTypeNames:["any","all","none","not all"],preComboText:"Match",postComboText:"of the following:",addConditionText:"add condition",
addGroupText:"add group",removeConditionText:"remove condition"},"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Name",titleHeaderText:"Title",queryableHeaderText:"Queryable",layerSelectionLabel:"View available data from:",layerAdditionLabel:"or add a new server.",expanderTemplateText:"<p><b>Abstract:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"circle",graphicSquareText:"square",graphicTriangleText:"triangle",graphicStarText:"star",graphicCrossText:"cross",graphicXText:"x",
graphicExternalText:"external",urlText:"URL",opacityText:"opacity",symbolText:"Symbol",sizeText:"Size",rotationText:"Rotation"},"gxp.QueryPanel.prototype":{queryByLocationText:"Query by location",currentTextText:"Current extent",queryByAttributesText:"Query by attributes",layerText:"Layer"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} Scale 1:{scale}",labelFeaturesText:"Label Features",labelsText:"Labels",basicText:"Basic",advancedText:"Advanced",limitByScaleText:"Limit by scale",limitByConditionText:"Limit by condition",
symbolText:"Symbol",nameText:"Name"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} Scale 1:{scale}",minScaleLimitText:"Min scale limit",maxScaleLimitText:"Max scale limit"},"gxp.StrokeSymbolizer.prototype":{solidStrokeName:"solid",dashStrokeName:"dash",dotStrokeName:"dot",titleText:"Stroke",styleText:"Style",colorText:"Color",widthText:"Width",opacityText:"Opacity"},"gxp.StylePropertiesDialog.prototype":{titleText:"General",nameFieldText:"Name",titleFieldText:"Title",abstractFieldText:"Abstract"},
"gxp.TextSymbolizer.prototype":{labelValuesText:"Label values",haloText:"Halo",sizeText:"Size"},"gxp.WMSLayerPanel.prototype":{attributionText:"Attribution",aboutText:"About",titleText:"Title",nameText:"Name",descriptionText:"Description",displayText:"Display",opacityText:"Opacity",formatText:"Format",transparentText:"Transparent",cacheText:"Cache",cacheFieldText:"Use cached version",stylesText:"Available Styles",infoFormatText:"Info format",infoFormatEmptyText:"Select a format",displayOptionsText:"Display options",
queryText:"Limit with filters",scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"Your map is ready to be published to the web! Simply copy the following HTML to embed the map in your website:",heightLabel:"Height",widthLabel:"Width",mapSizeLabel:"Map Size",
miniSizeLabel:"Mini",smallSizeLabel:"Small",premiumSizeLabel:"Premium",largeSizeLabel:"Large"},"gxp.WMSStylesDialog.prototype":{addStyleText:"Add",addStyleTip:"Add a new style",chooseStyleText:"Choose style",deleteStyleText:"Remove",deleteStyleTip:"Delete the selected style",editStyleText:"Edit",editStyleTip:"Edit the selected style",duplicateStyleText:"Duplicate",duplicateStyleTip:"Duplicate the selected style",addRuleText:"Add",addRuleTip:"Add a new rule",newRuleText:"New Rule",deleteRuleText:"Remove",
deleteRuleTip:"Delete the selected rule",editRuleText:"Edit",editRuleTip:"Edit the selected rule",duplicateRuleText:"Duplicate",duplicateRuleTip:"Duplicate the selected rule",cancelText:"Cancel",saveText:"Save",styleWindowTitle:"User Style: {0}",ruleWindowTitle:"Style Rule: {0}",stylesFieldsetTitle:"Styles",rulesFieldsetTitle:"Rules",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},"gxp.LayerUploadPanel.prototype":{titleLabel:"Title",titleEmptyText:"Layer title",
abstractLabel:"Description",abstractEmptyText:"Layer description",fileLabel:"Data",fieldEmptyText:"Browse for data archive...",uploadText:"Upload",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"Uploading your data...",invalidFileExtensionText:"File extension must be one of: ",optionsText:"Options",workspaceLabel:"Workspace",workspaceEmptyText:"Default workspace",dataStoreLabel:"Store",dataStoreEmptyText:"Choose a store",dataStoreNewText:"Create new store",
crsLabel:"CRS",crsEmptyText:"Coordinate Reference System ID",invalidCrsText:"CRS identifier should be an EPSG code (e.g. EPSG:4326)"},"gxp.NewSourceDialog.prototype":{title:"Add new server...",cancelText:"Cancel",addServerText:"Add Server",invalidURLText:"Enter a valid URL to a WMS endpoint (e.g. http://example.com/geoserver/wms)",contactingServerText:"Contacting Server..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Zoom level"},"gxp.Viewer.prototype":{saveErrorText:"Trouble saving: "},"gxp.FeedSourceDialog.prototype":{feedTypeText:"Source",
addPicasaText:"Picasa Photos",addYouTubeText:"YouTube Videos",addRSSText:"Other GeoRSS Feed",addFeedText:"Add to Map",addTitleText:"Title",keywordText:"Keyword",doneText:"Done",titleText:"Add Feeds",maxResultsText:"Max Items"},"gxp.ClassificationPanel.prototype":{classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",rampOrangeText:"Orange",rampJetText:"Blue-Red",rampGrayText:"Gray",rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",
colorEndText:"End Color",colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",methodJenksText:"Jenks Natural Breaks",selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",reverseColorsText:"Reverse colors"}});
GeoExt.Lang.add("es",{"gxp.menu.LayerMenu.prototype":{layerText:"Capa"},"gxp.plugins.AddLayers.prototype":{addActionMenuText:"A\u00f1adir Capas",addActionTip:"A\u00f1adir Capas",addServerText:"A\u00f1adir servidor",addButtonText:"A\u00f1adir Capas",untitledText:"Sin T\u00edtulo",addLayerSourceErrorText:"Error obteniendo capabilities de WMS ({msg}).\nPor favor, compruebe la URL y vuelva a intentarlo.",availableLayersText:"Capas disponibles",expanderTemplateText:"<p><b>Resumen:</b> {abstract}</p>",
panelTitleText:"T\u00edtulo",layerSelectionText:"Ver datos disponibles de:",doneText:"Hecho",uploadText:"Subir Datos",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},"gxp.plugins.BingSource.prototype":{title:"Capas Bing",roadTitle:"Bing Carreteras",aerialTitle:"Bing Foto A\u00e9rea",labeledAerialTitle:"Bing H\u00edbrido"},"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",createFeatureActionTip:"Crear nuevo elemento",
editFeatureActionTip:"Editar elemento existente",commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:"},"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"Mostrar en el mapa",firstPageTip:"Primera p\u00e1gina",previousPageTip:"P\u00e1gina anterior",zoomPageExtentTip:"Zoom a la extensi\u00f3n de la p\u00e1gina",nextPageTip:"P\u00e1gina siguiente",lastPageTip:"\u00daltima p\u00e1gina",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{menuText:"Vista 3D",
tooltip:"Vista 3D"},"gxp.plugins.GoogleSource.prototype":{title:"Capas Google",roadmapAbstract:"Mostrar Callejero",satelliteAbstract:"Mostrar im\u00e1genes a\u00e9reas",hybridAbstract:"Mostrar im\u00e1genes con nombres de calle",terrainAbstract:"Mostrar callejero con terreno"},"gxp.plugins.LayerProperties.prototype":{menuText:"Propiedades de la capa",toolTip:"Propiedades de la capa"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Capas",rootNodeText:"Capas",overlayNodeText:"Capas superpuestas",baseNodeText:"Capa base"},
"gxp.plugins.LayerManager.prototype":{baseNodeText:"Capa base"},"gxp.plugins.Legend.prototype":{menuText:"Leyenda",tooltip:"Leyenda"},"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"Loading Map..."},"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",
controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldPrintTitle:"World Print"},"gxp.plugins.Measure.prototype":{buttonText:"Medir",lengthMenuText:"Longitud",areaMenuText:"\u00c1rea",lengthTooltip:"Medir Longitud",areaTooltip:"Medir \u00c1rea",
measureTooltip:"Medir"},"gxp.plugins.Navigation.prototype":{menuText:"Desplazar mapa",tooltip:"Desplazar mapa"},"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Vista anterior",nextMenuText:"Vista siguiente",previousTooltip:"Vista anterior",nextTooltip:"Vista siguiente"},"gxp.plugins.OSMSource.prototype":{title:"Capas OpenStreetMap",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Datos CC-By-SA de <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},
"gxp.plugins.Print.prototype":{buttonText:"Imprimir",menuText:"Imprimir mapa",tooltip:"Imprimir mapa",previewText:"Vista previa",notAllNotPrintableText:"No se pueden imprimir todas las capas",nonePrintableText:"No se puede imprimir ninguna de las capas del mapa"},"gxp.plugins.MapQuestSource.prototype":{title:"Capas MapQuest",osmAttribution:"Teselas cortes\u00eda de <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Teselas cortes\u00eda de <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",naipTitle:"MapQuest Im\u00e1genes"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Consultar",queryMenuText:"Consultar capa",queryActionTip:"Consultar la capa seleccionada",queryByLocationText:"Query by current map extent",queryByAttributesText:"Consultar por atributos",queryMsg:"Consultando...",
cancelButtonText:"Cancelar",noFeaturesTitle:"Sin coincidencias",noFeaturesMessage:"Su consulta no produjo resultados."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Eliminar Capa",removeActionTip:"Eliminar Capa"},"gxp.plugins.Styler.prototype":{menuText:"Editar estilos",tooltip:"Gestionar estilos de capa"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"Consultar elementos",popupTitle:"Informaci\u00f3n de elementos"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",
zoomInMenuText:"Acercar",zoomOutMenuText:"Alejar",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"Acercar",zoomOutTooltip:"Alejar"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Ver extensi\u00f3n total",tooltip:"Ver extensi\u00f3n total"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Ver toda la capa",tooltip:"Ver toda la capa"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Ver toda la la capa",tooltip:"Ver toda la capa"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Ver los elementos seleccionados",
tooltip:"Ver los elementos seleccionados"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"\u00bfDesea guardar los cambios?",closeMsg:"Los cambios en este elemento no se han guardado. \u00bfDesea guardar los cambios?",deleteMsgTitle:"\u00bfDesea borrar el elemento?",deleteMsg:"\u00bfEst\u00e1 seguro de querer borrar este elemento?",editButtonText:"Editar",editButtonTooltip:"Hacer editable este elemento",deleteButtonText:"Borrar",deleteButtonTooltip:"Borrar este elemento",cancelButtonText:"Cancelar",
cancelButtonTooltip:"Dejar de editar, descartar cambios",saveButtonText:"Guardar",saveButtonTooltip:"Guardar cambios"},"gxp.FillSymbolizer.prototype":{fillText:"Relleno",colorText:"Color",opacityText:"Opacidad"},"gxp.FilterBuilder.prototype":{builderTypeNames:["cualquiera de","todas","ninguna de","no todas"],preComboText:"Cumplir",postComboText:"las condiciones siguientes:",addConditionText:"a\u00f1adir condici\u00f3n",addGroupText:"a\u00f1adir grupo",removeConditionText:"eliminar condici\u00f3n"},
"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Nombre",titleHeaderText:"T\u00edtulo",queryableHeaderText:"Consultable",layerSelectionLabel:"Ver datos disponibles de:",layerAdditionLabel:"o a\u00f1adir otro servidor.",expanderTemplateText:"<p><b>Resumen:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"c\u00edrculo",graphicSquareText:"cuadrado",graphicTriangleText:"tri\u00e1ngulo",graphicStarText:"estrella",graphicCrossText:"cruz",graphicXText:"x",graphicExternalText:"externo",
urlText:"URL",opacityText:"opacidad",symbolText:"S\u00edmbolo",sizeText:"Tama\u00f1o",rotationText:"Giro"},"gxp.QueryPanel.prototype":{queryByLocationText:"Consultar por localizaci\u00f3n",currentTextText:"Extensi\u00f3n actual",queryByAttributesText:"Consultar por atributo",layerText:"Capa"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} Escala 1:{scale}",labelFeaturesText:"Etiquetado de elementos",labelsText:"Etiquetas",basicText:"B\u00e1sico",advancedText:"Advanzado",limitByScaleText:"Limitar por escala",
limitByConditionText:"Limitar por condici\u00f3n",symbolText:"S\u00edmbolo",nameText:"Nombre"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} Escala 1:{scale}",minScaleLimitText:"Escala m\u00ednima",maxScaleLimitText:"Escala m\u00e1xima"},"gxp.StrokeSymbolizer.prototype":{solidStrokeName:"continuo",dashStrokeName:"guiones",dotStrokeName:"puntos",titleText:"Trazo",styleText:"Estilo",colorText:"Color",widthText:"Ancho",opacityText:"Opacidad"},"gxp.StylePropertiesDialog.prototype":{titleText:"General",
nameFieldText:"Nombre",titleFieldText:"T\u00edtulo",abstractFieldText:"Resumen"},"gxp.TextSymbolizer.prototype":{labelValuesText:"Etiquetado",haloText:"Halo",sizeText:"Tama\u00f1o"},"gxp.WMSLayerPanel.prototype":{attributionText:"Attribution",aboutText:"Acerca de",titleText:"T\u00edtulo",nameText:"Nombre",descriptionText:"Descripci\u00f3n",displayText:"Mostrar",opacityText:"Opacidad",formatText:"Formato",transparentText:"Transparente",cacheText:"Cach\u00e9",cacheFieldText:"Usar la versi\u00f3n en cach\u00e9",
stylesText:"Estilos disponibles",infoFormatText:"Info format",infoFormatEmptyText:"Select a format",displayOptionsText:"Display options",queryText:"Limit with filters",scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"\u00a1Ya puede publicar su mapa en otras webs! Simplemente copie el siguiente c\u00f3digo HTML en el lugar donde desee incrustarlo:",
heightLabel:"Alto",widthLabel:"Ancho",mapSizeLabel:"Tama\u00f1o",miniSizeLabel:"M\u00ednimo",smallSizeLabel:"Peque\u00f1o",premiumSizeLabel:"Premium",largeSizeLabel:"Grande"},"gxp.WMSStylesDialog.prototype":{addStyleText:"A\u00f1adir",addStyleTip:"A\u00f1adir un estilo",chooseStyleText:"Escoger estilo",deleteStyleText:"Quitar",deleteStyleTip:"Borrar el estilo seleccionado",editStyleText:"Cambiar",editStyleTip:"Editar el estilo seleccionado",duplicateStyleText:"Clonar",duplicateStyleTip:"Duplicar el estilo seleccionado",
addRuleText:"A\u00f1adir",addRuleTip:"A\u00f1adir una regla",newRuleText:"Nueva regla",deleteRuleText:"Quitar",deleteRuleTip:"Borrar la regla seleccionada",editRuleText:"Cambiar",editRuleTip:"Editar la regla seleccionada",duplicateRuleText:"Duplicar",duplicateRuleTip:"Duplicar la regla seleccionada",cancelText:"Cancelar",saveText:"Guardar",styleWindowTitle:"Estilo: {0}",ruleWindowTitle:"Regla: {0}",stylesFieldsetTitle:"Estilos",rulesFieldsetTitle:"Reglas",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},
"gxp.LayerUploadPanel.prototype":{titleLabel:"T\u00edtulo",titleEmptyText:"T\u00edtulo de la capa",abstractLabel:"Descripci\u00f3n",abstractEmptyText:"Descripci\u00f3n de la capa",fileLabel:"Datos",fieldEmptyText:"Navegue por los datos...",uploadText:"Subir",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"Suba sus datos data...",invalidFileExtensionText:"El fichero debe tener alguna de estas extensiones: ",optionsText:"Opciones",workspaceLabel:"Espacio de trabajo",
workspaceEmptyText:"Espacio de trabajo por defecto",dataStoreLabel:"Almac\u00e9n de datos",dataStoreEmptyText:"Create new store",defaultDataStoreEmptyText:"Almac\u00e9n de datos por defecto"},"gxp.NewSourceDialog.prototype":{title:"A\u00f1adir Servidor...",cancelText:"Cancelar",addServerText:"A\u00f1adir Servidor",invalidURLText:"Enter a valid URL to a WMS endpoint (e.g. http://example.com/geoserver/wms)",contactingServerText:"Conectando con el Servidor..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Escala"},
"gxp.Viewer.prototype":{saveErrorText:"Problemas guardando: "},"gxp.FeedSourceDialog.prototype":{feedTypeText:"Fuente",addPicasaText:"Picasa fotos",addYouTubeText:"YouTube Videos",addRSSText:"Feed GeoRSS Otro",addFeedText:"Agregar al Mapa",addTitleText:"T\u00edtulo",keywordText:"Palabra clave",doneText:"Hecho",titleText:"Agregar Feeds",maxResultsText:"Productos Max"},"gxp.ClassificationPanel.prototype":{classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",rampOrangeText:"Orange",
rampJetText:"Blue-Red",rampGrayText:"Gray",rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",colorEndText:"End Color",colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",methodJenksText:"Jenks Natural Breaks",selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",
startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",reverseColorsText:"Reverse colors"}});
GeoExt.Lang.add("fr",{"gxp.plugins.AddLayers.prototype":{addActionMenuText:"Ajouter des calques",addActionTip:"Ajouter des calques",addServerText:"Ajouter un nouveau serveur",untitledText:"Sans titre",addLayerSourceErrorText:"Impossible d'obtenir les capacit\u00e9s WMS ({msg}).\nVeuillez v\u00e9rifier l'URL et essayez \u00e0 nouveau.",availableLayersText:"Couches disponibles",doneText:"Termin\u00e9",uploadText:"T\u00e9l\u00e9charger des donn\u00e9es",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},
"gxp.plugins.BingSource.prototype":{title:"Calques Bing",roadTitle:"Bing routes",aerialTitle:"Bing images a\u00e9riennes",labeledAerialTitle:"Bing images a\u00e9riennes avec \u00e9tiquettes"},"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",createFeatureActionTip:"Cr\u00e9er un nouvel objet",editFeatureActionTip:"Modifier un objet existant",commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:"},
"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"Afficher sur la carte",firstPageTip:"Premi\u00e8re page",previousPageTip:"Page pr\u00e9c\u00e9dente",zoomPageExtentTip:"Zoom sur la page",nextPageTip:"Page suivante",lastPageTip:"Derni\u00e8re page",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{menuText:"Passer \u00e0 la visionneuse 3D",tooltip:"Passer \u00e0 la visionneuse 3D"},"gxp.plugins.GoogleSource.prototype":{title:"Calques Google",roadmapAbstract:"Carte routi\u00e8re",
satelliteAbstract:"Images satellite",hybridAbstract:"Images avec routes",terrainAbstract:"Carte routi\u00e8re avec le terrain"},"gxp.plugins.LayerProperties.prototype":{menuText:"Propri\u00e9t\u00e9s de la couche",toolTip:"Afficher les propri\u00e9t\u00e9s de la couche"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Layers",rootNodeText:"Layers",overlayNodeText:"Surimpressions",baseNodeText:"Couches"},"gxp.plugins.LayerManager.prototype":{baseNodeText:"Couche"},"gxp.plugins.Legend.prototype":{menuText:"L\u00e9gende",
tooltip:"Afficher la l\u00e9gende"},"gxp.plugins.Measure.prototype":{buttonText:"Mesure",lengthMenuText:"Longueur",areaMenuText:"Surface",lengthTooltip:"Mesurer une longueur",areaTooltip:"Mesurer une surface",measureTooltip:"Mesurer"},"gxp.plugins.Navigation.prototype":{menuText:"Panner",tooltip:"Faire glisser la carte"},"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Position pr\u00e9c\u00e9dente",nextMenuText:"Position suivante",previousTooltip:"Retourner \u00e0 la position pr\u00e9c\u00e9dente",
nextTooltip:"Aller \u00e0 la position suivante"},"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"Chargement de la carte..."},"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",
naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldPrintTitle:"World Print"},"gxp.plugins.OSMSource.prototype":{title:"Calques OpenStreetMap",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Donn\u00e9es CC-By-SA par <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},
"gxp.plugins.Print.prototype":{buttonText:"Imprimer",menuText:"Imprimer la carte",tooltip:"Imprimer la carte",previewText:"Aper\u00e7u avant impression",notAllNotPrintableText:"Non, toutes les couches peuvent \u00eatre imprim\u00e9es",nonePrintableText:"Aucune de vos couches ne peut \u00eatre imprim\u00e9e"},"gxp.plugins.MapQuestSource.prototype":{title:"MapQuest Layers",osmAttribution:"Avec la permission de tuiles <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Avec la permission de tuiles <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",naipTitle:"MapQuest Imagery"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Interrogation",queryMenuText:"Couche de requ\u00eates",queryActionTip:"Interroger la couche s\u00e9lectionn\u00e9e",queryByLocationText:"Query by current map extent",queryByAttributesText:"Requ\u00eate par attributs"},
"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Enlever la couche",removeActionTip:"Enlever la couche"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"Get Feature Info",popupTitle:"Info sur l'objet"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",zoomInMenuText:"Zoom avant",zoomOutMenuText:"Zoom arri\u00e8re",zoomTooltip:"Zoomer en dessinant un rectangle",zoomInTooltip:"Zoomer",zoomOutTooltip:"D\u00e9zoomer"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Zoomer sur la carte max",
tooltip:"Zoomer sur la carte max"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Zoomer sur la couche",tooltip:"Zoomer sur la couche"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Zoomer sur la couche",tooltip:"Zoomer sur la couche"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Zoomer sur les objets s\u00e9lectionn\u00e9s",tooltip:"Zoomer sur les objets s\u00e9lectionn\u00e9s"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"Enregistrer les modifications ?",closeMsg:"Cet objet a des modifications non enregistr\u00e9es. Voulez-vous enregistrer vos modifications ?",
deleteMsgTitle:"Supprimer l'objet ?",deleteMsg:"Etes-vous s\u00fbr de vouloir supprimer cet objet ?",editButtonText:"Modifier",editButtonTooltip:"Modifier cet objet",deleteButtonText:"Supprimer",deleteButtonTooltip:"Supprimer cet objet",cancelButtonText:"Annuler",cancelButtonTooltip:"Arr\u00eater de modifier, annuler les modifications",saveButtonText:"Enregistrer",saveButtonTooltip:"Enregistrer les modifications"},"gxp.FillSymbolizer.prototype":{fillText:"Remplir",colorText:"Couleur",opacityText:"Opacit\u00e9"},
"gxp.FilterBuilder.prototype":{builderTypeNames:["Tout","tous","aucun","pas tout"],preComboText:"Match",postComboText:"de ce qui suit:",addConditionText:"Ajouter la condition",addGroupText:"Ajouter un groupe",removeConditionText:"Supprimer la condition"},"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Nom",titleHeaderText:"Titre",queryableHeaderText:"Interrogeable",layerSelectionLabel:"Voir les donn\u00e9es disponibles \u00e0 partir de :",layerAdditionLabel:"ou ajouter un nouveau serveur.",
expanderTemplateText:"<p><b>R\u00e9sum\u00e9:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"Cercle",graphicSquareText:"Carr\u00e9",graphicTriangleText:"Triangle",graphicStarText:"\u00c9toile",graphicCrossText:"Croix",graphicXText:"x",graphicExternalText:"Externe",urlText:"URL",opacityText:"Opacit\u00e9",symbolText:"Symbole",sizeText:"Taille",rotationText:"Rotation"},"gxp.QueryPanel.prototype":{queryByLocationText:"Interrogation selon le lieu",currentTextText:"Mesure actuelle",
queryByAttributesText:"Requ\u00eate par attributs",layerText:"Calque"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} \u00e9chelle 1:{scale}",labelFeaturesText:"Label Caract\u00e9ristiques",advancedText:"Avanc\u00e9",limitByScaleText:"Limiter par l'\u00e9chelle",limitByConditionText:"Limiter par condition",symbolText:"Symbole",nameText:"Nom"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} \u00e9chelle 1:{scale}",maxScaleLimitText:"\u00c9chelle maximale"},"gxp.TextSymbolizer.prototype":{labelValuesText:"Label valeurs",
haloText:"Halo",sizeText:"Taille"},"gxp.WMSLayerPanel.prototype":{attributionText:"Attribution",aboutText:"A propos",titleText:"Titre",nameText:"Nom",descriptionText:"Description",displayText:"Affichage",opacityText:"Opacit\u00e9",formatText:"Format",transparentText:"Transparent",cacheText:"Cache",cacheFieldText:"Utiliser la version mise en cache",stylesText:"Available styles",infoFormatText:"Info format",infoFormatEmptyText:"Choisissez un format",displayOptionsText:"Display options",queryText:"Limit with filters",
scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"Votre carte est pr\u00eate \u00e0 \u00eatre publi\u00e9e sur le web. Il suffit de copier le code HTML suivant pour int\u00e9grer la carte dans votre site Web :",heightLabel:"Hauteur",widthLabel:"Largeur",
mapSizeLabel:"Taille de la carte",miniSizeLabel:"Mini",smallSizeLabel:"Petit",premiumSizeLabel:"Premium",largeSizeLabel:"Large"},"gxp.WMSStylesDialog.prototype":{addStyleText:"Add",addStyleTip:"Add a new style",chooseStyleText:"Choose style",deleteStyleText:"Remove",deleteStyleTip:"Delete the selected style",editStyleText:"Edit",editStyleTip:"Edit the selected style",duplicateStyleText:"Duplicate",duplicateStyleTip:"Duplicate the selected style",addRuleText:"Add",addRuleTip:"Add a new rule",newRuleText:"New Rule",
deleteRuleText:"Remove",deleteRuleTip:"Delete the selected rule",editRuleText:"Edit",editRuleTip:"Edit the selected rule",duplicateRuleText:"Duplicate",duplicateRuleTip:"Duplicate the selected rule",cancelText:"Cancel",saveText:"Save",styleWindowTitle:"User Style: {0}",ruleWindowTitle:"Style Rule: {0}",stylesFieldsetTitle:"Styles",rulesFieldsetTitle:"Rules",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},"gxp.LayerUploadPanel.prototype":{titleLabel:"Titre",
titleEmptyText:"Titre de la couche",abstractLabel:"Description",abstractEmptyText:"Description couche",fileLabel:"Donn\u00e9es",fieldEmptyText:"Parcourir pour ...",uploadText:"Upload",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"Transfert de vos donn\u00e9es ...",invalidFileExtensionText:"L'extension du fichier doit \u00eatre : ",optionsText:"Options",workspaceLabel:"Espace de travail",workspaceEmptyText:"Espace de travail par d\u00e9faut",dataStoreLabel:"Magasin de donn\u00e9es",
dataStoreEmptyText:"Create new store",defaultDataStoreEmptyText:"Magasin de donn\u00e9es par d\u00e9faut"},"gxp.NewSourceDialog.prototype":{title:"Ajouter un nouveau serveur...",cancelText:"Annuler",addServerText:"Ajouter un serveur",invalidURLText:"Indiquez l'URL valide d'un serveur WMS (e.g. http://example.com/geoserver/wms)",contactingServerText:"Interrogation du serveur..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Niveau de zoom"},"gxp.Viewer.prototype":{saveErrorText:"Sauver Trouble: "},
"gxp.FeedSourceDialog.prototype":{feedTypeText:"Source",addPicasaText:"Picasa Photos",addYouTubeText:"YouTube Vid\u00e9os",addRSSText:"GeoRSS Autre",addFeedText:"Ajouter \u00e0 la carte",addTitleText:"Titre",keywordText:"Mot-cl\u00e9",doneText:"Termin\u00e9",titletext:"Ajouter RSS",maxResultsText:"Articles Max"},"gxp.ClassificationPanel.prototype":{classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",rampOrangeText:"Orange",rampJetText:"Blue-Red",rampGrayText:"Gray",
rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",colorEndText:"End Color",colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",methodJenksText:"Jenks Natural Breaks",selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",
reverseColorsText:"Reverse colors"}});
GeoExt.Lang.add("id",{"gxp.menu.LayerMenu.prototype":{layerText:"Layer"},"gxp.plugins.AddLayers.prototype":{addActionMenuText:"Tambahkan layer",addActionTip:"Tambahkan layer",addServerText:"Tambahkan server baru",addButtonText:"Add layers",untitledText:"Untitled",addLayerSourceErrorText:"Kesalahan mendapatkan kemampuan WMS ({msg}). \nSilakan cek url dan coba lagi.",availableLayersText:"Layer tersedia",expanderTemplateText:"<p><b>Abstract:</b> {abstract}</p>",panelTitleText:"Title",layerSelectionText:"View available data from:",
doneText:"Selesai",uploadText:"Unggah data",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},"gxp.plugins.BingSource.prototype":{title:"Layers Bing",roadTitle:"Jalan Bing",aerialTitle:"Udara Bing",labeledAerialTitle:"Udara Bing dengan label"},"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",createFeatureActionTip:"Membuat sebuah fitur",editFeatureActionTip:"Edit fitur",commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:"},
"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"Tampilkan pada peta",firstPageTip:"Halaman pertama",previousPageTip:"Halaman sebelumnya",zoomPageExtentTip:"Zoom sampai batas halaman",nextPageTip:"Halaman berikut",lastPageTip:"Halaman terakhir",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{menuText:"3D Viewer",tooltip:"Switch to 3D Viewer"},"gxp.plugins.GoogleSource.prototype":{title:"Google Layers",roadmapAbstract:"Tampilkan peta jalan",satelliteAbstract:"Tampilkan citra satelit",
hybridAbstract:"Tampilkan citra dengan nama jalan",terrainAbstract:"Tampilkan peta jalan dengan peta medan"},"gxp.plugins.LayerProperties.prototype":{menuText:"Properti layer",toolTip:"Properti layer"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Layer-layer",rootNodeText:"Layer-layer",overlayNodeText:"Superimposisi",baseNodeText:"Layer dasar"},"gxp.plugins.LayerManager.prototype":{baseNodeText:"Layer dasar"},"gxp.plugins.Legend.prototype":{menuText:"Tampilkan legend",tooltip:"Tampilkan legend"},
"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"Loading Map..."},"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",
naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",worldPrintTitle:"World Print"},"gxp.plugins.Measure.prototype":{buttonText:"Pengukuran",lengthMenuText:"Panjang",areaMenuText:"Luas",lengthTooltip:"Pengukuran panjang",areaTooltip:"Pengukuran luas",measureTooltip:"Pengukuran"},"gxp.plugins.Navigation.prototype":{menuText:"Pan peta",tooltip:"Pan peta"},
"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Zoom ke luas sebelumnya",nextMenuText:"Zoom ke luas setelahnya",previousTooltip:"Zoom ke luas sebelumnya",nextTooltip:"Zoom ke luas setelahnya"},"gxp.plugins.OSMSource.prototype":{title:"OpenStreetMap Layers",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},"gxp.plugins.Print.prototype":{buttonText:"Cetak",
menuText:"Cetak peta",tooltip:"Cetak peta",previewText:"Preview cetak",notAllNotPrintableText:"Tidak semua layer dapat dicetak",nonePrintableText:"Tidak ada peta yang dapat dicetak"},"gxp.plugins.MapQuestSource.prototype":{title:"MapQuest Layers",osmAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
naipTitle:"Citra MapQuest"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Query",queryMenuText:"Queryable Layer",queryActionTip:"Query layer yang dipilih",queryByLocationText:"Query by current map extent",queryByAttributesText:"Query atribut",queryMsg:"Querying...",cancelButtonText:"Batal",noFeaturesTitle:"Tidak sesuai",noFeaturesMessage:"Permintaan anda tidak berhasil."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Hapus layer",removeActionTip:"Hapus layer"},"gxp.plugins.Styler.prototype":{menuText:"Edit Styles",
tooltip:"Manage layer styles"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"Get Feature Info",popupTitle:"Info fitur"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",zoomInMenuText:"Memperbesar",zoomOutMenuText:"Memperkecil",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"Memperbesar",zoomOutTooltip:"Memperkecil"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Pembesaran maksimum",tooltip:"Pembesaran maksimum"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Pembesaran batas layer",
tooltip:"Pembesaran batas layer"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Pembesaran batas layer",tooltip:"Pembesaran batas layer"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Pembesaran pada fitur terpilih",tooltip:"Pembesaran pada fitur terpilih"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"Simpan update?",closeMsg:"Fitur belum di simpan. Apakah ingin disimpan?",deleteMsgTitle:"Hapus Fitur?",deleteMsg:"Anda yakin untuk menghapus fitur ini?",editButtonText:"Edit",
editButtonTooltip:"Jadikan fitur dapat diedit",deleteButtonText:"Hapus",deleteButtonTooltip:"Hapus fitur ini",cancelButtonText:"Batal",cancelButtonTooltip:"Berhenti mengedit, batalkan perubahan",saveButtonText:"Simpan",saveButtonTooltip:"Simpan Update"},"gxp.FillSymbolizer.prototype":{fillText:"Isikan warna",colorText:"Warna",opacityText:"Kepekatan"},"gxp.FilterBuilder.prototype":{builderTypeNames:["any","all","none","not all"],preComboText:"Sesuai",postComboText:"of the following:",addConditionText:"tambahkan kondisi",
addGroupText:"tambahkan grup",removeConditionText:"Hilangkan kondisi"},"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Nama",titleHeaderText:"Judul",queryableHeaderText:"Queryable",layerSelectionLabel:"Melihat data dari:",layerAdditionLabel:"atau tambahkan sebagai server baru.",expanderTemplateText:"<p><b>Abstract:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"Lingkaran",graphicSquareText:"square",graphicTriangleText:"Segitiga",graphicStarText:"Bintang",graphicCrossText:"Silang",
graphicXText:"x",graphicExternalText:"dari luar",urlText:"URL",opacityText:"Kepekatan",symbolText:"Simbol",sizeText:"Ukuran",rotationText:"Rotasi"},"gxp.QueryPanel.prototype":{queryByLocationText:"Query lokasi",currentTextText:"Sejauh ini",queryByAttributesText:"Query atribut",layerText:"Layer"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} Scale 1:{scale}",labelFeaturesText:"Label Fitur",labelsText:"Labels",basicText:"Basic",advancedText:"Tingkat lanjut",limitByScaleText:"Batasan oleh skala",
limitByConditionText:"Batasan oleh kondisi",symbolText:"Simbol",nameText:"Nama"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} Scale 1:{scale}",minScaleLimitText:"Min scale limit",maxScaleLimitText:"Batas skala maksimum"},"gxp.StrokeSymbolizer.prototype":{solidStrokeName:"solid",dashStrokeName:"dash",dotStrokeName:"dot",titleText:"Stroke",styleText:"Style",colorText:"Color",widthText:"Width",opacityText:"Opacity"},"gxp.StylePropertiesDialog.prototype":{titleText:"General",nameFieldText:"Name",
titleFieldText:"Title",abstractFieldText:"Abstract"},"gxp.TextSymbolizer.prototype":{labelValuesText:"Label nilai",haloText:"Halo",sizeText:"Ukuran"},"gxp.WMSLayerPanel.prototype":{attributionText:"Attribution",aboutText:"Tentang Program",titleText:"Judul",nameText:"Nama",descriptionText:"Deskripsi",displayText:"Tampilan",opacityText:"Kecerahan",formatText:"Format",transparentText:"Transparent",cacheText:"Cache",cacheFieldText:"Menggunakan versi cached",stylesText:"Styles tersedia",infoFormatText:"Info format",
infoFormatEmptyText:"Select a format",displayOptionsText:"Display options",queryText:"Limit with filters",scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"Peta anda siap dipublikasikan melalui web! Cukup salin HTML berikut untuk meletakkan peta dalam situs web Anda:",
heightLabel:"Tinggi",widthLabel:"Lebar",mapSizeLabel:"Ukuran peta",miniSizeLabel:"Mini",smallSizeLabel:"Kecil",premiumSizeLabel:"Premium",largeSizeLabel:"Besar"},"gxp.WMSStylesDialog.prototype":{addStyleText:"Tambah",addStyleTip:"Tambah style baru",chooseStyleText:"Choose style",deleteStyleText:"Hilangkan",deleteStyleTip:"Hapus style yang dipilih",editStyleText:"Edit",editStyleTip:"Edit style yang dipilih",duplicateStyleText:"Duplikat",duplicateStyleTip:"Duplikat style yang dipilih",addRuleText:"Tambah",
addRuleTip:"Tambah Rule baru",newRuleText:"New Rule",deleteRuleText:"Hilangkan",deleteRuleTip:"Hapus Rule yang dipilih",editRuleText:"Edit",editRuleTip:"Edit ule yang dipilih",duplicateRuleText:"Duplikat",duplicateRuleTip:"Duplikat style yang dipilih",cancelText:"Batal",saveText:"Save",styleWindowTitle:"User Style: {0}",ruleWindowTitle:"Style Rule: {0}",stylesFieldsetTitle:"Styles",rulesFieldsetTitle:"Rules",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},"gxp.LayerUploadPanel.prototype":{titleLabel:"Judul",
titleEmptyText:"Judul Layer",abstractLabel:"Deskripsi",abstractEmptyText:"Deskripsi Layer",fileLabel:"Data",fieldEmptyText:"Pencarian arsip data...",uploadText:"Pengisian",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"Mengisi Data anda...",invalidFileExtensionText:"Ekstensi file harus salah satu: ",optionsText:"Pilihan",workspaceLabel:"Ruang Kerja",workspaceEmptyText:"Ruang kerja Default",dataStoreLabel:"Penyimpanan",dataStoreEmptyText:"Create new store",
defaultDataStoreEmptyText:"Penyimpanan data Default"},"gxp.NewSourceDialog.prototype":{title:"Add New Server...",cancelText:"Cancel",addServerText:"Add Server",invalidURLText:"Enter a valid URL to a WMS endpoint (e.g. http://example.com/geoserver/wms)",contactingServerText:"Contacting Server..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Zoom level"},"gxp.Viewer.prototype":{saveErrorText:"Trouble saving: "},"gxp.FeedSourceDialog.prototype":{feedTypeText:"Sumber",addPicasaText:"Picasa Foto",addYouTubeText:"YouTube Video",
addRSSText:"GeoRSS Pakan lain",addFeedText:"Tambah ke Peta",addTitleText:"Judul",keywordText:"Kata Kunci",doneText:"Selesai",titleText:"Tambah Blog",maxResultsText:"Produk Max"},"gxp.ClassificationPanel.prototype":{classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",rampOrangeText:"Orange",rampJetText:"Blue-Red",rampGrayText:"Gray",rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",colorEndText:"End Color",
colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",methodJenksText:"Jenks Natural Breaks",selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",reverseColorsText:"Reverse colors"}});
GeoExt.Lang.add("nl",{"gxp.plugins.AddLayers.prototype":{addActionMenuText:"Voeg kaartlagen toe",addActionTip:"Voeg kaartlagen toe",addServerText:"Voeg service toe",untitledText:"Onbekend",addLayerSourceErrorText:"Probleem bij het ophalen van de Error WMS GetCapabilities ({msg}).\nControleer de URL en probeer opnieuw.",availableLayersText:"Beschikbare kaartlagen",doneText:"Klaar",addFeedActionMenuText:"Add feeds",searchText:"Zoek naar kaartlagen"},"gxp.plugins.BingSource.prototype":{title:"Bing kaartlagen",
roadTitle:"Bing wegen",aerialTitle:"Bing luchtfoto's",labeledAerialTitle:"Bing luchtfoto's met labels"},"gxp.plugins.FeatureEditor.prototype":{createFeatureActionTip:"Maak een nieuw object",editFeatureActionTip:"Wijzig een bestand object",commitTitle:"Wijzingsbeschrijving",commitText:"Voor a.u.b. een beschrijving in voor de wijziging:"},"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"Toon op kaart",firstPageTip:"Eerste pagina",previousPageTip:"Vorige pagina",zoomPageExtentTip:"Zoom naar de uitsnede van de pagina",
nextPageTip:"Volgende pagina",lastPageTip:"Laatste pagina",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{menuText:"3D weergave",tooltip:"Bekijk kaart in 3D"},"gxp.plugins.GoogleSource.prototype":{title:"Google Maps kaartlagen",roadmapAbstract:"Toon stratenkaart",satelliteAbstract:"Toon satellietbeeld",hybridAbstract:"Toon rasterbeelden met labels",terrainAbstract:"Toon stratenkaart met terrein"},"gxp.plugins.LayerProperties.prototype":{menuText:"Kaartlaag eigenschappen",
toolTip:"Kaartlaag eigenschappen"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Kaartlagen",rootNodeText:"Kaartlagen",overlayNodeText:"Kaart overlays",baseNodeText:"Basis Kaarten"},"gxp.plugins.LayerManager.prototype":{baseNodeText:"Basis Kaart"},"gxp.plugins.Legend.prototype":{menuText:"Toon legenda",tooltip:"Toon legenda"},"gxp.plugins.LoadingIndicator.prototype":{loadingMapMessage:"Laden van de kaart..."},"gxp.plugins.MapBoxSource.prototype":{title:"MapBox Layers",blueMarbleTopoBathyJanTitle:"Blue Marble Topography & Bathymetry (January)",
blueMarbleTopoBathyJulTitle:"Blue Marble Topography & Bathymetry (July)",blueMarbleTopoJanTitle:"Blue Marble Topography (January)",blueMarbleTopoJulTitle:"Blue Marble Topography (July)",controlRoomTitle:"Control Room",geographyClassTitle:"Geography Class",naturalEarthHypsoTitle:"Natural Earth Hypsometric",naturalEarthHypsoBathyTitle:"Natural Earth Hypsometric & Bathymetry",naturalEarth1Title:"Natural Earth I",naturalEarth2Title:"Natural Earth II",worldDarkTitle:"World Dark",worldLightTitle:"World Light",
worldPrintTitle:"World Print"},"gxp.plugins.Measure.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",buttonText:"Meten",lengthMenuText:"Lengte",areaMenuText:"Oppervlakte",lengthTooltip:"Meet lengte",areaTooltip:"Meet oppervlakte",measureTooltip:"Meten"},"gxp.plugins.Navigation.prototype":{menuText:"Verschuif kaart",tooltip:"Verschuif kaart"},"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Zoom naar de vorige uitsnede",nextMenuText:"Zoom naar de volgende uitsnede",
previousTooltip:"Zoom naar de vorige uitsnede",nextTooltip:"Zoom naar de volgende uitsnede"},"gxp.plugins.OSMSource.prototype":{title:"OpenStreetMap kaartlagen",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},"gxp.plugins.Print.prototype":{buttonText:"Afdrukken",menuText:"Afdrukken kaart",tooltip:"Afdrukken kaart",previewText:"Voorvertoning",notAllNotPrintableText:"Niet alle lagen kunnen worden afgedrukt",
nonePrintableText:"Geen van de huidige lagen kunnen worden afgedrukt"},"gxp.plugins.MapQuestSource.prototype":{title:"MapQuest kaartlagen",osmAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
naipTitle:"MapQuest Rasterbeelden"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Bevraag",queryMenuText:"Bevraag kaartlaag",queryActionTip:"Bevraag de geselecteerde kaartlaag",queryByLocationText:"Query by current map extent",queryByAttributesText:"Bevraag middels attributen",queryMsg:"Bevragen...",cancelButtonText:"Annuleren",noFeaturesTitle:"Niks gevonden",noFeaturesMessage:"De bevraging heeft geen resultaten opgeleverd."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Verwijder kaartlaag",
removeActionTip:"Verwijder kaartlaag"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"Attribuut-informatie",popupTitle:"Attribuut-informatie"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",zoomInMenuText:"Inzoomen",zoomOutMenuText:"Uitzoomen",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"Inzoomen",zoomOutTooltip:"Uitzoomen"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Zoom naar de maximale uitsnede",tooltip:"Zoom naar de maximale uitsnede"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Zoom naar de uitsnede van de kaartlaag",
tooltip:"Zoom naar de uitsnede van de kaartlaag"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Zoom naar de uitsnede van de kaartlaag",tooltip:"Zoom naar de uitsnede van de kaartlaag"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Zoom naar de geselecteerde objecten",tooltip:"Zoom naar de geselecteerde objecten"},"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"Wijzigingen opslaan?",closeMsg:"Het object is gewijzigd. Wilt u de wijzigingen opslaan?",deleteMsgTitle:"Verwijder object?",
deleteMsg:"Weet u zeker dat u dit object wilt verwijderen?",editButtonText:"Wijzigen",editButtonTooltip:"Wijzig dit object",deleteButtonText:"Verwijderen",deleteButtonTooltip:"Verwijder dit object",cancelButtonText:"Annuleren",cancelButtonTooltip:"Stop met wijzigen, wijzigingen worden ongedaan gemaakt",saveButtonText:"Opslaan",saveButtonTooltip:"Wijzigingen opslaan"},"gxp.FillSymbolizer.prototype":{fillText:"Opvulling",colorText:"Kleur",opacityText:"Opaciteit"},"gxp.FilterBuilder.prototype":{builderTypeNames:["om het even welk",
"alle","geen","niet alle"],preComboText:"Overeenkomst",postComboText:"van de volgende:",addConditionText:"voeg voorwaarde toe",addGroupText:"voeg groep toe",removeConditionText:"verwijder voorwaarde"},"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Naam",titleHeaderText:"Titel",queryableHeaderText:"Bevraagbaar",layerSelectionLabel:"Bekijk beschikbare data van:",layerAdditionLabel:"of voeg een nieuwe server toe.",expanderTemplateText:"<p><b>Samenvatting:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"cirkel",
graphicSquareText:"vierkant",graphicTriangleText:"driehoek",graphicStarText:"ster",graphicCrossText:"kruis",graphicXText:"x",graphicExternalText:"extern",urlText:"URL",opacityText:"opaciteit",symbolText:"Symbool",sizeText:"Grootte",rotationText:"Rotatie"},"gxp.QueryPanel.prototype":{queryByLocationText:"Bevraag middels locatie",currentTextText:"Huidige uitsnede",queryByAttributesText:"Bevraag middels attributen",layerText:"Kaartlaag"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} Schaal 1:{scale}",
labelFeaturesText:"Label objecten",advancedText:"Geavanceerd",limitByScaleText:"Beperk middels schaal",limitByConditionText:"Beperk middels voorwaarde",symbolText:"Symbool",nameText:"Naam"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} Schaal 1:{scale}",maxScaleLimitText:"Maximale schaal"},"gxp.TextSymbolizer.prototype":{labelValuesText:"Label waardes",haloText:"Halo",sizeText:"Grootte"},"gxp.WMSLayerPanel.prototype":{attributionText:"Bronvermelding",aboutText:"Informatie",titleText:"Titel",
nameText:"Naam",descriptionText:"Omschrijving",displayText:"Toon",opacityText:"Opaciteit",formatText:"Formaat",transparentText:"Transparant",cacheText:"Cache",cacheFieldText:"Gebruik de versie vanuit de cache",stylesText:"Beschikbare Stijlen",infoFormatText:"Info formaat",infoFormatEmptyText:"Selecteer een formaat",displayOptionsText:"Weergave opties",queryText:"Begrens d.m.v. query",scaleText:"Bregens d.m.v. schaal",minScaleText:"Minimum schaal",maxScaleText:"Maximum schaal",switchToFilterBuilderText:"Terug naar de querybuilder",
cqlPrefixText:"of ",cqlText:"gebruik een CQL filter",singleTileText:"Enkele kaarttegel",singleTileFieldText:"Gebruik 1 kaarttegel"},"gxp.EmbedMapDialog.prototype":{publishMessage:"Uw map is klaar voor publicatie! Kopieer de volgende HTML in uw website om de kaart in te voegen:",heightLabel:"Hoogte",widthLabel:"Breedte",mapSizeLabel:"Kaartgrootte",miniSizeLabel:"Mini",smallSizeLabel:"Klein",premiumSizeLabel:"Extra groot",largeSizeLabel:"Groot"},"gxp.WMSStylesDialog.prototype":{addStyleText:"Voeg toe",
addStyleTip:"Voeg een nieuwe stijl toe",deleteStyleText:"Verwijder",deleteStyleTip:"Verwijder de geselecteerde stijl",editStyleText:"Wijzig",editStyleTip:"Wijzig de geselecteerde stijl",duplicateStyleText:"Dupliceer",duplicateStyleTip:"Dupliceer de geselecteerde stijl",addRuleText:"Voeg toe",addRuleTip:"Voeg een nieuwe klasse toe",deleteRuleText:"Verwijder",deleteRuleTip:"Verwijder de geselecteerde klasse",editRuleText:"Wijzig",editRuleTip:"Wijzig de geselecteerde klasse",duplicateRuleText:"Dupliceer",
duplicateRuleTip:"Dupliceer de geselecteerde klasse",cancelText:"Annuleer",styleWindowTitle:"Kaartstijl: {0}",ruleWindowTitle:"Klasse: {0}",stylesFieldsetTitle:"Kaartstijlen",rulesFieldsetTitle:"Klassen",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},"gxp.LayerUploadPanel.prototype":{titleLabel:"Titel",titleEmptyText:"Kaartlaag titel",abstractLabel:"Omschrijving",abstractEmptyText:"Kaartlaag omschrijving",fileLabel:"Data",fieldEmptyText:"Kies data archief...",
uploadText:"Upload",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",waitMsgText:"Bezig met uploaden van de data...",invalidFileExtensionText:"Bestandsextensie is een van: ",optionsText:"Opties",workspaceLabel:"Werkruimte",workspaceEmptyText:"Standaard werkruimte",dataStoreLabel:"Archief",dataStoreEmptyText:"Create new store",defaultDataStoreEmptyText:"Standaard archief"},"gxp.NewSourceDialog.prototype":{title:"Add New Server...",cancelText:"Cancel",addServerText:"Add Server",
invalidURLText:"Enter a valid URL to a WMS endpoint (e.g. http://example.com/geoserver/wms)",contactingServerText:"Contacting Server..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Zoom niveau"},"gxp.Viewer.prototype":{saveErrorText:"Problemen bij het opslaan: "},"gxp.FeedSourceDialog.prototype":{feedTypeText:"Bron",addPicasaText:"Picasa Foto's",addYouTubeText:"YouTube video's",addRSSText:"Andere GeoRSS Feed",addFeedText:"Voeg toe aan Map",addTitleText:"Titel",keywordText:"Trefwoord",doneText:"Klaar",
titleText:"Voeg Feeds",maxResultsText:"Max Items"},"gxp.ClassificationPanel.prototype":{classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",rampOrangeText:"Orange",rampJetText:"Blue-Red",rampGrayText:"Gray",rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",colorEndText:"End Color",colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",
methodJenksText:"Jenks Natural Breaks",selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",reverseColorsText:"Reverse colors"}});
GeoExt.Lang.add("pl",{"gxp.menu.LayerMenu.prototype":{layerText:"Warstwa"},"gxp.plugins.AddLayers.prototype":{addMenuText:"Dodaj warstwy",addActionTip:"Dodaj warstwy",addServerText:"Dodaj serwer",addButtonText:"Dodaj warstwy",untitledText:"Bez tytu\u0142u",addLayerSourceErrorText:"B\u0142\u0105d w czasie pobierania parametr\u00f3w serwera WMS ({msg}).\nProsz\u0119 sprawdzi\u0107 adres.",availableLayersText:"Dost\u0119pne warstwy",expanderTemplateText:"<p><b>Opis:</b> {abstract}</p>",panelTitleText:"Tytu\u0142",
layerSelectionText:"Poka\u017c dost\u0119pne warstwy z:",doneText:"Gotowe",uploadText:"Wy\u015blij dane",addFeedActionMenuText:"Add feeds",searchText:"Search for layers"},"gxp.plugins.BingSource.prototype":{title:"Bing Maps",roadTitle:"Bing - drogi",aerialTitle:"Bing - ortofoto",labeledAerialTitle:"Bing - ortofoto z etykietami"},"gxp.plugins.FeatureEditor.prototype":{splitButtonText:"Edit",createFeatureActionText:"Create",editFeatureActionText:"Modify",createFeatureActionTip:"Utw\u00f3rz nowy obiekt",
editFeatureActionTip:"Edytuj istniej\u0105cy obiekt",commitTitle:"Commit message",commitText:"Please enter a commit message for this edit:"},"gxp.plugins.FeatureGrid.prototype":{displayFeatureText:"Poka\u017c na mapie",firstPageTip:"Pierwsza strona",previousPageTip:"Poprzednia strona",zoomPageExtentTip:"Powi\u0119ksz do zasi\u0119gu strony",nextPageTip:"Nast\u0119pna strona",lastPageTip:"Ostatnia strona",totalMsg:"Features {1} to {2} of {0}"},"gxp.plugins.GoogleEarth.prototype":{menuText:"Przegl\u0105darka 3D",
tooltip:"Prze\u0142\u0105cz do widoku 3D"},"gxp.plugins.GoogleSource.prototype":{title:"Google Maps",roadmapAbstract:"Mapa drogowa",satelliteAbstract:"Zdj\u0119cia satelitarne",hybridAbstract:"Zdj\u0119cia satelitarne z etykietami",terrainAbstract:"Mapa terenowa z etykietami"},"gxp.plugins.LayerProperties.prototype":{menuText:"W\u0142a\u015bciwo\u015bci",toolTip:"W\u0142a\u015bciwo\u015bci"},"gxp.plugins.LayerTree.prototype":{shortTitle:"Mapa",rootNodeText:"Mapa",overlayNodeText:"Warstwy",baseNodeText:"Mapa referencyjna"},
"gxp.plugins.LayerManager.prototype":{baseNodeText:"Mapa referencyjna"},"gxp.plugins.Legend.prototype":{menuText:"Legenda mapy",tooltip:"Legenda mapy"},"gxp.plugins.Measure.prototype":{buttonText:"Pomiary",lengthMenuText:"D\u0142ugo\u015b\u0107",areaMenuText:"Powierzchnia",lengthTooltip:"Pomiar odleg\u0142o\u015bci",areaTooltip:"Pomiar powierzchni",measureTooltip:"Pomiary"},"gxp.plugins.Navigation.prototype":{menuText:"Przesu\u0144 map\u0119",tooltip:"Przesu\u0144 map\u0119"},"gxp.plugins.NavigationHistory.prototype":{previousMenuText:"Poprzedni widok",
nextMenuText:"Kolejny widok",previousTooltip:"Poprzedni widok",nextTooltip:"Kolejny widok"},"gxp.plugins.OSMSource.prototype":{title:"OpenStreetMap",mapnikAttribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",osmarenderAttribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>"},"gxp.plugins.Print.prototype":{buttonText:"Drukuj",menuText:"Drukuj",tooltip:"Drukuj",previewText:"Podgl\u0105d wydruku",notAllNotPrintableText:"Nie wszystkie warstwy mog\u0105 by\u0107 wydrukowane",
nonePrintableText:"\u017badna z warstw nie mo\u017ce byc wydrukowana"},"gxp.plugins.MapQuestSource.prototype":{title:"MapQuest",osmAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",osmTitle:"MapQuest OpenStreetMap",naipAttribution:"Tiles Courtesy of <a href='http://open.mapquest.co.uk/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png' border='0'>",
naipTitle:"MapQuest Imagery"},"gxp.plugins.QueryForm.prototype":{queryActionText:"Wyszukaj",queryMenuText:"Przeszukaj warstw\u0119",queryActionTip:"Przeszukaj zaznaczon\u0105 warstw\u0119",queryByLocationText:"Query by current map extent",queryByAttributesText:"Przeszukaj po atrybutach",queryMsg:"Przeszukiwanie...",cancelButtonText:"Anuluj",noFeaturesTitle:"Brak danych",noFeaturesMessage:"Przeszukanie nie zwr\u00f3ci\u0142o \u017cadnych danych."},"gxp.plugins.RemoveLayer.prototype":{removeMenuText:"Usu\u0144 warstw\u0119",
removeActionTip:"Usu\u0144 warstw\u0119"},"gxp.plugins.Styler.prototype":{menuText:"Eycja styli",tooltip:"Zarz\u0105dzanie stylami warstwy"},"gxp.plugins.WMSGetFeatureInfo.prototype":{buttonText:"Identify",infoActionTip:"Info o obiekcie",popupTitle:"Info o obiekcie"},"gxp.plugins.Zoom.prototype":{zoomMenuText:"Zoom Box",zoomInMenuText:"Powi\u0119ksz",zoomOutMenuText:"Pomniejsz",zoomTooltip:"Zoom by dragging a box",zoomInTooltip:"Powi\u0119ksz",zoomOutTooltip:"Pomniejsz"},"gxp.plugins.ZoomToExtent.prototype":{menuText:"Ca\u0142a mapa",
tooltip:"Ca\u0142a mapa"},"gxp.plugins.ZoomToDataExtent.prototype":{menuText:"Powi\u0119ksz do zasi\u0119gu ca\u0142ej warstwy",tooltip:"Powi\u0119ksz do zasi\u0119gu ca\u0142ej warstwy"},"gxp.plugins.ZoomToLayerExtent.prototype":{menuText:"Powi\u0119ksz do zasi\u0119gu ca\u0142ej warstwy",tooltip:"Powi\u0119ksz do zasi\u0119gu ca\u0142ej warstwy"},"gxp.plugins.ZoomToSelectedFeatures.prototype":{menuText:"Powi\u0119ksz do wybranych obiekt\u00f3w",tooltip:"Powi\u0119ksz do wybranych obiekt\u00f3w"},
"gxp.FeatureEditPopup.prototype":{closeMsgTitle:"Zapisa\u0107 zmiany?",closeMsg:"Istniej\u0105 nie zapisane zmiany. Chcesz je zapisa\u0107?",deleteMsgTitle:"Usun\u0105\u0107 obiekt?",deleteMsg:"Jeste\u015b pewien \u017ce chcesz usun\u0105\u0107 ten obiekt?",editButtonText:"Edytuj",editButtonTooltip:"Edytuj ten obiekt",deleteButtonText:"Usu\u0144",deleteButtonTooltip:"Usu\u0144 ten obiekt",cancelButtonText:"Anuluj",cancelButtonTooltip:"Anuluj edycj\u0119 i nie zapisuj zmian",saveButtonText:"Zapisz",
saveButtonTooltip:"Zapisz zmiany"},"gxp.FillSymbolizer.prototype":{fillText:"Wype\u0142nienie",colorText:"Kolor",opacityText:"Prze\u015bwit"},"gxp.FilterBuilder.prototype":{builderTypeNames:["dowolny","wszystkie","\u017caden","odwrotno\u015b\u0107"],preComboText:"Dopasuj",postComboText:"sposr\u00f3d:",addConditionText:"dodaj warunek",addGroupText:"dodaj grup\u0119",removeConditionText:"usu\u0144 warunek"},"gxp.grid.CapabilitiesGrid.prototype":{nameHeaderText:"Nazwa",titleHeaderText:"Tytu\u0142",queryableHeaderText:"Przeszukiwalna",
layerSelectionLabel:"Zobacz dost\u0119pne dane z:",layerAdditionLabel:"lub dodaj serwer.",expanderTemplateText:"<p><b>Opis:</b> {abstract}</p>"},"gxp.PointSymbolizer.prototype":{graphicCircleText:"ko\u0142o",graphicSquareText:"kwadrat",graphicTriangleText:"tr\u00f3jk\u0105t",graphicStarText:"gwiazda",graphicCrossText:"krzy\u017c",graphicXText:"x",graphicExternalText:"inny",urlText:"URL",opacityText:"Prze\u015bwit",symbolText:"Symbol",sizeText:"Rozmiar",rotationText:"Obr\u00f3t"},"gxp.QueryPanel.prototype":{queryByLocationText:"Zapytanie przestrzenne",
currentTextText:"Aktualne powi\u0119kszenie",queryByAttributesText:"Zapytanie atrybutowe",layerText:"Warstwa"},"gxp.RulePanel.prototype":{scaleSliderTemplate:"{scaleType} Skala 1:{scale}",labelFeaturesText:"Etykiety obiekt\u00f3w",labelsText:"Etykiety",basicText:"Podstawowa",advancedText:"Zaawansowana",limitByScaleText:"Ograniczenie skalowe",limitByConditionText:"Ograniczenie warunkowe",symbolText:"Symbol",nameText:"Nazwa"},"gxp.ScaleLimitPanel.prototype":{scaleSliderTemplate:"{scaleType} Skala 1:{scale}",
minScaleLimitText:"Skala min.",maxScaleLimitText:"Skala max"},"gxp.StrokeSymbolizer.prototype":{solidStrokeName:"ci\u0105g\u0142y",dashStrokeName:"kreskowany",dotStrokeName:"kropkowany",titleText:"Obrys",styleText:"Styl",colorText:"Kolor",widthText:"Grubo\u015b\u0107",opacityText:"Prze\u015bwit"},"gxp.StylePropertiesDialog.prototype":{titleText:"Og\u00f3lny",nameFieldText:"Nazwa",titleFieldText:"Tytu\u0142",abstractFieldText:"Opis"},"gxp.TextSymbolizer.prototype":{labelValuesText:"Warto\u015bci etykiet",
haloText:"Efekt Halo",sizeText:"Rozmiar"},"gxp.WMSLayerPanel.prototype":{attributionText:"Attribution",aboutText:"O",titleText:"Tytu\u0142",nameText:"Nazwa",descriptionText:"Opis",displayText:"Wy\u015bwietlanie",opacityText:"Prze\u015bwit",formatText:"Format",transparentText:"Prze\u017ar.",cacheText:"Cache",cacheFieldText:"U\u017cyj wersji cache",stylesText:"Dost\u0119pne Style",infoFormatText:"Info format",infoFormatEmptyText:"Select a format",displayOptionsText:"Display options",queryText:"Limit with filters",
scaleText:"Limit by scale",minScaleText:"Min scale",maxScaleText:"Max scale",switchToFilterBuilderText:"Switch back to filter builder",cqlPrefixText:"or ",cqlText:"use CQL filter instead",singleTileText:"Single tile",singleTileFieldText:"Use a single tile"},"gxp.EmbedMapDialog.prototype":{publishMessage:"Twoja mapa jest gotowa do publikacji! Po prostu wklej poni\u017cszy kod na swojej witrynie:",heightLabel:"Wysoko\u015b\u0107",widthLabel:"Szeroko\u015b\u0107",mapSizeLabel:"Rozmiar mapy",miniSizeLabel:"Mini",
smallSizeLabel:"Ma\u0142y",premiumSizeLabel:"\u015aredni",largeSizeLabel:"Du\u017cy"},"gxp.WMSStylesDialog.prototype":{addStyleText:"Dodaj",addStyleTip:"Dodaj nowy styl",chooseStyleText:"Wybierz styl",deleteStyleText:"Usu\u0144",deleteStyleTip:"Usu\u0144 styl",editStyleText:"Edytuj",editStyleTip:"Edytuj wybrany styl",duplicateStyleText:"Stw\u00f3rz kopi\u0119",duplicateStyleTip:"Stw\u00f3rz kopi\u0119 wybranego stylu",addRuleText:"Dodaj",addRuleTip:"Dodaj now\u0105 regu\u0142\u0119",newRuleText:"Nowa regu\u0142a",
deleteRuleText:"Usu\u0144",deleteRuleTip:"Usu\u0144 wybran\u0105 regu\u0142\u0119",editRuleText:"Edytuj",editRuleTip:"Edytuj wybran\u0105 regu\u0142\u0119",duplicateRuleText:"Stw\u00f3rz kopi\u0119",duplicateRuleTip:"Skopiuj wybran\u0105 regu\u0142\u0119",cancelText:"Anuluj",saveText:"Zapisz",styleWindowTitle:"Styl u\u017cytkownika: {0}",ruleWindowTitle:"Regu\u0142a stylu: {0}",stylesFieldsetTitle:"Style",rulesFieldsetTitle:"Regu\u0142y",classifyStyleText:"Classify",classifyStyleTip:"Classify the layer based on attributes"},
"gxp.LayerUploadPanel.prototype":{titleLabel:"Tytu\u0142",titleEmptyText:"Tytu\u0142 warstwy",abstractLabel:"Opis",abstractEmptyText:"Opis warstwy",fileLabel:"Dane",fieldEmptyText:"Wska\u017c lokalizacj\u0119 danych...",uploadText:"Prze\u015blij",uploadFailedText:"Upload failed",processingUploadText:"Processing upload...",importText:"Importing upload...",waitMsgText:"Przesy\u0142anie danych...",invalidFileExtensionText:"Typ pliku musi by\u0107 jednym z poni\u017cszych: ",optionsText:"Opcje",workspaceLabel:"Obszar roboczy",
workspaceEmptyText:"Domy\u015blny obszar roboczy",dataStoreLabel:"Magazyn danych",dataStoreEmptyText:"Create new store",defaultDataStoreEmptyText:"Domy\u015blny magazyn danych"},"gxp.NewSourceDialog.prototype":{title:"Dodaj serwer...",cancelText:"Anuluj",addServerText:"Dodaj serwer",invalidURLText:"Podaj prawid\u0142owy adres URL us\u0142ugi WMS (n.p. http://example.com/geoserver/wms)",contactingServerText:"\u0141\u0105czenie z serwerem..."},"gxp.ScaleOverlay.prototype":{zoomLevelText:"Poziom powi\u0119kszenia"},
"gxp.Viewer.prototype":{saveErrorText:"Trouble saving: "},"gxp.FeedSourceDialog.prototype":{feedTypeText:"\u0179r\u00f3d\u0142o",addPicasaText:"Picasa zdj\u0119cia",addYouTubeText:"YouTube Videos",addRSSText:"Inne GeoRSS",addFeedText:"Dodaj do mapy",addTitleText:"Tytu\u0142",keywordText:"S\u0142owo",doneText:"Gotowe",titleText:"Dodaj kana\u0142y",maxResultsText:"Rzeczy Max"},"gxp.ClassificationPanel.prototype":{classNumberText:"Classes",classifyText:"Classify",rampBlueText:"Blue",rampRedText:"Red",
rampOrangeText:"Orange",rampJetText:"Blue-Red",rampGrayText:"Gray",rampRandomText:"Random",rampCustomText:"Custom",selectColorText:"Select colors",colorStartText:"Start Color",colorEndText:"End Color",colorRampText:"Color Ramp",methodText:"Method",methodUniqueText:"Unique Values",methodQuantileText:"Quantile",methodEqualText:"Equal Intervals",methodJenksText:"Jenks Natural Breaks",selectMethodText:"Select method",standardDeviationText:"Standard Deviations",attributeText:"Attribute",selectAttributeText:"Select attribute",
startColor:"#FEE5D9",endColor:"#A50F15",generateRulesText:"Apply",reverseColorsText:"Reverse colors"}});