function addressAutoComplete(n,t,i,r,u){var f=!0;u!==undefined&&(f=!1);$("#"+n).autocomplete({source:function(u,f){$.ajax({url:t+"/query/",dataType:"jsonp",data:{where:"EZI_ADD LIKE '"+getSmartAddress(u.term.replace(/\'/g,"''"))+"%'",outFields:"EZI_ADD,COL_DAY,GRN_WASTE,PROPNUM,WARD,SUBURB",returnGeometry:!0,f:"pjson"},success:function(t){t.features&&f($.map(t.features.slice(0,6),function(u){return t.features.length===1&&autoPost&&($("#"+i+"Suggestions").empty(),$("#"+i).empty(),setFormFieldsArc(u),selectedAddress=!0,$("#"+r).show(),selectedAddressReturnAll(),$("#"+n).autocomplete("close"),autoPost=!0),{label:u.attributes.EZI_ADD,valuex:u.geometry.x,valuey:u.geometry.y,valuecolDay:u.attributes.COL_DAY,valuegrnWaste:u.attributes.GRN_WASTE,valuepropNum:u.attributes.PROPNUM,valueward:u.attributes.WARD,valuesuburb:u.attributes.SUBURB}}))}})},minLength:3,select:function(n,t){n.preventDefault();$("#"+r).show();$("#"+i).empty();setFormFields(t.item);selectedAddressReturnAll()}})}function getSmartAddress(n){var t=[[/\b\,/gi,"/"],[/^[\W]*?unit\s{1,}(([0-9]{0,})([\w]?))[\s{0,}]?([\/||-||,]{0,}?)[\s{0,}]?([0-9]{0,})\.?/gi,"$2$4/$5"],[/\b\s?\/\/?\s?/gi,"/"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}st[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 STREET $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}rd[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Road $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}fr?wy[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 FREEWAY $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}bl(vd)[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Boulevard $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}te?rr?[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Terrace $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}tce[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Terrace $6 "],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}pk[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Park $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}plz[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Plaza $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}pl[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Place $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}ln[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Lane $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}cir[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Circle $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}ct|crt[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Court $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}cl[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Close $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}sq[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Square $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}cr[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Crescent $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}dr[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Drive $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}drv[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Drive $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}dve[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Drive $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}GDNS[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Gardens $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}GR[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Grove $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}lne[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Lane $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}wy[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Way $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}aly[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Alley $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}ave[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 Avenue $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}lnk[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 LINK $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}pde[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 PARADE $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}trl[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 TRAIL $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}wkwy[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 WALKWAY $6"],[/^[\W]*([0-9]{1,})([/|,]?)([\w]{0,})([\s]?)([\w]{1,})[\s]{1,}wkwy[\s]{1,}([\sa-zA-Z0-9]{0,})$/gi,"$1$2$3$4$5 WALKWAY $6"],[/^[\W]*([0-9]{1,})[\s]{1,}street[\s]{1}([\sa-zA-Z0-9]{0,})$/gi,"$1 ST $2"],[/^[\W]*un?i?t?([\s]{0,})([\w]{0,})/gi,""],[/^[\W]*([\/]{0,})/gi,""],[/\b\/\//gi,"/"],[/[^a-zA-Z0-9\- \/\,]/gi,""]],r=n;for(var i in t)n=n.replace(t[i][0],t[i][1]);return r!==n,n}function searchAgain(n){$("#"+n+"Suggestions").hide();$("#address").val("").focus()}function searchAddressSubmit(){$("#selectedAddressSuggestions").hide();autoPost=!0;$(".ui-menu-item").hide()}function setAddressAutoComplete(n){$("#address").val(n);$("#address").autocomplete("search");autoPost=!0}function selectedAddressReturnAll(){$("#address").val()===""&&(zeroResults=!1);$("#sAddress").val($("#address").val());$("#address").prop("disabled",!1);autoPost}function selectedAddressSubmit(){$("#address").autocomplete("search");var t=getSmartAddress($("#address").val()),n="selectedAddress";return $(".ui-menu-item").length===0&&t.lastIndexOf(" ")>10?(autoPost=!0,$("#"+n+"Suggestions").hide(),setAddressAutoComplete(ucwords(t)),!1):($("#address").autocomplete("close"),$("#"+n+"Suggestions").show(),$("#"+n+"Suggestions").empty(),$("#"+n+"Suggestions").html("<strong><span class='noAddress'>Sorry we can't find that address. Please try again.<\/span><\/strong>"),$(".ui-menu-item").length>0&&($("#"+n+"Suggestions").empty(),$("#"+n+"Suggestions").show(),$("<div class='margin-top-bottom-3'><strong>Did you mean?<\/strong><\/div><ul id='autoSuggest'><\/ul>").appendTo("#"+n+"Suggestions"),$(".ui-menu-item").each(function(){ucwords($(this).text()).toUpperCase()===ucwords(t).toUpperCase()&&($("#"+n+"Suggestions").hide(),$("#sAddress").val(t),$("#address").val(t),$(".ui-menu-item").length===1&&(autoPost=!0,$("#"+n+"Suggestions").hide(),setAddressAutoComplete(ucwords($(this).text()))));$("<li><a href='#' onclick=\"$('#'+"+n+"+'Suggestions').empty();setAddressAutoComplete('"+ucwords($(this).text())+"');searchAddressSubmit();\">"+ucwords($(this).text())+"<\/a><\/li>").appendTo("#autoSuggest")}),$("<li><a href='#' onclick=\"searchAgain('"+n+"')\">Search again<\/td><\/li>").appendTo("#autoSuggest")),$(".ui-menu-item").hide(),!1)}function requestGeoLocation(){navigator.geolocation&&!tryAutoAddress&&navigator.geolocation.getCurrentPosition(function(n){Proj4js.defs["EPSG:28355"]="+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs";var i=new OpenLayers.Projection("EPSG:4326"),r=new OpenLayers.Projection("EPSG:28355"),u=new OpenLayers.LonLat(n.coords.longitude,n.coords.latitude),t=u.clone().transform(i,r);$.ajax({url:"https://geo.moreland.vic.gov.au/geoserver/Moreland/ows",dataType:"jsonp",data:{typename:"Moreland:Address",propertyName:"EZI_ADD,the_geom,COL_DAY,PROPNUM,WARD,GRN_WASTE,SUBURB",outputFormat:"text/javascript",service:"wfs",version:"1.0.0",request:"GetFeature",maxFeatures:1,cql_filter:"DWITHIN(the_geom,POINT("+t.lon+" "+t.lat+"),100,meters)"},jsonp:"false",jsonpCallback:"parseResponse",success:function(n){n.features[0].properties.EZI_ADD!==""&&$("#propNum").val()==""&&$("#address").val(n.features[0].properties.EZI_ADD)}})},function(){},{maximumAge:6e5,timeout:5e3,enableHighAccuracy:!0})}function ucwords(n){return n=n.toLowerCase(),n.replace(/(\b)([a-zA-Z])/g,function(n){return n.toUpperCase()})}function setFormFields(n){Proj4js.defs["ESPG:3857"]="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs";Proj4js.defs["EPSG:28355"]="+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs";var i=new OpenLayers.Projection("ESPG:3857"),r=new OpenLayers.Projection("EPSG:28355"),t=new OpenLayers.Geometry.Point(n.valuex,n.valuey).transform(i,r);$("#address").val(n.label);$("#xPoint").val(t.x);$("#yPoint").val(t.y);$("#colDay").val(n.valuecolDay);$("#grnWaste").val(n.valuegrnWaste);$("#ward").val(n.valueward);$("#propNum").val(n.valuepropNum);$("#suburb").val(n.valuesuburb);autoPost=!0}function setFormFieldsArc(n){Proj4js.defs["ESPG:3857"]="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs";Proj4js.defs["EPSG:28355"]="+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs";var i=new OpenLayers.Projection("ESPG:3857"),r=new OpenLayers.Projection("EPSG:28355"),t=new OpenLayers.Geometry.Point(n.geometry.x,n.geometry.y).transform(i,r);$("#address").val(n.attributes.EZI_ADD);$("#xPoint").val(t.x);$("#yPoint").val(t.y);$("#colDay").val(n.attributes.COL_DAY);$("#grnWaste").val(n.attributes.GRN_WASTE);$("#ward").val(n.attributes.WARD);$("#propNum").val(n.attributes.PROPNUM);$("#suburb").val(n.attributes.SUBURB);autoPost=!0}function parseResponse(n){return n}function calcDistance(n){var t=(n/1e3).toFixed(1);return(t=t.replace(".0",""),t<1)?t*1e3+" m":t>=1?t+" km":""}function padBounds(n,t){var r=n.x,u=n.y,i=150;n.x>t.x&&(r=n.x+i);n.x<t.x&&(r=n.x-i);n.y>t.y&&(u=n.y+i);n.y<t.y&&(u=n.y-i);bounds.extend(new OpenLayers.Geometry.Point(r,u))}function openPopUpAndSetCenter(n,t){var e,o,u,s,f,r,i,h,c;for($(".list-view-block").addClass("hide"),$(".map-view-block").removeClass("hide"),e="",o="",u=0;u<layerNames.length;u++)layerNames[u].group===n&&(e=layerNames[u].selectedImage,o=layerNames[u].image);for(s=map.getControlsBy("id","featureSelect")[0],f=0;f<s.layers.length;f++)for(r=s.layers[f],i=0;i<r.features.length;i++)r.features[i].fid.toUpperCase()===t.toUpperCase()?(h=r.features[i],h.style={externalGraphic:e,graphicWidth:35,graphicHeight:35,cursor:"pointer"},c=new OpenLayers.LonLat(r.features[i].geometry.x,r.features[i].geometry.y),createPopup(r.features[i],"none"),map.setCenter(c)):r.features[i].style={externalGraphic:o,graphicWidth:35,graphicHeight:35,cursor:"pointer"}}function highlightIcon(n){for(var u,f,i,r,e,t=0;t<layerNames.length;t++)if(u="",f="",u=layerNames[t].selectedImage,f=layerNames[t].image,u!==""&&f!==""){for(i=map.getLayersByName(layerNames[t].name)[0],r=0;r<i.features.length;r++)e=i.features[r],e.style=i.features[r].fid.toUpperCase()===n.fid.toUpperCase()?{externalGraphic:u,graphicWidth:35,graphicHeight:35,cursor:"pointer"}:{externalGraphic:f,graphicWidth:35,graphicHeight:35,cursor:"pointer"};i.redraw()}}function openPopUpNoSetCenter(n,t){var e,o,r,s,f,u,i,h;for($(".list-view-block").addClass("hide"),$(".map-view-block").removeClass("hide"),e="",o="",r=0;r<layerNames.length;r++)layerNames[r].group===n&&(e=layerNames[r].selectedImage,o=layerNames[r].image);for(s=map.getControlsBy("id","featureSelect")[0],f=0;f<s.layers.length;f++)for(u=s.layers[f],i=0;i<u.features.length;i++)u.features[i].fid.toUpperCase()===t.toUpperCase()?(h=u.features[i],h.style={externalGraphic:e,graphicWidth:35,graphicHeight:35,cursor:"pointer"},createPopup(u.features[i],"none")):u.features[i].style={externalGraphic:o,graphicWidth:35,graphicHeight:35,cursor:"pointer"};setTimeout(function(){try{$(".toolbar").get(0).scrollIntoView()}catch(n){}},300)}function openPopUpNoSetCenterHoverOnly(n,t){var u,f,e,r,i,h,s,o;for($(".list-view-block").addClass("hide"),$(".map-view-block").removeClass("hide"),u="",f="",e=0;e<layerNames.length;e++)layerNames[e].group===n&&(u=layerNames[e].selectedImage,f=layerNames[e].image);for(r="",i=map.getLayersByName(n),h=0;h<i.length;h++){for(s=i[h],o=0;o<s.features.length;o++)s.features[o].fid.toUpperCase()===t.toUpperCase()?(map.setLayerIndex(i[0],map.layers.length-1),r=s.features[o],r.style={externalGraphic:u,graphicWidth:35,graphicHeight:35,cursor:"pointer"}):s.features[o].style={externalGraphic:f,graphicWidth:35,graphicHeight:35,cursor:"pointer"};i[0].redraw()}setTimeout(function(){try{$(".maps").get(0).scrollIntoView()}catch(n){}},100);f!==""&&u!==""&&setTimeout(function(){try{r.style={externalGraphic:f,graphicWidth:35,graphicHeight:35,cursor:"pointer"};i[0].redraw();setTimeout(function(){try{r.style={externalGraphic:u,graphicWidth:35,graphicHeight:35,cursor:"pointer"};i[0].redraw();setTimeout(function(){try{r.style={externalGraphic:f,graphicWidth:35,graphicHeight:35,cursor:"pointer"};i[0].redraw();setTimeout(function(){try{r.style={externalGraphic:u,graphicWidth:35,graphicHeight:35,cursor:"pointer"};i[0].redraw()}catch(n){}},500)}catch(n){}},500)}catch(n){}},500)}catch(n){}},500)}function getDistanceToFeature(n,t,i){return t===""?"":calcDistance(Math.sqrt(Math.pow(t.x-n.geometry.x,2)+Math.pow(t.y-n.geometry.y,2)))+i}function getActiveLayers(){var n=0;return $("input.ima-layers[type=checkbox]").each(function(){$(this).is(":checked")&&n++}),n}function updateSectionHeadings(){var n="";$("#council-and-community-facilities div div").each(function(){n=n+$(this).html()});n===""?$("#council-and-community-facilities").hide():$("#council-and-community-facilities").show();n="";$("#recreation-and-arts-facilities div div").each(function(){n=n+$(this).html()});n===""?$("#recreation-and-arts-facilities").hide():$("#recreation-and-arts-facilities").show();n="";$("#early-years-facilities div div").each(function(){n=n+$(this).html()});n===""?$("#early-years-facilities").hide():$("#early-years-facilities").show();n="";$("#schools-facilities div div").each(function(){n=n+$(this).html()});n===""?$("#schools-facilities").hide():$("#schools-facilities").show()}function checkisMobileDevice(){var t,n,i;if(/Android|webOS|iPhone|iPod|iPad|BlackBerry|IEMobile|Opera Mini/gi.test(navigator.userAgent)){for(t=[],n=0;n<layerNames.length;n++)t.push(map.getLayersByName(layerNames[n].name)[0]);i=new OpenLayers.Control.SelectFeature(t,{id:"featureSelect2",onSelect:function(n){createPopup(n,"none",currentMouseLocation)},onUnselect:function(){}});map.addControl(i);i.activate()}}function phi4z(n,t,i,r,u,f,e,o,s){var l,c,p,h,a,w,b,k,v,y;for(s=f,y=1;y<=15;y++)if(l=Math.sin(s),p=Math.tan(s),o=p*Math.sqrt(1-n*l*l),c=Math.sin(2*s),h=t*s-i*c+r*Math.sin(4*s)-u*Math.sin(6*s),a=t-2*i*Math.cos(2*s)+4*r*Math.cos(4*s)-6*u*Math.cos(6*s),w=2*h+o*(h*h+e)-2*f*(o*h+1),b=n*c*(h*h+e-2*f*h)/(2*o),k=2*(f-h)*(o*a-2/c)-2*a,v=w/(b+k),s+=v,Math.abs(v)<=1e-10)return s;return Proj4js.reportError("phi4z: No convergence"),null}function e4fn(n){var t,i;return t=1+n,i=1-n,Math.sqrt(Math.pow(t,t)*Math.pow(i,i))}var autocompleteData="",selectedAddress=!1,setfirstAddress=!1,tryAutoAddress=!1,zeroResults=!1,autoPost=!1,submitted=!1,OpenLayers,Event,Proj4js;(function(){if(!window.google||!google.gears){var n=null;if("undefined"!=typeof GearsFactory)n=new GearsFactory;else try{n=new ActiveXObject("Gears.Factory");-1!=n.getBuildInfo().indexOf("ie_mobile")&&n.privateSetGlobalObject(this)}catch(t){navigator.mimeTypes!==void 0&&navigator.mimeTypes["application/x-googlegears"]&&(n=document.createElement("object"),n.style.display="none",n.width=0,n.height=0,n.type="application/x-googlegears",document.documentElement.appendChild(n))}n&&(window.google||(google={}),google.gears||(google.gears={factory:n}))}})();OpenLayers={VERSION_NUMBER:"Release 2.11",singleFile:!0,_getScriptLocation:function(){for(var n,i,f=RegExp("(^|(.*?\\/))(OpenLayers.js)(\\?|$)"),r=document.getElementsByTagName("script"),u="",t=0,e=r.length;e>t;t++)if((i=r[t].getAttribute("src"))&&(n=i.match(f),n)){u=n[1];break}return function(){return u}}()};(OpenLayers.Class=function(){var t=arguments.length,r=arguments[0],n=arguments[t-1],i="function"==typeof n.initialize?n.initialize:function(){r.prototype.initialize.apply(this,arguments)},u;return t>1?(u=[i,r].concat(Array.prototype.slice.call(arguments).slice(1,t-1),n),OpenLayers.inherit.apply(null,u)):i.prototype=n,i},OpenLayers.Class.isPrototype=function(){},OpenLayers.Class.create=function(){return function(){arguments&&arguments[0]!=OpenLayers.Class.isPrototype&&this.initialize.apply(this,arguments)}},OpenLayers.Class.inherit=function(n){var t=function(){n.call(this)},i=[t].concat(Array.prototype.slice.call(arguments));return OpenLayers.inherit.apply(null,i),t.prototype},OpenLayers.inherit=function(n,t){var u=function(){},r,f,i;for(u.prototype=t.prototype,n.prototype=new u,r=2,f=arguments.length;f>r;r++)i=arguments[r],"function"==typeof i&&(i=i.prototype),OpenLayers.Util.extend(n.prototype,i)},OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.extend=function(n,t){var i,r,u;if(n=n||{},t){for(i in t)r=t[i],void 0!==r&&(n[i]=r);u="function"==typeof Event&&t instanceof window.Event;!u&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(n.toString=t.toString)}return n},OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:!0,defaultFilter:null,initialize:function(n){n=n||{};OpenLayers.Util.extend(this,n);this.options=n},mergeWithDefaultFilter:function(n){return n&&this.defaultFilter?new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,n]}):n||this.defaultFilter||void 0},destroy:function(){this.options=null;this.format=null},read:function(n){n=n||{};n.filter=this.mergeWithDefaultFilter(n.filter)},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(){},createCallback:function(n,t,i){return OpenLayers.Function.bind(function(){n.apply(this,[t,i])},this)},CLASS_NAME:"OpenLayers.Protocol"}),OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:!0,features:null,reqFeatures:null,priv:null,error:null,initialize:function(n){OpenLayers.Util.extend(this,n)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"}),OpenLayers.Protocol.Response.SUCCESS=1,OpenLayers.Protocol.Response.FAILURE=0,OpenLayers.Protocol.SQL=OpenLayers.Class(OpenLayers.Protocol,{databaseName:"ol",tableName:"ol_vector_features",postReadFiltering:!0,initialize:function(n){OpenLayers.Protocol.prototype.initialize.apply(this,[n])},destroy:function(){OpenLayers.Protocol.prototype.destroy.apply(this)},supported:function(){return!1},evaluateFilter:function(n,t){return t&&this.postReadFiltering?t.evaluate(n):!0},CLASS_NAME:"OpenLayers.Protocol.SQL"}),OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(n){alert(n)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"},function(){for(var t=document.getElementsByTagName("script"),n=0,i=t.length;i>n;++n)if(-1!=t[n].src.indexOf("firebug.js")&&console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}(),OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){return OpenLayers.Lang.code||OpenLayers.Lang.setCode(),OpenLayers.Lang.code},setCode:function(n){var i,t,r;n||(n="msie"==OpenLayers.BROWSER_NAME?navigator.userLanguage:navigator.language);t=n.split("-");(t[0]=t[0].toLowerCase(),"object"==typeof OpenLayers.Lang[t[0]]&&(i=t[0]),t[1])&&(r=t[0]+"-"+t[1].toUpperCase(),"object"==typeof OpenLayers.Lang[r]&&(i=r));i||(OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+t.join("-")+" dictionary, falling back to default language"),i=OpenLayers.Lang.defaultCode);OpenLayers.Lang.code=i},translate:function(n,t){var r=OpenLayers.Lang[OpenLayers.Lang.getCode()],i=r&&r[n];return i||(i=n),t&&(i=OpenLayers.String.format(i,t)),i}},OpenLayers.i18n=OpenLayers.Lang.translate,OpenLayers.String={startsWith:function(n,t){return 0==n.indexOf(t)},contains:function(n,t){return-1!=n.indexOf(t)},trim:function(n){return n.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(n){for(var r,t=n.split("-"),u=t[0],i=1,f=t.length;f>i;i++)r=t[i],u+=r.charAt(0).toUpperCase()+r.substring(1);return u},format:function(n,t,i){t||(t=window);var r=function(n,r){for(var u,e=r.split(/\.+/),f=0;e.length>f;f++)0==f&&(u=t),u=u[e[f]];return"function"==typeof u&&(u=i?u.apply(null,i):u()),u===void 0?"undefined":u};return n.replace(OpenLayers.String.tokenRegEx,r)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(n){return OpenLayers.String.numberRegEx.test(n)},numericIf:function(n){return OpenLayers.String.isNumeric(n)?parseFloat(n):n}},String.prototype.startsWith||(String.prototype.startsWith=function(n){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"})),OpenLayers.String.startsWith(this,n)}),String.prototype.contains||(String.prototype.contains=function(n){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"})),OpenLayers.String.contains(this,n)}),String.prototype.trim||(String.prototype.trim=function(){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"})),OpenLayers.String.trim(this)}),String.prototype.camelize||(String.prototype.camelize=function(){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"})),OpenLayers.String.camelize(this)}),OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(n,t){var i=0;return t>0&&(i=parseFloat(n.toPrecision(t))),i},format:function(n,t,i,r){var f,u,o,s,e;if(t=t!==void 0?t:0,i=i!==void 0?i:OpenLayers.Number.thousandsSeparator,r=r!==void 0?r:OpenLayers.Number.decimalSeparator,null!=t&&(n=parseFloat(n.toFixed(t))),f=(""+n).split("."),1==f.length&&null==t&&(t=0),u=f[0],i)for(o=/(-?[0-9]+)([0-9]{3})/;o.test(u);)u=u.replace(o,"$1"+i+"$2");return 0==t?s=u:(e=f.length>1?f[1]:"0",null!=t&&(e+=Array(t-e.length+1).join("0")),s=u+r+e),s}},Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(n){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"})),OpenLayers.Number.limitSigDigs(this,n)}),OpenLayers.Function={bind:function(n,t){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var r=i.concat(Array.prototype.slice.apply(arguments,[0]));return n.apply(t,r)}},bindAsEventListener:function(n,t){return function(i){return n.call(t,i||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},Function.prototype.bind||(Function.prototype.bind=function(){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bind"})),Array.prototype.unshift.apply(arguments,[this]),OpenLayers.Function.bind.apply(null,arguments)}),Function.prototype.bindAsEventListener||(Function.prototype.bindAsEventListener=function(n){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"})),OpenLayers.Function.bindAsEventListener(this,n)}),OpenLayers.Array={filter:function(n,t,i){var u=[],e,r,f;if(Array.prototype.filter)u=n.filter(t,i);else{if(e=n.length,"function"!=typeof t)throw new TypeError;for(r=0;e>r;r++)r in n&&(f=n[r],t.call(i,f,r,n)&&u.push(f))}return u}},OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(n,t,i,r){null!=n&&(this.left=OpenLayers.Util.toFloat(n));null!=t&&(this.bottom=OpenLayers.Util.toFloat(t));null!=i&&(this.right=OpenLayers.Util.toFloat(i));null!=r&&(this.top=OpenLayers.Util.toFloat(r))},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(n){var t=!1;return null!=n&&(t=this.left==n.left&&this.right==n.right&&this.top==n.top&&this.bottom==n.bottom),t},toString:function(){return[this.left,this.bottom,this.right,this.top].join(",")},toArray:function(n){return n===!0?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]},toBBOX:function(n,t){null==n&&(n=6);var i=Math.pow(10,n),r=Math.round(this.left*i)/i,u=Math.round(this.bottom*i)/i,f=Math.round(this.right*i)/i,e=Math.round(this.top*i)/i;return t===!0?u+","+r+","+e+","+f:r+","+u+","+f+","+e},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return this.right-this.left},getHeight:function(){return this.top-this.bottom},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){return this.centerLonLat||(this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat},scale:function(n,t){var i,r;null==t&&(t=this.getCenterLonLat());"OpenLayers.LonLat"==t.CLASS_NAME?(i=t.lon,r=t.lat):(i=t.x,r=t.y);var u=(this.left-i)*n+i,f=(this.bottom-r)*n+r,e=(this.right-i)*n+i,o=(this.top-r)*n+r;return new OpenLayers.Bounds(u,f,e,o)},add:function(n,t){if(null==n||null==t){var i=OpenLayers.i18n("boundsAddError");return OpenLayers.Console.error(i),null}return new OpenLayers.Bounds(this.left+n,this.bottom+t,this.right+n,this.top+t)},extend:function(n){var t=null;if(n){switch(n.CLASS_NAME){case"OpenLayers.LonLat":t=new OpenLayers.Bounds(n.lon,n.lat,n.lon,n.lat);break;case"OpenLayers.Geometry.Point":t=new OpenLayers.Bounds(n.x,n.y,n.x,n.y);break;case"OpenLayers.Bounds":t=n}t&&(this.centerLonLat=null,(null==this.left||t.left<this.left)&&(this.left=t.left),(null==this.bottom||t.bottom<this.bottom)&&(this.bottom=t.bottom),(null==this.right||t.right>this.right)&&(this.right=t.right),(null==this.top||t.top>this.top)&&(this.top=t.top))}},containsLonLat:function(n,t){return this.contains(n.lon,n.lat,t)},containsPixel:function(n,t){return this.contains(n.x,n.y,t)},contains:function(n,t,i){if(null==i&&(i=!0),null==n||null==t)return!1;n=OpenLayers.Util.toFloat(n);t=OpenLayers.Util.toFloat(t);return i?n>=this.left&&this.right>=n&&t>=this.bottom&&this.top>=t:n>this.left&&this.right>n&&t>this.bottom&&this.top>t},intersectsBounds:function(n,t){var i,r;if(null==t&&(t=!0),i=!1,r=this.left==n.right||this.right==n.left||this.top==n.bottom||this.bottom==n.top,t||!r){var u=n.bottom>=this.bottom&&n.bottom<=this.top||this.bottom>=n.bottom&&this.bottom<=n.top,f=n.top>=this.bottom&&n.top<=this.top||this.top>n.bottom&&this.top<n.top,e=n.left>=this.left&&n.left<=this.right||this.left>=n.left&&this.left<=n.right,o=n.right>=this.left&&n.right<=this.right||this.right>=n.left&&this.right<=n.right;i=(u||f)&&(e||o)}return i},containsBounds:function(n,t,i){null==t&&(t=!1);null==i&&(i=!0);var r=this.contains(n.left,n.bottom,i),u=this.contains(n.right,n.bottom,i),f=this.contains(n.left,n.top,i),e=this.contains(n.right,n.top,i);return t?r||u||f||e:r&&u&&f&&e},determineQuadrant:function(n){var t="",i=this.getCenterLonLat();return t+=n.lat<i.lat?"b":"t",t+(n.lon<i.lon?"l":"r")},transform:function(n,t){this.centerLonLat=null;var i=OpenLayers.Projection.transform({x:this.left,y:this.bottom},n,t),r=OpenLayers.Projection.transform({x:this.right,y:this.bottom},n,t),u=OpenLayers.Projection.transform({x:this.left,y:this.top},n,t),f=OpenLayers.Projection.transform({x:this.right,y:this.top},n,t);return this.left=Math.min(i.x,u.x),this.bottom=Math.min(i.y,r.y),this.right=Math.max(r.x,f.x),this.top=Math.max(u.y,f.y),this},wrapDateLine:function(n,t){t=t||{};var r=t.leftTolerance||0,u=t.rightTolerance||0,i=this.clone();if(n){for(;i.left<n.left&&i.right-u<=n.left;)i=i.add(n.getWidth(),0);for(;i.left+r>=n.right&&i.right>n.right;)i=i.add(-n.getWidth(),0)}return i},CLASS_NAME:"OpenLayers.Bounds"}),OpenLayers.Bounds.fromString=function(n,t){var i=n.split(",");return OpenLayers.Bounds.fromArray(i,t)},OpenLayers.Bounds.fromArray=function(n,t){return t===!0?new OpenLayers.Bounds(parseFloat(n[1]),parseFloat(n[0]),parseFloat(n[3]),parseFloat(n[2])):new OpenLayers.Bounds(parseFloat(n[0]),parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]))},OpenLayers.Bounds.fromSize=function(n){return new OpenLayers.Bounds(0,n.h,n.w,0)},OpenLayers.Bounds.oppositeQuadrant=function(n){var t="";return t+="t"==n.charAt(0)?"b":"t",t+("l"==n.charAt(1)?"r":"l")},OpenLayers.Element={visible:function(n){return"none"!=OpenLayers.Util.getElement(n).style.display},toggle:function(){for(var t,r,n=0,i=arguments.length;i>n;n++)t=OpenLayers.Util.getElement(arguments[n]),r=OpenLayers.Element.visible(t)?"hide":"show",OpenLayers.Element[r](t)},hide:function(){var n,i,t;for(OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"element.style.display = 'none';"})),n=0,i=arguments.length;i>n;n++)t=OpenLayers.Util.getElement(arguments[n]),t&&(t.style.display="none")},show:function(){var n,i,t;for(OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"element.style.display = '';"})),n=0,i=arguments.length;i>n;n++)t=OpenLayers.Util.getElement(arguments[n]),t&&(t.style.display="")},remove:function(n){n=OpenLayers.Util.getElement(n);n.parentNode.removeChild(n)},getHeight:function(n){return n=OpenLayers.Util.getElement(n),n.offsetHeight},getDimensions:function(n){var i,r;if(n=OpenLayers.Util.getElement(n),"none"!=OpenLayers.Element.getStyle(n,"display"))return{width:n.offsetWidth,height:n.offsetHeight};var t=n.style,u=t.visibility,f=t.position,e=t.display;return t.visibility="hidden",t.position="absolute",t.display="",i=n.clientWidth,r=n.clientHeight,t.display=e,t.position=f,t.visibility=u,{width:i,height:r}},hasClass:function(n,t){var i=n.className;return!!i&&RegExp("(^|\\s)"+t+"(\\s|$)").test(i)},addClass:function(n,t){return OpenLayers.Element.hasClass(n,t)||(n.className+=(n.className?" ":"")+t),n},removeClass:function(n,t){var i=n.className;return i&&(n.className=OpenLayers.String.trim(i.replace(RegExp("(^|\\s+)"+t+"(\\s+|$)")," "))),n},toggleClass:function(n,t){return OpenLayers.Element.hasClass(n,t)?OpenLayers.Element.removeClass(n,t):OpenLayers.Element.addClass(n,t),n},getStyle:function(n,t){var i,r,u;return n=OpenLayers.Util.getElement(n),i=null,n&&n.style&&((i=n.style[OpenLayers.String.camelize(t)],i)||(document.defaultView&&document.defaultView.getComputedStyle?(r=document.defaultView.getComputedStyle(n,null),i=r?r.getPropertyValue(t):null):n.currentStyle&&(i=n.currentStyle[OpenLayers.String.camelize(t)])),u=["left","top","right","bottom"],window.opera&&-1!=OpenLayers.Util.indexOf(u,t)&&"static"==OpenLayers.Element.getStyle(n,"position")&&(i="auto")),"auto"==i?null:i}},OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(n,t){this.lon=OpenLayers.Util.toFloat(n);this.lat=OpenLayers.Util.toFloat(t)},toString:function(){return"lon="+this.lon+",lat="+this.lat},toShortString:function(){return this.lon+", "+this.lat},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(n,t){if(null==n||null==t){var i=OpenLayers.i18n("lonlatAddError");return OpenLayers.Console.error(i),null}return new OpenLayers.LonLat(this.lon+OpenLayers.Util.toFloat(n),this.lat+OpenLayers.Util.toFloat(t))},equals:function(n){var t=!1;return null!=n&&(t=this.lon==n.lon&&this.lat==n.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(n.lon)&&isNaN(n.lat)),t},transform:function(n,t){var i=OpenLayers.Projection.transform({x:this.lon,y:this.lat},n,t);return this.lon=i.x,this.lat=i.y,this},wrapDateLine:function(n){var t=this.clone();if(n){for(;t.lon<n.left;)t.lon+=n.getWidth();for(;t.lon>n.right;)t.lon-=n.getWidth()}return t},CLASS_NAME:"OpenLayers.LonLat"}),OpenLayers.LonLat.fromString=function(n){var t=n.split(",");return new OpenLayers.LonLat(t[0],t[1])},OpenLayers.LonLat.fromArray=function(n){var t=OpenLayers.Util.isArray(n),i=t&&n[0],r=t&&n[1];return new OpenLayers.LonLat(i,r)},OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(n,t){this.x=parseFloat(n);this.y=parseFloat(t)},toString:function(){return"x="+this.x+",y="+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(n){var t=!1;return null!=n&&(t=this.x==n.x&&this.y==n.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(n.x)&&isNaN(n.y)),t},distanceTo:function(n){return Math.sqrt(Math.pow(this.x-n.x,2)+Math.pow(this.y-n.y,2))},add:function(n,t){if(null==n||null==t){var i=OpenLayers.i18n("pixelAddError");return OpenLayers.Console.error(i),null}return new OpenLayers.Pixel(this.x+n,this.y+t)},offset:function(n){var t=this.clone();return n&&(t=this.add(n.x,n.y)),t},CLASS_NAME:"OpenLayers.Pixel"}),OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(n,t){this.w=parseFloat(n);this.h=parseFloat(t)},toString:function(){return"w="+this.w+",h="+this.h},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(n){var t=!1;return null!=n&&(t=this.w==n.w&&this.h==n.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(n.w)&&isNaN(n.h)),t},CLASS_NAME:"OpenLayers.Size"}),OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.getElement=function(){for(var n,i=[],t=0,r=arguments.length;r>t;t++){if(n=arguments[t],"string"==typeof n&&(n=document.getElementById(n)),1==arguments.length)return n;i.push(n)}return i},OpenLayers.Util.isElement=function(n){return!(!n||1!==n.nodeType)},OpenLayers.Util.isArray=function(n){return"[object Array]"===Object.prototype.toString.call(n)},window.$===void 0&&(window.$=OpenLayers.Util.getElement),OpenLayers.Util.removeItem=function(n,t){for(var i=n.length-1;i>=0;i--)n[i]==t&&n.splice(i,1);return n},OpenLayers.Util.clearArray=function(n){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));n.length=0},OpenLayers.Util.indexOf=function(n,t){if("function"==typeof n.indexOf)return n.indexOf(t);for(var i=0,r=n.length;r>i;i++)if(n[i]==t)return i;return-1},OpenLayers.Util.modifyDOMElement=function(n,t,i,r,u,f,e,o){t&&(n.id=t);i&&(n.style.left=i.x+"px",n.style.top=i.y+"px");r&&(n.style.width=r.w+"px",n.style.height=r.h+"px");u&&(n.style.position=u);f&&(n.style.border=f);e&&(n.style.overflow=e);parseFloat(o)>=0&&1>parseFloat(o)?(n.style.filter="alpha(opacity="+100*o+")",n.style.opacity=o):1==parseFloat(o)&&(n.style.filter="",n.style.opacity="")},OpenLayers.Util.createDiv=function(n,t,i,r,u,f,e,o){var s=document.createElement("div");return r&&(s.style.backgroundImage="url("+r+")"),n||(n=OpenLayers.Util.createUniqueID("OpenLayersDiv")),u||(u="absolute"),OpenLayers.Util.modifyDOMElement(s,n,t,i,u,f,e,o),s},OpenLayers.Util.createImage=function(n,t,i,r,u,f,e,o){var s=document.createElement("img");return n||(n=OpenLayers.Util.createUniqueID("OpenLayersDiv")),u||(u="relative"),OpenLayers.Util.modifyDOMElement(s,n,t,i,u,f,null,e),o&&(s.style.display="none",OpenLayers.Event.observe(s,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,s)),OpenLayers.Event.observe(s,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,s))),s.style.alt=n,s.galleryImg="no",r&&(s.src=r),s},OpenLayers.Util.setOpacity=function(n,t){OpenLayers.Util.modifyDOMElement(n,null,null,null,null,null,null,t)},OpenLayers.Util.onImageLoad=function(){(!this.viewRequestID||this.map&&this.viewRequestID==this.map.viewRequestID)&&(this.style.display="");OpenLayers.Element.removeClass(this,"olImageLoadError")},OpenLayers.IMAGE_RELOAD_ATTEMPTS=0,OpenLayers.Util.onImageLoadError=function(){var n,i,t,f,r,u;if(this._attempts=this._attempts?this._attempts+1:1,this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS)if(n=this.urls,n&&OpenLayers.Util.isArray(n)&&n.length>1){for(f=""+this.src,t=0;(i=n[t])&&-1==f.indexOf(i);t++);for(r=Math.floor(n.length*Math.random()),u=n[r],t=0;u==i&&4>t++;)r=Math.floor(n.length*Math.random()),u=n[r];this.src=f.replace(i,u)}else this.src=this.src;else OpenLayers.Element.addClass(this,"olImageLoadError");this.style.display=""},OpenLayers.Util.alphaHackNeeded=null,OpenLayers.Util.alphaHack=function(){if(null==OpenLayers.Util.alphaHackNeeded){var i=navigator.appVersion.split("MSIE"),n=parseFloat(i[1]),t=!1;try{t=!!document.body.filters}catch(r){}OpenLayers.Util.alphaHackNeeded=t&&n>=5.5&&7>n}return OpenLayers.Util.alphaHackNeeded},OpenLayers.Util.modifyAlphaImageDiv=function(n,t,i,r,u,f,e,o,s){OpenLayers.Util.modifyDOMElement(n,t,i,r,f,null,null,s);var h=n.childNodes[0];u&&(h.src=u);OpenLayers.Util.modifyDOMElement(h,n.id+"_innerImage",null,r,"relative",e);OpenLayers.Util.alphaHack()&&("none"!=n.style.display&&(n.style.display="inline-block"),null==o&&(o="scale"),n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+h.src+"', sizingMethod='"+o+"')",parseFloat(n.style.opacity)>=0&&1>parseFloat(n.style.opacity)&&(n.style.filter+=" alpha(opacity="+100*n.style.opacity+")"),h.style.filter="alpha(opacity=0)")},OpenLayers.Util.createAlphaImageDiv=function(n,t,i,r,u,f,e,o,s){var h=OpenLayers.Util.createDiv(),c=OpenLayers.Util.createImage(null,null,null,null,null,null,null,!1);return h.appendChild(c),s&&(c.style.display="none",OpenLayers.Event.observe(c,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,h)),OpenLayers.Event.observe(c,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,h))),OpenLayers.Util.modifyAlphaImageDiv(h,n,t,i,r,u,f,e,o),h},OpenLayers.Util.upperCaseObject=function(n){var t={};for(var i in n)t[i.toUpperCase()]=n[i];return t},OpenLayers.Util.applyDefaults=function(n,t){var r,i;n=n||{};r="function"==typeof Event&&t instanceof window.Event;for(i in t)(void 0===n[i]||!r&&t.hasOwnProperty&&t.hasOwnProperty(i)&&!n.hasOwnProperty(i))&&(n[i]=t[i]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!n.hasOwnProperty("toString")&&(n.toString=t.toString),n},OpenLayers.Util.getParameterString=function(n){var e=[],r,t,u;for(r in n)if(t=n[r],null!=t&&"function"!=typeof t){if("object"==typeof t&&t.constructor==Array){for(var i,o=[],f=0,s=t.length;s>f;f++)i=t[f],o.push(encodeURIComponent(null===i||void 0===i?"":i));u=o.join(",")}else u=encodeURIComponent(t);e.push(encodeURIComponent(r)+"="+u)}return e.join("&")},OpenLayers.Util.urlAppend=function(n,t){var r=n,i;return t&&(i=(n+" ").split(/[?&]/),r+=" "===i.pop()?t:i.length?"&"+t:"?"+t),r},OpenLayers.ImgPath="",OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+"img/"},OpenLayers.Util.Try=function(){for(var i,t=null,n=0,r=arguments.length;r>n;n++){i=arguments[n];try{t=i();break}catch(u){}}return t},OpenLayers.Util.getXmlNodeValue=function(n){var t=null;return OpenLayers.Util.Try(function(){t=n.text;t||(t=n.textContent);t||(t=n.firstChild.nodeValue)},function(){t=n.textContent}),t},OpenLayers.Util.mouseLeft=function(n,t){for(var i=n.relatedTarget?n.relatedTarget:n.toElement;i!=t&&null!=i;)i=i.parentNode;return i!=t},OpenLayers.Util.DEFAULT_PRECISION=14,OpenLayers.Util.toFloat=function(n,t){return null==t&&(t=OpenLayers.Util.DEFAULT_PRECISION),"number"!=typeof n&&(n=parseFloat(n)),0===t?n:parseFloat(n.toPrecision(t))},OpenLayers.Util.rad=function(n){return n*Math.PI/180},OpenLayers.Util.deg=function(n){return 180*n/Math.PI},OpenLayers.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563},OpenLayers.Util.distVincenty=function(n,t){for(var y=OpenLayers.Util.VincentyConstants,g=y.a,e=y.b,o=y.f,nt=OpenLayers.Util.rad(t.lon-n.lon),tt=Math.atan((1-o)*Math.tan(OpenLayers.Util.rad(n.lat))),it=Math.atan((1-o)*Math.tan(OpenLayers.Util.rad(t.lat))),h=Math.sin(tt),c=Math.cos(tt),l=Math.sin(it),f=Math.cos(it),s=nt,rt=2*Math.PI,ut=20;Math.abs(s-rt)>1e-12&&--ut>0;){var p=Math.sin(s),w=Math.cos(s),u=Math.sqrt(f*p*f*p+(c*l-h*f*w)*(c*l-h*f*w));if(0==u)return 0;var a=h*l+c*f*w,ft=Math.atan2(u,a),b=Math.asin(c*f*p/u),v=Math.cos(b)*Math.cos(b),i=a-2*h*l/v,k=o/16*v*(4+o*(4-3*v));rt=s;s=nt+(1-k)*o*Math.sin(b)*(ft+k*u*(i+k*a*(-1+2*i*i)))}if(0==ut)return NaN;var r=v*(g*g-e*e)/(e*e),et=1+r/16384*(4096+r*(-768+r*(320-175*r))),d=r/1024*(256+r*(-128+r*(74-47*r))),ot=d*u*(i+d/4*(a*(-1+2*i*i)-d/6*i*(-3+4*u*u)*(-3+4*i*i))),st=e*et*(ft-ot);return st.toFixed(3)/1e3},OpenLayers.Util.destinationVincenty=function(n,t,i){for(var h=OpenLayers.Util,p=h.VincentyConstants,nt=p.a,o=p.b,c=p.f,et=n.lon,ot=n.lat,tt=i,it=h.rad(t),rt=Math.sin(it),v=Math.cos(it),y=(1-c)*Math.tan(h.rad(ot)),l=1/Math.sqrt(1+y*y),w=y*l,st=Math.atan2(y,v),s=l*rt,b=1-s*s,u=b*(nt*nt-o*o)/(o*o),ut=1+u/16384*(4096+u*(-768+u*(320-175*u))),k=u/1024*(256+u*(-128+u*(74-47*u))),e=tt/(o*ut),ft=2*Math.PI;Math.abs(e-ft)>1e-12;){var r=Math.cos(2*st+e),f=Math.sin(e),a=Math.cos(e),ht=k*f*(r+k/4*(a*(-1+2*r*r)-k/6*r*(-3+4*f*f)*(-3+4*r*r)));ft=e;e=tt/(o*ut)+ht}var d=w*f-l*a*v,ct=Math.atan2(w*a+l*f*v,(1-c)*Math.sqrt(s*s+d*d)),lt=Math.atan2(f*rt,l*a-w*f*v),g=c/16*b*(4+c*(4-3*b)),at=lt-(1-g)*c*s*(e+g*f*(r+g*a*(-1+2*r*r)));return Math.atan2(s,-d),new OpenLayers.LonLat(et+h.deg(at),h.deg(ct))},OpenLayers.Util.getParameters=function(n){var u,e,o,r,i,t;n=null===n||void 0===n?window.location.href:n;u="";OpenLayers.String.contains(n,"?")&&(e=n.indexOf("?")+1,o=OpenLayers.String.contains(n,"#")?n.indexOf("#"):n.length,u=n.substring(e,o));for(var s={},h=u.split(/[&;]/),f=0,c=h.length;c>f;++f)if(r=h[f].split("="),r[0]){i=r[0];try{i=decodeURIComponent(i)}catch(l){i=unescape(i)}t=(r[1]||"").replace(/\+/g," ");try{t=decodeURIComponent(t)}catch(l){t=unescape(t)}t=t.split(",");1==t.length&&(t=t[0]);s[i]=t}return s},OpenLayers.Util.getArgs=function(n){return OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"})),OpenLayers.Util.getParameters(n)},OpenLayers.Util.lastSeqID=0,OpenLayers.Util.createUniqueID=function(n){return null==n&&(n="id_"),OpenLayers.Util.lastSeqID+=1,n+OpenLayers.Util.lastSeqID},OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36},OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches,OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd,OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m,OpenLayers.METERS_PER_INCH=.0254000508001016,OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:.30480060960121919/OpenLayers.METERS_PER_INCH,IFoot:.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:.30479971018150881/OpenLayers.METERS_PER_INCH,IInch:.0254/OpenLayers.METERS_PER_INCH,MicroInch:254e-7/OpenLayers.METERS_PER_INCH,Mil:254e-10/OpenLayers.METERS_PER_INCH,Centimeter:.01/OpenLayers.METERS_PER_INCH,Kilometer:1e3/OpenLayers.METERS_PER_INCH,Yard:.91440182880365761/OpenLayers.METERS_PER_INCH,SearsYard:.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:.91439853074444077/OpenLayers.METERS_PER_INCH,IndianYd37:.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:.1/OpenLayers.METERS_PER_INCH,Millimeter:.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:.20116840233680469/OpenLayers.METERS_PER_INCH,BenoitLink:.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":5e4/OpenLayers.METERS_PER_INCH,"150kilometers":15e4/OpenLayers.METERS_PER_INCH}),OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1e3,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:100*OpenLayers.INCHES_PER_UNIT.Meter,km:1e3*OpenLayers.INCHES_PER_UNIT.Meter,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH}),OpenLayers.DOTS_PER_INCH=72,OpenLayers.Util.normalizeScale=function(n){return n>1?1/n:n},OpenLayers.Util.getResolutionFromScale=function(n,t){var i,r;return n&&(null==t&&(t="degrees"),r=OpenLayers.Util.normalizeScale(n),i=1/(r*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH)),i},OpenLayers.Util.getScaleFromResolution=function(n,t){null==t&&(t="degrees");return n*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH},OpenLayers.Util.safeStopPropagation=function(n){OpenLayers.Event.stop(n,!0)},OpenLayers.Util.pagePosition=function(n){var i=[0,0],u=OpenLayers.Util.getViewportElement(),r,o,t,s,h,e,f;if(!n||n==window||n==u)return i;if(o=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&"absolute"==OpenLayers.Element.getStyle(n,"position")&&(""==n.style.top||""==n.style.left),t=null,n.getBoundingClientRect)r=n.getBoundingClientRect(),s=u.scrollTop,h=u.scrollLeft,i[0]=r.left+h,i[1]=r.top+s;else if(document.getBoxObjectFor&&!o)r=document.getBoxObjectFor(n),e=document.getBoxObjectFor(u),i[0]=r.screenX-e.screenX,i[1]=r.screenY-e.screenY;else{if(i[0]=n.offsetLeft,i[1]=n.offsetTop,t=n.offsetParent,t!=n)for(;t;)i[0]+=t.offsetLeft,i[1]+=t.offsetTop,t=t.offsetParent;for(f=OpenLayers.BROWSER_NAME,("opera"==f||"safari"==f&&"absolute"==OpenLayers.Element.getStyle(n,"position"))&&(i[1]-=document.body.offsetTop),t=n.offsetParent;t&&t!=document.body;)i[0]-=t.scrollLeft,("opera"!=f||"TR"!=t.tagName)&&(i[1]-=t.scrollTop),t=t.offsetParent}return i},OpenLayers.Util.getViewportElement=function(){var n=arguments.callee.viewportElement;return void 0==n&&(n="msie"==OpenLayers.BROWSER_NAME&&"CSS1Compat"!=document.compatMode?document.body:document.documentElement,arguments.callee.viewportElement=n),n},OpenLayers.Util.isEquivalentUrl=function(n,t,i){var u,f,r;i=i||{};OpenLayers.Util.applyDefaults(i,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0});u=OpenLayers.Util.createUrlObject(n,i);f=OpenLayers.Util.createUrlObject(t,i);for(r in u)if("args"!==r&&u[r]!=f[r])return!1;for(r in u.args){if(u.args[r]!=f.args[r])return!1;delete f.args[r]}for(r in f.args)return!1;return!0},OpenLayers.Util.createUrlObject=function(n,t){var e,i,r,f,o;if(t=t||{},!/^\w+:\/\//.test(n)){var u=window.location,h=u.port?":"+u.port:"",s=u.protocol+"//"+u.host.split(":").shift()+h;0===n.indexOf("/")?n=s+n:(e=u.pathname.split("/"),e.pop(),n=s+e.join("/")+"/"+n)}return t.ignoreCase&&(n=n.toLowerCase()),i=document.createElement("a"),i.href=n,r={},r.host=i.host.split(":").shift(),r.protocol=i.protocol,r.port=t.ignorePort80?"80"==i.port||"0"==i.port?"":i.port:""==i.port||"0"==i.port?"80":i.port,r.hash=t.ignoreHash||"#"===i.hash?"":i.hash,f=i.search,f||(o=n.indexOf("?"),f=-1!=o?n.substr(o):""),r.args=OpenLayers.Util.getParameters(f),r.pathname="/"==i.pathname.charAt(0)?i.pathname:"/"+i.pathname,r},OpenLayers.Util.removeTail=function(n){var i=n.indexOf("?"),t=n.indexOf("#");return-1==i?-1!=t?n.substr(0,t):n:-1!=t?n.substr(0,Math.min(i,t)):n.substr(0,i)},OpenLayers.IS_GECKO=function(){var n=navigator.userAgent.toLowerCase();return-1==n.indexOf("webkit")&&-1!=n.indexOf("gecko")}(),OpenLayers.BROWSER_NAME=function(){var n="",t=navigator.userAgent.toLowerCase();return-1!=t.indexOf("opera")?n="opera":-1!=t.indexOf("msie")?n="msie":-1!=t.indexOf("safari")?n="safari":-1!=t.indexOf("mozilla")&&(n=-1!=t.indexOf("firefox")?"firefox":"mozilla"),n}(),OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME},OpenLayers.Util.getRenderedDimensions=function(n,t,i){var f,o,r=document.createElement("div"),c,u,s,a,l,e,h;if(r.style.visibility="hidden",c=i&&i.containerElement?i.containerElement:document.body,t&&(t.w?(f=t.w,r.style.width=f+"px"):t.h&&(o=t.h,r.style.height=o+"px")),i&&i.displayClass&&(r.className=i.displayClass),u=document.createElement("div"),u.innerHTML=n,u.style.overflow="visible",u.childNodes)for(s=0,a=u.childNodes.length;a>s;s++)u.childNodes[s].style&&(u.childNodes[s].style.overflow="visible");for(r.appendChild(u),c.appendChild(r),l=!1,e=r.parentNode;e&&"body"!=e.tagName.toLowerCase();){if(h=OpenLayers.Element.getStyle(e,"position"),"absolute"==h){l=!0;break}if(h&&"static"!=h)break;e=e.parentNode}return l||(r.style.position="absolute"),f||(f=parseInt(u.scrollWidth),r.style.width=f+"px"),o||(o=parseInt(u.scrollHeight)),r.removeChild(u),c.removeChild(r),new OpenLayers.Size(f,o)},OpenLayers.Util.getScrollbarWidth=function(){var i=OpenLayers.Util._scrollbarWidth;if(null==i){var n=null,t=null,r=0,u=0;n=document.createElement("div");n.style.position="absolute";n.style.top="-1000px";n.style.left="-1000px";n.style.width="100px";n.style.height="50px";n.style.overflow="hidden";t=document.createElement("div");t.style.width="100%";t.style.height="200px";n.appendChild(t);document.body.appendChild(n);r=t.offsetWidth;n.style.overflow="scroll";u=t.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=r-u;i=OpenLayers.Util._scrollbarWidth}return i},OpenLayers.Util.getFormattedLonLat=function(n,t,i){var u,e;i||(i="dms");n=(n+540)%360-180;var o=Math.abs(n),f=Math.floor(o),r=(o-f)/(1/60),s=r;return r=Math.floor(r),u=(s-r)/(1/60),u=Math.round(10*u),u/=10,u>=60&&(u-=60,r+=1,r>=60&&(r-=60,f+=1)),10>f&&(f="0"+f),e=f+"Â°",i.indexOf("dm")>=0&&(10>r&&(r="0"+r),e+=r+"'",i.indexOf("dms")>=0&&(10>u&&(u="0"+u),e+=u+'"')),e+("lon"==t?0>n?OpenLayers.i18n("W"):OpenLayers.i18n("E"):0>n?OpenLayers.i18n("S"):OpenLayers.i18n("N"))},OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(n){OpenLayers.Util.extend(this,n);this.options=n},destroy:function(){},read:function(){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"}),OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:!1,nativeJSON:function(){return!(!window.JSON||"function"!=typeof JSON.parse||"function"!=typeof JSON.stringify)}(),read:function(json,filter){function walk(n,t){if(t&&"object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(t[i]=walk(i,t[i]));return filter(n,t)}var object;if(this.nativeJSON)object=JSON.parse(json,filter);else try{/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))&&(object=eval("("+json+")"),"function"==typeof filter&&(object=walk("",object)))}catch(e){}return this.keepData&&(this.data=object),object},write:function(n,t){this.pretty=!!t;var i=null,r=typeof n;if(this.serialize[r])try{i=!this.pretty&&this.nativeJSON?JSON.stringify(n):this.serialize[r].apply(this,[n])}catch(u){OpenLayers.Console.error("Trouble serializing: "+u)}return i},writeIndent:function(){var t=[],n;if(this.pretty)for(n=0;this.level>n;++n)t.push(this.indent);return t.join("")},writeNewline:function(){return this.pretty?this.newline:""},writeSpace:function(){return this.pretty?this.space:""},serialize:{object:function(n){var t,i,r,u,f;if(null==n)return"null";if(n.constructor==Date)return this.serialize.date.apply(this,[n]);if(n.constructor==Array)return this.serialize.array.apply(this,[n]);t=["{"];this.level+=1;f=!1;for(i in n)n.hasOwnProperty(i)&&(r=OpenLayers.Format.JSON.prototype.write.apply(this,[i,this.pretty]),u=OpenLayers.Format.JSON.prototype.write.apply(this,[n[i],this.pretty]),null!=r&&null!=u&&(f&&t.push(","),t.push(this.writeNewline(),this.writeIndent(),r,":",this.writeSpace(),u),f=!0));return this.level-=1,t.push(this.writeNewline(),this.writeIndent(),"}"),t.join("")},array:function(n){var r,i=["["],t,u;for(this.level+=1,t=0,u=n.length;u>t;++t)r=OpenLayers.Format.JSON.prototype.write.apply(this,[n[t],this.pretty]),null!=r&&(t>0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),r));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(n){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(n)?'"'+n.replace(/([\x00-\x1f\\"])/g,function(n,i){var r=t[i];return r?r:(r=i.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))})+'"':'"'+n+'"'},number:function(n){return isFinite(n)?n+"":"null"},boolean:function(n){return n+""},date:function(n){function t(n){return 10>n?"0"+n:n}return'"'+n.getFullYear()+"-"+t(n.getMonth()+1)+"-"+t(n.getDate())+"T"+t(n.getHours())+":"+t(n.getMinutes())+":"+t(n.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"}),OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:null,popup:null,initialize:function(n,t,i){this.layer=n;this.lonlat=t;this.data=null!=i?i:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){null!=this.layer&&null!=this.layer.map&&null!=this.popup&&this.layer.map.removePopup(this.popup);null!=this.layer&&null!=this.marker&&this.layer.removeMarker(this.marker);this.layer=null;this.id=null;this.lonlat=null;this.data=null;null!=this.marker&&(this.destroyMarker(this.marker),this.marker=null);null!=this.popup&&(this.destroyPopup(this.popup),this.popup=null)},onScreen:function(){var n=!1,t;return null!=this.layer&&null!=this.layer.map&&(t=this.layer.map.getExtent(),n=t.containsLonLat(this.lonlat)),n},createMarker:function(){return null!=this.lonlat&&(this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)),this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(n){if(null!=this.lonlat){if(!this.popup){var t=this.marker?this.marker.icon:null,i=this.popupClass?this.popupClass:OpenLayers.Popup.AnchoredBubble;this.popup=new i(this.id+"_popup",this.lonlat,this.data.popupSize,this.data.popupContentHTML,t,n)}null!=this.data.overflow&&(this.popup.contentDiv.style.overflow=this.data.overflow);this.popup.feature=this}return this.popup},destroyPopup:function(){this.popup&&(this.popup.feature=null,this.popup.destroy(),this.popup=null)},CLASS_NAME:"OpenLayers.Feature"}),OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"},OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,url:null,renderIntent:"default",modified:null,initialize:function(n,t,i){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,t]);this.lonlat=null;this.geometry=n?n:null;this.state=null;this.attributes={};t&&(this.attributes=OpenLayers.Util.extend(this.attributes,t));this.style=i?i:null},destroy:function(){this.layer&&(this.layer.removeFeatures(this),this.layer=null);this.geometry=null;this.modified=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(n){var t=!1,i,r,u;return this.layer&&this.layer.map&&(i=this.layer.map.getExtent(),n?(r=this.geometry.getBounds(),t=i.intersectsBounds(r)):(u=i.toGeometry(),t=u.intersects(this.geometry))),t},getVisibility:function(){return!(this.style&&"none"==this.style.display||!this.layer||this.layer&&this.layer.styleMap&&"none"==this.layer.styleMap.createSymbolizer(this,this.renderIntent).display||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(n,t,i){var r=!1;return this.geometry&&(r=this.geometry.atPoint(n,t,i)),r},destroyPopup:function(){},move:function(n){var i,t,r;if(this.layer&&this.geometry.move)return i="OpenLayers.LonLat"==n.CLASS_NAME?this.layer.getViewPortPxFromLonLat(n):n,t=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),r=this.layer.map.getResolution(),this.geometry.move(r*(i.x-t.x),r*(t.y-i.y)),this.layer.drawFeature(this),t},toState:function(n){if(n==OpenLayers.State.UPDATE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=n}else if(n==OpenLayers.State.INSERT)switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=n}else if(n==OpenLayers.State.DELETE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=n}else n==OpenLayers.State.UNKNOWN&&(this.state=n)},CLASS_NAME:"OpenLayers.Feature.Vector"}),OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"#66cccc",fillOpacity:.2,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}},OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(n){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[n])},read:function(n){var t,i,f,r,u,e,o;if(n=n.replace(/[\n\r]/g," "),r=this.regExes.typeStr.exec(n),r&&(i=r[1].toLowerCase(),f=r[2],this.parse[i]&&(t=this.parse[i].apply(this,[f])),this.internalProjection&&this.externalProjection))if(t&&"OpenLayers.Feature.Vector"==t.CLASS_NAME)t.geometry.transform(this.externalProjection,this.internalProjection);else if(t&&"geometrycollection"!=i&&"object"==typeof t)for(u=0,e=t.length;e>u;u++)o=t[u],o.geometry.transform(this.externalProjection,this.internalProjection);return t},write:function(n){var u,f,i,t,r,e;for(n.constructor==Array?(u=n,i=!0):(u=[n],i=!1),t=[],i&&t.push("GEOMETRYCOLLECTION("),r=0,e=u.length;e>r;++r)i&&r>0&&t.push(","),f=u[r].geometry,t.push(this.extractGeometry(f));return i&&t.push(")"),t.join("")},extractGeometry:function(n){var t=n.CLASS_NAME.split(".")[2].toLowerCase(),i,r;return this.extract[t]?(this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection)),i="collection"==t?"GEOMETRYCOLLECTION":t.toUpperCase(),r=i+"("+this.extract[t].apply(this,[n])+")",r):null},extract:{point:function(n){return n.x+" "+n.y},multipoint:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push("("+this.extract.point.apply(this,[n.components[t]])+")");return i.join(",")},linestring:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push(this.extract.point.apply(this,[n.components[t]]));return i.join(",")},multilinestring:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push("("+this.extract.linestring.apply(this,[n.components[t]])+")");return i.join(",")},polygon:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push("("+this.extract.linestring.apply(this,[n.components[t]])+")");return i.join(",")},multipolygon:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push("("+this.extract.polygon.apply(this,[n.components[t]])+")");return i.join(",")},collection:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push(this.extractGeometry.apply(this,[n.components[t]]));return i.join(",")}},parse:{point:function(n){var t=OpenLayers.String.trim(n).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t[0],t[1]))},multipoint:function(n){for(var i,r=OpenLayers.String.trim(n).split(","),u=[],t=0,f=r.length;f>t;++t)i=r[t].replace(this.regExes.trimParens,"$1"),u.push(this.parse.point.apply(this,[i]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(u))},linestring:function(n){for(var i=OpenLayers.String.trim(n).split(","),r=[],t=0,u=i.length;u>t;++t)r.push(this.parse.point.apply(this,[i[t]]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(r))},multilinestring:function(n){for(var i,r=OpenLayers.String.trim(n).split(this.regExes.parenComma),u=[],t=0,f=r.length;f>t;++t)i=r[t].replace(this.regExes.trimParens,"$1"),u.push(this.parse.linestring.apply(this,[i]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(u))},polygon:function(n){for(var i,r,u,f=OpenLayers.String.trim(n).split(this.regExes.parenComma),e=[],t=0,o=f.length;o>t;++t)i=f[t].replace(this.regExes.trimParens,"$1"),r=this.parse.linestring.apply(this,[i]).geometry,u=new OpenLayers.Geometry.LinearRing(r.components),e.push(u);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(e))},multipolygon:function(n){for(var i,r=OpenLayers.String.trim(n).split(this.regExes.doubleParenComma),u=[],t=0,f=r.length;f>t;++t)i=r[t].replace(this.regExes.trimParens,"$1"),u.push(this.parse.polygon.apply(this,[i]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(u))},geometrycollection:function(n){n=n.replace(/,\s*([A-Za-z])/g,"|$1");for(var i=OpenLayers.String.trim(n).split("|"),r=[],t=0,u=i.length;u>t;++t)r.push(OpenLayers.Format.WKT.prototype.read.apply(this,[i[t]]));return r}},CLASS_NAME:"OpenLayers.Format.WKT"}),OpenLayers.Protocol.SQL.Gears=OpenLayers.Class(OpenLayers.Protocol.SQL,{FID_PREFIX:"__gears_fid__",NULL_GEOMETRY:"__gears_null_geometry__",NULL_FEATURE_STATE:"__gears_null_feature_state__",jsonParser:null,wktParser:null,fidRegExp:null,saveFeatureState:!0,typeOfFid:"string",db:null,initialize:function(n){this.supported()&&(OpenLayers.Protocol.SQL.prototype.initialize.apply(this,[n]),this.jsonParser=new OpenLayers.Format.JSON,this.wktParser=new OpenLayers.Format.WKT,this.fidRegExp=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(n){var i,r,t,u;for(OpenLayers.Protocol.prototype.read.apply(this,arguments),n=OpenLayers.Util.applyDefaults(n,this.options),r=[],t=this.db.execute("SELECT * FROM "+this.tableName);t.isValidRow();)i=this.unfreezeFeature(t),this.evaluateFilter(i,n.filter)&&(n.noFeatureStateReset||(i.state=null),r.push(i)),t.next();return t.close(),u=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"read",features:r}),n&&n.callback&&n.callback.call(n.scope,u),u},unfreezeFeature:function(n){var t,r=n.fieldByName("geometry"),i;return t=r==this.NULL_GEOMETRY?new OpenLayers.Feature.Vector:this.wktParser.read(r),t.attributes=this.jsonParser.read(n.fieldByName("properties")),t.fid=this.extractFidFromField(n.fieldByName("fid")),i=n.fieldByName("state"),i==this.NULL_FEATURE_STATE&&(i=null),t.state=i,t},extractFidFromField:function(n){return n.match(this.fidRegExp)||"number"!=this.typeOfFid||(n=parseFloat(n)),n},create:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=this.createOrUpdate(n);return i.requestType="create",t&&t.callback&&t.callback.call(t.scope,i),i},update:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=this.createOrUpdate(n);return i.requestType="update",t&&t.callback&&t.callback.call(t.scope,i),i},createOrUpdate:function(n){var t,i,r,u,f,e;for(OpenLayers.Util.isArray(n)||(n=[n]),r=n.length,u=Array(r),t=0;r>t;t++)i=n[t],f=this.freezeFeature(i),this.db.execute("REPLACE INTO "+this.tableName+" (fid, geometry, properties, state) VALUES (?, ?, ?, ?)",f),e=i.clone(),e.fid=this.extractFidFromField(f[0]),u[t]=e;return new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,features:u,reqFeatures:n})},freezeFeature:function(n){n.fid=null!=n.fid?""+n.fid:OpenLayers.Util.createUniqueID(this.FID_PREFIX);var t=null!=n.geometry?""+n.geometry:this.NULL_GEOMETRY,i=this.jsonParser.write(n.attributes),r=this.getFeatureStateForFreeze(n);return[n.fid,t,i,r]},getFeatureStateForFreeze:function(n){return this.saveFeatureState?this.createdOffline(n)?OpenLayers.State.INSERT:n.state:this.NULL_FEATURE_STATE},"delete":function(n,t){var u,e,r,i,f;for(OpenLayers.Util.isArray(n)||(n=[n]),t=OpenLayers.Util.applyDefaults(t,this.options),u=0,e=n.length;e>u;u++)(r=n[u],this.saveFeatureState&&!this.createdOffline(r))?(i=r.clone(),i.fid=r.fid,i.geometry&&(i.geometry.destroy(),i.geometry=null),i.state=r.state,this.createOrUpdate(i)):this.db.execute("DELETE FROM "+this.tableName+" WHERE fid = ?",[r.fid]);return f=new OpenLayers.Protocol.Response({code:OpenLayers.Protocol.Response.SUCCESS,requestType:"delete",reqFeatures:n}),t&&t.callback&&t.callback.call(t.scope,f),f},createdOffline:function(n){return"string"==typeof n.fid&&!!n.fid.match(this.fidRegExp)},commit:function(n,t){function e(n){f>++l&&(n.last=!1);this.callUserCallback(t,n)}for(var i,r,u=[],f=0,l=0,o=[],s=[],h=[],c=n.length-1;c>=0;c--)switch(r=n[c],r.state){case OpenLayers.State.INSERT:o.push(r);break;case OpenLayers.State.UPDATE:s.push(r);break;case OpenLayers.State.DELETE:h.push(r)}return o.length>0&&(f++,i=OpenLayers.Util.applyDefaults({callback:e,scope:this},t.create),u.push(this.create(o,i))),s.length>0&&(f++,i=OpenLayers.Util.applyDefaults({callback:e,scope:this},t.update),u.push(this.update(s,i))),h.length>0&&(f++,i=OpenLayers.Util.applyDefaults({callback:e,scope:this},t["delete"]),u.push(this["delete"](h,i))),u},clear:function(){this.db.execute("DELETE FROM "+this.tableName)},callUserCallback:function(n,t){var i=n[t.requestType];i&&i.callback&&i.callback.call(i.scope,t);t.last&&n.callback&&n.callback.call(n.scope)},CLASS_NAME:"OpenLayers.Protocol.SQL.Gears"}),OpenLayers.Event={observers:!1,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(n){return n.target||n.srcElement},isSingleTouch:function(n){return n.touches&&1==n.touches.length},isMultiTouch:function(n){return n.touches&&n.touches.length>1},isLeftClick:function(n){return n.which&&1==n.which||n.button&&1==n.button},isRightClick:function(n){return n.which&&3==n.which||n.button&&2==n.button},stop:function(n,t){t||(n.preventDefault?n.preventDefault():n.returnValue=!1);n.stopPropagation?n.stopPropagation():n.cancelBubble=!0},findElement:function(n,t){for(var i=OpenLayers.Event.element(n);i.parentNode&&(!i.tagName||i.tagName.toUpperCase()!=t.toUpperCase());)i=i.parentNode;return i},observe:function(n,t,i,r){var u=OpenLayers.Util.getElement(n),f,e;(r=r||!1,"keypress"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||u.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),u._eventCacheID)||(f="eventCacheID_",u.id&&(f=u.id+"_"+f),u._eventCacheID=OpenLayers.Util.createUniqueID(f));e=u._eventCacheID;this.observers[e]||(this.observers[e]=[]);this.observers[e].push({element:u,name:t,observer:i,useCapture:r});u.addEventListener?u.addEventListener(t,i,r):u.attachEvent&&u.attachEvent("on"+t,i)},stopObservingElement:function(n){var t=OpenLayers.Util.getElement(n),i=t._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[i])},_removeElementObservers:function(n){var i,t,r;if(n)for(i=n.length-1;i>=0;i--)t=n[i],r=[t.element,t.name,t.observer,t.useCapture],OpenLayers.Event.stopObserving.apply(this,r)},stopObserving:function(n,t,i,r){var u,h,e,f,o,s;if(r=r||!1,u=OpenLayers.Util.getElement(n),h=u._eventCacheID,"keypress"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||u.detachEvent)&&(t="keydown"),e=!1,f=OpenLayers.Event.observers[h],f)for(o=0;!e&&f.length>o;){if(s=f[o],s.name==t&&s.observer==i&&s.useCapture==r){f.splice(o,1);0==f.length&&delete OpenLayers.Event.observers[h];e=!0;break}o++}return e&&(u.removeEventListener?u.removeEventListener(t,i,r):u&&u.detachEvent&&u.detachEvent("on"+t,i)),e},unloadCache:function(){var n,t;if(OpenLayers.Event&&OpenLayers.Event.observers){for(n in OpenLayers.Event.observers)t=OpenLayers.Event.observers[n],OpenLayers.Event._removeElementObservers.apply(this,[t]);OpenLayers.Event.observers=!1}},CLASS_NAME:"OpenLayers.Event"},OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,!1),window.Event)?OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event):Event=OpenLayers.Event;OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:!1,clearMouseListener:null,initialize:function(n,t,i,r,u){if(OpenLayers.Util.extend(this,u),this.object=n,this.fallThrough=r,this.listeners={},this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this),this.eventTypes=[],null!=i)for(var f=0,e=i.length;e>f;f++)this.addEventType(i[f]);null!=t&&this.attachToElement(t)},destroy:function(){this.element&&(OpenLayers.Event.stopObservingElement(this.element),this.element.hasScrollEvent&&OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener));this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(n){this.listeners[n]||(this.eventTypes.push(n),this.listeners[n]=[])},attachToElement:function(n){var t,r,i;for(this.element&&OpenLayers.Event.stopObservingElement(this.element),this.element=n,t=0,r=this.BROWSER_EVENTS.length;r>t;t++)i=this.BROWSER_EVENTS[t],this.addEventType(i),OpenLayers.Event.observe(n,i,this.eventHandler);OpenLayers.Event.observe(n,"dragstart",OpenLayers.Event.stop)},on:function(n){for(var t in n)"scope"!=t&&this.register(t,n.scope,n[t])},register:function(n,t,i){if(null!=i&&-1!=OpenLayers.Util.indexOf(this.eventTypes,n)){null==t&&(t=this.object);var r=this.listeners[n];r.push({obj:t,func:i})}},registerPriority:function(n,t,i){if(null!=i){null==t&&(t=this.object);var r=this.listeners[n];null!=r&&r.unshift({obj:t,func:i})}},un:function(n){for(var t in n)"scope"!=t&&this.unregister(t,n.scope,n[t])},unregister:function(n,t,i){var r,u,f;if(null==t&&(t=this.object),r=this.listeners[n],null!=r)for(u=0,f=r.length;f>u;u++)if(r[u].obj==t&&r[u].func==i){r.splice(u,1);break}},remove:function(n){null!=this.listeners[n]&&(this.listeners[n]=[])},triggerEvent:function(n,t){var i=this.listeners[n],r,u,e,f;if(!i||0==i.length)return void 0;for(null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=n),i=i.slice(),u=0,e=i.length;e>u;u++)if(f=i[u],r=f.func.apply(f.obj,[t]),void 0!=r&&0==r)break;return this.fallThrough||OpenLayers.Event.stop(t,!0),r},handleBrowserEvent:function(n){var f=n.type,e=this.listeners[f],t;if(e&&0!=e.length){if(t=n.touches,t&&t[0]){for(var i,o=0,s=0,r=t.length,u=0;r>u;++u)i=t[u],o+=i.clientX,s+=i.clientY;n.clientX=o/r;n.clientY=s/r}this.includeXY&&(n.xy=this.getMousePosition(n));this.triggerEvent(f,n)}},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;var n=document.body;n&&(0==n.scrollTop&&0==n.scrollLeft||!navigator.userAgent.match(/iPhone/i))&&(this.element.offsets=null)},getMousePosition:function(n){if(this.includeXY?this.element.hasScrollEvent||(OpenLayers.Event.observe(window,"scroll",this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache(),!this.element.scrolls){var t=OpenLayers.Util.getViewportElement();this.element.scrolls=[t.scrollLeft,t.scrollTop]}return this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]),this.element.offsets||(this.element.offsets=OpenLayers.Util.pagePosition(this.element)),new OpenLayers.Pixel(n.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],n.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:!1,initialize:function(n){this.easing=n?n:OpenLayers.Easing.Expo.easeOut},start:function(n,t,i,r){this.playing=!0;this.begin=n;this.finish=t;this.duration=i;this.callbacks=r.callbacks;this.time=0;this.interval&&(window.clearInterval(this.interval),this.interval=null);this.callbacks&&this.callbacks.start&&this.callbacks.start.call(this,this.begin);this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){this.playing&&(this.callbacks&&this.callbacks.done&&this.callbacks.done.call(this,this.finish),window.clearInterval(this.interval),this.interval=null,this.playing=!1)},play:function(){var r={},t,n,i,u;for(t in this.begin)n=this.begin[t],i=this.finish[t],(null==n||null==i||isNaN(n)||isNaN(i))&&OpenLayers.Console.error("invalid value for Tween"),u=i-n,r[t]=this.easing.apply(this,[this.time,n,u,this.duration]);this.time++;this.callbacks&&this.callbacks.eachStep&&this.callbacks.eachStep.call(this,r);this.time>this.duration&&this.stop()},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(n,t,i,r){return i*n/r+t},easeOut:function(n,t,i,r){return i*n/r+t},easeInOut:function(n,t,i,r){return i*n/r+t},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(n,t,i,r){return 0==n?t:i*Math.pow(2,10*(n/r-1))+t},easeOut:function(n,t,i,r){return n==r?t+i:i*(-Math.pow(2,-10*n/r)+1)+t},easeInOut:function(n,t,i,r){return 0==n?t:n==r?t+i:1>(n/=r/2)?i/2*Math.pow(2,10*(n-1))+t:i/2*(-Math.pow(2,-10*--n)+2)+t},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(n,t,i,r){return i*(n/=r)*n+t},easeOut:function(n,t,i,r){return-i*(n/=r)*(n-2)+t},easeInOut:function(n,t,i,r){return 1>(n/=r/2)?i/2*n*n+t:-i/2*(--n*(n-2)-1)+t},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1e3},EVENT_TYPES:["preaddlayer","addlayer","preremovelayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:!1,events:null,allOverlays:!1,div:null,dragging:!1,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:!0,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,minPx:null,maxPx:null,initialize:function(n,t){var f,i,u,r,e;if(1===arguments.length&&"object"==typeof n&&(t=n,n=t&&t.div),this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT),this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90),this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15),this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css",OpenLayers.Util.extend(this,t),this.layers=[],this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_"),this.div=OpenLayers.Util.getElement(n),this.div||(this.div=document.createElement("div"),this.div.style.height="1px",this.div.style.width="1px"),OpenLayers.Element.addClass(this.div,"olMap"),f=this.id+"_OpenLayers_ViewPort",this.viewPortDiv=OpenLayers.Util.createDiv(f,null,null,null,"relative",null,"hidden"),this.viewPortDiv.style.width="100%",this.viewPortDiv.style.height="100%",this.viewPortDiv.className="olMapViewport",this.div.appendChild(this.viewPortDiv),i=document.createElement("div"),i.id=this.id+"_events",i.style.position="absolute",i.style.width="100%",i.style.height="100%",i.style.zIndex=this.Z_INDEX_BASE.Control-1,this.viewPortDiv.appendChild(i),this.eventsDiv=i,this.events=new OpenLayers.Events(this,this.eventsDiv,this.EVENT_TYPES,this.fallThrough,{includeXY:!0}),f=this.id+"_OpenLayers_Container",this.layerContainerDiv=OpenLayers.Util.createDiv(f),this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1,this.eventsDiv.appendChild(this.layerContainerDiv),this.updateSize(),this.eventListeners instanceof Object&&this.events.on(this.eventListeners),this.events.register("movestart",this,this.updateSize),OpenLayers.String.contains(navigator.appName,"Microsoft")?this.events.register("resize",this,this.updateSize):(this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this),OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)),this.theme){for(var o=!0,s=document.getElementsByTagName("link"),r=0,e=s.length;e>r;++r)if(OpenLayers.Util.isEquivalentUrl(s.item(r).href,this.theme)){o=!1;break}o&&(u=document.createElement("link"),u.setAttribute("rel","stylesheet"),u.setAttribute("type","text/css"),u.setAttribute("href",this.theme),document.getElementsByTagName("head")[0].appendChild(u))}for(null==this.controls&&(this.controls=null!=OpenLayers.Control?[new OpenLayers.Control.Navigation,new OpenLayers.Control.PanZoom,new OpenLayers.Control.ArgParser,new OpenLayers.Control.Attribution]:[]),r=0,e=this.controls.length;e>r;r++)this.addControlToMap(this.controls[r]);this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy);t&&t.layers&&(delete this.center,this.addLayers(t.layers),t.center&&this.setCenter(t.center,t.zoom))},render:function(n){this.div=OpenLayers.Util.getElement(n);OpenLayers.Element.addClass(this.div,"olMap");this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){var n;if(!this.unloadDestroy)return!1;if(this.panTween&&(this.panTween.stop(),this.panTween=null),OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy),this.unloadDestroy=null,this.updateSizeDestroy?OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy):this.events.unregister("resize",this,this.updateSize),this.paddingForPopups=null,null!=this.controls){for(n=this.controls.length-1;n>=0;--n)this.controls[n].destroy();this.controls=null}if(null!=this.layers){for(n=this.layers.length-1;n>=0;--n)this.layers[n].destroy(!1);this.layers=null}this.viewPortDiv&&this.div.removeChild(this.viewPortDiv);this.viewPortDiv=null;this.eventListeners&&(this.events.un(this.eventListeners),this.eventListeners=null);this.events.destroy();this.events=null},setOptions:function(n){var t=this.minPx&&n.restrictedExtent!=this.restrictedExtent;OpenLayers.Util.extend(this,n);t&&this.moveTo(this.getCachedCenter(),this.zoom,{forceZoomChange:!0})},getTileSize:function(){return this.tileSize},getBy:function(n,t,i){var r="function"==typeof i.test;return OpenLayers.Array.filter(this[n],function(n){return n[t]==i||r&&i.test(n[t])})},getLayersBy:function(n,t){return this.getBy("layers",n,t)},getLayersByName:function(n){return this.getLayersBy("name",n)},getLayersByClass:function(n){return this.getLayersBy("CLASS_NAME",n)},getControlsBy:function(n,t){return this.getBy("controls",n,t)},getControlsByClass:function(n){return this.getControlsBy("CLASS_NAME",n)},getLayer:function(n){for(var i,r=null,t=0,u=this.layers.length;u>t;t++)if(i=this.layers[t],i.id==n){r=i;break}return r},setLayerZIndex:function(n,t){n.setZIndex(this.Z_INDEX_BASE[n.isBaseLayer?"BaseLayer":"Overlay"]+5*t)},resetLayersZIndex:function(){for(var i,n=0,t=this.layers.length;t>n;n++)i=this.layers[n],this.setLayerZIndex(i,n)},addLayer:function(n){for(var r,t=0,i=this.layers.length;i>t;t++)if(this.layers[t]==n)return r=OpenLayers.i18n("layerAlreadyAdded",{layerName:n.name}),OpenLayers.Console.warn(r),!1;this.events.triggerEvent("preaddlayer",{layer:n})!==!1&&(this.allOverlays&&(n.isBaseLayer=!1),n.div.className="olLayerDiv",n.div.style.overflow="",this.setLayerZIndex(n,this.layers.length),n.isFixed?this.viewPortDiv.appendChild(n.div):this.layerContainerDiv.appendChild(n.div),this.layers.push(n),n.setMap(this),n.isBaseLayer||this.allOverlays&&!this.baseLayer?null==this.baseLayer?this.setBaseLayer(n):n.setVisibility(!1):n.redraw(),this.events.triggerEvent("addlayer",{layer:n}),n.events.triggerEvent("added",{map:this,layer:n}),n.afterAdd())},addLayers:function(n){for(var t=0,i=n.length;i>t;t++)this.addLayer(n[t])},removeLayer:function(n,t){var i,u,r;if(this.events.triggerEvent("preremovelayer",{layer:n})!==!1){if(null==t&&(t=!0),n.isFixed?this.viewPortDiv.removeChild(n.div):this.layerContainerDiv.removeChild(n.div),OpenLayers.Util.removeItem(this.layers,n),n.removeMap(this),n.map=null,this.baseLayer==n&&(this.baseLayer=null,t))for(i=0,u=this.layers.length;u>i;i++)if(r=this.layers[i],r.isBaseLayer||this.allOverlays){this.setBaseLayer(r);break}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:n});n.events.triggerEvent("removed",{map:this,layer:n})}},getNumLayers:function(){return this.layers.length},getLayerIndex:function(n){return OpenLayers.Util.indexOf(this.layers,n)},setLayerIndex:function(n,t){var r=this.getLayerIndex(n),i,u;if(0>t?t=0:t>this.layers.length&&(t=this.layers.length),r!=t){for(this.layers.splice(r,1),this.layers.splice(t,0,n),i=0,u=this.layers.length;u>i;i++)this.setLayerZIndex(this.layers[i],i);this.events.triggerEvent("changelayer",{layer:n,property:"order"});this.allOverlays&&(0===t?this.setBaseLayer(n):this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0]))}},raiseLayer:function(n,t){var i=this.getLayerIndex(n)+t;this.setLayerIndex(n,i)},setBaseLayer:function(n){var t,i,r;n!=this.baseLayer&&-1!=OpenLayers.Util.indexOf(this.layers,n)&&(t=this.getCachedCenter(),i=OpenLayers.Util.getResolutionFromScale(this.getScale(),n.units),(null==this.baseLayer||this.allOverlays||this.baseLayer.setVisibility(!1),this.baseLayer=n,this.viewRequestID++,(!this.allOverlays||this.baseLayer.visibility)&&this.baseLayer.setVisibility(!0),null!=t)&&(r=this.getZoomForResolution(i||this.resolution,!0),this.setCenter(t,r,!1,!0)),this.events.triggerEvent("changebaselayer",{layer:this.baseLayer}))},addControl:function(n,t){this.controls.push(n);this.addControlToMap(n,t)},addControls:function(n,t){for(var u,f,r=1===arguments.length?[]:t,i=0,e=n.length;e>i;i++)u=n[i],f=r[i]?r[i]:null,this.addControl(u,f)},addControlToMap:function(n,t){n.outsideViewport=null!=n.div;this.displayProjection&&!n.displayProjection&&(n.displayProjection=this.displayProjection);n.setMap(this);var i=n.draw(t);i&&(n.outsideViewport||(i.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length,this.viewPortDiv.appendChild(i)));n.autoActivate&&n.activate()},getControl:function(n){for(var i,r=null,t=0,u=this.controls.length;u>t;t++)if(i=this.controls[t],i.id==n){r=i;break}return r},removeControl:function(n){n&&n==this.getControl(n.id)&&(n.div&&n.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(n.div),OpenLayers.Util.removeItem(this.controls,n))},addPopup:function(n,t){var i,r;if(t)for(i=this.popups.length-1;i>=0;--i)this.removePopup(this.popups[i]);n.map=this;this.popups.push(n);r=n.draw();r&&(r.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length,this.layerContainerDiv.appendChild(r))},removePopup:function(n){if(OpenLayers.Util.removeItem(this.popups,n),n.div)try{this.layerContainerDiv.removeChild(n.div)}catch(t){}n.map=null},getSize:function(){var n=null;return null!=this.size&&(n=this.size.clone()),n},updateSize:function(){var n=this.getCurrentSize(),t,i,u,r,f;if(n&&!isNaN(n.h)&&!isNaN(n.w)&&(this.events.clearMouseCache(),t=this.getSize(),null==t&&(this.size=t=n),!n.equals(t))){for(this.size=n,i=0,u=this.layers.length;u>i;i++)this.layers[i].onMapResize();r=this.getCachedCenter();null!=this.baseLayer&&null!=r&&(f=this.getZoom(),this.zoom=null,this.setCenter(r,f))}},getCurrentSize:function(){var n=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);return(0==n.w&&0==n.h||isNaN(n.w)&&isNaN(n.h))&&(n.w=this.div.offsetWidth,n.h=this.div.offsetHeight),(0==n.w&&0==n.h||isNaN(n.w)&&isNaN(n.h))&&(n.w=parseInt(this.div.style.width),n.h=parseInt(this.div.style.height)),n},calculateBounds:function(n,t){var i=null;if(null==n&&(n=this.getCachedCenter()),null==t&&(t=this.getResolution()),null!=n&&null!=t){var r=this.getSize(),u=r.w*t,f=r.h*t;i=new OpenLayers.Bounds(n.lon-u/2,n.lat-f/2,n.lon+u/2,n.lat+f/2)}return i},getCenter:function(){var n=null,t=this.getCachedCenter();return t&&(n=t.clone()),n},getCachedCenter:function(){return!this.center&&this.size&&(this.center=this.getLonLatFromViewPortPx(new OpenLayers.Pixel(this.size.w/2,this.size.h/2))),this.center},getZoom:function(){return this.zoom},pan:function(n,t,i){var r,u,f;(i=OpenLayers.Util.applyDefaults(i,{animate:!0,dragging:!1}),i.dragging)?(0!=n||0!=t)&&this.moveByPx(n,t):(r=this.getViewPortPxFromLonLat(this.getCachedCenter()),u=r.add(n,t),(this.dragging||!u.equals(r))&&(f=this.getLonLatFromViewPortPx(u),i.animate?this.panTo(f):(this.moveTo(f),this.dragging=!1,this.events.triggerEvent("moveend"))))},panTo:function(n){var i;if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(n)){if(this.panTween||(this.panTween=new OpenLayers.Tween(this.panMethod)),i=this.getCachedCenter(),n.equals(i))return;var r=this.getPixelFromLonLat(i),u=this.getPixelFromLonLat(n),f={x:u.x-r.x,y:u.y-r.y},t={x:0,y:0};this.panTween.start({x:0,y:0},f,this.panDuration,{callbacks:{eachStep:OpenLayers.Function.bind(function(n){var i=n.x-t.x,r=n.y-t.y;this.moveByPx(i,r);t.x=Math.round(n.x);t.y=Math.round(n.y)},this),done:OpenLayers.Function.bind(function(){this.moveTo(n);this.dragging=!1;this.events.triggerEvent("moveend")},this)}})}else this.setCenter(n)},setCenter:function(n,t,i,r){this.panTween&&this.panTween.stop();this.moveTo(n,t,{dragging:i,forceZoomChange:r})},moveByPx:function(n,t){var h=this.size.w/2,c=this.size.h/2,l=h+n,a=c+t,e=this.baseLayer.wrapDateLine,o=0,s=0,r,u,i,f,v;if(this.restrictedExtent&&(o=h,s=c,e=!1),n=e||this.maxPx.x-o>=l&&l>=this.minPx.x+o?Math.round(n):0,t=this.maxPx.y-s>=a&&a>=this.minPx.y+s?Math.round(t):0,r=this.minPx.x,u=this.maxPx.x,n||t){for(this.dragging||(this.dragging=!0,this.events.triggerEvent("movestart")),this.center=null,n&&(this.layerContainerDiv.style.left=parseInt(this.layerContainerDiv.style.left)-n+"px",this.minPx.x-=n,this.maxPx.x-=n,e&&(this.maxPx.x>u&&(this.maxPx.x-=u-r),r>this.minPx.x&&(this.minPx.x+=u-r))),t&&(this.layerContainerDiv.style.top=parseInt(this.layerContainerDiv.style.top)-t+"px",this.minPx.y-=t,this.maxPx.y-=t),f=0,v=this.layers.length;v>f;++f)i=this.layers[f],i.visibility&&(i===this.baseLayer||i.inRange)&&(i.moveByPx(n,t),i.events.triggerEvent("move"));this.events.triggerEvent("move")}},moveTo:function(n,t,i){var h,y,p,r,l,u,a,o,c,f,s,e,nt;if(i||(i={}),null!=t&&(t=parseFloat(t),this.fractionalZoom||(t=Math.round(t))),h=i.dragging||this.dragging,y=i.forceZoomChange,(this.getCachedCenter()||this.isValidLonLat(n)||(n=this.maxExtent.getCenterLonLat(),this.center=n.clone()),null!=this.restrictedExtent)&&(null==n&&(n=this.center),null==t&&(t=this.getZoom()),p=this.getResolutionForZoom(t),r=this.calculateBounds(n,p),this.restrictedExtent.containsBounds(r)||(l=this.restrictedExtent.getCenterLonLat(),r.getWidth()>this.restrictedExtent.getWidth()?n=new OpenLayers.LonLat(l.lon,n.lat):r.left<this.restrictedExtent.left?n=n.add(this.restrictedExtent.left-r.left,0):r.right>this.restrictedExtent.right&&(n=n.add(this.restrictedExtent.right-r.right,0)),r.getHeight()>this.restrictedExtent.getHeight()?n=new OpenLayers.LonLat(n.lon,l.lat):r.bottom<this.restrictedExtent.bottom?n=n.add(0,this.restrictedExtent.bottom-r.bottom):r.top>this.restrictedExtent.top&&(n=n.add(0,this.restrictedExtent.top-r.top)))),u=y||this.isValidZoomLevel(t)&&t!=this.getZoom(),a=this.isValidLonLat(n)&&!n.equals(this.center),u||a||h){if(h||this.events.triggerEvent("movestart"),a&&(!u&&this.center&&this.centerLayerContainer(n),this.center=n.clone()),o=u?this.getResolutionForZoom(t):this.getResolution(),u||null==this.layerContainerOrigin){this.layerContainerOrigin=this.getCachedCenter();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px";var v=this.getMaxExtent({restricted:!0}),w=v.getCenterLonLat(),tt=this.center.lon-w.lon,it=w.lat-this.center.lat,b=Math.round(v.getWidth()/o),k=Math.round(v.getHeight()/o),d=(this.size.w-b)/2-tt/o,g=(this.size.h-k)/2-it/o;this.minPx=new OpenLayers.Pixel(d,g);this.maxPx=new OpenLayers.Pixel(d+b,g+k)}for(u&&(this.zoom=t,this.resolution=o,this.viewRequestID++),c=this.getExtent(),this.baseLayer.visibility&&(this.baseLayer.moveTo(c,u,i.dragging),i.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:u})),c=this.baseLayer.getExtent(),e=this.layers.length-1;e>=0;--e)f=this.layers[e],f===this.baseLayer||f.isBaseLayer||(s=f.calculateInRange(),f.inRange!=s&&(f.inRange=s,s||f.display(!1),this.events.triggerEvent("changelayer",{layer:f,property:"visibility"})),s&&f.visibility&&(f.moveTo(c,u,i.dragging),i.dragging||f.events.triggerEvent("moveend",{zoomChanged:u})));if(this.events.triggerEvent("move"),h||this.events.triggerEvent("moveend"),u){for(e=0,nt=this.popups.length;nt>e;e++)this.popups[e].updatePosition();this.events.triggerEvent("zoomend")}}},centerLayerContainer:function(n){var t=this.getViewPortPxFromLonLat(this.layerContainerOrigin),i=this.getViewPortPxFromLonLat(n),r,u;if(null!=t&&null!=i){var o=parseInt(this.layerContainerDiv.style.left),s=parseInt(this.layerContainerDiv.style.top),f=Math.round(t.x-i.x),e=Math.round(t.y-i.y);this.layerContainerDiv.style.left=f+"px";this.layerContainerDiv.style.top=e+"px";r=o-f;u=s-e;this.minPx.x-=r;this.maxPx.x-=r;this.minPx.y-=u;this.maxPx.y-=u}},isValidZoomLevel:function(n){return null!=n&&n>=0&&this.getNumZoomLevels()>n},isValidLonLat:function(n){var t=!1,i;return null!=n&&(i=this.getMaxExtent(),t=i.containsLonLat(n)),t},getProjection:function(){var n=this.getProjectionObject();return n?n.getCode():null},getProjectionObject:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.projection),n},getMaxResolution:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.maxResolution),n},getMaxExtent:function(n){var t=null;return n&&n.restricted&&this.restrictedExtent?t=this.restrictedExtent:null!=this.baseLayer&&(t=this.baseLayer.maxExtent),t},getNumZoomLevels:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.numZoomLevels),n},getExtent:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.getExtent()),n},getResolution:function(){var n=null;return null!=this.baseLayer?n=this.baseLayer.getResolution():this.allOverlays===!0&&this.layers.length>0&&(n=this.layers[0].getResolution()),n},getUnits:function(){var n=null;return null!=this.baseLayer&&(n=this.baseLayer.units),n},getScale:function(){var n=null,t,i;return null!=this.baseLayer&&(t=this.getResolution(),i=this.baseLayer.units,n=OpenLayers.Util.getScaleFromResolution(t,i)),n},getZoomForExtent:function(n,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForExtent(n,t)),i},getResolutionForZoom:function(n){var t=null;return this.baseLayer&&(t=this.baseLayer.getResolutionForZoom(n)),t},getZoomForResolution:function(n,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForResolution(n,t)),i},zoomTo:function(n){this.isValidZoomLevel(n)&&this.setCenter(null,n)},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(n,t){var r=n.getCenterLonLat(),i;if(this.baseLayer.wrapDateLine){for(i=this.getMaxExtent(),n=n.clone();n.right<n.left;)n.right+=i.getWidth();r=n.getCenterLonLat().wrapDateLine(i)}this.setCenter(r,this.getZoomForExtent(n,t))},zoomToMaxExtent:function(n){var t=n?n.restricted:!0,i=this.getMaxExtent({restricted:t});this.zoomToExtent(i)},zoomToScale:function(n,t){var r=OpenLayers.Util.getResolutionFromScale(n,this.baseLayer.units),u=this.getSize(),f=u.w*r,e=u.h*r,i=this.getCachedCenter(),o=new OpenLayers.Bounds(i.lon-f/2,i.lat-e/2,i.lon+f/2,i.lat+e/2);this.zoomToExtent(o,t)},getLonLatFromViewPortPx:function(n){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getLonLatFromViewPortPx(n)),t},getViewPortPxFromLonLat:function(n){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getViewPortPxFromLonLat(n)),t},getLonLatFromPixel:function(n){return this.getLonLatFromViewPortPx(n)},getPixelFromLonLat:function(n){var t=this.getViewPortPxFromLonLat(n);return t.x=Math.round(t.x),t.y=Math.round(t.y),t},getGeodesicPixelSize:function(n){var r=n?this.getLonLatFromPixel(n):this.getCachedCenter()||new OpenLayers.LonLat(0,0),u=this.getResolution(),f=r.add(-u/2,0),e=r.add(u/2,0),o=r.add(0,-u/2),s=r.add(0,u/2),t=new OpenLayers.Projection("EPSG:4326"),i=this.getProjectionObject()||t;return i.equals(t)||(f.transform(i,t),e.transform(i,t),o.transform(i,t),s.transform(i,t)),new OpenLayers.Size(OpenLayers.Util.distVincenty(f,e),OpenLayers.Util.distVincenty(o,s))},getViewPortPxFromLayerPx:function(n){var t=null,i,r;return null!=n&&(i=parseInt(this.layerContainerDiv.style.left),r=parseInt(this.layerContainerDiv.style.top),t=n.add(i,r)),t},getLayerPxFromViewPortPx:function(n){var t=null,i,r;return null!=n&&(i=-parseInt(this.layerContainerDiv.style.left),r=-parseInt(this.layerContainerDiv.style.top),t=n.add(i,r),(isNaN(t.x)||isNaN(t.y))&&(t=null)),t},getLonLatFromLayerPx:function(n){return n=this.getViewPortPxFromLayerPx(n),this.getLonLatFromViewPortPx(n)},getLayerPxFromLonLat:function(n){var t=this.getPixelFromLonLat(n);return this.getLayerPxFromViewPortPx(t)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(n,t){OpenLayers.Util.extend(this,t);this.projCode=n;window.Proj4js&&(this.proj=new Proj4js.Proj(n))},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(n){var t=n,r=!1,i,u;return t&&(window.Proj4js&&this.proj.defData&&t.proj.defData?r=this.proj.defData.replace(this.titleRegEx,"")==t.proj.defData.replace(this.titleRegEx,""):t.getCode&&(i=this.getCode(),u=t.getCode(),r=i==u||!!OpenLayers.Projection.transforms[i]&&OpenLayers.Projection.transforms[i][u]===OpenLayers.Projection.nullTransform)),r},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(n,t,i){OpenLayers.Projection.transforms[n]||(OpenLayers.Projection.transforms[n]={});OpenLayers.Projection.transforms[n][t]=i};OpenLayers.Projection.transform=function(n,t,i){return t.proj&&i.proj?n=Proj4js.transform(t.proj,i.proj,n):t&&i&&OpenLayers.Projection.transforms[t.getCode()]&&OpenLayers.Projection.transforms[t.getCode()][i.getCode()]&&OpenLayers.Projection.transforms[t.getCode()][i.getCode()](n),n};OpenLayers.Projection.nullTransform=function(n){return n};OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend","added","removed"],RESOLUTION_PROPERTIES:["scales","resolutions","maxScale","minScale","maxResolution","minResolution","numZoomLevels","maxZoomLevel"],events:null,map:null,isBaseLayer:!1,alpha:!1,displayInLayerSwitcher:!0,visibility:!0,attribution:null,inRange:!1,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:!1,wrapDateLine:!1,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],metadata:{},initialize:function(n,t){this.addOptions(t);this.name=n;null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"),this.div=OpenLayers.Util.createDiv(this.id),this.div.style.width="100%",this.div.style.height="100%",this.div.dir="ltr",this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES),this.eventListeners instanceof Object&&this.events.on(this.eventListeners));this.wrapDateLine&&(this.displayOutsideMaxExtent=!0)},destroy:function(n){null==n&&(n=!0);null!=this.map&&this.map.removeLayer(this,n);this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy());this.eventListeners=null;this.events=null},clone:function(n){return null==n&&(n=new OpenLayers.Layer(this.name,this.getOptions())),OpenLayers.Util.applyDefaults(n,this),n.map=null,n},getOptions:function(){var n={};for(var t in this.options)n[t]=this[t];return n},setName:function(n){n!=this.name&&(this.name=n,null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"name"}))},addOptions:function(n,t){var r,u,i;if(null==this.options&&(this.options={}),OpenLayers.Util.extend(this.options,n),OpenLayers.Util.extend(this,n),"string"==typeof this.projection&&(this.projection=new OpenLayers.Projection(this.projection)),this.projection&&this.projection.getUnits()&&(this.units=this.projection.getUnits()),this.map){r=this.map.getResolution();u=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]);for(i in n)if(n.hasOwnProperty(i)&&OpenLayers.Util.indexOf(u,i)>=0){this.initResolutions();t&&this.map.baseLayer===this&&(this.map.setCenter(this.map.getCenter(),this.map.getZoomForResolution(r),!1,!0),this.map.events.triggerEvent("changebaselayer",{layer:this}));break}}},onMapResize:function(){},redraw:function(){var i=!1,n,t;return this.map&&(this.inRange=this.calculateInRange(),n=this.getExtent(),n&&this.inRange&&this.visibility&&(t=!0,this.moveTo(n,t,!1),this.events.triggerEvent("moveend",{zoomChanged:t}),i=!0)),i},moveTo:function(){var n=this.visibility;this.isBaseLayer||(n=n&&this.inRange);this.display(n)},moveByPx:function(){},setMap:function(n){if(null==this.map){if(this.map=n,this.maxExtent=this.maxExtent||this.map.maxExtent,this.minExtent=this.minExtent||this.map.minExtent,this.projection=this.projection||this.map.projection,"string"==typeof this.projection&&(this.projection=new OpenLayers.Projection(this.projection)),this.units=this.projection.getUnits()||this.units||this.map.units,this.initResolutions(),!this.isBaseLayer){this.inRange=this.calculateInRange();var t=this.visibility&&this.inRange;this.div.style.display=t?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(){},getImageSize:function(){return this.imageSize||this.tileSize},setTileSize:function(n){var t=n?n:this.tileSize?this.tileSize:this.map.getTileSize();this.tileSize=t;this.gutter&&(this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter),this.imageSize=new OpenLayers.Size(t.w+2*this.gutter,t.h+2*this.gutter))},getVisibility:function(){return this.visibility},setVisibility:function(n){n!=this.visibility&&(this.visibility=n,this.display(n),this.redraw(),null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"}),this.events.triggerEvent("visibilitychanged"))},display:function(n){n!=("none"!=this.div.style.display)&&(this.div.style.display=n&&this.calculateInRange()?"block":"none")},calculateInRange:function(){var n=!1,t;return this.alwaysInRange?n=!0:this.map&&(t=this.map.getResolution(),n=t>=this.minResolution&&this.maxResolution>=t),n},setIsBaseLayer:function(n){n!=this.isBaseLayer&&(this.isBaseLayer=n,null!=this.map&&this.map.events.triggerEvent("changebaselayer",{layer:this}))},initResolutions:function(){for(var i,n={},e=!0,u,f,o,t=0,r=this.RESOLUTION_PROPERTIES.length;r>t;t++)i=this.RESOLUTION_PROPERTIES[t],n[i]=this.options[i],e&&this.options[i]&&(e=!1);if(null==this.alwaysInRange&&(this.alwaysInRange=e),null==n.resolutions&&(n.resolutions=this.resolutionsFromScales(n.scales)),null==n.resolutions&&(n.resolutions=this.calculateResolutions(n)),null==n.resolutions){for(t=0,r=this.RESOLUTION_PROPERTIES.length;r>t;t++)i=this.RESOLUTION_PROPERTIES[t],n[i]=null!=this.options[i]?this.options[i]:this.map[i];null==n.resolutions&&(n.resolutions=this.resolutionsFromScales(n.scales));null==n.resolutions&&(n.resolutions=this.calculateResolutions(n))}if(this.options.maxResolution&&"auto"!==this.options.maxResolution&&(u=this.options.maxResolution),this.options.minScale&&(u=OpenLayers.Util.getResolutionFromScale(this.options.minScale,this.units)),(this.options.minResolution&&"auto"!==this.options.minResolution&&(f=this.options.minResolution),this.options.maxScale&&(f=OpenLayers.Util.getResolutionFromScale(this.options.maxScale,this.units)),n.resolutions&&(n.resolutions.sort(function(n,t){return t-n}),u||(u=n.resolutions[0]),!f))&&(o=n.resolutions.length-1,f=n.resolutions[o]),this.resolutions=n.resolutions,this.resolutions){for(r=this.resolutions.length,this.scales=Array(r),t=0;r>t;t++)this.scales[t]=OpenLayers.Util.getScaleFromResolution(this.resolutions[t],this.units);this.numZoomLevels=r}this.minResolution=f;f&&(this.maxScale=OpenLayers.Util.getScaleFromResolution(f,this.units));this.maxResolution=u;u&&(this.minScale=OpenLayers.Util.getScaleFromResolution(u,this.units))},resolutionsFromScales:function(n){if(null!=n){var i,t,r;for(r=n.length,i=Array(r),t=0;r>t;t++)i[t]=OpenLayers.Util.getResolutionFromScale(n[t],this.units);return i}},calculateResolutions:function(n){var f,e,o,i=n.maxResolution,u,c,t,l,s,h,r;if(null!=n.minScale?i=OpenLayers.Util.getResolutionFromScale(n.minScale,this.units):"auto"==i&&null!=this.maxExtent&&(f=this.map.getSize(),e=this.maxExtent.getWidth()/f.w,o=this.maxExtent.getHeight()/f.h,i=Math.max(e,o)),u=n.minResolution,null!=n.maxScale?u=OpenLayers.Util.getResolutionFromScale(n.maxScale,this.units):"auto"==n.minResolution&&null!=this.minExtent&&(f=this.map.getSize(),e=this.minExtent.getWidth()/f.w,o=this.minExtent.getHeight()/f.h,u=Math.max(e,o)),c=n.maxZoomLevel,t=n.numZoomLevels,"number"==typeof u&&"number"==typeof i&&void 0===t?(l=i/u,t=Math.floor(Math.log(l)/Math.log(2))+1):void 0===t&&null!=c&&(t=c+1),!("number"!=typeof t||0>=t||"number"!=typeof i&&"number"!=typeof u)){if(s=Array(t),h=2,"number"==typeof u&&"number"==typeof i&&(h=Math.pow(i/u,1/(t-1))),"number"==typeof i)for(r=0;t>r;r++)s[r]=i/Math.pow(h,r);else for(r=0;t>r;r++)s[t-1-r]=u*Math.pow(h,r);return s}},getResolution:function(){var n=this.map.getZoom();return this.getResolutionForZoom(n)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(n,t){var i=this.map.getSize(),r=Math.max(n.getWidth()/i.w,n.getHeight()/i.h);return this.getZoomForResolution(r,t)},getDataExtent:function(){},getResolutionForZoom:function(n){var i,t,r;return n=Math.max(0,Math.min(n,this.resolutions.length-1)),this.map.fractionalZoom?(t=Math.floor(n),r=Math.ceil(n),i=this.resolutions[t]-(n-t)*(this.resolutions[t]-this.resolutions[r])):i=this.resolutions[Math.round(n)],i},getZoomForResolution:function(n,t){var e,i,u,s,h,c;if(this.map.fractionalZoom){var r,f=0,l=this.resolutions.length-1,o=this.resolutions[f],a=this.resolutions[l];for(i=0,u=this.resolutions.length;u>i;++i)if(r=this.resolutions[i],r>=n&&(o=r,f=i),n>=r){a=r;l=i;break}s=o-a;e=s>0?f+(o-n)/s:f}else{for(c=Number.POSITIVE_INFINITY,i=0,u=this.resolutions.length;u>i;i++)if(t){if(h=Math.abs(this.resolutions[i]-n),h>c)break;c=h}else if(n>this.resolutions[i])break;e=Math.max(0,i-1)}return e},getLonLatFromViewPortPx:function(n){var i=null,t=this.map;if(null!=n&&t.minPx){var r=t.getResolution(),u=t.getMaxExtent({restricted:!0}),f=(n.x-t.minPx.x)*r+u.left,e=(t.minPx.y-n.y)*r+u.top;i=new OpenLayers.LonLat(f,e);this.wrapDateLine&&(i=i.wrapDateLine(this.maxExtent))}return i},getViewPortPxFromLonLat:function(n){var r=null,t,i;return null!=n&&(t=this.map.getResolution(),i=this.map.getExtent(),r=new OpenLayers.Pixel(1/t*(n.lon-i.left),1/t*(i.top-n.lat))),r},setOpacity:function(n){var t,i,r;if(n!=this.opacity){for(this.opacity=n,t=0,i=this.div.childNodes.length;i>t;++t)r=this.div.childNodes[t].firstChild,OpenLayers.Util.modifyDOMElement(r,null,null,null,null,null,null,n);null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(n){this.div.style.zIndex=n},adjustBounds:function(n){var t,i;return this.gutter&&(t=this.gutter*this.map.getResolution(),n=new OpenLayers.Bounds(n.left-t,n.bottom-t,n.right+t,n.top+t)),this.wrapDateLine&&(i={rightTolerance:this.getResolution(),leftTolerance:this.getResolution()},n=n.wrapDateLine(this.maxExtent,i)),n},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Layer.SphericalMercator={getExtent:function(){return this.sphericalMercator?this.map.calculateBounds():OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)},getLonLatFromViewPortPx:function(){return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this,arguments)},getViewPortPxFromLonLat:function(){return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this,arguments)},initMercatorParameters:function(){this.RESOLUTIONS=[];for(var n=0;this.MAX_ZOOM_LEVEL>=n;++n)this.RESOLUTIONS[n]=156543.03390625/Math.pow(2,n);this.units="m";this.projection=this.projection||"EPSG:900913"},forwardMercator:function(n,t){var r=20037508.34*n/180,i=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return i=20037508.34*i/180,new OpenLayers.LonLat(r,i)},inverseMercator:function(n,t){var r=180*(n/20037508.34),i=180*(t/20037508.34);return i=180/Math.PI*(2*Math.atan(Math.exp(i*Math.PI/180))-Math.PI/2),new OpenLayers.LonLat(r,i)},projectForward:function(n){var t=OpenLayers.Layer.SphericalMercator.forwardMercator(n.x,n.y);return n.x=t.lon,n.y=t.lat,n},projectInverse:function(n){var t=OpenLayers.Layer.SphericalMercator.inverseMercator(n.x,n.y);return n.x=t.lon,n.y=t.lat,n}},function(){for(var t,f,i,e=["EPSG:900913","EPSG:3857","EPSG:102113","EPSG:102100"],r=OpenLayers.Projection.addTransform,o=OpenLayers.Layer.SphericalMercator,s=OpenLayers.Projection.nullTransform,n=0,u=e.length;u>n;++n)for(t=e[n],r("EPSG:4326",t,o.projectForward),r(t,"EPSG:4326",o.projectInverse),i=n+1;u>i;++i)f=e[i],r(t,f,s),r(f,t,s)}();OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:!0,isBaseLayer:!0,isFixed:!0,pane:null,mapObject:null,initialize:function(){OpenLayers.Layer.prototype.initialize.apply(this,arguments);null==this.pane&&(this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane"))},destroy:function(){this.mapObject=null;this.pane=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";"msie"==OpenLayers.BROWSER_NAME&&(this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)");this.isFixed?this.map.eventsDiv.appendChild(this.pane):this.map.layerContainerDiv.appendChild(this.pane);this.loadMapObject();null==this.mapObject&&this.loadWarningMessage()},removeMap:function(){this.pane&&this.pane.parentNode&&this.pane.parentNode.removeChild(this.pane);OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var n=this.map.getSize(),r=Math.min(n.w,300),u=Math.min(n.h,200),i=new OpenLayers.Size(r,u),f=new OpenLayers.Pixel(n.w/2,n.h/2),e=f.add(-i.w/2,-i.h/2),t=OpenLayers.Util.createDiv(this.name+"_warning",e,i,null,null,null,"auto");t.style.padding="7px";t.style.backgroundColor="yellow";t.innerHTML=this.getWarningHTML();this.div.appendChild(t)},getWarningHTML:function(){return""},display:function(){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveByPx:function(n,t){OpenLayers.Layer.prototype.moveByPx.apply(this,arguments);this.dragPanMapObject?this.dragPanMapObject(n,-t):this.moveTo(this.map.getCachedCenter())},moveTo:function(n,t,i){var r,u,e,o,s,h;if((OpenLayers.Layer.prototype.moveTo.apply(this,arguments),null!=this.mapObject)&&(r=this.map.getCenter(),u=this.map.getZoom(),null!=r)){var c=this.getMapObjectCenter(),f=this.getOLLonLatFromMapObjectLonLat(c),l=this.getMapObjectZoom(),a=this.getOLZoomFromMapObjectZoom(l);r.equals(f)&&u==a||(!t&&f&&this.dragPanMapObject&&this.smoothDragPan?(e=this.map.getViewPortPxFromLonLat(f),o=this.map.getViewPortPxFromLonLat(r),this.dragPanMapObject(o.x-e.x,e.y-o.y)):(s=this.getMapObjectLonLatFromOLLonLat(r),h=this.getMapObjectZoomFromOLZoom(u),this.setMapObjectCenter(s,h,i)))}},getLonLatFromViewPortPx:function(n){var t=null,i,r;return null!=this.mapObject&&null!=this.getMapObjectCenter()&&(i=this.getMapObjectPixelFromOLPixel(n),r=this.getMapObjectLonLatFromMapObjectPixel(i),t=this.getOLLonLatFromMapObjectLonLat(r)),t},getViewPortPxFromLonLat:function(n){var t=null,i,r;return null!=this.mapObject&&null!=this.getMapObjectCenter()&&(i=this.getMapObjectLonLatFromOLLonLat(n),r=this.getMapObjectPixelFromMapObjectLonLat(i),t=this.getOLPixelFromMapObjectPixel(r)),t},getOLLonLatFromMapObjectLonLat:function(n){var t=null,i,r;return null!=n&&(i=this.getLongitudeFromMapObjectLonLat(n),r=this.getLatitudeFromMapObjectLonLat(n),t=new OpenLayers.LonLat(i,r)),t},getMapObjectLonLatFromOLLonLat:function(n){var t=null;return null!=n&&(t=this.getMapObjectLonLatFromLonLat(n.lon,n.lat)),t},getOLPixelFromMapObjectPixel:function(n){var t=null,i,r;return null!=n&&(i=this.getXFromMapObjectPixel(n),r=this.getYFromMapObjectPixel(n),t=new OpenLayers.Pixel(i,r)),t},getMapObjectPixelFromOLPixel:function(n){var t=null;return null!=n&&(t=this.getMapObjectPixelFromXY(n.x,n.y)),t},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){for(var t,i,r,f,u=["minZoomLevel","maxZoomLevel","numZoomLevels"],n=0,e=u.length;e>n;n++)t=u[n],this[t]=null!=this.options[t]?this.options[t]:this.map[t];if((null==this.minZoomLevel||this.minZoomLevel<this.MIN_ZOOM_LEVEL)&&(this.minZoomLevel=this.MIN_ZOOM_LEVEL),r=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1,i=null==this.options.numZoomLevels&&null!=this.options.maxZoomLevel||null==this.numZoomLevels&&null!=this.maxZoomLevel?this.maxZoomLevel-this.minZoomLevel+1:this.numZoomLevels,this.numZoomLevels=null!=i?Math.min(i,r):r,this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1,null!=this.RESOLUTIONS){for(f=0,this.resolutions=[],n=this.minZoomLevel;this.maxZoomLevel>=n;n++)this.resolutions[f++]=this.RESOLUTIONS[n];this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getResolution.apply(this,arguments);var i=null,n=this.map.getSize(),t=this.getExtent();return null!=n&&null!=t&&(i=Math.max(t.getWidth()/n.w,t.getHeight()/n.h)),i},getExtent:function(){var i=null,r=this.map.getSize(),u=new OpenLayers.Pixel(0,0),n=this.getLonLatFromViewPortPx(u),f=new OpenLayers.Pixel(r.w,r.h),t=this.getLonLatFromViewPortPx(f);return null!=n&&null!=t&&(i=new OpenLayers.Bounds(n.lon,t.lat,t.lon,n.lat)),i},getZoomForResolution:function(){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);var n=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(n)},getOLZoomFromMapObjectZoom:function(n){var t=null;return null!=n&&(t=n-this.minZoomLevel,this.map.baseLayer!==this&&(t=this.map.baseLayer.getZoomForResolution(this.getResolutionForZoom(t)))),t},getMapObjectZoomFromOLZoom:function(n){var t=null;return null!=n&&(t=n+this.minZoomLevel,this.map.baseLayer!==this&&(t=this.getZoomForResolution(this.map.baseLayer.getResolutionForZoom(t)))),t},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,21457672119140622e-21,10728836059570311e-21,536441802978515e-20],type:null,wrapDateLine:!0,sphericalMercator:!1,animationEnabled:!0,initialize:function(){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},loadMapObject:function(){var n=OpenLayers.Util.createDiv(this.name),t=this.map.getSize();n.style.width=t.w+"px";n.style.height=t.h+"px";this.div.appendChild(n);try{this.mapObject=new VEMap(this.name)}catch(i){}if(null!=this.mapObject){try{this.mapObject.LoadMap(null,null,this.type,!0);this.mapObject.AttachEvent("onmousedown",OpenLayers.Function.True)}catch(i){}this.mapObject.HideDashboard();"function"==typeof this.mapObject.SetAnimationEnabled&&this.mapObject.SetAnimationEnabled(this.animationEnabled)}this.mapObject&&this.mapObject.vemapcontrol&&this.mapObject.vemapcontrol.PanMap&&"function"==typeof this.mapObject.vemapcontrol.PanMap||(this.dragPanMapObject=null)},onMapResize:function(){this.mapObject.Resize(this.map.size.w,this.map.size.h)},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"VE",layerLib:"VirtualEarth"})},setMapObjectCenter:function(n,t){this.mapObject.SetCenterAndZoom(n,t)},getMapObjectCenter:function(){return this.mapObject.GetCenter()},dragPanMapObject:function(n,t){this.mapObject.vemapcontrol.PanMap(n,-t)},getMapObjectZoom:function(){return this.mapObject.GetZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(n){return"undefined"!=typeof VEPixel?this.mapObject.PixelToLatLong(n):this.mapObject.PixelToLatLong(n.x,n.y)},getMapObjectPixelFromMapObjectLonLat:function(n){return this.mapObject.LatLongToPixel(n)},getLongitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.Longitude,n.Latitude).lon:n.Longitude},getLatitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.Longitude,n.Latitude).lat:n.Latitude},getMapObjectLonLatFromLonLat:function(n,t){var i,r;return this.sphericalMercator?(r=this.inverseMercator(n,t),i=new VELatLong(r.lat,r.lon)):i=new VELatLong(t,n),i},getXFromMapObjectPixel:function(n){return n.x},getYFromMapObjectPixel:function(n){return n.y},getMapObjectPixelFromXY:function(n,t){return"undefined"!=typeof VEPixel?new VEPixel(n,t):new Msn.VE.Pixel(n,t)},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:!1,displayClass:"",title:"",autoActivate:!1,active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(n){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,n);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);this.eventListeners instanceof Object&&this.events.on(this.eventListeners);null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"))},destroy:function(){if(this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=null),this.eventListeners=null,this.handler&&(this.handler.destroy(),this.handler=null),this.handlers){for(var n in this.handlers)this.handlers.hasOwnProperty(n)&&"function"==typeof this.handlers[n].destroy&&this.handlers[n].destroy();this.handlers=null}this.map&&(this.map.removeControl(this),this.map=null);this.div=null},setMap:function(n){this.map=n;this.handler&&this.handler.setMap(n)},draw:function(n){return null==this.div&&(this.div=OpenLayers.Util.createDiv(this.id),this.div.className=this.displayClass,this.allowSelection||(this.div.className+=" olControlNoSelect",this.div.setAttribute("unselectable","on",0),this.div.onselectstart=OpenLayers.Function.False),""!=this.title&&(this.div.title=this.title)),null!=n&&(this.position=n.clone()),this.moveTo(this.position),this.div},moveTo:function(n){null!=n&&null!=this.div&&(this.div.style.left=n.x+"px",this.div.style.top=n.y+"px")},activate:function(){return this.active?!1:(this.handler&&this.handler.activate(),this.active=!0,this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("activate"),!0)},deactivate:function(){return this.active?(this.handler&&this.handler.deactivate(),this.active=!1,this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("deactivate"),!0):!1},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:!1,handlers:null,resolutionFactor:1,maximized:!1,initialize:function(n){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[n])},destroy:function(){this.mapDiv&&(this.handlers.click&&this.handlers.click.destroy(),this.handlers.drag&&this.handlers.drag.destroy(),this.ovmap&&this.ovmap.eventsDiv.removeChild(this.extentRectangle),this.extentRectangle=null,this.rectEvents&&(this.rectEvents.destroy(),this.rectEvents=null),this.ovmap&&(this.ovmap.destroy(),this.ovmap=null),this.element.removeChild(this.mapDiv),this.mapDiv=null,this.div.removeChild(this.element),this.element=null,this.maximizeDiv&&(OpenLayers.Event.stopObservingElement(this.maximizeDiv),this.div.removeChild(this.maximizeDiv),this.maximizeDiv=null),this.minimizeDiv&&(OpenLayers.Event.stopObservingElement(this.minimizeDiv),this.div.removeChild(this.minimizeDiv),this.minimizeDiv=null),this.map.events.un({moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments))},draw:function(){var u,i,n;if(OpenLayers.Control.prototype.draw.apply(this,arguments),!(this.layers.length>0)){if(!this.map.baseLayer)return this.map.events.register("changebaselayer",this,this.baseLayerDraw),this.div;u=this.map.baseLayer.clone();this.layers=[u]}if(this.element=document.createElement("div"),this.element.className=this.displayClass+"Element",this.element.style.display="none",this.mapDiv=document.createElement("div"),this.mapDiv.style.width=this.size.w+"px",this.mapDiv.style.height=this.size.h+"px",this.mapDiv.style.position="relative",this.mapDiv.style.overflow="hidden",this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap"),this.extentRectangle=document.createElement("div"),this.extentRectangle.style.position="absolute",this.extentRectangle.style.zIndex=1e3,this.extentRectangle.className=this.displayClass+"ExtentRectangle",this.element.appendChild(this.mapDiv),this.div.appendChild(this.element),this.outsideViewport)this.element.style.display="";else{this.div.className+=" "+this.displayClass+"Container";i=OpenLayers.Util.getImagesLocation();n=i+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),n,"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);n=i+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),n,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);for(var r=["dblclick","mousedown"],t=0,f=r.length;f>t;t++)OpenLayers.Event.observe(this.maximizeDiv,r[t],OpenLayers.Event.stop),OpenLayers.Event.observe(this.minimizeDiv,r[t],OpenLayers.Event.stop);this.minimizeControl()}return this.map.getExtent()&&this.update(),this.map.events.register("moveend",this,this.update),this.maximized&&this.maximizeControl(),this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(n){var r=this.handlers.drag.last.x-n.x,u=this.handlers.drag.last.y-n.y,t;if(0!=r||0!=u){var o=this.rectPxBounds.top,s=this.rectPxBounds.left,f=Math.abs(this.rectPxBounds.getHeight()),e=this.rectPxBounds.getWidth(),i=Math.max(0,o-u);i=Math.min(i,this.ovmap.size.h-this.hComp-f);t=Math.max(0,s-r);t=Math.min(t,this.ovmap.size.w-this.wComp-e);this.setRectPxBounds(new OpenLayers.Bounds(t,i+f,t+e,i))}},mapDivClick:function(n){var r=this.rectPxBounds.getCenterPixel(),e=n.xy.x-r.x,o=n.xy.y-r.y,s=this.rectPxBounds.top,h=this.rectPxBounds.left,u=Math.abs(this.rectPxBounds.getHeight()),f=this.rectPxBounds.getWidth(),i=Math.max(0,s+o),t;i=Math.min(i,this.ovmap.size.h-u);t=Math.max(0,h+e);t=Math.min(t,this.ovmap.size.w-f);this.setRectPxBounds(new OpenLayers.Bounds(t,i+u,t+f,i));this.updateMapToRect()},maximizeControl:function(n){this.element.style.display="";this.showToggle(!1);null!=n&&OpenLayers.Event.stop(n)},minimizeControl:function(n){this.element.style.display="none";this.showToggle(!0);null!=n&&OpenLayers.Event.stop(n)},showToggle:function(n){this.maximizeDiv.style.display=n?"":"none";this.minimizeDiv.style.display=n?"none":""},update:function(){null==this.ovmap&&this.createMap();(this.autoPan||!this.isSuitableOverview())&&this.updateOverview();this.updateRectToMap()},isSuitableOverview:function(){var n=this.map.getExtent(),t=this.map.maxExtent,i=new OpenLayers.Bounds(Math.max(n.left,t.left),Math.max(n.bottom,t.bottom),Math.min(n.right,t.right),Math.min(n.top,t.top)),r;return this.ovmap.getProjection()!=this.map.getProjection()&&(i=i.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())),r=this.ovmap.getResolution()/this.map.getResolution(),r>this.minRatio&&this.maxRatio>=r&&this.ovmap.getExtent().containsBounds(i)},updateOverview:function(){var i=this.map.getResolution(),n=this.ovmap.getResolution(),r=n/i,t;r>this.maxRatio?n=this.minRatio*i:this.minRatio>=r&&(n=this.maxRatio*i);this.ovmap.getProjection()!=this.map.getProjection()?(t=this.map.center.clone(),t.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())):t=this.map.center;this.ovmap.setCenter(t,this.ovmap.getZoomForResolution(n*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var i=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:!1},this.mapOptions),n,t;(this.ovmap=new OpenLayers.Map(this.mapDiv,i),this.ovmap.eventsDiv.appendChild(this.extentRectangle),OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy),this.ovmap.addLayers(this.layers),this.ovmap.zoomToMaxExtent(),this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width")),this.wComp=this.wComp?this.wComp:2,this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width")),this.hComp=this.hComp?this.hComp:2,this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap}),this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:!0,double:!1,stopSingle:!0,stopDouble:!0,pixelTolerance:1,map:this.ovmap}),this.handlers.click.activate(),this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,!0),this.rectEvents.register("mouseover",this,function(){this.handlers.drag.active||this.map.dragging||this.handlers.drag.activate()}),this.rectEvents.register("mouseout",this,function(){this.handlers.drag.dragging||this.handlers.drag.deactivate()}),this.ovmap.getProjection()!=this.map.getProjection())&&(n=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,t=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units,this.resolutionFactor=n&&t?OpenLayers.INCHES_PER_UNIT[n]/OpenLayers.INCHES_PER_UNIT[t]:1)},updateRectToMap:function(){var t,n;t=this.ovmap.getProjection()!=this.map.getProjection()?this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()):this.map.getExtent();n=this.getRectBoundsFromMapBounds(t);n&&this.setRectPxBounds(n)},updateMapToRect:function(){var n=this.getMapBoundsFromRectBounds(this.rectPxBounds);this.ovmap.getProjection()!=this.map.getProjection()&&(n=n.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject()));this.map.panTo(n.getCenterLonLat())},setRectPxBounds:function(n){var t=Math.max(n.top,0),i=Math.max(n.left,0),f=Math.min(n.top+Math.abs(n.getHeight()),this.ovmap.size.h-this.hComp),e=Math.min(n.left+n.getWidth(),this.ovmap.size.w-this.wComp),r=Math.max(e-i,0),u=Math.max(f-t,0),o,s;this.minRectSize>r||this.minRectSize>u?(this.extentRectangle.className=this.displayClass+this.minRectDisplayClass,o=i+r/2-this.minRectSize/2,s=t+u/2-this.minRectSize/2,this.extentRectangle.style.top=Math.round(s)+"px",this.extentRectangle.style.left=Math.round(o)+"px",this.extentRectangle.style.height=this.minRectSize+"px",this.extentRectangle.style.width=this.minRectSize+"px"):(this.extentRectangle.className=this.displayClass+"ExtentRectangle",this.extentRectangle.style.top=Math.round(t)+"px",this.extentRectangle.style.left=Math.round(i)+"px",this.extentRectangle.style.height=Math.round(u)+"px",this.extentRectangle.style.width=Math.round(r)+"px");this.rectPxBounds=new OpenLayers.Bounds(Math.round(i),Math.round(f),Math.round(e),Math.round(t))},getRectBoundsFromMapBounds:function(n){var u=new OpenLayers.LonLat(n.left,n.bottom),f=new OpenLayers.LonLat(n.right,n.top),t=this.getOverviewPxFromLonLat(u),i=this.getOverviewPxFromLonLat(f),r=null;return t&&i&&(r=new OpenLayers.Bounds(t.x,t.y,i.x,i.y)),r},getMapBoundsFromRectBounds:function(n){var r=new OpenLayers.Pixel(n.left,n.bottom),u=new OpenLayers.Pixel(n.right,n.top),t=this.getLonLatFromOverviewPx(r),i=this.getLonLatFromOverviewPx(u);return new OpenLayers.Bounds(t.lon,t.lat,i.lon,i.lat)},getLonLatFromOverviewPx:function(n){var t=this.ovmap.size,i=this.ovmap.getResolution(),r=this.ovmap.getExtent().getCenterLonLat(),u=n.x-t.w/2,f=n.y-t.h/2;return new OpenLayers.LonLat(r.lon+u*i,r.lat-f*i)},getOverviewPxFromLonLat:function(n){var i=this.ovmap.getResolution(),t=this.ovmap.getExtent(),r=null;return t&&(r=new OpenLayers.Pixel(Math.round(1/i*(n.lon-t.left)),Math.round(1/i*(t.top-n.lat)))),r},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:21,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,21457672119140622e-21,10728836059570311e-21,536441802978515e-20,268220901489257e-20,13411045074462891e-22,67055225372314453e-23],type:null,wrapDateLine:!0,sphericalMercator:!1,version:null,initialize:function(n,t){t=t||{};t.version||(t.version="function"==typeof GMap2?"2":"3");var i=OpenLayers.Layer.Google["v"+t.version.replace(/\./g,"_")];if(!i)throw"Unsupported Google Maps API version: "+t.version;OpenLayers.Util.applyDefaults(t,i);OpenLayers.Util.applyDefaults(t,i.DEFAULTS);t.maxExtent&&(t.maxExtent=t.maxExtent.clone());OpenLayers.Layer.EventPane.prototype.initialize.apply(this,[n,t]);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,[n,t]);this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},clone:function(){return new OpenLayers.Layer.Google(this.name,this.getOptions())},setVisibility:function(){var n=null==this.opacity?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments);this.setOpacity(n)},display:function(n){this._dragging||this.setGMapVisibility(n);OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments)},moveTo:function(n,t,i){this._dragging=i;OpenLayers.Layer.EventPane.prototype.moveTo.apply(this,arguments);delete this._dragging},setOpacity:function(n){if(n!==this.opacity&&(null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"}),this.opacity=n),this.getVisibility()){var t=this.getMapContainer();OpenLayers.Util.modifyDOMElement(t,null,null,null,null,null,null,n)}},destroy:function(){if(this.map){this.setGMapVisibility(!1);var n=OpenLayers.Layer.Google.cache[this.map.id];n&&1>=n.count&&this.removeGMapElements()}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var r=OpenLayers.Layer.Google.cache[this.map.id],n,t,i;r&&(n=this.mapObject&&this.getMapContainer(),n&&n.parentNode&&n.parentNode.removeChild(n),t=r.termsOfUse,t&&t.parentNode&&t.parentNode.removeChild(t),i=r.poweredBy,i&&i.parentNode&&i.parentNode.removeChild(i))},removeMap:function(n){this.visibility&&this.mapObject&&this.setGMapVisibility(!1);var t=OpenLayers.Layer.Google.cache[n.id];t&&(1>=t.count?(this.removeGMapElements(),delete OpenLayers.Layer.Google.cache[n.id]):--t.count);delete this.termsOfUse;delete this.poweredBy;delete this.mapObject;delete this.dragObject;OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(n){var r=null,t,i;return null!=n&&(t=n.getSouthWest(),i=n.getNorthEast(),this.sphericalMercator?(t=this.forwardMercator(t.lng(),t.lat()),i=this.forwardMercator(i.lng(),i.lat())):(t=new OpenLayers.LonLat(t.lng(),t.lat()),i=new OpenLayers.LonLat(i.lng(),i.lat())),r=new OpenLayers.Bounds(t.lon,t.lat,i.lon,i.lat)),r},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getLongitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.lng(),n.lat()).lon:n.lng()},getLatitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.lng(),n.lat()).lat:n.lat()},getXFromMapObjectPixel:function(n){return n.x},getYFromMapObjectPixel:function(n){return n.y},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Google.cache={};OpenLayers.Layer.Google.v2={termsOfUse:null,poweredBy:null,dragObject:null,loadMapObject:function(){var r,n,t,u,f,i;if(this.type||(this.type=G_NORMAL_MAP),u=OpenLayers.Layer.Google.cache[this.map.id],u)r=u.mapObject,n=u.termsOfUse,t=u.poweredBy,++u.count;else{f=this.map.viewPortDiv;i=document.createElement("div");i.id=this.map.id+"_GMap2Container";i.style.position="absolute";i.style.width="100%";i.style.height="100%";f.appendChild(i);try{r=new GMap2(i);n=i.lastChild;f.appendChild(n);n.style.zIndex="1100";n.style.right="";n.style.bottom="";n.className="olLayerGoogleCopyright";t=i.lastChild;f.appendChild(t);t.style.zIndex="1100";t.style.right="";t.style.bottom="";t.className="olLayerGooglePoweredBy gmnoprint"}catch(e){throw e;}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:r,termsOfUse:n,poweredBy:t,count:1}}this.mapObject=r;this.termsOfUse=n;this.poweredBy=t;-1===OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)&&this.mapObject.addMapType(this.type);"function"==typeof r.getDragObject?this.dragObject=r.getDragObject():this.dragPanMapObject=null;this.isBaseLayer===!1&&this.setGMapVisibility("none"!==this.div.style.display)},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded())this.mapObject.checkResize();else{if(!this._resized)var n=this,t=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(t);delete n._resized;n.mapObject.checkResize();n.moveTo(n.map.getCenter(),n.map.getZoom())});this._resized=!0}},setGMapVisibility:function(n){var t=OpenLayers.Layer.Google.cache[this.map.id],i;t&&(i=this.mapObject.getContainer(),n===!0?(this.mapObject.setMapType(this.type),i.style.display="",this.termsOfUse.style.left="",this.termsOfUse.style.display="",this.poweredBy.style.display="",t.displayed=this.id):(t.displayed===this.id&&delete t.displayed,t.displayed||(i.style.display="none",this.termsOfUse.style.display="none",this.termsOfUse.style.left="-9999px",this.poweredBy.style.display="none")))},getMapContainer:function(){return this.mapObject.getContainer()},getMapObjectBoundsFromOLBounds:function(n){var r=null,t,i;return null!=n&&(t=this.sphericalMercator?this.inverseMercator(n.bottom,n.left):new OpenLayers.LonLat(n.bottom,n.left),i=this.sphericalMercator?this.inverseMercator(n.top,n.right):new OpenLayers.LonLat(n.top,n.right),r=new GLatLngBounds(new GLatLng(t.lat,t.lon),new GLatLng(i.lat,i.lon))),r},setMapObjectCenter:function(n,t){this.mapObject.setCenter(n,t)},dragPanMapObject:function(n,t){this.dragObject.moveBy(new GSize(-n,t))},getMapObjectLonLatFromMapObjectPixel:function(n){return this.mapObject.fromContainerPixelToLatLng(n)},getMapObjectPixelFromMapObjectLonLat:function(n){return this.mapObject.fromLatLngToContainerPixel(n)},getMapObjectZoomFromMapObjectBounds:function(n){return this.mapObject.getBoundsZoomLevel(n)},getMapObjectLonLatFromLonLat:function(n,t){var i,r;return this.sphericalMercator?(r=this.inverseMercator(n,t),i=new GLatLng(r.lat,r.lon)):i=new GLatLng(t,n),i},getMapObjectPixelFromXY:function(n,t){return new GPoint(n,t)}};OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(n){window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM"));OpenLayers.Format.prototype.initialize.apply(this,[n]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var t in this.namespaces)this.namespaceAlias[this.namespaces[t]]=t},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(n,t){this.namespaces[n]=t;this.namespaceAlias[t]=n},read:function(n){var i=n.indexOf("<"),t;return i>0&&(n=n.substring(i)),t=OpenLayers.Util.Try(OpenLayers.Function.bind(function(){var t;return t=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom,t.loadXML(n),t},this),function(){return(new DOMParser).parseFromString(n,"text/xml")},function(){var t=new XMLHttpRequest;return t.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(n),!1),t.overrideMimeType&&t.overrideMimeType("text/xml"),t.send(null),t.responseXML}),this.keepData&&(this.data=t),t},write:function(n){var i,r,t;return this.xmldom?i=n.xml:(r=new XMLSerializer,1==n.nodeType?(t=document.implementation.createDocument("","",null),t.importNode&&(n=t.importNode(n,!0)),t.appendChild(n),i=r.serializeToString(t)):i=r.serializeToString(n)),i},createElementNS:function(n,t){return this.xmldom?"string"==typeof n?this.xmldom.createNode(1,t,n):this.xmldom.createNode(1,t,""):document.createElementNS(n,t)},createTextNode:function(n){var t;return"string"!=typeof n&&(n+=""),t=this.xmldom?this.xmldom.createTextNode(n):document.createTextNode(n)},getElementsByTagNameNS:function(n,t,i){var u=[];if(n.getElementsByTagNameNS)u=n.getElementsByTagNameNS(t,i);else for(var r,e,o=n.getElementsByTagName("*"),f=0,s=o.length;s>f;++f)r=o[f],e=r.prefix?r.prefix+":"+i:i,("*"==i||e==r.nodeName)&&("*"==t||t==r.namespaceURI)&&u.push(r);return u},getAttributeNodeNS:function(n,t,i){var u=null;if(n.getAttributeNodeNS)u=n.getAttributeNodeNS(t,i);else for(var r,e,o=n.attributes,f=0,s=o.length;s>f;++f)if(r=o[f],r.namespaceURI==t&&(e=r.prefix?r.prefix+":"+i:i,e==r.nodeName)){u=r;break}return u},getAttributeNS:function(n,t,i){var r="",u;return n.getAttributeNS?r=n.getAttributeNS(t,i)||"":(u=this.getAttributeNodeNS(n,t,i),u&&(r=u.nodeValue)),r},getChildValue:function(n,t){var r=t||"",i;if(n)for(i=n.firstChild;i;i=i.nextSibling)switch(i.nodeType){case 3:case 4:r+=i.nodeValue}return r},concatChildValues:function(n,t){for(var u,i="",r=n.firstChild;r;)u=r.nodeValue,u&&(i+=u),r=r.nextSibling;return""==i&&void 0!=t&&(i=t),i},isSimpleContent:function(n){for(var i=!0,t=n.firstChild;t;t=t.nextSibling)if(1===t.nodeType){i=!1;break}return i},contentType:function(n){for(var t=!1,i=!1,u=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY,r=n.firstChild;r;r=r.nextSibling){switch(r.nodeType){case 1:i=!0;break;case 8:break;default:t=!0}if(i&&t)break}if(i&&t)u=OpenLayers.Format.XML.CONTENT_TYPE.MIXED;else{if(i)return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX;if(t)return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}return u},hasAttributeNS:function(n,t,i){return n.hasAttributeNS?n.hasAttributeNS(t,i):!!this.getAttributeNodeNS(n,t,i)},setAttributeNS:function(n,t,i,r){if(n.setAttributeNS)n.setAttributeNS(t,i,r);else{if(!this.xmldom)throw"setAttributeNS not implemented";if(t){var u=n.ownerDocument.createNode(2,i,t);u.nodeValue=r;n.setAttributeNode(u)}else n.setAttribute(i,r)}},createElementNSPlus:function(n,t){var i,f,r,u;return t=t||{},i=t.uri||this.namespaces[t.prefix],i||(f=n.indexOf(":"),i=this.namespaces[n.substring(0,f)]),i||(i=this.namespaces[this.defaultPrefix]),r=this.createElementNS(i,n),t.attributes&&this.setAttributes(r,t.attributes),u=t.value,null!=u&&r.appendChild(this.createTextNode(u)),r},setAttributes:function(n,t){var r,u;for(var i in t)null!=t[i]&&t[i].toString&&(r=""+t[i],u=this.namespaces[i.substring(0,i.indexOf(":"))]||null,this.setAttributeNS(n,u,i,r))},readNode:function(n,t){var i,u,r;return t||(t={}),i=this.readers[n.namespaceURI?this.namespaceAlias[n.namespaceURI]:this.defaultPrefix],i&&(u=n.localName||n.nodeName.split(":").pop(),r=i[u]||i["*"],r&&r.apply(this,[n,t])),t},readChildNodes:function(n,t){t||(t={});for(var i,u=n.childNodes,r=0,f=u.length;f>r;++r)i=u[r],1==i.nodeType&&this.readNode(i,t);return t},writeNode:function(n,t,i){var r,u,f=n.indexOf(":"),e;return f>0?(r=n.substring(0,f),u=n.substring(f+1)):(r=i?this.namespaceAlias[i.namespaceURI]:this.defaultPrefix,u=n),e=this.writers[r][u].apply(this,[t]),i&&i.appendChild(e),e},getChildEl:function(n,t,i){return n&&this.getThisOrNextEl(n.firstChild,t,i)},getNextEl:function(n,t,i){return n&&this.getThisOrNextEl(n.nextSibling,t,i)},getThisOrNextEl:function(n,t,i){n:for(var r=n;r;r=r.nextSibling)switch(r.nodeType){case 1:if(!(t&&t!==(r.localName||r.nodeName.split(":").pop())||i&&i!==r.namespaceURI))break n;r=null;break n;case 3:if(/^\s*$/.test(r.nodeValue))break;case 4:case 6:case 12:case 10:case 11:r=null;break n}return r||null},lookupNamespaceURI:function(n,t){var i=null,f,r,u;if(n)if(n.lookupNamespaceURI)i=n.lookupNamespaceURI(t);else n:switch(n.nodeType){case 1:if(null!==n.namespaceURI&&n.prefix===t){i=n.namespaceURI;break n}if(f=n.attributes.length,f)for(u=0;f>u;++u){if(r=n.attributes[u],"xmlns"===r.prefix&&r.name==="xmlns:"+t){i=r.value||null;break n}if("xmlns"===r.name&&null===t){i=r.value||null;break n}}i=this.lookupNamespaceURI(n.parentNode,t);break n;case 2:i=this.lookupNamespaceURI(n.ownerElement,t);break n;case 9:i=this.lookupNamespaceURI(n.documentElement,t);break n;case 6:case 12:case 10:case 11:break n;default:i=this.lookupNamespaceURI(n.parentNode,t)}return i},getXMLDoc:function(){return OpenLayers.Format.XML.document||this.xmldom||(document.implementation&&document.implementation.createDocument?OpenLayers.Format.XML.document=document.implementation.createDocument("","",null):!this.xmldom&&window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM"))),OpenLayers.Format.XML.document||this.xmldom},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3};OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);OpenLayers.Format.XML.document=null;OpenLayers.Format.WFST=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Format.WFST.DEFAULTS);var t=OpenLayers.Format.WFST["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFST version: "+n.version;return new t(n)};OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"};OpenLayers.Format.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs",gml:"http://www.opengis.net/gml",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:!0,xy:!0,stateName:null,initialize:function(n){this.stateName={};this.stateName[OpenLayers.State.INSERT]="wfs:Insert";this.stateName[OpenLayers.State.UPDATE]="wfs:Update";this.stateName[OpenLayers.State.DELETE]="wfs:Delete";OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},getSrsName:function(n,t){var i=t&&t.srsName;return i||(i=n&&n.layer?n.layer.projection.getCode():this.srsName),i},read:function(n,t){t=t||{};OpenLayers.Util.applyDefaults(t,{output:"features"});"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var i={};return n&&this.readNode(n,i,!0),i.features&&"features"===t.output&&(i=i.features),i},readers:{wfs:{FeatureCollection:function(n,t){t.features=[];this.readChildNodes(n,t)}}},write:function(n,t){var i=this.writeNode("wfs:Transaction",{features:n,options:t}),r=this.schemaLocationAttr();return r&&this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",r),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{wfs:{GetFeature:function(n){var i=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,handle:n&&n.handle,outputFormat:n&&n.outputFormat,maxFeatures:n&&n.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(n)}}),t,r;if("string"==typeof this.featureType)this.writeNode("Query",n,i);else for(t=0,r=this.featureType.length;r>t;t++)n.featureType=this.featureType[t],this.writeNode("Query",n,i);return i},Transaction:function(n){var e,o;n=n||{};var t,r,i=n.options||{},u=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version,handle:i.handle}}),f=n.features;if(f){for(i.multi===!0&&OpenLayers.Util.extend(this.geometryTypes,{"OpenLayers.Geometry.Point":"MultiPoint","OpenLayers.Geometry.LineString":this.multiCurve===!0?"MultiCurve":"MultiLineString","OpenLayers.Geometry.Polygon":this.multiSurface===!0?"MultiSurface":"MultiPolygon"}),t=0,r=f.length;r>t;++t)o=f[t],e=this.stateName[o.state],e&&this.writeNode(e,{feature:o,options:i},u);i.multi===!0&&this.setGeometryTypes()}if(i.nativeElements)for(t=0,r=i.nativeElements.length;r>t;++t)this.writeNode("wfs:Native",i.nativeElements[t],u);return u},Native:function(n){return this.createElementNSPlus("wfs:Native",{attributes:{vendorId:n.vendorId,safeToIgnore:n.safeToIgnore},value:n.value})},Insert:function(n){var t=n.feature,i=n.options,r=this.createElementNSPlus("wfs:Insert",{attributes:{handle:i&&i.handle}});return this.srsName=this.getSrsName(t),this.writeNode("feature:_typeName",t,r),r},Update:function(n){var t=n.feature,f=n.options,r=this.createElementNSPlus("wfs:Update",{attributes:{handle:f&&f.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}}),i,u;this.featureNS&&r.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);i=t.modified;null===this.geometryName||i&&void 0===i.geometry||(this.srsName=this.getSrsName(t),this.writeNode("Property",{name:this.geometryName,value:t.geometry},r));for(u in t.attributes)void 0===t.attributes[u]||i&&i.attributes&&(!i.attributes||void 0===i.attributes[u])||this.writeNode("Property",{name:u,value:t.attributes[u]},r);return this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[t.fid]}),r),r},Property:function(n){var t=this.createElementNSPlus("wfs:Property");return this.writeNode("Name",n.name,t),null!==n.value&&this.writeNode("Value",n.value,t),t},Name:function(n){return this.createElementNSPlus("wfs:Name",{value:n})},Value:function(n){var t,i;return n instanceof OpenLayers.Geometry?(t=this.createElementNSPlus("wfs:Value"),i=this.writeNode("feature:_geometry",n).firstChild,t.appendChild(i)):t=this.createElementNSPlus("wfs:Value",{value:n}),t},Delete:function(n){var r=n.feature,i=n.options,t=this.createElementNSPlus("wfs:Delete",{attributes:{handle:i&&i.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});return this.featureNS&&t.setAttribute("xmlns:"+this.featurePrefix,this.featureNS),this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[r.fid]}),t),t}}},schemaLocationAttr:function(n){var t,i,r,u;n=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},n);t=OpenLayers.Util.extend({},this.schemaLocations);n.schema&&(t[n.featurePrefix]=n.schema);r=[];for(u in t)i=this.namespaces[u],i&&r.push(i+" "+t[u]);return r.join(" ")||void 0},setFilterProperty:function(n){if(n.filters)for(var t=0,i=n.filters.length;i>t;++t)this.setFilterProperty(n.filters[t]);else n instanceof OpenLayers.Filter.Spatial&&(n.property=this.geometryName)},CLASS_NAME:"OpenLayers.Format.WFST.v1"});OpenLayers.Format.OGCExceptionReport=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},defaultPrefix:"ogc",read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));var i=n.documentElement,t={exceptionReport:null};return i&&(this.readChildNodes(n,t),null===t.exceptionReport&&(t=(new OpenLayers.Format.OWSCommon).read(n))),t},readers:{ogc:{ServiceExceptionReport:function(n,t){t.exceptionReport={exceptions:[]};this.readChildNodes(n,t.exceptionReport)},ServiceException:function(n,t){var i={code:n.getAttribute("code"),locator:n.getAttribute("locator"),text:this.getChildValue(n)};t.exceptions.push(i)}}},CLASS_NAME:"OpenLayers.Format.OGCExceptionReport"});OpenLayers.Format.XML.VersionedOGC=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:null,version:null,profile:null,errorProperty:null,name:null,stringifyOutput:!1,parser:null,initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]);var t=this.CLASS_NAME;this.name=t.substring(t.lastIndexOf(".")+1)},getVersion:function(n,t){var i;return n?(i=this.version,i||(i=n.getAttribute("version"),i||(i=this.defaultVersion))):i=t&&t.version||this.version||this.defaultVersion,i},getParser:function(n){var t,i;if(n=n||this.defaultVersion,t=this.profile?"_"+this.profile:"",!this.parser||this.parser.VERSION!=n){if(i=OpenLayers.Format[this.name]["v"+n.replace(/\./g,"_")+t],!i)throw"Can't find a "+this.name+" parser for version "+n+t;this.parser=new i(this.options)}return this.parser},write:function(n,t){var r=this.getVersion(null,t),i;return this.parser=this.getParser(r),i=this.parser.write(n,t),this.stringifyOutput===!1?i:OpenLayers.Format.XML.prototype.write.apply(this,[i])},read:function(n,t){var u,r,i,f;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),u=n.documentElement,r=this.getVersion(u),this.parser=this.getParser(r),i=this.parser.read(n,t),null!==this.errorProperty&&void 0===i[this.errorProperty]&&(f=new OpenLayers.Format.OGCExceptionReport,i.error=f.read(n)),i.version=r,i},CLASS_NAME:"OpenLayers.Format.XML.VersionedOGC"});OpenLayers.Style=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:!1,propertyStyles:null,initialize:function(n,t){OpenLayers.Util.extend(this,t);this.rules=[];t&&t.rules&&this.addRules(t.rules);this.setDefaultStyle(n||OpenLayers.Feature.Vector.style["default"]);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var n=0,t=this.rules.length;t>n;n++)this.rules[n].destroy(),this.rules[n]=null;this.rules=null;this.defaultStyle=null},createSymbolizer:function(n){for(var s,r,t=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),n),e=this.rules,u=[],f=!1,i=0,o=e.length;o>i;i++)r=e[i],s=r.evaluate(n),s&&(r instanceof OpenLayers.Rule&&r.elseFilter?u.push(r):(f=!0,this.applySymbolizer(r,t,n)));if(0==f&&u.length>0)for(f=!0,i=0,o=u.length;o>i;i++)this.applySymbolizer(u[i],t,n);return e.length>0&&0==f&&(t.display="none"),t.label&&"string"!=typeof t.label&&(t.label=t.label+""),t},applySymbolizer:function(n,t,i){var f=i.geometry?this.getSymbolizerPrefix(i.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0],r=n.symbolizer[f]||n.symbolizer,u;return this.defaultsPerSymbolizer===!0&&(u=this.defaultStyle,OpenLayers.Util.applyDefaults(r,{pointRadius:u.pointRadius}),(r.stroke===!0||r.graphic===!0)&&OpenLayers.Util.applyDefaults(r,{strokeWidth:u.strokeWidth,strokeColor:u.strokeColor,strokeOpacity:u.strokeOpacity,strokeDashstyle:u.strokeDashstyle,strokeLinecap:u.strokeLinecap}),(r.fill===!0||r.graphic===!0)&&OpenLayers.Util.applyDefaults(r,{fillColor:u.fillColor,fillOpacity:u.fillOpacity}),r.graphic===!0&&OpenLayers.Util.applyDefaults(r,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})),this.createLiterals(OpenLayers.Util.extend(t,r),i)},createLiterals:function(n,t){var r=OpenLayers.Util.extend({},t.attributes||t.data),i;OpenLayers.Util.extend(r,this.context);for(i in this.propertyStyles)n[i]=OpenLayers.Style.createLiteral(n[i],r,t,i);return n},findPropertyStyles:function(){var n={},e=this.defaultStyle,f;this.addPropertyStyles(n,e);for(var t,i,u=this.rules,r=0,o=u.length;o>r;r++){t=u[r].symbolizer;for(f in t){if(i=t[f],"object"!=typeof i){this.addPropertyStyles(n,t);break}this.addPropertyStyles(n,i)}}return n},addPropertyStyles:function(n,t){var i;for(var r in t)i=t[r],"string"==typeof i&&i.match(/\$\{\w+\}/)&&(n[r]=!0);return n},addRules:function(n){Array.prototype.push.apply(this.rules,n);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(n){this.defaultStyle=n;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(n){for(var i=OpenLayers.Style.SYMBOLIZER_PREFIXES,t=0,r=i.length;r>t;t++)if(-1!=n.CLASS_NAME.indexOf(i[t]))return i[t]},clone:function(){var n=OpenLayers.Util.extend({},this),t,i,r;if(this.rules)for(n.rules=[],t=0,i=this.rules.length;i>t;++t)n.rules.push(this.rules[t].clone());return n.context=this.context&&OpenLayers.Util.extend({},this.context),r=OpenLayers.Util.extend({},this.defaultStyle),new OpenLayers.Style(r,n)},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(n,t,i,r){return"string"==typeof n&&-1!=n.indexOf("${")&&(n=OpenLayers.String.format(n,t,[i,r]),n=isNaN(n)||!n?n:parseFloat(n)),n};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text","Raster"];OpenLayers.Filter=OpenLayers.Class({initialize:function(n){OpenLayers.Util.extend(this,n)},destroy:function(){},evaluate:function(){return!0},clone:function(){return null},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,type:"FID",initialize:function(n){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[n])},evaluate:function(n){for(var r,t=0,i=this.fids.length;i>t;t++)if(r=n.fid||n.id,r==this.fids[t])return!0;return!1},clone:function(){var n=new OpenLayers.Filter.FeatureId;return OpenLayers.Util.extend(n,this),n.fids=this.fids.slice(),n},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(n){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[n])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(n){var t,i;switch(this.type){case OpenLayers.Filter.Logical.AND:for(t=0,i=this.filters.length;i>t;t++)if(0==this.filters[t].evaluate(n))return!1;return!0;case OpenLayers.Filter.Logical.OR:for(t=0,i=this.filters.length;i>t;t++)if(1==this.filters[t].evaluate(n))return!0;return!1;case OpenLayers.Filter.Logical.NOT:return!this.filters[0].evaluate(n)}return void 0},clone:function(){for(var t=[],n=0,i=this.filters.length;i>n;++n)t.push(this.filters[n].clone());return new OpenLayers.Filter.Logical({type:this.type,filters:t})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:!0,lowerBoundary:null,upperBoundary:null,initialize:function(n){OpenLayers.Filter.prototype.initialize.apply(this,[n]);this.type===OpenLayers.Filter.Comparison.LIKE&&void 0===n.matchCase&&(this.matchCase=null)},evaluate:function(n){var r,i,t,u;n instanceof OpenLayers.Feature.Vector&&(n=n.attributes);i=!1;t=n[this.property];switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:r=this.value;i=this.matchCase||"string"!=typeof t||"string"!=typeof r?t==r:t.toUpperCase()==r.toUpperCase();break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:r=this.value;i=this.matchCase||"string"!=typeof t||"string"!=typeof r?t!=r:t.toUpperCase()!=r.toUpperCase();break;case OpenLayers.Filter.Comparison.LESS_THAN:i=this.value>t;break;case OpenLayers.Filter.Comparison.GREATER_THAN:i=t>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:i=this.value>=t;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:i=t>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:i=t>=this.lowerBoundary&&this.upperBoundary>=t;break;case OpenLayers.Filter.Comparison.LIKE:u=RegExp(this.value,"gi");i=u.test(t)}return i},value2regex:function(n,t,i){if("."==n)return OpenLayers.Console.error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison"),null;return n=n?n:"*",t=t?t:".",i=i?i:"!",this.value=this.value.replace(RegExp("\\"+i+"(.|$)","g"),"\\$1"),this.value=this.value.replace(RegExp("\\"+t,"g"),"."),this.value=this.value.replace(RegExp("\\"+n,"g"),".*"),this.value=this.value.replace(RegExp("\\\\.\\*","g"),"\\"+n),this.value=this.value.replace(RegExp("\\\\\\.","g"),"\\"+t),this.value},regex2value:function(){var n=this.value;return n=n.replace(/!/g,"!!"),n=n.replace(/(\\)?\\\./g,function(n,t){return t?n:"!."}),n=n.replace(/(\\)?\\\*/g,function(n,t){return t?n:"!*"}),n=n.replace(/\\\\/g,"\\"),n=n.replace(/\.\*/g,"*")},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison,this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.Filter"});OpenLayers.Filter.Function=OpenLayers.Class(OpenLayers.Filter,{name:null,params:null,initialize:function(n){OpenLayers.Filter.prototype.initialize.apply(this,[n])},CLASS_NAME:"OpenLayers.Filter.Function"});OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var t={};return this.readers.ogc.Filter.apply(this,[n,t]),t.filter},readers:{ogc:{Filter:function(n,t){var i={fids:[],filters:[]};this.readChildNodes(n,i);i.fids.length>0?t.filter=new OpenLayers.Filter.FeatureId({fids:i.fids}):i.filters.length>0&&(t.filter=i.filters[0])},FeatureId:function(n,t){var i=n.getAttribute("fid");i&&t.fids.push(i)},And:function(n,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(n,i);t.filters.push(i)},Or:function(n,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(n,i);t.filters.push(i)},Not:function(n,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(n,i);t.filters.push(i)},PropertyIsLessThan:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(n,i);t.filters.push(i)},PropertyIsGreaterThan:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(n,i);t.filters.push(i)},PropertyIsLessThanOrEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(n,i);t.filters.push(i)},PropertyIsGreaterThanOrEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(n,i);t.filters.push(i)},PropertyIsBetween:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(n,i);t.filters.push(i)},Literal:function(n,t){t.value=OpenLayers.String.numericIf(this.getChildValue(n))},PropertyName:function(n,t){t.property=this.getChildValue(n)},LowerBoundary:function(n,t){t.lowerBoundary=OpenLayers.String.numericIf(this.readOgcExpression(n))},UpperBoundary:function(n,t){t.upperBoundary=OpenLayers.String.numericIf(this.readOgcExpression(n))},Intersects:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(n,t){this.readSpatial(n,t,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(n,t){t.distance=parseInt(this.getChildValue(n));t.distanceUnits=n.getAttribute("units")},Function:function(){}}},readSpatial:function(n,t,i){var r=new OpenLayers.Filter.Spatial({type:i});this.readChildNodes(n,r);r.value=r.components[0];delete r.components;t.filters.push(r)},readOgcExpression:function(n){var i={},t;return this.readChildNodes(n,i),t=i.value,void 0===t&&(t=this.getChildValue(n)),t},writeOgcExpression:function(n,t){if(n instanceof OpenLayers.Filter.Function){var i=this.writeNode("Function",n,t);t.appendChild(i)}else this.writeNode("Literal",n,t);return t},write:function(n){return this.writers.ogc.Filter.apply(this,[n])},writeFeatureIdNodes:function(n,t){for(var i=0,r=n.fids.length;r>i;++i)this.writeNode("FeatureId",n.fids[i],t)},writers:{ogc:{Filter:function(n){var t=this.createElementNSPlus("ogc:Filter");return"FID"===n.type?this.writeFeatureIdNodes(n,t):this.writeNode(this.getFilterType(n),n,t),t},FeatureId:function(n){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:n}})},And:function(n){for(var t,i=this.createElementNSPlus("ogc:And"),r=0,u=n.filters.length;u>r;++r)t=n.filters[r],"FID"===t.type?this.writeFeatureIdNodes(t,i):this.writeNode(this.getFilterType(t),t,i);return i},Or:function(n){for(var t,i=this.createElementNSPlus("ogc:Or"),r=0,u=n.filters.length;u>r;++r)t=n.filters[r],"FID"===t.type?this.writeFeatureIdNodes(t,i):this.writeNode(this.getFilterType(t),t,i);return i},Not:function(n){var i=this.createElementNSPlus("ogc:Not"),t=n.filters[0];return"FID"===t.type?this.writeFeatureIdNodes(t,i):this.writeNode(this.getFilterType(t),t,i),i},PropertyIsLessThan:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLessThan");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsGreaterThan:function(n){var t=this.createElementNSPlus("ogc:PropertyIsGreaterThan");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsLessThanOrEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsGreaterThanOrEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsBetween:function(n){var t=this.createElementNSPlus("ogc:PropertyIsBetween");return this.writeNode("PropertyName",n,t),this.writeNode("LowerBoundary",n,t),this.writeNode("UpperBoundary",n,t),t},PropertyName:function(n){return this.createElementNSPlus("ogc:PropertyName",{value:n.property})},Literal:function(n){return this.createElementNSPlus("ogc:Literal",{value:n})},LowerBoundary:function(n){var t=this.createElementNSPlus("ogc:LowerBoundary");return this.writeOgcExpression(n.lowerBoundary,t),t},UpperBoundary:function(n){var t=this.createElementNSPlus("ogc:UpperBoundary");return this.writeNode("Literal",n.upperBoundary,t),t},INTERSECTS:function(n){return this.writeSpatial(n,"Intersects")},WITHIN:function(n){return this.writeSpatial(n,"Within")},CONTAINS:function(n){return this.writeSpatial(n,"Contains")},DWITHIN:function(n){var t=this.writeSpatial(n,"DWithin");return this.writeNode("Distance",n,t),t},Distance:function(n){return this.createElementNSPlus("ogc:Distance",{attributes:{units:n.distanceUnits},value:n.distance})},Function:function(n){for(var i=this.createElementNSPlus("ogc:Function",{attributes:{name:n.name}}),r=n.params,t=0,u=r.length;u>t;t++)this.writeOgcExpression(r[t],i);return i}}},getFilterType:function(n){var t=this.filterMap[n.type];if(!t)throw"Filter writing not supported for rule type: "+n.type;return t},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"FeatureId"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});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(n){n&&(this.bounds=n.clone())},clearBounds:function(){this.bounds=null;this.parent&&this.parent.clearBounds()},extendBounds:function(n){var t=this.getBounds();t?this.bounds.extend(n):this.setBounds(n)},getBounds:function(){return null==this.bounds&&this.calculateBounds(),this.bounds},calculateBounds:function(){},distanceTo:function(){},getVertices:function(){},atPoint:function(n,t,i){var r=!1,e=this.getBounds();if(null!=e&&null!=n){var u=null!=t?t:0,f=null!=i?i:0,o=new OpenLayers.Bounds(this.bounds.left-u,this.bounds.bottom-f,this.bounds.right+u,this.bounds.top+f);r=o.containsLonLat(n)}return r},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(n){var i=arguments.callee.format,u,t;if(i||(i=new OpenLayers.Format.WKT,arguments.callee.format=i),t=i.read(n),t instanceof OpenLayers.Feature.Vector)u=t.geometry;else if(OpenLayers.Util.isArray(t)){for(var f=t.length,e=Array(f),r=0;f>r;++r)e[r]=t[r].geometry;u=new OpenLayers.Geometry.Collection(e)}return u};OpenLayers.Geometry.segmentsIntersect=function(n,t,i){var l=i&&i.point,a=i&&i.tolerance,r=!1,d=n.x1-t.x1,g=n.y1-t.y1,v=n.x2-n.x1,y=n.y2-n.y1,nt=t.y2-t.y1,tt=t.x2-t.x1,p=nt*v-tt*y,it=tt*g-nt*d,rt=v*g-y*d,e,w,ut,b,k,ft,o,s,c,et,h,f,u;if(0==p?0==it&&0==rt&&(r=!0):(e=it/p,w=rt/p,e>=0&&1>=e&&w>=0&&1>=w&&(l?(o=n.x1+e*v,s=n.y1+e*y,r=new OpenLayers.Geometry.Point(o,s)):r=!0)),a)if(r){if(l){h=[n,t];n:for(f=0;2>f;++f)for(b=h[f],u=1;3>u;++u)if(o=b["x"+u],s=b["y"+u],ut=Math.sqrt(Math.pow(o-r.x,2)+Math.pow(s-r.y,2)),a>ut){r.x=o;r.y=s;break n}}}else{h=[n,t];n:for(f=0;2>f;++f)for(k=h[f],ft=h[(f+1)%2],u=1;3>u;++u)if(c={x:k["x"+u],y:k["y"+u]},et=OpenLayers.Geometry.distanceToSegment(c,ft),a>et.distance){r=l?new OpenLayers.Geometry.Point(c.x,c.y):!0;break n}}return r};OpenLayers.Geometry.distanceToSegment=function(n,t){var i,r,h=n.x,c=n.y,u=t.x1,f=t.y1,l=t.x2,a=t.y2,o=l-u,s=a-f,e=(o*(h-u)+s*(c-f))/(Math.pow(o,2)+Math.pow(s,2));return 0>=e?(i=u,r=f):e>=1?(i=l,r=a):(i=u+e*o,r=f+e*s),{distance:Math.sqrt(Math.pow(i-h,2)+Math.pow(r-c,2)),x:i,y:r}};OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(n,t){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(n);this.y=parseFloat(t)},clone:function(n){return null==n&&(n=new OpenLayers.Geometry.Point(this.x,this.y)),OpenLayers.Util.applyDefaults(n,this),n},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(n,t){var r,u,f,e,o,i,h=!(t&&t.edge===!1),s=h&&t&&t.details;return n instanceof OpenLayers.Geometry.Point?(u=this.x,f=this.y,e=n.x,o=n.y,r=Math.sqrt(Math.pow(u-e,2)+Math.pow(f-o,2)),i=s?{x0:u,y0:f,x1:e,y1:o,distance:r}:r):(i=n.distanceTo(this,t),s&&(i={x0:i.x1,y0:i.y1,x1:i.x0,y1:i.y0,distance:i.distance})),i},equals:function(n){var t=!1;return null!=n&&(t=this.x==n.x&&this.y==n.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(n.x)&&isNaN(n.y)),t},toShortString:function(){return this.x+", "+this.y},move:function(n,t){this.x=this.x+n;this.y=this.y+t;this.clearBounds()},rotate:function(n,t){n*=Math.PI/180;var i=this.distanceTo(t),r=n+Math.atan2(this.y-t.y,this.x-t.x);this.x=t.x+i*Math.cos(r);this.y=t.y+i*Math.sin(r);this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(n,t,i){return i=void 0==i?1:i,this.x=t.x+n*i*(this.x-t.x),this.y=t.y+n*(this.y-t.y),this.clearBounds(),this},intersects:function(n){return"OpenLayers.Geometry.Point"==n.CLASS_NAME?this.equals(n):n.intersects(this)},transform:function(n,t){return n&&t&&(OpenLayers.Projection.transform(this,n,t),this.bounds=null),this},getVertices:function(){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(n){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];null!=n&&this.addComponents(n)},destroy:function(){this.components.length=0;this.components=null;OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},clone:function(){for(var geometry=eval("new "+this.CLASS_NAME+"()"),i=0,len=this.components.length;len>i;i++)geometry.addComponent(this.components[i].clone());return OpenLayers.Util.applyDefaults(geometry,this),geometry},getComponentsString:function(){for(var t=[],n=0,i=this.components.length;i>n;n++)t.push(this.components[n].toShortString());return t.join(",")},calculateBounds:function(){var n,t,i,r;if(this.bounds=null,n=new OpenLayers.Bounds,t=this.components,t)for(i=0,r=t.length;r>i;i++)n.extend(t[i].getBounds());null!=n.left&&null!=n.bottom&&null!=n.right&&null!=n.top&&this.setBounds(n)},addComponents:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var t=0,i=n.length;i>t;t++)this.addComponent(n[t])},addComponent:function(n,t){var r=!1,i,u;return n&&(null==this.componentTypes||OpenLayers.Util.indexOf(this.componentTypes,n.CLASS_NAME)>-1)&&(null!=t&&this.components.length>t?(i=this.components.slice(0,t),u=this.components.slice(t,this.components.length),i.push(n),this.components=i.concat(u)):this.components.push(n),n.parent=this,this.clearBounds(),r=!0),r},removeComponents:function(n){var i=!1,t;for(OpenLayers.Util.isArray(n)||(n=[n]),t=n.length-1;t>=0;--t)i=this.removeComponent(n[t])||i;return i},removeComponent:function(n){return OpenLayers.Util.removeItem(this.components,n),this.clearBounds(),!0},getLength:function(){for(var t=0,n=0,i=this.components.length;i>n;n++)t+=this.components[n].getLength();return t},getArea:function(){for(var t=0,n=0,i=this.components.length;i>n;n++)t+=this.components[n].getArea();return t},getGeodesicArea:function(n){for(var i=0,t=0,r=this.components.length;r>t;t++)i+=this.components[t].getGeodesicArea(n);return i},getCentroid:function(n){var r,i,u,t;if(!n)return this.components.length&&this.components[0].getCentroid();if(r=this.components.length,!r)return!1;for(var s,f=[],h=[],e=0,o=Number.MAX_VALUE,t=0;r>t;++t)s=this.components[t],i=s.getArea(),u=s.getCentroid(!0),isNaN(i)||isNaN(u.x)||isNaN(u.y)||(f.push(i),e+=i,o=o>i&&i>0?i:o,h.push(u));if(r=f.length,0===e){for(t=0;r>t;++t)f[t]=1;e=f.length}else{for(t=0;r>t;++t)f[t]/=o;e/=o}for(var u,i,c=0,l=0,t=0;r>t;++t)u=h[t],i=f[t],c+=u.x*i,l+=u.y*i;return new OpenLayers.Geometry.Point(c/e,l/e)},getGeodesicLength:function(n){for(var i=0,t=0,r=this.components.length;r>t;t++)i+=this.components[t].getGeodesicLength(n);return i},move:function(n,t){for(var i=0,r=this.components.length;r>i;i++)this.components[i].move(n,t)},rotate:function(n,t){for(var i=0,r=this.components.length;r>i;++i)this.components[i].rotate(n,t)},resize:function(n,t,i){for(var r=0;this.components.length>r;++r)this.components[r].resize(n,t,i);return this},distanceTo:function(n,t){for(var i,e,r,o=!(t&&t.edge===!1),s=o&&t&&t.details,u=Number.POSITIVE_INFINITY,f=0,h=this.components.length;h>f&&(i=this.components[f].distanceTo(n,t),r=s?i.distance:i,!(u>r&&(u=r,e=i,0==u)));++f);return e},equals:function(n){var i=!0,t,r;if(n&&n.CLASS_NAME&&this.CLASS_NAME==n.CLASS_NAME)if(OpenLayers.Util.isArray(n.components)&&n.components.length==this.components.length){for(t=0,r=this.components.length;r>t;++t)if(!this.components[t].equals(n.components[t])){i=!1;break}}else i=!1;else i=!1;return i},transform:function(n,t){var i,r,u;if(n&&t){for(i=0,r=this.components.length;r>i;i++)u=this.components[i],u.transform(n,t);this.bounds=null}return this},intersects:function(n){for(var i=!1,t=0,r=this.components.length;r>t&&!(i=n.intersects(this.components[t]));++t);return i},getVertices:function(n){for(var i=[],t=0,r=this.components.length;r>t;++t)Array.prototype.push.apply(i,this.components[t].getVertices(n));return i},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(n,t){this.addComponent(n,t)},removePoint:function(n){this.removeComponent(n)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var t=0,n,i;if(this.components&&this.components.length>1)for(n=1,i=this.components.length;i>n;n++)t+=this.components[n-1].distanceTo(this.components[n]);return t},getGeodesicLength:function(n){var t=this,r,u,f,e,i,o;if(n&&(r=new OpenLayers.Projection("EPSG:4326"),r.equals(n)||(t=this.clone().transform(n,r))),u=0,t.components&&t.components.length>1)for(i=1,o=t.components.length;o>i;i++)f=t.components[i-1],e=t.components[i],u+=OpenLayers.Util.distVincenty({lon:f.x,lat:f.y},{lon:e.x,lat:e.y});return 1e3*u},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(){var n=this.components&&this.components.length>2;return n&&OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments),n},intersects:function(n){var e=!1,r=n.CLASS_NAME,o,s,t,v,y,h,c,i,l,a,u,p,f,w;if("OpenLayers.Geometry.LineString"==r||"OpenLayers.Geometry.LinearRing"==r||"OpenLayers.Geometry.Point"==r){s=this.getSortedSegments();o="OpenLayers.Geometry.Point"==r?[{x1:n.x,y1:n.y,x2:n.x,y2:n.y}]:n.getSortedSegments();n:for(u=0,p=s.length;p>u;++u)for(t=s[u],v=t.x1,y=t.x2,h=t.y1,c=t.y2,f=0,w=o.length;w>f&&(i=o[f],!(i.x1>y));++f)if(!(v>i.x2||(l=i.y1,a=i.y2,Math.min(l,a)>Math.max(h,c)||Math.max(l,a)<Math.min(h,c)||!OpenLayers.Geometry.segmentsIntersect(t,i)))){e=!0;break n}}else e=n.intersects(this);return e},getSortedSegments:function(){function f(n,t){return n.x1-t.x1}for(var n,t,r=this.components.length-1,u=Array(r),i=0;r>i;++i)n=this.components[i],t=this.components[i+1],u[i]=n.x<t.x?{x1:n.x,y1:n.y,x2:t.x,y2:t.y}:{x1:t.x,y1:t.y,x2:n.x,y2:n.y};return u.sort(f)},splitWithSegment:function(n,t){for(var c,l,r,u,i,a,v,w=!(t&&t.edge===!1),b=t&&t.tolerance,s=[],h=this.getVertices(),f=[],e=[],y=!1,k={point:!0,tolerance:b},p=null,o=0,d=h.length-2;d>=o;++o)if(r=h[o],f.push(r.clone()),u=h[o+1],v={x1:r.x,y1:r.y,x2:u.x,y2:u.y},i=OpenLayers.Geometry.segmentsIntersect(n,v,k),i instanceof OpenLayers.Geometry.Point&&(a=i.x===n.x1&&i.y===n.y1||i.x===n.x2&&i.y===n.y2||i.equals(r)||i.equals(u)?!0:!1,a||w)){if(i.equals(e[e.length-1])||e.push(i.clone()),0===o&&i.equals(r))continue;if(i.equals(u))continue;y=!0;i.equals(r)||f.push(i);s.push(new OpenLayers.Geometry.LineString(f));f=[i.clone()]}return(y&&(f.push(u.clone()),s.push(new OpenLayers.Geometry.LineString(f))),e.length>0)&&(c=n.x1<n.x2?1:-1,l=n.y1<n.y2?1:-1,p={lines:s,points:e.sort(function(n,t){return c*n.x-c*t.x||l*n.y-l*t.y})}),p},split:function(n,t){var w,b,r,i,p=null,a=t&&t.mutual,e,o,k,s,h,c,v,u,l,d,f,y,g;if(n instanceof OpenLayers.Geometry.LineString){for(v=this.getVertices(),u=[],r=[],l=0,d=v.length-2;d>=l;++l)for(e=v[l],o=v[l+1],k={x1:e.x,y1:e.y,x2:o.x,y2:o.y},i=i||[n],a&&u.push(e.clone()),f=0;i.length>f;++f)if(s=i[f].splitWithSegment(k,t),s&&(h=s.lines,h.length>0&&(h.unshift(f,1),Array.prototype.splice.apply(i,h),f+=h.length-2),a))for(y=0,g=s.points.length;g>y;++y)c=s.points[y],c.equals(e)||(u.push(c),r.push(new OpenLayers.Geometry.LineString(u)),u=c.equals(o)?[]:[c.clone()]);a&&r.length>0&&u.length>0&&(u.push(o.clone()),r.push(new OpenLayers.Geometry.LineString(u)))}else p=n.splitWith(this,t);return i&&i.length>1?b=!0:i=[],r&&r.length>1?w=!0:r=[],(b||w)&&(p=a?[r,i]:i),p},splitWith:function(n,t){return n.split(this,t)},getVertices:function(n){return n===!0?[this.components[0],this.components[this.components.length-1]]:n===!1?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(n,t){var r,nt=!(t&&t.edge===!1),s=nt&&t&&t.details,i={},u=Number.POSITIVE_INFINITY,e,a,l,w;if(n instanceof OpenLayers.Geometry.Point){for(var f,b=this.getSortedSegments(),k=n.x,h=n.y,e=0,a=b.length;a>e;++e)if(f=b[e],r=OpenLayers.Geometry.distanceToSegment(n,f),u>r.distance){if(u=r.distance,i=r,0===u)break}else if(f.x2>k&&(h>f.y1&&f.y2>h||f.y1>h&&h>f.y2))break;i=s?{distance:i.distance,x0:i.x,y0:i.y,x1:k,y1:h}:i.distance}else if(n instanceof OpenLayers.Geometry.LineString){var o,v,c,y,p,d=this.getSortedSegments(),g=n.getSortedSegments(),tt=g.length,it={point:!0};n:for(e=0,a=d.length;a>e;++e)for(o=d[e],y=o.x1,p=o.y1,l=0;tt>l;++l){if(v=g[l],c=OpenLayers.Geometry.segmentsIntersect(o,v,it)){u=0;i={distance:0,x0:c.x,y0:c.y,x1:c.x,y1:c.y};break n}r=OpenLayers.Geometry.distanceToSegment({x:y,y:p},v);u>r.distance&&(u=r.distance,i={distance:u,x0:y,y0:p,x1:r.x,y1:r.y})}(s||(i=i.distance),0!==u&&o)&&(r=n.distanceTo(new OpenLayers.Geometry.Point(o.x2,o.y2),t),w=s?r.distance:r,u>w&&(i=s?{distance:u,x0:r.x1,y0:r.y1,x1:r.x0,y1:r.y0}:w))}else i=n.distanceTo(this,t),s&&(i={distance:i.distance,x0:i.x1,y0:i.y1,x1:i.x0,y1:i.y0});return i},simplify:function(n){var t,o,u;if(this&&null!==this){if(t=this.getVertices(),3>t.length)return this;var s=function(n,t){return n-t},f=function(n,t,r,u){for(var s,c=0,e=0,o=t;r>o;o++)s=h(n[t],n[r],n[o]),s>c&&(c=s,e=o);c>u&&e!=t&&(i.push(e),f(n,t,e,u),f(n,e,r,u))},h=function(n,t,i){var r=Math.abs(.5*(n.x*t.y+t.x*i.y+i.x*n.y-t.x*n.y-i.x*t.y-n.x*i.y)),u=Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2));return 2*(r/u)},e=0,r=t.length-1,i=[];for(i.push(e),i.push(r);t[e].equals(t[r]);)r--,i.push(r);for(f(t,e,r,n),o=[],i.sort(s),u=0;i.length>u;u++)o.push(t[i[u]]);return new OpenLayers.Geometry.LineString(o)}return this},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(n,t){for(var o,f,y,u,s,h,e,l,a=null,v=t&&t.mutual,i=[],r=[n],c=0,p=this.components.length;p>c;++c){for(s=this.components[c],e=!1,o=0;r.length>o;++o)if(u=s.split(r[o],t)){if(v){for(h=u[0],f=0,y=h.length;y>f;++f)0===f&&i.length?i[i.length-1].addComponent(h[f]):i.push(new OpenLayers.Geometry.MultiLineString([h[f]]));e=!0;u=u[1]}if(u.length){u.unshift(o,1);Array.prototype.splice.apply(r,u);break}}e||(i.length?i[i.length-1].addComponent(s.clone()):i=[new OpenLayers.Geometry.MultiLineString(s.clone())])}return i&&i.length>1?e=!0:i=[],r&&r.length>1?l=!0:r=[],(e||l)&&(a=v?[i,r]:r),a},splitWith:function(n,t){var r,o,s,a,h,u,i,l=null,v=t&&t.mutual,c,y,f,e,p;if(n instanceof OpenLayers.Geometry.LineString)for(i=[],u=[n],c=0,y=this.components.length;y>c;++c){for(h=!1,o=this.components[c],f=0;u.length>f;++f)if(r=u[f].split(o,t)){for(v&&(s=r[0],s.length&&(s.unshift(f,1),Array.prototype.splice.apply(u,s),f+=s.length-2),r=r[1],0===r.length&&(r=[o.clone()])),e=0,p=r.length;p>e;++e)0===e&&i.length?i[i.length-1].addComponent(r[e]):i.push(new OpenLayers.Geometry.MultiLineString([r[e]]));h=!0}h||(i.length?i[i.length-1].addComponent(o.clone()):i=[new OpenLayers.Geometry.MultiLineString([o.clone()])])}else l=n.split(this);return u&&u.length>1?a=!0:u=[],i&&i.length>1?h=!0:i=[],(a||h)&&(l=v?[u,i]:i),l},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(n,t){var i=!1,u=this.components.pop(),r;return null==t&&n.equals(u)||(i=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)),r=this.components[0],OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[r]),i},removeComponent:function(){var n=this.components&&this.components.length>3,t;return n&&(this.components.pop(),OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments),t=this.components[0],OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[t])),n},move:function(n,t){for(var i=0,r=this.components.length;r-1>i;i++)this.components[i].move(n,t)},rotate:function(n,t){for(var i=0,r=this.components.length;r-1>i;++i)this.components[i].rotate(n,t)},resize:function(n,t,i){for(var r=0,u=this.components.length;u-1>r;++r)this.components[r].resize(n,t,i);return this},transform:function(n,t){var i,r,u;if(n&&t){for(i=0,r=this.components.length;r-1>i;i++)u=this.components[i],u.transform(n,t);this.bounds=null}return this},getCentroid:function(){var n,t;if(this.components&&this.components.length>2){for(var r=0,u=0,i=0;this.components.length-1>i;i++)n=this.components[i],t=this.components[i+1],r+=(n.x+t.x)*(n.x*t.y-t.x*n.y),u+=(n.y+t.y)*(n.x*t.y-t.x*n.y);var f=-1*this.getArea(),e=r/(6*f),o=u/(6*f);return new OpenLayers.Geometry.Point(e,o)}return null},getArea:function(){var r=0,t,i;if(this.components&&this.components.length>2){for(var u=0,n=0,f=this.components.length;f-1>n;n++)t=this.components[n],i=this.components[n+1],u+=(t.x+i.x)*(i.y-t.y);r=-u/2}return r},getGeodesicArea:function(n){var t=this,u,i,f,e,o,r;if(n&&(u=new OpenLayers.Projection("EPSG:4326"),u.equals(n)||(t=this.clone().transform(n,u))),i=0,f=t.components&&t.components.length,f>2){for(r=0;f-1>r;r++)e=t.components[r],o=t.components[r+1],i+=OpenLayers.Util.rad(o.x-e.x)*(2+Math.sin(OpenLayers.Util.rad(e.y))+Math.sin(OpenLayers.Util.rad(o.y)));i=40680631590769*i/2}return i},containsPoint:function(n){function y(n,t,i,r,u){return((t-r)*n+(r*i-t*u))/(i-u)}for(var a,v,u,t,f,i,h,e=OpenLayers.Number.limitSigDigs,o=14,s=e(n.x,o),r=e(n.y,o),p=this.components.length-1,c=0,l=0;p>l;++l)if(a=this.components[l],u=e(a.x,o),t=e(a.y,o),v=this.components[l+1],f=e(v.x,o),i=e(v.y,o),t!=i){if(h=e(y(r,u,t,f,i),o),h==s&&(i>t&&r>=t&&i>=r||t>i&&t>=r&&r>=i)){c=-1;break}s>=h||u!=f&&(Math.min(u,f)>h||h>Math.max(u,f))||(i>t&&r>=t&&i>r||t>i&&t>r&&r>=i)&&++c}else if(r==t&&(f>=u&&s>=u&&f>=s||u>=f&&u>=s&&s>=f)){c=-1;break}return-1==c?1:!!(1&c)},intersects:function(n){var t=!1,i,r;if("OpenLayers.Geometry.Point"==n.CLASS_NAME)t=this.containsPoint(n);else if("OpenLayers.Geometry.LineString"==n.CLASS_NAME)t=n.intersects(this);else if("OpenLayers.Geometry.LinearRing"==n.CLASS_NAME)t=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[n]);else for(i=0,r=n.components.length;r>i&&!(t=n.components[i].intersects(this));++i);return t},getVertices:function(n){return n===!0?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var t=0,n,i;if(this.components&&this.components.length>0)for(t+=Math.abs(this.components[0].getArea()),n=1,i=this.components.length;i>n;n++)t-=Math.abs(this.components[n].getArea());return t},getGeodesicArea:function(n){var i=0,t,r;if(this.components&&this.components.length>0)for(i+=Math.abs(this.components[0].getGeodesicArea(n)),t=1,r=this.components.length;r>t;t++)i-=Math.abs(this.components[t].getGeodesicArea(n));return i},containsPoint:function(n){var r=this.components.length,t=!1,u,i;if(r>0&&(t=this.components[0].containsPoint(n),1!==t&&t&&r>1))for(i=1;r>i;++i)if(u=this.components[i].containsPoint(n)){t=1===u?1:!1;break}return t},intersects:function(n){var t,i,r=!1,u;if("OpenLayers.Geometry.Point"==n.CLASS_NAME)r=this.containsPoint(n);else if("OpenLayers.Geometry.LineString"==n.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==n.CLASS_NAME){for(t=0,i=this.components.length;i>t&&!(r=n.intersects(this.components[t]));++t);if(!r)for(t=0,i=n.components.length;i>t&&!(r=this.containsPoint(n.components[t]));++t);}else for(t=0,i=n.components.length;i>t&&!(r=this.intersects(n.components[t]));++t);if(!r&&"OpenLayers.Geometry.Polygon"==n.CLASS_NAME)for(u=this.components[0],t=0,i=u.components.length;i>t&&!(r=n.containsPoint(u.components[t]));++t);return r},distanceTo:function(n,t){var i=!(t&&t.edge===!1);return!i&&this.intersects(n)?0:OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[n,t])},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(n,t,i,r){var o=Math.PI*(1/i-.5),f,s,h,e,u,c;for(r&&(o+=r/180*Math.PI),e=[],u=0;i>u;++u)f=o+2*u*Math.PI/i,s=n.x+t*Math.cos(f),h=n.y+t*Math.sin(f),e.push(new OpenLayers.Geometry.Point(s,h));return c=new OpenLayers.Geometry.LinearRing(e),new OpenLayers.Geometry.Polygon([c])};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.umn.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"features",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.opengis.net/gml",extractAttributes:!0,xy:!0,initialize:function(n){this.regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g};OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var i;"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));for(var r=this.getElementsByTagNameNS(n.documentElement,this.gmlns,this.featureName),u=[],t=0;r.length>t;t++)i=this.parseFeature(r[t]),i&&u.push(i);return u},parseFeature:function(n){for(var u,e,f,o,c,h,y,r,p,i,s=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],t=0;s.length>t;++t)if(u=s[t],e=this.getElementsByTagNameNS(n,this.gmlns,u),e.length>0){o=this.parseGeometry[u.toLowerCase()];o?(f=o.apply(this,[e[0]]),this.internalProjection&&this.externalProjection&&f.transform(this.externalProjection,this.internalProjection)):OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:u}));break}for(h=this.getElementsByTagNameNS(n,this.gmlns,"Box"),t=0;h.length>t;++t){var l=h[t],a=this.parseGeometry.box.apply(this,[l]),v=l.parentNode,w=v.localName||v.nodeName.split(":").pop();"boundedBy"===w?c=a:f=a.toGeometry()}for(this.extractAttributes&&(y=this.parseAttributes(n)),r=new OpenLayers.Feature.Vector(f,y),r.bounds=c,r.gml={featureType:n.firstChild.nodeName.split(":")[1],featureNS:n.firstChild.namespaceURI,featureNSPrefix:n.firstChild.prefix},i=n.firstChild;i&&(1!=i.nodeType||!(p=i.getAttribute("fid")||i.getAttribute("id")));)i=i.nextSibling;return r.fid=p,r},parseGeometry:{point:function(n){var r,t=[],i=this.getElementsByTagNameNS(n,this.gmlns,"pos"),u,f;return(i.length>0&&(r=i[0].firstChild.nodeValue,r=r.replace(this.regExes.trimSpace,""),t=r.split(this.regExes.splitSpace)),0==t.length&&(i=this.getElementsByTagNameNS(n,this.gmlns,"coordinates"),i.length>0&&(r=i[0].firstChild.nodeValue,r=r.replace(this.regExes.removeSpace,""),t=r.split(","))),0==t.length&&(i=this.getElementsByTagNameNS(n,this.gmlns,"coord"),i.length>0))&&(u=this.getElementsByTagNameNS(i[0],this.gmlns,"X"),f=this.getElementsByTagNameNS(i[0],this.gmlns,"Y"),u.length>0&&f.length>0&&(t=[u[0].firstChild.nodeValue,f[0].firstChild.nodeValue])),2==t.length&&(t[2]=null),this.xy?new OpenLayers.Geometry.Point(t[0],t[1],t[2]):new OpenLayers.Geometry.Point(t[1],t[0],t[2])},multipoint:function(n){var i=this.getElementsByTagNameNS(n,this.gmlns,"Point"),u=[],r,t;if(i.length>0)for(t=0;i.length>t;++t)r=this.parseGeometry.point.apply(this,[i[t]]),r&&u.push(r);return new OpenLayers.Geometry.MultiPoint(u)},linestring:function(n,t){var f,r,i=[],e=[],o,h,c,l,s,a,u,v;if(f=this.getElementsByTagNameNS(n,this.gmlns,"posList"),f.length>0)for(r=this.getChildValue(f[0]),r=r.replace(this.regExes.trimSpace,""),i=r.split(this.regExes.splitSpace),s=parseInt(f[0].getAttribute("dimension")),u=0;i.length/s>u;++u)o=u*s,h=i[o],c=i[o+1],l=2==s?null:i[o+2],this.xy?e.push(new OpenLayers.Geometry.Point(h,c,l)):e.push(new OpenLayers.Geometry.Point(c,h,l));if(0==i.length&&(f=this.getElementsByTagNameNS(n,this.gmlns,"coordinates"),f.length>0))for(r=this.getChildValue(f[0]),r=r.replace(this.regExes.trimSpace,""),r=r.replace(this.regExes.trimComma,","),a=r.split(this.regExes.splitSpace),u=0;a.length>u;++u)i=a[u].split(","),2==i.length&&(i[2]=null),this.xy?e.push(new OpenLayers.Geometry.Point(i[0],i[1],i[2])):e.push(new OpenLayers.Geometry.Point(i[1],i[0],i[2]));return v=null,0!=e.length&&(v=t?new OpenLayers.Geometry.LinearRing(e):new OpenLayers.Geometry.LineString(e)),v},multilinestring:function(n){var i=this.getElementsByTagNameNS(n,this.gmlns,"LineString"),u=[],r,t;if(i.length>0)for(t=0;i.length>t;++t)r=this.parseGeometry.linestring.apply(this,[i[t]]),r&&u.push(r);return new OpenLayers.Geometry.MultiLineString(u)},polygon:function(n){var i=this.getElementsByTagNameNS(n,this.gmlns,"LinearRing"),u=[],r,t;if(i.length>0)for(t=0;i.length>t;++t)r=this.parseGeometry.linestring.apply(this,[i[t],!0]),r&&u.push(r);return new OpenLayers.Geometry.Polygon(u)},multipolygon:function(n){var i=this.getElementsByTagNameNS(n,this.gmlns,"Polygon"),u=[],r,t;if(i.length>0)for(t=0;i.length>t;++t)r=this.parseGeometry.polygon.apply(this,[i[t]]),r&&u.push(r);return new OpenLayers.Geometry.MultiPolygon(u)},envelope:function(n){var i,s,u=[],o=this.getElementsByTagNameNS(n,this.gmlns,"lowerCorner"),r,e,t,f,h;return o.length>0&&(t=[],r=(o.length>0&&(i=o[0].firstChild.nodeValue,i=i.replace(this.regExes.trimSpace,""),t=i.split(this.regExes.splitSpace)),2==t.length&&(t[2]=null),this.xy)?new OpenLayers.Geometry.Point(t[0],t[1],t[2]):new OpenLayers.Geometry.Point(t[1],t[0],t[2])),e=this.getElementsByTagNameNS(n,this.gmlns,"upperCorner"),e.length>0&&(t=[],f=(e.length>0&&(i=e[0].firstChild.nodeValue,i=i.replace(this.regExes.trimSpace,""),t=i.split(this.regExes.splitSpace)),2==t.length&&(t[2]=null),this.xy)?new OpenLayers.Geometry.Point(t[0],t[1],t[2]):new OpenLayers.Geometry.Point(t[1],t[0],t[2])),r&&f&&(u.push(new OpenLayers.Geometry.Point(r.x,r.y)),u.push(new OpenLayers.Geometry.Point(f.x,r.y)),u.push(new OpenLayers.Geometry.Point(f.x,f.y)),u.push(new OpenLayers.Geometry.Point(r.x,f.y)),u.push(new OpenLayers.Geometry.Point(r.x,r.y)),h=new OpenLayers.Geometry.LinearRing(u),s=new OpenLayers.Geometry.Polygon([h])),s},box:function(n){var u,t,f=this.getElementsByTagNameNS(n,this.gmlns,"coordinates"),i=null,r=null;return f.length>0&&(u=f[0].firstChild.nodeValue,t=u.split(" "),2==t.length&&(i=t[0].split(","),r=t[1].split(","))),null!==i&&null!==r?new OpenLayers.Bounds(parseFloat(i[0]),parseFloat(i[1]),parseFloat(r[0]),parseFloat(r[1])):void 0}},parseAttributes:function(n){for(var f,r,t,e,u,s,h,o={},i=n.firstChild;i;){if(1==i.nodeType){for(f=i.childNodes,r=0;f.length>r;++r)t=f[r],1==t.nodeType&&(e=t.childNodes,1==e.length?(u=e[0],(3==u.nodeType||4==u.nodeType)&&(s=t.prefix?t.nodeName.split(":")[1]:t.nodeName,h=u.nodeValue.replace(this.regExes.trimSpace,""),o[s]=h)):o[t.nodeName.split(":").pop()]=null);break}i=i.nextSibling}return o},write:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var i=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName),t=0;n.length>t;t++)i.appendChild(this.createFeatureXML(n[t]));return OpenLayers.Format.XML.prototype.write.apply(this,[i])},createFeatureXML:function(n){var e=n.geometry,o=this.buildGeometryNode(e),r=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName),i;r.appendChild(o);var u=this.createElementNS(this.gmlns,"gml:"+this.featureName),t=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName),s=n.fid||n.id;t.setAttribute("fid",s);t.appendChild(r);for(i in n.attributes){var h=this.createTextNode(n.attributes[i]),c=i.substring(i.lastIndexOf(":")+1),f=this.createElementNS(this.featureNS,this.featurePrefix+":"+c);f.appendChild(h);t.appendChild(f)}return u.appendChild(t),u},buildGeometryNode:function(n){this.externalProjection&&this.internalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection));var t=n.CLASS_NAME,i=t.substring(t.lastIndexOf(".")+1),r=this.buildGeometry[i.toLowerCase()];return r.apply(this,[n])},buildGeometry:{point:function(n){var t=this.createElementNS(this.gmlns,"gml:Point");return t.appendChild(this.buildCoordinatesNode(n)),t},multipoint:function(n){for(var t,r,u=this.createElementNS(this.gmlns,"gml:MultiPoint"),f=n.components,i=0;f.length>i;i++)t=this.createElementNS(this.gmlns,"gml:pointMember"),r=this.buildGeometry.point.apply(this,[f[i]]),t.appendChild(r),u.appendChild(t);return u},linestring:function(n){var t=this.createElementNS(this.gmlns,"gml:LineString");return t.appendChild(this.buildCoordinatesNode(n)),t},multilinestring:function(n){for(var t,r,u=this.createElementNS(this.gmlns,"gml:MultiLineString"),f=n.components,i=0;f.length>i;++i)t=this.createElementNS(this.gmlns,"gml:lineStringMember"),r=this.buildGeometry.linestring.apply(this,[f[i]]),t.appendChild(r),u.appendChild(t);return u},linearring:function(n){var t=this.createElementNS(this.gmlns,"gml:LinearRing");return t.appendChild(this.buildCoordinatesNode(n)),t},polygon:function(n){for(var i,r,u,f=this.createElementNS(this.gmlns,"gml:Polygon"),e=n.components,t=0;e.length>t;++t)u=0==t?"outerBoundaryIs":"innerBoundaryIs",i=this.createElementNS(this.gmlns,"gml:"+u),r=this.buildGeometry.linearring.apply(this,[e[t]]),i.appendChild(r),f.appendChild(i);return f},multipolygon:function(n){for(var t,r,u=this.createElementNS(this.gmlns,"gml:MultiPolygon"),f=n.components,i=0;f.length>i;++i)t=this.createElementNS(this.gmlns,"gml:polygonMember"),r=this.buildGeometry.polygon.apply(this,[f[i]]),t.appendChild(r),u.appendChild(t);return u},bounds:function(n){var t=this.createElementNS(this.gmlns,"gml:Box");return t.appendChild(this.buildCoordinatesNode(n)),t}},buildCoordinatesNode:function(n){var t=this.createElementNS(this.gmlns,"gml:coordinates"),i,u,r,f;if(t.setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," "),i=[],n instanceof OpenLayers.Bounds)i.push(n.left+","+n.bottom),i.push(n.right+","+n.top);else for(u=n.components?n.components:[n],r=0;u.length>r;r++)i.push(u[r].x+","+u[r].y);return f=this.createTextNode(i.join(" ")),t.appendChild(f),t},CLASS_NAME:"OpenLayers.Format.GML"});OpenLayers.Format.GML||(OpenLayers.Format.GML={});OpenLayers.Format.GML.Base=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs"},defaultPrefix:"gml",schemaLocation:null,featureType:null,featureNS:null,geometryName:"geometry",extractAttributes:!0,srsName:null,xy:!0,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,featureMember:/^(.*:)?featureMembers?$/},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]);this.setGeometryTypes();n&&n.featureNS&&this.setNamespace("feature",n.featureNS);this.singleFeatureType=!n||"string"==typeof n.featureType},read:function(n){var i,r,u,t;if("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement),i=[],this.readNode(n,{features:i},!0),0==i.length)if(t=this.getElementsByTagNameNS(n,this.namespaces.gml,"featureMember"),t.length)for(r=0,u=t.length;u>r;++r)this.readNode(t[r],{features:i},!0);else t=this.getElementsByTagNameNS(n,this.namespaces.gml,"featureMembers"),t.length&&this.readNode(t[0],{features:i},!0);return i},readNode:function(n,t,i){return i===!0&&this.autoConfig===!0&&(this.featureType=null,delete this.namespaceAlias[this.featureNS],delete this.namespaces.feature,this.featureNS=null),this.featureNS||n.prefix in this.namespaces||n.parentNode.namespaceURI!=this.namespaces.gml||!this.regExes.featureMember.test(n.parentNode.nodeName)||(this.featureType=n.nodeName.split(":").pop(),this.setNamespace("feature",n.namespaceURI),this.featureNS=n.namespaceURI,this.autoConfig=!0),OpenLayers.Format.XML.prototype.readNode.apply(this,[n,t])},readers:{gml:{featureMember:function(n,t){this.readChildNodes(n,t)},featureMembers:function(n,t){this.readChildNodes(n,t)},name:function(n,t){t.name=this.getChildValue(n)},boundedBy:function(n,t){var i={};this.readChildNodes(n,i);i.components&&i.components.length>0&&(t.bounds=i.components[0])},Point:function(n,t){var i={points:[]};this.readChildNodes(n,i);t.components||(t.components=[]);t.components.push(i.points[0])},coordinates:function(n,t){var u=this.getChildValue(n).replace(this.regExes.trimSpace,"");u=u.replace(this.regExes.trimComma,",");for(var i,f=u.split(this.regExes.splitSpace),e=f.length,o=Array(e),r=0;e>r;++r)i=f[r].split(","),o[r]=this.xy?new OpenLayers.Geometry.Point(i[0],i[1],i[2]):new OpenLayers.Geometry.Point(i[1],i[0],i[2]);t.points=o},coord:function(n,t){var i={};this.readChildNodes(n,i);t.points||(t.points=[]);t.points.push(new OpenLayers.Geometry.Point(i.x,i.y,i.z))},X:function(n,t){t.x=this.getChildValue(n)},Y:function(n,t){t.y=this.getChildValue(n)},Z:function(n,t){t.z=this.getChildValue(n)},MultiPoint:function(n,t){var i={components:[]};this.readChildNodes(n,i);t.components=[new OpenLayers.Geometry.MultiPoint(i.components)]},pointMember:function(n,t){this.readChildNodes(n,t)},LineString:function(n,t){var i={};this.readChildNodes(n,i);t.components||(t.components=[]);t.components.push(new OpenLayers.Geometry.LineString(i.points))},MultiLineString:function(n,t){var i={components:[]};this.readChildNodes(n,i);t.components=[new OpenLayers.Geometry.MultiLineString(i.components)]},lineStringMember:function(n,t){this.readChildNodes(n,t)},Polygon:function(n,t){var i={outer:null,inner:[]};this.readChildNodes(n,i);i.inner.unshift(i.outer);t.components||(t.components=[]);t.components.push(new OpenLayers.Geometry.Polygon(i.inner))},LinearRing:function(n,t){var i={};this.readChildNodes(n,i);t.components=[new OpenLayers.Geometry.LinearRing(i.points)]},MultiPolygon:function(n,t){var i={components:[]};this.readChildNodes(n,i);t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)]},polygonMember:function(n,t){this.readChildNodes(n,t)},GeometryCollection:function(n,t){var i={components:[]};this.readChildNodes(n,i);t.components=[new OpenLayers.Geometry.Collection(i.components)]},geometryMember:function(n,t){this.readChildNodes(n,t)}},feature:{"*":function(n,t){var i,r=n.localName||n.nodeName.split(":").pop();t.features?this.singleFeatureType||-1===OpenLayers.Util.indexOf(this.featureType,r)?r===this.featureType&&(i="_typeName"):i="_typeName":0==n.childNodes.length||1==n.childNodes.length&&3==n.firstChild.nodeType?this.extractAttributes&&(i="_attribute"):i="_geometry";i&&this.readers.feature[i].apply(this,[n,t])},_typeName:function(n,t){var i={components:[],attributes:{}},r,u;this.readChildNodes(n,i);i.name&&(i.attributes.name=i.name);r=new OpenLayers.Feature.Vector(i.components[0],i.attributes);this.singleFeatureType||(r.type=n.nodeName.split(":").pop(),r.namespace=n.namespaceURI);u=n.getAttribute("fid")||this.getAttributeNS(n,this.namespaces.gml,"id");u&&(r.fid=u);this.internalProjection&&this.externalProjection&&r.geometry&&r.geometry.transform(this.externalProjection,this.internalProjection);i.bounds&&(r.bounds=i.bounds);t.features.push(r)},_geometry:function(n,t){this.geometryName||(this.geometryName=n.nodeName.split(":").pop());this.readChildNodes(n,t)},_attribute:function(n,t){var i=n.localName||n.nodeName.split(":").pop(),r=this.getChildValue(n);t.attributes[i]=r}},wfs:{FeatureCollection:function(n,t){this.readChildNodes(n,t)}}},write:function(n){var i,t;return i=OpenLayers.Util.isArray(n)?"featureMembers":"featureMember",t=this.writeNode("gml:"+i,n),this.setAttributeNS(t,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{gml:{featureMember:function(n){var t=this.createElementNSPlus("gml:featureMember");return this.writeNode("feature:_typeName",n,t),t},MultiPoint:function(n){for(var i=this.createElementNSPlus("gml:MultiPoint"),r=n.components||[n],t=0,u=r.length;u>t;++t)this.writeNode("pointMember",r[t],i);return i},pointMember:function(n){var t=this.createElementNSPlus("gml:pointMember");return this.writeNode("Point",n,t),t},MultiLineString:function(n){for(var i=this.createElementNSPlus("gml:MultiLineString"),r=n.components||[n],t=0,u=r.length;u>t;++t)this.writeNode("lineStringMember",r[t],i);return i},lineStringMember:function(n){var t=this.createElementNSPlus("gml:lineStringMember");return this.writeNode("LineString",n,t),t},MultiPolygon:function(n){for(var i=this.createElementNSPlus("gml:MultiPolygon"),r=n.components||[n],t=0,u=r.length;u>t;++t)this.writeNode("polygonMember",r[t],i);return i},polygonMember:function(n){var t=this.createElementNSPlus("gml:polygonMember");return this.writeNode("Polygon",n,t),t},GeometryCollection:function(n){for(var i=this.createElementNSPlus("gml:GeometryCollection"),t=0,r=n.components.length;r>t;++t)this.writeNode("geometryMember",n.components[t],i);return i},geometryMember:function(n){var t=this.createElementNSPlus("gml:geometryMember"),i=this.writeNode("feature:_geometry",n);return t.appendChild(i.firstChild),t}},feature:{_typeName:function(n){var t=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:n.fid}}),i,r;n.geometry&&this.writeNode("feature:_geometry",n.geometry,t);for(i in n.attributes)r=n.attributes[i],null!=r&&this.writeNode("feature:_attribute",{name:i,value:r},t);return t},_geometry:function(n){this.externalProjection&&this.internalProjection&&(n=n.clone().transform(this.internalProjection,this.externalProjection));var t=this.createElementNSPlus("feature:"+this.geometryName),i=this.geometryTypes[n.CLASS_NAME],r=this.writeNode("gml:"+i,n,t);return this.srsName&&r.setAttribute("srsName",this.srsName),t},_attribute:function(n){return this.createElementNSPlus("feature:"+n.name,{value:n.value})}},wfs:{FeatureCollection:function(n){for(var i=this.createElementNSPlus("wfs:FeatureCollection"),t=0,r=n.length;r>t;++t)this.writeNode("gml:featureMember",n[t],i);return i}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"});OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:!1,multiCurve:!0,surface:!1,multiSurface:!0,initialize:function(n){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[n])},readers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(n,t){this.readChildNodes(n,t)},Curve:function(n,t){var i={points:[]};this.readChildNodes(n,i);t.components||(t.components=[]);t.components.push(new OpenLayers.Geometry.LineString(i.points))},segments:function(n,t){this.readChildNodes(n,t)},LineStringSegment:function(n,t){var i={};this.readChildNodes(n,i);i.points&&Array.prototype.push.apply(t.points,i.points)},pos:function(n,t){var r,u=this.getChildValue(n).replace(this.regExes.trimSpace,""),i=u.split(this.regExes.splitSpace);r=this.xy?new OpenLayers.Geometry.Point(i[0],i[1],i[2]):new OpenLayers.Geometry.Point(i[1],i[0],i[2]);t.points=[r]},posList:function(n,t){for(var f,e,o,h=this.getChildValue(n).replace(this.regExes.trimSpace,""),r=h.split(this.regExes.splitSpace),u=parseInt(n.getAttribute("dimension"))||2,c=r.length/u,s=Array(c),i=0,l=r.length;l>i;i+=u)f=r[i],e=r[i+1],o=2==u?void 0:r[i+2],s[i/u]=this.xy?new OpenLayers.Geometry.Point(f,e,o):new OpenLayers.Geometry.Point(e,f,o);t.points=s},Surface:function(n,t){this.readChildNodes(n,t)},patches:function(n,t){this.readChildNodes(n,t)},PolygonPatch:function(n,t){this.readers.gml.Polygon.apply(this,[n,t])},exterior:function(n,t){var i={};this.readChildNodes(n,i);t.outer=i.components[0]},interior:function(n,t){var i={};this.readChildNodes(n,i);t.inner.push(i.components[0])},MultiCurve:function(n,t){var i={components:[]};this.readChildNodes(n,i);i.components.length>0&&(t.components=[new OpenLayers.Geometry.MultiLineString(i.components)])},curveMember:function(n,t){this.readChildNodes(n,t)},MultiSurface:function(n,t){var i={components:[]};this.readChildNodes(n,i);i.components.length>0&&(t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)])},surfaceMember:function(n,t){this.readChildNodes(n,t)},surfaceMembers:function(n,t){this.readChildNodes(n,t)},pointMembers:function(n,t){this.readChildNodes(n,t)},lineStringMembers:function(n,t){this.readChildNodes(n,t)},polygonMembers:function(n,t){this.readChildNodes(n,t)},geometryMembers:function(n,t){this.readChildNodes(n,t)},Envelope:function(n,t){var i={points:Array(2)},r,u;this.readChildNodes(n,i);t.components||(t.components=[]);r=i.points[0];u=i.points[1];t.components.push(new OpenLayers.Bounds(r.x,r.y,u.x,u.y))},lowerCorner:function(n,t){var i={};this.readers.gml.pos.apply(this,[n,i]);t.points[0]=i.points[0]},upperCorner:function(n,t){var i={};this.readers.gml.pos.apply(this,[n,i]);t.points[1]=i.points[0]}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(n){var i,t;return i=OpenLayers.Util.isArray(n)?"featureMembers":"featureMember",t=this.writeNode("gml:"+i,n),this.setAttributeNS(t,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(n){for(var i=this.createElementNSPlus("gml:featureMembers"),t=0,r=n.length;r>t;++t)this.writeNode("feature:_typeName",n[t],i);return i},Point:function(n){var t=this.createElementNSPlus("gml:Point");return this.writeNode("pos",n,t),t},pos:function(n){var t=this.xy?n.x+" "+n.y:n.y+" "+n.x;return this.createElementNSPlus("gml:pos",{value:t})},LineString:function(n){var t=this.createElementNSPlus("gml:LineString");return this.writeNode("posList",n.components,t),t},Curve:function(n){var t=this.createElementNSPlus("gml:Curve");return this.writeNode("segments",n,t),t},segments:function(n){var t=this.createElementNSPlus("gml:segments");return this.writeNode("LineStringSegment",n,t),t},LineStringSegment:function(n){var t=this.createElementNSPlus("gml:LineStringSegment");return this.writeNode("posList",n.components,t),t},posList:function(n){for(var t,r=n.length,u=Array(r),i=0;r>i;++i)t=n[i],u[i]=this.xy?t.x+" "+t.y:t.y+" "+t.x;return this.createElementNSPlus("gml:posList",{value:u.join(" ")})},Surface:function(n){var t=this.createElementNSPlus("gml:Surface");return this.writeNode("patches",n,t),t},patches:function(n){var t=this.createElementNSPlus("gml:patches");return this.writeNode("PolygonPatch",n,t),t},PolygonPatch:function(n){var i=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}}),t,r;for(this.writeNode("exterior",n.components[0],i),t=1,r=n.components.length;r>t;++t)this.writeNode("interior",n.components[t],i);return i},Polygon:function(n){var i=this.createElementNSPlus("gml:Polygon"),t,r;for(this.writeNode("exterior",n.components[0],i),t=1,r=n.components.length;r>t;++t)this.writeNode("interior",n.components[t],i);return i},exterior:function(n){var t=this.createElementNSPlus("gml:exterior");return this.writeNode("LinearRing",n,t),t},interior:function(n){var t=this.createElementNSPlus("gml:interior");return this.writeNode("LinearRing",n,t),t},LinearRing:function(n){var t=this.createElementNSPlus("gml:LinearRing");return this.writeNode("posList",n.components,t),t},MultiCurve:function(n){for(var i=this.createElementNSPlus("gml:MultiCurve"),r=n.components||[n],t=0,u=r.length;u>t;++t)this.writeNode("curveMember",r[t],i);return i},curveMember:function(n){var t=this.createElementNSPlus("gml:curveMember");return this.curve?this.writeNode("Curve",n,t):this.writeNode("LineString",n,t),t},MultiSurface:function(n){for(var i=this.createElementNSPlus("gml:MultiSurface"),r=n.components||[n],t=0,u=r.length;u>t;++t)this.writeNode("surfaceMember",r[t],i);return i},surfaceMember:function(n){var t=this.createElementNSPlus("gml:surfaceMember");return this.surface?this.writeNode("Surface",n,t):this.writeNode("Polygon",n,t),t},Envelope:function(n){var t=this.createElementNSPlus("gml:Envelope");return this.writeNode("lowerCorner",n,t),this.writeNode("upperCorner",n,t),this.srsName&&t.setAttribute("srsName",this.srsName),t},lowerCorner:function(n){var t=this.xy?n.left+" "+n.bottom:n.bottom+" "+n.left;return this.createElementNSPlus("gml:lowerCorner",{value:t})},upperCorner:function(n){var t=this.xy?n.right+" "+n.top:n.top+" "+n.right;return this.createElementNSPlus("gml:upperCorner",{value:t})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":this.curve===!0?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":this.multiCurve===!1?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":this.surface===!0?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":this.multiSurface===!1?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"});OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(n){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[n])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(n,t){var i=n.getAttribute("matchCase"),r=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(n,r);t.filters.push(r)},PropertyIsNotEqualTo:function(n,t){var i=n.getAttribute("matchCase"),r=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(n,r);t.filters.push(r)},PropertyIsLike:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(n,i);var r=n.getAttribute("wildCard"),u=n.getAttribute("singleChar"),f=n.getAttribute("escapeChar");i.value2regex(r,u,f);t.filters.push(i)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:n.matchCase}});return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsNotEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:n.matchCase}});return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsLike:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{matchCase:n.matchCase,wildCard:"*",singleChar:".",escapeChar:"!"}});return this.writeNode("PropertyName",n,t),this.writeNode("Literal",n.regex2value(),t),t},BBOX:function(n){var t=this.createElementNSPlus("ogc:BBOX"),i;return n.property&&this.writeNode("PropertyName",n,t),i=this.writeNode("gml:Envelope",n.value),n.projection&&i.setAttribute("srsName",n.projection),t.appendChild(i),t},SortBy:function(n){for(var i=this.createElementNSPlus("ogc:SortBy"),t=0,r=n.length;r>t;t++)this.writeNode("ogc:SortProperty",n[t],i);return i},SortProperty:function(n){var t=this.createElementNSPlus("ogc:SortProperty");return this.writeNode("ogc:PropertyName",n,t),this.writeNode("ogc:SortOrder","DESC"==n.order?"DESC":"ASC",t),t},SortOrder:function(n){return this.createElementNSPlus("ogc:SortOrder",{value:n})}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature},writeSpatial:function(n,t){var i=this.createElementNSPlus("ogc:"+t),r;return(this.writeNode("PropertyName",n,i),n.value instanceof OpenLayers.Filter.Function)?this.writeNode("Function",n.value,i):(r=n.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",n.value).firstChild:this.writeNode("gml:Envelope",n.value),n.projection&&r.setAttribute("srsName",n.projection),i.appendChild(r)),i},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"});OpenLayers.Format.OWSCommon=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",getVersion:function(n){var t=this.version,i;return t||(i=n.getAttribute("xmlns:ows"),i&&"1.1"===i.substring(i.lastIndexOf("/")+1)&&(t="1.1.0"),t||(t=this.defaultVersion)),t},CLASS_NAME:"OpenLayers.Format.OWSCommon"});OpenLayers.Format.OWSCommon.v1=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i={};return this.readChildNodes(n,i),i},readers:{ows:{Exception:function(n,t){var i={code:n.getAttribute("exceptionCode"),locator:n.getAttribute("locator"),texts:[]};t.exceptions.push(i);this.readChildNodes(n,i)},ExceptionText:function(n,t){var i=this.getChildValue(n);t.texts.push(i)},ServiceIdentification:function(n,t){t.serviceIdentification={};this.readChildNodes(n,t.serviceIdentification)},Title:function(n,t){t.title=this.getChildValue(n)},Abstract:function(n,t){t.abstract=this.getChildValue(n)},Keywords:function(n,t){t.keywords={};this.readChildNodes(n,t.keywords)},Keyword:function(n,t){t[this.getChildValue(n)]=!0},ServiceType:function(n,t){t.serviceType={codeSpace:n.getAttribute("codeSpace"),value:this.getChildValue(n)}},ServiceTypeVersion:function(n,t){t.serviceTypeVersion=this.getChildValue(n)},Fees:function(n,t){t.fees=this.getChildValue(n)},AccessConstraints:function(n,t){t.accessConstraints=this.getChildValue(n)},ServiceProvider:function(n,t){t.serviceProvider={};this.readChildNodes(n,t.serviceProvider)},ProviderName:function(n,t){t.providerName=this.getChildValue(n)},ProviderSite:function(n,t){t.providerSite=this.getAttributeNS(n,this.namespaces.xlink,"href")},ServiceContact:function(n,t){t.serviceContact={};this.readChildNodes(n,t.serviceContact)},IndividualName:function(n,t){t.individualName=this.getChildValue(n)},PositionName:function(n,t){t.positionName=this.getChildValue(n)},ContactInfo:function(n,t){t.contactInfo={};this.readChildNodes(n,t.contactInfo)},Phone:function(n,t){t.phone={};this.readChildNodes(n,t.phone)},Voice:function(n,t){t.voice=this.getChildValue(n)},Address:function(n,t){t.address={};this.readChildNodes(n,t.address)},DeliveryPoint:function(n,t){t.deliveryPoint=this.getChildValue(n)},City:function(n,t){t.city=this.getChildValue(n)},AdministrativeArea:function(n,t){t.administrativeArea=this.getChildValue(n)},PostalCode:function(n,t){t.postalCode=this.getChildValue(n)},Country:function(n,t){t.country=this.getChildValue(n)},ElectronicMailAddress:function(n,t){t.electronicMailAddress=this.getChildValue(n)},Role:function(n,t){t.role=this.getChildValue(n)},OperationsMetadata:function(n,t){t.operationsMetadata={};this.readChildNodes(n,t.operationsMetadata)},Operation:function(n,t){var i=n.getAttribute("name");t[i]={};this.readChildNodes(n,t[i])},DCP:function(n,t){t.dcp={};this.readChildNodes(n,t.dcp)},HTTP:function(n,t){t.http={};this.readChildNodes(n,t.http)},Get:function(n,t){t.get=this.getAttributeNS(n,this.namespaces.xlink,"href")},Post:function(n,t){t.post=this.getAttributeNS(n,this.namespaces.xlink,"href")},Parameter:function(n,t){t.parameters||(t.parameters={});var i=n.getAttribute("name");t.parameters[i]={};this.readChildNodes(n,t.parameters[i])},Value:function(n,t){t[this.getChildValue(n)]=!0},OutputFormat:function(n,t){t.formats.push({value:this.getChildValue(n)});this.readChildNodes(n,t)},WGS84BoundingBox:function(n,t){var i={};i.crs=n.getAttribute("crs");t.BoundingBox?t.BoundingBox.push(i):(t.projection=i.crs,i=t);this.readChildNodes(n,i)},BoundingBox:function(n,t){this.readers.ows.WGS84BoundingBox.apply(this,[n,t])},LowerCorner:function(n,t){var i=this.getChildValue(n).replace(this.regExes.trimSpace,""),r;i=i.replace(this.regExes.trimComma,",");r=i.split(this.regExes.splitSpace);t.left=r[0];t.bottom=r[1]},UpperCorner:function(n,t){var i=this.getChildValue(n).replace(this.regExes.trimSpace,""),r;i=i.replace(this.regExes.trimComma,",");r=i.split(this.regExes.splitSpace);t.right=r[0];t.top=r[1];t.bounds=new OpenLayers.Bounds(t.left,t.bottom,t.right,t.top);delete t.left;delete t.bottom;delete t.right;delete t.top},Language:function(n,t){t.language=this.getChildValue(n)}}},writers:{ows:{BoundingBox:function(n){var t=this.createElementNSPlus("ows:BoundingBox",{attributes:{crs:n.projection}});return this.writeNode("ows:LowerCorner",n,t),this.writeNode("ows:UpperCorner",n,t),t},LowerCorner:function(n){return this.createElementNSPlus("ows:LowerCorner",{value:n.bounds.left+" "+n.bounds.bottom})},UpperCorner:function(n){return this.createElementNSPlus("ows:UpperCorner",{value:n.bounds.right+" "+n.bounds.top})},Identifier:function(n){return this.createElementNSPlus("ows:Identifier",{value:n})},Title:function(n){return this.createElementNSPlus("ows:Title",{value:n})},Abstract:function(n){return this.createElementNSPlus("ows:Abstract",{value:n})},OutputFormat:function(n){return this.createElementNSPlus("ows:OutputFormat",{value:n})}}},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1"});OpenLayers.Format.OWSCommon.v1_0_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1,{namespaces:{ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink"},readers:{ows:OpenLayers.Util.applyDefaults({ExceptionReport:function(n,t){t.success=!1;t.exceptionReport={version:n.getAttribute("version"),language:n.getAttribute("language"),exceptions:[]};this.readChildNodes(n,t.exceptionReport)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Format.OWSCommon.v1.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1_0_0"});OpenLayers.Format.WFST.v1_1_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0,OpenLayers.Format.WFST.v1,{version:"1.1.0",schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"},initialize:function(n){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[n]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[n])},readNode:function(n,t){return OpenLayers.Format.GML.v3.prototype.readNode.apply(this,[n,t])},readers:{wfs:OpenLayers.Util.applyDefaults({FeatureCollection:function(n,t){t.numberOfFeatures=parseInt(n.getAttribute("numberOfFeatures"));OpenLayers.Format.WFST.v1.prototype.readers.wfs.FeatureCollection.apply(this,arguments)},TransactionResponse:function(n,t){t.insertIds=[];t.success=!1;this.readChildNodes(n,t)},TransactionSummary:function(n,t){t.success=!0},InsertResults:function(n,t){this.readChildNodes(n,t)},Feature:function(n,t){var i={fids:[]};this.readChildNodes(n,i);t.insertIds.push(i.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc,ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows},writers:{wfs:OpenLayers.Util.applyDefaults({GetFeature:function(n){var t=OpenLayers.Format.WFST.v1.prototype.writers.wfs.GetFeature.apply(this,arguments);return n&&this.setAttributes(t,{resultType:n.resultType,startIndex:n.startIndex,count:n.count}),t},Query:function(n){var i,t,r,u;if(n=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},n),i=n.featurePrefix,t=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(i?i+":":"")+n.featureType,srsName:n.srsName}}),n.featureNS&&t.setAttribute("xmlns:"+i,n.featureNS),n.propertyNames)for(r=0,u=n.propertyNames.length;u>r;r++)this.writeNode("wfs:PropertyName",{property:n.propertyNames[r]},t);return n.filter&&(this.setFilterProperty(n.filter),this.writeNode("ogc:Filter",n.filter,t)),t},PropertyName:function(n){return this.createElementNSPlus("wfs:PropertyName",{value:n.property})}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_1_0"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:!1,read:function(n,t,i){var r,u,e,o,s;if(t=t?t:"FeatureCollection",r=null,u=null,u="string"==typeof n?OpenLayers.Format.JSON.prototype.read.apply(this,[n,i]):n){if("string"!=typeof u.type)OpenLayers.Console.error("Bad GeoJSON - no type: "+n);else if(this.isValidType(u,t))switch(t){case"Geometry":try{r=this.parseGeometry(u)}catch(f){OpenLayers.Console.error(f)}break;case"Feature":try{r=this.parseFeature(u);r.type="Feature"}catch(f){OpenLayers.Console.error(f)}break;case"FeatureCollection":switch(r=[],u.type){case"Feature":try{r.push(this.parseFeature(u))}catch(f){r=null;OpenLayers.Console.error(f)}break;case"FeatureCollection":for(e=0,o=u.features.length;o>e;++e)try{r.push(this.parseFeature(u.features[e]))}catch(f){r=null;OpenLayers.Console.error(f)}break;default:try{s=this.parseGeometry(u);r.push(new OpenLayers.Feature.Vector(s))}catch(f){r=null;OpenLayers.Console.error(f)}}}}else OpenLayers.Console.error("Bad JSON: "+n);return r},isValidType:function(n,t){var i=!1;switch(t){case"Geometry":-1==OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],n.type)?OpenLayers.Console.error("Unsupported geometry type: "+n.type):i=!0;break;case"FeatureCollection":i=!0;break;default:n.type==t?i=!0:OpenLayers.Console.error("Cannot convert types from "+n.type+" to "+t)}return i},parseFeature:function(n){var t,r,u,i;u=n.properties?n.properties:{};i=n.geometry&&n.geometry.bbox||n.bbox;try{r=this.parseGeometry(n.geometry)}catch(f){throw f;}return t=new OpenLayers.Feature.Vector(r,u),i&&(t.bounds=OpenLayers.Bounds.fromArray(i)),n.id&&(t.fid=n.id),t},parseGeometry:function(n){var t,r;if(null==n)return null;if(r=!1,"GeometryCollection"==n.type){if(!OpenLayers.Util.isArray(n.geometries))throw"GeometryCollection must have geometries array: "+n;for(var u=n.geometries.length,f=Array(u),i=0;u>i;++i)f[i]=this.parseGeometry.apply(this,[n.geometries[i]]);t=new OpenLayers.Geometry.Collection(f);r=!0}else{if(!OpenLayers.Util.isArray(n.coordinates))throw"Geometry must have coordinates array: "+n;if(!this.parseCoords[n.type.toLowerCase()])throw"Unsupported geometry type: "+n.type;try{t=this.parseCoords[n.type.toLowerCase()].apply(this,[n.coordinates])}catch(e){throw e;}}return this.internalProjection&&this.externalProjection&&!r&&t.transform(this.externalProjection,this.internalProjection),t},parseCoords:{point:function(n){if(0==this.ignoreExtraDims&&2!=n.length)throw"Only 2D points are supported: "+n;return new OpenLayers.Geometry.Point(n[0],n[1])},multipoint:function(n){for(var i=[],r=null,t=0,u=n.length;u>t;++t){try{r=this.parseCoords.point.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.MultiPoint(i)},linestring:function(n){for(var i=[],r=null,t=0,u=n.length;u>t;++t){try{r=this.parseCoords.point.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.LineString(i)},multilinestring:function(n){for(var i=[],r=null,t=0,u=n.length;u>t;++t){try{r=this.parseCoords.linestring.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.MultiLineString(i)},polygon:function(n){for(var i,r,u=[],t=0,f=n.length;f>t;++t){try{r=this.parseCoords.linestring.apply(this,[n[t]])}catch(e){throw e;}i=new OpenLayers.Geometry.LinearRing(r.components);u.push(i)}return new OpenLayers.Geometry.Polygon(u)},multipolygon:function(n){for(var i=[],r=null,t=0,u=n.length;u>t;++t){try{r=this.parseCoords.polygon.apply(this,[n[t]])}catch(f){throw f;}i.push(r)}return new OpenLayers.Geometry.MultiPolygon(i)},box:function(n){if(2!=n.length)throw"GeoJSON box coordinates must have 2 elements";return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(n[0][0],n[0][1]),new OpenLayers.Geometry.Point(n[1][0],n[0][1]),new OpenLayers.Geometry.Point(n[1][0],n[1][1]),new OpenLayers.Geometry.Point(n[0][0],n[1][1]),new OpenLayers.Geometry.Point(n[0][0],n[0][1])])])}},write:function(n,t){var i={type:null},f,r,u,e;if(OpenLayers.Util.isArray(n))for(i.type="FeatureCollection",f=n.length,i.features=Array(f),r=0;f>r;++r){if(u=n[r],!u instanceof OpenLayers.Feature.Vector){e="FeatureCollection only supports collections of features: "+u;throw e;}i.features[r]=this.extract.feature.apply(this,[u])}else 0==n.CLASS_NAME.indexOf("OpenLayers.Geometry")?i=this.extract.geometry.apply(this,[n]):n instanceof OpenLayers.Feature.Vector&&(i=this.extract.feature.apply(this,[n]),n.layer&&n.layer.projection&&(i.crs=this.createCRSObject(n)));return OpenLayers.Format.JSON.prototype.write.apply(this,[i,t])},createCRSObject:function(n){var t=""+n.layer.projection,r={},i;return t.match(/epsg:/i)&&(i=parseInt(t.substring(t.indexOf(":")+1)),r=4326==i?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+i}}),r},extract:{feature:function(n){var i=this.extract.geometry.apply(this,[n.geometry]),t={type:"Feature",properties:n.attributes,geometry:i};return null!=n.fid&&(t.id=n.fid),t},geometry:function(n){if(null==n)return null;this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection));var t=n.CLASS_NAME.split(".")[2],i=this.extract[t.toLowerCase()].apply(this,[n]);return"Collection"==t?{type:"GeometryCollection",geometries:i}:{type:t,coordinates:i}},point:function(n){return[n.x,n.y]},multipoint:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push(this.extract.point.apply(this,[n.components[t]]));return i},linestring:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push(this.extract.point.apply(this,[n.components[t]]));return i},multilinestring:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push(this.extract.linestring.apply(this,[n.components[t]]));return i},polygon:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push(this.extract.linestring.apply(this,[n.components[t]]));return i},multipolygon:function(n){for(var i=[],t=0,r=n.components.length;r>t;++t)i.push(this.extract.polygon.apply(this,[n.components[t]]));return i},collection:function(n){for(var i=n.components.length,r=Array(i),t=0;i>t;++t)r[t]=this.extract.geometry.apply(this,[n.components[t]]);return r}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});OpenLayers.Protocol.Script=OpenLayers.Class(OpenLayers.Protocol,{url:null,params:null,callback:null,scope:null,format:null,callbackKey:"callback",callbackPrefix:"",pendingRequests:null,srsInBBOX:!1,initialize:function(n){if(n=n||{},this.params={},this.pendingRequests={},OpenLayers.Protocol.prototype.initialize.apply(this,arguments),this.format||(this.format=new OpenLayers.Format.GeoJSON),!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var t=new OpenLayers.Format.QueryStringFilter({srsInBBOX:this.srsInBBOX});this.filterToParams=function(n,i){return t.write(n,i)}}},read:function(n){OpenLayers.Protocol.prototype.read.apply(this,arguments);n=OpenLayers.Util.applyDefaults(n,this.options);n.params=OpenLayers.Util.applyDefaults(n.params,this.options.params);n.filter&&this.filterToParams&&(n.params=this.filterToParams(n.filter,n.params));var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.createRequest(n.url,n.params,OpenLayers.Function.bind(function(i){t.data=i;this.handleRead(t,n)},this));return t.priv=i,t},createRequest:function(n,t,i){var u=OpenLayers.Protocol.Script.register(i),e="OpenLayers.Protocol.Script.registry["+u+"]",r,f;return t=OpenLayers.Util.extend({},t),t[this.callbackKey]=this.callbackPrefix+e,n=OpenLayers.Util.urlAppend(n,OpenLayers.Util.getParameterString(t)),r=document.createElement("script"),r.type="text/javascript",r.src=n,r.id="OpenLayers_Protocol_Script_"+u,this.pendingRequests[r.id]=r,f=document.getElementsByTagName("head")[0],f.appendChild(r),r},destroyRequest:function(n){OpenLayers.Protocol.Script.unregister(n.id.split("_").pop());delete this.pendingRequests[n.id];n.parentNode&&n.parentNode.removeChild(n)},handleRead:function(n,t){this.handleResponse(n,t)},handleResponse:function(n,t){t.callback&&(n.data?(n.features=this.parseFeatures(n.data),n.code=OpenLayers.Protocol.Response.SUCCESS):n.code=OpenLayers.Protocol.Response.FAILURE,this.destroyRequest(n.priv),t.callback.call(t.scope,n))},parseFeatures:function(n){return this.format.read(n)},abort:function(n){if(n)this.destroyRequest(n.priv);else for(var t in this.pendingRequests)this.destroyRequest(this.pendingRequests[t])},destroy:function(){this.abort();delete this.params;delete this.format;OpenLayers.Protocol.prototype.destroy.apply(this)},CLASS_NAME:"OpenLayers.Protocol.Script"}),function(){var n=OpenLayers.Protocol.Script,t=0;n.registry=[];n.register=function(i){var r=++t;return n.registry[r]=function(){n.unregister(r);i.apply(this,arguments)},r};n.unregister=function(t){delete n.registry[t]}}();OpenLayers.Format.CSWGetRecords=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Format.CSWGetRecords.DEFAULTS);var t=OpenLayers.Format.CSWGetRecords["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSWGetRecords version: "+n.version;return new t(n)};OpenLayers.Format.CSWGetRecords.DEFAULTS={version:"2.0.2"};OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,autoActivate:!0,defaultControl:null,saveState:!1,allowDepress:!1,activeState:null,initialize:function(n){OpenLayers.Control.prototype.initialize.apply(this,[n]);this.controls=[];this.activeState={}},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var n,t=this.controls.length-1;t>=0;t--)n=this.controls[t],n.events&&n.events.un({activate:this.iconOn,deactivate:this.iconOff}),OpenLayers.Event.stopObservingElement(n.panel_div),n.panel_div=null;this.activeState=null},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var n,t=0,i=this.controls.length;i>t;t++)n=this.controls[t],(n===this.defaultControl||this.saveState&&this.activeState[n.id])&&n.activate();return this.saveState===!0&&(this.defaultControl=null),this.redraw(),!0}return!1},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var n,t=0,i=this.controls.length;i>t;t++)n=this.controls[t],this.activeState[n.id]=n.deactivate();return this.redraw(),!0}return!1},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.addControlsToMap(this.controls),this.div},redraw:function(){for(var i,t=this.div.childNodes.length,n=t-1;n>=0;n--)this.div.removeChild(this.div.childNodes[n]);if(this.div.innerHTML="",this.active)for(n=0,i=this.controls.length;i>n;n++)this.div.appendChild(this.controls[n].panel_div)},activateControl:function(n){if(!this.active)return!1;if(n.type==OpenLayers.Control.TYPE_BUTTON)return n.trigger(),void 0;if(n.type==OpenLayers.Control.TYPE_TOGGLE)return n.active?n.deactivate():n.activate(),void 0;if(this.allowDepress&&n.active)n.deactivate();else{for(var t,i=0,r=this.controls.length;r>i;i++)t=this.controls[i],t==n||t.type!==OpenLayers.Control.TYPE_TOOL&&null!=t.type||t.deactivate();n.activate()}},addControls:function(n){var t,r,i;for(OpenLayers.Util.isArray(n)||(n=[n]),this.controls=this.controls.concat(n),t=0,r=n.length;r>t;t++)i=document.createElement("div"),i.className=n[t].displayClass+"ItemInactive",n[t].panel_div=i,""!=n[t].title&&(n[t].panel_div.title=n[t].title),OpenLayers.Event.observe(n[t].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,n[t])),OpenLayers.Event.observe(n[t].panel_div,"dblclick",OpenLayers.Function.bind(this.onDoubleClick,this,n[t])),OpenLayers.Event.observe(n[t].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop));this.map&&(this.addControlsToMap(n),this.redraw())},addControlsToMap:function(n){for(var t,i=0,r=n.length;r>i;i++)t=n[i],t.autoActivate===!0?(t.autoActivate=!1,this.map.addControl(t),t.autoActivate=!0):(this.map.addControl(t),t.deactivate()),t.events.on({activate:this.iconOn,deactivate:this.iconOff})},iconOn:function(){var n=this.panel_div;n.className=n.className.replace(/ItemInactive$/,"ItemActive")},iconOff:function(){var n=this.panel_div;n.className=n.className.replace(/ItemActive$/,"ItemInactive")},onClick:function(n,t){OpenLayers.Event.stop(t?t:window.event);this.activateControl(n)},onDoubleClick:function(n,t){OpenLayers.Event.stop(t?t:window.event)},getControlsBy:function(n,t){var i="function"==typeof t.test;return OpenLayers.Array.filter(this.controls,function(r){return r[n]==t||i&&t.test(r[n])})},getControlsByName:function(n){return this.getControlsBy("name",n)},getControlsByClass:function(n){return this.getControlsBy("CLASS_NAME",n)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map&&this.map.zoomToMaxExtent()},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(n){OpenLayers.Control.Panel.prototype.initialize.apply(this,[n]);this.addControls([new OpenLayers.Control.ZoomIn,new OpenLayers.Control.ZoomToMaxExtent,new OpenLayers.Control.ZoomOut])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:!1,initialize:function(n,t,i,r){OpenLayers.Layer.prototype.initialize.apply(this,[n,r]);this.url=t;this.params=OpenLayers.Util.extend({},i)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.prototype.clone.apply(this,[n])},setUrl:function(n){this.url=n},mergeNewParams:function(n){this.params=OpenLayers.Util.extend(this.params,n);var t=this.redraw();return null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"params"}),t},redraw:function(n){return n?this.mergeNewParams({_olSalt:Math.random()}):OpenLayers.Layer.prototype.redraw.apply(this,[])},selectUrl:function(n,t){for(var i=1,r=0,u=n.length;u>r;r++)i*=n.charCodeAt(r)*this.URL_HASH_FACTOR,i-=Math.floor(i);return t[Math.floor(i*t.length)]},getFullRequestString:function(n,t){var r=t||this.url,i=OpenLayers.Util.extend({},this.params),u,e,f;i=OpenLayers.Util.extend(i,n);u=OpenLayers.Util.getParameterString(i);OpenLayers.Util.isArray(r)&&(r=this.selectUrl(u,r));e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(r));for(f in i)f.toUpperCase()in e&&delete i[f];return u=OpenLayers.Util.getParameterString(i),OpenLayers.Util.urlAppend(r,u)},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,grid:null,singleTile:!1,ratio:1.5,buffer:0,numLoadingTiles:0,tileLoadingDelay:100,timerId:null,initialize:function(){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[];this._moveGriddedTiles=OpenLayers.Function.bind(this.moveGriddedTiles,this)},removeMap:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null)},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){var n,r,i;if(this.grid){for(n=0,r=this.grid.length;r>n;n++)for(var u=this.grid[n],t=0,f=u.length;f>t;t++)i=u[t],this.removeTileMonitoringHooks(i),i.destroy();this.grid=[]}},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[n]),null!=this.tileSize&&(n.tileSize=this.tileSize.clone()),n.grid=[],n},moveTo:function(n,t,i){if(OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments),n=n||this.map.getExtent(),null!=n){var r=!this.grid.length||t,u=this.getTilesBounds();this.singleTile?(r||!i&&!u.containsBounds(n))&&this.initSingleTile(n):r||!u.containsBounds(n,!0)?this.initGriddedTiles(n):this.scheduleMoveGriddedTiles()}},moveByPx:function(){this.singleTile||this.scheduleMoveGriddedTiles()},scheduleMoveGriddedTiles:function(){null!=this.timerId&&window.clearTimeout(this.timerId);this.timerId=window.setTimeout(this._moveGriddedTiles,this.tileLoadingDelay)},setTileSize:function(n){this.singleTile&&(n=this.map.getSize(),n.h=parseInt(n.h*this.ratio),n.w=parseInt(n.w*this.ratio));OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[n])},getGridBounds:function(){return OpenLayers.Console.warn("The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead."),this.getTilesBounds()},getTilesBounds:function(){var n=null;if(this.grid.length){var r=this.grid.length-1,t=this.grid[r][0],u=this.grid[0].length-1,i=this.grid[0][u];n=new OpenLayers.Bounds(t.bounds.left,t.bounds.bottom,i.bounds.right,i.bounds.top)}return n},initSingleTile:function(n){var i=n.getCenterLonLat(),u=n.getWidth()*this.ratio,f=n.getHeight()*this.ratio,r=new OpenLayers.Bounds(i.lon-u/2,i.lat-f/2,i.lon+u/2,i.lat+f/2),o=new OpenLayers.LonLat(r.left,r.top),e=this.map.getLayerPxFromLonLat(o),t;this.grid.length||(this.grid[0]=[]);t=this.grid[0][0];t?t.moveTo(r,e):(t=this.addTile(r,e),this.addTileMonitoringHooks(t),t.draw(),this.grid[0][0]=t);this.removeExcessTiles(1,1)},calculateGridLayout:function(n,t,i){var u=i*this.tileSize.w,r=i*this.tileSize.h,f=n.left-t.lon,e=Math.floor(f/u)-this.buffer,h=f/u-e,c=-h*this.tileSize.w,l=t.lon+e*u,o=n.top-(t.lat+r),s=Math.ceil(o/r)+this.buffer,a=s-o/r,v=-a*this.tileSize.h,y=t.lat+s*r;return{tilelon:u,tilelat:r,tileoffsetlon:l,tileoffsetlat:y,tileoffsetx:c,tileoffsety:v}},getTileOrigin:function(){var n=this.tileOrigin,t,i;return n||(t=this.getMaxExtent(),i={tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]}[this.tileOriginCorner],n=new OpenLayers.LonLat(t[i[0]],t[i[1]])),n},initGriddedTiles:function(n){var w=this.map.getSize(),b=Math.ceil(w.h/this.tileSize.h)+Math.max(1,2*this.buffer),k=Math.ceil(w.w/this.tileSize.w)+Math.max(1,2*this.buffer),d=this.getTileOrigin(),g=this.map.getResolution(),t=this.calculateGridLayout(n,d,g),f=Math.round(t.tileoffsetx),s=Math.round(t.tileoffsety),i=t.tileoffsetlon,e=t.tileoffsetlat,h=t.tilelon,c=t.tilelat,r,o,a,v,y,p,u;this.origin=new OpenLayers.Pixel(f,s);var nt=f,tt=i,l=0,it=parseInt(this.map.layerContainerDiv.style.left),rt=parseInt(this.map.layerContainerDiv.style.top);do{r=this.grid[l++];r||(r=[],this.grid.push(r));i=tt;f=nt;o=0;do a=new OpenLayers.Bounds(i,e,i+h,e+c),v=f,v-=it,y=s,y-=rt,p=new OpenLayers.Pixel(v,y),u=r[o++],u?u.moveTo(a,p,!1):(u=this.addTile(a,p),this.addTileMonitoringHooks(u),r.push(u)),i+=h,f+=this.tileSize.w;while(n.right+h*this.buffer>=i||k>o);e-=c;s+=this.tileSize.h}while(e>=n.bottom-c*this.buffer||b>l);this.removeExcessTiles(l,o);this.spiralTileLoad()},getMaxExtent:function(){return this.maxExtent},spiralTileLoad:function(){for(var t,i,r,c,n,u=[],f=["right","down","left","up"],s=0,h=-1,e=OpenLayers.Util.indexOf(f,"right"),o=0;f.length>o;){t=s;i=h;switch(f[e]){case"right":i++;break;case"down":t++;break;case"left":i--;break;case"up":t--}n=null;this.grid.length>t&&t>=0&&this.grid[0].length>i&&i>=0&&(n=this.grid[t][i]);null==n||n.queued?(e=(e+1)%4,o++):(u.unshift(n),n.queued=!0,o=0,s=t,h=i)}for(r=0,c=u.length;c>r;r++)n=u[r],n.draw(),n.queued=!1},addTile:function(n,t){return new OpenLayers.Tile.Image(this,t,n,null,this.tileSize,this.tileOptions)},addTileMonitoringHooks:function(n){n.onLoadStart=function(){0==this.numLoadingTiles&&this.events.triggerEvent("loadstart");this.numLoadingTiles++};n.events.register("loadstart",this,n.onLoadStart);n.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");0==this.numLoadingTiles&&this.events.triggerEvent("loadend")};n.events.register("loadend",this,n.onLoadEnd);n.events.register("unload",this,n.onLoadEnd)},removeTileMonitoringHooks:function(n){n.unload();n.events.un({loadstart:n.onLoadStart,loadend:n.onLoadEnd,unload:n.onLoadEnd,scope:this})},moveGriddedTiles:function(){var i=!0,n=this.buffer||1,r=this.grid[0][0].position,u=parseInt(this.map.layerContainerDiv.style.left),f=parseInt(this.map.layerContainerDiv.style.top),t=r.add(u,f);t.x>-this.tileSize.w*(n-1)?this.shiftColumn(!0):t.x<-this.tileSize.w*n?this.shiftColumn(!1):t.y>-this.tileSize.h*(n-1)?this.shiftRow(!0):t.y<-this.tileSize.h*n?this.shiftRow(!1):i=!1;i&&(this.timerId=window.setTimeout(this._moveGriddedTiles,0))},shiftRow:function(n){for(var c=n?0:this.grid.length-1,t=this.grid,e=t[c],l=this.map.getResolution(),o=n?-this.tileSize.h:this.tileSize.h,s=l*-o,u=n?t.pop():t.shift(),r=0,a=e.length;a>r;r++){var h=e[r],i=h.bounds.clone(),f=h.position.clone();i.bottom=i.bottom+s;i.top=i.top+s;f.y=f.y+o;u[r].moveTo(i,f)}n?t.unshift(u):t.push(u)},shiftColumn:function(n){for(var u,e=n?-this.tileSize.w:this.tileSize.w,h=this.map.getResolution(),o=h*e,t=0,c=this.grid.length;c>t;t++){var r=this.grid[t],l=n?0:r.length-1,s=r[l],i=s.bounds.clone(),f=s.position.clone();i.left=i.left+o;i.right=i.right+o;f.x=f.x+e;u=n?this.grid[t].pop():this.grid[t].shift();u.moveTo(i,f);n?r.unshift(u):r.push(u)}},removeExcessTiles:function(n,t){for(var i,f,u,r;this.grid.length>n;)for(var u=this.grid.pop(),i=0,f=u.length;f>i;i++)r=u[i],this.removeTileMonitoringHooks(r),r.destroy();for(;this.grid[0].length>t;)for(i=0,f=this.grid.length;f>i;i++)u=this.grid[i],r=u.pop(),this.removeTileMonitoringHooks(r),r.destroy()},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(n){var t=this.maxExtent,u=this.getResolution(),i=u*this.tileSize.w,r=u*this.tileSize.h,f=this.getLonLatFromViewPortPx(n),e=t.left+i*Math.floor((f.lon-t.left)/i),o=t.bottom+r*Math.floor((f.lat-t.bottom)/r);return new OpenLayers.Bounds(e,o,e+i,o+r)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:!1,initialize:function(n,t,i,r,u,f){this.layer=n;this.position=t.clone();this.bounds=i.clone();this.url=r;u&&(this.size=u.clone());this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);OpenLayers.Util.extend(this,f)},unload:function(){this.isLoading&&(this.isLoading=!1,this.events.triggerEvent("unload"))},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destroy();this.events=null},clone:function(n){return null==n&&(n=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)),OpenLayers.Util.applyDefaults(n,this),n},draw:function(){var n=this.layer.maxExtent,t=n&&this.bounds.intersectsBounds(n,!1);return this.shouldDraw=t||this.layer.displayOutsideMaxExtent,this.clear(),this.shouldDraw},moveTo:function(n,t,i){null==i&&(i=!0);this.bounds=n.clone();this.position=t.clone();i&&this.draw()},clear:function(){},getBoundsFromBaseLayer:function(n){var u=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name}),t,r,i;return OpenLayers.Console.warn(u),t=this.layer.map.getLonLatFromLayerPx(n),r=n.clone(),r.x+=this.size.w,r.y+=this.size.h,i=this.layer.map.getLonLatFromLayerPx(r),t.lon>i.lon&&(0>t.lon?t.lon=-180-(t.lon+180):i.lon=180+i.lon+180),new OpenLayers.Bounds(t.lon,i.lat,i.lon,t.lat)},showTile:function(){this.shouldDraw&&this.show()},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:!1,isFirstDraw:!0,backBufferTile:null,maxGetUrlLength:null,initialize:function(n,t,i,r){OpenLayers.Tile.prototype.initialize.apply(this,arguments);null!=this.maxGetUrlLength&&OpenLayers.Util.extend(this,OpenLayers.Tile.Image.IFrame);this.url=r;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){null!=this.imgDiv&&this.removeImgDiv();this.imgDiv=null;null!=this.frame&&this.frame.parentNode==this.layer.div&&this.layer.div.removeChild(this.frame);this.frame=null;this.backBufferTile&&(this.backBufferTile.destroy(),this.backBufferTile=null);this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)),n=OpenLayers.Tile.prototype.clone.apply(this,[n]),n.imgDiv=null,n},draw:function(){this.layer!=this.layer.map.baseLayer&&this.layer.reproject&&(this.bounds=this.getBoundsFromBaseLayer(this.position));var n=OpenLayers.Tile.prototype.draw.apply(this,arguments);return-1!=OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)||this.layer.singleTile?n?(this.backBufferTile||(this.backBufferTile=this.clone(),this.backBufferTile.hide(),this.backBufferTile.isBackBuffer=!0,this.events.register("loadend",this,this.resetBackBuffer),this.layer.events.register("loadend",this,this.resetBackBuffer)),this.startTransition()):this.backBufferTile&&this.backBufferTile.clear():n&&this.isFirstDraw&&(this.events.register("loadend",this,this.showTile),this.isFirstDraw=!1),n?(this.isLoading?this.events.triggerEvent("reload"):(this.isLoading=!0,this.events.triggerEvent("loadstart")),this.renderTile()):!1},resetBackBuffer:function(){if(this.showTile(),this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=!1;var n=this.layer.maxExtent,t=n&&this.bounds.intersectsBounds(n,!1);t&&(this.backBufferTile.position=this.position,this.backBufferTile.bounds=this.bounds,this.backBufferTile.size=this.size,this.backBufferTile.imageSize=this.layer.getImageSize(this.bounds)||this.size,this.backBufferTile.imageOffset=this.layer.imageOffset,this.backBufferTile.resolution=this.layer.getResolution(),this.backBufferTile.renderTile());this.backBufferTile.hide()}},renderTile:function(){return this.layer.async?(this.initImgDiv(),this.layer.getURLasync(this.bounds,this,"url",this.positionImage)):(this.url=this.layer.getURL(this.bounds),this.initImgDiv(),this.positionImage()),!0},positionImage:function(){if(null!==this.layer){OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var n=this.layer.getImageSize(this.bounds);this.layerAlphaHack?OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,n,this.url):(OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,n),this.imgDiv.src=this.url)}},clear:function(){this.imgDiv&&(this.hide(),OpenLayers.Tile.Image.useBlankTile&&(this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"))},initImgDiv:function(){var t,i,n,r;null==this.imgDiv&&(t=this.layer.imageOffset,i=this.layer.getImageSize(this.bounds),this.imgDiv=this.layerAlphaHack?OpenLayers.Util.createAlphaImageDiv(null,t,i,null,"relative",null,null,null,!0):OpenLayers.Util.createImage(null,t,i,null,"relative",null,null,!0),OpenLayers.Util.isArray(this.layer.url)&&(this.imgDiv.urls=this.layer.url.slice()),this.imgDiv.className="olTileImage",this.frame.style.zIndex=this.isBackBuffer?0:1,this.frame.appendChild(this.imgDiv),this.layer.div.appendChild(this.frame),null!=this.layer.opacity&&OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity),this.imgDiv.map=this.layer.map,n=function(){this.isLoading&&(this.isLoading=!1,this.events.triggerEvent("loadend"))},this.layerAlphaHack?OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(n,this)):OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(n,this)),r=function(){this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS&&n.call(this)},OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(r,this)));this.imgDiv.viewRequestID=this.layer.map.viewRequestID},removeImgDiv:function(){OpenLayers.Event.stopObservingElement(this.imgDiv);this.imgDiv.parentNode==this.frame&&(this.frame.removeChild(this.imgDiv),this.imgDiv.map=null);this.imgDiv.urls=null;var n=this.imgDiv.firstChild;n?(OpenLayers.Event.stopObservingElement(n),this.imgDiv.removeChild(n),delete n):this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"},checkImgURL:function(){if(this.layer){var n=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;OpenLayers.Util.isEquivalentUrl(n,this.url)||this.hide()}},startTransition:function(){var n,i,t;if(this.backBufferTile&&this.backBufferTile.imgDiv)if(n=1,this.backBufferTile.resolution&&(n=this.backBufferTile.resolution/this.layer.getResolution()),1!=n){if("resize"==this.layer.transitionEffect){var r=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top),u=new OpenLayers.Size(this.backBufferTile.size.w*n,this.backBufferTile.size.h*n),f=this.layer.map.getLayerPxFromLonLat(r);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,f,u);i=this.backBufferTile.imageSize;i=new OpenLayers.Size(i.w*n,i.h*n);t=this.backBufferTile.imageOffset;t&&(t=new OpenLayers.Pixel(t.x*n,t.y*n));OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,t,i);this.backBufferTile.show()}}else this.layer.singleTile?this.backBufferTile.show():this.backBufferTile.hide()},show:function(){this.frame.style.display="";-1!=OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)&&OpenLayers.IS_GECKO===!0&&(this.frame.scrollLeft=this.frame.scrollLeft)},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile="safari"==OpenLayers.BROWSER_NAME||"opera"==OpenLayers.BROWSER_NAME;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(n){var t,i;(this.request=new OpenLayers.Format.ArcXML.Request,this.response=new OpenLayers.Format.ArcXML.Response,n)&&("feature"==n.requesttype?(this.request.get_image=null,t=this.request.get_feature.query,this.addCoordSys(t.featurecoordsys,n.featureCoordSys),this.addCoordSys(t.filtercoordsys,n.filterCoordSys),n.polygon?(t.isspatial=!0,t.spatialfilter.polygon=n.polygon):n.envelope&&(t.isspatial=!0,t.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0},this.parseEnvelope(t.spatialfilter.envelope,n.envelope))):"image"==n.requesttype?(this.request.get_feature=null,i=this.request.get_image.properties,this.parseEnvelope(i.envelope,n.envelope),this.addLayers(i.layerlist,n.layers),this.addImageSize(i.imagesize,n.tileSize),this.addCoordSys(i.featurecoordsys,n.featureCoordSys),this.addCoordSys(i.filtercoordsys,n.filterCoordSys)):this.request=null);OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},parseEnvelope:function(n,t){t&&4==t.length&&(n.minx=t[0],n.miny=t[1],n.maxx=t[2],n.maxy=t[3])},addLayers:function(n,t){for(var i=0,r=t.length;r>i;i++)n.push(t[i])},addImageSize:function(n,t){null!==t&&(n.width=t.w,n.height=t.h,n.printwidth=t.w,n.printheight=t.h)},addCoordSys:function(n,t){"string"==typeof t?(n.id=parseInt(t),n.string=t):"object"==typeof t&&null!==t.proj?(n.id=t.proj.srsProjNumber,n.string=t.proj.srsCode):n=t},iserror:function(n){var t=null,i;return n?(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]),i=n.documentElement.getElementsByTagName("ERROR"),t=null!==i&&i.length>0):t=""!==this.response.error,t},read:function(n){var t,i,r;if("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),t=null,n&&n.documentElement&&(t="ARCXML"==n.documentElement.nodeName?n.documentElement:n.documentElement.getElementsByTagName("ARCXML")[0]),!t||"parsererror"===t.firstChild.nodeName){try{i=n.firstChild.nodeValue;r=n.firstChild.childNodes[1].firstChild.nodeValue}catch(u){}throw{message:"Error parsing the ArcXML request",error:i,source:r};}return this.parseResponse(t)},write:function(n){var y,p,s,t,w,b,h,c,k,nt,f,l,r,e,u,tt,i,o,d,g,it,v,a;if(n||(n=this.request),y=this.createElementNS("","ARCXML"),y.setAttribute("version","1.1"),p=this.createElementNS("","REQUEST"),null!=n.get_image){if(u=this.createElementNS("","GET_IMAGE"),p.appendChild(u),s=this.createElementNS("","PROPERTIES"),u.appendChild(s),t=n.get_image.properties,null!=t.featurecoordsys&&(w=this.createElementNS("","FEATURECOORDSYS"),s.appendChild(w),0===t.featurecoordsys.id?w.setAttribute("string",t.featurecoordsys.string):w.setAttribute("id",t.featurecoordsys.id)),null!=t.filtercoordsys&&(b=this.createElementNS("","FILTERCOORDSYS"),s.appendChild(b),0===t.filtercoordsys.id?b.setAttribute("string",t.filtercoordsys.string):b.setAttribute("id",t.filtercoordsys.id)),null!=t.envelope&&(h=this.createElementNS("","ENVELOPE"),s.appendChild(h),h.setAttribute("minx",t.envelope.minx),h.setAttribute("miny",t.envelope.miny),h.setAttribute("maxx",t.envelope.maxx),h.setAttribute("maxy",t.envelope.maxy)),c=this.createElementNS("","IMAGESIZE"),(s.appendChild(c),c.setAttribute("height",t.imagesize.height),c.setAttribute("width",t.imagesize.width),(t.imagesize.height!=t.imagesize.printheight||t.imagesize.width!=t.imagesize.printwidth)&&(c.setAttribute("printheight",t.imagesize.printheight),c.setArrtibute("printwidth",t.imagesize.printwidth)),null!=t.background)&&(k=this.createElementNS("","BACKGROUND"),s.appendChild(k),k.setAttribute("color",t.background.color.r+","+t.background.color.g+","+t.background.color.b),null!==t.background.transcolor&&k.setAttribute("transcolor",t.background.transcolor.r+","+t.background.transcolor.g+","+t.background.transcolor.b)),null!=t.layerlist&&t.layerlist.length>0)for(nt=this.createElementNS("","LAYERLIST"),s.appendChild(nt),f=0;t.layerlist.length>f;f++){if(l=this.createElementNS("","LAYERDEF"),nt.appendChild(l),l.setAttribute("id",t.layerlist[f].id),l.setAttribute("visible",t.layerlist[f].visible),"object"==typeof t.layerlist[f].query){if(r=t.layerlist[f].query,0>r.where.length)continue;e=null;e="boolean"==typeof r.spatialfilter&&r.spatialfilter?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY");e.setAttribute("where",r.where);"number"==typeof r.accuracy&&r.accuracy>0&&e.setAttribute("accuracy",r.accuracy);"number"==typeof r.featurelimit&&2e3>r.featurelimit&&e.setAttribute("featurelimit",r.featurelimit);"string"==typeof r.subfields&&"#ALL#"!=r.subfields&&e.setAttribute("subfields",r.subfields);"string"==typeof r.joinexpression&&r.joinexpression.length>0&&e.setAttribute("joinexpression",r.joinexpression);"string"==typeof r.jointables&&r.jointables.length>0&&e.setAttribute("jointables",r.jointables);l.appendChild(e)}"object"==typeof t.layerlist[f].renderer&&this.addRenderer(l,t.layerlist[f].renderer)}}else null!=n.get_feature&&(u=this.createElementNS("","GET_FEATURES"),(u.setAttribute("outputmode","newxml"),u.setAttribute("checkesc","true"),n.get_feature.geometry?u.setAttribute("geometry",n.get_feature.geometry):u.setAttribute("geometry","false"),n.get_feature.compact&&u.setAttribute("compact",n.get_feature.compact),"number"==n.get_feature.featurelimit&&u.setAttribute("featurelimit",n.get_feature.featurelimit),u.setAttribute("globalenvelope","true"),p.appendChild(u),null!=n.get_feature.layer&&n.get_feature.layer.length>0)&&(tt=this.createElementNS("","LAYER"),tt.setAttribute("id",n.get_feature.layer),u.appendChild(tt)),i=n.get_feature.query,null!=i&&(o=null,(o=i.isspatial?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY"),u.appendChild(o),"number"==typeof i.accuracy&&o.setAttribute("accuracy",i.accuracy),null!=i.featurecoordsys)&&(d=this.createElementNS("","FEATURECOORDSYS"),0==i.featurecoordsys.id?d.setAttribute("string",i.featurecoordsys.string):d.setAttribute("id",i.featurecoordsys.id),o.appendChild(d)),null!=i.filtercoordsys&&(g=this.createElementNS("","FILTERCOORDSYS"),0===i.filtercoordsys.id?g.setAttribute("string",i.filtercoordsys.string):g.setAttribute("id",i.filtercoordsys.id),o.appendChild(g)),i.buffer>0&&(it=this.createElementNS("","BUFFER"),it.setAttribute("distance",i.buffer),o.appendChild(it)),i.isspatial&&(v=this.createElementNS("","SPATIALFILTER"),(v.setAttribute("relation",i.spatialfilter.relation),o.appendChild(v),i.spatialfilter.envelope)?(a=this.createElementNS("","ENVELOPE"),a.setAttribute("minx",i.spatialfilter.envelope.minx),a.setAttribute("miny",i.spatialfilter.envelope.miny),a.setAttribute("maxx",i.spatialfilter.envelope.maxx),a.setAttribute("maxy",i.spatialfilter.envelope.maxy),v.appendChild(a)):"object"==typeof i.spatialfilter.polygon&&v.appendChild(this.writePolygonGeometry(i.spatialfilter.polygon))),null!=i.where&&i.where.length>0&&o.setAttribute("where",i.where)));return y.appendChild(p),OpenLayers.Format.XML.prototype.write.apply(this,[y])},addGroupRenderer:function(n,t){var r=this.createElementNS("","GROUPRENDERER"),i,u;for(n.appendChild(r),i=0;t.length>i;i++)u=t[i],this.addRenderer(r,u)},addRenderer:function(n,t){if(OpenLayers.Util.isArray(t))this.addGroupRenderer(n,t);else{var i=this.createElementNS("",t.type.toUpperCase()+"RENDERER");n.appendChild(i);"VALUEMAPRENDERER"==i.tagName?this.addValueMapRenderer(i,t):"VALUEMAPLABELRENDERER"==i.tagName?this.addValueMapLabelRenderer(i,t):"SIMPLELABELRENDERER"==i.tagName?this.addSimpleLabelRenderer(i,t):"SCALEDEPENDENTRENDERER"==i.tagName&&this.addScaleDependentRenderer(i,t)}},addScaleDependentRenderer:function(n,t){("string"==typeof t.lower||"number"==typeof t.lower)&&n.setAttribute("lower",t.lower);("string"==typeof t.upper||"number"==typeof t.upper)&&n.setAttribute("upper",t.upper);this.addRenderer(n,t.renderer)},addValueMapLabelRenderer:function(n,t){var f,s,i,r,u,e;if(n.setAttribute("lookupfield",t.lookupfield),n.setAttribute("labelfield",t.labelfield),"object"==typeof t.exacts)for(f=0,s=t.exacts.length;s>f;f++)if(i=t.exacts[f],r=this.createElementNS("","EXACT"),("string"==typeof i.value&&r.setAttribute("value",i.value),"string"==typeof i.label&&r.setAttribute("label",i.label),"string"==typeof i.method&&r.setAttribute("method",i.method),n.appendChild(r),"object"==typeof i.symbol)&&(u=null,"text"==i.symbol.type&&(u=this.createElementNS("","TEXTSYMBOL")),null!=u)){for(var h=this.fontStyleKeys,o=0,c=h.length;c>o;o++)e=h[o],i.symbol[e]&&u.setAttribute(e,i.symbol[e]);r.appendChild(u)}},addValueMapRenderer:function(n,t){var o,h,u,e,s,c,i,f,r;if(n.setAttribute("lookupfield",t.lookupfield),"object"==typeof t.ranges)for(o=0,h=t.ranges.length;h>o;o++)u=t.ranges[o],e=this.createElementNS("","RANGE"),(e.setAttribute("lower",u.lower),e.setAttribute("upper",u.upper),n.appendChild(e),"object"==typeof u.symbol)&&(r=null,"simplepolygon"==u.symbol.type&&(r=this.createElementNS("","SIMPLEPOLYGONSYMBOL")),null!=r&&("string"==typeof u.symbol.boundarycolor&&r.setAttribute("boundarycolor",u.symbol.boundarycolor),"string"==typeof u.symbol.fillcolor&&r.setAttribute("fillcolor",u.symbol.fillcolor),"number"==typeof u.symbol.filltransparency&&r.setAttribute("filltransparency",u.symbol.filltransparency),e.appendChild(r)));else if("object"==typeof t.exacts)for(s=0,c=t.exacts.length;c>s;s++)i=t.exacts[s],f=this.createElementNS("","EXACT"),("string"==typeof i.value&&f.setAttribute("value",i.value),"string"==typeof i.label&&f.setAttribute("label",i.label),"string"==typeof i.method&&f.setAttribute("method",i.method),n.appendChild(f),"object"==typeof i.symbol)&&(r=null,"simplemarker"==i.symbol.type&&(r=this.createElementNS("","SIMPLEMARKERSYMBOL")),null!=r&&("string"==typeof i.symbol.antialiasing&&r.setAttribute("antialiasing",i.symbol.antialiasing),"string"==typeof i.symbol.color&&r.setAttribute("color",i.symbol.color),"string"==typeof i.symbol.outline&&r.setAttribute("outline",i.symbol.outline),"string"==typeof i.symbol.overlap&&r.setAttribute("overlap",i.symbol.overlap),"string"==typeof i.symbol.shadow&&r.setAttribute("shadow",i.symbol.shadow),"number"==typeof i.symbol.transparency&&r.setAttribute("transparency",i.symbol.transparency),"string"==typeof i.symbol.usecentroid&&r.setAttribute("usecentroid",i.symbol.usecentroid),"number"==typeof i.symbol.width&&r.setAttribute("width",i.symbol.width),f.appendChild(r)))},addSimpleLabelRenderer:function(n,t){var o,f,i;n.setAttribute("field",t.field);for(var u=["featureweight","howmanylabels","labelbufferratio","labelpriorities","labelweight","linelabelposition","rotationalangles"],r=0,e=u.length;e>r;r++)i=u[r],t[i]&&n.setAttribute(i,t[i]);if("text"==t.symbol.type){o=t.symbol;f=this.createElementNS("","TEXTSYMBOL");n.appendChild(f);for(var u=this.fontStyleKeys,r=0,e=u.length;e>r;r++)i=u[r],o[i]&&f.setAttribute(i,t[i])}},writePolygonGeometry:function(n){var u,t;if(!(n instanceof OpenLayers.Geometry.Polygon))throw{message:"Cannot write polygon geometry to ArcXML with an "+n.CLASS_NAME+" object.",geometry:n};for(var f=this.createElementNS("","POLYGON"),i=0,s=n.components.length;s>i;i++){for(var e=n.components[i],o=this.createElementNS("","RING"),r=0,h=e.components.length;h>r;r++)u=e.components[r],t=this.createElementNS("","POINT"),t.setAttribute("x",u.x),t.setAttribute("y",u.y),o.appendChild(t);f.appendChild(o)}return f},parseResponse:function(n){var tt,t,o,i,r,s,u,k,h,c,it,rt,l,f,ut,ft,nt,e,w,b;if("string"==typeof n&&(tt=new OpenLayers.Format.XML,n=tt.read(n)),t=new OpenLayers.Format.ArcXML.Response,o=n.getElementsByTagName("ERROR"),null!=o&&o.length>0)t.error=this.getChildValue(o,"Unknown error.");else{if(i=n.getElementsByTagName("RESPONSE"),null==i||0==i.length)return t.error="No RESPONSE tag found in ArcXML response.",t;if(r=i[0].firstChild.nodeName,"#text"==r&&(r=i[0].firstChild.nextSibling.nodeName),"IMAGE"==r)s=n.getElementsByTagName("ENVELOPE"),u=n.getElementsByTagName("OUTPUT"),null==s||0==s.length?t.error="No ENVELOPE tag found in ArcXML response.":null==u||0==u.length?t.error="No OUTPUT tag found in ArcXML response.":(k=this.parseAttributes(s[0]),h=this.parseAttributes(u[0]),t.image="string"==typeof h.type?{envelope:k,output:{type:h.type,data:this.getChildValue(u[0])}}:{envelope:k,output:h});else if("FEATURES"==r){if(c=i[0].getElementsByTagName("FEATURES"),it=c[0].getElementsByTagName("FEATURECOUNT"),t.features.featurecount=it[0].getAttribute("count"),t.features.featurecount>0)for(rt=c[0].getElementsByTagName("ENVELOPE"),t.features.envelope=this.parseAttributes(rt[0],"number"),l=c[0].getElementsByTagName("FEATURE"),f=0;l.length>f;f++){for(var d=new OpenLayers.Feature.Vector,g=l[f].getElementsByTagName("FIELD"),a=0;g.length>a;a++)ut=g[a].getAttribute("name"),ft=g[a].getAttribute("value"),d.attributes[ut]=ft;if(nt=l[f].getElementsByTagName("POLYGON"),nt.length>0){for(var v=nt[0].getElementsByTagName("RING"),y=[],p=0;v.length>p;p++){for(e=[],e.push(this.parsePointGeometry(v[p])),w=v[p].getElementsByTagName("HOLE"),b=0;w.length>b;b++)e.push(this.parsePointGeometry(w[b]));w=null;y.push(new OpenLayers.Geometry.Polygon(e));e=null}v=null;d.geometry=1==y.length?y[0]:new OpenLayers.Geometry.MultiPolygon(y)}t.features.feature.push(d)}}else t.error="Unidentified response type."}return t},parseAttributes:function(n,t){for(var r={},i=0;n.attributes.length>i;i++)r[n.attributes[i].nodeName]="number"==t?parseFloat(n.attributes[i].nodeValue):n.attributes[i].nodeValue;return r},parsePointGeometry:function(n){var f=[],e=n.getElementsByTagName("COORDS"),i,u,o,t,r;if(e.length>0){for(i=this.getChildValue(e[0]),i=i.split(/;/),u=0;i.length>u;u++)o=i[u].split(/ /),f.push(new OpenLayers.Geometry.Point(parseFloat(o[0]),parseFloat(o[1])));e=null}else{if(t=n.getElementsByTagName("POINT"),t.length>0)for(r=0;t.length>r;r++)f.push(new OpenLayers.Geometry.Point(parseFloat(t[r].getAttribute("x")),parseFloat(t[r].getAttribute("y"))));t=null}return new OpenLayers.Geometry.LinearRing(f)},CLASS_NAME:"OpenLayers.Format.ArcXML"});OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(){return OpenLayers.Util.extend(this,{get_image:{properties:{background:null,draw:!0,envelope:{minx:0,miny:0,maxx:0,maxy:0},featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},imagesize:{height:0,width:0,dpi:96,printheight:0,printwidth:0,scalesymbols:!1},layerlist:[],output:{baseurl:"",legendbaseurl:"",legendname:"",legendpath:"",legendurl:"",name:"",path:"",type:"jpg",url:""}}},get_feature:{layer:"",query:{isspatial:!1,featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},buffer:0,where:"",spatialfilter:{relation:"envelope_intersection",envelope:null}}},environment:{separators:{cs:" ",ts:";"}},layer:[],workspaces:[]})},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"});OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(){return OpenLayers.Util.extend(this,{image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""})},CLASS_NAME:"OpenLayers.Format.ArcXML.Response"});OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:!0,user:void 0,password:void 0,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(n){var l=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost}),f,e,o,s,h,c;n=OpenLayers.Util.applyDefaults(n,l);var t=new OpenLayers.Request.XMLHttpRequest,i=OpenLayers.Util.urlAppend(n.url,OpenLayers.Util.getParameterString(n.params||{})),r=!(0==i.indexOf("http")),u=!r&&i.match(this.URL_SPLIT_REGEX);u&&(f=window.location,r=u[1]==f.protocol&&u[3]==f.hostname,e=u[4],o=f.port,(80!=e&&""!=e||"80"!=o&&""!=o)&&(r=r&&e==o));r||(n.proxy?i="function"==typeof n.proxy?n.proxy(i):n.proxy+encodeURIComponent(i):OpenLayers.Console.warn(OpenLayers.i18n("proxyNeeded"),{url:i}));t.open(n.method,i,n.async,n.user,n.password);for(s in n.headers)t.setRequestHeader(s,n.headers[s]);return h=this.events,c=this,t.onreadystatechange=function(){if(t.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var r=h.triggerEvent("complete",{request:t,config:n,requestUrl:i});r!==!1&&c.runCallbacks({request:t,config:n,requestUrl:i})}},n.async===!1?t.send(n.data):window.setTimeout(function(){0!==t.readyState&&t.send(n.data)},0),t},runCallbacks:function(n){var r,i=n.request,t=n.config,f=t.scope?OpenLayers.Function.bind(t.callback,t.scope):t.callback,u;t.success&&(r=t.scope?OpenLayers.Function.bind(t.success,t.scope):t.success);t.failure&&(u=t.scope?OpenLayers.Function.bind(t.failure,t.scope):t.failure);"file:"==OpenLayers.Util.createUrlObject(t.url).protocol&&i.responseText&&(i.status=200);f(i);(!i.status||i.status>=200&&300>i.status)&&(this.events.triggerEvent("success",n),r&&r(i));i.status&&(200>i.status||i.status>=300)&&(this.events.triggerEvent("failure",n),u&&u(i))},GET:function(n){return n=OpenLayers.Util.extend(n,{method:"GET"}),OpenLayers.Request.issue(n)},POST:function(n){return n=OpenLayers.Util.extend(n,{method:"POST"}),n.headers=n.headers?n.headers:{},"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(n.headers)||(n.headers["Content-Type"]="application/xml"),OpenLayers.Request.issue(n)},PUT:function(n){return n=OpenLayers.Util.extend(n,{method:"PUT"}),n.headers=n.headers?n.headers:{},"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(n.headers)||(n.headers["Content-Type"]="application/xml"),OpenLayers.Request.issue(n)},DELETE:function(n){return n=OpenLayers.Util.extend(n,{method:"DELETE"}),OpenLayers.Request.issue(n)},HEAD:function(n){return n=OpenLayers.Util.extend(n,{method:"HEAD"}),OpenLayers.Request.issue(n)},OPTIONS:function(n){return n=OpenLayers.Util.extend(n,{method:"OPTIONS"}),OpenLayers.Request.issue(n)}};OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},tileSize:null,featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:!0,name:"ArcIMS",isBaseLayer:!0,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:!0,async:!0,name:"ArcIMS"},initialize:function(n,t,i){this.tileSize=new OpenLayers.Size(512,512);this.params=OpenLayers.Util.applyDefaults({ServiceName:i.serviceName},this.DEFAULT_PARAMS);this.options=OpenLayers.Util.applyDefaults(i,this.DEFAULT_OPTIONS);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n,t,this.params,i]);this.transparent&&(this.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.format&&(this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png"));null===this.options.layers&&(this.options.layers=[])},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},getURL:function(n){var r="",u,i,t,f,e;return n=this.adjustBounds(n),u=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:n.toArray(),tileSize:this.tileSize})),i=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:u.write(),async:!1}),null!=i&&(t=i.responseXML,t&&t.documentElement||(t=i.responseText),f=new OpenLayers.Format.ArcXML,e=f.read(t),r=this.getUrlOrImage(e.image.output)),r},getURLasync:function(n,t,i,r){n=this.adjustBounds(n);var u=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:n.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(),async:!0,data:u.write(),callback:function(n){var u=n.responseXML,f,e;u&&u.documentElement||(u=n.responseText);f=new OpenLayers.Format.ArcXML;e=f.read(u);t[i]=this.getUrlOrImage(e.image.output);r.apply(t)},scope:this})},getUrlOrImage:function(n){var t="";return n.url?t=n.url:n.data&&(t="data:image/"+n.type+";base64,"+n.data),t},setLayerQuery:function(n,t){for(var i=0;this.options.layers.length>i;i++)if(n==this.options.layers[i].id)return this.options.layers[i].query=t,void 0;this.options.layers.push({id:n,visible:!0,query:t})},getFeatureInfo:function(n,t,i){var f=i.buffer||1,s=i.callback||function(){},h=i.scope||window,u={},r,e,o,c;OpenLayers.Util.extend(u,this.options);u.requesttype="feature";n instanceof OpenLayers.LonLat?(u.polygon=null,u.envelope=[n.lon-f,n.lat-f,n.lon+f,n.lat+f]):n instanceof OpenLayers.Geometry.Polygon&&(u.envelope=null,u.polygon=n);r=new OpenLayers.Format.ArcXML(u);(OpenLayers.Util.extend(r.request.get_feature,i),r.request.get_feature.layer=t.id,"number"==typeof t.query.accuracy)?r.request.get_feature.query.accuracy=t.query.accuracy:(e=this.map.getCenter(),o=this.map.getViewPortPxFromLonLat(e),o.x++,c=this.map.getLonLatFromPixel(o),r.request.get_feature.query.accuracy=c.lon-e.lon);r.request.get_feature.query.where=t.query.where;r.request.get_feature.query.spatialfilter.relation="area_intersection";OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:r.write(),callback:function(n){var t=r.parseResponse(n.responseText);r.iserror()?s.call(h,null):s.call(h,t.features)}})},clone:function(n){return null==n&&(n=new OpenLayers.Layer.ArcIMS(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},CLASS_NAME:"OpenLayers.Layer.ArcIMS"});OpenLayers.Format.OWSCommon.v1_1_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1,{namespaces:{ows:"http://www.opengis.net/ows/1.1",xlink:"http://www.w3.org/1999/xlink"},readers:{ows:OpenLayers.Util.applyDefaults({ExceptionReport:function(n,t){t.exceptionReport={version:n.getAttribute("version"),language:n.getAttribute("xml:lang"),exceptions:[]};this.readChildNodes(n,t.exceptionReport)},AllowedValues:function(n,t){t.allowedValues={};this.readChildNodes(n,t.allowedValues)},AnyValue:function(n,t){t.anyValue=!0},DataType:function(n,t){t.dataType=this.getChildValue(n)},Range:function(n,t){t.range={};this.readChildNodes(n,t.range)},MinimumValue:function(n,t){t.minValue=this.getChildValue(n)},MaximumValue:function(n,t){t.maxValue=this.getChildValue(n)},Identifier:function(n,t){t.identifier=this.getChildValue(n)},SupportedCRS:function(n,t){t.supportedCRS=this.getChildValue(n)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Util.applyDefaults({Range:function(n){var t=this.createElementNSPlus("ows:Range",{attributes:{"ows:rangeClosure":n.closure}});return this.writeNode("ows:MinimumValue",n.minValue,t),this.writeNode("ows:MaximumValue",n.maxValue,t),t},MinimumValue:function(n){return this.createElementNSPlus("ows:MinimumValue",{value:n})},MaximumValue:function(n){return this.createElementNSPlus("ows:MaximumValue",{value:n})},Value:function(n){return this.createElementNSPlus("ows:Value",{value:n})}},OpenLayers.Format.OWSCommon.v1.prototype.writers.ows)},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1_1_0"});OpenLayers.Format.WCSGetCoverage=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows/1.1",wcs:"http://www.opengis.net/wcs/1.1",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.1.2",schemaLocation:"http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1/wcsGetCoverage.xsd",write:function(n){var t=this.writeNode("wcs:GetCoverage",n);return this.setAttributeNS(t,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{wcs:{GetCoverage:function(n){var t=this.createElementNSPlus("wcs:GetCoverage",{attributes:{version:n.version||this.VERSION,service:"WCS"}});return this.writeNode("ows:Identifier",n.identifier,t),this.writeNode("wcs:DomainSubset",n.domainSubset,t),this.writeNode("wcs:Output",n.output,t),t},DomainSubset:function(n){var t=this.createElementNSPlus("wcs:DomainSubset",{});return this.writeNode("ows:BoundingBox",n.boundingBox,t),n.temporalSubset&&this.writeNode("wcs:TemporalSubset",n.temporalSubset,t),t},TemporalSubset:function(n){for(var i=this.createElementNSPlus("wcs:TemporalSubset",{}),t=0,r=n.timePeriods.length;r>t;++t)this.writeNode("wcs:TimePeriod",n.timePeriods[t],i);return i},TimePeriod:function(n){var t=this.createElementNSPlus("wcs:TimePeriod",{});return this.writeNode("wcs:BeginPosition",n.begin,t),this.writeNode("wcs:EndPosition",n.end,t),n.resolution&&this.writeNode("wcs:TimeResolution",n.resolution,t),t},BeginPosition:function(n){return this.createElementNSPlus("wcs:BeginPosition",{value:n})},EndPosition:function(n){return this.createElementNSPlus("wcs:EndPosition",{value:n})},TimeResolution:function(n){return this.createElementNSPlus("wcs:TimeResolution",{value:n})},Output:function(n){var t=this.createElementNSPlus("wcs:Output",{attributes:{format:n.format,store:n.store}});return n.gridCRS&&this.writeNode("wcs:GridCRS",n.gridCRS,t),t},GridCRS:function(n){var t=this.createElementNSPlus("wcs:GridCRS",{});return this.writeNode("wcs:GridBaseCRS",n.baseCRS,t),n.type&&this.writeNode("wcs:GridType",n.type,t),n.origin&&this.writeNode("wcs:GridOrigin",n.origin,t),this.writeNode("wcs:GridOffsets",n.offsets,t),n.CS&&this.writeNode("wcs:GridCS",n.CS,t),t},GridBaseCRS:function(n){return this.createElementNSPlus("wcs:GridBaseCRS",{value:n})},GridOrigin:function(n){return this.createElementNSPlus("wcs:GridOrigin",{value:n})},GridType:function(n){return this.createElementNSPlus("wcs:GridType",{value:n})},GridOffsets:function(n){return this.createElementNSPlus("wcs:GridOffsets",{value:n})},GridCS:function(n){return this.createElementNSPlus("wcs:GridCS",{value:n})}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.WCSGetCoverage"});OpenLayers.Format.WPSExecute=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows/1.1",gml:"http://www.opengis.net/gml",wps:"http://www.opengis.net/wps/1.0.0",wfs:"http://www.opengis.net/wfs",ogc:"http://www.opengis.net/ogc",wcs:"http://www.opengis.net/wcs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",schemaLocationAttr:function(){return void 0},write:function(n){var t,i;return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),this.xmldom=t):t=document.implementation.createDocument("","",null),i=this.writeNode("wps:Execute",n,t),this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{wps:{Execute:function(n){var t=this.createElementNSPlus("wps:Execute",{attributes:{version:this.VERSION,service:"WPS"}});return this.writeNode("ows:Identifier",n.identifier,t),this.writeNode("wps:DataInputs",n.dataInputs,t),this.writeNode("wps:ResponseForm",n.responseForm,t),t},ResponseForm:function(n){var t=this.createElementNSPlus("wps:ResponseForm",{});return n.rawDataOutput&&this.writeNode("wps:RawDataOutput",n.rawDataOutput,t),n.responseDocument&&this.writeNode("wps:ResponseDocument",n.responseDocument,t),t},ResponseDocument:function(n){var t=this.createElementNSPlus("wps:ResponseDocument",{attributes:{storeExecuteResponse:n.storeExecuteResponse,lineage:n.lineage,status:n.status}});return n.output&&this.writeNode("wps:Output",n.output,t),t},Output:function(n){var t=this.createElementNSPlus("wps:Output",{attributes:{asReference:n.asReference}});return this.writeNode("ows:Identifier",n.identifier,t),this.writeNode("ows:Title",n.title,t),this.writeNode("ows:Abstract",n.abstract,t),t},RawDataOutput:function(n){var t=this.createElementNSPlus("wps:RawDataOutput",{attributes:{mimeType:n.mimeType}});return this.writeNode("ows:Identifier",n.identifier,t),t},DataInputs:function(n){for(var i=this.createElementNSPlus("wps:DataInputs",{}),t=0,r=n.length;r>t;++t)this.writeNode("wps:Input",n[t],i);return i},Input:function(n){var t=this.createElementNSPlus("wps:Input",{});return this.writeNode("ows:Identifier",n.identifier,t),n.title&&this.writeNode("ows:Title",n.title,t),n.data&&this.writeNode("wps:Data",n.data,t),n.reference&&this.writeNode("wps:Reference",n.reference,t),t},Data:function(n){var t=this.createElementNSPlus("wps:Data",{});return n.literalData?this.writeNode("wps:LiteralData",n.literalData,t):n.complexData&&this.writeNode("wps:ComplexData",n.complexData,t),t},LiteralData:function(n){return this.createElementNSPlus("wps:LiteralData",{attributes:{uom:n.uom},value:n.value})},ComplexData:function(n){var t=this.createElementNSPlus("wps:ComplexData",{attributes:{mimeType:n.mimeType,encoding:n.encoding,schema:n.schema}});return t.appendChild(this.getXMLDoc().createCDATASection(n.value)),t},Reference:function(n){var t=this.createElementNSPlus("wps:Reference",{attributes:{mimeType:n.mimeType,"xlink:href":n.href,method:n.method,encoding:n.encoding,schema:n.schema}});return n.body&&this.writeNode("wps:Body",n.body,t),t},Body:function(n){var t=this.createElementNSPlus("wps:Body",{});return n.wcs?this.writeNode("wcs:GetCoverage",n.wcs,t):n.wfs?(this.featureType=n.wfs.featureType,this.version=n.wfs.version,this.writeNode("wfs:GetFeature",n.wfs,t)):this.writeNode("wps:Execute",n,t),t}},wcs:OpenLayers.Format.WCSGetCoverage.prototype.writers.wcs,wfs:OpenLayers.Format.WFST.v1_1_0.prototype.writers.wfs,ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.WPSExecute"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.removeButtons();this.buttons=null;this.position=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(n){OpenLayers.Control.prototype.draw.apply(this,arguments);n=this.position;this.buttons=[];var t=new OpenLayers.Size(18,18),i=new OpenLayers.Pixel(n.x+t.w/2,n.y);return this._addButton("panup","north-mini.png",i,t),n.y=i.y+t.h,this._addButton("panleft","west-mini.png",n,t),this._addButton("panright","east-mini.png",n.add(t.w,0),t),this._addButton("pandown","south-mini.png",i.add(0,2*t.h),t),this._addButton("zoomin","zoom-plus-mini.png",i.add(0,3*t.h+5),t),this._addButton("zoomworld","zoom-world-mini.png",i.add(0,4*t.h+5),t),this._addButton("zoomout","zoom-minus-mini.png",i.add(0,5*t.h+5),t),this.div},_addButton:function(n,t,i,r){var s=OpenLayers.Util.getImagesLocation()+t,u=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+n,i,r,s,"absolute"),e,o,f;return(u.style.cursor="pointer",this.div.appendChild(u),OpenLayers.Event.observe(u,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,u)),OpenLayers.Event.observe(u,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,u)),OpenLayers.Event.observe(u,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,u)),u.action=n,u.map=this.map,this.slideRatio)?(e=this.slideRatio,f=function(n){return this.map.getSize()[n]*e}):(o=this.slideFactor,f=function(){return o}),u.getSlideFactor=f,this.buttons.push(u),u},_removeButton:function(n){OpenLayers.Event.stopObservingElement(n);n.map=null;n.getSlideFactor=null;this.div.removeChild(n);OpenLayers.Util.removeItem(this.buttons,n)},removeButtons:function(){for(var n=this.buttons.length-1;n>=0;--n)this._removeButton(this.buttons[n])},doubleClick:function(n){return OpenLayers.Event.stop(n),!1},buttonDown:function(n){if(OpenLayers.Event.isLeftClick(n)){switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor("h"));break;case"pandown":this.map.pan(0,this.getSlideFactor("h"));break;case"panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case"panright":this.map.pan(this.getSlideFactor("w"),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent()}OpenLayers.Event.stop(n)}},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoombarDiv:null,divEvents:null,zoomWorldIcon:!1,panIcons:!0,forceFixedZoomLevel:!1,mouseDragStart:null,deltaY:null,zoomStart:null,destroy:function(){this._removeZoomBar();this.map.events.un({changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);delete this.mouseDragStart;delete this.zoomStart},setMap:function(){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){null!=this.div&&(this.removeButtons(),this._removeZoomBar());this.draw()},draw:function(n){var t,i,r;return OpenLayers.Control.prototype.draw.apply(this,arguments),n=this.position.clone(),this.buttons=[],t=new OpenLayers.Size(18,18),this.panIcons?(i=new OpenLayers.Pixel(n.x+t.w/2,n.y),r=t.w,this.zoomWorldIcon&&(i=new OpenLayers.Pixel(n.x+t.w,n.y)),this._addButton("panup","north-mini.png",i,t),n.y=i.y+t.h,this._addButton("panleft","west-mini.png",n,t),this.zoomWorldIcon&&(this._addButton("zoomworld","zoom-world-mini.png",n.add(t.w,0),t),r*=2),this._addButton("panright","east-mini.png",n.add(r,0),t),this._addButton("pandown","south-mini.png",i.add(0,2*t.h),t),this._addButton("zoomin","zoom-plus-mini.png",i.add(0,3*t.h+5),t),i=this._addZoomBar(i.add(0,4*t.h+5)),this._addButton("zoomout","zoom-minus-mini.png",i,t)):(this._addButton("zoomin","zoom-plus-mini.png",n,t),i=this._addZoomBar(n.add(0,t.h)),this._addButton("zoomout","zoom-minus-mini.png",i,t),this.zoomWorldIcon&&(i=i.add(0,t.h+3),this._addButton("zoomworld","zoom-world-mini.png",i,t))),this.div},_addZoomBar:function(n){var u=OpenLayers.Util.getImagesLocation(),f=this.id+"_"+this.map.id,e=this.map.getNumZoomLevels()-1-this.map.getZoom(),r=OpenLayers.Util.createAlphaImageDiv(f,n.add(-1,e*this.zoomStopHeight),new OpenLayers.Size(20,9),u+"slider.png","absolute"),i,t;return r.style.cursor="move",this.slider=r,this.sliderEvents=new OpenLayers.Events(this,r,null,!0,{includeXY:!0}),this.sliderEvents.on({touchstart:this.zoomBarDown,touchmove:this.zoomBarDrag,touchend:this.zoomBarUp,mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick}),i=new OpenLayers.Size,i.h=this.zoomStopHeight*this.map.getNumZoomLevels(),i.w=this.zoomStopWidth,t=null,OpenLayers.Util.alphaHack()?(f=this.id+"_"+this.map.id,t=OpenLayers.Util.createAlphaImageDiv(f,n,new OpenLayers.Size(i.w,this.zoomStopHeight),u+"zoombar.png","absolute",null,"crop"),t.style.height=i.h+"px"):t=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,n,i,u+"zoombar.png"),t.style.cursor="pointer",this.zoombarDiv=t,this.divEvents=new OpenLayers.Events(this,t,null,!0,{includeXY:!0}),this.divEvents.on({touchmove:this.passEventToSlider,mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick}),this.div.appendChild(t),this.startTop=parseInt(t.style.top),this.div.appendChild(r),this.map.events.register("zoomend",this,this.moveZoomBar),n=n.add(0,this.zoomStopHeight*this.map.getNumZoomLevels())},_removeZoomBar:function(){this.sliderEvents.un({touchmove:this.zoomBarDrag,mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});this.sliderEvents.destroy();this.divEvents.un({touchmove:this.passEventToSlider,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(n){this.sliderEvents.handleBrowserEvent(n)},divClick:function(n){var t,i;OpenLayers.Event.isLeftClick(n)&&(t=n.xy.y/this.zoomStopHeight,(this.forceFixedZoomLevel||!this.map.fractionalZoom)&&(t=Math.floor(t)),i=this.map.getNumZoomLevels()-1-t,i=Math.min(Math.max(i,0),this.map.getNumZoomLevels()-1),this.map.zoomTo(i),OpenLayers.Event.stop(n))},zoomBarDown:function(n){(OpenLayers.Event.isLeftClick(n)||OpenLayers.Event.isSingleTouch(n))&&(this.map.events.on({touchmove:this.passEventToSlider,mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this}),this.mouseDragStart=n.xy.clone(),this.zoomStart=n.xy.clone(),this.div.style.cursor="move",this.zoombarDiv.offsets=null,OpenLayers.Event.stop(n))},zoomBarDrag:function(n){var i,t,r;null!=this.mouseDragStart&&(i=this.mouseDragStart.y-n.xy.y,t=OpenLayers.Util.pagePosition(this.zoombarDiv),n.clientY-t[1]>0&&n.clientY-t[1]<parseInt(this.zoombarDiv.style.height)-2&&(r=parseInt(this.slider.style.top)-i,this.slider.style.top=r+"px",this.mouseDragStart=n.xy.clone()),this.deltaY=this.zoomStart.y-n.xy.y,OpenLayers.Event.stop(n))},zoomBarUp:function(n){if((OpenLayers.Event.isLeftClick(n)||"touchend"===n.type)&&this.mouseDragStart){this.div.style.cursor="";this.map.events.un({touchmove:this.passEventToSlider,mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var t=this.map.zoom;!this.forceFixedZoomLevel&&this.map.fractionalZoom?(t+=this.deltaY/this.zoomStopHeight,t=Math.min(Math.max(t,0),this.map.getNumZoomLevels()-1)):(t+=this.deltaY/this.zoomStopHeight,t=Math.max(Math.round(t),0));this.map.zoomTo(t);this.mouseDragStart=null;this.zoomStart=null;this.deltaY=0;OpenLayers.Event.stop(n)}},moveZoomBar:function(){var n=(this.map.getNumZoomLevels()-1-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=n+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!0,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(n,t,i,r,u){this.url=t;this.extent=i;this.maxExtent=i;this.size=r;OpenLayers.Layer.prototype.initialize.apply(this,[n,u]);this.aspectRatio=this.extent.getHeight()/this.size.h/(this.extent.getWidth()/this.size.w)},destroy:function(){this.tile&&(this.removeTileMonitoringHooks(this.tile),this.tile.destroy(),this.tile=null);OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.getOptions())),n=OpenLayers.Layer.prototype.clone.apply(this,[n])},setMap:function(){null==this.options.maxResolution&&(this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w);OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(n,t){var i,u,r;OpenLayers.Layer.prototype.moveTo.apply(this,arguments);i=null==this.tile;(t||i)&&(this.setTileSize(),u=new OpenLayers.LonLat(this.extent.left,this.extent.top),r=this.map.getLayerPxFromLonLat(u),i?(this.tile=new OpenLayers.Tile.Image(this,r,this.extent,null,this.tileSize),this.addTileMonitoringHooks(this.tile)):(this.tile.size=this.tileSize.clone(),this.tile.position=r.clone()),this.tile.draw())},setTileSize:function(){var n=this.extent.getWidth()/this.map.getResolution(),t=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(n,t)},addTileMonitoringHooks:function(n){n.onLoadStart=function(){this.events.triggerEvent("loadstart")};n.events.register("loadstart",this,n.onLoadStart);n.onLoadEnd=function(){this.events.triggerEvent("loadend")};n.events.register("loadend",this,n.onLoadEnd);n.events.register("unload",this,n.onLoadEnd)},removeTileMonitoringHooks:function(n){n.unload();n.events.un({loadstart:n.onLoadStart,loadend:n.onLoadEnd,unload:n.onLoadEnd,scope:this})},setUrl:function(n){this.url=n;this.tile.draw()},getURL:function(){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:!0,autoDestroy:!0,initialize:function(n){OpenLayers.Util.extend(this,n);this.options=n;this.active=!1},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(n){this.layer=n},activate:function(){return this.active?!1:(this.active=!0,!0)},deactivate:function(){return this.active?(this.active=!1,!0):!1},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{EVENT_TYPES:["start","success","fail"],events:null,auto:!1,timer:null,initialize:function(n){OpenLayers.Strategy.prototype.initialize.apply(this,[n]);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);return n&&this.auto&&("number"==typeof this.auto?this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),1e3*this.auto):this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})),n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&this.auto&&("number"==typeof this.auto?window.clearInterval(this.timer):this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})),n},triggerSave:function(n){var t=n.feature;(t.state===OpenLayers.State.INSERT||t.state===OpenLayers.State.UPDATE||t.state===OpenLayers.State.DELETE)&&this.save([n.feature])},save:function(n){var u,f;if(n||(n=this.layer.features),this.events.triggerEvent("start",{features:n}),u=this.layer.projection,f=this.layer.map.getProjectionObject(),!f.equals(u)){for(var t,i,e=n.length,o=Array(e),r=0;e>r;++r)t=n[r],i=t.clone(),i.fid=t.fid,i.state=t.state,t.url&&(i.url=t.url),i._original=t,i.geometry.transform(f,u),o[r]=i;n=o}this.layer.protocol.commit(n,{callback:this.onCommit,scope:this})},onCommit:function(n){var f={response:n};if(n.success()){for(var i,t,e=n.reqFeatures,r=[],s=n.insertIds||[],o=0,u=0,h=e.length;h>u;++u)t=e[u],t=t._original||t,i=t.state,i&&(i==OpenLayers.State.DELETE?r.push(t):i==OpenLayers.State.INSERT&&(t.fid=s[o],++o),t.state=null);r.length>0&&this.layer.destroyFeatures(r);this.events.triggerEvent("success",f)}else this.events.triggerEvent("fail",f)},CLASS_NAME:"OpenLayers.Strategy.Save"});OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{extractWaypoints:!0,extractTracks:!0,extractRoutes:!0,extractAttributes:!0,initialize:function(n){this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var i,v,y,t,p,s,w;if("string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),i=[],this.extractTracks)for(var f=n.getElementsByTagName("trk"),r=0,l=f.length;l>r;r++){t={};this.extractAttributes&&(t=this.parseAttributes(f[r]));for(var a=this.getElementsByTagNameNS(f[r],f[r].namespaceURI,"trkseg"),h=0,b=a.length;b>h;h++)v=this.extractSegment(a[h],"trkpt"),i.push(new OpenLayers.Feature.Vector(v,t))}if(this.extractRoutes)for(var c=n.getElementsByTagName("rte"),e=0,k=c.length;k>e;e++)t={},this.extractAttributes&&(t=this.parseAttributes(c[e])),y=this.extractSegment(c[e],"rtept"),i.push(new OpenLayers.Feature.Vector(y,t));if(this.extractWaypoints)for(var o=n.getElementsByTagName("wpt"),u=0,l=o.length;l>u;u++)t={},this.extractAttributes&&(t=this.parseAttributes(o[u])),p=new OpenLayers.Geometry.Point(o[u].getAttribute("lon"),o[u].getAttribute("lat")),i.push(new OpenLayers.Feature.Vector(p,t));if(this.internalProjection&&this.externalProjection)for(s=0,w=i.length;w>s;s++)i[s].geometry.transform(this.externalProjection,this.internalProjection);return i},extractSegment:function(n,t){for(var r=this.getElementsByTagNameNS(n,n.namespaceURI,t),u=[],i=0,f=r.length;f>i;i++)u.push(new OpenLayers.Geometry.Point(r[i].getAttribute("lon"),r[i].getAttribute("lat")));return new OpenLayers.Geometry.LineString(u)},parseAttributes:function(n){for(var i,r,u={},t=n.firstChild;t;)1==t.nodeType&&(i=t.firstChild,(3==i.nodeType||4==i.nodeType)&&(r=t.prefix?t.nodeName.split(":")[1]:t.nodeName,"trkseg"!=r&&"rtept"!=r&&(u[r]=i.nodeValue))),t=t.nextSibling;return u},CLASS_NAME:"OpenLayers.Format.GPX"});OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",getVersion:function(){var n=OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this,arguments);return("1.1.1"==n||"1.1.0"==n)&&(n="1.1"),n},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"});OpenLayers.Format.WMSDescribeLayer.v1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(n){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[n])},read:function(n){var f;"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));for(var t,o,c=n.documentElement,s=c.childNodes,h=[],e=0;s.length>e;++e)if(t=s[e],o=t.nodeName,"LayerDescription"==o){var l=t.getAttribute("name"),i="",r="",u="";t.getAttribute("owsType")?(i=t.getAttribute("owsType"),r=t.getAttribute("owsURL")):""!=t.getAttribute("wfs")?(i="WFS",r=t.getAttribute("wfs")):""!=t.getAttribute("wcs")&&(i="WCS",r=t.getAttribute("wcs"));f=t.getElementsByTagName("Query");f.length>0&&(u=f[0].getAttribute("typeName"),u||(u=f[0].getAttribute("typename")));h.push({layerName:l,owsType:i,owsURL:r,typeName:u})}return h},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1"});OpenLayers.Format.XLS=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",stringifyOutput:!0,CLASS_NAME:"OpenLayers.Format.XLS"});OpenLayers.Format.XLS.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xls:"http://www.opengis.net/xls",gml:"http://www.opengis.net/gml",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},xy:!0,defaultPrefix:"xls",schemaLocation:null,initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i={};return this.readChildNodes(n,i),i},readers:{xls:{XLS:function(n,t){t.version=n.getAttribute("version");this.readChildNodes(n,t)},Response:function(n,t){this.readChildNodes(n,t)},GeocodeResponse:function(n,t){t.responseLists=[];this.readChildNodes(n,t)},GeocodeResponseList:function(n,t){var i={features:[],numberOfGeocodedAddresses:parseInt(n.getAttribute("numberOfGeocodedAddresses"))};t.responseLists.push(i);this.readChildNodes(n,i)},GeocodedAddress:function(n,t){var i=new OpenLayers.Feature.Vector;t.features.push(i);this.readChildNodes(n,i);i.geometry=i.components[0]},GeocodeMatchCode:function(n,t){t.attributes.matchCode={accuracy:parseFloat(n.getAttribute("accuracy")),matchType:n.getAttribute("matchType")}},Address:function(n,t){var i={countryCode:n.getAttribute("countryCode"),addressee:n.getAttribute("addressee"),street:[],place:[]};t.attributes.address=i;this.readChildNodes(n,i)},freeFormAddress:function(n,t){t.freeFormAddress=this.getChildValue(n)},StreetAddress:function(n,t){this.readChildNodes(n,t)},Building:function(n,t){t.building={number:n.getAttribute("number"),subdivision:n.getAttribute("subdivision"),buildingName:n.getAttribute("buildingName")}},Street:function(n,t){t.street.push(this.getChildValue(n))},Place:function(n,t){t.place[n.getAttribute("type")]=this.getChildValue(n)},PostalCode:function(n,t){t.postalCode=this.getChildValue(n)}},gml:OpenLayers.Format.GML.v3.prototype.readers.gml},write:function(n){return this.writers.xls.XLS.apply(this,[n])},writers:{xls:{XLS:function(n){var t=this.createElementNSPlus("xls:XLS",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});return this.writeNode("RequestHeader",n.header,t),this.writeNode("Request",n,t),t},RequestHeader:function(){return this.createElementNSPlus("xls:RequestHeader")},Request:function(n){var t=this.createElementNSPlus("xls:Request",{attributes:{methodName:"GeocodeRequest",requestID:n.requestID||"",version:this.VERSION}});return this.writeNode("GeocodeRequest",n.addresses,t),t},GeocodeRequest:function(n){for(var i=this.createElementNSPlus("xls:GeocodeRequest"),t=0,r=n.length;r>t;t++)this.writeNode("Address",n[t],i);return i},Address:function(n){var t=this.createElementNSPlus("xls:Address",{attributes:{countryCode:n.countryCode}});return n.freeFormAddress?this.writeNode("freeFormAddess",n.freeFormAddress,t):(n.street&&this.writeNode("StreetAddress",n,t),n.municipality&&this.writeNode("Municipality",n.municipality,t),n.countrySubdivision&&this.writeNode("CountrySubdivision",n.countrySubdivision,t),n.postalCode&&this.writeNode("PostalCode",n.postalCode,t)),t},freeFormAddress:function(n){return this.createElementNSPlus("freeFormAddress",{value:n})},StreetAddress:function(n){var r=this.createElementNSPlus("xls:StreetAddress"),t,i,u;for(n.building&&this.writeNode(r,"Building",n.building),t=n.street,OpenLayers.Util.isArray(t)||(t=[t]),i=0,u=t.length;u>i;i++)this.writeNode("Street",t[i],r);return r},Building:function(n){return this.createElementNSPlus("xls:Building",{attributes:{number:n.number,subdivision:n.subdivision,buildingName:n.buildingName}})},Street:function(n){return this.createElementNSPlus("xls:Street",{value:n})},Municipality:function(n){return this.createElementNSPlus("xls:Place",{attributes:{type:"Municipality"},value:n})},CountrySubdivision:function(n){return this.createElementNSPlus("xls:Place",{attributes:{type:"CountrySubdivision"},value:n})},PostalCode:function(n){return this.createElementNSPlus("xls:PostalCode",{value:n})}}},CLASS_NAME:"OpenLayers.Format.XLS.v1"});OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:!1,size:null,resolution:null,map:null,initialize:function(n,t){this.container=OpenLayers.Util.getElement(n);OpenLayers.Util.extend(this,t)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return!1},setExtent:function(n,t){this.extent=n.clone();t&&(this.resolution=null)},setSize:function(n){this.size=n.clone();this.resolution=null},getResolution:function(){return this.resolution=this.resolution||this.map.getResolution(),this.resolution},drawFeature:function(n,t){var i,r,u;if((null==t&&(t=n.style),n.geometry)&&(i=n.geometry.getBounds(),i)){if(i.intersectsBounds(this.extent)||(t={display:"none"}),r=this.drawGeometry(n.geometry,t,n.id),"none"!=t.display&&t.label&&r!==!1){if(u=n.geometry.getCentroid(),t.labelXOffset||t.labelYOffset){var e=isNaN(t.labelXOffset)?0:t.labelXOffset,o=isNaN(t.labelYOffset)?0:t.labelYOffset,f=this.getResolution();u.move(e*f,o*f)}this.drawText(n.id,t,u)}else this.removeText(n.id);return r}},drawGeometry:function(){},drawText:function(){},removeText:function(){},clear:function(){},getFeatureIdFromEvent:function(){},eraseFeatures:function(n){var t,r,i;for(OpenLayers.Util.isArray(n)||(n=[n]),t=0,r=n.length;r>t;++t)i=n[t],this.eraseGeometry(i.geometry,i.id),this.removeText(i.id)},eraseGeometry:function(){},moveRoot:function(){},getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(n){var t=OpenLayers.Util.extend({},OpenLayers.Renderer.defaultSymbolizer);return n.stroke===!1&&(delete t.strokeWidth,delete t.strokeColor),n.fill===!1&&delete t.fillColor,OpenLayers.Util.extend(t,n),t},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Renderer.defaultSymbolizer={fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1,pointRadius:0};OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{hitDetection:!0,hitOverflow:0,canvas:null,features:null,pendingRedraw:!1,initialize:function(){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);this.canvas=this.root.getContext("2d");this.features={};this.hitDetection&&(this.hitCanvas=document.createElement("canvas"),this.hitContext=this.hitCanvas.getContext("2d"))},eraseGeometry:function(n,t){this.eraseFeatures(this.features[t][0])},supported:function(){var n=document.createElement("canvas");return!!n.getContext},setSize:function(n){var t,i;this.size=n.clone();t=this.root;(t.style.width=n.w+"px",t.style.height=n.h+"px",t.width=n.w,t.height=n.h,this.resolution=null,this.hitDetection)&&(i=this.hitCanvas,i.style.width=n.w+"px",i.style.height=n.h+"px",i.width=n.w,i.height=n.h)},drawFeature:function(n,t){var i,r;return n.geometry&&(t=this.applyDefaultSymbolizer(t||n.style),r=n.geometry.getBounds(),i="none"!==t.display&&!!r&&r.intersectsBounds(this.extent),i?this.features[n.id]=[n,t]:delete this.features[n.id],this.pendingRedraw=!0),this.pendingRedraw&&!this.locked&&(this.redraw(),this.pendingRedraw=!1),i},drawGeometry:function(n,t,i){var r=n.CLASS_NAME,u;if("OpenLayers.Geometry.Collection"!=r&&"OpenLayers.Geometry.MultiPoint"!=r&&"OpenLayers.Geometry.MultiLineString"!=r&&"OpenLayers.Geometry.MultiPolygon"!=r)switch(n.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(n,t,i);break;case"OpenLayers.Geometry.LineString":this.drawLineString(n,t,i);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(n,t,i);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(n,t,i)}else for(u=0;n.components.length>u;u++)this.drawGeometry(n.components[u],t,i)},drawExternalGraphic:function(n,t,i){var f=new Image,r,u;t.graphicTitle&&(f.title=t.graphicTitle);r=t.graphicWidth||t.graphicHeight;u=t.graphicHeight||t.graphicWidth;r=r?r:2*t.pointRadius;u=u?u:2*t.pointRadius;var e=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*r),o=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*u),s=t.graphicOpacity||t.fillOpacity,h=function(){var t;if(this.features[i]){var h=this.getLocalXY(n),c=h[0],l=h[1];if(!isNaN(c)&&!isNaN(l)){var a=0|c+e,v=0|l+o,y=this.canvas;y.globalAlpha=s;t=OpenLayers.Renderer.Canvas.drawImageScaleFactor||(OpenLayers.Renderer.Canvas.drawImageScaleFactor=/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1);y.drawImage(f,a*t,v*t,r*t,u*t);this.hitDetection&&(this.setHitContextStyle("fill",i),this.hitContext.fillRect(a,v,r,u))}}};f.onload=OpenLayers.Function.bind(h,this);f.src=t.externalGraphic},setCanvasStyle:function(n,t){"fill"===n?(this.canvas.globalAlpha=t.fillOpacity,this.canvas.fillStyle=t.fillColor):"stroke"===n?(this.canvas.globalAlpha=t.strokeOpacity,this.canvas.strokeStyle=t.strokeColor,this.canvas.lineWidth=t.strokeWidth):(this.canvas.globalAlpha=0,this.canvas.lineWidth=1)},featureIdToHex:function(n){var t=Number(n.split("_").pop())+1,i,r;return t>=16777216&&(this.hitOverflow=t-16777215,t=t%16777216+1),i="000000"+t.toString(16),r=i.length,"#"+i.substring(r-6,r)},setHitContextStyle:function(n,t,i){var r=this.featureIdToHex(t);"fill"==n?(this.hitContext.globalAlpha=1,this.hitContext.fillStyle=r):"stroke"==n?(this.hitContext.globalAlpha=1,this.hitContext.strokeStyle=r,this.hitContext.lineWidth=i.strokeWidth+2):(this.hitContext.globalAlpha=0,this.hitContext.lineWidth=1)},drawPoint:function(n,t,i){var f,e;if(t.graphic!==!1)if(t.externalGraphic)this.drawExternalGraphic(n,t,i);else{var o=this.getLocalXY(n),r=o[0],u=o[1];isNaN(r)||isNaN(u)||(f=2*Math.PI,e=t.pointRadius,t.fill!==!1&&(this.setCanvasStyle("fill",t),this.canvas.beginPath(),this.canvas.arc(r,u,e,0,f,!0),this.canvas.fill(),this.hitDetection&&(this.setHitContextStyle("fill",i,t),this.hitContext.beginPath(),this.hitContext.arc(r,u,e,0,f,!0),this.hitContext.fill())),t.stroke!==!1&&(this.setCanvasStyle("stroke",t),this.canvas.beginPath(),this.canvas.arc(r,u,e,0,f,!0),this.canvas.stroke(),this.hitDetection&&(this.setHitContextStyle("stroke",i,t),this.hitContext.beginPath(),this.hitContext.arc(r,u,e,0,f,!0),this.hitContext.stroke()),this.setCanvasStyle("reset")))}},drawLineString:function(n,t,i){t=OpenLayers.Util.applyDefaults({fill:!1},t);this.drawLinearRing(n,t,i)},drawLinearRing:function(n,t,i){t.fill!==!1&&(this.setCanvasStyle("fill",t),this.renderPath(this.canvas,n,t,i,"fill"),this.hitDetection&&(this.setHitContextStyle("fill",i,t),this.renderPath(this.hitContext,n,t,i,"fill")));t.stroke!==!1&&(this.setCanvasStyle("stroke",t),this.renderPath(this.canvas,n,t,i,"stroke"),this.hitDetection&&(this.setHitContextStyle("stroke",i,t),this.renderPath(this.hitContext,n,t,i,"stroke")));this.setCanvasStyle("reset")},renderPath:function(n,t,i,r,u){var o=t.components,h=o.length,e,s;n.beginPath();var f=this.getLocalXY(o[0]),c=f[0],l=f[1];if(!isNaN(c)&&!isNaN(l)){for(n.moveTo(f[0],f[1]),e=1;h>e;++e)s=this.getLocalXY(o[e]),n.lineTo(s[0],s[1]);"fill"===u?n.fill():n.stroke()}},drawPolygon:function(n,t,i){var u=n.components,f=u.length,r;for(this.drawLinearRing(u[0],t,i),r=1;f>r;++r)this.canvas.globalCompositeOperation="destination-out",this.hitDetection&&(this.hitContext.globalCompositeOperation="destination-out"),this.drawLinearRing(u[r],OpenLayers.Util.applyDefaults({stroke:!1,fillOpacity:1},t),i),this.canvas.globalCompositeOperation="source-over",this.hitDetection&&(this.hitContext.globalCompositeOperation="source-over"),this.drawLinearRing(u[r],OpenLayers.Util.applyDefaults({fill:!1},t),i)},drawText:function(n,t){var u,s,r,f,i,h,c;t=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},t);u=this.getLocalXY(n);this.setCanvasStyle("reset");this.canvas.fillStyle=t.fontColor;this.canvas.globalAlpha=t.fontOpacity||1;var l=[t.fontStyle?t.fontStyle:"normal","normal",t.fontWeight?t.fontWeight:"normal",t.fontSize?t.fontSize:"1em",t.fontFamily?t.fontFamily:"sans-serif"].join(" "),e=t.label.split("\n"),o=e.length;if(this.canvas.fillText)for(this.canvas.font=l,this.canvas.textAlign=OpenLayers.Renderer.Canvas.LABEL_ALIGN[t.labelAlign[0]]||"center",this.canvas.textBaseline=OpenLayers.Renderer.Canvas.LABEL_ALIGN[t.labelAlign[1]]||"middle",r=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[1]],null==r&&(r=-.5),f=this.canvas.measureText("Mg").height||this.canvas.measureText("xx").width,u[1]+=f*r*(o-1),i=0;o>i;i++)this.canvas.fillText(e[i],u[0],u[1]+f*i);else if(this.canvas.mozDrawText)for(this.canvas.mozTextStyle=l,s=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[0]],null==s&&(s=-.5),r=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[1]],null==r&&(r=-.5),f=this.canvas.mozMeasureText("xx"),u[1]+=f*(1+r*o),i=0;o>i;i++)h=u[0]+s*this.canvas.mozMeasureText(e[i]),c=u[1]+i*f,this.canvas.translate(h,c),this.canvas.mozDrawText(e[i]),this.canvas.translate(-h,-c);this.setCanvasStyle("reset")},getLocalXY:function(n){var t=this.getResolution(),i=this.extent,r=n.x/t+-i.left/t,u=i.top/t-n.y/t;return[r,u]},clear:function(){var n=this.root.height,t=this.root.width;this.canvas.clearRect(0,0,t,n);this.features={};this.hitDetection&&this.hitContext.clearRect(0,0,t,n)},getFeatureIdFromEvent:function(n){var r=null,i;if(this.hitDetection&&!this.map.dragging){var u=n.xy,f=0|u.x,e=0|u.y,t=this.hitContext.getImageData(f,e,1,1).data;255===t[3]&&(i=t[2]+256*(t[1]+256*t[0]),i&&(r=this.features["OpenLayers.Feature.Vector_"+(i-1+this.hitOverflow)][0]))}return r},eraseFeatures:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var t=0;n.length>t;++t)delete this.features[n[t].id];this.redraw()},redraw:function(){var f,e,n,t,i,r,o,u,s;if(!this.locked){f=this.root.height;e=this.root.width;this.canvas.clearRect(0,0,e,f);this.hitDetection&&this.hitContext.clearRect(0,0,e,f);i=[];for(r in this.features)this.features.hasOwnProperty(r)&&(n=this.features[r][0],t=this.features[r][1],this.drawGeometry(n.geometry,t,n.id),t.label&&i.push([n,t]));for(u=0,s=i.length;s>u;++u)o=i[u],this.drawText(o[0].geometry.getCentroid(),o[1])}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right",t:"top",b:"bottom"};OpenLayers.Renderer.Canvas.LABEL_FACTOR={l:0,r:-1,t:0,b:-1};OpenLayers.Renderer.Canvas.drawImageScaleFactor=null;OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:!1,interestingTagsExclude:null,areaTags:null,initialize:function(n){var t={interestingTagsExclude:["source","source_ref","source:ref","history","attribution","created_by"],areaTags:["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]},r,u,i;for(t=OpenLayers.Util.extend(t,n),r={},i=0;t.interestingTagsExclude.length>i;i++)r[t.interestingTagsExclude[i]]=!0;for(t.interestingTagsExclude=r,u={},i=0;t.areaTags.length>i;i++)u[t.areaTags[i]]=!0;t.areaTags=u;this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[t])},read:function(n){var l,e,a,t,o,v,i;"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));for(var s=this.getNodes(n),u=this.getWays(n),h=Array(u.length),r=0;u.length>r;r++){for(var c=Array(u[r].nodes.length),y=this.isWayArea(u[r])?1:0,f=0;u[r].nodes.length>f;f++)t=s[u[r].nodes[f]],l=new OpenLayers.Geometry.Point(t.lon,t.lat),l.osm_id=parseInt(u[r].nodes[f]),c[f]=l,t.used=!0;e=null;e=y?new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(c)):new OpenLayers.Geometry.LineString(c);this.internalProjection&&this.externalProjection&&e.transform(this.externalProjection,this.internalProjection);i=new OpenLayers.Feature.Vector(e,u[r].tags);i.osm_id=parseInt(u[r].id);i.fid="way."+i.osm_id;h[r]=i}for(a in s){if(t=s[a],!t.used||this.checkTags){if(o=null,this.checkTags){if(v=this.getTags(t.node,!0),t.used&&!v[1])continue;o=v[0]}else o=this.getTags(t.node);i=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat),o);this.internalProjection&&this.externalProjection&&i.geometry.transform(this.externalProjection,this.internalProjection);i.osm_id=parseInt(a);i.fid="node."+i.osm_id;h.push(i)}t.node=null}return h},getNodes:function(n){for(var t,f,r=n.getElementsByTagName("node"),u={},i=0;r.length>i;i++)t=r[i],f=t.getAttribute("id"),u[f]={lat:t.getAttribute("lat"),lon:t.getAttribute("lon"),node:t};return u},getWays:function(n){for(var r,t,u,i,e=n.getElementsByTagName("way"),o=[],f=0;e.length>f;f++){for(r=e[f],t={id:r.getAttribute("id")},t.tags=this.getTags(r),u=r.getElementsByTagName("nd"),t.nodes=Array(u.length),i=0;u.length>i;i++)t.nodes[i]=u[i].getAttribute("ref");o.push(t)}return o},getTags:function(n,t){for(var f,r=n.getElementsByTagName("tag"),u={},e=!1,i=0;r.length>i;i++)f=r[i].getAttribute("k"),u[f]=r[i].getAttribute("v"),t&&(this.interestingTagsExclude[f]||(e=!0));return t?[u,e]:u},isWayArea:function(n){var t=!1,i=!1,r;if(n.nodes[0]==n.nodes[n.nodes.length-1]&&(t=!0),this.checkTags)for(r in n.tags)if(this.areaTags[r]){i=!0;break}return t&&(this.checkTags?i:!0)},write:function(n){var t,i,u,r;for(OpenLayers.Util.isArray(n)||(n=[n]),this.osm_id=1,this.created_nodes={},t=this.createElementNS(null,"osm"),t.setAttribute("version","0.5"),t.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER),i=n.length-1;i>=0;i--)for(u=this.createFeatureNodes(n[i]),r=0;u.length>r;r++)t.appendChild(u[r]);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureNodes:function(n){var r=[],u=n.geometry.CLASS_NAME,t=u.substring(u.lastIndexOf(".")+1),i;return t=t.toLowerCase(),i=this.createXML[t],i&&(r=i.apply(this,[n])),r},createXML:{point:function(n){var i=null,r=n.geometry?n.geometry:n,u,t;return this.internalProjection&&this.externalProjection&&(r=r.clone(),r.transform(this.internalProjection,this.externalProjection)),u=!1,t=(n.osm_id?(i=n.osm_id,this.created_nodes[i]&&(u=!0)):(i=-this.osm_id,this.osm_id++),u)?this.created_nodes[i]:this.createElementNS(null,"node"),this.created_nodes[i]=t,t.setAttribute("id",i),t.setAttribute("lon",r.x),t.setAttribute("lat",r.y),n.attributes&&this.serializeTags(n,t),this.setState(n,t),u?[]:[t]},linestring:function(n){var f,e=[],o=n.geometry,i,r,t,u,s;for(n.osm_id?f=n.osm_id:(f=-this.osm_id,this.osm_id++),i=this.createElementNS(null,"way"),i.setAttribute("id",f),r=0;o.components.length>r;r++)t=this.createXML.point.apply(this,[o.components[r]]),t.length?(t=t[0],u=t.getAttribute("id"),e.push(t)):(u=o.components[r].osm_id,t=this.created_nodes[u]),this.setState(n,t),s=this.createElementNS(null,"nd"),s.setAttribute("ref",u),i.appendChild(s);return this.serializeTags(n,i),e.push(i),e},polygon:function(n){var i=OpenLayers.Util.extend({area:"yes"},n.attributes),t=new OpenLayers.Feature.Vector(n.geometry.components[0],i);return t.osm_id=n.osm_id,this.createXML.linestring.apply(this,[t])}},serializeTags:function(n,t){var r,i;for(r in n.attributes)i=this.createElementNS(null,"tag"),i.setAttribute("k",r),i.setAttribute("v",n.attributes[r]),t.appendChild(i)},setState:function(n,t){if(n.state){var i=null;switch(n.state){case OpenLayers.State.UPDATE:i="modify";case OpenLayers.State.DELETE:i="delete"}i&&t.setAttribute("action",i)}},CLASS_NAME:"OpenLayers.Format.OSM"});OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:!1,evt:null,initialize:function(n,t,i){OpenLayers.Util.extend(this,i);this.control=n;this.callbacks=t;var r=this.map||n.map;r&&this.setMap(r);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(n){this.map=n},checkModifiers:function(n){if(null==this.keyMask)return!0;var t=(n.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(n.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(n.altKey?OpenLayers.Handler.MOD_ALT:0);return t==this.keyMask},activate:function(){if(this.active)return!1;for(var t=OpenLayers.Events.prototype.BROWSER_EVENTS,n=0,i=t.length;i>n;n++)this[t[n]]&&this.register(t[n],this[t[n]]);return this.active=!0,!0},deactivate:function(){if(!this.active)return!1;for(var t=OpenLayers.Events.prototype.BROWSER_EVENTS,n=0,i=t.length;i>n;n++)this[t[n]]&&this.unregister(t[n],this[t[n]]);return this.active=!1,!0},callback:function(n,t){n&&this.callbacks[n]&&this.callbacks[n].apply(this.control,t)},register:function(n,t){this.map.events.registerPriority(n,this,t);this.map.events.registerPriority(n,this,this.setEvent)},unregister:function(n,t){this.map.events.unregister(n,this,t);this.map.events.unregister(n,this,this.setEvent)},setEvent:function(n){return this.evt=n,!0},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!0,dragging:!1,touch:!1,last:null,start:null,lastMoveEvt:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:!1,documentEvents:null,initialize:function(){if(OpenLayers.Handler.prototype.initialize.apply(this,arguments),this.documentDrag===!0){var n=this;this._docMove=function(t){n.mousemove({xy:{x:t.clientX,y:t.clientY},element:document})};this._docUp=function(t){n.mouseup({xy:{x:t.clientX,y:t.clientY}})}}},dragstart:function(n){var t=!0;return this.dragging=!1,this.checkModifiers(n)&&(OpenLayers.Event.isLeftClick(n)||OpenLayers.Event.isSingleTouch(n))?(this.started=!0,this.start=n.xy,this.last=n.xy,OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown"),this.down(n),this.callback("down",[n.xy]),OpenLayers.Event.stop(n),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart?document.onselectstart:OpenLayers.Function.True),document.onselectstart=OpenLayers.Function.False,t=!this.stopDown):(this.started=!1,this.start=null,this.last=null),t},dragmove:function(n){return this.lastMoveEvt=n,!this.started||this.timeoutId||n.xy.x==this.last.x&&n.xy.y==this.last.y||(this.documentDrag===!0&&this.documentEvents&&(n.element===document?(this.adjustXY(n),this.setEvent(n)):this.removeDocumentEvents()),this.interval>0&&(this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)),this.dragging=!0,this.move(n),this.callback("move",[n.xy]),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart,document.onselectstart=OpenLayers.Function.False),this.last=n.xy),!0},dragend:function(n){if(this.started){this.documentDrag===!0&&this.documentEvents&&(this.adjustXY(n),this.removeDocumentEvents());var t=this.start!=this.last;this.started=!1;this.dragging=!1;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(n);this.callback("up",[n.xy]);t&&this.callback("done",[n.xy]);document.onselectstart=this.oldOnselectstart}return!0},down:function(){},move:function(){},up:function(){},out:function(){},mousedown:function(n){return this.dragstart(n)},touchstart:function(n){return this.touch||(this.touch=!0,this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,scope:this})),this.dragstart(n)},mousemove:function(n){return this.dragmove(n)},touchmove:function(n){return this.dragmove(n)},removeTimeout:function(){this.timeoutId=null;this.dragging&&this.mousemove(this.lastMoveEvt)},mouseup:function(n){return this.dragend(n)},touchend:function(n){return n.xy=this.last,this.dragend(n)},mouseout:function(n){if(this.started&&OpenLayers.Util.mouseLeft(n,this.map.eventsDiv))if(this.documentDrag===!0)this.addDocumentEvents();else{var t=this.start!=this.last;this.started=!1;this.dragging=!1;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(n);this.callback("out",[]);t&&this.callback("done",[n.xy]);document.onselectstart&&(document.onselectstart=this.oldOnselectstart)}return!0},click:function(){return this.start==this.last},activate:function(){var n=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.dragging=!1,n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.touch=!1,this.started=!1,this.dragging=!1,this.start=null,this.last=null,n=!0,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")),n},adjustXY:function(n){var t=OpenLayers.Util.pagePosition(this.map.viewPortDiv);n.xy.x-=t[0];n.xy.y-=t[1]},addDocumentEvents:function(){OpenLayers.Element.addClass(document.body,"olDragDown");this.documentEvents=!0;OpenLayers.Event.observe(document,"mousemove",this._docMove);OpenLayers.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown");this.documentEvents=!1;OpenLayers.Event.stopObserving(document,"mousemove",this._docMove);OpenLayers.Event.stopObserving(document,"mouseup",this._docUp)},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null},touchstart:{"in":"click",out:"clickout"}},feature:null,lastFeature:null,down:null,up:null,touch:!1,clickTolerance:4,geometryTypes:null,stopClick:!0,stopDown:!0,stopUp:!1,initialize:function(n,t,i,r){OpenLayers.Handler.prototype.initialize.apply(this,[n,i,r]);this.layer=t},touchstart:function(n){return this.touch||(this.touch=!0,this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,dblclick:this.dblclick,scope:this})),OpenLayers.Event.isMultiTouch(n)?!0:this.mousedown(n)},touchmove:function(n){OpenLayers.Event.stop(n)},mousedown:function(n){return this.down=n.xy,this.handle(n)?!this.stopDown:!0},mouseup:function(n){return this.up=n.xy,this.handle(n)?!this.stopUp:!0},click:function(n){return this.handle(n)?!this.stopClick:!0},mousemove:function(n){return this.callbacks.over||this.callbacks.out?(this.handle(n),!0):!0},dblclick:function(n){return!this.handle(n)},geometryTypeMatches:function(n){return null==this.geometryTypes||OpenLayers.Util.indexOf(this.geometryTypes,n.geometry.CLASS_NAME)>-1},handle:function(n){var u;this.feature&&!this.feature.layer&&(this.feature=null);var t=n.type,f=!1,i=!!this.feature,r="click"==t||"dblclick"==t||"touchstart"==t;return(this.feature=this.layer.getFeatureFromEvent(n),this.feature&&!this.feature.layer&&(this.feature=null),this.lastFeature&&!this.lastFeature.layer&&(this.lastFeature=null),this.feature)?("touchstart"===t&&OpenLayers.Event.stop(n),u=this.feature!=this.lastFeature,this.geometryTypeMatches(this.feature)?(i&&u?(this.lastFeature&&this.triggerCallback(t,"out",[this.lastFeature]),this.triggerCallback(t,"in",[this.feature])):(!i||r)&&this.triggerCallback(t,"in",[this.feature]),this.lastFeature=this.feature,f=!0):(this.lastFeature&&(i&&u||r)&&this.triggerCallback(t,"out",[this.lastFeature]),this.feature=null)):this.lastFeature&&(i||r)&&this.triggerCallback(t,"out",[this.lastFeature]),f},triggerCallback:function(n,t,i){var r=this.EVENTMAP[n][t],u;r&&("click"==n&&this.up&&this.down?(u=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2)),this.clickTolerance>=u&&this.callback(r,i)):this.callback(r,i))},activate:function(){var n=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.moveLayerBack(),this.feature=null,this.lastFeature=null,this.down=null,this.up=null,this.touch=!1,this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),n=!0),n},handleMapEvents:function(n){("removelayer"==n.type||"order"==n.property)&&this.moveLayerToTop()},moveLayerToTop:function(){var n=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(n)},moveLayerBack:function(){var n=this.layer.getZIndex()-1;n>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(n):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(){},onDrag:function(){},onComplete:function(){},onEnter:function(){},onLeave:function(){},documentDrag:!1,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]);this.layer=n;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{documentDrag:this.documentDrag}),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},clickFeature:function(n){this.handlers.feature.touch&&!this.over&&this.overFeature(n)&&(this.handlers.drag.dragstart(this.handlers.feature.evt),this.handlers.drag.stopDown=!1)},clickoutFeature:function(n){this.handlers.feature.touch&&this.over&&(this.outFeature(n),this.handlers.drag.stopDown=!0)},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.handlers.drag.deactivate(),this.handlers.feature.deactivate(),this.feature=null,this.dragging=!1,this.lastPixel=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(n){var t=!1;return this.handlers.drag.dragging?this.over=this.feature.id==n.id?!0:!1:(this.feature=n,this.handlers.drag.activate(),t=!0,this.over=!0,OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onEnter(n)),t},downFeature:function(n){this.lastPixel=n;this.onStart(this.feature,n)},moveFeature:function(n){var t=this.map.getResolution();this.feature.geometry.move(t*(n.x-this.lastPixel.x),t*(this.lastPixel.y-n.y));this.layer.drawFeature(this.feature);this.lastPixel=n;this.onDrag(this.feature,n)},upFeature:function(){this.over||this.handlers.drag.deactivate()},doneDragging:function(n){this.onComplete(this.feature,n)},outFeature:function(n){this.handlers.drag.dragging?this.feature.id==n.id&&(this.over=!1):(this.over=!1,this.handlers.drag.deactivate(),OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onLeave(n),this.feature=null)},cancel:function(){this.handlers.drag.deactivate();this.over=!1},setMap:function(n){this.handlers.drag.setMap(n);this.handlers.feature.setMap(n);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:!0,initialize:function(n,t){if(this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])},n instanceof OpenLayers.Style)this.styles["default"]=n,this.styles.select=n,this.styles.temporary=n,this.styles["delete"]=n;else if("object"==typeof n)for(var i in n)if(n[i]instanceof OpenLayers.Style)this.styles[i]=n[i];else{if("object"!=typeof n[i]){this.styles["default"]=new OpenLayers.Style(n);this.styles.select=new OpenLayers.Style(n);this.styles.temporary=new OpenLayers.Style(n);this.styles["delete"]=new OpenLayers.Style(n);break}this.styles[i]=new OpenLayers.Style(n[i])}OpenLayers.Util.extend(this,t)},destroy:function(){for(var n in this.styles)this.styles[n].destroy();this.styles=null},createSymbolizer:function(n,t){n||(n=new OpenLayers.Feature.Vector);this.styles[t]||(t="default");n.renderIntent=t;var i={};return this.extendDefault&&"default"!=t&&(i=this.styles["default"].createSymbolizer(n)),OpenLayers.Util.extend(i,this.styles[t].createSymbolizer(n))},addUniqueValueRules:function(n,t,i,r){var u=[];for(var f in i)u.push(new OpenLayers.Rule({symbolizer:i[f],context:r,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:t,value:f})}));this.styles[n].addRules(u)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","beforefeaturesremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","vertexremoved","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:!1,isFixed:!1,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:!0,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:!1,initialize:function(){if(this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES),OpenLayers.Layer.prototype.initialize.apply(this,arguments),this.renderer&&this.renderer.supported()||this.assignRenderer(),this.renderer&&this.renderer.supported()||(this.renderer=null,this.displayError()),this.styleMap||(this.styleMap=new OpenLayers.StyleMap),this.features=[],this.selectedFeatures=[],this.unrenderedFeatures={},this.strategies)for(var n=0,t=this.strategies.length;t>n;n++)this.strategies[n].setLayer(this)},destroy:function(){if(this.strategies){for(var t,n=0,i=this.strategies.length;i>n;n++)t=this.strategies[n],t.autoDestroy&&t.destroy();this.strategies=null}this.protocol&&(this.protocol.autoDestroy&&this.protocol.destroy(),this.protocol=null);this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;this.renderer&&this.renderer.destroy();this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(n){null==n&&(n=new OpenLayers.Layer.Vector(this.name,this.getOptions()));n=OpenLayers.Layer.prototype.clone.apply(this,[n]);for(var i=this.features,r=i.length,u=Array(r),t=0;r>t;++t)u[t]=i[t].clone();return n.features=u,n},refresh:function(n){this.calculateInRange()&&this.visibility&&this.events.triggerEvent("refresh",n)},assignRenderer:function(){for(var t,i,n=0,r=this.renderers.length;r>n;n++)if(t=this.renderers[n],i="function"==typeof t?t:OpenLayers.Renderer[t],i&&i.prototype.supported()){this.renderer=new i(this.div,this.rendererOptions);break}},displayError:function(){this.reportError&&OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))},setMap:function(){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.renderer?(this.renderer.map=this.map,this.renderer.setSize(this.map.getSize())):this.map.removeLayer(this)},afterAdd:function(){if(this.strategies)for(var t,n=0,i=this.strategies.length;i>n;n++)t=this.strategies[n],t.autoActivate&&t.activate()},removeMap:function(){if(this.drawn=!1,this.strategies)for(var t,n=0,i=this.strategies.length;i>n;n++)t=this.strategies[n],t.autoActivate&&t.deactivate()},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(n,t,i){var e,u,s,f,r,o;if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),e=OpenLayers.Renderer.NG&&this.renderer instanceof OpenLayers.Renderer.NG,e)i||this.renderer.updateDimensions(t);else if(u=!0,!i&&(this.renderer.root.style.visibility="hidden",this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px",this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px",s=this.map.getExtent(),u=this.renderer.setExtent(s,t),this.renderer.root.style.visibility="visible",OpenLayers.IS_GECKO===!0&&(this.div.scrollLeft=this.div.scrollLeft),!t&&u))for(r in this.unrenderedFeatures)f=this.unrenderedFeatures[r],this.drawFeature(f);if(!this.drawn||!e&&(t||!u))for(this.drawn=!0,r=0,o=this.features.length;o>r;r++)this.renderer.locked=r!==o-1,f=this.features[r],this.drawFeature(f)},redraw:function(){return OpenLayers.Renderer.NG&&this.renderer instanceof OpenLayers.Renderer.NG&&(this.drawn=!1),OpenLayers.Layer.prototype.redraw.apply(this,arguments)},display:function(){OpenLayers.Layer.prototype.display.apply(this,arguments);var n=this.div.style.display;n!=this.renderer.root.style.display&&(this.renderer.root.style.display=n)},addFeatures:function(n,t){var r,f,e,i,s;if(OpenLayers.Util.isArray(n)||(n=[n]),r=!t||!t.silent,r){if(f={features:n},e=this.events.triggerEvent("beforefeaturesadded",f),e===!1)return;n=f.features}for(var o=[],u=0,h=n.length;h>u;u++){if(this.renderer.locked=u!=n.length-1?!0:!1,i=n[u],this.geometryType&&!(i.geometry instanceof this.geometryType)){s=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw s;}if(i.layer=this,!i.style&&this.style&&(i.style=OpenLayers.Util.extend({},this.style)),r){if(this.events.triggerEvent("beforefeatureadded",{feature:i})===!1)continue;this.preFeatureInsert(i)}o.push(i);this.features.push(i);this.drawFeature(i);r&&(this.events.triggerEvent("featureadded",{feature:i}),this.onFeatureInsert(i))}r&&this.events.triggerEvent("featuresadded",{features:o})},removeFeatures:function(n,t){var u,r,i;if(n&&0!==n.length){if(n===this.features)return this.removeAllFeatures(t);for(OpenLayers.Util.isArray(n)||(n=[n]),n===this.selectedFeatures&&(n=n.slice()),u=!t||!t.silent,u&&this.events.triggerEvent("beforefeaturesremoved",{features:n}),r=n.length-1;r>=0;r--)this.renderer.locked=0!=r&&n[r-1].geometry?!0:!1,i=n[r],delete this.unrenderedFeatures[i.id],u&&this.events.triggerEvent("beforefeatureremoved",{feature:i}),this.features=OpenLayers.Util.removeItem(this.features,i),i.layer=null,i.geometry&&this.renderer.eraseFeatures(i),-1!=OpenLayers.Util.indexOf(this.selectedFeatures,i)&&OpenLayers.Util.removeItem(this.selectedFeatures,i),u&&this.events.triggerEvent("featureremoved",{feature:i});u&&this.events.triggerEvent("featuresremoved",{features:n})}},removeAllFeatures:function(n){var t=!n||!n.silent,i=this.features,r,u;for(t&&this.events.triggerEvent("beforefeaturesremoved",{features:i}),u=i.length-1;u>=0;u--)r=i[u],t&&this.events.triggerEvent("beforefeatureremoved",{feature:r}),r.layer=null,t&&this.events.triggerEvent("featureremoved",{feature:r});this.renderer.clear();this.features=[];this.unrenderedFeatures={};this.selectedFeatures=[];t&&this.events.triggerEvent("featuresremoved",{features:i})},destroyFeatures:function(n,t){var r=void 0==n,i;if(r&&(n=this.features),n)for(this.removeFeatures(n,t),i=n.length-1;i>=0;i--)n[i].destroy()},drawFeature:function(n,t){var r,i;this.drawn&&("object"!=typeof t&&(t||n.state!==OpenLayers.State.DELETE||(t="delete"),r=t||n.renderIntent,t=n.style||this.style,t||(t=this.styleMap.createSymbolizer(n,r))),i=this.renderer.drawFeature(n,t),i===!1||null===i?this.unrenderedFeatures[n.id]=n:delete this.unrenderedFeatures[n.id])},eraseFeatures:function(n){this.renderer.eraseFeatures(n)},getFeatureFromEvent:function(n){if(!this.renderer)return OpenLayers.Console.error(OpenLayers.i18n("getFeatureError")),null;var i=null,t=this.renderer.getFeatureIdFromEvent(n);return t&&(i="string"==typeof t?this.getFeatureById(t):t),i},getFeatureBy:function(n,t){for(var r=null,i=0,u=this.features.length;u>i;++i)if(this.features[i][n]==t){r=this.features[i];break}return r},getFeatureById:function(n){return this.getFeatureBy("id",n)},getFeatureByFid:function(n){return this.getFeatureBy("fid",n)},getFeaturesByAttribute:function(n,t){for(var i,f=this.features.length,u=[],r=0;f>r;r++)i=this.features[r],i&&i.attributes&&i.attributes[n]===t&&u.push(i);return u},onFeatureInsert:function(){},preFeatureInsert:function(){},getDataExtent:function(){var n=null,t=this.features;if(t&&t.length>0)for(var i=null,r=0,u=t.length;u>r;r++)i=t[r].geometry,i&&(null===n&&(n=new OpenLayers.Bounds),n.extend(i.getBounds()));return n},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:!1,layers:null,initialize:function(){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(n){for(var i,r=this.layers,t=0;r.length>t;t++)if(i=r[t].getFeatureFromEvent(n))return i},setMap:function(n){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();n.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(n){n.events.unregister("changelayer",this,this.handleChangeLayer);this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){for(var n,t=0;this.map.layers.length>t;++t)n=this.map.layers[t],-1!=OpenLayers.Util.indexOf(this.layers,n)&&n.renderer.moveRoot(this.renderer)},resetRoots:function(){for(var n,t=0;this.layers.length>t;++t)n=this.layers[t],this.renderer&&n.renderer.getRenderLayerId()==this.id&&this.renderer.moveRoot(n.renderer)},handleChangeLayer:function(n){var t=n.layer;"order"==n.property&&-1!=OpenLayers.Util.indexOf(this.layers,t)&&(this.resetRoots(),this.collectRoots())},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],multipleKey:null,toggleKey:null,multiple:!1,clickout:!0,toggle:!1,hover:!1,highlightOnly:!1,box:!1,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(n,t){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[t]);null===this.scope&&(this.scope=this);this.initLayer(n);var i={click:this.clickFeature,clickout:this.clickoutFeature};this.hover&&(i.over=this.overFeature,i.out=this.outFeature);this.callbacks=OpenLayers.Util.extend(i,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"}))},initLayer:function(n){OpenLayers.Util.isArray(n)?(this.layers=n,this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:n})):this.layer=n},destroy:function(){this.active&&this.layers&&this.map.removeLayer(this.layer);OpenLayers.Control.prototype.destroy.apply(this,arguments);this.layers&&this.layer.destroy()},activate:function(){return this.active||(this.layers&&this.map.addLayer(this.layer),this.handlers.feature.activate(),this.box&&this.handlers.box&&this.handlers.box.activate()),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.active&&(this.handlers.feature.deactivate(),this.handlers.box&&this.handlers.box.deactivate(),this.layers&&this.map.removeLayer(this.layer)),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(n){for(var r,u,i,f=this.layers||[this.layer],t=0;f.length>t;++t)for(r=f[t],i=r.selectedFeatures.length-1;i>=0;--i)u=r.selectedFeatures[i],n&&n.except==u||this.unselect(u)},clickFeature:function(n){if(!this.hover){var t=OpenLayers.Util.indexOf(n.layer.selectedFeatures,n)>-1;t?this.toggleSelect()?this.unselect(n):this.multipleSelect()||this.unselectAll({except:n}):(this.multipleSelect()||this.unselectAll({except:n}),this.select(n))}},multipleSelect:function(){return this.multiple||this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey]},toggleSelect:function(){return this.toggle||this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey]},clickoutFeature:function(){!this.hover&&this.clickout&&this.unselectAll()},overFeature:function(n){var t=n.layer;this.hover&&(this.highlightOnly?this.highlight(n):-1==OpenLayers.Util.indexOf(t.selectedFeatures,n)&&this.select(n))},outFeature:function(n){if(this.hover)if(this.highlightOnly){if(n._lastHighlighter==this.id)if(n._prevHighlighter&&n._prevHighlighter!=this.id){delete n._lastHighlighter;var t=this.map.getControl(n._prevHighlighter);t&&t.highlight(n)}else this.unhighlight(n)}else this.unselect(n)},highlight:function(n){var i=n.layer,r=this.events.triggerEvent("beforefeaturehighlighted",{feature:n}),t;r!==!1&&(n._prevHighlighter=n._lastHighlighter,n._lastHighlighter=this.id,t=this.selectStyle||this.renderIntent,i.drawFeature(n,t),this.events.triggerEvent("featurehighlighted",{feature:n}))},unhighlight:function(n){var t=n.layer;void 0==n._prevHighlighter?delete n._lastHighlighter:n._prevHighlighter==this.id?delete n._prevHighlighter:(n._lastHighlighter=n._prevHighlighter,delete n._prevHighlighter);t.drawFeature(n,n.style||n.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:n})},select:function(n){var i=this.onBeforeSelect.call(this.scope,n),t=n.layer;i!==!1&&(i=t.events.triggerEvent("beforefeatureselected",{feature:n}),i!==!1&&(t.selectedFeatures.push(n),this.highlight(n),this.handlers.feature.lastFeature||(this.handlers.feature.lastFeature=t.selectedFeatures[0]),t.events.triggerEvent("featureselected",{feature:n}),this.onSelect.call(this.scope,n)))},unselect:function(n){var t=n.layer;this.unhighlight(n);OpenLayers.Util.removeItem(t.selectedFeatures,n);t.events.triggerEvent("featureunselected",{feature:n});this.onUnselect.call(this.scope,n)},selectBox:function(n){var s,i,f,r,u,h,t;if(n instanceof OpenLayers.Bounds){var e=this.map.getLonLatFromPixel(new OpenLayers.Pixel(n.left,n.bottom)),o=this.map.getLonLatFromPixel(new OpenLayers.Pixel(n.right,n.top)),c=new OpenLayers.Bounds(e.lon,e.lat,o.lon,o.lat);for(this.multipleSelect()||this.unselectAll(),s=this.multiple,this.multiple=!0,f=this.layers||[this.layer],r=0;f.length>r;++r)for(i=f[r],u=0,h=i.features.length;h>u;++u)t=i.features[u],t.getVisibility()&&(null==this.geometryTypes||OpenLayers.Util.indexOf(this.geometryTypes,t.geometry.CLASS_NAME)>-1)&&c.toGeometry().intersects(t.geometry)&&-1==OpenLayers.Util.indexOf(i.selectedFeatures,t)&&this.select(t);this.multiple=s}},setMap:function(n){this.handlers.feature.setMap(n);this.box&&this.handlers.box.setMap(n);OpenLayers.Control.prototype.setMap.apply(this,arguments)},setLayer:function(n){var t=this.active;this.unselectAll();this.deactivate();this.layers&&(this.layer.destroy(),this.layers=null);this.initLayer(n);this.handlers.feature.layer=this.layer;t&&this.activate()},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var n=0,t=this.KEY_EVENTS.length;t>n;n++)OpenLayers.Event.observe(document,this.KEY_EVENTS[n],this.eventListener);return!0}return!1},deactivate:function(){var t=!1,n,i;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(n=0,i=this.KEY_EVENTS.length;i>n;n++)OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[n],this.eventListener);t=!0}return t},handleKeyEvent:function(n){this.checkModifiers(n)&&this.callback(n.type,[n])},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:!0,toggle:!0,standalone:!1,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,vertexRenderIntent:null,mode:null,modified:!1,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(n,t){var i,r,u,f;t=t||{};this.layer=n;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer(null,t.vertexRenderIntent));this.virtualStyle.fillOpacity=.3;this.virtualStyle.strokeOpacity=.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[t]);OpenLayers.Util.isArray(this.deleteCodes)||(this.deleteCodes=[this.deleteCodes]);i=this;r={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};this.standalone===!1&&(this.selectControl=new OpenLayers.Control.SelectFeature(n,r));u={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(n,t){i.dragStart.apply(i,[n,t])},onDrag:function(n,t){i.dragVertex.apply(i,[n,t])},onComplete:function(n){i.dragComplete.apply(i,[n])},featureCallbacks:{over:function(n){(i.standalone!==!0||n._sketch||i.feature===n)&&i.dragControl.overFeature.apply(i.dragControl,[n])}}};this.dragControl=new OpenLayers.Control.DragFeature(n,u);f={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,f)}},destroy:function(){this.layer=null;this.standalone||this.selectControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.standalone||this.selectControl.activate())&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){var i=!1,n,t;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.layer.removeFeatures(this.vertices,{silent:!0}),this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.vertices=[],this.dragControl.deactivate(),n=this.feature,t=n&&n.geometry&&n.layer,this.standalone===!1?(t&&this.selectControl.unselect.apply(this.selectControl,[n]),this.selectControl.deactivate()):t&&this.unselectFeature(n),this.handlers.keyboard.deactivate(),i=!0),i},beforeSelectFeature:function(n){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:n})},selectFeature:function(n){this.standalone&&this.beforeSelectFeature(n)===!1||(this.feature=n,this.modified=!1,this.resetVertices(),this.dragControl.activate(),this.onModificationStart(this.feature));var t=n.modified;!n.geometry||t&&t.geometry||(this._originalGeometry=n.geometry.clone())},unselectFeature:function(n){this.layer.removeFeatures(this.vertices,{silent:!0});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:!0});this.virtualVertices=[];this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),delete this.dragHandle);this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),delete this.radiusHandle);this.feature=null;this.dragControl.deactivate();this.onModificationEnd(n);this.layer.events.triggerEvent("afterfeaturemodified",{feature:n,modified:this.modified});this.modified=!1},dragStart:function(n,t){n==this.feature||n.geometry.parent||n==this.dragHandle||n==this.radiusHandle||(this.standalone===!1&&this.feature&&this.selectControl.clickFeature.apply(this.selectControl,[this.feature]),(null==this.geometryTypes||-1!=OpenLayers.Util.indexOf(this.geometryTypes,n.geometry.CLASS_NAME))&&(this.standalone||this.selectControl.clickFeature.apply(this.selectControl,[n]),this.dragControl.overFeature.apply(this.dragControl,[n]),this.dragControl.lastPixel=t,this.dragControl.handlers.drag.started=!0,this.dragControl.handlers.drag.start=t,this.dragControl.handlers.drag.last=t))},dragVertex:function(n,t){this.modified=!0;"OpenLayers.Geometry.Point"==this.feature.geometry.CLASS_NAME?(this.feature!=n&&(this.feature=n),this.layer.events.triggerEvent("vertexmodified",{vertex:n.geometry,feature:this.feature,pixel:t})):(n._index?(n.geometry.parent.addComponent(n.geometry,n._index),delete n._index,OpenLayers.Util.removeItem(this.virtualVertices,n),this.vertices.push(n)):n==this.dragHandle?(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null)):n!==this.radiusHandle&&this.layer.events.triggerEvent("vertexmodified",{vertex:n.geometry,feature:this.feature,pixel:t}),this.virtualVertices.length>0&&(this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.layer.drawFeature(this.feature,this.standalone?void 0:this.selectControl.renderIntent));this.layer.drawFeature(n)},dragComplete:function(){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE&&(this.feature.state=OpenLayers.State.UPDATE,this.modified&&this._originalGeometry)){var n=this.feature;n.modified=OpenLayers.Util.extend(n.modified,{geometry:this._originalGeometry});delete this._originalGeometry}},resetVertices:function(){this.dragControl.feature&&this.dragControl.outFeature(this.dragControl.feature);this.vertices.length>0&&(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[]);this.virtualVertices.length>0&&(this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]);this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),this.dragHandle=null);this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null);this.feature&&"OpenLayers.Geometry.Point"!=this.feature.geometry.CLASS_NAME&&(this.mode&OpenLayers.Control.ModifyFeature.DRAG&&this.collectDragHandle(),this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE)&&this.collectRadiusHandle(),this.mode&OpenLayers.Control.ModifyFeature.RESHAPE&&(this.mode&OpenLayers.Control.ModifyFeature.RESIZE||this.collectVertices()))},handleKeypress:function(n){var i=n.keyCode,t;this.feature&&-1!=OpenLayers.Util.indexOf(this.deleteCodes,i)&&(t=this.dragControl.feature,t&&-1!=OpenLayers.Util.indexOf(this.vertices,t)&&!this.dragControl.handlers.drag.dragging&&t.geometry.parent&&(t.geometry.parent.removeComponent(t.geometry),this.layer.events.triggerEvent("vertexremoved",{vertex:t.geometry,feature:this.feature,pixel:n.xy}),this.layer.drawFeature(this.feature,this.standalone?void 0:this.selectControl.renderIntent),this.modified=!0,this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent("featuremodified",{feature:this.feature})))},collectVertices:function(){function t(i){var r,u,f,c,h,e,o;if("OpenLayers.Geometry.Point"==i.CLASS_NAME)u=new OpenLayers.Feature.Vector(i),u._sketch=!0,u.renderIntent=n.vertexRenderIntent,n.vertices.push(u);else{for(h=i.components.length,"OpenLayers.Geometry.LinearRing"==i.CLASS_NAME&&(h-=1),r=0;h>r;++r)f=i.components[r],"OpenLayers.Geometry.Point"==f.CLASS_NAME?(u=new OpenLayers.Feature.Vector(f),u._sketch=!0,u.renderIntent=n.vertexRenderIntent,n.vertices.push(u)):t(f);if("OpenLayers.Geometry.MultiPoint"!=i.CLASS_NAME)for(r=0,c=i.components.length;c-1>r;++r)if(e=i.components[r],o=i.components[r+1],"OpenLayers.Geometry.Point"==e.CLASS_NAME&&"OpenLayers.Geometry.Point"==o.CLASS_NAME){var l=(e.x+o.x)/2,a=(e.y+o.y)/2,s=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(l,a),null,n.virtualStyle);s.geometry.parent=i;s._index=r+1;s._sketch=!0;n.virtualVertices.push(s)}}}this.vertices=[];this.virtualVertices=[];var n=this;t.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:!0});this.layer.addFeatures(this.vertices,{silent:!0})},collectDragHandle:function(){var n=this.feature.geometry,t=n.getBounds().getCenterLonLat(),i=new OpenLayers.Geometry.Point(t.lon,t.lat),r=new OpenLayers.Feature.Vector(i);i.move=function(t,i){OpenLayers.Geometry.Point.prototype.move.call(this,t,i);n.move(t,i)};r._sketch=!0;this.dragHandle=r;this.layer.addFeatures([this.dragHandle],{silent:!0})},collectRadiusHandle:function(){var t=this.feature.geometry,i=t.getBounds(),r=i.getCenterLonLat(),n=new OpenLayers.Geometry.Point(r.lon,r.lat),u=new OpenLayers.Geometry.Point(i.right,i.bottom),f=new OpenLayers.Feature.Vector(u),e=this.mode&OpenLayers.Control.ModifyFeature.RESIZE,o=this.mode&OpenLayers.Control.ModifyFeature.RESHAPE,s=this.mode&OpenLayers.Control.ModifyFeature.ROTATE;u.move=function(i,r){var l,v,y,p;OpenLayers.Geometry.Point.prototype.move.call(this,i,r);var u=this.x-n.x,f=this.y-n.y,h=u-i,c=f-r;if(s){var w=Math.atan2(c,h),b=Math.atan2(f,u),a=b-w;a*=180/Math.PI;t.rotate(a,n)}e&&(o?(l=f/c,v=u/h/l):(y=Math.sqrt(h*h+c*c),p=Math.sqrt(u*u+f*f),l=p/y),t.resize(l,n,v))};f._sketch=!0;this.radiusHandle=f;this.layer.addFeatures([this.radiusHandle],{silent:!0})},setMap:function(n){this.standalone||this.selectControl.setMap(n);this.dragControl.setMap(n);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,sphericalMercator:!1,zoomOffset:0,serverResolutions:null,initialize:function(n,t,i){(i&&i.sphericalMercator||this.sphericalMercator)&&(i=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),maxResolution:156543.03390625,numZoomLevels:19,units:"m",projection:"EPSG:900913"},i));t=t||this.url;n=n||this.name;var r=[n,t,{},i];OpenLayers.Layer.Grid.prototype.initialize.apply(this,r)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){var t=this.getXYZ(n),i=this.url,r;return OpenLayers.Util.isArray(i)&&(r=""+t.x+t.y+t.z,i=this.selectUrl(r,i)),OpenLayers.String.format(i,t)},getXYZ:function(n){var t=this.map.getResolution(),i=Math.round((n.left-this.maxExtent.left)/(t*this.tileSize.w)),f=Math.round((this.maxExtent.top-n.top)/(t*this.tileSize.h)),u=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,t):this.map.getZoom()+this.zoomOffset,r=Math.pow(2,u);return this.wrapDateLine&&(i=(i%r+r)%r),{x:i,y:f,z:u}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap<\/a>",sphericalMercator:!0,url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",clone:function(n){return null==n&&(n=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[n])},wrapDateLine:!0,CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Layer.Bing=OpenLayers.Class(OpenLayers.Layer.XYZ,{serverResolutions:[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.9396191406249,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.49622619628906,305.74811309814453,152.87405654907226,76.437028274536132,38.218514137268066,19.109257068634033,9.5546285343170165,4.7773142671585083,2.3886571335792541,1.1943285667896271,.59716428339481353,.29858214169740677,.14929107084870338,.074645535424351692],attributionTemplate:'<span class="olBingAttribution ${type}"><div><a target="_blank" href="http://www.bing.com/maps/"><img src="${logo}" /><\/a><\/div>${copyrights}<a style="white-space: nowrap" target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use<\/a><\/span>',metadata:null,type:"Road",metadataParams:null,initialize:function(n){n=OpenLayers.Util.applyDefaults({sphericalMercator:!0},n);var t=n.name||"Bing "+(n.type||this.type),i=[t,null,n];OpenLayers.Layer.XYZ.prototype.initialize.apply(this,i);this.loadMetadata()},loadMetadata:function(){this._callbackId="_callback_"+this.id.replace(/\./g,"_");window[this._callbackId]=OpenLayers.Function.bind(OpenLayers.Layer.Bing.processMetadata,this);var t=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams),i="http://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(t),n=document.createElement("script");n.type="text/javascript";n.src=i;n.id=this._callbackId;document.getElementsByTagName("head")[0].appendChild(n)},initLayer:function(){var n=this.metadata.resourceSets[0].resources[0],i=n.imageUrl.replace("{quadkey}","${quadkey}"),t;for(this.url=[],t=0;n.imageUrlSubdomains.length>t;++t)this.url.push(i.replace("{subdomain}",n.imageUrlSubdomains[t]));this.addOptions({maxResolution:Math.min(this.serverResolutions[n.zoomMin],this.maxResolution),zoomOffset:n.zoomMin,numZoomLevels:Math.min(n.zoomMax+1-n.zoomMin,this.numZoomLevels)},!0)},getURL:function(n){var t,u,h,c;if(!this.url)return OpenLayers.Util.getImagesLocation()+"blank.gif";for(var i=this.getXYZ(n),f=i.x,e=i.y,o=i.z,s=[],r=o;r>0;--r)t="0",u=1<<r-1,0!=(f&u)&&t++,0!=(e&u)&&(t++,t++),s.push(t);return h=s.join(""),c=this.selectUrl(""+f+e+o,this.url),OpenLayers.String.format(c,{quadkey:h})},updateAttribution:function(){var u=this.metadata;if(u&&this.map&&this.map.center){for(var n,i,e,o,r,l=u.resourceSets[0].resources[0],a=this.map.getExtent().transform(this.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326")),s=l.imageryProviders,h=this.map.getZoom()+1,c="",t=0,f=s.length;f>t;++t)for(n=s[t],i=0,e=n.coverageAreas.length;e>i;++i)r=n.coverageAreas[i],o=OpenLayers.Bounds.fromArray(r.bbox),a.intersectsBounds(o)&&r.zoomMax>=h&&h>=r.zoomMin&&(c+=n.attribution+" ");this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(),logo:u.brandLogoUri,copyrights:c});this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"attribution"})}},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments);this.updateAttribution();this.map.events.register("moveend",this,this.updateAttribution)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Bing(this.options)),n=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[n])},destroy:function(){this.map&&this.map.events.unregister("moveend",this,this.updateAttribution);OpenLayers.Layer.XYZ.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.Bing"});OpenLayers.Layer.Bing.processMetadata=function(n){this.metadata=n;this.initLayer();var t=document.getElementById(this._callbackId);t.parentNode.removeChild(t);window[this._callbackId]=void 0;delete this._callbackId};OpenLayers.Layer.PointGrid=OpenLayers.Class(OpenLayers.Layer.Vector,{dx:null,dy:null,ratio:1.5,maxFeatures:250,rotation:0,origin:null,gridBounds:null,initialize:function(n){n=n||{};OpenLayers.Layer.Vector.prototype.initialize.apply(this,[n.name,n])},setMap:function(n){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);n.events.register("moveend",this,this.onMoveEnd)},removeMap:function(n){n.events.unregister("moveend",this,this.onMoveEnd);OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},setRatio:function(n){this.ratio=n;this.updateGrid(!0)},setMaxFeatures:function(n){this.maxFeatures=n;this.updateGrid(!0)},setSpacing:function(n,t){this.dx=n;this.dy=t||n;this.updateGrid(!0)},setOrigin:function(n){this.origin=n;this.updateGrid(!0)},getOrigin:function(){return this.origin||(this.origin=this.map.getExtent().getCenterLonLat()),this.origin},setRotation:function(n){this.rotation=n;this.updateGrid(!0)},onMoveEnd:function(){this.updateGrid()},getViewBounds:function(){var n=this.map.getExtent();if(this.rotation){var t=this.getOrigin(),r=new OpenLayers.Geometry.Point(t.lon,t.lat),i=n.toGeometry();i.rotate(-this.rotation,r);n=i.getBounds()}return n},updateGrid:function(n){var i;if(n||this.invalidBounds()){var f=this.getViewBounds(),t=this.getOrigin(),k=new OpenLayers.Geometry.Point(t.lon,t.lat),c=f.getWidth(),l=f.getHeight(),a=c/l,v=Math.sqrt(this.dx*this.dy*this.maxFeatures/a),d=v*a,e=Math.min(c*this.ratio,d),o=Math.min(l*this.ratio,v),r=f.getCenterLonLat();this.gridBounds=new OpenLayers.Bounds(r.lon-e/2,r.lat-o/2,r.lon+e/2,r.lat+o/2);for(var y,p,s,h=Math.floor(o/this.dy),w=Math.floor(e/this.dx),g=t.lon+this.dx*Math.ceil((this.gridBounds.left-t.lon)/this.dx),nt=t.lat+this.dy*Math.ceil((this.gridBounds.bottom-t.lat)/this.dy),b=Array(h*w),u=0;w>u;++u)for(y=g+u*this.dx,i=0;h>i;++i)p=nt+i*this.dy,s=new OpenLayers.Geometry.Point(y,p),this.rotation&&s.rotate(this.rotation,k),b[u*h+i]=new OpenLayers.Feature.Vector(s);this.destroyFeatures(this.features,{silent:!0});this.addFeatures(b,{silent:!0})}},invalidBounds:function(){return!this.gridBounds||!this.gridBounds.containsBounds(this.getViewBounds())},CLASS_NAME:"OpenLayers.Layer.PointGrid"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,interval:0,delta:0,cumulative:!0,initialize:function(){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(n){var s,r,u,h,i;if(this.map&&this.checkModifiers(n)){for(var f=!1,e=!1,o=!1,t=OpenLayers.Event.element(n);null!=t&&!o&&!f;){if(!f)try{t.currentStyle?r=t.currentStyle.overflow:(s=document.defaultView.getComputedStyle(t,null),r=s.getPropertyValue("overflow"));f=r&&"auto"==r||"scroll"==r}catch(c){}if(!e)for(u=0,h=this.map.layers.length;h>u;u++)if(t==this.map.layers[u].div||t==this.map.layers[u].pane){e=!0;break}o=t==this.map.div;t=t.parentNode}!f&&o&&(e&&(i=0,n||(n=window.event),n.wheelDelta?(i=n.wheelDelta/120,window.opera&&9.2>window.opera.version()&&(i=-i)):n.detail&&(i=-n.detail/3),this.delta=this.delta+i,this.interval?(window.clearTimeout(this._timeoutId),this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(n)},this),this.interval)):this.wheelZoom(n)),OpenLayers.Event.stop(n))}},wheelZoom:function(n){var t=this.delta;this.delta=0;t&&(this.mousePosition&&(n.xy=this.mousePosition),n.xy||(n.xy=this.map.getPixelFromLonLat(this.map.getCenter())),0>t?this.callback("down",[n,this.cumulative?t:-1]):this.callback("up",[n,this.cumulative?t:1]))},mousemove:function(n){this.mousePosition=n.xy},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var n=this.wheelListener;return OpenLayers.Event.observe(window,"DOMMouseScroll",n),OpenLayers.Event.observe(window,"mousewheel",n),OpenLayers.Event.observe(document,"mousewheel",n),!0}return!1},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var n=this.wheelListener;return OpenLayers.Event.stopObserving(window,"DOMMouseScroll",n),OpenLayers.Event.stopObserving(window,"mousewheel",n),OpenLayers.Event.stopObserving(document,"mousewheel",n),!0}return!1},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(n){OpenLayers.Util.extend(this,n)},clone:function(){var Type=eval(this.CLASS_NAME);return new Type(OpenLayers.Util.extend({},this))},CLASS_NAME:"OpenLayers.Symbolizer"});OpenLayers.Symbolizer.Raster=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Raster"});OpenLayers.Symbolizer.Point=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Point"});OpenLayers.Symbolizer.Line=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Line"});OpenLayers.Symbolizer.Polygon=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Polygon"});OpenLayers.Symbolizer.Text=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Text"});OpenLayers.Rule=OpenLayers.Class({id:null,name:null,title:null,description:null,context:null,filter:null,elseFilter:!1,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(n){this.symbolizer={};OpenLayers.Util.extend(this,n);this.symbolizers&&delete this.symbolizer;this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var n in this.symbolizer)this.symbolizer[n]=null;this.symbolizer=null;delete this.symbolizers},evaluate:function(n){var i=this.getContext(n),t=!0,r;return(this.minScaleDenominator||this.maxScaleDenominator)&&(r=n.layer.map.getScale()),this.minScaleDenominator&&(t=r>=OpenLayers.Style.createLiteral(this.minScaleDenominator,i)),t&&this.maxScaleDenominator&&(t=OpenLayers.Style.createLiteral(this.maxScaleDenominator,i)>r),t&&this.filter&&(t="OpenLayers.Filter.FeatureId"==this.filter.CLASS_NAME?this.filter.evaluate(n):this.filter.evaluate(i)),t},getContext:function(n){var t=this.context;return t||(t=n.attributes||n.data),"function"==typeof this.context&&(t=this.context(n)),t},clone:function(){var n=OpenLayers.Util.extend({},this),u,t,i,f,r;if(this.symbolizers)for(u=this.symbolizers.length,n.symbolizers=Array(u),t=0;u>t;++t)n.symbolizers[t]=this.symbolizers[t].clone();else{n.symbolizer={};for(r in this.symbolizer)i=this.symbolizer[r],f=typeof i,"object"===f?n.symbolizer[r]=OpenLayers.Util.extend({},i):"string"===f&&(n.symbolizer[r]=i)}return n.filter=this.filter&&this.filter.clone(),n.context=this.context&&OpenLayers.Util.extend({},this.context),new OpenLayers.Rule(n)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(n){OpenLayers.Filter.prototype.initialize.apply(this,[n])},evaluate:function(n){var i=!1,t;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:n.geometry&&(t=this.value,"OpenLayers.Bounds"==this.value.CLASS_NAME&&(t=this.value.toGeometry()),n.geometry.intersects(t)&&(i=!0));break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"))}return i},clone:function(){var n=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(n)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",stringifyOutput:!0,namedLayersAsArray:!1,CLASS_NAME:"OpenLayers.Format.SLD"});OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",initialize:function(n){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[n])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(n,t){var i={};this.readChildNodes(n,i);t.outer=i.components[0]},innerBoundaryIs:function(n,t){var i={};this.readChildNodes(n,i);t.inner.push(i.components[0])},Box:function(n,t){var i={},r,u;this.readChildNodes(n,i);t.components||(t.components=[]);r=i.points[0];u=i.points[1];t.components.push(new OpenLayers.Bounds(r.x,r.y,u.x,u.y))}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(n){var i,t;return i=OpenLayers.Util.isArray(n)?"wfs:FeatureCollection":"gml:featureMember",t=this.writeNode(i,n),this.setAttributeNS(t,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(n){var t=this.createElementNSPlus("gml:Point");return this.writeNode("coordinates",[n],t),t},coordinates:function(n){for(var t,u=n.length,r=Array(u),i=0;u>i;++i)t=n[i],r[i]=this.xy?t.x+","+t.y:t.y+","+t.x,void 0!=t.z&&(r[i]+=","+t.z);return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:1==u?r[0]:r.join(" ")})},LineString:function(n){var t=this.createElementNSPlus("gml:LineString");return this.writeNode("coordinates",n.components,t),t},Polygon:function(n){var i=this.createElementNSPlus("gml:Polygon"),t;for(this.writeNode("outerBoundaryIs",n.components[0],i),t=1;n.components.length>t;++t)this.writeNode("innerBoundaryIs",n.components[t],i);return i},outerBoundaryIs:function(n){var t=this.createElementNSPlus("gml:outerBoundaryIs");return this.writeNode("LinearRing",n,t),t},innerBoundaryIs:function(n){var t=this.createElementNSPlus("gml:innerBoundaryIs");return this.writeNode("LinearRing",n,t),t},LinearRing:function(n){var t=this.createElementNSPlus("gml:LinearRing");return this.writeNode("coordinates",n.components,t),t},Box:function(n){var t=this.createElementNSPlus("gml:Box");return this.writeNode("coordinates",[{x:n.left,y:n.bottom},{x:n.right,y:n.top}],t),this.srsName&&t.setAttribute("srsName",this.srsName),t}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},CLASS_NAME:"OpenLayers.Format.GML.v2"});OpenLayers.Format.Filter.v1_0_0=OpenLayers.Class(OpenLayers.Format.GML.v2,OpenLayers.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(n){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[n])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(n,i);t.filters.push(i)},PropertyIsNotEqualTo:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(n,i);t.filters.push(i)},PropertyIsLike:function(n,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(n,i);var r=n.getAttribute("wildCard"),u=n.getAttribute("singleChar"),f=n.getAttribute("escape");i.value2regex(r,u,f);t.filters.push(i)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsNotEqualTo:function(n){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");return this.writeNode("PropertyName",n,t),this.writeOgcExpression(n.value,t),t},PropertyIsLike:function(n){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});return this.writeNode("PropertyName",n,t),this.writeNode("Literal",n.regex2value(),t),t},BBOX:function(n){var t=this.createElementNSPlus("ogc:BBOX"),i;return n.property&&this.writeNode("PropertyName",n,t),i=this.writeNode("gml:Box",n.value,t),n.projection&&i.setAttribute("srsName",n.projection),t}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},writeSpatial:function(n,t){var i=this.createElementNSPlus("ogc:"+t),r;return(this.writeNode("PropertyName",n,i),n.value instanceof OpenLayers.Filter.Function)?this.writeNode("Function",n.value,i):(r=n.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",n.value).firstChild:this.writeNode("gml:Box",n.value),n.projection&&r.setAttribute("srsName",n.projection),i.appendChild(r)),i},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"});OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:"1.0.0",srsNameInQuery:!1,schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"},initialize:function(n){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[n]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[n])},readNode:function(n,t){return OpenLayers.Format.GML.v2.prototype.readNode.apply(this,[n,t])},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(n,t){t.insertIds=[];t.success=!1;this.readChildNodes(n,t)},InsertResult:function(n,t){var i={fids:[]};this.readChildNodes(n,i);t.insertIds.push(i.fids[0])},TransactionResult:function(n,t){this.readChildNodes(n,t)},Status:function(n,t){this.readChildNodes(n,t)},SUCCESS:function(n,t){t.success=!0}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(n){var i,t,r,u;if(n=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName,srsNameInQuery:this.srsNameInQuery},n),i=n.featurePrefix,t=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(i?i+":":"")+n.featureType}}),n.srsNameInQuery&&n.srsName&&t.setAttribute("srsName",n.srsName),n.featureNS&&t.setAttribute("xmlns:"+i,n.featureNS),n.propertyNames)for(r=0,u=n.propertyNames.length;u>r;r++)this.writeNode("ogc:PropertyName",{property:n.propertyNames[r]},t);return n.filter&&(this.setFilterProperty(n.filter),this.writeNode("ogc:Filter",n.filter,t)),t}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_0_0"});OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(n){this.compare=n?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.clear()},insert:function(n){var u,i,r,t,f;for(this.exists(n)&&this.remove(n),u=n.id,this.determineZIndex(n),r=-1,t=this.order.length;t-r>1;)i=parseInt((r+t)/2),f=this.compare(this,n,OpenLayers.Util.getElement(this.order[i])),f>0?r=i:t=i;return this.order.splice(t,0,u),this.indices[u]=this.getZIndex(n),this.getNextElement(t)},remove:function(n){var t=n.id,i=OpenLayers.Util.indexOf(this.order,t),r;i>=0&&((this.order.splice(i,1),delete this.indices[t],this.order.length>0)?(r=this.order[this.order.length-1],this.maxZIndex=this.indices[r]):this.maxZIndex=0)},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(n){return null!=this.indices[n.id]},getZIndex:function(n){return n._style.graphicZIndex},determineZIndex:function(n){var t=n._style.graphicZIndex;null==t?(t=this.maxZIndex,n._style.graphicZIndex=t):t>this.maxZIndex&&(this.maxZIndex=t)},getNextElement:function(n){var i=n+1,t;return this.order.length>i?(t=OpenLayers.Util.getElement(this.order[i]),void 0==t&&(t=this.getNextElement(i)),t):null},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(n,t,i){var f=n.getZIndex(t),r=0,u;return i&&(u=n.getZIndex(i),r=f-u),r},Z_ORDER_DRAWING_ORDER:function(n,t,i){var r=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(n,t,i);return i&&0==r&&(r=1),r},Z_ORDER_Y_ORDER:function(n,t,i){var r=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(n,t,i),u;return i&&0===r&&(u=i._boundsBottom-t._boundsBottom,r=0===u?1:u),r}};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",initialize:function(n,t){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot);this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);t&&(t.zIndexing||t.yOrdering)&&(this.indexer=new OpenLayers.ElementsIndexer(t.yOrdering))},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var t,n=this.vectorRoot;if(n)for(;t=n.firstChild;)n.removeChild(t);if(n=this.textRoot)for(;t=n.firstChild;)n.removeChild(t);this.indexer&&this.indexer.clear()},getNodeType:function(){},drawGeometry:function(n,t,i){var f=n.CLASS_NAME,u=!0,e,s,o,r;if("OpenLayers.Geometry.Collection"==f||"OpenLayers.Geometry.MultiPoint"==f||"OpenLayers.Geometry.MultiLineString"==f||"OpenLayers.Geometry.MultiPolygon"==f){for(e=0,s=n.components.length;s>e;e++)u=this.drawGeometry(n.components[e],t,i)&&u;return u}return u=!1,o=!1,("none"!=t.display&&(t.backgroundGraphic?this.redrawBackgroundNode(n.id,n,t,i):o=!0,u=this.redrawNode(n.id,n,t,i)),0==u)&&(r=document.getElementById(n.id),r&&(r._style.backgroundGraphic&&(o=!0),r.parentNode.removeChild(r))),o&&(r=document.getElementById(n.id+this.BACKGROUND_ID_SUFFIX),r&&r.parentNode.removeChild(r)),u},redrawNode:function(n,t,i,r){var u,f,e;return(i=this.applyDefaultSymbolizer(i),u=this.nodeFactory(n,this.getNodeType(t,i)),u._featureId=r,u._boundsBottom=t.getBounds().bottom,u._geometryClass=t.CLASS_NAME,u._style=i,f=this.drawGeometryNode(u,t,i),f===!1)?!1:((u=f.node,this.indexer)?(e=this.indexer.insert(u),e?this.vectorRoot.insertBefore(u,e):this.vectorRoot.appendChild(u)):u.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(u),this.postDraw(u),f.complete)},redrawBackgroundNode:function(n,t,i){var r=OpenLayers.Util.extend({},i);return r.externalGraphic=r.backgroundGraphic,r.graphicXOffset=r.backgroundXOffset,r.graphicYOffset=r.backgroundYOffset,r.graphicZIndex=r.backgroundGraphicZIndex,r.graphicWidth=r.backgroundWidth||r.graphicWidth,r.graphicHeight=r.backgroundHeight||r.graphicHeight,r.backgroundGraphic=null,r.backgroundXOffset=null,r.backgroundYOffset=null,r.backgroundGraphicZIndex=null,this.redrawNode(n+this.BACKGROUND_ID_SUFFIX,t,r,null)},drawGeometryNode:function(n,t,i){i=i||n._style;var r,u={isFilled:void 0===i.fill?!0:i.fill,isStroked:void 0===i.stroke?!!i.strokeWidth:i.stroke};switch(t.CLASS_NAME){case"OpenLayers.Geometry.Point":i.graphic===!1&&(u.isFilled=!1,u.isStroked=!1);r=this.drawPoint(n,t);break;case"OpenLayers.Geometry.LineString":u.isFilled=!1;r=this.drawLineString(n,t);break;case"OpenLayers.Geometry.LinearRing":r=this.drawLinearRing(n,t);break;case"OpenLayers.Geometry.Polygon":r=this.drawPolygon(n,t);break;case"OpenLayers.Geometry.Surface":r=this.drawSurface(n,t);break;case"OpenLayers.Geometry.Rectangle":r=this.drawRectangle(n,t)}return n._options=u,0!=r?{node:this.setStyle(n,i,u,t),complete:r}:!1},postDraw:function(){},drawPoint:function(){},drawLineString:function(){},drawLinearRing:function(){},drawPolygon:function(){},drawRectangle:function(){},drawCircle:function(){},drawSurface:function(){},removeText:function(n){var t=document.getElementById(n+this.LABEL_ID_SUFFIX);t&&this.textRoot.removeChild(t)},getFeatureIdFromEvent:function(n){var t=n.target,i=t&&t.correspondingUseElement,r=i?i:t||n.srcElement;return r._featureId},eraseGeometry:function(n,t){var u,f,i,e,r;if("OpenLayers.Geometry.MultiPoint"==n.CLASS_NAME||"OpenLayers.Geometry.MultiLineString"==n.CLASS_NAME||"OpenLayers.Geometry.MultiPolygon"==n.CLASS_NAME||"OpenLayers.Geometry.Collection"==n.CLASS_NAME)for(u=0,f=n.components.length;f>u;u++)this.eraseGeometry(n.components[u],t);else i=OpenLayers.Util.getElement(n.id),i&&i.parentNode&&(i.geometry&&(i.geometry.destroy(),i.geometry=null),i.parentNode.removeChild(i),this.indexer&&this.indexer.remove(i),i._style.backgroundGraphic)&&(e=n.id+this.BACKGROUND_ID_SUFFIX,r=OpenLayers.Util.getElement(e),r&&r.parentNode&&r.parentNode.removeChild(r))},nodeFactory:function(n,t){var i=OpenLayers.Util.getElement(n);return i?this.nodeTypeCompare(i,t)||(i.parentNode.removeChild(i),i=this.nodeFactory(n,t)):i=this.createNode(t,n),i},nodeTypeCompare:function(){},createNode:function(){},moveRoot:function(n){var t=this.root;n.root.parentNode==this.rendererRoot&&(t=n.root);t.parentNode.removeChild(t);n.rendererRoot.appendChild(t)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(n){return"circle"!=n&&!!n},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.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.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,getParameters:function(n){n=n||window.location.href;var t=OpenLayers.Util.getParameters(n),i=n.indexOf("#");return i>0&&(n="?"+n.substring(i+1,n.length),OpenLayers.Util.extend(t,OpenLayers.Util.getParameters(n))),t},setMap:function(){var t,r,i,n;for(OpenLayers.Control.prototype.setMap.apply(this,arguments),t=0,r=this.map.controls.length;r>t;t++)if(i=this.map.controls[t],i!=this&&"OpenLayers.Control.ArgParser"==i.CLASS_NAME){i.displayProjection!=this.displayProjection&&(this.displayProjection=i.displayProjection);break}t==this.map.controls.length&&(n=this.getParameters(),n.layers&&(this.layers=n.layers,this.map.events.register("addlayer",this,this.configureLayers),this.configureLayers()),n.lat&&n.lon&&(this.center=new OpenLayers.LonLat(parseFloat(n.lon),parseFloat(n.lat)),n.zoom&&(this.zoom=parseInt(n.zoom)),this.map.events.register("changebaselayer",this,this.setCenter),this.setCenter()))},setCenter:function(){this.map.baseLayer&&(this.map.events.unregister("changebaselayer",this,this.setCenter),this.displayProjection&&this.center.transform(this.displayProjection,this.map.getProjectionObject()),this.map.setCenter(this.center,this.zoom))},configureLayers:function(){var n,r,i,t;if(this.layers.length==this.map.layers.length)for(this.map.events.unregister("addlayer",this,this.configureLayers),n=0,r=this.layers.length;r>n;n++)i=this.map.layers[n],t=this.layers.charAt(n),"B"==t?this.map.setBaseLayer(i):("T"==t||"F"==t)&&i.setVisibility("T"==t)},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,anchor:!1,base:"",displayProjection:null,initialize:function(n,t,i){null===n||"object"!=typeof n||OpenLayers.Util.isElement(n)?(OpenLayers.Control.prototype.initialize.apply(this,[i]),this.element=OpenLayers.Util.getElement(n),this.base=t||document.location.href):(i=n,this.base=document.location.href,OpenLayers.Control.prototype.initialize.apply(this,[i]),null!=this.element&&(this.element=OpenLayers.Util.getElement(this.element)))},destroy:function(){this.element.parentNode==this.div&&this.div.removeChild(this.element);this.element=null;this.map.events.unregister("moveend",this,this.updateLink);OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(){var n,i,t;for(OpenLayers.Control.prototype.setMap.apply(this,arguments),n=0,i=this.map.controls.length;i>n;n++)if(t=this.map.controls[n],t.CLASS_NAME==this.argParserClass.CLASS_NAME){t.displayProjection!=this.displayProjection&&(this.displayProjection=t.displayProjection);break}n==this.map.controls.length&&this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||this.anchor||(this.element=document.createElement("a"),this.element.innerHTML=OpenLayers.i18n("Permalink"),this.element.href="",this.div.appendChild(this.element)),this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this}),this.updateLink(),this.div},updateLink:function(){var t=this.anchor?"#":"?",n=this.base;-1!=n.indexOf(t)&&(n=n.substring(0,n.indexOf(t)));n+=t+OpenLayers.Util.getParameterString(this.createParams());this.anchor&&!this.element?window.location.href=n:this.element.href=n},createParams:function(n,t,i){var r,u,f,s,e,h,o;if(n=n||this.map.getCenter(),r=OpenLayers.Util.getParameters(this.base),n)for(r.zoom=t||this.map.getZoom(),u=n.lat,f=n.lon,this.displayProjection&&(s=OpenLayers.Projection.transform({x:f,y:u},this.map.getProjectionObject(),this.displayProjection),f=s.x,u=s.y),r.lat=Math.round(1e5*u)/1e5,r.lon=Math.round(1e5*f)/1e5,i=i||this.map.layers,r.layers="",e=0,h=i.length;h>e;e++)o=i[e],r.layers+=o.isBaseLayer?o==this.map.baseLayer?"B":"0":o.getVisibility()?"T":"F";return r},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",layername:null,type:null,isBaseLayer:!0,tileOrigin:null,serverResolutions:null,zoomOffset:0,initialize:function(n,t,i){var r=[];r.push(n,t,{},i);OpenLayers.Layer.Grid.prototype.initialize.apply(this,r)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.TMS(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){n=this.adjustBounds(n);var i=this.map.getResolution(),u=Math.round((n.left-this.tileOrigin.lon)/(i*this.tileSize.w)),f=Math.round((n.bottom-this.tileOrigin.lat)/(i*this.tileSize.h)),e=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,i):this.map.getZoom()+this.zoomOffset,r=this.serviceVersion+"/"+this.layername+"/"+e+"/"+u+"/"+f+"."+this.type,t=this.url;return OpenLayers.Util.isArray(t)&&(t=this.selectUrl(r,t)),t+r},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.TMS"});OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:!1,activate:function(){return OpenLayers.Strategy.prototype.activate.apply(this,arguments)?(this.layer.events.on({refresh:this.load,scope:this}),1==this.layer.visibility||this.preload?this.load():this.layer.events.on({visibilitychanged:this.load,scope:this}),!0):!1},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this}),n},load:function(n){var t=this.layer;t.events.triggerEvent("loadstart");t.protocol.read(OpenLayers.Util.applyDefaults({callback:OpenLayers.Function.bind(this.merge,this,t.map.getProjectionObject()),filter:t.filter},n));t.events.un({visibilitychanged:this.load,scope:this})},merge:function(n,t){var r=this.layer,i,f,u,e;if(r.destroyFeatures(),i=t.features,i&&i.length>0){if(!n.equals(r.projection))for(u=0,e=i.length;e>u;++u)f=i[u].geometry,f&&f.transform(r.projection,n);r.addFeatures(i)}r.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",errorProperty:"service",CLASS_NAME:"OpenLayers.Format.WFSCapabilities"});OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.WFSCapabilities,{initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]);this.options=n},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));var t={},i=n.documentElement;return this.runChildNodes(t,i),t},runChildNodes:function(n,t){for(var i,r,f=t.childNodes,u=0;f.length>u;++u)i=f[u],1==i.nodeType&&(r=this["read_cap_"+i.nodeName],r&&r.apply(this,[n,i]))},read_cap_FeatureTypeList:function(n,t){var i={featureTypes:[]};this.runChildNodes(i,t);n.featureTypeList=i},read_cap_FeatureType:function(n,t){var i={};this.runChildNodes(i,t);n.featureTypes.push(i)},read_cap_Name:function(n,t){var r=this.getChildValue(t),i;r&&(i=r.split(":"),n.name=i.pop(),i.length>0&&(n.featureNS=this.lookupNamespaceURI(t,i[0])))},read_cap_Title:function(n,t){var i=this.getChildValue(t);i&&(n.title=i)},read_cap_Abstract:function(n,t){var i=this.getChildValue(t);i&&(n.abstract=i)},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"});OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(n){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[n])},read_cap_DefaultSRS:function(n,t){var i=this.getChildValue(t);i&&(n.srs=i)},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"});OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,styleFrom:null,initialize:function(){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},addNodes:function(n,t){var f;if(2>n.length)return OpenLayers.Console.error("At least two point features have to be added to createa line from"),void 0;for(var u,e,r,o=Array(n.length-1),i=0,s=n.length;s>i;i++){if(u=n[i],r=u.geometry){if("OpenLayers.Geometry.Point"!=r.CLASS_NAME)return OpenLayers.Console.error("Only features with point geometries are supported."),void 0}else f=u.lonlat,r=new OpenLayers.Geometry.Point(f.lon,f.lat);if(i>0){var h=null!=this.dataFrom?n[i+this.dataFrom].data||n[i+this.dataFrom].attributes:null,c=null!=this.styleFrom?n[i+this.styleFrom].style:null,l=new OpenLayers.Geometry.LineString([e,r]);o[i-1]=new OpenLayers.Feature.Vector(l,h,c)}e=r}this.addFeatures(o,t)},CLASS_NAME:"OpenLayers.Layer.PointTrack"});OpenLayers.Layer.PointTrack.SOURCE_NODE=-1;OpenLayers.Layer.PointTrack.TARGET_NODE=0;OpenLayers.Layer.PointTrack.dataFrom={SOURCE_NODE:-1,TARGET_NODE:0};OpenLayers.Protocol.WFS=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Protocol.WFS.DEFAULTS);var t=OpenLayers.Protocol.WFS["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFS version: "+n.version;return new t(n)};OpenLayers.Protocol.WFS.fromWMSLayer=function(n,t){var u,f,i=n.params.LAYERS,r=(OpenLayers.Util.isArray(i)?i[0]:i).split(":"),e;return r.length>1&&(f=r[0]),u=r.pop(),e={url:n.url,featureType:u,featurePrefix:f,srsName:n.projection&&n.projection.getCode()||n.map&&n.map.getProjectionObject().getCode(),version:"1.1.0"},new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(t,e))};OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"};OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,markers:null,drawn:!1,initialize:function(){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(n){if(n!=this.opacity){this.opacity=n;for(var t=0,i=this.markers.length;i>t;t++)this.markers[t].setOpacity(this.opacity)}},moveTo:function(n,t){if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),t||!this.drawn){for(var i=0,r=this.markers.length;r>i;i++)this.drawMarker(this.markers[i]);this.drawn=!0}},addMarker:function(n){this.markers.push(n);null!=this.opacity&&n.setOpacity(this.opacity);this.map&&this.map.getExtent()&&(n.map=this.map,this.drawMarker(n))},removeMarker:function(n){this.markers&&this.markers.length&&(OpenLayers.Util.removeItem(this.markers,n),n.erase())},clearMarkers:function(){if(null!=this.markers)for(;this.markers.length>0;)this.removeMarker(this.markers[0])},drawMarker:function(n){var t=this.map.getLayerPxFromLonLat(n.lonlat),i;null==t?n.display(!1):n.isDrawn()?n.icon&&n.icon.moveTo(t):(i=n.draw(t),this.div.appendChild(i))},getDataExtent:function(){var t=null,i;if(this.markers&&this.markers.length>0)for(var t=new OpenLayers.Bounds,n=0,r=this.markers.length;r>n;n++)i=this.markers[n],t.extend(i.lonlat);return t},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(n,t){this.direction=n;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[t])},trigger:function(){var n=OpenLayers.Function.bind(function(n){return this.slideRatio?this.map.getSize()[n]*this.slideRatio:this.slideFactor},this);switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-n("h"));break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,n("h"));break;case OpenLayers.Control.Pan.WEST:this.map.pan(-n("w"),0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(n("w"),0)}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"},reproject:!1,isBaseLayer:!0,encodeBBOX:!1,noMagic:!1,yx:{"EPSG:4326":!0},initialize:function(n,t,i,r){var u=[];i=OpenLayers.Util.upperCaseObject(i);parseFloat(i.VERSION)>=1.3&&!i.EXCEPTIONS&&(i.EXCEPTIONS="INIMAGE");u.push(n,t,i,r);OpenLayers.Layer.Grid.prototype.initialize.apply(this,u);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));!this.noMagic&&this.params.TRANSPARENT&&"true"==(""+this.params.TRANSPARENT).toLowerCase()&&(null!=r&&r.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"))},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},reverseAxisOrder:function(){return parseFloat(this.params.VERSION)>=1.3&&!!this.yx[this.map.getProjectionObject().getCode()]},getURL:function(n){n=this.adjustBounds(n);var i=this.getImageSize(),t={},r=this.reverseAxisOrder();return t.BBOX=this.encodeBBOX?n.toBBOX(null,r):n.toArray(r),t.WIDTH=i.w,t.HEIGHT=i.h,this.getFullRequestString(t)},mergeNewParams:function(n){var t=OpenLayers.Util.upperCaseObject(n),i=[t];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,i)},getFullRequestString:function(n){var t=this.map.getProjectionObject(),i=this.projection&&this.projection.equals(t)?this.projection.getCode():t.getCode(),r="none"==i?null:i;return parseFloat(this.params.VERSION)>=1.3?this.params.CRS=r:this.params.SRS=r,"boolean"==typeof this.params.TRANSPARENT&&(n.TRANSPARENT=this.params.TRANSPARENT?"TRUE":"FALSE"),OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS,{singleTile:!0,initialize:function(){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);OpenLayers.Console.warn("The OpenLayers.Layer.WMS.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.WMS class, passing it the option 'singleTile' as true.")},clone:function(n){return null==n&&(n=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.WMS.prototype.clone.apply(this,[n])},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"});OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var t=new OpenLayers.Format.ArcXML,i=t.read(n);return i.features.feature}});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesnap","snap","unsnap"],DEFAULTS:{tolerance:10,node:!0,edge:!0,vertex:!0},greedy:!0,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(n){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[n]);this.options=n||{};this.options.layer&&this.setLayer(this.options.layer);var t=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(t,this.DEFAULTS);this.setTargets(this.options.targets);0===this.targets.length&&this.layer&&this.addTargetLayer(this.layer);this.geoToleranceCache={}},setLayer:function(n){this.active?(this.deactivate(),this.layer=n,this.activate()):this.layer=n},setTargets:function(n){if(this.targets=[],n&&n.length)for(var t,i=0,r=n.length;r>i;++i)t=n[i],t instanceof OpenLayers.Layer.Vector?this.addTargetLayer(t):this.addTarget(t)},addTargetLayer:function(n){this.addTarget({layer:n})},addTarget:function(n){n=OpenLayers.Util.applyDefaults(n,this.defaults);n.nodeTolerance=n.nodeTolerance||n.tolerance;n.vertexTolerance=n.vertexTolerance||n.tolerance;n.edgeTolerance=n.edgeTolerance||n.tolerance;this.targets.push(n)},removeTargetLayer:function(n){for(var t,i=this.targets.length-1;i>=0;--i)t=this.targets[i],t.layer===n&&this.removeTarget(t)},removeTarget:function(n){return OpenLayers.Util.removeItem(this.targets,n)},activate:function(){var n=OpenLayers.Control.prototype.activate.call(this);return n&&this.layer&&this.layer.events&&this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this}),n},deactivate:function(){var n=OpenLayers.Control.prototype.deactivate.call(this);return n&&this.layer&&this.layer.events&&this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this}),this.feature=null,this.point=null,n},onSketchModified:function(n){this.feature=n.feature;this.considerSnapping(n.vertex,n.vertex)},onVertexModified:function(n){this.feature=n.feature;var t=this.layer.map.getLonLatFromViewPortPx(n.pixel);this.considerSnapping(n.vertex,new OpenLayers.Geometry.Point(t.lon,t.lat))},considerSnapping:function(n,t){for(var o,r,f,i={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null},u=!1,e=0,s=this.targets.length;s>e;++e)if(f=this.targets[e],r=this.testTarget(f,t)){if(this.greedy){i=r;i.target=f;u=!0;break}(r.rank<i.rank||r.rank===i.rank&&r.dist<i.dist)&&(i=r,i.target=f,u=!0)}u&&(o=this.events.triggerEvent("beforesnap",{point:n,x:i.x,y:i.y,distance:i.dist,layer:i.target.layer,snapType:this.precedence[i.rank]}),o!==!1?(n.x=i.x,n.y=i.y,this.point=n,this.events.triggerEvent("snap",{point:n,snapType:this.precedence[i.rank],layer:i.target.layer,distance:i.dist})):u=!1);this.point&&!u&&(n.x=t.x,n.y=t.y,this.point=null,this.events.triggerEvent("unsnap",{point:n}))},testTarget:function(n,t){var o=this.layer.map.getResolution(),f,k,l,d;if("minResolution"in n&&n.minResolution>o||"maxResolution"in n&&o>=n.maxResolution)return null;for(var i,e,a,h,c,r,v,s={node:this.getGeoTolerance(n.nodeTolerance,o),vertex:this.getGeoTolerance(n.vertexTolerance,o),edge:this.getGeoTolerance(n.edgeTolerance,o)},w=Math.max(s.node,s.vertex,s.edge),u={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY},y=!1,b=n.layer.features,g=this.precedence.length,nt=new OpenLayers.LonLat(t.x,t.y),p=0,tt=b.length;tt>p;++p)if(i=b[p],i!==this.feature&&!i._sketch&&i.state!==OpenLayers.State.DELETE&&(!n.filter||n.filter.evaluate(i.attributes))&&i.atPoint(nt,w,w))for(f=0,k=Math.min(u.rank+1,g);k>f;++f)if(e=this.precedence[f],n[e])if("edge"===e){if(c=i.geometry.distanceTo(t,{details:!0}),r=c.distance,s[e]>=r&&u.dist>r){u={rank:f,dist:r,x:c.x0,y:c.y0};y=!0;break}}else{for(a=i.geometry.getVertices("node"===e),v=!1,l=0,d=a.length;d>l;++l)h=a[l],r=h.distanceTo(t),s[e]>=r&&(u.rank>f||f===u.rank&&u.dist>r)&&(u={rank:f,dist:r,x:h.x,y:h.y},y=!0,v=!0);if(v)break}return y?u:null},getGeoTolerance:function(n,t){t!==this.resolution&&(this.resolution=t,this.geoToleranceCache={});var i=this.geoToleranceCache[n];return void 0===i&&(i=n*t,this.geoToleranceCache[n]=i),i},destroy:function(){this.active&&this.deactivate();delete this.layer;delete this.targets;OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"});OpenLayers.Date={toISOString:function(){function n(n,t){for(var i=n+"";t>i.length;)i="0"+i;return i}return"toISOString"in Date.prototype?function(n){return n.toISOString()}:function(t){return isNaN(t.getTime())?"Invalid Date":t.getUTCFullYear()+"-"+n(t.getUTCMonth()+1,2)+"-"+n(t.getUTCDate(),2)+"T"+n(t.getUTCHours(),2)+":"+n(t.getUTCMinutes(),2)+":"+n(t.getUTCSeconds(),2)+"."+n(t.getUTCMilliseconds(),3)+"Z"}}(),parse:function(n){var i,t=n.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))?$/),r;if(t&&(t[1]||t[7])){var e=parseInt(t[1],10)||0,o=parseInt(t[2],10)-1||0,s=parseInt(t[3],10)||1;if(i=new Date(Date.UTC(e,o,s)),r=t[7],r){var h=parseInt(t[4],10),c=parseInt(t[5],10),u=parseFloat(t[6]),f=0|u,l=Math.round(1e3*(u-f));if(i.setUTCHours(h,c,f,l),"Z"!==r){var a=parseInt(r,10),v=parseInt(t[8],10)||0,y=-1e3*(3600*a+60*v);i=new Date(i.getTime()+y)}}}else i=new Date("invalid");return i}},function(){function e(){this._object=i&&!c?new i:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function n(){return new e}function s(t){if(t._object.send(t._data),f&&!t._async)for(t.readyState=n.OPENED,o(t);t.readyState<n.DONE;)if(t.readyState++,r(t),t._aborted)return}function r(t){n.onreadystatechange&&n.onreadystatechange.apply(t);t.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function h(n){var i=n.responseXML,r=n.responseText;return t&&r&&i&&!i.documentElement&&n.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)&&(i=new window.ActiveXObject("Microsoft.XMLDOM"),i.async=!1,i.validateOnParse=!1,i.loadXML(r)),i&&(t&&0!=i.parseError||!i.documentElement||i.documentElement&&"parsererror"==i.documentElement.tagName)?null:i}function o(n){try{n.responseText=n._object.responseText}catch(t){}try{n.responseXML=h(n._object)}catch(t){}try{n.status=n._object.status}catch(t){}try{n.statusText=n._object.statusText}catch(t){}}function u(n){n._object.onreadystatechange=new window.Function}var i=window.XMLHttpRequest,f=!!window.controllers,t=window.document.all&&!window.opera,c=t&&window.navigator.userAgent.match(/MSIE 7.0/);n.prototype=e.prototype;f&&i.wrapped&&(n.wrapped=i.wrapped);n.UNSENT=0;n.OPENED=1;n.HEADERS_RECEIVED=2;n.LOADING=3;n.DONE=4;n.prototype.readyState=n.UNSENT;n.prototype.responseText="";n.prototype.responseXML=null;n.prototype.status=0;n.prototype.statusText="";n.prototype.priority="NORMAL";n.prototype.onreadystatechange=null;n.onreadystatechange=null;n.onopen=null;n.onsend=null;n.onabort=null;n.prototype.open=function(i,e,s,h,c){delete this._headers;3>arguments.length&&(s=!0);this._async=s;var a,l=this,v=this.readyState;t&&s&&(a=function(){v!=n.DONE&&(u(l),l.abort())},window.attachEvent("onunload",a));n.onopen&&n.onopen.apply(this,arguments);arguments.length>4?this._object.open(i,e,s,h,c):arguments.length>3?this._object.open(i,e,s,h):this._object.open(i,e,s);this.readyState=n.OPENED;r(this);this._object.onreadystatechange=function(){if(!f||s){if(l.readyState=l._object.readyState,o(l),l._aborted)return l.readyState=n.UNSENT,void 0;l.readyState==n.DONE&&(delete l._data,u(l),t&&s&&window.detachEvent("onunload",a));v!=l.readyState&&r(l);v=l.readyState}}};n.prototype.send=function(t){n.onsend&&n.onsend.apply(this,arguments);arguments.length||(t=null);t&&t.nodeType&&(t=window.XMLSerializer?(new window.XMLSerializer).serializeToString(t):t.xml,oRequest._headers["Content-Type"]||oRequest._object.setRequestHeader("Content-Type","application/xml"));this._data=t;s(this)};n.prototype.abort=function(){n.onabort&&n.onabort.apply(this,arguments);this.readyState>n.UNSENT&&(this._aborted=!0);this._object.abort();u(this);this.readyState=n.UNSENT;delete this._data};n.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};n.prototype.getResponseHeader=function(n){return this._object.getResponseHeader(n)};n.prototype.setRequestHeader=function(n,t){return this._headers||(this._headers={}),this._headers[n]=t,this._object.setRequestHeader(n,t)};n.prototype.addEventListener=function(n,t,i){for(var r,u=0;r=this._listeners[u];u++)if(r[0]==n&&r[1]==t&&r[2]==i)return;this._listeners.push([n,t,i])};n.prototype.removeEventListener=function(n,t,i){for(var r,u=0;(r=this._listeners[u])&&(r[0]!=n||r[1]!=t||r[2]!=i);u++);r&&this._listeners.splice(u,1)};n.prototype.dispatchEvent=function(n){var i={type:n.type,target:this,currentTarget:this,eventPhase:2,bubbles:n.bubbles,cancelable:n.cancelable,timeStamp:n.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}},t,r;for("readystatechange"==i.type&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[i]),r=0;t=this._listeners[r];r++)t[0]!=i.type||t[2]||(t[1].handleEvent||t[1]).apply(this,[i])};n.prototype.toString=function(){return"[object XMLHttpRequest]"};n.toString=function(){return"[XMLHttpRequest]"};window.Function.prototype.apply||(window.Function.prototype.apply=function(n,t){t||(t=[]);n.__func=this;n.__func(t[0],t[1],t[2],t[3],t[4]);delete n.__func});OpenLayers.Request.XMLHttpRequest=n}();OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{kml:"http://www.opengis.net/kml/2.2",gx:"http://www.google.com/kml/ext/2.2"},kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new Date,extractAttributes:!0,extractStyles:!1,extractTracks:!1,trackAttributes:null,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(n){this.regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,kmlColor:/(\w{2})(\w{2})(\w{2})(\w{2})/,kmlIconPalette:/root:\/\/icons\/palette-(\d+)(\.\w+)/,straightBracket:/\$\[(.*?)\]/g};this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){this.features=[];this.styles={};this.fetched={};var t={depth:0,styleBaseUrl:this.styleBaseUrl};return this.parseData(n,t)},parseData:function(n,t){var u,i;"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));for(var f=["Link","NetworkLink","Style","StyleMap","Placemark"],r=0,e=f.length;e>r;++r)if(u=f[r],i=this.getElementsByTagNameNS(n,"*",u),0!=i.length)switch(u.toLowerCase()){case"link":case"networklink":this.parseLinks(i,t);break;case"style":this.extractStyles&&this.parseStyles(i,t);break;case"stylemap":this.extractStyles&&this.parseStyleMaps(i,t);break;case"placemark":this.parseFeatures(i,t)}return this.features},parseLinks:function(n,t){var u,r,e,i,f;if(t.depth>=this.maxDepth)return!1;for(u=OpenLayers.Util.extend({},t),u.depth++,r=0,e=n.length;e>r;r++)i=this.parseProperty(n[r],"*","href"),i&&!this.fetched[i]&&(this.fetched[i]=!0,f=this.fetchLink(i),f&&this.parseData(f,u))},fetchLink:function(n){var t=OpenLayers.Request.GET({url:n,async:!1});if(t)return t.responseText},parseStyles:function(n,t){for(var r,f,i=0,u=n.length;u>i;i++)r=this.parseStyle(n[i]),r&&(f=(t.styleBaseUrl||"")+"#"+r.id,this.styles[f]=r)},parseKmlColor:function(n){var i=null,t;return n&&(t=n.match(this.regExes.kmlColor),t&&(i={color:"#"+t[4]+t[3]+t[2],opacity:parseInt(t[1],16)/255})),i},parseStyle:function(n){for(var f,it,rt,c,p,l,w,g,s,i,nt,b,r,t={},tt=["LineStyle","PolyStyle","IconStyle","BalloonStyle","LabelStyle"],k=0,ut=tt.length;ut>k;++k)if(b=tt[k],r=this.getElementsByTagNameNS(n,"*",b)[0])switch(b.toLowerCase()){case"linestyle":s=this.parseProperty(r,"*","color");i=this.parseKmlColor(s);i&&(t.strokeColor=i.color,t.strokeOpacity=i.opacity);f=this.parseProperty(r,"*","width");f&&(t.strokeWidth=f);break;case"polystyle":s=this.parseProperty(r,"*","color");i=this.parseKmlColor(s);i&&(t.fillOpacity=i.opacity,t.fillColor=i.color);it=this.parseProperty(r,"*","fill");"0"==it&&(t.fillColor="none");rt=this.parseProperty(r,"*","outline");"0"==rt&&(t.strokeWidth="0");break;case"iconstyle":var u=parseFloat(this.parseProperty(r,"*","scale")||1),f=32*u,y=32*u,h=this.getElementsByTagNameNS(r,"*","Icon")[0];if(h&&(c=this.parseProperty(h,"*","href"),c)){var e=this.parseProperty(h,"*","w"),o=this.parseProperty(h,"*","h");if(!OpenLayers.String.startsWith(c,"http://maps.google.com/mapfiles/kml")||e||o||(e=64,o=64,u/=2),e=e||o,o=o||e,e&&(f=parseInt(e)*u),o&&(y=parseInt(o)*u),p=c.match(this.regExes.kmlIconPalette),p){var ft=p[1],et=p[2],a=this.parseProperty(h,"*","x"),v=this.parseProperty(h,"*","y"),ot=a?a/32:0,st=v?7-v/32:7,ht=8*st+ot;c="http://maps.google.com/mapfiles/kml/pal"+ft+"/icon"+ht+et}t.graphicOpacity=1;t.externalGraphic=c}if(l=this.getElementsByTagNameNS(r,"*","hotSpot")[0],l){var a=parseFloat(l.getAttribute("x")),v=parseFloat(l.getAttribute("y")),d=l.getAttribute("xunits");"pixels"==d?t.graphicXOffset=-a*u:"insetPixels"==d?t.graphicXOffset=-f+a*u:"fraction"==d&&(t.graphicXOffset=-f*a);w=l.getAttribute("yunits");"pixels"==w?t.graphicYOffset=-y+v*u+1:"insetPixels"==w?t.graphicYOffset=-(v*u)+1:"fraction"==w&&(t.graphicYOffset=-y*(1-v)+1)}t.graphicWidth=f;t.graphicHeight=y;break;case"balloonstyle":g=OpenLayers.Util.getXmlNodeValue(r);g&&(t.balloonStyle=g.replace(this.regExes.straightBracket,"${$1}"));break;case"labelstyle":s=this.parseProperty(r,"*","color");i=this.parseKmlColor(s);i&&(t.fontColor=i.color,t.fontOpacity=i.opacity)}return!t.strokeColor&&t.fillColor&&(t.strokeColor=t.fillColor),nt=n.getAttribute("id"),nt&&t&&(t.id=nt),t},parseStyleMaps:function(n,t){for(var i=0,u=n.length;u>i;i++)for(var f=n[i],e=this.getElementsByTagNameNS(f,"*","Pair"),h=f.getAttribute("id"),r=0,c=e.length;c>r;r++){var o=e[r],l=this.parseProperty(o,"*","key"),s=this.parseProperty(o,"*","styleUrl");s&&"normal"==l&&(this.styles[(t.styleBaseUrl||"")+"#"+h]=this.styles[(t.styleBaseUrl||"")+s])}},parseFeatures:function(n,t){for(var f,i,s,h,e,c,o,r=[],u=0,l=n.length;l>u;u++){if(f=n[u],i=this.parseFeature.apply(this,[f]),!i)throw"Bad Placemark: "+u;(this.extractStyles&&i.attributes&&i.attributes.styleUrl&&(i.style=this.getStyle(i.attributes.styleUrl,t)),this.extractStyles)&&(s=this.getElementsByTagNameNS(f,"*","Style")[0],s&&(h=this.parseStyle(s),h&&(i.style=OpenLayers.Util.extend(i.style,h))));this.extractTracks?(e=this.getElementsByTagNameNS(f,this.namespaces.gx,"Track"),e&&e.length>0&&(c=e[0],o={features:[],feature:i},this.readNode(c,o),o.features.length>0&&r.push.apply(r,o.features))):r.push(i)}this.features=this.features.concat(r)},readers:{kml:{when:function(n,t){t.whens.push(OpenLayers.Date.parse(this.getChildValue(n)))},_trackPointAttribute:function(n,t){var i=n.nodeName.split(":").pop();t.attributes[i].push(this.getChildValue(n))}},gx:{Track:function(n,t){var i={whens:[],points:[],angles:[]},f,c,r,o,s,u,e,h,l;if(this.trackAttributes)for(i.attributes={},u=0,e=this.trackAttributes.length;e>u;++u)f=this.trackAttributes[u],i.attributes[f]=[],f in this.readers.kml||(this.readers.kml[f]=this.readers.kml._trackPointAttribute);if(this.readChildNodes(n,i),i.whens.length!==i.points.length)throw Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:coord ("+i.points.length+") elements.");if(c=i.angles.length>0,c&&i.whens.length!==i.angles.length)throw Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:angles ("+i.angles.length+") elements.");for(u=0,e=i.whens.length;e>u;++u){if(r=t.feature.clone(),r.fid=t.feature.fid||t.feature.id,o=i.points[u],r.geometry=o,"z"in o&&(r.attributes.altitude=o.z),this.internalProjection&&this.externalProjection&&r.geometry.transform(this.externalProjection,this.internalProjection),this.trackAttributes)for(h=0,l=this.trackAttributes.length;l>h;++h)r.attributes[f]=i.attributes[this.trackAttributes[h]][u];r.attributes.when=i.whens[u];r.attributes.trackId=t.feature.id;c&&(s=i.angles[u],r.attributes.heading=parseFloat(s[0]),r.attributes.tilt=parseFloat(s[1]),r.attributes.roll=parseFloat(s[2]));t.features.push(r)}},coord:function(n,t){var u=this.getChildValue(n),i=u.replace(this.regExes.trimSpace,"").split(/\s+/),r=new OpenLayers.Geometry.Point(i[0],i[1]);i.length>2&&(r.z=parseFloat(i[2]));t.points.push(r)},angles:function(n,t){var i=this.getChildValue(n),r=i.replace(this.regExes.trimSpace,"").split(/\s+/);t.angles.push(r)}}},parseFeature:function(n){for(var u,h,e,o,t,i,r,s=["MultiGeometry","Polygon","LineString","Point"],f=0,c=s.length;c>f;++f)if(t=s[f],this.internalns=n.namespaceURI?n.namespaceURI:this.kmlns,i=this.getElementsByTagNameNS(n,this.internalns,t),i.length>0){u=this.parseGeometry[t.toLowerCase()];u?(r=u.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&r.transform(this.externalProjection,this.internalProjection)):OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:t}));break}return this.extractAttributes&&(h=this.parseAttributes(n)),e=new OpenLayers.Feature.Vector(r,h),o=n.getAttribute("id")||n.getAttribute("name"),null!=o&&(e.fid=o),e},getStyle:function(n,t){var r=OpenLayers.Util.removeTail(n),i=OpenLayers.Util.extend({},t),u;return(i.depth++,i.styleBaseUrl=r,!this.styles[n]&&!OpenLayers.String.startsWith(n,"#")&&i.depth<=this.maxDepth&&!this.fetched[r])&&(u=this.fetchLink(r),u&&this.parseData(u,i)),OpenLayers.Util.extend({},this.styles[n])},parseGeometry:{point:function(n){var r=this.getElementsByTagNameNS(n,this.internalns,"coordinates"),t=[],i,u;if(r.length>0&&(i=r[0].firstChild.nodeValue,i=i.replace(this.regExes.removeSpace,""),t=i.split(",")),u=null,!(t.length>1))throw"Bad coordinate string: "+i;return 2==t.length&&(t[2]=null),u=new OpenLayers.Geometry.Point(t[0],t[1],t[2])},linestring:function(n,t){var s=this.getElementsByTagNameNS(n,this.internalns,"coordinates"),h=null,i;if(s.length>0){i=this.getChildValue(s[0]);i=i.replace(this.regExes.trimSpace,"");i=i.replace(this.regExes.trimComma,",");for(var r,c,f=i.split(this.regExes.splitSpace),e=f.length,o=Array(e),u=0;e>u;++u){if(r=f[u].split(","),c=r.length,!(c>1))throw"Bad LineString point coordinates: "+f[u];2==r.length&&(r[2]=null);o[u]=new OpenLayers.Geometry.Point(r[0],r[1],r[2])}if(!e)throw"Bad LineString coordinates: "+i;h=t?new OpenLayers.Geometry.LinearRing(o):new OpenLayers.Geometry.LineString(o)}return h},polygon:function(n){var i=this.getElementsByTagNameNS(n,this.internalns,"LinearRing"),u=i.length,f=Array(u),r,t,e;if(u>0)for(t=0,e=i.length;e>t;++t){if(r=this.parseGeometry.linestring.apply(this,[i[t],!0]),!r)throw"Bad LinearRing geometry: "+t;f[t]=r}return new OpenLayers.Geometry.Polygon(f)},multigeometry:function(n){for(var e,i,t,u=[],f=n.childNodes,r=0,o=f.length;o>r;++r)(t=f[r],1==t.nodeType)&&(e=t.prefix?t.nodeName.split(":")[1]:t.nodeName,i=this.parseGeometry[e.toLowerCase()],i&&u.push(i.apply(this,[t])));return new OpenLayers.Geometry.Collection(u)}},parseAttributes:function(n){var e={},s=n.getElementsByTagName("ExtendedData"),r,f,c,l,u;s.length&&(e=this.parseExtendedData(s[0]));for(var i,t,r,h=n.childNodes,o=0,a=h.length;a>o;++o)if(i=h[o],1==i.nodeType&&(t=i.childNodes,t.length>=1&&3>=t.length)){switch(t.length){case 1:r=t[0];break;case 2:f=t[0];c=t[1];r=3==f.nodeType||4==f.nodeType?f:c;break;case 3:default:r=t[1]}(3==r.nodeType||4==r.nodeType)&&(l=i.prefix?i.nodeName.split(":")[1]:i.nodeName,u=OpenLayers.Util.getXmlNodeValue(r),u&&(u=u.replace(this.regExes.trimSpace,""),e[l]=u))}return e},parseExtendedData:function(n){for(var r,u,e={},c=n.getElementsByTagName("Data"),o,s,h,i,t=0,f=c.length;f>t;t++)r=c[t],u=r.getAttribute("name"),i={},o=r.getElementsByTagName("value"),o.length&&(i.value=this.getChildValue(o[0])),s=r.getElementsByTagName("displayName"),s.length&&(i.displayName=this.getChildValue(s[0])),e[u]=i;for(h=n.getElementsByTagName("SimpleData"),t=0,f=h.length;f>t;t++)i={},r=h[t],u=r.getAttribute("name"),i.value=this.getChildValue(r),i.displayName=u,e[u]=i;return e},parseProperty:function(n,t,i){var r,u=this.getElementsByTagNameNS(n,t,i);try{r=OpenLayers.Util.getXmlNodeValue(u[0])}catch(f){r=null}return r},write:function(n){OpenLayers.Util.isArray(n)||(n=[n]);for(var i=this.createElementNS(this.kmlns,"kml"),r=this.createFolderXML(),t=0,u=n.length;u>t;++t)r.appendChild(this.createPlacemarkXML(n[t]));return i.appendChild(r),OpenLayers.Format.XML.prototype.write.apply(this,[i])},createFolderXML:function(){var n=this.createElementNS(this.kmlns,"Folder"),t,r,i,u;return this.foldersName&&(t=this.createElementNS(this.kmlns,"name"),r=this.createTextNode(this.foldersName),t.appendChild(r),n.appendChild(t)),this.foldersDesc&&(i=this.createElementNS(this.kmlns,"description"),u=this.createTextNode(this.foldersDesc),i.appendChild(u),n.appendChild(i)),n},createPlacemarkXML:function(n){var r=this.createElementNS(this.kmlns,"name"),e=n.style&&n.style.label?n.style.label:n.attributes.name||n.id,i,u,t,f;return r.appendChild(this.createTextNode(e)),i=this.createElementNS(this.kmlns,"description"),u=n.attributes.description||this.placemarksDesc,i.appendChild(this.createTextNode(u)),t=this.createElementNS(this.kmlns,"Placemark"),null!=n.fid&&t.setAttribute("id",n.fid),t.appendChild(r),t.appendChild(i),f=this.buildGeometryNode(n.geometry),t.appendChild(f),t},buildGeometryNode:function(n){var t=n.CLASS_NAME,u=t.substring(t.lastIndexOf(".")+1),i=this.buildGeometry[u.toLowerCase()],r=null;return i&&(r=i.apply(this,[n])),r},buildGeometry:{point:function(n){var t=this.createElementNS(this.kmlns,"Point");return t.appendChild(this.buildCoordinatesNode(n)),t},multipoint:function(n){return this.buildGeometry.collection.apply(this,[n])},linestring:function(n){var t=this.createElementNS(this.kmlns,"LineString");return t.appendChild(this.buildCoordinatesNode(n)),t},multilinestring:function(n){return this.buildGeometry.collection.apply(this,[n])},linearring:function(n){var t=this.createElementNS(this.kmlns,"LinearRing");return t.appendChild(this.buildCoordinatesNode(n)),t},polygon:function(n){for(var i,r,u,f=this.createElementNS(this.kmlns,"Polygon"),e=n.components,t=0,o=e.length;o>t;++t)u=0==t?"outerBoundaryIs":"innerBoundaryIs",i=this.createElementNS(this.kmlns,u),r=this.buildGeometry.linearring.apply(this,[e[t]]),i.appendChild(r),f.appendChild(i);return f},multipolygon:function(n){return this.buildGeometry.collection.apply(this,[n])},collection:function(n){for(var t,r=this.createElementNS(this.kmlns,"MultiGeometry"),i=0,u=n.components.length;u>i;++i)t=this.buildGeometryNode.apply(this,[n.components[i]]),t&&r.appendChild(t);return r}},buildCoordinatesNode:function(n){var i,u=this.createElementNS(this.kmlns,"coordinates"),r=n.components,s;if(r){for(var f,e=r.length,o=Array(e),t=0;e>t;++t)f=r[t],o[t]=this.buildCoordinates(f);i=o.join(" ")}else i=this.buildCoordinates(n);return s=this.createTextNode(i),u.appendChild(s),u},buildCoordinates:function(n){return this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection)),n.x+","+n.y},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:!1,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:!1,fixPadding:function(){"number"==typeof this.padding&&(this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding))},panMapIfOutOfView:!1,keepInMap:!1,closeOnMove:!1,map:null,initialize:function(n,t,i,r,u,f){var e,n;null==n&&(n=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"));this.id=n;this.lonlat=t;this.contentSize=null!=i?i:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);null!=r&&(this.contentHTML=r);this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;e=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(e,null,null,null,"relative",null,"hidden");n=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(n,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);u&&this.addCloseBox(f);this.registerEvents()},destroy:function(){this.id=null;this.lonlat=null;this.size=null;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null;this.closeOnMove&&this.map&&this.map.events.unregister("movestart",this,this.hide);this.events.destroy();this.events=null;this.closeDiv&&(OpenLayers.Event.stopObservingElement(this.closeDiv),this.groupDiv.removeChild(this.closeDiv));this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;null!=this.map&&this.map.removePopup(this);this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;this.padding=null;this.panMapIfOutOfView=null},draw:function(n){return null==n&&null!=this.lonlat&&null!=this.map&&(n=this.map.getLayerPxFromLonLat(this.lonlat)),this.closeOnMove&&this.map.events.register("movestart",this,this.hide),this.disableFirefoxOverflowHack||"firefox"!=OpenLayers.BROWSER_NAME||(this.map.events.register("movestart",this,function(){var t=document.defaultView.getComputedStyle(this.contentDiv,null),n=t.getPropertyValue("overflow");"hidden"!=n&&(this.contentDiv._oldOverflow=n,this.contentDiv.style.overflow="hidden")}),this.map.events.register("moveend",this,function(){var n=this.contentDiv._oldOverflow;n&&(this.contentDiv.style.overflow=n,this.contentDiv._oldOverflow=null)})),this.moveTo(n),this.autoSize||this.size||this.setSize(this.contentSize),this.setBackgroundColor(),this.setOpacity(),this.setBorder(),this.setContentHTML(),this.panMapIfOutOfView&&this.panIntoView(),this.div},updatePosition:function(){if(this.lonlat&&this.map){var n=this.map.getLayerPxFromLonLat(this.lonlat);n&&this.moveTo(n)}},moveTo:function(n){null!=n&&null!=this.div&&(this.div.style.left=n.x+"px",this.div.style.top=n.y+"px")},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){this.visible()?this.hide():this.show()},show:function(){this.div.style.display="";this.panMapIfOutOfView&&this.panIntoView()},hide:function(){this.div.style.display="none"},setSize:function(n){var u;this.size=n.clone();var t=this.getContentDivPadding(),i=t.left+t.right,r=t.top+t.bottom;(this.fixPadding(),i+=this.padding.left+this.padding.right,r+=this.padding.top+this.padding.bottom,this.closeDiv)&&(u=parseInt(this.closeDiv.style.width),i+=u+t.right);this.size.w+=i;this.size.h+=r;"msie"==OpenLayers.BROWSER_NAME&&(this.contentSize.w+=t.left+t.right,this.contentSize.h+=t.bottom+t.top);null!=this.div&&(this.div.style.width=this.size.w+"px",this.div.style.height=this.size.h+"px");null!=this.contentDiv&&(this.contentDiv.style.width=n.w+"px",this.contentDiv.style.height=n.h+"px")},updateSize:function(){var e="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"<\/div>",o=this.map?this.map.layerContainerDiv:document.body,i=OpenLayers.Util.getRenderedDimensions(e,null,{displayClass:this.displayClass,containerElement:o}),n=this.getSafeContentSize(i),u=null,t,r,s,f;n.equals(i)?u=i:(t=new OpenLayers.Size,(t.w=n.w<i.w?n.w:null,t.h=n.h<i.h?n.h:null,t.w&&t.h)?u=n:(r=OpenLayers.Util.getRenderedDimensions(e,t,{displayClass:this.contentDisplayClass,containerElement:o}),s=OpenLayers.Element.getStyle(this.contentDiv,"overflow"),"hidden"!=s&&r.equals(n)&&(f=OpenLayers.Util.getScrollbarWidth(),t.w?r.h+=f:r.w+=f),u=this.getSafeContentSize(r)));this.setSize(u)},setBackgroundColor:function(n){void 0!=n&&(this.backgroundColor=n);null!=this.div&&(this.div.style.backgroundColor=this.backgroundColor)},setOpacity:function(n){void 0!=n&&(this.opacity=n);null!=this.div&&(this.div.style.opacity=this.opacity,this.div.style.filter="alpha(opacity="+100*this.opacity+")")},setBorder:function(n){void 0!=n&&(this.border=n);null!=this.div&&(this.div.style.border=this.border)},setContentHTML:function(n){null!=n&&(this.contentHTML=n);null!=this.contentDiv&&null!=this.contentHTML&&this.contentHTML!=this.contentDiv.innerHTML&&(this.contentDiv.innerHTML=this.contentHTML,this.autoSize&&(this.registerImageListeners(),this.updateSize()))},registerImageListeners:function(){for(var n,r,u=function(){this.popup.updateSize();this.popup.visible()&&this.popup.panMapIfOutOfView&&this.popup.panIntoView();OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)},i=this.contentDiv.getElementsByTagName("img"),t=0,f=i.length;f>t;t++)n=i[t],(0==n.width||0==n.height)&&(r={popup:this,img:n},n._onImgLoad=OpenLayers.Function.bind(u,r),OpenLayers.Event.observe(n,"load",n._onImgLoad))},getSafeContentSize:function(n){var t=n.clone(),f=this.getContentDivPadding(),e=f.left+f.right,o=f.top+f.bottom,s,r,u,i,h,c;if((this.fixPadding(),e+=this.padding.left+this.padding.right,o+=this.padding.top+this.padding.bottom,this.closeDiv)&&(s=parseInt(this.closeDiv.style.width),e+=s+f.right),this.minSize&&(t.w=Math.max(t.w,this.minSize.w-e),t.h=Math.max(t.h,this.minSize.h-o)),this.maxSize&&(t.w=Math.min(t.w,this.maxSize.w-e),t.h=Math.min(t.h,this.maxSize.h-o)),this.map&&this.map.size){if(r=0,u=0,this.keepInMap&&!this.panMapIfOutOfView){i=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":r=i.x;u=this.map.size.h-i.y;break;case"tl":r=this.map.size.w-i.x;u=this.map.size.h-i.y;break;case"bl":r=this.map.size.w-i.x;u=i.y;break;case"br":r=i.x;u=i.y;break;default:r=i.x;u=this.map.size.h-i.y}}h=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-o-u;c=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-e-r;t.w=Math.min(t.w,c);t.h=Math.min(t.h,h)}return t},getContentDivPadding:function(){var n=this._contentDivPadding;return n||(null==this.div.parentNode&&(this.div.style.display="none",document.body.appendChild(this.div)),n=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top")),this._contentDivPadding=n,this.div.parentNode==document.body&&(document.body.removeChild(this.div),this.div.style.display="")),n},addCloseBox:function(n){var t,i;this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";t=this.getContentDivPadding();this.closeDiv.style.right=t.right+"px";this.closeDiv.style.top=t.top+"px";this.groupDiv.appendChild(this.closeDiv);i=n||function(n){this.hide();OpenLayers.Event.stop(n)};OpenLayers.Event.observe(this.closeDiv,"touchend",OpenLayers.Function.bindAsEventListener(i,this));OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(i,this))},panIntoView:function(){var i=this.map.getSize(),n=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top))),t=n.clone(),r,u;n.x<this.map.paddingForPopups.left?t.x=this.map.paddingForPopups.left:n.x+this.size.w>i.w-this.map.paddingForPopups.right&&(t.x=i.w-this.map.paddingForPopups.right-this.size.w);n.y<this.map.paddingForPopups.top?t.y=this.map.paddingForPopups.top:n.y+this.size.h>i.h-this.map.paddingForPopups.bottom&&(t.y=i.h-this.map.paddingForPopups.bottom-this.size.h);r=n.x-t.x;u=n.y-t.y;this.map.pan(r,u)},registerEvents:function(){function n(n){OpenLayers.Event.stop(n,!0)}this.events=new OpenLayers.Events(this,this.div,null,!0);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,touchstart:n,scope:this})},onmousedown:function(n){this.mousedown=!0;OpenLayers.Event.stop(n,!0)},onmousemove:function(n){this.mousedown&&OpenLayers.Event.stop(n,!0)},onmouseup:function(n){this.mousedown&&(this.mousedown=!1,OpenLayers.Event.stop(n,!0))},onclick:function(n){OpenLayers.Event.stop(n,!0)},onmouseout:function(){this.mousedown=!1},ondblclick:function(n){OpenLayers.Event.stop(n,!0)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:!0,anchor:null,initialize:function(n,t,i,r,u,f,e){var o=[n,t,i,r,f,e];OpenLayers.Popup.prototype.initialize.apply(this,o);this.anchor=null!=u?u:{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(n){var r=this.relativePosition,t,i;this.relativePosition=this.calculateRelativePosition(n);t=this.calculateNewPx(n);i=Array(t);OpenLayers.Popup.prototype.moveTo.apply(this,i);this.relativePosition!=r&&this.updateRelativePosition()},setSize:function(){if(OpenLayers.Popup.prototype.setSize.apply(this,arguments),this.lonlat&&this.map){var n=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(n)}},calculateRelativePosition:function(n){var t=this.map.getLonLatFromLayerPx(n),i=this.map.getExtent(),r=i.determineQuadrant(t);return OpenLayers.Bounds.oppositeQuadrant(r)},updateRelativePosition:function(){},calculateNewPx:function(n){var t=n.offset(this.anchor.offset),i=this.size||this.contentSize,u="t"==this.relativePosition.charAt(0),r;return t.y+=u?-i.h:this.anchor.size.h,r="l"==this.relativePosition.charAt(1),t.x+=r?-i.w:this.anchor.size.w,t},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Rico=OpenLayers.Rico||{};OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(n,t,i){this.rgb={r:n,g:t,b:i}},setRed:function(n){this.rgb.r=n},setGreen:function(n){this.rgb.g=n},setBlue:function(n){this.rgb.b=n},setHue:function(n){var t=this.asHSB();t.h=n;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setSaturation:function(n){var t=this.asHSB();t.s=n;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setBrightness:function(n){var t=this.asHSB();t.b=n;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},darken:function(n){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.max(t.b-n,0))},brighten:function(n){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.min(t.b+n,1))},blend:function(n){this.rgb.r=Math.floor((this.rgb.r+n.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+n.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+n.rgb.b)/2)},isBright:function(){return this.asHSB(),this.asHSB().b>.5},isDark:function(){return!this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}});OpenLayers.Rico.Color.createFromHex=function(n){if(4==n.length)for(var i=n,n="#",t=1;4>t;t++)n+=i.charAt(t)+i.charAt(t);0==n.indexOf("#")&&(n=n.substring(1));var r=n.substring(0,2),u=n.substring(2,4),f=n.substring(4,6);return new OpenLayers.Rico.Color(parseInt(r,16),parseInt(u,16),parseInt(f,16))};OpenLayers.Rico.Color.createColorFromBackground=function(n){var t=OpenLayers.Element.getStyle(OpenLayers.Util.getElement(n),"backgroundColor"),r,i;return"transparent"==t&&n.parentNode?OpenLayers.Rico.Color.createColorFromBackground(n.parentNode):null==t?new OpenLayers.Rico.Color(255,255,255):0==t.indexOf("rgb(")?(r=t.substring(4,t.length-1),i=r.split(","),new OpenLayers.Rico.Color(parseInt(i[0]),parseInt(i[1]),parseInt(i[2]))):0==t.indexOf("#")?OpenLayers.Rico.Color.createFromHex(t):new OpenLayers.Rico.Color(255,255,255)};OpenLayers.Rico.Color.HSBtoRGB=function(n,t,i){var r=0,u=0,f=0;if(0==t)r=parseInt(255*i+.5),u=r,f=r;else{var o=6*(n-Math.floor(n)),c=o-Math.floor(o),e=i*(1-t),s=i*(1-t*c),h=i*(1-t*(1-c));switch(parseInt(o)){case 0:r=255*i+.5;u=255*h+.5;f=255*e+.5;break;case 1:r=255*s+.5;u=255*i+.5;f=255*e+.5;break;case 2:r=255*e+.5;u=255*i+.5;f=255*h+.5;break;case 3:r=255*e+.5;u=255*s+.5;f=255*i+.5;break;case 4:r=255*h+.5;u=255*e+.5;f=255*i+.5;break;case 5:r=255*i+.5;u=255*e+.5;f=255*s+.5}}return{r:parseInt(r),g:parseInt(u),b:parseInt(f)}};OpenLayers.Rico.Color.RGBtoHSB=function(n,t,i){var f,e,o,r=n>t?n:t,u;if(i>r&&(r=i),u=t>n?n:t,u>i&&(u=i),o=r/255,e=0!=r?(r-u)/r:0,0==e)f=0;else{var s=(r-n)/(r-u),h=(r-t)/(r-u),c=(r-i)/(r-u);f=n==r?c-h:t==r?2+s-c:4+h-s;f/=6;0>f&&(f+=1)}return{h:f,s:e,b:o}};OpenLayers.Rico=OpenLayers.Rico||{};OpenLayers.Rico.Corner={round:function(n,t){var i,r;n=OpenLayers.Util.getElement(n);this._setOptions(t);i=this.options.color;"fromElement"==this.options.color&&(i=this._background(n));r=this.options.bgColor;"fromParent"==this.options.bgColor&&(r=this._background(n.offsetParent));this._roundCornersImpl(n,i,r)},changeColor:function(n,t){n.style.backgroundColor=t;for(var r=n.parentNode.getElementsByTagName("span"),i=0;r.length>i;i++)r[i].style.backgroundColor=t},changeOpacity:function(n,t){var u=t,f="alpha(opacity="+100*t+")",r,i;for(n.style.opacity=u,n.style.filter=f,r=n.parentNode.getElementsByTagName("span"),i=0;r.length>i;i++)r[i].style.opacity=u,r[i].style.filter=f},reRound:function(n,t){var i=n.parentNode.childNodes[0],r=n.parentNode.childNodes[2];n.parentNode.removeChild(i);n.parentNode.removeChild(r);this.round(n.parentNode,t)},_roundCornersImpl:function(n,t,i){this.options.border&&this._renderBorder(n,i);this._isTopRounded()&&this._roundTopCorners(n,t,i);this._isBottomRounded()&&this._roundBottomCorners(n,t,i)},_renderBorder:function(n,t){var i="1px solid "+this._borderColor(t),r="border-left: "+i,u="border-right: "+i,f="style='"+r+";"+u+"'";n.innerHTML="<div "+f+">"+n.innerHTML+"<\/div>"},_roundTopCorners:function(n,t,i){for(var u=this._createCorner(i),r=0;this.options.numSlices>r;r++)u.appendChild(this._createCornerSlice(t,i,r,"top"));n.style.paddingTop=0;n.insertBefore(u,n.firstChild)},_roundBottomCorners:function(n,t,i){for(var u=this._createCorner(i),r=this.options.numSlices-1;r>=0;r--)u.appendChild(this._createCornerSlice(t,i,r,"bottom"));n.style.paddingBottom=0;n.appendChild(u)},_createCorner:function(n){var t=document.createElement("div");return t.style.backgroundColor=this._isTransparent()?"transparent":n,t},_createCornerSlice:function(n,t,i,r){var f=document.createElement("span"),u=f.style,e;return u.backgroundColor=n,u.display="block",u.height="1px",u.overflow="hidden",u.fontSize="1px",e=this._borderColor(n,t),this.options.border&&0==i?(u.borderTopStyle="solid",u.borderTopWidth="1px",u.borderLeftWidth="0px",u.borderRightWidth="0px",u.borderBottomWidth="0px",u.height="0px",u.borderColor=e):e&&(u.borderColor=e,u.borderStyle="solid",u.borderWidth="0px 1px"),this.options.compact||i!=this.options.numSlices-1||(u.height="2px"),this._setMargin(f,i,r),this._setBorder(f,i,r),f},_setOptions:function(n){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:!0,border:!1,compact:!1};OpenLayers.Util.extend(this.options,n||{});this.options.numSlices=this.options.compact?2:4;this._isTransparent()&&(this.options.blend=!1)},_whichSideTop:function(){return this._hasString(this.options.corners,"all","top")?"":this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0?"":this.options.corners.indexOf("tl")>=0?"left":this.options.corners.indexOf("tr")>=0?"right":""},_whichSideBottom:function(){return this._hasString(this.options.corners,"all","bottom")?"":this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0?"":this.options.corners.indexOf("bl")>=0?"left":this.options.corners.indexOf("br")>=0?"right":""},_borderColor:function(n,t){return"transparent"==n?t:this.options.border?this.options.border:this.options.blend?this._blend(t,n):""},_setMargin:function(n,t,i){var r=this._marginSize(t),u="top"==i?this._whichSideTop():this._whichSideBottom();"left"==u?(n.style.marginLeft=r+"px",n.style.marginRight="0px"):"right"==u?(n.style.marginRight=r+"px",n.style.marginLeft="0px"):(n.style.marginLeft=r+"px",n.style.marginRight=r+"px")},_setBorder:function(n,t,i){var r=this._borderSize(t),u="top"==i?this._whichSideTop():this._whichSideBottom();"left"==u?(n.style.borderLeftWidth=r+"px",n.style.borderRightWidth="0px"):"right"==u?(n.style.borderRightWidth=r+"px",n.style.borderLeftWidth="0px"):(n.style.borderLeftWidth=r+"px",n.style.borderRightWidth=r+"px");0!=this.options.border&&(n.style.borderLeftWidth=r+"px",n.style.borderRightWidth=r+"px")},_marginSize:function(n){if(this._isTransparent())return 0;return this.options.compact&&this.options.blend?[1,0][n]:this.options.compact?[2,1][n]:this.options.blend?[3,2,1,0][n]:[5,3,2,1][n]},_borderSize:function(n){return this.options.compact&&(this.options.blend||this._isTransparent())?1:this.options.compact?[1,0][n]:this.options.blend?[2,1,1,1][n]:this.options.border?[0,2,0,0][n]:this._isTransparent()?[5,3,2,1][n]:0},_hasString:function(n){for(var t=1;arguments.length>t;t++)if(n.indexOf(arguments[t])>=0)return!0;return!1},_blend:function(n,t){var i=OpenLayers.Rico.Color.createFromHex(n);return i.blend(OpenLayers.Rico.Color.createFromHex(t)),i},_background:function(n){try{return OpenLayers.Rico.Color.createColorFromBackground(n).asHex()}catch(t){return"#ffffff"}},_isTransparent:function(){return"transparent"==this.options.color},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(n){return 1==n.childNodes.length&&3==n.childNodes[0].nodeType}};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:!1,initialize:function(){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(){return OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments),this.setContentHTML(),this.setBackgroundColor(),this.setOpacity(),this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(n){void 0!=n&&(this.backgroundColor=n);null!=this.div&&null!=this.contentDiv&&(this.div.style.background="transparent",OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor))},setOpacity:function(n){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,n);null!=this.div&&null!=this.groupDiv&&OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)},setBorder:function(){this.border=0},setRicoCorners:function(){var t=this.getCornersToRound(this.relativePosition),n={corners:t,color:this.backgroundColor,bgColor:"transparent",blend:!1};this.rounded?(OpenLayers.Rico.Corner.reRound(this.groupDiv,n),this.setBackgroundColor(),this.setOpacity()):(OpenLayers.Rico.Corner.round(this.div,n),this.rounded=!0)},getCornersToRound:function(){var n=["tl","tr","bl","br"],t=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);return OpenLayers.Util.removeItem(n,t),n.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,readFormat:null,readOptions:null,initialize:function(n){OpenLayers.Protocol.prototype.initialize.apply(this,[n]);n.format||(this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions)));!n.geometryName&&parseFloat(this.format.version)>1&&this.setGeometryName(null)},destroy:function(){this.options&&!this.options.format&&this.format.destroy();this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(n){OpenLayers.Protocol.prototype.read.apply(this,arguments);n=OpenLayers.Util.extend({},n);OpenLayers.Util.applyDefaults(n,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",n)]);return t.priv=OpenLayers.Request.POST({url:n.url,callback:this.createCallback(this.handleRead,t,n),params:n.params,headers:n.headers,data:i}),t},setFeatureType:function(n){this.featureType=n;this.format.featureType=n},setGeometryName:function(n){this.geometryName=n;this.format.geometryName=n},handleRead:function(n,t){var r,i;(t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options),t.callback)&&(r=n.priv,r.status>=200&&300>r.status?(i=this.parseResponse(r,t.readOptions),i&&i.success!==!1?(t.readOptions&&"object"==t.readOptions.output?OpenLayers.Util.extend(n,i):n.features=i,n.code=OpenLayers.Protocol.Response.SUCCESS):(n.code=OpenLayers.Protocol.Response.FAILURE,n.error=i)):n.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,n))},parseResponse:function(n,t){var i=n.responseXML,u,r;return(i&&i.documentElement||(i=n.responseText),!i||0>=i.length)?null:(u=null!==this.readFormat?this.readFormat.read(i):this.format.read(i,t),this.featureNS||(r=this.readFormat||this.format,this.featureNS=r.featureNS,r.autoConfig=!1,this.geometryName||this.setGeometryName(r.geometryName)),u)},commit:function(n,t){t=OpenLayers.Util.extend({},t);OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:n});return i.priv=OpenLayers.Request.POST({url:t.url,headers:t.headers,data:this.format.write(n,t),callback:this.createCallback(this.handleCommit,i,t)}),i},handleCommit:function(n,t){var u,i,r;t.callback&&(u=n.priv,i=u.responseXML,i&&i.documentElement||(i=u.responseText),r=this.format.read(i)||{},n.insertIds=r.insertIds||[],r.success?n.code=OpenLayers.Protocol.Response.SUCCESS:(n.code=OpenLayers.Protocol.Response.FAILURE,n.error=r),t.callback.call(t.scope,n))},filterDelete:function(n,t){var r,i,u,f;return t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options),new OpenLayers.Protocol.Response({requestType:"commit"}),r=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}}),i=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(t.featureNS?this.featurePrefix+":":"")+t.featureType}}),t.featureNS&&i.setAttribute("xmlns:"+this.featurePrefix,t.featureNS),u=this.format.writeNode("ogc:Filter",n),i.appendChild(u),r.appendChild(i),f=OpenLayers.Format.XML.prototype.write.apply(this.format,[r]),OpenLayers.Request.POST({url:this.url,callback:t.callback||function(){},data:f})},abort:function(n){n&&n.priv.abort()},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:!1,mouseDown:!1,stoppedDown:null,lastDown:null,lastUp:null,persist:!1,stopDown:!1,stopUp:!1,layerOptions:null,pixelTolerance:5,touch:!1,lastTouchPx:null,initialize:function(n,t,i){i&&i.layerOptions&&i.layerOptions.styleMap||(this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{}));OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments))return!1;var n=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True},this.layerOptions);return this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,n),this.map.addLayer(this.layer),!0},createFeature:function(n){var t=this.map.getLonLatFromPixel(n),i=new OpenLayers.Geometry.Point(t.lon,t.lat);this.point=new OpenLayers.Feature.Vector(i);this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:!0})},deactivate:function(){return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)?(this.cancel(),null!=this.layer.map&&(this.destroyFeature(!0),this.layer.destroy(!1)),this.layer=null,this.touch=!1,!0):!1},destroyFeature:function(n){this.layer&&(n||!this.persist)&&this.layer.destroyFeatures();this.point=null},destroyPersistedFeature:function(){var n=this.layer;n&&n.features.length>1&&this.layer.features[0].destroy()},finalize:function(n){var t=n?"cancel":"done";this.mouseDown=!1;this.lastDown=null;this.lastUp=null;this.lastTouchPx=null;this.callback(t,[this.geometryClone()]);this.destroyFeature(n)},cancel:function(){this.finalize(!0)},click:function(n){return OpenLayers.Event.stop(n),!1},dblclick:function(n){return OpenLayers.Event.stop(n),!1},modifyFeature:function(n){this.point||this.createFeature(n);var t=this.map.getLonLatFromPixel(n);this.point.geometry.x=t.lon;this.point.geometry.y=t.lat;this.callback("modify",[this.point.geometry,this.point,!1]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var n=this.point&&this.point.geometry;return n&&this.multi&&(n=new OpenLayers.Geometry.MultiPoint([n])),n},geometryClone:function(){var n=this.getGeometry();return n&&n.clone()},mousedown:function(n){return this.down(n)},touchstart:function(n){return this.touch||(this.touch=!0,this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,mousemove:this.mousemove,click:this.click,dblclick:this.dblclick,scope:this})),this.lastTouchPx=n.xy,this.down(n)},mousemove:function(n){return this.move(n)},touchmove:function(n){return this.lastTouchPx=n.xy,this.move(n)},mouseup:function(n){return this.up(n)},touchend:function(n){return n.xy=this.lastTouchPx,this.up(n)},down:function(n){return this.mouseDown=!0,this.lastDown=n.xy,this.touch||this.modifyFeature(n.xy),this.stoppedDown=this.stopDown,!this.stopDown},move:function(n){return this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(n.xy),!0},up:function(n){return this.mouseDown=!1,this.stoppedDown=this.stopDown,this.checkModifiers(n)?this.lastUp&&this.lastUp.equals(n.xy)?!0:this.lastDown&&this.passesTolerance(this.lastDown,n.xy,this.pixelTolerance)?(this.touch&&this.modifyFeature(n.xy),this.persist&&this.destroyPersistedFeature(),this.lastUp=n.xy,this.finalize(),!this.stopUp):!0:!0},mouseout:function(n){OpenLayers.Util.mouseLeft(n,this.map.eventsDiv)&&(this.stoppedDown=this.stopDown,this.mouseDown=!1)},passesTolerance:function(n,t,i){var r=!0,u;return null!=i&&n&&t&&(u=n.distanceTo(t),u>i&&(r=!1)),r},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,maxVertices:null,doubleTouchTolerance:20,freehand:!1,freehandToggle:"shiftKey",timerId:null,redoStack:null,initialize:function(){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(n){var t=this.map.getLonLatFromPixel(n),i=new OpenLayers.Geometry.Point(t.lon,t.lat);this.point=new OpenLayers.Feature.Vector(i);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:!0})},destroyFeature:function(n){OpenLayers.Handler.Point.prototype.destroyFeature.call(this,n);this.line=null},destroyPersistedFeature:function(){var n=this.layer;n&&n.features.length>2&&this.layer.features[0].destroy()},removePoint:function(){this.point&&this.layer.removeFeatures([this.point])},addPoint:function(n){this.layer.removeFeatures([this.point]);var t=this.control.map.getLonLatFromPixel(n);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.layer.addFeatures([this.point]);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature();delete this.redoStack},insertXY:function(n,t){this.line.geometry.addComponent(new OpenLayers.Geometry.Point(n,t),this.getCurrentPointIndex());this.drawFeature();delete this.redoStack},insertDeltaXY:function(n,t){var r=this.getCurrentPointIndex()-1,i=this.line.geometry.components[r];!i||isNaN(i.x)||isNaN(i.y)||this.insertXY(i.x+n,i.y+t)},insertDirectionLength:function(n,t){n*=Math.PI/180;var i=t*Math.cos(n),r=t*Math.sin(n);this.insertDeltaXY(i,r)},insertDeflectionLength:function(n,t){var i=this.getCurrentPointIndex()-1;if(i>0){var r=this.line.geometry.components[i],u=this.line.geometry.components[i-1],f=Math.atan2(r.y-u.y,r.x-u.x);this.insertDirectionLength(180*f/Math.PI+n,t)}},getCurrentPointIndex:function(){return this.line.geometry.components.length-1},undo:function(){var n=this.line.geometry,r=n.components,u=this.getCurrentPointIndex()-1,t=r[u],i=n.removeComponent(t);return i&&(this.redoStack||(this.redoStack=[]),this.redoStack.push(t),this.drawFeature()),i},redo:function(){var n=this.redoStack&&this.redoStack.pop();return n&&(this.line.geometry.addComponent(n,this.getCurrentPointIndex()),this.drawFeature()),!!n},freehandMode:function(n){return this.freehandToggle&&n[this.freehandToggle]?!this.freehand:this.freehand},modifyFeature:function(n,t){this.line||this.createFeature(n);var i=this.control.map.getLonLatFromPixel(n);this.point.geometry.x=i.lon;this.point.geometry.y=i.lat;this.callback("modify",[this.point.geometry,this.getSketch(),t]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var n=this.line&&this.line.geometry;return n&&this.multi&&(n=new OpenLayers.Geometry.MultiLineString([n])),n},touchstart:function(n){return this.timerId&&this.passesTolerance(this.lastTouchPx,n.xy,this.doubleTouchTolerance)?(this.finishGeometry(),window.clearTimeout(this.timerId),this.timerId=null,!1):(this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null),this.timerId=window.setTimeout(OpenLayers.Function.bind(function(){this.timerId=null},this),300),OpenLayers.Handler.Point.prototype.touchstart.call(this,n))},down:function(n){var t=this.stopDown;return this.freehandMode(n)&&(t=!0),this.touch||this.lastDown&&this.passesTolerance(this.lastDown,n.xy,this.pixelTolerance)||this.modifyFeature(n.xy,!!this.lastUp),this.mouseDown=!0,this.lastDown=n.xy,this.stoppedDown=t,!t},move:function(n){return this.stoppedDown&&this.freehandMode(n)?(this.persist&&this.destroyPersistedFeature(),this.addPoint(n.xy),!1):(this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(n.xy,!!this.lastUp),!0)},up:function(n){return!this.mouseDown||this.lastUp&&this.lastUp.equals(n.xy)||(this.stoppedDown&&this.freehandMode(n)?(this.persist&&this.destroyPersistedFeature(),this.removePoint(),this.finalize()):this.passesTolerance(this.lastDown,n.xy,this.pixelTolerance)&&(this.touch&&this.modifyFeature(n.xy),null==this.lastUp&&this.persist&&this.destroyPersistedFeature(),this.addPoint(n.xy),this.lastUp=n.xy,this.line.geometry.components.length===this.maxVertices+1&&this.finishGeometry())),this.stoppedDown=this.stopDown,this.mouseDown=!1,!this.stopUp},finishGeometry:function(){var n=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[n]);this.removePoint();this.finalize()},dblclick:function(n){return this.freehandMode(n)||this.finishGeometry(),!1},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Layer.GML=OpenLayers.Class(OpenLayers.Layer.Vector,{loaded:!1,format:null,formatOptions:null,initialize:function(n,t,i){var r=[];r.push(n,i);OpenLayers.Layer.Vector.prototype.initialize.apply(this,r);this.url=t},setVisibility:function(){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);this.visibility&&!this.loaded&&this.loadGML()},moveTo:function(){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments);this.visibility&&!this.loaded&&this.loadGML()},loadGML:function(){this.loaded||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.url,success:this.requestSuccess,failure:this.requestFailure,scope:this}),this.loaded=!0)},setUrl:function(n){this.url=n;this.destroyFeatures();this.loaded=!1;this.loadGML()},requestSuccess:function(n){var i=n.responseXML,t,r;i&&i.documentElement||(i=n.responseText);t={};OpenLayers.Util.extend(t,this.formatOptions);this.map&&!this.projection.equals(this.map.getProjectionObject())&&(t.externalProjection=this.projection,t.internalProjection=this.map.getProjectionObject());r=this.format?new this.format(t):new OpenLayers.Format.GML(t);this.addFeatures(r.read(i));this.events.triggerEvent("loadend")},requestFailure:function(){OpenLayers.Console.userError(OpenLayers.i18n("errorLoadingGML",{url:this.url}));this.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Layer.GML"});OpenLayers.Format.Context=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{layerOptions:null,layerParams:null,read:function(n,t){var r,u=OpenLayers.Format.XML.VersionedOGC.prototype.read.apply(this,arguments),i;return t&&t.map?(this.context=u,t.map instanceof OpenLayers.Map)?r=this.mergeContextToMap(u,t.map):(i=t.map,(OpenLayers.Util.isElement(i)||"string"==typeof i)&&(i={div:i}),r=this.contextToMap(u,i)):r=u,r},getLayerFromContext:function(n){var i,e,t={queryable:n.queryable,visibility:n.visibility,maxExtent:n.maxExtent,metadata:OpenLayers.Util.applyDefaults(n.metadata,{styles:n.styles,formats:n.formats,abstract:n.abstract,dataURL:n.dataURL}),numZoomLevels:n.numZoomLevels,units:n.units,isBaseLayer:n.isBaseLayer,opacity:n.opacity,displayInLayerSwitcher:n.displayInLayerSwitcher,singleTile:n.singleTile,tileSize:n.tileSize?new OpenLayers.Size(n.tileSize.width,n.tileSize.height):void 0,minScale:n.minScale||n.maxScaleDenominator,maxScale:n.maxScale||n.minScaleDenominator,srs:n.srs,dimensions:n.dimensions,metadataURL:n.metadataURL},r,s,f,u,o;if(this.layerOptions&&OpenLayers.Util.applyDefaults(t,this.layerOptions),r={layers:n.name,transparent:n.transparent,version:n.version},n.formats&&n.formats.length>0)for(r.format=n.formats[0].value,i=0,e=n.formats.length;e>i;i++)if(s=n.formats[i],1==s.current){r.format=s.value;break}if(n.styles&&n.styles.length>0)for(i=0,e=n.styles.length;e>i;i++)if(f=n.styles[i],1==f.current){f.href?r.sld=f.href:f.body?r.sld_body=f.body:r.styles=f.name;break}return this.layerParams&&OpenLayers.Util.applyDefaults(r,this.layerParams),u=null,o=n.service,o==OpenLayers.Format.Context.serviceTypes.WFS?(t.strategies=[new OpenLayers.Strategy.BBOX],t.protocol=new OpenLayers.Protocol.WFS({url:n.url,featurePrefix:n.name.split(":")[0],featureType:n.name.split(":").pop()}),u=new OpenLayers.Layer.Vector(n.title||n.name,t)):o==OpenLayers.Format.Context.serviceTypes.KML?(t.strategies=[new OpenLayers.Strategy.Fixed],t.protocol=new OpenLayers.Protocol.HTTP({url:n.url,format:new OpenLayers.Format.KML}),u=new OpenLayers.Layer.Vector(n.title||n.name,t)):o==OpenLayers.Format.Context.serviceTypes.GML?(t.strategies=[new OpenLayers.Strategy.Fixed],t.protocol=new OpenLayers.Protocol.HTTP({url:n.url,format:new OpenLayers.Format.GML}),u=new OpenLayers.Layer.Vector(n.title||n.name,t)):n.features?(u=new OpenLayers.Layer.Vector(n.title||n.name,t),u.addFeatures(n.features)):n.categoryLayer!==!0&&(u=new OpenLayers.Layer.WMS(n.title||n.name,n.url,r,t)),u},getLayersFromContext:function(n){for(var i,r=[],t=0,u=n.length;u>t;t++)i=this.getLayerFromContext(n[t]),null!==i&&r.push(i);return r},contextToMap:function(n,t){var r,i;return t=OpenLayers.Util.applyDefaults({maxExtent:n.maxExtent,projection:n.projection,units:n.units},t),t.maxExtent&&(t.maxResolution=t.maxExtent.getWidth()/OpenLayers.Map.TILE_WIDTH),r={contactInformation:n.contactInformation,abstract:n.abstract,keywords:n.keywords,logo:n.logo,descriptionURL:n.descriptionURL},t.metadata=r,i=new OpenLayers.Map(t),i.addLayers(this.getLayersFromContext(n.layersContext)),i.setCenter(n.bounds.getCenterLonLat(),i.getZoomForExtent(n.bounds,!0)),i},mergeContextToMap:function(n,t){return t.addLayers(this.getLayersFromContext(n.layersContext)),t},write:function(n){return n=this.toContext(n),OpenLayers.Format.XML.VersionedOGC.prototype.write.apply(this,arguments)},CLASS_NAME:"OpenLayers.Format.Context"});OpenLayers.Format.Context.serviceTypes={WMS:"urn:ogc:serviceType:WMS",WFS:"urn:ogc:serviceType:WFS",WCS:"urn:ogc:serviceType:WCS",GML:"urn:ogc:serviceType:GML",SLD:"urn:ogc:serviceType:SLD",FES:"urn:ogc:serviceType:FES",KML:"urn:ogc:serviceType:KML"};OpenLayers.Format.WMC=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"1.1.0",layerToContext:function(n){var e=this.getParser(),i={queryable:n.queryable,visibility:n.visibility,name:n.params.LAYERS,title:n.name,abstract:n.metadata.abstract,dataURL:n.metadata.dataURL,metadataURL:n.metadataURL,server:{version:n.params.VERSION,url:n.url},maxExtent:n.maxExtent,transparent:n.params.TRANSPARENT,numZoomLevels:n.numZoomLevels,units:n.units,isBaseLayer:n.isBaseLayer,opacity:n.opacity,displayInLayerSwitcher:n.displayInLayerSwitcher,singleTile:n.singleTile,tileSize:n.singleTile||!n.tileSize?void 0:{width:n.tileSize.w,height:n.tileSize.h},minScale:n.options.resolutions||n.options.scales||n.options.maxResolution||n.options.minScale?n.minScale:void 0,maxScale:n.options.resolutions||n.options.scales||n.options.minResolution||n.options.maxScale?n.maxScale:void 0,formats:[],styles:[],srs:n.srs,dimensions:n.dimensions},f,t,u,r;if(n.metadata.servertitle&&(i.server.title=n.metadata.servertitle),n.metadata.formats&&n.metadata.formats.length>0)for(t=0,u=n.metadata.formats.length;u>t;t++)f=n.metadata.formats[t],i.formats.push({value:f.value,current:f.value==n.params.FORMAT});else i.formats.push({value:n.params.FORMAT,current:!0});if(n.metadata.styles&&n.metadata.styles.length>0)for(t=0,u=n.metadata.styles.length;u>t;t++)r=n.metadata.styles[t],r.current=r.href==n.params.SLD||r.body==n.params.SLD_BODY||r.name==n.params.STYLES?!0:!1,i.styles.push(r);else i.styles.push({href:n.params.SLD,body:n.params.SLD_BODY,name:n.params.STYLES||e.defaultStyleName,title:e.defaultStyleTitle,current:!0});return i},toContext:function(n){var t={},r=n.layers,i,u,e,f;if("OpenLayers.Map"==n.CLASS_NAME?(i=n.metadata||{},t.size=n.getSize(),t.bounds=n.getExtent(),t.projection=n.projection,t.title=n.title,t.keywords=i.keywords,t.abstract=i.abstract,t.logo=i.logo,t.descriptionURL=i.descriptionURL,t.contactInformation=i.contactInformation,t.maxExtent=n.maxExtent):(OpenLayers.Util.applyDefaults(t,n),void 0!=t.layers&&delete t.layers),void 0==t.layersContext&&(t.layersContext=[]),void 0!=r&&OpenLayers.Util.isArray(r))for(u=0,e=r.length;e>u;u++)f=r[u],f instanceof OpenLayers.Layer.WMS&&t.layersContext.push(this.layerToContext(f));return t},CLASS_NAME:"OpenLayers.Format.WMC"});OpenLayers.Format.WMC.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ol:"http://openlayers.org/context",wmc:"http://www.opengis.net/context",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"",getNamespacePrefix:function(n){var t=null;if(null==n)t=this.namespaces[this.defaultPrefix];else for(t in this.namespaces)if(this.namespaces[t]==n)break;return t},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"Default",initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var t,i;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),t=n.documentElement,this.rootPrefix=t.prefix,i={version:t.getAttribute("version")},this.runChildNodes(i,t),i},runChildNodes:function(n,t){for(var i,r,f,e,o=t.childNodes,u=0,s=o.length;s>u;++u)i=o[u],1==i.nodeType&&(f=this.getNamespacePrefix(i.namespaceURI),e=i.nodeName.split(":").pop(),r=this["read_"+f+"_"+e],r&&r.apply(this,[n,i]))},read_wmc_General:function(n,t){this.runChildNodes(n,t)},read_wmc_BoundingBox:function(n,t){n.projection=t.getAttribute("SRS");n.bounds=new OpenLayers.Bounds(parseFloat(t.getAttribute("minx")),parseFloat(t.getAttribute("miny")),parseFloat(t.getAttribute("maxx")),parseFloat(t.getAttribute("maxy")))},read_wmc_LayerList:function(n,t){n.layersContext=[];this.runChildNodes(n,t)},read_wmc_Layer:function(n,t){var i={visibility:"1"!=t.getAttribute("hidden"),queryable:"1"==t.getAttribute("queryable"),formats:[],styles:[],metadata:{}};this.runChildNodes(i,t);n.layersContext.push(i)},read_wmc_Extension:function(n,t){this.runChildNodes(n,t)},read_ol_units:function(n,t){n.units=this.getChildValue(t)},read_ol_maxExtent:function(n,t){var i=new OpenLayers.Bounds(t.getAttribute("minx"),t.getAttribute("miny"),t.getAttribute("maxx"),t.getAttribute("maxy"));n.maxExtent=i},read_ol_transparent:function(n,t){n.transparent=this.getChildValue(t)},read_ol_numZoomLevels:function(n,t){n.numZoomLevels=parseInt(this.getChildValue(t))},read_ol_opacity:function(n,t){n.opacity=parseFloat(this.getChildValue(t))},read_ol_singleTile:function(n,t){n.singleTile="true"==this.getChildValue(t)},read_ol_tileSize:function(n,t){var i={width:t.getAttribute("width"),height:t.getAttribute("height")};n.tileSize=i},read_ol_isBaseLayer:function(n,t){n.isBaseLayer="true"==this.getChildValue(t)},read_ol_displayInLayerSwitcher:function(n,t){n.displayInLayerSwitcher="true"==this.getChildValue(t)},read_wmc_Server:function(n,t){n.version=t.getAttribute("version");n.url=this.getOnlineResource_href(t);n.metadata.servertitle=t.getAttribute("title")},read_wmc_FormatList:function(n,t){this.runChildNodes(n,t)},read_wmc_Format:function(n,t){var i={value:this.getChildValue(t)};"1"==t.getAttribute("current")&&(i.current=!0);n.formats.push(i)},read_wmc_StyleList:function(n,t){this.runChildNodes(n,t)},read_wmc_Style:function(n,t){var i={};this.runChildNodes(i,t);"1"==t.getAttribute("current")&&(i.current=!0);n.styles.push(i)},read_wmc_SLD:function(n,t){this.runChildNodes(n,t)},read_sld_StyledLayerDescriptor:function(n,t){var i=OpenLayers.Format.XML.prototype.write.apply(this,[t]);n.body=i},read_sld_FeatureTypeStyle:function(n,t){var i=OpenLayers.Format.XML.prototype.write.apply(this,[t]);n.body=i},read_wmc_OnlineResource:function(n,t){n.href=this.getAttributeNS(t,this.namespaces.xlink,"href")},read_wmc_Name:function(n,t){var i=this.getChildValue(t);i&&(n.name=i)},read_wmc_Title:function(n,t){var i=this.getChildValue(t);i&&(n.title=i)},read_wmc_MetadataURL:function(n,t){n.metadataURL=this.getOnlineResource_href(t)},read_wmc_KeywordList:function(n,t){n.keywords=[];this.runChildNodes(n.keywords,t)},read_wmc_Keyword:function(n,t){n.push(this.getChildValue(t))},read_wmc_Abstract:function(n,t){var i=this.getChildValue(t);i&&(n.abstract=i)},read_wmc_LogoURL:function(n,t){n.logo={width:t.getAttribute("width"),height:t.getAttribute("height"),format:t.getAttribute("format"),href:this.getOnlineResource_href(t)}},read_wmc_DescriptionURL:function(n,t){n.descriptionURL=this.getOnlineResource_href(t)},read_wmc_ContactInformation:function(n,t){var i={};this.runChildNodes(i,t);n.contactInformation=i},read_wmc_ContactPersonPrimary:function(n,t){var i={};this.runChildNodes(i,t);n.personPrimary=i},read_wmc_ContactPerson:function(n,t){var i=this.getChildValue(t);i&&(n.person=i)},read_wmc_ContactOrganization:function(n,t){var i=this.getChildValue(t);i&&(n.organization=i)},read_wmc_ContactPosition:function(n,t){var i=this.getChildValue(t);i&&(n.position=i)},read_wmc_ContactAddress:function(n,t){var i={};this.runChildNodes(i,t);n.contactAddress=i},read_wmc_AddressType:function(n,t){var i=this.getChildValue(t);i&&(n.type=i)},read_wmc_Address:function(n,t){var i=this.getChildValue(t);i&&(n.address=i)},read_wmc_City:function(n,t){var i=this.getChildValue(t);i&&(n.city=i)},read_wmc_StateOrProvince:function(n,t){var i=this.getChildValue(t);i&&(n.stateOrProvince=i)},read_wmc_PostCode:function(n,t){var i=this.getChildValue(t);i&&(n.postcode=i)},read_wmc_Country:function(n,t){var i=this.getChildValue(t);i&&(n.country=i)},read_wmc_ContactVoiceTelephone:function(n,t){var i=this.getChildValue(t);i&&(n.phone=i)},read_wmc_ContactFacsimileTelephone:function(n,t){var i=this.getChildValue(t);i&&(n.fax=i)},read_wmc_ContactElectronicMailAddress:function(n,t){var i=this.getChildValue(t);i&&(n.email=i)},read_wmc_DataURL:function(n,t){n.dataURL=this.getOnlineResource_href(t)},read_wmc_LegendURL:function(n,t){var i={width:t.getAttribute("width"),height:t.getAttribute("height"),format:t.getAttribute("format"),href:this.getOnlineResource_href(t)};n.legend=i},read_wmc_DimensionList:function(n,t){n.dimensions={};this.runChildNodes(n.dimensions,t)},read_wmc_Dimension:function(n,t){var r=t.getAttribute("name").toLowerCase(),i={name:r,units:t.getAttribute("units")||"",unitSymbol:t.getAttribute("unitSymbol")||"",userValue:t.getAttribute("userValue")||"",nearestValue:"1"===t.getAttribute("nearestValue"),multipleValues:"1"===t.getAttribute("multipleValues"),current:"1"===t.getAttribute("current"),"default":t.getAttribute("default")||""},u=this.getChildValue(t);i.values=u.split(",");n[i.name]=i},write:function(n,t){var i=this.createElementDefaultNS("ViewContext");return this.setAttributes(i,{version:this.VERSION,id:t&&"string"==typeof t.id?t.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")}),this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),i.appendChild(this.write_wmc_General(n)),i.appendChild(this.write_wmc_LayerList(n)),OpenLayers.Format.XML.prototype.write.apply(this,[i])},createElementDefaultNS:function(n,t,i){var r=this.createElementNS(this.namespaces[this.defaultPrefix],n);return t&&r.appendChild(this.createTextNode(t)),i&&this.setAttributes(r,i),r},setAttributes:function(n,t){var i;for(var r in t)i=""+t[r],i.match(/[A-Z]/)?this.setAttributeNS(n,null,r,i):n.setAttribute(r,i)},write_wmc_General:function(n){var t=this.createElementDefaultNS("General"),i;return n.size&&t.appendChild(this.createElementDefaultNS("Window",null,{width:n.size.w,height:n.size.h})),i=n.bounds,t.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:i.left.toPrecision(18),miny:i.bottom.toPrecision(18),maxx:i.right.toPrecision(18),maxy:i.top.toPrecision(18),SRS:n.projection})),t.appendChild(this.createElementDefaultNS("Title",n.title)),n.keywords&&t.appendChild(this.write_wmc_KeywordList(n.keywords)),n.abstract&&t.appendChild(this.createElementDefaultNS("Abstract",n.abstract)),n.logo&&t.appendChild(this.write_wmc_URLType("LogoURL",n.logo.href,n.logo)),n.descriptionURL&&t.appendChild(this.write_wmc_URLType("DescriptionURL",n.descriptionURL)),n.contactInformation&&t.appendChild(this.write_wmc_ContactInformation(n.contactInformation)),t.appendChild(this.write_ol_MapExtension(n)),t},write_wmc_KeywordList:function(n){for(var i=this.createElementDefaultNS("KeywordList"),t=0,r=n.length;r>t;t++)i.appendChild(this.createElementDefaultNS("Keyword",n[t]));return i},write_wmc_ContactInformation:function(n){var t=this.createElementDefaultNS("ContactInformation");return n.personPrimary&&t.appendChild(this.write_wmc_ContactPersonPrimary(n.personPrimary)),n.position&&t.appendChild(this.createElementDefaultNS("ContactPosition",n.position)),n.contactAddress&&t.appendChild(this.write_wmc_ContactAddress(n.contactAddress)),n.phone&&t.appendChild(this.createElementDefaultNS("ContactVoiceTelephone",n.phone)),n.fax&&t.appendChild(this.createElementDefaultNS("ContactFacsimileTelephone",n.fax)),n.email&&t.appendChild(this.createElementDefaultNS("ContactElectronicMailAddress",n.email)),t},write_wmc_ContactPersonPrimary:function(n){var t=this.createElementDefaultNS("ContactPersonPrimary");return n.person&&t.appendChild(this.createElementDefaultNS("ContactPerson",n.person)),n.organization&&t.appendChild(this.createElementDefaultNS("ContactOrganization",n.organization)),t},write_wmc_ContactAddress:function(n){var t=this.createElementDefaultNS("ContactAddress");return n.type&&t.appendChild(this.createElementDefaultNS("AddressType",n.type)),n.address&&t.appendChild(this.createElementDefaultNS("Address",n.address)),n.city&&t.appendChild(this.createElementDefaultNS("City",n.city)),n.stateOrProvince&&t.appendChild(this.createElementDefaultNS("StateOrProvince",n.stateOrProvince)),n.postcode&&t.appendChild(this.createElementDefaultNS("PostCode",n.postcode)),n.country&&t.appendChild(this.createElementDefaultNS("Country",n.country)),t},write_ol_MapExtension:function(n){var r=this.createElementDefaultNS("Extension"),t=n.maxExtent,i;return t&&(i=this.createElementNS(this.namespaces.ol,"ol:maxExtent"),this.setAttributes(i,{minx:t.left.toPrecision(18),miny:t.bottom.toPrecision(18),maxx:t.right.toPrecision(18),maxy:t.top.toPrecision(18)}),r.appendChild(i)),r},write_wmc_LayerList:function(n){for(var i=this.createElementDefaultNS("LayerList"),t=0,r=n.layersContext.length;r>t;++t)i.appendChild(this.write_wmc_Layer(n.layersContext[t]));return i},write_wmc_Layer:function(n){var t=this.createElementDefaultNS("Layer",null,{queryable:n.queryable?"1":"0",hidden:n.visibility?"0":"1"});return t.appendChild(this.write_wmc_Server(n)),t.appendChild(this.createElementDefaultNS("Name",n.name)),t.appendChild(this.createElementDefaultNS("Title",n.title)),n.abstract&&t.appendChild(this.createElementDefaultNS("Abstract",n.abstract)),n.dataURL&&t.appendChild(this.write_wmc_URLType("DataURL",n.dataURL)),n.metadataURL&&t.appendChild(this.write_wmc_URLType("MetadataURL",n.metadataURL)),t},write_wmc_LayerExtension:function(n){var t=this.createElementDefaultNS("Extension"),i=n.maxExtent,e=this.createElementNS(this.namespaces.ol,"ol:maxExtent"),r;(this.setAttributes(e,{minx:i.left.toPrecision(18),miny:i.bottom.toPrecision(18),maxx:i.right.toPrecision(18),maxy:i.top.toPrecision(18)}),t.appendChild(e),n.tileSize&&!n.singleTile)&&(r=this.createElementNS(this.namespaces.ol,"ol:tileSize"),this.setAttributes(r,n.tileSize),t.appendChild(r));for(var u,o=["transparent","numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"],f=0,s=o.length;s>f;++f)u=this.createOLPropertyNode(n,o[f]),u&&t.appendChild(u);return t},createOLPropertyNode:function(n,t){var i=null;return null!=n[t]&&(i=this.createElementNS(this.namespaces.ol,"ol:"+t),i.appendChild(this.createTextNode(""+n[t]))),i},write_wmc_Server:function(n){var t=n.server,i=this.createElementDefaultNS("Server"),r={service:"OGC:WMS",version:t.version};return t.title&&(r.title=t.title),this.setAttributes(i,r),i.appendChild(this.write_wmc_OnlineResource(t.url)),i},write_wmc_URLType:function(n,t,i){var f=this.createElementDefaultNS(n),u,r;if(f.appendChild(this.write_wmc_OnlineResource(t)),i)for(u=["width","height","format"],r=0;u.length>r;r++)u[r]in i&&f.setAttribute(u[r],i[u[r]]);return f},write_wmc_DimensionList:function(n){var f=this.createElementDefaultNS("DimensionList"),e,t,i,r,u;for(e in n.dimensions){t={};i=n.dimensions[e];for(r in i)t[r]="boolean"==typeof i[r]?Number(i[r]):i[r];u="";t.values&&(u=t.values.join(","),delete t.values);f.appendChild(this.createElementDefaultNS("Dimension",u,t))}return f},write_wmc_FormatList:function(n){for(var t,r=this.createElementDefaultNS("FormatList"),i=0,u=n.formats.length;u>i;i++)t=n.formats[i],r.appendChild(this.createElementDefaultNS("Format",t.value,t.current&&1==t.current?{current:"1"}:null));return r},write_wmc_StyleList:function(n){var o=this.createElementDefaultNS("StyleList"),u=n.styles,i,f,s,t,r,h,c,e;if(u&&OpenLayers.Util.isArray(u))for(f=0,s=u.length;s>f;f++)t=u[f],r=this.createElementDefaultNS("Style",null,t.current&&1==t.current?{current:"1"}:null),t.href?(i=this.createElementDefaultNS("SLD"),t.name&&i.appendChild(this.createElementDefaultNS("Name",t.name)),t.title&&i.appendChild(this.createElementDefaultNS("Title",t.title)),t.legend&&i.appendChild(this.write_wmc_URLType("LegendURL",t.legend.href,t.legend)),h=this.write_wmc_OnlineResource(t.href),i.appendChild(h),r.appendChild(i)):t.body?(i=this.createElementDefaultNS("SLD"),t.name&&i.appendChild(this.createElementDefaultNS("Name",t.name)),t.title&&i.appendChild(this.createElementDefaultNS("Title",t.title)),t.legend&&i.appendChild(this.write_wmc_URLType("LegendURL",t.legend.href,t.legend)),c=OpenLayers.Format.XML.prototype.read.apply(this,[t.body]),e=c.documentElement,i.ownerDocument&&i.ownerDocument.importNode&&(e=i.ownerDocument.importNode(e,!0)),i.appendChild(e),r.appendChild(i)):(r.appendChild(this.createElementDefaultNS("Name",t.name)),r.appendChild(this.createElementDefaultNS("Title",t.title)),t.abstract&&r.appendChild(this.createElementDefaultNS("Abstract",t.abstract)),t.legend&&r.appendChild(this.write_wmc_URLType("LegendURL",t.legend.href,t.legend))),o.appendChild(r);return o},write_wmc_OnlineResource:function(n){var t=this.createElementDefaultNS("OnlineResource");return this.setAttributeNS(t,this.namespaces.xlink,"xlink:type","simple"),this.setAttributeNS(t,this.namespaces.xlink,"xlink:href",n),t},getOnlineResource_href:function(n){var t={},i=n.getElementsByTagName("OnlineResource");return i.length>0&&this.read_wmc_OnlineResource(t,i[0]),t.href},CLASS_NAME:"OpenLayers.Format.WMC.v1"});OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{slideFactor:50,slideRatio:null,initialize:function(n){OpenLayers.Control.Panel.prototype.initialize.apply(this,[n]);var n={slideFactor:this.slideFactor,slideRatio:this.slideRatio};this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,n),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,n),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,n),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,n)])},CLASS_NAME:"OpenLayers.Control.PanPanel"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this}),this.updateAttribution(),this.div},updateAttribution:function(){var i=[],t,r,n;if(this.map&&this.map.layers){for(t=0,r=this.map.layers.length;r>t;t++)n=this.map.layers[t],n.attribution&&n.getVisibility()&&-1===OpenLayers.Util.indexOf(i,n.attribution)&&i.push(n.attribution);this.div.innerHTML=i.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Renderer.NG=OpenLayers.Class(OpenLayers.Renderer.Elements,{labelNodeType:null,updateDimensions:function(){var t=this.map.getExtent(),i=t.scale(3);this.setExtent(i,!0);var r=this.getResolution(),n=this.rendererRoot.parentNode,u=parseFloat(n.parentNode.style.left),f=parseFloat(n.parentNode.style.top);n.style.left=(i.left-t.left)/r-u+"px";n.style.top=(t.top-i.top)/r-f+"px"},setSize:function(){this.map.getExtent()&&this.updateDimensions()},drawFeature:function(n,t){var i,r;if(null==t&&(t=n.style),n.geometry)return i=this.drawGeometry(n.geometry,t,n.id),i!==!1&&t.label?(r=n.geometry.getCentroid(),this.drawText(n.id,t,r)):this.removeText(n.id),i},drawText:function(n,t,i){var r;if("string"!=typeof n?r=n:(r=this.nodeFactory(n+this.LABEL_ID_SUFFIX,this.labelNodeType),r._featureId=n),r._style=t,r._x=i.x,r._y=i.y,t.labelXOffset||t.labelYOffset){var f=isNaN(t.labelXOffset)?0:t.labelXOffset,e=isNaN(t.labelYOffset)?0:t.labelYOffset,u=this.getResolution();i.move(f*u,e*u)}return r.parentNode!==this.textRoot&&this.textRoot.appendChild(r),r},CLASS_NAME:"OpenLayers.Renderer.NG"});OpenLayers.Renderer.SVG2=OpenLayers.Class(OpenLayers.Renderer.NG,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",symbolMetrics:null,labelNodeType:"g",initialize:function(){this.supported()&&(OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.symbolMetrics={})},supported:function(){var n="http://www.w3.org/TR/SVG11/feature#";return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(n+"SVG","1.1")||document.implementation.hasFeature(n+"BasicStructure","1.1"))},updateDimensions:function(n){var t,r,u,i,f;OpenLayers.Renderer.NG.prototype.updateDimensions.apply(this,arguments);var e=this.getResolution(),o=this.extent.getWidth(),s=this.extent.getHeight(),h=[this.extent.left,-this.extent.top,o,s].join(" ");if(this.rendererRoot.setAttributeNS(null,"viewBox",h),this.rendererRoot.setAttributeNS(null,"width",o/e),this.rendererRoot.setAttributeNS(null,"height",s/e),n===!0){for(u=this.vectorRoot.childNodes,t=0,r=u.length;r>t;++t)this.setStyle(u[t]);for(f=this.textRoot.childNodes,t=0,r=f.length;r>t;++t)i=f[t],this.drawText(i,i._style,new OpenLayers.Geometry.Point(i._x,i._y))}},getNodeType:function(n,t){var i=null;switch(n.CLASS_NAME){case"OpenLayers.Geometry.Point":i=t.externalGraphic?"image":this.isComplexSymbol(t.graphicName)?"svg":"circle";break;case"OpenLayers.Geometry.Rectangle":i="rect";break;case"OpenLayers.Geometry.LineString":i="polyline";break;case"OpenLayers.Geometry.LinearRing":i="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":i="path"}return i},setStyle:function(n,t,i){var c,u,f,e,v,o,y;t=t||n._style;i=i||n._options;var r=this.getResolution(),p=n._radius,h=r;if("OpenLayers.Geometry.Point"==n._geometryClass&&p){if(n.style.visibility="",t.graphic===!1)n.style.visibility="hidden";else if(t.externalGraphic){t.graphicTitle&&(n.setAttributeNS(null,"title",t.graphicTitle),c=this.nodeFactory(null,"title"),c.textContent=t.graphicTitle,n.appendChild(c));t.graphicWidth&&t.graphicHeight&&n.setAttributeNS(null,"preserveAspectRatio","none");u=t.graphicWidth||t.graphicHeight;f=t.graphicHeight||t.graphicWidth;u=u?u:2*t.pointRadius;f=f?f:2*t.pointRadius;u*=r;f*=r;var w=void 0!=t.graphicXOffset?t.graphicXOffset*r:-(.5*u),b=void 0!=t.graphicYOffset?t.graphicYOffset*r:-(.5*f),k=t.graphicOpacity||t.fillOpacity;n.setAttributeNS(null,"x",n._x+w);n.setAttributeNS(null,"y",n._y+b);n.setAttributeNS(null,"width",u);n.setAttributeNS(null,"height",f);n.setAttributeNS(this.xlinkns,"href",t.externalGraphic);n.setAttributeNS(null,"style","opacity: "+k);n.onclick=OpenLayers.Renderer.SVG2.preventDefault}else if(this.isComplexSymbol(t.graphicName)){var l=3*t.pointRadius*r,a=2*l,s=this.importSymbol(t.graphicName);h=3*this.symbolMetrics[s.id].size/a*r;e=n.parentNode;v=n.nextSibling;e&&e.removeChild(n);n.firstChild&&n.removeChild(n.firstChild);n.appendChild(s.firstChild.cloneNode(!0));n.setAttributeNS(null,"viewBox",s.getAttributeNS(null,"viewBox"));n.setAttributeNS(null,"width",a);n.setAttributeNS(null,"height",a);n.setAttributeNS(null,"x",n._x-l);n.setAttributeNS(null,"y",n._y-l);v?e.insertBefore(n,v):e&&e.appendChild(n)}else n.setAttributeNS(null,"r",t.pointRadius*r);o=t.rotation;(void 0!==o||void 0!==n._rotation)&&((n._rotation=o,o|=0,"svg"!==n.nodeName)?n.setAttributeNS(null,"transform",["rotate(",o,n._x,n._y,")"].join(" ")):(y=this.symbolMetrics[s.id],n.firstChild.setAttributeNS(null,"transform",["rotate(",o,y.x,y.y,")"].join(" "))))}return i.isFilled?(n.setAttributeNS(null,"fill",t.fillColor),n.setAttributeNS(null,"fill-opacity",t.fillOpacity)):n.setAttributeNS(null,"fill","none"),i.isStroked?(n.setAttributeNS(null,"stroke",t.strokeColor),n.setAttributeNS(null,"stroke-opacity",t.strokeOpacity),n.setAttributeNS(null,"stroke-width",t.strokeWidth*h),n.setAttributeNS(null,"stroke-linecap",t.strokeLinecap||"round"),n.setAttributeNS(null,"stroke-linejoin","round"),t.strokeDashstyle&&n.setAttributeNS(null,"stroke-dasharray",this.dashStyle(t,h))):n.setAttributeNS(null,"stroke","none"),t.pointerEvents&&n.setAttributeNS(null,"pointer-events",t.pointerEvents),null!=t.cursor&&n.setAttributeNS(null,"cursor",t.cursor),n},dashStyle:function(n,t){var i=n.strokeWidth*t,f=n.strokeDashstyle;switch(f){case"solid":return"none";case"dot":return[t,4*i].join();case"dash":return[4*i,4*i].join();case"dashdot":return[4*i,4*i,t,4*i].join();case"longdash":return[8*i,4*i].join();case"longdashdot":return[8*i,4*i,t,4*i].join();default:for(var r=OpenLayers.String.trim(f).split(/\s+/g),u=0,e=r.length;e>u;u++)r[u]=r[u]*t;return r.join()}},createNode:function(n,t){var i=document.createElementNS(this.xmlns,n);return t&&i.setAttributeNS(null,"id",t),i},nodeTypeCompare:function(n,t){return t==n.nodeName},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(n){return this.nodeFactory(this.container.id+n,"g")},createDefs:function(){var n=this.nodeFactory(this.container.id+"_defs","defs");return this.rendererRoot.appendChild(n),n},drawPoint:function(n,t){return this.drawCircle(n,t,1)},drawCircle:function(n,t,i){var r=t.x,u=-t.y;return n.setAttributeNS(null,"cx",r),n.setAttributeNS(null,"cy",u),n._x=r,n._y=u,n._radius=i,n},drawLineString:function(n,t){var i=this.getComponentsString(t.components);return n.setAttributeNS(null,"points",i),n},drawLinearRing:function(n,t){var i=this.getComponentsString(t.components);return n.setAttributeNS(null,"points",i),n},drawPolygon:function(n,t){for(var u,i=[],r=0,f=t.components.length;f>r;r++)i.push("M"),u=this.getComponentsString(t.components[r].components," "),i.push(u);return i.push("z"),n.setAttributeNS(null,"d",i.join(" ")),n.setAttributeNS(null,"fill-rule","evenodd"),n},drawRectangle:function(n,t){return n.setAttributeNS(null,"x",t.x),n.setAttributeNS(null,"y",-t.y),n.setAttributeNS(null,"width",t.width),n.setAttributeNS(null,"height",t.height),n},drawSurface:function(n,t){for(var r,u=[],i=0,f=t.components.length;f>i;i++)0==i%3&&0==i/3?(r=this.getShortString(t.components[i]),u.push("M",r)):1==i%3?(r=this.getShortString(t.components[i]),u.push("C",r)):(r=this.getShortString(t.components[i]),u.push(r));return u.push("Z"),n.setAttributeNS(null,"d",u.join(" ")),n},drawText:function(n,t,i){var o=OpenLayers.Renderer.NG.prototype.drawText.apply(this,arguments),r=o.firstChild||this.nodeFactory(n+this.LABEL_ID_SUFFIX+"_text","text"),s=this.getResolution(),e,h,c,f,u,l;for(r.setAttributeNS(null,"x",i.x/s),r.setAttributeNS(null,"y",-i.y/s),o.setAttributeNS(null,"transform","scale("+s+")"),t.fontColor&&r.setAttributeNS(null,"fill",t.fontColor),t.fontOpacity&&r.setAttributeNS(null,"opacity",t.fontOpacity),t.fontFamily&&r.setAttributeNS(null,"font-family",t.fontFamily),t.fontSize&&r.setAttributeNS(null,"font-size",t.fontSize),t.fontWeight&&r.setAttributeNS(null,"font-weight",t.fontWeight),t.fontStyle&&r.setAttributeNS(null,"font-style",t.fontStyle),t.labelSelect===!0?(r.setAttributeNS(null,"pointer-events","visible"),r._featureId=n):r.setAttributeNS(null,"pointer-events","none"),e=t.labelAlign||"cm",r.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG2.LABEL_ALIGN[e[0]]||"middle"),OpenLayers.IS_GECKO===!0&&r.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG2.LABEL_ALIGN[e[1]]||"central"),h=t.label.split("\n"),c=h.length;r.childNodes.length>c;)r.removeChild(r.lastChild);for(f=0;c>f;f++)u=r.childNodes[f]||this.nodeFactory(n+this.LABEL_ID_SUFFIX+"_tspan_"+f,"tspan"),(t.labelSelect===!0&&(u._featureId=n),OpenLayers.IS_GECKO===!1&&u.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG2.LABEL_VSHIFT[e[1]]||"-35%"),u.setAttribute("x",i.x/s),0==f)?(l=OpenLayers.Renderer.SVG2.LABEL_VFACTOR[e[1]],null==l&&(l=-.5),u.setAttribute("dy",l*(c-1)+"em")):u.setAttribute("dy","1em"),u.textContent=""===h[f]?" ":h[f],u.parentNode||r.appendChild(u);return r.parentNode||o.appendChild(r),o},getComponentsString:function(n,t){for(var r=n.length,u=Array(r),i=0;r>i;i++)u[i]=this.getShortString(n[i]);return u.join(t||",")},getShortString:function(n){return n.x+","+-n.y},importSymbol:function(n){var u,s,i,r,h;if(this.defs||(this.defs=this.createDefs()),u=this.container.id+"-"+n,s=document.getElementById(u),null!=s)return s;if(i=OpenLayers.Renderer.symbol[n],!i)throw Error(n+" is not a valid symbol name");r=this.nodeFactory(u,"symbol");h=this.nodeFactory(null,"polygon");r.appendChild(h);for(var f,e,t=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),a=[],o=0,v=i.length;v>o;o+=2)f=i[o],e=i[o+1],t.left=Math.min(t.left,f),t.bottom=Math.min(t.bottom,e),t.right=Math.max(t.right,f),t.top=Math.max(t.top,e),a.push(f,",",e);h.setAttributeNS(null,"points",a.join(" "));var c=t.getWidth(),l=t.getHeight(),y=[t.left-c,t.bottom-l,3*c,3*l];return r.setAttributeNS(null,"viewBox",y.join(" ")),this.symbolMetrics[u]={size:Math.max(c,l),x:t.getCenterLonLat().lon,y:t.getCenterLonLat().lat},this.defs.appendChild(r),r},getFeatureIdFromEvent:function(n){var i=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments),t;return i||(t=n.target,i=t.parentNode&&t!=this.rendererRoot&&t.parentNode._featureId),i},CLASS_NAME:"OpenLayers.Renderer.SVG2"});OpenLayers.Renderer.SVG2.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};OpenLayers.Renderer.SVG2.LABEL_VSHIFT={t:"-70%",b:"0"};OpenLayers.Renderer.SVG2.LABEL_VFACTOR={t:0,b:-1};OpenLayers.Renderer.SVG2.preventDefault=function(n){n.preventDefault&&n.preventDefault()};OpenLayers.Kinetic=OpenLayers.Class({threshold:0,interval:10,deceleration:.0035,nbPoints:100,delay:200,points:void 0,timerId:void 0,initialize:function(n){OpenLayers.Util.extend(this,n)},begin:function(){clearInterval(this.timerId);this.timerId=void 0;this.points=[]},update:function(n){this.points.unshift({xy:n,tick:(new Date).getTime()});this.points.length>this.nbPoints&&this.points.pop()},end:function(n){for(var i,t,r,o=(new Date).getTime(),u=0,s=this.points.length;s>u&&(r=this.points[u],!(o-r.tick>this.delay));u++)t=r;if(t){var h=(new Date).getTime()-t.tick,e=Math.sqrt(Math.pow(n.x-t.xy.x,2)+Math.pow(n.y-t.xy.y,2)),f=e/h;if(!(0==f||this.threshold>f))return i=Math.asin((n.y-t.xy.y)/e),t.xy.x<=n.x&&(i=Math.PI-i),{speed:f,theta:i}}},move:function(n,t){var i=n.speed,e=Math.cos(n.theta),o=-Math.sin(n.theta),r=0,s=(new Date).getTime(),u=0,f=0,h=function(){var v;if(null!=this.timerId){r+=this.interval;var y=(new Date).getTime()-s,h=(r+y)/2,c=-this.deceleration*Math.pow(h,2)/2+i*h,l=c*e,a=c*o,n={};n.end=!1;v=-this.deceleration*h+i;0>=v&&(clearInterval(this.timerId),this.timerId=null,n.end=!0);n.x=l-u;n.y=a-f;u=l;f=a;t(n.x,n.y,n.end)}};this.timerId=window.setInterval(OpenLayers.Function.bind(h,this),this.interval)},CLASS_NAME:"OpenLayers.Kinetic"});OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(n){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:n.statusText}))};OpenLayers.loadURL=function(n,t,i,r,u){"string"==typeof t&&(t=OpenLayers.Util.getParameters(t));var f=r?r:OpenLayers.nullHandler,e=u?u:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:n,params:t,success:f,failure:e,scope:i})};OpenLayers.parseXMLString=function(n){var t=n.indexOf("<");return t>0&&(n=n.substring(t)),OpenLayers.Util.Try(function(){var t=new ActiveXObject("Microsoft.XMLDOM");return t.loadXML(n),t},function(){return(new DOMParser).parseFromString(n,"text/xml")},function(){var t=new XMLHttpRequest;return t.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(n),!1),t.overrideMimeType&&t.overrideMimeType("text/xml"),t.send(null),t.responseXML})};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||!1},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(n){for(var t=0;this.responders.length>t;t++)if(n==this.responders[t])return;this.responders.push(n)},unregister:function(n){OpenLayers.Util.removeItem(this.reponders,n)},dispatch:function(n,t,i){for(var r,u=0;this.responders.length>u;u++)if(r=this.responders[u],r[n]&&"function"==typeof r[n])try{r[n].apply(r,[t,i])}catch(f){}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(n){this.options={method:"post",asynchronous:!0,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,n||{});this.options.method=this.options.method.toLowerCase();"string"==typeof this.options.parameters&&(this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters))}});OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:!1,initialize:function(n,t){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[t]);OpenLayers.ProxyHost&&OpenLayers.String.startsWith(n,"http")&&(n=OpenLayers.ProxyHost+encodeURIComponent(n));this.transport=OpenLayers.Ajax.getTransport();this.request(n)},request:function(n){var t,i;this.url=n;this.method=this.options.method;t=OpenLayers.Util.extend({},this.options.parameters);"get"!=this.method&&"post"!=this.method&&(t._method=this.method,this.method="post");this.parameters=t;(t=OpenLayers.Util.getParameterString(t))&&("get"==this.method?this.url+=(this.url.indexOf("?")>-1?"&":"?")+t:/Konqueror|Safari|KHTML/.test(navigator.userAgent)&&(t+="&_="));try{i=new OpenLayers.Ajax.Response(this);this.options.onCreate&&this.options.onCreate(i);OpenLayers.Ajax.Responders.dispatch("onCreate",this,i);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);this.options.asynchronous&&window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10);this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body="post"==this.method?this.options.postBody||t:null;this.transport.send(this.body);!this.options.asynchronous&&this.transport.overrideMimeType&&this.onStateChange()}catch(r){this.dispatchException(r)}},onStateChange:function(){var n=this.transport.readyState;n>1&&(4!=n||!this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var i={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:!0},t,u,n,r;if("post"==this.method&&(i["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:""),this.transport.overrideMimeType&&2005>(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]&&(i.Connection="close")),"object"==typeof this.options.requestHeaders)if(t=this.options.requestHeaders,"function"==typeof t.push)for(n=0,u=t.length;u>n;n+=2)i[t[n]]=t[n+1];else for(n in t)i[n]=t[n];for(r in i)this.transport.setRequestHeader(r,i[r])},success:function(){var n=this.getStatus();return!n||n>=200&&300>n},getStatus:function(){try{return this.transport.status||0}catch(n){return 0}},respondToReadyState:function(n){var i=OpenLayers.Ajax.Request.Events[n],t=new OpenLayers.Ajax.Response(this);if("Complete"==i){try{this._complete=!0;(this.options["on"+t.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(t)}catch(r){this.dispatchException(r)}t.getHeader("Content-type")}try{(this.options["on"+i]||OpenLayers.Ajax.emptyFunction)(t);OpenLayers.Ajax.Responders.dispatch("on"+i,this,t)}catch(r){this.dispatchException(r)}"Complete"==i&&(this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction)},getHeader:function(n){try{return this.transport.getResponseHeader(n)}catch(t){return null}},dispatchException:function(n){var i=this.options.onException;if(i)i(this,n),OpenLayers.Ajax.Responders.dispatch("onException",this,n);else{for(var r=!1,u=OpenLayers.Ajax.Responders.responders,t=0;u.length>t;t++)if(u[t].onException){r=!0;break}if(!r)throw n;OpenLayers.Ajax.Responders.dispatch("onException",this,n)}}});OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(n){var t,i,r;this.request=n;t=this.transport=n.transport;i=this.readyState=t.readyState;((i>2&&(!window.attachEvent||window.opera)||4==i)&&(this.status=this.getStatus(),this.statusText=this.getStatusText(),this.responseText=null==t.responseText?"":t.responseText+""),4==i)&&(r=t.responseXML,this.responseXML=void 0===r?null:r)},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(n){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(n){return this.transport.getResponseHeader(n)}});OpenLayers.Ajax.getElementsByTagNameNS=function(n,t,i,r){return n.getElementsByTagNameNS?n.getElementsByTagNameNS(t,r):n.getElementsByTagName(i+":"+r)};OpenLayers.Ajax.serializeXMLToString=function(n){var t=new XMLSerializer;return t.serializeToString(n)};OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:!0,initialize:function(n,t,i){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[n,i]);this.location=t;this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadRSS:function(){this.loaded||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this}),this.loaded=!0)},moveTo:function(){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);this.visibility&&!this.loaded&&this.loadRSS()},parseData:function(n){var u=n.responseXML,f,e,r,i,t,l;if(u&&u.documentElement||(u=OpenLayers.Format.XML.prototype.read(n.responseText)),this.useFeedTitle){f=null;try{f=u.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(w){f=u.getElementsByTagName("title")[0].firstChild.nodeValue}f&&this.setName(f)}e={};OpenLayers.Util.extend(e,this.formatOptions);this.map&&!this.projection.equals(this.map.getProjectionObject())&&(e.externalProjection=this.projection,e.internalProjection=this.map.getProjectionObject());for(var v=new OpenLayers.Format.GeoRSS(e),a=v.read(u),o=0,y=a.length;y>o;o++)if(r={},t=a[o],t.geometry){var s=t.attributes.title?t.attributes.title:"Untitled",h=t.attributes.description?t.attributes.description:"No description.",c=t.attributes.link?t.attributes.link:"",p=t.geometry.getBounds().getCenterLonLat();(r.icon=null==this.icon?OpenLayers.Marker.defaultIcon():this.icon.clone(),r.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120),s||h)&&(r.title=s,r.description=h,i='<div class="olLayerGeoRSSClose">[x]<\/div>',i+='<div class="olLayerGeoRSSTitle">',c&&(i+='<a class="link" href="'+c+'" target="_blank">'),i+=s,c&&(i+="<\/a>"),i+="<\/div>",i+='<div style="" class="olLayerGeoRSSDescription">',i+=h,i+="<\/div>",r.popupContentHTML=i);t=new OpenLayers.Feature(this,p,r);this.features.push(t);l=t.createMarker();l.events.register("click",t,this.markerClick);this.addMarker(l)}this.events.triggerEvent("loadend")},markerClick:function(n){var r=this==this.layer.selectedFeature,t,u,i;for(this.layer.selectedFeature=r?null:this,t=0,u=this.layer.map.popups.length;u>t;t++)this.layer.map.removePopup(this.layer.map.popups[t]);r||(i=this.createPopup(),OpenLayers.Event.observe(i.div,"click",OpenLayers.Function.bind(function(){for(var n=0,t=this.layer.map.popups.length;t>n;n++)this.layer.map.removePopup(this.layer.map.popups[n])},this)),this.layer.map.addPopup(i));OpenLayers.Event.stop(n)},clearFeatures:function(){if(null!=this.features)for(;this.features.length>0;){var n=this.features[0];OpenLayers.Util.removeItem(this.features,n);n.destroy()}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Format.SLD.v1=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,{namespaces:{sld:"http://www.opengis.net/sld",ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"sld",schemaLocation:null,multipleSymbolizers:!1,featureTypeCounter:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,graphicName:"square"},initialize:function(n){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[n])},read:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i={namedLayers:t.namedLayersAsArray===!0?[]:{}};return this.readChildNodes(n,i),i},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(n,t){t.version=n.getAttribute("version");this.readChildNodes(n,t)},Name:function(n,t){t.name=this.getChildValue(n)},Title:function(n,t){t.title=this.getChildValue(n)},Abstract:function(n,t){t.description=this.getChildValue(n)},NamedLayer:function(n,t){var i={userStyles:[],namedStyles:[]},r,u;for(this.readChildNodes(n,i),r=0,u=i.userStyles.length;u>r;++r)i.userStyles[r].layerName=i.name;OpenLayers.Util.isArray(t.namedLayers)?t.namedLayers.push(i):t.namedLayers[i.name]=i},NamedStyle:function(n,t){t.namedStyles.push(this.getChildName(n.firstChild))},UserStyle:function(n,t){var i={defaultsPerSymbolizer:!0,rules:[]},r;this.featureTypeCounter=-1;this.readChildNodes(n,i);this.multipleSymbolizers?(delete i.defaultsPerSymbolizer,r=new OpenLayers.Style2(i)):r=new OpenLayers.Style(this.defaultSymbolizer,i);t.userStyles.push(r)},IsDefault:function(n,t){"1"==this.getChildValue(n)&&(t.isDefault=!0)},FeatureTypeStyle:function(n,t){++this.featureTypeCounter;var i={rules:this.multipleSymbolizers?t.rules:[]};this.readChildNodes(n,i);this.multipleSymbolizers||(t.rules=i.rules)},Rule:function(n,t){var r,i;this.multipleSymbolizers&&(r={symbolizers:[]});i=new OpenLayers.Rule(r);this.readChildNodes(n,i);t.rules.push(i)},ElseFilter:function(n,t){t.elseFilter=!0},MinScaleDenominator:function(n,t){t.minScaleDenominator=parseFloat(this.getChildValue(n))},MaxScaleDenominator:function(n,t){t.maxScaleDenominator=parseFloat(this.getChildValue(n))},TextSymbolizer:function(n,t){var i={};this.readChildNodes(n,i);this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Text(i))):t.symbolizer.Text=OpenLayers.Util.applyDefaults(i,t.symbolizer.Text)},Label:function(n,t){var i={},r;(this.readChildNodes(n,i),i.property)?t.label="${"+i.property+"}":(r=this.readOgcExpression(n),r&&(t.label=r))},Font:function(n,t){this.readChildNodes(n,t)},Halo:function(n,t){var i={};this.readChildNodes(n,i);t.haloRadius=i.haloRadius;t.haloColor=i.fillColor;t.haloOpacity=i.fillOpacity},Radius:function(n,t){var i=this.readOgcExpression(n);null!=i&&(t.haloRadius=i)},RasterSymbolizer:function(n,t){var i={};this.readChildNodes(n,i);this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Raster(i))):t.symbolizer.Raster=OpenLayers.Util.applyDefaults(i,t.symbolizer.Raster)},Geometry:function(n,t){t.geometry={};this.readChildNodes(n,t.geometry)},ColorMap:function(n,t){t.colorMap=[];this.readChildNodes(n,t.colorMap)},ColorMapEntry:function(n,t){var i=n.getAttribute("quantity"),r=n.getAttribute("opacity");t.push({color:n.getAttribute("color"),quantity:null!==i?parseFloat(i):void 0,label:n.getAttribute("label")||void 0,opacity:null!==r?parseFloat(r):void 0})},LineSymbolizer:function(n,t){var i={};this.readChildNodes(n,i);this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Line(i))):t.symbolizer.Line=OpenLayers.Util.applyDefaults(i,t.symbolizer.Line)},PolygonSymbolizer:function(n,t){var i={fill:!1,stroke:!1};this.multipleSymbolizers||(i=t.symbolizer.Polygon||i);this.readChildNodes(n,i);this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Polygon(i))):t.symbolizer.Polygon=i},PointSymbolizer:function(n,t){var i={fill:!1,stroke:!1,graphic:!1};this.multipleSymbolizers||(i=t.symbolizer.Point||i);this.readChildNodes(n,i);this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Point(i))):t.symbolizer.Point=i},Stroke:function(n,t){t.stroke=!0;this.readChildNodes(n,t)},Fill:function(n,t){t.fill=!0;this.readChildNodes(n,t)},CssParameter:function(n,t){var u=n.getAttribute("name"),r=this.cssMap[u],i;r&&(i=this.readOgcExpression(n),i&&(t[r]=i))},Graphic:function(n,t){var i;t.graphic=!0;i={};this.readChildNodes(n,i);for(var r,u,e=["stroke","strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fill","fillColor","fillOpacity","graphicName","rotation","graphicFormat"],f=0,o=e.length;o>f;++f)r=e[f],u=i[r],void 0!=u&&(t[r]=u);void 0!=i.opacity&&(t.graphicOpacity=i.opacity);void 0!=i.size&&(t.pointRadius=i.size/2);void 0!=i.href&&(t.externalGraphic=i.href);void 0!=i.rotation&&(t.rotation=i.rotation)},ExternalGraphic:function(n,t){this.readChildNodes(n,t)},Mark:function(n,t){this.readChildNodes(n,t)},WellKnownName:function(n,t){t.graphicName=this.getChildValue(n)},Opacity:function(n,t){var i=this.readOgcExpression(n);i&&(t.opacity=i)},Size:function(n,t){var i=this.readOgcExpression(n);i&&(t.size=i)},Rotation:function(n,t){var i=this.readOgcExpression(n);i&&(t.rotation=i)},OnlineResource:function(n,t){t.href=this.getAttributeNS(n,this.namespaces.xlink,"href")},Format:function(n,t){t.graphicFormat=this.getChildValue(n)}}},OpenLayers.Format.Filter.v1_0_0.prototype.readers),cssMap:{stroke:"strokeColor","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-dasharray":"strokeDashstyle",fill:"fillColor","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","font-weight":"fontWeight","font-style":"fontStyle"},getCssProperty:function(n){var t=null;for(var i in this.cssMap)if(this.cssMap[i]==n){t=i;break}return t},getGraphicFormat:function(n){var t;for(var i in this.graphicFormats)if(this.graphicFormats[i].test(n)){t=i;break}return t||this.defautlGraphicFormat},defaultGraphicFormat:"image/png",graphicFormats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(n){return this.writers.sld.StyledLayerDescriptor.apply(this,[n])},writers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(n){var t=this.createElementNSPlus("sld:StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}}),i,r,u;if(t.setAttribute("xmlns:ogc",this.namespaces.ogc),t.setAttribute("xmlns:gml",this.namespaces.gml),n.name&&this.writeNode("Name",n.name,t),n.title&&this.writeNode("Title",n.title,t),n.description&&this.writeNode("Abstract",n.description,t),OpenLayers.Util.isArray(n.namedLayers))for(i=0,r=n.namedLayers.length;r>i;++i)this.writeNode("NamedLayer",n.namedLayers[i],t);else for(u in n.namedLayers)this.writeNode("NamedLayer",n.namedLayers[u],t);return t},Name:function(n){return this.createElementNSPlus("sld:Name",{value:n})},Title:function(n){return this.createElementNSPlus("sld:Title",{value:n})},Abstract:function(n){return this.createElementNSPlus("sld:Abstract",{value:n})},NamedLayer:function(n){var i=this.createElementNSPlus("sld:NamedLayer"),t,r;if(this.writeNode("Name",n.name,i),n.namedStyles)for(t=0,r=n.namedStyles.length;r>t;++t)this.writeNode("NamedStyle",n.namedStyles[t],i);if(n.userStyles)for(t=0,r=n.userStyles.length;r>t;++t)this.writeNode("UserStyle",n.userStyles[t],i);return i},NamedStyle:function(n){var t=this.createElementNSPlus("sld:NamedStyle");return this.writeNode("Name",n,t),t},UserStyle:function(n){var r=this.createElementNSPlus("sld:UserStyle"),h,a,v,i,l;if(n.name&&this.writeNode("Name",n.name,r),n.title&&this.writeNode("Title",n.title,r),n.description&&this.writeNode("Abstract",n.description,r),n.isDefault&&this.writeNode("IsDefault",n.isDefault,r),this.multipleSymbolizers&&n.rules){for(var u,f,c,t,e,o={0:[]},s=[0],i=0,l=n.rules.length;l>i;++i)if(u=n.rules[i],u.symbolizers){for(f={},h=0,a=u.symbolizers.length;a>h;++h)c=u.symbolizers[h],t=c.zIndex,t in f||(e=u.clone(),e.symbolizers=[],f[t]=e),f[t].symbolizers.push(c.clone());for(t in f)t in o||(s.push(t),o[t]=[]),o[t].push(f[t])}else o[0].push(u.clone());for(s.sort(),i=0,l=s.length;l>i;++i)v=o[s[i]],v.length>0&&(e=n.clone(),e.rules=o[s[i]],this.writeNode("FeatureTypeStyle",e,r))}else this.writeNode("FeatureTypeStyle",n,r);return r},IsDefault:function(n){return this.createElementNSPlus("sld:IsDefault",{value:n?"1":"0"})},FeatureTypeStyle:function(n){for(var i=this.createElementNSPlus("sld:FeatureTypeStyle"),t=0,r=n.rules.length;r>t;++t)this.writeNode("Rule",n.rules[t],i);return i},Rule:function(n){var t=this.createElementNSPlus("sld:Rule"),u,r,i,f;if(n.name&&this.writeNode("Name",n.name,t),n.title&&this.writeNode("Title",n.title,t),n.description&&this.writeNode("Abstract",n.description,t),n.elseFilter?this.writeNode("ElseFilter",null,t):n.filter&&this.writeNode("ogc:Filter",n.filter,t),void 0!=n.minScaleDenominator&&this.writeNode("MinScaleDenominator",n.minScaleDenominator,t),void 0!=n.maxScaleDenominator&&this.writeNode("MaxScaleDenominator",n.maxScaleDenominator,t),this.multipleSymbolizers&&n.symbolizers)for(i=0,f=n.symbolizers.length;f>i;++i)r=n.symbolizers[i],u=r.CLASS_NAME.split(".").pop(),this.writeNode(u+"Symbolizer",r,t);else for(var e=OpenLayers.Style.SYMBOLIZER_PREFIXES,i=0,o=e.length;o>i;++i)u=e[i],r=n.symbolizer[u],r&&this.writeNode(u+"Symbolizer",r,t);return t},ElseFilter:function(){return this.createElementNSPlus("sld:ElseFilter")},MinScaleDenominator:function(n){return this.createElementNSPlus("sld:MinScaleDenominator",{value:n})},MaxScaleDenominator:function(n){return this.createElementNSPlus("sld:MaxScaleDenominator",{value:n})},LineSymbolizer:function(n){var t=this.createElementNSPlus("sld:LineSymbolizer");return this.writeNode("Stroke",n,t),t},Stroke:function(n){var t=this.createElementNSPlus("sld:Stroke");return void 0!=n.strokeColor&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeColor"},t),void 0!=n.strokeOpacity&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeOpacity"},t),void 0!=n.strokeWidth&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeWidth"},t),void 0!=n.strokeDashstyle&&"solid"!==n.strokeDashstyle&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeDashstyle"},t),void 0!=n.strokeLinecap&&this.writeNode("CssParameter",{symbolizer:n,key:"strokeLinecap"},t),t},CssParameter:function(n){return this.createElementNSPlus("sld:CssParameter",{attributes:{name:this.getCssProperty(n.key)},value:n.symbolizer[n.key]})},TextSymbolizer:function(n){var t=this.createElementNSPlus("sld:TextSymbolizer");return null!=n.label&&this.writeNode("Label",n.label,t),(null!=n.fontFamily||null!=n.fontSize||null!=n.fontWeight||null!=n.fontStyle)&&this.writeNode("Font",n,t),(null!=n.haloRadius||null!=n.haloColor||null!=n.haloOpacity)&&this.writeNode("Halo",n,t),(null!=n.fillColor||null!=n.fillOpacity)&&this.writeNode("Fill",n,t),t},Font:function(n){var t=this.createElementNSPlus("sld:Font");return n.fontFamily&&this.writeNode("CssParameter",{symbolizer:n,key:"fontFamily"},t),n.fontSize&&this.writeNode("CssParameter",{symbolizer:n,key:"fontSize"},t),n.fontWeight&&this.writeNode("CssParameter",{symbolizer:n,key:"fontWeight"},t),n.fontStyle&&this.writeNode("CssParameter",{symbolizer:n,key:"fontStyle"},t),t},Label:function(n){var t=this.createElementNSPlus("sld:Label"),f=n.split("${"),i,r,u,e;for(t.appendChild(this.createTextNode(f[0])),u=1,e=f.length;e>u;u++)i=f[u],r=i.indexOf("}"),r>0?(this.writeNode("ogc:PropertyName",{property:i.substring(0,r)},t),t.appendChild(this.createTextNode(i.substring(++r)))):t.appendChild(this.createTextNode("${"+i));return t},Halo:function(n){var t=this.createElementNSPlus("sld:Halo");return n.haloRadius&&this.writeNode("Radius",n.haloRadius,t),(n.haloColor||n.haloOpacity)&&this.writeNode("Fill",{fillColor:n.haloColor,fillOpacity:n.haloOpacity},t),t},Radius:function(n){return this.createElementNSPlus("sld:Radius",{value:n})},RasterSymbolizer:function(n){var t=this.createElementNSPlus("sld:RasterSymbolizer");return n.geometry&&this.writeNode("Geometry",n.geometry,t),n.opacity&&this.writeNode("Opacity",n.opacity,t),n.colorMap&&this.writeNode("ColorMap",n.colorMap,t),t},Geometry:function(n){var t=this.createElementNSPlus("sld:Geometry");return n.property&&this.writeNode("ogc:PropertyName",n,t),t},ColorMap:function(n){for(var i=this.createElementNSPlus("sld:ColorMap"),t=0,r=n.length;r>t;++t)this.writeNode("ColorMapEntry",n[t],i);return i},ColorMapEntry:function(n){var i=this.createElementNSPlus("sld:ColorMapEntry"),t=n;return i.setAttribute("color",t.color),void 0!==t.opacity&&i.setAttribute("opacity",parseFloat(t.opacity)),void 0!==t.quantity&&i.setAttribute("quantity",parseFloat(t.quantity)),void 0!==t.label&&i.setAttribute("label",t.label),i},PolygonSymbolizer:function(n){var t=this.createElementNSPlus("sld:PolygonSymbolizer");return n.fill!==!1&&this.writeNode("Fill",n,t),n.stroke!==!1&&this.writeNode("Stroke",n,t),t},Fill:function(n){var t=this.createElementNSPlus("sld:Fill");return n.fillColor&&this.writeNode("CssParameter",{symbolizer:n,key:"fillColor"},t),null!=n.fillOpacity&&this.writeNode("CssParameter",{symbolizer:n,key:"fillOpacity"},t),t},PointSymbolizer:function(n){var t=this.createElementNSPlus("sld:PointSymbolizer");return this.writeNode("Graphic",n,t),t},Graphic:function(n){var t=this.createElementNSPlus("sld:Graphic");return void 0!=n.externalGraphic?this.writeNode("ExternalGraphic",n,t):this.writeNode("Mark",n,t),void 0!=n.graphicOpacity&&this.writeNode("Opacity",n.graphicOpacity,t),void 0!=n.pointRadius&&this.writeNode("Size",2*n.pointRadius,t),void 0!=n.rotation&&this.writeNode("Rotation",n.rotation,t),t},ExternalGraphic:function(n){var t=this.createElementNSPlus("sld:ExternalGraphic"),i;return this.writeNode("OnlineResource",n.externalGraphic,t),i=n.graphicFormat||this.getGraphicFormat(n.externalGraphic),this.writeNode("Format",i,t),t},Mark:function(n){var t=this.createElementNSPlus("sld:Mark");return n.graphicName&&this.writeNode("WellKnownName",n.graphicName,t),n.fill!==!1&&this.writeNode("Fill",n,t),n.stroke!==!1&&this.writeNode("Stroke",n,t),t},WellKnownName:function(n){return this.createElementNSPlus("sld:WellKnownName",{value:n})},Opacity:function(n){return this.createElementNSPlus("sld:Opacity",{value:n})},Size:function(n){return this.createElementNSPlus("sld:Size",{value:n})},Rotation:function(n){return this.createElementNSPlus("sld:Rotation",{value:n})},OnlineResource:function(n){return this.createElementNSPlus("sld:OnlineResource",{attributes:{"xlink:type":"simple","xlink:href":n}})},Format:function(n){return this.createElementNSPlus("sld:Format",{value:n})}}},OpenLayers.Format.Filter.v1_0_0.prototype.writers),CLASS_NAME:"OpenLayers.Format.SLD.v1"});OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd",initialize:function(n){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[n])},read_sld_MinScaleDenominator:function(n,t){var i=parseFloat(this.getChildValue(t));i>0&&(n.maxScale=i)},read_sld_MaxScaleDenominator:function(n,t){n.minScale=parseFloat(this.getChildValue(t))},read_wmc_SRS:function(n,t){"srs"in n||(n.srs={});n.srs[this.getChildValue(t)]=!0},write_wmc_Layer:function(n){var t=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[n]),i,r,u;if(n.maxScale&&(i=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator"),i.appendChild(this.createTextNode(n.maxScale.toPrecision(16))),t.appendChild(i)),n.minScale&&(r=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator"),r.appendChild(this.createTextNode(n.minScale.toPrecision(16))),t.appendChild(r)),n.srs)for(u in n.srs)t.appendChild(this.createElementDefaultNS("SRS",u));return t.appendChild(this.write_wmc_FormatList(n)),t.appendChild(this.write_wmc_StyleList(n)),n.dimensions&&t.appendChild(this.write_wmc_DimensionList(n)),t.appendChild(this.write_wmc_LayerExtension(n)),t},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Format.XLS.v1_1_0=OpenLayers.Class(OpenLayers.Format.XLS.v1,{VERSION:"1.1",schemaLocation:"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.1.0/LocationUtilityService.xsd",initialize:function(n){OpenLayers.Format.XLS.v1.prototype.initialize.apply(this,[n])},CLASS_NAME:"OpenLayers.Format.XLS.v1_1_0"});OpenLayers.Format.XLS.v1_1=OpenLayers.Format.XLS.v1_1_0;OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15e3,translationParameters:null,symbolMetrics:null,initialize:function(){this.supported()&&(OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.translationParameters={x:0,y:0},this.symbolMetrics={})},supported:function(){var n="http://www.w3.org/TR/SVG11/feature#";return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(n+"SVG","1.1")||document.implementation.hasFeature(n+"BasicStructure","1.1"))},inValidRange:function(n,t,i){var r=n+(i?0:this.translationParameters.x),u=t+(i?0:this.translationParameters.y);return r>=-this.MAX_PIXEL&&this.MAX_PIXEL>=r&&u>=-this.MAX_PIXEL&&this.MAX_PIXEL>=u},setExtent:function(n,t){var e,i;OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var r=this.getResolution(),u=-n.left/r,f=n.top/r;return t?(this.left=u,this.top=f,e="0 0 "+this.size.w+" "+this.size.h,this.rendererRoot.setAttributeNS(null,"viewBox",e),this.translate(0,0),!0):(i=this.translate(u-this.left,f-this.top),i||this.setExtent(n,!0),i)},translate:function(n,t){if(this.inValidRange(n,t,!0)){var i="";return(n||t)&&(i="translate("+n+","+t+")"),this.root.setAttributeNS(null,"transform",i),this.translationParameters={x:n,y:t},!0}return!1},setSize:function(){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(n,t){var i=null;switch(n.CLASS_NAME){case"OpenLayers.Geometry.Point":i=t.externalGraphic?"image":this.isComplexSymbol(t.graphicName)?"svg":"circle";break;case"OpenLayers.Geometry.Rectangle":i="rect";break;case"OpenLayers.Geometry.LineString":i="polyline";break;case"OpenLayers.Geometry.LinearRing":i="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":i="path"}return i},setStyle:function(n,t,i){var r,p,s,c,u,f,e,v,o,y;if(t=t||n._style,i=i||n._options,p=parseFloat(n.getAttributeNS(null,"r")),s=1,"OpenLayers.Geometry.Point"==n._geometryClass&&p){if(n.style.visibility="",t.graphic===!1)n.style.visibility="hidden";else if(t.externalGraphic){(r=this.getPosition(n),t.graphicTitle)&&(n.setAttributeNS(null,"title",t.graphicTitle),c=this.nodeFactory(null,"title"),c.textContent=t.graphicTitle,n.appendChild(c));t.graphicWidth&&t.graphicHeight&&n.setAttributeNS(null,"preserveAspectRatio","none");u=t.graphicWidth||t.graphicHeight;f=t.graphicHeight||t.graphicWidth;u=u?u:2*t.pointRadius;f=f?f:2*t.pointRadius;var w=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*u),b=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*f),k=t.graphicOpacity||t.fillOpacity;n.setAttributeNS(null,"x",(r.x+w).toFixed());n.setAttributeNS(null,"y",(r.y+b).toFixed());n.setAttributeNS(null,"width",u);n.setAttributeNS(null,"height",f);n.setAttributeNS(this.xlinkns,"href",t.externalGraphic);n.setAttributeNS(null,"style","opacity: "+k);n.onclick=OpenLayers.Renderer.SVG.preventDefault}else if(this.isComplexSymbol(t.graphicName)){var l=3*t.pointRadius,a=2*l,h=this.importSymbol(t.graphicName);r=this.getPosition(n);s=3*this.symbolMetrics[h.id][0]/a;e=n.parentNode;v=n.nextSibling;e&&e.removeChild(n);n.firstChild&&n.removeChild(n.firstChild);n.appendChild(h.firstChild.cloneNode(!0));n.setAttributeNS(null,"viewBox",h.getAttributeNS(null,"viewBox"));n.setAttributeNS(null,"width",a);n.setAttributeNS(null,"height",a);n.setAttributeNS(null,"x",r.x-l);n.setAttributeNS(null,"y",r.y-l);v?e.insertBefore(n,v):e&&e.appendChild(n)}else n.setAttributeNS(null,"r",t.pointRadius);o=t.rotation;(void 0!==o||void 0!==n._rotation)&&r&&((n._rotation=o,o|=0,"svg"!==n.nodeName)?n.setAttributeNS(null,"transform","rotate("+o+" "+r.x+" "+r.y+")"):(y=this.symbolMetrics[h.id],n.firstChild.setAttributeNS(null,"transform","rotate("+o+" "+y[1]+" "+y[2]+")")))}return i.isFilled?(n.setAttributeNS(null,"fill",t.fillColor),n.setAttributeNS(null,"fill-opacity",t.fillOpacity)):n.setAttributeNS(null,"fill","none"),i.isStroked?(n.setAttributeNS(null,"stroke",t.strokeColor),n.setAttributeNS(null,"stroke-opacity",t.strokeOpacity),n.setAttributeNS(null,"stroke-width",t.strokeWidth*s),n.setAttributeNS(null,"stroke-linecap",t.strokeLinecap||"round"),n.setAttributeNS(null,"stroke-linejoin","round"),t.strokeDashstyle&&n.setAttributeNS(null,"stroke-dasharray",this.dashStyle(t,s))):n.setAttributeNS(null,"stroke","none"),t.pointerEvents&&n.setAttributeNS(null,"pointer-events",t.pointerEvents),null!=t.cursor&&n.setAttributeNS(null,"cursor",t.cursor),n},dashStyle:function(n,t){var i=n.strokeWidth*t,r=n.strokeDashstyle;switch(r){case"solid":return"none";case"dot":return[1,4*i].join();case"dash":return[4*i,4*i].join();case"dashdot":return[4*i,4*i,1,4*i].join();case"longdash":return[8*i,4*i].join();case"longdashdot":return[8*i,4*i,1,4*i].join();default:return OpenLayers.String.trim(r).replace(/\s+/g,",")}},createNode:function(n,t){var i=document.createElementNS(this.xmlns,n);return t&&i.setAttributeNS(null,"id",t),i},nodeTypeCompare:function(n,t){return t==n.nodeName},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(n){return this.nodeFactory(this.container.id+n,"g")},createDefs:function(){var n=this.nodeFactory(this.container.id+"_defs","defs");return this.rendererRoot.appendChild(n),n},drawPoint:function(n,t){return this.drawCircle(n,t,1)},drawCircle:function(n,t,i){var r=this.getResolution(),u=t.x/r+this.left,f=this.top-t.y/r;return this.inValidRange(u,f)?(n.setAttributeNS(null,"cx",u),n.setAttributeNS(null,"cy",f),n.setAttributeNS(null,"r",i),n):!1},drawLineString:function(n,t){var i=this.getComponentsString(t.components);return i.path?(n.setAttributeNS(null,"points",i.path),i.complete?n:null):!1},drawLinearRing:function(n,t){var i=this.getComponentsString(t.components);return i.path?(n.setAttributeNS(null,"points",i.path),i.complete?n:null):!1},drawPolygon:function(n,t){for(var r,u,i="",o=!0,f=!0,e=0,s=t.components.length;s>e;e++)i+=" M",r=this.getComponentsString(t.components[e].components," "),u=r.path,u?(i+=" "+u,f=r.complete&&f):o=!1;return i+=" z",o?(n.setAttributeNS(null,"d",i),n.setAttributeNS(null,"fill-rule","evenodd"),f?n:null):!1},drawRectangle:function(n,t){var i=this.getResolution(),r=t.x/i+this.left,u=this.top-t.y/i;return this.inValidRange(r,u)?(n.setAttributeNS(null,"x",r),n.setAttributeNS(null,"y",u),n.setAttributeNS(null,"width",t.width/i),n.setAttributeNS(null,"height",t.height/i),n):!1},drawSurface:function(n,t){for(var i,u=null,f=!0,r=0,e=t.components.length;e>r;r++)0==r%3&&0==r/3?(i=this.getShortString(t.components[r]),i||(f=!1),u="M "+i):1==r%3?(i=this.getShortString(t.components[r]),i||(f=!1),u+=" C "+i):(i=this.getShortString(t.components[r]),i||(f=!1),u+=" "+i);return u+=" Z",f?(n.setAttributeNS(null,"d",u),n):!1},drawText:function(n,t,i){var c=this.getResolution(),l=i.x/c+this.left,a=i.y/c-this.top,r=this.nodeFactory(n+this.LABEL_ID_SUFFIX,"text"),e,o,s,f,u,h;for(r.setAttributeNS(null,"x",l),r.setAttributeNS(null,"y",-a),t.fontColor&&r.setAttributeNS(null,"fill",t.fontColor),t.fontOpacity&&r.setAttributeNS(null,"opacity",t.fontOpacity),t.fontFamily&&r.setAttributeNS(null,"font-family",t.fontFamily),t.fontSize&&r.setAttributeNS(null,"font-size",t.fontSize),t.fontWeight&&r.setAttributeNS(null,"font-weight",t.fontWeight),t.fontStyle&&r.setAttributeNS(null,"font-style",t.fontStyle),t.labelSelect===!0?(r.setAttributeNS(null,"pointer-events","visible"),r._featureId=n):r.setAttributeNS(null,"pointer-events","none"),e=t.labelAlign||"cm",r.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[0]]||"middle"),OpenLayers.IS_GECKO===!0&&r.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[1]]||"central"),o=t.label.split("\n"),s=o.length;r.childNodes.length>s;)r.removeChild(r.lastChild);for(f=0;s>f;f++)u=this.nodeFactory(n+this.LABEL_ID_SUFFIX+"_tspan_"+f,"tspan"),(t.labelSelect===!0&&(u._featureId=n,u._geometry=i,u._geometryClass=i.CLASS_NAME),OpenLayers.IS_GECKO===!1&&u.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[e[1]]||"-35%"),u.setAttribute("x",l),0==f)?(h=OpenLayers.Renderer.SVG.LABEL_VFACTOR[e[1]],null==h&&(h=-.5),u.setAttribute("dy",h*(s-1)+"em")):u.setAttribute("dy","1em"),u.textContent=""===o[f]?" ":o[f],u.parentNode||r.appendChild(u);r.parentNode||this.textRoot.appendChild(r)},getComponentsString:function(n,t){for(var u,f,s=[],e=!0,o=n.length,r=[],i=0;o>i;i++)f=n[i],s.push(f),u=this.getShortString(f),u?r.push(u):(i>0&&this.getShortString(n[i-1])&&r.push(this.clipLine(n[i],n[i-1])),o-1>i&&this.getShortString(n[i+1])&&r.push(this.clipLine(n[i],n[i+1])),e=!1);return{path:r.join(t||","),complete:e}},clipLine:function(n,t){if(t.equals(n))return"";var u,f=this.getResolution(),e=this.MAX_PIXEL-this.translationParameters.x,o=this.MAX_PIXEL-this.translationParameters.y,s=t.x/f+this.left,h=this.top-t.y/f,i=n.x/f+this.left,r=this.top-n.y/f;return(-e>i||i>e)&&(u=(r-h)/(i-s),i=0>i?-e:e,r=h+(i-s)*u),(-o>r||r>o)&&(u=(i-s)/(r-h),r=0>r?-o:o,i=s+(r-h)*u),i+","+r},getShortString:function(n){var t=this.getResolution(),i=n.x/t+this.left,r=this.top-n.y/t;return this.inValidRange(i,r)?i+","+r:!1},getPosition:function(n){return{x:parseFloat(n.getAttributeNS(null,"cx")),y:parseFloat(n.getAttributeNS(null,"cy"))}},importSymbol:function(n){var u,s,i,r,h;if(this.defs||(this.defs=this.createDefs()),u=this.container.id+"-"+n,s=document.getElementById(u),null!=s)return s;if(i=OpenLayers.Renderer.symbol[n],!i)throw Error(n+" is not a valid symbol name");r=this.nodeFactory(u,"symbol");h=this.nodeFactory(null,"polygon");r.appendChild(h);for(var f,e,t=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),a=[],o=0;i.length>o;o+=2)f=i[o],e=i[o+1],t.left=Math.min(t.left,f),t.bottom=Math.min(t.bottom,e),t.right=Math.max(t.right,f),t.top=Math.max(t.top,e),a.push(f,",",e);h.setAttributeNS(null,"points",a.join(" "));var c=t.getWidth(),l=t.getHeight(),v=[t.left-c,t.bottom-l,3*c,3*l];return r.setAttributeNS(null,"viewBox",v.join(" ")),this.symbolMetrics[u]=[Math.max(c,l),t.getCenterLonLat().lon,t.getCenterLonLat().lat],this.defs.appendChild(r),r},getFeatureIdFromEvent:function(n){var i=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments),t;return i||(t=n.target,i=t.parentNode&&t!=this.rendererRoot&&t.parentNode._featureId),i},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};OpenLayers.Renderer.SVG.LABEL_VSHIFT={t:"-70%",b:"0"};OpenLayers.Renderer.SVG.LABEL_VFACTOR={t:0,b:-1};OpenLayers.Renderer.SVG.preventDefault=function(n){n.preventDefault&&n.preventDefault()};OpenLayers.Format.SLD.v1_0_0=OpenLayers.Class(OpenLayers.Format.SLD.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd",initialize:function(n){OpenLayers.Format.SLD.v1.prototype.initialize.apply(this,[n])},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0"});OpenLayers.Format.OWSContext=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"0.3.1",getVersion:function(){var n=OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this,arguments);return"0.3.0"===n&&(n=this.defaultVersion),n},toContext:function(n){var t={};return"OpenLayers.Map"==n.CLASS_NAME&&(t.bounds=n.getExtent(),t.maxExtent=n.maxExtent,t.projection=n.projection,t.size=n.getSize(),t.layers=n.layers),t},CLASS_NAME:"OpenLayers.Format.OWSContext"});OpenLayers.Format.OWSContext.v0_3_1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{owc:"http://www.opengis.net/ows-context",gml:"http://www.opengis.net/gml",kml:"http://www.opengis.net/kml/2.2",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},VERSION:"0.3.1",schemaLocation:"http://www.opengis.net/ows-context http://www.ogcnetwork.net/schemas/owc/0.3.1/owsContext.xsd",defaultPrefix:"owc",extractAttributes:!0,xy:!0,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},featureNS:"http://mapserver.gis.umn.edu/mapserver",featureType:"vector",geometryName:"geometry",nestingLayerLookup:null,initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]);OpenLayers.Format.GML.v2.prototype.setGeometryTypes.call(this)},setNestingPath:function(n){var t,u;if(n.layersContext)for(t=0,u=n.layersContext.length;u>t;t++){var i=n.layersContext[t],r=[],f=n.title||"";n.metadata&&n.metadata.nestingPath&&(r=n.metadata.nestingPath.slice());""!=f&&r.push(f);i.metadata.nestingPath=r;i.layersContext&&this.setNestingPath(i)}},decomposeNestingPath:function(n){var i=[],t;if(OpenLayers.Util.isArray(n)){for(t=n.slice();t.length>0;)i.push(t.slice()),t.pop();i.reverse()}return i},read:function(n){var t,i;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),n&&9==n.nodeType&&(n=n.documentElement),t={},this.readNode(n,t),this.setNestingPath({layersContext:t.layersContext}),i=[],this.processLayer(i,t),delete t.layersContext,t.layersContext=i,t},processLayer:function(n,t){var i,u,r;if(t.layersContext)for(i=0,u=t.layersContext.length;u>i;i++)r=t.layersContext[i],n.push(r),r.layersContext&&this.processLayer(n,r)},write:function(n,t){var i;return this.nestingLayerLookup={},t=t||{},OpenLayers.Util.applyDefaults(t,n),i=this.writeNode("OWSContext",t),this.nestingLayerLookup=null,this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},readers:{kml:{Document:function(n,t){t.features=new OpenLayers.Format.KML({kmlns:this.namespaces.kml,extractStyles:!0}).read(n)}},owc:{OWSContext:function(n,t){this.readChildNodes(n,t)},General:function(n,t){this.readChildNodes(n,t)},ResourceList:function(n,t){this.readChildNodes(n,t)},Layer:function(n,t){var i={metadata:{},visibility:"1"!=n.getAttribute("hidden"),queryable:"1"==n.getAttribute("queryable"),opacity:null!=n.getAttribute("opacity")?parseFloat(n.getAttribute("opacity")):null,name:n.getAttribute("name"),categoryLayer:null==n.getAttribute("name"),formats:[],styles:[]};t.layersContext||(t.layersContext=[]);t.layersContext.push(i);this.readChildNodes(n,i)},InlineGeometry:function(n,t){var i,u,r;t.features=[];u=this.getElementsByTagNameNS(n,this.namespaces.gml,"featureMember");(u.length>=1&&(i=u[0]),i&&i.firstChild)&&(r=i.firstChild.nextSibling?i.firstChild.nextSibling:i.firstChild,this.setNamespace("feature",r.namespaceURI),this.featureType=r.localName||r.nodeName.split(":").pop(),this.readChildNodes(n,t))},Server:function(n,t){(t.service||t.version)&&t.service==OpenLayers.Format.Context.serviceTypes.WMS||(t.service=n.getAttribute("service"),t.version=n.getAttribute("version"),this.readChildNodes(n,t))},Name:function(n,t){t.name=this.getChildValue(n);this.readChildNodes(n,t)},Title:function(n,t){t.title=this.getChildValue(n);this.readChildNodes(n,t)},StyleList:function(n,t){this.readChildNodes(n,t.styles)},Style:function(n,t){var i={};t.push(i);this.readChildNodes(n,i)},LegendURL:function(n,t){var i={};t.legend=i;this.readChildNodes(n,i)},OnlineResource:function(n,t){t.url=this.getAttributeNS(n,this.namespaces.xlink,"href");this.readChildNodes(n,t)}},ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows,gml:OpenLayers.Format.GML.v2.prototype.readers.gml,sld:OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{owc:{OWSContext:function(n){var t=this.createElementNSPlus("OWSContext",{attributes:{version:this.VERSION,id:n.id||OpenLayers.Util.createUniqueID("OpenLayers_OWSContext_")}});return this.writeNode("General",n,t),this.writeNode("ResourceList",n,t),t},General:function(n){var t=this.createElementNSPlus("General");return this.writeNode("ows:BoundingBox",n,t),this.writeNode("ows:Title",n.title||"OpenLayers OWSContext",t),t},ResourceList:function(n){for(var i,u,r=this.createElementNSPlus("ResourceList"),t=0,f=n.layers.length;f>t;t++)i=n.layers[t],u=this.decomposeNestingPath(i.metadata.nestingPath),this.writeNode("_Layer",{layer:i,subPaths:u},r);return r},Server:function(n){var t=this.createElementNSPlus("Server",{attributes:{version:n.version,service:n.service}});return this.writeNode("OnlineResource",n,t),t},OnlineResource:function(n){return this.createElementNSPlus("OnlineResource",{attributes:{"xlink:href":n.url}})},InlineGeometry:function(n){var i=this.createElementNSPlus("InlineGeometry"),t,r;for(this.writeNode("gml:boundedBy",n.getDataExtent(),i),t=0,r=n.features.length;r>t;t++)this.writeNode("gml:featureMember",n.features[t],i);return i},StyleList:function(n){for(var i=this.createElementNSPlus("StyleList"),t=0,r=n.length;r>t;t++)this.writeNode("Style",n[t],i);return i},Style:function(n){var t=this.createElementNSPlus("Style");return this.writeNode("Name",n,t),this.writeNode("Title",n,t),n.legend&&this.writeNode("LegendURL",n,t),t},Name:function(n){return this.createElementNSPlus("Name",{value:n.name})},Title:function(n){return this.createElementNSPlus("Title",{value:n.title})},LegendURL:function(n){var t=this.createElementNSPlus("LegendURL");return this.writeNode("OnlineResource",n.legend,t),t},_WMS:function(n){var t=this.createElementNSPlus("Layer",{attributes:{name:n.params.LAYERS,queryable:n.queryable?"1":"0",hidden:n.visibility?"0":"1",opacity:n.opacity?n.opacity:null}});return this.writeNode("ows:Title",n.name,t),this.writeNode("ows:OutputFormat",n.params.FORMAT,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WMS,version:n.params.VERSION,url:n.url},t),n.metadata.styles&&n.metadata.styles.length>0&&this.writeNode("StyleList",n.metadata.styles,t),t},_Layer:function(n){var t,u,i,f,r,e;return(t=n.layer,u=n.subPaths,i=null,f=null,u.length>0)?(r=u[0].join("/"),e=r.lastIndexOf("/"),i=this.nestingLayerLookup[r],f=e>0?r.substring(e+1,r.length):r,i||(i=this.createElementNSPlus("Layer"),this.writeNode("ows:Title",f,i),this.nestingLayerLookup[r]=i),n.subPaths.shift(),this.writeNode("_Layer",n,i),i):(t instanceof OpenLayers.Layer.WMS?i=this.writeNode("_WMS",t):t instanceof OpenLayers.Layer.Vector&&(t.protocol instanceof OpenLayers.Protocol.WFS.v1?i=this.writeNode("_WFS",t):t.protocol instanceof OpenLayers.Protocol.HTTP?t.protocol.format instanceof OpenLayers.Format.GML?(t.protocol.format.version="2.1.2",i=this.writeNode("_GML",t)):t.protocol.format instanceof OpenLayers.Format.KML&&(t.protocol.format.version="2.2",i=this.writeNode("_KML",t)):(this.setNamespace("feature",this.featureNS),i=this.writeNode("_InlineGeometry",t))),t.options.maxScale&&this.writeNode("sld:MinScaleDenominator",t.options.maxScale,i),t.options.minScale&&this.writeNode("sld:MaxScaleDenominator",t.options.minScale,i),this.nestingLayerLookup[t.name]=i,i)},_WFS:function(n){var t=this.createElementNSPlus("Layer",{attributes:{name:n.protocol.featurePrefix+":"+n.protocol.featureType,hidden:n.visibility?"0":"1"}});return this.writeNode("ows:Title",n.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WFS,version:n.protocol.version,url:n.protocol.url},t),t},_InlineGeometry:function(n){var t=this.createElementNSPlus("Layer",{attributes:{name:this.featureType,hidden:n.visibility?"0":"1"}});return this.writeNode("ows:Title",n.name,t),this.writeNode("InlineGeometry",n,t),t},_GML:function(n){var t=this.createElementNSPlus("Layer");return this.writeNode("ows:Title",n.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.GML,url:n.protocol.url,version:n.protocol.format.version},t),t},_KML:function(n){var t=this.createElementNSPlus("Layer");return this.writeNode("ows:Title",n.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.KML,version:n.protocol.format.version,url:n.protocol.url},t),t}},gml:OpenLayers.Util.applyDefaults({boundedBy:function(n){var t=this.createElementNSPlus("gml:boundedBy");return this.writeNode("gml:Box",n,t),t}},OpenLayers.Format.GML.v2.prototype.writers.gml),ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.writers.ows,sld:OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},CLASS_NAME:"OpenLayers.Format.OWSContext.v0_3_1"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.eTop||(this.eTop=document.createElement("div"),this.eTop.className=this.displayClass+"Top",this.topInUnits.length,this.div.appendChild(this.eTop),this.eTop.style.visibility=""==this.topOutUnits||""==this.topInUnits?"hidden":"visible",this.eBottom=document.createElement("div"),this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),this.eBottom.style.visibility=""==this.bottomOutUnits||""==this.bottomInUnits?"hidden":"visible"),this.map.events.register("moveend",this,this.update),this.update(),this.div},getBarLen:function(n){var t,u=parseInt(Math.log(n)/Math.log(10)),i=Math.pow(10,u),r=parseInt(n/i);return t=r>5?5:r>2?2:1,t*i},update:function(){var u=this.map.getResolution(),h,c,i,r,v,y;if(u){var e=this.map.getUnits(),n=OpenLayers.INCHES_PER_UNIT,t=this.maxWidth*u*n[e],f=1;this.geodesic===!0&&(h=(this.map.getGeodesicPixelSize().w||1e-6)*this.maxWidth,c=t/n.km,f=h/c,t*=f);t>1e5?(i=this.topOutUnits,r=this.bottomOutUnits):(i=this.topInUnits,r=this.bottomInUnits);var o=t/n[i],s=t/n[r],l=this.getBarLen(o),a=this.getBarLen(s);o=l/n[e]*n[i];s=a/n[e]*n[r];v=o/u/f;y=s/u/f;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(y)+"px",this.eBottom.innerHTML=a+" "+r);"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(v)+"px",this.eTop.innerHTML=l+" "+i)}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(n,t,i,r){this.url=n;this.size=t?t:new OpenLayers.Size(20,20);this.offset=i?i:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=r;var u=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(u)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(n){null!=n&&(this.size=n);this.draw()},setUrl:function(n){null!=n&&(this.url=n);this.draw()},draw:function(n){return OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute"),this.moveTo(n),this.imageDiv},erase:function(){null!=this.imageDiv&&null!=this.imageDiv.parentNode&&OpenLayers.Element.remove(this.imageDiv)},setOpacity:function(n){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,n)},moveTo:function(n){if(null!=n&&(this.px=n),null!=this.imageDiv)if(null==this.px)this.display(!1);else{this.calculateOffset&&(this.offset=this.calculateOffset(this.size));var t=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,t)}},display:function(n){this.imageDiv.style.display=n?"":"none"},isDrawn:function(){return this.imageDiv&&this.imageDiv.parentNode&&11!=this.imageDiv.parentNode.nodeType},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(n,t){this.lonlat=n;var i=t?t:OpenLayers.Marker.defaultIcon();null==this.icon?this.icon=i:(this.icon.url=i.url,this.icon.size=i.size,this.icon.offset=i.offset,this.icon.calculateOffset=i.calculateOffset);this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;null!=this.icon&&(this.icon.destroy(),this.icon=null)},draw:function(n){return this.icon.draw(n)},erase:function(){null!=this.icon&&this.icon.erase()},moveTo:function(n){null!=n&&null!=this.icon&&this.icon.moveTo(n);this.lonlat=this.map.getLonLatFromLayerPx(n)},isDrawn:function(){return this.icon&&this.icon.isDrawn()},onScreen:function(){var n=!1,t;return this.map&&(t=this.map.getExtent(),n=t.containsLonLat(this.lonlat)),n},inflate:function(n){if(this.icon){var t=new OpenLayers.Size(this.icon.size.w*n,this.icon.size.h*n);this.icon.setSize(t)}},setOpacity:function(n){this.icon.setOpacity(n)},setUrl:function(n){this.icon.setUrl(n)},display:function(n){this.icon.display(n)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var n=OpenLayers.Util.getImagesLocation()+"marker.png",t=new OpenLayers.Size(21,25),i=function(n){return new OpenLayers.Pixel(-(n.w/2),-n.h)};return new OpenLayers.Icon(n,t,null,i)};OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,format:"image/png",serverResolutions:null,initialize:function(n,t,i,r){this.layername=i;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[n,t,{},r]);this.extension=this.format.split("/")[1].toLowerCase();this.extension="jpg"==this.extension?"jpeg":this.extension},clone:function(n){return null==n&&(n=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){function i(n,t){n+="";for(var i=[],r=0;t>r;++r)i.push("0");return i.join("").substring(0,t-n.length)+n}var r=this.map.getResolution(),e=this.maxExtent,o=this.tileSize,u=Math.round((n.left-e.left)/(r*o.w)),f=Math.round((n.bottom-e.bottom)/(r*o.h)),h=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,r):this.map.getZoom(),c=[this.layername,i(h,2),i(parseInt(u/1e6),3),i(parseInt(u/1e3)%1e3,3),i(parseInt(u)%1e3,3),i(parseInt(f/1e6),3),i(parseInt(f/1e3)%1e3,3),i(parseInt(f)%1e3,3)+"."+this.extension],s=c.join("/"),t=this.url;return OpenLayers.Util.isArray(t)&&(t=this.selectUrl(s,t)),t="/"==t.charAt(t.length-1)?t:t+"/",t+s},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:!1,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);return n&&this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this}),n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})),n},cacheFeatures:function(n){this.paging||(this.clearCache(),this.features=n.features,this.pageNext(n))},clearCache:function(){if(this.features)for(var n=0;this.features.length>n;++n)this.features[n].destroy();this.features=null;this.num=null},pageCount:function(){var n=this.features?this.features.length:0;return Math.ceil(n/this.length)},pageNum:function(){return this.num},pageLength:function(n){return n&&n>0&&(this.length=n),this.length},pageNext:function(n){var t=!1,i;return this.features&&(null===this.num&&(this.num=-1),i=(this.num+1)*this.length,t=this.page(i,n)),t},pagePrevious:function(){var n=!1,t;return this.features&&(null===this.num&&(this.num=this.pageCount()),t=(this.num-1)*this.length,n=this.page(t)),n},page:function(n,t){var u=!1,i,r;return this.features&&n>=0&&this.features.length>n&&(i=Math.floor(n/this.length),i!=this.num&&(this.paging=!0,r=this.features.slice(n,n+this.length),this.layer.removeFeatures(this.layer.features),this.num=i,t&&t.features?t.features=r:this.layer.addFeatures(r),this.paging=!1,u=!0)),u},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Control.TransformFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesetfeature","setfeature","beforetransform","transform","transformcomplete"],geometryTypes:null,layer:null,preserveAspectRatio:!1,rotate:!0,feature:null,renderIntent:"temporary",rotationHandleSymbolizer:null,box:null,center:null,scale:1,ratio:1,rotation:0,handles:null,rotationHandles:null,dragControl:null,initialize:function(n,t){this.EVENT_TYPES=OpenLayers.Control.TransformFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[t]);this.layer=n;this.rotationHandleSymbolizer||(this.rotationHandleSymbolizer={stroke:!1,pointRadius:10,fillOpacity:0,cursor:"pointer"});this.createBox();this.createControl()},activate:function(){var n=!1;return OpenLayers.Control.prototype.activate.apply(this,arguments)&&(this.dragControl.activate(),this.layer.addFeatures([this.box]),this.rotate&&this.layer.addFeatures(this.rotationHandles),this.layer.addFeatures(this.handles),n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.layer.removeFeatures(this.handles),this.rotate&&this.layer.removeFeatures(this.rotationHandles),this.layer.removeFeatures([this.box]),this.dragControl.deactivate(),n=!0),n&&this.unsetFeature(),n},setMap:function(n){this.dragControl.setMap(n);OpenLayers.Control.prototype.setMap.apply(this,arguments)},setFeature:function(n,t){var e,o,s,i,u,f,r,h;t=OpenLayers.Util.applyDefaults(t,{rotation:0,scale:1,ratio:1});e=this.rotation;o=this.center;OpenLayers.Util.extend(this,t);s=this.events.triggerEvent("beforesetfeature",{feature:n});s!==!1&&(this.feature=n,this.activate(),this._setfeature=!0,i=this.feature.geometry.getBounds(),this.box.move(i.getCenterLonLat()),this.box.geometry.rotate(-e,o),this._angle=0,this.rotation?(f=n.geometry.clone(),f.rotate(-this.rotation,this.center),r=new OpenLayers.Feature.Vector(f.getBounds().toGeometry()),r.geometry.rotate(this.rotation,this.center),this.box.geometry.rotate(this.rotation,this.center),this.box.move(r.geometry.getBounds().getCenterLonLat()),h=r.geometry.components[0].components[0],u=h.getBounds().getCenterLonLat()):u=new OpenLayers.LonLat(i.left,i.bottom),this.handles[0].move(u),delete this._setfeature,this.events.triggerEvent("setfeature",{feature:n}))},unsetFeature:function(){this.active?this.deactivate():(this.feature=null,this.rotation=0,this.scale=1,this.ratio=1)},createBox:function(){var n=this,r;this.center=new OpenLayers.Geometry.Point(0,0);r=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(-1,-1),new OpenLayers.Geometry.Point(0,-1),new OpenLayers.Geometry.Point(1,-1),new OpenLayers.Geometry.Point(1,0),new OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(0,1),new OpenLayers.Geometry.Point(-1,1),new OpenLayers.Geometry.Point(-1,0),new OpenLayers.Geometry.Point(-1,-1)]),null,"string"==typeof this.renderIntent?null:this.renderIntent);r.geometry.move=function(t,i){n._moving=!0;OpenLayers.Geometry.LineString.prototype.move.apply(this,arguments);n.center.move(t,i);delete n._moving};for(var t,u,f,s=function(n,t){OpenLayers.Geometry.Point.prototype.move.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.move(n,t);this._handle.geometry.move(n,t)},h=function(n,t,i){OpenLayers.Geometry.Point.prototype.resize.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.resize(n,t,i);this._handle.geometry.resize(n,t,i)},c=function(n,t){OpenLayers.Geometry.Point.prototype.rotate.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.rotate(n,t);this._handle.geometry.rotate(n,t)},l=function(t,i){var l=this.x,a=this.y,u,h,y,p;if(OpenLayers.Geometry.Point.prototype.move.call(this,t,i),!n._moving){var v=n.dragControl.handlers.drag.evt,w=!n._setfeature&&n.preserveAspectRatio,b=!(w||v&&v.shiftKey),c=new OpenLayers.Geometry.Point(l,a),r=n.center;this.rotate(-n.rotation,r);c.rotate(-n.rotation,r);var f=this.x-r.x,e=this.y-r.y,o=f-(this.x-c.x),s=e-(this.y-c.y);this.x=l;this.y=a;h=1;b?(u=1e-5>Math.abs(s)?1:e/s,h=(1e-5>Math.abs(o)?1:f/o)/u):(y=Math.sqrt(o*o+s*s),p=Math.sqrt(f*f+e*e),u=p/y);n._moving=!0;n.box.geometry.rotate(-n.rotation,r);delete n._moving;n.box.geometry.resize(u,r,h);n.box.geometry.rotate(n.rotation,r);n.transformFeature({scale:u,ratio:h})}},a=function(t,i){var c=this.x,l=this.y,e;if(OpenLayers.Geometry.Point.prototype.move.call(this,t,i),!n._moving){var o=n.dragControl.handlers.drag.evt,u=o&&o.shiftKey?45:1,f=n.center,s=this.x-f.x,h=this.y-f.y,a=s-t,v=h-i;this.x=c;this.y=l;var y=Math.atan2(v,a),p=Math.atan2(h,s),r=p-y;r*=180/Math.PI;n._angle=(n._angle+r)%360;e=n.rotation%u;(Math.abs(n._angle)>=u||0!==e)&&(r=Math.round(n._angle/u)*u-e,n._angle=0,n.box.geometry.rotate(r,f),n.transformFeature({rotation:r}))}},e=Array(8),o=Array(4),i=0;8>i;++i)t=r.geometry.components[i],u=new OpenLayers.Feature.Vector(t.clone(),null,"string"==typeof this.renderIntent?null:this.renderIntent),0==i%2&&(f=new OpenLayers.Feature.Vector(t.clone(),null,"string"==typeof this.rotationHandleSymbolizer?null:this.rotationHandleSymbolizer),f.geometry.move=a,t._rotationHandle=f,o[i/2]=f),t.move=s,t.resize=h,t.rotate=c,u.geometry.move=l,t._handle=u,e[i]=u;this.box=r;this.rotationHandles=o;this.handles=e},createControl:function(){var n=this;this.dragControl=new OpenLayers.Control.DragFeature(this.layer,{documentDrag:!0,moveFeature:function(){this.feature===n.feature&&(this.feature=n.box);OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,arguments)},onDrag:function(t){t===n.box&&(n.transformFeature({center:n.center}),n.drawHandles())},onStart:function(t){var r=!n.geometryTypes||-1!==OpenLayers.Util.indexOf(n.geometryTypes,t.geometry.CLASS_NAME),i=OpenLayers.Util.indexOf(n.handles,t);i+=OpenLayers.Util.indexOf(n.rotationHandles,t);t!==n.feature&&t!==n.box&&-2==i&&r&&n.setFeature(t)},onComplete:function(){n.events.triggerEvent("transformcomplete",{feature:n.feature})}})},drawHandles:function(){for(var t=this.layer,n=0;8>n;++n)this.rotate&&0==n%2&&t.drawFeature(this.rotationHandles[n/2],this.rotationHandleSymbolizer),t.drawFeature(this.handles[n],this.renderIntent)},transformFeature:function(n){var u;if(!this._setfeature&&(this.scale*=n.scale||1,this.ratio*=n.ratio||1,u=this.rotation,this.rotation=(this.rotation+(n.rotation||0))%360,this.events.triggerEvent("beforetransform",n)!==!1)){var t=this.feature,i=t.geometry,r=this.center;i.rotate(-u,r);n.scale||n.ratio?i.resize(n.scale,r,n.ratio):n.center&&t.move(n.center.getBounds().getCenterLonLat());i.rotate(this.rotation,r);this.layer.drawFeature(t);t.toState(OpenLayers.State.UPDATE);this.events.triggerEvent("transform",n)}this.layer.drawFeature(this.box,this.renderIntent);this.drawHandles()},destroy:function(){for(var n,t=0;8>t;++t)n=this.box.geometry.components[t],n._handle.destroy(),n._handle=null,n._rotationHandle&&n._rotationHandle.destroy(),n._rotationHandle=null;this.box.destroy();this.box=null;this.layer=null;this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.TransformFeature"});OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,sphericalMercator:!1,zoomOffset:0,serverResolutions:null,initialize:function(n,t,i){(i&&i.sphericalMercator||this.sphericalMercator)&&(i=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),maxResolution:156543.03390625,numZoomLevels:19,units:"m",projection:"EPSG:900913"},i));t=t||this.url;n=n||this.name;var r=[n,t,{},i];OpenLayers.Layer.Grid.prototype.initialize.apply(this,r)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){var t=this.getXYZ(n),i=this.url,r;return OpenLayers.Util.isArray(i)&&(r=""+t.x+t.y+t.z,i=this.selectUrl(r,i)),OpenLayers.String.format(i,t)},getXYZ:function(n){var t=this.map.getResolution(),i=Math.round((n.left-this.maxExtent.left)/(t*this.tileSize.w)),f=Math.round((this.maxExtent.top-n.top)/(t*this.tileSize.h)),u=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,t):this.map.getZoom()+this.zoomOffset,r=Math.pow(2,u);return this.wrapDateLine&&(i=(i%r+r)%r),{x:i,y:f,z:u}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap<\/a>",sphericalMercator:!0,url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",clone:function(n){return null==n&&(n=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions())),n=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[n])},wrapDateLine:!0,CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxOffsets:null,initialize:function(){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.dragHandler=new OpenLayers.Handler.Drag(this,{down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox},{keyMask:this.keyMask})},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.dragHandler&&(this.dragHandler.destroy(),this.dragHandler=null)},setMap:function(n){OpenLayers.Handler.prototype.setMap.apply(this,arguments);this.dragHandler&&this.dragHandler.setMap(n)},startBox:function(){this.callback("start",[]);this.zoomBox=OpenLayers.Util.createDiv("zoomBox",new OpenLayers.Pixel(-9999,-9999));this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.eventsDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.eventsDiv,"olDrawBox")},moveBox:function(n){var i=this.dragHandler.start.x,r=this.dragHandler.start.y,u=Math.abs(i-n.x),f=Math.abs(r-n.y),t=this.getBoxOffsets();this.zoomBox.style.width=u+t.width+1+"px";this.zoomBox.style.height=f+t.height+1+"px";this.zoomBox.style.left=(i>n.x?i-u-t.left:i-t.left)+"px";this.zoomBox.style.top=(r>n.y?r-f-t.top:r-t.top)+"px"},endBox:function(n){var i;if(Math.abs(this.dragHandler.start.x-n.x)>5||Math.abs(this.dragHandler.start.y-n.y)>5){var t=this.dragHandler.start,r=Math.min(t.y,n.y),u=Math.max(t.y,n.y),f=Math.min(t.x,n.x),e=Math.max(t.x,n.x);i=new OpenLayers.Bounds(f,u,e,r)}else i=this.dragHandler.start.clone();this.removeBox();this.callback("done",[i])},removeBox:function(){this.map.eventsDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxOffsets=null;OpenLayers.Element.removeClass(this.map.eventsDiv,"olDrawBox")},activate:function(){return OpenLayers.Handler.prototype.activate.apply(this,arguments)?(this.dragHandler.activate(),!0):!1},deactivate:function(){return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)?(this.dragHandler.deactivate()&&this.zoomBox&&this.removeBox(),!0):!1},getBoxOffsets:function(){var n,t;if(!this.boxOffsets){n=document.createElement("div");n.style.position="absolute";n.style.border="1px solid black";n.style.width="3px";document.body.appendChild(n);t=3==n.clientWidth;document.body.removeChild(n);var i=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width")),r=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width")),u=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width")),f=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"));this.boxOffsets={left:i,right:r,top:u,bottom:f,width:t===!1?i+r:0,height:t===!1?u+f:0}}return this.boxOffsets},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:!1,alwaysZoom:!1,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(n){var u,f,e,o;if(n instanceof OpenLayers.Bounds){if(this.out){var s=Math.abs(n.right-n.left),h=Math.abs(n.top-n.bottom),t=Math.min(this.map.size.h/h,this.map.size.w/s),i=this.map.getExtent(),r=this.map.getLonLatFromPixel(n.getCenterPixel()),c=r.lon-i.getWidth()/2*t,l=r.lon+i.getWidth()/2*t,a=r.lat-i.getHeight()/2*t,v=r.lat+i.getHeight()/2*t;u=new OpenLayers.Bounds(c,a,l,v)}else f=this.map.getLonLatFromPixel(new OpenLayers.Pixel(n.left,n.bottom)),e=this.map.getLonLatFromPixel(new OpenLayers.Pixel(n.right,n.top)),u=new OpenLayers.Bounds(f.lon,f.lat,e.lon,e.lat);o=this.map.getZoom();this.map.zoomToExtent(u);o==this.map.getZoom()&&1==this.alwaysZoom&&this.map.zoomTo(o+(this.out?-1:1))}else this.out?this.map.setCenter(this.map.getLonLatFromPixel(n),this.map.getZoom()-1):this.map.setCenter(this.map.getLonLatFromPixel(n),this.map.getZoom()+1)},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:!1,interval:1,documentDrag:!1,kinetic:null,enableKinetic:!1,kineticInterval:10,draw:function(){if(this.enableKinetic){var n={interval:this.kineticInterval};"object"==typeof this.enableKinetic&&(n=OpenLayers.Util.extend(n,this.enableKinetic));this.kinetic=new OpenLayers.Kinetic(n)}this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone,down:this.panMapStart},{interval:this.interval,documentDrag:this.documentDrag})},panMapStart:function(){this.kinetic&&this.kinetic.begin()},panMap:function(n){this.kinetic&&this.kinetic.update(n);this.panned=!0;this.map.pan(this.handler.last.x-n.x,this.handler.last.y-n.y,{dragging:!0,animate:!1})},panMapDone:function(n){var t,i;this.panned&&(t=null,(this.kinetic&&(t=this.kinetic.end(n)),this.map.pan(this.handler.last.x-n.x,this.handler.last.y-n.y,{dragging:!!t,animate:!1}),t)&&(i=this,this.kinetic.move(t,function(n,t,r){i.map.pan(n,t,{dragging:!r,animate:!1})})),this.panned=!1)},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:!0,double:!1,pixelTolerance:0,dblclickTolerance:13,stopSingle:!1,stopDouble:!1,timerId:null,touch:!1,down:null,last:null,first:null,rightclickTimerId:null,initialize:function(){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},touchstart:function(n){return this.touch||(this.unregisterMouseListeners(),this.touch=!0),this.down=this.getEventInfo(n),this.last=this.getEventInfo(n),!0},touchmove:function(n){return this.last=this.getEventInfo(n),!0},touchend:function(n){return this.down&&(n.xy=this.last.xy,n.lastTouches=this.last.touches,this.handleSingle(n),this.down=null),!0},unregisterMouseListeners:function(){this.map.events.un({mousedown:this.mousedown,mouseup:this.mouseup,click:this.click,dblclick:this.dblclick,scope:this})},mousedown:function(n){return this.down=this.getEventInfo(n),this.last=this.getEventInfo(n),!0},mouseup:function(n){var t=!0;return this.checkModifiers(n)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(n)&&(t=this.rightclick(n)),t},rightclick:function(n){if(this.passesTolerance(n)){if(null!=this.rightclickTimerId)return this.clearTimer(),this.callback("dblrightclick",[n]),!this.stopDouble;var t=this.double?OpenLayers.Util.extend({},n):this.callback("rightclick",[n]),i=OpenLayers.Function.bind(this.delayedRightCall,this,t);this.rightclickTimerId=window.setTimeout(i,this.delay)}return!this.stopSingle},delayedRightCall:function(n){this.rightclickTimerId=null;n&&this.callback("rightclick",[n])},click:function(n){return this.last||(this.last=this.getEventInfo(n)),this.handleSingle(n),!this.stopSingle},dblclick:function(n){return this.handleDouble(n),!this.stopDouble},handleDouble:function(n){this.double&&this.passesDblclickTolerance(n)&&this.callback("dblclick",[n])},handleSingle:function(n){if(this.passesTolerance(n))if(null!=this.timerId)this.last.touches&&1===this.last.touches.length&&(this.double&&OpenLayers.Event.stop(n),this.handleDouble(n)),this.last.touches&&2===this.last.touches.length||this.clearTimer();else{this.first=this.getEventInfo(n);var t=this.single?OpenLayers.Util.extend({},n):null;this.queuePotentialClick(t)}},queuePotentialClick:function(n){this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,n),this.delay)},passesTolerance:function(n){var i=!0,t,r;if(null!=this.pixelTolerance&&this.down&&this.down.xy&&(i=this.pixelTolerance>=this.down.xy.distanceTo(n.xy),i&&this.touch&&this.down.touches.length===this.last.touches.length))for(t=0,r=this.down.touches.length;r>t;++t)if(this.getTouchDistance(this.down.touches[t],this.last.touches[t])>this.pixelTolerance){i=!1;break}return i},getTouchDistance:function(n,t){return Math.sqrt(Math.pow(n.clientX-t.clientX,2)+Math.pow(n.clientY-t.clientY,2))},passesDblclickTolerance:function(){var n=!0;return this.down&&this.first&&(n=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance),n},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null);null!=this.rightclickTimerId&&(window.clearTimeout(this.rightclickTimerId),this.rightclickTimerId=null)},delayedCall:function(n){this.timerId=null;n&&this.callback("click",[n])},getEventInfo:function(n){var i,r,u,t;if(n.touches)for(r=n.touches.length,i=Array(r),t=0;r>t;t++)u=n.touches[t],i[t]={clientX:u.clientX,clientY:u.clientY};return{xy:n.xy,touches:i}},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),this.down=null,this.first=null,this.last=null,this.touch=!1,n=!0),n},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,documentDrag:!1,zoomBox:null,zoomBoxEnabled:!0,zoomWheelEnabled:!0,mouseWheelOptions:null,handleRightClicks:!1,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,autoActivate:!0,initialize:function(){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();this.dragPan&&this.dragPan.destroy();this.dragPan=null;this.zoomBox&&this.zoomBox.destroy();this.zoomBox=null;this.pinchZoom&&this.pinchZoom.destroy();this.pinchZoom=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return this.dragPan.activate(),this.zoomWheelEnabled&&this.handlers.wheel.activate(),this.handlers.click.activate(),this.zoomBoxEnabled&&this.zoomBox.activate(),this.pinchZoom&&this.pinchZoom.activate(),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return this.pinchZoom&&this.pinchZoom.deactivate(),this.zoomBox.deactivate(),this.dragPan.deactivate(),this.handlers.click.deactivate(),this.handlers.wheel.deactivate(),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){this.handleRightClicks&&(this.map.viewPortDiv.oncontextmenu=OpenLayers.Function.False);var n={click:this.defaultClick,dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};this.handlers.click=new OpenLayers.Handler.Click(this,n,{double:!0,stopDouble:!0});this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},this.mouseWheelOptions);OpenLayers.Control.PinchZoom&&(this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions)))},defaultClick:function(n){n.lastTouches&&2==n.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(n){var t=this.map.getLonLatFromViewPortPx(n.xy);this.map.setCenter(t,this.map.zoom+1)},defaultDblRightClick:function(n){var t=this.map.getLonLatFromViewPortPx(n.xy);this.map.setCenter(t,this.map.zoom-1)},wheelChange:function(n,t){var e=this.map.getZoom(),i=this.map.getZoom()+Math.round(t);if(i=Math.max(i,0),i=Math.min(i,this.map.getNumZoomLevels()),i!==e){var r=this.map.getSize(),o=r.w/2-n.xy.x,s=n.xy.y-r.h/2,u=this.map.baseLayer.getResolutionForZoom(i),f=this.map.getLonLatFromPixel(n.xy),h=new OpenLayers.LonLat(f.lon+o*u,f.lat+s*u);this.map.setCenter(h,i)}},wheelUp:function(n,t){this.wheelChange(n,t||1)},wheelDown:function(n,t){this.wheelChange(n,t||-1)},disableZoomBox:function(){this.zoomBoxEnabled=!1;this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=!0;this.active&&this.zoomBox.activate()},disableZoomWheel:function(){this.zoomWheelEnabled=!1;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=!0;this.active&&this.handlers.wheel.activate()},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],multi:!1,featureAdded:function(){},handlerOptions:null,initialize:function(n,t,i){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[i]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(n,t){this.layer.events.triggerEvent("sketchmodified",{vertex:n,feature:t})},create:function(n,t){this.layer.events.triggerEvent("sketchstarted",{vertex:n,feature:t})}},this.callbacks);this.layer=n;this.handlerOptions=this.handlerOptions||{};"multi"in this.handlerOptions||(this.handlerOptions.multi=this.multi);var r=this.layer.styleMap&&this.layer.styleMap.styles.temporary;r&&(this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":r})}));this.handler=new t(this,this.callbacks,this.handlerOptions)},drawFeature:function(n){var t=new OpenLayers.Feature.Vector(n),i=this.layer.events.triggerEvent("sketchcomplete",{feature:t});i!==!1&&(t.state=OpenLayers.State.INSERT,this.layer.addFeatures([t]),this.featureAdded(t),this.events.triggerEvent("featureadded",{feature:t}))},insertXY:function(n,t){this.handler&&this.handler.line&&this.handler.insertXY(n,t)},insertDeltaXY:function(n,t){this.handler&&this.handler.line&&this.handler.insertDeltaXY(n,t)},insertDirectionLength:function(n,t){this.handler&&this.handler.line&&this.handler.insertDirectionLength(n,t)},insertDeflectionLength:function(n,t){this.handler&&this.handler.line&&this.handler.insertDeflectionLength(n,t)},undo:function(){return this.handler.undo&&this.handler.undo()},redo:function(){return this.handler.redo&&this.handler.redo()},finishSketch:function(){this.handler.finishGeometry()},cancel:function(){this.handler.cancel()},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{holeModifier:null,drawingHole:!1,polygon:null,initialize:function(){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(n){var t=this.map.getLonLatFromPixel(n),i=new OpenLayers.Geometry.Point(t.lon,t.lat);this.point=new OpenLayers.Feature.Vector(i);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:!0})},addPoint:function(){if(!this.drawingHole&&this.holeModifier&&this.evt&&this.evt[this.holeModifier])for(var n,t,u=this.point.geometry,r=this.control.layer.features,i=r.length-1;i>=0;--i)if(n=r[i].geometry,(n instanceof OpenLayers.Geometry.Polygon||n instanceof OpenLayers.Geometry.MultiPolygon)&&n.intersects(u)){t=r[i];this.control.layer.removeFeatures([t],{silent:!0});this.control.layer.events.registerPriority("sketchcomplete",this,this.finalizeInteriorRing);this.control.layer.events.registerPriority("sketchmodified",this,this.enforceTopology);t.geometry.addComponent(this.line.geometry);this.polygon=t;this.drawingHole=!0;break}OpenLayers.Handler.Path.prototype.addPoint.apply(this,arguments)},getCurrentPointIndex:function(){return this.line.geometry.components.length-2},enforceTopology:function(n){var t=n.vertex,r=this.line.geometry.components,i;this.polygon.geometry.intersects(t)||(i=r[r.length-3],t.x=i.x,t.y=i.y)},finishGeometry:function(){var n=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[n]);this.removePoint();this.finalize()},finalizeInteriorRing:function(){var r=this.line.geometry,t=0!==r.getArea(),i,n;if(t){for(i=this.polygon.geometry.components,n=i.length-2;n>=0;--n)if(r.intersects(i[n])){t=!1;break}if(t)n:for(n=i.length-2;n>0;--n)for(var f=i[n].components,u=0,e=f.length;e>u;++u)if(r.containsPoint(f[u])){t=!1;break n}}return t?this.polygon.state!==OpenLayers.State.INSERT&&(this.polygon.state=OpenLayers.State.UPDATE):this.polygon.geometry.removeComponent(r),this.restoreFeature(),!1},cancel:function(){return this.drawingHole&&(this.polygon.geometry.removeComponent(this.line.geometry),this.restoreFeature(!0)),OpenLayers.Handler.Path.prototype.cancel.apply(this,arguments)},restoreFeature:function(n){this.control.layer.events.unregister("sketchcomplete",this,this.finalizeInteriorRing);this.control.layer.events.unregister("sketchmodified",this,this.enforceTopology);this.layer.removeFeatures([this.polygon],{silent:!0});this.control.layer.addFeatures([this.polygon],{silent:!0});this.drawingHole=!1;n||this.control.layer.events.triggerEvent("sketchcomplete",{feature:this.polygon})},destroyFeature:function(n){OpenLayers.Handler.Path.prototype.destroyFeature.call(this,n);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var n=this.polygon&&this.polygon.geometry;return n&&this.multi&&(n=new OpenLayers.Geometry.MultiPolygon([n])),n},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(n,t){OpenLayers.Control.Panel.prototype.initialize.apply(this,[t]);this.addControls([new OpenLayers.Control.Navigation]);var i=[new OpenLayers.Control.DrawFeature(n,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(n,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(n,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon"})];this.addControls(i)},draw:function(){var n=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return null===this.defaultControl&&(this.defaultControl=this.controls[0]),n},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);return n&&(this.layer.events.on({moveend:this.update,scope:this}),this.layer.events.on({refresh:this.update,scope:this}),this.layer.visibility===!0&&this.layer.inRange===!0?this.update():this.layer.events.on({visibilitychanged:this.update,scope:this})),n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&this.layer.events.un({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this}),n},update:function(n){var t=this.getMapBounds();null!==t&&(n&&n.force||this.invalidBounds(t))&&(this.calculateBounds(t),this.resolution=this.layer.map.getResolution(),this.triggerRead(n))},getMapBounds:function(){if(null===this.layer.map)return null;var n=this.layer.map.getExtent();return n&&!this.layer.projection.equals(this.layer.map.getProjectionObject())&&(n=n.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)),n},invalidBounds:function(n){var t,i;return n||(n=this.getMapBounds()),t=!this.bounds||!this.bounds.containsBounds(n),!t&&this.resFactor&&(i=this.resolution/this.layer.map.getResolution(),t=i>=this.resFactor||1/this.resFactor>=i),t},calculateBounds:function(n){n||(n=this.getMapBounds());var t=n.getCenterLonLat(),i=n.getWidth()*this.ratio,r=n.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(t.lon-i/2,t.lat-r/2,t.lon+i/2,t.lat+r/2)},triggerRead:function(n){this.response&&(this.layer.protocol.abort(this.response),this.layer.events.triggerEvent("loadend"));this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:this.createFilter(),callback:this.merge,scope:this},n))},createFilter:function(){var n=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});return this.layer.filter&&(n=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,n]})),n},merge:function(n){var t,r,u,f,i,e;if(this.layer.destroyFeatures(),t=n.features,t&&t.length>0){if(r=this.layer.projection,u=this.layer.map.getProjectionObject(),!u.equals(r))for(i=0,e=t.length;e>i;++i)f=t[i].geometry,f&&f.transform(r,u);this.layer.addFeatures(t)}this.response=null;this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:!0,lzd:null,zoomLevels:null,initialize:function(n,t,i,r,u,f){this.lzd=i;this.zoomLevels=r;var e=[];e.push(n,t,u,f);OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getZoom:function(){var n=this.map.getZoom();return this.map.getMaxExtent(),n-Math.log(this.maxResolution/(this.lzd/512))/Math.log(2)},getURL:function(n){n=this.adjustBounds(n);var r=this.getZoom(),t=this.map.getMaxExtent(),i=this.lzd/Math.pow(2,this.getZoom()),u=Math.floor((n.left-t.left)/i),f=Math.floor((n.bottom-t.bottom)/i);return this.map.getResolution()<=this.lzd/512&&this.getZoom()<=this.zoomLevels?this.getFullRequestString({L:r,X:u,Y:f}):OpenLayers.Util.getImagesLocation()+"blank.gif"},CLASS_NAME:"OpenLayers.Layer.WorldWind"});OpenLayers.Format.WMTSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",yx:{"urn:ogc:def:crs:EPSG::4326":!0},createLayer:function(n,t){var h,e,r,o,u,s,i,f;for(e in{layer:!0,matrixSet:!0})if(!(e in t))throw Error("Missing property '"+e+"' in layer configuration.");for(r=n.contents,o=r.tileMatrixSets[t.matrixSet],r.layers,i=0,f=r.layers.length;f>i;++i)if(r.layers[i].identifier===t.layer){u=r.layers[i];break}if(u&&o){for(i=0,f=u.styles.length;f>i&&(s=u.styles[i],!s.isDefault);++i);h=new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults(t,{url:n.operationsMetadata.GetTile.dcp.http.get,name:u.title,style:s.identifier,matrixIds:o.matrixIds}))}return h},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities"});OpenLayers.Layer.Google.v3={DEFAULTS:{maxExtent:new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),sphericalMercator:!0,maxResolution:156543.03390625,units:"m",projection:"EPSG:900913"},animationEnabled:!0,loadMapObject:function(){var i,t,u,n,r;this.type||(this.type=google.maps.MapTypeId.ROADMAP);t=OpenLayers.Layer.Google.cache[this.map.id];t?(i=t.mapObject,++t.count):(u=this.map.viewPortDiv,n=document.createElement("div"),n.id=this.map.id+"_GMapContainer",n.style.position="absolute",n.style.width="100%",n.style.height="100%",u.appendChild(n),r=this.map.getCenter(),i=new google.maps.Map(n,{center:r?new google.maps.LatLng(r.lat,r.lon):new google.maps.LatLng(0,0),zoom:this.map.getZoom()||0,mapTypeId:this.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,streetViewControl:!1}),t={mapObject:i,count:1},OpenLayers.Layer.Google.cache[this.map.id]=t,this.repositionListener=google.maps.event.addListenerOnce(i,"center_changed",OpenLayers.Function.bind(this.repositionMapElements,this)));this.mapObject=i;this.setGMapVisibility(this.visibility)},repositionMapElements:function(){var n,u,r,t,i;if(google.maps.event.trigger(this.mapObject,"resize"),n=this.mapObject.getDiv().firstChild,!n||3>n.childNodes.length)return this.repositionTimer=window.setTimeout(OpenLayers.Function.bind(this.repositionMapElements,this),250),!1;for(u=OpenLayers.Layer.Google.cache[this.map.id],r=this.map.viewPortDiv;"none"==n.lastChild.style.display;)r.appendChild(n.lastChild);t=n.lastChild;r.appendChild(t);t.style.zIndex="1100";t.style.bottom="";t.className="olLayerGoogleCopyright olLayerGoogleV3";t.style.display="";u.termsOfUse=t;i=n.lastChild;r.appendChild(i);i.style.zIndex="1100";i.style.bottom="";i.className="olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";i.style.display="";u.poweredBy=i;this.setGMapVisibility(this.visibility)},onMapResize:function(){var t,n;this.visibility?google.maps.event.trigger(this.mapObject,"resize"):(t=OpenLayers.Layer.Google.cache[this.map.id],t.resized||(n=this,google.maps.event.addListenerOnce(this.mapObject,"tilesloaded",function(){google.maps.event.trigger(n.mapObject,"resize");n.moveTo(n.map.getCenter(),n.map.getZoom());delete t.resized})),t.resized=!0)},setGMapVisibility:function(n){var t=OpenLayers.Layer.Google.cache[this.map.id],u;if(t){for(var i,f=this.type,e=this.map.layers,r=e.length-1;r>=0;--r)if(i=e[r],i instanceof OpenLayers.Layer.Google&&i.visibility===!0&&i.inRange===!0){f=i.type;n=!0;break}u=this.mapObject.getDiv();n===!0?(this.mapObject.setMapTypeId(f),u.style.left="",t.termsOfUse&&t.termsOfUse.style&&(t.termsOfUse.style.left="",t.termsOfUse.style.display="",t.poweredBy.style.display=""),t.displayed=this.id):(delete t.displayed,u.style.left="-9999px",t.termsOfUse&&t.termsOfUse.style&&(t.termsOfUse.style.display="none",t.termsOfUse.style.left="-9999px",t.poweredBy.style.display="none"))}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(n){var r=null,t,i;return null!=n&&(t=this.sphericalMercator?this.inverseMercator(n.bottom,n.left):new OpenLayers.LonLat(n.bottom,n.left),i=this.sphericalMercator?this.inverseMercator(n.top,n.right):new OpenLayers.LonLat(n.top,n.right),r=new google.maps.LatLngBounds(new google.maps.LatLng(t.lat,t.lon),new google.maps.LatLng(i.lat,i.lon))),r},getMapObjectLonLatFromMapObjectPixel:function(n){var i=this.map.getSize(),u=this.getLongitudeFromMapObjectLonLat(this.mapObject.center),f=this.getLatitudeFromMapObjectLonLat(this.mapObject.center),r=this.map.getResolution(),e=n.x-i.w/2,o=n.y-i.h/2,t=new OpenLayers.LonLat(u+e*r,f-o*r);return this.wrapDateLine&&(t=t.wrapDateLine(this.maxExtent)),this.getMapObjectLonLatFromLonLat(t.lon,t.lat)},getMapObjectPixelFromMapObjectLonLat:function(n){var u=this.getLongitudeFromMapObjectLonLat(n),f=this.getLatitudeFromMapObjectLonLat(n),t=this.map.getResolution(),i=this.map.getExtent(),r=new OpenLayers.Pixel(1/t*(u-i.left),1/t*(i.top-f));return this.getMapObjectPixelFromXY(r.x,r.y)},setMapObjectCenter:function(n,t){if(this.animationEnabled===!1&&t!=this.mapObject.zoom){var i=this.getMapContainer();google.maps.event.addListenerOnce(this.mapObject,"idle",function(){i.style.visibility=""});i.style.visibility="hidden"}this.mapObject.setOptions({center:n,zoom:t})},getMapObjectZoomFromMapObjectBounds:function(n){return this.mapObject.getBoundsZoomLevel(n)},getMapObjectLonLatFromLonLat:function(n,t){var i,r;return this.sphericalMercator?(r=this.inverseMercator(n,t),i=new google.maps.LatLng(r.lat,r.lon)):i=new google.maps.LatLng(t,n),i},getMapObjectPixelFromXY:function(n,t){return new google.maps.Point(n,t)},destroy:function(){this.repositionListener&&google.maps.event.removeListener(this.repositionListener);this.repositionTimer&&window.clearTimeout(this.repositionTimer);OpenLayers.Layer.Google.prototype.destroy.apply(this,arguments)}};OpenLayers.Format.WPSDescribeProcess=OpenLayers.Class(OpenLayers.Format.XML,{VERSION:"1.0.0",namespaces:{wps:"http://www.opengis.net/wps/1.0.0",ows:"http://www.opengis.net/ows/1.1",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",defaultPrefix:"wps",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{wps:{ProcessDescriptions:function(n,t){t.processDescriptions={};this.readChildNodes(n,t.processDescriptions)},ProcessDescription:function(n,t){var r=this.getAttributeNS(n,this.namespaces.wps,"processVersion"),i={processVersion:r,statusSupported:"true"===n.getAttribute("statusSupported"),storeSupported:"true"===n.getAttribute("storeSupported")};this.readChildNodes(n,i);t[i.identifier]=i},DataInputs:function(n,t){t.dataInputs=[];this.readChildNodes(n,t.dataInputs)},ProcessOutputs:function(n,t){t.processOutputs=[];this.readChildNodes(n,t.processOutputs)},Output:function(n,t){var i={};this.readChildNodes(n,i);t.push(i)},ComplexOutput:function(n,t){t.complexOutput={};this.readChildNodes(n,t.complexOutput)},Input:function(n,t){var i={maxOccurs:parseInt(n.getAttribute("maxOccurs")),minOccurs:parseInt(n.getAttribute("minOccurs"))};this.readChildNodes(n,i);t.push(i)},BoundingBoxData:function(n,t){t.boundingBoxData={};this.readChildNodes(n,t.boundingBoxData)},CRS:function(n,t){t.CRSs||(t.CRSs={});t.CRSs[this.getChildValue(n)]=!0},LiteralData:function(n,t){t.literalData={};this.readChildNodes(n,t.literalData)},ComplexData:function(n,t){t.complexData={};this.readChildNodes(n,t.complexData)},Default:function(n,t){t["default"]={};this.readChildNodes(n,t["default"])},Supported:function(n,t){t.supported={};this.readChildNodes(n,t.supported)},Format:function(n,t){var i={};this.readChildNodes(n,i);t.formats||(t.formats={});t.formats[i.mimeType]=!0},MimeType:function(n,t){t.mimeType=this.getChildValue(n)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSDescribeProcess"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(n){OpenLayers.Control.Panel.prototype.initialize.apply(this,[n]);this.addControls([new OpenLayers.Control.Navigation,new OpenLayers.Control.ZoomBox])},draw:function(){var n=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return null===this.defaultControl&&(this.defaultControl=this.controls[0]),n},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Format.CSWGetRecords.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{csw:"http://www.opengis.net/cat/csw/2.0.2",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",geonet:"http://www.fao.org/geonetwork",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",requestId:null,resultType:null,outputFormat:null,outputSchema:null,startPosition:null,maxRecords:null,DistributedSearch:null,ResponseHandler:null,Query:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{csw:{GetRecordsResponse:function(n,t){t.records=[];this.readChildNodes(n,t);var i=this.getAttributeNS(n,"","version");""!=i&&(t.version=i)},RequestId:function(n,t){t.RequestId=this.getChildValue(n)},SearchStatus:function(n,t){t.SearchStatus={};var i=this.getAttributeNS(n,"","timestamp");""!=i&&(t.SearchStatus.timestamp=i)},SearchResults:function(n,t){this.readChildNodes(n,t);for(var r=n.attributes,u={},i=0,f=r.length;f>i;++i)u[r[i].name]="numberOfRecordsMatched"==r[i].name||"numberOfRecordsReturned"==r[i].name||"nextRecord"==r[i].name?parseInt(r[i].nodeValue):r[i].nodeValue;t.SearchResults=u},SummaryRecord:function(n,t){var i={type:"SummaryRecord"};this.readChildNodes(n,i);t.records.push(i)},BriefRecord:function(n,t){var i={type:"BriefRecord"};this.readChildNodes(n,i);t.records.push(i)},DCMIRecord:function(n,t){var i={type:"DCMIRecord"};this.readChildNodes(n,i);t.records.push(i)},Record:function(n,t){var i={type:"Record"};this.readChildNodes(n,i);t.records.push(i)},"*":function(n,t){var i=n.localName||n.nodeName.split(":").pop();t[i]=this.getChildValue(n)}},geonet:{info:function(n,t){var i={};this.readChildNodes(n,i);t.gninfo=i}},dc:{"*":function(n,t){var r=n.localName||n.nodeName.split(":").pop();OpenLayers.Util.isArray(t[r])||(t[r]=[]);for(var u={},f=n.attributes,i=0,e=f.length;e>i;++i)u[f[i].name]=f[i].nodeValue;u.value=this.getChildValue(n);t[r].push(u)}},dct:{"*":function(n,t){var i=n.localName||n.nodeName.split(":").pop();OpenLayers.Util.isArray(t[i])||(t[i]=[]);t[i].push(this.getChildValue(n))}},ows:OpenLayers.Util.applyDefaults({BoundingBox:function(n,t){t.bounds&&(t.BoundingBox=[{crs:t.projection,value:[t.bounds.left,t.bounds.bottom,t.bounds.right,t.bounds.top]}],delete t.projection,delete t.bounds);OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows.BoundingBox.apply(this,arguments)}},OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows)},write:function(n){var t=this.writeNode("csw:GetRecords",n);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{csw:{GetRecords:function(n){var t,i,r,u;if(n||(n={}),t=this.createElementNSPlus("csw:GetRecords",{attributes:{service:"CSW",version:this.version,requestId:n.requestId||this.requestId,resultType:n.resultType||this.resultType,outputFormat:n.outputFormat||this.outputFormat,outputSchema:n.outputSchema||this.outputSchema,startPosition:n.startPosition||this.startPosition,maxRecords:n.maxRecords||this.maxRecords}}),(n.DistributedSearch||this.DistributedSearch)&&this.writeNode("csw:DistributedSearch",n.DistributedSearch||this.DistributedSearch,t),i=n.ResponseHandler||this.ResponseHandler,OpenLayers.Util.isArray(i)&&i.length>0)for(r=0,u=i.length;u>r;r++)this.writeNode("csw:ResponseHandler",i[r],t);return this.writeNode("Query",n.Query||this.Query,t),t},DistributedSearch:function(n){return this.createElementNSPlus("csw:DistributedSearch",{attributes:{hopCount:n.hopCount}})},ResponseHandler:function(n){return this.createElementNSPlus("csw:ResponseHandler",{value:n.value})},Query:function(n){var t,i,r,u;if(n||(n={}),t=this.createElementNSPlus("csw:Query",{attributes:{typeNames:n.typeNames||"csw:Record"}}),i=n.ElementName,OpenLayers.Util.isArray(i)&&i.length>0)for(r=0,u=i.length;u>r;r++)this.writeNode("csw:ElementName",i[r],t);else this.writeNode("csw:ElementSetName",n.ElementSetName||{value:"summary"},t);return n.Constraint&&this.writeNode("csw:Constraint",n.Constraint,t),n.SortBy&&this.writeNode("ogc:SortBy",n.SortBy,t),t},ElementName:function(n){return this.createElementNSPlus("csw:ElementName",{value:n.value})},ElementSetName:function(n){return this.createElementNSPlus("csw:ElementSetName",{attributes:{typeNames:n.typeNames},value:n.value})},Constraint:function(n){var t=this.createElementNSPlus("csw:Constraint",{attributes:{version:n.version}}),i,r;return n.Filter?(i=new OpenLayers.Format.Filter({version:n.version}),t.appendChild(i.write(n.Filter))):n.CqlText&&(r=this.createElementNSPlus("CqlText",{value:n.CqlText.value}),t.appendChild(r)),t}},ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.CSWGetRecords.v2_0_2"});OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(n,t,i){this.bounds=n;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(t,i)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(n,t){n||(n="red");t||(t=2);this.div.style.border=t+"px solid "+n},draw:function(n,t){return OpenLayers.Util.modifyDOMElement(this.div,null,n,t),this.div},onScreen:function(){var n=!1,t;return this.map&&(t=this.map.getExtent(),n=t.containsBounds(this.bounds,!0,!0)),n},display:function(n){this.div.style.display=n?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:!0,initialize:function(n){n=n||{};n.extractStyles!==!1&&(n.defaultStyle={externalGraphic:OpenLayers.Util.getImagesLocation()+"marker.png",graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5});OpenLayers.Format.prototype.initialize.apply(this,[n])},read:function(n){for(var o,c,l,a,p,i,v=n.split("\n"),y=[],h=0;v.length-1>h;h++)if(o=v[h].replace(/^\s*/,"").replace(/\s*$/,""),"#"!=o.charAt(0))if(i){for(var r=o.split("\t"),f=new OpenLayers.Geometry.Point(0,0),e={},u=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null,s=!1,t=0;r.length>t;t++)r[t]&&("point"==i[t]?(c=r[t].split(","),f.y=parseFloat(c[0]),f.x=parseFloat(c[1]),s=!0):"lat"==i[t]?(f.y=parseFloat(r[t]),s=!0):"lon"==i[t]?(f.x=parseFloat(r[t]),s=!0):"title"==i[t]?e.title=r[t]:"image"==i[t]||"icon"==i[t]&&u?u.externalGraphic=r[t]:"iconSize"==i[t]&&u?(l=r[t].split(","),u.graphicWidth=parseFloat(l[0]),u.graphicHeight=parseFloat(l[1])):"iconOffset"==i[t]&&u?(a=r[t].split(","),u.graphicXOffset=parseFloat(a[0]),u.graphicYOffset=parseFloat(a[1])):"description"==i[t]?e.description=r[t]:"overflow"==i[t]?e.overflow=r[t]:e[i[t]]=r[t]);s&&(this.internalProjection&&this.externalProjection&&f.transform(this.externalProjection,this.internalProjection),p=new OpenLayers.Feature.Vector(f,e,u),y.push(p))}else i=o.split("\t");return y},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadText:function(){if(!this.loaded&&null!=this.location){var n=function(){this.events.triggerEvent("loadend")};this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:n,scope:this});this.loaded=!0}},moveTo:function(){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);this.visibility&&!this.loaded&&this.loadText()},parseData:function(n){var l=n.responseText,r={},h,u,c,i,t,f,o;OpenLayers.Util.extend(r,this.formatOptions);this.map&&!this.projection.equals(this.map.getProjectionObject())&&(r.externalProjection=this.projection,r.internalProjection=this.map.getProjectionObject());for(var a=new OpenLayers.Format.Text(r),s=a.read(l),e=0,v=s.length;v>e;e++)i={},t=s[e],h=new OpenLayers.LonLat(t.geometry.x,t.geometry.y),t.style.graphicWidth&&t.style.graphicHeight&&(u=new OpenLayers.Size(t.style.graphicWidth,t.style.graphicHeight)),void 0!==t.style.graphicXOffset&&void 0!==t.style.graphicYOffset&&(c=new OpenLayers.Pixel(t.style.graphicXOffset,t.style.graphicYOffset)),null!=t.style.externalGraphic?i.icon=new OpenLayers.Icon(t.style.externalGraphic,u,c):(i.icon=OpenLayers.Marker.defaultIcon(),null!=u&&i.icon.setSize(u)),null!=t.attributes.title&&null!=t.attributes.description&&(i.popupContentHTML="<h2>"+t.attributes.title+"<\/h2><p>"+t.attributes.description+"<\/p>"),i.overflow=t.attributes.overflow||"auto",f=new OpenLayers.Feature(this,h,i),this.features.push(f),o=f.createMarker(),null!=t.attributes.title&&null!=t.attributes.description&&o.events.register("click",f,this.markerClick),this.addMarker(o);this.events.triggerEvent("loadend")},markerClick:function(n){var i=this==this.layer.selectedFeature,t,r;for(this.layer.selectedFeature=i?null:this,t=0,r=this.layer.map.popups.length;r>t;t++)this.layer.map.removePopup(this.layer.map.popups[t]);i||this.layer.map.addPopup(this.createPopup());OpenLayers.Event.stop(n)},clearFeatures:function(){if(null!=this.features)for(;this.features.length>0;){var n=this.features[0];OpenLayers.Util.removeItem(this.features,n);n.destroy()}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",layerOptions:null,persist:!1,irregular:!1,angle:null,fixedRadius:!1,feature:null,layer:null,origin:null,initialize:function(n,t,i){i&&i.layerOptions&&i.layerOptions.styleMap||(this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{}));OpenLayers.Handler.Drag.prototype.initialize.apply(this,[n,t,i]);this.options=i?i:{}},setOptions:function(n){OpenLayers.Util.extend(this.options,n);OpenLayers.Util.extend(this,n)},activate:function(){var n=!1,t;return OpenLayers.Handler.Drag.prototype.activate.apply(this,arguments)&&(t=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True},this.layerOptions),this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,t),this.map.addLayer(this.layer),n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)&&(this.dragging&&this.cancel(),null!=this.layer.map&&(this.layer.destroy(!1),this.feature&&this.feature.destroy()),this.layer=null,this.feature=null,n=!0),n},down:function(n){this.fixedRadius=!!this.radius;var t=this.map.getLonLatFromPixel(n.xy);this.origin=new OpenLayers.Geometry.Point(t.lon,t.lat);(!this.fixedRadius||this.irregular)&&(this.radius=this.map.getResolution());this.persist&&this.clear();this.feature=new OpenLayers.Feature.Vector;this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature],{silent:!0});this.layer.drawFeature(this.feature,this.style)},move:function(n){var u=this.map.getLonLatFromPixel(n.xy),t=new OpenLayers.Geometry.Point(u.lon,u.lat),f,e,i,r;this.irregular?(f=Math.sqrt(2)*Math.abs(t.y-this.origin.y)/2,this.radius=Math.max(this.map.getResolution()/2,f)):this.fixedRadius?this.origin=t:(this.calculateAngle(t,n),this.radius=Math.max(this.map.getResolution()/2,t.distanceTo(this.origin)));(this.modifyGeometry(),this.irregular)&&(i=t.x-this.origin.x,r=t.y-this.origin.y,e=0==r?i/(this.radius*Math.sqrt(2)):i/r,this.feature.geometry.resize(1,this.origin,e),this.feature.geometry.move(i/2,r/2));this.layer.drawFeature(this.feature,this.style)},up:function(n){this.finalize();this.start==this.last&&this.callback("done",[n.xy])},out:function(){this.finalize()},createGeometry:function(){this.angle=Math.PI*(1/this.sides-.5);this.snapAngle&&(this.angle+=this.snapAngle*(Math.PI/180));this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var i,t,r=this.feature.geometry.components[0],n;for(r.components.length!=this.sides+1&&(this.createGeometry(),r=this.feature.geometry.components[0]),n=0;this.sides>n;++n)t=r.components[n],i=this.angle+2*n*Math.PI/this.sides,t.x=this.origin.x+this.radius*Math.cos(i),t.y=this.origin.y+this.radius*Math.sin(i),t.clearBounds()},calculateAngle:function(n,t){var r=Math.atan2(n.y-this.origin.y,n.x-this.origin.x),i;this.snapAngle&&this.snapToggle&&!t[this.snapToggle]?(i=Math.PI/180*this.snapAngle,this.angle=Math.round(r/i)*i):this.angle=r},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){this.layer&&(this.layer.renderer.clear(),this.layer.destroyFeatures())},callback:function(n){this.callbacks[n]&&this.callbacks[n].apply(this.control,[this.feature.geometry.clone()]);this.persist||"done"!=n&&"cancel"!=n||this.clear()},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Control.SLDSelect=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["selected"],clearOnDeactivate:!1,layers:null,callbacks:null,selectionSymbolizer:{Polygon:{fillColor:"#FF0000",stroke:!1},Line:{strokeColor:"#FF0000",strokeWidth:2},Point:{graphicName:"square",fillColor:"#FF0000",pointRadius:5}},layerOptions:null,handlerOptions:null,sketchStyle:null,wfsCache:{},layerCache:{},initialize:function(n,t){this.EVENT_TYPES=OpenLayers.Control.SLDSelect.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[t]);this.callbacks=OpenLayers.Util.extend({done:this.select,click:this.select},this.callbacks);this.handlerOptions=this.handlerOptions||{};this.layerOptions=OpenLayers.Util.applyDefaults(this.layerOptions,{displayInLayerSwitcher:!1,tileOptions:{maxGetUrlLength:2048}});this.sketchStyle&&(this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":this.sketchStyle})}));this.handler=new n(this,this.callbacks,this.handlerOptions)},destroy:function(){for(var n in this.layerCache)delete this.layerCache[n];for(n in this.wfsCache)delete this.wfsCache[n];OpenLayers.Control.prototype.destroy.apply(this,arguments)},coupleLayerVisiblity:function(n){this.setVisibility(n.object.getVisibility())},createSelectionLayer:function(n){var t;return this.layerCache[n.id]?t=this.layerCache[n.id]:(t=new OpenLayers.Layer.WMS(n.name,n.url,n.params,OpenLayers.Util.applyDefaults(this.layerOptions,n.getOptions())),this.layerCache[n.id]=t,this.layerOptions.displayInLayerSwitcher===!1&&n.events.on({visibilitychanged:this.coupleLayerVisiblity,scope:t}),this.map.addLayer(t)),t},createSLD:function(n,t,i){for(var f,u,e,h,o={version:"1.0.0",namedLayers:{}},s=[n.params.LAYERS].join(",").split(","),r=0,c=s.length;c>r;r++)f=s[r],o.namedLayers[f]={name:f,userStyles:[]},u=this.selectionSymbolizer,e=i[r],e.type.indexOf("Polygon")>=0?u={Polygon:this.selectionSymbolizer.Polygon}:e.type.indexOf("LineString")>=0?u={Line:this.selectionSymbolizer.Line}:e.type.indexOf("Point")>=0&&(u={Point:this.selectionSymbolizer.Point}),h=t[r],o.namedLayers[f].userStyles.push({name:"default",rules:[new OpenLayers.Rule({symbolizer:u,filter:h,maxScaleDenominator:n.options.minScale})]});return new OpenLayers.Format.SLD({srsName:this.map.getProjection()}).write(o)},parseDescribeLayer:function(n){var o=new OpenLayers.Format.WMSDescribeLayer,i=n.responseXML,e;i&&i.documentElement||(i=n.responseText);for(var r=o.read(i),u=[],f=null,t=0,s=r.length;s>t;t++)"WFS"==r[t].owsType&&(u.push(r[t].typeName),f=r[t].owsURL);e={url:f,params:{SERVICE:"WFS",TYPENAME:""+u,REQUEST:"DescribeFeatureType",VERSION:"1.0.0"},callback:function(n){var r=new OpenLayers.Format.WFSDescribeFeatureType,t=n.responseXML,i;t&&t.documentElement||(t=n.responseText);i=r.read(t);this.control.wfsCache[this.layer.id]=i;this.control._queue&&this.control.applySelection()},scope:this};OpenLayers.Request.GET(e)},getGeometryAttributes:function(n){for(var u,t,f=[],e=this.wfsCache[n.id],i=0,s=e.featureTypes.length;s>i;i++)for(var h=e.featureTypes[i],o=h.properties,r=0,c=o.length;c>r;r++)u=o[r],t=u.type,(t.indexOf("LineString")>=0||t.indexOf("GeometryAssociationType")>=0||t.indexOf("GeometryPropertyType")>=0||t.indexOf("Point")>=0||t.indexOf("Polygon")>=0)&&f.push(u);return f},activate:function(){var i=OpenLayers.Control.prototype.activate.call(this),t,r,n,u;if(i)for(t=0,r=this.layers.length;r>t;t++)n=this.layers[t],n&&!this.wfsCache[n.id]&&(u={url:n.url,params:{SERVICE:"WMS",VERSION:n.params.VERSION,LAYERS:n.params.LAYERS,REQUEST:"DescribeLayer"},callback:this.parseDescribeLayer,scope:{layer:n,control:this}},OpenLayers.Request.GET(u));return i},deactivate:function(){var u=OpenLayers.Control.prototype.deactivate.call(this),t,f,n,r,i;if(u)for(t=0,f=this.layers.length;f>t;t++)n=this.layers[t],n&&this.clearOnDeactivate===!0&&(r=this.layerCache,i=r[n.id],i&&(n.events.un({visibilitychanged:this.coupleLayerVisiblity,scope:i}),i.destroy(),delete r[n.id]));return u},setLayers:function(n){this.active?(this.deactivate(),this.layers=n,this.activate()):this.layers=n},createFilter:function(n,t){var i=null;return this.handler instanceof OpenLayers.Handler.RegularPolygon?i=this.handler.irregular===!0?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:n.name,value:t.getBounds()}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):this.handler instanceof OpenLayers.Handler.Polygon?i=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):this.handler instanceof OpenLayers.Handler.Path?i=n.type.indexOf("Point")>=0?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:n.name,distance:.01*this.map.getExtent().getWidth(),distanceUnits:this.map.getUnits(),value:t}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):this.handler instanceof OpenLayers.Handler.Click&&(i=n.type.indexOf("Polygon")>=0?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n.name,value:t}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:n.name,distance:.01*this.map.getExtent().getWidth(),distanceUnits:this.map.getUnits(),value:t})),i},select:function(n){this._queue=function(){for(var e,o,s,c,l,t=0,h=this.layers.length;h>t;t++){for(var i=this.layers[t],r=this.getGeometryAttributes(i),u=[],f=0,a=r.length;a>f;f++)e=r[f],null!==e&&(n instanceof OpenLayers.Geometry||(o=this.map.getLonLatFromPixel(n.xy),n=new OpenLayers.Geometry.Point(o.lon,o.lat)),s=this.createFilter(e,n),null!==s&&u.push(s));c=this.createSelectionLayer(i);l=this.createSLD(i,u,r);this.events.triggerEvent("selected",{layer:i,filters:u});c.mergeNewParams({SLD_BODY:l});delete this._queue}};this.applySelection()},applySelection:function(){for(var t=!0,n=0,i=this.layers.length;i>n;n++)if(!this.wfsCache[this.layers[n].id]){t=!1;break}t&&this._queue.call(this)},CLASS_NAME:"OpenLayers.Control.SLDSelect"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,geodesic:!1,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,[t]);this.element=OpenLayers.Util.getElement(n)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.element=document.createElement("div"),this.div.appendChild(this.element)),this.map.events.register("moveend",this,this.updateScale),this.updateScale(),this.div},updateScale:function(){var n,t,i;if(this.geodesic===!0){if(t=this.map.getUnits(),!t)return;i=OpenLayers.INCHES_PER_UNIT;n=(this.map.getGeodesicPixelSize().w||1e-6)*i.km*OpenLayers.DOTS_PER_INCH}else n=this.map.getScale();n&&(n=n>=9500&&95e4>=n?Math.round(n/1e3)+"K":n>=95e4?Math.round(n/1e6)+"M":Math.round(n),this.element.innerHTML=OpenLayers.i18n("Scale = 1 : ${scaleDenom}",{scaleDenom:n}))},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,useHttpTile:!1,singleTile:!1,useOverlay:!1,useAsyncOverlay:!0,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300,300),tileOriginCorner:"tl",initialize:function(n,t,i,r){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);(null==r||null==r.isBaseLayer)&&(this.isBaseLayer="true"!=this.transparent&&1!=this.transparent);r&&null!=r.useOverlay&&(this.useOverlay=r.useOverlay);this.singleTile?this.useOverlay?(OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS),this.useAsyncOverlay||(this.params.version="1.0.0")):OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS):(this.useHttpTile?OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS):OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS),this.setTileSize(this.defaultSize))},clone:function(n){return null==n&&(n=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){var i,o=n.getCenterLonLat(),s=this.map.getSize(),f,t,e,r,u;return this.singleTile?(f={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:s.h*this.ratio,setdisplaywidth:s.w*this.ratio,setviewcenterx:o.lon,setviewcentery:o.lat,setviewscale:this.map.getScale()},this.useOverlay&&!this.useAsyncOverlay&&(t={},t=OpenLayers.Util.extend(t,f),t.operation="GETVISIBLEMAPEXTENT",t.version="1.0.0",t.session=this.params.session,t.mapName=this.params.mapName,t.format="text/xml",i=this.getFullRequestString(t),OpenLayers.Request.GET({url:i,async:!1})),i=this.getFullRequestString(f)):(e=this.map.getResolution(),r=Math.floor((n.left-this.maxExtent.left)/e),r=Math.round(r/this.tileSize.w),u=Math.floor((this.maxExtent.top-n.top)/e),u=Math.round(u/this.tileSize.h),i=this.useHttpTile?this.getImageFilePath({tilecol:r,tilerow:u,scaleindex:this.resolutions.length-this.map.zoom-1}):this.getFullRequestString({tilecol:r,tilerow:u,scaleindex:this.resolutions.length-this.map.zoom-1})),i},getFullRequestString:function(n,t){var i=null==t?this.url:t,f,u,s,e,r,o;"object"==typeof i&&(i=i[Math.floor(Math.random()*i.length)]);f=i;u=OpenLayers.Util.extend({},this.params);u=OpenLayers.Util.extend(u,n);s=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(i));for(e in u)e.toUpperCase()in s&&delete u[e];return r=OpenLayers.Util.getParameterString(u),(r=r.replace(/,/g,"+"),""!=r)&&(o=i.charAt(i.length-1),f+="&"==o||"?"==o?r:-1==i.indexOf("?")?"?"+r:"&"+r),f},getImageFilePath:function(n,t){var i=null==t?this.url:t,f;"object"==typeof i&&(i=i[Math.floor(Math.random()*i.length)]);var e=i,r="",u="";return 0>n.tilerow&&(r="-"),r+=0==n.tilerow?"0":Math.floor(Math.abs(n.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder,0>n.tilecol&&(u="-"),u+=0==n.tilecol?"0":Math.floor(Math.abs(n.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder,f="/S"+Math.floor(n.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+r+"/C"+u+"/"+n.tilerow%this.params.tileRowsPerFolder+"_"+n.tilecol%this.params.tileColumnsPerFolder+"."+this.params.format,this.params.querystring&&(f+="?"+this.params.querystring),e+f},calculateGridLayout:function(n,t,i){var u=i*this.tileSize.w,r=i*this.tileSize.h,f=n.left-t.lon,e=Math.floor(f/u)-this.buffer,h=f/u-e,c=-h*this.tileSize.w,l=t.lon+e*u,o=t.lat-n.top+r,s=Math.floor(o/r)-this.buffer,a=s-o/r,v=a*this.tileSize.h,y=t.lat-r*s;return{tilelon:u,tilelat:r,tileoffsetlon:l,tileoffsetlat:y,tileoffsetx:c,tileoffsety:v}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:!1,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:!1,immediate:!1,initialize:function(n,t){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[t]);var i={done:this.measureComplete,point:this.measurePartial};this.immediate&&(i.modify=this.measureImmediate);this.callbacks=OpenLayers.Util.extend(i,this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new n(this,this.callbacks,this.handlerOptions)},deactivate:function(){return this.cancelDelay(),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},cancel:function(){this.cancelDelay();this.handler.cancel()},setImmediate:function(n){this.immediate=n;this.immediate?this.callbacks.modify=this.measureImmediate:delete this.callbacks.modify},updateHandler:function(n,t){var i=this.active;i&&this.deactivate();this.handler=new n(this,this.callbacks,t);i&&this.activate()},measureComplete:function(n){this.cancelDelay();this.measure(n,"measure")},measurePartial:function(n,t){this.cancelDelay();t=t.clone();this.handler.freehandMode(this.handler.evt)?this.measure(t,"measurepartial"):this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.delayedTrigger=null;this.measure(t,"measurepartial")},this),this.partialDelay)},measureImmediate:function(n,t,i){i&&null===this.delayedTrigger&&!this.handler.freehandMode(this.handler.evt)&&this.measure(t.geometry,"measurepartial")},cancelDelay:function(){null!==this.delayedTrigger&&(window.clearTimeout(this.delayedTrigger),this.delayedTrigger=null)},measure:function(n,t){var i,r;n.CLASS_NAME.indexOf("LineString")>-1?(i=this.getBestLength(n),r=1):(i=this.getBestArea(n),r=2);this.events.triggerEvent(t,{measure:i[0],units:i[1],order:r,geometry:n})},getBestArea:function(n){for(var t,i,u=this.displaySystemUnits[this.displaySystem],r=0,f=u.length;f>r&&(t=u[r],i=this.getArea(n,t),!(i>1));++r);return[i,t]},getArea:function(n,t){var i,r,u,f;return this.geodesic?(i=n.getGeodesicArea(this.map.getProjectionObject()),r="m"):(i=n.getArea(),r=this.map.getUnits()),u=OpenLayers.INCHES_PER_UNIT[t],u&&(f=OpenLayers.INCHES_PER_UNIT[r],i*=Math.pow(f/u,2)),i},getBestLength:function(n){for(var t,i,u=this.displaySystemUnits[this.displaySystem],r=0,f=u.length;f>r&&(t=u[r],i=this.getLength(n,t),!(i>1));++r);return[i,t]},getLength:function(n,t){var i,r,u,f;return this.geodesic?(i=n.getGeodesicLength(this.map.getProjectionObject()),r="m"):(i=n.getLength(),r=this.map.getUnits()),u=OpenLayers.INCHES_PER_UNIT[t],u&&(f=OpenLayers.INCHES_PER_UNIT[r],i*=f/u),i},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,units:null,resolution:OpenLayers.DOTS_PER_INCH,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(n,t,i,r){var u=[];u.push(n,t,i,r);OpenLayers.Layer.Grid.prototype.initialize.apply(this,u);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(n){n=this.adjustBounds(n);var t=this.map.getResolution(),i=Math.round(1e4*this.map.getScale())/1e4,r=Math.round(n.left/t),u=-Math.round(n.top/t);return this.getFullRequestString({t:u,l:r,s:i})},calculateGridLayout:function(n,t,i){var r=i*this.tileSize.w,u=i*this.tileSize.h,f=n.left,e=Math.floor(f/r)-this.buffer,h=f/r-e,c=-h*this.tileSize.w,l=e*r,o=n.top,s=Math.ceil(o/u)+this.buffer,a=s-o/u,v=-(a+1)*this.tileSize.h,y=s*u;return{tilelon:r,tilelat:u,tileoffsetlon:l,tileoffsetlat:y,tileoffsetx:c,tileoffsety:v}},clone:function(n){return null==n&&(n=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n]),null!=this.tileSize&&(n.tileSize=this.tileSize.clone()),n.grid=[],n},getTileBounds:function(n){var r=this.getResolution(),t=r*this.tileSize.w,i=r*this.tileSize.h,u=this.getLonLatFromViewPortPx(n),f=t*Math.floor(u.lon/t),e=i*Math.floor(u.lat/i);return new OpenLayers.Bounds(f,e,f+t,e+i)},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:!1,positionBlocks:null,blocks:null,fixedRelativePosition:!1,initialize:function(n,t,i,r,u,f){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);this.fixedRelativePosition&&(this.updateRelativePosition(),this.calculateRelativePosition=function(){return this.relativePosition});this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;f&&(this.closeDiv.style.zIndex=1);this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){var t,n;for(this.imageSrc=null,this.imageSize=null,this.isAlphaImage=null,this.fixedRelativePosition=!1,this.positionBlocks=null,t=0;this.blocks.length>t;t++)n=this.blocks[t],n.image&&n.div.removeChild(n.image),n.image=null,n.div&&this.groupDiv.removeChild(n.div),n.div=null;this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(){},setBorder:function(){},setOpacity:function(){},setSize:function(){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){if(this.padding=this.positionBlocks[this.relativePosition].padding,this.closeDiv){var n=this.getContentDivPadding();this.closeDiv.style.right=n.right+this.padding.right+"px";this.closeDiv.style.top=n.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(){var n=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);return n.offset(this.positionBlocks[this.relativePosition].offset)},createBlocks:function(){var i,r,u,t,n,f,e,o;this.blocks=[];i=null;for(r in this.positionBlocks){i=r;break}for(u=this.positionBlocks[i],t=0;u.blocks.length>t;t++)n={},this.blocks.push(n),f=this.id+"_FrameDecorationDiv_"+t,n.div=OpenLayers.Util.createDiv(f,null,null,null,"absolute",null,"hidden",null),e=this.id+"_FrameDecorationImg_"+t,o=this.isAlphaImage?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage,n.image=o(e,null,this.imageSize,this.imageSrc,"absolute",null,null,null),n.div.appendChild(n.image),this.groupDiv.appendChild(n.div)},updateBlocks:function(){var r,i;if(this.blocks||this.createBlocks(),this.size&&this.relativePosition){for(r=this.positionBlocks[this.relativePosition],i=0;r.blocks.length>i;i++){var n=r.blocks[i],t=this.blocks[i],u=n.anchor.left,f=n.anchor.bottom,e=n.anchor.right,o=n.anchor.top,s=isNaN(n.size.w)?this.size.w-(e+u):n.size.w,h=isNaN(n.size.h)?this.size.h-(f+o):n.size.h;t.div.style.width=(0>s?0:s)+"px";t.div.style.height=(0>h?0:h)+"px";t.div.style.left=null!=u?u+"px":"";t.div.style.bottom=null!=f?f+"px":"";t.div.style.right=null!=e?e+"px":"";t.div.style.top=null!=o?o+"px":"";t.image.style.left=n.position.x+"px";t.image.style.top=n.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:!0,panMapIfOutOfView:!0,imageSize:new OpenLayers.Size(1276,736),isAlphaImage:!1,fixedRelativePosition:!1,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-1238,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-1238,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-1238,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-1238,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(1200,660),initialize:function(){this.imageSrc=OpenLayers.Util.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.Tile.Image.IFrame={useIFrame:null,clear:function(){if(this.useIFrame){if(this.imgDiv){var n=this.imgDiv.firstChild;OpenLayers.Event.stopObservingElement(n);this.imgDiv.removeChild(n);delete n}}else OpenLayers.Tile.Image.prototype.clear.apply(this,arguments)},renderTile:function(){if(OpenLayers.Tile.Image.prototype.renderTile.apply(this,arguments)&&this.useIFrame){var n=this.createRequestForm();this.imgDiv.appendChild(n);n.submit();this.imgDiv.removeChild(n);delete n}return!0},initImgDiv:function(){var t,n;(this.useIFrame=null!==this.maxGetUrlLength&&!this.layer.async&&this.url.length>this.maxGetUrlLength,null!=this.imgDiv)&&(t=this.imgDiv.nodeName.toLowerCase(),(this.useIFrame&&"img"==t||!this.useIFrame&&"div"==t)&&(this.removeImgDiv(),this.imgDiv=null));this.useIFrame?(null==this.imgDiv&&(n=document.createElement("div"),"msie"==OpenLayers.BROWSER_NAME&&(n.style.backgroundColor="#FFFFFF",n.style.filter="chroma(color=#FFFFFF)"),OpenLayers.Util.modifyDOMElement(n,null,new OpenLayers.Pixel(0,0),this.layer.getImageSize(),"absolute"),this.imgDiv=document.createElement("div"),this.imgDiv.appendChild(n),OpenLayers.Util.modifyDOMElement(this.imgDiv,this.id,null,this.layer.getImageSize(),"relative"),this.imgDiv.className="olTileImage",this.frame.appendChild(this.imgDiv),this.layer.div.appendChild(this.frame),null!=this.layer.opacity&&OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity),this.imgDiv.map=this.layer.map),this.imgDiv.viewRequestID=this.layer.map.viewRequestID):OpenLayers.Tile.Image.prototype.initImgDiv.apply(this,arguments)},createIFrame:function(){var n,t=this.id+"_iFrame",i;return"msie"==OpenLayers.BROWSER_NAME?(n=document.createElement('<iframe name="'+t+'">'),n.style.backgroundColor="#FFFFFF",n.style.filter="chroma(color=#FFFFFF)"):(n=document.createElement("iframe"),n.style.backgroundColor="transparent",n.name=t),n.id=t,n.scrolling="no",n.marginWidth="0px",n.marginHeight="0px",n.frameBorder="0",OpenLayers.Util.modifyDOMElement(n,t,new OpenLayers.Pixel(0,0),this.layer.getImageSize(),"absolute"),i=function(){this.isLoading&&(this.isLoading=!1,this.events.triggerEvent("loadend"))},OpenLayers.Event.observe(n,"load",OpenLayers.Function.bind(i,this)),n},createRequestForm:function(){var n=document.createElement("form"),t,r,u,i;n.method="POST";t=this.layer.params._OLSALT;t=(t?t+"_":"")+this.bounds.toBBOX();n.action=OpenLayers.Util.urlAppend(this.layer.url,t);this.imgDiv.insertBefore(this.createIFrame(),this.imgDiv.firstChild);n.target=this.id+"_iFrame";this.layer.getImageSize();r=OpenLayers.Util.getParameters(this.url);for(u in r)i=document.createElement("input"),i.type="hidden",i.name=u,i.value=r[u],n.appendChild(i);return n}};OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(n,t,i,r){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=n;this.y=t;this.width=i;this.height=r},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)},getLength:function(){return 2*this.width+2*this.height},getArea:function(){return this.width*this.height},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Tile.WFS=OpenLayers.Class(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(n,t,i,r){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=r;this.features=[]},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(this,arguments);this.destroyAllFeatures();this.features=null;this.url=null;this.request&&(this.request.abort(),this.request=null)},clear:function(){this.destroyAllFeatures()},draw:function(){OpenLayers.Tile.prototype.draw.apply(this,arguments)&&(this.isLoading?this.events.triggerEvent("reload"):(this.isLoading=!0,this.events.triggerEvent("loadstart")),this.loadFeaturesForRegion(this.requestSuccess))},loadFeaturesForRegion:function(n,t){this.request&&this.request.abort();this.request=OpenLayers.Request.GET({url:this.url,success:n,failure:t,scope:this})},requestSuccess:function(n){var t,i,r;this.features&&(t=n.responseXML,(t&&t.documentElement||(t=n.responseText),this.layer.vectorMode)?this.layer.addFeatures(this.layer.formatObject.read(t)):(i=new OpenLayers.Format.XML,"string"==typeof t&&(t=i.read(t)),r=i.getElementsByTagNameNS(t,"http://www.opengis.net/gml","featureMember"),this.addResults(r)));this.events&&this.events.triggerEvent("loadend");this.request=null},addResults:function(n){for(var i,t=0;n.length>t;t++)i=new this.layer.featureClass(this.layer,n[t]),this.features.push(i)},destroyAllFeatures:function(){for(;this.features.length>0;){var n=this.features.shift();n.destroy()}},CLASS_NAME:"OpenLayers.Tile.WFS"});OpenLayers.Format.SOSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.SOSCapabilities"});OpenLayers.Format.SOSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.SOSCapabilities,{namespaces:{ows:"http://www.opengis.net/ows/1.1",sos:"http://www.opengis.net/sos/1.0",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]);this.options=n},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{gml:OpenLayers.Util.applyDefaults({name:function(n,t){t.name=this.getChildValue(n)},TimePeriod:function(n,t){t.timePeriod={};this.readChildNodes(n,t.timePeriod)},beginPosition:function(n,t){t.beginPosition=this.getChildValue(n)},endPosition:function(n,t){t.endPosition=this.getChildValue(n)}},OpenLayers.Format.GML.v3.prototype.readers.gml),sos:{Capabilities:function(n,t){this.readChildNodes(n,t)},Contents:function(n,t){t.contents={};this.readChildNodes(n,t.contents)},ObservationOfferingList:function(n,t){t.offeringList={};this.readChildNodes(n,t.offeringList)},ObservationOffering:function(n,t){var i=this.getAttributeNS(n,this.namespaces.gml,"id");t[i]={procedures:[],observedProperties:[],featureOfInterestIds:[],responseFormats:[],resultModels:[],responseModes:[]};this.readChildNodes(n,t[i])},time:function(n,t){t.time={};this.readChildNodes(n,t.time)},procedure:function(n,t){t.procedures.push(this.getAttributeNS(n,this.namespaces.xlink,"href"))},observedProperty:function(n,t){t.observedProperties.push(this.getAttributeNS(n,this.namespaces.xlink,"href"))},featureOfInterest:function(n,t){t.featureOfInterestIds.push(this.getAttributeNS(n,this.namespaces.xlink,"href"))},responseFormat:function(n,t){t.responseFormats.push(this.getChildValue(n))},resultModel:function(n,t){t.resultModels.push(this.getChildValue(n))},responseMode:function(n,t){t.responseModes.push(this.getChildValue(n))}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.SOSCapabilities.v1_0_0"});OpenLayers.Handler.Pinch=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!1,pinching:!1,last:null,start:null,initialize:function(){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},touchstart:function(n){var t=!0;return this.pinching=!1,OpenLayers.Event.isMultiTouch(n)?(this.started=!0,this.last=this.start={distance:this.getDistance(n.touches),delta:0,scale:1},this.callback("start",[n,this.start]),t=!this.stopDown):(this.started=!1,this.start=null,this.last=null),OpenLayers.Event.stop(n),t},touchmove:function(n){if(this.started&&OpenLayers.Event.isMultiTouch(n)){this.pinching=!0;var t=this.getPinchData(n);this.callback("move",[n,t]);this.last=t;OpenLayers.Event.stop(n)}return!0},touchend:function(n){return this.started&&(this.started=!1,this.pinching=!1,this.callback("done",[n,this.start,this.last]),this.start=null,this.last=null),!0},activate:function(){var n=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.pinching=!1,n=!0),n},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.started=!1,this.pinching=!1,this.start=null,this.last=null,n=!0),n},getDistance:function(n){var t=n[0],i=n[1];return Math.sqrt(Math.pow(t.clientX-i.clientX,2)+Math.pow(t.clientY-i.clientY,2))},getPinchData:function(n){var t=this.getDistance(n.touches),i=t/this.start.distance;return{distance:t,delta:this.last.distance-t,scale:i}},CLASS_NAME:"OpenLayers.Handler.Pinch"});OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:!1,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.handler&&this.handler.destroy();this.handler=null;this.map.events.un({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.map.events.on({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});this.registerWheelEvents()},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)},defaultClick:function(n){if(OpenLayers.Event.isLeftClick(n)){var t=!this.performedDrag;return this.performedDrag=!1,t}},defaultDblClick:function(n){var t=this.map.getLonLatFromViewPortPx(n.xy);return this.map.setCenter(t,this.map.zoom+1),OpenLayers.Event.stop(n),!1},defaultMouseDown:function(n){OpenLayers.Event.isLeftClick(n)&&(this.mouseDragStart=n.xy.clone(),this.performedDrag=!1,n.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.eventsDiv.appendChild(this.zoomBox)),document.onselectstart=OpenLayers.Function.False,OpenLayers.Event.stop(n))},defaultMouseMove:function(n){var t,i;if(this.mousePosition=n.xy.clone(),null!=this.mouseDragStart){if(this.zoomBox)t=Math.abs(this.mouseDragStart.x-n.xy.x),i=Math.abs(this.mouseDragStart.y-n.xy.y),this.zoomBox.style.width=Math.max(1,t)+"px",this.zoomBox.style.height=Math.max(1,i)+"px",n.xy.x<this.mouseDragStart.x&&(this.zoomBox.style.left=n.xy.x+"px"),n.xy.y<this.mouseDragStart.y&&(this.zoomBox.style.top=n.xy.y+"px");else{var t=this.mouseDragStart.x-n.xy.x,i=this.mouseDragStart.y-n.xy.y,r=this.map.getSize(),u=new OpenLayers.Pixel(r.w/2+t,r.h/2+i),f=this.map.getLonLatFromViewPortPx(u);this.map.setCenter(f,null,!0);this.mouseDragStart=n.xy.clone();this.map.div.style.cursor="move"}this.performedDrag=!0}},defaultMouseUp:function(n){OpenLayers.Event.isLeftClick(n)&&(this.zoomBox?this.zoomBoxEnd(n):this.performedDrag&&this.map.setCenter(this.map.center),document.onselectstart=null,this.mouseDragStart=null,this.map.div.style.cursor="")},defaultMouseOut:function(n){null!=this.mouseDragStart&&OpenLayers.Util.mouseLeft(n,this.map.eventsDiv)&&(this.zoomBox&&this.removeZoomBox(),this.mouseDragStart=null)},defaultWheelUp:function(n){this.map.getZoom()<=this.map.getNumZoomLevels()&&this.map.setCenter(this.map.getLonLatFromPixel(n.xy),this.map.getZoom()+1)},defaultWheelDown:function(n){this.map.getZoom()>0&&this.map.setCenter(this.map.getLonLatFromPixel(n.xy),this.map.getZoom()-1)},zoomBoxEnd:function(n){var t;if(null!=this.mouseDragStart){if(Math.abs(this.mouseDragStart.x-n.xy.x)>5||Math.abs(this.mouseDragStart.y-n.xy.y)>5){var i=this.map.getLonLatFromViewPortPx(this.mouseDragStart),t=this.map.getLonLatFromViewPortPx(n.xy),r=Math.max(i.lat,t.lat),u=Math.min(i.lat,t.lat),f=Math.min(i.lon,t.lon),e=Math.max(i.lon,t.lon),o=new OpenLayers.Bounds(f,u,e,r);this.map.zoomToExtent(o)}else t=this.map.getLonLatFromViewPortPx(n.xy),this.map.setCenter(new OpenLayers.LonLat(t.lon,t.lat),this.map.getZoom()+1);this.removeZoomBox()}},removeZoomBox:function(){this.map.eventsDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(n){for(var t,r=!1,i=OpenLayers.Event.element(n);null!=i;){if(this.map&&i==this.map.div){r=!0;break}i=i.parentNode}r&&(t=0,n||(n=window.event),n.wheelDelta?(t=n.wheelDelta/120,window.opera&&9.2>window.opera.version()&&(t=-t)):n.detail&&(t=-n.detail/3),t&&(n.xy=this.mousePosition,0>t?this.defaultWheelDown(n):this.defaultWheelUp(n)),OpenLayers.Event.stop(n))},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},readers:{xsd:{schema:function(n,t){var r=[],o={},l={complexTypes:r,customTypes:o},e,c,i,s;this.readChildNodes(n,l);for(var u,f,h=n.attributes,i=0,s=h.length;s>i;++i)u=h[i],f=u.name,0==f.indexOf("xmlns")?this.setNamespace(f.split(":")[1]||"",u.value):t[f]=u.value;for(t.featureTypes=r,t.targetPrefix=this.namespaceAlias[t.targetNamespace],i=0,s=r.length;s>i;++i)e=r[i],c=o[e.typeName],o[e.typeName]&&(e.typeName=c.name)},complexType:function(n,t){var i={typeName:n.getAttribute("name")};this.readChildNodes(n,i);t.complexTypes.push(i)},complexContent:function(n,t){this.readChildNodes(n,t)},extension:function(n,t){this.readChildNodes(n,t)},sequence:function(n,t){var i={elements:[]};this.readChildNodes(n,i);t.properties=i.elements},element:function(n,t){var o,i,s;if(t.elements){for(var u,r={},e=n.attributes,f=0,h=e.length;h>f;++f)u=e[f],r[u.name]=u.value;i=r.type;i||(i={},this.readChildNodes(n,i),r.restriction=i,r.type=i.base);o=i.base||i;r.localType=o.split(":").pop();t.elements.push(r)}t.complexTypes&&(i=n.getAttribute("type"),s=i.split(":").pop(),t.customTypes[s]={name:n.getAttribute("name"),type:i})},simpleType:function(n,t){this.readChildNodes(n,t)},restriction:function(n,t){t.base=n.getAttribute("base");this.readRestriction(n,t)}}},readRestriction:function(n,t){for(var r,i,u,e=n.childNodes,f=0,o=e.length;o>f;++f)r=e[f],1==r.nodeType&&(i=r.nodeName.split(":").pop(),u=r.getAttribute("value"),t[i]?("string"==typeof t[i]&&(t[i]=[t[i]]),t[i].push(u)):t[i]=u)},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});OpenLayers.Strategy.Refresh=OpenLayers.Class(OpenLayers.Strategy,{force:!1,interval:0,timer:null,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);return n&&(this.layer.visibility===!0&&this.start(),this.layer.events.on({visibilitychanged:this.reset,scope:this})),n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&this.stop(),n},reset:function(){this.layer.visibility===!0?this.start():this.stop()},start:function(){this.interval&&"number"==typeof this.interval&&this.interval>0&&(this.timer=window.setInterval(OpenLayers.Function.bind(this.refresh,this),this.interval))},refresh:function(){this.layer&&this.layer.refresh&&"function"==typeof this.layer.refresh&&this.layer.refresh({force:this.force})},stop:function(){null!==this.timer&&(window.clearInterval(this.timer),this.timer=null)},CLASS_NAME:"OpenLayers.Strategy.Refresh"});OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:!0,initialize:function(n,t,i,r){var u=[];i=OpenLayers.Util.upperCaseObject(i);u.push(n,t,i,r);OpenLayers.Layer.Grid.prototype.initialize.apply(this,u);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));this.params.TRANSPARENT&&"true"==(""+this.params.TRANSPARENT).toLowerCase()&&(null!=r&&r.isBaseLayer||(this.isBaseLayer=!1),"jpg"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"))},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){var i,t;n=this.adjustBounds(n);var r=this.projection.getCode().split(":"),u=r[r.length-1],f=this.getImageSize(),e={BBOX:n.toBBOX(),SIZE:f.w+","+f.h,F:"image",BBOXSR:u,IMAGESR:u};if(this.layerDefs){t=[];for(i in this.layerDefs)this.layerDefs.hasOwnProperty(i)&&this.layerDefs[i]&&(t.push(i),t.push(":"),t.push(this.layerDefs[i]),t.push(";"));t.length>0&&(e.LAYERDEFS=t.join(""))}return this.getFullRequestString(e)},setLayerFilter:function(n,t){this.layerDefs||(this.layerDefs={});t?this.layerDefs[n]=t:delete this.layerDefs[n]},clearLayerFilter:function(n){n?delete this.layerDefs[n]:delete this.layerDefs},mergeNewParams:function(n){var t=OpenLayers.Util.upperCaseObject(n),i=[t];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,i)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(n,t,i,r){var u=[];u.push(n,t,i,r);OpenLayers.Layer.Grid.prototype.initialize.apply(this,u);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);(null==r||null==r.isBaseLayer)&&(this.isBaseLayer="true"!=this.params.transparent&&1!=this.params.transparent)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){n=this.adjustBounds(n);var i=[n.left,n.bottom,n.right,n.top],t=this.getImageSize();return this.getFullRequestString({mapext:i,imgext:i,map_size:[t.w,t.h],imgx:t.w/2,imgy:t.h/2,imgxy:[t.w,t.h]})},getFullRequestString:function(n,t){var r=null==t?this.url:t,u=OpenLayers.Util.extend({},this.params),i,s,f,e,o;u=OpenLayers.Util.extend(u,n);i=OpenLayers.Util.getParameterString(u);OpenLayers.Util.isArray(r)&&(r=this.selectUrl(i,r));s=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(r));for(f in u)f.toUpperCase()in s&&delete u[f];return i=OpenLayers.Util.getParameterString(u),e=r,(i=i.replace(/,/g,"+"),""!=i)&&(o=r.charAt(r.length-1),e+="&"==o||"?"==o?i:-1==r.indexOf("?")?"?"+i:"&"+i),e},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.MapServer.Untiled=OpenLayers.Class(OpenLayers.Layer.MapServer,{singleTile:!0,initialize:function(){OpenLayers.Layer.MapServer.prototype.initialize.apply(this,arguments);OpenLayers.Console.warn("The OpenLayers.Layer.MapServer.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.MapServer class, passing it the option 'singleTile' as true.")},clone:function(n){return null==n&&(n=new OpenLayers.Layer.MapServer.Untiled(this.name,this.url,this.params,this.getOptions())),n=OpenLayers.Layer.MapServer.prototype.clone.apply(this,[n])},CLASS_NAME:"OpenLayers.Layer.MapServer.Untiled"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:!1,px:null,timerId:null,initialize:function(){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(n){return this.passesTolerance(n.xy)&&(this.clearTimer(),this.callback("move",[n]),this.px=n.xy,n=OpenLayers.Util.extend({},n),this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,n),this.delay)),!this.stopMove},mouseout:function(n){return OpenLayers.Util.mouseLeft(n,this.map.eventsDiv)&&(this.clearTimer(),this.callback("move",[n])),!0},passesTolerance:function(n){var t=!0,i;return this.pixelTolerance&&this.px&&(i=Math.sqrt(Math.pow(this.px.x-n.x,2)+Math.pow(this.px.y-n.y,2)),this.pixelTolerance>i&&(t=!1)),t},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null)},delayedCall:function(n){this.callback("pause",[n])},deactivate:function(){var n=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),n=!0),n},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:!1,click:!0,single:!0,clickout:!0,toggle:!1,clickTolerance:5,hover:!1,box:!1,maxFeatures:10,features:null,hoverFeature:null,handlerOptions:null,handlers:null,hoverResponse:null,filterType:OpenLayers.Filter.Spatial.BBOX,EVENT_TYPES:["featureselected","featuresselected","featureunselected","clickout","beforefeatureselected","beforefeaturesselected","hoverfeature","outfeature"],initialize:function(n){this.EVENT_TYPES=OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);n.handlerOptions=n.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[n]);this.features={};this.handlers={};this.click&&(this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectClick},this.handlerOptions.click||{}));this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"})));this.hover&&(this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250})))},activate:function(){if(!this.active)for(var n in this.handlers)this.handlers[n].activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active)for(var n in this.handlers)this.handlers[n].deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},selectClick:function(n){var t=this.pixelToBounds(n.xy);this.setModifiers(n);this.request(t,{single:this.single})},selectBox:function(n){var t,i,r;if(n instanceof OpenLayers.Bounds)i=this.map.getLonLatFromPixel(new OpenLayers.Pixel(n.left,n.bottom)),r=this.map.getLonLatFromPixel(new OpenLayers.Pixel(n.right,n.top)),t=new OpenLayers.Bounds(i.lon,i.lat,r.lon,r.lat);else{if(this.click)return;t=this.pixelToBounds(n)}this.setModifiers(this.handlers.box.dragHandler.evt);this.request(t)},selectHover:function(n){var t=this.pixelToBounds(n.xy);this.request(t,{single:!0,hover:!0})},cancelHover:function(){this.hoverResponse&&(this.protocol.abort(this.hoverResponse),this.hoverResponse=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"))},request:function(n,t){var i,r;t=t||{};i=new OpenLayers.Filter.Spatial({type:this.filterType,value:n});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");r=this.protocol.read({maxFeatures:1==t.single?this.maxFeatures:void 0,filter:i,callback:function(i){i.success()&&(i.features.length?1==t.single?this.selectBestFeature(i.features,n.getCenterLonLat(),t):this.select(i.features):t.hover?this.hoverSelect():(this.events.triggerEvent("clickout"),this.clickout&&this.unselectAll()));OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});1==t.hover&&(this.hoverResponse=r)},selectBestFeature:function(n,t,i){if(i=i||{},n.length){for(var r,u,f,s=new OpenLayers.Geometry.Point(t.lon,t.lat),e=Number.MAX_VALUE,o=0;n.length>o&&(r=n[o],!(r.geometry&&(f=s.distanceTo(r.geometry,{edge:!1}),e>f&&(e=f,u=r,0==e))));++o);1==i.hover?this.hoverSelect(u):this.select(u||n)}},setModifiers:function(n){this.modifiers={multiple:this.multiple||this.multipleKey&&n[this.multipleKey],toggle:this.toggle||this.toggleKey&&n[this.toggleKey]}},select:function(n){var i;if(this.modifiers.multiple||this.modifiers.toggle||this.unselectAll(),OpenLayers.Util.isArray(n)||(n=[n]),i=this.events.triggerEvent("beforefeaturesselected",{features:n}),i!==!1){for(var t,u=[],r=0,f=n.length;f>r;++r)t=n[r],this.features[t.fid||t.id]?this.modifiers.toggle&&this.unselect(this.features[t.fid||t.id]):(i=this.events.triggerEvent("beforefeatureselected",{feature:t}),i!==!1&&(this.features[t.fid||t.id]=t,u.push(t),this.events.triggerEvent("featureselected",{feature:t})));this.events.triggerEvent("featuresselected",{features:u})}},hoverSelect:function(n){var t=n?n.fid||n.id:null,i=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;i&&i!=t&&(this.events.triggerEvent("outfeature",{feature:this.hoverFeature}),this.hoverFeature=null);t&&t!=i&&(this.events.triggerEvent("hoverfeature",{feature:n}),this.hoverFeature=n)},unselect:function(n){delete this.features[n.fid||n.id];this.events.triggerEvent("featureunselected",{feature:n})},unselectAll:function(){for(var n in this.features)this.unselect(this.features[n])},setMap:function(n){for(var t in this.handlers)this.handlers[t].setMap(n);OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(n){var r=n.add(-this.clickTolerance/2,this.clickTolerance/2),u=n.add(this.clickTolerance/2,-this.clickTolerance/2),t=this.map.getLonLatFromPixel(r),i=this.map.getLonLatFromPixel(u);return new OpenLayers.Bounds(t.lon,t.lat,i.lon,i.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Format.QueryStringFilter=function(){function t(n){return n=n.replace(/%/g,"\\%"),n=n.replace(/\\\\\.(\*)?/g,function(n,t){return t?n:"\\\\_"}),n=n.replace(/\\\\\.\*/g,"\\\\%"),n=n.replace(/(\\)?\.(\*)?/g,function(n,t,i){return t||i?n:"_"}),n=n.replace(/(\\)?\.\*/g,function(n,t){return t?n:"%"}),n=n.replace(/\\\./g,"."),n=n.replace(/(\\)?\\\*/g,function(n,t){return t?n:"*"})}var n={};return n[OpenLayers.Filter.Comparison.EQUAL_TO]="eq",n[OpenLayers.Filter.Comparison.NOT_EQUAL_TO]="ne",n[OpenLayers.Filter.Comparison.LESS_THAN]="lt",n[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO]="lte",n[OpenLayers.Filter.Comparison.GREATER_THAN]="gt",n[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO]="gte",n[OpenLayers.Filter.Comparison.LIKE]="ilike",OpenLayers.Class(OpenLayers.Format,{wildcarded:!1,srsInBBOX:!1,write:function(i,r){var e,o,s,u,f,h;r=r||{};e=i.CLASS_NAME;o=e.substring(e.lastIndexOf(".")+1);switch(o){case"Spatial":switch(i.type){case OpenLayers.Filter.Spatial.BBOX:r.bbox=i.value.toArray();this.srsInBBOX&&i.projection&&r.bbox.push(i.projection.getCode());break;case OpenLayers.Filter.Spatial.DWITHIN:r.tolerance=i.distance;case OpenLayers.Filter.Spatial.WITHIN:r.lon=i.value.x;r.lat=i.value.y;break;default:OpenLayers.Console.warn("Unknown spatial filter type "+i.type)}break;case"Comparison":s=n[i.type];void 0!==s?(u=i.value,i.type==OpenLayers.Filter.Comparison.LIKE&&(u=t(u),this.wildcarded&&(u="%"+u+"%")),r[i.property+"__"+s]=u,r.queryable=r.queryable||[],r.queryable.push(i.property)):OpenLayers.Console.warn("Unknown comparison filter type "+i.type);break;case"Logical":if(i.type===OpenLayers.Filter.Logical.AND)for(f=0,h=i.filters.length;h>f;f++)r=this.write(i.filters[f],r);else OpenLayers.Console.warn("Unsupported logical filter type "+i.type);break;default:OpenLayers.Console.warn("Unknown filter type "+o)}return r},CLASS_NAME:"OpenLayers.Format.QueryStringFilter"})}();OpenLayers.Format.SOSGetFeatureOfInterest=OpenLayers.Class(OpenLayers.Format.XML,{VERSION:"1.0.0",namespaces:{sos:"http://www.opengis.net/sos/1.0",gml:"http://www.opengis.net/gml",sa:"http://www.opengis.net/sampling/1.0",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosAll.xsd",defaultPrefix:"sos",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(n){var i,t,f;"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);i={features:[]};this.readNode(n,i);for(var u=[],r=0,e=i.features.length;e>r;r++)t=i.features[r],this.internalProjection&&this.externalProjection&&t.components[0]&&t.components[0].transform(this.externalProjection,this.internalProjection),f=new OpenLayers.Feature.Vector(t.components[0],t.attributes),u.push(f);return u},readers:{sa:{SamplingPoint:function(n,t){if(!t.attributes){var i={attributes:{}};t.features.push(i);t=i}t.attributes.id=this.getAttributeNS(n,this.namespaces.gml,"id");this.readChildNodes(n,t)},position:function(n,t){this.readChildNodes(n,t)}},gml:OpenLayers.Util.applyDefaults({FeatureCollection:function(n,t){this.readChildNodes(n,t)},featureMember:function(n,t){var i={attributes:{}};t.features.push(i);this.readChildNodes(n,i)},name:function(n,t){t.attributes.name=this.getChildValue(n)},pos:function(n,t){this.externalProjection||(this.externalProjection=new OpenLayers.Projection(n.getAttribute("srsName")));OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[n,t])}},OpenLayers.Format.GML.v3.prototype.readers.gml)},writers:{sos:{GetFeatureOfInterest:function(n){for(var i=this.createElementNSPlus("GetFeatureOfInterest",{attributes:{version:this.VERSION,service:"SOS","xsi:schemaLocation":this.schemaLocation}}),t=0,r=n.fois.length;r>t;t++)this.writeNode("FeatureOfInterestId",{foi:n.fois[t]},i);return i},FeatureOfInterestId:function(n){return this.createElementNSPlus("FeatureOfInterestId",{value:n.foi})}}},CLASS_NAME:"OpenLayers.Format.SOSGetFeatureOfInterest"});OpenLayers.Format.SOSGetObservation=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows",gml:"http://www.opengis.net/gml",sos:"http://www.opengis.net/sos/1.0",ogc:"http://www.opengis.net/ogc",om:"http://www.opengis.net/om/1.0",sa:"http://www.opengis.net/sampling/1.0",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd",defaultPrefix:"sos",read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={measurements:[],observations:[]};return this.readNode(n,t),t},write:function(n){var t=this.writeNode("sos:GetObservation",n);return t.setAttribute("xmlns:om",this.namespaces.om),t.setAttribute("xmlns:ogc",this.namespaces.ogc),this.setAttributeNS(t,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[t])},readers:{om:{ObservationCollection:function(n,t){t.id=this.getAttributeNS(n,this.namespaces.gml,"id");this.readChildNodes(n,t)},member:function(n,t){this.readChildNodes(n,t)},Measurement:function(n,t){var i={};t.measurements.push(i);this.readChildNodes(n,i)},Observation:function(n,t){var i={};t.observations.push(i);this.readChildNodes(n,i)},samplingTime:function(n,t){var i={};t.samplingTime=i;this.readChildNodes(n,i)},observedProperty:function(n,t){t.observedProperty=this.getAttributeNS(n,this.namespaces.xlink,"href");this.readChildNodes(n,t)},procedure:function(n,t){t.procedure=this.getAttributeNS(n,this.namespaces.xlink,"href");this.readChildNodes(n,t)},featureOfInterest:function(n,t){var i={features:[]},u;t.fois=[];t.fois.push(i);this.readChildNodes(n,i);for(var f=[],r=0,e=i.features.length;e>r;r++)u=i.features[r],f.push(new OpenLayers.Feature.Vector(u.components[0],u.attributes));i.features=f},result:function(n,t){var i={};t.result=i;""!==this.getChildValue(n)?(i.value=this.getChildValue(n),i.uom=n.getAttribute("uom")):this.readChildNodes(n,i)}},sa:OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.sa,gml:OpenLayers.Util.applyDefaults({TimeInstant:function(n,t){var i={};t.timeInstant=i;this.readChildNodes(n,i)},timePosition:function(n,t){t.timePosition=this.getChildValue(n)}},OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.gml)},writers:{sos:{GetObservation:function(n){var t=this.createElementNSPlus("GetObservation",{attributes:{version:this.VERSION,service:"SOS"}}),i,r;this.writeNode("offering",n,t);n.eventTime&&this.writeNode("eventTime",n,t);for(i in n.procedures)this.writeNode("procedure",n.procedures[i],t);for(r in n.observedProperties)this.writeNode("observedProperty",n.observedProperties[r],t);return n.foi&&this.writeNode("featureOfInterest",n.foi,t),this.writeNode("responseFormat",n,t),n.resultModel&&this.writeNode("resultModel",n,t),n.responseMode&&this.writeNode("responseMode",n,t),t},featureOfInterest:function(n){var t=this.createElementNSPlus("featureOfInterest");return this.writeNode("ObjectID",n.objectId,t),t},ObjectID:function(n){return this.createElementNSPlus("ObjectID",{value:n})},responseFormat:function(n){return this.createElementNSPlus("responseFormat",{value:n.responseFormat})},procedure:function(n){return this.createElementNSPlus("procedure",{value:n})},offering:function(n){return this.createElementNSPlus("offering",{value:n.offering})},observedProperty:function(n){return this.createElementNSPlus("observedProperty",{value:n})},eventTime:function(n){var t=this.createElementNSPlus("eventTime");return"latest"===n.eventTime&&this.writeNode("ogc:TM_Equals",n,t),t},resultModel:function(n){return this.createElementNSPlus("resultModel",{value:n.resultModel})},responseMode:function(n){return this.createElementNSPlus("responseMode",{value:n.responseMode})}},ogc:{TM_Equals:function(n){var t=this.createElementNSPlus("ogc:TM_Equals");return this.writeNode("ogc:PropertyName",{property:"urn:ogc:data:time:iso8601"},t),"latest"===n.eventTime&&this.writeNode("gml:TimeInstant",{value:"latest"},t),t},PropertyName:function(n){return this.createElementNSPlus("ogc:PropertyName",{value:n.property})}},gml:{TimeInstant:function(n){var t=this.createElementNSPlus("gml:TimeInstant");return this.writeNode("gml:timePosition",n,t),t},timePosition:function(n){return this.createElementNSPlus("gml:timePosition",{value:n.value})}}},CLASS_NAME:"OpenLayers.Format.SOSGetObservation"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,emptyString:null,lastXy:null,displayProjection:null,destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.map.events.register("mousemove",this,this.redraw),this.map.events.register("mouseout",this,this.reset),this.redraw(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.map.events.unregister("mousemove",this,this.redraw),this.map.events.unregister("mouseout",this,this.reset),this.element.innerHTML="",!0):!1},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.div.left="",this.div.top="",this.element=this.div),this.div},redraw:function(n){var t,i;if(null==n)return this.reset(),void 0;if(null==this.lastXy||Math.abs(n.xy.x-this.lastXy.x)>this.granularity||Math.abs(n.xy.y-this.lastXy.y)>this.granularity)return this.lastXy=n.xy,void 0;(t=this.map.getLonLatFromPixel(n.xy))&&(this.displayProjection&&t.transform(this.map.getProjectionObject(),this.displayProjection),this.lastXy=n.xy,i=this.formatOutput(t),i!=this.element.innerHTML&&(this.element.innerHTML=i))},reset:function(){null!=this.emptyString&&(this.element.innerHTML=this.emptyString)},formatOutput:function(n){var t=parseInt(this.numDigits);return this.prefix+n.lon.toFixed(t)+this.separator+n.lat.toFixed(t)+this.suffix},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.Geolocate=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["locationupdated","locationfailed","locationuncapable"],geolocation:navigator.geolocation,bind:!0,watch:!1,geolocationOptions:null,initialize:function(n){this.EVENT_TYPES=OpenLayers.Control.Geolocate.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);this.geolocationOptions={};OpenLayers.Control.prototype.initialize.apply(this,[n])},destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return this.geolocation?OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.watch?this.watchId=this.geolocation.watchPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions):this.getCurrentLocation(),!0):!1:(this.events.triggerEvent("locationuncapable"),!1)},deactivate:function(){return this.active&&null!==this.watchId&&this.geolocation.clearWatch(this.watchId),OpenLayers.Control.prototype.deactivate.apply(this,arguments)},geolocate:function(n){var t=new OpenLayers.LonLat(n.coords.longitude,n.coords.latitude).transform(new OpenLayers.Projection("EPSG:4326"),this.map.getProjectionObject());this.bind&&this.map.setCenter(t);this.events.triggerEvent("locationupdated",{position:n,point:new OpenLayers.Geometry.Point(t.lon,t.lat)})},getCurrentLocation:function(){return!this.active||this.watch?!1:(this.geolocation.getCurrentPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions),!0)},failure:function(n){this.events.triggerEvent("locationfailed",{error:n})},CLASS_NAME:"OpenLayers.Control.Geolocate"});OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,autoActivate:!0,clearOnDeactivate:!1,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:!1,initialize:function(n){var t,i;OpenLayers.Control.prototype.initialize.apply(this,[n]);this.registry=OpenLayers.Util.extend({moveend:this.getState},this.registry);t={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(t,this.previousOptions);this.previous=new OpenLayers.Control.Button(t);i={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(i,this.nextOptions);this.next=new OpenLayers.Control.Button(i);this.clear()},onPreviousChange:function(n){n&&!this.previous.active?this.previous.activate():!n&&this.previous.active&&this.previous.deactivate()},onNextChange:function(n){n&&!this.next.active?this.next.activate():!n&&this.next.active&&this.next.deactivate()},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var n in this)this[n]=null},setMap:function(n){this.map=n;this.next.setMap(n);this.previous.setMap(n)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw()},previousTrigger:function(){var t=this.previousStack.shift(),n=this.previousStack.shift();return void 0!=n?(this.nextStack.unshift(t),this.previousStack.unshift(n),this.restoring=!0,this.restore(n),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)):this.previousStack.unshift(t),n},nextTrigger:function(){var n=this.nextStack.shift();return void 0!=n&&(this.previousStack.unshift(n),this.restoring=!0,this.restore(n),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)),n},clear:function(){this.previousStack=[];this.previous.deactivate();this.nextStack=[];this.next.deactivate()},getState:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution(),projection:this.map.getProjectionObject(),units:this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units}},restore:function(n){var t,i;if(this.map.getProjectionObject()==n.projection)i=this.map.getZoomForResolution(n.resolution),t=n.center;else{t=n.center.clone();t.transform(n.projection,this.map.getProjectionObject());var r=n.units,u=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,f=r&&u?OpenLayers.INCHES_PER_UNIT[r]/OpenLayers.INCHES_PER_UNIT[u]:1;i=this.map.getZoomForResolution(f*n.resolution)}this.map.setCenter(t,i)},setListeners:function(){this.listeners={};for(var n in this.registry)this.listeners[n]=OpenLayers.Function.bind(function(){if(!this.restoring){var t=this.registry[n].apply(this,arguments);this.previousStack.unshift(t);this.previousStack.length>1&&this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);this.previousStack.length>this.limit+1&&this.previousStack.pop();this.nextStack.length>0&&(this.nextStack=[],this.onNextChange(null,0))}return!0},this)},activate:function(){var t=!1,n;if(this.map&&OpenLayers.Control.prototype.activate.apply(this)){null==this.listeners&&this.setListeners();for(n in this.listeners)this.map.events.register(n,this,this.listeners[n]);t=!0;0==this.previousStack.length&&this.initStack()}return t},initStack:function(){this.map.getCenter()&&this.listeners.moveend()},deactivate:function(){var t=!1,n;if(this.map&&OpenLayers.Control.prototype.deactivate.apply(this)){for(n in this.listeners)this.map.events.unregister(n,this,this.listeners[n]);this.clearOnDeactivate&&this.clear();t=!0}return t},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,wildcarded:!1,srsInBBOX:!1,initialize:function(n){if(n=n||{},this.params={},this.headers={},OpenLayers.Protocol.prototype.initialize.apply(this,arguments),!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var t=new OpenLayers.Format.QueryStringFilter({wildcarded:this.wildcarded,srsInBBOX:this.srsInBBOX});this.filterToParams=function(n,i){return t.write(n,i)}}},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(n){OpenLayers.Protocol.prototype.read.apply(this,arguments);n=n||{};n.params=OpenLayers.Util.applyDefaults(n.params,this.options.params);n=OpenLayers.Util.applyDefaults(n,this.options);n.filter&&this.filterToParams&&(n.params=this.filterToParams(n.filter,n.params));var i=void 0!==n.readWithPOST?n.readWithPOST:this.readWithPOST,t=new OpenLayers.Protocol.Response({requestType:"read"});return t.priv=i?OpenLayers.Request.POST({url:n.url,callback:this.createCallback(this.handleRead,t,n),data:OpenLayers.Util.getParameterString(n.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}}):OpenLayers.Request.GET({url:n.url,callback:this.createCallback(this.handleRead,t,n),params:n.params,headers:n.headers}),t},handleRead:function(n,t){this.handleResponse(n,t)},create:function(n,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({reqFeatures:n,requestType:"create"});return i.priv=OpenLayers.Request.POST({url:t.url,callback:this.createCallback(this.handleCreate,i,t),headers:t.headers,data:this.format.write(n)}),i},handleCreate:function(n,t){this.handleResponse(n,t)},update:function(n,t){var r,i;return t=t||{},r=t.url||n.url||this.options.url+"/"+n.fid,t=OpenLayers.Util.applyDefaults(t,this.options),i=new OpenLayers.Protocol.Response({reqFeatures:n,requestType:"update"}),i.priv=OpenLayers.Request.PUT({url:r,callback:this.createCallback(this.handleUpdate,i,t),headers:t.headers,data:this.format.write(n)}),i},handleUpdate:function(n,t){this.handleResponse(n,t)},"delete":function(n,t){var r,i;return t=t||{},r=t.url||n.url||this.options.url+"/"+n.fid,t=OpenLayers.Util.applyDefaults(t,this.options),i=new OpenLayers.Protocol.Response({reqFeatures:n,requestType:"delete"}),i.priv=OpenLayers.Request.DELETE({url:r,callback:this.createCallback(this.handleDelete,i,t),headers:t.headers}),i},handleDelete:function(n,t){this.handleResponse(n,t)},handleResponse:function(n,t){var i=n.priv;t.callback&&(i.status>=200&&300>i.status?("delete"!=n.requestType&&(n.features=this.parseFeatures(i)),n.code=OpenLayers.Protocol.Response.SUCCESS):n.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,n))},parseFeatures:function(n){var t=n.responseXML;return t&&t.documentElement||(t=n.responseText),!t||0>=t.length?null:this.format.read(t)},commit:function(n,t){function v(n){for(var i=n.features?n.features.length:0,r=Array(i),t=0;i>t;++t)r[t]=n.features[t].fid;c.insertIds=r;o.apply(this,[n])}function o(n){this.callUserCallback(n,t);h=h&&n.success();l++;l>=p&&t.callback&&(c.code=h?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE,t.callback.apply(t.scope,[c]))}var i;t=OpenLayers.Util.applyDefaults(t,this.options);var f=[],l=0,r={};r[OpenLayers.State.INSERT]=[];r[OpenLayers.State.UPDATE]=[];r[OpenLayers.State.DELETE]=[];for(var e,s,a=[],i=0,y=n.length;y>i;++i)e=n[i],s=r[e.state],s&&(s.push(e),a.push(e));var p=(r[OpenLayers.State.INSERT].length>0?1:0)+r[OpenLayers.State.UPDATE].length+r[OpenLayers.State.DELETE].length,h=!0,c=new OpenLayers.Protocol.Response({reqFeatures:a}),u=r[OpenLayers.State.INSERT];for(u.length>0&&f.push(this.create(u,OpenLayers.Util.applyDefaults({callback:v,scope:this},t.create))),u=r[OpenLayers.State.UPDATE],i=u.length-1;i>=0;--i)f.push(this.update(u[i],OpenLayers.Util.applyDefaults({callback:o,scope:this},t.update)));for(u=r[OpenLayers.State.DELETE],i=u.length-1;i>=0;--i)f.push(this["delete"](u[i],OpenLayers.Util.applyDefaults({callback:o,scope:this},t["delete"])));return f},abort:function(n){n&&n.priv.abort()},callUserCallback:function(n,t){var i=t[n.requestType];i&&i.callback&&i.callback.call(i.scope,n)},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Format.CSWGetDomain=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Format.CSWGetDomain.DEFAULTS);var t=OpenLayers.Format.CSWGetDomain["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSWGetDomain version: "+n.version;return new t(n)};OpenLayers.Format.CSWGetDomain.DEFAULTS={version:"2.0.2"};OpenLayers.Format.CSWGetDomain.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",csw:"http://www.opengis.net/cat/csw/2.0.2"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",PropertyName:null,ParameterName:null,initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{csw:{GetDomainResponse:function(n,t){this.readChildNodes(n,t)},DomainValues:function(n,t){OpenLayers.Util.isArray(t.DomainValues)||(t.DomainValues=[]);for(var r=n.attributes,u={},i=0,f=r.length;f>i;++i)u[r[i].name]=r[i].nodeValue;this.readChildNodes(n,u);t.DomainValues.push(u)},PropertyName:function(n,t){t.PropertyName=this.getChildValue(n)},ParameterName:function(n,t){t.ParameterName=this.getChildValue(n)},ListOfValues:function(n,t){OpenLayers.Util.isArray(t.ListOfValues)||(t.ListOfValues=[]);this.readChildNodes(n,t.ListOfValues)},Value:function(n,t){for(var r=n.attributes,u={},i=0,f=r.length;f>i;++i)u[r[i].name]=r[i].nodeValue;u.value=this.getChildValue(n);t.push({Value:u})},ConceptualScheme:function(n,t){t.ConceptualScheme={};this.readChildNodes(n,t.ConceptualScheme)},Name:function(n,t){t.Name=this.getChildValue(n)},Document:function(n,t){t.Document=this.getChildValue(n)},Authority:function(n,t){t.Authority=this.getChildValue(n)},RangeOfValues:function(n,t){t.RangeOfValues={};this.readChildNodes(n,t.RangeOfValues)},MinValue:function(n,t){for(var r=n.attributes,u={},i=0,f=r.length;f>i;++i)u[r[i].name]=r[i].nodeValue;u.value=this.getChildValue(n);t.MinValue=u},MaxValue:function(n,t){for(var r=n.attributes,u={},i=0,f=r.length;f>i;++i)u[r[i].name]=r[i].nodeValue;u.value=this.getChildValue(n);t.MaxValue=u}}},write:function(n){var t=this.writeNode("csw:GetDomain",n);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{csw:{GetDomain:function(n){var t=this.createElementNSPlus("csw:GetDomain",{attributes:{service:"CSW",version:this.version}});return n.PropertyName||this.PropertyName?this.writeNode("csw:PropertyName",n.PropertyName||this.PropertyName,t):(n.ParameterName||this.ParameterName)&&this.writeNode("csw:ParameterName",n.ParameterName||this.ParameterName,t),this.readChildNodes(t,n),t},PropertyName:function(n){return this.createElementNSPlus("csw:PropertyName",{value:n})},ParameterName:function(n){return this.createElementNSPlus("csw:ParameterName",{value:n})}}},CLASS_NAME:"OpenLayers.Format.CSWGetDomain.v2_0_2"});OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:!1,resolution:null,activate:function(){var n=OpenLayers.Strategy.prototype.activate.call(this);return n&&this.layer.events.on({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this}),n},deactivate:function(){var n=OpenLayers.Strategy.prototype.deactivate.call(this);return n&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})),n},cacheFeatures:function(n){var t=!0;return this.clustering||(this.clearCache(),this.features=n.features,this.cluster(),t=!1),t},clearCache:function(){this.features=null},cluster:function(n){var e,r,o,s,t,u,h,f,i,c;if((!n||n.zoomChanged)&&this.features&&(e=this.layer.map.getResolution(),e!=this.resolution||!this.clustersExist())){for(this.resolution=e,t=[],i=0;this.features.length>i;++i)if(r=this.features[i],r.geometry){for(o=!1,u=t.length-1;u>=0;--u)if(s=t[u],this.shouldCluster(s,r)){this.addToCluster(s,r);o=!0;break}o||t.push(this.createCluster(this.features[i]))}if(this.layer.removeAllFeatures(),t.length>0){if(this.threshold>1)for(h=t.slice(),t=[],i=0,c=h.length;c>i;++i)f=h[i],f.attributes.count<this.threshold?Array.prototype.push.apply(t,f.cluster):t.push(f);this.clustering=!0;this.layer.addFeatures(t);this.clustering=!1}this.clusters=t}},clustersExist:function(){var t=!1,n;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length)for(t=!0,n=0;this.clusters.length>n;++n)if(this.clusters[n]!=this.layer.features[n]){t=!1;break}return t},shouldCluster:function(n,t){var i=n.geometry.getBounds().getCenterLonLat(),r=t.geometry.getBounds().getCenterLonLat(),u=Math.sqrt(Math.pow(i.lon-r.lon,2)+Math.pow(i.lat-r.lat,2))/this.resolution;return this.distance>=u},addToCluster:function(n,t){n.cluster.push(t);n.attributes.count+=1},createCluster:function(n){var t=n.geometry.getBounds().getCenterLonLat(),i=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat),{count:1});return i.cluster=[n],i},CLASS_NAME:"OpenLayers.Strategy.Cluster"});OpenLayers.Strategy.Filter=OpenLayers.Class(OpenLayers.Strategy,{filter:null,cache:null,caching:!1,activate:function(){var n=OpenLayers.Strategy.prototype.activate.apply(this,arguments);return n&&(this.cache=[],this.layer.events.on({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this})),n},deactivate:function(){return this.cache=null,this.layer&&this.layer.events&&this.layer.events.un({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this}),OpenLayers.Strategy.prototype.deactivate.apply(this,arguments)},handleAdd:function(n){var r,t,i,u;if(!this.caching&&this.filter)for(r=n.features,n.features=[],i=0,u=r.length;u>i;++i)t=r[i],this.filter.evaluate(t)?n.features.push(t):this.cache.push(t)},handleRemove:function(){this.caching||(this.cache=[])},setFilter:function(n){var i,t;this.filter=n;i=this.cache;(this.cache=[],this.handleAdd({features:this.layer.features}),this.cache.length>0&&(this.caching=!0,this.layer.removeFeatures(this.cache.slice()),this.caching=!1),i.length>0)&&(t={features:i},this.handleAdd(t),t.features.length>0&&(this.caching=!0,this.layer.addFeatures(t.features),this.caching=!1))},CLASS_NAME:"OpenLayers.Strategy.Filter"});OpenLayers.Protocol.SOS=function(n){n=OpenLayers.Util.applyDefaults(n,OpenLayers.Protocol.SOS.DEFAULTS);var t=OpenLayers.Protocol.SOS["v"+n.version.replace(/\./g,"_")];if(!t)throw"Unsupported SOS version: "+n.version;return new t(n)};OpenLayers.Protocol.SOS.DEFAULTS={version:"1.0.0"};OpenLayers.Format.GeoRSS=OpenLayers.Class(OpenLayers.Format.XML,{rssns:"http://backend.userland.com/rss2",featureNS:"http://mapserver.gis.umn.edu/mapserver",georssns:"http://www.georss.org/georss",geons:"http://www.w3.org/2003/01/geo/wgs84_pos#",featureTitle:"Untitled",featureDescription:"No Description",gmlParser:null,xy:!1,createGeometryFromItem:function(n){var t=this.getElementsByTagNameNS(n,this.georssns,"point"),o=this.getElementsByTagNameNS(n,this.geons,"lat"),s=this.getElementsByTagNameNS(n,this.geons,"long"),h=this.getElementsByTagNameNS(n,this.georssns,"line"),c=this.getElementsByTagNameNS(n,this.georssns,"polygon"),l=this.getElementsByTagNameNS(n,this.georssns,"where"),a=this.getElementsByTagNameNS(n,this.georssns,"box"),e,u,y,i,r;if(t.length>0||o.length>0&&s.length>0)t.length>0?(e=OpenLayers.String.trim(t[0].firstChild.nodeValue).split(/\s+/),2!=e.length&&(e=OpenLayers.String.trim(t[0].firstChild.nodeValue).split(/\s*,\s*/))):e=[parseFloat(o[0].firstChild.nodeValue),parseFloat(s[0].firstChild.nodeValue)],u=new OpenLayers.Geometry.Point(parseFloat(e[1]),parseFloat(e[0]));else if(h.length>0){for(var t,i=OpenLayers.String.trim(this.concatChildValues(h[0])).split(/\s+/),r=[],f=0,v=i.length;v>f;f+=2)t=new OpenLayers.Geometry.Point(parseFloat(i[f+1]),parseFloat(i[f])),r.push(t);u=new OpenLayers.Geometry.LineString(r)}else if(c.length>0){for(var t,i=OpenLayers.String.trim(this.concatChildValues(c[0])).split(/\s+/),r=[],f=0,v=i.length;v>f;f+=2)t=new OpenLayers.Geometry.Point(parseFloat(i[f+1]),parseFloat(i[f])),r.push(t);u=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(r)])}else l.length>0?(this.gmlParser||(this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})),y=this.gmlParser.parseFeature(l[0]),u=y.geometry):a.length>0&&(i=OpenLayers.String.trim(a[0].firstChild.nodeValue).split(/\s+/),r=[],i.length>3&&(t=new OpenLayers.Geometry.Point(parseFloat(i[1]),parseFloat(i[0])),r.push(t),t=new OpenLayers.Geometry.Point(parseFloat(i[1]),parseFloat(i[2])),r.push(t),t=new OpenLayers.Geometry.Point(parseFloat(i[3]),parseFloat(i[2])),r.push(t),t=new OpenLayers.Geometry.Point(parseFloat(i[3]),parseFloat(i[0])),r.push(t),t=new OpenLayers.Geometry.Point(parseFloat(i[1]),parseFloat(i[0])),r.push(t)),u=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(r)]));return u&&this.internalProjection&&this.externalProjection&&u.transform(this.externalProjection,this.internalProjection),u},createFeatureFromItem:function(n){var r=this.createGeometryFromItem(n),u=this.getChildValue(n,"*","title",this.featureTitle),f=this.getChildValue(n,"*","description",this.getChildValue(n,"*","content",this.getChildValue(n,"*","summary",this.featureDescription))),t=this.getChildValue(n,"*","link");if(!t)try{t=this.getElementsByTagNameNS(n,"*","link")[0].getAttribute("href")}catch(s){t=null}var e=this.getChildValue(n,"*","id",null),o={title:u,description:f,link:t},i=new OpenLayers.Feature.Vector(r,o);return i.fid=e,i},getChildValue:function(n,t,i,r){var u=this.getElementsByTagNameNS(n,t,i);return u&&u[0]&&u[0].firstChild&&u[0].firstChild.nodeValue?OpenLayers.Format.XML.prototype.getChildValue(u[0]):void 0==r?"":r},read:function(n){var t;"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));t=null;t=this.getElementsByTagNameNS(n,"*","item");0==t.length&&(t=this.getElementsByTagNameNS(n,"*","entry"));for(var r=t.length,u=Array(r),i=0;r>i;i++)u[i]=this.createFeatureFromItem(t[i]);return u},write:function(n){var t,i,r;if(OpenLayers.Util.isArray(n))for(t=this.createElementNS(this.rssns,"rss"),i=0,r=n.length;r>i;i++)t.appendChild(this.createFeatureXML(n[i]));else t=this.createFeatureXML(n);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(n){var h=this.buildGeometryNode(n.geometry),i=this.createElementNS(this.rssns,"item"),o=this.createElementNS(this.rssns,"title"),r,u,t,s,f,e;o.appendChild(this.createTextNode(n.attributes.title?n.attributes.title:""));r=this.createElementNS(this.rssns,"description");(r.appendChild(this.createTextNode(n.attributes.description?n.attributes.description:"")),i.appendChild(o),i.appendChild(r),n.attributes.link)&&(u=this.createElementNS(this.rssns,"link"),u.appendChild(this.createTextNode(n.attributes.link)),i.appendChild(u));for(t in n.attributes)"link"!=t&&"title"!=t&&"description"!=t&&(s=this.createTextNode(n.attributes[t]),f=t,-1!=t.search(":")&&(f=t.split(":")[1]),e=this.createElementNS(this.featureNS,"feature:"+f),e.appendChild(s),i.appendChild(e));return i.appendChild(h),i},buildGeometryNode:function(n){this.internalProjection&&this.externalProjection&&(n=n.clone(),n.transform(this.internalProjection,this.externalProjection));var t;if("OpenLayers.Geometry.Polygon"==n.CLASS_NAME)t=this.createElementNS(this.georssns,"georss:polygon"),t.appendChild(this.buildCoordinatesNode(n.components[0]));else if("OpenLayers.Geometry.LineString"==n.CLASS_NAME)t=this.createElementNS(this.georssns,"georss:line"),t.appendChild(this.buildCoordinatesNode(n));else{if("OpenLayers.Geometry.Point"!=n.CLASS_NAME)throw"Couldn't parse "+n.CLASS_NAME;t=this.createElementNS(this.georssns,"georss:point");t.appendChild(this.buildCoordinatesNode(n))}return t},buildCoordinatesNode:function(n){var t=null,r;if(n.components&&(t=n.components),t){for(var u=t.length,f=Array(u),i=0;u>i;i++)f[i]=t[i].y+" "+t[i].x;r=f.join(" ")}else r=n.y+" "+n.x;return this.createTextNode(r)},CLASS_NAME:"OpenLayers.Format.GeoRSS"});OpenLayers.Format.WPSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.WPSCapabilities"});OpenLayers.Format.WPSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows/1.1",wps:"http://www.opengis.net/wps/1.0.0",xlink:"http://www.w3.org/1999/xlink"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t},readers:{wps:{Capabilities:function(n,t){this.readChildNodes(n,t)},ProcessOfferings:function(n,t){t.processOfferings={};this.readChildNodes(n,t.processOfferings)},Process:function(n,t){var r=this.getAttributeNS(n,this.namespaces.wps,"processVersion"),i={processVersion:r};this.readChildNodes(n,i);t[i.identifier]=i},Languages:function(n,t){t.languages=[];this.readChildNodes(n,t.languages)},Default:function(n,t){var i={isDefault:!0};this.readChildNodes(n,i);t.push(i)},Supported:function(n,t){var i={};this.readChildNodes(n,i);t.push(i)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSCapabilities.v1_0_0"});OpenLayers.Control.PinchZoom=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,containerOrigin:null,pinchOrigin:null,currentCenter:null,autoActivate:!0,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Pinch(this,{start:this.pinchStart,move:this.pinchMove,done:this.pinchDone},this.handlerOptions)},activate:function(){var n=OpenLayers.Control.prototype.activate.apply(this,arguments);return n&&(this.map.events.on({moveend:this.updateContainerOrigin,scope:this}),this.updateContainerOrigin()),n},deactivate:function(){var n=OpenLayers.Control.prototype.deactivate.apply(this,arguments);return this.map&&this.map.events&&this.map.events.un({moveend:this.updateContainerOrigin,scope:this}),n},updateContainerOrigin:function(){var n=this.map.layerContainerDiv;this.containerOrigin={x:parseInt(n.style.left,10),y:parseInt(n.style.top,10)}},pinchStart:function(n){this.pinchOrigin=n.xy;this.currentCenter=n.xy},pinchMove:function(n,t){var r=t.scale,f=this.containerOrigin,i=this.pinchOrigin,u=n.xy,e=Math.round(u.x-i.x+(r-1)*(f.x-i.x)),o=Math.round(u.y-i.y+(r-1)*(f.y-i.y));this.applyTransform("translate("+e+"px, "+o+"px) scale("+r+")");this.currentCenter=u},applyTransform:function(n){var t=this.map.layerContainerDiv.style;t["-webkit-transform"]=n;t["-moz-transform"]=n},pinchDone:function(n,t,i){var r;if(this.applyTransform(""),r=this.map.getZoomForResolution(this.map.getResolution()/i.scale,!0),r!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){var f=this.map.getResolutionForZoom(r),u=this.map.getLonLatFromPixel(this.pinchOrigin),e=this.currentCenter,o=this.map.getSize();u.lon+=f*(o.w/2-e.x);u.lat-=f*(o.h/2-e.y);this.map.setCenter(u,r)}},CLASS_NAME:"OpenLayers.Control.PinchZoom"});OpenLayers.Control.TouchNavigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,clickHandlerOptions:null,documentDrag:!1,autoActivate:!0,initialize:function(){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();this.dragPan&&this.dragPan.destroy();this.dragPan=null;this.pinchZoom&&(this.pinchZoom.destroy(),delete this.pinchZoom);OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.dragPan.activate(),this.handlers.click.activate(),this.pinchZoom.activate(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.dragPan.deactivate(),this.handlers.click.deactivate(),this.pinchZoom.deactivate(),!0):!1},draw:function(){var n={click:this.defaultClick,dblclick:this.defaultDblClick},t=OpenLayers.Util.extend({double:!0,stopDouble:!0,pixelTolerance:2},this.clickHandlerOptions);this.handlers.click=new OpenLayers.Handler.Click(this,n,t);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions));this.dragPan.draw();this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions))},defaultClick:function(n){n.lastTouches&&2==n.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(n){var t=this.map.getLonLatFromViewPortPx(n.xy);this.map.setCenter(t,this.map.zoom+1)},CLASS_NAME:"OpenLayers.Control.TouchNavigation"});OpenLayers.Style2=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,initialize:function(n){OpenLayers.Util.extend(this,n);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var n=0,t=this.rules.length;t>n;n++)this.rules[n].destroy();delete this.rules},clone:function(){var t=OpenLayers.Util.extend({},this),n,i;if(this.rules)for(t.rules=[],n=0,i=this.rules.length;i>n;++n)t.rules.push(this.rules[n].clone());return new OpenLayers.Style2(t)},CLASS_NAME:"OpenLayers.Style2"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(n){var t=n.bounds,i=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(t.left,t.top)),r=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(t.right,t.bottom)),u,f;null==r||null==i?n.display(!1):(u=new OpenLayers.Size(Math.max(1,r.x-i.x),Math.max(1,r.y-i.y)),f=n.draw(i,u),n.drawn||(this.div.appendChild(f),n.drawn=!0))},removeMarker:function(n){OpenLayers.Util.removeItem(this.markers,n);null!=n.div&&n.div.parentNode==this.div&&this.div.removeChild(n.div)},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(n){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[n])},read_cap_Service:function(n,t){var i={};this.runChildNodes(i,t);n.service=i},read_cap_Fees:function(n,t){var i=this.getChildValue(t);i&&"none"!=i.toLowerCase()&&(n.fees=i)},read_cap_AccessConstraints:function(n,t){var i=this.getChildValue(t);i&&"none"!=i.toLowerCase()&&(n.accessConstraints=i)},read_cap_OnlineResource:function(n,t){var i=this.getChildValue(t);i&&"none"!=i.toLowerCase()&&(n.onlineResource=i)},read_cap_Keywords:function(n,t){var i=this.getChildValue(t);i&&"none"!=i.toLowerCase()&&(n.keywords=i.split(", "))},read_cap_Capability:function(n,t){var i={};this.runChildNodes(i,t);n.capability=i},read_cap_Request:function(n,t){var i={};this.runChildNodes(i,t);n.request=i},read_cap_GetFeature:function(n,t){var i={href:{},formats:[]};this.runChildNodes(i,t);n.getfeature=i},read_cap_ResultFormat:function(n,t){for(var i,u=t.childNodes,r=0;u.length>r;r++)i=u[r],1==i.nodeType&&n.formats.push(i.nodeName)},read_cap_DCPType:function(n,t){this.runChildNodes(n,t)},read_cap_HTTP:function(n,t){this.runChildNodes(n.href,t)},read_cap_Get:function(n,t){n.get=t.getAttribute("onlineResource")},read_cap_Post:function(n,t){n.post=t.getAttribute("onlineResource")},read_cap_SRS:function(n,t){var i=this.getChildValue(t);i&&(n.srs=i)},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"});OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",profile:null,CLASS_NAME:"OpenLayers.Format.WMSCapabilities"});OpenLayers.Format.WMSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{wms:"http://www.opengis.net/wms",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"wms",initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n])},read:function(n){var i,t,r;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),i=n,n&&9==n.nodeType&&(n=n.documentElement),t={},(this.readNode(n,t),void 0===t.service)?(r=new OpenLayers.Format.OGCExceptionReport,t.error=r.read(i)):this.postProcessLayers(t),t},postProcessLayers:function(n){var r;if(n.capability){n.capability.layers=[];for(var i=n.capability.nestedLayers,t=0,u=i.length;u>t;++t)r=i[t],this.processLayer(n.capability,r)}},processLayer:function(n,t,i){var u,f,r,e,o,s,h,c;if(void 0===t.formats&&(t.formats=n.request.getmap.formats),i){for(t.styles=t.styles.concat(i.styles),e=["queryable","cascaded","fixedWidth","fixedHeight","opaque","noSubsets","llbbox","minScale","maxScale","attribution"],o=["srs","bbox","dimensions","authorityURLs"],u=0,f=e.length;f>u;u++)(r=e[u],r in i&&(null==t[r]&&(t[r]=i[r]),null==t[r]))&&(s=["cascaded","fixedWidth","fixedHeight"],h=["queryable","opaque","noSubsets"],-1!=OpenLayers.Util.indexOf(s,r)&&(t[r]=0),-1!=OpenLayers.Util.indexOf(h,r)&&(t[r]=!1));for(u=0,f=o.length;f>u;u++)r=o[u],t[r]=OpenLayers.Util.applyDefaults(t[r],i[r])}for(u=0,f=t.nestedLayers.length;f>u;u++)c=t.nestedLayers[u],this.processLayer(n,c,t);t.name&&n.layers.push(t)},readers:{wms:{Service:function(n,t){t.service={};this.readChildNodes(n,t.service)},Name:function(n,t){t.name=this.getChildValue(n)},Title:function(n,t){t.title=this.getChildValue(n)},Abstract:function(n,t){t.abstract=this.getChildValue(n)},BoundingBox:function(n){var i={},t;return i.bbox=[parseFloat(n.getAttribute("minx")),parseFloat(n.getAttribute("miny")),parseFloat(n.getAttribute("maxx")),parseFloat(n.getAttribute("maxy"))],t={x:parseFloat(n.getAttribute("resx")),y:parseFloat(n.getAttribute("resy"))},isNaN(t.x)&&isNaN(t.y)||(i.res=t),i},OnlineResource:function(n,t){t.href=this.getAttributeNS(n,this.namespaces.xlink,"href")},ContactInformation:function(n,t){t.contactInformation={};this.readChildNodes(n,t.contactInformation)},ContactPersonPrimary:function(n,t){t.personPrimary={};this.readChildNodes(n,t.personPrimary)},ContactPerson:function(n,t){t.person=this.getChildValue(n)},ContactOrganization:function(n,t){t.organization=this.getChildValue(n)},ContactPosition:function(n,t){t.position=this.getChildValue(n)},ContactAddress:function(n,t){t.contactAddress={};this.readChildNodes(n,t.contactAddress)},AddressType:function(n,t){t.type=this.getChildValue(n)},Address:function(n,t){t.address=this.getChildValue(n)},City:function(n,t){t.city=this.getChildValue(n)},StateOrProvince:function(n,t){t.stateOrProvince=this.getChildValue(n)},PostCode:function(n,t){t.postcode=this.getChildValue(n)},Country:function(n,t){t.country=this.getChildValue(n)},ContactVoiceTelephone:function(n,t){t.phone=this.getChildValue(n)},ContactFacsimileTelephone:function(n,t){t.fax=this.getChildValue(n)},ContactElectronicMailAddress:function(n,t){t.email=this.getChildValue(n)},Fees:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.fees=i)},AccessConstraints:function(n,t){var i=this.getChildValue(n);i&&"none"!=i.toLowerCase()&&(t.accessConstraints=i)},Capability:function(n,t){t.capability={nestedLayers:[]};this.readChildNodes(n,t.capability)},Request:function(n,t){t.request={};this.readChildNodes(n,t.request)},GetCapabilities:function(n,t){t.getcapabilities={formats:[]};this.readChildNodes(n,t.getcapabilities)},Format:function(n,t){OpenLayers.Util.isArray(t.formats)?t.formats.push(this.getChildValue(n)):t.format=this.getChildValue(n)},DCPType:function(n,t){this.readChildNodes(n,t)},HTTP:function(n,t){this.readChildNodes(n,t)},Get:function(n,t){t.get={};this.readChildNodes(n,t.get);t.href||(t.href=t.get.href)},Post:function(n,t){t.post={};this.readChildNodes(n,t.post);t.href||(t.href=t.get.href)},GetMap:function(n,t){t.getmap={formats:[]};this.readChildNodes(n,t.getmap)},GetFeatureInfo:function(n,t){t.getfeatureinfo={formats:[]};this.readChildNodes(n,t.getfeatureinfo)},Exception:function(n,t){t.exception={formats:[]};this.readChildNodes(n,t.exception)},Layer:function(n,t){var i=n.getAttributeNode("queryable"),u=i&&i.specified?n.getAttribute("queryable"):null,f,s;i=n.getAttributeNode("cascaded");f=i&&i.specified?n.getAttribute("cascaded"):null;i=n.getAttributeNode("opaque");var e=i&&i.specified?n.getAttribute("opaque"):null,o=n.getAttribute("noSubsets"),h=n.getAttribute("fixedWidth"),c=n.getAttribute("fixedHeight"),r={nestedLayers:[],styles:[],srs:{},metadataURLs:[],bbox:{},dimensions:{},authorityURLs:{},identifiers:{},keywords:[],queryable:u&&""!==u?"1"===u||"true"===u:null,cascaded:null!==f?parseInt(f):null,opaque:e?"1"===e||"true"===e:null,noSubsets:null!==o?"1"===o||"true"===o:null,fixedWidth:null!=h?parseInt(h):null,fixedHeight:null!=c?parseInt(c):null};(t.nestedLayers.push(r),this.readChildNodes(n,r),r.name)&&(s=r.name.split(":"),s.length>0&&(r.prefix=s[0]))},Attribution:function(n,t){t.attribution={};this.readChildNodes(n,t.attribution)},LogoURL:function(n,t){t.logo={width:n.getAttribute("width"),height:n.getAttribute("height")};this.readChildNodes(n,t.logo)},Style:function(n,t){var i={};t.styles.push(i);this.readChildNodes(n,i)},LegendURL:function(n,t){var i={width:n.getAttribute("width"),height:n.getAttribute("height")};t.legend=i;this.readChildNodes(n,i)},MetadataURL:function(n,t){var i={type:n.getAttribute("type")};t.metadataURLs.push(i);this.readChildNodes(n,i)},DataURL:function(n,t){t.dataURL={};this.readChildNodes(n,t.dataURL)},FeatureListURL:function(n,t){t.featureListURL={};this.readChildNodes(n,t.featureListURL)},AuthorityURL:function(n,t){var r=n.getAttribute("name"),i={};this.readChildNodes(n,i);t.authorityURLs[r]=i.href},Identifier:function(n,t){var i=n.getAttribute("authority");t.identifiers[i]=this.getChildValue(n)},KeywordList:function(n,t){this.readChildNodes(n,t)},SRS:function(n,t){t.srs[this.getChildValue(n)]=!0}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1"});OpenLayers.Format.WMSCapabilities.v1_3=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMS_Capabilities:function(n,t){this.readChildNodes(n,t)},LayerLimit:function(n,t){t.layerLimit=parseInt(this.getChildValue(n))},MaxWidth:function(n,t){t.maxWidth=parseInt(this.getChildValue(n))},MaxHeight:function(n,t){t.maxHeight=parseInt(this.getChildValue(n))},BoundingBox:function(n,t){var i=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[n,t]);i.srs=n.getAttribute("CRS");t.bbox[i.srs]=i},CRS:function(n,t){this.readers.wms.SRS.apply(this,[n,t])},EX_GeographicBoundingBox:function(n,t){t.llbbox=[];this.readChildNodes(n,t.llbbox)},westBoundLongitude:function(n,t){t[0]=this.getChildValue(n)},eastBoundLongitude:function(n,t){t[2]=this.getChildValue(n)},southBoundLatitude:function(n,t){t[1]=this.getChildValue(n)},northBoundLatitude:function(n,t){t[3]=this.getChildValue(n)},MinScaleDenominator:function(n,t){t.maxScale=parseFloat(this.getChildValue(n)).toPrecision(16)},MaxScaleDenominator:function(n,t){t.minScale=parseFloat(this.getChildValue(n)).toPrecision(16)},Dimension:function(n,t){var r=n.getAttribute("name").toLowerCase(),i={name:r,units:n.getAttribute("units"),unitsymbol:n.getAttribute("unitSymbol"),nearestVal:"1"===n.getAttribute("nearestValue"),multipleVal:"1"===n.getAttribute("multipleValues"),"default":n.getAttribute("default")||"",current:"1"===n.getAttribute("current"),values:this.getChildValue(n).split(",")};t.dimensions[i.name]=i},Keyword:function(n,t){var i={value:this.getChildValue(n),vocabulary:n.getAttribute("vocabulary")};t.keywords&&t.keywords.push(i)}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms),sld:{UserDefinedSymbolization:function(n,t){this.readers.wms.UserDefinedSymbolization.apply(this,[n,t]);t.userSymbols.inlineFeature=1==parseInt(n.getAttribute("InlineFeature"));t.userSymbols.remoteWCS=1==parseInt(n.getAttribute("RemoteWCS"))},DescribeLayer:function(n,t){this.readers.wms.DescribeLayer.apply(this,[n,t])},GetLegendGraphic:function(n,t){this.readers.wms.GetLegendGraphic.apply(this,[n,t])}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3"});OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,21457672119140622e-21,10728836059570311e-21],type:null,wrapDateLine:!0,sphericalMercator:!1,initialize:function(){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},loadMapObject:function(){try{var n=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new YMap(this.div,this.type,n);this.mapObject.disableKeyControls();this.mapObject.disableDragMap();this.mapObject.moveByXY&&"function"==typeof this.mapObject.moveByXY||(this.dragPanMapObject=null)}catch(t){}},onMapResize:function(){try{var n=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(n)}catch(t){}},setMap:function(){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.fixYahooEventPane)},fixYahooEventPane:function(){var n=OpenLayers.Util.getElement("ygddfdiv");null!=n&&(null!=n.parentNode&&n.parentNode.removeChild(n),this.map.events.unregister("moveend",this,this.fixYahooEventPane))},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"Yahoo",layerLib:"Yahoo"})},getOLZoomFromMapObjectZoom:function(n){var t=null;return null!=n&&(t=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[n]),t=18-t),t},getMapObjectZoomFromOLZoom:function(n){var t=null;return null!=n&&(t=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[n]),t=18-t),t},setMapObjectCenter:function(n,t){this.mapObject.drawZoomAndCenter(n,t)},getMapObjectCenter:function(){return this.mapObject.getCenterLatLon()},dragPanMapObject:function(n,t){this.mapObject.moveByXY({x:-n,y:t})},getMapObjectZoom:function(){return this.mapObject.getZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(n){return this.mapObject.convertXYLatLon(n)},getMapObjectPixelFromMapObjectLonLat:function(n){return this.mapObject.convertLatLonXY(n)},getLongitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.Lon,n.Lat).lon:n.Lon},getLatitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.Lon,n.Lat).lat:n.Lat},getMapObjectLonLatFromLonLat:function(n,t){var i,r;return this.sphericalMercator?(r=this.inverseMercator(n,t),i=new YGeoPoint(r.lat,r.lon)):i=new YGeoPoint(t,n),i},getXFromMapObjectPixel:function(n){return n.x},getYFromMapObjectPixel:function(n){return n.y},getMapObjectPixelFromXY:function(n,t){return new YCoordPoint(n,t)},getMapObjectSizeFromOLSize:function(n){return new YSize(n.w,n.h)},CLASS_NAME:"OpenLayers.Layer.Yahoo"});OpenLayers.Layer.Zoomify=OpenLayers.Class(OpenLayers.Layer.Grid,{url:null,size:null,isBaseLayer:!0,standardTileSize:256,tileOriginCorner:"tl",numberOfTiers:0,tileCountUpToTier:[],tierSizeInTiles:[],tierImageSize:[],initialize:function(n,t,i,r){this.initializeZoomify(i);var u=[];u.push(n,t,i,{},r);OpenLayers.Layer.Grid.prototype.initialize.apply(this,u)},initializeZoomify:function(n){var t=n.clone(),r=new OpenLayers.Size(Math.ceil(t.w/this.standardTileSize),Math.ceil(t.h/this.standardTileSize)),i;for(this.tierSizeInTiles.push(r),this.tierImageSize.push(t);t.w>this.standardTileSize||t.h>this.standardTileSize;)t=new OpenLayers.Size(Math.floor(t.w/2),Math.floor(t.h/2)),r=new OpenLayers.Size(Math.ceil(t.w/this.standardTileSize),Math.ceil(t.h/this.standardTileSize)),this.tierSizeInTiles.push(r),this.tierImageSize.push(t);for(this.tierSizeInTiles.reverse(),this.tierImageSize.reverse(),this.numberOfTiers=this.tierSizeInTiles.length,this.tileCountUpToTier[0]=0,i=1;this.numberOfTiers>i;i++)this.tileCountUpToTier.push(this.tierSizeInTiles[i-1].w*this.tierSizeInTiles[i-1].h+this.tileCountUpToTier[i-1])},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);this.tileCountUpToTier.length=0;this.tierSizeInTiles.length=0;this.tierImageSize.length=0},clone:function(n){return null==n&&(n=new OpenLayers.Layer.Zoomify(this.name,this.url,this.size,this.options)),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getURL:function(n){n=this.adjustBounds(n);var r=this.map.getResolution(),u=Math.round((n.left-this.tileOrigin.lon)/(r*this.tileSize.w)),f=Math.round((this.tileOrigin.lat-n.top)/(r*this.tileSize.h)),i=this.map.getZoom(),o=u+f*this.tierSizeInTiles[i].w+this.tileCountUpToTier[i],e="TileGroup"+Math.floor(o/256)+"/"+i+"-"+u+"-"+f+".jpg",t=this.url;return OpenLayers.Util.isArray(t)&&(t=this.selectUrl(e,t)),t+e},getImageSize:function(){var r,u;if(arguments.length>0){var t=this.adjustBounds(arguments[0]),i=this.map.getResolution(),f=Math.round((t.left-this.tileOrigin.lon)/(i*this.tileSize.w)),e=Math.round((this.tileOrigin.lat-t.top)/(i*this.tileSize.h)),n=this.map.getZoom(),r=this.standardTileSize,u=this.standardTileSize;return f==this.tierSizeInTiles[n].w-1&&(r=this.tierImageSize[n].w%this.standardTileSize),e==this.tierSizeInTiles[n].h-1&&(u=this.tierImageSize[n].h%this.standardTileSize),new OpenLayers.Size(r,u)}return this.tileSize},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.top)},calculateGridLayout:function(n,t,i){var u=i*this.tileSize.w,r=i*this.tileSize.h,f=n.left-t.lon,e=Math.floor(f/u)-this.buffer,h=f/u-e,c=-h*this.tileSize.w,l=t.lon+e*u,o=t.lat-n.top+r,s=Math.floor(o/r)-this.buffer,a=s-o/r,v=a*this.tileSize.h,y=t.lat-r*s;return{tilelon:u,tilelat:r,tileoffsetlon:l,tileoffsetlat:y,tileoffsetx:c,tileoffsety:v}},CLASS_NAME:"OpenLayers.Layer.Zoomify"});OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(){if(this.supported()){if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);for(var i=document.createStyleSheet(),t=["shape","rect","oval","fill","stroke","imagedata","group","textbox"],n=0,r=t.length;r>n;n++)i.addRule("olv\\:"+t[n],"behavior: url(#default#VML); position: absolute; display: inline-block;")}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments)}},supported:function(){return!!document.namespaces},setExtent:function(n,t){var e,h;OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var f=this.getResolution(),i=0|n.left/f,r=0|n.top/f-this.size.h;t||!this.offset?(this.offset={x:i,y:r},i=0,r=0):(i-=this.offset.x,r-=this.offset.y);e=i+" "+r;this.root.coordorigin=e;for(var o,s=[this.root,this.vectorRoot,this.textRoot],u=0,c=s.length;c>u;++u)o=s[u],h=this.size.w+" "+this.size.h,o.coordsize=h;return this.root.style.flip="y",!0},setSize:function(){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);for(var n,i=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],r=this.size.w+"px",u=this.size.h+"px",t=0,f=i.length;f>t;++t)n=i[t],n.style.width=r,n.style.height=u},getNodeType:function(n,t){var i=null;switch(n.CLASS_NAME){case"OpenLayers.Geometry.Point":i=t.externalGraphic?"olv:rect":this.isComplexSymbol(t.graphicName)?"olv:shape":"olv:oval";break;case"OpenLayers.Geometry.Rectangle":i="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":i="olv:shape"}return i},setStyle:function(n,t,i,r){var c,o,e,s,l,a,u,h,v,f;if(t=t||n._style,i=i||n._options,c=t.fillColor,"OpenLayers.Geometry.Point"===n._geometryClass)if(t.externalGraphic){i.isFilled=!0;t.graphicTitle&&(n.title=t.graphicTitle);o=t.graphicWidth||t.graphicHeight;e=t.graphicHeight||t.graphicWidth;o=o?o:2*t.pointRadius;e=e?e:2*t.pointRadius;var y=this.getResolution(),p=void 0!=t.graphicXOffset?t.graphicXOffset:-(.5*o),w=void 0!=t.graphicYOffset?t.graphicYOffset:-(.5*e);n.style.left=(0|r.x/y-this.offset.x+p)+"px";n.style.top=(0|r.y/y-this.offset.y-(w+e))+"px";n.style.width=o+"px";n.style.height=e+"px";n.style.flip="y";c="none";i.isStroked=!1}else this.isComplexSymbol(t.graphicName)?(s=this.importSymbol(t.graphicName),n.path=s.path,n.coordorigin=s.left+","+s.bottom,l=s.size,n.coordsize=l+","+l,this.drawCircle(n,r,t.pointRadius),n.style.flip="y"):this.drawCircle(n,r,t.pointRadius);return i.isFilled?n.fillcolor=c:n.filled="false",a=n.getElementsByTagName("fill"),u=0==a.length?null:a[0],i.isFilled?(u||(u=this.createNode("olv:fill",n.id+"_fill")),u.opacity=t.fillOpacity,"OpenLayers.Geometry.Point"===n._geometryClass&&t.externalGraphic&&(t.graphicOpacity&&(u.opacity=t.graphicOpacity),u.src=t.externalGraphic,u.type="frame",t.graphicWidth&&t.graphicHeight||(u.aspect="atmost")),u.parentNode!=n&&n.appendChild(u)):u&&n.removeChild(u),h=t.rotation,(void 0!==h||void 0!==n._rotation)&&(n._rotation=h,t.externalGraphic?(this.graphicRotate(n,p,w,t),u.opacity=0):"OpenLayers.Geometry.Point"===n._geometryClass&&(n.style.rotation=h||0)),v=n.getElementsByTagName("stroke"),f=0==v.length?null:v[0],i.isStroked?(f||(f=this.createNode("olv:stroke",n.id+"_stroke"),n.appendChild(f)),f.on=!0,f.color=t.strokeColor,f.weight=t.strokeWidth+"px",f.opacity=t.strokeOpacity,f.endcap="butt"==t.strokeLinecap?"flat":t.strokeLinecap||"round",t.strokeDashstyle&&(f.dashstyle=this.dashStyle(t))):(n.stroked=!1,f&&(f.on=!1)),"inherit"!=t.cursor&&null!=t.cursor&&(n.style.cursor=t.cursor),n},graphicRotate:function(n,t,i,r){var o,e,r=r||n._style,k=r.rotation||0,f,s,h,u,b,l,a;if(!r.graphicWidth||!r.graphicHeight)return f=new Image,f.onreadystatechange=OpenLayers.Function.bind(function(){("complete"==f.readyState||"interactive"==f.readyState)&&(o=f.width/f.height,e=Math.max(2*r.pointRadius,r.graphicWidth||0,r.graphicHeight||0),t*=o,r.graphicWidth=e*o,r.graphicHeight=e,this.graphicRotate(n,t,i,r))},this),f.src=r.externalGraphic,void 0;e=Math.max(r.graphicWidth,r.graphicHeight);o=r.graphicWidth/r.graphicHeight;s=Math.round(r.graphicWidth||e*o);h=Math.round(r.graphicHeight||e);n.style.width=s+"px";n.style.height=h+"px";u=document.getElementById(n.id+"_image");u||(u=this.createNode("olv:imagedata",n.id+"_image"),n.appendChild(u));u.style.width=s+"px";u.style.height=h+"px";u.src=r.externalGraphic;u.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var v=k*Math.PI/180,y=Math.sin(v),p=Math.cos(v),w="progid:DXImageTransform.Microsoft.Matrix(M11="+p+",M12="+-y+",M21="+y+",M22="+p+",SizingMethod='auto expand')\n",c=r.graphicOpacity||r.fillOpacity;c&&1!=c&&(w+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+c+")\n");n.style.filter=w;b=new OpenLayers.Geometry.Point(-t,-i);l=new OpenLayers.Bounds(0,0,s,h).toGeometry();l.rotate(r.rotation,b);a=l.getBounds();n.style.left=Math.round(parseInt(n.style.left)+a.left)+"px";n.style.top=Math.round(parseInt(n.style.top)-a.bottom)+"px"},postDraw:function(n){n.style.visibility="visible";var t=n._style.fillColor,i=n._style.strokeColor;"none"==t&&n.fillcolor!=t&&(n.fillcolor=t);"none"==i&&n.strokecolor!=i&&(n.strokecolor=i)},setNodeDimension:function(n,t){var r=t.getBounds(),u,i;r&&(u=this.getResolution(),i=new OpenLayers.Bounds(0|r.left/u-this.offset.x,0|r.bottom/u-this.offset.y,0|r.right/u-this.offset.x,0|r.top/u-this.offset.y),n.style.left=i.left+"px",n.style.top=i.top+"px",n.style.width=i.getWidth()+"px",n.style.height=i.getHeight()+"px",n.coordorigin=i.left+" "+i.top,n.coordsize=i.getWidth()+" "+i.getHeight())},dashStyle:function(n){var i=n.strokeDashstyle,t;switch(i){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return i;default:return t=i.split(/[ ,]/),2==t.length?1*t[0]>=2*t[1]?"longdash":1==t[0]||1==t[1]?"dot":"dash":4==t.length?1*t[0]>=2*t[1]?"longdashdot":"dashdot":"solid"}},createNode:function(n,t){var i=document.createElement(n);return t&&(i.id=t),i.unselectable="on",i.onselectstart=OpenLayers.Function.False,i},nodeTypeCompare:function(n,t){var u=t,i=u.indexOf(":"),r;return-1!=i&&(u=u.substr(i+1)),r=n.nodeName,i=r.indexOf(":"),-1!=i&&(r=r.substr(i+1)),u==r},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(n){return this.nodeFactory(this.container.id+n,"olv:group")},drawPoint:function(n,t){return this.drawCircle(n,t,1)},drawCircle:function(n,t,i){var r,u;return!isNaN(t.x)&&!isNaN(t.y)?(r=this.getResolution(),n.style.left=(0|t.x/r-this.offset.x)-i+"px",n.style.top=(0|t.y/r-this.offset.y)-i+"px",u=2*i,n.style.width=u+"px",n.style.height=u+"px",n):!1},drawLineString:function(n,t){return this.drawLine(n,t,!1)},drawLinearRing:function(n,t){return this.drawLine(n,t,!0)},drawLine:function(n,t,i){var c;this.setNodeDimension(n,t);for(var u,f,e,o=this.getResolution(),s=t.components.length,h=Array(s),r=0;s>r;r++)u=t.components[r],f=0|u.x/o-this.offset.x,e=0|u.y/o-this.offset.y,h[r]=" "+f+","+e+" l ";return c=i?" x e":" e",n.path="m"+h.join("")+c,n},drawPolygon:function(n,t){this.setNodeDimension(n,t);for(var h,e,o,s,f,a,c,i,v,y,p=this.getResolution(),r=[],u=0,l=t.components.length;l>u;u++){for(r.push("m"),h=t.components[u].components,e=0===u,o=null,s=null,f=0,a=h.length;a>f;f++)c=h[f],v=0|c.x/p-this.offset.x,y=0|c.y/p-this.offset.y,i=" "+v+","+y,r.push(i),0==f&&r.push(" l"),e||(o?o!=i&&(s?s!=i&&(e=!0):s=i):o=i);r.push(e?" x ":" ")}return r.push("e"),n.path=r.join(""),n},drawRectangle:function(n,t){var i=this.getResolution();return n.style.left=(0|t.x/i-this.offset.x)+"px",n.style.top=(0|t.y/i-this.offset.y)+"px",n.style.width=(0|t.width/i)+"px",n.style.height=(0|t.height/i)+"px",n},drawText:function(n,t,i){var u=this.nodeFactory(n+this.LABEL_ID_SUFFIX,"olv:rect"),r=this.nodeFactory(n+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox"),e=this.getResolution(),f,o,s;u.style.left=(0|i.x/e-this.offset.x)+"px";u.style.top=(0|i.y/e-this.offset.y)+"px";u.style.flip="y";r.innerText=t.label;"inherit"!=t.cursor&&null!=t.cursor&&(r.style.cursor=t.cursor);t.fontColor&&(r.style.color=t.fontColor);t.fontOpacity&&(r.style.filter="alpha(opacity="+100*t.fontOpacity+")");t.fontFamily&&(r.style.fontFamily=t.fontFamily);t.fontSize&&(r.style.fontSize=t.fontSize);t.fontWeight&&(r.style.fontWeight=t.fontWeight);t.fontStyle&&(r.style.fontStyle=t.fontStyle);t.labelSelect===!0&&(u._featureId=n,r._featureId=n,r._geometry=i,r._geometryClass=i.CLASS_NAME);r.style.whiteSpace="nowrap";r.inset="1px,0px,0px,0px";u.parentNode||(u.appendChild(r),this.textRoot.appendChild(u));f=t.labelAlign||"cm";1==f.length&&(f+="m");o=r.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[f.substr(0,1)];s=r.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[f.substr(1,1)];u.style.left=parseInt(u.style.left)-o-1+"px";u.style.top=parseInt(u.style.top)+s+"px"},drawSurface:function(n,t){this.setNodeDimension(n,t);for(var u,f,e,o=this.getResolution(),r=[],i=0,s=t.components.length;s>i;i++)u=t.components[i],f=0|u.x/o-this.offset.x,e=0|u.y/o-this.offset.y,0==i%3&&0==i/3?r.push("m"):1==i%3&&r.push(" c"),r.push(" "+f+","+e);return r.push(" x e"),n.path=r.join(""),n},moveRoot:function(n){var t=this.map.getLayer(n.container.id);t instanceof OpenLayers.Layer.Vector.RootContainer&&(t=this.map.getLayer(this.container.id));t&&t.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);t&&t.redraw()},importSymbol:function(n){var h=this.container.id+"-"+n,r=this.symbolCache[h],u,o,s,c,i;if(r)return r;if(u=OpenLayers.Renderer.symbol[n],!u)throw Error(n+" is not a valid symbol name");for(var t=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),f=["m"],e=0;u.length>e;e+=2)o=u[e],s=u[e+1],t.left=Math.min(t.left,o),t.bottom=Math.min(t.bottom,s),t.right=Math.max(t.right,o),t.top=Math.max(t.top,s),f.push(o),f.push(s),0==e&&f.push("l");return f.push("x e"),c=f.join(" "),i=(t.getWidth()-t.getHeight())/2,i>0?(t.bottom=t.bottom-i,t.top=t.top+i):(t.left=t.left+i,t.right=t.right-i),r={path:c,size:t.getWidth(),left:t.left,bottom:t.bottom},this.symbolCache[h]=r,r},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:.5,r:1,t:0,m:.5,b:1};OpenLayers.Layer.MultiMap=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[9,1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20],type:null,initialize:function(){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters(),this.RESOLUTIONS.unshift(10))},loadMapObject:function(){try{this.mapObject=new MultimapViewer(this.div)}catch(n){}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"MM",layerLib:"MultiMap"})},setMapObjectCenter:function(n,t){this.mapObject.goToPosition(n,t)},getMapObjectCenter:function(){return this.mapObject.getCurrentPosition()},getMapObjectZoom:function(){return this.mapObject.getZoomFactor()},getMapObjectLonLatFromMapObjectPixel:function(n){return n.x=n.x-this.map.getSize().w/2,n.y=n.y-this.map.getSize().h/2,this.mapObject.getMapPositionAt(n)},getMapObjectPixelFromMapObjectLonLat:function(n){return this.mapObject.geoPosToContainerPixels(n)},getLongitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.lon,n.lat).lon:n.lon},getLatitudeFromMapObjectLonLat:function(n){return this.sphericalMercator?this.forwardMercator(n.lon,n.lat).lat:n.lat},getMapObjectLonLatFromLonLat:function(n,t){var i,r;return this.sphericalMercator?(r=this.inverseMercator(n,t),i=new MMLatLon(r.lat,r.lon)):i=new MMLatLon(t,n),i},getXFromMapObjectPixel:function(n){return n.x},getYFromMapObjectPixel:function(n){return n.y},getMapObjectPixelFromXY:function(n,t){return new MMPoint(n,t)},CLASS_NAME:"OpenLayers.Layer.MultiMap"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(n,t){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);n&&(this.position=n);t&&(this.direction=t);this.measureDivs=[]},destroy:function(){var t,n;for(t in this.buttons)n=this.buttons[t],n.map=null,n.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 n=new OpenLayers.Size(28,28),t=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);return this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",t,n,"Shift->Drag to zoom to area"),t=t.add("vertical"==this.direction?0:n.w,"vertical"==this.direction?n.h:0),this._addButton("pan","panning-hand-off.png","panning-hand-on.png",t,n,"Drag the map to pan."),t=t.add("vertical"==this.direction?0:n.w,"vertical"==this.direction?n.h:0),this.switchModeTo("pan"),this.div},_addButton:function(n,t,i,r,u,f){var o=OpenLayers.Util.getImagesLocation()+t,s=OpenLayers.Util.getImagesLocation()+i,e=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+n,r,u,o,"absolute");return this.div.appendChild(e),e.imgLocation=o,e.activeImgLocation=s,e.events=new OpenLayers.Events(this,e,null,!0),e.events.on({mousedown:this.buttonDown,mouseup:this.buttonUp,dblclick:OpenLayers.Event.stop,scope:this}),e.action=n,e.title=f,e.alt=f,e.map=this.map,this.buttons[n]=e,e},buttonDown:function(n){OpenLayers.Event.isLeftClick(n)&&(this.buttonClicked=n.element.action,OpenLayers.Event.stop(n))},buttonUp:function(n){OpenLayers.Event.isLeftClick(n)&&null!=this.buttonClicked&&(this.buttonClicked==n.element.action&&this.switchModeTo(n.element.action),OpenLayers.Event.stop(n),this.buttonClicked=null)},defaultDblClick:function(n){this.switchModeTo("pan");this.performedDrag=!1;var t=this.map.getLonLatFromViewPortPx(n.xy);return this.map.setCenter(t,this.map.zoom+1),OpenLayers.Event.stop(n),!1},defaultMouseDown:function(n){var t,i;if(OpenLayers.Event.isLeftClick(n)){switch(this.mouseDragStart=n.xy.clone(),this.performedDrag=!1,this.startViaKeyboard=!1,n.shiftKey&&"zoombox"!=this.mode?(this.switchModeTo("zoombox"),this.startViaKeyboard=!0):n.altKey&&"measure"!=this.mode?this.switchModeTo("measure"):this.mode||this.switchModeTo("pan"),this.mode){case"zoombox":this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.eventsDiv.appendChild(this.zoomBox);this.performedDrag=!0;break;case"measure":t="";this.measureStart&&(i=this.map.getLonLatFromViewPortPx(this.mouseDragStart),t=OpenLayers.Util.distVincenty(this.measureStart,i),t=Math.round(100*t)/100,t+="km",this.measureStartBox=this.measureBox);this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");this.measureBox.style.width="4px";this.measureBox.style.height="4px";this.measureBox.style.fontSize="1px";this.measureBox.style.backgroundColor="red";this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBox);t&&(this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute"),this.measureBoxDistance.innerHTML=t,this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.layerContainerDiv.appendChild(this.measureBoxDistance),this.measureDivs.push(this.measureBoxDistance));this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.layerContainerDiv.appendChild(this.measureBox);this.measureDivs.push(this.measureBox);break;default:this.map.div.style.cursor="move"}document.onselectstart=OpenLayers.Function.False;OpenLayers.Event.stop(n)}},switchModeTo:function(n){if(n!=this.mode){if(this.mode&&this.buttons[this.mode]&&OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation),"measure"==this.mode&&"measure"!=n){for(var t=0,i=this.measureDivs.length;i>t;t++)this.measureDivs[t]&&this.map.layerContainerDiv.removeChild(this.measureDivs[t]);this.measureDivs=[];this.measureStart=null}switch(this.mode=n,this.buttons[n]&&OpenLayers.Util.modifyAlphaImageDiv(this.buttons[n],null,null,null,this.buttons[n].activeImgLocation),this.mode){case"zoombox":this.map.div.style.cursor="crosshair";break;default:this.map.div.style.cursor=""}}},leaveMode:function(){this.switchModeTo("pan")},defaultMouseMove:function(n){var t,i;if(null!=this.mouseDragStart){switch(this.mode){case"zoombox":t=Math.abs(this.mouseDragStart.x-n.xy.x);i=Math.abs(this.mouseDragStart.y-n.xy.y);this.zoomBox.style.width=Math.max(1,t)+"px";this.zoomBox.style.height=Math.max(1,i)+"px";n.xy.x<this.mouseDragStart.x&&(this.zoomBox.style.left=n.xy.x+"px");n.xy.y<this.mouseDragStart.y&&(this.zoomBox.style.top=n.xy.y+"px");break;default:var t=this.mouseDragStart.x-n.xy.x,i=this.mouseDragStart.y-n.xy.y,r=this.map.getSize(),u=new OpenLayers.Pixel(r.w/2+t,r.h/2+i),f=this.map.getLonLatFromViewPortPx(u);this.map.setCenter(f,null,!0);this.mouseDragStart=n.xy.clone()}this.performedDrag=!0}},defaultMouseUp:function(n){if(OpenLayers.Event.isLeftClick(n)){switch(this.mode){case"zoombox":this.zoomBoxEnd(n);this.startViaKeyboard&&this.leaveMode();break;case"pan":this.performedDrag&&this.map.setCenter(this.map.center)}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor="default"}},defaultMouseOut:function(n){null!=this.mouseDragStart&&OpenLayers.Util.mouseLeft(n,this.map.eventsDiv)&&(this.zoomBox&&(this.removeZoomBox(),this.startViaKeyboard&&this.leaveMode()),this.mouseDragStart=null,this.map.div.style.cursor="default")},defaultClick:function(){if(this.performedDrag)return(this.performedDrag=!1,!1)},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});OpenLayers.Control.MouseToolbar.X=6;OpenLayers.Control.MouseToolbar.Y=300;OpenLayers.Protocol.WFS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_0_0"});OpenLayers.Format.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Format.XML,{layerIdentifier:"_layer",featureIdentifier:"_feature",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},gmlFormat:null,read:function(n){var i,t,r;return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),t=n.documentElement,t?(r=this["read_"+t.nodeName],i=r?r.call(this,t):new OpenLayers.Format.GML(this.options?this.options:{}).read(n)):i=n,i},read_msGMLOutput:function(n){var s=[],e=this.getSiblingNodesByTagCriteria(n,this.layerIdentifier),i,h,r,t,u,f;if(e)for(i=0,h=e.length;h>i;++i)if(r=e[i],t=r.nodeName,r.prefix&&(t=t.split(":")[1]),t=t.replace(this.layerIdentifier,""),u=this.getSiblingNodesByTagCriteria(r,this.featureIdentifier),u)for(f=0;u.length>f;f++){var c=u[f],l=this.parseGeometry(c),a=this.parseAttributes(c),o=new OpenLayers.Feature.Vector(l.geometry,a,null);o.bounds=l.bounds;o.type=t;s.push(o)}return s},read_FeatureInfoResponse:function(n){for(var o,s,r,h=[],c=this.getElementsByTagNameNS(n,"*","FIELDS"),u=0,l=c.length;l>u;u++){var t,f=c[u],e={},i=f.attributes.length;if(i>0)for(t=0;i>t;t++)o=f.attributes[t],e[o.nodeName]=o.nodeValue;else for(s=f.childNodes,t=0,i=s.length;i>t;++t)r=s[t],3!=r.nodeType&&(e[r.getAttribute("name")]=r.getAttribute("value"));h.push(new OpenLayers.Feature.Vector(null,e,null))}return h},getSiblingNodesByTagCriteria:function(n,t){var e,o,s,f,i,r=[],u;if(n&&n.hasChildNodes())for(e=n.childNodes,s=e.length,u=0;s>u;u++){for(i=e[u];i&&1!=i.nodeType;)i=i.nextSibling,u++;o=i?i.nodeName:"";o.length>0&&o.indexOf(t)>-1?r.push(i):(f=this.getSiblingNodesByTagCriteria(i,t),f.length>0&&(0==r.length?r=f:r.push(f)))}return r},parseAttributes:function(n){var u={},t,i,e,r,s;if(1==n.nodeType)for(var o=n.childNodes,h=o.length,f=0;h>f;++f)t=o[f],1==t.nodeType&&(i=t.childNodes,e=t.prefix?t.nodeName.split(":")[1]:t.nodeName,0==i.length?u[e]=null:1==i.length&&(r=i[0],(3==r.nodeType||4==r.nodeType)&&(s=r.nodeValue.replace(this.regExes.trimSpace,""),u[e]=s)));return u},parseGeometry:function(n){this.gmlFormat||(this.gmlFormat=new OpenLayers.Format.GML);var i,t=this.gmlFormat.parseFeature(n),r=null;return t&&(i=t.geometry&&t.geometry.clone(),r=t.bounds&&t.bounds.clone(),t.destroy()),{geometry:i,bounds:r}},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"});OpenLayers.Control.WMTSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,requestEncoding:"KVP",drillDown:!1,maxFeatures:10,clickCallback:"click",layers:null,queryVisible:!0,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,EVENT_TYPES:["beforegetfeatureinfo","getfeatureinfo","exception"],pending:0,initialize:function(n){if(this.EVENT_TYPES=OpenLayers.Control.WMTSGetFeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES),n=n||{},n.handlerOptions=n.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[n]),this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(n.formatOptions)),this.drillDown===!0&&(this.hover=!1),this.hover)this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}));else{var t={};t[this.clickCallback]=this.getInfoForClick;this.handler=new OpenLayers.Handler.Click(this,t,this.handlerOptions.click||{})}},getInfoForClick:function(n){this.request(n.xy,{})},getInfoForHover:function(n){this.request(n.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(--this.pending,0>=this.pending&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0),this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var n,i=this.layers||this.map.layers,r=[],t=i.length-1;t>=0&&(n=i[t],!(n instanceof OpenLayers.Layer.WMTS&&n.requestEncoding===this.requestEncoding)||this.queryVisible&&!n.getVisibility()||(r.push(n),this.drillDown&&!this.hover));--t);return r},buildRequestOptions:function(n,t){var i=this.map.getLonLatFromPixel(t),f=n.getURL(new OpenLayers.Bounds(i.lon,i.lat,i.lon,i.lat)),r=OpenLayers.Util.getParameters(f),u=n.getTileInfo(i);return OpenLayers.Util.extend(r,{service:"WMTS",version:n.version,request:"GetFeatureInfo",infoFormat:this.infoFormat,i:u.i,j:u.j}),OpenLayers.Util.applyDefaults(r,this.vendorParams),{url:OpenLayers.Util.isArray(n.url)?n.url[0]:n.url,params:OpenLayers.Util.upperCaseObject(r),callback:function(i){this.handleResponse(t,i,n)},scope:this}},request:function(n,t){var i,f,u,r,e,o,s;if(t=t||{},i=this.findLayers(),i.length>0){for(r=0,e=i.length;e>r;r++)(u=i[r],f=this.events.triggerEvent("beforegetfeatureinfo",{xy:n,layer:u}),f!==!1)&&(++this.pending,o=this.buildRequestOptions(u,n),s=OpenLayers.Request.GET(o),t.hover===!0&&(this.hoverRequest=s));this.pending>0&&OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(n,t,i){var r,u,f;if(--this.pending,0>=this.pending&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0),t.status&&(200>t.status||t.status>=300))this.events.triggerEvent("exception",{xy:n,request:t,layer:i});else{r=t.responseXML;r&&r.documentElement||(r=t.responseText);try{u=this.format.read(r)}catch(e){f=!0;this.events.triggerEvent("exception",{xy:n,request:t,error:e,layer:i})}f||this.events.triggerEvent("getfeatureinfo",{text:t.responseText,features:u,request:t,xy:n,layer:i})}},CLASS_NAME:"OpenLayers.Control.WMTSGetFeatureInfo"});OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMT_MS_Capabilities:function(n,t){this.readChildNodes(n,t)},Keyword:function(n,t){t.keywords&&t.keywords.push(this.getChildValue(n))},DescribeLayer:function(n,t){t.describelayer={formats:[]};this.readChildNodes(n,t.describelayer)},GetLegendGraphic:function(n,t){t.getlegendgraphic={formats:[]};this.readChildNodes(n,t.getlegendgraphic)},GetStyles:function(n,t){t.getstyles={formats:[]};this.readChildNodes(n,t.getstyles)},PutStyles:function(n,t){t.putstyles={formats:[]};this.readChildNodes(n,t.putstyles)},UserDefinedSymbolization:function(n,t){var i={supportSLD:1==parseInt(n.getAttribute("SupportSLD")),userLayer:1==parseInt(n.getAttribute("UserLayer")),userStyle:1==parseInt(n.getAttribute("UserStyle")),remoteWFS:1==parseInt(n.getAttribute("RemoteWFS"))};t.userSymbols=i},LatLonBoundingBox:function(n,t){t.llbbox=[parseFloat(n.getAttribute("minx")),parseFloat(n.getAttribute("miny")),parseFloat(n.getAttribute("maxx")),parseFloat(n.getAttribute("maxy"))]},BoundingBox:function(n,t){var i=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[n,t]);i.srs=n.getAttribute("SRS");t.bbox[i.srs]=i},ScaleHint:function(n,t){var u=n.getAttribute("min"),f=n.getAttribute("max"),i=Math.pow(2,.5),r=OpenLayers.INCHES_PER_UNIT.m;t.maxScale=parseFloat((u/i*r*OpenLayers.DOTS_PER_INCH).toPrecision(13));t.minScale=parseFloat((f/i*r*OpenLayers.DOTS_PER_INCH).toPrecision(13))},Dimension:function(n,t){var r=n.getAttribute("name").toLowerCase(),i={name:r,units:n.getAttribute("units"),unitsymbol:n.getAttribute("unitSymbol")};t.dimensions[i.name]=i},Extent:function(n,t){var r=n.getAttribute("name").toLowerCase(),i,u;r in t.dimensions&&(i=t.dimensions[r],i.nearestVal="1"===n.getAttribute("nearestValue"),i.multipleVal="1"===n.getAttribute("multipleValues"),i.current="1"===n.getAttribute("current"),i["default"]=n.getAttribute("default")||"",u=this.getChildValue(n),i.values=u.split(","))}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1"});OpenLayers.Control.Graticule=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,intervals:[45,30,20,10,5,2,1,.5,.2,.1,.05,.01,.005,.002,.001],displayInLayerSwitcher:!0,visible:!0,numPoints:50,targetSize:200,layerName:null,labelled:!0,labelFormat:"dm",lineSymbolizer:{strokeColor:"#333",strokeWidth:1,strokeOpacity:.5},labelSymbolizer:{},gratLayer:null,initialize:function(n){n=n||{};n.layerName=n.layerName||OpenLayers.i18n("Graticule");OpenLayers.Control.prototype.initialize.apply(this,[n]);this.labelSymbolizer.stroke=!1;this.labelSymbolizer.fill=!1;this.labelSymbolizer.label="${label}";this.labelSymbolizer.labelAlign="${labelAlign}";this.labelSymbolizer.labelXOffset="${xOffset}";this.labelSymbolizer.labelYOffset="${yOffset}"},destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments);this.gratLayer&&(this.gratLayer.destroy(),this.gratLayer=null)},draw:function(){if(OpenLayers.Control.prototype.draw.apply(this,arguments),!this.gratLayer){var n=new OpenLayers.Style({},{rules:[new OpenLayers.Rule({symbolizer:{Point:this.labelSymbolizer,Line:this.lineSymbolizer}})]});this.gratLayer=new OpenLayers.Layer.Vector(this.layerName,{styleMap:new OpenLayers.StyleMap({"default":n}),visibility:this.visible,displayInLayerSwitcher:this.displayInLayerSwitcher})}return this.div},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.map.addLayer(this.gratLayer),this.map.events.register("moveend",this,this.update),this.update(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.map.events.unregister("moveend",this,this.update),this.map.removeLayer(this.gratLayer),!0):!1},update:function(){var e=this.map.getExtent(),ut,t,k,r,ft,h,g,u,a,f,tt,it,rt;if(e){this.gratLayer.destroyFeatures();var o=new OpenLayers.Projection("EPSG:4326"),i=this.map.getProjectionObject(),st=this.map.getResolution();for(i.proj&&"longlat"==i.proj.projName&&(this.numPoints=1),ut=this.map.getCenter(),t=new OpenLayers.Pixel(ut.lon,ut.lat),OpenLayers.Projection.transform(t,i,o),k=this.targetSize*st,k*=k,u=0;this.intervals.length>u;++u){r=this.intervals[u];var d=r/2,v=t.offset(new OpenLayers.Pixel(-d,-d)),y=t.offset(new OpenLayers.Pixel(d,d));if(OpenLayers.Projection.transform(v,o,i),OpenLayers.Projection.transform(y,o,i),ft=(v.x-y.x)*(v.x-y.x)+(v.y-y.y)*(v.y-y.y),k>=ft)break}t.x=Math.floor(t.x/r)*r;t.y=Math.floor(t.y/r)*r;var s,p=0,l=[t.clone()],n=t.clone();do n=n.offset(new OpenLayers.Pixel(0,r)),s=OpenLayers.Projection.transform(n.clone(),o,i),l.unshift(n);while(e.containsPixel(s)&&1e3>++p);n=t.clone();do n=n.offset(new OpenLayers.Pixel(0,-r)),s=OpenLayers.Projection.transform(n.clone(),o,i),l.push(n);while(e.containsPixel(s)&&1e3>++p);p=0;h=[t.clone()];n=t.clone();do n=n.offset(new OpenLayers.Pixel(-r,0)),s=OpenLayers.Projection.transform(n.clone(),o,i),h.unshift(n);while(e.containsPixel(s)&&1e3>++p);n=t.clone();do n=n.offset(new OpenLayers.Pixel(r,0)),s=OpenLayers.Projection.transform(n.clone(),o,i),h.push(n);while(e.containsPixel(s)&&1e3>++p);for(g=[],u=0;h.length>u;++u){for(var w=h[u].x,nt=[],b=null,ht=Math.min(l[0].y,90),et=Math.max(l[l.length-1].y,-90),ct=(ht-et)/this.numPoints,c=et,a=0;this.numPoints>=a;++a)f=new OpenLayers.Geometry.Point(w,c),f.transform(o,i),nt.push(f),c+=ct,f.y>=e.bottom&&!b&&(b=f);this.labelled&&(tt=new OpenLayers.Geometry.Point(b.x,e.bottom),it={value:w,label:this.labelled?OpenLayers.Util.getFormattedLonLat(w,"lon",this.labelFormat):"",labelAlign:"cb",xOffset:0,yOffset:2},this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(tt,it)));rt=new OpenLayers.Geometry.LineString(nt);g.push(new OpenLayers.Feature.Vector(rt))}for(a=0;l.length>a;++a)if(c=l[a].y,!(-90>c||c>90)){for(var nt=[],ot=h[0].x,lt=h[h.length-1].x,at=(lt-ot)/this.numPoints,w=ot,b=null,u=0;this.numPoints>=u;++u)f=new OpenLayers.Geometry.Point(w,c),f.transform(o,i),nt.push(f),w+=at,f.x<e.right&&(b=f);this.labelled&&(tt=new OpenLayers.Geometry.Point(e.right,b.y),it={value:c,label:this.labelled?OpenLayers.Util.getFormattedLonLat(c,"lat",this.labelFormat):"",labelAlign:"rb",xOffset:-2,yOffset:2},this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(tt,it)));rt=new OpenLayers.Geometry.LineString(nt);g.push(new OpenLayers.Feature.Vector(rt))}this.gratLayer.addFeatures(g)}},CLASS_NAME:"OpenLayers.Control.Graticule"});OpenLayers.Layer.WMS.Post=OpenLayers.Class(OpenLayers.Layer.WMS,{unsupportedBrowsers:["mozilla","firefox","opera"],SUPPORTED_TRANSITIONS:[],usePost:null,initialize:function(n,t,i,r){var u=[];u.push(n,t,i,r);OpenLayers.Layer.WMS.prototype.initialize.apply(this,u);this.usePost=-1==OpenLayers.Util.indexOf(this.unsupportedBrowsers,OpenLayers.BROWSER_NAME)},addTile:function(n,t){return new OpenLayers.Tile.Image(this,t,n,null,this.tileSize,{maxGetUrlLength:this.usePost?0:null})},CLASS_NAME:"OpenLayers.Layer.WMS.Post"});OpenLayers.Layer.ArcGISCache=OpenLayers.Class(OpenLayers.Layer.XYZ,{url:null,tileOrigin:null,tileSize:new OpenLayers.Size(256,256),useArcGISServer:!0,type:"png",useScales:!1,overrideDPI:!1,initialize:function(){var n,i,e,o,r,t,u,f;if((OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments),this.resolutions&&(this.serverResolutions=this.resolutions,this.maxExtent=this.getMaxExtentForResolution(this.resolutions[0])),this.layerInfo)&&(n=this.layerInfo,i=new OpenLayers.Bounds(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax),this.projection="EPSG:"+n.spatialReference.wkid,this.sphericalMercator=102100==n.spatialReference.wkid,this.units="esriFeet"==n.units?"ft":"m",n.tileInfo)){this.tileSize=new OpenLayers.Size(n.tileInfo.width||n.tileInfo.cols,n.tileInfo.height||n.tileInfo.rows);this.tileOrigin=new OpenLayers.LonLat(n.tileInfo.origin.x,n.tileInfo.origin.y);e=new OpenLayers.Geometry.Point(i.left,i.top);o=new OpenLayers.Geometry.Point(i.right,i.bottom);this.useScales?this.scales=[]:this.resolutions=[];this.lods=[];for(r in n.tileInfo.lods)n.tileInfo.lods.hasOwnProperty(r)&&(t=n.tileInfo.lods[r],this.useScales?this.scales.push(t.scale):this.resolutions.push(t.resolution),u=this.getContainingTileCoords(e,t.resolution),t.startTileCol=u.x,t.startTileRow=u.y,f=this.getContainingTileCoords(o,t.resolution),t.endTileCol=f.x,t.endTileRow=f.y,this.lods.push(t));this.maxExtent=this.calculateMaxExtentWithLOD(this.lods[0]);this.serverResolutions=this.resolutions;this.overrideDPI&&n.tileInfo.dpi&&(OpenLayers.DOTS_PER_INCH=n.tileInfo.dpi)}},getContainingTileCoords:function(n,t){return new OpenLayers.Pixel(Math.max(Math.floor((n.x-this.tileOrigin.lon)/(this.tileSize.w*t)),0),Math.max(Math.floor((this.tileOrigin.lat-n.y)/(this.tileSize.h*t)),0))},calculateMaxExtentWithLOD:function(n){var r=n.endTileCol-n.startTileCol+1,u=n.endTileRow-n.startTileRow+1,t=this.tileOrigin.lon+n.startTileCol*this.tileSize.w*n.resolution,f=t+r*this.tileSize.w*n.resolution,i=this.tileOrigin.lat-n.startTileRow*this.tileSize.h*n.resolution,e=i-u*this.tileSize.h*n.resolution;return new OpenLayers.Bounds(t,e,f,i)},calculateMaxExtentWithExtent:function(n,t){var u=new OpenLayers.Geometry.Point(n.left,n.top),f=new OpenLayers.Geometry.Point(n.right,n.bottom),i=this.getContainingTileCoords(u,t),r=this.getContainingTileCoords(f,t),e={resolution:t,startTileCol:i.x,startTileRow:i.y,endTileCol:r.x,endTileRow:r.y};return this.calculateMaxExtentWithLOD(e)},getUpperLeftTileCoord:function(n){var t=new OpenLayers.Geometry.Point(this.maxExtent.left,this.maxExtent.top);return this.getContainingTileCoords(t,n)},getLowerRightTileCoord:function(n){var t=new OpenLayers.Geometry.Point(this.maxExtent.right,this.maxExtent.bottom);return this.getContainingTileCoords(t,n)},getMaxExtentForResolution:function(n){var t=this.getUpperLeftTileCoord(n),i=this.getLowerRightTileCoord(n),f=i.x-t.x+1,e=i.y-t.y+1,r=this.tileOrigin.lon+t.x*this.tileSize.w*n,o=r+f*this.tileSize.w*n,u=this.tileOrigin.lat-t.y*this.tileSize.h*n,s=u-e*this.tileSize.h*n;return new OpenLayers.Bounds(r,s,o,u)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.ArcGISCache(this.name,this.url,this.options)),OpenLayers.Layer.XYZ.prototype.clone.apply(this,[n])},getMaxExtent:function(){var n=this.map.getResolution();return this.maxExtent=this.getMaxExtentForResolution(n)},getTileOrigin:function(){var n=this.getMaxExtent();return new OpenLayers.LonLat(n.left,n.bottom)},getURL:function(n){var u=this.getResolution(),l=this.tileOrigin.lon+u*this.tileSize.w/2,a=this.tileOrigin.lat-u*this.tileSize.h/2,e=n.getCenterLonLat(),f,s,h,t,c;({x:e.lon,y:e.lat});var i=Math.round(Math.abs((e.lon-l)/(u*this.tileSize.w))),r=Math.round(Math.abs((a-e.lat)/(u*this.tileSize.h))),o=this.map.getZoom();if(this.lods){if(f=this.lods[this.map.getZoom()],f.startTileCol>i||i>f.endTileCol||f.startTileRow>r||r>f.endTileRow)return null}else if(s=this.getUpperLeftTileCoord(u),h=this.getLowerRightTileCoord(u),s.x>i||i>=h.x||s.y>r||r>=h.y)return null;return t=this.url,c=""+i+r+o,OpenLayers.Util.isArray(t)&&(t=this.selectUrl(c,t)),this.useArcGISServer?t+="/tile/${z}/${y}/${x}":(i="C"+this.zeroPad(i,8,16),r="R"+this.zeroPad(r,8,16),o="L"+this.zeroPad(o,2,16),t=t+"/${z}/${y}/${x}."+this.type),t=OpenLayers.String.format(t,{x:i,y:r,z:o})},zeroPad:function(n,t,i){for(var r=n.toString(i||10);t>r.length;)r="0"+r;return r},CLASS_NAME:"OpenLayers.Layer.ArcGISCache"});OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,drillDown:!1,maxFeatures:10,clickCallback:"click",output:"features",layers:null,queryVisible:!1,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handlerOptions:null,handler:null,hoverRequest:null,EVENT_TYPES:["beforegetfeatureinfo","nogetfeatureinfo","getfeatureinfo"],initialize:function(n){if(this.EVENT_TYPES=OpenLayers.Control.WMSGetFeatureInfo.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES),n=n||{},n.handlerOptions=n.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[n]),this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(n.formatOptions)),this.drillDown===!0&&(this.hover=!1),this.hover)this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}));else{var t={};t[this.clickCallback]=this.getInfoForClick;this.handler=new OpenLayers.Handler.Click(this,t,this.handlerOptions.click||{})}},activate:function(){return this.active||this.handler.activate(),OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},getInfoForClick:function(n){this.events.triggerEvent("beforegetfeatureinfo",{xy:n.xy});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");this.request(n.xy,{})},getInfoForHover:function(n){this.events.triggerEvent("beforegetfeatureinfo",{xy:n.xy});this.request(n.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var n,t,r=this.layers||this.map.layers,u=[],i=0,f=r.length;f>i;++i)n=r[i],n instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||n.getVisibility())&&(t=OpenLayers.Util.isArray(n.url)?n.url[0]:n.url,this.drillDown!==!1||this.url||(this.url=t),(this.drillDown===!0||this.urlMatches(t))&&u.push(n));return u},urlMatches:function(n){var i=OpenLayers.Util.isEquivalentUrl(this.url,n),t,r;if(!i&&this.layerUrls)for(t=0,r=this.layerUrls.length;r>t;++t)if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[t],n)){i=!0;break}return i},buildWMSOptions:function(n,t,i,r){for(var c,f=[],o=[],e=0,l=t.length;l>e;e++)f=f.concat(t[e].params.LAYERS),o=o.concat(this.getStyleNames(t[e]));var u=t[0],s=this.map.getProjection(),h=u.projection;return h&&h.equals(this.map.getProjectionObject())&&(s=h.getCode()),c=OpenLayers.Util.extend({service:"WMS",version:u.params.VERSION,request:"GetFeatureInfo",layers:f,query_layers:f,styles:o,bbox:this.map.getExtent().toBBOX(null,u.reverseAxisOrder()),feature_count:this.maxFeatures,height:this.map.getSize().h,width:this.map.getSize().w,format:r,info_format:u.params.INFO_FORMAT||this.infoFormat},parseFloat(u.params.VERSION)>=1.3?{crs:s,i:parseInt(i.x),j:parseInt(i.y)}:{srs:s,x:parseInt(i.x),y:parseInt(i.y)}),OpenLayers.Util.applyDefaults(c,this.vendorParams),{url:n,params:OpenLayers.Util.upperCaseObject(c),callback:function(t){this.handleResponse(i,t,n)},scope:this}},getStyleNames:function(n){return n.params.STYLES?n.params.STYLES:OpenLayers.Util.isArray(n.params.LAYERS)?Array(n.params.LAYERS.length):n.params.LAYERS.replace(/[^,]/g,"")},request:function(n,t){var i=this.findLayers(),s,u,r,e;if(0==i.length)return this.events.triggerEvent("nogetfeatureinfo"),OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),void 0;if(t=t||{},this.drillDown===!1)e=this.buildWMSOptions(this.url,i,n,i[0].params.FORMAT),s=OpenLayers.Request.GET(e),t.hover===!0&&(this.hoverRequest=s);else{this._requestCount=0;this._numRequests=0;this.features=[];for(var r,f={},o=0,h=i.length;h>o;o++)u=i[o],r=OpenLayers.Util.isArray(u.url)?u.url[0]:u.url,r in f?f[r].push(u):(this._numRequests++,f[r]=[u]);for(r in f)i=f[r],e=this.buildWMSOptions(r,i,n,i[0].params.FORMAT),OpenLayers.Request.GET(e)}},triggerGetFeatureInfo:function(n,t,i){this.events.triggerEvent("getfeatureinfo",{text:n.responseText,features:i,request:n,xy:t});OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},handleResponse:function(n,t,i){var r=t.responseXML,u;r&&r.documentElement||(r=t.responseText);u=this.format.read(r);this.drillDown===!1?this.triggerGetFeatureInfo(t,n,u):(this._requestCount++,this._features="object"===this.output?(this._features||[]).concat({url:i,features:u}):(this._features||[]).concat(u),this._requestCount===this._numRequests&&(this.triggerGetFeatureInfo(t,n,this._features.concat()),delete this._features,delete this._requestCount,delete this._numRequests))},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"});OpenLayers.Format.WMSCapabilities.v1_3_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_3,{version:"1.3.0",CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3_0"});OpenLayers.Format.CQL=function(){function o(n,t){return t instanceof RegExp?t.exec(n):t(n)}function s(n,t){for(var u,h=t.length,c,f,e,l,s,i=0;h>i;i++)if(u=t[i],c=r[u],f=o(n,c),f)return e=f[0],l=n.substr(e.length).replace(/^\s*/,""),{type:u,text:e,remainder:l};for(s="ERROR: In parsing: ["+n+"], expected one of: ",i=0;h>i;i++)u=t[i],s+="\n    "+u+": "+r[u];throw Error(s);}function h(n){var t,r=[],i=["NOT","GEOMETRY","SPATIAL","PROPERTY","LPAREN"];do{if(t=s(n,i),n=t.remainder,i=l[t.type],"END"!=t.type&&!i)throw Error("No follows list for "+t.type);r.push(t)}while("END"!=t.type);return r}function c(n){function r(){var u=f.pop(),o,s,h,c,l,e,n;switch(u.type){case"LOGICAL":return o=r(),s=r(),new OpenLayers.Filter.Logical({filters:[s,o],type:i[u.text.toUpperCase()]});case"NOT":return h=r(),new OpenLayers.Filter.Logical({filters:[h],type:OpenLayers.Filter.Logical.NOT});case"BETWEEN":return f.pop(),l=r(),c=r(),n=r(),new OpenLayers.Filter.Comparison({property:n,lowerBoundary:c,upperBoundary:l,type:OpenLayers.Filter.Comparison.BETWEEN});case"COMPARISON":return e=r(),n=r(),new OpenLayers.Filter.Comparison({property:n,value:e,type:t[u.text.toUpperCase()]});case"VALUE":return/^'.*'$/.test(u.text)?u.text.substr(1,u.text.length-2):Number(u.text);case"SPATIAL":switch(u.text.toUpperCase()){case"BBOX":var a=r(),v=r(),y=r(),p=r(),w=r();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:w,value:OpenLayers.Bounds.fromArray([p,y,v,a])});case"INTERSECTS":return e=r(),n=r(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:n,value:e});case"WITHIN":return e=r(),n=r(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.WITHIN,property:n,value:e});case"CONTAINS":return e=r(),n=r(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.CONTAINS,property:n,value:e});case"DWITHIN":var b=r(),e=r(),n=r();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,value:e,property:n,distance:Number(b)})}case"GEOMETRY":return OpenLayers.Geometry.fromWKT(u.text);default:return u.text}}for(var o,c,l,h,s,u=[],f=[];n.length;){o=n.shift();switch(o.type){case"PROPERTY":case"GEOMETRY":case"VALUE":f.push(o);break;case"COMPARISON":case"BETWEEN":case"LOGICAL":for(c=e[o.type];u.length>0&&c>=e[u[u.length-1].type];)f.push(u.pop());u.push(o);break;case"SPATIAL":case"NOT":case"LPAREN":u.push(o);break;case"RPAREN":for(;u.length>0&&"LPAREN"!=u[u.length-1].type;)f.push(u.pop());u.pop();u.length>0&&"SPATIAL"==u[u.length-1].type&&f.push(u.pop());case"COMMA":case"END":break;default:throw Error("Unknown token type "+o.type);}}for(;u.length>0;)f.push(u.pop());if(l=r(),f.length>0){for(h="Remaining tokens after building AST: \n",s=f.length-1;s>=0;s--)h+=f[s].type+": "+f[s].text+"\n";throw Error(h);}return l}var n,r={PROPERTY:/^[_a-zA-Z]\w*/,COMPARISON:/^(=|<>|<=|<|>=|>|LIKE)/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('\w+'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/,RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(n){var r=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(n),u,t,i;if(r){if(u=n.length,t=n.indexOf("(",r[0].length),t>-1)for(i=1;u>t&&i>0;)switch(t++,n.charAt(t)){case"(":i++;break;case")":i--}return[n.substr(0,t+1)]}},END:/^$/},l={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON","BETWEEN","COMMA"],BETWEEN:["VALUE"],COMPARISON:["VALUE"],COMMA:["GEOMETRY","VALUE","PROPERTY"],VALUE:["LOGICAL","COMMA","RPAREN","END"],SPATIAL:["LPAREN"],LOGICAL:["NOT","VALUE","SPATIAL","PROPERTY","LPAREN"],NOT:["PROPERTY","LPAREN"],GEOMETRY:["COMMA","RPAREN"]},t={"=":OpenLayers.Filter.Comparison.EQUAL_TO,"<>":OpenLayers.Filter.Comparison.NOT_EQUAL_TO,"<":OpenLayers.Filter.Comparison.LESS_THAN,"<=":OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,">":OpenLayers.Filter.Comparison.GREATER_THAN,">=":OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,LIKE:OpenLayers.Filter.Comparison.LIKE,BETWEEN:OpenLayers.Filter.Comparison.BETWEEN},u={},i={AND:OpenLayers.Filter.Logical.AND,OR:OpenLayers.Filter.Logical.OR},f={},e={RPAREN:3,LOGICAL:2,COMPARISON:1};for(n in t)t.hasOwnProperty(n)&&(u[t[n]]=n);for(n in i)i.hasOwnProperty(n)&&(f[i[n]]=n);return OpenLayers.Class(OpenLayers.Format,{read:function(n){var t=c(h(n));return this.keepData&&(this.data=t),t},write:function(n){if(n instanceof OpenLayers.Geometry)return""+n;switch(n.CLASS_NAME){case"OpenLayers.Filter.Spatial":switch(n.type){case OpenLayers.Filter.Spatial.BBOX:return"BBOX("+n.property+","+n.value.toBBOX()+")";case OpenLayers.Filter.Spatial.DWITHIN:return"DWITHIN("+n.property+", "+this.write(n.value)+", "+n.distance+")";case OpenLayers.Filter.Spatial.WITHIN:return"WITHIN("+n.property+", "+this.write(n.value)+")";case OpenLayers.Filter.Spatial.INTERSECTS:return"INTERSECTS("+n.property+", "+this.write(n.value)+")";case OpenLayers.Filter.Spatial.CONTAINS:return"CONTAINS("+n.property+", "+this.write(n.value)+")";default:throw Error("Unknown spatial filter type: "+n.type);}case"OpenLayers.Filter.Logical":if(n.type==OpenLayers.Filter.Logical.NOT)return"NOT ("+this.write(n.filters[0])+")";for(var t="(",r=!0,i=0;n.filters.length>i;i++)r?r=!1:t+=") "+f[n.type]+" (",t+=this.write(n.filters[i]);return t+")";case"OpenLayers.Filter.Comparison":return n.type==OpenLayers.Filter.Comparison.BETWEEN?n.property+" BETWEEN "+this.write(n.lowerBoundary)+" AND "+this.write(n.upperBoundary):n.property+" "+u[n.type]+" "+this.write(n.value);case void 0:if("string"==typeof n)return"'"+n+"'";if("number"==typeof n)return n+"";default:throw Error("Can't encode: "+n.CLASS_NAME+" "+n);}},CLASS_NAME:"OpenLayers.Format.CQL"})}();OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesplit","split","aftersplit"],layer:null,source:null,sourceOptions:null,tolerance:null,edge:!0,deferDelete:!1,mutual:!0,targetFilter:null,sourceFilter:null,handler:null,initialize:function(n){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[n]);this.options=n||{};this.options.source&&this.setSource(this.options.source)},setSource:function(n){this.active?(this.deactivate(),this.handler&&(this.handler.destroy(),delete this.handler),this.source=n,this.activate()):this.source=n},activate:function(){var n=OpenLayers.Control.prototype.activate.call(this);return n&&(this.source?this.source.events&&this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this}):(this.handler||(this.handler=new OpenLayers.Handler.Path(this,{done:function(n){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(n)})}},{layerOptions:this.sourceOptions})),this.handler.activate())),n},deactivate:function(){var n=OpenLayers.Control.prototype.deactivate.call(this);return n&&this.source&&this.source.events&&this.layer.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this}),n},onSketchComplete:function(n){return this.feature=null,!this.considerSplit(n.feature)},afterFeatureModified:function(n){if(n.modified){var t=n.feature;(t.geometry instanceof OpenLayers.Geometry.LineString||t.geometry instanceof OpenLayers.Geometry.MultiLineString)&&(this.feature=n.feature,this.considerSplit(n.feature))}},removeByGeometry:function(n,t){for(var i=0,r=n.length;r>i;++i)if(n[i].geometry===t){n.splice(i,1);break}},isEligible:function(n){return n.state!==OpenLayers.State.DELETE&&(n.geometry instanceof OpenLayers.Geometry.LineString||n.geometry instanceof OpenLayers.Geometry.MultiLineString)&&this.feature!==n&&(!this.targetFilter||this.targetFilter.evaluate(n.attributes))},considerSplit:function(n){var v=!1,w=!1,o,s,t,a;if(!this.sourceFilter||this.sourceFilter.evaluate(n.attributes)){for(var y,i,b,f,r,p,h,k=this.layer&&this.layer.features||[],e=[],c=[],d=this.layer===this.source&&this.mutual,nt={edge:this.edge,tolerance:this.tolerance,mutual:d},u=[n.geometry],t=0,a=k.length;a>t;++t)if(f=k[t],this.isEligible(f)){for(r=[f.geometry],o=0;u.length>o;++o)for(p=u[o],s=0;r.length>s;++s)y=r[s],p.getBounds().intersectsBounds(y.getBounds())&&(i=p.split(y,nt),i&&(b=this.events.triggerEvent("beforesplit",{source:n,target:f}),b!==!1&&(d&&(h=i[0],h.length>1&&(h.unshift(o,1),Array.prototype.splice.apply(u,h),o+=h.length-3),i=i[1]),i.length>1&&(i.unshift(s,1),Array.prototype.splice.apply(r,i),s+=i.length-3))));r&&r.length>1&&(this.geomsToFeatures(f,r),this.events.triggerEvent("split",{original:f,features:r}),Array.prototype.push.apply(e,r),c.push(f),w=!0)}if(u&&u.length>1&&(this.geomsToFeatures(n,u),this.events.triggerEvent("split",{original:n,features:u}),Array.prototype.push.apply(e,u),c.push(n),v=!0),v||w){if(this.deferDelete){for(var l,g=[],t=0,a=c.length;a>t;++t)l=c[t],l.state===OpenLayers.State.INSERT?g.push(l):(l.state=OpenLayers.State.DELETE,this.layer.drawFeature(l));for(this.layer.destroyFeatures(g,{silent:!0}),t=0,a=e.length;a>t;++t)e[t].state=OpenLayers.State.INSERT}else this.layer.destroyFeatures(c,{silent:!0});this.layer.addFeatures(e,{silent:!0});this.events.triggerEvent("aftersplit",{source:n,features:e})}}return v},geomsToFeatures:function(n,t){var u=n.clone(),r,i,f;for(delete u.geometry,i=0,f=t.length;f>i;++i)r=u.clone(),r.geometry=t[i],r.state=OpenLayers.State.INSERT,t[i]=r},destroy:function(){this.active&&this.deactivate();OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"});OpenLayers.Layer.WMTS=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,version:"1.0.0",requestEncoding:"KVP",url:null,layer:null,matrixSet:null,style:null,format:"image/jpeg",tileOrigin:null,tileFullExtent:null,formatSuffix:null,matrixIds:null,dimensions:null,params:null,zoomOffset:0,formatSuffixMap:{"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"},matrix:null,initialize:function(n){var r,u,i,f,t;for(r in{url:!0,layer:!0,style:!0,matrixSet:!0})if(!(r in n))throw Error("Missing property '"+r+"' in layer configuration.");if(n.params=OpenLayers.Util.upperCaseObject(n.params),u=[n.name,n.url,n.params,n],(OpenLayers.Layer.Grid.prototype.initialize.apply(this,u),this.formatSuffix||(this.formatSuffix=this.formatSuffixMap[this.format]||this.format.split("/").pop()),this.matrixIds)&&(i=this.matrixIds.length,i&&"string"==typeof this.matrixIds[0]))for(f=this.matrixIds,this.matrixIds=Array(i),t=0;i>t;++t)this.matrixIds[t]={identifier:f[t]}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.updateMatrixProperties()},updateMatrixProperties:function(){this.matrix=this.getMatrix();this.matrix&&(this.matrix.topLeftCorner&&(this.tileOrigin=this.matrix.topLeftCorner),this.matrix.tileWidth&&this.matrix.tileHeight&&(this.tileSize=new OpenLayers.Size(this.matrix.tileWidth,this.matrix.tileHeight)),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.top)),this.tileFullExtent||(this.tileFullExtent=this.maxExtent))},moveTo:function(n,t){return(t||!this.matrix)&&this.updateMatrixProperties(),OpenLayers.Layer.Grid.prototype.moveTo.apply(this,arguments)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.WMTS(this.options)),n=OpenLayers.Layer.Grid.prototype.clone.apply(this,[n])},getMatrix:function(){var n;if(this.matrixIds&&0!==this.matrixIds.length)if("scaleDenominator"in this.matrixIds[0])for(var i,u=OpenLayers.METERS_PER_INCH*OpenLayers.INCHES_PER_UNIT[this.units]*this.map.getResolution()/.00028,r=Number.POSITIVE_INFINITY,t=0,f=this.matrixIds.length;f>t;++t)i=Math.abs(1-this.matrixIds[t].scaleDenominator/u),r>i&&(r=i,n=this.matrixIds[t]);else n=this.matrixIds[this.map.getZoom()+this.zoomOffset];else n={identifier:this.map.getZoom()+this.zoomOffset};return n},getTileInfo:function(n){var t=this.map.getResolution(),i=(n.lon-this.tileOrigin.lon)/(t*this.tileSize.w),r=(this.tileOrigin.lat-n.lat)/(t*this.tileSize.h),u=Math.floor(i),f=Math.floor(r);return{col:u,row:f,i:Math.floor((i-u)*this.tileSize.w),j:Math.floor((r-f)*this.tileSize.h)}},getURL:function(n){var t,f,r,i,u,e;if(n=this.adjustBounds(n),t="",!this.tileFullExtent||this.tileFullExtent.intersectsBounds(n))if(f=n.getCenterLonLat(),r=this.getTileInfo(f),this.matrix.identifier,"REST"===this.requestEncoding.toUpperCase()){if(i=this.version+"/"+this.layer+"/"+this.style+"/",this.dimensions)for(u=0;this.dimensions.length>u;u++)this.params[this.dimensions[u]]&&(i=i+this.params[this.dimensions[u]]+"/");i=i+this.matrixSet+"/"+this.matrix.identifier+"/"+r.row+"/"+r.col+"."+this.formatSuffix;t=OpenLayers.Util.isArray(this.url)?this.selectUrl(i,this.url):this.url;t.match(/\/$/)||(t+="/");t+=i}else"KVP"===this.requestEncoding.toUpperCase()&&(e={SERVICE:"WMTS",REQUEST:"GetTile",VERSION:this.version,LAYER:this.layer,STYLE:this.style,TILEMATRIXSET:this.matrixSet,TILEMATRIX:this.matrix.identifier,TILEROW:r.row,TILECOL:r.col,FORMAT:this.format},t=OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,[e]));return t},mergeNewParams:function(n){if("KVP"===this.requestEncoding.toUpperCase())return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,[OpenLayers.Util.upperCaseObject(n)])},CLASS_NAME:"OpenLayers.Layer.WMTS"});OpenLayers.Protocol.SOS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol,{fois:null,formatOptions:null,initialize:function(n){OpenLayers.Protocol.prototype.initialize.apply(this,[n]);n.format||(this.format=new OpenLayers.Format.SOSGetFeatureOfInterest(this.formatOptions))},destroy:function(){this.options&&!this.options.format&&this.format.destroy();this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(n){n=OpenLayers.Util.extend({},n);OpenLayers.Util.applyDefaults(n,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.format,r=OpenLayers.Format.XML.prototype.write.apply(i,[i.writeNode("sos:GetFeatureOfInterest",{fois:this.fois})]);return t.priv=OpenLayers.Request.POST({url:n.url,callback:this.createCallback(this.handleRead,t,n),data:r}),t},handleRead:function(n,t){if(t.callback){var i=n.priv;i.status>=200&&300>i.status?(n.features=this.parseFeatures(i),n.code=OpenLayers.Protocol.Response.SUCCESS):n.code=OpenLayers.Protocol.Response.FAILURE;t.callback.call(t.scope,n)}},parseFeatures:function(n){var t=n.responseXML;return t&&t.documentElement||(t=n.responseText),!t||0>=t.length?null:this.format.read(t)},CLASS_NAME:"OpenLayers.Protocol.SOS.v1_0_0"});OpenLayers.Layer.KaMapCache=OpenLayers.Class(OpenLayers.Layer.KaMap,{IMAGE_EXTENSIONS:{jpeg:"jpg",gif:"gif",png:"png",png8:"png",png24:"png",dithered:"png"},DEFAULT_FORMAT:"jpeg",initialize:function(){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments);this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||DEFAULT_FORMAT]},getURL:function(n){var f;n=this.adjustBounds(n);var i=this.map.getResolution(),e=Math.round(1e4*this.map.getScale())/1e4,r=Math.round(n.left/i),u=-Math.round(n.top/i),o=Math.floor(r/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w,s=Math.floor(u/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h,t=this.url;return OpenLayers.Util.isArray(t)&&(t=this.selectUrl(paramsString,t)),f=[t,"/",this.params.map,"/",e,"/",this.params.g.replace(/\s/g,"_"),"/def/t",s,"/l",o,"/t",u,"l",r,".",this.extension],f.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.1.0",initialize:function(){OpenLayers.Protocol.WFS.v1.prototype.initialize.apply(this,arguments);this.outputFormat&&!this.readFormat&&("gml2"==this.outputFormat.toLowerCase()?this.readFormat=new OpenLayers.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName}):"json"==this.outputFormat.toLowerCase()&&(this.readFormat=new OpenLayers.Format.GeoJSON))},CLASS_NAME:"OpenLayers.Protocol.WFS.v1_1_0"});OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.1",initialize:function(n){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[n])},readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(n,t){t.srs[this.getChildValue(n)]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1"});OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1_1,{version:"1.1.1",profile:"WMSC",initialize:function(n){OpenLayers.Format.WMSCapabilities.v1_1_1.prototype.initialize.apply(this,[n])},readers:{wms:OpenLayers.Util.applyDefaults({VendorSpecificCapabilities:function(n,t){t.vendorSpecific={tileSets:[]};this.readChildNodes(n,t.vendorSpecific)},TileSet:function(n,t){var i={srs:{},bbox:{},resolutions:[]};this.readChildNodes(n,i);t.tileSets.push(i)},Resolutions:function(n,t){for(var r=this.getChildValue(n).split(" "),i=0,u=r.length;u>i;i++)""!=r[i]&&t.resolutions.push(parseFloat(r[i]))},Width:function(n,t){t.width=parseInt(this.getChildValue(n))},Height:function(n,t){t.height=parseInt(this.getChildValue(n))},Layers:function(n,t){t.layers=this.getChildValue(n)},Styles:function(n,t){t.styles=this.getChildValue(n)}},OpenLayers.Format.WMSCapabilities.v1_1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC"});OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.0",initialize:function(n){OpenLayers.Format.WMSCapabilities.v1_1.prototype.initialize.apply(this,[n])},readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(n,t){for(var u=this.getChildValue(n),r=u.split(/ +/),i=0,f=r.length;f>i;i++)t.srs[r[i]]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"});OpenLayers.Layer.WFS=OpenLayers.Class(OpenLayers.Layer.Vector,OpenLayers.Layer.Markers,{isBaseLayer:!1,tile:null,ratio:2,DEFAULT_PARAMS:{service:"WFS",version:"1.0.0",request:"GetFeature"},featureClass:null,format:null,formatObject:null,formatOptions:null,vectorMode:!0,encodeBBOX:!1,extractAttributes:!1,initialize:function(n,t,i,r){void 0==r&&(r={});!r.featureClass&&OpenLayers.Layer.Vector&&OpenLayers.Feature.Vector||(this.vectorMode=!1);i=OpenLayers.Util.upperCaseObject(i);OpenLayers.Util.extend(r,{reportError:!1});var u=[];u.push(n,r);OpenLayers.Layer.Vector.prototype.initialize.apply(this,u);this.renderer&&this.vectorMode||(this.vectorMode=!1,r.featureClass||(r.featureClass=OpenLayers.Feature.WFS),OpenLayers.Layer.Markers.prototype.initialize.apply(this,u));this.params&&this.params.typename&&!this.options.typename&&(this.options.typename=this.params.typename);this.options.geometry_column||(this.options.geometry_column="the_geom");this.params=OpenLayers.Util.applyDefaults(i,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));this.url=t},destroy:function(){this.vectorMode?OpenLayers.Layer.Vector.prototype.destroy.apply(this,arguments):OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.tile&&this.tile.destroy();this.tile=null;this.ratio=null;this.featureClass=null;this.format=null;this.formatObject&&this.formatObject.destroy&&this.formatObject.destroy();this.formatObject=null;this.formatOptions=null;this.vectorMode=null;this.encodeBBOX=null;this.extractAttributes=null},setMap:function(){if(this.vectorMode){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);var n={extractAttributes:this.extractAttributes};OpenLayers.Util.extend(n,this.formatOptions);this.map&&!this.projection.equals(this.map.getProjectionObject())&&(n.externalProjection=this.projection,n.internalProjection=this.map.getProjectionObject());this.formatObject=this.format?new this.format(n):new OpenLayers.Format.GML(n)}else OpenLayers.Layer.Markers.prototype.setMap.apply(this,arguments)},moveTo:function(n,t,i){var o,l,e;if(this.vectorMode?OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments):OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),i)return!1;if(t&&this.vectorMode&&this.renderer.clear(),this.options.minZoomLevel&&(OpenLayers.Console.warn(OpenLayers.i18n("minZoomLevelError")),this.map.getZoom()<this.options.minZoomLevel))return null;if(null==n&&(n=this.map.getExtent()),o=null==this.tile,l=!o&&!this.tile.bounds.containsBounds(n),t||o||!i&&l){var f=n.getCenterLonLat(),a=n.getWidth()*this.ratio,v=n.getHeight()*this.ratio,r=new OpenLayers.Bounds(f.lon-a/2,f.lat-v/2,f.lon+a/2,f.lat+v/2),u=this.map.getSize();u.w=u.w*this.ratio;u.h=u.h*this.ratio;var p=new OpenLayers.LonLat(r.left,r.top),y=this.map.getLayerPxFromLonLat(p),s=this.getFullRequestString(),h=null,c=this.params.filter||this.params.FILTER;(h=c?{FILTER:c}:{BBOX:this.encodeBBOX?r.toBBOX():r.toArray()},this.map&&!this.projection.equals(this.map.getProjectionObject()))&&(e=r.clone(),e.transform(this.map.getProjectionObject(),this.projection),c||(h.BBOX=this.encodeBBOX?e.toBBOX():e.toArray()));s+="&"+OpenLayers.Util.getParameterString(h);this.tile?(this.vectorMode?(this.destroyFeatures(),this.renderer.clear()):this.clearMarkers(),this.removeTileMonitoringHooks(this.tile),this.tile.destroy(),this.tile=null,this.tile=new OpenLayers.Tile.WFS(this,y,r,s,u),this.addTileMonitoringHooks(this.tile),this.tile.draw()):(this.tile=new OpenLayers.Tile.WFS(this,y,r,s,u),this.addTileMonitoringHooks(this.tile),this.tile.draw())}},addTileMonitoringHooks:function(n){n.onLoadStart=function(){this==this.layer.tile&&this.layer.events.triggerEvent("loadstart")};n.events.register("loadstart",n,n.onLoadStart);n.onLoadEnd=function(){this==this.layer.tile&&(this.layer.events.triggerEvent("tileloaded"),this.layer.events.triggerEvent("loadend"))};n.events.register("loadend",n,n.onLoadEnd);n.events.register("unload",n,n.onLoadEnd)},removeTileMonitoringHooks:function(n){n.unload();n.events.un({loadstart:n.onLoadStart,loadend:n.onLoadEnd,unload:n.onLoadEnd,scope:n})},onMapResize:function(){this.vectorMode?OpenLayers.Layer.Vector.prototype.onMapResize.apply(this,arguments):OpenLayers.Layer.Markers.prototype.onMapResize.apply(this,arguments)},display:function(){this.vectorMode?OpenLayers.Layer.Vector.prototype.display.apply(this,arguments):OpenLayers.Layer.Markers.prototype.display.apply(this,arguments)},mergeNewParams:function(n){var t=OpenLayers.Util.upperCaseObject(n),i=[t];return OpenLayers.Layer.HTTPRequest.prototype.mergeNewParams.apply(this,i)},clone:function(n){return null==n&&(n=new OpenLayers.Layer.WFS(this.name,this.url,this.params,this.getOptions())),n=this.vectorMode?OpenLayers.Layer.Vector.prototype.clone.apply(this,[n]):OpenLayers.Layer.Markers.prototype.clone.apply(this,[n])},getFullRequestString:function(){var n=this.projection.getCode()||this.map.getProjection();return this.params.SRS="none"==n?null:n,OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},commit:function(){var n,t;this.writer||(n={},this.map&&!this.projection.equals(this.map.getProjectionObject())&&(n.externalProjection=this.projection,n.internalProjection=this.map.getProjectionObject()),this.writer=new OpenLayers.Format.WFS(n,this));t=this.writer.write(this.features);OpenLayers.Request.POST({url:this.url,data:t,success:this.commitSuccess,failure:this.commitFailure,scope:this})},commitSuccess:function(n){var t=n.responseText,i;if(-1!=t.indexOf("SUCCESS"))for(this.commitReport(OpenLayers.i18n("commitSuccess",{response:t})),i=0;this.features.length>i;i++)this.features[i].state=null;else(-1!=t.indexOf("FAILED")||-1!=t.indexOf("Exception"))&&this.commitReport(OpenLayers.i18n("commitFailed",{response:t}))},commitFailure:function(){},commitReport:function(n){OpenLayers.Console.userError(n)},refresh:function(){this.tile&&(this.vectorMode?(this.renderer.clear(),this.features.length=0):(this.clearMarkers(),this.markers.length=0),this.tile.draw())},getDataExtent:function(){return this.vectorMode?OpenLayers.Layer.Vector.prototype.getDataExtent.apply(this):OpenLayers.Layer.Markers.prototype.getDataExtent.apply(this)},setOpacity:function(n){this.vectorMode?OpenLayers.Layer.Vector.prototype.setOpacity.apply(this,[n]):OpenLayers.Layer.Markers.prototype.setOpacity.apply(this,[n])},CLASS_NAME:"OpenLayers.Layer.WFS"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{roundedCorner:!0,roundedCornerColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:!0,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[]},destroy:function(){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(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})},draw:function(){return OpenLayers.Control.prototype.draw.apply(this),this.loadContents(),this.outsideViewport||this.minimizeControl(),this.redraw(),this.div},clearLayersArray:function(n){var i=this[n+"Layers"],t,u,r;if(i)for(t=0,u=i.length;u>t;t++)r=i[t],OpenLayers.Event.stopObservingElement(r.inputElem),OpenLayers.Event.stopObservingElement(r.labelSpan);this[n+"LayersDiv"].innerHTML="";this[n+"Layers"]=[]},checkRedraw:function(){var r=!1,n,u,t,i;if(this.layerStates.length&&this.map.layers.length==this.layerStates.length){for(n=0,u=this.layerStates.length;u>n;n++)if(t=this.layerStates[n],i=this.map.layers[n],t.name!=i.name||t.inRange!=i.inRange||t.id!=i.id||t.visibility!=i.visibility){r=!0;break}}else r=!0;return r},redraw:function(){var e,r,f,n,i,s,t,h,u,a,v,o;if(!this.checkRedraw())return this.div;this.clearLayersArray("base");this.clearLayersArray("data");var c=!1,l=!1,f=this.map.layers.length;for(this.layerStates=Array(f),r=0;f>r;r++)n=this.map.layers[r],this.layerStates[r]={name:n.name,visibility:n.visibility,inRange:n.inRange,id:n.id};for(e=this.map.layers.slice(),this.ascending||e.reverse(),r=0,f=e.length;f>r;r++)n=e[r],i=n.isBaseLayer,n.displayInLayerSwitcher&&(i?l=!0:c=!0,s=i?n==this.map.baseLayer:n.getVisibility(),t=document.createElement("input"),t.id=this.id+"_input_"+n.name,t.name=i?this.id+"_baseLayers":n.name,t.type=i?"radio":"checkbox",t.value=n.name,t.checked=s,t.defaultChecked=s,i||n.inRange||(t.disabled=!0),h={inputElem:t,layer:n,layerSwitcher:this},OpenLayers.Event.observe(t,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,h)),u=document.createElement("span"),OpenLayers.Element.addClass(u,"labelSpan"),i||n.inRange||(u.style.color="gray"),u.innerHTML=n.name,u.style.verticalAlign=i?"bottom":"baseline",OpenLayers.Event.observe(u,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,h)),a=document.createElement("br"),v=i?this.baseLayers:this.dataLayers,v.push({layer:n,inputElem:t,labelSpan:u}),o=i?this.baseLayersDiv:this.dataLayersDiv,o.appendChild(t),o.appendChild(u),o.appendChild(a));return this.dataLbl.style.display=c?"":"none",this.baseLbl.style.display=l?"":"none",this.div},onInputClick:function(n){this.inputElem.disabled||("radio"==this.inputElem.type?(this.inputElem.checked=!0,this.layer.map.setBaseLayer(this.layer)):(this.inputElem.checked=!this.inputElem.checked,this.layerSwitcher.updateMap()));OpenLayers.Event.stop(n)},onLayerClick:function(){this.updateMap()},updateMap:function(){for(var t,n=0,i=this.baseLayers.length;i>n;n++)t=this.baseLayers[n],t.inputElem.checked&&this.map.setBaseLayer(t.layer,!1);for(n=0,i=this.dataLayers.length;i>n;n++)t=this.dataLayers[n],t.layer.setVisibility(t.inputElem.checked)},maximizeControl:function(n){this.div.style.width="";this.div.style.height="";this.showControls(!1);null!=n&&OpenLayers.Event.stop(n)},minimizeControl:function(n){this.div.style.width="0px";this.div.style.height="0px";this.showControls(!0);null!=n&&OpenLayers.Event.stop(n)},showControls:function(n){this.maximizeDiv.style.display=n?"":"none";this.minimizeDiv.style.display=n?"none":"";this.layersDiv.style.display=n?"none":""},loadContents:function(){var t,n;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";OpenLayers.Element.addClass(this.layersDiv,"layersDiv");this.baseLbl=document.createElement("div");this.baseLbl.innerHTML=OpenLayers.i18n("Base Layer");OpenLayers.Element.addClass(this.baseLbl,"baseLbl");this.baseLayersDiv=document.createElement("div");OpenLayers.Element.addClass(this.baseLayersDiv,"baseLayersDiv");this.dataLbl=document.createElement("div");this.dataLbl.innerHTML=OpenLayers.i18n("Overlays");OpenLayers.Element.addClass(this.dataLbl,"dataLbl");this.dataLayersDiv=document.createElement("div");OpenLayers.Element.addClass(this.dataLayersDiv,"dataLayersDiv");this.ascending?(this.layersDiv.appendChild(this.baseLbl),this.layersDiv.appendChild(this.baseLayersDiv),this.layersDiv.appendChild(this.dataLbl),this.layersDiv.appendChild(this.dataLayersDiv)):(this.layersDiv.appendChild(this.dataLbl),this.layersDiv.appendChild(this.dataLayersDiv),this.layersDiv.appendChild(this.baseLbl),this.layersDiv.appendChild(this.baseLayersDiv));this.div.appendChild(this.layersDiv);this.roundedCorner&&(OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.roundedCornerColor,blend:!1}),OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,.75));var i=OpenLayers.Util.getImagesLocation(),n=new OpenLayers.Size(18,18),t=i+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,n,t,"absolute");OpenLayers.Element.addClass(this.maximizeDiv,"maximizeDiv");this.maximizeDiv.style.display="none";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);t=i+"layer-switcher-minimize.png";n=new OpenLayers.Size(18,18);this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,n,t,"absolute");OpenLayers.Element.addClass(this.minimizeDiv,"minimizeDiv");this.minimizeDiv.style.display="none";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv)},ignoreEvent:function(n){OpenLayers.Event.stop(n)},mouseDown:function(n){this.isMouseDown=!0;this.ignoreEvent(n)},mouseUp:function(n){this.isMouseDown&&(this.isMouseDown=!1,this.ignoreEvent(n))},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Format.WFS=OpenLayers.Class(OpenLayers.Format.GML,{layer:null,wfsns:"http://www.opengis.net/wfs",ogcns:"http://www.opengis.net/ogc",initialize:function(n,t){OpenLayers.Format.GML.prototype.initialize.apply(this,[n]);this.layer=t;this.layer.featureNS&&(this.featureNS=this.layer.featureNS);this.layer.options.geometry_column&&(this.geometryName=this.layer.options.geometry_column);this.layer.options.typename&&(this.featureName=this.layer.options.typename)},write:function(n){var i=this.createElementNS(this.wfsns,"wfs:Transaction"),t;for(i.setAttribute("version","1.0.0"),i.setAttribute("service","WFS"),t=0;n.length>t;t++)switch(n[t].state){case OpenLayers.State.INSERT:i.appendChild(this.insert(n[t]));break;case OpenLayers.State.UPDATE:i.appendChild(this.update(n[t]));break;case OpenLayers.State.DELETE:i.appendChild(this.remove(n[t]))}return OpenLayers.Format.XML.prototype.write.apply(this,[i])},createFeatureXML:function(n){var o=this.buildGeometryNode(n.geometry),f=this.createElementNS(this.featureNS,"feature:"+this.geometryName),i,t,e,r,u;f.appendChild(o);i=this.createElementNS(this.featureNS,"feature:"+this.featureName);i.appendChild(f);for(t in n.attributes)e=this.createTextNode(n.attributes[t]),r=t,-1!=t.search(":")&&(r=t.split(":")[1]),u=this.createElementNS(this.featureNS,"feature:"+r),u.appendChild(e),i.appendChild(u);return i},insert:function(n){var t=this.createElementNS(this.wfsns,"wfs:Insert");return t.appendChild(this.createFeatureXML(n)),t},update:function(n){var t,r,f,e,o,s;n.fid||OpenLayers.Console.userError(OpenLayers.i18n("noFID"));t=this.createElementNS(this.wfsns,"wfs:Update");t.setAttribute("typeName",this.featurePrefix+":"+this.featureName);t.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var i=this.createElementNS(this.wfsns,"wfs:Property"),u=this.createElementNS(this.wfsns,"wfs:Name"),h=this.createTextNode(this.geometryName);u.appendChild(h);i.appendChild(u);r=this.createElementNS(this.wfsns,"wfs:Value");f=this.buildGeometryNode(n.geometry);n.layer&&f.setAttribute("srsName",n.layer.projection.getCode());r.appendChild(f);i.appendChild(r);t.appendChild(i);for(e in n.attributes)i=this.createElementNS(this.wfsns,"wfs:Property"),u=this.createElementNS(this.wfsns,"wfs:Name"),u.appendChild(this.createTextNode(e)),i.appendChild(u),r=this.createElementNS(this.wfsns,"wfs:Value"),r.appendChild(this.createTextNode(n.attributes[e])),i.appendChild(r),t.appendChild(i);return o=this.createElementNS(this.ogcns,"ogc:Filter"),s=this.createElementNS(this.ogcns,"ogc:FeatureId"),s.setAttribute("fid",n.fid),o.appendChild(s),t.appendChild(o),t},remove:function(n){var t,i,r;return n.fid?(t=this.createElementNS(this.wfsns,"wfs:Delete"),t.setAttribute("typeName",this.featurePrefix+":"+this.featureName),t.setAttribute("xmlns:"+this.featurePrefix,this.featureNS),i=this.createElementNS(this.ogcns,"ogc:Filter"),r=this.createElementNS(this.ogcns,"ogc:FeatureId"),r.setAttribute("fid",n.fid),i.appendChild(r),t.appendChild(i),t):(OpenLayers.Console.userError(OpenLayers.i18n("noFID")),!1)},destroy:function(){this.layer=null},CLASS_NAME:"OpenLayers.Format.WFS"});OpenLayers.Format.Atom=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{atom:"http://www.w3.org/2005/Atom",georss:"http://www.georss.org/georss"},feedTitle:"untitled",defaultEntryTitle:"untitled",gmlParser:null,xy:!1,read:function(n){return"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n])),this.parseFeatures(n)},write:function(n){var t,i,r;if(OpenLayers.Util.isArray(n))for(t=this.createElementNSPlus("atom:feed"),t.appendChild(this.createElementNSPlus("atom:title",{value:this.feedTitle})),i=0,r=n.length;r>i;i++)t.appendChild(this.buildEntryNode(n[i]));else t=this.buildEntryNode(n);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},buildContentNode:function(n){var t=this.createElementNSPlus("atom:content",{attributes:{type:n.type||null}});if(n.src)t.setAttribute("src",n.src);else if("text"==n.type||null==n.type)t.appendChild(this.createTextNode(n.value));else if("html"==n.type){if("string"!=typeof n.value)throw"HTML content must be in form of an escaped string";t.appendChild(this.createTextNode(n.value))}else"xhtml"==n.type?t.appendChild(n.value):"xhtml"==n.type||n.type.match(/(\+|\/)xml$/)?t.appendChild(n.value):t.appendChild(this.createTextNode(n.value));return t},buildEntryNode:function(n){var f=n.attributes,t=f.atom||{},i=this.createElementNSPlus("atom:entry"),s;if(t.authors)for(var h=OpenLayers.Util.isArray(t.authors)?t.authors:[t.authors],r=0,e=h.length;e>r;r++)i.appendChild(this.buildPersonConstructNode("author",h[r]));if(t.categories)for(var o,c=OpenLayers.Util.isArray(t.categories)?t.categories:[t.categories],r=0,e=c.length;e>r;r++)o=c[r],i.appendChild(this.createElementNSPlus("atom:category",{attributes:{term:o.term,scheme:o.scheme||null,label:o.label||null}}));if(t.content&&i.appendChild(this.buildContentNode(t.content)),t.contributors)for(var l=OpenLayers.Util.isArray(t.contributors)?t.contributors:[t.contributors],r=0,e=l.length;e>r;r++)i.appendChild(this.buildPersonConstructNode("contributor",l[r]));if(n.fid&&i.appendChild(this.createElementNSPlus("atom:id",{value:n.fid})),t.links)for(var u,a=OpenLayers.Util.isArray(t.links)?t.links:[t.links],r=0,e=a.length;e>r;r++)u=a[r],i.appendChild(this.createElementNSPlus("atom:link",{attributes:{href:u.href,rel:u.rel||null,type:u.type||null,hreflang:u.hreflang||null,title:u.title||null,length:u.length||null}}));return(t.published&&i.appendChild(this.createElementNSPlus("atom:published",{value:t.published})),t.rights&&i.appendChild(this.createElementNSPlus("atom:rights",{value:t.rights})),(t.summary||f.description)&&i.appendChild(this.createElementNSPlus("atom:summary",{value:t.summary||f.description})),i.appendChild(this.createElementNSPlus("atom:title",{value:t.title||f.title||this.defaultEntryTitle})),t.updated&&i.appendChild(this.createElementNSPlus("atom:updated",{value:t.updated})),n.geometry)&&(s=this.createElementNSPlus("georss:where"),s.appendChild(this.buildGeometryNode(n.geometry)),i.appendChild(s)),i},initGmlParser:function(){this.gmlParser=new OpenLayers.Format.GML.v3({xy:this.xy,featureNS:"http://example.com#feature",internalProjection:this.internalProjection,externalProjection:this.externalProjection})},buildGeometryNode:function(n){this.gmlParser||this.initGmlParser();var t=this.gmlParser.writeNode("feature:_geometry",n);return t.firstChild},buildPersonConstructNode:function(n,t){var r=["uri","email"],u=this.createElementNSPlus("atom:"+n),i,f;for(u.appendChild(this.createElementNSPlus("atom:name",{value:t.name})),i=0,f=r.length;f>i;i++)t[r[i]]&&u.appendChild(this.createElementNSPlus("atom:"+r[i],{value:t[r[i]]}));return u},getFirstChildValue:function(n,t,i,r){var u=this.getElementsByTagNameNS(n,t,i);return u&&u.length>0?this.getChildValue(u[0],r):r},parseFeature:function(n){var i={},t=null,r=null,u=null,f=this.namespaces.atom,e,s,o,c;for(this.parsePersonConstructs(n,"author",i),r=this.getElementsByTagNameNS(n,f,"category"),r.length>0&&(i.categories=[]),e=0,s=r.length;s>e;e++)t={},t.term=r[e].getAttribute("term"),u=r[e].getAttribute("scheme"),u&&(t.scheme=u),u=r[e].getAttribute("label"),u&&(t.label=u),i.categories.push(t);r=this.getElementsByTagNameNS(n,f,"content");r.length>0&&(t={},u=r[0].getAttribute("type"),u&&(t.type=u),u=r[0].getAttribute("src"),u?t.src=u:(t.value="text"==t.type||"html"==t.type||null==t.type?this.getFirstChildValue(n,f,"content",null):"xhtml"==t.type||t.type.match(/(\+|\/)xml$/)?this.getChildEl(r[0]):this.getFirstChildValue(n,f,"content",null),i.content=t));this.parsePersonConstructs(n,"contributor",i);i.id=this.getFirstChildValue(n,f,"id",null);r=this.getElementsByTagNameNS(n,f,"link");r.length>0&&(i.links=Array(r.length));for(var h=["rel","type","hreflang","title","length"],e=0,s=r.length;s>e;e++){for(t={},t.href=r[e].getAttribute("href"),o=0,c=h.length;c>o;o++)u=r[e].getAttribute(h[o]),u&&(t[h[o]]=u);i.links[e]=t}t=this.getFirstChildValue(n,f,"published",null);t&&(i.published=t);t=this.getFirstChildValue(n,f,"rights",null);t&&(i.rights=t);t=this.getFirstChildValue(n,f,"summary",null);t&&(i.summary=t);i.title=this.getFirstChildValue(n,f,"title",null);i.updated=this.getFirstChildValue(n,f,"updated",null);var a={title:i.title,description:i.summary,atom:i},v=this.parseLocations(n)[0],l=new OpenLayers.Feature.Vector(v,a);return l.fid=i.id,l},parseFeatures:function(n){var r=[],t=this.getElementsByTagNameNS(n,this.namespaces.atom,"entry"),i,u;for(0==t.length&&(t=[n]),i=0,u=t.length;u>i;i++)r.push(this.parseFeature(t[i]));return r},parseLocations:function(n){var l=this.namespaces.georss,p={components:[]},a=this.getElementsByTagNameNS(n,l,"where"),u,e,o,s,c,f,v,h,r,y,t,i;if(a&&a.length>0)for(this.gmlParser||this.initGmlParser(),t=0,i=a.length;i>t;t++)this.gmlParser.readChildNodes(a[t],p);if(u=p.components,e=this.getElementsByTagNameNS(n,l,"point"),e&&e.length>0)for(t=0,i=e.length;i>t;t++)o=OpenLayers.String.trim(e[t].firstChild.nodeValue).split(/\s+/),2!=o.length&&(o=OpenLayers.String.trim(e[t].firstChild.nodeValue).split(/\s*,\s*/)),u.push(new OpenLayers.Geometry.Point(parseFloat(o[1]),parseFloat(o[0])));if(s=this.getElementsByTagNameNS(n,l,"line"),s&&s.length>0)for(t=0,i=s.length;i>t;t++){for(f=OpenLayers.String.trim(s[t].firstChild.nodeValue).split(/\s+/),h=[],r=0,y=f.length;y>r;r+=2)v=new OpenLayers.Geometry.Point(parseFloat(f[r+1]),parseFloat(f[r])),h.push(v);u.push(new OpenLayers.Geometry.LineString(h))}if(c=this.getElementsByTagNameNS(n,l,"polygon"),c&&c.length>0)for(t=0,i=c.length;i>t;t++){for(f=OpenLayers.String.trim(c[t].firstChild.nodeValue).split(/\s+/),h=[],r=0,y=f.length;y>r;r+=2)v=new OpenLayers.Geometry.Point(parseFloat(f[r+1]),parseFloat(f[r])),h.push(v);u.push(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(u)]))}if(this.internalProjection&&this.externalProjection)for(t=0,i=u.length;i>t;t++)u[t]&&u[t].transform(this.externalProjection,this.internalProjection);return u},parsePersonConstructs:function(n,t,i){for(var f,r,l,c,e=[],o=this.namespaces.atom,s=this.getElementsByTagNameNS(n,o,t),h=["uri","email"],u=0,a=s.length;a>u;u++){for(f={},f.name=this.getFirstChildValue(s[u],o,"name",null),r=0,l=h.length;l>r;r++)c=this.getFirstChildValue(s[u],o,h[r],null),c&&(f[h[r]]=c);e.push(f)}e.length>0&&(i[t+"s"]=e)},CLASS_NAME:"OpenLayers.Format.Atom"});OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,slideFactor:75,draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress})},defaultKeyPress:function(n){var t;switch(n.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:t=this.map.getSize();this.map.pan(0,-.75*t.h);break;case 34:t=this.map.getSize();this.map.pan(0,.75*t.h);break;case 35:t=this.map.getSize();this.map.pan(.75*t.w,0);break;case 36:t=this.map.getSize();this.map.pan(-.75*t.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut()}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(n){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[n])},read_wmc_SRS:function(n,t){var u=this.getChildValue(t);"object"!=typeof n.projections&&(n.projections={});for(var r=u.split(/ +/),i=0,f=r.length;f>i;i++)n.projections[r[i]]=!0},write_wmc_Layer:function(n){var t=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[n]),i,r;if(n.srs){i=[];for(r in n.srs)i.push(r);t.appendChild(this.createElementDefaultNS("SRS",i.join(" ")))}t.appendChild(this.write_wmc_FormatList(n));t.appendChild(this.write_wmc_StyleList(n));n.dimensions&&t.appendChild(this.write_wmc_DimensionList(n));t.appendChild(this.write_wmc_LayerExtension(n))},CLASS_NAME:"OpenLayers.Format.WMC.v1_0_0"});OpenLayers.Feature.WFS=OpenLayers.Class(OpenLayers.Feature,{initialize:function(n,t){var i=arguments,r=this.processXMLNode(t);i=[n,r.lonlat,r];OpenLayers.Feature.prototype.initialize.apply(this,i);this.createMarker();this.layer.addMarker(this.marker)},destroy:function(){null!=this.marker&&this.layer.removeMarker(this.marker);OpenLayers.Feature.prototype.destroy.apply(this,arguments)},processXMLNode:function(n){var i=OpenLayers.Ajax.getElementsByTagNameNS(n,"http://www.opengis.net/gml","gml","Point"),r=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(i[0],"http://www.opengis.net/gml","gml","coordinates")[0]),t=r.split(",");return{lonlat:new OpenLayers.LonLat(parseFloat(t[0]),parseFloat(t[1])),id:null}},CLASS_NAME:"OpenLayers.Feature.WFS"});OpenLayers.Format.WMTSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1_1_0,{version:"1.0.0",namespaces:{ows:"http://www.opengis.net/ows/1.1",wmts:"http://www.opengis.net/wmts/1.0",xlink:"http://www.w3.org/1999/xlink"},yx:null,defaultPrefix:"wmts",initialize:function(n){OpenLayers.Format.XML.prototype.initialize.apply(this,[n]);this.options=n;var t=OpenLayers.Util.extend({},OpenLayers.Format.WMTSCapabilities.prototype.yx);this.yx=OpenLayers.Util.extend(t,this.yx)},read:function(n){"string"==typeof n&&(n=OpenLayers.Format.XML.prototype.read.apply(this,[n]));n&&9==n.nodeType&&(n=n.documentElement);var t={};return this.readNode(n,t),t.version=this.version,t},readers:{wmts:{Capabilities:function(n,t){this.readChildNodes(n,t)},Contents:function(n,t){t.contents={};t.contents.layers=[];t.contents.tileMatrixSets={};this.readChildNodes(n,t.contents)},Layer:function(n,t){var i={styles:[],formats:[],tileMatrixSetLinks:[]};i.layers=[];this.readChildNodes(n,i);t.layers.push(i)},Style:function(n,t){var i={};i.isDefault="true"===n.getAttribute("isDefault");this.readChildNodes(n,i);t.styles.push(i)},Format:function(n,t){t.formats.push(this.getChildValue(n))},TileMatrixSetLink:function(n,t){var i={};this.readChildNodes(n,i);t.tileMatrixSetLinks.push(i)},TileMatrixSet:function(n,t){if(t.layers){var i={matrixIds:[]};this.readChildNodes(n,i);t.tileMatrixSets[i.identifier]=i}else t.tileMatrixSet=this.getChildValue(n)},TileMatrix:function(n,t){var i={supportedCRS:t.supportedCRS};this.readChildNodes(n,i);t.matrixIds.push(i)},ScaleDenominator:function(n,t){t.scaleDenominator=parseFloat(this.getChildValue(n))},TopLeftCorner:function(n,t){var r,f=this.getChildValue(n),i=f.split(" "),u;t.supportedCRS&&(u=t.supportedCRS.replace(/urn:ogc:def:crs:(\w+):.+:(\w+)$/,"urn:ogc:def:crs:$1::$2"),r=!!this.yx[u]);t.topLeftCorner=r?new OpenLayers.LonLat(i[1],i[0]):new OpenLayers.LonLat(i[0],i[1])},TileWidth:function(n,t){t.tileWidth=parseInt(this.getChildValue(n))},TileHeight:function(n,t){t.tileHeight=parseInt(this.getChildValue(n))},MatrixWidth:function(n,t){t.matrixWidth=parseInt(this.getChildValue(n))},MatrixHeight:function(n,t){t.matrixHeight=parseInt(this.getChildValue(n))},ResourceURL:function(n,t){t.resourceUrl=t.resourceUrl||{};t.resourceUrl[n.getAttribute("resourceType")]={format:n.getAttribute("format"),template:n.getAttribute("template")}},WSDL:function(n,t){t.wsdl={};t.wsdl.href=n.getAttribute("xlink:href")},ServiceMetadataURL:function(n,t){t.serviceMetadataUrl={};t.serviceMetadataUrl.href=n.getAttribute("xlink:href")}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities.v1_0_0"});!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):n("object"==typeof exports?require("jquery"):jQuery)}(function(n){var t=function(){var t;return n&&n.fn&&n.fn.select2&&n.fn.select2.amd&&(t=n.fn.select2.amd),function(){if(!t||!t.requirejs){t?i=t:t={};var n,i,r;!function(t){function e(n,t){return nt.call(n,t)}function c(n,t){var e,s,o,r,h,y,c,w,i,l,p,u=t&&t.split("/"),a=f.map,v=a&&a["*"]||{};if(n&&"."===n.charAt(0))if(t){for(n=n.split("/"),h=n.length-1,f.nodeIdCompat&&b.test(n[h])&&(n[h]=n[h].replace(b,"")),n=u.slice(0,u.length-1).concat(n),i=0;i<n.length;i+=1)if(p=n[i],"."===p)n.splice(i,1),i-=1;else if(".."===p){if(1===i&&(".."===n[2]||".."===n[0]))break;i>0&&(n.splice(i-1,2),i-=2)}n=n.join("/")}else 0===n.indexOf("./")&&(n=n.substring(2));if((u||v)&&a){for(e=n.split("/"),i=e.length;i>0;i-=1){if(s=e.slice(0,i).join("/"),u)for(l=u.length;l>0;l-=1)if(o=a[u.slice(0,l).join("/")],o&&(o=o[s])){r=o;y=i;break}if(r)break;!c&&v&&v[s]&&(c=v[s],w=i)}!r&&c&&(r=c,y=w);r&&(e.splice(0,y,r),n=e.join("/"))}return n}function p(n,i){return function(){var r=tt.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),o.apply(t,r.concat([n,i]))}}function k(n){return function(t){return c(t,n)}}function d(n){return function(t){u[n]=t}}function l(n){if(e(h,n)){var i=h[n];delete h[n];y[n]=!0;a.apply(t,i)}if(!e(u,n)&&!e(y,n))throw new Error("No "+n);return u[n]}function w(n){var i,t=n?n.indexOf("!"):-1;return t>-1&&(i=n.substring(0,t),n=n.substring(t+1,n.length)),[i,n]}function g(n){return function(){return f&&f.config&&f.config[n]||{}}}var a,o,v,s,u={},h={},f={},y={},nt=Object.prototype.hasOwnProperty,tt=[].slice,b=/\.js$/;v=function(n,t){var r,u=w(n),i=u[0];return n=u[1],i&&(i=c(i,t),r=l(i)),i?n=r&&r.normalize?r.normalize(n,k(t)):c(n,t):(n=c(n,t),u=w(n),i=u[0],n=u[1],i&&(r=l(i))),{f:i?i+"!"+n:n,n:n,pr:i,p:r}};s={require:function(n){return p(n)},exports:function(n){var t=u[n];return"undefined"!=typeof t?t:u[n]={}},module:function(n){return{id:n,uri:"",exports:u[n],config:g(n)}}};a=function(n,i,r,f){var w,o,k,b,c,g,a=[],nt=typeof r;if(f=f||n,"undefined"===nt||"function"===nt){for(i=!i.length&&r.length?["require","exports","module"]:i,c=0;c<i.length;c+=1)if(b=v(i[c],f),o=b.f,"require"===o)a[c]=s.require(n);else if("exports"===o)a[c]=s.exports(n),g=!0;else if("module"===o)w=a[c]=s.module(n);else if(e(u,o)||e(h,o)||e(y,o))a[c]=l(o);else{if(!b.p)throw new Error(n+" missing "+o);b.p.load(b.n,p(f,!0),d(o),{});a[c]=u[o]}k=r?r.apply(u[n],a):void 0;n&&(w&&w.exports!==t&&w.exports!==u[n]?u[n]=w.exports:k===t&&g||(u[n]=k))}else n&&(u[n]=r)};n=i=o=function(n,i,r,u,e){if("string"==typeof n)return s[n]?s[n](i):l(v(n,i).f);if(!n.splice){if(f=n,f.deps&&o(f.deps,f.callback),!i)return;i.splice?(n=i,i=r,r=null):n=t}return i=i||function(){},"function"==typeof r&&(r=u,u=e),u?a(t,n,i,r):setTimeout(function(){a(t,n,i,r)},4),o};o.config=function(n){return o(n)};n._defined=u;r=function(n,t,i){if("string"!=typeof n)throw new Error("See almond README: incorrect module build, no module name");t.splice||(i=t,t=[]);e(u,n)||e(h,n)||(h[n]=[n,t,i])};r.amd={jQuery:!0}}();t.requirejs=n;t.require=i;t.define=r}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=n||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(n){function r(n){var i=n.prototype,r=[],t,u;for(t in i)u=i[t],"function"==typeof u&&"constructor"!==t&&r.push(t);return r}var t={},i;return t.Extend=function(n,t){function r(){this.constructor=n}var u={}.hasOwnProperty;for(var i in t)u.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n},t.Decorate=function(n,t){function i(){var r=Array.prototype.unshift,u=t.prototype.constructor.length,i=n.prototype.constructor;u>0&&(r.call(arguments,n.prototype.constructor),i=t.prototype.constructor);i.apply(this,arguments)}function l(){this.constructor=i}var s=r(t),h=r(n),u,e,c,f,o;for(t.displayName=n.displayName,i.prototype=new l,u=0;u<h.length;u++)e=h[u],i.prototype[e]=n.prototype[e];for(c=function(n){var r=function(){},u;return n in i.prototype&&(r=i.prototype[n]),u=t.prototype[n],function(){var n=Array.prototype.unshift;return n.call(arguments,r),u.apply(this,arguments)}},f=0;f<s.length;f++)o=s[f],i.prototype[o]=c(o);return i},i=function(){this.listeners={}},i.prototype.on=function(n,t){this.listeners=this.listeners||{};n in this.listeners?this.listeners[n].push(t):this.listeners[n]=[t]},i.prototype.trigger=function(n){var t=Array.prototype.slice;this.listeners=this.listeners||{};n in this.listeners&&this.invoke(this.listeners[n],t.call(arguments,1));"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(n,t){for(var i=0,r=n.length;r>i;i++)n[i].apply(this,t)},t.Observable=i,t.generateChars=function(n){for(var r,t="",i=0;n>i;i++)r=Math.floor(36*Math.random()),t+=r.toString(36);return t},t.bind=function(n,t){return function(){n.apply(t,arguments)}},t._convertData=function(n){var f,r,i,u,t;for(f in n)if(r=f.split("-"),i=n,1!==r.length){for(u=0;u<r.length;u++)t=r[u],t=t.substring(0,1).toLowerCase()+t.substring(1),t in i||(i[t]={}),u==r.length-1&&(i[t]=n[f]),i=i[t];delete n[f]}return n},t.hasScroll=function(t,i){var u=n(i),f=i.style.overflowX,r=i.style.overflowY;return f!==r||"hidden"!==r&&"visible"!==r?"scroll"===f||"scroll"===r?!0:u.innerHeight()<i.scrollHeight||u.innerWidth()<i.scrollWidth:!1},t.escapeMarkup=function(n){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof n?n:String(n).replace(/[&<>"'\/\\]/g,function(n){return t[n]})},t.appendMany=function(t,i){if("1.7"===n.fn.jquery.substr(0,3)){var r=n();n.map(i,function(n){r=r.add(n)});i=r}t.append(i)},t}),t.define("select2/results",["jquery","./utils"],function(n,t){function i(n,t,r){this.$element=n;this.data=r;this.options=t;i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=n('<ul class="select2-results__options" role="tree"><\/ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(t){var u=this.options.get("escapeMarkup"),i,r;this.clear();this.hideLoading();i=n('<li role="treeitem" aria-live="assertive" class="select2-results__option"><\/li>');r=this.options.get("translations").get(t.message);i.append(u(r(t.args)));i[0].className+=" select2-results__message";this.$results.append(i)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(n){var i,t,r,u;if(this.hideLoading(),i=[],null==n.results||0===n.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));for(n.results=this.sort(n.results),t=0;t<n.results.length;t++)r=n.results[t],u=this.option(r),i.push(u);this.$results.append(i)},i.prototype.position=function(n,t){var i=t.find(".select2-results");i.append(n)},i.prototype.sort=function(n){var t=this.options.get("sorter");return t(n)},i.prototype.setClasses=function(){var t=this;this.data.current(function(i){var f=n.map(i,function(n){return n.id.toString()}),r=t.$results.find(".select2-results__option[aria-selected]"),u;r.each(function(){var i=n(this),t=n.data(this,"data"),r=""+t.id;null!=t.element&&t.element.selected||null==t.element&&n.inArray(r,f)>-1?i.attr("aria-selected","true"):i.attr("aria-selected","false")});u=r.filter("[aria-selected=true]");u.length>0?u.first().trigger("mouseenter"):r.first().trigger("mouseenter")})},i.prototype.showLoading=function(n){this.hideLoading();var i=this.options.get("translations").get("searching"),r={disabled:!0,loading:!0,text:i(n)},t=this.option(r);t.className+=" loading-results";this.$results.prepend(t)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(t){var r=document.createElement("li"),i,e,c,o,u,s,f,l,a,h;r.className="select2-results__option";i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true");null==t.id&&delete i["aria-selected"];null!=t._resultId&&(r.id=t._resultId);t.title&&(r.title=t.title);t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(e in i)c=i[e],r.setAttribute(e,c);if(t.children){for(o=n(r),u=document.createElement("strong"),u.className="select2-results__group",n(u),this.template(t,u),s=[],f=0;f<t.children.length;f++)l=t.children[f],a=this.option(l),s.push(a);h=n("<ul><\/ul>",{"class":"select2-results__options select2-results__options--nested"});h.append(s);o.append(u);o.append(h)}else this.template(t,r);return n.data(r,"data",t),r},i.prototype.bind=function(t){var i=this,r=t.id+"-results";this.$results.attr("id",r);t.on("results:all",function(n){i.clear();i.append(n.data);t.isOpen()&&i.setClasses()});t.on("results:append",function(n){i.append(n.data);t.isOpen()&&i.setClasses()});t.on("query",function(n){i.hideMessages();i.showLoading(n)});t.on("select",function(){t.isOpen()&&i.setClasses()});t.on("unselect",function(){t.isOpen()&&i.setClasses()});t.on("open",function(){i.$results.attr("aria-expanded","true");i.$results.attr("aria-hidden","false");i.setClasses();i.ensureHighlightVisible()});t.on("close",function(){i.$results.attr("aria-expanded","false");i.$results.attr("aria-hidden","true");i.$results.removeAttr("aria-activedescendant")});t.on("results:toggle",function(){var n=i.getHighlightedResults();0!==n.length&&n.trigger("mouseup")});t.on("results:select",function(){var n=i.getHighlightedResults(),t;0!==n.length&&(t=n.data("data"),"true"==n.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t}))});t.on("results:previous",function(){var r=i.getHighlightedResults(),u=i.$results.find("[aria-selected]"),f=u.index(r),n,t;if(0!==f){n=f-1;0===r.length&&(n=0);t=u.eq(n);t.trigger("mouseenter");var e=i.$results.offset().top,o=t.offset().top,s=i.$results.scrollTop()+(o-e);0===n?i.$results.scrollTop(0):0>o-e&&i.$results.scrollTop(s)}});t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),o=t.index(e),r=o+1,n;if(!(r>=t.length)){n=t.eq(r);n.trigger("mouseenter");var u=i.$results.offset().top+i.$results.outerHeight(!1),f=n.offset().top+n.outerHeight(!1),s=i.$results.scrollTop()+f-u;0===r?i.$results.scrollTop(0):f>u&&i.$results.scrollTop(s)}});t.on("results:focus",function(n){n.element.addClass("select2-results__option--highlighted")});t.on("results:message",function(n){i.displayMessage(n)});n.fn.mousewheel&&this.$results.on("mousewheel",function(n){var t=i.$results.scrollTop(),r=i.$results.get(0).scrollHeight-i.$results.scrollTop()+n.deltaY,u=n.deltaY>0&&t-n.deltaY<=0,f=n.deltaY<0&&r<=i.$results.height();u?(i.$results.scrollTop(0),n.preventDefault(),n.stopPropagation()):f&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),n.preventDefault(),n.stopPropagation())});this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var r=n(this),u=r.data("data");return"true"===r.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:u}):i.trigger("close",{})):void i.trigger("select",{originalEvent:t,data:u})});this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(){var t=n(this).data("data");i.getHighlightedResults().removeClass("select2-results__option--highlighted");i.trigger("results:focus",{data:t,element:n(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var n=this.getHighlightedResults();if(0!==n.length){var f=this.$results.find("[aria-selected]"),e=f.index(n),t=this.$results.offset().top,i=n.offset().top,r=this.$results.scrollTop()+(i-t),u=i-t;r-=2*n.outerHeight(!1);2>=e?this.$results.scrollTop(0):(u>this.$results.outerHeight()||0>u)&&this.$results.scrollTop(r)}},i.prototype.template=function(t,i){var u=this.options.get("templateResult"),f=this.options.get("escapeMarkup"),r=u(t,i);null==r?i.style.display="none":"string"==typeof r?i.innerHTML=f(r):n(i).append(r)},i}),t.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(n,t,i){function r(n,t){this.$element=n;this.options=t;r.__super__.constructor.call(this)}return t.Extend(r,t.Observable),r.prototype.render=function(){var t=n('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"><\/span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},r.prototype.bind=function(n){var t=this,r=(n.id+"-container",n.id+"-results");this.container=n;this.$selection.on("focus",function(n){t.trigger("focus",n)});this.$selection.on("blur",function(n){t._handleBlur(n)});this.$selection.on("keydown",function(n){t.trigger("keypress",n);n.which===i.SPACE&&n.preventDefault()});n.on("results:focus",function(n){t.$selection.attr("aria-activedescendant",n.data._resultId)});n.on("selection:update",function(n){t.update(n.data)});n.on("open",function(){t.$selection.attr("aria-expanded","true");t.$selection.attr("aria-owns",r);t._attachCloseHandler(n)});n.on("close",function(){t.$selection.attr("aria-expanded","false");t.$selection.removeAttr("aria-activedescendant");t.$selection.removeAttr("aria-owns");t.$selection.focus();t._detachCloseHandler(n)});n.on("enable",function(){t.$selection.attr("tabindex",t._tabindex)});n.on("disable",function(){t.$selection.attr("tabindex","-1")})},r.prototype._handleBlur=function(t){var i=this;window.setTimeout(function(){document.activeElement==i.$selection[0]||n.contains(i.$selection[0],document.activeElement)||i.trigger("blur",t)},1)},r.prototype._attachCloseHandler=function(t){n(document.body).on("mousedown.select2."+t.id,function(t){var i=n(t.target),r=i.closest(".select2"),u=n(".select2.select2-container--open");u.each(function(){var i=n(this),t;this!=r[0]&&(t=i.data("element"),t.select2("close"))})})},r.prototype._detachCloseHandler=function(t){n(document.body).off("mousedown.select2."+t.id)},r.prototype.position=function(n,t){var i=t.find(".selection");i.append(n)},r.prototype.destroy=function(){this._detachCloseHandler(this.container)},r.prototype.update=function(){throw new Error("The `update` method must be defined in child classes.");},r}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(n,t,i){function r(){r.__super__.constructor.apply(this,arguments)}return i.Extend(r,t),r.prototype.render=function(){var n=r.__super__.render.call(this);return n.addClass("select2-selection--single"),n.html('<span class="select2-selection__rendered"><\/span><span class="select2-selection__arrow" role="presentation"><b role="presentation"><\/b><\/span>'),n},r.prototype.bind=function(n){var i=this,t;r.__super__.bind.apply(this,arguments);t=n.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",t);this.$selection.attr("aria-labelledby",t);this.$selection.on("mousedown",function(n){1===n.which&&i.trigger("toggle",{originalEvent:n})});this.$selection.on("focus",function(){});this.$selection.on("blur",function(){});n.on("selection:update",function(n){i.update(n.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(n,t){var i=this.options.get("templateSelection"),r=this.options.get("escapeMarkup");return r(i(n,t))},r.prototype.selectionContainer=function(){return n("<span><\/span>")},r.prototype.update=function(n){if(0===n.length)return void this.clear();var t=n[0],i=this.$selection.find(".select2-selection__rendered"),r=this.display(t,i);i.empty().append(r);i.prop("title",t.title||t.text)},r}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(n,t,i){function r(){r.__super__.constructor.apply(this,arguments)}return i.Extend(r,t),r.prototype.render=function(){var n=r.__super__.render.call(this);return n.addClass("select2-selection--multiple"),n.html('<ul class="select2-selection__rendered"><\/ul>'),n},r.prototype.bind=function(){var t=this;r.__super__.bind.apply(this,arguments);this.$selection.on("click",function(n){t.trigger("toggle",{originalEvent:n})});this.$selection.on("click",".select2-selection__choice__remove",function(i){if(!t.options.get("disabled")){var r=n(this),u=r.parent(),f=u.data("data");t.trigger("unselect",{originalEvent:i,data:f})}})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(n,t){var i=this.options.get("templateSelection"),r=this.options.get("escapeMarkup");return r(i(n,t))},r.prototype.selectionContainer=function(){return n('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;<\/span><\/li>')},r.prototype.update=function(n){var f,r,e;if(this.clear(),0!==n.length){for(f=[],r=0;r<n.length;r++){var u=n[r],t=this.selectionContainer(),o=this.display(u,t);t.append(o);t.prop("title",u.title||u.text);t.data("data",u);f.push(t)}e=this.$selection.find(".select2-selection__rendered");i.appendMany(e,f)}},r}),t.define("select2/selection/placeholder",["../utils"],function(){function n(n,t,i){this.placeholder=this.normalizePlaceholder(i.get("placeholder"));n.call(this,t,i)}return n.prototype.normalizePlaceholder=function(n,t){return"string"==typeof t&&(t={id:"",text:t}),t},n.prototype.createPlaceholder=function(n,t){var i=this.selectionContainer();return i.html(this.display(t)),i.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),i},n.prototype.update=function(n,t){var r=1==t.length&&t[0].id!=this.placeholder.id,u=t.length>1,i;if(u||r)return n.call(this,t);this.clear();i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},n}),t.define("select2/selection/allowClear",["jquery","../keys"],function(n,t){function i(){}return i.prototype.bind=function(n,t,i){var r=this;n.call(this,t,i);null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option.");this.$selection.on("mousedown",".select2-selection__clear",function(n){r._handleClear(n)});t.on("keypress",function(n){r._handleKeyboardClear(n,t)})},i.prototype._handleClear=function(n,t){var r,u,i,f;if(!this.options.get("disabled")&&(r=this.$selection.find(".select2-selection__clear"),0!==r.length)){for(t.stopPropagation(),u=r.data("data"),i=0;i<u.length;i++)if(f={data:u[i]},this.trigger("unselect",f),f.prevented)return;this.$element.val(this.placeholder.id).trigger("change");this.trigger("toggle",{})}},i.prototype._handleKeyboardClear=function(n,i,r){r.isOpen()||(i.which==t.DELETE||i.which==t.BACKSPACE)&&this._handleClear(i)},i.prototype.update=function(t,i){if(t.call(this,i),!(this.$selection.find(".select2-selection__placeholder").length>0||0===i.length)){var r=n('<span class="select2-selection__clear">&times;<\/span>');r.data("data",i);this.$selection.find(".select2-selection__rendered").prepend(r)}},i}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(n,t,i){function r(n,t,i){n.call(this,t,i)}return r.prototype.render=function(t){var i=n('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /><\/li>'),r;return this.$searchContainer=i,this.$search=i.find("input"),r=t.call(this),this._transferTabIndex(),r},r.prototype.bind=function(n,t,r){var u=this,f,e;n.call(this,t,r);t.on("open",function(){u.$search.trigger("focus")});t.on("close",function(){u.$search.val("");u.$search.removeAttr("aria-activedescendant");u.$search.trigger("focus")});t.on("enable",function(){u.$search.prop("disabled",!1);u._transferTabIndex()});t.on("disable",function(){u.$search.prop("disabled",!0)});t.on("focus",function(){u.$search.trigger("focus")});t.on("results:focus",function(n){u.$search.attr("aria-activedescendant",n.id)});this.$selection.on("focusin",".select2-search--inline",function(n){u.trigger("focus",n)});this.$selection.on("focusout",".select2-search--inline",function(n){u._handleBlur(n)});this.$selection.on("keydown",".select2-search--inline",function(n){var r,t,f;n.stopPropagation();u.trigger("keypress",n);u._keyUpPrevented=n.isDefaultPrevented();r=n.which;r===i.BACKSPACE&&""===u.$search.val()&&(t=u.$searchContainer.prev(".select2-selection__choice"),t.length>0&&(f=t.data("data"),u.searchRemoveChoice(f),n.preventDefault()))});f=document.documentMode;e=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(){return e?void u.$selection.off("input.search input.searchcheck"):void u.$selection.off("keyup.search")});this.$selection.on("keyup.search input.search",".select2-search--inline",function(n){if(e&&"input"===n.type)return void u.$selection.off("input.search input.searchcheck");var t=n.which;t!=i.SHIFT&&t!=i.CTRL&&t!=i.ALT&&t!=i.TAB&&u.handleSearch(n)})},r.prototype._transferTabIndex=function(){this.$search.attr("tabindex",this.$selection.attr("tabindex"));this.$selection.attr("tabindex","-1")},r.prototype.createPlaceholder=function(n,t){this.$search.attr("placeholder",t.text)},r.prototype.update=function(n,t){var i=this.$search[0]==document.activeElement;this.$search.attr("placeholder","");n.call(this,t);this.$selection.find(".select2-selection__rendered").append(this.$searchContainer);this.resizeSearch();i&&this.$search.focus()},r.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var n=this.$search.val();this.trigger("query",{term:n})}this._keyUpPrevented=!1},r.prototype.searchRemoveChoice=function(n,t){this.trigger("unselect",{data:t});this.$search.val(t.text);this.handleSearch()},r.prototype.resizeSearch=function(){var n,t;this.$search.css("width","25px");n="";""!==this.$search.attr("placeholder")?n=this.$selection.find(".select2-selection__rendered").innerWidth():(t=this.$search.val().length+1,n=.75*t+"em");this.$search.css("width",n)},r}),t.define("select2/selection/eventRelay",["jquery"],function(n){function t(){}return t.prototype.bind=function(t,i,r){var u=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],e=["opening","closing","selecting","unselecting"];t.call(this,i,r);i.on("*",function(t,i){if(-1!==n.inArray(t,f)){i=i||{};var r=n.Event("select2:"+t,{params:i});u.$element.trigger(r);-1!==n.inArray(t,e)&&(i.prevented=r.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(n,t){function i(n){this.dict=n||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(n){return this.dict[n]},i.prototype.extend=function(t){this.dict=n.extend({},t.all(),this.dict)},i._cache={},i.loadPath=function(n){if(!(n in i._cache)){var r=t(n);i._cache[n]=r}return new i(i._cache[n])},i}),t.define("select2/diacritics",[],function(){return{"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),t.define("select2/data/base",["../utils"],function(n){function t(){t.__super__.constructor.call(this)}return n.Extend(t,n.Observable),t.prototype.current=function(){throw new Error("The `current` method must be defined in child classes.");},t.prototype.query=function(){throw new Error("The `query` method must be defined in child classes.");},t.prototype.bind=function(){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,i){var r=t.id+"-result-";return r+=n.generateChars(4),r+(null!=i.id?"-"+i.id.toString():"-"+n.generateChars(4))},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(n,t,i){function r(n,t){this.$element=n;this.options=t;r.__super__.constructor.call(this)}return t.Extend(r,n),r.prototype.current=function(n){var t=[],r=this;this.$element.find(":selected").each(function(){var n=i(this),u=r.item(n);t.push(u)});n(t)},r.prototype.select=function(n){var t=this,r;if(n.selected=!0,i(n.element).is("option"))return n.element.selected=!0,void this.$element.trigger("change");this.$element.prop("multiple")?this.current(function(r){var f=[],u,e;for(n=[n],n.push.apply(n,r),u=0;u<n.length;u++)e=n[u].id,-1===i.inArray(e,f)&&f.push(e);t.$element.val(f);t.$element.trigger("change")}):(r=n.id,this.$element.val(r),this.$element.trigger("change"))},r.prototype.unselect=function(n){var t=this;if(this.$element.prop("multiple"))return n.selected=!1,i(n.element).is("option")?(n.element.selected=!1,void this.$element.trigger("change")):void this.current(function(r){for(var e,u=[],f=0;f<r.length;f++)e=r[f].id,e!==n.id&&-1===i.inArray(e,u)&&u.push(e);t.$element.val(u);t.$element.trigger("change")})},r.prototype.bind=function(n){var t=this;this.container=n;n.on("select",function(n){t.select(n.data)});n.on("unselect",function(n){t.unselect(n.data)})},r.prototype.destroy=function(){this.$element.find("*").each(function(){i.removeData(this,"data")})},r.prototype.query=function(n,t){var r=[],u=this,f=this.$element.children();f.each(function(){var t=i(this),e,f;(t.is("option")||t.is("optgroup"))&&(e=u.item(t),f=u.matches(n,e),null!==f&&r.push(f))});t({results:r})},r.prototype.addOptions=function(n){t.appendMany(this.$element,n)},r.prototype.option=function(n){var t,u,r;return n.children?(t=document.createElement("optgroup"),t.label=n.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=n.text:t.innerText=n.text),n.id&&(t.value=n.id),n.disabled&&(t.disabled=!0),n.selected&&(t.selected=!0),n.title&&(t.title=n.title),u=i(t),r=this._normalizeItem(n),r.element=t,i.data(t,"data",r),u},r.prototype.item=function(n){var t={},e,o;if(t=i.data(n[0],"data"),null!=t)return t;if(n.is("option"))t={id:n.val(),text:n.text(),disabled:n.prop("disabled"),selected:n.prop("selected"),title:n.prop("title")};else if(n.is("optgroup")){t={text:n.prop("label"),children:[],title:n.prop("title")};for(var u=n.children("option"),f=[],r=0;r<u.length;r++)e=i(u[r]),o=this.item(e),f.push(o);t.children=f}return t=this._normalizeItem(t),t.element=n[0],i.data(n[0],"data",t),t},r.prototype._normalizeItem=function(n){i.isPlainObject(n)||(n={id:n,text:n});n=i.extend({},{text:""},n);return null!=n.id&&(n.id=n.id.toString()),null!=n.text&&(n.text=n.text.toString()),null==n._resultId&&n.id&&null!=this.container&&(n._resultId=this.generateResultId(this.container,n)),i.extend({},{selected:!1,disabled:!1},n)},r.prototype.matches=function(n,t){var i=this.options.get("matcher");return i(n,t)},r}),t.define("select2/data/array",["./select","../utils","jquery"],function(n,t,i){function r(n,t){var i=t.get("data")||[];r.__super__.constructor.call(this,n,t);this.addOptions(this.convertToOptions(i))}return t.Extend(r,n),r.prototype.select=function(n){var t=this.$element.find("option").filter(function(t,i){return i.value==n.id.toString()});0===t.length&&(t=this.option(n),this.addOptions(t));r.__super__.select.call(this,n)},r.prototype.convertToOptions=function(n){function c(n){return function(){return i(this).val()==n.id}}for(var r,f,h,l=this,e=this.$element.find("option"),a=e.map(function(){return l.item(i(this)).id}).get(),o=[],u=0;u<n.length;u++)if(r=this._normalizeItem(n[u]),i.inArray(r.id,a)>=0){var s=e.filter(c(r)),v=this.item(s),y=i.extend(!0,{},v,r),p=this.option(y);s.replaceWith(p)}else f=this.option(r),r.children&&(h=this.convertToOptions(r.children),t.appendMany(f,h)),o.push(f);return o},r}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(n,t,i){function r(n,t){this.ajaxOptions=this._applyDefaults(t.get("ajax"));null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults);r.__super__.constructor.call(this,n,t)}return t.Extend(r,n),r.prototype._applyDefaults=function(n){var t={data:function(n){return i.extend({},n,{q:n.term})},transport:function(n,t,r){var u=i.ajax(n);return u.then(t),u.fail(r),u}};return i.extend({},t,n,!0)},r.prototype.processResults=function(n){return n},r.prototype.query=function(n,t){function f(){var f=r.transport(r,function(r){var f=u.processResults(r,n);u.options.get("debug")&&window.console&&console.error&&(f&&f.results&&i.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response."));t(f)},function(){});u._request=f}var u=this,r;null!=this._request&&(i.isFunction(this._request.abort)&&this._request.abort(),this._request=null);r=i.extend({type:"GET"},this.ajaxOptions);"function"==typeof r.url&&(r.url=r.url.call(this.$element,n));"function"==typeof r.data&&(r.data=r.data.call(this.$element,n));this.ajaxOptions.delay&&""!==n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(f,this.ajaxOptions.delay)):f()},r}),t.define("select2/data/tags",["jquery"],function(n){function t(t,i,r){var f=r.get("tags"),e=r.get("createTag"),u;if(void 0!==e&&(this.createTag=e),t.call(this,i,r),n.isArray(f))for(u=0;u<f.length;u++){var o=f[u],s=this._normalizeItem(o),h=this.option(s);this.$element.append(h)}}return t.prototype.query=function(n,t,i){function u(n,f){for(var s,c,e=n.results,o=0;o<e.length;o++){var h=e[o],l=null!=h.children&&!u({results:h.children},!0),a=h.text===t.term;if(a||l)return f?!1:(n.data=e,void i(n))}if(f)return!0;s=r.createTag(t);null!=s&&(c=r.option(s),c.attr("data-select2-tag",!0),r.addOptions([c]),r.insertTag(e,s));n.results=e;i(n)}var r=this;return this._removeOldTags(),null==t.term||null!=t.page?void n.call(this,t,i):void n.call(this,t,u)},t.prototype.createTag=function(t,i){var r=n.trim(i.term);return""===r?null:{id:r,text:r}},t.prototype.insertTag=function(n,t,i){t.unshift(i)},t.prototype._removeOldTags=function(){var t=(this._lastTag,this.$element.find("option[data-select2-tag]"));t.each(function(){this.selected||n(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(n){function t(n,t,i){var r=i.get("tokenizer");void 0!==r&&(this.tokenizer=r);n.call(this,t,i)}return t.prototype.bind=function(n,t,i){n.call(this,t,i);this.$search=t.dropdown.$search||t.selection.$search||i.find(".select2-search__field")},t.prototype.query=function(n,t,i){function u(n){f.trigger("select",{data:n})}var f=this,r;t.term=t.term||"";r=this.tokenizer(t,this.options,u);r.term!==t.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.focus()),t.term=r.term);n.call(this,t,i)},t.prototype.tokenizer=function(t,i,r,u){for(var o,h=r.get("tokenSeparators")||[],e=i.term,f=0,c=this.createTag||function(n){return{id:n.term,text:n.term}};f<e.length;)if(o=e[f],-1!==n.inArray(o,h)){var l=e.substr(0,f),a=n.extend({},i,{term:l}),s=c(a);null!=s?(u(s),e=e.substr(f+1)||"",f=0):f++}else f++;return{term:e}},t}),t.define("select2/data/minimumInputLength",[],function(){function n(n,t,i){this.minimumInputLength=i.get("minimumInputLength");n.call(this,t,i)}return n.prototype.query=function(n,t,i){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void n.call(this,t,i)},n}),t.define("select2/data/maximumInputLength",[],function(){function n(n,t,i){this.maximumInputLength=i.get("maximumInputLength");n.call(this,t,i)}return n.prototype.query=function(n,t,i){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):void n.call(this,t,i)},n}),t.define("select2/data/maximumSelectionLength",[],function(){function n(n,t,i){this.maximumSelectionLength=i.get("maximumSelectionLength");n.call(this,t,i)}return n.prototype.query=function(n,t,i){var r=this;this.current(function(u){var f=null!=u?u.length:0;return r.maximumSelectionLength>0&&f>=r.maximumSelectionLength?void r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):void n.call(r,t,i)})},n}),t.define("select2/dropdown",["jquery","./utils"],function(n,t){function i(n,t){this.$element=n;this.options=t;i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=n('<span class="select2-dropdown"><span class="select2-results"><\/span><\/span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},i.prototype.bind=function(){},i.prototype.position=function(){},i.prototype.destroy=function(){this.$dropdown.remove()},i}),t.define("select2/dropdown/search",["jquery","../utils"],function(n){function t(){}return t.prototype.render=function(t){var r=t.call(this),i=n('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /><\/span>');return this.$searchContainer=i,this.$search=i.find("input"),r.prepend(i),r},t.prototype.bind=function(t,i,r){var u=this;t.call(this,i,r);this.$search.on("keydown",function(n){u.trigger("keypress",n);u._keyUpPrevented=n.isDefaultPrevented()});this.$search.on("input",function(){n(this).off("keyup")});this.$search.on("keyup input",function(n){u.handleSearch(n)});i.on("open",function(){u.$search.attr("tabindex",0);u.$search.focus();window.setTimeout(function(){u.$search.focus()},0)});i.on("close",function(){u.$search.attr("tabindex",-1);u.$search.val("")});i.on("results:all",function(n){if(null==n.query.term||""===n.query.term){var t=u.showSearch(n);t?u.$searchContainer.removeClass("select2-search--hide"):u.$searchContainer.addClass("select2-search--hide")}})},t.prototype.handleSearch=function(){if(!this._keyUpPrevented){var n=this.$search.val();this.trigger("query",{term:n})}this._keyUpPrevented=!1},t.prototype.showSearch=function(){return!0},t}),t.define("select2/dropdown/hidePlaceholder",[],function(){function n(n,t,i,r){this.placeholder=this.normalizePlaceholder(i.get("placeholder"));n.call(this,t,i,r)}return n.prototype.append=function(n,t){t.results=this.removePlaceholder(t.results);n.call(this,t)},n.prototype.normalizePlaceholder=function(n,t){return"string"==typeof t&&(t={id:"",text:t}),t},n.prototype.removePlaceholder=function(n,t){for(var u,r=t.slice(0),i=t.length-1;i>=0;i--)u=t[i],this.placeholder.id===u.id&&r.splice(i,1);return r},n}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function t(n,t,i,r){this.lastParams={};n.call(this,t,i,r);this.$loadingMore=this.createLoadingMore();this.loading=!1}return t.prototype.append=function(n,t){this.$loadingMore.remove();this.loading=!1;n.call(this,t);this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,i,r){var u=this;t.call(this,i,r);i.on("query",function(n){u.lastParams=n;u.loading=!0});i.on("query:append",function(n){u.lastParams=n;u.loading=!0});this.$results.on("scroll",function(){var r=n.contains(document.documentElement,u.$loadingMore[0]),t,i;!u.loading&&r&&(t=u.$results.offset().top+u.$results.outerHeight(!1),i=u.$loadingMore.offset().top+u.$loadingMore.outerHeight(!1),t+50>=i&&u.loadMore())})},t.prototype.loadMore=function(){this.loading=!0;var t=n.extend({},{page:1},this.lastParams);t.page++;this.trigger("query:append",t)},t.prototype.showLoadingMore=function(n,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=n('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"><\/li>'),i=this.options.get("translations").get("loadingMore");return t.html(i(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(n,t){function i(t,i,r){this.$dropdownParent=r.get("dropdownParent")||n(document.body);t.call(this,i,r)}return i.prototype.bind=function(n,t,i){var r=this,u=!1;n.call(this,t,i);t.on("open",function(){r._showDropdown();r._attachPositioningHandler(t);u||(u=!0,t.on("results:all",function(){r._positionDropdown();r._resizeDropdown()}),t.on("results:append",function(){r._positionDropdown();r._resizeDropdown()}))});t.on("close",function(){r._hideDropdown();r._detachPositioningHandler(t)});this.$dropdownContainer.on("mousedown",function(n){n.stopPropagation()})},i.prototype.destroy=function(n){n.call(this);this.$dropdownContainer.remove()},i.prototype.position=function(n,t,i){t.attr("class",i.attr("class"));t.removeClass("select2");t.addClass("select2-container--open");t.css({position:"absolute",top:-999999});this.$container=i},i.prototype.render=function(t){var i=n("<span><\/span>"),r=t.call(this);return i.append(r),this.$dropdownContainer=i,i},i.prototype._hideDropdown=function(){this.$dropdownContainer.detach()},i.prototype._attachPositioningHandler=function(i,r){var u=this,f="scroll.select2."+r.id,o="resize.select2."+r.id,s="orientationchange.select2."+r.id,e=this.$container.parents().filter(t.hasScroll);e.each(function(){n(this).data("select2-scroll-position",{x:n(this).scrollLeft(),y:n(this).scrollTop()})});e.on(f,function(){var t=n(this).data("select2-scroll-position");n(this).scrollTop(t.y)});n(window).on(f+" "+o+" "+s,function(){u._positionDropdown();u._resizeDropdown()})},i.prototype._detachPositioningHandler=function(i,r){var u="scroll.select2."+r.id,f="resize.select2."+r.id,e="orientationchange.select2."+r.id,o=this.$container.parents().filter(t.hasScroll);o.off(u);n(window).off(u+" "+f+" "+e)},i.prototype._positionDropdown=function(){var e=n(window),u=this.$dropdown.hasClass("select2-dropdown--above"),a=this.$dropdown.hasClass("select2-dropdown--below"),t=null,i=(this.$container.position(),this.$container.offset()),r,s;i.bottom=i.top+this.$container.outerHeight(!1);r={height:this.$container.outerHeight(!1)};r.top=i.top;r.bottom=i.top+r.height;var o={height:this.$dropdown.outerHeight(!1)},h={top:e.scrollTop(),bottom:e.scrollTop()+e.height()},c=h.top<i.top-o.height,l=h.bottom>i.bottom+o.height,f={left:i.left,top:r.bottom};"static"!==this.$dropdownParent[0].style.position&&(s=this.$dropdownParent.offset(),f.top-=s.top,f.left-=s.left);u||a||(t="below");l||!c||u?!c&&l&&u&&(t="below"):t="above";("above"==t||u&&"below"!==t)&&(f.top=r.top-o.height);null!=t&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+t),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+t));this.$dropdownContainer.css(f)},i.prototype._resizeDropdown=function(){var n={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(n.minWidth=n.width,n.width="auto");this.$dropdown.css(n)},i.prototype._showDropdown=function(){this.$dropdownContainer.appendTo(this.$dropdownParent);this._positionDropdown();this._resizeDropdown()},i}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function n(t){for(var u,i=0,r=0;r<t.length;r++)u=t[r],u.children?i+=n(u.children):i++;return i}function t(n,t,i,r){this.minimumResultsForSearch=i.get("minimumResultsForSearch");this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0);n.call(this,t,i,r)}return t.prototype.showSearch=function(t,i){return n(i.data.results)<this.minimumResultsForSearch?!1:t.call(this,i)},t}),t.define("select2/dropdown/selectOnClose",[],function(){function n(){}return n.prototype.bind=function(n,t,i){var r=this;n.call(this,t,i);t.on("close",function(){r._handleSelectOnClose()})},n.prototype._handleSelectOnClose=function(){var t=this.getHighlightedResults(),n;t.length<1||(n=t.data("data"),null!=n.element&&n.element.selected||null==n.element&&n.selected||this.trigger("select",{data:n}))},n}),t.define("select2/dropdown/closeOnSelect",[],function(){function n(){}return n.prototype.bind=function(n,t,i){var r=this;n.call(this,t,i);t.on("select",function(n){r._selectTriggered(n)});t.on("unselect",function(n){r._selectTriggered(n)})},n.prototype._selectTriggered=function(n,t){var i=t.originalEvent;i&&i.ctrlKey||this.trigger("close",{})},n}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(n){var t=n.input.length-n.maximum,i="Please delete "+t+" character";return 1!=t&&(i+="s"),i},inputTooShort:function(n){var t=n.minimum-n.input.length;return"Please enter "+t+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(n){var t="You can only select "+n.maximum+" item";return 1!=n.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot){function st(){this.reset()}st.prototype.apply=function(l){var vt,yt,pt,wt,bt,kt,dt,ct,lt,st,ot,ht,gt,at;if((l=n.extend({},this.defaults,l),null==l.dataAdapter)&&((l.dataAdapter=null!=l.ajax?y:null!=l.data?v:a,l.minimumInputLength>0&&(l.dataAdapter=h.Decorate(l.dataAdapter,b)),l.maximumInputLength>0&&(l.dataAdapter=h.Decorate(l.dataAdapter,k)),l.maximumSelectionLength>0&&(l.dataAdapter=h.Decorate(l.dataAdapter,d)),l.tags&&(l.dataAdapter=h.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=h.Decorate(l.dataAdapter,w)),null!=l.query)&&(vt=t(l.amdBase+"compat/query"),l.dataAdapter=h.Decorate(l.dataAdapter,vt)),null!=l.initSelection&&(yt=t(l.amdBase+"compat/initSelection"),l.dataAdapter=h.Decorate(l.dataAdapter,yt))),(null==l.resultsAdapter&&(l.resultsAdapter=i,null!=l.ajax&&(l.resultsAdapter=h.Decorate(l.resultsAdapter,it)),null!=l.placeholder&&(l.resultsAdapter=h.Decorate(l.resultsAdapter,tt)),l.selectOnClose&&(l.resultsAdapter=h.Decorate(l.resultsAdapter,ft))),null==l.dropdownAdapter)&&(l.multiple?l.dropdownAdapter=g:(pt=h.Decorate(g,nt),l.dropdownAdapter=pt),(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=h.Decorate(l.dropdownAdapter,ut)),l.closeOnSelect&&(l.dropdownAdapter=h.Decorate(l.dropdownAdapter,et)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass)&&(wt=t(l.amdBase+"compat/dropdownCss"),l.dropdownAdapter=h.Decorate(l.dropdownAdapter,wt)),l.dropdownAdapter=h.Decorate(l.dropdownAdapter,rt)),null==l.selectionAdapter&&((l.selectionAdapter=l.multiple?u:r,null!=l.placeholder&&(l.selectionAdapter=h.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=h.Decorate(l.selectionAdapter,e)),l.multiple&&(l.selectionAdapter=h.Decorate(l.selectionAdapter,o)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass)&&(bt=t(l.amdBase+"compat/containerCss"),l.selectionAdapter=h.Decorate(l.selectionAdapter,bt)),l.selectionAdapter=h.Decorate(l.selectionAdapter,s)),"string"==typeof l.language&&(l.language.indexOf("-")>0?(kt=l.language.split("-"),dt=kt[0],l.language=[l.language,dt]):l.language=[l.language]),n.isArray(l.language)){for(ct=new c,l.language.push("en"),lt=l.language,st=0;st<lt.length;st++){ot=lt[st];ht={};try{ht=c.loadPath(ot)}catch(ni){try{ot=this.defaults.amdLanguageBase+ot;ht=c.loadPath(ot)}catch(ti){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+ot+'" could not be automatically loaded. A fallback will be used instead.');continue}}ct.extend(ht)}l.translations=ct}else gt=c.loadPath(this.defaults.amdLanguageBase+"en"),at=new c(l.language),at.extend(gt),l.translations=at;return l};st.prototype.reset=function(){function i(n){function t(n){return l[n]||n}return n.replace(/[^\u0000-\u007E]/g,t)}function t(r,u){var f,e,o,s,h,c;if(""===n.trim(r.term))return u;if(u.children&&u.children.length>0){for(f=n.extend(!0,{},u),e=u.children.length-1;e>=0;e--)o=u.children[e],s=t(r,o),null==s&&f.children.splice(e,1);return f.children.length>0?f:t(r,f)}return h=i(u.text).toUpperCase(),c=i(r.term).toUpperCase(),h.indexOf(c)>-1?u:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:h.escapeMarkup,language:ot,matcher:t,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(n){return n},templateResult:function(n){return n.text},templateSelection:function(n){return n.text},theme:"default",width:"resolve"}};st.prototype.set=function(t,i){var f=n.camelCase(t),r={},u;r[f]=i;u=h._convertData(r);n.extend(this.defaults,u)};return new st}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(n,t,i,r){function u(t,u){if(this.options=t,null!=u&&this.fromElement(u),this.options=i.apply(this.options),u&&u.is("input")){var f=n(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=r.Decorate(this.options.dataAdapter,f)}}return u.prototype.fromElement=function(n){var e=["select2"],f,u,i;null==this.options.multiple&&(this.options.multiple=n.prop("multiple"));null==this.options.disabled&&(this.options.disabled=n.prop("disabled"));null==this.options.language&&(n.prop("lang")?this.options.language=n.prop("lang").toLowerCase():n.closest("[lang]").prop("lang")&&(this.options.language=n.closest("[lang]").prop("lang")));null==this.options.dir&&(this.options.dir=n.prop("dir")?n.prop("dir"):n.closest("[dir]").prop("dir")?n.closest("[dir]").prop("dir"):"ltr");n.prop("disabled",this.options.disabled);n.prop("multiple",this.options.multiple);n.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),n.data("data",n.data("select2Tags")),n.data("tags",!0));n.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),n.attr("ajax--url",n.data("ajaxUrl")),n.data("ajax--url",n.data("ajaxUrl")));f={};f=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&n[0].dataset?t.extend(!0,{},n[0].dataset,n.data()):n.data();u=t.extend(!0,{},f);u=r._convertData(u);for(i in u)t.inArray(i,e)>-1||(t.isPlainObject(this.options[i])?t.extend(this.options[i],u[i]):this.options[i]=u[i]);return this},u.prototype.get=function(n){return this.options[n]},u.prototype.set=function(n,t){this.options[n]=t},u}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(n,t,i,r){var u=function(n,i){var f,e,r,o,s,h,c;null!=n.data("select2")&&n.data("select2").destroy();this.$element=n;this.id=this._generateId(n);i=i||{};this.options=new t(i,n);u.__super__.constructor.call(this);f=n.attr("tabindex")||0;n.data("old-tabindex",f);n.attr("tabindex","-1");e=this.options.get("dataAdapter");this.dataAdapter=new e(n,this.options);r=this.render();this._placeContainer(r);o=this.options.get("selectionAdapter");this.selection=new o(n,this.options);this.$selection=this.selection.render();this.selection.position(this.$selection,r);s=this.options.get("dropdownAdapter");this.dropdown=new s(n,this.options);this.$dropdown=this.dropdown.render();this.dropdown.position(this.$dropdown,r);h=this.options.get("resultsAdapter");this.results=new h(n,this.options,this.dataAdapter);this.$results=this.results.render();this.results.position(this.$results,this.$dropdown);c=this;this._bindAdapters();this._registerDomEvents();this._registerDataEvents();this._registerSelectionEvents();this._registerDropdownEvents();this._registerResultsEvents();this._registerEvents();this.dataAdapter.current(function(n){c.trigger("selection:update",{data:n})});n.addClass("select2-hidden-accessible");n.attr("aria-hidden","true");this._syncAttributes();n.data("select2",this)};return i.Extend(u,i.Observable),u.prototype._generateId=function(n){var t="";return t=null!=n.attr("id")?n.attr("id"):null!=n.attr("name")?n.attr("name")+"-"+i.generateChars(2):i.generateChars(4),t="select2-"+t},u.prototype._placeContainer=function(n){n.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&n.css("width",t)},u.prototype._resolveWidth=function(n,t){var r,u,f,s,i;if("resolve"==t)return r=this._resolveWidth(n,"style"),null!=r?r:this._resolveWidth(n,"element");if("element"==t)return u=n.outerWidth(!1),0>=u?"auto":u+"px";if("style"==t){if(f=n.attr("style"),"string"!=typeof f)return null;for(var o=f.split(";"),e=0,h=o.length;h>e;e+=1)if(s=o[e].replace(/\s/g,""),i=s.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==i&&i.length>=1)return i[1];return null}return t},u.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container);this.selection.bind(this,this.$container);this.dropdown.bind(this,this.$container);this.results.bind(this,this.$container)},u.prototype._registerDomEvents=function(){var t=this,r;this.$element.on("change.select2",function(){t.dataAdapter.current(function(n){t.trigger("selection:update",{data:n})})});this._sync=i.bind(this._syncAttributes,this);this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=r?(this._observer=new r(function(i){n.each(i,t._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",t._sync,!1)},u.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(t,i){n.trigger(t,i)})},u.prototype._registerSelectionEvents=function(){var t=this,i=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()});this.selection.on("focus",function(n){t.focus(n)});this.selection.on("*",function(r,u){-1===n.inArray(r,i)&&t.trigger(r,u)})},u.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(t,i){n.trigger(t,i)})},u.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(t,i){n.trigger(t,i)})},u.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")});this.on("close",function(){n.$container.removeClass("select2-container--open")});this.on("enable",function(){n.$container.removeClass("select2-container--disabled")});this.on("disable",function(){n.$container.addClass("select2-container--disabled")});this.on("blur",function(){n.$container.removeClass("select2-container--focus")});this.on("query",function(t){n.isOpen()||n.trigger("open",{});this.dataAdapter.query(t,function(i){n.trigger("results:all",{data:i,query:t})})});this.on("query:append",function(t){this.dataAdapter.query(t,function(i){n.trigger("results:append",{data:i,query:t})})});this.on("keypress",function(t){var i=t.which;n.isOpen()?i===r.ESC||i===r.TAB||i===r.UP&&t.altKey?(n.close(),t.preventDefault()):i===r.ENTER?(n.trigger("results:select",{}),t.preventDefault()):i===r.SPACE&&t.ctrlKey?(n.trigger("results:toggle",{}),t.preventDefault()):i===r.UP?(n.trigger("results:previous",{}),t.preventDefault()):i===r.DOWN&&(n.trigger("results:next",{}),t.preventDefault()):(i===r.ENTER||i===r.SPACE||i===r.DOWN&&t.altKey)&&(n.open(),t.preventDefault())})},u.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled"));this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},u.prototype.trigger=function(n,t){var r=u.__super__.trigger,f={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"},e,i;if((void 0===t&&(t={}),n in f)&&(e=f[n],i={prevented:!1,name:n,args:t},r.call(this,e,i),i.prevented))return void(t.prevented=!0);r.call(this,n,t)},u.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},u.prototype.open=function(){this.isOpen()||this.trigger("query",{})},u.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},u.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},u.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},u.prototype.focus=function(){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},u.prototype.enable=function(n){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');(null==n||0===n.length)&&(n=[!0]);var t=!n[0];this.$element.prop("disabled",t)},u.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var n=[];return this.dataAdapter.current(function(t){n=t}),n},u.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var i=t[0];n.isArray(i)&&(i=n.map(i,function(n){return n.toString()}));this.$element.val(i).trigger("change")},u.prototype.destroy=function(){this.$container.remove();this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync);null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1);this._sync=null;this.$element.off(".select2");this.$element.attr("tabindex",this.$element.data("old-tabindex"));this.$element.removeClass("select2-hidden-accessible");this.$element.attr("aria-hidden","false");this.$element.removeData("select2");this.dataAdapter.destroy();this.selection.destroy();this.dropdown.destroy();this.results.destroy();this.dataAdapter=null;this.selection=null;this.dropdown=null;this.results=null},u.prototype.render=function(){var t=n('<span class="select2 select2-container"><span class="selection"><\/span><span class="dropdown-wrapper" aria-hidden="true"><\/span><\/span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),t.data("element",this.$element),t},u}),t.define("jquery-mousewheel",["jquery"],function(n){return n}),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(n,t,i,r){if(null==n.fn.select2){var u=["open","close","destroy"];n.fn.select2=function(t){if(t=t||{},"object"==typeof t)return this.each(function(){var r=n.extend(!0,{},t);new i(n(this),r)}),this;if("string"==typeof t){var r;return this.each(function(){var i=n(this).data("select2"),u;null==i&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2.");u=Array.prototype.slice.call(arguments,1);r=i[t].apply(i,u)}),n.inArray(t,u)>-1?this:r}throw new Error("Invalid arguments for Select2: "+t);}}return null==n.fn.select2.defaults&&(n.fn.select2.defaults=r),i}),{define:t.define,require:t.require}}(),i=t.require("jquery.select2");return n.fn.select2.amd=t,i});Proj4js={defaultDatum:"WGS84",transform:function(n,t,i){if(!n.readyToUse)return this.reportError("Proj4js initialization for:"+n.srsCode+" not yet complete"),i;if(!t.readyToUse)return this.reportError("Proj4js initialization for:"+t.srsCode+" not yet complete"),i;if(n.datum&&t.datum&&((n.datum.datum_type==Proj4js.common.PJD_3PARAM||n.datum.datum_type==Proj4js.common.PJD_7PARAM)&&t.datumCode!="WGS84"||(t.datum.datum_type==Proj4js.common.PJD_3PARAM||t.datum.datum_type==Proj4js.common.PJD_7PARAM)&&n.datumCode!="WGS84")){var r=Proj4js.WGS84;this.transform(n,r,i);n=r}return n.axis!="enu"&&this.adjust_axis(n,!1,i),n.projName=="longlat"?(i.x*=Proj4js.common.D2R,i.y*=Proj4js.common.D2R):(n.to_meter&&(i.x*=n.to_meter,i.y*=n.to_meter),n.inverse(i)),n.from_greenwich&&(i.x+=n.from_greenwich),i=this.datum_transform(n.datum,t.datum,i),t.from_greenwich&&(i.x-=t.from_greenwich),t.projName=="longlat"?(i.x*=Proj4js.common.R2D,i.y*=Proj4js.common.R2D):(t.forward(i),t.to_meter&&(i.x/=t.to_meter,i.y/=t.to_meter)),t.axis!="enu"&&this.adjust_axis(t,!0,i),i},datum_transform:function(n,t,i){return n.compare_datums(t)?i:n.datum_type==Proj4js.common.PJD_NODATUM||t.datum_type==Proj4js.common.PJD_NODATUM?i:((n.es!=t.es||n.a!=t.a||n.datum_type==Proj4js.common.PJD_3PARAM||n.datum_type==Proj4js.common.PJD_7PARAM||t.datum_type==Proj4js.common.PJD_3PARAM||t.datum_type==Proj4js.common.PJD_7PARAM)&&(n.geodetic_to_geocentric(i),(n.datum_type==Proj4js.common.PJD_3PARAM||n.datum_type==Proj4js.common.PJD_7PARAM)&&n.geocentric_to_wgs84(i),(t.datum_type==Proj4js.common.PJD_3PARAM||t.datum_type==Proj4js.common.PJD_7PARAM)&&t.geocentric_from_wgs84(i),t.geocentric_to_geodetic(i)),i)},adjust_axis:function(n,t,i){for(var e=i.x,o=i.y,s=i.z||0,r,u,f=0;f<3;f++)if(!t||f!=2||i.z!==undefined){f==0?(r=e,u="x"):f==1?(r=o,u="y"):(r=s,u="z");switch(n.axis[f]){case"e":i[u]=r;break;case"w":i[u]=-r;break;case"n":i[u]=r;break;case"s":i[u]=-r;break;case"u":i[u]!==undefined&&(i.z=r);break;case"d":i[u]!==undefined&&(i.z=-r);break;default:return alert("ERROR: unknow axis ("+n.axis[f]+") - check definition of "+n.projName),null}}return i},reportError:function(){},extend:function(n,t){var i,r;if(n=n||{},t)for(i in t)r=t[i],r!==undefined&&(n[i]=r);return n},Class:function(){for(var t=function(){this.initialize.apply(this,arguments)},i={},r,n=0;n<arguments.length;++n)r=typeof arguments[n]=="function"?arguments[n].prototype:arguments[n],Proj4js.extend(i,r);return t.prototype=i,t},bind:function(n,t){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var r=i.concat(Array.prototype.slice.apply(arguments,[0]));return n.apply(t,r)}},scriptName:"proj4js-combined.js",defsLookupService:"http://spatialreference.org/ref",libPath:null,getScriptLocation:function(){var t,n,i;if(this.libPath)return this.libPath;var r=this.scriptName,u=r.length,f=document.getElementsByTagName("script");for(t=0;t<f.length;t++)if(n=f[t].getAttribute("src"),n&&(i=n.lastIndexOf(r),i>-1&&i+u==n.length)){this.libPath=n.slice(0,-u);break}return this.libPath||""},loadScript:function(n,t,i,r){var u=document.createElement("script");u.defer=!1;u.type="text/javascript";u.id=n;u.src=n;u.onload=t;u.onerror=i;u.loadCheck=r;/MSIE/.test(navigator.userAgent)&&(u.onreadystatechange=this.checkReadyState)},checkReadyState:function(){this.readyState=="loaded"&&(this.loadCheck()?this.onload():this.onerror())}};Proj4js.Proj=Proj4js.Class({readyToUse:!1,title:null,projName:null,units:null,datum:null,x0:0,y0:0,localCS:!1,queue:null,initialize:function(n,t){var i,r;if(this.srsCodeInput=n,this.queue=[],t&&this.queue.push(t),n.indexOf("GEOGCS")>=0||n.indexOf("GEOCCS")>=0||n.indexOf("PROJCS")>=0||n.indexOf("LOCAL_CS")>=0){this.parseWKT(n);this.deriveConstants();this.loadProjCode(this.projName);return}n.indexOf("urn:")==0?(i=n.split(":"),(i[1]=="ogc"||i[1]=="x-ogc")&&i[2]=="def"&&i[3]=="crs"&&(n=i[4]+":"+i[i.length-1])):n.indexOf("http://")==0&&(r=n.split("#"),r[0].match(/epsg.org/)?n="EPSG:"+r[1]:r[0].match(/RIG.xml/)&&(n="IGNF:"+r[1]));this.srsCode=n.toUpperCase();this.srsCode.indexOf("EPSG")==0?(this.srsCode=this.srsCode,this.srsAuth="epsg",this.srsProjNumber=this.srsCode.substring(5)):this.srsCode.indexOf("IGNF")==0?(this.srsCode=this.srsCode,this.srsAuth="IGNF",this.srsProjNumber=this.srsCode.substring(5)):this.srsCode.indexOf("CRS")==0?(this.srsCode=this.srsCode,this.srsAuth="CRS",this.srsProjNumber=this.srsCode.substring(4)):(this.srsAuth="",this.srsProjNumber=this.srsCode);this.loadProjDefinition()},loadProjDefinition:function(){if(Proj4js.defs[this.srsCode]){this.defsLoaded();return}var n=Proj4js.getScriptLocation()+"defs/"+this.srsAuth.toUpperCase()+this.srsProjNumber+".js";Proj4js.loadScript(n,Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.loadFromService,this),Proj4js.bind(this.checkDefsLoaded,this))},loadFromService:function(){var n=Proj4js.defsLookupService+"/"+this.srsAuth+"/"+this.srsProjNumber+"/proj4js/";Proj4js.loadScript(n,Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.defsFailed,this),Proj4js.bind(this.checkDefsLoaded,this))},defsLoaded:function(){this.parseDefs();this.loadProjCode(this.projName)},checkDefsLoaded:function(){return Proj4js.defs[this.srsCode]?!0:!1},defsFailed:function(){Proj4js.reportError("failed to load projection definition for: "+this.srsCode);Proj4js.defs[this.srsCode]=Proj4js.defs.WGS84;this.defsLoaded()},loadProjCode:function(n){if(Proj4js.Proj[n]){this.initTransforms();return}var t=Proj4js.getScriptLocation()+"projCode/"+n+".js";Proj4js.loadScript(t,Proj4js.bind(this.loadProjCodeSuccess,this,n),Proj4js.bind(this.loadProjCodeFailure,this,n),Proj4js.bind(this.checkCodeLoaded,this,n))},loadProjCodeSuccess:function(n){Proj4js.Proj[n].dependsOn?this.loadProjCode(Proj4js.Proj[n].dependsOn):this.initTransforms()},loadProjCodeFailure:function(n){Proj4js.reportError("failed to find projection file for: "+n)},checkCodeLoaded:function(n){return Proj4js.Proj[n]?!0:!1},initTransforms:function(){if(Proj4js.extend(this,Proj4js.Proj[this.projName]),this.init(),this.readyToUse=!0,this.queue)for(var n;n=this.queue.shift();)n.call(this,this)},wktRE:/^(\w+)\[(.*)\]$/,parseWKT:function(n){var h=n.match(this.wktRE),f,e,s,t,u;if(h){var c=h[1],v=h[2],l=v.split(","),i;i=c.toUpperCase()=="TOWGS84"?c:l.shift();i=i.replace(/^\"/,"");i=i.replace(/\"$/,"");var r=[],a=0,o="";for(u=0;u<l.length;++u){for(f=l[u],e=0;e<f.length;++e)f.charAt(e)=="["&&++a,f.charAt(e)=="]"&&--a;o+=f;a===0?(r.push(o),o=""):o+=","}switch(c){case"LOCAL_CS":this.projName="identity";this.localCS=!0;this.srsCode=i;break;case"GEOGCS":this.projName="longlat";this.geocsCode=i;this.srsCode||(this.srsCode=i);break;case"PROJCS":this.srsCode=i;break;case"PROJECTION":this.projName=Proj4js.wktProjections[i];break;case"DATUM":this.datumName=i;break;case"LOCAL_DATUM":this.datumCode="none";break;case"SPHEROID":this.ellps=i;this.a=parseFloat(r.shift());this.rf=parseFloat(r.shift());break;case"PRIMEM":this.from_greenwich=parseFloat(r.shift());break;case"UNIT":this.units=i;this.unitsPerMeter=parseFloat(r.shift());break;case"PARAMETER":s=i.toLowerCase();t=parseFloat(r.shift());switch(s){case"false_easting":this.x0=t;break;case"false_northing":this.y0=t;break;case"scale_factor":this.k0=t;break;case"central_meridian":this.long0=t*Proj4js.common.D2R;break;case"latitude_of_origin":this.lat0=t*Proj4js.common.D2R}break;case"TOWGS84":this.datum_params=r;break;case"AXIS":s=i.toLowerCase();t=r.shift();switch(t){case"EAST":t="e";break;case"WEST":t="w";break;case"NORTH":t="n";break;case"SOUTH":t="s";break;case"UP":t="u";break;case"DOWN":t="d";break;case"OTHER":default:t=" "}this.axis||(this.axis="enu");switch(s){case"x":this.axis=t+this.axis.substr(1,2);break;case"y":this.axis=this.axis.substr(0,1)+t+this.axis.substr(2,1);break;case"z":this.axis=this.axis.substr(0,2)+t}}for(u=0;u<r.length;++u)this.parseWKT(r[u])}},parseDefs:function(){var f,n,r,t,u,i;if(this.defData=Proj4js.defs[this.srsCode],this.defData){for(r=this.defData.split("+"),t=0;t<r.length;t++){u=r[t].split("=");f=u[0].toLowerCase();n=u[1];switch(f.replace(/\s/gi,"")){case"title":this.title=n;break;case"proj":this.projName=n.replace(/\s/gi,"");break;case"units":this.units=n.replace(/\s/gi,"");break;case"datum":this.datumCode=n.replace(/\s/gi,"");break;case"nadgrids":this.nagrids=n.replace(/\s/gi,"");break;case"ellps":this.ellps=n.replace(/\s/gi,"");break;case"a":this.a=parseFloat(n);break;case"b":this.b=parseFloat(n);break;case"rf":this.rf=parseFloat(n);break;case"lat_0":this.lat0=n*Proj4js.common.D2R;break;case"lat_1":this.lat1=n*Proj4js.common.D2R;break;case"lat_2":this.lat2=n*Proj4js.common.D2R;break;case"lat_ts":this.lat_ts=n*Proj4js.common.D2R;break;case"lon_0":this.long0=n*Proj4js.common.D2R;break;case"alpha":this.alpha=parseFloat(n)*Proj4js.common.D2R;break;case"lonc":this.longc=n*Proj4js.common.D2R;break;case"x_0":this.x0=parseFloat(n);break;case"y_0":this.y0=parseFloat(n);break;case"k_0":this.k0=parseFloat(n);break;case"k":this.k0=parseFloat(n);break;case"r_a":this.R_A=!0;break;case"zone":this.zone=parseInt(n,10);break;case"south":this.utmSouth=!0;break;case"towgs84":this.datum_params=n.split(",");break;case"to_meter":this.to_meter=parseFloat(n);break;case"from_greenwich":this.from_greenwich=n*Proj4js.common.D2R;break;case"pm":n=n.replace(/\s/gi,"");this.from_greenwich=Proj4js.PrimeMeridian[n]?Proj4js.PrimeMeridian[n]:parseFloat(n);this.from_greenwich*=Proj4js.common.D2R;break;case"axis":n=n.replace(/\s/gi,"");i="ewnsud";n.length==3&&i.indexOf(n.substr(0,1))!=-1&&i.indexOf(n.substr(1,1))!=-1&&i.indexOf(n.substr(2,1))!=-1&&(this.axis=n)}}this.deriveConstants()}},deriveConstants:function(){var n,t;this.nagrids=="@null"&&(this.datumCode="none");this.datumCode&&this.datumCode!="none"&&(n=Proj4js.Datum[this.datumCode],n&&(this.datum_params=n.towgs84?n.towgs84.split(","):null,this.ellps=n.ellipse,this.datumName=n.datumName?n.datumName:this.datumCode));this.a||(t=Proj4js.Ellipsoid[this.ellps]?Proj4js.Ellipsoid[this.ellps]:Proj4js.Ellipsoid.WGS84,Proj4js.extend(this,t));this.rf&&!this.b&&(this.b=(1-1/this.rf)*this.a);(this.rf===0||Math.abs(this.a-this.b)<Proj4js.common.EPSLN)&&(this.sphere=!0,this.b=this.a);this.a2=this.a*this.a;this.b2=this.b*this.b;this.es=(this.a2-this.b2)/this.a2;this.e=Math.sqrt(this.es);this.R_A&&(this.a*=1-this.es*(Proj4js.common.SIXTH+this.es*(Proj4js.common.RA4+this.es*Proj4js.common.RA6)),this.a2=this.a*this.a,this.b2=this.b*this.b,this.es=0);this.ep2=(this.a2-this.b2)/this.b2;this.k0||(this.k0=1);this.axis||(this.axis="enu");this.datum=new Proj4js.datum(this)}});Proj4js.Proj.longlat={init:function(){},forward:function(n){return n},inverse:function(n){return n}};Proj4js.Proj.identity=Proj4js.Proj.longlat;Proj4js.defs={WGS84:"+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","EPSG:4326":"+title=long/lat:WGS84 +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees","EPSG:4269":"+title=long/lat:NAD83 +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees","EPSG:3875":"+title= Google Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"};Proj4js.defs["EPSG:3785"]=Proj4js.defs["EPSG:3875"];Proj4js.defs.GOOGLE=Proj4js.defs["EPSG:3875"];Proj4js.defs["EPSG:900913"]=Proj4js.defs["EPSG:3875"];Proj4js.defs["EPSG:102113"]=Proj4js.defs["EPSG:3875"];Proj4js.common={PI:3.1415926535897931,HALF_PI:1.5707963267948966,TWO_PI:6.2831853071795862,FORTPI:.78539816339744828,R2D:57.295779513082323,D2R:.017453292519943295,SEC_TO_RAD:484813681109536e-20,EPSLN:1e-10,MAX_ITER:20,COS_67P5:.38268343236508978,AD_C:1.0026,PJD_UNKNOWN:0,PJD_3PARAM:1,PJD_7PARAM:2,PJD_GRIDSHIFT:3,PJD_WGS84:4,PJD_NODATUM:5,SRS_WGS84_SEMIMAJOR:6378137,SIXTH:.16666666666666666,RA4:.047222222222222221,RA6:.022156084656084655,RV4:.069444444444444448,RV6:.042438271604938273,msfnz:function(n,t,i){var r=n*t;return i/Math.sqrt(1-r*r)},tsfnz:function(n,t,i){var r=n*i,u=.5*n;return r=Math.pow((1-r)/(1+r),u),Math.tan(.5*(this.HALF_PI-t))/r},phi2z:function(n,t){for(var e=.5*n,r,u,i=this.HALF_PI-2*Math.atan(t),f=0;f<=15;f++)if(r=n*Math.sin(i),u=this.HALF_PI-2*Math.atan(t*Math.pow((1-r)/(1+r),e))-i,i+=u,Math.abs(u)<=1e-10)return i;return alert("phi2z has NoConvergence"),-9999},qsfnz:function(n,t){var i;return n>1e-7?(i=n*t,(1-n*n)*(t/(1-i*i)-.5/n*Math.log((1-i)/(1+i)))):2*t},asinz:function(n){return Math.abs(n)>1&&(n=n>1?1:-1),Math.asin(n)},e0fn:function(n){return 1-.25*n*(1+n/16*(3+1.25*n))},e1fn:function(n){return.375*n*(1+.25*n*(1+.46875*n))},e2fn:function(n){return.05859375*n*n*(1+.75*n)},e3fn:function(n){return n*n*n*(35/3072)},mlfn:function(n,t,i,r,u){return n*u-t*Math.sin(2*u)+i*Math.sin(4*u)-r*Math.sin(6*u)},srat:function(n,t){return Math.pow((1-n)/(1+n),t)},sign:function(n){return n<0?-1:1},adjust_lon:function(n){return Math.abs(n)<this.PI?n:n-this.sign(n)*this.TWO_PI},adjust_lat:function(n){return Math.abs(n)<this.HALF_PI?n:n-this.sign(n)*this.PI},latiso:function(n,t,i){if(Math.abs(t)>this.HALF_PI)return+Number.NaN;if(t==this.HALF_PI)return Number.POSITIVE_INFINITY;if(t==-1*this.HALF_PI)return-1*Number.POSITIVE_INFINITY;var r=n*i;return Math.log(Math.tan((this.HALF_PI+t)/2))+n*Math.log((1-r)/(1+r))/2},fL:function(n,t){return 2*Math.atan(n*Math.exp(t))-this.HALF_PI},invlatiso:function(n,t){var i=this.fL(1,t),r=0,u=0;do r=i,u=n*Math.sin(r),i=this.fL(Math.exp(n*Math.log((1+u)/(1-u))/2),t);while(Math.abs(i-r)>1e-12);return i},sinh:function(n){var t=Math.exp(n);return(t-1/t)/2},cosh:function(n){var t=Math.exp(n);return(t+1/t)/2},tanh:function(n){var t=Math.exp(n);return(t-1/t)/(t+1/t)},asinh:function(n){var t=n>=0?1:-1;return t*Math.log(Math.abs(n)+Math.sqrt(n*n+1))},acosh:function(n){return 2*Math.log(Math.sqrt((n+1)/2)+Math.sqrt((n-1)/2))},atanh:function(n){return Math.log((n-1)/(n+1))/2},gN:function(n,t,i){var r=t*i;return n/Math.sqrt(1-r*r)},pj_enfn:function(n){var t=[],i;return t[0]=this.C00-n*(this.C02+n*(this.C04+n*(this.C06+n*this.C08))),t[1]=n*(this.C22-n*(this.C04+n*(this.C06+n*this.C08))),i=n*n,t[2]=i*(this.C44-n*(this.C46+n*this.C48)),i*=n,t[3]=i*(this.C66-n*this.C68),t[4]=i*n*this.C88,t},pj_mlfn:function(n,t,i,r){return i*=t,t*=t,r[0]*n-i*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))},pj_inv_mlfn:function(n,t,i){for(var f,u,o=1/(1-t),r=n,e=Proj4js.common.MAX_ITER;e;--e)if(f=Math.sin(r),u=1-t*f*f,u=(this.pj_mlfn(r,f,Math.cos(r),i)-n)*u*Math.sqrt(u)*o,r-=u,Math.abs(u)<Proj4js.common.EPSLN)return r;return Proj4js.reportError("cass:pj_inv_mlfn: Convergence error"),r},C00:1,C02:.25,C04:.046875,C06:.01953125,C08:.01068115234375,C22:.75,C44:.46875,C46:.013020833333333334,C48:.007120768229166667,C66:.36458333333333331,C68:.005696614583333333,C88:.3076171875};Proj4js.datum=Proj4js.Class({initialize:function(n){if(this.datum_type=Proj4js.common.PJD_WGS84,n.datumCode&&n.datumCode=="none"&&(this.datum_type=Proj4js.common.PJD_NODATUM),n&&n.datum_params){for(var t=0;t<n.datum_params.length;t++)n.datum_params[t]=parseFloat(n.datum_params[t]);(n.datum_params[0]!=0||n.datum_params[1]!=0||n.datum_params[2]!=0)&&(this.datum_type=Proj4js.common.PJD_3PARAM);n.datum_params.length>3&&(n.datum_params[3]!=0||n.datum_params[4]!=0||n.datum_params[5]!=0||n.datum_params[6]!=0)&&(this.datum_type=Proj4js.common.PJD_7PARAM,n.datum_params[3]*=Proj4js.common.SEC_TO_RAD,n.datum_params[4]*=Proj4js.common.SEC_TO_RAD,n.datum_params[5]*=Proj4js.common.SEC_TO_RAD,n.datum_params[6]=n.datum_params[6]/1e6+1)}n&&(this.a=n.a,this.b=n.b,this.es=n.es,this.ep2=n.ep2,this.datum_params=n.datum_params)},compare_datums:function(n){return this.datum_type!=n.datum_type?!1:this.a!=n.a||Math.abs(this.es-n.es)>5e-11?!1:this.datum_type==Proj4js.common.PJD_3PARAM?this.datum_params[0]==n.datum_params[0]&&this.datum_params[1]==n.datum_params[1]&&this.datum_params[2]==n.datum_params[2]:this.datum_type==Proj4js.common.PJD_7PARAM?this.datum_params[0]==n.datum_params[0]&&this.datum_params[1]==n.datum_params[1]&&this.datum_params[2]==n.datum_params[2]&&this.datum_params[3]==n.datum_params[3]&&this.datum_params[4]==n.datum_params[4]&&this.datum_params[5]==n.datum_params[5]&&this.datum_params[6]==n.datum_params[6]:this.datum_type==Proj4js.common.PJD_GRIDSHIFT||n.datum_type==Proj4js.common.PJD_GRIDSHIFT?(alert("ERROR: Grid shift transformations are not implemented."),!1):!0},geodetic_to_geocentric:function(n){var i=n.x,t=n.y,f=n.z?n.z:0,o,s,h,r,u,c,e;if(t<-Proj4js.common.HALF_PI&&t>-1.001*Proj4js.common.HALF_PI)t=-Proj4js.common.HALF_PI;else if(t>Proj4js.common.HALF_PI&&t<1.001*Proj4js.common.HALF_PI)t=Proj4js.common.HALF_PI;else if(t<-Proj4js.common.HALF_PI||t>Proj4js.common.HALF_PI)return Proj4js.reportError("geocent:lat out of range:"+t),null;return i>Proj4js.common.PI&&(i-=2*Proj4js.common.PI),u=Math.sin(t),e=Math.cos(t),c=u*u,r=this.a/Math.sqrt(1-this.es*c),o=(r+f)*e*Math.cos(i),s=(r+f)*e*Math.sin(i),h=(r*(1-this.es)+f)*u,n.x=o,n.y=s,n.z=h,0},geocentric_to_geodetic:function(n){var e=1e-12,tt=e*e,o,s,w,i,r,h,c,l,t,a,v,b,nt,k,u=n.x,f=n.y,y=n.z?n.z:0,d,g,p;if(nt=!1,o=Math.sqrt(u*u+f*f),s=Math.sqrt(u*u+f*f+y*y),o/this.a<e){if(nt=!0,d=0,s/this.a<e){g=Proj4js.common.HALF_PI;p=-this.b;return}}else d=Math.atan2(f,u);w=y/s;i=o/s;r=1/Math.sqrt(1-this.es*(2-this.es)*i*i);l=i*(1-this.es)*r;t=w*r;k=0;do k++,c=this.a/Math.sqrt(1-this.es*t*t),p=o*l+y*t-c*(1-this.es*t*t),h=this.es*c/(c+p),r=1/Math.sqrt(1-h*(2-h)*i*i),a=i*(1-h)*r,v=w*r,b=v*l-a*t,l=a,t=v;while(b*b>tt&&k<30);return g=Math.atan(v/Math.abs(a)),n.x=d,n.y=g,n.z=p,n},geocentric_to_geodetic_noniter:function(n){var r=n.x,t=n.y,i=n.z?n.z:0,f,e,p,o,w,h,c,b,k,l,g,a,s,u,v,y,d;if(r=parseFloat(r),t=parseFloat(t),i=parseFloat(i),d=!1,r!=0)f=Math.atan2(t,r);else if(t>0)f=Proj4js.common.HALF_PI;else if(t<0)f=-Proj4js.common.HALF_PI;else if(d=!0,f=0,i>0)e=Proj4js.common.HALF_PI;else if(i<0)e=-Proj4js.common.HALF_PI;else{e=Proj4js.common.HALF_PI;p=-this.b;return}return w=r*r+t*t,o=Math.sqrt(w),h=i*Proj4js.common.AD_C,b=Math.sqrt(h*h+w),l=h/b,a=o/b,g=l*l*l,c=i+this.b*this.ep2*g,y=o-this.a*this.es*a*a*a,k=Math.sqrt(c*c+y*y),s=c/k,u=y/k,v=this.a/Math.sqrt(1-this.es*s*s),p=u>=Proj4js.common.COS_67P5?o/u-v:u<=-Proj4js.common.COS_67P5?o/-u-v:i/s+v*(this.es-1),d==!1&&(e=Math.atan(s/u)),n.x=f,n.y=e,n.z=p,n},geocentric_to_wgs84:function(n){if(this.datum_type==Proj4js.common.PJD_3PARAM)n.x+=this.datum_params[0],n.y+=this.datum_params[1],n.z+=this.datum_params[2];else if(this.datum_type==Proj4js.common.PJD_7PARAM){var f=this.datum_params[0],e=this.datum_params[1],o=this.datum_params[2],i=this.datum_params[3],r=this.datum_params[4],u=this.datum_params[5],t=this.datum_params[6],s=t*(n.x-u*n.y+r*n.z)+f,h=t*(u*n.x+n.y-i*n.z)+e,c=t*(-r*n.x+i*n.y+n.z)+o;n.x=s;n.y=h;n.z=c}},geocentric_from_wgs84:function(n){if(this.datum_type==Proj4js.common.PJD_3PARAM)n.x-=this.datum_params[0],n.y-=this.datum_params[1],n.z-=this.datum_params[2];else if(this.datum_type==Proj4js.common.PJD_7PARAM){var s=this.datum_params[0],h=this.datum_params[1],c=this.datum_params[2],f=this.datum_params[3],e=this.datum_params[4],o=this.datum_params[5],t=this.datum_params[6],i=(n.x-s)/t,r=(n.y-h)/t,u=(n.z-c)/t;n.x=i+o*r-e*u;n.y=-o*i+r+f*u;n.z=e*i-f*r+u}}});Proj4js.Point=Proj4js.Class({initialize:function(n,t,i){if(typeof n=="object")this.x=n[0],this.y=n[1],this.z=n[2]||0;else if(typeof n=="string"&&typeof t=="undefined"){var r=n.split(",");this.x=parseFloat(r[0]);this.y=parseFloat(r[1]);this.z=parseFloat(r[2])||0}else this.x=n,this.y=t,this.z=i||0},clone:function(){return new Proj4js.Point(this.x,this.y,this.z)},toString:function(){return"x="+this.x+",y="+this.y},toShortString:function(){return this.x+", "+this.y}});Proj4js.PrimeMeridian={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};Proj4js.Ellipsoid={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},"APL4.":{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};Proj4js.Datum={WGS84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},GGRS87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},NAD83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},NAD27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},OSGB36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"}};Proj4js.WGS84=new Proj4js.Proj("WGS84");Proj4js.Datum.OSB36=Proj4js.Datum.OSGB36;Proj4js.wktProjections={"Lambert Tangential Conformal Conic Projection":"lcc",Mercator:"merc","Popular Visualisation Pseudo Mercator":"merc",Mercator_1SP:"merc",Transverse_Mercator:"tmerc","Transverse Mercator":"tmerc","Lambert Azimuthal Equal Area":"laea","Universal Transverse Mercator System":"utm"};Proj4js.Proj.aea={init:function(){if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("aeaInitEqualLatitudes");return}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e3=Math.sqrt(this.es);this.sin_po=Math.sin(this.lat1);this.cos_po=Math.cos(this.lat1);this.t1=this.sin_po;this.con=this.sin_po;this.ms1=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po);this.qs1=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);this.sin_po=Math.sin(this.lat2);this.cos_po=Math.cos(this.lat2);this.t2=this.sin_po;this.ms2=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po);this.qs2=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);this.sin_po=Math.sin(this.lat0);this.cos_po=Math.cos(this.lat0);this.t3=this.sin_po;this.qs0=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);this.ns0=Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con;this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0},forward:function(n){var u=n.x,t=n.y;this.sin_phi=Math.sin(t);this.cos_phi=Math.cos(t);var f=Proj4js.common.qsfnz(this.e3,this.sin_phi,this.cos_phi),i=this.a*Math.sqrt(this.c-this.ns0*f)/this.ns0,r=this.ns0*Proj4js.common.adjust_lon(u-this.long0),e=i*Math.sin(r)+this.x0,o=this.rh-i*Math.cos(r)+this.y0;return n.x=e,n.y=o,n},inverse:function(n){var r,i,t,u,e,f;return n.x-=this.x0,n.y=this.rh-n.y+this.y0,this.ns0>=0?(r=Math.sqrt(n.x*n.x+n.y*n.y),t=1):(r=-Math.sqrt(n.x*n.x+n.y*n.y),t=-1),u=0,r!=0&&(u=Math.atan2(t*n.x,t*n.y)),t=r*this.ns0/this.a,i=(this.c-t*t)/this.ns0,this.e3>=1e-10?(t=1-.5*(1-this.es)*Math.log((1-this.e3)/(1+this.e3))/this.e3,f=Math.abs(Math.abs(t)-Math.abs(i))>1e-10?this.phi1z(this.e3,i):i>=0?.5*Proj4js.common.PI:-.5*Proj4js.common.PI):f=this.phi1z(this.e3,i),e=Proj4js.common.adjust_lon(u/this.ns0+this.long0),n.x=e,n.y=f,n},phi1z:function(n,t){var f,s,r,u,e,i=Proj4js.common.asinz(.5*t),h,o;if(n<Proj4js.common.EPSLN)return i;for(h=n*n,o=1;o<=25;o++)if(f=Math.sin(i),s=Math.cos(i),r=n*f,u=1-r*r,e=.5*u*u/s*(t/(1-h)-f/u+.5/n*Math.log((1-r)/(1+r))),i=i+e,Math.abs(e)<=1e-7)return i;return Proj4js.reportError("aea:phi1z:Convergence error"),null}};Proj4js.Proj.sterea={dependsOn:"gauss",init:function(){if(Proj4js.Proj.gauss.init.apply(this),!this.rc){Proj4js.reportError("sterea:init:E_ERROR_0");return}this.sinc0=Math.sin(this.phic0);this.cosc0=Math.cos(this.phic0);this.R2=2*this.rc;this.title||(this.title="Oblique Stereographic Alternative")},forward:function(n){var i,t,r,u;return n.x=Proj4js.common.adjust_lon(n.x-this.long0),Proj4js.Proj.gauss.forward.apply(this,[n]),i=Math.sin(n.y),t=Math.cos(n.y),r=Math.cos(n.x),u=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*t*r),n.x=u*t*Math.sin(n.x),n.y=u*(this.cosc0*i-this.sinc0*t*r),n.x=this.a*n.x+this.x0,n.y=this.a*n.y+this.y0,n},inverse:function(n){var t,r,u,f,i,e;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(i=Math.sqrt(n.x*n.x+n.y*n.y))?(e=2*Math.atan2(i,this.R2),t=Math.sin(e),r=Math.cos(e),f=Math.asin(r*this.sinc0+n.y*t*this.cosc0/i),u=Math.atan2(n.x*t,i*this.cosc0*r-n.y*this.sinc0*t)):(f=this.phic0,u=0),n.x=u,n.y=f,Proj4js.Proj.gauss.inverse.apply(this,[n]),n.x=Proj4js.common.adjust_lon(n.x+this.long0),n}};Proj4js.Proj.poly={init:function(){this.lat0==0&&(this.lat0=90);this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(n){var t,o,i,s,u,f,e,h=n.x,r=n.y;return i=Proj4js.common.adjust_lon(h-this.long0),Math.abs(r)<=1e-7?(f=this.x0+this.a*i,e=this.y0-this.a*this.ml0):(t=Math.sin(r),o=Math.cos(r),s=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,r),u=Proj4js.common.msfnz(this.e,t,o),i=t,f=this.x0+this.a*u*Math.sin(i)/t,e=this.y0+this.a*(s-this.ml0+u*(1-Math.cos(i))/t)),n.x=f,n.y=e,n},inverse:function(n){var t,f,e,i,u,r;if(n.x-=this.x0,n.y-=this.y0,t=this.ml0+n.y/this.a,i=0,Math.abs(t)<=1e-7)u=n.x/this.a+this.long0,r=0;else{if(f=t*t+n.x/this.a*(n.x/this.a),i=phi4z(this.es,this.e0,this.e1,this.e2,this.e3,this.al,f,e,r),i!=1)return i;u=Proj4js.common.adjust_lon(Proj4js.common.asinz(n.x*e/this.a)/Math.sin(r)+this.long0)}return n.x=u,n.y=r,n}};Proj4js.Proj.equi={init:function(){this.x0||(this.x0=0);this.y0||(this.y0=0);this.lat0||(this.lat0=0);this.long0||(this.long0=0)},forward:function(n){var i=n.x,r=n.y,u=Proj4js.common.adjust_lon(i-this.long0),t=this.x0+this.a*u*Math.cos(this.lat0),f=this.y0+this.a*r;return this.t1=t,this.t2=Math.cos(this.lat0),n.x=t,n.y=f,n},inverse:function(n){var t,i;n.x-=this.x0;n.y-=this.y0;t=n.y/this.a;Math.abs(t)>Proj4js.common.HALF_PI&&Proj4js.reportError("equi:Inv:DataError");i=Proj4js.common.adjust_lon(this.long0+n.x/(this.a*Math.cos(this.lat0)));n.x=i;n.y=t}};Proj4js.Proj.merc={init:function(){this.lat_ts&&(this.k0=this.sphere?Math.cos(this.lat_ts):Proj4js.common.msfnz(this.es,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(n){var i=n.x,t=n.y,r,u,f,e;return t*Proj4js.common.R2D>90&&t*Proj4js.common.R2D<-90&&i*Proj4js.common.R2D>180&&i*Proj4js.common.R2D<-180?(Proj4js.reportError("merc:forward: llInputOutOfRange: "+i+" : "+t),null):Math.abs(Math.abs(t)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN?(Proj4js.reportError("merc:forward: ll2mAtPoles"),null):(this.sphere?(r=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(i-this.long0),u=this.y0+this.a*this.k0*Math.log(Math.tan(Proj4js.common.FORTPI+.5*t))):(f=Math.sin(t),e=Proj4js.common.tsfnz(this.e,t,f),r=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(i-this.long0),u=this.y0-this.a*this.k0*Math.log(e)),n.x=r,n.y=u,n)},inverse:function(n){var f=n.x-this.x0,i=n.y-this.y0,r,t,u;if(this.sphere)t=Proj4js.common.HALF_PI-2*Math.atan(Math.exp(-i/this.a*this.k0));else if(u=Math.exp(-i/(this.a*this.k0)),t=Proj4js.common.phi2z(this.e,u),t==-9999)return Proj4js.reportError("merc:inverse: lat = -9999"),null;return r=Proj4js.common.adjust_lon(this.long0+f/(this.a*this.k0)),n.x=r,n.y=t,n}};Proj4js.Proj.utm={dependsOn:"tmerc",init:function(){if(!this.zone){Proj4js.reportError("utm:init: zone must be specified for UTM");return}this.lat0=0;this.long0=(6*Math.abs(this.zone)-183)*Proj4js.common.D2R;this.x0=5e5;this.y0=this.utmSouth?1e7:0;this.k0=.9996;Proj4js.Proj.tmerc.init.apply(this);this.forward=Proj4js.Proj.tmerc.forward;this.inverse=Proj4js.Proj.tmerc.inverse}};Proj4js.Proj.eqdc={init:function(){this.mode||(this.mode=0);this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi);this.ml1=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1);this.mode!=0?(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN&&Proj4js.reportError("eqdc:Init:EqualLatitudes"),this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi),this.ml2=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=Math.abs(this.lat1-this.lat2)>=Proj4js.common.EPSLN?(this.ms1-this.ms2)/(this.ml2-this.ml1):this.sinphi):this.ns=this.sinphi;this.g=this.ml1+this.ms1/this.ns;this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)},forward:function(n){var r=n.x,u=n.y,f=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,u),t=this.a*(this.g-f),i=this.ns*Proj4js.common.adjust_lon(r-this.long0),e=this.x0+t*Math.sin(i),o=this.y0+this.rh-t*Math.cos(i);return n.x=e,n.y=o,n},inverse:function(n){var t,i,r;n.x-=this.x0;n.y=this.rh-n.y+this.y0;this.ns>=0?(i=Math.sqrt(n.x*n.x+n.y*n.y),t=1):(i=-Math.sqrt(n.x*n.x+n.y*n.y),t=-1);r=0;i!=0&&(r=Math.atan2(t*n.x,t*n.y));var u=this.g-i/this.a,f=this.phi3z(u,this.e0,this.e1,this.e2,this.e3),e=Proj4js.common.adjust_lon(this.long0+r/this.ns);return n.x=e,n.y=f,n},phi3z:function(n,t,i,r,u){for(var e,f=n,o=0;o<15;o++)if(e=(n+i*Math.sin(2*f)-r*Math.sin(4*f)+u*Math.sin(6*f))/t-f,f+=e,Math.abs(e)<=1e-10)return f;return Proj4js.reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations"),null}};Proj4js.Proj.tmerc={init:function(){this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(n){var p=n.x,u=n.y,s=Proj4js.common.adjust_lon(p-this.long0),t,h,c,w=Math.sin(u),o=Math.cos(u),i,l,y;if(this.sphere){if(i=o*Math.sin(s),Math.abs(Math.abs(i)-1)<1e-10)return Proj4js.reportError("tmerc:forward: Point projects into infinity"),93;h=.5*this.a*this.k0*Math.log((1+i)/(1-i));t=Math.acos(o*Math.cos(s)/Math.sqrt(1-i*i));u<0&&(t=-t);c=this.a*this.k0*(t-this.lat0)}else{var a=o*s,f=Math.pow(a,2),e=this.ep2*Math.pow(o,2),v=Math.tan(u),r=Math.pow(v,2);t=1-this.es*Math.pow(w,2);l=this.a/Math.sqrt(t);y=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,u);h=this.k0*l*a*(1+f/6*(1-r+e+f/20*(5-18*r+Math.pow(r,2)+72*e-58*this.ep2)))+this.x0;c=this.k0*(y-this.ml0+l*v*f*(.5+f/24*(5-r+9*e+4*Math.pow(e,2)+f/30*(61-58*r+Math.pow(r,2)+600*e-330*this.ep2))))+this.y0}return n.x=h,n.y=c,n},inverse:function(n){var i,t,c,l,r,o,b,a;if(this.sphere){var p=Math.exp(n.x/(this.a*this.k0)),s=.5*(p-1/p),w=this.lat0+n.y/(this.a*this.k0),h=Math.cos(w);i=Math.sqrt((1-h*h)/(1+s*s));r=Proj4js.common.asinz(i);w<0&&(r=-r);o=s==0&&h==0?this.long0:Proj4js.common.adjust_lon(Math.atan2(s,h)+this.long0)}else{for(b=n.x-this.x0,a=n.y-this.y0,i=(this.ml0+a/this.k0)/this.a,t=i,l=0;;l++){if(c=(i+this.e1*Math.sin(2*t)-this.e2*Math.sin(4*t)+this.e3*Math.sin(6*t))/this.e0-t,t+=c,Math.abs(c)<=Proj4js.common.EPSLN)break;if(l>=6)return Proj4js.reportError("tmerc:inverse: Latitude failed to converge"),95}if(Math.abs(t)<Proj4js.common.HALF_PI){var tt=Math.sin(t),k=Math.cos(t),d=Math.tan(t),u=this.ep2*Math.pow(k,2),v=Math.pow(u,2),f=Math.pow(d,2),g=Math.pow(f,2);i=1-this.es*Math.pow(tt,2);var y=this.a/Math.sqrt(i),it=y*(1-this.es)/i,nt=b/(y*this.k0),e=Math.pow(nt,2);r=t-y*d*e/it*(.5-e/24*(5+3*f+10*u-4*v-9*this.ep2-e/30*(61+90*f+298*u+45*g-252*this.ep2-3*v)));o=Proj4js.common.adjust_lon(this.long0+nt*(1-e/6*(1+2*f+u-e/20*(5-2*u+28*f-3*v+8*this.ep2+24*g)))/k)}else r=Proj4js.common.HALF_PI*Proj4js.common.sign(a),o=this.long0}return n.x=o,n.y=r,n}};Proj4js.defs.GOOGLE="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";Proj4js.defs["EPSG:900913"]=Proj4js.defs.GOOGLE;Proj4js.Proj.gstmerc={init:function(){var i=this.b/this.a;this.e=Math.sqrt(1-i*i);this.lc=this.long0;this.rs=Math.sqrt(1+this.e*this.e*Math.pow(Math.cos(this.lat0),4)/(1-this.e*this.e));var n=Math.sin(this.lat0),t=Math.asin(n/this.rs),r=Math.sin(t);this.cp=Proj4js.common.latiso(0,t,r)-this.rs*Proj4js.common.latiso(this.e,this.lat0,n);this.n2=this.k0*this.a*Math.sqrt(1-this.e*this.e)/(1-this.e*this.e*n*n);this.xs=this.x0;this.ys=this.y0-this.n2*t;this.title||(this.title="Gauss Schreiber transverse mercator")},forward:function(n){var f=n.x,t=n.y,i=this.rs*(f-this.lc),r=this.cp+this.rs*Proj4js.common.latiso(this.e,t,Math.sin(t)),u=Math.asin(Math.sin(i)/Proj4js.common.cosh(r)),e=Proj4js.common.latiso(0,u,Math.sin(u));return n.x=this.xs+this.n2*e,n.y=this.ys+this.n2*Math.atan(Proj4js.common.sinh(r)/Math.cos(i)),n},inverse:function(n){var t=n.x,i=n.y,u=Math.atan(Proj4js.common.sinh((t-this.xs)/this.n2)/Math.cos((i-this.ys)/this.n2)),r=Math.asin(Math.sin((i-this.ys)/this.n2)/Proj4js.common.cosh((t-this.xs)/this.n2)),f=Proj4js.common.latiso(0,r,Math.sin(r));return n.x=this.lc+u/this.rs,n.y=Proj4js.common.invlatiso(this.e,(f-this.cp)/this.rs),n}};Proj4js.Proj.ortho={init:function(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)},forward:function(n){var i,t,r,u,f,e,c=n.x,o=n.y,s,h;return r=Proj4js.common.adjust_lon(c-this.long0),i=Math.sin(o),t=Math.cos(o),u=Math.cos(r),e=this.sin_p14*i+this.cos_p14*t*u,f=1,e>0||Math.abs(e)<=Proj4js.common.EPSLN?(s=this.a*f*t*Math.sin(r),h=this.y0+this.a*f*(this.cos_p14*i-this.sin_p14*t*u)):Proj4js.reportError("orthoFwdPointError"),n.x=s,n.y=h,n},inverse:function(n){var t,r,o,u,f,e,i;return n.x-=this.x0,n.y-=this.y0,t=Math.sqrt(n.x*n.x+n.y*n.y),t>this.a+1e-7&&Proj4js.reportError("orthoInvDataError"),r=Proj4js.common.asinz(t/this.a),o=Math.sin(r),u=Math.cos(r),e=this.long0,Math.abs(t)<=Proj4js.common.EPSLN&&(i=this.lat0),i=Proj4js.common.asinz(u*this.sin_p14+n.y*o*this.cos_p14/t),f=Math.abs(this.lat0)-Proj4js.common.HALF_PI,Math.abs(f)<=Proj4js.common.EPSLN&&(e=this.lat0>=0?Proj4js.common.adjust_lon(this.long0+Math.atan2(n.x,-n.y)):Proj4js.common.adjust_lon(this.long0-Math.atan2(-n.x,n.y))),f=u-this.sin_p14*Math.sin(i),n.x=e,n.y=i,n}};Proj4js.Proj.krovak={init:function(){this.a=6377397.155;this.es=.006674372230614;this.e=Math.sqrt(this.es);this.lat0||(this.lat0=.863937979737193);this.long0||(this.long0=.74176493209759009-.308341501185665);this.k0||(this.k0=.9999);this.s45=.785398163397448;this.s90=2*this.s45;this.fi0=this.lat0;this.e2=this.es;this.e=Math.sqrt(this.e2);this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2));this.uq=1.04216856380474;this.u0=Math.asin(Math.sin(this.fi0)/this.alfa);this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2);this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g;this.k1=this.k0;this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2));this.s0=1.37008346281555;this.n=Math.sin(this.s0);this.ro0=this.k1*this.n0/Math.tan(this.s0);this.ad=this.s90-this.uq},forward:function(n){var o,t,i,r,s,u,f,h=n.x,e=n.y,c=Proj4js.common.adjust_lon(h-this.long0);return o=Math.pow((1+this.e*Math.sin(e))/(1-this.e*Math.sin(e)),this.alfa*this.e/2),t=2*(Math.atan(this.k*Math.pow(Math.tan(e/2+this.s45),this.alfa)/o)-this.s45),i=-c*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(t)+Math.sin(this.ad)*Math.cos(t)*Math.cos(i)),s=Math.asin(Math.cos(t)*Math.sin(i)/Math.cos(r)),u=this.n*s,f=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),n.y=f*Math.cos(u)/1,n.x=f*Math.sin(u)/1,this.czech&&(n.y*=-1,n.x*=-1),n},inverse:function(n){var i,o,r,f,s,h,t,e,c=n.x,u;n.x=n.y;n.y=c;this.czech&&(n.y*=-1,n.x*=-1);h=Math.sqrt(n.x*n.x+n.y*n.y);s=Math.atan2(n.y,n.x);f=s/Math.sin(this.s0);r=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45);i=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(f));o=Math.asin(Math.cos(r)*Math.sin(f)/Math.cos(i));n.x=this.long0-o/this.alfa;t=i;e=0;u=0;do n.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(t))/(1-this.e*Math.sin(t)),this.e/2))-this.s45),Math.abs(t-n.y)<1e-10&&(e=1),t=n.y,u+=1;while(e==0&&u<15);return u>=15?(Proj4js.reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations"),null):n}};Proj4js.Proj.somerc={init:function(){var i=this.lat0;this.lambda0=this.long0;var t=Math.sin(i),f=this.a,e=this.rf,u=1/e,n=2*u-Math.pow(u,2),r=this.e=Math.sqrt(n);this.R=this.k0*f*Math.sqrt(1-n)/(1-n*Math.pow(t,2));this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(i),4));this.b0=Math.asin(t/this.alpha);this.K=Math.log(Math.tan(Math.PI/4+this.b0/2))-this.alpha*Math.log(Math.tan(Math.PI/4+i/2))+this.alpha*r/2*Math.log((1+r*t)/(1-r*t))},forward:function(n){var u=Math.log(Math.tan(Math.PI/4-n.y/2)),f=this.e/2*Math.log((1+this.e*Math.sin(n.y))/(1-this.e*Math.sin(n.y))),e=-this.alpha*(u+f)+this.K,t=2*(Math.atan(Math.exp(e))-Math.PI/4),i=this.alpha*(n.x-this.lambda0),o=Math.atan(Math.sin(i)/(Math.sin(this.b0)*Math.tan(t)+Math.cos(this.b0)*Math.cos(i))),r=Math.asin(Math.cos(this.b0)*Math.sin(t)-Math.sin(this.b0)*Math.cos(t)*Math.cos(i));return n.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,n.x=this.R*o+this.x0,n},inverse:function(n){for(var o=n.x-this.x0,s=n.y-this.y0,i=o/this.R,r=2*(Math.atan(Math.exp(s/this.R))-Math.PI/4),u=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(i)),h=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(r))),c=this.lambda0+h/this.alpha,f=0,t=u,e=-1e3,l=0;Math.abs(t-e)>1e-7;){if(++l>20){Proj4js.reportError("omercFwdInfinity");return}f=1/this.alpha*(Math.log(Math.tan(Math.PI/4+u/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(t))/2));e=t;t=2*Math.atan(Math.exp(f))-Math.PI/2}return n.x=c,n.y=t,n}};Proj4js.Proj.stere={ssfn_:function(n,t,i){return t*=i,Math.tan(.5*(Proj4js.common.HALF_PI+n))*Math.pow((1-t)/(1+t),.5*i)},TOL:1e-8,NITER:8,CONV:1e-10,S_POLE:0,N_POLE:1,OBLIQ:2,EQUIT:3,init:function(){var n,t;if(this.phits=this.lat_ts?this.lat_ts:Proj4js.common.HALF_PI,n=Math.abs(this.lat0),this.mode=Math.abs(n)-Proj4js.common.HALF_PI<Proj4js.common.EPSLN?this.lat0<0?this.S_POLE:this.N_POLE:n>Proj4js.common.EPSLN?this.OBLIQ:this.EQUIT,this.phits=Math.abs(this.phits),this.es)switch(this.mode){case this.N_POLE:case this.S_POLE:Math.abs(this.phits-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN?this.akm1=2*this.k0/Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)):(n=Math.sin(this.phits),this.akm1=Math.cos(this.phits)/Proj4js.common.tsfnz(this.e,this.phits,n),n*=this.e,this.akm1/=Math.sqrt(1-n*n));break;case this.EQUIT:this.akm1=2*this.k0;break;case this.OBLIQ:n=Math.sin(this.lat0);t=2*Math.atan(this.ssfn_(this.lat0,n,this.e))-Proj4js.common.HALF_PI;n*=this.e;this.akm1=2*this.k0*Math.cos(this.lat0)/Math.sqrt(1-n*n);this.sinX1=Math.sin(t);this.cosX1=Math.cos(t)}else switch(this.mode){case this.OBLIQ:this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0);case this.EQUIT:this.akm1=2*this.k0;break;case this.S_POLE:case this.N_POLE:this.akm1=Math.abs(this.phits-Proj4js.common.HALF_PI)>=Proj4js.common.EPSLN?Math.cos(this.phits)/Math.tan(Proj4js.common.FORTPI-.5*this.phits):2*this.k0}},forward:function(n){var e=n.x,r,u,t,f,o,i,s,l,h,a,c;if(e=Proj4js.common.adjust_lon(e-this.long0),r=n.y,this.sphere){f=Math.sin(r);o=Math.cos(r);i=Math.cos(e);s=Math.sin(e);switch(this.mode){case this.EQUIT:t=1+o*i;t<=Proj4js.common.EPSLN&&Proj4js.reportError("stere:forward:Equit");t=this.akm1/t;u=t*o*s;t*=f;break;case this.OBLIQ:t=1+this.sinph0*f+this.cosph0*o*i;t<=Proj4js.common.EPSLN&&Proj4js.reportError("stere:forward:Obliq");t=this.akm1/t;u=t*o*s;t*=this.cosph0*f-this.sinph0*o*i;break;case this.N_POLE:i=-i;r=-r;case this.S_POLE:Math.abs(r-Proj4js.common.HALF_PI)<this.TOL&&Proj4js.reportError("stere:forward:S_POLE");t=this.akm1*Math.tan(Proj4js.common.FORTPI+.5*r);u=s*t;t*=i}}else{i=Math.cos(e);s=Math.sin(e);f=Math.sin(r);(this.mode==this.OBLIQ||this.mode==this.EQUIT)&&(a=2*Math.atan(this.ssfn_(r,f,this.e)),l=Math.sin(a-Proj4js.common.HALF_PI),h=Math.cos(a));switch(this.mode){case this.OBLIQ:c=this.akm1/(this.cosX1*(1+this.sinX1*l+this.cosX1*h*i));t=c*(this.cosX1*l-this.sinX1*h*i);u=c*h;break;case this.EQUIT:c=2*this.akm1/(1+h*i);t=c*l;u=c*h;break;case this.S_POLE:r=-r;i=-i;f=-f;case this.N_POLE:u=this.akm1*Proj4js.common.tsfnz(this.e,r,f);t=-u*i}u=u*s}return n.x=u*this.a+this.x0,n.y=t*this.a+this.y0,n},inverse:function(n){var i=(n.x-this.x0)/this.a,t=(n.y-this.y0)/this.a,f,r,v,e,o=0,h=0,c,y=0,p=0,w,l,u,a,s;if(this.sphere){u=Math.sqrt(i*i+t*t);l=2*Math.atan(u/this.akm1);a=Math.sin(l);s=Math.cos(l);f=0;switch(this.mode){case this.EQUIT:r=Math.abs(u)<=Proj4js.common.EPSLN?0:Math.asin(t*a/u);(s!=0||i!=0)&&(f=Math.atan2(i*a,s*u));break;case this.OBLIQ:r=Math.abs(u)<=Proj4js.common.EPSLN?this.phi0:Math.asin(s*this.sinph0+t*a*this.cosph0/u);l=s-this.sinph0*Math.sin(r);(l!=0||i!=0)&&(f=Math.atan2(i*a*this.cosph0,l*u));break;case this.N_POLE:t=-t;case this.S_POLE:r=Math.abs(u)<=Proj4js.common.EPSLN?this.phi0:Math.asin(this.mode==this.S_POLE?-s:s);f=i==0&&t==0?0:Math.atan2(i,t)}n.x=Proj4js.common.adjust_lon(f+this.long0);n.y=r}else{c=Math.sqrt(i*i+t*t);switch(this.mode){case this.OBLIQ:case this.EQUIT:o=2*Math.atan2(c*this.cosX1,this.akm1);v=Math.cos(o);e=Math.sin(o);h=c==0?Math.asin(v*this.sinX1):Math.asin(v*this.sinX1+t*e*this.cosX1/c);o=Math.tan(.5*(Proj4js.common.HALF_PI+h));i*=e;t=c*this.cosX1*v-t*this.sinX1*e;p=Proj4js.common.HALF_PI;y=.5*this.e;break;case this.N_POLE:t=-t;case this.S_POLE:o=-c/this.akm1;h=Proj4js.common.HALF_PI-2*Math.atan(o);p=-Proj4js.common.HALF_PI;y=-.5*this.e}for(w=this.NITER;w--;h=r)if(e=this.e*Math.sin(h),r=2*Math.atan(o*Math.pow((1+e)/(1-e),y))-p,Math.abs(h-r)<this.CONV)return this.mode==this.S_POLE&&(r=-r),f=i==0&&t==0?0:Math.atan2(i,t),n.x=Proj4js.common.adjust_lon(f+this.long0),n.y=r,n}}};Proj4js.Proj.nzmg={iterations:1,init:function(){this.A=[];this.A[1]=.6399175073;this.A[2]=-.1358797613;this.A[3]=.063294409;this.A[4]=-.02526853;this.A[5]=.0117879;this.A[6]=-.0055161;this.A[7]=.0026906;this.A[8]=-.001333;this.A[9]=.00067;this.A[10]=-.00034;this.B_re=[];this.B_im=[];this.B_re[1]=.7557853228;this.B_im[1]=0;this.B_re[2]=.249204646;this.B_im[2]=.003371507;this.B_re[3]=-.001541739;this.B_im[3]=.04105856;this.B_re[4]=-.10162907;this.B_im[4]=.01727609;this.B_re[5]=-.26623489;this.B_im[5]=-.36249218;this.B_re[6]=-.6870983;this.B_im[6]=-1.1651967;this.C_re=[];this.C_im=[];this.C_re[1]=1.3231270439;this.C_im[1]=0;this.C_re[2]=-.577245789;this.C_im[2]=-.007809598;this.C_re[3]=.508307513;this.C_im[3]=-.112208952;this.C_re[4]=-.15094762;this.C_im[4]=.18200602;this.C_re[5]=1.01418179;this.C_im[5]=1.64497696;this.C_re[6]=1.9660549;this.C_im[6]=2.5127645;this.D=[];this.D[1]=1.5627014243;this.D[2]=.5185406398;this.D[3]=-.03333098;this.D[4]=-.1052906;this.D[5]=-.0368594;this.D[6]=.007317;this.D[7]=.0122;this.D[8]=.00394;this.D[9]=-.0013},forward:function(n){for(var a=n.x,v=n.y,y=v-this.lat0,p=a-this.long0,w=y/Proj4js.common.SEC_TO_RAD*1e-5,b=p,u=1,f=0,t=1;t<=10;t++)u=u*w,f=f+this.A[t]*u;var s=f,h=b,i=1,r=0,c,l,e=0,o=0;for(t=1;t<=6;t++)c=i*s-r*h,l=r*s+i*h,i=c,r=l,e=e+this.B_re[t]*i-this.B_im[t]*r,o=o+this.B_im[t]*i+this.B_re[t]*r;return n.x=o*this.a+this.x0,n.y=e*this.a+this.y0,n},inverse:function(n){for(var w,e,o,b,tt,it,rt=n.x,ut=n.y,ft=rt-this.x0,et=ut-this.y0,y=et/this.a,p=ft/this.a,s=1,h=0,g,nt,u=0,f=0,t=1;t<=6;t++)g=s*y-h*p,nt=h*y+s*p,s=g,h=nt,u=u+this.C_re[t]*s-this.C_im[t]*h,f=f+this.C_im[t]*s+this.C_re[t]*h;for(w=0;w<this.iterations;w++){var i=u,r=f,c,l,a=y,v=p;for(t=2;t<=6;t++)c=i*u-r*f,l=r*u+i*f,i=c,r=l,a=a+(t-1)*(this.B_re[t]*i-this.B_im[t]*r),v=v+(t-1)*(this.B_im[t]*i+this.B_re[t]*r);for(i=1,r=0,e=this.B_re[1],o=this.B_im[1],t=2;t<=6;t++)c=i*u-r*f,l=r*u+i*f,i=c,r=l,e=e+t*(this.B_re[t]*i-this.B_im[t]*r),o=o+t*(this.B_im[t]*i+this.B_re[t]*r);b=e*e+o*o;u=(a*e+v*o)/b;f=(v*e-a*o)/b}var ot=u,st=f,k=1,d=0;for(t=1;t<=9;t++)k=k*ot,d=d+this.D[t]*k;return tt=this.lat0+d*Proj4js.common.SEC_TO_RAD*1e5,it=this.long0+st,n.x=it,n.y=tt,n}};Proj4js.Proj.mill={init:function(){},forward:function(n){var t=n.x,i=n.y,r=Proj4js.common.adjust_lon(t-this.long0),u=this.x0+this.a*r,f=this.y0+this.a*Math.log(Math.tan(Proj4js.common.PI/4+i/2.5))*1.25;return n.x=u,n.y=f,n},inverse:function(n){n.x-=this.x0;n.y-=this.y0;var t=Proj4js.common.adjust_lon(this.long0+n.x/this.a),i=2.5*(Math.atan(Math.exp(.8*n.y/this.a))-Proj4js.common.PI/4);return n.x=t,n.y=i,n}};Proj4js.Proj.gnom={init:function(){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1e3*this.a;this.rc=1},forward:function(n){var r,t,u,f,e,i,o,s,c=n.x,h=n.y;return u=Proj4js.common.adjust_lon(c-this.long0),r=Math.sin(h),t=Math.cos(h),f=Math.cos(u),i=this.sin_p14*r+this.cos_p14*t*f,e=1,i>0||Math.abs(i)<=Proj4js.common.EPSLN?(o=this.x0+this.a*e*t*Math.sin(u)/i,s=this.y0+this.a*e*(this.cos_p14*r-this.sin_p14*t*f)/i):(Proj4js.reportError("orthoFwdPointError"),o=this.x0+this.infinity_dist*t*Math.sin(u),s=this.y0+this.infinity_dist*(this.cos_p14*r-this.sin_p14*t*f)),n.x=o,n.y=s,n},inverse:function(n){var i,r,u,f,t,e;return n.x=(n.x-this.x0)/this.a,n.y=(n.y-this.y0)/this.a,n.x/=this.k0,n.y/=this.k0,(i=Math.sqrt(n.x*n.x+n.y*n.y))?(f=Math.atan2(i,this.rc),r=Math.sin(f),u=Math.cos(f),e=Proj4js.common.asinz(u*this.sin_p14+n.y*r*this.cos_p14/i),t=Math.atan2(n.x*r,i*this.cos_p14*u-n.y*this.sin_p14*r),t=Proj4js.common.adjust_lon(this.long0+t)):(e=this.phic0,t=0),n.x=t,n.y=e,n}};Proj4js.Proj.sinu={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Proj4js.common.pj_enfn(this.es)},forward:function(n){var u,f,i=n.x,t=n.y,h,e,o,r,s;if(i=Proj4js.common.adjust_lon(i-this.long0),this.sphere){if(this.m){for(h=this.n*Math.sin(t),e=Proj4js.common.MAX_ITER;e;--e)if(o=(this.m*t+Math.sin(t)-h)/(this.m+Math.cos(t)),t-=o,Math.abs(o)<Proj4js.common.EPSLN)break}else t=this.n!=1?Math.asin(this.n*Math.sin(t)):t;u=this.a*this.C_x*i*(this.m+Math.cos(t));f=this.a*this.C_y*t}else r=Math.sin(t),s=Math.cos(t),f=this.a*Proj4js.common.pj_mlfn(t,r,s,this.en),u=this.a*i*s/Math.sqrt(1-this.es*r*r);return n.x=u,n.y=f,n},inverse:function(n){var t,u,r,i;return n.x-=this.x0,n.y-=this.y0,t=n.y/this.a,this.sphere?(n.y/=this.C_y,t=this.m?Math.asin((this.m*n.y+Math.sin(n.y))/this.n):this.n!=1?Math.asin(Math.sin(n.y)/this.n):n.y,r=n.x/(this.C_x*(this.m+Math.cos(n.y)))):(t=Proj4js.common.pj_inv_mlfn(n.y/this.a,this.es,this.en),i=Math.abs(t),i<Proj4js.common.HALF_PI?(i=Math.sin(t),u=this.long0+n.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),r=Proj4js.common.adjust_lon(u)):i-Proj4js.common.EPSLN<Proj4js.common.HALF_PI&&(r=this.long0)),n.x=r,n.y=t,n}};Proj4js.Proj.vandg={init:function(){this.R=6370997},forward:function(n){var y=n.x,u=n.y,f=Proj4js.common.adjust_lon(y-this.long0),s,h,e;Math.abs(u)<=Proj4js.common.EPSLN&&(s=this.x0+this.R*f,h=this.y0);e=Proj4js.common.asinz(2*Math.abs(u/Proj4js.common.PI));(Math.abs(f)<=Proj4js.common.EPSLN||Math.abs(Math.abs(u)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN)&&(s=this.x0,h=u>=0?this.y0+Proj4js.common.PI*this.R*Math.tan(.5*e):this.y0+Proj4js.common.PI*this.R*-Math.tan(.5*e));var o=.5*Math.abs(Proj4js.common.PI/f-f/Proj4js.common.PI),c=o*o,l=Math.sin(e),a=Math.cos(e),i=a/(l+a-1),p=i*i,v=i*(2/l-1),r=v*v,t=Proj4js.common.PI*this.R*(o*(i-r)+Math.sqrt(c*(i-r)*(i-r)-(r+c)*(p-r)))/(r+c);return f<0&&(t=-t),s=this.x0+t,t=Math.abs(t/(Proj4js.common.PI*this.R)),h=u>=0?this.y0+Proj4js.common.PI*this.R*Math.sqrt(1-t*t-2*o*t):this.y0-Proj4js.common.PI*this.R*Math.sqrt(1-t*t-2*o*t),n.x=s,n.y=h,n},inverse:function(n){var h,a,r,t,e,o,u,i,c,s,f,l,v;return n.x-=this.x0,n.y-=this.y0,f=Proj4js.common.PI*this.R,r=n.x/f,t=n.y/f,e=r*r+t*t,o=-Math.abs(t)*(1+e),u=o-2*t*t+r*r,i=-2*o+1+2*t*t+e*e,v=t*t/i+(2*u*u*u/i/i/i-9*o*u/i/i)/27,c=(o-u*u/3/i)/i,s=2*Math.sqrt(-c/3),f=3*v/c/s,Math.abs(f)>1&&(f=f>=0?1:-1),l=Math.acos(f)/3,a=n.y>=0?(-s*Math.cos(l+Proj4js.common.PI/3)-u/3/i)*Proj4js.common.PI:-(-s*Math.cos(l+Proj4js.common.PI/3)-u/3/i)*Proj4js.common.PI,Math.abs(r)<Proj4js.common.EPSLN&&(h=this.long0),h=Proj4js.common.adjust_lon(this.long0+Proj4js.common.PI*(e-1+Math.sqrt(1+2*(r*r-t*t)+e*e))/2/r),n.x=h,n.y=a,n}};Proj4js.Proj.cea={init:function(){},forward:function(n){var t=n.x,i=n.y,r=Proj4js.common.adjust_lon(t-this.long0),u=this.x0+this.a*r*Math.cos(this.lat_ts),f=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);return n.x=u,n.y=f,n},inverse:function(n){n.x-=this.x0;n.y-=this.y0;var t=Proj4js.common.adjust_lon(this.long0+n.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(n.y/this.a*Math.cos(this.lat_ts));return n.x=t,n.y=i,n}};Proj4js.Proj.eqc={init:function(){this.x0||(this.x0=0);this.y0||(this.y0=0);this.lat0||(this.lat0=0);this.long0||(this.long0=0);this.lat_ts||(this.lat_ts=0);this.title||(this.title="Equidistant Cylindrical (Plate Carre)");this.rc=Math.cos(this.lat_ts)},forward:function(n){var t=n.x,i=n.y,r=Proj4js.common.adjust_lon(t-this.long0),u=Proj4js.common.adjust_lat(i-this.lat0);return n.x=this.x0+this.a*r*this.rc,n.y=this.y0+this.a*u,n},inverse:function(n){var t=n.x,i=n.y;return n.x=Proj4js.common.adjust_lon(this.long0+(t-this.x0)/(this.a*this.rc)),n.y=Proj4js.common.adjust_lat(this.lat0+(i-this.y0)/this.a),n}};Proj4js.Proj.cass={init:function(){this.sphere||(this.en=Proj4js.common.pj_enfn(this.es),this.m0=Proj4js.common.pj_mlfn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},C1:.16666666666666666,C2:.0083333333333333332,C3:.041666666666666664,C4:.33333333333333331,C5:.066666666666666666,forward:function(n){var u,r,i=n.x,t=n.y;return i=Proj4js.common.adjust_lon(i-this.long0),this.sphere?(u=Math.asin(Math.cos(t)*Math.sin(i)),r=Math.atan2(Math.tan(t),Math.cos(i))-this.phi0):(this.n=Math.sin(t),this.c=Math.cos(t),r=Proj4js.common.pj_mlfn(t,this.n,this.c,this.en),this.n=1/Math.sqrt(1-this.es*this.n*this.n),this.tn=Math.tan(t),this.t=this.tn*this.tn,this.a1=i*this.c,this.c*=this.es*this.c/(1-this.es),this.a2=this.a1*this.a1,u=this.n*this.a1*(1-this.a2*this.t*(this.C1-(8-this.t+8*this.c)*this.a2*this.C2)),r-=this.m0-this.n*this.tn*this.a2*(.5+(5-this.t+6*this.c)*this.a2*this.C3)),n.x=this.a*u+this.x0,n.y=this.a*r+this.y0,n},inverse:function(n){var i,r,u,f,t;return n.x-=this.x0,n.y-=this.y0,i=n.x/this.a,r=n.y/this.a,this.sphere?(this.dd=r+this.lat0,u=Math.asin(Math.sin(this.dd)*Math.cos(i)),f=Math.atan2(Math.tan(i),Math.cos(this.dd))):(t=Proj4js.common.pj_inv_mlfn(this.m0+r,this.es,this.en),this.tn=Math.tan(t),this.t=this.tn*this.tn,this.n=Math.sin(t),this.r=1/(1-this.es*this.n*this.n),this.n=Math.sqrt(this.r),this.r*=(1-this.es)*this.n,this.dd=i/this.n,this.d2=this.dd*this.dd,u=t-this.n*this.tn/this.r*this.d2*(.5-(1+3*this.t)*this.d2*this.C3),f=this.dd*(1+this.t*this.d2*(-this.C4+(1+3*this.t)*this.d2*this.C5))/Math.cos(t)),n.x=Proj4js.common.adjust_lon(this.long0+f),n.y=u,n}};Proj4js.Proj.gauss={init:function(){var n=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t;this.rc=Math.sqrt(1-this.es)/(1-this.es*n*n);this.C=Math.sqrt(1+this.es*t*t/(1-this.es));this.phic0=Math.asin(n/this.C);this.ratexp=.5*this.C*this.e;this.K=Math.tan(.5*this.phic0+Proj4js.common.FORTPI)/(Math.pow(Math.tan(.5*this.lat0+Proj4js.common.FORTPI),this.C)*Proj4js.common.srat(this.e*n,this.ratexp))},forward:function(n){var i=n.x,t=n.y;return n.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*t+Proj4js.common.FORTPI),this.C)*Proj4js.common.srat(this.e*Math.sin(t),this.ratexp))-Proj4js.common.HALF_PI,n.x=this.C*i,n},inverse:function(n){for(var r=n.x/this.C,t=n.y,u=Math.pow(Math.tan(.5*t+Proj4js.common.FORTPI)/this.K,1/this.C),i=Proj4js.common.MAX_ITER;i>0;--i){if(t=2*Math.atan(u*Proj4js.common.srat(this.e*Math.sin(n.y),-.5*this.e))-Proj4js.common.HALF_PI,Math.abs(t-n.y)<1e-14)break;n.y=t}return i?(n.x=r,n.y=t,n):(Proj4js.reportError("gauss:inverse:convergence failed"),null)}};Proj4js.Proj.omerc={init:function(){this.mode||(this.mode=0);this.lon1||(this.lon1=0,this.mode=1);this.lon2||(this.lon2=0);this.lat2||(this.lat2=0);var t=this.b/this.a,n=1-Math.pow(t,2),i=Math.sqrt(n);this.sin_p20=Math.sin(this.lat0);this.cos_p20=Math.cos(this.lat0);this.con=1-this.es*this.sin_p20*this.sin_p20;this.com=Math.sqrt(1-n);this.bl=Math.sqrt(1+this.es*Math.pow(this.cos_p20,4)/(1-n));this.al=this.a*this.bl*this.k0*this.com/this.con;Math.abs(this.lat0)<Proj4js.common.EPSLN?(this.ts=1,this.d=1,this.el=1):(this.ts=Proj4js.common.tsfnz(this.e,this.lat0,this.sin_p20),this.con=Math.sqrt(this.con),this.d=this.bl*this.com/(this.cos_p20*this.con),this.f=this.d*this.d-1>0?this.lat0>=0?this.d+Math.sqrt(this.d*this.d-1):this.d-Math.sqrt(this.d*this.d-1):this.d,this.el=this.f*Math.pow(this.ts,this.bl));this.mode!=0?(this.g=.5*(this.f-1/this.f),this.gama=Proj4js.common.asinz(Math.sin(this.alpha)/this.d),this.longc=this.longc-Proj4js.common.asinz(this.g*Math.tan(this.gama))/this.bl,this.con=Math.abs(this.lat0),this.con>Proj4js.common.EPSLN&&Math.abs(this.con-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN?(this.singam=Math.sin(this.gama),this.cosgam=Math.cos(this.gama),this.sinaz=Math.sin(this.alpha),this.cosaz=Math.cos(this.alpha),this.u=this.lat0>=0?this.al/this.bl*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz):-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)):Proj4js.reportError("omerc:Init:DataError")):(this.sinphi=Math.sin(this.at1),this.ts1=Proj4js.common.tsfnz(this.e,this.lat1,this.sinphi),this.sinphi=Math.sin(this.lat2),this.ts2=Proj4js.common.tsfnz(this.e,this.lat2,this.sinphi),this.h=Math.pow(this.ts1,this.bl),this.l=Math.pow(this.ts2,this.bl),this.f=this.el/this.h,this.g=.5*(this.f-1/this.f),this.j=(this.el*this.el-this.l*this.h)/(this.el*this.el+this.l*this.h),this.p=(this.l-this.h)/(this.l+this.h),this.dlon=this.lon1-this.lon2,this.dlon<-Proj4js.common.PI&&(this.lon2=this.lon2-2*Proj4js.common.PI),this.dlon>Proj4js.common.PI&&(this.lon2=this.lon2+2*Proj4js.common.PI),this.dlon=this.lon1-this.lon2,this.longc=.5*(this.lon1+this.lon2)-Math.atan(this.j*Math.tan(.5*this.bl*this.dlon)/this.p)/this.bl,this.dlon=Proj4js.common.adjust_lon(this.lon1-this.longc),this.gama=Math.atan(Math.sin(this.bl*this.dlon)/this.g),this.alpha=Proj4js.common.asinz(this.d*Math.sin(this.gama)),Math.abs(this.lat1-this.lat2)<=Proj4js.common.EPSLN?Proj4js.reportError("omercInitDataError"):this.con=Math.abs(this.lat1),this.con<=Proj4js.common.EPSLN||Math.abs(this.con-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN?Proj4js.reportError("omercInitDataError"):Math.abs(Math.abs(this.lat0)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN&&Proj4js.reportError("omercInitDataError"),this.singam=Math.sin(this.gam),this.cosgam=Math.cos(this.gam),this.sinaz=Math.sin(this.alpha),this.cosaz=Math.cos(this.alpha),this.u=this.lat0>=0?this.al/this.bl*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz):-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz))},forward:function(n){var c,l,f,i,t,o,r,s,h,e,a,p=n.x,u=n.y,v,y;return c=Math.sin(u),e=Proj4js.common.adjust_lon(p-this.longc),o=Math.sin(this.bl*e),Math.abs(Math.abs(u)-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN?(a=Proj4js.common.tsfnz(this.e,u,c),i=this.el/Math.pow(a,this.bl),h=.5*(i-1/i),l=.5*(i+1/i),r=(h*this.singam-o*this.cosgam)/l,f=Math.cos(this.bl*e),Math.abs(f)<1e-7?t=this.al*this.bl*e:(t=this.al*Math.atan((h*this.cosgam+o*this.singam)/f)/this.bl,f<0&&(t=t+Proj4js.common.PI*this.al/this.bl))):(r=u>=0?this.singam:-this.singam,t=this.al*u/this.bl),Math.abs(Math.abs(r)-1)<=Proj4js.common.EPSLN&&Proj4js.reportError("omercFwdInfinity"),s=.5*this.al*Math.log((1-r)/(1+r))/this.bl,t=t-this.u,v=this.x0+s*this.cosaz+t*this.sinaz,y=this.y0+t*this.cosaz-s*this.sinaz,n.x=v,n.y=y,n},inverse:function(n){var h,c,u,l,r,t,f,a,e,i,o,s,v;return n.x-=this.x0,n.y-=this.y0,v=0,l=n.x*this.cosaz-n.y*this.sinaz,r=n.y*this.cosaz+n.x*this.sinaz,r=r+this.u,t=Math.exp(-this.bl*l/this.al),f=.5*(t-1/t),c=.5*(t+1/t),e=Math.sin(this.bl*r/this.al),i=(e*this.cosgam+f*this.singam)/c,Math.abs(Math.abs(i)-1)<=Proj4js.common.EPSLN?(o=this.longc,s=i>=0?Proj4js.common.HALF_PI:-Proj4js.common.HALF_PI):(u=1/this.bl,a=Math.pow(this.el/Math.sqrt((1+i)/(1-i)),u),s=Proj4js.common.phi2z(this.e,a),h=this.longc-Math.atan2(f*this.cosgam-e*this.singam,u)/this.bl,o=Proj4js.common.adjust_lon(h)),n.x=o,n.y=s,n}};Proj4js.Proj.lcc={init:function(){var n;if(this.lat2||(this.lat2=this.lat0),this.k0||(this.k0=1),Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("lcc:init: Equal Latitudes");return}n=this.b/this.a;this.e=Math.sqrt(1-n*n);var t=Math.sin(this.lat1),f=Math.cos(this.lat1),i=Proj4js.common.msfnz(this.e,t,f),r=Proj4js.common.tsfnz(this.e,this.lat1,t),u=Math.sin(this.lat2),e=Math.cos(this.lat2),o=Proj4js.common.msfnz(this.e,u,e),s=Proj4js.common.tsfnz(this.e,this.lat2,u),h=Proj4js.common.tsfnz(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN?Math.log(i/o)/Math.log(r/s):t;this.f0=i/(this.ns*Math.pow(r,this.ns));this.rh=this.a*this.f0*Math.pow(h,this.ns);this.title||(this.title="Lambert Conformal Conic")},forward:function(n){var i=n.x,t=n.y,r,e,u,f;if(!(t<=90)||!(t>=-90)||!(i<=180)||!(i>=-180))return Proj4js.reportError("lcc:forward: llInputOutOfRange: "+i+" : "+t),null;if(r=Math.abs(Math.abs(t)-Proj4js.common.HALF_PI),r>Proj4js.common.EPSLN)e=Proj4js.common.tsfnz(this.e,t,Math.sin(t)),u=this.a*this.f0*Math.pow(e,this.ns);else{if(r=t*this.ns,r<=0)return Proj4js.reportError("lcc:forward: No Projection"),null;u=0}return f=this.ns*Proj4js.common.adjust_lon(i-this.long0),n.x=this.k0*u*Math.sin(f)+this.x0,n.y=this.k0*(this.rh-u*Math.cos(f))+this.y0,n},inverse:function(n){var i,t,o,f,s,r=(n.x-this.x0)/this.k0,u=this.rh-(n.y-this.y0)/this.k0,e;if(this.ns>0?(i=Math.sqrt(r*r+u*u),t=1):(i=-Math.sqrt(r*r+u*u),t=-1),e=0,i!=0&&(e=Math.atan2(t*r,t*u)),i!=0||this.ns>0){if(t=1/this.ns,o=Math.pow(i/(this.a*this.f0),t),f=Proj4js.common.phi2z(this.e,o),f==-9999)return null}else f=-Proj4js.common.HALF_PI;return s=Proj4js.common.adjust_lon(e/this.ns+this.long0),n.x=s,n.y=f,n}};Proj4js.Proj.laea={S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4,init:function(){var t=Math.abs(this.lat0),n;if(this.mode=Math.abs(t-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN?this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<Proj4js.common.EPSLN?this.EQUIT:this.OBLIQ,this.es>0){this.qp=Proj4js.common.qsfnz(this.e,1);this.mmf=.5/(1-this.es);this.apa=this.authset(this.es);switch(this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp);n=Math.sin(this.lat0);this.sinb1=Proj4js.common.qsfnz(this.e,n)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*n*n)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd}}else this.mode==this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(n){var o,t,f=n.x,e=n.y,i,l,s;if(f=Proj4js.common.adjust_lon(f-this.long0),this.sphere){s=Math.sin(e);l=Math.cos(e);i=Math.cos(f);switch(this.mode){case this.OBLIQ:case this.EQUIT:if(t=this.mode==this.EQUIT?1+l*i:1+this.sinph0*s+this.cosph0*l*i,t<=Proj4js.common.EPSLN)return Proj4js.reportError("laea:fwd:y less than eps"),null;t=Math.sqrt(2/t);o=t*l*Math.sin(f);t*=this.mode==this.EQUIT?s:this.cosph0*s-this.sinph0*l*i;break;case this.N_POLE:i=-i;case this.S_POLE:if(Math.abs(e+this.phi0)<Proj4js.common.EPSLN)return Proj4js.reportError("laea:fwd:phi < eps"),null;t=Proj4js.common.FORTPI-e*.5;t=2*(this.mode==this.S_POLE?Math.cos(t):Math.sin(t));o=t*Math.sin(f);t*=i}}else{var i,a,s,u,h=0,c=0,r=0;i=Math.cos(f);a=Math.sin(f);s=Math.sin(e);u=Proj4js.common.qsfnz(this.e,s);(this.mode==this.OBLIQ||this.mode==this.EQUIT)&&(h=u/this.qp,c=Math.sqrt(1-h*h));switch(this.mode){case this.OBLIQ:r=1+this.sinb1*h+this.cosb1*c*i;break;case this.EQUIT:r=1+c*i;break;case this.N_POLE:r=Proj4js.common.HALF_PI+e;u=this.qp-u;break;case this.S_POLE:r=e-Proj4js.common.HALF_PI;u=this.qp+u}if(Math.abs(r)<Proj4js.common.EPSLN)return Proj4js.reportError("laea:fwd:b < eps"),null;switch(this.mode){case this.OBLIQ:case this.EQUIT:r=Math.sqrt(2/r);t=this.mode==this.OBLIQ?this.ymf*r*(this.cosb1*h-this.sinb1*c*i):(r=Math.sqrt(2/(1+c*i)))*h*this.ymf;o=this.xmf*r*c*a;break;case this.N_POLE:case this.S_POLE:u>=0?(o=(r=Math.sqrt(u))*a,t=i*(this.mode==this.S_POLE?r:-r)):o=t=0}}return n.x=this.a*o+this.x0,n.y=this.a*t+this.y0,n},inverse:function(n){var r,t,a,i,h,f,s,l,e,c,o,u;if(n.x-=this.x0,n.y-=this.y0,r=n.x/this.a,t=n.y/this.a,this.sphere){if(h=0,s=0,f=Math.sqrt(r*r+t*t),i=f*.5,i>1)return Proj4js.reportError("laea:Inv:DataError"),null;i=2*Math.asin(i);(this.mode==this.OBLIQ||this.mode==this.EQUIT)&&(s=Math.sin(i),h=Math.cos(i));switch(this.mode){case this.EQUIT:i=Math.abs(f)<=Proj4js.common.EPSLN?0:Math.asin(t*s/f);r*=s;t=h*f;break;case this.OBLIQ:i=Math.abs(f)<=Proj4js.common.EPSLN?this.phi0:Math.asin(h*this.sinph0+t*s*this.cosph0/f);r*=s*this.cosph0;t=(h-Math.sin(i)*this.sinph0)*f;break;case this.N_POLE:t=-t;i=Proj4js.common.HALF_PI-i;break;case this.S_POLE:i-=Proj4js.common.HALF_PI}a=t==0&&(this.mode==this.EQUIT||this.mode==this.OBLIQ)?0:Math.atan2(r,t)}else{u=0;switch(this.mode){case this.EQUIT:case this.OBLIQ:if(r/=this.dd,t*=this.dd,o=Math.sqrt(r*r+t*t),o<Proj4js.common.EPSLN)return n.x=0,n.y=this.phi0,n;e=2*Math.asin(.5*o/this.rq);l=Math.cos(e);r*=e=Math.sin(e);this.mode==this.OBLIQ?(u=l*this.sinb1+t*e*this.cosb1/o,c=this.qp*u,t=o*this.cosb1*l-t*this.sinb1*e):(u=t*e/o,c=this.qp*u,t=o*l);break;case this.N_POLE:t=-t;case this.S_POLE:if(c=r*r+t*t,!c)return n.x=0,n.y=this.phi0,n;u=1-c/this.qp;this.mode==this.S_POLE&&(u=-u)}a=Math.atan2(r,t);i=this.authlat(Math.asin(u),this.apa)}return n.x=Proj4js.common.adjust_lon(this.long0+a),n.y=i,n},P00:.33333333333333331,P01:.17222222222222222,P02:.10257936507936508,P10:.063888888888888884,P11:.0664021164021164,P20:.016415012942191543,authset:function(n){var t,i=[];return i[0]=n*this.P00,t=n*n,i[0]+=t*this.P01,i[1]=t*this.P10,t*=n,i[0]+=t*this.P02,i[1]+=t*this.P11,i[2]=t*this.P20,i},authlat:function(n,t){var i=n+n;return n+t[0]*Math.sin(i)+t[1]*Math.sin(i+i)+t[2]*Math.sin(i+i+i)}};Proj4js.Proj.aeqd={init:function(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)},forward:function(n){var s=n.x,h=n.y,t,f=Math.sin(n.y),i=Math.cos(n.y),e=Proj4js.common.adjust_lon(s-this.long0),o=Math.cos(e),r=this.sin_p12*f+this.cos_p12*i*o,u;if(Math.abs(Math.abs(r)-1)<Proj4js.common.EPSLN){if(t=1,r<0){Proj4js.reportError("aeqd:Fwd:PointError");return}}else u=Math.acos(r),t=u/Math.sin(u);return n.x=this.x0+this.a*t*i*Math.sin(e),n.y=this.y0+this.a*t*(this.cos_p12*f-this.sin_p12*i*o),n},inverse:function(n){var t,i,s;if(n.x-=this.x0,n.y-=this.y0,t=Math.sqrt(n.x*n.x+n.y*n.y),t>2*Proj4js.common.HALF_PI*this.a){Proj4js.reportError("aeqdInvDataError");return}var e=t/this.a,u=Math.sin(e),o=Math.cos(e),f=this.long0,r;return Math.abs(t)<=Proj4js.common.EPSLN?r=this.lat0:(r=Proj4js.common.asinz(o*this.sin_p12+n.y*u*this.cos_p12/t),i=Math.abs(this.lat0)-Proj4js.common.HALF_PI,Math.abs(i)<=Proj4js.common.EPSLN?f=this.lat0>=0?Proj4js.common.adjust_lon(this.long0+Math.atan2(n.x,-n.y)):Proj4js.common.adjust_lon(this.long0-Math.atan2(-n.x,n.y)):(i=o-this.sin_p12*Math.sin(r),Math.abs(i)<Proj4js.common.EPSLN&&Math.abs(n.x)<Proj4js.common.EPSLN||(s=Math.atan2(n.x*u*this.cos_p12,i*t),f=Proj4js.common.adjust_lon(this.long0+Math.atan2(n.x*u*this.cos_p12,i*t))))),n.x=f,n.y=r,n}};Proj4js.Proj.moll={init:function(){},forward:function(n){for(var r,e,o,s=n.x,i=n.y,u=Proj4js.common.adjust_lon(s-this.long0),t=i,h=Proj4js.common.PI*Math.sin(i),f=0;;f++){if(r=-(t+Math.sin(t)-h)/(1+Math.cos(t)),t+=r,Math.abs(r)<Proj4js.common.EPSLN)break;f>=50&&Proj4js.reportError("moll:Fwd:IterationError")}return t/=2,Proj4js.common.PI/2-Math.abs(i)<Proj4js.common.EPSLN&&(u=0),e=.900316316158*this.a*u*Math.cos(t)+this.x0,o=1.4142135623731*this.a*Math.sin(t)+this.y0,n.x=e,n.y=o,n},inverse:function(n){var t,r,i,u;return n.x-=this.x0,t=n.y/(1.4142135623731*this.a),Math.abs(t)>.999999999999&&(t=.999999999999),r=Math.asin(t),i=Proj4js.common.adjust_lon(this.long0+n.x/(.900316316158*this.a*Math.cos(r))),i<-Proj4js.common.PI&&(i=-Proj4js.common.PI),i>Proj4js.common.PI&&(i=Proj4js.common.PI),t=(2*r+Math.sin(2*r))/Proj4js.common.PI,Math.abs(t)>1&&(t=1),u=Math.asin(t),n.x=i,n.y=u,n}};$=jQuery.noConflict();$(document).ready(function(){$(".carouselproduct").each(function(){var n=$(this);n.find(".crsl-content").slick({rtl:!0,prevArrow:"<span class='crsl-button crsl-prev'>PREV<\/span>",nextArrow:"<span class='crsl-button crsl-next'>NEXT<\/span>",lazyLoad:"progressive",slidesToShow:n.attr("slidestoshow")?n.attr("slidestoshow"):4});n.removeClass("lazyload")})}),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports!="undefined"?module.exports=n(require("jquery")):n(jQuery)}(function(n){"use strict";var t=window.Slick||{};t=function(){function i(i,r){var u=this,f;u.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:n(i),appendDots:n(i),arrows:!0,asNavFor:null,prevArrow:'<button type="button" data-role="none" class="slick-prev" aria-label="Previous" tabindex="0" role="button">Previous<\/button>',nextArrow:'<button type="button" data-role="none" class="slick-next" aria-label="Next" tabindex="0" role="button">Next<\/button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,i){return n('<button type="button" data-role="none" role="button" tabindex="0" />').text(i+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3};u.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1};n.extend(u,u.initials);u.activeBreakpoint=null;u.animType=null;u.animProp=null;u.breakpoints=[];u.breakpointSettings=[];u.cssTransitions=!1;u.focussed=!1;u.interrupted=!1;u.hidden="hidden";u.paused=!0;u.positionProp=null;u.respondTo=null;u.rowCount=1;u.shouldClick=!0;u.$slider=n(i);u.$slidesCache=null;u.transformType=null;u.transitionType=null;u.visibilityChange="visibilitychange";u.windowWidth=0;u.windowTimer=null;f=n(i).data("slick")||{};u.options=n.extend({},u.defaults,r,f);u.currentSlide=u.options.initialSlide;u.originalSettings=u.options;typeof document.mozHidden!="undefined"?(u.hidden="mozHidden",u.visibilityChange="mozvisibilitychange"):typeof document.webkitHidden!="undefined"&&(u.hidden="webkitHidden",u.visibilityChange="webkitvisibilitychange");u.autoPlay=n.proxy(u.autoPlay,u);u.autoPlayClear=n.proxy(u.autoPlayClear,u);u.autoPlayIterator=n.proxy(u.autoPlayIterator,u);u.changeSlide=n.proxy(u.changeSlide,u);u.clickHandler=n.proxy(u.clickHandler,u);u.selectHandler=n.proxy(u.selectHandler,u);u.setPosition=n.proxy(u.setPosition,u);u.swipeHandler=n.proxy(u.swipeHandler,u);u.dragHandler=n.proxy(u.dragHandler,u);u.keyHandler=n.proxy(u.keyHandler,u);u.instanceUid=t++;u.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;u.registerBreakpoints();u.init(!0)}var t=0;return i}();t.prototype.activateADA=function(){var n=this;n.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})};t.prototype.addSlide=t.prototype.slickAdd=function(t,i,r){var u=this;if(typeof i=="boolean")r=i,i=null;else if(i<0||i>=u.slideCount)return!1;u.unload();typeof i=="number"?i===0&&u.$slides.length===0?n(t).appendTo(u.$slideTrack):r?n(t).insertBefore(u.$slides.eq(i)):n(t).insertAfter(u.$slides.eq(i)):r===!0?n(t).prependTo(u.$slideTrack):n(t).appendTo(u.$slideTrack);u.$slides=u.$slideTrack.children(this.options.slide);u.$slideTrack.children(this.options.slide).detach();u.$slideTrack.append(u.$slides);u.$slides.each(function(t,i){n(i).attr("data-slick-index",t)});u.$slidesCache=u.$slides;u.reinit()};t.prototype.animateHeight=function(){var n=this,t;n.options.slidesToShow===1&&n.options.adaptiveHeight===!0&&n.options.vertical===!1&&(t=n.$slides.eq(n.currentSlide).outerHeight(!0),n.$list.animate({height:t},n.options.speed))};t.prototype.animateSlide=function(t,i){var u={},r=this;r.animateHeight();r.options.rtl===!0&&r.options.vertical===!1&&(t=-t);r.transformsEnabled===!1?r.options.vertical===!1?r.$slideTrack.animate({left:t},r.options.speed,r.options.easing,i):r.$slideTrack.animate({top:t},r.options.speed,r.options.easing,i):r.cssTransitions===!1?(r.options.rtl===!0&&(r.currentLeft=-r.currentLeft),n({animStart:r.currentLeft}).animate({animStart:t},{duration:r.options.speed,easing:r.options.easing,step:function(n){n=Math.ceil(n);r.options.vertical===!1?(u[r.animType]="translate("+n+"px, 0px)",r.$slideTrack.css(u)):(u[r.animType]="translate(0px,"+n+"px)",r.$slideTrack.css(u))},complete:function(){i&&i.call()}})):(r.applyTransition(),t=Math.ceil(t),u[r.animType]=r.options.vertical===!1?"translate3d("+t+"px, 0px, 0px)":"translate3d(0px,"+t+"px, 0px)",r.$slideTrack.css(u),i&&setTimeout(function(){r.disableTransition();i.call()},r.options.speed))};t.prototype.getNavTarget=function(){var i=this,t=i.options.asNavFor;return t&&t!==null&&(t=n(t).not(i.$slider)),t};t.prototype.asNavFor=function(t){var r=this,i=r.getNavTarget();i!==null&&typeof i=="object"&&i.each(function(){var i=n(this).slick("getSlick");i.unslicked||i.slideHandler(t,!0)})};t.prototype.applyTransition=function(n){var t=this,i={};i[t.transitionType]=t.options.fade===!1?t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:"opacity "+t.options.speed+"ms "+t.options.cssEase;t.options.fade===!1?t.$slideTrack.css(i):t.$slides.eq(n).css(i)};t.prototype.autoPlay=function(){var n=this;n.autoPlayClear();n.slideCount>n.options.slidesToShow&&(n.autoPlayTimer=setInterval(n.autoPlayIterator,n.options.autoplaySpeed))};t.prototype.autoPlayClear=function(){var n=this;n.autoPlayTimer&&clearInterval(n.autoPlayTimer)};t.prototype.autoPlayIterator=function(){var n=this,t=n.currentSlide+n.options.slidesToScroll;n.paused||n.interrupted||n.focussed||(n.options.infinite===!1&&(n.direction===1&&n.currentSlide+1===n.slideCount-1?n.direction=0:n.direction===0&&(t=n.currentSlide-n.options.slidesToScroll,n.currentSlide-1==0&&(n.direction=1))),n.slideHandler(t))};t.prototype.buildArrows=function(){var t=this;t.options.arrows===!0&&(t.$prevArrow=n(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=n(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),t.options.infinite!==!0&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))};t.prototype.buildDots=function(){var t=this,i,r;if(t.options.dots===!0&&t.slideCount>t.options.slidesToShow){for(t.$slider.addClass("slick-dotted"),r=n("<ul />").addClass(t.options.dotsClass),i=0;i<=t.getDotCount();i+=1)r.append(n("<li />").append(t.options.customPaging.call(this,t,i)));t.$dots=r.appendTo(t.options.appendDots);t.$dots.find("li").first().addClass("slick-active").attr("aria-hidden","false")}};t.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide");t.slideCount=t.$slides.length;t.$slides.each(function(t,i){n(i).attr("data-slick-index",t).data("originalStyling",n(i).attr("style")||"")});t.$slider.addClass("slick-slider");t.$slideTrack=t.slideCount===0?n('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent();t.$list=t.$slideTrack.wrap('<div aria-live="polite" class="slick-list"/>').parent();t.$slideTrack.css("opacity",0);(t.options.centerMode===!0||t.options.swipeToSlide===!0)&&(t.options.slidesToScroll=1);n("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading");t.setupInfinite();t.buildArrows();t.buildDots();t.updateDots();t.setSlideClasses(typeof t.currentSlide=="number"?t.currentSlide:0);t.options.draggable===!0&&t.$list.addClass("draggable")};t.prototype.buildRows=function(){var n=this,t,i,r,f,c,u,e,o,s,h;if(f=document.createDocumentFragment(),u=n.$slider.children(),n.options.rows>1){for(e=n.options.slidesPerRow*n.options.rows,c=Math.ceil(u.length/e),t=0;t<c;t++){for(o=document.createElement("div"),i=0;i<n.options.rows;i++){for(s=document.createElement("div"),r=0;r<n.options.slidesPerRow;r++)h=t*e+(i*n.options.slidesPerRow+r),u.get(h)&&s.appendChild(u.get(h));o.appendChild(s)}f.appendChild(o)}n.$slider.empty().append(f);n.$slider.children().children().children().css({width:100/n.options.slidesPerRow+"%",display:"inline-block"})}};t.prototype.checkResponsive=function(t,i){var r=this,f,u,e,o=!1,s=r.$slider.width(),h=window.innerWidth||n(window).width();if(r.respondTo==="window"?e=h:r.respondTo==="slider"?e=s:r.respondTo==="min"&&(e=Math.min(h,s)),r.options.responsive&&r.options.responsive.length&&r.options.responsive!==null){u=null;for(f in r.breakpoints)r.breakpoints.hasOwnProperty(f)&&(r.originalSettings.mobileFirst===!1?e<r.breakpoints[f]&&(u=r.breakpoints[f]):e>r.breakpoints[f]&&(u=r.breakpoints[f]));u!==null?r.activeBreakpoint!==null?(u!==r.activeBreakpoint||i)&&(r.activeBreakpoint=u,r.breakpointSettings[u]==="unslick"?r.unslick(u):(r.options=n.extend({},r.originalSettings,r.breakpointSettings[u]),t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),o=u):(r.activeBreakpoint=u,r.breakpointSettings[u]==="unslick"?r.unslick(u):(r.options=n.extend({},r.originalSettings,r.breakpointSettings[u]),t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t)),o=u):r.activeBreakpoint!==null&&(r.activeBreakpoint=null,r.options=r.originalSettings,t===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(t),o=u);t||o===!1||r.$slider.trigger("breakpoint",[r,o])}};t.prototype.changeSlide=function(t,i){var r=this,u=n(t.currentTarget),f,e,o,s;u.is("a")&&t.preventDefault();u.is("li")||(u=u.closest("li"));o=r.slideCount%r.options.slidesToScroll!=0;f=o?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll;switch(t.data.message){case"previous":e=f===0?r.options.slidesToScroll:r.options.slidesToShow-f;r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-e,!1,i);break;case"next":e=f===0?r.options.slidesToScroll:f;r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+e,!1,i);break;case"index":s=t.data.index===0?0:t.data.index||u.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(s),!1,i);u.children().trigger("focus");break;default:return}};t.prototype.checkNavigable=function(n){var u=this,t,i,r;if(t=u.getNavigableIndexes(),i=0,n>t[t.length-1])n=t[t.length-1];else for(r in t){if(n<t[r]){n=i;break}i=t[r]}return n};t.prototype.cleanUpEvents=function(){var t=this;t.options.dots&&t.$dots!==null&&n("li",t.$dots).off("click.slick",t.changeSlide).off("mouseenter.slick",n.proxy(t.interrupt,t,!0)).off("mouseleave.slick",n.proxy(t.interrupt,t,!1));t.$slider.off("focus.slick blur.slick");t.options.arrows===!0&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow&&t.$prevArrow.off("click.slick",t.changeSlide),t.$nextArrow&&t.$nextArrow.off("click.slick",t.changeSlide));t.$list.off("touchstart.slick mousedown.slick",t.swipeHandler);t.$list.off("touchmove.slick mousemove.slick",t.swipeHandler);t.$list.off("touchend.slick mouseup.slick",t.swipeHandler);t.$list.off("touchcancel.slick mouseleave.slick",t.swipeHandler);t.$list.off("click.slick",t.clickHandler);n(document).off(t.visibilityChange,t.visibility);t.cleanUpSlideEvents();t.options.accessibility===!0&&t.$list.off("keydown.slick",t.keyHandler);t.options.focusOnSelect===!0&&n(t.$slideTrack).children().off("click.slick",t.selectHandler);n(window).off("orientationchange.slick.slick-"+t.instanceUid,t.orientationChange);n(window).off("resize.slick.slick-"+t.instanceUid,t.resize);n("[draggable!=true]",t.$slideTrack).off("dragstart",t.preventDefault);n(window).off("load.slick.slick-"+t.instanceUid,t.setPosition);n(document).off("ready.slick.slick-"+t.instanceUid,t.setPosition)};t.prototype.cleanUpSlideEvents=function(){var t=this;t.$list.off("mouseenter.slick",n.proxy(t.interrupt,t,!0));t.$list.off("mouseleave.slick",n.proxy(t.interrupt,t,!1))};t.prototype.cleanUpRows=function(){var n=this,t;n.options.rows>1&&(t=n.$slides.children().children(),t.removeAttr("style"),n.$slider.empty().append(t))};t.prototype.clickHandler=function(n){var t=this;t.shouldClick===!1&&(n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault())};t.prototype.destroy=function(t){var i=this;i.autoPlayClear();i.touchObject={};i.cleanUpEvents();n(".slick-cloned",i.$slider).detach();i.$dots&&i.$dots.remove();i.$prevArrow&&i.$prevArrow.length&&(i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.prevArrow)&&i.$prevArrow.remove());i.$nextArrow&&i.$nextArrow.length&&(i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),i.htmlExpr.test(i.options.nextArrow)&&i.$nextArrow.remove());i.$slides&&(i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){n(this).attr("style",n(this).data("originalStyling"))}),i.$slideTrack.children(this.options.slide).detach(),i.$slideTrack.detach(),i.$list.detach(),i.$slider.append(i.$slides));i.cleanUpRows();i.$slider.removeClass("slick-slider");i.$slider.removeClass("slick-initialized");i.$slider.removeClass("slick-dotted");i.unslicked=!0;t||i.$slider.trigger("destroy",[i])};t.prototype.disableTransition=function(n){var t=this,i={};i[t.transitionType]="";t.options.fade===!1?t.$slideTrack.css(i):t.$slides.eq(n).css(i)};t.prototype.fadeSlide=function(n,t){var i=this;i.cssTransitions===!1?(i.$slides.eq(n).css({zIndex:i.options.zIndex}),i.$slides.eq(n).animate({opacity:1},i.options.speed,i.options.easing,t)):(i.applyTransition(n),i.$slides.eq(n).css({opacity:1,zIndex:i.options.zIndex}),t&&setTimeout(function(){i.disableTransition(n);t.call()},i.options.speed))};t.prototype.fadeSlideOut=function(n){var t=this;t.cssTransitions===!1?t.$slides.eq(n).animate({opacity:0,zIndex:t.options.zIndex-2},t.options.speed,t.options.easing):(t.applyTransition(n),t.$slides.eq(n).css({opacity:0,zIndex:t.options.zIndex-2}))};t.prototype.filterSlides=t.prototype.slickFilter=function(n){var t=this;n!==null&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(n).appendTo(t.$slideTrack),t.reinit())};t.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*:not(.slick-arrow)",function(i){i.stopImmediatePropagation();var r=n(this);setTimeout(function(){t.options.pauseOnFocus&&(t.focussed=r.is(":focus"),t.autoPlay())},0)})};t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){var n=this;return n.currentSlide};t.prototype.getDotCount=function(){var n=this,i=0,r=0,t=0;if(n.options.infinite===!0)while(i<n.slideCount)++t,i=r+n.options.slidesToScroll,r+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;else if(n.options.centerMode===!0)t=n.slideCount;else if(n.options.asNavFor)while(i<n.slideCount)++t,i=r+n.options.slidesToScroll,r+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;else t=1+Math.ceil((n.slideCount-n.options.slidesToShow)/n.options.slidesToScroll);return t-1};t.prototype.getLeft=function(n){var t=this,f,r,u=0,i;return t.slideOffset=0,r=t.$slides.first().outerHeight(!0),t.options.infinite===!0?(t.slideCount>t.options.slidesToShow&&(t.slideOffset=t.slideWidth*t.options.slidesToShow*-1,u=r*t.options.slidesToShow*-1),t.slideCount%t.options.slidesToScroll!=0&&n+t.options.slidesToScroll>t.slideCount&&t.slideCount>t.options.slidesToShow&&(n>t.slideCount?(t.slideOffset=(t.options.slidesToShow-(n-t.slideCount))*t.slideWidth*-1,u=(t.options.slidesToShow-(n-t.slideCount))*r*-1):(t.slideOffset=t.slideCount%t.options.slidesToScroll*t.slideWidth*-1,u=t.slideCount%t.options.slidesToScroll*r*-1))):n+t.options.slidesToShow>t.slideCount&&(t.slideOffset=(n+t.options.slidesToShow-t.slideCount)*t.slideWidth,u=(n+t.options.slidesToShow-t.slideCount)*r),t.slideCount<=t.options.slidesToShow&&(t.slideOffset=0,u=0),t.options.centerMode===!0&&t.slideCount<=t.options.slidesToShow?t.slideOffset=t.slideWidth*Math.floor(t.options.slidesToShow)/2-t.slideWidth*t.slideCount/2:t.options.centerMode===!0&&t.options.infinite===!0?t.slideOffset+=t.slideWidth*Math.floor(t.options.slidesToShow/2)-t.slideWidth:t.options.centerMode===!0&&(t.slideOffset=0,t.slideOffset+=t.slideWidth*Math.floor(t.options.slidesToShow/2)),f=t.options.vertical===!1?n*t.slideWidth*-1+t.slideOffset:n*r*-1+u,t.options.variableWidth===!0&&(i=t.slideCount<=t.options.slidesToShow||t.options.infinite===!1?t.$slideTrack.children(".slick-slide").eq(n):t.$slideTrack.children(".slick-slide").eq(n+t.options.slidesToShow),f=t.options.rtl===!0?i[0]?(t.$slideTrack.width()-i[0].offsetLeft-i.width())*-1:0:i[0]?i[0].offsetLeft*-1:0,t.options.centerMode===!0&&(i=t.slideCount<=t.options.slidesToShow||t.options.infinite===!1?t.$slideTrack.children(".slick-slide").eq(n):t.$slideTrack.children(".slick-slide").eq(n+t.options.slidesToShow+1),f=(t.options.rtl===!0?i[0]?(t.$slideTrack.width()-i[0].offsetLeft-i.width())*-1:0:i[0]?i[0].offsetLeft*-1:0)+(t.$list.width()-i.outerWidth())/2)),f};t.prototype.getOption=t.prototype.slickGetOption=function(n){var t=this;return t.options[n]};t.prototype.getNavigableIndexes=function(){var n=this,t=0,i=0,u=[],r;for(n.options.infinite===!1?r=n.slideCount:(t=n.options.slidesToScroll*-1,i=n.options.slidesToScroll*-1,r=n.slideCount*2);t<r;)u.push(t),t=i+n.options.slidesToScroll,i+=n.options.slidesToScroll<=n.options.slidesToShow?n.options.slidesToScroll:n.options.slidesToShow;return u};t.prototype.getSlick=function(){return this};t.prototype.getSlideCount=function(){var t=this,i,r;return r=t.options.centerMode===!0?t.slideWidth*Math.floor(t.options.slidesToShow/2):0,t.options.swipeToSlide===!0?(t.$slideTrack.find(".slick-slide").each(function(u,f){if(f.offsetLeft-r+n(f).outerWidth()/2>t.swipeLeft*-1)return i=f,!1}),Math.abs(n(i).attr("data-slick-index")-t.currentSlide)||1):t.options.slidesToScroll};t.prototype.goTo=t.prototype.slickGoTo=function(n,t){var i=this;i.changeSlide({data:{message:"index",index:parseInt(n)}},t)};t.prototype.init=function(t){var i=this;n(i.$slider).hasClass("slick-initialized")||(n(i.$slider).addClass("slick-initialized"),i.buildRows(),i.buildOut(),i.setProps(),i.startLoad(),i.loadSlider(),i.initializeEvents(),i.updateArrows(),i.updateDots(),i.checkResponsive(!0),i.focusHandler());t&&i.$slider.trigger("init",[i]);i.options.accessibility===!0&&i.initADA();i.options.autoplay&&(i.paused=!1,i.autoPlay())};t.prototype.initADA=function(){var t=this;t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"});t.$slideTrack.attr("role","listbox");t.$slides.not(t.$slideTrack.find(".slick-cloned")).each(function(i){n(this).attr("role","option");var r=t.options.centerMode?i:Math.floor(i/t.options.slidesToShow);t.options.dots===!0&&n(this).attr("aria-describedby","slick-slide"+t.instanceUid+r+"")});t.$dots!==null&&t.$dots.attr("role","tablist").find("li").each(function(i){n(this).attr({role:"presentation","aria-selected":"false","aria-controls":"navigation"+t.instanceUid+i+"",id:"slick-slide"+t.instanceUid+i+""})}).first().attr("aria-selected","true").end().find("button").attr("role","button").end().closest("div").attr("role","toolbar");t.activateADA()};t.prototype.initArrowEvents=function(){var n=this;if(n.options.arrows===!0&&n.slideCount>n.options.slidesToShow){n.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},n.changeSlide);n.$nextArrow.off("click.slick").on("click.slick",{message:"next"},n.changeSlide)}};t.prototype.initDotEvents=function(){var t=this;if(t.options.dots===!0&&t.slideCount>t.options.slidesToShow)n("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide);if(t.options.dots===!0&&t.options.pauseOnDotsHover===!0)n("li",t.$dots).on("mouseenter.slick",n.proxy(t.interrupt,t,!0)).on("mouseleave.slick",n.proxy(t.interrupt,t,!1))};t.prototype.initSlideEvents=function(){var t=this;if(t.options.pauseOnHover){t.$list.on("mouseenter.slick",n.proxy(t.interrupt,t,!0));t.$list.on("mouseleave.slick",n.proxy(t.interrupt,t,!1))}};t.prototype.initializeEvents=function(){var t=this;t.initArrowEvents();t.initDotEvents();t.initSlideEvents();t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler);t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler);t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler);t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler);t.$list.on("click.slick",t.clickHandler);n(document).on(t.visibilityChange,n.proxy(t.visibility,t));if(t.options.accessibility===!0)t.$list.on("keydown.slick",t.keyHandler);if(t.options.focusOnSelect===!0)n(t.$slideTrack).children().on("click.slick",t.selectHandler);n(window).on("orientationchange.slick.slick-"+t.instanceUid,n.proxy(t.orientationChange,t));n(window).on("resize.slick.slick-"+t.instanceUid,n.proxy(t.resize,t));n("[draggable!=true]",t.$slideTrack).on("dragstart",t.preventDefault);n(window).on("load.slick.slick-"+t.instanceUid,t.setPosition);n(document).on("ready.slick.slick-"+t.instanceUid,t.setPosition)};t.prototype.initUI=function(){var n=this;n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&(n.$prevArrow.show(),n.$nextArrow.show());n.options.dots===!0&&n.slideCount>n.options.slidesToShow&&n.$dots.show()};t.prototype.keyHandler=function(n){var t=this;n.target.tagName.match("TEXTAREA|INPUT|SELECT")||(n.keyCode===37&&t.options.accessibility===!0?t.changeSlide({data:{message:t.options.rtl===!0?"next":"previous"}}):n.keyCode===39&&t.options.accessibility===!0&&t.changeSlide({data:{message:t.options.rtl===!0?"previous":"next"}}))};t.prototype.lazyLoad=function(){function f(i){n("img[data-lazy]",i).each(function(){var i=n(this),r=n(this).attr("data-lazy"),u=document.createElement("img");u.onload=function(){i.animate({opacity:0},100,function(){i.attr("src",r).animate({opacity:1},200,function(){i.removeAttr("data-lazy").removeClass("slick-loading")});t.$slider.trigger("lazyLoaded",[t,i,r])})};u.onerror=function(){i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error");t.$slider.trigger("lazyLoadError",[t,i,r])};u.src=r})}var t=this,e,r,i,u;t.options.centerMode===!0?t.options.infinite===!0?(i=t.currentSlide+(t.options.slidesToShow/2+1),u=i+t.options.slidesToShow+2):(i=Math.max(0,t.currentSlide-(t.options.slidesToShow/2+1)),u=2+(t.options.slidesToShow/2+1)+t.currentSlide):(i=t.options.infinite?t.options.slidesToShow+t.currentSlide:t.currentSlide,u=Math.ceil(i+t.options.slidesToShow),t.options.fade===!0&&(i>0&&i--,u<=t.slideCount&&u++));e=t.$slider.find(".slick-slide").slice(i,u);f(e);t.slideCount<=t.options.slidesToShow?(r=t.$slider.find(".slick-slide"),f(r)):t.currentSlide>=t.slideCount-t.options.slidesToShow?(r=t.$slider.find(".slick-cloned").slice(0,t.options.slidesToShow),f(r)):t.currentSlide===0&&(r=t.$slider.find(".slick-cloned").slice(t.options.slidesToShow*-1),f(r))};t.prototype.loadSlider=function(){var n=this;n.setPosition();n.$slideTrack.css({opacity:1});n.$slider.removeClass("slick-loading");n.initUI();n.options.lazyLoad==="progressive"&&n.progressiveLazyLoad()};t.prototype.next=t.prototype.slickNext=function(){var n=this;n.changeSlide({data:{message:"next"}})};t.prototype.orientationChange=function(){var n=this;n.checkResponsive();n.setPosition()};t.prototype.pause=t.prototype.slickPause=function(){var n=this;n.autoPlayClear();n.paused=!0};t.prototype.play=t.prototype.slickPlay=function(){var n=this;n.autoPlay();n.options.autoplay=!0;n.paused=!1;n.focussed=!1;n.interrupted=!1};t.prototype.postSlide=function(n){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,n]),t.animating=!1,t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),t.options.accessibility===!0&&t.initADA())};t.prototype.prev=t.prototype.slickPrev=function(){var n=this;n.changeSlide({data:{message:"previous"}})};t.prototype.preventDefault=function(n){n.preventDefault()};t.prototype.progressiveLazyLoad=function(t){t=t||1;var i=this,e=n("img[data-lazy]",i.$slider),r,u,f;e.length?(r=e.first(),u=r.attr("data-lazy"),f=document.createElement("img"),f.onload=function(){r.attr("src",u).removeAttr("data-lazy").removeClass("slick-loading");i.options.adaptiveHeight===!0&&i.setPosition();i.$slider.trigger("lazyLoaded",[i,r,u]);i.progressiveLazyLoad()},f.onerror=function(){t<3?setTimeout(function(){i.progressiveLazyLoad(t+1)},500):(r.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),i.$slider.trigger("lazyLoadError",[i,r,u]),i.progressiveLazyLoad())},f.src=u):i.$slider.trigger("allImagesLoaded",[i])};t.prototype.refresh=function(t){var i=this,r,u;u=i.slideCount-i.options.slidesToShow;!i.options.infinite&&i.currentSlide>u&&(i.currentSlide=u);i.slideCount<=i.options.slidesToShow&&(i.currentSlide=0);r=i.currentSlide;i.destroy(!0);n.extend(i,i.initials,{currentSlide:r});i.init();t||i.changeSlide({data:{message:"index",index:r}},!1)};t.prototype.registerBreakpoints=function(){var t=this,u,f,i,r=t.options.responsive||null;if(n.type(r)==="array"&&r.length){t.respondTo=t.options.respondTo||"window";for(u in r)if(i=t.breakpoints.length-1,f=r[u].breakpoint,r.hasOwnProperty(u)){while(i>=0)t.breakpoints[i]&&t.breakpoints[i]===f&&t.breakpoints.splice(i,1),i--;t.breakpoints.push(f);t.breakpointSettings[f]=r[u].settings}t.breakpoints.sort(function(n,i){return t.options.mobileFirst?n-i:i-n})}};t.prototype.reinit=function(){var t=this;if(t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&t.currentSlide!==0&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),t.options.focusOnSelect===!0)n(t.$slideTrack).children().on("click.slick",t.selectHandler);t.setSlideClasses(typeof t.currentSlide=="number"?t.currentSlide:0);t.setPosition();t.focusHandler();t.paused=!t.options.autoplay;t.autoPlay();t.$slider.trigger("reInit",[t])};t.prototype.resize=function(){var t=this;n(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout(function(){t.windowWidth=n(window).width();t.checkResponsive();t.unslicked||t.setPosition()},50))};t.prototype.removeSlide=t.prototype.slickRemove=function(n,t,i){var r=this;if(typeof n=="boolean"?(t=n,n=t===!0?0:r.slideCount-1):n=t===!0?--n:n,r.slideCount<1||n<0||n>r.slideCount-1)return!1;r.unload();i===!0?r.$slideTrack.children().remove():r.$slideTrack.children(this.options.slide).eq(n).remove();r.$slides=r.$slideTrack.children(this.options.slide);r.$slideTrack.children(this.options.slide).detach();r.$slideTrack.append(r.$slides);r.$slidesCache=r.$slides;r.reinit()};t.prototype.setCSS=function(n){var t=this,i={},r,u;t.options.rtl===!0&&(n=-n);r=t.positionProp=="left"?Math.ceil(n)+"px":"0px";u=t.positionProp=="top"?Math.ceil(n)+"px":"0px";i[t.positionProp]=n;t.transformsEnabled===!1?t.$slideTrack.css(i):(i={},t.cssTransitions===!1?(i[t.animType]="translate("+r+", "+u+")",t.$slideTrack.css(i)):(i[t.animType]="translate3d("+r+", "+u+", 0px)",t.$slideTrack.css(i)))};t.prototype.setDimensions=function(){var n=this,t;n.options.vertical===!1?n.options.centerMode===!0&&n.$list.css({padding:"0px "+n.options.centerPadding}):(n.$list.height(n.$slides.first().outerHeight(!0)*n.options.slidesToShow),n.options.centerMode===!0&&n.$list.css({padding:n.options.centerPadding+" 0px"}));n.listWidth=n.$list.width();n.listHeight=n.$list.height();n.options.vertical===!1&&n.options.variableWidth===!1?(n.slideWidth=Math.ceil(n.listWidth/n.options.slidesToShow),n.$slideTrack.width(Math.ceil(n.slideWidth*n.$slideTrack.children(".slick-slide").length))):n.options.variableWidth===!0?n.$slideTrack.width(5e3*n.slideCount):(n.slideWidth=Math.ceil(n.listWidth),n.$slideTrack.height(Math.ceil(n.$slides.first().outerHeight(!0)*n.$slideTrack.children(".slick-slide").length)));t=n.$slides.first().outerWidth(!0)-n.$slides.first().width();n.options.variableWidth===!1&&n.$slideTrack.children(".slick-slide").width(n.slideWidth-t)};t.prototype.setFade=function(){var t=this,i;t.$slides.each(function(r,u){i=t.slideWidth*r*-1;t.options.rtl===!0?n(u).css({position:"relative",right:i,top:0,zIndex:t.options.zIndex-2,opacity:0}):n(u).css({position:"relative",left:i,top:0,zIndex:t.options.zIndex-2,opacity:0})});t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})};t.prototype.setHeight=function(){var n=this,t;n.options.slidesToShow===1&&n.options.adaptiveHeight===!0&&n.options.vertical===!1&&(t=n.$slides.eq(n.currentSlide).outerHeight(!0),n.$list.css("height",t))};t.prototype.setOption=t.prototype.slickSetOption=function(){var t=this,u,f,e,i,o=!1,r;if(n.type(arguments[0])==="object"?(e=arguments[0],o=arguments[1],r="multiple"):n.type(arguments[0])==="string"&&(e=arguments[0],i=arguments[1],o=arguments[2],arguments[0]==="responsive"&&n.type(arguments[1])==="array"?r="responsive":typeof arguments[1]!="undefined"&&(r="single")),r==="single")t.options[e]=i;else if(r==="multiple")n.each(e,function(n,i){t.options[n]=i});else if(r==="responsive")for(f in i)if(n.type(t.options.responsive)!=="array")t.options.responsive=[i[f]];else{for(u=t.options.responsive.length-1;u>=0;)t.options.responsive[u].breakpoint===i[f].breakpoint&&t.options.responsive.splice(u,1),u--;t.options.responsive.push(i[f])}o&&(t.unload(),t.reinit())};t.prototype.setPosition=function(){var n=this;n.setDimensions();n.setHeight();n.options.fade===!1?n.setCSS(n.getLeft(n.currentSlide)):n.setFade();n.$slider.trigger("setPosition",[n])};t.prototype.setProps=function(){var n=this,t=document.body.style;n.positionProp=n.options.vertical===!0?"top":"left";n.positionProp==="top"?n.$slider.addClass("slick-vertical"):n.$slider.removeClass("slick-vertical");(t.WebkitTransition!==undefined||t.MozTransition!==undefined||t.msTransition!==undefined)&&n.options.useCSS===!0&&(n.cssTransitions=!0);n.options.fade&&(typeof n.options.zIndex=="number"?n.options.zIndex<3&&(n.options.zIndex=3):n.options.zIndex=n.defaults.zIndex);t.OTransform!==undefined&&(n.animType="OTransform",n.transformType="-o-transform",n.transitionType="OTransition",t.perspectiveProperty===undefined&&t.webkitPerspective===undefined&&(n.animType=!1));t.MozTransform!==undefined&&(n.animType="MozTransform",n.transformType="-moz-transform",n.transitionType="MozTransition",t.perspectiveProperty===undefined&&t.MozPerspective===undefined&&(n.animType=!1));t.webkitTransform!==undefined&&(n.animType="webkitTransform",n.transformType="-webkit-transform",n.transitionType="webkitTransition",t.perspectiveProperty===undefined&&t.webkitPerspective===undefined&&(n.animType=!1));t.msTransform!==undefined&&(n.animType="msTransform",n.transformType="-ms-transform",n.transitionType="msTransition",t.msTransform===undefined&&(n.animType=!1));t.transform!==undefined&&n.animType!==!1&&(n.animType="transform",n.transformType="transform",n.transitionType="transition");n.transformsEnabled=n.options.useTransform&&n.animType!==null&&n.animType!==!1};t.prototype.setSlideClasses=function(n){var t=this,u,i,r,f;i=t.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true");t.$slides.eq(n).addClass("slick-current");t.options.centerMode===!0?(u=Math.floor(t.options.slidesToShow/2),t.options.infinite===!0&&(n>=u&&n<=t.slideCount-1-u?t.$slides.slice(n-u,n+u+1).addClass("slick-active").attr("aria-hidden","false"):(r=t.options.slidesToShow+n,i.slice(r-u+1,r+u+2).addClass("slick-active").attr("aria-hidden","false")),n===0?i.eq(i.length-1-t.options.slidesToShow).addClass("slick-center"):n===t.slideCount-1&&i.eq(t.options.slidesToShow).addClass("slick-center")),t.$slides.eq(n).addClass("slick-center")):n>=0&&n<=t.slideCount-t.options.slidesToShow?t.$slides.slice(n,n+t.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):i.length<=t.options.slidesToShow?i.addClass("slick-active").attr("aria-hidden","false"):(f=t.slideCount%t.options.slidesToShow,r=t.options.infinite===!0?t.options.slidesToShow+n:n,t.options.slidesToShow==t.options.slidesToScroll&&t.slideCount-n<t.options.slidesToShow?i.slice(r-(t.options.slidesToShow-f),r+f).addClass("slick-active").attr("aria-hidden","false"):i.slice(r,r+t.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));t.options.lazyLoad==="ondemand"&&t.lazyLoad()};t.prototype.setupInfinite=function(){var t=this,i,r,u;if(t.options.fade===!0&&(t.options.centerMode=!1),t.options.infinite===!0&&t.options.fade===!1&&(r=null,t.slideCount>t.options.slidesToShow)){for(u=t.options.centerMode===!0?t.options.slidesToShow+1:t.options.slidesToShow,i=t.slideCount;i>t.slideCount-u;i-=1)r=i-1,n(t.$slides[r]).clone(!0).attr("id","").attr("data-slick-index",r-t.slideCount).prependTo(t.$slideTrack).addClass("slick-cloned");for(i=0;i<u;i+=1)r=i,n(t.$slides[r]).clone(!0).attr("id","").attr("data-slick-index",r+t.slideCount).appendTo(t.$slideTrack).addClass("slick-cloned");t.$slideTrack.find(".slick-cloned").find("[id]").each(function(){n(this).attr("id","")})}};t.prototype.interrupt=function(n){var t=this;n||t.autoPlay();t.interrupted=n};t.prototype.selectHandler=function(t){var i=this,u=n(t.target).is(".slick-slide")?n(t.target):n(t.target).parents(".slick-slide"),r=parseInt(u.attr("data-slick-index"));if(r||(r=0),i.slideCount<=i.options.slidesToShow){i.setSlideClasses(r);i.asNavFor(r);return}i.slideHandler(r)};t.prototype.slideHandler=function(n,t,i){var u,f,s,o,h=null,r=this,e;if((t=t||!1,r.animating!==!0||r.options.waitForAnimate!==!0)&&(r.options.fade!==!0||r.currentSlide!==n)&&!(r.slideCount<=r.options.slidesToShow)){if(t===!1&&r.asNavFor(n),u=n,h=r.getLeft(u),o=r.getLeft(r.currentSlide),r.currentLeft=r.swipeLeft===null?o:r.swipeLeft,r.options.infinite===!1&&r.options.centerMode===!1&&(n<0||n>r.getDotCount()*r.options.slidesToScroll)){r.options.fade===!1&&(u=r.currentSlide,i!==!0?r.animateSlide(o,function(){r.postSlide(u)}):r.postSlide(u));return}if(r.options.infinite===!1&&r.options.centerMode===!0&&(n<0||n>r.slideCount-r.options.slidesToScroll)){r.options.fade===!1&&(u=r.currentSlide,i!==!0?r.animateSlide(o,function(){r.postSlide(u)}):r.postSlide(u));return}if(r.options.autoplay&&clearInterval(r.autoPlayTimer),f=u<0?r.slideCount%r.options.slidesToScroll!=0?r.slideCount-r.slideCount%r.options.slidesToScroll:r.slideCount+u:u>=r.slideCount?r.slideCount%r.options.slidesToScroll!=0?0:u-r.slideCount:u,r.animating=!0,r.$slider.trigger("beforeChange",[r,r.currentSlide,f]),s=r.currentSlide,r.currentSlide=f,r.setSlideClasses(r.currentSlide),r.options.asNavFor&&(e=r.getNavTarget(),e=e.slick("getSlick"),e.slideCount<=e.options.slidesToShow&&e.setSlideClasses(r.currentSlide)),r.updateDots(),r.updateArrows(),r.options.fade===!0){i!==!0?(r.fadeSlideOut(s),r.fadeSlide(f,function(){r.postSlide(f)})):r.postSlide(f);r.animateHeight();return}i!==!0?r.animateSlide(h,function(){r.postSlide(f)}):r.postSlide(f)}};t.prototype.startLoad=function(){var n=this;n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&(n.$prevArrow.hide(),n.$nextArrow.hide());n.options.dots===!0&&n.slideCount>n.options.slidesToShow&&n.$dots.hide();n.$slider.addClass("slick-loading")};t.prototype.swipeDirection=function(){var i,r,u,n,t=this;return(i=t.touchObject.startX-t.touchObject.curX,r=t.touchObject.startY-t.touchObject.curY,u=Math.atan2(r,i),n=Math.round(u*180/Math.PI),n<0&&(n=360-Math.abs(n)),n<=45&&n>=0)?t.options.rtl===!1?"left":"right":n<=360&&n>=315?t.options.rtl===!1?"left":"right":n>=135&&n<=225?t.options.rtl===!1?"right":"left":t.options.verticalSwiping===!0?n>=35&&n<=135?"down":"up":"vertical"};t.prototype.swipeEnd=function(){var n=this,i,t;if(n.dragging=!1,n.interrupted=!1,n.shouldClick=n.touchObject.swipeLength>10?!1:!0,n.touchObject.curX===undefined)return!1;if(n.touchObject.edgeHit===!0&&n.$slider.trigger("edge",[n,n.swipeDirection()]),n.touchObject.swipeLength>=n.touchObject.minSwipe){t=n.swipeDirection();switch(t){case"left":case"down":i=n.options.swipeToSlide?n.checkNavigable(n.currentSlide+n.getSlideCount()):n.currentSlide+n.getSlideCount();n.currentDirection=0;break;case"right":case"up":i=n.options.swipeToSlide?n.checkNavigable(n.currentSlide-n.getSlideCount()):n.currentSlide-n.getSlideCount();n.currentDirection=1}t!="vertical"&&(n.slideHandler(i),n.touchObject={},n.$slider.trigger("swipe",[n,t]))}else n.touchObject.startX!==n.touchObject.curX&&(n.slideHandler(n.currentSlide),n.touchObject={})};t.prototype.swipeHandler=function(n){var t=this;if(t.options.swipe!==!1&&(!("ontouchend"in document)||t.options.swipe!==!1)&&(t.options.draggable!==!1||n.type.indexOf("mouse")===-1)){t.touchObject.fingerCount=n.originalEvent&&n.originalEvent.touches!==undefined?n.originalEvent.touches.length:1;t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold;t.options.verticalSwiping===!0&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold);switch(n.data.action){case"start":t.swipeStart(n);break;case"move":t.swipeMove(n);break;case"end":t.swipeEnd(n)}}};t.prototype.swipeMove=function(n){var t=this,f,e,r,u,i;if(i=n.originalEvent!==undefined?n.originalEvent.touches:null,!t.dragging||i&&i.length!==1)return!1;if(f=t.getLeft(t.currentSlide),t.touchObject.curX=i!==undefined?i[0].pageX:n.clientX,t.touchObject.curY=i!==undefined?i[0].pageY:n.clientY,t.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(t.touchObject.curX-t.touchObject.startX,2))),t.options.verticalSwiping===!0&&(t.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(t.touchObject.curY-t.touchObject.startY,2)))),e=t.swipeDirection(),e!=="vertical"){if(n.originalEvent!==undefined&&t.touchObject.swipeLength>4&&n.preventDefault(),u=(t.options.rtl===!1?1:-1)*(t.touchObject.curX>t.touchObject.startX?1:-1),t.options.verticalSwiping===!0&&(u=t.touchObject.curY>t.touchObject.startY?1:-1),r=t.touchObject.swipeLength,t.touchObject.edgeHit=!1,t.options.infinite===!1&&(t.currentSlide===0&&e==="right"||t.currentSlide>=t.getDotCount()&&e==="left")&&(r=t.touchObject.swipeLength*t.options.edgeFriction,t.touchObject.edgeHit=!0),t.swipeLeft=t.options.vertical===!1?f+r*u:f+r*(t.$list.height()/t.listWidth)*u,t.options.verticalSwiping===!0&&(t.swipeLeft=f+r*u),t.options.fade===!0||t.options.touchMove===!1)return!1;if(t.animating===!0)return t.swipeLeft=null,!1;t.setCSS(t.swipeLeft)}};t.prototype.swipeStart=function(n){var t=this,i;if(t.interrupted=!0,t.touchObject.fingerCount!==1||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;n.originalEvent!==undefined&&n.originalEvent.touches!==undefined&&(i=n.originalEvent.touches[0]);t.touchObject.startX=t.touchObject.curX=i!==undefined?i.pageX:n.clientX;t.touchObject.startY=t.touchObject.curY=i!==undefined?i.pageY:n.clientY;t.dragging=!0};t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var n=this;n.$slidesCache!==null&&(n.unload(),n.$slideTrack.children(this.options.slide).detach(),n.$slidesCache.appendTo(n.$slideTrack),n.reinit())};t.prototype.unload=function(){var t=this;n(".slick-cloned",t.$slider).remove();t.$dots&&t.$dots.remove();t.$prevArrow&&t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove();t.$nextArrow&&t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove();t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")};t.prototype.unslick=function(n){var t=this;t.$slider.trigger("unslick",[t,n]);t.destroy()};t.prototype.updateArrows=function(){var n=this,t;t=Math.floor(n.options.slidesToShow/2);n.options.arrows===!0&&n.slideCount>n.options.slidesToShow&&!n.options.infinite&&(n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),n.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),n.currentSlide===0?(n.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):n.currentSlide>=n.slideCount-n.options.slidesToShow&&n.options.centerMode===!1?(n.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):n.currentSlide>=n.slideCount-1&&n.options.centerMode===!0&&(n.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),n.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))};t.prototype.updateDots=function(){var n=this;n.$dots!==null&&(n.$dots.find("li").removeClass("slick-active").attr("aria-hidden","true"),n.$dots.find("li").eq(Math.floor(n.currentSlide/n.options.slidesToScroll)).addClass("slick-active").attr("aria-hidden","false"))};t.prototype.visibility=function(){var n=this;n.options.autoplay&&(n.interrupted=document[n.hidden]?!0:!1)};n.fn.slick=function(){for(var i=this,r=arguments[0],f=Array.prototype.slice.call(arguments,1),e=i.length,u,n=0;n<e;n++)if(typeof r=="object"||typeof r=="undefined"?i[n].slick=new t(i[n],r):u=i[n].slick[r].apply(i[n].slick,f),typeof u!="undefined")return u;return i};n(".blog-widget-container-mobile").slick({dots:!1,infinite:!0,arrows:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,autoplaySpeed:4e3})})