webpackJsonp([26],{

/***/ 126:
/***/ function(module, exports, __webpack_require__) {

	__webpack_require__(6)(__webpack_require__(644))

/***/ },

/***/ 127:
/***/ function(module, exports, __webpack_require__) {

	__webpack_require__(6)(__webpack_require__(645))

/***/ },

/***/ 644:
/***/ function(module, exports) {

	module.exports = "Ext.namespace(\"GeoExt.tree\"),GeoExt.tree.LayerContainer=Ext.extend(Ext.tree.AsyncTreeNode,{constructor:function(e){e=Ext.applyIf(e||{},{text:\"Layers\"}),this.loader=e.loader instanceof GeoExt.tree.LayerLoader?e.loader:new GeoExt.tree.LayerLoader(Ext.applyIf(e.loader||{},{store:e.layerStore})),GeoExt.tree.LayerContainer.superclass.constructor.call(this,e)},recordIndexToNodeIndex:function(e){for(var t=this.loader.store,a=t.getCount(),i=this.childNodes.length,r=-1,s=a-1;s>=0&&!(this.loader.filter(t.getAt(s))===!0&&(++r,e===s||r>i-1));--s);return r},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.BaseLayerContainer=Ext.extend(GeoExt.tree.LayerContainer,{constructor:function(e){e=Ext.applyIf(e||{},{text:\"Base Layer\",loader:{}}),e.loader=Ext.applyIf(e.loader,{baseAttrs:Ext.applyIf(e.loader.baseAttrs||{},{iconCls:\"gx-tree-baselayer-icon\",checkedGroup:\"baselayer\"}),filter:function(e){var t=e.get(\"layer\");return t.displayInLayerSwitcher===!0&&t.isBaseLayer===!0}}),GeoExt.tree.BaseLayerContainer.superclass.constructor.call(this,e)}}),Ext.tree.TreePanel.nodeTypes.gx_baselayercontainer=GeoExt.tree.BaseLayerContainer,Ext.namespace(\"GeoExt.tree\"),GeoExt.tree.LayerParamLoader=function(e){Ext.apply(this,e),this.addEvents(\"beforeload\",\"load\"),GeoExt.tree.LayerLoader.superclass.constructor.call(this)},Ext.extend(GeoExt.tree.LayerParamLoader,Ext.util.Observable,{param:null,delimiter:\",\",load:function(e,t){if(this.fireEvent(\"beforeload\",this,e)){for(;e.firstChild;)e.removeChild(e.firstChild);var a=e.layer instanceof OpenLayers.Layer.HTTPRequest&&e.layer.params[this.param];if(a){var i=a instanceof Array?a:a.split(this.delimiter);Ext.each(i,function(t){this.addParamNode(t,e)},this)}\"function\"==typeof t&&t(),this.fireEvent(\"load\",this,e)}},addParamNode:function(e,t){var a=this.createNode({layer:t.layer,param:this.param,item:e,delimiter:this.delimiter}),i=t.item(0);i?t.insertBefore(a,i):t.appendChild(a)},createNode:function(attr){return this.baseAttrs&&Ext.apply(attr,this.baseAttrs),\"string\"==typeof attr.uiProvider&&(attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)),attr.nodeType=attr.nodeType||\"gx_layerparam\",new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)}}),Ext.namespace(\"GeoExt\"),GeoExt.SliderTip=Ext.extend(Ext.Tip,{hover:!0,minWidth:10,minWidth:10,offsets:[0,-10],dragging:!1,init:function(e){e.on({dragstart:this.onSlide,drag:this.onSlide,dragend:this.hide,destroy:this.destroy,scope:this}),this.hover&&e.on(\"render\",this.registerThumbListeners,this),this.slider=e},registerThumbListeners:function(){this.slider.thumb.on({mouseover:function(){this.onSlide(this.slider),this.dragging=!1},mouseout:function(){this.dragging||this.hide.apply(this,arguments)},scope:this})},onSlide:function(e){this.dragging=!0,this.show(),this.body.update(this.getText(e)),this.doAutoWidth(),this.el.alignTo(e.thumb,\"b-t?\",this.offsets)},getText:function(e){return e.getValue()}}),Ext.namespace(\"GeoExt\"),GeoExt.ZoomSlider=Ext.extend(Ext.Slider,{map:null,baseCls:\"gx-zoomslider\",aggressive:!1,updating:!1,initComponent:function(){GeoExt.ZoomSlider.superclass.initComponent.call(this),this.map&&(this.map instanceof GeoExt.MapPanel&&(this.map=this.map.map),this.bind(this.map)),this.aggressive===!0?this.on(\"change\",this.changeHandler,this):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.superclass.afterRender.apply(this,arguments),this.update()},addToMapPanel:function(e){this.events.afterrender||this.on({render:function(){window.setTimeout(this.bind.createDelegate(this,[e.map]),0)},scope:this}),this.on({render:function(){var t=this.getEl();t.setStyle({position:\"absolute\",zIndex:e.map.Z_INDEX_BASE.Control}),t.on({mousedown:this.stopMouseEvents,click:this.stopMouseEvents})},afterrender:function(){this.bind(e.map)},scope:this})},stopMouseEvents:function(e){e.stopEvent()},removeFromMapPanel:function(e){var t=this.getEl();t.un(\"mousedown\",this.stopMouseEvents,this),t.un(\"click\",this.stopMouseEvents,this),this.unbind()},bind:function(e){this.map=e,this.map.events.on({zoomend:this.update,changebaselayer:this.initZoomValues,scope:this}),this.map.baseLayer&&(this.initZoomValues(),this.update())},unbind:function(){this.map&&this.map.events.un({zoomend:this.update,changebaselayer:this.initZoomValues,scope:this})},initZoomValues:function(){var e=this.map.baseLayer;void 0===this.initialConfig.minValue&&(this.minValue=e.minZoomLevel||0),void 0===this.initialConfig.maxValue&&(this.maxValue=e.maxZoomLevel||e.numZoomLevels-1)},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(){this.rendered&&this.map&&(this.updating=!0,this.setValue(this.map.getZoom()),this.updating=!1)}}),Ext.reg(\"gx_zoomslider\",GeoExt.ZoomSlider),Ext.namespace(\"GeoExt.data\"),GeoExt.data.WMSCapabilitiesReader=function(e,t){e=e||{},e.format||(e.format=new OpenLayers.Format.WMSCapabilities),\"function\"!=typeof t&&(t=GeoExt.data.LayerRecord.create(t||e.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\"}])),GeoExt.data.WMSCapabilitiesReader.superclass.constructor.call(this,e,t)},Ext.extend(GeoExt.data.WMSCapabilitiesReader,Ext.data.DataReader,{attributionCls:\"gx-attribution\",read:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),this.readRecords(t)},serviceExceptionFormat:function(e){return OpenLayers.Util.indexOf(e,\"application/vnd.ogc.se_inimage\")>-1?\"application/vnd.ogc.se_inimage\":OpenLayers.Util.indexOf(e,\"application/vnd.ogc.se_xml\")>-1?\"application/vnd.ogc.se_xml\":e[0]},imageFormat:function(e){var t=e.formats;return e.opaque&&OpenLayers.Util.indexOf(t,\"image/jpeg\")>-1?\"image/jpeg\":OpenLayers.Util.indexOf(t,\"image/png\")>-1?\"image/png\":OpenLayers.Util.indexOf(t,\"image/png; mode=24bit\")>-1?\"image/png; mode=24bit\":OpenLayers.Util.indexOf(t,\"image/gif\")>-1?\"image/gif\":t[0]},imageTransparent:function(e){return void 0==e.opaque||!e.opaque},readRecords:function(e){(\"string\"==typeof e||e.nodeType)&&(e=this.meta.format.read(e));var t=e.version,a=e.capability||{},i=a.request&&a.request.getmap&&a.request.getmap.href,r=a.layers,s=a.exception?a.exception.formats:[],n=this.serviceExceptionFormat(s),o=[];if(i&&r)for(var l,d,h,c,p,u=this.recordType.prototype.fields,y=0,m=r.length;y<m;y++)if(l=r[y],l.name){d={};for(var f=0,g=u.length;f<g;f++)c=u.items[f],p=l[c.mapping||c.name]||c.defaultValue,p=c.convert(p),d[c.name]=p;h={attribution:l.attribution?this.attributionMarkup(l.attribution):void 0,minScale:l.minScale,maxScale:l.maxScale},this.meta.layerOptions&&Ext.apply(h,this.meta.layerOptions),d.layer=new OpenLayers.Layer.WMS(l.title||l.name,i,{layers:l.name,exceptions:n,format:this.imageFormat(l),transparent:this.imageTransparent(l),version:t},h),o.push(new this.recordType(d,d.layer.id))}return{totalRecords:o.length,success:!0,records:o}},attributionMarkup:function(e){var t=[];if(e.logo&&t.push(\"<img class='\"+this.attributionCls+\"-image' src='\"+e.logo.href+\"' />\"),e.title&&t.push(\"<span class='\"+this.attributionCls+\"-title'>\"+e.title+\"</span>\"),e.href)for(var a=0;a<t.length;a++)t[a]=\"<a class='\"+this.attributionCls+\"-link' href=\"+e.href+\">\"+t[a]+\"</a>\";return t.join(\" \")}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.LayerStoreMixin=function(){return{map:null,reader:null,constructor:function(e){e=e||{},e.reader=e.reader||new GeoExt.data.LayerReader({},e.fields),delete e.fields;var t=e.map instanceof GeoExt.MapPanel?e.map.map:e.map;delete e.map,e.layers&&(e.data=e.layers),delete e.layers;var a={initDir:e.initDir};delete e.initDir,arguments.callee.superclass.constructor.call(this,e),t&&this.bind(t,a)},bind:function(e,t){if(!this.map){this.map=e,t=t||{};var a=t.initDir;void 0==t.initDir&&(a=GeoExt.data.LayerStore.MAP_TO_STORE|GeoExt.data.LayerStore.STORE_TO_MAP);var i=e.layers.slice(0);a&GeoExt.data.LayerStore.STORE_TO_MAP&&this.each(function(e){this.map.addLayer(e.get(\"layer\"))},this),a&GeoExt.data.LayerStore.MAP_TO_STORE&&this.loadData(i,!0),e.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})}},unbind:function(){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(e){var t=e.layer,a=this.findBy(function(e,a){return e.get(\"layer\")===t});if(a>-1){var i=this.getAt(a);if(\"order\"===e.property){if(!this._adding&&!this._removing){var r=this.map.getLayerIndex(t);r!==a&&(this._removing=!0,this.remove(i),delete this._removing,this._adding=!0,this.insert(r,[i]),delete this._adding)}}else\"name\"===e.property?i.set(\"title\",t.name):this.fireEvent(\"update\",this,i,Ext.data.Record.EDIT)}},onAddLayer:function(e){if(!this._adding){var t=e.layer;this._adding=!0,this.loadData([t],!0),delete this._adding}},onRemoveLayer:function(e){if(this.map.unloadDestroy){if(!this._removing){var t=e.layer;this._removing=!0,this.remove(this.getById(t.id)),delete this._removing}}else this.unbind()},onLoad:function(e,t,a){if(Ext.isArray(t)||(t=[t]),a&&!a.add){this._removing=!0;for(var i=this.map.layers.length-1;i>=0;i--)this.map.removeLayer(this.map.layers[i]);delete this._removing;var r=t.length;if(r>0){for(var s=new Array(r),n=0;n<r;n++)s[n]=t[n].get(\"layer\");this._adding=!0,this.map.addLayers(s),delete this._adding}}},onClear:function(e){this._removing=!0;for(var t=this.map.layers.length-1;t>=0;t--)this.map.removeLayer(this.map.layers[t]);delete this._removing},onAdd:function(e,t,a){if(!this._adding){this._adding=!0;for(var i,r=t.length-1;r>=0;--r)i=t[r].get(\"layer\"),this.map.addLayer(i),a!==this.map.layers.length-1&&this.map.setLayerIndex(i,a);delete this._adding}},onRemove:function(e,t,a){if(!this._removing){var i=t.get(\"layer\");null!=this.map.getLayer(i.id)&&(this._removing=!0,this.removeMapLayer(t),delete this._removing)}},onUpdate:function(e,t,a){if(a===Ext.data.Record.EDIT){var i=t.get(\"layer\"),r=t.get(\"title\");r!==i.name&&i.setName(r)}},removeMapLayer:function(e){this.map.removeLayer(e.get(\"layer\"))},onReplace:function(e,t,a){this.removeMapLayer(t)},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.tree\"),GeoExt.tree.LayerLoader=function(e){Ext.apply(this,e),this.addEvents(\"beforeload\",\"load\"),GeoExt.tree.LayerLoader.superclass.constructor.call(this)},Ext.extend(GeoExt.tree.LayerLoader,Ext.util.Observable,{store:null,filter:function(e){return 1==e.get(\"layer\").displayInLayerSwitcher},uiProviders:null,load:function(e,t){if(this.fireEvent(\"beforeload\",this,e)){for(this.removeStoreHandlers();e.firstChild;)e.removeChild(e.firstChild);this.uiProviders||(this.uiProviders=e.getOwnerTree().getLoader().uiProviders),this.store||(this.store=GeoExt.MapPanel.guess().layers),this.store.each(function(t){this.addLayerNode(e,t)},this),this.addStoreHandlers(e),\"function\"==typeof t&&t(),this.fireEvent(\"load\",this,e)}},onStoreAdd:function(e,t,a,i){if(!this._reordering)for(var r=i.recordIndexToNodeIndex(a+t.length-1),s=0;s<t.length;++s)this.addLayerNode(i,t[s],r)},onStoreRemove:function(e,t,a,i){this._reordering||this.removeLayerNode(i,t)},addLayerNode:function(e,t,a){if(a=a||0,this.filter(t)===!0){var i=this.createNode({nodeType:\"gx_layer\",layer:t.get(\"layer\"),layerStore:this.store}),r=e.item(a);r?e.insertBefore(i,r):e.appendChild(i),i.on(\"move\",this.onChildMove,this)}},removeLayerNode:function(e,t){if(this.filter(t)===!0){var a=e.findChildBy(function(e){return e.layer==t.get(\"layer\")});a&&(a.un(\"move\",this.onChildMove,this),a.remove(),e.reload())}},onChildMove:function(e,t,a,i,r){this._reordering=!0;var s=this.store.findBy(function(e){return e.get(\"layer\")===t.layer}),n=this.store.getAt(s);if(i instanceof GeoExt.tree.LayerContainer&&this.store===i.loader.store){i.loader._reordering=!0,this.store.remove(n);var o;if(i.childNodes.length>1){var l=0===r?r+1:r-1;o=this.store.findBy(function(e){return i.childNodes[l].layer===e.get(\"layer\")}),0===r&&o++}else if(a.parentNode===i.parentNode){var d=i;do{d=d.previousSibling}while(d&&!(d instanceof GeoExt.tree.LayerContainer&&d.lastChild));if(d)o=this.store.findBy(function(e){return d.lastChild.layer===e.get(\"layer\")});else{var h=i;do{h=h.nextSibling}while(h&&!(h instanceof GeoExt.tree.LayerContainer&&h.firstChild));h&&(o=this.store.findBy(function(e){return h.firstChild.layer===e.get(\"layer\")})),o++}}void 0!==o?(this.store.insert(o,[n]),window.setTimeout(function(){i.reload(),a.reload()})):this.store.insert(s,[n]),delete i.loader._reordering}delete this._reordering},addStoreHandlers:function(e){if(!this._storeHandlers){this._storeHandlers={add:this.onStoreAdd.createDelegate(this,[e],!0),remove:this.onStoreRemove.createDelegate(this,[e],!0)};for(var t in this._storeHandlers)this.store.on(t,this._storeHandlers[t],this)}},removeStoreHandlers:function(){if(this._storeHandlers){for(var e in this._storeHandlers)this.store.un(e,this._storeHandlers[e],this);delete this._storeHandlers}},createNode:function(attr){return this.baseAttrs&&Ext.apply(attr,this.baseAttrs),\"string\"==typeof attr.uiProvider&&(attr.uiProvider=this.uiProviders[attr.uiProvider]||eval(attr.uiProvider)),attr.nodeType=attr.nodeType||\"gx_layer\",new Ext.tree.TreePanel.nodeTypes[attr.nodeType](attr)},destroy:function(){this.removeStoreHandlers()}}),Ext.namespace(\"GeoExt.grid\"),GeoExt.grid.FeatureSelectionModelMixin=function(){return{autoActivateControl:!0,layerFromStore:!0,selectControl:null,bound:!1,superclass:null,constructor:function(e){if(e=e||{},e.selectControl instanceof OpenLayers.Control.SelectFeature){if(!e.singleSelect){var t=e.selectControl;e.singleSelect=!(t.multiple||t.multipleKey)}}else e.layer instanceof OpenLayers.Layer.Vector&&(this.selectControl=this.createSelectControl(e.layer,e.selectControl),delete e.layer,delete e.selectControl);this.superclass=arguments.callee.superclass,this.superclass.constructor.call(this,e)},initEvents:function(){if(this.superclass.initEvents.call(this),this.layerFromStore){var e=this.grid.getStore()&&this.grid.getStore().layer;!e||this.selectControl instanceof OpenLayers.Control.SelectFeature||(this.selectControl=this.createSelectControl(e,this.selectControl))}this.selectControl&&this.bind(this.selectControl)},createSelectControl:function(e,t){t=t||{};var a=void 0!==t.singleSelect?t.singleSelect:this.singleSelect;t=OpenLayers.Util.extend({toggle:!0,multipleKey:a?null:Ext.isMac?\"metaKey\":\"ctrlKey\"},t);var i=new OpenLayers.Control.SelectFeature(e,t);return e.map.addControl(i),i},bind:function(e,t){if(!this.bound){t=t||{},this.selectControl=e,e instanceof OpenLayers.Layer.Vector&&(this.selectControl=this.createSelectControl(e,t.controlConfig)),this.autoActivateControl&&this.selectControl.activate();for(var a=this.getLayers(),i=0,r=a.length;i<r;i++)a[i].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 e=this.selectControl;if(this.bound){for(var t=this.getLayers(),a=0,i=t.length;a<i;a++)t[a].events.un({featureselected:this.featureSelected,featureunselected:this.featureUnselected,scope:this});this.un(\"rowselect\",this.rowSelected,this),this.un(\"rowdeselect\",this.rowDeselected,this),this.autoActivateControl&&e.deactivate(),this.selectControl=null,this.bound=!1}return e},featureSelected:function(e){if(!this._selecting){var t=this.grid.store,a=t.findBy(function(t,a){return t.data.feature==e.feature});a==-1||this.isSelected(a)||(this._selecting=!0,this.selectRow(a,!this.singleSelect),this._selecting=!1,this.grid.getView().focusRow(a))}},featureUnselected:function(e){if(!this._selecting){var t=this.grid.store,a=t.findBy(function(t,a){return t.data.feature==e.feature});a!=-1&&this.isSelected(a)&&(this._selecting=!0,this.deselectRow(a),this._selecting=!1,this.grid.getView().focusRow(a))}},rowSelected:function(e,t,a){var i=a.data.feature;if(!this._selecting&&i)for(var r=this.getLayers(),s=0,n=r.length;s<n;s++)if(r[s].selectedFeatures.indexOf(i)==-1){this._selecting=!0,this.selectControl.select(i),this._selecting=!1;break}},rowDeselected:function(e,t,a){var i=a.data.feature;if(!this._selecting&&i)for(var r=this.getLayers(),s=0,n=r.length;s<n;s++)if(r[s].selectedFeatures.indexOf(i)!=-1){this._selecting=!0,this.selectControl.unselect(i),this._selecting=!1;break}},getLayers:function(){return this.selectControl.layers||[this.selectControl.layer]}}},GeoExt.grid.FeatureSelectionModel=Ext.extend(Ext.grid.RowSelectionModel,new GeoExt.grid.FeatureSelectionModelMixin),Ext.namespace(\"GeoExt\",\"GeoExt.data\"),GeoExt.data.LayerReader=function(e,t){e=e||{},t instanceof Function||(t=GeoExt.data.LayerRecord.create(t||e.fields||{})),GeoExt.data.LayerReader.superclass.constructor.call(this,e,t)},Ext.extend(GeoExt.data.LayerReader,Ext.data.DataReader,{totalRecords:null,readRecords:function(e){var t=[];if(e){var a,i,r,s,n,o,l,d,h=this.recordType,c=h.prototype.fields;for(a=0,i=e.length;a<i;a++){for(n=e[a],o={},r=0,s=c.length;r<s;r++)l=c.items[r],d=n[l.mapping||l.name]||l.defaultValue,d=l.convert(d),o[l.name]=d;o.layer=n,t[t.length]=new h(o,n.id)}}return{records:t,totalRecords:null!=this.totalRecords?this.totalRecords:t.length}}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.LayerRecord=Ext.data.Record.create([{name:\"layer\"},{name:\"title\",type:\"string\",mapping:\"name\"}]),GeoExt.data.LayerRecord.prototype.clone=function(e){var t=this.get(\"layer\")&&this.get(\"layer\").clone();return new this.constructor(Ext.applyIf({layer:t},this.data),e||t.id)},GeoExt.data.LayerRecord.create=function(e){var t=Ext.extend(GeoExt.data.LayerRecord,{}),a=t.prototype;if(a.fields=new Ext.util.MixedCollection(!1,function(e){return e.name}),GeoExt.data.LayerRecord.prototype.fields.each(function(e){a.fields.add(e)}),e)for(var i=0,r=e.length;i<r;i++)a.fields.add(new Ext.data.Field(e[i]));return t.getField=function(e){return a.fields.get(e)},t},Ext.namespace(\"GeoExt.form\"),GeoExt.form.BasicForm=Ext.extend(Ext.form.BasicForm,{protocol:null,prevResponse:null,autoAbort:!0,doAction:function(e,t){return\"search\"==e&&(t=Ext.applyIf(t||{},{protocol:this.protocol,abortPrevious:this.autoAbort}),e=new GeoExt.form.SearchAction(this,t)),GeoExt.form.BasicForm.superclass.doAction.call(this,e,t)},search:function(e){return this.doAction(\"search\",e)}}),Ext.namespace(\"GeoExt\",\"GeoExt.data\"),GeoExt.data.FeatureReader=function(e,t){e=e||{},t instanceof Function||(t=GeoExt.data.FeatureRecord.create(t||e.fields||{})),GeoExt.data.FeatureReader.superclass.constructor.call(this,e,t)},Ext.extend(GeoExt.data.FeatureReader,Ext.data.DataReader,{totalRecords:null,read:function(e){return this.readRecords(e.features)},readRecords:function(e){var t=[];if(e){var a,i,r,s,n,o,l,d,h=this.recordType,c=h.prototype.fields;for(a=0,i=e.length;a<i;a++){if(n=e[a],o={},n.attributes)for(r=0,s=c.length;r<s;r++){if(l=c.items[r],/[\\[\\.]/.test(l.mapping))try{d=new Function(\"obj\",\"return obj.\"+l.mapping)(n.attributes)}catch(e){d=l.defaultValue}else d=n.attributes[l.mapping||l.name]||l.defaultValue;l.convert&&(d=l.convert(d)),o[l.name]=d}o.feature=n,o.state=n.state,o.fid=n.fid;var p=n.state===OpenLayers.State.INSERT?void 0:n.id;t[t.length]=new h(o,p)}}return{records:t,totalRecords:null!=this.totalRecords?this.totalRecords:t.length}}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.WMSDescribeLayerReader=function(e,t){e=e||{},e.format||(e.format=new OpenLayers.Format.WMSDescribeLayer),\"function\"!=typeof t&&(t=Ext.data.Record.create(t||e.fields||[{name:\"owsType\",type:\"string\"},{name:\"owsURL\",type:\"string\"},{name:\"typeName\",type:\"string\"}])),GeoExt.data.WMSDescribeLayerReader.superclass.constructor.call(this,e,t)},Ext.extend(GeoExt.data.WMSDescribeLayerReader,Ext.data.DataReader,{read:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),this.readRecords(t)},readRecords:function(e){(\"string\"==typeof e||e.nodeType)&&(e=this.meta.format.read(e));for(var t,a=[],i=0,r=e.length;i<r;i++)(t=e[i])&&a.push(new this.recordType(t));return{totalRecords:a.length,success:!0,records:a}}}),Ext.namespace(\"GeoExt.form\"),GeoExt.form.SearchAction=Ext.extend(Ext.form.Action,{type:\"search\",response:null,constructor:function(e,t){GeoExt.form.SearchAction.superclass.constructor.call(this,e,t)},run:function(){var e=this.options,t=GeoExt.form.toFilter(this.form);e.clientValidation===!1||this.form.isValid()?(e.abortPrevious&&this.form.prevResponse&&e.protocol.abort(this.form.prevResponse),this.form.prevResponse=e.protocol.read(Ext.applyIf({filter:t,callback:this.handleResponse,scope:this},e))):e.clientValidation!==!1&&(this.failureType=Ext.form.Action.CLIENT_INVALID,this.form.afterAction(this,!1))},handleResponse:function(e){this.form.prevResponse=null,this.response=e,e.success()?this.form.afterAction(this,!0):this.form.afterAction(this,!1);var t=this.options;t.callback&&t.callback.call(t.scope,e)}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.FeatureRecord=Ext.data.Record.create([{name:\"feature\"},{name:\"state\"},{name:\"fid\"}]),GeoExt.data.FeatureRecord.create=function(e){var t=Ext.extend(GeoExt.data.FeatureRecord,{}),a=t.prototype;if(a.fields=new Ext.util.MixedCollection(!1,function(e){return e.name}),GeoExt.data.FeatureRecord.prototype.fields.each(function(e){a.fields.add(e)}),e)for(var i=0,r=e.length;i<r;i++)a.fields.add(new Ext.data.Field(e[i]));return t.getField=function(e){return a.fields.get(e)},t},Ext.namespace(\"GeoExt\"),GeoExt.LegendWMS=Ext.extend(Ext.Panel,{imageFormat:\"image/gif\",defaultStyleIsFirst:!0,layer:null,record:null,bodyBorder:!1,initComponent:function(){GeoExt.LegendWMS.superclass.initComponent.call(this),this.layer||(this.layer=this.record.get(\"layer\")),this.updateLegend()},getLegendUrl:function(e,t){var a,i=this.record&&this.record.get(\"styles\");t=t||this.layer.params.LAYERS instanceof Array?this.layer.params.LAYERS:this.layer.params.LAYERS.split(\",\");var r=this.layer.params.STYLES&&this.layer.params.STYLES.split(\",\"),s=t.indexOf(e),n=r&&r[s];return i&&i.length>0&&(n?Ext.each(i,function(e){return!(a=e.name==n&&e.legend&&e.legend.href)}):this.defaultStyleIsFirst!==!0||r||this.layer.params.SLD||this.layer.params.SLD_BODY||(a=i[0].legend&&i[0].legend.href)),a||this.layer.getFullRequestString({REQUEST:\"GetLegendGraphic\",WIDTH:null,HEIGHT:null,EXCEPTIONS:\"application/vnd.ogc.se_xml\",LAYER:e,LAYERS:null,STYLE:\"\"!==n?n:null,STYLES:null,SRS:null,FORMAT:this.imageFormat})},updateLegend:function(e){var t,a,i,r;if(t=this.layer.params.LAYERS instanceof Array?this.layer.params.LAYERS:this.layer.params.LAYERS.split(\",\"),this.items){var s=[];for(this.items.each(function(r){if((i=t.indexOf(r.itemId))<0)s.push(r);else{a=t[i];var n=e||this.getLegendUrl(a,t);OpenLayers.Util.isEquivalentUrl(n,r.url)||r.updateLegend(n)}},this),i=0,r=s.length;i<r;i++){var n=s[i];this.remove(n),n.destroy()}}var o=!1;for(i=0,r=t.length;i<r;i++)a=t[i],this.items&&this.getComponent(a)||(this.add({xtype:\"gx_legendimage\",url:e||this.getLegendUrl(a,t),itemId:a}),o=!0);o&&this.doLayout()}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.WMSDescribeLayerStore=function(e){e=e||{},GeoExt.data.WMSDescribeLayerStore.superclass.constructor.call(this,Ext.apply(e,{proxy:e.proxy||(e.data?void 0:new Ext.data.HttpProxy({url:e.url,disableCaching:!1,method:\"GET\"})),reader:new GeoExt.data.WMSDescribeLayerReader(e,e.fields)}))},Ext.extend(GeoExt.data.WMSDescribeLayerStore,Ext.data.Store),Ext.namespace(\"GeoExt\"),GeoExt.FeatureRenderer=Ext.extend(Ext.BoxComponent,{feature:void 0,symbolizers:[OpenLayers.Feature.Vector.style.default],symbolType:\"Point\",resolution:1,minWidth:20,minHeight:20,renderers:[\"SVG\",\"VML\",\"Canvas\"],rendererOptions:null,pointFeature:void 0,lineFeature:void 0,polygonFeature: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)])]))}),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(e,t){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)},this.drawFeature(),GeoExt.FeatureRenderer.superclass.onRender.apply(this,arguments)},afterRender:function(){GeoExt.FeatureRenderer.superclass.afterRender.apply(this,arguments),this.initCustomEvents()},onResize:function(e,t){this.setRendererDimensions(),GeoExt.FeatureRenderer.superclass.onResize.apply(this,arguments)},setRendererDimensions:function(){var e=this.feature.geometry.getBounds(),t=e.getWidth(),a=e.getHeight(),i=this.initialConfig.resolution;i||(i=Math.max(t/this.width||0,a/this.height||0)||1),this.resolution=i;var r=Math.max(this.width||this.minWidth,t/i),s=Math.max(this.height||this.minHeight,a/i),n=e.getCenterPixel(),o=r*i/2,l=s*i/2,d=new OpenLayers.Bounds(n.x-o,n.y-l,n.x+o,n.y+l);this.renderer.setSize(new OpenLayers.Size(Math.round(r),Math.round(s))),this.renderer.setExtent(d,!0)},assignRenderer:function(){for(var e=0,t=this.renderers.length;e<t;++e){var a=OpenLayers.Renderer[this.renderers[e]];if(a&&a.prototype.supported()){this.renderer=new a(this.el,this.rendererOptions);break}}},setSymbolizers:function(e,t){this.symbolizers=e,t&&!t.draw||this.drawFeature()},setSymbolType:function(e,t){this.symbolType=e,this.setFeature(null,t)},setFeature:function(e,t){this.feature=e||this[this.symbolType.toLowerCase()+\"Feature\"],t&&!t.draw||this.drawFeature()},drawFeature:function(){this.renderer.clear(),this.setRendererDimensions();for(var e=0,t=this.symbolizers.length;e<t;++e)this.renderer.drawFeature(this.feature.clone(),Ext.apply({},this.symbolizers[e]))},update:function(e){e=e||{},e.feature?this.setFeature(e.feature,{draw:!1}):e.symbolType&&this.setSymbolType(e.symbolType,{draw:!1}),e.symbolizers&&this.setSymbolizers(e.symbolizers,{draw:!1}),this.drawFeature()},beforeDestroy:function(){this.clearCustomEvents(),this.renderer&&this.renderer.destroy()}}),Ext.reg(\"gx_renderer\",GeoExt.FeatureRenderer),Ext.namespace(\"GeoExt\"),GeoExt.Popup=Ext.extend(Ext.Window,{anchored:!0,map:null,panIn:!0,unpinnable:!0,feature:null,lonlat:null,animCollapse:!1,draggable:!1,shadow:!1,popupCls:\"gx-popup\",ancCls:null,initComponent:function(){this.map instanceof GeoExt.MapPanel&&(this.map=this.map.map),!this.map&&this.feature&&this.feature.layer&&(this.map=this.feature.layer.map),!this.feature&&this.lonlat&&(this.feature=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(this.lonlat.lon,this.lonlat.lat))),this.anchored&&this.addAnchorEvents(),this.baseCls=this.popupCls+\" \"+this.baseCls,this.elements+=\",anc\",GeoExt.Popup.superclass.initComponent.call(this)},onRender:function(e,t){GeoExt.Popup.superclass.onRender.call(this,e,t),this.ancCls=this.popupCls+\"-anc\",this.createElement(\"anc\",this.el.dom)},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())},setSize:function(e,t){if(this.anc){var a=this.anc.getSize();\"object\"==typeof e?(t=e.height-a.height,e=e.width):isNaN(t)||(t-=a.height)}GeoExt.Popup.superclass.setSize.call(this,e,t)},position:function(){var e=this.feature.geometry.getBounds().getCenterLonLat();if(this._mapMove===!0){var t=this.map.getExtent().containsLonLat(e);t!==this.isVisible()&&this.setVisible(t)}if(this.isVisible()){var a=this.map.getViewPortPxFromLonLat(e),i=Ext.fly(this.map.div).getBox(),r=this.anc,s=r.getLeft(!0)+r.getWidth()/2,n=this.el.getHeight();this.setPosition(a.x+i.x-s,a.y+i.y-n)}},unanchorPopup:function(){this.removeAnchorEvents(),this.draggable=!0,this.header.addClass(\"x-window-draggable\"),this.dd=new Ext.Window.DD(this),this.anc.remove(),this.anc=null,this.tools.unpin.hide()},panIntoView:function(){var e=this.feature.geometry.getBounds().getCenterLonLat(),t=(this.map.getViewPortPxFromLonLat(e),Ext.fly(this.map.div).getBox()),a=this.getPosition(!0);a[0]-=t.x,a[1]-=t.y;var i=[t.width,t.height],r=this.getSize(),s=[a[0],a[1]],n=this.map.paddingForPopups;a[0]<n.left?s[0]=n.left:a[0]+r.width>i[0]-n.right&&(s[0]=i[0]-n.right-r.width),a[1]<n.top?s[1]=n.top:a[1]+r.height>i[1]-n.bottom&&(s[1]=i[1]-n.bottom-r.height);var o=a[0]-s[0],l=a[1]-s[1];this.map.pan(o,l)},onMapMove:function(){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.data\"),GeoExt.data.AttributeStore=function(e){e=e||{},GeoExt.data.AttributeStore.superclass.constructor.call(this,Ext.apply(e,{proxy:e.proxy||(e.data?void 0:new Ext.data.HttpProxy({url:e.url,disableCaching:!1,method:\"GET\"})),reader:new GeoExt.data.AttributeReader(e,e.fields||[\"name\",\"type\"])}))},Ext.extend(GeoExt.data.AttributeStore,Ext.data.Store),Ext.namespace(\"GeoExt.form\"),GeoExt.form.FormPanel=Ext.extend(Ext.form.FormPanel,{protocol:null,createForm:function(){return delete this.initialConfig.listeners,\nnew GeoExt.form.BasicForm(null,this.initialConfig)},search:function(e){this.getForm().search(e)}}),Ext.reg(\"gx_formpanel\",GeoExt.form.FormPanel),Ext.namespace(\"GeoExt.data\"),GeoExt.data.WMCReader=function(e,t){e=e||{},e.format||(e.format=new OpenLayers.Format.WMC),\"function\"!=typeof t&&(t=GeoExt.data.LayerRecord.create(t||e.fields||[{name:\"abstract\",type:\"string\"},{name:\"metadataURL\",type:\"string\"},{name:\"queryable\",type:\"boolean\"},{name:\"formats\"},{name:\"styles\"}])),GeoExt.data.WMCReader.superclass.constructor.call(this,e,t)},Ext.extend(GeoExt.data.WMCReader,Ext.data.DataReader,{read:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),this.readRecords(t)},readRecords:function(e){var t=this.meta.format;(\"string\"==typeof e||e.nodeType)&&(e=t.read(e));var a=e?e.layersContext:void 0,i=[];if(a){var r,s,n,o,l,d,h,c,p=this.recordType,u=p.prototype.fields;for(r=0,s=a.length;r<s;r++){for(l=a[r],d={},n=0,o=u.length;n<o;n++)h=u.items[n],c=l[h.mapping||h.name]||h.defaultValue,c=h.convert(c),d[h.name]=c;d.layer=t.getLayerFromContext(l),i.push(new this.recordType(d,d.layer.id))}}return{totalRecords:i.length,success:!0,records:i}}}),Ext.namespace(\"GeoExt.tree\"),GeoExt.tree.OverlayLayerContainer=Ext.extend(GeoExt.tree.LayerContainer,{constructor:function(e){e=Ext.applyIf(e||{},{text:\"Overlays\"}),e.loader=Ext.applyIf(e.loader||{},{filter:function(e){var t=e.get(\"layer\");return t.displayInLayerSwitcher===!0&&t.isBaseLayer===!1}}),GeoExt.tree.OverlayLayerContainer.superclass.constructor.call(this,e)}}),Ext.tree.TreePanel.nodeTypes.gx_overlaylayercontainer=GeoExt.tree.OverlayLayerContainer,Ext.namespace(\"GeoExt.data\"),GeoExt.data.WFSCapabilitiesReader=function(e,t){e=e||{},e.format||(e.format=new OpenLayers.Format.WFSCapabilities),\"function\"!=typeof t&&(t=GeoExt.data.LayerRecord.create(t||e.fields||[{name:\"name\",type:\"string\"},{name:\"abstract\",type:\"string\"}])),GeoExt.data.WFSCapabilitiesReader.superclass.constructor.call(this,e,t)},Ext.extend(GeoExt.data.WFSCapabilitiesReader,Ext.data.DataReader,{read:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),this.readRecords(t)},readRecords:function(e){(\"string\"==typeof e||e.nodeType)&&(e=this.meta.format.read(e));for(var t,a,i,r,s,n=[],o=e.featureTypeList.featureTypes,l={url:e.capability.request.getfeature.href.post},d=0,h=o.length;d<h;d++)t=o[d],t.name&&(i=t.name.split(\":\"),s=i.length>1?{featureType:i[1],featurePrefix:i[0]}:{featureType:i[0],featurePrefix:null},this.meta.protocolOptions?Ext.apply(s,this.meta.protocolOptions,l):Ext.apply(s,{},l),r={protocol:new OpenLayers.Protocol.WFS(s),strategies:[new OpenLayers.Strategy.Fixed]},this.meta.layerOptions&&Ext.apply(r,this.meta.layerOptions),a=new OpenLayers.Layer.Vector(t.title||t.name,r),n.push(new this.recordType(Ext.apply(t,{layer:a}),a.id)));return{totalRecords:n.length,success:!0,records:n}}}),Ext.namespace(\"GeoExt\"),GeoExt.LegendPanel=Ext.extend(Ext.Panel,{dynamic:!0,showTitle:!0,labelCls:null,bodyStyle:\"\",layerStore:null,filter:function(e){return!0},initComponent:function(){GeoExt.LegendPanel.superclass.initComponent.call(this)},onRender:function(){GeoExt.LegendPanel.superclass.onRender.apply(this,arguments),this.layerStore||(this.layerStore=GeoExt.MapPanel.guess().layers),this.layerStore.each(function(e){this.addLegend(e)},this),this.dynamic&&this.layerStore.on({add:this.onStoreAdd,remove:this.onStoreRemove,clear:this.onStoreClear,update:this.onStoreUpdate,scope:this}),this.doLayout()},recordIndexToPanelIndex:function(e){for(var t=this.layerStore,a=t.getCount(),i=-1,r=this.items?this.items.length:0,s=a-1;s>=0;--s){var n=t.getAt(s).get(\"layer\"),o=GeoExt[\"Legend\"+n.CLASS_NAME.split(\".\").pop()];if(n.displayInLayerSwitcher&&o&&t.getAt(s).get(\"hideInLegend\")!==!0&&(++i,e===s||i>r-1))break}return i},onStoreUpdate:function(e,t,a){var i=t.get(\"layer\"),r=this.items?this.getComponent(i.id):null;if(this.showTitle&&!t.get(\"hideTitle\")&&r&&r.items.get(0).text!==t.get(\"title\")&&r.items.get(0).setText(t.get(\"title\")),r){r.setVisible(i.getVisibility()&&i.inRange&&i.displayInLayerSwitcher&&!t.get(\"hideInLegend\"));var s=null!=t.get(\"legendURL\")?t.get(\"legendURL\"):void 0;r.items.get(1).updateLegend(s)}},onStoreAdd:function(e,t,a){for(var i=this.recordIndexToPanelIndex(a+t.length-1),r=0,s=t.length;r<s;r++)this.addLegend(t[r],i);this.doLayout()},onStoreRemove:function(e,t,a){this.removeLegend(t)},removeLegend:function(e){var t=this.getComponent(e.get(\"layer\").id);t&&(this.remove(t,!0),this.doLayout())},onStoreClear:function(e){this.removeAllLegends()},removeAllLegends:function(){this.removeAll(!0),this.doLayout()},createLegendSubpanel:function(e){var t=e.get(\"layer\"),a=this.createMainPanel(e);if(null!==a){var i;if(e.get(\"legendURL\"))i=new GeoExt.LegendImage({url:e.get(\"legendURL\")}),a.add(i);else{var r=GeoExt[\"Legend\"+t.CLASS_NAME.split(\".\").pop()];r&&(i=new r(Ext.applyIf({layer:t,record:e},this.legendOptions)),a.add(i))}}return a},addLegend:function(e,t){if(this.filter(e)===!0){t=t||0;var a=e.get(\"layer\"),i=this.createLegendSubpanel(e);null!==i&&(i.setVisible(a.getVisibility()&&a.inRange),this.insert(t,i))}},createMainPanel:function(e){var t=e.get(\"layer\"),a=null,i=GeoExt[\"Legend\"+t.CLASS_NAME.split(\".\").pop()];if(t.displayInLayerSwitcher&&!e.get(\"hideInLegend\")&&i){var r={id:t.id,border:!1,bodyBorder:!1,hideMode:\"offsets\",bodyStyle:this.bodyStyle,items:[new Ext.form.Label({text:this.showTitle&&!e.get(\"hideTitle\")?t.name:\"\",cls:\"x-form-item x-form-item-label\"+(this.labelCls?\" \"+this.labelCls:\"\")})]};a=new Ext.Panel(r)}return a},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),this.layerStore.un(\"update\",this.onStoreUpdate,this)),GeoExt.LegendPanel.superclass.onDestroy.apply(this,arguments)}}),Ext.reg(\"gx_legendpanel\",GeoExt.LegendPanel),Ext.namespace(\"GeoExt.form\"),GeoExt.form.toFilter=function(e,t){e instanceof Ext.form.FormPanel&&(e=e.getForm());var a=[],i=e.getValues(!1);for(var r in i){var s,n=r.split(\"__\"),o=i[r];n.length>1&&void 0!==(s=GeoExt.form.toFilter.FILTER_MAP[n[1]])?r=n[0]:s=OpenLayers.Filter.Comparison.EQUAL_TO,a.push(new OpenLayers.Filter.Comparison({type:s,value:o,property:r}))}return new OpenLayers.Filter.Logical({type:t||OpenLayers.Filter.Logical.AND,filters:a})},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},Ext.namespace(\"GeoExt.tree\"),GeoExt.tree.LayerNodeUI=Ext.extend(Ext.tree.TreeNodeUI,{constructor:function(e){GeoExt.tree.LayerNodeUI.superclass.constructor.apply(this,arguments)},render:function(e){var t=this.node.attributes;void 0===t.checked&&(t.checked=this.node.layer.getVisibility()),GeoExt.tree.LayerNodeUI.superclass.render.apply(this,arguments);var a=this.checkbox;if(t.checkedGroup){var i=Ext.DomHelper.insertAfter(a,['<input type=\"radio\" name=\"',t.checkedGroup,'_checkbox\" class=\"',a.className,a.checked?'\" checked=\"checked\"':\"\",'\"></input>'].join(\"\"));i.defaultChecked=a.defaultChecked,Ext.get(a).remove(),this.checkbox=i}this.enforceOneVisible()},onClick:function(e){e.getTarget(\".x-tree-node-cb\",1)?this.toggleCheck(this.isChecked()):GeoExt.tree.LayerNodeUI.superclass.onClick.apply(this,arguments)},toggleCheck:function(e){e=void 0===e?!this.isChecked():e,GeoExt.tree.LayerNodeUI.superclass.toggleCheck.call(this,e),this.enforceOneVisible()},enforceOneVisible:function(){var e=this.node.attributes,t=e.checkedGroup;if(t){var a=this.node.layer,i=this.node.getOwnerTree().getChecked(),r=0;if(Ext.each(i,function(i){var s=(i.getUI(),i.layer);i.hidden||i.attributes.checkedGroup!==t||(r++,s!=a&&e.checked&&s.setVisibility(!1))}),0===r&&0==e.checked){this.node.getUI();a.setVisibility(!0)}}},appendDDGhost:function(e){var t=this.elNode.cloneNode(!0),a=Ext.DomQuery.select(\"input[type='radio']\",t);Ext.each(a,function(e){e.name=e.name+\"_clone\"}),e.appendChild(t)}}),GeoExt.tree.LayerNode=Ext.extend(Ext.tree.AsyncTreeNode,{layer:null,layerStore:null,constructor:function(e){e.leaf=e.leaf||!(e.children||e.loader),e.iconCls||e.children||(e.iconCls=\"gx-tree-layer-icon\"),!e.loader||e.loader instanceof Ext.tree.TreeLoader||(e.loader=new GeoExt.tree.LayerParamLoader(e.loader)),this.defaultUI=this.defaultUI||GeoExt.tree.LayerNodeUI,Ext.apply(this,{layer:e.layer,layerStore:e.layerStore}),e.text&&(this.fixedText=!0),GeoExt.tree.LayerNode.superclass.constructor.apply(this,arguments)},render:function(e){var t=this.layer instanceof OpenLayers.Layer&&this.layer;if(!t){this.layerStore&&\"auto\"!=this.layerStore||(this.layerStore=GeoExt.MapPanel.guess().layers);var a=this.layerStore.findBy(function(e){return e.get(\"title\")==this.layer},this);a!=-1&&(t=this.layerStore.getAt(a).get(\"layer\"))}if(!this.rendered||!t){var i=this.getUI();t?(this.layer=t,t.isBaseLayer&&(this.draggable=!1,Ext.applyIf(this.attributes,{checkedGroup:\"gx_baselayer\"})),this.text||(this.text=t.name),i.show(),this.addVisibilityEventHandlers()):i.hide(),this.layerStore instanceof GeoExt.data.LayerStore&&this.addStoreEventHandlers(t)}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})},onLayerVisibilityChanged:function(){this._visibilityChanging||this.getUI().toggleCheck(this.layer.getVisibility())},onCheckChange:function(e,t){if(t!=this.layer.getVisibility()){this._visibilityChanging=!0;var a=this.layer;t&&a.isBaseLayer&&a.map?a.map.setBaseLayer(a):a.setVisibility(t),delete this._visibilityChanging}},addStoreEventHandlers:function(){this.layerStore.on({add:this.onStoreAdd,remove:this.onStoreRemove,update:this.onStoreUpdate,scope:this})},onStoreAdd:function(e,t,a){for(var i,r=0;r<t.length;++r){if(i=t[r].get(\"layer\"),this.layer==i){this.getUI().show();break}if(this.layer==i.name){this.render();break}}},onStoreRemove:function(e,t,a){this.layer==t.get(\"layer\")&&this.getUI().hide()},onStoreUpdate:function(e,t,a){var i=t.get(\"layer\");this.fixedText||this.layer!=i||this.text===i.name||this.setText(i.name)},destroy:function(){var e=this.layer;e instanceof OpenLayers.Layer&&e.events.un({visibilitychanged:this.onLayerVisibilityChanged,scope:this}),delete this.layer;var t=this.layerStore;t&&(t.un(\"add\",this.onStoreAdd,this),t.un(\"remove\",this.onStoreRemove,this),t.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.LayerParamNode=Ext.extend(Ext.tree.TreeNode,{layer:null,param:null,item:null,delimiter:null,allItems:null,constructor:function(e){var t=e||{};t.iconCls=t.iconCls||\"gx-tree-layerparam-icon\",t.text=t.text||t.item,\"string\"!=typeof t.layer&&t.layer.getVisibility(),this.param=t.param,this.item=t.item,this.delimiter=t.delimiter||\",\",GeoExt.tree.LayerParamNode.superclass.constructor.apply(this,arguments)},render:function(e){var t=this.attributes.layer;if(\"string\"==typeof t){var a=this.attributes.layerStore||GeoExt.MapPanel.guess().layers,i=a.findBy(function(e){return e.get(\"title\")==t});t=a.getAt(i).get(\"layer\")}this.layer=t,this.allItems=this.getItems();var r=t.getVisibility();this.attributes.checked=null==this.attributes.checked?r:this.attributes.checked,this.attributes.checked!==r&&this.onCheckChange(this,!r),this.addVisibilityEventHandlers(),GeoExt.tree.LayerParamNode.superclass.render.apply(this,arguments)},getItems:function(){var e=this.layer.params[this.param];return e instanceof Array?e:e?e.split(this.delimiter):[]},createParams:function(e){var t={};return t[this.param]=this.layer.params[this.param]instanceof Array?e:e.join(this.delimiter),t},addVisibilityEventHandlers:function(){this.layer.events.on({visibilitychanged:this.onLayerVisibilityChanged,scope:this}),this.on({checkchange:this.onCheckChange,scope:this})},onLayerVisibilityChanged:function(){0===this.getItems().length&&this.layer.mergeNewParams(this.createParams(this.allItems));var e=this.layer.getVisibility();e&&this.getItems().indexOf(this.item)!==-1&&this.getUI().toggleCheck(!0),e||(this.layer.mergeNewParams(this.createParams([])),this.getUI().toggleCheck(!1))},onCheckChange:function(e,t){var a=this.layer,i=[],r=this.getItems();t===!0&&a.getVisibility()===!1&&r.length===this.allItems.length&&(r=[]),Ext.each(this.allItems,function(e){(e!==this.item&&r.indexOf(e)!==-1||t===!0&&e===this.item)&&i.push(e)},this);var s=i.length>0;s&&a.mergeNewParams(this.createParams(i)),s!==a.getVisibility()&&a.setVisibility(s),!s&&a.mergeNewParams(this.createParams([]))},destroy:function(){var e=this.layer;e instanceof OpenLayers.Layer&&e.events.un({visibilitychanged:this.onLayerVisibilityChanged,scope:this}),delete this.layer,this.un(\"checkchange\",this.onCheckChange,this),GeoExt.tree.LayerNode.superclass.destroy.apply(this,arguments)}}),Ext.tree.TreePanel.nodeTypes.gx_layerparam=GeoExt.tree.LayerParamNode,Ext.namespace(\"GeoExt.tree\"),GeoExt.tree.RadioButtonMixin=function(){return function(){var e;return{constructor:function(t){t.addEvents(\"radiochange\"),e=arguments.callee.superclass,e.constructor.apply(this,arguments)},render:function(t){if(!this.rendered){e.render.apply(this,arguments);var a=this.node.attributes;a.radioGroup&&Ext.DomHelper.insertBefore(this.anchor,['<input type=\"radio\" class=\"gx-tree-radio\" name=\"',a.radioGroup,'_radio\"></input>'].join(\"\"))}},onClick:function(t){var a=t.getTarget(\".gx-tree-radio\",1);a?(a.defaultChecked=a.checked,this.fireEvent(\"radiochange\",this.node)):e.onClick.apply(this,arguments)}}}()},Ext.namespace(\"GeoExt\"),GeoExt.LegendImage=Ext.extend(Ext.BoxComponent,{url:null,defaultImgSrc:null,imgCls:null,initComponent:function(){GeoExt.LegendImage.superclass.initComponent.call(this),null===this.defaultImgSrc&&(this.defaultImgSrc=Ext.BLANK_IMAGE_URL),this.autoEl={tag:\"img\",class:this.imgCls?this.imgCls:\"\",src:this.defaultImgSrc}},updateLegend:function(e){this.url=e;var t=this.getEl();t&&(t.un(\"error\",this.onImageLoadError,this),t.on(\"error\",this.onImageLoadError,this,{single:!0}),t.dom.src=e)},onRender:function(e,t){GeoExt.LegendImage.superclass.onRender.call(this,e,t),this.url&&this.updateLegend(this.url)},onDestroy:function(){var e=this.getEl();e&&e.un(\"error\",this.onImageLoadError,this),GeoExt.LegendImage.superclass.onDestroy.apply(this,arguments)},onImageLoadError:function(){this.getEl().dom.src=this.defaultImgSrc}}),Ext.reg(\"gx_legendimage\",GeoExt.LegendImage),Ext.namespace(\"GeoExt\"),GeoExt.LayerOpacitySlider=Ext.extend(Ext.Slider,{layer:null,complementaryLayer:null,delay:5,changeVisibilityDelay:5,aggressive:!1,changeVisibility:!1,value:null,constructor:function(e){e.layer&&(e.layer instanceof OpenLayers.Layer?this.layer=e.layer:e.layer instanceof GeoExt.data.LayerRecord&&(this.layer=e.layer.get(\"layer\")),e.complementaryLayer instanceof OpenLayers.Layer?this.complementaryLayer=e.complementaryLayer:e.complementaryLayer instanceof GeoExt.data.LayerRecord&&(this.complementaryLayer=e.complementaryLayer.get(\"layer\")),delete e.layer,delete e.complementaryLayer),GeoExt.LayerOpacitySlider.superclass.constructor.call(this,e)},initComponent:function(){this.layer&&null!==this.layer.opacity?this.value=parseInt(this.layer.opacity*(this.maxValue-this.minValue)):null==this.value&&(this.value=this.maxValue),GeoExt.LayerOpacitySlider.superclass.initComponent.call(this),this.changeVisibility&&this.layer&&(0==this.layer.opacity||this.value==this.minValue)&&this.layer.setVisibility(!1),this.complementaryLayer&&(this.layer&&1==this.layer.opacity||this.value==this.maxValue)&&this.complementaryLayer.setVisibility(!1),this.aggressive===!0?this.on(\"change\",this.changeLayerOpacity,this,{buffer:this.delay}):this.on(\"changecomplete\",this.changeLayerOpacity,this),this.changeVisibility===!0&&this.on(\"change\",this.changeLayerVisibility,this,{buffer:this.changeVisibilityDelay}),this.complementaryLayer&&this.on(\"change\",this.changeComplementaryLayerVisibility,this,{buffer:this.changeVisibilityDelay})},changeLayerOpacity:function(e,t){this.layer&&this.layer.setOpacity(t/100)},changeLayerVisibility:function(e,t){var a=this.layer.getVisibility();t==this.minValue&&a===!0?this.layer.setVisibility(!1):t>this.minValue&&0==a&&this.layer.setVisibility(!0)},changeComplementaryLayerVisibility:function(e,t){var a=this.complementaryLayer.getVisibility();t==this.maxValue&&a===!0?this.complementaryLayer.setVisibility(!1):t<this.maxValue&&0==a&&this.complementaryLayer.setVisibility(!0)},addToMapPanel:function(e){this.on({render:function(){var t=this.getEl();t.setStyle({position:\"absolute\",zIndex:e.map.Z_INDEX_BASE.Control}),t.on({mousedown:this.stopMouseEvents,click:this.stopMouseEvents})},scope:this})},removeFromMapPanel:function(e){this.getEl().un({mousedown:this.stopMouseEvents,click:this.stopMouseEvents,scope:this})},stopMouseEvents:function(e){e.stopEvent()}}),Ext.reg(\"gx_opacityslider\",GeoExt.LayerOpacitySlider),Ext.namespace(\"GeoExt.data\"),GeoExt.data.AttributeReader=function(e,t){e=e||{},e.format||(e.format=new OpenLayers.Format.WFSDescribeFeatureType),GeoExt.data.AttributeReader.superclass.constructor.call(this,e,t||e.fields)},Ext.extend(GeoExt.data.AttributeReader,Ext.data.DataReader,{read:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),this.readRecords(t)},readRecords:function(e){var t;t=e instanceof Array?e:this.meta.format.read(e).featureTypes[0].properties;for(var a,i,r,s,n,o,l=this.recordType,d=l.prototype.fields,h=d.length,c=[],p=0,u=t.length;p<u;++p){s=!1,a=t[p],i={};for(var y=0;y<h&&(r=d.items[y].name,o=a[r],!(this.meta.ignore&&this.meta.ignore[r]&&(n=this.meta.ignore[r],\"string\"==typeof n?s=n===o:n instanceof Array?s=n.indexOf(o)>-1:n instanceof RegExp&&(s=n.test(o)),s)));++y)i[r]=a[r];s||(c[c.length]=new l(i))}return{success:!0,records:c,totalRecords:c.length}}}),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(e){this.compiledTemplate=new Ext.Template(this.template),GeoExt.ZoomSliderTip.superclass.init.call(this,e)},getText:function(e){var t={zoom:e.getZoom(),resolution:e.getResolution(),scale:Math.round(e.getScale())};return this.compiledTemplate.apply(t)}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.ScaleStore=Ext.extend(Ext.data.Store,{map:null,constructor:function(e){var t=e.map instanceof GeoExt.MapPanel?e.map.map:e.map;delete e.map,e=Ext.applyIf(e,{reader:new Ext.data.JsonReader({},[\"level\",\"resolution\",\"scale\"])}),GeoExt.data.ScaleStore.superclass.constructor.call(this,e),t&&this.bind(t)},bind:function(e,t){this.map=e instanceof GeoExt.MapPanel?e.map:e,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(e){e.layer.isBaseLayer&&(this.populateFromMap(),this.map.events.unregister(\"addlayer\",this,this.populateOnAdd))},populateFromMap:function(){for(var e=[],t=this.map.baseLayer.resolutions,a=this.map.baseLayer.units,i=t.length-1;i>=0;i--){var r=t[i];e.push({level:i,resolution:r,scale:OpenLayers.Util.getScaleFromResolution(r,a)})}this.loadData(e)}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.FeatureStoreMixin=function(){return{layer:null,reader:null,addFeatureFilter:null,addRecordFilter:null,constructor:function(e){e=e||{},e.reader=e.reader||new GeoExt.data.FeatureReader({},e.fields);var t=e.layer;delete e.layer,e.features&&(e.data=e.features),delete e.features;var a={initDir:e.initDir};delete e.initDir,arguments.callee.superclass.constructor.call(this,e),t&&this.bind(t,a)},bind:function(e,t){if(!this.layer){this.layer=e,t=t||{};var a=t.initDir;void 0==t.initDir&&(a=GeoExt.data.FeatureStore.LAYER_TO_STORE|GeoExt.data.FeatureStore.STORE_TO_LAYER);var i=e.features.slice(0);if(a&GeoExt.data.FeatureStore.STORE_TO_LAYER)for(var r=this.getRange(),s=r.length-1;s>=0;s--)this.layer.addFeatures([r[s].get(\"feature\")]);a&GeoExt.data.FeatureStore.LAYER_TO_STORE&&this.loadData(i,!0),e.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(){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(e){var t=null;if(e.state!==OpenLayers.State.INSERT)t=this.getById(e.id);else{var a=this.findBy(function(t){return t.get(\"feature\")===e});a>-1&&(t=this.getAt(a))}return t},onFeaturesAdded:function(e){if(!this._adding){var t=e.features,a=t;if(\"function\"==typeof this.addFeatureFilter){a=[];for(var i,r,s,i=0,r=t.length;i<r;i++)s=t[i],this.addFeatureFilter(s)!==!1&&a.push(s)}this._adding=!0,this.loadData(a,!0),delete this._adding}},onFeaturesRemoved:function(e){if(!this._removing){var t,a,i,r=e.features;for(i=r.length-1;i>=0;i--)t=r[i],void 0!==(a=this.getRecordFromFeature(t))&&(this._removing=!0,this.remove(a),delete this._removing)}},onFeatureModified:function(e){if(!this._updating){var t=e.feature,a=this.getRecordFromFeature(t);if(void 0!==a){if(a.beginEdit(),attributes=t.attributes,attributes)for(var i=this.recordType.prototype.fields,r=0,s=i.length;r<s;r++){var n=i.items[r],o=n.mapping||n.name;o in attributes&&a.set(n.name,n.convert(attributes[o]))}a.set(\"state\",t.state),a.set(\"fid\",t.fid),a.data.feature=t,this._updating=!0,a.endEdit(),delete this._updating}}},addFeaturesToLayer:function(e){var t,a,i,r;if(\"function\"==typeof this.addRecordFilter)for(i=[],t=0,a=e.length;t<a;t++)r=e[t],this.addRecordFilter(r)!==!1&&i.push(r.get(\"feature\"));else for(i=new Array(a=e.length),t=0;t<a;t++)i[t]=e[t].get(\"feature\");i.length>0&&(this._adding=!0,this.layer.addFeatures(i),delete this._adding)},onLoad:function(e,t,a){a&&a.add===!0||(this._removing=!0,this.layer.removeFeatures(this.layer.features),delete this._removing,this.addFeaturesToLayer(t))},onClear:function(e){this._removing=!0,this.layer.removeFeatures(this.layer.features),delete this._removing},onAdd:function(e,t,a){this._adding||this.addFeaturesToLayer(t)},onRemove:function(e,t,a){if(!this._removing){var i=t.get(\"feature\");null!=this.layer.getFeatureById(i.id)&&(this._removing=!0,this.layer.removeFeatures([t.get(\"feature\")]),delete this._removing)}},onUpdate:function(e,t,a){if(!this._updating){var i=(new GeoExt.data.FeatureRecord).fields,r=t.get(\"feature\");if(t.fields){if(this.layer.events.triggerEvent(\"beforefeaturemodified\",{feature:r})!==!1){var s=r.attributes;t.fields.each(function(e){var a=e.mapping||e.name;i.containsKey(a)||(s[a]=t.get(e.name))}),this._updating=!0,this.layer.events.triggerEvent(\"featuremodified\",{feature:r}),delete this._updating,null!=this.layer.getFeatureById(r.id)&&this.layer.drawFeature(r)}}}}}},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.data\"),GeoExt.data.WFSCapabilitiesStore=function(e){e=e||{},GeoExt.data.WFSCapabilitiesStore.superclass.constructor.call(this,Ext.apply(e,{proxy:e.proxy||(e.data?void 0:new Ext.data.HttpProxy({url:e.url,disableCaching:!1,method:\"GET\"})),reader:new GeoExt.data.WFSCapabilitiesReader(e,e.fields)}))},Ext.extend(GeoExt.data.WFSCapabilitiesStore,Ext.data.Store),Ext.namespace(\"GeoExt\"),GeoExt.MapPanel=Ext.extend(Ext.Panel,{map:null,layers:null,center:null,zoom:null,extent:null,initComponent:function(){this.map instanceof OpenLayers.Map||(this.map=new OpenLayers.Map(Ext.applyIf(this.map||{},{allOverlays:!0})));var e=this.layers;(!e||e instanceof Array)&&(this.layers=new GeoExt.data.LayerStore({layers:e,map:this.map})),\"string\"==typeof this.center?this.center=OpenLayers.LonLat.fromString(this.center):this.center instanceof Array&&(this.center=new OpenLayers.LonLat(this.center[0],this.center[1])),\"string\"==typeof this.extent?this.extent=OpenLayers.Bounds.fromString(this.extent):this.extent instanceof Array&&(this.extent=OpenLayers.Bounds.fromArray(this.extent)),GeoExt.MapPanel.superclass.initComponent.call(this)},updateMapSize:function(){this.map&&this.map.updateSize()},renderMap:function(){var e=this.map;e.render(this.body.dom),e.layers.length>0&&(this.center||null!=this.zoom?e.setCenter(this.center,this.zoom):this.extent?e.zoomToExtent(this.extent):e.zoomToMaxExtent())},afterRender:function(){GeoExt.MapPanel.superclass.afterRender.apply(this,arguments),this.ownerCt?(this.ownerCt.on(\"move\",this.updateMapSize,this),this.ownerCt.on({afterlayout:{fn:this.renderMap,scope:this,single:!0}})):this.renderMap()},onResize:function(){GeoExt.MapPanel.superclass.onResize.apply(this,arguments),this.updateMapSize()},onBeforeAdd:function(e){\"function\"==typeof e.addToMapPanel&&e.addToMapPanel(this),GeoExt.MapPanel.superclass.onBeforeAdd.apply(this,arguments)},remove:function(e,t){\"function\"==typeof e.removeFromMapPanel&&e.removeFromMapPanel(this),GeoExt.MapPanel.superclass.remove.apply(this,arguments)},beforeDestroy:function(){this.ownerCt&&this.ownerCt.un(\"move\",this.updateMapSize,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(e){return e instanceof GeoExt.MapPanel})},Ext.reg(\"gx_mappanel\",GeoExt.MapPanel),Ext.namespace(\"GeoExt\",\"GeoExt.data\"),GeoExt.data.ProtocolProxy=function(e){Ext.apply(this,e),GeoExt.data.ProtocolProxy.superclass.constructor.apply(this,arguments)},Ext.extend(GeoExt.data.ProtocolProxy,Ext.data.DataProxy,{protocol:null,abortPrevious:!0,response:null,load:function(e,t,a,i,r){if(this.fireEvent(\"beforeload\",this,e)!==!1){var s={params:e||{},request:{callback:a,scope:i,arg:r},reader:t},n=OpenLayers.Function.bind(this.loadResponse,this,s);this.abortPrevious&&this.abortRequest();var o={params:e,callback:n,scope:this};Ext.applyIf(o,r),this.response=this.protocol.read(o)}else a.call(i||this,null,r,!1)},abortRequest:function(){this.response&&(this.protocol.abort(this.response),this.response=null)},loadResponse:function(e,t){if(t.success()){var a=e.reader.read(t);this.fireEvent(\"load\",this,e,e.request.arg),e.request.callback.call(e.request.scope,a,e.request.arg,!0)}else this.fireEvent(\"loadexception\",this,e,t),e.request.callback.call(e.request.scope,null,e.request.arg,!1)}}),Ext.namespace(\"GeoExt\"),GeoExt.Action=Ext.extend(Ext.Action,{control:null,map:null,uScope:null,uHandler:null,uToggleHandler:null,uCheckHandler:null,constructor:function(e){this.uScope=e.scope,this.uHandler=e.handler,this.uToggleHandler=e.toggleHandler,this.uCheckHandler=e.checkHandler,e.scope=this,e.handler=this.pHandler,e.toggleHandler=this.pToggleHandler,e.checkHandler=this.pCheckHandler;var t=this.control=e.control;delete e.control,t&&(e.map&&(e.map.addControl(t),delete e.map),(e.pressed||e.checked)&&t.map&&t.activate(),t.events.on({activate:this.onCtrlActivate,deactivate:this.onCtrlDeactivate,scope:this})),arguments.callee.superclass.constructor.call(this,e)},pHandler:function(e){var t=this.control;t&&t.type==OpenLayers.Control.TYPE_BUTTON&&t.trigger(),this.uHandler&&this.uHandler.apply(this.uScope,arguments)},pToggleHandler:function(e,t){this.changeControlState(t),this.uToggleHandler&&this.uToggleHandler.apply(this.uScope,arguments)},pCheckHandler:function(e,t){this.changeControlState(t),this.uCheckHandler&&this.uCheckHandler.apply(this.uScope,arguments)},changeControlState:function(e){e?this._activating||(this._activating=!0,this.control.activate(),this._activating=!1):this._deactivating||(this._deactivating=!0,this.control.deactivate(),this._deactivating=!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(e,t){for(var a=this.items,i=0,r=a.length;i<r;i++)a[i][e]&&a[i][e].apply(a[i],t)}}),Ext.namespace(\"GeoExt.data\"),GeoExt.data.WMSCapabilitiesStore=function(e){e=e||{},GeoExt.data.WMSCapabilitiesStore.superclass.constructor.call(this,Ext.apply(e,{proxy:e.proxy||(e.data?void 0:new Ext.data.HttpProxy({url:e.url,disableCaching:!1,method:\"GET\"})),reader:new GeoExt.data.WMSCapabilitiesReader(e,e.fields)}))},Ext.extend(GeoExt.data.WMSCapabilitiesStore,Ext.data.Store),Ext.namespace(\"GeoExt\"),GeoExt.LayerOpacitySliderTip=Ext.extend(GeoExt.SliderTip,{template:\"<div>{opacity}%</div>\",compiledTemplate:null,init:function(e){this.compiledTemplate=new Ext.Template(this.template),GeoExt.LayerOpacitySliderTip.superclass.init.call(this,e)},getText:function(e){var t={opacity:e.getValue()};return this.compiledTemplate.apply(t)}});"

/***/ },

/***/ 645:
/***/ function(module, exports) {

	module.exports = "var OpenLayers={singleFile:!0};if(function(){var e=\"object\"==typeof OpenLayers&&OpenLayers.singleFile;if(window.OpenLayers={_scriptName:e?\"OpenLayers.js\":\"lib/OpenLayers.js\",_getScriptLocation:function(){for(var e=\"\",t=new RegExp(\"(^|(.*?\\\\/))(\"+OpenLayers._scriptName+\")(\\\\?|$)\"),i=document.getElementsByTagName(\"script\"),r=0,n=i.length;r<n;r++){var s=i[r].getAttribute(\"src\");if(s){var a=s.match(t);if(a){e=a[1];break}}}return e}},!e){var t=new Array(\"OpenLayers/Util.js\",\"OpenLayers/BaseTypes.js\",\"OpenLayers/BaseTypes/Class.js\",\"OpenLayers/BaseTypes/Bounds.js\",\"OpenLayers/BaseTypes/Element.js\",\"OpenLayers/BaseTypes/LonLat.js\",\"OpenLayers/BaseTypes/Pixel.js\",\"OpenLayers/BaseTypes/Size.js\",\"OpenLayers/Console.js\",\"OpenLayers/Tween.js\",\"Rico/Corner.js\",\"Rico/Color.js\",\"OpenLayers/Ajax.js\",\"OpenLayers/Events.js\",\"OpenLayers/Request.js\",\"OpenLayers/Request/XMLHttpRequest.js\",\"OpenLayers/Projection.js\",\"OpenLayers/Map.js\",\"OpenLayers/Layer.js\",\"OpenLayers/Icon.js\",\"OpenLayers/Marker.js\",\"OpenLayers/Marker/Box.js\",\"OpenLayers/Popup.js\",\"OpenLayers/Tile.js\",\"OpenLayers/Tile/Image.js\",\"OpenLayers/Tile/WFS.js\",\"OpenLayers/Layer/Image.js\",\"OpenLayers/Layer/SphericalMercator.js\",\"OpenLayers/Layer/EventPane.js\",\"OpenLayers/Layer/FixedZoomLevels.js\",\"OpenLayers/Layer/Google.js\",\"OpenLayers/Layer/VirtualEarth.js\",\"OpenLayers/Layer/Yahoo.js\",\"OpenLayers/Layer/HTTPRequest.js\",\"OpenLayers/Layer/Grid.js\",\"OpenLayers/Layer/MapGuide.js\",\"OpenLayers/Layer/MapServer.js\",\"OpenLayers/Layer/MapServer/Untiled.js\",\"OpenLayers/Layer/KaMap.js\",\"OpenLayers/Layer/KaMapCache.js\",\"OpenLayers/Layer/MultiMap.js\",\"OpenLayers/Layer/Markers.js\",\"OpenLayers/Layer/Text.js\",\"OpenLayers/Layer/WorldWind.js\",\"OpenLayers/Layer/ArcGIS93Rest.js\",\"OpenLayers/Layer/WMS.js\",\"OpenLayers/Layer/WMS/Untiled.js\",\"OpenLayers/Layer/ArcIMS.js\",\"OpenLayers/Layer/GeoRSS.js\",\"OpenLayers/Layer/Boxes.js\",\"OpenLayers/Layer/XYZ.js\",\"OpenLayers/Layer/TMS.js\",\"OpenLayers/Layer/TileCache.js\",\"OpenLayers/Popup/Anchored.js\",\"OpenLayers/Popup/AnchoredBubble.js\",\"OpenLayers/Popup/Framed.js\",\"OpenLayers/Popup/FramedCloud.js\",\"OpenLayers/Feature.js\",\"OpenLayers/Feature/Vector.js\",\"OpenLayers/Feature/WFS.js\",\"OpenLayers/Handler.js\",\"OpenLayers/Handler/Click.js\",\"OpenLayers/Handler/Hover.js\",\"OpenLayers/Handler/Point.js\",\"OpenLayers/Handler/Path.js\",\"OpenLayers/Handler/Polygon.js\",\"OpenLayers/Handler/Feature.js\",\"OpenLayers/Handler/Drag.js\",\"OpenLayers/Handler/RegularPolygon.js\",\"OpenLayers/Handler/Box.js\",\"OpenLayers/Handler/MouseWheel.js\",\"OpenLayers/Handler/Keyboard.js\",\"OpenLayers/Control.js\",\"OpenLayers/Control/Attribution.js\",\"OpenLayers/Control/Button.js\",\"OpenLayers/Control/ZoomBox.js\",\"OpenLayers/Control/ZoomToMaxExtent.js\",\"OpenLayers/Control/DragPan.js\",\"OpenLayers/Control/Navigation.js\",\"OpenLayers/Control/MouseDefaults.js\",\"OpenLayers/Control/MousePosition.js\",\"OpenLayers/Control/OverviewMap.js\",\"OpenLayers/Control/KeyboardDefaults.js\",\"OpenLayers/Control/PanZoom.js\",\"OpenLayers/Control/PanZoomBar.js\",\"OpenLayers/Control/ArgParser.js\",\"OpenLayers/Control/Permalink.js\",\"OpenLayers/Control/Scale.js\",\"OpenLayers/Control/ScaleLine.js\",\"OpenLayers/Control/Snapping.js\",\"OpenLayers/Control/Split.js\",\"OpenLayers/Control/LayerSwitcher.js\",\"OpenLayers/Control/DrawFeature.js\",\"OpenLayers/Control/DragFeature.js\",\"OpenLayers/Control/ModifyFeature.js\",\"OpenLayers/Control/Panel.js\",\"OpenLayers/Control/SelectFeature.js\",\"OpenLayers/Control/NavigationHistory.js\",\"OpenLayers/Control/Measure.js\",\"OpenLayers/Control/WMSGetFeatureInfo.js\",\"OpenLayers/Geometry.js\",\"OpenLayers/Geometry/Rectangle.js\",\"OpenLayers/Geometry/Collection.js\",\"OpenLayers/Geometry/Point.js\",\"OpenLayers/Geometry/MultiPoint.js\",\"OpenLayers/Geometry/Curve.js\",\"OpenLayers/Geometry/LineString.js\",\"OpenLayers/Geometry/LinearRing.js\",\"OpenLayers/Geometry/Polygon.js\",\"OpenLayers/Geometry/MultiLineString.js\",\"OpenLayers/Geometry/MultiPolygon.js\",\"OpenLayers/Geometry/Surface.js\",\"OpenLayers/Renderer.js\",\"OpenLayers/Renderer/Elements.js\",\"OpenLayers/Renderer/SVG.js\",\"OpenLayers/Renderer/Canvas.js\",\"OpenLayers/Renderer/VML.js\",\"OpenLayers/Layer/Vector.js\",\"OpenLayers/Layer/Vector/RootContainer.js\",\"OpenLayers/Strategy.js\",\"OpenLayers/Strategy/Fixed.js\",\"OpenLayers/Strategy/Cluster.js\",\"OpenLayers/Strategy/Paging.js\",\"OpenLayers/Strategy/BBOX.js\",\"OpenLayers/Strategy/Save.js\",\"OpenLayers/Protocol.js\",\"OpenLayers/Protocol/HTTP.js\",\"OpenLayers/Protocol/SQL.js\",\"OpenLayers/Protocol/SQL/Gears.js\",\"OpenLayers/Protocol/WFS.js\",\"OpenLayers/Protocol/WFS/v1.js\",\"OpenLayers/Protocol/WFS/v1_0_0.js\",\"OpenLayers/Protocol/WFS/v1_1_0.js\",\"OpenLayers/Layer/PointTrack.js\",\"OpenLayers/Layer/GML.js\",\"OpenLayers/Style.js\",\"OpenLayers/StyleMap.js\",\"OpenLayers/Rule.js\",\"OpenLayers/Filter.js\",\"OpenLayers/Filter/FeatureId.js\",\"OpenLayers/Filter/Logical.js\",\"OpenLayers/Filter/Comparison.js\",\"OpenLayers/Filter/Spatial.js\",\"OpenLayers/Format.js\",\"OpenLayers/Format/XML.js\",\"OpenLayers/Format/ArcXML.js\",\"OpenLayers/Format/ArcXML/Features.js\",\"OpenLayers/Format/GML.js\",\"OpenLayers/Format/GML/Base.js\",\"OpenLayers/Format/GML/v2.js\",\"OpenLayers/Format/GML/v3.js\",\"OpenLayers/Format/KML.js\",\"OpenLayers/Format/GeoRSS.js\",\"OpenLayers/Format/WFS.js\",\"OpenLayers/Format/WFSCapabilities.js\",\"OpenLayers/Format/WFSCapabilities/v1.js\",\"OpenLayers/Format/WFSCapabilities/v1_0_0.js\",\"OpenLayers/Format/WFSCapabilities/v1_1_0.js\",\"OpenLayers/Format/WFSDescribeFeatureType.js\",\"OpenLayers/Format/WMSDescribeLayer.js\",\"OpenLayers/Format/WMSDescribeLayer/v1_1.js\",\"OpenLayers/Format/WKT.js\",\"OpenLayers/Format/OSM.js\",\"OpenLayers/Format/GPX.js\",\"OpenLayers/Format/Filter.js\",\"OpenLayers/Format/Filter/v1.js\",\"OpenLayers/Format/Filter/v1_0_0.js\",\"OpenLayers/Format/Filter/v1_1_0.js\",\"OpenLayers/Format/SLD.js\",\"OpenLayers/Format/SLD/v1.js\",\"OpenLayers/Format/SLD/v1_0_0.js\",\"OpenLayers/Format/SLD/v1.js\",\"OpenLayers/Format/WFST.js\",\"OpenLayers/Format/WFST/v1.js\",\"OpenLayers/Format/WFST/v1_0_0.js\",\"OpenLayers/Format/WFST/v1_1_0.js\",\"OpenLayers/Format/Text.js\",\"OpenLayers/Format/JSON.js\",\"OpenLayers/Format/GeoJSON.js\",\"OpenLayers/Format/WMC.js\",\"OpenLayers/Format/WMC/v1.js\",\"OpenLayers/Format/WMC/v1_0_0.js\",\"OpenLayers/Format/WMC/v1_1_0.js\",\"OpenLayers/Format/WMSCapabilities.js\",\"OpenLayers/Format/WMSCapabilities/v1_1.js\",\"OpenLayers/Format/WMSCapabilities/v1_1_0.js\",\"OpenLayers/Format/WMSCapabilities/v1_1_1.js\",\"OpenLayers/Format/WMSGetFeatureInfo.js\",\"OpenLayers/Layer/WFS.js\",\"OpenLayers/Control/GetFeature.js\",\"OpenLayers/Control/MouseToolbar.js\",\"OpenLayers/Control/NavToolbar.js\",\"OpenLayers/Control/PanPanel.js\",\"OpenLayers/Control/Pan.js\",\"OpenLayers/Control/ZoomIn.js\",\"OpenLayers/Control/ZoomOut.js\",\"OpenLayers/Control/ZoomPanel.js\",\"OpenLayers/Control/EditingToolbar.js\",\"OpenLayers/Lang.js\",\"OpenLayers/Lang/en.js\"),i=navigator.userAgent,r=i.match(\"MSIE\")||i.match(\"Safari\");if(r)var n=new Array(t.length);for(var s=OpenLayers._getScriptLocation()+\"lib/\",a=0,o=t.length;a<o;a++)if(r)n[a]=\"<script src='\"+s+t[a]+\"'></script>\";else{var l=document.createElement(\"script\");l.src=s+t[a];var p=document.getElementsByTagName(\"head\").length?document.getElementsByTagName(\"head\")[0]:document.body;p.appendChild(l)}r&&document.write(n.join(\"\"))}}(),OpenLayers.VERSION_NUMBER=\"OpenLayers 2.8 -- $Revision: 9492 $\",OpenLayers.String={startsWith:function(e,t){return 0==e.indexOf(t)},contains:function(e,t){return e.indexOf(t)!=-1},trim:function(e){return e.replace(/^\\s\\s*/,\"\").replace(/\\s\\s*$/,\"\")},camelize:function(e){for(var t=e.split(\"-\"),i=t[0],r=1,n=t.length;r<n;r++){var s=t[r];i+=s.charAt(0).toUpperCase()+s.substring(1)}return i},format:function(e,t,i){t||(t=window);var r=function(e,r){for(var n,s=r.split(/\\.+/),a=0;a<s.length;a++)0==a&&(n=t),n=n[s[a]];return\"function\"==typeof n&&(n=i?n.apply(null,i):n()),void 0===n?\"undefined\":n};return e.replace(OpenLayers.String.tokenRegEx,r)},tokenRegEx:/\\$\\{([\\w.]+?)\\}/g,numberRegEx:/^([+-]?)(?=\\d|\\.\\d)\\d*(\\.\\d*)?([Ee]([+-]?\\d+))?$/,isNumeric:function(e){return OpenLayers.String.numberRegEx.test(e)},numericIf:function(e){return OpenLayers.String.isNumeric(e)?parseFloat(e):e}},String.prototype.startsWith||(String.prototype.startsWith=function(e){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.String.startsWith\"})),OpenLayers.String.startsWith(this,e)}),String.prototype.contains||(String.prototype.contains=function(e){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.String.contains\"})),OpenLayers.String.contains(this,e)}),String.prototype.trim||(String.prototype.trim=function(){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.String.trim\"})),OpenLayers.String.trim(this)}),String.prototype.camelize||(String.prototype.camelize=function(){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.String.camelize\"})),OpenLayers.String.camelize(this)}),OpenLayers.Number={decimalSeparator:\".\",thousandsSeparator:\",\",limitSigDigs:function(e,t){var i=0;return t>0&&(i=parseFloat(e.toPrecision(t))),i},format:function(e,t,i,r){t=void 0!==t?t:0,i=void 0!==i?i:OpenLayers.Number.thousandsSeparator,r=void 0!==r?r:OpenLayers.Number.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var n=e.toString().split(\".\");1==n.length&&null==t&&(t=0);var s=n[0];if(i)for(var a=/(-?[0-9]+)([0-9]{3})/;a.test(s);)s=s.replace(a,\"$1\"+i+\"$2\");var o;if(0==t)o=s;else{var l=n.length>1?n[1]:\"0\";null!=t&&(l+=new Array(t-l.length+1).join(\"0\")),o=s+r+l}return o}},Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.Number.limitSigDigs\"})),OpenLayers.Number.limitSigDigs(this,e)}),OpenLayers.Function={bind:function(e,t){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var r=i.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,r)}},bindAsEventListener:function(e,t){return function(i){return e.call(t,i||window.event)}}},Function.prototype.bind||(Function.prototype.bind=function(){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.Function.bind\"})),Array.prototype.unshift.apply(arguments,[this]),OpenLayers.Function.bind.apply(null,arguments)}),Function.prototype.bindAsEventListener||(Function.prototype.bindAsEventListener=function(e){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.Function.bindAsEventListener\"})),OpenLayers.Function.bindAsEventListener(this,e)}),OpenLayers.Array={filter:function(e,t,i){var r=[];if(Array.prototype.filter)r=e.filter(t,i);else{var n=e.length;if(\"function\"!=typeof t)throw new TypeError;for(var s=0;s<n;s++)if(s in e){var a=e[s];t.call(i,a,s,e)&&r.push(a)}}return r}},OpenLayers.Class=function(){for(var e,t,i=function(){arguments&&arguments[0]!=OpenLayers.Class.isPrototype&&this.initialize.apply(this,arguments)},r={},n=0,s=arguments.length;n<s;++n)\"function\"==typeof arguments[n]?(0==n&&s>1&&(t=arguments[n].prototype.initialize,arguments[n].prototype.initialize=function(){},r=new arguments[n],void 0===t?delete arguments[n].prototype.initialize:arguments[n].prototype.initialize=t),e=arguments[n].prototype):e=arguments[n],OpenLayers.Util.extend(r,e);return i.prototype=r,i},OpenLayers.Class.isPrototype=function(){},OpenLayers.Class.create=function(){return function(){arguments&&arguments[0]!=OpenLayers.Class.isPrototype&&this.initialize.apply(this,arguments)}},OpenLayers.Class.inherit=function(){for(var e=arguments[0],t=new e(OpenLayers.Class.isPrototype),i=1,r=arguments.length;i<r;i++){if(\"function\"==typeof arguments[i]){var n=arguments[i];arguments[i]=new n(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(t,arguments[i])}return t},OpenLayers.Util={},OpenLayers.Util.getElement=function(){for(var e=[],t=0,i=arguments.length;t<i;t++){var r=arguments[t];if(\"string\"==typeof r&&(r=document.getElementById(r)),1==arguments.length)return r;e.push(r)}return e},void 0===window.$&&(window.$=OpenLayers.Util.getElement),OpenLayers.Util.extend=function(e,t){if(e=e||{},t){for(var i in t){var r=t[i];void 0!==r&&(e[i]=r)}!(\"function\"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty(\"toString\")&&(e.toString=t.toString)}return e},OpenLayers.Util.removeItem=function(e,t){for(var i=e.length-1;i>=0;i--)e[i]==t&&e.splice(i,1);return e},OpenLayers.Util.clearArray=function(e){OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"array = []\"})),e.length=0},OpenLayers.Util.indexOf=function(e,t){for(var i=0,r=e.length;i<r;i++)if(e[i]==t)return i;return-1},OpenLayers.Util.modifyDOMElement=function(e,t,i,r,n,s,a,o){t&&(e.id=t),i&&(e.style.left=i.x+\"px\",e.style.top=i.y+\"px\"),r&&(e.style.width=r.w+\"px\",e.style.height=r.h+\"px\"),n&&(e.style.position=n),s&&(e.style.border=s),a&&(e.style.overflow=a),parseFloat(o)>=0&&parseFloat(o)<1?(e.style.filter=\"alpha(opacity=\"+100*o+\")\",e.style.opacity=o):1==parseFloat(o)&&(e.style.filter=\"\",e.style.opacity=\"\")},OpenLayers.Util.createDiv=function(e,t,i,r,n,s,a,o){var l=document.createElement(\"div\");return r&&(l.style.backgroundImage=\"url(\"+r+\")\"),e||(e=OpenLayers.Util.createUniqueID(\"OpenLayersDiv\")),n||(n=\"absolute\"),OpenLayers.Util.modifyDOMElement(l,e,t,i,n,s,a,o),l},OpenLayers.Util.createImage=function(e,t,i,r,n,s,a,o){var l=document.createElement(\"img\");return e||(e=OpenLayers.Util.createUniqueID(\"OpenLayersDiv\")),n||(n=\"relative\"),OpenLayers.Util.modifyDOMElement(l,e,t,i,n,s,null,a),o&&(l.style.display=\"none\",OpenLayers.Event.observe(l,\"load\",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,l)),OpenLayers.Event.observe(l,\"error\",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,l))),l.style.alt=e,l.galleryImg=\"no\",r&&(l.src=r),l},OpenLayers.Util.setOpacity=function(e,t){OpenLayers.Util.modifyDOMElement(e,null,null,null,null,null,null,t)},OpenLayers.Util.onImageLoad=function(){(!this.viewRequestID||this.map&&this.viewRequestID==this.map.viewRequestID)&&(this.style.backgroundColor=\"transparent\",this.style.display=\"\")},OpenLayers.Util.onImageLoadErrorColor=\"pink\",OpenLayers.IMAGE_RELOAD_ATTEMPTS=0,OpenLayers.Util.onImageLoadError=function(){if(this._attempts=this._attempts?this._attempts+1:1,this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var e=this.urls;if(e&&e instanceof Array&&e.length>1){var t,i,r=this.src.toString();for(i=0;(t=e[i])&&r.indexOf(t)==-1;i++);var n=Math.floor(e.length*Math.random()),s=e[n];for(i=0;s==t&&i++<4;)n=Math.floor(e.length*Math.random()),s=e[n];this.src=r.replace(t,s)}else this.src=this.src}else this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor;this.style.display=\"\"},OpenLayers.Util.alphaHackNeeded=null,OpenLayers.Util.alphaHack=function(){if(null==OpenLayers.Util.alphaHackNeeded){var e=navigator.appVersion.split(\"MSIE\"),t=parseFloat(e[1]),i=!1;try{i=!!document.body.filters}catch(e){}OpenLayers.Util.alphaHackNeeded=i&&t>=5.5&&t<7}return OpenLayers.Util.alphaHackNeeded},OpenLayers.Util.modifyAlphaImageDiv=function(e,t,i,r,n,s,a,o,l){OpenLayers.Util.modifyDOMElement(e,t,i,r,s,null,null,l);var p=e.childNodes[0];n&&(p.src=n),OpenLayers.Util.modifyDOMElement(p,e.id+\"_innerImage\",null,r,\"relative\",a),OpenLayers.Util.alphaHack()&&(\"none\"!=e.style.display&&(e.style.display=\"inline-block\"),null==o&&(o=\"scale\"),e.style.filter=\"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='\"+p.src+\"', sizingMethod='\"+o+\"')\",parseFloat(e.style.opacity)>=0&&parseFloat(e.style.opacity)<1&&(e.style.filter+=\" alpha(opacity=\"+100*e.style.opacity+\")\"),p.style.filter=\"alpha(opacity=0)\")},OpenLayers.Util.createAlphaImageDiv=function(e,t,i,r,n,s,a,o,l){var p=OpenLayers.Util.createDiv(),h=OpenLayers.Util.createImage(null,null,null,null,null,null,null,!1);return p.appendChild(h),l&&(h.style.display=\"none\",OpenLayers.Event.observe(h,\"load\",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,p)),OpenLayers.Event.observe(h,\"error\",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,p))),OpenLayers.Util.modifyAlphaImageDiv(p,e,t,i,r,n,s,a,o),p},OpenLayers.Util.upperCaseObject=function(e){var t={};for(var i in e)t[i.toUpperCase()]=e[i];return t},OpenLayers.Util.applyDefaults=function(e,t){e=e||{};var i=\"function\"==typeof window.Event&&t instanceof window.Event;for(var r in t)(void 0===e[r]||!i&&t.hasOwnProperty&&t.hasOwnProperty(r)&&!e.hasOwnProperty(r))&&(e[r]=t[r]);return!i&&t&&t.hasOwnProperty&&t.hasOwnProperty(\"toString\")&&!e.hasOwnProperty(\"toString\")&&(e.toString=t.toString),e},OpenLayers.Util.getParameterString=function(e){var t=[];for(var i in e){var r=e[i];if(null!=r&&\"function\"!=typeof r){var n;if(\"object\"==typeof r&&r.constructor==Array){for(var s=[],a=0,o=r.length;a<o;a++)s.push(encodeURIComponent(r[a]));n=s.join(\",\")}else n=encodeURIComponent(r);t.push(encodeURIComponent(i)+\"=\"+n)}}return t.join(\"&\")},OpenLayers.ImgPath=\"\",OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+\"img/\"},OpenLayers.Util.Try=function(){for(var e=null,t=0,i=arguments.length;t<i;t++){var r=arguments[t];try{e=r();break}catch(e){}}return e},OpenLayers.Util.getNodes=function(e,t){return OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(e.documentElement.childNodes,t)},function(){return OpenLayers.Util._getNodes(e.childNodes,t)})},OpenLayers.Util._getNodes=function(e,t){for(var i=[],r=0,n=e.length;r<n;r++)e[r].nodeName==t&&i.push(e[r]);return i},OpenLayers.Util.getTagText=function(e,t,i){var r=OpenLayers.Util.getNodes(e,t);return r&&r.length>0?(i||(i=0),r[i].childNodes.length>1?r.childNodes[1].nodeValue:1==r[i].childNodes.length?r[i].firstChild.nodeValue:void 0):\"\"},OpenLayers.Util.getXmlNodeValue=function(e){var t=null;return OpenLayers.Util.Try(function(){t=e.text,t||(t=e.textContent),t||(t=e.firstChild.nodeValue)},function(){t=e.textContent}),t},OpenLayers.Util.mouseLeft=function(e,t){for(var i=e.relatedTarget?e.relatedTarget:e.toElement;i!=t&&null!=i;)i=i.parentNode;return i!=t},OpenLayers.Util.DEFAULT_PRECISION=14,OpenLayers.Util.toFloat=function(e,t){null==t&&(t=OpenLayers.Util.DEFAULT_PRECISION);var e;return e=0==t?parseFloat(e):parseFloat(parseFloat(e).toPrecision(t))},OpenLayers.Util.rad=function(e){return e*Math.PI/180},OpenLayers.Util.distVincenty=function(e,t){for(var i=6378137,r=6356752.3142,n=1/298.257223563,s=OpenLayers.Util.rad(t.lon-e.lon),a=Math.atan((1-n)*Math.tan(OpenLayers.Util.rad(e.lat))),o=Math.atan((1-n)*Math.tan(OpenLayers.Util.rad(t.lat))),l=Math.sin(a),p=Math.cos(a),h=Math.sin(o),u=Math.cos(o),y=s,c=2*Math.PI,d=20;Math.abs(y-c)>1e-12&&--d>0;){var m=Math.sin(y),f=Math.cos(y),L=Math.sqrt(u*m*(u*m)+(p*h-l*u*f)*(p*h-l*u*f));if(0==L)return 0;var g=l*h+p*u*f,v=Math.atan2(L,g),O=Math.asin(p*u*m/L),S=Math.cos(O)*Math.cos(O),C=g-2*l*h/S,b=n/16*S*(4+n*(4-3*S));c=y,y=s+(1-b)*n*Math.sin(O)*(v+b*L*(C+b*g*(2*C*C-1)))}if(0==d)return NaN;var w=S*(i*i-r*r)/(r*r),E=1+w/16384*(4096+w*(w*(320-175*w)-768)),x=w/1024*(256+w*(w*(74-47*w)-128));return(r*E*(v-x*L*(C+x/4*(g*(2*C*C-1)-x/6*C*(4*L*L-3)*(4*C*C-3))))).toFixed(3)/1e3},OpenLayers.Util.getParameters=function(e){e=e||window.location.href;var t=\"\";if(OpenLayers.String.contains(e,\"?\")){var i=e.indexOf(\"?\")+1,r=OpenLayers.String.contains(e,\"#\")?e.indexOf(\"#\"):e.length;t=e.substring(i,r)}for(var n={},s=t.split(/[&;]/),a=0,o=s.length;a<o;++a){var l=s[a].split(\"=\");if(l[0]){var p=decodeURIComponent(l[0]),h=l[1]||\"\";h=h.split(\",\");for(var u=0,y=h.length;u<y;u++)h[u]=decodeURIComponent(h[u]);1==h.length&&(h=h[0]),n[p]=h}}return n},OpenLayers.Util.getArgs=function(e){return OpenLayers.Console.warn(OpenLayers.i18n(\"methodDeprecated\",{newMethod:\"OpenLayers.Util.getParameters\"})),OpenLayers.Util.getParameters(e)},OpenLayers.Util.lastSeqID=0,OpenLayers.Util.createUniqueID=function(e){return null==e&&(e=\"id_\"),OpenLayers.Util.lastSeqID+=1,e+OpenLayers.Util.lastSeqID},OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36},OpenLayers.INCHES_PER_UNIT.in=OpenLayers.INCHES_PER_UNIT.inches,OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd,OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m,OpenLayers.METERS_PER_INCH=.0254000508001016,OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:.0254/OpenLayers.METERS_PER_INCH,MicroInch:254e-7/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:.01/OpenLayers.METERS_PER_INCH,Kilometer:1e3/OpenLayers.METERS_PER_INCH,Yard:.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,\"Lat-66\":110943.31648893273/OpenLayers.METERS_PER_INCH,\"Lat-83\":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:.1/OpenLayers.METERS_PER_INCH,Millimeter:.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,\"NautM-UK\":1853.184/OpenLayers.METERS_PER_INCH,\"50kilometers\":5e4/OpenLayers.METERS_PER_INCH,\"150kilometers\":15e4/OpenLayers.METERS_PER_INCH}),OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1e3,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:100*OpenLayers.INCHES_PER_UNIT.Meter,km:1e3*OpenLayers.INCHES_PER_UNIT.Meter,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,\"us-in\":OpenLayers.INCHES_PER_UNIT.inches,\"us-ft\":OpenLayers.INCHES_PER_UNIT.Foot,\"us-yd\":OpenLayers.INCHES_PER_UNIT.Yard,\"us-ch\":OpenLayers.INCHES_PER_UNIT.GunterChain,\"us-mi\":OpenLayers.INCHES_PER_UNIT.Mile,\"ind-yd\":OpenLayers.INCHES_PER_UNIT.IndianYd37,\"ind-ft\":OpenLayers.INCHES_PER_UNIT.IndianFt37,\"ind-ch\":20.11669506/OpenLayers.METERS_PER_INCH}),OpenLayers.DOTS_PER_INCH=72,OpenLayers.Util.normalizeScale=function(e){return e>1?1/e:e},OpenLayers.Util.getResolutionFromScale=function(e,t){return null==t&&(t=\"degrees\"),1/(OpenLayers.Util.normalizeScale(e)*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH)},OpenLayers.Util.getScaleFromResolution=function(e,t){return null==t&&(t=\"degrees\"),e*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH},OpenLayers.Util.safeStopPropagation=function(e){OpenLayers.Event.stop(e,!0)},OpenLayers.Util.pagePosition=function(e){for(var t=0,i=0,r=e,n=e;r&&(r!=document.body||\"absolute\"!=OpenLayers.Element.getStyle(n,\"position\"));){t+=r.offsetTop||0,i+=r.offsetLeft||0,n=r;try{r=r.offsetParent}catch(e){OpenLayers.Console.error(OpenLayers.i18n(\"pagePositionFailed\",{elemId:r.id}));break}}for(r=e;r;)t-=r.scrollTop||0,i-=r.scrollLeft||0,r=r.parentNode;return[i,t]},OpenLayers.Util.isEquivalentUrl=function(e,t,i){i=i||{},OpenLayers.Util.applyDefaults(i,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0});var r=OpenLayers.Util.createUrlObject(e,i),n=OpenLayers.Util.createUrlObject(t,i);for(var s in r)if(\"args\"!==s&&r[s]!=n[s])return!1;for(var s in r.args){if(r.args[s]!=n.args[s])return!1;delete n.args[s]}for(var s in n.args)return!1;return!0},OpenLayers.Util.createUrlObject=function(e,t){if(t=t||{},!/^\\w+:\\/\\//.test(e)){var i=window.location,r=i.port?\":\"+i.port:\"\",n=i.protocol+\"//\"+i.host.split(\":\").shift()+r;if(0===e.indexOf(\"/\"))e=n+e;else{var s=i.pathname.split(\"/\");s.pop(),e=n+s.join(\"/\")+\"/\"+e}}t.ignoreCase&&(e=e.toLowerCase());var a=document.createElement(\"a\");a.href=e;var o={};o.host=a.host.split(\":\").shift(),o.protocol=a.protocol,t.ignorePort80?o.port=\"80\"==a.port||\"0\"==a.port?\"\":a.port:o.port=\"\"==a.port||\"0\"==a.port?\"80\":a.port,o.hash=t.ignoreHash||\"#\"===a.hash?\"\":a.hash;var l=a.search;if(!l){var p=e.indexOf(\"?\");l=p!=-1?e.substr(p):\"\"}return o.args=OpenLayers.Util.getParameters(l),o.pathname=\"/\"==a.pathname.charAt(0)?a.pathname:\"/\"+a.pathname,o},OpenLayers.Util.removeTail=function(e){var t=e.indexOf(\"?\"),i=e.indexOf(\"#\");return t==-1?i!=-1?e.substr(0,i):e:i!=-1?e.substr(0,Math.min(t,i)):e.substr(0,t)},OpenLayers.Util.getBrowserName=function(){var e=\"\",t=navigator.userAgent.toLowerCase();return t.indexOf(\"opera\")!=-1?e=\"opera\":t.indexOf(\"msie\")!=-1?e=\"msie\":t.indexOf(\"safari\")!=-1?e=\"safari\":t.indexOf(\"mozilla\")!=-1&&(e=t.indexOf(\"firefox\")!=-1?\"firefox\":\"mozilla\"),e},OpenLayers.Util.getRenderedDimensions=function(e,t,i){var r,n,s=document.createElement(\"div\");s.style.visibility=\"hidden\";var a=i&&i.containerElement?i.containerElement:document.body;t&&(t.w?(r=t.w,s.style.width=r+\"px\"):t.h&&(n=t.h,s.style.height=n+\"px\")),i&&i.displayClass&&(s.className=i.displayClass);var o=document.createElement(\"div\");if(o.innerHTML=e,o.style.overflow=\"visible\",o.childNodes)for(var l=0,p=o.childNodes.length;l<p;l++)o.childNodes[l].style&&(o.childNodes[l].style.overflow=\"visible\");s.appendChild(o),a.appendChild(s);for(var h=!1,u=s.parentNode;u&&\"body\"!=u.tagName.toLowerCase();){var y=OpenLayers.Element.getStyle(u,\"position\");if(\"absolute\"==y){h=!0;break}if(y&&\"static\"!=y)break;u=u.parentNode}return h||(s.style.position=\"absolute\"),r||(r=parseInt(o.scrollWidth),s.style.width=r+\"px\"),n||(n=parseInt(o.scrollHeight)),s.removeChild(o),a.removeChild(s),new OpenLayers.Size(r,n)},OpenLayers.Util.getScrollbarWidth=function(){var e=OpenLayers.Util._scrollbarWidth;if(null==e){var t=null,i=null,r=0,n=0;t=document.createElement(\"div\"),t.style.position=\"absolute\",t.style.top=\"-1000px\",t.style.left=\"-1000px\",t.style.width=\"100px\",t.style.height=\"50px\",t.style.overflow=\"hidden\",i=document.createElement(\"div\"),i.style.width=\"100%\",i.style.height=\"200px\",t.appendChild(i),document.body.appendChild(t),r=i.offsetWidth,t.style.overflow=\"scroll\",n=i.offsetWidth,document.body.removeChild(document.body.lastChild),OpenLayers.Util._scrollbarWidth=r-n,e=OpenLayers.Util._scrollbarWidth}return e},OpenLayers.Rico=new Object,OpenLayers.Rico.Corner={round:function(e,t){e=OpenLayers.Util.getElement(e),this._setOptions(t);var i=this.options.color;\"fromElement\"==this.options.color&&(i=this._background(e));var r=this.options.bgColor;\"fromParent\"==this.options.bgColor&&(r=this._background(e.offsetParent)),this._roundCornersImpl(e,i,r)},changeColor:function(e,t){e.style.backgroundColor=t;for(var i=e.parentNode.getElementsByTagName(\"span\"),r=0;r<i.length;r++)i[r].style.backgroundColor=t},changeOpacity:function(e,t){var i=t,r=\"alpha(opacity=\"+100*t+\")\";e.style.opacity=i,e.style.filter=r;for(var n=e.parentNode.getElementsByTagName(\"span\"),s=0;s<n.length;s++)n[s].style.opacity=i,n[s].style.filter=r},reRound:function(e,t){var i=e.parentNode.childNodes[0],r=e.parentNode.childNodes[2];e.parentNode.removeChild(i),e.parentNode.removeChild(r),this.round(e.parentNode,t)},_roundCornersImpl:function(e,t,i){this.options.border&&this._renderBorder(e,i),this._isTopRounded()&&this._roundTopCorners(e,t,i),this._isBottomRounded()&&this._roundBottomCorners(e,t,i)},_renderBorder:function(e,t){var i=\"1px solid \"+this._borderColor(t),r=\"border-left: \"+i,n=\"border-right: \"+i,s=\"style='\"+r+\";\"+n+\"'\";e.innerHTML=\"<div \"+s+\">\"+e.innerHTML+\"</div>\"},_roundTopCorners:function(e,t,i){for(var r=this._createCorner(i),n=0;n<this.options.numSlices;n++)r.appendChild(this._createCornerSlice(t,i,n,\"top\"));e.style.paddingTop=0,e.insertBefore(r,e.firstChild)},_roundBottomCorners:function(e,t,i){for(var r=this._createCorner(i),n=this.options.numSlices-1;n>=0;n--)r.appendChild(this._createCornerSlice(t,i,n,\"bottom\"));e.style.paddingBottom=0,e.appendChild(r)},_createCorner:function(e){var t=document.createElement(\"div\");return t.style.backgroundColor=this._isTransparent()?\"transparent\":e,t},_createCornerSlice:function(e,t,i,r){var n=document.createElement(\"span\"),s=n.style;s.backgroundColor=e,s.display=\"block\",s.height=\"1px\",s.overflow=\"hidden\",s.fontSize=\"1px\";var a=this._borderColor(e,t);return this.options.border&&0==i?(s.borderTopStyle=\"solid\",s.borderTopWidth=\"1px\",s.borderLeftWidth=\"0px\",s.borderRightWidth=\"0px\",s.borderBottomWidth=\"0px\",s.height=\"0px\",s.borderColor=a):a&&(s.borderColor=a,s.borderStyle=\"solid\",s.borderWidth=\"0px 1px\"),this.options.compact||i!=this.options.numSlices-1||(s.height=\"2px\"),this._setMargin(n,i,r),this._setBorder(n,i,r),n},_setOptions:function(e){this.options={corners:\"all\",color:\"fromElement\",bgColor:\"fromParent\",blend:!0,border:!1,compact:!1},OpenLayers.Util.extend(this.options,e||{}),this.options.numSlices=this.options.compact?2:4,this._isTransparent()&&(this.options.blend=!1)},_whichSideTop:function(){return this._hasString(this.options.corners,\"all\",\"top\")?\"\":this.options.corners.indexOf(\"tl\")>=0&&this.options.corners.indexOf(\"tr\")>=0?\"\":this.options.corners.indexOf(\"tl\")>=0?\"left\":this.options.corners.indexOf(\"tr\")>=0?\"right\":\"\"},_whichSideBottom:function(){return this._hasString(this.options.corners,\"all\",\"bottom\")?\"\":this.options.corners.indexOf(\"bl\")>=0&&this.options.corners.indexOf(\"br\")>=0?\"\":this.options.corners.indexOf(\"bl\")>=0?\"left\":this.options.corners.indexOf(\"br\")>=0?\"right\":\"\"},_borderColor:function(e,t){return\"transparent\"==e?t:this.options.border?this.options.border:this.options.blend?this._blend(t,e):\"\"},_setMargin:function(e,t,i){var r=this._marginSize(t),n=\"top\"==i?this._whichSideTop():this._whichSideBottom();\"left\"==n?(e.style.marginLeft=r+\"px\",e.style.marginRight=\"0px\"):\"right\"==n?(e.style.marginRight=r+\"px\",e.style.marginLeft=\"0px\"):(e.style.marginLeft=r+\"px\",e.style.marginRight=r+\"px\")},_setBorder:function(e,t,i){var r=this._borderSize(t),n=\"top\"==i?this._whichSideTop():this._whichSideBottom();\"left\"==n?(e.style.borderLeftWidth=r+\"px\",e.style.borderRightWidth=\"0px\"):\"right\"==n?(e.style.borderRightWidth=r+\"px\",e.style.borderLeftWidth=\"0px\"):(e.style.borderLeftWidth=r+\"px\",e.style.borderRightWidth=r+\"px\"),0!=this.options.border&&(e.style.borderLeftWidth=r+\"px\",e.style.borderRightWidth=r+\"px\")},_marginSize:function(e){if(this._isTransparent())return 0;var t=[5,3,2,1],i=[3,2,1,0],r=[2,1],n=[1,0];return this.options.compact&&this.options.blend?n[e]:this.options.compact?r[e]:this.options.blend?i[e]:t[e]},_borderSize:function(e){var t=[5,3,2,1],i=[2,1,1,1],r=[1,0],n=[0,2,0,0];return this.options.compact&&(this.options.blend||this._isTransparent())?1:this.options.compact?r[e]:this.options.blend?i[e]:this.options.border?n[e]:this._isTransparent()?t[e]:0},_hasString:function(e){\nfor(var t=1;t<arguments.length;t++)if(e.indexOf(arguments[t])>=0)return!0;return!1},_blend:function(e,t){var i=OpenLayers.Rico.Color.createFromHex(e);return i.blend(OpenLayers.Rico.Color.createFromHex(t)),i},_background:function(e){try{return OpenLayers.Rico.Color.createColorFromBackground(e).asHex()}catch(e){return\"#ffffff\"}},_isTransparent:function(){return\"transparent\"==this.options.color},_isTopRounded:function(){return this._hasString(this.options.corners,\"all\",\"top\",\"tl\",\"tr\")},_isBottomRounded:function(){return this._hasString(this.options.corners,\"all\",\"bottom\",\"bl\",\"br\")},_hasSingleTextChild:function(e){return 1==e.childNodes.length&&3==e.childNodes[0].nodeType}},function(){if(!window.google||!google.gears){var e=null;if(\"undefined\"!=typeof GearsFactory)e=new GearsFactory;else try{e=new ActiveXObject(\"Gears.Factory\"),e.getBuildInfo().indexOf(\"ie_mobile\")!=-1&&e.privateSetGlobalObject(this)}catch(t){void 0!==navigator.mimeTypes&&navigator.mimeTypes[\"application/x-googlegears\"]&&(e=document.createElement(\"object\"),e.style.display=\"none\",e.width=0,e.height=0,e.type=\"application/x-googlegears\",document.documentElement.appendChild(e))}e&&(window.google||(google={}),google.gears||(google.gears={factory:e}))}}(),OpenLayers.Element={visible:function(e){return\"none\"!=OpenLayers.Util.getElement(e).style.display},toggle:function(){for(var e=0,t=arguments.length;e<t;e++){var i=OpenLayers.Util.getElement(arguments[e]),r=OpenLayers.Element.visible(i)?\"hide\":\"show\";OpenLayers.Element[r](i)}},hide:function(){for(var e=0,t=arguments.length;e<t;e++){OpenLayers.Util.getElement(arguments[e]).style.display=\"none\"}},show:function(){for(var e=0,t=arguments.length;e<t;e++){OpenLayers.Util.getElement(arguments[e]).style.display=\"\"}},remove:function(e){e=OpenLayers.Util.getElement(e),e.parentNode.removeChild(e)},getHeight:function(e){return e=OpenLayers.Util.getElement(e),e.offsetHeight},getDimensions:function(e){if(e=OpenLayers.Util.getElement(e),\"none\"!=OpenLayers.Element.getStyle(e,\"display\"))return{width:e.offsetWidth,height:e.offsetHeight};var t=e.style,i=t.visibility,r=t.position;t.visibility=\"hidden\",t.position=\"absolute\",t.display=\"\";var n=e.clientWidth,s=e.clientHeight;return t.display=\"none\",t.position=r,t.visibility=i,{width:n,height:s}},hasClass:function(e,t){var i=e.className;return!!i&&new RegExp(\"(^|\\\\s)\"+t+\"(\\\\s|$)\").test(i)},addClass:function(e,t){return OpenLayers.Element.hasClass(e,t)||(e.className+=(e.className?\" \":\"\")+t),e},removeClass:function(e,t){var i=e.className;return i&&(e.className=OpenLayers.String.trim(i.replace(new RegExp(\"(^|\\\\s+)\"+t+\"(\\\\s+|$)\"),\" \"))),e},toggleClass:function(e,t){return OpenLayers.Element.hasClass(e,t)?OpenLayers.Element.removeClass(e,t):OpenLayers.Element.addClass(e,t),e},getStyle:function(e,t){e=OpenLayers.Util.getElement(e);var i=null;if(e&&e.style){if(!(i=e.style[OpenLayers.String.camelize(t)]))if(document.defaultView&&document.defaultView.getComputedStyle){var r=document.defaultView.getComputedStyle(e,null);i=r?r.getPropertyValue(t):null}else e.currentStyle&&(i=e.currentStyle[OpenLayers.String.camelize(t)]);var n=[\"left\",\"top\",\"right\",\"bottom\"];window.opera&&OpenLayers.Util.indexOf(n,t)!=-1&&\"static\"==OpenLayers.Element.getStyle(e,\"position\")&&(i=\"auto\")}return\"auto\"==i?null:i}},OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(e,t){this.w=parseFloat(e),this.h=parseFloat(t)},toString:function(){return\"w=\"+this.w+\",h=\"+this.h},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(e){var t=!1;return null!=e&&(t=this.w==e.w&&this.h==e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t},CLASS_NAME:\"OpenLayers.Size\"}),OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(e){alert(e)},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 e=document.getElementsByTagName(\"script\"),t=0,i=e.length;t<i;++t)if(e[t].src.indexOf(\"firebug.js\")!=-1&&console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}(),OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(e,t,i,r){this.url=e,this.size=t?t:new OpenLayers.Size(20,20),this.offset=i?i:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2)),this.calculateOffset=r;var n=OpenLayers.Util.createUniqueID(\"OL_Icon_\");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(n)},destroy:function(){this.erase(),OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild),this.imageDiv.innerHTML=\"\",this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(e){null!=e&&(this.size=e),this.draw()},setUrl:function(e){null!=e&&(this.url=e),this.draw()},draw:function(e){return OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,\"absolute\"),this.moveTo(e),this.imageDiv},erase:function(){null!=this.imageDiv&&null!=this.imageDiv.parentNode&&OpenLayers.Element.remove(this.imageDiv)},setOpacity:function(e){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,e)},moveTo:function(e){if(null!=e&&(this.px=e),null!=this.imageDiv)if(null==this.px)this.display(!1);else{this.calculateOffset&&(this.offset=this.calculateOffset(this.size));var t=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,t)}},display:function(e){this.imageDiv.style.display=e?\"\":\"none\"},isDrawn:function(){return this.imageDiv&&this.imageDiv.parentNode&&11!=this.imageDiv.parentNode.nodeType},CLASS_NAME:\"OpenLayers.Icon\"}),OpenLayers.Popup=OpenLayers.Class({events:null,id:\"\",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:\"\",opacity:\"\",border:\"\",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:!1,minSize:null,maxSize:null,displayClass:\"olPopup\",contentDisplayClass:\"olPopupContent\",padding:0,disableFirefoxOverflowHack:!1,fixPadding:function(){\"number\"==typeof this.padding&&(this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding))},panMapIfOutOfView:!1,keepInMap:!1,closeOnMove:!1,map:null,initialize:function(e,t,i,r,n,s){null==e&&(e=OpenLayers.Util.createUniqueID(this.CLASS_NAME+\"_\")),this.id=e,this.lonlat=t,this.contentSize=null!=i?i:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT),null!=r&&(this.contentHTML=r),this.backgroundColor=OpenLayers.Popup.COLOR,this.opacity=OpenLayers.Popup.OPACITY,this.border=OpenLayers.Popup.BORDER,this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,\"hidden\"),this.div.className=this.displayClass;var a=this.id+\"_GroupDiv\";this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,\"relative\",null,\"hidden\");var e=this.div.id+\"_contentDiv\";this.contentDiv=OpenLayers.Util.createDiv(e,null,this.contentSize.clone(),null,\"relative\"),this.contentDiv.className=this.contentDisplayClass,this.groupDiv.appendChild(this.contentDiv),this.div.appendChild(this.groupDiv),n&&this.addCloseBox(s),this.registerEvents()},destroy:function(){this.id=null,this.lonlat=null,this.size=null,this.contentHTML=null,this.backgroundColor=null,this.opacity=null,this.border=null,this.closeOnMove&&this.map&&this.map.events.unregister(\"movestart\",this,this.hide),this.events.destroy(),this.events=null,this.closeDiv&&(OpenLayers.Event.stopObservingElement(this.closeDiv),this.groupDiv.removeChild(this.closeDiv)),this.closeDiv=null,this.div.removeChild(this.groupDiv),this.groupDiv=null,null!=this.map&&this.map.removePopup(this),this.map=null,this.div=null,this.autoSize=null,this.minSize=null,this.maxSize=null,this.padding=null,this.panMapIfOutOfView=null},draw:function(e){return null==e&&null!=this.lonlat&&null!=this.map&&(e=this.map.getLayerPxFromLonLat(this.lonlat)),this.closeOnMove&&this.map.events.register(\"movestart\",this,this.hide),this.disableFirefoxOverflowHack||\"firefox\"!=OpenLayers.Util.getBrowserName()||(this.map.events.register(\"movestart\",this,function(){var e=document.defaultView.getComputedStyle(this.contentDiv,null),t=e.getPropertyValue(\"overflow\");\"hidden\"!=t&&(this.contentDiv._oldOverflow=t,this.contentDiv.style.overflow=\"hidden\")}),this.map.events.register(\"moveend\",this,function(){var e=this.contentDiv._oldOverflow;e&&(this.contentDiv.style.overflow=e,this.contentDiv._oldOverflow=null)})),this.moveTo(e),this.autoSize||this.size||this.setSize(this.contentSize),this.setBackgroundColor(),this.setOpacity(),this.setBorder(),this.setContentHTML(),this.panMapIfOutOfView&&this.panIntoView(),this.div},updatePosition:function(){if(this.lonlat&&this.map){var e=this.map.getLayerPxFromLonLat(this.lonlat);e&&this.moveTo(e)}},moveTo:function(e){null!=e&&null!=this.div&&(this.div.style.left=e.x+\"px\",this.div.style.top=e.y+\"px\")},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){this.visible()?this.hide():this.show()},show:function(){OpenLayers.Element.show(this.div),this.panMapIfOutOfView&&this.panIntoView()},hide:function(){OpenLayers.Element.hide(this.div)},setSize:function(e){this.size=e.clone();var t=this.getContentDivPadding(),i=t.left+t.right,r=t.top+t.bottom;if(this.fixPadding(),i+=this.padding.left+this.padding.right,r+=this.padding.top+this.padding.bottom,this.closeDiv){i+=parseInt(this.closeDiv.style.width)+t.right}this.size.w+=i,this.size.h+=r,\"msie\"==OpenLayers.Util.getBrowserName()&&(this.contentSize.w+=t.left+t.right,this.contentSize.h+=t.bottom+t.top),null!=this.div&&(this.div.style.width=this.size.w+\"px\",this.div.style.height=this.size.h+\"px\"),null!=this.contentDiv&&(this.contentDiv.style.width=e.w+\"px\",this.contentDiv.style.height=e.h+\"px\")},updateSize:function(){var e=\"<div class='\"+this.contentDisplayClass+\"'>\"+this.contentDiv.innerHTML+\"</div>\",t=this.map?this.map.layerContainerDiv:document.body,i=OpenLayers.Util.getRenderedDimensions(e,null,{displayClass:this.displayClass,containerElement:t}),r=this.getSafeContentSize(i),n=null;if(r.equals(i))n=i;else{var s=new OpenLayers.Size;if(s.w=r.w<i.w?r.w:null,s.h=r.h<i.h?r.h:null,s.w&&s.h)n=r;else{var a=OpenLayers.Util.getRenderedDimensions(e,s,{displayClass:this.contentDisplayClass,containerElement:t});if(\"hidden\"!=OpenLayers.Element.getStyle(this.contentDiv,\"overflow\")&&a.equals(r)){var o=OpenLayers.Util.getScrollbarWidth();s.w?a.h+=o:a.w+=o}n=this.getSafeContentSize(a)}}this.setSize(n)},setBackgroundColor:function(e){void 0!=e&&(this.backgroundColor=e),null!=this.div&&(this.div.style.backgroundColor=this.backgroundColor)},setOpacity:function(e){void 0!=e&&(this.opacity=e),null!=this.div&&(this.div.style.opacity=this.opacity,this.div.style.filter=\"alpha(opacity=\"+100*this.opacity+\")\")},setBorder:function(e){void 0!=e&&(this.border=e),null!=this.div&&(this.div.style.border=this.border)},setContentHTML:function(e){null!=e&&(this.contentHTML=e),null!=this.contentDiv&&null!=this.contentHTML&&this.contentHTML!=this.contentDiv.innerHTML&&(this.contentDiv.innerHTML=this.contentHTML,this.autoSize&&(this.registerImageListeners(),this.updateSize()))},registerImageListeners:function(){for(var e=function(){this.popup.updateSize(),this.popup.visible()&&this.popup.panMapIfOutOfView&&this.popup.panIntoView(),OpenLayers.Event.stopObserving(this.img,\"load\",this.img._onImageLoad)},t=this.contentDiv.getElementsByTagName(\"img\"),i=0,r=t.length;i<r;i++){var n=t[i];if(0==n.width||0==n.height){var s={popup:this,img:n};n._onImgLoad=OpenLayers.Function.bind(e,s),OpenLayers.Event.observe(n,\"load\",n._onImgLoad)}}},getSafeContentSize:function(e){var t=e.clone(),i=this.getContentDivPadding(),r=i.left+i.right,n=i.top+i.bottom;if(this.fixPadding(),r+=this.padding.left+this.padding.right,n+=this.padding.top+this.padding.bottom,this.closeDiv){r+=parseInt(this.closeDiv.style.width)+i.right}if(this.minSize&&(t.w=Math.max(t.w,this.minSize.w-r),t.h=Math.max(t.h,this.minSize.h-n)),this.maxSize&&(t.w=Math.min(t.w,this.maxSize.w-r),t.h=Math.min(t.h,this.maxSize.h-n)),this.map&&this.map.size){var s=0,a=0;if(this.keepInMap&&!this.panMapIfOutOfView){var o=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case\"tr\":s=o.x,a=this.map.size.h-o.y;break;case\"tl\":s=this.map.size.w-o.x,a=this.map.size.h-o.y;break;case\"bl\":s=this.map.size.w-o.x,a=o.y;break;case\"br\":s=o.x,a=o.y;break;default:s=o.x,a=this.map.size.h-o.y}}var l=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-n-a,p=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-r-s;t.w=Math.min(t.w,p),t.h=Math.min(t.h,l)}return t},getContentDivPadding:function(){var e=this._contentDivPadding;return e||(null==this.div.parentNode&&(this.div.style.display=\"none\",document.body.appendChild(this.div)),e=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,\"padding-left\"),OpenLayers.Element.getStyle(this.contentDiv,\"padding-bottom\"),OpenLayers.Element.getStyle(this.contentDiv,\"padding-right\"),OpenLayers.Element.getStyle(this.contentDiv,\"padding-top\")),this._contentDivPadding=e,this.div.parentNode==document.body&&(document.body.removeChild(this.div),this.div.style.display=\"\")),e},addCloseBox:function(e){this.closeDiv=OpenLayers.Util.createDiv(this.id+\"_close\",null,new OpenLayers.Size(17,17)),this.closeDiv.className=\"olPopupCloseBox\";var t=this.getContentDivPadding();this.closeDiv.style.right=t.right+\"px\",this.closeDiv.style.top=t.top+\"px\",this.groupDiv.appendChild(this.closeDiv);var i=e||function(e){this.hide(),OpenLayers.Event.stop(e)};OpenLayers.Event.observe(this.closeDiv,\"click\",OpenLayers.Function.bindAsEventListener(i,this))},panIntoView:function(){var e=this.map.getSize(),t=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top))),i=t.clone();t.x<this.map.paddingForPopups.left?i.x=this.map.paddingForPopups.left:t.x+this.size.w>e.w-this.map.paddingForPopups.right&&(i.x=e.w-this.map.paddingForPopups.right-this.size.w),t.y<this.map.paddingForPopups.top?i.y=this.map.paddingForPopups.top:t.y+this.size.h>e.h-this.map.paddingForPopups.bottom&&(i.y=e.h-this.map.paddingForPopups.bottom-this.size.h);var r=t.x-i.x,n=t.y-i.y;this.map.pan(r,n)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,!0),this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})},onmousedown:function(e){this.mousedown=!0,OpenLayers.Event.stop(e,!0)},onmousemove:function(e){this.mousedown&&OpenLayers.Event.stop(e,!0)},onmouseup:function(e){this.mousedown&&(this.mousedown=!1,OpenLayers.Event.stop(e,!0))},onclick:function(e){OpenLayers.Event.stop(e,!0)},onmouseout:function(e){this.mousedown=!1},ondblclick:function(e){OpenLayers.Event.stop(e,!0)},CLASS_NAME:\"OpenLayers.Popup\"}),OpenLayers.Popup.WIDTH=200,OpenLayers.Popup.HEIGHT=200,OpenLayers.Popup.COLOR=\"white\",OpenLayers.Popup.OPACITY=1,OpenLayers.Popup.BORDER=\"0px\",OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:!0,initialize:function(e){e=e||{},OpenLayers.Util.extend(this,e),this.options=e},destroy:function(){this.options=null,this.format=null},read:function(){},create:function(){},update:function(){},delete:function(){},commit:function(){},abort:function(e){},CLASS_NAME:\"OpenLayers.Protocol\"}),OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:!0,features:null,reqFeatures:null,priv:null,initialize:function(e){OpenLayers.Util.extend(this,e)},success:function(){return this.code>0},CLASS_NAME:\"OpenLayers.Protocol.Response\"}),OpenLayers.Protocol.Response.SUCCESS=1,OpenLayers.Protocol.Response.FAILURE=0,OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:!1,size:null,resolution:null,map:null,initialize:function(e,t){this.container=OpenLayers.Util.getElement(e)},destroy:function(){this.container=null,this.extent=null,this.size=null,this.resolution=null,this.map=null},supported:function(){return!1},setExtent:function(e,t){this.extent=e.clone(),t&&(this.resolution=null)},setSize:function(e){this.size=e.clone(),this.resolution=null},getResolution:function(){return this.resolution=this.resolution||this.map.getResolution(),this.resolution},drawFeature:function(e,t){if(null==t&&(t=e.style),e.geometry){var i=e.geometry.getBounds();if(i){i.intersectsBounds(this.extent)||(t={display:\"none\"});var r=this.drawGeometry(e.geometry,t,e.id);return\"none\"!=t.display&&t.label&&r!==!1?this.drawText(e.id,t,e.geometry.getCentroid()):this.removeText(e.id),r}}},drawGeometry:function(e,t,i){},drawText:function(e,t,i){},removeText:function(e){},clear:function(){},getFeatureIdFromEvent:function(e){},eraseFeatures:function(e){e instanceof Array||(e=[e]);for(var t=0,i=e.length;t<i;++t)this.eraseGeometry(e[t].geometry),this.removeText(e[t].id)},eraseGeometry:function(e){},moveRoot:function(e){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:\"OpenLayers.Renderer\"}),OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:!0,autoDestroy:!0,initialize:function(e){OpenLayers.Util.extend(this,e),this.options=e,this.active=!1},destroy:function(){this.deactivate(),this.layer=null,this.options=null},setLayer:function(e){this.layer=e},activate:function(){return!this.active&&(this.active=!0,!0)},deactivate:function(){return!!this.active&&(this.active=!1,!0)},CLASS_NAME:\"OpenLayers.Strategy\"}),OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(e,t,i){this.rgb={r:e,g:t,b:i}},setRed:function(e){this.rgb.r=e},setGreen:function(e){this.rgb.g=e},setBlue:function(e){this.rgb.b=e},setHue:function(e){var t=this.asHSB();t.h=e,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setSaturation:function(e){var t=this.asHSB();t.s=e,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setBrightness:function(e){var t=this.asHSB();t.b=e,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},darken:function(e){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.max(t.b-e,0))},brighten:function(e){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.min(t.b+e,1))},blend:function(e){this.rgb.r=Math.floor((this.rgb.r+e.rgb.r)/2),this.rgb.g=Math.floor((this.rgb.g+e.rgb.g)/2),this.rgb.b=Math.floor((this.rgb.b+e.rgb.b)/2)},isBright:function(){this.asHSB();return this.asHSB().b>.5},isDark:function(){return!this.isBright()},asRGB:function(){return\"rgb(\"+this.rgb.r+\",\"+this.rgb.g+\",\"+this.rgb.b+\")\"},asHex:function(){return\"#\"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}}),OpenLayers.Rico.Color.createFromHex=function(e){if(4==e.length)for(var t=e,e=\"#\",i=1;i<4;i++)e+=t.charAt(i)+t.charAt(i);0==e.indexOf(\"#\")&&(e=e.substring(1));var r=e.substring(0,2),n=e.substring(2,4),s=e.substring(4,6);return new OpenLayers.Rico.Color(parseInt(r,16),parseInt(n,16),parseInt(s,16))},OpenLayers.Rico.Color.createColorFromBackground=function(e){var t=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(e),\"backgroundColor\",\"background-color\");if(\"transparent\"==t&&e.parentNode)return OpenLayers.Rico.Color.createColorFromBackground(e.parentNode);if(null==t)return new OpenLayers.Rico.Color(255,255,255);if(0==t.indexOf(\"rgb(\")){var i=t.substring(4,t.length-1),r=i.split(\",\");return new OpenLayers.Rico.Color(parseInt(r[0]),parseInt(r[1]),parseInt(r[2]))}return 0==t.indexOf(\"#\")?OpenLayers.Rico.Color.createFromHex(t):new OpenLayers.Rico.Color(255,255,255)},OpenLayers.Rico.Color.HSBtoRGB=function(e,t,i){var r=0,n=0,s=0;if(0==t)r=parseInt(255*i+.5),n=r,s=r;else{var a=6*(e-Math.floor(e)),o=a-Math.floor(a),l=i*(1-t),p=i*(1-t*o),h=i*(1-t*(1-o));switch(parseInt(a)){case 0:r=255*i+.5,n=255*h+.5,s=255*l+.5;break;case 1:r=255*p+.5,n=255*i+.5,s=255*l+.5;break;case 2:r=255*l+.5,n=255*i+.5,s=255*h+.5;break;case 3:r=255*l+.5,n=255*p+.5,s=255*i+.5;break;case 4:r=255*h+.5,n=255*l+.5,s=255*i+.5;break;case 5:r=255*i+.5,n=255*l+.5,s=255*p+.5}}return{r:parseInt(r),g:parseInt(n),b:parseInt(s)}},OpenLayers.Rico.Color.RGBtoHSB=function(e,t,i){var r,n,s,a=e>t?e:t;i>a&&(a=i);var o=e<t?e:t;if(i<o&&(o=i),s=a/255,0==(n=0!=a?(a-o)/a:0))r=0;else{var l=(a-e)/(a-o),p=(a-t)/(a-o),h=(a-i)/(a-o);r=e==a?h-p:t==a?2+l-h:4+p-l,r/=6,r<0&&(r+=1)}return{h:r,s:n,b:s}},OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(e,t,i,r){null!=e&&(this.left=OpenLayers.Util.toFloat(e)),null!=t&&(this.bottom=OpenLayers.Util.toFloat(t)),null!=i&&(this.right=OpenLayers.Util.toFloat(i)),null!=r&&(this.top=OpenLayers.Util.toFloat(r))},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(e){var t=!1;return null!=e&&(t=this.left==e.left&&this.right==e.right&&this.top==e.top&&this.bottom==e.bottom),t},toString:function(){return\"left-bottom=(\"+this.left+\",\"+this.bottom+\") right-top=(\"+this.right+\",\"+this.top+\")\"},toArray:function(){return[this.left,this.bottom,this.right,this.top]},toBBOX:function(e){null==e&&(e=6);var t=Math.pow(10,e);return Math.round(this.left*t)/t+\",\"+Math.round(this.bottom*t)/t+\",\"+Math.round(this.right*t)/t+\",\"+Math.round(this.top*t)/t},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return this.right-this.left},getHeight:function(){return this.top-this.bottom},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){return this.centerLonLat||(this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat},scale:function(e,t){null==t&&(t=this.getCenterLonLat());var i,r;\"OpenLayers.LonLat\"==t.CLASS_NAME?(i=t.lon,r=t.lat):(i=t.x,r=t.y);var n=(this.left-i)*e+i,s=(this.bottom-r)*e+r,a=(this.right-i)*e+i,o=(this.top-r)*e+r;return new OpenLayers.Bounds(n,s,a,o)},add:function(e,t){if(null==e||null==t){var i=OpenLayers.i18n(\"boundsAddError\");return OpenLayers.Console.error(i),null}return new OpenLayers.Bounds(this.left+e,this.bottom+t,this.right+e,this.top+t)},extend:function(e){var t=null;if(e){switch(e.CLASS_NAME){case\"OpenLayers.LonLat\":t=new OpenLayers.Bounds(e.lon,e.lat,e.lon,e.lat);break;case\"OpenLayers.Geometry.Point\":t=new OpenLayers.Bounds(e.x,e.y,e.x,e.y);break;case\"OpenLayers.Bounds\":t=e}t&&(this.centerLonLat=null,(null==this.left||t.left<this.left)&&(this.left=t.left),(null==this.bottom||t.bottom<this.bottom)&&(this.bottom=t.bottom),(null==this.right||t.right>this.right)&&(this.right=t.right),(null==this.top||t.top>this.top)&&(this.top=t.top))}},containsLonLat:function(e,t){return this.contains(e.lon,e.lat,t)},containsPixel:function(e,t){return this.contains(e.x,e.y,t)},contains:function(e,t,i){if(null==i&&(i=!0),null==e||null==t)return!1;e=OpenLayers.Util.toFloat(e),t=OpenLayers.Util.toFloat(t);return i?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&e<this.right&&t>this.bottom&&t<this.top},intersectsBounds:function(e,t){null==t&&(t=!0);var i=!1,r=this.left==e.right||this.right==e.left||this.top==e.bottom||this.bottom==e.top;if(t||!r){var n=e.bottom>=this.bottom&&e.bottom<=this.top||this.bottom>=e.bottom&&this.bottom<=e.top,s=e.top>=this.bottom&&e.top<=this.top||this.top>e.bottom&&this.top<e.top,a=e.left>=this.left&&e.left<=this.right||this.left>=e.left&&this.left<=e.right,o=e.right>=this.left&&e.right<=this.right||this.right>=e.left&&this.right<=e.right;i=(n||s)&&(a||o)}return i},containsBounds:function(e,t,i){null==t&&(t=!1),null==i&&(i=!0);var r=this.contains(e.left,e.bottom,i),n=this.contains(e.right,e.bottom,i),s=this.contains(e.left,e.top,i),a=this.contains(e.right,e.top,i);return t?r||n||s||a:r&&n&&s&&a},determineQuadrant:function(e){var t=\"\",i=this.getCenterLonLat();return t+=e.lat<i.lat?\"b\":\"t\",t+=e.lon<i.lon?\"l\":\"r\"},transform:function(e,t){this.centerLonLat=null;var i=OpenLayers.Projection.transform({x:this.left,y:this.bottom},e,t),r=OpenLayers.Projection.transform({x:this.right,y:this.bottom},e,t),n=OpenLayers.Projection.transform({x:this.left,y:this.top},e,t),s=OpenLayers.Projection.transform({x:this.right,y:this.top},e,t);return this.left=Math.min(i.x,n.x),this.bottom=Math.min(i.y,r.y),this.right=Math.max(r.x,s.x),this.top=Math.max(n.y,s.y),this},wrapDateLine:function(e,t){t=t||{};var i=t.leftTolerance||0,r=t.rightTolerance||0,n=this.clone();if(e){for(;n.left<e.left&&n.right-r<=e.left;)n=n.add(e.getWidth(),0);for(;n.left+i>=e.right&&n.right>e.right;)n=n.add(-e.getWidth(),0)}return n},CLASS_NAME:\"OpenLayers.Bounds\"}),OpenLayers.Bounds.fromString=function(e){var t=e.split(\",\");return OpenLayers.Bounds.fromArray(t)},OpenLayers.Bounds.fromArray=function(e){return new OpenLayers.Bounds(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]))},OpenLayers.Bounds.fromSize=function(e){return new OpenLayers.Bounds(0,e.h,e.w,0)},OpenLayers.Bounds.oppositeQuadrant=function(e){var t=\"\";return t+=\"t\"==e.charAt(0)?\"b\":\"t\",t+=\"l\"==e.charAt(1)?\"r\":\"l\"},OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(e,t){this.lon=OpenLayers.Util.toFloat(e),this.lat=OpenLayers.Util.toFloat(t)},toString:function(){return\"lon=\"+this.lon+\",lat=\"+this.lat},toShortString:function(){return this.lon+\", \"+this.lat},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(e,t){if(null==e||null==t){var i=OpenLayers.i18n(\"lonlatAddError\");return OpenLayers.Console.error(i),null}return new OpenLayers.LonLat(this.lon+e,this.lat+t)},equals:function(e){var t=!1;return null!=e&&(t=this.lon==e.lon&&this.lat==e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t},transform:function(e,t){var i=OpenLayers.Projection.transform({x:this.lon,y:this.lat},e,t);return this.lon=i.x,this.lat=i.y,this},wrapDateLine:function(e){var t=this.clone();if(e){for(;t.lon<e.left;)t.lon+=e.getWidth();for(;t.lon>e.right;)t.lon-=e.getWidth()}return t},CLASS_NAME:\"OpenLayers.LonLat\"}),OpenLayers.LonLat.fromString=function(e){var t=e.split(\",\");return new OpenLayers.LonLat(parseFloat(t[0]),parseFloat(t[1]))},OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(e,t){this.x=parseFloat(e),this.y=parseFloat(t)},toString:function(){return\"x=\"+this.x+\",y=\"+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t},add:function(e,t){if(null==e||null==t){var i=OpenLayers.i18n(\"pixelAddError\");return OpenLayers.Console.error(i),null}return new OpenLayers.Pixel(this.x+e,this.y+t)},offset:function(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t},CLASS_NAME:\"OpenLayers.Pixel\"}),OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:!1,displayClass:\"\",title:\"\",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:[\"activate\",\"deactivate\"],initialize:function(e){this.displayClass=this.CLASS_NAME.replace(\"OpenLayers.\",\"ol\").replace(/\\./g,\"\"),OpenLayers.Util.extend(this,e),this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES),this.eventListeners instanceof Object&&this.events.on(this.eventListeners),null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+\"_\"))},destroy:function(){if(this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=null),this.eventListeners=null,this.handler&&(this.handler.destroy(),this.handler=null),this.handlers){for(var e in this.handlers)this.handlers.hasOwnProperty(e)&&\"function\"==typeof this.handlers[e].destroy&&this.handlers[e].destroy();this.handlers=null}this.map&&(this.map.removeControl(this),this.map=null)},setMap:function(e){this.map=e,this.handler&&this.handler.setMap(e)},draw:function(e){return null==this.div&&(this.div=OpenLayers.Util.createDiv(this.id),this.div.className=this.displayClass,this.allowSelection||(this.div.className+=\" olControlNoSelect\",this.div.setAttribute(\"unselectable\",\"on\",0),this.div.onselectstart=function(){return!1}),\"\"!=this.title&&(this.div.title=this.title)),null!=e&&(this.position=e.clone()),this.moveTo(this.position),this.div},moveTo:function(e){null!=e&&null!=this.div&&(this.div.style.left=e.x+\"px\",this.div.style.top=e.y+\"px\")},activate:function(){return!this.active&&(this.handler&&this.handler.activate(),this.active=!0,this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,\"\")+\"Active\"),this.events.triggerEvent(\"activate\"),!0)},deactivate:function(){return!!this.active&&(this.handler&&this.handler.deactivate(),this.active=!1,this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,\"\")+\"Active\"),this.events.triggerEvent(\"deactivate\"),!0)},CLASS_NAME:\"OpenLayers.Control\"}),OpenLayers.Control.TYPE_BUTTON=1,OpenLayers.Control.TYPE_TOGGLE=2,OpenLayers.Control.TYPE_TOOL=3,OpenLayers.Lang={code:null,defaultCode:\"en\",getCode:function(){return OpenLayers.Lang.code||OpenLayers.Lang.setCode(),OpenLayers.Lang.code},setCode:function(e){var t;e||(e=\"msie\"==OpenLayers.Util.getBrowserName()?navigator.userLanguage:navigator.language);var i=e.split(\"-\");if(i[0]=i[0].toLowerCase(),\"object\"==typeof OpenLayers.Lang[i[0]]&&(t=i[0]),i[1]){var r=i[0]+\"-\"+i[1].toUpperCase();\"object\"==typeof OpenLayers.Lang[r]&&(t=r)}t||(OpenLayers.Console.warn(\"Failed to find OpenLayers.Lang.\"+i.join(\"-\")+\" dictionary, falling back to default language\"),t=OpenLayers.Lang.defaultCode),OpenLayers.Lang.code=t},translate:function(e,t){var i=OpenLayers.Lang[OpenLayers.Lang.getCode()],r=i[e];return r||(r=e),t&&(r=OpenLayers.String.format(r,t)),r}},OpenLayers.i18n=OpenLayers.Lang.translate,OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:!0,anchor:null,initialize:function(e,t,i,r,n,s,a){var o=[e,t,i,r,s,a];OpenLayers.Popup.prototype.initialize.apply(this,o),this.anchor=null!=n?n:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null,this.relativePosition=null,OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition(),OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(e){var t=this.relativePosition;this.relativePosition=this.calculateRelativePosition(e);var i=this.calculateNewPx(e),r=new Array(i);OpenLayers.Popup.prototype.moveTo.apply(this,r),this.relativePosition!=t&&this.updateRelativePosition()},setSize:function(e){if(OpenLayers.Popup.prototype.setSize.apply(this,arguments),this.lonlat&&this.map){var t=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(t)}},calculateRelativePosition:function(e){var t=this.map.getLonLatFromLayerPx(e),i=this.map.getExtent(),r=i.determineQuadrant(t);return OpenLayers.Bounds.oppositeQuadrant(r)},updateRelativePosition:function(){},calculateNewPx:function(e){var t=e.offset(this.anchor.offset),i=this.size||this.contentSize,r=\"t\"==this.relativePosition.charAt(0);t.y+=r?-i.h:this.anchor.size.h;var n=\"l\"==this.relativePosition.charAt(1);return t.x+=n?-i.w:this.anchor.size.w,t},CLASS_NAME:\"OpenLayers.Popup.Anchored\"}),OpenLayers.Protocol.SQL=OpenLayers.Class(OpenLayers.Protocol,{databaseName:\"ol\",tableName:\"ol_vector_features\",postReadFiltering:!0,initialize:function(e){OpenLayers.Protocol.prototype.initialize.apply(this,[e])},destroy:function(){OpenLayers.Protocol.prototype.destroy.apply(this)},supported:function(){return!1},evaluateFilter:function(e,t){\nreturn!t||!this.postReadFiltering||t.evaluate(e)},CLASS_NAME:\"OpenLayers.Protocol.SQL\"}),OpenLayers.Protocol.WFS=function(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Protocol.WFS.DEFAULTS);var t=OpenLayers.Protocol.WFS[\"v\"+e.version.replace(/\\./g,\"_\")];if(!t)throw\"Unsupported WFS version: \"+e.version;return new t(e)},OpenLayers.Protocol.WFS.fromWMSLayer=function(e,t){var i,r,n=e.params.LAYERS,s=(n instanceof Array?n[0]:n).split(\":\");s.length>1&&(r=s[0]),i=s.pop();var a={url:e.url,featureType:i,featurePrefix:r,srsName:e.projection&&e.projection.getCode()||e.map&&e.map.getProjectionObject().getCode(),version:\"1.1.0\"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(t,a))},OpenLayers.Protocol.WFS.DEFAULTS={version:\"1.0.0\"},OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,geometryMap:null,initialize:function(e){OpenLayers.Renderer.prototype.initialize.apply(this,arguments),this.root=document.createElement(\"canvas\"),this.container.appendChild(this.root),this.canvas=this.root.getContext(\"2d\"),this.features={},this.geometryMap={}},eraseGeometry:function(e){this.eraseFeatures(this.features[this.geometryMap[e.id]][0])},supported:function(){return!!document.createElement(\"canvas\").getContext},setExtent:function(e){this.extent=e.clone(),this.resolution=null,this.redraw()},setSize:function(e){this.size=e.clone(),this.root.style.width=e.w+\"px\",this.root.style.height=e.h+\"px\",this.root.width=e.w,this.root.height=e.h,this.resolution=null},drawFeature:function(e,t){null==t&&(t=e.style),t=OpenLayers.Util.extend({fillColor:\"#000000\",strokeColor:\"#000000\",strokeWidth:2,fillOpacity:1,strokeOpacity:1},t),this.features[e.id]=[e,t],e.geometry&&(this.geometryMap[e.geometry.id]=e.id),this.redraw()},drawGeometry:function(e,t){var i=e.CLASS_NAME;if(\"OpenLayers.Geometry.Collection\"!=i&&\"OpenLayers.Geometry.MultiPoint\"!=i&&\"OpenLayers.Geometry.MultiLineString\"!=i&&\"OpenLayers.Geometry.MultiPolygon\"!=i)switch(e.CLASS_NAME){case\"OpenLayers.Geometry.Point\":this.drawPoint(e,t);break;case\"OpenLayers.Geometry.LineString\":this.drawLineString(e,t);break;case\"OpenLayers.Geometry.LinearRing\":this.drawLinearRing(e,t);break;case\"OpenLayers.Geometry.Polygon\":this.drawPolygon(e,t)}else for(var r=0;r<e.components.length;r++)this.drawGeometry(e.components[r],t)},drawExternalGraphic:function(e,t){var i=new Image;i.src=t.externalGraphic,t.graphicTitle&&(i.title=t.graphicTitle);var r=t.graphicWidth||t.graphicHeight,n=t.graphicHeight||t.graphicWidth;r=r?r:2*t.pointRadius,n=n?n:2*t.pointRadius;var s=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*r),a=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*n),o=(t.graphicOpacity||t.fillOpacity,{img:i,x:e[0]+s,y:e[1]+a,width:r,height:n,canvas:this.canvas});i.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},o)},setCanvasStyle:function(e,t){\"fill\"==e?(this.canvas.globalAlpha=t.fillOpacity,this.canvas.fillStyle=t.fillColor):\"stroke\"==e?(this.canvas.globalAlpha=t.strokeOpacity,this.canvas.strokeStyle=t.strokeColor,this.canvas.lineWidth=t.strokeWidth):(this.canvas.globalAlpha=0,this.canvas.lineWidth=1)},drawPoint:function(e,t){if(t.graphic!==!1){var i=this.getLocalXY(e);t.externalGraphic?this.drawExternalGraphic(i,t):(t.fill!==!1&&(this.setCanvasStyle(\"fill\",t),this.canvas.beginPath(),this.canvas.arc(i[0],i[1],6,0,2*Math.PI,!0),this.canvas.fill()),t.stroke!==!1&&(this.setCanvasStyle(\"stroke\",t),this.canvas.beginPath(),this.canvas.arc(i[0],i[1],6,0,2*Math.PI,!0),this.canvas.stroke(),this.setCanvasStyle(\"reset\")))}},drawLineString:function(e,t){if(t.stroke!==!1){this.setCanvasStyle(\"stroke\",t),this.canvas.beginPath();var i=this.getLocalXY(e.components[0]);this.canvas.moveTo(i[0],i[1]);for(var r=1;r<e.components.length;r++){var n=this.getLocalXY(e.components[r]);this.canvas.lineTo(n[0],n[1])}this.canvas.stroke()}this.setCanvasStyle(\"reset\")},drawLinearRing:function(e,t){if(t.fill!==!1){this.setCanvasStyle(\"fill\",t),this.canvas.beginPath();var i=this.getLocalXY(e.components[0]);this.canvas.moveTo(i[0],i[1]);for(var r=1;r<e.components.length-1;r++){var n=this.getLocalXY(e.components[r]);this.canvas.lineTo(n[0],n[1])}this.canvas.fill()}if(t.stroke!==!1){this.canvas.lineWidth;this.setCanvasStyle(\"stroke\",t),this.canvas.beginPath();var i=this.getLocalXY(e.components[0]);this.canvas.moveTo(i[0],i[1]);for(var r=1;r<e.components.length;r++){var n=this.getLocalXY(e.components[r]);this.canvas.lineTo(n[0],n[1])}this.canvas.stroke()}this.setCanvasStyle(\"reset\")},drawPolygon:function(e,t){this.drawLinearRing(e.components[0],t);for(var i=1;i<e.components.length;i++)this.drawLinearRing(e.components[i],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:\"#000000\",fillColor:\"#000000\"})},drawText:function(e,t){t=OpenLayers.Util.extend({fontColor:\"#000000\",labelAlign:\"cm\"},t);var i=this.getLocalXY(e);this.setCanvasStyle(\"reset\"),this.canvas.fillStyle=t.fontColor,this.canvas.globalAlpha=1;var r=t.fontWeight+\" \"+t.fontSize+\" \"+t.fontFamily;if(this.canvas.fillText){var n=OpenLayers.Renderer.Canvas.LABEL_ALIGN[t.labelAlign[0]]||\"middle\";this.canvas.font=r,this.canvas.textAlign=n,this.canvas.fillText(t.label,i[0],i[1])}else if(this.canvas.mozDrawText){this.canvas.mozTextStyle=r;var s=this.canvas.mozMeasureText(t.label);switch(t.labelAlign[0]){case\"l\":break;case\"r\":i[0]-=s;break;case\"c\":default:i[0]-=s/2}this.canvas.translate(i[0],i[1]),this.canvas.mozDrawText(t.label),this.canvas.translate(-1*i[0],-1*i[1])}this.setCanvasStyle(\"reset\")},getLocalXY:function(e){var t=this.getResolution(),i=this.extent;return[e.x/t+-i.left/t,i.top/t-e.y/t]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(e){var t=this.map.getLonLatFromPixel(e.xy),i=this.getResolution(),r=new OpenLayers.Bounds(t.lon-5*i,t.lat-5*i,t.lon+5*i,t.lat+5*i),n=r.toGeometry();for(var s in this.features)if(this.features.hasOwnProperty(s)&&this.features[s][0].geometry.intersects(n))return s;return null},eraseFeatures:function(e){e instanceof Array||(e=[e]);for(var t=0;t<e.length;++t)delete this.features[e[t].id];this.redraw()},redraw:function(){if(!this.locked){this.clear();var e,t,i=[];for(var r in this.features)this.features.hasOwnProperty(r)&&(e=this.features[r][0],t=this.features[r][1],e.geometry&&(this.drawGeometry(e.geometry,t),t.label&&i.push([e,t])));for(var n,s=0;len=i.length,s<len;++s)n=i[s],this.drawText(n[0].geometry.getCentroid(),n[1])}},CLASS_NAME:\"OpenLayers.Renderer.Canvas\"}),OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:\"left\",r:\"right\"},OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(e){this.compare=e?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER,this.order=[],this.indices={},this.maxZIndex=0},insert:function(e){this.exists(e)&&this.remove(e);var t=e.id;this.determineZIndex(e);for(var i,r=-1,n=this.order.length;n-r>1;){i=parseInt((r+n)/2);this.compare(this,e,OpenLayers.Util.getElement(this.order[i]))>0?r=i:n=i}return this.order.splice(n,0,t),this.indices[t]=this.getZIndex(e),this.getNextElement(n)},remove:function(e){var t=e.id,i=OpenLayers.Util.indexOf(this.order,t);if(i>=0)if(this.order.splice(i,1),delete this.indices[t],this.order.length>0){var r=this.order[this.order.length-1];this.maxZIndex=this.indices[r]}else this.maxZIndex=0},clear:function(){this.order=[],this.indices={},this.maxZIndex=0},exists:function(e){return null!=this.indices[e.id]},getZIndex:function(e){return e._style.graphicZIndex},determineZIndex:function(e){var t=e._style.graphicZIndex;null==t?(t=this.maxZIndex,e._style.graphicZIndex=t):t>this.maxZIndex&&(this.maxZIndex=t)},getNextElement:function(e){var t=e+1;if(t<this.order.length){var i=OpenLayers.Util.getElement(this.order[t]);return void 0==i&&(i=this.getNextElement(t)),i}return null},CLASS_NAME:\"OpenLayers.ElementsIndexer\"}),OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(e,t,i){var r=e.getZIndex(t),n=0;if(i){n=r-e.getZIndex(i)}return n},Z_ORDER_DRAWING_ORDER:function(e,t,i){var r=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(e,t,i);return i&&0==r&&(r=1),r},Z_ORDER_Y_ORDER:function(e,t,i){var r=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(e,t,i);if(i&&0==r){var n=t._geometry.getBounds().bottom,s=i._geometry.getBounds().bottom,a=s-n;r=0==a?1:a}return r}},OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:\"_background\",LABEL_ID_SUFFIX:\"_label\",minimumSymbolizer:{strokeLinecap:\"round\",strokeOpacity:1,strokeDashstyle:\"solid\",fillOpacity:1,pointRadius:0},initialize:function(e,t){OpenLayers.Renderer.prototype.initialize.apply(this,arguments),this.rendererRoot=this.createRenderRoot(),this.root=this.createRoot(\"_root\"),this.vectorRoot=this.createRoot(\"_vroot\"),this.textRoot=this.createRoot(\"_troot\"),this.root.appendChild(this.vectorRoot),this.root.appendChild(this.textRoot),this.rendererRoot.appendChild(this.root),this.container.appendChild(this.rendererRoot),t&&(t.zIndexing||t.yOrdering)&&(this.indexer=new OpenLayers.ElementsIndexer(t.yOrdering))},destroy:function(){this.clear(),this.rendererRoot=null,this.root=null,this.xmlns=null,OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){if(this.vectorRoot)for(;this.vectorRoot.childNodes.length>0;)this.vectorRoot.removeChild(this.vectorRoot.firstChild);if(this.textRoot)for(;this.textRoot.childNodes.length>0;)this.textRoot.removeChild(this.textRoot.firstChild);this.indexer&&this.indexer.clear()},getNodeType:function(e,t){},drawGeometry:function(e,t,i){var r=e.CLASS_NAME,n=!0;if(\"OpenLayers.Geometry.Collection\"==r||\"OpenLayers.Geometry.MultiPoint\"==r||\"OpenLayers.Geometry.MultiLineString\"==r||\"OpenLayers.Geometry.MultiPolygon\"==r){for(var s=0,a=e.components.length;s<a;s++)n=this.drawGeometry(e.components[s],t,i)&&n;return n}if(n=!1,\"none\"!=t.display&&(t.backgroundGraphic&&this.redrawBackgroundNode(e.id,e,t,i),n=this.redrawNode(e.id,e,t,i)),0==n){var o=document.getElementById(e.id);o&&(o._style.backgroundGraphic&&o.parentNode.removeChild(document.getElementById(e.id+this.BACKGROUND_ID_SUFFIX)),o.parentNode.removeChild(o))}return n},redrawNode:function(e,t,i,r){var n=this.nodeFactory(e,this.getNodeType(t,i));n._featureId=r,n._geometry=t,n._geometryClass=t.CLASS_NAME,n._style=i;var s=this.drawGeometryNode(n,t,i);if(s===!1)return!1;if(n=s.node,this.indexer){var a=this.indexer.insert(n);a?this.vectorRoot.insertBefore(n,a):this.vectorRoot.appendChild(n)}else n.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(n);return this.postDraw(n),s.complete},redrawBackgroundNode:function(e,t,i,r){var n=OpenLayers.Util.extend({},i);return n.externalGraphic=n.backgroundGraphic,n.graphicXOffset=n.backgroundXOffset,n.graphicYOffset=n.backgroundYOffset,n.graphicZIndex=n.backgroundGraphicZIndex,n.graphicWidth=n.backgroundWidth||n.graphicWidth,n.graphicHeight=n.backgroundHeight||n.graphicHeight,n.backgroundGraphic=null,n.backgroundXOffset=null,n.backgroundYOffset=null,n.backgroundGraphicZIndex=null,this.redrawNode(e+this.BACKGROUND_ID_SUFFIX,t,n,null)},drawGeometryNode:function(e,t,i){i=i||e._style,OpenLayers.Util.applyDefaults(i,this.minimumSymbolizer);var r,n={isFilled:void 0===i.fill||i.fill,isStroked:void 0===i.stroke?!!i.strokeWidth:i.stroke};switch(t.CLASS_NAME){case\"OpenLayers.Geometry.Point\":i.graphic===!1&&(n.isFilled=!1,n.isStroked=!1),r=this.drawPoint(e,t);break;case\"OpenLayers.Geometry.LineString\":n.isFilled=!1,r=this.drawLineString(e,t);break;case\"OpenLayers.Geometry.LinearRing\":r=this.drawLinearRing(e,t);break;case\"OpenLayers.Geometry.Polygon\":r=this.drawPolygon(e,t);break;case\"OpenLayers.Geometry.Surface\":r=this.drawSurface(e,t);break;case\"OpenLayers.Geometry.Rectangle\":r=this.drawRectangle(e,t)}return e._style=i,e._options=n,0!=r&&{node:this.setStyle(e,i,n,t),complete:r}},postDraw:function(e){},drawPoint:function(e,t){},drawLineString:function(e,t){},drawLinearRing:function(e,t){},drawPolygon:function(e,t){},drawRectangle:function(e,t){},drawCircle:function(e,t){},drawSurface:function(e,t){},removeText:function(e){var t=document.getElementById(e+this.LABEL_ID_SUFFIX);t&&this.textRoot.removeChild(t)},getFeatureIdFromEvent:function(e){var t=e.target,i=t&&t.correspondingUseElement;return(i?i:t||e.srcElement)._featureId},eraseGeometry:function(e){if(\"OpenLayers.Geometry.MultiPoint\"==e.CLASS_NAME||\"OpenLayers.Geometry.MultiLineString\"==e.CLASS_NAME||\"OpenLayers.Geometry.MultiPolygon\"==e.CLASS_NAME||\"OpenLayers.Geometry.Collection\"==e.CLASS_NAME)for(var t=0,i=e.components.length;t<i;t++)this.eraseGeometry(e.components[t]);else{var r=OpenLayers.Util.getElement(e.id);if(r&&r.parentNode&&(r.geometry&&(r.geometry.destroy(),r.geometry=null),r.parentNode.removeChild(r),this.indexer&&this.indexer.remove(r),r._style.backgroundGraphic)){var n=e.id+this.BACKGROUND_ID_SUFFIX,s=OpenLayers.Util.getElement(n);s&&s.parentNode&&s.parentNode.removeChild(s)}}},nodeFactory:function(e,t){var i=OpenLayers.Util.getElement(e);return i?this.nodeTypeCompare(i,t)||(i.parentNode.removeChild(i),i=this.nodeFactory(e,t)):i=this.createNode(t,e),i},nodeTypeCompare:function(e,t){},createNode:function(e,t){},moveRoot:function(e){var t=this.root;e.root.parentNode==this.rendererRoot&&(t=e.root),t.parentNode.removeChild(t),e.rendererRoot.appendChild(t)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(e){return\"circle\"!=e&&!!e},CLASS_NAME:\"OpenLayers.Renderer.Elements\"}),OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]},OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:!1,resolution:null,initialize:function(e){OpenLayers.Strategy.prototype.initialize.apply(this,[e])},activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&this.layer.events.on({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this}),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})),e},cacheFeatures:function(e){var t=!0;return this.clustering||(this.clearCache(),this.features=e.features,this.cluster(),t=!1),t},clearCache:function(){this.features=null},cluster:function(e){if((!e||e.zoomChanged)&&this.features){var t=this.layer.map.getResolution();if(t!=this.resolution||!this.clustersExist()){this.resolution=t;for(var i,r,n,s=[],a=0;a<this.features.length;++a)if(i=this.features[a],i.geometry){r=!1;for(var o=0;o<s.length;++o)if(n=s[o],this.shouldCluster(n,i)){this.addToCluster(n,i),r=!0;break}r||s.push(this.createCluster(this.features[a]))}if(this.layer.destroyFeatures(),s.length>0){if(this.threshold>1){var l=s.slice();s=[];for(var p,a=0,h=l.length;a<h;++a)p=l[a],p.attributes.count<this.threshold?Array.prototype.push.apply(s,p.cluster):s.push(p)}this.clustering=!0,this.layer.addFeatures(s),this.clustering=!1}this.clusters=s}}},clustersExist:function(){var e=!1;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){e=!0;for(var t=0;t<this.clusters.length;++t)if(this.clusters[t]!=this.layer.features[t]){e=!1;break}}return e},shouldCluster:function(e,t){var i=e.geometry.getBounds().getCenterLonLat(),r=t.geometry.getBounds().getCenterLonLat();return Math.sqrt(Math.pow(i.lon-r.lon,2)+Math.pow(i.lat-r.lat,2))/this.resolution<=this.distance},addToCluster:function(e,t){e.cluster.push(t),e.attributes.count+=1},createCluster:function(e){var t=e.geometry.getBounds().getCenterLonLat(),i=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat),{count:1});return i.cluster=[e],i},CLASS_NAME:\"OpenLayers.Strategy.Cluster\"}),OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:!1,initialize:function(e){OpenLayers.Strategy.prototype.initialize.apply(this,[e])},destroy:function(){OpenLayers.Strategy.prototype.destroy.apply(this,arguments)},activate:function(){return!!OpenLayers.Strategy.prototype.activate.apply(this,arguments)&&(this.layer.events.on({refresh:this.load,scope:this}),1==this.layer.visibility||this.preload?this.load():this.layer.events.on({visibilitychanged:this.load,scope:this}),!0)},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this}),e},load:function(e){this.layer.events.triggerEvent(\"loadstart\"),this.layer.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,scope:this},e)),this.layer.events.un({visibilitychanged:this.load,scope:this})},merge:function(e){this.layer.destroyFeatures();var t=e.features;if(t&&t.length>0){var i=this.layer.projection,r=this.layer.map.getProjectionObject();if(!r.equals(i))for(var n,s=0,a=t.length;s<a;++s)(n=t[s].geometry)&&n.transform(i,r);this.layer.addFeatures(t)}this.layer.events.triggerEvent(\"loadend\")},CLASS_NAME:\"OpenLayers.Strategy.Fixed\"}),OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:!1,initialize:function(e){OpenLayers.Strategy.prototype.initialize.apply(this,[e])},activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this}),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})),e},cacheFeatures:function(e){this.paging||(this.clearCache(),this.features=e.features,this.pageNext(e))},clearCache:function(){if(this.features)for(var e=0;e<this.features.length;++e)this.features[e].destroy();this.features=null,this.num=null},pageCount:function(){var e=this.features?this.features.length:0;return Math.ceil(e/this.length)},pageNum:function(){return this.num},pageLength:function(e){return e&&e>0&&(this.length=e),this.length},pageNext:function(e){var t=!1;if(this.features){null===this.num&&(this.num=-1);var i=(this.num+1)*this.length;t=this.page(i,e)}return t},pagePrevious:function(){var e=!1;if(this.features){null===this.num&&(this.num=this.pageCount());var t=(this.num-1)*this.length;e=this.page(t)}return e},page:function(e,t){var i=!1;if(this.features&&e>=0&&e<this.features.length){var r=Math.floor(e/this.length);if(r!=this.num){this.paging=!0;var n=this.features.slice(e,e+this.length);this.layer.removeFeatures(this.layer.features),this.num=r,t&&t.features?t.features=n:this.layer.addFeatures(n),this.paging=!1,i=!0}}return i},CLASS_NAME:\"OpenLayers.Strategy.Paging\"}),OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{auto:!1,timer:null,initialize:function(e){OpenLayers.Strategy.prototype.initialize.apply(this,[e])},activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&this.auto&&(\"number\"==typeof this.auto?this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),1e3*this.auto):this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&this.auto&&(\"number\"==typeof this.auto?window.clearInterval(this.timer):this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})),e},triggerSave:function(e){var t=e.feature;t.state!==OpenLayers.State.INSERT&&t.state!==OpenLayers.State.UPDATE&&t.state!==OpenLayers.State.DELETE||this.save([e.feature])},save:function(e){e||(e=this.layer.features);var t=this.layer.projection,i=this.layer.map.getProjectionObject();if(!i.equals(t)){for(var r,n,s=e.length,a=new Array(s),o=0;o<s;++o)r=e[o],n=r.clone(),n.fid=r.fid,n.state=r.state,n._original=r,n.geometry.transform(i,t),a[o]=n;e=a}this.layer.protocol.commit(e,{callback:this.onCommit,scope:this})},onCommit:function(e){if(e.success()){for(var t,i,r=e.reqFeatures,n=[],s=e.insertIds||[],a=0,o=0,l=r.length;o<l;++o)i=r[o],i=i._original||i,(t=i.state)&&(t==OpenLayers.State.DELETE?n.push(i):t==OpenLayers.State.INSERT&&(i.fid=s[a],++a),i.state=null);n.length>0&&this.layer.destroyFeatures(n)}},CLASS_NAME:\"OpenLayers.Strategy.Save\"}),OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:!1,initialize:function(e){this.easing=e?e:OpenLayers.Easing.Expo.easeOut},start:function(e,t,i,r){this.playing=!0,this.begin=e,this.finish=t,this.duration=i,this.callbacks=r.callbacks,this.time=0,this.interval&&(window.clearInterval(this.interval),this.interval=null),this.callbacks&&this.callbacks.start&&this.callbacks.start.call(this,this.begin),this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){this.playing&&(this.callbacks&&this.callbacks.done&&this.callbacks.done.call(this,this.finish),window.clearInterval(this.interval),this.interval=null,this.playing=!1)},play:function(){var e={};for(var t in this.begin){var i=this.begin[t],r=this.finish[t];(null==i||null==r||isNaN(i)||isNaN(r))&&OpenLayers.Console.error(\"invalid value for Tween\");var n=r-i;e[t]=this.easing.apply(this,[this.time,i,n,this.duration])}this.time++,this.callbacks&&this.callbacks.eachStep&&this.callbacks.eachStep.call(this,e),this.time>this.duration&&(this.callbacks&&this.callbacks.done&&(this.callbacks.done.call(this,this.finish),this.playing=!1),window.clearInterval(this.interval),this.interval=null)},CLASS_NAME:\"OpenLayers.Tween\"}),OpenLayers.Easing={CLASS_NAME:\"OpenLayers.Easing\"},OpenLayers.Easing.Linear={easeIn:function(e,t,i,r){return i*e/r+t},easeOut:function(e,t,i,r){return i*e/r+t},easeInOut:function(e,t,i,r){return i*e/r+t},CLASS_NAME:\"OpenLayers.Easing.Linear\"},OpenLayers.Easing.Expo={easeIn:function(e,t,i,r){return 0==e?t:i*Math.pow(2,10*(e/r-1))+t},easeOut:function(e,t,i,r){return e==r?t+i:i*(1-Math.pow(2,-10*e/r))+t},easeInOut:function(e,t,i,r){return 0==e?t:e==r?t+i:(e/=r/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t},CLASS_NAME:\"OpenLayers.Easing.Expo\"},OpenLayers.Easing.Quad={easeIn:function(e,t,i,r){return i*(e/=r)*e+t},easeOut:function(e,t,i,r){return-i*(e/=r)*(e-2)+t},easeInOut:function(e,t,i,r){return(e/=r/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},CLASS_NAME:\"OpenLayers.Easing.Quad\"},OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var t=0,i=this.map.controls.length;t<i;t++){var r=this.map.controls[t];if(r!=this&&\"OpenLayers.Control.ArgParser\"==r.CLASS_NAME){r.displayProjection!=this.displayProjection&&(this.displayProjection=r.displayProjection);break}}if(t==this.map.controls.length){var n=OpenLayers.Util.getParameters();n.layers&&(this.layers=n.layers,this.map.events.register(\"addlayer\",this,this.configureLayers),this.configureLayers()),n.lat&&n.lon&&(this.center=new OpenLayers.LonLat(parseFloat(n.lon),parseFloat(n.lat)),n.zoom&&(this.zoom=parseInt(n.zoom)),this.map.events.register(\"changebaselayer\",this,this.setCenter),this.setCenter())}},setCenter:function(){this.map.baseLayer&&(this.map.events.unregister(\"changebaselayer\",this,this.setCenter),this.displayProjection&&this.center.transform(this.displayProjection,this.map.getProjectionObject()),this.map.setCenter(this.center,this.zoom))},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister(\"addlayer\",this,this.configureLayers);for(var e=0,t=this.layers.length;e<t;e++){var i=this.map.layers[e],r=this.layers.charAt(e);\"B\"==r?this.map.setBaseLayer(i):\"T\"!=r&&\"F\"!=r||i.setVisibility(\"T\"==r)}}},CLASS_NAME:\"OpenLayers.Control.ArgParser\"}),OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:\", \",initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){return 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(),this.div},updateAttribution:function(){var e=[];if(this.map&&this.map.layers){for(var t=0,i=this.map.layers.length;t<i;t++){var r=this.map.layers[t];r.attribution&&r.getVisibility()&&e.push(r.attribution)}this.div.innerHTML=e.join(this.separator)}},CLASS_NAME:\"OpenLayers.Control.Attribution\"}),OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:\"OpenLayers.Control.Button\"}),OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:\"darkblue\",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:!0,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,arguments),this.layerStates=[]},destroy:function(){OpenLayers.Event.stopObservingElement(this.div),OpenLayers.Event.stopObservingElement(this.minimizeDiv),OpenLayers.Event.stopObservingElement(this.maximizeDiv),this.clearLayersArray(\"base\"),this.clearLayersArray(\"data\"),this.map.events.un({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})},draw:function(){return OpenLayers.Control.prototype.draw.apply(this),this.loadContents(),this.outsideViewport||this.minimizeControl(),this.redraw(),this.div},clearLayersArray:function(e){var t=this[e+\"Layers\"];if(t)for(var i=0,r=t.length;i<r;i++){var n=t[i];OpenLayers.Event.stopObservingElement(n.inputElem),OpenLayers.Event.stopObservingElement(n.labelSpan)}this[e+\"LayersDiv\"].innerHTML=\"\",this[e+\"Layers\"]=[]},checkRedraw:function(){var e=!1;if(this.layerStates.length&&this.map.layers.length==this.layerStates.length)for(var t=0,i=this.layerStates.length;t<i;t++){var r=this.layerStates[t],n=this.map.layers[t];if(r.name!=n.name||r.inRange!=n.inRange||r.id!=n.id||r.visibility!=n.visibility){e=!0;break}}else e=!0;return e},redraw:function(){if(!this.checkRedraw())return this.div;this.clearLayersArray(\"base\"),this.clearLayersArray(\"data\");var e=!1,t=!1,i=this.map.layers.length;this.layerStates=new Array(i);for(var r=0;r<i;r++){var n=this.map.layers[r];this.layerStates[r]={name:n.name,visibility:n.visibility,inRange:n.inRange,id:n.id}}var s=this.map.layers.slice();this.ascending||s.reverse();for(var r=0,i=s.length;r<i;r++){var n=s[r],a=n.isBaseLayer;if(n.displayInLayerSwitcher){a?t=!0:e=!0;var o=a?n==this.map.baseLayer:n.getVisibility(),l=document.createElement(\"input\");l.id=this.id+\"_input_\"+n.name,l.name=a?\"baseLayers\":n.name,l.type=a?\"radio\":\"checkbox\",l.value=n.name,l.checked=o,l.defaultChecked=o,a||n.inRange||(l.disabled=!0);var p={inputElem:l,layer:n,layerSwitcher:this};OpenLayers.Event.observe(l,\"mouseup\",OpenLayers.Function.bindAsEventListener(this.onInputClick,p));var h=document.createElement(\"span\");a||n.inRange||(h.style.color=\"gray\"),h.innerHTML=n.name,h.style.verticalAlign=a?\"bottom\":\"baseline\",OpenLayers.Event.observe(h,\"click\",OpenLayers.Function.bindAsEventListener(this.onInputClick,p));var u=document.createElement(\"br\");(a?this.baseLayers:this.dataLayers).push({layer:n,inputElem:l,labelSpan:h});var y=a?this.baseLayersDiv:this.dataLayersDiv;y.appendChild(l),y.appendChild(h),y.appendChild(u)}}return this.dataLbl.style.display=e?\"\":\"none\",this.baseLbl.style.display=t?\"\":\"none\",this.div},onInputClick:function(e){this.inputElem.disabled||(\"radio\"==this.inputElem.type?(this.inputElem.checked=!0,this.layer.map.setBaseLayer(this.layer)):(this.inputElem.checked=!this.inputElem.checked,this.layerSwitcher.updateMap())),OpenLayers.Event.stop(e)},onLayerClick:function(e){this.updateMap()},updateMap:function(){for(var e=0,t=this.baseLayers.length;e<t;e++){var i=this.baseLayers[e];i.inputElem.checked&&this.map.setBaseLayer(i.layer,!1)}for(var e=0,t=this.dataLayers.length;e<t;e++){var i=this.dataLayers[e];i.layer.setVisibility(i.inputElem.checked)}},maximizeControl:function(e){this.div.style.width=\"20em\",this.div.style.height=\"\",this.showControls(!1),null!=e&&OpenLayers.Event.stop(e)},minimizeControl:function(e){this.div.style.width=\"0px\",this.div.style.height=\"0px\",this.showControls(!0),null!=e&&OpenLayers.Event.stop(e)},showControls:function(e){this.maximizeDiv.style.display=e?\"\":\"none\",this.minimizeDiv.style.display=e?\"none\":\"\",this.layersDiv.style.display=e?\"none\":\"\"},loadContents:function(){this.div.style.position=\"absolute\",this.div.style.top=\"25px\",this.div.style.right=\"0px\",this.div.style.left=\"\",this.div.style.fontFamily=\"sans-serif\",this.div.style.fontWeight=\"bold\",this.div.style.marginTop=\"3px\",this.div.style.marginLeft=\"3px\",this.div.style.marginBottom=\"3px\",this.div.style.fontSize=\"smaller\",this.div.style.color=\"white\",this.div.style.backgroundColor=\"transparent\",OpenLayers.Event.observe(this.div,\"mouseup\",OpenLayers.Function.bindAsEventListener(this.mouseUp,this)),OpenLayers.Event.observe(this.div,\"click\",this.ignoreEvent),OpenLayers.Event.observe(this.div,\"mousedown\",OpenLayers.Function.bindAsEventListener(this.mouseDown,this)),OpenLayers.Event.observe(this.div,\"dblclick\",this.ignoreEvent),this.layersDiv=document.createElement(\"div\"),this.layersDiv.id=this.id+\"_layersDiv\",this.layersDiv.style.paddingTop=\"5px\",this.layersDiv.style.paddingLeft=\"10px\",this.layersDiv.style.paddingBottom=\"5px\",this.layersDiv.style.paddingRight=\"75px\",this.layersDiv.style.backgroundColor=this.activeColor,this.layersDiv.style.width=\"100%\",this.layersDiv.style.height=\"100%\",this.baseLbl=document.createElement(\"div\"),this.baseLbl.innerHTML=OpenLayers.i18n(\"baseLayer\"),this.baseLbl.style.marginTop=\"3px\",this.baseLbl.style.marginLeft=\"3px\",this.baseLbl.style.marginBottom=\"3px\",this.baseLayersDiv=document.createElement(\"div\"),this.baseLayersDiv.style.paddingLeft=\"10px\",this.dataLbl=document.createElement(\"div\"),this.dataLbl.innerHTML=OpenLayers.i18n(\"overlays\"),this.dataLbl.style.marginTop=\"3px\",this.dataLbl.style.marginLeft=\"3px\",this.dataLbl.style.marginBottom=\"3px\",this.dataLayersDiv=document.createElement(\"div\"),this.dataLayersDiv.style.paddingLeft=\"10px\",this.ascending?(this.layersDiv.appendChild(this.baseLbl),this.layersDiv.appendChild(this.baseLayersDiv),this.layersDiv.appendChild(this.dataLbl),this.layersDiv.appendChild(this.dataLayersDiv)):(this.layersDiv.appendChild(this.dataLbl),this.layersDiv.appendChild(this.dataLayersDiv),this.layersDiv.appendChild(this.baseLbl),this.layersDiv.appendChild(this.baseLayersDiv)),this.div.appendChild(this.layersDiv),OpenLayers.Rico.Corner.round(this.div,{corners:\"tl bl\",bgColor:\"transparent\",color:this.activeColor,blend:!1}),OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,.75);var e=OpenLayers.Util.getImagesLocation(),t=new OpenLayers.Size(18,18),i=e+\"layer-switcher-maximize.png\"\n;this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(\"OpenLayers_Control_MaximizeDiv\",null,t,i,\"absolute\"),this.maximizeDiv.style.top=\"5px\",this.maximizeDiv.style.right=\"0px\",this.maximizeDiv.style.left=\"\",this.maximizeDiv.style.display=\"none\",OpenLayers.Event.observe(this.maximizeDiv,\"click\",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this)),this.div.appendChild(this.maximizeDiv);var i=e+\"layer-switcher-minimize.png\",t=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv(\"OpenLayers_Control_MinimizeDiv\",null,t,i,\"absolute\"),this.minimizeDiv.style.top=\"5px\",this.minimizeDiv.style.right=\"0px\",this.minimizeDiv.style.left=\"\",this.minimizeDiv.style.display=\"none\",OpenLayers.Event.observe(this.minimizeDiv,\"click\",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this)),this.div.appendChild(this.minimizeDiv)},ignoreEvent:function(e){OpenLayers.Event.stop(e)},mouseDown:function(e){this.isMouseDown=!0,this.ignoreEvent(e)},mouseUp:function(e){this.isMouseDown&&(this.isMouseDown=!1,this.ignoreEvent(e))},CLASS_NAME:\"OpenLayers.Control.LayerSwitcher\"}),OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:!1,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.handler&&this.handler.destroy(),this.handler=null,this.map.events.un({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this}),OpenLayers.Event.stopObserving(window,\"DOMMouseScroll\",this.wheelObserver),OpenLayers.Event.stopObserving(window,\"mousewheel\",this.wheelObserver),OpenLayers.Event.stopObserving(document,\"mousewheel\",this.wheelObserver),this.wheelObserver=null,OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.map.events.on({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this}),this.registerWheelEvents()},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this),OpenLayers.Event.observe(window,\"DOMMouseScroll\",this.wheelObserver),OpenLayers.Event.observe(window,\"mousewheel\",this.wheelObserver),OpenLayers.Event.observe(document,\"mousewheel\",this.wheelObserver)},defaultClick:function(e){if(OpenLayers.Event.isLeftClick(e)){var t=!this.performedDrag;return this.performedDrag=!1,t}},defaultDblClick:function(e){var t=this.map.getLonLatFromViewPortPx(e.xy);return this.map.setCenter(t,this.map.zoom+1),OpenLayers.Event.stop(e),!1},defaultMouseDown:function(e){OpenLayers.Event.isLeftClick(e)&&(this.mouseDragStart=e.xy.clone(),this.performedDrag=!1,e.shiftKey&&(this.map.div.style.cursor=\"crosshair\",this.zoomBox=OpenLayers.Util.createDiv(\"zoomBox\",this.mouseDragStart,null,null,\"absolute\",\"2px solid red\"),this.zoomBox.style.backgroundColor=\"white\",this.zoomBox.style.filter=\"alpha(opacity=50)\",this.zoomBox.style.opacity=\"0.50\",this.zoomBox.style.fontSize=\"1px\",this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.viewPortDiv.appendChild(this.zoomBox)),document.onselectstart=function(){return!1},OpenLayers.Event.stop(e))},defaultMouseMove:function(e){if(this.mousePosition=e.xy.clone(),null!=this.mouseDragStart){if(this.zoomBox){var t=Math.abs(this.mouseDragStart.x-e.xy.x),i=Math.abs(this.mouseDragStart.y-e.xy.y);this.zoomBox.style.width=Math.max(1,t)+\"px\",this.zoomBox.style.height=Math.max(1,i)+\"px\",e.xy.x<this.mouseDragStart.x&&(this.zoomBox.style.left=e.xy.x+\"px\"),e.xy.y<this.mouseDragStart.y&&(this.zoomBox.style.top=e.xy.y+\"px\")}else{var t=this.mouseDragStart.x-e.xy.x,i=this.mouseDragStart.y-e.xy.y,r=this.map.getSize(),n=new OpenLayers.Pixel(r.w/2+t,r.h/2+i),s=this.map.getLonLatFromViewPortPx(n);this.map.setCenter(s,null,!0),this.mouseDragStart=e.xy.clone(),this.map.div.style.cursor=\"move\"}this.performedDrag=!0}},defaultMouseUp:function(e){OpenLayers.Event.isLeftClick(e)&&(this.zoomBox?this.zoomBoxEnd(e):this.performedDrag&&this.map.setCenter(this.map.center),document.onselectstart=null,this.mouseDragStart=null,this.map.div.style.cursor=\"\")},defaultMouseOut:function(e){null!=this.mouseDragStart&&OpenLayers.Util.mouseLeft(e,this.map.div)&&(this.zoomBox&&this.removeZoomBox(),this.mouseDragStart=null)},defaultWheelUp:function(e){this.map.getZoom()<=this.map.getNumZoomLevels()&&this.map.setCenter(this.map.getLonLatFromPixel(e.xy),this.map.getZoom()+1)},defaultWheelDown:function(e){this.map.getZoom()>0&&this.map.setCenter(this.map.getLonLatFromPixel(e.xy),this.map.getZoom()-1)},zoomBoxEnd:function(e){if(null!=this.mouseDragStart){if(Math.abs(this.mouseDragStart.x-e.xy.x)>5||Math.abs(this.mouseDragStart.y-e.xy.y)>5){var t=this.map.getLonLatFromViewPortPx(this.mouseDragStart),i=this.map.getLonLatFromViewPortPx(e.xy),r=Math.max(t.lat,i.lat),n=Math.min(t.lat,i.lat),s=Math.min(t.lon,i.lon),a=Math.max(t.lon,i.lon),o=new OpenLayers.Bounds(s,n,a,r);this.map.zoomToExtent(o)}else{var i=this.map.getLonLatFromViewPortPx(e.xy);this.map.setCenter(new OpenLayers.LonLat(i.lon,i.lat),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox),this.zoomBox=null},onWheelEvent:function(e){for(var t=!1,i=OpenLayers.Event.element(e);null!=i;){if(this.map&&i==this.map.div){t=!0;break}i=i.parentNode}if(t){var r=0;e||(e=window.event),e.wheelDelta?(r=e.wheelDelta/120,window.opera&&window.opera.version()<9.2&&(r=-r)):e.detail&&(r=-e.detail/3),r&&(e.xy=this.mousePosition,r<0?this.defaultWheelDown(e):this.defaultWheelUp(e)),OpenLayers.Event.stop(e)}},CLASS_NAME:\"OpenLayers.Control.MouseDefaults\"}),OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:\"\",separator:\", \",suffix:\"\",numDigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map&&this.map.events.unregister(\"mousemove\",this,this.redraw),OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.div.left=\"\",this.div.top=\"\",this.element=this.div),this.redraw(),this.div},redraw:function(e){var t;if(null==e)t=new OpenLayers.LonLat(0,0);else{if(null==this.lastXy||Math.abs(e.xy.x-this.lastXy.x)>this.granularity||Math.abs(e.xy.y-this.lastXy.y)>this.granularity)return void(this.lastXy=e.xy);if(!(t=this.map.getLonLatFromPixel(e.xy)))return;this.displayProjection&&t.transform(this.map.getProjectionObject(),this.displayProjection),this.lastXy=e.xy}var i=this.formatOutput(t);i!=this.element.innerHTML&&(this.element.innerHTML=i)},formatOutput:function(e){var t=parseInt(this.numDigits);return this.prefix+e.lon.toFixed(t)+this.separator+e.lat.toFixed(t)+this.suffix},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.map.events.register(\"mousemove\",this,this.redraw)},CLASS_NAME:\"OpenLayers.Control.MousePosition\"}),OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(e,t){this.direction=e,this.CLASS_NAME+=this.direction,OpenLayers.Control.prototype.initialize.apply(this,[t])},trigger:function(){switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,this.slideFactor);break;case OpenLayers.Control.Pan.WEST:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(this.slideFactor,0)}},CLASS_NAME:\"OpenLayers.Control.Pan\"}),OpenLayers.Control.Pan.NORTH=\"North\",OpenLayers.Control.Pan.SOUTH=\"South\",OpenLayers.Control.Pan.EAST=\"East\",OpenLayers.Control.Pan.WEST=\"West\",OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(e){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y),OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments),this.removeButtons(),this.buttons=null,this.position=null},draw:function(e){OpenLayers.Control.prototype.draw.apply(this,arguments),e=this.position,this.buttons=[];var t=new OpenLayers.Size(18,18),i=new OpenLayers.Pixel(e.x+t.w/2,e.y);return this._addButton(\"panup\",\"north-mini.png\",i,t),e.y=i.y+t.h,this._addButton(\"panleft\",\"west-mini.png\",e,t),this._addButton(\"panright\",\"east-mini.png\",e.add(t.w,0),t),this._addButton(\"pandown\",\"south-mini.png\",i.add(0,2*t.h),t),this._addButton(\"zoomin\",\"zoom-plus-mini.png\",i.add(0,3*t.h+5),t),this._addButton(\"zoomworld\",\"zoom-world-mini.png\",i.add(0,4*t.h+5),t),this._addButton(\"zoomout\",\"zoom-minus-mini.png\",i.add(0,5*t.h+5),t),this.div},_addButton:function(e,t,i,r){var n=OpenLayers.Util.getImagesLocation()+t,s=OpenLayers.Util.createAlphaImageDiv(this.id+\"_\"+e,i,r,n,\"absolute\");if(this.div.appendChild(s),OpenLayers.Event.observe(s,\"mousedown\",OpenLayers.Function.bindAsEventListener(this.buttonDown,s)),OpenLayers.Event.observe(s,\"dblclick\",OpenLayers.Function.bindAsEventListener(this.doubleClick,s)),OpenLayers.Event.observe(s,\"click\",OpenLayers.Function.bindAsEventListener(this.doubleClick,s)),s.action=e,s.map=this.map,this.slideRatio)var a=this.slideRatio,o=function(e){return this.map.getSize()[e]*a};else var l=this.slideFactor,o=function(){return l};return s.getSlideFactor=o,this.buttons.push(s),s},_removeButton:function(e){OpenLayers.Event.stopObservingElement(e),e.map=null,this.div.removeChild(e),OpenLayers.Util.removeItem(this.buttons,e)},removeButtons:function(){for(var e=this.buttons.length-1;e>=0;--e)this._removeButton(this.buttons[e])},doubleClick:function(e){return OpenLayers.Event.stop(e),!1},buttonDown:function(e){if(OpenLayers.Event.isLeftClick(e)){switch(this.action){case\"panup\":this.map.pan(0,-this.getSlideFactor(\"h\"));break;case\"pandown\":this.map.pan(0,this.getSlideFactor(\"h\"));break;case\"panleft\":this.map.pan(-this.getSlideFactor(\"w\"),0);break;case\"panright\":this.map.pan(this.getSlideFactor(\"w\"),0);break;case\"zoomin\":this.map.zoomIn();break;case\"zoomout\":this.map.zoomOut();break;case\"zoomworld\":this.map.zoomToMaxExtent()}OpenLayers.Event.stop(e)}},CLASS_NAME:\"OpenLayers.Control.PanZoom\"}),OpenLayers.Control.PanZoom.X=4,OpenLayers.Control.PanZoom.Y=4,OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,[e]),this.controls=[]},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var e=this.controls.length-1;e>=0;e--)this.controls[e].events&&this.controls[e].events.un({activate:this.redraw,deactivate:this.redraw,scope:this}),OpenLayers.Event.stopObservingElement(this.controls[e].panel_div),this.controls[e].panel_div=null},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var e=0,t=this.controls.length;e<t;e++)this.controls[e]==this.defaultControl&&this.controls[e].activate();return this.redraw(),!0}return!1},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var e=0,t=this.controls.length;e<t;e++)this.controls[e].deactivate();return!0}return!1},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var e=0,t=this.controls.length;e<t;e++)this.map.addControl(this.controls[e]),this.controls[e].deactivate(),this.controls[e].events.on({activate:this.redraw,deactivate:this.redraw,scope:this});return this.activate(),this.div},redraw:function(){if(this.div.innerHTML=\"\",this.active)for(var e=0,t=this.controls.length;e<t;e++){var i=this.controls[e].panel_div;this.controls[e].active?i.className=this.controls[e].displayClass+\"ItemActive\":i.className=this.controls[e].displayClass+\"ItemInactive\",this.div.appendChild(i)}},activateControl:function(e){if(!this.active)return!1;if(e.type==OpenLayers.Control.TYPE_BUTTON)return e.trigger(),void this.redraw();if(e.type==OpenLayers.Control.TYPE_TOGGLE)return e.active?e.deactivate():e.activate(),void this.redraw();for(var t=0,i=this.controls.length;t<i;t++)this.controls[t]!=e&&this.controls[t].type!=OpenLayers.Control.TYPE_TOGGLE&&this.controls[t].deactivate();e.activate()},addControls:function(e){e instanceof Array||(e=[e]),this.controls=this.controls.concat(e);for(var t=0,i=e.length;t<i;t++){var r=document.createElement(\"div\");document.createTextNode(\" \");e[t].panel_div=r,\"\"!=e[t].title&&(e[t].panel_div.title=e[t].title),OpenLayers.Event.observe(e[t].panel_div,\"click\",OpenLayers.Function.bind(this.onClick,this,e[t])),OpenLayers.Event.observe(e[t].panel_div,\"mousedown\",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var t=0,i=e.length;t<i;t++)this.map.addControl(e[t]),e[t].deactivate(),e[t].events.on({activate:this.redraw,deactivate:this.redraw,scope:this});this.redraw()}},onClick:function(e,t){OpenLayers.Event.stop(t?t:window.event),this.activateControl(e)},getControlsBy:function(e,t){var i=\"function\"==typeof t.test;return OpenLayers.Array.filter(this.controls,function(r){return r[e]==t||i&&t.test(r[e])})},getControlsByName:function(e){return this.getControlsBy(\"name\",e)},getControlsByClass:function(e){return this.getControlsBy(\"CLASS_NAME\",e)},CLASS_NAME:\"OpenLayers.Control.Panel\"}),OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(e,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.element=OpenLayers.Util.getElement(e)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.element=document.createElement(\"div\"),this.div.appendChild(this.element)),this.map.events.register(\"moveend\",this,this.updateScale),this.updateScale(),this.div},updateScale:function(){var e=this.map.getScale();e&&(e=e>=9500&&e<=95e4?Math.round(e/1e3)+\"K\":e>=95e4?Math.round(e/1e6)+\"M\":Math.round(e),this.element.innerHTML=OpenLayers.i18n(\"scale\",{scaleDenom:e}))},CLASS_NAME:\"OpenLayers.Control.Scale\"}),OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:\"km\",topInUnits:\"m\",bottomOutUnits:\"mi\",bottomInUnits:\"ft\",eTop:null,eBottom:null,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,[e])},draw:function(){if(OpenLayers.Control.prototype.draw.apply(this,arguments),!this.eTop){this.div.style.display=\"block\",this.div.style.position=\"absolute\",this.eTop=document.createElement(\"div\"),this.eTop.className=this.displayClass+\"Top\";this.topInUnits.length;this.div.appendChild(this.eTop),\"\"==this.topOutUnits||\"\"==this.topInUnits?this.eTop.style.visibility=\"hidden\":this.eTop.style.visibility=\"visible\",this.eBottom=document.createElement(\"div\"),this.eBottom.className=this.displayClass+\"Bottom\",this.div.appendChild(this.eBottom),\"\"==this.bottomOutUnits||\"\"==this.bottomInUnits?this.eBottom.style.visibility=\"hidden\":this.eBottom.style.visibility=\"visible\"}return this.map.events.register(\"moveend\",this,this.update),this.update(),this.div},getBarLen:function(e){var t=parseInt(Math.log(e)/Math.log(10)),i=Math.pow(10,t),r=parseInt(e/i);return(r>5?5:r>2?2:1)*i},update:function(){var e=this.map.getResolution();if(e){var t,i,r=this.map.getUnits(),n=OpenLayers.INCHES_PER_UNIT,s=this.maxWidth*e*n[r];s>1e5?(t=this.topOutUnits,i=this.bottomOutUnits):(t=this.topInUnits,i=this.bottomInUnits);var a=s/n[t],o=s/n[i],l=this.getBarLen(a),p=this.getBarLen(o);a=l/n[r]*n[t],o=p/n[r]*n[i];var h=a/e,u=o/e;\"visible\"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(u)+\"px\",this.eBottom.innerHTML=p+\" \"+i),\"visible\"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(h)+\"px\",this.eTop.innerHTML=l+\" \"+t)}},CLASS_NAME:\"OpenLayers.Control.ScaleLine\"}),OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()},CLASS_NAME:\"OpenLayers.Control.ZoomIn\"}),OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()},CLASS_NAME:\"OpenLayers.Control.ZoomOut\"}),OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map&&this.map.zoomToMaxExtent()},CLASS_NAME:\"OpenLayers.Control.ZoomToMaxExtent\"}),OpenLayers.Event={observers:!1,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(e){return e.target||e.srcElement},isLeftClick:function(e){return e.which&&1==e.which||e.button&&1==e.button},isRightClick:function(e){return e.which&&3==e.which||e.button&&2==e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var i=OpenLayers.Event.element(e);i.parentNode&&(!i.tagName||i.tagName.toUpperCase()!=t.toUpperCase());)i=i.parentNode;return i},observe:function(e,t,i,r){var n=OpenLayers.Util.getElement(e);if(r=r||!1,\"keypress\"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||n.attachEvent)&&(t=\"keydown\"),this.observers||(this.observers={}),!n._eventCacheID){var s=\"eventCacheID_\";n.id&&(s=n.id+\"_\"+s),n._eventCacheID=OpenLayers.Util.createUniqueID(s)}var a=n._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:n,name:t,observer:i,useCapture:r}),n.addEventListener?n.addEventListener(t,i,r):n.attachEvent&&n.attachEvent(\"on\"+t,i)},stopObservingElement:function(e){var t=OpenLayers.Util.getElement(e),i=t._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[i])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var i=e[t],r=new Array(i.element,i.name,i.observer,i.useCapture);OpenLayers.Event.stopObserving.apply(this,r)}},stopObserving:function(e,t,i,r){r=r||!1;var n=OpenLayers.Util.getElement(e),s=n._eventCacheID;\"keypress\"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||n.detachEvent)&&(t=\"keydown\");var a=!1,o=OpenLayers.Event.observers[s];if(o)for(var l=0;!a&&l<o.length;){var p=o[l];if(p.name==t&&p.observer==i&&p.useCapture==r){o.splice(l,1),0==o.length&&delete OpenLayers.Event.observers[s],a=!0;break}l++}return a&&(n.removeEventListener?n.removeEventListener(t,i,r):n&&n.detachEvent&&n.detachEvent(\"on\"+t,i)),a},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var e in OpenLayers.Event.observers){var t=OpenLayers.Event.observers[e];OpenLayers.Event._removeElementObservers.apply(this,[t])}OpenLayers.Event.observers=!1}},CLASS_NAME:\"OpenLayers.Event\"},OpenLayers.Event.observe(window,\"unload\",OpenLayers.Event.unloadCache,!1),window.Event)OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event);else var Event=OpenLayers.Event;OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:[\"mouseover\",\"mouseout\",\"mousedown\",\"mouseup\",\"mousemove\",\"click\",\"dblclick\",\"rightclick\",\"dblrightclick\",\"resize\",\"focus\",\"blur\"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:!1,clearMouseListener:null,initialize:function(e,t,i,r,n){if(OpenLayers.Util.extend(this,n),this.object=e,this.fallThrough=r,this.listeners={},this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this),this.eventTypes=[],null!=i)for(var s=0,a=i.length;s<a;s++)this.addEventType(i[s]);null!=t&&this.attachToElement(t)},destroy:function(){this.element&&(OpenLayers.Event.stopObservingElement(this.element),this.element.hasScrollEvent&&OpenLayers.Event.stopObserving(window,\"scroll\",this.clearMouseListener)),this.element=null,this.listeners=null,this.object=null,this.eventTypes=null,this.fallThrough=null,this.eventHandler=null},addEventType:function(e){this.listeners[e]||(this.eventTypes.push(e),this.listeners[e]=[])},attachToElement:function(e){this.element&&OpenLayers.Event.stopObservingElement(this.element),this.element=e;for(var t=0,i=this.BROWSER_EVENTS.length;t<i;t++){var r=this.BROWSER_EVENTS[t];this.addEventType(r),OpenLayers.Event.observe(e,r,this.eventHandler)}OpenLayers.Event.observe(e,\"dragstart\",OpenLayers.Event.stop)},on:function(e){for(var t in e)\"scope\"!=t&&this.register(t,e.scope,e[t])},register:function(e,t,i){if(null!=i&&OpenLayers.Util.indexOf(this.eventTypes,e)!=-1){null==t&&(t=this.object);this.listeners[e].push({obj:t,func:i})}},registerPriority:function(e,t,i){if(null!=i){null==t&&(t=this.object);var r=this.listeners[e];null!=r&&r.unshift({obj:t,func:i})}},un:function(e){for(var t in e)\"scope\"!=t&&this.unregister(t,e.scope,e[t])},unregister:function(e,t,i){null==t&&(t=this.object);var r=this.listeners[e];if(null!=r)for(var n=0,s=r.length;n<s;n++)if(r[n].obj==t&&r[n].func==i){r.splice(n,1);break}},remove:function(e){null!=this.listeners[e]&&(this.listeners[e]=[])},triggerEvent:function(e,t){var i=this.listeners[e];if(i&&0!=i.length){null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e);for(var r,i=i.slice(),n=0,s=i.length;n<s;n++){var a=i[n];if(void 0!=(r=a.func.apply(a.obj,[t]))&&0==r)break}return this.fallThrough||OpenLayers.Event.stop(t,!0),r}},handleBrowserEvent:function(e){this.includeXY&&(e.xy=this.getMousePosition(e)),this.triggerEvent(e.type,e)},clearMouseCache:function(){this.element.scrolls=null,this.element.lefttop=null,this.element.offsets=null},getMousePosition:function(e){return this.includeXY?this.element.hasScrollEvent||(OpenLayers.Event.observe(window,\"scroll\",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),this.element.scrolls||(this.element.scrolls=[document.documentElement.scrollLeft||document.body.scrollLeft,document.documentElement.scrollTop||document.body.scrollTop]),this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=OpenLayers.Util.pagePosition(this.element),this.element.offsets[0]+=this.element.scrolls[0],this.element.offsets[1]+=this.element.scrolls[1]),new OpenLayers.Pixel(e.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],e.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:\"OpenLayers.Events\"}),OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(e){OpenLayers.Util.extend(this,e),this.options=e},destroy:function(){},read:function(e){OpenLayers.Console.userError(OpenLayers.i18n(\"readNotImplemented\"))},write:function(e){OpenLayers.Console.userError(OpenLayers.i18n(\"writeNotImplemented\"))},CLASS_NAME:\"OpenLayers.Format\"}),OpenLayers.Lang.en={unhandledRequest:\"Unhandled request return ${statusText}\",permalink:\"Permalink\",overlays:\"Overlays\",baseLayer:\"Base Layer\",sameProjection:\"The overview map only works when it is in the same projection as the main map\",readNotImplemented:\"Read not implemented.\",writeNotImplemented:\"Write not implemented.\",noFID:\"Can't update a feature for which there is no FID.\",errorLoadingGML:\"Error in loading GML file ${url}\",browserNotSupported:\"Your browser does not support vector rendering. Currently supported renderers are:\\n${renderers}\",componentShouldBe:\"addFeatures : component should be an ${geomType}\",getFeatureError:\"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.\",minZoomLevelError:\"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels\",commitSuccess:\"WFS Transaction: SUCCESS ${response}\",commitFailed:\"WFS Transaction: FAILED ${response}\",googleWarning:\"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>\",getLayerWarning:\"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>\",scale:\"Scale = 1 : ${scaleDenom}\",layerAlreadyAdded:\"You tried to add the layer: ${layerName} to the map, but it has already been added\",reprojectDeprecated:\"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.\",methodDeprecated:\"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.\",boundsAddError:\"You must pass both x and y values to the add function.\",lonlatAddError:\"You must pass both lon and lat values to the add function.\",pixelAddError:\"You must pass both x and y values to the add function.\",unsupportedGeometryType:\"Unsupported geometry type: ${geomType}\",pagePositionFailed:\"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.\",end:\"\",filterEvaluateNotImplemented:\"evaluate is not implemented for this filter type.\"},OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:!1,initialize:function(e,t,i,r,n,s,a){this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE),OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)},draw:function(e){return OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments),this.setContentHTML(),this.setBackgroundColor(),this.setOpacity(),this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(e){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments),this.setRicoCorners()},setBackgroundColor:function(e){void 0!=e&&(this.backgroundColor=e),null!=this.div&&null!=this.contentDiv&&(this.div.style.background=\"transparent\",OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor))},setOpacity:function(e){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,e),null!=this.div&&null!=this.groupDiv&&OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)},setBorder:function(e){this.border=0},setRicoCorners:function(){var e=this.getCornersToRound(this.relativePosition),t={corners:e,color:this.backgroundColor,bgColor:\"transparent\",blend:!1};this.rounded?(OpenLayers.Rico.Corner.reRound(this.groupDiv,t),this.setBackgroundColor(),this.setOpacity()):(OpenLayers.Rico.Corner.round(this.div,t),this.rounded=!0)},getCornersToRound:function(){var e=[\"tl\",\"tr\",\"bl\",\"br\"],t=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);return OpenLayers.Util.removeItem(e,t),e.join(\" \")},CLASS_NAME:\"OpenLayers.Popup.AnchoredBubble\"}),OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5,OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:!1,positionBlocks:null,blocks:null,fixedRelativePosition:!1,initialize:function(e,t,i,r,n,s,a){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments),this.fixedRelativePosition&&(this.updateRelativePosition(),this.calculateRelativePosition=function(e){return this.relativePosition}),this.contentDiv.style.position=\"absolute\",this.contentDiv.style.zIndex=1,s&&(this.closeDiv.style.zIndex=1),this.groupDiv.style.position=\"absolute\",this.groupDiv.style.top=\"0px\",this.groupDiv.style.left=\"0px\",this.groupDiv.style.height=\"100%\",this.groupDiv.style.width=\"100%\"},destroy:function(){this.imageSrc=null,this.imageSize=null,this.isAlphaImage=null,this.fixedRelativePosition=!1,this.positionBlocks=null;for(var e=0;e<this.blocks.length;e++){var t=this.blocks[e];t.image&&t.div.removeChild(t.image),t.image=null,t.div&&this.groupDiv.removeChild(t.div),t.div=null}this.blocks=null,OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(e){},setBorder:function(){},setOpacity:function(e){},setSize:function(e){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments),this.updateBlocks()},updateRelativePosition:function(){if(this.padding=this.positionBlocks[this.relativePosition].padding,this.closeDiv){var e=this.getContentDivPadding();this.closeDiv.style.right=e.right+this.padding.right+\"px\",this.closeDiv.style.top=e.top+this.padding.top+\"px\"}this.updateBlocks()},calculateNewPx:function(e){var t=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);return t=t.offset(this.positionBlocks[this.relativePosition].offset)},createBlocks:function(){this.blocks=[];var e=null;for(var t in this.positionBlocks){e=t;break}for(var i=this.positionBlocks[e],r=0;r<i.blocks.length;r++){var n={};this.blocks.push(n);var s=this.id+\"_FrameDecorationDiv_\"+r;n.div=OpenLayers.Util.createDiv(s,null,null,null,\"absolute\",null,\"hidden\",null);var a=this.id+\"_FrameDecorationImg_\"+r,o=this.isAlphaImage?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;n.image=o(a,null,this.imageSize,this.imageSrc,\"absolute\",null,null,null),n.div.appendChild(n.image),this.groupDiv.appendChild(n.div)}},updateBlocks:function(){if(this.blocks||this.createBlocks(),this.size&&this.relativePosition){for(var e=this.positionBlocks[this.relativePosition],t=0;t<e.blocks.length;t++){var i=e.blocks[t],r=this.blocks[t],n=i.anchor.left,s=i.anchor.bottom,a=i.anchor.right,o=i.anchor.top,l=isNaN(i.size.w)?this.size.w-(a+n):i.size.w,p=isNaN(i.size.h)?this.size.h-(s+o):i.size.h;r.div.style.width=(l<0?0:l)+\"px\",r.div.style.height=(p<0?0:p)+\"px\",r.div.style.left=null!=n?n+\"px\":\"\",r.div.style.bottom=null!=s?s+\"px\":\"\",r.div.style.right=null!=a?a+\"px\":\"\",r.div.style.top=null!=o?o+\"px\":\"\",r.image.style.left=i.position.x+\"px\",r.image.style.top=i.position.y+\"px\"}this.contentDiv.style.left=this.padding.left+\"px\",this.contentDiv.style.top=this.padding.top+\"px\"}},CLASS_NAME:\"OpenLayers.Popup.Framed\"}),OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(e,t){OpenLayers.Util.extend(this,t),this.projCode=e,window.Proj4js&&(this.proj=new Proj4js.Proj(e))},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(e){return!(!e||!e.getCode)&&this.getCode()==e.getCode()},destroy:function(){delete this.proj,delete this.projCode},CLASS_NAME:\"OpenLayers.Projection\"}),OpenLayers.Projection.transforms={},OpenLayers.Projection.addTransform=function(e,t,i){OpenLayers.Projection.transforms[e]||(OpenLayers.Projection.transforms[e]={}),OpenLayers.Projection.transforms[e][t]=i},OpenLayers.Projection.transform=function(e,t,i){\nreturn t.proj&&i.proj?e=Proj4js.transform(t.proj,i.proj,e):t&&i&&OpenLayers.Projection.transforms[t.getCode()]&&OpenLayers.Projection.transforms[t.getCode()][i.getCode()]&&OpenLayers.Projection.transforms[t.getCode()][i.getCode()](e),e},OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:\"EPSG:4326\",featureType:null,featureNS:null,geometryName:\"the_geom\",schema:null,featurePrefix:\"feature\",formatOptions:null,initialize:function(e){if(OpenLayers.Protocol.prototype.initialize.apply(this,[e]),e.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))),!this.featureNS){var t=this.format.readNode;this.format.readNode=function(e,i){return this.featureNS||e.prefix!=this.featurePrefix||(this.featureNS=e.namespaceURI,this.setNamespace(\"feature\",this.featureNS)),t.apply(this,arguments)}}},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(e,t,i){return OpenLayers.Function.bind(function(){e.apply(this,[t,i])},this)},read:function(e){e=OpenLayers.Util.extend({},e),OpenLayers.Util.applyDefaults(e,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:\"read\"}),i=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode(\"wfs:GetFeature\",e)]);return t.priv=OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),params:e.params,headers:e.headers,data:i}),t},handleRead:function(e,t){if(t.callback){var i=e.priv;i.status>=200&&i.status<300?(e.features=this.parseFeatures(i),e.code=OpenLayers.Protocol.Response.SUCCESS):e.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,e)}},parseFeatures:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},commit:function(e,t){t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({requestType:\"commit\",reqFeatures:e});return i.priv=OpenLayers.Request.POST({url:t.url,data:this.format.write(e,t),callback:this.createCallback(this.handleCommit,i,t)}),i},handleCommit:function(e,t){if(t.callback){var i=e.priv,r=i.responseXML;r&&r.documentElement||(r=i.responseText);var n=this.format.read(r)||{};e.insertIds=n.insertIds||[],e.code=n.success?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,e)}},filterDelete:function(e,t){t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options);var i=(new OpenLayers.Protocol.Response({requestType:\"commit\"}),this.format.createElementNSPlus(\"wfs:Transaction\",{attributes:{service:\"WFS\",version:this.version}})),r=this.format.createElementNSPlus(\"wfs:Delete\",{attributes:{typeName:(t.featureNS?this.featurePrefix+\":\":\"\")+t.featureType}});t.featureNS&&r.setAttribute(\"xmlns:\"+this.featurePrefix,t.featureNS);var n=this.format.writeNode(\"ogc:Filter\",e);r.appendChild(n),i.appendChild(r);var s=OpenLayers.Format.XML.prototype.write.apply(this.format,[i]);return OpenLayers.Request.POST({url:this.url,callback:t.callback||function(){},data:s})},abort:function(e){e&&e.priv.abort()},CLASS_NAME:\"OpenLayers.Protocol.WFS.v1\"}),OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:\"http://www.w3.org/2000/svg\",xlinkns:\"http://www.w3.org/1999/xlink\",MAX_PIXEL:15e3,translationParameters:null,symbolSize:{},isGecko:null,initialize:function(e){this.supported()&&(OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.translationParameters={x:0,y:0},this.isGecko=navigator.userAgent.toLowerCase().indexOf(\"gecko/\")!=-1)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var e=\"http://www.w3.org/TR/SVG11/feature#\";return document.implementation&&(document.implementation.hasFeature(\"org.w3c.svg\",\"1.0\")||document.implementation.hasFeature(e+\"SVG\",\"1.1\")||document.implementation.hasFeature(e+\"BasicStructure\",\"1.1\"))},inValidRange:function(e,t,i){var r=e+(i?0:this.translationParameters.x),n=t+(i?0:this.translationParameters.y);return r>=-this.MAX_PIXEL&&r<=this.MAX_PIXEL&&n>=-this.MAX_PIXEL&&n<=this.MAX_PIXEL},setExtent:function(e,t){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var i=this.getResolution(),r=-e.left/i,n=e.top/i;if(t){this.left=r,this.top=n;var s=\"0 0 \"+this.size.w+\" \"+this.size.h;return this.rendererRoot.setAttributeNS(null,\"viewBox\",s),this.translate(0,0),!0}var a=this.translate(r-this.left,n-this.top);return a||this.setExtent(e,!0),a},translate:function(e,t){if(this.inValidRange(e,t,!0)){var i=\"\";return(e||t)&&(i=\"translate(\"+e+\",\"+t+\")\"),this.root.setAttributeNS(null,\"transform\",i),this.translationParameters={x:e,y:t},!0}return!1},setSize:function(e){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(e,t){var i=null;switch(e.CLASS_NAME){case\"OpenLayers.Geometry.Point\":i=t.externalGraphic?\"image\":this.isComplexSymbol(t.graphicName)?\"use\":\"circle\";break;case\"OpenLayers.Geometry.Rectangle\":i=\"rect\";break;case\"OpenLayers.Geometry.LineString\":i=\"polyline\";break;case\"OpenLayers.Geometry.LinearRing\":i=\"polygon\";break;case\"OpenLayers.Geometry.Polygon\":case\"OpenLayers.Geometry.Curve\":case\"OpenLayers.Geometry.Surface\":i=\"path\"}return i},setStyle:function(e,t,i){t=t||e._style,i=i||e._options;var r,n=parseFloat(e.getAttributeNS(null,\"r\")),s=1;if(\"OpenLayers.Geometry.Point\"==e._geometryClass&&n){if(e.style.visibility=\"\",t.graphic===!1)e.style.visibility=\"hidden\";else if(t.externalGraphic){r=this.getPosition(e),t.graphicTitle&&e.setAttributeNS(null,\"title\",t.graphicTitle),t.graphicWidth&&t.graphicHeight&&e.setAttributeNS(null,\"preserveAspectRatio\",\"none\");var a=t.graphicWidth||t.graphicHeight,o=t.graphicHeight||t.graphicWidth;a=a?a:2*t.pointRadius,o=o?o:2*t.pointRadius;var l=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*a),p=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*o),h=t.graphicOpacity||t.fillOpacity;e.setAttributeNS(null,\"x\",(r.x+l).toFixed()),e.setAttributeNS(null,\"y\",(r.y+p).toFixed()),e.setAttributeNS(null,\"width\",a),e.setAttributeNS(null,\"height\",o),e.setAttributeNS(this.xlinkns,\"href\",t.externalGraphic),e.setAttributeNS(null,\"style\",\"opacity: \"+h)}else if(this.isComplexSymbol(t.graphicName)){var u=3*t.pointRadius,y=2*u,c=this.importSymbol(t.graphicName),d=\"#\"+c;r=this.getPosition(e),s=this.symbolSize[c]/y;var m=e.parentNode,f=e.nextSibling;m&&m.removeChild(e),e.setAttributeNS(this.xlinkns,\"href\",d),e.setAttributeNS(null,\"width\",y),e.setAttributeNS(null,\"height\",y),e.setAttributeNS(null,\"x\",r.x-u),e.setAttributeNS(null,\"y\",r.y-u),f?m.insertBefore(e,f):m&&m.appendChild(e)}else e.setAttributeNS(null,\"r\",t.pointRadius);if(void 0!==t.rotation&&r){var L=OpenLayers.String.format(\"rotate(${0} ${1} ${2})\",[t.rotation,r.x,r.y]);e.setAttributeNS(null,\"transform\",L)}}return i.isFilled?(e.setAttributeNS(null,\"fill\",t.fillColor),e.setAttributeNS(null,\"fill-opacity\",t.fillOpacity)):e.setAttributeNS(null,\"fill\",\"none\"),i.isStroked?(e.setAttributeNS(null,\"stroke\",t.strokeColor),e.setAttributeNS(null,\"stroke-opacity\",t.strokeOpacity),e.setAttributeNS(null,\"stroke-width\",t.strokeWidth*s),e.setAttributeNS(null,\"stroke-linecap\",t.strokeLinecap),e.setAttributeNS(null,\"stroke-linejoin\",\"round\"),e.setAttributeNS(null,\"stroke-dasharray\",this.dashStyle(t,s))):e.setAttributeNS(null,\"stroke\",\"none\"),t.pointerEvents&&e.setAttributeNS(null,\"pointer-events\",t.pointerEvents),null!=t.cursor&&e.setAttributeNS(null,\"cursor\",t.cursor),e},dashStyle:function(e,t){var i=e.strokeWidth*t;switch(e.strokeDashstyle){case\"solid\":return\"none\";case\"dot\":return[1,4*i].join();case\"dash\":return[4*i,4*i].join();case\"dashdot\":return[4*i,4*i,1,4*i].join();case\"longdash\":return[8*i,4*i].join();case\"longdashdot\":return[8*i,4*i,1,4*i].join();default:return e.strokeDashstyle.replace(/ /g,\",\")}},createNode:function(e,t){var i=document.createElementNS(this.xmlns,e);return t&&i.setAttributeNS(null,\"id\",t),i},nodeTypeCompare:function(e,t){return t==e.nodeName},createRenderRoot:function(){return this.nodeFactory(this.container.id+\"_svgRoot\",\"svg\")},createRoot:function(e){return this.nodeFactory(this.container.id+e,\"g\")},createDefs:function(){var e=this.nodeFactory(this.container.id+\"_defs\",\"defs\");return this.rendererRoot.appendChild(e),e},drawPoint:function(e,t){return this.drawCircle(e,t,1)},drawCircle:function(e,t,i){var r=this.getResolution(),n=t.x/r+this.left,s=this.top-t.y/r;return!!this.inValidRange(n,s)&&(e.setAttributeNS(null,\"cx\",n),e.setAttributeNS(null,\"cy\",s),e.setAttributeNS(null,\"r\",i),e)},drawLineString:function(e,t){var i=this.getComponentsString(t.components);return!!i.path&&(e.setAttributeNS(null,\"points\",i.path),i.complete?e:null)},drawLinearRing:function(e,t){var i=this.getComponentsString(t.components);return!!i.path&&(e.setAttributeNS(null,\"points\",i.path),i.complete?e:null)},drawPolygon:function(e,t){for(var i,r,n=\"\",s=!0,a=!0,o=0,l=t.components.length;o<l;o++)n+=\" M\",i=this.getComponentsString(t.components[o].components,\" \"),r=i.path,r?(n+=\" \"+r,a=i.complete&&a):s=!1;return n+=\" z\",!!s&&(e.setAttributeNS(null,\"d\",n),e.setAttributeNS(null,\"fill-rule\",\"evenodd\"),a?e:null)},drawRectangle:function(e,t){var i=this.getResolution(),r=t.x/i+this.left,n=this.top-t.y/i;return!!this.inValidRange(r,n)&&(e.setAttributeNS(null,\"x\",r),e.setAttributeNS(null,\"y\",n),e.setAttributeNS(null,\"width\",t.width/i),e.setAttributeNS(null,\"height\",t.height/i),e)},drawSurface:function(e,t){for(var i=null,r=!0,n=0,s=t.components.length;n<s;n++)if(n%3==0&&n/3==0){var a=this.getShortString(t.components[n]);a||(r=!1),i=\"M \"+a}else if(n%3==1){var a=this.getShortString(t.components[n]);a||(r=!1),i+=\" C \"+a}else{var a=this.getShortString(t.components[n]);a||(r=!1),i+=\" \"+a}return i+=\" Z\",!!r&&(e.setAttributeNS(null,\"d\",i),e)},drawText:function(e,t,i){var r=this.getResolution(),n=i.x/r+this.left,s=i.y/r-this.top,a=this.nodeFactory(e+this.LABEL_ID_SUFFIX,\"text\"),o=this.nodeFactory(e+this.LABEL_ID_SUFFIX+\"_tspan\",\"tspan\");a.setAttributeNS(null,\"x\",n),a.setAttributeNS(null,\"y\",-s),a.setAttributeNS(null,\"pointer-events\",\"none\"),t.fontColor&&a.setAttributeNS(null,\"fill\",t.fontColor),t.fontFamily&&a.setAttributeNS(null,\"font-family\",t.fontFamily),t.fontSize&&a.setAttributeNS(null,\"font-size\",t.fontSize),t.fontWeight&&a.setAttributeNS(null,\"font-weight\",t.fontWeight);var l=t.labelAlign||\"cm\";a.setAttributeNS(null,\"text-anchor\",OpenLayers.Renderer.SVG.LABEL_ALIGN[l[0]]||\"middle\"),this.isGecko?a.setAttributeNS(null,\"dominant-baseline\",OpenLayers.Renderer.SVG.LABEL_ALIGN[l[1]]||\"central\"):o.setAttributeNS(null,\"baseline-shift\",OpenLayers.Renderer.SVG.LABEL_VSHIFT[l[1]]||\"-35%\"),o.textContent=t.label,a.parentNode||(a.appendChild(o),this.textRoot.appendChild(a))},getComponentsString:function(e,t){for(var i,r,n=[],s=!0,a=e.length,o=[],l=0;l<a;l++)r=e[l],n.push(r),i=this.getShortString(r),i?o.push(i):(l>0&&this.getShortString(e[l-1])&&o.push(this.clipLine(e[l],e[l-1])),l<a-1&&this.getShortString(e[l+1])&&o.push(this.clipLine(e[l],e[l+1])),s=!1);return{path:o.join(t||\",\"),complete:s}},clipLine:function(e,t){if(t.equals(e))return\"\";var i,r=this.getResolution(),n=this.MAX_PIXEL-this.translationParameters.x,s=this.MAX_PIXEL-this.translationParameters.y,a=t.x/r+this.left,o=this.top-t.y/r,l=e.x/r+this.left,p=this.top-e.y/r;return(l<-n||l>n)&&(i=(p-o)/(l-a),l=l<0?-n:n,p=o+(l-a)*i),(p<-s||p>s)&&(i=(l-a)/(p-o),p=p<0?-s:s,l=a+(p-o)*i),l+\",\"+p},getShortString:function(e){var t=this.getResolution(),i=e.x/t+this.left,r=this.top-e.y/t;return!!this.inValidRange(i,r)&&i+\",\"+r},getPosition:function(e){return{x:parseFloat(e.getAttributeNS(null,\"cx\")),y:parseFloat(e.getAttributeNS(null,\"cy\"))}},importSymbol:function(e){this.defs||(this.defs=this.createDefs());var t=this.container.id+\"-\"+e;if(null!=document.getElementById(t))return t;var i=OpenLayers.Renderer.symbol[e];if(!i)throw new Error(e+\" is not a valid symbol name\");var r=this.nodeFactory(t,\"symbol\"),n=this.nodeFactory(null,\"polygon\");r.appendChild(n);for(var s,a,o=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),l=\"\",p=0;p<i.length;p+=2)s=i[p],a=i[p+1],o.left=Math.min(o.left,s),o.bottom=Math.min(o.bottom,a),o.right=Math.max(o.right,s),o.top=Math.max(o.top,a),l+=\" \"+s+\",\"+a;n.setAttributeNS(null,\"points\",l);var h=o.getWidth(),u=o.getHeight(),y=[o.left-h,o.bottom-u,3*h,3*u];return r.setAttributeNS(null,\"viewBox\",y.join(\" \")),this.symbolSize[t]=3*Math.max(h,u),this.defs.appendChild(r),r.id},CLASS_NAME:\"OpenLayers.Renderer.SVG\"}),OpenLayers.Renderer.SVG.LABEL_ALIGN={l:\"start\",r:\"end\",b:\"bottom\",t:\"hanging\"},OpenLayers.Renderer.SVG.LABEL_VSHIFT={t:\"-70%\",b:\"0\"},OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:\"urn:schemas-microsoft-com:vml\",symbolCache:{},offset:null,initialize:function(e){if(this.supported()){if(!document.namespaces.olv){document.namespaces.add(\"olv\",this.xmlns);for(var t=document.createStyleSheet(),i=[\"shape\",\"rect\",\"oval\",\"fill\",\"stroke\",\"imagedata\",\"group\",\"textbox\"],r=0,n=i.length;r<n;r++)t.addRule(\"olv\\\\:\"+i[r],\"behavior: url(#default#VML); position: absolute; display: inline-block;\")}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.offset={x:0,y:0}}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return!!document.namespaces},setExtent:function(e,t){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var i=this.getResolution(),r=e.left/i,n=e.top/i-this.size.h;t?(this.offset={x:r,y:n},r=0,n=0):(r-=this.offset.x,n-=this.offset.y);var s=r+\" \"+n;this.root.coordorigin=s;for(var a,o=[this.root,this.vectorRoot,this.textRoot],l=0,p=o.length;l<p;++l){a=o[l];var h=this.size.w+\" \"+this.size.h;a.coordsize=h}return this.root.style.flip=\"y\",!0},setSize:function(e){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);for(var t,i=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],r=this.size.w+\"px\",n=this.size.h+\"px\",s=0,a=i.length;s<a;++s)t=i[s],t.style.width=r,t.style.height=n},getNodeType:function(e,t){var i=null;switch(e.CLASS_NAME){case\"OpenLayers.Geometry.Point\":i=t.externalGraphic?\"olv:rect\":this.isComplexSymbol(t.graphicName)?\"olv:shape\":\"olv:oval\";break;case\"OpenLayers.Geometry.Rectangle\":i=\"olv:rect\";break;case\"OpenLayers.Geometry.LineString\":case\"OpenLayers.Geometry.LinearRing\":case\"OpenLayers.Geometry.Polygon\":case\"OpenLayers.Geometry.Curve\":case\"OpenLayers.Geometry.Surface\":i=\"olv:shape\"}return i},setStyle:function(e,t,i,r){t=t||e._style,i=i||e._options;if(\"OpenLayers.Geometry.Point\"==e._geometryClass)if(t.externalGraphic){t.graphicTitle&&(e.title=t.graphicTitle);var n=t.graphicWidth||t.graphicHeight,s=t.graphicHeight||t.graphicWidth;n=n?n:2*t.pointRadius,s=s?s:2*t.pointRadius;var a=this.getResolution(),o=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*n),l=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*s);e.style.left=(r.x/a-this.offset.x+o).toFixed(),e.style.top=(r.y/a-this.offset.y-(l+s)).toFixed(),e.style.width=n+\"px\",e.style.height=s+\"px\",e.style.flip=\"y\",t.fillColor=\"none\",i.isStroked=!1}else if(this.isComplexSymbol(t.graphicName)){var p=this.importSymbol(t.graphicName);e.path=p.path,e.coordorigin=p.left+\",\"+p.bottom;var h=p.size;e.coordsize=h+\",\"+h,this.drawCircle(e,r,t.pointRadius),e.style.flip=\"y\"}else this.drawCircle(e,r,t.pointRadius);i.isFilled?e.fillcolor=t.fillColor:e.filled=\"false\";var u=e.getElementsByTagName(\"fill\"),y=0==u.length?null:u[0];i.isFilled?(y||(y=this.createNode(\"olv:fill\",e.id+\"_fill\")),y.opacity=t.fillOpacity,\"OpenLayers.Geometry.Point\"==e._geometryClass&&t.externalGraphic&&(t.graphicOpacity&&(y.opacity=t.graphicOpacity),y.src=t.externalGraphic,y.type=\"frame\",t.graphicWidth&&t.graphicHeight||(y.aspect=\"atmost\")),y.parentNode!=e&&e.appendChild(y)):y&&e.removeChild(y),void 0!==t.rotation&&(t.externalGraphic?(this.graphicRotate(e,o,l),y.opacity=0):e.style.rotation=t.rotation),i.isStroked?(e.strokecolor=t.strokeColor,e.strokeweight=t.strokeWidth+\"px\"):e.stroked=!1;var c=e.getElementsByTagName(\"stroke\"),d=0==c.length?null:c[0];return i.isStroked?(d||(d=this.createNode(\"olv:stroke\",e.id+\"_stroke\"),e.appendChild(d)),d.opacity=t.strokeOpacity,d.endcap=t.strokeLinecap&&\"butt\"!=t.strokeLinecap?t.strokeLinecap:\"flat\",d.dashstyle=this.dashStyle(t)):d&&e.removeChild(d),\"inherit\"!=t.cursor&&null!=t.cursor&&(e.style.cursor=t.cursor),e},graphicRotate:function(e,t,i){var r,n,s=s||e._style;e._options;if(!s.graphicWidth||!s.graphicHeight){var a=new Image;return a.onreadystatechange=OpenLayers.Function.bind(function(){\"complete\"!=a.readyState&&\"interactive\"!=a.readyState||(r=a.width/a.height,n=Math.max(2*s.pointRadius,s.graphicWidth||0,s.graphicHeight||0),t*=r,s.graphicWidth=n*r,s.graphicHeight=n,this.graphicRotate(e,t,i))},this),void(a.src=s.externalGraphic)}n=Math.max(s.graphicWidth,s.graphicHeight),r=s.graphicWidth/s.graphicHeight;var o=Math.round(s.graphicWidth||n*r),l=Math.round(s.graphicHeight||n);e.style.width=o+\"px\",e.style.height=l+\"px\";var p=document.getElementById(e.id+\"_image\");p||(p=this.createNode(\"olv:imagedata\",e.id+\"_image\"),e.appendChild(p)),p.style.width=o+\"px\",p.style.height=l+\"px\",p.src=s.externalGraphic,p.style.filter=\"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')\";var h=s.rotation*Math.PI/180,u=Math.sin(h),y=Math.cos(h),c=\"progid:DXImageTransform.Microsoft.Matrix(M11=\"+y+\",M12=\"+-u+\",M21=\"+u+\",M22=\"+y+\",SizingMethod='auto expand')\\n\",d=s.graphicOpacity||s.fillOpacity;d&&1!=d&&(c+=\"progid:DXImageTransform.Microsoft.BasicImage(opacity=\"+d+\")\\n\"),e.style.filter=c;var m=new OpenLayers.Geometry.Point(-t,-i),f=new OpenLayers.Bounds(0,0,o,l).toGeometry();f.rotate(s.rotation,m);var L=f.getBounds();e.style.left=Math.round(parseInt(e.style.left)+L.left)+\"px\",e.style.top=Math.round(parseInt(e.style.top)-L.bottom)+\"px\"},postDraw:function(e){var t=e._style.fillColor,i=e._style.strokeColor;\"none\"==t&&e.fillcolor!=t&&(e.fillcolor=t),\"none\"==i&&e.strokecolor!=i&&(e.strokecolor=i)},setNodeDimension:function(e,t){var i=t.getBounds();if(i){var r=this.getResolution(),n=new OpenLayers.Bounds((i.left/r-this.offset.x).toFixed(),(i.bottom/r-this.offset.y).toFixed(),(i.right/r-this.offset.x).toFixed(),(i.top/r-this.offset.y).toFixed());e.style.left=n.left+\"px\",e.style.top=n.top+\"px\",e.style.width=n.getWidth()+\"px\",e.style.height=n.getHeight()+\"px\",e.coordorigin=n.left+\" \"+n.top,e.coordsize=n.getWidth()+\" \"+n.getHeight()}},dashStyle:function(e){var t=e.strokeDashstyle;switch(t){case\"solid\":case\"dot\":case\"dash\":case\"dashdot\":case\"longdash\":case\"longdashdot\":return t;default:var i=t.split(/[ ,]/);return 2==i.length?1*i[0]>=2*i[1]?\"longdash\":1==i[0]||1==i[1]?\"dot\":\"dash\":4==i.length?1*i[0]>=2*i[1]?\"longdashdot\":\"dashdot\":\"solid\"}},createNode:function(e,t){var i=document.createElement(e);return t&&(i.id=t),i.unselectable=\"on\",i.onselectstart=function(){return!1},i},nodeTypeCompare:function(e,t){var i=t,r=i.indexOf(\":\");r!=-1&&(i=i.substr(r+1));var n=e.nodeName;return r=n.indexOf(\":\"),r!=-1&&(n=n.substr(r+1)),i==n},createRenderRoot:function(){return this.nodeFactory(this.container.id+\"_vmlRoot\",\"div\")},createRoot:function(e){return this.nodeFactory(this.container.id+e,\"olv:group\")},drawPoint:function(e,t){return this.drawCircle(e,t,1)},drawCircle:function(e,t,i){if(!isNaN(t.x)&&!isNaN(t.y)){var r=this.getResolution();e.style.left=(t.x/r-this.offset.x).toFixed()-i+\"px\",e.style.top=(t.y/r-this.offset.y).toFixed()-i+\"px\";var n=2*i;return e.style.width=n+\"px\",e.style.height=n+\"px\",e}return!1},drawLineString:function(e,t){return this.drawLine(e,t,!1)},drawLinearRing:function(e,t){return this.drawLine(e,t,!0)},drawLine:function(e,t,i){this.setNodeDimension(e,t);for(var r,n,s,a=this.getResolution(),o=t.components.length,l=new Array(o),p=0;p<o;p++)r=t.components[p],n=r.x/a-this.offset.x,s=r.y/a-this.offset.y,l[p]=\" \"+n.toFixed()+\",\"+s.toFixed()+\" l \";var h=i?\" x e\":\" e\";return e.path=\"m\"+l.join(\"\")+h,e},drawPolygon:function(e,t){this.setNodeDimension(e,t);var i,r,n,s,a,o,l,p,h=this.getResolution(),u=[];for(n=0,s=t.components.length;n<s;n++){for(i=t.components[n],u.push(\"m\"),r=0,a=i.components.length;r<a;r++)o=i.components[r],l=o.x/h-this.offset.x,p=o.y/h-this.offset.y,u.push(\" \"+l.toFixed()+\",\"+p.toFixed()),0==r&&u.push(\" l\");u.push(\" x \")}return u.push(\"e\"),e.path=u.join(\"\"),e},drawRectangle:function(e,t){var i=this.getResolution();return e.style.left=t.x/i-this.offset.x+\"px\",e.style.top=t.y/i-this.offset.y+\"px\",e.style.width=t.width/i+\"px\",e.style.height=t.height/i+\"px\",e},drawText:function(e,t,i){var r=this.nodeFactory(e+this.LABEL_ID_SUFFIX,\"olv:rect\"),n=this.nodeFactory(e+this.LABEL_ID_SUFFIX+\"_textbox\",\"olv:textbox\"),s=this.getResolution();r.style.left=(i.x/s-this.offset.x).toFixed()+\"px\",r.style.top=(i.y/s-this.offset.y).toFixed()+\"px\",r.style.flip=\"y\",n.innerText=t.label,t.fillColor&&(n.style.color=t.fontColor),t.fontFamily&&(n.style.fontFamily=t.fontFamily),t.fontSize&&(n.style.fontSize=t.fontSize),t.fontWeight&&(n.style.fontWeight=t.fontWeight),n.style.whiteSpace=\"nowrap\",n.inset=\"1px,0px,0px,0px\",r.parentNode||(r.appendChild(n),this.textRoot.appendChild(r));var a=t.labelAlign||\"cm\",o=n.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[a.substr(0,1)],l=n.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[a.substr(1,1)];r.style.left=parseInt(r.style.left)-o-1+\"px\",r.style.top=parseInt(r.style.top)+l+\"px\"},drawSurface:function(e,t){this.setNodeDimension(e,t);for(var i,r,n,s=this.getResolution(),a=[],o=0,l=t.components.length;o<l;o++)i=t.components[o],r=i.x/s-this.offset.x,n=i.y/s-this.offset.y,o%3==0&&o/3==0?a.push(\"m\"):o%3==1&&a.push(\" c\"),a.push(\" \"+r+\",\"+n);return a.push(\" x e\"),e.path=a.join(\"\"),e},moveRoot:function(e){var t=this.map.getLayer(e.container.id);t instanceof OpenLayers.Layer.Vector.RootContainer&&(t=this.map.getLayer(this.container.id)),t&&t.renderer.clear(),OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments),t&&t.redraw()},importSymbol:function(e){var t=this.container.id+\"-\"+e,i=this.symbolCache[t];if(i)return i;var r=OpenLayers.Renderer.symbol[e];if(!r)throw new Error(e+\" is not a valid symbol name\");for(var n=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),s=[\"m\"],a=0;a<r.length;a+=2)x=r[a],y=r[a+1],n.left=Math.min(n.left,x),n.bottom=Math.min(n.bottom,y),n.right=Math.max(n.right,x),n.top=Math.max(n.top,y),s.push(x),s.push(y),0==a&&s.push(\"l\");s.push(\"x e\");var o=s.join(\" \"),l=(n.getWidth()-n.getHeight())/2;return l>0?(n.bottom=n.bottom-l,n.top=n.top+l):(n.left=n.left-l,n.right=n.right+l),i={path:o,size:n.getWidth(),left:n.left,bottom:n.bottom},this.symbolCache[t]=i,i},CLASS_NAME:\"OpenLayers.Renderer.VML\"}),OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:.5,r:1,t:0,m:.5,b:1},OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:[\"loadstart\",\"loadend\",\"reload\",\"unload\"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:!1,initialize:function(e,t,i,r,n){this.layer=e,this.position=t.clone(),this.bounds=i.clone(),this.url=r,this.size=n.clone(),this.id=OpenLayers.Util.createUniqueID(\"Tile_\"),this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},unload:function(){this.isLoading&&(this.isLoading=!1,this.events.triggerEvent(\"unload\"))},destroy:function(){this.layer=null,this.bounds=null,this.size=null,this.position=null,this.events.destroy(),this.events=null},clone:function(e){return null==e&&(e=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)),OpenLayers.Util.applyDefaults(e,this),e},draw:function(){var e=this.layer.maxExtent,t=e&&this.bounds.intersectsBounds(e,!1);return this.shouldDraw=t||this.layer.displayOutsideMaxExtent,this.clear(),this.shouldDraw},moveTo:function(e,t,i){null==i&&(i=!0),this.bounds=e.clone(),this.position=t.clone(),i&&this.draw()},clear:function(){},getBoundsFromBaseLayer:function(e){var t=OpenLayers.i18n(\"reprojectDeprecated\",{layerName:this.layer.name});OpenLayers.Console.warn(t);var i=this.layer.map.getLonLatFromLayerPx(e),r=e.clone();r.x+=this.size.w,r.y+=this.size.h;var n=this.layer.map.getLonLatFromLayerPx(r);return i.lon>n.lon&&(i.lon<0?i.lon=-180-(i.lon+180):n.lon=180+n.lon+180),new OpenLayers.Bounds(i.lon,n.lat,n.lon,i.lat)},showTile:function(){this.shouldDraw&&this.show()},show:function(){},hide:function(){},CLASS_NAME:\"OpenLayers.Tile\"}),OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:\"vertical\",buttonClicked:null,initialize:function(e,t){OpenLayers.Control.prototype.initialize.apply(this,arguments),this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y),e&&(this.position=e),t&&(this.direction=t),this.measureDivs=[]},destroy:function(){for(var e in this.buttons){var t=this.buttons[e];t.map=null,t.events.destroy()}OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments),OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments),this.buttons={};var e=new OpenLayers.Size(28,28),t=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);return this._addButton(\"zoombox\",\"drag-rectangle-off.png\",\"drag-rectangle-on.png\",t,e,\"Shift->Drag to zoom to area\"),t=t.add(\"vertical\"==this.direction?0:e.w,\"vertical\"==this.direction?e.h:0),this._addButton(\"pan\",\"panning-hand-off.png\",\"panning-hand-on.png\",t,e,\"Drag the map to pan.\"),t=t.add(\"vertical\"==this.direction?0:e.w,\"vertical\"==this.direction?e.h:0),this.switchModeTo(\"pan\"),this.div},_addButton:function(e,t,i,r,n,s){var a=OpenLayers.Util.getImagesLocation()+t,o=OpenLayers.Util.getImagesLocation()+i,l=OpenLayers.Util.createAlphaImageDiv(\"OpenLayers_Control_MouseToolbar_\"+e,r,n,a,\"absolute\");return this.div.appendChild(l),l.imgLocation=a,l.activeImgLocation=o,l.events=new OpenLayers.Events(this,l,null,!0),l.events.on({mousedown:this.buttonDown,mouseup:this.buttonUp,dblclick:OpenLayers.Event.stop,scope:this}),l.action=e,l.title=s,l.alt=s,l.map=this.map,this.buttons[e]=l,l},buttonDown:function(e){OpenLayers.Event.isLeftClick(e)&&(this.buttonClicked=e.element.action,OpenLayers.Event.stop(e))},buttonUp:function(e){OpenLayers.Event.isLeftClick(e)&&null!=this.buttonClicked&&(this.buttonClicked==e.element.action&&this.switchModeTo(e.element.action),OpenLayers.Event.stop(e),this.buttonClicked=null)},defaultDblClick:function(e){this.switchModeTo(\"pan\"),this.performedDrag=!1;var t=this.map.getLonLatFromViewPortPx(e.xy);return this.map.setCenter(t,this.map.zoom+1),OpenLayers.Event.stop(e),!1},defaultMouseDown:function(e){if(OpenLayers.Event.isLeftClick(e)){switch(this.mouseDragStart=e.xy.clone(),this.performedDrag=!1,this.startViaKeyboard=!1,e.shiftKey&&\"zoombox\"!=this.mode?(this.switchModeTo(\"zoombox\"),this.startViaKeyboard=!0):e.altKey&&\"measure\"!=this.mode?this.switchModeTo(\"measure\"):this.mode||this.switchModeTo(\"pan\"),this.mode){case\"zoombox\":this.map.div.style.cursor=\"crosshair\",this.zoomBox=OpenLayers.Util.createDiv(\"zoomBox\",this.mouseDragStart,null,null,\"absolute\",\"2px solid red\"),this.zoomBox.style.backgroundColor=\"white\",this.zoomBox.style.filter=\"alpha(opacity=50)\",this.zoomBox.style.opacity=\"0.50\",this.zoomBox.style.fontSize=\"1px\",this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.viewPortDiv.appendChild(this.zoomBox),this.performedDrag=!0;break;case\"measure\":var t=\"\";if(this.measureStart){var i=this.map.getLonLatFromViewPortPx(this.mouseDragStart);t=OpenLayers.Util.distVincenty(this.measureStart,i),t=Math.round(100*t)/100,t+=\"km\",this.measureStartBox=this.measureBox}this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart),this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,\"absolute\"),this.measureBox.style.width=\"4px\",this.measureBox.style.height=\"4px\",this.measureBox.style.fontSize=\"1px\",this.measureBox.style.backgroundColor=\"red\",this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.layerContainerDiv.appendChild(this.measureBox),t&&(this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,\"absolute\"),this.measureBoxDistance.innerHTML=t,this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.layerContainerDiv.appendChild(this.measureBoxDistance),this.measureDivs.push(this.measureBoxDistance)),this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.layerContainerDiv.appendChild(this.measureBox),this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor=\"move\"}document.onselectstart=function(){return!1},OpenLayers.Event.stop(e)}},switchModeTo:function(e){if(e!=this.mode){if(this.mode&&this.buttons[this.mode]&&OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation),\"measure\"==this.mode&&\"measure\"!=e){for(var t=0,i=this.measureDivs.length;t<i;t++)this.measureDivs[t]&&this.map.layerContainerDiv.removeChild(this.measureDivs[t]);this.measureDivs=[],this.measureStart=null}switch(this.mode=e,this.buttons[e]&&OpenLayers.Util.modifyAlphaImageDiv(this.buttons[e],null,null,null,this.buttons[e].activeImgLocation),this.mode){case\"zoombox\":this.map.div.style.cursor=\"crosshair\";break;default:this.map.div.style.cursor=\"\"}}},leaveMode:function(){this.switchModeTo(\"pan\")},defaultMouseMove:function(e){if(null!=this.mouseDragStart){switch(this.mode){case\"zoombox\":var t=Math.abs(this.mouseDragStart.x-e.xy.x),i=Math.abs(this.mouseDragStart.y-e.xy.y);this.zoomBox.style.width=Math.max(1,t)+\"px\",this.zoomBox.style.height=Math.max(1,i)+\"px\",e.xy.x<this.mouseDragStart.x&&(this.zoomBox.style.left=e.xy.x+\"px\"),e.xy.y<this.mouseDragStart.y&&(this.zoomBox.style.top=e.xy.y+\"px\");break;default:var t=this.mouseDragStart.x-e.xy.x,i=this.mouseDragStart.y-e.xy.y,r=this.map.getSize(),n=new OpenLayers.Pixel(r.w/2+t,r.h/2+i),s=this.map.getLonLatFromViewPortPx(n);this.map.setCenter(s,null,!0),this.mouseDragStart=e.xy.clone()}this.performedDrag=!0}},defaultMouseUp:function(e){if(OpenLayers.Event.isLeftClick(e)){switch(this.mode){case\"zoombox\":this.zoomBoxEnd(e),this.startViaKeyboard&&this.leaveMode();break;case\"pan\":this.performedDrag&&this.map.setCenter(this.map.center)}document.onselectstart=null,this.mouseDragStart=null,this.map.div.style.cursor=\"default\"}},defaultMouseOut:function(e){null!=this.mouseDragStart&&OpenLayers.Util.mouseLeft(e,this.map.div)&&(this.zoomBox&&(this.removeZoomBox(),this.startViaKeyboard&&this.leaveMode()),this.mouseDragStart=null,this.map.div.style.cursor=\"default\")},defaultClick:function(e){if(this.performedDrag)return this.performedDrag=!1,!1},CLASS_NAME:\"OpenLayers.Control.MouseToolbar\"}),OpenLayers.Control.MouseToolbar.X=6,OpenLayers.Control.MouseToolbar.Y=300,OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:!0,clearOnDeactivate:!1,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:!1,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,[e]),this.registry=OpenLayers.Util.extend({moveend:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution()}}},this.registry),this.clear();var t={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+\" \"+this.displayClass+\"Previous\"};OpenLayers.Util.extend(t,this.previousOptions),this.previous=new OpenLayers.Control.Button(t)\n;var i={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+\" \"+this.displayClass+\"Next\"};OpenLayers.Util.extend(i,this.nextOptions),this.next=new OpenLayers.Control.Button(i)},onPreviousChange:function(e,t){e&&!this.previous.active?this.previous.activate():!e&&this.previous.active&&this.previous.deactivate()},onNextChange:function(e,t){e&&!this.next.active?this.next.activate():!e&&this.next.active&&this.next.deactivate()},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this),this.previous.destroy(),this.next.destroy(),this.deactivate();for(var e in this)this[e]=null},setMap:function(e){this.map=e,this.next.setMap(e),this.previous.setMap(e)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments),this.next.draw(),this.previous.draw(),this.activateOnDraw&&this.activate()},previousTrigger:function(){var e=this.previousStack.shift(),t=this.previousStack.shift();return void 0!=t?(this.nextStack.unshift(e),this.previousStack.unshift(t),this.restoring=!0,this.restore(t),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)):this.previousStack.unshift(e),t},nextTrigger:function(){var e=this.nextStack.shift();return void 0!=e&&(this.previousStack.unshift(e),this.restoring=!0,this.restore(e),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)),e},clear:function(){this.previousStack=[],this.nextStack=[]},restore:function(e){var t=this.map.getZoomForResolution(e.resolution);this.map.setCenter(e.center,t)},setListeners:function(){this.listeners={};for(var e in this.registry)this.listeners[e]=OpenLayers.Function.bind(function(){if(!this.restoring){var t=this.registry[e].apply(this,arguments);this.previousStack.unshift(t),this.previousStack.length>1&&this.onPreviousChange(this.previousStack[1],this.previousStack.length-1),this.previousStack.length>this.limit+1&&this.previousStack.pop(),this.nextStack.length>0&&(this.nextStack=[],this.onNextChange(null,0))}return!0},this)},activate:function(){var e=!1;if(this.map&&OpenLayers.Control.prototype.activate.apply(this)){null==this.listeners&&this.setListeners();for(var t in this.listeners)this.map.events.register(t,this,this.listeners[t]);e=!0,0==this.previousStack.length&&this.initStack()}return e},initStack:function(){this.map.getCenter()&&this.listeners.moveend()},deactivate:function(){var e=!1;if(this.map&&OpenLayers.Control.prototype.deactivate.apply(this)){for(var t in this.listeners)this.map.events.unregister(t,this,this.listeners[t]);this.clearOnDeactivate&&this.clear(),e=!0}return e},CLASS_NAME:\"OpenLayers.Control.NavigationHistory\"}),OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(e){OpenLayers.Control.Panel.prototype.initialize.apply(this,[e]),this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)])},CLASS_NAME:\"OpenLayers.Control.PanPanel\"}),OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:!1,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this._removeZoomBar(),this.map.events.un({changebaselayer:this.redraw,scope:this}),OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments),this.map.events.register(\"changebaselayer\",this,this.redraw)},redraw:function(){null!=this.div&&(this.removeButtons(),this._removeZoomBar()),this.draw()},draw:function(e){OpenLayers.Control.prototype.draw.apply(this,arguments),e=this.position.clone(),this.buttons=[];var t=new OpenLayers.Size(18,18),i=new OpenLayers.Pixel(e.x+t.w/2,e.y),r=t.w;return this.zoomWorldIcon&&(i=new OpenLayers.Pixel(e.x+t.w,e.y)),this._addButton(\"panup\",\"north-mini.png\",i,t),e.y=i.y+t.h,this._addButton(\"panleft\",\"west-mini.png\",e,t),this.zoomWorldIcon&&(this._addButton(\"zoomworld\",\"zoom-world-mini.png\",e.add(t.w,0),t),r*=2),this._addButton(\"panright\",\"east-mini.png\",e.add(r,0),t),this._addButton(\"pandown\",\"south-mini.png\",i.add(0,2*t.h),t),this._addButton(\"zoomin\",\"zoom-plus-mini.png\",i.add(0,3*t.h+5),t),i=this._addZoomBar(i.add(0,4*t.h+5)),this._addButton(\"zoomout\",\"zoom-minus-mini.png\",i,t),this.div},_addZoomBar:function(e){var t=OpenLayers.Util.getImagesLocation(),i=this.id+\"_\"+this.map.id,r=this.map.getNumZoomLevels()-1-this.map.getZoom(),n=OpenLayers.Util.createAlphaImageDiv(i,e.add(-1,r*this.zoomStopHeight),new OpenLayers.Size(20,9),t+\"slider.png\",\"absolute\");this.slider=n,this.sliderEvents=new OpenLayers.Events(this,n,null,!0,{includeXY:!0}),this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var s=new OpenLayers.Size;s.h=this.zoomStopHeight*this.map.getNumZoomLevels(),s.w=this.zoomStopWidth;var a=null;if(OpenLayers.Util.alphaHack()){var i=this.id+\"_\"+this.map.id;a=OpenLayers.Util.createAlphaImageDiv(i,e,new OpenLayers.Size(s.w,this.zoomStopHeight),t+\"zoombar.png\",\"absolute\",null,\"crop\"),a.style.height=s.h+\"px\"}else a=OpenLayers.Util.createDiv(\"OpenLayers_Control_PanZoomBar_Zoombar\"+this.map.id,e,s,t+\"zoombar.png\");return this.zoombarDiv=a,this.divEvents=new OpenLayers.Events(this,a,null,!0,{includeXY:!0}),this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick}),this.div.appendChild(a),this.startTop=parseInt(a.style.top),this.div.appendChild(n),this.map.events.register(\"zoomend\",this,this.moveZoomBar),e=e.add(0,this.zoomStopHeight*this.map.getNumZoomLevels())},_removeZoomBar:function(){this.sliderEvents.un({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick}),this.sliderEvents.destroy(),this.divEvents.un({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick}),this.divEvents.destroy(),this.div.removeChild(this.zoombarDiv),this.zoombarDiv=null,this.div.removeChild(this.slider),this.slider=null,this.map.events.unregister(\"zoomend\",this,this.moveZoomBar)},passEventToSlider:function(e){this.sliderEvents.handleBrowserEvent(e)},divClick:function(e){if(OpenLayers.Event.isLeftClick(e)){var t=e.xy.y,i=OpenLayers.Util.pagePosition(e.object)[1],r=(t-i)/this.zoomStopHeight;this.map.fractionalZoom||(r=Math.floor(r));var n=this.map.getNumZoomLevels()-1-r;n=Math.min(Math.max(n,0),this.map.getNumZoomLevels()-1),this.map.zoomTo(n),OpenLayers.Event.stop(e)}},zoomBarDown:function(e){OpenLayers.Event.isLeftClick(e)&&(this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this}),this.mouseDragStart=e.xy.clone(),this.zoomStart=e.xy.clone(),this.div.style.cursor=\"move\",this.zoombarDiv.offsets=null,OpenLayers.Event.stop(e))},zoomBarDrag:function(e){if(null!=this.mouseDragStart){var t=this.mouseDragStart.y-e.xy.y,i=OpenLayers.Util.pagePosition(this.zoombarDiv);if(e.clientY-i[1]>0&&e.clientY-i[1]<parseInt(this.zoombarDiv.style.height)-2){var r=parseInt(this.slider.style.top)-t;this.slider.style.top=r+\"px\",this.mouseDragStart=e.xy.clone()}OpenLayers.Event.stop(e)}},zoomBarUp:function(e){if(OpenLayers.Event.isLeftClick(e)&&this.zoomStart){this.div.style.cursor=\"\",this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var t=this.zoomStart.y-e.xy.y,i=this.map.zoom;this.map.fractionalZoom?(i+=t/this.zoomStopHeight,i=Math.min(Math.max(i,0),this.map.getNumZoomLevels()-1)):i+=Math.round(t/this.zoomStopHeight),this.map.zoomTo(i),this.moveZoomBar(),this.mouseDragStart=null,OpenLayers.Event.stop(e)}},moveZoomBar:function(){var e=(this.map.getNumZoomLevels()-1-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=e+\"px\"},CLASS_NAME:\"OpenLayers.Control.PanZoomBar\"}),OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,base:\"\",displayProjection:null,initialize:function(e,t,i){OpenLayers.Control.prototype.initialize.apply(this,[i]),this.element=OpenLayers.Util.getElement(e),this.base=t||document.location.href},destroy:function(){this.element.parentNode==this.div&&this.div.removeChild(this.element),this.element=null,this.map.events.unregister(\"moveend\",this,this.updateLink),OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var t=0,i=this.map.controls.length;t<i;t++){var r=this.map.controls[t];if(r.CLASS_NAME==this.argParserClass.CLASS_NAME){r.displayProjection!=this.displayProjection&&(this.displayProjection=r.displayProjection);break}}t==this.map.controls.length&&this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.div.className=this.displayClass,this.element=document.createElement(\"a\"),this.element.innerHTML=OpenLayers.i18n(\"permalink\"),this.element.href=\"\",this.div.appendChild(this.element)),this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this}),this.updateLink(),this.div},updateLink:function(){var e=this.base;e.indexOf(\"?\")!=-1&&(e=e.substring(0,e.indexOf(\"?\"))),e+=\"?\"+OpenLayers.Util.getParameterString(this.createParams()),this.element.href=e},createParams:function(e,t,i){e=e||this.map.getCenter();var r=OpenLayers.Util.getParameters(this.base);if(e){r.zoom=t||this.map.getZoom();var n=e.lat,s=e.lon;if(this.displayProjection){var a=OpenLayers.Projection.transform({x:s,y:n},this.map.getProjectionObject(),this.displayProjection);s=a.x,n=a.y}r.lat=Math.round(1e5*n)/1e5,r.lon=Math.round(1e5*s)/1e5,i=i||this.map.layers,r.layers=\"\";for(var o=0,l=i.length;o<l;o++){var p=i[o];p.isBaseLayer?r.layers+=p==this.map.baseLayer?\"B\":\"0\":r.layers+=p.getVisibility()?\"T\":\"F\"}}return r},CLASS_NAME:\"OpenLayers.Control.Permalink\"}),OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(e){OpenLayers.Control.Panel.prototype.initialize.apply(this,[e]),this.addControls([new OpenLayers.Control.ZoomIn,new OpenLayers.Control.ZoomToMaxExtent,new OpenLayers.Control.ZoomOut])},CLASS_NAME:\"OpenLayers.Control.ZoomPanel\"}),OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:\"    \",space:\" \",newline:\"\\n\",level:0,pretty:!1,initialize:function(e){OpenLayers.Format.prototype.initialize.apply(this,[e])},read:function(json,filter){function walk(e,t){if(t&&\"object\"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(t[i]=walk(i,t[i]));return filter(e,t)}try{if(/^[\\],:{}\\s]*$/.test(json.replace(/\\\\[\"\\\\\\/bfnrtu]/g,\"@\").replace(/\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g,\"]\").replace(/(?:^|:|,)(?:\\s*\\[)+/g,\"\"))){var object=eval(\"(\"+json+\")\");return\"function\"==typeof filter&&(object=walk(\"\",object)),this.keepData&&(this.data=object),object}}catch(e){}return null},write:function(e,t){this.pretty=!!t;var i=null,r=typeof e;if(this.serialize[r])try{i=this.serialize[r].apply(this,[e])}catch(e){OpenLayers.Console.error(\"Trouble serializing: \"+e)}return i},writeIndent:function(){var e=[];if(this.pretty)for(var t=0;t<this.level;++t)e.push(this.indent);return e.join(\"\")},writeNewline:function(){return this.pretty?this.newline:\"\"},writeSpace:function(){return this.pretty?this.space:\"\"},serialize:{object:function(e){if(null==e)return\"null\";if(e.constructor==Date)return this.serialize.date.apply(this,[e]);if(e.constructor==Array)return this.serialize.array.apply(this,[e]);var t=[\"{\"];this.level+=1;var i,r,n,s=!1;for(i in e)e.hasOwnProperty(i)&&(r=OpenLayers.Format.JSON.prototype.write.apply(this,[i,this.pretty]),n=OpenLayers.Format.JSON.prototype.write.apply(this,[e[i],this.pretty]),null!=r&&null!=n&&(s&&t.push(\",\"),t.push(this.writeNewline(),this.writeIndent(),r,\":\",this.writeSpace(),n),s=!0));return this.level-=1,t.push(this.writeNewline(),this.writeIndent(),\"}\"),t.join(\"\")},array:function(e){var t,i=[\"[\"];this.level+=1;for(var r=0,n=e.length;r<n;++r)null!=(t=OpenLayers.Format.JSON.prototype.write.apply(this,[e[r],this.pretty]))&&(r>0&&i.push(\",\"),i.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),\"]\"),i.join(\"\")},string:function(e){var t={\"\\b\":\"\\\\b\",\"\\t\":\"\\\\t\",\"\\n\":\"\\\\n\",\"\\f\":\"\\\\f\",\"\\r\":\"\\\\r\",'\"':'\\\\\"',\"\\\\\":\"\\\\\\\\\"};return/[\"\\\\\\x00-\\x1f]/.test(e)?'\"'+e.replace(/([\\x00-\\x1f\\\\\"])/g,function(e,i){var r=t[i];return r?r:(r=i.charCodeAt(),\"\\\\u00\"+Math.floor(r/16).toString(16)+(r%16).toString(16))})+'\"':'\"'+e+'\"'},number:function(e){return isFinite(e)?String(e):\"null\"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?\"0\"+e:e}return'\"'+e.getFullYear()+\"-\"+t(e.getMonth()+1)+\"-\"+t(e.getDate())+\"T\"+t(e.getHours())+\":\"+t(e.getMinutes())+\":\"+t(e.getSeconds())+'\"'}},CLASS_NAME:\"OpenLayers.Format.JSON\"}),OpenLayers.Format.WFST=function(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Format.WFST.DEFAULTS);var t=OpenLayers.Format.WFST[\"v\"+e.version.replace(/\\./g,\"_\")];if(!t)throw\"Unsupported WFST version: \"+e.version;return new t(e)},OpenLayers.Format.WFST.DEFAULTS={version:\"1.0.0\"},OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:\"1.1.1\",version:null,parser:null,initialize:function(e){OpenLayers.Format.prototype.initialize.apply(this,[e]),this.options=e},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=e.documentElement,i=this.version||t.getAttribute(\"version\")||this.defaultVersion;if(!this.parser||this.parser.version!==i){var r=OpenLayers.Format.WMSCapabilities[\"v\"+i.replace(/\\./g,\"_\")];if(!r)throw\"Can't find a WMS capabilities parser for version \"+i;var n=new r(this.options)}var s=n.read(e);return s.version=i,s},CLASS_NAME:\"OpenLayers.Format.WMSCapabilities\"}),OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(e){window.ActiveXObject&&(this.xmldom=new ActiveXObject(\"Microsoft.XMLDOM\")),OpenLayers.Format.prototype.initialize.apply(this,[e]),this.namespaces=OpenLayers.Util.extend({},this.namespaces),this.namespaceAlias={};for(var t in this.namespaces)this.namespaceAlias[this.namespaces[t]]=t},destroy:function(){this.xmldom=null,OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(e,t){this.namespaces[e]=t,this.namespaceAlias[t]=e},read:function(e){var t=e.indexOf(\"<\");t>0&&(e=e.substring(t));var i=OpenLayers.Util.Try(OpenLayers.Function.bind(function(){var t;return t=window.ActiveXObject&&!this.xmldom?new ActiveXObject(\"Microsoft.XMLDOM\"):this.xmldom,t.loadXML(e),t},this),function(){return(new DOMParser).parseFromString(e,\"text/xml\")},function(){var t=new XMLHttpRequest;return t.open(\"GET\",\"data:text/xml;charset=utf-8,\"+encodeURIComponent(e),!1),t.overrideMimeType&&t.overrideMimeType(\"text/xml\"),t.send(null),t.responseXML});return this.keepData&&(this.data=i),i},write:function(e){var t;if(this.xmldom)t=e.xml;else{var i=new XMLSerializer;if(1==e.nodeType){var r=document.implementation.createDocument(\"\",\"\",null);r.importNode&&(e=r.importNode(e,!0)),r.appendChild(e),t=i.serializeToString(r)}else t=i.serializeToString(e)}return t},createElementNS:function(e,t){return this.xmldom?\"string\"==typeof e?this.xmldom.createNode(1,t,e):this.xmldom.createNode(1,t,\"\"):document.createElementNS(e,t)},createTextNode:function(e){return this.xmldom?this.xmldom.createTextNode(e):document.createTextNode(e)},getElementsByTagNameNS:function(e,t,i){var r=[];if(e.getElementsByTagNameNS)r=e.getElementsByTagNameNS(t,i);else for(var n,s,a=e.getElementsByTagName(\"*\"),o=0,l=a.length;o<l;++o)n=a[o],s=n.prefix?n.prefix+\":\"+i:i,\"*\"!=i&&s!=n.nodeName||\"*\"!=t&&t!=n.namespaceURI||r.push(n);return r},getAttributeNodeNS:function(e,t,i){var r=null;if(e.getAttributeNodeNS)r=e.getAttributeNodeNS(t,i);else for(var n,s=e.attributes,a=0,o=s.length;a<o;++a)if(n=s[a],n.namespaceURI==t&&(n.prefix?n.prefix+\":\"+i:i)==n.nodeName){r=n;break}return r},getAttributeNS:function(e,t,i){var r=\"\";if(e.getAttributeNS)r=e.getAttributeNS(t,i)||\"\";else{var n=this.getAttributeNodeNS(e,t,i);n&&(r=n.nodeValue)}return r},getChildValue:function(e,t){var i=t||\"\";if(e)for(var r=e.firstChild;r;r=r.nextSibling)switch(r.nodeType){case 3:case 4:i+=r.nodeValue}return i},concatChildValues:function(e,t){for(var i,r=\"\",n=e.firstChild;n;)i=n.nodeValue,i&&(r+=i),n=n.nextSibling;return\"\"==r&&void 0!=t&&(r=t),r},isSimpleContent:function(e){for(var t=!0,i=e.firstChild;i;i=i.nextSibling)if(1===i.nodeType){t=!1;break}return t},contentType:function(e){for(var t=!1,i=!1,r=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY,n=e.firstChild;n;n=n.nextSibling){switch(n.nodeType){case 1:i=!0;break;case 8:break;default:t=!0}if(i&&t)break}if(i&&t)r=OpenLayers.Format.XML.CONTENT_TYPE.MIXED;else{if(i)return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX;if(t)return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}return r},hasAttributeNS:function(e,t,i){return e.hasAttributeNS?e.hasAttributeNS(t,i):!!this.getAttributeNodeNS(e,t,i)},setAttributeNS:function(e,t,i,r){if(e.setAttributeNS)e.setAttributeNS(t,i,r);else{if(!this.xmldom)throw\"setAttributeNS not implemented\";if(t){var n=e.ownerDocument.createNode(2,i,t);n.nodeValue=r,e.setAttributeNode(n)}else e.setAttribute(i,r)}},createElementNSPlus:function(e,t){t=t||{};var i=t.uri||this.namespaces[t.prefix];if(!i){var r=e.indexOf(\":\");i=this.namespaces[e.substring(0,r)]}i||(i=this.namespaces[this.defaultPrefix]);var n=this.createElementNS(i,e);t.attributes&&this.setAttributes(n,t.attributes);var s=t.value;return null!=s&&(\"boolean\"==typeof s&&(s=String(s)),n.appendChild(this.createTextNode(s))),n},setAttributes:function(e,t){var i,r;for(var n in t)null!=t[n]&&t[n].toString&&(i=t[n].toString(),r=this.namespaces[n.substring(0,n.indexOf(\":\"))]||null,this.setAttributeNS(e,r,n,i))},readNode:function(e,t){t||(t={});var i=this.readers[this.namespaceAlias[e.namespaceURI]];if(i){var r=e.localName||e.nodeName.split(\":\").pop(),n=i[r]||i[\"*\"];n&&n.apply(this,[e,t])}return t},readChildNodes:function(e,t){t||(t={});for(var i,r=e.childNodes,n=0,s=r.length;n<s;++n)i=r[n],1==i.nodeType&&this.readNode(i,t);return t},writeNode:function(e,t,i){var r,n,s=e.indexOf(\":\");s>0?(r=e.substring(0,s),n=e.substring(s+1)):(r=i?this.namespaceAlias[i.namespaceURI]:this.defaultPrefix,n=e);var a=this.writers[r][n].apply(this,[t]);return i&&i.appendChild(a),a},getChildEl:function(e,t,i){return e&&this.getThisOrNextEl(e.firstChild,t,i)},getNextEl:function(e,t,i){return e&&this.getThisOrNextEl(e.nextSibling,t,i)},getThisOrNextEl:function(e,t,i){e:for(var r=e;r;r=r.nextSibling)switch(r.nodeType){case 1:if(!(t&&t!==(r.localName||r.nodeName.split(\":\").pop())||i&&i!==r.namespaceURI))break e;r=null;break e;case 3:if(/^\\s*$/.test(r.nodeValue))break;case 4:case 6:case 12:case 10:case 11:r=null;break e}return r||null},lookupNamespaceURI:function(e,t){var i=null;if(e)if(e.lookupNamespaceURI)i=e.lookupNamespaceURI(t);else e:switch(e.nodeType){case 1:if(null!==e.namespaceURI&&e.prefix===t){i=e.namespaceURI;break e}var r=e.attributes.length;if(r)for(var n,s=0;s<r;++s){if(n=e.attributes[s],\"xmlns\"===n.prefix&&n.name===\"xmlns:\"+t){i=n.value||null;break e}if(\"xmlns\"===n.name&&null===t){i=n.value||null;break e}}i=this.lookupNamespaceURI(e.parentNode,t);break e;case 2:i=this.lookupNamespaceURI(e.ownerElement,t);break e;case 9:i=this.lookupNamespaceURI(e.documentElement,t);break e;case 6:case 12:case 10:case 11:break e;default:i=this.lookupNamespaceURI(e.parentNode,t)}return i},CLASS_NAME:\"OpenLayers.Format.XML\"}),OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3},OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype),OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:!1,evt:null,initialize:function(e,t,i){OpenLayers.Util.extend(this,i),this.control=e,this.callbacks=t,e.map&&this.setMap(e.map),OpenLayers.Util.extend(this,i),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+\"_\")},setMap:function(e){this.map=e},checkModifiers:function(e){return null==this.keyMask||((e.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(e.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(e.altKey?OpenLayers.Handler.MOD_ALT:0))==this.keyMask},activate:function(){if(this.active)return!1;for(var e=OpenLayers.Events.prototype.BROWSER_EVENTS,t=0,i=e.length;t<i;t++)this[e[t]]&&this.register(e[t],this[e[t]]);return this.active=!0,!0},deactivate:function(){if(!this.active)return!1;for(var e=OpenLayers.Events.prototype.BROWSER_EVENTS,t=0,i=e.length;t<i;t++)this[e[t]]&&this.unregister(e[t],this[e[t]]);return this.active=!1,!0},callback:function(e,t){e&&this.callbacks[e]&&this.callbacks[e].apply(this.control,t)},register:function(e,t){this.map.events.registerPriority(e,this,t),this.map.events.registerPriority(e,this,this.setEvent)},unregister:function(e,t){this.map.events.unregister(e,this,t),this.map.events.unregister(e,this,this.setEvent)},setEvent:function(e){return this.evt=e,!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.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1e3},EVENT_TYPES:[\"preaddlayer\",\"addlayer\",\"removelayer\",\"changelayer\",\"movestart\",\"move\",\"moveend\",\"zoomend\",\"popupopen\",\"popupclose\",\"addmarker\",\"removemarker\",\"clearmarkers\",\"mouseover\",\"mouseout\",\"mousemove\",\"dragstart\",\"drag\",\"dragend\",\"changebaselayer\"],id:null,fractionalZoom:!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,viewRequestID:0,tileSize:null,projection:\"EPSG:4326\",units:\"degrees\",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:!0,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,initialize:function(e,t){1===arguments.length&&\"object\"==typeof e&&(t=e,e=t&&t.div),this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT),this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90),this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15),this.theme=OpenLayers._getScriptLocation()+\"theme/default/style.css\",OpenLayers.Util.extend(this,t),this.id=OpenLayers.Util.createUniqueID(\"OpenLayers.Map_\"),this.div=OpenLayers.Util.getElement(e),this.div||(this.div=document.createElement(\"div\"),this.div.style.height=\"1px\",this.div.style.width=\"1px\"),OpenLayers.Element.addClass(this.div,\"olMap\");var i=this.div.id+\"_OpenLayers_ViewPort\";if(this.viewPortDiv=OpenLayers.Util.createDiv(i,null,null,null,\"relative\",null,\"hidden\"),this.viewPortDiv.style.width=\"100%\",this.viewPortDiv.style.height=\"100%\",this.viewPortDiv.className=\"olMapViewport\",this.div.appendChild(this.viewPortDiv),i=this.div.id+\"_OpenLayers_Container\",this.layerContainerDiv=OpenLayers.Util.createDiv(i),this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1,this.viewPortDiv.appendChild(this.layerContainerDiv),this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough,{includeXY:!0}),this.updateSize(),this.eventListeners instanceof Object&&this.events.on(this.eventListeners),this.events.register(\"movestart\",this,this.updateSize),OpenLayers.String.contains(navigator.appName,\"Microsoft\")?this.events.register(\"resize\",this,this.updateSize):(this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this),OpenLayers.Event.observe(window,\"resize\",this.updateSizeDestroy)),this.theme){for(var r=!0,n=document.getElementsByTagName(\"link\"),s=0,a=n.length;s<a;++s)if(OpenLayers.Util.isEquivalentUrl(n.item(s).href,this.theme)){r=!1;break}if(r){var o=document.createElement(\"link\");o.setAttribute(\"rel\",\"stylesheet\"),o.setAttribute(\"type\",\"text/css\"),o.setAttribute(\"href\",this.theme),document.getElementsByTagName(\"head\")[0].appendChild(o)}}this.layers=[],null==this.controls&&(null!=OpenLayers.Control?this.controls=[new OpenLayers.Control.Navigation,new OpenLayers.Control.PanZoom,new OpenLayers.Control.ArgParser,new OpenLayers.Control.Attribution]:this.controls=[]);for(var s=0,a=this.controls.length;s<a;s++)this.addControlToMap(this.controls[s]);this.popups=[],this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this),OpenLayers.Event.observe(window,\"unload\",this.unloadDestroy)},render:function(e){this.div=OpenLayers.Util.getElement(e),OpenLayers.Element.addClass(this.div,\"olMap\"),this.events.attachToElement(this.div),this.viewPortDiv.parentNode.removeChild(this.viewPortDiv),this.div.appendChild(this.viewPortDiv),this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy)return!1;if(OpenLayers.Event.stopObserving(window,\"unload\",this.unloadDestroy),this.unloadDestroy=null,this.updateSizeDestroy?OpenLayers.Event.stopObserving(window,\"resize\",this.updateSizeDestroy):this.events.unregister(\"resize\",this,this.updateSize),this.paddingForPopups=null,null!=this.controls){for(var e=this.controls.length-1;e>=0;--e)this.controls[e].destroy();this.controls=null}if(null!=this.layers){for(var e=this.layers.length-1;e>=0;--e)this.layers[e].destroy(!1);this.layers=null}this.viewPortDiv&&this.div.removeChild(this.viewPortDiv),this.viewPortDiv=null,this.eventListeners&&(this.events.un(this.eventListeners),this.eventListeners=null),this.events.destroy(),this.events=null},setOptions:function(e){OpenLayers.Util.extend(this,e)},getTileSize:function(){return this.tileSize},getBy:function(e,t,i){var r=\"function\"==typeof i.test;return OpenLayers.Array.filter(this[e],function(e){return e[t]==i||r&&i.test(e[t])})},getLayersBy:function(e,t){return this.getBy(\"layers\",e,t)},getLayersByName:function(e){return this.getLayersBy(\"name\",e)},getLayersByClass:function(e){return this.getLayersBy(\"CLASS_NAME\",e)},getControlsBy:function(e,t){return this.getBy(\"controls\",e,t)},getControlsByClass:function(e){return this.getControlsBy(\"CLASS_NAME\",e)},getLayer:function(e){for(var t=null,i=0,r=this.layers.length;i<r;i++){var n=this.layers[i];if(n.id==e){t=n;break}}return t},setLayerZIndex:function(e,t){e.setZIndex(this.Z_INDEX_BASE[e.isBaseLayer?\"BaseLayer\":\"Overlay\"]+5*t)},resetLayersZIndex:function(){for(var e=0,t=this.layers.length;e<t;e++){var i=this.layers[e];this.setLayerZIndex(i,e)}},addLayer:function(e){for(var t=0,i=this.layers.length;t<i;t++)if(this.layers[t]==e){var r=OpenLayers.i18n(\"layerAlreadyAdded\",{layerName:e.name});return OpenLayers.Console.warn(r),!1}this.allOverlays&&(e.isBaseLayer=!1),this.events.triggerEvent(\"preaddlayer\",{layer:e}),e.div.className=\"olLayerDiv\",e.div.style.overflow=\"\",this.setLayerZIndex(e,this.layers.length),e.isFixed?this.viewPortDiv.appendChild(e.div):this.layerContainerDiv.appendChild(e.div),this.layers.push(e),e.setMap(this),e.isBaseLayer||this.allOverlays&&!this.baseLayer?null==this.baseLayer?this.setBaseLayer(e):e.setVisibility(!1):e.redraw(),this.events.triggerEvent(\"addlayer\",{layer:e}),e.afterAdd()},addLayers:function(e){for(var t=0,i=e.length;t<i;t++)this.addLayer(e[t])},removeLayer:function(e,t){if(null==t&&(t=!0),e.isFixed?this.viewPortDiv.removeChild(e.div):this.layerContainerDiv.removeChild(e.div),OpenLayers.Util.removeItem(this.layers,e),e.removeMap(this),e.map=null,this.baseLayer==e&&(this.baseLayer=null,t))for(var i=0,r=this.layers.length;i<r;i++){var n=this.layers[i];if(n.isBaseLayer||this.allOverlays){this.setBaseLayer(n);break}}this.resetLayersZIndex(),this.events.triggerEvent(\"removelayer\",{layer:e})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(e){return OpenLayers.Util.indexOf(this.layers,e)},setLayerIndex:function(e,t){var i=this.getLayerIndex(e);if(t<0?t=0:t>this.layers.length&&(t=this.layers.length),i!=t){this.layers.splice(i,1),this.layers.splice(t,0,e);for(var r=0,n=this.layers.length;r<n;r++)this.setLayerZIndex(this.layers[r],r);this.events.triggerEvent(\"changelayer\",{layer:e,property:\"order\"}),this.allOverlays&&(0===t?this.setBaseLayer(e):this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0]))}},raiseLayer:function(e,t){var i=this.getLayerIndex(e)+t;this.setLayerIndex(e,i)},setBaseLayer:function(e){var t=null;if(this.baseLayer&&(t=this.baseLayer.getExtent()),e!=this.baseLayer&&OpenLayers.Util.indexOf(this.layers,e)!=-1){null==this.baseLayer||this.allOverlays||this.baseLayer.setVisibility(!1),this.baseLayer=e,this.viewRequestID++,this.allOverlays||(this.baseLayer.visibility=!0);var i=this.getCenter();if(null!=i){var r=t?t.getCenterLonLat():i,n=t?this.getZoomForExtent(t,!0):this.getZoomForResolution(this.resolution,!0);this.setCenter(r,n,!1,!0)}this.events.triggerEvent(\"changebaselayer\",{layer:this.baseLayer})}},addControl:function(e,t){this.controls.push(e),this.addControlToMap(e,t)},addControlToMap:function(e,t){e.outsideViewport=null!=e.div,this.displayProjection&&!e.displayProjection&&(e.displayProjection=this.displayProjection),e.setMap(this);var i=e.draw(t);i&&(e.outsideViewport||(i.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length,this.viewPortDiv.appendChild(i)))},getControl:function(e){for(var t=null,i=0,r=this.controls.length;i<r;i++){var n=this.controls[i];if(n.id==e){t=n;break}}return t},removeControl:function(e){e&&e==this.getControl(e.id)&&(e.div&&e.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(e.div),OpenLayers.Util.removeItem(this.controls,e))},addPopup:function(e,t){if(t)for(var i=this.popups.length-1;i>=0;--i)this.removePopup(this.popups[i]);e.map=this,this.popups.push(e);var r=e.draw();r&&(r.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length,this.layerContainerDiv.appendChild(r))},removePopup:function(e){if(OpenLayers.Util.removeItem(this.popups,e),e.div)try{this.layerContainerDiv.removeChild(e.div)}catch(e){}e.map=null},getSize:function(){var e=null;return null!=this.size&&(e=this.size.clone()),e},updateSize:function(){this.events.clearMouseCache();var e=this.getCurrentSize(),t=this.getSize();if(null==t&&(this.size=t=e),!e.equals(t)){this.size=e;for(var i=0,r=this.layers.length;i<r;i++)this.layers[i].onMapResize();if(null!=this.baseLayer){var n=new OpenLayers.Pixel(e.w/2,e.h/2),s=(this.getLonLatFromViewPortPx(n),this.getZoom());this.zoom=null,this.setCenter(this.getCenter(),s)}}},getCurrentSize:function(){var e=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(0==e.w&&0==e.h||isNaN(e.w)&&isNaN(e.h)){var t=OpenLayers.Element.getDimensions(this.div);e.w=t.width,e.h=t.height}return(0==e.w&&0==e.h||isNaN(e.w)&&isNaN(e.h))&&(e.w=parseInt(this.div.style.width),e.h=parseInt(this.div.style.height)),e},calculateBounds:function(e,t){var i=null;if(null==e&&(e=this.getCenter()),null==t&&(t=this.getResolution()),null!=e&&null!=t){var r=this.getSize(),n=r.w*t,s=r.h*t;i=new OpenLayers.Bounds(e.lon-n/2,e.lat-s/2,e.lon+n/2,e.lat+s/2)}return i},getCenter:function(){var e=null;return this.center&&(e=this.center.clone()),e},getZoom:function(){return this.zoom},pan:function(e,t,i){i=OpenLayers.Util.applyDefaults(i,{animate:!0,dragging:!1});var r=this.getViewPortPxFromLonLat(this.getCenter()),n=r.add(e,t);if(!i.dragging||!n.equals(r)){\nvar s=this.getLonLatFromViewPortPx(n);i.animate?this.panTo(s):this.setCenter(s,null,i.dragging)}},panTo:function(e){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(e)){this.panTween||(this.panTween=new OpenLayers.Tween(this.panMethod));var t=this.getCenter();if(e.lon==t.lon&&e.lat==t.lat)return;var i={lon:t.lon,lat:t.lat},r={lon:e.lon,lat:e.lat};this.panTween.start(i,r,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(e){this.events.triggerEvent(\"movestart\")},this),eachStep:OpenLayers.Function.bind(function(e){e=new OpenLayers.LonLat(e.lon,e.lat),this.moveTo(e,this.zoom,{dragging:!0,noEvent:!0})},this),done:OpenLayers.Function.bind(function(e){e=new OpenLayers.LonLat(e.lon,e.lat),this.moveTo(e,this.zoom,{noEvent:!0}),this.events.triggerEvent(\"moveend\")},this)}})}else this.setCenter(e)},setCenter:function(e,t,i,r){this.moveTo(e,t,{dragging:i,forceZoomChange:r,caller:\"setCenter\"})},moveTo:function(e,t,i){i||(i={});var r=i.dragging,n=i.forceZoomChange,s=i.noEvent;if(this.panTween&&\"setCenter\"==i.caller&&this.panTween.stop(),this.center||this.isValidLonLat(e)||(e=this.maxExtent.getCenterLonLat()),null!=this.restrictedExtent){null==e&&(e=this.getCenter()),null==t&&(t=this.getZoom());var a=this.getResolutionForZoom(t),o=this.calculateBounds(e,a);if(!this.restrictedExtent.containsBounds(o)){var l=this.restrictedExtent.getCenterLonLat();o.getWidth()>this.restrictedExtent.getWidth()?e=new OpenLayers.LonLat(l.lon,e.lat):o.left<this.restrictedExtent.left?e=e.add(this.restrictedExtent.left-o.left,0):o.right>this.restrictedExtent.right&&(e=e.add(this.restrictedExtent.right-o.right,0)),o.getHeight()>this.restrictedExtent.getHeight()?e=new OpenLayers.LonLat(e.lon,l.lat):o.bottom<this.restrictedExtent.bottom?e=e.add(0,this.restrictedExtent.bottom-o.bottom):o.top>this.restrictedExtent.top&&(e=e.add(0,this.restrictedExtent.top-o.top))}}var p=n||this.isValidZoomLevel(t)&&t!=this.getZoom(),h=this.isValidLonLat(e)&&!e.equals(this.center);if(p||h||!r){this.dragging||s||this.events.triggerEvent(\"movestart\"),h&&(!p&&this.center&&this.centerLayerContainer(e),this.center=e.clone()),(p||null==this.layerContainerOrigin)&&(this.layerContainerOrigin=this.center.clone(),this.layerContainerDiv.style.left=\"0px\",this.layerContainerDiv.style.top=\"0px\"),p&&(this.zoom=t,this.resolution=this.getResolutionForZoom(t),this.viewRequestID++);var u=this.getExtent();this.baseLayer.visibility&&(this.baseLayer.moveTo(u,p,r),r?this.baseLayer.events.triggerEvent(\"move\"):this.baseLayer.events.triggerEvent(\"moveend\",{zoomChanged:p})),u=this.baseLayer.getExtent();for(var y=0,c=this.layers.length;y<c;y++){var d=this.layers[y];if(d!==this.baseLayer&&!d.isBaseLayer){var m=d.calculateInRange();d.inRange!=m&&(d.inRange=m,m||d.display(!1),this.events.triggerEvent(\"changelayer\",{layer:d,property:\"visibility\"})),m&&d.visibility&&(d.moveTo(u,p,r),r?d.events.triggerEvent(\"move\"):d.events.triggerEvent(\"moveend\",{zoomChanged:p}))}}if(p)for(var y=0,c=this.popups.length;y<c;y++)this.popups[y].updatePosition();this.events.triggerEvent(\"move\"),p&&this.events.triggerEvent(\"zoomend\")}r||s||this.events.triggerEvent(\"moveend\"),this.dragging=!!r},centerLayerContainer:function(e){var t=this.getViewPortPxFromLonLat(this.layerContainerOrigin),i=this.getViewPortPxFromLonLat(e);null!=t&&null!=i&&(this.layerContainerDiv.style.left=Math.round(t.x-i.x)+\"px\",this.layerContainerDiv.style.top=Math.round(t.y-i.y)+\"px\")},isValidZoomLevel:function(e){return null!=e&&e>=0&&e<this.getNumZoomLevels()},isValidLonLat:function(e){var t=!1;if(null!=e){t=this.getMaxExtent().containsLonLat(e)}return t},getProjection:function(){var e=this.getProjectionObject();return e?e.getCode():null},getProjectionObject:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.projection),e},getMaxResolution:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.maxResolution),e},getMaxExtent:function(e){var t=null;return e&&e.restricted&&this.restrictedExtent?t=this.restrictedExtent:null!=this.baseLayer&&(t=this.baseLayer.maxExtent),t},getNumZoomLevels:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.numZoomLevels),e},getExtent:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.getExtent()),e},getResolution:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.getResolution()),e},getUnits:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.units),e},getScale:function(){var e=null;if(null!=this.baseLayer){var t=this.getResolution(),i=this.baseLayer.units;e=OpenLayers.Util.getScaleFromResolution(t,i)}return e},getZoomForExtent:function(e,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForExtent(e,t)),i},getResolutionForZoom:function(e){var t=null;return this.baseLayer&&(t=this.baseLayer.getResolutionForZoom(e)),t},getZoomForResolution:function(e,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForResolution(e,t)),i},zoomTo:function(e){this.isValidZoomLevel(e)&&this.setCenter(null,e)},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(e,t){var i=e.getCenterLonLat();if(this.baseLayer.wrapDateLine){var r=this.getMaxExtent();for(e=e.clone();e.right<e.left;)e.right+=r.getWidth();i=e.getCenterLonLat().wrapDateLine(r)}this.setCenter(i,this.getZoomForExtent(e,t))},zoomToMaxExtent:function(e){var t=!e||e.restricted,i=this.getMaxExtent({restricted:t});this.zoomToExtent(i)},zoomToScale:function(e,t){var i=OpenLayers.Util.getResolutionFromScale(e,this.baseLayer.units),r=this.getSize(),n=r.w*i,s=r.h*i,a=this.getCenter(),o=new OpenLayers.Bounds(a.lon-n/2,a.lat-s/2,a.lon+n/2,a.lat+s/2);this.zoomToExtent(o,t)},getLonLatFromViewPortPx:function(e){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getLonLatFromViewPortPx(e)),t},getViewPortPxFromLonLat:function(e){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getViewPortPxFromLonLat(e)),t},getLonLatFromPixel:function(e){return this.getLonLatFromViewPortPx(e)},getPixelFromLonLat:function(e){var t=this.getViewPortPxFromLonLat(e);return t.x=Math.round(t.x),t.y=Math.round(t.y),t},getViewPortPxFromLayerPx:function(e){var t=null;if(null!=e){var i=parseInt(this.layerContainerDiv.style.left),r=parseInt(this.layerContainerDiv.style.top);t=e.add(i,r)}return t},getLayerPxFromViewPortPx:function(e){var t=null;if(null!=e){var i=-parseInt(this.layerContainerDiv.style.left),r=-parseInt(this.layerContainerDiv.style.top);t=e.add(i,r),(isNaN(t.x)||isNaN(t.y))&&(t=null)}return t},getLonLatFromLayerPx:function(e){return e=this.getViewPortPxFromLayerPx(e),this.getLonLatFromViewPortPx(e)},getLayerPxFromLonLat:function(e){var t=this.getPixelFromLonLat(e);return this.getLayerPxFromViewPortPx(t)},CLASS_NAME:\"OpenLayers.Map\"}),OpenLayers.Map.TILE_WIDTH=256,OpenLayers.Map.TILE_HEIGHT=256,OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(e,t){this.lonlat=e;var i=t?t:OpenLayers.Marker.defaultIcon();null==this.icon?this.icon=i:(this.icon.url=i.url,this.icon.size=i.size,this.icon.offset=i.offset,this.icon.calculateOffset=i.calculateOffset),this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase(),this.map=null,this.events.destroy(),this.events=null,null!=this.icon&&(this.icon.destroy(),this.icon=null)},draw:function(e){return this.icon.draw(e)},erase:function(){null!=this.icon&&this.icon.erase()},moveTo:function(e){null!=e&&null!=this.icon&&this.icon.moveTo(e),this.lonlat=this.map.getLonLatFromLayerPx(e)},isDrawn:function(){return this.icon&&this.icon.isDrawn()},onScreen:function(){var e=!1;if(this.map){e=this.map.getExtent().containsLonLat(this.lonlat)}return e},inflate:function(e){if(this.icon){var t=new OpenLayers.Size(this.icon.size.w*e,this.icon.size.h*e);this.icon.setSize(t)}},setOpacity:function(e){this.icon.setOpacity(e)},setUrl:function(e){this.icon.setUrl(e)},display:function(e){this.icon.display(e)},CLASS_NAME:\"OpenLayers.Marker\"}),OpenLayers.Marker.defaultIcon=function(){var e=OpenLayers.Util.getImagesLocation()+\"marker.png\",t=new OpenLayers.Size(21,25),i=function(e){return new OpenLayers.Pixel(-(e.w/2),-e.h)};return new OpenLayers.Icon(e,t,null,i)},OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:\"olFramedCloudPopupContent\",autoSize:!0,panMapIfOutOfView:!0,imageSize:new OpenLayers.Size(676,736),isAlphaImage:!1,fixedRelativePosition:!1,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size(\"auto\",\"auto\"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,\"auto\"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size(\"auto\",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size(\"auto\",\"auto\"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,\"auto\"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size(\"auto\",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size(\"auto\",\"auto\"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,\"auto\"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size(\"auto\",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size(\"auto\",\"auto\"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,\"auto\"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size(\"auto\",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),initialize:function(e,t,i,r,n,s,a){this.imageSrc=OpenLayers.Util.getImagesLocation()+\"cloud-popup-relative.png\",OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments),this.contentDiv.className=this.contentDisplayClass},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Popup.FramedCloud\"}),OpenLayers.Request={DEFAULT_CONFIG:{method:\"GET\",url:window.location.href,async:!0,user:void 0,password:void 0,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},events:new OpenLayers.Events(this,null,[\"complete\",\"success\",\"failure\"]),issue:function(e){var t=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});e=OpenLayers.Util.applyDefaults(e,t);var i=new OpenLayers.Request.XMLHttpRequest,r=e.url;if(e.params){var n=OpenLayers.Util.getParameterString(e.params);if(n.length>0){var s=r.indexOf(\"?\")>-1?\"&\":\"?\";r+=s+n}}e.proxy&&0==r.indexOf(\"http\")&&(r=e.proxy+encodeURIComponent(r)),i.open(e.method,r,e.async,e.user,e.password);for(var a in e.headers)i.setRequestHeader(a,e.headers[a]);var o,l=e.scope?OpenLayers.Function.bind(e.callback,e.scope):e.callback;e.success&&(o=e.scope?OpenLayers.Function.bind(e.success,e.scope):e.success);var p;e.failure&&(p=e.scope?OpenLayers.Function.bind(e.failure,e.scope):e.failure);var h=this.events;return i.onreadystatechange=function(){if(i.readyState==OpenLayers.Request.XMLHttpRequest.DONE){h.triggerEvent(\"complete\",{request:i,config:e,requestUrl:r})!==!1&&(l(i),(!i.status||i.status>=200&&i.status<300)&&(h.triggerEvent(\"success\",{request:i,config:e,requestUrl:r}),o&&o(i)),i.status&&(i.status<200||i.status>=300)&&(h.triggerEvent(\"failure\",{request:i,config:e,requestUrl:r}),p&&p(i)))}},e.async===!1?i.send(e.data):window.setTimeout(function(){i.send(e.data)},0),i},GET:function(e){return e=OpenLayers.Util.extend(e,{method:\"GET\"}),OpenLayers.Request.issue(e)},POST:function(e){return e=OpenLayers.Util.extend(e,{method:\"POST\"}),e.headers=e.headers?e.headers:{},\"CONTENT-TYPE\"in OpenLayers.Util.upperCaseObject(e.headers)||(e.headers[\"Content-Type\"]=\"application/xml\"),OpenLayers.Request.issue(e)},PUT:function(e){return e=OpenLayers.Util.extend(e,{method:\"PUT\"}),e.headers=e.headers?e.headers:{},\"CONTENT-TYPE\"in OpenLayers.Util.upperCaseObject(e.headers)||(e.headers[\"Content-Type\"]=\"application/xml\"),OpenLayers.Request.issue(e)},DELETE:function(e){return e=OpenLayers.Util.extend(e,{method:\"DELETE\"}),OpenLayers.Request.issue(e)},HEAD:function(e){return e=OpenLayers.Util.extend(e,{method:\"HEAD\"}),OpenLayers.Request.issue(e)},OPTIONS:function(e){return e=OpenLayers.Util.extend(e,{method:\"OPTIONS\"}),OpenLayers.Request.issue(e)}},OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:!1,lastRatio:1,isFirstDraw:!0,backBufferTile:null,initialize:function(e,t,i,r,n){OpenLayers.Tile.prototype.initialize.apply(this,arguments),this.url=r,this.frame=document.createElement(\"div\"),this.frame.style.overflow=\"hidden\",this.frame.style.position=\"absolute\",this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){null!=this.imgDiv&&(this.layerAlphaHack&&OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id),OpenLayers.Event.stopObservingElement(this.imgDiv.id),this.imgDiv.parentNode==this.frame&&(this.frame.removeChild(this.imgDiv),this.imgDiv.map=null),this.imgDiv.urls=null,this.imgDiv.src=OpenLayers.Util.getImagesLocation()+\"blank.gif\"),this.imgDiv=null,null!=this.frame&&this.frame.parentNode==this.layer.div&&this.layer.div.removeChild(this.frame),this.frame=null,this.backBufferTile&&(this.backBufferTile.destroy(),this.backBufferTile=null),this.layer.events.unregister(\"loadend\",this,this.resetBackBuffer),OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)),e=OpenLayers.Tile.prototype.clone.apply(this,[e]),e.imgDiv=null,e},draw:function(){this.layer!=this.layer.map.baseLayer&&this.layer.reproject&&(this.bounds=this.getBoundsFromBaseLayer(this.position));var e=OpenLayers.Tile.prototype.draw.apply(this,arguments);return OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1?e?(this.backBufferTile||(this.backBufferTile=this.clone(),this.backBufferTile.hide(),this.backBufferTile.isBackBuffer=!0,this.events.register(\"loadend\",this,this.resetBackBuffer),this.layer.events.register(\"loadend\",this,this.resetBackBuffer)),this.startTransition()):this.backBufferTile&&this.backBufferTile.clear():e&&this.isFirstDraw&&(this.events.register(\"loadend\",this,this.showTile),this.isFirstDraw=!1),!!e&&(this.isLoading?this.events.triggerEvent(\"reload\"):(this.isLoading=!0,this.events.triggerEvent(\"loadstart\")),this.renderTile())},resetBackBuffer:function(){if(this.showTile(),this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=!1;var e=this.layer.maxExtent;e&&this.bounds.intersectsBounds(e,!1)&&(this.backBufferTile.position=this.position,this.backBufferTile.bounds=this.bounds,this.backBufferTile.size=this.size,this.backBufferTile.imageSize=this.layer.imageSize||this.size,this.backBufferTile.imageOffset=this.layer.imageOffset,this.backBufferTile.resolution=this.layer.getResolution(),this.backBufferTile.renderTile()),this.backBufferTile.hide()}},renderTile:function(){return null==this.imgDiv&&this.initImgDiv(),this.imgDiv.viewRequestID=this.layer.map.viewRequestID,this.layer.async?this.layer.getURLasync(this.bounds,this,\"url\",this.positionImage):(this.layer.url instanceof Array&&(this.imgDiv.urls=this.layer.url.slice()),this.url=this.layer.getURL(this.bounds),this.positionImage()),!0},positionImage:function(){if(null!=this.layer){OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var e=this.layer.getImageSize();this.layerAlphaHack?OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,e,this.url):(OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,e),this.imgDiv.src=this.url)}},clear:function(){this.imgDiv&&(this.hide(),OpenLayers.Tile.Image.useBlankTile&&(this.imgDiv.src=OpenLayers.Util.getImagesLocation()+\"blank.gif\"))},initImgDiv:function(){var e=this.layer.imageOffset,t=this.layer.getImageSize();this.layerAlphaHack?this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,e,t,null,\"relative\",null,null,null,!0):this.imgDiv=OpenLayers.Util.createImage(null,e,t,null,\"relative\",null,null,!0),this.imgDiv.className=\"olTileImage\",this.frame.style.zIndex=this.isBackBuffer?0:1,this.frame.appendChild(this.imgDiv),this.layer.div.appendChild(this.frame),null!=this.layer.opacity&&OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity),this.imgDiv.map=this.layer.map;var i=function(){this.isLoading&&(this.isLoading=!1,this.events.triggerEvent(\"loadend\"))};this.layerAlphaHack?OpenLayers.Event.observe(this.imgDiv.childNodes[0],\"load\",OpenLayers.Function.bind(i,this)):OpenLayers.Event.observe(this.imgDiv,\"load\",OpenLayers.Function.bind(i,this));var r=function(){this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS&&i.call(this)};OpenLayers.Event.observe(this.imgDiv,\"error\",OpenLayers.Function.bind(r,this))},checkImgURL:function(){if(this.layer){var e=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;OpenLayers.Util.isEquivalentUrl(e,this.url)||this.hide()}},startTransition:function(){if(this.backBufferTile&&this.backBufferTile.imgDiv){var e=1;if(this.backBufferTile.resolution&&(e=this.backBufferTile.resolution/this.layer.getResolution()),e!=this.lastRatio){if(\"resize\"==this.layer.transitionEffect){var t=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top),i=new OpenLayers.Size(this.backBufferTile.size.w*e,this.backBufferTile.size.h*e),r=this.layer.map.getLayerPxFromLonLat(t);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,r,i);var n=this.backBufferTile.imageSize;n=new OpenLayers.Size(n.w*e,n.h*e);var s=this.backBufferTile.imageOffset;s&&(s=new OpenLayers.Pixel(s.x*e,s.y*e)),OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,s,n),this.backBufferTile.show()}}else this.layer.singleTile?this.backBufferTile.show():this.backBufferTile.hide();this.lastRatio=e}},show:function(){this.frame.style.display=\"\",OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1&&navigator.userAgent.toLowerCase().indexOf(\"gecko\")!=-1&&(this.frame.scrollLeft=this.frame.scrollLeft)},hide:function(){this.frame.style.display=\"none\"},CLASS_NAME:\"OpenLayers.Tile.Image\"}),OpenLayers.Tile.Image.useBlankTile=\"safari\"==OpenLayers.Util.getBrowserName()||\"opera\"==OpenLayers.Util.getBrowserName(),OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:\"RectReplacement\",minRatio:8,maxRatio:32,mapOptions:null,autoPan:!1,handlers:null,resolutionFactor:1,initialize:function(e){this.layers=[],this.handlers={},OpenLayers.Control.prototype.initialize.apply(this,[e])},destroy:function(){this.mapDiv&&(this.handlers.click.destroy(),this.mapDiv.removeChild(this.extentRectangle),this.extentRectangle=null,this.rectEvents.destroy(),this.rectEvents=null,this.ovmap.destroy(),this.ovmap=null,this.element.removeChild(this.mapDiv),this.mapDiv=null,this.div.removeChild(this.element),this.element=null,this.maximizeDiv&&(OpenLayers.Event.stopObservingElement(this.maximizeDiv),this.div.removeChild(this.maximizeDiv),this.maximizeDiv=null),this.minimizeDiv&&(OpenLayers.Event.stopObservingElement(this.minimizeDiv),this.div.removeChild(this.minimizeDiv),this.minimizeDiv=null),this.map.events.un({moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments))},draw:function(){if(OpenLayers.Control.prototype.draw.apply(this,arguments),!(this.layers.length>0)){if(!this.map.baseLayer)return this.map.events.register(\"changebaselayer\",this,this.baseLayerDraw),this.div;var e=this.map.baseLayer.clone();this.layers=[e]}if(this.element=document.createElement(\"div\"),this.element.className=this.displayClass+\"Element\",this.element.style.display=\"none\",this.mapDiv=document.createElement(\"div\"),this.mapDiv.style.width=this.size.w+\"px\",this.mapDiv.style.height=this.size.h+\"px\",this.mapDiv.style.position=\"relative\",this.mapDiv.style.overflow=\"hidden\",this.mapDiv.id=OpenLayers.Util.createUniqueID(\"overviewMap\"),this.extentRectangle=document.createElement(\"div\"),this.extentRectangle.style.position=\"absolute\",this.extentRectangle.style.zIndex=1e3,this.extentRectangle.className=this.displayClass+\"ExtentRectangle\",this.mapDiv.appendChild(this.extentRectangle),this.element.appendChild(this.mapDiv),this.div.appendChild(this.element),this.outsideViewport)this.element.style.display=\"\";else{this.div.className+=\" \"+this.displayClass+\"Container\";var t=OpenLayers.Util.getImagesLocation(),i=t+\"layer-switcher-maximize.png\";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+\"MaximizeButton\",null,new OpenLayers.Size(18,18),i,\"absolute\"),this.maximizeDiv.style.display=\"none\",this.maximizeDiv.className=this.displayClass+\"MaximizeButton\",OpenLayers.Event.observe(this.maximizeDiv,\"click\",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this)),this.div.appendChild(this.maximizeDiv);var i=t+\"layer-switcher-minimize.png\";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv(\"OpenLayers_Control_minimizeDiv\",null,new OpenLayers.Size(18,18),i,\"absolute\"),this.minimizeDiv.style.display=\"none\",this.minimizeDiv.className=this.displayClass+\"MinimizeButton\",OpenLayers.Event.observe(this.minimizeDiv,\"click\",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this)),this.div.appendChild(this.minimizeDiv);for(var r=[\"dblclick\",\"mousedown\"],n=0,s=r.length;n<s;n++)OpenLayers.Event.observe(this.maximizeDiv,r[n],OpenLayers.Event.stop),OpenLayers.Event.observe(this.minimizeDiv,r[n],OpenLayers.Event.stop);this.minimizeControl()}return this.map.getExtent()&&this.update(),this.map.events.register(\"moveend\",this,this.update),this.div},baseLayerDraw:function(){this.draw(),this.map.events.unregister(\"changebaselayer\",this,this.baseLayerDraw)},rectDrag:function(e){var t=this.handlers.drag.last.x-e.x,i=this.handlers.drag.last.y-e.y;if(0!=t||0!=i){var r=this.rectPxBounds.top,n=this.rectPxBounds.left,s=Math.abs(this.rectPxBounds.getHeight()),a=this.rectPxBounds.getWidth(),o=Math.max(0,r-i);o=Math.min(o,this.ovmap.size.h-this.hComp-s);var l=Math.max(0,n-t);l=Math.min(l,this.ovmap.size.w-this.wComp-a),this.setRectPxBounds(new OpenLayers.Bounds(l,o+s,l+a,o))}},mapDivClick:function(e){var t=this.rectPxBounds.getCenterPixel(),i=e.xy.x-t.x,r=e.xy.y-t.y,n=this.rectPxBounds.top,s=this.rectPxBounds.left,a=Math.abs(this.rectPxBounds.getHeight()),o=this.rectPxBounds.getWidth(),l=Math.max(0,n+r);l=Math.min(l,this.ovmap.size.h-a);var p=Math.max(0,s+i);p=Math.min(p,this.ovmap.size.w-o),this.setRectPxBounds(new OpenLayers.Bounds(p,l+a,p+o,l)),this.updateMapToRect()},maximizeControl:function(e){this.element.style.display=\"\",this.showToggle(!1),null!=e&&OpenLayers.Event.stop(e)},minimizeControl:function(e){this.element.style.display=\"none\",this.showToggle(!0),null!=e&&OpenLayers.Event.stop(e)},showToggle:function(e){this.maximizeDiv.style.display=e?\"\":\"none\",this.minimizeDiv.style.display=e?\"none\":\"\"},update:function(){null==this.ovmap&&this.createMap(),!this.autoPan&&this.isSuitableOverview()||this.updateOverview(),this.updateRectToMap()},isSuitableOverview:function(){var e=this.map.getExtent(),t=this.map.maxExtent,i=new OpenLayers.Bounds(Math.max(e.left,t.left),Math.max(e.bottom,t.bottom),Math.min(e.right,t.right),Math.min(e.top,t.top));this.ovmap.getProjection()!=this.map.getProjection()&&(i=i.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()));var r=this.ovmap.getResolution()/this.map.getResolution();return r>this.minRatio&&r<=this.maxRatio&&this.ovmap.getExtent().containsBounds(i)},updateOverview:function(){var e=this.map.getResolution(),t=this.ovmap.getResolution(),i=t/e;i>this.maxRatio?t=this.minRatio*e:i<=this.minRatio&&(t=this.maxRatio*e);var r;this.ovmap.getProjection()!=this.map.getProjection()?(r=this.map.center.clone(),r.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())):r=this.map.center,this.ovmap.setCenter(r,this.ovmap.getZoomForResolution(t*this.resolutionFactor)),this.updateRectToMap()},createMap:function(){var e=OpenLayers.Util.extend({controls:[],maxResolution:\"auto\",fallThrough:!1},this.mapOptions);if(this.ovmap=new OpenLayers.Map(this.mapDiv,e),OpenLayers.Event.stopObserving(window,\"unload\",this.ovmap.unloadDestroy),this.ovmap.addLayers(this.layers),this.ovmap.zoomToMaxExtent(),this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,\"border-left-width\"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,\"border-right-width\")),this.wComp=this.wComp?this.wComp:2,this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,\"border-top-width\"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,\"border-bottom-width\")),this.hComp=this.hComp?this.hComp:2,this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap}),this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:!0,double:!1,stopSingle:!0,stopDouble:!0,pixelTolerance:1,map:this.ovmap}),this.handlers.click.activate(),this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,!0),this.rectEvents.register(\"mouseover\",this,function(e){this.handlers.drag.active||this.map.dragging||this.handlers.drag.activate()}),this.rectEvents.register(\"mouseout\",this,function(e){this.handlers.drag.dragging||this.handlers.drag.deactivate()}),this.ovmap.getProjection()!=this.map.getProjection()){var t=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,i=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=t&&i?OpenLayers.INCHES_PER_UNIT[t]/OpenLayers.INCHES_PER_UNIT[i]:1}},updateRectToMap:function(){var e;e=this.ovmap.getProjection()!=this.map.getProjection()?this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()):this.map.getExtent();var t=this.getRectBoundsFromMapBounds(e);t&&this.setRectPxBounds(t)},updateMapToRect:function(){var e=this.getMapBoundsFromRectBounds(this.rectPxBounds);this.ovmap.getProjection()!=this.map.getProjection()&&(e=e.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())),this.map.panTo(e.getCenterLonLat())},setRectPxBounds:function(e){var t=Math.max(e.top,0),i=Math.max(e.left,0),r=Math.min(e.top+Math.abs(e.getHeight()),this.ovmap.size.h-this.hComp),n=Math.min(e.left+e.getWidth(),this.ovmap.size.w-this.wComp),s=Math.max(n-i,0),a=Math.max(r-t,0);if(s<this.minRectSize||a<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var o=i+s/2-this.minRectSize/2,l=t+a/2-this.minRectSize/2;this.extentRectangle.style.top=Math.round(l)+\"px\",this.extentRectangle.style.left=Math.round(o)+\"px\",this.extentRectangle.style.height=this.minRectSize+\"px\",this.extentRectangle.style.width=this.minRectSize+\"px\"}else this.extentRectangle.className=this.displayClass+\"ExtentRectangle\",this.extentRectangle.style.top=Math.round(t)+\"px\",this.extentRectangle.style.left=Math.round(i)+\"px\",this.extentRectangle.style.height=Math.round(a)+\"px\",this.extentRectangle.style.width=Math.round(s)+\"px\";this.rectPxBounds=new OpenLayers.Bounds(Math.round(i),Math.round(r),Math.round(n),Math.round(t))},getRectBoundsFromMapBounds:function(e){var t=new OpenLayers.LonLat(e.left,e.bottom),i=new OpenLayers.LonLat(e.right,e.top),r=this.getOverviewPxFromLonLat(t),n=this.getOverviewPxFromLonLat(i),s=null;return r&&n&&(s=new OpenLayers.Bounds(r.x,r.y,n.x,n.y)),s},getMapBoundsFromRectBounds:function(e){var t=new OpenLayers.Pixel(e.left,e.bottom),i=new OpenLayers.Pixel(e.right,e.top),r=this.getLonLatFromOverviewPx(t),n=this.getLonLatFromOverviewPx(i);return new OpenLayers.Bounds(r.lon,r.lat,n.lon,n.lat)},getLonLatFromOverviewPx:function(e){var t=this.ovmap.size,i=this.ovmap.getResolution(),r=this.ovmap.getExtent().getCenterLonLat(),n=e.x-t.w/2,s=e.y-t.h/2;return new OpenLayers.LonLat(r.lon+n*i,r.lat-s*i)},getOverviewPxFromLonLat:function(e){var t=this.ovmap.getResolution(),i=this.ovmap.getExtent(),r=null;return i&&(r=new OpenLayers.Pixel(Math.round(1/t*(e.lon-i.left)),Math.round(1/t*(i.top-e.lat)))),r},CLASS_NAME:\"OpenLayers.Control.OverviewMap\"}),OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(e,t,i){this.layer=e,this.lonlat=t,this.data=null!=i?i:{},this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+\"_\")},destroy:function(){null!=this.layer&&null!=this.layer.map&&null!=this.popup&&this.layer.map.removePopup(this.popup),this.layer=null,this.id=null,this.lonlat=null,this.data=null,null!=this.marker&&(this.destroyMarker(this.marker),this.marker=null),null!=this.popup&&(this.destroyPopup(this.popup),this.popup=null)},onScreen:function(){var e=!1;if(null!=this.layer&&null!=this.layer.map){e=this.layer.map.getExtent().containsLonLat(this.lonlat)}return e},createMarker:function(){return null!=this.lonlat&&(this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)),this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(e){if(null!=this.lonlat){var t=this.id+\"_popup\",i=this.marker?this.marker.icon:null;this.popup||(this.popup=new this.popupClass(t,this.lonlat,this.data.popupSize,this.data.popupContentHTML,i,e)),null!=this.data.overflow&&(this.popup.contentDiv.style.overflow=this.data.overflow),this.popup.feature=this}return this.popup},destroyPopup:function(){this.popup&&(this.popup.feature=null,this.popup.destroy(),this.popup=null)},CLASS_NAME:\"OpenLayers.Feature\"}),OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:\"1.1.0\",version:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.options=e},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=e.documentElement,i=this.version;i||(i=t.getAttribute(\"version\"))||(i=this.defaultVersion);var r=OpenLayers.Format.WFSCapabilities[\"v\"+i.replace(/\\./g,\"_\")];if(!r)throw\"Can't find a WFS capabilities parser for version \"+i;var n=new r(this.options),s=n.read(e)\n;return s.version=i,s},CLASS_NAME:\"OpenLayers.Format.WFSCapabilities\"}),OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xsd:\"http://www.w3.org/2001/XMLSchema\"},initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},readers:{xsd:{schema:function(e,t){var i=[],r={},n={complexTypes:i,customTypes:r};this.readChildNodes(e,n);for(var s,a,o=e.attributes,l=0,p=o.length;l<p;++l)s=o[l],a=s.name,0==a.indexOf(\"xmlns\")?this.setNamespace(a.split(\":\")[1]||\"\",s.value):t[a]=s.value;t.featureTypes=i,t.targetPrefix=this.namespaceAlias[t.targetNamespace];for(var h,u,l=0,p=i.length;l<p;++l)h=i[l],u=r[h.typeName],r[h.typeName]&&(h.typeName=u.name)},complexType:function(e,t){var i={typeName:e.getAttribute(\"name\")};this.readChildNodes(e,i),t.complexTypes.push(i)},complexContent:function(e,t){this.readChildNodes(e,t)},extension:function(e,t){this.readChildNodes(e,t)},sequence:function(e,t){var i={elements:[]};this.readChildNodes(e,i),t.properties=i.elements},element:function(e,t){if(t.elements){for(var i,r={},n=e.attributes,s=0,a=n.length;s<a;++s)i=n[s],r[i.name]=i.value;var o=r.type;o||(o={},this.readChildNodes(e,o),r.restriction=o,r.type=o.base);var l=o.base||o;r.localType=l.split(\":\").pop(),t.elements.push(r)}if(t.complexTypes){var o=e.getAttribute(\"type\"),p=o.split(\":\").pop();t.customTypes[p]={name:e.getAttribute(\"name\"),type:o}}},simpleType:function(e,t){this.readChildNodes(e,t)},restriction:function(e,t){t.base=e.getAttribute(\"base\"),this.readRestriction(e,t)}}},readRestriction:function(e,t){for(var i,r,n,s=e.childNodes,a=0,o=s.length;a<o;++a)i=s[a],1==i.nodeType&&(r=i.nodeName.split(\":\").pop(),n=i.getAttribute(\"value\"),t[r]?(\"string\"==typeof t[r]&&(t[r]=[t[r]]),t[r].push(n)):t[r]=n)},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},CLASS_NAME:\"OpenLayers.Format.WFSDescribeFeatureType\"}),OpenLayers.Format.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:\"http://www.w3.org/1999/xlink\",xsi:\"http://www.w3.org/2001/XMLSchema-instance\",wfs:\"http://www.opengis.net/wfs\",gml:\"http://www.opengis.net/gml\",ogc:\"http://www.opengis.net/ogc\"},defaultPrefix:\"wfs\",version:null,schemaLocations:null,srsName:null,extractAttributes:!0,xy:!0,stateName:null,initialize:function(e){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,[e])},getSrsName:function(e,t){var i=t&&t.srsName;return i||(i=e&&e.layer?e.layer.projection.getCode():this.srsName),i},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t.features&&(t=t.features),t},readers:{wfs:{FeatureCollection:function(e,t){t.features=[],this.readChildNodes(e,t)}}},write:function(e){var t=this.writeNode(\"wfs:Transaction\",e),i=this.schemaLocationAttr();return i&&this.setAttributeNS(t,this.namespaces.xsi,\"xsi:schemaLocation\",i),OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{wfs:{GetFeature:function(e){var t=this.createElementNSPlus(\"wfs:GetFeature\",{attributes:{service:\"WFS\",version:this.version,maxFeatures:e&&e.maxFeatures,\"xsi:schemaLocation\":this.schemaLocationAttr(e)}});return this.writeNode(\"Query\",e,t),t},Query:function(e){e=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},e);var t=this.createElementNSPlus(\"wfs:Query\",{attributes:{typeName:(e.featureNS?e.featurePrefix+\":\":\"\")+e.featureType,srsName:e.srsName}});return e.featureNS&&t.setAttribute(\"xmlns:\"+e.featurePrefix,e.featureNS),e.filter&&(this.setFilterProperty(e.filter),this.writeNode(\"ogc:Filter\",e.filter,t)),t},Transaction:function(e){var t=this.createElementNSPlus(\"wfs:Transaction\",{attributes:{service:\"WFS\",version:this.version}});if(e)for(var i,r,n=0,s=e.length;n<s;++n)r=e[n],(i=this.stateName[r.state])&&this.writeNode(i,r,t);return t},Insert:function(e){var t=this.createElementNSPlus(\"wfs:Insert\");return this.srsName=this.getSrsName(e),this.writeNode(\"feature:_typeName\",e,t),t},Update:function(e){var t=this.createElementNSPlus(\"wfs:Update\",{attributes:{typeName:(this.featureNS?this.featurePrefix+\":\":\"\")+this.featureType}});this.featureNS&&t.setAttribute(\"xmlns:\"+this.featurePrefix,this.featureNS),this.writeNode(\"Property\",{name:this.geometryName,value:e},t);for(var i in e.attributes)this.writeNode(\"Property\",{name:i,value:e.attributes[i]},t);return this.writeNode(\"ogc:Filter\",new OpenLayers.Filter.FeatureId({fids:[e.fid]}),t),t},Property:function(e){var t=this.createElementNSPlus(\"wfs:Property\");return this.writeNode(\"Name\",e.name,t),this.writeNode(\"Value\",e.value,t),t},Name:function(e){return this.createElementNSPlus(\"wfs:Name\",{value:e})},Value:function(e){var t;if(e instanceof OpenLayers.Feature.Vector){t=this.createElementNSPlus(\"wfs:Value\"),this.srsName=this.getSrsName(e);var i=this.writeNode(\"feature:_geometry\",e.geometry).firstChild;t.appendChild(i)}else t=this.createElementNSPlus(\"wfs:Value\",{value:e});return t},Delete:function(e){var t=this.createElementNSPlus(\"wfs:Delete\",{attributes:{typeName:(this.featureNS?this.featurePrefix+\":\":\"\")+this.featureType}});return this.featureNS&&t.setAttribute(\"xmlns:\"+this.featurePrefix,this.featureNS),this.writeNode(\"ogc:Filter\",new OpenLayers.Filter.FeatureId({fids:[e.fid]}),t),t}}},schemaLocationAttr:function(e){e=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},e);var t=OpenLayers.Util.extend({},this.schemaLocations);e.schema&&(t[e.featurePrefix]=e.schema);var i,r=[];for(var n in t)(i=this.namespaces[n])&&r.push(i+\" \"+t[n]);return r.join(\" \")||void 0},setFilterProperty:function(e){if(e.filters)for(var t=0,i=e.filters.length;t<i;++t)this.setFilterProperty(e.filters[t]);else e instanceof OpenLayers.Filter.Spatial&&(e.property=this.geometryName)},CLASS_NAME:\"OpenLayers.Format.WFST.v1\"}),OpenLayers.Format.WMC=OpenLayers.Class({defaultVersion:\"1.1.0\",version:null,layerOptions:null,layerParams:null,parser:null,initialize:function(e){OpenLayers.Util.extend(this,e),this.options=e},read:function(e,t){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var i=e.documentElement,r=this.version;if(r||(r=i.getAttribute(\"version\"))||(r=this.defaultVersion),!this.parser||this.parser.VERSION!=r){var n=OpenLayers.Format.WMC[\"v\"+r.replace(/\\./g,\"_\")];if(!n)throw\"Can't find a WMC parser for version \"+r;this.parser=new n(this.options)}var s,a=this.parser.read(e,t);return t.map?(this.context=a,s=t.map instanceof OpenLayers.Map?this.mergeContextToMap(a,t.map):this.contextToMap(a,t.map)):s=a,s},contextToMap:function(e,t){var i=new OpenLayers.Map(t,{maxExtent:e.maxExtent,projection:e.projection});return i.addLayers(e.layers),i.setCenter(e.bounds.getCenterLonLat(),i.getZoomForExtent(e.bounds,!0)),i},mergeContextToMap:function(e,t){return t.addLayers(e.layers),t},write:function(e,t){\"OpenLayers.Map\"==e.CLASS_NAME&&(e=this.mapToContext(e));var i=t&&t.version||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=i){var r=OpenLayers.Format.WMC[\"v\"+i.replace(/\\./g,\"_\")];if(!r)throw\"Can't find a WMS capabilities parser for version \"+i;this.parser=new r(this.options)}return this.parser.write(e,t)},mapToContext:function(e){return{bounds:e.getExtent(),maxExtent:e.maxExtent,projection:e.projection,layers:e.layers,size:e.getSize()}},CLASS_NAME:\"OpenLayers.Format.WMC\"}),OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.options=e},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t={},i=e.documentElement;return this.runChildNodes(t,i),t},runChildNodes:function(e,t){for(var i,r,n=t.childNodes,s=0;s<n.length;++s)i=n[s],1==i.nodeType&&(r=this[\"read_cap_\"+i.nodeName])&&r.apply(this,[e,i])},read_cap_Capability:function(e,t){var i={layers:[]};this.runChildNodes(i,t),e.capability=i},read_cap_Request:function(e,t){var i={};this.runChildNodes(i,t),e.request=i},read_cap_GetMap:function(e,t){var i={formats:[]};this.runChildNodes(i,t),e.getmap=i},read_cap_Format:function(e,t){e.formats&&e.formats.push(this.getChildValue(t))},read_cap_DCPType:function(e,t){var i=t.getElementsByTagName(\"OnlineResource\");i.length>0&&this.read_cap_OnlineResource(e,i[0])},read_cap_Service:function(e,t){var i={};this.runChildNodes(i,t),e.service=i},read_cap_Layer:function(e,t,i){var r={formats:e.request.getmap.formats||[],styles:[],queryable:\"1\"===t.getAttribute(\"queryable\")||\"true\"===t.getAttribute(\"queryable\")};i&&(r.styles=r.styles.concat(i.styles),r.llbbox=i.llbbox,r.minScale=i.minScale,r.maxScale=i.maxScale);for(var n,s,a,o=t.childNodes,l=0;l<o.length;++l)n=o[l],s=n.nodeName,(a=this[\"read_cap_\"+n.nodeName])&&(\"Layer\"==s?a.apply(this,[e,n,r]):a.apply(this,[r,n]));if(r.name){var p=r.name.indexOf(\":\");p>0&&(r.prefix=r.name.substring(0,p)),e.layers.push(r)}},read_cap_ScaleHint:function(e,t){var i=t.getAttribute(\"min\"),r=t.getAttribute(\"max\"),n=Math.pow(2,.5),s=OpenLayers.INCHES_PER_UNIT.m;e.maxScale=parseFloat((n*i*s*OpenLayers.DOTS_PER_INCH).toPrecision(13)),e.minScale=parseFloat((n*r*s*OpenLayers.DOTS_PER_INCH).toPrecision(13))},read_cap_Name:function(e,t){var i=this.getChildValue(t);i&&(e.name=i)},read_cap_Title:function(e,t){var i=this.getChildValue(t);i&&(e.title=i)},read_cap_Abstract:function(e,t){var i=this.getChildValue(t);i&&(e.abstract=i)},read_cap_LatLonBoundingBox:function(e,t){e.llbbox=[parseFloat(t.getAttribute(\"minx\")),parseFloat(t.getAttribute(\"miny\")),parseFloat(t.getAttribute(\"maxx\")),parseFloat(t.getAttribute(\"maxy\"))]},read_cap_Style:function(e,t){var i={};this.runChildNodes(i,t),e.styles.push(i)},read_cap_LegendURL:function(e,t){var i={width:t.getAttribute(\"width\"),height:t.getAttribute(\"height\")},r=t.getElementsByTagName(\"OnlineResource\");r.length>0&&this.read_cap_OnlineResource(i,r[0]),e.legend=i},read_cap_OnlineResource:function(e,t){e.href=this.getAttributeNS(t,\"http://www.w3.org/1999/xlink\",\"href\")},CLASS_NAME:\"OpenLayers.Format.WMSCapabilities.v1_1\"}),OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:\"1.1.1\",version:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.options=e},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=e.documentElement,i=this.version;i||(i=t.getAttribute(\"version\"))||(i=this.defaultVersion),\"1.1.1\"!=i&&\"1.1.0\"!=i||(i=\"1.1\");var r=OpenLayers.Format.WMSDescribeLayer[\"v\"+i.replace(/\\./g,\"_\")];if(!r)throw\"Can't find a WMS DescribeLayer parser for version \"+i;var n=new r(this.options),s=n.read(e);return s.version=i,s},CLASS_NAME:\"OpenLayers.Format.WMSDescribeLayer\"}),OpenLayers.Format.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Format.XML,{layerIdentifier:\"_layer\",featureIdentifier:\"_feature\",regExes:{trimSpace:/^\\s*|\\s*$/g,removeSpace:/\\s*/g,splitSpace:/\\s+/,trimComma:/\\s*,\\s*/g},gmlFormat:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,arguments),OpenLayers.Util.extend(this,e),this.options=e},read:function(e){var t;\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var i=e.documentElement;if(i){var r=this[\"read_\"+i.nodeName];t=r?r.call(this,i):new OpenLayers.Format.GML(this.options?this.options:{}).read(e)}else t=e;return t},read_msGMLOutput:function(e){var t=[],i=this.getSiblingNodesByTagCriteria(e,this.layerIdentifier);if(i)for(var r=0,n=i.length;r<n;++r){var s=i[r],a=s.nodeName;s.prefix&&(a=a.split(\":\")[1]);var a=a.replace(this.layerIdentifier,\"\"),o=this.getSiblingNodesByTagCriteria(s,this.featureIdentifier);if(o)for(var l=0;l<o.length;l++){var p=o[l],h=this.parseGeometry(p),u=this.parseAttributes(p),y=new OpenLayers.Feature.Vector(h,u,null);y.type=a,t.push(y)}}return t},read_FeatureInfoResponse:function(e){for(var t=[],i=this.getElementsByTagNameNS(e,\"*\",\"FIELDS\"),r=0,n=i.length;r<n;r++){for(var s=i[r],a={},o=0,l=s.attributes.length;o<l;o++){var p=s.attributes[o];a[p.nodeName]=p.nodeValue}t.push(new OpenLayers.Feature.Vector(null,a,null))}return t},getSiblingNodesByTagCriteria:function(e,t){var i,r,n,s,a,o=[];if(e&&e.hasChildNodes()){i=e.childNodes,n=i.length;for(var l=0;l<n;l++){for(a=i[l];a&&1!=a.nodeType;)a=a.nextSibling,l++;r=a?a.nodeName:\"\",r.length>0&&r.indexOf(t)>-1?o.push(a):(s=this.getSiblingNodesByTagCriteria(a,t),s.length>0&&(0==o.length?o=s:o.push(s)))}}return o},parseAttributes:function(e){var t={};if(1==e.nodeType){var i=e.childNodes;n=i.length;for(var r=0;r<n;++r){var s=i[r];if(1==s.nodeType){var a=s.childNodes;if(1==a.length){var o=a[0];if(3==o.nodeType||4==o.nodeType){var l=s.prefix?s.nodeName.split(\":\")[1]:s.nodeName,p=o.nodeValue.replace(this.regExes.trimSpace,\"\");t[l]=p}}}}}return t},parseGeometry:function(e){this.gmlFormat||(this.gmlFormat=new OpenLayers.Format.GML);var t=this.gmlFormat.parseFeature(e),i=null;return t&&t.geometry&&(i=t.geometry.clone(),t.destroy()),i},CLASS_NAME:\"OpenLayers.Format.WMSGetFeatureInfo\"}),OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:!0,double:!1,pixelTolerance:0,stopSingle:!1,stopDouble:!1,timerId:null,down:null,rightclickTimerId:null,initialize:function(e,t,i){OpenLayers.Handler.prototype.initialize.apply(this,arguments),null!=this.pixelTolerance&&(this.mousedown=function(e){return this.down=e.xy,!0})},mousedown:null,mouseup:function(e){var t=!0;return this.checkModifiers(e)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(e)&&(t=this.rightclick(e)),t},rightclick:function(e){if(this.passesTolerance(e)){if(null!=this.rightclickTimerId)return this.clearTimer(),this.callback(\"dblrightclick\",[e]),!this.stopDouble;var t=this.double?OpenLayers.Util.extend({},e):this.callback(\"rightclick\",[e]),i=OpenLayers.Function.bind(this.delayedRightCall,this,t);this.rightclickTimerId=window.setTimeout(i,this.delay)}return!this.stopSingle},delayedRightCall:function(e){return this.rightclickTimerId=null,e&&this.callback(\"rightclick\",[e]),!this.stopSingle},dblclick:function(e){return this.passesTolerance(e)&&(this.double&&this.callback(\"dblclick\",[e]),this.clearTimer()),!this.stopDouble},click:function(e){if(this.passesTolerance(e))if(null!=this.timerId)this.clearTimer();else{var t=this.single?OpenLayers.Util.extend({},e):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,t),this.delay)}return!this.stopSingle},passesTolerance:function(e){var t=!0;if(null!=this.pixelTolerance&&this.down){Math.sqrt(Math.pow(this.down.x-e.xy.x,2)+Math.pow(this.down.y-e.xy.y,2))>this.pixelTolerance&&(t=!1)}return t},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null),null!=this.rightclickTimerId&&(window.clearTimeout(this.rightclickTimerId),this.rightclickTimerId=null)},delayedCall:function(e){this.timerId=null,e&&this.callback(\"click\",[e])},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),this.down=null,e=!0),e},CLASS_NAME:\"OpenLayers.Handler.Click\"}),OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!0,dragging:!1,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(e,t,i){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(e){},move:function(e){},up:function(e){},out:function(e){},mousedown:function(e){var t=!0;return this.dragging=!1,this.checkModifiers(e)&&OpenLayers.Event.isLeftClick(e)?(this.started=!0,this.start=e.xy,this.last=e.xy,OpenLayers.Element.addClass(this.map.viewPortDiv,\"olDragDown\"),this.down(e),this.callback(\"down\",[e.xy]),OpenLayers.Event.stop(e),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart?document.onselectstart:function(){return!0},document.onselectstart=function(){return!1}),t=!this.stopDown):(this.started=!1,this.start=null,this.last=null),t},mousemove:function(e){return!this.started||this.timeoutId||e.xy.x==this.last.x&&e.xy.y==this.last.y||(this.interval>0&&(this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)),this.dragging=!0,this.move(e),this.callback(\"move\",[e.xy]),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart,document.onselectstart=function(){return!1}),this.last=this.evt.xy),!0},removeTimeout:function(){this.timeoutId=null},mouseup:function(e){if(this.started){var t=this.start!=this.last;this.started=!1,this.dragging=!1,OpenLayers.Element.removeClass(this.map.viewPortDiv,\"olDragDown\"),this.up(e),this.callback(\"up\",[e.xy]),t&&this.callback(\"done\",[e.xy]),document.onselectstart=this.oldOnselectstart}return!0},mouseout:function(e){if(this.started&&OpenLayers.Util.mouseLeft(e,this.map.div)){var t=this.start!=this.last;this.started=!1,this.dragging=!1,OpenLayers.Element.removeClass(this.map.viewPortDiv,\"olDragDown\"),this.out(e),this.callback(\"out\",[]),t&&this.callback(\"done\",[e.xy]),document.onselectstart&&(document.onselectstart=this.oldOnselectstart)}return!0},click:function(e){return this.start==this.last},activate:function(){var e=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.dragging=!1,e=!0),e},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.started=!1,this.dragging=!1,this.start=null,this.last=null,e=!0,OpenLayers.Element.removeClass(this.map.viewPortDiv,\"olDragDown\")),e},CLASS_NAME:\"OpenLayers.Handler.Drag\"}),OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{in:\"click\",out:\"clickout\"},mousemove:{in:\"over\",out:\"out\"},dblclick:{in:\"dblclick\",out:null},mousedown:{in:null,out:null},mouseup:{in:null,out:null}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:!0,stopDown:!0,stopUp:!1,initialize:function(e,t,i,r){OpenLayers.Handler.prototype.initialize.apply(this,[e,i,r]),this.layer=t},mousedown:function(e){return this.down=e.xy,!this.handle(e)||!this.stopDown},mouseup:function(e){return this.up=e.xy,!this.handle(e)||!this.stopUp},click:function(e){return!this.handle(e)||!this.stopClick},mousemove:function(e){return!this.callbacks.over&&!this.callbacks.out||(this.handle(e),!0)},dblclick:function(e){return!this.handle(e)},geometryTypeMatches:function(e){return null==this.geometryTypes||OpenLayers.Util.indexOf(this.geometryTypes,e.geometry.CLASS_NAME)>-1},handle:function(e){this.feature&&!this.feature.layer&&(this.feature=null);var t=e.type,i=!1,r=!!this.feature,n=\"click\"==t||\"dblclick\"==t;if(this.feature=this.layer.getFeatureFromEvent(e),this.feature&&!this.feature.layer&&(this.feature=null),this.lastFeature&&!this.lastFeature.layer&&(this.lastFeature=null),this.feature){var s=this.feature!=this.lastFeature;this.geometryTypeMatches(this.feature)?(r&&s?(this.lastFeature&&this.triggerCallback(t,\"out\",[this.lastFeature]),this.triggerCallback(t,\"in\",[this.feature])):r&&!n||this.triggerCallback(t,\"in\",[this.feature]),this.lastFeature=this.feature,i=!0):(this.lastFeature&&(r&&s||n)&&this.triggerCallback(t,\"out\",[this.lastFeature]),this.feature=null)}else this.lastFeature&&(r||n)&&this.triggerCallback(t,\"out\",[this.lastFeature]);return i},triggerCallback:function(e,t,i){var r=this.EVENTMAP[e][t];if(r)if(\"click\"==e&&this.up&&this.down){var n=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));n<=this.clickTolerance&&this.callback(r,i)}else this.callback(r,i)},activate:function(){var e=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),e=!0),e},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.moveLayerBack(),this.feature=null,this.lastFeature=null,this.down=null,this.up=null,this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),e=!0),e},handleMapEvents:function(e){e.property&&\"order\"!=e.property||this.moveLayerToTop()},moveLayerToTop:function(){var e=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(e)},moveLayerBack:function(){var e=this.layer.getZIndex()-1;e>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(e):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:\"OpenLayers.Handler.Feature\"}),OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:!1,px:null,timerId:null,initialize:function(e,t,i){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(e){return this.passesTolerance(e.xy)&&(this.clearTimer(),this.callback(\"move\",[e]),this.px=e.xy,e=OpenLayers.Util.extend({},e),this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,e),this.delay)),!this.stopMove},mouseout:function(e){return OpenLayers.Util.mouseLeft(e,this.map.div)&&(this.clearTimer(),this.callback(\"move\",[e])),!0},passesTolerance:function(e){var t=!0;if(this.pixelTolerance&&this.px){Math.sqrt(Math.pow(this.px.x-e.x,2)+Math.pow(this.px.y-e.y,2))<this.pixelTolerance&&(t=!1)}return t},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null)},delayedCall:function(e){this.callback(\"pause\",[e])},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),e=!0),e},CLASS_NAME:\"OpenLayers.Handler.Hover\"}),OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:[\"keydown\",\"keyup\"],eventListener:null,initialize:function(e,t,i){OpenLayers.Handler.prototype.initialize.apply(this,arguments),this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate(),this.eventListener=null,OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var e=0,t=this.KEY_EVENTS.length;e<t;e++)OpenLayers.Event.observe(document,this.KEY_EVENTS[e],this.eventListener);return!0}return!1},deactivate:function(){var e=!1;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var t=0,i=this.KEY_EVENTS.length;t<i;t++)OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[t],this.eventListener);e=!0}return e},handleKeyEvent:function(e){this.checkModifiers(e)&&this.callback(e.type,[e])},CLASS_NAME:\"OpenLayers.Handler.Keyboard\"}),OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(e,t,i){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(e){if(this.map&&this.checkModifiers(e)){for(var t=!1,i=!1,r=!1,n=OpenLayers.Event.element(e);null!=n&&!r&&!t;){if(!t)try{if(n.currentStyle)a=n.currentStyle.overflow;else var s=document.defaultView.getComputedStyle(n,null),a=s.getPropertyValue(\"overflow\");t=a&&\"auto\"==a||\"scroll\"==a}catch(e){}if(!i)for(var o=0,l=this.map.layers.length;o<l;o++)if(n==this.map.layers[o].div||n==this.map.layers[o].pane){i=!0;break}r=n==this.map.div,n=n.parentNode}!t&&r&&(i&&this.wheelZoom(e),OpenLayers.Event.stop(e))}},wheelZoom:function(e){var t=0;e||(e=window.event),e.wheelDelta?(t=e.wheelDelta/120,window.opera&&window.opera.version()<9.2&&(t=-t)):e.detail&&(t=-e.detail/3),t&&(this.mousePosition&&(e.xy=this.mousePosition),e.xy||(e.xy=this.map.getPixelFromLonLat(this.map.getCenter())),t<0?this.callback(\"down\",[e,t]):this.callback(\"up\",[e,t]))},mousemove:function(e){this.mousePosition=e.xy},activate:function(e){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var t=this.wheelListener;return OpenLayers.Event.observe(window,\"DOMMouseScroll\",t),OpenLayers.Event.observe(window,\"mousewheel\",t),OpenLayers.Event.observe(document,\"mousewheel\",t),!0}return!1},deactivate:function(e){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var t=this.wheelListener;return OpenLayers.Event.stopObserving(window,\"DOMMouseScroll\",t),OpenLayers.Event.stopObserving(window,\"mousewheel\",t),OpenLayers.Event.stopObserving(document,\"mousewheel\",t),!0}return!1},CLASS_NAME:\"OpenLayers.Handler.MouseWheel\"}),OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:[\"loadstart\",\"loadend\",\"loadcancel\",\"visibilitychanged\",\"move\",\"moveend\"],events:null,map:null,isBaseLayer:!1,alpha:!1,displayInLayerSwitcher:!0,visibility:!0,attribution:null,inRange:!1,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:!1,wrapDateLine:!1,transitionEffect:null,SUPPORTED_TRANSITIONS:[\"resize\"],initialize:function(e,t){this.addOptions(t),this.name=e,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.EVENT_TYPES),this.eventListeners instanceof Object&&this.events.on(this.eventListeners)),this.wrapDateLine&&(this.displayOutsideMaxExtent=!0)},destroy:function(e){null==e&&(e=!0),null!=this.map&&this.map.removeLayer(this,e),this.projection=null,this.map=null,this.name=null,this.div=null,this.options=null,this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy()),this.eventListeners=null,this.events=null},clone:function(e){return null==e&&(e=new OpenLayers.Layer(this.name,this.options)),OpenLayers.Util.applyDefaults(e,this),e.map=null,e},setName:function(e){e!=this.name&&(this.name=e,null!=this.map&&this.map.events.triggerEvent(\"changelayer\",{layer:this,property:\"name\"}))},addOptions:function(e){null==this.options&&(this.options={}),OpenLayers.Util.extend(this.options,e),OpenLayers.Util.extend(this,e)},onMapResize:function(){},redraw:function(){var e=!1;if(this.map){this.inRange=this.calculateInRange();var t=this.getExtent();if(t&&this.inRange&&this.visibility){this.moveTo(t,!0,!1),this.events.triggerEvent(\"moveend\",{zoomChanged:!0}),e=!0}}return e},moveTo:function(e,t,i){var r=this.visibility;this.isBaseLayer||(r=r&&this.inRange),this.display(r)},setMap:function(e){if(null==this.map){if(this.map=e,this.maxExtent=this.maxExtent||this.map.maxExtent,this.projection=this.projection||this.map.projection,this.projection&&\"string\"==typeof this.projection&&(this.projection=new OpenLayers.Projection(this.projection)),this.units=this.projection.getUnits()||this.units||this.map.units,this.initResolutions(),!this.isBaseLayer){this.inRange=this.calculateInRange();var t=this.visibility&&this.inRange;this.div.style.display=t?\"\":\"none\"}this.setTileSize()}},afterAdd:function(){},removeMap:function(e){},getImageSize:function(){return this.imageSize||this.tileSize},setTileSize:function(e){var t=e?e:this.tileSize?this.tileSize:this.map.getTileSize();this.tileSize=t,this.gutter&&(this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter),this.imageSize=new OpenLayers.Size(t.w+2*this.gutter,t.h+2*this.gutter))},getVisibility:function(){return this.visibility},setVisibility:function(e){e!=this.visibility&&(this.visibility=e,this.display(e),this.redraw(),null!=this.map&&this.map.events.triggerEvent(\"changelayer\",{layer:this,property:\"visibility\"}),this.events.triggerEvent(\"visibilitychanged\"))},display:function(e){var t=this.calculateInRange();e!=(\"none\"!=this.div.style.display)&&(this.div.style.display=e&&t?\"block\":\"none\")},calculateInRange:function(){var e=!1;if(this.alwaysInRange)e=!0;else if(this.map){var t=this.map.getResolution();e=t>=this.minResolution&&t<=this.maxResolution}return e},setIsBaseLayer:function(e){e!=this.isBaseLayer&&(this.isBaseLayer=e,null!=this.map&&this.map.events.triggerEvent(\"changebaselayer\",{layer:this}))},initResolutions:function(){for(var e=new Array(\"projection\",\"units\",\"scales\",\"resolutions\",\"maxScale\",\"minScale\",\"maxResolution\",\"minResolution\",\"minExtent\",\"maxExtent\",\"numZoomLevels\",\"maxZoomLevel\"),t=[\"projection\",\"units\"],i=!1,r={},n=0,s=e.length;n<s;n++){var a=e[n];this.options[a]&&OpenLayers.Util.indexOf(t,a)==-1&&(i=!0),r[a]=this.options[a]||this.map[a]}if(null==this.alwaysInRange&&(this.alwaysInRange=!i),null==this.options.minScale&&null==this.options.maxScale||null!=this.options.scales||(r.scales=null),null==this.options.minResolution&&null==this.options.maxResolution||null!=this.options.resolutions||(r.resolutions=null),!r.numZoomLevels&&r.maxZoomLevel&&(r.numZoomLevels=r.maxZoomLevel+1),null!=r.scales||null!=r.resolutions){if(null!=r.scales){r.resolutions=[];for(var n=0,s=r.scales.length;n<s;n++){var o=r.scales[n];r.resolutions[n]=OpenLayers.Util.getResolutionFromScale(o,r.units)}}r.numZoomLevels=r.resolutions.length}else{if(r.minScale)r.maxResolution=OpenLayers.Util.getResolutionFromScale(r.minScale,r.units);else if(\"auto\"==r.maxResolution){var l=this.map.getSize(),p=r.maxExtent.getWidth()/l.w,h=r.maxExtent.getHeight()/l.h;r.maxResolution=Math.max(p,h)}if(null!=r.maxScale)r.minResolution=OpenLayers.Util.getResolutionFromScale(r.maxScale,r.units);else if(\"auto\"==r.minResolution&&null!=r.minExtent){var l=this.map.getSize(),p=r.minExtent.getWidth()/l.w,h=r.minExtent.getHeight()/l.h;r.minResolution=Math.max(p,h)}if(null!=r.minResolution&&void 0==this.options.numZoomLevels){var u=r.maxResolution/r.minResolution;r.numZoomLevels=Math.floor(Math.log(u)/Math.log(2))+1}r.resolutions=new Array(r.numZoomLevels);var y=2;\"number\"==typeof r.minResolution&&r.numZoomLevels>1&&(y=Math.pow(r.maxResolution/r.minResolution,1/(r.numZoomLevels-1)));for(var n=0;n<r.numZoomLevels;n++){var c=r.maxResolution/Math.pow(y,n);r.resolutions[n]=c}}r.resolutions.sort(function(e,t){return t-e}),this.resolutions=r.resolutions,this.maxResolution=r.resolutions[0];var d=r.resolutions.length-1;this.minResolution=r.resolutions[d],this.scales=[];for(var n=0,s=r.resolutions.length;n<s;n++)this.scales[n]=OpenLayers.Util.getScaleFromResolution(r.resolutions[n],r.units);this.minScale=this.scales[0],this.maxScale=this.scales[this.scales.length-1],this.numZoomLevels=r.numZoomLevels},getResolution:function(){var e=this.map.getZoom();return this.getResolutionForZoom(e)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(e,t){var i=this.map.getSize(),r=Math.max(e.getWidth()/i.w,e.getHeight()/i.h);return this.getZoomForResolution(r,t)},getDataExtent:function(){},getResolutionForZoom:function(e){e=Math.max(0,Math.min(e,this.resolutions.length-1));var t;if(this.map.fractionalZoom){var i=Math.floor(e),r=Math.ceil(e);t=this.resolutions[i]-(e-i)*(this.resolutions[i]-this.resolutions[r])}else t=this.resolutions[Math.round(e)];return t},getZoomForResolution:function(e,t){var i;if(this.map.fractionalZoom){for(var r,n=0,s=this.resolutions.length-1,a=this.resolutions[n],o=this.resolutions[s],l=0,p=this.resolutions.length;l<p;++l)if(r=this.resolutions[l],r>=e&&(a=r,n=l),r<=e){o=r,s=l;break}var h=a-o;i=h>0?n+(a-e)/h:n}else{for(var u,y=Number.POSITIVE_INFINITY,l=0,p=this.resolutions.length;l<p;l++)if(t){if((u=Math.abs(this.resolutions[l]-e))>y)break;y=u}else if(this.resolutions[l]<e)break;i=Math.max(0,l-1)}return i},getLonLatFromViewPortPx:function(e){var t=null;if(null!=e){var i=this.map.getSize(),r=this.map.getCenter();if(r){var n=this.map.getResolution(),s=e.x-i.w/2,a=e.y-i.h/2\n;t=new OpenLayers.LonLat(r.lon+s*n,r.lat-a*n),this.wrapDateLine&&(t=t.wrapDateLine(this.maxExtent))}}return t},getViewPortPxFromLonLat:function(e){var t=null;if(null!=e){var i=this.map.getResolution(),r=this.map.getExtent();t=new OpenLayers.Pixel(1/i*(e.lon-r.left),1/i*(r.top-e.lat))}return t},setOpacity:function(e){if(e!=this.opacity){this.opacity=e;for(var t=0,i=this.div.childNodes.length;t<i;++t){var r=this.div.childNodes[t].firstChild;OpenLayers.Util.modifyDOMElement(r,null,null,null,null,null,null,e)}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(e){this.div.style.zIndex=e},adjustBounds:function(e){if(this.gutter){var t=this.gutter*this.map.getResolution();e=new OpenLayers.Bounds(e.left-t,e.bottom-t,e.right+t,e.top+t)}if(this.wrapDateLine){var i={rightTolerance:this.getResolution()};e=e.wrapDateLine(this.maxExtent,i)}return e},CLASS_NAME:\"OpenLayers.Layer\"}),OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(e,t,i){this.bounds=e,this.div=OpenLayers.Util.createDiv(),this.div.style.overflow=\"hidden\",this.events=new OpenLayers.Events(this,this.div,null),this.setBorder(t,i)},destroy:function(){this.bounds=null,this.div=null,OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(e,t){e||(e=\"red\"),t||(t=2),this.div.style.border=t+\"px solid \"+e},draw:function(e,t){return OpenLayers.Util.modifyDOMElement(this.div,null,e,t),this.div},onScreen:function(){var e=!1;if(this.map){e=this.map.getExtent().containsBounds(this.bounds,!0,!0)}return e},display:function(e){this.div.style.display=e?\"\":\"none\"},CLASS_NAME:\"OpenLayers.Marker.Box\"}),function(){function e(){this._object=s?new s:new window.ActiveXObject(\"Microsoft.XMLHTTP\")}function t(t){t.onreadystatechange&&t.onreadystatechange.apply(t),e.onreadystatechange&&e.onreadystatechange.apply(t)}function i(e){var t=e.responseXML;return o&&t&&!t.documentElement&&e.getResponseHeader(\"Content-Type\").match(/[^\\/]+\\/[^\\+]+\\+xml/)&&(t=new ActiveXObject(\"Microsoft.XMLDOM\"),t.loadXML(e.responseText)),t&&(o&&0!=t.parseError||t.documentElement&&\"parsererror\"==t.documentElement.tagName)?null:t}function r(e){try{e.responseText=e._object.responseText}catch(e){}try{e.responseXML=i(e._object)}catch(e){}try{e.status=e._object.status}catch(e){}try{e.statusText=e._object.statusText}catch(e){}}function n(e){e._object.onreadystatechange=new window.Function,delete e._headers}var s=window.XMLHttpRequest,a=!!window.controllers,o=window.document.all&&!window.opera;a&&s.wrapped&&(e.wrapped=s.wrapped),e.UNSENT=0,e.OPENED=1,e.HEADERS_RECEIVED=2,e.LOADING=3,e.DONE=4,e.prototype.readyState=e.UNSENT,e.prototype.responseText=\"\",e.prototype.responseXML=null,e.prototype.status=0,e.prototype.statusText=\"\",e.prototype.onreadystatechange=null,e.onreadystatechange=null,e.onopen=null,e.onsend=null,e.onabort=null,e.prototype.open=function(i,s,l,p,h){this._async=l;var u=this,y=this.readyState;if(o){var c=function(){u._object.readyState!=e.DONE&&n(u)};l&&window.attachEvent(\"onunload\",c)}this._object.onreadystatechange=function(){if(!a||l){if(u.readyState=u._object.readyState,r(u),u._aborted)return void(u.readyState=e.UNSENT);u.readyState==e.DONE&&(n(u),o&&l&&window.detachEvent(\"onunload\",c)),y!=u.readyState&&t(u),y=u.readyState}},e.onopen&&e.onopen.apply(this,arguments),this._object.open(i,s,l,p,h),!l&&a&&(this.readyState=e.OPENED,t(this))},e.prototype.send=function(i){if(e.onsend&&e.onsend.apply(this,arguments),i&&i.nodeType&&(i=window.XMLSerializer?(new window.XMLSerializer).serializeToString(i):i.xml,this._headers[\"Content-Type\"]||this._object.setRequestHeader(\"Content-Type\",\"application/xml\")),this._object.send(i),a&&!this._async)for(this.readyState=e.OPENED,r(this);this.readyState<e.DONE;)if(this.readyState++,t(this),this._aborted)return},e.prototype.abort=function(){e.onabort&&e.onabort.apply(this,arguments),this.readyState>e.UNSENT&&(this._aborted=!0),this._object.abort(),n(this)},e.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()},e.prototype.getResponseHeader=function(e){return this._object.getResponseHeader(e)},e.prototype.setRequestHeader=function(e,t){return this._headers||(this._headers={}),this._headers[e]=t,this._object.setRequestHeader(e,t)},e.prototype.toString=function(){return\"[object XMLHttpRequest]\"},e.toString=function(){return\"[XMLHttpRequest]\"},window.Function.prototype.apply||(window.Function.prototype.apply=function(e,t){t||(t=[]),e.__func=this,e.__func(t[0],t[1],t[2],t[3],t[4]),delete e.__func}),OpenLayers.Request.XMLHttpRequest=e}(),OpenLayers.ProxyHost=\"\",OpenLayers.nullHandler=function(e){OpenLayers.Console.userError(OpenLayers.i18n(\"unhandledRequest\",{statusText:e.statusText}))},OpenLayers.loadURL=function(e,t,i,r,n){\"string\"==typeof t&&(t=OpenLayers.Util.getParameters(t));var s=r?r:OpenLayers.nullHandler,a=n?n:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:e,params:t,success:s,failure:a,scope:i})},OpenLayers.parseXMLString=function(e){var t=e.indexOf(\"<\");return t>0&&(e=e.substring(t)),OpenLayers.Util.Try(function(){var t=new ActiveXObject(\"Microsoft.XMLDOM\");return t.loadXML(e),t},function(){return(new DOMParser).parseFromString(e,\"text/xml\")},function(){var t=new XMLHttpRequest;return t.open(\"GET\",\"data:text/xml;charset=utf-8,\"+encodeURIComponent(e),!1),t.overrideMimeType&&t.overrideMimeType(\"text/xml\"),t.send(null),t.responseXML})},OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest},function(){return new ActiveXObject(\"Msxml2.XMLHTTP\")},function(){return new ActiveXObject(\"Microsoft.XMLHTTP\")})||!1},activeRequestCount:0},OpenLayers.Ajax.Responders={responders:[],register:function(e){for(var t=0;t<this.responders.length;t++)if(e==this.responders[t])return;this.responders.push(e)},unregister:function(e){OpenLayers.Util.removeItem(this.reponders,e)},dispatch:function(e,t,i){for(var r,n=0;n<this.responders.length;n++)if(r=this.responders[n],r[e]&&\"function\"==typeof r[e])try{r[e].apply(r,[t,i])}catch(e){}}},OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}}),OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(e){this.options={method:\"post\",asynchronous:!0,contentType:\"application/xml\",parameters:\"\"},OpenLayers.Util.extend(this.options,e||{}),this.options.method=this.options.method.toLowerCase(),\"string\"==typeof this.options.parameters&&(this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters))}}),OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:!1,initialize:function(e,t){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[t]),OpenLayers.ProxyHost&&OpenLayers.String.startsWith(e,\"http\")&&(e=OpenLayers.ProxyHost+encodeURIComponent(e)),this.transport=OpenLayers.Ajax.getTransport(),this.request(e)},request:function(e){this.url=e,this.method=this.options.method;var t=OpenLayers.Util.extend({},this.options.parameters);\"get\"!=this.method&&\"post\"!=this.method&&(t._method=this.method,this.method=\"post\"),this.parameters=t,(t=OpenLayers.Util.getParameterString(t))&&(\"get\"==this.method?this.url+=(this.url.indexOf(\"?\")>-1?\"&\":\"?\")+t:/Konqueror|Safari|KHTML/.test(navigator.userAgent)&&(t+=\"&_=\"));try{var i=new OpenLayers.Ajax.Response(this);this.options.onCreate&&this.options.onCreate(i),OpenLayers.Ajax.Responders.dispatch(\"onCreate\",this,i),this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous),this.options.asynchronous&&window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10),this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this),this.setRequestHeaders(),this.body=\"post\"==this.method?this.options.postBody||t:null,this.transport.send(this.body),!this.options.asynchronous&&this.transport.overrideMimeType&&this.onStateChange()}catch(e){this.dispatchException(e)}},onStateChange:function(){var e=this.transport.readyState;e>1&&(4!=e||!this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var e={\"X-Requested-With\":\"XMLHttpRequest\",Accept:\"text/javascript, text/html, application/xml, text/xml, */*\",OpenLayers:!0};if(\"post\"==this.method&&(e[\"Content-type\"]=this.options.contentType+(this.options.encoding?\"; charset=\"+this.options.encoding:\"\"),this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\\/(\\d{4})/)||[0,2005])[1]<2005&&(e.Connection=\"close\")),\"object\"==typeof this.options.requestHeaders){var t=this.options.requestHeaders;if(\"function\"==typeof t.push)for(var i=0,r=t.length;i<r;i+=2)e[t[i]]=t[i+1];else for(var i in t)e[i]=t[i]}for(var n in e)this.transport.setRequestHeader(n,e[n])},success:function(){var e=this.getStatus();return!e||e>=200&&e<300},getStatus:function(){try{return this.transport.status||0}catch(e){return 0}},respondToReadyState:function(e){var t=OpenLayers.Ajax.Request.Events[e],i=new OpenLayers.Ajax.Response(this);if(\"Complete\"==t){try{this._complete=!0,(this.options[\"on\"+i.status]||this.options[\"on\"+(this.success()?\"Success\":\"Failure\")]||OpenLayers.Ajax.emptyFunction)(i)}catch(e){this.dispatchException(e)}i.getHeader(\"Content-type\")}try{(this.options[\"on\"+t]||OpenLayers.Ajax.emptyFunction)(i),OpenLayers.Ajax.Responders.dispatch(\"on\"+t,this,i)}catch(e){this.dispatchException(e)}\"Complete\"==t&&(this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction)},getHeader:function(e){try{return this.transport.getResponseHeader(e)}catch(e){return null}},dispatchException:function(e){var t=this.options.onException;if(t)t(this,e),OpenLayers.Ajax.Responders.dispatch(\"onException\",this,e);else{for(var i=!1,r=OpenLayers.Ajax.Responders.responders,n=0;n<r.length;n++)if(r[n].onException){i=!0;break}if(!i)throw e;OpenLayers.Ajax.Responders.dispatch(\"onException\",this,e)}}}),OpenLayers.Ajax.Request.Events=[\"Uninitialized\",\"Loading\",\"Loaded\",\"Interactive\",\"Complete\"],OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:\"\",initialize:function(e){this.request=e;var t=this.transport=e.transport,i=this.readyState=t.readyState;if((i>2&&(!window.attachEvent||window.opera)||4==i)&&(this.status=this.getStatus(),this.statusText=this.getStatusText(),this.responseText=null==t.responseText?\"\":String(t.responseText)),4==i){var r=t.responseXML;this.responseXML=void 0===r?null:r}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||\"\"}catch(e){return\"\"}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(e){return this.transport.getResponseHeader(e)}}),OpenLayers.Ajax.getElementsByTagNameNS=function(e,t,i,r){return e.getElementsByTagNameNS?e.getElementsByTagNameNS(t,r):e.getElementsByTagName(i+\":\"+r)},OpenLayers.Ajax.serializeXMLToString=function(e){return(new XMLSerializer).serializeToString(e)},OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(e,t){},onDrag:function(e,t){},onComplete:function(e,t){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(e,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.layer=e,this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},destroy:function(){this.layer=null,OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.handlers.drag.deactivate(),this.handlers.feature.deactivate(),this.feature=null,this.dragging=!1,this.lastPixel=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+\"Over\"),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(e){this.handlers.drag.dragging?this.feature.id==e.id?this.over=!0:this.over=!1:(this.feature=e,this.handlers.drag.activate(),this.over=!0,OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+\"Over\"))},downFeature:function(e){this.lastPixel=e,this.onStart(this.feature,e)},moveFeature:function(e){var t=this.map.getResolution();this.feature.geometry.move(t*(e.x-this.lastPixel.x),t*(this.lastPixel.y-e.y)),this.layer.drawFeature(this.feature),this.lastPixel=e,this.onDrag(this.feature,e)},upFeature:function(e){this.over||this.handlers.drag.deactivate()},doneDragging:function(e){this.onComplete(this.feature,e)},outFeature:function(e){this.handlers.drag.dragging?this.feature.id==e.id&&(this.over=!1):(this.over=!1,this.handlers.drag.deactivate(),OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+\"Over\"),this.feature=null)},cancel:function(){this.handlers.drag.deactivate(),this.over=!1},setMap:function(e){this.handlers.drag.setMap(e),this.handlers.feature.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Control.DragFeature\"}),OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:!1,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval})},panMap:function(e){this.panned=!0,this.map.pan(this.handler.last.x-e.x,this.handler.last.y-e.y,{dragging:this.handler.dragging,animate:!1})},panMapDone:function(e){this.panned&&(this.panMap(e),this.panned=!1)},CLASS_NAME:\"OpenLayers.Control.DragPan\"}),OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.handler&&this.handler.destroy(),this.handler=null,OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress}),this.activate()},defaultKeyPress:function(e){switch(e.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:var t=this.map.getSize();this.map.pan(0,-.75*t.h);break;case 34:var t=this.map.getSize();this.map.pan(0,.75*t.h);break;case 35:var t=this.map.getSize();this.map.pan(.75*t.w,0);break;case 36:var t=this.map.getSize();this.map.pan(-.75*t.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut()}},CLASS_NAME:\"OpenLayers.Control.KeyboardDefaults\"}),OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,maxFeatures:10,layers:null,queryVisible:!1,url:null,layerUrls:null,infoFormat:\"text/html\",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,EVENT_TYPES:[\"getfeatureinfo\"],initialize:function(e){this.EVENT_TYPES=OpenLayers.Control.WMSGetFeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES),e=e||{},e.handlerOptions=e.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[e]),this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(e.formatOptions)),this.hover?this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250})):this.handler=new OpenLayers.Handler.Click(this,{click:this.getInfoForClick},this.handlerOptions.click||{})},activate:function(){return this.active||this.handler.activate(),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},getInfoForClick:function(e){OpenLayers.Element.addClass(this.map.viewPortDiv,\"olCursorWait\"),this.request(e.xy,{})},getInfoForHover:function(e){this.request(e.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var e,t,i=[],r=this.layers||this.map.layers,n=0,s=r.length;n<s;++n)(e=r[n])instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||e.getVisibility())&&(t=e.url instanceof Array?e.url[0]:e.url,this.url||(this.url=t),this.urlMatches(t)&&i.push(e));return i},urlMatches:function(e){var t=OpenLayers.Util.isEquivalentUrl(this.url,e);if(!t&&this.layerUrls)for(var i=0,r=this.layerUrls.length;i<r;++i)if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[i],e)){t=!0;break}return t},request:function(e,t){t=t||{};var i=[],r=[],n=this.findLayers();if(n.length>0){for(var s=0,a=n.length;s<a;s++)i=i.concat(n[s].params.LAYERS),r=n[s].params.STYLES?r.concat(n[s].params.STYLES):n[s].params.LAYERS instanceof Array?r.concat(new Array(n[s].params.LAYERS.length)):r.concat(n[s].params.LAYERS.replace(/[^,]/g,\"\"));var o={url:this.url,params:OpenLayers.Util.applyDefaults({service:\"WMS\",version:\"1.1.0\",request:\"GetFeatureInfo\",layers:i,query_layers:i,styles:r,bbox:this.map.getExtent().toBBOX(),srs:this.map.getProjection(),feature_count:this.maxFeatures,x:e.x,y:e.y,height:this.map.getSize().h,width:this.map.getSize().w,info_format:this.infoFormat},this.vendorParams),callback:function(t){this.handleResponse(e,t)},scope:this},l=OpenLayers.Request.GET(o);t.hover===!0&&(this.hoverRequest=l.priv)}else OpenLayers.Element.removeClass(this.map.viewPortDiv,\"olCursorWait\")},handleResponse:function(e,t){var i=t.responseXML;i&&i.documentElement||(i=t.responseText);var r=this.format.read(i);this.events.triggerEvent(\"getfeatureinfo\",{text:t.responseText,features:r,request:t,xy:e}),OpenLayers.Element.removeClass(this.map.viewPortDiv,\"olCursorWait\")},setMap:function(e){this.handler.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Control.WMSGetFeatureInfo\"}),OpenLayers.State={UNKNOWN:\"Unknown\",INSERT:\"Insert\",UPDATE:\"Update\",DELETE:\"Delete\"},OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:\"default\",initialize:function(e,t,i){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,t]),this.lonlat=null,this.geometry=e?e:null,this.state=null,this.attributes={},t&&(this.attributes=OpenLayers.Util.extend(this.attributes,t)),this.style=i?i:null},destroy:function(){this.layer&&(this.layer.removeFeatures(this),this.layer=null),this.geometry=null,OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(e){var t=!1;if(this.layer&&this.layer.map){var i=this.layer.map.getExtent();if(e){var r=this.geometry.getBounds();t=i.intersectsBounds(r)}else{t=i.toGeometry().intersects(this.geometry)}}return t},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(e,t,i){var r=!1;return this.geometry&&(r=this.geometry.atPoint(e,t,i)),r},destroyPopup:function(){},move:function(e){if(this.layer&&this.geometry.move){var t;t=\"OpenLayers.LonLat\"==e.CLASS_NAME?this.layer.getViewPortPxFromLonLat(e):e;var i=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),r=this.layer.map.getResolution();return this.geometry.move(r*(t.x-i.x),r*(i.y-t.y)),this.layer.drawFeature(this),i}},toState:function(e){if(e==OpenLayers.State.UPDATE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=e;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:}else if(e==OpenLayers.State.INSERT)switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=e}else if(e==OpenLayers.State.DELETE)switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=e}else e==OpenLayers.State.UNKNOWN&&(this.state=e)},CLASS_NAME:\"OpenLayers.Feature.Vector\"}),OpenLayers.Feature.Vector.style={default:{fillColor:\"#ee9900\",fillOpacity:.4,hoverFillColor:\"white\",hoverFillOpacity:.8,strokeColor:\"#ee9900\",strokeOpacity:1,strokeWidth:1,strokeLinecap:\"round\",strokeDashstyle:\"solid\",hoverStrokeColor:\"red\",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:\"%\",pointerEvents:\"visiblePainted\",cursor:\"inherit\"},select:{fillColor:\"blue\",fillOpacity:.4,hoverFillColor:\"white\",hoverFillOpacity:.8,strokeColor:\"blue\",strokeOpacity:1,strokeWidth:2,strokeLinecap:\"round\",strokeDashstyle:\"solid\",hoverStrokeColor:\"red\",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:\"%\",pointerEvents:\"visiblePainted\",cursor:\"pointer\"},temporary:{fillColor:\"#66cccc\",fillOpacity:.2,hoverFillColor:\"white\",hoverFillOpacity:.8,strokeColor:\"#66cccc\",strokeOpacity:1,strokeLinecap:\"round\",strokeWidth:2,strokeDashstyle:\"solid\",hoverStrokeColor:\"red\",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:\"%\",pointerEvents:\"visiblePainted\",cursor:\"inherit\"},delete:{display:\"none\"}},OpenLayers.Feature.WFS=OpenLayers.Class(OpenLayers.Feature,{initialize:function(e,t){var i=arguments,r=this.processXMLNode(t);i=new Array(e,r.lonlat,r),OpenLayers.Feature.prototype.initialize.apply(this,i),this.createMarker(),this.layer.addMarker(this.marker)},destroy:function(){null!=this.marker&&this.layer.removeMarker(this.marker),OpenLayers.Feature.prototype.destroy.apply(this,arguments)},processXMLNode:function(e){var t=OpenLayers.Ajax.getElementsByTagNameNS(e,\"http://www.opengis.net/gml\",\"gml\",\"Point\"),i=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(t[0],\"http://www.opengis.net/gml\",\"gml\",\"coordinates\")[0]),r=i.split(\",\");return{lonlat:new OpenLayers.LonLat(parseFloat(r[0]),parseFloat(r[1])),id:null}},CLASS_NAME:\"OpenLayers.Feature.WFS\"}),OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.WFSCapabilities,{initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.options=e},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t={},i=e.documentElement;return this.runChildNodes(t,i),t},runChildNodes:function(e,t){for(var i,r,n=t.childNodes,s=0;s<n.length;++s)i=n[s],1==i.nodeType&&(r=this[\"read_cap_\"+i.nodeName])&&r.apply(this,[e,i])},read_cap_FeatureTypeList:function(e,t){var i={featureTypes:[]};this.runChildNodes(i,t),e.featureTypeList=i},read_cap_FeatureType:function(e,t,i){var r={};this.runChildNodes(r,t),e.featureTypes.push(r)},read_cap_Name:function(e,t){var i=this.getChildValue(t);i&&(e.name=i)},read_cap_Title:function(e,t){var i=this.getChildValue(t);i&&(e.title=i)},read_cap_Abstract:function(e,t){var i=this.getChildValue(t);i&&(e.abstract=i)},CLASS_NAME:\"OpenLayers.Format.WFSCapabilities.v1\"}),OpenLayers.Format.WMC.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ol:\"http://openlayers.org/context\",wmc:\"http://www.opengis.net/context\",sld:\"http://www.opengis.net/sld\",xlink:\"http://www.w3.org/1999/xlink\",xsi:\"http://www.w3.org/2001/XMLSchema-instance\"},schemaLocation:\"\",getNamespacePrefix:function(e){var t=null;if(null==e)t=this.namespaces[this.defaultPrefix];else for(t in this.namespaces)if(this.namespaces[t]==e)break;return t},defaultPrefix:\"wmc\",rootPrefix:null,defaultStyleName:\"\",defaultStyleTitle:\"Default\",initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=e.documentElement;this.rootPrefix=t.prefix;var i={version:t.getAttribute(\"version\")};return this.runChildNodes(i,t),i},runChildNodes:function(e,t){for(var i,r,n,s,a=t.childNodes,o=0,l=a.length;o<l;++o)i=a[o],1==i.nodeType&&(n=this.getNamespacePrefix(i.namespaceURI),s=i.nodeName.split(\":\").pop(),(r=this[\"read_\"+n+\"_\"+s])&&r.apply(this,[e,i]))},read_wmc_General:function(e,t){this.runChildNodes(e,t)},read_wmc_BoundingBox:function(e,t){e.projection=t.getAttribute(\"SRS\"),e.bounds=new OpenLayers.Bounds(parseFloat(t.getAttribute(\"minx\")),parseFloat(t.getAttribute(\"miny\")),parseFloat(t.getAttribute(\"maxx\")),parseFloat(t.getAttribute(\"maxy\")))},read_wmc_LayerList:function(e,t){e.layers=[],this.runChildNodes(e,t)},read_wmc_Layer:function(e,t){var i={params:this.layerParams||{},options:{visibility:\"1\"!=t.getAttribute(\"hidden\"),queryable:\"1\"==t.getAttribute(\"queryable\")},formats:[],styles:[]};this.runChildNodes(i,t),i.params.layers=i.name,i.options.maxExtent=i.maxExtent;var r=this.getLayerFromInfo(i);e.layers.push(r)},getLayerFromInfo:function(e){var t=e.options;return this.layerOptions&&OpenLayers.Util.applyDefaults(t,this.layerOptions),new OpenLayers.Layer.WMS(e.title,e.href,e.params,t)},read_wmc_Extension:function(e,t){this.runChildNodes(e,t)},read_ol_units:function(e,t){e.options.units=this.getChildValue(t)},read_ol_maxExtent:function(e,t){var i=new OpenLayers.Bounds(t.getAttribute(\"minx\"),t.getAttribute(\"miny\"),t.getAttribute(\"maxx\"),t.getAttribute(\"maxy\"));e.maxExtent=i},read_ol_transparent:function(e,t){e.params.transparent=this.getChildValue(t)},read_ol_numZoomLevels:function(e,t){e.options.numZoomLevels=parseInt(this.getChildValue(t))},read_ol_opacity:function(e,t){e.options.opacity=parseFloat(this.getChildValue(t))},read_ol_singleTile:function(e,t){e.options.singleTile=\"true\"==this.getChildValue(t)},read_ol_isBaseLayer:function(e,t){e.options.isBaseLayer=\"true\"==this.getChildValue(t)},read_ol_displayInLayerSwitcher:function(e,t){e.options.displayInLayerSwitcher=\"true\"==this.getChildValue(t)},read_wmc_Server:function(e,t){e.params.version=t.getAttribute(\"version\"),this.runChildNodes(e,t)},read_wmc_FormatList:function(e,t){this.runChildNodes(e,t)},read_wmc_Format:function(e,t){var i=this.getChildValue(t);e.formats.push(i),\"1\"==t.getAttribute(\"current\")&&(e.params.format=i)},read_wmc_StyleList:function(e,t){this.runChildNodes(e,t)},read_wmc_Style:function(e,t){var i={};this.runChildNodes(i,t),\"1\"==t.getAttribute(\"current\")&&(i.href?e.params.sld=i.href:i.body?e.params.sld_body=i.body:e.params.styles=i.name),e.styles.push(i)},read_wmc_SLD:function(e,t){this.runChildNodes(e,t)},read_sld_StyledLayerDescriptor:function(e,t){var i=OpenLayers.Format.XML.prototype.write.apply(this,[t]);e.body=i},read_wmc_OnlineResource:function(e,t){e.href=this.getAttributeNS(t,this.namespaces.xlink,\"href\")},read_wmc_Name:function(e,t){var i=this.getChildValue(t);i&&(e.name=i)},read_wmc_Title:function(e,t){var i=this.getChildValue(t);i&&(e.title=i)},read_wmc_MetadataURL:function(e,t){var i={},r=t.getElementsByTagName(\"OnlineResource\");r.length>0&&this.read_wmc_OnlineResource(i,r[0]),e.options.metadataURL=i.href},read_wmc_Abstract:function(e,t){var i=this.getChildValue(t);i&&(e.abstract=i)},read_wmc_LatLonBoundingBox:function(e,t){e.llbbox=[parseFloat(t.getAttribute(\"minx\")),parseFloat(t.getAttribute(\"miny\")),parseFloat(t.getAttribute(\"maxx\")),parseFloat(t.getAttribute(\"maxy\"))]},read_wmc_LegendURL:function(e,t){var i={width:t.getAttribute(\"width\"),height:t.getAttribute(\"height\")},r=t.getElementsByTagName(\"OnlineResource\");r.length>0&&this.read_wmc_OnlineResource(i,r[0]),e.legend=i},write:function(e,t){var i=this.createElementDefaultNS(\"ViewContext\");return this.setAttributes(i,{version:this.VERSION,id:t&&\"string\"==typeof t.id?t.id:OpenLayers.Util.createUniqueID(\"OpenLayers_Context_\")}),this.setAttributeNS(i,this.namespaces.xsi,\"xsi:schemaLocation\",this.schemaLocation),i.appendChild(this.write_wmc_General(e)),i.appendChild(this.write_wmc_LayerList(e)),OpenLayers.Format.XML.prototype.write.apply(this,[i])},createElementDefaultNS:function(e,t,i){var r=this.createElementNS(this.namespaces[this.defaultPrefix],e);return t&&r.appendChild(this.createTextNode(t)),i&&this.setAttributes(r,i),r},setAttributes:function(e,t){var i;for(var r in t)i=t[r].toString(),i.match(/[A-Z]/)?this.setAttributeNS(e,null,r,i):e.setAttribute(r,i)},write_wmc_General:function(e){var t=this.createElementDefaultNS(\"General\");e.size&&t.appendChild(this.createElementDefaultNS(\"Window\",null,{width:e.size.w,height:e.size.h}));var i=e.bounds;return t.appendChild(this.createElementDefaultNS(\"BoundingBox\",null,{minx:i.left.toPrecision(10),miny:i.bottom.toPrecision(10),maxx:i.right.toPrecision(10),maxy:i.top.toPrecision(10),SRS:e.projection})),t.appendChild(this.createElementDefaultNS(\"Title\",e.title)),t.appendChild(this.write_ol_MapExtension(e)),t},write_ol_MapExtension:function(e){var t=this.createElementDefaultNS(\"Extension\"),i=e.maxExtent;if(i){var r=this.createElementNS(this.namespaces.ol,\"ol:maxExtent\");this.setAttributes(r,{minx:i.left.toPrecision(10),miny:i.bottom.toPrecision(10),maxx:i.right.toPrecision(10),maxy:i.top.toPrecision(10)}),t.appendChild(r)}return t},write_wmc_LayerList:function(e){for(var t,i=this.createElementDefaultNS(\"LayerList\"),r=0,n=e.layers.length;r<n;++r)(t=e.layers[r])instanceof OpenLayers.Layer.WMS&&i.appendChild(this.write_wmc_Layer(t));return i},write_wmc_Layer:function(e){var t=this.createElementDefaultNS(\"Layer\",null,{queryable:e.queryable?\"1\":\"0\",hidden:e.visibility?\"0\":\"1\"});return t.appendChild(this.write_wmc_Server(e)),t.appendChild(this.createElementDefaultNS(\"Name\",e.params.LAYERS)),t.appendChild(this.createElementDefaultNS(\"Title\",e.name)),e.metadataURL&&t.appendChild(this.write_wmc_MetadataURL(e)),t.appendChild(this.write_wmc_FormatList(e)),t.appendChild(this.write_wmc_StyleList(e)),t.appendChild(this.write_wmc_LayerExtension(e)),t},write_wmc_LayerExtension:function(e){var t=this.createElementDefaultNS(\"Extension\"),i=e.maxExtent,r=this.createElementNS(this.namespaces.ol,\"ol:maxExtent\");this.setAttributes(r,{minx:i.left.toPrecision(10),miny:i.bottom.toPrecision(10),maxx:i.right.toPrecision(10),maxy:i.top.toPrecision(10)}),t.appendChild(r);var n=e.params.TRANSPARENT;if(n){var s=this.createElementNS(this.namespaces.ol,\"ol:transparent\");s.appendChild(this.createTextNode(n)),t.appendChild(s)}for(var a,o=[\"numZoomLevels\",\"units\",\"isBaseLayer\",\"opacity\",\"displayInLayerSwitcher\",\"singleTile\"],l=0,p=o.length;l<p;++l)(a=this.createOLPropertyNode(e,o[l]))&&t.appendChild(a);return t},createOLPropertyNode:function(e,t){var i=null;return null!=e[t]&&(i=this.createElementNS(this.namespaces.ol,\"ol:\"+t),i.appendChild(this.createTextNode(e[t].toString()))),i},write_wmc_Server:function(e){var t=this.createElementDefaultNS(\"Server\");return this.setAttributes(t,{service:\"OGC:WMS\",version:e.params.VERSION}),t.appendChild(this.write_wmc_OnlineResource(e.url)),t},write_wmc_MetadataURL:function(e){var t=this.createElementDefaultNS(\"MetadataURL\");return t.appendChild(this.write_wmc_OnlineResource(e.metadataURL)),t},write_wmc_FormatList:function(e){var t=this.createElementDefaultNS(\"FormatList\");return t.appendChild(this.createElementDefaultNS(\"Format\",e.params.FORMAT,{current:\"1\"})),t},write_wmc_StyleList:function(e){var t=this.createElementDefaultNS(\"StyleList\"),i=this.createElementDefaultNS(\"Style\",null,{current:\"1\"});if(e.params.SLD){var r=this.createElementDefaultNS(\"SLD\"),n=this.write_wmc_OnlineResource(e.params.SLD);r.appendChild(n),i.appendChild(r)}else if(e.params.SLD_BODY){var r=this.createElementDefaultNS(\"SLD\"),s=e.params.SLD_BODY,a=OpenLayers.Format.XML.prototype.read.apply(this,[s]),o=a.documentElement;r.ownerDocument&&r.ownerDocument.importNode&&(o=r.ownerDocument.importNode(o,!0)),r.appendChild(o),i.appendChild(r)}else{var l=e.params.STYLES?e.params.STYLES:this.defaultStyleName;i.appendChild(this.createElementDefaultNS(\"Name\",l)),i.appendChild(this.createElementDefaultNS(\"Title\",this.defaultStyleTitle))}return t.appendChild(i),t},write_wmc_OnlineResource:function(e){\nvar t=this.createElementDefaultNS(\"OnlineResource\");return this.setAttributeNS(t,this.namespaces.xlink,\"xlink:type\",\"simple\"),this.setAttributeNS(t,this.namespaces.xlink,\"xlink:href\",e),t},CLASS_NAME:\"OpenLayers.Format.WMC.v1\"}),OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:\"1.1.0\",initialize:function(e){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[e])},CLASS_NAME:\"OpenLayers.Format.WMSCapabilities.v1_1_0\"}),OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:\"1.1.1\",initialize:function(e){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[e])},CLASS_NAME:\"OpenLayers.Format.WMSCapabilities.v1_1_1\"}),OpenLayers.Format.WMSDescribeLayer.v1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(e){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[e])},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var t=e.documentElement,i=t.childNodes,r=[],n=0;n<i.length;++n)if(childNode=i[n],nodeName=childNode.nodeName,\"LayerDescription\"==nodeName){var s=\"\",a=\"\",o=\"\";childNode.getAttribute(\"owsType\")?(s=childNode.getAttribute(\"owsType\"),a=childNode.getAttribute(\"owsURL\")):\"\"!=childNode.getAttribute(\"wfs\")?(s=\"WFS\",a=childNode.getAttribute(\"wfs\")):\"\"!=childNode.getAttribute(\"wcs\")&&(s=\"WCS\",a=childNode.getAttribute(\"wcs\")),query=childNode.getElementsByTagName(\"Query\"),query.length>0&&((o=query[0].getAttribute(\"typeName\"))||(o=query[0].getAttribute(\"typename\"))),r.push({owsType:s,owsURL:a,typeName:o})}return r},CLASS_NAME:\"OpenLayers.Format.WMSDescribeLayer.v1_1\"}),OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:\"olHandlerBoxZoomBox\",boxCharacteristics:null,initialize:function(e,t,i){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var t={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,t,{keyMask:this.keyMask})},setMap:function(e){OpenLayers.Handler.prototype.setMap.apply(this,arguments),this.dragHandler&&this.dragHandler.setMap(e)},startBox:function(e){this.zoomBox=OpenLayers.Util.createDiv(\"zoomBox\",this.dragHandler.start),this.zoomBox.className=this.boxDivClassName,this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.viewPortDiv.appendChild(this.zoomBox),OpenLayers.Element.addClass(this.map.viewPortDiv,\"olDrawBox\")},moveBox:function(e){var t=this.dragHandler.start.x,i=this.dragHandler.start.y,r=Math.abs(t-e.x),n=Math.abs(i-e.y);this.zoomBox.style.width=Math.max(1,r)+\"px\",this.zoomBox.style.height=Math.max(1,n)+\"px\",this.zoomBox.style.left=e.x<t?e.x+\"px\":t+\"px\",this.zoomBox.style.top=e.y<i?e.y+\"px\":i+\"px\";var s=this.getBoxCharacteristics();s.newBoxModel&&(e.x>t&&(this.zoomBox.style.width=Math.max(1,r-s.xOffset)+\"px\"),e.y>i&&(this.zoomBox.style.height=Math.max(1,n-s.yOffset)+\"px\"))},endBox:function(e){var t;if(Math.abs(this.dragHandler.start.x-e.x)>5||Math.abs(this.dragHandler.start.y-e.y)>5){var i=this.dragHandler.start,r=Math.min(i.y,e.y),n=Math.max(i.y,e.y),s=Math.min(i.x,e.x),a=Math.max(i.x,e.x);t=new OpenLayers.Bounds(s,n,a,r)}else t=this.dragHandler.start.clone();this.removeBox(),this.callback(\"done\",[t])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox),this.zoomBox=null,this.boxCharacteristics=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,\"olDrawBox\")},activate:function(){return!!OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.dragHandler.activate(),!0)},deactivate:function(){return!!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.dragHandler.deactivate(),!0)},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var e=parseInt(OpenLayers.Element.getStyle(this.zoomBox,\"border-left-width\"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,\"border-right-width\"))+1,t=parseInt(OpenLayers.Element.getStyle(this.zoomBox,\"border-top-width\"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,\"border-bottom-width\"))+1,i=\"msie\"!=OpenLayers.Util.getBrowserName()||\"BackCompat\"!=document.compatMode;this.boxCharacteristics={xOffset:e,yOffset:t,newBoxModel:i}}return this.boxCharacteristics},CLASS_NAME:\"OpenLayers.Handler.Box\"}),OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:\"shiftKey\",persist:!1,irregular:!1,angle:null,fixedRadius:!1,feature:null,layer:null,origin:null,initialize:function(e,t,i){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.default,{}),OpenLayers.Handler.prototype.initialize.apply(this,[e,t,i]),this.options=i?i:new Object},setOptions:function(e){OpenLayers.Util.extend(this.options,e),OpenLayers.Util.extend(this,e)},activate:function(){var e=!1;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var t={displayInLayerSwitcher:!1,calculateInRange:function(){return!0}};this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,t),this.map.addLayer(this.layer),e=!0}return e},deactivate:function(){var e=!1;return OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)&&(this.dragging&&this.cancel(),null!=this.layer.map&&(this.layer.destroy(!1),this.feature&&this.feature.destroy()),this.layer=null,this.feature=null,e=!0),e},down:function(e){this.fixedRadius=!!this.radius;var t=this.map.getLonLatFromPixel(e.xy);this.origin=new OpenLayers.Geometry.Point(t.lon,t.lat),this.fixedRadius&&!this.irregular||(this.radius=this.map.getResolution()),this.persist&&this.clear(),this.feature=new OpenLayers.Feature.Vector,this.createGeometry(),this.callback(\"create\",[this.origin,this.feature]),this.layer.addFeatures([this.feature],{silent:!0}),this.layer.drawFeature(this.feature,this.style)},move:function(e){var t=this.map.getLonLatFromPixel(e.xy),i=new OpenLayers.Geometry.Point(t.lon,t.lat);if(this.irregular){var r=Math.sqrt(2)*Math.abs(i.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,r)}else this.fixedRadius?this.origin=i:(this.calculateAngle(i,e),this.radius=Math.max(this.map.getResolution()/2,i.distanceTo(this.origin)));if(this.modifyGeometry(),this.irregular){var n,s=i.x-this.origin.x,a=i.y-this.origin.y;n=0==a?s/(this.radius*Math.sqrt(2)):s/a,this.feature.geometry.resize(1,this.origin,n),this.feature.geometry.move(s/2,a/2)}this.layer.drawFeature(this.feature,this.style)},up:function(e){this.finalize(),this.start==this.last&&this.callback(\"done\",[e.xy])},out:function(e){this.finalize()},createGeometry:function(){this.angle=Math.PI*(1/this.sides-.5),this.snapAngle&&(this.angle+=this.snapAngle*(Math.PI/180)),this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var e,t,i=this.feature.geometry.components[0];i.components.length!=this.sides+1&&(this.createGeometry(),i=this.feature.geometry.components[0]);for(var r=0;r<this.sides;++r)t=i.components[r],e=this.angle+2*r*Math.PI/this.sides,t.x=this.origin.x+this.radius*Math.cos(e),t.y=this.origin.y+this.radius*Math.sin(e),t.clearBounds()},calculateAngle:function(e,t){var i=Math.atan2(e.y-this.origin.y,e.x-this.origin.x);if(this.snapAngle&&this.snapToggle&&!t[this.snapToggle]){var r=Math.PI/180*this.snapAngle;this.angle=Math.round(i/r)*r}else this.angle=i},cancel:function(){this.callback(\"cancel\",null),this.finalize()},finalize:function(){this.origin=null,this.radius=this.options.radius},clear:function(){this.layer.renderer.clear(),this.layer.destroyFeatures()},callback:function(e,t){this.callbacks[e]&&this.callbacks[e].apply(this.control,[this.feature.geometry.clone()]),this.persist||\"done\"!=e&&\"cancel\"!=e||this.clear()},CLASS_NAME:\"OpenLayers.Handler.RegularPolygon\"}),OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:!0,isBaseLayer:!0,isFixed:!0,pane:null,mapObject:null,initialize:function(e,t){OpenLayers.Layer.prototype.initialize.apply(this,arguments),null==this.pane&&(this.pane=OpenLayers.Util.createDiv(this.div.id+\"_EventPane\"))},destroy:function(){this.mapObject=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Layer.prototype.setMap.apply(this,arguments),this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1,this.pane.style.display=this.div.style.display,this.pane.style.width=\"100%\",this.pane.style.height=\"100%\",\"msie\"==OpenLayers.Util.getBrowserName()&&(this.pane.style.background=\"url(\"+OpenLayers.Util.getImagesLocation()+\"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(e){this.pane&&this.pane.parentNode&&(this.pane.parentNode.removeChild(this.pane),this.pane=null),OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor=\"darkblue\";var e=this.map.getSize(),t=Math.min(e.w,300),i=Math.min(e.h,200),r=new OpenLayers.Size(t,i),n=new OpenLayers.Pixel(e.w/2,e.h/2),s=n.add(-r.w/2,-r.h/2),a=OpenLayers.Util.createDiv(this.name+\"_warning\",s,r,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(e){OpenLayers.Layer.prototype.display.apply(this,arguments),this.pane.style.display=this.div.style.display},setZIndex:function(e){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments),this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveTo:function(e,t,i){if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),null!=this.mapObject){var r=this.map.getCenter(),n=this.map.getZoom();if(null!=r){var s=this.getMapObjectCenter(),a=this.getOLLonLatFromMapObjectLonLat(s),o=this.getMapObjectZoom(),l=this.getOLZoomFromMapObjectZoom(o);if(!r.equals(a)||n!=l)if(i&&this.dragPanMapObject&&this.smoothDragPan){var p=this.map.getViewPortPxFromLonLat(a),h=this.map.getViewPortPxFromLonLat(r);this.dragPanMapObject(h.x-p.x,p.y-h.y)}else{var u=this.getMapObjectLonLatFromOLLonLat(r),y=this.getMapObjectZoomFromOLZoom(n);this.setMapObjectCenter(u,y,i)}}}},getLonLatFromViewPortPx:function(e){var t=null;if(null!=this.mapObject&&null!=this.getMapObjectCenter()){var i=this.getMapObjectPixelFromOLPixel(e),r=this.getMapObjectLonLatFromMapObjectPixel(i);t=this.getOLLonLatFromMapObjectLonLat(r)}return t},getViewPortPxFromLonLat:function(e){var t=null;if(null!=this.mapObject&&null!=this.getMapObjectCenter()){var i=this.getMapObjectLonLatFromOLLonLat(e),r=this.getMapObjectPixelFromMapObjectLonLat(i);t=this.getOLPixelFromMapObjectPixel(r)}return t},getOLLonLatFromMapObjectLonLat:function(e){var t=null;if(null!=e){var i=this.getLongitudeFromMapObjectLonLat(e),r=this.getLatitudeFromMapObjectLonLat(e);t=new OpenLayers.LonLat(i,r)}return t},getMapObjectLonLatFromOLLonLat:function(e){var t=null;return null!=e&&(t=this.getMapObjectLonLatFromLonLat(e.lon,e.lat)),t},getOLPixelFromMapObjectPixel:function(e){var t=null;if(null!=e){var i=this.getXFromMapObjectPixel(e),r=this.getYFromMapObjectPixel(e);t=new OpenLayers.Pixel(i,r)}return t},getMapObjectPixelFromOLPixel:function(e){var t=null;return null!=e&&(t=this.getMapObjectPixelFromXY(e.x,e.y)),t},CLASS_NAME:\"OpenLayers.Layer.EventPane\"}),OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){for(var e=new Array(\"minZoomLevel\",\"maxZoomLevel\",\"numZoomLevels\"),t=0,i=e.length;t<i;t++){var r=e[t];this[r]=null!=this.options[r]?this.options[r]:this.map[r]}(null==this.minZoomLevel||this.minZoomLevel<this.MIN_ZOOM_LEVEL)&&(this.minZoomLevel=this.MIN_ZOOM_LEVEL);var n,s=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(n=null==this.options.numZoomLevels&&null!=this.options.maxZoomLevel||null==this.numZoomLevels&&null!=this.maxZoomLevel?this.maxZoomLevel-this.minZoomLevel+1:this.numZoomLevels,this.numZoomLevels=null!=n?Math.min(n,s):s,this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1,null!=this.RESOLUTIONS){var a=0;this.resolutions=[];for(var t=this.minZoomLevel;t<=this.maxZoomLevel;t++)this.resolutions[a++]=this.RESOLUTIONS[t];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 e=null,t=this.map.getSize(),i=this.getExtent();return null!=t&&null!=i&&(e=Math.max(i.getWidth()/t.w,i.getHeight()/t.h)),e},getExtent:function(){var e=null,t=this.map.getSize(),i=new OpenLayers.Pixel(0,0),r=this.getLonLatFromViewPortPx(i),n=new OpenLayers.Pixel(t.w,t.h),s=this.getLonLatFromViewPortPx(n);return null!=r&&null!=s&&(e=new OpenLayers.Bounds(r.lon,s.lat,s.lon,r.lat)),e},getZoomForResolution:function(e){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);var t=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(t)},getOLZoomFromMapObjectZoom:function(e){var t=null;return null!=e&&(t=e-this.minZoomLevel),t},getMapObjectZoomFromOLZoom:function(e){var t=null;return null!=e&&(t=e+this.minZoomLevel),t},CLASS_NAME:\"OpenLayers.Layer.FixedZoomLevels\"}),OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:!1,initialize:function(e,t,i,r){var n=arguments;n=[e,r],OpenLayers.Layer.prototype.initialize.apply(this,n),this.url=t,this.params=OpenLayers.Util.extend({},i)},destroy:function(){this.url=null,this.params=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.prototype.clone.apply(this,[e])},setUrl:function(e){this.url=e},mergeNewParams:function(e){return this.params=OpenLayers.Util.extend(this.params,e),this.redraw()},redraw:function(e){return e?this.mergeNewParams({_olSalt:Math.random()}):OpenLayers.Layer.prototype.redraw.apply(this,[])},selectUrl:function(e,t){for(var i=1,r=0,n=e.length;r<n;r++)i*=e.charCodeAt(r)*this.URL_HASH_FACTOR,i-=Math.floor(i);return t[Math.floor(i*t.length)]},getFullRequestString:function(e,t){var i=t||this.url,r=OpenLayers.Util.extend({},this.params);r=OpenLayers.Util.extend(r,e);var n=OpenLayers.Util.getParameterString(r);i instanceof Array&&(i=this.selectUrl(n,i));var s=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(i));for(var a in r)a.toUpperCase()in s&&delete r[a];n=OpenLayers.Util.getParameterString(r);var o=i;if(\"\"!=n){var l=i.charAt(i.length-1);o+=\"&\"==l||\"?\"==l?n:i.indexOf(\"?\")==-1?\"?\"+n:\"&\"+n}return o},CLASS_NAME:\"OpenLayers.Layer.HTTPRequest\"}),OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!0,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(e,t,i,r,n){this.url=t,this.extent=i,this.maxExtent=i,this.size=r,OpenLayers.Layer.prototype.initialize.apply(this,[e,n]),this.aspectRatio=this.extent.getHeight()/this.size.h/(this.extent.getWidth()/this.size.w)},destroy:function(){this.tile&&(this.removeTileMonitoringHooks(this.tile),this.tile.destroy(),this.tile=null),OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.options)),e=OpenLayers.Layer.prototype.clone.apply(this,[e])},setMap:function(e){null==this.options.maxResolution&&(this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w),OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(e,t,i){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var r=null==this.tile;if(t||r){this.setTileSize();var n=new OpenLayers.LonLat(this.extent.left,this.extent.top),s=this.map.getLayerPxFromLonLat(n);r?(this.tile=new OpenLayers.Tile.Image(this,s,this.extent,null,this.tileSize),this.addTileMonitoringHooks(this.tile)):(this.tile.size=this.tileSize.clone(),this.tile.position=s.clone()),this.tile.draw()}},setTileSize:function(){var e=this.extent.getWidth()/this.map.getResolution(),t=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(e,t)},addTileMonitoringHooks:function(e){e.onLoadStart=function(){this.events.triggerEvent(\"loadstart\")},e.events.register(\"loadstart\",this,e.onLoadStart),e.onLoadEnd=function(){this.events.triggerEvent(\"loadend\")},e.events.register(\"loadend\",this,e.onLoadEnd),e.events.register(\"unload\",this,e.onLoadEnd)},removeTileMonitoringHooks:function(e){e.unload(),e.events.un({loadstart:e.onLoadStart,loadend:e.onLoadEnd,unload:e.onLoadEnd,scope:this})},setUrl:function(e){this.url=e,this.tile.draw()},getURL:function(e){return this.url},CLASS_NAME:\"OpenLayers.Layer.Image\"}),OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,markers:null,drawn:!1,initialize:function(e,t){OpenLayers.Layer.prototype.initialize.apply(this,arguments),this.markers=[]},destroy:function(){this.clearMarkers(),this.markers=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(e){if(e!=this.opacity){this.opacity=e;for(var t=0,i=this.markers.length;t<i;t++)this.markers[t].setOpacity(this.opacity)}},moveTo:function(e,t,i){if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),t||!this.drawn){for(var r=0,n=this.markers.length;r<n;r++)this.drawMarker(this.markers[r]);this.drawn=!0}},addMarker:function(e){this.markers.push(e),null!=this.opacity&&e.setOpacity(this.opacity),this.map&&this.map.getExtent()&&(e.map=this.map,this.drawMarker(e))},removeMarker:function(e){this.markers&&this.markers.length&&(OpenLayers.Util.removeItem(this.markers,e),e.erase())},clearMarkers:function(){if(null!=this.markers)for(;this.markers.length>0;)this.removeMarker(this.markers[0])},drawMarker:function(e){var t=this.map.getLayerPxFromLonLat(e.lonlat);if(null==t)e.display(!1);else if(e.isDrawn())e.icon&&e.icon.moveTo(t);else{var i=e.draw(t);this.div.appendChild(i)}},getDataExtent:function(){var e=null;if(this.markers&&this.markers.length>0)for(var e=new OpenLayers.Bounds,t=0,i=this.markers.length;t<i;t++){var r=this.markers[t];e.extend(r.lonlat)}return e},CLASS_NAME:\"OpenLayers.Layer.Markers\"}),OpenLayers.Layer.SphericalMercator={getExtent:function(){return this.sphericalMercator?this.map.calculateBounds():OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)},initMercatorParameters:function(){this.RESOLUTIONS=[];for(var e=0;e<=this.MAX_ZOOM_LEVEL;++e)this.RESOLUTIONS[e]=156543.0339/Math.pow(2,e);this.units=\"m\",this.projection=\"EPSG:900913\"},forwardMercator:function(e,t){var i=20037508.34*e/180,r=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return r=20037508.34*r/180,new OpenLayers.LonLat(i,r)},inverseMercator:function(e,t){var i=e/20037508.34*180,r=t/20037508.34*180;return r=180/Math.PI*(2*Math.atan(Math.exp(r*Math.PI/180))-Math.PI/2),new OpenLayers.LonLat(i,r)},projectForward:function(e){var t=OpenLayers.Layer.SphericalMercator.forwardMercator(e.x,e.y);return e.x=t.lon,e.y=t.lat,e},projectInverse:function(e){var t=OpenLayers.Layer.SphericalMercator.inverseMercator(e.x,e.y);return e.x=t.lon,e.y=t.lat,e}},OpenLayers.Projection.addTransform(\"EPSG:4326\",\"EPSG:900913\",OpenLayers.Layer.SphericalMercator.projectForward),OpenLayers.Projection.addTransform(\"EPSG:900913\",\"EPSG:4326\",OpenLayers.Layer.SphericalMercator.projectInverse),OpenLayers.Tile.WFS=OpenLayers.Class(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(e,t,i,r,n){OpenLayers.Tile.prototype.initialize.apply(this,arguments),this.url=r,this.features=[]},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(this,arguments),this.destroyAllFeatures(),this.features=null,this.url=null,this.request&&(this.request.abort(),this.request=null)},clear:function(){this.destroyAllFeatures()},draw:function(){OpenLayers.Tile.prototype.draw.apply(this,arguments)&&(this.isLoading?this.events.triggerEvent(\"reload\"):(this.isLoading=!0,this.events.triggerEvent(\"loadstart\")),this.loadFeaturesForRegion(this.requestSuccess))},loadFeaturesForRegion:function(e,t){this.request&&this.request.abort(),this.request=OpenLayers.Request.GET({url:this.url,success:e,failure:t,scope:this})},requestSuccess:function(e){if(this.features){var t=e.responseXML;if(t&&t.documentElement||(t=e.responseText),this.layer.vectorMode)this.layer.addFeatures(this.layer.formatObject.read(t));else{var i=new OpenLayers.Format.XML;\"string\"==typeof t&&(t=i.read(t));var r=i.getElementsByTagNameNS(t,\"http://www.opengis.net/gml\",\"featureMember\");this.addResults(r)}}this.events&&this.events.triggerEvent(\"loadend\"),this.request=null},addResults:function(e){for(var t=0;t<e.length;t++){var i=new this.layer.featureClass(this.layer,e[t]);this.features.push(i)}},destroyAllFeatures:function(){for(;this.features.length>0;){this.features.shift().destroy()}},CLASS_NAME:\"OpenLayers.Tile.WFS\"}),OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:[\"featureadded\"],featureAdded:function(){},handlerOptions:null,initialize:function(e,t,i){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES),OpenLayers.Control.prototype.initialize.apply(this,[i]),this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(e,t){this.layer.events.triggerEvent(\"sketchmodified\",{vertex:e,feature:t})},create:function(e,t){this.layer.events.triggerEvent(\"sketchstarted\",{vertex:e,feature:t})}},this.callbacks),this.layer=e;var r=this.layer.styleMap&&this.layer.styleMap.styles.temporary;r&&(this.handlerOptions=this.handlerOptions||{},this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({default:r})})),this.handler=new t(this,this.callbacks,this.handlerOptions)},drawFeature:function(e){var t=new OpenLayers.Feature.Vector(e);this.layer.events.triggerEvent(\"sketchcomplete\",{feature:t})!==!1&&(t.state=OpenLayers.State.INSERT,this.layer.addFeatures([t]),this.featureAdded(t),this.events.triggerEvent(\"featureadded\",{feature:t}))},CLASS_NAME:\"OpenLayers.Control.DrawFeature\"}),OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:[\"measure\",\"measurepartial\"],handlerOptions:null,callbacks:null,displaySystem:\"metric\",geodesic:!1,displaySystemUnits:{geographic:[\"dd\"],english:[\"mi\",\"ft\",\"in\"],metric:[\"km\",\"m\"]},partialDelay:300,delayedTrigger:null,persist:!1,initialize:function(e,t){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES),OpenLayers.Control.prototype.initialize.apply(this,[t]),this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks),this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions),this.handler=new e(this,this.callbacks,this.handlerOptions)},cancel:function(){this.handler.cancel()},updateHandler:function(e,t){var i=this.active;i&&this.deactivate(),this.handler=new e(this,this.callbacks,t),i&&this.activate()},measureComplete:function(e){this.delayedTrigger&&window.clearTimeout(this.delayedTrigger),this.measure(e,\"measure\")},measurePartial:function(e,t){this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(t,\"measurepartial\")},this),this.partialDelay)},measure:function(e,t){var i,r;e.CLASS_NAME.indexOf(\"LineString\")>-1?(i=this.getBestLength(e),r=1):(i=this.getBestArea(e),r=2),this.events.triggerEvent(t,{measure:i[0],units:i[1],order:r,geometry:e})},getBestArea:function(e){for(var t,i,r=this.displaySystemUnits[this.displaySystem],n=0,s=r.length;n<s&&(t=r[n],!((i=this.getArea(e,t))>1));++n);return[i,t]},getArea:function(e,t){var i,r;this.geodesic?(i=e.getGeodesicArea(this.map.getProjectionObject()),r=\"m\"):(i=e.getArea(),r=this.map.getUnits());var n=OpenLayers.INCHES_PER_UNIT[t];if(n){var s=OpenLayers.INCHES_PER_UNIT[r];i*=Math.pow(s/n,2)}return i},getBestLength:function(e){for(var t,i,r=this.displaySystemUnits[this.displaySystem],n=0,s=r.length;n<s&&(t=r[n],!((i=this.getLength(e,t))>1));++n);return[i,t]},getLength:function(e,t){var i,r;this.geodesic?(i=e.getGeodesicLength(this.map.getProjectionObject()),r=\"m\"):(i=e.getLength(),r=this.map.getUnits());var n=OpenLayers.INCHES_PER_UNIT[t];if(n){i*=OpenLayers.INCHES_PER_UNIT[r]/n}return i},CLASS_NAME:\"OpenLayers.Control.Measure\"}),OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:!1,alwaysZoom:!1,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(e){if(e instanceof OpenLayers.Bounds){if(this.out)var t=Math.abs(e.right-e.left),i=Math.abs(e.top-e.bottom),r=Math.min(this.map.size.h/i,this.map.size.w/t),n=this.map.getExtent(),s=this.map.getLonLatFromPixel(e.getCenterPixel()),a=s.lon-n.getWidth()/2*r,o=s.lon+n.getWidth()/2*r,l=s.lat-n.getHeight()/2*r,p=s.lat+n.getHeight()/2*r,h=new OpenLayers.Bounds(a,l,o,p);else var u=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.left,e.bottom)),y=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.right,e.top)),h=new OpenLayers.Bounds(u.lon,u.lat,y.lon,y.lat);var c=this.map.getZoom();this.map.zoomToExtent(h),c==this.map.getZoom()&&1==this.alwaysZoom&&this.map.zoomTo(c+(this.out?-1:1))}else this.out?this.map.setCenter(this.map.getLonLatFromPixel(e),this.map.getZoom()-1):this.map.setCenter(this.map.getLonLatFromPixel(e),this.map.getZoom()+1)},CLASS_NAME:\"OpenLayers.Control.ZoomBox\"}),OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(e){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[e])},CLASS_NAME:\"OpenLayers.Format.WFSCapabilities.v1_0_0\"}),OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(e){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[e])},CLASS_NAME:\"OpenLayers.Format.WFSCapabilities.v1_1_0\"}),OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(e){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,[e])},read:function(e){var t,i,r,n=this.regExes.typeStr.exec(e);if(n&&(i=n[1].toLowerCase(),r=n[2],this.parse[i]&&(t=this.parse[i].apply(this,[r])),this.internalProjection&&this.externalProjection))if(t&&\"OpenLayers.Feature.Vector\"==t.CLASS_NAME)t.geometry.transform(this.externalProjection,this.internalProjection);else if(t&&\"geometrycollection\"!=i&&\"object\"==typeof t)for(var s=0,a=t.length;s<a;s++){var o=t[s];o.geometry.transform(this.externalProjection,this.internalProjection)}return t},write:function(e){var t,i,r,n,s;e.constructor==Array?(t=e,s=!0):(t=[e],s=!1);var a=[];s&&a.push(\"GEOMETRYCOLLECTION(\");for(var o=0,l=t.length;o<l;++o){if(s&&o>0&&a.push(\",\"),i=t[o].geometry,r=i.CLASS_NAME.split(\".\")[2].toLowerCase(),!this.extract[r])return null;this.internalProjection&&this.externalProjection&&(i=i.clone(),i.transform(this.internalProjection,this.externalProjection)),n=this.extract[r].apply(this,[i]),a.push(r.toUpperCase()+\"(\"+n+\")\")}return s&&a.push(\")\"),a.join(\"\")},extract:{point:function(e){return e.x+\" \"+e.y},multipoint:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t.join(\",\")},linestring:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t.join(\",\")},multilinestring:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(\"(\"+this.extract.linestring.apply(this,[e.components[i]])+\")\");return t.join(\",\")},polygon:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(\"(\"+this.extract.linestring.apply(this,[e.components[i]])+\")\");return t.join(\",\")},multipolygon:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(\"(\"+this.extract.polygon.apply(this,[e.components[i]])+\")\");return t.join(\",\")}},parse:{point:function(e){var t=OpenLayers.String.trim(e).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t[0],t[1]))},multipoint:function(e){for(var t=OpenLayers.String.trim(e).split(\",\"),i=[],r=0,n=t.length;r<n;++r)i.push(this.parse.point.apply(this,[t[r]]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(i))},linestring:function(e){for(var t=OpenLayers.String.trim(e).split(\",\"),i=[],r=0,n=t.length;r<n;++r)i.push(this.parse.point.apply(this,[t[r]]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(i))},multilinestring:function(e){for(var t,i=OpenLayers.String.trim(e).split(this.regExes.parenComma),r=[],n=0,s=i.length;n<s;++n)t=i[n].replace(this.regExes.trimParens,\"$1\"),r.push(this.parse.linestring.apply(this,[t]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(r))},polygon:function(e){for(var t,i,r,n=OpenLayers.String.trim(e).split(this.regExes.parenComma),s=[],a=0,o=n.length;a<o;++a)t=n[a].replace(this.regExes.trimParens,\"$1\"),i=this.parse.linestring.apply(this,[t]).geometry,r=new OpenLayers.Geometry.LinearRing(i.components),s.push(r);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(s))},multipolygon:function(e){for(var t,i=OpenLayers.String.trim(e).split(this.regExes.doubleParenComma),r=[],n=0,s=i.length;n<s;++n)t=i[n].replace(this.regExes.trimParens,\"$1\"),r.push(this.parse.polygon.apply(this,[t]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(r))},geometrycollection:function(e){e=e.replace(/,\\s*([A-Za-z])/g,\"|$1\");for(var t=OpenLayers.String.trim(e).split(\"|\"),i=[],r=0,n=t.length;r<n;++r)i.push(OpenLayers.Format.WKT.prototype.read.apply(this,[t[r]]));return i}},CLASS_NAME:\"OpenLayers.Format.WKT\"}),OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:\"1.0.0\",schemaLocation:\"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd\",initialize:function(e){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[e])},CLASS_NAME:\"OpenLayers.Format.WMC.v1_0_0\"}),OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:\"1.1.0\",schemaLocation:\"http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd\",initialize:function(e){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[e])},read_sld_MinScaleDenominator:function(e,t){e.options.maxScale=this.getChildValue(t)},read_sld_MaxScaleDenominator:function(e,t){e.options.minScale=this.getChildValue(t)},write_wmc_Layer:function(e){var t=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[e]);if(e.options.resolutions||e.options.scales||e.options.minResolution||e.options.maxScale){var i=this.createElementNS(this.namespaces.sld,\"sld:MinScaleDenominator\");i.appendChild(this.createTextNode(e.maxScale.toPrecision(10))),t.insertBefore(i,t.childNodes[3])}if(e.options.resolutions||e.options.scales||e.options.maxResolution||e.options.minScale){var r=this.createElementNS(this.namespaces.sld,\"sld:MaxScaleDenominator\");r.appendChild(this.createTextNode(e.minScale.toPrecision(10))),t.insertBefore(r,t.childNodes[4])}return t},CLASS_NAME:\"OpenLayers.Format.WMC.v1_1_0\"}),OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(e,t){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(e){var t=e.bounds,i=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(t.left,t.top)),r=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(t.right,t.bottom));if(null==r||null==i)e.display(!1);else{var n=new OpenLayers.Size(Math.max(1,r.x-i.x),Math.max(1,r.y-i.y)),s=e.draw(i,n)\n;e.drawn||(this.div.appendChild(s),e.drawn=!0)}},removeMarker:function(e){OpenLayers.Util.removeItem(this.markers,e),null!=e.div&&e.div.parentNode==this.div&&this.div.removeChild(e.div)},CLASS_NAME:\"OpenLayers.Layer.Boxes\"}),OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:!0,initialize:function(e,t,i){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[e,i]),this.location=t,this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments),this.clearFeatures(),this.features=null},loadRSS:function(){this.loaded||(this.events.triggerEvent(\"loadstart\"),OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this}),this.loaded=!0)},moveTo:function(e,t,i){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),this.visibility&&!this.loaded&&this.loadRSS()},parseData:function(e){var t=e.responseXML;if(t&&t.documentElement||(t=OpenLayers.Format.XML.prototype.read(e.responseText)),this.useFeedTitle){var i=null;try{i=t.getElementsByTagNameNS(\"*\",\"title\")[0].firstChild.nodeValue}catch(e){i=t.getElementsByTagName(\"title\")[0].firstChild.nodeValue}i&&this.setName(i)}var r={};OpenLayers.Util.extend(r,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(r.externalProjection=this.projection,r.internalProjection=this.map.getProjectionObject());for(var n=new OpenLayers.Format.GeoRSS(r),s=n.read(t),a=0,o=s.length;a<o;a++){var l={},p=s[a];if(p.geometry){var h=p.attributes.title?p.attributes.title:\"Untitled\",u=p.attributes.description?p.attributes.description:\"No description.\",y=p.attributes.link?p.attributes.link:\"\",c=p.geometry.getBounds().getCenterLonLat();if(l.icon=null==this.icon?OpenLayers.Marker.defaultIcon():this.icon.clone(),l.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120),h||u){l.title=h,l.description=u;var d='<div class=\"olLayerGeoRSSClose\">[x]</div>';d+='<div class=\"olLayerGeoRSSTitle\">',y&&(d+='<a class=\"link\" href=\"'+y+'\" target=\"_blank\">'),d+=h,y&&(d+=\"</a>\"),d+=\"</div>\",d+='<div style=\"\" class=\"olLayerGeoRSSDescription\">',d+=u,d+=\"</div>\",l.popupContentHTML=d}var p=new OpenLayers.Feature(this,c,l);this.features.push(p);var m=p.createMarker();m.events.register(\"click\",p,this.markerClick),this.addMarker(m)}}this.events.triggerEvent(\"loadend\")},markerClick:function(e){var t=this==this.layer.selectedFeature;this.layer.selectedFeature=t?null:this;for(var i=0,r=this.layer.map.popups.length;i<r;i++)this.layer.map.removePopup(this.layer.map.popups[i]);if(!t){var n=this.createPopup();OpenLayers.Event.observe(n.div,\"click\",OpenLayers.Function.bind(function(){for(var e=0,t=this.layer.map.popups.length;e<t;e++)this.layer.map.removePopup(this.layer.map.popups[e])},this)),this.layer.map.addPopup(n)}OpenLayers.Event.stop(e)},clearFeatures:function(){if(null!=this.features)for(;this.features.length>0;){var e=this.features[0];OpenLayers.Util.removeItem(this.features,e),e.destroy()}},CLASS_NAME:\"OpenLayers.Layer.GeoRSS\"}),OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,2145767211914062e-20,1072883605957031e-20,536441802978515e-20,268220901489257e-20],type:null,sphericalMercator:!1,dragObject:null,termsOfUse:null,poweredBy:null,initialize:function(e,t){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments),OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments),this.addContainerPxFunction(),this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},loadMapObject:function(){try{this.mapObject=new GMap2(this.div),\"function\"==typeof this.mapObject.getDragObject?this.dragObject=this.mapObject.getDragObject():this.dragPanMapObject=null,this.termsOfUse=this.div.lastChild,this.div.removeChild(this.termsOfUse),this.isFixed?this.map.viewPortDiv.appendChild(this.termsOfUse):this.map.layerContainerDiv.appendChild(this.termsOfUse),this.termsOfUse.style.zIndex=\"1100\",this.termsOfUse.style.display=this.div.style.display,this.termsOfUse.style.right=\"\",this.termsOfUse.style.bottom=\"\",this.termsOfUse.className=\"olLayerGoogleCopyright\",this.poweredBy=this.div.lastChild,this.div.removeChild(this.poweredBy),this.isFixed?this.map.viewPortDiv.appendChild(this.poweredBy):this.map.layerContainerDiv.appendChild(this.poweredBy),this.poweredBy.style.zIndex=\"1100\",this.poweredBy.style.display=this.div.style.display,this.poweredBy.style.right=\"\",this.poweredBy.style.bottom=\"\",this.poweredBy.className=\"olLayerGooglePoweredBy gmnoprint\"}catch(e){OpenLayers.Console.error(e)}},setMap:function(e){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments),null!=this.type&&this.map.events.register(\"moveend\",this,this.setMapType)},setMapType:function(){null!=this.mapObject.getCenter()&&(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1&&this.mapObject.addMapType(this.type),this.mapObject.setMapType(this.type),this.map.events.unregister(\"moveend\",this,this.setMapType))},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded())this.mapObject.checkResize();else{if(!this._resized)var e=this,t=GEvent.addListener(this.mapObject,\"load\",function(){GEvent.removeListener(t),delete e._resized,e.mapObject.checkResize(),e.moveTo(e.map.getCenter(),e.map.getZoom())});this._resized=!0}},display:function(e){OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments),this.termsOfUse.style.display=this.div.style.display,this.poweredBy.style.display=this.div.style.display},removeMap:function(e){this.termsOfUse&&this.termsOfUse.parentNode&&(this.termsOfUse.parentNode.removeChild(this.termsOfUse),this.termsOfUse=null),this.poweredBy&&this.poweredBy.parentNode&&(this.poweredBy.parentNode.removeChild(this.poweredBy),this.poweredBy=null),OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(e){var t=null;if(null!=e){var i=e.getSouthWest(),r=e.getNorthEast();this.sphericalMercator?(i=this.forwardMercator(i.lng(),i.lat()),r=this.forwardMercator(r.lng(),r.lat())):(i=new OpenLayers.LonLat(i.lng(),i.lat()),r=new OpenLayers.LonLat(r.lng(),r.lat())),t=new OpenLayers.Bounds(i.lon,i.lat,r.lon,r.lat)}return t},getMapObjectBoundsFromOLBounds:function(e){var t=null;if(null!=e){var i=this.sphericalMercator?this.inverseMercator(e.bottom,e.left):new OpenLayers.LonLat(e.bottom,e.left),r=this.sphericalMercator?this.inverseMercator(e.top,e.right):new OpenLayers.LonLat(e.top,e.right);t=new GLatLngBounds(new GLatLng(i.lat,i.lon),new GLatLng(r.lat,r.lon))}return t},addContainerPxFunction:function(){\"undefined\"==typeof GMap2||GMap2.prototype.fromLatLngToContainerPixel||(GMap2.prototype.fromLatLngToContainerPixel=function(e){var t=this.fromLatLngToDivPixel(e),i=this.getContainer().firstChild.firstChild;return t.x+=i.offsetLeft,t.y+=i.offsetTop,t})},getWarningHTML:function(){return OpenLayers.i18n(\"googleWarning\")},setMapObjectCenter:function(e,t){this.mapObject.setCenter(e,t)},dragPanMapObject:function(e,t){this.dragObject.moveBy(new GSize(-e,t))},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getMapObjectLonLatFromMapObjectPixel:function(e){return this.mapObject.fromContainerPixelToLatLng(e)},getMapObjectPixelFromMapObjectLonLat:function(e){return this.mapObject.fromLatLngToContainerPixel(e)},getMapObjectZoomFromMapObjectBounds:function(e){return this.mapObject.getBoundsZoomLevel(e)},getLongitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.lng(),e.lat()).lon:e.lng()},getLatitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.lng(),e.lat()).lat:e.lat()},getMapObjectLonLatFromLonLat:function(e,t){var i;if(this.sphericalMercator){var r=this.inverseMercator(e,t);i=new GLatLng(r.lat,r.lon)}else i=new GLatLng(t,e);return i},getXFromMapObjectPixel:function(e){return e.x},getYFromMapObjectPixel:function(e){return e.y},getMapObjectPixelFromXY:function(e,t){return new GPoint(e,t)},CLASS_NAME:\"OpenLayers.Layer.Google\"}),OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:!1,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(e,t,i,r){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments),this.events.addEventType(\"tileloaded\"),this.grid=[]},destroy:function(){this.clearGrid(),this.grid=null,this.tileSize=null,OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var e=0,t=this.grid.length;e<t;e++)for(var i=this.grid[e],r=0,n=i.length;r<n;r++){var s=i[r];this.removeTileMonitoringHooks(s),s.destroy()}this.grid=[]}},clone:function(e){return null==e&&(e=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[e]),null!=this.tileSize&&(e.tileSize=this.tileSize.clone()),e.grid=[],e},moveTo:function(e,t,i){if(OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments),null!=(e=e||this.map.getExtent())){var r=!this.grid.length||t,n=this.getTilesBounds();this.singleTile?(r||!i&&!n.containsBounds(e))&&this.initSingleTile(e):r||!n.containsBounds(e,!0)?this.initGriddedTiles(e):this.moveGriddedTiles(e)}},setTileSize:function(e){this.singleTile&&(e=this.map.getSize().clone(),e.h=parseInt(e.h*this.ratio),e.w=parseInt(e.w*this.ratio)),OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[e])},getGridBounds:function(){return OpenLayers.Console.warn(\"The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.\"),this.getTilesBounds()},getTilesBounds:function(){var e=null;if(this.grid.length){var t=this.grid.length-1,i=this.grid[t][0],r=this.grid[0].length-1,n=this.grid[0][r];e=new OpenLayers.Bounds(i.bounds.left,i.bounds.bottom,n.bounds.right,n.bounds.top)}return e},initSingleTile:function(e){var t=e.getCenterLonLat(),i=e.getWidth()*this.ratio,r=e.getHeight()*this.ratio,n=new OpenLayers.Bounds(t.lon-i/2,t.lat-r/2,t.lon+i/2,t.lat+r/2),s=new OpenLayers.LonLat(n.left,n.top),a=this.map.getLayerPxFromLonLat(s);this.grid.length||(this.grid[0]=[]);var o=this.grid[0][0];o?o.moveTo(n,a):(o=this.addTile(n,a),this.addTileMonitoringHooks(o),o.draw(),this.grid[0][0]=o),this.removeExcessTiles(1,1)},calculateGridLayout:function(e,t,i){var r=i*this.tileSize.w,n=i*this.tileSize.h,s=e.left-t.left,a=Math.floor(s/r)-this.buffer,o=s/r-a,l=-o*this.tileSize.w,p=t.left+a*r,h=e.top-(t.bottom+n),u=Math.ceil(h/n)+this.buffer,y=u-h/n,c=-y*this.tileSize.h;return{tilelon:r,tilelat:n,tileoffsetlon:p,tileoffsetlat:t.bottom+u*n,tileoffsetx:l,tileoffsety:c}},initGriddedTiles:function(e){var t=this.map.getSize(),i=Math.ceil(t.h/this.tileSize.h)+Math.max(1,2*this.buffer),r=Math.ceil(t.w/this.tileSize.w)+Math.max(1,2*this.buffer),n=this.maxExtent,s=this.map.getResolution(),a=this.calculateGridLayout(e,n,s),o=Math.round(a.tileoffsetx),l=Math.round(a.tileoffsety),p=a.tileoffsetlon,h=a.tileoffsetlat,u=a.tilelon,y=a.tilelat;this.origin=new OpenLayers.Pixel(o,l);var c=o,d=p,m=0,f=parseInt(this.map.layerContainerDiv.style.left),L=parseInt(this.map.layerContainerDiv.style.top);do{var g=this.grid[m++];g||(g=[],this.grid.push(g)),p=d,o=c;var v=0;do{var O=new OpenLayers.Bounds(p,h,p+u,h+y),S=o;S-=f;var C=l;C-=L;var b=new OpenLayers.Pixel(S,C),w=g[v++];w?w.moveTo(O,b,!1):(w=this.addTile(O,b),this.addTileMonitoringHooks(w),g.push(w)),p+=u,o+=this.tileSize.w}while(p<=e.right+u*this.buffer||v<r);h-=y,l+=this.tileSize.h}while(h>=e.bottom-y*this.buffer||m<i);this.removeExcessTiles(m,v),this.spiralTileLoad()},spiralTileLoad:function(){for(var e=[],t=[\"right\",\"down\",\"left\",\"up\"],i=0,r=-1,n=OpenLayers.Util.indexOf(t,\"right\"),s=0;s<t.length;){var a=i,o=r;switch(t[n]){case\"right\":o++;break;case\"down\":a++;break;case\"left\":o--;break;case\"up\":a--}var l=null;a<this.grid.length&&a>=0&&o<this.grid[0].length&&o>=0&&(l=this.grid[a][o]),null==l||l.queued?(n=(n+1)%4,s++):(e.unshift(l),l.queued=!0,s=0,i=a,r=o)}for(var p=0,h=e.length;p<h;p++){var l=e[p];l.draw(),l.queued=!1}},addTile:function(e,t){},addTileMonitoringHooks:function(e){e.onLoadStart=function(){0==this.numLoadingTiles&&this.events.triggerEvent(\"loadstart\"),this.numLoadingTiles++},e.events.register(\"loadstart\",this,e.onLoadStart),e.onLoadEnd=function(){this.numLoadingTiles--,this.events.triggerEvent(\"tileloaded\"),0==this.numLoadingTiles&&this.events.triggerEvent(\"loadend\")},e.events.register(\"loadend\",this,e.onLoadEnd),e.events.register(\"unload\",this,e.onLoadEnd)},removeTileMonitoringHooks:function(e){e.unload(),e.events.un({loadstart:e.onLoadStart,loadend:e.onLoadEnd,unload:e.onLoadEnd,scope:this})},moveGriddedTiles:function(e){for(var t=this.buffer||1;;){var i=this.grid[0][0].position,r=this.map.getViewPortPxFromLayerPx(i);if(r.x>-this.tileSize.w*(t-1))this.shiftColumn(!0);else if(r.x<-this.tileSize.w*t)this.shiftColumn(!1);else if(r.y>-this.tileSize.h*(t-1))this.shiftRow(!0);else{if(!(r.y<-this.tileSize.h*t))break;this.shiftRow(!1)}}},shiftRow:function(e){for(var t=e?0:this.grid.length-1,i=this.grid,r=i[t],n=this.map.getResolution(),s=e?-this.tileSize.h:this.tileSize.h,a=n*-s,o=e?i.pop():i.shift(),l=0,p=r.length;l<p;l++){var h=r[l],u=h.bounds.clone(),y=h.position.clone();u.bottom=u.bottom+a,u.top=u.top+a,y.y=y.y+s,o[l].moveTo(u,y)}e?i.unshift(o):i.push(o)},shiftColumn:function(e){for(var t=e?-this.tileSize.w:this.tileSize.w,i=this.map.getResolution(),r=i*t,n=0,s=this.grid.length;n<s;n++){var a=this.grid[n],o=e?0:a.length-1,l=a[o],p=l.bounds.clone(),h=l.position.clone();p.left=p.left+r,p.right=p.right+r,h.x=h.x+t;var u=e?this.grid[n].pop():this.grid[n].shift();u.moveTo(p,h),e?a.unshift(u):a.push(u)}},removeExcessTiles:function(e,t){for(;this.grid.length>e;)for(var i=this.grid.pop(),r=0,n=i.length;r<n;r++){var s=i[r];this.removeTileMonitoringHooks(s),s.destroy()}for(;this.grid[0].length>t;)for(var r=0,n=this.grid.length;r<n;r++){var i=this.grid[r],s=i.pop();this.removeTileMonitoringHooks(s),s.destroy()}},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(e){var t=this.maxExtent,i=this.getResolution(),r=i*this.tileSize.w,n=i*this.tileSize.h,s=this.getLonLatFromViewPortPx(e),a=t.left+r*Math.floor((s.lon-t.left)/r),o=t.bottom+n*Math.floor((s.lat-t.bottom)/n);return new OpenLayers.Bounds(a,o,a+r,o+n)},CLASS_NAME:\"OpenLayers.Layer.Grid\"}),OpenLayers.Layer.MultiMap=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[9,1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20],type:null,initialize:function(e,t){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments),OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments),this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters(),this.RESOLUTIONS.unshift(10))},loadMapObject:function(){try{this.mapObject=new MultimapViewer(this.div)}catch(e){}},getWarningHTML:function(){return OpenLayers.i18n(\"getLayerWarning\",{layerType:\"MM\",layerLib:\"MultiMap\"})},setMapObjectCenter:function(e,t){this.mapObject.goToPosition(e,t)},getMapObjectCenter:function(){return this.mapObject.getCurrentPosition()},getMapObjectZoom:function(){return this.mapObject.getZoomFactor()},getMapObjectLonLatFromMapObjectPixel:function(e){return e.x=e.x-this.map.getSize().w/2,e.y=e.y-this.map.getSize().h/2,this.mapObject.getMapPositionAt(e)},getMapObjectPixelFromMapObjectLonLat:function(e){return this.mapObject.geoPosToContainerPixels(e)},getLongitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.lon,e.lat).lon:e.lon},getLatitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.lon,e.lat).lat:e.lat},getMapObjectLonLatFromLonLat:function(e,t){var i;if(this.sphericalMercator){var r=this.inverseMercator(e,t);i=new MMLatLon(r.lat,r.lon)}else i=new MMLatLon(t,e);return i},getXFromMapObjectPixel:function(e){return e.x},getYFromMapObjectPixel:function(e){return e.y},getMapObjectPixelFromXY:function(e,t){return new MMPoint(e,t)},CLASS_NAME:\"OpenLayers.Layer.MultiMap\"}),OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(e,t){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments),this.features=new Array},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments),this.clearFeatures(),this.features=null},loadText:function(){if(!this.loaded&&null!=this.location){var e=function(e){this.events.triggerEvent(\"loadend\")};this.events.triggerEvent(\"loadstart\"),OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:e,scope:this}),this.loaded=!0}},moveTo:function(e,t,i){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),this.visibility&&!this.loaded&&this.loadText()},parseData:function(e){var t=e.responseText,i={};OpenLayers.Util.extend(i,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(i.externalProjection=this.projection,i.internalProjection=this.map.getProjectionObject());for(var r=new OpenLayers.Format.Text(i),n=r.read(t),s=0,a=n.length;s<a;s++){var o,l,p,h={},u=n[s];o=new OpenLayers.LonLat(u.geometry.x,u.geometry.y),u.style.graphicWidth&&u.style.graphicHeight&&(l=new OpenLayers.Size(u.style.graphicWidth,u.style.graphicHeight)),void 0!==u.style.graphicXOffset&&void 0!==u.style.graphicYOffset&&(p=new OpenLayers.Pixel(u.style.graphicXOffset,u.style.graphicYOffset)),null!=u.style.externalGraphic?h.icon=new OpenLayers.Icon(u.style.externalGraphic,l,p):(h.icon=OpenLayers.Marker.defaultIcon(),null!=l&&h.icon.setSize(l)),null!=u.attributes.title&&null!=u.attributes.description&&(h.popupContentHTML=\"<h2>\"+u.attributes.title+\"</h2><p>\"+u.attributes.description+\"</p>\"),h.overflow=u.attributes.overflow||\"auto\";var y=new OpenLayers.Feature(this,o,h);this.features.push(y);var c=y.createMarker();null!=u.attributes.title&&null!=u.attributes.description&&c.events.register(\"click\",y,this.markerClick),this.addMarker(c)}this.events.triggerEvent(\"loadend\")},markerClick:function(e){var t=this==this.layer.selectedFeature;this.layer.selectedFeature=t?null:this;for(var i=0,r=this.layer.map.popups.length;i<r;i++)this.layer.map.removePopup(this.layer.map.popups[i]);t||this.layer.map.addPopup(this.createPopup()),OpenLayers.Event.stop(e)},clearFeatures:function(){if(null!=this.features)for(;this.features.length>0;){var e=this.features[0];OpenLayers.Util.removeItem(this.features,e),e.destroy()}},CLASS_NAME:\"OpenLayers.Layer.Text\"}),OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,2145767211914062e-20],type:null,sphericalMercator:!1,initialize:function(e,t){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments),OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments),this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},loadMapObject:function(){var e=OpenLayers.Util.createDiv(this.name),t=this.map.getSize();e.style.width=t.w+\"px\",e.style.height=t.h+\"px\",this.div.appendChild(e);try{this.mapObject=new VEMap(this.name)}catch(e){}if(null!=this.mapObject){try{this.mapObject.LoadMap(null,null,this.type,!0),this.mapObject.AttachEvent(\"onmousedown\",function(){return!0})}catch(e){}this.mapObject.HideDashboard()}this.mapObject&&this.mapObject.vemapcontrol&&this.mapObject.vemapcontrol.PanMap&&\"function\"==typeof this.mapObject.vemapcontrol.PanMap||(this.dragPanMapObject=null)},getWarningHTML:function(){return OpenLayers.i18n(\"getLayerWarning\",{layerType:\"VE\",layerLib:\"VirtualEarth\"})},setMapObjectCenter:function(e,t){this.mapObject.SetCenterAndZoom(e,t)},getMapObjectCenter:function(){return this.mapObject.GetCenter()},dragPanMapObject:function(e,t){this.mapObject.vemapcontrol.PanMap(e,-t)},getMapObjectZoom:function(){return this.mapObject.GetZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(e){return\"undefined\"!=typeof VEPixel?this.mapObject.PixelToLatLong(e):this.mapObject.PixelToLatLong(e.x,e.y)},getMapObjectPixelFromMapObjectLonLat:function(e){return this.mapObject.LatLongToPixel(e)},getLongitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.Longitude,e.Latitude).lon:e.Longitude},getLatitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.Longitude,e.Latitude).lat:e.Latitude},getMapObjectLonLatFromLonLat:function(e,t){var i;if(this.sphericalMercator){var r=this.inverseMercator(e,t);i=new VELatLong(r.lat,r.lon)}else i=new VELatLong(t,e);return i},getXFromMapObjectPixel:function(e){return e.x},getYFromMapObjectPixel:function(e){return e.y},getMapObjectPixelFromXY:function(e,t){return\"undefined\"!=typeof VEPixel?new VEPixel(e,t):new Msn.VE.Pixel(e,t)},CLASS_NAME:\"OpenLayers.Layer.VirtualEarth\"}),OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,2145767211914062e-20,1072883605957031e-20],type:null,sphericalMercator:!1,initialize:function(e,t){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments),OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments),this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},loadMapObject:function(){try{var e=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new YMap(this.div,this.type,e),this.mapObject.disableKeyControls(),this.mapObject.disableDragMap(),this.mapObject.moveByXY&&\"function\"==typeof this.mapObject.moveByXY||(this.dragPanMapObject=null)}catch(e){}},onMapResize:function(){try{var e=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(e)}catch(e){}},setMap:function(e){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments),this.map.events.register(\"moveend\",this,this.fixYahooEventPane)},fixYahooEventPane:function(){var e=OpenLayers.Util.getElement(\"ygddfdiv\");null!=e&&(null!=e.parentNode&&e.parentNode.removeChild(e),this.map.events.unregister(\"moveend\",this,this.fixYahooEventPane))},getWarningHTML:function(){return OpenLayers.i18n(\"getLayerWarning\",{layerType:\"Yahoo\",layerLib:\"Yahoo\"})},getOLZoomFromMapObjectZoom:function(e){var t=null;return null!=e&&(t=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[e]),t=18-t),t},getMapObjectZoomFromOLZoom:function(e){var t=null;return null!=e&&(t=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[e]),t=18-t),t},setMapObjectCenter:function(e,t){this.mapObject.drawZoomAndCenter(e,t)},getMapObjectCenter:function(){return this.mapObject.getCenterLatLon()},dragPanMapObject:function(e,t){this.mapObject.moveByXY({x:-e,y:t})},getMapObjectZoom:function(){return this.mapObject.getZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(e){return this.mapObject.convertXYLatLon(e)},getMapObjectPixelFromMapObjectLonLat:function(e){return this.mapObject.convertLatLonXY(e)},getLongitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.Lon,e.Lat).lon:e.Lon},getLatitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.Lon,e.Lat).lat:e.Lat},getMapObjectLonLatFromLonLat:function(e,t){var i;if(this.sphericalMercator){var r=this.inverseMercator(e,t);i=new YGeoPoint(r.lat,r.lon)}else i=new YGeoPoint(t,e);return i},getXFromMapObjectPixel:function(e){return e.x},getYFromMapObjectPixel:function(e){return e.y},getMapObjectPixelFromXY:function(e,t){return new YCoordPoint(e,t)},getMapObjectSizeFromOLSize:function(e){return new YSize(e.w,e.h)},CLASS_NAME:\"OpenLayers.Layer.Yahoo\"}),OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,initialize:function(e){this.params={},this.headers={},OpenLayers.Protocol.prototype.initialize.apply(this,arguments)},destroy:function(){this.params=null,this.headers=null,OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(e,t,i){return OpenLayers.Function.bind(function(){e.apply(this,[t,i])},this)},read:function(e){e=OpenLayers.Util.applyDefaults(e,this.options);var t=void 0!==e.readWithPOST?e.readWithPOST:this.readWithPOST,i=new OpenLayers.Protocol.Response({requestType:\"read\"});return e.filter&&e.filter instanceof OpenLayers.Filter.Spatial&&e.filter.type==OpenLayers.Filter.Spatial.BBOX&&(e.params=OpenLayers.Util.extend(e.params,{bbox:e.filter.value.toArray()})),i.priv=t?OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,i,e),data:OpenLayers.Util.getParameterString(e.params),headers:{\"Content-Type\":\"application/x-www-form-urlencoded\"}}):OpenLayers.Request.GET({url:e.url,callback:this.createCallback(this.handleRead,i,e),params:e.params,headers:e.headers}),i},handleRead:function(e,t){this.handleResponse(e,t)},create:function(e,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({reqFeatures:e,requestType:\"create\"});return i.priv=OpenLayers.Request.POST({url:t.url,callback:this.createCallback(this.handleCreate,i,t),headers:t.headers,data:this.format.write(e)}),i},handleCreate:function(e,t){this.handleResponse(e,t)},update:function(e,t){var i=t.url||e.url||this.options.url;t=OpenLayers.Util.applyDefaults(t,this.options);var r=new OpenLayers.Protocol.Response({reqFeatures:e,requestType:\"update\"});return r.priv=OpenLayers.Request.PUT({url:i,callback:this.createCallback(this.handleUpdate,r,t),headers:t.headers,data:this.format.write(e)}),r},handleUpdate:function(e,t){this.handleResponse(e,t)},delete:function(e,t){var i=t.url||e.url||this.options.url;t=OpenLayers.Util.applyDefaults(t,this.options);var r=new OpenLayers.Protocol.Response({reqFeatures:e,requestType:\"delete\"});return r.priv=OpenLayers.Request.DELETE({url:i,callback:this.createCallback(this.handleDelete,r,t),headers:t.headers}),r},handleDelete:function(e,t){this.handleResponse(e,t)},handleResponse:function(e,t){var i=e.priv;t.callback&&(i.status>=200&&i.status<300?(\"delete\"!=e.requestType&&(e.features=this.parseFeatures(i)),e.code=OpenLayers.Protocol.Response.SUCCESS):e.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,e))},parseFeatures:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},commit:function(e,t){function i(e){for(var t=e.features?e.features.length:0,i=new Array(t),n=0;n<t;++n)i[n]=e.features[n].fid;d.insertIds=i,r.apply(this,[e])}function r(e){this.callUserCallback(e,t),c=c&&e.success(),++s>=y&&t.callback&&(d.code=c?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE,t.callback.apply(t.scope,[d]))}t=OpenLayers.Util.applyDefaults(t,this.options);var n=[],s=0,a={};a[OpenLayers.State.INSERT]=[],a[OpenLayers.State.UPDATE]=[],a[OpenLayers.State.DELETE]=[];for(var o,l,p=[],h=0,u=e.length;h<u;++h)o=e[h],(l=a[o.state])&&(l.push(o),p.push(o));var y=(a[OpenLayers.State.INSERT].length>0?1:0)+a[OpenLayers.State.UPDATE].length+a[OpenLayers.State.DELETE].length,c=!0,d=new OpenLayers.Protocol.Response({reqFeatures:p}),m=a[OpenLayers.State.INSERT];m.length>0&&n.push(this.create(m,OpenLayers.Util.applyDefaults({callback:i,scope:this},t.create))),m=a[OpenLayers.State.UPDATE];for(var h=m.length-1;h>=0;--h)n.push(this.update(m[h],OpenLayers.Util.applyDefaults({callback:r,scope:this},t.update)));m=a[OpenLayers.State.DELETE];for(var h=m.length-1;h>=0;--h)n.push(this.delete(m[h],OpenLayers.Util.applyDefaults({callback:r,scope:this},t.delete)));return n},abort:function(e){e&&e.priv.abort()},callUserCallback:function(e,t){var i=t[e.requestType];i&&i.callback&&i.callback.call(i.scope,e)},CLASS_NAME:\"OpenLayers.Protocol.HTTP\"}),OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:!1,propertyStyles:null,initialize:function(e,t){OpenLayers.Util.extend(this,t),this.rules=[],t&&t.rules&&this.addRules(t.rules),this.setDefaultStyle(e||OpenLayers.Feature.Vector.style.default)},destroy:function(){for(var e=0,t=this.rules.length;e<t;e++)this.rules[e].destroy(),this.rules[e]=null;this.rules=null,this.defaultStyle=null},createSymbolizer:function(e){for(var t,i=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),e),r=this.rules,n=[],s=!1,a=0,o=r.length;a<o;a++){t=r[a];t.evaluate(e)&&(t instanceof OpenLayers.Rule&&t.elseFilter?n.push(t):(s=!0,this.applySymbolizer(t,i,e)))}if(0==s&&n.length>0){s=!0;for(var a=0,o=n.length;a<o;a++)this.applySymbolizer(n[a],i,e)}return r.length>0&&0==s&&(i.display=\"none\"),i},applySymbolizer:function(e,t,i){var r=i.geometry?this.getSymbolizerPrefix(i.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0],n=e.symbolizer[r]||e.symbolizer;if(this.defaultsPerSymbolizer===!0){var s=this.defaultStyle;OpenLayers.Util.applyDefaults(n,{pointRadius:s.pointRadius}),n.stroke!==!0&&n.graphic!==!0||OpenLayers.Util.applyDefaults(n,{strokeWidth:s.strokeWidth,strokeColor:s.strokeColor,strokeOpacity:s.strokeOpacity,strokeDashstyle:s.strokeDashstyle,strokeLinecap:s.strokeLinecap}),n.fill!==!0&&n.graphic!==!0||OpenLayers.Util.applyDefaults(n,{fillColor:s.fillColor,fillOpacity:s.fillOpacity}),n.graphic===!0&&OpenLayers.Util.applyDefaults(n,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}return this.createLiterals(OpenLayers.Util.extend(t,n),i)},createLiterals:function(e,t){var i=this.context||t.attributes||t.data;for(var r in this.propertyStyles)e[r]=OpenLayers.Style.createLiteral(e[r],i,t);return e},findPropertyStyles:function(){var e={},t=this.defaultStyle;this.addPropertyStyles(e,t);for(var i,r,n=this.rules,s=0,a=n.length;s<a;s++){i=n[s].symbolizer;for(var o in i){if(\"object\"!=typeof(r=i[o])){this.addPropertyStyles(e,i);break}this.addPropertyStyles(e,r)}}return e},addPropertyStyles:function(e,t){var i;for(var r in t)\"string\"==typeof(i=t[r])&&i.match(/\\$\\{\\w+\\}/)&&(e[r]=!0);return e},addRules:function(e){this.rules=this.rules.concat(e),this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(e){this.defaultStyle=e,this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(e){for(var t=OpenLayers.Style.SYMBOLIZER_PREFIXES,i=0,r=t.length;i<r;i++)if(e.CLASS_NAME.indexOf(t[i])!=-1)return t[i]},CLASS_NAME:\"OpenLayers.Style\"\n}),OpenLayers.Style.createLiteral=function(e,t,i){return\"string\"==typeof e&&e.indexOf(\"${\")!=-1&&(e=OpenLayers.String.format(e,t,[i]),e=isNaN(e)||!e?e:parseFloat(e)),e},OpenLayers.Style.SYMBOLIZER_PREFIXES=[\"Point\",\"Line\",\"Polygon\",\"Text\"],OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:!0,handleRightClicks:!1,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,initialize:function(e){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,OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return this.dragPan.activate(),this.zoomWheelEnabled&&this.handlers.wheel.activate(),this.handlers.click.activate(),this.zoomBox.activate(),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.zoomBox.deactivate(),this.dragPan.deactivate(),this.handlers.click.deactivate(),this.handlers.wheel.deactivate(),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){this.handleRightClicks&&(this.map.viewPortDiv.oncontextmenu=function(){return!1});var e={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick},t={double:!0,stopDouble:!0};this.handlers.click=new OpenLayers.Handler.Click(this,e,t),this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions)),this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask}),this.dragPan.draw(),this.zoomBox.draw(),this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown}),this.activate()},defaultDblClick:function(e){var t=this.map.getLonLatFromViewPortPx(e.xy);this.map.setCenter(t,this.map.zoom+1)},defaultDblRightClick:function(e){var t=this.map.getLonLatFromViewPortPx(e.xy);this.map.setCenter(t,this.map.zoom-1)},wheelChange:function(e,t){var i=this.map.getZoom()+t;if(this.map.isValidZoomLevel(i)){var r=this.map.getSize(),n=r.w/2-e.xy.x,s=e.xy.y-r.h/2,a=this.map.baseLayer.getResolutionForZoom(i),o=this.map.getLonLatFromPixel(e.xy),l=new OpenLayers.LonLat(o.lon+n*a,o.lat+s*a);this.map.setCenter(l,i)}},wheelUp:function(e){this.wheelChange(e,1)},wheelDown:function(e){this.wheelChange(e,-1)},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.Filter=OpenLayers.Class({initialize:function(e){OpenLayers.Util.extend(this,e)},destroy:function(){},evaluate:function(e){return!0},clone:function(){return null},CLASS_NAME:\"OpenLayers.Filter\"}),OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+\"_\")},destroy:function(){this.id=null,this.bounds=null},clone:function(){return new OpenLayers.Geometry},setBounds:function(e){e&&(this.bounds=e.clone())},clearBounds:function(){this.bounds=null,this.parent&&this.parent.clearBounds()},extendBounds:function(e){this.getBounds()?this.bounds.extend(e):this.setBounds(e)},getBounds:function(){return null==this.bounds&&this.calculateBounds(),this.bounds},calculateBounds:function(){},distanceTo:function(e,t){},getVertices:function(e){},atPoint:function(e,t,i){var r=!1;if(null!=this.getBounds()&&null!=e){var n=null!=t?t:0,s=null!=i?i:0;r=new OpenLayers.Bounds(this.bounds.left-n,this.bounds.bottom-s,this.bounds.right+n,this.bounds.top+s).containsLonLat(e)}return r},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:\"OpenLayers.Geometry\"}),OpenLayers.Geometry.fromWKT=function(e){var t=arguments.callee.format;t||(t=new OpenLayers.Format.WKT,arguments.callee.format=t);var i,r=t.read(e);if(r instanceof OpenLayers.Feature.Vector)i=r.geometry;else if(r instanceof Array){for(var n=r.length,s=new Array(n),a=0;a<n;++a)s[a]=r[a].geometry;i=new OpenLayers.Geometry.Collection(s)}return i},OpenLayers.Geometry.segmentsIntersect=function(e,t,i){var r=i&&i.point,n=i&&i.tolerance,s=!1,a=e.x1-t.x1,o=e.y1-t.y1,l=e.x2-e.x1,p=e.y2-e.y1,h=t.y2-t.y1,u=t.x2-t.x1,y=h*l-u*p,c=u*o-h*a,d=l*o-p*a;if(0==y)0==c&&0==d&&(s=!0);else{var m=c/y,f=d/y;if(m>=0&&m<=1&&f>=0&&f<=1)if(r){var L=e.x1+m*l,g=e.y1+m*p;s=new OpenLayers.Geometry.Point(L,g)}else s=!0}if(n){if(s){if(r){var v,L,g,O=[e,t];e:for(var S=0;S<2;++S){v=O[S];for(var C=1;C<3;++C)if(L=v[\"x\"+C],g=v[\"y\"+C],Math.sqrt(Math.pow(L-s.x,2)+Math.pow(g-s.y,2))<n){s.x=L,s.y=g;break e}}}}else{var b,w,L,g,E,x,O=[e,t];e:for(var S=0;S<2;++S){b=O[S],w=O[(S+1)%2];for(var C=1;C<3;++C)if(E={x:b[\"x\"+C],y:b[\"y\"+C]},x=OpenLayers.Geometry.distanceToSegment(E,w),x.distance<n){s=!r||new OpenLayers.Geometry.Point(E.x,E.y);break e}}}}return s},OpenLayers.Geometry.distanceToSegment=function(e,t){var i,r,n=e.x,s=e.y,a=t.x1,o=t.y1,l=t.x2,p=t.y2,h=l-a,u=p-o,y=(h*(n-a)+u*(s-o))/(Math.pow(h,2)+Math.pow(u,2));return y<=0?(i=a,r=o):y>=1?(i=l,r=p):(i=a+y*h,r=o+y*u),{distance:Math.sqrt(Math.pow(i-n,2)+Math.pow(r-s,2)),x:i,y:r}},OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:\"png\"},isBaseLayer:!0,initialize:function(e,t,i,r){var n=[];i=OpenLayers.Util.upperCaseObject(i),n.push(e,t,i,r),OpenLayers.Layer.Grid.prototype.initialize.apply(this,n),OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)),this.params.TRANSPARENT&&\"true\"==this.params.TRANSPARENT.toString().toLowerCase()&&(null!=r&&r.isBaseLayer||(this.isBaseLayer=!1),\"jpg\"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?\"gif\":\"png\"))},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){e=this.adjustBounds(e);var t=this.projection.getCode().split(\":\"),i=t[t.length-1],r=this.getImageSize(),n={BBOX:e.toBBOX(),SIZE:r.w+\",\"+r.h,F:\"image\",BBOXSR:i,IMAGESR:i};if(this.layerDefs){var s,a=[];for(s in this.layerDefs)this.layerDefs.hasOwnProperty(s)&&this.layerDefs[s]&&(a.push(s),a.push(\":\"),a.push(this.layerDefs[s]),a.push(\";\"));a.length>0&&(n.LAYERDEFS=a.join(\"\"))}return this.getFullRequestString(n)},setLayerFilter:function(e,t){this.layerDefs||(this.layerDefs={}),t?this.layerDefs[e]=t:delete this.layerDefs[e]},clearLayerFilter:function(e){e?delete this.layerDefs[e]:delete this.layerDefs},mergeNewParams:function(e){var t=OpenLayers.Util.upperCaseObject(e),i=[t];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,i)},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},CLASS_NAME:\"OpenLayers.Layer.ArcGIS93Rest\"}),OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:\"jpeg\",map:\"\"},initialize:function(e,t,i,r){var n=[];n.push(e,t,i,r),OpenLayers.Layer.Grid.prototype.initialize.apply(this,n),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(e){e=this.adjustBounds(e);var t=this.map.getResolution(),i=Math.round(1e4*this.map.getScale())/1e4,r=Math.round(e.left/t),n=-Math.round(e.top/t);return this.getFullRequestString({t:n,l:r,s:i})},addTile:function(e,t){var i=this.getURL(e);return new OpenLayers.Tile.Image(this,t,e,i,this.tileSize)},calculateGridLayout:function(e,t,i){var r=i*this.tileSize.w,n=i*this.tileSize.h,s=e.left,a=Math.floor(s/r)-this.buffer,o=s/r-a,l=-o*this.tileSize.w,p=a*r,h=e.top,u=Math.ceil(h/n)+this.buffer;return{tilelon:r,tilelat:n,tileoffsetlon:p,tileoffsetlat:u*n,tileoffsetx:l,tileoffsety:-(u-h/n+1)*this.tileSize.h}},clone:function(e){return null==e&&(e=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e]),null!=this.tileSize&&(e.tileSize=this.tileSize.clone()),e.grid=[],e},getTileBounds:function(e){var t=this.getResolution(),i=t*this.tileSize.w,r=t*this.tileSize.h,n=this.getLonLatFromViewPortPx(e),s=i*Math.floor(n.lon/i),a=r*Math.floor(n.lat/r);return new OpenLayers.Bounds(s,a,s+i,a+r)},CLASS_NAME:\"OpenLayers.Layer.KaMap\"}),OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,useHttpTile:!1,singleTile:!1,useOverlay:!1,useAsyncOverlay:!0,TILE_PARAMS:{operation:\"GETTILEIMAGE\",version:\"1.2.0\"},SINGLE_TILE_PARAMS:{operation:\"GETMAPIMAGE\",format:\"PNG\",locale:\"en\",clip:\"1\",version:\"1.0.0\"},OVERLAY_PARAMS:{operation:\"GETDYNAMICMAPOVERLAYIMAGE\",format:\"PNG\",locale:\"en\",clip:\"1\",version:\"2.0.0\"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:\"png\",querystring:null},defaultSize:new OpenLayers.Size(300,300),initialize:function(e,t,i,r){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments),null!=r&&null!=r.isBaseLayer||(this.isBaseLayer=\"true\"!=this.transparent&&1!=this.transparent),r&&null!=r.useOverlay&&(this.useOverlay=r.useOverlay),this.singleTile?this.useOverlay?(OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS),this.useAsyncOverlay||(this.params.version=\"1.0.0\")):OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS):(this.useHttpTile?OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS):OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS),this.setTileSize(this.defaultSize))},clone:function(e){return null==e&&(e=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},getURL:function(e){var t,i=e.getCenterLonLat(),r=this.map.getCurrentSize();if(this.singleTile){var n={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:r.h*this.ratio,setdisplaywidth:r.w*this.ratio,setviewcenterx:i.lon,setviewcentery:i.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var s={};s=OpenLayers.Util.extend(s,n),s.operation=\"GETVISIBLEMAPEXTENT\",s.version=\"1.0.0\",s.session=this.params.session,s.mapName=this.params.mapName,s.format=\"text/xml\",t=this.getFullRequestString(s),OpenLayers.Request.GET({url:t,async:!1})}t=this.getFullRequestString(n)}else{var a=this.map.getResolution(),o=Math.floor((e.left-this.maxExtent.left)/a);o=Math.round(o/this.tileSize.w);var l=Math.floor((this.maxExtent.top-e.top)/a);l=Math.round(l/this.tileSize.h),t=this.useHttpTile?this.getImageFilePath({tilecol:o,tilerow:l,scaleindex:this.resolutions.length-this.map.zoom-1}):this.getFullRequestString({tilecol:o,tilerow:l,scaleindex:this.resolutions.length-this.map.zoom-1})}return t},getFullRequestString:function(e,t){var i=null==t?this.url:t;\"object\"==typeof i&&(i=i[Math.floor(Math.random()*i.length)]);var r=i,n=OpenLayers.Util.extend({},this.params);n=OpenLayers.Util.extend(n,e);var s=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(i));for(var a in n)a.toUpperCase()in s&&delete n[a];var o=OpenLayers.Util.getParameterString(n);if(\"\"!=(o=o.replace(/,/g,\"+\"))){var l=i.charAt(i.length-1);r+=\"&\"==l||\"?\"==l?o:i.indexOf(\"?\")==-1?\"?\"+o:\"&\"+o}return r},getImageFilePath:function(e,t){var i=null==t?this.url:t;\"object\"==typeof i&&(i=i[Math.floor(Math.random()*i.length)]);var r=i,n=\"\",s=\"\";e.tilerow<0&&(n=\"-\"),n+=0==e.tilerow?\"0\":Math.floor(Math.abs(e.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder,e.tilecol<0&&(s=\"-\"),s+=0==e.tilecol?\"0\":Math.floor(Math.abs(e.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder;var a=\"/S\"+Math.floor(e.scaleindex)+\"/\"+this.params.basemaplayergroupname+\"/R\"+n+\"/C\"+s+\"/\"+e.tilerow%this.params.tileRowsPerFolder+\"_\"+e.tilecol%this.params.tileColumnsPerFolder+\".\"+this.params.format;return this.params.querystring&&(a+=\"?\"+this.params.querystring),r+=a},calculateGridLayout:function(e,t,i){var r=i*this.tileSize.w,n=i*this.tileSize.h,s=e.left-t.left,a=Math.floor(s/r)-this.buffer,o=s/r-a,l=-o*this.tileSize.w,p=t.left+a*r,h=t.top-e.top+n,u=Math.floor(h/n)-this.buffer,y=u-h/n,c=y*this.tileSize.h;return{tilelon:r,tilelat:n,tileoffsetlon:p,tileoffsetlat:t.top-n*u,tileoffsetx:l,tileoffsety:c}},CLASS_NAME:\"OpenLayers.Layer.MapGuide\"}),OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:\"map\",map_imagetype:\"png\"},initialize:function(e,t,i,r){var n=[];n.push(e,t,i,r),OpenLayers.Layer.Grid.prototype.initialize.apply(this,n),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS),null!=r&&null!=r.isBaseLayer||(this.isBaseLayer=\"true\"!=this.params.transparent&&1!=this.params.transparent)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},getURL:function(e){e=this.adjustBounds(e);var t=[e.left,e.bottom,e.right,e.top],i=this.getImageSize();return this.getFullRequestString({mapext:t,imgext:t,map_size:[i.w,i.h],imgx:i.w/2,imgy:i.h/2,imgxy:[i.w,i.h]})},getFullRequestString:function(e,t){var i=null==t?this.url:t,r=OpenLayers.Util.extend({},this.params);r=OpenLayers.Util.extend(r,e);var n=OpenLayers.Util.getParameterString(r);i instanceof Array&&(i=this.selectUrl(n,i));var s=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(i));for(var a in r)a.toUpperCase()in s&&delete r[a];n=OpenLayers.Util.getParameterString(r);var o=i;if(\"\"!=(n=n.replace(/,/g,\"+\"))){var l=i.charAt(i.length-1);o+=\"&\"==l||\"?\"==l?n:i.indexOf(\"?\")==-1?\"?\"+n:\"&\"+n}return o},CLASS_NAME:\"OpenLayers.Layer.MapServer\"}),OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:\"1.0.0\",isBaseLayer:!0,tileOrigin:null,serverResolutions:null,initialize:function(e,t,i){var r=[];r.push(e,t,{},i),OpenLayers.Layer.Grid.prototype.initialize.apply(this,r)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.TMS(this.name,this.url,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){e=this.adjustBounds(e);var t=this.map.getResolution(),i=Math.round((e.left-this.tileOrigin.lon)/(t*this.tileSize.w)),r=Math.round((e.bottom-this.tileOrigin.lat)/(t*this.tileSize.h)),n=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,t):this.map.getZoom(),s=this.serviceVersion+\"/\"+this.layername+\"/\"+n+\"/\"+i+\"/\"+r+\".\"+this.type,a=this.url;return a instanceof Array&&(a=this.selectUrl(s,a)),a+s},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},setMap:function(e){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom))},CLASS_NAME:\"OpenLayers.Layer.TMS\"}),OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,format:\"image/png\",serverResolutions:null,initialize:function(e,t,i,r){this.layername=i,OpenLayers.Layer.Grid.prototype.initialize.apply(this,[e,t,{},r]),this.extension=this.format.split(\"/\")[1].toLowerCase(),this.extension=\"jpg\"==this.extension?\"jpeg\":this.extension},clone:function(e){return null==e&&(e=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){function t(e,t){e=String(e);for(var i=[],r=0;r<t;++r)i.push(\"0\");return i.join(\"\").substring(0,t-e.length)+e}var i=this.map.getResolution(),r=this.maxExtent,n=this.tileSize,s=Math.round((e.left-r.left)/(i*n.w)),a=Math.round((e.bottom-r.bottom)/(i*n.h)),o=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,i):this.map.getZoom(),l=[this.layername,t(o,2),t(parseInt(s/1e6),3),t(parseInt(s/1e3)%1e3,3),t(parseInt(s)%1e3,3),t(parseInt(a/1e6),3),t(parseInt(a/1e3)%1e3,3),t(parseInt(a)%1e3,3)+\".\"+this.extension],p=l.join(\"/\"),h=this.url;return h instanceof Array&&(h=this.selectUrl(p,h)),(h=\"/\"==h.charAt(h.length-1)?h:h+\"/\")+p},addTile:function(e,t){var i=this.getURL(e);return new OpenLayers.Tile.Image(this,t,e,i,this.tileSize)},CLASS_NAME:\"OpenLayers.Layer.TileCache\"}),OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:\"WMS\",version:\"1.1.1\",request:\"GetMap\",styles:\"\",exceptions:\"application/vnd.ogc.se_inimage\",format:\"image/jpeg\"},reproject:!1,isBaseLayer:!0,encodeBBOX:!1,noMagic:!1,initialize:function(e,t,i,r){var n=[];i=OpenLayers.Util.upperCaseObject(i),n.push(e,t,i,r),OpenLayers.Layer.Grid.prototype.initialize.apply(this,n),OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)),!this.noMagic&&this.params.TRANSPARENT&&\"true\"==this.params.TRANSPARENT.toString().toLowerCase()&&(null!=r&&r.isBaseLayer||(this.isBaseLayer=!1),\"image/jpeg\"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?\"image/gif\":\"image/png\"))},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){e=this.adjustBounds(e);var t=this.getImageSize(),i={BBOX:this.encodeBBOX?e.toBBOX():e.toArray(),WIDTH:t.w,HEIGHT:t.h};return this.getFullRequestString(i)},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},mergeNewParams:function(e){var t=OpenLayers.Util.upperCaseObject(e),i=[t];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,i)},getFullRequestString:function(e,t){var i=this.map.getProjection();return this.params.SRS=\"none\"==i?null:i,OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Layer.WMS\"}),OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:!0,lzd:null,zoomLevels:null,initialize:function(e,t,i,r,n,s){this.lzd=i,this.zoomLevels=r;var a=[];a.push(e,t,n,s),OpenLayers.Layer.Grid.prototype.initialize.apply(this,a),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},getZoom:function(){var e=this.map.getZoom();this.map.getMaxExtent();return e-=Math.log(this.maxResolution/(this.lzd/512))/Math.log(2)},getURL:function(e){e=this.adjustBounds(e);var t=this.getZoom(),i=this.map.getMaxExtent(),r=this.lzd/Math.pow(2,this.getZoom()),n=Math.floor((e.left-i.left)/r),s=Math.floor((e.bottom-i.bottom)/r);return this.map.getResolution()<=this.lzd/512&&this.getZoom()<=this.zoomLevels?this.getFullRequestString({L:t,X:n,Y:s}):OpenLayers.Util.getImagesLocation()+\"blank.gif\"},CLASS_NAME:\"OpenLayers.Layer.WorldWind\"}),OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,sphericalMercator:!1,initialize:function(e,t,i){(i&&i.sphericalMercator||this.sphericalMercator)&&(i=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-20037508.3392,-20037508.3392,20037508.3392,20037508.3392),maxResolution:156543.0339,numZoomLevels:19,units:\"m\",projection:\"EPSG:900913\"},i)),t=t||this.url,e=e||this.name;var r=[e,t,{},i];OpenLayers.Layer.Grid.prototype.initialize.apply(this,r)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.XYZ(this.name,this.url,this.options)),e=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[e]),null!=this.tileSize&&(e.tileSize=this.tileSize.clone()),e.grid=[],e},getURL:function(e){var t=this.map.getResolution(),i=Math.round((e.left-this.maxExtent.left)/(t*this.tileSize.w)),r=Math.round((this.maxExtent.top-e.top)/(t*this.tileSize.h)),n=this.map.getZoom(),s=(Math.pow(2,n),this.url),a=\"\"+i+r+n;return s instanceof Array&&(s=this.selectUrl(a,s)),OpenLayers.String.format(s,{x:i,y:r,z:n})},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},setMap:function(e){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom))},CLASS_NAME:\"OpenLayers.Layer.XYZ\"}),OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:\"OpenStreetMap\",attribution:\"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>\",sphericalMercator:!0,url:\"http://tile.openstreetmap.org/${z}/${x}/${y}.png\",CLASS_NAME:\"OpenLayers.Layer.OSM\"}),OpenLayers.Protocol.SQL.Gears=OpenLayers.Class(OpenLayers.Protocol.SQL,{FID_PREFIX:\"__gears_fid__\",NULL_GEOMETRY:\"__gears_null_geometry__\",NULL_FEATURE_STATE:\"__gears_null_feature_state__\",jsonParser:null,wktParser:null,fidRegExp:null,saveFeatureState:!0,typeOfFid:\"string\",db:null,initialize:function(e){this.supported()&&(OpenLayers.Protocol.SQL.prototype.initialize.apply(this,[e]),this.jsonParser=new OpenLayers.Format.JSON,this.wktParser=new OpenLayers.Format.WKT,this.fidRegExp=new RegExp(\"^\"+this.FID_PREFIX),this.initializeDatabase())},initializeDatabase:function(){this.db=google.gears.factory.create(\"beta.database\"),this.db.open(this.databaseName),this.db.execute(\"CREATE TABLE IF NOT EXISTS \"+this.tableName+\" (fid TEXT UNIQUE, geometry TEXT, properties TEXT,  state TEXT)\")},destroy:function(){this.db.close(),this.db=null,this.jsonParser=null,this.wktParser=null,OpenLayers.Protocol.SQL.prototype.destroy.apply(this)},supported:function(){return!(!window.google||!google.gears)},read:function(e){e=OpenLayers.Util.applyDefaults(e,this.options);for(var t,i=[],r=this.db.execute(\"SELECT * FROM \"+this.tableName);r.isValidRow();)t=this.unfreezeFeature(r),this.evaluateFilter(t,e.filter)&&(e.noFeatureStateReset||(t.state=null),i.push(t)),r.next();r.close();var n=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:\"read\",features:i});return e&&e.callback&&e.callback.call(e.scope,n),n},unfreezeFeature:function(e){var t,i=e.fieldByName(\"geometry\");t=i==this.NULL_GEOMETRY?new OpenLayers.Feature.Vector:this.wktParser.read(i),t.attributes=this.jsonParser.read(e.fieldByName(\"properties\")),t.fid=this.extractFidFromField(e.fieldByName(\"fid\"));var r=e.fieldByName(\"state\");return r==this.NULL_FEATURE_STATE&&(r=null),t.state=r,t},extractFidFromField:function(e){return e.match(this.fidRegExp)||\"number\"!=this.typeOfFid||(e=parseFloat(e)),e},create:function(e,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=this.createOrUpdate(e);return i.requestType=\"create\",t&&t.callback&&t.callback.call(t.scope,i),i},update:function(e,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=this.createOrUpdate(e);return i.requestType=\"update\",t&&t.callback&&t.callback.call(t.scope,i),i},createOrUpdate:function(e){e instanceof Array||(e=[e]);var t,i,r=e.length,n=new Array(r);for(t=0;t<r;t++){i=e[t];var s=this.freezeFeature(i);this.db.execute(\"REPLACE INTO \"+this.tableName+\" (fid, geometry, properties, state) VALUES (?, ?, ?, ?)\",s);var a=i.clone();a.fid=this.extractFidFromField(s[0]),n[t]=a}return new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,features:n,reqFeatures:e})},freezeFeature:function(e){e.fid=null!=e.fid?\"\"+e.fid:OpenLayers.Util.createUniqueID(this.FID_PREFIX);var t=null!=e.geometry?e.geometry.toString():this.NULL_GEOMETRY,i=this.jsonParser.write(e.attributes),r=this.getFeatureStateForFreeze(e);return[e.fid,t,i,r]},getFeatureStateForFreeze:function(e){return this.saveFeatureState?this.createdOffline(e)?OpenLayers.State.INSERT:e.state:this.NULL_FEATURE_STATE},delete:function(e,t){e instanceof Array||(e=[e]),t=OpenLayers.Util.applyDefaults(t,this.options);var i,r,n;for(i=0,r=e.length;i<r;i++)if(n=e[i],this.saveFeatureState&&!this.createdOffline(n)){var s=n.clone();s.fid=n.fid,s.geometry&&(s.geometry.destroy(),s.geometry=null),s.state=n.state,this.createOrUpdate(s)}else this.db.execute(\"DELETE FROM \"+this.tableName+\" WHERE fid = ?\",[n.fid]);var a=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:\"delete\",reqFeatures:e});return t&&t.callback&&t.callback.call(t.scope,a),a},createdOffline:function(e){return\"string\"==typeof e.fid&&!!e.fid.match(this.fidRegExp)},commit:function(e,t){function i(e){++o<a&&(e.last=!1),this.callUserCallback(t,e)}for(var r,n,s=[],a=0,o=0,l=[],p=[],h=[],u=e.length-1;u>=0;u--)switch(n=e[u],n.state){case OpenLayers.State.INSERT:l.push(n);break;case OpenLayers.State.UPDATE:p.push(n);break;case OpenLayers.State.DELETE:h.push(n)}return l.length>0&&(a++,r=OpenLayers.Util.applyDefaults({callback:i,scope:this},t.create),s.push(this.create(l,r))),p.length>0&&(a++,r=OpenLayers.Util.applyDefaults({callback:i,scope:this},t.update),s.push(this.update(p,r))),h.length>0&&(a++,r=OpenLayers.Util.applyDefaults({callback:i,scope:this},t.delete),s.push(this.delete(h,r))),s},clear:function(){this.db.execute(\"DELETE FROM \"+this.tableName)},callUserCallback:function(e,t){var i=e[t.requestType];i&&i.callback&&i.callback.call(i.scope,t),t.last&&e.callback&&e.callback.call(e.scope)},CLASS_NAME:\"OpenLayers.Protocol.SQL.Gears\"}),OpenLayers.Rule=OpenLayers.Class({id:null,name:\"default\",title:null,description:null,context:null,filter:null,elseFilter:!1,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(e){this.symbolizer={},OpenLayers.Util.extend(this,e),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+\"_\")},destroy:function(){for(var e in this.symbolizer)this.symbolizer[e]=null;this.symbolizer=null},evaluate:function(e){var t=this.getContext(e),i=!0;if(this.minScaleDenominator||this.maxScaleDenominator)var r=e.layer.map.getScale();return this.minScaleDenominator&&(i=r>=OpenLayers.Style.createLiteral(this.minScaleDenominator,t)),i&&this.maxScaleDenominator&&(i=r<OpenLayers.Style.createLiteral(this.maxScaleDenominator,t)),i&&this.filter&&(i=\"OpenLayers.Filter.FeatureId\"==this.filter.CLASS_NAME?this.filter.evaluate(e):this.filter.evaluate(t)),i},getContext:function(e){var t=this.context;return t||(t=e.attributes||e.data),\"function\"==typeof this.context&&(t=this.context(e)),t},clone:function(){var e=OpenLayers.Util.extend({},this);e.symbolizer={};for(var t in this.symbolizer)value=this.symbolizer[t],type=typeof value,\"object\"===type?e.symbolizer[t]=OpenLayers.Util.extend({},value):\"string\"===type&&(e.symbolizer[t]=value);return e.filter=this.filter&&this.filter.clone(),e.context=this.context&&OpenLayers.Util.extend({},this.context),new OpenLayers.Rule(e)},CLASS_NAME:\"OpenLayers.Rule\"}),OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:!0,initialize:function(e,t){if(this.styles={default:new OpenLayers.Style(OpenLayers.Feature.Vector.style.default),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),delete:new OpenLayers.Style(OpenLayers.Feature.Vector.style.delete)},e instanceof OpenLayers.Style)this.styles.default=e,this.styles.select=e,this.styles.temporary=e,this.styles.delete=e;else if(\"object\"==typeof e)for(var i in e)if(e[i]instanceof OpenLayers.Style)this.styles[i]=e[i];else{if(\"object\"!=typeof e[i]){this.styles.default=new OpenLayers.Style(e),this.styles.select=new OpenLayers.Style(e),this.styles.temporary=new OpenLayers.Style(e),this.styles.delete=new OpenLayers.Style(e);break}this.styles[i]=new OpenLayers.Style(e[i])}OpenLayers.Util.extend(this,t)},destroy:function(){for(var e in this.styles)this.styles[e].destroy();this.styles=null},createSymbolizer:function(e,t){e||(e=new OpenLayers.Feature.Vector),this.styles[t]||(t=\"default\"),e.renderIntent=t;var i={};return this.extendDefault&&\"default\"!=t&&(i=this.styles.default.createSymbolizer(e)),OpenLayers.Util.extend(i,this.styles[t].createSymbolizer(e))},addUniqueValueRules:function(e,t,i,r){var n=[];for(var s in i)n.push(new OpenLayers.Rule({symbolizer:i[s],context:r,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:t,value:s})}));this.styles[e].addRules(n)},CLASS_NAME:\"OpenLayers.StyleMap\"}),OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(e){OpenLayers.Control.Panel.prototype.initialize.apply(this,[e]),this.addControls([new OpenLayers.Control.Navigation,new OpenLayers.Control.ZoomBox])},draw:function(){var e=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return this.activateControl(this.controls[0]),e},CLASS_NAME:\"OpenLayers.Control.NavToolbar\"}),OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:!0,lowerBoundary:null,upperBoundary:null,initialize:function(e){OpenLayers.Filter.prototype.initialize.apply(this,[e])},evaluate:function(e){var t=!1;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:var i=e[this.property],r=this.value;t=this.matchCase||\"string\"!=typeof i||\"string\"!=typeof r?i==r:i.toUpperCase()==r.toUpperCase();break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:var i=e[this.property],r=this.value;t=this.matchCase||\"string\"!=typeof i||\"string\"!=typeof r?i!=r:i.toUpperCase()!=r.toUpperCase();break;case OpenLayers.Filter.Comparison.LESS_THAN:t=e[this.property]<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:t=e[this.property]>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:t=e[this.property]<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:t=e[this.property]>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:t=e[this.property]>=this.lowerBoundary&&e[this.property]<=this.upperBoundary;break;case OpenLayers.Filter.Comparison.LIKE:t=new RegExp(this.value,\"gi\").test(e[this.property])}return t},value2regex:function(e,t,i){if(\".\"==e){return OpenLayers.Console.error(\"'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison\"),null}return e=e?e:\"*\",t=t?t:\".\",i=i?i:\"!\",this.value=this.value.replace(new RegExp(\"\\\\\"+i+\"(.|$)\",\"g\"),\"\\\\$1\"),this.value=this.value.replace(new RegExp(\"\\\\\"+t,\"g\"),\".\"),this.value=this.value.replace(new RegExp(\"\\\\\"+e,\"g\"),\".*\"),this.value=this.value.replace(new RegExp(\"\\\\\\\\.\\\\*\",\"g\"),\"\\\\\"+e),this.value=this.value.replace(new RegExp(\"\\\\\\\\\\\\.\",\"g\"),\"\\\\\"+t),this.value},regex2value:function(){var e=this.value;return e=e.replace(/!/g,\"!!\"),e=e.replace(/(\\\\)?\\\\\\./g,function(e,t){return t?e:\"!.\"}),e=e.replace(/(\\\\)?\\\\\\*/g,function(e,t){return t?e:\"!*\"}),e=e.replace(/\\\\\\\\/g,\"\\\\\"),e=e.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.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(e){this.fids=[],OpenLayers.Filter.prototype.initialize.apply(this,[e])},evaluate:function(e){for(var t=0,i=this.fids.length;t<i;t++){if((e.fid||e.id)==this.fids[t])return!0}return!1},clone:function(){var e=new OpenLayers.Filter.FeatureId;return OpenLayers.Util.extend(e,this),e.fids=this.fids.slice(),e},CLASS_NAME:\"OpenLayers.Filter.FeatureId\"}),OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(e){this.filters=[],OpenLayers.Filter.prototype.initialize.apply(this,[e])},destroy:function(){this.filters=null,OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(e){switch(this.type){case OpenLayers.Filter.Logical.AND:\nfor(var t=0,i=this.filters.length;t<i;t++)if(0==this.filters[t].evaluate(e))return!1;return!0;case OpenLayers.Filter.Logical.OR:for(var t=0,i=this.filters.length;t<i;t++)if(1==this.filters[t].evaluate(e))return!0;return!1;case OpenLayers.Filter.Logical.NOT:return!this.filters[0].evaluate(e)}},clone:function(){for(var e=[],t=0,i=this.filters.length;t<i;++t)e.push(this.filters[t].clone());return new OpenLayers.Filter.Logical({type:this.type,filters:e})},CLASS_NAME:\"OpenLayers.Filter.Logical\"}),OpenLayers.Filter.Logical.AND=\"&&\",OpenLayers.Filter.Logical.OR=\"||\",OpenLayers.Filter.Logical.NOT=\"!\",OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(e){OpenLayers.Filter.prototype.initialize.apply(this,[e])},evaluate:function(e){var t=!1;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(e.geometry){var i=this.value;\"OpenLayers.Bounds\"==this.value.CLASS_NAME&&(i=this.value.toGeometry()),e.geometry.intersects(i)&&(t=!0)}break;default:OpenLayers.Console.error(OpenLayers.i18n(\"filterEvaluateNotImplemented\"))}return t},clone:function(){var e=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(e)},CLASS_NAME:\"OpenLayers.Filter.Spatial\"}),OpenLayers.Filter.Spatial.BBOX=\"BBOX\",OpenLayers.Filter.Spatial.INTERSECTS=\"INTERSECTS\",OpenLayers.Filter.Spatial.DWITHIN=\"DWITHIN\",OpenLayers.Filter.Spatial.WITHIN=\"WITHIN\",OpenLayers.Filter.Spatial.CONTAINS=\"CONTAINS\",OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(e){OpenLayers.Geometry.prototype.initialize.apply(this,arguments),this.components=[],null!=e&&this.addComponents(e)},destroy:function(){this.components.length=0,this.components=null},clone:function(){for(var geometry=eval(\"new \"+this.CLASS_NAME+\"()\"),i=0,len=this.components.length;i<len;i++)geometry.addComponent(this.components[i].clone());return OpenLayers.Util.applyDefaults(geometry,this),geometry},getComponentsString:function(){for(var e=[],t=0,i=this.components.length;t<i;t++)e.push(this.components[t].toShortString());return e.join(\",\")},calculateBounds:function(){if(this.bounds=null,this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var e=1,t=this.components.length;e<t;e++)this.extendBounds(this.components[e].getBounds())}},addComponents:function(e){e instanceof Array||(e=[e]);for(var t=0,i=e.length;t<i;t++)this.addComponent(e[t])},addComponent:function(e,t){var i=!1;if(e&&(null==this.componentTypes||OpenLayers.Util.indexOf(this.componentTypes,e.CLASS_NAME)>-1)){if(null!=t&&t<this.components.length){var r=this.components.slice(0,t),n=this.components.slice(t,this.components.length);r.push(e),this.components=r.concat(n)}else this.components.push(e);e.parent=this,this.clearBounds(),i=!0}return i},removeComponents:function(e){e instanceof Array||(e=[e]);for(var t=e.length-1;t>=0;--t)this.removeComponent(e[t])},removeComponent:function(e){OpenLayers.Util.removeItem(this.components,e),this.clearBounds()},getLength:function(){for(var e=0,t=0,i=this.components.length;t<i;t++)e+=this.components[t].getLength();return e},getArea:function(){for(var e=0,t=0,i=this.components.length;t<i;t++)e+=this.components[t].getArea();return e},getGeodesicArea:function(e){for(var t=0,i=0,r=this.components.length;i<r;i++)t+=this.components[i].getGeodesicArea(e);return t},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(e){for(var t=0,i=0,r=this.components.length;i<r;i++)t+=this.components[i].getGeodesicLength(e);return t},move:function(e,t){for(var i=0,r=this.components.length;i<r;i++)this.components[i].move(e,t)},rotate:function(e,t){for(var i=0,r=this.components.length;i<r;++i)this.components[i].rotate(e,t)},resize:function(e,t,i){for(var r=0;r<this.components.length;++r)this.components[r].resize(e,t,i);return this},distanceTo:function(e,t){for(var i,r,n=!(t&&t.edge===!1),s=n&&t&&t.details,a=Number.POSITIVE_INFINITY,o=0,l=this.components.length;o<l&&(i=this.components[o].distanceTo(e,t),distance=s?i.distance:i,!(distance<a&&(a=distance,r=i,0==a)));++o);return r},equals:function(e){var t=!0;if(e&&e.CLASS_NAME&&this.CLASS_NAME==e.CLASS_NAME)if(e.components instanceof Array&&e.components.length==this.components.length){for(var i=0,r=this.components.length;i<r;++i)if(!this.components[i].equals(e.components[i])){t=!1;break}}else t=!1;else t=!1;return t},transform:function(e,t){if(e&&t){for(var i=0,r=this.components.length;i<r;i++){this.components[i].transform(e,t)}this.bounds=null}return this},intersects:function(e){for(var t=!1,i=0,r=this.components.length;i<r&&!(t=e.intersects(this.components[i]));++i);return t},getVertices:function(e){for(var t=[],i=0,r=this.components.length;i<r;++i)Array.prototype.push.apply(t,this.components[i].getVertices(e));return t},CLASS_NAME:\"OpenLayers.Geometry.Collection\"}),OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(e,t){OpenLayers.Geometry.prototype.initialize.apply(this,arguments),this.x=parseFloat(e),this.y=parseFloat(t)},clone:function(e){return null==e&&(e=new OpenLayers.Geometry.Point(this.x,this.y)),OpenLayers.Util.applyDefaults(e,this),e},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(e,t){var i,r,n,s,a,o,l=!(t&&t.edge===!1),p=l&&t&&t.details;return e instanceof OpenLayers.Geometry.Point?(r=this.x,n=this.y,s=e.x,a=e.y,i=Math.sqrt(Math.pow(r-s,2)+Math.pow(n-a,2)),o=p?{x0:r,y0:n,x1:s,y1:a,distance:i}:i):(o=e.distanceTo(this,t),p&&(o={x0:o.x1,y0:o.y1,x1:o.x0,y1:o.y0,distance:o.distance})),o},equals:function(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t},toShortString:function(){return this.x+\", \"+this.y},move:function(e,t){this.x=this.x+e,this.y=this.y+t,this.clearBounds()},rotate:function(e,t){e*=Math.PI/180;var i=this.distanceTo(t),r=e+Math.atan2(this.y-t.y,this.x-t.x);this.x=t.x+i*Math.cos(r),this.y=t.y+i*Math.sin(r),this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(e,t,i){return i=void 0==i?1:i,this.x=t.x+e*i*(this.x-t.x),this.y=t.y+e*(this.y-t.y),this.clearBounds(),this},intersects:function(e){return\"OpenLayers.Geometry.Point\"==e.CLASS_NAME?this.equals(e):e.intersects(this)},transform:function(e,t){return e&&t&&(OpenLayers.Projection.transform(this,e,t),this.bounds=null),this},getVertices:function(e){return[this]},CLASS_NAME:\"OpenLayers.Geometry.Point\"}),OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(e,t,i,r){OpenLayers.Geometry.prototype.initialize.apply(this,arguments),this.x=e,this.y=t,this.width=i,this.height=r},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)},getLength:function(){return 2*this.width+2*this.height},getArea:function(){return this.width*this.height},CLASS_NAME:\"OpenLayers.Geometry.Rectangle\"}),OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Geometry.Surface\"}),OpenLayers.Layer.KaMapCache=OpenLayers.Class(OpenLayers.Layer.KaMap,{IMAGE_EXTENSIONS:{jpeg:\"jpg\",gif:\"gif\",png:\"png\",png8:\"png\",png24:\"png\",dithered:\"png\"},DEFAULT_FORMAT:\"jpeg\",initialize:function(e,t,i,r){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments),this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||DEFAULT_FORMAT]},getURL:function(e){e=this.adjustBounds(e);var t=this.map.getResolution(),i=Math.round(1e4*this.map.getScale())/1e4,r=Math.round(e.left/t),n=-Math.round(e.top/t),s=Math.floor(r/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w,a=Math.floor(n/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h,o=this.url;return o instanceof Array&&(o=this.selectUrl(paramsString,o)),[o,\"/\",this.params.map,\"/\",i,\"/\",this.params.g.replace(/\\s/g,\"_\"),\"/def/t\",a,\"/l\",s,\"/t\",n,\"l\",r,\".\",this.extension].join(\"\")},CLASS_NAME:\"OpenLayers.Layer.KaMapCache\"}),OpenLayers.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:!0,initialize:function(e,t,i,r){OpenLayers.Layer.MapServer.prototype.initialize.apply(this,arguments);OpenLayers.Console.warn(\"The OpenLayers.Layer.MapServer.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.MapServer class, passing it the option 'singleTile' as true.\")},clone:function(e){return null==e&&(e=new OpenLayers.Layer.MapServer.Untiled(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.MapServer.prototype.clone.apply(this,[e])},CLASS_NAME:\"OpenLayers.Layer.MapServer.Untiled\"}),OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:[\"beforefeatureadded\",\"beforefeaturesadded\",\"featureadded\",\"featuresadded\",\"beforefeatureremoved\",\"featureremoved\",\"featuresremoved\",\"beforefeatureselected\",\"featureselected\",\"featureunselected\",\"beforefeaturemodified\",\"featuremodified\",\"afterfeaturemodified\",\"vertexmodified\",\"sketchstarted\",\"sketchmodified\",\"sketchcomplete\",\"refresh\"],isBaseLayer:!1,isFixed:!1,isVector:!0,features: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,initialize:function(e,t){if(this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES),OpenLayers.Layer.prototype.initialize.apply(this,arguments),this.renderer&&this.renderer.supported()||this.assignRenderer(),this.renderer&&this.renderer.supported()||(this.renderer=null,this.displayError()),this.styleMap||(this.styleMap=new OpenLayers.StyleMap),this.features=[],this.selectedFeatures=[],this.unrenderedFeatures={},this.strategies)for(var i=0,r=this.strategies.length;i<r;i++)this.strategies[i].setLayer(this)},destroy:function(){if(this.strategies){var e,t,i;for(t=0,i=this.strategies.length;t<i;t++)e=this.strategies[t],e.autoDestroy&&e.destroy();this.strategies=null}this.protocol&&(this.protocol.autoDestroy&&this.protocol.destroy(),this.protocol=null),this.destroyFeatures(),this.features=null,this.selectedFeatures=null,this.unrenderedFeatures=null,this.renderer&&this.renderer.destroy(),this.renderer=null,this.geometryType=null,this.drawn=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},refresh:function(e){this.calculateInRange()&&this.visibility&&this.events.triggerEvent(\"refresh\",e)},assignRenderer:function(){for(var e=0,t=this.renderers.length;e<t;e++){var i=OpenLayers.Renderer[this.renderers[e]];if(i&&i.prototype.supported()){this.renderer=new i(this.div,this.rendererOptions);break}}},displayError:function(){this.reportError&&OpenLayers.Console.userError(OpenLayers.i18n(\"browserNotSupported\",{renderers:this.renderers.join(\"\\n\")}))},setMap:function(e){OpenLayers.Layer.prototype.setMap.apply(this,arguments),this.renderer?(this.renderer.map=this.map,this.renderer.setSize(this.map.getSize())):this.map.removeLayer(this)},afterAdd:function(){if(this.strategies){var e,t,i;for(t=0,i=this.strategies.length;t<i;t++)e=this.strategies[t],e.autoActivate&&e.activate()}},removeMap:function(e){if(this.strategies){var t,i,r;for(i=0,r=this.strategies.length;i<r;i++)t=this.strategies[i],t.autoActivate&&t.deactivate()}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments),this.renderer.setSize(this.map.getSize())},moveTo:function(e,t,i){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var r=!0;if(!i){this.renderer.root.style.visibility=\"hidden\",this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+\"px\",this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+\"px\";var n=this.map.getExtent();if(r=this.renderer.setExtent(n,t),this.renderer.root.style.visibility=\"visible\",navigator.userAgent.toLowerCase().indexOf(\"gecko\")!=-1&&(this.div.scrollLeft=this.div.scrollLeft),!t&&r)for(var s in this.unrenderedFeatures){var a=this.unrenderedFeatures[s];this.drawFeature(a)}}if(!this.drawn||t||!r){this.drawn=!0;for(var a,s=0,o=this.features.length;s<o;s++)this.renderer.locked=s!==o-1,a=this.features[s],this.drawFeature(a)}},display:function(e){OpenLayers.Layer.prototype.display.apply(this,arguments);var t=this.div.style.display;t!=this.renderer.root.style.display&&(this.renderer.root.style.display=t)},addFeatures:function(e,t){e instanceof Array||(e=[e]);var i=!t||!t.silent;if(i){var r={features:e};if(this.events.triggerEvent(\"beforefeaturesadded\",r)===!1)return;e=r.features}for(var n=0,s=e.length;n<s;n++){n!=e.length-1?this.renderer.locked=!0:this.renderer.locked=!1;var a=e[n];if(this.geometryType&&!(a.geometry instanceof this.geometryType)){throw OpenLayers.i18n(\"componentShouldBe\",{geomType:this.geometryType.prototype.CLASS_NAME})}if(this.features.push(a),a.layer=this,!a.style&&this.style&&(a.style=OpenLayers.Util.extend({},this.style)),i){if(this.events.triggerEvent(\"beforefeatureadded\",{feature:a})===!1)continue;this.preFeatureInsert(a)}this.drawFeature(a),i&&(this.events.triggerEvent(\"featureadded\",{feature:a}),this.onFeatureInsert(a))}i&&this.events.triggerEvent(\"featuresadded\",{features:e})},removeFeatures:function(e,t){if(e&&0!==e.length){e instanceof Array||(e=[e]),e===this.features&&(e=e.slice());for(var i=!t||!t.silent,r=e.length-1;r>=0;r--){0!=r&&e[r-1].geometry?this.renderer.locked=!0:this.renderer.locked=!1;var n=e[r];delete this.unrenderedFeatures[n.id],i&&this.events.triggerEvent(\"beforefeatureremoved\",{feature:n}),this.features=OpenLayers.Util.removeItem(this.features,n),n.layer=null,n.geometry&&this.renderer.eraseFeatures(n),OpenLayers.Util.indexOf(this.selectedFeatures,n)!=-1&&OpenLayers.Util.removeItem(this.selectedFeatures,n),i&&this.events.triggerEvent(\"featureremoved\",{feature:n})}i&&this.events.triggerEvent(\"featuresremoved\",{features:e})}},destroyFeatures:function(e,t){if(void 0==e&&(e=this.features),e){this.removeFeatures(e,t);for(var i=e.length-1;i>=0;i--)e[i].destroy()}},drawFeature:function(e,t){if(this.drawn){if(\"object\"!=typeof t){t||e.state!==OpenLayers.State.DELETE||(t=\"delete\");var i=t||e.renderIntent;t=e.style||this.style,t||(t=this.styleMap.createSymbolizer(e,i))}this.renderer.drawFeature(e,t)?delete this.unrenderedFeatures[e.id]:this.unrenderedFeatures[e.id]=e}},eraseFeatures:function(e){this.renderer.eraseFeatures(e)},getFeatureFromEvent:function(e){if(!this.renderer)return OpenLayers.Console.error(OpenLayers.i18n(\"getFeatureError\")),null;var t=this.renderer.getFeatureIdFromEvent(e);return this.getFeatureById(t)},getFeatureById:function(e){for(var t=null,i=0,r=this.features.length;i<r;++i)if(this.features[i].id==e){t=this.features[i];break}return t},onFeatureInsert:function(e){},preFeatureInsert:function(e){},getDataExtent:function(){var e=null;if(this.features&&this.features.length>0){e=new OpenLayers.Bounds;for(var t=0,i=this.features.length;t<i;t++)e.extend(this.features[t].geometry.getBounds())}return e},CLASS_NAME:\"OpenLayers.Layer.Vector\"}),OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS,{singleTile:!0,initialize:function(e,t,i,r){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);OpenLayers.Console.warn(\"The OpenLayers.Layer.WMS.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.WMS class, passing it the option 'singleTile' as true.\")},clone:function(e){return null==e&&(e=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options)),e=OpenLayers.Layer.WMS.prototype.clone.apply(this,[e])},CLASS_NAME:\"OpenLayers.Layer.WMS.Untiled\"}),OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:!1,click:!0,clickout:!0,toggle:!1,clickTolerance:5,hover:!1,box:!1,maxFeatures:10,features:null,hoverFeature:null,handlerOptions:null,handlers:null,hoverResponse:null,EVENT_TYPES:[\"featureselected\",\"featureunselected\",\"clickout\",\"beforefeatureselected\",\"hoverfeature\",\"outfeature\"],initialize:function(e){this.EVENT_TYPES=OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES),e.handlerOptions=e.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[e]),this.features={},this.handlers={},this.click&&(this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectSingle},this.handlerOptions.click||{})),this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:\"olHandlerBoxSelectFeature\"}))),this.hover&&(this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250})))},activate:function(){if(!this.active)for(var e in this.handlers)this.handlers[e].activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active)for(var e in this.handlers)this.handlers[e].deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(e){for(var t,i=this.features.length-1;i>=0;--i)t=this.features[i],e&&e.except==t||this.unselect(t)},selectSingle:function(e){OpenLayers.Element.addClass(this.map.viewPortDiv,\"olCursorWait\");var t=this.pixelToBounds(e.xy);this.setModifiers(e),this.request(t,{single:!0})},selectBox:function(e){if(e instanceof OpenLayers.Bounds){var t=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.left,e.bottom)),i=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.right,e.top)),r=new OpenLayers.Bounds(t.lon,t.lat,i.lon,i.lat);this.setModifiers(this.handlers.box.dragHandler.evt),this.request(r)}},selectHover:function(e){var t=this.pixelToBounds(e.xy);this.request(t,{single:!0,hover:!0})},cancelHover:function(){this.hoverResponse&&(this.protocol.abort(this.hoverResponse),this.hoverResponse=null)},request:function(e,t){t=t||{};var i=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:e}),r=this.protocol.read({maxFeatures:1==t.single?this.maxFeatures:void 0,filter:i,callback:function(i){1==i.code&&(i.features.length?1==t.single?this.selectBestFeature(i.features,e.getCenterLonLat(),t):this.select(i.features):t.hover?this.hoverSelect():(this.events.triggerEvent(\"clickout\"),this.clickout&&this.unselectAll())),OpenLayers.Element.removeClass(this.map.viewPortDiv,\"olCursorWait\")},scope:this});1==t.hover&&(this.hoverResponse=r)},selectBestFeature:function(e,t,i){if(i=i||{},e.length){for(var r,n,s,a=new OpenLayers.Geometry.Point(t.lon,t.lat),o=Number.MAX_VALUE,l=0;l<e.length&&(r=e[l],!(r.geometry&&(s=a.distanceTo(r.geometry,{edge:!1}))<o&&(o=s,n=r,0==o)));++l);1==i.hover?this.hoverSelect(n):this.select(n||e)}},setModifiers:function(e){this.modifiers={multiple:this.multiple||this.multipleKey&&e[this.multipleKey],toggle:this.toggle||this.toggleKey&&e[this.toggleKey]}},select:function(e){this.modifiers.multiple||this.modifiers.toggle||this.unselectAll(),e instanceof Array||(e=[e]);for(var t,i=0,r=e.length;i<r;++i)t=e[i],this.features[t.fid||t.id]?this.modifiers.toggle&&this.unselect(this.features[t.fid||t.id]):(cont=this.events.triggerEvent(\"beforefeatureselected\",{feature:t}),cont!==!1&&(this.features[t.fid||t.id]=t,this.events.triggerEvent(\"featureselected\",{feature:t})))},hoverSelect:function(e){var t=e?e.fid||e.id:null,i=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;i&&i!=t&&(this.events.triggerEvent(\"outfeature\",{feature:this.hoverFeature}),this.hoverFeature=null),t&&t!=i&&(this.events.triggerEvent(\"hoverfeature\",{feature:e}),this.hoverFeature=e)},unselect:function(e){delete this.features[e.fid||e.id],this.events.triggerEvent(\"featureunselected\",{feature:e})},unselectAll:function(){for(var e in this.features)this.unselect(this.features[e])},setMap:function(e){for(var t in this.handlers)this.handlers[t].setMap(e);OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(e){var t=e.add(-this.clickTolerance/2,this.clickTolerance/2),i=e.add(this.clickTolerance/2,-this.clickTolerance/2),r=this.map.getLonLatFromPixel(t),n=this.map.getLonLatFromPixel(i);return new OpenLayers.Bounds(r.lon,r.lat,n.lon,n.lat)},CLASS_NAME:\"OpenLayers.Control.GetFeature\"}),OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:[\"beforesnap\",\"snap\",\"unsnap\"],DEFAULTS:{tolerance:10,node:!0,edge:!0,vertex:!0},greedy:!0,precedence:[\"node\",\"vertex\",\"edge\"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(e){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES),OpenLayers.Control.prototype.initialize.apply(this,[e]),this.options=e||{},this.options.layer&&this.setLayer(this.options.layer);var t=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(t,this.DEFAULTS),this.setTargets(this.options.targets),0===this.targets.length&&this.layer&&this.addTargetLayer(this.layer),this.geoToleranceCache={}},setLayer:function(e){this.active?(this.deactivate(),this.layer=e,this.activate()):this.layer=e},setTargets:function(e){if(this.targets=[],e&&e.length)for(var t,i=0,r=e.length;i<r;++i)t=e[i],t instanceof OpenLayers.Layer.Vector?this.addTargetLayer(t):this.addTarget(t)},addTargetLayer:function(e){this.addTarget({layer:e})},addTarget:function(e){e=OpenLayers.Util.applyDefaults(e,this.defaults),e.nodeTolerance=e.nodeTolerance||e.tolerance,e.vertexTolerance=e.vertexTolerance||e.tolerance,e.edgeTolerance=e.edgeTolerance||e.tolerance,this.targets.push(e)},removeTargetLayer:function(e){for(var t,i=this.targets.length-1;i>=0;--i)t=this.targets[i],t.layer===e&&this.removeTarget(t)},removeTarget:function(e){return OpenLayers.Util.removeItem(this.targets,e)},activate:function(){var e=OpenLayers.Control.prototype.activate.call(this);return e&&this.layer&&this.layer.events&&this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this}),e},deactivate:function(){var e=OpenLayers.Control.prototype.deactivate.call(this);return e&&this.layer&&this.layer.events&&this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this}),this.feature=null,this.point=null,e},onSketchModified:function(e){this.feature=e.feature,this.considerSnapping(e.vertex,e.vertex)},onVertexModified:function(e){this.feature=e.feature;var t=this.layer.map.getLonLatFromViewPortPx(e.pixel);this.considerSnapping(e.vertex,new OpenLayers.Geometry.Point(t.lon,t.lat))},considerSnapping:function(e,t){for(var i,r,n={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null},s=!1,a=0,o=this.targets.length;a<o;++a)if(r=this.targets[a],i=this.testTarget(r,t)){if(this.greedy){n=i,n.target=r,s=!0;break}(i.rank<n.rank||i.rank===n.rank&&i.dist<n.dist)&&(n=i,n.target=r,s=!0)}if(s){this.events.triggerEvent(\"beforesnap\",{point:e,x:n.x,y:n.y,distance:n.dist,layer:n.target.layer,snapType:this.precedence[n.rank]})!==!1?(e.x=n.x,e.y=n.y,this.point=e,this.events.triggerEvent(\"snap\",{point:e,snapType:this.precedence[n.rank],layer:n.target.layer,distance:n.dist})):s=!1}this.point&&!s&&(e.x=t.x,e.y=t.y,this.point=null,this.events.triggerEvent(\"unsnap\",{point:e}))},testTarget:function(e,t){for(var i,r,n,s,a,o,l,p={node:this.getGeoTolerance(e.nodeTolerance),vertex:this.getGeoTolerance(e.vertexTolerance),edge:this.getGeoTolerance(e.edgeTolerance)},h=Math.max(p.node,p.vertex,p.edge),u={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY},y=!1,c=e.layer.features,d=this.precedence.length,m=new OpenLayers.LonLat(t.x,t.y),f=0,L=c.length;f<L;++f)if((i=c[f])!==this.feature&&!i._sketch&&i.state!==OpenLayers.State.DELETE&&(!e.filter||e.filter.evaluate(i.attributes))&&i.atPoint(m,h,h))for(var g=0,v=Math.min(u.rank+1,d);g<v;++g)if(r=this.precedence[g],e[r])if(\"edge\"===r){if(a=i.geometry.distanceTo(t,{details:!0}),(o=a.distance)<=p[r]&&o<u.dist){u={rank:g,dist:o,x:a.x0,y:a.y0},y=!0;break}}else{n=i.geometry.getVertices(\"node\"===r),l=!1;for(var O=0,S=n.length;O<S;++O)s=n[O],(o=s.distanceTo(t))<=p[r]&&(g<u.rank||g===u.rank&&o<u.dist)&&(u={rank:g,dist:o,x:s.x,y:s.y},y=!0,l=!0);if(l)break}return y?u:null},getGeoTolerance:function(e){var t=this.layer.map.getResolution();t!==this.resolution&&(this.resolution=t,this.geoToleranceCache={});var i=this.geoToleranceCache[e];return void 0===i&&(i=e*t,this.geoToleranceCache[e]=i),i},destroy:function(){this.active&&this.deactivate(),delete this.layer,delete this.targets,OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:\"OpenLayers.Control.Snapping\"}),OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:\"1.0.0\",version:null,parser:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},write:function(e,t){var i=t&&t.version||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=i){var r=OpenLayers.Format.Filter[\"v\"+i.replace(/\\./g,\"_\")];if(!r)throw\"Can't find a Filter parser for version \"+i;this.parser=new r(this.options)}return this.parser.write(e)},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=this.version;if(t||(t=this.defaultVersion),!this.parser||this.parser.VERSION!=t){var i=OpenLayers.Format.Filter[\"v\"+t.replace(/\\./g,\"_\")];if(!i)throw\"Can't find a Filter parser for version \"+t;this.parser=new i(this.options)}return this.parser.read(e)},CLASS_NAME:\"OpenLayers.Format.Filter\"}),OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:\"1.0.0\",version:null,namedLayersAsArray:!1,parser:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},write:function(e,t){var i=t&&t.version||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=i){var r=OpenLayers.Format.SLD[\"v\"+i.replace(/\\./g,\"_\")];if(!r)throw\"Can't find a SLD parser for version \"+i;this.parser=new r(this.options)}var n=this.parser.write(e);return OpenLayers.Format.XML.prototype.write.apply(this,[n])},read:function(e,t){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var i=e.documentElement,r=this.version;if(r||(r=i.getAttribute(\"version\"))||(r=this.defaultVersion),!this.parser||this.parser.VERSION!=r){var n=OpenLayers.Format.SLD[\"v\"+r.replace(/\\./g,\"_\")];if(!n)throw\"Can't find a SLD parser for version \"+r;this.parser=new n(this.options)}return this.parser.read(e,t)},CLASS_NAME:\"OpenLayers.Format.SLD\"}),OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:!0,initialize:function(e){e=e||{},e.extractStyles!==!1&&(e.defaultStyle={externalGraphic:OpenLayers.Util.getImagesLocation()+\"marker.png\",graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5}),OpenLayers.Format.prototype.initialize.apply(this,[e])},read:function(e){for(var t,i=e.split(\"\\n\"),r=[],n=0;n<i.length-1;n++){var s=i[n].replace(/^\\s*/,\"\").replace(/\\s*$/,\"\");if(\"#\"!=s.charAt(0))if(t){for(var a=s.split(\"\\t\"),o=new OpenLayers.Geometry.Point(0,0),l={},p=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null,h=!1,u=0;u<a.length;u++)if(a[u])if(\"point\"==t[u]){var y=a[u].split(\",\");o.y=parseFloat(y[0]),o.x=parseFloat(y[1]),h=!0}else if(\"lat\"==t[u])o.y=parseFloat(a[u]),h=!0;else if(\"lon\"==t[u])o.x=parseFloat(a[u]),h=!0;else if(\"title\"==t[u])l.title=a[u];else if(\"image\"==t[u]||\"icon\"==t[u]&&p)p.externalGraphic=a[u];else if(\"iconSize\"==t[u]&&p){var c=a[u].split(\",\");p.graphicWidth=parseFloat(c[0]),p.graphicHeight=parseFloat(c[1])}else if(\"iconOffset\"==t[u]&&p){var d=a[u].split(\",\");p.graphicXOffset=parseFloat(d[0]),p.graphicYOffset=parseFloat(d[1])}else\"description\"==t[u]?l.description=a[u]:\"overflow\"==t[u]?l.overflow=a[u]:l[t[u]]=a[u];if(h){this.internalProjection&&this.externalProjection&&o.transform(this.externalProjection,this.internalProjection);var m=new OpenLayers.Feature.Vector(o,l,p);r.push(m)}}else t=s.split(\"\\t\")}return r},CLASS_NAME:\"OpenLayers.Format.Text\"}),OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:[\"OpenLayers.Geometry.Point\"],initialize:function(e){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(e,t){this.addComponent(e,t)},removePoint:function(e){this.removeComponent(e)},CLASS_NAME:\"OpenLayers.Geometry.MultiPoint\"}),OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:!1,drawing:!1,mouseDown:!1,lastDown:null,lastUp:null,persist:!1,layerOptions:null,initialize:function(e,t,i){i&&i.layerOptions&&i.layerOptions.styleMap||(this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.default,{})),OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments))return!1;var e=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:function(){return!0}},this.layerOptions);return this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,e),this.map.addLayer(this.layer),!0},createFeature:function(e){var t=this.map.getLonLatFromPixel(e);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat)),this.callback(\"create\",[this.point.geometry,this.point]),this.point.geometry.clearBounds(),this.layer.addFeatures([this.point],{silent:!0})},deactivate:function(){return!!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.drawing&&this.cancel(),this.destroyFeature(),null!=this.layer.map&&this.layer.destroy(!1),this.layer=null,!0)},destroyFeature:function(){this.layer&&this.layer.destroyFeatures(),this.point=null},finalize:function(e){var t=e?\"cancel\":\"done\";this.drawing=!1,this.mouseDown=!1,this.lastDown=null,this.lastUp=null,this.callback(t,[this.geometryClone()]),!e&&this.persist||this.destroyFeature()},cancel:function(){this.finalize(!0)},click:function(e){return OpenLayers.Event.stop(e),!1},dblclick:function(e){return OpenLayers.Event.stop(e),!1},modifyFeature:function(e){var t=this.map.getLonLatFromPixel(e);this.point.geometry.x=t.lon,this.point.geometry.y=t.lat,this.callback(\"modify\",[this.point.geometry,this.point]),this.point.geometry.clearBounds(),this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var e=this.point&&this.point.geometry;return e&&this.multi&&(e=new OpenLayers.Geometry.MultiPoint([e])),e},geometryClone:function(){var e=this.getGeometry();return e&&e.clone()},mousedown:function(e){return!this.checkModifiers(e)||(!(!this.lastDown||!this.lastDown.equals(e.xy))||(this.drawing=!0,null==this.lastDown?(this.persist&&this.destroyFeature(),this.createFeature(e.xy)):this.modifyFeature(e.xy),this.lastDown=e.xy,!1))},mousemove:function(e){return this.drawing&&this.modifyFeature(e.xy),!0},mouseup:function(e){return!this.drawing||(this.finalize(),!1)},CLASS_NAME:\"OpenLayers.Handler.Point\"}),OpenLayers.Layer.GML=OpenLayers.Class(OpenLayers.Layer.Vector,{loaded:!1,format:null,formatOptions:null,initialize:function(e,t,i){var r=[];r.push(e,i),OpenLayers.Layer.Vector.prototype.initialize.apply(this,r),this.url=t},setVisibility:function(e,t){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments),this.visibility&&!this.loaded&&this.loadGML()},moveTo:function(e,t,i){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments),this.visibility&&!this.loaded&&this.loadGML()},loadGML:function(){this.loaded||(this.events.triggerEvent(\"loadstart\"),OpenLayers.Request.GET({\nurl:this.url,success:this.requestSuccess,failure:this.requestFailure,scope:this}),this.loaded=!0)},setUrl:function(e){this.url=e,this.destroyFeatures(),this.loaded=!1,this.loadGML()},requestSuccess:function(e){var t=e.responseXML;t&&t.documentElement||(t=e.responseText);var i={};OpenLayers.Util.extend(i,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(i.externalProjection=this.projection,i.internalProjection=this.map.getProjectionObject());var r=this.format?new this.format(i):new OpenLayers.Format.GML(i);this.addFeatures(r.read(t)),this.events.triggerEvent(\"loadend\")},requestFailure:function(e){OpenLayers.Console.userError(OpenLayers.i18n(\"errorLoadingGML\",{url:this.url})),this.events.triggerEvent(\"loadend\")},CLASS_NAME:\"OpenLayers.Layer.GML\"}),OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,initialize:function(e,t){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},addNodes:function(e){if(e.length<2)return void OpenLayers.Console.error(\"At least two point features have to be added to createa line from\");for(var t,i,r,n=new Array(e.length-1),s=0,a=e.length;s<a;s++){if(t=e[s],r=t.geometry){if(\"OpenLayers.Geometry.Point\"!=r.CLASS_NAME)return void OpenLayers.Console.error(\"Only features with point geometries are supported.\")}else{var o=t.lonlat;r=new OpenLayers.Geometry.Point(o.lon,o.lat)}if(s>0){var l=null!=this.dataFrom?e[s+this.dataFrom].data||e[s+this.dataFrom].attributes:null,p=new OpenLayers.Geometry.LineString([i,r]);n[s-1]=new OpenLayers.Feature.Vector(p,l)}i=r}this.addFeatures(n)},CLASS_NAME:\"OpenLayers.Layer.PointTrack\"}),OpenLayers.Layer.PointTrack.dataFrom={SOURCE_NODE:-1,TARGET_NODE:0},OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:!1,layers:null,initialize:function(e,t){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(e){for(var t,i=this.layers,r=0;r<i.length;r++)if(t=i[r].getFeatureFromEvent(e))return t},setMap:function(e){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments),this.collectRoots(),e.events.register(\"changelayer\",this,this.handleChangeLayer)},removeMap:function(e){e.events.unregister(\"changelayer\",this,this.handleChangeLayer),this.resetRoots(),OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){for(var e,t=0;t<this.map.layers.length;++t)e=this.map.layers[t],OpenLayers.Util.indexOf(this.layers,e)!=-1&&e.renderer.moveRoot(this.renderer)},resetRoots:function(){for(var e,t=0;t<this.layers.length;++t)e=this.layers[t],this.renderer&&e.renderer.getRenderLayerId()==this.id&&this.renderer.moveRoot(e.renderer)},handleChangeLayer:function(e){var t=e.layer;\"order\"==e.property&&OpenLayers.Util.indexOf(this.layers,t)!=-1&&(this.resetRoots(),this.collectRoots())},CLASS_NAME:\"OpenLayers.Layer.Vector.RootContainer\"}),OpenLayers.Layer.WFS=OpenLayers.Class(OpenLayers.Layer.Vector,OpenLayers.Layer.Markers,{isBaseLayer:!1,tile:null,ratio:2,DEFAULT_PARAMS:{service:\"WFS\",version:\"1.0.0\",request:\"GetFeature\"},featureClass:null,format:null,formatObject:null,formatOptions:null,vectorMode:!0,encodeBBOX:!1,extractAttributes:!1,initialize:function(e,t,i,r){void 0==r&&(r={}),!r.featureClass&&OpenLayers.Layer.Vector&&OpenLayers.Feature.Vector||(this.vectorMode=!1),OpenLayers.Util.extend(r,{reportError:!1});var n=[];n.push(e,r),OpenLayers.Layer.Vector.prototype.initialize.apply(this,n),this.renderer&&this.vectorMode||(this.vectorMode=!1,r.featureClass||(r.featureClass=OpenLayers.Feature.WFS),OpenLayers.Layer.Markers.prototype.initialize.apply(this,n)),this.params&&this.params.typename&&!this.options.typename&&(this.options.typename=this.params.typename),this.options.geometry_column||(this.options.geometry_column=\"the_geom\"),this.params=OpenLayers.Util.applyDefaults(i,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)),this.url=t},destroy:function(){this.vectorMode?OpenLayers.Layer.Vector.prototype.destroy.apply(this,arguments):OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments),this.tile&&this.tile.destroy(),this.tile=null,this.ratio=null,this.featureClass=null,this.format=null,this.formatObject&&this.formatObject.destroy&&this.formatObject.destroy(),this.formatObject=null,this.formatOptions=null,this.vectorMode=null,this.encodeBBOX=null,this.extractAttributes=null},setMap:function(e){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);var t={extractAttributes:this.extractAttributes};OpenLayers.Util.extend(t,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(t.externalProjection=this.projection,t.internalProjection=this.map.getProjectionObject()),this.formatObject=this.format?new this.format(t):new OpenLayers.Format.GML(t)}else OpenLayers.Layer.Markers.prototype.setMap.apply(this,arguments)},moveTo:function(e,t,i){if(this.vectorMode?OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments):OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),i)return!1;if(t&&this.vectorMode&&this.renderer.clear(),this.options.minZoomLevel&&(OpenLayers.Console.warn(OpenLayers.i18n(\"minZoomLevelError\")),this.map.getZoom()<this.options.minZoomLevel))return null;null==e&&(e=this.map.getExtent());var r=null==this.tile,n=!r&&!this.tile.bounds.containsBounds(e);if(t||r||!i&&n){var s=e.getCenterLonLat(),a=e.getWidth()*this.ratio,o=e.getHeight()*this.ratio,l=new OpenLayers.Bounds(s.lon-a/2,s.lat-o/2,s.lon+a/2,s.lat+o/2),p=this.map.getSize();p.w=p.w*this.ratio,p.h=p.h*this.ratio;var h=new OpenLayers.LonLat(l.left,l.top),u=this.map.getLayerPxFromLonLat(h),y=this.getFullRequestString(),c=null,d=this.params.filter||this.params.FILTER;if(c=d?{FILTER:d}:{BBOX:this.encodeBBOX?l.toBBOX():l.toArray()},this.map&&!this.projection.equals(this.map.getProjectionObject())){var m=l.clone();m.transform(this.map.getProjectionObject(),this.projection),d||(c.BBOX=this.encodeBBOX?m.toBBOX():m.toArray())}y+=\"&\"+OpenLayers.Util.getParameterString(c),this.tile?(this.vectorMode?(this.destroyFeatures(),this.renderer.clear()):this.clearMarkers(),this.removeTileMonitoringHooks(this.tile),this.tile.destroy(),this.tile=null,this.tile=new OpenLayers.Tile.WFS(this,u,l,y,p),this.addTileMonitoringHooks(this.tile),this.tile.draw()):(this.tile=new OpenLayers.Tile.WFS(this,u,l,y,p),this.addTileMonitoringHooks(this.tile),this.tile.draw())}},addTileMonitoringHooks:function(e){e.onLoadStart=function(){this==this.layer.tile&&this.layer.events.triggerEvent(\"loadstart\")},e.events.register(\"loadstart\",e,e.onLoadStart),e.onLoadEnd=function(){this==this.layer.tile&&(this.layer.events.triggerEvent(\"tileloaded\"),this.layer.events.triggerEvent(\"loadend\"))},e.events.register(\"loadend\",e,e.onLoadEnd),e.events.register(\"unload\",e,e.onLoadEnd)},removeTileMonitoringHooks:function(e){e.unload(),e.events.un({loadstart:e.onLoadStart,loadend:e.onLoadEnd,unload:e.onLoadEnd,scope:e})},onMapResize:function(){this.vectorMode?OpenLayers.Layer.Vector.prototype.onMapResize.apply(this,arguments):OpenLayers.Layer.Markers.prototype.onMapResize.apply(this,arguments)},display:function(){this.vectorMode?OpenLayers.Layer.Vector.prototype.display.apply(this,arguments):OpenLayers.Layer.Markers.prototype.display.apply(this,arguments)},mergeNewParams:function(e){var t=OpenLayers.Util.upperCaseObject(e),i=[t];return OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,i)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.WFS(this.name,this.url,this.params,this.options)),e=this.vectorMode?OpenLayers.Layer.Vector.prototype.clone.apply(this,[e]):OpenLayers.Layer.Markers.prototype.clone.apply(this,[e])},getFullRequestString:function(e,t){var i=this.projection.getCode()||this.map.getProjection();return this.params.SRS=\"none\"==i?null:i,OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},commit:function(){if(!this.writer){var e={};this.map&&!this.projection.equals(this.map.getProjectionObject())&&(e.externalProjection=this.projection,e.internalProjection=this.map.getProjectionObject()),this.writer=new OpenLayers.Format.WFS(e,this)}var t=this.writer.write(this.features);OpenLayers.Request.POST({url:this.url,data:t,success:this.commitSuccess,failure:this.commitFailure,scope:this})},commitSuccess:function(e){var t=e.responseText;if(t.indexOf(\"SUCCESS\")!=-1){this.commitReport(OpenLayers.i18n(\"commitSuccess\",{response:t}));for(var i=0;i<this.features.length;i++)this.features[i].state=null}else t.indexOf(\"FAILED\")==-1&&t.indexOf(\"Exception\")==-1||this.commitReport(OpenLayers.i18n(\"commitFailed\",{response:t}))},commitFailure:function(e){},commitReport:function(e,t){OpenLayers.Console.userError(e)},refresh:function(){this.tile&&(this.vectorMode?(this.renderer.clear(),this.features.length=0):(this.clearMarkers(),this.markers.length=0),this.tile.draw())},getDataExtent:function(){return this.vectorMode?OpenLayers.Layer.Vector.prototype.getDataExtent.apply(this):OpenLayers.Layer.Markers.prototype.getDataExtent.apply(this)},setOpacity:function(e){this.vectorMode?OpenLayers.Layer.Vector.prototype.setOpacity.apply(this,[e]):OpenLayers.Layer.Markers.prototype.setOpacity.apply(this,[e])},CLASS_NAME:\"OpenLayers.Layer.WFS\"}),OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,initialize:function(e){OpenLayers.Strategy.prototype.initialize.apply(this,[e])},activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&(this.layer.events.on({moveend:this.update,scope:this}),this.layer.events.on({refresh:this.update,scope:this})),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&(this.layer.events.un({moveend:this.update,scope:this}),this.layer.events.un({refresh:this.update,scope:this})),e},update:function(e){var t=this.getMapBounds();(e&&e.force||this.invalidBounds(t))&&(this.calculateBounds(t),this.resolution=this.layer.map.getResolution(),this.triggerRead())},getMapBounds:function(){var e=this.layer.map.getExtent();return this.layer.projection.equals(this.layer.map.getProjectionObject())||(e=e.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)),e},invalidBounds:function(e){e||(e=this.getMapBounds());var t=!this.bounds||!this.bounds.containsBounds(e);if(!t&&this.resFactor){var i=this.resolution/this.layer.map.getResolution();t=i>=this.resFactor||i<=1/this.resFactor}return t},calculateBounds:function(e){e||(e=this.getMapBounds());var t=e.getCenterLonLat(),i=e.getWidth()*this.ratio,r=e.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(t.lon-i/2,t.lat-r/2,t.lon+i/2,t.lat+r/2)},triggerRead:function(){this.layer.protocol.abort(this.response),this.layer.events.triggerEvent(\"loadstart\"),this.response=this.layer.protocol.read({filter:this.createFilter(),callback:this.merge,scope:this})},createFilter:function(){var e=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});return this.layer.filter&&(e=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,e]})),e},merge:function(e){this.layer.destroyFeatures();var t=e.features;if(t&&t.length>0){var i=this.layer.projection,r=this.layer.map.getProjectionObject();if(!r.equals(i))for(var n,s=0,a=t.length;s<a;++s)(n=t[s].geometry)&&n.transform(i,r);this.layer.addFeatures(t)}this.layer.events.triggerEvent(\"loadend\")},CLASS_NAME:\"OpenLayers.Strategy.BBOX\"}),OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:[\"beforefeaturehighlighted\",\"featurehighlighted\",\"featureunhighlighted\"],multipleKey:null,toggleKey:null,multiple:!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(e,t){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES),OpenLayers.Control.prototype.initialize.apply(this,[t]),null===this.scope&&(this.scope=this),e instanceof Array?(this.layers=e,this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+\"_container\",{layers:e})):this.layer=e;var i={click:this.clickFeature,clickout:this.clickoutFeature};this.hover&&(i.over=this.overFeature,i.out=this.outFeature),this.callbacks=OpenLayers.Util.extend(i,this.callbacks),this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})},this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:\"olHandlerBoxSelectFeature\"}))},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments),this.layers&&this.layer.destroy()},activate:function(){return this.active||(this.layers&&this.map.addLayer(this.layer),this.handlers.feature.activate(),this.box&&this.handlers.box&&this.handlers.box.activate()),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.active&&(this.handlers.feature.deactivate(),this.handlers.box&&this.handlers.box.deactivate(),this.layers&&this.map.removeLayer(this.layer)),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(e){for(var t,i,r=this.layers||[this.layer],n=0;n<r.length;++n){t=r[n];for(var s=t.selectedFeatures.length-1;s>=0;--s)i=t.selectedFeatures[s],e&&e.except==i||this.unselect(i)}},clickFeature:function(e){if(!this.hover){OpenLayers.Util.indexOf(e.layer.selectedFeatures,e)>-1?this.toggleSelect()?this.unselect(e):this.multipleSelect()||this.unselectAll({except:e}):(this.multipleSelect()||this.unselectAll({except:e}),this.select(e))}},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(e){!this.hover&&this.clickout&&this.unselectAll()},overFeature:function(e){var t=e.layer;this.hover&&(this.highlightOnly?this.highlight(e):OpenLayers.Util.indexOf(t.selectedFeatures,e)==-1&&this.select(e))},outFeature:function(e){if(this.hover)if(this.highlightOnly){if(e._lastHighlighter==this.id)if(e._prevHighlighter&&e._prevHighlighter!=this.id){delete e._lastHighlighter;var t=this.map.getControl(e._prevHighlighter);t&&t.highlight(e)}else this.unhighlight(e)}else this.unselect(e)},highlight:function(e){var t=e.layer;if(this.events.triggerEvent(\"beforefeaturehighlighted\",{feature:e})!==!1){e._prevHighlighter=e._lastHighlighter,e._lastHighlighter=this.id;var i=this.selectStyle||this.renderIntent;t.drawFeature(e,i),this.events.triggerEvent(\"featurehighlighted\",{feature:e})}},unhighlight:function(e){var t=e.layer;e._lastHighlighter=e._prevHighlighter,delete e._prevHighlighter,t.drawFeature(e,e.style||e.layer.style||\"default\"),this.events.triggerEvent(\"featureunhighlighted\",{feature:e})},select:function(e){var t=this.onBeforeSelect.call(this.scope,e),i=e.layer;t!==!1&&(t=i.events.triggerEvent(\"beforefeatureselected\",{feature:e}))!==!1&&(i.selectedFeatures.push(e),this.highlight(e),i.events.triggerEvent(\"featureselected\",{feature:e}),this.onSelect.call(this.scope,e))},unselect:function(e){var t=e.layer;this.unhighlight(e),OpenLayers.Util.removeItem(t.selectedFeatures,e),t.events.triggerEvent(\"featureunselected\",{feature:e}),this.onUnselect.call(this.scope,e)},selectBox:function(e){if(e instanceof OpenLayers.Bounds){var t=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.left,e.bottom)),i=this.map.getLonLatFromPixel(new OpenLayers.Pixel(e.right,e.top)),r=new OpenLayers.Bounds(t.lon,t.lat,i.lon,i.lat);this.multipleSelect()||this.unselectAll();var n=this.multiple;this.multiple=!0;for(var s,a=this.layers||[this.layer],o=0;o<a.length;++o){s=a[o];for(var l=0,p=s.features.length;l<p;++l){var h=s.features[l];(null==this.geometryTypes||OpenLayers.Util.indexOf(this.geometryTypes,h.geometry.CLASS_NAME)>-1)&&r.toGeometry().intersects(h.geometry)&&OpenLayers.Util.indexOf(s.selectedFeatures,h)==-1&&this.select(h)}}this.multiple=n}},setMap:function(e){this.handlers.feature.setMap(e),this.box&&this.handlers.box.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Control.SelectFeature\"}),OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:\"http://www.opengis.net/ogc\",gml:\"http://www.opengis.net/gml\",xlink:\"http://www.w3.org/1999/xlink\",xsi:\"http://www.w3.org/2001/XMLSchema-instance\"},defaultPrefix:\"ogc\",schemaLocation:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){var t={};return this.readers.ogc.Filter.apply(this,[e,t]),t.filter},readers:{ogc:{Filter:function(e,t){var i={fids:[],filters:[]};this.readChildNodes(e,i),i.fids.length>0?t.filter=new OpenLayers.Filter.FeatureId({fids:i.fids}):i.filters.length>0&&(t.filter=i.filters[0])},FeatureId:function(e,t){var i=e.getAttribute(\"fid\");i&&t.fids.push(i)},And:function(e,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(e,i),t.filters.push(i)},Or:function(e,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(e,i),t.filters.push(i)},Not:function(e,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThan:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThan:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThanOrEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThanOrEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsBetween:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLike:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(e,i);var r=e.getAttribute(\"wildCard\"),n=e.getAttribute(\"singleChar\"),s=e.getAttribute(\"escape\");i.value2regex(r,n,s),t.filters.push(i)},Literal:function(e,t){t.value=OpenLayers.String.numericIf(this.getChildValue(e))},PropertyName:function(e,t){t.property=this.getChildValue(e)},LowerBoundary:function(e,t){t.lowerBoundary=OpenLayers.String.numericIf(this.readOgcExpression(e))},UpperBoundary:function(e,t){t.upperBoundary=OpenLayers.String.numericIf(this.readOgcExpression(e))},Intersects:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(e,t){t.distance=parseInt(this.getChildValue(e)),t.distanceUnits=e.getAttribute(\"units\")}}},readSpatial:function(e,t,i){var r=new OpenLayers.Filter.Spatial({type:i});this.readChildNodes(e,r),r.value=r.components[0],delete r.components,t.filters.push(r)},readOgcExpression:function(e){var t={};this.readChildNodes(e,t);var i=t.value;return i||(i=this.getChildValue(e)),i},write:function(e){return this.writers.ogc.Filter.apply(this,[e])},writers:{ogc:{Filter:function(e){var t=this.createElementNSPlus(\"ogc:Filter\");if(\"FeatureId\"==e.CLASS_NAME.split(\".\").pop())for(var i=0;i<e.fids.length;++i)this.writeNode(\"FeatureId\",e.fids[i],t);else this.writeNode(this.getFilterType(e),e,t);return t},FeatureId:function(e){return this.createElementNSPlus(\"ogc:FeatureId\",{attributes:{fid:e}})},And:function(e){for(var t,i=this.createElementNSPlus(\"ogc:And\"),r=0;r<e.filters.length;++r)t=e.filters[r],this.writeNode(this.getFilterType(t),t,i);return i},Or:function(e){for(var t,i=this.createElementNSPlus(\"ogc:Or\"),r=0;r<e.filters.length;++r)t=e.filters[r],this.writeNode(this.getFilterType(t),t,i);return i},Not:function(e){var t=this.createElementNSPlus(\"ogc:Not\"),i=e.filters[0];return this.writeNode(this.getFilterType(i),i,t),t},PropertyIsLessThan:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsLessThan\");return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},PropertyIsGreaterThan:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsGreaterThan\");return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},PropertyIsLessThanOrEqualTo:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsLessThanOrEqualTo\");return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},PropertyIsGreaterThanOrEqualTo:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsGreaterThanOrEqualTo\");return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},PropertyIsBetween:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsBetween\");return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"LowerBoundary\",e,t),this.writeNode(\"UpperBoundary\",e,t),t},PropertyIsLike:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsLike\",{attributes:{wildCard:\"*\",singleChar:\".\",escape:\"!\"}});return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.regex2value(),t),t},PropertyName:function(e){return this.createElementNSPlus(\"ogc:PropertyName\",{value:e.property})},Literal:function(e){return this.createElementNSPlus(\"ogc:Literal\",{value:e})},LowerBoundary:function(e){var t=this.createElementNSPlus(\"ogc:LowerBoundary\");return this.writeNode(\"Literal\",e.lowerBoundary,t),t},UpperBoundary:function(e){var t=this.createElementNSPlus(\"ogc:UpperBoundary\");return this.writeNode(\"Literal\",e.upperBoundary,t),t},INTERSECTS:function(e){return this.writeSpatial(e,\"Intersects\")},WITHIN:function(e){return this.writeSpatial(e,\"Within\")},CONTAINS:function(e){return this.writeSpatial(e,\"Contains\")},DWITHIN:function(e){var t=this.writeSpatial(e,\"DWithin\");return this.writeNode(\"Distance\",e,t),t},Distance:function(e){return this.createElementNSPlus(\"ogc:Distance\",{attributes:{units:e.distanceUnits},value:e.distance})}}},getFilterType:function(e){var t=this.filterMap[e.type];if(!t)throw\"Filter writing not supported for rule type: \"+e.type;return t},filterMap:{\"&&\":\"And\",\"||\":\"Or\",\"!\":\"Not\",\"==\":\"PropertyIsEqualTo\",\"!=\":\"PropertyIsNotEqualTo\",\"<\":\"PropertyIsLessThan\",\">\":\"PropertyIsGreaterThan\",\"<=\":\"PropertyIsLessThanOrEqualTo\",\">=\":\"PropertyIsGreaterThanOrEqualTo\",\"..\":\"PropertyIsBetween\",\"~\":\"PropertyIsLike\",BBOX:\"BBOX\",DWITHIN:\"DWITHIN\",WITHIN:\"WITHIN\",CONTAINS:\"CONTAINS\",INTERSECTS:\"INTERSECTS\"},CLASS_NAME:\"OpenLayers.Format.Filter.v1\"}),OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:[\"OpenLayers.Geometry.Point\"],initialize:function(e){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var e=0;if(this.components&&this.components.length>1)for(var t=1,i=this.components.length;t<i;t++)e+=this.components[t-1].distanceTo(this.components[t]);return e},getGeodesicLength:function(e){var t=this;if(e){var i=new OpenLayers.Projection(\"EPSG:4326\");i.equals(e)||(t=this.clone().transform(e,i))}var r=0;if(t.components&&t.components.length>1)for(var n,s,a=1,o=t.components.length;a<o;a++)n=t.components[a-1],s=t.components[a],r+=OpenLayers.Util.distVincenty({lon:n.x,lat:n.y},{lon:s.x,lat:s.y});return 1e3*r},CLASS_NAME:\"OpenLayers.Geometry.Curve\"}),OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:!0,toggle:!0,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,modified:!1,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(e,t){this.layer=e,this.vertices=[],this.virtualVertices=[],this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer()),this.virtualStyle.fillOpacity=.3,this.virtualStyle.strokeOpacity=.3,this.deleteCodes=[46,68],this.mode=OpenLayers.Control.ModifyFeature.RESHAPE,OpenLayers.Control.prototype.initialize.apply(this,[t]),this.deleteCodes instanceof Array||(this.deleteCodes=[this.deleteCodes]);var i=this,r={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};this.selectControl=new OpenLayers.Control.SelectFeature(e,r);var n={geometryTypes:[\"OpenLayers.Geometry.Point\"],snappingOptions:this.snappingOptions,onStart:function(e,t){i.dragStart.apply(i,[e,t])},onDrag:function(e,t){i.dragVertex.apply(i,[e,t])},onComplete:function(e){i.dragComplete.apply(i,[e])}};this.dragControl=new OpenLayers.Control.DragFeature(e,n);var s={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,s)}},destroy:function(){this.layer=null,this.selectControl.destroy(),this.dragControl.destroy(),OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return this.selectControl.activate()&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){var e=!1;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.layer.removeFeatures(this.vertices,{silent:!0}),this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.vertices=[],this.dragControl.deactivate(),this.feature&&this.feature.geometry&&this.feature.layer&&this.selectControl.unselect.apply(this.selectControl,[this.feature]),this.selectControl.deactivate(),this.handlers.keyboard.deactivate(),e=!0),e},beforeSelectFeature:function(e){return this.layer.events.triggerEvent(\"beforefeaturemodified\",{feature:e})},selectFeature:function(e){this.feature=e,this.modified=!1,this.resetVertices(),this.dragControl.activate(),this.onModificationStart(this.feature)},unselectFeature:function(e){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.feature=null,this.dragControl.deactivate(),this.onModificationEnd(e),this.layer.events.triggerEvent(\"afterfeaturemodified\",{feature:e,modified:this.modified}),this.modified=!1},dragStart:function(e,t){e==this.feature||e.geometry.parent||e==this.dragHandle||e==this.radiusHandle||(this.feature&&this.selectControl.clickFeature.apply(this.selectControl,[this.feature]),null!=this.geometryTypes&&OpenLayers.Util.indexOf(this.geometryTypes,e.geometry.CLASS_NAME)==-1||(this.selectControl.clickFeature.apply(this.selectControl,[e]),this.dragControl.overFeature.apply(this.dragControl,[e]),this.dragControl.lastPixel=t,this.dragControl.handlers.drag.started=!0,this.dragControl.handlers.drag.start=t,this.dragControl.handlers.drag.last=t))},dragVertex:function(e,t){this.modified=!0,\"OpenLayers.Geometry.Point\"==this.feature.geometry.CLASS_NAME?(this.feature!=e&&(this.feature=e),this.layer.events.triggerEvent(\"vertexmodified\",{vertex:e.geometry,feature:this.feature,pixel:t})):(e._index?(e.geometry.parent.addComponent(e.geometry,e._index),delete e._index,OpenLayers.Util.removeItem(this.virtualVertices,e),this.vertices.push(e)):e==this.dragHandle?(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null)):e!==this.radiusHandle&&this.layer.events.triggerEvent(\"vertexmodified\",{vertex:e.geometry,feature:this.feature,pixel:t}),this.virtualVertices.length>0&&(this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.layer.drawFeature(this.feature,this.selectControl.renderIntent)),this.layer.drawFeature(e)},dragComplete:function(e){this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent(\"featuremodified\",{feature:this.feature})},setFeatureState:function(){this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE&&(this.feature.state=OpenLayers.State.UPDATE)},resetVertices:function(){this.dragControl.feature&&this.dragControl.outFeature(this.dragControl.feature),this.vertices.length>0&&(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[]),this.virtualVertices.length>0&&(this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),this.dragHandle=null),this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null),this.feature&&\"OpenLayers.Geometry.Point\"!=this.feature.geometry.CLASS_NAME&&(this.mode&OpenLayers.Control.ModifyFeature.DRAG&&this.collectDragHandle(),this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE)&&this.collectRadiusHandle(),this.mode&OpenLayers.Control.ModifyFeature.RESHAPE&&(this.mode&OpenLayers.Control.ModifyFeature.RESIZE||this.collectVertices()))},handleKeypress:function(e){var t=e.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,t)!=-1){var i=this.dragControl.feature;i&&OpenLayers.Util.indexOf(this.vertices,i)!=-1&&!this.dragControl.handlers.drag.dragging&&i.geometry.parent&&(i.geometry.parent.removeComponent(i.geometry),this.layer.drawFeature(this.feature,this.selectControl.renderIntent),this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent(\"featuremodified\",{feature:this.feature}))}},collectVertices:function(){function e(i){var r,n,s,a;if(\"OpenLayers.Geometry.Point\"==i.CLASS_NAME)n=new OpenLayers.Feature.Vector(i),n._sketch=!0,t.vertices.push(n);else{var o=i.components.length;for(\"OpenLayers.Geometry.LinearRing\"==i.CLASS_NAME&&(o-=1),r=0;r<o;++r)s=i.components[r],\"OpenLayers.Geometry.Point\"==s.CLASS_NAME?(n=new OpenLayers.Feature.Vector(s),n._sketch=!0,t.vertices.push(n)):e(s);if(\"OpenLayers.Geometry.MultiPoint\"!=i.CLASS_NAME)for(r=0,a=i.components.length;r<a-1;++r){var l=i.components[r],p=i.components[r+1];if(\"OpenLayers.Geometry.Point\"==l.CLASS_NAME&&\"OpenLayers.Geometry.Point\"==p.CLASS_NAME){var h=(l.x+p.x)/2,u=(l.y+p.y)/2,y=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(h,u),null,t.virtualStyle);y.geometry.parent=i,y._index=r+1,y._sketch=!0,t.virtualVertices.push(y)}}}}this.vertices=[],this.virtualVertices=[];var t=this;e.call(this,this.feature.geometry),this.layer.addFeatures(this.virtualVertices,{silent:!0}),this.layer.addFeatures(this.vertices,{silent:!0})},collectDragHandle:function(){var e=this.feature.geometry,t=e.getBounds().getCenterLonLat(),i=new OpenLayers.Geometry.Point(t.lon,t.lat),r=new OpenLayers.Feature.Vector(i);i.move=function(t,i){OpenLayers.Geometry.Point.prototype.move.call(this,t,i),e.move(t,i)},r._sketch=!0,this.dragHandle=r,this.layer.addFeatures([this.dragHandle],{silent:!0})},collectRadiusHandle:function(){\nvar e=this.feature.geometry,t=e.getBounds(),i=t.getCenterLonLat(),r=new OpenLayers.Geometry.Point(i.lon,i.lat),n=new OpenLayers.Geometry.Point(t.right,t.bottom),s=new OpenLayers.Feature.Vector(n),a=this.mode&OpenLayers.Control.ModifyFeature.RESIZE,o=this.mode&OpenLayers.Control.ModifyFeature.RESHAPE,l=this.mode&OpenLayers.Control.ModifyFeature.ROTATE;n.move=function(t,i){OpenLayers.Geometry.Point.prototype.move.call(this,t,i);var n=this.x-r.x,s=this.y-r.y,p=n-t,h=s-i;if(l){var u=Math.atan2(h,p),y=Math.atan2(s,n),c=y-u;c*=180/Math.PI,e.rotate(c,r)}if(a){var d,m;if(o)d=s/h,m=n/p/d;else{var f=Math.sqrt(p*p+h*h);d=Math.sqrt(n*n+s*s)/f}e.resize(d,r,m)}},s._sketch=!0,this.radiusHandle=s,this.layer.addFeatures([this.radiusHandle],{silent:!0})},setMap:function(e){this.selectControl.setMap(e),this.dragControl.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Control.ModifyFeature\"}),OpenLayers.Control.ModifyFeature.RESHAPE=1,OpenLayers.Control.ModifyFeature.RESIZE=2,OpenLayers.Control.ModifyFeature.ROTATE=4,OpenLayers.Control.ModifyFeature.DRAG=8,OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(e){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(e){this.components&&this.components.length>2&&OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)},intersects:function(e){var t=!1,i=e.CLASS_NAME;if(\"OpenLayers.Geometry.LineString\"==i||\"OpenLayers.Geometry.LinearRing\"==i||\"OpenLayers.Geometry.Point\"==i){var r,n=this.getSortedSegments();r=\"OpenLayers.Geometry.Point\"==i?[{x1:e.x,y1:e.y,x2:e.x,y2:e.y}]:e.getSortedSegments();var s,a,o,l,p,h,u,y;e:for(var c=0,d=n.length;c<d;++c){s=n[c],a=s.x1,o=s.x2,l=s.y1,p=s.y2;for(var m=0,f=r.length;m<f&&(h=r[m],!(h.x1>o));++m)if(!(h.x2<a)&&(u=h.y1,y=h.y2,!(Math.min(u,y)>Math.max(l,p))&&!(Math.max(u,y)<Math.min(l,p))&&OpenLayers.Geometry.segmentsIntersect(s,h))){t=!0;break e}}}else t=e.intersects(this);return t},getSortedSegments:function(){function e(e,t){return e.x1-t.x1}for(var t=this.components.length-1,i=new Array(t),r=0;r<t;++r)point1=this.components[r],point2=this.components[r+1],point1.x<point2.x?i[r]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}:i[r]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y};return i.sort(e)},splitWithSegment:function(e,t){for(var i,r,n,s,a=!(t&&t.edge===!1),o=t&&t.tolerance,l=[],p=this.getVertices(),h=[],u=[],y=!1,c={point:!0,tolerance:o},d=null,m=0,f=p.length-2;m<=f;++m)if(i=p[m],h.push(i.clone()),r=p[m+1],s={x1:i.x,y1:i.y,x2:r.x,y2:r.y},(n=OpenLayers.Geometry.segmentsIntersect(e,s,c))instanceof OpenLayers.Geometry.Point&&(!!(n.x===e.x1&&n.y===e.y1||n.x===e.x2&&n.y===e.y2||n.equals(i)||n.equals(r))||a)){if(n.equals(u[u.length-1])||u.push(n.clone()),0===m&&n.equals(i))continue;if(n.equals(r))continue;y=!0,n.equals(i)||h.push(n),l.push(new OpenLayers.Geometry.LineString(h)),h=[n.clone()]}if(y&&(h.push(r.clone()),l.push(new OpenLayers.Geometry.LineString(h))),u.length>0){var L=e.x1<e.x2?1:-1,g=e.y1<e.y2?1:-1;d={lines:l,points:u.sort(function(e,t){return L*e.x-L*t.x||g*e.y-g*t.y})}}return d},split:function(e,t){var i,r,n,s,a=null,o=t&&t.mutual;if(e instanceof OpenLayers.Geometry.LineString){var l,p,h,u,y,c,d=this.getVertices(),m=[];n=[];for(var f=0,L=d.length-2;f<=L;++f){l=d[f],p=d[f+1],h={x1:l.x,y1:l.y,x2:p.x,y2:p.y},s=s||[e],o&&m.push(l.clone());for(var g=0;g<s.length;++g)if((u=s[g].splitWithSegment(h,t))&&(y=u.lines,y.length>0&&(y.unshift(g,1),Array.prototype.splice.apply(s,y),g+=y.length-2),o))for(var v=0,O=u.points.length;v<O;++v)c=u.points[v],c.equals(l)||(m.push(c),n.push(new OpenLayers.Geometry.LineString(m)),m=c.equals(p)?[]:[c.clone()])}o&&n.length>0&&m.length>0&&(m.push(p.clone()),n.push(new OpenLayers.Geometry.LineString(m)))}else a=e.splitWith(this,t);return s&&s.length>1?r=!0:s=[],n&&n.length>1?i=!0:n=[],(r||i)&&(a=o?[n,s]:s),a},splitWith:function(e,t){return e.split(this,t)},getVertices:function(e){return e===!0?[this.components[0],this.components[this.components.length-1]]:e===!1?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(e,t){var i,r=!(t&&t.edge===!1),n=r&&t&&t.details,s={},a=Number.POSITIVE_INFINITY;if(e instanceof OpenLayers.Geometry.Point){for(var o,l=this.getSortedSegments(),p=e.x,h=e.y,u=0,y=l.length;u<y;++u)if(o=l[u],i=OpenLayers.Geometry.distanceToSegment(e,o),i.distance<a){if(a=i.distance,s=i,0===a)break}else if(o.x2>p&&(h>o.y1&&h<o.y2||h<o.y1&&h>o.y2))break;s=n?{distance:s.distance,x0:s.x,y0:s.y,x1:p,y1:h}:s.distance}else if(e instanceof OpenLayers.Geometry.LineString){var c,d,m,f,L,g=this.getSortedSegments(),v=e.getSortedSegments(),O=v.length,S={point:!0};e:for(var u=0,y=g.length;u<y;++u){c=g[u],f=c.x1,L=c.y1;for(var C=0;C<O;++C){if(d=v[C],m=OpenLayers.Geometry.segmentsIntersect(c,d,S)){a=0,s={distance:0,x0:m.x,y0:m.y,x1:m.x,y1:m.y};break e}i=OpenLayers.Geometry.distanceToSegment({x:f,y:L},d),i.distance<a&&(a=i.distance,s={distance:a,x0:f,y0:L,x1:i.x,y1:i.y})}}if(n||(s=s.distance),0!==a&&c){i=e.distanceTo(new OpenLayers.Geometry.Point(c.x2,c.y2),t);var b=n?i.distance:i;b<a&&(s=n?{distance:a,x0:i.x1,y0:i.y1,x1:i.x0,y1:i.y0}:b)}}else s=e.distanceTo(this,t),n&&(s={distance:s.distance,x0:s.x1,y0:s.y1,x1:s.x0,y1:s.y0});return s},CLASS_NAME:\"OpenLayers.Geometry.LineString\"}),OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{extractWaypoints:!0,extractTracks:!0,extractRoutes:!0,extractAttributes:!0,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=[];if(this.extractTracks)for(var i=e.getElementsByTagName(\"trk\"),r=0,n=i.length;r<n;r++){var s={};this.extractAttributes&&(s=this.parseAttributes(i[r]));for(var a=this.getElementsByTagNameNS(i[r],i[r].namespaceURI,\"trkseg\"),o=0,l=a.length;o<l;o++){var p=this.extractSegment(a[o],\"trkpt\");t.push(new OpenLayers.Feature.Vector(p,s))}}if(this.extractRoutes)for(var h=e.getElementsByTagName(\"rte\"),u=0,y=h.length;u<y;u++){var s={};this.extractAttributes&&(s=this.parseAttributes(h[u]));var c=this.extractSegment(h[u],\"rtept\");t.push(new OpenLayers.Feature.Vector(c,s))}if(this.extractWaypoints)for(var d=e.getElementsByTagName(\"wpt\"),m=0,n=d.length;m<n;m++){var s={};this.extractAttributes&&(s=this.parseAttributes(d[m]));var f=new OpenLayers.Geometry.Point(d[m].getAttribute(\"lon\"),d[m].getAttribute(\"lat\"));t.push(new OpenLayers.Feature.Vector(f,s))}if(this.internalProjection&&this.externalProjection)for(var L=0,g=t.length;L<g;L++)t[L].geometry.transform(this.externalProjection,this.internalProjection);return t},extractSegment:function(e,t){for(var i=this.getElementsByTagNameNS(e,e.namespaceURI,t),r=[],n=0,s=i.length;n<s;n++)r.push(new OpenLayers.Geometry.Point(i[n].getAttribute(\"lon\"),i[n].getAttribute(\"lat\")));return new OpenLayers.Geometry.LineString(r)},parseAttributes:function(e){for(var t={},i=e.firstChild;i;){if(1==i.nodeType){var r=i.firstChild;3!=r.nodeType&&4!=r.nodeType||(name=i.prefix?i.nodeName.split(\":\")[1]:i.nodeName,\"trkseg\"!=name&&\"rtept\"!=name&&(t[name]=r.nodeValue))}i=i.nextSibling}return t},CLASS_NAME:\"OpenLayers.Format.GPX\"}),OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:[\"OpenLayers.Geometry.Point\"],initialize:function(e){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(e,t){var i=!1,r=this.components.pop();null==t&&e.equals(r)||(i=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments));var n=this.components[0];return OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[n]),i},removeComponent:function(e){if(this.components.length>4){this.components.pop(),OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var t=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[t])}},move:function(e,t){for(var i=0,r=this.components.length;i<r-1;i++)this.components[i].move(e,t)},rotate:function(e,t){for(var i=0,r=this.components.length;i<r-1;++i)this.components[i].rotate(e,t)},resize:function(e,t,i){for(var r=0,n=this.components.length;r<n-1;++r)this.components[r].resize(e,t,i);return this},transform:function(e,t){if(e&&t){for(var i=0,r=this.components.length;i<r-1;i++){this.components[i].transform(e,t)}this.bounds=null}return this},getCentroid:function(){if(this.components&&this.components.length>2){for(var e=0,t=0,i=0;i<this.components.length-1;i++){var r=this.components[i],n=this.components[i+1];e+=(r.x+n.x)*(r.x*n.y-n.x*r.y),t+=(r.y+n.y)*(r.x*n.y-n.x*r.y)}var s=-1*this.getArea(),a=e/(6*s),o=t/(6*s)}return new OpenLayers.Geometry.Point(a,o)},getArea:function(){var e=0;if(this.components&&this.components.length>2){for(var t=0,i=0,r=this.components.length;i<r-1;i++){var n=this.components[i],s=this.components[i+1];t+=(n.x+s.x)*(s.y-n.y)}e=-t/2}return e},getGeodesicArea:function(e){var t=this;if(e){var i=new OpenLayers.Projection(\"EPSG:4326\");i.equals(e)||(t=this.clone().transform(e,i))}var r=0,n=t.components&&t.components.length;if(n>2){for(var s,a,o=0;o<n-1;o++)s=t.components[o],a=t.components[o+1],r+=OpenLayers.Util.rad(a.x-s.x)*(2+Math.sin(OpenLayers.Util.rad(s.y))+Math.sin(OpenLayers.Util.rad(a.y)));r=6378137*r*6378137/2}return r},containsPoint:function(e){for(var t,i,r,n,s,a,o,l=OpenLayers.Number.limitSigDigs,p=l(e.x,14),h=l(e.y,14),u=this.components.length-1,y=0,c=0;c<u;++c)if(t=this.components[c],r=l(t.x,14),n=l(t.y,14),i=this.components[c+1],s=l(i.x,14),a=l(i.y,14),n!=a){if((o=l(function(e,t,i,r,n){return((t-r)*e+(r*i-t*n))/(i-n)}(h,r,n,s,a),14))==p&&(n<a&&h>=n&&h<=a||n>a&&h<=n&&h>=a)){y=-1;break}o<=p||r!=s&&(o<Math.min(r,s)||o>Math.max(r,s))||(n<a&&h>=n&&h<a||n>a&&h<n&&h>=a)&&++y}else if(h==n&&(r<=s&&p>=r&&p<=s||r>=s&&p<=r&&p>=s)){y=-1;break}return y==-1?1:!!(1&y)},intersects:function(e){var t=!1;if(\"OpenLayers.Geometry.Point\"==e.CLASS_NAME)t=this.containsPoint(e);else if(\"OpenLayers.Geometry.LineString\"==e.CLASS_NAME)t=e.intersects(this);else if(\"OpenLayers.Geometry.LinearRing\"==e.CLASS_NAME)t=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[e]);else for(var i=0,r=e.components.length;i<r&&!(t=e.components[i].intersects(this));++i);return t},getVertices:function(e){return e===!0?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:\"OpenLayers.Geometry.LinearRing\"}),OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:[\"OpenLayers.Geometry.LineString\"],initialize:function(e){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(e,t){for(var i,r,n,s,a,o=null,l=t&&t.mutual,p=[],h=[e],u=0,y=this.components.length;u<y;++u){r=this.components[u],s=!1;for(var c=0;c<h.length;++c)if(i=r.split(h[c],t)){if(l){n=i[0];for(var d=0,m=n.length;d<m;++d)0===d&&p.length?p[p.length-1].addComponent(n[d]):p.push(new OpenLayers.Geometry.MultiLineString([n[d]]));s=!0,i=i[1]}if(i.length){i.unshift(c,1),Array.prototype.splice.apply(h,i);break}}s||(p.length?p[p.length-1].addComponent(r.clone()):p=[new OpenLayers.Geometry.MultiLineString(r.clone())])}return p&&p.length>1?s=!0:p=[],h&&h.length>1?a=!0:h=[],(s||a)&&(o=l?[p,h]:h),o},splitWith:function(e,t){var i,r,n,s,a,o,l,p=null,h=t&&t.mutual;if(e instanceof OpenLayers.Geometry.LineString){l=[],o=[e];for(var u=0,y=this.components.length;u<y;++u){a=!1,r=this.components[u];for(var c=0;c<o.length;++c)if(i=o[c].split(r,t)){h&&(n=i[0],n.length&&(n.unshift(c,1),Array.prototype.splice.apply(o,n),c+=n.length-2),i=i[1],0===i.length&&(i=[r.clone()]));for(var d=0,m=i.length;d<m;++d)0===d&&l.length?l[l.length-1].addComponent(i[d]):l.push(new OpenLayers.Geometry.MultiLineString([i[d]]));a=!0}a||(l.length?l[l.length-1].addComponent(r.clone()):l=[new OpenLayers.Geometry.MultiLineString([r.clone()])])}}else p=e.split(this);return o&&o.length>1?s=!0:o=[],l&&l.length>1?a=!0:l=[],(s||a)&&(p=h?[o,l]:l),p},CLASS_NAME:\"OpenLayers.Geometry.MultiLineString\"}),OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:!1,freehandToggle:\"shiftKey\",initialize:function(e,t,i){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(e){var t=this.control.map.getLonLatFromPixel(e);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat)),this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry])),this.callback(\"create\",[this.point.geometry,this.getSketch()]),this.point.geometry.clearBounds(),this.layer.addFeatures([this.line,this.point],{silent:!0})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this),this.line=null},removePoint:function(){this.point&&this.layer.removeFeatures([this.point])},addPoint:function(e){this.layer.removeFeatures([this.point]);var t=this.control.map.getLonLatFromPixel(e);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat)),this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length),this.callback(\"point\",[this.point.geometry,this.getGeometry()]),this.callback(\"modify\",[this.point.geometry,this.getSketch()]),this.drawFeature()},freehandMode:function(e){return this.freehandToggle&&e[this.freehandToggle]?!this.freehand:this.freehand},modifyFeature:function(e){var t=this.control.map.getLonLatFromPixel(e);this.point.geometry.x=t.lon,this.point.geometry.y=t.lat,this.callback(\"modify\",[this.point.geometry,this.getSketch()]),this.point.geometry.clearBounds(),this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style),this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var e=this.line&&this.line.geometry;return e&&this.multi&&(e=new OpenLayers.Geometry.MultiLineString([e])),e},mousedown:function(e){return(!this.lastDown||!this.lastDown.equals(e.xy))&&(null==this.lastDown?(this.persist&&this.destroyFeature(),this.createFeature(e.xy)):null!=this.lastUp&&this.lastUp.equals(e.xy)||this.addPoint(e.xy),this.mouseDown=!0,this.lastDown=e.xy,this.drawing=!0,!1)},mousemove:function(e){return this.drawing&&(this.mouseDown&&this.freehandMode(e)?this.addPoint(e.xy):this.modifyFeature(e.xy)),!0},mouseup:function(e){return this.mouseDown=!1,!this.drawing||(this.freehandMode(e)?(this.removePoint(),this.finalize()):(null==this.lastUp&&this.addPoint(e.xy),this.lastUp=e.xy),!1)},dblclick:function(e){if(!this.freehandMode(e)){var t=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[t]),this.removePoint(),this.finalize()}return!1},CLASS_NAME:\"OpenLayers.Handler.Path\"}),OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:[\"beforesplit\",\"split\",\"aftersplit\"],layer:null,source:null,sourceOptions:null,tolerance:null,edge:!0,deferDelete:!1,mutual:!0,targetFilter:null,sourceFilter:null,handler:null,initialize:function(e){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES),OpenLayers.Control.prototype.initialize.apply(this,[e]),this.options=e||{},this.options.source&&this.setSource(this.options.source)},setSource:function(e){this.active?(this.deactivate(),this.handler&&(this.handler.destroy(),delete this.handler),this.source=e,this.activate()):this.source=e},activate:function(){var e=OpenLayers.Control.prototype.activate.call(this);return e&&(this.source?this.source.events&&this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this}):(this.handler||(this.handler=new OpenLayers.Handler.Path(this,{done:function(e){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(e)})}},{layerOptions:this.sourceOptions})),this.handler.activate())),e},deactivate:function(){var e=OpenLayers.Control.prototype.deactivate.call(this);return e&&this.source&&this.source.events&&this.layer.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this}),e},onSketchComplete:function(e){return this.feature=null,!this.considerSplit(e.feature)},afterFeatureModified:function(e){if(e.modified){var t=e.feature;(t.geometry instanceof OpenLayers.Geometry.LineString||t.geometry instanceof OpenLayers.Geometry.MultiLineString)&&(this.feature=e.feature,this.considerSplit(e.feature))}},removeByGeometry:function(e,t){for(var i=0,r=e.length;i<r;++i)if(e[i].geometry===t){e.splice(i,1);break}},isEligible:function(e){return e.state!==OpenLayers.State.DELETE&&(e.geometry instanceof OpenLayers.Geometry.LineString||e.geometry instanceof OpenLayers.Geometry.MultiLineString)&&this.feature!==e&&(!this.targetFilter||this.targetFilter.evaluate(e.attributes))},considerSplit:function(e){if(sourceSplit=!1,targetSplit=!1,!this.sourceFilter||this.sourceFilter.evaluate(e.attributes)){for(var t,i,r,n,s,a,o=this.layer&&this.layer.features||[],l=[],p=[],h=this.layer===this.source&&this.mutual,u={edge:this.edge,tolerance:this.tolerance,mutual:h},y=[e.geometry],c=0,d=o.length;c<d;++c)if(r=o[c],this.isEligible(r)){n=[r.geometry];for(var m=0;m<y.length;++m){s=y[m];for(var f=0;f<n.length;++f)t=n[f],s.getBounds().intersectsBounds(t.getBounds())&&(i=s.split(t,u))&&this.events.triggerEvent(\"beforesplit\",{source:e,target:r})!==!1&&(h&&(a=i[0],a.length>1&&(a.unshift(m,1),Array.prototype.splice.apply(y,a),m+=a.length-3),i=i[1]),i.length>1&&(i.unshift(f,1),Array.prototype.splice.apply(n,i),f+=i.length-3))}n&&n.length>1&&(this.geomsToFeatures(r,n),this.events.triggerEvent(\"split\",{original:r,features:n}),Array.prototype.push.apply(l,n),p.push(r),targetSplit=!0)}if(y&&y.length>1&&(this.geomsToFeatures(e,y),this.events.triggerEvent(\"split\",{original:e,features:y}),Array.prototype.push.apply(l,y),p.push(e),sourceSplit=!0),sourceSplit||targetSplit){if(this.deferDelete){for(var L,g=[],c=0,d=p.length;c<d;++c)L=p[c],L.state===OpenLayers.State.INSERT?g.push(L):(L.state=OpenLayers.State.DELETE,this.layer.drawFeature(L));this.layer.destroyFeatures(g,{silent:!0});for(var c=0,d=l.length;c<d;++c)l[c].state=OpenLayers.State.INSERT}else this.layer.destroyFeatures(p,{silent:!0});this.layer.addFeatures(l,{silent:!0}),this.events.triggerEvent(\"aftersplit\",{source:e,features:l})}}return sourceSplit},geomsToFeatures:function(e,t){var i=e.clone();delete i.geometry;for(var r,n=0,s=t.length;n<s;++n)r=i.clone(),r.geometry=t[n],r.state=OpenLayers.State.INSERT,t[n]=r},destroy:function(){this.active&&this.deactivate(),OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:\"OpenLayers.Control.Split\"}),OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:[\"OpenLayers.Geometry.LinearRing\"],initialize:function(e){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var e=0;if(this.components&&this.components.length>0){e+=Math.abs(this.components[0].getArea());for(var t=1,i=this.components.length;t<i;t++)e-=Math.abs(this.components[t].getArea())}return e},getGeodesicArea:function(e){var t=0;if(this.components&&this.components.length>0){t+=Math.abs(this.components[0].getGeodesicArea(e));for(var i=1,r=this.components.length;i<r;i++)t-=Math.abs(this.components[i].getGeodesicArea(e))}return t},containsPoint:function(e){var t=this.components.length,i=!1;if(t>0&&1!==(i=this.components[0].containsPoint(e))&&i&&t>1)for(var r,n=1;n<t;++n)if(r=this.components[n].containsPoint(e)){i=1===r&&1;break}return i},intersects:function(e){var t,i,r=!1;if(\"OpenLayers.Geometry.Point\"==e.CLASS_NAME)r=this.containsPoint(e);else if(\"OpenLayers.Geometry.LineString\"==e.CLASS_NAME||\"OpenLayers.Geometry.LinearRing\"==e.CLASS_NAME){for(t=0,i=this.components.length;t<i&&!(r=e.intersects(this.components[t]));++t);if(!r)for(t=0,i=e.components.length;t<i&&!(r=this.containsPoint(e.components[t]));++t);}else for(t=0,i=e.components.length;t<i&&!(r=this.intersects(e.components[t]));++t);if(!r&&\"OpenLayers.Geometry.Polygon\"==e.CLASS_NAME){var n=this.components[0];for(t=0,i=n.components.length;t<i&&!(r=e.containsPoint(n.components[t]));++t);}return r},distanceTo:function(e,t){var i=!(t&&t.edge===!1);return!i&&this.intersects(e)?0:OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[e,t])},CLASS_NAME:\"OpenLayers.Geometry.Polygon\"}),OpenLayers.Geometry.Polygon.createRegularPolygon=function(e,t,i,r){var n=Math.PI*(1/i-.5);r&&(n+=r/180*Math.PI);for(var s,a,o,l=[],p=0;p<i;++p)s=n+2*p*Math.PI/i,a=e.x+t*Math.cos(s),o=e.y+t*Math.sin(s),l.push(new OpenLayers.Geometry.Point(a,o));var h=new OpenLayers.Geometry.LinearRing(l);return new OpenLayers.Geometry.Polygon([h])},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,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},createGeometryFromItem:function(e){var t=this.getElementsByTagNameNS(e,this.georssns,\"point\"),i=this.getElementsByTagNameNS(e,this.geons,\"lat\"),r=this.getElementsByTagNameNS(e,this.geons,\"long\"),n=this.getElementsByTagNameNS(e,this.georssns,\"line\"),s=this.getElementsByTagNameNS(e,this.georssns,\"polygon\"),a=this.getElementsByTagNameNS(e,this.georssns,\"where\"),o=this.getElementsByTagNameNS(e,this.georssns,\"box\");if(t.length>0||i.length>0&&r.length>0){var l;t.length>0?(l=OpenLayers.String.trim(t[0].firstChild.nodeValue).split(/\\s+/),2!=l.length&&(l=OpenLayers.String.trim(t[0].firstChild.nodeValue).split(/\\s*,\\s*/))):l=[parseFloat(i[0].firstChild.nodeValue),parseFloat(r[0].firstChild.nodeValue)];var p=new OpenLayers.Geometry.Point(parseFloat(l[1]),parseFloat(l[0]))}else if(n.length>0){for(var t,h=OpenLayers.String.trim(this.concatChildValues(n[0])).split(/\\s+/),u=[],y=0,c=h.length;y<c;y+=2)t=new OpenLayers.Geometry.Point(parseFloat(h[y+1]),parseFloat(h[y])),u.push(t);p=new OpenLayers.Geometry.LineString(u)}else if(s.length>0){for(var t,h=OpenLayers.String.trim(this.concatChildValues(s[0])).split(/\\s+/),u=[],y=0,c=h.length;y<c;y+=2)t=new OpenLayers.Geometry.Point(parseFloat(h[y+1]),parseFloat(h[y])),u.push(t);p=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(u)])}else if(a.length>0){this.gmlParser||(this.gmlParser=new OpenLayers.Format.GML({xy:this.xy}));var d=this.gmlParser.parseFeature(a[0]);p=d.geometry}else if(o.length>0){var t,h=OpenLayers.String.trim(o[0].firstChild.nodeValue).split(/\\s+/),u=[];h.length>3&&(t=new OpenLayers.Geometry.Point(parseFloat(h[1]),parseFloat(h[0])),u.push(t),t=new OpenLayers.Geometry.Point(parseFloat(h[1]),parseFloat(h[2])),u.push(t),t=new OpenLayers.Geometry.Point(parseFloat(h[3]),parseFloat(h[2])),u.push(t),t=new OpenLayers.Geometry.Point(parseFloat(h[3]),parseFloat(h[0])),u.push(t),t=new OpenLayers.Geometry.Point(parseFloat(h[1]),parseFloat(h[0])),u.push(t)),p=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(u)])}return p&&this.internalProjection&&this.externalProjection&&p.transform(this.externalProjection,this.internalProjection),p},createFeatureFromItem:function(e){var t=this.createGeometryFromItem(e),i=this.getChildValue(e,\"*\",\"title\",this.featureTitle),r=this.getChildValue(e,\"*\",\"description\",this.getChildValue(e,\"*\",\"content\",this.getChildValue(e,\"*\",\"summary\",this.featureDescription))),n=this.getChildValue(e,\"*\",\"link\");if(!n)try{n=this.getElementsByTagNameNS(e,\"*\",\"link\")[0].getAttribute(\"href\")}catch(e){n=null}var s=this.getChildValue(e,\"*\",\"id\",null),a={title:i,description:r,link:n},o=new OpenLayers.Feature.Vector(t,a);return o.fid=s,o},getChildValue:function(e,t,i,r){var n=this.getElementsByTagNameNS(e,t,i);return n&&n[0]&&n[0].firstChild&&n[0].firstChild.nodeValue?n[0].firstChild.nodeValue:void 0==r?\"\":r},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=null;t=this.getElementsByTagNameNS(e,\"*\",\"item\"),0==t.length&&(t=this.getElementsByTagNameNS(e,\"*\",\"entry\"));for(var i=t.length,r=new Array(i),n=0;n<i;n++)r[n]=this.createFeatureFromItem(t[n]);return r},write:function(e){var t;if(e instanceof Array){t=this.createElementNS(this.rssns,\"rss\");for(var i=0,r=e.length;i<r;i++)t.appendChild(this.createFeatureXML(e[i]))}else t=this.createFeatureXML(e);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(e){var t=this.buildGeometryNode(e.geometry),i=this.createElementNS(this.rssns,\"item\"),r=this.createElementNS(this.rssns,\"title\");r.appendChild(this.createTextNode(e.attributes.title?e.attributes.title:\"\"));var n=this.createElementNS(this.rssns,\"description\");if(n.appendChild(this.createTextNode(e.attributes.description?e.attributes.description:\"\")),i.appendChild(r),i.appendChild(n),e.attributes.link){var s=this.createElementNS(this.rssns,\"link\");s.appendChild(this.createTextNode(e.attributes.link)),i.appendChild(s)}for(var a in e.attributes)if(\"link\"!=a&&\"title\"!=a&&\"description\"!=a){var o=this.createTextNode(e.attributes[a]),l=a;a.search(\":\")!=-1&&(l=a.split(\":\")[1]);var p=this.createElementNS(this.featureNS,\"feature:\"+l);p.appendChild(o),i.appendChild(p)}return i.appendChild(t),i},buildGeometryNode:function(e){this.internalProjection&&this.externalProjection&&(e=e.clone(),e.transform(this.internalProjection,this.externalProjection));var t;if(\"OpenLayers.Geometry.Polygon\"==e.CLASS_NAME)t=this.createElementNS(this.georssns,\"georss:polygon\"),t.appendChild(this.buildCoordinatesNode(e.components[0]));else if(\"OpenLayers.Geometry.LineString\"==e.CLASS_NAME)t=this.createElementNS(this.georssns,\"georss:line\"),t.appendChild(this.buildCoordinatesNode(e));else{if(\"OpenLayers.Geometry.Point\"!=e.CLASS_NAME)throw\"Couldn't parse \"+e.CLASS_NAME;t=this.createElementNS(this.georssns,\"georss:point\"),t.appendChild(this.buildCoordinatesNode(e))}return t},buildCoordinatesNode:function(e){var t=null;e.components&&(t=e.components);var i;if(t){for(var r=t.length,n=new Array(r),s=0;s<r;s++)n[s]=t[s].y+\" \"+t[s].x;i=n.join(\" \")}else i=e.y+\" \"+e.x;return this.createTextNode(i)},CLASS_NAME:\"OpenLayers.Format.GeoRSS\"}),OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{kmlns:\"http://earth.google.com/kml/2.0\",placemarksDesc:\"No description available\",foldersName:\"OpenLayers export\",foldersDesc:\"Exported on \"+new Date,extractAttributes:!0,extractStyles:!1,internalns:null,features:null,styles:null,styleBaseUrl:\"\",fetched:null,maxDepth:0,initialize:function(e){this.regExes={trimSpace:/^\\s*|\\s*$/g,removeSpace:/\\s*/g,splitSpace:/\\s+/,trimComma:/\\s*,\\s*/g,kmlColor:/(\\w{2})(\\w{2})(\\w{2})(\\w{2})/,kmlIconPalette:/root:\\/\\/icons\\/palette-(\\d+)(\\.\\w+)/,straightBracket:/\\$\\[(.*?)\\]/g},OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){this.features=[],this.styles={},this.fetched={};var t={depth:0,styleBaseUrl:this.styleBaseUrl};return this.parseData(e,t)},parseData:function(e,t){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var i=[\"Link\",\"NetworkLink\",\"Style\",\"StyleMap\",\"Placemark\"],r=0,n=i.length;r<n;++r){var s=i[r],a=this.getElementsByTagNameNS(e,\"*\",s);if(0!=a.length)switch(s.toLowerCase()){case\"link\":case\"networklink\":this.parseLinks(a,t);break;case\"style\":this.extractStyles&&this.parseStyles(a,t);break;case\"stylemap\":this.extractStyles&&this.parseStyleMaps(a,t);break;case\"placemark\":this.parseFeatures(a,t)}}return this.features},parseLinks:function(e,t){if(t.depth>=this.maxDepth)return!1;var i=OpenLayers.Util.extend({},t);i.depth++;for(var r=0,n=e.length;r<n;r++){var s=this.parseProperty(e[r],\"*\",\"href\");if(s&&!this.fetched[s]){this.fetched[s]=!0;var a=this.fetchLink(s);a&&this.parseData(a,i)}}},fetchLink:function(e){var t=OpenLayers.Request.GET({url:e,async:!1});if(t)return t.responseText},parseStyles:function(e,t){for(var i=0,r=e.length;i<r;i++){var n=this.parseStyle(e[i]);n&&(styleName=(t.styleBaseUrl||\"\")+\"#\"+n.id,this.styles[styleName]=n)}},parseStyle:function(e){for(var t,i={},r=[\"LineStyle\",\"PolyStyle\",\"IconStyle\",\"BalloonStyle\"],n=0,s=r.length;n<s;++n)if(t=r[n],styleTypeNode=this.getElementsByTagNameNS(e,\"*\",t)[0],styleTypeNode)switch(t.toLowerCase()){case\"linestyle\":var a=this.parseProperty(styleTypeNode,\"*\",\"color\");if(a){var o=a.toString().match(this.regExes.kmlColor),l=o[1];i.strokeOpacity=parseInt(l,16)/255;var p=o[2],h=o[3],u=o[4];i.strokeColor=\"#\"+u+h+p}var y=this.parseProperty(styleTypeNode,\"*\",\"width\");y&&(i.strokeWidth=y);case\"polystyle\":var a=this.parseProperty(styleTypeNode,\"*\",\"color\");if(a){var o=a.toString().match(this.regExes.kmlColor),l=o[1];i.fillOpacity=parseInt(l,16)/255;var p=o[2],h=o[3],u=o[4];i.fillColor=\"#\"+u+h+p}var c=this.parseProperty(styleTypeNode,\"*\",\"fill\");\"0\"==c&&(i.fillColor=\"none\");break;case\"iconstyle\":var d=parseFloat(this.parseProperty(styleTypeNode,\"*\",\"scale\")||1),y=32*d,m=32*d,f=this.getElementsByTagNameNS(styleTypeNode,\"*\",\"Icon\")[0];if(f){var L=this.parseProperty(f,\"*\",\"href\");if(L){var g=this.parseProperty(f,\"*\",\"w\"),v=this.parseProperty(f,\"*\",\"h\");!OpenLayers.String.startsWith(L,\"http://maps.google.com/mapfiles/kml\")||g||v||(g=64,v=64,d/=2),g=g||v,v=v||g,g&&(y=parseInt(g)*d),v&&(m=parseInt(v)*d);var o=L.match(this.regExes.kmlIconPalette);if(o){var O=o[1],S=o[2],C=this.parseProperty(f,\"*\",\"x\"),b=this.parseProperty(f,\"*\",\"y\"),w=C?C/32:0,E=b?7-b/32:7,x=8*E+w;L=\"http://maps.google.com/mapfiles/kml/pal\"+O+\"/icon\"+x+S}i.graphicOpacity=1,i.externalGraphic=L}}var N=this.getElementsByTagNameNS(styleTypeNode,\"*\",\"hotSpot\")[0];if(N){var C=parseFloat(N.getAttribute(\"x\")),b=parseFloat(N.getAttribute(\"y\")),M=N.getAttribute(\"xunits\");\"pixels\"==M?i.graphicXOffset=-C*d:\"insetPixels\"==M?i.graphicXOffset=C*d-y:\"fraction\"==M&&(i.graphicXOffset=-y*C);var P=N.getAttribute(\"yunits\");\"pixels\"==P?i.graphicYOffset=b*d-m+1:\"insetPixels\"==P?i.graphicYOffset=1-b*d:\"fraction\"==P&&(i.graphicYOffset=-m*(1-b)+1)}i.graphicWidth=y,i.graphicHeight=m;break;case\"balloonstyle\":var F=OpenLayers.Util.getXmlNodeValue(styleTypeNode);F&&(i.balloonStyle=F.replace(this.regExes.straightBracket,\"${$1}\"))}!i.strokeColor&&i.fillColor&&(i.strokeColor=i.fillColor);var T=e.getAttribute(\"id\");return T&&i&&(i.id=T),i},parseStyleMaps:function(e,t){for(var i=0,r=e.length;i<r;i++)for(var n=e[i],s=this.getElementsByTagNameNS(n,\"*\",\"Pair\"),a=n.getAttribute(\"id\"),o=0,l=s.length;o<l;o++){var p=s[o],h=this.parseProperty(p,\"*\",\"key\"),u=this.parseProperty(p,\"*\",\"styleUrl\");u&&\"normal\"==h&&(this.styles[(t.styleBaseUrl||\"\")+\"#\"+a]=this.styles[(t.styleBaseUrl||\"\")+u])}},parseFeatures:function(e,t){for(var i=new Array(e.length),r=0,n=e.length;r<n;r++){var s=e[r],a=this.parseFeature.apply(this,[s]);if(!a)throw\"Bad Placemark: \"+r;if(this.extractStyles&&a.attributes&&a.attributes.styleUrl&&(a.style=this.getStyle(a.attributes.styleUrl,t)),this.extractStyles){var o=this.getElementsByTagNameNS(s,\"*\",\"Style\")[0];if(o){var l=this.parseStyle(o);l&&(a.style=OpenLayers.Util.extend(a.style,l))}}i[r]=a}this.features=this.features.concat(i)},parseFeature:function(e){for(var t,i,r,n,s=[\"MultiGeometry\",\"Polygon\",\"LineString\",\"Point\"],a=0,o=s.length;a<o;++a)if(t=s[a],this.internalns=e.namespaceURI?e.namespaceURI:this.kmlns,i=this.getElementsByTagNameNS(e,this.internalns,t),i.length>0){var n=this.parseGeometry[t.toLowerCase()];n?(r=n.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&r.transform(this.externalProjection,this.internalProjection)):OpenLayers.Console.error(OpenLayers.i18n(\"unsupportedGeometryType\",{geomType:t}));break}var l;this.extractAttributes&&(l=this.parseAttributes(e));var p=new OpenLayers.Feature.Vector(r,l),h=e.getAttribute(\"id\")||e.getAttribute(\"name\");return null!=h&&(p.fid=h),p},getStyle:function(e,t){var i=OpenLayers.Util.removeTail(e),r=OpenLayers.Util.extend({},t);if(r.depth++,r.styleBaseUrl=i,!this.styles[e]&&!OpenLayers.String.startsWith(e,\"#\")&&r.depth<=this.maxDepth&&!this.fetched[i]){var n=this.fetchLink(i)\n;n&&this.parseData(n,r)}return OpenLayers.Util.extend({},this.styles[e])},parseGeometry:{point:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,\"coordinates\"),i=[];if(t.length>0){var r=t[0].firstChild.nodeValue;r=r.replace(this.regExes.removeSpace,\"\"),i=r.split(\",\")}if(!(i.length>1))throw\"Bad coordinate string: \"+r;return 2==i.length&&(i[2]=null),new OpenLayers.Geometry.Point(i[0],i[1],i[2])},linestring:function(e,t){var i=this.getElementsByTagNameNS(e,this.internalns,\"coordinates\"),r=null;if(i.length>0){var n=this.getChildValue(i[0]);n=n.replace(this.regExes.trimSpace,\"\"),n=n.replace(this.regExes.trimComma,\",\");for(var s,a=n.split(this.regExes.splitSpace),o=a.length,l=new Array(o),p=0;p<o;++p){if(s=a[p].split(\",\"),!(s.length>1))throw\"Bad LineString point coordinates: \"+a[p];2==s.length&&(s[2]=null),l[p]=new OpenLayers.Geometry.Point(s[0],s[1],s[2])}if(!o)throw\"Bad LineString coordinates: \"+n;r=t?new OpenLayers.Geometry.LinearRing(l):new OpenLayers.Geometry.LineString(l)}return r},polygon:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,\"LinearRing\"),i=t.length,r=new Array(i);if(i>0)for(var n,s=0,a=t.length;s<a;++s){if(!(n=this.parseGeometry.linestring.apply(this,[t[s],!0])))throw\"Bad LinearRing geometry: \"+s;r[s]=n}return new OpenLayers.Geometry.Polygon(r)},multigeometry:function(e){for(var t,i,r=[],n=e.childNodes,s=0,a=n.length;s<a;++s)if(t=n[s],1==t.nodeType){var o=t.prefix?t.nodeName.split(\":\")[1]:t.nodeName,i=this.parseGeometry[o.toLowerCase()];i&&r.push(i.apply(this,[t]))}return new OpenLayers.Geometry.Collection(r)}},parseAttributes:function(e){var t={},i=e.getElementsByTagName(\"ExtendedData\");i.length&&(t=this.parseExtendedData(i[0]));for(var r,n,s,a=e.childNodes,o=0,l=a.length;o<l;++o)if(r=a[o],1==r.nodeType&&(n=r.childNodes,1==n.length||3==n.length)){var s;switch(n.length){case 1:s=n[0];break;case 3:default:s=n[1]}if(3==s.nodeType||4==s.nodeType){var p=r.prefix?r.nodeName.split(\":\")[1]:r.nodeName,h=OpenLayers.Util.getXmlNodeValue(s);h&&(h=h.replace(this.regExes.trimSpace,\"\"),t[p]=h)}}return t},parseExtendedData:function(e){for(var t={},i=e.getElementsByTagName(\"Data\"),r=0,n=i.length;r<n;r++){var s=i[r],a=s.getAttribute(\"name\"),o={},l=s.getElementsByTagName(\"value\");l.length&&(o.value=this.getChildValue(l[0]));var p=s.getElementsByTagName(\"displayName\");p.length&&(o.displayName=this.getChildValue(p[0])),t[a]=o}return t},parseProperty:function(e,t,i){var r,n=this.getElementsByTagNameNS(e,t,i);try{r=OpenLayers.Util.getXmlNodeValue(n[0])}catch(e){r=null}return r},write:function(e){e instanceof Array||(e=[e]);for(var t=this.createElementNS(this.kmlns,\"kml\"),i=this.createFolderXML(),r=0,n=e.length;r<n;++r)i.appendChild(this.createPlacemarkXML(e[r]));return t.appendChild(i),OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFolderXML:function(){var e=this.createElementNS(this.kmlns,\"name\"),t=this.createTextNode(this.foldersName);e.appendChild(t);var i=this.createElementNS(this.kmlns,\"description\"),r=this.createTextNode(this.foldersDesc);i.appendChild(r);var n=this.createElementNS(this.kmlns,\"Folder\");return n.appendChild(e),n.appendChild(i),n},createPlacemarkXML:function(e){var t=this.createElementNS(this.kmlns,\"name\"),i=e.attributes.name?e.attributes.name:e.id;t.appendChild(this.createTextNode(i));var r=this.createElementNS(this.kmlns,\"description\"),n=e.attributes.description?e.attributes.description:this.placemarksDesc;r.appendChild(this.createTextNode(n));var s=this.createElementNS(this.kmlns,\"Placemark\");null!=e.fid&&s.setAttribute(\"id\",e.fid),s.appendChild(t),s.appendChild(r);var a=this.buildGeometryNode(e.geometry);return s.appendChild(a),s},buildGeometryNode:function(e){this.internalProjection&&this.externalProjection&&(e=e.clone(),e.transform(this.internalProjection,this.externalProjection));var t=e.CLASS_NAME,i=t.substring(t.lastIndexOf(\".\")+1),r=this.buildGeometry[i.toLowerCase()],n=null;return r&&(n=r.apply(this,[e])),n},buildGeometry:{point:function(e){var t=this.createElementNS(this.kmlns,\"Point\");return t.appendChild(this.buildCoordinatesNode(e)),t},multipoint:function(e){return this.buildGeometry.collection.apply(this,[e])},linestring:function(e){var t=this.createElementNS(this.kmlns,\"LineString\");return t.appendChild(this.buildCoordinatesNode(e)),t},multilinestring:function(e){return this.buildGeometry.collection.apply(this,[e])},linearring:function(e){var t=this.createElementNS(this.kmlns,\"LinearRing\");return t.appendChild(this.buildCoordinatesNode(e)),t},polygon:function(e){for(var t,i,r,n=this.createElementNS(this.kmlns,\"Polygon\"),s=e.components,a=0,o=s.length;a<o;++a)r=0==a?\"outerBoundaryIs\":\"innerBoundaryIs\",t=this.createElementNS(this.kmlns,r),i=this.buildGeometry.linearring.apply(this,[s[a]]),t.appendChild(i),n.appendChild(t);return n},multipolygon:function(e){return this.buildGeometry.collection.apply(this,[e])},collection:function(e){for(var t,i=this.createElementNS(this.kmlns,\"MultiGeometry\"),r=0,n=e.components.length;r<n;++r)(t=this.buildGeometryNode.apply(this,[e.components[r]]))&&i.appendChild(t);return i}},buildCoordinatesNode:function(e){var t,i=this.createElementNS(this.kmlns,\"coordinates\"),r=e.components;if(r){for(var n,s=r.length,a=new Array(s),o=0;o<s;++o)n=r[o],a[o]=n.x+\",\"+n.y;t=a.join(\" \")}else t=e.x+\",\"+e.y;var l=this.createTextNode(t);return i.appendChild(l),i},CLASS_NAME:\"OpenLayers.Format.KML\"});OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:!1,interestingTagsExclude:null,areaTags:null,initialize:function(e){var t={interestingTagsExclude:[\"source\",\"source_ref\",\"source:ref\",\"history\",\"attribution\",\"created_by\"],areaTags:[\"area\",\"building\",\"leisure\",\"tourism\",\"ruins\",\"historic\",\"landuse\",\"military\",\"natural\",\"sport\"]};t=OpenLayers.Util.extend(t,e);for(var i={},r=0;r<t.interestingTagsExclude.length;r++)i[t.interestingTagsExclude[r]]=!0;t.interestingTagsExclude=i;for(var n={},r=0;r<t.areaTags.length;r++)n[t.areaTags[r]]=!0;t.areaTags=n,OpenLayers.Format.XML.prototype.initialize.apply(this,[t])},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var t=this.getNodes(e),i=this.getWays(e),r=new Array(i.length),n=0;n<i.length;n++){for(var s=new Array(i[n].nodes.length),a=this.isWayArea(i[n])?1:0,o=0;o<i[n].nodes.length;o++){var l=t[i[n].nodes[o]],p=new OpenLayers.Geometry.Point(l.lon,l.lat);p.osm_id=parseInt(i[n].nodes[o]),s[o]=p,l.used=!0}var h=null;h=a?new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(s)):new OpenLayers.Geometry.LineString(s),this.internalProjection&&this.externalProjection&&h.transform(this.externalProjection,this.internalProjection);var u=new OpenLayers.Feature.Vector(h,i[n].tags);u.osm_id=parseInt(i[n].id),u.fid=\"way.\"+u.osm_id,r[n]=u}for(var y in t){var l=t[y];if(!l.used||this.checkTags){var c=null;if(this.checkTags){var d=this.getTags(l.node,!0);if(l.used&&!d[1])continue;c=d[0]}else c=this.getTags(l.node);var u=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(l.lon,l.lat),c);this.internalProjection&&this.externalProjection&&u.geometry.transform(this.externalProjection,this.internalProjection),u.osm_id=parseInt(y),u.fid=\"node.\"+u.osm_id,r.push(u)}l.node=null}return r},getNodes:function(e){for(var t=e.getElementsByTagName(\"node\"),i={},r=0;r<t.length;r++){var n=t[r];i[n.getAttribute(\"id\")]={lat:n.getAttribute(\"lat\"),lon:n.getAttribute(\"lon\"),node:n}}return i},getWays:function(e){for(var t=e.getElementsByTagName(\"way\"),i=[],r=0;r<t.length;r++){var n=t[r],s={id:n.getAttribute(\"id\")};s.tags=this.getTags(n);var a=n.getElementsByTagName(\"nd\");s.nodes=new Array(a.length);for(var o=0;o<a.length;o++)s.nodes[o]=a[o].getAttribute(\"ref\");i.push(s)}return i},getTags:function(e,t){for(var i=e.getElementsByTagName(\"tag\"),r={},n=!1,s=0;s<i.length;s++){var a=i[s].getAttribute(\"k\");r[a]=i[s].getAttribute(\"v\"),t&&(this.interestingTagsExclude[a]||(n=!0))}return t?[r,n]:r},isWayArea:function(e){var t=!1,i=!1;if(e.nodes[0]==e.nodes[e.nodes.length-1]&&(t=!0),this.checkTags)for(var r in e.tags)if(this.areaTags[r]){i=!0;break}return t&&(!this.checkTags||i)},write:function(e){e instanceof Array||(e=[e]),this.osm_id=1,this.created_nodes={};var t=this.createElementNS(null,\"osm\");t.setAttribute(\"version\",\"0.5\"),t.setAttribute(\"generator\",\"OpenLayers \"+OpenLayers.VERSION_NUMBER);for(var i=e.length-1;i>=0;i--)for(var r=this.createFeatureNodes(e[i]),n=0;n<r.length;n++)t.appendChild(r[n]);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureNodes:function(e){var t=[],i=e.geometry.CLASS_NAME,r=i.substring(i.lastIndexOf(\".\")+1);r=r.toLowerCase();var n=this.createXML[r];return n&&(t=n.apply(this,[e])),t},createXML:{point:function(e){var t=null,i=e.geometry?e.geometry:e,r=!1;if(e.osm_id?(t=e.osm_id,this.created_nodes[t]&&(r=!0)):(t=-this.osm_id,this.osm_id++),r)n=this.created_nodes[t];else var n=this.createElementNS(null,\"node\");return this.created_nodes[t]=n,n.setAttribute(\"id\",t),n.setAttribute(\"lon\",i.x),n.setAttribute(\"lat\",i.y),e.attributes&&this.serializeTags(e,n),this.setState(e,n),r?[]:[n]},linestring:function(e){var t=[],i=e.geometry;e.osm_id?id=e.osm_id:(id=-this.osm_id,this.osm_id++);var r=this.createElementNS(null,\"way\");r.setAttribute(\"id\",id);for(var n=0;n<i.components.length;n++){var s=this.createXML.point.apply(this,[i.components[n]]);if(s.length){s=s[0];var a=s.getAttribute(\"id\");t.push(s)}else a=i.components[n].osm_id,s=this.created_nodes[a];this.setState(e,s);var o=this.createElementNS(null,\"nd\");o.setAttribute(\"ref\",a),r.appendChild(o)}return this.serializeTags(e,r),t.push(r),t},polygon:function(e){var t=OpenLayers.Util.extend({area:\"yes\"},e.attributes),i=new OpenLayers.Feature.Vector(e.geometry.components[0],t);return i.osm_id=e.osm_id,this.createXML.linestring.apply(this,[i])}},serializeTags:function(e,t){for(var i in e.attributes){var r=this.createElementNS(null,\"tag\");r.setAttribute(\"k\",i),r.setAttribute(\"v\",e.attributes[i]),t.appendChild(r)}},setState:function(e,t){if(e.state){var i=null;switch(e.state){case OpenLayers.State.UPDATE:i=\"modify\";case OpenLayers.State.DELETE:i=\"delete\"}i&&t.setAttribute(\"action\",i)}},CLASS_NAME:\"OpenLayers.Format.OSM\"}),OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:[\"OpenLayers.Geometry.Polygon\"],initialize:function(e){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:\"OpenLayers.Geometry.MultiPolygon\"}),OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(e,t,i){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(e){var t=this.control.map.getLonLatFromPixel(e);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat)),this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry])),this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry])),this.callback(\"create\",[this.point.geometry,this.getSketch()]),this.point.geometry.clearBounds(),this.layer.addFeatures([this.polygon,this.point],{silent:!0})},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this),this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style),this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var e=this.polygon&&this.polygon.geometry;return e&&this.multi&&(e=new OpenLayers.Geometry.MultiPolygon([e])),e},dblclick:function(e){if(!this.freehandMode(e)){var t=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[t]),this.removePoint(),this.finalize()}return!1},CLASS_NAME:\"OpenLayers.Handler.Polygon\"}),OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(e,t){OpenLayers.Control.Panel.prototype.initialize.apply(this,[t]),this.addControls([new OpenLayers.Control.Navigation]);var i=[new OpenLayers.Control.DrawFeature(e,OpenLayers.Handler.Point,{displayClass:\"olControlDrawFeaturePoint\"}),new OpenLayers.Control.DrawFeature(e,OpenLayers.Handler.Path,{displayClass:\"olControlDrawFeaturePath\"}),new OpenLayers.Control.DrawFeature(e,OpenLayers.Handler.Polygon,{displayClass:\"olControlDrawFeaturePolygon\"})];this.addControls(i)},draw:function(){var e=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return this.activateControl(this.controls[0]),e},CLASS_NAME:\"OpenLayers.Control.EditingToolbar\"}),OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:[\"antialiasing\",\"blockout\",\"font\",\"fontcolor\",\"fontsize\",\"fontstyle\",\"glowing\",\"interval\",\"outline\",\"printmode\",\"shadow\",\"transparency\"],request:null,response:null,initialize:function(e){if(this.request=new OpenLayers.Format.ArcXML.Request,this.response=new OpenLayers.Format.ArcXML.Response,e)if(\"feature\"==e.requesttype){this.request.get_image=null;var t=this.request.get_feature.query;this.addCoordSys(t.featurecoordsys,e.featureCoordSys),this.addCoordSys(t.filtercoordsys,e.filterCoordSys),e.polygon?(t.isspatial=!0,t.spatialfilter.polygon=e.polygon):e.envelope&&(t.isspatial=!0,t.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0},this.parseEnvelope(t.spatialfilter.envelope,e.envelope))}else if(\"image\"==e.requesttype){this.request.get_feature=null;var i=this.request.get_image.properties;this.parseEnvelope(i.envelope,e.envelope),this.addLayers(i.layerlist,e.layers),this.addImageSize(i.imagesize,e.tileSize),this.addCoordSys(i.featurecoordsys,e.featureCoordSys),this.addCoordSys(i.filtercoordsys,e.filterCoordSys)}else this.request=null;OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},parseEnvelope:function(e,t){t&&4==t.length&&(e.minx=t[0],e.miny=t[1],e.maxx=t[2],e.maxy=t[3])},addLayers:function(e,t){for(var i=0,r=t.length;i<r;i++)e.push(t[i])},addImageSize:function(e,t){null!==t&&(e.width=t.w,e.height=t.h,e.printwidth=t.w,e.printheight=t.h)},addCoordSys:function(e,t){\"string\"==typeof t?(e.id=parseInt(t),e.string=t):\"object\"==typeof t&&null!==t.proj?(e.id=t.proj.srsProjNumber,e.string=t.proj.srsCode):e=t},iserror:function(e){var t=null;if(e){e=OpenLayers.Format.XML.prototype.read.apply(this,[e]);var i=e.documentElement.getElementsByTagName(\"ERROR\");t=null!==i&&i.length>0}else t=\"\"!==this.response.error;return t},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=null;if(e&&e.documentElement&&(t=\"ARCXML\"==e.documentElement.nodeName?e.documentElement:e.documentElement.getElementsByTagName(\"ARCXML\")[0]),!t){var i,r;try{i=e.firstChild.nodeValue,r=e.firstChild.childNodes[1].firstChild.nodeValue}catch(e){}throw{message:\"Error parsing the ArcXML request\",error:i,source:r}}return this.parseResponse(t)},write:function(e){e||(e=this.request);var t=this.createElementNS(\"\",\"ARCXML\");t.setAttribute(\"version\",\"1.1\");var i=this.createElementNS(\"\",\"REQUEST\");if(null!=e.get_image){var r=this.createElementNS(\"\",\"GET_IMAGE\");i.appendChild(r);var n=this.createElementNS(\"\",\"PROPERTIES\");r.appendChild(n);var s=e.get_image.properties;if(null!=s.featurecoordsys){var a=this.createElementNS(\"\",\"FEATURECOORDSYS\");n.appendChild(a),0===s.featurecoordsys.id?a.setAttribute(\"string\",s.featurecoordsys.string):a.setAttribute(\"id\",s.featurecoordsys.id)}if(null!=s.filtercoordsys){var o=this.createElementNS(\"\",\"FILTERCOORDSYS\");n.appendChild(o),0===s.filtercoordsys.id?o.setAttribute(\"string\",s.filtercoordsys.string):o.setAttribute(\"id\",s.filtercoordsys.id)}if(null!=s.envelope){var l=this.createElementNS(\"\",\"ENVELOPE\");n.appendChild(l),l.setAttribute(\"minx\",s.envelope.minx),l.setAttribute(\"miny\",s.envelope.miny),l.setAttribute(\"maxx\",s.envelope.maxx),l.setAttribute(\"maxy\",s.envelope.maxy)}var p=this.createElementNS(\"\",\"IMAGESIZE\");if(n.appendChild(p),p.setAttribute(\"height\",s.imagesize.height),p.setAttribute(\"width\",s.imagesize.width),s.imagesize.height==s.imagesize.printheight&&s.imagesize.width==s.imagesize.printwidth||(p.setAttribute(\"printheight\",s.imagesize.printheight),p.setArrtibute(\"printwidth\",s.imagesize.printwidth)),null!=s.background){var h=this.createElementNS(\"\",\"BACKGROUND\");n.appendChild(h),h.setAttribute(\"color\",s.background.color.r+\",\"+s.background.color.g+\",\"+s.background.color.b),null!==s.background.transcolor&&h.setAttribute(\"transcolor\",s.background.transcolor.r+\",\"+s.background.transcolor.g+\",\"+s.background.transcolor.b)}if(null!=s.layerlist&&s.layerlist.length>0){var u=this.createElementNS(\"\",\"LAYERLIST\");n.appendChild(u);for(var y=0;y<s.layerlist.length;y++){var c=this.createElementNS(\"\",\"LAYERDEF\");if(u.appendChild(c),c.setAttribute(\"id\",s.layerlist[y].id),c.setAttribute(\"visible\",s.layerlist[y].visible),\"object\"==typeof s.layerlist[y].query){var d=s.layerlist[y].query;if(d.where.length<0)continue;var m=null;m=\"boolean\"==typeof d.spatialfilter&&d.spatialfilter?this.createElementNS(\"\",\"SPATIALQUERY\"):this.createElementNS(\"\",\"QUERY\"),m.setAttribute(\"where\",d.where),\"number\"==typeof d.accuracy&&d.accuracy>0&&m.setAttribute(\"accuracy\",d.accuracy),\"number\"==typeof d.featurelimit&&d.featurelimit<2e3&&m.setAttribute(\"featurelimit\",d.featurelimit),\"string\"==typeof d.subfields&&\"#ALL#\"!=d.subfields&&m.setAttribute(\"subfields\",d.subfields),\"string\"==typeof d.joinexpression&&d.joinexpression.length>0&&m.setAttribute(\"joinexpression\",d.joinexpression),\"string\"==typeof d.jointables&&d.jointables.length>0&&m.setAttribute(\"jointables\",d.jointables),c.appendChild(m)}\"object\"==typeof s.layerlist[y].renderer&&this.addRenderer(c,s.layerlist[y].renderer)}}}else if(null!=e.get_feature){var r=this.createElementNS(\"\",\"GET_FEATURES\");if(r.setAttribute(\"outputmode\",\"newxml\"),r.setAttribute(\"checkesc\",\"true\"),e.get_feature.geometry?r.setAttribute(\"geometry\",e.get_feature.geometry):r.setAttribute(\"geometry\",\"false\"),e.get_feature.compact&&r.setAttribute(\"compact\",e.get_feature.compact),\"number\"==e.get_feature.featurelimit&&r.setAttribute(\"featurelimit\",e.get_feature.featurelimit),r.setAttribute(\"globalenvelope\",\"true\"),i.appendChild(r),null!=e.get_feature.layer&&e.get_feature.layer.length>0){var f=this.createElementNS(\"\",\"LAYER\");f.setAttribute(\"id\",e.get_feature.layer),r.appendChild(f)}var L=e.get_feature.query;if(null!=L){var g=null;if(g=L.isspatial?this.createElementNS(\"\",\"SPATIALQUERY\"):this.createElementNS(\"\",\"QUERY\"),r.appendChild(g),\"number\"==typeof L.accuracy&&g.setAttribute(\"accuracy\",L.accuracy),null!=L.featurecoordsys){var v=this.createElementNS(\"\",\"FEATURECOORDSYS\");0==L.featurecoordsys.id?v.setAttribute(\"string\",L.featurecoordsys.string):v.setAttribute(\"id\",L.featurecoordsys.id),g.appendChild(v)}if(null!=L.filtercoordsys){var O=this.createElementNS(\"\",\"FILTERCOORDSYS\");0===L.filtercoordsys.id?O.setAttribute(\"string\",L.filtercoordsys.string):O.setAttribute(\"id\",L.filtercoordsys.id),g.appendChild(O)}if(L.buffer>0){var S=this.createElementNS(\"\",\"BUFFER\");S.setAttribute(\"distance\",L.buffer),g.appendChild(S)}if(L.isspatial){var C=this.createElementNS(\"\",\"SPATIALFILTER\");if(C.setAttribute(\"relation\",L.spatialfilter.relation),g.appendChild(C),L.spatialfilter.envelope){var b=this.createElementNS(\"\",\"ENVELOPE\");b.setAttribute(\"minx\",L.spatialfilter.envelope.minx),b.setAttribute(\"miny\",L.spatialfilter.envelope.miny),b.setAttribute(\"maxx\",L.spatialfilter.envelope.maxx),b.setAttribute(\"maxy\",L.spatialfilter.envelope.maxy),C.appendChild(b)}else\"object\"==typeof L.spatialfilter.polygon&&C.appendChild(this.writePolygonGeometry(L.spatialfilter.polygon))}null!=L.where&&L.where.length>0&&g.setAttribute(\"where\",L.where)}}return t.appendChild(i),OpenLayers.Format.XML.prototype.write.apply(this,[t])},addGroupRenderer:function(e,t){var i=this.createElementNS(\"\",\"GROUPRENDERER\");e.appendChild(i);for(var r=0;r<t.length;r++){var n=t[r];this.addRenderer(i,n)}},addRenderer:function(e,t){if(t instanceof Array)this.addGroupRenderer(e,t);else{var i=this.createElementNS(\"\",t.type.toUpperCase()+\"RENDERER\");e.appendChild(i),\"VALUEMAPRENDERER\"==i.tagName?this.addValueMapRenderer(i,t):\"VALUEMAPLABELRENDERER\"==i.tagName?this.addValueMapLabelRenderer(i,t):\"SIMPLELABELRENDERER\"==i.tagName?this.addSimpleLabelRenderer(i,t):\"SCALEDEPENDENTRENDERER\"==i.tagName&&this.addScaleDependentRenderer(i,t)}},addScaleDependentRenderer:function(e,t){\"string\"!=typeof t.lower&&\"number\"!=typeof t.lower||e.setAttribute(\"lower\",t.lower),\"string\"!=typeof t.upper&&\"number\"!=typeof t.upper||e.setAttribute(\"upper\",t.upper),this.addRenderer(e,t.renderer)},addValueMapLabelRenderer:function(e,t){if(e.setAttribute(\"lookupfield\",t.lookupfield),e.setAttribute(\"labelfield\",t.labelfield),\"object\"==typeof t.exacts)for(var i=0,r=t.exacts.length;i<r;i++){var n=t.exacts[i],s=this.createElementNS(\"\",\"EXACT\");if(\"string\"==typeof n.value&&s.setAttribute(\"value\",n.value),\"string\"==typeof n.label&&s.setAttribute(\"label\",n.label),\"string\"==typeof n.method&&s.setAttribute(\"method\",n.method),e.appendChild(s),\"object\"==typeof n.symbol){var a=null;if(\"text\"==n.symbol.type&&(a=this.createElementNS(\"\",\"TEXTSYMBOL\")),null!=a){for(var o=this.fontStyleKeys,l=0,p=o.length;l<p;l++){var h=o[l];n.symbol[h]&&a.setAttribute(h,n.symbol[h])}s.appendChild(a)}}}},addValueMapRenderer:function(e,t){if(e.setAttribute(\"lookupfield\",t.lookupfield),\"object\"==typeof t.ranges)for(var i=0,r=t.ranges.length;i<r;i++){var n=t.ranges[i],s=this.createElementNS(\"\",\"RANGE\");if(s.setAttribute(\"lower\",n.lower),s.setAttribute(\"upper\",n.upper),e.appendChild(s),\"object\"==typeof n.symbol){var a=null;\"simplepolygon\"==n.symbol.type&&(a=this.createElementNS(\"\",\"SIMPLEPOLYGONSYMBOL\")),null!=a&&(\"string\"==typeof n.symbol.boundarycolor&&a.setAttribute(\"boundarycolor\",n.symbol.boundarycolor),\"string\"==typeof n.symbol.fillcolor&&a.setAttribute(\"fillcolor\",n.symbol.fillcolor),\"number\"==typeof n.symbol.filltransparency&&a.setAttribute(\"filltransparency\",n.symbol.filltransparency),s.appendChild(a))}}else if(\"object\"==typeof t.exacts)for(var o=0,l=t.exacts.length;o<l;o++){var p=t.exacts[o],h=this.createElementNS(\"\",\"EXACT\");if(\"string\"==typeof p.value&&h.setAttribute(\"value\",p.value),\"string\"==typeof p.label&&h.setAttribute(\"label\",p.label),\"string\"==typeof p.method&&h.setAttribute(\"method\",p.method),e.appendChild(h),\"object\"==typeof p.symbol){var a=null;\"simplemarker\"==p.symbol.type&&(a=this.createElementNS(\"\",\"SIMPLEMARKERSYMBOL\")),null!=a&&(\"string\"==typeof p.symbol.antialiasing&&a.setAttribute(\"antialiasing\",p.symbol.antialiasing),\"string\"==typeof p.symbol.color&&a.setAttribute(\"color\",p.symbol.color),\"string\"==typeof p.symbol.outline&&a.setAttribute(\"outline\",p.symbol.outline),\"string\"==typeof p.symbol.overlap&&a.setAttribute(\"overlap\",p.symbol.overlap),\"string\"==typeof p.symbol.shadow&&a.setAttribute(\"shadow\",p.symbol.shadow),\"number\"==typeof p.symbol.transparency&&a.setAttribute(\"transparency\",p.symbol.transparency),\"string\"==typeof p.symbol.usecentroid&&a.setAttribute(\"usecentroid\",p.symbol.usecentroid),\"number\"==typeof p.symbol.width&&a.setAttribute(\"width\",p.symbol.width),h.appendChild(a))}}},addSimpleLabelRenderer:function(e,t){e.setAttribute(\"field\",t.field);for(var i=[\"featureweight\",\"howmanylabels\",\"labelbufferratio\",\"labelpriorities\",\"labelweight\",\"linelabelposition\",\"rotationalangles\"],r=0,n=i.length;r<n;r++){var s=i[r];t[s]&&e.setAttribute(s,t[s])}if(\"text\"==t.symbol.type){var a=t.symbol,o=this.createElementNS(\"\",\"TEXTSYMBOL\");e.appendChild(o);for(var i=this.fontStyleKeys,r=0,n=i.length;r<n;r++){var s=i[r];a[s]&&o.setAttribute(s,t[s])}}},writePolygonGeometry:function(e){if(!(e instanceof OpenLayers.Geometry.Polygon))throw{message:\"Cannot write polygon geometry to ArcXML with an \"+e.CLASS_NAME+\" object.\",geometry:e};for(var t=this.createElementNS(\"\",\"POLYGON\"),i=0,r=e.components.length;i<r;i++){for(var n=e.components[i],s=this.createElementNS(\"\",\"RING\"),a=0,o=n.components.length;a<o;a++){var l=n.components[a],p=this.createElementNS(\"\",\"POINT\");p.setAttribute(\"x\",l.x),p.setAttribute(\"y\",l.y),s.appendChild(p)}t.appendChild(s)}return t},parseResponse:function(e){if(\"string\"==typeof e){e=(new OpenLayers.Format.XML).read(e)}var t=new OpenLayers.Format.ArcXML.Response,i=e.getElementsByTagName(\"ERROR\");if(null!=i&&i.length>0)t.error=this.getChildValue(i,\"Unknown error.\");else{var r=e.getElementsByTagName(\"RESPONSE\");if(null==r||0==r.length)return t.error=\"No RESPONSE tag found in ArcXML response.\",t;var n=r[0].firstChild.nodeName;if(\"#text\"==n&&(n=r[0].firstChild.nextSibling.nodeName),\"IMAGE\"==n){var s=e.getElementsByTagName(\"ENVELOPE\"),a=e.getElementsByTagName(\"OUTPUT\");if(null==s||0==s.length)t.error=\"No ENVELOPE tag found in ArcXML response.\";else if(null==a||0==a.length)t.error=\"No OUTPUT tag found in ArcXML response.\";else{var o=this.parseAttributes(s[0]),l=this.parseAttributes(a[0]);\"string\"==typeof l.type?t.image={envelope:o,output:{type:l.type,data:this.getChildValue(a[0])}}:t.image={envelope:o,output:l}}}else if(\"FEATURES\"==n){var p=r[0].getElementsByTagName(\"FEATURES\"),h=p[0].getElementsByTagName(\"FEATURECOUNT\");if(t.features.featurecount=h[0].getAttribute(\"count\"),t.features.featurecount>0){var u=p[0].getElementsByTagName(\"ENVELOPE\");t.features.envelope=this.parseAttributes(u[0],\"number\");for(var y=p[0].getElementsByTagName(\"FEATURE\"),c=0;c<y.length;c++){for(var d=new OpenLayers.Feature.Vector,m=y[c].getElementsByTagName(\"FIELD\"),f=0;f<m.length;f++){var L=m[f].getAttribute(\"name\"),g=m[f].getAttribute(\"value\");d.attributes[L]=g}var v=y[c].getElementsByTagName(\"POLYGON\");if(v.length>0){for(var O=v[0].getElementsByTagName(\"RING\"),S=[],C=0;C<O.length;C++){var b=[];b.push(this.parsePointGeometry(O[C]));for(var w=O[C].getElementsByTagName(\"HOLE\"),E=0;E<w.length;E++)b.push(this.parsePointGeometry(w[E]));w=null,S.push(new OpenLayers.Geometry.Polygon(b)),b=null}O=null,1==S.length?d.geometry=S[0]:d.geometry=new OpenLayers.Geometry.MultiPolygon(S)}t.features.feature.push(d)}}}else t.error=\"Unidentified response type.\"}return t},parseAttributes:function(e,t){for(var i={},r=0;r<e.attributes.length;r++)i[e.attributes[r].nodeName]=\"number\"==t?parseFloat(e.attributes[r].nodeValue):e.attributes[r].nodeValue;return i},parsePointGeometry:function(e){var t=[],i=e.getElementsByTagName(\"COORDS\");if(i.length>0){var r=this.getChildValue(i[0]);r=r.split(/;/);for(var n=0;n<r.length;n++){var s=r[n].split(/ /);t.push(new OpenLayers.Geometry.Point(parseFloat(s[0]),parseFloat(s[1])))}i=null}else{var a=e.getElementsByTagName(\"POINT\");if(a.length>0)for(var o=0;o<a.length;o++)t.push(new OpenLayers.Geometry.Point(parseFloat(a[o].getAttribute(\"x\")),parseFloat(a[o].getAttribute(\"y\"))));a=null}return new OpenLayers.Geometry.LinearRing(t)},CLASS_NAME:\"OpenLayers.Format.ArcXML\"}),OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(e){var t={get_image:{properties:{background:null,draw:!0,envelope:{minx:0,miny:0,maxx:0,maxy:0},featurecoordsys:{id:0,string:\"\",datumtransformid:0,datumtransformstring:\"\"},filtercoordsys:{id:0,string:\"\",datumtransformid:0,datumtransformstring:\"\"},imagesize:{height:0,width:0,dpi:96,printheight:0,printwidth:0,scalesymbols:!1},layerlist:[],output:{baseurl:\"\",legendbaseurl:\"\",legendname:\"\",legendpath:\"\",legendurl:\"\",name:\"\",path:\"\",type:\"jpg\",url:\"\"}}},get_feature:{layer:\"\",query:{isspatial:!1,featurecoordsys:{id:0,string:\"\",datumtransformid:0,datumtransformstring:\"\"},filtercoordsys:{id:0,string:\"\",datumtransformid:0,datumtransformstring:\"\"},buffer:0,where:\"\",spatialfilter:{relation:\"envelope_intersection\",envelope:null}}},environment:{separators:{cs:\" \",ts:\";\"}},layer:[],workspaces:[]};return OpenLayers.Util.extend(this,t)},CLASS_NAME:\"OpenLayers.Format.ArcXML.Request\"}),OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(e){var t={image:{envelope:null,output:\"\"},features:{featurecount:0,envelope:null,feature:[]},error:\"\"};return OpenLayers.Util.extend(this,t)},CLASS_NAME:\"OpenLayers.Format.ArcXML.Response\"}),OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:\"http://mapserver.gis.umn.edu/mapserver\",featurePrefix:\"feature\",featureName:\"featureMember\",layerName:\"features\",geometryName:\"geometry\",collectionName:\"FeatureCollection\",gmlns:\"http://www.opengis.net/gml\",extractAttributes:!0,xy:!0,initialize:function(e){this.regExes={trimSpace:/^\\s*|\\s*$/g,removeSpace:/\\s*/g,splitSpace:/\\s+/,trimComma:/\\s*,\\s*/g},OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var t=this.getElementsByTagNameNS(e.documentElement,this.gmlns,this.featureName),i=[],r=0;r<t.length;r++){var n=this.parseFeature(t[r]);n&&i.push(n)}return i},parseFeature:function(e){for(var t,i,r,n,s=[\"MultiPolygon\",\"Polygon\",\"MultiLineString\",\"LineString\",\"MultiPoint\",\"Point\",\"Envelope\",\"Box\"],a=0;a<s.length;++a)if(t=s[a],i=this.getElementsByTagNameNS(e,this.gmlns,t),i.length>0){var n=this.parseGeometry[t.toLowerCase()];n?(r=n.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&r.transform(this.externalProjection,this.internalProjection)):OpenLayers.Console.error(OpenLayers.i18n(\"unsupportedGeometryType\",{geomType:t}));break}var o;this.extractAttributes&&(o=this.parseAttributes(e));var l=new OpenLayers.Feature.Vector(r,o);l.gml={featureType:e.firstChild.nodeName.split(\":\")[1],featureNS:e.firstChild.namespaceURI,featureNSPrefix:e.firstChild.prefix};for(var p,h=e.firstChild;h&&(1!=h.nodeType||!(p=h.getAttribute(\"fid\")||h.getAttribute(\"id\")));)h=h.nextSibling;return l.fid=p,l},parseGeometry:{point:function(e){var t,i,r=[],t=this.getElementsByTagNameNS(e,this.gmlns,\"pos\");if(t.length>0&&(i=t[0].firstChild.nodeValue,i=i.replace(this.regExes.trimSpace,\"\"),r=i.split(this.regExes.splitSpace)),0==r.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,\"coordinates\"),t.length>0&&(i=t[0].firstChild.nodeValue,i=i.replace(this.regExes.removeSpace,\"\"),r=i.split(\",\"))),0==r.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,\"coord\"),t.length>0)){var n=this.getElementsByTagNameNS(t[0],this.gmlns,\"X\"),s=this.getElementsByTagNameNS(t[0],this.gmlns,\"Y\");n.length>0&&s.length>0&&(r=[n[0].firstChild.nodeValue,s[0].firstChild.nodeValue])}return 2==r.length&&(r[2]=null),this.xy?new OpenLayers.Geometry.Point(r[0],r[1],r[2]):new OpenLayers.Geometry.Point(r[1],r[0],r[2])},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,\"Point\"),i=[];if(t.length>0)for(var r,n=0;n<t.length;++n)(r=this.parseGeometry.point.apply(this,[t[n]]))&&i.push(r);return new OpenLayers.Geometry.MultiPoint(i)},linestring:function(e,t){var i,r,n=[],s=[];if(i=this.getElementsByTagNameNS(e,this.gmlns,\"posList\"),i.length>0){r=this.getChildValue(i[0]),r=r.replace(this.regExes.trimSpace,\"\"),n=r.split(this.regExes.splitSpace);for(var a,o,l,p,h=parseInt(i[0].getAttribute(\"dimension\")),u=0;u<n.length/h;++u)a=u*h,o=n[a],l=n[a+1],p=2==h?null:n[a+2],this.xy?s.push(new OpenLayers.Geometry.Point(o,l,p)):s.push(new OpenLayers.Geometry.Point(l,o,p))}if(0==n.length&&(i=this.getElementsByTagNameNS(e,this.gmlns,\"coordinates\"),i.length>0)){r=this.getChildValue(i[0]),r=r.replace(this.regExes.trimSpace,\"\"),r=r.replace(this.regExes.trimComma,\",\");for(var y=r.split(this.regExes.splitSpace),u=0;u<y.length;++u)n=y[u].split(\",\"),2==n.length&&(n[2]=null),this.xy?s.push(new OpenLayers.Geometry.Point(n[0],n[1],n[2])):s.push(new OpenLayers.Geometry.Point(n[1],n[0],n[2]))}var c=null;return 0!=s.length&&(c=t?new OpenLayers.Geometry.LinearRing(s):new OpenLayers.Geometry.LineString(s)),c},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,\"LineString\"),i=[];if(t.length>0)for(var r,n=0;n<t.length;++n)(r=this.parseGeometry.linestring.apply(this,[t[n]]))&&i.push(r);return new OpenLayers.Geometry.MultiLineString(i)},polygon:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,\"LinearRing\"),i=[];if(t.length>0)for(var r,n=0;n<t.length;++n)(r=this.parseGeometry.linestring.apply(this,[t[n],!0]))&&i.push(r);return new OpenLayers.Geometry.Polygon(i)},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,\"Polygon\"),i=[]\n;if(t.length>0)for(var r,n=0;n<t.length;++n)(r=this.parseGeometry.polygon.apply(this,[t[n]]))&&i.push(r);return new OpenLayers.Geometry.MultiPolygon(i)},envelope:function(e){var t,i,r=[],n=this.getElementsByTagNameNS(e,this.gmlns,\"lowerCorner\");if(n.length>0){var s=[];if(n.length>0&&(t=n[0].firstChild.nodeValue,t=t.replace(this.regExes.trimSpace,\"\"),s=t.split(this.regExes.splitSpace)),2==s.length&&(s[2]=null),this.xy)var a=new OpenLayers.Geometry.Point(s[0],s[1],s[2]);else var a=new OpenLayers.Geometry.Point(s[1],s[0],s[2])}var o=this.getElementsByTagNameNS(e,this.gmlns,\"upperCorner\");if(o.length>0){var s=[];if(o.length>0&&(t=o[0].firstChild.nodeValue,t=t.replace(this.regExes.trimSpace,\"\"),s=t.split(this.regExes.splitSpace)),2==s.length&&(s[2]=null),this.xy)var l=new OpenLayers.Geometry.Point(s[0],s[1],s[2]);else var l=new OpenLayers.Geometry.Point(s[1],s[0],s[2])}if(a&&l){r.push(new OpenLayers.Geometry.Point(a.x,a.y)),r.push(new OpenLayers.Geometry.Point(l.x,a.y)),r.push(new OpenLayers.Geometry.Point(l.x,l.y)),r.push(new OpenLayers.Geometry.Point(a.x,l.y)),r.push(new OpenLayers.Geometry.Point(a.x,a.y));var p=new OpenLayers.Geometry.LinearRing(r);i=new OpenLayers.Geometry.Polygon([p])}return i}},parseAttributes:function(e){for(var t,i,r,n,s,a,o,l={},p=e.firstChild;p;){if(1==p.nodeType){for(t=p.childNodes,i=0;i<t.length;++i)r=t[i],1==r.nodeType&&(n=r.childNodes,1==n.length?(s=n[0],3!=s.nodeType&&4!=s.nodeType||(a=r.prefix?r.nodeName.split(\":\")[1]:r.nodeName,o=s.nodeValue.replace(this.regExes.trimSpace,\"\"),l[a]=o)):l[r.nodeName.split(\":\").pop()]=null);break}p=p.nextSibling}return l},write:function(e){e instanceof Array||(e=[e]);for(var t=this.createElementNS(\"http://www.opengis.net/wfs\",\"wfs:\"+this.collectionName),i=0;i<e.length;i++)t.appendChild(this.createFeatureXML(e[i]));return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(e){var t=e.geometry,i=this.buildGeometryNode(t),r=this.createElementNS(this.featureNS,this.featurePrefix+\":\"+this.geometryName);r.appendChild(i);var n=this.createElementNS(this.gmlns,\"gml:\"+this.featureName),s=this.createElementNS(this.featureNS,this.featurePrefix+\":\"+this.layerName),a=e.fid||e.id;s.setAttribute(\"fid\",a),s.appendChild(r);for(var o in e.attributes){var l=this.createTextNode(e.attributes[o]),p=o.substring(o.lastIndexOf(\":\")+1),h=this.createElementNS(this.featureNS,this.featurePrefix+\":\"+p);h.appendChild(l),s.appendChild(h)}return n.appendChild(s),n},buildGeometryNode:function(e){this.externalProjection&&this.internalProjection&&(e=e.clone(),e.transform(this.internalProjection,this.externalProjection));var t=e.CLASS_NAME,i=t.substring(t.lastIndexOf(\".\")+1);return this.buildGeometry[i.toLowerCase()].apply(this,[e])},buildGeometry:{point:function(e){var t=this.createElementNS(this.gmlns,\"gml:Point\");return t.appendChild(this.buildCoordinatesNode(e)),t},multipoint:function(e){for(var t,i,r=this.createElementNS(this.gmlns,\"gml:MultiPoint\"),n=e.components,s=0;s<n.length;s++)t=this.createElementNS(this.gmlns,\"gml:pointMember\"),i=this.buildGeometry.point.apply(this,[n[s]]),t.appendChild(i),r.appendChild(t);return r},linestring:function(e){var t=this.createElementNS(this.gmlns,\"gml:LineString\");return t.appendChild(this.buildCoordinatesNode(e)),t},multilinestring:function(e){for(var t,i,r=this.createElementNS(this.gmlns,\"gml:MultiLineString\"),n=e.components,s=0;s<n.length;++s)t=this.createElementNS(this.gmlns,\"gml:lineStringMember\"),i=this.buildGeometry.linestring.apply(this,[n[s]]),t.appendChild(i),r.appendChild(t);return r},linearring:function(e){var t=this.createElementNS(this.gmlns,\"gml:LinearRing\");return t.appendChild(this.buildCoordinatesNode(e)),t},polygon:function(e){for(var t,i,r,n=this.createElementNS(this.gmlns,\"gml:Polygon\"),s=e.components,a=0;a<s.length;++a)r=0==a?\"outerBoundaryIs\":\"innerBoundaryIs\",t=this.createElementNS(this.gmlns,\"gml:\"+r),i=this.buildGeometry.linearring.apply(this,[s[a]]),t.appendChild(i),n.appendChild(t);return n},multipolygon:function(e){for(var t,i,r=this.createElementNS(this.gmlns,\"gml:MultiPolygon\"),n=e.components,s=0;s<n.length;++s)t=this.createElementNS(this.gmlns,\"gml:polygonMember\"),i=this.buildGeometry.polygon.apply(this,[n[s]]),t.appendChild(i),r.appendChild(t);return r},bounds:function(e){var t=this.createElementNS(this.gmlns,\"gml:Box\");return t.appendChild(this.buildCoordinatesNode(e)),t}},buildCoordinatesNode:function(e){var t=this.createElementNS(this.gmlns,\"gml:coordinates\");t.setAttribute(\"decimal\",\".\"),t.setAttribute(\"cs\",\",\"),t.setAttribute(\"ts\",\" \");var i=[];if(e instanceof OpenLayers.Bounds)i.push(e.left+\",\"+e.bottom),i.push(e.right+\",\"+e.top);else for(var r=e.components?e.components:[e],n=0;n<r.length;n++)i.push(r[n].x+\",\"+r[n].y);var s=this.createTextNode(i.join(\" \"));return t.appendChild(s),t},CLASS_NAME:\"OpenLayers.Format.GML\"}),OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{initialize:function(e){OpenLayers.Format.JSON.prototype.initialize.apply(this,[e])},read:function(e,t,i){t=t?t:\"FeatureCollection\";var r=null,n=null;if(n=\"string\"==typeof e?OpenLayers.Format.JSON.prototype.read.apply(this,[e,i]):e){if(\"string\"!=typeof n.type)OpenLayers.Console.error(\"Bad GeoJSON - no type: \"+e);else if(this.isValidType(n,t))switch(t){case\"Geometry\":try{r=this.parseGeometry(n)}catch(e){OpenLayers.Console.error(e)}break;case\"Feature\":try{r=this.parseFeature(n),r.type=\"Feature\"}catch(e){OpenLayers.Console.error(e)}break;case\"FeatureCollection\":switch(r=[],n.type){case\"Feature\":try{r.push(this.parseFeature(n))}catch(e){r=null,OpenLayers.Console.error(e)}break;case\"FeatureCollection\":for(var s=0,a=n.features.length;s<a;++s)try{r.push(this.parseFeature(n.features[s]))}catch(e){r=null,OpenLayers.Console.error(e)}break;default:try{var o=this.parseGeometry(n);r.push(new OpenLayers.Feature.Vector(o))}catch(e){r=null,OpenLayers.Console.error(e)}}}}else OpenLayers.Console.error(\"Bad JSON: \"+e);return r},isValidType:function(e,t){var i=!1;switch(t){case\"Geometry\":OpenLayers.Util.indexOf([\"Point\",\"MultiPoint\",\"LineString\",\"MultiLineString\",\"Polygon\",\"MultiPolygon\",\"Box\",\"GeometryCollection\"],e.type)==-1?OpenLayers.Console.error(\"Unsupported geometry type: \"+e.type):i=!0;break;case\"FeatureCollection\":i=!0;break;default:e.type==t?i=!0:OpenLayers.Console.error(\"Cannot convert types from \"+e.type+\" to \"+t)}return i},parseFeature:function(e){var t,i,r,n;r=e.properties?e.properties:{},n=e.geometry&&e.geometry.bbox||e.bbox;try{i=this.parseGeometry(e.geometry)}catch(e){throw e}return t=new OpenLayers.Feature.Vector(i,r),n&&(t.bounds=OpenLayers.Bounds.fromArray(n)),e.id&&(t.fid=e.id),t},parseGeometry:function(e){if(null==e)return null;var t,i=!1;if(\"GeometryCollection\"==e.type){if(!(e.geometries instanceof Array))throw\"GeometryCollection must have geometries array: \"+e;for(var r=e.geometries.length,n=new Array(r),s=0;s<r;++s)n[s]=this.parseGeometry.apply(this,[e.geometries[s]]);t=new OpenLayers.Geometry.Collection(n),i=!0}else{if(!(e.coordinates instanceof Array))throw\"Geometry must have coordinates array: \"+e;if(!this.parseCoords[e.type.toLowerCase()])throw\"Unsupported geometry type: \"+e.type;try{t=this.parseCoords[e.type.toLowerCase()].apply(this,[e.coordinates])}catch(e){throw e}}return this.internalProjection&&this.externalProjection&&!i&&t.transform(this.externalProjection,this.internalProjection),t},parseCoords:{point:function(e){if(2!=e.length)throw\"Only 2D points are supported: \"+e;return new OpenLayers.Geometry.Point(e[0],e[1])},multipoint:function(e){for(var t=[],i=null,r=0,n=e.length;r<n;++r){try{i=this.parseCoords.point.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.MultiPoint(t)},linestring:function(e){for(var t=[],i=null,r=0,n=e.length;r<n;++r){try{i=this.parseCoords.point.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.LineString(t)},multilinestring:function(e){for(var t=[],i=null,r=0,n=e.length;r<n;++r){try{i=this.parseCoords.linestring.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.MultiLineString(t)},polygon:function(e){for(var t,i,r=[],n=0,s=e.length;n<s;++n){try{i=this.parseCoords.linestring.apply(this,[e[n]])}catch(e){throw e}t=new OpenLayers.Geometry.LinearRing(i.components),r.push(t)}return new OpenLayers.Geometry.Polygon(r)},multipolygon:function(e){for(var t=[],i=null,r=0,n=e.length;r<n;++r){try{i=this.parseCoords.polygon.apply(this,[e[r]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.MultiPolygon(t)},box:function(e){if(2!=e.length)throw\"GeoJSON box coordinates must have 2 elements\";return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(e[0][0],e[0][1]),new OpenLayers.Geometry.Point(e[1][0],e[0][1]),new OpenLayers.Geometry.Point(e[1][0],e[1][1]),new OpenLayers.Geometry.Point(e[0][0],e[1][1]),new OpenLayers.Geometry.Point(e[0][0],e[0][1])])])}},write:function(e,t){var i={type:null};if(e instanceof Array){i.type=\"FeatureCollection\";var r=e.length;i.features=new Array(r);for(var n=0;n<r;++n){var s=e[n];if(!s instanceof OpenLayers.Feature.Vector){throw\"FeatureCollection only supports collections of features: \"+s}i.features[n]=this.extract.feature.apply(this,[s])}}else 0==e.CLASS_NAME.indexOf(\"OpenLayers.Geometry\")?i=this.extract.geometry.apply(this,[e]):e instanceof OpenLayers.Feature.Vector&&(i=this.extract.feature.apply(this,[e]),e.layer&&e.layer.projection&&(i.crs=this.createCRSObject(e)));return OpenLayers.Format.JSON.prototype.write.apply(this,[i,t])},createCRSObject:function(e){var t=e.layer.projection.toString(),i={};if(t.match(/epsg:/i)){var r=parseInt(t.substring(t.indexOf(\":\")+1));i=4326==r?{type:\"OGC\",properties:{urn:\"urn:ogc:def:crs:OGC:1.3:CRS84\"}}:{type:\"EPSG\",properties:{code:r}}}return i},extract:{feature:function(e){var t=this.extract.geometry.apply(this,[e.geometry]);return{type:\"Feature\",id:null==e.fid?e.id:e.fid,properties:e.attributes,geometry:t}},geometry:function(e){if(null==e)return null;this.internalProjection&&this.externalProjection&&(e=e.clone(),e.transform(this.internalProjection,this.externalProjection));var t=e.CLASS_NAME.split(\".\")[2],i=this.extract[t.toLowerCase()].apply(this,[e]);return\"Collection\"==t?{type:\"GeometryCollection\",geometries:i}:{type:t,coordinates:i}},point:function(e){return[e.x,e.y]},multipoint:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t},linestring:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t},multilinestring:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.linestring.apply(this,[e.components[i]]));return t},polygon:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.linestring.apply(this,[e.components[i]]));return t},multipolygon:function(e){for(var t=[],i=0,r=e.components.length;i<r;++i)t.push(this.extract.polygon.apply(this,[e.components[i]]));return t},collection:function(e){for(var t=e.components.length,i=new Array(t),r=0;r<t;++r)i[r]=this.extract.geometry.apply(this,[e.components[r]]);return i}},CLASS_NAME:\"OpenLayers.Format.GeoJSON\"}),OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){return(new OpenLayers.Format.ArcXML).read(e).features.feature}}),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},initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.setGeometryTypes(),e&&e.featureNS&&this.setNamespace(\"feature\",e.featureNS),this.singleFeatureType=!e||\"string\"==typeof e.featureType},read:function(e){\"string\"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t=[];if(this.readNode(e,{features:t}),0==t.length){var i=this.getElementsByTagNameNS(e,this.namespaces.gml,\"featureMember\");if(i.length)for(var r=0,n=i.length;r<n;++r)this.readNode(i[r],{features:t});else{var i=this.getElementsByTagNameNS(e,this.namespaces.gml,\"featureMembers\");i.length&&this.readNode(i[0],{features:t})}}return t},readers:{gml:{featureMember:function(e,t){this.readChildNodes(e,t)},featureMembers:function(e,t){this.readChildNodes(e,t)},name:function(e,t){t.name=this.getChildValue(e)},boundedBy:function(e,t){var i={};this.readChildNodes(e,i),i.components&&i.components.length>0&&(t.bounds=i.components[0])},Point:function(e,t){var i={points:[]};this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(i.points[0])},coordinates:function(e,t){var i=this.getChildValue(e).replace(this.regExes.trimSpace,\"\");i=i.replace(this.regExes.trimComma,\",\");for(var r,n=i.split(this.regExes.splitSpace),s=n.length,a=new Array(s),o=0;o<s;++o)r=n[o].split(\",\"),this.xy?a[o]=new OpenLayers.Geometry.Point(r[0],r[1],r[2]):a[o]=new OpenLayers.Geometry.Point(r[1],r[0],r[2]);t.points=a},coord:function(e,t){var i={};this.readChildNodes(e,i),t.points||(t.points=[]),t.points.push(new OpenLayers.Geometry.Point(i.x,i.y,i.z))},X:function(e,t){t.x=this.getChildValue(e)},Y:function(e,t){t.y=this.getChildValue(e)},Z:function(e,t){t.z=this.getChildValue(e)},MultiPoint:function(e,t){var i={components:[]};this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.MultiPoint(i.components)]},pointMember:function(e,t){this.readChildNodes(e,t)},LineString:function(e,t){var i={};this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.LineString(i.points))},MultiLineString:function(e,t){var i={components:[]};this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.MultiLineString(i.components)]},lineStringMember:function(e,t){this.readChildNodes(e,t)},Polygon:function(e,t){var i={outer:null,inner:[]};this.readChildNodes(e,i),i.inner.unshift(i.outer),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.Polygon(i.inner))},LinearRing:function(e,t){var i={};this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.LinearRing(i.points)]},MultiPolygon:function(e,t){var i={components:[]};this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)]},polygonMember:function(e,t){this.readChildNodes(e,t)},GeometryCollection:function(e,t){var i={components:[]};this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.Collection(i.components)]},geometryMember:function(e,t){this.readChildNodes(e,t)}},feature:{\"*\":function(e,t){var i,r=e.localName||e.nodeName.split(\":\").pop();this.singleFeatureType||OpenLayers.Util.indexOf(this.featureType,r)==-1?r==this.featureType?i=\"_typeName\":0==e.childNodes.length||1==e.childNodes.length&&3==e.firstChild.nodeType?this.extractAttributes&&(i=\"_attribute\"):i=\"_geometry\":i=\"_typeName\",i&&this.readers.feature[i].apply(this,[e,t])},_typeName:function(e,t){var i={components:[],attributes:{}};this.readChildNodes(e,i),i.name&&(i.attributes.name=i.name);var r=new OpenLayers.Feature.Vector(i.components[0],i.attributes);this.singleFeatureType||(r.type=e.nodeName.split(\":\").pop(),r.namespace=e.namespaceURI);var n=e.getAttribute(\"fid\")||this.getAttributeNS(e,this.namespaces.gml,\"id\");n&&(r.fid=n),this.internalProjection&&this.externalProjection&&r.geometry&&r.geometry.transform(this.externalProjection,this.internalProjection),i.bounds&&(r.geometry.bounds=i.bounds),t.features.push(r)},_geometry:function(e,t){this.readChildNodes(e,t)},_attribute:function(e,t){var i=e.localName||e.nodeName.split(\":\").pop(),r=this.getChildValue(e);t.attributes[i]=r}},wfs:{FeatureCollection:function(e,t){this.readChildNodes(e,t)}}},write:function(e){var t;t=e instanceof Array?\"featureMembers\":\"featureMember\";var i=this.writeNode(\"gml:\"+t,e);return this.setAttributeNS(i,this.namespaces.xsi,\"xsi:schemaLocation\",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{gml:{featureMember:function(e){var t=this.createElementNSPlus(\"gml:featureMember\");return this.writeNode(\"feature:_typeName\",e,t),t},MultiPoint:function(e){for(var t=this.createElementNSPlus(\"gml:MultiPoint\"),i=0;i<e.components.length;++i)this.writeNode(\"pointMember\",e.components[i],t);return t},pointMember:function(e){var t=this.createElementNSPlus(\"gml:pointMember\");return this.writeNode(\"Point\",e,t),t},MultiLineString:function(e){for(var t=this.createElementNSPlus(\"gml:MultiLineString\"),i=0;i<e.components.length;++i)this.writeNode(\"lineStringMember\",e.components[i],t);return t},lineStringMember:function(e){var t=this.createElementNSPlus(\"gml:lineStringMember\");return this.writeNode(\"LineString\",e,t),t},MultiPolygon:function(e){for(var t=this.createElementNSPlus(\"gml:MultiPolygon\"),i=0;i<e.components.length;++i)this.writeNode(\"polygonMember\",e.components[i],t);return t},polygonMember:function(e){var t=this.createElementNSPlus(\"gml:polygonMember\");return this.writeNode(\"Polygon\",e,t),t},GeometryCollection:function(e){for(var t=this.createElementNSPlus(\"gml:GeometryCollection\"),i=0,r=e.components.length;i<r;++i)this.writeNode(\"geometryMember\",e.components[i],t);return t},geometryMember:function(e){var t=this.createElementNSPlus(\"gml:geometryMember\"),i=this.writeNode(\"feature:_geometry\",e);return t.appendChild(i.firstChild),t}},feature:{_typeName:function(e){var t=this.createElementNSPlus(\"feature:\"+this.featureType,{attributes:{fid:e.fid}});e.geometry&&this.writeNode(\"feature:_geometry\",e.geometry,t);for(var i in e.attributes){var r=e.attributes[i];null!=r&&this.writeNode(\"feature:_attribute\",{name:i,value:r},t)}return t},_geometry:function(e){this.externalProjection&&this.internalProjection&&(e=e.clone().transform(this.internalProjection,this.externalProjection));var t=this.createElementNSPlus(\"feature:\"+this.geometryName),i=this.geometryTypes[e.CLASS_NAME],r=this.writeNode(\"gml:\"+i,e,t);return this.srsName&&r.setAttribute(\"srsName\",this.srsName),t},_attribute:function(e){return this.createElementNSPlus(\"feature:\"+e.name,{value:e.value})}},wfs:{FeatureCollection:function(e){for(var t=this.createElementNSPlus(\"wfs:FeatureCollection\"),i=0,r=e.length;i<r;++i)this.writeNode(\"gml:featureMember\",e[i],t);return t}}},setGeometryTypes:function(){this.geometryTypes={\"OpenLayers.Geometry.Point\":\"Point\",\"OpenLayers.Geometry.MultiPoint\":\"MultiPoint\",\"OpenLayers.Geometry.LineString\":\"LineString\",\"OpenLayers.Geometry.MultiLineString\":\"MultiLineString\",\"OpenLayers.Geometry.Polygon\":\"Polygon\",\"OpenLayers.Geometry.MultiPolygon\":\"MultiPolygon\",\"OpenLayers.Geometry.Collection\":\"GeometryCollection\"}},CLASS_NAME:\"OpenLayers.Format.GML.Base\"}),OpenLayers.Format.WFS=OpenLayers.Class(OpenLayers.Format.GML,{layer:null,wfsns:\"http://www.opengis.net/wfs\",ogcns:\"http://www.opengis.net/ogc\",initialize:function(e,t){OpenLayers.Format.GML.prototype.initialize.apply(this,[e]),this.layer=t,this.layer.featureNS&&(this.featureNS=this.layer.featureNS),this.layer.options.geometry_column&&(this.geometryName=this.layer.options.geometry_column),this.layer.options.typename&&(this.featureName=this.layer.options.typename)},write:function(e){var t=this.createElementNS(this.wfsns,\"wfs:Transaction\");t.setAttribute(\"version\",\"1.0.0\"),t.setAttribute(\"service\",\"WFS\");for(var i=0;i<e.length;i++)switch(e[i].state){case OpenLayers.State.INSERT:t.appendChild(this.insert(e[i]));break;case OpenLayers.State.UPDATE:t.appendChild(this.update(e[i]));break;case OpenLayers.State.DELETE:t.appendChild(this.remove(e[i]))}return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(e){var t=this.buildGeometryNode(e.geometry),i=this.createElementNS(this.featureNS,\"feature:\"+this.geometryName);i.appendChild(t);var r=this.createElementNS(this.featureNS,\"feature:\"+this.featureName);r.appendChild(i);for(var n in e.attributes){var s=this.createTextNode(e.attributes[n]),a=n;n.search(\":\")!=-1&&(a=n.split(\":\")[1]);var o=this.createElementNS(this.featureNS,\"feature:\"+a);o.appendChild(s),r.appendChild(o)}return r},insert:function(e){var t=this.createElementNS(this.wfsns,\"wfs:Insert\");return t.appendChild(this.createFeatureXML(e)),t},update:function(e){e.fid||OpenLayers.Console.userError(OpenLayers.i18n(\"noFID\"));var t=this.createElementNS(this.wfsns,\"wfs:Update\");t.setAttribute(\"typeName\",this.featurePrefix+\":\"+this.featureName),t.setAttribute(\"xmlns:\"+this.featurePrefix,this.featureNS);var i=this.createElementNS(this.wfsns,\"wfs:Property\"),r=this.createElementNS(this.wfsns,\"wfs:Name\"),n=this.createTextNode(this.geometryName);r.appendChild(n),i.appendChild(r);var s=this.createElementNS(this.wfsns,\"wfs:Value\"),a=this.buildGeometryNode(e.geometry);e.layer&&a.setAttribute(\"srsName\",e.layer.projection.getCode()),s.appendChild(a),i.appendChild(s),t.appendChild(i);for(var o in e.attributes)i=this.createElementNS(this.wfsns,\"wfs:Property\"),r=this.createElementNS(this.wfsns,\"wfs:Name\"),r.appendChild(this.createTextNode(o)),i.appendChild(r),s=this.createElementNS(this.wfsns,\"wfs:Value\"),s.appendChild(this.createTextNode(e.attributes[o])),i.appendChild(s),t.appendChild(i);var l=this.createElementNS(this.ogcns,\"ogc:Filter\"),p=this.createElementNS(this.ogcns,\"ogc:FeatureId\");return p.setAttribute(\"fid\",e.fid),l.appendChild(p),t.appendChild(l),t},remove:function(e){if(!e.fid)return OpenLayers.Console.userError(OpenLayers.i18n(\"noFID\")),!1;var t=this.createElementNS(this.wfsns,\"wfs:Delete\");t.setAttribute(\"typeName\",this.featurePrefix+\":\"+this.featureName),t.setAttribute(\"xmlns:\"+this.featurePrefix,this.featureNS);var i=this.createElementNS(this.ogcns,\"ogc:Filter\"),r=this.createElementNS(this.ogcns,\"ogc:FeatureId\");return r.setAttribute(\"fid\",e.fid),i.appendChild(r),t.appendChild(i),t},destroy:function(){this.layer=null},CLASS_NAME:\"OpenLayers.Format.WFS\"}),OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:\"9.2\",ServiceName:\"\"},tileSize:null,featureCoordSys:\"4326\",filterCoordSys:\"4326\",layers:null,async:!0,name:\"ArcIMS\",isBaseLayer:!0,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:\"4326\",filterCoordSys:\"4326\",layers:null,isBaseLayer:!0,async:!0,name:\"ArcIMS\"},initialize:function(e,t,i){this.tileSize=new OpenLayers.Size(512,512),this.params=OpenLayers.Util.applyDefaults({ServiceName:i.serviceName},this.DEFAULT_PARAMS),this.options=OpenLayers.Util.applyDefaults(i,this.DEFAULT_OPTIONS),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[e,t,this.params,i]),this.transparent&&(this.isBaseLayer||(this.isBaseLayer=!1),\"image/jpeg\"==this.format&&(this.format=OpenLayers.Util.alphaHack()?\"image/gif\":\"image/png\")),null===this.options.layers&&(this.options.layers=[])},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},getURL:function(e){var t=\"\";e=this.adjustBounds(e);var i=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:\"image\",envelope:e.toArray(),tileSize:this.tileSize})),r=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:i.write(),async:!1});if(null!=r){var n=r.responseXML;n&&n.documentElement||(n=r.responseText);var s=new OpenLayers.Format.ArcXML,a=s.read(n);t=this.getUrlOrImage(a.image.output)}return t},getURLasync:function(e,t,i,r){e=this.adjustBounds(e);var n=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:\"image\",envelope:e.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(),async:!0,data:n.write(),callback:function(e){var n=e.responseXML;n&&n.documentElement||(n=e.responseText);var s=new OpenLayers.Format.ArcXML,a=s.read(n);t[i]=this.getUrlOrImage(a.image.output),r.apply(t)},scope:this})},getUrlOrImage:function(e){var t=\"\";return e.url?t=e.url:e.data&&(t=\"data:image/\"+e.type+\";base64,\"+e.data),t},setLayerQuery:function(e,t){for(var i=0;i<this.options.layers.length;i++)if(e==this.options.layers[i].id)return void(this.options.layers[i].query=t);this.options.layers.push({id:e,visible:!0,query:t})},getFeatureInfo:function(e,t,i){var r=i.buffer||1,n=i.callback||function(){},s=i.scope||window,a={};OpenLayers.Util.extend(a,this.options),a.requesttype=\"feature\",e instanceof OpenLayers.LonLat?(a.polygon=null,a.envelope=[e.lon-r,e.lat-r,e.lon+r,e.lat+r]):e instanceof OpenLayers.Geometry.Polygon&&(a.envelope=null,a.polygon=e);var o=new OpenLayers.Format.ArcXML(a);if(OpenLayers.Util.extend(o.request.get_feature,i),o.request.get_feature.layer=t.id,\"number\"==typeof t.query.accuracy)o.request.get_feature.query.accuracy=t.query.accuracy;else{var l=this.map.getCenter(),p=this.map.getViewPortPxFromLonLat(l);p.x++;var h=this.map.getLonLatFromPixel(p);o.request.get_feature.query.accuracy=h.lon-l.lon}o.request.get_feature.query.where=t.query.where,o.request.get_feature.query.spatialfilter.relation=\"area_intersection\",OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:\"Query\"}),data:o.write(),callback:function(e){var t=o.parseResponse(e.responseText);o.iserror()?n.call(s,null):n.call(s,t.features)}})},addTile:function(e,t){return new OpenLayers.Tile.Image(this,t,e,null,this.tileSize)},CLASS_NAME:\"OpenLayers.Layer.ArcIMS\"}),OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:\"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd\",initialize:function(e){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[e])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(e,t){var i={};this.readChildNodes(e,i),t.outer=i.components[0]},innerBoundaryIs:function(e,t){var i={};this.readChildNodes(e,i),t.inner.push(i.components[0])},Box:function(e,t){var i={};this.readChildNodes(e,i),t.components||(t.components=[]);var r=i.points[0],n=i.points[1];t.components.push(new OpenLayers.Bounds(r.x,r.y,n.x,n.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(e){var t;t=e instanceof Array?\"wfs:FeatureCollection\":\"gml:featureMember\";var i=this.writeNode(t,e);return this.setAttributeNS(i,this.namespaces.xsi,\"xsi:schemaLocation\",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(e){var t=this.createElementNSPlus(\"gml:Point\");return this.writeNode(\"coordinates\",[e],t),t},coordinates:function(e){for(var t,i=e.length,r=new Array(i),n=0;n<i;++n)t=e[n],this.xy?r[n]=t.x+\",\"+t.y:r[n]=t.y+\",\"+t.x,void 0!=t.z&&(r[n]+=\",\"+t.z);return this.createElementNSPlus(\"gml:coordinates\",{attributes:{decimal:\".\",cs:\",\",ts:\" \"},value:1==i?r[0]:r.join(\" \")})},LineString:function(e){var t=this.createElementNSPlus(\"gml:LineString\");return this.writeNode(\"coordinates\",e.components,t),t},Polygon:function(e){var t=this.createElementNSPlus(\"gml:Polygon\");this.writeNode(\"outerBoundaryIs\",e.components[0],t);for(var i=1;i<e.components.length;++i)this.writeNode(\"innerBoundaryIs\",e.components[i],t);return t},outerBoundaryIs:function(e){var t=this.createElementNSPlus(\"gml:outerBoundaryIs\");return this.writeNode(\"LinearRing\",e,t),t},innerBoundaryIs:function(e){var t=this.createElementNSPlus(\"gml:innerBoundaryIs\");return this.writeNode(\"LinearRing\",e,t),t},LinearRing:function(e){var t=this.createElementNSPlus(\"gml:LinearRing\");return this.writeNode(\"coordinates\",e.components,t),t},Box:function(e){var t=this.createElementNSPlus(\"gml:Box\");return this.writeNode(\"coordinates\",[{x:e.left,y:e.bottom},{x:e.right,y:e.top}],t),this.srsName&&t.setAttribute(\"srsName\",this.srsName),t}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},CLASS_NAME:\"OpenLayers.Format.GML.v2\"}),OpenLayers.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(e){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[e])},readers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(e,t){this.readChildNodes(e,t)},Curve:function(e,t){var i={points:[]};this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.LineString(i.points))},segments:function(e,t){this.readChildNodes(e,t)},LineStringSegment:function(e,t){var i={};this.readChildNodes(e,i),i.points&&Array.prototype.push.apply(t.points,i.points)},pos:function(e,t){var i,r=this.getChildValue(e).replace(this.regExes.trimSpace,\"\"),n=r.split(this.regExes.splitSpace);i=this.xy?new OpenLayers.Geometry.Point(n[0],n[1],n[2]):new OpenLayers.Geometry.Point(n[1],n[0],n[2]),t.points=[i]},posList:function(e,t){for(var i,r,n,s=this.getChildValue(e).replace(this.regExes.trimSpace,\"\"),a=s.split(this.regExes.splitSpace),o=parseInt(e.getAttribute(\"dimension\"))||2,l=a.length/o,p=new Array(l),h=0,u=a.length;h<u;h+=o)i=a[h],r=a[h+1],n=2==o?void 0:a[h+2],this.xy?p[h/o]=new OpenLayers.Geometry.Point(i,r,n):p[h/o]=new OpenLayers.Geometry.Point(r,i,n);t.points=p},Surface:function(e,t){this.readChildNodes(e,t)},patches:function(e,t){this.readChildNodes(e,t)},PolygonPatch:function(e,t){this.readers.gml.Polygon.apply(this,[e,t])},exterior:function(e,t){var i={};this.readChildNodes(e,i),t.outer=i.components[0]},interior:function(e,t){var i={};this.readChildNodes(e,i),t.inner.push(i.components[0])},MultiCurve:function(e,t){var i={components:[]};this.readChildNodes(e,i),i.components.length>0&&(t.components=[new OpenLayers.Geometry.MultiLineString(i.components)])},curveMember:function(e,t){this.readChildNodes(e,t)},MultiSurface:function(e,t){var i={components:[]};this.readChildNodes(e,i),i.components.length>0&&(t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)])},surfaceMember:function(e,t){this.readChildNodes(e,t)},surfaceMembers:function(e,t){this.readChildNodes(e,t)},pointMembers:function(e,t){this.readChildNodes(e,t)},lineStringMembers:function(e,t){this.readChildNodes(e,t)},polygonMembers:function(e,t){this.readChildNodes(e,t)},geometryMembers:function(e,t){this.readChildNodes(e,t)},Envelope:function(e,t){var i={points:new Array(2)};this.readChildNodes(e,i),t.components||(t.components=[]);var r=i.points[0],n=i.points[1];t.components.push(new OpenLayers.Bounds(r.x,r.y,n.x,n.y))},lowerCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[0]=i.points[0]},upperCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[1]=i.points[0]}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(e){var t;t=e instanceof Array?\"featureMembers\":\"featureMember\";var i=this.writeNode(\"gml:\"+t,e);return this.setAttributeNS(i,this.namespaces.xsi,\"xsi:schemaLocation\",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(e){for(var t=this.createElementNSPlus(\"gml:featureMembers\"),i=0,r=e.length;i<r;++i)this.writeNode(\"feature:_typeName\",e[i],t);return t},Point:function(e){var t=this.createElementNSPlus(\"gml:Point\");return this.writeNode(\"pos\",e,t),t},pos:function(e){var t=this.xy?e.x+\" \"+e.y:e.y+\" \"+e.x;return this.createElementNSPlus(\"gml:pos\",{value:t})},LineString:function(e){var t=this.createElementNSPlus(\"gml:LineString\");return this.writeNode(\"posList\",e.components,t),t},Curve:function(e){var t=this.createElementNSPlus(\"gml:Curve\")\n;return this.writeNode(\"segments\",e,t),t},segments:function(e){var t=this.createElementNSPlus(\"gml:segments\");return this.writeNode(\"LineStringSegment\",e,t),t},LineStringSegment:function(e){var t=this.createElementNSPlus(\"gml:LineStringSegment\");return this.writeNode(\"posList\",e.components,t),t},posList:function(e){for(var t,i=e.length,r=new Array(i),n=0;n<i;++n)t=e[n],this.xy?r[n]=t.x+\" \"+t.y:r[n]=t.y+\" \"+t.x;return this.createElementNSPlus(\"gml:posList\",{value:r.join(\" \")})},Surface:function(e){var t=this.createElementNSPlus(\"gml:Surface\");return this.writeNode(\"patches\",e,t),t},patches:function(e){var t=this.createElementNSPlus(\"gml:patches\");return this.writeNode(\"PolygonPatch\",e,t),t},PolygonPatch:function(e){var t=this.createElementNSPlus(\"gml:PolygonPatch\",{attributes:{interpolation:\"planar\"}});this.writeNode(\"exterior\",e.components[0],t);for(var i=1,r=e.components.length;i<r;++i)this.writeNode(\"interior\",e.components[i],t);return t},Polygon:function(e){var t=this.createElementNSPlus(\"gml:Polygon\");this.writeNode(\"exterior\",e.components[0],t);for(var i=1,r=e.components.length;i<r;++i)this.writeNode(\"interior\",e.components[i],t);return t},exterior:function(e){var t=this.createElementNSPlus(\"gml:exterior\");return this.writeNode(\"LinearRing\",e,t),t},interior:function(e){var t=this.createElementNSPlus(\"gml:interior\");return this.writeNode(\"LinearRing\",e,t),t},LinearRing:function(e){var t=this.createElementNSPlus(\"gml:LinearRing\");return this.writeNode(\"posList\",e.components,t),t},MultiCurve:function(e){for(var t=this.createElementNSPlus(\"gml:MultiCurve\"),i=0,r=e.components.length;i<r;++i)this.writeNode(\"curveMember\",e.components[i],t);return t},curveMember:function(e){var t=this.createElementNSPlus(\"gml:curveMember\");return this.curve?this.writeNode(\"Curve\",e,t):this.writeNode(\"LineString\",e,t),t},MultiSurface:function(e){for(var t=this.createElementNSPlus(\"gml:MultiSurface\"),i=0,r=e.components.length;i<r;++i)this.writeNode(\"surfaceMember\",e.components[i],t);return t},surfaceMember:function(e){var t=this.createElementNSPlus(\"gml:surfaceMember\");return this.surface?this.writeNode(\"Surface\",e,t):this.writeNode(\"Polygon\",e,t),t},Envelope:function(e){var t=this.createElementNSPlus(\"gml:Envelope\");return this.writeNode(\"lowerCorner\",e,t),this.writeNode(\"upperCorner\",e,t),this.srsName&&t.setAttribute(\"srsName\",this.srsName),t},lowerCorner:function(e){var t=this.xy?e.left+\" \"+e.bottom:e.bottom+\" \"+e.left;return this.createElementNSPlus(\"gml:lowerCorner\",{value:t})},upperCorner:function(e){var t=this.xy?e.right+\" \"+e.top:e.top+\" \"+e.right;return this.createElementNSPlus(\"gml:upperCorner\",{value:t})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={\"OpenLayers.Geometry.Point\":\"Point\",\"OpenLayers.Geometry.MultiPoint\":\"MultiPoint\",\"OpenLayers.Geometry.LineString\":this.curve===!0?\"Curve\":\"LineString\",\"OpenLayers.Geometry.MultiLineString\":this.multiCurve===!1?\"MultiLineString\":\"MultiCurve\",\"OpenLayers.Geometry.Polygon\":this.surface===!0?\"Surface\":\"Polygon\",\"OpenLayers.Geometry.MultiPolygon\":this.multiSurface===!1?\"MultiPolygon\":\"MultiSurface\",\"OpenLayers.Geometry.Collection\":\"GeometryCollection\"}},CLASS_NAME:\"OpenLayers.Format.GML.v3\"}),OpenLayers.Format.Filter.v1_0_0=OpenLayers.Class(OpenLayers.Format.GML.v2,OpenLayers.Format.Filter.v1,{VERSION:\"1.0.0\",schemaLocation:\"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd\",initialize:function(e){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[e])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsNotEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsEqualTo\");return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsNotEqualTo\");return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},BBOX:function(e){var t=this.createElementNSPlus(\"ogc:BBOX\");this.writeNode(\"PropertyName\",e,t);var i=this.writeNode(\"gml:Box\",e.value,t);return e.projection&&i.setAttribute(\"srsName\",e.projection),t}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},writeSpatial:function(e,t){var i=this.createElementNSPlus(\"ogc:\"+t);this.writeNode(\"PropertyName\",e,i);var r;return r=e.value instanceof OpenLayers.Geometry?this.writeNode(\"feature:_geometry\",e.value).firstChild:this.writeNode(\"gml:Box\",e.value),e.projection&&r.setAttribute(\"srsName\",e.projection),i.appendChild(r),i},CLASS_NAME:\"OpenLayers.Format.Filter.v1_0_0\"}),OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:\"1.1.0\",schemaLocation:\"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd\",initialize:function(e){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[e])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=e.getAttribute(\"matchCase\"),r=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!(\"false\"===i||\"0\"===i)});this.readChildNodes(e,r),t.filters.push(r)},PropertyIsNotEqualTo:function(e,t){var i=e.getAttribute(\"matchCase\"),r=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!(\"false\"===i||\"0\"===i)});this.readChildNodes(e,r),t.filters.push(r)}},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(e){var t=this.createElementNSPlus(\"ogc:PropertyIsEqualTo\",{attributes:{matchCase:e.matchCase}});return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus(\"ogc:PropertyIsNotEqualTo\",{attributes:{matchCase:e.matchCase}});return this.writeNode(\"PropertyName\",e,t),this.writeNode(\"Literal\",e.value,t),t},BBOX:function(e){var t=this.createElementNSPlus(\"ogc:BBOX\");this.writeNode(\"PropertyName\",e,t);var i=this.writeNode(\"gml:Envelope\",e.value);return e.projection&&i.setAttribute(\"srsName\",e.projection),t.appendChild(i),t}},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(e,t){var i=this.createElementNSPlus(\"ogc:\"+t);this.writeNode(\"PropertyName\",e,i);var r;return r=e.value instanceof OpenLayers.Geometry?this.writeNode(\"feature:_geometry\",e.value).firstChild:this.writeNode(\"gml:Envelope\",e.value),e.projection&&r.setAttribute(\"srsName\",e.projection),i.appendChild(r),i},CLASS_NAME:\"OpenLayers.Format.Filter.v1_1_0\"}),OpenLayers.Format.SLD.v1=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,{namespaces:{sld:\"http://www.opengis.net/sld\",ogc:\"http://www.opengis.net/ogc\",gml:\"http://www.opengis.net/gml\",xlink:\"http://www.w3.org/1999/xlink\",xsi:\"http://www.w3.org/2001/XMLSchema-instance\"},defaultPrefix:\"sld\",schemaLocation:null,defaultSymbolizer:{fillColor:\"#808080\",fillOpacity:1,strokeColor:\"#000000\",strokeOpacity:1,strokeWidth:1,strokeDashstyle:\"solid\",pointRadius:3,graphicName:\"square\"},initialize:function(e){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[e])},read:function(e,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i={namedLayers:t.namedLayersAsArray===!0?[]:{}};return this.readChildNodes(e,i),i},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(e,t){t.version=e.getAttribute(\"version\"),this.readChildNodes(e,t)},Name:function(e,t){t.name=this.getChildValue(e)},Title:function(e,t){t.title=this.getChildValue(e)},Abstract:function(e,t){t.description=this.getChildValue(e)},NamedLayer:function(e,t){var i={userStyles:[],namedStyles:[]};this.readChildNodes(e,i);for(var r=0,n=i.userStyles.length;r<n;++r)i.userStyles[r].layerName=i.name;t.namedLayers instanceof Array?t.namedLayers.push(i):t.namedLayers[i.name]=i},NamedStyle:function(e,t){t.namedStyles.push(this.getChildName(e.firstChild))},UserStyle:function(e,t){var i={defaultsPerSymbolizer:!0,rules:[]};this.readChildNodes(e,i);var r=new OpenLayers.Style(this.defaultSymbolizer,i);t.userStyles.push(r)},IsDefault:function(e,t){\"1\"==this.getChildValue(e)&&(t.isDefault=!0)},FeatureTypeStyle:function(e,t){var i={rules:[]};this.readChildNodes(e,i),t.rules=i.rules},Rule:function(e,t){var i=new OpenLayers.Rule;this.readChildNodes(e,i),t.rules.push(i)},ElseFilter:function(e,t){t.elseFilter=!0},MinScaleDenominator:function(e,t){t.minScaleDenominator=parseFloat(this.getChildValue(e))},MaxScaleDenominator:function(e,t){t.maxScaleDenominator=parseFloat(this.getChildValue(e))},TextSymbolizer:function(e,t){var i=t.symbolizer.Text||{};this.readChildNodes(e,i),t.symbolizer.Text=i},Label:function(e,t){var i={};if(this.readChildNodes(e,i),i.property)t.label=\"${\"+i.property+\"}\";else{var r=this.readOgcExpression(e);r&&(t.label=r)}},Font:function(e,t){this.readChildNodes(e,t)},Halo:function(e,t){var i={};this.readChildNodes(e,i),t.haloRadius=i.haloRadius,t.haloColor=i.fillColor,t.haloOpacity=i.fillOpacity},Radius:function(e,t){var i=this.readOgcExpression(e);null!=i&&(t.haloRadius=i)},LineSymbolizer:function(e,t){var i=t.symbolizer.Line||{};this.readChildNodes(e,i),t.symbolizer.Line=i},PolygonSymbolizer:function(e,t){var i=t.symbolizer.Polygon||{};this.readChildNodes(e,i),t.symbolizer.Polygon=i},PointSymbolizer:function(e,t){var i=t.symbolizer.Point||{};this.readChildNodes(e,i),t.symbolizer.Point=i},Stroke:function(e,t){t.stroke=!0,this.readChildNodes(e,t)},Fill:function(e,t){t.fill=!0,this.readChildNodes(e,t)},CssParameter:function(e,t){var i=e.getAttribute(\"name\"),r=this.cssMap[i];if(r){var n=this.readOgcExpression(e);n&&(t[r]=n)}},Graphic:function(e,t){t.graphic=!0;var i={};this.readChildNodes(e,i);for(var r,n,s=[\"strokeColor\",\"strokeWidth\",\"strokeOpacity\",\"strokeLinecap\",\"fillColor\",\"fillOpacity\",\"graphicName\",\"rotation\",\"graphicFormat\"],a=0,o=s.length;a<o;++a)r=s[a],void 0!=(n=i[r])&&(t[r]=n);void 0!=i.opacity&&(t.graphicOpacity=i.opacity),void 0!=i.size&&(t.pointRadius=i.size/2),void 0!=i.href&&(t.externalGraphic=i.href),void 0!=i.rotation&&(t.rotation=i.rotation)},ExternalGraphic:function(e,t){this.readChildNodes(e,t)},Mark:function(e,t){this.readChildNodes(e,t)},WellKnownName:function(e,t){t.graphicName=this.getChildValue(e)},Opacity:function(e,t){var i=this.readOgcExpression(e);i&&(t.opacity=i)},Size:function(e,t){var i=this.readOgcExpression(e);i&&(t.size=i)},Rotation:function(e,t){var i=this.readOgcExpression(e);i&&(t.rotation=i)},OnlineResource:function(e,t){t.href=this.getAttributeNS(e,this.namespaces.xlink,\"href\")},Format:function(e,t){t.graphicFormat=this.getChildValue(e)}}},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(e){var t=null;for(var i in this.cssMap)if(this.cssMap[i]==e){t=i;break}return t},getGraphicFormat:function(e){var t;for(var i in this.graphicFormats)if(this.graphicFormats[i].test(e)){t=i;break}return t||this.defautlGraphicFormat},defaultGraphicFormat:\"image/png\",graphicFormats:{\"image/jpeg\":/\\.jpe?g$/i,\"image/gif\":/\\.gif$/i,\"image/png\":/\\.png$/i},write:function(e){return this.writers.sld.StyledLayerDescriptor.apply(this,[e])},writers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(e){var t=this.createElementNSPlus(\"StyledLayerDescriptor\",{attributes:{version:this.VERSION,\"xsi:schemaLocation\":this.schemaLocation}});if(e.name&&this.writeNode(\"Name\",e.name,t),e.title&&this.writeNode(\"Title\",e.title,t),e.description&&this.writeNode(\"Abstract\",e.description,t),e.namedLayers instanceof Array)for(var i=0,r=e.namedLayers.length;i<r;++i)this.writeNode(\"NamedLayer\",e.namedLayers[i],t);else for(var n in e.namedLayers)this.writeNode(\"NamedLayer\",e.namedLayers[n],t);return t},Name:function(e){return this.createElementNSPlus(\"Name\",{value:e})},Title:function(e){return this.createElementNSPlus(\"Title\",{value:e})},Abstract:function(e){return this.createElementNSPlus(\"Abstract\",{value:e})},NamedLayer:function(e){var t=this.createElementNSPlus(\"NamedLayer\");if(this.writeNode(\"Name\",e.name,t),e.namedStyles)for(var i=0,r=e.namedStyles.length;i<r;++i)this.writeNode(\"NamedStyle\",e.namedStyles[i],t);if(e.userStyles)for(var i=0,r=e.userStyles.length;i<r;++i)this.writeNode(\"UserStyle\",e.userStyles[i],t);return t},NamedStyle:function(e){var t=this.createElementNSPlus(\"NamedStyle\");return this.writeNode(\"Name\",e,t),t},UserStyle:function(e){var t=this.createElementNSPlus(\"UserStyle\");return e.name&&this.writeNode(\"Name\",e.name,t),e.title&&this.writeNode(\"Title\",e.title,t),e.description&&this.writeNode(\"Abstract\",e.description,t),e.isDefault&&this.writeNode(\"IsDefault\",e.isDefault,t),this.writeNode(\"FeatureTypeStyle\",e,t),t},IsDefault:function(e){return this.createElementNSPlus(\"IsDefault\",{value:e?\"1\":\"0\"})},FeatureTypeStyle:function(e){for(var t=this.createElementNSPlus(\"FeatureTypeStyle\"),i=0,r=e.rules.length;i<r;++i)this.writeNode(\"Rule\",e.rules[i],t);return t},Rule:function(e){var t=this.createElementNSPlus(\"Rule\");e.name&&this.writeNode(\"Name\",e.name,t),e.title&&this.writeNode(\"Title\",e.title,t),e.description&&this.writeNode(\"Abstract\",e.description,t),e.elseFilter?this.writeNode(\"ElseFilter\",null,t):e.filter&&this.writeNode(\"ogc:Filter\",e.filter,t),void 0!=e.minScaleDenominator&&this.writeNode(\"MinScaleDenominator\",e.minScaleDenominator,t),void 0!=e.maxScaleDenominator&&this.writeNode(\"MaxScaleDenominator\",e.maxScaleDenominator,t);for(var i,r,n=OpenLayers.Style.SYMBOLIZER_PREFIXES,s=0,a=n.length;s<a;++s)i=n[s],(r=e.symbolizer[i])&&this.writeNode(i+\"Symbolizer\",r,t);return t},ElseFilter:function(){return this.createElementNSPlus(\"ElseFilter\")},MinScaleDenominator:function(e){return this.createElementNSPlus(\"MinScaleDenominator\",{value:e})},MaxScaleDenominator:function(e){return this.createElementNSPlus(\"MaxScaleDenominator\",{value:e})},LineSymbolizer:function(e){var t=this.createElementNSPlus(\"LineSymbolizer\");return this.writeNode(\"Stroke\",e,t),t},Stroke:function(e){var t=this.createElementNSPlus(\"Stroke\");return void 0!=e.strokeColor&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"strokeColor\"},t),void 0!=e.strokeOpacity&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"strokeOpacity\"},t),void 0!=e.strokeWidth&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"strokeWidth\"},t),t},CssParameter:function(e){return this.createElementNSPlus(\"CssParameter\",{attributes:{name:this.getCssProperty(e.key)},value:e.symbolizer[e.key]})},TextSymbolizer:function(e){var t=this.createElementNSPlus(\"TextSymbolizer\");return null!=e.label&&this.writeNode(\"Label\",e.label,t),null==e.fontFamily&&null==e.fontSize&&null==e.fontWeight&&null==e.fontStyle||this.writeNode(\"Font\",e,t),null==e.haloRadius&&null==e.haloColor&&null==e.haloOpacity||this.writeNode(\"Halo\",e,t),null==e.fillColor&&null==e.fillOpacity||this.writeNode(\"Fill\",e,t),t},Font:function(e){var t=this.createElementNSPlus(\"Font\");return e.fontFamily&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"fontFamily\"},t),e.fontSize&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"fontSize\"},t),e.fontWeight&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"fontWeight\"},t),e.fontStyle&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"fontStyle\"},t),t},Label:function(e){var t=this.createElementNSPlus(\"Label\"),i=e.split(\"${\");t.appendChild(this.createTextNode(i[0]));for(var r,n,s=1,a=i.length;s<a;s++)r=i[s],n=r.indexOf(\"}\"),n>0?(this.writeNode(\"ogc:PropertyName\",{property:r.substring(0,n)},t),t.appendChild(this.createTextNode(r.substring(++n)))):t.appendChild(this.createTextNode(\"${\"+r));return t},Halo:function(e){var t=this.createElementNSPlus(\"Halo\");return e.haloRadius&&this.writeNode(\"Radius\",e.haloRadius,t),(e.haloColor||e.haloOpacity)&&this.writeNode(\"Fill\",{fillColor:e.haloColor,fillOpacity:e.haloOpacity},t),t},Radius:function(e){return node=this.createElementNSPlus(\"Radius\",{value:e})},PolygonSymbolizer:function(e){var t=this.createElementNSPlus(\"PolygonSymbolizer\");return void 0==e.fillColor&&void 0==e.fillOpacity||this.writeNode(\"Fill\",e,t),void 0==e.strokeWidth&&void 0==e.strokeColor&&void 0==e.strokeOpacity&&void 0==e.strokeDashstyle||this.writeNode(\"Stroke\",e,t),t},Fill:function(e){var t=this.createElementNSPlus(\"Fill\");return e.fillColor&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"fillColor\"},t),null!=e.fillOpacity&&this.writeNode(\"CssParameter\",{symbolizer:e,key:\"fillOpacity\"},t),t},PointSymbolizer:function(e){var t=this.createElementNSPlus(\"PointSymbolizer\");return this.writeNode(\"Graphic\",e,t),t},Graphic:function(e){var t=this.createElementNSPlus(\"Graphic\");return void 0!=e.externalGraphic?this.writeNode(\"ExternalGraphic\",e,t):this.writeNode(\"Mark\",e,t),void 0!=e.graphicOpacity&&this.writeNode(\"Opacity\",e.graphicOpacity,t),void 0!=e.pointRadius&&this.writeNode(\"Size\",2*e.pointRadius,t),void 0!=e.rotation&&this.writeNode(\"Rotation\",e.rotation,t),t},ExternalGraphic:function(e){var t=this.createElementNSPlus(\"ExternalGraphic\");this.writeNode(\"OnlineResource\",e.externalGraphic,t);var i=e.graphicFormat||this.getGraphicFormat(e.externalGraphic);return this.writeNode(\"Format\",i,t),t},Mark:function(e){var t=this.createElementNSPlus(\"Mark\");return e.graphicName&&this.writeNode(\"WellKnownName\",e.graphicName,t),this.writeNode(\"Fill\",e,t),this.writeNode(\"Stroke\",e,t),t},WellKnownName:function(e){return this.createElementNSPlus(\"WellKnownName\",{value:e})},Opacity:function(e){return this.createElementNSPlus(\"Opacity\",{value:e})},Size:function(e){return this.createElementNSPlus(\"Size\",{value:e})},Rotation:function(e){return this.createElementNSPlus(\"Rotation\",{value:e})},OnlineResource:function(e){return this.createElementNSPlus(\"OnlineResource\",{attributes:{\"xlink:type\":\"simple\",\"xlink:href\":e}})},Format:function(e){return this.createElementNSPlus(\"Format\",{value:e})}}},OpenLayers.Format.Filter.v1_0_0.prototype.writers),CLASS_NAME:\"OpenLayers.Format.SLD.v1\"}),OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:\"1.0.0\",schemaLocations:{wfs:\"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd\"},initialize:function(e){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[e]),OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[e])},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(e,t){t.insertIds=[],t.success=!1,this.readChildNodes(e,t)},InsertResult:function(e,t){var i={fids:[]};this.readChildNodes(e,i),t.insertIds.push(i.fids[0])},TransactionResult:function(e,t){this.readChildNodes(e,t)},Status:function(e,t){this.readChildNodes(e,t)},SUCCESS:function(e,t){t.success=!0}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(e){e=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},e);var t=this.createElementNSPlus(\"wfs:Query\",{attributes:{typeName:(e.featureNS?e.featurePrefix+\":\":\"\")+e.featureType}});if(e.featureNS&&t.setAttribute(\"xmlns:\"+e.featurePrefix,e.featureNS),e.propertyNames)for(var i=0,r=e.propertyNames.length;i<r;i++)this.writeNode(\"ogc:PropertyName\",{property:e.propertyNames[i]},t);return e.filter&&(this.setFilterProperty(e.filter),this.writeNode(\"ogc:Filter\",e.filter,t)),t}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.writers.ogc},CLASS_NAME:\"OpenLayers.Format.WFST.v1_0_0\"}),OpenLayers.Format.WFST.v1_1_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0,OpenLayers.Format.WFST.v1,{version:\"1.1.0\",schemaLocations:{wfs:\"http://schemas.opengis.net/wfs/1.1.0/wfs.xsd\"},initialize:function(e){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[e]),OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[e])},readers:{wfs:OpenLayers.Util.applyDefaults({TransactionResponse:function(e,t){t.insertIds=[],t.success=!1,this.readChildNodes(e,t)},TransactionSummary:function(e,t){t.success=!0},InsertResults:function(e,t){this.readChildNodes(e,t)},Feature:function(e,t){var i={fids:[]};this.readChildNodes(e,i),t.insertIds.push(i.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(e){e=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},e);var t=this.createElementNSPlus(\"wfs:Query\",{attributes:{typeName:(e.featureNS?e.featurePrefix+\":\":\"\")+e.featureType,srsName:e.srsName}});if(e.featureNS&&t.setAttribute(\"xmlns:\"+e.featurePrefix,e.featureNS),e.propertyNames)for(var i=0,r=e.propertyNames.length;i<r;i++)this.writeNode(\"wfs:PropertyName\",{property:e.propertyNames[i]},t);return e.filter&&(this.setFilterProperty(e.filter),this.writeNode(\"ogc:Filter\",e.filter,t)),t},PropertyName:function(e){return this.createElementNSPlus(\"wfs:PropertyName\",{value:e.property})}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:\"OpenLayers.Format.WFST.v1_1_0\"}),OpenLayers.Format.SLD.v1_0_0=OpenLayers.Class(OpenLayers.Format.SLD.v1,{VERSION:\"1.0.0\",schemaLocation:\"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd\",initialize:function(e){OpenLayers.Format.SLD.v1.prototype.initialize.apply(this,[e])},CLASS_NAME:\"OpenLayers.Format.SLD.v1_0_0\"}),OpenLayers.Protocol.WFS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:\"1.0.0\",CLASS_NAME:\"OpenLayers.Protocol.WFS.v1_0_0\"}),OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:\"1.1.0\",CLASS_NAME:\"OpenLayers.Protocol.WFS.v1_1_0\"});"

/***/ }

});