/*
 * Tine 2.0 USER CLIENT
 * 
 * license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * copyright   Copyright (c) 2007-2010 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * FOR MORE DETAILED LICENSE AND COPYRIGHT INFORMATION PLEASE CONSULT THE LICENSE FILE 
 * LOCATED AT: <YOUR TINE 2.0 URL>/LICENSE OR VISIT THE TINE 2.0 HOMEPAGE AT http://www.tine20.org
 */
Ext.apply(Ext.form.HtmlEditor.prototype,{fixKeys:function(){if(Ext.isIE){return function(f){var a=f.getKey(),d=this.getDoc(),b;if(a==f.TAB){f.stopEvent();b=d.selection.createRange();if(b){b.collapse(true);b.pasteHTML("&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}else{if(a==f.ENTER){b=d.selection.createRange();if(b){var c=b.parentElement();if(!c||c.tagName.toLowerCase()!="li"){f.stopEvent();b.pasteHTML("<br />");b.collapse(false);b.select()}}}}}}else{if(Ext.isOpera){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.win.focus();this.execCmd("InsertHTML","&nbsp;&nbsp;&nbsp;&nbsp;");this.deferFocus()}}}else{if(Ext.isWebKit){return function(b){var a=b.getKey();if(a==b.TAB){b.stopEvent();this.execCmd("InsertText","\t");this.deferFocus()}}}}}}()});Ext.apply(Ext.form.VTypes,{emailFixed:/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i,email:function(a){return this.emailFixed.test(a)}});Ext.override(Ext.form.TextField,{validator:function(a){return this.allowBlank!==false||Ext.util.Format.trim(a).length>0}});Ext.applyIf(Ext.tree.MultiSelectionModel.prototype,{getSelectedNode:function(){var a=this.getSelectedNodes();return Ext.isArray(a)?a[0]:null}});Ext.form.DateField.prototype.setValue=function(a){this.fullDateTime=a;Ext.form.DateField.superclass.setValue.call(this,this.formatDate(this.parseDate(a)))};Ext.form.DateField.prototype.getValue=function(){value=this.fullDateTime;return value||""};Date.parseIso=function(a){return Date.parseDate(a.replace(/\+\d{2}\d{2}/,""),"Y-m-d\\Th:i:s")};Ext.Window.prototype.rename=function(a){var b=this.manager||Ext.WindowMgr;b.unregister(this);this.id=a;b.register(this)};Ext.ButtonToggleMgr=function(){var a={};function b(f,j){if(j){var h=a[f.toggleGroup];for(var d=0,c=h.length;d<c;d++){if(h[d]!=f){h[d].toggle(false)}}}}return{register:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(!d){d=a[c.toggleGroup]=[]}d.push(c);c.on("toggle",b)},unregister:function(c){if(!c.toggleGroup){return}var d=a[c.toggleGroup];if(d){d.remove(c);c.un("toggle",b)}},getSelected:function(f,j,h){var k=a[f];for(var d=0,c=k.length;d<c;d++){if(k[d].pressed===true){if(j){j.call(h||k[d],k[d])}return k[d]}}return}}}();
/*
 * Ext JS Library 3.2.1
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.ux.Portal=Ext.extend(Ext.Panel,{layout:"column",autoScroll:true,cls:"x-portal",defaultType:"portalcolumn",initComponent:function(){Ext.ux.Portal.superclass.initComponent.call(this);this.addEvents({validatedrop:true,beforedragover:true,dragover:true,beforedrop:true,drop:true})},initEvents:function(){Ext.ux.Portal.superclass.initEvents.call(this);this.dd=new Ext.ux.Portal.DropZone(this,this.dropConfig)},beforeDestroy:function(){if(this.dd){this.dd.unreg()}Ext.ux.Portal.superclass.beforeDestroy.call(this)}});Ext.reg("portal",Ext.ux.Portal);Ext.ux.Portal.DropZone=Ext.extend(Ext.dd.DropTarget,{constructor:function(a,b){this.portal=a;Ext.dd.ScrollManager.register(a.body);Ext.ux.Portal.DropZone.superclass.constructor.call(this,a.bwrap.dom,b);a.body.ddScrollConfig=this.ddScrollConfig},ddScrollConfig:{vthresh:50,hthresh:-1,animate:true,increment:200},createEvent:function(a,f,d,b,h,g){return{portal:this.portal,panel:d.panel,columnIndex:b,column:h,position:g,data:d,source:a,rawEvent:f,status:this.dropAllowed}},notifyOver:function(z,v,A){var f=v.getXY(),a=this.portal,q=z.proxy;if(!this.grid){this.grid=this.getGrid()}var b=a.body.dom.clientWidth;if(!this.lastCW){this.lastCW=b}else{if(this.lastCW!=b){this.lastCW=b;a.doLayout();this.grid=this.getGrid()}}var d=0,m=this.grid.columnX,o=false;for(var u=m.length;d<u;d++){if(f[0]<(m[d].x+m[d].w)){o=true;break}}if(!o){d--}var s,l=false,j=0,w=a.items.itemAt(d),r=w.items.items,k=false;for(var u=r.length;j<u;j++){s=r[j];var t=s.el.getHeight();if(t===0){k=true}else{if((s.el.getY()+(t/2))>f[1]){l=true;break}}}j=(l&&s?j:w.items.getCount())+(k?-1:0);var g=this.createEvent(z,v,A,d,w,j);if(a.fireEvent("validatedrop",g)!==false&&a.fireEvent("beforedragover",g)!==false){q.getProxy().setWidth("auto");if(s){q.moveProxy(s.el.dom.parentNode,l?s.el.dom:null)}else{q.moveProxy(w.el.dom,null)}this.lastPos={c:w,col:d,p:k||(l&&s)?j:false};this.scrollPos=a.body.getScroll();a.fireEvent("dragover",g);return g.status}else{return g.status}},notifyOut:function(){delete this.grid},notifyDrop:function(m,h,g){delete this.grid;if(!this.lastPos){return}var k=this.lastPos.c,f=this.lastPos.col,l=this.lastPos.p,a=m.panel,b=this.createEvent(m,h,g,f,k,l!==false?l:k.items.getCount());if(this.portal.fireEvent("validatedrop",b)!==false&&this.portal.fireEvent("beforedrop",b)!==false){m.proxy.getProxy().remove();a.el.dom.parentNode.removeChild(m.panel.el.dom);if(l!==false){k.insert(l,a)}else{k.add(a)}k.doLayout();this.portal.fireEvent("drop",b);var o=this.scrollPos.top;if(o){var j=this.portal.body.dom;setTimeout(function(){j.scrollTop=o},10)}}delete this.lastPos},getGrid:function(){var a=this.portal.bwrap.getBox();a.columnX=[];this.portal.items.each(function(b){a.columnX.push({x:b.el.getX(),w:b.el.getWidth()})});return a},unreg:function(){Ext.dd.ScrollManager.unregister(this.portal.body);Ext.ux.Portal.DropZone.superclass.unreg.call(this)}});
/*
 * Ext JS Library 3.2.1
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.ux.PortalColumn=Ext.extend(Ext.Container,{layout:"anchor",defaultType:"portlet",cls:"x-portal-column"});Ext.reg("portalcolumn",Ext.ux.PortalColumn);
/*
 * Ext JS Library 3.2.1
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.ux.Portlet=Ext.extend(Ext.Panel,{anchor:"100%",frame:true,collapsible:true,draggable:true,cls:"x-portlet"});Ext.reg("portlet",Ext.ux.Portlet);if(!window.console){window.console={}}for(fn in {log:null,debug:null,info:null,warn:null,error:null,assert:null,dir:null,dirxml:null,group:null,groupEnd:null,time:null,timeEnd:null,count:null,trace:null,profile:null,profileEnd:null}){window.console[fn]=window.console[fn]||function(){}}if(window.google&&google.gears){var permission=google.gears.factory.getPermission("Tine 2.0","images/oxygen/32x32/actions/dialog-information.png","Tine 2.0 detected that gears is installed on your computer. Permitting Tine 2.0 to store information on your computer, will increase speed of the software.");if(permission){try{google.gears.localServer=google.gears.factory.create("beta.localserver");google.gears.localServer.store=google.gears.localServer.createManagedStore("tine20-store");google.gears.localServer.store.manifestUrl="Tinebase/js/tine20-manifest.js";google.gears.localServer.store.checkForUpdate();if(google.gears.localServer.store.updateStatus==3){console.info("gears localserver store failure: "+google.gears.localServer.store.lastErrorMessage);google.gears.localServer.removeManagedStore("tine20-store")}}catch(e){console.info("can't initialize gears: "+e)}}}Ext.BLANK_IMAGE_URL="library/ExtJS/resources/images/default/s.gif";Ext.chart.Chart.CHART_URL="library/ExtJS/resources/charts.swf";Ext.QuickTips.init();Ext.grid.ColumnModel.defaultRenderer=Ext.util.Format.htmlEncode;Ext.grid.Column.prototype.renderer=function(b){var a=Ext.util.Format.htmlEncode(b);return a};Ext.apply(Ext.data.JsonStore.prototype,{url:"index.php",root:"results",idProperty:"id",totalProperty:"totalcount"});Ext.form.ComboBox.prototype.initComponent=Ext.form.ComboBox.prototype.initComponent.createSequence(function(){if(this.expandOnFocus){this.lazyInit=false;this.on("focus",function(){this.onTriggerClick()})}if(this.blurOnSelect){this.on("select",function(){this.blur(true);this.fireEvent("blur",this)},this)}});Ext.form.ComboBox.prototype.triggerAction="all";Date.patterns={ISO8601Long:"Y-m-d H:i:s",ISO8601Short:"Y-m-d",ISO8601Time:"H:i:s",ShortDate:"n/j/Y",LongDate:"l, F d, Y",FullDateTime:"l, F d, Y g:i:s A",MonthDay:"F d",ShortTime:"g:i A",LongTime:"g:i:s A",SortableDateTime:"Y-m-d\\TH:i:s",UniversalSortableDateTime:"Y-m-d H:i:sO",YearMonth:"F, Y"};Ext.util.JSON.encodeDate=function(b){var a=function(c){return c<10?"0"+c:c};return'"'+b.getFullYear()+"-"+a(b.getMonth()+1)+"-"+a(b.getDate())+" "+a(b.getHours())+":"+a(b.getMinutes())+":"+a(b.getSeconds())+'"'};Ext.util.Format=Ext.apply(Ext.util.Format,{euMoney:function(a){a.toString().replace(/,/,".");a=(Math.round(parseFloat(a)*100))/100;a=(a==Math.floor(a))?a+".00":((a*10==Math.floor(a*10))?a+"0":a);a=String(a);var f=a.split(".");var d=f[0];var b=f[1]?"."+f[1]:".00";var c=/(\d+)(\d{3})/;while(c.test(d)){d=d.replace(c,"$1.$2")}a=d+b;if(a.charAt(0)=="-"){return a.substr(1)+" -€"}return a+" €"},percentage:function(a){if(a===null){return"none"}if(!isNaN(a)){return a+" %"}},pad:function(b,a,f){if(!f){f="&nbsp;"}var d=a-b.length;for(var c=0;c<d;c++){b+=f}return b}});if(typeof Locale=="undefined"){var Locale=function(b,a){this._instance=true;this.LC_ALL="C";this.LC_COLLATE="C";this.LC_CTYPE="C";this.LC_MESSAGES="C";this.LC_MONETARY="C";this.LC_NUMERIC="C";this.LC_TIME="C";this.setlocale(b,a)}}Locale.VERSION="0.0.3";Locale.EXPORT=["LC_ALL","LC_COLLATE","LC_CTYPE","LC_MESSAGES","LC_MONETARY","LC_NUMERIC","LC_TIME"];Locale.EXPORT_OK=["setlocale"];Locale.EXPORT_TAGS={":common":Locale.EXPORT,":all":Locale.EXPORT.concat(Locale.EXPORT_OK)};Locale.prototype.TranslationLists={};Locale.LC_ALL="LC_ALL";Locale.LC_COLLATE="LC_COLLATE";Locale.LC_CTYPE="LC_CTYPE";Locale.LC_MESSAGES="LC_MESSAGES";Locale.LC_MONETARY="LC_MONETARY";Locale.LC_NUMERIC="LC_NUMERIC";Locale.LC_TIME="LC_TIME";Locale.setlocale=Locale.prototype.setlocale=function(b,a){return function(){if(a===null||typeof a=="undefined"){return this[b]}if(a==""){a=(window.navigator.browserLanguage||window.navigator.language||"C").replace(/^(.{2}).?(.{2})?.*$/,function(c,d,f){return d.toLowerCase()+(f?"_"+f.toUpperCase():"")})}switch(b){case Locale.LC_ALL:this.LC_ALL=a;this.LC_COLLATE=a;this.LC_CTYPE=a;this.LC_MESSAGES=a;this.LC_MONETARY=a;this.LC_NUMERIC=a;this.LC_TIME=a;break;case Locale.LC_COLLATE:case Locale.LC_CTYPE:case Locale.LC_MESSAGES:case Locale.LC_MONETARY:case Locale.LC_NUMERIC:case Locale.LC_TIME:this[b]=a;break;default:return false}return a}.call(this._instance?this:arguments.callee)};Locale.setlocale.LC_ALL="C";Locale.setlocale.LC_COLLATE="C";Locale.setlocale.LC_CTYPE="C";Locale.setlocale.LC_MESSAGES="C";Locale.setlocale.LC_MONETARY="C";Locale.setlocale.LC_NUMERIC="C";Locale.setlocale.LC_TIME="C";Locale.getTranslationData=function(b,a){var c="";if(Locale.prototype.TranslationLists[b]&&Locale.prototype.TranslationLists[b][a]){c=Locale.prototype.TranslationLists[b][a]}return c};Locale.getTranslationList=function(a){return Locale.prototype.TranslationLists[a]};Locale.Gettext=function(a){this.locale=typeof a=="string"?new Locale(Locale.LC_ALL,a):a||Locale;this.domain="messages";this.category=Locale.LC_MESSAGES;this.suffix="po";this.dir="."};Locale.Gettext.prototype.bindtextdomain=function(b,a){this.dir=a;this.domain=b};Locale.Gettext.prototype.textdomain=function(a){this.domain=a};Locale.Gettext.prototype.getmsg=function(d,c,b){var a=this._getkey(c,d);return Locale.Gettext.prototype._msgs[a]};Locale.Gettext.prototype._msgs={};Locale.Gettext.prototype._getkey=function(a,b){return this.dir+"/"+a+"/"+b};Locale.Gettext.prototype.dcgettext=function(c,b,a){var d=this.getmsg(c,a);return d?d.get(b)||b:b};Locale.Gettext.prototype.dcngettext=function(d,c,a,g,b){var f=this.getmsg(d,b);if(f){return(f.get(c,a)||[c,a])[f.plural(g)]}else{return g>1?a:c}};Locale.Gettext.prototype.dgettext=function(b,a){return this.dcgettext(b,a,this.category)};Locale.Gettext.prototype.dngettext=function(c,b,a,d){return this.dcngettext(c,b,a,d,this.category)};Locale.Gettext.prototype.gettext=Locale.Gettext.prototype._=Locale.Gettext.prototype._hidden=function(a){return this.dcgettext(this.domain,a,this.category)};Locale.Gettext.prototype.ngettext=Locale.Gettext.prototype.n_=Locale.Gettext.prototype.n_hidden=function(b,a,c){return this.dcngettext(this.domain,b,a,c,this.category)};Locale.Gettext.prototype.gettext_noop=Locale.Gettext.prototype.N_=function(a){return a};(function(){for(var a in Locale.Gettext.prototype){Locale.Gettext[a]=function(b){return function(){return b.apply(Locale.Gettext,arguments)}}(Locale.Gettext.prototype[a])}})();if(typeof Locale.Gettext.PO=="undefined"){Locale.Gettext.PO=function(a){if(typeof a=="string"||a instanceof String){this.msg=Locale.Gettext.PO.po2object(a)}else{if(a instanceof Object){this.msg=a}else{this.msg={}}}}}Locale.Gettext.PO.prototype.get=function(b,a){return typeof a!="undefined"?this.msg[b+", "+a]:this.msg[b]};Locale.Gettext.PO.prototype.plural=function(n){var nplurals,plural;eval((this.msg[""]+"Plural-Forms: nplurals=2; plural=n != 1\n").match(/Plural-Forms:(.*)\n/)[1]);return plural===true?1:plural===false?0:plural};Locale.Gettext.prototype._msgs.emptyDomain=new Locale.Gettext.PO(({}));var OpenLayers={singleFile:true};(function(){var j=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!j)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var s="";var u=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var o=document.getElementsByTagName("script");for(var r=0,h=o.length;r<h;r++){var t=o[r].getAttribute("src");if(t){var q=t.match(u);if(q){s=q[1];break}}}return s}};if(!j){var k=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/ArcGIS93Rest.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/ArcIMS.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/XYZ.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/Snapping.js","OpenLayers/Control/Split.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Control/WMSGetFeatureInfo.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/Vector/RootContainer.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Strategy/Save.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Protocol/WFS.js","OpenLayers/Protocol/WFS/v1.js","OpenLayers/Protocol/WFS/v1_0_0.js","OpenLayers/Protocol/WFS/v1_1_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/ArcXML.js","OpenLayers/Format/ArcXML/Features.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WFSCapabilities.js","OpenLayers/Format/WFSCapabilities/v1.js","OpenLayers/Format/WFSCapabilities/v1_0_0.js","OpenLayers/Format/WFSCapabilities/v1_1_0.js","OpenLayers/Format/WFSDescribeFeatureType.js","OpenLayers/Format/WMSDescribeLayer.js","OpenLayers/Format/WMSDescribeLayer/v1_1.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Filter/v1_1_0.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/WFST.js","OpenLayers/Format/WFST/v1.js","OpenLayers/Format/WFST/v1_0_0.js","OpenLayers/Format/WFST/v1_1_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Format/WMSCapabilities.js","OpenLayers/Format/WMSCapabilities/v1_1.js","OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/GetFeature.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var b=navigator.userAgent;var d=(b.match("MSIE")||b.match("Safari"));if(d){var a=new Array(k.length)}var l=OpenLayers._getScriptLocation()+"lib/";for(var c=0,g=k.length;c<g;c++){if(d){a[c]="<script src='"+l+k[c]+"'><\/script>"}else{var m=document.createElement("script");m.src=l+k[c];var f=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;f.appendChild(m)}}if(d){document.write(a.join(""))}}})();OpenLayers.VERSION_NUMBER="OpenLayers 2.8 -- $Revision: 9492 $";OpenLayers.String={startsWith:function(b,a){return(b.indexOf(a)==0)},contains:function(b,a){return(b.indexOf(a)!=-1)},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(g){var d=g.split("-");var b=d[0];for(var c=1,a=d.length;c<a;c++){var f=d[c];b+=f.charAt(0).toUpperCase()+f.substring(1)}return b},format:function(d,c,a){if(!c){c=window}var b=function(k,f){var j;var h=f.split(/\.+/);for(var g=0;g<h.length;g++){if(g==0){j=c}j=j[h[g]]}if(typeof j=="function"){j=a?j.apply(null,a):j()}if(typeof j=="undefined"){return"undefined"}else{return j}};return d.replace(OpenLayers.String.tokenRegEx,b)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)},numericIf:function(a){return OpenLayers.String.isNumeric(a)?parseFloat(a):a}};if(!String.prototype.startsWith){String.prototype.startsWith=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,a)}}if(!String.prototype.contains){String.prototype.contains=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,a)}}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));return OpenLayers.String.trim(this)}}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return OpenLayers.String.camelize(this)}}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(a,c){var b=0;if(c>0){b=parseFloat(a.toPrecision(c))}return b},format:function(c,a,h,k){a=(typeof a!="undefined")?a:0;h=(typeof h!="undefined")?h:OpenLayers.Number.thousandsSeparator;k=(typeof k!="undefined")?k:OpenLayers.Number.decimalSeparator;if(a!=null){c=parseFloat(c.toFixed(a))}var b=c.toString().split(".");if(b.length==1&&a==null){a=0}var d=b[0];if(h){var f=/(-?[0-9]+)([0-9]{3})/;while(f.test(d)){d=d.replace(f,"$1"+h+"$2")}}var g;if(a==0){g=d}else{var j=b.length>1?b[1]:"0";if(a!=null){j=j+new Array(a-j.length+1).join("0")}g=d+k+j}return g}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,a)}}OpenLayers.Function={bind:function(c,b){var a=Array.prototype.slice.apply(arguments,[2]);return function(){var d=a.concat(Array.prototype.slice.apply(arguments,[0]));return c.apply(b,d)}},bindAsEventListener:function(b,a){return function(c){return b.call(a,c||window.event)}}};if(!Function.prototype.bind){Function.prototype.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bind"}));Array.prototype.unshift.apply(arguments,[this]);return OpenLayers.Function.bind.apply(null,arguments)}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,a)}}OpenLayers.Array={filter:function(h,g,b){var d=[];if(Array.prototype.filter){d=h.filter(g,b)}else{var a=h.length;if(typeof g!="function"){throw new TypeError()}for(var c=0;c<a;c++){if(c in h){var f=h[c];if(g.call(b,f,c,h)){d.push(f)}}}}return d}};OpenLayers.Class=function(){var d=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var c={};var g,b;for(var f=0,a=arguments.length;f<a;++f){if(typeof arguments[f]=="function"){if(f==0&&a>1){b=arguments[f].prototype.initialize;arguments[f].prototype.initialize=function(){};c=new arguments[f];if(b===undefined){delete arguments[f].prototype.initialize}else{arguments[f].prototype.initialize=b}}g=arguments[f].prototype}else{g=arguments[f]}OpenLayers.Util.extend(c,g)}d.prototype=c;return d};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}}};OpenLayers.Class.inherit=function(){var d=arguments[0];var f=new d(OpenLayers.Class.isPrototype);for(var c=1,a=arguments.length;c<a;c++){if(typeof arguments[c]=="function"){var b=arguments[c];arguments[c]=new b(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(f,arguments[c])}return f};OpenLayers.Util={};OpenLayers.Util.getElement=function(){var d=[];for(var c=0,a=arguments.length;c<a;c++){var b=arguments[c];if(typeof b=="string"){b=document.getElementById(b)}if(arguments.length==1){return b}d.push(b)}return d};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(a,f){a=a||{};if(f){for(var d in f){var c=f[d];if(c!==undefined){a[d]=c}}var b=typeof window.Event=="function"&&f instanceof window.Event;if(!b&&f.hasOwnProperty&&f.hasOwnProperty("toString")){a.toString=f.toString}}return a};OpenLayers.Util.removeItem=function(c,b){for(var a=c.length-1;a>=0;a--){if(c[a]==b){c.splice(a,1)}}return c};OpenLayers.Util.clearArray=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));a.length=0};OpenLayers.Util.indexOf=function(d,c){for(var b=0,a=d.length;b<a;b++){if(d[b]==c){return b}}return -1};OpenLayers.Util.modifyDOMElement=function(f,j,d,g,a,c,h,b){if(j){f.id=j}if(d){f.style.left=d.x+"px";f.style.top=d.y+"px"}if(g){f.style.width=g.w+"px";f.style.height=g.h+"px"}if(a){f.style.position=a}if(c){f.style.border=c}if(h){f.style.overflow=h}if(parseFloat(b)>=0&&parseFloat(b)<1){f.style.filter="alpha(opacity="+(b*100)+")";f.style.opacity=b}else{if(parseFloat(b)==1){f.style.filter="";f.style.opacity=""}}};OpenLayers.Util.createDiv=function(a,k,j,g,f,c,b,h){var d=document.createElement("div");if(g){d.style.backgroundImage="url("+g+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!f){f="absolute"}OpenLayers.Util.modifyDOMElement(d,a,k,j,f,c,b,h);return d};OpenLayers.Util.createImage=function(a,j,h,f,d,c,g,k){var b=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!d){d="relative"}OpenLayers.Util.modifyDOMElement(b,a,j,h,d,c,null,g);if(k){b.style.display="none";OpenLayers.Event.observe(b,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,b));OpenLayers.Event.observe(b,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,b))}b.style.alt=a;b.galleryImg="no";if(f){b.src=f}return b};OpenLayers.Util.setOpacity=function(b,a){OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,a)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor="transparent";this.style.display=""}};OpenLayers.Util.onImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var d=this.urls;if(d&&d instanceof Array&&d.length>1){var f=this.src.toString();var c,a;for(a=0;c=d[a];a++){if(f.indexOf(c)!=-1){break}}var g=Math.floor(d.length*Math.random());var b=d[g];a=0;while(b==c&&a++<4){g=Math.floor(d.length*Math.random());b=d[g]}this.src=f.replace(c,b)}else{this.src=this.src}}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var d=navigator.appVersion.split("MSIE");var a=parseFloat(d[1]);var b=false;try{b=!!(document.body.filters)}catch(c){}OpenLayers.Util.alphaHackNeeded=(b&&(a>=5.5)&&(a<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(a,b,l,k,h,g,c,d,j){OpenLayers.Util.modifyDOMElement(a,b,l,k,g,null,null,j);var f=a.childNodes[0];if(h){f.src=h}OpenLayers.Util.modifyDOMElement(f,a.id+"_innerImage",null,k,"relative",c);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(d==null){d="scale"}a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f.src+"', sizingMethod='"+d+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}f.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(b,l,k,h,g,c,d,j,m){var a=OpenLayers.Util.createDiv();var f=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);a.appendChild(f);if(m){f.style.display="none";OpenLayers.Event.observe(f,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,a));OpenLayers.Event.observe(f,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,a))}OpenLayers.Util.modifyAlphaImageDiv(a,b,l,k,h,g,c,d,j);return a};OpenLayers.Util.upperCaseObject=function(b){var a={};for(var c in b){a[c.toUpperCase()]=b[c]}return a};OpenLayers.Util.applyDefaults=function(d,c){d=d||{};var b=typeof window.Event=="function"&&c instanceof window.Event;for(var a in c){if(d[a]===undefined||(!b&&c.hasOwnProperty&&c.hasOwnProperty(a)&&!d.hasOwnProperty(a))){d[a]=c[a]}}if(!b&&c&&c.hasOwnProperty&&c.hasOwnProperty("toString")&&!d.hasOwnProperty("toString")){d.toString=c.toString}return d};OpenLayers.Util.getParameterString=function(j){var h=[];for(var c in j){var f=j[c];if((f!=null)&&(typeof f!="function")){var b;if(typeof f=="object"&&f.constructor==Array){var g=[];for(var d=0,a=f.length;d<a;d++){g.push(encodeURIComponent(f[d]))}b=g.join(",")}else{b=encodeURIComponent(f)}h.push(encodeURIComponent(c)+"="+b)}}return h.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var d=null;for(var c=0,a=arguments.length;c<a;c++){var b=arguments[c];try{d=b();break}catch(f){}}return d};OpenLayers.Util.getNodes=function(c,b){var a=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(c.documentElement.childNodes,b)},function(){return OpenLayers.Util._getNodes(c.childNodes,b)});return a};OpenLayers.Util._getNodes=function(c,f){var b=[];for(var d=0,a=c.length;d<a;d++){if(c[d].nodeName==f){b.push(c[d])}}return b};OpenLayers.Util.getTagText=function(c,d,b){var a=OpenLayers.Util.getNodes(c,d);if(a&&(a.length>0)){if(!b){b=0}if(a[b].childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a[b].childNodes.length==1){return a[b].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(a){var b=null;OpenLayers.Util.Try(function(){b=a.text;if(!b){b=a.textContent}if(!b){b=a.firstChild.nodeValue}},function(){b=a.textContent});return b};OpenLayers.Util.mouseLeft=function(a,c){var b=(a.relatedTarget)?a.relatedTarget:a.toElement;while(b!=c&&b!=null){b=b.parentNode}return(b!=c)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(b,a){if(a==null){a=OpenLayers.Util.DEFAULT_PRECISION}var b;if(a==0){b=parseFloat(b)}else{b=parseFloat(parseFloat(b).toPrecision(a))}return b};OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.distVincenty=function(h,c){var R=6378137,Q=6356752.3142,M=1/298.257223563;var q=OpenLayers.Util.rad(c.lon-h.lon);var P=Math.atan((1-M)*Math.tan(OpenLayers.Util.rad(h.lat)));var O=Math.atan((1-M)*Math.tan(OpenLayers.Util.rad(c.lat)));var o=Math.sin(P),k=Math.cos(P);var m=Math.sin(O),j=Math.cos(O);var v=q,r=2*Math.PI;var u=20;while(Math.abs(v-r)>1e-12&&--u>0){var H=Math.sin(v),g=Math.cos(v);var S=Math.sqrt((j*H)*(j*H)+(k*m-o*j*g)*(k*m-o*j*g));if(S==0){return 0}var J=o*m+k*j*g;var G=Math.atan2(S,J);var l=Math.asin(k*j*H/S);var K=Math.cos(l)*Math.cos(l);var t=J-2*o*m/K;var D=M/16*K*(4+M*(4-3*K));r=v;v=q+(1-D)*M*Math.sin(l)*(G+D*S*(t+D*J*(-1+2*t*t)))}if(u==0){return NaN}var z=K*(R*R-Q*Q)/(Q*Q);var F=1+z/16384*(4096+z*(-768+z*(320-175*z)));var E=z/1024*(256+z*(-128+z*(74-47*z)));var I=E*S*(t+E/4*(J*(-1+2*t*t)-E/6*t*(-3+4*S*S)*(-3+4*t*t)));var w=Q*F*(G-I);var N=w.toFixed(3)/1000;return N};OpenLayers.Util.getParameters=function(b){b=b||window.location.href;var a="";if(OpenLayers.String.contains(b,"?")){var c=b.indexOf("?")+1;var f=OpenLayers.String.contains(b,"#")?b.indexOf("#"):b.length;a=b.substring(c,f)}var r={};var d=a.split(/[&;]/);for(var k=0,l=d.length;k<l;++k){var h=d[k].split("=");if(h[0]){var o=decodeURIComponent(h[0]);var m=h[1]||"";m=m.split(",");for(var g=0,q=m.length;g<q;g++){m[g]=decodeURIComponent(m[g])}if(m.length==1){m=m[0]}r[o]=m}}return r};OpenLayers.Util.getArgs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(a)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(a){if(a==null){a="id_"}OpenLayers.Util.lastSeqID+=1;return a+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.METERS_PER_INCH=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(b){var a=(b>1)?(1/b):b;return a};OpenLayers.Util.getResolutionFromScale=function(d,a){if(a==null){a="degrees"}var c=OpenLayers.Util.normalizeScale(d);var b=1/(c*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH);return b};OpenLayers.Util.getScaleFromResolution=function(b,a){if(a==null){a="degrees"}var c=b*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH;return c};OpenLayers.Util.safeStopPropagation=function(a){OpenLayers.Event.stop(a,true)};OpenLayers.Util.pagePosition=function(f){var a=0,d=0;var b=f;var g=f;while(b){if(b==document.body){if(OpenLayers.Element.getStyle(g,"position")=="absolute"){break}}a+=b.offsetTop||0;d+=b.offsetLeft||0;g=b;try{b=b.offsetParent}catch(c){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:b.id}));break}}b=f;while(b){a-=b.scrollTop||0;d-=b.scrollLeft||0;b=b.parentNode}return[d,a]};OpenLayers.Util.isEquivalentUrl=function(g,f,c){c=c||{};OpenLayers.Util.applyDefaults(c,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=OpenLayers.Util.createUrlObject(g,c);var a=OpenLayers.Util.createUrlObject(f,c);for(var d in b){if(d!=="args"){if(b[d]!=a[d]){return false}}}for(var d in b.args){if(b.args[d]!=a.args[d]){return false}delete a.args[d]}for(var d in a.args){return false}return true};OpenLayers.Util.createUrlObject=function(c,m){m=m||{};if(!(/^\w+:\/\//).test(c)){var h=window.location;var f=h.port?":"+h.port:"";var j=h.protocol+"//"+h.host.split(":").shift()+f;if(c.indexOf("/")===0){c=j+c}else{var g=h.pathname.split("/");g.pop();c=j+g.join("/")+"/"+c}}if(m.ignoreCase){c=c.toLowerCase()}var k=document.createElement("a");k.href=c;var d={};d.host=k.host.split(":").shift();d.protocol=k.protocol;if(m.ignorePort80){d.port=(k.port=="80"||k.port=="0")?"":k.port}else{d.port=(k.port==""||k.port=="0")?"80":k.port}d.hash=(m.ignoreHash||k.hash==="#")?"":k.hash;var b=k.search;if(!b){var l=c.indexOf("?");b=(l!=-1)?c.substr(l):""}d.args=OpenLayers.Util.getParameters(b);d.pathname=(k.pathname.charAt(0)=="/")?k.pathname:"/"+k.pathname;return d};OpenLayers.Util.removeTail=function(b){var c=null;var a=b.indexOf("?");var d=b.indexOf("#");if(a==-1){c=(d!=-1)?b.substr(0,d):b}else{c=(d!=-1)?b.substr(0,Math.min(a,d)):b.substr(0,a)}return c};OpenLayers.Util.getBrowserName=function(){var b="";var a=navigator.userAgent.toLowerCase();if(a.indexOf("opera")!=-1){b="opera"}else{if(a.indexOf("msie")!=-1){b="msie"}else{if(a.indexOf("safari")!=-1){b="safari"}else{if(a.indexOf("mozilla")!=-1){if(a.indexOf("firefox")!=-1){b="firefox"}else{b="mozilla"}}}}}return b};OpenLayers.Util.getRenderedDimensions=function(b,r,s){var m,f;var a=document.createElement("div");a.style.visibility="hidden";var q=(s&&s.containerElement)?s.containerElement:document.body;if(r){if(r.w){m=r.w;a.style.width=m+"px"}else{if(r.h){f=r.h;a.style.height=f+"px"}}}if(s&&s.displayClass){a.className=s.displayClass}var g=document.createElement("div");g.innerHTML=b;g.style.overflow="visible";if(g.childNodes){for(var d=0,c=g.childNodes.length;d<c;d++){if(!g.childNodes[d].style){continue}g.childNodes[d].style.overflow="visible"}}a.appendChild(g);q.appendChild(a);var o=false;var k=a.parentNode;while(k&&k.tagName.toLowerCase()!="body"){var j=OpenLayers.Element.getStyle(k,"position");if(j=="absolute"){o=true;break}else{if(j&&j!="static"){break}}k=k.parentNode}if(!o){a.style.position="absolute"}if(!m){m=parseInt(g.scrollWidth);a.style.width=m+"px"}if(!f){f=parseInt(g.scrollHeight)}a.removeChild(g);q.removeChild(a);return new OpenLayers.Size(m,f)};OpenLayers.Util.getScrollbarWidth=function(){var c=OpenLayers.Util._scrollbarWidth;if(c==null){var f=null;var d=null;var a=0;var b=0;f=document.createElement("div");f.style.position="absolute";f.style.top="-1000px";f.style.left="-1000px";f.style.width="100px";f.style.height="50px";f.style.overflow="hidden";d=document.createElement("div");d.style.width="100%";d.style.height="200px";f.appendChild(d);document.body.appendChild(f);a=d.offsetWidth;f.style.overflow="scroll";b=d.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(a-b);c=OpenLayers.Util._scrollbarWidth}return c};OpenLayers.Rico=new Object();OpenLayers.Rico.Corner={round:function(d,b){d=OpenLayers.Util.getElement(d);this._setOptions(b);var a=this.options.color;if(this.options.color=="fromElement"){a=this._background(d)}var c=this.options.bgColor;if(this.options.bgColor=="fromParent"){c=this._background(d.offsetParent)}this._roundCornersImpl(d,a,c)},changeColor:function(c,b){c.style.backgroundColor=b;var a=c.parentNode.getElementsByTagName("span");for(var d=0;d<a.length;d++){a[d].style.backgroundColor=b}},changeOpacity:function(c,g){var d=g;var a="alpha(opacity="+g*100+")";c.style.opacity=d;c.style.filter=a;var b=c.parentNode.getElementsByTagName("span");for(var f=0;f<b.length;f++){b[f].style.opacity=d;b[f].style.filter=a}},reRound:function(d,c){var b=d.parentNode.childNodes[0];var a=d.parentNode.childNodes[2];d.parentNode.removeChild(b);d.parentNode.removeChild(a);this.round(d.parentNode,c)},_roundCornersImpl:function(c,a,b){if(this.options.border){this._renderBorder(c,b)}if(this._isTopRounded()){this._roundTopCorners(c,a,b)}if(this._isBottomRounded()){this._roundBottomCorners(c,a,b)}},_renderBorder:function(d,f){var b="1px solid "+this._borderColor(f);var a="border-left: "+b;var g="border-right: "+b;var c="style='"+a+";"+g+"'";d.innerHTML="<div "+c+">"+d.innerHTML+"</div>"},_roundTopCorners:function(c,a,f){var d=this._createCorner(f);for(var b=0;b<this.options.numSlices;b++){d.appendChild(this._createCornerSlice(a,f,b,"top"))}c.style.paddingTop=0;c.insertBefore(d,c.firstChild)},_roundBottomCorners:function(c,a,f){var d=this._createCorner(f);for(var b=(this.options.numSlices-1);b>=0;b--){d.appendChild(this._createCornerSlice(a,f,b,"bottom"))}c.style.paddingBottom=0;c.appendChild(d)},_createCorner:function(b){var a=document.createElement("div");a.style.backgroundColor=(this._isTransparent()?"transparent":b);return a},_createCornerSlice:function(c,d,h,a){var f=document.createElement("span");var b=f.style;b.backgroundColor=c;b.display="block";b.height="1px";b.overflow="hidden";b.fontSize="1px";var g=this._borderColor(c,d);if(this.options.border&&h==0){b.borderTopStyle="solid";b.borderTopWidth="1px";b.borderLeftWidth="0px";b.borderRightWidth="0px";b.borderBottomWidth="0px";b.height="0px";b.borderColor=g}else{if(g){b.borderColor=g;b.borderStyle="solid";b.borderWidth="0px 1px"}}if(!this.options.compact&&(h==(this.options.numSlices-1))){b.height="2px"}this._setMargin(f,h,a);this._setBorder(f,h,a);return f},_setOptions:function(a){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,a||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else{if(this.options.corners.indexOf("tr")>=0){return"right"}}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else{if(this.options.corners.indexOf("br")>=0){return"right"}}return""},_borderColor:function(a,b){if(a=="transparent"){return b}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(b,a)}else{return""}}}},_setMargin:function(d,f,b){var c=this._marginSize(f);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){d.style.marginLeft=c+"px";d.style.marginRight="0px"}else{if(a=="right"){d.style.marginRight=c+"px";d.style.marginLeft="0px"}else{d.style.marginLeft=c+"px";d.style.marginRight=c+"px"}}},_setBorder:function(d,f,b){var c=this._borderSize(f);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){d.style.borderLeftWidth=c+"px";d.style.borderRightWidth="0px"}else{if(a=="right"){d.style.borderRightWidth=c+"px";d.style.borderLeftWidth="0px"}else{d.style.borderLeftWidth=c+"px";d.style.borderRightWidth=c+"px"}}if(this.options.border!=false){d.style.borderLeftWidth=c+"px";d.style.borderRightWidth=c+"px"}},_marginSize:function(f){if(this._isTransparent()){return 0}var d=[5,3,2,1];var a=[3,2,1,0];var c=[2,1];var b=[1,0];if(this.options.compact&&this.options.blend){return b[f]}else{if(this.options.compact){return c[f]}else{if(this.options.blend){return a[f]}else{return d[f]}}}},_borderSize:function(f){var d=[5,3,2,1];var b=[2,1,1,1];var a=[1,0];var c=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else{if(this.options.compact){return a[f]}else{if(this.options.blend){return b[f]}else{if(this.options.border){return c[f]}else{if(this._isTransparent()){return d[f]}}}}}return 0},_hasString:function(b){for(var a=1;a<arguments.length;a++){if(b.indexOf(arguments[a])>=0){return true}}return false},_blend:function(c,a){var b=OpenLayers.Rico.Color.createFromHex(c);b.blend(OpenLayers.Rico.Color.createFromHex(a));return b},_background:function(a){try{return OpenLayers.Rico.Color.createColorFromBackground(a).asHex()}catch(b){return"#ffffff"}},_isTransparent:function(){return this.options.color=="transparent"},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(a){return a.childNodes.length==1&&a.childNodes[0].nodeType==3}};(function(){if(window.google&&google.gears){return}var a=null;if(typeof GearsFactory!="undefined"){a=new GearsFactory()}else{try{a=new ActiveXObject("Gears.Factory");if(a.getBuildInfo().indexOf("ie_mobile")!=-1){a.privateSetGlobalObject(this)}}catch(b){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){a=document.createElement("object");a.style.display="none";a.width=0;a.height=0;a.type="application/x-googlegears";document.documentElement.appendChild(a)}}}if(!a){return}if(!window.google){google={}}if(!google.gears){google.gears={factory:a}}})();OpenLayers.Element={visible:function(a){return OpenLayers.Util.getElement(a).style.display!="none"},toggle:function(){for(var c=0,a=arguments.length;c<a;c++){var b=OpenLayers.Util.getElement(arguments[c]);var d=OpenLayers.Element.visible(b)?"hide":"show";OpenLayers.Element[d](b)}},hide:function(){for(var c=0,a=arguments.length;c<a;c++){var b=OpenLayers.Util.getElement(arguments[c]);b.style.display="none"}},show:function(){for(var c=0,a=arguments.length;c<a;c++){var b=OpenLayers.Util.getElement(arguments[c]);b.style.display=""}},remove:function(a){a=OpenLayers.Util.getElement(a);a.parentNode.removeChild(a)},getHeight:function(a){a=OpenLayers.Util.getElement(a);return a.offsetHeight},getDimensions:function(b){b=OpenLayers.Util.getElement(b);if(OpenLayers.Element.getStyle(b,"display")!="none"){return{width:b.offsetWidth,height:b.offsetHeight}}var a=b.style;var f=a.visibility;var c=a.position;a.visibility="hidden";a.position="absolute";a.display="";var g=b.clientWidth;var d=b.clientHeight;a.display="none";a.position=c;a.visibility=f;return{width:g,height:d}},hasClass:function(b,a){var c=b.className;return(!!c&&new RegExp("(^|\\s)"+a+"(\\s|$)").test(c))},addClass:function(b,a){if(!OpenLayers.Element.hasClass(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClass:function(b,a){var c=b.className;if(c){b.className=OpenLayers.String.trim(c.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," "))}return b},toggleClass:function(b,a){if(OpenLayers.Element.hasClass(b,a)){OpenLayers.Element.removeClass(b,a)}else{OpenLayers.Element.addClass(b,a)}return b},getStyle:function(c,d){c=OpenLayers.Util.getElement(c);var f=null;if(c&&c.style){f=c.style[OpenLayers.String.camelize(d)];if(!f){if(document.defaultView&&document.defaultView.getComputedStyle){var b=document.defaultView.getComputedStyle(c,null);f=b?b.getPropertyValue(d):null}else{if(c.currentStyle){f=c.currentStyle[OpenLayers.String.camelize(d)]}}}var a=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(a,d)!=-1)&&(OpenLayers.Element.getStyle(c,"position")=="static")){f="auto"}}return f=="auto"?null:f}};OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(a,b){this.w=parseFloat(a);this.h=parseFloat(b)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(b){var a=false;if(b!=null){a=((this.w==b.w&&this.h==b.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(b.w)&&isNaN(b.h)))}return a},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(a){alert(a)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){var b=document.getElementsByTagName("script");for(var c=0,a=b.length;c<a;++c){if(b[c].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}}})();OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(a,b,d,c){this.url=a;this.size=(b)?b:new OpenLayers.Size(20,20);this.offset=d?d:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=c;var f=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(f)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(a){if(a!=null){this.size=a}this.draw()},setUrl:function(a){if(a!=null){this.url=a}this.draw()},draw:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(a);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,a)},moveTo:function(a){if(a!=null){this.px=a}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var b=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,b)}}},display:function(a){this.imageDiv.style.display=(a)?"":"none"},isDrawn:function(){var a=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return a},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:false,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,keepInMap:false,closeOnMove:false,map:null,initialize:function(h,c,g,b,f,d){if(h==null){h=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=h;this.lonlat=c;this.contentSize=(g!=null)?g:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(b!=null){this.contentHTML=b}this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;var a=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,"relative",null,"hidden");var h=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(h,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(f){this.addCloseBox(d)}this.registerEvents()},destroy:function(){this.id=null;this.lonlat=null;this.size=null;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null;if(this.closeOnMove&&this.map){this.map.events.unregister("movestart",this,this.hide)}this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv)}this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this)}this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;this.padding=null;this.panMapIfOutOfView=null},draw:function(a){if(a==null){if((this.lonlat!=null)&&(this.map!=null)){a=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(!this.disableFirefoxOverflowHack&&OpenLayers.Util.getBrowserName()=="firefox"){this.map.events.register("movestart",this,function(){var b=document.defaultView.getComputedStyle(this.contentDiv,null);var c=b.getPropertyValue("overflow");if(c!="hidden"){this.contentDiv._oldOverflow=c;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var b=this.contentDiv._oldOverflow;if(b){this.contentDiv.style.overflow=b;this.contentDiv._oldOverflow=null}})}this.moveTo(a);if(!this.autoSize&&!this.size){this.setSize(this.contentSize)}this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView()}return this.div},updatePosition:function(){if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);if(a){this.moveTo(a)}}},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){if(this.visible()){this.hide()}else{this.show()}},show:function(){OpenLayers.Element.show(this.div);if(this.panMapIfOutOfView){this.panIntoView()}},hide:function(){OpenLayers.Element.hide(this.div)},setSize:function(c){this.size=c.clone();var b=this.getContentDivPadding();var a=b.left+b.right;var f=b.top+b.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;f+=this.padding.top+this.padding.bottom;if(this.closeDiv){var d=parseInt(this.closeDiv.style.width);a+=d+b.right}this.size.w+=a;this.size.h+=f;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=b.left+b.right;this.contentSize.h+=b.bottom+b.top}if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}if(this.contentDiv!=null){this.contentDiv.style.width=c.w+"px";this.contentDiv.style.height=c.h+"px"}},updateSize:function(){var f="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var j=(this.map)?this.map.layerContainerDiv:document.body;var k=OpenLayers.Util.getRenderedDimensions(f,null,{displayClass:this.displayClass,containerElement:j});var h=this.getSafeContentSize(k);var g=null;if(h.equals(k)){g=k}else{var b=new OpenLayers.Size();b.w=(h.w<k.w)?h.w:null;b.h=(h.h<k.h)?h.h:null;if(b.w&&b.h){g=h}else{var d=OpenLayers.Util.getRenderedDimensions(f,b,{displayClass:this.contentDisplayClass,containerElement:j});var c=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((c!="hidden")&&(d.equals(h))){var a=OpenLayers.Util.getScrollbarWidth();if(b.w){d.h+=a}else{d.w+=a}}g=this.getSafeContentSize(d)}}this.setSize(g)},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(a){if(a!=undefined){this.opacity=a}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(a){if(a!=undefined){this.border=a}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(a){if(a!=null){this.contentHTML=a}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var g=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var b=this.contentDiv.getElementsByTagName("img");for(var f=0,a=b.length;f<a;f++){var c=b[f];if(c.width==0||c.height==0){var d={popup:this,img:c};c._onImgLoad=OpenLayers.Function.bind(g,d);OpenLayers.Event.observe(c,"load",c._onImgLoad)}}},getSafeContentSize:function(m){var d=m.clone();var k=this.getContentDivPadding();var l=k.left+k.right;var h=k.top+k.bottom;this.fixPadding();l+=this.padding.left+this.padding.right;h+=this.padding.top+this.padding.bottom;if(this.closeDiv){var c=parseInt(this.closeDiv.style.width);l+=c+k.right}if(this.minSize){d.w=Math.max(d.w,(this.minSize.w-l));d.h=Math.max(d.h,(this.minSize.h-h))}if(this.maxSize){d.w=Math.min(d.w,(this.maxSize.w-l));d.h=Math.min(d.h,(this.maxSize.h-h))}if(this.map&&this.map.size){var g=0,f=0;if(this.keepInMap&&!this.panMapIfOutOfView){var j=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":g=j.x;f=this.map.size.h-j.y;break;case"tl":g=this.map.size.w-j.x;f=this.map.size.h-j.y;break;case"bl":g=this.map.size.w-j.x;f=j.y;break;case"br":g=j.x;f=j.y;break;default:g=j.x;f=this.map.size.h-j.y;break}}var a=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-h-f;var b=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-l-g;d.w=Math.min(d.w,b);d.h=Math.min(d.h,a)}return d},getContentDivPadding:function(){var a=this._contentDivPadding;if(!a){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}a=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));this._contentDivPadding=a;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return a},addCloseBox:function(c){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var b=this.getContentDivPadding();this.closeDiv.style.right=b.right+"px";this.closeDiv.style.top=b.top+"px";this.groupDiv.appendChild(this.closeDiv);var a=c||function(d){this.hide();OpenLayers.Event.stop(d)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))},panIntoView:function(){var f=this.map.getSize();var d=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var c=d.clone();if(d.x<this.map.paddingForPopups.left){c.x=this.map.paddingForPopups.left}else{if((d.x+this.size.w)>(f.w-this.map.paddingForPopups.right)){c.x=f.w-this.map.paddingForPopups.right-this.size.w}}if(d.y<this.map.paddingForPopups.top){c.y=this.map.paddingForPopups.top}else{if((d.y+this.size.h)>(f.h-this.map.paddingForPopups.bottom)){c.y=f.h-this.map.paddingForPopups.bottom-this.size.h}}var b=d.x-c.x;var a=d.y-c.y;this.map.pan(b,a)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})},onmousedown:function(a){this.mousedown=true;OpenLayers.Event.stop(a,true)},onmousemove:function(a){if(this.mousedown){OpenLayers.Event.stop(a,true)}},onmouseup:function(a){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(a,true)}},onclick:function(a){OpenLayers.Event.stop(a,true)},onmouseout:function(a){this.mousedown=false},ondblclick:function(a){OpenLayers.Event.stop(a,true)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,initialize:function(a){a=a||{};OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){this.options=null;this.format=null},read:function(){},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(a){},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(a){OpenLayers.Util.extend(this,a)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(a,b){this.container=OpenLayers.Util.getElement(a)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(a,b){this.extent=a.clone();if(b){this.resolution=null}},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(a,b){if(b==null){b=a.style}if(a.geometry){var c=a.geometry.getBounds();if(c){if(!c.intersectsBounds(this.extent)){b={display:"none"}}var d=this.drawGeometry(a.geometry,b,a.id);if(b.display!="none"&&b.label&&d!==false){this.drawText(a.id,b,a.geometry.getCentroid())}else{this.removeText(a.id)}return d}}},drawGeometry:function(c,a,b){},drawText:function(c,b,a){},removeText:function(a){},clear:function(){},getFeatureIdFromEvent:function(a){},eraseFeatures:function(c){if(!(c instanceof Array)){c=[c]}for(var b=0,a=c.length;b<a;++b){this.eraseGeometry(c[b].geometry);this.removeText(c[b].id)}},eraseGeometry:function(a){},moveRoot:function(a){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(a){this.layer=a},activate:function(){if(!this.active){this.active=true;return true}return false},deactivate:function(){if(this.active){this.active=false;return true}return false},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(c,b,a){this.rgb={r:c,g:b,b:a}},setRed:function(a){this.rgb.r=a},setGreen:function(a){this.rgb.g=a},setBlue:function(a){this.rgb.b=a},setHue:function(b){var a=this.asHSB();a.h=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.b)},setSaturation:function(b){var a=this.asHSB();a.s=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.b)},setBrightness:function(a){var c=this.asHSB();c.b=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(c.h,c.s,c.b)},darken:function(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.max(a.b-b,0))},brighten:function(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.min(a.b+b,1))},blend:function(a){this.rgb.r=Math.floor((this.rgb.r+a.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+a.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+a.rgb.b)/2)},isBright:function(){var a=this.asHSB();return this.asHSB().b>0.5},isDark:function(){return !this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}});OpenLayers.Rico.Color.createFromHex=function(d){if(d.length==4){var b=d;var d="#";for(var c=1;c<4;c++){d+=(b.charAt(c)+b.charAt(c))}}if(d.indexOf("#")==0){d=d.substring(1)}var g=d.substring(0,2);var f=d.substring(2,4);var a=d.substring(4,6);return new OpenLayers.Rico.Color(parseInt(g,16),parseInt(f,16),parseInt(a,16))};OpenLayers.Rico.Color.createColorFromBackground=function(d){var b=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(d),"backgroundColor","background-color");if(b=="transparent"&&d.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(d.parentNode)}if(b==null){return new OpenLayers.Rico.Color(255,255,255)}if(b.indexOf("rgb(")==0){var a=b.substring(4,b.length-1);var c=a.split(",");return new OpenLayers.Rico.Color(parseInt(c[0]),parseInt(c[1]),parseInt(c[2]))}else{if(b.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(b)}else{return new OpenLayers.Rico.Color(255,255,255)}}};OpenLayers.Rico.Color.HSBtoRGB=function(k,g,m){var c=0;var d=0;var o=0;if(g==0){c=parseInt(m*255+0.5);d=c;o=c}else{var j=(k-Math.floor(k))*6;var l=j-Math.floor(j);var b=m*(1-g);var a=m*(1-g*l);var r=m*(1-(g*(1-l)));switch(parseInt(j)){case 0:c=(m*255+0.5);d=(r*255+0.5);o=(b*255+0.5);break;case 1:c=(a*255+0.5);d=(m*255+0.5);o=(b*255+0.5);break;case 2:c=(b*255+0.5);d=(m*255+0.5);o=(r*255+0.5);break;case 3:c=(b*255+0.5);d=(a*255+0.5);o=(m*255+0.5);break;case 4:c=(r*255+0.5);d=(b*255+0.5);o=(m*255+0.5);break;case 5:c=(m*255+0.5);d=(b*255+0.5);o=(a*255+0.5);break}}return{r:parseInt(c),g:parseInt(d),b:parseInt(o)}};OpenLayers.Rico.Color.RGBtoHSB=function(a,h,o){var j;var f;var m;var q=(a>h)?a:h;if(o>q){q=o}var k=(a<h)?a:h;if(o<k){k=o}m=q/255;if(q!=0){f=(q-k)/q}else{f=0}if(f==0){j=0}else{var c=(q-a)/(q-k);var l=(q-h)/(q-k);var d=(q-o)/(q-k);if(a==q){j=d-l}else{if(h==q){j=2+c-d}else{j=4+l-c}}j=j/6;if(j<0){j=j+1}}return{h:j,s:f,b:m}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(d,a,b,c){if(d!=null){this.left=OpenLayers.Util.toFloat(d)}if(a!=null){this.bottom=OpenLayers.Util.toFloat(a)}if(b!=null){this.right=OpenLayers.Util.toFloat(b)}if(c!=null){this.top=OpenLayers.Util.toFloat(c)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(b){var a=false;if(b!=null){a=((this.left==b.left)&&(this.right==b.right)&&(this.top==b.top)&&(this.bottom==b.bottom))}return a},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")},toArray:function(){return[this.left,this.bottom,this.right,this.top]},toBBOX:function(a){if(a==null){a=6}var b=Math.pow(10,a);var c=Math.round(this.left*b)/b+","+Math.round(this.bottom*b)/b+","+Math.round(this.right*b)/b+","+Math.round(this.top*b)/b;return c},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return(this.right-this.left)},getHeight:function(){return(this.top-this.bottom)},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat){this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)}return this.centerLonLat},scale:function(g,j){if(j==null){j=this.getCenterLonLat()}var a=[];var f,d;if(j.CLASS_NAME=="OpenLayers.LonLat"){f=j.lon;d=j.lat}else{f=j.x;d=j.y}var c=(this.left-f)*g+f;var b=(this.bottom-d)*g+d;var k=(this.right-f)*g+f;var h=(this.top-d)*g+d;return new OpenLayers.Bounds(c,b,k,h)},add:function(a,c){if((a==null)||(c==null)){var b=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Bounds(this.left+a,this.bottom+c,this.right+a,this.top+c)},extend:function(a){var b=null;if(a){switch(a.CLASS_NAME){case"OpenLayers.LonLat":b=new OpenLayers.Bounds(a.lon,a.lat,a.lon,a.lat);break;case"OpenLayers.Geometry.Point":b=new OpenLayers.Bounds(a.x,a.y,a.x,a.y);break;case"OpenLayers.Bounds":b=a;break}if(b){this.centerLonLat=null;if((this.left==null)||(b.left<this.left)){this.left=b.left}if((this.bottom==null)||(b.bottom<this.bottom)){this.bottom=b.bottom}if((this.right==null)||(b.right>this.right)){this.right=b.right}if((this.top==null)||(b.top>this.top)){this.top=b.top}}}},containsLonLat:function(b,a){return this.contains(b.lon,b.lat,a)},containsPixel:function(b,a){return this.contains(b.x,b.y,a)},contains:function(b,d,a){if(a==null){a=true}if(b==null||d==null){return false}b=OpenLayers.Util.toFloat(b);d=OpenLayers.Util.toFloat(d);var c=false;if(a){c=((b>=this.left)&&(b<=this.right)&&(d>=this.bottom)&&(d<=this.top))}else{c=((b>this.left)&&(b<this.right)&&(d>this.bottom)&&(d<this.top))}return c},intersectsBounds:function(f,b){if(b==null){b=true}var d=false;var j=(this.left==f.right||this.right==f.left||this.top==f.bottom||this.bottom==f.top);if(b||!j){var h=(((f.bottom>=this.bottom)&&(f.bottom<=this.top))||((this.bottom>=f.bottom)&&(this.bottom<=f.top)));var g=(((f.top>=this.bottom)&&(f.top<=this.top))||((this.top>f.bottom)&&(this.top<f.top)));var c=(((f.left>=this.left)&&(f.left<=this.right))||((this.left>=f.left)&&(this.left<=f.right)));var a=(((f.right>=this.left)&&(f.right<=this.right))||((this.right>=f.left)&&(this.right<=f.right)));d=((h||g)&&(c||a))}return d},containsBounds:function(h,b,a){if(b==null){b=false}if(a==null){a=true}var c=this.contains(h.left,h.bottom,a);var d=this.contains(h.right,h.bottom,a);var g=this.contains(h.left,h.top,a);var f=this.contains(h.right,h.top,a);return(b)?(c||d||g||f):(c&&d&&g&&f)},determineQuadrant:function(c){var b="";var a=this.getCenterLonLat();b+=(c.lat<a.lat)?"b":"t";b+=(c.lon<a.lon)?"l":"r";return b},transform:function(d,b){this.centerLonLat=null;var f=OpenLayers.Projection.transform({x:this.left,y:this.bottom},d,b);var a=OpenLayers.Projection.transform({x:this.right,y:this.bottom},d,b);var c=OpenLayers.Projection.transform({x:this.left,y:this.top},d,b);var g=OpenLayers.Projection.transform({x:this.right,y:this.top},d,b);this.left=Math.min(f.x,c.x);this.bottom=Math.min(f.y,a.y);this.right=Math.max(a.x,g.x);this.top=Math.max(c.y,g.y);return this},wrapDateLine:function(a,c){c=c||{};var d=c.leftTolerance||0;var b=c.rightTolerance||0;var f=this.clone();if(a){while(f.left<a.left&&(f.right-b)<=a.left){f=f.add(a.getWidth(),0)}while((f.left+d)>=a.right&&f.right>a.right){f=f.add(-a.getWidth(),0)}}return f},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(b){var a=b.split(",");return OpenLayers.Bounds.fromArray(a)};OpenLayers.Bounds.fromArray=function(a){return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]))};OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b="";b+=(a.charAt(0)=="t")?"b":"t";b+=(a.charAt(1)=="l")?"r":"l";return b};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(b,a){this.lon=OpenLayers.Util.toFloat(b);this.lat=OpenLayers.Util.toFloat(a)},toString:function(){return("lon="+this.lon+",lat="+this.lat)},toShortString:function(){return(this.lon+", "+this.lat)},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(c,a){if((c==null)||(a==null)){var b=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.LonLat(this.lon+c,this.lat+a)},equals:function(b){var a=false;if(b!=null){a=((this.lon==b.lon&&this.lat==b.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(b.lon)&&isNaN(b.lat)))}return a},transform:function(c,b){var a=OpenLayers.Projection.transform({x:this.lon,y:this.lat},c,b);this.lon=a.x;this.lat=a.y;return this},wrapDateLine:function(a){var b=this.clone();if(a){while(b.lon<a.left){b.lon+=a.getWidth()}while(b.lon>a.right){b.lon-=a.getWidth()}}return b},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(b){var a=b.split(",");return new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[1]))};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},add:function(a,c){if((a==null)||(c==null)){var b=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Pixel(this.x+a,this.y+c)},offset:function(a){var b=this.clone();if(a){b=this.add(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(a){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,a);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.handlers){for(var a in this.handlers){if(this.handlers.hasOwnProperty(a)&&typeof this.handlers[a].destroy=="function"){this.handlers[a].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(a){this.map=a;if(this.handler){this.handler.setMap(a)}},draw:function(a){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false)}}if(this.title!=""){this.div.title=this.title}}if(a!=null){this.position=a.clone()}this.moveTo(this.position);return this.div},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;if(this.map){OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;if(this.map){OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("deactivate");return true}return false},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(b){var d;if(!b){b=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var c=b.split("-");c[0]=c[0].toLowerCase();if(typeof OpenLayers.Lang[c[0]]=="object"){d=c[0]}if(c[1]){var a=c[0]+"-"+c[1].toUpperCase();if(typeof OpenLayers.Lang[a]=="object"){d=a}}if(!d){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+c.join("-")+" dictionary, falling back to default language");d=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=d},translate:function(b,a){var d=OpenLayers.Lang[OpenLayers.Lang.getCode()];var c=d[b];if(!c){c=b}if(a){c=OpenLayers.String.format(c,a)}return c}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(j,d,h,c,b,g,f){var a=[j,d,h,c,g,f];OpenLayers.Popup.prototype.initialize.apply(this,a);this.anchor=(b!=null)?b:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null;this.relativePosition=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(c){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(c);var d=this.calculateNewPx(c);var a=new Array(d);OpenLayers.Popup.prototype.moveTo.apply(this,a);if(this.relativePosition!=b){this.updateRelativePosition()}},setSize:function(b){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(a)}},calculateRelativePosition:function(b){var d=this.map.getLonLatFromLayerPx(b);var c=this.map.getExtent();var a=c.determineQuadrant(d);return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(b){var f=b.offset(this.anchor.offset);var a=this.size||this.contentSize;var d=(this.relativePosition.charAt(0)=="t");f.y+=(d)?-a.h:this.anchor.size.h;var c=(this.relativePosition.charAt(1)=="l");f.x+=(c)?-a.w:this.anchor.size.w;return f},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Protocol.SQL=OpenLayers.Class(OpenLayers.Protocol,{databaseName:"ol",tableName:"ol_vector_features",postReadFiltering:true,initialize:function(a){OpenLayers.Protocol.prototype.initialize.apply(this,[a])},destroy:function(){OpenLayers.Protocol.prototype.destroy.apply(this)},supported:function(){return false},evaluateFilter:function(a,b){return b&&this.postReadFiltering?b.evaluate(a):true},CLASS_NAME:"OpenLayers.Protocol.SQL"});OpenLayers.Protocol.WFS=function(b){b=OpenLayers.Util.applyDefaults(b,OpenLayers.Protocol.WFS.DEFAULTS);var a=OpenLayers.Protocol.WFS["v"+b.version.replace(/\./g,"_")];if(!a){throw"Unsupported WFS version: "+b.version}return new a(b)};OpenLayers.Protocol.WFS.fromWMSLayer=function(d,c){var a,f;var h=d.params.LAYERS;var g=(h instanceof Array?h[0]:h).split(":");if(g.length>1){f=g[0]}a=g.pop();var b={url:d.url,featureType:a,featurePrefix:f,srsName:d.projection&&d.projection.getCode()||d.map&&d.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(c,b))};OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"};OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,geometryMap:null,initialize:function(a){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);this.canvas=this.root.getContext("2d");this.features={};this.geometryMap={}},eraseGeometry:function(a){this.eraseFeatures(this.features[this.geometryMap[a.id]][0])},supported:function(){var a=document.createElement("canvas");return !!a.getContext},setExtent:function(a){this.extent=a.clone();this.resolution=null;this.redraw()},setSize:function(a){this.size=a.clone();this.root.style.width=a.w+"px";this.root.style.height=a.h+"px";this.root.width=a.w;this.root.height=a.h;this.resolution=null},drawFeature:function(a,b){if(b==null){b=a.style}b=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},b);this.features[a.id]=[a,b];if(a.geometry){this.geometryMap[a.geometry.id]=a.id}this.redraw()},drawGeometry:function(d,c){var b=d.CLASS_NAME;if((b=="OpenLayers.Geometry.Collection")||(b=="OpenLayers.Geometry.MultiPoint")||(b=="OpenLayers.Geometry.MultiLineString")||(b=="OpenLayers.Geometry.MultiPolygon")){for(var a=0;a<d.components.length;a++){this.drawGeometry(d.components[a],c)}return}switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(d,c);break;case"OpenLayers.Geometry.LineString":this.drawLineString(d,c);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(d,c);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(d,c);break;default:break}},drawExternalGraphic:function(k,a){var f=new Image();f.src=a.externalGraphic;if(a.graphicTitle){f.title=a.graphicTitle}var c=a.graphicWidth||a.graphicHeight;var j=a.graphicHeight||a.graphicWidth;c=c?c:a.pointRadius*2;j=j?j:a.pointRadius*2;var h=(a.graphicXOffset!=undefined)?a.graphicXOffset:-(0.5*c);var d=(a.graphicYOffset!=undefined)?a.graphicYOffset:-(0.5*j);var g=a.graphicOpacity||a.fillOpacity;var b={img:f,x:(k[0]+h),y:(k[1]+d),width:c,height:j,canvas:this.canvas};f.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},b)},setCanvasStyle:function(b,a){if(b=="fill"){this.canvas.globalAlpha=a.fillOpacity;this.canvas.fillStyle=a.fillColor}else{if(b=="stroke"){this.canvas.globalAlpha=a.strokeOpacity;this.canvas.strokeStyle=a.strokeColor;this.canvas.lineWidth=a.strokeWidth}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}}},drawPoint:function(c,a){if(a.graphic!==false){var b=this.getLocalXY(c);if(a.externalGraphic){this.drawExternalGraphic(b,a)}else{if(a.fill!==false){this.setCanvasStyle("fill",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],6,0,Math.PI*2,true);this.canvas.fill()}if(a.stroke!==false){this.setCanvasStyle("stroke",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],6,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(d,b){if(b.stroke!==false){this.setCanvasStyle("stroke",b);this.canvas.beginPath();var f=this.getLocalXY(d.components[0]);this.canvas.moveTo(f[0],f[1]);for(var a=1;a<d.components.length;a++){var c=this.getLocalXY(d.components[a]);this.canvas.lineTo(c[0],c[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(f,c){if(c.fill!==false){this.setCanvasStyle("fill",c);this.canvas.beginPath();var g=this.getLocalXY(f.components[0]);this.canvas.moveTo(g[0],g[1]);for(var b=1;b<f.components.length-1;b++){var d=this.getLocalXY(f.components[b]);this.canvas.lineTo(d[0],d[1])}this.canvas.fill()}if(c.stroke!==false){var a=this.canvas.lineWidth;this.setCanvasStyle("stroke",c);this.canvas.beginPath();var g=this.getLocalXY(f.components[0]);this.canvas.moveTo(g[0],g[1]);for(var b=1;b<f.components.length;b++){var d=this.getLocalXY(f.components[b]);this.canvas.lineTo(d[0],d[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawPolygon:function(c,b){this.drawLinearRing(c.components[0],b);for(var a=1;a<c.components.length;a++){this.drawLinearRing(c.components[a],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(b,d){d=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},d);var f=this.getLocalXY(b);this.setCanvasStyle("reset");this.canvas.fillStyle=d.fontColor;this.canvas.globalAlpha=1;var g=d.fontWeight+" "+d.fontSize+" "+d.fontFamily;if(this.canvas.fillText){var c=OpenLayers.Renderer.Canvas.LABEL_ALIGN[d.labelAlign[0]]||"middle";this.canvas.font=g;this.canvas.textAlign=c;this.canvas.fillText(d.label,f[0],f[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=g;var a=this.canvas.mozMeasureText(d.label);switch(d.labelAlign[0]){case"l":break;case"r":f[0]-=a;break;case"c":default:f[0]-=a/2}this.canvas.translate(f[0],f[1]);this.canvas.mozDrawText(d.label);this.canvas.translate(-1*f[0],-1*f[1])}}this.setCanvasStyle("reset")},getLocalXY:function(b){var c=this.getResolution();var d=this.extent;var a=(b.x/c+(-d.left/c));var f=((d.top/c)-b.y/c);return[a,f]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(a){var g=this.map.getLonLatFromPixel(a.xy);var b=this.getResolution();var f=new OpenLayers.Bounds(g.lon-b*5,g.lat-b*5,g.lon+b*5,g.lat+b*5);var c=f.toGeometry();for(var d in this.features){if(!this.features.hasOwnProperty(d)){continue}if(this.features[d][0].geometry.intersects(c)){return d}}return null},eraseFeatures:function(b){if(!(b instanceof Array)){b=[b]}for(var a=0;a<b.length;++a){delete this.features[b[a].id]}this.redraw()},redraw:function(){if(!this.locked){this.clear();var f=[];var b,c;for(var g in this.features){if(!this.features.hasOwnProperty(g)){continue}b=this.features[g][0];c=this.features[g][1];if(!b.geometry){continue}this.drawGeometry(b.geometry,c);if(c.label){f.push([b,c])}}var d;for(var a=0;len=f.length,a<len;++a){d=f[a];this.drawText(d[0].geometry.getCentroid(),d[1])}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right"};OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(a){this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(c){if(this.exists(c)){this.remove(c)}var g=c.id;this.determineZIndex(c);var d=-1;var f=this.order.length;var a;while(f-d>1){a=parseInt((d+f)/2);var b=this.compare(this,c,OpenLayers.Util.getElement(this.order[a]));if(b>0){d=a}else{f=a}}this.order.splice(f,0,g);this.indices[g]=this.getZIndex(c);return this.getNextElement(f)},remove:function(b){var d=b.id;var a=OpenLayers.Util.indexOf(this.order,d);if(a>=0){this.order.splice(a,1);delete this.indices[d];if(this.order.length>0){var c=this.order[this.order.length-1];this.maxZIndex=this.indices[c]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return(this.indices[a.id]!=null)},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;if(b==null){b=this.maxZIndex;a._style.graphicZIndex=b}else{if(b>this.maxZIndex){this.maxZIndex=b}}},getNextElement:function(b){var a=b+1;if(a<this.order.length){var c=OpenLayers.Util.getElement(this.order[a]);if(c==undefined){c=this.getNextElement(a)}return c}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(f,d,b){var a=f.getZIndex(d);var g=0;if(b){var c=f.getZIndex(b);g=a-c}return g},Z_ORDER_DRAWING_ORDER:function(c,b,a){var d=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(c,b,a);if(a&&d==0){d=1}return d},Z_ORDER_Y_ORDER:function(g,f,b){var h=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(g,f,b);if(b&&h==0){var c=f._geometry.getBounds().bottom;var d=b._geometry.getBounds().bottom;var a=d-c;h=(a==0)?1:a}return h}};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(a,b){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot);this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);if(b&&(b.zIndexing||b.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(b.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){if(this.vectorRoot){while(this.vectorRoot.childNodes.length>0){this.vectorRoot.removeChild(this.vectorRoot.firstChild)}}if(this.textRoot){while(this.textRoot.childNodes.length>0){this.textRoot.removeChild(this.textRoot.firstChild)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(b,a){},drawGeometry:function(h,d,g){var c=h.CLASS_NAME;var j=true;if((c=="OpenLayers.Geometry.Collection")||(c=="OpenLayers.Geometry.MultiPoint")||(c=="OpenLayers.Geometry.MultiLineString")||(c=="OpenLayers.Geometry.MultiPolygon")){for(var b=0,a=h.components.length;b<a;b++){j=this.drawGeometry(h.components[b],d,g)&&j}return j}j=false;if(d.display!="none"){if(d.backgroundGraphic){this.redrawBackgroundNode(h.id,h,d,g)}j=this.redrawNode(h.id,h,d,g)}if(j==false){var f=document.getElementById(h.id);if(f){if(f._style.backgroundGraphic){f.parentNode.removeChild(document.getElementById(h.id+this.BACKGROUND_ID_SUFFIX))}f.parentNode.removeChild(f)}}return j},redrawNode:function(h,g,b,f){var c=this.nodeFactory(h,this.getNodeType(g,b));c._featureId=f;c._geometry=g;c._geometryClass=g.CLASS_NAME;c._style=b;var a=this.drawGeometryNode(c,g,b);if(a===false){return false}c=a.node;if(this.indexer){var d=this.indexer.insert(c);if(d){this.vectorRoot.insertBefore(c,d)}else{this.vectorRoot.appendChild(c)}}else{if(c.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(c)}}this.postDraw(c);return a.complete},redrawBackgroundNode:function(f,d,b,c){var a=OpenLayers.Util.extend({},b);a.externalGraphic=a.backgroundGraphic;a.graphicXOffset=a.backgroundXOffset;a.graphicYOffset=a.backgroundYOffset;a.graphicZIndex=a.backgroundGraphicZIndex;a.graphicWidth=a.backgroundWidth||a.graphicWidth;a.graphicHeight=a.backgroundHeight||a.graphicHeight;a.backgroundGraphic=null;a.backgroundXOffset=null;a.backgroundYOffset=null;a.backgroundGraphicZIndex=null;return this.redrawNode(f+this.BACKGROUND_ID_SUFFIX,d,a,null)},drawGeometryNode:function(c,f,b){b=b||c._style;OpenLayers.Util.applyDefaults(b,this.minimumSymbolizer);var a={isFilled:b.fill===undefined?true:b.fill,isStroked:b.stroke===undefined?!!b.strokeWidth:b.stroke};var d;switch(f.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.graphic===false){a.isFilled=false;a.isStroked=false}d=this.drawPoint(c,f);break;case"OpenLayers.Geometry.LineString":a.isFilled=false;d=this.drawLineString(c,f);break;case"OpenLayers.Geometry.LinearRing":d=this.drawLinearRing(c,f);break;case"OpenLayers.Geometry.Polygon":d=this.drawPolygon(c,f);break;case"OpenLayers.Geometry.Surface":d=this.drawSurface(c,f);break;case"OpenLayers.Geometry.Rectangle":d=this.drawRectangle(c,f);break;default:break}c._style=b;c._options=a;if(d!=false){return{node:this.setStyle(c,b,a,f),complete:d}}else{return false}},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},drawSurface:function(a,b){},removeText:function(b){var a=document.getElementById(b+this.LABEL_ID_SUFFIX);if(a){this.textRoot.removeChild(a)}},getFeatureIdFromEvent:function(a){var d=a.target;var b=d&&d.correspondingUseElement;var c=b?b:(d||a.srcElement);var f=c._featureId;return f},eraseGeometry:function(g){if((g.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(g.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(g.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(g.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var d=0,a=g.components.length;d<a;d++){this.eraseGeometry(g.components[d])}}else{var c=OpenLayers.Util.getElement(g.id);if(c&&c.parentNode){if(c.geometry){c.geometry.destroy();c.geometry=null}c.parentNode.removeChild(c);if(this.indexer){this.indexer.remove(c)}if(c._style.backgroundGraphic){var b=g.id+this.BACKGROUND_ID_SUFFIX;var f=OpenLayers.Util.getElement(b);if(f&&f.parentNode){f.parentNode.removeChild(f)}}}}},nodeFactory:function(c,a){var b=OpenLayers.Util.getElement(c);if(b){if(!this.nodeTypeCompare(b,a)){b.parentNode.removeChild(b);b=this.nodeFactory(c,a)}}else{b=this.createNode(a,c)}return b},nodeTypeCompare:function(b,a){},createNode:function(a,b){},moveRoot:function(b){var a=this.root;if(b.root.parentNode==this.rendererRoot){a=b.root}a.parentNode.removeChild(a);b.rendererRoot.appendChild(a)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(a){return(a!="circle")&&!!a},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:false,resolution:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return a},cacheFeatures:function(b){var a=true;if(!this.clustering){this.clearCache();this.features=b.features;this.cluster();a=false}return a},clearCache:function(){this.features=null},cluster:function(a){if((!a||a.zoomChanged)&&this.features){var c=this.layer.map.getResolution();if(c!=this.resolution||!this.clustersExist()){this.resolution=c;var k=[];var o,b,l;for(var f=0;f<this.features.length;++f){o=this.features[f];if(o.geometry){b=false;for(var d=0;d<k.length;++d){l=k[d];if(this.shouldCluster(l,o)){this.addToCluster(l,o);b=true;break}}if(!b){k.push(this.createCluster(this.features[f]))}}}this.layer.destroyFeatures();if(k.length>0){if(this.threshold>1){var h=k.slice();k=[];var m;for(var f=0,g=h.length;f<g;++f){m=h[f];if(m.attributes.count<this.threshold){Array.prototype.push.apply(k,m.cluster)}else{k.push(m)}}}this.clustering=true;this.layer.addFeatures(k);this.clustering=false}this.clusters=k}}},clustersExist:function(){var b=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){b=true;for(var a=0;a<this.clusters.length;++a){if(this.clusters[a]!=this.layer.features[a]){b=false;break}}}return b},shouldCluster:function(a,b){var f=a.geometry.getBounds().getCenterLonLat();var c=b.geometry.getBounds().getCenterLonLat();var d=(Math.sqrt(Math.pow((f.lon-c.lon),2)+Math.pow((f.lat-c.lat),2))/this.resolution);return(d<=this.distance)},addToCluster:function(a,b){a.cluster.push(b);a.attributes.count+=1},createCluster:function(c){var b=c.geometry.getBounds().getCenterLonLat();var a=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat),{count:1});a.cluster=[c];return a},CLASS_NAME:"OpenLayers.Strategy.Cluster"});OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},destroy:function(){OpenLayers.Strategy.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Strategy.prototype.activate.apply(this,arguments)){this.layer.events.on({refresh:this.load,scope:this});if(this.layer.visibility==true||this.preload){this.load()}else{this.layer.events.on({visibilitychanged:this.load,scope:this})}return true}return false},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this})}return a},load:function(a){this.layer.events.triggerEvent("loadstart");this.layer.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,scope:this},a));this.layer.events.un({visibilitychanged:this.load,scope:this})},merge:function(h){this.layer.destroyFeatures();var f=h.features;if(f&&f.length>0){var g=this.layer.projection;var d=this.layer.map.getProjectionObject();if(!d.equals(g)){var c;for(var b=0,a=f.length;b<a;++b){c=f[b].geometry;if(c){c.transform(g,d)}}}this.layer.addFeatures(f)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})}return a},cacheFeatures:function(a){if(!this.paging){this.clearCache();this.features=a.features;this.pageNext(a)}},clearCache:function(){if(this.features){for(var a=0;a<this.features.length;++a){this.features[a].destroy()}}this.features=null;this.num=null},pageCount:function(){var a=this.features?this.features.length:0;return Math.ceil(a/this.length)},pageNum:function(){return this.num},pageLength:function(a){if(a&&a>0){this.length=a}return this.length},pageNext:function(a){var b=false;if(this.features){if(this.num===null){this.num=-1}var c=(this.num+1)*this.length;b=this.page(c,a)}return b},pagePrevious:function(){var a=false;if(this.features){if(this.num===null){this.num=this.pageCount()}var b=(this.num-1)*this.length;a=this.page(b)}return a},page:function(f,c){var d=false;if(this.features){if(f>=0&&f<this.features.length){var a=Math.floor(f/this.length);if(a!=this.num){this.paging=true;var b=this.features.slice(f,f+this.length);this.layer.removeFeatures(this.layer.features);this.num=a;if(c&&c.features){c.features=b}else{this.layer.addFeatures(b)}this.paging=false;d=true}}}return d},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{auto:false,timer:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),this.auto*1000)}else{this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){window.clearInterval(this.timer)}else{this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},triggerSave:function(b){var a=b.feature;if(a.state===OpenLayers.State.INSERT||a.state===OpenLayers.State.UPDATE||a.state===OpenLayers.State.DELETE){this.save([b.feature])}},save:function(d){if(!d){d=this.layer.features}var g=this.layer.projection;var c=this.layer.map.getProjectionObject();if(!c.equals(g)){var a=d.length;var f=new Array(a);var j,h;for(var b=0;b<a;++b){j=d[b];h=j.clone();h.fid=j.fid;h.state=j.state;h._original=j;h.geometry.transform(c,g);f[b]=h}d=f}this.layer.protocol.commit(d,{callback:this.onCommit,scope:this})},onCommit:function(d){if(d.success()){var b=d.reqFeatures;var a,l;var c=[];var k=d.insertIds||[];var f=0;for(var g=0,h=b.length;g<h;++g){l=b[g];l=l._original||l;a=l.state;if(a){if(a==OpenLayers.State.DELETE){c.push(l)}else{if(a==OpenLayers.State.INSERT){l.fid=k[f];++f}}l.state=null}}if(c.length>0){this.layer.destroyFeatures(c)}}},CLASS_NAME:"OpenLayers.Strategy.Save"});OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(a){this.easing=(a)?a:OpenLayers.Easing.Expo.easeOut},start:function(c,b,d,a){this.playing=true;this.begin=c;this.finish=b;this.duration=d;this.callbacks=a.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null}if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin)}this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){if(!this.playing){return}if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)}window.clearInterval(this.interval);this.interval=null;this.playing=false},play:function(){var h={};for(var d in this.begin){var a=this.begin[d];var g=this.finish[d];if(a==null||g==null||isNaN(a)||isNaN(g)){OpenLayers.Console.error("invalid value for Tween")}var j=g-a;h[d]=this.easing.apply(this,[this.time,a,j,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,h)}if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playing=false}window.clearInterval(this.interval);this.interval=null}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(f,a,h,g){return h*f/g+a},easeOut:function(f,a,h,g){return h*f/g+a},easeInOut:function(f,a,h,g){return h*f/g+a},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOut:function(f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOut:function(f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(f,a,h,g){return h*(f/=g)*f+a},easeOut:function(f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOut:function(f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(f){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var c=0,a=this.map.controls.length;c<a;c++){var d=this.map.controls[c];if((d!=this)&&(d.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(d.displayProjection!=this.displayProjection){this.displayProjection=d.displayProjection}break}}if(c==this.map.controls.length){var b=OpenLayers.Util.getParameters();if(b.layers){this.layers=b.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(b.lat&&b.lon){this.center=new OpenLayers.LonLat(parseFloat(b.lon),parseFloat(b.lat));if(b.zoom){this.zoom=parseInt(b.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var d=0,a=this.layers.length;d<a;d++){var b=this.map.layers[d];var f=this.layers.charAt(d);if(f=="B"){this.map.setBaseLayer(b)}else{if((f=="T")||(f=="F")){b.setVisibility(f=="T")}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this});this.updateAttribution();return this.div},updateAttribution:function(){var d=[];if(this.map&&this.map.layers){for(var c=0,a=this.map.layers.length;c<a;c++){var b=this.map.layers[c];if(b.attribution&&b.getVisibility()){d.push(b.attribution)}}this.div.innerHTML=d.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[]},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);OpenLayers.Event.stopObservingElement(this.minimizeDiv);OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.clearLayersArray("base");this.clearLayersArray("data");this.map.events.un({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();if(!this.outsideViewport){this.minimizeControl()}this.redraw();return this.div},clearLayersArray:function(d){var f=this[d+"Layers"];if(f){for(var c=0,a=f.length;c<a;c++){var b=f[c];OpenLayers.Event.stopObservingElement(b.inputElem);OpenLayers.Event.stopObservingElement(b.labelSpan)}}this[d+"LayersDiv"].innerHTML="";this[d+"Layers"]=[]},checkRedraw:function(){var f=false;if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){f=true}else{for(var c=0,a=this.layerStates.length;c<a;c++){var d=this.layerStates[c];var b=this.map.layers[c];if((d.name!=b.name)||(d.inRange!=b.inRange)||(d.id!=b.id)||(d.visibility!=b.visibility)){f=true;break}}}return f},redraw:function(){if(!this.checkRedraw()){return this.div}this.clearLayersArray("base");this.clearLayersArray("data");var d=false;var o=false;var j=this.map.layers.length;this.layerStates=new Array(j);for(var g=0;g<j;g++){var h=this.map.layers[g];this.layerStates[g]={name:h.name,visibility:h.visibility,inRange:h.inRange,id:h.id}}var f=this.map.layers.slice();if(!this.ascending){f.reverse()}for(var g=0,j=f.length;g<j;g++){var h=f[g];var k=h.isBaseLayer;if(h.displayInLayerSwitcher){if(k){o=true}else{d=true}var m=(k)?(h==this.map.baseLayer):h.getVisibility();var l=document.createElement("input");l.id=this.id+"_input_"+h.name;l.name=(k)?"baseLayers":h.name;l.type=(k)?"radio":"checkbox";l.value=h.name;l.checked=m;l.defaultChecked=m;if(!k&&!h.inRange){l.disabled=true}var a={inputElem:l,layer:h,layerSwitcher:this};OpenLayers.Event.observe(l,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var b=document.createElement("span");if(!k&&!h.inRange){b.style.color="gray"}b.innerHTML=h.name;b.style.verticalAlign=(k)?"bottom":"baseline";OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,a));var r=document.createElement("br");var q=(k)?this.baseLayers:this.dataLayers;q.push({layer:h,inputElem:l,labelSpan:b});var c=(k)?this.baseLayersDiv:this.dataLayersDiv;c.appendChild(l);c.appendChild(b);c.appendChild(r)}}this.dataLbl.style.display=(d)?"":"none";this.baseLbl.style.display=(o)?"":"none";return this.div},onInputClick:function(a){if(!this.inputElem.disabled){if(this.inputElem.type=="radio"){this.inputElem.checked=true;this.layer.map.setBaseLayer(this.layer)}else{this.inputElem.checked=!this.inputElem.checked;this.layerSwitcher.updateMap()}}OpenLayers.Event.stop(a)},onLayerClick:function(a){this.updateMap()},updateMap:function(){for(var b=0,a=this.baseLayers.length;b<a;b++){var c=this.baseLayers[b];if(c.inputElem.checked){this.map.setBaseLayer(c.layer,false)}}for(var b=0,a=this.dataLayers.length;b<a;b++){var c=this.dataLayers[b];c.layer.setVisibility(c.inputElem.checked)}},maximizeControl:function(a){this.div.style.width="20em";this.div.style.height="";this.showControls(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.div.style.width="0px";this.div.style.height="0px";this.showControls(true);if(a!=null){OpenLayers.Event.stop(a)}},showControls:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":"";this.layersDiv.style.display=a?"none":""},loadContents:function(){this.div.style.position="absolute";this.div.style.top="25px";this.div.style.right="0px";this.div.style.left="";this.div.style.fontFamily="sans-serif";this.div.style.fontWeight="bold";this.div.style.marginTop="3px";this.div.style.marginLeft="3px";this.div.style.marginBottom="3px";this.div.style.fontSize="smaller";this.div.style.color="white";this.div.style.backgroundColor="transparent";OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);this.layersDiv=document.createElement("div");this.layersDiv.id=this.id+"_layersDiv";this.layersDiv.style.paddingTop="5px";this.layersDiv.style.paddingLeft="10px";this.layersDiv.style.paddingBottom="5px";this.layersDiv.style.paddingRight="75px";this.layersDiv.style.backgroundColor=this.activeColor;this.layersDiv.style.width="100%";this.layersDiv.style.height="100%";this.baseLbl=document.createElement("div");this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");this.baseLbl.style.marginTop="3px";this.baseLbl.style.marginLeft="3px";this.baseLbl.style.marginBottom="3px";this.baseLayersDiv=document.createElement("div");this.baseLayersDiv.style.paddingLeft="10px";this.dataLbl=document.createElement("div");this.dataLbl.innerHTML=OpenLayers.i18n("overlays");this.dataLbl.style.marginTop="3px";this.dataLbl.style.marginLeft="3px";this.dataLbl.style.marginBottom="3px";this.dataLayersDiv=document.createElement("div");this.dataLayersDiv.style.paddingLeft="10px";if(this.ascending){this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv);this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv)}else{this.layersDiv.appendChild(this.dataLbl);this.layersDiv.appendChild(this.dataLayersDiv);this.layersDiv.appendChild(this.baseLbl);this.layersDiv.appendChild(this.baseLayersDiv)}this.div.appendChild(this.layersDiv);OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.activeColor,blend:false});OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);var c=OpenLayers.Util.getImagesLocation();var b=new OpenLayers.Size(18,18);var a=c+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,b,a,"absolute");this.maximizeDiv.style.top="5px";this.maximizeDiv.style.right="0px";this.maximizeDiv.style.left="";this.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var a=c+"layer-switcher-minimize.png";var b=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,b,a,"absolute");this.minimizeDiv.style.top="5px";this.minimizeDiv.style.right="0px";this.minimizeDiv.style.left="";this.minimizeDiv.style.display="none";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv)},ignoreEvent:function(a){OpenLayers.Event.stop(a)},mouseDown:function(a){this.isMouseDown=true;this.ignoreEvent(a)},mouseUp:function(a){if(this.isMouseDown){this.isMouseDown=false;this.ignoreEvent(a)}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;this.map.events.un({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.map.events.on({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});this.registerWheelEvents()},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)},defaultClick:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}var a=!this.performedDrag;this.performedDrag=false;return a},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;if(a.shiftKey){this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox)}document.onselectstart=function(){return false};OpenLayers.Event.stop(a)},defaultMouseMove:function(f){this.mousePosition=f.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var d=Math.abs(this.mouseDragStart.x-f.xy.x);var b=Math.abs(this.mouseDragStart.y-f.xy.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(f.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=f.xy.x+"px"}if(f.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=f.xy.y+"px"}}else{var d=this.mouseDragStart.x-f.xy.x;var b=this.mouseDragStart.y-f.xy.y;var g=this.map.getSize();var a=new OpenLayers.Pixel(g.w/2+d,g.h/2+b);var c=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(c,null,true);this.mouseDragStart=f.xy.clone();this.map.div.style.cursor="move"}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.zoomBox){this.zoomBoxEnd(a)}else{if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor=""},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox()}this.mouseDragStart=null}},defaultWheelUp:function(a){if(this.map.getZoom()<=this.map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()+1)}},defaultWheelDown:function(a){if(this.map.getZoom()>0){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()-1)}},zoomBoxEnd:function(b){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-b.xy.x)>5||Math.abs(this.mouseDragStart.y-b.xy.y)>5){var j=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var a=this.map.getLonLatFromViewPortPx(b.xy);var h=Math.max(j.lat,a.lat);var c=Math.min(j.lat,a.lat);var g=Math.min(j.lon,a.lon);var d=Math.max(j.lon,a.lon);var f=new OpenLayers.Bounds(g,c,d,h);this.map.zoomToExtent(f)}else{var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(new OpenLayers.LonLat((a.lon),(a.lat)),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(c){var b=false;var a=OpenLayers.Event.element(c);while(a!=null){if(this.map&&a==this.map.div){b=true;break}a=a.parentNode}if(b){var d=0;if(!c){c=window.event}if(c.wheelDelta){d=c.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){d=-d}}else{if(c.detail){d=-c.detail/3}}if(d){c.xy=this.mousePosition;if(d<0){this.defaultWheelDown(c)}else{this.defaultWheelUp(c)}}OpenLayers.Event.stop(c)}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.map){this.map.events.unregister("mousemove",this,this.redraw)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}this.redraw();return this.div},redraw:function(a){var c;if(a==null){c=new OpenLayers.LonLat(0,0)}else{if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity){this.lastXy=a.xy;return}c=this.map.getLonLatFromPixel(a.xy);if(!c){return}if(this.displayProjection){c.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=a.xy}var b=this.formatOutput(c);if(b!=this.element.innerHTML){this.element.innerHTML=b}},formatOutput:function(b){var c=parseInt(this.numDigits);var a=this.prefix+b.lon.toFixed(c)+this.separator+b.lat.toFixed(c)+this.suffix;return a},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("mousemove",this,this.redraw)},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(b,a){this.direction=b;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[a])},trigger:function(){switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,this.slideFactor);break;case OpenLayers.Control.Pan.WEST:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(this.slideFactor,0);break}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(a){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position;this.buttons=[];var c=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+c.w/2,b.y);this._addButton("panup","north-mini.png",a,c);b.y=a.y+c.h;this._addButton("panleft","west-mini.png",b,c);this._addButton("panright","east-mini.png",b.add(c.w,0),c);this._addButton("pandown","south-mini.png",a.add(0,c.h*2),c);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,c.h*3+5),c);this._addButton("zoomworld","zoom-world-mini.png",a.add(0,c.h*4+5),c);this._addButton("zoomout","zoom-minus-mini.png",a.add(0,c.h*5+5),c);return this.div},_addButton:function(a,d,k,h){var g=OpenLayers.Util.getImagesLocation()+d;var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,k,h,g,"absolute");this.div.appendChild(b);OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,b));OpenLayers.Event.observe(b,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));b.action=a;b.map=this.map;if(!this.slideRatio){var c=this.slideFactor;var f=function(){return c}}else{var j=this.slideRatio;var f=function(l){return this.map.getSize()[l]*j}}b.getSlideFactor=f;this.buttons.push(b);return b},_removeButton:function(a){OpenLayers.Event.stopObservingElement(a);a.map=null;this.div.removeChild(a);OpenLayers.Util.removeItem(this.buttons,a)},removeButtons:function(){for(var a=this.buttons.length-1;a>=0;--a){this._removeButton(this.buttons[a])}},doubleClick:function(a){OpenLayers.Event.stop(a);return false},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor("h"));break;case"pandown":this.map.pan(0,this.getSlideFactor("h"));break;case"panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case"panright":this.map.pan(this.getSlideFactor("w"),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break}OpenLayers.Event.stop(a)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.controls=[]},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var a=this.controls.length-1;a>=0;a--){if(this.controls[a].events){this.controls[a].events.un({activate:this.redraw,deactivate:this.redraw,scope:this})}OpenLayers.Event.stopObservingElement(this.controls[a].panel_div);this.controls[a].panel_div=null}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]==this.defaultControl){this.controls[b].activate()}}this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){this.controls[b].deactivate()}return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var b=0,a=this.controls.length;b<a;b++){this.map.addControl(this.controls[b]);this.controls[b].deactivate();this.controls[b].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.activate();return this.div},redraw:function(){this.div.innerHTML="";if(this.active){for(var c=0,a=this.controls.length;c<a;c++){var b=this.controls[c].panel_div;if(this.controls[c].active){b.className=this.controls[c].displayClass+"ItemActive"}else{b.className=this.controls[c].displayClass+"ItemInactive"}this.div.appendChild(b)}}},activateControl:function(c){if(!this.active){return false}if(c.type==OpenLayers.Control.TYPE_BUTTON){c.trigger();this.redraw();return}if(c.type==OpenLayers.Control.TYPE_TOGGLE){if(c.active){c.deactivate()}else{c.activate()}this.redraw();return}for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]!=c){if(this.controls[b].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[b].deactivate()}}}c.activate()},addControls:function(b){if(!(b instanceof Array)){b=[b]}this.controls=this.controls.concat(b);for(var d=0,a=b.length;d<a;d++){var c=document.createElement("div");var f=document.createTextNode(" ");b[d].panel_div=c;if(b[d].title!=""){b[d].panel_div.title=b[d].title}OpenLayers.Event.observe(b[d].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,b[d]));OpenLayers.Event.observe(b[d].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var d=0,a=b.length;d<a;d++){this.map.addControl(b[d]);b[d].deactivate();b[d].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.redraw()}},onClick:function(b,a){OpenLayers.Event.stop(a?a:window.event);this.activateControl(b)},getControlsBy:function(c,a){var d=(typeof a.test=="function");var b=OpenLayers.Array.filter(this.controls,function(f){return f[c]==a||(d&&a.test(f[c]))});return b},getControlsByName:function(a){return this.getControlsBy("name",a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.element=document.createElement("div");this.div.appendChild(this.element)}this.map.events.register("moveend",this,this.updateScale);this.updateScale();return this.div},updateScale:function(){var a=this.map.getScale();if(!a){return}if(a>=9500&&a<=950000){a=Math.round(a/1000)+"K"}else{if(a>=950000){a=Math.round(a/1000000)+"M"}else{a=Math.round(a)}}this.element.innerHTML=OpenLayers.i18n("scale",{scaleDenom:a})},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.div.style.display="block";this.div.style.position="absolute";this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var a=this.topInUnits.length;this.div.appendChild(this.eTop);if((this.topOutUnits=="")||(this.topInUnits=="")){this.eTop.style.visibility="hidden"}else{this.eTop.style.visibility="visible"}this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+"Bottom";this.div.appendChild(this.eBottom);if((this.bottomOutUnits=="")||(this.bottomInUnits=="")){this.eBottom.style.visibility="hidden"}else{this.eBottom.style.visibility="visible"}}this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(b){var d=parseInt(Math.log(b)/Math.log(10));var a=Math.pow(10,d);var c=parseInt(b/a);var f;if(c>5){f=5}else{if(c>2){f=2}else{f=1}}return f*a},update:function(){var j=this.map.getResolution();if(!j){return}var o=this.map.getUnits();var c=OpenLayers.INCHES_PER_UNIT;var k=this.maxWidth*j*c[o];var a;var d;if(k>100000){a=this.topOutUnits;d=this.bottomOutUnits}else{a=this.topInUnits;d=this.bottomInUnits}var g=k/c[a];var l=k/c[d];var h=this.getBarLen(g);var f=this.getBarLen(l);g=h/c[o]*c[a];l=f/c[o]*c[d];var b=g/j;var m=l/j;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(m)+"px";this.eBottom.innerHTML=f+" "+d}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(b)+"px";this.eTop.innerHTML=h+" "+a}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){this.map.zoomToMaxExtent()}},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},isRightClick:function(a){return(((a.which)&&(a.which==3))||((a.button)&&(a.button==2)))},stop:function(b,a){if(!a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}},findElement:function(c,b){var a=OpenLayers.Event.element(c);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observe:function(b,d,c,a){var f=OpenLayers.Util.getElement(b);a=a||false;if(d=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||f.attachEvent)){d="keydown"}if(!this.observers){this.observers={}}if(!f._eventCacheID){var g="eventCacheID_";if(f.id){g=f.id+"_"+g}f._eventCacheID=OpenLayers.Util.createUniqueID(g)}var h=f._eventCacheID;if(!this.observers[h]){this.observers[h]=[]}this.observers[h].push({element:f,name:d,observer:c,useCapture:a});if(f.addEventListener){f.addEventListener(d,c,a)}else{if(f.attachEvent){f.attachEvent("on"+d,c)}}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var c=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[c])},_removeElementObservers:function(f){if(f){for(var b=f.length-1;b>=0;b--){var c=f[b];var a=new Array(c.element,c.name,c.observer,c.useCapture);var d=OpenLayers.Event.stopObserving.apply(this,a)}}},stopObserving:function(j,a,h,b){b=b||false;var g=OpenLayers.Util.getElement(j);var d=g._eventCacheID;if(a=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||g.detachEvent){a="keydown"}}var l=false;var c=OpenLayers.Event.observers[d];if(c){var f=0;while(!l&&f<c.length){var k=c[f];if((k.name==a)&&(k.observer==h)&&(k.useCapture==b)){c.splice(f,1);if(c.length==0){delete OpenLayers.Event.observers[d]}l=true;break}f++}}if(l){if(g.removeEventListener){g.removeEventListener(a,h,b)}else{if(g&&g.detachEvent){g.detachEvent("on"+a,h)}}}return l},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers){var b=OpenLayers.Event.observers[a];OpenLayers.Event._removeElementObservers.apply(this,[b])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);if(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:false,clearMouseListener:null,initialize:function(c,f,h,g,b){OpenLayers.Util.extend(this,b);this.object=c;this.fallThrough=g;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(h!=null){for(var d=0,a=h.length;d<a;d++){this.addEventType(h[d])}}if(f!=null){this.attachToElement(f)}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element);if(this.element.hasScrollEvent){OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)}}this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(a){if(!this.listeners[a]){this.eventTypes.push(a);this.listeners[a]=[]}},attachToElement:function(d){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=d;for(var c=0,a=this.BROWSER_EVENTS.length;c<a;c++){var b=this.BROWSER_EVENTS[c];this.addEventType(b);OpenLayers.Event.observe(d,b,this.eventHandler)}OpenLayers.Event.observe(d,"dragstart",OpenLayers.Event.stop)},on:function(a){for(var b in a){if(b!="scope"){this.register(b,a.scope,a[b])}}},register:function(b,d,c){if((c!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,b)!=-1)){if(d==null){d=this.object}var a=this.listeners[b];a.push({obj:d,func:c})}},registerPriority:function(b,d,c){if(c!=null){if(d==null){d=this.object}var a=this.listeners[b];if(a!=null){a.unshift({obj:d,func:c})}}},un:function(a){for(var b in a){if(b!="scope"){this.unregister(b,a.scope,a[b])}}},unregister:function(d,g,f){if(g==null){g=this.object}var c=this.listeners[d];if(c!=null){for(var b=0,a=c.length;b<a;b++){if(c[b].obj==g&&c[b].func==f){c.splice(b,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(f,b){var d=this.listeners[f];if(!d||d.length==0){return}if(b==null){b={}}b.object=this.object;b.element=this.element;if(!b.type){b.type=f}var d=d.slice(),g;for(var c=0,a=d.length;c<a;c++){var h=d[c];g=h.func.apply(h.obj,[b]);if((g!=undefined)&&(g==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(b,true)}return g},handleBrowserEvent:function(a){if(this.includeXY){a.xy=this.getMousePosition(a)}this.triggerEvent(a.type,a)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(a){if(!this.includeXY){this.clearMouseCache()}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",this.clearMouseListener);this.element.hasScrollEvent=true}}if(!this.element.scrolls){this.element.scrolls=[(document.documentElement.scrollLeft||document.body.scrollLeft),(document.documentElement.scrollTop||document.body.scrollTop)]}if(!this.element.lefttop){this.element.lefttop=[(document.documentElement.clientLeft||0),(document.documentElement.clientTop||0)]}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element.offsets[0]+=this.element.scrolls[0];this.element.offsets[1]+=this.element.scrolls[1]}return new OpenLayers.Pixel((a.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(a.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:false,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(a){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(a){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(h,c,g,b,a,f,d){this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)},draw:function(a){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(a){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,a);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(a){this.border=0},setRicoCorners:function(){var a=this.getCornersToRound(this.relativePosition);var b={corners:a,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,b);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,b);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var a=["tl","tr","bl","br"];var b=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(a,b);return a.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,initialize:function(h,c,g,b,a,f,d){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);if(this.fixedRelativePosition){this.updateRelativePosition();this.calculateRelativePosition=function(j){return this.relativePosition}}this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;if(f){this.closeDiv.style.zIndex=1}this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){this.imageSrc=null;this.imageSize=null;this.isAlphaImage=null;this.fixedRelativePosition=false;this.positionBlocks=null;for(var a=0;a<this.blocks.length;a++){var b=this.blocks[a];if(b.image){b.div.removeChild(b.image)}b.image=null;if(b.div){this.groupDiv.removeChild(b.div)}b.div=null}this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(a){},setBorder:function(){},setOpacity:function(a){},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var a=this.getContentDivPadding();this.closeDiv.style.right=a.right+this.padding.right+"px";this.closeDiv.style.top=a.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(a){var b=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);b=b.offset(this.positionBlocks[this.relativePosition].offset);return b},createBlocks:function(){this.blocks=[];var g=null;for(var f in this.positionBlocks){g=f;break}var a=this.positionBlocks[g];for(var d=0;d<a.blocks.length;d++){var j={};this.blocks.push(j);var b=this.id+"_FrameDecorationDiv_"+d;j.div=OpenLayers.Util.createDiv(b,null,null,null,"absolute",null,"hidden",null);var c=this.id+"_FrameDecorationImg_"+d;var h=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;j.image=h(c,null,this.imageSize,this.imageSrc,"absolute",null,null,null);j.div.appendChild(j.image);this.groupDiv.appendChild(j.div)}},updateBlocks:function(){if(!this.blocks){this.createBlocks()}if(this.size&&this.relativePosition){var k=this.positionBlocks[this.relativePosition];for(var g=0;g<k.blocks.length;g++){var c=k.blocks[g];var f=this.blocks[g];var d=c.anchor.left;var m=c.anchor.bottom;var a=c.anchor.right;var q=c.anchor.top;var o=(isNaN(c.size.w))?this.size.w-(a+d):c.size.w;var j=(isNaN(c.size.h))?this.size.h-(m+q):c.size.h;f.div.style.width=(o<0?0:o)+"px";f.div.style.height=(j<0?0:j)+"px";f.div.style.left=(d!=null)?d+"px":"";f.div.style.bottom=(m!=null)?m+"px":"";f.div.style.right=(a!=null)?a+"px":"";f.div.style.top=(q!=null)?q+"px":"";f.image.style.left=c.position.x+"px";f.image.style.top=c.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(b,a){OpenLayers.Util.extend(this,a);this.projCode=b;if(window.Proj4js){this.proj=new Proj4js.Proj(b)}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(a){if(a&&a.getCode){return this.getCode()==a.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(c,b,a){if(!OpenLayers.Projection.transforms[c]){OpenLayers.Projection.transforms[c]={}}OpenLayers.Projection.transforms[c][b]=a};OpenLayers.Projection.transform=function(a,c,b){if(c.proj&&b.proj){a=Proj4js.transform(c.proj,b.proj,a)}else{if(c&&b&&OpenLayers.Projection.transforms[c.getCode()]&&OpenLayers.Projection.transforms[c.getCode()][b.getCode()]){OpenLayers.Projection.transforms[c.getCode()][b.getCode()](a)}}return a};OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,initialize:function(b){OpenLayers.Protocol.prototype.initialize.apply(this,[b]);if(!b.format){this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))}if(!this.featureNS){var a=this.format.readNode;this.format.readNode=function(c,d){if(!this.featureNS&&c.prefix==this.featurePrefix){this.featureNS=c.namespaceURI;this.setNamespace("feature",this.featureNS)}return a.apply(this,arguments)}}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy()}this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(c,a,b){return OpenLayers.Function.bind(function(){c.apply(this,[a,b])},this)},read:function(b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options||{});var a=new OpenLayers.Protocol.Response({requestType:"read"});var c=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",b)]);a.priv=OpenLayers.Request.POST({url:b.url,callback:this.createCallback(this.handleRead,a,b),params:b.params,headers:b.headers,data:c});return a},handleRead:function(a,b){if(b.callback){var c=a.priv;if(c.status>=200&&c.status<300){a.features=this.parseFeatures(c);a.code=OpenLayers.Protocol.Response.SUCCESS}else{a.code=OpenLayers.Protocol.Response.FAILURE}b.callback.call(b.scope,a)}},parseFeatures:function(a){var b=a.responseXML;if(!b||!b.documentElement){b=a.responseText}if(!b||b.length<=0){return null}return this.format.read(b)},commit:function(c,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);var a=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:c});a.priv=OpenLayers.Request.POST({url:b.url,data:this.format.write(c,b),callback:this.createCallback(this.handleCommit,a,b)});return a},handleCommit:function(a,b){if(b.callback){var c=a.priv;var d=c.responseXML;if(!d||!d.documentElement){d=c.responseText}var f=this.format.read(d)||{};a.insertIds=f.insertIds||[];a.code=(f.success)?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},filterDelete:function(f,c){c=OpenLayers.Util.extend({},c);OpenLayers.Util.applyDefaults(c,this.options);var b=new OpenLayers.Protocol.Response({requestType:"commit"});var a=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});var d=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(c.featureNS?this.featurePrefix+":":"")+c.featureType}});if(c.featureNS){d.setAttribute("xmlns:"+this.featurePrefix,c.featureNS)}var h=this.format.writeNode("ogc:Filter",f);d.appendChild(h);a.appendChild(d);var g=OpenLayers.Format.XML.prototype.write.apply(this.format,[a]);return OpenLayers.Request.POST({url:this.url,callback:c.callback||function(){},data:g})},abort:function(a){if(a){a.priv.abort()}},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},isGecko:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.isGecko=(navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var a="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(a+"SVG","1.1")||document.implementation.hasFeature(a+"BasicStructure","1.1")))},inValidRange:function(a,f,b){var d=a+(b?0:this.translationParameters.x);var c=f+(b?0:this.translationParameters.y);return(d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL&&c>=-this.MAX_PIXEL&&c<=this.MAX_PIXEL)},setExtent:function(b,d){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var g=-b.left/a;var f=b.top/a;if(d){this.left=g;this.top=f;var c="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",c);this.translate(0,0);return true}else{var h=this.translate(g-this.left,f-this.top);if(!h){this.setExtent(b,true)}return h}},translate:function(a,c){if(!this.inValidRange(a,c,true)){return false}else{var b="";if(a||c){b="translate("+a+","+c+")"}this.root.setAttributeNS(null,"transform",b);this.translationParameters={x:a,y:c};return true}},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(c,b){var a=null;switch(c.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="image"}else{if(this.isComplexSymbol(b.graphicName)){a="use"}else{a="circle"}}break;case"OpenLayers.Geometry.Rectangle":a="rect";break;case"OpenLayers.Geometry.LineString":a="polyline";break;case"OpenLayers.Geometry.LinearRing":a="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="path";break;default:break}return a},setStyle:function(s,v,b){v=v||s._style;b=b||s._options;var k=parseFloat(s.getAttributeNS(null,"r"));var j=1;var d;if(s._geometryClass=="OpenLayers.Geometry.Point"&&k){s.style.visibility="";if(v.graphic===false){s.style.visibility="hidden"}else{if(v.externalGraphic){d=this.getPosition(s);if(v.graphicTitle){s.setAttributeNS(null,"title",v.graphicTitle)}if(v.graphicWidth&&v.graphicHeight){s.setAttributeNS(null,"preserveAspectRatio","none")}var q=v.graphicWidth||v.graphicHeight;var m=v.graphicHeight||v.graphicWidth;q=q?q:v.pointRadius*2;m=m?m:v.pointRadius*2;var w=(v.graphicXOffset!=undefined)?v.graphicXOffset:-(0.5*q);var f=(v.graphicYOffset!=undefined)?v.graphicYOffset:-(0.5*m);var a=v.graphicOpacity||v.fillOpacity;s.setAttributeNS(null,"x",(d.x+w).toFixed());s.setAttributeNS(null,"y",(d.y+f).toFixed());s.setAttributeNS(null,"width",q);s.setAttributeNS(null,"height",m);s.setAttributeNS(this.xlinkns,"href",v.externalGraphic);s.setAttributeNS(null,"style","opacity: "+a)}else{if(this.isComplexSymbol(v.graphicName)){var c=v.pointRadius*3;var l=c*2;var o=this.importSymbol(v.graphicName);var u="#"+o;d=this.getPosition(s);j=this.symbolSize[o]/l;var g=s.parentNode;var h=s.nextSibling;if(g){g.removeChild(s)}s.setAttributeNS(this.xlinkns,"href",u);s.setAttributeNS(null,"width",l);s.setAttributeNS(null,"height",l);s.setAttributeNS(null,"x",d.x-c);s.setAttributeNS(null,"y",d.y-c);if(h){g.insertBefore(s,h)}else{if(g){g.appendChild(s)}}}else{s.setAttributeNS(null,"r",v.pointRadius)}}}if(typeof v.rotation!="undefined"&&d){var t=OpenLayers.String.format("rotate(${0} ${1} ${2})",[v.rotation,d.x,d.y]);s.setAttributeNS(null,"transform",t)}}if(b.isFilled){s.setAttributeNS(null,"fill",v.fillColor);s.setAttributeNS(null,"fill-opacity",v.fillOpacity)}else{s.setAttributeNS(null,"fill","none")}if(b.isStroked){s.setAttributeNS(null,"stroke",v.strokeColor);s.setAttributeNS(null,"stroke-opacity",v.strokeOpacity);s.setAttributeNS(null,"stroke-width",v.strokeWidth*j);s.setAttributeNS(null,"stroke-linecap",v.strokeLinecap);s.setAttributeNS(null,"stroke-linejoin","round");s.setAttributeNS(null,"stroke-dasharray",this.dashStyle(v,j))}else{s.setAttributeNS(null,"stroke","none")}if(v.pointerEvents){s.setAttributeNS(null,"pointer-events",v.pointerEvents)}if(v.cursor!=null){s.setAttributeNS(null,"cursor",v.cursor)}return s},dashStyle:function(c,b){var a=c.strokeWidth*b;switch(c.strokeDashstyle){case"solid":return"none";case"dot":return[1,4*a].join();case"dash":return[4*a,4*a].join();case"dashdot":return[4*a,4*a,1,4*a].join();case"longdash":return[8*a,4*a].join();case"longdashdot":return[8*a,4*a,1,4*a].join();default:return c.strokeDashstyle.replace(/ /g,",")}},createNode:function(a,c){var b=document.createElementNS(this.xmlns,a);if(c){b.setAttributeNS(null,"id",c)}return b},nodeTypeCompare:function(b,a){return(a==b.nodeName)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"g")},createDefs:function(){var a=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(a);return a},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(d,f,b){var c=this.getResolution();var a=(f.x/c+this.left);var g=(this.top-f.y/c);if(this.inValidRange(a,g)){d.setAttributeNS(null,"cx",a);d.setAttributeNS(null,"cy",g);d.setAttributeNS(null,"r",b);return d}else{return false}},drawLineString:function(b,c){var a=this.getComponentsString(c.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawLinearRing:function(b,c){var a=this.getComponentsString(c.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawPolygon:function(b,k){var h="";var l=true;var a=true;var c,m;for(var f=0,g=k.components.length;f<g;f++){h+=" M";c=this.getComponentsString(k.components[f].components," ");m=c.path;if(m){h+=" "+m;a=c.complete&&a}else{l=false}}h+=" z";if(l){b.setAttributeNS(null,"d",h);b.setAttributeNS(null,"fill-rule","evenodd");return a?b:null}else{return false}},drawRectangle:function(c,d){var b=this.getResolution();var a=(d.x/b+this.left);var f=(this.top-d.y/b);if(this.inValidRange(a,f)){c.setAttributeNS(null,"x",a);c.setAttributeNS(null,"y",f);c.setAttributeNS(null,"width",d.width/b);c.setAttributeNS(null,"height",d.height/b);return c}else{return false}},drawSurface:function(g,j){var h=null;var b=true;for(var f=0,a=j.components.length;f<a;f++){if((f%3)==0&&(f/3)==0){var c=this.getShortString(j.components[f]);if(!c){b=false}h="M "+c}else{if((f%3)==1){var c=this.getShortString(j.components[f]);if(!c){b=false}h+=" C "+c}else{var c=this.getShortString(j.components[f]);if(!c){b=false}h+=" "+c}}}h+=" Z";if(b){g.setAttributeNS(null,"d",h);return g}else{return false}},drawText:function(c,a,k){var b=this.getResolution();var j=(k.x/b+this.left);var f=(k.y/b-this.top);var h=this.nodeFactory(c+this.LABEL_ID_SUFFIX,"text");var g=this.nodeFactory(c+this.LABEL_ID_SUFFIX+"_tspan","tspan");h.setAttributeNS(null,"x",j);h.setAttributeNS(null,"y",-f);h.setAttributeNS(null,"pointer-events","none");if(a.fontColor){h.setAttributeNS(null,"fill",a.fontColor)}if(a.fontFamily){h.setAttributeNS(null,"font-family",a.fontFamily)}if(a.fontSize){h.setAttributeNS(null,"font-size",a.fontSize)}if(a.fontWeight){h.setAttributeNS(null,"font-weight",a.fontWeight)}var d=a.labelAlign||"cm";h.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[d[0]]||"middle");if(this.isGecko){h.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[d[1]]||"central")}else{g.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[d[1]]||"-35%")}g.textContent=a.label;if(!h.parentNode){h.appendChild(g);this.textRoot.appendChild(h)}},getComponentsString:function(f,d){var h=[];var a=true;var g=f.length;var m=[];var k,l,b;for(var c=0;c<g;c++){l=f[c];h.push(l);k=this.getShortString(l);if(k){m.push(k)}else{if(c>0){if(this.getShortString(f[c-1])){m.push(this.clipLine(f[c],f[c-1]))}}if(c<g-1){if(this.getShortString(f[c+1])){m.push(this.clipLine(f[c],f[c+1]))}}a=false}}return{path:m.join(d||","),complete:a}},clipLine:function(f,j){if(j.equals(f)){return""}var g=this.getResolution();var b=this.MAX_PIXEL-this.translationParameters.x;var a=this.MAX_PIXEL-this.translationParameters.y;var d=j.x/g+this.left;var m=this.top-j.y/g;var c=f.x/g+this.left;var l=this.top-f.y/g;var h;if(c<-b||c>b){h=(l-m)/(c-d);c=c<0?-b:b;l=m+(c-d)*h}if(l<-a||l>a){h=(c-d)/(l-m);l=l<0?-a:a;c=d+(l-m)*h}return c+","+l},getShortString:function(b){var c=this.getResolution();var a=(b.x/c+this.left);var d=(this.top-b.y/c);if(this.inValidRange(a,d)){return a+","+d}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(f){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+f;if(document.getElementById(b)!=null){return b}var d=OpenLayers.Renderer.symbol[f];if(!d){throw new Error(f+" is not a valid symbol name");return}var h=this.nodeFactory(b,"symbol");var c=this.nodeFactory(null,"polygon");h.appendChild(c);var o=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var l="";var k,j;for(var g=0;g<d.length;g=g+2){k=d[g];j=d[g+1];o.left=Math.min(o.left,k);o.bottom=Math.min(o.bottom,j);o.right=Math.max(o.right,k);o.top=Math.max(o.top,j);l+=" "+k+","+j}c.setAttributeNS(null,"points",l);var a=o.getWidth();var m=o.getHeight();var q=[o.left-a,o.bottom-m,a*3,m*3];h.setAttributeNS(null,"viewBox",q.join(" "));this.symbolSize[b]=Math.max(a,m)*3;this.defs.appendChild(h);return h.id},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};OpenLayers.Renderer.SVG.LABEL_VSHIFT={t:"-70%",b:"0"};OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(b){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var f=document.createStyleSheet();var c=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var d=0,a=c.length;d<a;d++){f.addRule("olv\\:"+c[d],"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(k,a){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var c=this.getResolution();var b=k.left/c;var g=k.top/c-this.size.h;if(a){this.offset={x:b,y:g};b=0;g=0}else{b=b-this.offset.x;g=g-this.offset.y}var m=b+" "+g;this.root.coordorigin=m;var j=[this.root,this.vectorRoot,this.textRoot];var h;for(var d=0,f=j.length;d<f;++d){h=j[d];var l=this.size.w+" "+this.size.h;h.coordsize=l}this.root.style.flip="y";return true},setSize:function(g){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var d=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var c=this.size.w+"px";var j=this.size.h+"px";var b;for(var f=0,a=d.length;f<a;++f){b=d[f];b.style.width=c;b.style.height=j}},getNodeType:function(c,b){var a=null;switch(c.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="olv:rect"}else{if(this.isComplexSymbol(b.graphicName)){a="olv:shape"}else{a="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":a="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="olv:shape";break;default:break}return a},setStyle:function(d,b,t,m){b=b||d._style;t=t||d._options;var k=1;if(d._geometryClass=="OpenLayers.Geometry.Point"){if(b.externalGraphic){if(b.graphicTitle){d.title=b.graphicTitle}var c=b.graphicWidth||b.graphicHeight;var o=b.graphicHeight||b.graphicWidth;c=c?c:b.pointRadius*2;o=o?o:b.pointRadius*2;var g=this.getResolution();var j=(b.graphicXOffset!=undefined)?b.graphicXOffset:-(0.5*c);var f=(b.graphicYOffset!=undefined)?b.graphicYOffset:-(0.5*o);d.style.left=((m.x/g-this.offset.x)+j).toFixed();d.style.top=((m.y/g-this.offset.y)-(f+o)).toFixed();d.style.width=c+"px";d.style.height=o+"px";d.style.flip="y";b.fillColor="none";t.isStroked=false}else{if(this.isComplexSymbol(b.graphicName)){var a=this.importSymbol(b.graphicName);d.path=a.path;d.coordorigin=a.left+","+a.bottom;var s=a.size;d.coordsize=s+","+s;this.drawCircle(d,m,b.pointRadius);d.style.flip="y"}else{this.drawCircle(d,m,b.pointRadius)}}}if(t.isFilled){d.fillcolor=b.fillColor}else{d.filled="false"}var l=d.getElementsByTagName("fill");var r=(l.length==0)?null:l[0];if(!t.isFilled){if(r){d.removeChild(r)}}else{if(!r){r=this.createNode("olv:fill",d.id+"_fill")}r.opacity=b.fillOpacity;if(d._geometryClass=="OpenLayers.Geometry.Point"&&b.externalGraphic){if(b.graphicOpacity){r.opacity=b.graphicOpacity}r.src=b.externalGraphic;r.type="frame";if(!(b.graphicWidth&&b.graphicHeight)){r.aspect="atmost"}}if(r.parentNode!=d){d.appendChild(r)}}if(typeof b.rotation!="undefined"){if(b.externalGraphic){this.graphicRotate(d,j,f);r.opacity=0}else{d.style.rotation=b.rotation}}if(t.isStroked){d.strokecolor=b.strokeColor;d.strokeweight=b.strokeWidth+"px"}else{d.stroked=false}var h=d.getElementsByTagName("stroke");var q=(h.length==0)?null:h[0];if(!t.isStroked){if(q){d.removeChild(q)}}else{if(!q){q=this.createNode("olv:stroke",d.id+"_stroke");d.appendChild(q)}q.opacity=b.strokeOpacity;q.endcap=!b.strokeLinecap||b.strokeLinecap=="butt"?"flat":b.strokeLinecap;q.dashstyle=this.dashStyle(b)}if(b.cursor!="inherit"&&b.cursor!=null){d.style.cursor=b.cursor}return d},graphicRotate:function(r,v,g){var u=u||r._style;var d=r._options;var a,l;if(!(u.graphicWidth&&u.graphicHeight)){var w=new Image();w.onreadystatechange=OpenLayers.Function.bind(function(){if(w.readyState=="complete"||w.readyState=="interactive"){a=w.width/w.height;l=Math.max(u.pointRadius*2,u.graphicWidth||0,u.graphicHeight||0);v=v*a;u.graphicWidth=l*a;u.graphicHeight=l;this.graphicRotate(r,v,g)}},this);w.src=u.externalGraphic;return}else{l=Math.max(u.graphicWidth,u.graphicHeight);a=u.graphicWidth/u.graphicHeight}var q=Math.round(u.graphicWidth||l*a);var m=Math.round(u.graphicHeight||l);r.style.width=q+"px";r.style.height=m+"px";var o=document.getElementById(r.id+"_image");if(!o){o=this.createNode("olv:imagedata",r.id+"_image");r.appendChild(o)}o.style.width=q+"px";o.style.height=m+"px";o.src=u.externalGraphic;o.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var s=u.rotation*Math.PI/180;var j=Math.sin(s);var f=Math.cos(s);var h="progid:DXImageTransform.Microsoft.Matrix(M11="+f+",M12="+(-j)+",M21="+j+",M22="+f+",SizingMethod='auto expand')\n";var b=u.graphicOpacity||u.fillOpacity;if(b&&b!=1){h+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+b+")\n"}r.style.filter=h;var t=new OpenLayers.Geometry.Point(-v,-g);var c=new OpenLayers.Bounds(0,0,q,m).toGeometry();c.rotate(u.rotation,t);var k=c.getBounds();r.style.left=Math.round(parseInt(r.style.left)+k.left)+"px";r.style.top=Math.round(parseInt(r.style.top)-k.bottom)+"px"},postDraw:function(a){var c=a._style.fillColor;var b=a._style.strokeColor;if(c=="none"&&a.fillcolor!=c){a.fillcolor=c}if(b=="none"&&a.strokecolor!=b){a.strokecolor=b}},setNodeDimension:function(b,f){var d=f.getBounds();if(d){var a=this.getResolution();var c=new OpenLayers.Bounds((d.left/a-this.offset.x).toFixed(),(d.bottom/a-this.offset.y).toFixed(),(d.right/a-this.offset.x).toFixed(),(d.top/a-this.offset.y).toFixed());b.style.left=c.left+"px";b.style.top=c.top+"px";b.style.width=c.getWidth()+"px";b.style.height=c.getHeight()+"px";b.coordorigin=c.left+" "+c.top;b.coordsize=c.getWidth()+" "+c.getHeight()}},dashStyle:function(a){var c=a.strokeDashstyle;switch(c){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return c;default:var b=c.split(/[ ,]/);if(b.length==2){if(1*b[0]>=2*b[1]){return"longdash"}return(b[0]==1||b[1]==1)?"dot":"dash"}else{if(b.length==4){return(1*b[0]>=2*b[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(a,c){var b=document.createElement(a);if(c){b.id=c}b.unselectable="on";b.onselectstart=function(){return(false)};return b},nodeTypeCompare:function(c,b){var d=b;var a=d.indexOf(":");if(a!=-1){d=d.substr(a+1)}var f=c.nodeName;a=f.indexOf(":");if(a!=-1){f=f.substr(a+1)}return(d==f)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"olv:group")},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(d,f,a){if(!isNaN(f.x)&&!isNaN(f.y)){var b=this.getResolution();d.style.left=((f.x/b-this.offset.x).toFixed()-a)+"px";d.style.top=((f.y/b-this.offset.y).toFixed()-a)+"px";var c=a*2;d.style.width=c+"px";d.style.height=c+"px";return d}return false},drawLineString:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(b,l,h){this.setNodeDimension(b,l);var c=this.getResolution();var a=l.components.length;var f=new Array(a);var j,m,k;for(var g=0;g<a;g++){j=l.components[g];m=(j.x/c-this.offset.x);k=(j.y/c-this.offset.y);f[g]=" "+m.toFixed()+","+k.toFixed()+" l "}var d=(h)?" x e":" e";b.path="m"+f.join("")+d;return b},drawPolygon:function(b,m){this.setNodeDimension(b,m);var c=this.getResolution();var q=[];var g,f,d,k,a,h,o,l;for(d=0,k=m.components.length;d<k;d++){g=m.components[d];q.push("m");for(f=0,a=g.components.length;f<a;f++){h=g.components[f];o=h.x/c-this.offset.x;l=h.y/c-this.offset.y;q.push(" "+o.toFixed()+","+l.toFixed());if(f==0){q.push(" l")}}q.push(" x ")}q.push("e");b.path=q.join("");return b},drawRectangle:function(b,c){var a=this.getResolution();b.style.left=(c.x/a-this.offset.x)+"px";b.style.top=(c.y/a-this.offset.y)+"px";b.style.width=c.width/a+"px";b.style.height=c.height/a+"px";return b},drawText:function(d,a,j){var h=this.nodeFactory(d+this.LABEL_ID_SUFFIX,"olv:rect");var g=this.nodeFactory(d+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var c=this.getResolution();h.style.left=(j.x/c-this.offset.x).toFixed()+"px";h.style.top=(j.y/c-this.offset.y).toFixed()+"px";h.style.flip="y";g.innerText=a.label;if(a.fillColor){g.style.color=a.fontColor}if(a.fontFamily){g.style.fontFamily=a.fontFamily}if(a.fontSize){g.style.fontSize=a.fontSize}if(a.fontWeight){g.style.fontWeight=a.fontWeight}g.style.whiteSpace="nowrap";g.inset="1px,0px,0px,0px";if(!h.parentNode){h.appendChild(g);this.textRoot.appendChild(h)}var f=a.labelAlign||"cm";var k=g.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[f.substr(0,1)]);var b=g.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[f.substr(1,1)]);h.style.left=parseInt(h.style.left)-k-1+"px";h.style.top=parseInt(h.style.top)+b+"px"},drawSurface:function(a,h){this.setNodeDimension(a,h);var b=this.getResolution();var k=[];var d,j,g;for(var c=0,f=h.components.length;c<f;c++){d=h.components[c];j=d.x/b-this.offset.x;g=d.y/b-this.offset.y;if((c%3)==0&&(c/3)==0){k.push("m")}else{if((c%3)==1){k.push(" c")}}k.push(" "+j+","+g)}k.push(" x e");a.path=k.join("");return a},moveRoot:function(b){var a=this.map.getLayer(b.container.id);if(a instanceof OpenLayers.Layer.Vector.RootContainer){a=this.map.getLayer(this.container.id)}a&&a.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);a&&a.redraw()},importSymbol:function(d){var b=this.container.id+"-"+d;var a=this.symbolCache[b];if(a){return a}var c=OpenLayers.Renderer.symbol[d];if(!c){throw new Error(d+" is not a valid symbol name");return}var j=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var f=["m"];for(var g=0;g<c.length;g=g+2){x=c[g];y=c[g+1];j.left=Math.min(j.left,x);j.bottom=Math.min(j.bottom,y);j.right=Math.max(j.right,x);j.top=Math.max(j.top,y);f.push(x);f.push(y);if(g==0){f.push("l")}}f.push("x e");var k=f.join(" ");var h=(j.getWidth()-j.getHeight())/2;if(h>0){j.bottom=j.bottom-h;j.top=j.top+h}else{j.left=j.left-h;j.right=j.right+h}a={path:k,size:j.getWidth(),left:j.left,bottom:j.bottom};this.symbolCache[b]=a;return a},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,initialize:function(d,a,f,b,c){this.layer=d;this.position=a.clone();this.bounds=f.clone();this.url=b;this.size=c.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},unload:function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("unload")}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destroy();this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(a,this);return a},draw:function(){var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));this.shouldDraw=(b||this.layer.displayOutsideMaxExtent);this.clear();return this.shouldDraw},moveTo:function(b,a,c){if(c==null){c=true}this.bounds=b.clone();this.position=a.clone();if(c){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(a){var g=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(g);var d=this.layer.map.getLonLatFromLayerPx(a);var c=a.clone();c.x+=this.size.w;c.y+=this.size.h;var b=this.layer.map.getLonLatFromLayerPx(c);if(d.lon>b.lon){if(d.lon<0){d.lon=-180-(d.lon+180)}else{b.lon=180+b.lon+180}}var f=new OpenLayers.Bounds(d.lon,b.lat,b.lon,d.lat);return f},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);if(a){this.position=a}if(b){this.direction=b}this.measureDivs=[]},destroy:function(){for(var b in this.buttons){var a=this.buttons[b];a.map=null;a.events.destroy()}OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);this.buttons={};var b=new OpenLayers.Size(28,28);var a=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",a,b,"Shift->Drag to zoom to area");a=a.add((this.direction=="vertical"?0:b.w),(this.direction=="vertical"?b.h:0));this._addButton("pan","panning-hand-off.png","panning-hand-on.png",a,b,"Drag the map to pan.");a=a.add((this.direction=="vertical"?0:b.w),(this.direction=="vertical"?b.h:0));this.switchModeTo("pan");return this.div},_addButton:function(a,f,d,k,h,j){var g=OpenLayers.Util.getImagesLocation()+f;var c=OpenLayers.Util.getImagesLocation()+d;var b=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+a,k,h,g,"absolute");this.div.appendChild(b);b.imgLocation=g;b.activeImgLocation=c;b.events=new OpenLayers.Events(this,b,null,true);b.events.on({mousedown:this.buttonDown,mouseup:this.buttonUp,dblclick:OpenLayers.Event.stop,scope:this});b.action=a;b.title=j;b.alt=j;b.map=this.map;this.buttons[a]=b;return b},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.buttonClicked=a.element.action;OpenLayers.Event.stop(a)},buttonUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.buttonClicked!=null){if(this.buttonClicked==a.element.action){this.switchModeTo(a.element.action)}OpenLayers.Event.stop(a);this.buttonClicked=null}},defaultDblClick:function(b){this.switchModeTo("pan");this.performedDrag=false;var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;this.startViaKeyboard=false;if(a.shiftKey&&this.mode!="zoombox"){this.switchModeTo("zoombox");this.startViaKeyboard=true}else{if(a.altKey&&this.mode!="measure"){this.switchModeTo("measure")}else{if(!this.mode){this.switchModeTo("pan")}}}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);this.performedDrag=true;break;case"measure":var c="";if(this.measureStart){var b=this.map.getLonLatFromViewPortPx(this.mouseDragStart);c=OpenLayers.Util.distVincenty(this.measureStart,b);c=Math.round(c*100)/100;c=c+"km";this.measureStartBox=this.measureBox}this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBox.style.width="4px";this.measureBox.style.height="4px";this.measureBox.style.fontSize="1px";this.measureBox.style.backgroundColor="red";this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBox);if(c){this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBoxDistance.innerHTML=c;this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBoxDistance);this.measureDivs.push(this.measureBoxDistance)}this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBox);this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor="move";break}document.onselectstart=function(){return false};OpenLayers.Event.stop(a)},switchModeTo:function(c){if(c!=this.mode){if(this.mode&&this.buttons[this.mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation)}if(this.mode=="measure"&&c!="measure"){for(var b=0,a=this.measureDivs.length;b<a;b++){if(this.measureDivs[b]){this.map.layerContainerDiv.removeChild(this.measureDivs[b])}}this.measureDivs=[];this.measureStart=null}this.mode=c;if(this.buttons[c]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[c],null,null,null,this.buttons[c].activeImgLocation)}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";break;default:this.map.div.style.cursor="";break}}},leaveMode:function(){this.switchModeTo("pan")},defaultMouseMove:function(f){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var d=Math.abs(this.mouseDragStart.x-f.xy.x);var b=Math.abs(this.mouseDragStart.y-f.xy.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(f.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=f.xy.x+"px"}if(f.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=f.xy.y+"px"}break;default:var d=this.mouseDragStart.x-f.xy.x;var b=this.mouseDragStart.y-f.xy.y;var g=this.map.getSize();var a=new OpenLayers.Pixel(g.w/2+d,g.h/2+b);var c=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(c,null,true);this.mouseDragStart=f.xy.clone()}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.mode){case"zoombox":this.zoomBoxEnd(a);if(this.startViaKeyboard){this.leaveMode()}break;case"pan":if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="default"},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox();if(this.startViaKeyboard){this.leaveMode()}}this.mouseDragStart=null;this.map.div.style.cursor="default"}},defaultClick:function(a){if(this.performedDrag){this.performedDrag=false;return false}},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});OpenLayers.Control.MouseToolbar.X=6;OpenLayers.Control.MouseToolbar.Y=300;OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,activateOnDraw:true,clearOnDeactivate:false,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:false,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.registry=OpenLayers.Util.extend({moveend:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution()}}},this.registry);this.clear();var b={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(b,this.previousOptions);this.previous=new OpenLayers.Control.Button(b);var c={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(c,this.nextOptions);this.next=new OpenLayers.Control.Button(c)},onPreviousChange:function(b,a){if(b&&!this.previous.active){this.previous.activate()}else{if(!b&&this.previous.active){this.previous.deactivate()}}},onNextChange:function(b,a){if(b&&!this.next.active){this.next.activate()}else{if(!b&&this.next.active){this.next.deactivate()}}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var a in this){this[a]=null}},setMap:function(a){this.map=a;this.next.setMap(a);this.previous.setMap(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw();if(this.activateOnDraw){this.activate()}},previousTrigger:function(){var b=this.previousStack.shift();var a=this.previousStack.shift();if(a!=undefined){this.nextStack.unshift(b);this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}else{this.previousStack.unshift(b)}return a},nextTrigger:function(){var a=this.nextStack.shift();if(a!=undefined){this.previousStack.unshift(a);this.restoring=true;this.restore(a);this.restoring=false;this.onNextChange(this.nextStack[0],this.nextStack.length);this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}return a},clear:function(){this.previousStack=[];this.nextStack=[]},restore:function(b){var a=this.map.getZoomForResolution(b.resolution);this.map.setCenter(b.center,a)},setListeners:function(){this.listeners={};for(var a in this.registry){this.listeners[a]=OpenLayers.Function.bind(function(){if(!this.restoring){var b=this.registry[a].apply(this,arguments);this.previousStack.unshift(b);if(this.previousStack.length>1){this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)}if(this.previousStack.length>(this.limit+1)){this.previousStack.pop()}if(this.nextStack.length>0){this.nextStack=[];this.onNextChange(null,0)}}return true},this)}},activate:function(){var a=false;if(this.map){if(OpenLayers.Control.prototype.activate.apply(this)){if(this.listeners==null){this.setListeners()}for(var b in this.listeners){this.map.events.register(b,this,this.listeners[b])}a=true;if(this.previousStack.length==0){this.initStack()}}}return a},initStack:function(){if(this.map.getCenter()){this.listeners.moveend()}},deactivate:function(){var b=false;if(this.map){if(OpenLayers.Control.prototype.deactivate.apply(this)){for(var a in this.listeners){this.map.events.unregister(a,this,this.listeners[a])}if(this.clearOnDeactivate){this.clear()}b=true}}return b},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)])},CLASS_NAME:"OpenLayers.Control.PanPanel"});OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this._removeZoomBar();this.map.events.un({changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){if(this.div!=null){this.removeButtons();this._removeZoomBar()}this.draw()},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position.clone();this.buttons=[];var d=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+d.w/2,b.y);var c=d.w;if(this.zoomWorldIcon){a=new OpenLayers.Pixel(b.x+d.w,b.y)}this._addButton("panup","north-mini.png",a,d);b.y=a.y+d.h;this._addButton("panleft","west-mini.png",b,d);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",b.add(d.w,0),d);c*=2}this._addButton("panright","east-mini.png",b.add(c,0),d);this._addButton("pandown","south-mini.png",a.add(0,d.h*2),d);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,d.h*3+5),d);a=this._addZoomBar(a.add(0,d.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",a,d);return this.div},_addZoomBar:function(a){var f=OpenLayers.Util.getImagesLocation();var h=this.id+"_"+this.map.id;var b=this.map.getNumZoomLevels()-1-this.map.getZoom();var c=OpenLayers.Util.createAlphaImageDiv(h,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),f+"slider.png","absolute");this.slider=c;this.sliderEvents=new OpenLayers.Events(this,c,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var d=new OpenLayers.Size();d.h=this.zoomStopHeight*this.map.getNumZoomLevels();d.w=this.zoomStopWidth;var g=null;if(OpenLayers.Util.alphaHack()){var h=this.id+"_"+this.map.id;g=OpenLayers.Util.createAlphaImageDiv(h,a,new OpenLayers.Size(d.w,this.zoomStopHeight),f+"zoombar.png","absolute",null,"crop");g.style.height=d.h+"px"}else{g=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,d,f+"zoombar.png")}this.zoombarDiv=g;this.divEvents=new OpenLayers.Events(this,g,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(g);this.startTop=parseInt(g.style.top);this.div.appendChild(c);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return a},_removeZoomBar:function(){this.sliderEvents.un({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});this.sliderEvents.destroy();this.divEvents.un({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.divEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.map.events.unregister("zoomend",this,this.moveZoomBar)},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var f=a.xy.y;var d=OpenLayers.Util.pagePosition(a.object)[1];var c=(f-d)/this.zoomStopHeight;if(!this.map.fractionalZoom){c=Math.floor(c)}var b=(this.map.getNumZoomLevels()-1)-c;b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(b);OpenLayers.Event.stop(a)},zoomBarDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(a)},zoomBarDrag:function(b){if(this.mouseDragStart!=null){var a=this.mouseDragStart.y-b.xy.y;var d=OpenLayers.Util.pagePosition(this.zoombarDiv);if((b.clientY-d[1])>0&&(b.clientY-d[1])<parseInt(this.zoombarDiv.style.height)-2){var c=parseInt(this.slider.style.top)-a;this.slider.style.top=c+"px";this.mouseDragStart=b.xy.clone()}OpenLayers.Event.stop(b)}},zoomBarUp:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}if(this.zoomStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var a=this.zoomStart.y-b.xy.y;var c=this.map.zoom;if(this.map.fractionalZoom){c+=a/this.zoomStopHeight;c=Math.min(Math.max(c,0),this.map.getNumZoomLevels()-1)}else{c+=Math.round(a/this.zoomStopHeight)}this.map.zoomTo(c);this.moveZoomBar();this.mouseDragStart=null;OpenLayers.Event.stop(b)}},moveZoomBar:function(){var a=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=a+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,base:"",displayProjection:null,initialize:function(b,c,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b);this.base=c||document.location.href},destroy:function(){if(this.element.parentNode==this.div){this.div.removeChild(this.element)}this.element=null;this.map.events.unregister("moveend",this,this.updateLink);OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(d){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var b=0,a=this.map.controls.length;b<a;b++){var c=this.map.controls[b];if(c.CLASS_NAME==this.argParserClass.CLASS_NAME){if(c.displayProjection!=this.displayProjection){this.displayProjection=c.displayProjection}break}}if(b==this.map.controls.length){this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.className=this.displayClass;this.element=document.createElement("a");this.element.innerHTML=OpenLayers.i18n("permalink");this.element.href="";this.div.appendChild(this.element)}this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this});this.updateLink();return this.div},updateLink:function(){var a=this.base;if(a.indexOf("?")!=-1){a=a.substring(0,a.indexOf("?"))}a+="?"+OpenLayers.Util.getParameterString(this.createParams());this.element.href=a},createParams:function(a,l,f){a=a||this.map.getCenter();var d=OpenLayers.Util.getParameters(this.base);if(a){d.zoom=l||this.map.getZoom();var k=a.lat;var b=a.lon;if(this.displayProjection){var c=OpenLayers.Projection.transform({x:b,y:k},this.map.getProjectionObject(),this.displayProjection);b=c.x;k=c.y}d.lat=Math.round(k*100000)/100000;d.lon=Math.round(b*100000)/100000;f=f||this.map.layers;d.layers="";for(var g=0,j=f.length;g<j;g++){var h=f[g];if(h.isBaseLayer){d.layers+=(h==this.map.baseLayer)?"B":"0"}else{d.layers+=(h.getVisibility())?"T":"F"}}}return d},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.ZoomIn(),new OpenLayers.Control.ZoomToMaxExtent(),new OpenLayers.Control.ZoomOut()])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(json,filter){try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){var object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}if(this.keepData){this.data=object}return object}}catch(e){}return null},write:function(f,c){this.pretty=!!c;var a=null;var b=typeof f;if(this.serialize[b]){try{a=this.serialize[b].apply(this,[f])}catch(d){OpenLayers.Console.error("Trouble serializing: "+d)}}return a},writeIndent:function(){var b=[];if(this.pretty){for(var a=0;a<this.level;++a){b.push(this.indent)}}return b.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{object:function(c){if(c==null){return"null"}if(c.constructor==Date){return this.serialize.date.apply(this,[c])}if(c.constructor==Array){return this.serialize.array.apply(this,[c])}var g=["{"];this.level+=1;var d,b,f;var a=false;for(d in c){if(c.hasOwnProperty(d)){b=OpenLayers.Format.JSON.prototype.write.apply(this,[d,this.pretty]);f=OpenLayers.Format.JSON.prototype.write.apply(this,[c[d],this.pretty]);if(b!=null&&f!=null){if(a){g.push(",")}g.push(this.writeNewline(),this.writeIndent(),b,":",this.writeSpace(),f);a=true}}}this.level-=1;g.push(this.writeNewline(),this.writeIndent(),"}");return g.join("")},array:function(f){var c;var d=["["];this.level+=1;for(var b=0,a=f.length;b<a;++b){c=OpenLayers.Format.JSON.prototype.write.apply(this,[f[b],this.pretty]);if(c!=null){if(b>0){d.push(",")}d.push(this.writeNewline(),this.writeIndent(),c)}}this.level-=1;d.push(this.writeNewline(),this.writeIndent(),"]");return d.join("")},string:function(b){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(/["\\\x00-\x1f]/.test(b)){return'"'+b.replace(/([\x00-\x1f\\"])/g,function(f,d){var g=a[d];if(g){return g}g=d.charCodeAt();return"\\u00"+Math.floor(g/16).toString(16)+(g%16).toString(16)})+'"'}return'"'+b+'"'},number:function(a){return isFinite(a)?String(a):"null"},"boolean":function(a){return String(a)},date:function(a){function b(c){return(c<10)?"0"+c:c}return'"'+a.getFullYear()+"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.WFST=function(b){b=OpenLayers.Util.applyDefaults(b,OpenLayers.Format.WFST.DEFAULTS);var a=OpenLayers.Format.WFST["v"+b.version.replace(/\./g,"_")];if(!a){throw"Unsupported WFST version: "+b.version}return new a(b)};OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"};OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.1",version:null,parser:null,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a]);this.options=a},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var b=this.version||c.getAttribute("version")||this.defaultVersion;if(!this.parser||this.parser.version!==b){var d=OpenLayers.Format.WMSCapabilities["v"+b.replace(/\./g,"_")];if(!d){throw"Can't find a WMS capabilities parser for version "+b}var g=new d(this.options)}var a=g.read(f);a.version=b;return a},CLASS_NAME:"OpenLayers.Format.WMSCapabilities"});OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(a){if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}OpenLayers.Format.prototype.initialize.apply(this,[a]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var b in this.namespaces){this.namespaceAlias[this.namespaces[b]]=b}},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(a,b){this.namespaces[a]=b;this.namespaceAlias[b]=a},read:function(c){var a=c.indexOf("<");if(a>0){c=c.substring(a)}var b=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var d;if(window.ActiveXObject&&!this.xmldom){d=new ActiveXObject("Microsoft.XMLDOM")}else{d=this.xmldom}d.loadXML(c);return d}),this),function(){return new DOMParser().parseFromString(c,"text/xml")},function(){var d=new XMLHttpRequest();d.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(c),false);if(d.overrideMimeType){d.overrideMimeType("text/xml")}d.send(null);return d.responseXML});if(this.keepData){this.data=b}return b},write:function(b){var c;if(this.xmldom){c=b.xml}else{var a=new XMLSerializer();if(b.nodeType==1){var d=document.implementation.createDocument("","",null);if(d.importNode){b=d.importNode(b,true)}d.appendChild(b);c=a.serializeToString(d)}else{c=a.serializeToString(b)}}return c},createElementNS:function(c,a){var b;if(this.xmldom){if(typeof c=="string"){b=this.xmldom.createNode(1,a,c)}else{b=this.xmldom.createNode(1,a,"")}}else{b=document.createElementNS(c,a)}return b},createTextNode:function(b){var a;if(this.xmldom){a=this.xmldom.createTextNode(b)}else{a=document.createTextNode(b)}return a},getElementsByTagNameNS:function(f,d,c){var a=[];if(f.getElementsByTagNameNS){a=f.getElementsByTagNameNS(d,c)}else{var b=f.getElementsByTagName("*");var k,g;for(var h=0,j=b.length;h<j;++h){k=b[h];g=(k.prefix)?(k.prefix+":"+c):c;if((c=="*")||(g==k.nodeName)){if((d=="*")||(d==k.namespaceURI)){a.push(k)}}}}return a},getAttributeNodeNS:function(c,b,a){var k=null;if(c.getAttributeNodeNS){k=c.getAttributeNodeNS(b,a)}else{var f=c.attributes;var j,d;for(var g=0,h=f.length;g<h;++g){j=f[g];if(j.namespaceURI==b){d=(j.prefix)?(j.prefix+":"+a):a;if(d==j.nodeName){k=j;break}}}}return k},getAttributeNS:function(f,d,a){var b="";if(f.getAttributeNS){b=f.getAttributeNS(d,a)||""}else{var c=this.getAttributeNodeNS(f,d,a);if(c){b=c.nodeValue}}return b},getChildValue:function(a,c){var b=c||"";if(a){for(var d=a.firstChild;d;d=d.nextSibling){switch(d.nodeType){case 3:case 4:b+=d.nodeValue}}}return b},concatChildValues:function(b,d){var c="";var f=b.firstChild;var a;while(f){a=f.nodeValue;if(a){c+=a}f=f.nextSibling}if(c==""&&d!=undefined){c=d}return c},isSimpleContent:function(a){var c=true;for(var b=a.firstChild;b;b=b.nextSibling){if(b.nodeType===1){c=false;break}}return c},contentType:function(c){var f=false,b=false;var a=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var d=c.firstChild;d;d=d.nextSibling){switch(d.nodeType){case 1:b=true;break;case 8:break;default:f=true}if(b&&f){break}}if(b&&f){a=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(b){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(f){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return a},hasAttributeNS:function(c,b,a){var d=false;if(c.hasAttributeNS){d=c.hasAttributeNS(b,a)}else{d=!!this.getAttributeNodeNS(c,b,a)}return d},setAttributeNS:function(d,c,a,f){if(d.setAttributeNS){d.setAttributeNS(c,a,f)}else{if(this.xmldom){if(c){var b=d.ownerDocument.createNode(2,a,c);b.nodeValue=f;d.setAttributeNode(b)}else{d.setAttribute(a,f)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(b,a){a=a||{};var d=a.uri||this.namespaces[a.prefix];if(!d){var g=b.indexOf(":");d=this.namespaces[b.substring(0,g)]}if(!d){d=this.namespaces[this.defaultPrefix]}var c=this.createElementNS(d,b);if(a.attributes){this.setAttributes(c,a.attributes)}var f=a.value;if(f!=null){if(typeof f=="boolean"){f=String(f)}c.appendChild(this.createTextNode(f))}return c},setAttributes:function(c,f){var d,b;for(var a in f){if(f[a]!=null&&f[a].toString){d=f[a].toString();b=this.namespaces[a.substring(0,a.indexOf(":"))]||null;this.setAttributeNS(c,b,a,d)}}},readNode:function(c,f){if(!f){f={}}var d=this.readers[this.namespaceAlias[c.namespaceURI]];if(d){var b=c.localName||c.nodeName.split(":").pop();var a=d[b]||d["*"];if(a){a.apply(this,[c,f])}}return f},readChildNodes:function(d,f){if(!f){f={}}var c=d.childNodes;var g;for(var b=0,a=c.length;b<a;++b){g=c[b];if(g.nodeType==1){this.readNode(g,f)}}return f},writeNode:function(a,g,d){var f,c;var b=a.indexOf(":");if(b>0){f=a.substring(0,b);c=a.substring(b+1)}else{if(d){f=this.namespaceAlias[d.namespaceURI]}else{f=this.defaultPrefix}c=a}var h=this.writers[f][c].apply(this,[g]);if(d){d.appendChild(h)}return h},getChildEl:function(c,a,b){return c&&this.getThisOrNextEl(c.firstChild,a,b)},getNextEl:function(c,a,b){return c&&this.getThisOrNextEl(c.nextSibling,a,b)},getThisOrNextEl:function(d,a,c){outer:for(var b=d;b;b=b.nextSibling){switch(b.nodeType){case 1:if((!a||a===(b.localName||b.nodeName.split(":").pop()))&&(!c||c===b.namespaceURI)){break outer}b=null;break outer;case 3:if(/^\s*$/.test(b.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:b=null;break outer}}return b||null},lookupNamespaceURI:function(f,g){var d=null;if(f){if(f.lookupNamespaceURI){d=f.lookupNamespaceURI(g)}else{outer:switch(f.nodeType){case 1:if(f.namespaceURI!==null&&f.prefix===g){d=f.namespaceURI;break outer}var b=f.attributes.length;if(b){var a;for(var c=0;c<b;++c){a=f.attributes[c];if(a.prefix==="xmlns"&&a.name==="xmlns:"+g){d=a.value||null;break outer}else{if(a.name==="xmlns"&&g===null){d=a.value||null;break outer}}}}d=this.lookupNamespaceURI(f.parentNode,g);break outer;case 2:d=this.lookupNamespaceURI(f.ownerElement,g);break outer;case 9:d=this.lookupNamespaceURI(f.documentElement,g);break outer;case 6:case 12:case 10:case 11:break outer;default:d=this.lookupNamespaceURI(f.parentNode,g);break outer}}}return d},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3};OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(c,b,a){OpenLayers.Util.extend(this,a);this.control=c;this.callbacks=b;if(c.map){this.setMap(c.map)}OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){if(this.keyMask==null){return true}var b=(a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT:0);return(b==this.keyMask)},activate:function(){if(this.active){return false}var c=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=c.length;b<a;b++){if(this[c[b]]){this.register(c[b],this[c[b]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var c=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=c.length;b<a;b++){if(this[c[b]]){this.unregister(c[b],this[c[b]])}}this.active=false;return true},callback:function(b,a){if(b&&this.callbacks[b]){this.callbacks[b].apply(this.control,a)}},register:function(a,b){this.map.events.registerPriority(a,this,b);this.map.events.registerPriority(a,this,this.setEvent)},unregister:function(a,b){this.map.events.unregister(a,this,b);this.map.events.unregister(a,this,this.setEvent)},setEvent:function(a){this.evt=a;return true},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,allOverlays:false,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,initialize:function(j,d){if(arguments.length===1&&typeof j==="object"){d=j;j=d&&d.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,d);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(j);if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}OpenLayers.Element.addClass(this.div,"olMap");var h=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(h,null,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPortDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendChild(this.viewPortDiv);h=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(h);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough,{includeXY:true});this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var g=true;var c=document.getElementsByTagName("link");for(var f=0,a=c.length;f<a;++f){if(OpenLayers.Util.isEquivalentUrl(c.item(f).href,this.theme)){g=false;break}}if(g){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(b)}}this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var f=0,a=this.controls.length;f<a;f++){this.addControlToMap(this.controls[f])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy)},render:function(a){this.div=OpenLayers.Util.getElement(a);OpenLayers.Element.addClass(this.div,"olMap");this.events.attachToElement(this.div);this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)}else{this.events.unregister("resize",this,this.updateSize)}this.paddingForPopups=null;if(this.controls!=null){for(var a=this.controls.length-1;a>=0;--a){this.controls[a].destroy()}this.controls=null}if(this.layers!=null){for(var a=this.layers.length-1;a>=0;--a){this.layers[a].destroy(false)}this.layers=null}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)}this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null}this.events.destroy();this.events=null},setOptions:function(a){OpenLayers.Util.extend(this,a)},getTileSize:function(){return this.tileSize},getBy:function(f,c,a){var d=(typeof a.test=="function");var b=OpenLayers.Array.filter(this[f],function(g){return g[c]==a||(d&&a.test(g[c]))});return b},getLayersBy:function(b,a){return this.getBy("layers",b,a)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(b,a){return this.getBy("controls",b,a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},getLayer:function(f){var b=null;for(var d=0,a=this.layers.length;d<a;d++){var c=this.layers[d];if(c.id==f){b=c;break}}return b},setLayerZIndex:function(b,a){b.setZIndex(this.Z_INDEX_BASE[b.isBaseLayer?"BaseLayer":"Overlay"]+a*5)},resetLayersZIndex:function(){for(var c=0,a=this.layers.length;c<a;c++){var b=this.layers[c];this.setLayerZIndex(b,c)}},addLayer:function(c){for(var b=0,a=this.layers.length;b<a;b++){if(this.layers[b]==c){var d=OpenLayers.i18n("layerAlreadyAdded",{layerName:c.name});OpenLayers.Console.warn(d);return false}}if(this.allOverlays){c.isBaseLayer=false}this.events.triggerEvent("preaddlayer",{layer:c});c.div.className="olLayerDiv";c.div.style.overflow="";this.setLayerZIndex(c,this.layers.length);if(c.isFixed){this.viewPortDiv.appendChild(c.div)}else{this.layerContainerDiv.appendChild(c.div)}this.layers.push(c);c.setMap(this);if(c.isBaseLayer||(this.allOverlays&&!this.baseLayer)){if(this.baseLayer==null){this.setBaseLayer(c)}else{c.setVisibility(false)}}else{c.redraw()}this.events.triggerEvent("addlayer",{layer:c});c.afterAdd()},addLayers:function(c){for(var b=0,a=c.length;b<a;b++){this.addLayer(c[b])}},removeLayer:function(c,f){if(f==null){f=true}if(c.isFixed){this.viewPortDiv.removeChild(c.div)}else{this.layerContainerDiv.removeChild(c.div)}OpenLayers.Util.removeItem(this.layers,c);c.removeMap(this);c.map=null;if(this.baseLayer==c){this.baseLayer=null;if(f){for(var b=0,a=this.layers.length;b<a;b++){var d=this.layers[b];if(d.isBaseLayer||this.allOverlays){this.setBaseLayer(d);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:c})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(d,b){var f=this.getLayerIndex(d);if(b<0){b=0}else{if(b>this.layers.length){b=this.layers.length}}if(f!=b){this.layers.splice(f,1);this.layers.splice(b,0,d);for(var c=0,a=this.layers.length;c<a;c++){this.setLayerZIndex(this.layers[c],c)}this.events.triggerEvent("changelayer",{layer:d,property:"order"});if(this.allOverlays){if(b===0){this.setBaseLayer(d)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(b,c){var a=this.getLayerIndex(b)+c;this.setLayerIndex(b,a)},setBaseLayer:function(f){var d=null;if(this.baseLayer){d=this.baseLayer.getExtent()}if(f!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,f)!=-1){if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=f;this.viewRequestID++;if(!this.allOverlays){this.baseLayer.visibility=true}var a=this.getCenter();if(a!=null){var b=(d)?d.getCenterLonLat():a;var c=(d)?this.getZoomForExtent(d,true):this.getZoomForResolution(this.resolution,true);this.setCenter(b,c,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(b,a){this.controls.push(b);this.addControlToMap(b,a)},addControlToMap:function(b,a){b.outsideViewport=(b.div!=null);if(this.displayProjection&&!b.displayProjection){b.displayProjection=this.displayProjection}b.setMap(this);var c=b.draw(a);if(c){if(!b.outsideViewport){c.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(c)}}},getControl:function(f){var b=null;for(var c=0,a=this.controls.length;c<a;c++){var d=this.controls[c];if(d.id==f){b=d;break}}return b},removeControl:function(a){if((a)&&(a==this.getControl(a.id))){if(a.div&&(a.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.controls,a)}},addPopup:function(a,d){if(d){for(var b=this.popups.length-1;b>=0;--b){this.removePopup(this.popups[b])}}a.map=this;this.popups.push(a);var c=a.draw();if(c){c.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(c)}},removePopup:function(a){OpenLayers.Util.removeItem(this.popups,a);if(a.div){try{this.layerContainerDiv.removeChild(a.div)}catch(b){}}a.map=null},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},updateSize:function(){this.events.clearMouseCache();var c=this.getCurrentSize();var g=this.getSize();if(g==null){this.size=g=c}if(!c.equals(g)){this.size=c;for(var d=0,b=this.layers.length;d<b;d++){this.layers[d].onMapResize()}if(this.baseLayer!=null){var a=new OpenLayers.Pixel(c.w/2,c.h/2);var h=this.getLonLatFromViewPortPx(a);var f=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),f)}}},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){var b=OpenLayers.Element.getDimensions(this.div);a.w=b.width;a.h=b.height}if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=parseInt(this.div.style.width);a.h=parseInt(this.div.style.height)}return a},calculateBounds:function(a,b){var f=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if((a!=null)&&(b!=null)){var d=this.getSize();var g=d.w*b;var c=d.h*b;f=new OpenLayers.Bounds(a.lon-g/2,a.lat-c/2,a.lon+g/2,a.lat+c/2)}return f},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},getZoom:function(){return this.zoom},pan:function(d,c,f){f=OpenLayers.Util.applyDefaults(f,{animate:true,dragging:false});var g=this.getViewPortPxFromLonLat(this.getCenter());var b=g.add(d,c);if(!f.dragging||!b.equals(g)){var a=this.getLonLatFromViewPortPx(b);if(f.animate){this.panTo(a)}else{this.setCenter(a,null,f.dragging)}}},panTo:function(b){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(b)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var a=this.getCenter();if(b.lon==a.lon&&b.lat==a.lat){return}var d={lon:a.lon,lat:a.lat};var c={lon:b.lon,lat:b.lat};this.panTween.start(d,c,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(f){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(f){f=new OpenLayers.LonLat(f.lon,f.lat);this.moveTo(f,this.zoom,{dragging:true,noEvent:true})},this),done:OpenLayers.Function.bind(function(f){f=new OpenLayers.LonLat(f.lon,f.lat);this.moveTo(f,this.zoom,{noEvent:true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(b)}},setCenter:function(c,a,b,d){this.moveTo(c,a,{dragging:b,forceZoomChange:d,caller:"setCenter"})},moveTo:function(h,q,t){if(!t){t={}}var o=t.dragging;var c=t.forceZoomChange;var j=t.noEvent;if(this.panTween&&t.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(h)){h=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(h==null){h=this.getCenter()}if(q==null){q=this.getZoom()}var d=this.getResolutionForZoom(q);var r=this.calculateBounds(h,d);if(!this.restrictedExtent.containsBounds(r)){var s=this.restrictedExtent.getCenterLonLat();if(r.getWidth()>this.restrictedExtent.getWidth()){h=new OpenLayers.LonLat(s.lon,h.lat)}else{if(r.left<this.restrictedExtent.left){h=h.add(this.restrictedExtent.left-r.left,0)}else{if(r.right>this.restrictedExtent.right){h=h.add(this.restrictedExtent.right-r.right,0)}}}if(r.getHeight()>this.restrictedExtent.getHeight()){h=new OpenLayers.LonLat(h.lon,s.lat)}else{if(r.bottom<this.restrictedExtent.bottom){h=h.add(0,this.restrictedExtent.bottom-r.bottom)}else{if(r.top>this.restrictedExtent.top){h=h.add(0,this.restrictedExtent.top-r.top)}}}}}var b=c||((this.isValidZoomLevel(q))&&(q!=this.getZoom()));var f=(this.isValidLonLat(h))&&(!h.equals(this.center));if(b||f||!o){if(!this.dragging&&!j){this.events.triggerEvent("movestart")}if(f){if((!b)&&(this.center)){this.centerLayerContainer(h)}this.center=h.clone()}if((b)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(b){this.zoom=q;this.resolution=this.getResolutionForZoom(q);this.viewRequestID++}var a=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(a,b,o);if(o){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:b})}}a=this.baseLayer.getExtent();for(var g=0,l=this.layers.length;g<l;g++){var k=this.layers[g];if(k!==this.baseLayer&&!k.isBaseLayer){var m=k.calculateInRange();if(k.inRange!=m){k.inRange=m;if(!m){k.display(false)}this.events.triggerEvent("changelayer",{layer:k,property:"visibility"})}if(m&&k.visibility){k.moveTo(a,b,o);if(o){k.events.triggerEvent("move")}else{k.events.triggerEvent("moveend",{zoomChanged:b})}}}}if(b){for(var g=0,l=this.popups.length;g<l;g++){this.popups[g].updatePosition()}}this.events.triggerEvent("move");if(b){this.events.triggerEvent("zoomend")}}if(!o&&!j){this.events.triggerEvent("moveend")}this.dragging=!!o},centerLayerContainer:function(b){var a=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var c=this.getViewPortPxFromLonLat(b);if((a!=null)&&(c!=null)){this.layerContainerDiv.style.left=Math.round(a.x-c.x)+"px";this.layerContainerDiv.style.top=Math.round(a.y-c.y)+"px"}},isValidZoomLevel:function(a){return((a!=null)&&(a>=0)&&(a<this.getNumZoomLevels()))},isValidLonLat:function(c){var b=false;if(c!=null){var a=this.getMaxExtent();b=a.containsLonLat(c)}return b},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode():null},getProjectionObject:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.projection}return a},getMaxResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.maxResolution}return a},getMaxExtent:function(b){var a=null;if(b&&b.restricted&&this.restrictedExtent){a=this.restrictedExtent}else{if(this.baseLayer!=null){a=this.baseLayer.maxExtent}}return a},getNumZoomLevels:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.numZoomLevels}return a},getExtent:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getExtent()}return a},getResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getResolution()}return a},getUnits:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.units}return a},getScale:function(){var c=null;if(this.baseLayer!=null){var b=this.getResolution();var a=this.baseLayer.units;c=OpenLayers.Util.getScaleFromResolution(b,a)}return c},getZoomForExtent:function(c,b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getZoomForExtent(c,b)}return a},getResolutionForZoom:function(b){var a=null;if(this.baseLayer){a=this.baseLayer.getResolutionForZoom(b)}return a},getZoomForResolution:function(a,c){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getZoomForResolution(a,c)}return b},zoomTo:function(a){if(this.isValidZoomLevel(a)){this.setCenter(null,a)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(d,c){var b=d.getCenterLonLat();if(this.baseLayer.wrapDateLine){var a=this.getMaxExtent();d=d.clone();while(d.right<d.left){d.right+=a.getWidth()}b=d.getCenterLonLat().wrapDateLine(a)}this.setCenter(b,this.getZoomForExtent(d,c))},zoomToMaxExtent:function(c){var b=(c)?c.restricted:true;var a=this.getMaxExtent({restricted:b});this.zoomToExtent(a)},zoomToScale:function(j,h){var d=OpenLayers.Util.getResolutionFromScale(j,this.baseLayer.units);var c=this.getSize();var g=c.w*d;var b=c.h*d;var a=this.getCenter();var f=new OpenLayers.Bounds(a.lon-g/2,a.lat-b/2,a.lon+g/2,a.lat+b/2);this.zoomToExtent(f,h)},getLonLatFromViewPortPx:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getLonLatFromViewPortPx(a)}return b},getViewPortPxFromLonLat:function(b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getViewPortPxFromLonLat(b)}return a},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(b){var a=this.getViewPortPxFromLonLat(b);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getViewPortPxFromLayerPx:function(d){var c=null;if(d!=null){var b=parseInt(this.layerContainerDiv.style.left);var a=parseInt(this.layerContainerDiv.style.top);c=d.add(b,a)}return c},getLayerPxFromViewPortPx:function(c){var d=null;if(c!=null){var b=-parseInt(this.layerContainerDiv.style.left);var a=-parseInt(this.layerContainerDiv.style.top);d=c.add(b,a);if(isNaN(d.x)||isNaN(d.y)){d=null}}return d},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(b){var a=this.getPixelFromLonLat(b);return this.getLayerPxFromViewPortPx(a)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(c,b){this.lonlat=c;var a=(b)?b:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=a}else{this.icon.url=a.url;this.icon.size=a.size;this.icon.offset=a.offset;this.icon.calculateOffset=a.calculateOffset}this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null}},draw:function(a){return this.icon.draw(a)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(a){if((a!=null)&&(this.icon!=null)){this.icon.moveTo(a)}this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){var a=(this.icon&&this.icon.isDrawn());return a},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},inflate:function(b){if(this.icon){var a=new OpenLayers.Size(this.icon.size.w*b,this.icon.size.h*b);this.icon.setSize(a)}},setOpacity:function(a){this.icon.setOpacity(a)},setUrl:function(a){this.icon.setUrl(a)},display:function(a){this.icon.display(a)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var a=OpenLayers.Util.getImagesLocation()+"marker.png";var b=new OpenLayers.Size(21,25);var c=function(d){return new OpenLayers.Pixel(-(d.w/2),-d.h)};return new OpenLayers.Icon(a,b,null,c)};OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),initialize:function(h,c,g,b,a,f,d){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative.png";OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(d){var h=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});d=OpenLayers.Util.applyDefaults(d,h);var g=new OpenLayers.Request.XMLHttpRequest();var a=d.url;if(d.params){var f=OpenLayers.Util.getParameterString(d.params);if(f.length>0){var k=(a.indexOf("?")>-1)?"&":"?";a+=k+f}}if(d.proxy&&(a.indexOf("http")==0)){a=d.proxy+encodeURIComponent(a)}g.open(d.method,a,d.async,d.user,d.password);for(var j in d.headers){g.setRequestHeader(j,d.headers[j])}var b=(d.scope)?OpenLayers.Function.bind(d.callback,d.scope):d.callback;var l;if(d.success){l=(d.scope)?OpenLayers.Function.bind(d.success,d.scope):d.success}var c;if(d.failure){c=(d.scope)?OpenLayers.Function.bind(d.failure,d.scope):d.failure}var m=this.events;g.onreadystatechange=function(){if(g.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var o=m.triggerEvent("complete",{request:g,config:d,requestUrl:a});if(o!==false){b(g);if(!g.status||(g.status>=200&&g.status<300)){m.triggerEvent("success",{request:g,config:d,requestUrl:a});if(l){l(g)}}if(g.status&&(g.status<200||g.status>=300)){m.triggerEvent("failure",{request:g,config:d,requestUrl:a});if(c){c(g)}}}}};if(d.async===false){g.send(d.data)}else{window.setTimeout(function(){g.send(d.data)},0)}return g},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},PUT:function(a){a=OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}};OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(d,a,f,b,c){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id)}OpenLayers.Event.stopObservingElement(this.imgDiv.id);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null;this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)}this.frame=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null}this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}a=OpenLayers.Tile.prototype.clone.apply(this,[a]);a.imgDiv=null;return a},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(a){if(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();this.backBufferTile.isBackBuffer=true;this.events.register("loadend",this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer)}this.startTransition()}else{if(this.backBufferTile){this.backBufferTile.clear()}}}else{if(a&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!a){return false}if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}return this.renderTile()},resetBackBuffer:function(){this.showTile();if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=false;var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));if(b){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.imageSize||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBufferTile.resolution=this.layer.getResolution();this.backBufferTile.renderTile()}this.backBufferTile.hide()}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.async){this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);this.positionImage()}return true},positionImage:function(){if(this.layer==null){return}OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var a=this.layer.getImageSize();if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,a,this.url)}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,a);this.imgDiv.src=this.url}},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image.useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}}},initImgDiv:function(){var d=this.layer.imageOffset;var b=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,d,b,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,d,b,null,"relative",null,null,true)}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var c=function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("loadend")}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(c,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(c,this))}var a=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){c.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(a,this))},checkImgURL:function(){if(this.layer){var a=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(a,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}var d=1;if(this.backBufferTile.resolution){d=this.backBufferTile.resolution/this.layer.getResolution()}if(d!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var c=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var b=new OpenLayers.Size(this.backBufferTile.size.w*d,this.backBufferTile.size.h*d);var a=this.layer.map.getLayerPxFromLonLat(c);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);var f=this.backBufferTile.imageSize;f=new OpenLayers.Size(f.w*d,f.h*d);var g=this.backBufferTile.imageOffset;if(g){g=new OpenLayers.Pixel(g.x*d,g.y*d)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,g,f);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=d},show:function(){this.frame.style.display="";if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scrollLeft}}},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:false,handlers:null,resolutionFactor:1,initialize:function(a){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[a])},destroy:function(){if(!this.mapDiv){return}this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.extentRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy();this.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeChild(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null}if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null}this.map.events.un({moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var d=this.map.baseLayer.clone();this.layers=[d]}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div}}this.element=document.createElement("div");this.element.className=this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var f=OpenLayers.Util.getImagesLocation();var b=f+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),b,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var b=f+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),b,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var g=["dblclick","mousedown"];for(var c=0,a=g.length;c<a;c++){OpenLayers.Event.observe(this.maximizeDiv,g[c],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,g[c],OpenLayers.Event.stop)}this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.register("moveend",this,this.update);return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(k){var d=this.handlers.drag.last.x-k.x;var b=this.handlers.drag.last.y-k.y;if(d!=0||b!=0){var h=this.rectPxBounds.top;var a=this.rectPxBounds.left;var f=Math.abs(this.rectPxBounds.getHeight());var c=this.rectPxBounds.getWidth();var g=Math.max(0,(h-b));g=Math.min(g,this.ovmap.size.h-this.hComp-f);var j=Math.max(0,(a-d));j=Math.min(j,this.ovmap.size.w-this.wComp-c);this.setRectPxBounds(new OpenLayers.Bounds(j,g+f,j+c,g))}},mapDivClick:function(k){var b=this.rectPxBounds.getCenterPixel();var f=k.xy.x-b.x;var d=k.xy.y-b.y;var h=this.rectPxBounds.top;var c=this.rectPxBounds.left;var l=Math.abs(this.rectPxBounds.getHeight());var a=this.rectPxBounds.getWidth();var g=Math.max(0,(h+d));g=Math.min(g,this.ovmap.size.h-l);var j=Math.max(0,(c+f));j=Math.min(j,this.ovmap.size.w-a);this.setRectPxBounds(new OpenLayers.Bounds(j,g+l,j+a,g));this.updateMapToRect()},maximizeControl:function(a){this.element.style.display="";this.showToggle(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.element.style.display="none";this.showToggle(true);if(a!=null){OpenLayers.Event.stop(a)}},showToggle:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var b=this.map.getExtent();var a=this.map.maxExtent;var c=new OpenLayers.Bounds(Math.max(b.left,a.left),Math.max(b.bottom,a.bottom),Math.min(b.right,a.right),Math.min(b.top,a.top));if(this.ovmap.getProjection()!=this.map.getProjection()){c=c.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var d=this.ovmap.getResolution()/this.map.getResolution();return((d>this.minRatio)&&(d<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(c)))},updateOverview:function(){var c=this.map.getResolution();var b=this.ovmap.getResolution();var d=b/c;if(d>this.maxRatio){b=this.minRatio*c}else{if(d<=this.minRatio){b=this.maxRatio*c}}var a;if(this.ovmap.getProjection()!=this.map.getProjection()){a=this.map.center.clone();a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{a=this.map.center}this.ovmap.setCenter(a,this.ovmap.getZoomForResolution(b*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var b=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,b);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:true,"double":false,stopSingle:true,stopDouble:true,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(d){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(d){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var c=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var a=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=c&&a?OpenLayers.INCHES_PER_UNIT[c]/OpenLayers.INCHES_PER_UNIT[a]:1}},updateRectToMap:function(){var b;if(this.ovmap.getProjection()!=this.map.getProjection()){b=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{b=this.map.getExtent()}var a=this.getRectBoundsFromMapBounds(b);if(a){this.setRectPxBounds(a)}},updateMapToRect:function(){var a=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){a=a.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(a.getCenterLonLat())},setRectPxBounds:function(d){var h=Math.max(d.top,0);var f=Math.max(d.left,0);var b=Math.min(d.top+Math.abs(d.getHeight()),this.ovmap.size.h-this.hComp);var j=Math.min(d.left+d.getWidth(),this.ovmap.size.w-this.wComp);var c=Math.max(j-f,0);var k=Math.max(b-h,0);if(c<this.minRectSize||k<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var g=f+(c/2)-(this.minRectSize/2);var a=h+(k/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(a)+"px";this.extentRectangle.style.left=Math.round(g)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(h)+"px";this.extentRectangle.style.left=Math.round(f)+"px";this.extentRectangle.style.height=Math.round(k)+"px";this.extentRectangle.style.width=Math.round(c)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(f),Math.round(b),Math.round(j),Math.round(h))},getRectBoundsFromMapBounds:function(d){var a=new OpenLayers.LonLat(d.left,d.bottom);var g=new OpenLayers.LonLat(d.right,d.top);var c=this.getOverviewPxFromLonLat(a);var b=this.getOverviewPxFromLonLat(g);var f=null;if(c&&b){f=new OpenLayers.Bounds(c.x,c.y,b.x,b.y)}return f},getMapBoundsFromRectBounds:function(d){var c=new OpenLayers.Pixel(d.left,d.bottom);var b=new OpenLayers.Pixel(d.right,d.top);var a=this.getLonLatFromOverviewPx(c);var f=this.getLonLatFromOverviewPx(b);return new OpenLayers.Bounds(a.lon,a.lat,f.lon,f.lat)},getLonLatFromOverviewPx:function(g){var c=this.ovmap.size;var b=this.ovmap.getResolution();var a=this.ovmap.getExtent().getCenterLonLat();var f=g.x-(c.w/2);var d=g.y-(c.h/2);return new OpenLayers.LonLat(a.lon+f*b,a.lat-d*b)},getOverviewPxFromLonLat:function(d){var b=this.ovmap.getResolution();var c=this.ovmap.getExtent();var a=null;if(c){a=new OpenLayers.Pixel(Math.round(1/b*(d.lon-c.left)),Math.round(1/b*(c.top-d.lat)))}return a},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(a,c,b){this.layer=a;this.lonlat=c;this.data=(b!=null)?b:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)}}this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null}if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null}},onScreen:function(){var b=false;if((this.layer!=null)&&(this.layer.map!=null)){var a=this.layer.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)}return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(b){if(this.lonlat!=null){var c=this.id+"_popup";var a=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(c,this.lonlat,this.data.popupSize,this.data.popupContentHTML,a,b)}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow}this.popup.feature=this}return this.popup},destroyPopup:function(){if(this.popup){this.popup.feature=null;this.popup.destroy();this.popup=null}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.0",version:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var b=this.version;if(!b){b=c.getAttribute("version");if(!b){b=this.defaultVersion}}var d=OpenLayers.Format.WFSCapabilities["v"+b.replace(/\./g,"_")];if(!d){throw"Can't find a WFS capabilities parser for version "+b}var g=new d(this.options);var a=g.read(f);a.version=b;return a},CLASS_NAME:"OpenLayers.Format.WFSCapabilities"});OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},readers:{xsd:{schema:function(d,k){var f=[];var b={};var g={complexTypes:f,customTypes:b};this.readChildNodes(d,g);var h=d.attributes;var m,a;for(var j=0,l=h.length;j<l;++j){m=h[j];a=m.name;if(a.indexOf("xmlns")==0){this.setNamespace(a.split(":")[1]||"",m.value)}else{k[a]=m.value}}k.featureTypes=f;k.targetPrefix=this.namespaceAlias[k.targetNamespace];var o,c;for(var j=0,l=f.length;j<l;++j){o=f[j];c=b[o.typeName];if(b[o.typeName]){o.typeName=c.name}}},complexType:function(b,c){var a={typeName:b.getAttribute("name")};this.readChildNodes(b,a);c.complexTypes.push(a)},complexContent:function(a,b){this.readChildNodes(a,b)},extension:function(a,b){this.readChildNodes(a,b)},sequence:function(a,b){var c={elements:[]};this.readChildNodes(a,c);b.properties=c.elements},element:function(a,c){if(c.elements){var d={};var b=a.attributes;var h;for(var f=0,g=b.length;f<g;++f){h=b[f];d[h.name]=h.value}var j=d.type;if(!j){j={};this.readChildNodes(a,j);d.restriction=j;d.type=j.base}var l=j.base||j;d.localType=l.split(":").pop();c.elements.push(d)}if(c.complexTypes){var j=a.getAttribute("type");var k=j.split(":").pop();c.customTypes[k]={name:a.getAttribute("name"),type:j}}},simpleType:function(a,b){this.readChildNodes(a,b)},restriction:function(a,b){b.base=a.getAttribute("base");this.readRestriction(a,b)}}},readRestriction:function(d,g){var c=d.childNodes;var j,h,f;for(var b=0,a=c.length;b<a;++b){j=c[b];if(j.nodeType==1){h=j.nodeName.split(":").pop();f=j.getAttribute("value");if(!g[h]){g[h]=f}else{if(typeof g[h]=="string"){g[h]=[g[h]]}g[h].push(f)}}}},read:function(b){if(typeof b=="string"){b=OpenLayers.Format.XML.prototype.read.apply(this,[b])}if(b&&b.nodeType==9){b=b.documentElement}var a={};this.readNode(b,a);return a},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});OpenLayers.Format.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs",gml:"http://www.opengis.net/gml",ogc:"http://www.opengis.net/ogc"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:true,xy:true,stateName:null,initialize:function(a){this.stateName={};this.stateName[OpenLayers.State.INSERT]="wfs:Insert";this.stateName[OpenLayers.State.UPDATE]="wfs:Update";this.stateName[OpenLayers.State.DELETE]="wfs:Delete";OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},getSrsName:function(c,b){var a=b&&b.srsName;if(!a){if(c&&c.layer){a=c.layer.projection.getCode()}else{a=this.srsName}}return a},read:function(a){if(typeof a=="string"){a=OpenLayers.Format.XML.prototype.read.apply(this,[a])}if(a&&a.nodeType==9){a=a.documentElement}var b={};this.readNode(a,b);if(b.features){b=b.features}return b},readers:{wfs:{FeatureCollection:function(a,b){b.features=[];this.readChildNodes(a,b)}}},write:function(a){var b=this.writeNode("wfs:Transaction",a);var c=this.schemaLocationAttr();if(c){this.setAttributeNS(b,this.namespaces.xsi,"xsi:schemaLocation",c)}return OpenLayers.Format.XML.prototype.write.apply(this,[b])},writers:{wfs:{GetFeature:function(a){var b=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,maxFeatures:a&&a.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(a)}});this.writeNode("Query",a,b);return b},Query:function(a){a=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},a);var b=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(a.featureNS?a.featurePrefix+":":"")+a.featureType,srsName:a.srsName}});if(a.featureNS){b.setAttribute("xmlns:"+a.featurePrefix,a.featureNS)}if(a.filter){this.setFilterProperty(a.filter);this.writeNode("ogc:Filter",a.filter,b)}return b},Transaction:function(f){var g=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});if(f){var b,d;for(var c=0,a=f.length;c<a;++c){d=f[c];b=this.stateName[d.state];if(b){this.writeNode(b,d,g)}}}return g},Insert:function(a){var b=this.createElementNSPlus("wfs:Insert");this.srsName=this.getSrsName(a);this.writeNode("feature:_typeName",a,b);return b},Update:function(b){var c=this.createElementNSPlus("wfs:Update",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){c.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("Property",{name:this.geometryName,value:b},c);for(var a in b.attributes){this.writeNode("Property",{name:a,value:b.attributes[a]},c)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[b.fid]}),c);return c},Property:function(b){var a=this.createElementNSPlus("wfs:Property");this.writeNode("Name",b.name,a);this.writeNode("Value",b.value,a);return a},Name:function(a){return this.createElementNSPlus("wfs:Name",{value:a})},Value:function(c){var b;if(c instanceof OpenLayers.Feature.Vector){b=this.createElementNSPlus("wfs:Value");this.srsName=this.getSrsName(c);var a=this.writeNode("feature:_geometry",c.geometry).firstChild;b.appendChild(a)}else{b=this.createElementNSPlus("wfs:Value",{value:c})}return b},Delete:function(a){var b=this.createElementNSPlus("wfs:Delete",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){b.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[a.fid]}),b);return b}}},schemaLocationAttr:function(a){a=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},a);var g=OpenLayers.Util.extend({},this.schemaLocations);if(a.schema){g[a.featurePrefix]=a.schema}var f=[];var c;for(var b in g){c=this.namespaces[b];if(c){f.push(c+" "+g[b])}}var d=f.join(" ")||undefined;return d},setFilterProperty:function(c){if(c.filters){for(var b=0,a=c.filters.length;b<a;++b){this.setFilterProperty(c.filters[b])}}else{if(c instanceof OpenLayers.Filter.Spatial){c.property=this.geometryName}}},CLASS_NAME:"OpenLayers.Format.WFST.v1"});OpenLayers.Format.WMC=OpenLayers.Class({defaultVersion:"1.1.0",version:null,layerOptions:null,layerParams:null,parser:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},read:function(f,c){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var b=f.documentElement;var a=this.version;if(!a){a=b.getAttribute("version");if(!a){a=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=a){var h=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!h){throw"Can't find a WMC parser for version "+a}this.parser=new h(this.options)}var d=this.parser.read(f,c);var g;if(c.map){this.context=d;if(c.map instanceof OpenLayers.Map){g=this.mergeContextToMap(d,c.map)}else{g=this.contextToMap(d,c.map)}}else{g=d}return g},contextToMap:function(a,c){var b=new OpenLayers.Map(c,{maxExtent:a.maxExtent,projection:a.projection});b.addLayers(a.layers);b.setCenter(a.bounds.getCenterLonLat(),b.getZoomForExtent(a.bounds,true));return b},mergeContextToMap:function(a,b){b.addLayers(a.layers);return b},write:function(f,b){if(f.CLASS_NAME=="OpenLayers.Map"){f=this.mapToContext(f)}var a=(b&&b.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=a){var d=OpenLayers.Format.WMC["v"+a.replace(/\./g,"_")];if(!d){throw"Can't find a WMS capabilities parser for version "+a}this.parser=new d(this.options)}var c=this.parser.write(f,b);return c},mapToContext:function(b){var a={bounds:b.getExtent(),maxExtent:b.maxExtent,projection:b.projection,layers:b.layers,size:b.getSize()};return a},CLASS_NAME:"OpenLayers.Format.WMC"});OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a={};var b=c.documentElement;this.runChildNodes(a,b);return a},runChildNodes:function(g,f){var c=f.childNodes;var b,d;for(var a=0;a<c.length;++a){b=c[a];if(b.nodeType==1){d=this["read_cap_"+b.nodeName];if(d){d.apply(this,[g,b])}}}},read_cap_Capability:function(a,c){var b={layers:[]};this.runChildNodes(b,c);a.capability=b},read_cap_Request:function(c,b){var a={};this.runChildNodes(a,b);c.request=a},read_cap_GetMap:function(c,b){var a={formats:[]};this.runChildNodes(a,b);c.getmap=a},read_cap_Format:function(b,a){if(b.formats){b.formats.push(this.getChildValue(a))}},read_cap_DCPType:function(c,b){var a=b.getElementsByTagName("OnlineResource");if(a.length>0){this.read_cap_OnlineResource(c,a[0])}},read_cap_Service:function(b,c){var a={};this.runChildNodes(a,c);b.service=a},read_cap_Layer:function(b,f,g){var j={formats:b.request.getmap.formats||[],styles:[],queryable:(f.getAttribute("queryable")==="1"||f.getAttribute("queryable")==="true")};if(g){j.styles=j.styles.concat(g.styles);j.llbbox=g.llbbox;j.minScale=g.minScale;j.maxScale=g.maxScale}var c=f.childNodes;var a,l,d;for(var h=0;h<c.length;++h){a=c[h];l=a.nodeName;d=this["read_cap_"+a.nodeName];if(d){if(l=="Layer"){d.apply(this,[b,a,j])}else{d.apply(this,[j,a])}}}if(j.name){var k=j.name.indexOf(":");if(k>0){j.prefix=j.name.substring(0,k)}b.layers.push(j)}},read_cap_ScaleHint:function(f,g){var d=g.getAttribute("min");var a=g.getAttribute("max");var c=Math.pow(2,0.5);var b=OpenLayers.INCHES_PER_UNIT.m;f.maxScale=parseFloat(((c*d)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13));f.minScale=parseFloat(((c*a)*b*OpenLayers.DOTS_PER_INCH).toPrecision(13))},read_cap_Name:function(c,b){var a=this.getChildValue(b);if(a){c.name=a}},read_cap_Title:function(b,a){var c=this.getChildValue(a);if(c){b.title=c}},read_cap_Abstract:function(c,b){var a=this.getChildValue(b);if(a){c["abstract"]=a}},read_cap_LatLonBoundingBox:function(a,b){a.llbbox=[parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy"))]},read_cap_Style:function(a,c){var b={};this.runChildNodes(b,c);a.styles.push(b)},read_cap_LegendURL:function(c,d){var b={width:d.getAttribute("width"),height:d.getAttribute("height")};var a=d.getElementsByTagName("OnlineResource");if(a.length>0){this.read_cap_OnlineResource(b,a[0])}c.legend=b},read_cap_OnlineResource:function(b,a){b.href=this.getAttributeNS(a,"http://www.w3.org/1999/xlink","href")},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1"});OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.1",version:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var c=f.documentElement;var b=this.version;if(!b){b=c.getAttribute("version");if(!b){b=this.defaultVersion}}if(b=="1.1.1"||b=="1.1.0"){b="1.1"}var d=OpenLayers.Format.WMSDescribeLayer["v"+b.replace(/\./g,"_")];if(!d){throw"Can't find a WMS DescribeLayer parser for version "+b}var g=new d(this.options);var a=g.read(f);a.version=b;return a},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"});OpenLayers.Format.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Format.XML,{layerIdentifier:"_layer",featureIdentifier:"_feature",regExes:{trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)},gmlFormat:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,arguments);OpenLayers.Util.extend(this,a);this.options=a},read:function(f){var a;if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var b=f.documentElement;if(b){var c=this;var d=this["read_"+b.nodeName];if(d){a=d.call(this,b)}else{a=new OpenLayers.Format.GML((this.options?this.options:{})).read(f)}}else{a=f}return a},read_msGMLOutput:function(h){var d=[];var b=this.getSiblingNodesByTagCriteria(h,this.layerIdentifier);if(b){for(var k=0,o=b.length;k<o;++k){var c=b[k];var l=c.nodeName;if(c.prefix){l=l.split(":")[1]}var l=l.replace(this.layerIdentifier,"");var m=this.getSiblingNodesByTagCriteria(c,this.featureIdentifier);if(m){for(var g=0;g<m.length;g++){var a=m[g];var q=this.parseGeometry(a);var f=this.parseAttributes(a);var r=new OpenLayers.Feature.Vector(q,f,null);r.type=l;d.push(r)}}}}return d},read_FeatureInfoResponse:function(g){var c=[];var k=this.getElementsByTagNameNS(g,"*","FIELDS");for(var h=0,l=k.length;h<l;h++){var a=k[h];var m=null;var f={};for(var d=0,o=a.attributes.length;d<o;d++){var b=a.attributes[d];f[b.nodeName]=b.nodeValue}c.push(new OpenLayers.Feature.Vector(m,f,null))}return c},getSiblingNodesByTagCriteria:function(g,l){var a=[];var c,f,d,h,b;if(g&&g.hasChildNodes()){c=g.childNodes;d=c.length;for(var j=0;j<d;j++){b=c[j];while(b&&b.nodeType!=1){b=b.nextSibling;j++}f=(b?b.nodeName:"");if(f.length>0&&f.indexOf(l)>-1){a.push(b)}else{h=this.getSiblingNodesByTagCriteria(b,l);if(h.length>0){(a.length==0)?a=h:a.push(h)}}}}return a},parseAttributes:function(d){var f={};if(d.nodeType==1){var c=d.childNodes;n=c.length;for(var g=0;g<n;++g){var b=c[g];if(b.nodeType==1){var k=b.childNodes;if(k.length==1){var j=k[0];if(j.nodeType==3||j.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var h=j.nodeValue.replace(this.regExes.trimSpace,"");f[a]=h}}}}}return f},parseGeometry:function(b){if(!this.gmlFormat){this.gmlFormat=new OpenLayers.Format.GML()}var a=this.gmlFormat.parseFeature(b);var c=null;if(a&&a.geometry){c=a.geometry.clone();a.destroy()}return c},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"});OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,stopSingle:false,stopDouble:false,timerId:null,down:null,rightclickTimerId:null,initialize:function(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(d){this.down=d.xy;return true}}},mousedown:null,mouseup:function(b){var a=true;if(this.checkModifiers(b)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(b)){a=this.rightclick(b)}return a},rightclick:function(b){if(this.passesTolerance(b)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[b]);return !this.stopDouble}else{var a=this["double"]?OpenLayers.Util.extend({},b):this.callback("rightclick",[b]);var c=OpenLayers.Function.bind(this.delayedRightCall,this,a);this.rightclickTimerId=window.setTimeout(c,this.delay)}}return !this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;if(a){this.callback("rightclick",[a])}return !this.stopSingle},dblclick:function(a){if(this.passesTolerance(a)){if(this["double"]){this.callback("dblclick",[a])}this.clearTimer()}return !this.stopDouble},click:function(b){if(this.passesTolerance(b)){if(this.timerId!=null){this.clearTimer()}else{var a=this.single?OpenLayers.Util.extend({},b):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}}return !this.stopSingle},passesTolerance:function(b){var c=true;if(this.pixelTolerance!=null&&this.down){var a=Math.sqrt(Math.pow(this.down.x-b.xy.x,2)+Math.pow(this.down.y-b.xy.y,2));if(a>this.pixelTolerance){c=false}}return c},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}if(this.rightclickTimerId!=null){window.clearTimeout(this.rightclickTimerId);this.rightclickTimerId=null}},delayedCall:function(a){this.timerId=null;if(a){this.callback("click",[a])}},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;a=true}return a},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(a){},move:function(a){},up:function(a){},out:function(a){},mousedown:function(b){var a=true;this.dragging=false;if(this.checkModifiers(b)&&OpenLayers.Event.isLeftClick(b)){this.started=true;this.start=b.xy;this.last=b.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(b);this.callback("down",[b.xy]);OpenLayers.Event.stop(b);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return true};document.onselectstart=function(){return false}}a=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return a},mousemove:function(a){if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)){if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(a);this.callback("move",[a.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=function(){return false}}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(b){if(this.started){var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(b);this.callback("up",[b.xy]);if(a){this.callback("done",[b.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(b){if(this.started&&OpenLayers.Util.mouseLeft(b,this.map.div)){var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(b);this.callback("out",[]);if(a){this.callback("done",[b.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}return true},click:function(a){return(this.start==this.last)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;a=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return a},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:false,initialize:function(d,b,c,a){OpenLayers.Handler.prototype.initialize.apply(this,[d,c,a]);this.layer=b},mousedown:function(a){this.down=a.xy;return this.handle(a)?!this.stopDown:true},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:true},click:function(a){return this.handle(a)?!this.stopClick:true},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(a);return true},dblclick:function(a){return !this.handle(a)},geometryTypeMatches:function(a){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1},handle:function(a){if(this.feature&&!this.feature.layer){this.feature=null}var c=a.type;var g=false;var f=!!(this.feature);var d=(c=="click"||c=="dblclick");this.feature=this.layer.getFeatureFromEvent(a);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var b=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(f&&b){if(this.lastFeature){this.triggerCallback(c,"out",[this.lastFeature])}this.triggerCallback(c,"in",[this.feature])}else{if(!f||d){this.triggerCallback(c,"in",[this.feature])}}this.lastFeature=this.feature;g=true}else{if(this.lastFeature&&(f&&b||d)){this.triggerCallback(c,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(f||d)){this.triggerCallback(c,"out",[this.lastFeature])}}return g},triggerCallback:function(d,f,b){var c=this.EVENTMAP[d][f];if(c){if(d=="click"&&this.up&&this.down){var a=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(a<=this.clickTolerance){this.callback(c,b)}}else{this.callback(c,b)}}},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();this.feature=null;this.lastFeature=null;this.down=null;this.up=null;this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},handleMapEvents:function(a){if(!a.property||a.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var a=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(a)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;if(a>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(a)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(a){if(this.passesTolerance(a.xy)){this.clearTimer();this.callback("move",[a]);this.px=a.xy;a=OpenLayers.Util.extend({},a);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}return !this.stopMove},mouseout:function(a){if(OpenLayers.Util.mouseLeft(a,this.map.div)){this.clearTimer();this.callback("move",[a])}return true},passesTolerance:function(b){var c=true;if(this.pixelTolerance&&this.px){var a=Math.sqrt(Math.pow(this.px.x-b.x,2)+Math.pow(this.px.y-b.y,2));if(a<this.pixelTolerance){c=false}}return c},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(a){this.callback("pause",[a])},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();a=true}return a},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.observe(document,this.KEY_EVENTS[b],this.eventListener)}return true}else{return false}},deactivate:function(){var c=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[b],this.eventListener)}c=true}return c},handleKeyEvent:function(a){if(this.checkModifiers(a)){this.callback(a.type,[a])}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(k){if(!this.map||!this.checkModifiers(k)){return}var g=false;var l=false;var f=false;var b=OpenLayers.Event.element(k);while((b!=null)&&!f&&!g){if(!g){try{if(b.currentStyle){c=b.currentStyle.overflow}else{var a=document.defaultView.getComputedStyle(b,null);var c=a.getPropertyValue("overflow")}g=(c&&(c=="auto")||(c=="scroll"))}catch(d){}}if(!l){for(var h=0,j=this.map.layers.length;h<j;h++){if(b==this.map.layers[h].div||b==this.map.layers[h].pane){l=true;break}}}f=(b==this.map.div);b=b.parentNode}if(!g&&f){if(l){this.wheelZoom(k)}OpenLayers.Event.stop(k)}},wheelZoom:function(a){var b=0;if(!a){a=window.event}if(a.wheelDelta){b=a.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){b=-b}}else{if(a.detail){b=-a.detail/3}}if(b){if(this.mousePosition){a.xy=this.mousePosition}if(!a.xy){a.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(b<0){this.callback("down",[a,b])}else{this.callback("up",[a,b])}}},mousemove:function(a){this.mousePosition=a.xy},activate:function(a){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",b);OpenLayers.Event.observe(window,"mousewheel",b);OpenLayers.Event.observe(document,"mousewheel",b);return true}else{return false}},deactivate:function(a){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",b);OpenLayers.Event.stopObserving(window,"mousewheel",b);OpenLayers.Event.stopObserving(document,"mousewheel",b);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(b,a){this.addOptions(a);this.name=b;if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLayers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.div.dir="ltr";this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}}if(this.wrapDateLine){this.displayOutsideMaxExtent=true}},destroy:function(a){if(a==null){a=true}if(this.map!=null){this.map.removeLayer(this,a)}this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Layer(this.name,this.options)}OpenLayers.Util.applyDefaults(a,this);a.map=null;return a},setName:function(a){if(a!=this.name){this.name=a;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(a){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},onMapResize:function(){},redraw:function(){var b=false;if(this.map){this.inRange=this.calculateInRange();var c=this.getExtent();if(c&&this.inRange&&this.visibility){var a=true;this.moveTo(c,a,false);this.events.triggerEvent("moveend",{zoomChanged:a});b=true}}return b},moveTo:function(b,a,c){var d=this.visibility;if(!this.isBaseLayer){d=d&&this.inRange}this.display(d)},setMap:function(b){if(this.map==null){this.map=b;this.maxExtent=this.maxExtent||this.map.maxExtent;this.projection=this.projection||this.map.projection;if(this.projection&&typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var a=((this.visibility)&&(this.inRange));this.div.style.display=a?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(a){},getImageSize:function(){return(this.imageSize||this.tileSize)},setTileSize:function(a){var b=(a)?a:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=b;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(b.w+(2*this.gutter),b.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(a){if(a!=this.visibility){this.visibility=a;this.display(a);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(a){var b=this.calculateInRange();if(a!=(this.div.style.display!="none")){this.div.style.display=(a&&b)?"block":"none"}},calculateInRange:function(){var b=false;if(this.alwaysInRange){b=true}else{if(this.map){var a=this.map.getResolution();b=((a>=this.minResolution)&&(a<=this.maxResolution))}}return b},setIsBaseLayer:function(a){if(a!=this.isBaseLayer){this.isBaseLayer=a;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var q=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var f=false;var d={};for(var g=0,k=q.length;g<k;g++){var s=q[g];if(this.options[s]&&OpenLayers.Util.indexOf(b,s)==-1){f=true}d[s]=this.options[s]||this.map[s]}if(this.alwaysInRange==null){this.alwaysInRange=!f}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){d.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){d.resolutions=null}if((!d.numZoomLevels)&&(d.maxZoomLevel)){d.numZoomLevels=d.maxZoomLevel+1}if((d.scales!=null)||(d.resolutions!=null)){if(d.scales!=null){d.resolutions=[];for(var g=0,k=d.scales.length;g<k;g++){var c=d.scales[g];d.resolutions[g]=OpenLayers.Util.getResolutionFromScale(c,d.units)}}d.numZoomLevels=d.resolutions.length}else{if(d.minScale){d.maxResolution=OpenLayers.Util.getResolutionFromScale(d.minScale,d.units)}else{if(d.maxResolution=="auto"){var r=this.map.getSize();var o=d.maxExtent.getWidth()/r.w;var j=d.maxExtent.getHeight()/r.h;d.maxResolution=Math.max(o,j)}}if(d.maxScale!=null){d.minResolution=OpenLayers.Util.getResolutionFromScale(d.maxScale,d.units)}else{if((d.minResolution=="auto")&&(d.minExtent!=null)){var r=this.map.getSize();var o=d.minExtent.getWidth()/r.w;var j=d.minExtent.getHeight()/r.h;d.minResolution=Math.max(o,j)}}if(d.minResolution!=null&&this.options.numZoomLevels==undefined){var m=d.maxResolution/d.minResolution;d.numZoomLevels=Math.floor(Math.log(m)/Math.log(2))+1}d.resolutions=new Array(d.numZoomLevels);var a=2;if(typeof d.minResolution=="number"&&d.numZoomLevels>1){a=Math.pow((d.maxResolution/d.minResolution),(1/(d.numZoomLevels-1)))}for(var g=0;g<d.numZoomLevels;g++){var l=d.maxResolution/Math.pow(a,g);d.resolutions[g]=l}}d.resolutions.sort(function(u,t){return(t-u)});this.resolutions=d.resolutions;this.maxResolution=d.resolutions[0];var h=d.resolutions.length-1;this.minResolution=d.resolutions[h];this.scales=[];for(var g=0,k=d.resolutions.length;g<k;g++){this.scales[g]=OpenLayers.Util.getScaleFromResolution(d.resolutions[g],d.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=d.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(b,c){var d=this.map.getSize();var a=Math.max(b.getWidth()/d.w,b.getHeight()/d.h);return this.getZoomForResolution(a,c)},getDataExtent:function(){},getResolutionForZoom:function(c){c=Math.max(0,Math.min(c,this.resolutions.length-1));var b;if(this.map.fractionalZoom){var a=Math.floor(c);var d=Math.ceil(c);b=this.resolutions[a]-((c-a)*(this.resolutions[a]-this.resolutions[d]))}else{b=this.resolutions[Math.round(c)]}return b},getZoomForResolution:function(f,a){var q;if(this.map.fractionalZoom){var l=0;var c=this.resolutions.length-1;var d=this.resolutions[l];var b=this.resolutions[c];var k;for(var g=0,h=this.resolutions.length;g<h;++g){k=this.resolutions[g];if(k>=f){d=k;l=g}if(k<=f){b=k;c=g;break}}var j=d-b;if(j>0){q=l+((d-f)/j)}else{q=l}}else{var m;var o=Number.POSITIVE_INFINITY;for(var g=0,h=this.resolutions.length;g<h;g++){if(a){m=Math.abs(this.resolutions[g]-f);if(m>o){break}o=m}else{if(this.resolutions[g]<f){break}}}q=Math.max(0,g-1)}return q},getLonLatFromViewPortPx:function(b){var f=null;if(b!=null){var d=this.map.getSize();var a=this.map.getCenter();if(a){var c=this.map.getResolution();var h=b.x-(d.w/2);var g=b.y-(d.h/2);f=new OpenLayers.LonLat(a.lon+h*c,a.lat-g*c);if(this.wrapDateLine){f=f.wrapDateLine(this.maxExtent)}}}return f},getViewPortPxFromLonLat:function(d){var b=null;if(d!=null){var a=this.map.getResolution();var c=this.map.getExtent();b=new OpenLayers.Pixel((1/a*(d.lon-c.left)),(1/a*(c.top-d.lat)))}return b},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var d=0,a=this.div.childNodes.length;d<a;++d){var c=this.div.childNodes[d].firstChild;OpenLayers.Util.modifyDOMElement(c,null,null,null,null,null,null,b)}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(b){if(this.gutter){var a=this.gutter*this.map.getResolution();b=new OpenLayers.Bounds(b.left-a,b.bottom-a,b.right+a,b.top+a)}if(this.wrapDateLine){var c={rightTolerance:this.getResolution()};b=b.wrapDateLine(this.maxExtent,c)}return b},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(b,c,a){this.bounds=b;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(c,a)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(a,b){if(!a){a="red"}if(!b){b=2}this.div.style.border=b+"px solid "+a},draw:function(a,b){OpenLayers.Util.modifyDOMElement(this.div,null,a,b);return this.div},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsBounds(this.bounds,true,true)}return b},display:function(a){this.div.style.display=(a)?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});(function(){var d=window.XMLHttpRequest;var j=!!window.controllers,f=window.document.all&&!window.opera;function c(){this._object=d?new d:new window.ActiveXObject("Microsoft.XMLHTTP")}if(j&&d.wrapped){c.wrapped=d.wrapped}c.UNSENT=0;c.OPENED=1;c.HEADERS_RECEIVED=2;c.LOADING=3;c.DONE=4;c.prototype.readyState=c.UNSENT;c.prototype.responseText="";c.prototype.responseXML=null;c.prototype.status=0;c.prototype.statusText="";c.prototype.onreadystatechange=null;c.onreadystatechange=null;c.onopen=null;c.onsend=null;c.onabort=null;c.prototype.open=function(o,s,m,t,l){this._async=m;var r=this,q=this.readyState;if(f){var k=function(){if(r._object.readyState!=c.DONE){a(r)}};if(m){window.attachEvent("onunload",k)}}this._object.onreadystatechange=function(){if(j&&!m){return}r.readyState=r._object.readyState;h(r);if(r._aborted){r.readyState=c.UNSENT;return}if(r.readyState==c.DONE){a(r);if(f&&m){window.detachEvent("onunload",k)}}if(q!=r.readyState){g(r)}q=r.readyState};if(c.onopen){c.onopen.apply(this,arguments)}this._object.open(o,s,m,t,l);if(!m&&j){this.readyState=c.OPENED;g(this)}};c.prototype.send=function(k){if(c.onsend){c.onsend.apply(this,arguments)}if(k&&k.nodeType){k=window.XMLSerializer?new window.XMLSerializer().serializeToString(k):k.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(k);if(j&&!this._async){this.readyState=c.OPENED;h(this);while(this.readyState<c.DONE){this.readyState++;g(this);if(this._aborted){return}}}};c.prototype.abort=function(){if(c.onabort){c.onabort.apply(this,arguments)}if(this.readyState>c.UNSENT){this._aborted=true}this._object.abort();a(this)};c.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};c.prototype.getResponseHeader=function(k){return this._object.getResponseHeader(k)};c.prototype.setRequestHeader=function(k,l){if(!this._headers){this._headers={}}this._headers[k]=l;return this._object.setRequestHeader(k,l)};c.prototype.toString=function(){return"[object XMLHttpRequest]"};c.toString=function(){return"[XMLHttpRequest]"};function g(k){if(k.onreadystatechange){k.onreadystatechange.apply(k)}if(c.onreadystatechange){c.onreadystatechange.apply(k)}}function b(l){var k=l.responseXML;if(f&&k&&!k.documentElement&&l.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){k=new ActiveXObject("Microsoft.XMLDOM");k.loadXML(l.responseText)}if(k){if((f&&k.parseError!=0)||(k.documentElement&&k.documentElement.tagName=="parsererror")){return null}}return k}function h(k){try{k.responseText=k._object.responseText}catch(l){}try{k.responseXML=b(k._object)}catch(l){}try{k.status=k._object.status}catch(l){}try{k.statusText=k._object.statusText}catch(l){}}function a(k){k._object.onreadystatechange=new window.Function;delete k._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(k,l){if(!l){l=[]}k.__func=this;k.__func(l[0],l[1],l[2],l[3],l[4]);delete k.__func}}OpenLayers.Request.XMLHttpRequest=c})();OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(a){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:a.statusText}))};OpenLayers.loadURL=function(d,h,b,f,c){if(typeof h=="string"){h=OpenLayers.Util.getParameters(h)}var g=(f)?f:OpenLayers.nullHandler;var a=(c)?c:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:d,params:h,success:g,failure:a,scope:b})};OpenLayers.parseXMLString=function(c){var a=c.indexOf("<");if(a>0){c=c.substring(a)}var b=OpenLayers.Util.Try(function(){var d=new ActiveXObject("Microsoft.XMLDOM");d.loadXML(c);return d},function(){return new DOMParser().parseFromString(c,"text/xml")},function(){var d=new XMLHttpRequest();d.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(c),false);if(d.overrideMimeType){d.overrideMimeType("text/xml")}d.send(null);return d.responseXML});return b};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(b){for(var a=0;a<this.responders.length;a++){if(b==this.responders[a]){return}}this.responders.push(b)},unregister:function(a){OpenLayers.Util.removeItem(this.reponders,a)},dispatch:function(g,c,f){var a;for(var b=0;b<this.responders.length;b++){a=this.responders[b];if(a[g]&&typeof a[g]=="function"){try{a[g].apply(a,[c,f])}catch(d){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters)}}});OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(b,a){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[a]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(b,"http")){b=OpenLayers.ProxyHost+encodeURIComponent(b)}this.transport=OpenLayers.Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var d=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){d._method=this.method;this.method="post"}this.parameters=d;if(d=OpenLayers.Util.getParameterString(d)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+d}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){d+="&_="}}}try{var a=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10)}this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(typeof c.push=="function"){for(var b=0,d=c.length;b<d;b+=2){f[c[b]]=c[b+1]}}else{for(var b in c){f[b]=c[b]}}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=OpenLayers.Ajax.Request.Events[a];var b=new OpenLayers.Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(b)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type")}try{(this.options["on"+c]||OpenLayers.Ajax.emptyFunction)(b);OpenLayers.Ajax.Responders.dispatch("on"+c,this,b)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){return null}},dispatchException:function(c){var d=this.options.onException;if(d){d(this,c);OpenLayers.Ajax.Responders.dispatch("onException",this,c)}else{var f=false;var a=OpenLayers.Ajax.Responders.responders;for(var b=0;b<a.length;b++){if(a[b].onException){f=true;break}}if(f){OpenLayers.Ajax.Responders.dispatch("onException",this,c)}else{throw c}}}});OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!(!!(window.attachEvent&&!window.opera)))||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=d.responseText==null?"":String(d.responseText)}if(a==4){var b=d.responseXML;this.responseXML=b===undefined?null:b}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(a){return this.transport.getResponseHeader(a)}});OpenLayers.Ajax.getElementsByTagNameNS=function(b,a,c,f){var d=null;if(b.getElementsByTagNameNS){d=b.getElementsByTagNameNS(a,f)}else{d=b.getElementsByTagName(c+":"+f)}return d};OpenLayers.Ajax.serializeXMLToString=function(a){var b=new XMLSerializer();var c=b.serializeToString(a);return c};OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(b,a){},onDrag:function(b,a){},onComplete:function(b,a){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){if(!this.handlers.drag.dragging){this.feature=a;this.handlers.drag.activate();this.over=true;OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over")}else{if(this.feature.id==a.id){this.over=true}else{this.over=false}}},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b*(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(a){if(!this.over){this.handlers.drag.deactivate()}},doneDragging:function(a){this.onComplete(this.feature,a)},outFeature:function(a){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");this.feature=null}else{if(this.feature.id==a.id){this.over=false}}},cancel:function(){this.handlers.drag.deactivate();this.over=false},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval})},panMap:function(a){this.panned=true;this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(a){if(this.panned){this.panMap(a);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress});this.activate()},defaultKeyPress:function(a){switch(a.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:var b=this.map.getSize();this.map.pan(0,-0.75*b.h);break;case 34:var b=this.map.getSize();this.map.pan(0,0.75*b.h);break;case 35:var b=this.map.getSize();this.map.pan(0.75*b.w,0);break;case 36:var b=this.map.getSize();this.map.pan(-0.75*b.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut();break}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:false,maxFeatures:10,layers:null,queryVisible:false,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,EVENT_TYPES:["getfeatureinfo"],initialize:function(a){this.EVENT_TYPES=OpenLayers.Control.WMSGetFeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);a=a||{};a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);if(!this.format){this.format=new OpenLayers.Format.WMSGetFeatureInfo(a.formatOptions)}if(this.hover){this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}))}else{this.handler=new OpenLayers.Handler.Click(this,{click:this.getInfoForClick},this.handlerOptions.click||{})}},activate:function(){if(!this.active){this.handler.activate()}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},getInfoForClick:function(a){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");this.request(a.xy,{})},getInfoForHover:function(a){this.request(a.xy,{hover:true})},cancelHover:function(){if(this.hoverRequest){this.hoverRequest.abort();this.hoverRequest=null}},findLayers:function(){var g=[];var f=this.layers||this.map.layers;var d,b;for(var c=0,a=f.length;c<a;++c){d=f[c];if(d instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||d.getVisibility())){b=d.url instanceof Array?d.url[0]:d.url;if(!this.url){this.url=b}if(this.urlMatches(b)){g.push(d)}}}return g},urlMatches:function(b){var d=OpenLayers.Util.isEquivalentUrl(this.url,b);if(!d&&this.layerUrls){for(var c=0,a=this.layerUrls.length;c<a;++c){if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[c],b)){d=true;break}}}return d},request:function(a,k){k=k||{};var g=[];var h=[];var c=this.findLayers();if(c.length>0){for(var d=0,f=c.length;d<f;d++){g=g.concat(c[d].params.LAYERS);if(c[d].params.STYLES){h=h.concat(c[d].params.STYLES)}else{if(c[d].params.LAYERS instanceof Array){h=h.concat(new Array(c[d].params.LAYERS.length))}else{h=h.concat(c[d].params.LAYERS.replace(/[^,]/g,""))}}}var j={url:this.url,params:OpenLayers.Util.applyDefaults({service:"WMS",version:"1.1.0",request:"GetFeatureInfo",layers:g,query_layers:g,styles:h,bbox:this.map.getExtent().toBBOX(),srs:this.map.getProjection(),feature_count:this.maxFeatures,x:a.x,y:a.y,height:this.map.getSize().h,width:this.map.getSize().w,info_format:this.infoFormat},this.vendorParams),callback:function(l){this.handleResponse(a,l)},scope:this};var b=OpenLayers.Request.GET(j);if(k.hover===true){this.hoverRequest=b.priv}}else{OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(d,b){var c=b.responseXML;if(!c||!c.documentElement){c=b.responseText}var a=this.format.read(c);this.events.triggerEvent("getfeatureinfo",{text:b.responseText,features:a,request:b,xy:d});OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},setMap:function(a){this.handler.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:"default",initialize:function(c,a,b){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,a]);this.lonlat=null;this.geometry=c?c:null;this.state=null;this.attributes={};if(a){this.attributes=OpenLayers.Util.extend(this.attributes,a)}this.style=b?b:null},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null}this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(d){var c=false;if(this.layer&&this.layer.map){var a=this.layer.map.getExtent();if(d){var b=this.geometry.getBounds();c=a.intersectsBounds(b)}else{var f=a.toGeometry();c=f.intersects(this.geometry)}}return c},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(b,d,c){var a=false;if(this.geometry){a=this.geometry.atPoint(b,d,c)}return a},destroyPopup:function(){},move:function(a){if(!this.layer||!this.geometry.move){return}var b;if(a.CLASS_NAME=="OpenLayers.LonLat"){b=this.layer.getViewPortPxFromLonLat(a)}else{b=a}var d=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var c=this.layer.map.getResolution();this.geometry.move(c*(b.x-d.x),c*(d.y-b.y));this.layer.drawFeature(this);return d},toState:function(a){if(a==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=a;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(a==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=a;break}}else{if(a==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=a;break}}else{if(a==OpenLayers.State.UNKNOWN){this.state=a}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}};OpenLayers.Feature.WFS=OpenLayers.Class(OpenLayers.Feature,{initialize:function(c,b){var a=arguments;var d=this.processXMLNode(b);a=new Array(c,d.lonlat,d);OpenLayers.Feature.prototype.initialize.apply(this,a);this.createMarker();this.layer.addMarker(this.marker)},destroy:function(){if(this.marker!=null){this.layer.removeMarker(this.marker)}OpenLayers.Feature.prototype.destroy.apply(this,arguments)},processXMLNode:function(b){var a=OpenLayers.Ajax.getElementsByTagNameNS(b,"http://www.opengis.net/gml","gml","Point");var d=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(a[0],"http://www.opengis.net/gml","gml","coordinates")[0]);var c=d.split(",");return{lonlat:new OpenLayers.LonLat(parseFloat(c[0]),parseFloat(c[1])),id:null}},CLASS_NAME:"OpenLayers.Feature.WFS"});OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.WFSCapabilities,{initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a={};var b=c.documentElement;this.runChildNodes(a,b);return a},runChildNodes:function(g,f){var c=f.childNodes;var b,d;for(var a=0;a<c.length;++a){b=c[a];if(b.nodeType==1){d=this["read_cap_"+b.nodeName];if(d){d.apply(this,[g,b])}}}},read_cap_FeatureTypeList:function(c,b){var a={featureTypes:[]};this.runChildNodes(a,b);c.featureTypeList=a},read_cap_FeatureType:function(a,d,b){var c={};this.runChildNodes(c,d);a.featureTypes.push(c)},read_cap_Name:function(c,b){var a=this.getChildValue(b);if(a){c.name=a}},read_cap_Title:function(b,a){var c=this.getChildValue(a);if(c){b.title=c}},read_cap_Abstract:function(c,b){var a=this.getChildValue(b);if(a){c["abstract"]=a}},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"});OpenLayers.Format.WMC.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ol:"http://openlayers.org/context",wmc:"http://www.opengis.net/context",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"",getNamespacePrefix:function(a){var b=null;if(a==null){b=this.namespaces[this.defaultPrefix]}else{for(b in this.namespaces){if(this.namespaces[b]==a){break}}}return b},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"Default",initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a=c.documentElement;this.rootPrefix=a.prefix;var b={version:a.getAttribute("version")};this.runChildNodes(b,a);return b},runChildNodes:function(f,d){var b=d.childNodes;var a,c,h,k;for(var g=0,j=b.length;g<j;++g){a=b[g];if(a.nodeType==1){h=this.getNamespacePrefix(a.namespaceURI);k=a.nodeName.split(":").pop();c=this["read_"+h+"_"+k];if(c){c.apply(this,[f,a])}}}},read_wmc_General:function(a,b){this.runChildNodes(a,b)},read_wmc_BoundingBox:function(a,b){a.projection=b.getAttribute("SRS");a.bounds=new OpenLayers.Bounds(parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy")))},read_wmc_LayerList:function(a,b){a.layers=[];this.runChildNodes(a,b)},read_wmc_Layer:function(b,c){var d={params:this.layerParams||{},options:{visibility:(c.getAttribute("hidden")!="1"),queryable:(c.getAttribute("queryable")=="1")},formats:[],styles:[]};this.runChildNodes(d,c);d.params.layers=d.name;d.options.maxExtent=d.maxExtent;var a=this.getLayerFromInfo(d);b.layers.push(a)},getLayerFromInfo:function(c){var a=c.options;if(this.layerOptions){OpenLayers.Util.applyDefaults(a,this.layerOptions)}var b=new OpenLayers.Layer.WMS(c.title,c.href,c.params,a);return b},read_wmc_Extension:function(b,a){this.runChildNodes(b,a)},read_ol_units:function(b,a){b.options.units=this.getChildValue(a)},read_ol_maxExtent:function(c,b){var a=new OpenLayers.Bounds(b.getAttribute("minx"),b.getAttribute("miny"),b.getAttribute("maxx"),b.getAttribute("maxy"));c.maxExtent=a},read_ol_transparent:function(b,a){b.params.transparent=this.getChildValue(a)},read_ol_numZoomLevels:function(b,a){b.options.numZoomLevels=parseInt(this.getChildValue(a))},read_ol_opacity:function(b,a){b.options.opacity=parseFloat(this.getChildValue(a))},read_ol_singleTile:function(b,a){b.options.singleTile=(this.getChildValue(a)=="true")},read_ol_isBaseLayer:function(b,a){b.options.isBaseLayer=(this.getChildValue(a)=="true")},read_ol_displayInLayerSwitcher:function(b,a){b.options.displayInLayerSwitcher=(this.getChildValue(a)=="true")},read_wmc_Server:function(b,a){b.params.version=a.getAttribute("version");this.runChildNodes(b,a)},read_wmc_FormatList:function(b,a){this.runChildNodes(b,a)},read_wmc_Format:function(c,a){var b=this.getChildValue(a);c.formats.push(b);if(a.getAttribute("current")=="1"){c.params.format=b}},read_wmc_StyleList:function(b,a){this.runChildNodes(b,a)},read_wmc_Style:function(c,b){var a={};this.runChildNodes(a,b);if(b.getAttribute("current")=="1"){if(a.href){c.params.sld=a.href}else{if(a.body){c.params.sld_body=a.body}else{c.params.styles=a.name}}}c.styles.push(a)},read_wmc_SLD:function(a,b){this.runChildNodes(a,b)},read_sld_StyledLayerDescriptor:function(c,b){var a=OpenLayers.Format.XML.prototype.write.apply(this,[b]);c.body=a},read_wmc_OnlineResource:function(b,a){b.href=this.getAttributeNS(a,this.namespaces.xlink,"href")},read_wmc_Name:function(c,b){var a=this.getChildValue(b);if(a){c.name=a}},read_wmc_Title:function(b,a){var c=this.getChildValue(a);if(c){b.title=c}},read_wmc_MetadataURL:function(c,b){var d={};var a=b.getElementsByTagName("OnlineResource");if(a.length>0){this.read_wmc_OnlineResource(d,a[0])}c.options.metadataURL=d.href},read_wmc_Abstract:function(c,b){var a=this.getChildValue(b);if(a){c["abstract"]=a}},read_wmc_LatLonBoundingBox:function(a,b){a.llbbox=[parseFloat(b.getAttribute("minx")),parseFloat(b.getAttribute("miny")),parseFloat(b.getAttribute("maxx")),parseFloat(b.getAttribute("maxy"))]},read_wmc_LegendURL:function(c,d){var b={width:d.getAttribute("width"),height:d.getAttribute("height")};var a=d.getElementsByTagName("OnlineResource");if(a.length>0){this.read_wmc_OnlineResource(b,a[0])}c.legend=b},write:function(c,b){var a=this.createElementDefaultNS("ViewContext");this.setAttributes(a,{version:this.VERSION,id:(b&&typeof b.id=="string")?b.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")});this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);a.appendChild(this.write_wmc_General(c));a.appendChild(this.write_wmc_LayerList(c));return OpenLayers.Format.XML.prototype.write.apply(this,[a])},createElementDefaultNS:function(c,b,a){var d=this.createElementNS(this.namespaces[this.defaultPrefix],c);if(b){d.appendChild(this.createTextNode(b))}if(a){this.setAttributes(d,a)}return d},setAttributes:function(b,d){var c;for(var a in d){c=d[a].toString();if(c.match(/[A-Z]/)){this.setAttributeNS(b,null,a,c)}else{b.setAttribute(a,c)}}},write_wmc_General:function(a){var c=this.createElementDefaultNS("General");if(a.size){c.appendChild(this.createElementDefaultNS("Window",null,{width:a.size.w,height:a.size.h}))}var b=a.bounds;c.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:b.left.toPrecision(10),miny:b.bottom.toPrecision(10),maxx:b.right.toPrecision(10),maxy:b.top.toPrecision(10),SRS:a.projection}));c.appendChild(this.createElementDefaultNS("Title",a.title));c.appendChild(this.write_ol_MapExtension(a));return c},write_ol_MapExtension:function(b){var d=this.createElementDefaultNS("Extension");var c=b.maxExtent;if(c){var a=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(a,{minx:c.left.toPrecision(10),miny:c.bottom.toPrecision(10),maxx:c.right.toPrecision(10),maxy:c.top.toPrecision(10)});d.appendChild(a)}return d},write_wmc_LayerList:function(d){var f=this.createElementDefaultNS("LayerList");var c;for(var b=0,a=d.layers.length;b<a;++b){c=d.layers[b];if(c instanceof OpenLayers.Layer.WMS){f.appendChild(this.write_wmc_Layer(c))}}return f},write_wmc_Layer:function(a){var b=this.createElementDefaultNS("Layer",null,{queryable:a.queryable?"1":"0",hidden:a.visibility?"0":"1"});b.appendChild(this.write_wmc_Server(a));b.appendChild(this.createElementDefaultNS("Name",a.params.LAYERS));b.appendChild(this.createElementDefaultNS("Title",a.name));if(a.metadataURL){b.appendChild(this.write_wmc_MetadataURL(a))}b.appendChild(this.write_wmc_FormatList(a));b.appendChild(this.write_wmc_StyleList(a));b.appendChild(this.write_wmc_LayerExtension(a));return b},write_wmc_LayerExtension:function(g){var d=this.createElementDefaultNS("Extension");var a=g.maxExtent;var k=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(k,{minx:a.left.toPrecision(10),miny:a.bottom.toPrecision(10),maxx:a.right.toPrecision(10),maxy:a.top.toPrecision(10)});d.appendChild(k);var c=g.params.TRANSPARENT;if(c){var l=this.createElementNS(this.namespaces.ol,"ol:transparent");l.appendChild(this.createTextNode(c));d.appendChild(l)}var j=["numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"];var b;for(var f=0,h=j.length;f<h;++f){b=this.createOLPropertyNode(g,j[f]);if(b){d.appendChild(b)}}return d},createOLPropertyNode:function(b,c){var a=null;if(b[c]!=null){a=this.createElementNS(this.namespaces.ol,"ol:"+c);a.appendChild(this.createTextNode(b[c].toString()))}return a},write_wmc_Server:function(a){var b=this.createElementDefaultNS("Server");this.setAttributes(b,{service:"OGC:WMS",version:a.params.VERSION});b.appendChild(this.write_wmc_OnlineResource(a.url));return b},write_wmc_MetadataURL:function(a){var b=this.createElementDefaultNS("MetadataURL");b.appendChild(this.write_wmc_OnlineResource(a.metadataURL));return b},write_wmc_FormatList:function(a){var b=this.createElementDefaultNS("FormatList");b.appendChild(this.createElementDefaultNS("Format",a.params.FORMAT,{current:"1"}));return b},write_wmc_StyleList:function(f){var d=this.createElementDefaultNS("StyleList");var c=this.createElementDefaultNS("Style",null,{current:"1"});if(f.params.SLD){var b=this.createElementDefaultNS("SLD");var h=this.write_wmc_OnlineResource(f.params.SLD);b.appendChild(h);c.appendChild(b)}else{if(f.params.SLD_BODY){var b=this.createElementDefaultNS("SLD");var g=f.params.SLD_BODY;var j=OpenLayers.Format.XML.prototype.read.apply(this,[g]);var k=j.documentElement;if(b.ownerDocument&&b.ownerDocument.importNode){k=b.ownerDocument.importNode(k,true)}b.appendChild(k);c.appendChild(b)}else{var a=f.params.STYLES?f.params.STYLES:this.defaultStyleName;c.appendChild(this.createElementDefaultNS("Name",a));c.appendChild(this.createElementDefaultNS("Title",this.defaultStyleTitle))}}d.appendChild(c);return d},write_wmc_OnlineResource:function(a){var b=this.createElementDefaultNS("OnlineResource");this.setAttributeNS(b,this.namespaces.xlink,"xlink:type","simple");this.setAttributeNS(b,this.namespaces.xlink,"xlink:href",a);return b},CLASS_NAME:"OpenLayers.Format.WMC.v1"});OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.0",initialize:function(a){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"});OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.1",initialize:function(a){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1"});OpenLayers.Format.WMSDescribeLayer.v1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(a){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[a])},read:function(h){if(typeof h=="string"){h=OpenLayers.Format.XML.prototype.read.apply(this,[h])}var b=h.documentElement;var f=b.childNodes;var a=[];for(var d=0;d<f.length;++d){childNode=f[d];nodeName=childNode.nodeName;if(nodeName=="LayerDescription"){var j="";var g="";var c="";if(childNode.getAttribute("owsType")){j=childNode.getAttribute("owsType");g=childNode.getAttribute("owsURL")}else{if(childNode.getAttribute("wfs")!=""){j="WFS";g=childNode.getAttribute("wfs")}else{if(childNode.getAttribute("wcs")!=""){j="WCS";g=childNode.getAttribute("wcs")}}}query=childNode.getElementsByTagName("Query");if(query.length>0){c=query[0].getAttribute("typeName");if(!c){c=query[0].getAttribute("typename")}}a.push({owsType:j,owsURL:g,typeName:c})}}return a},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(c,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var b={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,b,{keyMask:this.keyMask})},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(a)}},startBox:function(a){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(g){var d=this.dragHandler.start.x;var b=this.dragHandler.start.y;var c=Math.abs(d-g.x);var a=Math.abs(b-g.y);this.zoomBox.style.width=Math.max(1,c)+"px";this.zoomBox.style.height=Math.max(1,a)+"px";this.zoomBox.style.left=g.x<d?g.x+"px":d+"px";this.zoomBox.style.top=g.y<b?g.y+"px":b+"px";var f=this.getBoxCharacteristics();if(f.newBoxModel){if(g.x>d){this.zoomBox.style.width=Math.max(1,c-f.xOffset)+"px"}if(g.y>b){this.zoomBox.style.height=Math.max(1,a-f.yOffset)+"px"}}},endBox:function(b){var a;if(Math.abs(this.dragHandler.start.x-b.x)>5||Math.abs(this.dragHandler.start.y-b.y)>5){var h=this.dragHandler.start;var g=Math.min(h.y,b.y);var c=Math.max(h.y,b.y);var f=Math.min(h.x,b.x);var d=Math.max(h.x,b.x);a=new OpenLayers.Bounds(f,c,d,g)}else{a=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[a])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxCharacteristics=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return true}else{return false}},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var c=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var b=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:a,yOffset:c,newBoxModel:b}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(c,b,a){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,[c,b,a]);this.options=(a)?a:new Object()},setOptions:function(a){OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b={displayInLayerSwitcher:false,calculateInRange:function(){return true}};this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,b);this.map.addLayer(this.layer);a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel()}if(this.layer.map!=null){this.layer.destroy(false);if(this.feature){this.feature.destroy()}}this.layer=null;this.feature=null;a=true}return a},down:function(a){this.fixedRadius=!!(this.radius);var b=this.map.getLonLatFromPixel(a.xy);this.origin=new OpenLayers.Geometry.Point(b.lon,b.lat);if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution()}if(this.persist){this.clear()}this.feature=new OpenLayers.Feature.Vector();this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature],{silent:true});this.layer.drawFeature(this.feature,this.style)},move:function(c){var g=this.map.getLonLatFromPixel(c.xy);var a=new OpenLayers.Geometry.Point(g.lon,g.lat);if(this.irregular){var h=Math.sqrt(2)*Math.abs(a.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,h)}else{if(this.fixedRadius){this.origin=a}else{this.calculateAngle(a,c);this.radius=Math.max(this.map.getResolution()/2,a.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var d=a.x-this.origin.x;var b=a.y-this.origin.y;var f;if(b==0){f=d/(this.radius*Math.sqrt(2))}else{f=d/b}this.feature.geometry.resize(1,this.origin,f);this.feature.geometry.move(d/2,b/2)}this.layer.drawFeature(this.feature,this.style)},up:function(a){this.finalize();if(this.start==this.last){this.callback("done",[a.xy])}},out:function(a){this.finalize()},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180)}this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var g,c,b,a;var d=this.feature.geometry.components[0];if(d.components.length!=(this.sides+1)){this.createGeometry();d=this.feature.geometry.components[0]}for(var f=0;f<this.sides;++f){a=d.components[f];g=this.angle+(f*2*Math.PI/this.sides);a.x=this.origin.x+(this.radius*Math.cos(g));a.y=this.origin.y+(this.radius*Math.sin(g));a.clearBounds()}},calculateAngle:function(a,b){var d=Math.atan2(a.y-this.origin.y,a.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!b[this.snapToggle])){var c=(Math.PI/180)*this.snapAngle;this.angle=Math.round(d/c)*c}else{this.angle=d}},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){this.layer.renderer.clear();this.layer.destroyFeatures()},callback:function(b,a){if(this.callbacks[b]){this.callbacks[b].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(b=="done"||b=="cancel")){this.clear()}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(b,a){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(this.pane==null){this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")}},destroy:function(){this.mapObject=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(OpenLayers.Util.getBrowserName()=="msie"){this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)"}if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane)}else{this.map.layerContainerDiv.appendChild(this.pane)}this.loadMapObject();if(this.mapObject==null){this.loadWarningMessage()}},removeMap:function(a){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane);this.pane=null}OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var h=this.map.getSize();var a=Math.min(h.w,300);var f=Math.min(h.h,200);var b=new OpenLayers.Size(a,f);var d=new OpenLayers.Pixel(h.w/2,h.h/2);var c=d.add(-b.w/2,-b.h/2);var g=OpenLayers.Util.createDiv(this.name+"_warning",c,b,null,null,null,"auto");g.style.padding="7px";g.style.backgroundColor="yellow";g.innerHTML=this.getWarningHTML();this.div.appendChild(g)},getWarningHTML:function(){return""},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(a){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveTo:function(c,d,l){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var f=this.map.getCenter();var h=this.map.getZoom();if(f!=null){var g=this.getMapObjectCenter();var b=this.getOLLonLatFromMapObjectLonLat(g);var j=this.getMapObjectZoom();var q=this.getOLZoomFromMapObjectZoom(j);if(!(f.equals(b))||!(h==q)){if(l&&this.dragPanMapObject&&this.smoothDragPan){var k=this.map.getViewPortPxFromLonLat(b);var m=this.map.getViewPortPxFromLonLat(f);this.dragPanMapObject(m.x-k.x,k.y-m.y)}else{var a=this.getMapObjectLonLatFromOLLonLat(f);var o=this.getMapObjectZoomFromOLZoom(h);this.setMapObjectCenter(a,o,l)}}}}},getLonLatFromViewPortPx:function(a){var b=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var d=this.getMapObjectPixelFromOLPixel(a);var c=this.getMapObjectLonLatFromMapObjectPixel(d);b=this.getOLLonLatFromMapObjectLonLat(c)}return b},getViewPortPxFromLonLat:function(b){var a=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var d=this.getMapObjectLonLatFromOLLonLat(b);var c=this.getMapObjectPixelFromMapObjectLonLat(d);a=this.getOLPixelFromMapObjectPixel(c)}return a},getOLLonLatFromMapObjectLonLat:function(d){var a=null;if(d!=null){var c=this.getLongitudeFromMapObjectLonLat(d);var b=this.getLatitudeFromMapObjectLonLat(d);a=new OpenLayers.LonLat(c,b)}return a},getMapObjectLonLatFromOLLonLat:function(a){var b=null;if(a!=null){b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat)}return b},getOLPixelFromMapObjectPixel:function(d){var b=null;if(d!=null){var a=this.getXFromMapObjectPixel(d);var c=this.getYFromMapObjectPixel(d);b=new OpenLayers.Pixel(a,c)}return b},getMapObjectPixelFromOLPixel:function(a){var b=null;if(a!=null){b=this.getMapObjectPixelFromXY(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var c=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");for(var b=0,a=c.length;b<a;b++){var g=c[b];this[g]=(this.options[g]!=null)?this.options[g]:this.map[g]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var h;var f=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){h=this.maxZoomLevel-this.minZoomLevel+1}else{h=this.numZoomLevels}if(h!=null){this.numZoomLevels=Math.min(h,f)}else{this.numZoomLevels=f}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var d=0;this.resolutions=[];for(var b=this.minZoomLevel;b<=this.maxZoomLevel;b++){this.resolutions[d++]=this.RESOLUTIONS[b]}this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getResolution.apply(this,arguments)}else{var a=null;var c=this.map.getSize();var b=this.getExtent();if((c!=null)&&(b!=null)){a=Math.max(b.getWidth()/c.w,b.getHeight()/c.h)}return a}},getExtent:function(){var c=null;var b=this.map.getSize();var f=new OpenLayers.Pixel(0,0);var g=this.getLonLatFromViewPortPx(f);var a=new OpenLayers.Pixel(b.w,b.h);var d=this.getLonLatFromViewPortPx(a);if((g!=null)&&(d!=null)){c=new OpenLayers.Bounds(g.lon,d.lat,d.lon,g.lat)}return c},getZoomForResolution:function(a){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)}else{var b=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(b)}},getOLZoomFromMapObjectZoom:function(a){var b=null;if(a!=null){b=a-this.minZoomLevel}return b},getMapObjectZoomFromOLZoom:function(a){var b=null;if(a!=null){b=a+this.minZoomLevel}return b},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(d,c,f,b){var a=arguments;a=[d,b];OpenLayers.Layer.prototype.initialize.apply(this,a);this.url=c;this.params=OpenLayers.Util.extend({},f)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setUrl:function(a){this.url=a},mergeNewParams:function(a){this.params=OpenLayers.Util.extend(this.params,a);return this.redraw()},redraw:function(a){if(a){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(f,d){var c=1;for(var b=0,a=f.length;b<a;b++){c*=f.charCodeAt(b)*this.URL_HASH_FACTOR;c-=Math.floor(c)}return d[Math.floor(c*d.length)]},getFullRequestString:function(g,f){var b=f||this.url;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var a=OpenLayers.Util.getParameterString(h);if(b instanceof Array){b=this.selectUrl(a,b)}var d=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var j in h){if(j.toUpperCase() in d){delete h[j]}}a=OpenLayers.Util.getParameterString(h);var k=b;if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){k+=a}else{if(b.indexOf("?")==-1){k+="?"+a}else{k+="&"+a}}}return k},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:true,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(c,b,f,d,a){this.url=b;this.extent=f;this.maxExtent=f;this.size=d;OpenLayers.Layer.prototype.initialize.apply(this,[c,a]);this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.extent.getWidth()/this.size.w)},destroy:function(){if(this.tile){this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null}OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.options)}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setMap:function(a){if(this.options.maxResolution==null){this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w}OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(f,a,g){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var b=(this.tile==null);if(a||b){this.setTileSize();var d=new OpenLayers.LonLat(this.extent.left,this.extent.top);var c=this.map.getLayerPxFromLonLat(d);if(b){this.tile=new OpenLayers.Tile.Image(this,c,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=c.clone()}this.tile.draw()}},setTileSize:function(){var b=this.extent.getWidth()/this.map.getResolution();var a=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(b,a)},addTileMonitoringHooks:function(a){a.onLoadStart=function(){this.events.triggerEvent("loadstart")};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.events.triggerEvent("loadend")};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},setUrl:function(a){this.url=a;this.tile.draw()},getURL:function(a){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(b,a){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var c=0,a=this.markers.length;c<a;c++){this.markers[c].setOpacity(this.opacity)}}},moveTo:function(d,b,f){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(b||!this.drawn){for(var c=0,a=this.markers.length;c<a;c++){this.drawMarker(this.markers[c])}this.drawn=true}},addMarker:function(a){this.markers.push(a);if(this.opacity!=null){a.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){a.map=this.map;this.drawMarker(a)}},removeMarker:function(a){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,a);a.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(a){var b=this.map.getLayerPxFromLonLat(a.lonlat);if(b==null){a.display(false)}else{if(!a.isDrawn()){var c=a.draw(b);this.div.appendChild(c)}else{if(a.icon){a.icon.moveTo(b)}}}},getDataExtent:function(){var b=null;if(this.markers&&(this.markers.length>0)){var b=new OpenLayers.Bounds();for(var d=0,a=this.markers.length;d<a;d++){var c=this.markers[d];b.extend(c.lonlat)}}return b},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var a=null;if(this.sphericalMercator){a=this.map.calculateBounds()}else{a=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return a},initMercatorParameters:function(){this.RESOLUTIONS=[];var a=156543.0339;for(var b=0;b<=this.MAX_ZOOM_LEVEL;++b){this.RESOLUTIONS[b]=a/Math.pow(2,b)}this.units="m";this.projection="EPSG:900913"},forwardMercator:function(c,b){var a=c*20037508.34/180;var d=Math.log(Math.tan((90+b)*Math.PI/360))/(Math.PI/180);d=d*20037508.34/180;return new OpenLayers.LonLat(a,d)},inverseMercator:function(a,d){var c=(a/20037508.34)*180;var b=(d/20037508.34)*180;b=180/Math.PI*(2*Math.atan(Math.exp(b*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(c,b)},projectForward:function(a){var b=OpenLayers.Layer.SphericalMercator.forwardMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a},projectInverse:function(a){var b=OpenLayers.Layer.SphericalMercator.inverseMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);OpenLayers.Tile.WFS=OpenLayers.Class(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(d,a,f,b,c){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;this.features=[]},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(this,arguments);this.destroyAllFeatures();this.features=null;this.url=null;if(this.request){this.request.abort();this.request=null}},clear:function(){this.destroyAllFeatures()},draw:function(){if(OpenLayers.Tile.prototype.draw.apply(this,arguments)){if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}this.loadFeaturesForRegion(this.requestSuccess)}},loadFeaturesForRegion:function(b,a){if(this.request){this.request.abort()}this.request=OpenLayers.Request.GET({url:this.url,success:b,failure:a,scope:this})},requestSuccess:function(b){if(this.features){var d=b.responseXML;if(!d||!d.documentElement){d=b.responseText}if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(d))}else{var a=new OpenLayers.Format.XML();if(typeof d=="string"){d=a.read(d)}var c=a.getElementsByTagNameNS(d,"http://www.opengis.net/gml","featureMember");this.addResults(c)}}if(this.events){this.events.triggerEvent("loadend")}this.request=null},addResults:function(c){for(var b=0;b<c.length;b++){var a=new this.layer.featureClass(this.layer,c[b]);this.features.push(a)}},destroyAllFeatures:function(){while(this.features.length>0){var a=this.features.shift();a.destroy()}},CLASS_NAME:"OpenLayers.Tile.WFS"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,initialize:function(b,c,a){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(g,f){this.layer.events.triggerEvent("sketchmodified",{vertex:g,feature:f})},create:function(g,f){this.layer.events.triggerEvent("sketchstarted",{vertex:g,feature:f})}},this.callbacks);this.layer=b;var d=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(d){this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":d})})}this.handler=new c(this,this.callbacks,this.handlerOptions)},drawFeature:function(c){var a=new OpenLayers.Feature.Vector(c);var b=this.layer.events.triggerEvent("sketchcomplete",{feature:a});if(b!==false){a.state=OpenLayers.State.INSERT;this.layer.addFeatures([a]);this.featureAdded(a);this.events.triggerEvent("featureadded",{feature:a})}},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:false,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:false,initialize:function(b,a){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new b(this,this.callbacks,this.handlerOptions)},cancel:function(){this.handler.cancel()},updateHandler:function(b,a){var c=this.active;if(c){this.deactivate()}this.handler=new b(this,this.callbacks,a);if(c){this.activate()}},measureComplete:function(a){if(this.delayedTrigger){window.clearTimeout(this.delayedTrigger)}this.measure(a,"measure")},measurePartial:function(a,b){this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(b,"measurepartial")},this),this.partialDelay)},measure:function(d,b){var c,a;if(d.CLASS_NAME.indexOf("LineString")>-1){c=this.getBestLength(d);a=1}else{c=this.getBestArea(d);a=2}this.events.triggerEvent(b,{measure:c[0],units:c[1],order:a,geometry:d})},getBestArea:function(g){var b=this.displaySystemUnits[this.displaySystem];var f,d;for(var c=0,a=b.length;c<a;++c){f=b[c];d=this.getArea(g,f);if(d>1){break}}return[d,f]},getArea:function(g,a){var b,c;if(this.geodesic){b=g.getGeodesicArea(this.map.getProjectionObject());c="m"}else{b=g.getArea();c=this.map.getUnits()}var f=OpenLayers.INCHES_PER_UNIT[a];if(f){var d=OpenLayers.INCHES_PER_UNIT[c];b*=Math.pow((d/f),2)}return b},getBestLength:function(g){var b=this.displaySystemUnits[this.displaySystem];var f,d;for(var c=0,a=b.length;c<a;++c){f=b[c];d=this.getLength(g,f);if(d>1){break}}return[d,f]},getLength:function(g,a){var b,c;if(this.geodesic){b=g.getGeodesicLength(this.map.getProjectionObject());c="m"}else{b=g.getLength();c=this.map.getUnits()}var f=OpenLayers.INCHES_PER_UNIT[a];if(f){var d=OpenLayers.INCHES_PER_UNIT[c];b*=(d/f)}return b},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,alwaysZoom:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(j){if(j instanceof OpenLayers.Bounds){if(!this.out){var k=this.map.getLonLatFromPixel(new OpenLayers.Pixel(j.left,j.bottom));var q=this.map.getLonLatFromPixel(new OpenLayers.Pixel(j.right,j.top));var b=new OpenLayers.Bounds(k.lon,k.lat,q.lon,q.lat)}else{var h=Math.abs(j.right-j.left);var l=Math.abs(j.top-j.bottom);var f=Math.min((this.map.size.h/l),(this.map.size.w/h));var r=this.map.getExtent();var a=this.map.getLonLatFromPixel(j.getCenterPixel());var c=a.lon-(r.getWidth()/2)*f;var g=a.lon+(r.getWidth()/2)*f;var o=a.lat-(r.getHeight()/2)*f;var d=a.lat+(r.getHeight()/2)*f;var b=new OpenLayers.Bounds(c,o,g,d)}var m=this.map.getZoom();this.map.zoomToExtent(b);if(m==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(m+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(j),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(j),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(a){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"});OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(a){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(a){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(g){var f,d,j;var h=this.regExes.typeStr.exec(g);if(h){d=h[1].toLowerCase();j=h[2];if(this.parse[d]){f=this.parse[d].apply(this,[j])}if(this.internalProjection&&this.externalProjection){if(f&&f.CLASS_NAME=="OpenLayers.Feature.Vector"){f.geometry.transform(this.externalProjection,this.internalProjection)}else{if(f&&d!="geometrycollection"&&typeof f=="object"){for(var c=0,a=f.length;c<a;c++){var b=f[c];b.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return f},write:function(a){var g,k,j,d,b;if(a.constructor==Array){g=a;b=true}else{g=[a];b=false}var c=[];if(b){c.push("GEOMETRYCOLLECTION(")}for(var f=0,h=g.length;f<h;++f){if(b&&f>0){c.push(",")}k=g[f].geometry;j=k.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[j]){return null}if(this.internalProjection&&this.externalProjection){k=k.clone();k.transform(this.internalProjection,this.externalProjection)}d=this.extract[j].apply(this,[k]);c.push(j.toUpperCase()+"("+d+")")}if(b){c.push(")")}return c.join("")},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(c){var d=[];for(var b=0,a=c.components.length;b<a;++b){d.push(this.extract.point.apply(this,[c.components[b]]))}return d.join(",")},linestring:function(b){var d=[];for(var c=0,a=b.components.length;c<a;++c){d.push(this.extract.point.apply(this,[b.components[c]]))}return d.join(",")},multilinestring:function(c){var d=[];for(var b=0,a=c.components.length;b<a;++b){d.push("("+this.extract.linestring.apply(this,[c.components[b]])+")")}return d.join(",")},polygon:function(c){var d=[];for(var b=0,a=c.components.length;b<a;++b){d.push("("+this.extract.linestring.apply(this,[c.components[b]])+")")}return d.join(",")},multipolygon:function(d){var c=[];for(var b=0,a=d.components.length;b<a;++b){c.push("("+this.extract.polygon.apply(this,[d.components[b]])+")")}return c.join(",")}},parse:{point:function(b){var a=OpenLayers.String.trim(b).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0],a[1]))},multipoint:function(f){var c=OpenLayers.String.trim(f).split(",");var d=[];for(var b=0,a=c.length;b<a;++b){d.push(this.parse.point.apply(this,[c[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(d))},linestring:function(f){var c=OpenLayers.String.trim(f).split(",");var d=[];for(var b=0,a=c.length;b<a;++b){d.push(this.parse.point.apply(this,[c[b]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(d))},multilinestring:function(g){var c;var b=OpenLayers.String.trim(g).split(this.regExes.parenComma);var f=[];for(var d=0,a=b.length;d<a;++d){c=b[d].replace(this.regExes.trimParens,"$1");f.push(this.parse.linestring.apply(this,[c]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(f))},polygon:function(j){var c,b,g;var h=OpenLayers.String.trim(j).split(this.regExes.parenComma);var f=[];for(var d=0,a=h.length;d<a;++d){c=h[d].replace(this.regExes.trimParens,"$1");b=this.parse.linestring.apply(this,[c]).geometry;g=new OpenLayers.Geometry.LinearRing(b.components);f.push(g)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(f))},multipolygon:function(g){var d;var b=OpenLayers.String.trim(g).split(this.regExes.doubleParenComma);var f=[];for(var c=0,a=b.length;c<a;++c){d=b[c].replace(this.regExes.trimParens,"$1");f.push(this.parse.polygon.apply(this,[d]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(f))},geometrycollection:function(f){f=f.replace(/,\s*([A-Za-z])/g,"|$1");var d=OpenLayers.String.trim(f).split("|");var c=[];for(var b=0,a=d.length;b<a;++b){c.push(OpenLayers.Format.WKT.prototype.read.apply(this,[d[b]]))}return c}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},CLASS_NAME:"OpenLayers.Format.WMC.v1_0_0"});OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},read_sld_MinScaleDenominator:function(b,a){b.options.maxScale=this.getChildValue(a)},read_sld_MaxScaleDenominator:function(b,a){b.options.minScale=this.getChildValue(a)},write_wmc_Layer:function(b){var c=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[b]);if(b.options.resolutions||b.options.scales||b.options.minResolution||b.options.maxScale){var d=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");d.appendChild(this.createTextNode(b.maxScale.toPrecision(10)));c.insertBefore(d,c.childNodes[3])}if(b.options.resolutions||b.options.scales||b.options.maxResolution||b.options.minScale){var a=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator");a.appendChild(this.createTextNode(b.minScale.toPrecision(10)));c.insertBefore(a,c.childNodes[4])}return c},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(b,a){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(a){var d=a.bounds;var g=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(d.left,d.top));var c=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(d.right,d.bottom));if(c==null||g==null){a.display(false)}else{var f=new OpenLayers.Size(Math.max(1,c.x-g.x),Math.max(1,c.y-g.y));var b=a.draw(g,f);if(!a.drawn){this.div.appendChild(b);a.drawn=true}}},removeMarker:function(a){OpenLayers.Util.removeItem(this.markers,a);if((a.div!=null)&&(a.div.parentNode==this.div)){this.div.removeChild(a.div)}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:true,initialize:function(c,a,b){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[c,b]);this.location=a;this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadRSS:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this});this.loaded=true}},moveTo:function(c,a,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadRSS()}},parseData:function(k){var q=k.responseXML;if(!q||!q.documentElement){q=OpenLayers.Format.XML.prototype.read(k.responseText)}if(this.useFeedTitle){var a=null;try{a=q.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(j){a=q.getElementsByTagName("title")[0].firstChild.nodeValue}if(a){this.setName(a)}}var u={};OpenLayers.Util.extend(u,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){u.externalProjection=this.projection;u.internalProjection=this.map.getProjectionObject()}var r=new OpenLayers.Format.GeoRSS(u);var b=r.read(q);for(var g=0,h=b.length;g<h;g++){var f={};var t=b[g];if(!t.geometry){continue}var m=t.attributes.title?t.attributes.title:"Untitled";var s=t.attributes.description?t.attributes.description:"No description.";var l=t.attributes.link?t.attributes.link:"";var o=t.geometry.getBounds().getCenterLonLat();f.icon=this.icon==null?OpenLayers.Marker.defaultIcon():this.icon.clone();f.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120);if(m||s){f.title=m;f.description=s;var c='<div class="olLayerGeoRSSClose">[x]</div>';c+='<div class="olLayerGeoRSSTitle">';if(l){c+='<a class="link" href="'+l+'" target="_blank">'}c+=m;if(l){c+="</a>"}c+="</div>";c+='<div style="" class="olLayerGeoRSSDescription">';c+=s;c+="</div>";f.popupContentHTML=c}var t=new OpenLayers.Feature(this,o,f);this.features.push(t);var d=t.createMarker();d.events.register("click",t,this.markerClick);this.addMarker(d)}this.events.triggerEvent("loadend")},markerClick:function(c){var f=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!f)?this:null;for(var d=0,a=this.layer.map.popups.length;d<a;d++){this.layer.map.removePopup(this.layer.map.popups[d])}if(!f){var b=this.createPopup();OpenLayers.Event.observe(b.div,"click",OpenLayers.Function.bind(function(){for(var h=0,g=this.layer.map.popups.length;h<g;h++){this.layer.map.removePopup(this.layer.map.popups[h])}},this));this.layer.map.addPopup(b)}OpenLayers.Event.stop(c)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031,0.00000536441802978515,0.00000268220901489257],type:null,sphericalMercator:false,dragObject:null,termsOfUse:null,poweredBy:null,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.addContainerPxFunction();if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{this.mapObject=new GMap2(this.div);if(typeof this.mapObject.getDragObject=="function"){this.dragObject=this.mapObject.getDragObject()}else{this.dragPanMapObject=null}this.termsOfUse=this.div.lastChild;this.div.removeChild(this.termsOfUse);if(this.isFixed){this.map.viewPortDiv.appendChild(this.termsOfUse)}else{this.map.layerContainerDiv.appendChild(this.termsOfUse)}this.termsOfUse.style.zIndex="1100";this.termsOfUse.style.display=this.div.style.display;this.termsOfUse.style.right="";this.termsOfUse.style.bottom="";this.termsOfUse.className="olLayerGoogleCopyright";this.poweredBy=this.div.lastChild;this.div.removeChild(this.poweredBy);if(this.isFixed){this.map.viewPortDiv.appendChild(this.poweredBy)}else{this.map.layerContainerDiv.appendChild(this.poweredBy)}this.poweredBy.style.zIndex="1100";this.poweredBy.style.display=this.div.style.display;this.poweredBy.style.right="";this.poweredBy.style.bottom="";this.poweredBy.className="olLayerGooglePoweredBy gmnoprint"}catch(a){OpenLayers.Console.error(a)}},setMap:function(a){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);if(this.type!=null){this.map.events.register("moveend",this,this.setMapType)}},setMapType:function(){if(this.mapObject.getCenter()!=null){if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1){this.mapObject.addMapType(this.type)}this.mapObject.setMapType(this.type);this.map.events.unregister("moveend",this,this.setMapType)}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize()}else{if(!this._resized){var a=this;var b=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(b);delete a._resized;a.mapObject.checkResize();a.moveTo(a.map.getCenter(),a.map.getZoom())})}this._resized=true}},display:function(a){OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);this.termsOfUse.style.display=this.div.style.display;this.poweredBy.style.display=this.div.style.display},removeMap:function(a){if(this.termsOfUse&&this.termsOfUse.parentNode){this.termsOfUse.parentNode.removeChild(this.termsOfUse);this.termsOfUse=null}if(this.poweredBy&&this.poweredBy.parentNode){this.poweredBy.parentNode.removeChild(this.poweredBy);this.poweredBy=null}OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(b){var c=null;if(b!=null){var a=b.getSouthWest();var d=b.getNorthEast();if(this.sphericalMercator){a=this.forwardMercator(a.lng(),a.lat());d=this.forwardMercator(d.lng(),d.lat())}else{a=new OpenLayers.LonLat(a.lng(),a.lat());d=new OpenLayers.LonLat(d.lng(),d.lat())}c=new OpenLayers.Bounds(a.lon,a.lat,d.lon,d.lat)}return c},getMapObjectBoundsFromOLBounds:function(c){var b=null;if(c!=null){var a=this.sphericalMercator?this.inverseMercator(c.bottom,c.left):new OpenLayers.LonLat(c.bottom,c.left);var d=this.sphericalMercator?this.inverseMercator(c.top,c.right):new OpenLayers.LonLat(c.top,c.right);b=new GLatLngBounds(new GLatLng(a.lat,a.lon),new GLatLng(d.lat,d.lon))}return b},addContainerPxFunction:function(){if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){GMap2.prototype.fromLatLngToContainerPixel=function(b){var a=this.fromLatLngToDivPixel(b);var c=this.getContainer().firstChild.firstChild;a.x+=c.offsetLeft;a.y+=c.offsetTop;return a}}},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},setMapObjectCenter:function(a,b){this.mapObject.setCenter(a,b)},dragPanMapObject:function(b,a){this.dragObject.moveBy(new GSize(-b,a))},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.fromContainerPixelToLatLng(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.fromLatLngToContainerPixel(a)},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lon:a.lng()},getLatitudeFromMapObjectLonLat:function(b){var a=this.sphericalMercator?this.forwardMercator(b.lng(),b.lat()).lat:b.lat();return a},getMapObjectLonLatFromLonLat:function(d,b){var c;if(this.sphericalMercator){var a=this.inverseMercator(d,b);c=new GLatLng(a.lat,a.lon)}else{c=new GLatLng(b,d)}return c},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new GPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(c,b,d,a){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[]},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var g=0,b=this.grid.length;g<b;g++){var f=this.grid[g];for(var c=0,a=f.length;c<a;c++){var d=f[c];this.removeTileMonitoringHooks(d);d.destroy()}}this.grid=[]}},clone:function(a){if(a==null){a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},moveTo:function(d,a,f){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);d=d||this.map.getExtent();if(d!=null){var c=!this.grid.length||a;var b=this.getTilesBounds();if(this.singleTile){if(c||(!f&&!b.containsBounds(d))){this.initSingleTile(d)}}else{if(c||!b.containsBounds(d,true)){this.initGriddedTiles(d)}else{this.moveGriddedTiles(d)}}}},setTileSize:function(a){if(this.singleTile){a=this.map.getSize().clone();a.h=parseInt(a.h*this.ratio);a.w=parseInt(a.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])},getGridBounds:function(){var a="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(a);return this.getTilesBounds()},getTilesBounds:function(){var f=null;if(this.grid.length){var a=this.grid.length-1;var d=this.grid[a][0];var b=this.grid[0].length-1;var c=this.grid[0][b];f=new OpenLayers.Bounds(d.bounds.left,d.bounds.bottom,c.bounds.right,c.bounds.top)}return f},initSingleTile:function(g){var a=g.getCenterLonLat();var j=g.getWidth()*this.ratio;var b=g.getHeight()*this.ratio;var h=new OpenLayers.Bounds(a.lon-(j/2),a.lat-(b/2),a.lon+(j/2),a.lat+(b/2));var d=new OpenLayers.LonLat(h.left,h.top);var c=this.map.getLayerPxFromLonLat(d);if(!this.grid.length){this.grid[0]=[]}var f=this.grid[0][0];if(!f){f=this.addTile(h,c);this.addTileMonitoringHooks(f);f.draw();this.grid[0][0]=f}else{f.moveTo(h,c)}this.removeExcessTiles(1,1)},calculateGridLayout:function(a,s,f){var m=f*this.tileSize.w;var c=f*this.tileSize.h;var k=a.left-s.left;var o=Math.floor(k/m)-this.buffer;var l=k/m-o;var g=-l*this.tileSize.w;var q=s.left+o*m;var b=a.top-(s.bottom+c);var j=Math.ceil(b/c)+this.buffer;var r=j-b/c;var d=-r*this.tileSize.h;var h=s.bottom+j*c;return{tilelon:m,tilelat:c,tileoffsetlon:q,tileoffsetlat:h,tileoffsetx:g,tileoffsety:d}},initGriddedTiles:function(k){var h=this.map.getSize();var B=Math.ceil(h.h/this.tileSize.h)+Math.max(1,2*this.buffer);var D=Math.ceil(h.w/this.tileSize.w)+Math.max(1,2*this.buffer);var s=this.maxExtent;var v=this.map.getResolution();var u=this.calculateGridLayout(k,s,v);var g=Math.round(u.tileoffsetx);var c=Math.round(u.tileoffsety);var m=u.tileoffsetlon;var r=u.tileoffsetlat;var f=u.tilelon;var l=u.tilelat;this.origin=new OpenLayers.Pixel(g,c);var A=g;var C=m;var z=0;var a=parseInt(this.map.layerContainerDiv.style.left);var w=parseInt(this.map.layerContainerDiv.style.top);do{var j=this.grid[z++];if(!j){j=[];this.grid.push(j)}m=C;g=A;var d=0;do{var b=new OpenLayers.Bounds(m,r,m+f,r+l);var q=g;q-=a;var o=c;o-=w;var t=new OpenLayers.Pixel(q,o);var E=j[d++];if(!E){E=this.addTile(b,t);this.addTileMonitoringHooks(E);j.push(E)}else{E.moveTo(b,t,false)}m+=f;g+=this.tileSize.w}while((m<=k.right+f*this.buffer)||d<D);r-=l;c+=this.tileSize.h}while((r>=k.bottom-l*this.buffer)||z<B);this.removeExcessTiles(z,d);this.spiralTileLoad()},spiralTileLoad:function(){var b=[];var j=["right","down","left","up"];var h=0;var a=-1;var l=OpenLayers.Util.indexOf(j,"right");var m=0;while(m<j.length){var k=h;var c=a;switch(j[l]){case"right":c++;break;case"down":k++;break;case"left":c--;break;case"up":k--;break}var g=null;if((k<this.grid.length)&&(k>=0)&&(c<this.grid[0].length)&&(c>=0)){g=this.grid[k][c]}if((g!=null)&&(!g.queued)){b.unshift(g);g.queued=true;m=0;h=k;a=c}else{l=(l+1)%4;m++}}for(var d=0,f=b.length;d<f;d++){var g=b[d];g.draw();g.queued=false}},addTile:function(b,a){},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},moveGriddedTiles:function(c){var b=this.buffer||1;while(true){var a=this.grid[0][0].position;var d=this.map.getViewPortPxFromLayerPx(a);if(d.x>-this.tileSize.w*(b-1)){this.shiftColumn(true)}else{if(d.x<-this.tileSize.w*b){this.shiftColumn(false)}else{if(d.y>-this.tileSize.h*(b-1)){this.shiftRow(true)}else{if(d.y<-this.tileSize.h*b){this.shiftRow(false)}else{break}}}}}},shiftRow:function(q){var c=(q)?0:(this.grid.length-1);var b=this.grid;var g=b[c];var f=this.map.getResolution();var j=(q)?-this.tileSize.h:this.tileSize.h;var h=f*-j;var o=(q)?b.pop():b.shift();for(var k=0,m=g.length;k<m;k++){var d=g[k];var a=d.bounds.clone();var l=d.position.clone();a.bottom=a.bottom+h;a.top=a.top+h;l.y=l.y+j;o[k].moveTo(a,l)}if(q){b.unshift(o)}else{b.push(o)}},shiftColumn:function(o){var d=(o)?-this.tileSize.w:this.tileSize.w;var c=this.map.getResolution();var l=c*d;for(var f=0,h=this.grid.length;f<h;f++){var m=this.grid[f];var k=(o)?0:(m.length-1);var b=m[k];var a=b.bounds.clone();var g=b.position.clone();a.left=a.left+l;a.right=a.right+l;g.x=g.x+d;var j=o?this.grid[f].pop():this.grid[f].shift();j.moveTo(a,g);if(o){m.unshift(j)}else{m.push(j)}}},removeExcessTiles:function(f,c){while(this.grid.length>f){var g=this.grid.pop();for(var b=0,a=g.length;b<a;b++){var d=g[b];this.removeTileMonitoringHooks(d);d.destroy()}}while(this.grid[0].length>c){for(var b=0,a=this.grid.length;b<a;b++){var g=this.grid[b];var d=g.pop();this.removeTileMonitoringHooks(d);d.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(d){var c=this.maxExtent;var g=this.getResolution();var f=g*this.tileSize.w;var b=g*this.tileSize.h;var j=this.getLonLatFromViewPortPx(d);var a=c.left+(f*Math.floor((j.lon-c.left)/f));var h=c.bottom+(b*Math.floor((j.lat-c.bottom)/b));return new OpenLayers.Bounds(a,h,a+f,h+b)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Layer.MultiMap=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[9,1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125],type:null,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters();this.RESOLUTIONS.unshift(10)}},loadMapObject:function(){try{this.mapObject=new MultimapViewer(this.div)}catch(a){}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"MM",layerLib:"MultiMap"})},setMapObjectCenter:function(a,b){this.mapObject.goToPosition(a,b)},getMapObjectCenter:function(){return this.mapObject.getCurrentPosition()},getMapObjectZoom:function(){return this.mapObject.getZoomFactor()},getMapObjectLonLatFromMapObjectPixel:function(a){a.x=a.x-(this.map.getSize().w/2);a.y=a.y-(this.map.getSize().h/2);return this.mapObject.getMapPositionAt(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.geoPosToContainerPixels(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lon:a.lon},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lat:a.lat},getMapObjectLonLatFromLonLat:function(d,c){var a;if(this.sphericalMercator){var b=this.inverseMercator(d,c);a=new MMLatLon(b.lat,b.lon)}else{a=new MMLatLon(c,d)}return a},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new MMPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.MultiMap"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(b,a){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=new Array()},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadText:function(){if(!this.loaded){if(this.location!=null){var a=function(b){this.events.triggerEvent("loadend")};this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:a,scope:this});this.loaded=true}}},moveTo:function(c,a,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadText()}},parseData:function(l){var o=l.responseText;var r={};OpenLayers.Util.extend(r,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){r.externalProjection=this.projection;r.internalProjection=this.map.getProjectionObject()}var b=new OpenLayers.Format.Text(r);var c=b.read(o);for(var h=0,j=c.length;h<j;h++){var g={};var q=c[h];var m;var k,d;m=new OpenLayers.LonLat(q.geometry.x,q.geometry.y);if(q.style.graphicWidth&&q.style.graphicHeight){k=new OpenLayers.Size(q.style.graphicWidth,q.style.graphicHeight)}if(q.style.graphicXOffset!==undefined&&q.style.graphicYOffset!==undefined){d=new OpenLayers.Pixel(q.style.graphicXOffset,q.style.graphicYOffset)}if(q.style.externalGraphic!=null){g.icon=new OpenLayers.Icon(q.style.externalGraphic,k,d)}else{g.icon=OpenLayers.Marker.defaultIcon();if(k!=null){g.icon.setSize(k)}}if((q.attributes.title!=null)&&(q.attributes.description!=null)){g.popupContentHTML="<h2>"+q.attributes.title+"</h2><p>"+q.attributes.description+"</p>"}g.overflow=q.attributes.overflow||"auto";var a=new OpenLayers.Feature(this,m,g);this.features.push(a);var f=a.createMarker();if((q.attributes.title!=null)&&(q.attributes.description!=null)){f.events.register("click",a,this.markerClick)}this.addMarker(f)}this.events.triggerEvent("loadend")},markerClick:function(b){var d=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!d)?this:null;for(var c=0,a=this.layer.map.popups.length;c<a;c++){this.layer.map.removePopup(this.layer.map.popups[c])}if(!d){this.layer.map.addPopup(this.createPopup())}OpenLayers.Event.stop(b)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062],type:null,sphericalMercator:false,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){var a=OpenLayers.Util.createDiv(this.name);var c=this.map.getSize();a.style.width=c.w+"px";a.style.height=c.h+"px";this.div.appendChild(a);try{this.mapObject=new VEMap(this.name)}catch(b){}if(this.mapObject!=null){try{this.mapObject.LoadMap(null,null,this.type,true);this.mapObject.AttachEvent("onmousedown",function(){return true})}catch(b){}this.mapObject.HideDashboard()}if(!this.mapObject||!this.mapObject.vemapcontrol||!this.mapObject.vemapcontrol.PanMap||(typeof this.mapObject.vemapcontrol.PanMap!="function")){this.dragPanMapObject=null}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"VE",layerLib:"VirtualEarth"})},setMapObjectCenter:function(a,b){this.mapObject.SetCenterAndZoom(a,b)},getMapObjectCenter:function(){return this.mapObject.GetCenter()},dragPanMapObject:function(b,a){this.mapObject.vemapcontrol.PanMap(b,-a)},getMapObjectZoom:function(){return this.mapObject.GetZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(a){return(typeof VEPixel!="undefined")?this.mapObject.PixelToLatLong(a):this.mapObject.PixelToLatLong(a.x,a.y)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.LatLongToPixel(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Longitude,a.Latitude).lon:a.Longitude},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Longitude,a.Latitude).lat:a.Latitude},getMapObjectLonLatFromLonLat:function(d,b){var c;if(this.sphericalMercator){var a=this.inverseMercator(d,b);c=new VELatLong(a.lat,a.lon)}else{c=new VELatLong(b,d)}return c},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return(typeof VEPixel!="undefined")?new VEPixel(a,b):new Msn.VE.Pixel(a,b)},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031],type:null,sphericalMercator:false,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{var a=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new YMap(this.div,this.type,a);this.mapObject.disableKeyControls();this.mapObject.disableDragMap();if(!this.mapObject.moveByXY||(typeof this.mapObject.moveByXY!="function")){this.dragPanMapObject=null}}catch(b){}},onMapResize:function(){try{var a=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(a)}catch(b){}},setMap:function(a){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.fixYahooEventPane)},fixYahooEventPane:function(){var a=OpenLayers.Util.getElement("ygddfdiv");if(a!=null){if(a.parentNode!=null){a.parentNode.removeChild(a)}this.map.events.unregister("moveend",this,this.fixYahooEventPane)}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"Yahoo",layerLib:"Yahoo"})},getOLZoomFromMapObjectZoom:function(a){var b=null;if(a!=null){b=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[a]);b=18-b}return b},getMapObjectZoomFromOLZoom:function(a){var b=null;if(a!=null){b=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[a]);b=18-b}return b},setMapObjectCenter:function(a,b){this.mapObject.drawZoomAndCenter(a,b)},getMapObjectCenter:function(){return this.mapObject.getCenterLatLon()},dragPanMapObject:function(b,a){this.mapObject.moveByXY({x:-b,y:a})},getMapObjectZoom:function(){return this.mapObject.getZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.convertXYLatLon(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.convertLatLonXY(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Lon,a.Lat).lon:a.Lon},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.Lon,a.Lat).lat:a.Lat},getMapObjectLonLatFromLonLat:function(d,c){var a;if(this.sphericalMercator){var b=this.inverseMercator(d,c);a=new YGeoPoint(b.lat,b.lon)}else{a=new YGeoPoint(c,d)}return a},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new YCoordPoint(a,b)},getMapObjectSizeFromOLSize:function(a){return new YSize(a.w,a.h)},CLASS_NAME:"OpenLayers.Layer.Yahoo"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,initialize:function(a){this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments)},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(c,a,b){return OpenLayers.Function.bind(function(){c.apply(this,[a,b])},this)},read:function(a){a=OpenLayers.Util.applyDefaults(a,this.options);var b=(a.readWithPOST!==undefined)?a.readWithPOST:this.readWithPOST;var c=new OpenLayers.Protocol.Response({requestType:"read"});if(a.filter&&a.filter instanceof OpenLayers.Filter.Spatial){if(a.filter.type==OpenLayers.Filter.Spatial.BBOX){a.params=OpenLayers.Util.extend(a.params,{bbox:a.filter.value.toArray()})}}if(b){c.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,c,a),data:OpenLayers.Util.getParameterString(a.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}else{c.priv=OpenLayers.Request.GET({url:a.url,callback:this.createCallback(this.handleRead,c,a),params:a.params,headers:a.headers})}return c},handleRead:function(b,a){this.handleResponse(b,a)},create:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var c=new OpenLayers.Protocol.Response({reqFeatures:b,requestType:"create"});c.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleCreate,c,a),headers:a.headers,data:this.format.write(b)});return c},handleCreate:function(b,a){this.handleResponse(b,a)},update:function(c,b){var a=b.url||c.url||this.options.url;b=OpenLayers.Util.applyDefaults(b,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:c,requestType:"update"});d.priv=OpenLayers.Request.PUT({url:a,callback:this.createCallback(this.handleUpdate,d,b),headers:b.headers,data:this.format.write(c)});return d},handleUpdate:function(b,a){this.handleResponse(b,a)},"delete":function(c,b){var a=b.url||c.url||this.options.url;b=OpenLayers.Util.applyDefaults(b,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:c,requestType:"delete"});d.priv=OpenLayers.Request.DELETE({url:a,callback:this.createCallback(this.handleDelete,d,b),headers:b.headers});return d},handleDelete:function(b,a){this.handleResponse(b,a)},handleResponse:function(c,a){var b=c.priv;if(a.callback){if(b.status>=200&&b.status<300){if(c.requestType!="delete"){c.features=this.parseFeatures(b)}c.code=OpenLayers.Protocol.Response.SUCCESS}else{c.code=OpenLayers.Protocol.Response.FAILURE}a.callback.call(a.scope,c)}},parseFeatures:function(a){var b=a.responseXML;if(!b||!b.documentElement){b=a.responseText}if(!b||b.length<=0){return null}return this.format.read(b)},commit:function(b,t){t=OpenLayers.Util.applyDefaults(t,this.options);var d=[],o=0;var l={};l[OpenLayers.State.INSERT]=[];l[OpenLayers.State.UPDATE]=[];l[OpenLayers.State.DELETE]=[];var s,m,c=[];for(var f=0,k=b.length;f<k;++f){s=b[f];m=l[s.state];if(m){m.push(s);c.push(s)}}var h=(l[OpenLayers.State.INSERT].length>0?1:0)+l[OpenLayers.State.UPDATE].length+l[OpenLayers.State.DELETE].length;var r=true;var a=new OpenLayers.Protocol.Response({reqFeatures:c});function j(v){var u=v.features?v.features.length:0;var z=new Array(u);for(var w=0;w<u;++w){z[w]=v.features[w].fid}a.insertIds=z;q.apply(this,[v])}function q(u){this.callUserCallback(u,t);r=r&&u.success();o++;if(o>=h){if(t.callback){a.code=r?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;t.callback.apply(t.scope,[a])}}}var g=l[OpenLayers.State.INSERT];if(g.length>0){d.push(this.create(g,OpenLayers.Util.applyDefaults({callback:j,scope:this},t.create)))}g=l[OpenLayers.State.UPDATE];for(var f=g.length-1;f>=0;--f){d.push(this.update(g[f],OpenLayers.Util.applyDefaults({callback:q,scope:this},t.update)))}g=l[OpenLayers.State.DELETE];for(var f=g.length-1;f>=0;--f){d.push(this["delete"](g[f],OpenLayers.Util.applyDefaults({callback:q,scope:this},t["delete"])))}return d},abort:function(a){if(a){a.priv.abort()}},callUserCallback:function(c,a){var b=a[c.requestType];if(b&&b.callback){b.callback.call(b.scope,c)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(b,a){OpenLayers.Util.extend(this,a);this.rules=[];if(a&&a.rules){this.addRules(a.rules)}this.setDefaultStyle(b||OpenLayers.Feature.Vector.style["default"])},destroy:function(){for(var b=0,a=this.rules.length;b<a;b++){this.rules[b].destroy();this.rules[b]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(l){var a=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),l);var k=this.rules;var j,b;var c=[];var g=false;for(var d=0,f=k.length;d<f;d++){j=k[d];var h=j.evaluate(l);if(h){if(j instanceof OpenLayers.Rule&&j.elseFilter){c.push(j)}else{g=true;this.applySymbolizer(j,a,l)}}}if(g==false&&c.length>0){g=true;for(var d=0,f=c.length;d<f;d++){this.applySymbolizer(c[d],a,l)}}if(k.length>0&&g==false){a.display="none"}return a},applySymbolizer:function(g,d,b){var a=b.geometry?this.getSymbolizerPrefix(b.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var c=g.symbolizer[a]||g.symbolizer;if(this.defaultsPerSymbolizer===true){var f=this.defaultStyle;OpenLayers.Util.applyDefaults(c,{pointRadius:f.pointRadius});if(c.stroke===true||c.graphic===true){OpenLayers.Util.applyDefaults(c,{strokeWidth:f.strokeWidth,strokeColor:f.strokeColor,strokeOpacity:f.strokeOpacity,strokeDashstyle:f.strokeDashstyle,strokeLinecap:f.strokeLinecap})}if(c.fill===true||c.graphic===true){OpenLayers.Util.applyDefaults(c,{fillColor:f.fillColor,fillOpacity:f.fillOpacity})}if(c.graphic===true){OpenLayers.Util.applyDefaults(c,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}}return this.createLiterals(OpenLayers.Util.extend(d,c),b)},createLiterals:function(d,c){var b=this.context||c.attributes||c.data;for(var a in this.propertyStyles){d[a]=OpenLayers.Style.createLiteral(d[a],b,c)}return d},findPropertyStyles:function(){var d={};var g=this.defaultStyle;this.addPropertyStyles(d,g);var j=this.rules;var f,h;for(var c=0,a=j.length;c<a;c++){f=j[c].symbolizer;for(var b in f){h=f[b];if(typeof h=="object"){this.addPropertyStyles(d,h)}else{this.addPropertyStyles(d,f);break}}}return d},addPropertyStyles:function(b,c){var d;for(var a in c){d=c[a];if(typeof d=="string"&&d.match(/\$\{\w+\}/)){b[a]=true}}return b},addRules:function(a){this.rules=this.rules.concat(a);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(a){this.defaultStyle=a;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(d){var c=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var b=0,a=c.length;b<a;b++){if(d.CLASS_NAME.indexOf(c[b])!=-1){return c[b]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(c,b,a){if(typeof c=="string"&&c.indexOf("${")!=-1){c=OpenLayers.String.format(c,b,[a]);c=(isNaN(c)||!c)?c:parseFloat(c)}return c};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,initialize:function(a){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy()}this.zoomBox=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate()}this.handlers.click.activate();this.zoomBox.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks){this.map.viewPortDiv.oncontextmenu=function(){return false}}var a={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var b={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,a,b);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown});this.activate()},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1)},defaultDblRightClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom-1)},wheelChange:function(j,c){var g=this.map.getZoom()+c;if(!this.map.isValidZoomLevel(g)){return}var k=this.map.getSize();var f=k.w/2-j.xy.x;var d=j.xy.y-k.h/2;var h=this.map.baseLayer.getResolutionForZoom(g);var a=this.map.getLonLatFromPixel(j.xy);var b=new OpenLayers.LonLat(a.lon+f*h,a.lat+d*h);this.map.setCenter(b,g)},wheelUp:function(a){this.wheelChange(a,1)},wheelDown:function(a){this.wheelChange(a,-1)},disableZoomWheel:function(){this.zoomWheelEnabled=false;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=true;if(this.active){this.handlers.wheel.activate()}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Filter=OpenLayers.Class({initialize:function(a){OpenLayers.Util.extend(this,a)},destroy:function(){},evaluate:function(a){return true},clone:function(){return null},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(a){if(a){this.bounds=a.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(b){var a=this.getBounds();if(!a){this.setBounds(b)}else{this.bounds.extend(b)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(b,a){},getVertices:function(a){},atPoint:function(f,j,g){var c=false;var d=this.getBounds();if((d!=null)&&(f!=null)){var b=(j!=null)?j:0;var a=(g!=null)?g:0;var h=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-a,this.bounds.right+b,this.bounds.top+a);c=h.containsLonLat(f)}return c},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(g){var h=arguments.callee.format;if(!h){h=new OpenLayers.Format.WKT();arguments.callee.format=h}var d;var b=h.read(g);if(b instanceof OpenLayers.Feature.Vector){d=b.geometry}else{if(b instanceof Array){var a=b.length;var f=new Array(a);for(var c=0;c<a;++c){f[c]=b[c].geometry}d=new OpenLayers.Geometry.Collection(f)}}return d};OpenLayers.Geometry.segmentsIntersect=function(a,J,b){var u=b&&b.point;var B=b&&b.tolerance;var g=false;var D=a.x1-J.x1;var H=a.y1-J.y1;var r=a.x2-a.x1;var A=a.y2-a.y1;var v=J.y2-J.y1;var m=J.x2-J.x1;var F=(v*r)-(m*A);var f=(m*H)-(v*D);var c=(r*H)-(A*D);if(F==0){if(f==0&&c==0){g=true}}else{var G=f/F;var E=c/F;if(G>=0&&G<=1&&E>=0&&E<=1){if(!u){g=true}else{var k=a.x1+(G*r);var h=a.y1+(G*A);g=new OpenLayers.Geometry.Point(k,h)}}}if(B){var t;if(g){if(u){var q=[a,J];var C,k,h;outer:for(var z=0;z<2;++z){C=q[z];for(var w=1;w<3;++w){k=C["x"+w];h=C["y"+w];t=Math.sqrt(Math.pow(k-g.x,2)+Math.pow(h-g.y,2));if(t<B){g.x=k;g.y=h;break outer}}}}}else{var q=[a,J];var s,I,k,h,o,l;outer:for(var z=0;z<2;++z){s=q[z];I=q[(z+1)%2];for(var w=1;w<3;++w){o={x:s["x"+w],y:s["y"+w]};l=OpenLayers.Geometry.distanceToSegment(o,I);if(l.distance<B){if(u){g=new OpenLayers.Geometry.Point(o.x,o.y)}else{g=true}break outer}}}}}return g};OpenLayers.Geometry.distanceToSegment=function(m,d){var c=m.x;var l=m.y;var b=d.x1;var k=d.y1;var a=d.x2;var g=d.y2;var q=a-b;var o=g-k;var j=((q*(c-b))+(o*(l-k)))/(Math.pow(q,2)+Math.pow(o,2));var h,f;if(j<=0){h=b;f=k}else{if(j>=1){h=a;f=g}else{h=b+j*q;f=k+j*o}}return{distance:Math.sqrt(Math.pow(h-c,2)+Math.pow(f-l,2)),x:h,y:f}};OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:true,initialize:function(d,c,f,b){var a=[];f=OpenLayers.Util.upperCaseObject(f);a.push(d,c,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="jpg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(f){f=this.adjustBounds(f);var d=this.projection.getCode().split(":");var c=d[d.length-1];var h=this.getImageSize();var j={BBOX:f.toBBOX(),SIZE:h.w+","+h.h,F:"image",BBOXSR:c,IMAGESR:c};if(this.layerDefs){var g=[];var a;for(a in this.layerDefs){if(this.layerDefs.hasOwnProperty(a)){if(this.layerDefs[a]){g.push(a);g.push(":");g.push(this.layerDefs[a]);g.push(";")}}}if(g.length>0){j.LAYERDEFS=g.join("")}}var b=this.getFullRequestString(j);return b},setLayerFilter:function(b,a){if(!this.layerDefs){this.layerDefs={}}if(a){this.layerDefs[b]=a}else{delete this.layerDefs[b]}},clearLayerFilter:function(a){if(a){delete this.layerDefs[a]}else{delete this.layerDefs}},mergeNewParams:function(c){var b=OpenLayers.Util.upperCaseObject(c);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(d,c,f,b){var a=[];a.push(d,c,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(c){c=this.adjustBounds(c);var d=this.map.getResolution();var f=Math.round((this.map.getScale()*10000))/10000;var b=Math.round(c.left/d);var a=-Math.round(c.top/d);return this.getFullRequestString({t:a,l:b,s:f})},addTile:function(c,a){var b=this.getURL(c);return new OpenLayers.Tile.Image(this,a,c,b,this.tileSize)},calculateGridLayout:function(a,s,f){var m=f*this.tileSize.w;var c=f*this.tileSize.h;var k=a.left;var o=Math.floor(k/m)-this.buffer;var l=k/m-o;var g=-l*this.tileSize.w;var q=o*m;var b=a.top;var j=Math.ceil(b/c)+this.buffer;var r=j-b/c;var d=-(r+1)*this.tileSize.h;var h=j*c;return{tilelon:m,tilelat:c,tileoffsetlon:q,tileoffsetlat:h,tileoffsetx:g,tileoffsety:d}},clone:function(a){if(a==null){a=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},getTileBounds:function(c){var f=this.getResolution();var d=f*this.tileSize.w;var b=f*this.tileSize.h;var h=this.getLonLatFromViewPortPx(c);var a=d*Math.floor(h.lon/d);var g=b*Math.floor(h.lat/b);return new OpenLayers.Bounds(a,g,a+d,g+b)},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,useHttpTile:false,singleTile:false,useOverlay:false,useAsyncOverlay:true,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"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(c,b,d,a){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(a==null||a.isBaseLayer==null){this.isBaseLayer=((this.transparent!="true")&&(this.transparent!=true))}if(a&&a.useOverlay!=null){this.useOverlay=a.useOverlay}if(this.singleTile){if(this.useOverlay){OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS);if(!this.useAsyncOverlay){this.params.version="1.0.0"}}else{OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS)}}else{if(this.useHttpTile){OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS)}else{OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS)}this.setTileSize(this.defaultSize)}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(a){var d;var b=a.getCenterLonLat();var j=this.map.getCurrentSize();if(this.singleTile){var f={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:j.h*this.ratio,setdisplaywidth:j.w*this.ratio,setviewcenterx:b.lon,setviewcentery:b.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var k={};k=OpenLayers.Util.extend(k,f);k.operation="GETVISIBLEMAPEXTENT";k.version="1.0.0";k.session=this.params.session;k.mapName=this.params.mapName;k.format="text/xml";d=this.getFullRequestString(k);OpenLayers.Request.GET({url:d,async:false})}d=this.getFullRequestString(f)}else{var h=this.map.getResolution();var g=Math.floor((a.left-this.maxExtent.left)/h);g=Math.round(g/this.tileSize.w);var c=Math.floor((this.maxExtent.top-a.top)/h);c=Math.round(c/this.tileSize.h);if(this.useHttpTile){d=this.getImageFilePath({tilecol:g,tilerow:c,scaleindex:this.resolutions.length-this.map.zoom-1})}else{d=this.getFullRequestString({tilecol:g,tilerow:c,scaleindex:this.resolutions.length-this.map.zoom-1})}}return d},getFullRequestString:function(g,f){var b=(f==null)?this.url:f;if(typeof b=="object"){b=b[Math.floor(Math.random()*b.length)]}var k=b;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var d=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(b));for(var j in h){if(j.toUpperCase() in d){delete h[j]}}var a=OpenLayers.Util.getParameterString(h);a=a.replace(/,/g,"+");if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){k+=a}else{if(b.indexOf("?")==-1){k+="?"+a}else{k+="&"+a}}}return k},getImageFilePath:function(h,f){var c=(f==null)?this.url:f;if(typeof c=="object"){c=c[Math.floor(Math.random()*c.length)]}var b=c;var d="";var g="";if(h.tilerow<0){d="-"}if(h.tilerow==0){d+="0"}else{d+=Math.floor(Math.abs(h.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(h.tilecol<0){g="-"}if(h.tilecol==0){g+="0"}else{g+=Math.floor(Math.abs(h.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var a="/S"+Math.floor(h.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+d+"/C"+g+"/"+(h.tilerow%this.params.tileRowsPerFolder)+"_"+(h.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){a+="?"+this.params.querystring}b+=a;return b},calculateGridLayout:function(a,s,f){var m=f*this.tileSize.w;var c=f*this.tileSize.h;var k=a.left-s.left;var o=Math.floor(k/m)-this.buffer;var l=k/m-o;var g=-l*this.tileSize.w;var q=s.left+o*m;var b=s.top-a.top+c;var j=Math.floor(b/c)-this.buffer;var r=j-b/c;var d=r*this.tileSize.h;var h=s.top-c*j;return{tilelon:m,tilelat:c,tileoffsetlon:q,tileoffsetlat:h,tileoffsetx:g,tileoffsety:d}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(d,c,f,b){var a=[];a.push(d,c,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(b==null||b.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(c){c=this.adjustBounds(c);var b=[c.left,c.bottom,c.right,c.top];var d=this.getImageSize();var a=this.getFullRequestString({mapext:b,imgext:b,map_size:[d.w,d.h],imgx:d.w/2,imgy:d.h/2,imgxy:[d.w,d.h]});return a},getFullRequestString:function(g,f){var b=(f==null)?this.url:f;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var a=OpenLayers.Util.getParameterString(h);if(b instanceof Array){b=this.selectUrl(a,b)}var d=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var j in h){if(j.toUpperCase() in d){delete h[j]}}a=OpenLayers.Util.getParameterString(h);var k=b;a=a.replace(/,/g,"+");if(a!=""){var c=b.charAt(b.length-1);if((c=="&")||(c=="?")){k+=a}else{if(b.indexOf("?")==-1){k+="?"+a}else{k+="&"+a}}}return k},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",isBaseLayer:true,tileOrigin:null,serverResolutions:null,initialize:function(d,c,b){var a=[];a.push(d,c,{},b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.TMS(this.name,this.url,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(d){d=this.adjustBounds(d);var c=this.map.getResolution();var a=Math.round((d.left-this.tileOrigin.lon)/(c*this.tileSize.w));var h=Math.round((d.bottom-this.tileOrigin.lat)/(c*this.tileSize.h));var g=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,c):this.map.getZoom();var f=this.serviceVersion+"/"+this.layername+"/"+g+"/"+a+"/"+h+"."+this.type;var b=this.url;if(b instanceof Array){b=this.selectUrl(f,b)}return b+f},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.TMS"});OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,format:"image/png",serverResolutions:null,initialize:function(c,b,d,a){this.layername=d;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[c,b,{},a]);this.extension=this.format.split("/")[1].toLowerCase();this.extension=(this.extension=="jpg")?"jpeg":this.extension},clone:function(a){if(a==null){a=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){var g=this.map.getResolution();var h=this.maxExtent;var m=this.tileSize;var a=Math.round((b.left-h.left)/(g*m.w));var l=Math.round((b.bottom-h.bottom)/(g*m.h));var j=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,g):this.map.getZoom();function f(s,r){s=String(s);var o=[];for(var q=0;q<r;++q){o.push("0")}return o.join("").substring(0,r-s.length)+s}var d=[this.layername,f(j,2),f(parseInt(a/1000000),3),f((parseInt(a/1000)%1000),3),f((parseInt(a)%1000),3),f(parseInt(l/1000000),3),f((parseInt(l/1000)%1000),3),f((parseInt(l)%1000),3)+"."+this.extension];var k=d.join("/");var c=this.url;if(c instanceof Array){c=this.selectUrl(k,c)}c=(c.charAt(c.length-1)=="/")?c:c+"/";return c+k},addTile:function(c,a){var b=this.getURL(c);return new OpenLayers.Tile.Image(this,a,c,b,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,noMagic:false,initialize:function(d,c,f,b){var a=[];f=OpenLayers.Util.upperCaseObject(f);a.push(d,c,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){b=this.adjustBounds(b);var c=this.getImageSize();var d={BBOX:this.encodeBBOX?b.toBBOX():b.toArray(),WIDTH:c.w,HEIGHT:c.h};var a=this.getFullRequestString(d);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},mergeNewParams:function(c){var b=OpenLayers.Util.upperCaseObject(c);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},getFullRequestString:function(c,b){var a=this.map.getProjection();this.params.SRS=(a=="none")?null:a;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:true,lzd:null,zoomLevels:null,initialize:function(d,c,f,h,g,b){this.lzd=f;this.zoomLevels=h;var a=[];a.push(d,c,g,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getZoom:function(){var b=this.map.getZoom();var a=this.map.getMaxExtent();b=b-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2);return b},getURL:function(f){f=this.adjustBounds(f);var d=this.getZoom();var b=this.map.getMaxExtent();var c=this.lzd/Math.pow(2,this.getZoom());var a=Math.floor((f.left-b.left)/c);var g=Math.floor((f.bottom-b.bottom)/c);if(this.map.getResolution()<=(this.lzd/512)&&this.getZoom()<=this.zoomLevels){return this.getFullRequestString({L:d,X:a,Y:g})}else{return OpenLayers.Util.getImagesLocation()+"blank.gif"}},CLASS_NAME:"OpenLayers.Layer.WorldWind"});OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,sphericalMercator:false,initialize:function(d,c,b){if(b&&b.sphericalMercator||this.sphericalMercator){b=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-128*156543.0339,-128*156543.0339,128*156543.0339,128*156543.0339),maxResolution:156543.0339,numZoomLevels:19,units:"m",projection:"EPSG:900913"},b)}c=c||this.url;d=d||this.name;var a=[d,c,{},b];OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},clone:function(a){if(a==null){a=new OpenLayers.Layer.XYZ(this.name,this.url,this.options)}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},getURL:function(a){var d=this.map.getResolution();var h=Math.round((a.left-this.maxExtent.left)/(d*this.tileSize.w));var g=Math.round((this.maxExtent.top-a.top)/(d*this.tileSize.h));var f=this.map.getZoom();var c=Math.pow(2,f);var b=this.url;var k=""+h+g+f;if(b instanceof Array){b=this.selectUrl(k,b)}var j=OpenLayers.String.format(b,{x:h,y:g,z:f});return j},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>",sphericalMercator:true,url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Protocol.SQL.Gears=OpenLayers.Class(OpenLayers.Protocol.SQL,{FID_PREFIX:"__gears_fid__",NULL_GEOMETRY:"__gears_null_geometry__",NULL_FEATURE_STATE:"__gears_null_feature_state__",jsonParser:null,wktParser:null,fidRegExp:null,saveFeatureState:true,typeOfFid:"string",db:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Protocol.SQL.prototype.initialize.apply(this,[a]);this.jsonParser=new OpenLayers.Format.JSON();this.wktParser=new OpenLayers.Format.WKT();this.fidRegExp=new RegExp("^"+this.FID_PREFIX);this.initializeDatabase()},initializeDatabase:function(){this.db=google.gears.factory.create("beta.database");this.db.open(this.databaseName);this.db.execute("CREATE TABLE IF NOT EXISTS "+this.tableName+" (fid TEXT UNIQUE, geometry TEXT, properties TEXT,  state TEXT)")},destroy:function(){this.db.close();this.db=null;this.jsonParser=null;this.wktParser=null;OpenLayers.Protocol.SQL.prototype.destroy.apply(this)},supported:function(){return !!(window.google&&google.gears)},read:function(b){b=OpenLayers.Util.applyDefaults(b,this.options);var c,d=[];var a=this.db.execute("SELECT * FROM "+this.tableName);while(a.isValidRow()){c=this.unfreezeFeature(a);if(this.evaluateFilter(c,b.filter)){if(!b.noFeatureStateReset){c.state=null}d.push(c)}a.next()}a.close();var f=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"read",features:d});if(b&&b.callback){b.callback.call(b.scope,f)}return f},unfreezeFeature:function(d){var a;var b=d.fieldByName("geometry");if(b==this.NULL_GEOMETRY){a=new OpenLayers.Feature.Vector()}else{a=this.wktParser.read(b)}a.attributes=this.jsonParser.read(d.fieldByName("properties"));a.fid=this.extractFidFromField(d.fieldByName("fid"));var c=d.fieldByName("state");if(c==this.NULL_FEATURE_STATE){c=null}a.state=c;return a},extractFidFromField:function(a){if(!a.match(this.fidRegExp)&&this.typeOfFid=="number"){a=parseFloat(a)}return a},create:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var c=this.createOrUpdate(b);c.requestType="create";if(a&&a.callback){a.callback.call(a.scope,c)}return c},update:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var c=this.createOrUpdate(b);c.requestType="update";if(a&&a.callback){a.callback.call(a.scope,c)}return c},createOrUpdate:function(f){if(!(f instanceof Array)){f=[f]}var c,a=f.length,b;var d=new Array(a);for(c=0;c<a;c++){b=f[c];var g=this.freezeFeature(b);this.db.execute("REPLACE INTO "+this.tableName+" (fid, geometry, properties, state) VALUES (?, ?, ?, ?)",g);var h=b.clone();h.fid=this.extractFidFromField(g[0]);d[c]=h}return new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,features:d,reqFeatures:f})},freezeFeature:function(b){b.fid=b.fid!=null?""+b.fid:OpenLayers.Util.createUniqueID(this.FID_PREFIX);var d=b.geometry!=null?b.geometry.toString():this.NULL_GEOMETRY;var a=this.jsonParser.write(b.attributes);var c=this.getFeatureStateForFreeze(b);return[b.fid,d,a,c]},getFeatureStateForFreeze:function(a){var b;if(!this.saveFeatureState){b=this.NULL_FEATURE_STATE}else{if(this.createdOffline(a)){b=OpenLayers.State.INSERT}else{b=a.state}}return b},"delete":function(g,c){if(!(g instanceof Array)){g=[g]}c=OpenLayers.Util.applyDefaults(c,this.options);var f,a,d;for(f=0,a=g.length;f<a;f++){d=g[f];if(this.saveFeatureState&&!this.createdOffline(d)){var b=d.clone();b.fid=d.fid;if(b.geometry){b.geometry.destroy();b.geometry=null}b.state=d.state;this.createOrUpdate(b)}else{this.db.execute("DELETE FROM "+this.tableName+" WHERE fid = ?",[d.fid])}}var h=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"delete",reqFeatures:g});if(c&&c.callback){c.callback.call(c.scope,h)}return h},createdOffline:function(a){return(typeof a.fid=="string"&&!!(a.fid.match(this.fidRegExp)))},commit:function(c,o){var b,f=[],h=0,j=0;function l(q){if(++j<h){q.last=false}this.callUserCallback(o,q)}var m,k=[],a=[],d=[];for(var g=c.length-1;g>=0;g--){m=c[g];switch(m.state){case OpenLayers.State.INSERT:k.push(m);break;case OpenLayers.State.UPDATE:a.push(m);break;case OpenLayers.State.DELETE:d.push(m);break}}if(k.length>0){h++;b=OpenLayers.Util.applyDefaults({callback:l,scope:this},o.create);f.push(this.create(k,b))}if(a.length>0){h++;b=OpenLayers.Util.applyDefaults({callback:l,scope:this},o.update);f.push(this.update(a,b))}if(d.length>0){h++;b=OpenLayers.Util.applyDefaults({callback:l,scope:this},o["delete"]);f.push(this["delete"](d,b))}return f},clear:function(){this.db.execute("DELETE FROM "+this.tableName)},callUserCallback:function(a,c){var b=a[c.requestType];if(b&&b.callback){b.callback.call(b.scope,c)}if(c.last&&a.callback){a.callback.call(a.scope)}},CLASS_NAME:"OpenLayers.Protocol.SQL.Gears"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a in this.symbolizer){this.symbolizer[a]=null}this.symbolizer=null},evaluate:function(c){var b=this.getContext(c);var a=true;if(this.minScaleDenominator||this.maxScaleDenominator){var d=c.layer.map.getScale()}if(this.minScaleDenominator){a=d>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b)}if(a&&this.maxScaleDenominator){a=d<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b)}if(a&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){a=this.filter.evaluate(c)}else{a=this.filter.evaluate(b)}}return a},getContext:function(b){var a=this.context;if(!a){a=b.attributes||b.data}if(typeof this.context=="function"){a=this.context(b)}return a},clone:function(){var a=OpenLayers.Util.extend({},this);a.symbolizer={};for(var b in this.symbolizer){value=this.symbolizer[b];type=typeof value;if(type==="object"){a.symbolizer[b]=OpenLayers.Util.extend({},value)}else{if(type==="string"){a.symbolizer[b]=value}}}a.filter=this.filter&&this.filter.clone();a.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(a)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(c,a){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(c instanceof OpenLayers.Style){this.styles["default"]=c;this.styles.select=c;this.styles.temporary=c;this.styles["delete"]=c}else{if(typeof c=="object"){for(var b in c){if(c[b] instanceof OpenLayers.Style){this.styles[b]=c[b]}else{if(typeof c[b]=="object"){this.styles[b]=new OpenLayers.Style(c[b])}else{this.styles["default"]=new OpenLayers.Style(c);this.styles.select=new OpenLayers.Style(c);this.styles.temporary=new OpenLayers.Style(c);this.styles["delete"]=new OpenLayers.Style(c);break}}}}}OpenLayers.Util.extend(this,a)},destroy:function(){for(var a in this.styles){this.styles[a].destroy()}this.styles=null},createSymbolizer:function(b,c){if(!b){b=new OpenLayers.Feature.Vector()}if(!this.styles[c]){c="default"}b.renderIntent=c;var a={};if(this.extendDefault&&c!="default"){a=this.styles["default"].createSymbolizer(b)}return OpenLayers.Util.extend(a,this.styles[c].createSymbolizer(b))},addUniqueValueRules:function(b,d,g,a){var f=[];for(var c in g){f.push(new OpenLayers.Rule({symbolizer:g[c],context:a,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:d,value:c})}))}this.styles[b].addRules(f)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Navigation(),new OpenLayers.Control.ZoomBox()])},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:true,lowerBoundary:null,upperBoundary:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(c){var a=false;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:var b=c[this.property];var f=this.value;if(!this.matchCase&&typeof b=="string"&&typeof f=="string"){a=(b.toUpperCase()==f.toUpperCase())}else{a=(b==f)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:var b=c[this.property];var f=this.value;if(!this.matchCase&&typeof b=="string"&&typeof f=="string"){a=(b.toUpperCase()!=f.toUpperCase())}else{a=(b!=f)}break;case OpenLayers.Filter.Comparison.LESS_THAN:a=c[this.property]<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:a=c[this.property]>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:a=c[this.property]<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:a=c[this.property]>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:a=(c[this.property]>=this.lowerBoundary)&&(c[this.property]<=this.upperBoundary);break;case OpenLayers.Filter.Comparison.LIKE:var d=new RegExp(this.value,"gi");a=d.test(c[this.property]);break}return a},value2regex:function(d,b,a){if(d=="."){var c="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";OpenLayers.Console.error(c);return null}d=d?d:"*";b=b?b:".";a=a?a:"!";this.value=this.value.replace(new RegExp("\\"+a+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+b,"g"),".");this.value=this.value.replace(new RegExp("\\"+d,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+d);this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+b);return this.value},regex2value:function(){var a=this.value;a=a.replace(/!/g,"!!");a=a.replace(/(\\)?\\\./g,function(c,b){return b?c:"!."});a=a.replace(/(\\)?\\\*/g,function(c,b){return b?c:"!*"});a=a.replace(/\\\\/g,"\\");a=a.replace(/\.\*/g,"*");return a},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison(),this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(a){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(c){for(var b=0,a=this.fids.length;b<a;b++){var d=c.fid||c.id;if(d==this.fids[b]){return true}}return false},clone:function(){var a=new OpenLayers.Filter.FeatureId();OpenLayers.Util.extend(a,this);a.fids=this.fids.slice();return a},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(a){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(c){switch(this.type){case OpenLayers.Filter.Logical.AND:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(c)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(c)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(c))}},clone:function(){var c=[];for(var b=0,a=this.filters.length;b<a;++b){c.push(this.filters[b].clone())}return new OpenLayers.Filter.Logical({type:this.type,filters:c})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(c){var a=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(c.geometry){var b=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){b=this.value.toGeometry()}if(c.geometry.intersects(b)){a=true}}break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));break}return a},clone:function(){var a=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(a)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(a!=null){this.addComponents(a)}},destroy:function(){this.components.length=0;this.components=null},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var b=[];for(var c=0,a=this.components.length;c<a;c++){b.push(this.components[c].toShortString())}return b.join(",")},calculateBounds:function(){this.bounds=null;if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var b=1,a=this.components.length;b<a;b++){this.extendBounds(this.components[b].getBounds())}}},addComponents:function(c){if(!(c instanceof Array)){c=[c]}for(var b=0,a=c.length;b<a;b++){this.addComponent(c[b])}},addComponent:function(b,a){var d=false;if(b){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,b.CLASS_NAME)>-1)){if(a!=null&&(a<this.components.length)){var f=this.components.slice(0,a);var c=this.components.slice(a,this.components.length);f.push(b);this.components=f.concat(c)}else{this.components.push(b)}b.parent=this;this.clearBounds();d=true}}return d},removeComponents:function(b){if(!(b instanceof Array)){b=[b]}for(var a=b.length-1;a>=0;--a){this.removeComponent(b[a])}},removeComponent:function(a){OpenLayers.Util.removeItem(this.components,a);this.clearBounds()},getLength:function(){var c=0;for(var b=0,a=this.components.length;b<a;b++){c+=this.components[b].getLength()}return c},getArea:function(){var c=0;for(var b=0,a=this.components.length;b<a;b++){c+=this.components[b].getArea()}return c},getGeodesicArea:function(b){var d=0;for(var c=0,a=this.components.length;c<a;c++){d+=this.components[c].getGeodesicArea(b)}return d},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(b){var d=0;for(var c=0,a=this.components.length;c<a;c++){d+=this.components[c].getGeodesicLength(b)}return d},move:function(b,d){for(var c=0,a=this.components.length;c<a;c++){this.components[c].move(b,d)}},rotate:function(d,b){for(var c=0,a=this.components.length;c<a;++c){this.components[c].rotate(d,b)}},resize:function(d,a,c){for(var b=0;b<this.components.length;++b){this.components[b].resize(d,a,c)}return this},distanceTo:function(h,j){var b=!(j&&j.edge===false);var a=b&&j&&j.details;var k,c;var d=Number.POSITIVE_INFINITY;for(var f=0,g=this.components.length;f<g;++f){k=this.components[f].distanceTo(h,j);distance=a?k.distance:k;if(distance<d){d=distance;c=k;if(d==0){break}}}return c},equals:function(d){var b=true;if(!d||!d.CLASS_NAME||(this.CLASS_NAME!=d.CLASS_NAME)){b=false}else{if(!(d.components instanceof Array)||(d.components.length!=this.components.length)){b=false}else{for(var c=0,a=this.components.length;c<a;++c){if(!this.components[c].equals(d.components[c])){b=false;break}}}}return b},transform:function(f,c){if(f&&c){for(var d=0,a=this.components.length;d<a;d++){var b=this.components[d];b.transform(f,c)}this.bounds=null}return this},intersects:function(d){var b=false;for(var c=0,a=this.components.length;c<a;++c){b=d.intersects(this.components[c]);if(b){break}}return b},getVertices:function(b){var c=[];for(var d=0,a=this.components.length;d<a;++d){Array.prototype.push.apply(c,this.components[d].getVertices(b))}return c},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(a,b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(b)},clone:function(a){if(a==null){a=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(g,l){var d=!(l&&l.edge===false);var a=d&&l&&l.details;var b,f,j,c,h,k;if(g instanceof OpenLayers.Geometry.Point){f=this.x;j=this.y;c=g.x;h=g.y;b=Math.sqrt(Math.pow(f-c,2)+Math.pow(j-h,2));k=!a?b:{x0:f,y0:j,x1:c,y1:h,distance:b}}else{k=g.distanceTo(this,l);if(a){k={x0:k.x1,y0:k.y1,x1:k.x0,y1:k.y0,distance:k.distance}}}return k},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},toShortString:function(){return(this.x+", "+this.y)},move:function(a,b){this.x=this.x+a;this.y=this.y+b;this.clearBounds()},rotate:function(d,b){d*=Math.PI/180;var a=this.distanceTo(b);var c=d+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+(a*Math.cos(c));this.y=b.y+(a*Math.sin(c));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(c,a,b){b=(b==undefined)?1:b;this.x=a.x+(c*b*(this.x-a.x));this.y=a.y+(c*(this.y-a.y));this.clearBounds();return this},intersects:function(b){var a=false;if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.equals(b)}else{a=b.intersects(this)}return a},transform:function(b,a){if((b&&a)){OpenLayers.Projection.transform(this,b,a);this.bounds=null}return this},getVertices:function(a){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(b,d,c,a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=b;this.y=d;this.width=c;this.height=a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)},getLength:function(){var a=(2*this.width)+(2*this.height);return a},getArea:function(){var a=this.width*this.height;return a},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers.Layer.KaMapCache=OpenLayers.Class(OpenLayers.Layer.KaMap,{IMAGE_EXTENSIONS:{jpeg:"jpg",gif:"gif",png:"png",png8:"png",png24:"png",dithered:"png"},DEFAULT_FORMAT:"jpeg",initialize:function(c,b,d,a){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments);this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||DEFAULT_FORMAT]},getURL:function(a){a=this.adjustBounds(a);var g=this.map.getResolution();var f=Math.round((this.map.getScale()*10000))/10000;var d=Math.round(a.left/g);var c=-Math.round(a.top/g);var k=Math.floor(d/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w;var j=Math.floor(c/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h;var b=this.url;if(b instanceof Array){b=this.selectUrl(paramsString,b)}var h=[b,"/",this.params.map,"/",f,"/",this.params.g.replace(/\s/g,"_"),"/def/t",j,"/l",k,"/t",c,"l",d,".",this.extension];return h.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:true,initialize:function(c,b,f,a){OpenLayers.Layer.MapServer.prototype.initialize.apply(this,arguments);var d="The OpenLayers.Layer.MapServer.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.MapServer class, passing it the option 'singleTile' as true.";OpenLayers.Console.warn(d)},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer.Untiled(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.MapServer.prototype.clone.apply(this,[a]);return a},CLASS_NAME:"OpenLayers.Layer.MapServer.Untiled"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(c,b){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var d=0,a=this.strategies.length;d<a;d++){this.strategies[d].setLayer(this)}}},destroy:function(){if(this.strategies){var c,b,a;for(b=0,a=this.strategies.length;b<a;b++){c=this.strategies[b];if(c.autoDestroy){c.destroy()}}this.strategies=null}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()}this.protocol=null}this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;if(this.renderer){this.renderer.destroy()}this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},refresh:function(a){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",a)}},assignRenderer:function(){for(var c=0,a=this.renderers.length;c<a;c++){var b=OpenLayers.Renderer[this.renderers[c]];if(b&&b.prototype.supported()){this.renderer=new b(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.renderer){this.map.removeLayer(this)}else{this.renderer.map=this.map;this.renderer.setSize(this.map.getSize())}},afterAdd:function(){if(this.strategies){var c,b,a;for(b=0,a=this.strategies.length;b<a;b++){c=this.strategies[b];if(c.autoActivate){c.activate()}}}},removeMap:function(c){if(this.strategies){var d,b,a;for(b=0,a=this.strategies.length;b<a;b++){d=this.strategies[b];if(d.autoActivate){d.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(h,b,j){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var f=true;if(!j){this.renderer.root.style.visibility="hidden";this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var g=this.map.getExtent();f=this.renderer.setExtent(g,b);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!b&&f){for(var d in this.unrenderedFeatures){var c=this.unrenderedFeatures[d];this.drawFeature(c)}}}if(!this.drawn||b||!f){this.drawn=true;var c;for(var d=0,a=this.features.length;d<a;d++){this.renderer.locked=(d!==(a-1));c=this.features[d];this.drawFeature(c)}}},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);var b=this.div.style.display;if(b!=this.renderer.root.style.display){this.renderer.root.style.display=b}},addFeatures:function(b,k){if(!(b instanceof Array)){b=[b]}var h=!k||!k.silent;if(h){var a={features:b};var g=this.events.triggerEvent("beforefeaturesadded",a);if(g===false){return}b=a.features}for(var c=0,f=b.length;c<f;c++){if(c!=(b.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var j=b[c];if(this.geometryType&&!(j.geometry instanceof this.geometryType)){var d=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw d}this.features.push(j);j.layer=this;if(!j.style&&this.style){j.style=OpenLayers.Util.extend({},this.style)}if(h){if(this.events.triggerEvent("beforefeatureadded",{feature:j})===false){continue}this.preFeatureInsert(j)}this.drawFeature(j);if(h){this.events.triggerEvent("featureadded",{feature:j});this.onFeatureInsert(j)}}if(h){this.events.triggerEvent("featuresadded",{features:b})}},removeFeatures:function(f,a){if(!f||f.length===0){return}if(!(f instanceof Array)){f=[f]}if(f===this.features){f=f.slice()}var d=!a||!a.silent;for(var c=f.length-1;c>=0;c--){if(c!=0&&f[c-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var b=f[c];delete this.unrenderedFeatures[b.id];if(d){this.events.triggerEvent("beforefeatureremoved",{feature:b})}this.features=OpenLayers.Util.removeItem(this.features,b);b.layer=null;if(b.geometry){this.renderer.eraseFeatures(b)}if(OpenLayers.Util.indexOf(this.selectedFeatures,b)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,b)}if(d){this.events.triggerEvent("featureremoved",{feature:b})}}if(d){this.events.triggerEvent("featuresremoved",{features:f})}},destroyFeatures:function(d,a){var c=(d==undefined);if(c){d=this.features}if(d){this.removeFeatures(d,a);for(var b=d.length-1;b>=0;b--){d[b].destroy()}}},drawFeature:function(a,b){if(!this.drawn){return}if(typeof b!="object"){if(!b&&a.state===OpenLayers.State.DELETE){b="delete"}var c=b||a.renderIntent;b=a.style||this.style;if(!b){b=this.styleMap.createSymbolizer(a,c)}}if(!this.renderer.drawFeature(a,b)){this.unrenderedFeatures[a.id]=a}else{delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var b=this.renderer.getFeatureIdFromEvent(a);return this.getFeatureById(b)},getFeatureById:function(d){var c=null;for(var b=0,a=this.features.length;b<a;++b){if(this.features[b].id==d){c=this.features[b];break}}return c},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getDataExtent:function(){var b=null;if(this.features&&(this.features.length>0)){b=new OpenLayers.Bounds();for(var c=0,a=this.features.length;c<a;c++){b.extend(this.features[c].geometry.getBounds())}}return b},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS,{singleTile:true,initialize:function(c,b,f,a){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);var d="The OpenLayers.Layer.WMS.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.WMS class, passing it the option 'singleTile' as true.";OpenLayers.Console.warn(d)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.WMS.prototype.clone.apply(this,[a]);return a},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"});OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:false,click:true,clickout:true,toggle:false,clickTolerance:5,hover:false,box:false,maxFeatures:10,features:null,hoverFeature:null,handlerOptions:null,handlers:null,hoverResponse:null,EVENT_TYPES:["featureselected","featureunselected","clickout","beforefeatureselected","hoverfeature","outfeature"],initialize:function(a){this.EVENT_TYPES=OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);this.features={};this.handlers={};if(this.click){this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectSingle},this.handlerOptions.click||{})}if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"}))}if(this.hover){this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250}))}},activate:function(){if(!this.active){for(var a in this.handlers){this.handlers[a].activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){for(var a in this.handlers){this.handlers[a].deactivate()}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(a){var c;for(var b=this.features.length-1;b>=0;--b){c=this.features[b];if(!a||a.except!=c){this.unselect(c)}}},selectSingle:function(a){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var b=this.pixelToBounds(a.xy);this.setModifiers(a);this.request(b,{single:true})},selectBox:function(a){if(a instanceof OpenLayers.Bounds){var d=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));var c=new OpenLayers.Bounds(d.lon,d.lat,b.lon,b.lat);this.setModifiers(this.handlers.box.dragHandler.evt);this.request(c)}},selectHover:function(a){var b=this.pixelToBounds(a.xy);this.request(b,{single:true,hover:true})},cancelHover:function(){if(this.hoverResponse){this.protocol.abort(this.hoverResponse);this.hoverResponse=null}},request:function(d,b){b=b||{};var c=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:d});var a=this.protocol.read({maxFeatures:b.single==true?this.maxFeatures:undefined,filter:c,callback:function(f){if(f.code==1){if(f.features.length){if(b.single==true){this.selectBestFeature(f.features,d.getCenterLonLat(),b)}else{this.select(f.features)}}else{if(b.hover){this.hoverSelect()}else{this.events.triggerEvent("clickout");if(this.clickout){this.unselectAll()}}}}OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});if(b.hover==true){this.hoverResponse=a}},selectBestFeature:function(b,a,k){k=k||{};if(b.length){var h=new OpenLayers.Geometry.Point(a.lon,a.lat);var j,d,f;var g=Number.MAX_VALUE;for(var c=0;c<b.length;++c){j=b[c];if(j.geometry){f=h.distanceTo(j.geometry,{edge:false});if(f<g){g=f;d=j;if(g==0){break}}}}if(k.hover==true){this.hoverSelect(d)}else{this.select(d||b)}}},setModifiers:function(a){this.modifiers={multiple:this.multiple||(this.multipleKey&&a[this.multipleKey]),toggle:this.toggle||(this.toggleKey&&a[this.toggleKey])}},select:function(d){if(!this.modifiers.multiple&&!this.modifiers.toggle){this.unselectAll()}if(!(d instanceof Array)){d=[d]}var c;for(var b=0,a=d.length;b<a;++b){c=d[b];if(this.features[c.fid||c.id]){if(this.modifiers.toggle){this.unselect(this.features[c.fid||c.id])}}else{cont=this.events.triggerEvent("beforefeatureselected",{feature:c});if(cont!==false){this.features[c.fid||c.id]=c;this.events.triggerEvent("featureselected",{feature:c})}}}},hoverSelect:function(a){var c=a?a.fid||a.id:null;var b=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;if(b&&b!=c){this.events.triggerEvent("outfeature",{feature:this.hoverFeature});this.hoverFeature=null}if(c&&c!=b){this.events.triggerEvent("hoverfeature",{feature:a});this.hoverFeature=a}},unselect:function(a){delete this.features[a.fid||a.id];this.events.triggerEvent("featureunselected",{feature:a})},unselectAll:function(){for(var a in this.features){this.unselect(this.features[a])}},setMap:function(b){for(var a in this.handlers){this.handlers[a].setMap(b)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(b){var f=b.add(-this.clickTolerance/2,this.clickTolerance/2);var a=b.add(this.clickTolerance/2,-this.clickTolerance/2);var c=this.map.getLonLatFromPixel(f);var d=this.map.getLonLatFromPixel(a);return new OpenLayers.Bounds(c.lon,c.lat,d.lon,d.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesnap","snap","unsnap"],DEFAULTS:{tolerance:10,node:true,edge:true,vertex:true},greedy:true,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(a){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};if(this.options.layer){this.setLayer(this.options.layer)}var b=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(b,this.DEFAULTS);this.setTargets(this.options.targets);if(this.targets.length===0&&this.layer){this.addTargetLayer(this.layer)}this.geoToleranceCache={}},setLayer:function(a){if(this.active){this.deactivate();this.layer=a;this.activate()}else{this.layer=a}},setTargets:function(b){this.targets=[];if(b&&b.length){var d;for(var c=0,a=b.length;c<a;++c){d=b[c];if(d instanceof OpenLayers.Layer.Vector){this.addTargetLayer(d)}else{this.addTarget(d)}}}},addTargetLayer:function(a){this.addTarget({layer:a})},addTarget:function(a){a=OpenLayers.Util.applyDefaults(a,this.defaults);a.nodeTolerance=a.nodeTolerance||a.tolerance;a.vertexTolerance=a.vertexTolerance||a.tolerance;a.edgeTolerance=a.edgeTolerance||a.tolerance;this.targets.push(a)},removeTargetLayer:function(b){var c;for(var a=this.targets.length-1;a>=0;--a){c=this.targets[a];if(c.layer===b){this.removeTarget(c)}}},removeTarget:function(a){return OpenLayers.Util.removeItem(this.targets,a)},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}this.feature=null;this.point=null;return a},onSketchModified:function(a){this.feature=a.feature;this.considerSnapping(a.vertex,a.vertex)},onVertexModified:function(a){this.feature=a.feature;var b=this.layer.map.getLonLatFromViewPortPx(a.pixel);this.considerSnapping(a.vertex,new OpenLayers.Geometry.Point(b.lon,b.lat))},considerSnapping:function(j,d){var a={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null};var c=false;var k,g;for(var b=0,f=this.targets.length;b<f;++b){g=this.targets[b];k=this.testTarget(g,d);if(k){if(this.greedy){a=k;a.target=g;c=true;break}else{if((k.rank<a.rank)||(k.rank===a.rank&&k.dist<a.dist)){a=k;a.target=g;c=true}}}}if(c){var h=this.events.triggerEvent("beforesnap",{point:j,x:a.x,y:a.y,distance:a.dist,layer:a.target.layer,snapType:this.precedence[a.rank]});if(h!==false){j.x=a.x;j.y=a.y;this.point=j;this.events.triggerEvent("snap",{point:j,snapType:this.precedence[a.rank],layer:a.target.layer,distance:a.dist})}else{c=false}}if(this.point&&!c){j.x=d.x;j.y=d.y;this.point=null;this.events.triggerEvent("unsnap",{point:j})}},testTarget:function(D,g){var B={node:this.getGeoTolerance(D.nodeTolerance),vertex:this.getGeoTolerance(D.vertexTolerance),edge:this.getGeoTolerance(D.edgeTolerance)};var h=Math.max(B.node,B.vertex,B.edge);var l={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY};var f=false;var c=D.layer.features;var b,a,d,C,r,s,q;var o=this.precedence.length;var m=new OpenLayers.LonLat(g.x,g.y);for(var z=0,A=c.length;z<A;++z){b=c[z];if(b!==this.feature&&!b._sketch&&b.state!==OpenLayers.State.DELETE&&(!D.filter||D.filter.evaluate(b.attributes))){if(b.atPoint(m,h,h)){for(var w=0,t=Math.min(l.rank+1,o);w<t;++w){a=this.precedence[w];if(D[a]){if(a==="edge"){r=b.geometry.distanceTo(g,{details:true});s=r.distance;if(s<=B[a]&&s<l.dist){l={rank:w,dist:s,x:r.x0,y:r.y0};f=true;break}}else{d=b.geometry.getVertices(a==="node");q=false;for(var v=0,u=d.length;v<u;++v){C=d[v];s=C.distanceTo(g);if(s<=B[a]&&(w<l.rank||(w===l.rank&&s<l.dist))){l={rank:w,dist:s,x:C.x,y:C.y};f=true;q=true}}if(q){break}}}}}}}return f?l:null},getGeoTolerance:function(a){var b=this.layer.map.getResolution();if(b!==this.resolution){this.resolution=b;this.geoToleranceCache={}}var c=this.geoToleranceCache[a];if(c===undefined){c=a*b;this.geoToleranceCache[a]=c}return c},destroy:function(){if(this.active){this.deactivate()}delete this.layer;delete this.targets;OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"});OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},write:function(c,b){var a=(b&&b.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=a){var d=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!d){throw"Can't find a Filter parser for version "+a}this.parser=new d(this.options)}return this.parser.write(c)},read:function(c){if(typeof c=="string"){c=OpenLayers.Format.XML.prototype.read.apply(this,[c])}var a=this.version;if(!a){a=this.defaultVersion}if(!this.parser||this.parser.VERSION!=a){var d=OpenLayers.Format.Filter["v"+a.replace(/\./g,"_")];if(!d){throw"Can't find a Filter parser for version "+a}this.parser=new d(this.options)}var b=this.parser.read(c);return b},CLASS_NAME:"OpenLayers.Format.Filter"});OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,namedLayersAsArray:false,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},write:function(d,c){var b=(c&&c.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=b){var f=OpenLayers.Format.SLD["v"+b.replace(/\./g,"_")];if(!f){throw"Can't find a SLD parser for version "+b}this.parser=new f(this.options)}var a=this.parser.write(d);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},read:function(f,c){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var b=f.documentElement;var a=this.version;if(!a){a=b.getAttribute("version");if(!a){a=this.defaultVersion}}if(!this.parser||this.parser.VERSION!=a){var g=OpenLayers.Format.SLD["v"+a.replace(/\./g,"_")];if(!g){throw"Can't find a SLD parser for version "+a}this.parser=new g(this.options)}var d=this.parser.read(f,c);return d},CLASS_NAME:"OpenLayers.Format.SLD"});OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:true,initialize:function(a){a=a||{};if(a.extractStyles!==false){a.defaultStyle={externalGraphic:OpenLayers.Util.getImagesLocation()+"marker.png",graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5}}OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(l){var a=l.split("\n");var b;var h=[];for(var z=0;z<(a.length-1);z++){var w=a[z].replace(/^\s*/,"").replace(/\s*$/,"");if(w.charAt(0)!="#"){if(!b){b=w.split("\t")}else{var o=w.split("\t");var d=new OpenLayers.Geometry.Point(0,0);var j={};var t=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null;var u,v,c,r;var m=false;for(var k=0;k<o.length;k++){if(o[k]){if(b[k]=="point"){var s=o[k].split(",");d.y=parseFloat(s[0]);d.x=parseFloat(s[1]);m=true}else{if(b[k]=="lat"){d.y=parseFloat(o[k]);m=true}else{if(b[k]=="lon"){d.x=parseFloat(o[k]);m=true}else{if(b[k]=="title"){j.title=o[k]}else{if(b[k]=="image"||b[k]=="icon"&&t){t.externalGraphic=o[k]}else{if(b[k]=="iconSize"&&t){var q=o[k].split(",");t.graphicWidth=parseFloat(q[0]);t.graphicHeight=parseFloat(q[1])}else{if(b[k]=="iconOffset"&&t){var g=o[k].split(",");t.graphicXOffset=parseFloat(g[0]);t.graphicYOffset=parseFloat(g[1])}else{if(b[k]=="description"){j.description=o[k]}else{if(b[k]=="overflow"){j.overflow=o[k]}else{j[b[k]]=o[k]}}}}}}}}}}}if(m){if(this.internalProjection&&this.externalProjection){d.transform(this.externalProjection,this.internalProjection)}var f=new OpenLayers.Feature.Vector(d,j,t);h.push(f)}}}}return h},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(a,b){this.addComponent(a,b)},removePoint:function(a){this.removeComponent(a)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(c,b,a){if(!(a&&a.layerOptions&&a.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var a=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a);this.map.addLayer(this.layer);return true},createFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}if(this.drawing){this.cancel()}this.destroyFeature();if(this.layer.map!=null){this.layer.destroy(false)}this.layer=null;return true},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.point=null},finalize:function(b){var a=b?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(a,[this.geometryClone()]);if(b||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(a){OpenLayers.Event.stop(a);return false},dblclick:function(a){OpenLayers.Event.stop(a);return false},modifyFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.point&&this.point.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPoint([a])}return a},geometryClone:function(){var a=this.getGeometry();return a&&a.clone()},mousedown:function(a){if(!this.checkModifiers(a)){return true}if(this.lastDown&&this.lastDown.equals(a.xy)){return true}this.drawing=true;if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{this.modifyFeature(a.xy)}this.lastDown=a.xy;return false},mousemove:function(a){if(this.drawing){this.modifyFeature(a.xy)}return true},mouseup:function(a){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Layer.GML=OpenLayers.Class(OpenLayers.Layer.Vector,{loaded:false,format:null,formatOptions:null,initialize:function(d,c,b){var a=[];a.push(d,b);OpenLayers.Layer.Vector.prototype.initialize.apply(this,a);this.url=c},setVisibility:function(a,b){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},moveTo:function(c,a,b){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},loadGML:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.url,success:this.requestSuccess,failure:this.requestFailure,scope:this});this.loaded=true}},setUrl:function(a){this.url=a;this.destroyFeatures();this.loaded=false;this.loadGML()},requestSuccess:function(c){var d=c.responseXML;if(!d||!d.documentElement){d=c.responseText}var a={};OpenLayers.Util.extend(a,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}var b=this.format?new this.format(a):new OpenLayers.Format.GML(a);this.addFeatures(b.read(d));this.events.triggerEvent("loadend")},requestFailure:function(a){OpenLayers.Console.userError(OpenLayers.i18n("errorLoadingGML",{url:this.url}));this.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Layer.GML"});OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,initialize:function(b,a){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},addNodes:function(g){if(g.length<2){OpenLayers.Console.error("At least two point features have to be added to createa line from");return}var l=new Array(g.length-1);var h,a,j;for(var c=0,f=g.length;c<f;c++){h=g[c];j=h.geometry;if(!j){var d=h.lonlat;j=new OpenLayers.Geometry.Point(d.lon,d.lat)}else{if(j.CLASS_NAME!="OpenLayers.Geometry.Point"){OpenLayers.Console.error("Only features with point geometries are supported.");return}}if(c>0){var b=(this.dataFrom!=null)?(g[c+this.dataFrom].data||g[c+this.dataFrom].attributes):null;var k=new OpenLayers.Geometry.LineString([a,j]);l[c-1]=new OpenLayers.Feature.Vector(k,b)}a=j}this.addFeatures(l)},CLASS_NAME:"OpenLayers.Layer.PointTrack"});OpenLayers.Layer.PointTrack.dataFrom={SOURCE_NODE:-1,TARGET_NODE:0};OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:false,layers:null,initialize:function(b,a){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(a){var d=this.layers;var c;for(var b=0;b<d.length;b++){c=d[b].getFeatureFromEvent(a);if(c){return c}}},setMap:function(a){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();a.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(a){a.events.unregister("changelayer",this,this.handleChangeLayer);this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){var b;for(var a=0;a<this.map.layers.length;++a){b=this.map.layers[a];if(OpenLayers.Util.indexOf(this.layers,b)!=-1){b.renderer.moveRoot(this.renderer)}}},resetRoots:function(){var b;for(var a=0;a<this.layers.length;++a){b=this.layers[a];if(this.renderer&&b.renderer.getRenderLayerId()==this.id){this.renderer.moveRoot(b.renderer)}}},handleChangeLayer:function(a){var b=a.layer;if(a.property=="order"&&OpenLayers.Util.indexOf(this.layers,b)!=-1){this.resetRoots();this.collectRoots()}},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Layer.WFS=OpenLayers.Class(OpenLayers.Layer.Vector,OpenLayers.Layer.Markers,{isBaseLayer:false,tile:null,ratio:2,DEFAULT_PARAMS:{service:"WFS",version:"1.0.0",request:"GetFeature"},featureClass:null,format:null,formatObject:null,formatOptions:null,vectorMode:true,encodeBBOX:false,extractAttributes:false,initialize:function(d,c,f,b){if(b==undefined){b={}}if(b.featureClass||!OpenLayers.Layer.Vector||!OpenLayers.Feature.Vector){this.vectorMode=false}OpenLayers.Util.extend(b,{reportError:false});var a=[];a.push(d,b);OpenLayers.Layer.Vector.prototype.initialize.apply(this,a);if(!this.renderer||!this.vectorMode){this.vectorMode=false;if(!b.featureClass){b.featureClass=OpenLayers.Feature.WFS}OpenLayers.Layer.Markers.prototype.initialize.apply(this,a)}if(this.params&&this.params.typename&&!this.options.typename){this.options.typename=this.params.typename}if(!this.options.geometry_column){this.options.geometry_column="the_geom"}this.params=OpenLayers.Util.applyDefaults(f,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));this.url=c},destroy:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.destroy.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments)}if(this.tile){this.tile.destroy()}this.tile=null;this.ratio=null;this.featureClass=null;this.format=null;if(this.formatObject&&this.formatObject.destroy){this.formatObject.destroy()}this.formatObject=null;this.formatOptions=null;this.vectorMode=null;this.encodeBBOX=null;this.extractAttributes=null},setMap:function(b){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);var a={extractAttributes:this.extractAttributes};OpenLayers.Util.extend(a,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}this.formatObject=this.format?new this.format(a):new OpenLayers.Format.GML(a)}else{OpenLayers.Layer.Markers.prototype.setMap.apply(this,arguments)}},moveTo:function(a,b,r){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments)}if(r){return false}if(b){if(this.vectorMode){this.renderer.clear()}}if(this.options.minZoomLevel){OpenLayers.Console.warn(OpenLayers.i18n("minZoomLevelError"));if(this.map.getZoom()<this.options.minZoomLevel){return null}}if(a==null){a=this.map.getExtent()}var q=(this.tile==null);var h=(!q&&!this.tile.bounds.containsBounds(a));if(b||q||(!r&&h)){var c=a.getCenterLonLat();var o=a.getWidth()*this.ratio;var j=a.getHeight()*this.ratio;var l=new OpenLayers.Bounds(c.lon-(o/2),c.lat-(j/2),c.lon+(o/2),c.lat+(j/2));var s=this.map.getSize();s.w=s.w*this.ratio;s.h=s.h*this.ratio;var k=new OpenLayers.LonLat(l.left,l.top);var m=this.map.getLayerPxFromLonLat(k);var d=this.getFullRequestString();var g=null;var f=this.params.filter||this.params.FILTER;if(f){g={FILTER:f}}else{g={BBOX:this.encodeBBOX?l.toBBOX():l.toArray()}}if(this.map&&!this.projection.equals(this.map.getProjectionObject())){var t=l.clone();t.transform(this.map.getProjectionObject(),this.projection);if(!f){g.BBOX=this.encodeBBOX?t.toBBOX():t.toArray()}}d+="&"+OpenLayers.Util.getParameterString(g);if(!this.tile){this.tile=new OpenLayers.Tile.WFS(this,m,l,d,s);this.addTileMonitoringHooks(this.tile);this.tile.draw()}else{if(this.vectorMode){this.destroyFeatures();this.renderer.clear()}else{this.clearMarkers()}this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null;this.tile=new OpenLayers.Tile.WFS(this,m,l,d,s);this.addTileMonitoringHooks(this.tile);this.tile.draw()}}},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this==this.layer.tile){this.layer.events.triggerEvent("loadstart")}};a.events.register("loadstart",a,a.onLoadStart);a.onLoadEnd=function(){if(this==this.layer.tile){this.layer.events.triggerEvent("tileloaded");this.layer.events.triggerEvent("loadend")}};a.events.register("loadend",a,a.onLoadEnd);a.events.register("unload",a,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:a})},onMapResize:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.onMapResize.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.onMapResize.apply(this,arguments)}},display:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.display.apply(this,arguments)}else{OpenLayers.Layer.Markers.prototype.display.apply(this,arguments)}},mergeNewParams:function(c){var b=OpenLayers.Util.upperCaseObject(c);var a=[b];return OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,a)},clone:function(a){if(a==null){a=new OpenLayers.Layer.WFS(this.name,this.url,this.params,this.options)}if(this.vectorMode){a=OpenLayers.Layer.Vector.prototype.clone.apply(this,[a])}else{a=OpenLayers.Layer.Markers.prototype.clone.apply(this,[a])}return a},getFullRequestString:function(c,b){var a=this.projection.getCode()||this.map.getProjection();this.params.SRS=(a=="none")?null:a;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},commit:function(){if(!this.writer){var a={};if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}this.writer=new OpenLayers.Format.WFS(a,this)}var b=this.writer.write(this.features);OpenLayers.Request.POST({url:this.url,data:b,success:this.commitSuccess,failure:this.commitFailure,scope:this})},commitSuccess:function(c){var a=c.responseText;if(a.indexOf("SUCCESS")!=-1){this.commitReport(OpenLayers.i18n("commitSuccess",{response:a}));for(var b=0;b<this.features.length;b++){this.features[b].state=null}}else{if(a.indexOf("FAILED")!=-1||a.indexOf("Exception")!=-1){this.commitReport(OpenLayers.i18n("commitFailed",{response:a}))}}},commitFailure:function(a){},commitReport:function(b,a){OpenLayers.Console.userError(b)},refresh:function(){if(this.tile){if(this.vectorMode){this.renderer.clear();this.features.length=0}else{this.clearMarkers();this.markers.length=0}this.tile.draw()}},getDataExtent:function(){var a;if(this.vectorMode){a=OpenLayers.Layer.Vector.prototype.getDataExtent.apply(this)}else{a=OpenLayers.Layer.Markers.prototype.getDataExtent.apply(this)}return a},setOpacity:function(a){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setOpacity.apply(this,[a])}else{OpenLayers.Layer.Markers.prototype.setOpacity.apply(this,[a])}},CLASS_NAME:"OpenLayers.Layer.WFS"});OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({moveend:this.update,scope:this});this.layer.events.on({refresh:this.update,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({moveend:this.update,scope:this});this.layer.events.un({refresh:this.update,scope:this})}return a},update:function(b){var a=this.getMapBounds();if((b&&b.force)||this.invalidBounds(a)){this.calculateBounds(a);this.resolution=this.layer.map.getResolution();this.triggerRead()}},getMapBounds:function(){var a=this.layer.map.getExtent();if(!this.layer.projection.equals(this.layer.map.getProjectionObject())){a=a.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)}return a},invalidBounds:function(a){if(!a){a=this.getMapBounds()}var c=!this.bounds||!this.bounds.containsBounds(a);if(!c&&this.resFactor){var b=this.resolution/this.layer.map.getResolution();c=(b>=this.resFactor||b<=(1/this.resFactor))}return c},calculateBounds:function(b){if(!b){b=this.getMapBounds()}var a=b.getCenterLonLat();var d=b.getWidth()*this.ratio;var c=b.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(a.lon-(d/2),a.lat-(c/2),a.lon+(d/2),a.lat+(c/2))},triggerRead:function(){this.layer.protocol.abort(this.response);this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read({filter:this.createFilter(),callback:this.merge,scope:this})},createFilter:function(){var a=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,a]})}return a},merge:function(h){this.layer.destroyFeatures();var f=h.features;if(f&&f.length>0){var g=this.layer.projection;var d=this.layer.map.getProjectionObject();if(!d.equals(g)){var c;for(var b=0,a=f.length;b<a;++b){c=f[b].geometry;if(c){c.transform(g,d)}}}this.layer.addFeatures(f)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,highlightOnly:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(c,a){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);if(this.scope===null){this.scope=this}if(c instanceof Array){this.layers=c;this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:c})}else{this.layer=c}var b={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){b.over=this.overFeature;b.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(b,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.layers){this.layer.destroy()}},activate:function(){if(!this.active){if(this.layers){this.map.addLayer(this.layer)}this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}if(this.layers){this.map.removeLayer(this.layer)}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(b){var g=this.layers||[this.layer];var f,d;for(var a=0;a<g.length;++a){f=g[a];for(var c=f.selectedFeatures.length-1;c>=0;--c){d=f.selectedFeatures[c];if(!b||b.except!=d){this.unselect(d)}}}},clickFeature:function(a){if(!this.hover){var b=(OpenLayers.Util.indexOf(a.layer.selectedFeatures,a)>-1);if(b){if(this.toggleSelect()){this.unselect(a)}else{if(!this.multipleSelect()){this.unselectAll({except:a})}}}else{if(!this.multipleSelect()){this.unselectAll({except:a})}this.select(a)}}},multipleSelect:function(){return this.multiple||(this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey])},toggleSelect:function(){return this.toggle||(this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey])},clickoutFeature:function(a){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(b){var a=b.layer;if(this.hover){if(this.highlightOnly){this.highlight(b)}else{if(OpenLayers.Util.indexOf(a.selectedFeatures,b)==-1){this.select(b)}}}},outFeature:function(a){if(this.hover){if(this.highlightOnly){if(a._lastHighlighter==this.id){if(a._prevHighlighter&&a._prevHighlighter!=this.id){delete a._lastHighlighter;var b=this.map.getControl(a._prevHighlighter);if(b){b.highlight(a)}}else{this.unhighlight(a)}}}else{this.unselect(a)}}},highlight:function(c){var b=c.layer;var a=this.events.triggerEvent("beforefeaturehighlighted",{feature:c});if(a!==false){c._prevHighlighter=c._lastHighlighter;c._lastHighlighter=this.id;var d=this.selectStyle||this.renderIntent;b.drawFeature(c,d);this.events.triggerEvent("featurehighlighted",{feature:c})}},unhighlight:function(b){var a=b.layer;b._lastHighlighter=b._prevHighlighter;delete b._prevHighlighter;a.drawFeature(b,b.style||b.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:b})},select:function(c){var a=this.onBeforeSelect.call(this.scope,c);var b=c.layer;if(a!==false){a=b.events.triggerEvent("beforefeatureselected",{feature:c});if(a!==false){b.selectedFeatures.push(c);this.highlight(c);b.events.triggerEvent("featureselected",{feature:c});this.onSelect.call(this.scope,c)}}},unselect:function(b){var a=b.layer;this.unhighlight(b);OpenLayers.Util.removeItem(a.selectedFeatures,b);a.events.triggerEvent("featureunselected",{feature:b});this.onUnselect.call(this.scope,b)},selectBox:function(f){if(f instanceof OpenLayers.Bounds){var j=this.map.getLonLatFromPixel(new OpenLayers.Pixel(f.left,f.bottom));var m=this.map.getLonLatFromPixel(new OpenLayers.Pixel(f.right,f.top));var a=new OpenLayers.Bounds(j.lon,j.lat,m.lon,m.lat);if(!this.multipleSelect()){this.unselectAll()}var k=this.multiple;this.multiple=true;var d=this.layers||[this.layer];var g;for(var b=0;b<d.length;++b){g=d[b];for(var c=0,h=g.features.length;c<h;++c){var o=g.features[c];if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,o.geometry.CLASS_NAME)>-1){if(a.toGeometry().intersects(o.geometry)){if(OpenLayers.Util.indexOf(g.selectedFeatures,o)==-1){this.select(o)}}}}}this.multiple=k}},setMap:function(a){this.handlers.feature.setMap(a);if(this.box){this.handlers.box.setMap(a)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){var b={};this.readers.ogc.Filter.apply(this,[a,b]);return b.filter},readers:{ogc:{Filter:function(b,a){var c={fids:[],filters:[]};this.readChildNodes(b,c);if(c.fids.length>0){a.filter=new OpenLayers.Filter.FeatureId({fids:c.fids})}else{if(c.filters.length>0){a.filter=c.filters[0]}}},FeatureId:function(a,b){var c=a.getAttribute("fid");if(c){b.fids.push(c)}},And:function(b,c){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(b,a);c.filters.push(a)},Or:function(b,c){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(b,a);c.filters.push(a)},Not:function(b,c){var a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsLessThan:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsGreaterThan:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsLessThanOrEqualTo:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsGreaterThanOrEqualTo:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsBetween:function(b,c){var a=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(b,a);c.filters.push(a)},PropertyIsLike:function(d,f){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(d,c);var g=d.getAttribute("wildCard");var b=d.getAttribute("singleChar");var a=d.getAttribute("escape");c.value2regex(g,b,a);f.filters.push(c)},Literal:function(a,b){b.value=OpenLayers.String.numericIf(this.getChildValue(a))},PropertyName:function(b,a){a.property=this.getChildValue(b)},LowerBoundary:function(b,a){a.lowerBoundary=OpenLayers.String.numericIf(this.readOgcExpression(b))},UpperBoundary:function(b,a){a.upperBoundary=OpenLayers.String.numericIf(this.readOgcExpression(b))},Intersects:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(a,b){b.distance=parseInt(this.getChildValue(a));b.distanceUnits=a.getAttribute("units")}}},readSpatial:function(c,d,b){var a=new OpenLayers.Filter.Spatial({type:b});this.readChildNodes(c,a);a.value=a.components[0];delete a.components;d.filters.push(a)},readOgcExpression:function(a){var c={};this.readChildNodes(a,c);var b=c.value;if(!b){b=this.getChildValue(a)}return b},write:function(a){return this.writers.ogc.Filter.apply(this,[a])},writers:{ogc:{Filter:function(c){var d=this.createElementNSPlus("ogc:Filter");var b=c.CLASS_NAME.split(".").pop();if(b=="FeatureId"){for(var a=0;a<c.fids.length;++a){this.writeNode("FeatureId",c.fids[a],d)}}else{this.writeNode(this.getFilterType(c),c,d)}return d},FeatureId:function(a){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:a}})},And:function(c){var d=this.createElementNSPlus("ogc:And");var b;for(var a=0;a<c.filters.length;++a){b=c.filters[a];this.writeNode(this.getFilterType(b),b,d)}return d},Or:function(c){var d=this.createElementNSPlus("ogc:Or");var b;for(var a=0;a<c.filters.length;++a){b=c.filters[a];this.writeNode(this.getFilterType(b),b,d)}return d},Not:function(b){var c=this.createElementNSPlus("ogc:Not");var a=b.filters[0];this.writeNode(this.getFilterType(a),a,c);return c},PropertyIsLessThan:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThan");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsGreaterThan:function(a){var b=this.createElementNSPlus("ogc:PropertyIsGreaterThan");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsLessThanOrEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsGreaterThanOrEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.value,b);return b},PropertyIsBetween:function(a){var b=this.createElementNSPlus("ogc:PropertyIsBetween");this.writeNode("PropertyName",a,b);this.writeNode("LowerBoundary",a,b);this.writeNode("UpperBoundary",a,b);return b},PropertyIsLike:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.regex2value(),b);return b},PropertyName:function(a){return this.createElementNSPlus("ogc:PropertyName",{value:a.property})},Literal:function(a){return this.createElementNSPlus("ogc:Literal",{value:a})},LowerBoundary:function(a){var b=this.createElementNSPlus("ogc:LowerBoundary");this.writeNode("Literal",a.lowerBoundary,b);return b},UpperBoundary:function(a){var b=this.createElementNSPlus("ogc:UpperBoundary");this.writeNode("Literal",a.upperBoundary,b);return b},INTERSECTS:function(a){return this.writeSpatial(a,"Intersects")},WITHIN:function(a){return this.writeSpatial(a,"Within")},CONTAINS:function(a){return this.writeSpatial(a,"Contains")},DWITHIN:function(a){var b=this.writeSpatial(a,"DWithin");this.writeNode("Distance",a,b);return b},Distance:function(a){return this.createElementNSPlus("ogc:Distance",{attributes:{units:a.distanceUnits},value:a.distance})}}},getFilterType:function(a){var b=this.filterMap[a.type];if(!b){throw"Filter writing not supported for rule type: "+a.type}return b},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var c=0;if(this.components&&(this.components.length>1)){for(var b=1,a=this.components.length;b<a;b++){c+=this.components[b-1].distanceTo(this.components[b])}}return c},getGeodesicLength:function(b){var f=this;if(b){var c=new OpenLayers.Projection("EPSG:4326");if(!c.equals(b)){f=this.clone().transform(b,c)}}var g=0;if(f.components&&(f.components.length>1)){var j,h;for(var d=1,a=f.components.length;d<a;d++){j=f.components[d-1];h=f.components[d];g+=OpenLayers.Util.distVincenty({lon:j.x,lat:j.y},{lon:h.x,lat:h.y})}}return g*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,modified:false,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(d,c){this.layer=d;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());this.virtualStyle.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[c]);if(!(this.deleteCodes instanceof Array)){this.deleteCodes=[this.deleteCodes]}var g=this;var a={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};this.selectControl=new OpenLayers.Control.SelectFeature(d,a);var b={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(j,h){g.dragStart.apply(g,[j,h])},onDrag:function(j,h){g.dragVertex.apply(g,[j,h])},onComplete:function(h){g.dragComplete.apply(g,[h])}};this.dragControl=new OpenLayers.Control.DragFeature(d,b);var f={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,f)}},destroy:function(){this.layer=null;this.selectControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.selectControl.activate()&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){var a=false;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.vertices,{silent:true});this.layer.removeFeatures(this.virtualVertices,{silent:true});this.vertices=[];this.dragControl.deactivate();if(this.feature&&this.feature.geometry&&this.feature.layer){this.selectControl.unselect.apply(this.selectControl,[this.feature])}this.selectControl.deactivate();this.handlers.keyboard.deactivate();a=true}return a},beforeSelectFeature:function(a){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:a})},selectFeature:function(a){this.feature=a;this.modified=false;this.resetVertices();this.dragControl.activate();this.onModificationStart(this.feature)},unselectFeature:function(a){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[];if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});delete this.dragHandle}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});delete this.radiusHandle}this.feature=null;this.dragControl.deactivate();this.onModificationEnd(a);this.layer.events.triggerEvent("afterfeaturemodified",{feature:a,modified:this.modified});this.modified=false},dragStart:function(b,a){if(b!=this.feature&&!b.geometry.parent&&b!=this.dragHandle&&b!=this.radiusHandle){if(this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature])}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,b.geometry.CLASS_NAME)!=-1){this.selectControl.clickFeature.apply(this.selectControl,[b]);this.dragControl.overFeature.apply(this.dragControl,[b]);this.dragControl.lastPixel=a;this.dragControl.handlers.drag.started=true;this.dragControl.handlers.drag.start=a;this.dragControl.handlers.drag.last=a}}},dragVertex:function(b,a){this.modified=true;if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=b){this.feature=b}this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}else{if(b._index){b.geometry.parent.addComponent(b.geometry,b._index);delete b._index;OpenLayers.Util.removeItem(this.virtualVertices,b);this.vertices.push(b)}else{if(b==this.dragHandle){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}}else{if(b!==this.radiusHandle){this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}}}if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}this.layer.drawFeature(this.feature,this.selectControl.renderIntent)}this.layer.drawFeature(b)},dragComplete:function(a){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE){this.feature.state=OpenLayers.State.UPDATE}},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature)}if(this.vertices.length>0){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[]}if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});this.dragHandle=null}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle()}if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle()}if(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE){if(!(this.mode&OpenLayers.Control.ModifyFeature.RESIZE)){this.collectVertices()}}}},handleKeypress:function(a){var b=a.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,b)!=-1){var c=this.dragControl.feature;if(c&&OpenLayers.Util.indexOf(this.vertices,c)!=-1&&!this.dragControl.handlers.drag.dragging&&c.geometry.parent){c.geometry.parent.removeComponent(c.geometry);this.layer.drawFeature(this.feature,this.selectControl.renderIntent);this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})}}},collectVertices:function(){this.vertices=[];this.virtualVertices=[];var a=this;function b(j){var d,f,k,g;if(j.CLASS_NAME=="OpenLayers.Geometry.Point"){f=new OpenLayers.Feature.Vector(j);f._sketch=true;a.vertices.push(f)}else{var c=j.components.length;if(j.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){c-=1}for(d=0;d<c;++d){k=j.components[d];if(k.CLASS_NAME=="OpenLayers.Geometry.Point"){f=new OpenLayers.Feature.Vector(k);f._sketch=true;a.vertices.push(f)}else{b(k)}}if(j.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(d=0,g=j.components.length;d<g-1;++d){var o=j.components[d];var q=j.components[d+1];if(o.CLASS_NAME=="OpenLayers.Geometry.Point"&&q.CLASS_NAME=="OpenLayers.Geometry.Point"){var l=(o.x+q.x)/2;var h=(o.y+q.y)/2;var m=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(l,h),null,a.virtualStyle);m.geometry.parent=j;m._index=d+1;m._sketch=true;a.virtualVertices.push(m)}}}}}b.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var d=this.feature.geometry;var a=d.getBounds().getCenterLonLat();var c=new OpenLayers.Geometry.Point(a.lon,a.lat);var b=new OpenLayers.Feature.Vector(c);c.move=function(f,g){OpenLayers.Geometry.Point.prototype.move.call(this,f,g);d.move(f,g)};b._sketch=true;this.dragHandle=b;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var j=this.feature.geometry;var a=j.getBounds();var b=a.getCenterLonLat();var k=new OpenLayers.Geometry.Point(b.lon,b.lat);var h=new OpenLayers.Geometry.Point(a.right,a.bottom);var g=new OpenLayers.Feature.Vector(h);var c=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var f=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var d=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);h.move=function(z,w){OpenLayers.Geometry.Point.prototype.move.call(this,z,w);var A=this.x-k.x;var t=this.y-k.y;var B=A-z;var u=t-w;if(d){var m=Math.atan2(u,B);var l=Math.atan2(t,A);var r=l-m;r*=180/Math.PI;j.rotate(r,k)}if(c){var q,v;if(f){q=t/u;v=(A/B)/q}else{var s=Math.sqrt((B*B)+(u*u));var o=Math.sqrt((A*A)+(t*t));q=o/s}j.resize(q,k,v)}};g._sketch=true;this.radiusHandle=g;this.layer.addFeatures([this.radiusHandle],{silent:true})},setMap:function(a){this.selectControl.setMap(a);this.dragControl.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(a){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(a){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(o){var c=false;var m=o.CLASS_NAME;if(m=="OpenLayers.Geometry.LineString"||m=="OpenLayers.Geometry.LinearRing"||m=="OpenLayers.Geometry.Point"){var s=this.getSortedSegments();var q;if(m=="OpenLayers.Geometry.Point"){q=[{x1:o.x,y1:o.y,x2:o.x,y2:o.y}]}else{q=o.getSortedSegments()}var v,h,f,a,u,t,d,b;outer:for(var k=0,l=s.length;k<l;++k){v=s[k];h=v.x1;f=v.x2;a=v.y1;u=v.y2;inner:for(var g=0,r=q.length;g<r;++g){t=q[g];if(t.x1>f){break}if(t.x2<h){continue}d=t.y1;b=t.y2;if(Math.min(d,b)>Math.max(a,u)){continue}if(Math.max(d,b)<Math.min(a,u)){continue}if(OpenLayers.Geometry.segmentsIntersect(v,t)){c=true;break outer}}}}else{c=o.intersects(this)}return c},getSortedSegments:function(){var a=this.components.length-1;var b=new Array(a);for(var c=0;c<a;++c){point1=this.components[c];point2=this.components[c+1];if(point1.x<point2.x){b[c]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}}else{b[c]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}}}function d(g,f){return g.x1-f.x1}return b.sort(d)},splitWithSegment:function(u,b){var c=!(b&&b.edge===false);var r=b&&b.tolerance;var a=[];var w=this.getVertices();var q=[];var A=[];var j=false;var f,d,m;var k,t,z;var g={point:true,tolerance:r};var h=null;for(var o=0,l=w.length-2;o<=l;++o){f=w[o];q.push(f.clone());d=w[o+1];z={x1:f.x,y1:f.y,x2:d.x,y2:d.y};m=OpenLayers.Geometry.segmentsIntersect(u,z,g);if(m instanceof OpenLayers.Geometry.Point){if((m.x===u.x1&&m.y===u.y1)||(m.x===u.x2&&m.y===u.y2)||m.equals(f)||m.equals(d)){t=true}else{t=false}if(t||c){if(!m.equals(A[A.length-1])){A.push(m.clone())}if(o===0){if(m.equals(f)){continue}}if(m.equals(d)){continue}j=true;if(!m.equals(f)){q.push(m)}a.push(new OpenLayers.Geometry.LineString(q));q=[m.clone()]}}}if(j){q.push(d.clone());a.push(new OpenLayers.Geometry.LineString(q))}if(A.length>0){var s=u.x1<u.x2?1:-1;var v=u.y1<u.y2?1:-1;h={lines:a,points:A.sort(function(C,B){return(s*C.x-s*B.x)||(v*C.y-v*B.y)})}}return h},split:function(C,b){var q=null;var d=b&&b.mutual;var m,f,o,c;if(C instanceof OpenLayers.Geometry.LineString){var B=this.getVertices();var h,g,A,l,a,s;var v=[];o=[];for(var w=0,r=B.length-2;w<=r;++w){h=B[w];g=B[w+1];A={x1:h.x,y1:h.y,x2:g.x,y2:g.y};c=c||[C];if(d){v.push(h.clone())}for(var u=0;u<c.length;++u){l=c[u].splitWithSegment(A,b);if(l){a=l.lines;if(a.length>0){a.unshift(u,1);Array.prototype.splice.apply(c,a);u+=a.length-2}if(d){for(var t=0,z=l.points.length;t<z;++t){s=l.points[t];if(!s.equals(h)){v.push(s);o.push(new OpenLayers.Geometry.LineString(v));if(s.equals(g)){v=[]}else{v=[s.clone()]}}}}}}}if(d&&o.length>0&&v.length>0){v.push(g.clone());o.push(new OpenLayers.Geometry.LineString(v))}}else{q=C.splitWith(this,b)}if(c&&c.length>1){f=true}else{c=[]}if(o&&o.length>1){m=true}else{o=[]}if(f||m){if(d){q=[o,c]}else{q=c}}return q},splitWith:function(b,a){return b.split(this,a)},getVertices:function(a){var b;if(a===true){b=[this.components[0],this.components[this.components.length-1]]}else{if(a===false){b=this.components.slice(1,this.components.length-1)}else{b=this.components.slice()}}return b},distanceTo:function(k,h){var l=!(h&&h.edge===false);var E=l&&h&&h.details;var t,f={};var w=Number.POSITIVE_INFINITY;if(k instanceof OpenLayers.Geometry.Point){var u=this.getSortedSegments();var s=k.x;var r=k.y;var C;for(var A=0,B=u.length;A<B;++A){C=u[A];t=OpenLayers.Geometry.distanceToSegment(k,C);if(t.distance<w){w=t.distance;f=t;if(w===0){break}}else{if(C.x2>s&&((r>C.y1&&r<C.y2)||(r<C.y1&&r>C.y2))){break}}}if(E){f={distance:f.distance,x0:f.x,y0:f.y,x1:s,y1:r}}else{f=f.distance}}else{if(k instanceof OpenLayers.Geometry.LineString){var d=this.getSortedSegments();var c=k.getSortedSegments();var b,a,q,D,g;var o=c.length;var m={point:true};outer:for(var A=0,B=d.length;A<B;++A){b=d[A];D=b.x1;g=b.y1;for(var z=0;z<o;++z){a=c[z];q=OpenLayers.Geometry.segmentsIntersect(b,a,m);if(q){w=0;f={distance:0,x0:q.x,y0:q.y,x1:q.x,y1:q.y};break outer}else{t=OpenLayers.Geometry.distanceToSegment({x:D,y:g},a);if(t.distance<w){w=t.distance;f={distance:w,x0:D,y0:g,x1:t.x,y1:t.y}}}}}if(!E){f=f.distance}if(w!==0){if(b){t=k.distanceTo(new OpenLayers.Geometry.Point(b.x2,b.y2),h);var v=E?t.distance:t;if(v<w){if(E){f={distance:w,x0:t.x1,y0:t.y1,x1:t.x0,y1:t.y0}}else{f=v}}}}}else{f=k.distanceTo(this,h);if(E){f={distance:f.distance,x0:f.x1,y0:f.y1,x1:f.x0,y1:f.y0}}}}return f},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{extractWaypoints:true,extractTracks:true,extractRoutes:true,extractAttributes:true,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(C){if(typeof C=="string"){C=OpenLayers.Format.XML.prototype.read.apply(this,[C])}var c=[];if(this.extractTracks){var w=C.getElementsByTagName("trk");for(var v=0,z=w.length;v<z;v++){var q={};if(this.extractAttributes){q=this.parseAttributes(w[v])}var m=this.getElementsByTagNameNS(w[v],w[v].namespaceURI,"trkseg");for(var u=0,h=m.length;u<h;u++){var o=this.extractSegment(m[u],"trkpt");c.push(new OpenLayers.Feature.Vector(o,q))}}}if(this.extractRoutes){var a=C.getElementsByTagName("rte");for(var t=0,s=a.length;t<s;t++){var q={};if(this.extractAttributes){q=this.parseAttributes(a[t])}var B=this.extractSegment(a[t],"rtept");c.push(new OpenLayers.Feature.Vector(B,q))}}if(this.extractWaypoints){var b=C.getElementsByTagName("wpt");for(var r=0,z=b.length;r<z;r++){var q={};if(this.extractAttributes){q=this.parseAttributes(b[r])}var f=new OpenLayers.Geometry.Point(b[r].getAttribute("lon"),b[r].getAttribute("lat"));c.push(new OpenLayers.Feature.Vector(f,q))}}if(this.internalProjection&&this.externalProjection){for(var A=0,d=c.length;A<d;A++){c[A].geometry.transform(this.externalProjection,this.internalProjection)}}return c},extractSegment:function(f,g){var d=this.getElementsByTagNameNS(f,f.namespaceURI,g);var b=[];for(var c=0,a=d.length;c<a;c++){b.push(new OpenLayers.Geometry.Point(d[c].getAttribute("lon"),d[c].getAttribute("lat")))}return new OpenLayers.Geometry.LineString(b)},parseAttributes:function(b){var a={};var d=b.firstChild;while(d){if(d.nodeType==1){var c=d.firstChild;if(c.nodeType==3||c.nodeType==4){name=(d.prefix)?d.nodeName.split(":")[1]:d.nodeName;if(name!="trkseg"&&name!="rtept"){a[name]=c.nodeValue}}}d=d.nextSibling}return a},CLASS_NAME:"OpenLayers.Format.GPX"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(a,b){var c=false;var d=this.components.pop();if(b!=null||!a.equals(d)){c=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var f=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[f]);return c},removeComponent:function(a){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var b=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[b])}},move:function(b,d){for(var c=0,a=this.components.length;c<a-1;c++){this.components[c].move(b,d)}},rotate:function(d,b){for(var c=0,a=this.components.length;c<a-1;++c){this.components[c].rotate(d,b)}},resize:function(f,b,d){for(var c=0,a=this.components.length;c<a-1;++c){this.components[c].resize(f,b,d)}return this},transform:function(f,c){if(f&&c){for(var d=0,a=this.components.length;d<a-1;d++){var b=this.components[d];b.transform(f,c)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var j=0;var h=0;for(var f=0;f<this.components.length-1;f++){var d=this.components[f];var l=this.components[f+1];j+=(d.x+l.x)*(d.x*l.y-l.x*d.y);h+=(d.y+l.y)*(d.x*l.y-l.x*d.y)}var g=-1*this.getArea();var a=j/(6*g);var k=h/(6*g)}return new OpenLayers.Geometry.Point(a,k)},getArea:function(){var h=0;if(this.components&&(this.components.length>2)){var g=0;for(var f=0,d=this.components.length;f<d-1;f++){var a=this.components[f];var j=this.components[f+1];g+=(a.x+j.x)*(j.y-a.y)}h=-g/2}return h},getGeodesicArea:function(b){var d=this;if(b){var c=new OpenLayers.Projection("EPSG:4326");if(!c.equals(b)){d=this.clone().transform(b,c)}}var g=0;var a=d.components&&d.components.length;if(a>2){var j,h;for(var f=0;f<a-1;f++){j=d.components[f];h=d.components[f+1];g+=OpenLayers.Util.rad(h.x-j.x)*(2+Math.sin(OpenLayers.Util.rad(j.y))+Math.sin(OpenLayers.Util.rad(h.y)))}g=g*6378137*6378137/2}return g},containsPoint:function(o){var v=OpenLayers.Number.limitSigDigs;var m=14;var l=v(o.x,m);var k=v(o.y,m);function u(C,z,B,w,A){return(((z-w)*C)+((w*B)-(z*A)))/(B-A)}var a=this.components.length-1;var h,g,t,d,r,b,f,c;var j=0;for(var q=0;q<a;++q){h=this.components[q];t=v(h.x,m);d=v(h.y,m);g=this.components[q+1];r=v(g.x,m);b=v(g.y,m);if(d==b){if(k==d){if(t<=r&&(l>=t&&l<=r)||t>=r&&(l<=t&&l>=r)){j=-1;break}}continue}f=v(u(k,t,d,r,b),m);if(f==l){if(d<b&&(k>=d&&k<=b)||d>b&&(k<=d&&k>=b)){j=-1;break}}if(f<=l){continue}if(t!=r&&(f<Math.min(t,r)||f>Math.max(t,r))){continue}if(d<b&&(k>=d&&k<b)||d>b&&(k<d&&k>=b)){++j}}var s=(j==-1)?1:!!(j&1);return s},intersects:function(d){var b=false;if(d.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(d)}else{if(d.CLASS_NAME=="OpenLayers.Geometry.LineString"){b=d.intersects(this)}else{if(d.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[d])}else{for(var c=0,a=d.components.length;c<a;++c){b=d.components[c].intersects(this);if(b){break}}}}}return b},getVertices:function(a){return(a===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(q,v){var h=null;var u=v&&v.mutual;var r,a,t,o,b;var f=[];var s=[q];for(var g=0,l=this.components.length;g<l;++g){a=this.components[g];o=false;for(var d=0;d<s.length;++d){r=a.split(s[d],v);if(r){if(u){t=r[0];for(var c=0,m=t.length;c<m;++c){if(c===0&&f.length){f[f.length-1].addComponent(t[c])}else{f.push(new OpenLayers.Geometry.MultiLineString([t[c]]))}}o=true;r=r[1]}if(r.length){r.unshift(d,1);Array.prototype.splice.apply(s,r);break}}}if(!o){if(f.length){f[f.length-1].addComponent(a.clone())}else{f=[new OpenLayers.Geometry.MultiLineString(a.clone())]}}}if(f&&f.length>1){o=true}else{f=[]}if(s&&s.length>1){b=true}else{s=[]}if(o||b){if(u){h=[f,s]}else{h=s}}return h},splitWith:function(q,v){var h=null;var u=v&&v.mutual;var r,c,t,o,a,f,s;if(q instanceof OpenLayers.Geometry.LineString){s=[];f=[q];for(var g=0,l=this.components.length;g<l;++g){a=false;c=this.components[g];for(var d=0;d<f.length;++d){r=f[d].split(c,v);if(r){if(u){t=r[0];if(t.length){t.unshift(d,1);Array.prototype.splice.apply(f,t);d+=t.length-2}r=r[1];if(r.length===0){r=[c.clone()]}}for(var b=0,m=r.length;b<m;++b){if(b===0&&s.length){s[s.length-1].addComponent(r[b])}else{s.push(new OpenLayers.Geometry.MultiLineString([r[b]]))}}a=true}}if(!a){if(s.length){s[s.length-1].addComponent(c.clone())}else{s=[new OpenLayers.Geometry.MultiLineString([c.clone()])]}}}}else{h=q.split(this)}if(f&&f.length>1){o=true}else{f=[]}if(s&&s.length>1){a=true}else{s=[]}if(o||a){if(u){h=[f,s]}else{h=s}}return h},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(c,b,a){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);this.line=null},removePoint:function(){if(this.point){this.layer.removeFeatures([this.point])}},addPoint:function(a){this.layer.removeFeatures([this.point]);var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature()},freehandMode:function(a){return(this.freehandToggle&&a[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var a=this.line&&this.line.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiLineString([a])}return a},mousedown:function(a){if(this.lastDown&&this.lastDown.equals(a.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{if((this.lastUp==null)||!this.lastUp.equals(a.xy)){this.addPoint(a.xy)}}this.mouseDown=true;this.lastDown=a.xy;this.drawing=true;return false},mousemove:function(a){if(this.drawing){if(this.mouseDown&&this.freehandMode(a)){this.addPoint(a.xy)}else{this.modifyFeature(a.xy)}}return true},mouseup:function(a){this.mouseDown=false;if(this.drawing){if(this.freehandMode(a)){this.removePoint();this.finalize()}else{if(this.lastUp==null){this.addPoint(a.xy)}this.lastUp=a.xy}return false}return true},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesplit","split","aftersplit"],layer:null,source:null,sourceOptions:null,tolerance:null,edge:true,deferDelete:false,mutual:true,targetFilter:null,sourceFilter:null,handler:null,initialize:function(a){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};if(this.options.source){this.setSource(this.options.source)}},setSource:function(a){if(this.active){this.deactivate();if(this.handler){this.handler.destroy();delete this.handler}this.source=a;this.activate()}else{this.source=a}},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(!this.source){if(!this.handler){this.handler=new OpenLayers.Handler.Path(this,{done:function(b){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(b)})}},{layerOptions:this.sourceOptions})}this.handler.activate()}else{if(this.source.events){this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.source&&this.source.events){this.layer.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}return a},onSketchComplete:function(a){this.feature=null;return !this.considerSplit(a.feature)},afterFeatureModified:function(b){if(b.modified){var a=b.feature;if(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString){this.feature=b.feature;this.considerSplit(b.feature)}}},removeByGeometry:function(c,d){for(var b=0,a=c.length;b<a;++b){if(c[b].geometry===d){c.splice(b,1);break}}},isEligible:function(a){return(a.state!==OpenLayers.State.DELETE)&&(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString)&&(this.feature!==a)&&(!this.targetFilter||this.targetFilter.evaluate(a.attributes))},considerSplit:function(c){sourceSplit=false;targetSplit=false;if(!this.sourceFilter||this.sourceFilter.evaluate(c.attributes)){var g=this.layer&&this.layer.features||[];var C,r,h,a;var m=[],B=[];var d=(this.layer===this.source)&&this.mutual;var b={edge:this.edge,tolerance:this.tolerance,mutual:d};var l=[c.geometry];var q,f;var t,s;for(var z=0,A=g.length;z<A;++z){q=g[z];if(this.isEligible(q)){f=[q.geometry];for(var w=0;w<l.length;++w){t=l[w];for(var u=0;u<f.length;++u){C=f[u];if(t.getBounds().intersectsBounds(C.getBounds())){r=t.split(C,b);if(r){a=this.events.triggerEvent("beforesplit",{source:c,target:q});if(a!==false){if(d){s=r[0];if(s.length>1){s.unshift(w,1);Array.prototype.splice.apply(l,s);w+=s.length-3}r=r[1]}if(r.length>1){r.unshift(u,1);Array.prototype.splice.apply(f,r);u+=r.length-3}}}}}}if(f&&f.length>1){this.geomsToFeatures(q,f);this.events.triggerEvent("split",{original:q,features:f});Array.prototype.push.apply(m,f);B.push(q);targetSplit=true}}}if(l&&l.length>1){this.geomsToFeatures(c,l);this.events.triggerEvent("split",{original:c,features:l});Array.prototype.push.apply(m,l);B.push(c);sourceSplit=true}if(sourceSplit||targetSplit){if(this.deferDelete){var o,v=[];for(var z=0,A=B.length;z<A;++z){o=B[z];if(o.state===OpenLayers.State.INSERT){v.push(o)}else{o.state=OpenLayers.State.DELETE;this.layer.drawFeature(o)}}this.layer.destroyFeatures(v,{silent:true});for(var z=0,A=m.length;z<A;++z){m[z].state=OpenLayers.State.INSERT}}else{this.layer.destroyFeatures(B,{silent:true})}this.layer.addFeatures(m,{silent:true});this.events.triggerEvent("aftersplit",{source:c,features:m})}}return sourceSplit},geomsToFeatures:function(c,d){var g=c.clone();delete g.geometry;var f;for(var b=0,a=d.length;b<a;++b){f=g.clone();f.geometry=d[b];f.state=OpenLayers.State.INSERT;d[b]=f}},destroy:function(){if(this.active){this.deactivate()}OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var c=0;if(this.components&&(this.components.length>0)){c+=Math.abs(this.components[0].getArea());for(var b=1,a=this.components.length;b<a;b++){c-=Math.abs(this.components[b].getArea())}}return c},getGeodesicArea:function(b){var d=0;if(this.components&&(this.components.length>0)){d+=Math.abs(this.components[0].getGeodesicArea(b));for(var c=1,a=this.components.length;c<a;c++){d-=Math.abs(this.components[c].getGeodesicArea(b))}}return d},containsPoint:function(a){var f=this.components.length;var c=false;if(f>0){c=this.components[0].containsPoint(a);if(c!==1){if(c&&f>1){var d;for(var b=1;b<f;++b){d=this.components[b].containsPoint(a);if(d){if(d===1){c=1}else{c=false}break}}}}}return c},intersects:function(f){var b=false;var d,a;if(f.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(f)}else{if(f.CLASS_NAME=="OpenLayers.Geometry.LineString"||f.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(d=0,a=this.components.length;d<a;++d){b=f.intersects(this.components[d]);if(b){break}}if(!b){for(d=0,a=f.components.length;d<a;++d){b=this.containsPoint(f.components[d]);if(b){break}}}}else{for(d=0,a=f.components.length;d<a;++d){b=this.intersects(f.components[d]);if(b){break}}}}if(!b&&f.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var c=this.components[0];for(d=0,a=c.components.length;d<a;++d){b=f.containsPoint(c.components[d]);if(b){break}}}return b},distanceTo:function(d,b){var c=!(b&&b.edge===false);var a;if(!c&&this.intersects(d)){a=0}else{a=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[d,b])}return a},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(k,g,b,m){var c=Math.PI*((1/b)-(1/2));if(m){c+=(m/180)*Math.PI}var a,j,h;var l=[];for(var f=0;f<b;++f){a=c+(f*2*Math.PI/b);j=k.x+(g*Math.cos(a));h=k.y+(g*Math.sin(a));l.push(new OpenLayers.Geometry.Point(j,h))}var d=new OpenLayers.Geometry.LinearRing(l);return new OpenLayers.Geometry.Polygon([d])};OpenLayers.Format.GeoRSS=OpenLayers.Class(OpenLayers.Format.XML,{rssns:"http://backend.userland.com/rss2",featureNS:"http://mapserver.gis.umn.edu/mapserver",georssns:"http://www.georss.org/georss",geons:"http://www.w3.org/2003/01/geo/wgs84_pos#",featureTitle:"Untitled",featureDescription:"No Description",gmlParser:null,xy:false,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},createGeometryFromItem:function(q){var o=this.getElementsByTagNameNS(q,this.georssns,"point");var h=this.getElementsByTagNameNS(q,this.geons,"lat");var a=this.getElementsByTagNameNS(q,this.geons,"long");var s=this.getElementsByTagNameNS(q,this.georssns,"line");var l=this.getElementsByTagNameNS(q,this.georssns,"polygon");var c=this.getElementsByTagNameNS(q,this.georssns,"where");var d=this.getElementsByTagNameNS(q,this.georssns,"box");if(o.length>0||(h.length>0&&a.length>0)){var m;if(o.length>0){m=OpenLayers.String.trim(o[0].firstChild.nodeValue).split(/\s+/);if(m.length!=2){m=OpenLayers.String.trim(o[0].firstChild.nodeValue).split(/\s*,\s*/)}}else{m=[parseFloat(h[0].firstChild.nodeValue),parseFloat(a[0].firstChild.nodeValue)]}var j=new OpenLayers.Geometry.Point(parseFloat(m[1]),parseFloat(m[0]))}else{if(s.length>0){var k=OpenLayers.String.trim(this.concatChildValues(s[0])).split(/\s+/);var f=[];var o;for(var b=0,g=k.length;b<g;b+=2){o=new OpenLayers.Geometry.Point(parseFloat(k[b+1]),parseFloat(k[b]));f.push(o)}j=new OpenLayers.Geometry.LineString(f)}else{if(l.length>0){var k=OpenLayers.String.trim(this.concatChildValues(l[0])).split(/\s+/);var f=[];var o;for(var b=0,g=k.length;b<g;b+=2){o=new OpenLayers.Geometry.Point(parseFloat(k[b+1]),parseFloat(k[b]));f.push(o)}j=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(f)])}else{if(c.length>0){if(!this.gmlParser){this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})}var r=this.gmlParser.parseFeature(c[0]);j=r.geometry}else{if(d.length>0){var k=OpenLayers.String.trim(d[0].firstChild.nodeValue).split(/\s+/);var f=[];var o;if(k.length>3){o=new OpenLayers.Geometry.Point(parseFloat(k[1]),parseFloat(k[0]));f.push(o);o=new OpenLayers.Geometry.Point(parseFloat(k[1]),parseFloat(k[2]));f.push(o);o=new OpenLayers.Geometry.Point(parseFloat(k[3]),parseFloat(k[2]));f.push(o);o=new OpenLayers.Geometry.Point(parseFloat(k[3]),parseFloat(k[0]));f.push(o);o=new OpenLayers.Geometry.Point(parseFloat(k[1]),parseFloat(k[0]));f.push(o)}j=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(f)])}}}}}if(j&&this.internalProjection&&this.externalProjection){j.transform(this.externalProjection,this.internalProjection)}return j},createFeatureFromItem:function(j){var d=this.createGeometryFromItem(j);var g=this.getChildValue(j,"*","title",this.featureTitle);var h=this.getChildValue(j,"*","description",this.getChildValue(j,"*","content",this.getChildValue(j,"*","summary",this.featureDescription)));var f=this.getChildValue(j,"*","link");if(!f){try{f=this.getElementsByTagNameNS(j,"*","link")[0].getAttribute("href")}catch(c){f=null}}var a=this.getChildValue(j,"*","id",null);var b={title:g,description:h,link:f};var k=new OpenLayers.Feature.Vector(d,b);k.fid=a;return k},getChildValue:function(d,b,c,g){var f;var a=this.getElementsByTagNameNS(d,b,c);if(a&&a[0]&&a[0].firstChild&&a[0].firstChild.nodeValue){f=a[0].firstChild.nodeValue}else{f=(g==undefined)?"":g}return f},read:function(f){if(typeof f=="string"){f=OpenLayers.Format.XML.prototype.read.apply(this,[f])}var a=null;a=this.getElementsByTagNameNS(f,"*","item");if(a.length==0){a=this.getElementsByTagNameNS(f,"*","entry")}var c=a.length;var d=new Array(c);for(var b=0;b<c;b++){d[b]=this.createFeatureFromItem(a[b])}return d},write:function(c){var d;if(c instanceof Array){d=this.createElementNS(this.rssns,"rss");for(var b=0,a=c.length;b<a;b++){d.appendChild(this.createFeatureXML(c[b]))}}else{d=this.createFeatureXML(c)}return OpenLayers.Format.XML.prototype.write.apply(this,[d])},createFeatureXML:function(l){var g=this.buildGeometryNode(l.geometry);var a=this.createElementNS(this.rssns,"item");var d=this.createElementNS(this.rssns,"title");d.appendChild(this.createTextNode(l.attributes.title?l.attributes.title:""));var b=this.createElementNS(this.rssns,"description");b.appendChild(this.createTextNode(l.attributes.description?l.attributes.description:""));a.appendChild(d);a.appendChild(b);if(l.attributes.link){var j=this.createElementNS(this.rssns,"link");j.appendChild(this.createTextNode(l.attributes.link));a.appendChild(j)}for(var k in l.attributes){if(k=="link"||k=="title"||k=="description"){continue}var h=this.createTextNode(l.attributes[k]);var f=k;if(k.search(":")!=-1){f=k.split(":")[1]}var c=this.createElementNS(this.featureNS,"feature:"+f);c.appendChild(h);a.appendChild(c)}a.appendChild(g);return a},buildGeometryNode:function(b){if(this.internalProjection&&this.externalProjection){b=b.clone();b.transform(this.internalProjection,this.externalProjection)}var a;if(b.CLASS_NAME=="OpenLayers.Geometry.Polygon"){a=this.createElementNS(this.georssns,"georss:polygon");a.appendChild(this.buildCoordinatesNode(b.components[0]))}else{if(b.CLASS_NAME=="OpenLayers.Geometry.LineString"){a=this.createElementNS(this.georssns,"georss:line");a.appendChild(this.buildCoordinatesNode(b))}else{if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.createElementNS(this.georssns,"georss:point");a.appendChild(this.buildCoordinatesNode(b))}else{throw"Couldn't parse "+b.CLASS_NAME}}}return a},buildCoordinatesNode:function(g){var c=null;if(g.components){c=g.components}var f;if(c){var b=c.length;var d=new Array(b);for(var a=0;a<b;a++){d[a]=c[a].y+" "+c[a].x}f=d.join(" ")}else{f=g.y+" "+g.x}return this.createTextNode(f)},CLASS_NAME:"OpenLayers.Format.GeoRSS"});OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new Date(),extractAttributes:true,extractStyles:false,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(a){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g),kmlColor:(/(\w{2})(\w{2})(\w{2})(\w{2})/),kmlIconPalette:(/root:\/\/icons\/palette-(\d+)(\.\w+)/),straightBracket:(/\$\[(.*?)\]/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(b){this.features=[];this.styles={};this.fetched={};var a={depth:0,styleBaseUrl:this.styleBaseUrl};return this.parseData(b,a)},parseData:function(h,c){if(typeof h=="string"){h=OpenLayers.Format.XML.prototype.read.apply(this,[h])}var f=["Link","NetworkLink","Style","StyleMap","Placemark"];for(var d=0,a=f.length;d<a;++d){var g=f[d];var b=this.getElementsByTagNameNS(h,"*",g);if(b.length==0){continue}switch(g.toLowerCase()){case"link":case"networklink":this.parseLinks(b,c);break;case"style":if(this.extractStyles){this.parseStyles(b,c)}break;case"stylemap":if(this.extractStyles){this.parseStyleMaps(b,c)}break;case"placemark":this.parseFeatures(b,c);break}}return this.features},parseLinks:function(c,d){if(d.depth>=this.maxDepth){return false}var h=OpenLayers.Util.extend({},d);h.depth++;for(var f=0,a=c.length;f<a;f++){var b=this.parseProperty(c[f],"*","href");if(b&&!this.fetched[b]){this.fetched[b]=true;var g=this.fetchLink(b);if(g){this.parseData(g,h)}}}},fetchLink:function(a){var b=OpenLayers.Request.GET({url:a,async:false});if(b){return b.responseText}},parseStyles:function(b,c){for(var d=0,a=b.length;d<a;d++){var f=this.parseStyle(b[d]);if(f){styleName=(c.styleBaseUrl||"")+"#"+f.id;this.styles[styleName]=f}}},parseStyle:function(B){var M={};var K=["LineStyle","PolyStyle","IconStyle","BalloonStyle"];var U,l,m,v;for(var P=0,q=K.length;P<q;++P){U=K[P];styleTypeNode=this.getElementsByTagNameNS(B,"*",U)[0];if(!styleTypeNode){continue}switch(U.toLowerCase()){case"linestyle":var u=this.parseProperty(styleTypeNode,"*","color");if(u){var c=(u.toString()).match(this.regExes.kmlColor);var N=c[1];M.strokeOpacity=parseInt(N,16)/255;var T=c[2];var R=c[3];var L=c[4];M.strokeColor="#"+L+R+T}var a=this.parseProperty(styleTypeNode,"*","width");if(a){M.strokeWidth=a}case"polystyle":var u=this.parseProperty(styleTypeNode,"*","color");if(u){var c=(u.toString()).match(this.regExes.kmlColor);var N=c[1];M.fillOpacity=parseInt(N,16)/255;var T=c[2];var R=c[3];var L=c[4];M.fillColor="#"+L+R+T}var o=this.parseProperty(styleTypeNode,"*","fill");if(o=="0"){M.fillColor="none"}break;case"iconstyle":var C=parseFloat(this.parseProperty(styleTypeNode,"*","scale")||1);var a=32*C;var d=32*C;var f=this.getElementsByTagNameNS(styleTypeNode,"*","Icon")[0];if(f){var t=this.parseProperty(f,"*","href");if(t){var J=this.parseProperty(f,"*","w");var Q=this.parseProperty(f,"*","h");var k="http://maps.google.com/mapfiles/kml";if(OpenLayers.String.startsWith(t,k)&&!J&&!Q){J=64;Q=64;C=C/2}J=J||Q;Q=Q||J;if(J){a=parseInt(J)*C}if(Q){d=parseInt(Q)*C}var c=t.match(this.regExes.kmlIconPalette);if(c){var O=c[1];var s=c[2];var I=this.parseProperty(f,"*","x");var H=this.parseProperty(f,"*","y");var E=I?I/32:0;var D=H?(7-H/32):7;var A=D*8+E;t="http://maps.google.com/mapfiles/kml/pal"+O+"/icon"+A+s}M.graphicOpacity=1;M.externalGraphic=t}}var G=this.getElementsByTagNameNS(styleTypeNode,"*","hotSpot")[0];if(G){var I=parseFloat(G.getAttribute("x"));var H=parseFloat(G.getAttribute("y"));var z=G.getAttribute("xunits");if(z=="pixels"){M.graphicXOffset=-I*C}else{if(z=="insetPixels"){M.graphicXOffset=-a+(I*C)}else{if(z=="fraction"){M.graphicXOffset=-a*I}}}var j=G.getAttribute("yunits");if(j=="pixels"){M.graphicYOffset=-d+(H*C)+1}else{if(j=="insetPixels"){M.graphicYOffset=-(H*C)+1}else{if(j=="fraction"){M.graphicYOffset=-d*(1-H)+1}}}}M.graphicWidth=a;M.graphicHeight=d;break;case"balloonstyle":var S=OpenLayers.Util.getXmlNodeValue(styleTypeNode);if(S){M.balloonStyle=S.replace(this.regExes.straightBracket,"${$1}")}break;default:}}if(!M.strokeColor&&M.fillColor){M.strokeColor=M.fillColor}var F=B.getAttribute("id");if(F&&M){M.id=F}return M},parseStyleMaps:function(a,q){for(var h=0,k=a.length;h<k;h++){var d=a[h];var c=this.getElementsByTagNameNS(d,"*","Pair");var b=d.getAttribute("id");for(var g=0,o=c.length;g<o;g++){var f=c[g];var m=this.parseProperty(f,"*","key");var l=this.parseProperty(f,"*","styleUrl");if(l&&m=="normal"){this.styles[(q.styleBaseUrl||"")+"#"+b]=this.styles[(q.styleBaseUrl||"")+l]}if(l&&m=="highlight"){}}}},parseFeatures:function(a,k){var d=new Array(a.length);for(var f=0,g=a.length;f<g;f++){var b=a[f];var j=this.parseFeature.apply(this,[b]);if(j){if(this.extractStyles&&j.attributes&&j.attributes.styleUrl){j.style=this.getStyle(j.attributes.styleUrl,k)}if(this.extractStyles){var h=this.getElementsByTagNameNS(b,"*","Style")[0];if(h){var c=this.parseStyle(h);if(c){j.style=OpenLayers.Util.extend(j.style,c)}}}d[f]=j}else{throw"Bad Placemark: "+f}}this.features=this.features.concat(d)},parseFeature:function(b){var c=["MultiGeometry","Polygon","LineString","Point"];var k,f,l,a;for(var h=0,j=c.length;h<j;++h){k=c[h];this.internalns=b.namespaceURI?b.namespaceURI:this.kmlns;f=this.getElementsByTagNameNS(b,this.internalns,k);if(f.length>0){var a=this.parseGeometry[k.toLowerCase()];if(a){l=a.apply(this,[f[0]]);if(this.internalProjection&&this.externalProjection){l.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:k}))}break}}var g;if(this.extractAttributes){g=this.parseAttributes(b)}var m=new OpenLayers.Feature.Vector(l,g);var d=b.getAttribute("id")||b.getAttribute("name");if(d!=null){m.fid=d}return m},getStyle:function(b,a){var c=OpenLayers.Util.removeTail(b);var g=OpenLayers.Util.extend({},a);g.depth++;g.styleBaseUrl=c;if(!this.styles[b]&&!OpenLayers.String.startsWith(b,"#")&&g.depth<=this.maxDepth&&!this.fetched[c]){var f=this.fetchLink(c);if(f){this.parseData(f,g)}}var d=OpenLayers.Util.extend({},this.styles[b]);return d},parseGeometry:{point:function(d){var c=this.getElementsByTagNameNS(d,this.internalns,"coordinates");var f=[];if(c.length>0){var b=c[0].firstChild.nodeValue;b=b.replace(this.regExes.removeSpace,"");f=b.split(",")}var a=null;if(f.length>1){if(f.length==2){f[2]=null}a=new OpenLayers.Geometry.Point(f[0],f[1],f[2])}else{throw"Bad coordinate string: "+b}return a},linestring:function(c,f){var d=this.getElementsByTagNameNS(c,this.internalns,"coordinates");var m=null;if(d.length>0){var b=this.getChildValue(d[0]);b=b.replace(this.regExes.trimSpace,"");b=b.replace(this.regExes.trimComma,",");var a=b.split(this.regExes.splitSpace);var j=a.length;var l=new Array(j);var k,h;for(var g=0;g<j;++g){k=a[g].split(",");h=k.length;if(h>1){if(k.length==2){k[2]=null}l[g]=new OpenLayers.Geometry.Point(k[0],k[1],k[2])}else{throw"Bad LineString point coordinates: "+a[g]}}if(j){if(f){m=new OpenLayers.Geometry.LinearRing(l)}else{m=new OpenLayers.Geometry.LineString(l)}}else{throw"Bad LineString coordinates: "+b}}return m},polygon:function(g){var c=this.getElementsByTagNameNS(g,this.internalns,"LinearRing");var h=c.length;var f=new Array(h);if(h>0){var b;for(var d=0,a=c.length;d<a;++d){b=this.parseGeometry.linestring.apply(this,[c[d],true]);if(b){f[d]=b}else{throw"Bad LinearRing geometry: "+d}}}return new OpenLayers.Geometry.Polygon(f)},multigeometry:function(f){var j,h;var g=[];var c=f.childNodes;for(var b=0,a=c.length;b<a;++b){j=c[b];if(j.nodeType==1){var d=(j.prefix)?j.nodeName.split(":")[1]:j.nodeName;var h=this.parseGeometry[d.toLowerCase()];if(h){g.push(h.apply(this,[j]))}}}return new OpenLayers.Geometry.Collection(g)}},parseAttributes:function(d){var f={};var g=d.getElementsByTagName("ExtendedData");if(g.length){f=this.parseExtendedData(g[0])}var b,m,l;var c=d.childNodes;for(var h=0,j=c.length;h<j;++h){b=c[h];if(b.nodeType==1){m=b.childNodes;if(m.length==1||m.length==3){var l;switch(m.length){case 1:l=m[0];break;case 3:default:l=m[1];break}if(l.nodeType==3||l.nodeType==4){var a=(b.prefix)?b.nodeName.split(":")[1]:b.nodeName;var k=OpenLayers.Util.getXmlNodeValue(l);if(k){k=k.replace(this.regExes.trimSpace,"");f[a]=k}}}}}return f},parseExtendedData:function(b){var d={};var c=b.getElementsByTagName("Data");for(var g=0,j=c.length;g<j;g++){var f=c[g];var k=f.getAttribute("name");var h={};var l=f.getElementsByTagName("value");if(l.length){h.value=this.getChildValue(l[0])}var a=f.getElementsByTagName("displayName");if(a.length){h.displayName=this.getChildValue(a[0])}d[k]=h}return d},parseProperty:function(c,d,b){var f;var a=this.getElementsByTagNameNS(c,d,b);try{f=OpenLayers.Util.getXmlNodeValue(a[0])}catch(g){f=null}return f},write:function(d){if(!(d instanceof Array)){d=[d]}var b=this.createElementNS(this.kmlns,"kml");var f=this.createFolderXML();for(var c=0,a=d.length;c<a;++c){f.appendChild(this.createPlacemarkXML(d[c]))}b.appendChild(f);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFolderXML:function(){var f=this.createElementNS(this.kmlns,"name");var d=this.createTextNode(this.foldersName);f.appendChild(d);var a=this.createElementNS(this.kmlns,"description");var b=this.createTextNode(this.foldersDesc);a.appendChild(b);var c=this.createElementNS(this.kmlns,"Folder");c.appendChild(f);c.appendChild(a);return c},createPlacemarkXML:function(f){var h=this.createElementNS(this.kmlns,"name");var c=(f.attributes.name)?f.attributes.name:f.id;h.appendChild(this.createTextNode(c));var d=this.createElementNS(this.kmlns,"description");var g=(f.attributes.description)?f.attributes.description:this.placemarksDesc;d.appendChild(this.createTextNode(g));var b=this.createElementNS(this.kmlns,"Placemark");if(f.fid!=null){b.setAttribute("id",f.fid)}b.appendChild(h);b.appendChild(d);var a=this.buildGeometryNode(f.geometry);b.appendChild(a);return b},buildGeometryNode:function(f){if(this.internalProjection&&this.externalProjection){f=f.clone();f.transform(this.internalProjection,this.externalProjection)}var c=f.CLASS_NAME;var b=c.substring(c.lastIndexOf(".")+1);var a=this.buildGeometry[b.toLowerCase()];var d=null;if(a){d=a.apply(this,[f])}return d},buildGeometry:{point:function(b){var a=this.createElementNS(this.kmlns,"Point");a.appendChild(this.buildCoordinatesNode(b));return a},multipoint:function(a){return this.buildGeometry.collection.apply(this,[a])},linestring:function(b){var a=this.createElementNS(this.kmlns,"LineString");a.appendChild(this.buildCoordinatesNode(b));return a},multilinestring:function(a){return this.buildGeometry.collection.apply(this,[a])},linearring:function(b){var a=this.createElementNS(this.kmlns,"LinearRing");a.appendChild(this.buildCoordinatesNode(b));return a},polygon:function(j){var b=this.createElementNS(this.kmlns,"Polygon");var h=j.components;var f,g,d;for(var c=0,a=h.length;c<a;++c){d=(c==0)?"outerBoundaryIs":"innerBoundaryIs";f=this.createElementNS(this.kmlns,d);g=this.buildGeometry.linearring.apply(this,[h[c]]);f.appendChild(g);b.appendChild(f)}return b},multipolygon:function(a){return this.buildGeometry.collection.apply(this,[a])},collection:function(d){var b=this.createElementNS(this.kmlns,"MultiGeometry");var f;for(var c=0,a=d.components.length;c<a;++c){f=this.buildGeometryNode.apply(this,[d.components[c]]);if(f){b.appendChild(f)}}return b}},buildCoordinatesNode:function(f){var a=this.createElementNS(this.kmlns,"coordinates");var k;var j=f.components;if(j){var h;var g=j.length;var c=new Array(g);for(var d=0;d<g;++d){h=j[d];c[d]=h.x+","+h.y}k=c.join(" ")}else{k=f.x+","+f.y}var b=this.createTextNode(k);a.appendChild(b);return a},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:false,interestingTagsExclude:null,areaTags:null,initialize:function(a){var d={interestingTagsExclude:["source","source_ref","source:ref","history","attribution","created_by"],areaTags:["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]};d=OpenLayers.Util.extend(d,a);var f={};for(var b=0;b<d.interestingTagsExclude.length;b++){f[d.interestingTagsExclude[b]]=true}d.interestingTagsExclude=f;var c={};for(var b=0;b<d.areaTags.length;b++){c[d.areaTags[b]]=true}d.areaTags=c;OpenLayers.Format.XML.prototype.initialize.apply(this,[d])},read:function(q){if(typeof q=="string"){q=OpenLayers.Format.XML.prototype.read.apply(this,[q])}var b=this.getNodes(q);var r=this.getWays(q);var h=new Array(r.length);for(var g=0;g<r.length;g++){var m=new Array(r[g].nodes.length);var a=this.isWayArea(r[g])?1:0;for(var f=0;f<r[g].nodes.length;f++){var c=b[r[g].nodes[f]];var o=new OpenLayers.Geometry.Point(c.lon,c.lat);o.osm_id=parseInt(r[g].nodes[f]);m[f]=o;c.used=true}var l=null;if(a){l=new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(m))}else{l=new OpenLayers.Geometry.LineString(m)}if(this.internalProjection&&this.externalProjection){l.transform(this.externalProjection,this.internalProjection)}var k=new OpenLayers.Feature.Vector(l,r[g].tags);k.osm_id=parseInt(r[g].id);k.fid="way."+k.osm_id;h[g]=k}for(var d in b){var c=b[d];if(!c.used||this.checkTags){var t=null;if(this.checkTags){var s=this.getTags(c.node,true);if(c.used&&!s[1]){continue}t=s[0]}else{t=this.getTags(c.node)}var k=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(c.lon,c.lat),t);if(this.internalProjection&&this.externalProjection){k.geometry.transform(this.externalProjection,this.internalProjection)}k.osm_id=parseInt(d);k.fid="node."+k.osm_id;h.push(k)}c.node=null}return h},getNodes:function(f){var d=f.getElementsByTagName("node");var a={};for(var b=0;b<d.length;b++){var c=d[b];var g=c.getAttribute("id");a[g]={lat:c.getAttribute("lat"),lon:c.getAttribute("lon"),node:c}}return a},getWays:function(h){var g=h.getElementsByTagName("way");var k=[];for(var d=0;d<g.length;d++){var b=g[d];var c={id:b.getAttribute("id")};c.tags=this.getTags(b);var f=b.getElementsByTagName("nd");c.nodes=new Array(f.length);for(var a=0;a<f.length;a++){c.nodes[a]=f[a].getAttribute("ref")}k.push(c)}return k},getTags:function(f,h){var a=f.getElementsByTagName("tag");var c={};var g=false;for(var b=0;b<a.length;b++){var d=a[b].getAttribute("k");c[d]=a[b].getAttribute("v");if(h){if(!this.interestingTagsExclude[d]){g=true}}}return h?[c,g]:c},isWayArea:function(b){var a=false;var d=false;if(b.nodes[0]==b.nodes[b.nodes.length-1]){a=true}if(this.checkTags){for(var c in b.tags){if(this.areaTags[c]){d=true;break}}}return a&&(this.checkTags?d:true)},write:function(d){if(!(d instanceof Array)){d=[d]}this.osm_id=1;this.created_nodes={};var f=this.createElementNS(null,"osm");f.setAttribute("version","0.5");f.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var c=d.length-1;c>=0;c--){var a=this.createFeatureNodes(d[c]);for(var b=0;b<a.length;b++){f.appendChild(a[b])}}return OpenLayers.Format.XML.prototype.write.apply(this,[f])},createFeatureNodes:function(c){var b=[];var f=c.geometry.CLASS_NAME;var d=f.substring(f.lastIndexOf(".")+1);d=d.toLowerCase();var a=this.createXML[d];if(a){b=a.apply(this,[c])}return b},createXML:{point:function(a){var f=null;var c=a.geometry?a.geometry:a;var d=false;if(a.osm_id){f=a.osm_id;if(this.created_nodes[f]){d=true}}else{f=-this.osm_id;this.osm_id++}if(d){b=this.created_nodes[f]}else{var b=this.createElementNS(null,"node")}this.created_nodes[f]=b;b.setAttribute("id",f);b.setAttribute("lon",c.x);b.setAttribute("lat",c.y);if(a.attributes){this.serializeTags(a,b)}this.setState(a,b);return d?[]:[b]},linestring:function(d){var a=[];var j=d.geometry;if(d.osm_id){id=d.osm_id}else{id=-this.osm_id;this.osm_id++}var b=this.createElementNS(null,"way");b.setAttribute("id",id);for(var c=0;c<j.components.length;c++){var g=this.createXML.point.apply(this,[j.components[c]]);if(g.length){g=g[0];var f=g.getAttribute("id");a.push(g)}else{f=j.components[c].osm_id;g=this.created_nodes[f]}this.setState(d,g);var h=this.createElementNS(null,"nd");h.setAttribute("ref",f);b.appendChild(h)}this.serializeTags(d,b);a.push(b);return a},polygon:function(b){var a=OpenLayers.Util.extend({area:"yes"},b.attributes);var c=new OpenLayers.Feature.Vector(b.geometry.components[0],a);c.osm_id=b.osm_id;return this.createXML.linestring.apply(this,[c])}},serializeTags:function(c,d){for(var b in c.attributes){var a=this.createElementNS(null,"tag");a.setAttribute("k",b);a.setAttribute("v",c.attributes[b]);d.appendChild(a)}},setState:function(a,b){if(a.state){var c=null;switch(a.state){case OpenLayers.State.UPDATE:c="modify";case OpenLayers.State.DELETE:c="delete"}if(c){b.setAttribute("action",c)}}},CLASS_NAME:"OpenLayers.Format.OSM"});OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(c,b,a){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var a=this.polygon&&this.polygon.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPolygon([a])}return a},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(c,b){OpenLayers.Control.Panel.prototype.initialize.apply(this,[b]);this.addControls([new OpenLayers.Control.Navigation()]);var a=[new OpenLayers.Control.DrawFeature(c,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(c,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(c,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon"})];this.addControls(a)},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);this.activateControl(this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:["antialiasing","blockout","font","fontcolor","fontsize","fontstyle","glowing","interval","outline","printmode","shadow","transparency"],request:null,response:null,initialize:function(a){this.request=new OpenLayers.Format.ArcXML.Request();this.response=new OpenLayers.Format.ArcXML.Response();if(a){if(a.requesttype=="feature"){this.request.get_image=null;var c=this.request.get_feature.query;this.addCoordSys(c.featurecoordsys,a.featureCoordSys);this.addCoordSys(c.filtercoordsys,a.filterCoordSys);if(a.polygon){c.isspatial=true;c.spatialfilter.polygon=a.polygon}else{if(a.envelope){c.isspatial=true;c.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0};this.parseEnvelope(c.spatialfilter.envelope,a.envelope)}}}else{if(a.requesttype=="image"){this.request.get_feature=null;var b=this.request.get_image.properties;this.parseEnvelope(b.envelope,a.envelope);this.addLayers(b.layerlist,a.layers);this.addImageSize(b.imagesize,a.tileSize);this.addCoordSys(b.f
