SafeDispatch/Safedispatch_4_0/resource/output.min.js
2024-02-22 18:43:59 +02:00

1 line
1.2 MiB
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function DataSetPoint(e,t,i,n,s,r,a,o,l,h,u){this.id=n,this.latitude=e,this.longitude=t,this.time=i,this.name=n,this.speed=s,this.altitude=r,this.address=a,this.icon=o,this.hasVoice=l,this.hasText=h,this.isInCall=u,DataSetPoint.prototype.merge=function(e){return _.extend(this,e),this},DataSetPoint.prototype.getNewIconsColor=function(){var e="default_size",t="#287aab",i=/_[0-9A-F]{6}_[sml]\./;if(this.icon&&i.test(this.icon)){var n=this.icon.split(/[_\.]/).slice(-3,-1);t="#"+n[0],e=n[1]}return{color:t,size:e}},DataSetPoint.prototype.getNewIconsSize=function(){var e=new google.maps.Point(16,48),t={s:new google.maps.Size(-6,-40),m:new google.maps.Size(-2,-33),l:new google.maps.Size(0,-24),default_size:new google.maps.Size(0,-25)},i=this.getNewIconsColor();return{labelOffset:t[i.size],labelColor:i.color,imageMarkerAnchor:e}}}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}function getHrefParam(e){var t=location.href.toLowerCase().split("?");return t.length>1&&(t=t[1].split("&").reduce(function(e,t){var i=t.split("=");return e[i[0]]=i[1],e},{})),t[e]||null}function splitString(e,t,i){for(var n=0,s=0;s<e.length;s++)if(e.charAt(s)===t&&n++,n>i)return log("-----------command split at index: "+i+" / "+e.length+" -----------"),e.slice(0,s);return e}function bindEvents(e,t,i,n){function s(i,n){var s=t.get("center"),r=t.get("zoom");e.centerZoom(s[0],s[1],r)}t.on("change:bounds",function(i,n){e.autosizeOnBounds(n),sendExecTimeSince("set-bounds",this.get("lastUpdated")),t.attributes.bounds=[]}),t.on("change:center change:zoom",s),t.on("change:dimmensions",function(t,i){e.resize(i[0],i[1]),console.log("dimmensions changed to:"+i)}),t.on("change:polygonToGet",function(t,i){var n=i.name;e.getPolygon(n)}),t.on("change:openedMarker",function(i,n){n&&(e.openInfoBubble(n),t.set("openedMarker",""))}),t.on("change:isReset",function(t,i){e.resetAll()}),t.on("change:console",function(e,t){var i=t?"show":"hide";$("#log-area")[i]()}),t.on("change:traffic",function(t,i){e.setTraffic(i)}),t.on("change:legacyicons",function(t,i){e.setLegacyIcons(i)}),t.on("change:isVisible",function(t,s){console.log("map visibility: "+s),s&&(i.forEach(function(t){t.get("isVisible")?t.get("isPolyline")?e.setPoly(!0,t.get("color"),t.get("thickness"),t.get("points"),t.id):e.putPoints(t.get("points"),!0,t.get("isShowLabels")):t.get("isPolyline")&&e.deletePoly(t.id)}),n.forEach(function(t){console.log(t.get("points").length),(t.get("points")||0!==t.get("points").length)&&e.setPolygon(t.id,t.get("color"),t.get("points"),t.get("opacity"),t.get("borderColor"),t.get("borderOpacity"),t.get("borderWidth"),t.get("thickness"))}))}),i.on("add",function(t){t.on("change:isVisible change:lastUpdated",function(t,i){var n="";this.get("isVisible")?this.get("isPolyline")||(e.putPoints(this.get("points"),this.get("isAutosize"),this.get("isShowLabels"),this.get("id")),n="put"):(n="lastUpdated"===Object.keys(t.changedAttributes())[0]?"update":"remove",e.removePoints(this.get("points")),this.get("isPolyline")&&e.deletePoly(this.id)),sendExecTimeSince(n,this.get("lastUpdated"))},t),t.on("change:isShowLabels",function(t,i){var n=i?"put":"remove";e[n+"Labels"](this.get("points")),sendExecTimeSince(n+"-labels",t.get("lastUpdated"))},t),t.on("change:isPolyline change:color",function(t,i){i&&(e.setPoly(!0,t.get("color"),t.get("thickness"),t.get("points"),t.id),t.set("isVisible",!0))})}),i.on("remove",function(e){e.attributes.lastUpdated=new Date,e.set("isVisible",!1),console.log("removed dataset ="+e.get("id"))}),n.on("add",function(t){console.log("polygon added"),t.get("points")&&0!=t.get("points").length?e.setPolygon(t.get("id"),t.get("color"),t.get("points"),t.get("opacity"),t.get("borderColor"),t.get("borderOpacity"),t.get("borderWidth")):e.newPolygon(t.get("id"),t.get("color"),t.get("opacity"),t.get("borderColor"),t.get("borderOpacity"),t.get("borderWidth")),t.on("change:isEditing",function(t,i){i?e.startEditPolygon(t.get("id")):e.endEditPolygon(t.get("id"))}),t.on("change:color change:opacity change:borderColor change:borderWidth change:borderOpacity",function(t,i){var n=Object.keys(t.changedAttributes())[0];console.log(t.get("id")+" polygon changed prop "+n+" = "+i),e.updatePolygon(t.get("id"),n,i)})}),n.on("remove",function(t){e.deletePolygon(t.get("name"))}),n.on("reset",function(t,i){e.deleteAllPolygons()})}function navigate(e){log("sending : "+e);try{"undefined"!=typeof callbackObj&&null!=callbackObj&&callbackObj.callBackMethod("app://"+e)}catch(e){log(e.toString())}}function initialize(){function e(e){function t(e,t,i,n){var s=69.1*(i-e),r=53*(n-t);return Math.sqrt(Math.pow(s,2)+Math.pow(r,2))}var i=e.x,n=e.y,s=e.lat,r=e.lon,a="/nearest/"+i+"/"+n+"/"+parseFloat(s).toFixed(5)+"/"+parseFloat(r).toFixed(5);console.log("Will navigate to:.."+a);var o=new Promise(function(e,s){nearestCallback=function(s,r,a,o,l){l.forEach(function(e){e.speedUnits=e.speed.indexOf("k")<0?"mi":"km";var i="km"==e.speedUnits?1.6:1;e.distance=+(t(a,o,e.latitude,e.longitude)*i).toFixed(2),e.isEnabled=h.markerExists(e.id)}),console.log("Got a nearest reply for "+s+" and "+r+". Registered for "+i+" and "+n+"."),e(l)}});return navigate(a),o}if("osm"==mapProvider)document.getElementById("tools");var t={SfmbMapsMainSatelitte:"satellite",SfmbMapsMain:"hybrid",SfmbMapsMainMap:"map",SfmbMapsMainTerrain:"terrain"}[location.href.split("/").pop().split(".").shift()]||"hybrid",i=new MapProperties,n=new DataSetCollection;globalSets=n;var s=new PolygonCollection,r={divObject:document.getElementById("Map"),polyPointCallback:function(e){var t=e.map(function(e){return e.latitude+","+e.longitude}).join();document.getElementById("click_string").innerHTML=t,navigate("points/"+t)},getPolygonCallback:function(e){var t=e.points&&e.points.map(function(e){return e.latitude+","+e.longitude}).join(),i="["+e.name+","+e.color+","+t+"]";document.getElementById("response_string").innerHTML=i,navigate("polygon/"+i)},landmarkCallback:function(e){var t=e.latitude+","+e.longitude;document.getElementById("click_string").innerHTML=t,navigate("landmark/"+t)},fastCommandCallback:function(e,t,i){"ptt"==e&&"off"==i&&GWTcallback("setCall,"+t+",False"),i=encodeURIComponent(i),navigate({ptt:"ptt-command",text:"text-command",fast:"fast-command"}[e]+"/"+t+","+i)},mapLoaded:_.once(function(){i.set("isVisible",!0),navigate("map-loaded")}),setMapVisible:function(){i.set("isVisible",!0)},streetViewOpen:function(e){navigate("street-view-open/"+e)},mapType:t,properties:i,osmServer:getHrefParam("osmserver")},a=function(e,t){$(".ui-widget-header").html("Closest to ["+parseFloat(e).toFixed(4)+", "+parseFloat(t).toFixed(4)+"]"),$(document).contextmenu("setEntry","cmd0",{title:"loading...",uiIcon:"",disabled:!1});for(var i=1;i<5;i++)$(document).contextmenu("showEntry","cmd"+i,!1)};$(document).contextmenu({delegate:".map",autoFocus:!0,autoTrigger:!1,preventContextMenuForPopup:!0,preventSelect:!0,show:{effect:"slideDown",duration:200},menu:[{title:"Closest units",isHeader:!0},{title:"none",cmd:"cmd0",uiIcon:""},{title:"none",cmd:"cmd1",uiIcon:""},{title:"none",cmd:"cmd2",uiIcon:""},{title:"none",cmd:"cmd3",uiIcon:""}],position:function(e,t){return{my:"left top",at:"left bottom",of:e}},select:function(e,t){var i=t.item.data();i.isEnabled?h.openInfoBubble(i.id):navigate("/request-unit-display/"+i.id)},beforeOpen:function(t,i){var n=t.pageX,s=t.pageY,r=h.getLatLonFromPx(n,s),o=r.lon,l=r.lat;a(l,o),e&&e({x:n,y:s,lat:l,lon:o}).then(function(e){e.forEach(function(e,t){var i=e.id.length<=15?e.id:e.id.slice(0,13)+"..";$(document).contextmenu("setEntry","cmd"+t,{title:" "+i+" <kbd>"+e.distance+e.speedUnits+"</kbd>",data:{id:e.id,isEnabled:e.isEnabled},uiIcon:e.isEnabled?"ui-icon-blank":"ui-icon-refresh"}),$(document).contextmenu("showEntry","cmd"+t,!0)})}).catch(function(e){console.log(e);$(document).contextmenu("isOpen")})}});var o=location.href.match(/reloadMinutes=(\d+)/);o=o?o[1]:360,console.log("Minutes to reload ====================== "+o),setTimeout(function(){log("Map will refresh itself in "+o+" minutes.")},3e3);var l=60*o*1e3;"google"===t&&setInterval(function(){log("Kill map. Recreate a new one!"),i.set("isVisible",!1),h=null,h=new SfmbMaps(r)},l);var h=new SfmbMaps(r);bindEvents(h,i,n,s),window.parser=Parser(n,i,s);var u=$("#tools").width()-$("#open").width();$("#tools").animate({right:"-"+u+"px"},400),$("input:text:first").focus(function(){$(this).val("")});var p=_.isFunction(h.setTraffic)?"show":"hide";$("#traffic")[p](),$("#traffic").parent()[p](),$("#traffic").change(function(){i.set("traffic",$(this).is(":checked"))}),$("input:text:first").autocomplete({source:function(e,t){h.geocode(e.term).then(function(e){return t(e)}).catch(function(e){return t()})},select:function(e,t){h.geocode($(this).val(),!0)}}),$("input:text:first").keyup(function(e){if(13===e.which){var t=$(this).val();h.geocode(t,!0)}}),$("#open").click(function(){var e=$("#tools").width()-$("#open").width();console.log("");var t=-1===$("#open").attr("src").indexOf("close"),i=t?"images/close_vertical.png":"images/tools.png";$("#open").attr("src",i),$("#tools").animate({right:t?"0px":"-"+e+"px"},700)}),$(window).resize(function(){var e=[$(this).height(),$(this).width()];i.set("dimmensions",e)}),$(window).trigger("resize"),DEBUG&&i.set("console",!0)}function sendExecTimeSince(e,t){t||(t=new Date),navigate("exec-time/"+e+"/"+(new Date-t))}function getInfo(){var e=globalSets,t={};if(t.resStr="",window.performance.memory){var i=window.performance.memory,n=i.totalJSHeapSize,s=i.usedJSHeapSize;t.usedHeap=Math.floor(s/1024/1024),t.totalHeap=Math.floor(n/1024/1024),t.resStr+=t.usedHeap+"Mb"}if(e){var r=function(e,t){return e+t.get("points").length},a=e.reduce(r,0),o=e.filter(function(e){return e.get("isVisible")}).reduce(r,0);t.units=a,t.displayed=o,t.resStr+="/"+t.units+"u"}return t.time=moment(),t.timeStr=t.time.format("mm:ss"),t.resStr+="/"+t.timeStr,t}function sampleMemory(e){var t="";if(window.performance.memory){var i=window.performance.memory,n=i.totalJSHeapSize,s=i.usedJSHeapSize;t+="MEMORY Mb: "+(Math.floor(s/1024/1024)+" / "+Math.floor(n/1024/1024))}if(e){var r=function(e,t){return e+t.get("points").length},a=e.reduce(r,0);t+=" UNITS: "+e.filter(function(e){return e.get("isVisible")}).reduce(r,0)+" / "+a}t&&log(t)}function GWTcallback(e){commandsCache.length>2e3&&commandsCache.shift(),commandsCache.push(e);try{log(e),executeCommand(e)}catch(e){console.error(e),log(e.toString())}}function log(e,t,i){var n=document.getElementById("log-area"),s=n&&"none"!=n.style.display,r=moment().format("H:mm:ss:SS> ");if(r=getInfo().resStr+">",s){e.indexOf("Error")>-1&&(e=" "+e),e.indexOf("URL")>-1&&(e=" "+e),e=r+e;var a="",o=n.value,l=o.lastIndexOf("\n")+1,h=o.substr(l);if(h===e)a=n.value+" x 1";else{var u=/(.*)\sx\s(\d*)/.exec(h);if(u){var p=u[1],c=+u[2];p===e?a=n.value.substr(0,l)+p+" x "+(c+1):u=null}u||(a=n.value+"\n"+e)}return a.length>35e4&&(a=a.slice(7e3),console.log("======Removing lines from console========")),n.value=a,n.scrollTop=n.scrollHeight,!1}}function executeCommand(e){window.parser.parseCommand(e)}function startSeeding(){instanceId=Date.now(),id=setInterval(function(){if(!(commandsCache.length<1)){command=commandsCache.shift();var e="http://"+debugServer+"/api/command/"+instanceId+"/"+encodeURIComponent(command);$.ajax({type:"POST",url:e,success:function(e){console.log(command.substr(0,20)+"... command sent to "+debugServer+".")}})}},10)}function fileExists(e){return new Promise(function(t,i){$?$.ajax({url:e,type:"HEAD",dataType:"jsonp",error:function(e){200==e.status?t():i()}}):i()})}function SfmbMapsOL(e){function t(e){if(!e)return!1;var t=e.split(".");return 4===t.length&&t.every(function(e){return parseInt(e,10)>0})}function n(e){D(),null!=q&&(q.destroy(),q=null);var t=b.getLonLatFromViewPortPx(e.xy).transform(T,M);N&&N({latitude:t.lat,longitude:t.lon})}function s(e){S=e.attributes.id;var t=OpenLayers.Class(OpenLayers.Popup.FramedCloud,{displayClass:"olScrollable olPopup",registerEvents:function(){this.events=new OpenLayers.Events(this)}}),i="<div>"+e.attributes.description+"</div>";e.attributes.description||(i=null),e.popup=new t("pop",e.geometry.getBounds().getCenterLonLat(),null,i,null,!0,function(){j.selector.unselectAll()}),$("#pop_contentDiv").replaceWith(A.el),b.addPopup(e.popup)}function r(e){S=null,e.popup.destroy(),e.popup=null}function a(e){}function o(e){return l(G.handler.getGeometry().getVertices())}function l(e){for(var t=[],i=0;i<e.length;i++){var n=new OpenLayers.LonLat(e[i].x,e[i].y).transform(T,M);t.push({latitude:n.lat,longitude:n.lon})}return t=y(t),t=g(t),x&&x(t),t}function h(e,t){var i=e.getFeaturesByAttribute("name",t);null!=i[0]&&e.destroyFeatures([i[0]])}function u(e){e.destroyFeatures()}function p(e){b.zoomToExtent(e)}function c(e,t){for(var i=0;i<e.length;i++){var n=U.getFeaturesByAttribute("id",e[i].id);n[0]&&(n[0].attributes.name=t?n[0].attributes.id:"")}U.redraw()}function d(e){var t=e.map(function(e){return new OpenLayers.Geometry.Point(e.longitude,e.latitude).transform(M,T)});return t}function m(e){var t=[];if(!e)return t;for(var i=e.components[0].components,n=0;n<i.length;n++){var s=new OpenLayers.LonLat(i[n].x,i[n].y).transform(T,M);t.push({latitude:s.lat,longitude:s.lon})}return g(y(t))}function y(e){return e.reduce(function(e,t){return _(e).find(function(e){return e.latitude===t.latitude&&e.longitude===t.longitude})||e.push(t),e},[])}function g(e){return e.reduce(function(e,t){if(t.longitude<-180||t.longitude>180){var i=360-Math.abs(t.longitude);t.longitude>=0&&(i=-i),t.longitude=i}return e.push(t),e},[])}function v(e){return m(e.geometry)}function L(e){Object.assign(z.styleMap.styles.default.defaultStyle,e)}function O(e){Object.assign(z.styleMap.styles.temporary.defaultStyle,e)}var b,w,S,C=e.divObject,x=e.polyPointCallback,E=e.getPolygonCallback,N=e.landmarkCallback,P=e.mapLoaded,M=(new Object,new OpenLayers.Projection("EPSG:4326")),T=new OpenLayers.Projection("EPSG:900913");this.div=C;var k=new InfoWindowModel,A=new InfoWindowView(_.extend({model:k},e)),F=new OpenLayers.Layer.OSM;setTimeout(function(){log(">>>>>>>>>>>>>>>>>>>>> Map loaded from: "+e.osmServer+".")},3e3),t(e.osmServer)&&(F=new OpenLayers.Layer.OSM("OpenStreetMap","http://"+e.osmServer+"/osm/${z}/${x}/${y}.png")),F.events.register("loadend",F,P),console.log("============ Using OSM server at: "+F.url[0]+". "+e.osmServer),b=new OpenLayers.Map({div:C,layers:[F],controls:[new OpenLayers.Control.Navigation({dragPanOptions:{enableKinetic:!1,documentDrag:!0}}),new OpenLayers.Control.ScaleLine,new OpenLayers.Control.PanZoomBar],center:[0,0],zoom:1}),SfmbMapsOL.prototype.markerExists=function(e){return!!U.getFeaturesByAttribute("id",e).length},SfmbMapsOL.prototype.getLatLonFromPx=function(e,t){return b.getLonLatFromViewPortPx({x:e,y:t}).transform(T,M)},b.div.oncontextmenu=function(e){return OpenLayers.Event.isRightClick(e)&&$(document).contextmenu("open",e),!1},b.events.register("move",b,function(){e.properties.attributes.center=[0,0],D()});var D=function(){$(document).contextmenu("close")};b.events.register("zoomstart",D),b.events.register("click",b,n);var I=OpenLayers.Util.getParameters(window.location.href).renderer;I=I?[I]:OpenLayers.Layer.Vector.prototype.renderers;var R=new OpenLayers.Layer.Vector("Poly"),z=new OpenLayers.Layer.Vector("Polygon",{styleMap:new OpenLayers.StyleMap({default:{cursor:"inherit",fillColor:"${color}",fillOpacity:"${opacity}",strokeColor:"${borderColor}",strokeOpacity:"${borderOpacity}",strokeWidth:"${borderWidth}",hoverPointUnit:"%",fontColor:"#ee9900",hoverFillColor:"white",hoverFillOpacity:.8,hoverPointRadius:1,hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3,pointRadius:6,pointerEvents:"visiblePainted",strokeDashstyle:"solid",strokeLinecap:"round"}})}),U=new OpenLayers.Layer.Vector("Markers",{styleMap:new OpenLayers.StyleMap({default:{strokeColor:"#00FF00",strokeOpacity:1,strokeWidth:3,fill:!0,fillColor:"yellow",fillOpacity:1,pointRadius:1,label:"${name}",labelOutlineColor:"${color}",backgroundColor:"${color}",externalGraphic:"${icon}",graphicWidth:30,graphicHeight:40,graphicOpacity:1,fontColor:"${favColor}",fontSize:"12px",fontFamily:"Courier New, monospace",fontWeight:"bold",labelAlign:"${align}",labelXOffset:"${Xoffset}",labelYOffset:"${Yoffset}",labelOutlineWidth:4}}),renderers:I});b.addLayer(U),b.addLayer(z),b.addLayer(R);var B=new OpenLayers.Control.SelectFeature(U,{onSelect:s,onUnselect:r}),G=new OpenLayers.Control.DrawFeature(z,OpenLayers.Handler.Polygon);G.handler.move=a,G.handler.dblclick=null,G.handler.callbacks.point=o;var H=new OpenLayers.Control.ModifyFeature(z);z.events.on({featuremodified:function(e){return l(e.feature.geometry.getVertices())}});var j={selector:B,polygon:G,modify:H,line:new OpenLayers.Control.DrawFeature(R,OpenLayers.Handler.Path)};j.modify.mode|=OpenLayers.Control.ModifyFeature.ROTATE,j.modify.createVertices=!0,j.modify.standalone=!0,j.modify.clickout=!1;for(var W in j)b.addControl(j[W]);j.selector.activate(),SfmbMapsOL.prototype.resize=function(e,t){this.div.style.height=e+"px",this.div.style.width=t+"px",b.updateSize()},SfmbMaps.prototype.setLegacyIcons=function(){},SfmbMapsOL.prototype.autosizeOnBounds=function(e){if((e=e.map(function(e){return new OpenLayers.LonLat(e.longitude,e.latitude).transform(M,T)})).length>1){var t=new OpenLayers.Bounds;e.forEach(function(e){return t.extend(e)}),t.toArray().filter(function(e){return!!e}).length&&p(t)}else{var i=e[0];b.panTo(i),b.zoomTo(7)}},SfmbMapsOL.prototype.putPoints=function(e,t,i,n){if(0!=e.length){for(var s=void 0,r=new OpenLayers.Bounds,a=(U.styleMap.styles.default.defaultStyle,0);a<e.length;a++){var o=U.getFeaturesByAttribute("id",e[a].id);if(""!=e[a].id&&null!=o[0]&&o[0].attributes.lon==e[a].longitude&&o[0].attributes.lat==e[a].latitude&&o[0].attributes.icon==e[a].icon&&o[0].attributes.id==e[a].id)r.extend(o[0].geometry.getBounds());else{null!=o[0]&&""!=e[a].id&&(e[a].id==S&&(s=e[a].id),this.removePoint(e[a]));var l=e[a],h=new OpenLayers.LonLat(l.longitude,l.latitude).transform(M,T),u=new OpenLayers.Geometry.Point(h.lon,h.lat),c=new OpenLayers.Feature.Vector(u),d="Speed = "+l.speed+" at "+moment(l.time).format("HH:mm on DD/MM");"speed"==l.speed&&(d=null);var f=i?l.id:"",m=7*Math.ceil(l.id.length/2);c.attributes={id:l.id,name:f,color:l.getNewIconsColor().color,favColor:"black",align:"cm",icon:l.icon?l.icon:"images/transparent.png",description:d,dataset:e[0].dataset,lat:l.latitude,lon:l.longitude,Xoffset:m,Yoffset:-14},l.id.indexOf("#")>-1&&(c.attributes.Xoffset=c.attributes.Yoffset=5),U.addFeatures([c]),r.extend(c.geometry.getBounds()),""==e[a].id&&U.destroyFeatures([c])}}U.features.reduce(function(t,i){var n=i.attributes.id,s=i.attributes.dataset;return e.find(function(e){return e.id===n})||s!==e[0].dataset||t.push(i.attributes),t},[]).forEach(function(e){this.removePoint(e)},this),s&&(this.openInfoBubble(s),s=!1),t&&p(r)}},SfmbMapsOL.prototype.removeAllPoints=function(){B.unselectAll(),B.deactivate(),u(U),B.activate()},SfmbMapsOL.prototype.removePoint=function(e){var t=U.getFeaturesByAttribute("id",e.id);null!=t[0]&&(null!=t[0].popup&&B.unselect(t[0]),B.deactivate(),U.destroyFeatures([t[0]]),B.activate())},SfmbMapsOL.prototype.removePoints=function(e){if(e)for(var t=0;t<e.length;t++)this.removePoint(e[t])},SfmbMapsOL.prototype.showLabels=function(){U.styleMap.styles.default.defaultStyle.label="${name}",U.redraw()},SfmbMapsOL.prototype.hideLabels=function(){U.styleMap.styles.default.defaultStyle.label="",U.redraw()},SfmbMapsOL.prototype.putLabels=function(e){c(e,"${name}")},SfmbMapsOL.prototype.removeLabels=function(e){c(e,"")},SfmbMapsOL.prototype.centerZoom=function(e,t,i){var n=new OpenLayers.LonLat(t,e).transform(M,T);b.panTo(n),U.redraw(),z.redraw(),R.redraw()},SfmbMapsOL.prototype.setMapType=function(e){},SfmbMapsOL.prototype.getMapType=function(){return"OSM"},SfmbMapsOL.prototype.openInfoBubble=function(e){var t=U.getFeaturesByAttribute("id",e);return t&&(B.unselectAll(),B.select(t[0]),this.centerZoom(t[0].attributes.lat,t[0].attributes.lon)),!!t},SfmbMapsOL.prototype.setPolygon=function(e,t,i,n,s,r,a){var o=d(i);o.push(o[0]);var l=new OpenLayers.Geometry.LinearRing(o),h=new OpenLayers.Geometry.Polygon([l]),u=new OpenLayers.Feature.Vector(h,{name:e,color:t,opacity:n,borderColor:s,borderWidth:a,borderOpacity:r});z.addFeatures([u])},SfmbMapsOL.prototype.deletePolygon=function(e){if(j.polygon.active&&(e==w||void 0==e))return G.handler.cancel(),void j.polygon.deactivate();j.modify.deactivate(),e?h(z,e):u(z)},SfmbMapsOL.prototype.deleteAllPolygons=function(){this.deletePolygon()},SfmbMapsOL.prototype.setPoly=function(e,t,i,n,s){var r=s||"default",a={strokeColor:t,strokeOpacity:i,strokeWidth:5},o=d(n),l=new OpenLayers.Geometry.LineString(o),h=new OpenLayers.Feature.Vector(l,null,a);h.attributes={name:r},R.addFeatures([h])},SfmbMapsOL.prototype.deletePoly=function(e){e?h(R,e):u(R)},SfmbMapsOL.prototype.newPolygon=function(e,t,i,n,s,r){w=e,j.polygon.activate()},SfmbMapsOL.prototype.getPolygon=function(e){var t=[];if(j.polygon.active&&w==e)t={name:e,color:z.styleMap.styles.default.defaultStyle.fillColor,points:m(j.polygon.handler.getGeometry())};else if(e){var n=z.getFeaturesByAttribute("name",e);n[0]&&(t={name:e,color:n[0].attributes.color,points:v(n[0])})}else for(i=0;i<z.features.length;i++)f=z.features[i],t.push({name:f.attributes.name,color:f.attributes.color,points:v(f)});return console.log(JSON.stringify(t)),E&&E(t),t},SfmbMapsOL.prototype.startEditPolygon=function(e){var t=z.getFeaturesByAttribute("name",e);console.log("Start editing '"+t[0].attributes.name+"' polygon."),t[0]&&(t[0].geometry.components[0].components.forEach(function(e,t){return h(U,"#"+(t+1))}),j.modify.activate(),j.modify.selectFeature(t[0]))},SfmbMapsOL.prototype.endEditPolygon=function(){j.polygon.active&&(G.handler.finishGeometry(),z.features[z.features.length-1].attributes.name=w,z.features[z.features.length-1].attributes.color=z.styleMap.styles.default.defaultStyle.fillColor,j.polygon.deactivate()),j.modify.deactivate()},SfmbMapsOL.prototype.clearFromMap=function(e,t,i){},SfmbMapsOL.prototype.resetAll=function(){this.removeAllPoints(),this.deletePolygon(),this.deletePoly()},SfmbMapsOL.prototype.changePolygonColor=function(e,t){var i=z.getFeaturesByAttribute("name",e);i[0]&&(i[0].style.fillColor=t,i[0].style.strokeColor=t,i[0].attributes.color=t,L(t),O(t),j.modify.virtualStyle.fillColor=t,j.modify.virtualStyle.strokeColor=t,j.modify.selectFeature(i[0]))};var V=[];SfmbMapsOL.prototype.geocode=function(i,n){var s=n?1:10,r=this;if(n){var a=V.find(function(e){return e.display_name===i});if(a)return void r.openSimplePopup(a)}return new Promise(function(a,o){var l=encodeURIComponent(i),h="http://nominatim.openstreetmap.org";t(e.osmServer)&&(h="http://"+e.osmServer+"/nominatim");var u=h+"/search/"+l+"/?format=json&addressdetails=1&limit="+s;$.post(u,function(e,t){"success"==t?e.length>0&&(n?r.openSimplePopup(e[0]):V=e,a(e.map(function(e){return""+e.display_name}))):o(t)})})};var q;SfmbMapsOL.prototype.openSimplePopup=function(e){null!=q&&(q.destroy(),q=null);var t=OpenLayers.Class(OpenLayers.Popup.FramedCloud,{displayClass:"olScrollable olPopup",registerEvents:function(){this.events=new OpenLayers.Events(this)}}),i=new OpenLayers.LonLat(e.lon,e.lat).transform(M,T);q=new t("simple_pop",i,null,"<div>"+e.display_name+"</div>",null,!0,function(){q.destroy(),q=null}),b.addPopup(q),b.panTo(i)},SfmbMapsOL.prototype.updatePolygon=function(e,t,i){var n=z.getFeaturesByAttribute("name",e);n[0]&&(n[0].attributes[t]=i,z.drawFeature(n[0]))},SfmbMapsOL.prototype.setMapKind=function(){},SfmbMapsOL.prototype.getMapKind=function(){return"OSM"}}function SfmbMapsGoogle(e){function t(e,t){return t=t||8,parseFloat(parseFloat(e).toFixed(t))}function i(e,t){var i=new google.maps.LatLng(t.latitude,t.longitude);e.marker.setPosition(i),e.marker.setIcon(t.icon),e.label.setPosition(i);var s=t.getNewIconsSize().labelColor;D&&(s="yellow",e.marker.setOptions({icon:{url:t.icon,anchor:new google.maps.Point(16,16)}})),e.label.setContent(n(s,t.id)),e.point=t,w.id==t.id&&(w.mergePoint(t),w.isOpened()&&A.setCenter(i))}function n(e,t){return'<p style="background-color:'+e+'";white-space: nowrap;"><nobr>'+t+"</nobr></p>"}function s(e,t){var i=e.latitude,s=e.longitude,r={url:e.icon?""+e.icon:"",anchor:new google.maps.Point(16,16)},a=new google.maps.Size(-20,-35),o="yellow";if(!D){var l=e.getNewIconsSize();a=l.labelOffset,o=l.labelColor,r.anchor=l.imageMarkerAnchor}var h=new google.maps.Marker({position:new google.maps.LatLng(i,s),icon:r});/\d{1,3}\s?[mk][ph|mp]/.test(e.speed)&&google.maps.event.addListener(h,"click",I.bind(null,e.id)),""!==r.url&&h.setMap(A);var u={content:n(o,e.id),boxStyle:{textAlign:"center",fontSize:"8pt"},disableAutoPan:!0,pixelOffset:a,position:new google.maps.LatLng(i,s),closeBoxURL:"",isHidden:!1,zIndex:google.maps.Marker.MAX_ZINDEX+1,pane:"floatShadow"},p=new InfoBox(u);return p.open(A),t||p.setMap(null),{marker:h,dataset:e.dataset,label:p,id:e.id,description:e.description,point:e,hide:function(){this.id==w.get("id")&&k.close(),this.marker.setMap(null),this.label.setMap(null)}}}function r(e,t){var i=_.find(e,{id:t});i&&(i.hide(),e.splice(e.indexOf(i),1))}function a(e){_.pluck(e,"id").forEach(function(t){r(e,t)})}function o(e,t){var i=e?A:null;t?t.forEach(function(e,t,n){S.forEach(function(t,n,s){t.id==e.id&&t.label.setMap(i)})}):S.forEach(function(e,t,n){e.label.setMap(i)})}function l(e){return"map"==e?google.maps.MapTypeId.ROADMAP:"satellite"==e?google.maps.MapTypeId.SATELLITE:"hybrid"==e?google.maps.MapTypeId.HYBRID:"terrain"==e?google.maps.MapTypeId.TERRAIN:void 0}function h(e,t,i,n,s){(new google.maps.StreetViewService).getPanoramaByLocation(e.getPosition(),100,function(t,i){var n=i===google.maps.StreetViewStatus.OK;s.hasStreetView=n,w.get("id")!=s.id&&(k.close(),w.mergePoint(s)),k.open(A,e)}),A.getStreetView().setPosition(e.getPosition())}function u(e,t,i,n,s,r,a,o){console.log("borderColor = "+r+" width = "+o);var l={name:e,color:t,opacity:s,borderColor:r,borderWidth:o,borderOpacity:a},h=[];n||i.forEach(function(e,t,i){h.push(new google.maps.LatLng(e.latitude,e.longitude))});var u=new google.maps.Polygon({clickable:!1,path:h,strokeColor:r,strokeOpacity:a,strokeWeight:o,fillColor:t,fillOpacity:s});n&&(u.editable=!0);var p={polygonAttr:l,polygon:u,id:l.name,hide:function(){google.maps.event.clearListeners(this.polygon.getPath(),"set_at"),google.maps.event.clearListeners(this.polygon.getPath(),"insert_at"),this.polygon.setMap(null),N&&N.id==this.id&&(N=null,P=!1,A.setOptions({draggableCursor:"default"}))}};if(x.push(p),u.setMap(A),n)return x[x.length-1]}function c(){E.forEach(function(e){e.poly.setMap(null)}),a(E)}function d(e){var t=[];points=e.getPath();for(var i=points.getLength(),n=0;n<i;n++){var s=points.getAt(n);t.push({latitude:s.lat(),longitude:s.lng()})}return t}function f(e){google.maps.event.addListener(e.getPath(),"set_at",function(t){if(y){var i=d(e);y(i)}}),google.maps.event.addListener(e.getPath(),"insert_at",function(t){if(y){var i=d(e);y(i)}})}if(google){var m=e.divObject,y=e.polyPointCallback,g=e.getPolygonCallback,v=e.landmarkCallback,L=e.mapLoaded,O=e.streetViewOpen,b=e.setMapVisible;google.maps.fastCommandCallback=e.fastCommandCallback,this.div=m;var w=new InfoWindowModel,S=[],C={},x=[],E=[],N=null,P=!1,M=l(e.mapType),T={zoom:1,minZoom:2,center:new google.maps.LatLng(0,0),mapTypeId:M,gestureHandling:"greedy"},k=new InfoBubble({map:A,disableAutoPan:!0,padding:4,content:new InfoWindowView(_.extend({model:w},e)).el});k.close(),google.maps.event.addListener(k,"closeclick",function(){});var A=new google.maps.Map(document.getElementById(m.getAttribute("id")),T);A.setOptions({draggableCursor:"default"}),google.maps.event.addListener(A,"dragend",function(){e.properties.attributes.center=[A.getCenter().lat(),A.getCenter().lng()]}),google.maps.event.addListenerOnce(A,"tilesloaded",function(){L(),b()});var F=new google.maps.StreetViewPanorama(A.getDiv(),{enableCloseButton:!0,visible:!1});F.setOptions({enableCloseButton:!0,visible:!1}),A.setStreetView(F),google.maps.event.addListener(F,"visible_changed",function(){O(F.getVisible())}),google.maps.openStreetView=function(){A.getStreetView().setVisible(!0),O(!0),log("am deschis street view "+A.getStreetView())},google.maps.event.addListener(A,"click",function(e){k.close(),null!=R&&(R.setMap(null),R=null),P&&null!=N&&(N.polygon.getPath()?N.polygon.getPath().push(e.latLng):N.polygon.setPath([e.latLng])),!P&&v&&v({latitude:e.latLng.lat(),longitude:e.latLng.lng()})}),SfmbMapsGoogle.prototype.markerExists=function(e){return!!_.find(S,{id:markerName})},SfmbMapsGoogle.prototype.getLatLonFromPx=function(e,t){return{lat:24,lon:12.89}},SfmbMapsGoogle.prototype.resize=function(e,t){this.div.style.height=e+"px",this.div.style.width=t+"px",google.maps.event.trigger(A,"resize")},SfmbMapsGoogle.prototype.putPoints=function(e,n,r,a){var o=new google.maps.LatLngBounds,l=this;S.filter(function(t){return t.dataset===a&&!_.find(e,{id:t.id})}).forEach(function(e){l.removePoint(e),C[e.id]&&delete C[e.id]}),e.forEach(function(e){o.extend(new google.maps.LatLng(e.latitude,e.longitude));var n=C[e.id];if(""!=e.id&&!n){var a=s(e,r);S.push(a),C[e.id]=a}n&&(!(t(n.marker.getPosition().lat())==t(e.latitude)&&t(e.longitude)==t(n.marker.getPosition().lng()))||n.marker.icon.url!=e.icon||n.point.isInCall!=e.isInCall||n.point.address!=e.address)&&i(n,e)}),n&&(A.fitBounds(o),1==e.length&&A.setZoom(A.getZoom()-3))};var D=!1;SfmbMapsGoogle.prototype.removeAllPoints=function(){a(S)},SfmbMapsGoogle.prototype.removePoint=function(e){r(S,e.id)},SfmbMapsGoogle.prototype.removePoints=function(e){e.forEach(function(e){this.removePoint(e),delete C[e.id]},this)},SfmbMapsGoogle.prototype.showLabels=function(){o(!0)},SfmbMapsGoogle.prototype.hideLabels=function(){o(!1)},SfmbMapsGoogle.prototype.putLabels=function(e){o(!0,e)},SfmbMapsGoogle.prototype.removeLabels=function(e){o(!1,e)},SfmbMapsGoogle.prototype.centerZoom=function(e,t,i){A.panTo(new google.maps.LatLng(e,t)),i>0&&A.setZoom(parseInt(i))},SfmbMapsGoogle.prototype.setMapType=function(e){A.setMapTypeId(l(e))},SfmbMapsGoogle.prototype.getMapType=function(){result="";var e=A.getMapTypeId();return e==google.maps.MapTypeId.ROADMAP?result="map":e==google.maps.MapTypeId.SATELLITE?result="satellite":e==google.maps.MapTypeId.HYBRID?result="hybrid":e==google.maps.MapTypeId.TERRAIN&&(result="terrain"),result},SfmbMapsGoogle.prototype.getLocation=function(e){},SfmbMapsGoogle.prototype.getAddress=function(e,t){};var I=function(e){console.log("clicking on a marker "+e);var t=_.find(S,{id:e});t&&h(t.marker,t.id,t.description,t.dataset,t.point)};SfmbMapsGoogle.prototype.openInfoBubble=I,SfmbMapsGoogle.prototype.updatePolygon=function(e,t,i){var n={};n[{borderColor:"strokeColor",borderOpacity:"strokeOpacity",borderWidth:"strokeWeight",color:"fillColor",opacity:"fillOpacity"}[t]]=i;var s=_(x).findWhere({id:e});s&&s.polygon.setOptions(n)},SfmbMapsGoogle.prototype.setPolygon=function(e,t,i,n,s,r,a){u(e,t,i,!1,n,s,r,a)},SfmbMapsGoogle.prototype.deletePolygon=function(e){if(console.log("removing polygon "+e),e){var t=_.find(x,{polygonAttr:{name:e}});t&&t.polygon.setMap(null),r(x,e)}else this.deleteAllPolygons();A.setOptions({draggableCursor:"default"})},SfmbMapsGoogle.prototype.deleteAllPolygons=function(){x.forEach(function(e){e.polygon.setMap(null)}),console.log("------------------removing all polygons...."),a(x)},SfmbMapsGoogle.prototype.setPoly=function(e,t,i,n,s){var r={name:s,color:t,thickness:i},a=[];n.forEach(function(e,t,i){a.push(new google.maps.LatLng(e.latitude,e.longitude))});var o=new google.maps.Polyline({path:a,strokeColor:t,strokeOpacity:i,strokeWeight:4});E.push({polyAttr:r,poly:o,id:r.name,hide:function(){this.poly.setMap(null)}}),o.setMap(A)},SfmbMapsGoogle.prototype.deletePoly=function(e){e?(p=_.find(E,{polyAttr:{name:e}}),p&&p.poly.setMap(null),r(E,e)):c()},SfmbMapsGoogle.prototype.newPolygon=function(e,t,i,n,s,r){console.log("opacity = "+i+" borderColor = "+n);N=u(e,t,null,!0,i,n,s,r),A.setOptions({draggableCursor:"crosshair"}),f(N.polygon),P=!0},SfmbMapsGoogle.prototype.getPolygon=function(e){var t=[];if(e){var i=_(x).findWhere({id:e});i&&(t={name:i.polygonAttr.name,color:i.polygonAttr.color,points:d(i.polygon)})}else x.forEach(function(e,i,n){t.push({name:e.polygonAttr.name,color:e.polygonAttr.color,points:d(e.polygon)})});return console.log(JSON.stringify(t)),g&&g(t),t},SfmbMapsGoogle.prototype.startEditPolygon=function(e){var t=this,i=_(x).findWhere({id:e});i&&(i.polygon.getPath().forEach(function(e,i){return t.removePoint({id:"#"+(i+1)})}),i.polygon.setEditable(!0),N=i,A.setOptions({draggableCursor:"crosshair"}),f(i.polygon))},SfmbMapsGoogle.prototype.endEditPolygon=function(){google.maps.event.clearListeners(N.polygon.getPath(),"set_at"),google.maps.event.clearListeners(N.polygon.getPath(),"insert_at"),N.polygon.setEditable(!1),N=null,P=!1,A.setOptions({draggableCursor:"default"})},SfmbMapsGoogle.prototype.clearFromMap=function(e,t,i){},SfmbMapsGoogle.prototype.resetAll=function(){k.close(),this.removeAllPoints(),this.deletePolygon(),this.deletePoly()},SfmbMapsGoogle.prototype.changePolygonColor=function(e,t){var i=_(x).findWhere({id:e});i&&(i.polygonAttr.color=t,i.polygon.setOptions({fillColor:t,strokeColor:t}))},SfmbMapsGoogle.prototype.geocode=function(e,t){var i=this;return new Promise(function(n,s){var r=new google.maps.Geocoder,a=i;r.geocode({address:e},function(e,i){if(i==google.maps.GeocoderStatus.OK){var r={lat:e[0].geometry.location.lat(),lon:e[0].geometry.location.lng(),display_name:e[0].formatted_address};t&&a.openSimplePopup(r),n(e.map(function(e){return e.formatted_address}))}else s(i)})})};var R=null;SfmbMapsGoogle.prototype.openSimplePopup=function(e){var t="http://chart.apis.google.com/chart?chst=d_bubble_icon_text_small&chld=flag|bbtl|"+e.display_name+"|FFFFaa|000000",i="http://chart.apis.google.com/chart?chst=d_bubble_icon_text_small_shadow&chld=flag|bbtl|"+e.display_name+"|FFFF88|000000";A.panTo(new google.maps.LatLng(e.lat,e.lon));var n={anchor:new google.maps.Point(0,0),url:t},s={anchor:new google.maps.Point(0,0),url:i},r=new google.maps.Marker({map:A,position:new google.maps.LatLng(e.lat,e.lon),icon:n,shadow:s,anchorPoint:new google.maps.Point(0,0)});google.maps.event.addListener(r,"click",function(e){r.setMap(null),r=null})},SfmbMapsGoogle.prototype.autosizeOnBounds=function(e){var t=new google.maps.LatLngBounds;e.forEach(function(e){return t.extend(new google.maps.LatLng(e.latitude,e.longitude))}),A.fitBounds(t)};var z=new google.maps.TrafficLayer;SfmbMapsGoogle.prototype.setTraffic=function(e){e?z.setMap(A):z.setMap(null)},SfmbMapsGoogle.prototype.setMapKind=function(){},SfmbMapsGoogle.prototype.getMapKind=function(){return"Google"},SfmbMapsGoogle.prototype.setLegacyIcons=function(e){console.log("Legacy icons for Google Maps are: "+e),D=JSON.parse(e)}}}var OpenLayers={VERSION_NUMBER:"Release 2.13.1",singleFile:!0,_getScriptLocation:function(){for(var e,t,i=new RegExp("(^|(.*?\\/))(OpenLayers[^\\/]*?\\.js)(\\?|$)"),n=document.getElementsByTagName("script"),s="",r=0,a=n.length;r<a;r++)if((e=n[r].getAttribute("src"))&&(t=e.match(i))){s=t[1];break}return function(){return s}}(),ImgPath:""};OpenLayers.Class=function(){var e=arguments.length,t=arguments[0],i=arguments[e-1],n="function"==typeof i.initialize?i.initialize:function(){t.prototype.initialize.apply(this,arguments)};if(e>1){var s=[n,t].concat(Array.prototype.slice.call(arguments).slice(1,e-1),i);OpenLayers.inherit.apply(null,s)}else n.prototype=i;return n},OpenLayers.inherit=function(e,t){var i=function(){};i.prototype=t.prototype,e.prototype=new i;var n,s,r;for(n=2,s=arguments.length;n<s;n++)"function"==typeof(r=arguments[n])&&(r=r.prototype),OpenLayers.Util.extend(e.prototype,r)},OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.extend=function(e,t){if(e=e||{},t){for(var i in t){var n=t[i];void 0!==n&&(e[i]=n)}!("function"==typeof window.Event&&t instanceof window.Event)&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&(e.toString=t.toString)}return e},OpenLayers.String={startsWith:function(e,t){return 0==e.indexOf(t)},contains:function(e,t){return-1!=e.indexOf(t)},trim:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(e){for(var t=e.split("-"),i=t[0],n=1,s=t.length;n<s;n++){var r=t[n];i+=r.charAt(0).toUpperCase()+r.substring(1)}return i},format:function(e,t,i){t||(t=window);var n=function(e,n){for(var s,r=n.split(/\.+/),a=0;a<r.length&&(0==a&&(s=t),void 0!==s);a++)s=s[r[a]];return"function"==typeof s&&(s=i?s.apply(null,i):s()),void 0===s?"undefined":s};return e.replace(OpenLayers.String.tokenRegEx,n)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(e){return OpenLayers.String.numberRegEx.test(e)},numericIf:function(e,t){var i=e;return!0===t&&null!=e&&e.replace&&(e=e.replace(/^\s*|\s*$/g,"")),OpenLayers.String.isNumeric(e)?parseFloat(e):i}},OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(e,t){var i=0;return t>0&&(i=parseFloat(e.toPrecision(t))),i},format:function(e,t,i,n){t=void 0!==t?t:0,i=void 0!==i?i:OpenLayers.Number.thousandsSeparator,n=void 0!==n?n:OpenLayers.Number.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var s=e.toString().split(".");1==s.length&&null==t&&(t=0);var r=s[0];if(i)for(var a=/(-?[0-9]+)([0-9]{3})/;a.test(r);)r=r.replace(a,"$1"+i+"$2");var o;if(0==t)o=r;else{var l=s.length>1?s[1]:"0";null!=t&&(l+=new Array(t-l.length+1).join("0")),o=r+n+l}return o},zeroPad:function(e,t,i){for(var n=e.toString(i||10);n.length<t;)n="0"+n;return n}},OpenLayers.Function={bind:function(e,t){var i=Array.prototype.slice.apply(arguments,[2]);return function(){var n=i.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,n)}},bindAsEventListener:function(e,t){return function(i){return e.call(t,i||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},OpenLayers.Array={filter:function(e,t,i){var n=[];if(Array.prototype.filter)n=e.filter(t,i);else{var s=e.length;if("function"!=typeof t)throw new TypeError;for(var r=0;r<s;r++)if(r in e){var a=e[r];t.call(i,a,r,e)&&n.push(a)}}return n}},OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(e,t,i,n){OpenLayers.Util.isArray(e)&&(n=e[3],i=e[2],t=e[1],e=e[0]),null!=e&&(this.left=OpenLayers.Util.toFloat(e)),null!=t&&(this.bottom=OpenLayers.Util.toFloat(t)),null!=i&&(this.right=OpenLayers.Util.toFloat(i)),null!=n&&(this.top=OpenLayers.Util.toFloat(n))},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(e){var t=!1;return null!=e&&(t=this.left==e.left&&this.right==e.right&&this.top==e.top&&this.bottom==e.bottom),t},toString:function(){return[this.left,this.bottom,this.right,this.top].join(",")},toArray:function(e){return!0===e?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]},toBBOX:function(e,t){null==e&&(e=6);var i=Math.pow(10,e),n=Math.round(this.left*i)/i,s=Math.round(this.bottom*i)/i,r=Math.round(this.right*i)/i,a=Math.round(this.top*i)/i;return!0===t?s+","+n+","+a+","+r:n+","+s+","+r+","+a},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return this.right-this.left},getHeight:function(){return this.top-this.bottom},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){return this.centerLonLat||(this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)),this.centerLonLat},scale:function(e,t){null==t&&(t=this.getCenterLonLat());var i,n;"OpenLayers.LonLat"==t.CLASS_NAME?(i=t.lon,n=t.lat):(i=t.x,n=t.y);var s=(this.left-i)*e+i,r=(this.bottom-n)*e+n,a=(this.right-i)*e+i,o=(this.top-n)*e+n;return new OpenLayers.Bounds(s,r,a,o)},add:function(e,t){if(null==e||null==t)throw new TypeError("Bounds.add cannot receive null values");return new OpenLayers.Bounds(this.left+e,this.bottom+t,this.right+e,this.top+t)},extend:function(e){if(e)switch(e.CLASS_NAME){case"OpenLayers.LonLat":this.extendXY(e.lon,e.lat);break;case"OpenLayers.Geometry.Point":this.extendXY(e.x,e.y);break;case"OpenLayers.Bounds":this.centerLonLat=null,(null==this.left||e.left<this.left)&&(this.left=e.left),(null==this.bottom||e.bottom<this.bottom)&&(this.bottom=e.bottom),(null==this.right||e.right>this.right)&&(this.right=e.right),(null==this.top||e.top>this.top)&&(this.top=e.top)}},extendXY:function(e,t){this.centerLonLat=null,(null==this.left||e<this.left)&&(this.left=e),(null==this.bottom||t<this.bottom)&&(this.bottom=t),(null==this.right||e>this.right)&&(this.right=e),(null==this.top||t>this.top)&&(this.top=t)},containsLonLat:function(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var i=this.contains(e.lon,e.lat,t.inclusive),n=t.worldBounds;if(n&&!i){var s=n.getWidth(),r=(n.left+n.right)/2,a=Math.round((e.lon-r)/s);i=this.containsLonLat({lon:e.lon-a*s,lat:e.lat},{inclusive:t.inclusive})}return i},containsPixel:function(e,t){return this.contains(e.x,e.y,t)},contains:function(e,t,i){if(null==i&&(i=!0),null==e||null==t)return!1;e=OpenLayers.Util.toFloat(e),t=OpenLayers.Util.toFloat(t);return i?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&e<this.right&&t>this.bottom&&t<this.top},intersectsBounds:function(e,t){if("boolean"==typeof t&&(t={inclusive:t}),(t=t||{}).worldBounds){var i=this.wrapDateLine(t.worldBounds);e=e.wrapDateLine(t.worldBounds)}else i=this;null==t.inclusive&&(t.inclusive=!0);var n=!1,s=i.left==e.right||i.right==e.left||i.top==e.bottom||i.bottom==e.top;if(t.inclusive||!s){var r=e.bottom>=i.bottom&&e.bottom<=i.top||i.bottom>=e.bottom&&i.bottom<=e.top,a=e.top>=i.bottom&&e.top<=i.top||i.top>e.bottom&&i.top<e.top,o=e.left>=i.left&&e.left<=i.right||i.left>=e.left&&i.left<=e.right,l=e.right>=i.left&&e.right<=i.right||i.right>=e.left&&i.right<=e.right;n=(r||a)&&(o||l)}if(t.worldBounds&&!n){var h=t.worldBounds,u=h.getWidth(),p=!h.containsBounds(i),c=!h.containsBounds(e);p&&!c?(e=e.add(-u,0),n=i.intersectsBounds(e,{inclusive:t.inclusive})):c&&!p&&(i=i.add(-u,0),n=e.intersectsBounds(i,{inclusive:t.inclusive}))}return n},containsBounds:function(e,t,i){null==t&&(t=!1),null==i&&(i=!0);var n=this.contains(e.left,e.bottom,i),s=this.contains(e.right,e.bottom,i),r=this.contains(e.left,e.top,i),a=this.contains(e.right,e.top,i);return t?n||s||r||a:n&&s&&r&&a},determineQuadrant:function(e){var t="",i=this.getCenterLonLat();return t+=e.lat<i.lat?"b":"t",t+=e.lon<i.lon?"l":"r"},transform:function(e,t){this.centerLonLat=null;var i=OpenLayers.Projection.transform({x:this.left,y:this.bottom},e,t),n=OpenLayers.Projection.transform({x:this.right,y:this.bottom},e,t),s=OpenLayers.Projection.transform({x:this.left,y:this.top},e,t),r=OpenLayers.Projection.transform({x:this.right,y:this.top},e,t);return this.left=Math.min(i.x,s.x),this.bottom=Math.min(i.y,n.y),this.right=Math.max(n.x,r.x),this.top=Math.max(s.y,r.y),this},wrapDateLine:function(e,t){var i=(t=t||{}).leftTolerance||0,n=t.rightTolerance||0,s=this.clone();if(e){for(var r=e.getWidth();s.left<e.left&&s.right-n<=e.left;)s=s.add(r,0);for(;s.left+i>=e.right&&s.right>e.right;)s=s.add(-r,0);var a=s.left+i;a<e.right&&a>e.left&&s.right-n>e.right&&(s=s.add(-r,0))}return s},CLASS_NAME:"OpenLayers.Bounds"}),OpenLayers.Bounds.fromString=function(e,t){var i=e.split(",");return OpenLayers.Bounds.fromArray(i,t)},OpenLayers.Bounds.fromArray=function(e,t){return!0===t?new OpenLayers.Bounds(e[1],e[0],e[3],e[2]):new OpenLayers.Bounds(e[0],e[1],e[2],e[3])},OpenLayers.Bounds.fromSize=function(e){return new OpenLayers.Bounds(0,e.h,e.w,0)},OpenLayers.Bounds.oppositeQuadrant=function(e){var t="";return t+="t"==e.charAt(0)?"b":"t",t+="l"==e.charAt(1)?"r":"l"},OpenLayers.Element={visible:function(e){return"none"!=OpenLayers.Util.getElement(e).style.display},toggle:function(){for(var e=0,t=arguments.length;e<t;e++){var i=OpenLayers.Util.getElement(arguments[e]),n=OpenLayers.Element.visible(i)?"none":"";i.style.display=n}},remove:function(e){(e=OpenLayers.Util.getElement(e)).parentNode.removeChild(e)},getHeight:function(e){return(e=OpenLayers.Util.getElement(e)).offsetHeight},hasClass:function(e,t){var i=e.className;return!!i&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(i)},addClass:function(e,t){return OpenLayers.Element.hasClass(e,t)||(e.className+=(e.className?" ":"")+t),e},removeClass:function(e,t){var i=e.className;return i&&(e.className=OpenLayers.String.trim(i.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," "))),e},toggleClass:function(e,t){return OpenLayers.Element.hasClass(e,t)?OpenLayers.Element.removeClass(e,t):OpenLayers.Element.addClass(e,t),e},getStyle:function(e,t){var i=null;if((e=OpenLayers.Util.getElement(e))&&e.style){if(!(i=e.style[OpenLayers.String.camelize(t)]))if(document.defaultView&&document.defaultView.getComputedStyle){var n=document.defaultView.getComputedStyle(e,null);i=n?n.getPropertyValue(t):null}else e.currentStyle&&(i=e.currentStyle[OpenLayers.String.camelize(t)]);var s=["left","top","right","bottom"];window.opera&&-1!=OpenLayers.Util.indexOf(s,t)&&"static"==OpenLayers.Element.getStyle(e,"position")&&(i="auto")}return"auto"==i?null:i}},OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(e,t){OpenLayers.Util.isArray(e)&&(t=e[1],e=e[0]),this.lon=OpenLayers.Util.toFloat(e),this.lat=OpenLayers.Util.toFloat(t)},toString:function(){return"lon="+this.lon+",lat="+this.lat},toShortString:function(){return this.lon+", "+this.lat},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(e,t){if(null==e||null==t)throw new TypeError("LonLat.add cannot receive null values");return new OpenLayers.LonLat(this.lon+OpenLayers.Util.toFloat(e),this.lat+OpenLayers.Util.toFloat(t))},equals:function(e){var t=!1;return null!=e&&(t=this.lon==e.lon&&this.lat==e.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(e.lon)&&isNaN(e.lat)),t},transform:function(e,t){var i=OpenLayers.Projection.transform({x:this.lon,y:this.lat},e,t);return this.lon=i.x,this.lat=i.y,this},wrapDateLine:function(e){var t=this.clone();if(e){for(;t.lon<e.left;)t.lon+=e.getWidth();for(;t.lon>e.right;)t.lon-=e.getWidth()}return t},CLASS_NAME:"OpenLayers.LonLat"}),OpenLayers.LonLat.fromString=function(e){var t=e.split(",");return new OpenLayers.LonLat(t[0],t[1])},OpenLayers.LonLat.fromArray=function(e){var t=OpenLayers.Util.isArray(e),i=t&&e[0],n=t&&e[1];return new OpenLayers.LonLat(i,n)},OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(e,t){this.x=parseFloat(e),this.y=parseFloat(t)},toString:function(){return"x="+this.x+",y="+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t},distanceTo:function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},add:function(e,t){if(null==e||null==t)throw new TypeError("Pixel.add cannot receive null values");return new OpenLayers.Pixel(this.x+e,this.y+t)},offset:function(e){var t=this.clone();return e&&(t=this.add(e.x,e.y)),t},CLASS_NAME:"OpenLayers.Pixel"}),OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(e,t){this.w=parseFloat(e),this.h=parseFloat(t)},toString:function(){return"w="+this.w+",h="+this.h},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(e){var t=!1;return null!=e&&(t=this.w==e.w&&this.h==e.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(e.w)&&isNaN(e.h)),t},CLASS_NAME:"OpenLayers.Size"}),OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(e){alert(e)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"},function(){for(var e=document.getElementsByTagName("script"),t=0,i=e.length;t<i;++t)if(-1!=e[t].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(e){var t;e||(e="msie"==OpenLayers.BROWSER_NAME?navigator.userLanguage:navigator.language);var i=e.split("-");if(i[0]=i[0].toLowerCase(),"object"==typeof OpenLayers.Lang[i[0]]&&(t=i[0]),i[1]){var n=i[0]+"-"+i[1].toUpperCase();"object"==typeof OpenLayers.Lang[n]&&(t=n)}t||(OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+i.join("-")+" dictionary, falling back to default language"),t=OpenLayers.Lang.defaultCode),OpenLayers.Lang.code=t},translate:function(e,t){var i=OpenLayers.Lang[OpenLayers.Lang.getCode()],n=i&&i[e];return n||(n=e),t&&(n=OpenLayers.String.format(n,t)),n}},OpenLayers.i18n=OpenLayers.Lang.translate,OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.getElement=function(){for(var e=[],t=0,i=arguments.length;t<i;t++){var n=arguments[t];if("string"==typeof n&&(n=document.getElementById(n)),1==arguments.length)return n;e.push(n)}return e},OpenLayers.Util.isElement=function(e){return!(!e||1!==e.nodeType)},OpenLayers.Util.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},OpenLayers.Util.removeItem=function(e,t){for(var i=e.length-1;i>=0;i--)e[i]==t&&e.splice(i,1);return e},OpenLayers.Util.indexOf=function(e,t){if("function"==typeof e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]==t)return i;return-1},OpenLayers.Util.dotless=/\./g,OpenLayers.Util.modifyDOMElement=function(e,t,i,n,s,r,a,o){t&&(e.id=t.replace(OpenLayers.Util.dotless,"_")),i&&(e.style.left=i.x+"px",e.style.top=i.y+"px"),n&&(e.style.width=n.w+"px",e.style.height=n.h+"px"),s&&(e.style.position=s),r&&(e.style.border=r),a&&(e.style.overflow=a),parseFloat(o)>=0&&parseFloat(o)<1?(e.style.filter="alpha(opacity="+100*o+")",e.style.opacity=o):1==parseFloat(o)&&(e.style.filter="",e.style.opacity="")},OpenLayers.Util.createDiv=function(e,t,i,n,s,r,a,o){var l=document.createElement("div");return n&&(l.style.backgroundImage="url("+n+")"),e||(e=OpenLayers.Util.createUniqueID("OpenLayersDiv")),s||(s="absolute"),OpenLayers.Util.modifyDOMElement(l,e,t,i,s,r,a,o),l},OpenLayers.Util.createImage=function(e,t,i,n,s,r,a,o){function l(){h.style.display="",OpenLayers.Event.stopObservingElement(h)}var h=document.createElement("img");return e||(e=OpenLayers.Util.createUniqueID("OpenLayersDiv")),s||(s="relative"),OpenLayers.Util.modifyDOMElement(h,e,t,i,s,r,null,a),o&&(h.style.display="none",OpenLayers.Event.observe(h,"load",l),OpenLayers.Event.observe(h,"error",l)),h.style.alt=e,h.galleryImg="no",n&&(h.src=n),h},OpenLayers.IMAGE_RELOAD_ATTEMPTS=0,OpenLayers.Util.alphaHackNeeded=null,OpenLayers.Util.alphaHack=function(){if(null==OpenLayers.Util.alphaHackNeeded){var e=navigator.appVersion.split("MSIE"),t=parseFloat(e[1]),i=!1;try{i=!!document.body.filters}catch(e){}OpenLayers.Util.alphaHackNeeded=i&&t>=5.5&&t<7}return OpenLayers.Util.alphaHackNeeded},OpenLayers.Util.modifyAlphaImageDiv=function(e,t,i,n,s,r,a,o,l){OpenLayers.Util.modifyDOMElement(e,t,i,n,r,null,null,l);var h=e.childNodes[0];s&&(h.src=s),OpenLayers.Util.modifyDOMElement(h,e.id+"_innerImage",null,n,"relative",a),OpenLayers.Util.alphaHack()&&("none"!=e.style.display&&(e.style.display="inline-block"),null==o&&(o="scale"),e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+h.src+"', sizingMethod='"+o+"')",parseFloat(e.style.opacity)>=0&&parseFloat(e.style.opacity)<1&&(e.style.filter+=" alpha(opacity="+100*e.style.opacity+")"),h.style.filter="alpha(opacity=0)")},OpenLayers.Util.createAlphaImageDiv=function(e,t,i,n,s,r,a,o,l){var h=OpenLayers.Util.createDiv(),u=OpenLayers.Util.createImage(null,null,null,null,null,null,null,l);return u.className="olAlphaImg",h.appendChild(u),OpenLayers.Util.modifyAlphaImageDiv(h,e,t,i,n,s,r,a,o),h},OpenLayers.Util.upperCaseObject=function(e){var t={};for(var i in e)t[i.toUpperCase()]=e[i];return t},OpenLayers.Util.applyDefaults=function(e,t){e=e||{};var i="function"==typeof window.Event&&t instanceof window.Event;for(var n in t)(void 0===e[n]||!i&&t.hasOwnProperty&&t.hasOwnProperty(n)&&!e.hasOwnProperty(n))&&(e[n]=t[n]);return!i&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},OpenLayers.Util.getParameterString=function(e){var t=[];for(var i in e){var n=e[i];if(null!=n&&"function"!=typeof n){var s;if("object"==typeof n&&n.constructor==Array){for(var r,a=[],o=0,l=n.length;o<l;o++)r=n[o],a.push(encodeURIComponent(null===r||void 0===r?"":r));s=a.join(",")}else s=encodeURIComponent(n);t.push(encodeURIComponent(i)+"="+s)}}return t.join("&")},OpenLayers.Util.urlAppend=function(e,t){var i=e;if(t){var n=(e+" ").split(/[?&]/);i+=" "===n.pop()?t:n.length?"&"+t:"?"+t}return i},OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+"img/"},OpenLayers.Util.getImageLocation=function(e){return OpenLayers.Util.getImagesLocation()+e},OpenLayers.Util.Try=function(){for(var e=null,t=0,i=arguments.length;t<i;t++){var n=arguments[t];try{e=n();break}catch(e){}}return e},OpenLayers.Util.getXmlNodeValue=function(e){var t=null;return OpenLayers.Util.Try(function(){(t=e.text)||(t=e.textContent),t||(t=e.firstChild.nodeValue)},function(){t=e.textContent}),t},OpenLayers.Util.mouseLeft=function(e,t){for(var i=e.relatedTarget?e.relatedTarget:e.toElement;i!=t&&null!=i;)i=i.parentNode;return i!=t},OpenLayers.Util.DEFAULT_PRECISION=14,OpenLayers.Util.toFloat=function(e,t){return null==t&&(t=OpenLayers.Util.DEFAULT_PRECISION),"number"!=typeof e&&(e=parseFloat(e)),0===t?e:parseFloat(e.toPrecision(t))},OpenLayers.Util.rad=function(e){return e*Math.PI/180},OpenLayers.Util.deg=function(e){return 180*e/Math.PI},OpenLayers.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563},OpenLayers.Util.distVincenty=function(e,t){for(var i=OpenLayers.Util.VincentyConstants,n=i.a,s=i.b,r=i.f,a=OpenLayers.Util.rad(t.lon-e.lon),o=Math.atan((1-r)*Math.tan(OpenLayers.Util.rad(e.lat))),l=Math.atan((1-r)*Math.tan(OpenLayers.Util.rad(t.lat))),h=Math.sin(o),u=Math.cos(o),p=Math.sin(l),c=Math.cos(l),d=a,f=2*Math.PI,m=20;Math.abs(d-f)>1e-12&&--m>0;){var y=Math.sin(d),g=Math.cos(d),v=Math.sqrt(c*y*(c*y)+(u*p-h*c*g)*(u*p-h*c*g));if(0==v)return 0;var L=h*p+u*c*g,O=Math.atan2(v,L),b=Math.asin(u*c*y/v),w=Math.cos(b)*Math.cos(b),S=L-2*h*p/w,C=r/16*w*(4+r*(4-3*w));f=d,d=a+(1-C)*r*Math.sin(b)*(O+C*v*(S+C*L*(2*S*S-1)))}if(0==m)return NaN;var x=w*(n*n-s*s)/(s*s),_=x/1024*(256+x*(x*(74-47*x)-128));return(s*(1+x/16384*(4096+x*(x*(320-175*x)-768)))*(O-_*v*(S+_/4*(L*(2*S*S-1)-_/6*S*(4*v*v-3)*(4*S*S-3))))).toFixed(3)/1e3},OpenLayers.Util.destinationVincenty=function(e,t,i){for(var n=OpenLayers.Util,s=n.VincentyConstants,r=s.a,a=s.b,o=s.f,l=e.lon,h=e.lat,u=i,p=n.rad(t),c=Math.sin(p),d=Math.cos(p),f=(1-o)*Math.tan(n.rad(h)),m=1/Math.sqrt(1+f*f),y=f*m,g=Math.atan2(f,d),v=m*c,L=1-v*v,O=L*(r*r-a*a)/(a*a),b=1+O/16384*(4096+O*(O*(320-175*O)-768)),w=O/1024*(256+O*(O*(74-47*O)-128)),S=u/(a*b),C=2*Math.PI;Math.abs(S-C)>1e-12;){var x=Math.cos(2*g+S),_=Math.sin(S),E=Math.cos(S);C=S,S=u/(a*b)+w*_*(x+w/4*(E*(2*x*x-1)-w/6*x*(4*_*_-3)*(4*x*x-3)))}var N=y*_-m*E*d,P=Math.atan2(y*E+m*_*d,(1-o)*Math.sqrt(v*v+N*N)),M=o/16*L*(4+o*(4-3*L)),T=Math.atan2(_*c,m*E-y*_*d)-(1-M)*o*v*(S+M*_*(x+M*E*(2*x*x-1)));Math.atan2(v,-N);return new OpenLayers.LonLat(l+n.deg(T),n.deg(P))},OpenLayers.Util.getParameters=function(e,t){t=t||{},e=null===e||void 0===e?window.location.href:e;var i="";if(OpenLayers.String.contains(e,"?")){var n=e.indexOf("?")+1,s=OpenLayers.String.contains(e,"#")?e.indexOf("#"):e.length;i=e.substring(n,s)}for(var r={},a=i.split(/[&;]/),o=0,l=a.length;o<l;++o){var h=a[o].split("=");if(h[0]){var u=h[0];try{u=decodeURIComponent(u)}catch(e){u=unescape(u)}var p=(h[1]||"").replace(/\+/g," ");try{p=decodeURIComponent(p)}catch(e){p=unescape(p)}!1!==t.splitArgs&&(p=p.split(",")),1==p.length&&(p=p[0]),r[u]=p}}return r},OpenLayers.Util.lastSeqID=0,OpenLayers.Util.createUniqueID=function(e){return e=null==e?"id_":e.replace(OpenLayers.Util.dotless,"_"),OpenLayers.Util.lastSeqID+=1,e+OpenLayers.Util.lastSeqID},OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.37,km:39370,dd:4374754,yd:36},OpenLayers.INCHES_PER_UNIT.in=OpenLayers.INCHES_PER_UNIT.inches,OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd,OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m,OpenLayers.METERS_PER_INCH=.0254000508001016,OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:.0254/OpenLayers.METERS_PER_INCH,MicroInch:254e-7/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:.01/OpenLayers.METERS_PER_INCH,Kilometer:1e3/OpenLayers.METERS_PER_INCH,Yard:.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:.1/OpenLayers.METERS_PER_INCH,Millimeter:.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":5e4/OpenLayers.METERS_PER_INCH,"150kilometers":15e4/OpenLayers.METERS_PER_INCH}),OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1e3,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:100*OpenLayers.INCHES_PER_UNIT.Meter,km:1e3*OpenLayers.INCHES_PER_UNIT.Meter,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH}),OpenLayers.DOTS_PER_INCH=72,OpenLayers.Util.normalizeScale=function(e){return e>1?1/e:e},OpenLayers.Util.getResolutionFromScale=function(e,t){var i;return e&&(null==t&&(t="degrees"),i=1/(OpenLayers.Util.normalizeScale(e)*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH)),i},OpenLayers.Util.getScaleFromResolution=function(e,t){return null==t&&(t="degrees"),e*OpenLayers.INCHES_PER_UNIT[t]*OpenLayers.DOTS_PER_INCH},OpenLayers.Util.pagePosition=function(e){var t=[0,0],i=OpenLayers.Util.getViewportElement();if(!e||e==window||e==i)return t;var n,s=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&"absolute"==OpenLayers.Element.getStyle(e,"position")&&(""==e.style.top||""==e.style.left),r=null;if(e.getBoundingClientRect){n=e.getBoundingClientRect();var a=window.pageYOffset||i.scrollTop,o=window.pageXOffset||i.scrollLeft;t[0]=n.left+o,t[1]=n.top+a}else if(document.getBoxObjectFor&&!s){n=document.getBoxObjectFor(e);var l=document.getBoxObjectFor(i);t[0]=n.screenX-l.screenX,t[1]=n.screenY-l.screenY}else{if(t[0]=e.offsetLeft,t[1]=e.offsetTop,(r=e.offsetParent)!=e)for(;r;)t[0]+=r.offsetLeft,t[1]+=r.offsetTop,r=r.offsetParent;var h=OpenLayers.BROWSER_NAME;for(("opera"==h||"safari"==h&&"absolute"==OpenLayers.Element.getStyle(e,"position"))&&(t[1]-=document.body.offsetTop),r=e.offsetParent;r&&r!=document.body;)t[0]-=r.scrollLeft,"opera"==h&&"TR"==r.tagName||(t[1]-=r.scrollTop),r=r.offsetParent}return t},OpenLayers.Util.getViewportElement=function(){var e=arguments.callee.viewportElement;return void 0==e&&(e="msie"==OpenLayers.BROWSER_NAME&&"CSS1Compat"!=document.compatMode?document.body:document.documentElement,arguments.callee.viewportElement=e),e},OpenLayers.Util.isEquivalentUrl=function(e,t,i){i=i||{},OpenLayers.Util.applyDefaults(i,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0,splitArgs:!1});var n=OpenLayers.Util.createUrlObject(e,i),s=OpenLayers.Util.createUrlObject(t,i);for(var r in n)if("args"!==r&&n[r]!=s[r])return!1;for(var r in n.args){if(n.args[r]!=s.args[r])return!1;delete s.args[r]}for(var r in s.args)return!1;return!0},OpenLayers.Util.createUrlObject=function(e,t){if(t=t||{},!/^\w+:\/\//.test(e)){var i=window.location,n=i.port?":"+i.port:"",s=i.protocol+"//"+i.host.split(":").shift()+n;if(0===e.indexOf("/"))e=s+e;else{var r=i.pathname.split("/");r.pop(),e=s+r.join("/")+"/"+e}}t.ignoreCase&&(e=e.toLowerCase());var a=document.createElement("a");a.href=e;var o={};o.host=a.host.split(":").shift(),o.protocol=a.protocol,t.ignorePort80?o.port="80"==a.port||"0"==a.port?"":a.port:o.port=""==a.port||"0"==a.port?"80":a.port,o.hash=t.ignoreHash||"#"===a.hash?"":a.hash;var l=a.search;if(!l){var h=e.indexOf("?");l=-1!=h?e.substr(h):""}return o.args=OpenLayers.Util.getParameters(l,{splitArgs:t.splitArgs}),o.pathname="/"==a.pathname.charAt(0)?a.pathname:"/"+a.pathname,o},OpenLayers.Util.removeTail=function(e){var t=e.indexOf("?"),i=e.indexOf("#");return-1==t?-1!=i?e.substr(0,i):e:-1!=i?e.substr(0,Math.min(t,i)):e.substr(0,t)},OpenLayers.IS_GECKO=function(){var e=navigator.userAgent.toLowerCase();return-1==e.indexOf("webkit")&&-1!=e.indexOf("gecko")}(),OpenLayers.CANVAS_SUPPORTED=function(){var e=document.createElement("canvas");return!(!e.getContext||!e.getContext("2d"))}(),OpenLayers.BROWSER_NAME=function(){var e="",t=navigator.userAgent.toLowerCase();return-1!=t.indexOf("opera")?e="opera":-1!=t.indexOf("msie")?e="msie":-1!=t.indexOf("safari")?e="safari":-1!=t.indexOf("mozilla")&&(e=-1!=t.indexOf("firefox")?"firefox":"mozilla"),e}(),OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME},OpenLayers.Util.getRenderedDimensions=function(e,t,i){var n,s,r=document.createElement("div");r.style.visibility="hidden";for(var a=i&&i.containerElement?i.containerElement:document.body,o=!1,l=null,h=a;h&&"body"!=h.tagName.toLowerCase();){var u=OpenLayers.Element.getStyle(h,"position");if("absolute"==u){o=!0;break}if(u&&"static"!=u)break;h=h.parentNode}!o||0!==a.clientHeight&&0!==a.clientWidth||((l=document.createElement("div")).style.visibility="hidden",l.style.position="absolute",l.style.overflow="visible",l.style.width=document.body.clientWidth+"px",l.style.height=document.body.clientHeight+"px",l.appendChild(r)),r.style.position="absolute",t&&(t.w?(n=t.w,r.style.width=n+"px"):t.h&&(s=t.h,r.style.height=s+"px")),i&&i.displayClass&&(r.className=i.displayClass);var p=document.createElement("div");if(p.innerHTML=e,p.style.overflow="visible",p.childNodes)for(var c=0,d=p.childNodes.length;c<d;c++)p.childNodes[c].style&&(p.childNodes[c].style.overflow="visible");return r.appendChild(p),l?a.appendChild(l):a.appendChild(r),n||(n=parseInt(p.scrollWidth),r.style.width=n+"px"),s||(s=parseInt(p.scrollHeight)),r.removeChild(p),l?(l.removeChild(r),a.removeChild(l)):a.removeChild(r),new OpenLayers.Size(n,s)},OpenLayers.Util.getScrollbarWidth=function(){var e=OpenLayers.Util._scrollbarWidth;if(null==e){var t=null,i=null,n=0,s=0;(t=document.createElement("div")).style.position="absolute",t.style.top="-1000px",t.style.left="-1000px",t.style.width="100px",t.style.height="50px",t.style.overflow="hidden",(i=document.createElement("div")).style.width="100%",i.style.height="200px",t.appendChild(i),document.body.appendChild(t),n=i.offsetWidth,t.style.overflow="scroll",s=i.offsetWidth,document.body.removeChild(document.body.lastChild),OpenLayers.Util._scrollbarWidth=n-s,e=OpenLayers.Util._scrollbarWidth}return e},OpenLayers.Util.getFormattedLonLat=function(e,t,i){i||(i="dms"),e=(e+540)%360-180;var n=Math.abs(e),s=Math.floor(n),r=(n-s)/(1/60),a=(r-(r=Math.floor(r)))/(1/60);a=Math.round(10*a),(a/=10)>=60&&(a-=60,(r+=1)>=60&&(r-=60,s+=1)),s<10&&(s="0"+s);var o=s+"°";return i.indexOf("dm")>=0&&(r<10&&(r="0"+r),o+=r+"'",i.indexOf("dms")>=0&&(a<10&&(a="0"+a),o+=a+'"')),o+="lon"==t?e<0?OpenLayers.i18n("W"):OpenLayers.i18n("E"):e<0?OpenLayers.i18n("S"):OpenLayers.i18n("N")},OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(e){OpenLayers.Util.extend(this,e),this.options=e},destroy:function(){},read:function(e){throw new Error("Read not implemented.")},write:function(e){throw new Error("Write not implemented.")},CLASS_NAME:"OpenLayers.Format"}),OpenLayers.Format.CSWGetRecords=function(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Format.CSWGetRecords.DEFAULTS);var t=OpenLayers.Format.CSWGetRecords["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSWGetRecords version: "+e.version;return new t(e)},OpenLayers.Format.CSWGetRecords.DEFAULTS={version:"2.0.2"},OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:!1,displayClass:"",title:"",autoActivate:!1,active:null,handlerOptions:null,handler:null,eventListeners:null,events:null,initialize:function(e){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,""),OpenLayers.Util.extend(this,e),this.events=new OpenLayers.Events(this),this.eventListeners instanceof Object&&this.events.on(this.eventListeners),null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"))},destroy:function(){if(this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=null),this.eventListeners=null,this.handler&&(this.handler.destroy(),this.handler=null),this.handlers){for(var e in this.handlers)this.handlers.hasOwnProperty(e)&&"function"==typeof this.handlers[e].destroy&&this.handlers[e].destroy();this.handlers=null}this.map&&(this.map.removeControl(this),this.map=null),this.div=null},setMap:function(e){this.map=e,this.handler&&this.handler.setMap(e)},draw:function(e){return null==this.div&&(this.div=OpenLayers.Util.createDiv(this.id),this.div.className=this.displayClass,this.allowSelection||(this.div.className+=" olControlNoSelect",this.div.setAttribute("unselectable","on",0),this.div.onselectstart=OpenLayers.Function.False),""!=this.title&&(this.div.title=this.title)),null!=e&&(this.position=e.clone()),this.moveTo(this.position),this.div},moveTo:function(e){null!=e&&null!=this.div&&(this.div.style.left=e.x+"px",this.div.style.top=e.y+"px")},activate:function(){return!this.active&&(this.handler&&this.handler.activate(),this.active=!0,this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("activate"),!0)},deactivate:function(){return!!this.active&&(this.handler&&this.handler.deactivate(),this.active=!1,this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("deactivate"),!0)},CLASS_NAME:"OpenLayers.Control"}),OpenLayers.Control.TYPE_BUTTON=1,OpenLayers.Control.TYPE_TOGGLE=2,OpenLayers.Control.TYPE_TOOL=3,OpenLayers.Event={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(e){return e.target||e.srcElement},isSingleTouch:function(e){return e.touches&&1==e.touches.length},isMultiTouch:function(e){return e.touches&&e.touches.length>1},isLeftClick:function(e){return e.which&&1==e.which||e.button&&1==e.button},isRightClick:function(e){return e.which&&3==e.which||e.button&&2==e.button},stop:function(e,t){t||OpenLayers.Event.preventDefault(e),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},findElement:function(e,t){for(var i=OpenLayers.Event.element(e);i.parentNode&&(!i.tagName||i.tagName.toUpperCase()!=t.toUpperCase());)i=i.parentNode;return i},observe:function(e,t,i,n){var s=OpenLayers.Util.getElement(e);if(n=n||!1,"keypress"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!s._eventCacheID){var r="eventCacheID_";s.id&&(r=s.id+"_"+r),s._eventCacheID=OpenLayers.Util.createUniqueID(r)}var a=s._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:s,name:t,observer:i,useCapture:n}),s.addEventListener?s.addEventListener(t,i,n):s.attachEvent&&s.attachEvent("on"+t,i)},stopObservingElement:function(e){var t=OpenLayers.Util.getElement(e)._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var i=e[t];OpenLayers.Event.stopObserving.apply(this,[i.element,i.name,i.observer,i.useCapture])}},stopObserving:function(e,t,i,n){n=n||!1;var s=OpenLayers.Util.getElement(e),r=s._eventCacheID;"keypress"==t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||s.detachEvent)&&(t="keydown");var a=!1,o=OpenLayers.Event.observers[r];if(o)for(var l=0;!a&&l<o.length;){var h=o[l];if(h.name==t&&h.observer==i&&h.useCapture==n){o.splice(l,1),0==o.length&&delete OpenLayers.Event.observers[r],a=!0;break}l++}return a&&(s.removeEventListener?s.removeEventListener(t,i,n):s&&s.detachEvent&&s.detachEvent("on"+t,i)),a},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var e in OpenLayers.Event.observers){var t=OpenLayers.Event.observers[e];OpenLayers.Event._removeElementObservers.apply(this,[t])}OpenLayers.Event.observers=!1}},CLASS_NAME:"OpenLayers.Event"},OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,!1),OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur","touchstart","touchmove","touchend","keydown"],listeners:null,object:null,element:null,eventHandler:null,fallThrough:null,includeXY:!1,extensions:null,extensionCount:null,clearMouseListener:null,initialize:function(e,t,i,n,s){OpenLayers.Util.extend(this,s),this.object=e,this.fallThrough=n,this.listeners={},this.extensions={},this.extensionCount={},this._msTouches=[],null!=t&&this.attachToElement(t)},destroy:function(){for(var e in this.extensions)"boolean"!=typeof this.extensions[e]&&this.extensions[e].destroy();this.extensions=null,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.fallThrough=null,this.eventHandler=null},addEventType:function(e){},attachToElement:function(e){this.element?OpenLayers.Event.stopObservingElement(this.element):(this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this)),this.element=e;for(var t,i=!!window.navigator.msMaxTouchPoints,n=0,s=this.BROWSER_EVENTS.length;n<s;n++)t=this.BROWSER_EVENTS[n],OpenLayers.Event.observe(e,t,this.eventHandler),i&&0===t.indexOf("touch")&&this.addMsTouchListener(e,t,this.eventHandler);OpenLayers.Event.observe(e,"dragstart",OpenLayers.Event.stop)},on:function(e){for(var t in e)"scope"!=t&&e.hasOwnProperty(t)&&this.register(t,e.scope,e[t])},register:function(e,t,i,n){if(e in OpenLayers.Events&&!this.extensions[e]&&(this.extensions[e]=new OpenLayers.Events[e](this)),null!=i){null==t&&(t=this.object);var s=this.listeners[e];s||(s=[],this.listeners[e]=s,this.extensionCount[e]=0);var r={obj:t,func:i};n?(s.splice(this.extensionCount[e],0,r),"object"==typeof n&&n.extension&&this.extensionCount[e]++):s.push(r)}},registerPriority:function(e,t,i){this.register(e,t,i,!0)},un:function(e){for(var t in e)"scope"!=t&&e.hasOwnProperty(t)&&this.unregister(t,e.scope,e[t])},unregister:function(e,t,i){null==t&&(t=this.object);var n=this.listeners[e];if(null!=n)for(var s=0,r=n.length;s<r;s++)if(n[s].obj==t&&n[s].func==i){n.splice(s,1);break}},remove:function(e){null!=this.listeners[e]&&(this.listeners[e]=[])},triggerEvent:function(e,t){var i=this.listeners[e];if(i&&0!=i.length){null==t&&(t={}),t.object=this.object,t.element=this.element,t.type||(t.type=e);for(var n,s=0,r=(i=i.slice()).length;s<r;s++){var a=i[s];if(void 0!=(n=a.func.apply(a.obj,[t]))&&0==n)break}return this.fallThrough||OpenLayers.Event.stop(t,!0),n}},handleBrowserEvent:function(e){var t=e.type,i=this.listeners[t];if(i&&0!=i.length){var n=e.touches;if(n&&n[0]){for(var s,r=0,a=0,o=n.length,l=0;l<o;++l)r+=(s=this.getTouchClientXY(n[l])).clientX,a+=s.clientY;e.clientX=r/o,e.clientY=a/o}this.includeXY&&(e.xy=this.getMousePosition(e)),this.triggerEvent(t,e)}},getTouchClientXY:function(e){var t=window.olMockWin||window,i=t.pageXOffset,n=t.pageYOffset,s=e.clientX,r=e.clientY;return 0===e.pageY&&Math.floor(r)>Math.floor(e.pageY)||0===e.pageX&&Math.floor(s)>Math.floor(e.pageX)?(s-=i,r-=n):(r<e.pageY-n||s<e.pageX-i)&&(s=e.pageX-i,r=e.pageY-n),e.olClientX=s,e.olClientY=r,{clientX:s,clientY:r}},clearMouseCache:function(){this.element.scrolls=null,this.element.lefttop=null,this.element.offsets=null},getMousePosition:function(e){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=[window.pageXOffset||t.scrollLeft,window.pageYOffset||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(e.clientX+this.element.scrolls[0]-this.element.offsets[0]-this.element.lefttop[0],e.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])},addMsTouchListener:function(e,t,i){function n(e){i(OpenLayers.Util.applyDefaults({stopPropagation:function(){for(var e=s.length-1;e>=0;--e)s[e].stopPropagation()},preventDefault:function(){for(var e=s.length-1;e>=0;--e)s[e].preventDefault()},type:t},e))}this.eventHandler;var s=this._msTouches;switch(t){case"touchstart":return this.addMsTouchListenerStart(e,t,n);case"touchend":return this.addMsTouchListenerEnd(e,t,n);case"touchmove":return this.addMsTouchListenerMove(e,t,n);default:throw"Unknown touch event type"}},addMsTouchListenerStart:function(e,t,i){var n=this._msTouches,s=function(e){for(var t=!1,s=0,r=n.length;s<r;++s)if(n[s].pointerId==e.pointerId){t=!0;break}t||n.push(e),e.touches=n.slice(),i(e)};OpenLayers.Event.observe(e,"MSPointerDown",s);var r=function(e){for(var t=0,i=n.length;t<i;++t)if(n[t].pointerId==e.pointerId){n.splice(t,1);break}};OpenLayers.Event.observe(e,"MSPointerUp",r)},addMsTouchListenerMove:function(e,t,i){var n=this._msTouches,s=function(e){if(!(e.pointerType==e.MSPOINTER_TYPE_MOUSE&&0==e.buttons||1==n.length&&n[0].pageX==e.pageX&&n[0].pageY==e.pageY)){for(var t=0,s=n.length;t<s;++t)if(n[t].pointerId==e.pointerId){n[t]=e;break}e.touches=n.slice(),i(e)}};OpenLayers.Event.observe(e,"MSPointerMove",s)},addMsTouchListenerEnd:function(e,t,i){var n=this._msTouches,s=function(e){for(var t=0,s=n.length;t<s;++t)if(n[t].pointerId==e.pointerId){n.splice(t,1);break}e.touches=n.slice(),i(e)};OpenLayers.Event.observe(e,"MSPointerUp",s)},CLASS_NAME:"OpenLayers.Events"}),OpenLayers.Events.buttonclick=OpenLayers.Class({target:null,events:["mousedown","mouseup","click","dblclick","touchstart","touchmove","touchend","keydown"],startRegEx:/^mousedown|touchstart$/,cancelRegEx:/^touchmove$/,completeRegEx:/^mouseup|touchend$/,initialize:function(e){this.target=e;for(var t=this.events.length-1;t>=0;--t)this.target.register(this.events[t],this,this.buttonClick,{extension:!0})},destroy:function(){for(var e=this.events.length-1;e>=0;--e)this.target.unregister(this.events[e],this,this.buttonClick);delete this.target},getPressedButton:function(e){var t,i=3;do{if(OpenLayers.Element.hasClass(e,"olButton")){t=e;break}e=e.parentNode}while(--i>0&&e);return t},ignore:function(e){var t=3,i=!1;do{if("a"===e.nodeName.toLowerCase()){i=!0;break}e=e.parentNode}while(--t>0&&e);return i},buttonClick:function(e){var t=!0,i=OpenLayers.Event.element(e);if(i&&(OpenLayers.Event.isLeftClick(e)||!~e.type.indexOf("mouse"))){var n=this.getPressedButton(i);if(n){if("keydown"===e.type)switch(e.keyCode){case OpenLayers.Event.KEY_RETURN:case OpenLayers.Event.KEY_SPACE:this.target.triggerEvent("buttonclick",{buttonElement:n}),OpenLayers.Event.stop(e),t=!1}else if(this.startEvt){if(this.completeRegEx.test(e.type)){var s=OpenLayers.Util.pagePosition(n),r=OpenLayers.Util.getViewportElement(),a=window.pageYOffset||r.scrollTop,o=window.pageXOffset||r.scrollLeft;s[0]=s[0]-o,s[1]=s[1]-a,this.target.triggerEvent("buttonclick",{buttonElement:n,buttonXY:{x:this.startEvt.clientX-s[0],y:this.startEvt.clientY-s[1]}})}this.cancelRegEx.test(e.type)&&delete this.startEvt,OpenLayers.Event.stop(e),t=!1}this.startRegEx.test(e.type)&&(this.startEvt=e,OpenLayers.Event.stop(e),t=!1)}else t=!this.ignore(OpenLayers.Event.element(e)),delete this.startEvt}return t}}),OpenLayers.Util=OpenLayers.Util||{},OpenLayers.Util.vendorPrefix=function(){"use strict";function e(e){return e?e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()}).replace(/^ms-/,"-ms-"):null}function t(t){if(void 0===a[t]){var i=n(t.replace(/(-[\s\S])/g,function(e){return e.charAt(1).toUpperCase()}));a[t]=e(i)}return a[t]}function i(e,t){if(void 0===o[t]){var i,n,r=0,a=s.length,l=void 0!==e.cssText;for(o[t]=null;r<a;r++)if(n=s[r],n?(l||(n=n.toLowerCase()),i=n+t.charAt(0).toUpperCase()+t.slice(1)):i=t,void 0!==e[i]){o[t]=i;break}}return o[t]}function n(e){return i(r,e)}var s=["","O","ms","Moz","Webkit"],r=document.createElement("div").style,a={},o={};return{css:t,js:i,style:n,cssCache:a,jsCache:o}}(),OpenLayers.Animation=function(e){function t(e,t,i){t=t>0?t:Number.POSITIVE_INFINITY;var n=++a,s=+new Date;return o[n]=function(){o[n]&&+new Date-s<=t?(e(),o[n]&&r(o[n],i)):delete o[n]},r(o[n],i),n}function i(e){delete o[e]}var n=OpenLayers.Util.vendorPrefix.js(e,"requestAnimationFrame"),s=!!n,r=function(){var t=e[n]||function(t,i){e.setTimeout(t,16)};return function(i,n){t.apply(e,[i,n])}}(),a=0,o={};return{isNative:s,requestFrame:r,start:t,stop:i}}(window),OpenLayers.Tween=OpenLayers.Class({easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,minFrameRate:null,startTime:null,animationId:null,playing:!1,initialize:function(e){this.easing=e||OpenLayers.Easing.Expo.easeOut},start:function(e,t,i,n){this.playing=!0,this.begin=e,this.finish=t,this.duration=i,this.callbacks=n.callbacks,this.minFrameRate=n.minFrameRate||30,this.time=0,this.startTime=(new Date).getTime(),OpenLayers.Animation.stop(this.animationId),this.animationId=null,this.callbacks&&this.callbacks.start&&this.callbacks.start.call(this,this.begin),this.animationId=OpenLayers.Animation.start(OpenLayers.Function.bind(this.play,this))},stop:function(){this.playing&&(this.callbacks&&this.callbacks.done&&this.callbacks.done.call(this,this.finish),OpenLayers.Animation.stop(this.animationId),this.animationId=null,this.playing=!1)},play:function(){var e={};for(var t in this.begin){var i=this.begin[t],n=this.finish[t];if(null==i||null==n||isNaN(i)||isNaN(n))throw new TypeError("invalid value for Tween");var s=n-i;e[t]=this.easing.apply(this,[this.time,i,s,this.duration])}this.time++,this.callbacks&&this.callbacks.eachStep&&((new Date).getTime()-this.startTime)/this.time<=1e3/this.minFrameRate&&this.callbacks.eachStep.call(this,e),this.time>this.duration&&this.stop()},CLASS_NAME:"OpenLayers.Tween"}),OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"},OpenLayers.Easing.Linear={easeIn:function(e,t,i,n){return i*e/n+t},easeOut:function(e,t,i,n){return i*e/n+t},easeInOut:function(e,t,i,n){return i*e/n+t},CLASS_NAME:"OpenLayers.Easing.Linear"},OpenLayers.Easing.Expo={easeIn:function(e,t,i,n){return 0==e?t:i*Math.pow(2,10*(e/n-1))+t},easeOut:function(e,t,i,n){return e==n?t+i:i*(1-Math.pow(2,-10*e/n))+t},easeInOut:function(e,t,i,n){return 0==e?t:e==n?t+i:(e/=n/2)<1?i/2*Math.pow(2,10*(e-1))+t:i/2*(2-Math.pow(2,-10*--e))+t},CLASS_NAME:"OpenLayers.Easing.Expo"},OpenLayers.Easing.Quad={easeIn:function(e,t,i,n){return i*(e/=n)*e+t},easeOut:function(e,t,i,n){return-i*(e/=n)*(e-2)+t},easeInOut:function(e,t,i,n){return(e/=n/2)<1?i/2*e*e+t:-i/2*(--e*(e-2)-1)+t},CLASS_NAME:"OpenLayers.Easing.Quad"},OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(e,t){OpenLayers.Util.extend(this,t),this.projCode=e,"object"==typeof Proj4js&&(this.proj=new Proj4js.Proj(e))},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(e){var t=e,i=!1;if(t)if(t instanceof OpenLayers.Projection||(t=new OpenLayers.Projection(t)),"object"==typeof Proj4js&&this.proj.defData&&t.proj.defData)i=this.proj.defData.replace(this.titleRegEx,"")==t.proj.defData.replace(this.titleRegEx,"");else if(t.getCode){var n=this.getCode(),s=t.getCode();i=n==s||!!OpenLayers.Projection.transforms[n]&&OpenLayers.Projection.transforms[n][s]===OpenLayers.Projection.nullTransform}return i},destroy:function(){delete this.proj,delete this.projCode},CLASS_NAME:"OpenLayers.Projection"}),OpenLayers.Projection.transforms={},OpenLayers.Projection.defaults={"EPSG:4326":{units:"degrees",maxExtent:[-180,-90,180,90],yx:!0},"CRS:84":{units:"degrees",maxExtent:[-180,-90,180,90]},"EPSG:900913":{units:"m",maxExtent:[-20037508.34,-20037508.34,20037508.34,20037508.34]}},OpenLayers.Projection.addTransform=function(e,t,i){if(i===OpenLayers.Projection.nullTransform){var n=OpenLayers.Projection.defaults[e];n&&!OpenLayers.Projection.defaults[t]&&(OpenLayers.Projection.defaults[t]=n)}OpenLayers.Projection.transforms[e]||(OpenLayers.Projection.transforms[e]={}),OpenLayers.Projection.transforms[e][t]=i},OpenLayers.Projection.transform=function(e,t,i){if(t&&i)if(t instanceof OpenLayers.Projection||(t=new OpenLayers.Projection(t)),i instanceof OpenLayers.Projection||(i=new OpenLayers.Projection(i)),t.proj&&i.proj)e=Proj4js.transform(t.proj,i.proj,e);else{var n=t.getCode(),s=i.getCode(),r=OpenLayers.Projection.transforms;r[n]&&r[n][s]&&r[n][s](e)}return e},OpenLayers.Projection.nullTransform=function(e){return e},function(){function e(e){return e.x=180*e.x/s,e.y=180/Math.PI*(2*Math.atan(Math.exp(e.y/s*Math.PI))-Math.PI/2),e}function t(e){e.x=e.x*s/180;var t=Math.log(Math.tan((90+e.y)*Math.PI/360))/Math.PI*s;return e.y=Math.max(-20037508.34,Math.min(t,20037508.34)),e}function i(i,n){var s,r,a,o,l,h=OpenLayers.Projection.addTransform,u=OpenLayers.Projection.nullTransform;for(s=0,r=n.length;s<r;++s)for(h(i,a=n[s],t),h(a,i,e),l=s+1;l<r;++l)h(a,o=n[l],u),h(o,a,u)}var n,s=20037508.34,r=["EPSG:900913","EPSG:3857","EPSG:102113","EPSG:102100"],a=["CRS:84","urn:ogc:def:crs:EPSG:6.6:4326","EPSG:4326"];for(n=r.length-1;n>=0;--n)i(r[n],a);for(n=a.length-1;n>=0;--n)i(a[n],r)}(),OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1e3},id:null,fractionalZoom:!1,events:null,allOverlays:!1,div:null,dragging:!1,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,options:null,tileSize:null,projection:"EPSG:4326",units:null,resolutions:null,maxResolution:null,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:!1,autoUpdateSize:!0,eventListeners:null,panTween:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,zoomTween:null,zoomMethod:OpenLayers.Easing.Quad.easeOut,zoomDuration:20,paddingForPopups:null,layerContainerOriginPx:null,minPx:null,maxPx:null,initialize:function(e,t){1===arguments.length&&"object"==typeof e&&(e=(t=e)&&t.div),this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT),this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15),this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css",this.options=OpenLayers.Util.extend({},t),OpenLayers.Util.extend(this,t);var i=this.projection instanceof OpenLayers.Projection?this.projection.projCode:this.projection;OpenLayers.Util.applyDefaults(this,OpenLayers.Projection.defaults[i]),!this.maxExtent||this.maxExtent instanceof OpenLayers.Bounds||(this.maxExtent=new OpenLayers.Bounds(this.maxExtent)),!this.minExtent||this.minExtent instanceof OpenLayers.Bounds||(this.minExtent=new OpenLayers.Bounds(this.minExtent)),!this.restrictedExtent||this.restrictedExtent instanceof OpenLayers.Bounds||(this.restrictedExtent=new OpenLayers.Bounds(this.restrictedExtent)),!this.center||this.center instanceof OpenLayers.LonLat||(this.center=new OpenLayers.LonLat(this.center)),this.layers=[],this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_"),this.div=OpenLayers.Util.getElement(e),this.div||(this.div=document.createElement("div"),this.div.style.height="1px",this.div.style.width="1px"),OpenLayers.Element.addClass(this.div,"olMap");var n=this.id+"_OpenLayers_ViewPort";if(this.viewPortDiv=OpenLayers.Util.createDiv(n,null,null,null,"relative",null,"hidden"),this.viewPortDiv.style.width="100%",this.viewPortDiv.style.height="100%",this.viewPortDiv.className="olMapViewport",this.div.appendChild(this.viewPortDiv),this.events=new OpenLayers.Events(this,this.viewPortDiv,null,this.fallThrough,{includeXY:!0}),OpenLayers.TileManager&&null!==this.tileManager&&(this.tileManager instanceof OpenLayers.TileManager||(this.tileManager=new OpenLayers.TileManager(this.tileManager)),this.tileManager.addMap(this)),n=this.id+"_OpenLayers_Container",this.layerContainerDiv=OpenLayers.Util.createDiv(n),this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1,this.layerContainerOriginPx={x:0,y:0},this.applyTransform(),this.viewPortDiv.appendChild(this.layerContainerDiv),this.updateSize(),this.eventListeners instanceof Object&&this.events.on(this.eventListeners),!0===this.autoUpdateSize&&(this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this),OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)),this.theme){for(var s=!0,r=document.getElementsByTagName("link"),a=0,o=r.length;a<o;++a)if(OpenLayers.Util.isEquivalentUrl(r.item(a).href,this.theme)){s=!1;break}if(s){var l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("type","text/css"),l.setAttribute("href",this.theme),document.getElementsByTagName("head")[0].appendChild(l)}}null==this.controls&&(this.controls=[],null!=OpenLayers.Control&&(OpenLayers.Control.Navigation?this.controls.push(new OpenLayers.Control.Navigation):OpenLayers.Control.TouchNavigation&&this.controls.push(new OpenLayers.Control.TouchNavigation),OpenLayers.Control.Zoom?this.controls.push(new OpenLayers.Control.Zoom):OpenLayers.Control.PanZoom&&this.controls.push(new OpenLayers.Control.PanZoom),OpenLayers.Control.ArgParser&&this.controls.push(new OpenLayers.Control.ArgParser),OpenLayers.Control.Attribution&&this.controls.push(new OpenLayers.Control.Attribution)));for(var a=0,o=this.controls.length;a<o;a++)this.addControlToMap(this.controls[a]);this.popups=[],this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this),OpenLayers.Event.observe(window,"unload",this.unloadDestroy),t&&t.layers&&(delete this.center,delete this.zoom,this.addLayers(t.layers),t.center&&!this.getCenter()&&this.setCenter(t.center,t.zoom)),this.panMethod&&(this.panTween=new OpenLayers.Tween(this.panMethod)),this.zoomMethod&&this.applyTransform.transform&&(this.zoomTween=new OpenLayers.Tween(this.zoomMethod))},getViewport:function(){return this.viewPortDiv},render:function(e){this.div=OpenLayers.Util.getElement(e),OpenLayers.Element.addClass(this.div,"olMap"),this.viewPortDiv.parentNode.removeChild(this.viewPortDiv),this.div.appendChild(this.viewPortDiv),this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy)return!1;if(this.panTween&&(this.panTween.stop(),this.panTween=null),this.zoomTween&&(this.zoomTween.stop(),this.zoomTween=null),OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy),this.unloadDestroy=null,this.updateSizeDestroy&&OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy),this.paddingForPopups=null,null!=this.controls){for(e=this.controls.length-1;e>=0;--e)this.controls[e].destroy();this.controls=null}if(null!=this.layers){for(var e=this.layers.length-1;e>=0;--e)this.layers[e].destroy(!1);this.layers=null}this.viewPortDiv&&this.viewPortDiv.parentNode&&this.viewPortDiv.parentNode.removeChild(this.viewPortDiv),this.viewPortDiv=null,this.tileManager&&(this.tileManager.removeMap(this),this.tileManager=null),this.eventListeners&&(this.events.un(this.eventListeners),this.eventListeners=null),this.events.destroy(),this.events=null,this.options=null},setOptions:function(e){var t=this.minPx&&e.restrictedExtent!=this.restrictedExtent;OpenLayers.Util.extend(this,e),t&&this.moveTo(this.getCachedCenter(),this.zoom,{forceZoomChange:!0})},getTileSize:function(){return this.tileSize},getBy:function(e,t,i){var n="function"==typeof i.test;return OpenLayers.Array.filter(this[e],function(e){return e[t]==i||n&&i.test(e[t])})},getLayersBy:function(e,t){return this.getBy("layers",e,t)},getLayersByName:function(e){return this.getLayersBy("name",e)},getLayersByClass:function(e){return this.getLayersBy("CLASS_NAME",e)},getControlsBy:function(e,t){return this.getBy("controls",e,t)},getControlsByClass:function(e){return this.getControlsBy("CLASS_NAME",e)},getLayer:function(e){for(var t=null,i=0,n=this.layers.length;i<n;i++){var s=this.layers[i];if(s.id==e){t=s;break}}return t},setLayerZIndex:function(e,t){e.setZIndex(this.Z_INDEX_BASE[e.isBaseLayer?"BaseLayer":"Overlay"]+5*t)},resetLayersZIndex:function(){for(var e=0,t=this.layers.length;e<t;e++){var i=this.layers[e];this.setLayerZIndex(i,e)}},addLayer:function(e){for(var t=0,i=this.layers.length;t<i;t++)if(this.layers[t]==e)return!1;return!1!==this.events.triggerEvent("preaddlayer",{layer:e})&&(this.allOverlays&&(e.isBaseLayer=!1),e.div.className="olLayerDiv",e.div.style.overflow="",this.setLayerZIndex(e,this.layers.length),e.isFixed?this.viewPortDiv.appendChild(e.div):this.layerContainerDiv.appendChild(e.div),this.layers.push(e),e.setMap(this),e.isBaseLayer||this.allOverlays&&!this.baseLayer?null==this.baseLayer?this.setBaseLayer(e):e.setVisibility(!1):e.redraw(),this.events.triggerEvent("addlayer",{layer:e}),e.events.triggerEvent("added",{map:this,layer:e}),e.afterAdd(),!0)},addLayers:function(e){for(var t=0,i=e.length;t<i;t++)this.addLayer(e[t])},removeLayer:function(e,t){if(!1!==this.events.triggerEvent("preremovelayer",{layer:e})){if(null==t&&(t=!0),e.isFixed?this.viewPortDiv.removeChild(e.div):this.layerContainerDiv.removeChild(e.div),OpenLayers.Util.removeItem(this.layers,e),e.removeMap(this),e.map=null,this.baseLayer==e&&(this.baseLayer=null,t))for(var i=0,n=this.layers.length;i<n;i++){var s=this.layers[i];if(s.isBaseLayer||this.allOverlays){this.setBaseLayer(s);break}}this.resetLayersZIndex(),this.events.triggerEvent("removelayer",{layer:e}),e.events.triggerEvent("removed",{map:this,layer:e})}},getNumLayers:function(){return this.layers.length},getLayerIndex:function(e){return OpenLayers.Util.indexOf(this.layers,e)},setLayerIndex:function(e,t){var i=this.getLayerIndex(e);if(t<0?t=0:t>this.layers.length&&(t=this.layers.length),i!=t){this.layers.splice(i,1),this.layers.splice(t,0,e);for(var n=0,s=this.layers.length;n<s;n++)this.setLayerZIndex(this.layers[n],n);this.events.triggerEvent("changelayer",{layer:e,property:"order"}),this.allOverlays&&(0===t?this.setBaseLayer(e):this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0]))}},raiseLayer:function(e,t){var i=this.getLayerIndex(e)+t;this.setLayerIndex(e,i)},setBaseLayer:function(e){if(e!=this.baseLayer&&-1!=OpenLayers.Util.indexOf(this.layers,e)){var t=this.getCachedCenter(),i=OpenLayers.Util.getResolutionFromScale(this.getScale(),e.units);if(null==this.baseLayer||this.allOverlays||this.baseLayer.setVisibility(!1),this.baseLayer=e,this.allOverlays&&!this.baseLayer.visibility||(this.baseLayer.setVisibility(!0),!1===this.baseLayer.inRange&&this.baseLayer.redraw()),null!=t){var n=this.getZoomForResolution(i||this.resolution,!0);this.setCenter(t,n,!1,!0)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}},addControl:function(e,t){this.controls.push(e),this.addControlToMap(e,t)},addControls:function(e,t){for(var i=1===arguments.length?[]:t,n=0,s=e.length;n<s;n++){var r=e[n],a=i[n]?i[n]:null;this.addControl(r,a)}},addControlToMap:function(e,t){e.outsideViewport=null!=e.div,this.displayProjection&&!e.displayProjection&&(e.displayProjection=this.displayProjection),e.setMap(this);var i=e.draw(t);i&&(e.outsideViewport||(i.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length,this.viewPortDiv.appendChild(i))),e.autoActivate&&e.activate()},getControl:function(e){for(var t=null,i=0,n=this.controls.length;i<n;i++){var s=this.controls[i];if(s.id==e){t=s;break}}return t},removeControl:function(e){e&&e==this.getControl(e.id)&&(e.div&&e.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(e.div),OpenLayers.Util.removeItem(this.controls,e))},addPopup:function(e,t){if(t)for(var i=this.popups.length-1;i>=0;--i)this.removePopup(this.popups[i]);e.map=this,this.popups.push(e);var n=e.draw();n&&(n.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length,this.layerContainerDiv.appendChild(n))},removePopup:function(e){if(OpenLayers.Util.removeItem(this.popups,e),e.div)try{this.layerContainerDiv.removeChild(e.div)}catch(e){}e.map=null},getSize:function(){var e=null;return null!=this.size&&(e=this.size.clone()),e},updateSize:function(){var e=this.getCurrentSize();if(e&&!isNaN(e.h)&&!isNaN(e.w)){this.events.clearMouseCache();var t=this.getSize();if(null==t&&(this.size=t=e),!e.equals(t)){this.size=e;for(var i=0,n=this.layers.length;i<n;i++)this.layers[i].onMapResize();var s=this.getCachedCenter();if(null!=this.baseLayer&&null!=s){var r=this.getZoom();this.zoom=null,this.setCenter(s,r)}}}this.events.triggerEvent("updatesize")},getCurrentSize:function(){var e=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);return(0==e.w&&0==e.h||isNaN(e.w)&&isNaN(e.h))&&(e.w=this.div.offsetWidth,e.h=this.div.offsetHeight),(0==e.w&&0==e.h||isNaN(e.w)&&isNaN(e.h))&&(e.w=parseInt(this.div.style.width),e.h=parseInt(this.div.style.height)),e},calculateBounds:function(e,t){var i=null;if(null==e&&(e=this.getCachedCenter()),null==t&&(t=this.getResolution()),null!=e&&null!=t){var n=this.size.w*t/2,s=this.size.h*t/2;i=new OpenLayers.Bounds(e.lon-n,e.lat-s,e.lon+n,e.lat+s)}return i},getCenter:function(){var e=null,t=this.getCachedCenter();return t&&(e=t.clone()),e},getCachedCenter:function(){return!this.center&&this.size&&(this.center=this.getLonLatFromViewPortPx({x:this.size.w/2,y:this.size.h/2})),this.center},getZoom:function(){return this.zoom},pan:function(e,t,i){if((i=OpenLayers.Util.applyDefaults(i,{animate:!0,dragging:!1})).dragging)0==e&&0==t||this.moveByPx(e,t);else{var n=this.getViewPortPxFromLonLat(this.getCachedCenter()),s=n.add(e,t);if(this.dragging||!s.equals(n)){var r=this.getLonLatFromViewPortPx(s);i.animate?this.panTo(r):(this.moveTo(r),this.dragging&&(this.dragging=!1,this.events.triggerEvent("moveend")))}}},panTo:function(e){if(this.panTween&&this.getExtent().scale(this.panRatio).containsLonLat(e)){var t=this.getCachedCenter();if(e.equals(t))return;var i=this.getPixelFromLonLat(t),n=this.getPixelFromLonLat(e),s={x:n.x-i.x,y:n.y-i.y},r={x:0,y:0};this.panTween.start({x:0,y:0},s,this.panDuration,{callbacks:{eachStep:OpenLayers.Function.bind(function(e){var t=e.x-r.x,i=e.y-r.y;this.moveByPx(t,i),r.x=Math.round(e.x),r.y=Math.round(e.y)},this),done:OpenLayers.Function.bind(function(t){this.moveTo(e),this.dragging=!1,this.events.triggerEvent("moveend")},this)}})}else this.setCenter(e)},setCenter:function(e,t,i,n){this.panTween&&this.panTween.stop(),this.zoomTween&&this.zoomTween.stop(),this.moveTo(e,t,{dragging:i,forceZoomChange:n})},moveByPx:function(e,t){var i=this.size.w/2,n=this.size.h/2,s=i+e,r=n+t,a=this.baseLayer.wrapDateLine,o=0,l=0;if(this.restrictedExtent&&(o=i,l=n,a=!1),e=a||s<=this.maxPx.x-o&&s>=this.minPx.x+o?Math.round(e):0,t=r<=this.maxPx.y-l&&r>=this.minPx.y+l?Math.round(t):0,e||t){this.dragging||(this.dragging=!0,this.events.triggerEvent("movestart")),this.center=null,e&&(this.layerContainerOriginPx.x-=e,this.minPx.x-=e,this.maxPx.x-=e),t&&(this.layerContainerOriginPx.y-=t,this.minPx.y-=t,this.maxPx.y-=t),this.applyTransform();var h,u,p;for(u=0,p=this.layers.length;u<p;++u)(h=this.layers[u]).visibility&&(h===this.baseLayer||h.inRange)&&(h.moveByPx(e,t),h.events.triggerEvent("move"));this.events.triggerEvent("move")}},adjustZoom:function(e){if(this.baseLayer&&this.baseLayer.wrapDateLine){var t=this.baseLayer.resolutions,i=this.getMaxExtent().getWidth()/this.size.w;if(this.getResolutionForZoom(e)>i)if(this.fractionalZoom)e=this.getZoomForResolution(i);else for(var n=0|e,s=t.length;n<s;++n)if(t[n]<=i){e=n;break}}return e},getMinZoom:function(){return this.adjustZoom(0)},moveTo:function(e,t,i){null==e||e instanceof OpenLayers.LonLat||(e=new OpenLayers.LonLat(e)),i||(i={}),null!=t&&(t=parseFloat(t),this.fractionalZoom||(t=Math.round(t)));var n=t;(t=this.adjustZoom(t))!==n&&(e=this.getCenter());var s=i.dragging||this.dragging,r=i.forceZoomChange;if(this.getCachedCenter()||this.isValidLonLat(e)||(e=this.maxExtent.getCenterLonLat(),this.center=e.clone()),null!=this.restrictedExtent){null==e&&(e=this.center),null==t&&(t=this.getZoom());var a=this.getResolutionForZoom(t),o=this.calculateBounds(e,a);if(!this.restrictedExtent.containsBounds(o)){var l=this.restrictedExtent.getCenterLonLat();o.getWidth()>this.restrictedExtent.getWidth()?e=new OpenLayers.LonLat(l.lon,e.lat):o.left<this.restrictedExtent.left?e=e.add(this.restrictedExtent.left-o.left,0):o.right>this.restrictedExtent.right&&(e=e.add(this.restrictedExtent.right-o.right,0)),o.getHeight()>this.restrictedExtent.getHeight()?e=new OpenLayers.LonLat(e.lon,l.lat):o.bottom<this.restrictedExtent.bottom?e=e.add(0,this.restrictedExtent.bottom-o.bottom):o.top>this.restrictedExtent.top&&(e=e.add(0,this.restrictedExtent.top-o.top))}}var h=r||this.isValidZoomLevel(t)&&t!=this.getZoom(),u=this.isValidLonLat(e)&&!e.equals(this.center);if(h||u||s){s||this.events.triggerEvent("movestart",{zoomChanged:h}),u&&(!h&&this.center&&this.centerLayerContainer(e),this.center=e.clone());var p=h?this.getResolutionForZoom(t):this.getResolution();if(h||null==this.layerContainerOrigin){this.layerContainerOrigin=this.getCachedCenter(),this.layerContainerOriginPx.x=0,this.layerContainerOriginPx.y=0,this.applyTransform();var c=this.getMaxExtent({restricted:!0}),d=c.getCenterLonLat(),f=this.center.lon-d.lon,m=d.lat-this.center.lat,y=Math.round(c.getWidth()/p),g=Math.round(c.getHeight()/p);this.minPx={x:(this.size.w-y)/2-f/p,y:(this.size.h-g)/2-m/p},this.maxPx={x:this.minPx.x+Math.round(c.getWidth()/p),y:this.minPx.y+Math.round(c.getHeight()/p)}}h&&(this.zoom=t,this.resolution=p);var v=this.getExtent();this.baseLayer.visibility&&(this.baseLayer.moveTo(v,h,i.dragging),i.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:h})),v=this.baseLayer.getExtent();for(b=this.layers.length-1;b>=0;--b){var L=this.layers[b];if(L!==this.baseLayer&&!L.isBaseLayer){var O=L.calculateInRange();L.inRange!=O&&(L.inRange=O,O||L.display(!1),this.events.triggerEvent("changelayer",{layer:L,property:"visibility"})),O&&L.visibility&&(L.moveTo(v,h,i.dragging),i.dragging||L.events.triggerEvent("moveend",{zoomChanged:h}))}}if(this.events.triggerEvent("move"),s||this.events.triggerEvent("moveend"),h){for(var b=0,w=this.popups.length;b<w;b++)this.popups[b].updatePosition();this.events.triggerEvent("zoomend")}}},centerLayerContainer:function(e){var t=this.getViewPortPxFromLonLat(this.layerContainerOrigin),i=this.getViewPortPxFromLonLat(e);if(null!=t&&null!=i){var n=this.layerContainerOriginPx.x,s=this.layerContainerOriginPx.y,r=Math.round(t.x-i.x),a=Math.round(t.y-i.y);this.applyTransform(this.layerContainerOriginPx.x=r,this.layerContainerOriginPx.y=a);var o=n-r,l=s-a;this.minPx.x-=o,this.maxPx.x-=o,this.minPx.y-=l,this.maxPx.y-=l}},isValidZoomLevel:function(e){return null!=e&&e>=0&&e<this.getNumZoomLevels()},isValidLonLat:function(e){var t=!1;if(null!=e){var i=this.getMaxExtent(),n=this.baseLayer.wrapDateLine&&i;t=i.containsLonLat(e,{worldBounds:n})}return t},getProjection:function(){var e=this.getProjectionObject();return e?e.getCode():null},getProjectionObject:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.projection),e},getMaxResolution:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.maxResolution),e},getMaxExtent:function(e){var t=null;return e&&e.restricted&&this.restrictedExtent?t=this.restrictedExtent:null!=this.baseLayer&&(t=this.baseLayer.maxExtent),t},getNumZoomLevels:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.numZoomLevels),e},getExtent:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.getExtent()),e},getResolution:function(){var e=null;return null!=this.baseLayer?e=this.baseLayer.getResolution():!0===this.allOverlays&&this.layers.length>0&&(e=this.layers[0].getResolution()),e},getUnits:function(){var e=null;return null!=this.baseLayer&&(e=this.baseLayer.units),e},getScale:function(){var e=null;if(null!=this.baseLayer){var t=this.getResolution(),i=this.baseLayer.units;e=OpenLayers.Util.getScaleFromResolution(t,i)}return e},getZoomForExtent:function(e,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForExtent(e,t)),i},getResolutionForZoom:function(e){var t=null;return this.baseLayer&&(t=this.baseLayer.getResolutionForZoom(e)),t},getZoomForResolution:function(e,t){var i=null;return null!=this.baseLayer&&(i=this.baseLayer.getZoomForResolution(e,t)),i},zoomTo:function(e,t){var i=this;if(i.isValidZoomLevel(e))if(i.baseLayer.wrapDateLine&&(e=i.adjustZoom(e)),i.zoomTween){var n={scale:1},s={scale:i.getResolution()/i.getResolutionForZoom(e)};if(i.zoomTween.playing&&i.zoomTween.duration<3*i.zoomDuration)i.zoomTween.finish={scale:i.zoomTween.finish.scale*s.scale};else{if(!t){var r=i.getSize();t={x:r.w/2,y:r.h/2}}i.zoomTween.start(n,s,i.zoomDuration,{minFrameRate:50,callbacks:{eachStep:function(e){var n=i.layerContainerOriginPx,s=e.scale,r=(s-1)*(n.x-t.x)|0,a=(s-1)*(n.y-t.y)|0;i.applyTransform(n.x+r,n.y+a,s)},done:function(e){i.applyTransform();var n=i.getResolution()/e.scale,s=i.getZoomForResolution(n,!0);i.moveTo(i.getZoomTargetCenter(t,n),s,!0)}}})}}else{var a=t?i.getZoomTargetCenter(t,i.getResolutionForZoom(e)):null;i.setCenter(a,e)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(e,t){e instanceof OpenLayers.Bounds||(e=new OpenLayers.Bounds(e));var i=e.getCenterLonLat();if(this.baseLayer.wrapDateLine){var n=this.getMaxExtent();for(e=e.clone();e.right<e.left;)e.right+=n.getWidth();i=e.getCenterLonLat().wrapDateLine(n)}this.setCenter(i,this.getZoomForExtent(e,t))},zoomToMaxExtent:function(e){var t=!e||e.restricted,i=this.getMaxExtent({restricted:t});this.zoomToExtent(i)},zoomToScale:function(e,t){var i=OpenLayers.Util.getResolutionFromScale(e,this.baseLayer.units),n=this.size.w*i/2,s=this.size.h*i/2,r=this.getCachedCenter(),a=new OpenLayers.Bounds(r.lon-n,r.lat-s,r.lon+n,r.lat+s);this.zoomToExtent(a,t)},getLonLatFromViewPortPx:function(e){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getLonLatFromViewPortPx(e)),t},getViewPortPxFromLonLat:function(e){var t=null;return null!=this.baseLayer&&(t=this.baseLayer.getViewPortPxFromLonLat(e)),t},getZoomTargetCenter:function(e,t){var i=null,n=this.getSize(),s=n.w/2-e.x,r=e.y-n.h/2,a=this.getLonLatFromPixel(e);return a&&(i=new OpenLayers.LonLat(a.lon+s*t,a.lat+r*t)),i},getLonLatFromPixel:function(e){return this.getLonLatFromViewPortPx(e)},getPixelFromLonLat:function(e){var t=this.getViewPortPxFromLonLat(e);return t.x=Math.round(t.x),t.y=Math.round(t.y),t},getGeodesicPixelSize:function(e){var t=e?this.getLonLatFromPixel(e):this.getCachedCenter()||new OpenLayers.LonLat(0,0),i=this.getResolution(),n=t.add(-i/2,0),s=t.add(i/2,0),r=t.add(0,-i/2),a=t.add(0,i/2),o=new OpenLayers.Projection("EPSG:4326"),l=this.getProjectionObject()||o;return l.equals(o)||(n.transform(l,o),s.transform(l,o),r.transform(l,o),a.transform(l,o)),new OpenLayers.Size(OpenLayers.Util.distVincenty(n,s),OpenLayers.Util.distVincenty(r,a))},getViewPortPxFromLayerPx:function(e){var t=null;if(null!=e){var i=this.layerContainerOriginPx.x,n=this.layerContainerOriginPx.y;t=e.add(i,n)}return t},getLayerPxFromViewPortPx:function(e){var t=null;if(null!=e){var i=-this.layerContainerOriginPx.x,n=-this.layerContainerOriginPx.y;t=e.add(i,n),(isNaN(t.x)||isNaN(t.y))&&(t=null)}return t},getLonLatFromLayerPx:function(e){return e=this.getViewPortPxFromLayerPx(e),this.getLonLatFromViewPortPx(e)},getLayerPxFromLonLat:function(e){var t=this.getPixelFromLonLat(e);return this.getLayerPxFromViewPortPx(t)},applyTransform:function(e,t,i){i=i||1;var n=this.layerContainerOriginPx,s=1!==i;e=e||n.x,t=t||n.y;var r=this.layerContainerDiv.style,a=this.applyTransform.transform,o=this.applyTransform.template;if(void 0===a&&(a=OpenLayers.Util.vendorPrefix.style("transform"),this.applyTransform.transform=a,a)){var l=OpenLayers.Element.getStyle(this.viewPortDiv,OpenLayers.Util.vendorPrefix.css("transform"));l&&"none"===l||(o=["translate3d(",",0) ","scale3d(",",1)"],r[a]=[o[0],"0,0",o[1]].join("")),o&&~r[a].indexOf(o[0])||(o=["translate(",") ","scale(",")"]),this.applyTransform.template=o}null===a||"translate3d("!==o[0]&&!0!==s?(r.left=e+"px",r.top=t+"px",null!==a&&(r[a]="")):(!0===s&&"translate("===o[0]&&(e-=n.x,t-=n.y,r.left=n.x+"px",r.top=n.y+"px"),r[a]=[o[0],e,"px,",t,"px",o[1],o[2],i,",",i,o[3]].join(""))},CLASS_NAME:"OpenLayers.Map"}),OpenLayers.Map.TILE_WIDTH=256,OpenLayers.Map.TILE_HEIGHT=256,OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:!1,evt:null,touch:!1,initialize:function(e,t,i){OpenLayers.Util.extend(this,i),this.control=e,this.callbacks=t;var n=this.map||e.map;n&&this.setMap(n),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(e){this.map=e},checkModifiers:function(e){return null==this.keyMask||((e.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(e.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(e.altKey?OpenLayers.Handler.MOD_ALT:0)|(e.metaKey?OpenLayers.Handler.MOD_META:0))==this.keyMask},activate:function(){if(this.active)return!1;for(var e=OpenLayers.Events.prototype.BROWSER_EVENTS,t=0,i=e.length;t<i;t++)this[e[t]]&&this.register(e[t],this[e[t]]);return this.active=!0,!0},deactivate:function(){if(!this.active)return!1;for(var e=OpenLayers.Events.prototype.BROWSER_EVENTS,t=0,i=e.length;t<i;t++)this[e[t]]&&this.unregister(e[t],this[e[t]]);return this.touch=!1,this.active=!1,!0},startTouch:function(){if(!this.touch){this.touch=!0;for(var e=["mousedown","mouseup","mousemove","click","dblclick","mouseout"],t=0,i=e.length;t<i;t++)this[e[t]]&&this.unregister(e[t],this[e[t]])}},callback:function(e,t){e&&this.callbacks[e]&&this.callbacks[e].apply(this.control,t)},register:function(e,t){this.map.events.registerPriority(e,this,t),this.map.events.registerPriority(e,this,this.setEvent)},unregister:function(e,t){this.map.events.unregister(e,this,t),this.map.events.unregister(e,this,this.setEvent)},setEvent:function(e){return this.evt=e,!0},destroy:function(){this.deactivate(),this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"}),OpenLayers.Handler.MOD_NONE=0,OpenLayers.Handler.MOD_SHIFT=1,OpenLayers.Handler.MOD_CTRL=2,OpenLayers.Handler.MOD_ALT=4,OpenLayers.Handler.MOD_META=8,OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:!0,double:!1,pixelTolerance:0,dblclickTolerance:13,stopSingle:!1,stopDouble:!1,timerId:null,down:null,last:null,first:null,rightclickTimerId:null,touchstart:function(e){return this.startTouch(),this.down=this.getEventInfo(e),this.last=this.getEventInfo(e),!0},touchmove:function(e){return this.last=this.getEventInfo(e),!0},touchend:function(e){return this.down&&(e.xy=this.last.xy,e.lastTouches=this.last.touches,this.handleSingle(e),this.down=null),!0},mousedown:function(e){return this.down=this.getEventInfo(e),this.last=this.getEventInfo(e),!0},mouseup:function(e){var t=!0;return this.checkModifiers(e)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(e)&&(t=this.rightclick(e)),t},rightclick:function(e){if(this.passesTolerance(e)){if(null!=this.rightclickTimerId)return this.clearTimer(),this.callback("dblrightclick",[e]),!this.stopDouble;var t=this.double?OpenLayers.Util.extend({},e):this.callback("rightclick",[e]),i=OpenLayers.Function.bind(this.delayedRightCall,this,t);this.rightclickTimerId=window.setTimeout(i,this.delay)}return!this.stopSingle},delayedRightCall:function(e){this.rightclickTimerId=null,e&&this.callback("rightclick",[e])},click:function(e){return this.last||(this.last=this.getEventInfo(e)),this.handleSingle(e),!this.stopSingle},dblclick:function(e){return this.handleDouble(e),!this.stopDouble},handleDouble:function(e){this.passesDblclickTolerance(e)&&(this.double&&this.callback("dblclick",[e]),this.clearTimer())},handleSingle:function(e){if(this.passesTolerance(e))if(null!=this.timerId)this.last.touches&&1===this.last.touches.length&&(this.double&&OpenLayers.Event.preventDefault(e),this.handleDouble(e)),this.last.touches&&2===this.last.touches.length||this.clearTimer();else{this.first=this.getEventInfo(e);var t=this.single?OpenLayers.Util.extend({},e):null;this.queuePotentialClick(t)}},queuePotentialClick:function(e){this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,e),this.delay)},passesTolerance:function(e){var t=!0;if(null!=this.pixelTolerance&&this.down&&this.down.xy&&(t=this.pixelTolerance>=this.down.xy.distanceTo(e.xy))&&this.touch&&this.down.touches.length===this.last.touches.length)for(var i=0,n=this.down.touches.length;i<n;++i)if(this.getTouchDistance(this.down.touches[i],this.last.touches[i])>this.pixelTolerance){t=!1;break}return t},getTouchDistance:function(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))},passesDblclickTolerance:function(e){var t=!0;return this.down&&this.first&&(t=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance),t},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null),null!=this.rightclickTimerId&&(window.clearTimeout(this.rightclickTimerId),this.rightclickTimerId=null)},delayedCall:function(e){this.timerId=null,e&&this.callback("click",[e])},getEventInfo:function(e){var t;if(e.touches){var i=e.touches.length;t=new Array(i);for(var n,s=0;s<i;s++)n=e.touches[s],t[s]={clientX:n.olClientX,clientY:n.olClientY}}return{xy:e.xy,touches:t}},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),this.down=null,this.first=null,this.last=null,e=!0),e},CLASS_NAME:"OpenLayers.Handler.Click"}),OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!0,dragging:!1,last:null,start:null,lastMoveEvt:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:!1,documentEvents:null,initialize:function(e,t,i){if(OpenLayers.Handler.prototype.initialize.apply(this,arguments),!0===this.documentDrag){var n=this;this._docMove=function(e){n.mousemove({xy:{x:e.clientX,y:e.clientY},element:document})},this._docUp=function(e){n.mouseup({xy:{x:e.clientX,y:e.clientY}})}}},dragstart:function(e){var t=!0;return this.dragging=!1,this.checkModifiers(e)&&(OpenLayers.Event.isLeftClick(e)||OpenLayers.Event.isSingleTouch(e))?(this.started=!0,this.start=e.xy,this.last=e.xy,OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown"),this.down(e),this.callback("down",[e.xy]),OpenLayers.Event.preventDefault(e),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(e){return this.lastMoveEvt=e,!this.started||this.timeoutId||e.xy.x==this.last.x&&e.xy.y==this.last.y||(!0===this.documentDrag&&this.documentEvents&&(e.element===document?(this.adjustXY(e),this.setEvent(e)):this.removeDocumentEvents()),this.interval>0&&(this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)),this.dragging=!0,this.move(e),this.callback("move",[e.xy]),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart,document.onselectstart=OpenLayers.Function.False),this.last=e.xy),!0},dragend:function(e){if(this.started){!0===this.documentDrag&&this.documentEvents&&(this.adjustXY(e),this.removeDocumentEvents());var t=this.start!=this.last;this.started=!1,this.dragging=!1,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown"),this.up(e),this.callback("up",[e.xy]),t&&this.callback("done",[e.xy]),document.onselectstart=this.oldOnselectstart}return!0},down:function(e){},move:function(e){},up:function(e){},out:function(e){},mousedown:function(e){return this.dragstart(e)},touchstart:function(e){return this.startTouch(),this.dragstart(e)},mousemove:function(e){return this.dragmove(e)},touchmove:function(e){return this.dragmove(e)},removeTimeout:function(){this.timeoutId=null,this.dragging&&this.mousemove(this.lastMoveEvt)},mouseup:function(e){return this.dragend(e)},touchend:function(e){return e.xy=this.last,this.dragend(e)},mouseout:function(e){if(this.started&&OpenLayers.Util.mouseLeft(e,this.map.viewPortDiv))if(!0===this.documentDrag)this.addDocumentEvents();else{var t=this.start!=this.last;this.started=!1,this.dragging=!1,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown"),this.out(e),this.callback("out",[]),t&&this.callback("done",[e.xy]),document.onselectstart&&(document.onselectstart=this.oldOnselectstart)}return!0},click:function(e){return this.start==this.last},activate:function(){var e=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.dragging=!1,e=!0),e},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.started=!1,this.dragging=!1,this.start=null,this.last=null,e=!0,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")),e},adjustXY:function(e){var t=OpenLayers.Util.pagePosition(this.map.viewPortDiv);e.xy.x-=t[0],e.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.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:{w:180,h:90},layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:!1,handlers:null,resolutionFactor:1,maximized:!1,maximizeTitle:"",minimizeTitle:"",initialize:function(e){this.layers=[],this.handlers={},OpenLayers.Control.prototype.initialize.apply(this,[e])},destroy:function(){this.mapDiv&&(this.handlers.click&&this.handlers.click.destroy(),this.handlers.drag&&this.handlers.drag.destroy(),this.ovmap&&this.ovmap.viewPortDiv.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&&(this.div.removeChild(this.maximizeDiv),this.maximizeDiv=null),this.minimizeDiv&&(this.div.removeChild(this.minimizeDiv),this.minimizeDiv=null),this.map.events.un({buttonclick:this.onButtonClick,moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments))},draw:function(){if(OpenLayers.Control.prototype.draw.apply(this,arguments),0===this.layers.length){if(!this.map.baseLayer)return this.map.events.register("changebaselayer",this,this.baseLayerDraw),this.div;var e=this.map.baseLayer.clone();this.layers=[e]}if(this.element=document.createElement("div"),this.element.className=this.displayClass+"Element",this.element.style.display="none",this.mapDiv=document.createElement("div"),this.mapDiv.style.width=this.size.w+"px",this.mapDiv.style.height=this.size.h+"px",this.mapDiv.style.position="relative",this.mapDiv.style.overflow="hidden",this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap"),this.extentRectangle=document.createElement("div"),this.extentRectangle.style.position="absolute",this.extentRectangle.style.zIndex=1e3,this.extentRectangle.className=this.displayClass+"ExtentRectangle",this.element.appendChild(this.mapDiv),this.div.appendChild(this.element),this.outsideViewport)this.element.style.display="";else{this.div.className+=" "+this.displayClass+"Container";t=OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,null,t,"absolute"),this.maximizeDiv.style.display="none",this.maximizeDiv.className=this.displayClass+"MaximizeButton olButton",this.maximizeTitle&&(this.maximizeDiv.title=this.maximizeTitle),this.div.appendChild(this.maximizeDiv);var t=OpenLayers.Util.getImageLocation("layer-switcher-minimize.png");this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,null,t,"absolute"),this.minimizeDiv.style.display="none",this.minimizeDiv.className=this.displayClass+"MinimizeButton olButton",this.minimizeTitle&&(this.minimizeDiv.title=this.minimizeTitle),this.div.appendChild(this.minimizeDiv),this.minimizeControl()}return this.map.getExtent()&&this.update(),this.map.events.on({buttonclick:this.onButtonClick,moveend:this.update,scope:this}),this.maximized&&this.maximizeControl(),this.div},baseLayerDraw:function(){this.draw(),this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(e){var t=this.handlers.drag.last.x-e.x,i=this.handlers.drag.last.y-e.y;if(0!=t||0!=i){var n=this.rectPxBounds.top,s=this.rectPxBounds.left,r=Math.abs(this.rectPxBounds.getHeight()),a=this.rectPxBounds.getWidth(),o=Math.max(0,n-i);o=Math.min(o,this.ovmap.size.h-this.hComp-r);var l=Math.max(0,s-t);l=Math.min(l,this.ovmap.size.w-this.wComp-a),this.setRectPxBounds(new OpenLayers.Bounds(l,o+r,l+a,o))}},mapDivClick:function(e){var t=this.rectPxBounds.getCenterPixel(),i=e.xy.x-t.x,n=e.xy.y-t.y,s=this.rectPxBounds.top,r=this.rectPxBounds.left,a=Math.abs(this.rectPxBounds.getHeight()),o=this.rectPxBounds.getWidth(),l=Math.max(0,s+n);l=Math.min(l,this.ovmap.size.h-a);var h=Math.max(0,r+i);h=Math.min(h,this.ovmap.size.w-o),this.setRectPxBounds(new OpenLayers.Bounds(h,l+a,h+o,l)),this.updateMapToRect()},onButtonClick:function(e){e.buttonElement===this.minimizeDiv?this.minimizeControl():e.buttonElement===this.maximizeDiv&&this.maximizeControl()},maximizeControl:function(e){this.element.style.display="",this.showToggle(!1),null!=e&&OpenLayers.Event.stop(e)},minimizeControl:function(e){this.element.style.display="none",this.showToggle(!0),null!=e&&OpenLayers.Event.stop(e)},showToggle:function(e){this.maximizeDiv&&(this.maximizeDiv.style.display=e?"":"none"),this.minimizeDiv&&(this.minimizeDiv.style.display=e?"none":"")},update:function(){null==this.ovmap&&this.createMap(),!this.autoPan&&this.isSuitableOverview()||this.updateOverview(),this.updateRectToMap()},isSuitableOverview:function(){var e=this.map.getExtent(),t=this.map.getMaxExtent(),i=new OpenLayers.Bounds(Math.max(e.left,t.left),Math.max(e.bottom,t.bottom),Math.min(e.right,t.right),Math.min(e.top,t.top));this.ovmap.getProjection()!=this.map.getProjection()&&(i=i.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()));var n=this.ovmap.getResolution()/this.map.getResolution();return n>this.minRatio&&n<=this.maxRatio&&this.ovmap.getExtent().containsBounds(i)},updateOverview:function(){var e=this.map.getResolution(),t=this.ovmap.getResolution(),i=t/e;i>this.maxRatio?t=this.minRatio*e:i<=this.minRatio&&(t=this.maxRatio*e);var n;this.ovmap.getProjection()!=this.map.getProjection()?(n=this.map.center.clone()).transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()):n=this.map.center,this.ovmap.setCenter(n,this.ovmap.getZoomForResolution(t*this.resolutionFactor)),this.updateRectToMap()},createMap:function(){var e=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:!1},this.mapOptions);if(this.ovmap=new OpenLayers.Map(this.mapDiv,e),this.ovmap.viewPortDiv.appendChild(this.extentRectangle),OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy),this.ovmap.addLayers(this.layers),this.ovmap.zoomToMaxExtent(),this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width")),this.wComp=this.wComp?this.wComp:2,this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width")),this.hComp=this.hComp?this.hComp:2,this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap}),this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:!0,double:!1,stopSingle:!0,stopDouble:!0,pixelTolerance:1,map:this.ovmap}),this.handlers.click.activate(),this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,!0),this.rectEvents.register("mouseover",this,function(e){this.handlers.drag.active||this.map.dragging||this.handlers.drag.activate()}),this.rectEvents.register("mouseout",this,function(e){this.handlers.drag.dragging||this.handlers.drag.deactivate()}),this.ovmap.getProjection()!=this.map.getProjection()){var t=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,i=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=t&&i?OpenLayers.INCHES_PER_UNIT[t]/OpenLayers.INCHES_PER_UNIT[i]:1}},updateRectToMap:function(){var e;e=this.ovmap.getProjection()!=this.map.getProjection()?this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()):this.map.getExtent();var t=this.getRectBoundsFromMapBounds(e);t&&this.setRectPxBounds(t)},updateMapToRect:function(){var e=this.getMapBoundsFromRectBounds(this.rectPxBounds);this.ovmap.getProjection()!=this.map.getProjection()&&(e=e.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())),this.map.panTo(e.getCenterLonLat())},setRectPxBounds:function(e){var t=Math.max(e.top,0),i=Math.max(e.left,0),n=Math.min(e.top+Math.abs(e.getHeight()),this.ovmap.size.h-this.hComp),s=Math.min(e.left+e.getWidth(),this.ovmap.size.w-this.wComp),r=Math.max(s-i,0),a=Math.max(n-t,0);if(r<this.minRectSize||a<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var o=i+r/2-this.minRectSize/2,l=t+a/2-this.minRectSize/2;this.extentRectangle.style.top=Math.round(l)+"px",this.extentRectangle.style.left=Math.round(o)+"px",this.extentRectangle.style.height=this.minRectSize+"px",this.extentRectangle.style.width=this.minRectSize+"px"}else this.extentRectangle.className=this.displayClass+"ExtentRectangle",this.extentRectangle.style.top=Math.round(t)+"px",this.extentRectangle.style.left=Math.round(i)+"px",this.extentRectangle.style.height=Math.round(a)+"px",this.extentRectangle.style.width=Math.round(r)+"px";this.rectPxBounds=new OpenLayers.Bounds(Math.round(i),Math.round(n),Math.round(s),Math.round(t))},getRectBoundsFromMapBounds:function(e){var t=this.getOverviewPxFromLonLat({lon:e.left,lat:e.bottom}),i=this.getOverviewPxFromLonLat({lon:e.right,lat:e.top}),n=null;return t&&i&&(n=new OpenLayers.Bounds(t.x,t.y,i.x,i.y)),n},getMapBoundsFromRectBounds:function(e){var t=this.getLonLatFromOverviewPx({x:e.left,y:e.bottom}),i=this.getLonLatFromOverviewPx({x:e.right,y:e.top});return new OpenLayers.Bounds(t.lon,t.lat,i.lon,i.lat)},getLonLatFromOverviewPx:function(e){var t=this.ovmap.size,i=this.ovmap.getResolution(),n=this.ovmap.getExtent().getCenterLonLat(),s=e.x-t.w/2,r=e.y-t.h/2;return{lon:n.lon+s*i,lat:n.lat-r*i}},getOverviewPxFromLonLat:function(e){var t=this.ovmap.getResolution(),i=this.ovmap.getExtent();if(i)return{x:Math.round(1/t*(e.lon-i.left)),y:Math.round(1/t*(i.top-e.lat))}},CLASS_NAME:"OpenLayers.Control.OverviewMap"}),OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:1,alwaysInRange:null,RESOLUTION_PROPERTIES:["scales","resolutions","maxScale","minScale","maxResolution","minResolution","numZoomLevels","maxZoomLevel"],events:null,map:null,isBaseLayer:!1,alpha:!1,displayInLayerSwitcher:!0,visibility:!0,attribution:null,inRange:!1,imageSize:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:!1,wrapDateLine:!1,metadata:null,initialize:function(e,t){this.metadata={},t=OpenLayers.Util.extend({},t),null!=this.alwaysInRange&&(t.alwaysInRange=this.alwaysInRange),this.addOptions(t),this.name=e,null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"),this.div=OpenLayers.Util.createDiv(this.id),this.div.style.width="100%",this.div.style.height="100%",this.div.dir="ltr",this.events=new OpenLayers.Events(this,this.div),this.eventListeners instanceof Object&&this.events.on(this.eventListeners))},destroy:function(e){null==e&&(e=!0),null!=this.map&&this.map.removeLayer(this,e),this.projection=null,this.map=null,this.name=null,this.div=null,this.options=null,this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy()),this.eventListeners=null,this.events=null},clone:function(e){return null==e&&(e=new OpenLayers.Layer(this.name,this.getOptions())),OpenLayers.Util.applyDefaults(e,this),e.map=null,e},getOptions:function(){var e={};for(var t in this.options)e[t]=this[t];return e},setName:function(e){e!=this.name&&(this.name=e,null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"name"}))},addOptions:function(e,t){if(null==this.options&&(this.options={}),e&&("string"==typeof e.projection&&(e.projection=new OpenLayers.Projection(e.projection)),e.projection&&OpenLayers.Util.applyDefaults(e,OpenLayers.Projection.defaults[e.projection.getCode()]),!e.maxExtent||e.maxExtent instanceof OpenLayers.Bounds||(e.maxExtent=new OpenLayers.Bounds(e.maxExtent)),!e.minExtent||e.minExtent instanceof OpenLayers.Bounds||(e.minExtent=new OpenLayers.Bounds(e.minExtent))),OpenLayers.Util.extend(this.options,e),OpenLayers.Util.extend(this,e),this.projection&&this.projection.getUnits()&&(this.units=this.projection.getUnits()),this.map){var i=this.map.getResolution(),n=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]);for(var s in e)if(e.hasOwnProperty(s)&&OpenLayers.Util.indexOf(n,s)>=0){this.initResolutions(),t&&this.map.baseLayer===this&&(this.map.setCenter(this.map.getCenter(),this.map.getZoomForResolution(i),!1,!0),this.map.events.triggerEvent("changebaselayer",{layer:this}));break}}},onMapResize:function(){},redraw:function(){var e=!1;if(this.map){this.inRange=this.calculateInRange();var t=this.getExtent();if(t&&this.inRange&&this.visibility){this.moveTo(t,!0,!1),this.events.triggerEvent("moveend",{zoomChanged:!0}),e=!0}}return e},moveTo:function(e,t,i){var n=this.visibility;this.isBaseLayer||(n=n&&this.inRange),this.display(n)},moveByPx:function(e,t){},setMap:function(e){if(null==this.map){if(this.map=e,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(e){},getImageSize:function(e){return this.imageSize||this.tileSize},setTileSize:function(e){var t=e||(this.tileSize?this.tileSize:this.map.getTileSize());this.tileSize=t,this.gutter&&(this.imageSize=new OpenLayers.Size(t.w+2*this.gutter,t.h+2*this.gutter))},getVisibility:function(){return this.visibility},setVisibility:function(e){e!=this.visibility&&(this.visibility=e,this.display(e),this.redraw(),null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"}),this.events.triggerEvent("visibilitychanged"))},display:function(e){e!=("none"!=this.div.style.display)&&(this.div.style.display=e&&this.calculateInRange()?"block":"none")},calculateInRange:function(){var e=!1;if(this.alwaysInRange)e=!0;else if(this.map){var t=this.map.getResolution();e=t>=this.minResolution&&t<=this.maxResolution}return e},setIsBaseLayer:function(e){e!=this.isBaseLayer&&(this.isBaseLayer=e,null!=this.map&&this.map.events.triggerEvent("changebaselayer",{layer:this}))},initResolutions:function(){var e,t,i,n={},s=!0;for(e=0,t=this.RESOLUTION_PROPERTIES.length;e<t;e++)n[i=this.RESOLUTION_PROPERTIES[e]]=this.options[i],s&&this.options[i]&&(s=!1);if(null==this.options.alwaysInRange&&(this.alwaysInRange=s),null==n.resolutions&&(n.resolutions=this.resolutionsFromScales(n.scales)),null==n.resolutions&&(n.resolutions=this.calculateResolutions(n)),null==n.resolutions){for(e=0,t=this.RESOLUTION_PROPERTIES.length;e<t;e++)n[i=this.RESOLUTION_PROPERTIES[e]]=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))}var r;this.options.maxResolution&&"auto"!==this.options.maxResolution&&(r=this.options.maxResolution),this.options.minScale&&(r=OpenLayers.Util.getResolutionFromScale(this.options.minScale,this.units));var a;if(this.options.minResolution&&"auto"!==this.options.minResolution&&(a=this.options.minResolution),this.options.maxScale&&(a=OpenLayers.Util.getResolutionFromScale(this.options.maxScale,this.units)),n.resolutions&&(n.resolutions.sort(function(e,t){return t-e}),r||(r=n.resolutions[0]),!a)){var o=n.resolutions.length-1;a=n.resolutions[o]}if(this.resolutions=n.resolutions,this.resolutions){for(t=this.resolutions.length,this.scales=new Array(t),e=0;e<t;e++)this.scales[e]=OpenLayers.Util.getScaleFromResolution(this.resolutions[e],this.units);this.numZoomLevels=t}this.minResolution=a,a&&(this.maxScale=OpenLayers.Util.getScaleFromResolution(a,this.units)),this.maxResolution=r,r&&(this.minScale=OpenLayers.Util.getScaleFromResolution(r,this.units))},resolutionsFromScales:function(e){if(null!=e){var t,i,n;for(n=e.length,t=new Array(n),i=0;i<n;i++)t[i]=OpenLayers.Util.getResolutionFromScale(e[i],this.units);return t}},calculateResolutions:function(e){var t,i,n,s=e.maxResolution;null!=e.minScale?s=OpenLayers.Util.getResolutionFromScale(e.minScale,this.units):"auto"==s&&null!=this.maxExtent&&(t=this.map.getSize(),i=this.maxExtent.getWidth()/t.w,n=this.maxExtent.getHeight()/t.h,s=Math.max(i,n));var r=e.minResolution;if(null!=e.maxScale?r=OpenLayers.Util.getResolutionFromScale(e.maxScale,this.units):"auto"==e.minResolution&&null!=this.minExtent&&(t=this.map.getSize(),i=this.minExtent.getWidth()/t.w,n=this.minExtent.getHeight()/t.h,r=Math.max(i,n)),"number"!=typeof s&&"number"!=typeof r&&null!=this.maxExtent){var a=this.map.getTileSize();s=Math.max(this.maxExtent.getWidth()/a.w,this.maxExtent.getHeight()/a.h)}var o=e.maxZoomLevel,l=e.numZoomLevels;if("number"==typeof r&&"number"==typeof s&&void 0===l){var h=s/r;l=Math.floor(Math.log(h)/Math.log(2))+1}else void 0===l&&null!=o&&(l=o+1);if(!("number"!=typeof l||l<=0||"number"!=typeof s&&"number"!=typeof r)){var u=new Array(l),p=2;"number"==typeof r&&"number"==typeof s&&(p=Math.pow(s/r,1/(l-1)));var c;if("number"==typeof s)for(c=0;c<l;c++)u[c]=s/Math.pow(p,c);else for(c=0;c<l;c++)u[l-1-c]=r*Math.pow(p,c);return u}},getResolution:function(){var e=this.map.getZoom();return this.getResolutionForZoom(e)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(e,t){var i=this.map.getSize(),n=Math.max(e.getWidth()/i.w,e.getHeight()/i.h);return this.getZoomForResolution(n,t)},getDataExtent:function(){},getResolutionForZoom:function(e){e=Math.max(0,Math.min(e,this.resolutions.length-1));var t;if(this.map.fractionalZoom){var i=Math.floor(e),n=Math.ceil(e);t=this.resolutions[i]-(e-i)*(this.resolutions[i]-this.resolutions[n])}else t=this.resolutions[Math.round(e)];return t},getZoomForResolution:function(e,t){var i,n,s;if(this.map.fractionalZoom){var r,a=0,o=this.resolutions.length-1,l=this.resolutions[a],h=this.resolutions[o];for(n=0,s=this.resolutions.length;n<s;++n)if((r=this.resolutions[n])>=e&&(l=r,a=n),r<=e){h=r,o=n;break}var u=l-h;i=u>0?a+(l-e)/u:a}else{var p,c=Number.POSITIVE_INFINITY;for(n=0,s=this.resolutions.length;n<s;n++)if(t){if((p=Math.abs(this.resolutions[n]-e))>c)break;c=p}else if(this.resolutions[n]<e)break;i=Math.max(0,n-1)}return i},getLonLatFromViewPortPx:function(e){var t=null,i=this.map;if(null!=e&&i.minPx){var n=i.getResolution(),s=i.getMaxExtent({restricted:!0}),r=(e.x-i.minPx.x)*n+s.left,a=(i.minPx.y-e.y)*n+s.top;t=new OpenLayers.LonLat(r,a),this.wrapDateLine&&(t=t.wrapDateLine(this.maxExtent))}return t},getViewPortPxFromLonLat:function(e,t){var i=null;if(null!=e){t=t||this.map.getResolution();var n=this.map.calculateBounds(null,t);i=new OpenLayers.Pixel(1/t*(e.lon-n.left),1/t*(n.top-e.lat))}return i},setOpacity:function(e){if(e!=this.opacity){this.opacity=e;for(var t=this.div.childNodes,i=0,n=t.length;i<n;++i){var s=t[i].firstChild||t[i],r=t[i].lastChild;r&&"iframe"===r.nodeName.toLowerCase()&&(s=r.parentNode),OpenLayers.Util.modifyDOMElement(s,null,null,null,null,null,null,e)}null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(e){this.div.style.zIndex=e},adjustBounds:function(e){if(this.gutter){var t=this.gutter*this.map.getResolution();e=new OpenLayers.Bounds(e.left-t,e.bottom-t,e.right+t,e.top+t)}if(this.wrapDateLine){var i={rightTolerance:this.getResolution(),leftTolerance:this.getResolution()};e=e.wrapDateLine(this.maxExtent,i)}return e},CLASS_NAME:"OpenLayers.Layer"}),OpenLayers.Layer.SphericalMercator={getExtent:function(){return this.sphericalMercator?this.map.calculateBounds():OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)},getLonLatFromViewPortPx:function(e){return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this,arguments)},getViewPortPxFromLonLat:function(e){return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this,arguments)},initMercatorParameters:function(){this.RESOLUTIONS=[];for(var e=0;e<=this.MAX_ZOOM_LEVEL;++e)this.RESOLUTIONS[e]=156543.03390625/Math.pow(2,e);this.units="m",this.projection=this.projection||"EPSG:900913"},forwardMercator:function(){var e=new OpenLayers.Projection("EPSG:4326"),t=new OpenLayers.Projection("EPSG:900913");return function(i,n){var s=OpenLayers.Projection.transform({x:i,y:n},e,t);return new OpenLayers.LonLat(s.x,s.y)}}(),inverseMercator:function(){var e=new OpenLayers.Projection("EPSG:4326"),t=new OpenLayers.Projection("EPSG:900913");return function(i,n){var s=OpenLayers.Projection.transform({x:i,y:n},t,e);return new OpenLayers.LonLat(s.x,s.y)}}()},OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:!0,isBaseLayer:!0,isFixed:!0,pane:null,mapObject:null,initialize:function(e,t){OpenLayers.Layer.prototype.initialize.apply(this,arguments),null==this.pane&&(this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane"))},destroy:function(){this.mapObject=null,this.pane=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Layer.prototype.setMap.apply(this,arguments),this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1,this.pane.style.display=this.div.style.display,this.pane.style.width="100%",this.pane.style.height="100%","msie"==OpenLayers.BROWSER_NAME&&(this.pane.style.background="url("+OpenLayers.Util.getImageLocation("blank.gif")+")"),this.isFixed?this.map.viewPortDiv.appendChild(this.pane):this.map.layerContainerDiv.appendChild(this.pane),this.loadMapObject(),null==this.mapObject&&this.loadWarningMessage()},removeMap:function(e){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 e=this.map.getSize(),t=Math.min(e.w,300),i=Math.min(e.h,200),n=new OpenLayers.Size(t,i),s=new OpenLayers.Pixel(e.w/2,e.h/2).add(-n.w/2,-n.h/2),r=OpenLayers.Util.createDiv(this.name+"_warning",s,n,null,null,null,"auto");r.style.padding="7px",r.style.backgroundColor="yellow",r.innerHTML=this.getWarningHTML(),this.div.appendChild(r)},getWarningHTML:function(){return""},display:function(e){OpenLayers.Layer.prototype.display.apply(this,arguments),this.pane.style.display=this.div.style.display},setZIndex:function(e){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments),this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveByPx:function(e,t){OpenLayers.Layer.prototype.moveByPx.apply(this,arguments),this.dragPanMapObject?this.dragPanMapObject(e,-t):this.moveTo(this.map.getCachedCenter())},moveTo:function(e,t,i){if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),null!=this.mapObject){var n=this.map.getCenter(),s=this.map.getZoom();if(null!=n){var r=this.getMapObjectCenter(),a=this.getOLLonLatFromMapObjectLonLat(r),o=this.getMapObjectZoom(),l=this.getOLZoomFromMapObjectZoom(o);if(!n.equals(a)||s!=l)if(!t&&a&&this.dragPanMapObject&&this.smoothDragPan){var h=this.map.getViewPortPxFromLonLat(a),u=this.map.getViewPortPxFromLonLat(n);this.dragPanMapObject(u.x-h.x,h.y-u.y)}else{var p=this.getMapObjectLonLatFromOLLonLat(n),c=this.getMapObjectZoomFromOLZoom(s);this.setMapObjectCenter(p,c,i)}}}},getLonLatFromViewPortPx:function(e){var t=null;if(null!=this.mapObject&&null!=this.getMapObjectCenter()){var i=this.getMapObjectPixelFromOLPixel(e),n=this.getMapObjectLonLatFromMapObjectPixel(i);t=this.getOLLonLatFromMapObjectLonLat(n)}return t},getViewPortPxFromLonLat:function(e){var t=null;if(null!=this.mapObject&&null!=this.getMapObjectCenter()){var i=this.getMapObjectLonLatFromOLLonLat(e),n=this.getMapObjectPixelFromMapObjectLonLat(i);t=this.getOLPixelFromMapObjectPixel(n)}return t},getOLLonLatFromMapObjectLonLat:function(e){var t=null;if(null!=e){var i=this.getLongitudeFromMapObjectLonLat(e),n=this.getLatitudeFromMapObjectLonLat(e);t=new OpenLayers.LonLat(i,n)}return t},getMapObjectLonLatFromOLLonLat:function(e){var t=null;return null!=e&&(t=this.getMapObjectLonLatFromLonLat(e.lon,e.lat)),t},getOLPixelFromMapObjectPixel:function(e){var t=null;if(null!=e){var i=this.getXFromMapObjectPixel(e),n=this.getYFromMapObjectPixel(e);t=new OpenLayers.Pixel(i,n)}return t},getMapObjectPixelFromOLPixel:function(e){var t=null;return null!=e&&(t=this.getMapObjectPixelFromXY(e.x,e.y)),t},CLASS_NAME:"OpenLayers.Layer.EventPane"}),OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){for(var e=["minZoomLevel","maxZoomLevel","numZoomLevels"],t=0,i=e.length;t<i;t++){var n=e[t];this[n]=null!=this.options[n]?this.options[n]:this.map[n]}(null==this.minZoomLevel||this.minZoomLevel<this.MIN_ZOOM_LEVEL)&&(this.minZoomLevel=this.MIN_ZOOM_LEVEL);var s,r=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(s=null==this.options.numZoomLevels&&null!=this.options.maxZoomLevel||null==this.numZoomLevels&&null!=this.maxZoomLevel?this.maxZoomLevel-this.minZoomLevel+1:this.numZoomLevels,this.numZoomLevels=null!=s?Math.min(s,r):r,this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1,null!=this.RESOLUTIONS){var a=0;this.resolutions=[];for(t=this.minZoomLevel;t<=this.maxZoomLevel;t++)this.resolutions[a++]=this.RESOLUTIONS[t];this.maxResolution=this.resolutions[0],this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getResolution.apply(this,arguments);var e=null,t=this.map.getSize(),i=this.getExtent();return null!=t&&null!=i&&(e=Math.max(i.getWidth()/t.w,i.getHeight()/t.h)),e},getExtent:function(){var e=this.map.getSize(),t=this.getLonLatFromViewPortPx({x:0,y:0}),i=this.getLonLatFromViewPortPx({x:e.w,y:e.h});return null!=t&&null!=i?new OpenLayers.Bounds(t.lon,i.lat,i.lon,t.lat):null},getZoomForResolution:function(e){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);var t=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(t)},getOLZoomFromMapObjectZoom:function(e){var t=null;return null!=e&&(t=e-this.minZoomLevel,this.map.baseLayer!==this&&(t=this.map.baseLayer.getZoomForResolution(this.getResolutionForZoom(t)))),t},getMapObjectZoomFromOLZoom:function(e){var t=null;return null!=e&&(t=e+this.minZoomLevel,this.map.baseLayer!==this&&(t=this.getZoomForResolution(this.map.baseLayer.getResolutionForZoom(t)))),t},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"}),OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:21,RESOLUTIONS:[1.40625,.703125,.3515625,.17578125,.087890625,.0439453125,.02197265625,.010986328125,.0054931640625,.00274658203125,.001373291015625,.0006866455078125,.00034332275390625,.000171661376953125,858306884765625e-19,4291534423828125e-20,2145767211914062e-20,1072883605957031e-20,536441802978515e-20,268220901489257e-20,1341104507446289e-21,6.705522537231445e-7],type:null,wrapDateLine:!0,sphericalMercator:!1,version:null,initialize:function(e,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,[e,t]),OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,[e,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(e){var t=null==this.opacity?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments),this.setOpacity(t)},display:function(e){this._dragging||this.setGMapVisibility(e),OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments)},moveTo:function(e,t,i){this._dragging=i,OpenLayers.Layer.EventPane.prototype.moveTo.apply(this,arguments),delete this._dragging},setOpacity:function(e){if(e!==this.opacity&&(null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"}),this.opacity=e),this.getVisibility()){var t=this.getMapContainer();OpenLayers.Util.modifyDOMElement(t,null,null,null,null,null,null,e)}},destroy:function(){if(this.map){this.setGMapVisibility(!1);var e=OpenLayers.Layer.Google.cache[this.map.id];e&&e.count<=1&&this.removeGMapElements()}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var e=OpenLayers.Layer.Google.cache[this.map.id];if(e){var t=this.mapObject&&this.getMapContainer();t&&t.parentNode&&t.parentNode.removeChild(t);var i=e.termsOfUse;i&&i.parentNode&&i.parentNode.removeChild(i);var n=e.poweredBy;n&&n.parentNode&&n.parentNode.removeChild(n),this.mapObject&&window.google&&google.maps&&google.maps.event&&google.maps.event.clearListeners&&google.maps.event.clearListeners(this.mapObject,"tilesloaded")}},removeMap:function(e){this.visibility&&this.mapObject&&this.setGMapVisibility(!1);var t=OpenLayers.Layer.Google.cache[e.id];t&&(t.count<=1?(this.removeGMapElements(),delete OpenLayers.Layer.Google.cache[e.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(e){var t=null;if(null!=e){var i=e.getSouthWest(),n=e.getNorthEast();this.sphericalMercator?(i=this.forwardMercator(i.lng(),i.lat()),n=this.forwardMercator(n.lng(),n.lat())):(i=new OpenLayers.LonLat(i.lng(),i.lat()),n=new OpenLayers.LonLat(n.lng(),n.lat())),t=new OpenLayers.Bounds(i.lon,i.lat,n.lon,n.lat)}return t},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getLongitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.lng(),e.lat()).lon:e.lng()},getLatitudeFromMapObjectLonLat:function(e){return this.sphericalMercator?this.forwardMercator(e.lng(),e.lat()).lat:e.lat()},getXFromMapObjectPixel:function(e){return e.x},getYFromMapObjectPixel:function(e){return e.y},CLASS_NAME:"OpenLayers.Layer.Google"}),OpenLayers.Layer.Google.cache={},OpenLayers.Layer.Google.v2={termsOfUse:null,poweredBy:null,dragObject:null,loadMapObject:function(){this.type||(this.type=G_NORMAL_MAP);var e,t,i,n=OpenLayers.Layer.Google.cache[this.map.id];if(n)e=n.mapObject,t=n.termsOfUse,i=n.poweredBy,++n.count;else{var s=this.map.viewPortDiv,r=document.createElement("div");r.id=this.map.id+"_GMap2Container",r.style.position="absolute",r.style.width="100%",r.style.height="100%",s.appendChild(r);try{e=new GMap2(r),t=r.lastChild,s.appendChild(t),t.style.zIndex="1100",t.style.right="",t.style.bottom="",t.className="olLayerGoogleCopyright",i=r.lastChild,s.appendChild(i),i.style.zIndex="1100",i.style.right="",i.style.bottom="",i.className="olLayerGooglePoweredBy gmnoprint"}catch(e){throw e}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:e,termsOfUse:t,poweredBy:i,count:1}}this.mapObject=e,this.termsOfUse=t,this.poweredBy=i,-1===OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)&&this.mapObject.addMapType(this.type),"function"==typeof e.getDragObject?this.dragObject=e.getDragObject():this.dragPanMapObject=null,!1===this.isBaseLayer&&this.setGMapVisibility("none"!==this.div.style.display)},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded())this.mapObject.checkResize();else{if(!this._resized)var e=this,t=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(t),delete e._resized,e.mapObject.checkResize(),e.moveTo(e.map.getCenter(),e.map.getZoom())});this._resized=!0}},setGMapVisibility:function(e){var t=OpenLayers.Layer.Google.cache[this.map.id];if(t){var i=this.mapObject.getContainer();!0===e?(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(e){var t=null;if(null!=e){var i=this.sphericalMercator?this.inverseMercator(e.bottom,e.left):new OpenLayers.LonLat(e.bottom,e.left),n=this.sphericalMercator?this.inverseMercator(e.top,e.right):new OpenLayers.LonLat(e.top,e.right);t=new GLatLngBounds(new GLatLng(i.lat,i.lon),new GLatLng(n.lat,n.lon))}return t},setMapObjectCenter:function(e,t){this.mapObject.setCenter(e,t)},dragPanMapObject:function(e,t){this.dragObject.moveBy(new GSize(-e,t))},getMapObjectLonLatFromMapObjectPixel:function(e){return this.mapObject.fromContainerPixelToLatLng(e)},getMapObjectPixelFromMapObjectLonLat:function(e){return this.mapObject.fromLatLngToContainerPixel(e)},getMapObjectZoomFromMapObjectBounds:function(e){return this.mapObject.getBoundsZoomLevel(e)},getMapObjectLonLatFromLonLat:function(e,t){var i;if(this.sphericalMercator){var n=this.inverseMercator(e,t);i=new GLatLng(n.lat,n.lon)}else i=new GLatLng(t,e);return i},getMapObjectPixelFromXY:function(e,t){return new GPoint(e,t)}},OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(e){window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM")),OpenLayers.Format.prototype.initialize.apply(this,[e]),this.namespaces=OpenLayers.Util.extend({},this.namespaces),this.namespaceAlias={};for(var t in this.namespaces)this.namespaceAlias[this.namespaces[t]]=t},destroy:function(){this.xmldom=null,OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(e,t){this.namespaces[e]=t,this.namespaceAlias[t]=e},read:function(e){var t=e.indexOf("<");t>0&&(e=e.substring(t));var i=OpenLayers.Util.Try(OpenLayers.Function.bind(function(){var t;return(t=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom).loadXML(e),t},this),function(){return(new DOMParser).parseFromString(e,"text/xml")},function(){var t=new XMLHttpRequest;return t.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(e),!1),t.overrideMimeType&&t.overrideMimeType("text/xml"),t.send(null),t.responseXML});return this.keepData&&(this.data=i),i},write:function(e){var t;if(this.xmldom)t=e.xml;else{var i=new XMLSerializer;if(1==e.nodeType){var n=document.implementation.createDocument("","",null);n.importNode&&(e=n.importNode(e,!0)),n.appendChild(e),t=i.serializeToString(n)}else t=i.serializeToString(e)}return t},createElementNS:function(e,t){return this.xmldom?"string"==typeof e?this.xmldom.createNode(1,t,e):this.xmldom.createNode(1,t,""):document.createElementNS(e,t)},createDocumentFragment:function(){return this.xmldom?this.xmldom.createDocumentFragment():document.createDocumentFragment()},createTextNode:function(e){return"string"!=typeof e&&(e=String(e)),this.xmldom?this.xmldom.createTextNode(e):document.createTextNode(e)},getElementsByTagNameNS:function(e,t,i){var n=[];if(e.getElementsByTagNameNS)n=e.getElementsByTagNameNS(t,i);else for(var s,r,a=e.getElementsByTagName("*"),o=0,l=a.length;o<l;++o)r=(s=a[o]).prefix?s.prefix+":"+i:i,"*"!=i&&r!=s.nodeName||"*"!=t&&t!=s.namespaceURI||n.push(s);return n},getAttributeNodeNS:function(e,t,i){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,i);else for(var s,r=e.attributes,a=0,o=r.length;a<o;++a)if((s=r[a]).namespaceURI==t&&(s.prefix?s.prefix+":"+i:i)==s.nodeName){n=s;break}return n},getAttributeNS:function(e,t,i){var n="";if(e.getAttributeNS)n=e.getAttributeNS(t,i)||"";else{var s=this.getAttributeNodeNS(e,t,i);s&&(n=s.nodeValue)}return n},getChildValue:function(e,t){var i=t||"";if(e)for(var n=e.firstChild;n;n=n.nextSibling)switch(n.nodeType){case 3:case 4:i+=n.nodeValue}return i},isSimpleContent:function(e){for(var t=!0,i=e.firstChild;i;i=i.nextSibling)if(1===i.nodeType){t=!1;break}return t},contentType:function(e){for(var t=!1,i=!1,n=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY,s=e.firstChild;s;s=s.nextSibling){switch(s.nodeType){case 1:i=!0;break;case 8:break;default:t=!0}if(i&&t)break}if(i&&t)n=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 n},hasAttributeNS:function(e,t,i){return e.hasAttributeNS?e.hasAttributeNS(t,i):!!this.getAttributeNodeNS(e,t,i)},setAttributeNS:function(e,t,i,n){if(e.setAttributeNS)e.setAttributeNS(t,i,n);else{if(!this.xmldom)throw"setAttributeNS not implemented";if(t){var s=e.ownerDocument.createNode(2,i,t);s.nodeValue=n,e.setAttributeNode(s)}else e.setAttribute(i,n)}},createElementNSPlus:function(e,t){var i=(t=t||{}).uri||this.namespaces[t.prefix];if(!i){var n=e.indexOf(":");i=this.namespaces[e.substring(0,n)]}i||(i=this.namespaces[this.defaultPrefix]);var s=this.createElementNS(i,e);t.attributes&&this.setAttributes(s,t.attributes);var r=t.value;return null!=r&&s.appendChild(this.createTextNode(r)),s},setAttributes:function(e,t){var i,n;for(var s in t)null!=t[s]&&t[s].toString&&(i=t[s].toString(),n=this.namespaces[s.substring(0,s.indexOf(":"))]||null,this.setAttributeNS(e,n,s,i))},readNode:function(e,t){t||(t={});var i=this.readers[e.namespaceURI?this.namespaceAlias[e.namespaceURI]:this.defaultPrefix];if(i){var n=i[e.localName||e.nodeName.split(":").pop()]||i["*"];n&&n.apply(this,[e,t])}return t},readChildNodes:function(e,t){t||(t={});for(var i,n=e.childNodes,s=0,r=n.length;s<r;++s)1==(i=n[s]).nodeType&&this.readNode(i,t);return t},writeNode:function(e,t,i){var n,s,r=e.indexOf(":");r>0?(n=e.substring(0,r),s=e.substring(r+1)):(n=i?this.namespaceAlias[i.namespaceURI]:this.defaultPrefix,s=e);var a=this.writers[n][s].apply(this,[t]);return i&&i.appendChild(a),a},getChildEl:function(e,t,i){return e&&this.getThisOrNextEl(e.firstChild,t,i)},getNextEl:function(e,t,i){return e&&this.getThisOrNextEl(e.nextSibling,t,i)},getThisOrNextEl:function(e,t,i){e:for(var n=e;n;n=n.nextSibling)switch(n.nodeType){case 1:if(!(t&&t!==(n.localName||n.nodeName.split(":").pop())||i&&i!==n.namespaceURI))break e;n=null;break e;case 3:if(/^\s*$/.test(n.nodeValue))break;case 4:case 6:case 12:case 10:case 11:n=null;break e}return n||null},lookupNamespaceURI:function(e,t){var i=null;if(e)if(e.lookupNamespaceURI)i=e.lookupNamespaceURI(t);else e:switch(e.nodeType){case 1:if(null!==e.namespaceURI&&e.prefix===t){i=e.namespaceURI;break e}var n=e.attributes.length;if(n)for(var s,r=0;r<n;++r){if("xmlns"===(s=e.attributes[r]).prefix&&s.name==="xmlns:"+t){i=s.value||null;break e}if("xmlns"===s.name&&null===t){i=s.value||null;break e}}i=this.lookupNamespaceURI(e.parentNode,t);break e;case 2:i=this.lookupNamespaceURI(e.ownerElement,t);break e;case 9:i=this.lookupNamespaceURI(e.documentElement,t);break e;case 6:case 12:case 10:case 11:break e;default:i=this.lookupNamespaceURI(e.parentNode,t)}return i},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(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Format.WFST.DEFAULTS);var t=OpenLayers.Format.WFST["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFST version: "+e.version;return new t(e)},OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"},OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:null,popup:null,initialize:function(e,t,i){this.layer=e,this.lonlat=t,this.data=null!=i?i:{},this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){null!=this.layer&&null!=this.layer.map&&null!=this.popup&&this.layer.map.removePopup(this.popup),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 e=!1;return null!=this.layer&&null!=this.layer.map&&(e=this.layer.map.getExtent().containsLonLat(this.lonlat)),e},createMarker:function(){return null!=this.lonlat&&(this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)),this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(e){if(null!=this.lonlat){if(!this.popup){var t=this.marker?this.marker.icon:null,i=this.popupClass?this.popupClass:OpenLayers.Popup.Anchored;this.popup=new i(this.id+"_popup",this.lonlat,this.data.popupSize,this.data.popupContentHTML,t,e)}null!=this.data.overflow&&(this.popup.contentDiv.style.overflow=this.data.overflow),this.popup.feature=this}return this.popup},destroyPopup:function(){this.popup&&(this.popup.feature=null,this.popup.destroy(),this.popup=null)},CLASS_NAME:"OpenLayers.Feature"}),OpenLayers.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(e,t,i){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,t]),this.lonlat=null,this.geometry=e||null,this.state=null,this.attributes={},t&&(this.attributes=OpenLayers.Util.extend(this.attributes,t)),this.style=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(e){var t=!1;if(this.layer&&this.layer.map){var i=this.layer.map.getExtent();if(e){var n=this.geometry.getBounds();t=i.intersectsBounds(n)}else t=i.toGeometry().intersects(this.geometry)}return 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(e,t,i){var n=!1;return this.geometry&&(n=this.geometry.atPoint(e,t,i)),n},destroyPopup:function(){},move:function(e){if(this.layer&&this.geometry.move){var t;t="OpenLayers.LonLat"==e.CLASS_NAME?this.layer.getViewPortPxFromLonLat(e):e;var i=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),n=this.layer.map.getResolution();return this.geometry.move(n*(t.x-i.x),n*(i.y-t.y)),this.layer.drawFeature(this),i}},toState:function(e){if(e==OpenLayers.State.UPDATE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=e;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:}else if(e==OpenLayers.State.INSERT)switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=e}else if(e==OpenLayers.State.DELETE)switch(this.state){case OpenLayers.State.INSERT:case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=e}else e==OpenLayers.State.UNKNOWN&&(this.state=e)},CLASS_NAME:"OpenLayers.Feature.Vector"}),OpenLayers.Feature.Vector.style={default:{fillColor:"#ee9900",fillOpacity:.4,hoverFillColor:"white",hoverFillOpacity:.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},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",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},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",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},delete:{display:"none"}},OpenLayers.Style=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:!1,propertyStyles:null,initialize:function(e,t){OpenLayers.Util.extend(this,t),this.rules=[],t&&t.rules&&this.addRules(t.rules),this.setDefaultStyle(e||OpenLayers.Feature.Vector.style.default),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var e=0,t=this.rules.length;e<t;e++)this.rules[e].destroy(),this.rules[e]=null;this.rules=null,this.defaultStyle=null},createSymbolizer:function(e){for(var t,i=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),e),n=this.rules,s=[],r=!1,a=0,o=n.length;a<o;a++)(t=n[a]).evaluate(e)&&(t instanceof OpenLayers.Rule&&t.elseFilter?s.push(t):(r=!0,this.applySymbolizer(t,i,e)));if(0==r&&s.length>0){r=!0;for(var a=0,o=s.length;a<o;a++)this.applySymbolizer(s[a],i,e)}return n.length>0&&0==r&&(i.display="none"),null!=i.label&&"string"!=typeof i.label&&(i.label=String(i.label)),i},applySymbolizer:function(e,t,i){var n=i.geometry?this.getSymbolizerPrefix(i.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0],s=e.symbolizer[n]||e.symbolizer;if(!0===this.defaultsPerSymbolizer){var r=this.defaultStyle;OpenLayers.Util.applyDefaults(s,{pointRadius:r.pointRadius}),!0!==s.stroke&&!0!==s.graphic||OpenLayers.Util.applyDefaults(s,{strokeWidth:r.strokeWidth,strokeColor:r.strokeColor,strokeOpacity:r.strokeOpacity,strokeDashstyle:r.strokeDashstyle,strokeLinecap:r.strokeLinecap}),!0!==s.fill&&!0!==s.graphic||OpenLayers.Util.applyDefaults(s,{fillColor:r.fillColor,fillOpacity:r.fillOpacity}),!0===s.graphic&&OpenLayers.Util.applyDefaults(s,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}return this.createLiterals(OpenLayers.Util.extend(t,s),i)},createLiterals:function(e,t){var i=OpenLayers.Util.extend({},t.attributes||t.data);OpenLayers.Util.extend(i,this.context);for(var n in this.propertyStyles)e[n]=OpenLayers.Style.createLiteral(e[n],i,t,n);return e},findPropertyStyles:function(){var e={},t=this.defaultStyle;this.addPropertyStyles(e,t);for(var i,n,s=this.rules,r=0,a=s.length;r<a;r++){i=s[r].symbolizer;for(var o in i){if("object"!=typeof(n=i[o])){this.addPropertyStyles(e,i);break}this.addPropertyStyles(e,n)}}return e},addPropertyStyles:function(e,t){var i;for(var n in t)"string"==typeof(i=t[n])&&i.match(/\$\{\w+\}/)&&(e[n]=!0);return e},addRules:function(e){Array.prototype.push.apply(this.rules,e),this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(e){this.defaultStyle=e,this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(e){for(var t=OpenLayers.Style.SYMBOLIZER_PREFIXES,i=0,n=t.length;i<n;i++)if(-1!=e.CLASS_NAME.indexOf(t[i]))return t[i]},clone:function(){var e=OpenLayers.Util.extend({},this);if(this.rules){e.rules=[];for(var t=0,i=this.rules.length;t<i;++t)e.rules.push(this.rules[t].clone())}e.context=this.context&&OpenLayers.Util.extend({},this.context);var n=OpenLayers.Util.extend({},this.defaultStyle);return new OpenLayers.Style(n,e)},CLASS_NAME:"OpenLayers.Style"}),OpenLayers.Style.createLiteral=function(e,t,i,n){return"string"==typeof e&&-1!=e.indexOf("${")&&(e=OpenLayers.String.format(e,t,[i,n]),e=isNaN(e)||!e?e:parseFloat(e)),e},OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text","Raster"],OpenLayers.Filter=OpenLayers.Class({initialize:function(e){OpenLayers.Util.extend(this,e)},destroy:function(){},evaluate:function(e){return!0},clone:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.CQL?OpenLayers.Format.CQL.prototype.write(this):Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Filter"}),OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,evaluate:function(e){var t=!1;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(e.geometry){var i=this.value;"OpenLayers.Bounds"==this.value.CLASS_NAME&&(i=this.value.toGeometry()),e.geometry.intersects(i)&&(t=!0)}break;default:throw new Error("evaluate is not implemented for this filter type.")}return t},clone:function(){var e=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(e)},CLASS_NAME:"OpenLayers.Filter.Spatial"}),OpenLayers.Filter.Spatial.BBOX="BBOX",OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS",OpenLayers.Filter.Spatial.DWITHIN="DWITHIN",OpenLayers.Filter.Spatial.WITHIN="WITHIN",OpenLayers.Filter.Spatial.CONTAINS="CONTAINS",OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,type:"FID",initialize:function(e){this.fids=[],OpenLayers.Filter.prototype.initialize.apply(this,[e])},evaluate:function(e){for(var t=0,i=this.fids.length;t<i;t++)if((e.fid||e.id)==this.fids[t])return!0;return!1},clone:function(){var e=new OpenLayers.Filter.FeatureId;return OpenLayers.Util.extend(e,this),e.fids=this.fids.slice(),e},CLASS_NAME:"OpenLayers.Filter.FeatureId"}),OpenLayers.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(e){this.stateName={},this.stateName[OpenLayers.State.INSERT]="wfs:Insert",this.stateName[OpenLayers.State.UPDATE]="wfs:Update",this.stateName[OpenLayers.State.DELETE]="wfs:Delete",OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},getSrsName:function(e,t){var i=t&&t.srsName;return i||(i=e&&e.layer?e.layer.projection.getCode():this.srsName),i},read:function(e,t){t=t||{},OpenLayers.Util.applyDefaults(t,{output:"features"}),"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var i={};return e&&this.readNode(e,i,!0),i.features&&"features"===t.output&&(i=i.features),i},readers:{wfs:{FeatureCollection:function(e,t){t.features=[],this.readChildNodes(e,t)}}},write:function(e,t){var i=this.writeNode("wfs:Transaction",{features:e,options:t}),n=this.schemaLocationAttr();return n&&this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",n),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{wfs:{GetFeature:function(e){var t=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,handle:e&&e.handle,outputFormat:e&&e.outputFormat,maxFeatures:e&&e.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(e)}});if("string"==typeof this.featureType)this.writeNode("Query",e,t);else for(var i=0,n=this.featureType.length;i<n;i++)e.featureType=this.featureType[i],this.writeNode("Query",e,t);return t},Transaction:function(e){var t,i,n=(e=e||{}).options||{},s=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version,handle:n.handle}}),r=e.features;if(r){!0===n.multi&&OpenLayers.Util.extend(this.geometryTypes,{"OpenLayers.Geometry.Point":"MultiPoint","OpenLayers.Geometry.LineString":!0===this.multiCurve?"MultiCurve":"MultiLineString","OpenLayers.Geometry.Polygon":!0===this.multiSurface?"MultiSurface":"MultiPolygon"});var a,o;for(t=0,i=r.length;t<i;++t)o=r[t],(a=this.stateName[o.state])&&this.writeNode(a,{feature:o,options:n},s);!0===n.multi&&this.setGeometryTypes()}if(n.nativeElements)for(t=0,i=n.nativeElements.length;t<i;++t)this.writeNode("wfs:Native",n.nativeElements[t],s);return s},Native:function(e){return this.createElementNSPlus("wfs:Native",{attributes:{vendorId:e.vendorId,safeToIgnore:e.safeToIgnore},value:e.value})},Insert:function(e){var t=e.feature,i=e.options,n=this.createElementNSPlus("wfs:Insert",{attributes:{handle:i&&i.handle}});return this.srsName=this.getSrsName(t),this.writeNode("feature:_typeName",t,n),n},Update:function(e){var t=e.feature,i=e.options,n=this.createElementNSPlus("wfs:Update",{attributes:{handle:i&&i.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});this.featureNS&&n.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var s=t.modified;null===this.geometryName||s&&void 0===s.geometry||(this.srsName=this.getSrsName(t),this.writeNode("Property",{name:this.geometryName,value:t.geometry},n));for(var r in t.attributes)void 0===t.attributes[r]||s&&s.attributes&&(!s.attributes||void 0===s.attributes[r])||this.writeNode("Property",{name:r,value:t.attributes[r]},n);return this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[t.fid]}),n),n},Property:function(e){var t=this.createElementNSPlus("wfs:Property");return this.writeNode("Name",e.name,t),null!==e.value&&this.writeNode("Value",e.value,t),t},Name:function(e){return this.createElementNSPlus("wfs:Name",{value:e})},Value:function(e){var t;if(e instanceof OpenLayers.Geometry){t=this.createElementNSPlus("wfs:Value");var i=this.writeNode("feature:_geometry",e).firstChild;t.appendChild(i)}else t=this.createElementNSPlus("wfs:Value",{value:e});return t},Delete:function(e){var t=e.feature,i=e.options,n=this.createElementNSPlus("wfs:Delete",{attributes:{handle:i&&i.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});return this.featureNS&&n.setAttribute("xmlns:"+this.featurePrefix,this.featureNS),this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[t.fid]}),n),n}}},schemaLocationAttr:function(e){e=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},e);var t=OpenLayers.Util.extend({},this.schemaLocations);e.schema&&(t[e.featurePrefix]=e.schema);var i,n=[];for(var s in t)(i=this.namespaces[s])&&n.push(i+" "+t[s]);return n.join(" ")||void 0},setFilterProperty:function(e){if(e.filters)for(var t=0,i=e.filters.length;t<i;++t)OpenLayers.Format.WFST.v1.prototype.setFilterProperty.call(this,e.filters[t]);else e instanceof OpenLayers.Filter.Spatial&&!e.property&&(e.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(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t={exceptionReport:null};return e.documentElement&&(this.readChildNodes(e,t),null===t.exceptionReport&&(t=(new OpenLayers.Format.OWSCommon).read(e))),t},readers:{ogc:{ServiceExceptionReport:function(e,t){t.exceptionReport={exceptions:[]},this.readChildNodes(e,t.exceptionReport)},ServiceException:function(e,t){var i={code:e.getAttribute("code"),locator:e.getAttribute("locator"),text:this.getChildValue(e)};t.exceptions.push(i)}}},CLASS_NAME:"OpenLayers.Format.OGCExceptionReport"}),OpenLayers.Format.XML.VersionedOGC=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:null,version:null,profile:null,allowFallback:!1,name:null,stringifyOutput:!1,parser:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]);var t=this.CLASS_NAME;this.name=t.substring(t.lastIndexOf(".")+1)},getVersion:function(e,t){var i;return e?(i=this.version)||(i=e.getAttribute("version"))||(i=this.defaultVersion):i=t&&t.version||this.version||this.defaultVersion,i},getParser:function(e){e=e||this.defaultVersion;var t=this.profile?"_"+this.profile:"";if(!this.parser||this.parser.VERSION!=e){var i=OpenLayers.Format[this.name]["v"+e.replace(/\./g,"_")+t];if(!i&&(""!==t&&this.allowFallback&&(t="",i=OpenLayers.Format[this.name]["v"+e.replace(/\./g,"_")]),!i))throw"Can't find a "+this.name+" parser for version "+e+t;this.parser=new i(this.options)}return this.parser},write:function(e,t){var i=this.getVersion(null,t);this.parser=this.getParser(i);var n=this.parser.write(e,t);return!1===this.stringifyOutput?n:OpenLayers.Format.XML.prototype.write.apply(this,[n])},read:function(e,t){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var i=e.documentElement,n=this.getVersion(i);this.parser=this.getParser(n);var s=this.parser.read(e,t),r=this.parser.errorProperty||null;if(null!==r&&void 0===s[r]){var a=new OpenLayers.Format.OGCExceptionReport;s.error=a.read(e)}return s.version=n,s},CLASS_NAME:"OpenLayers.Format.XML.VersionedOGC"}),OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(e){this.filters=[],OpenLayers.Filter.prototype.initialize.apply(this,[e])},destroy:function(){this.filters=null,OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(e){var t,i;switch(this.type){case OpenLayers.Filter.Logical.AND:for(t=0,i=this.filters.length;t<i;t++)if(0==this.filters[t].evaluate(e))return!1;return!0;case OpenLayers.Filter.Logical.OR:for(t=0,i=this.filters.length;t<i;t++)if(1==this.filters[t].evaluate(e))return!0;return!1;case OpenLayers.Filter.Logical.NOT:return!this.filters[0].evaluate(e)}},clone:function(){for(var e=[],t=0,i=this.filters.length;t<i;++t)e.push(this.filters[t].clone());return new OpenLayers.Filter.Logical({type:this.type,filters:e})},CLASS_NAME:"OpenLayers.Filter.Logical"}),OpenLayers.Filter.Logical.AND="&&",OpenLayers.Filter.Logical.OR="||",OpenLayers.Filter.Logical.NOT="!",OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:!0,lowerBoundary:null,upperBoundary:null,initialize:function(e){OpenLayers.Filter.prototype.initialize.apply(this,[e]),this.type===OpenLayers.Filter.Comparison.LIKE&&void 0===e.matchCase&&(this.matchCase=null)},evaluate:function(e){e instanceof OpenLayers.Feature.Vector&&(e=e.attributes);var t,i=!1,n=e[this.property];switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:t=this.value,i=this.matchCase||"string"!=typeof n||"string"!=typeof t?n==t:n.toUpperCase()==t.toUpperCase();break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:t=this.value,i=this.matchCase||"string"!=typeof n||"string"!=typeof t?n!=t:n.toUpperCase()!=t.toUpperCase();break;case OpenLayers.Filter.Comparison.LESS_THAN:i=n<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:i=n>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:i=n<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:i=n>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:i=n>=this.lowerBoundary&&n<=this.upperBoundary;break;case OpenLayers.Filter.Comparison.LIKE:i=new RegExp(this.value,"gi").test(n);break;case OpenLayers.Filter.Comparison.IS_NULL:i=null===n}return i},value2regex:function(e,t,i){if("."==e)throw new Error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison");return e=e||"*",t=t||".",i=i||"!",this.value=this.value.replace(new RegExp("\\"+i+"(.|$)","g"),"\\$1"),this.value=this.value.replace(new RegExp("\\"+t,"g"),"."),this.value=this.value.replace(new RegExp("\\"+e,"g"),".*"),this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+e),this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+t),this.value},regex2value:function(){var e=this.value;return e=e.replace(/!/g,"!!"),e=e.replace(/(\\)?\\\./g,function(e,t){return t?e:"!."}),e=e.replace(/(\\)?\\\*/g,function(e,t){return t?e:"!*"}),e=e.replace(/\\\\/g,"\\"),e=e.replace(/\.\*/g,"*")},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison,this)},CLASS_NAME:"OpenLayers.Filter.Comparison"}),OpenLayers.Filter.Comparison.EQUAL_TO="==",OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=",OpenLayers.Filter.Comparison.LESS_THAN="<",OpenLayers.Filter.Comparison.GREATER_THAN=">",OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=",OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=",OpenLayers.Filter.Comparison.BETWEEN="..",OpenLayers.Filter.Comparison.LIKE="~",OpenLayers.Filter.Comparison.IS_NULL="NULL",OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.Filter"}),OpenLayers.Filter.Function=OpenLayers.Class(OpenLayers.Filter,{name:null,params:null,CLASS_NAME:"OpenLayers.Filter.Function"}),OpenLayers.Date={dateRegEx:/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,toISOString:function(){return"toISOString"in Date.prototype?function(e){return e.toISOString()}:function(e){return isNaN(e.getTime())?"Invalid Date":e.getUTCFullYear()+"-"+OpenLayers.Number.zeroPad(e.getUTCMonth()+1,2)+"-"+OpenLayers.Number.zeroPad(e.getUTCDate(),2)+"T"+OpenLayers.Number.zeroPad(e.getUTCHours(),2)+":"+OpenLayers.Number.zeroPad(e.getUTCMinutes(),2)+":"+OpenLayers.Number.zeroPad(e.getUTCSeconds(),2)+"."+OpenLayers.Number.zeroPad(e.getUTCMilliseconds(),3)+"Z"}}(),parse:function(e){var t,i=e.match(this.dateRegEx);if(i&&(i[1]||i[7])){var n=parseInt(i[1],10)||0,s=parseInt(i[2],10)-1||0,r=parseInt(i[3],10)||1;t=new Date(Date.UTC(n,s,r));var a=i[7];if(a){var o=parseInt(i[4],10),l=parseInt(i[5],10),h=parseFloat(i[6]),u=0|h,p=Math.round(1e3*(h-u));if(t.setUTCHours(o,l,u,p),"Z"!==a){var c=-1e3*(60*parseInt(a,10)*60+60*(parseInt(i[8],10)||0));t=new Date(t.getTime()+c)}}}else t=new Date("invalid");return t}},OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){var t={};return this.readers.ogc.Filter.apply(this,[e,t]),t.filter},readers:{ogc:{_expression:function(e){for(var t,i="",n=e.firstChild;n;n=n.nextSibling)switch(n.nodeType){case 1:(t=this.readNode(n)).property?i+="${"+t.property+"}":void 0!==t.value&&(i+=t.value);break;case 3:case 4:i+=n.nodeValue}return i},Filter:function(e,t){var i={fids:[],filters:[]};this.readChildNodes(e,i),i.fids.length>0?t.filter=new OpenLayers.Filter.FeatureId({fids:i.fids}):i.filters.length>0&&(t.filter=i.filters[0])},FeatureId:function(e,t){var i=e.getAttribute("fid");i&&t.fids.push(i)},And:function(e,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(e,i),t.filters.push(i)},Or:function(e,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(e,i),t.filters.push(i)},Not:function(e,t){var i=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThan:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThan:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLessThanOrEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsGreaterThanOrEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsBetween:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(e,i),t.filters.push(i)},Literal:function(e,t){t.value=OpenLayers.String.numericIf(this.getChildValue(e),!0)},PropertyName:function(e,t){t.property=this.getChildValue(e)},LowerBoundary:function(e,t){t.lowerBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,e),!0)},UpperBoundary:function(e,t){t.upperBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,e),!0)},Intersects:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(e,t){this.readSpatial(e,t,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(e,t){t.distance=parseInt(this.getChildValue(e)),t.distanceUnits=e.getAttribute("units")},Function:function(e,t){},PropertyIsNull:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.IS_NULL});this.readChildNodes(e,i),t.filters.push(i)}}},readSpatial:function(e,t,i){var n=new OpenLayers.Filter.Spatial({type:i});this.readChildNodes(e,n),n.value=n.components[0],delete n.components,t.filters.push(n)},encodeLiteral:function(e){return e instanceof Date&&(e=OpenLayers.Date.toISOString(e)),e},writeOgcExpression:function(e,t){return e instanceof OpenLayers.Filter.Function?this.writeNode("Function",e,t):this.writeNode("Literal",e,t),t},write:function(e){return this.writers.ogc.Filter.apply(this,[e])},writers:{ogc:{Filter:function(e){var t=this.createElementNSPlus("ogc:Filter");return this.writeNode(this.getFilterType(e),e,t),t},_featureIds:function(e){for(var t=this.createDocumentFragment(),i=0,n=e.fids.length;i<n;++i)this.writeNode("ogc:FeatureId",e.fids[i],t);return t},FeatureId:function(e){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:e}})},And:function(e){for(var t,i=this.createElementNSPlus("ogc:And"),n=0,s=e.filters.length;n<s;++n)t=e.filters[n],this.writeNode(this.getFilterType(t),t,i);return i},Or:function(e){for(var t,i=this.createElementNSPlus("ogc:Or"),n=0,s=e.filters.length;n<s;++n)t=e.filters[n],this.writeNode(this.getFilterType(t),t,i);return i},Not:function(e){var t=this.createElementNSPlus("ogc:Not"),i=e.filters[0];return this.writeNode(this.getFilterType(i),i,t),t},PropertyIsLessThan:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLessThan");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsGreaterThan:function(e){var t=this.createElementNSPlus("ogc:PropertyIsGreaterThan");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsLessThanOrEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsGreaterThanOrEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsBetween:function(e){var t=this.createElementNSPlus("ogc:PropertyIsBetween");return this.writeNode("PropertyName",e,t),this.writeNode("LowerBoundary",e,t),this.writeNode("UpperBoundary",e,t),t},PropertyName:function(e){return this.createElementNSPlus("ogc:PropertyName",{value:e.property})},Literal:function(e){var t=this.encodeLiteral||OpenLayers.Format.Filter.v1.prototype.encodeLiteral;return this.createElementNSPlus("ogc:Literal",{value:t(e)})},LowerBoundary:function(e){var t=this.createElementNSPlus("ogc:LowerBoundary");return this.writeOgcExpression(e.lowerBoundary,t),t},UpperBoundary:function(e){var t=this.createElementNSPlus("ogc:UpperBoundary");return this.writeNode("Literal",e.upperBoundary,t),t},INTERSECTS:function(e){return this.writeSpatial(e,"Intersects")},WITHIN:function(e){return this.writeSpatial(e,"Within")},CONTAINS:function(e){return this.writeSpatial(e,"Contains")},DWITHIN:function(e){var t=this.writeSpatial(e,"DWithin");return this.writeNode("Distance",e,t),t},Distance:function(e){return this.createElementNSPlus("ogc:Distance",{attributes:{units:e.distanceUnits},value:e.distance})},Function:function(e){for(var t=this.createElementNSPlus("ogc:Function",{attributes:{name:e.name}}),i=e.params,n=0,s=i.length;n<s;n++)this.writeOgcExpression(i[n],t);return t},PropertyIsNull:function(e){var t=this.createElementNSPlus("ogc:PropertyIsNull");return this.writeNode("PropertyName",e,t),t}}},getFilterType:function(e){var t=this.filterMap[e.type];if(!t)throw"Filter writing not supported for rule type: "+e.type;return t},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",NULL:"PropertyIsNull",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"_featureIds"},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(e){e&&(this.bounds=e.clone())},clearBounds:function(){this.bounds=null,this.parent&&this.parent.clearBounds()},extendBounds:function(e){this.getBounds()?this.bounds.extend(e):this.setBounds(e)},getBounds:function(){return null==this.bounds&&this.calculateBounds(),this.bounds},calculateBounds:function(){},distanceTo:function(e,t){},getVertices:function(e){},atPoint:function(e,t,i){var n=!1;if(null!=this.getBounds()&&null!=e){var s=null!=t?t:0,r=null!=i?i:0;n=new OpenLayers.Bounds(this.bounds.left-s,this.bounds.bottom-r,this.bounds.right+s,this.bounds.top+r).containsLonLat(e)}return n},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.WKT?OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this)):Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Geometry"}),OpenLayers.Geometry.fromWKT=function(e){var t;if(OpenLayers.Format&&OpenLayers.Format.WKT){var i=OpenLayers.Geometry.fromWKT.format;i||(i=new OpenLayers.Format.WKT,OpenLayers.Geometry.fromWKT.format=i);var n=i.read(e);if(n instanceof OpenLayers.Feature.Vector)t=n.geometry;else if(OpenLayers.Util.isArray(n)){for(var s=n.length,r=new Array(s),a=0;a<s;++a)r[a]=n[a].geometry;t=new OpenLayers.Geometry.Collection(r)}}return t},OpenLayers.Geometry.segmentsIntersect=function(e,t,i){var n=i&&i.point,s=i&&i.tolerance,r=!1,a=e.x1-t.x1,o=e.y1-t.y1,l=e.x2-e.x1,h=e.y2-e.y1,u=t.y2-t.y1,p=t.x2-t.x1,c=u*l-p*h,d=p*o-u*a,f=l*o-h*a;if(0==c)0==d&&0==f&&(r=!0);else{var m=d/c,y=f/c;if(m>=0&&m<=1&&y>=0&&y<=1)if(n){var g=e.x1+m*l,v=e.y1+m*h;r=new OpenLayers.Geometry.Point(g,v)}else r=!0}if(s){if(r){if(n){var L,O=[e,t];e:for(C=0;C<2;++C){L=O[C];for(x=1;x<3;++x)if(g=L["x"+x],v=L["y"+x],Math.sqrt(Math.pow(g-r.x,2)+Math.pow(v-r.y,2))<s){r.x=g,r.y=v;break e}}}}else{var b,w,S,O=[e,t];e:for(var C=0;C<2;++C){b=O[C],w=O[(C+1)%2];for(var x=1;x<3;++x)if(S={x:b["x"+x],y:b["y"+x]},OpenLayers.Geometry.distanceToSegment(S,w).distance<s){r=!n||new OpenLayers.Geometry.Point(S.x,S.y);break e}}}}return r},OpenLayers.Geometry.distanceToSegment=function(e,t){var i=OpenLayers.Geometry.distanceSquaredToSegment(e,t);return i.distance=Math.sqrt(i.distance),i},OpenLayers.Geometry.distanceSquaredToSegment=function(e,t){var i,n,s=e.x,r=e.y,a=t.x1,o=t.y1,l=t.x2,h=t.y2,u=l-a,p=h-o,c=(u*(s-a)+p*(r-o))/(Math.pow(u,2)+Math.pow(p,2));return c<=0?(i=a,n=o):c>=1?(i=l,n=h):(i=a+c*u,n=o+c*p),{distance:Math.pow(i-s,2)+Math.pow(n-r,2),x:i,y:n,along:c}},OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(e,t){OpenLayers.Geometry.prototype.initialize.apply(this,arguments),this.x=parseFloat(e),this.y=parseFloat(t)},clone:function(e){return null==e&&(e=new OpenLayers.Geometry.Point(this.x,this.y)),OpenLayers.Util.applyDefaults(e,this),e},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(e,t){var i,n,s,r,a,o,l=!(t&&!1===t.edge)&&t&&t.details;return e instanceof OpenLayers.Geometry.Point?(n=this.x,s=this.y,r=e.x,a=e.y,i=Math.sqrt(Math.pow(n-r,2)+Math.pow(s-a,2)),o=l?{x0:n,y0:s,x1:r,y1:a,distance:i}:i):(o=e.distanceTo(this,t),l&&(o={x0:o.x1,y0:o.y1,x1:o.x0,y1:o.y0,distance:o.distance})),o},equals:function(e){var t=!1;return null!=e&&(t=this.x==e.x&&this.y==e.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(e.x)&&isNaN(e.y)),t},toShortString:function(){return this.x+", "+this.y},move:function(e,t){this.x=this.x+e,this.y=this.y+t,this.clearBounds()},rotate:function(e,t){e*=Math.PI/180;var i=this.distanceTo(t),n=e+Math.atan2(this.y-t.y,this.x-t.x);this.x=t.x+i*Math.cos(n),this.y=t.y+i*Math.sin(n),this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(e,t,i){return i=void 0==i?1:i,this.x=t.x+e*i*(this.x-t.x),this.y=t.y+e*(this.y-t.y),this.clearBounds(),this},intersects:function(e){return"OpenLayers.Geometry.Point"==e.CLASS_NAME?this.equals(e):e.intersects(this)},transform:function(e,t){return e&&t&&(OpenLayers.Projection.transform(this,e,t),this.bounds=null),this},getVertices:function(e){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"}),OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(e){OpenLayers.Geometry.prototype.initialize.apply(this,arguments),this.components=[],null!=e&&this.addComponents(e)},destroy:function(){this.components.length=0,this.components=null,OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},clone:function(){for(var geometry=eval("new "+this.CLASS_NAME+"()"),i=0,len=this.components.length;i<len;i++)geometry.addComponent(this.components[i].clone());return OpenLayers.Util.applyDefaults(geometry,this),geometry},getComponentsString:function(){for(var e=[],t=0,i=this.components.length;t<i;t++)e.push(this.components[t].toShortString());return e.join(",")},calculateBounds:function(){this.bounds=null;var e=new OpenLayers.Bounds,t=this.components;if(t)for(var i=0,n=t.length;i<n;i++)e.extend(t[i].getBounds());null!=e.left&&null!=e.bottom&&null!=e.right&&null!=e.top&&this.setBounds(e)},addComponents:function(e){OpenLayers.Util.isArray(e)||(e=[e]);for(var t=0,i=e.length;t<i;t++)this.addComponent(e[t])},addComponent:function(e,t){var i=!1;if(e&&(null==this.componentTypes||OpenLayers.Util.indexOf(this.componentTypes,e.CLASS_NAME)>-1)){if(null!=t&&t<this.components.length){var n=this.components.slice(0,t),s=this.components.slice(t,this.components.length);n.push(e),this.components=n.concat(s)}else this.components.push(e);e.parent=this,this.clearBounds(),i=!0}return i},removeComponents:function(e){var t=!1;OpenLayers.Util.isArray(e)||(e=[e]);for(var i=e.length-1;i>=0;--i)t=this.removeComponent(e[i])||t;return t},removeComponent:function(e){return OpenLayers.Util.removeItem(this.components,e),this.clearBounds(),!0},getLength:function(){for(var e=0,t=0,i=this.components.length;t<i;t++)e+=this.components[t].getLength();return e},getArea:function(){for(var e=0,t=0,i=this.components.length;t<i;t++)e+=this.components[t].getArea();return e},getGeodesicArea:function(e){for(var t=0,i=0,n=this.components.length;i<n;i++)t+=this.components[i].getGeodesicArea(e);return t},getCentroid:function(e){if(!e)return this.components.length&&this.components[0].getCentroid();var t=this.components.length;if(!t)return!1;for(var i,n=[],s=[],r=0,a=Number.MAX_VALUE,o=0;o<t;++o){var l=(i=this.components[o]).getArea(),h=i.getCentroid(!0);isNaN(l)||isNaN(h.x)||isNaN(h.y)||(n.push(l),r+=l,a=l<a&&l>0?l:a,s.push(h))}if(t=n.length,0===r){for(o=0;o<t;++o)n[o]=1;r=n.length}else{for(o=0;o<t;++o)n[o]/=a;r/=a}for(var u=0,p=0,o=0;o<t;++o)h=s[o],l=n[o],u+=h.x*l,p+=h.y*l;return new OpenLayers.Geometry.Point(u/r,p/r)},getGeodesicLength:function(e){for(var t=0,i=0,n=this.components.length;i<n;i++)t+=this.components[i].getGeodesicLength(e);return t},move:function(e,t){for(var i=0,n=this.components.length;i<n;i++)this.components[i].move(e,t)},rotate:function(e,t){for(var i=0,n=this.components.length;i<n;++i)this.components[i].rotate(e,t)},resize:function(e,t,i){for(var n=0;n<this.components.length;++n)this.components[n].resize(e,t,i);return this},distanceTo:function(e,t){for(var i,n,s,r=!(t&&!1===t.edge)&&t&&t.details,a=Number.POSITIVE_INFINITY,o=0,l=this.components.length;o<l&&(i=this.components[o].distanceTo(e,t),!((s=r?i.distance:i)<a&&(a=s,n=i,0==a)));++o);return n},equals:function(e){var t=!0;if(e&&e.CLASS_NAME&&this.CLASS_NAME==e.CLASS_NAME)if(OpenLayers.Util.isArray(e.components)&&e.components.length==this.components.length){for(var i=0,n=this.components.length;i<n;++i)if(!this.components[i].equals(e.components[i])){t=!1;break}}else t=!1;else t=!1;return t},transform:function(e,t){if(e&&t){for(var i=0,n=this.components.length;i<n;i++)this.components[i].transform(e,t);this.bounds=null}return this},intersects:function(e){for(var t=!1,i=0,n=this.components.length;i<n&&!(t=e.intersects(this.components[i]));++i);return t},getVertices:function(e){for(var t=[],i=0,n=this.components.length;i<n;++i)Array.prototype.push.apply(t,this.components[i].getVertices(e));return t},CLASS_NAME:"OpenLayers.Geometry.Collection"}),OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],addPoint:function(e,t){this.addComponent(e,t)},removePoint:function(e){this.removeComponent(e)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"}),OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],getLength:function(){var e=0;if(this.components&&this.components.length>1)for(var t=1,i=this.components.length;t<i;t++)e+=this.components[t-1].distanceTo(this.components[t]);return e},getGeodesicLength:function(e){var t=this;if(e){var i=new OpenLayers.Projection("EPSG:4326");i.equals(e)||(t=this.clone().transform(e,i))}var n=0;if(t.components&&t.components.length>1)for(var s,r,a=1,o=t.components.length;a<o;a++)s=t.components[a-1],r=t.components[a],n+=OpenLayers.Util.distVincenty({lon:s.x,lat:s.y},{lon:r.x,lat:r.y});return 1e3*n},CLASS_NAME:"OpenLayers.Geometry.Curve"}),OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{removeComponent:function(e){var t=this.components&&this.components.length>2;return t&&OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments),t},intersects:function(e){var t=!1,i=e.CLASS_NAME;if("OpenLayers.Geometry.LineString"==i||"OpenLayers.Geometry.LinearRing"==i||"OpenLayers.Geometry.Point"==i){var n,s=this.getSortedSegments();n="OpenLayers.Geometry.Point"==i?[{x1:e.x,y1:e.y,x2:e.x,y2:e.y}]:e.getSortedSegments();var r,a,o,l,h,u,p,c;e:for(var d=0,f=s.length;d<f;++d){a=(r=s[d]).x1,o=r.x2,l=r.y1,h=r.y2;for(var m=0,y=n.length;m<y&&!((u=n[m]).x1>o);++m)if(!(u.x2<a)&&(p=u.y1,c=u.y2,!(Math.min(p,c)>Math.max(l,h))&&!(Math.max(p,c)<Math.min(l,h))&&OpenLayers.Geometry.segmentsIntersect(r,u))){t=!0;break e}}}else t=e.intersects(this);return t},getSortedSegments:function(){function e(e,t){return e.x1-t.x1}for(var t,i,n=this.components.length-1,s=new Array(n),r=0;r<n;++r)t=this.components[r],i=this.components[r+1],t.x<i.x?s[r]={x1:t.x,y1:t.y,x2:i.x,y2:i.y}:s[r]={x1:i.x,y1:i.y,x2:t.x,y2:t.y};return s.sort(e)},splitWithSegment:function(e,t){for(var i,n,s,r,a=!(t&&!1===t.edge),o=t&&t.tolerance,l=[],h=this.getVertices(),u=[],p=[],c=!1,d={point:!0,tolerance:o},f=null,m=0,y=h.length-2;m<=y;++m)if(i=h[m],u.push(i.clone()),n=h[m+1],r={x1:i.x,y1:i.y,x2:n.x,y2:n.y},(s=OpenLayers.Geometry.segmentsIntersect(e,r,d))instanceof OpenLayers.Geometry.Point&&(!!(s.x===e.x1&&s.y===e.y1||s.x===e.x2&&s.y===e.y2||s.equals(i)||s.equals(n))||a)){if(s.equals(p[p.length-1])||p.push(s.clone()),0===m&&s.equals(i))continue;if(s.equals(n))continue;c=!0,s.equals(i)||u.push(s),l.push(new OpenLayers.Geometry.LineString(u)),u=[s.clone()]}if(c&&(u.push(n.clone()),l.push(new OpenLayers.Geometry.LineString(u))),p.length>0){var g=e.x1<e.x2?1:-1,v=e.y1<e.y2?1:-1;f={lines:l,points:p.sort(function(e,t){return g*e.x-g*t.x||v*e.y-v*t.y})}}return f},split:function(e,t){var i,n,s,r,a=null,o=t&&t.mutual;if(e instanceof OpenLayers.Geometry.LineString){var l,h,u,p,c,d,f=this.getVertices(),m=[];s=[];for(var y=0,g=f.length-2;y<=g;++y){l=f[y],h=f[y+1],u={x1:l.x,y1:l.y,x2:h.x,y2:h.y},r=r||[e],o&&m.push(l.clone());for(var v=0;v<r.length;++v)if((p=r[v].splitWithSegment(u,t))&&((c=p.lines).length>0&&(c.unshift(v,1),Array.prototype.splice.apply(r,c),v+=c.length-2),o))for(var L=0,O=p.points.length;L<O;++L)(d=p.points[L]).equals(l)||(m.push(d),s.push(new OpenLayers.Geometry.LineString(m)),m=d.equals(h)?[]:[d.clone()])}o&&s.length>0&&m.length>0&&(m.push(h.clone()),s.push(new OpenLayers.Geometry.LineString(m)))}else a=e.splitWith(this,t);return r&&r.length>1?n=!0:r=[],s&&s.length>1?i=!0:s=[],(n||i)&&(a=o?[s,r]:r),a},splitWith:function(e,t){return e.split(this,t)},getVertices:function(e){return!0===e?[this.components[0],this.components[this.components.length-1]]:!1===e?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(e,t){var i,n=!(t&&!1===t.edge)&&t&&t.details,s={},r=Number.POSITIVE_INFINITY;if(e instanceof OpenLayers.Geometry.Point){for(var a,o=this.getSortedSegments(),l=e.x,h=e.y,u=0,p=o.length;u<p;++u)if(a=o[u],(i=OpenLayers.Geometry.distanceToSegment(e,a)).distance<r){if(r=i.distance,s=i,0===r)break}else if(a.x2>l&&(h>a.y1&&h<a.y2||h<a.y1&&h>a.y2))break;s=n?{distance:s.distance,x0:s.x,y0:s.y,x1:l,y1:h}:s.distance}else if(e instanceof OpenLayers.Geometry.LineString){var c,d,f,m,y,g=this.getSortedSegments(),v=e.getSortedSegments(),L=v.length,O={point:!0};e:for(var u=0,p=g.length;u<p;++u){m=(c=g[u]).x1,y=c.y1;for(var b=0;b<L;++b){if(d=v[b],f=OpenLayers.Geometry.segmentsIntersect(c,d,O)){r=0,s={distance:0,x0:f.x,y0:f.y,x1:f.x,y1:f.y};break e}(i=OpenLayers.Geometry.distanceToSegment({x:m,y:y},d)).distance<r&&(s={distance:r=i.distance,x0:m,y0:y,x1:i.x,y1:i.y})}}if(n||(s=s.distance),0!==r&&c){i=e.distanceTo(new OpenLayers.Geometry.Point(c.x2,c.y2),t);var w=n?i.distance:i;w<r&&(s=n?{distance:r,x0:i.x1,y0:i.y1,x1:i.x0,y1:i.y0}:w)}}else s=e.distanceTo(this,t),n&&(s={distance:s.distance,x0:s.x1,y0:s.y1,x1:s.x0,y1:s.y0});return s},simplify:function(e){if(this&&null!==this){var t=this.getVertices();if(t.length<3)return this;var i=function(e,t){return e-t},n=function(e,t,i,r){for(var o,l=0,h=0,u=t;u<i;u++)(o=s(e[t],e[i],e[u]))>l&&(l=o,h=u);l>r&&h!=t&&(a.push(h),n(e,t,h,r),n(e,h,i,r))},s=function(e,t,i){return Math.abs(.5*(e.x*t.y+t.x*i.y+i.x*e.y-t.x*e.y-i.x*t.y-e.x*i.y))/Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))*2},r=t.length-1,a=[];for(a.push(0),a.push(r);t[0].equals(t[r]);)r--,a.push(r);n(t,0,r,e);var o=[];a.sort(i);for(var l=0;l<a.length;l++)o.push(t[a[l]]);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"],split:function(e,t){for(var i,n,s,r,a,o=null,l=t&&t.mutual,h=[],u=[e],p=0,c=this.components.length;p<c;++p){n=this.components[p],r=!1;for(var d=0;d<u.length;++d)if(i=n.split(u[d],t)){if(l){for(var f=0,m=(s=i[0]).length;f<m;++f)0===f&&h.length?h[h.length-1].addComponent(s[f]):h.push(new OpenLayers.Geometry.MultiLineString([s[f]]));r=!0,i=i[1]}if(i.length){i.unshift(d,1),Array.prototype.splice.apply(u,i);break}}r||(h.length?h[h.length-1].addComponent(n.clone()):h=[new OpenLayers.Geometry.MultiLineString(n.clone())])}return h&&h.length>1?r=!0:h=[],u&&u.length>1?a=!0:u=[],(r||a)&&(o=l?[h,u]:u),o},splitWith:function(e,t){var i,n,s,r,a,o,l,h=null,u=t&&t.mutual;if(e instanceof OpenLayers.Geometry.LineString){l=[],o=[e];for(var p=0,c=this.components.length;p<c;++p){a=!1,n=this.components[p];for(var d=0;d<o.length;++d)if(i=o[d].split(n,t)){u&&((s=i[0]).length&&(s.unshift(d,1),Array.prototype.splice.apply(o,s),d+=s.length-2),0===(i=i[1]).length&&(i=[n.clone()]));for(var f=0,m=i.length;f<m;++f)0===f&&l.length?l[l.length-1].addComponent(i[f]):l.push(new OpenLayers.Geometry.MultiLineString([i[f]]));a=!0}a||(l.length?l[l.length-1].addComponent(n.clone()):l=[new OpenLayers.Geometry.MultiLineString([n.clone()])])}}else h=e.split(this);return o&&o.length>1?r=!0:o=[],l&&l.length>1?a=!0:l=[],(r||a)&&(h=u?[o,l]:l),h},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"}),OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],addComponent:function(e,t){var i=!1,n=this.components.pop();null==t&&e.equals(n)||(i=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments));var s=this.components[0];return OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[s]),i},removeComponent:function(e){var t=this.components&&this.components.length>3;if(t){this.components.pop(),OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var i=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[i])}return t},move:function(e,t){for(var i=0,n=this.components.length;i<n-1;i++)this.components[i].move(e,t)},rotate:function(e,t){for(var i=0,n=this.components.length;i<n-1;++i)this.components[i].rotate(e,t)},resize:function(e,t,i){for(var n=0,s=this.components.length;n<s-1;++n)this.components[n].resize(e,t,i);return this},transform:function(e,t){if(e&&t){for(var i=0,n=this.components.length;i<n-1;i++)this.components[i].transform(e,t);this.bounds=null}return this},getCentroid:function(){if(this.components){var e=this.components.length;if(e>0&&e<=2)return this.components[0].clone();if(e>2){var t=0,i=0,n=this.components[0].x,s=this.components[0].y,r=-1*this.getArea();if(0!=r){for(u=0;u<e-1;u++){var a=this.components[u],o=this.components[u+1];t+=(a.x+o.x-2*n)*((a.x-n)*(o.y-s)-(o.x-n)*(a.y-s)),i+=(a.y+o.y-2*s)*((a.x-n)*(o.y-s)-(o.x-n)*(a.y-s))}var l=n+t/(6*r),h=s+i/(6*r)}else{for(var u=0;u<e-1;u++)t+=this.components[u].x,i+=this.components[u].y;var l=t/(e-1),h=i/(e-1)}return new OpenLayers.Geometry.Point(l,h)}return null}},getArea:function(){var e=0;if(this.components&&this.components.length>2){for(var t=0,i=0,n=this.components.length;i<n-1;i++){var s=this.components[i],r=this.components[i+1];t+=(s.x+r.x)*(r.y-s.y)}e=-t/2}return e},getGeodesicArea:function(e){var t=this;if(e){var i=new OpenLayers.Projection("EPSG:4326");i.equals(e)||(t=this.clone().transform(e,i))}var n=0,s=t.components&&t.components.length;if(s>2){for(var r,a,o=0;o<s-1;o++)r=t.components[o],a=t.components[o+1],n+=OpenLayers.Util.rad(a.x-r.x)*(2+Math.sin(OpenLayers.Util.rad(r.y))+Math.sin(OpenLayers.Util.rad(a.y)));n=6378137*n*6378137/2}return n},containsPoint:function(e){for(var t,i,n,s,r,a,o,l=OpenLayers.Number.limitSigDigs,h=l(e.x,14),u=l(e.y,14),p=this.components.length-1,c=0,d=0;d<p;++d)if(t=this.components[d],n=l(t.x,14),s=l(t.y,14),i=this.components[d+1],r=l(i.x,14),a=l(i.y,14),s!=a){if((o=l(function(e,t,i,n,s){return(n-t)/(s-i)*(e-s)+n}(u,n,s,r,a),14))==h&&(s<a&&u>=s&&u<=a||s>a&&u<=s&&u>=a)){c=-1;break}o<=h||n!=r&&(o<Math.min(n,r)||o>Math.max(n,r))||(s<a&&u>=s&&u<a||s>a&&u<s&&u>=a)&&++c}else if(u==s&&(n<=r&&h>=n&&h<=r||n>=r&&h<=n&&h>=r)){c=-1;break}return-1==c?1:!!(1&c)},intersects:function(e){var t=!1;if("OpenLayers.Geometry.Point"==e.CLASS_NAME)t=this.containsPoint(e);else if("OpenLayers.Geometry.LineString"==e.CLASS_NAME)t=e.intersects(this);else if("OpenLayers.Geometry.LinearRing"==e.CLASS_NAME)t=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[e]);else for(var i=0,n=e.components.length;i<n&&!(t=e.components[i].intersects(this));++i);return t},getVertices:function(e){return!0===e?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"}),OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],getArea:function(){var e=0;if(this.components&&this.components.length>0){e+=Math.abs(this.components[0].getArea());for(var t=1,i=this.components.length;t<i;t++)e-=Math.abs(this.components[t].getArea())}return e},getGeodesicArea:function(e){var t=0;if(this.components&&this.components.length>0){t+=Math.abs(this.components[0].getGeodesicArea(e));for(var i=1,n=this.components.length;i<n;i++)t-=Math.abs(this.components[i].getGeodesicArea(e))}return t},containsPoint:function(e){var t=this.components.length,i=!1;if(t>0&&1!==(i=this.components[0].containsPoint(e))&&i&&t>1)for(var n,s=1;s<t;++s)if(n=this.components[s].containsPoint(e)){i=1===n&&1;break}return i},intersects:function(e){var t,i,n=!1;if("OpenLayers.Geometry.Point"==e.CLASS_NAME)n=this.containsPoint(e);else if("OpenLayers.Geometry.LineString"==e.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==e.CLASS_NAME){for(t=0,i=this.components.length;t<i&&!(n=e.intersects(this.components[t]));++t);if(!n)for(t=0,i=e.components.length;t<i&&!(n=this.containsPoint(e.components[t]));++t);}else for(t=0,i=e.components.length;t<i&&!(n=this.intersects(e.components[t]));++t);if(!n&&"OpenLayers.Geometry.Polygon"==e.CLASS_NAME){var s=this.components[0];for(t=0,i=s.components.length;t<i&&!(n=e.containsPoint(s.components[t]));++t);}return n},distanceTo:function(e,t){return!!(t&&!1===t.edge)&&this.intersects(e)?0:OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[e,t])},CLASS_NAME:"OpenLayers.Geometry.Polygon"}),OpenLayers.Geometry.Polygon.createRegularPolygon=function(e,t,i,n){var s=Math.PI*(1/i-.5);n&&(s+=n/180*Math.PI);for(var r,a,o,l=[],h=0;h<i;++h)r=s+2*h*Math.PI/i,a=e.x+t*Math.cos(r),o=e.y+t*Math.sin(r),l.push(new OpenLayers.Geometry.Point(a,o));var u=new OpenLayers.Geometry.LinearRing(l);return new OpenLayers.Geometry.Polygon([u])},OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"}),OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.umn.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"features",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.opengis.net/gml",extractAttributes:!0,xy:!0,initialize:function(e){this.regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var t=this.getElementsByTagNameNS(e.documentElement,this.gmlns,this.featureName),i=[],n=0;n<t.length;n++){var s=this.parseFeature(t[n]);s&&i.push(s)}return i},parseFeature:function(e){for(var t,i,n,s,r=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],a=0;a<r.length;++a)if(t=r[a],(i=this.getElementsByTagNameNS(e,this.gmlns,t)).length>0){if(!(s=this.parseGeometry[t.toLowerCase()]))throw new TypeError("Unsupported geometry type: "+t);n=s.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&n.transform(this.externalProjection,this.internalProjection);break}var o,l=this.getElementsByTagNameNS(e,this.gmlns,"Box");for(a=0;a<l.length;++a){var h=l[a],u=this.parseGeometry.box.apply(this,[h]),p=h.parentNode;"boundedBy"===(p.localName||p.nodeName.split(":").pop())?o=u:n=u.toGeometry()}var c;this.extractAttributes&&(c=this.parseAttributes(e));var d=new OpenLayers.Feature.Vector(n,c);d.bounds=o,d.gml={featureType:e.firstChild.nodeName.split(":")[1],featureNS:e.firstChild.namespaceURI,featureNSPrefix:e.firstChild.prefix};for(var f,m=e.firstChild;m&&(1!=m.nodeType||!(f=m.getAttribute("fid")||m.getAttribute("id")));)m=m.nextSibling;return d.fid=f,d},parseGeometry:{point:function(e){var t,i=[];if((t=this.getElementsByTagNameNS(e,this.gmlns,"pos")).length>0&&(i=t[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),0==i.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,"coordinates")).length>0&&(i=t[0].firstChild.nodeValue.replace(this.regExes.removeSpace,"").split(",")),0==i.length&&(t=this.getElementsByTagNameNS(e,this.gmlns,"coord")).length>0){var n=this.getElementsByTagNameNS(t[0],this.gmlns,"X"),s=this.getElementsByTagNameNS(t[0],this.gmlns,"Y");n.length>0&&s.length>0&&(i=[n[0].firstChild.nodeValue,s[0].firstChild.nodeValue])}return 2==i.length&&(i[2]=null),this.xy?new OpenLayers.Geometry.Point(i[0],i[1],i[2]):new OpenLayers.Geometry.Point(i[1],i[0],i[2])},multipoint:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,"Point"),i=[];if(t.length>0)for(var n,s=0;s<t.length;++s)(n=this.parseGeometry.point.apply(this,[t[s]]))&&i.push(n);return new OpenLayers.Geometry.MultiPoint(i)},linestring:function(e,t){var i,n,s=[],r=[];if((i=this.getElementsByTagNameNS(e,this.gmlns,"posList")).length>0){s=(n=(n=this.getChildValue(i[0])).replace(this.regExes.trimSpace,"")).split(this.regExes.splitSpace);for(var a,o,l,h,u=parseInt(i[0].getAttribute("dimension")),p=0;p<s.length/u;++p)o=s[a=p*u],l=s[a+1],h=2==u?null:s[a+2],this.xy?r.push(new OpenLayers.Geometry.Point(o,l,h)):r.push(new OpenLayers.Geometry.Point(l,o,h))}if(0==s.length&&(i=this.getElementsByTagNameNS(e,this.gmlns,"coordinates")).length>0)for(var c=(n=(n=(n=this.getChildValue(i[0])).replace(this.regExes.trimSpace,"")).replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace),p=0;p<c.length;++p)2==(s=c[p].split(",")).length&&(s[2]=null),this.xy?r.push(new OpenLayers.Geometry.Point(s[0],s[1],s[2])):r.push(new OpenLayers.Geometry.Point(s[1],s[0],s[2]));var d=null;return 0!=r.length&&(d=t?new OpenLayers.Geometry.LinearRing(r):new OpenLayers.Geometry.LineString(r)),d},multilinestring:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,"LineString"),i=[];if(t.length>0)for(var n,s=0;s<t.length;++s)(n=this.parseGeometry.linestring.apply(this,[t[s]]))&&i.push(n);return new OpenLayers.Geometry.MultiLineString(i)},polygon:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,"LinearRing"),i=[];if(t.length>0)for(var n,s=0;s<t.length;++s)(n=this.parseGeometry.linestring.apply(this,[t[s],!0]))&&i.push(n);return new OpenLayers.Geometry.Polygon(i)},multipolygon:function(e){var t=this.getElementsByTagNameNS(e,this.gmlns,"Polygon"),i=[];if(t.length>0)for(var n,s=0;s<t.length;++s)(n=this.parseGeometry.polygon.apply(this,[t[s]]))&&i.push(n);return new OpenLayers.Geometry.MultiPolygon(i)},envelope:function(e){var t,i=[],n=this.getElementsByTagNameNS(e,this.gmlns,"lowerCorner");if(n.length>0){a=[];if(n.length>0&&(a=n[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),2==a.length&&(a[2]=null),this.xy)s=new OpenLayers.Geometry.Point(a[0],a[1],a[2]);else var s=new OpenLayers.Geometry.Point(a[1],a[0],a[2])}var r=this.getElementsByTagNameNS(e,this.gmlns,"upperCorner");if(r.length>0){var a=[];if(r.length>0&&(a=r[0].firstChild.nodeValue.replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace)),2==a.length&&(a[2]=null),this.xy)o=new OpenLayers.Geometry.Point(a[0],a[1],a[2]);else var o=new OpenLayers.Geometry.Point(a[1],a[0],a[2])}if(s&&o){i.push(new OpenLayers.Geometry.Point(s.x,s.y)),i.push(new OpenLayers.Geometry.Point(o.x,s.y)),i.push(new OpenLayers.Geometry.Point(o.x,o.y)),i.push(new OpenLayers.Geometry.Point(s.x,o.y)),i.push(new OpenLayers.Geometry.Point(s.x,s.y));var l=new OpenLayers.Geometry.LinearRing(i);t=new OpenLayers.Geometry.Polygon([l])}return t},box:function(e){var t,i=this.getElementsByTagNameNS(e,this.gmlns,"coordinates"),n=null,s=null;if(i.length>0&&2==(t=i[0].firstChild.nodeValue.split(" ")).length&&(n=t[0].split(","),s=t[1].split(",")),null!==n&&null!==s)return new OpenLayers.Bounds(parseFloat(n[0]),parseFloat(n[1]),parseFloat(s[0]),parseFloat(s[1]))}},parseAttributes:function(e){for(var t,i,n,s,r,a,o,l={},h=e.firstChild;h;){if(1==h.nodeType){for(t=h.childNodes,i=0;i<t.length;++i)1==(n=t[i]).nodeType&&(1==(s=n.childNodes).length?3!=(r=s[0]).nodeType&&4!=r.nodeType||(a=n.prefix?n.nodeName.split(":")[1]:n.nodeName,o=r.nodeValue.replace(this.regExes.trimSpace,""),l[a]=o):l[n.nodeName.split(":").pop()]=null);break}h=h.nextSibling}return l},write:function(e){OpenLayers.Util.isArray(e)||(e=[e]);for(var t=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName),i=0;i<e.length;i++)t.appendChild(this.createFeatureXML(e[i]));return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(e){var t=e.geometry,i=this.buildGeometryNode(t),n=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);n.appendChild(i);var s=this.createElementNS(this.gmlns,"gml:"+this.featureName),r=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName),a=e.fid||e.id;r.setAttribute("fid",a),r.appendChild(n);for(var o in e.attributes){var l=this.createTextNode(e.attributes[o]),h=o.substring(o.lastIndexOf(":")+1),u=this.createElementNS(this.featureNS,this.featurePrefix+":"+h);u.appendChild(l),r.appendChild(u)}return s.appendChild(r),s},buildGeometryNode:function(e){this.externalProjection&&this.internalProjection&&(e=e.clone()).transform(this.internalProjection,this.externalProjection);var t=e.CLASS_NAME,i=t.substring(t.lastIndexOf(".")+1);return this.buildGeometry[i.toLowerCase()].apply(this,[e])},buildGeometry:{point:function(e){var t=this.createElementNS(this.gmlns,"gml:Point");return t.appendChild(this.buildCoordinatesNode(e)),t},multipoint:function(e){for(var t,i,n=this.createElementNS(this.gmlns,"gml:MultiPoint"),s=e.components,r=0;r<s.length;r++)t=this.createElementNS(this.gmlns,"gml:pointMember"),i=this.buildGeometry.point.apply(this,[s[r]]),t.appendChild(i),n.appendChild(t);return n},linestring:function(e){var t=this.createElementNS(this.gmlns,"gml:LineString");return t.appendChild(this.buildCoordinatesNode(e)),t},multilinestring:function(e){for(var t,i,n=this.createElementNS(this.gmlns,"gml:MultiLineString"),s=e.components,r=0;r<s.length;++r)t=this.createElementNS(this.gmlns,"gml:lineStringMember"),i=this.buildGeometry.linestring.apply(this,[s[r]]),t.appendChild(i),n.appendChild(t);return n},linearring:function(e){var t=this.createElementNS(this.gmlns,"gml:LinearRing");return t.appendChild(this.buildCoordinatesNode(e)),t},polygon:function(e){for(var t,i,n,s=this.createElementNS(this.gmlns,"gml:Polygon"),r=e.components,a=0;a<r.length;++a)n=0==a?"outerBoundaryIs":"innerBoundaryIs",t=this.createElementNS(this.gmlns,"gml:"+n),i=this.buildGeometry.linearring.apply(this,[r[a]]),t.appendChild(i),s.appendChild(t);return s},multipolygon:function(e){for(var t,i,n=this.createElementNS(this.gmlns,"gml:MultiPolygon"),s=e.components,r=0;r<s.length;++r)t=this.createElementNS(this.gmlns,"gml:polygonMember"),i=this.buildGeometry.polygon.apply(this,[s[r]]),t.appendChild(i),n.appendChild(t);return n},bounds:function(e){var t=this.createElementNS(this.gmlns,"gml:Box");return t.appendChild(this.buildCoordinatesNode(e)),t}},buildCoordinatesNode:function(e){var t=this.createElementNS(this.gmlns,"gml:coordinates");t.setAttribute("decimal","."),t.setAttribute("cs",","),t.setAttribute("ts"," ");var i=[];if(e instanceof OpenLayers.Bounds)i.push(e.left+","+e.bottom),i.push(e.right+","+e.top);else for(var n=e.components?e.components:[e],s=0;s<n.length;s++)i.push(n[s].x+","+n[s].y);var r=this.createTextNode(i.join(" "));return t.appendChild(r),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(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.setGeometryTypes(),e&&e.featureNS&&this.setNamespace("feature",e.featureNS),this.singleFeatureType=!e||"string"==typeof e.featureType},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t=[];if(this.readNode(e,{features:t},!0),0==t.length){var i=this.getElementsByTagNameNS(e,this.namespaces.gml,"featureMember");if(i.length)for(var n=0,s=i.length;n<s;++n)this.readNode(i[n],{features:t},!0);else(i=this.getElementsByTagNameNS(e,this.namespaces.gml,"featureMembers")).length&&this.readNode(i[0],{features:t},!0)}return t},readNode:function(e,t,i){return!0===i&&!0===this.autoConfig&&(this.featureType=null,delete this.namespaceAlias[this.featureNS],delete this.namespaces.feature,this.featureNS=null),this.featureNS||e.prefix in this.namespaces||e.parentNode.namespaceURI!=this.namespaces.gml||!this.regExes.featureMember.test(e.parentNode.nodeName)||(this.featureType=e.nodeName.split(":").pop(),this.setNamespace("feature",e.namespaceURI),this.featureNS=e.namespaceURI,this.autoConfig=!0),OpenLayers.Format.XML.prototype.readNode.apply(this,[e,t])},readers:{gml:{_inherit:function(e,t,i){},featureMember:function(e,t){this.readChildNodes(e,t)},featureMembers:function(e,t){this.readChildNodes(e,t)},name:function(e,t){t.name=this.getChildValue(e)},boundedBy:function(e,t){var i={};this.readChildNodes(e,i),i.components&&i.components.length>0&&(t.bounds=i.components[0])},Point:function(e,t){var i={points:[]};this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(i.points[0])},coordinates:function(e,t){for(var i,n=this.getChildValue(e).replace(this.regExes.trimSpace,""),s=(n=n.replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace),r=s.length,a=new Array(r),o=0;o<r;++o)i=s[o].split(","),this.xy?a[o]=new OpenLayers.Geometry.Point(i[0],i[1],i[2]):a[o]=new OpenLayers.Geometry.Point(i[1],i[0],i[2]);t.points=a},coord:function(e,t){var i={};this.readChildNodes(e,i),t.points||(t.points=[]),t.points.push(new OpenLayers.Geometry.Point(i.x,i.y,i.z))},X:function(e,t){t.x=this.getChildValue(e)},Y:function(e,t){t.y=this.getChildValue(e)},Z:function(e,t){t.z=this.getChildValue(e)},MultiPoint:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.MultiPoint(i.components)]},pointMember:function(e,t){this.readChildNodes(e,t)},LineString:function(e,t){var i={};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.LineString(i.points))},MultiLineString:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.MultiLineString(i.components)]},lineStringMember:function(e,t){this.readChildNodes(e,t)},Polygon:function(e,t){var i={outer:null,inner:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),i.inner.unshift(i.outer),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.Polygon(i.inner))},LinearRing:function(e,t){var i={};this.readers.gml._inherit.apply(this,[e,i]),this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.LinearRing(i.points)]},MultiPolygon:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)]},polygonMember:function(e,t){this.readChildNodes(e,t)},GeometryCollection:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),t.components=[new OpenLayers.Geometry.Collection(i.components)]},geometryMember:function(e,t){this.readChildNodes(e,t)}},feature:{"*":function(e,t){var i,n=e.localName||e.nodeName.split(":").pop();t.features?this.singleFeatureType||-1===OpenLayers.Util.indexOf(this.featureType,n)?n===this.featureType&&(i="_typeName"):i="_typeName":0==e.childNodes.length||1==e.childNodes.length&&3==e.firstChild.nodeType?this.extractAttributes&&(i="_attribute"):i="_geometry",i&&this.readers.feature[i].apply(this,[e,t])},_typeName:function(e,t){var i={components:[],attributes:{}};this.readChildNodes(e,i),i.name&&(i.attributes.name=i.name);var n=new OpenLayers.Feature.Vector(i.components[0],i.attributes);this.singleFeatureType||(n.type=e.nodeName.split(":").pop(),n.namespace=e.namespaceURI);var s=e.getAttribute("fid")||this.getAttributeNS(e,this.namespaces.gml,"id");s&&(n.fid=s),this.internalProjection&&this.externalProjection&&n.geometry&&n.geometry.transform(this.externalProjection,this.internalProjection),i.bounds&&(n.bounds=i.bounds),t.features.push(n)},_geometry:function(e,t){this.geometryName||(this.geometryName=e.nodeName.split(":").pop()),this.readChildNodes(e,t)},_attribute:function(e,t){var i=e.localName||e.nodeName.split(":").pop(),n=this.getChildValue(e);t.attributes[i]=n}},wfs:{FeatureCollection:function(e,t){this.readChildNodes(e,t)}}},write:function(e){var t;t=OpenLayers.Util.isArray(e)?"featureMembers":"featureMember";var i=this.writeNode("gml:"+t,e);return this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{gml:{featureMember:function(e){var t=this.createElementNSPlus("gml:featureMember");return this.writeNode("feature:_typeName",e,t),t},MultiPoint:function(e){for(var t=this.createElementNSPlus("gml:MultiPoint"),i=e.components||[e],n=0,s=i.length;n<s;++n)this.writeNode("pointMember",i[n],t);return t},pointMember:function(e){var t=this.createElementNSPlus("gml:pointMember");return this.writeNode("Point",e,t),t},MultiLineString:function(e){for(var t=this.createElementNSPlus("gml:MultiLineString"),i=e.components||[e],n=0,s=i.length;n<s;++n)this.writeNode("lineStringMember",i[n],t);return t},lineStringMember:function(e){var t=this.createElementNSPlus("gml:lineStringMember");return this.writeNode("LineString",e,t),t},MultiPolygon:function(e){for(var t=this.createElementNSPlus("gml:MultiPolygon"),i=e.components||[e],n=0,s=i.length;n<s;++n)this.writeNode("polygonMember",i[n],t);return t},polygonMember:function(e){var t=this.createElementNSPlus("gml:polygonMember");return this.writeNode("Polygon",e,t),t},GeometryCollection:function(e){for(var t=this.createElementNSPlus("gml:GeometryCollection"),i=0,n=e.components.length;i<n;++i)this.writeNode("geometryMember",e.components[i],t);return t},geometryMember:function(e){var t=this.createElementNSPlus("gml:geometryMember"),i=this.writeNode("feature:_geometry",e);return t.appendChild(i.firstChild),t}},feature:{_typeName:function(e){var t=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:e.fid}});e.geometry&&this.writeNode("feature:_geometry",e.geometry,t);for(var i in e.attributes){var n=e.attributes[i];null!=n&&this.writeNode("feature:_attribute",{name:i,value:n},t)}return t},_geometry:function(e){this.externalProjection&&this.internalProjection&&(e=e.clone().transform(this.internalProjection,this.externalProjection));var t=this.createElementNSPlus("feature:"+this.geometryName),i=this.geometryTypes[e.CLASS_NAME],n=this.writeNode("gml:"+i,e,t);return this.srsName&&n.setAttribute("srsName",this.srsName),t},_attribute:function(e){return this.createElementNSPlus("feature:"+e.name,{value:e.value})}},wfs:{FeatureCollection:function(e){for(var t=this.createElementNSPlus("wfs:FeatureCollection"),i=0,n=e.length;i<n;++i)this.writeNode("gml:featureMember",e[i],t);return t}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"}),OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:!1,multiCurve:!0,surface:!1,multiSurface:!0,initialize:function(e){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[e])},readers:{gml:OpenLayers.Util.applyDefaults({_inherit:function(e,t,i){var n=parseInt(e.getAttribute("srsDimension"),10)||i&&i.srsDimension;n&&(t.srsDimension=n)},featureMembers:function(e,t){this.readChildNodes(e,t)},Curve:function(e,t){var i={points:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),t.components||(t.components=[]),t.components.push(new OpenLayers.Geometry.LineString(i.points))},segments:function(e,t){this.readChildNodes(e,t)},LineStringSegment:function(e,t){var i={};this.readChildNodes(e,i),i.points&&Array.prototype.push.apply(t.points,i.points)},pos:function(e,t){var i,n=this.getChildValue(e).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace);i=this.xy?new OpenLayers.Geometry.Point(n[0],n[1],n[2]):new OpenLayers.Geometry.Point(n[1],n[0],n[2]),t.points=[i]},posList:function(e,t){for(var i,n,s,r=this.getChildValue(e).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace),a=t.srsDimension||parseInt(e.getAttribute("srsDimension")||e.getAttribute("dimension"),10)||2,o=r.length/a,l=new Array(o),h=0,u=r.length;h<u;h+=a)i=r[h],n=r[h+1],s=2==a?void 0:r[h+2],this.xy?l[h/a]=new OpenLayers.Geometry.Point(i,n,s):l[h/a]=new OpenLayers.Geometry.Point(n,i,s);t.points=l},Surface:function(e,t){this.readChildNodes(e,t)},patches:function(e,t){this.readChildNodes(e,t)},PolygonPatch:function(e,t){this.readers.gml.Polygon.apply(this,[e,t])},exterior:function(e,t){var i={};this.readChildNodes(e,i),t.outer=i.components[0]},interior:function(e,t){var i={};this.readChildNodes(e,i),t.inner.push(i.components[0])},MultiCurve:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),i.components.length>0&&(t.components=[new OpenLayers.Geometry.MultiLineString(i.components)])},curveMember:function(e,t){this.readChildNodes(e,t)},MultiSurface:function(e,t){var i={components:[]};this.readers.gml._inherit.apply(this,[e,i,t]),this.readChildNodes(e,i),i.components.length>0&&(t.components=[new OpenLayers.Geometry.MultiPolygon(i.components)])},surfaceMember:function(e,t){this.readChildNodes(e,t)},surfaceMembers:function(e,t){this.readChildNodes(e,t)},pointMembers:function(e,t){this.readChildNodes(e,t)},lineStringMembers:function(e,t){this.readChildNodes(e,t)},polygonMembers:function(e,t){this.readChildNodes(e,t)},geometryMembers:function(e,t){this.readChildNodes(e,t)},Envelope:function(e,t){var i={points:new Array(2)};this.readChildNodes(e,i),t.components||(t.components=[]);var n=i.points[0],s=i.points[1];t.components.push(new OpenLayers.Bounds(n.x,n.y,s.x,s.y))},lowerCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[0]=i.points[0]},upperCorner:function(e,t){var i={};this.readers.gml.pos.apply(this,[e,i]),t.points[1]=i.points[0]}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(e){var t;t=OpenLayers.Util.isArray(e)?"featureMembers":"featureMember";var i=this.writeNode("gml:"+t,e);return this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(e){for(var t=this.createElementNSPlus("gml:featureMembers"),i=0,n=e.length;i<n;++i)this.writeNode("feature:_typeName",e[i],t);return t},Point:function(e){var t=this.createElementNSPlus("gml:Point");return this.writeNode("pos",e,t),t},pos:function(e){var t=this.xy?e.x+" "+e.y:e.y+" "+e.x;return this.createElementNSPlus("gml:pos",{value:t})},LineString:function(e){var t=this.createElementNSPlus("gml:LineString");return this.writeNode("posList",e.components,t),t},Curve:function(e){var t=this.createElementNSPlus("gml:Curve");return this.writeNode("segments",e,t),t},segments:function(e){var t=this.createElementNSPlus("gml:segments");return this.writeNode("LineStringSegment",e,t),t},LineStringSegment:function(e){var t=this.createElementNSPlus("gml:LineStringSegment");return this.writeNode("posList",e.components,t),t},posList:function(e){for(var t,i=e.length,n=new Array(i),s=0;s<i;++s)t=e[s],this.xy?n[s]=t.x+" "+t.y:n[s]=t.y+" "+t.x;return this.createElementNSPlus("gml:posList",{value:n.join(" ")})},Surface:function(e){var t=this.createElementNSPlus("gml:Surface");return this.writeNode("patches",e,t),t},patches:function(e){var t=this.createElementNSPlus("gml:patches");return this.writeNode("PolygonPatch",e,t),t},PolygonPatch:function(e){var t=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",e.components[0],t);for(var i=1,n=e.components.length;i<n;++i)this.writeNode("interior",e.components[i],t);return t},Polygon:function(e){var t=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",e.components[0],t);for(var i=1,n=e.components.length;i<n;++i)this.writeNode("interior",e.components[i],t);return t},exterior:function(e){var t=this.createElementNSPlus("gml:exterior");return this.writeNode("LinearRing",e,t),t},interior:function(e){var t=this.createElementNSPlus("gml:interior");return this.writeNode("LinearRing",e,t),t},LinearRing:function(e){var t=this.createElementNSPlus("gml:LinearRing");return this.writeNode("posList",e.components,t),t},MultiCurve:function(e){for(var t=this.createElementNSPlus("gml:MultiCurve"),i=e.components||[e],n=0,s=i.length;n<s;++n)this.writeNode("curveMember",i[n],t);return t},curveMember:function(e){var t=this.createElementNSPlus("gml:curveMember");return this.curve?this.writeNode("Curve",e,t):this.writeNode("LineString",e,t),t},MultiSurface:function(e){for(var t=this.createElementNSPlus("gml:MultiSurface"),i=e.components||[e],n=0,s=i.length;n<s;++n)this.writeNode("surfaceMember",i[n],t);return t},surfaceMember:function(e){var t=this.createElementNSPlus("gml:surfaceMember");return this.surface?this.writeNode("Surface",e,t):this.writeNode("Polygon",e,t),t},Envelope:function(e){var t=this.createElementNSPlus("gml:Envelope");return this.writeNode("lowerCorner",e,t),this.writeNode("upperCorner",e,t),this.srsName&&t.setAttribute("srsName",this.srsName),t},lowerCorner:function(e){var t=this.xy?e.left+" "+e.bottom:e.bottom+" "+e.left;return this.createElementNSPlus("gml:lowerCorner",{value:t})},upperCorner:function(e){var t=this.xy?e.right+" "+e.top:e.top+" "+e.right;return this.createElementNSPlus("gml:upperCorner",{value:t})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":!0===this.curve?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":!1===this.multiCurve?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":!0===this.surface?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":!1===this.multiSurface?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"}),OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(e){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[e])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=e.getAttribute("matchCase"),n=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(e,n),t.filters.push(n)},PropertyIsNotEqualTo:function(e,t){var i=e.getAttribute("matchCase"),n=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!("false"===i||"0"===i)});this.readChildNodes(e,n),t.filters.push(n)},PropertyIsLike:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(e,i);var n=e.getAttribute("wildCard"),s=e.getAttribute("singleChar"),r=e.getAttribute("escapeChar");i.value2regex(n,s,r),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(e){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:e.matchCase}});return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:e.matchCase}});return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsLike:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{matchCase:e.matchCase,wildCard:"*",singleChar:".",escapeChar:"!"}});return this.writeNode("PropertyName",e,t),this.writeNode("Literal",e.regex2value(),t),t},BBOX:function(e){var t=this.createElementNSPlus("ogc:BBOX");e.property&&this.writeNode("PropertyName",e,t);var i=this.writeNode("gml:Envelope",e.value);return e.projection&&i.setAttribute("srsName",e.projection),t.appendChild(i),t},SortBy:function(e){for(var t=this.createElementNSPlus("ogc:SortBy"),i=0,n=e.length;i<n;i++)this.writeNode("ogc:SortProperty",e[i],t);return t},SortProperty:function(e){var t=this.createElementNSPlus("ogc:SortProperty");return this.writeNode("ogc:PropertyName",e,t),this.writeNode("ogc:SortOrder","DESC"==e.order?"DESC":"ASC",t),t},SortOrder:function(e){return this.createElementNSPlus("ogc:SortOrder",{value:e})}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature},writeSpatial:function(e,t){var i=this.createElementNSPlus("ogc:"+t);if(this.writeNode("PropertyName",e,i),e.value instanceof OpenLayers.Filter.Function)this.writeNode("Function",e.value,i);else{var n;n=e.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",e.value).firstChild:this.writeNode("gml:Envelope",e.value),e.projection&&n.setAttribute("srsName",e.projection),i.appendChild(n)}return i},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"}),OpenLayers.Format.OWSCommon=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",getVersion:function(e,t){var i=this.version;if(!i){var n=e.getAttribute("xmlns:ows");n&&"1.1"===n.substring(n.lastIndexOf("/")+1)&&(i="1.1.0"),i||(i=this.defaultVersion)}return i},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(e,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i={};return this.readChildNodes(e,i),i},readers:{ows:{Exception:function(e,t){var i={code:e.getAttribute("exceptionCode"),locator:e.getAttribute("locator"),texts:[]};t.exceptions.push(i),this.readChildNodes(e,i)},ExceptionText:function(e,t){var i=this.getChildValue(e);t.texts.push(i)},ServiceIdentification:function(e,t){t.serviceIdentification={},this.readChildNodes(e,t.serviceIdentification)},Title:function(e,t){t.title=this.getChildValue(e)},Abstract:function(e,t){t.abstract=this.getChildValue(e)},Keywords:function(e,t){t.keywords={},this.readChildNodes(e,t.keywords)},Keyword:function(e,t){t[this.getChildValue(e)]=!0},ServiceType:function(e,t){t.serviceType={codeSpace:e.getAttribute("codeSpace"),value:this.getChildValue(e)}},ServiceTypeVersion:function(e,t){t.serviceTypeVersion=this.getChildValue(e)},Fees:function(e,t){t.fees=this.getChildValue(e)},AccessConstraints:function(e,t){t.accessConstraints=this.getChildValue(e)},ServiceProvider:function(e,t){t.serviceProvider={},this.readChildNodes(e,t.serviceProvider)},ProviderName:function(e,t){t.providerName=this.getChildValue(e)},ProviderSite:function(e,t){t.providerSite=this.getAttributeNS(e,this.namespaces.xlink,"href")},ServiceContact:function(e,t){t.serviceContact={},this.readChildNodes(e,t.serviceContact)},IndividualName:function(e,t){t.individualName=this.getChildValue(e)},PositionName:function(e,t){t.positionName=this.getChildValue(e)},ContactInfo:function(e,t){t.contactInfo={},this.readChildNodes(e,t.contactInfo)},Phone:function(e,t){t.phone={},this.readChildNodes(e,t.phone)},Voice:function(e,t){t.voice=this.getChildValue(e)},Address:function(e,t){t.address={},this.readChildNodes(e,t.address)},DeliveryPoint:function(e,t){t.deliveryPoint=this.getChildValue(e)},City:function(e,t){t.city=this.getChildValue(e)},AdministrativeArea:function(e,t){t.administrativeArea=this.getChildValue(e)},PostalCode:function(e,t){t.postalCode=this.getChildValue(e)},Country:function(e,t){t.country=this.getChildValue(e)},ElectronicMailAddress:function(e,t){t.electronicMailAddress=this.getChildValue(e)},Role:function(e,t){t.role=this.getChildValue(e)},OperationsMetadata:function(e,t){t.operationsMetadata={},this.readChildNodes(e,t.operationsMetadata)},Operation:function(e,t){var i=e.getAttribute("name");t[i]={},this.readChildNodes(e,t[i])},DCP:function(e,t){t.dcp={},this.readChildNodes(e,t.dcp)},HTTP:function(e,t){t.http={},this.readChildNodes(e,t.http)},Get:function(e,t){t.get||(t.get=[]);var i={url:this.getAttributeNS(e,this.namespaces.xlink,"href")};this.readChildNodes(e,i),t.get.push(i)},Post:function(e,t){t.post||(t.post=[]);var i={url:this.getAttributeNS(e,this.namespaces.xlink,"href")};this.readChildNodes(e,i),t.post.push(i)},Parameter:function(e,t){t.parameters||(t.parameters={});var i=e.getAttribute("name");t.parameters[i]={},this.readChildNodes(e,t.parameters[i])},Constraint:function(e,t){t.constraints||(t.constraints={});var i=e.getAttribute("name");t.constraints[i]={},this.readChildNodes(e,t.constraints[i])},Value:function(e,t){t[this.getChildValue(e)]=!0},OutputFormat:function(e,t){t.formats.push({value:this.getChildValue(e)}),this.readChildNodes(e,t)},WGS84BoundingBox:function(e,t){var i={};i.crs=e.getAttribute("crs"),t.BoundingBox?t.BoundingBox.push(i):(t.projection=i.crs,i=t),this.readChildNodes(e,i)},BoundingBox:function(e,t){this.readers.ows.WGS84BoundingBox.apply(this,[e,t])},LowerCorner:function(e,t){var i=this.getChildValue(e).replace(this.regExes.trimSpace,""),n=(i=i.replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace);t.left=n[0],t.bottom=n[1]},UpperCorner:function(e,t){var i=this.getChildValue(e).replace(this.regExes.trimSpace,""),n=(i=i.replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace);t.right=n[0],t.top=n[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(e,t){t.language=this.getChildValue(e)}}},writers:{ows:{BoundingBox:function(e,t){var i=this.createElementNSPlus(t||"ows:BoundingBox",{attributes:{crs:e.projection}});return this.writeNode("ows:LowerCorner",e,i),this.writeNode("ows:UpperCorner",e,i),i},LowerCorner:function(e){return this.createElementNSPlus("ows:LowerCorner",{value:e.bounds.left+" "+e.bounds.bottom})},UpperCorner:function(e){return this.createElementNSPlus("ows:UpperCorner",{value:e.bounds.right+" "+e.bounds.top})},Identifier:function(e){return this.createElementNSPlus("ows:Identifier",{value:e})},Title:function(e){return this.createElementNSPlus("ows:Title",{value:e})},Abstract:function(e){return this.createElementNSPlus("ows:Abstract",{value:e})},OutputFormat:function(e){return this.createElementNSPlus("ows:OutputFormat",{value:e})}}},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(e,t){t.success=!1,t.exceptionReport={version:e.getAttribute("version"),language:e.getAttribute("language"),exceptions:[]},this.readChildNodes(e,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(e){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[e]),OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[e])},readNode:function(e,t,i){return OpenLayers.Format.GML.v3.prototype.readNode.apply(this,arguments)},readers:{wfs:OpenLayers.Util.applyDefaults({FeatureCollection:function(e,t){t.numberOfFeatures=parseInt(e.getAttribute("numberOfFeatures")),OpenLayers.Format.WFST.v1.prototype.readers.wfs.FeatureCollection.apply(this,arguments)},TransactionResponse:function(e,t){t.insertIds=[],t.success=!1,this.readChildNodes(e,t)},TransactionSummary:function(e,t){t.success=!0},InsertResults:function(e,t){this.readChildNodes(e,t)},Feature:function(e,t){var i={fids:[]};this.readChildNodes(e,i),t.insertIds.push(i.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc,ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows},writers:{wfs:OpenLayers.Util.applyDefaults({GetFeature:function(e){var t=OpenLayers.Format.WFST.v1.prototype.writers.wfs.GetFeature.apply(this,arguments);return e&&this.setAttributes(t,{resultType:e.resultType,startIndex:e.startIndex,count:e.count}),t},Query:function(e){var t=(e=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},e)).featurePrefix,i=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(t?t+":":"")+e.featureType,srsName:e.srsName}});if(e.featureNS&&i.setAttribute("xmlns:"+t,e.featureNS),e.propertyNames)for(var n=0,s=e.propertyNames.length;n<s;n++)this.writeNode("wfs:PropertyName",{property:e.propertyNames[n]},i);return e.filter&&(OpenLayers.Format.WFST.v1_1_0.prototype.setFilterProperty.call(this,e.filter),this.writeNode("ogc:Filter",e.filter,i)),i},PropertyName:function(e){return this.createElementNSPlus("wfs:PropertyName",{value:e.property})}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_1_0"}),OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:!0,defaultFilter:null,initialize:function(e){e=e||{},OpenLayers.Util.extend(this,e),this.options=e},mergeWithDefaultFilter:function(e){return e&&this.defaultFilter?new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,e]}):e||this.defaultFilter||void 0},destroy:function(){this.options=null,this.format=null},read:function(e){(e=e||{}).filter=this.mergeWithDefaultFilter(e.filter)},create:function(){},update:function(){},delete:function(){},commit:function(){},abort:function(e){},createCallback:function(e,t,i){return OpenLayers.Function.bind(function(){e.apply(this,[t,i])},this)},CLASS_NAME:"OpenLayers.Protocol"}),OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:!0,features:null,data:null,reqFeatures:null,priv:null,error:null,initialize:function(e){OpenLayers.Util.extend(this,e)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"}),OpenLayers.Protocol.Response.SUCCESS=1,OpenLayers.Protocol.Response.FAILURE=0,OpenLayers.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(e,t){if(t&&"object"==typeof t)for(var i in t)t.hasOwnProperty(i)&&(t[i]=walk(i,t[i]));return filter(e,t)}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(e,t){this.pretty=!!t;var i=null,n=typeof e;if(this.serialize[n])try{i=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[n].apply(this,[e])}catch(e){OpenLayers.Console.error("Trouble serializing: "+e)}return i},writeIndent:function(){var e=[];if(this.pretty)for(var t=0;t<this.level;++t)e.push(this.indent);return e.join("")},writeNewline:function(){return this.pretty?this.newline:""},writeSpace:function(){return this.pretty?this.space:""},serialize:{object:function(e){if(null==e)return"null";if(e.constructor==Date)return this.serialize.date.apply(this,[e]);if(e.constructor==Array)return this.serialize.array.apply(this,[e]);var t=["{"];this.level+=1;var i,n,s,r=!1;for(i in e)e.hasOwnProperty(i)&&(n=OpenLayers.Format.JSON.prototype.write.apply(this,[i,this.pretty]),s=OpenLayers.Format.JSON.prototype.write.apply(this,[e[i],this.pretty]),null!=n&&null!=s&&(r&&t.push(","),t.push(this.writeNewline(),this.writeIndent(),n,":",this.writeSpace(),s),r=!0));return this.level-=1,t.push(this.writeNewline(),this.writeIndent(),"}"),t.join("")},array:function(e){var t,i=["["];this.level+=1;for(var n=0,s=e.length;n<s;++n)null!=(t=OpenLayers.Format.JSON.prototype.write.apply(this,[e[n],this.pretty]))&&(n>0&&i.push(","),i.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,i.push(this.writeNewline(),this.writeIndent(),"]"),i.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,function(e,i){var n=t[i];return n||(n=i.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"}),OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:!1,read:function(e,t,i){t=t||"FeatureCollection";var n=null,s=null;if(s="string"==typeof e?OpenLayers.Format.JSON.prototype.read.apply(this,[e,i]):e){if("string"!=typeof s.type)OpenLayers.Console.error("Bad GeoJSON - no type: "+e);else if(this.isValidType(s,t))switch(t){case"Geometry":try{n=this.parseGeometry(s)}catch(e){OpenLayers.Console.error(e)}break;case"Feature":try{(n=this.parseFeature(s)).type="Feature"}catch(e){OpenLayers.Console.error(e)}break;case"FeatureCollection":switch(n=[],s.type){case"Feature":try{n.push(this.parseFeature(s))}catch(e){n=null,OpenLayers.Console.error(e)}break;case"FeatureCollection":for(var r=0,a=s.features.length;r<a;++r)try{n.push(this.parseFeature(s.features[r]))}catch(e){n=null,OpenLayers.Console.error(e)}break;default:try{var o=this.parseGeometry(s);n.push(new OpenLayers.Feature.Vector(o))}catch(e){n=null,OpenLayers.Console.error(e)}}}}else OpenLayers.Console.error("Bad JSON: "+e);return n},isValidType:function(e,t){var i=!1;switch(t){case"Geometry":-1==OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],e.type)?OpenLayers.Console.error("Unsupported geometry type: "+e.type):i=!0;break;case"FeatureCollection":i=!0;break;default:e.type==t?i=!0:OpenLayers.Console.error("Cannot convert types from "+e.type+" to "+t)}return i},parseFeature:function(e){var t,i,n,s;n=e.properties?e.properties:{},s=e.geometry&&e.geometry.bbox||e.bbox;try{i=this.parseGeometry(e.geometry)}catch(e){throw e}return t=new OpenLayers.Feature.Vector(i,n),s&&(t.bounds=OpenLayers.Bounds.fromArray(s)),e.id&&(t.fid=e.id),t},parseGeometry:function(e){if(null==e)return null;var t,i=!1;if("GeometryCollection"==e.type){if(!OpenLayers.Util.isArray(e.geometries))throw"GeometryCollection must have geometries array: "+e;for(var n=e.geometries.length,s=new Array(n),r=0;r<n;++r)s[r]=this.parseGeometry.apply(this,[e.geometries[r]]);t=new OpenLayers.Geometry.Collection(s),i=!0}else{if(!OpenLayers.Util.isArray(e.coordinates))throw"Geometry must have coordinates array: "+e;if(!this.parseCoords[e.type.toLowerCase()])throw"Unsupported geometry type: "+e.type;try{t=this.parseCoords[e.type.toLowerCase()].apply(this,[e.coordinates])}catch(e){throw e}}return this.internalProjection&&this.externalProjection&&!i&&t.transform(this.externalProjection,this.internalProjection),t},parseCoords:{point:function(e){if(0==this.ignoreExtraDims&&2!=e.length)throw"Only 2D points are supported: "+e;return new OpenLayers.Geometry.Point(e[0],e[1])},multipoint:function(e){for(var t=[],i=null,n=0,s=e.length;n<s;++n){try{i=this.parseCoords.point.apply(this,[e[n]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.MultiPoint(t)},linestring:function(e){for(var t=[],i=null,n=0,s=e.length;n<s;++n){try{i=this.parseCoords.point.apply(this,[e[n]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.LineString(t)},multilinestring:function(e){for(var t=[],i=null,n=0,s=e.length;n<s;++n){try{i=this.parseCoords.linestring.apply(this,[e[n]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.MultiLineString(t)},polygon:function(e){for(var t,i,n=[],s=0,r=e.length;s<r;++s){try{i=this.parseCoords.linestring.apply(this,[e[s]])}catch(e){throw e}t=new OpenLayers.Geometry.LinearRing(i.components),n.push(t)}return new OpenLayers.Geometry.Polygon(n)},multipolygon:function(e){for(var t=[],i=null,n=0,s=e.length;n<s;++n){try{i=this.parseCoords.polygon.apply(this,[e[n]])}catch(e){throw e}t.push(i)}return new OpenLayers.Geometry.MultiPolygon(t)},box:function(e){if(2!=e.length)throw"GeoJSON box coordinates must have 2 elements";return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(e[0][0],e[0][1]),new OpenLayers.Geometry.Point(e[1][0],e[0][1]),new OpenLayers.Geometry.Point(e[1][0],e[1][1]),new OpenLayers.Geometry.Point(e[0][0],e[1][1]),new OpenLayers.Geometry.Point(e[0][0],e[0][1])])])}},write:function(e,t){var i={type:null};if(OpenLayers.Util.isArray(e)){i.type="FeatureCollection";var n=e.length;i.features=new Array(n);for(var s=0;s<n;++s){var r=e[s];if(!r instanceof OpenLayers.Feature.Vector)throw"FeatureCollection only supports collections of features: "+r;i.features[s]=this.extract.feature.apply(this,[r])}}else 0==e.CLASS_NAME.indexOf("OpenLayers.Geometry")?i=this.extract.geometry.apply(this,[e]):e instanceof OpenLayers.Feature.Vector&&(i=this.extract.feature.apply(this,[e]),e.layer&&e.layer.projection&&(i.crs=this.createCRSObject(e)));return OpenLayers.Format.JSON.prototype.write.apply(this,[i,t])},createCRSObject:function(e){var t=e.layer.projection.toString(),i={};if(t.match(/epsg:/i)){var n=parseInt(t.substring(t.indexOf(":")+1));i=4326==n?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+n}}}return i},extract:{feature:function(e){var t=this.extract.geometry.apply(this,[e.geometry]),i={type:"Feature",properties:e.attributes,geometry:t};return null!=e.fid&&(i.id=e.fid),i},geometry:function(e){if(null==e)return null;this.internalProjection&&this.externalProjection&&(e=e.clone()).transform(this.internalProjection,this.externalProjection);var t=e.CLASS_NAME.split(".")[2],i=this.extract[t.toLowerCase()].apply(this,[e]);return"Collection"==t?{type:"GeometryCollection",geometries:i}:{type:t,coordinates:i}},point:function(e){return[e.x,e.y]},multipoint:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t},linestring:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t},multilinestring:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push(this.extract.linestring.apply(this,[e.components[i]]));return t},polygon:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push(this.extract.linestring.apply(this,[e.components[i]]));return t},multipolygon:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push(this.extract.polygon.apply(this,[e.components[i]]));return t},collection:function(e){for(var t=e.components.length,i=new Array(t),n=0;n<t;++n)i[n]=this.extract.geometry.apply(this,[e.components[n]]);return i}},CLASS_NAME:"OpenLayers.Format.GeoJSON"}),OpenLayers.Protocol.Script=OpenLayers.Class(OpenLayers.Protocol,{url:null,params:null,callback:null,callbackTemplate:"OpenLayers.Protocol.Script.registry.${id}",callbackKey:"callback",callbackPrefix:"",scope:null,format:null,pendingRequests:null,srsInBBOX:!1,initialize:function(e){if(e=e||{},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(e,i){return t.write(e,i)}}},read:function(e){OpenLayers.Protocol.prototype.read.apply(this,arguments),(e=OpenLayers.Util.applyDefaults(e,this.options)).params=OpenLayers.Util.applyDefaults(e.params,this.options.params),e.filter&&this.filterToParams&&(e.params=this.filterToParams(e.filter,e.params));var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.createRequest(e.url,e.params,OpenLayers.Function.bind(function(i){t.data=i,this.handleRead(t,e)},this));return t.priv=i,t},createRequest:function(e,t,i){var n=OpenLayers.Protocol.Script.register(i),s=OpenLayers.String.format(this.callbackTemplate,{id:n});(t=OpenLayers.Util.extend({},t))[this.callbackKey]=this.callbackPrefix+s,e=OpenLayers.Util.urlAppend(e,OpenLayers.Util.getParameterString(t));var r=document.createElement("script");return r.type="text/javascript",r.src=e,r.id="OpenLayers_Protocol_Script_"+n,this.pendingRequests[r.id]=r,document.getElementsByTagName("head")[0].appendChild(r),r},destroyRequest:function(e){OpenLayers.Protocol.Script.unregister(e.id.split("_").pop()),delete this.pendingRequests[e.id],e.parentNode&&e.parentNode.removeChild(e)},handleRead:function(e,t){this.handleResponse(e,t)},handleResponse:function(e,t){t.callback&&(e.data?(e.features=this.parseFeatures(e.data),e.code=OpenLayers.Protocol.Response.SUCCESS):e.code=OpenLayers.Protocol.Response.FAILURE,this.destroyRequest(e.priv),t.callback.call(t.scope,e))},parseFeatures:function(e){return this.format.read(e)},abort:function(e){if(e)this.destroyRequest(e.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 e=OpenLayers.Protocol.Script,t=0;e.registry={},e.register=function(i){var n="c"+ ++t;return e.registry[n]=function(){i.apply(this,arguments)},n},e.unregister=function(t){delete e.registry[t]}}(),OpenLayers.Format.EncodedPolyline=OpenLayers.Class(OpenLayers.Format,{geometryType:"linestring",initialize:function(e){OpenLayers.Format.prototype.initialize.apply(this,[e])},read:function(e){var t;if("linestring"==this.geometryType)t=OpenLayers.Geometry.LineString;else if("linearring"==this.geometryType)t=OpenLayers.Geometry.LinearRing;else if("multipoint"==this.geometryType)t=OpenLayers.Geometry.MultiPoint;else if("point"!=this.geometryType&&"polygon"!=this.geometryType)return null;for(var i=this.decodeDeltas(e,2),n=i.length,s=[],r=0;r+1<n;){var a=i[r++],o=i[r++];s.push(new OpenLayers.Geometry.Point(o,a))}return"point"==this.geometryType?new OpenLayers.Feature.Vector(s[0]):"polygon"==this.geometryType?new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(s)])):new OpenLayers.Feature.Vector(new t(s))},decode:function(e,t,i){for(var n=i||1e5,s=this.decodeDeltas(e,t,n),r=s.length,a=[],o=0;o+(t-1)<r;){for(var l=[],h=0;h<t;++h)l.push(s[o++]);a.push(l)}return a},write:function(e){var t,i,n=(t=e.constructor==Array?e[0]:e).geometry,s=n.CLASS_NAME.split(".")[2].toLowerCase();if("point"==s)i=new Array(n);else if("linestring"==s||"linearring"==s||"multipoint"==s)i=n.components;else{if("polygon"!=s)return null;i=n.components[0].components}for(var r=[],a=i.length,o=0;o<a;++o){var l=i[o];r.push(l.y),r.push(l.x)}return this.encodeDeltas(r,2)},encode:function(e,t,i){for(var n=i||1e5,s=[],r=e.length,a=0;a<r;++a)for(var o=e[a],l=0;l<t;++l)s.push(o[l]);return this.encodeDeltas(s,t,n)},encodeDeltas:function(e,t,i){var n,s=i||1e5,r=new Array(t);for(n=0;n<t;++n)r[n]=0;for(var a=e.length,o=0;o<a;)for(n=0;n<t;++n,++o){var l=e[o],h=l-r[n];r[n]=l,e[o]=h}return this.encodeFloats(e,s)},decodeDeltas:function(e,t,i){var n,s=i||1e5,r=new Array(t);for(n=0;n<t;++n)r[n]=0;for(var a=this.decodeFloats(e,s),o=a.length,l=0;l<o;)for(n=0;n<t;++n,++l)r[n]+=a[l],a[l]=r[n];return a},encodeFloats:function(e,t){for(var i=t||1e5,n=e.length,s=0;s<n;++s)e[s]=Math.round(e[s]*i);return this.encodeSignedIntegers(e)},decodeFloats:function(e,t){for(var i=t||1e5,n=this.decodeSignedIntegers(e),s=n.length,r=0;r<s;++r)n[r]/=i;return n},encodeSignedIntegers:function(e){for(var t=e.length,i=0;i<t;++i){var n=e[i],s=n<<1;n<0&&(s=~s),e[i]=s}return this.encodeUnsignedIntegers(e)},decodeSignedIntegers:function(e){for(var t=this.decodeUnsignedIntegers(e),i=t.length,n=0;n<i;++n){var s=t[n];t[n]=1&s?~(s>>1):s>>1}return t},encodeUnsignedIntegers:function(e){for(var t="",i=e.length,n=0;n<i;++n)t+=this.encodeUnsignedInteger(e[n]);return t},decodeUnsignedIntegers:function(e){for(var t=[],i=0,n=0,s=e.length,r=0;r<s;++r){var a=e.charCodeAt(r)-63;i|=(31&a)<<n,a<32?(t.push(i),i=0,n=0):n+=5}return t},encodeFloat:function(e,t){return e=Math.round(e*(t||1e5)),this.encodeSignedInteger(e)},decodeFloat:function(e,t){return this.decodeSignedInteger(e)/(t||1e5)},encodeSignedInteger:function(e){var t=e<<1;return e<0&&(t=~t),this.encodeUnsignedInteger(t)},decodeSignedInteger:function(e){var t=this.decodeUnsignedInteger(e);return 1&t?~(t>>1):t>>1},encodeUnsignedInteger:function(e){for(var t,i="";e>=32;)t=63+(32|31&e),i+=String.fromCharCode(t),e>>=5;return t=e+63,i+=String.fromCharCode(t)},decodeUnsignedInteger:function(e){for(var t=0,i=0,n=e.length,s=0;s<n;++s){var r=e.charCodeAt(s)-63;if(t|=(31&r)<<i,r<32)break;i+=5}return t},CLASS_NAME:"OpenLayers.Format.EncodedPolyline"}),OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,autoActivate:!0,defaultControl:null,saveState:!1,allowDepress:!1,activeState:null,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,[e]),this.controls=[],this.activeState={}},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onButtonClick),OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var e,t=this.controls.length-1;t>=0;t--)(e=this.controls[t]).events&&e.events.un({activate:this.iconOn,deactivate:this.iconOff}),e.panel_div=null;this.activeState=null},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var e,t=0,i=this.controls.length;t<i;t++)((e=this.controls[t])===this.defaultControl||this.saveState&&this.activeState[e.id])&&e.activate();return!0===this.saveState&&(this.defaultControl=null),this.redraw(),!0}return!1},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var e,t=0,i=this.controls.length;t<i;t++)e=this.controls[t],this.activeState[e.id]=e.deactivate();return this.redraw(),!0}return!1},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.outsideViewport?(this.events.attachToElement(this.div),this.events.register("buttonclick",this,this.onButtonClick)):this.map.events.register("buttonclick",this,this.onButtonClick),this.addControlsToMap(this.controls),this.div},redraw:function(){for(e=this.div.childNodes.length-1;e>=0;e--)this.div.removeChild(this.div.childNodes[e]);if(this.div.innerHTML="",this.active)for(var e=0,t=this.controls.length;e<t;e++)this.div.appendChild(this.controls[e].panel_div)},activateControl:function(e){if(!this.active)return!1;if(e.type!=OpenLayers.Control.TYPE_BUTTON)if(e.type!=OpenLayers.Control.TYPE_TOGGLE)if(this.allowDepress&&e.active)e.deactivate();else{for(var t,i=0,n=this.controls.length;i<n;i++)(t=this.controls[i])==e||t.type!==OpenLayers.Control.TYPE_TOOL&&null!=t.type||t.deactivate();e.activate()}else e.active?e.deactivate():e.activate();else e.trigger()},addControls:function(e){OpenLayers.Util.isArray(e)||(e=[e]),this.controls=this.controls.concat(e);for(var t=0,i=e.length;t<i;t++){var n=e[t],s=this.createControlMarkup(n);OpenLayers.Element.addClass(s,n.displayClass+"ItemInactive"),OpenLayers.Element.addClass(s,"olButton"),""==n.title||s.title||(s.title=n.title),n.panel_div=s}this.map&&(this.addControlsToMap(e),this.redraw())},createControlMarkup:function(e){return document.createElement("div")},addControlsToMap:function(e){for(var t,i=0,n=e.length;i<n;i++)!0===(t=e[i]).autoActivate?(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 e=this.panel_div,t=new RegExp("\\b("+this.displayClass+"Item)Inactive\\b");e.className=e.className.replace(t,"$1Active")},iconOff:function(){var e=this.panel_div,t=new RegExp("\\b("+this.displayClass+"Item)Active\\b");e.className=e.className.replace(t,"$1Inactive")},onButtonClick:function(e){for(var t=this.controls,i=e.buttonElement,n=t.length-1;n>=0;--n)if(t[n].panel_div===i){this.activateControl(t[n]);break}},getControlsBy:function(e,t){var i="function"==typeof t.test;return OpenLayers.Array.filter(this.controls,function(n){return n[e]==t||i&&t.test(n[e])})},getControlsByName:function(e){return this.getControlsBy("name",e)},getControlsByClass:function(e){return this.getControlsBy("CLASS_NAME",e)},CLASS_NAME:"OpenLayers.Control.Panel"}),OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"}),OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"}),OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"}),OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomToMaxExtent()},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"}),OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(e){OpenLayers.Control.Panel.prototype.initialize.apply(this,[e]),this.addControls([new OpenLayers.Control.ZoomIn,new OpenLayers.Control.ZoomToMaxExtent,new OpenLayers.Control.ZoomOut])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"}),OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:!1,initialize:function(e,t,i,n){OpenLayers.Layer.prototype.initialize.apply(this,[e,n]),this.url=t,this.params||(this.params=OpenLayers.Util.extend({},i))},destroy:function(){this.url=null,this.params=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())),e=OpenLayers.Layer.prototype.clone.apply(this,[e])},setUrl:function(e){this.url=e},mergeNewParams:function(e){this.params=OpenLayers.Util.extend(this.params,e);var t=this.redraw();return null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"params"}),t},redraw:function(e){return e?this.mergeNewParams({_olSalt:Math.random()}):OpenLayers.Layer.prototype.redraw.apply(this,[])},selectUrl:function(e,t){for(var i=1,n=0,s=e.length;n<s;n++)i*=e.charCodeAt(n)*this.URL_HASH_FACTOR,i-=Math.floor(i);return t[Math.floor(i*t.length)]},getFullRequestString:function(e,t){var i=t||this.url,n=OpenLayers.Util.extend({},this.params);n=OpenLayers.Util.extend(n,e);var s=OpenLayers.Util.getParameterString(n);OpenLayers.Util.isArray(i)&&(i=this.selectUrl(s,i));var r=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(i));for(var a in n)a.toUpperCase()in r&&delete n[a];return s=OpenLayers.Util.getParameterString(n),OpenLayers.Util.urlAppend(i,s)},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"}),OpenLayers.Tile=OpenLayers.Class({events:null,eventListeners:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:!1,initialize:function(e,t,i,n,s,r){this.layer=e,this.position=t.clone(),this.setBounds(i),this.url=n,s&&(this.size=s.clone()),this.id=OpenLayers.Util.createUniqueID("Tile_"),OpenLayers.Util.extend(this,r),this.events=new OpenLayers.Events(this),this.eventListeners instanceof Object&&this.events.on(this.eventListeners)},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.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.eventListeners=null,this.events=null},draw:function(e){e||this.clear();var t=this.shouldDraw();return t&&!e&&!1===this.events.triggerEvent("beforedraw")&&(t=null),t},shouldDraw:function(){var e=!1,t=this.layer.maxExtent;if(t){var i=this.layer.map,n=i.baseLayer.wrapDateLine&&i.getMaxExtent();this.bounds.intersectsBounds(t,{inclusive:!1,worldBounds:n})&&(e=!0)}return e||this.layer.displayOutsideMaxExtent},setBounds:function(e){if(e=e.clone(),this.layer.map.baseLayer.wrapDateLine){var t=this.layer.map.getMaxExtent(),i=this.layer.map.getResolution();e=e.wrapDateLine(t,{leftTolerance:i,rightTolerance:i})}this.bounds=e},moveTo:function(e,t,i){null==i&&(i=!0),this.setBounds(e),this.position=t.clone(),i&&this.draw()},clear:function(e){},CLASS_NAME:"OpenLayers.Tile"}),OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,imageReloadAttempts:null,layerAlphaHack:null,asyncRequestId:null,maxGetUrlLength:null,canvasContext:null,crossOriginKeyword:null,initialize:function(e,t,i,n,s,r){OpenLayers.Tile.prototype.initialize.apply(this,arguments),this.url=n,this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack(),(null!=this.maxGetUrlLength||this.layer.gutter||this.layerAlphaHack)&&(this.frame=document.createElement("div"),this.frame.style.position="absolute",this.frame.style.overflow="hidden"),null!=this.maxGetUrlLength&&OpenLayers.Util.extend(this,OpenLayers.Tile.Image.IFrame)},destroy:function(){this.imgDiv&&(this.clear(),this.imgDiv=null,this.frame=null),this.asyncRequestId=null,OpenLayers.Tile.prototype.destroy.apply(this,arguments)},draw:function(){var e=OpenLayers.Tile.prototype.draw.apply(this,arguments);return e?(this.layer!=this.layer.map.baseLayer&&this.layer.reproject&&(this.bounds=this.getBoundsFromBaseLayer(this.position)),this.isLoading?this._loadEvent="reload":(this.isLoading=!0,this._loadEvent="loadstart"),this.renderTile(),this.positionTile()):!1===e&&this.unload(),e},renderTile:function(){if(this.layer.async){var e=this.asyncRequestId=(this.asyncRequestId||0)+1;this.layer.getURLasync(this.bounds,function(t){e==this.asyncRequestId&&(this.url=t,this.initImage())},this)}else this.url=this.layer.getURL(this.bounds),this.initImage()},positionTile:function(){var e=this.getTile().style,t=this.frame?this.size:this.layer.getImageSize(this.bounds),i=1;this.layer instanceof OpenLayers.Layer.Grid&&(i=this.layer.getServerResolution()/this.layer.map.getResolution()),e.left=this.position.x+"px",e.top=this.position.y+"px",e.width=Math.round(i*t.w)+"px",e.height=Math.round(i*t.h)+"px"},clear:function(){OpenLayers.Tile.prototype.clear.apply(this,arguments);var e=this.imgDiv;if(e){var t=this.getTile();t.parentNode===this.layer.div&&this.layer.div.removeChild(t),this.setImgSrc(),!0===this.layerAlphaHack&&(e.style.filter=""),OpenLayers.Element.removeClass(e,"olImageLoadError")}this.canvasContext=null},getImage:function(){if(!this.imgDiv){this.imgDiv=OpenLayers.Tile.Image.IMAGE.cloneNode(!1);var e=this.imgDiv.style;if(this.frame){var t=0,i=0;this.layer.gutter&&(t=this.layer.gutter/this.layer.tileSize.w*100,i=this.layer.gutter/this.layer.tileSize.h*100),e.left=-t+"%",e.top=-i+"%",e.width=2*t+100+"%",e.height=2*i+100+"%"}e.visibility="hidden",e.opacity=0,this.layer.opacity<1&&(e.filter="alpha(opacity="+100*this.layer.opacity+")"),e.position="absolute",this.layerAlphaHack&&(e.paddingTop=e.height,e.height="0",e.width="100%"),this.frame&&this.frame.appendChild(this.imgDiv)}return this.imgDiv},setImage:function(e){this.imgDiv=e},initImage:function(){if(this.url||this.imgDiv){this.events.triggerEvent("beforeload"),this.layer.div.appendChild(this.getTile()),this.events.triggerEvent(this._loadEvent);var e=this.getImage(),t=e.getAttribute("src")||"";this.url&&OpenLayers.Util.isEquivalentUrl(t,this.url)?this._loadTimeout=window.setTimeout(OpenLayers.Function.bind(this.onImageLoad,this),0):(this.stopLoading(),this.crossOriginKeyword&&e.removeAttribute("crossorigin"),OpenLayers.Event.observe(e,"load",OpenLayers.Function.bind(this.onImageLoad,this)),OpenLayers.Event.observe(e,"error",OpenLayers.Function.bind(this.onImageError,this)),this.imageReloadAttempts=0,this.setImgSrc(this.url))}else this.isLoading=!1},setImgSrc:function(e){var t=this.imgDiv;e?(t.style.visibility="hidden",t.style.opacity=0,this.crossOriginKeyword&&("data:"!==e.substr(0,5)?t.setAttribute("crossorigin",this.crossOriginKeyword):t.removeAttribute("crossorigin")),t.src=e):(this.stopLoading(),this.imgDiv=null,t.parentNode&&t.parentNode.removeChild(t))},getTile:function(){return this.frame?this.frame:this.getImage()},createBackBuffer:function(){if(this.imgDiv&&!this.isLoading){var e;return this.frame?(e=this.frame.cloneNode(!1)).appendChild(this.imgDiv):e=this.imgDiv,this.imgDiv=null,e}},onImageLoad:function(){var e=this.imgDiv;this.stopLoading(),e.style.visibility="inherit",e.style.opacity=this.layer.opacity,this.isLoading=!1,this.canvasContext=null,this.events.triggerEvent("loadend"),!0===this.layerAlphaHack&&(e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+e.src+"', sizingMethod='scale')")},onImageError:function(){var e=this.imgDiv;null!=e.src&&(++this.imageReloadAttempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS?this.setImgSrc(this.layer.getURL(this.bounds)):(OpenLayers.Element.addClass(e,"olImageLoadError"),this.events.triggerEvent("loaderror"),this.onImageLoad()))},stopLoading:function(){OpenLayers.Event.stopObservingElement(this.imgDiv),window.clearTimeout(this._loadTimeout),delete this._loadTimeout},getCanvasContext:function(){if(OpenLayers.CANVAS_SUPPORTED&&this.imgDiv&&!this.isLoading){if(!this.canvasContext){var e=document.createElement("canvas");e.width=this.size.w,e.height=this.size.h,this.canvasContext=e.getContext("2d"),this.canvasContext.drawImage(this.imgDiv,0,0)}return this.canvasContext}},CLASS_NAME:"OpenLayers.Tile.Image"}),OpenLayers.Tile.Image.IMAGE=function(){var e=new Image;return e.className="olTileImage",e.galleryImg="no",e}(),OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,tileClass:OpenLayers.Tile.Image,grid:null,singleTile:!1,ratio:1.5,buffer:0,transitionEffect:"resize",numLoadingTiles:0,serverResolutions:null,loading:!1,backBuffer:null,gridResolution:null,backBufferResolution:null,backBufferLonLat:null,backBufferTimerId:null,removeBackBufferDelay:null,className:null,gridLayout:null,rowSign:null,transitionendEvents:["transitionend","webkitTransitionEnd","otransitionend","oTransitionEnd"],initialize:function(e,t,i,n){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments),this.grid=[],this._removeBackBuffer=OpenLayers.Function.bind(this.removeBackBuffer,this),this.initProperties(),this.rowSign="t"===this.tileOriginCorner.substr(0,1)?1:-1},initProperties:function(){void 0===this.options.removeBackBufferDelay&&(this.removeBackBufferDelay=this.singleTile?0:2500),void 0===this.options.className&&(this.className=this.singleTile?"olLayerGridSingleTile":"olLayerGrid")},setMap:function(e){OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this,e),OpenLayers.Element.addClass(this.div,this.className)},removeMap:function(e){this.removeBackBuffer()},destroy:function(){this.removeBackBuffer(),this.clearGrid(),this.grid=null,this.tileSize=null,OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var e=0,t=this.grid.length;e<t;e++)for(var i=this.grid[e],n=0,s=i.length;n<s;n++){var r=i[n];this.destroyTile(r)}this.grid=[],this.gridResolution=null,this.gridLayout=null}},addOptions:function(e,t){var i=void 0!==e.singleTile&&e.singleTile!==this.singleTile;OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this,arguments),this.map&&i&&(this.initProperties(),this.clearGrid(),this.tileSize=this.options.tileSize,this.setTileSize(),this.moveTo(null,!0))},clone:function(e){return null==e&&(e=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions())),e=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[e]),null!=this.tileSize&&(e.tileSize=this.tileSize.clone()),e.grid=[],e.gridResolution=null,e.backBuffer=null,e.backBufferTimerId=null,e.loading=!1,e.numLoadingTiles=0,e},moveTo:function(e,t,i){if(OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments),null!=(e=e||this.map.getExtent())){var n=!this.grid.length||t,s=this.getTilesBounds(),r=this.map.getResolution();this.getServerResolution(r);this.singleTile?(n||!i&&!s.containsBounds(e))&&(t&&"resize"!==this.transitionEffect&&this.removeBackBuffer(),t&&"resize"!==this.transitionEffect||this.applyBackBuffer(r),this.initSingleTile(e)):(n=n||!s.intersectsBounds(e,{worldBounds:this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent()}))?(!t||"resize"!==this.transitionEffect&&this.gridResolution!==r||this.applyBackBuffer(r),this.initGriddedTiles(e)):this.moveGriddedTiles()}},getTileData:function(e){var t=null,i=e.lon,n=e.lat,s=this.grid.length;if(this.map&&s){var r=this.map.getResolution(),a=this.tileSize.w,o=this.tileSize.h,l=this.grid[0][0].bounds,h=l.left,u=l.top;if(i<h&&this.map.baseLayer.wrapDateLine){var p=this.map.getMaxExtent().getWidth();i+=p*Math.ceil((h-i)/p)}var c=(i-h)/(r*a),d=(u-n)/(r*o),f=Math.floor(c),m=Math.floor(d);if(m>=0&&m<s){var y=this.grid[m][f];y&&(t={tile:y,i:Math.floor((c-f)*a),j:Math.floor((d-m)*o)})}}return t},destroyTile:function(e){this.removeTileMonitoringHooks(e),e.destroy()},getServerResolution:function(e){var t=Number.POSITIVE_INFINITY;if(e=e||this.map.getResolution(),this.serverResolutions&&-1===OpenLayers.Util.indexOf(this.serverResolutions,e)){var i,n,s,r;for(i=this.serverResolutions.length-1;i>=0&&(s=this.serverResolutions[i],!((n=Math.abs(s-e))>t));i--)t=n,r=s;e=r}return e},getServerZoom:function(){var e=this.getServerResolution();return this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,e):this.map.getZoomForResolution(e)+(this.zoomOffset||0)},applyBackBuffer:function(e){null!==this.backBufferTimerId&&this.removeBackBuffer();var t=this.backBuffer;if(!t){if(!(t=this.createBackBuffer()))return;e===this.gridResolution?this.div.insertBefore(t,this.div.firstChild):this.map.baseLayer.div.parentNode.insertBefore(t,this.map.baseLayer.div),this.backBuffer=t;var i=this.grid[0][0].bounds;this.backBufferLonLat={lon:i.left,lat:i.top},this.backBufferResolution=this.gridResolution}for(var n,s=this.backBufferResolution/e,r=t.childNodes,a=r.length-1;a>=0;--a)(n=r[a]).style.top=(s*n._i*n._h|0)+"px",n.style.left=(s*n._j*n._w|0)+"px",n.style.width=Math.round(s*n._w)+"px",n.style.height=Math.round(s*n._h)+"px";var o=this.getViewPortPxFromLonLat(this.backBufferLonLat,e),l=this.map.layerContainerOriginPx.x,h=this.map.layerContainerOriginPx.y;t.style.left=Math.round(o.x-l)+"px",t.style.top=Math.round(o.y-h)+"px"},createBackBuffer:function(){var e;if(this.grid.length>0){(e=document.createElement("div")).id=this.div.id+"_bb",e.className="olBackBuffer",e.style.position="absolute";var t=this.map;e.style.zIndex="resize"===this.transitionEffect?this.getZIndex()-1:t.Z_INDEX_BASE.BaseLayer-(t.getNumLayers()-t.getLayerIndex(this));for(var i=0,n=this.grid.length;i<n;i++)for(var s=0,r=this.grid[i].length;s<r;s++){var a=this.grid[i][s],o=this.grid[i][s].createBackBuffer();o&&(o._i=i,o._j=s,o._w=a.size.w,o._h=a.size.h,o.id=a.id+"_bb",e.appendChild(o))}}return e},removeBackBuffer:function(){if(this._transitionElement){for(var e=this.transitionendEvents.length-1;e>=0;--e)OpenLayers.Event.stopObserving(this._transitionElement,this.transitionendEvents[e],this._removeBackBuffer);delete this._transitionElement}this.backBuffer&&(this.backBuffer.parentNode&&this.backBuffer.parentNode.removeChild(this.backBuffer),this.backBuffer=null,this.backBufferResolution=null,null!==this.backBufferTimerId&&(window.clearTimeout(this.backBufferTimerId),this.backBufferTimerId=null))},moveByPx:function(e,t){this.singleTile||this.moveGriddedTiles()},setTileSize:function(e){this.singleTile&&((e=this.map.getSize()).h=parseInt(e.h*this.ratio,10),e.w=parseInt(e.w*this.ratio,10)),OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[e])},getTilesBounds:function(){var e=null,t=this.grid.length;if(t){var i=this.grid[t-1][0].bounds,n=this.grid[0].length*i.getWidth(),s=this.grid.length*i.getHeight();e=new OpenLayers.Bounds(i.left,i.bottom,i.left+n,i.bottom+s)}return e},initSingleTile:function(e){this.events.triggerEvent("retile");var t=e.getCenterLonLat(),i=e.getWidth()*this.ratio,n=e.getHeight()*this.ratio,s=new OpenLayers.Bounds(t.lon-i/2,t.lat-n/2,t.lon+i/2,t.lat+n/2),r=this.map.getLayerPxFromLonLat({lon:s.left,lat:s.top});this.grid.length||(this.grid[0]=[]);var a=this.grid[0][0];a?a.moveTo(s,r):(a=this.addTile(s,r),this.addTileMonitoringHooks(a),a.draw(),this.grid[0][0]=a),this.removeExcessTiles(1,1),this.gridResolution=this.getServerResolution()},calculateGridLayout:function(e,t,i){var n=i*this.tileSize.w,s=i*this.tileSize.h,r=e.left-t.lon,a=Math.floor(r/n)-this.buffer,o=this.rowSign,l=o*(t.lat-e.top+s);return{tilelon:n,tilelat:s,startcol:a,startrow:Math[~o?"floor":"ceil"](l/s)-this.buffer*o}},getTileOrigin:function(){var e=this.tileOrigin;if(!e){var t=this.getMaxExtent(),i={tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]}[this.tileOriginCorner];e=new OpenLayers.LonLat(t[i[0]],t[i[1]])}return e},getTileBoundsForGridIndex:function(e,t){var i=this.getTileOrigin(),n=this.gridLayout,s=n.tilelon,r=n.tilelat,a=n.startcol,o=n.startrow,l=this.rowSign;return new OpenLayers.Bounds(i.lon+(a+t)*s,i.lat-(o+e*l)*r*l,i.lon+(a+t+1)*s,i.lat-(o+(e-1)*l)*r*l)},initGriddedTiles:function(e){this.events.triggerEvent("retile");var t=this.map.getSize(),i=this.getTileOrigin(),n=this.map.getResolution(),s=this.getServerResolution(),r=n/s,a={w:this.tileSize.w/r,h:this.tileSize.h/r},o=Math.ceil(t.h/a.h)+2*this.buffer+1,l=Math.ceil(t.w/a.w)+2*this.buffer+1,h=this.calculateGridLayout(e,i,s);this.gridLayout=h;var u=h.tilelon,p=h.tilelat,c=this.map.layerContainerOriginPx.x,d=this.map.layerContainerOriginPx.y,f=this.getTileBoundsForGridIndex(0,0),m=this.map.getViewPortPxFromLonLat(new OpenLayers.LonLat(f.left,f.top));m.x=Math.round(m.x)-c,m.y=Math.round(m.y)-d;var y=[],g=this.map.getCenter(),v=0;do{var L=this.grid[v];L||(L=[],this.grid.push(L));var O=0;do{f=this.getTileBoundsForGridIndex(v,O);var b=m.clone();b.x=b.x+O*Math.round(a.w),b.y=b.y+v*Math.round(a.h);var w=L[O];w?w.moveTo(f,b,!1):(w=this.addTile(f,b),this.addTileMonitoringHooks(w),L.push(w));var S=f.getCenterLonLat();y.push({tile:w,distance:Math.pow(S.lon-g.lon,2)+Math.pow(S.lat-g.lat,2)}),O+=1}while(f.right<=e.right+u*this.buffer||O<l);v+=1}while(f.bottom>=e.bottom-p*this.buffer||v<o);this.removeExcessTiles(v,O);n=this.getServerResolution();this.gridResolution=n,y.sort(function(e,t){return e.distance-t.distance});for(var C=0,x=y.length;C<x;++C)y[C].tile.draw()},getMaxExtent:function(){return this.maxExtent},addTile:function(e,t){var i=new this.tileClass(this,t,e,null,this.tileSize,this.tileOptions);return this.events.triggerEvent("addtile",{tile:i}),i},addTileMonitoringHooks:function(e){e.onLoadStart=function(){!1===this.loading&&(this.loading=!0,this.events.triggerEvent("loadstart")),this.events.triggerEvent("tileloadstart",{tile:e}),this.numLoadingTiles++,!this.singleTile&&this.backBuffer&&this.gridResolution===this.backBufferResolution&&OpenLayers.Element.addClass(e.getTile(),"olTileReplacing")},e.onLoadEnd=function(t){this.numLoadingTiles--;var i="unload"===t.type;if(this.events.triggerEvent("tileloaded",{tile:e,aborted:i}),!this.singleTile&&!i&&this.backBuffer&&this.gridResolution===this.backBufferResolution){var n=e.getTile();if("none"===OpenLayers.Element.getStyle(n,"display")){var s=document.getElementById(e.id+"_bb");s&&s.parentNode.removeChild(s)}OpenLayers.Element.removeClass(n,"olTileReplacing")}if(0===this.numLoadingTiles){if(this.backBuffer)if(0===this.backBuffer.childNodes.length)this.removeBackBuffer();else{this._transitionElement=i?this.div.lastChild:e.imgDiv;for(var r=this.transitionendEvents,a=r.length-1;a>=0;--a)OpenLayers.Event.observe(this._transitionElement,r[a],this._removeBackBuffer);this.backBufferTimerId=window.setTimeout(this._removeBackBuffer,this.removeBackBufferDelay)}this.loading=!1,this.events.triggerEvent("loadend")}},e.onLoadError=function(){this.events.triggerEvent("tileerror",{tile:e})},e.events.on({loadstart:e.onLoadStart,loadend:e.onLoadEnd,unload:e.onLoadEnd,loaderror:e.onLoadError,scope:this})},removeTileMonitoringHooks:function(e){e.unload(),e.events.un({loadstart:e.onLoadStart,loadend:e.onLoadEnd,unload:e.onLoadEnd,loaderror:e.onLoadError,scope:this})},moveGriddedTiles:function(){for(var e=this.buffer+1;;){var t=this.grid[0][0],i={x:t.position.x+this.map.layerContainerOriginPx.x,y:t.position.y+this.map.layerContainerOriginPx.y},n=this.getServerResolution()/this.map.getResolution(),s={w:Math.round(this.tileSize.w*n),h:Math.round(this.tileSize.h*n)};if(i.x>-s.w*(e-1))this.shiftColumn(!0,s);else if(i.x<-s.w*e)this.shiftColumn(!1,s);else if(i.y>-s.h*(e-1))this.shiftRow(!0,s);else{if(!(i.y<-s.h*e))break;this.shiftRow(!1,s)}}},shiftRow:function(e,t){var i=this.grid,n=e?0:i.length-1,s=e?-1:1,r=this.rowSign;this.gridLayout.startrow+=s*r;for(var a=i[n],o=i[e?"pop":"shift"](),l=0,h=o.length;l<h;l++){var u=o[l],p=a[l].position.clone();p.y+=t.h*s,u.moveTo(this.getTileBoundsForGridIndex(n,l),p)}i[e?"unshift":"push"](o)},shiftColumn:function(e,t){var i=this.grid,n=e?0:i[0].length-1,s=e?-1:1;this.gridLayout.startcol+=s;for(var r=0,a=i.length;r<a;r++){var o=i[r],l=o[n].position.clone(),h=o[e?"pop":"shift"]();l.x+=t.w*s,h.moveTo(this.getTileBoundsForGridIndex(r,n),l),o[e?"unshift":"push"](h)}},removeExcessTiles:function(e,t){for(var i,n;this.grid.length>e;)for(i=0,n=(s=this.grid.pop()).length;i<n;i++){r=s[i];this.destroyTile(r)}for(i=0,n=this.grid.length;i<n;i++)for(;this.grid[i].length>t;){var s=this.grid[i],r=s.pop();this.destroyTile(r)}},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(e){var t=this.maxExtent,i=this.getResolution(),n=i*this.tileSize.w,s=i*this.tileSize.h,r=this.getLonLatFromViewPortPx(e),a=t.left+n*Math.floor((r.lon-t.left)/n),o=t.bottom+s*Math.floor((r.lat-t.bottom)/s);return new OpenLayers.Bounds(a,o,a+n,o+s)},CLASS_NAME:"OpenLayers.Layer.Grid"}),OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:["antialiasing","blockout","font","fontcolor","fontsize","fontstyle","glowing","interval","outline","printmode","shadow","transparency"],request:null,response:null,initialize:function(e){if(this.request=new OpenLayers.Format.ArcXML.Request,this.response=new OpenLayers.Format.ArcXML.Response,e)if("feature"==e.requesttype){this.request.get_image=null;var t=this.request.get_feature.query;this.addCoordSys(t.featurecoordsys,e.featureCoordSys),this.addCoordSys(t.filtercoordsys,e.filterCoordSys),e.polygon?(t.isspatial=!0,t.spatialfilter.polygon=e.polygon):e.envelope&&(t.isspatial=!0,t.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0},this.parseEnvelope(t.spatialfilter.envelope,e.envelope))}else if("image"==e.requesttype){this.request.get_feature=null;var i=this.request.get_image.properties;this.parseEnvelope(i.envelope,e.envelope),this.addLayers(i.layerlist,e.layers),this.addImageSize(i.imagesize,e.tileSize),this.addCoordSys(i.featurecoordsys,e.featureCoordSys),this.addCoordSys(i.filtercoordsys,e.filterCoordSys)}else this.request=null;OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},parseEnvelope:function(e,t){t&&4==t.length&&(e.minx=t[0],e.miny=t[1],e.maxx=t[2],e.maxy=t[3])},addLayers:function(e,t){for(var i=0,n=t.length;i<n;i++)e.push(t[i])},addImageSize:function(e,t){null!==t&&(e.width=t.w,e.height=t.h,e.printwidth=t.w,e.printheight=t.h)},addCoordSys:function(e,t){"string"==typeof t?(e.id=parseInt(t),e.string=t):"object"==typeof t&&null!==t.proj?(e.id=t.proj.srsProjNumber,e.string=t.proj.srsCode):e=t},iserror:function(e){var t=null;if(e){var i=(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])).documentElement.getElementsByTagName("ERROR");t=null!==i&&i.length>0}else t=""!==this.response.error;return t},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=null;if(e&&e.documentElement&&(t="ARCXML"==e.documentElement.nodeName?e.documentElement:e.documentElement.getElementsByTagName("ARCXML")[0]),!t||"parsererror"===t.firstChild.nodeName){var i,n;try{i=e.firstChild.nodeValue,n=e.firstChild.childNodes[1].firstChild.nodeValue}catch(e){}throw{message:"Error parsing the ArcXML request",error:i,source:n}}return this.parseResponse(t)},write:function(e){e||(e=this.request);var t=this.createElementNS("","ARCXML");t.setAttribute("version","1.1");var i=this.createElementNS("","REQUEST");if(null!=e.get_image){var n=this.createElementNS("","GET_IMAGE");i.appendChild(n);var s=this.createElementNS("","PROPERTIES");n.appendChild(s);var r=e.get_image.properties;if(null!=r.featurecoordsys){var a=this.createElementNS("","FEATURECOORDSYS");s.appendChild(a),0===r.featurecoordsys.id?a.setAttribute("string",r.featurecoordsys.string):a.setAttribute("id",r.featurecoordsys.id)}if(null!=r.filtercoordsys){var o=this.createElementNS("","FILTERCOORDSYS");s.appendChild(o),0===r.filtercoordsys.id?o.setAttribute("string",r.filtercoordsys.string):o.setAttribute("id",r.filtercoordsys.id)}if(null!=r.envelope){var l=this.createElementNS("","ENVELOPE");s.appendChild(l),l.setAttribute("minx",r.envelope.minx),l.setAttribute("miny",r.envelope.miny),l.setAttribute("maxx",r.envelope.maxx),l.setAttribute("maxy",r.envelope.maxy)}var h=this.createElementNS("","IMAGESIZE");if(s.appendChild(h),h.setAttribute("height",r.imagesize.height),h.setAttribute("width",r.imagesize.width),r.imagesize.height==r.imagesize.printheight&&r.imagesize.width==r.imagesize.printwidth||(h.setAttribute("printheight",r.imagesize.printheight),h.setArrtibute("printwidth",r.imagesize.printwidth)),null!=r.background){var u=this.createElementNS("","BACKGROUND");s.appendChild(u),u.setAttribute("color",r.background.color.r+","+r.background.color.g+","+r.background.color.b),null!==r.background.transcolor&&u.setAttribute("transcolor",r.background.transcolor.r+","+r.background.transcolor.g+","+r.background.transcolor.b)}if(null!=r.layerlist&&r.layerlist.length>0){var p=this.createElementNS("","LAYERLIST");s.appendChild(p);for(var c=0;c<r.layerlist.length;c++){var d=this.createElementNS("","LAYERDEF");if(p.appendChild(d),d.setAttribute("id",r.layerlist[c].id),d.setAttribute("visible",r.layerlist[c].visible),"object"==typeof r.layerlist[c].query){var f=r.layerlist[c].query;if(f.where.length<0)continue;var m=null;(m="boolean"==typeof f.spatialfilter&&f.spatialfilter?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY")).setAttribute("where",f.where),"number"==typeof f.accuracy&&f.accuracy>0&&m.setAttribute("accuracy",f.accuracy),"number"==typeof f.featurelimit&&f.featurelimit<2e3&&m.setAttribute("featurelimit",f.featurelimit),"string"==typeof f.subfields&&"#ALL#"!=f.subfields&&m.setAttribute("subfields",f.subfields),"string"==typeof f.joinexpression&&f.joinexpression.length>0&&m.setAttribute("joinexpression",f.joinexpression),"string"==typeof f.jointables&&f.jointables.length>0&&m.setAttribute("jointables",f.jointables),d.appendChild(m)}"object"==typeof r.layerlist[c].renderer&&this.addRenderer(d,r.layerlist[c].renderer)}}}else if(null!=e.get_feature){if((n=this.createElementNS("","GET_FEATURES")).setAttribute("outputmode","newxml"),n.setAttribute("checkesc","true"),e.get_feature.geometry?n.setAttribute("geometry",e.get_feature.geometry):n.setAttribute("geometry","false"),e.get_feature.compact&&n.setAttribute("compact",e.get_feature.compact),"number"==e.get_feature.featurelimit&&n.setAttribute("featurelimit",e.get_feature.featurelimit),n.setAttribute("globalenvelope","true"),i.appendChild(n),null!=e.get_feature.layer&&e.get_feature.layer.length>0){var y=this.createElementNS("","LAYER");y.setAttribute("id",e.get_feature.layer),n.appendChild(y)}var g=e.get_feature.query;if(null!=g){var v=null;if(v=g.isspatial?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY"),n.appendChild(v),"number"==typeof g.accuracy&&v.setAttribute("accuracy",g.accuracy),null!=g.featurecoordsys){var L=this.createElementNS("","FEATURECOORDSYS");0==g.featurecoordsys.id?L.setAttribute("string",g.featurecoordsys.string):L.setAttribute("id",g.featurecoordsys.id),v.appendChild(L)}if(null!=g.filtercoordsys){var O=this.createElementNS("","FILTERCOORDSYS");0===g.filtercoordsys.id?O.setAttribute("string",g.filtercoordsys.string):O.setAttribute("id",g.filtercoordsys.id),v.appendChild(O)}if(g.buffer>0){var b=this.createElementNS("","BUFFER");b.setAttribute("distance",g.buffer),v.appendChild(b)}if(g.isspatial){var w=this.createElementNS("","SPATIALFILTER");if(w.setAttribute("relation",g.spatialfilter.relation),v.appendChild(w),g.spatialfilter.envelope){var S=this.createElementNS("","ENVELOPE");S.setAttribute("minx",g.spatialfilter.envelope.minx),S.setAttribute("miny",g.spatialfilter.envelope.miny),S.setAttribute("maxx",g.spatialfilter.envelope.maxx),S.setAttribute("maxy",g.spatialfilter.envelope.maxy),w.appendChild(S)}else"object"==typeof g.spatialfilter.polygon&&w.appendChild(this.writePolygonGeometry(g.spatialfilter.polygon))}null!=g.where&&g.where.length>0&&v.setAttribute("where",g.where)}}return t.appendChild(i),OpenLayers.Format.XML.prototype.write.apply(this,[t])},addGroupRenderer:function(e,t){var i=this.createElementNS("","GROUPRENDERER");e.appendChild(i);for(var n=0;n<t.length;n++){var s=t[n];this.addRenderer(i,s)}},addRenderer:function(e,t){if(OpenLayers.Util.isArray(t))this.addGroupRenderer(e,t);else{var i=this.createElementNS("",t.type.toUpperCase()+"RENDERER");e.appendChild(i),"VALUEMAPRENDERER"==i.tagName?this.addValueMapRenderer(i,t):"VALUEMAPLABELRENDERER"==i.tagName?this.addValueMapLabelRenderer(i,t):"SIMPLELABELRENDERER"==i.tagName?this.addSimpleLabelRenderer(i,t):"SCALEDEPENDENTRENDERER"==i.tagName&&this.addScaleDependentRenderer(i,t)}},addScaleDependentRenderer:function(e,t){"string"!=typeof t.lower&&"number"!=typeof t.lower||e.setAttribute("lower",t.lower),"string"!=typeof t.upper&&"number"!=typeof t.upper||e.setAttribute("upper",t.upper),this.addRenderer(e,t.renderer)},addValueMapLabelRenderer:function(e,t){if(e.setAttribute("lookupfield",t.lookupfield),e.setAttribute("labelfield",t.labelfield),"object"==typeof t.exacts)for(var i=0,n=t.exacts.length;i<n;i++){var s=t.exacts[i],r=this.createElementNS("","EXACT");if("string"==typeof s.value&&r.setAttribute("value",s.value),"string"==typeof s.label&&r.setAttribute("label",s.label),"string"==typeof s.method&&r.setAttribute("method",s.method),e.appendChild(r),"object"==typeof s.symbol){var a=null;if("text"==s.symbol.type&&(a=this.createElementNS("","TEXTSYMBOL")),null!=a){for(var o=this.fontStyleKeys,l=0,h=o.length;l<h;l++){var u=o[l];s.symbol[u]&&a.setAttribute(u,s.symbol[u])}r.appendChild(a)}}}},addValueMapRenderer:function(e,t){if(e.setAttribute("lookupfield",t.lookupfield),"object"==typeof t.ranges)for(var i=0,n=t.ranges.length;i<n;i++){var s=t.ranges[i],r=this.createElementNS("","RANGE");if(r.setAttribute("lower",s.lower),r.setAttribute("upper",s.upper),e.appendChild(r),"object"==typeof s.symbol){u=null;"simplepolygon"==s.symbol.type&&(u=this.createElementNS("","SIMPLEPOLYGONSYMBOL")),null!=u&&("string"==typeof s.symbol.boundarycolor&&u.setAttribute("boundarycolor",s.symbol.boundarycolor),"string"==typeof s.symbol.fillcolor&&u.setAttribute("fillcolor",s.symbol.fillcolor),"number"==typeof s.symbol.filltransparency&&u.setAttribute("filltransparency",s.symbol.filltransparency),r.appendChild(u))}}else if("object"==typeof t.exacts)for(var a=0,o=t.exacts.length;a<o;a++){var l=t.exacts[a],h=this.createElementNS("","EXACT");if("string"==typeof l.value&&h.setAttribute("value",l.value),"string"==typeof l.label&&h.setAttribute("label",l.label),"string"==typeof l.method&&h.setAttribute("method",l.method),e.appendChild(h),"object"==typeof l.symbol){var u=null;"simplemarker"==l.symbol.type&&(u=this.createElementNS("","SIMPLEMARKERSYMBOL")),null!=u&&("string"==typeof l.symbol.antialiasing&&u.setAttribute("antialiasing",l.symbol.antialiasing),"string"==typeof l.symbol.color&&u.setAttribute("color",l.symbol.color),"string"==typeof l.symbol.outline&&u.setAttribute("outline",l.symbol.outline),"string"==typeof l.symbol.overlap&&u.setAttribute("overlap",l.symbol.overlap),"string"==typeof l.symbol.shadow&&u.setAttribute("shadow",l.symbol.shadow),"number"==typeof l.symbol.transparency&&u.setAttribute("transparency",l.symbol.transparency),"string"==typeof l.symbol.usecentroid&&u.setAttribute("usecentroid",l.symbol.usecentroid),"number"==typeof l.symbol.width&&u.setAttribute("width",l.symbol.width),h.appendChild(u))}}},addSimpleLabelRenderer:function(e,t){e.setAttribute("field",t.field);for(var i=["featureweight","howmanylabels","labelbufferratio","labelpriorities","labelweight","linelabelposition","rotationalangles"],n=0,s=i.length;n<s;n++)t[o=i[n]]&&e.setAttribute(o,t[o]);if("text"==t.symbol.type){var r=t.symbol,a=this.createElementNS("","TEXTSYMBOL");e.appendChild(a);for(var n=0,s=(i=this.fontStyleKeys).length;n<s;n++){var o=i[n];r[o]&&a.setAttribute(o,t[o])}}},writePolygonGeometry:function(e){if(!(e instanceof OpenLayers.Geometry.Polygon))throw{message:"Cannot write polygon geometry to ArcXML with an "+e.CLASS_NAME+" object.",geometry:e};for(var t=this.createElementNS("","POLYGON"),i=0,n=e.components.length;i<n;i++){for(var s=e.components[i],r=this.createElementNS("","RING"),a=0,o=s.components.length;a<o;a++){var l=s.components[a],h=this.createElementNS("","POINT");h.setAttribute("x",l.x),h.setAttribute("y",l.y),r.appendChild(h)}t.appendChild(r)}return t},parseResponse:function(e){"string"==typeof e&&(e=(new OpenLayers.Format.XML).read(e));var t=new OpenLayers.Format.ArcXML.Response,i=e.getElementsByTagName("ERROR");if(null!=i&&i.length>0)t.error=this.getChildValue(i,"Unknown error.");else{var n=e.getElementsByTagName("RESPONSE");if(null==n||0==n.length)return t.error="No RESPONSE tag found in ArcXML response.",t;var s=n[0].firstChild.nodeName;if("#text"==s&&(s=n[0].firstChild.nextSibling.nodeName),"IMAGE"==s){var r=e.getElementsByTagName("ENVELOPE"),a=e.getElementsByTagName("OUTPUT");if(null==r||0==r.length)t.error="No ENVELOPE tag found in ArcXML response.";else if(null==a||0==a.length)t.error="No OUTPUT tag found in ArcXML response.";else{var o=this.parseAttributes(r[0]),l=this.parseAttributes(a[0]);"string"==typeof l.type?t.image={envelope:o,output:{type:l.type,data:this.getChildValue(a[0])}}:t.image={envelope:o,output:l}}}else if("FEATURES"==s){var h=n[0].getElementsByTagName("FEATURES"),u=h[0].getElementsByTagName("FEATURECOUNT");if(t.features.featurecount=u[0].getAttribute("count"),t.features.featurecount>0){var p=h[0].getElementsByTagName("ENVELOPE");t.features.envelope=this.parseAttributes(p[0],"number");for(var c=h[0].getElementsByTagName("FEATURE"),d=0;d<c.length;d++){for(var f=new OpenLayers.Feature.Vector,m=c[d].getElementsByTagName("FIELD"),y=0;y<m.length;y++){var g=m[y].getAttribute("name"),v=m[y].getAttribute("value");f.attributes[g]=v}var L=c[d].getElementsByTagName("POLYGON");if(L.length>0){for(var O=L[0].getElementsByTagName("RING"),b=[],w=0;w<O.length;w++){var S=[];S.push(this.parsePointGeometry(O[w]));for(var C=O[w].getElementsByTagName("HOLE"),x=0;x<C.length;x++)S.push(this.parsePointGeometry(C[x]));C=null,b.push(new OpenLayers.Geometry.Polygon(S)),S=null}O=null,1==b.length?f.geometry=b[0]:f.geometry=new OpenLayers.Geometry.MultiPolygon(b)}t.features.feature.push(f)}}}else t.error="Unidentified response type."}return t},parseAttributes:function(e,t){for(var i={},n=0;n<e.attributes.length;n++)i[e.attributes[n].nodeName]="number"==t?parseFloat(e.attributes[n].nodeValue):e.attributes[n].nodeValue;return i},parsePointGeometry:function(e){var t=[],i=e.getElementsByTagName("COORDS");if(i.length>0){var n=this.getChildValue(i[0]);n=n.split(/;/);for(var s=0;s<n.length;s++){var r=n[s].split(/ /);t.push(new OpenLayers.Geometry.Point(r[0],r[1]))}i=null}else{var a=e.getElementsByTagName("POINT");if(a.length>0)for(var o=0;o<a.length;o++)t.push(new OpenLayers.Geometry.Point(parseFloat(a[o].getAttribute("x")),parseFloat(a[o].getAttribute("y"))));a=null}return new OpenLayers.Geometry.LinearRing(t)},CLASS_NAME:"OpenLayers.Format.ArcXML"}),OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(e){var t={get_image:{properties:{background:null,draw:!0,envelope:{minx:0,miny:0,maxx:0,maxy:0},featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},imagesize:{height:0,width:0,dpi:96,printheight:0,printwidth:0,scalesymbols:!1},layerlist:[],output:{baseurl:"",legendbaseurl:"",legendname:"",legendpath:"",legendurl:"",name:"",path:"",type:"jpg",url:""}}},get_feature:{layer:"",query:{isspatial:!1,featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},buffer:0,where:"",spatialfilter:{relation:"envelope_intersection",envelope:null}}},environment:{separators:{cs:" ",ts:";"}},layer:[],workspaces:[]};return OpenLayers.Util.extend(this,t)},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"}),OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(e){var t={image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""};return OpenLayers.Util.extend(this,t)},CLASS_NAME:"OpenLayers.Format.ArcXML.Response"}),function(){function e(){this._object=o&&!u?new o:new window.ActiveXObject("Microsoft.XMLHTTP"),this._listeners=[]}function t(){return new e}function i(e){if(e._object.send(e._data),l&&!e._async)for(e.readyState=t.OPENED,r(e);e.readyState<t.DONE;)if(e.readyState++,n(e),e._aborted)return}function n(e){t.onreadystatechange&&t.onreadystatechange.apply(e),e.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function s(e){var t=e.responseXML,i=e.responseText;return h&&i&&t&&!t.documentElement&&e.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)&&((t=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,t.validateOnParse=!1,t.loadXML(i)),t&&(h&&0!=t.parseError||!t.documentElement||t.documentElement&&"parsererror"==t.documentElement.tagName)?null:t}function r(e){try{e.responseText=e._object.responseText}catch(e){}try{e.responseXML=s(e._object)}catch(e){}try{e.status=e._object.status}catch(e){}try{e.statusText=e._object.statusText}catch(e){}}function a(e){e._object.onreadystatechange=new window.Function}var o=window.XMLHttpRequest,l=!!window.controllers,h=window.document.all&&!window.opera,u=h&&window.navigator.userAgent.match(/MSIE 7.0/);t.prototype=e.prototype,l&&o.wrapped&&(t.wrapped=o.wrapped),t.UNSENT=0,t.OPENED=1,t.HEADERS_RECEIVED=2,t.LOADING=3,t.DONE=4,t.prototype.readyState=t.UNSENT,t.prototype.responseText="",t.prototype.responseXML=null,t.prototype.status=0,t.prototype.statusText="",t.prototype.priority="NORMAL",t.prototype.onreadystatechange=null,t.onreadystatechange=null,t.onopen=null,t.onsend=null,t.onabort=null,t.prototype.open=function(e,i,s,o,u){delete this._headers,arguments.length<3&&(s=!0),this._async=s;var p,c=this,d=this.readyState;h&&s&&(p=function(){d!=t.DONE&&(a(c),c.abort())},window.attachEvent("onunload",p)),t.onopen&&t.onopen.apply(this,arguments),arguments.length>4?this._object.open(e,i,s,o,u):arguments.length>3?this._object.open(e,i,s,o):this._object.open(e,i,s),this.readyState=t.OPENED,n(this),this._object.onreadystatechange=function(){l&&!s||(c.readyState=c._object.readyState,r(c),c._aborted?c.readyState=t.UNSENT:(c.readyState==t.DONE&&(delete c._data,a(c),h&&s&&window.detachEvent("onunload",p)),d!=c.readyState&&n(c),d=c.readyState))}},t.prototype.send=function(e){t.onsend&&t.onsend.apply(this,arguments),arguments.length||(e=null),e&&e.nodeType&&(e=window.XMLSerializer?(new window.XMLSerializer).serializeToString(e):e.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")),this._data=e,i(this)},t.prototype.abort=function(){t.onabort&&t.onabort.apply(this,arguments),this.readyState>t.UNSENT&&(this._aborted=!0),this._object.abort(),a(this),this.readyState=t.UNSENT,delete this._data},t.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()},t.prototype.getResponseHeader=function(e){return this._object.getResponseHeader(e)},t.prototype.setRequestHeader=function(e,t){return this._headers||(this._headers={}),this._headers[e]=t,this._object.setRequestHeader(e,t)},t.prototype.addEventListener=function(e,t,i){for(var n,s=0;n=this._listeners[s];s++)if(n[0]==e&&n[1]==t&&n[2]==i)return;this._listeners.push([e,t,i])},t.prototype.removeEventListener=function(e,t,i){for(var n,s=0;(n=this._listeners[s])&&(n[0]!=e||n[1]!=t||n[2]!=i);s++);n&&this._listeners.splice(s,1)},t.prototype.dispatchEvent=function(e){var t={type:e.type,target:this,currentTarget:this,eventPhase:2,bubbles:e.bubbles,cancelable:e.cancelable,timeStamp:e.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};"readystatechange"==t.type&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[t]);for(var i,n=0;i=this._listeners[n];n++)i[0]!=t.type||i[2]||(i[1].handleEvent||i[1]).apply(this,[t])},t.prototype.toString=function(){return"[object XMLHttpRequest]"},t.toString=function(){return"[XMLHttpRequest]"},window.Function.prototype.apply||(window.Function.prototype.apply=function(e,t){t||(t=[]),e.__func=this,e.__func(t[0],t[1],t[2],t[3],t[4]),delete e.__func}),OpenLayers.Request||(OpenLayers.Request={}),OpenLayers.Request.XMLHttpRequest=t}(),OpenLayers.ProxyHost="",OpenLayers.Request||(OpenLayers.Request={}),OpenLayers.Util.extend(OpenLayers.Request,{DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:!0,user:void 0,password:void 0,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new OpenLayers.Events(this),makeSameOrigin:function(e,t){var i=0!==e.indexOf("http"),n=!i&&e.match(this.URL_SPLIT_REGEX);if(n){var s=window.location;i=n[1]==s.protocol&&n[3]==s.hostname;var r=n[4],a=s.port;(80!=r&&""!=r||"80"!=a&&""!=a)&&(i=i&&r==a)}return i||t&&(e="function"==typeof t?t(e):t+encodeURIComponent(e)),e},issue:function(e){var t=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});(e=e||{}).headers=e.headers||{},(e=OpenLayers.Util.applyDefaults(e,t)).headers=OpenLayers.Util.applyDefaults(e.headers,t.headers);var i,n=!1;for(i in e.headers)e.headers.hasOwnProperty(i)&&"x-requested-with"===i.toLowerCase()&&(n=!0);!1===n&&(e.headers["X-Requested-With"]="XMLHttpRequest");var s=new OpenLayers.Request.XMLHttpRequest,r=OpenLayers.Util.urlAppend(e.url,OpenLayers.Util.getParameterString(e.params||{}));r=OpenLayers.Request.makeSameOrigin(r,e.proxy),s.open(e.method,r,e.async,e.user,e.password);for(var a in e.headers)s.setRequestHeader(a,e.headers[a]);var o=this.events,l=this;return s.onreadystatechange=function(){s.readyState==OpenLayers.Request.XMLHttpRequest.DONE&&!1!==o.triggerEvent("complete",{request:s,config:e,requestUrl:r})&&l.runCallbacks({request:s,config:e,requestUrl:r})},!1===e.async?s.send(e.data):window.setTimeout(function(){0!==s.readyState&&s.send(e.data)},0),s},runCallbacks:function(e){var t,i=e.request,n=e.config,s=n.scope?OpenLayers.Function.bind(n.callback,n.scope):n.callback;n.success&&(t=n.scope?OpenLayers.Function.bind(n.success,n.scope):n.success);var r;n.failure&&(r=n.scope?OpenLayers.Function.bind(n.failure,n.scope):n.failure),"file:"==OpenLayers.Util.createUrlObject(n.url).protocol&&i.responseText&&(i.status=200),s(i),(!i.status||i.status>=200&&i.status<300)&&(this.events.triggerEvent("success",e),t&&t(i)),i.status&&(i.status<200||i.status>=300)&&(this.events.triggerEvent("failure",e),r&&r(i))},GET:function(e){return e=OpenLayers.Util.extend(e,{method:"GET"}),OpenLayers.Request.issue(e)},POST:function(e){return e=OpenLayers.Util.extend(e,{method:"POST"}),e.headers=e.headers?e.headers:{},"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),OpenLayers.Request.issue(e)},PUT:function(e){return e=OpenLayers.Util.extend(e,{method:"PUT"}),e.headers=e.headers?e.headers:{},"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(e.headers)||(e.headers["Content-Type"]="application/xml"),OpenLayers.Request.issue(e)},DELETE:function(e){return e=OpenLayers.Util.extend(e,{method:"DELETE"}),OpenLayers.Request.issue(e)},HEAD:function(e){return e=OpenLayers.Util.extend(e,{method:"HEAD"}),OpenLayers.Request.issue(e)},OPTIONS:function(e){return e=OpenLayers.Util.extend(e,{method:"OPTIONS"}),OpenLayers.Request.issue(e)}}),OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:!0,name:"ArcIMS",isBaseLayer:!0,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:!0,async:!0,name:"ArcIMS"},initialize:function(e,t,i){this.tileSize=new OpenLayers.Size(512,512),this.params=OpenLayers.Util.applyDefaults({ServiceName:i.serviceName},this.DEFAULT_PARAMS),this.options=OpenLayers.Util.applyDefaults(i,this.DEFAULT_OPTIONS),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[e,t,this.params,i]),this.transparent&&(this.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.format&&(this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png")),null===this.options.layers&&(this.options.layers=[])},getURL:function(e){var t="";e=this.adjustBounds(e);var i=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:e.toArray(),tileSize:this.tileSize})),n=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:i.write(),async:!1});if(null!=n){var s=n.responseXML;s&&s.documentElement||(s=n.responseText);var r=(new OpenLayers.Format.ArcXML).read(s);t=this.getUrlOrImage(r.image.output)}return t},getURLasync:function(e,t,i){e=this.adjustBounds(e);var n=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:e.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(),async:!0,data:n.write(),callback:function(e){var n=e.responseXML;n&&n.documentElement||(n=e.responseText);var s=(new OpenLayers.Format.ArcXML).read(n);t.call(i,this.getUrlOrImage(s.image.output))},scope:this})},getUrlOrImage:function(e){var t="";return e.url?t=e.url:e.data&&(t="data:image/"+e.type+";base64,"+e.data),t},setLayerQuery:function(e,t){for(var i=0;i<this.options.layers.length;i++)if(e==this.options.layers[i].id)return void(this.options.layers[i].query=t);this.options.layers.push({id:e,visible:!0,query:t})},getFeatureInfo:function(e,t,i){var n=i.buffer||1,s=i.callback||function(){},r=i.scope||window,a={};OpenLayers.Util.extend(a,this.options),a.requesttype="feature",e instanceof OpenLayers.LonLat?(a.polygon=null,a.envelope=[e.lon-n,e.lat-n,e.lon+n,e.lat+n]):e instanceof OpenLayers.Geometry.Polygon&&(a.envelope=null,a.polygon=e);var o=new OpenLayers.Format.ArcXML(a);if(OpenLayers.Util.extend(o.request.get_feature,i),o.request.get_feature.layer=t.id,"number"==typeof t.query.accuracy)o.request.get_feature.query.accuracy=t.query.accuracy;else{var l=this.map.getCenter(),h=this.map.getViewPortPxFromLonLat(l);h.x++;var u=this.map.getLonLatFromPixel(h);o.request.get_feature.query.accuracy=u.lon-l.lon}o.request.get_feature.query.where=t.query.where,o.request.get_feature.query.spatialfilter.relation="area_intersection",OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:o.write(),callback:function(e){var t=o.parseResponse(e.responseText);o.iserror()?s.call(r,null):s.call(r,t.features)}})},clone:function(e){return null==e&&(e=new OpenLayers.Layer.ArcIMS(this.name,this.url,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},CLASS_NAME:"OpenLayers.Layer.ArcIMS"}),OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(e){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y),OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onButtonClick),this.removeButtons(),this.buttons=null,this.position=null,OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.map.events.register("buttonclick",this,this.onButtonClick)},draw:function(e){OpenLayers.Control.prototype.draw.apply(this,arguments),e=this.position,this.buttons=[];var t={w:18,h:18},i=new OpenLayers.Pixel(e.x+t.w/2,e.y);return this._addButton("panup","north-mini.png",i,t),e.y=i.y+t.h,this._addButton("panleft","west-mini.png",e,t),this._addButton("panright","east-mini.png",e.add(t.w,0),t),this._addButton("pandown","south-mini.png",i.add(0,2*t.h),t),this._addButton("zoomin","zoom-plus-mini.png",i.add(0,3*t.h+5),t),this._addButton("zoomworld","zoom-world-mini.png",i.add(0,4*t.h+5),t),this._addButton("zoomout","zoom-minus-mini.png",i.add(0,5*t.h+5),t),this.div},_addButton:function(e,t,i,n){var s=OpenLayers.Util.getImageLocation(t),r=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+e,i,n,s,"absolute");return r.style.cursor="pointer",this.div.appendChild(r),r.action=e,r.className="olButton",this.buttons.push(r),r},_removeButton:function(e){this.div.removeChild(e),OpenLayers.Util.removeItem(this.buttons,e)},removeButtons:function(){for(var e=this.buttons.length-1;e>=0;--e)this._removeButton(this.buttons[e])},onButtonClick:function(e){switch(e.buttonElement.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()}},getSlideFactor:function(e){return this.slideRatio?this.map.getSize()[e]*this.slideRatio:this.slideFactor},CLASS_NAME:"OpenLayers.Control.PanZoom"}),OpenLayers.Control.PanZoom.X=4,OpenLayers.Control.PanZoom.Y=4,OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoombarDiv:null,zoomWorldIcon:!1,panIcons:!0,forceFixedZoomLevel:!1,mouseDragStart:null,deltaY:null,zoomStart:null,destroy:function(){this._removeZoomBar(),this.map.events.un({changebaselayer:this.redraw,updatesize:this.redraw,scope:this}),OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments),delete this.mouseDragStart,delete this.zoomStart},setMap:function(e){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments),this.map.events.on({changebaselayer:this.redraw,updatesize:this.redraw,scope:this})},redraw:function(){null!=this.div&&(this.removeButtons(),this._removeZoomBar()),this.draw()},draw:function(e){OpenLayers.Control.prototype.draw.apply(this,arguments),e=this.position.clone(),this.buttons=[];var t={w:18,h:18};if(this.panIcons){var i=new OpenLayers.Pixel(e.x+t.w/2,e.y),n=t.w;this.zoomWorldIcon&&(i=new OpenLayers.Pixel(e.x+t.w,e.y)),this._addButton("panup","north-mini.png",i,t),e.y=i.y+t.h,this._addButton("panleft","west-mini.png",e,t),this.zoomWorldIcon&&(this._addButton("zoomworld","zoom-world-mini.png",e.add(t.w,0),t),n*=2),this._addButton("panright","east-mini.png",e.add(n,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)}else this._addButton("zoomin","zoom-plus-mini.png",e,t),i=this._addZoomBar(e.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));return this.div},_addZoomBar:function(e){var t=OpenLayers.Util.getImageLocation("slider.png"),i=this.id+"_"+this.map.id,n=this.map.getMinZoom(),s=this.map.getNumZoomLevels()-1-this.map.getZoom(),r=OpenLayers.Util.createAlphaImageDiv(i,e.add(-1,s*this.zoomStopHeight),{w:20,h:9},t,"absolute");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});var a={w:this.zoomStopWidth,h:this.zoomStopHeight*(this.map.getNumZoomLevels()-n)},t=OpenLayers.Util.getImageLocation("zoombar.png"),o=null;if(OpenLayers.Util.alphaHack()){i=this.id+"_"+this.map.id;(o=OpenLayers.Util.createAlphaImageDiv(i,e,{w:a.w,h:this.zoomStopHeight},t,"absolute",null,"crop")).style.height=a.h+"px"}else o=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,e,a,t);return o.style.cursor="pointer",o.className="olButton",this.zoombarDiv=o,this.div.appendChild(o),this.startTop=parseInt(o.style.top),this.div.appendChild(r),this.map.events.register("zoomend",this,this.moveZoomBar),e=e.add(0,this.zoomStopHeight*(this.map.getNumZoomLevels()-n))},_removeZoomBar:function(){this.sliderEvents.un({touchstart:this.zoomBarDown,touchmove:this.zoomBarDrag,touchend:this.zoomBarUp,mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp}),this.sliderEvents.destroy(),this.div.removeChild(this.zoombarDiv),this.zoombarDiv=null,this.div.removeChild(this.slider),this.slider=null,this.map.events.unregister("zoomend",this,this.moveZoomBar)},onButtonClick:function(e){if(OpenLayers.Control.PanZoom.prototype.onButtonClick.apply(this,arguments),e.buttonElement===this.zoombarDiv){var t=e.buttonXY.y/this.zoomStopHeight;!this.forceFixedZoomLevel&&this.map.fractionalZoom||(t=Math.floor(t));var i=this.map.getNumZoomLevels()-1-t;i=Math.min(Math.max(i,0),this.map.getNumZoomLevels()-1),this.map.zoomTo(i)}},passEventToSlider:function(e){this.sliderEvents.handleBrowserEvent(e)},zoomBarDown:function(e){(OpenLayers.Event.isLeftClick(e)||OpenLayers.Event.isSingleTouch(e))&&(this.map.events.on({touchmove:this.passEventToSlider,mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this}),this.mouseDragStart=e.xy.clone(),this.zoomStart=e.xy.clone(),this.div.style.cursor="move",this.zoombarDiv.offsets=null,OpenLayers.Event.stop(e))},zoomBarDrag:function(e){if(null!=this.mouseDragStart){var t=this.mouseDragStart.y-e.xy.y,i=OpenLayers.Util.pagePosition(this.zoombarDiv);if(e.clientY-i[1]>0&&e.clientY-i[1]<parseInt(this.zoombarDiv.style.height)-2){var n=parseInt(this.slider.style.top)-t;this.slider.style.top=n+"px",this.mouseDragStart=e.xy.clone()}this.deltaY=this.zoomStart.y-e.xy.y,OpenLayers.Event.stop(e)}},zoomBarUp:function(e){if((OpenLayers.Event.isLeftClick(e)||"touchend"===e.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(e)}},moveZoomBar:function(){var e=(this.map.getNumZoomLevels()-1-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=e+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"}),OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",CLASS_NAME:"OpenLayers.Format.WFSCapabilities"}),OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{wfs:"http://www.opengis.net/wfs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows"},errorProperty:"featureTypeList",defaultPrefix:"wfs",read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},readers:{wfs:{WFS_Capabilities:function(e,t){this.readChildNodes(e,t)},FeatureTypeList:function(e,t){t.featureTypeList={featureTypes:[]},this.readChildNodes(e,t.featureTypeList)},FeatureType:function(e,t){var i={};this.readChildNodes(e,i),t.featureTypes.push(i)},Name:function(e,t){var i=this.getChildValue(e);if(i){var n=i.split(":");t.name=n.pop(),n.length>0&&(t.featureNS=this.lookupNamespaceURI(e,n[0]))}},Title:function(e,t){var i=this.getChildValue(e);i&&(t.title=i)},Abstract:function(e,t){var i=this.getChildValue(e);i&&(t.abstract=i)}}},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"}),OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},readers:{wfs:OpenLayers.Util.applyDefaults({DefaultSRS:function(e,t){var i=this.getChildValue(e);i&&(t.srs=i)}},OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs),ows:OpenLayers.Format.OWSCommon.v1.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"}),OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!0,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(e,t,i,n,s){this.url=t,this.extent=i,this.maxExtent=i,this.size=n,OpenLayers.Layer.prototype.initialize.apply(this,[e,s]),this.aspectRatio=this.extent.getHeight()/this.size.h/(this.extent.getWidth()/this.size.w)},destroy:function(){this.tile&&(this.removeTileMonitoringHooks(this.tile),this.tile.destroy(),this.tile=null),OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.getOptions())),e=OpenLayers.Layer.prototype.clone.apply(this,[e])},setMap:function(e){null==this.options.maxResolution&&(this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w),OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(e,t,i){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var n=null==this.tile;if(t||n){this.setTileSize();var s=this.map.getLayerPxFromLonLat({lon:this.extent.left,lat:this.extent.top});n?(this.tile=new OpenLayers.Tile.Image(this,s,this.extent,null,this.tileSize),this.addTileMonitoringHooks(this.tile)):(this.tile.size=this.tileSize.clone(),this.tile.position=s.clone()),this.tile.draw()}},setTileSize:function(){var e=this.extent.getWidth()/this.map.getResolution(),t=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(e,t)},addTileMonitoringHooks:function(e){e.onLoadStart=function(){this.events.triggerEvent("loadstart")},e.events.register("loadstart",this,e.onLoadStart),e.onLoadEnd=function(){this.events.triggerEvent("loadend")},e.events.register("loadend",this,e.onLoadEnd),e.events.register("unload",this,e.onLoadEnd)},removeTileMonitoringHooks:function(e){e.unload(),e.events.un({loadstart:e.onLoadStart,loadend:e.onLoadEnd,unload:e.onLoadEnd,scope:this})},setUrl:function(e){this.url=e,this.tile.draw()},getURL:function(e){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"}),OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:!0,autoDestroy:!0,initialize:function(e){OpenLayers.Util.extend(this,e),this.options=e,this.active=!1},destroy:function(){this.deactivate(),this.layer=null,this.options=null},setLayer:function(e){this.layer=e},activate:function(){return!this.active&&(this.active=!0,!0)},deactivate:function(){return!!this.active&&(this.active=!1,!0)},CLASS_NAME:"OpenLayers.Strategy"}),OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{events:null,auto:!1,timer:null,initialize:function(e){OpenLayers.Strategy.prototype.initialize.apply(this,[e]),this.events=new OpenLayers.Events(this)},activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&this.auto&&("number"==typeof this.auto?this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),1e3*this.auto):this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&this.auto&&("number"==typeof this.auto?window.clearInterval(this.timer):this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})),e},triggerSave:function(e){var t=e.feature;t.state!==OpenLayers.State.INSERT&&t.state!==OpenLayers.State.UPDATE&&t.state!==OpenLayers.State.DELETE||this.save([e.feature])},save:function(e){e||(e=this.layer.features),this.events.triggerEvent("start",{features:e});var t=this.layer.projection,i=this.layer.map.getProjectionObject();if(!i.equals(t)){for(var n,s,r=e.length,a=new Array(r),o=0;o<r;++o)(s=(n=e[o]).clone()).fid=n.fid,s.state=n.state,n.url&&(s.url=n.url),s._original=n,s.geometry.transform(i,t),a[o]=s;e=a}this.layer.protocol.commit(e,{callback:this.onCommit,scope:this})},onCommit:function(e){var t={response:e};if(e.success()){for(var i,n,s=e.reqFeatures,r=[],a=e.insertIds||[],o=0,l=0,h=s.length;l<h;++l)(i=(n=(n=s[l])._original||n).state)&&(i==OpenLayers.State.DELETE?r.push(n):i==OpenLayers.State.INSERT&&(n.fid=a[o],++o),n.state=null);r.length>0&&this.layer.destroyFeatures(r),this.events.triggerEvent("success",t)}else this.events.triggerEvent("fail",t)},CLASS_NAME:"OpenLayers.Strategy.Save"}),OpenLayers.Events.featureclick=OpenLayers.Class({cache:null,map:null,provides:["featureclick","nofeatureclick","featureover","featureout"],initialize:function(e){if(this.target=e,e.object instanceof OpenLayers.Map)this.setMap(e.object);else{if(!(e.object instanceof OpenLayers.Layer.Vector))throw"Listeners for '"+this.provides.join("', '")+"' events can only be registered for OpenLayers.Layer.Vector or OpenLayers.Map instances";e.object.map?this.setMap(e.object.map):e.object.events.register("added",this,function(t){this.setMap(e.object.map)})}for(var t=this.provides.length-1;t>=0;--t)e.extensions[this.provides[t]]=!0},setMap:function(e){this.map=e,this.cache={},e.events.register("mousedown",this,this.start,{extension:!0}),e.events.register("mouseup",this,this.onClick,{extension:!0}),e.events.register("touchstart",this,this.start,{extension:!0}),e.events.register("touchmove",this,this.cancel,{extension:!0}),e.events.register("touchend",this,this.onClick,{extension:!0}),e.events.register("mousemove",this,this.onMousemove,{extension:!0})},start:function(e){this.startEvt=e},cancel:function(e){delete this.startEvt},onClick:function(e){if(this.startEvt&&("touchend"===e.type||OpenLayers.Event.isLeftClick(e))){var t=this.getFeatures(this.startEvt);delete this.startEvt;for(var i,n,s={},r=0,a=t.length;r<a&&(i=t[r],n=i.layer,s[n.id]=!0,!1!==this.triggerEvent("featureclick",{feature:i}));++r);for(r=0,a=this.map.layers.length;r<a;++r)(n=this.map.layers[r])instanceof OpenLayers.Layer.Vector&&!s[n.id]&&this.triggerEvent("nofeatureclick",{layer:n})}},onMousemove:function(e){delete this.startEvt;for(var t,i=this.getFeatures(e),n={},s=[],r=0,a=i.length;r<a;++r)n[(t=i[r]).id]=t,this.cache[t.id]||s.push(t);var o=[];for(var l in this.cache)(t=this.cache[l]).layer&&t.layer.map?n[t.id]||o.push(t):delete this.cache[l];for(r=0,a=s.length;r<a&&(t=s[r],this.cache[t.id]=t,!1!==this.triggerEvent("featureover",{feature:t}));++r);for(r=0,a=o.length;r<a&&(t=o[r],delete this.cache[t.id],!1!==this.triggerEvent("featureout",{feature:t}));++r);},triggerEvent:function(e,t){var i=t.feature?t.feature.layer:t.layer,n=this.target.object;if(n instanceof OpenLayers.Map||n===i)return this.target.triggerEvent(e,t)},getFeatures:function(e){var t,i,n,s,r,a=e.clientX,o=e.clientY,l=[],h=[],u=[];for(s=this.map.layers.length-1;s>=0;--s)if("none"!==(t=this.map.layers[s]).div.style.display)if(t.renderer instanceof OpenLayers.Renderer.Elements){if(t instanceof OpenLayers.Layer.Vector)for(i=document.elementFromPoint(a,o);i&&i._featureId;)(n=t.getFeatureById(i._featureId))?(l.push(n),i.style.display="none",h.push(i),i=document.elementFromPoint(a,o)):i=!1;u.push(t),t.div.style.display="none"}else t.renderer instanceof OpenLayers.Renderer.Canvas&&(n=t.renderer.getFeatureIdFromEvent(e))&&(l.push(n),u.push(t));for(s=0,r=h.length;s<r;++s)h[s].style.display="";for(s=u.length-1;s>=0;--s)u[s].div.style.display="block";return l},destroy:function(){for(var e=this.provides.length-1;e>=0;--e)delete this.target.extensions[this.provides[e]];this.map.events.un({mousemove:this.onMousemove,mousedown:this.start,mouseup:this.onClick,touchstart:this.start,touchmove:this.cancel,touchend:this.onClick,scope:this}),delete this.cache,delete this.map,delete this.target}}),OpenLayers.Events.nofeatureclick=OpenLayers.Events.featureclick,OpenLayers.Events.featureover=OpenLayers.Events.featureclick,OpenLayers.Events.featureout=OpenLayers.Events.featureclick,OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{defaultDesc:"No description available",extractWaypoints:!0,extractTracks:!0,extractRoutes:!0,extractAttributes:!0,namespaces:{gpx:"http://www.topografix.com/GPX/1/1",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",creator:"OpenLayers",initialize:function(e){this.externalProjection=new OpenLayers.Projection("EPSG:4326"),OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=[];if(this.extractTracks)for(var i=e.getElementsByTagName("trk"),n=0,s=i.length;n<s;n++){m={};this.extractAttributes&&(m=this.parseAttributes(i[n]));for(var r=this.getElementsByTagNameNS(i[n],i[n].namespaceURI,"trkseg"),a=0,o=r.length;a<o;a++){var l=this.extractSegment(r[a],"trkpt");t.push(new OpenLayers.Feature.Vector(l,m))}}if(this.extractRoutes)for(var h=e.getElementsByTagName("rte"),u=0,p=h.length;u<p;u++){m={};this.extractAttributes&&(m=this.parseAttributes(h[u]));var c=this.extractSegment(h[u],"rtept");t.push(new OpenLayers.Feature.Vector(c,m))}if(this.extractWaypoints)for(var d=e.getElementsByTagName("wpt"),f=0,s=d.length;f<s;f++){var m={};this.extractAttributes&&(m=this.parseAttributes(d[f]));var y=new OpenLayers.Geometry.Point(d[f].getAttribute("lon"),d[f].getAttribute("lat"));t.push(new OpenLayers.Feature.Vector(y,m))}if(this.internalProjection&&this.externalProjection)for(var g=0,v=t.length;g<v;g++)t[g].geometry.transform(this.externalProjection,this.internalProjection);return t},extractSegment:function(e,t){for(var i=this.getElementsByTagNameNS(e,e.namespaceURI,t),n=[],s=0,r=i.length;s<r;s++)n.push(new OpenLayers.Geometry.Point(i[s].getAttribute("lon"),i[s].getAttribute("lat")));return new OpenLayers.Geometry.LineString(n)},parseAttributes:function(e){for(var t,i,n={},s=e.firstChild;s;)1==s.nodeType&&s.firstChild&&(3!=(t=s.firstChild).nodeType&&4!=t.nodeType||"trkseg"!=(i=s.prefix?s.nodeName.split(":")[1]:s.nodeName)&&"rtept"!=i&&(n[i]=t.nodeValue)),s=s.nextSibling;return n},write:function(e,t){e=OpenLayers.Util.isArray(e)?e:[e];var i=this.createElementNS(this.namespaces.gpx,"gpx");i.setAttribute("version","1.1"),i.setAttribute("creator",this.creator),this.setAttributes(i,{"xsi:schemaLocation":this.schemaLocation}),t&&"object"==typeof t&&i.appendChild(this.buildMetadataNode(t));for(var n=0,s=e.length;n<s;n++)i.appendChild(this.buildFeatureNode(e[n]));return OpenLayers.Format.XML.prototype.write.apply(this,[i])},buildMetadataNode:function(e){for(var t=["name","desc","author"],i=this.createElementNS(this.namespaces.gpx,"metadata"),n=0;n<t.length;n++){var s=t[n];if(e[s]){var r=this.createElementNS(this.namespaces.gpx,s);r.appendChild(this.createTextNode(e[s])),i.appendChild(r)}}return i},buildFeatureNode:function(e){var t=e.geometry;if(t=t.clone(),this.internalProjection&&this.externalProjection&&t.transform(this.internalProjection,this.externalProjection),"OpenLayers.Geometry.Point"==t.CLASS_NAME){var i=this.buildWptNode(t);return this.appendAttributesNode(i,e),i}var n=this.createElementNS(this.namespaces.gpx,"trk");this.appendAttributesNode(n,e);for(var s=this.buildTrkSegNode(t),r=0,a=(s=OpenLayers.Util.isArray(s)?s:[s]).length;r<a;r++)n.appendChild(s[r]);return n},buildTrkSegNode:function(e){var t,i,n,s,r;if("OpenLayers.Geometry.LineString"==e.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==e.CLASS_NAME){for(t=this.createElementNS(this.namespaces.gpx,"trkseg"),i=0,n=e.components.length;i<n;i++)s=e.components[i],t.appendChild(this.buildTrkPtNode(s));return t}for(r=[],i=0,n=e.components.length;i<n;i++)r.push(this.buildTrkSegNode(e.components[i]));return r},buildTrkPtNode:function(e){var t=this.createElementNS(this.namespaces.gpx,"trkpt");return t.setAttribute("lon",e.x),t.setAttribute("lat",e.y),t},buildWptNode:function(e){var t=this.createElementNS(this.namespaces.gpx,"wpt");return t.setAttribute("lon",e.x),t.setAttribute("lat",e.y),t},appendAttributesNode:function(e,t){var i=this.createElementNS(this.namespaces.gpx,"name");i.appendChild(this.createTextNode(t.attributes.name||t.id)),e.appendChild(i);var n=this.createElementNS(this.namespaces.gpx,"desc");n.appendChild(this.createTextNode(t.attributes.description||this.defaultDesc)),e.appendChild(n)},CLASS_NAME:"OpenLayers.Format.GPX"}),OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"}),OpenLayers.Format.WMSDescribeLayer.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(e){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[e])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var t,i,n=e.documentElement.childNodes,s={layerDescriptions:[]},r=0;r<n.length;++r)if(t=n[r],"LayerDescription"==(i=t.nodeName)){var a=t.getAttribute("name"),o="",l="",h="";t.getAttribute("owsType")?(o=t.getAttribute("owsType"),l=t.getAttribute("owsURL")):""!=t.getAttribute("wfs")?(o="WFS",l=t.getAttribute("wfs")):""!=t.getAttribute("wcs")&&(o="WCS",l=t.getAttribute("wcs"));var u=t.getElementsByTagName("Query");u.length>0&&((h=u[0].getAttribute("typeName"))||(h=u[0].getAttribute("typename")));var p={layerName:a,owsType:o,owsURL:l,typeName:h};s.layerDescriptions.push(p),s.length=s.layerDescriptions.length,s[s.length-1]=p}else if("ServiceException"==i)return{error:(new OpenLayers.Format.OGCExceptionReport).read(e)};return s},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1_1"}),OpenLayers.Format.WMSDescribeLayer.v1_1_0=OpenLayers.Format.WMSDescribeLayer.v1_1_1,OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,sphericalMercator:!1,zoomOffset:0,serverResolutions:null,initialize:function(e,t,i){(i&&i.sphericalMercator||this.sphericalMercator)&&(i=OpenLayers.Util.extend({projection:"EPSG:900913",numZoomLevels:19},i)),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[e||this.name,t||this.url,{},i])},clone:function(e){return null==e&&(e=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){var t=this.getXYZ(e),i=this.url;if(OpenLayers.Util.isArray(i)){var n=""+t.x+t.y+t.z;i=this.selectUrl(n,i)}return OpenLayers.String.format(i,t)},getXYZ:function(e){var t=this.getServerResolution(),i=Math.round((e.left-this.maxExtent.left)/(t*this.tileSize.w)),n=Math.round((this.maxExtent.top-e.top)/(t*this.tileSize.h)),s=this.getServerZoom();if(this.wrapDateLine){var r=Math.pow(2,s);i=(i%r+r)%r}return{x:i,y:n,z:s}},setMap:function(e){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.XYZ"}),OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",url:["http://a.tile.openstreetmap.org/${z}/${x}/${y}.png","http://b.tile.openstreetmap.org/${z}/${x}/${y}.png","http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"],attribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",sphericalMercator:!0,wrapDateLine:!0,tileOptions:null,initialize:function(e,t,i){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments),this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options&&this.options.tileOptions)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions())),e=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[e])},CLASS_NAME:"OpenLayers.Layer.OSM"}),OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:!1,size:null,resolution:null,map:null,featureDx:0,initialize:function(e,t){this.container=OpenLayers.Util.getElement(e),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(e,t){if(this.extent=e.clone(),this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var i=e.getWidth()/this.map.getExtent().getWidth(),e=e.scale(1/i);this.extent=e.wrapDateLine(this.map.getMaxExtent()).scale(i)}return t&&(this.resolution=null),!0},setSize:function(e){this.size=e.clone(),this.resolution=null},getResolution:function(){return this.resolution=this.resolution||this.map.getResolution(),this.resolution},drawFeature:function(e,t){if(null==t&&(t=e.style),e.geometry){var i=e.geometry.getBounds();if(i){var n;this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(n=this.map.getMaxExtent()),i.intersectsBounds(this.extent,{worldBounds:n})?this.calculateFeatureDx(i,n):t={display:"none"};var s=this.drawGeometry(e.geometry,t,e.id);if("none"!=t.display&&t.label&&!1!==s){var r=e.geometry.getCentroid();if(t.labelXOffset||t.labelYOffset){var a=isNaN(t.labelXOffset)?0:t.labelXOffset,o=isNaN(t.labelYOffset)?0:t.labelYOffset,l=this.getResolution();r.move(a*l,o*l)}this.drawText(e.id,t,r)}else this.removeText(e.id);return s}}},calculateFeatureDx:function(e,t){if(this.featureDx=0,t){var i=t.getWidth(),n=(this.extent.left+this.extent.right)/2,s=(e.left+e.right)/2,r=Math.round((s-n)/i);this.featureDx=r*i}},drawGeometry:function(e,t,i){},drawText:function(e,t,i){},removeText:function(e){},clear:function(){},getFeatureIdFromEvent:function(e){},eraseFeatures:function(e){OpenLayers.Util.isArray(e)||(e=[e]);for(var t=0,i=e.length;t<i;++t){var n=e[t];this.eraseGeometry(n.geometry,n.id),this.removeText(n.id)}},eraseGeometry:function(e,t){},moveRoot:function(e){},getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(e){var t=OpenLayers.Util.extend({},OpenLayers.Renderer.defaultSymbolizer);return!1===e.stroke&&(delete t.strokeWidth,delete t.strokeColor),!1===e.fill&&delete t.fillColor,OpenLayers.Util.extend(t,e),t},CLASS_NAME:"OpenLayers.Renderer"}),OpenLayers.Renderer.defaultSymbolizer={fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1,pointRadius:0,labelAlign:"cm"},OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]},OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{hitDetection:!0,hitOverflow:0,canvas:null,features:null,pendingRedraw:!1,cachedSymbolBounds:{},initialize:function(e,t){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"))},setExtent:function(){return OpenLayers.Renderer.prototype.setExtent.apply(this,arguments),!1},eraseGeometry:function(e,t){this.eraseFeatures(this.features[t][0])},supported:function(){return OpenLayers.CANVAS_SUPPORTED},setSize:function(e){this.size=e.clone();var t=this.root;if(t.style.width=e.w+"px",t.style.height=e.h+"px",t.width=e.w,t.height=e.h,this.resolution=null,this.hitDetection){var i=this.hitCanvas;i.style.width=e.w+"px",i.style.height=e.h+"px",i.width=e.w,i.height=e.h}},drawFeature:function(e,t){var i;if(e.geometry){t=this.applyDefaultSymbolizer(t||e.style);var n,s=e.geometry.getBounds();this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(n=this.map.getMaxExtent());var r=s&&s.intersectsBounds(this.extent,{worldBounds:n});(i="none"!==t.display&&!!s&&r)?this.features[e.id]=[e,t]:delete this.features[e.id],this.pendingRedraw=!0}return this.pendingRedraw&&!this.locked&&(this.redraw(),this.pendingRedraw=!1),i},drawGeometry:function(e,t,i){var n=e.CLASS_NAME;if("OpenLayers.Geometry.Collection"!=n&&"OpenLayers.Geometry.MultiPoint"!=n&&"OpenLayers.Geometry.MultiLineString"!=n&&"OpenLayers.Geometry.MultiPolygon"!=n)switch(e.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(e,t,i);break;case"OpenLayers.Geometry.LineString":this.drawLineString(e,t,i);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(e,t,i);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(e,t,i)}else for(var s=0;s<e.components.length;s++)this.drawGeometry(e.components[s],t,i)},drawExternalGraphic:function(e,t,i){var n=new Image,s=t.title||t.graphicTitle;s&&(n.title=s);var r=t.graphicWidth||t.graphicHeight,a=t.graphicHeight||t.graphicWidth;r=r||2*t.pointRadius,a=a||2*t.pointRadius;var o=void 0!=t.graphicXOffset?t.graphicXOffset:-.5*r,l=void 0!=t.graphicYOffset?t.graphicYOffset:-.5*a,h=t.graphicOpacity||t.fillOpacity,u=function(){if(this.features[i]){var t=this.getLocalXY(e),s=t[0],u=t[1];if(!isNaN(s)&&!isNaN(u)){var p=s+o|0,c=u+l|0,d=this.canvas;d.globalAlpha=h;var f=OpenLayers.Renderer.Canvas.drawImageScaleFactor||(OpenLayers.Renderer.Canvas.drawImageScaleFactor=/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1);d.drawImage(n,p*f,c*f,r*f,a*f),this.hitDetection&&(this.setHitContextStyle("fill",i),this.hitContext.fillRect(p,c,r,a))}}};n.onload=OpenLayers.Function.bind(u,this),n.src=t.externalGraphic},drawNamedSymbol:function(e,t,i){var n,s,r,a,o,l,h,u,p,c=Math.PI/180,d=OpenLayers.Renderer.symbol[t.graphicName];if(!d)throw new Error(t.graphicName+" is not a valid symbol name");if(d.length&&!(d.length<2)){var f=this.getLocalXY(e),m=f[0],y=f[1];if(!isNaN(m)&&!isNaN(y)){if(this.canvas.lineCap="round",this.canvas.lineJoin="round",this.hitDetection&&(this.hitContext.lineCap="round",this.hitContext.lineJoin="round"),t.graphicName in this.cachedSymbolBounds)l=this.cachedSymbolBounds[t.graphicName];else{for(l=new OpenLayers.Bounds,o=0;o<d.length;o+=2)l.extend(new OpenLayers.LonLat(d[o],d[o+1]));this.cachedSymbolBounds[t.graphicName]=l}if(this.canvas.save(),this.hitDetection&&this.hitContext.save(),this.canvas.translate(m,y),this.hitDetection&&this.hitContext.translate(m,y),u=c*t.rotation,isNaN(u)||(this.canvas.rotate(u),this.hitDetection&&this.hitContext.rotate(u)),h=2*t.pointRadius/Math.max(l.getWidth(),l.getHeight()),this.canvas.scale(h,h),this.hitDetection&&this.hitContext.scale(h,h),r=l.getCenterLonLat().lon,a=l.getCenterLonLat().lat,this.canvas.translate(-r,-a),this.hitDetection&&this.hitContext.translate(-r,-a),p=t.strokeWidth,t.strokeWidth=p/h,!1!==t.fill){for(this.setCanvasStyle("fill",t),this.canvas.beginPath(),o=0;o<d.length;o+=2)n=d[o],s=d[o+1],0==o&&this.canvas.moveTo(n,s),this.canvas.lineTo(n,s);if(this.canvas.closePath(),this.canvas.fill(),this.hitDetection){for(this.setHitContextStyle("fill",i,t),this.hitContext.beginPath(),o=0;o<d.length;o+=2)n=d[o],s=d[o+1],0==o&&this.canvas.moveTo(n,s),this.hitContext.lineTo(n,s);this.hitContext.closePath(),this.hitContext.fill()}}if(!1!==t.stroke){for(this.setCanvasStyle("stroke",t),this.canvas.beginPath(),o=0;o<d.length;o+=2)n=d[o],s=d[o+1],0==o&&this.canvas.moveTo(n,s),this.canvas.lineTo(n,s);if(this.canvas.closePath(),this.canvas.stroke(),this.hitDetection){for(this.setHitContextStyle("stroke",i,t,h),this.hitContext.beginPath(),o=0;o<d.length;o+=2)n=d[o],s=d[o+1],0==o&&this.hitContext.moveTo(n,s),this.hitContext.lineTo(n,s);this.hitContext.closePath(),this.hitContext.stroke()}}t.strokeWidth=p,this.canvas.restore(),this.hitDetection&&this.hitContext.restore(),this.setCanvasStyle("reset")}}},setCanvasStyle:function(e,t){"fill"===e?(this.canvas.globalAlpha=t.fillOpacity,this.canvas.fillStyle=t.fillColor):"stroke"===e?(this.canvas.globalAlpha=t.strokeOpacity,this.canvas.strokeStyle=t.strokeColor,this.canvas.lineWidth=t.strokeWidth):(this.canvas.globalAlpha=0,this.canvas.lineWidth=1)},featureIdToHex:function(e){var t=Number(e.split("_").pop())+1;t>=16777216&&(this.hitOverflow=t-16777215,t=t%16777216+1);var i="000000"+t.toString(16),n=i.length;return i="#"+i.substring(n-6,n)},setHitContextStyle:function(e,t,i,n){var s=this.featureIdToHex(t);"fill"==e?(this.hitContext.globalAlpha=1,this.hitContext.fillStyle=s):"stroke"==e?(this.hitContext.globalAlpha=1,this.hitContext.strokeStyle=s,void 0===n?this.hitContext.lineWidth=i.strokeWidth+2:isNaN(n)||(this.hitContext.lineWidth=i.strokeWidth+2/n)):(this.hitContext.globalAlpha=0,this.hitContext.lineWidth=1)},drawPoint:function(e,t,i){if(!1!==t.graphic)if(t.externalGraphic)this.drawExternalGraphic(e,t,i);else if(t.graphicName&&"circle"!=t.graphicName)this.drawNamedSymbol(e,t,i);else{var n=this.getLocalXY(e),s=n[0],r=n[1];if(!isNaN(s)&&!isNaN(r)){var a=2*Math.PI,o=t.pointRadius;!1!==t.fill&&(this.setCanvasStyle("fill",t),this.canvas.beginPath(),this.canvas.arc(s,r,o,0,a,!0),this.canvas.fill(),this.hitDetection&&(this.setHitContextStyle("fill",i,t),this.hitContext.beginPath(),this.hitContext.arc(s,r,o,0,a,!0),this.hitContext.fill())),!1!==t.stroke&&(this.setCanvasStyle("stroke",t),this.canvas.beginPath(),this.canvas.arc(s,r,o,0,a,!0),this.canvas.stroke(),this.hitDetection&&(this.setHitContextStyle("stroke",i,t),this.hitContext.beginPath(),this.hitContext.arc(s,r,o,0,a,!0),this.hitContext.stroke()),this.setCanvasStyle("reset"))}}},drawLineString:function(e,t,i){t=OpenLayers.Util.applyDefaults({fill:!1},t),this.drawLinearRing(e,t,i)},drawLinearRing:function(e,t,i){!1!==t.fill&&(this.setCanvasStyle("fill",t),this.renderPath(this.canvas,e,t,i,"fill"),this.hitDetection&&(this.setHitContextStyle("fill",i,t),this.renderPath(this.hitContext,e,t,i,"fill"))),!1!==t.stroke&&(this.setCanvasStyle("stroke",t),this.renderPath(this.canvas,e,t,i,"stroke"),this.hitDetection&&(this.setHitContextStyle("stroke",i,t),this.renderPath(this.hitContext,e,t,i,"stroke"))),this.setCanvasStyle("reset")},renderPath:function(e,t,i,n,s){var r=t.components,a=r.length;e.beginPath();var o=this.getLocalXY(r[0]),l=o[0],h=o[1];if(!isNaN(l)&&!isNaN(h)){e.moveTo(o[0],o[1]);for(var u=1;u<a;++u){var p=this.getLocalXY(r[u]);e.lineTo(p[0],p[1])}"fill"===s?e.fill():e.stroke()}},drawPolygon:function(e,t,i){var n=e.components,s=n.length;this.drawLinearRing(n[0],t,i);for(var r=1;r<s;++r)this.canvas.globalCompositeOperation="destination-out",this.hitDetection&&(this.hitContext.globalCompositeOperation="destination-out"),this.drawLinearRing(n[r],OpenLayers.Util.applyDefaults({stroke:!1,fillOpacity:1},t),i),this.canvas.globalCompositeOperation="source-over",this.hitDetection&&(this.hitContext.globalCompositeOperation="source-over"),this.drawLinearRing(n[r],OpenLayers.Util.applyDefaults({fill:!1},t),i)},drawText:function(e,t){var i=this.getLocalXY(e);this.setCanvasStyle("reset"),this.canvas.fillStyle=t.fontColor,this.canvas.globalAlpha=t.fontOpacity||1;var n=[t.fontStyle?t.fontStyle:"normal","normal",t.fontWeight?t.fontWeight:"normal",t.fontSize?t.fontSize:"1em",t.fontFamily?t.fontFamily:"sans-serif"].join(" "),s=t.label.split("\n"),r=s.length;if(this.canvas.fillText){this.canvas.font=n,this.canvas.textAlign=OpenLayers.Renderer.Canvas.LABEL_ALIGN[t.labelAlign[0]]||"center",this.canvas.textBaseline=OpenLayers.Renderer.Canvas.LABEL_ALIGN[t.labelAlign[1]]||"middle",null==(o=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[1]])&&(o=-.5);l=this.canvas.measureText("Mg").height||this.canvas.measureText("xx").width;i[1]+=l*o*(r-1);for(h=0;h<r;h++)t.labelOutlineWidth&&(this.canvas.save(),this.canvas.globalAlpha=t.labelOutlineOpacity||t.fontOpacity||1,this.canvas.strokeStyle=t.labelOutlineColor,this.canvas.lineWidth=t.labelOutlineWidth,this.canvas.strokeText(s[h],i[0],i[1]+l*h+1),this.canvas.restore()),this.canvas.fillText(s[h],i[0],i[1]+l*h)}else if(this.canvas.mozDrawText){this.canvas.mozTextStyle=n;var a=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[0]];null==a&&(a=-.5);var o=OpenLayers.Renderer.Canvas.LABEL_FACTOR[t.labelAlign[1]];null==o&&(o=-.5);var l=this.canvas.mozMeasureText("xx");i[1]+=l*(1+o*r);for(var h=0;h<r;h++){var u=i[0]+a*this.canvas.mozMeasureText(s[h]),p=i[1]+h*l;this.canvas.translate(u,p),this.canvas.mozDrawText(s[h]),this.canvas.translate(-u,-p)}}this.setCanvasStyle("reset")},getLocalXY:function(e){var t=this.getResolution(),i=this.extent;return[(e.x-this.featureDx)/t+-i.left/t,i.top/t-e.y/t]},clear:function(){var e=this.root.height,t=this.root.width;this.canvas.clearRect(0,0,t,e),this.features={},this.hitDetection&&this.hitContext.clearRect(0,0,t,e)},getFeatureIdFromEvent:function(e){var t,i;if(this.hitDetection&&"none"!==this.root.style.display&&!this.map.dragging){var n=e.xy,s=0|n.x,r=0|n.y,a=this.hitContext.getImageData(s,r,1,1).data;if(255===a[3]){var o=a[2]+256*(a[1]+256*a[0]);if(o){t="OpenLayers_Feature_Vector_"+(o-1+this.hitOverflow);try{i=this.features[t][0]}catch(e){}}}}return i},eraseFeatures:function(e){OpenLayers.Util.isArray(e)||(e=[e]);for(var t=0;t<e.length;++t)delete this.features[e[t].id];this.redraw()},redraw:function(){if(!this.locked){var e=this.root.height,t=this.root.width;this.canvas.clearRect(0,0,t,e),this.hitDetection&&this.hitContext.clearRect(0,0,t,e);var i,n,s,r=[],a=this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent();for(var o in this.features)this.features.hasOwnProperty(o)&&(n=(i=this.features[o][0]).geometry,this.calculateFeatureDx(n.getBounds(),a),s=this.features[o][1],this.drawGeometry(n,s,i.id),s.label&&r.push([i,s]));for(var l,h=0,u=r.length;h<u;++h)l=r[h],this.drawText(l[0].geometry.getCentroid(),l[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(e){var t={interestingTagsExclude:["source","source_ref","source:ref","history","attribution","created_by"],areaTags:["area","building","leisure","tourism","ruins","historic","landuse","military","natural","sport"]};t=OpenLayers.Util.extend(t,e);for(var i={},n=0;n<t.interestingTagsExclude.length;n++)i[t.interestingTagsExclude[n]]=!0;t.interestingTagsExclude=i;for(var s={},n=0;n<t.areaTags.length;n++)s[t.areaTags[n]]=!0;t.areaTags=s,this.externalProjection=new OpenLayers.Projection("EPSG:4326"),OpenLayers.Format.XML.prototype.initialize.apply(this,[t])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var t=this.getNodes(e),i=this.getWays(e),n=new Array(i.length),s=0;s<i.length;s++){for(var r=new Array(i[s].nodes.length),a=this.isWayArea(i[s])?1:0,o=0;o<i[s].nodes.length;o++){var l=t[i[s].nodes[o]],h=new OpenLayers.Geometry.Point(l.lon,l.lat);h.osm_id=parseInt(i[s].nodes[o]),r[o]=h,l.used=!0}var u=null;u=a?new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(r)):new OpenLayers.Geometry.LineString(r),this.internalProjection&&this.externalProjection&&u.transform(this.externalProjection,this.internalProjection),(f=new OpenLayers.Feature.Vector(u,i[s].tags)).osm_id=parseInt(i[s].id),f.fid="way."+f.osm_id,n[s]=f}for(var p in t){if(!(l=t[p]).used||this.checkTags){var c=null;if(this.checkTags){var d=this.getTags(l.node,!0);if(l.used&&!d[1])continue;c=d[0]}else c=this.getTags(l.node);var f=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(l.lon,l.lat),c);this.internalProjection&&this.externalProjection&&f.geometry.transform(this.externalProjection,this.internalProjection),f.osm_id=parseInt(p),f.fid="node."+f.osm_id,n.push(f)}l.node=null}return n},getNodes:function(e){for(var t=e.getElementsByTagName("node"),i={},n=0;n<t.length;n++){var s=t[n];i[s.getAttribute("id")]={lat:s.getAttribute("lat"),lon:s.getAttribute("lon"),node:s}}return i},getWays:function(e){for(var t=e.getElementsByTagName("way"),i=[],n=0;n<t.length;n++){var s=t[n],r={id:s.getAttribute("id")};r.tags=this.getTags(s);var a=s.getElementsByTagName("nd");r.nodes=new Array(a.length);for(var o=0;o<a.length;o++)r.nodes[o]=a[o].getAttribute("ref");i.push(r)}return i},getTags:function(e,t){for(var i=e.getElementsByTagName("tag"),n={},s=!1,r=0;r<i.length;r++){var a=i[r].getAttribute("k");n[a]=i[r].getAttribute("v"),t&&(this.interestingTagsExclude[a]||(s=!0))}return t?[n,s]:n},isWayArea:function(e){var t=!1,i=!1;if(e.nodes[0]==e.nodes[e.nodes.length-1]&&(t=!0),this.checkTags)for(var n in e.tags)if(this.areaTags[n]){i=!0;break}return t&&(!this.checkTags||i)},write:function(e){OpenLayers.Util.isArray(e)||(e=[e]),this.osm_id=1,this.created_nodes={};var t=this.createElementNS(null,"osm");t.setAttribute("version","0.5"),t.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var i=e.length-1;i>=0;i--)for(var n=this.createFeatureNodes(e[i]),s=0;s<n.length;s++)t.appendChild(n[s]);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureNodes:function(e){var t=[],i=e.geometry.CLASS_NAME,n=i.substring(i.lastIndexOf(".")+1);n=n.toLowerCase();var s=this.createXML[n];return s&&(t=s.apply(this,[e])),t},createXML:{point:function(e){var t=null,i=e.geometry?e.geometry:e;this.internalProjection&&this.externalProjection&&(i=i.clone()).transform(this.internalProjection,this.externalProjection);var n=!1;if(e.osm_id?(t=e.osm_id,this.created_nodes[t]&&(n=!0)):(t=-this.osm_id,this.osm_id++),n)s=this.created_nodes[t];else var s=this.createElementNS(null,"node");return this.created_nodes[t]=s,s.setAttribute("id",t),s.setAttribute("lon",i.x),s.setAttribute("lat",i.y),e.attributes&&this.serializeTags(e,s),this.setState(e,s),n?[]:[s]},linestring:function(e){var t,i=[],n=e.geometry;e.osm_id?t=e.osm_id:(t=-this.osm_id,this.osm_id++);var s=this.createElementNS(null,"way");s.setAttribute("id",t);for(var r=0;r<n.components.length;r++){var a=this.createXML.point.apply(this,[n.components[r]]);if(a.length){var o=(a=a[0]).getAttribute("id");i.push(a)}else o=n.components[r].osm_id,a=this.created_nodes[o];this.setState(e,a);var l=this.createElementNS(null,"nd");l.setAttribute("ref",o),s.appendChild(l)}return this.serializeTags(e,s),i.push(s),i},polygon:function(e){var t=OpenLayers.Util.extend({area:"yes"},e.attributes),i=new OpenLayers.Feature.Vector(e.geometry.components[0],t);return i.osm_id=e.osm_id,this.createXML.linestring.apply(this,[i])}},serializeTags:function(e,t){for(var i in e.attributes){var n=this.createElementNS(null,"tag");n.setAttribute("k",i),n.setAttribute("v",e.attributes[i]),t.appendChild(n)}},setState:function(e,t){if(e.state){var i=null;switch(e.state){case OpenLayers.State.UPDATE:i="modify";case OpenLayers.State.DELETE:i="delete"}i&&t.setAttribute("action",i)}},CLASS_NAME:"OpenLayers.Format.OSM"}),OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,observeElement:null,initialize:function(e,t,i){OpenLayers.Handler.prototype.initialize.apply(this,arguments),this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate(),this.eventListener=null,OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.observeElement=this.observeElement||document;for(var e=0,t=this.KEY_EVENTS.length;e<t;e++)OpenLayers.Event.observe(this.observeElement,this.KEY_EVENTS[e],this.eventListener);return!0}return!1},deactivate:function(){var e=!1;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var t=0,i=this.KEY_EVENTS.length;t<i;t++)OpenLayers.Event.stopObserving(this.observeElement,this.KEY_EVENTS[t],this.eventListener);e=!0}return e},handleKeyEvent:function(e){this.checkModifiers(e)&&this.callback(e.type,[e])},CLASS_NAME:"OpenLayers.Handler.Keyboard"}),OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{documentDrag:!1,geometryTypes:null,clickout:!0,toggle:!0,standalone:!1,layer:null,feature:null,vertex:null,vertices:null,virtualVertices:null,handlers:null,deleteCodes:null,virtualStyle:null,vertexRenderIntent:null,mode:null,createVertices:!0,modified:!1,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(e,t){t=t||{},this.layer=e,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]);var i={down:function(e){this.vertex=null;var t=this.layer.getFeatureFromEvent(this.handlers.drag.evt);t?this.dragStart(t):this.clickout&&(this._unselect=this.feature)},move:function(e){delete this._unselect,this.vertex&&this.dragVertex(this.vertex,e)},up:function(){this.handlers.drag.stopDown=!1,this._unselect&&(this.unselectFeature(this._unselect),delete this._unselect)},done:function(e){this.vertex&&this.dragComplete(this.vertex)}},n={documentDrag:this.documentDrag,stopDown:!1},s={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,s),drag:new OpenLayers.Handler.Drag(this,i,n)}},destroy:function(){this.map&&this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),this.layer=null,OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),this.handlers.keyboard.activate()&&this.handlers.drag.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){var e=!1;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.moveLayerBack(),this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),this.layer.removeFeatures(this.vertices,{silent:!0}),this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.vertices=[],this.handlers.drag.deactivate(),this.handlers.keyboard.deactivate();var t=this.feature;t&&t.geometry&&t.layer&&this.unselectFeature(t),e=!0}return e},beforeSelectFeature:function(e){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:e})},selectFeature:function(e){if(!(this.feature===e||this.geometryTypes&&-1==OpenLayers.Util.indexOf(this.geometryTypes,e.geometry.CLASS_NAME))){!1!==this.beforeSelectFeature(e)&&(this.feature&&this.unselectFeature(this.feature),this.feature=e,this.layer.selectedFeatures.push(e),this.layer.drawFeature(e,"select"),this.modified=!1,this.resetVertices(),this.onModificationStart(this.feature));var t=e.modified;!e.geometry||t&&t.geometry||(this._originalGeometry=e.geometry.clone())}},unselectFeature:function(e){this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[],this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),delete this.dragHandle),this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),delete this.radiusHandle),this.layer.drawFeature(this.feature,"default"),this.feature=null,OpenLayers.Util.removeItem(this.layer.selectedFeatures,e),this.onModificationEnd(e),this.layer.events.triggerEvent("afterfeaturemodified",{feature:e,modified:this.modified}),this.modified=!1},dragStart:function(e){var t="OpenLayers.Geometry.Point"==e.geometry.CLASS_NAME;this.standalone||(e._sketch||!t)&&e._sketch||(this.toggle&&this.feature===e&&(this._unselect=e),this.selectFeature(e)),(e._sketch||t)&&(this.vertex=e,this.handlers.drag.stopDown=!0)},dragVertex:function(e,t){var i=this.map.getLonLatFromViewPortPx(t),n=e.geometry;n.move(i.lon-n.x,i.lat-n.y),this.modified=!0,"OpenLayers.Geometry.Point"==this.feature.geometry.CLASS_NAME?this.layer.events.triggerEvent("vertexmodified",{vertex:e.geometry,feature:this.feature,pixel:t}):(e._index?(e.geometry.parent.addComponent(e.geometry,e._index),delete e._index,OpenLayers.Util.removeItem(this.virtualVertices,e),this.vertices.push(e)):e==this.dragHandle?(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null)):e!==this.radiusHandle&&this.layer.events.triggerEvent("vertexmodified",{vertex:e.geometry,feature:this.feature,pixel:t}),this.virtualVertices.length>0&&(this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.layer.drawFeature(this.feature,this.standalone?void 0:"select")),this.layer.drawFeature(e)},dragComplete:function(e){this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE&&(this.feature.state=OpenLayers.State.UPDATE,this.modified&&this._originalGeometry)){var e=this.feature;e.modified=OpenLayers.Util.extend(e.modified,{geometry:this._originalGeometry}),delete this._originalGeometry}},resetVertices:function(){this.vertices.length>0&&(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[]),this.virtualVertices.length>0&&(this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),this.dragHandle=null),this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null),this.feature&&"OpenLayers.Geometry.Point"!=this.feature.geometry.CLASS_NAME&&(this.mode&OpenLayers.Control.ModifyFeature.DRAG&&this.collectDragHandle(),this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE)&&this.collectRadiusHandle(),this.mode&OpenLayers.Control.ModifyFeature.RESHAPE&&(this.mode&OpenLayers.Control.ModifyFeature.RESIZE||this.collectVertices()))},handleKeypress:function(e){var t=e.keyCode;if(this.feature&&-1!=OpenLayers.Util.indexOf(this.deleteCodes,t)){var i=this.layer.getFeatureFromEvent(this.handlers.drag.evt);i&&-1!=OpenLayers.Util.indexOf(this.vertices,i)&&!this.handlers.drag.dragging&&i.geometry.parent&&(i.geometry.parent.removeComponent(i.geometry),this.layer.events.triggerEvent("vertexremoved",{vertex:i.geometry,feature:this.feature,pixel:e.xy}),this.layer.drawFeature(this.feature,this.standalone?void 0:"select"),this.modified=!0,this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent("featuremodified",{feature:this.feature}))}},collectVertices:function(){function e(i){var n,s,r,a;if("OpenLayers.Geometry.Point"==i.CLASS_NAME)(s=new OpenLayers.Feature.Vector(i))._sketch=!0,s.renderIntent=t.vertexRenderIntent,t.vertices.push(s);else{var o=i.components.length;for("OpenLayers.Geometry.LinearRing"==i.CLASS_NAME&&(o-=1),n=0;n<o;++n)"OpenLayers.Geometry.Point"==(r=i.components[n]).CLASS_NAME?((s=new OpenLayers.Feature.Vector(r))._sketch=!0,s.renderIntent=t.vertexRenderIntent,t.vertices.push(s)):e(r);if(t.createVertices&&"OpenLayers.Geometry.MultiPoint"!=i.CLASS_NAME)for(n=0,a=i.components.length;n<a-1;++n){var l=i.components[n],h=i.components[n+1];if("OpenLayers.Geometry.Point"==l.CLASS_NAME&&"OpenLayers.Geometry.Point"==h.CLASS_NAME){var u=(l.x+h.x)/2,p=(l.y+h.y)/2,c=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(u,p),null,t.virtualStyle);c.geometry.parent=i,c._index=n+1,c._sketch=!0,t.virtualVertices.push(c)}}}}this.vertices=[],this.virtualVertices=[];var t=this;e.call(this,this.feature.geometry),this.layer.addFeatures(this.virtualVertices,{silent:!0}),this.layer.addFeatures(this.vertices,{silent:!0})},collectDragHandle:function(){var e=this.feature.geometry,t=e.getBounds().getCenterLonLat(),i=new OpenLayers.Geometry.Point(t.lon,t.lat),n=new OpenLayers.Feature.Vector(i);i.move=function(t,i){OpenLayers.Geometry.Point.prototype.move.call(this,t,i),e.move(t,i)},n._sketch=!0,this.dragHandle=n,this.dragHandle.renderIntent=this.vertexRenderIntent,this.layer.addFeatures([this.dragHandle],{silent:!0})},collectRadiusHandle:function(){var e=this.feature.geometry,t=e.getBounds(),i=t.getCenterLonLat(),n=new OpenLayers.Geometry.Point(i.lon,i.lat),s=new OpenLayers.Geometry.Point(t.right,t.bottom),r=new OpenLayers.Feature.Vector(s),a=this.mode&OpenLayers.Control.ModifyFeature.RESIZE,o=this.mode&OpenLayers.Control.ModifyFeature.RESHAPE,l=this.mode&OpenLayers.Control.ModifyFeature.ROTATE;s.move=function(t,i){OpenLayers.Geometry.Point.prototype.move.call(this,t,i);var s=this.x-n.x,r=this.y-n.y,h=s-t,u=r-i;if(l){var p=Math.atan2(u,h),c=Math.atan2(r,s)-p;c*=180/Math.PI,e.rotate(c,n)}if(a){var d,f;if(o)f=s/h/(d=r/u);else{var m=Math.sqrt(h*h+u*u);d=Math.sqrt(s*s+r*r)/m}e.resize(d,n,f)}},r._sketch=!0,this.radiusHandle=r,this.radiusHandle.renderIntent=this.vertexRenderIntent,this.layer.addFeatures([this.radiusHandle],{silent:!0})},setMap:function(e){this.handlers.drag.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},handleMapEvents:function(e){"removelayer"!=e.type&&"order"!=e.property||this.moveLayerToTop()},moveLayerToTop:function(){var e=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(e)},moveLayerBack:function(){var e=this.layer.getZIndex()-1;e>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(e):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Control.ModifyFeature"}),OpenLayers.Control.ModifyFeature.RESHAPE=1,OpenLayers.Control.ModifyFeature.RESIZE=2,OpenLayers.Control.ModifyFeature.ROTATE=4,OpenLayers.Control.ModifyFeature.DRAG=8,OpenLayers.Layer.Bing=OpenLayers.Class(OpenLayers.Layer.XYZ,{key:null,serverResolutions:[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,.5971642833948135,.29858214169740677,.14929107084870338,.07464553542435169],attributionTemplate:'<span class="olBingAttribution ${type}"><div><a target="_blank" href="http://www.bing.com/maps/"><img src="${logo}" /></a></div>${copyrights}<a style="white-space: nowrap" target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a></span>',metadata:null,protocolRegex:/^http:/i,type:"Road",culture:"en-US",metadataParams:null,tileOptions:null,protocol:~window.location.href.indexOf("http")?"":"http:",initialize:function(e){var t=[(e=OpenLayers.Util.applyDefaults({sphericalMercator:!0},e)).name||"Bing "+(e.type||this.type),null,e];OpenLayers.Layer.XYZ.prototype.initialize.apply(this,t),this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options.tileOptions),this.loadMetadata()},loadMetadata:function(){this._callbackId="_callback_"+this.id.replace(/\./g,"_"),window[this._callbackId]=OpenLayers.Function.bind(OpenLayers.Layer.Bing.processMetadata,this);var e=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams),t=this.protocol+"//dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(e),i=document.createElement("script");i.type="text/javascript",i.src=t,i.id=this._callbackId,document.getElementsByTagName("head")[0].appendChild(i)},initLayer:function(){var e=this.metadata.resourceSets[0].resources[0],t=e.imageUrl.replace("{quadkey}","${quadkey}");t=(t=t.replace("{culture}",this.culture)).replace(this.protocolRegex,this.protocol),this.url=[];for(var i=0;i<e.imageUrlSubdomains.length;++i)this.url.push(t.replace("{subdomain}",e.imageUrlSubdomains[i]));this.addOptions({maxResolution:Math.min(this.serverResolutions[e.zoomMin],this.maxResolution||Number.POSITIVE_INFINITY),numZoomLevels:Math.min(e.zoomMax+1-e.zoomMin,this.numZoomLevels)},!0),this.isBaseLayer||this.redraw(),this.updateAttribution()},getURL:function(e){if(this.url){for(var t=this.getXYZ(e),i=t.x,n=t.y,s=t.z,r=[],a=s;a>0;--a){var o="0",l=1<<a-1;0!=(i&l)&&o++,0!=(n&l)&&(o++,o++),r.push(o)}var h=r.join(""),u=this.selectUrl(""+i+n+s,this.url);return OpenLayers.String.format(u,{quadkey:h})}},updateAttribution:function(){var e=this.metadata;if(e.resourceSets&&this.map&&this.map.center){var t,i,n,s,r,a,o,l=e.resourceSets[0].resources[0],h=this.map.getExtent().transform(this.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326")),u=l.imageryProviders||[],p=OpenLayers.Util.indexOf(this.serverResolutions,this.getServerResolution()),c="";for(i=0,n=u.length;i<n;++i)for(s=0,r=(t=u[i]).coverageAreas.length;s<r;++s)o=t.coverageAreas[s],a=OpenLayers.Bounds.fromArray(o.bbox,!0),h.intersectsBounds(a)&&p<=o.zoomMax&&p>=o.zoomMin&&(c+=t.attribution+" ");var d=e.brandLogoUri.replace(this.protocolRegex,this.protocol);this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(),logo:d,copyrights:c}),this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"attribution"})}},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments),this.map.events.register("moveend",this,this.updateAttribution)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.Bing(this.options)),e=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[e])},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(e){this.metadata=e,this.initLayer();var t=document.getElementById(this._callbackId);t.parentNode.removeChild(t),window[this._callbackId]=void 0,delete this._callbackId},OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:!0,initialize:function(e,t){if(this.styles={default:new OpenLayers.Style(OpenLayers.Feature.Vector.style.default),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),delete:new OpenLayers.Style(OpenLayers.Feature.Vector.style.delete)},e instanceof OpenLayers.Style)this.styles.default=e,this.styles.select=e,this.styles.temporary=e,this.styles.delete=e;else if("object"==typeof e)for(var i in e)if(e[i]instanceof OpenLayers.Style)this.styles[i]=e[i];else{if("object"!=typeof e[i]){this.styles.default=new OpenLayers.Style(e),this.styles.select=new OpenLayers.Style(e),this.styles.temporary=new OpenLayers.Style(e),this.styles.delete=new OpenLayers.Style(e);break}this.styles[i]=new OpenLayers.Style(e[i])}OpenLayers.Util.extend(this,t)},destroy:function(){for(var e in this.styles)this.styles[e].destroy();this.styles=null},createSymbolizer:function(e,t){e||(e=new OpenLayers.Feature.Vector),this.styles[t]||(t="default"),e.renderIntent=t;var i={};return this.extendDefault&&"default"!=t&&(i=this.styles.default.createSymbolizer(e)),OpenLayers.Util.extend(i,this.styles[t].createSymbolizer(e))},addUniqueValueRules:function(e,t,i,n){var s=[];for(var r in i)s.push(new OpenLayers.Rule({symbolizer:i[r],context:n,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:t,value:r})}));this.styles[e].addRules(s)},CLASS_NAME:"OpenLayers.StyleMap"}),OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,isFixed:!1,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:!0,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:!1,ratio:1,initialize:function(e,t){if(OpenLayers.Layer.prototype.initialize.apply(this,arguments),this.renderer&&this.renderer.supported()||this.assignRenderer(),this.renderer&&this.renderer.supported()||(this.renderer=null,this.displayError()),this.styleMap||(this.styleMap=new OpenLayers.StyleMap),this.features=[],this.selectedFeatures=[],this.unrenderedFeatures={},this.strategies)for(var i=0,n=this.strategies.length;i<n;i++)this.strategies[i].setLayer(this)},destroy:function(){if(this.strategies){var e,t,i;for(t=0,i=this.strategies.length;t<i;t++)(e=this.strategies[t]).autoDestroy&&e.destroy();this.strategies=null}this.protocol&&(this.protocol.autoDestroy&&this.protocol.destroy(),this.protocol=null),this.destroyFeatures(),this.features=null,this.selectedFeatures=null,this.unrenderedFeatures=null,this.renderer&&this.renderer.destroy(),this.renderer=null,this.geometryType=null,this.drawn=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(e){null==e&&(e=new OpenLayers.Layer.Vector(this.name,this.getOptions())),e=OpenLayers.Layer.prototype.clone.apply(this,[e]);for(var t=this.features,i=t.length,n=new Array(i),s=0;s<i;++s)n[s]=t[s].clone();return e.features=n,e},refresh:function(e){this.calculateInRange()&&this.visibility&&this.events.triggerEvent("refresh",e)},assignRenderer:function(){for(var e=0,t=this.renderers.length;e<t;e++){var i=this.renderers[e],n="function"==typeof i?i:OpenLayers.Renderer[i];if(n&&n.prototype.supported()){this.renderer=new n(this.div,this.rendererOptions);break}}},displayError:function(){this.reportError&&OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))},setMap:function(e){if(OpenLayers.Layer.prototype.setMap.apply(this,arguments),this.renderer){this.renderer.map=this.map;var t=this.map.getSize();t.w=t.w*this.ratio,t.h=t.h*this.ratio,this.renderer.setSize(t)}else this.map.removeLayer(this)},afterAdd:function(){if(this.strategies){var e,t,i;for(t=0,i=this.strategies.length;t<i;t++)(e=this.strategies[t]).autoActivate&&e.activate()}},removeMap:function(e){if(this.drawn=!1,this.strategies){var t,i,n;for(i=0,n=this.strategies.length;i<n;i++)(t=this.strategies[i]).autoActivate&&t.deactivate()}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);var e=this.map.getSize();e.w=e.w*this.ratio,e.h=e.h*this.ratio,this.renderer.setSize(e)},moveTo:function(e,t,i){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var n=!0;if(!i){this.renderer.root.style.visibility="hidden";var s=this.map.getSize(),r=s.w,a=s.h,o=r/2*this.ratio-r/2,l=a/2*this.ratio-a/2;o+=this.map.layerContainerOriginPx.x,o=-Math.round(o),l+=this.map.layerContainerOriginPx.y,l=-Math.round(l),this.div.style.left=o+"px",this.div.style.top=l+"px";var h=this.map.getExtent().scale(this.ratio);if(n=this.renderer.setExtent(h,t),this.renderer.root.style.visibility="visible",!0===OpenLayers.IS_GECKO&&(this.div.scrollLeft=this.div.scrollLeft),!t&&n)for(var u in this.unrenderedFeatures){p=this.unrenderedFeatures[u];this.drawFeature(p)}}if(!this.drawn||t||!n){this.drawn=!0;for(var p,u=0,c=this.features.length;u<c;u++)this.renderer.locked=u!==c-1,p=this.features[u],this.drawFeature(p)}},display:function(e){OpenLayers.Layer.prototype.display.apply(this,arguments);var t=this.div.style.display;t!=this.renderer.root.style.display&&(this.renderer.root.style.display=t)},addFeatures:function(e,t){OpenLayers.Util.isArray(e)||(e=[e]);var i=!t||!t.silent;if(i){var n={features:e};if(!1===this.events.triggerEvent("beforefeaturesadded",n))return;e=n.features}for(var s=[],r=0,a=e.length;r<a;r++){r!=e.length-1?this.renderer.locked=!0:this.renderer.locked=!1;var o=e[r];if(this.geometryType&&!(o.geometry instanceof this.geometryType))throw new TypeError("addFeatures: component should be an "+this.geometryType.prototype.CLASS_NAME);if(o.layer=this,!o.style&&this.style&&(o.style=OpenLayers.Util.extend({},this.style)),i){if(!1===this.events.triggerEvent("beforefeatureadded",{feature:o}))continue;this.preFeatureInsert(o)}s.push(o),this.features.push(o),this.drawFeature(o),i&&(this.events.triggerEvent("featureadded",{feature:o}),this.onFeatureInsert(o))}i&&this.events.triggerEvent("featuresadded",{features:s})},removeFeatures:function(e,t){if(e&&0!==e.length){if(e===this.features)return this.removeAllFeatures(t);OpenLayers.Util.isArray(e)||(e=[e]),e===this.selectedFeatures&&(e=e.slice());var i=!t||!t.silent;i&&this.events.triggerEvent("beforefeaturesremoved",{features:e});for(var n=e.length-1;n>=0;n--){0!=n&&e[n-1].geometry?this.renderer.locked=!0:this.renderer.locked=!1;var s=e[n];delete this.unrenderedFeatures[s.id],i&&this.events.triggerEvent("beforefeatureremoved",{feature:s}),this.features=OpenLayers.Util.removeItem(this.features,s),s.layer=null,s.geometry&&this.renderer.eraseFeatures(s),-1!=OpenLayers.Util.indexOf(this.selectedFeatures,s)&&OpenLayers.Util.removeItem(this.selectedFeatures,s),i&&this.events.triggerEvent("featureremoved",{feature:s})}i&&this.events.triggerEvent("featuresremoved",{features:e})}},removeAllFeatures:function(e){var t=!e||!e.silent,i=this.features;t&&this.events.triggerEvent("beforefeaturesremoved",{features:i});for(var n,s=i.length-1;s>=0;s--)n=i[s],t&&this.events.triggerEvent("beforefeatureremoved",{feature:n}),n.layer=null,t&&this.events.triggerEvent("featureremoved",{feature:n});this.renderer.clear(),this.features=[],this.unrenderedFeatures={},this.selectedFeatures=[],t&&this.events.triggerEvent("featuresremoved",{features:i})},destroyFeatures:function(e,t){if(void 0==e&&(e=this.features),e){this.removeFeatures(e,t);for(var i=e.length-1;i>=0;i--)e[i].destroy()}},drawFeature:function(e,t){if(this.drawn){if("object"!=typeof t){t||e.state!==OpenLayers.State.DELETE||(t="delete");var i=t||e.renderIntent;(t=e.style||this.style)||(t=this.styleMap.createSymbolizer(e,i))}var n=this.renderer.drawFeature(e,t);!1===n||null===n?this.unrenderedFeatures[e.id]=e:delete this.unrenderedFeatures[e.id]}},eraseFeatures:function(e){this.renderer.eraseFeatures(e)},getFeatureFromEvent:function(e){if(!this.renderer)throw new Error("getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.");var t=null,i=this.renderer.getFeatureIdFromEvent(e);return i&&(t="string"==typeof i?this.getFeatureById(i):i),t},getFeatureBy:function(e,t){for(var i=null,n=0,s=this.features.length;n<s;++n)if(this.features[n][e]==t){i=this.features[n];break}return i},getFeatureById:function(e){return this.getFeatureBy("id",e)},getFeatureByFid:function(e){return this.getFeatureBy("fid",e)},getFeaturesByAttribute:function(e,t){var i,n,s=this.features.length,r=[];for(i=0;i<s;i++)(n=this.features[i])&&n.attributes&&n.attributes[e]===t&&r.push(n);return r},onFeatureInsert:function(e){},preFeatureInsert:function(e){},getDataExtent:function(){var e=null,t=this.features;if(t&&t.length>0)for(var i=null,n=0,s=t.length;n<s;n++)(i=t[n].geometry)&&(null===e&&(e=new OpenLayers.Bounds),e.extend(i.getBounds()));return e},CLASS_NAME:"OpenLayers.Layer.Vector"}),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(e){e=e||{},OpenLayers.Layer.Vector.prototype.initialize.apply(this,[e.name,e])},setMap:function(e){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments),e.events.register("moveend",this,this.onMoveEnd)},removeMap:function(e){e.events.unregister("moveend",this,this.onMoveEnd),OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},setRatio:function(e){this.ratio=e,this.updateGrid(!0)},setMaxFeatures:function(e){this.maxFeatures=e,this.updateGrid(!0)},setSpacing:function(e,t){this.dx=e,this.dy=t||e,this.updateGrid(!0)},setOrigin:function(e){this.origin=e,this.updateGrid(!0)},getOrigin:function(){return this.origin||(this.origin=this.map.getExtent().getCenterLonLat()),this.origin},setRotation:function(e){this.rotation=e,this.updateGrid(!0)},onMoveEnd:function(){this.updateGrid()},getViewBounds:function(){var e=this.map.getExtent();if(this.rotation){var t=this.getOrigin(),i=new OpenLayers.Geometry.Point(t.lon,t.lat),n=e.toGeometry();n.rotate(-this.rotation,i),e=n.getBounds()}return e},updateGrid:function(e){if(e||this.invalidBounds()){var t=this.getViewBounds(),i=this.getOrigin(),n=new OpenLayers.Geometry.Point(i.lon,i.lat),s=t.getWidth(),r=t.getHeight(),a=s/r,o=Math.sqrt(this.dx*this.dy*this.maxFeatures/a),l=o*a,h=Math.min(s*this.ratio,l),u=Math.min(r*this.ratio,o),p=t.getCenterLonLat();this.gridBounds=new OpenLayers.Bounds(p.lon-h/2,p.lat-u/2,p.lon+h/2,p.lat+u/2);for(var c,d,f,m=Math.floor(u/this.dy),y=Math.floor(h/this.dx),g=i.lon+this.dx*Math.ceil((this.gridBounds.left-i.lon)/this.dx),v=i.lat+this.dy*Math.ceil((this.gridBounds.bottom-i.lat)/this.dy),L=new Array(m*y),O=0;O<y;++O){c=g+O*this.dx;for(var b=0;b<m;++b)d=v+b*this.dy,f=new OpenLayers.Geometry.Point(c,d),this.rotation&&f.rotate(this.rotation,n),L[O*m+b]=new OpenLayers.Feature.Vector(f)}this.destroyFeatures(this.features,{silent:!0}),this.addFeatures(L,{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,interval:0,maxDelta:Number.POSITIVE_INFINITY,delta:0,cumulative:!0,initialize:function(e,t,i){OpenLayers.Handler.prototype.initialize.apply(this,arguments),this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments),this.wheelListener=null},onWheelEvent:function(e){if(this.map&&this.checkModifiers(e)){for(var t=!1,i=!1,n=!1,s=OpenLayers.Event.element(e);null!=s&&!n&&!t;){if(!t)try{var r;t=(r=s.currentStyle?s.currentStyle.overflow:document.defaultView.getComputedStyle(s,null).getPropertyValue("overflow"))&&"auto"==r||"scroll"==r}catch(e){}if(!i&&!(i=OpenLayers.Element.hasClass(s,"olScrollable")))for(var a=0,o=this.map.layers.length;a<o;a++){var l=this.map.layers[a];if(s==l.div||s==l.pane){i=!0;break}}n=s==this.map.div,s=s.parentNode}if(!t&&n){if(i){var h=0;if(e.wheelDelta?((h=e.wheelDelta)%160==0&&(h*=.75),h/=120):e.detail&&(h=-e.detail/Math.abs(e.detail)),this.delta+=h,window.clearTimeout(this._timeoutId),this.interval&&Math.abs(this.delta)<this.maxDelta){var u=OpenLayers.Util.extend({},e);this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(u)},this),this.interval)}else this.wheelZoom(e)}OpenLayers.Event.stop(e)}}},wheelZoom:function(e){var t=this.delta;this.delta=0,t&&(e.xy=this.map.events.getMousePosition(e),t<0?this.callback("down",[e,this.cumulative?Math.max(-this.maxDelta,t):-1]):this.callback("up",[e,this.cumulative?Math.min(this.maxDelta,t):1]))},activate:function(e){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var t=this.wheelListener;return OpenLayers.Event.observe(window,"DOMMouseScroll",t),OpenLayers.Event.observe(window,"mousewheel",t),OpenLayers.Event.observe(document,"mousewheel",t),!0}return!1},deactivate:function(e){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var t=this.wheelListener;return OpenLayers.Event.stopObserving(window,"DOMMouseScroll",t),OpenLayers.Event.stopObserving(window,"mousewheel",t),OpenLayers.Event.stopObserving(document,"mousewheel",t),!0}return!1},CLASS_NAME:"OpenLayers.Handler.MouseWheel"}),OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(e){OpenLayers.Util.extend(this,e)},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(e){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Raster"}),OpenLayers.Rule=OpenLayers.Class({id:null,name:null,title:null,description:null,context:null,filter:null,elseFilter:!1,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(e){this.symbolizer={},OpenLayers.Util.extend(this,e),this.symbolizers&&delete this.symbolizer,this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var e in this.symbolizer)this.symbolizer[e]=null;this.symbolizer=null,delete this.symbolizers},evaluate:function(e){var t=this.getContext(e),i=!0;if(this.minScaleDenominator||this.maxScaleDenominator)var n=e.layer.map.getScale();return this.minScaleDenominator&&(i=n>=OpenLayers.Style.createLiteral(this.minScaleDenominator,t)),i&&this.maxScaleDenominator&&(i=n<OpenLayers.Style.createLiteral(this.maxScaleDenominator,t)),i&&this.filter&&(i="OpenLayers.Filter.FeatureId"==this.filter.CLASS_NAME?this.filter.evaluate(e):this.filter.evaluate(t)),i},getContext:function(e){var t=this.context;return t||(t=e.attributes||e.data),"function"==typeof this.context&&(t=this.context(e)),t},clone:function(){var e=OpenLayers.Util.extend({},this);if(this.symbolizers){var t=this.symbolizers.length;e.symbolizers=new Array(t);for(var i=0;i<t;++i)e.symbolizers[i]=this.symbolizers[i].clone()}else{e.symbolizer={};var n,s;for(var r in this.symbolizer)"object"===(s=typeof(n=this.symbolizer[r]))?e.symbolizer[r]=OpenLayers.Util.extend({},n):"string"===s&&(e.symbolizer[r]=n)}return e.filter=this.filter&&this.filter.clone(),e.context=this.context&&OpenLayers.Util.extend({},this.context),new OpenLayers.Rule(e)},CLASS_NAME:"OpenLayers.Rule"}),OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{profile:null,defaultVersion:"1.0.0",stringifyOutput:!0,namedLayersAsArray:!1,CLASS_NAME:"OpenLayers.Format.SLD"}),OpenLayers.Symbolizer.Polygon=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(e){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Polygon"}),OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",initialize:function(e){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[e])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(e,t){var i={};this.readChildNodes(e,i),t.outer=i.components[0]},innerBoundaryIs:function(e,t){var i={};this.readChildNodes(e,i),t.inner.push(i.components[0])},Box:function(e,t){var i={};this.readChildNodes(e,i),t.components||(t.components=[]);var n=i.points[0],s=i.points[1];t.components.push(new OpenLayers.Bounds(n.x,n.y,s.x,s.y))}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(e){var t;t=OpenLayers.Util.isArray(e)?"wfs:FeatureCollection":"gml:featureMember";var i=this.writeNode(t,e);return this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(e){var t=this.createElementNSPlus("gml:Point");return this.writeNode("coordinates",[e],t),t},coordinates:function(e){for(var t,i=e.length,n=new Array(i),s=0;s<i;++s)t=e[s],this.xy?n[s]=t.x+","+t.y:n[s]=t.y+","+t.x,void 0!=t.z&&(n[s]+=","+t.z);return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:1==i?n[0]:n.join(" ")})},LineString:function(e){var t=this.createElementNSPlus("gml:LineString");return this.writeNode("coordinates",e.components,t),t},Polygon:function(e){var t=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",e.components[0],t);for(var i=1;i<e.components.length;++i)this.writeNode("innerBoundaryIs",e.components[i],t);return t},outerBoundaryIs:function(e){var t=this.createElementNSPlus("gml:outerBoundaryIs");return this.writeNode("LinearRing",e,t),t},innerBoundaryIs:function(e){var t=this.createElementNSPlus("gml:innerBoundaryIs");return this.writeNode("LinearRing",e,t),t},LinearRing:function(e){var t=this.createElementNSPlus("gml:LinearRing");return this.writeNode("coordinates",e.components,t),t},Box:function(e){var t=this.createElementNSPlus("gml:Box");return this.writeNode("coordinates",[{x:e.left,y:e.bottom},{x:e.right,y:e.top}],t),this.srsName&&t.setAttribute("srsName",this.srsName),t}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},CLASS_NAME:"OpenLayers.Format.GML.v2"}),OpenLayers.Format.Filter.v1_0_0=OpenLayers.Class(OpenLayers.Format.GML.v2,OpenLayers.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(e){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[e])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsNotEqualTo:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(e,i),t.filters.push(i)},PropertyIsLike:function(e,t){var i=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(e,i);var n=e.getAttribute("wildCard"),s=e.getAttribute("singleChar"),r=e.getAttribute("escape");i.value2regex(n,s,r),t.filters.push(i)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsNotEqualTo:function(e){var t=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");return this.writeNode("PropertyName",e,t),this.writeOgcExpression(e.value,t),t},PropertyIsLike:function(e){var t=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});return this.writeNode("PropertyName",e,t),this.writeNode("Literal",e.regex2value(),t),t},BBOX:function(e){var t=this.createElementNSPlus("ogc:BBOX");e.property&&this.writeNode("PropertyName",e,t);var i=this.writeNode("gml:Box",e.value,t);return e.projection&&i.setAttribute("srsName",e.projection),t}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},writeSpatial:function(e,t){var i=this.createElementNSPlus("ogc:"+t);if(this.writeNode("PropertyName",e,i),e.value instanceof OpenLayers.Filter.Function)this.writeNode("Function",e.value,i);else{var n;n=e.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",e.value).firstChild:this.writeNode("gml:Box",e.value),e.projection&&n.setAttribute("srsName",e.projection),i.appendChild(n)}return 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(e){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[e]),OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[e])},readNode:function(e,t,i){return OpenLayers.Format.GML.v2.prototype.readNode.apply(this,arguments)},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(e,t){t.insertIds=[],t.success=!1,this.readChildNodes(e,t)},InsertResult:function(e,t){var i={fids:[]};this.readChildNodes(e,i),t.insertIds=t.insertIds.concat(i.fids)},TransactionResult:function(e,t){this.readChildNodes(e,t)},Status:function(e,t){this.readChildNodes(e,t)},SUCCESS:function(e,t){t.success=!0}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(e){var t=(e=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName,srsNameInQuery:this.srsNameInQuery},e)).featurePrefix,i=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(t?t+":":"")+e.featureType}});if(e.srsNameInQuery&&e.srsName&&i.setAttribute("srsName",e.srsName),e.featureNS&&i.setAttribute("xmlns:"+t,e.featureNS),e.propertyNames)for(var n=0,s=e.propertyNames.length;n<s;n++)this.writeNode("ogc:PropertyName",{property:e.propertyNames[n]},i);return e.filter&&(this.setFilterProperty(e.filter),this.writeNode("ogc:Filter",e.filter,i)),i}},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(e){this.compare=e?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER,this.clear()},insert:function(e){this.exists(e)&&this.remove(e);var t=e.id;this.determineZIndex(e);for(var i,n=-1,s=this.order.length;s-n>1;)i=parseInt((n+s)/2),this.compare(this,e,OpenLayers.Util.getElement(this.order[i]))>0?n=i:s=i;return this.order.splice(s,0,t),this.indices[t]=this.getZIndex(e),this.getNextElement(s)},remove:function(e){var t=e.id,i=OpenLayers.Util.indexOf(this.order,t);if(i>=0)if(this.order.splice(i,1),delete this.indices[t],this.order.length>0){var n=this.order[this.order.length-1];this.maxZIndex=this.indices[n]}else this.maxZIndex=0},clear:function(){this.order=[],this.indices={},this.maxZIndex=0},exists:function(e){return null!=this.indices[e.id]},getZIndex:function(e){return e._style.graphicZIndex},determineZIndex:function(e){var t=e._style.graphicZIndex;null==t?(t=this.maxZIndex,e._style.graphicZIndex=t):t>this.maxZIndex&&(this.maxZIndex=t)},getNextElement:function(e){var t=e+1;if(t<this.order.length){var i=OpenLayers.Util.getElement(this.order[t]);return void 0==i&&(i=this.getNextElement(t)),i}return null},CLASS_NAME:"OpenLayers.ElementsIndexer"}),OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(e,t,i){var n=e.getZIndex(t),s=0;return i&&(s=n-e.getZIndex(i)),s},Z_ORDER_DRAWING_ORDER:function(e,t,i){var n=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(e,t,i);return i&&0==n&&(n=1),n},Z_ORDER_Y_ORDER:function(e,t,i){var n=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(e,t,i);if(i&&0===n){var s=i._boundsBottom-t._boundsBottom;n=0===s?1:s}return n}},OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,xOffset:0,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",LABEL_OUTLINE_SUFFIX:"_outline",initialize:function(e,t){OpenLayers.Renderer.prototype.initialize.apply(this,arguments),this.rendererRoot=this.createRenderRoot(),this.root=this.createRoot("_root"),this.vectorRoot=this.createRoot("_vroot"),this.textRoot=this.createRoot("_troot"),this.root.appendChild(this.vectorRoot),this.root.appendChild(this.textRoot),this.rendererRoot.appendChild(this.root),this.container.appendChild(this.rendererRoot),t&&(t.zIndexing||t.yOrdering)&&(this.indexer=new OpenLayers.ElementsIndexer(t.yOrdering))},destroy:function(){this.clear(),this.rendererRoot=null,this.root=null,this.xmlns=null,OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var e,t=this.vectorRoot;if(t)for(;e=t.firstChild;)t.removeChild(e);if(t=this.textRoot)for(;e=t.firstChild;)t.removeChild(e);this.indexer&&this.indexer.clear()},setExtent:function(e,t){var i=OpenLayers.Renderer.prototype.setExtent.apply(this,arguments),n=this.getResolution();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var s,r=e.getWidth()/this.map.getExtent().getWidth(),e=e.scale(1/r),a=this.map.getMaxExtent();a.right>e.left&&a.right<e.right?s=!0:a.left>e.left&&a.left<e.right&&(s=!1),(s!==this.rightOfDateLine||t)&&(i=!1,this.xOffset=!0===s?a.getWidth()/n:0),this.rightOfDateLine=s}return i},getNodeType:function(e,t){},drawGeometry:function(e,t,i){var n=e.CLASS_NAME,s=!0;if("OpenLayers.Geometry.Collection"==n||"OpenLayers.Geometry.MultiPoint"==n||"OpenLayers.Geometry.MultiLineString"==n||"OpenLayers.Geometry.MultiPolygon"==n){for(var r=0,a=e.components.length;r<a;r++)s=this.drawGeometry(e.components[r],t,i)&&s;return s}s=!1;var o=!1;if("none"!=t.display&&(t.backgroundGraphic?this.redrawBackgroundNode(e.id,e,t,i):o=!0,s=this.redrawNode(e.id,e,t,i)),0==s&&(l=document.getElementById(e.id))&&(l._style.backgroundGraphic&&(o=!0),l.parentNode.removeChild(l)),o){var l=document.getElementById(e.id+this.BACKGROUND_ID_SUFFIX);l&&l.parentNode.removeChild(l)}return s},redrawNode:function(e,t,i,n){i=this.applyDefaultSymbolizer(i);var s=this.nodeFactory(e,this.getNodeType(t,i));s._featureId=n,s._boundsBottom=t.getBounds().bottom,s._geometryClass=t.CLASS_NAME,s._style=i;var r=this.drawGeometryNode(s,t,i);if(!1===r)return!1;if(s=r.node,this.indexer){var a=this.indexer.insert(s);a?this.vectorRoot.insertBefore(s,a):this.vectorRoot.appendChild(s)}else s.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(s);return this.postDraw(s),r.complete},redrawBackgroundNode:function(e,t,i,n){var s=OpenLayers.Util.extend({},i);return s.externalGraphic=s.backgroundGraphic,s.graphicXOffset=s.backgroundXOffset,s.graphicYOffset=s.backgroundYOffset,s.graphicZIndex=s.backgroundGraphicZIndex,s.graphicWidth=s.backgroundWidth||s.graphicWidth,s.graphicHeight=s.backgroundHeight||s.graphicHeight,s.backgroundGraphic=null,s.backgroundXOffset=null,s.backgroundYOffset=null,s.backgroundGraphicZIndex=null,this.redrawNode(e+this.BACKGROUND_ID_SUFFIX,t,s,null)},drawGeometryNode:function(e,t,i){var n,s={isFilled:void 0===(i=i||e._style).fill||i.fill,isStroked:void 0===i.stroke?!!i.strokeWidth:i.stroke};switch(t.CLASS_NAME){case"OpenLayers.Geometry.Point":!1===i.graphic&&(s.isFilled=!1,s.isStroked=!1),n=this.drawPoint(e,t);break;case"OpenLayers.Geometry.LineString":s.isFilled=!1,n=this.drawLineString(e,t);break;case"OpenLayers.Geometry.LinearRing":n=this.drawLinearRing(e,t);break;case"OpenLayers.Geometry.Polygon":n=this.drawPolygon(e,t);break;case"OpenLayers.Geometry.Rectangle":n=this.drawRectangle(e,t)}return e._options=s,0!=n&&{node:this.setStyle(e,i,s,t),complete:n}},postDraw:function(e){},drawPoint:function(e,t){},drawLineString:function(e,t){},drawLinearRing:function(e,t){},drawPolygon:function(e,t){},drawRectangle:function(e,t){},drawCircle:function(e,t){},removeText:function(e){var t=document.getElementById(e+this.LABEL_ID_SUFFIX);t&&this.textRoot.removeChild(t);var i=document.getElementById(e+this.LABEL_OUTLINE_SUFFIX);i&&this.textRoot.removeChild(i)},getFeatureIdFromEvent:function(e){var t=e.target,i=t&&t.correspondingUseElement;return(i||(t||e.srcElement))._featureId},eraseGeometry:function(e,t){if("OpenLayers.Geometry.MultiPoint"==e.CLASS_NAME||"OpenLayers.Geometry.MultiLineString"==e.CLASS_NAME||"OpenLayers.Geometry.MultiPolygon"==e.CLASS_NAME||"OpenLayers.Geometry.Collection"==e.CLASS_NAME)for(var i=0,n=e.components.length;i<n;i++)this.eraseGeometry(e.components[i],t);else{var s=OpenLayers.Util.getElement(e.id);if(s&&s.parentNode&&(s.geometry&&(s.geometry.destroy(),s.geometry=null),s.parentNode.removeChild(s),this.indexer&&this.indexer.remove(s),s._style.backgroundGraphic)){var r=e.id+this.BACKGROUND_ID_SUFFIX,a=OpenLayers.Util.getElement(r);a&&a.parentNode&&a.parentNode.removeChild(a)}}},nodeFactory:function(e,t){var i=OpenLayers.Util.getElement(e);return i?this.nodeTypeCompare(i,t)||(i.parentNode.removeChild(i),i=this.nodeFactory(e,t)):i=this.createNode(t,e),i},nodeTypeCompare:function(e,t){},createNode:function(e,t){},moveRoot:function(e){var t=this.root;e.root.parentNode==this.rendererRoot&&(t=e.root),t.parentNode.removeChild(t),e.rendererRoot.appendChild(t)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(e){return"circle"!=e&&!!e},CLASS_NAME:"OpenLayers.Renderer.Elements"}),OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,getParameters:function(e){e=e||window.location.href;var t=OpenLayers.Util.getParameters(e),i=e.indexOf("#");return i>0&&(e="?"+e.substring(i+1,e.length),OpenLayers.Util.extend(t,OpenLayers.Util.getParameters(e))),t},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var t=0,i=this.map.controls.length;t<i;t++){var n=this.map.controls[t];if(n!=this&&"OpenLayers.Control.ArgParser"==n.CLASS_NAME){n.displayProjection!=this.displayProjection&&(this.displayProjection=n.displayProjection);break}}if(t==this.map.controls.length){var s=this.getParameters();s.layers&&(this.layers=s.layers,this.map.events.register("addlayer",this,this.configureLayers),this.configureLayers()),s.lat&&s.lon&&(this.center=new OpenLayers.LonLat(parseFloat(s.lon),parseFloat(s.lat)),s.zoom&&(this.zoom=parseFloat(s.zoom)),this.map.events.register("changebaselayer",this,this.setCenter),this.setCenter())}},setCenter:function(){this.map.baseLayer&&(this.map.events.unregister("changebaselayer",this,this.setCenter),this.displayProjection&&this.center.transform(this.displayProjection,this.map.getProjectionObject()),this.map.setCenter(this.center,this.zoom))},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var e=0,t=this.layers.length;e<t;e++){var i=this.map.layers[e],n=this.layers.charAt(e);"B"==n?this.map.setBaseLayer(i):"T"!=n&&"F"!=n||i.setVisibility("T"==n)}}},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(e,t,i){null===e||"object"!=typeof e||OpenLayers.Util.isElement(e)?(OpenLayers.Control.prototype.initialize.apply(this,[i]),this.element=OpenLayers.Util.getElement(e),this.base=t||document.location.href):(i=e,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&&this.element.parentNode==this.div&&(this.div.removeChild(this.element),this.element=null),this.map&&this.map.events.unregister("moveend",this,this.updateLink),OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var t=0,i=this.map.controls.length;t<i;t++){var n=this.map.controls[t];if(n.CLASS_NAME==this.argParserClass.CLASS_NAME){n.displayProjection!=this.displayProjection&&(this.displayProjection=n.displayProjection);break}}t==this.map.controls.length&&this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||this.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 e=this.anchor?"#":"?",t=this.base,i=null;-1!=t.indexOf("#")&&0==this.anchor&&(i=t.substring(t.indexOf("#"),t.length)),-1!=t.indexOf(e)&&(t=t.substring(0,t.indexOf(e))),t=t.split("#")[0]+e+OpenLayers.Util.getParameterString(this.createParams()),i&&(t+=i),this.anchor&&!this.element?window.location.href=t:this.element.href=t},createParams:function(e,t,i){e=e||this.map.getCenter();var n=OpenLayers.Util.getParameters(this.base);if(e){n.zoom=t||this.map.getZoom();var s=e.lat,r=e.lon;if(this.displayProjection){var a=OpenLayers.Projection.transform({x:r,y:s},this.map.getProjectionObject(),this.displayProjection);r=a.x,s=a.y}n.lat=Math.round(1e5*s)/1e5,n.lon=Math.round(1e5*r)/1e5,i=i||this.map.layers,n.layers="";for(var o=0,l=i.length;o<l;o++){var h=i[o];h.isBaseLayer?n.layers+=h==this.map.baseLayer?"B":"0":n.layers+=h.getVisibility()?"T":"F"}}return n},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(e,t,i){var n=[];n.push(e,t,{},i),OpenLayers.Layer.Grid.prototype.initialize.apply(this,n)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.TMS(this.name,this.url,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){e=this.adjustBounds(e);var t=this.getServerResolution(),i=Math.round((e.left-this.tileOrigin.lon)/(t*this.tileSize.w)),n=Math.round((e.bottom-this.tileOrigin.lat)/(t*this.tileSize.h)),s=this.getServerZoom(),r=this.serviceVersion+"/"+this.layername+"/"+s+"/"+i+"/"+n+"."+this.type,a=this.url;return OpenLayers.Util.isArray(a)&&(a=this.selectUrl(r,a)),a+r},setMap:function(e){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.TMS"}),OpenLayers.Format.WCSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",CLASS_NAME:"OpenLayers.Format.WCSCapabilities"}),OpenLayers.Format.WCSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g,splitSpace:/\s+/},defaultPrefix:"wcs",read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1"}),OpenLayers.Format.WCSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1,{namespaces:{wcs:"http://www.opengis.net/wcs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows"},errorProperty:"service",readers:{wcs:{WCS_Capabilities:function(e,t){this.readChildNodes(e,t)},Service:function(e,t){t.service={},this.readChildNodes(e,t.service)},name:function(e,t){t.name=this.getChildValue(e)},label:function(e,t){t.label=this.getChildValue(e)},keywords:function(e,t){t.keywords=[],this.readChildNodes(e,t.keywords)},keyword:function(e,t){t.push(this.getChildValue(e))},responsibleParty:function(e,t){t.responsibleParty={},this.readChildNodes(e,t.responsibleParty)},individualName:function(e,t){t.individualName=this.getChildValue(e)},organisationName:function(e,t){t.organisationName=this.getChildValue(e)},positionName:function(e,t){t.positionName=this.getChildValue(e)},contactInfo:function(e,t){t.contactInfo={},this.readChildNodes(e,t.contactInfo)},phone:function(e,t){t.phone={},this.readChildNodes(e,t.phone)},voice:function(e,t){t.voice=this.getChildValue(e)},facsimile:function(e,t){t.facsimile=this.getChildValue(e)},address:function(e,t){t.address={},this.readChildNodes(e,t.address)},deliveryPoint:function(e,t){t.deliveryPoint=this.getChildValue(e)},city:function(e,t){t.city=this.getChildValue(e)},postalCode:function(e,t){t.postalCode=this.getChildValue(e)},country:function(e,t){t.country=this.getChildValue(e)},electronicMailAddress:function(e,t){t.electronicMailAddress=this.getChildValue(e)},fees:function(e,t){t.fees=this.getChildValue(e)},accessConstraints:function(e,t){t.accessConstraints=this.getChildValue(e)},ContentMetadata:function(e,t){t.contentMetadata=[],this.readChildNodes(e,t.contentMetadata)},CoverageOfferingBrief:function(e,t){var i={};this.readChildNodes(e,i),t.push(i)},name:function(e,t){t.name=this.getChildValue(e)},label:function(e,t){t.label=this.getChildValue(e)},lonLatEnvelope:function(e,t){var i=this.getElementsByTagNameNS(e,"http://www.opengis.net/gml","pos");if(2==i.length){var n={},s={};OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[i[0],n]),OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[i[1],s]),t.lonLatEnvelope={},t.lonLatEnvelope.srsName=e.getAttribute("srsName"),t.lonLatEnvelope.min=n.points[0],t.lonLatEnvelope.max=s.points[0]}}}},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1_0_0"}),OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:!1,activate:function(){var e=OpenLayers.Strategy.prototype.activate.apply(this,arguments);return e&&(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})),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this}),e},load:function(e){var t=this.layer;t.events.triggerEvent("loadstart",{filter:t.filter}),t.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,filter:t.filter,scope:this},e)),t.events.un({visibilitychanged:this.load,scope:this})},merge:function(e){var t=this.layer;t.destroyFeatures();var i=e.features;if(i&&i.length>0){var n=t.projection,s=t.map.getProjectionObject();if(!s.equals(n))for(var r,a=0,o=i.length;a<o;++a)(r=i[a].geometry)&&r.transform(n,s);t.addFeatures(i)}t.events.triggerEvent("loadend",{response:e})},CLASS_NAME:"OpenLayers.Strategy.Fixed"}),OpenLayers.Control.Zoom=OpenLayers.Class(OpenLayers.Control,{zoomInText:"+",zoomInId:"olZoomInLink",zoomOutText:"",zoomOutId:"olZoomOutLink",draw:function(){var e=OpenLayers.Control.prototype.draw.apply(this),t=this.getOrCreateLinks(e),i=t.zoomIn,n=t.zoomOut,s=this.map.events;return n.parentNode!==e&&(s=this.events).attachToElement(n.parentNode),s.register("buttonclick",this,this.onZoomClick),this.zoomInLink=i,this.zoomOutLink=n,e},getOrCreateLinks:function(e){var t=document.getElementById(this.zoomInId),i=document.getElementById(this.zoomOutId);return t||((t=document.createElement("a")).href="#zoomIn",t.appendChild(document.createTextNode(this.zoomInText)),t.className="olControlZoomIn",e.appendChild(t)),OpenLayers.Element.addClass(t,"olButton"),i||((i=document.createElement("a")).href="#zoomOut",i.appendChild(document.createTextNode(this.zoomOutText)),i.className="olControlZoomOut",e.appendChild(i)),OpenLayers.Element.addClass(i,"olButton"),{zoomIn:t,zoomOut:i}},onZoomClick:function(e){var t=e.buttonElement;t===this.zoomInLink?this.map.zoomIn():t===this.zoomOutLink&&this.map.zoomOut()},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onZoomClick),delete this.zoomInLink,delete this.zoomOutLink,OpenLayers.Control.prototype.destroy.apply(this)},CLASS_NAME:"OpenLayers.Control.Zoom"}),OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,styleFrom:null,addNodes:function(e,t){if(e.length<2)throw new Error("At least two point features have to be added to create a line from");for(var i,n,s,r=new Array(e.length-1),a=0,o=e.length;a<o;a++){if(i=e[a],s=i.geometry){if("OpenLayers.Geometry.Point"!=s.CLASS_NAME)throw new TypeError("Only features with point geometries are supported.")}else{var l=i.lonlat;s=new OpenLayers.Geometry.Point(l.lon,l.lat)}if(a>0){var h=null!=this.dataFrom?e[a+this.dataFrom].data||e[a+this.dataFrom].attributes:null,u=null!=this.styleFrom?e[a+this.styleFrom].style:null,p=new OpenLayers.Geometry.LineString([n,s]);r[a-1]=new OpenLayers.Feature.Vector(p,h,u)}n=s}this.addFeatures(r,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(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Protocol.WFS.DEFAULTS);var t=OpenLayers.Protocol.WFS["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported WFS version: "+e.version;return new t(e)},OpenLayers.Protocol.WFS.fromWMSLayer=function(e,t){var i,n,s=e.params.LAYERS,r=(OpenLayers.Util.isArray(s)?s[0]:s).split(":");r.length>1&&(n=r[0]),i=r.pop();var a={url:e.url,featureType:i,featurePrefix:n,srsName:e.projection&&e.projection.getCode()||e.map&&e.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(t,a))},OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"},OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,markers:null,drawn:!1,initialize:function(e,t){OpenLayers.Layer.prototype.initialize.apply(this,arguments),this.markers=[]},destroy:function(){this.clearMarkers(),this.markers=null,OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(e){if(e!=this.opacity){this.opacity=e;for(var t=0,i=this.markers.length;t<i;t++)this.markers[t].setOpacity(this.opacity)}},moveTo:function(e,t,i){if(OpenLayers.Layer.prototype.moveTo.apply(this,arguments),t||!this.drawn){for(var n=0,s=this.markers.length;n<s;n++)this.drawMarker(this.markers[n]);this.drawn=!0}},addMarker:function(e){this.markers.push(e),this.opacity<1&&e.setOpacity(this.opacity),this.map&&this.map.getExtent()&&(e.map=this.map,this.drawMarker(e))},removeMarker:function(e){this.markers&&this.markers.length&&(OpenLayers.Util.removeItem(this.markers,e),e.erase())},clearMarkers:function(){if(null!=this.markers)for(;this.markers.length>0;)this.removeMarker(this.markers[0])},drawMarker:function(e){var t=this.map.getLayerPxFromLonLat(e.lonlat);if(null==t)e.display(!1);else if(e.isDrawn())e.icon&&e.icon.moveTo(t);else{var i=e.draw(t);this.div.appendChild(i)}},getDataExtent:function(){e=null;if(this.markers&&this.markers.length>0)for(var e=new OpenLayers.Bounds,t=0,i=this.markers.length;t<i;t++){var n=this.markers[t];e.extend(n.lonlat)}return e},CLASS_NAME:"OpenLayers.Layer.Markers"}),OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control.Button,{slideFactor:50,slideRatio:null,direction:null,initialize:function(e,t){this.direction=e,this.CLASS_NAME+=this.direction,OpenLayers.Control.prototype.initialize.apply(this,[t])},trigger:function(){if(this.map){var e=OpenLayers.Function.bind(function(e){return this.slideRatio?this.map.getSize()[e]*this.slideRatio:this.slideFactor},this);switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-e("h"));break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,e("h"));break;case OpenLayers.Control.Pan.WEST:this.map.pan(-e("w"),0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(e("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.Format.CSWGetDomain=function(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Format.CSWGetDomain.DEFAULTS);var t=OpenLayers.Format.CSWGetDomain["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSWGetDomain version: "+e.version;return new t(e)},OpenLayers.Format.CSWGetDomain.DEFAULTS={version:"2.0.2"},OpenLayers.Format.CSWGetDomain.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",csw:"http://www.opengis.net/cat/csw/2.0.2"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",PropertyName:null,ParameterName:null,read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},readers:{csw:{GetDomainResponse:function(e,t){this.readChildNodes(e,t)},DomainValues:function(e,t){OpenLayers.Util.isArray(t.DomainValues)||(t.DomainValues=[]);for(var i=e.attributes,n={},s=0,r=i.length;s<r;++s)n[i[s].name]=i[s].nodeValue;this.readChildNodes(e,n),t.DomainValues.push(n)},PropertyName:function(e,t){t.PropertyName=this.getChildValue(e)},ParameterName:function(e,t){t.ParameterName=this.getChildValue(e)},ListOfValues:function(e,t){OpenLayers.Util.isArray(t.ListOfValues)||(t.ListOfValues=[]),this.readChildNodes(e,t.ListOfValues)},Value:function(e,t){for(var i=e.attributes,n={},s=0,r=i.length;s<r;++s)n[i[s].name]=i[s].nodeValue;n.value=this.getChildValue(e),t.push({Value:n})},ConceptualScheme:function(e,t){t.ConceptualScheme={},this.readChildNodes(e,t.ConceptualScheme)},Name:function(e,t){t.Name=this.getChildValue(e)},Document:function(e,t){t.Document=this.getChildValue(e)},Authority:function(e,t){t.Authority=this.getChildValue(e)},RangeOfValues:function(e,t){t.RangeOfValues={},this.readChildNodes(e,t.RangeOfValues)},MinValue:function(e,t){for(var i=e.attributes,n={},s=0,r=i.length;s<r;++s)n[i[s].name]=i[s].nodeValue;n.value=this.getChildValue(e),t.MinValue=n},MaxValue:function(e,t){for(var i=e.attributes,n={},s=0,r=i.length;s<r;++s)n[i[s].name]=i[s].nodeValue;n.value=this.getChildValue(e),t.MaxValue=n}}},write:function(e){var t=this.writeNode("csw:GetDomain",e);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{csw:{GetDomain:function(e){var t=this.createElementNSPlus("csw:GetDomain",{attributes:{service:"CSW",version:this.version}});return e.PropertyName||this.PropertyName?this.writeNode("csw:PropertyName",e.PropertyName||this.PropertyName,t):(e.ParameterName||this.ParameterName)&&this.writeNode("csw:ParameterName",e.ParameterName||this.ParameterName,t),this.readChildNodes(t,e),t},PropertyName:function(e){return this.createElementNSPlus("csw:PropertyName",{value:e})},ParameterName:function(e){return this.createElementNSPlus("csw:ParameterName",{value:e})}}},CLASS_NAME:"OpenLayers.Format.CSWGetDomain.v2_0_2"}),OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{read:function(e){return(new OpenLayers.Format.ArcXML).read(e).features.feature}}),OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{DEFAULTS:{tolerance:10,node:!0,edge:!0,vertex:!0},greedy:!0,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,[e]),this.options=e||{},this.options.layer&&this.setLayer(this.options.layer);var t=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(t,this.DEFAULTS),this.setTargets(this.options.targets),0===this.targets.length&&this.layer&&this.addTargetLayer(this.layer),this.geoToleranceCache={}},setLayer:function(e){this.active?(this.deactivate(),this.layer=e,this.activate()):this.layer=e},setTargets:function(e){if(this.targets=[],e&&e.length)for(var t,i=0,n=e.length;i<n;++i)(t=e[i])instanceof OpenLayers.Layer.Vector?this.addTargetLayer(t):this.addTarget(t)},addTargetLayer:function(e){this.addTarget({layer:e})},addTarget:function(e){(e=OpenLayers.Util.applyDefaults(e,this.defaults)).nodeTolerance=e.nodeTolerance||e.tolerance,e.vertexTolerance=e.vertexTolerance||e.tolerance,e.edgeTolerance=e.edgeTolerance||e.tolerance,this.targets.push(e)},removeTargetLayer:function(e){for(var t,i=this.targets.length-1;i>=0;--i)(t=this.targets[i]).layer===e&&this.removeTarget(t)},removeTarget:function(e){return OpenLayers.Util.removeItem(this.targets,e)},activate:function(){var e=OpenLayers.Control.prototype.activate.call(this);return e&&this.layer&&this.layer.events&&this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this}),e},deactivate:function(){var e=OpenLayers.Control.prototype.deactivate.call(this);return e&&this.layer&&this.layer.events&&this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this}),this.feature=null,this.point=null,e},onSketchModified:function(e){this.feature=e.feature,this.considerSnapping(e.vertex,e.vertex)},onVertexModified:function(e){this.feature=e.feature;var t=this.layer.map.getLonLatFromViewPortPx(e.pixel);this.considerSnapping(e.vertex,new OpenLayers.Geometry.Point(t.lon,t.lat))},considerSnapping:function(e,t){for(var i,n,s={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null},r=!1,a=0,o=this.targets.length;a<o;++a)if(n=this.targets[a],i=this.testTarget(n,t)){if(this.greedy){(s=i).target=n,r=!0;break}(i.rank<s.rank||i.rank===s.rank&&i.dist<s.dist)&&((s=i).target=n,r=!0)}r&&(!1!==this.events.triggerEvent("beforesnap",{point:e,x:s.x,y:s.y,distance:s.dist,layer:s.target.layer,snapType:this.precedence[s.rank]})?(e.x=s.x,e.y=s.y,this.point=e,this.events.triggerEvent("snap",{point:e,snapType:this.precedence[s.rank],layer:s.target.layer,distance:s.dist})):r=!1),this.point&&!r&&(e.x=t.x,e.y=t.y,this.point=null,this.events.triggerEvent("unsnap",{point:e}))},testTarget:function(e,t){var i=this.layer.map.getResolution();if("minResolution"in e&&i<e.minResolution)return null;if("maxResolution"in e&&i>=e.maxResolution)return null;for(var n,s,r,a,o,l,h,u={node:this.getGeoTolerance(e.nodeTolerance,i),vertex:this.getGeoTolerance(e.vertexTolerance,i),edge:this.getGeoTolerance(e.edgeTolerance,i)},p=Math.max(u.node,u.vertex,u.edge),c={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY},d=!1,f=e.layer.features,m=this.precedence.length,y=new OpenLayers.LonLat(t.x,t.y),g=0,v=f.length;g<v;++g)if((n=f[g])!==this.feature&&!n._sketch&&n.state!==OpenLayers.State.DELETE&&(!e.filter||e.filter.evaluate(n))&&n.atPoint(y,p,p))for(var L=0,O=Math.min(c.rank+1,m);L<O;++L)if(s=this.precedence[L],e[s])if("edge"===s){if(o=n.geometry.distanceTo(t,{details:!0}),(l=o.distance)<=u[s]&&l<c.dist){c={rank:L,dist:l,x:o.x0,y:o.y0},d=!0;break}}else{h=!1;for(var b=0,w=(r=n.geometry.getVertices("node"===s)).length;b<w;++b)(l=(a=r[b]).distanceTo(t))<=u[s]&&(L<c.rank||L===c.rank&&l<c.dist)&&(c={rank:L,dist:l,x:a.x,y:a.y},d=!0,h=!0);if(h)break}return d?c:null},getGeoTolerance:function(e,t){t!==this.resolution&&(this.resolution=t,this.geoToleranceCache={});var i=this.geoToleranceCache[e];return void 0===i&&(i=e*t,this.geoToleranceCache[e]=i),i},destroy:function(){this.active&&this.deactivate(),delete this.layer,delete this.targets,OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"}),OpenLayers.Format.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(e,t){t.exceptionReport={version:e.getAttribute("version"),language:e.getAttribute("xml:lang"),exceptions:[]},this.readChildNodes(e,t.exceptionReport)},AllowedValues:function(e,t){t.allowedValues={},this.readChildNodes(e,t.allowedValues)},AnyValue:function(e,t){t.anyValue=!0},DataType:function(e,t){t.dataType=this.getChildValue(e)},Range:function(e,t){t.range={},this.readChildNodes(e,t.range)},MinimumValue:function(e,t){t.minValue=this.getChildValue(e)},MaximumValue:function(e,t){t.maxValue=this.getChildValue(e)},Identifier:function(e,t){t.identifier=this.getChildValue(e)},SupportedCRS:function(e,t){t.supportedCRS=this.getChildValue(e)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Util.applyDefaults({Range:function(e){var t=this.createElementNSPlus("ows:Range",{attributes:{"ows:rangeClosure":e.closure}});return this.writeNode("ows:MinimumValue",e.minValue,t),this.writeNode("ows:MaximumValue",e.maxValue,t),t},MinimumValue:function(e){return this.createElementNSPlus("ows:MinimumValue",{value:e})},MaximumValue:function(e){return this.createElementNSPlus("ows:MaximumValue",{value:e})},Value:function(e){return this.createElementNSPlus("ows:Value",{value:e})}},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(e){var t=this.writeNode("wcs:GetCoverage",e);return this.setAttributeNS(t,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{wcs:{GetCoverage:function(e){var t=this.createElementNSPlus("wcs:GetCoverage",{attributes:{version:e.version||this.VERSION,service:"WCS"}});return this.writeNode("ows:Identifier",e.identifier,t),this.writeNode("wcs:DomainSubset",e.domainSubset,t),this.writeNode("wcs:Output",e.output,t),t},DomainSubset:function(e){var t=this.createElementNSPlus("wcs:DomainSubset",{});return this.writeNode("ows:BoundingBox",e.boundingBox,t),e.temporalSubset&&this.writeNode("wcs:TemporalSubset",e.temporalSubset,t),t},TemporalSubset:function(e){for(var t=this.createElementNSPlus("wcs:TemporalSubset",{}),i=0,n=e.timePeriods.length;i<n;++i)this.writeNode("wcs:TimePeriod",e.timePeriods[i],t);return t},TimePeriod:function(e){var t=this.createElementNSPlus("wcs:TimePeriod",{});return this.writeNode("wcs:BeginPosition",e.begin,t),this.writeNode("wcs:EndPosition",e.end,t),e.resolution&&this.writeNode("wcs:TimeResolution",e.resolution,t),t},BeginPosition:function(e){return this.createElementNSPlus("wcs:BeginPosition",{value:e})},EndPosition:function(e){return this.createElementNSPlus("wcs:EndPosition",{value:e})},TimeResolution:function(e){return this.createElementNSPlus("wcs:TimeResolution",{value:e})},Output:function(e){var t=this.createElementNSPlus("wcs:Output",{attributes:{format:e.format,store:e.store}});return e.gridCRS&&this.writeNode("wcs:GridCRS",e.gridCRS,t),t},GridCRS:function(e){var t=this.createElementNSPlus("wcs:GridCRS",{});return this.writeNode("wcs:GridBaseCRS",e.baseCRS,t),e.type&&this.writeNode("wcs:GridType",e.type,t),e.origin&&this.writeNode("wcs:GridOrigin",e.origin,t),this.writeNode("wcs:GridOffsets",e.offsets,t),e.CS&&this.writeNode("wcs:GridCS",e.CS,t),t},GridBaseCRS:function(e){return this.createElementNSPlus("wcs:GridBaseCRS",{value:e})},GridOrigin:function(e){return this.createElementNSPlus("wcs:GridOrigin",{value:e})},GridType:function(e){return this.createElementNSPlus("wcs:GridType",{value:e})},GridOffsets:function(e){return this.createElementNSPlus("wcs:GridOffsets",{value:e})},GridCS:function(e){return this.createElementNSPlus("wcs:GridCS",{value:e})}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.WCSGetCoverage"}),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,kvpAttributes:!1,extractStyles:!1,extractTracks:!1,trackAttributes:null,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(e){this.regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,kmlColor:/(\w{2})(\w{2})(\w{2})(\w{2})/,kmlIconPalette:/root:\/\/icons\/palette-(\d+)(\.\w+)/,straightBracket:/\$\[(.*?)\]/g},this.externalProjection=new OpenLayers.Projection("EPSG:4326"),OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){this.features=[],this.styles={},this.fetched={};var t={depth:0,styleBaseUrl:this.styleBaseUrl};return this.parseData(e,t)},parseData:function(e,t){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));for(var i=["Link","NetworkLink","Style","StyleMap","Placemark"],n=0,s=i.length;n<s;++n){var r=i[n],a=this.getElementsByTagNameNS(e,"*",r);if(0!=a.length)switch(r.toLowerCase()){case"link":case"networklink":this.parseLinks(a,t);break;case"style":this.extractStyles&&this.parseStyles(a,t);break;case"stylemap":this.extractStyles&&this.parseStyleMaps(a,t);break;case"placemark":this.parseFeatures(a,t)}}return this.features},parseLinks:function(e,t){if(t.depth>=this.maxDepth)return!1;var i=OpenLayers.Util.extend({},t);i.depth++;for(var n=0,s=e.length;n<s;n++){var r=this.parseProperty(e[n],"*","href");if(r&&!this.fetched[r]){this.fetched[r]=!0;var a=this.fetchLink(r);a&&this.parseData(a,i)}}},fetchLink:function(e){var t=OpenLayers.Request.GET({url:e,async:!1});if(t)return t.responseText},parseStyles:function(e,t){for(var i=0,n=e.length;i<n;i++){var s=this.parseStyle(e[i]);if(s){var r=(t.styleBaseUrl||"")+"#"+s.id;this.styles[r]=s}}},parseKmlColor:function(e){var t=null;if(e){var i=e.match(this.regExes.kmlColor);i&&(t={color:"#"+i[4]+i[3]+i[2],opacity:parseInt(i[1],16)/255})}return t},parseStyle:function(e){for(var t,i,n={},s=["LineStyle","PolyStyle","IconStyle","BalloonStyle","LabelStyle"],r=0,a=s.length;r<a;++r)if(t=s[r],i=this.getElementsByTagNameNS(e,"*",t)[0])switch(t.toLowerCase()){case"linestyle":C=this.parseProperty(i,"*","color");(x=this.parseKmlColor(C))&&(n.strokeColor=x.color,n.strokeOpacity=x.opacity),(l=this.parseProperty(i,"*","width"))&&(n.strokeWidth=l);break;case"polystyle":C=this.parseProperty(i,"*","color");(x=this.parseKmlColor(C))&&(n.fillOpacity=x.opacity,n.fillColor=x.color),"0"==this.parseProperty(i,"*","fill")&&(n.fillColor="none"),"0"==this.parseProperty(i,"*","outline")&&(n.strokeWidth="0");break;case"iconstyle":var o=parseFloat(this.parseProperty(i,"*","scale")||1),l=32*o,h=32*o,u=this.getElementsByTagNameNS(i,"*","Icon")[0];if(u){var p=this.parseProperty(u,"*","href");if(p){var c=this.parseProperty(u,"*","w"),d=this.parseProperty(u,"*","h");!OpenLayers.String.startsWith(p,"http://maps.google.com/mapfiles/kml")||c||d||(c=64,d=64,o/=2),c=c||d,d=d||c,c&&(l=parseInt(c)*o),d&&(h=parseInt(d)*o);var f=p.match(this.regExes.kmlIconPalette);if(f){var m=f[1],y=f[2],g=this.parseProperty(u,"*","x"),v=this.parseProperty(u,"*","y"),L=g?g/32:0;p="http://maps.google.com/mapfiles/kml/pal"+m+"/icon"+(8*(v?7-v/32:7)+L)+y}n.graphicOpacity=1,n.externalGraphic=p}}var O=this.getElementsByTagNameNS(i,"*","hotSpot")[0];if(O){var g=parseFloat(O.getAttribute("x")),v=parseFloat(O.getAttribute("y")),b=O.getAttribute("xunits");"pixels"==b?n.graphicXOffset=-g*o:"insetPixels"==b?n.graphicXOffset=g*o-l:"fraction"==b&&(n.graphicXOffset=-l*g);var w=O.getAttribute("yunits");"pixels"==w?n.graphicYOffset=v*o-h+1:"insetPixels"==w?n.graphicYOffset=-v*o+1:"fraction"==w&&(n.graphicYOffset=-h*(1-v)+1)}n.graphicWidth=l,n.graphicHeight=h;break;case"balloonstyle":var S=OpenLayers.Util.getXmlNodeValue(i);S&&(n.balloonStyle=S.replace(this.regExes.straightBracket,"${$1}"));break;case"labelstyle":var C=this.parseProperty(i,"*","color"),x=this.parseKmlColor(C);x&&(n.fontColor=x.color,n.fontOpacity=x.opacity)}!n.strokeColor&&n.fillColor&&(n.strokeColor=n.fillColor);var _=e.getAttribute("id");return _&&n&&(n.id=_),n},parseStyleMaps:function(e,t){for(var i=0,n=e.length;i<n;i++)for(var s=e[i],r=this.getElementsByTagNameNS(s,"*","Pair"),a=s.getAttribute("id"),o=0,l=r.length;o<l;o++){var h=r[o],u=this.parseProperty(h,"*","key"),p=this.parseProperty(h,"*","styleUrl");p&&"normal"==u&&(this.styles[(t.styleBaseUrl||"")+"#"+a]=this.styles[(t.styleBaseUrl||"")+p])}},parseFeatures:function(e,t){for(var i=[],n=0,s=e.length;n<s;n++){var r=e[n],a=this.parseFeature.apply(this,[r]);if(!a)throw"Bad Placemark: "+n;if(this.extractStyles&&a.attributes&&a.attributes.styleUrl&&(a.style=this.getStyle(a.attributes.styleUrl,t)),this.extractStyles){var o=this.getElementsByTagNameNS(r,"*","Style")[0];if(o){var l=this.parseStyle(o);l&&(a.style=OpenLayers.Util.extend(a.style,l))}}if(this.extractTracks){var h=this.getElementsByTagNameNS(r,this.namespaces.gx,"Track");if(h&&h.length>0){var u=h[0],p={features:[],feature:a};this.readNode(u,p),p.features.length>0&&i.push.apply(i,p.features)}}else i.push(a)}this.features=this.features.concat(i)},readers:{kml:{when:function(e,t){t.whens.push(OpenLayers.Date.parse(this.getChildValue(e)))},_trackPointAttribute:function(e,t){var i=e.nodeName.split(":").pop();t.attributes[i].push(this.getChildValue(e))}},gx:{Track:function(e,t){var i={whens:[],points:[],angles:[]};if(this.trackAttributes){i.attributes={};for(var n=0,s=this.trackAttributes.length;n<s;++n)p=this.trackAttributes[n],i.attributes[p]=[],p in this.readers.kml||(this.readers.kml[p]=this.readers.kml._trackPointAttribute)}if(this.readChildNodes(e,i),i.whens.length!==i.points.length)throw new Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:coord ("+i.points.length+") elements.");var r=i.angles.length>0;if(r&&i.whens.length!==i.angles.length)throw new Error("gx:Track with unequal number of when ("+i.whens.length+") and gx:angles ("+i.angles.length+") elements.");for(var a,o,l,n=0,s=i.whens.length;n<s;++n){if(a=t.feature.clone(),a.fid=t.feature.fid||t.feature.id,o=i.points[n],a.geometry=o,"z"in o&&(a.attributes.altitude=o.z),this.internalProjection&&this.externalProjection&&a.geometry.transform(this.externalProjection,this.internalProjection),this.trackAttributes)for(var h=0,u=this.trackAttributes.length;h<u;++h){var p=this.trackAttributes[h];a.attributes[p]=i.attributes[p][n]}a.attributes.when=i.whens[n],a.attributes.trackId=t.feature.id,r&&(l=i.angles[n],a.attributes.heading=parseFloat(l[0]),a.attributes.tilt=parseFloat(l[1]),a.attributes.roll=parseFloat(l[2])),t.features.push(a)}},coord:function(e,t){var i=this.getChildValue(e).replace(this.regExes.trimSpace,"").split(/\s+/),n=new OpenLayers.Geometry.Point(i[0],i[1]);i.length>2&&(n.z=parseFloat(i[2])),t.points.push(n)},angles:function(e,t){var i=this.getChildValue(e).replace(this.regExes.trimSpace,"").split(/\s+/);t.angles.push(i)}}},parseFeature:function(e){for(var t,i,n,s,r=["MultiGeometry","Polygon","LineString","Point"],a=0,o=r.length;a<o;++a)if(t=r[a],this.internalns=e.namespaceURI?e.namespaceURI:this.kmlns,(i=this.getElementsByTagNameNS(e,this.internalns,t)).length>0){if(!(s=this.parseGeometry[t.toLowerCase()]))throw new TypeError("Unsupported geometry type: "+t);n=s.apply(this,[i[0]]),this.internalProjection&&this.externalProjection&&n.transform(this.externalProjection,this.internalProjection);break}var l;this.extractAttributes&&(l=this.parseAttributes(e));var h=new OpenLayers.Feature.Vector(n,l),u=e.getAttribute("id")||e.getAttribute("name");return null!=u&&(h.fid=u),h},getStyle:function(e,t){var i=OpenLayers.Util.removeTail(e),n=OpenLayers.Util.extend({},t);if(n.depth++,n.styleBaseUrl=i,!this.styles[e]&&!OpenLayers.String.startsWith(e,"#")&&n.depth<=this.maxDepth&&!this.fetched[i]){var s=this.fetchLink(i);s&&this.parseData(s,n)}return OpenLayers.Util.extend({},this.styles[e])},parseGeometry:{point:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,"coordinates"),i=[];if(t.length>0){var n=t[0].firstChild.nodeValue;i=(n=n.replace(this.regExes.removeSpace,"")).split(",")}if(!(i.length>1))throw"Bad coordinate string: "+n;return 2==i.length&&(i[2]=null),new OpenLayers.Geometry.Point(i[0],i[1],i[2])},linestring:function(e,t){var i=this.getElementsByTagNameNS(e,this.internalns,"coordinates"),n=null;if(i.length>0){for(var s,r=this.getChildValue(i[0]),a=(r=(r=r.replace(this.regExes.trimSpace,"")).replace(this.regExes.trimComma,",")).split(this.regExes.splitSpace),o=a.length,l=new Array(o),h=0;h<o;++h){if(s=a[h].split(","),!(s.length>1))throw"Bad LineString point coordinates: "+a[h];2==s.length&&(s[2]=null),l[h]=new OpenLayers.Geometry.Point(s[0],s[1],s[2])}if(!o)throw"Bad LineString coordinates: "+r;n=t?new OpenLayers.Geometry.LinearRing(l):new OpenLayers.Geometry.LineString(l)}return n},polygon:function(e){var t=this.getElementsByTagNameNS(e,this.internalns,"LinearRing"),i=t.length,n=new Array(i);if(i>0)for(var s,r=0,a=t.length;r<a;++r){if(!(s=this.parseGeometry.linestring.apply(this,[t[r],!0])))throw"Bad LinearRing geometry: "+r;n[r]=s}return new OpenLayers.Geometry.Polygon(n)},multigeometry:function(e){for(var t,i,n=[],s=e.childNodes,r=0,a=s.length;r<a;++r)if(1==(t=s[r]).nodeType){var o=t.prefix?t.nodeName.split(":")[1]:t.nodeName;(i=this.parseGeometry[o.toLowerCase()])&&n.push(i.apply(this,[t]))}return new OpenLayers.Geometry.Collection(n)}},parseAttributes:function(e){var t={},i=e.getElementsByTagName("ExtendedData");i.length&&(t=this.parseExtendedData(i[0]));for(var n,s,r=e.childNodes,a=0,o=r.length;a<o;++a)if(1==(n=r[a]).nodeType&&(s=n.childNodes).length>=1&&s.length<=3){var l;switch(s.length){case 1:l=s[0];break;case 2:var h=s[0],u=s[1];l=3==h.nodeType||4==h.nodeType?h:u;break;case 3:default:l=s[1]}if(3==l.nodeType||4==l.nodeType){var p=n.prefix?n.nodeName.split(":")[1]:n.nodeName,c=OpenLayers.Util.getXmlNodeValue(l);c&&(c=c.replace(this.regExes.trimSpace,""),t[p]=c)}}return t},parseExtendedData:function(e){var t,i,n,s,r={},a=e.getElementsByTagName("Data");for(t=0,i=a.length;t<i;t++){s=(n=a[t]).getAttribute("name");var o={},l=n.getElementsByTagName("value");if(l.length&&(o.value=this.getChildValue(l[0])),this.kvpAttributes)r[s]=o.value;else{var h=n.getElementsByTagName("displayName");h.length&&(o.displayName=this.getChildValue(h[0])),r[s]=o}}var u=e.getElementsByTagName("SimpleData");for(t=0,i=u.length;t<i;t++){o={};s=(n=u[t]).getAttribute("name"),o.value=this.getChildValue(n),this.kvpAttributes?r[s]=o.value:(o.displayName=s,r[s]=o)}return r},parseProperty:function(e,t,i){var n,s=this.getElementsByTagNameNS(e,t,i);try{n=OpenLayers.Util.getXmlNodeValue(s[0])}catch(e){n=null}return n},write:function(e){OpenLayers.Util.isArray(e)||(e=[e]);for(var t=this.createElementNS(this.kmlns,"kml"),i=this.createFolderXML(),n=0,s=e.length;n<s;++n)i.appendChild(this.createPlacemarkXML(e[n]));return t.appendChild(i),OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFolderXML:function(){var e=this.createElementNS(this.kmlns,"Folder");if(this.foldersName){var t=this.createElementNS(this.kmlns,"name"),i=this.createTextNode(this.foldersName);t.appendChild(i),e.appendChild(t)}if(this.foldersDesc){var n=this.createElementNS(this.kmlns,"description"),s=this.createTextNode(this.foldersDesc);n.appendChild(s),e.appendChild(n)}return e},createPlacemarkXML:function(e){var t=this.createElementNS(this.kmlns,"name"),i=e.style&&e.style.label?e.style.label:e.id,n=e.attributes.name||i;t.appendChild(this.createTextNode(n));var s=this.createElementNS(this.kmlns,"description"),r=e.attributes.description||this.placemarksDesc;s.appendChild(this.createTextNode(r));var a=this.createElementNS(this.kmlns,"Placemark");null!=e.fid&&a.setAttribute("id",e.fid),a.appendChild(t),a.appendChild(s);var o=this.buildGeometryNode(e.geometry);if(a.appendChild(o),e.attributes){var l=this.buildExtendedData(e.attributes);l&&a.appendChild(l)}return a},buildGeometryNode:function(e){var t=e.CLASS_NAME,i=t.substring(t.lastIndexOf(".")+1),n=this.buildGeometry[i.toLowerCase()],s=null;return n&&(s=n.apply(this,[e])),s},buildGeometry:{point:function(e){var t=this.createElementNS(this.kmlns,"Point");return t.appendChild(this.buildCoordinatesNode(e)),t},multipoint:function(e){return this.buildGeometry.collection.apply(this,[e])},linestring:function(e){var t=this.createElementNS(this.kmlns,"LineString");return t.appendChild(this.buildCoordinatesNode(e)),t},multilinestring:function(e){return this.buildGeometry.collection.apply(this,[e])},linearring:function(e){var t=this.createElementNS(this.kmlns,"LinearRing");return t.appendChild(this.buildCoordinatesNode(e)),t},polygon:function(e){for(var t,i,n,s=this.createElementNS(this.kmlns,"Polygon"),r=e.components,a=0,o=r.length;a<o;++a)n=0==a?"outerBoundaryIs":"innerBoundaryIs",t=this.createElementNS(this.kmlns,n),i=this.buildGeometry.linearring.apply(this,[r[a]]),t.appendChild(i),s.appendChild(t);return s},multipolygon:function(e){return this.buildGeometry.collection.apply(this,[e])},collection:function(e){for(var t,i=this.createElementNS(this.kmlns,"MultiGeometry"),n=0,s=e.components.length;n<s;++n)(t=this.buildGeometryNode.apply(this,[e.components[n]]))&&i.appendChild(t);return i}},buildCoordinatesNode:function(e){var t,i=this.createElementNS(this.kmlns,"coordinates"),n=e.components;if(n){for(var s,r=n.length,a=new Array(r),o=0;o<r;++o)s=n[o],a[o]=this.buildCoordinates(s);t=a.join(" ")}else t=this.buildCoordinates(e);var l=this.createTextNode(t);return i.appendChild(l),i},buildCoordinates:function(e){return this.internalProjection&&this.externalProjection&&(e=e.clone()).transform(this.internalProjection,this.externalProjection),e.x+","+e.y},buildExtendedData:function(e){var t=this.createElementNS(this.kmlns,"ExtendedData");for(var i in e)if(e[i]&&"name"!=i&&"description"!=i&&"styleUrl"!=i){var n=this.createElementNS(this.kmlns,"Data");n.setAttribute("name",i);var s=this.createElementNS(this.kmlns,"value");if("object"==typeof e[i]){if(e[i].value&&s.appendChild(this.createTextNode(e[i].value)),e[i].displayName){var r=this.createElementNS(this.kmlns,"displayName");r.appendChild(this.getXMLDoc().createCDATASection(e[i].displayName)),n.appendChild(r)}}else s.appendChild(this.createTextNode(e[i]));n.appendChild(s),t.appendChild(n)}return this.isSimpleContent(t)?null:t},CLASS_NAME:"OpenLayers.Format.KML"}),OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",profile:null,CLASS_NAME:"OpenLayers.Format.WMSCapabilities"}),OpenLayers.Format.WMSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{wms:"http://www.opengis.net/wms",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"wms",read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=e;e&&9==e.nodeType&&(e=e.documentElement);var i={};if(this.readNode(e,i),void 0===i.service){var n=new OpenLayers.Format.OGCExceptionReport;i.error=n.read(t)}return i},readers:{wms:{Service:function(e,t){t.service={},this.readChildNodes(e,t.service)},Name:function(e,t){t.name=this.getChildValue(e)},Title:function(e,t){t.title=this.getChildValue(e)},Abstract:function(e,t){t.abstract=this.getChildValue(e)},BoundingBox:function(e,t){var i={};i.bbox=[parseFloat(e.getAttribute("minx")),parseFloat(e.getAttribute("miny")),parseFloat(e.getAttribute("maxx")),parseFloat(e.getAttribute("maxy"))];var n={x:parseFloat(e.getAttribute("resx")),y:parseFloat(e.getAttribute("resy"))};return isNaN(n.x)&&isNaN(n.y)||(i.res=n),i},OnlineResource:function(e,t){t.href=this.getAttributeNS(e,this.namespaces.xlink,"href")},ContactInformation:function(e,t){t.contactInformation={},this.readChildNodes(e,t.contactInformation)},ContactPersonPrimary:function(e,t){t.personPrimary={},this.readChildNodes(e,t.personPrimary)},ContactPerson:function(e,t){t.person=this.getChildValue(e)},ContactOrganization:function(e,t){t.organization=this.getChildValue(e)},ContactPosition:function(e,t){t.position=this.getChildValue(e)},ContactAddress:function(e,t){t.contactAddress={},this.readChildNodes(e,t.contactAddress)},AddressType:function(e,t){t.type=this.getChildValue(e)},Address:function(e,t){t.address=this.getChildValue(e)},City:function(e,t){t.city=this.getChildValue(e)},StateOrProvince:function(e,t){t.stateOrProvince=this.getChildValue(e)},PostCode:function(e,t){t.postcode=this.getChildValue(e)},Country:function(e,t){t.country=this.getChildValue(e)},ContactVoiceTelephone:function(e,t){t.phone=this.getChildValue(e)},ContactFacsimileTelephone:function(e,t){t.fax=this.getChildValue(e)},ContactElectronicMailAddress:function(e,t){t.email=this.getChildValue(e)},Fees:function(e,t){var i=this.getChildValue(e);i&&"none"!=i.toLowerCase()&&(t.fees=i)},AccessConstraints:function(e,t){var i=this.getChildValue(e);i&&"none"!=i.toLowerCase()&&(t.accessConstraints=i)},Capability:function(e,t){t.capability={nestedLayers:[],layers:[]},this.readChildNodes(e,t.capability)},Request:function(e,t){t.request={},this.readChildNodes(e,t.request)},GetCapabilities:function(e,t){t.getcapabilities={formats:[]},this.readChildNodes(e,t.getcapabilities)},Format:function(e,t){OpenLayers.Util.isArray(t.formats)?t.formats.push(this.getChildValue(e)):t.format=this.getChildValue(e)},DCPType:function(e,t){this.readChildNodes(e,t)},HTTP:function(e,t){this.readChildNodes(e,t)},Get:function(e,t){t.get={},this.readChildNodes(e,t.get),t.href||(t.href=t.get.href)},Post:function(e,t){t.post={},this.readChildNodes(e,t.post),t.href||(t.href=t.get.href)},GetMap:function(e,t){t.getmap={formats:[]},this.readChildNodes(e,t.getmap)},GetFeatureInfo:function(e,t){t.getfeatureinfo={formats:[]},this.readChildNodes(e,t.getfeatureinfo)},Exception:function(e,t){t.exception={formats:[]},this.readChildNodes(e,t.exception)},Layer:function(e,t){var i,n;t.capability?(n=t.capability,i=t):n=t;var s=e.getAttributeNode("queryable"),r=s&&s.specified?e.getAttribute("queryable"):null,a=(s=e.getAttributeNode("cascaded"))&&s.specified?e.getAttribute("cascaded"):null,o=(s=e.getAttributeNode("opaque"))&&s.specified?e.getAttribute("opaque"):null,l=e.getAttribute("noSubsets"),h=e.getAttribute("fixedWidth"),u=e.getAttribute("fixedHeight"),p=i||{},c=OpenLayers.Util.extend,d={nestedLayers:[],styles:i?[].concat(i.styles):[],srs:i?c({},p.srs):{},metadataURLs:[],bbox:i?c({},p.bbox):{},llbbox:p.llbbox,dimensions:i?c({},p.dimensions):{},authorityURLs:i?c({},p.authorityURLs):{},identifiers:{},keywords:[],queryable:r&&""!==r?"1"===r||"true"===r:p.queryable||!1,cascaded:null!==a?parseInt(a):p.cascaded||0,opaque:o?"1"===o||"true"===o:p.opaque||!1,noSubsets:null!==l?"1"===l||"true"===l:p.noSubsets||!1,fixedWidth:null!=h?parseInt(h):p.fixedWidth||0,fixedHeight:null!=u?parseInt(u):p.fixedHeight||0,minScale:p.minScale,maxScale:p.maxScale,attribution:p.attribution};if(t.nestedLayers.push(d),d.capability=n,this.readChildNodes(e,d),delete d.capability,d.name){var f=d.name.split(":"),m=n.request,y=m.getfeatureinfo;f.length>0&&(d.prefix=f[0]),n.layers.push(d),void 0===d.formats&&(d.formats=m.getmap.formats),void 0===d.infoFormats&&y&&(d.infoFormats=y.formats)}},Attribution:function(e,t){t.attribution={},this.readChildNodes(e,t.attribution)},LogoURL:function(e,t){t.logo={width:e.getAttribute("width"),height:e.getAttribute("height")},this.readChildNodes(e,t.logo)},Style:function(e,t){var i={};t.styles.push(i),this.readChildNodes(e,i)},LegendURL:function(e,t){var i={width:e.getAttribute("width"),height:e.getAttribute("height")};t.legend=i,this.readChildNodes(e,i)},MetadataURL:function(e,t){var i={type:e.getAttribute("type")};t.metadataURLs.push(i),this.readChildNodes(e,i)},DataURL:function(e,t){t.dataURL={},this.readChildNodes(e,t.dataURL)},FeatureListURL:function(e,t){t.featureListURL={},this.readChildNodes(e,t.featureListURL)},AuthorityURL:function(e,t){var i=e.getAttribute("name"),n={};this.readChildNodes(e,n),t.authorityURLs[i]=n.href},Identifier:function(e,t){var i=e.getAttribute("authority");t.identifiers[i]=this.getChildValue(e)},KeywordList:function(e,t){this.readChildNodes(e,t)},SRS:function(e,t){t.srs[this.getChildValue(e)]=!0}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1"}),OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMT_MS_Capabilities:function(e,t){this.readChildNodes(e,t)},Keyword:function(e,t){t.keywords&&t.keywords.push(this.getChildValue(e))},DescribeLayer:function(e,t){t.describelayer={formats:[]},this.readChildNodes(e,t.describelayer)},GetLegendGraphic:function(e,t){t.getlegendgraphic={formats:[]},this.readChildNodes(e,t.getlegendgraphic)},GetStyles:function(e,t){t.getstyles={formats:[]},this.readChildNodes(e,t.getstyles)},PutStyles:function(e,t){t.putstyles={formats:[]},this.readChildNodes(e,t.putstyles)},UserDefinedSymbolization:function(e,t){var i={supportSLD:1==parseInt(e.getAttribute("SupportSLD")),userLayer:1==parseInt(e.getAttribute("UserLayer")),userStyle:1==parseInt(e.getAttribute("UserStyle")),remoteWFS:1==parseInt(e.getAttribute("RemoteWFS"))};t.userSymbols=i},LatLonBoundingBox:function(e,t){t.llbbox=[parseFloat(e.getAttribute("minx")),parseFloat(e.getAttribute("miny")),parseFloat(e.getAttribute("maxx")),parseFloat(e.getAttribute("maxy"))]},BoundingBox:function(e,t){var i=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[e,t]);i.srs=e.getAttribute("SRS"),t.bbox[i.srs]=i},ScaleHint:function(e,t){var i=e.getAttribute("min"),n=e.getAttribute("max"),s=Math.pow(2,.5),r=OpenLayers.INCHES_PER_UNIT.m;0!=i&&(t.maxScale=parseFloat((i/s*r*OpenLayers.DOTS_PER_INCH).toPrecision(13))),n!=Number.POSITIVE_INFINITY&&(t.minScale=parseFloat((n/s*r*OpenLayers.DOTS_PER_INCH).toPrecision(13)))},Dimension:function(e,t){var i={name:e.getAttribute("name").toLowerCase(),units:e.getAttribute("units"),unitsymbol:e.getAttribute("unitSymbol")};t.dimensions[i.name]=i},Extent:function(e,t){var i=e.getAttribute("name").toLowerCase();if(i in t.dimensions){var n=t.dimensions[i];n.nearestVal="1"===e.getAttribute("nearestValue"),n.multipleVal="1"===e.getAttribute("multipleValues"),n.current="1"===e.getAttribute("current"),n.default=e.getAttribute("default")||"";var s=this.getChildValue(e);n.values=s.split(",")}}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1"}),OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.0",readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(e,t){for(var i=this.getChildValue(e).split(/ +/),n=0,s=i.length;n<s;n++)t.srs[i[n]]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"}),OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,readFormat:null,readOptions:null,initialize:function(e){OpenLayers.Protocol.prototype.initialize.apply(this,[e]),e.format||(this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))),!e.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(e){OpenLayers.Protocol.prototype.read.apply(this,arguments),e=OpenLayers.Util.extend({},e),OpenLayers.Util.applyDefaults(e,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",e)]);return t.priv=OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),params:e.params,headers:e.headers,data:i}),t},setFeatureType:function(e){this.featureType=e,this.format.featureType=e},setGeometryName:function(e){this.geometryName=e,this.format.geometryName=e},handleRead:function(e,t){if(t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options),t.callback){var i=e.priv;if(i.status>=200&&i.status<300){var n=this.parseResponse(i,t.readOptions);n&&!1!==n.success?(t.readOptions&&"object"==t.readOptions.output?OpenLayers.Util.extend(e,n):e.features=n,e.code=OpenLayers.Protocol.Response.SUCCESS):(e.code=OpenLayers.Protocol.Response.FAILURE,e.error=n)}else e.code=OpenLayers.Protocol.Response.FAILURE;t.callback.call(t.scope,e)}},parseResponse:function(e,t){var i=e.responseXML;if(i&&i.documentElement||(i=e.responseText),!i||i.length<=0)return null;var n=null!==this.readFormat?this.readFormat.read(i):this.format.read(i,t);if(!this.featureNS){var s=this.readFormat||this.format;this.featureNS=s.featureNS,s.autoConfig=!1,this.geometryName||this.setGeometryName(s.geometryName)}return n},commit:function(e,t){t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:e});return i.priv=OpenLayers.Request.POST({url:t.url,headers:t.headers,data:this.format.write(e,t),callback:this.createCallback(this.handleCommit,i,t)}),i},handleCommit:function(e,t){if(t.callback){var i=e.priv,n=i.responseXML;n&&n.documentElement||(n=i.responseText);var s=this.format.read(n)||{};e.insertIds=s.insertIds||[],s.success?e.code=OpenLayers.Protocol.Response.SUCCESS:(e.code=OpenLayers.Protocol.Response.FAILURE,e.error=s),t.callback.call(t.scope,e)}},filterDelete:function(e,t){t=OpenLayers.Util.extend({},t),OpenLayers.Util.applyDefaults(t,this.options);new OpenLayers.Protocol.Response({requestType:"commit"});var i=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}}),n=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(t.featureNS?this.featurePrefix+":":"")+t.featureType}});t.featureNS&&n.setAttribute("xmlns:"+this.featurePrefix,t.featureNS);var s=this.format.writeNode("ogc:Filter",e);n.appendChild(s),i.appendChild(n);var r=OpenLayers.Format.XML.prototype.write.apply(this.format,[i]);return OpenLayers.Request.POST({url:this.url,callback:t.callback||function(){},data:r})},abort:function(e){e&&e.priv.abort()},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"}),OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{in:"click",out:"clickout"},mousemove:{in:"over",out:"out"},dblclick:{in:"dblclick",out:null},mousedown:{in:null,out:null},mouseup:{in:null,out:null},touchstart:{in:"click",out:"clickout"}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:!0,stopDown:!0,stopUp:!1,initialize:function(e,t,i,n){OpenLayers.Handler.prototype.initialize.apply(this,[e,i,n]),this.layer=t},touchstart:function(e){return this.startTouch(),!!OpenLayers.Event.isMultiTouch(e)||this.mousedown(e)},touchmove:function(e){OpenLayers.Event.preventDefault(e)},mousedown:function(e){return(OpenLayers.Event.isLeftClick(e)||OpenLayers.Event.isSingleTouch(e))&&(this.down=e.xy),!this.handle(e)||!this.stopDown},mouseup:function(e){return this.up=e.xy,!this.handle(e)||!this.stopUp},click:function(e){return!this.handle(e)||!this.stopClick},mousemove:function(e){return!this.callbacks.over&&!this.callbacks.out||(this.handle(e),!0)},dblclick:function(e){return!this.handle(e)},geometryTypeMatches:function(e){return null==this.geometryTypes||OpenLayers.Util.indexOf(this.geometryTypes,e.geometry.CLASS_NAME)>-1},handle:function(e){this.feature&&!this.feature.layer&&(this.feature=null);var t=e.type,i=!1,n=!!this.feature,s="click"==t||"dblclick"==t||"touchstart"==t;if(this.feature=this.layer.getFeatureFromEvent(e),this.feature&&!this.feature.layer&&(this.feature=null),this.lastFeature&&!this.lastFeature.layer&&(this.lastFeature=null),this.feature){"touchstart"===t&&OpenLayers.Event.preventDefault(e);var r=this.feature!=this.lastFeature;this.geometryTypeMatches(this.feature)?(n&&r?(this.lastFeature&&this.triggerCallback(t,"out",[this.lastFeature]),this.triggerCallback(t,"in",[this.feature])):n&&!s||this.triggerCallback(t,"in",[this.feature]),this.lastFeature=this.feature,i=!0):(this.lastFeature&&(n&&r||s)&&this.triggerCallback(t,"out",[this.lastFeature]),this.feature=null)}else this.lastFeature&&(n||s)&&this.triggerCallback(t,"out",[this.lastFeature]);return i},triggerCallback:function(e,t,i){var n=this.EVENTMAP[e][t];n&&("click"==e&&this.up&&this.down?(Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2))<=this.clickTolerance&&this.callback(n,i),this.up=this.down=null):this.callback(n,i))},activate:function(){var e=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),e=!0),e},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.moveLayerBack(),this.feature=null,this.lastFeature=null,this.down=null,this.up=null,this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),e=!0),e},handleMapEvents:function(e){"removelayer"!=e.type&&"order"!=e.property||this.moveLayerToTop()},moveLayerToTop:function(){var e=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(e)},moveLayerBack:function(){var e=this.layer.getZIndex()-1;e>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(e):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Handler.Feature"}),OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:!1,layers:null,display:function(){},getFeatureFromEvent:function(e){for(var t,i=this.layers,n=0;n<i.length;n++)if(t=i[n].getFeatureFromEvent(e))return t},setMap:function(e){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments),this.collectRoots(),e.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(e){e.events.unregister("changelayer",this,this.handleChangeLayer),this.resetRoots(),OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){for(var e,t=0;t<this.map.layers.length;++t)e=this.map.layers[t],-1!=OpenLayers.Util.indexOf(this.layers,e)&&e.renderer.moveRoot(this.renderer)},resetRoots:function(){for(var e,t=0;t<this.layers.length;++t)e=this.layers[t],this.renderer&&e.renderer.getRenderLayerId()==this.id&&this.renderer.moveRoot(e.renderer)},handleChangeLayer:function(e){var t=e.layer;"order"==e.property&&-1!=OpenLayers.Util.indexOf(this.layers,t)&&(this.resetRoots(),this.collectRoots())},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"}),OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:!1,clickout:!0,toggle:!1,hover:!1,highlightOnly:!1,box:!1,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(e,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),null===this.scope&&(this.scope=this),this.initLayer(e);var i={click:this.clickFeature,clickout:this.clickoutFeature};this.hover&&(i.over=this.overFeature,i.out=this.outFeature),this.callbacks=OpenLayers.Util.extend(i,this.callbacks),this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})},this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"}))},initLayer:function(e){OpenLayers.Util.isArray(e)?(this.layers=e,this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:e})):this.layer=e},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(e){var t,i,n,s,r=this.layers||[this.layer];for(n=0;n<r.length;++n)if(t=r[n],s=0,null!=t.selectedFeatures)for(;t.selectedFeatures.length>s;)i=t.selectedFeatures[s],e&&e.except==i?++s:this.unselect(i)},clickFeature:function(e){this.hover||(OpenLayers.Util.indexOf(e.layer.selectedFeatures,e)>-1?this.toggleSelect()?this.unselect(e):this.multipleSelect()||this.unselectAll({except:e}):(this.multipleSelect()||this.unselectAll({except:e}),this.select(e)))},multipleSelect:function(){return this.multiple||this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey]},toggleSelect:function(){return this.toggle||this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey]},clickoutFeature:function(e){!this.hover&&this.clickout&&this.unselectAll()},overFeature:function(e){var t=e.layer;this.hover&&(this.highlightOnly?this.highlight(e):-1==OpenLayers.Util.indexOf(t.selectedFeatures,e)&&this.select(e))},outFeature:function(e){if(this.hover)if(this.highlightOnly){if(e._lastHighlighter==this.id)if(e._prevHighlighter&&e._prevHighlighter!=this.id){delete e._lastHighlighter;var t=this.map.getControl(e._prevHighlighter);t&&t.highlight(e)}else this.unhighlight(e)}else this.unselect(e)},highlight:function(e){var t=e.layer;if(!1!==this.events.triggerEvent("beforefeaturehighlighted",{feature:e})){e._prevHighlighter=e._lastHighlighter,e._lastHighlighter=this.id;var i=this.selectStyle||this.renderIntent;t.drawFeature(e,i),this.events.triggerEvent("featurehighlighted",{feature:e})}},unhighlight:function(e){var t=e.layer;void 0==e._prevHighlighter?delete e._lastHighlighter:e._prevHighlighter==this.id?delete e._prevHighlighter:(e._lastHighlighter=e._prevHighlighter,delete e._prevHighlighter),t.drawFeature(e,e.style||e.layer.style||"default"),this.events.triggerEvent("featureunhighlighted",{feature:e})},select:function(e){var t=this.onBeforeSelect.call(this.scope,e),i=e.layer;!1!==t&&!1!==(t=i.events.triggerEvent("beforefeatureselected",{feature:e}))&&(i.selectedFeatures.push(e),this.highlight(e),this.handlers.feature.lastFeature||(this.handlers.feature.lastFeature=i.selectedFeatures[0]),i.events.triggerEvent("featureselected",{feature:e}),this.onSelect.call(this.scope,e))},unselect:function(e){var t=e.layer;this.unhighlight(e),OpenLayers.Util.removeItem(t.selectedFeatures,e),t.events.triggerEvent("featureunselected",{feature:e}),this.onUnselect.call(this.scope,e)},selectBox:function(e){if(e instanceof OpenLayers.Bounds){var t=this.map.getLonLatFromPixel({x:e.left,y:e.bottom}),i=this.map.getLonLatFromPixel({x:e.right,y:e.top}),n=new OpenLayers.Bounds(t.lon,t.lat,i.lon,i.lat);this.multipleSelect()||this.unselectAll();var s=this.multiple;this.multiple=!0;var r=this.layers||[this.layer];this.events.triggerEvent("boxselectionstart",{layers:r});for(var a,o=0;o<r.length;++o)for(var l=0,h=(a=r[o]).features.length;l<h;++l){var u=a.features[l];u.getVisibility()&&((null==this.geometryTypes||OpenLayers.Util.indexOf(this.geometryTypes,u.geometry.CLASS_NAME)>-1)&&n.toGeometry().intersects(u.geometry)&&-1==OpenLayers.Util.indexOf(a.selectedFeatures,u)&&this.select(u))}this.multiple=s,this.events.triggerEvent("boxselectionend",{layers:r})}},setMap:function(e){this.handlers.feature.setMap(e),this.box&&this.handlers.box.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},setLayer:function(e){var t=this.active;this.unselectAll(),this.deactivate(),this.layers&&(this.layer.destroy(),this.layers=null),this.initLayer(e),this.handlers.feature.layer=this.layer,t&&this.activate()},CLASS_NAME:"OpenLayers.Control.SelectFeature"}),OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:!1,citeCompliant:!1,mouseDown:!1,stoppedDown:null,lastDown:null,lastUp:null,persist:!1,stopDown:!1,stopUp:!1,layerOptions:null,pixelTolerance:5,lastTouchPx:null,initialize:function(e,t,i){i&&i.layerOptions&&i.layerOptions.styleMap||(this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style.default,{})),OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments))return!1;var e=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions);return this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,e),this.map.addLayer(this.layer),!0},createFeature:function(e){var t=this.layer.getLonLatFromViewPortPx(e),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,!0)},destroyFeature:function(e){!this.layer||!e&&this.persist||this.layer.destroyFeatures(),this.point=null},destroyPersistedFeature:function(){var e=this.layer;e&&e.features.length>1&&this.layer.features[0].destroy()},finalize:function(e){var t=e?"cancel":"done";this.mouseDown=!1,this.lastDown=null,this.lastUp=null,this.lastTouchPx=null,this.callback(t,[this.geometryClone()]),this.destroyFeature(e)},cancel:function(){this.finalize(!0)},click:function(e){return OpenLayers.Event.stop(e),!1},dblclick:function(e){return OpenLayers.Event.stop(e),!1},modifyFeature:function(e){this.point||this.createFeature(e);var t=this.layer.getLonLatFromViewPortPx(e);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 e=this.point&&this.point.geometry;return e&&this.multi&&(e=new OpenLayers.Geometry.MultiPoint([e])),e},geometryClone:function(){var e=this.getGeometry();return e&&e.clone()},mousedown:function(e){return this.down(e)},touchstart:function(e){return this.startTouch(),this.lastTouchPx=e.xy,this.down(e)},mousemove:function(e){return this.move(e)},touchmove:function(e){return this.lastTouchPx=e.xy,this.move(e)},mouseup:function(e){return this.up(e)},touchend:function(e){return e.xy=this.lastTouchPx,this.up(e)},down:function(e){return this.mouseDown=!0,this.lastDown=e.xy,this.touch||this.modifyFeature(e.xy),this.stoppedDown=this.stopDown,!this.stopDown},move:function(e){return this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(e.xy),!0},up:function(e){return this.mouseDown=!1,this.stoppedDown=this.stopDown,!this.checkModifiers(e)||(!(!this.lastUp||!this.lastUp.equals(e.xy))||(!this.lastDown||!this.passesTolerance(this.lastDown,e.xy,this.pixelTolerance)||(this.touch&&this.modifyFeature(e.xy),this.persist&&this.destroyPersistedFeature(),this.lastUp=e.xy,this.finalize(),!this.stopUp)))},mouseout:function(e){OpenLayers.Util.mouseLeft(e,this.map.viewPortDiv)&&(this.stoppedDown=this.stopDown,this.mouseDown=!1)},passesTolerance:function(e,t,i){var n=!0;return null!=i&&e&&t&&e.distanceTo(t)>i&&(n=!1),n},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,createFeature:function(e){var t=this.layer.getLonLatFromViewPortPx(e),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(e){OpenLayers.Handler.Point.prototype.destroyFeature.call(this,e),this.line=null},destroyPersistedFeature:function(){var e=this.layer;e&&e.features.length>2&&this.layer.features[0].destroy()},removePoint:function(){this.point&&this.layer.removeFeatures([this.point])},addPoint:function(e){this.layer.removeFeatures([this.point]);var t=this.layer.getLonLatFromViewPortPx(e);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat)),this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length),this.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(e,t){this.line.geometry.addComponent(new OpenLayers.Geometry.Point(e,t),this.getCurrentPointIndex()),this.drawFeature(),delete this.redoStack},insertDeltaXY:function(e,t){var i=this.getCurrentPointIndex()-1,n=this.line.geometry.components[i];!n||isNaN(n.x)||isNaN(n.y)||this.insertXY(n.x+e,n.y+t)},insertDirectionLength:function(e,t){e*=Math.PI/180;var i=t*Math.cos(e),n=t*Math.sin(e);this.insertDeltaXY(i,n)},insertDeflectionLength:function(e,t){var i=this.getCurrentPointIndex()-1;if(i>0){var n=this.line.geometry.components[i],s=this.line.geometry.components[i-1],r=Math.atan2(n.y-s.y,n.x-s.x);this.insertDirectionLength(180*r/Math.PI+e,t)}},getCurrentPointIndex:function(){return this.line.geometry.components.length-1},undo:function(){var e=this.line.geometry,t=e.components,i=this.getCurrentPointIndex()-1,n=t[i],s=e.removeComponent(n);if(s){if(this.touch&&i>0){var r=(t=e.components)[i-1],a=t[this.getCurrentPointIndex()];a.x=r.x,a.y=r.y}this.redoStack||(this.redoStack=[]),this.redoStack.push(n),this.drawFeature()}return s},redo:function(){var e=this.redoStack&&this.redoStack.pop();return e&&(this.line.geometry.addComponent(e,this.getCurrentPointIndex()),this.drawFeature()),!!e},freehandMode:function(e){return this.freehandToggle&&e[this.freehandToggle]?!this.freehand:this.freehand},modifyFeature:function(e,t){this.line||this.createFeature(e);var i=this.layer.getLonLatFromViewPortPx(e);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 e=this.line&&this.line.geometry;return e&&this.multi&&(e=new OpenLayers.Geometry.MultiLineString([e])),e},touchstart:function(e){return this.timerId&&this.passesTolerance(this.lastTouchPx,e.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,e))},down:function(e){var t=this.stopDown;return this.freehandMode(e)&&(t=!0,this.touch&&(this.modifyFeature(e.xy,!!this.lastUp),OpenLayers.Event.stop(e))),this.touch||this.lastDown&&this.passesTolerance(this.lastDown,e.xy,this.pixelTolerance)||this.modifyFeature(e.xy,!!this.lastUp),this.mouseDown=!0,this.lastDown=e.xy,this.stoppedDown=t,!t},move:function(e){return this.stoppedDown&&this.freehandMode(e)?(this.persist&&this.destroyPersistedFeature(),this.maxVertices&&this.line&&this.line.geometry.components.length===this.maxVertices?(this.removePoint(),this.finalize()):this.addPoint(e.xy),!1):(this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(e.xy,!!this.lastUp),!0)},up:function(e){return!this.mouseDown||this.lastUp&&this.lastUp.equals(e.xy)||(this.stoppedDown&&this.freehandMode(e)?(this.persist&&this.destroyPersistedFeature(),this.removePoint(),this.finalize()):this.passesTolerance(this.lastDown,e.xy,this.pixelTolerance)&&(this.touch&&this.modifyFeature(e.xy),null==this.lastUp&&this.persist&&this.destroyPersistedFeature(),this.addPoint(e.xy),this.lastUp=e.xy,this.line.geometry.components.length===this.maxVertices+1&&this.finishGeometry())),this.stoppedDown=this.stopDown,this.mouseDown=!1,!this.stopUp},finishGeometry:function(){var e=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[e]),this.removePoint(),this.finalize()},dblclick:function(e){return this.freehandMode(e)||this.finishGeometry(),!1},CLASS_NAME:"OpenLayers.Handler.Path"}),OpenLayers.Spherical=OpenLayers.Spherical||{},OpenLayers.Spherical.DEFAULT_RADIUS=6378137,OpenLayers.Spherical.computeDistanceBetween=function(e,t,i){var n=i||OpenLayers.Spherical.DEFAULT_RADIUS,s=Math.sin(Math.PI*(t.lon-e.lon)/360),r=Math.sin(Math.PI*(t.lat-e.lat)/360),a=r*r+s*s*Math.cos(Math.PI*e.lat/180)*Math.cos(Math.PI*t.lat/180);return 2*n*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))},OpenLayers.Spherical.computeHeading=function(e,t){var i=Math.sin(Math.PI*(e.lon-t.lon)/180)*Math.cos(Math.PI*t.lat/180),n=Math.cos(Math.PI*e.lat/180)*Math.sin(Math.PI*t.lat/180)-Math.sin(Math.PI*e.lat/180)*Math.cos(Math.PI*t.lat/180)*Math.cos(Math.PI*(e.lon-t.lon)/180);return 180*Math.atan2(i,n)/Math.PI},OpenLayers.Control.CacheWrite=OpenLayers.Class(OpenLayers.Control,{layers:null,imageFormat:"image/png",quotaRegEx:/quota/i,setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);var t,i=this.layers||e.layers;for(t=i.length-1;t>=0;--t)this.addLayer({layer:i[t]});this.layers||e.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})},addLayer:function(e){e.layer.events.on({tileloadstart:this.makeSameOrigin,tileloaded:this.onTileLoaded,scope:this})},removeLayer:function(e){e.layer.events.un({tileloadstart:this.makeSameOrigin,tileloaded:this.onTileLoaded,scope:this})},makeSameOrigin:function(e){if(this.active){var t=e.tile;if(t instanceof OpenLayers.Tile.Image&&!t.crossOriginKeyword&&"data:"!==t.url.substr(0,5)){var i=OpenLayers.Request.makeSameOrigin(t.url,OpenLayers.ProxyHost);OpenLayers.Control.CacheWrite.urlMap[i]=t.url,t.url=i}}},onTileLoaded:function(e){this.active&&!e.aborted&&e.tile instanceof OpenLayers.Tile.Image&&"data:"!==e.tile.url.substr(0,5)&&(this.cache({tile:e.tile}),delete OpenLayers.Control.CacheWrite.urlMap[e.tile.url])},cache:function(e){if(window.localStorage){var t=e.tile;try{var i=t.getCanvasContext();if(i){var n=OpenLayers.Control.CacheWrite.urlMap[t.url]||t.url;window.localStorage.setItem("olCache_"+n,i.canvas.toDataURL(this.imageFormat))}}catch(e){var s=e.name||e.message;s&&this.quotaRegEx.test(s)?this.events.triggerEvent("cachefull",{tile:t}):OpenLayers.Console.error(e.toString())}}},destroy:function(){if(this.layers||this.map){var e,t=this.layers||this.map.layers;for(e=t.length-1;e>=0;--e)this.removeLayer({layer:t[e]})}this.map&&this.map.events.un({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.CacheWrite"}),OpenLayers.Control.CacheWrite.clearCache=function(){if(window.localStorage){var e,t;for(e=window.localStorage.length-1;e>=0;--e)"olCache_"===(t=window.localStorage.key(e)).substr(0,8)&&window.localStorage.removeItem(t)}},OpenLayers.Control.CacheWrite.urlMap={},OpenLayers.Format.Context=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{layerOptions:null,layerParams:null,read:function(e,t){var i,n=OpenLayers.Format.XML.VersionedOGC.prototype.read.apply(this,arguments);if(t&&t.map)if(this.context=n,t.map instanceof OpenLayers.Map)i=this.mergeContextToMap(n,t.map);else{var s=t.map;(OpenLayers.Util.isElement(s)||"string"==typeof s)&&(s={div:s}),i=this.contextToMap(n,s)}else i=n;return i},getLayerFromContext:function(e){var t,i,n={queryable:e.queryable,visibility:e.visibility,maxExtent:e.maxExtent,metadata:OpenLayers.Util.applyDefaults(e.metadata,{styles:e.styles,formats:e.formats,abstract:e.abstract,dataURL:e.dataURL}),numZoomLevels:e.numZoomLevels,units:e.units,isBaseLayer:e.isBaseLayer,opacity:e.opacity,displayInLayerSwitcher:e.displayInLayerSwitcher,singleTile:e.singleTile,tileSize:e.tileSize?new OpenLayers.Size(e.tileSize.width,e.tileSize.height):void 0,minScale:e.minScale||e.maxScaleDenominator,maxScale:e.maxScale||e.minScaleDenominator,srs:e.srs,dimensions:e.dimensions,metadataURL:e.metadataURL};this.layerOptions&&OpenLayers.Util.applyDefaults(n,this.layerOptions);var s={layers:e.name,transparent:e.transparent,version:e.version};if(e.formats&&e.formats.length>0)for(s.format=e.formats[0].value,t=0,i=e.formats.length;t<i;t++){var r=e.formats[t];if(1==r.current){s.format=r.value;break}}if(e.styles&&e.styles.length>0)for(t=0,i=e.styles.length;t<i;t++){var a=e.styles[t];if(1==a.current){a.href?s.sld=a.href:a.body?s.sld_body=a.body:s.styles=a.name;break}}this.layerParams&&OpenLayers.Util.applyDefaults(s,this.layerParams);var o=null,l=e.service;return l==OpenLayers.Format.Context.serviceTypes.WFS?(n.strategies=[new OpenLayers.Strategy.BBOX],n.protocol=new OpenLayers.Protocol.WFS({url:e.url,featurePrefix:e.name.split(":")[0],featureType:e.name.split(":").pop()}),o=new OpenLayers.Layer.Vector(e.title||e.name,n)):l==OpenLayers.Format.Context.serviceTypes.KML?(n.strategies=[new OpenLayers.Strategy.Fixed],n.protocol=new OpenLayers.Protocol.HTTP({url:e.url,format:new OpenLayers.Format.KML}),o=new OpenLayers.Layer.Vector(e.title||e.name,n)):l==OpenLayers.Format.Context.serviceTypes.GML?(n.strategies=[new OpenLayers.Strategy.Fixed],n.protocol=new OpenLayers.Protocol.HTTP({url:e.url,format:new OpenLayers.Format.GML}),o=new OpenLayers.Layer.Vector(e.title||e.name,n)):e.features?(o=new OpenLayers.Layer.Vector(e.title||e.name,n)).addFeatures(e.features):!0!==e.categoryLayer&&(o=new OpenLayers.Layer.WMS(e.title||e.name,e.url,s,n)),o},getLayersFromContext:function(e){for(var t=[],i=0,n=e.length;i<n;i++){var s=this.getLayerFromContext(e[i]);null!==s&&t.push(s)}return t},contextToMap:function(e,t){(t=OpenLayers.Util.applyDefaults({maxExtent:e.maxExtent,projection:e.projection,units:e.units},t)).maxExtent&&(t.maxResolution=t.maxExtent.getWidth()/OpenLayers.Map.TILE_WIDTH);var i={contactInformation:e.contactInformation,abstract:e.abstract,keywords:e.keywords,logo:e.logo,descriptionURL:e.descriptionURL};t.metadata=i;var n=new OpenLayers.Map(t);return n.addLayers(this.getLayersFromContext(e.layersContext)),n.setCenter(e.bounds.getCenterLonLat(),n.getZoomForExtent(e.bounds,!0)),n},mergeContextToMap:function(e,t){return t.addLayers(this.getLayersFromContext(e.layersContext)),t},write:function(e,t){return e=this.toContext(e),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(e){var t=this.getParser(),i={queryable:e.queryable,visibility:e.visibility,name:e.params.LAYERS,title:e.name,abstract:e.metadata.abstract,dataURL:e.metadata.dataURL,metadataURL:e.metadataURL,server:{version:e.params.VERSION,url:e.url},maxExtent:e.maxExtent,transparent:e.params.TRANSPARENT,numZoomLevels:e.numZoomLevels,units:e.units,isBaseLayer:e.isBaseLayer,opacity:1==e.opacity?void 0:e.opacity,displayInLayerSwitcher:e.displayInLayerSwitcher,singleTile:e.singleTile,tileSize:e.singleTile||!e.tileSize?void 0:{width:e.tileSize.w,height:e.tileSize.h},minScale:e.options.resolutions||e.options.scales||e.options.maxResolution||e.options.minScale?e.minScale:void 0,maxScale:e.options.resolutions||e.options.scales||e.options.minResolution||e.options.maxScale?e.maxScale:void 0,formats:[],styles:[],srs:e.srs,dimensions:e.dimensions};if(e.metadata.servertitle&&(i.server.title=e.metadata.servertitle),e.metadata.formats&&e.metadata.formats.length>0)for(var n=0,s=e.metadata.formats.length;n<s;n++){var r=e.metadata.formats[n];i.formats.push({value:r.value,current:r.value==e.params.FORMAT})}else i.formats.push({value:e.params.FORMAT,current:!0});if(e.metadata.styles&&e.metadata.styles.length>0)for(var n=0,s=e.metadata.styles.length;n<s;n++){var a=e.metadata.styles[n];a.href==e.params.SLD||a.body==e.params.SLD_BODY||a.name==e.params.STYLES?a.current=!0:a.current=!1,i.styles.push(a)}else i.styles.push({href:e.params.SLD,body:e.params.SLD_BODY,name:e.params.STYLES||t.defaultStyleName,title:t.defaultStyleTitle,current:!0});return i},toContext:function(e){var t={},i=e.layers;if("OpenLayers.Map"==e.CLASS_NAME){var n=e.metadata||{};t.size=e.getSize(),t.bounds=e.getExtent(),t.projection=e.projection,t.title=e.title,t.keywords=n.keywords,t.abstract=n.abstract,t.logo=n.logo,t.descriptionURL=n.descriptionURL,t.contactInformation=n.contactInformation,t.maxExtent=e.maxExtent}else OpenLayers.Util.applyDefaults(t,e),void 0!=t.layers&&delete t.layers;if(void 0==t.layersContext&&(t.layersContext=[]),void 0!=i&&OpenLayers.Util.isArray(i))for(var s=0,r=i.length;s<r;s++){var a=i[s];a instanceof OpenLayers.Layer.WMS&&t.layersContext.push(this.layerToContext(a))}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(e){var t=null;if(null==e)t=this.namespaces[this.defaultPrefix];else for(t in this.namespaces)if(this.namespaces[t]==e)break;return t},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"",defaultStyleTitle:"Default",initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=e.documentElement;this.rootPrefix=t.prefix;var i={version:t.getAttribute("version")};return this.runChildNodes(i,t),i},runChildNodes:function(e,t){for(var i,n,s=t.childNodes,r=0,a=s.length;r<a;++r)1==(i=s[r]).nodeType&&(n=this["read_"+this.getNamespacePrefix(i.namespaceURI)+"_"+i.nodeName.split(":").pop()])&&n.apply(this,[e,i])},read_wmc_General:function(e,t){this.runChildNodes(e,t)},read_wmc_BoundingBox:function(e,t){e.projection=t.getAttribute("SRS"),e.bounds=new OpenLayers.Bounds(t.getAttribute("minx"),t.getAttribute("miny"),t.getAttribute("maxx"),t.getAttribute("maxy"))},read_wmc_LayerList:function(e,t){e.layersContext=[],this.runChildNodes(e,t)},read_wmc_Layer:function(e,t){var i={visibility:"1"!=t.getAttribute("hidden"),queryable:"1"==t.getAttribute("queryable"),formats:[],styles:[],metadata:{}};this.runChildNodes(i,t),e.layersContext.push(i)},read_wmc_Extension:function(e,t){this.runChildNodes(e,t)},read_ol_units:function(e,t){e.units=this.getChildValue(t)},read_ol_maxExtent:function(e,t){var i=new OpenLayers.Bounds(t.getAttribute("minx"),t.getAttribute("miny"),t.getAttribute("maxx"),t.getAttribute("maxy"));e.maxExtent=i},read_ol_transparent:function(e,t){e.transparent=this.getChildValue(t)},read_ol_numZoomLevels:function(e,t){e.numZoomLevels=parseInt(this.getChildValue(t))},read_ol_opacity:function(e,t){e.opacity=parseFloat(this.getChildValue(t))},read_ol_singleTile:function(e,t){e.singleTile="true"==this.getChildValue(t)},read_ol_tileSize:function(e,t){var i={width:t.getAttribute("width"),height:t.getAttribute("height")};e.tileSize=i},read_ol_isBaseLayer:function(e,t){e.isBaseLayer="true"==this.getChildValue(t)},read_ol_displayInLayerSwitcher:function(e,t){e.displayInLayerSwitcher="true"==this.getChildValue(t)},read_wmc_Server:function(e,t){e.version=t.getAttribute("version"),e.url=this.getOnlineResource_href(t),e.metadata.servertitle=t.getAttribute("title")},read_wmc_FormatList:function(e,t){this.runChildNodes(e,t)},read_wmc_Format:function(e,t){var i={value:this.getChildValue(t)};"1"==t.getAttribute("current")&&(i.current=!0),e.formats.push(i)},read_wmc_StyleList:function(e,t){this.runChildNodes(e,t)},read_wmc_Style:function(e,t){var i={};this.runChildNodes(i,t),"1"==t.getAttribute("current")&&(i.current=!0),e.styles.push(i)},read_wmc_SLD:function(e,t){this.runChildNodes(e,t)},read_sld_StyledLayerDescriptor:function(e,t){var i=OpenLayers.Format.XML.prototype.write.apply(this,[t]);e.body=i},read_sld_FeatureTypeStyle:function(e,t){var i=OpenLayers.Format.XML.prototype.write.apply(this,[t]);e.body=i},read_wmc_OnlineResource:function(e,t){e.href=this.getAttributeNS(t,this.namespaces.xlink,"href")},read_wmc_Name:function(e,t){var i=this.getChildValue(t);i&&(e.name=i)},read_wmc_Title:function(e,t){var i=this.getChildValue(t);i&&(e.title=i)},read_wmc_MetadataURL:function(e,t){e.metadataURL=this.getOnlineResource_href(t)},read_wmc_KeywordList:function(e,t){e.keywords=[],this.runChildNodes(e.keywords,t)},read_wmc_Keyword:function(e,t){e.push(this.getChildValue(t))},read_wmc_Abstract:function(e,t){var i=this.getChildValue(t);i&&(e.abstract=i)},read_wmc_LogoURL:function(e,t){e.logo={width:t.getAttribute("width"),height:t.getAttribute("height"),format:t.getAttribute("format"),href:this.getOnlineResource_href(t)}},read_wmc_DescriptionURL:function(e,t){e.descriptionURL=this.getOnlineResource_href(t)},read_wmc_ContactInformation:function(e,t){var i={};this.runChildNodes(i,t),e.contactInformation=i},read_wmc_ContactPersonPrimary:function(e,t){var i={};this.runChildNodes(i,t),e.personPrimary=i},read_wmc_ContactPerson:function(e,t){var i=this.getChildValue(t);i&&(e.person=i)},read_wmc_ContactOrganization:function(e,t){var i=this.getChildValue(t);i&&(e.organization=i)},read_wmc_ContactPosition:function(e,t){var i=this.getChildValue(t);i&&(e.position=i)},read_wmc_ContactAddress:function(e,t){var i={};this.runChildNodes(i,t),e.contactAddress=i},read_wmc_AddressType:function(e,t){var i=this.getChildValue(t);i&&(e.type=i)},read_wmc_Address:function(e,t){var i=this.getChildValue(t);i&&(e.address=i)},read_wmc_City:function(e,t){var i=this.getChildValue(t);i&&(e.city=i)},read_wmc_StateOrProvince:function(e,t){var i=this.getChildValue(t);i&&(e.stateOrProvince=i)},read_wmc_PostCode:function(e,t){var i=this.getChildValue(t);i&&(e.postcode=i)},read_wmc_Country:function(e,t){var i=this.getChildValue(t);i&&(e.country=i)},read_wmc_ContactVoiceTelephone:function(e,t){var i=this.getChildValue(t);i&&(e.phone=i)},read_wmc_ContactFacsimileTelephone:function(e,t){var i=this.getChildValue(t);i&&(e.fax=i)},read_wmc_ContactElectronicMailAddress:function(e,t){var i=this.getChildValue(t);i&&(e.email=i)},read_wmc_DataURL:function(e,t){e.dataURL=this.getOnlineResource_href(t)},read_wmc_LegendURL:function(e,t){var i={width:t.getAttribute("width"),height:t.getAttribute("height"),format:t.getAttribute("format"),href:this.getOnlineResource_href(t)};e.legend=i},read_wmc_DimensionList:function(e,t){e.dimensions={},this.runChildNodes(e.dimensions,t)},read_wmc_Dimension:function(e,t){var i={name:t.getAttribute("name").toLowerCase(),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")||""},n=this.getChildValue(t);i.values=n.split(","),e[i.name]=i},write:function(e,t){var i=this.createElementDefaultNS("ViewContext");return this.setAttributes(i,{version:this.VERSION,id:t&&"string"==typeof t.id?t.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")}),this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),i.appendChild(this.write_wmc_General(e)),i.appendChild(this.write_wmc_LayerList(e)),OpenLayers.Format.XML.prototype.write.apply(this,[i])},createElementDefaultNS:function(e,t,i){var n=this.createElementNS(this.namespaces[this.defaultPrefix],e);return t&&n.appendChild(this.createTextNode(t)),i&&this.setAttributes(n,i),n},setAttributes:function(e,t){var i;for(var n in t)(i=t[n].toString()).match(/[A-Z]/)?this.setAttributeNS(e,null,n,i):e.setAttribute(n,i)},write_wmc_General:function(e){var t=this.createElementDefaultNS("General");e.size&&t.appendChild(this.createElementDefaultNS("Window",null,{width:e.size.w,height:e.size.h}));var i=e.bounds;return t.appendChild(this.createElementDefaultNS("BoundingBox",null,{minx:i.left.toPrecision(18),miny:i.bottom.toPrecision(18),maxx:i.right.toPrecision(18),maxy:i.top.toPrecision(18),SRS:e.projection})),t.appendChild(this.createElementDefaultNS("Title",e.title)),e.keywords&&t.appendChild(this.write_wmc_KeywordList(e.keywords)),e.abstract&&t.appendChild(this.createElementDefaultNS("Abstract",e.abstract)),e.logo&&t.appendChild(this.write_wmc_URLType("LogoURL",e.logo.href,e.logo)),e.descriptionURL&&t.appendChild(this.write_wmc_URLType("DescriptionURL",e.descriptionURL)),e.contactInformation&&t.appendChild(this.write_wmc_ContactInformation(e.contactInformation)),t.appendChild(this.write_ol_MapExtension(e)),t},write_wmc_KeywordList:function(e){for(var t=this.createElementDefaultNS("KeywordList"),i=0,n=e.length;i<n;i++)t.appendChild(this.createElementDefaultNS("Keyword",e[i]));return t},write_wmc_ContactInformation:function(e){var t=this.createElementDefaultNS("ContactInformation");return e.personPrimary&&t.appendChild(this.write_wmc_ContactPersonPrimary(e.personPrimary)),e.position&&t.appendChild(this.createElementDefaultNS("ContactPosition",e.position)),e.contactAddress&&t.appendChild(this.write_wmc_ContactAddress(e.contactAddress)),e.phone&&t.appendChild(this.createElementDefaultNS("ContactVoiceTelephone",e.phone)),e.fax&&t.appendChild(this.createElementDefaultNS("ContactFacsimileTelephone",e.fax)),e.email&&t.appendChild(this.createElementDefaultNS("ContactElectronicMailAddress",e.email)),t},write_wmc_ContactPersonPrimary:function(e){var t=this.createElementDefaultNS("ContactPersonPrimary");return e.person&&t.appendChild(this.createElementDefaultNS("ContactPerson",e.person)),e.organization&&t.appendChild(this.createElementDefaultNS("ContactOrganization",e.organization)),t},write_wmc_ContactAddress:function(e){var t=this.createElementDefaultNS("ContactAddress");return e.type&&t.appendChild(this.createElementDefaultNS("AddressType",e.type)),e.address&&t.appendChild(this.createElementDefaultNS("Address",e.address)),e.city&&t.appendChild(this.createElementDefaultNS("City",e.city)),e.stateOrProvince&&t.appendChild(this.createElementDefaultNS("StateOrProvince",e.stateOrProvince)),e.postcode&&t.appendChild(this.createElementDefaultNS("PostCode",e.postcode)),e.country&&t.appendChild(this.createElementDefaultNS("Country",e.country)),t},write_ol_MapExtension:function(e){var t=this.createElementDefaultNS("Extension"),i=e.maxExtent;if(i){var n=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(n,{minx:i.left.toPrecision(18),miny:i.bottom.toPrecision(18),maxx:i.right.toPrecision(18),maxy:i.top.toPrecision(18)}),t.appendChild(n)}return t},write_wmc_LayerList:function(e){for(var t=this.createElementDefaultNS("LayerList"),i=0,n=e.layersContext.length;i<n;++i)t.appendChild(this.write_wmc_Layer(e.layersContext[i]));return t},write_wmc_Layer:function(e){var t=this.createElementDefaultNS("Layer",null,{queryable:e.queryable?"1":"0",hidden:e.visibility?"0":"1"});return t.appendChild(this.write_wmc_Server(e)),t.appendChild(this.createElementDefaultNS("Name",e.name)),t.appendChild(this.createElementDefaultNS("Title",e.title)),e.abstract&&t.appendChild(this.createElementDefaultNS("Abstract",e.abstract)),e.dataURL&&t.appendChild(this.write_wmc_URLType("DataURL",e.dataURL)),e.metadataURL&&t.appendChild(this.write_wmc_URLType("MetadataURL",e.metadataURL)),t},write_wmc_LayerExtension:function(e){var t=this.createElementDefaultNS("Extension"),i=e.maxExtent,n=this.createElementNS(this.namespaces.ol,"ol:maxExtent");if(this.setAttributes(n,{minx:i.left.toPrecision(18),miny:i.bottom.toPrecision(18),maxx:i.right.toPrecision(18),maxy:i.top.toPrecision(18)}),t.appendChild(n),e.tileSize&&!e.singleTile){var s=this.createElementNS(this.namespaces.ol,"ol:tileSize");this.setAttributes(s,e.tileSize),t.appendChild(s)}for(var r,a=["transparent","numZoomLevels","units","isBaseLayer","opacity","displayInLayerSwitcher","singleTile"],o=0,l=a.length;o<l;++o)(r=this.createOLPropertyNode(e,a[o]))&&t.appendChild(r);return t},createOLPropertyNode:function(e,t){var i=null;return null!=e[t]&&(i=this.createElementNS(this.namespaces.ol,"ol:"+t)).appendChild(this.createTextNode(e[t].toString())),i},write_wmc_Server:function(e){var t=e.server,i=this.createElementDefaultNS("Server"),n={service:"OGC:WMS",version:t.version};return t.title&&(n.title=t.title),this.setAttributes(i,n),i.appendChild(this.write_wmc_OnlineResource(t.url)),i},write_wmc_URLType:function(e,t,i){var n=this.createElementDefaultNS(e);if(n.appendChild(this.write_wmc_OnlineResource(t)),i)for(var s=["width","height","format"],r=0;r<s.length;r++)s[r]in i&&n.setAttribute(s[r],i[s[r]]);return n},write_wmc_DimensionList:function(e){var t=this.createElementDefaultNS("DimensionList");for(var i in e.dimensions){var n={},s=e.dimensions[i];for(var r in s)"boolean"==typeof s[r]?n[r]=Number(s[r]):n[r]=s[r];var a="";n.values&&(a=n.values.join(","),delete n.values),t.appendChild(this.createElementDefaultNS("Dimension",a,n))}return t},write_wmc_FormatList:function(e){for(var t=this.createElementDefaultNS("FormatList"),i=0,n=e.formats.length;i<n;i++){var s=e.formats[i];t.appendChild(this.createElementDefaultNS("Format",s.value,s.current&&1==s.current?{current:"1"}:null))}return t},write_wmc_StyleList:function(e){var t=this.createElementDefaultNS("StyleList"),i=e.styles;if(i&&OpenLayers.Util.isArray(i))for(var n,s=0,r=i.length;s<r;s++){var a=i[s],o=this.createElementDefaultNS("Style",null,a.current&&1==a.current?{current:"1"}:null);if(a.href){n=this.createElementDefaultNS("SLD"),a.name&&n.appendChild(this.createElementDefaultNS("Name",a.name)),a.title&&n.appendChild(this.createElementDefaultNS("Title",a.title)),a.legend&&n.appendChild(this.write_wmc_URLType("LegendURL",a.legend.href,a.legend));var l=this.write_wmc_OnlineResource(a.href);n.appendChild(l),o.appendChild(n)}else if(a.body){n=this.createElementDefaultNS("SLD"),a.name&&n.appendChild(this.createElementDefaultNS("Name",a.name)),a.title&&n.appendChild(this.createElementDefaultNS("Title",a.title)),a.legend&&n.appendChild(this.write_wmc_URLType("LegendURL",a.legend.href,a.legend));var h=OpenLayers.Format.XML.prototype.read.apply(this,[a.body]).documentElement;n.ownerDocument&&n.ownerDocument.importNode&&(h=n.ownerDocument.importNode(h,!0)),n.appendChild(h),o.appendChild(n)}else o.appendChild(this.createElementDefaultNS("Name",a.name)),o.appendChild(this.createElementDefaultNS("Title",a.title)),a.abstract&&o.appendChild(this.createElementDefaultNS("Abstract",a.abstract)),a.legend&&o.appendChild(this.write_wmc_URLType("LegendURL",a.legend.href,a.legend));t.appendChild(o)}return t},write_wmc_OnlineResource:function(e){var t=this.createElementDefaultNS("OnlineResource");return this.setAttributeNS(t,this.namespaces.xlink,"xlink:type","simple"),this.setAttributeNS(t,this.namespaces.xlink,"xlink:href",e),t},getOnlineResource_href:function(e){var t={},i=e.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(e){OpenLayers.Control.Panel.prototype.initialize.apply(this,[e]);var e={slideFactor:this.slideFactor,slideRatio:this.slideRatio};this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,e),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,e),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,e),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,e)])},CLASS_NAME:"OpenLayers.Control.PanPanel"}),OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",template:"${layers}",destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this}),this.updateAttribution(),this.div},updateAttribution:function(){var e=[];if(this.map&&this.map.layers){for(var t=0,i=this.map.layers.length;t<i;t++){var n=this.map.layers[t];n.attribution&&n.getVisibility()&&-1===OpenLayers.Util.indexOf(e,n.attribution)&&e.push(n.attribution)}this.div.innerHTML=OpenLayers.String.format(this.template,{layers:e.join(this.separator)})}},CLASS_NAME:"OpenLayers.Control.Attribution"}),OpenLayers.Kinetic=OpenLayers.Class({threshold:0,deceleration:.0035,nbPoints:100,delay:200,points:void 0,timerId:void 0,initialize:function(e){OpenLayers.Util.extend(this,e)},begin:function(){OpenLayers.Animation.stop(this.timerId),this.timerId=void 0,this.points=[]},update:function(e){this.points.unshift({xy:e,tick:(new Date).getTime()}),this.points.length>this.nbPoints&&this.points.pop()},end:function(e){for(var t,i,n=(new Date).getTime(),s=0,r=this.points.length;s<r&&(i=this.points[s],!(n-i.tick>this.delay));s++)t=i;if(t){var a=(new Date).getTime()-t.tick,o=Math.sqrt(Math.pow(e.x-t.xy.x,2)+Math.pow(e.y-t.xy.y,2)),l=o/a;if(!(0==l||l<this.threshold)){var h=Math.asin((e.y-t.xy.y)/o);return t.xy.x<=e.x&&(h=Math.PI-h),{speed:l,theta:h}}}},move:function(e,t){var i=e.speed,n=Math.cos(e.theta),s=-Math.sin(e.theta),r=(new Date).getTime(),a=0,o=0,l=function(){if(null!=this.timerId){var e=(new Date).getTime()-r,l=-this.deceleration*Math.pow(e,2)/2+i*e,h=l*n,u=l*s,p={};p.end=!1,-this.deceleration*e+i<=0&&(OpenLayers.Animation.stop(this.timerId),this.timerId=null,p.end=!0),p.x=h-a,p.y=u-o,a=h,o=u,t(p.x,p.y,p.end)}};this.timerId=OpenLayers.Animation.start(OpenLayers.Function.bind(l,this))},CLASS_NAME:"OpenLayers.Kinetic"}),OpenLayers.Format.WPSExecute=OpenLayers.Class(OpenLayers.Format.XML,OpenLayers.Format.Filter.v1_1_0,{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(e){},write:function(e){var t;window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),this.xmldom=t):t=document.implementation.createDocument("","",null);var i=this.writeNode("wps:Execute",e,t);return this.setAttributeNS(i,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation),OpenLayers.Format.XML.prototype.write.apply(this,[i])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},writers:{wps:{Execute:function(e){var t=this.createElementNSPlus("wps:Execute",{attributes:{version:this.VERSION,service:"WPS"}});return this.writeNode("ows:Identifier",e.identifier,t),this.writeNode("wps:DataInputs",e.dataInputs,t),this.writeNode("wps:ResponseForm",e.responseForm,t),t},ResponseForm:function(e){var t=this.createElementNSPlus("wps:ResponseForm",{});return e.rawDataOutput&&this.writeNode("wps:RawDataOutput",e.rawDataOutput,t),e.responseDocument&&this.writeNode("wps:ResponseDocument",e.responseDocument,t),t},ResponseDocument:function(e){var t=this.createElementNSPlus("wps:ResponseDocument",{attributes:{storeExecuteResponse:e.storeExecuteResponse,lineage:e.lineage,status:e.status}});if(e.outputs)for(var i=0,n=e.outputs.length;i<n;i++)this.writeNode("wps:Output",e.outputs[i],t);return t},Output:function(e){var t=this.createElementNSPlus("wps:Output",{attributes:{asReference:e.asReference,mimeType:e.mimeType,encoding:e.encoding,schema:e.schema}});return this.writeNode("ows:Identifier",e.identifier,t),this.writeNode("ows:Title",e.title,t),this.writeNode("ows:Abstract",e.abstract,t),t},RawDataOutput:function(e){var t=this.createElementNSPlus("wps:RawDataOutput",{attributes:{mimeType:e.mimeType,encoding:e.encoding,schema:e.schema}});return this.writeNode("ows:Identifier",e.identifier,t),t},DataInputs:function(e){for(var t=this.createElementNSPlus("wps:DataInputs",{}),i=0,n=e.length;i<n;++i)this.writeNode("wps:Input",e[i],t);return t},Input:function(e){var t=this.createElementNSPlus("wps:Input",{});return this.writeNode("ows:Identifier",e.identifier,t),e.title&&this.writeNode("ows:Title",e.title,t),e.data&&this.writeNode("wps:Data",e.data,t),e.reference&&this.writeNode("wps:Reference",e.reference,t),e.boundingBoxData&&this.writeNode("wps:BoundingBoxData",e.boundingBoxData,t),t},Data:function(e){var t=this.createElementNSPlus("wps:Data",{});return e.literalData?this.writeNode("wps:LiteralData",e.literalData,t):e.complexData?this.writeNode("wps:ComplexData",e.complexData,t):e.boundingBoxData&&this.writeNode("ows:BoundingBox",e.boundingBoxData,t),t},LiteralData:function(e){return this.createElementNSPlus("wps:LiteralData",{attributes:{uom:e.uom},value:e.value})},ComplexData:function(e){var t=this.createElementNSPlus("wps:ComplexData",{attributes:{mimeType:e.mimeType,encoding:e.encoding,schema:e.schema}}),i=e.value;return"string"==typeof i?t.appendChild(this.getXMLDoc().createCDATASection(e.value)):t.appendChild(i),t},Reference:function(e){var t=this.createElementNSPlus("wps:Reference",{attributes:{mimeType:e.mimeType,"xlink:href":e.href,method:e.method,encoding:e.encoding,schema:e.schema}});return e.body&&this.writeNode("wps:Body",e.body,t),t},BoundingBoxData:function(e,t){this.writers.ows.BoundingBox.apply(this,[e,t,"wps:BoundingBoxData"])},Body:function(e){var t=this.createElementNSPlus("wps:Body",{});return e.wcs?this.writeNode("wcs:GetCoverage",e.wcs,t):e.wfs?(this.featureType=e.wfs.featureType,this.version=e.wfs.version,this.writeNode("wfs:GetFeature",e.wfs,t)):this.writeNode("wps:Execute",e,t),t}},wcs:OpenLayers.Format.WCSGetCoverage.prototype.writers.wcs,wfs:OpenLayers.Format.WFST.v1_1_0.prototype.writers.wfs,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc,ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},readers:{wps:{ExecuteResponse:function(e,t){t.executeResponse={lang:e.getAttribute("lang"),statusLocation:e.getAttribute("statusLocation"),serviceInstance:e.getAttribute("serviceInstance"),service:e.getAttribute("service")},this.readChildNodes(e,t.executeResponse)},Process:function(e,t){t.process={},this.readChildNodes(e,t.process)},Status:function(e,t){t.status={creationTime:e.getAttribute("creationTime")},this.readChildNodes(e,t.status)},ProcessSucceeded:function(e,t){t.processSucceeded=!0},ProcessOutputs:function(e,t){t.processOutputs=[],this.readChildNodes(e,t.processOutputs)},Output:function(e,t){var i={};this.readChildNodes(e,i),t.push(i)},Reference:function(e,t){t.reference={href:e.getAttribute("href"),mimeType:e.getAttribute("mimeType"),encoding:e.getAttribute("encoding"),schema:e.getAttribute("schema")}},Data:function(e,t){t.data={},this.readChildNodes(e,t)},LiteralData:function(e,t){t.literalData={dataType:e.getAttribute("dataType"),uom:e.getAttribute("uom"),value:this.getChildValue(e)}},ComplexData:function(e,t){if(t.complexData={mimeType:e.getAttribute("mimeType"),schema:e.getAttribute("schema"),encoding:e.getAttribute("encoding"),value:""},this.isSimpleContent(e)){var i;for(i=e.firstChild;i;i=i.nextSibling)switch(i.nodeType){case 3:case 4:t.complexData.value+=i.nodeValue}}else for(i=e.firstChild;i;i=i.nextSibling)1==i.nodeType&&(t.complexData.value=i)},BoundingBox:function(e,t){t.boundingBoxData={dimensions:e.getAttribute("dimensions"),crs:e.getAttribute("crs")},this.readChildNodes(e,t.boundingBoxData)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSExecute"}),OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:!0,initialize:function(e,t,i){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[e,i]),this.location=t,this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments),this.clearFeatures(),this.features=null},loadRSS:function(){this.loaded||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location,success:this.parseData,scope:this}),this.loaded=!0)},moveTo:function(e,t,i){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),this.visibility&&!this.loaded&&this.loadRSS()},parseData:function(e){var t=e.responseXML;if(t&&t.documentElement||(t=OpenLayers.Format.XML.prototype.read(e.responseText)),this.useFeedTitle){var i=null;try{i=t.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(e){i=t.getElementsByTagName("title")[0].firstChild.nodeValue}i&&this.setName(i)}var n={};OpenLayers.Util.extend(n,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(n.externalProjection=this.projection,n.internalProjection=this.map.getProjectionObject());for(var s=new OpenLayers.Format.GeoRSS(n).read(t),r=0,a=s.length;r<a;r++){var o={};if((d=s[r]).geometry){var l=d.attributes.title?d.attributes.title:"Untitled",h=d.attributes.description?d.attributes.description:"No description.",u=d.attributes.link?d.attributes.link:"",p=d.geometry.getBounds().getCenterLonLat();if(o.icon=null==this.icon?OpenLayers.Marker.defaultIcon():this.icon.clone(),o.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120),l||h){o.title=l,o.description=h;var c='<div class="olLayerGeoRSSClose">[x]</div>';c+='<div class="olLayerGeoRSSTitle">',u&&(c+='<a class="link" href="'+u+'" target="_blank">'),c+=l,u&&(c+="</a>"),c+="</div>",c+='<div style="" class="olLayerGeoRSSDescription">',c+=h,c+="</div>",o.popupContentHTML=c}var d=new OpenLayers.Feature(this,p,o);this.features.push(d);var f=d.createMarker();f.events.register("click",d,this.markerClick),this.addMarker(f)}}this.events.triggerEvent("loadend")},markerClick:function(e){var t=this==this.layer.selectedFeature;this.layer.selectedFeature=t?null:this;for(var i=0,n=this.layer.map.popups.length;i<n;i++)this.layer.map.removePopup(this.layer.map.popups[i]);if(!t){var s=this.createPopup();OpenLayers.Event.observe(s.div,"click",OpenLayers.Function.bind(function(){for(var e=0,t=this.layer.map.popups.length;e<t;e++)this.layer.map.removePopup(this.layer.map.popups[e])},this)),this.layer.map.addPopup(s)}OpenLayers.Event.stop(e)},clearFeatures:function(){if(null!=this.features)for(;this.features.length>0;){var e=this.features[0];OpenLayers.Util.removeItem(this.features,e),e.destroy()}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"}),OpenLayers.Symbolizer.Point=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(e){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Point"}),OpenLayers.Symbolizer.Line=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(e){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Line"}),OpenLayers.Symbolizer.Text=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(e){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Text"}),OpenLayers.Format.SLD.v1=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,{namespaces:{sld:"http://www.opengis.net/sld",ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"sld",schemaLocation:null,multipleSymbolizers:!1,featureTypeCounter:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3,graphicName:"square"},read:function(e,t){var i={namedLayers:!0===(t=OpenLayers.Util.applyDefaults(t,this.options)).namedLayersAsArray?[]:{}};return this.readChildNodes(e,i),i},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(e,t){t.version=e.getAttribute("version"),this.readChildNodes(e,t)},Name:function(e,t){t.name=this.getChildValue(e)},Title:function(e,t){t.title=this.getChildValue(e)},Abstract:function(e,t){t.description=this.getChildValue(e)},NamedLayer:function(e,t){var i={userStyles:[],namedStyles:[]};this.readChildNodes(e,i);for(var n=0,s=i.userStyles.length;n<s;++n)i.userStyles[n].layerName=i.name;OpenLayers.Util.isArray(t.namedLayers)?t.namedLayers.push(i):t.namedLayers[i.name]=i},NamedStyle:function(e,t){t.namedStyles.push(this.getChildName(e.firstChild))},UserStyle:function(e,t){var i={defaultsPerSymbolizer:!0,rules:[]};this.featureTypeCounter=-1,this.readChildNodes(e,i);var n;this.multipleSymbolizers?(delete i.defaultsPerSymbolizer,n=new OpenLayers.Style2(i)):n=new OpenLayers.Style(this.defaultSymbolizer,i),t.userStyles.push(n)},IsDefault:function(e,t){"1"==this.getChildValue(e)&&(t.isDefault=!0)},FeatureTypeStyle:function(e,t){++this.featureTypeCounter;var i={rules:this.multipleSymbolizers?t.rules:[]};this.readChildNodes(e,i),this.multipleSymbolizers||(t.rules=i.rules)},Rule:function(e,t){var i;this.multipleSymbolizers&&(i={symbolizers:[]});var n=new OpenLayers.Rule(i);this.readChildNodes(e,n),t.rules.push(n)},ElseFilter:function(e,t){t.elseFilter=!0},MinScaleDenominator:function(e,t){t.minScaleDenominator=parseFloat(this.getChildValue(e))},MaxScaleDenominator:function(e,t){t.maxScaleDenominator=parseFloat(this.getChildValue(e))},TextSymbolizer:function(e,t){var i={};this.readChildNodes(e,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)},LabelPlacement:function(e,t){this.readChildNodes(e,t)},PointPlacement:function(e,t){var i={};this.readChildNodes(e,i),i.labelRotation=i.rotation,delete i.rotation;var n,s=t.labelAnchorPointX,r=t.labelAnchorPointY;s<=1/3?n="l":s>1/3&&s<2/3?n="c":s>=2/3&&(n="r"),r<=1/3?n+="b":r>1/3&&r<2/3?n+="m":r>=2/3&&(n+="t"),i.labelAlign=n,OpenLayers.Util.applyDefaults(t,i)},AnchorPoint:function(e,t){this.readChildNodes(e,t)},AnchorPointX:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.labelAnchorPointX=i)},AnchorPointY:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.labelAnchorPointY=i)},Displacement:function(e,t){this.readChildNodes(e,t)},DisplacementX:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.labelXOffset=i)},DisplacementY:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.labelYOffset=i)},LinePlacement:function(e,t){this.readChildNodes(e,t)},PerpendicularOffset:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.labelPerpendicularOffset=i)},Label:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.label=i)},Font:function(e,t){this.readChildNodes(e,t)},Halo:function(e,t){var i={};this.readChildNodes(e,i),t.haloRadius=i.haloRadius,t.haloColor=i.fillColor,t.haloOpacity=i.fillOpacity},Radius:function(e,t){var i=this.readers.ogc._expression.call(this,e);null!=i&&(t.haloRadius=i)},RasterSymbolizer:function(e,t){var i={};this.readChildNodes(e,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(e,t){t.geometry={},this.readChildNodes(e,t.geometry)},ColorMap:function(e,t){t.colorMap=[],this.readChildNodes(e,t.colorMap)},ColorMapEntry:function(e,t){var i=e.getAttribute("quantity"),n=e.getAttribute("opacity");t.push({color:e.getAttribute("color"),quantity:null!==i?parseFloat(i):void 0,label:e.getAttribute("label")||void 0,opacity:null!==n?parseFloat(n):void 0})},LineSymbolizer:function(e,t){var i={};this.readChildNodes(e,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(e,t){var i={fill:!1,stroke:!1};this.multipleSymbolizers||(i=t.symbolizer.Polygon||i),this.readChildNodes(e,i),this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Polygon(i))):t.symbolizer.Polygon=i},PointSymbolizer:function(e,t){var i={fill:!1,stroke:!1,graphic:!1};this.multipleSymbolizers||(i=t.symbolizer.Point||i),this.readChildNodes(e,i),this.multipleSymbolizers?(i.zIndex=this.featureTypeCounter,t.symbolizers.push(new OpenLayers.Symbolizer.Point(i))):t.symbolizer.Point=i},Stroke:function(e,t){t.stroke=!0,this.readChildNodes(e,t)},Fill:function(e,t){t.fill=!0,this.readChildNodes(e,t)},CssParameter:function(e,t){var i=e.getAttribute("name"),n=this.cssMap[i];if(t.label&&("fill"===i?n="fontColor":"fill-opacity"===i&&(n="fontOpacity")),n){var s=this.readers.ogc._expression.call(this,e);s&&(t[n]=s)}},Graphic:function(e,t){t.graphic=!0;var i={};this.readChildNodes(e,i);for(var n,s,r=["stroke","strokeColor","strokeWidth","strokeOpacity","strokeLinecap","fill","fillColor","fillOpacity","graphicName","rotation","graphicFormat"],a=0,o=r.length;a<o;++a)void 0!=(s=i[n=r[a]])&&(t[n]=s);if(void 0!=i.opacity&&(t.graphicOpacity=i.opacity),void 0!=i.size){var l=i.size/2;isNaN(l)?t.graphicWidth=i.size:t.pointRadius=i.size/2}void 0!=i.href&&(t.externalGraphic=i.href),void 0!=i.rotation&&(t.rotation=i.rotation)},ExternalGraphic:function(e,t){this.readChildNodes(e,t)},Mark:function(e,t){this.readChildNodes(e,t)},WellKnownName:function(e,t){t.graphicName=this.getChildValue(e)},Opacity:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.opacity=i)},Size:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.size=i)},Rotation:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.rotation=i)},OnlineResource:function(e,t){t.href=this.getAttributeNS(e,this.namespaces.xlink,"href")},Format:function(e,t){t.graphicFormat=this.getChildValue(e)}}},OpenLayers.Format.Filter.v1_0_0.prototype.readers),cssMap:{stroke:"strokeColor","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-dasharray":"strokeDashstyle",fill:"fillColor","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","font-weight":"fontWeight","font-style":"fontStyle"},getCssProperty:function(e){var t=null;for(var i in this.cssMap)if(this.cssMap[i]==e){t=i;break}return t},getGraphicFormat:function(e){var t;for(var i in this.graphicFormats)if(this.graphicFormats[i].test(e)){t=i;break}return t||this.defaultGraphicFormat},defaultGraphicFormat:"image/png",graphicFormats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(e){return this.writers.sld.StyledLayerDescriptor.apply(this,[e])},writers:OpenLayers.Util.applyDefaults({sld:{_OGCExpression:function(e,t){var i=this.createElementNSPlus(e),n="string"==typeof t?t.split("${"):[t];i.appendChild(this.createTextNode(n[0]));for(var s,r,a=1,o=n.length;a<o;a++)(r=(s=n[a]).indexOf("}"))>0?(this.writeNode("ogc:PropertyName",{property:s.substring(0,r)},i),i.appendChild(this.createTextNode(s.substring(++r)))):i.appendChild(this.createTextNode("${"+s));return i},StyledLayerDescriptor:function(e){var t=this.createElementNSPlus("sld:StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});if(t.setAttribute("xmlns:ogc",this.namespaces.ogc),t.setAttribute("xmlns:gml",this.namespaces.gml),e.name&&this.writeNode("Name",e.name,t),e.title&&this.writeNode("Title",e.title,t),e.description&&this.writeNode("Abstract",e.description,t),OpenLayers.Util.isArray(e.namedLayers))for(var i=0,n=e.namedLayers.length;i<n;++i)this.writeNode("NamedLayer",e.namedLayers[i],t);else for(var s in e.namedLayers)this.writeNode("NamedLayer",e.namedLayers[s],t);return t},Name:function(e){return this.createElementNSPlus("sld:Name",{value:e})},Title:function(e){return this.createElementNSPlus("sld:Title",{value:e})},Abstract:function(e){return this.createElementNSPlus("sld:Abstract",{value:e})},NamedLayer:function(e){var t=this.createElementNSPlus("sld:NamedLayer");if(this.writeNode("Name",e.name,t),e.namedStyles)for(var i=0,n=e.namedStyles.length;i<n;++i)this.writeNode("NamedStyle",e.namedStyles[i],t);if(e.userStyles)for(var i=0,n=e.userStyles.length;i<n;++i)this.writeNode("UserStyle",e.userStyles[i],t);return t},NamedStyle:function(e){var t=this.createElementNSPlus("sld:NamedStyle");return this.writeNode("Name",e,t),t},UserStyle:function(e){var t=this.createElementNSPlus("sld:UserStyle");if(e.name&&this.writeNode("Name",e.name,t),e.title&&this.writeNode("Title",e.title,t),e.description&&this.writeNode("Abstract",e.description,t),e.isDefault&&this.writeNode("IsDefault",e.isDefault,t),this.multipleSymbolizers&&e.rules){for(var i,n,s,r,a,o={0:[]},l=[0],h=0,u=e.rules.length;h<u;++h)if((i=e.rules[h]).symbolizers){n={};for(var p=0,c=i.symbolizers.length;p<c;++p)(r=(s=i.symbolizers[p]).zIndex)in n||((a=i.clone()).symbolizers=[],n[r]=a),n[r].symbolizers.push(s.clone());for(r in n)r in o||(l.push(r),o[r]=[]),o[r].push(n[r])}else o[0].push(i.clone());l.sort();for(var h=0,u=l.length;h<u;++h)o[l[h]].length>0&&((a=e.clone()).rules=o[l[h]],this.writeNode("FeatureTypeStyle",a,t))}else this.writeNode("FeatureTypeStyle",e,t);return t},IsDefault:function(e){return this.createElementNSPlus("sld:IsDefault",{value:e?"1":"0"})},FeatureTypeStyle:function(e){for(var t=this.createElementNSPlus("sld:FeatureTypeStyle"),i=0,n=e.rules.length;i<n;++i)this.writeNode("Rule",e.rules[i],t);return t},Rule:function(e){var t=this.createElementNSPlus("sld:Rule");e.name&&this.writeNode("Name",e.name,t),e.title&&this.writeNode("Title",e.title,t),e.description&&this.writeNode("Abstract",e.description,t),e.elseFilter?this.writeNode("ElseFilter",null,t):e.filter&&this.writeNode("ogc:Filter",e.filter,t),void 0!=e.minScaleDenominator&&this.writeNode("MinScaleDenominator",e.minScaleDenominator,t),void 0!=e.maxScaleDenominator&&this.writeNode("MaxScaleDenominator",e.maxScaleDenominator,t);var i;if(this.multipleSymbolizers&&e.symbolizers)for(var n,s=0,r=e.symbolizers.length;s<r;++s)i=(n=e.symbolizers[s]).CLASS_NAME.split(".").pop(),this.writeNode(i+"Symbolizer",n,t);else for(var a=OpenLayers.Style.SYMBOLIZER_PREFIXES,s=0,o=a.length;s<o;++s)i=a[s],(n=e.symbolizer[i])&&this.writeNode(i+"Symbolizer",n,t);return t},ElseFilter:function(){return this.createElementNSPlus("sld:ElseFilter")},MinScaleDenominator:function(e){return this.createElementNSPlus("sld:MinScaleDenominator",{value:e})},MaxScaleDenominator:function(e){return this.createElementNSPlus("sld:MaxScaleDenominator",{value:e})},LineSymbolizer:function(e){var t=this.createElementNSPlus("sld:LineSymbolizer");return this.writeNode("Stroke",e,t),t},Stroke:function(e){var t=this.createElementNSPlus("sld:Stroke");return void 0!=e.strokeColor&&this.writeNode("CssParameter",{symbolizer:e,key:"strokeColor"},t),void 0!=e.strokeOpacity&&this.writeNode("CssParameter",{symbolizer:e,key:"strokeOpacity"},t),void 0!=e.strokeWidth&&this.writeNode("CssParameter",{symbolizer:e,key:"strokeWidth"},t),void 0!=e.strokeDashstyle&&"solid"!==e.strokeDashstyle&&this.writeNode("CssParameter",{symbolizer:e,key:"strokeDashstyle"},t),void 0!=e.strokeLinecap&&this.writeNode("CssParameter",{symbolizer:e,key:"strokeLinecap"},t),t},CssParameter:function(e){return this.createElementNSPlus("sld:CssParameter",{attributes:{name:this.getCssProperty(e.key)},value:e.symbolizer[e.key]})},TextSymbolizer:function(e){var t=this.createElementNSPlus("sld:TextSymbolizer");return null!=e.label&&this.writeNode("Label",e.label,t),null==e.fontFamily&&null==e.fontSize&&null==e.fontWeight&&null==e.fontStyle||this.writeNode("Font",e,t),null==e.labelAnchorPointX&&null==e.labelAnchorPointY&&null==e.labelAlign&&null==e.labelXOffset&&null==e.labelYOffset&&null==e.labelRotation&&null==e.labelPerpendicularOffset||this.writeNode("LabelPlacement",e,t),null==e.haloRadius&&null==e.haloColor&&null==e.haloOpacity||this.writeNode("Halo",e,t),null==e.fontColor&&null==e.fontOpacity||this.writeNode("Fill",{fillColor:e.fontColor,fillOpacity:e.fontOpacity},t),t},LabelPlacement:function(e){var t=this.createElementNSPlus("sld:LabelPlacement");return null==e.labelAnchorPointX&&null==e.labelAnchorPointY&&null==e.labelAlign&&null==e.labelXOffset&&null==e.labelYOffset&&null==e.labelRotation||null!=e.labelPerpendicularOffset||this.writeNode("PointPlacement",e,t),null!=e.labelPerpendicularOffset&&this.writeNode("LinePlacement",e,t),t},LinePlacement:function(e){var t=this.createElementNSPlus("sld:LinePlacement");return this.writeNode("PerpendicularOffset",e.labelPerpendicularOffset,t),t},PerpendicularOffset:function(e){return this.createElementNSPlus("sld:PerpendicularOffset",{value:e})},PointPlacement:function(e){var t=this.createElementNSPlus("sld:PointPlacement");return null==e.labelAnchorPointX&&null==e.labelAnchorPointY&&null==e.labelAlign||this.writeNode("AnchorPoint",e,t),null==e.labelXOffset&&null==e.labelYOffset||this.writeNode("Displacement",e,t),null!=e.labelRotation&&this.writeNode("Rotation",e.labelRotation,t),t},AnchorPoint:function(e){var t=this.createElementNSPlus("sld:AnchorPoint"),i=e.labelAnchorPointX,n=e.labelAnchorPointY;if(null!=i&&this.writeNode("AnchorPointX",i,t),null!=n&&this.writeNode("AnchorPointY",n,t),null==i&&null==n){var s=e.labelAlign.substr(0,1),r=e.labelAlign.substr(1,1);"l"===s?i=0:"c"===s?i=.5:"r"===s&&(i=1),"b"===r?n=0:"m"===r?n=.5:"t"===r&&(n=1),this.writeNode("AnchorPointX",i,t),this.writeNode("AnchorPointY",n,t)}return t},AnchorPointX:function(e){return this.createElementNSPlus("sld:AnchorPointX",{value:e})},AnchorPointY:function(e){return this.createElementNSPlus("sld:AnchorPointY",{value:e})},Displacement:function(e){var t=this.createElementNSPlus("sld:Displacement");return null!=e.labelXOffset&&this.writeNode("DisplacementX",e.labelXOffset,t),null!=e.labelYOffset&&this.writeNode("DisplacementY",e.labelYOffset,t),t},DisplacementX:function(e){return this.createElementNSPlus("sld:DisplacementX",{value:e})},DisplacementY:function(e){return this.createElementNSPlus("sld:DisplacementY",{value:e})},Font:function(e){var t=this.createElementNSPlus("sld:Font");return e.fontFamily&&this.writeNode("CssParameter",{symbolizer:e,key:"fontFamily"},t),e.fontSize&&this.writeNode("CssParameter",{symbolizer:e,key:"fontSize"},t),e.fontWeight&&this.writeNode("CssParameter",{symbolizer:e,key:"fontWeight"},t),e.fontStyle&&this.writeNode("CssParameter",{symbolizer:e,key:"fontStyle"},t),t},Label:function(e){return this.writers.sld._OGCExpression.call(this,"sld:Label",e)},Halo:function(e){var t=this.createElementNSPlus("sld:Halo");return e.haloRadius&&this.writeNode("Radius",e.haloRadius,t),(e.haloColor||e.haloOpacity)&&this.writeNode("Fill",{fillColor:e.haloColor,fillOpacity:e.haloOpacity},t),t},Radius:function(e){return this.createElementNSPlus("sld:Radius",{value:e})},RasterSymbolizer:function(e){var t=this.createElementNSPlus("sld:RasterSymbolizer");return e.geometry&&this.writeNode("Geometry",e.geometry,t),e.opacity&&this.writeNode("Opacity",e.opacity,t),e.colorMap&&this.writeNode("ColorMap",e.colorMap,t),t},Geometry:function(e){var t=this.createElementNSPlus("sld:Geometry");return e.property&&this.writeNode("ogc:PropertyName",e,t),t},ColorMap:function(e){for(var t=this.createElementNSPlus("sld:ColorMap"),i=0,n=e.length;i<n;++i)this.writeNode("ColorMapEntry",e[i],t);return t},ColorMapEntry:function(e){var t=this.createElementNSPlus("sld:ColorMapEntry"),i=e;return t.setAttribute("color",i.color),void 0!==i.opacity&&t.setAttribute("opacity",parseFloat(i.opacity)),void 0!==i.quantity&&t.setAttribute("quantity",parseFloat(i.quantity)),void 0!==i.label&&t.setAttribute("label",i.label),t},PolygonSymbolizer:function(e){var t=this.createElementNSPlus("sld:PolygonSymbolizer");return!1!==e.fill&&this.writeNode("Fill",e,t),!1!==e.stroke&&this.writeNode("Stroke",e,t),t},Fill:function(e){var t=this.createElementNSPlus("sld:Fill");return e.fillColor&&this.writeNode("CssParameter",{symbolizer:e,key:"fillColor"},t),null!=e.fillOpacity&&this.writeNode("CssParameter",{symbolizer:e,key:"fillOpacity"},t),t},PointSymbolizer:function(e){var t=this.createElementNSPlus("sld:PointSymbolizer");return this.writeNode("Graphic",e,t),t},Graphic:function(e){var t=this.createElementNSPlus("sld:Graphic");return void 0!=e.externalGraphic?this.writeNode("ExternalGraphic",e,t):this.writeNode("Mark",e,t),void 0!=e.graphicOpacity&&this.writeNode("Opacity",e.graphicOpacity,t),void 0!=e.pointRadius?this.writeNode("Size",2*e.pointRadius,t):void 0!=e.graphicWidth&&this.writeNode("Size",e.graphicWidth,t),void 0!=e.rotation&&this.writeNode("Rotation",e.rotation,t),t},ExternalGraphic:function(e){var t=this.createElementNSPlus("sld:ExternalGraphic");this.writeNode("OnlineResource",e.externalGraphic,t);var i=e.graphicFormat||this.getGraphicFormat(e.externalGraphic);return this.writeNode("Format",i,t),t},Mark:function(e){var t=this.createElementNSPlus("sld:Mark");return e.graphicName&&this.writeNode("WellKnownName",e.graphicName,t),!1!==e.fill&&this.writeNode("Fill",e,t),!1!==e.stroke&&this.writeNode("Stroke",e,t),t},WellKnownName:function(e){return this.createElementNSPlus("sld:WellKnownName",{value:e})},Opacity:function(e){return this.createElementNSPlus("sld:Opacity",{value:e})},Size:function(e){return this.writers.sld._OGCExpression.call(this,"sld:Size",e)},Rotation:function(e){return this.createElementNSPlus("sld:Rotation",{value:e})},OnlineResource:function(e){return this.createElementNSPlus("sld:OnlineResource",{attributes:{"xlink:type":"simple","xlink:href":e}})},Format:function(e){return this.createElementNSPlus("sld:Format",{value:e})}}},OpenLayers.Format.Filter.v1_0_0.prototype.writers),CLASS_NAME:"OpenLayers.Format.SLD.v1"}),OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"},isBaseLayer:!0,encodeBBOX:!1,noMagic:!1,yx:{},initialize:function(e,t,i,n){var s=[];i=OpenLayers.Util.upperCaseObject(i),parseFloat(i.VERSION)>=1.3&&!i.EXCEPTIONS&&(i.EXCEPTIONS="INIMAGE"),s.push(e,t,i,n),OpenLayers.Layer.Grid.prototype.initialize.apply(this,s),OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)),!this.noMagic&&this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase()&&(null!=n&&n.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"))},clone:function(e){return null==e&&(e=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},reverseAxisOrder:function(){var e=this.projection.getCode();return parseFloat(this.params.VERSION)>=1.3&&!!(this.yx[e]||OpenLayers.Projection.defaults[e]&&OpenLayers.Projection.defaults[e].yx)},getURL:function(e){e=this.adjustBounds(e);var t=this.getImageSize(),i={},n=this.reverseAxisOrder();return i.BBOX=this.encodeBBOX?e.toBBOX(null,n):e.toArray(n),i.WIDTH=t.w,i.HEIGHT=t.h,this.getFullRequestString(i)},mergeNewParams:function(e){var t=[OpenLayers.Util.upperCaseObject(e)];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,t)},getFullRequestString:function(e,t){var i=this.map.getProjectionObject(),n=this.projection&&this.projection.equals(i)?this.projection.getCode():i.getCode(),s="none"==n?null:n;return parseFloat(this.params.VERSION)>=1.3?this.params.CRS=s:this.params.SRS=s,"boolean"==typeof this.params.TRANSPARENT&&(e.TRANSPARENT=this.params.TRANSPARENT?"TRUE":"FALSE"),OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"}),OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(e,t,i,n){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(e){e=this.adjustBounds(e);var t=this.map.getResolution(),i=Math.round(1e4*this.map.getScale())/1e4,n=Math.round(e.left/t),s=-Math.round(e.top/t);return this.getFullRequestString({t:s,l:n,s:i})},calculateGridLayout:function(e,t,i){var n=i*this.tileSize.w,s=i*this.tileSize.h,r=e.left,a=Math.floor(r/n)-this.buffer,o=e.top;return{tilelon:n,tilelat:s,startcol:a,startrow:Math.floor(o/s)+this.buffer}},getTileBoundsForGridIndex:function(e,t){this.getTileOrigin();var i=this.gridLayout,n=i.tilelon,s=i.tilelat,r=(i.startcol+t)*n,a=(i.startrow-e)*s;return new OpenLayers.Bounds(r,a,r+n,a+s)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e]),null!=this.tileSize&&(e.tileSize=this.tileSize.clone()),e.grid=[],e},getTileBounds:function(e){var t=this.getResolution(),i=t*this.tileSize.w,n=t*this.tileSize.h,s=this.getLonLatFromViewPortPx(e),r=i*Math.floor(s.lon/i),a=n*Math.floor(s.lat/n);return new OpenLayers.Bounds(r,a,r+i,a+n)},CLASS_NAME:"OpenLayers.Layer.KaMap"}),OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd",initialize:function(e){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[e])},read_sld_MinScaleDenominator:function(e,t){var i=parseFloat(this.getChildValue(t));i>0&&(e.maxScale=i)},read_sld_MaxScaleDenominator:function(e,t){e.minScale=parseFloat(this.getChildValue(t))},read_wmc_SRS:function(e,t){"srs"in e||(e.srs={}),e.srs[this.getChildValue(t)]=!0},write_wmc_Layer:function(e){var t=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[e]);if(e.maxScale){var i=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");i.appendChild(this.createTextNode(e.maxScale.toPrecision(16))),t.appendChild(i)}if(e.minScale){var n=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator");n.appendChild(this.createTextNode(e.minScale.toPrecision(16))),t.appendChild(n)}if(e.srs)for(var s in e.srs)t.appendChild(this.createElementDefaultNS("SRS",s));return t.appendChild(this.write_wmc_FormatList(e)),t.appendChild(this.write_wmc_StyleList(e)),e.dimensions&&t.appendChild(this.write_wmc_DimensionList(e)),t.appendChild(this.write_wmc_LayerExtension(e)),t},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"}),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,read:function(e,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i={};return this.readChildNodes(e,i),i},readers:{xls:{XLS:function(e,t){t.version=e.getAttribute("version"),this.readChildNodes(e,t)},Response:function(e,t){this.readChildNodes(e,t)},GeocodeResponse:function(e,t){t.responseLists=[],this.readChildNodes(e,t)},GeocodeResponseList:function(e,t){var i={features:[],numberOfGeocodedAddresses:parseInt(e.getAttribute("numberOfGeocodedAddresses"))};t.responseLists.push(i),this.readChildNodes(e,i)},GeocodedAddress:function(e,t){var i=new OpenLayers.Feature.Vector;t.features.push(i),this.readChildNodes(e,i),i.geometry=i.components[0]},GeocodeMatchCode:function(e,t){t.attributes.matchCode={accuracy:parseFloat(e.getAttribute("accuracy")),matchType:e.getAttribute("matchType")}},Address:function(e,t){var i={countryCode:e.getAttribute("countryCode"),addressee:e.getAttribute("addressee"),street:[],place:[]};t.attributes.address=i,this.readChildNodes(e,i)},freeFormAddress:function(e,t){t.freeFormAddress=this.getChildValue(e)},StreetAddress:function(e,t){this.readChildNodes(e,t)},Building:function(e,t){t.building={number:e.getAttribute("number"),subdivision:e.getAttribute("subdivision"),buildingName:e.getAttribute("buildingName")}},Street:function(e,t){t.street.push(this.getChildValue(e))},Place:function(e,t){t.place[e.getAttribute("type")]=this.getChildValue(e)},PostalCode:function(e,t){t.postalCode=this.getChildValue(e)}},gml:OpenLayers.Format.GML.v3.prototype.readers.gml},write:function(e){return this.writers.xls.XLS.apply(this,[e])},writers:{xls:{XLS:function(e){var t=this.createElementNSPlus("xls:XLS",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});return this.writeNode("RequestHeader",e.header,t),this.writeNode("Request",e,t),t},RequestHeader:function(e){return this.createElementNSPlus("xls:RequestHeader")},Request:function(e){var t=this.createElementNSPlus("xls:Request",{attributes:{methodName:"GeocodeRequest",requestID:e.requestID||"",version:this.VERSION}});return this.writeNode("GeocodeRequest",e.addresses,t),t},GeocodeRequest:function(e){for(var t=this.createElementNSPlus("xls:GeocodeRequest"),i=0,n=e.length;i<n;i++)this.writeNode("Address",e[i],t);return t},Address:function(e){var t=this.createElementNSPlus("xls:Address",{attributes:{countryCode:e.countryCode}});return e.freeFormAddress?this.writeNode("freeFormAddress",e.freeFormAddress,t):(e.street&&this.writeNode("StreetAddress",e,t),e.municipality&&this.writeNode("Municipality",e.municipality,t),e.countrySubdivision&&this.writeNode("CountrySubdivision",e.countrySubdivision,t),e.postalCode&&this.writeNode("PostalCode",e.postalCode,t)),t},freeFormAddress:function(e){return this.createElementNSPlus("freeFormAddress",{value:e})},StreetAddress:function(e){var t=this.createElementNSPlus("xls:StreetAddress");e.building&&this.writeNode(t,"Building",e.building);var i=e.street;OpenLayers.Util.isArray(i)||(i=[i]);for(var n=0,s=i.length;n<s;n++)this.writeNode("Street",i[n],t);return t},Building:function(e){return this.createElementNSPlus("xls:Building",{attributes:{number:e.number,subdivision:e.subdivision,buildingName:e.buildingName}})},Street:function(e){return this.createElementNSPlus("xls:Street",{value:e})},Municipality:function(e){return this.createElementNSPlus("xls:Place",{attributes:{type:"Municipality"},value:e})},CountrySubdivision:function(e){return this.createElementNSPlus("xls:Place",{attributes:{type:"CountrySubdivision"},value:e})},PostalCode:function(e){return this.createElementNSPlus("xls:PostalCode",{value:e})}}},CLASS_NAME:"OpenLayers.Format.XLS.v1"}),OpenLayers.Format.XLS.v1_1_0=OpenLayers.Class(OpenLayers.Format.XLS.v1,{VERSION:"1.1",schemaLocation:"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.1.0/LocationUtilityService.xsd",CLASS_NAME:"OpenLayers.Format.XLS.v1_1_0"}),OpenLayers.Format.XLS.v1_1=OpenLayers.Format.XLS.v1_1_0,OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15e3,translationParameters:null,symbolMetrics:null,initialize:function(e){this.supported()&&(OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.translationParameters={x:0,y:0},this.symbolMetrics={})},supported:function(){var e="http://www.w3.org/TR/SVG11/feature#";return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(e+"SVG","1.1")||document.implementation.hasFeature(e+"BasicStructure","1.1"))},inValidRange:function(e,t,i){var n=e+(i?0:this.translationParameters.x),s=t+(i?0:this.translationParameters.y);return n>=-this.MAX_PIXEL&&n<=this.MAX_PIXEL&&s>=-this.MAX_PIXEL&&s<=this.MAX_PIXEL},setExtent:function(e,t){var i=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),n=this.getResolution(),s=-e.left/n,r=e.top/n;if(t){this.left=s,this.top=r;var a="0 0 "+this.size.w+" "+this.size.h;return this.rendererRoot.setAttributeNS(null,"viewBox",a),this.translate(this.xOffset,0),!0}var o=this.translate(s-this.left+this.xOffset,r-this.top);return o||this.setExtent(e,!0),i&&o},translate:function(e,t){if(this.inValidRange(e,t,!0)){var i="";return(e||t)&&(i="translate("+e+","+t+")"),this.root.setAttributeNS(null,"transform",i),this.translationParameters={x:e,y:t},!0}return!1},setSize:function(e){OpenLayers.Renderer.prototype.setSize.apply(this,arguments),this.rendererRoot.setAttributeNS(null,"width",this.size.w),this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(e,t){var i=null;switch(e.CLASS_NAME){case"OpenLayers.Geometry.Point":i=t.externalGraphic?"image":this.isComplexSymbol(t.graphicName)?"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":i="path"}return i},setStyle:function(e,t,i){t=t||e._style,i=i||e._options;var n=t.title||t.graphicTitle;if(n){e.setAttributeNS(null,"title",n);var s=e.getElementsByTagName("title");if(s.length>0)s[0].firstChild.textContent=n;else{var r=this.nodeFactory(null,"title");r.textContent=n,e.appendChild(r)}}var a,o=parseFloat(e.getAttributeNS(null,"r")),l=1;if("OpenLayers.Geometry.Point"==e._geometryClass&&o){if(e.style.visibility="",!1===t.graphic)e.style.visibility="hidden";else if(t.externalGraphic){a=this.getPosition(e),t.graphicWidth&&t.graphicHeight&&e.setAttributeNS(null,"preserveAspectRatio","none");var h=t.graphicWidth||t.graphicHeight,u=t.graphicHeight||t.graphicWidth;h=h||2*t.pointRadius,u=u||2*t.pointRadius;var p=void 0!=t.graphicXOffset?t.graphicXOffset:-.5*h,c=void 0!=t.graphicYOffset?t.graphicYOffset:-.5*u,d=t.graphicOpacity||t.fillOpacity;e.setAttributeNS(null,"x",(a.x+p).toFixed()),e.setAttributeNS(null,"y",(a.y+c).toFixed()),e.setAttributeNS(null,"width",h),e.setAttributeNS(null,"height",u),e.setAttributeNS(this.xlinkns,"xlink:href",t.externalGraphic),e.setAttributeNS(null,"style","opacity: "+d),e.onclick=OpenLayers.Event.preventDefault}else if(this.isComplexSymbol(t.graphicName)){var f=3*t.pointRadius,m=2*f,y=this.importSymbol(t.graphicName);a=this.getPosition(e),l=3*this.symbolMetrics[y.id][0]/m;var g=e.parentNode,v=e.nextSibling;g&&g.removeChild(e),e.firstChild&&e.removeChild(e.firstChild),e.appendChild(y.firstChild.cloneNode(!0)),e.setAttributeNS(null,"viewBox",y.getAttributeNS(null,"viewBox")),e.setAttributeNS(null,"width",m),e.setAttributeNS(null,"height",m),e.setAttributeNS(null,"x",a.x-f),e.setAttributeNS(null,"y",a.y-f),v?g.insertBefore(e,v):g&&g.appendChild(e)}else e.setAttributeNS(null,"r",t.pointRadius);var L=t.rotation;if((void 0!==L||void 0!==e._rotation)&&a)if(e._rotation=L,L|=0,"svg"!==e.nodeName)e.setAttributeNS(null,"transform","rotate("+L+" "+a.x+" "+a.y+")");else{var O=this.symbolMetrics[y.id];e.firstChild.setAttributeNS(null,"transform","rotate("+L+" "+O[1]+" "+O[2]+")")}}return i.isFilled?(e.setAttributeNS(null,"fill",t.fillColor),e.setAttributeNS(null,"fill-opacity",t.fillOpacity)):e.setAttributeNS(null,"fill","none"),i.isStroked?(e.setAttributeNS(null,"stroke",t.strokeColor),e.setAttributeNS(null,"stroke-opacity",t.strokeOpacity),e.setAttributeNS(null,"stroke-width",t.strokeWidth*l),e.setAttributeNS(null,"stroke-linecap",t.strokeLinecap||"round"),e.setAttributeNS(null,"stroke-linejoin","round"),t.strokeDashstyle&&e.setAttributeNS(null,"stroke-dasharray",this.dashStyle(t,l))):e.setAttributeNS(null,"stroke","none"),t.pointerEvents&&e.setAttributeNS(null,"pointer-events",t.pointerEvents),null!=t.cursor&&e.setAttributeNS(null,"cursor",t.cursor),e},dashStyle:function(e,t){var i=e.strokeWidth*t,n=e.strokeDashstyle;switch(n){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(n).replace(/\s+/g,",")}},createNode:function(e,t){var i=document.createElementNS(this.xmlns,e);return t&&i.setAttributeNS(null,"id",t),i},nodeTypeCompare:function(e,t){return t==e.nodeName},createRenderRoot:function(){var e=this.nodeFactory(this.container.id+"_svgRoot","svg");return e.style.display="block",e},createRoot:function(e){return this.nodeFactory(this.container.id+e,"g")},createDefs:function(){var e=this.nodeFactory(this.container.id+"_defs","defs");return this.rendererRoot.appendChild(e),e},drawPoint:function(e,t){return this.drawCircle(e,t,1)},drawCircle:function(e,t,i){var n=this.getResolution(),s=(t.x-this.featureDx)/n+this.left,r=this.top-t.y/n;return!!this.inValidRange(s,r)&&(e.setAttributeNS(null,"cx",s),e.setAttributeNS(null,"cy",r),e.setAttributeNS(null,"r",i),e)},drawLineString:function(e,t){var i=this.getComponentsString(t.components);return!!i.path&&(e.setAttributeNS(null,"points",i.path),i.complete?e:null)},drawLinearRing:function(e,t){var i=this.getComponentsString(t.components);return!!i.path&&(e.setAttributeNS(null,"points",i.path),i.complete?e:null)},drawPolygon:function(e,t){for(var i,n,s="",r=!0,a=!0,o=0,l=t.components.length;o<l;o++)s+=" M",(n=(i=this.getComponentsString(t.components[o].components," ")).path)?(s+=" "+n,a=i.complete&&a):r=!1;return s+=" z",!!r&&(e.setAttributeNS(null,"d",s),e.setAttributeNS(null,"fill-rule","evenodd"),a?e:null)},drawRectangle:function(e,t){var i=this.getResolution(),n=(t.x-this.featureDx)/i+this.left,s=this.top-t.y/i;return!!this.inValidRange(n,s)&&(e.setAttributeNS(null,"x",n),e.setAttributeNS(null,"y",s),e.setAttributeNS(null,"width",t.width/i),e.setAttributeNS(null,"height",t.height/i),e)},drawText:function(e,t,i){var n=!!t.labelOutlineWidth;if(n){var s=OpenLayers.Util.extend({},t);s.fontColor=s.labelOutlineColor,s.fontStrokeColor=s.labelOutlineColor,s.fontStrokeWidth=t.labelOutlineWidth,t.labelOutlineOpacity&&(s.fontOpacity=t.labelOutlineOpacity),delete s.labelOutlineWidth,this.drawText(e,s,i)}var r=this.getResolution(),a=(i.x-this.featureDx)/r+this.left,o=i.y/r-this.top,l=n?this.LABEL_OUTLINE_SUFFIX:this.LABEL_ID_SUFFIX,h=this.nodeFactory(e+l,"text");h.setAttributeNS(null,"x",a),h.setAttributeNS(null,"y",-o),t.fontColor&&h.setAttributeNS(null,"fill",t.fontColor),t.fontStrokeColor&&h.setAttributeNS(null,"stroke",t.fontStrokeColor),t.fontStrokeWidth&&h.setAttributeNS(null,"stroke-width",t.fontStrokeWidth),t.fontOpacity&&h.setAttributeNS(null,"opacity",t.fontOpacity),t.fontFamily&&h.setAttributeNS(null,"font-family",t.fontFamily),t.fontSize&&h.setAttributeNS(null,"font-size",t.fontSize),t.fontWeight&&h.setAttributeNS(null,"font-weight",t.fontWeight),t.fontStyle&&h.setAttributeNS(null,"font-style",t.fontStyle),!0===t.labelSelect?(h.setAttributeNS(null,"pointer-events","visible"),h._featureId=e):h.setAttributeNS(null,"pointer-events","none");var u=t.labelAlign||OpenLayers.Renderer.defaultSymbolizer.labelAlign;h.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[u[0]]||"middle"),!0===OpenLayers.IS_GECKO&&h.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[u[1]]||"central");for(var p=t.label.split("\n"),c=p.length;h.childNodes.length>c;)h.removeChild(h.lastChild);for(var d=0;d<c;d++){var f=this.nodeFactory(e+l+"_tspan_"+d,"tspan");if(!0===t.labelSelect&&(f._featureId=e,f._geometry=i,f._geometryClass=i.CLASS_NAME),!1===OpenLayers.IS_GECKO&&f.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[u[1]]||"-35%"),f.setAttribute("x",a),0==d){var m=OpenLayers.Renderer.SVG.LABEL_VFACTOR[u[1]];null==m&&(m=-.5),f.setAttribute("dy",m*(c-1)+"em")}else f.setAttribute("dy","1em");f.textContent=""===p[d]?" ":p[d],f.parentNode||h.appendChild(f)}h.parentNode||this.textRoot.appendChild(h)},getComponentsString:function(e,t){for(var i,n,s=[],r=!0,a=e.length,o=[],l=0;l<a;l++)n=e[l],s.push(n),(i=this.getShortString(n))?o.push(i):(l>0&&this.getShortString(e[l-1])&&o.push(this.clipLine(e[l],e[l-1])),l<a-1&&this.getShortString(e[l+1])&&o.push(this.clipLine(e[l],e[l+1])),r=!1);return{path:o.join(t||","),complete:r}},clipLine:function(e,t){if(t.equals(e))return"";var i,n=this.getResolution(),s=this.MAX_PIXEL-this.translationParameters.x,r=this.MAX_PIXEL-this.translationParameters.y,a=(t.x-this.featureDx)/n+this.left,o=this.top-t.y/n,l=(e.x-this.featureDx)/n+this.left,h=this.top-e.y/n;return(l<-s||l>s)&&(i=(h-o)/(l-a),h=o+((l=l<0?-s:s)-a)*i),(h<-r||h>r)&&(i=(l-a)/(h-o),l=a+((h=h<0?-r:r)-o)*i),l+","+h},getShortString:function(e){var t=this.getResolution(),i=(e.x-this.featureDx)/t+this.left,n=this.top-e.y/t;return!!this.inValidRange(i,n)&&i+","+n},getPosition:function(e){return{x:parseFloat(e.getAttributeNS(null,"cx")),y:parseFloat(e.getAttributeNS(null,"cy"))}},importSymbol:function(e){this.defs||(this.defs=this.createDefs());var t=this.container.id+"-"+e,i=document.getElementById(t);if(null!=i)return i;var n=OpenLayers.Renderer.symbol[e];if(!n)throw new Error(e+" is not a valid symbol name");var s=this.nodeFactory(t,"symbol"),r=this.nodeFactory(null,"polygon");s.appendChild(r);for(var a,o,l=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),h=[],u=0;u<n.length;u+=2)a=n[u],o=n[u+1],l.left=Math.min(l.left,a),l.bottom=Math.min(l.bottom,o),l.right=Math.max(l.right,a),l.top=Math.max(l.top,o),h.push(a,",",o);r.setAttributeNS(null,"points",h.join(" "));var p=l.getWidth(),c=l.getHeight(),d=[l.left-p,l.bottom-c,3*p,3*c];return s.setAttributeNS(null,"viewBox",d.join(" ")),this.symbolMetrics[t]=[Math.max(p,c),l.getCenterLonLat().lon,l.getCenterLonLat().lat],this.defs.appendChild(s),s},getFeatureIdFromEvent:function(e){var t=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments);if(!t){var i=e.target;t=i.parentNode&&i!=this.rendererRoot?i.parentNode._featureId:void 0}return t},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(e){OpenLayers.Event.preventDefault(e)},OpenLayers.Format.SLD.v1_0_0=OpenLayers.Class(OpenLayers.Format.SLD.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd",CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0"}),OpenLayers.Format.OWSContext=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"0.3.1",getVersion:function(e,t){var i=OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this,arguments);return"0.3.0"===i&&(i=this.defaultVersion),i},toContext:function(e){var t={};return"OpenLayers.Map"==e.CLASS_NAME&&(t.bounds=e.getExtent(),t.maxExtent=e.maxExtent,t.projection=e.projection,t.size=e.getSize(),t.layers=e.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(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),OpenLayers.Format.GML.v2.prototype.setGeometryTypes.call(this)},setNestingPath:function(e){if(e.layersContext)for(var t=0,i=e.layersContext.length;t<i;t++){var n=e.layersContext[t],s=[],r=e.title||"";e.metadata&&e.metadata.nestingPath&&(s=e.metadata.nestingPath.slice()),""!=r&&s.push(r),n.metadata.nestingPath=s,n.layersContext&&this.setNestingPath(n)}},decomposeNestingPath:function(e){var t=[];if(OpenLayers.Util.isArray(e)){for(var i=e.slice();i.length>0;)t.push(i.slice()),i.pop();t.reverse()}return t},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};this.readNode(e,t),this.setNestingPath({layersContext:t.layersContext});var i=[];return this.processLayer(i,t),delete t.layersContext,t.layersContext=i,t},processLayer:function(e,t){if(t.layersContext)for(var i=0,n=t.layersContext.length;i<n;i++){var s=t.layersContext[i];e.push(s),s.layersContext&&this.processLayer(e,s)}},write:function(e,t){this.nestingLayerLookup={},t=t||{},OpenLayers.Util.applyDefaults(t,e);var i=this.writeNode("OWSContext",t);return 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(e,t){t.features=new OpenLayers.Format.KML({kmlns:this.namespaces.kml,extractStyles:!0}).read(e)}},owc:{OWSContext:function(e,t){this.readChildNodes(e,t)},General:function(e,t){this.readChildNodes(e,t)},ResourceList:function(e,t){this.readChildNodes(e,t)},Layer:function(e,t){var i={metadata:{},visibility:"1"!=e.getAttribute("hidden"),queryable:"1"==e.getAttribute("queryable"),opacity:null!=e.getAttribute("opacity")?parseFloat(e.getAttribute("opacity")):null,name:e.getAttribute("name"),categoryLayer:null==e.getAttribute("name"),formats:[],styles:[]};t.layersContext||(t.layersContext=[]),t.layersContext.push(i),this.readChildNodes(e,i)},InlineGeometry:function(e,t){t.features=[];var i,n=this.getElementsByTagNameNS(e,this.namespaces.gml,"featureMember");if(n.length>=1&&(i=n[0]),i&&i.firstChild){var s=i.firstChild.nextSibling?i.firstChild.nextSibling:i.firstChild;this.setNamespace("feature",s.namespaceURI),this.featureType=s.localName||s.nodeName.split(":").pop(),this.readChildNodes(e,t)}},Server:function(e,t){(t.service||t.version)&&t.service==OpenLayers.Format.Context.serviceTypes.WMS||(t.service=e.getAttribute("service"),t.version=e.getAttribute("version"),this.readChildNodes(e,t))},Name:function(e,t){t.name=this.getChildValue(e),this.readChildNodes(e,t)},Title:function(e,t){t.title=this.getChildValue(e),this.readChildNodes(e,t)},StyleList:function(e,t){this.readChildNodes(e,t.styles)},Style:function(e,t){var i={};t.push(i),this.readChildNodes(e,i)},LegendURL:function(e,t){var i={};t.legend=i,this.readChildNodes(e,i)},OnlineResource:function(e,t){t.url=this.getAttributeNS(e,this.namespaces.xlink,"href"),this.readChildNodes(e,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(e){var t=this.createElementNSPlus("OWSContext",{attributes:{version:this.VERSION,id:e.id||OpenLayers.Util.createUniqueID("OpenLayers_OWSContext_")}});return this.writeNode("General",e,t),this.writeNode("ResourceList",e,t),t},General:function(e){var t=this.createElementNSPlus("General");return this.writeNode("ows:BoundingBox",e,t),this.writeNode("ows:Title",e.title||"OpenLayers OWSContext",t),t},ResourceList:function(e){for(var t=this.createElementNSPlus("ResourceList"),i=0,n=e.layers.length;i<n;i++){var s=e.layers[i],r=this.decomposeNestingPath(s.metadata.nestingPath);this.writeNode("_Layer",{layer:s,subPaths:r},t)}return t},Server:function(e){var t=this.createElementNSPlus("Server",{attributes:{version:e.version,service:e.service}});return this.writeNode("OnlineResource",e,t),t},OnlineResource:function(e){return this.createElementNSPlus("OnlineResource",{attributes:{"xlink:href":e.url}})},InlineGeometry:function(e){var t=this.createElementNSPlus("InlineGeometry"),i=e.getDataExtent();null!==i&&this.writeNode("gml:boundedBy",i,t);for(var n=0,s=e.features.length;n<s;n++)this.writeNode("gml:featureMember",e.features[n],t);return t},StyleList:function(e){for(var t=this.createElementNSPlus("StyleList"),i=0,n=e.length;i<n;i++)this.writeNode("Style",e[i],t);return t},Style:function(e){var t=this.createElementNSPlus("Style");return this.writeNode("Name",e,t),this.writeNode("Title",e,t),e.legend&&this.writeNode("LegendURL",e,t),t},Name:function(e){return this.createElementNSPlus("Name",{value:e.name})},Title:function(e){return this.createElementNSPlus("Title",{value:e.title})},LegendURL:function(e){var t=this.createElementNSPlus("LegendURL");return this.writeNode("OnlineResource",e.legend,t),t},_WMS:function(e){var t=this.createElementNSPlus("Layer",{attributes:{name:e.params.LAYERS,queryable:e.queryable?"1":"0",hidden:e.visibility?"0":"1",opacity:e.hasOwnProperty("opacity")?e.opacity:null}});return this.writeNode("ows:Title",e.name,t),this.writeNode("ows:OutputFormat",e.params.FORMAT,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WMS,version:e.params.VERSION,url:e.url},t),e.metadata.styles&&e.metadata.styles.length>0&&this.writeNode("StyleList",e.metadata.styles,t),t},_Layer:function(e){var t,i,n,s;if(t=e.layer,i=e.subPaths,n=null,s=null,i.length>0){var r=i[0].join("/"),a=r.lastIndexOf("/");return n=this.nestingLayerLookup[r],s=a>0?r.substring(a+1,r.length):r,n||(n=this.createElementNSPlus("Layer"),this.writeNode("ows:Title",s,n),this.nestingLayerLookup[r]=n),e.subPaths.shift(),this.writeNode("_Layer",e,n),n}return t instanceof OpenLayers.Layer.WMS?n=this.writeNode("_WMS",t):t instanceof OpenLayers.Layer.Vector&&(t.protocol instanceof OpenLayers.Protocol.WFS.v1?n=this.writeNode("_WFS",t):t.protocol instanceof OpenLayers.Protocol.HTTP?t.protocol.format instanceof OpenLayers.Format.GML?(t.protocol.format.version="2.1.2",n=this.writeNode("_GML",t)):t.protocol.format instanceof OpenLayers.Format.KML&&(t.protocol.format.version="2.2",n=this.writeNode("_KML",t)):(this.setNamespace("feature",this.featureNS),n=this.writeNode("_InlineGeometry",t))),t.options.maxScale&&this.writeNode("sld:MinScaleDenominator",t.options.maxScale,n),t.options.minScale&&this.writeNode("sld:MaxScaleDenominator",t.options.minScale,n),this.nestingLayerLookup[t.name]=n,n},_WFS:function(e){var t=this.createElementNSPlus("Layer",{attributes:{name:e.protocol.featurePrefix+":"+e.protocol.featureType,hidden:e.visibility?"0":"1"}});return this.writeNode("ows:Title",e.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WFS,version:e.protocol.version,url:e.protocol.url},t),t},_InlineGeometry:function(e){var t=this.createElementNSPlus("Layer",{attributes:{name:this.featureType,hidden:e.visibility?"0":"1"}});return this.writeNode("ows:Title",e.name,t),this.writeNode("InlineGeometry",e,t),t},_GML:function(e){var t=this.createElementNSPlus("Layer");return this.writeNode("ows:Title",e.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.GML,url:e.protocol.url,version:e.protocol.format.version},t),t},_KML:function(e){var t=this.createElementNSPlus("Layer");return this.writeNode("ows:Title",e.name,t),this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.KML,version:e.protocol.format.version,url:e.protocol.url},t),t}},gml:OpenLayers.Util.applyDefaults({boundedBy:function(e){var t=this.createElementNSPlus("gml:boundedBy");return this.writeNode("gml:Box",e,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.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:!1,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:!1,fixPadding:function(){"number"==typeof this.padding&&(this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding))},panMapIfOutOfView:!1,keepInMap:!1,closeOnMove:!1,map:null,initialize:function(e,t,i,n,s,r){null==e&&(e=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")),this.id=e,this.lonlat=t,this.contentSize=null!=i?i:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT),null!=n&&(this.contentHTML=n),this.backgroundColor=OpenLayers.Popup.COLOR,this.opacity=OpenLayers.Popup.OPACITY,this.border=OpenLayers.Popup.BORDER,this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden"),this.div.className=this.displayClass;var a=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,"relative",null,"hidden");var e=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(e,null,this.contentSize.clone(),null,"relative"),this.contentDiv.className=this.contentDisplayClass,this.groupDiv.appendChild(this.contentDiv),this.div.appendChild(this.groupDiv),s&&this.addCloseBox(r),this.registerEvents()},destroy:function(){this.id=null,this.lonlat=null,this.size=null,this.contentHTML=null,this.backgroundColor=null,this.opacity=null,this.border=null,this.closeOnMove&&this.map&&this.map.events.unregister("movestart",this,this.hide),this.events.destroy(),this.events=null,this.closeDiv&&(OpenLayers.Event.stopObservingElement(this.closeDiv),this.groupDiv.removeChild(this.closeDiv)),this.closeDiv=null,this.div.removeChild(this.groupDiv),this.groupDiv=null,null!=this.map&&this.map.removePopup(this),this.map=null,this.div=null,this.autoSize=null,this.minSize=null,this.maxSize=null,this.padding=null,this.panMapIfOutOfView=null},draw:function(e){return null==e&&null!=this.lonlat&&null!=this.map&&(e=this.map.getLayerPxFromLonLat(this.lonlat)),this.closeOnMove&&this.map.events.register("movestart",this,this.hide),this.disableFirefoxOverflowHack||"firefox"!=OpenLayers.BROWSER_NAME||(this.map.events.register("movestart",this,function(){var e=document.defaultView.getComputedStyle(this.contentDiv,null).getPropertyValue("overflow");"hidden"!=e&&(this.contentDiv._oldOverflow=e,this.contentDiv.style.overflow="hidden")}),this.map.events.register("moveend",this,function(){var e=this.contentDiv._oldOverflow;e&&(this.contentDiv.style.overflow=e,this.contentDiv._oldOverflow=null)})),this.moveTo(e),this.autoSize||this.size||this.setSize(this.contentSize),this.setBackgroundColor(),this.setOpacity(),this.setBorder(),this.setContentHTML(),this.panMapIfOutOfView&&this.panIntoView(),this.div},updatePosition:function(){if(this.lonlat&&this.map){var e=this.map.getLayerPxFromLonLat(this.lonlat);e&&this.moveTo(e)}},moveTo:function(e){null!=e&&null!=this.div&&(this.div.style.left=e.x+"px",this.div.style.top=e.y+"px")},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){this.visible()?this.hide():this.show()},show:function(){this.div.style.display="",this.panMapIfOutOfView&&this.panIntoView()},hide:function(){this.div.style.display="none"},setSize:function(e){this.size=e.clone();var t=this.getContentDivPadding(),i=t.left+t.right,n=t.top+t.bottom;this.fixPadding(),i+=this.padding.left+this.padding.right,n+=this.padding.top+this.padding.bottom,this.closeDiv&&(i+=parseInt(this.closeDiv.style.width)+t.right),this.size.w+=i,this.size.h+=n,"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=e.w+"px",this.contentDiv.style.height=e.h+"px")},updateSize:function(){var e="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>",t=this.map?this.map.div:document.body,i=OpenLayers.Util.getRenderedDimensions(e,null,{displayClass:this.displayClass,containerElement:t}),n=this.getSafeContentSize(i),s=null;if(n.equals(i))s=i;else{var r={w:n.w<i.w?n.w:null,h:n.h<i.h?n.h:null};if(r.w&&r.h)s=n;else{var a=OpenLayers.Util.getRenderedDimensions(e,r,{displayClass:this.contentDisplayClass,containerElement:t});if("hidden"!=OpenLayers.Element.getStyle(this.contentDiv,"overflow")&&a.equals(n)){var o=OpenLayers.Util.getScrollbarWidth();r.w?a.h+=o:a.w+=o}s=this.getSafeContentSize(a)}}this.setSize(s)},setBackgroundColor:function(e){void 0!=e&&(this.backgroundColor=e),null!=this.div&&(this.div.style.backgroundColor=this.backgroundColor)},setOpacity:function(e){void 0!=e&&(this.opacity=e),null!=this.div&&(this.div.style.opacity=this.opacity,this.div.style.filter="alpha(opacity="+100*this.opacity+")")},setBorder:function(e){void 0!=e&&(this.border=e),null!=this.div&&(this.div.style.border=this.border)},setContentHTML:function(e){null!=e&&(this.contentHTML=e),null!=this.contentDiv&&null!=this.contentHTML&&this.contentHTML!=this.contentDiv.innerHTML&&(this.contentDiv.innerHTML=this.contentHTML,this.autoSize&&(this.registerImageListeners(),this.updateSize()))},registerImageListeners:function(){for(var e=function(){null!==this.popup.id&&(this.popup.updateSize(),this.popup.visible()&&this.popup.panMapIfOutOfView&&this.popup.panIntoView(),OpenLayers.Event.stopObserving(this.img,"load",this.img._onImgLoad))},t=this.contentDiv.getElementsByTagName("img"),i=0,n=t.length;i<n;i++){var s=t[i];if(0==s.width||0==s.height){var r={popup:this,img:s};s._onImgLoad=OpenLayers.Function.bind(e,r),OpenLayers.Event.observe(s,"load",s._onImgLoad)}}},getSafeContentSize:function(e){var t=e.clone(),i=this.getContentDivPadding(),n=i.left+i.right,s=i.top+i.bottom;if(this.fixPadding(),n+=this.padding.left+this.padding.right,s+=this.padding.top+this.padding.bottom,this.closeDiv&&(n+=parseInt(this.closeDiv.style.width)+i.right),this.minSize&&(t.w=Math.max(t.w,this.minSize.w-n),t.h=Math.max(t.h,this.minSize.h-s)),this.maxSize&&(t.w=Math.min(t.w,this.maxSize.w-n),t.h=Math.min(t.h,this.maxSize.h-s)),this.map&&this.map.size){var r=0,a=0;if(this.keepInMap&&!this.panMapIfOutOfView){var o=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":r=o.x,a=this.map.size.h-o.y;break;case"tl":r=this.map.size.w-o.x,a=this.map.size.h-o.y;break;case"bl":r=this.map.size.w-o.x,a=o.y;break;case"br":r=o.x,a=o.y;break;default:r=o.x,a=this.map.size.h-o.y}}var l=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-s-a,h=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-n-r;t.w=Math.min(t.w,h),t.h=Math.min(t.h,l)}return t},getContentDivPadding:function(){var e=this._contentDivPadding;return e||(null==this.div.parentNode&&(this.div.style.display="none",document.body.appendChild(this.div)),e=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top")),this._contentDivPadding=e,this.div.parentNode==document.body&&(document.body.removeChild(this.div),this.div.style.display="")),e},addCloseBox:function(e){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,{w:17,h:17}),this.closeDiv.className="olPopupCloseBox";var t=this.getContentDivPadding();this.closeDiv.style.right=t.right+"px",this.closeDiv.style.top=t.top+"px",this.groupDiv.appendChild(this.closeDiv);var i=e||function(e){this.hide(),OpenLayers.Event.stop(e)};OpenLayers.Event.observe(this.closeDiv,"touchend",OpenLayers.Function.bindAsEventListener(i,this)),OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(i,this))},panIntoView:function(){var e=this.map.getSize(),t=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top))),i=t.clone();t.x<this.map.paddingForPopups.left?i.x=this.map.paddingForPopups.left:t.x+this.size.w>e.w-this.map.paddingForPopups.right&&(i.x=e.w-this.map.paddingForPopups.right-this.size.w),t.y<this.map.paddingForPopups.top?i.y=this.map.paddingForPopups.top:t.y+this.size.h>e.h-this.map.paddingForPopups.bottom&&(i.y=e.h-this.map.paddingForPopups.bottom-this.size.h);var n=t.x-i.x,s=t.y-i.y;this.map.pan(n,s)},registerEvents:function(){function e(e){OpenLayers.Event.stop(e,!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:e,scope:this})},onmousedown:function(e){this.mousedown=!0,OpenLayers.Event.stop(e,!0)},onmousemove:function(e){this.mousedown&&OpenLayers.Event.stop(e,!0)},onmouseup:function(e){this.mousedown&&(this.mousedown=!1,OpenLayers.Event.stop(e,!0))},onclick:function(e){OpenLayers.Event.stop(e,!0)},onmouseout:function(e){this.mousedown=!1},ondblclick:function(e){OpenLayers.Event.stop(e,!0)},CLASS_NAME:"OpenLayers.Popup"}),OpenLayers.Popup.WIDTH=200,OpenLayers.Popup.HEIGHT=200,OpenLayers.Popup.COLOR="white",OpenLayers.Popup.OPACITY=1,OpenLayers.Popup.BORDER="0px",OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,draw:function(){if(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.topOutUnits||""==this.topInUnits?this.eTop.style.visibility="hidden":this.eTop.style.visibility="visible",this.eBottom=document.createElement("div"),this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),""==this.bottomOutUnits||""==this.bottomInUnits?this.eBottom.style.visibility="hidden":this.eBottom.style.visibility="visible"}return this.map.events.register("moveend",this,this.update),this.update(),this.div},getBarLen:function(e){var t=parseInt(Math.log(e)/Math.log(10)),i=Math.pow(10,t),n=parseInt(e/i);return(n>5?5:n>2?2:1)*i},update:function(){var e=this.map.getResolution();if(e){var t=this.map.getUnits(),i=OpenLayers.INCHES_PER_UNIT,n=this.maxWidth*e*i[t],s=1;!0===this.geodesic&&(n*=s=(this.map.getGeodesicPixelSize().w||1e-6)*this.maxWidth/(n/i.km));var r,a;n>1e5?(r=this.topOutUnits,a=this.bottomOutUnits):(r=this.topInUnits,a=this.bottomInUnits);var o=n/i[r],l=n/i[a],h=this.getBarLen(o),u=this.getBarLen(l),p=(o=h/i[t]*i[r])/e/s,c=(l=u/i[t]*i[a])/e/s;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(c)+"px",this.eBottom.innerHTML=u+" "+a),"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(p)+"px",this.eTop.innerHTML=h+" "+r)}},CLASS_NAME:"OpenLayers.Control.ScaleLine"}),OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(e,t,i,n){this.url=e,this.size=t||{w:20,h:20},this.offset=i||{x:-this.size.w/2,y:-this.size.h/2},this.calculateOffset=n;var s=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(s)},destroy:function(){this.erase(),OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild),this.imageDiv.innerHTML="",this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(e){null!=e&&(this.size=e),this.draw()},setUrl:function(e){null!=e&&(this.url=e),this.draw()},draw:function(e){return OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute"),this.moveTo(e),this.imageDiv},erase:function(){null!=this.imageDiv&&null!=this.imageDiv.parentNode&&OpenLayers.Element.remove(this.imageDiv)},setOpacity:function(e){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,e)},moveTo:function(e){null!=e&&(this.px=e),null!=this.imageDiv&&(null==this.px?this.display(!1):(this.calculateOffset&&(this.offset=this.calculateOffset(this.size)),OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,{x:this.px.x+this.offset.x,y:this.px.y+this.offset.y})))},display:function(e){this.imageDiv.style.display=e?"":"none"},isDrawn:function(){return this.imageDiv&&this.imageDiv.parentNode&&11!=this.imageDiv.parentNode.nodeType},CLASS_NAME:"OpenLayers.Icon"}),OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(e,t){this.lonlat=e;var i=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)},destroy:function(){this.erase(),this.map=null,this.events.destroy(),this.events=null,null!=this.icon&&(this.icon.destroy(),this.icon=null)},draw:function(e){return this.icon.draw(e)},erase:function(){null!=this.icon&&this.icon.erase()},moveTo:function(e){null!=e&&null!=this.icon&&this.icon.moveTo(e),this.lonlat=this.map.getLonLatFromLayerPx(e)},isDrawn:function(){return this.icon&&this.icon.isDrawn()},onScreen:function(){var e=!1;return this.map&&(e=this.map.getExtent().containsLonLat(this.lonlat)),e},inflate:function(e){this.icon&&this.icon.setSize({w:this.icon.size.w*e,h:this.icon.size.h*e})},setOpacity:function(e){this.icon.setOpacity(e)},setUrl:function(e){this.icon.setUrl(e)},display:function(e){this.icon.display(e)},CLASS_NAME:"OpenLayers.Marker"}),OpenLayers.Marker.defaultIcon=function(){return new OpenLayers.Icon(OpenLayers.Util.getImageLocation("marker.png"),{w:21,h:25},{x:-10.5,y:-25})},OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,format:"image/png",serverResolutions:null,initialize:function(e,t,i,n){this.layername=i,OpenLayers.Layer.Grid.prototype.initialize.apply(this,[e,t,{},n]),this.extension=this.format.split("/")[1].toLowerCase(),this.extension="jpg"==this.extension?"jpeg":this.extension},clone:function(e){return null==e&&(e=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){var t=this.getServerResolution(),i=this.maxExtent,n=this.tileSize,s=Math.round((e.left-i.left)/(t*n.w)),r=Math.round((e.bottom-i.bottom)/(t*n.h)),a=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,t):this.map.getZoom(),o=[this.layername,OpenLayers.Number.zeroPad(a,2),OpenLayers.Number.zeroPad(parseInt(s/1e6),3),OpenLayers.Number.zeroPad(parseInt(s/1e3)%1e3,3),OpenLayers.Number.zeroPad(parseInt(s)%1e3,3),OpenLayers.Number.zeroPad(parseInt(r/1e6),3),OpenLayers.Number.zeroPad(parseInt(r/1e3)%1e3,3),OpenLayers.Number.zeroPad(parseInt(r)%1e3,3)+"."+this.extension].join("/"),l=this.url;return OpenLayers.Util.isArray(l)&&(l=this.selectUrl(o,l)),(l="/"==l.charAt(l.length-1)?l:l+"/")+o},CLASS_NAME:"OpenLayers.Layer.TileCache"}),OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:!1,activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this}),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})),e},cacheFeatures:function(e){this.paging||(this.clearCache(),this.features=e.features,this.pageNext(e))},clearCache:function(){if(this.features)for(var e=0;e<this.features.length;++e)this.features[e].destroy();this.features=null,this.num=null},pageCount:function(){var e=this.features?this.features.length:0;return Math.ceil(e/this.length)},pageNum:function(){return this.num},pageLength:function(e){return e&&e>0&&(this.length=e),this.length},pageNext:function(e){var t=!1;if(this.features){null===this.num&&(this.num=-1);var i=(this.num+1)*this.length;t=this.page(i,e)}return t},pagePrevious:function(){var e=!1;if(this.features){null===this.num&&(this.num=this.pageCount());var t=(this.num-1)*this.length;e=this.page(t)}return e},page:function(e,t){var i=!1;if(this.features&&e>=0&&e<this.features.length){var n=Math.floor(e/this.length);if(n!=this.num){this.paging=!0;var s=this.features.slice(e,e+this.length);this.layer.removeFeatures(this.layer.features),this.num=n,t&&t.features?t.features=s:this.layer.addFeatures(s),this.paging=!1,i=!0}}return i},CLASS_NAME:"OpenLayers.Strategy.Paging"}),OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(e,t){},onDrag:function(e,t){},onComplete:function(e,t){},onEnter:function(e){},onLeave:function(e){},documentDrag:!1,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(e,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.layer=e,this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{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(e){this.handlers.feature.touch&&!this.over&&this.overFeature(e)&&(this.handlers.drag.dragstart(this.handlers.feature.evt),this.handlers.drag.stopDown=!1)},clickoutFeature:function(e){this.handlers.feature.touch&&this.over&&(this.outFeature(e),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(e){var t=!1;return this.handlers.drag.dragging?this.feature.id==e.id?this.over=!0:this.over=!1:(this.feature=e,this.handlers.drag.activate(),t=!0,this.over=!0,OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onEnter(e)),t},downFeature:function(e){this.lastPixel=e,this.onStart(this.feature,e)},moveFeature:function(e){var t=this.map.getResolution();this.feature.geometry.move(t*(e.x-this.lastPixel.x),t*(this.lastPixel.y-e.y)),this.layer.drawFeature(this.feature),this.lastPixel=e,this.onDrag(this.feature,e)},upFeature:function(e){this.over||this.handlers.drag.deactivate()},doneDragging:function(e){this.onComplete(this.feature,e)},outFeature:function(e){this.handlers.drag.dragging?this.feature.id==e.id&&(this.over=!1):(this.over=!1,this.handlers.drag.deactivate(),OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onLeave(e),this.feature=null)},cancel:function(){this.handlers.drag.deactivate(),this.over=!1},setMap:function(e){this.handlers.drag.setMap(e),this.handlers.feature.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"}),OpenLayers.Control.TransformFeature=OpenLayers.Class(OpenLayers.Control,{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,irregular:!1,initialize:function(e,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.layer=e,this.rotationHandleSymbolizer||(this.rotationHandleSymbolizer={stroke:!1,pointRadius:10,fillOpacity:0,cursor:"pointer"}),this.createBox(),this.createControl()},activate:function(){var e=!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),e=!0),e},deactivate:function(){var e=!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(),e=!0),e},setMap:function(e){this.dragControl.setMap(e),OpenLayers.Control.prototype.setMap.apply(this,arguments)},setFeature:function(e,t){t=OpenLayers.Util.applyDefaults(t,{rotation:0,scale:1,ratio:1});var i=this.rotation,n=this.center;if(OpenLayers.Util.extend(this,t),!1!==this.events.triggerEvent("beforesetfeature",{feature:e})){this.feature=e,this.activate(),this._setfeature=!0;var s=this.feature.geometry.getBounds();this.box.move(s.getCenterLonLat()),this.box.geometry.rotate(-i,n),this._angle=0;var r;if(this.rotation){var a=e.geometry.clone();a.rotate(-this.rotation,this.center);var o=new OpenLayers.Feature.Vector(a.getBounds().toGeometry());o.geometry.rotate(this.rotation,this.center),this.box.geometry.rotate(this.rotation,this.center),this.box.move(o.geometry.getBounds().getCenterLonLat()),r=o.geometry.components[0].components[0].getBounds().getCenterLonLat()}else r=new OpenLayers.LonLat(s.left,s.bottom);this.handles[0].move(r),delete this._setfeature,this.events.triggerEvent("setfeature",{feature:e})}},unsetFeature:function(){this.active?this.deactivate():(this.feature=null,this.rotation=0,this.scale=1,this.ratio=1)},createBox:function(){var e=this;this.center=new OpenLayers.Geometry.Point(0,0),this.box=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(-1,-1),new OpenLayers.Geometry.Point(0,-1),new OpenLayers.Geometry.Point(1,-1),new OpenLayers.Geometry.Point(1,0),new OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(0,1),new OpenLayers.Geometry.Point(-1,1),new OpenLayers.Geometry.Point(-1,0),new OpenLayers.Geometry.Point(-1,-1)]),null,"string"==typeof this.renderIntent?null:this.renderIntent),this.box.geometry.move=function(t,i){e._moving=!0,OpenLayers.Geometry.LineString.prototype.move.apply(this,arguments),e.center.move(t,i),delete e._moving};for(var t,i,n,s=function(e,t){OpenLayers.Geometry.Point.prototype.move.apply(this,arguments),this._rotationHandle&&this._rotationHandle.geometry.move(e,t),this._handle.geometry.move(e,t)},r=function(e,t,i){OpenLayers.Geometry.Point.prototype.resize.apply(this,arguments),this._rotationHandle&&this._rotationHandle.geometry.resize(e,t,i),this._handle.geometry.resize(e,t,i)},a=function(e,t){OpenLayers.Geometry.Point.prototype.rotate.apply(this,arguments),this._rotationHandle&&this._rotationHandle.geometry.rotate(e,t),this._handle.geometry.rotate(e,t)},o=function(t,i){var n=this.x,s=this.y;if(OpenLayers.Geometry.Point.prototype.move.call(this,t,i),!e._moving){var r=e.dragControl.handlers.drag.evt,a=!(!e._setfeature&&e.preserveAspectRatio||r&&r.shiftKey),o=new OpenLayers.Geometry.Point(n,s),l=e.center;this.rotate(-e.rotation,l),o.rotate(-e.rotation,l);var h=this.x-l.x,u=this.y-l.y,p=h-(this.x-o.x),c=u-(this.y-o.y);e.irregular&&!e._setfeature&&(h-=(this.x-o.x)/2,u-=(this.y-o.y)/2),this.x=n,this.y=s;var d,f=1;if(a)d=Math.abs(c)<1e-5?1:u/c,f=(Math.abs(p)<1e-5?1:h/p)/d;else{var m=Math.sqrt(p*p+c*c);d=Math.sqrt(h*h+u*u)/m}if(e._moving=!0,e.box.geometry.rotate(-e.rotation,l),delete e._moving,e.box.geometry.resize(d,l,f),e.box.geometry.rotate(e.rotation,l),e.transformFeature({scale:d,ratio:f}),e.irregular&&!e._setfeature){var y=l.clone();y.x+=Math.abs(n-l.x)<1e-5?0:this.x-n,y.y+=Math.abs(s-l.y)<1e-5?0:this.y-s,e.box.geometry.move(this.x-n,this.y-s),e.transformFeature({center:y})}}},l=function(t,i){var n=this.x,s=this.y;if(OpenLayers.Geometry.Point.prototype.move.call(this,t,i),!e._moving){var r=e.dragControl.handlers.drag.evt,a=r&&r.shiftKey?45:1,o=e.center,l=this.x-o.x,h=this.y-o.y,u=l-t,p=h-i;this.x=n,this.y=s;var c=Math.atan2(p,u),d=Math.atan2(h,l)-c;d*=180/Math.PI,e._angle=(e._angle+d)%360;var f=e.rotation%a;(Math.abs(e._angle)>=a||0!==f)&&(d=Math.round(e._angle/a)*a-f,e._angle=0,e.box.geometry.rotate(d,o),e.transformFeature({rotation:d}))}},h=new Array(8),u=new Array(4),p=["sw","s","se","e","ne","n","nw","w"],c=0;c<8;++c)t=this.box.geometry.components[c],i=new OpenLayers.Feature.Vector(t.clone(),{role:p[c]+"-resize"},"string"==typeof this.renderIntent?null:this.renderIntent),c%2==0&&((n=new OpenLayers.Feature.Vector(t.clone(),{role:p[c]+"-rotate"},"string"==typeof this.rotationHandleSymbolizer?null:this.rotationHandleSymbolizer)).geometry.move=l,t._rotationHandle=n,u[c/2]=n),t.move=s,t.resize=r,t.rotate=a,i.geometry.move=o,t._handle=i,h[c]=i;this.rotationHandles=u,this.handles=h},createControl:function(){var e=this;this.dragControl=new OpenLayers.Control.DragFeature(this.layer,{documentDrag:!0,moveFeature:function(t){this.feature===e.feature&&(this.feature=e.box),OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,arguments)},onDrag:function(t,i){t===e.box&&e.transformFeature({center:e.center})},onStart:function(t,i){var n=!e.geometryTypes||-1!==OpenLayers.Util.indexOf(e.geometryTypes,t.geometry.CLASS_NAME),s=OpenLayers.Util.indexOf(e.handles,t);s+=OpenLayers.Util.indexOf(e.rotationHandles,t),t!==e.feature&&t!==e.box&&-2==s&&n&&e.setFeature(t)},onComplete:function(t,i){e.events.triggerEvent("transformcomplete",{feature:e.feature})}})},drawHandles:function(){for(var e=this.layer,t=0;t<8;++t)this.rotate&&t%2==0&&e.drawFeature(this.rotationHandles[t/2],this.rotationHandleSymbolizer),e.drawFeature(this.handles[t],this.renderIntent)},transformFeature:function(e){if(!this._setfeature){this.scale*=e.scale||1,this.ratio*=e.ratio||1;var t=this.rotation;if(this.rotation=(this.rotation+(e.rotation||0))%360,!1!==this.events.triggerEvent("beforetransform",e)){var i=this.feature,n=i.geometry,s=this.center;n.rotate(-t,s),e.scale||e.ratio?n.resize(e.scale,s,e.ratio):e.center&&i.move(e.center.getBounds().getCenterLonLat()),n.rotate(this.rotation,s),this.layer.drawFeature(i),i.toState(OpenLayers.State.UPDATE),this.events.triggerEvent("transform",e)}}this.layer.drawFeature(this.box,this.renderIntent),this.drawHandles()},destroy:function(){for(var e,t=0;t<8;++t)(e=this.box.geometry.components[t])._handle.destroy(),e._handle=null,e._rotationHandle&&e._rotationHandle.destroy(),e._rotationHandle=null;this.center=null,this.feature=null,this.handles=null,this.rotationHandleSymbolizer=null,this.rotationHandles=null,this.box.destroy(),this.box=null,this.layer=null,this.dragControl.destroy(),this.dragControl=null,OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.TransformFeature"}),OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxOffsets:null,initialize:function(e,t,i){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(e){OpenLayers.Handler.prototype.setMap.apply(this,arguments),this.dragHandler&&this.dragHandler.setMap(e)},startBox:function(e){this.callback("start",[]),this.zoomBox=OpenLayers.Util.createDiv("zoomBox",{x:-9999,y:-9999}),this.zoomBox.className=this.boxDivClassName,this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1,this.map.viewPortDiv.appendChild(this.zoomBox),OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(e){var t=this.dragHandler.start.x,i=this.dragHandler.start.y,n=Math.abs(t-e.x),s=Math.abs(i-e.y),r=this.getBoxOffsets();this.zoomBox.style.width=n+r.width+1+"px",this.zoomBox.style.height=s+r.height+1+"px",this.zoomBox.style.left=(e.x<t?t-n-r.left:t-r.left)+"px",this.zoomBox.style.top=(e.y<i?i-s-r.top:i-r.top)+"px"},endBox:function(e){var t;if(Math.abs(this.dragHandler.start.x-e.x)>5||Math.abs(this.dragHandler.start.y-e.y)>5){var i=this.dragHandler.start,n=Math.min(i.y,e.y),s=Math.max(i.y,e.y),r=Math.min(i.x,e.x),a=Math.max(i.x,e.x);t=new OpenLayers.Bounds(r,s,a,n)}else t=this.dragHandler.start.clone();this.removeBox(),this.callback("done",[t])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox),this.zoomBox=null,this.boxOffsets=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){return!!OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.dragHandler.activate(),!0)},deactivate:function(){return!!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.dragHandler.deactivate()&&this.zoomBox&&this.removeBox(),!0)},getBoxOffsets:function(){if(!this.boxOffsets){var e=document.createElement("div");e.style.position="absolute",e.style.border="1px solid black",e.style.width="3px",document.body.appendChild(e);var t=3==e.clientWidth;document.body.removeChild(e);var i=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width")),n=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width")),s=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width")),r=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"));this.boxOffsets={left:i,right:n,top:s,bottom:r,width:!1===t?i+n:0,height:!1===t?s+r:0}}return this.boxOffsets},CLASS_NAME:"OpenLayers.Handler.Box"}),OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:!1,keyMask:null,alwaysZoom:!1,zoomOnClick:!0,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(e){if(e instanceof OpenLayers.Bounds){var t,i=e.getCenterPixel();if(this.out){var n=e.right-e.left,s=e.bottom-e.top,r=Math.min(this.map.size.h/s,this.map.size.w/n),a=this.map.getExtent(),o=this.map.getLonLatFromPixel(i),l=o.lon-a.getWidth()/2*r,h=o.lon+a.getWidth()/2*r,u=o.lat-a.getHeight()/2*r,p=o.lat+a.getHeight()/2*r;t=new OpenLayers.Bounds(l,u,h,p)}else{var c=this.map.getLonLatFromPixel({x:e.left,y:e.bottom}),d=this.map.getLonLatFromPixel({x:e.right,y:e.top});t=new OpenLayers.Bounds(c.lon,c.lat,d.lon,d.lat)}var f=this.map.getZoom(),m=this.map.getSize(),y={x:m.w/2,y:m.h/2},g=this.map.getZoomForExtent(t),v=this.map.getResolution(),L=this.map.getResolutionForZoom(g);if(v==L)this.map.setCenter(this.map.getLonLatFromPixel(i));else{var O={x:(v*i.x-L*y.x)/(v-L),y:(v*i.y-L*y.y)/(v-L)};this.map.zoomTo(g,O)}f==this.map.getZoom()&&1==this.alwaysZoom&&this.map.zoomTo(f+(this.out?-1:1))}else this.zoomOnClick&&(this.out?this.map.zoomTo(this.map.getZoom()-1,e):this.map.zoomTo(this.map.getZoom()+1,e))},CLASS_NAME:"OpenLayers.Control.ZoomBox"}),OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:!1,interval:0,documentDrag:!1,kinetic:null,enableKinetic:!0,kineticInterval:10,draw:function(){if(this.enableKinetic&&OpenLayers.Kinetic){var e={interval:this.kineticInterval};"object"==typeof this.enableKinetic&&(e=OpenLayers.Util.extend(e,this.enableKinetic)),this.kinetic=new OpenLayers.Kinetic(e)}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(e){this.kinetic&&this.kinetic.update(e),this.panned=!0,this.map.pan(this.handler.last.x-e.x,this.handler.last.y-e.y,{dragging:!0,animate:!1})},panMapDone:function(e){if(this.panned){var t=null;if(this.kinetic&&(t=this.kinetic.end(e)),this.map.pan(this.handler.last.x-e.x,this.handler.last.y-e.y,{dragging:!!t,animate:!1}),t){var i=this;this.kinetic.move(t,function(e,t,n){i.map.pan(e,t,{dragging:!n,animate:!1})})}this.panned=!1}},CLASS_NAME:"OpenLayers.Control.DragPan"}),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(e){this.handlers={},OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate(),this.dragPan&&this.dragPan.destroy(),this.dragPan=null,this.zoomBox&&this.zoomBox.destroy(),this.zoomBox=null,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 e={click:this.defaultClick,dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick},t={double:!0,stopDouble:!0};this.handlers.click=new OpenLayers.Handler.Click(this,e,t),this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions)),this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask}),this.dragPan.draw(),this.zoomBox.draw();var i=this.map.fractionalZoom?{}:{cumulative:!1,interval:50,maxDelta:6};this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},OpenLayers.Util.extend(i,this.mouseWheelOptions)),OpenLayers.Control.PinchZoom&&(this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions)))},defaultClick:function(e){e.lastTouches&&2==e.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(e){this.map.zoomTo(this.map.zoom+1,e.xy)},defaultDblRightClick:function(e){this.map.zoomTo(this.map.zoom-1,e.xy)},wheelChange:function(e,t){this.map.fractionalZoom||(t=Math.round(t));var i=this.map.getZoom(),n=i+t;n=Math.max(n,0),(n=Math.min(n,this.map.getNumZoomLevels()))!==i&&this.map.zoomTo(n,e.xy)},wheelUp:function(e,t){this.wheelChange(e,t||1)},wheelDown:function(e,t){this.wheelChange(e,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,multi:!1,featureAdded:function(){},initialize:function(e,t,i){OpenLayers.Control.prototype.initialize.apply(this,[i]),this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(e,t){this.layer.events.triggerEvent("sketchmodified",{vertex:e,feature:t})},create:function(e,t){this.layer.events.triggerEvent("sketchstarted",{vertex:e,feature:t})}},this.callbacks),this.layer=e,this.handlerOptions=this.handlerOptions||{},this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{renderers:e.renderers,rendererOptions:e.rendererOptions}),"multi"in this.handlerOptions||(this.handlerOptions.multi=this.multi);var n=this.layer.styleMap&&this.layer.styleMap.styles.temporary;n&&(this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({default:n})})),this.handler=new t(this,this.callbacks,this.handlerOptions)},drawFeature:function(e){var t=new OpenLayers.Feature.Vector(e);!1!==this.layer.events.triggerEvent("sketchcomplete",{feature:t})&&(t.state=OpenLayers.State.INSERT,this.layer.addFeatures([t]),this.featureAdded(t),this.events.triggerEvent("featureadded",{feature:t}))},insertXY:function(e,t){this.handler&&this.handler.line&&this.handler.insertXY(e,t)},insertDeltaXY:function(e,t){this.handler&&this.handler.line&&this.handler.insertDeltaXY(e,t)},insertDirectionLength:function(e,t){this.handler&&this.handler.line&&this.handler.insertDirectionLength(e,t)},insertDeflectionLength:function(e,t){this.handler&&this.handler.line&&this.handler.insertDeflectionLength(e,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,createFeature:function(e){var t=this.layer.getLonLatFromViewPortPx(e),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(e){if(!this.drawingHole&&this.holeModifier&&this.evt&&this.evt[this.holeModifier])for(var t,i,n=this.point.geometry,s=this.control.layer.features,r=s.length-1;r>=0;--r)if(((t=s[r].geometry)instanceof OpenLayers.Geometry.Polygon||t instanceof OpenLayers.Geometry.MultiPolygon)&&t.intersects(n)){i=s[r],this.control.layer.removeFeatures([i],{silent:!0}),this.control.layer.events.registerPriority("sketchcomplete",this,this.finalizeInteriorRing),this.control.layer.events.registerPriority("sketchmodified",this,this.enforceTopology),i.geometry.addComponent(this.line.geometry),this.polygon=i,this.drawingHole=!0;break}OpenLayers.Handler.Path.prototype.addPoint.apply(this,arguments)},getCurrentPointIndex:function(){return this.line.geometry.components.length-2},enforceTopology:function(e){var t=e.vertex,i=this.line.geometry.components;if(!this.polygon.geometry.intersects(t)){var n=i[i.length-3];t.x=n.x,t.y=n.y}},finishGeometry:function(){var e=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[e]),this.removePoint(),this.finalize()},finalizeInteriorRing:function(){var e=this.line.geometry,t=0!==e.getArea();if(t){for(var i=this.polygon.geometry.components,n=i.length-2;n>=0;--n)if(e.intersects(i[n])){t=!1;break}if(t){e:for(n=i.length-2;n>0;--n)for(var s=i[n].components,r=0,a=s.length;r<a;++r)if(e.containsPoint(s[r])){t=!1;break e}}}return t?this.polygon.state!==OpenLayers.State.INSERT&&(this.polygon.state=OpenLayers.State.UPDATE):this.polygon.geometry.removeComponent(e),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(e){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,e||this.control.layer.events.triggerEvent("sketchcomplete",{feature:this.polygon})},destroyFeature:function(e){OpenLayers.Handler.Path.prototype.destroyFeature.call(this,e),this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style),this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var e=this.polygon&&this.polygon.geometry;return e&&this.multi&&(e=new OpenLayers.Geometry.MultiPolygon([e])),e},CLASS_NAME:"OpenLayers.Handler.Polygon"}),OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{citeCompliant:!1,initialize:function(e,t){OpenLayers.Control.Panel.prototype.initialize.apply(this,[t]),this.addControls([new OpenLayers.Control.Navigation]);var i=[new OpenLayers.Control.DrawFeature(e,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint",handlerOptions:{citeCompliant:this.citeCompliant}}),new OpenLayers.Control.DrawFeature(e,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath",handlerOptions:{citeCompliant:this.citeCompliant}}),new OpenLayers.Control.DrawFeature(e,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon",handlerOptions:{citeCompliant:this.citeCompliant}})];this.addControls(i)},draw:function(){var e=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return null===this.defaultControl&&(this.defaultControl=this.controls[0]),e},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 e=OpenLayers.Strategy.prototype.activate.call(this);return e&&(this.layer.events.on({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this}),this.update()),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&this.layer.events.un({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this}),e},update:function(e){var t=this.getMapBounds();null!==t&&(e&&e.force||this.layer.visibility&&this.layer.calculateInRange()&&this.invalidBounds(t))&&(this.calculateBounds(t),this.resolution=this.layer.map.getResolution(),this.triggerRead(e))},getMapBounds:function(){if(null===this.layer.map)return null;var e=this.layer.map.getExtent();return e&&!this.layer.projection.equals(this.layer.map.getProjectionObject())&&(e=e.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)),e},invalidBounds:function(e){e||(e=this.getMapBounds());var t=!this.bounds||!this.bounds.containsBounds(e);if(!t&&this.resFactor){var i=this.resolution/this.layer.map.getResolution();t=i>=this.resFactor||i<=1/this.resFactor}return t},calculateBounds:function(e){e||(e=this.getMapBounds());var t=e.getCenterLonLat(),i=e.getWidth()*this.ratio,n=e.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(t.lon-i/2,t.lat-n/2,t.lon+i/2,t.lat+n/2)},triggerRead:function(e){!this.response||e&&!0===e.noAbort||(this.layer.protocol.abort(this.response),this.layer.events.triggerEvent("loadend"));var t={filter:this.createFilter()};this.layer.events.triggerEvent("loadstart",t),this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:t.filter,callback:this.merge,scope:this},e))},createFilter:function(){var e=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});return this.layer.filter&&(e=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,e]})),e},merge:function(e){if(this.layer.destroyFeatures(),e.success()){var t=e.features;if(t&&t.length>0){var i=this.layer.projection,n=this.layer.map.getProjectionObject();if(!n.equals(i))for(var s,r=0,a=t.length;r<a;++r)(s=t[r].geometry)&&s.transform(i,n);this.layer.addFeatures(t)}}else this.bounds=null;this.response=null,this.layer.events.triggerEvent("loadend",{response:e})},CLASS_NAME:"OpenLayers.Strategy.BBOX"}),OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:!0,lzd:null,zoomLevels:null,initialize:function(e,t,i,n,s,r){this.lzd=i,this.zoomLevels=n;var a=[];a.push(e,t,s,r),OpenLayers.Layer.Grid.prototype.initialize.apply(this,a),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getZoom:function(){var e=this.map.getZoom();this.map.getMaxExtent();return e-=Math.log(this.maxResolution/(this.lzd/512))/Math.log(2)},getURL:function(e){e=this.adjustBounds(e);var t=this.getZoom(),i=this.map.getMaxExtent(),n=this.lzd/Math.pow(2,this.getZoom()),s=Math.floor((e.left-i.left)/n),r=Math.floor((e.bottom-i.bottom)/n);return this.map.getResolution()<=this.lzd/512&&this.getZoom()<=this.zoomLevels?this.getFullRequestString({L:t,X:s,Y:r}):OpenLayers.Util.getImageLocation("blank.gif")},CLASS_NAME:"OpenLayers.Layer.WorldWind"}),OpenLayers.Protocol.CSW=function(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Protocol.CSW.DEFAULTS);var t=OpenLayers.Protocol.CSW["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported CSW version: "+e.version;return new t(e)},OpenLayers.Protocol.CSW.DEFAULTS={version:"2.0.2"},OpenLayers.Format.WMTSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",yx:{"urn:ogc:def:crs:EPSG::4326":!0},createLayer:function(e,t){if(!("layer"in t))throw new Error("Missing property 'layer' in configuration.");for(var i,n=e.contents,s=(n.layers,0),r=n.layers.length;s<r;++s)if(n.layers[s].identifier===t.layer){i=n.layers[s];break}if(!i)throw new Error("Layer not found");var a=t.format;!a&&i.formats&&i.formats.length&&(a=i.formats[0]);var o;if(t.matrixSet?o=n.tileMatrixSets[t.matrixSet]:i.tileMatrixSetLinks.length>=1&&(o=n.tileMatrixSets[i.tileMatrixSetLinks[0].tileMatrixSet]),!o)throw new Error("matrixSet not found");for(var l,s=0,r=i.styles.length;s<r&&!(l=i.styles[s]).isDefault;++s);var h=t.requestEncoding;if(!h&&(h="KVP",e.operationsMetadata.GetTile.dcp.http)){var u=e.operationsMetadata.GetTile.dcp.http;if(u.get[0].constraints){var p=u.get[0].constraints.GetEncoding.allowedValues;p.KVP||!p.REST&&!p.RESTful||(h="REST")}}var c=[],d=t.params||{};delete t.params;for(var f=0,m=i.dimensions.length;f<m;f++){var y=i.dimensions[f];c.push(y.identifier),d.hasOwnProperty(y.identifier)||(d[y.identifier]=y.default)}var g=t.projection||o.supportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"),v=t.units||("EPSG:4326"===g?"degrees":"m"),L=[];for(var O in o.matrixIds)o.matrixIds.hasOwnProperty(O)&&L.push(28e-5*o.matrixIds[O].scaleDenominator/OpenLayers.METERS_PER_INCH/OpenLayers.INCHES_PER_UNIT[v]);var b;if("REST"===h&&i.resourceUrls){b=[];i.resourceUrls;for(var w,S=0,C=i.resourceUrls.length;S<C;++S)(w=i.resourceUrls[S]).format===a&&"tile"===w.resourceType&&b.push(w.template)}else{var x=e.operationsMetadata.GetTile.dcp.http.get;b=[];for(var _,s=0,r=x.length;s<r;s++)(!(_=x[s].constraints)||_&&_.GetEncoding.allowedValues[h])&&b.push(x[s].url)}return new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults(t,{url:b,requestEncoding:h,name:i.title,style:l.identifier,format:a,matrixIds:o.matrixIds,matrixSet:o.identifier,projection:g,units:v,resolutions:!1===t.isBaseLayer?void 0:L,serverResolutions:L,tileFullExtent:o.bounds,dimensions:c,params:d}))},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities"}),OpenLayers.Layer.Google.v3={DEFAULTS:{sphericalMercator:!0,projection:"EPSG:900913"},animationEnabled:!0,loadMapObject:function(){this.type||(this.type=google.maps.MapTypeId.ROADMAP);var e,t=OpenLayers.Layer.Google.cache[this.map.id];if(t)e=t.mapObject,++t.count;else{var i=this.map.getCenter(),n=document.createElement("div");n.className="olForeignContainer",n.style.width="100%",n.style.height="100%",e=new google.maps.Map(n,{center:i?new google.maps.LatLng(i.lat,i.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});var s=document.createElement("div");s.style.width="100%",s.style.height="100%",e.controls[google.maps.ControlPosition.TOP_LEFT].push(s),t={googleControl:s,mapObject:e,count:1},OpenLayers.Layer.Google.cache[this.map.id]=t}this.mapObject=e,this.setGMapVisibility(this.visibility)},onMapResize:function(){this.visibility&&google.maps.event.trigger(this.mapObject,"resize")},setGMapVisibility:function(e){var t=OpenLayers.Layer.Google.cache[this.map.id],i=this.map;if(t){for(var n,s=this.type,r=i.layers,a=r.length-1;a>=0;--a)if((n=r[a])instanceof OpenLayers.Layer.Google&&!0===n.visibility&&!0===n.inRange){s=n.type,e=!0;break}var o=this.mapObject.getDiv();if(!0===e){if(o.parentNode!==i.div)if(t.rendered)i.div.appendChild(o),t.googleControl.appendChild(i.viewPortDiv),google.maps.event.trigger(this.mapObject,"resize");else{var l=this;google.maps.event.addListenerOnce(this.mapObject,"tilesloaded",function(){t.rendered=!0,l.setGMapVisibility(l.getVisibility()),l.moveTo(l.map.getCenter())})}this.mapObject.setMapTypeId(s)}else t.googleControl.hasChildNodes()&&(i.div.appendChild(i.viewPortDiv),i.div.removeChild(o))}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(e){var t=null;if(null!=e){var i=this.sphericalMercator?this.inverseMercator(e.bottom,e.left):new OpenLayers.LonLat(e.bottom,e.left),n=this.sphericalMercator?this.inverseMercator(e.top,e.right):new OpenLayers.LonLat(e.top,e.right);t=new google.maps.LatLngBounds(new google.maps.LatLng(i.lat,i.lon),new google.maps.LatLng(n.lat,n.lon))}return t},getMapObjectLonLatFromMapObjectPixel:function(e){var t=this.map.getSize(),i=this.getLongitudeFromMapObjectLonLat(this.mapObject.center),n=this.getLatitudeFromMapObjectLonLat(this.mapObject.center),s=this.map.getResolution(),r=e.x-t.w/2,a=e.y-t.h/2,o=new OpenLayers.LonLat(i+r*s,n-a*s);return this.wrapDateLine&&(o=o.wrapDateLine(this.maxExtent)),this.getMapObjectLonLatFromLonLat(o.lon,o.lat)},getMapObjectPixelFromMapObjectLonLat:function(e){var t=this.getLongitudeFromMapObjectLonLat(e),i=this.getLatitudeFromMapObjectLonLat(e),n=this.map.getResolution(),s=this.map.getExtent();return this.getMapObjectPixelFromXY(1/n*(t-s.left),1/n*(s.top-i))},setMapObjectCenter:function(e,t){if(!1===this.animationEnabled&&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:e,zoom:t})},getMapObjectZoomFromMapObjectBounds:function(e){return this.mapObject.getBoundsZoomLevel(e)},getMapObjectLonLatFromLonLat:function(e,t){var i;if(this.sphericalMercator){var n=this.inverseMercator(e,t);i=new google.maps.LatLng(n.lat,n.lon)}else i=new google.maps.LatLng(t,e);return i},getMapObjectPixelFromXY:function(e,t){return new google.maps.Point(e,t)}},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(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},readers:{wps:{ProcessDescriptions:function(e,t){t.processDescriptions={},this.readChildNodes(e,t.processDescriptions)},ProcessDescription:function(e,t){var i={processVersion:this.getAttributeNS(e,this.namespaces.wps,"processVersion"),statusSupported:"true"===e.getAttribute("statusSupported"),storeSupported:"true"===e.getAttribute("storeSupported")};this.readChildNodes(e,i),t[i.identifier]=i},DataInputs:function(e,t){t.dataInputs=[],this.readChildNodes(e,t.dataInputs)},ProcessOutputs:function(e,t){t.processOutputs=[],this.readChildNodes(e,t.processOutputs)},Output:function(e,t){var i={};this.readChildNodes(e,i),t.push(i)},ComplexOutput:function(e,t){t.complexOutput={},this.readChildNodes(e,t.complexOutput)},LiteralOutput:function(e,t){t.literalOutput={},this.readChildNodes(e,t.literalOutput)},Input:function(e,t){var i={maxOccurs:parseInt(e.getAttribute("maxOccurs")),minOccurs:parseInt(e.getAttribute("minOccurs"))};this.readChildNodes(e,i),t.push(i)},BoundingBoxData:function(e,t){t.boundingBoxData={},this.readChildNodes(e,t.boundingBoxData)},CRS:function(e,t){t.CRSs||(t.CRSs={}),t.CRSs[this.getChildValue(e)]=!0},LiteralData:function(e,t){t.literalData={},this.readChildNodes(e,t.literalData)},ComplexData:function(e,t){t.complexData={},this.readChildNodes(e,t.complexData)},Default:function(e,t){t.default={},this.readChildNodes(e,t.default)},Supported:function(e,t){t.supported={},this.readChildNodes(e,t.supported)},Format:function(e,t){var i={};this.readChildNodes(e,i),t.formats||(t.formats={}),t.formats[i.mimeType]=!0},MimeType:function(e,t){t.mimeType=this.getChildValue(e)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSDescribeProcess"}),OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(e){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/},OpenLayers.Format.prototype.initialize.apply(this,[e])},read:function(e){var t,i,n;e=e.replace(/[\n\r]/g," ");var s=this.regExes.typeStr.exec(e);if(s&&(i=s[1].toLowerCase(),n=s[2],this.parse[i]&&(t=this.parse[i].apply(this,[n])),this.internalProjection&&this.externalProjection))if(t&&"OpenLayers.Feature.Vector"==t.CLASS_NAME)t.geometry.transform(this.externalProjection,this.internalProjection);else if(t&&"geometrycollection"!=i&&"object"==typeof t)for(var r=0,a=t.length;r<a;r++)t[r].geometry.transform(this.externalProjection,this.internalProjection);return t},write:function(e){var t,i,n;e.constructor==Array?(t=e,n=!0):(t=[e],n=!1);var s=[];n&&s.push("GEOMETRYCOLLECTION(");for(var r=0,a=t.length;r<a;++r)n&&r>0&&s.push(","),i=t[r].geometry,s.push(this.extractGeometry(i));return n&&s.push(")"),s.join("")},extractGeometry:function(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?(this.internalProjection&&this.externalProjection&&(e=e.clone()).transform(this.internalProjection,this.externalProjection),("collection"==t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")"):null},extract:{point:function(e){return e.x+" "+e.y},multipoint:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push("("+this.extract.point.apply(this,[e.components[i]])+")");return t.join(",")},linestring:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push(this.extract.point.apply(this,[e.components[i]]));return t.join(",")},multilinestring:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push("("+this.extract.linestring.apply(this,[e.components[i]])+")");return t.join(",")},polygon:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push("("+this.extract.linestring.apply(this,[e.components[i]])+")");return t.join(",")},multipolygon:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push("("+this.extract.polygon.apply(this,[e.components[i]])+")");return t.join(",")},collection:function(e){for(var t=[],i=0,n=e.components.length;i<n;++i)t.push(this.extractGeometry.apply(this,[e.components[i]]));return t.join(",")}},parse:{point:function(e){var t=OpenLayers.String.trim(e).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t[0],t[1]))},multipoint:function(e){for(var t,i=OpenLayers.String.trim(e).split(","),n=[],s=0,r=i.length;s<r;++s)t=i[s].replace(this.regExes.trimParens,"$1"),n.push(this.parse.point.apply(this,[t]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(n))},linestring:function(e){for(var t=OpenLayers.String.trim(e).split(","),i=[],n=0,s=t.length;n<s;++n)i.push(this.parse.point.apply(this,[t[n]]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(i))},multilinestring:function(e){for(var t,i=OpenLayers.String.trim(e).split(this.regExes.parenComma),n=[],s=0,r=i.length;s<r;++s)t=i[s].replace(this.regExes.trimParens,"$1"),n.push(this.parse.linestring.apply(this,[t]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(n))},polygon:function(e){for(var t,i,n,s=OpenLayers.String.trim(e).split(this.regExes.parenComma),r=[],a=0,o=s.length;a<o;++a)t=s[a].replace(this.regExes.trimParens,"$1"),i=this.parse.linestring.apply(this,[t]).geometry,n=new OpenLayers.Geometry.LinearRing(i.components),r.push(n);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(r))},multipolygon:function(e){for(var t,i=OpenLayers.String.trim(e).split(this.regExes.doubleParenComma),n=[],s=0,r=i.length;s<r;++s)t=i[s].replace(this.regExes.trimParens,"$1"),n.push(this.parse.polygon.apply(this,[t]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(n))},geometrycollection:function(e){e=e.replace(/,\s*([A-Za-z])/g,"|$1");for(var t=OpenLayers.String.trim(e).split("|"),i=[],n=0,s=t.length;n<s;++n)i.push(OpenLayers.Format.WKT.prototype.read.apply(this,[t[n]]));return i}},CLASS_NAME:"OpenLayers.Format.WKT"}),OpenLayers.WPSProcess=OpenLayers.Class({client:null,server:null,identifier:null,description:null,localWPS:"http://geoserver/wps",formats:null,chained:0,executeCallbacks:null,initialize:function(e){OpenLayers.Util.extend(this,e),this.executeCallbacks=[],this.formats={"application/wkt":new OpenLayers.Format.WKT,"application/json":new OpenLayers.Format.GeoJSON}},describe:function(e){if(e=e||{},this.description){if(e.callback){var t=this.description;window.setTimeout(function(){e.callback.call(e.scope,t)},0)}}else this.client.describeProcess(this.server,this.identifier,function(t){this.description||this.parseDescription(t),e.callback&&e.callback.call(e.scope,this.description)},this)},configure:function(e){return this.describe({callback:function(){var t,i,n,s=this.description,r=e.inputs;for(i=0,n=s.dataInputs.length;i<n;++i)t=s.dataInputs[i],this.setInputData(t,r[t.identifier]);e.callback&&e.callback.call(e.scope)},scope:this}),this},execute:function(e){this.configure({inputs:e.inputs,callback:function(){var t=this,i=this.getOutputIndex(t.description.processOutputs,e.output);t.setResponseForm({outputIndex:i}),function n(){OpenLayers.Util.removeItem(t.executeCallbacks,n),0===t.chained?OpenLayers.Request.POST({url:t.client.servers[t.server].url,data:(new OpenLayers.Format.WPSExecute).write(t.description),success:function(n){var s=t.description.processOutputs[i],r=t.findMimeType(s.complexOutput.supported.formats),a=t.formats[r].read(n.responseText);if(a instanceof OpenLayers.Feature.Vector&&(a=[a]),e.success){var o={};o[e.output||"result"]=a,e.success.call(e.scope,o)}},scope:t}):t.executeCallbacks.push(n)}()},scope:this})},output:function(e){return new OpenLayers.WPSProcess.ChainLink({process:this,output:e})},parseDescription:function(e){var t=this.client.servers[this.server];this.description=(new OpenLayers.Format.WPSDescribeProcess).read(t.processDescription[this.identifier]).processDescriptions[this.identifier]},setInputData:function(e,t){if(delete e.data,delete e.reference,t instanceof OpenLayers.WPSProcess.ChainLink)++this.chained,e.reference={method:"POST",href:t.process.server===this.server?this.localWPS:this.client.servers[t.process.server].url},t.process.describe({callback:function(){--this.chained,this.chainProcess(e,t)},scope:this});else{e.data={};var i=e.complexData;if(i){var n=this.findMimeType(i.supported.formats);e.data.complexData={mimeType:n,value:this.formats[n].write(this.toFeatures(t))}}else e.data.literalData={value:t}}},setResponseForm:function(e){e=e||{};var t=this.description.processOutputs[e.outputIndex||0];this.description.responseForm={rawDataOutput:{identifier:t.identifier,mimeType:this.findMimeType(t.complexOutput.supported.formats,e.supportedFormats)}}},getOutputIndex:function(e,t){var i;if(t){for(var n=e.length-1;n>=0;--n)if(e[n].identifier===t){i=n;break}}else i=0;return i},chainProcess:function(e,t){var i=this.getOutputIndex(t.process.description.processOutputs,t.output);e.reference.mimeType=this.findMimeType(e.complexData.supported.formats,t.process.description.processOutputs[i].complexOutput.supported.formats);var n={};for(n[e.reference.mimeType]=!0,t.process.setResponseForm({outputIndex:i,supportedFormats:n}),e.reference.body=t.process.description;this.executeCallbacks.length>0;)this.executeCallbacks[0]()},toFeatures:function(e){var t=OpenLayers.Util.isArray(e);t||(e=[e]);for(var i,n=new Array(e.length),s=0,r=e.length;s<r;++s)i=e[s],n[s]=i instanceof OpenLayers.Feature.Vector?i:new OpenLayers.Feature.Vector(i);return t?n:n[0]},findMimeType:function(e,t){t=t||this.formats;for(var i in e)if(i in t)return i},CLASS_NAME:"OpenLayers.WPSProcess"}),OpenLayers.WPSProcess.ChainLink=OpenLayers.Class({process:null,output:null,initialize:function(e){OpenLayers.Util.extend(this,e)},CLASS_NAME:"OpenLayers.WPSProcess.ChainLink"}),OpenLayers.WPSClient=OpenLayers.Class({servers:null,version:"1.0.0",lazy:!1,events:null,initialize:function(e){OpenLayers.Util.extend(this,e),this.events=new OpenLayers.Events(this),this.servers={};for(var t in e.servers)this.servers[t]="string"==typeof e.servers[t]?{url:e.servers[t],version:this.version,processDescription:{}}:e.servers[t]},execute:function(e){this.getProcess(e.server,e.process).execute({inputs:e.inputs,success:e.success,scope:e.scope})},getProcess:function(e,t){var i=new OpenLayers.WPSProcess({client:this,server:e,identifier:t});return this.lazy||i.describe(),i},describeProcess:function(e,t,i,n){var s=this.servers[e];s.processDescription[t]?window.setTimeout(function(){i.call(n,s.processDescription[t])},0):t in s.processDescription?this.events.register("describeprocess",this,function e(s){s.identifier===t&&(this.events.unregister("describeprocess",this,e),i.call(n,s.raw))}):(s.processDescription[t]=null,OpenLayers.Request.GET({url:s.url,params:{SERVICE:"WPS",VERSION:s.version,REQUEST:"DescribeProcess",IDENTIFIER:t},success:function(e){s.processDescription[t]=e.responseText,this.events.triggerEvent("describeprocess",{identifier:t,raw:e.responseText})},scope:this}))},destroy:function(){this.events.destroy(),this.events=null,this.servers=null},CLASS_NAME:"OpenLayers.WPSClient"}),OpenLayers.Format.CSWGetRecords.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{csw:"http://www.opengis.net/cat/csw/2.0.2",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",gmd:"http://www.isotc211.org/2005/gmd",geonet:"http://www.fao.org/geonetwork",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",requestId:null,resultType:null,outputFormat:null,outputSchema:null,startPosition:null,maxRecords:null,DistributedSearch:null,ResponseHandler:null,Query:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},readers:{csw:{GetRecordsResponse:function(e,t){t.records=[],this.readChildNodes(e,t);var i=this.getAttributeNS(e,"","version");""!=i&&(t.version=i)},RequestId:function(e,t){t.RequestId=this.getChildValue(e)},SearchStatus:function(e,t){t.SearchStatus={};var i=this.getAttributeNS(e,"","timestamp");""!=i&&(t.SearchStatus.timestamp=i)},SearchResults:function(e,t){this.readChildNodes(e,t);for(var i=e.attributes,n={},s=0,r=i.length;s<r;++s)"numberOfRecordsMatched"==i[s].name||"numberOfRecordsReturned"==i[s].name||"nextRecord"==i[s].name?n[i[s].name]=parseInt(i[s].nodeValue):n[i[s].name]=i[s].nodeValue;t.SearchResults=n},SummaryRecord:function(e,t){var i={type:"SummaryRecord"};this.readChildNodes(e,i),t.records.push(i)},BriefRecord:function(e,t){var i={type:"BriefRecord"};this.readChildNodes(e,i),t.records.push(i)},DCMIRecord:function(e,t){var i={type:"DCMIRecord"};this.readChildNodes(e,i),t.records.push(i)},Record:function(e,t){var i={type:"Record"};this.readChildNodes(e,i),t.records.push(i)},"*":function(e,t){t[e.localName||e.nodeName.split(":").pop()]=this.getChildValue(e)}},geonet:{info:function(e,t){var i={};this.readChildNodes(e,i),t.gninfo=i}},dc:{"*":function(e,t){var i=e.localName||e.nodeName.split(":").pop();OpenLayers.Util.isArray(t[i])||(t[i]=[]);for(var n={},s=e.attributes,r=0,a=s.length;r<a;++r)n[s[r].name]=s[r].nodeValue;n.value=this.getChildValue(e),""!=n.value&&t[i].push(n)}},dct:{"*":function(e,t){var i=e.localName||e.nodeName.split(":").pop();OpenLayers.Util.isArray(t[i])||(t[i]=[]),t[i].push(this.getChildValue(e))}},ows:OpenLayers.Util.applyDefaults({BoundingBox:function(e,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(e){var t=this.writeNode("csw:GetRecords",e);return t.setAttribute("xmlns:gmd",this.namespaces.gmd),OpenLayers.Format.XML.prototype.write.apply(this,[t])},writers:{csw:{GetRecords:function(e){e||(e={});var t=this.createElementNSPlus("csw:GetRecords",{attributes:{service:"CSW",version:this.version,requestId:e.requestId||this.requestId,resultType:e.resultType||this.resultType,outputFormat:e.outputFormat||this.outputFormat,outputSchema:e.outputSchema||this.outputSchema,startPosition:e.startPosition||this.startPosition,maxRecords:e.maxRecords||this.maxRecords}});(e.DistributedSearch||this.DistributedSearch)&&this.writeNode("csw:DistributedSearch",e.DistributedSearch||this.DistributedSearch,t);var i=e.ResponseHandler||this.ResponseHandler;if(OpenLayers.Util.isArray(i)&&i.length>0)for(var n=0,s=i.length;n<s;n++)this.writeNode("csw:ResponseHandler",i[n],t);return this.writeNode("Query",e.Query||this.Query,t),t},DistributedSearch:function(e){return this.createElementNSPlus("csw:DistributedSearch",{attributes:{hopCount:e.hopCount}})},ResponseHandler:function(e){return this.createElementNSPlus("csw:ResponseHandler",{value:e.value})},Query:function(e){e||(e={});var t=this.createElementNSPlus("csw:Query",{attributes:{typeNames:e.typeNames||"csw:Record"}}),i=e.ElementName;if(OpenLayers.Util.isArray(i)&&i.length>0)for(var n=0,s=i.length;n<s;n++)this.writeNode("csw:ElementName",i[n],t);else this.writeNode("csw:ElementSetName",e.ElementSetName||{value:"summary"},t);return e.Constraint&&this.writeNode("csw:Constraint",e.Constraint,t),e.SortBy&&this.writeNode("ogc:SortBy",e.SortBy,t),t},ElementName:function(e){return this.createElementNSPlus("csw:ElementName",{value:e.value})},ElementSetName:function(e){return this.createElementNSPlus("csw:ElementSetName",{attributes:{typeNames:e.typeNames},value:e.value})},Constraint:function(e){var t=this.createElementNSPlus("csw:Constraint",{attributes:{version:e.version}});if(e.Filter){var i=new OpenLayers.Format.Filter({version:e.version});t.appendChild(i.write(e.Filter))}else if(e.CqlText){var n=this.createElementNSPlus("CqlText",{value:e.CqlText.value});t.appendChild(n)}return 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(e,t,i){this.bounds=e,this.div=OpenLayers.Util.createDiv(),this.div.style.overflow="hidden",this.events=new OpenLayers.Events(this,this.div),this.setBorder(t,i)},destroy:function(){this.bounds=null,this.div=null,OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(e,t){e||(e="red"),t||(t=2),this.div.style.border=t+"px solid "+e},draw:function(e,t){return OpenLayers.Util.modifyDOMElement(this.div,null,e,t),this.div},onScreen:function(){var e=!1;return this.map&&(e=this.map.getExtent().containsBounds(this.bounds,!0,!0)),e},display:function(e){this.div.style.display=e?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"}),OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:!0,initialize:function(e){!1!==(e=e||{}).extractStyles&&(e.defaultStyle={externalGraphic:OpenLayers.Util.getImageLocation("marker.png"),graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5}),OpenLayers.Format.prototype.initialize.apply(this,[e])},read:function(e){for(var t,i=e.split("\n"),n=[],s=0;s<i.length-1;s++){var r=i[s].replace(/^\s*/,"").replace(/\s*$/,"");if("#"!=r.charAt(0))if(t){for(var a=r.split("\t"),o=new OpenLayers.Geometry.Point(0,0),l={},h=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null,u=!1,p=0;p<a.length;p++)if(a[p])if("point"==t[p]){var c=a[p].split(",");o.y=parseFloat(c[0]),o.x=parseFloat(c[1]),u=!0}else if("lat"==t[p])o.y=parseFloat(a[p]),u=!0;else if("lon"==t[p])o.x=parseFloat(a[p]),u=!0;else if("title"==t[p])l.title=a[p];else if("image"==t[p]||"icon"==t[p]&&h)h.externalGraphic=a[p];else if("iconSize"==t[p]&&h){var d=a[p].split(",");h.graphicWidth=parseFloat(d[0]),h.graphicHeight=parseFloat(d[1])}else if("iconOffset"==t[p]&&h){var f=a[p].split(",");h.graphicXOffset=parseFloat(f[0]),h.graphicYOffset=parseFloat(f[1])}else"description"==t[p]?l.description=a[p]:"overflow"==t[p]?l.overflow=a[p]:l[t[p]]=a[p];if(u){this.internalProjection&&this.externalProjection&&o.transform(this.externalProjection,this.internalProjection);var m=new OpenLayers.Feature.Vector(o,l,h);n.push(m)}}else t=r.split("\t")}return n},CLASS_NAME:"OpenLayers.Format.Text"}),OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(e,t){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments),this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments),this.clearFeatures(),this.features=null},loadText:function(){if(!this.loaded&&null!=this.location){var e=function(e){this.events.triggerEvent("loadend")};this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:e,scope:this}),this.loaded=!0}},moveTo:function(e,t,i){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments),this.visibility&&!this.loaded&&this.loadText()},parseData:function(e){var t=e.responseText,i={};OpenLayers.Util.extend(i,this.formatOptions),this.map&&!this.projection.equals(this.map.getProjectionObject())&&(i.externalProjection=this.projection,i.internalProjection=this.map.getProjectionObject());for(var n=new OpenLayers.Format.Text(i).read(t),s=0,r=n.length;s<r;s++){var a,o,l,h={},u=n[s];a=new OpenLayers.LonLat(u.geometry.x,u.geometry.y),u.style.graphicWidth&&u.style.graphicHeight&&(o=new OpenLayers.Size(u.style.graphicWidth,u.style.graphicHeight)),void 0!==u.style.graphicXOffset&&void 0!==u.style.graphicYOffset&&(l=new OpenLayers.Pixel(u.style.graphicXOffset,u.style.graphicYOffset)),null!=u.style.externalGraphic?h.icon=new OpenLayers.Icon(u.style.externalGraphic,o,l):(h.icon=OpenLayers.Marker.defaultIcon(),null!=o&&h.icon.setSize(o)),null!=u.attributes.title&&null!=u.attributes.description&&(h.popupContentHTML="<h2>"+u.attributes.title+"</h2><p>"+u.attributes.description+"</p>"),h.overflow=u.attributes.overflow||"auto";var p=new OpenLayers.Feature(this,a,h);this.features.push(p);var c=p.createMarker();null!=u.attributes.title&&null!=u.attributes.description&&c.events.register("click",p,this.markerClick),this.addMarker(c)}this.events.triggerEvent("loadend")},markerClick:function(e){var t=this==this.layer.selectedFeature;this.layer.selectedFeature=t?null:this;for(var i=0,n=this.layer.map.popups.length;i<n;i++)this.layer.map.removePopup(this.layer.map.popups[i]);t||this.layer.map.addPopup(this.createPopup()),OpenLayers.Event.stop(e)},clearFeatures:function(){if(null!=this.features)for(;this.features.length>0;){var e=this.features[0];OpenLayers.Util.removeItem(this.features,e),e.destroy()}},CLASS_NAME:"OpenLayers.Layer.Text"}),OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",layerOptions:null,persist:!1,irregular:!1,citeCompliant:!1,angle:null,fixedRadius:!1,feature:null,layer:null,origin:null,initialize:function(e,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,[e,t,i]),this.options=i||{}},setOptions:function(e){OpenLayers.Util.extend(this.options,e),OpenLayers.Util.extend(this,e)},activate:function(){var e=!1;if(OpenLayers.Handler.Drag.prototype.activate.apply(this,arguments)){var t=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,t),this.map.addLayer(this.layer),e=!0}return e},deactivate:function(){var e=!1;return OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)&&(this.dragging&&this.cancel(),null!=this.layer.map&&(this.layer.destroy(!1),this.feature&&this.feature.destroy()),this.layer=null,this.feature=null,e=!0),e},down:function(e){this.fixedRadius=!!this.radius;var t=this.layer.getLonLatFromViewPortPx(e.xy);this.origin=new OpenLayers.Geometry.Point(t.lon,t.lat),this.fixedRadius&&!this.irregular||(this.radius=this.map.getResolution()),this.persist&&this.clear(),this.feature=new OpenLayers.Feature.Vector,this.createGeometry(),this.callback("create",[this.origin,this.feature]),this.layer.addFeatures([this.feature],{silent:!0}),this.layer.drawFeature(this.feature,this.style)},move:function(e){var t=this.layer.getLonLatFromViewPortPx(e.xy),i=new OpenLayers.Geometry.Point(t.lon,t.lat);if(this.irregular){var n=Math.sqrt(2)*Math.abs(i.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,n)}else this.fixedRadius?this.origin=i:(this.calculateAngle(i,e),this.radius=Math.max(this.map.getResolution()/2,i.distanceTo(this.origin)));if(this.modifyGeometry(),this.irregular){var s,r=i.x-this.origin.x,a=i.y-this.origin.y;s=0==a?r/(this.radius*Math.sqrt(2)):r/a,this.feature.geometry.resize(1,this.origin,s),this.feature.geometry.move(r/2,a/2)}this.layer.drawFeature(this.feature,this.style)},up:function(e){this.finalize(),this.start==this.last&&this.callback("done",[e.xy])},out:function(e){this.finalize()},createGeometry:function(){this.angle=Math.PI*(1/this.sides-.5),this.snapAngle&&(this.angle+=this.snapAngle*(Math.PI/180)),this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var e,t,i=this.feature.geometry.components[0];i.components.length!=this.sides+1&&(this.createGeometry(),i=this.feature.geometry.components[0]);for(var n=0;n<this.sides;++n)t=i.components[n],e=this.angle+2*n*Math.PI/this.sides,t.x=this.origin.x+this.radius*Math.cos(e),t.y=this.origin.y+this.radius*Math.sin(e),t.clearBounds()},calculateAngle:function(e,t){var i=Math.atan2(e.y-this.origin.y,e.x-this.origin.x);if(this.snapAngle&&this.snapToggle&&!t[this.snapToggle]){var n=Math.PI/180*this.snapAngle;this.angle=Math.round(i/n)*n}else this.angle=i},cancel:function(){this.callback("cancel",null),this.finalize()},finalize:function(){this.origin=null,this.radius=this.options.radius},clear:function(){this.layer&&(this.layer.renderer.clear(),this.layer.destroyFeatures())},callback:function(e,t){this.callbacks[e]&&this.callbacks[e].apply(this.control,[this.feature.geometry.clone()]),this.persist||"done"!=e&&"cancel"!=e||this.clear()},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"}),OpenLayers.Control.SLDSelect=OpenLayers.Class(OpenLayers.Control,{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,sketchStyle:null,wfsCache:{},layerCache:{},initialize:function(e,t){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 e(this,this.callbacks,this.handlerOptions)},destroy:function(){for(var e in this.layerCache)delete this.layerCache[e];for(var e in this.wfsCache)delete this.wfsCache[e];OpenLayers.Control.prototype.destroy.apply(this,arguments)},coupleLayerVisiblity:function(e){this.setVisibility(e.object.getVisibility())},createSelectionLayer:function(e){var t;return this.layerCache[e.id]?t=this.layerCache[e.id]:(t=new OpenLayers.Layer.WMS(e.name,e.url,e.params,OpenLayers.Util.applyDefaults(this.layerOptions,e.getOptions())),this.layerCache[e.id]=t,!1===this.layerOptions.displayInLayerSwitcher&&e.events.on({visibilitychanged:this.coupleLayerVisiblity,scope:t}),this.map.addLayer(t)),t},createSLD:function(e,t,i){for(var n={version:"1.0.0",namedLayers:{}},s=[e.params.LAYERS].join(",").split(","),r=0,a=s.length;r<a;r++){var o=s[r];n.namedLayers[o]={name:o,userStyles:[]};var l=this.selectionSymbolizer,h=i[r];h.type.indexOf("Polygon")>=0?l={Polygon:this.selectionSymbolizer.Polygon}:h.type.indexOf("LineString")>=0?l={Line:this.selectionSymbolizer.Line}:h.type.indexOf("Point")>=0&&(l={Point:this.selectionSymbolizer.Point});var u=t[r];n.namedLayers[o].userStyles.push({name:"default",rules:[new OpenLayers.Rule({symbolizer:l,filter:u,maxScaleDenominator:e.options.minScale})]})}return new OpenLayers.Format.SLD({srsName:this.map.getProjection()}).write(n)},parseDescribeLayer:function(e){var t=new OpenLayers.Format.WMSDescribeLayer,i=e.responseXML;i&&i.documentElement||(i=e.responseText);for(var n=t.read(i),s=[],r=null,a=0,o=n.length;a<o;a++)"WFS"==n[a].owsType&&(s.push(n[a].typeName),r=n[a].owsURL);var l={url:r,params:{SERVICE:"WFS",TYPENAME:s.toString(),REQUEST:"DescribeFeatureType",VERSION:"1.0.0"},callback:function(e){var t=new OpenLayers.Format.WFSDescribeFeatureType,i=e.responseXML;i&&i.documentElement||(i=e.responseText);var n=t.read(i);this.control.wfsCache[this.layer.id]=n,this.control._queue&&this.control.applySelection()},scope:this};OpenLayers.Request.GET(l)},getGeometryAttributes:function(e){for(var t=[],i=this.wfsCache[e.id],n=0,s=i.featureTypes.length;n<s;n++)for(var r=i.featureTypes[n].properties,a=0,o=r.length;a<o;a++){var l=r[a],h=l.type;(h.indexOf("LineString")>=0||h.indexOf("GeometryAssociationType")>=0||h.indexOf("GeometryPropertyType")>=0||h.indexOf("Point")>=0||h.indexOf("Polygon")>=0)&&t.push(l)}return t},activate:function(){var e=OpenLayers.Control.prototype.activate.call(this);if(e)for(var t=0,i=this.layers.length;t<i;t++){var n=this.layers[t];if(n&&!this.wfsCache[n.id]){var s={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(s)}}return e},deactivate:function(){var e=OpenLayers.Control.prototype.deactivate.call(this);if(e)for(var t=0,i=this.layers.length;t<i;t++){var n=this.layers[t];if(n&&!0===this.clearOnDeactivate){var s=this.layerCache,r=s[n.id];r&&(n.events.un({visibilitychanged:this.coupleLayerVisiblity,scope:r}),r.destroy(),delete s[n.id])}}return e},setLayers:function(e){this.active?(this.deactivate(),this.layers=e,this.activate()):this.layers=e},createFilter:function(e,t){var i=null;return this.handler instanceof OpenLayers.Handler.RegularPolygon?i=!0===this.handler.irregular?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:e.name,value:t.getBounds()}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:e.name,value:t}):this.handler instanceof OpenLayers.Handler.Polygon?i=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:e.name,value:t}):this.handler instanceof OpenLayers.Handler.Path?i=e.type.indexOf("Point")>=0?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:e.name,distance:.01*this.map.getExtent().getWidth(),distanceUnits:this.map.getUnits(),value:t}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:e.name,value:t}):this.handler instanceof OpenLayers.Handler.Click&&(i=e.type.indexOf("Polygon")>=0?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:e.name,value:t}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:e.name,distance:.01*this.map.getExtent().getWidth(),distanceUnits:this.map.getUnits(),value:t})),i},select:function(e){this._queue=function(){for(var t=0,i=this.layers.length;t<i;t++){for(var n=this.layers[t],s=this.getGeometryAttributes(n),r=[],a=0,o=s.length;a<o;a++){var l=s[a];if(null!==l){if(!(e instanceof OpenLayers.Geometry)){var h=this.map.getLonLatFromPixel(e.xy);e=new OpenLayers.Geometry.Point(h.lon,h.lat)}var u=this.createFilter(l,e);null!==u&&r.push(u)}}var p=this.createSelectionLayer(n);this.events.triggerEvent("selected",{layer:n,filters:r});var c=this.createSLD(n,r,s);p.mergeNewParams({SLD_BODY:c}),delete this._queue}},this.applySelection()},applySelection:function(){for(var e=!0,t=0,i=this.layers.length;t<i;t++)if(!this.wfsCache[this.layers[t].id]){e=!1;break}e&&this._queue.call(this)},CLASS_NAME:"OpenLayers.Control.SLDSelect"}),OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,geodesic:!1,initialize:function(e,t){OpenLayers.Control.prototype.initialize.apply(this,[t]),this.element=OpenLayers.Util.getElement(e)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this,arguments),this.element||(this.element=document.createElement("div"),this.div.appendChild(this.element)),this.map.events.register("moveend",this,this.updateScale),this.updateScale(),this.div},updateScale:function(){var e;if(!0===this.geodesic){if(!this.map.getUnits())return;var t=OpenLayers.INCHES_PER_UNIT;e=(this.map.getGeodesicPixelSize().w||1e-6)*t.km*OpenLayers.DOTS_PER_INCH}else e=this.map.getScale();e&&(e=e>=9500&&e<=95e4?Math.round(e/1e3)+"K":e>=95e4?Math.round(e/1e6)+"M":Math.round(e),this.element.innerHTML=OpenLayers.i18n("Scale = 1 : ${scaleDenom}",{scaleDenom:e}))},CLASS_NAME:"OpenLayers.Control.Scale"}),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(e,t,i,n){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments),null!=n&&null!=n.isBaseLayer||(this.isBaseLayer="true"!=this.transparent&&1!=this.transparent),n&&null!=n.useOverlay&&(this.useOverlay=n.useOverlay),this.singleTile?this.useOverlay?(OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS),this.useAsyncOverlay||(this.params.version="1.0.0")):OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS):(this.useHttpTile?OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS):OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS),this.setTileSize(this.defaultSize))},clone:function(e){return null==e&&(e=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){var t,i=e.getCenterLonLat(),n=this.map.getSize();if(this.singleTile){var s={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:n.h*this.ratio,setdisplaywidth:n.w*this.ratio,setviewcenterx:i.lon,setviewcentery:i.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var r={};(r=OpenLayers.Util.extend(r,s)).operation="GETVISIBLEMAPEXTENT",r.version="1.0.0",r.session=this.params.session,r.mapName=this.params.mapName,r.format="text/xml",t=this.getFullRequestString(r),OpenLayers.Request.GET({url:t,async:!1})}t=this.getFullRequestString(s)}else{var a=this.map.getResolution(),o=Math.floor((e.left-this.maxExtent.left)/a);o=Math.round(o/this.tileSize.w);var l=Math.floor((this.maxExtent.top-e.top)/a);l=Math.round(l/this.tileSize.h),t=this.useHttpTile?this.getImageFilePath({tilecol:o,tilerow:l,scaleindex:this.resolutions.length-this.map.zoom-1}):this.getFullRequestString({tilecol:o,tilerow:l,scaleindex:this.resolutions.length-this.map.zoom-1})}return t},getFullRequestString:function(e,t){var i=null==t?this.url:t;"object"==typeof i&&(i=i[Math.floor(Math.random()*i.length)]);var n=i,s=OpenLayers.Util.extend({},this.params);s=OpenLayers.Util.extend(s,e);var r=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(i));for(var a in s)a.toUpperCase()in r&&delete s[a];var o=OpenLayers.Util.getParameterString(s);if(""!=(o=o.replace(/,/g,"+"))){var l=i.charAt(i.length-1);"&"==l||"?"==l?n+=o:-1==i.indexOf("?")?n+="?"+o:n+="&"+o}return n},getImageFilePath:function(e,t){var i=null==t?this.url:t;"object"==typeof i&&(i=i[Math.floor(Math.random()*i.length)]);var n=i,s="",r="";e.tilerow<0&&(s="-"),0==e.tilerow?s+="0":s+=Math.floor(Math.abs(e.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder,e.tilecol<0&&(r="-"),0==e.tilecol?r+="0":r+=Math.floor(Math.abs(e.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder;var a="/S"+Math.floor(e.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+s+"/C"+r+"/"+e.tilerow%this.params.tileRowsPerFolder+"_"+e.tilecol%this.params.tileColumnsPerFolder+"."+this.params.format;return this.params.querystring&&(a+="?"+this.params.querystring),n+=a},CLASS_NAME:"OpenLayers.Layer.MapGuide"}),OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{callbacks:null,displaySystem:"metric",geodesic:!1,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:!1,immediate:!1,initialize:function(e,t){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 e(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(e){this.immediate=e,this.immediate?this.callbacks.modify=this.measureImmediate:delete this.callbacks.modify},updateHandler:function(e,t){var i=this.active;i&&this.deactivate(),this.handler=new e(this,this.callbacks,t),i&&this.activate()},measureComplete:function(e){this.cancelDelay(),this.measure(e,"measure")},measurePartial:function(e,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(e,t,i){i&&!this.handler.freehandMode(this.handler.evt)&&(this.cancelDelay(),this.measure(t.geometry,"measurepartial"))},cancelDelay:function(){null!==this.delayedTrigger&&(window.clearTimeout(this.delayedTrigger),this.delayedTrigger=null)},measure:function(e,t){var i,n;e.CLASS_NAME.indexOf("LineString")>-1?(i=this.getBestLength(e),n=1):(i=this.getBestArea(e),n=2),this.events.triggerEvent(t,{measure:i[0],units:i[1],order:n,geometry:e})},getBestArea:function(e){for(var t,i,n=this.displaySystemUnits[this.displaySystem],s=0,r=n.length;s<r&&(t=n[s],!((i=this.getArea(e,t))>1));++s);return[i,t]},getArea:function(e,t){var i,n;this.geodesic?(i=e.getGeodesicArea(this.map.getProjectionObject()),n="m"):(i=e.getArea(),n=this.map.getUnits());var s=OpenLayers.INCHES_PER_UNIT[t];if(s){var r=OpenLayers.INCHES_PER_UNIT[n];i*=Math.pow(r/s,2)}return i},getBestLength:function(e){for(var t,i,n=this.displaySystemUnits[this.displaySystem],s=0,r=n.length;s<r&&(t=n[s],!((i=this.getLength(e,t))>1));++s);return[i,t]},getLength:function(e,t){var i,n;this.geodesic?(i=e.getGeodesicLength(this.map.getProjectionObject()),n="m"):(i=e.getLength(),n=this.map.getUnits());var s=OpenLayers.INCHES_PER_UNIT[t];return s&&(i*=OpenLayers.INCHES_PER_UNIT[n]/s),i},CLASS_NAME:"OpenLayers.Control.Measure"}),OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(e){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[e])},read_wmc_SRS:function(e,t){var i=this.getChildValue(t);"object"!=typeof e.projections&&(e.projections={});for(var n=i.split(/ +/),s=0,r=n.length;s<r;s++)e.projections[n[s]]=!0},write_wmc_Layer:function(e){var t=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[e]);if(e.srs){var i=[];for(var n in e.srs)i.push(n);t.appendChild(this.createElementDefaultNS("SRS",i.join(" ")))}t.appendChild(this.write_wmc_FormatList(e)),t.appendChild(this.write_wmc_StyleList(e)),e.dimensions&&t.appendChild(this.write_wmc_DimensionList(e)),t.appendChild(this.write_wmc_LayerExtension(e))},CLASS_NAME:"OpenLayers.Format.WMC.v1_0_0"}),OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:!0,anchor:null,initialize:function(e,t,i,n,s,r,a){var o=[e,t,i,n,r,a];OpenLayers.Popup.prototype.initialize.apply(this,o),this.anchor=null!=s?s:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null,this.relativePosition=null,OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition(),OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(e){var t=this.relativePosition;this.relativePosition=this.calculateRelativePosition(e),OpenLayers.Popup.prototype.moveTo.call(this,this.calculateNewPx(e)),this.relativePosition!=t&&this.updateRelativePosition()},setSize:function(e){if(OpenLayers.Popup.prototype.setSize.apply(this,arguments),this.lonlat&&this.map){var t=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(t)}},calculateRelativePosition:function(e){var t=this.map.getLonLatFromLayerPx(e),i=this.map.getExtent().determineQuadrant(t);return OpenLayers.Bounds.oppositeQuadrant(i)},updateRelativePosition:function(){},calculateNewPx:function(e){var t=e.offset(this.anchor.offset),i=this.size||this.contentSize,n="t"==this.relativePosition.charAt(0);t.y+=n?-i.h:this.anchor.size.h;var s="l"==this.relativePosition.charAt(1);return t.x+=s?-i.w:this.anchor.size.w,t},CLASS_NAME:"OpenLayers.Popup.Anchored"}),OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:!1,positionBlocks:null,blocks:null,fixedRelativePosition:!1,initialize:function(e,t,i,n,s,r,a){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments),this.fixedRelativePosition&&(this.updateRelativePosition(),this.calculateRelativePosition=function(e){return this.relativePosition}),this.contentDiv.style.position="absolute",this.contentDiv.style.zIndex=1,r&&(this.closeDiv.style.zIndex=1),this.groupDiv.style.position="absolute",this.groupDiv.style.top="0px",this.groupDiv.style.left="0px",this.groupDiv.style.height="100%",this.groupDiv.style.width="100%"},destroy:function(){this.imageSrc=null,this.imageSize=null,this.isAlphaImage=null,this.fixedRelativePosition=!1,this.positionBlocks=null;for(var e=0;e<this.blocks.length;e++){var t=this.blocks[e];t.image&&t.div.removeChild(t.image),t.image=null,t.div&&this.groupDiv.removeChild(t.div),t.div=null}this.blocks=null,OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)},setBackgroundColor:function(e){},setBorder:function(){},setOpacity:function(e){},setSize:function(e){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments),this.updateBlocks()},updateRelativePosition:function(){if(this.padding=this.positionBlocks[this.relativePosition].padding,this.closeDiv){var e=this.getContentDivPadding();this.closeDiv.style.right=e.right+this.padding.right+"px",this.closeDiv.style.top=e.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(e){var t=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);return t=t.offset(this.positionBlocks[this.relativePosition].offset)},createBlocks:function(){this.blocks=[];var e=null;for(var t in this.positionBlocks){e=t;break}for(var i=this.positionBlocks[e],n=0;n<i.blocks.length;n++){var s={};this.blocks.push(s);var r=this.id+"_FrameDecorationDiv_"+n;s.div=OpenLayers.Util.createDiv(r,null,null,null,"absolute",null,"hidden",null);var a=this.id+"_FrameDecorationImg_"+n,o=this.isAlphaImage?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;s.image=o(a,null,this.imageSize,this.imageSrc,"absolute",null,null,null),s.div.appendChild(s.image),this.groupDiv.appendChild(s.div)}},updateBlocks:function(){if(this.blocks||this.createBlocks(),this.size&&this.relativePosition){for(var e=this.positionBlocks[this.relativePosition],t=0;t<e.blocks.length;t++){var i=e.blocks[t],n=this.blocks[t],s=i.anchor.left,r=i.anchor.bottom,a=i.anchor.right,o=i.anchor.top,l=isNaN(i.size.w)?this.size.w-(a+s):i.size.w,h=isNaN(i.size.h)?this.size.h-(r+o):i.size.h;n.div.style.width=(l<0?0:l)+"px",n.div.style.height=(h<0?0:h)+"px",n.div.style.left=null!=s?s+"px":"",n.div.style.bottom=null!=r?r+"px":"",n.div.style.right=null!=a?a+"px":"",n.div.style.top=null!=o?o+"px":"",n.image.style.left=i.position.x+"px",n.image.style.top=i.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px",this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"}),OpenLayers.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(e,t,i,n,s,r,a){this.imageSrc=OpenLayers.Util.getImageLocation("cloud-popup-relative.png"),OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments),this.contentDiv.className=this.contentDisplayClass},CLASS_NAME:"OpenLayers.Popup.FramedCloud"}),OpenLayers.Tile.Image.IFrame={useIFrame:null,blankImageUrl:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAQAIBRAA7",draw:function(){if(OpenLayers.Tile.Image.prototype.shouldDraw.call(this)){var e=this.layer.getURL(this.bounds),t=this.useIFrame;this.useIFrame=null!==this.maxGetUrlLength&&!this.layer.async&&e.length>this.maxGetUrlLength;var i=t&&!this.useIFrame,n=!t&&this.useIFrame;(i||n)&&(this.imgDiv&&this.imgDiv.parentNode===this.frame&&this.frame.removeChild(this.imgDiv),this.imgDiv=null,i&&this.frame.removeChild(this.frame.firstChild))}return OpenLayers.Tile.Image.prototype.draw.apply(this,arguments)},getImage:function(){if(!0===this.useIFrame){if(!this.frame.childNodes.length){var e=document.createElement("div"),t=e.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex=1,t.backgroundImage="url("+this.blankImageUrl+")",this.frame.appendChild(e)}var i,n=this.id+"_iFrame";return parseFloat(navigator.appVersion.split("MSIE")[1])<9?((i=document.createElement('<iframe name="'+n+'">')).style.backgroundColor="#FFFFFF",i.style.filter="chroma(color=#FFFFFF)"):((i=document.createElement("iframe")).style.backgroundColor="transparent",i.name=n),i.scrolling="no",i.marginWidth="0px",i.marginHeight="0px",i.frameBorder="0",i.style.position="absolute",i.style.width="100%",i.style.height="100%",this.layer.opacity<1&&OpenLayers.Util.modifyDOMElement(i,null,null,null,null,null,null,this.layer.opacity),this.frame.appendChild(i),this.imgDiv=i,i}return OpenLayers.Tile.Image.prototype.getImage.apply(this,arguments)},createRequestForm:function(){var e=document.createElement("form");e.method="POST";var t=this.layer.params._OLSALT;t=(t?t+"_":"")+this.bounds.toBBOX(),e.action=OpenLayers.Util.urlAppend(this.layer.url,t),e.target=this.id+"_iFrame";this.layer.getImageSize();var i,n=OpenLayers.Util.getParameters(this.url);for(var s in n)(i=document.createElement("input")).type="hidden",i.name=s,i.value=n[s],e.appendChild(i);return e},setImgSrc:function(e){if(!0===this.useIFrame)if(e){var t=this.createRequestForm();this.frame.appendChild(t),t.submit(),this.frame.removeChild(t)}else this.imgDiv.parentNode===this.frame&&(this.frame.removeChild(this.imgDiv),this.imgDiv=null);else OpenLayers.Tile.Image.prototype.setImgSrc.apply(this,arguments)},onImageLoad:function(){OpenLayers.Tile.Image.prototype.onImageLoad.apply(this,arguments),!0===this.useIFrame&&(this.imgDiv.style.opacity=1,this.frame.style.opacity=this.layer.opacity)},createBackBuffer:function(){var e;return!1===this.useIFrame&&(e=OpenLayers.Tile.Image.prototype.createBackBuffer.call(this)),e}},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(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.options=e},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},readers:{gml:OpenLayers.Util.applyDefaults({name:function(e,t){t.name=this.getChildValue(e)},TimePeriod:function(e,t){t.timePeriod={},this.readChildNodes(e,t.timePeriod)},beginPosition:function(e,t){t.beginPosition=this.getChildValue(e)},endPosition:function(e,t){t.endPosition=this.getChildValue(e)}},OpenLayers.Format.GML.v3.prototype.readers.gml),sos:{Capabilities:function(e,t){this.readChildNodes(e,t)},Contents:function(e,t){t.contents={},this.readChildNodes(e,t.contents)},ObservationOfferingList:function(e,t){t.offeringList={},this.readChildNodes(e,t.offeringList)},ObservationOffering:function(e,t){var i=this.getAttributeNS(e,this.namespaces.gml,"id");t[i]={procedures:[],observedProperties:[],featureOfInterestIds:[],responseFormats:[],resultModels:[],responseModes:[]},this.readChildNodes(e,t[i])},time:function(e,t){t.time={},this.readChildNodes(e,t.time)},procedure:function(e,t){t.procedures.push(this.getAttributeNS(e,this.namespaces.xlink,"href"))},observedProperty:function(e,t){t.observedProperties.push(this.getAttributeNS(e,this.namespaces.xlink,"href"))},featureOfInterest:function(e,t){t.featureOfInterestIds.push(this.getAttributeNS(e,this.namespaces.xlink,"href"))},responseFormat:function(e,t){t.responseFormats.push(this.getChildValue(e))},resultModel:function(e,t){t.resultModels.push(this.getChildValue(e))},responseMode:function(e,t){t.responseModes.push(this.getChildValue(e))}},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,touchstart:function(e){var t=!0;if(this.pinching=!1,OpenLayers.Event.isMultiTouch(e))this.started=!0,this.last=this.start={distance:this.getDistance(e.touches),delta:0,scale:1},this.callback("start",[e,this.start]),t=!this.stopDown;else{if(this.started)return!1;this.started=!1,this.start=null,this.last=null}return OpenLayers.Event.preventDefault(e),t},touchmove:function(e){if(this.started&&OpenLayers.Event.isMultiTouch(e)){this.pinching=!0;var t=this.getPinchData(e);this.callback("move",[e,t]),this.last=t,OpenLayers.Event.stop(e)}else if(this.started)return!1;return!0},touchend:function(e){return!(this.started&&!OpenLayers.Event.isMultiTouch(e))||(this.started=!1,this.pinching=!1,this.callback("done",[e,this.start,this.last]),this.start=null,this.last=null,!1)},activate:function(){var e=!1;return OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.pinching=!1,e=!0),e},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.started=!1,this.pinching=!1,this.start=null,this.last=null,e=!0),e},getDistance:function(e){var t=e[0],i=e[1];return Math.sqrt(Math.pow(t.olClientX-i.olClientX,2)+Math.pow(t.olClientY-i.olClientY,2))},getPinchData:function(e){var t=this.getDistance(e.touches),i=t/this.start.distance;return{distance:t,delta:this.last.distance-t,scale:i}},CLASS_NAME:"OpenLayers.Handler.Pinch"}),OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(e){OpenLayers.Control.Panel.prototype.initialize.apply(this,[e]),this.addControls([new OpenLayers.Control.Navigation,new OpenLayers.Control.ZoomBox])},draw:function(){var e=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);return null===this.defaultControl&&(this.defaultControl=this.controls[0]),e},CLASS_NAME:"OpenLayers.Control.NavToolbar"}),OpenLayers.Strategy.Refresh=OpenLayers.Class(OpenLayers.Strategy,{force:!1,interval:0,timer:null,activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&(!0===this.layer.visibility&&this.start(),this.layer.events.on({visibilitychanged:this.reset,scope:this})),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&(this.stop(),this.layer.events.un({visibilitychanged:this.reset,scope:this})),e},reset:function(){!0===this.layer.visibility?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(e,t,i,n){var s=[];i=OpenLayers.Util.upperCaseObject(i),s.push(e,t,i,n),OpenLayers.Layer.Grid.prototype.initialize.apply(this,s),OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)),this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase()&&(null!=n&&n.isBaseLayer||(this.isBaseLayer=!1),"jpg"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"))},clone:function(e){return null==e&&(e=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){e=this.adjustBounds(e);var t=this.projection.getCode().split(":"),i=t[t.length-1],n=this.getImageSize(),s={BBOX:e.toBBOX(),SIZE:n.w+","+n.h,F:"image",BBOXSR:i,IMAGESR:i};if(this.layerDefs){var r,a=[];for(r in this.layerDefs)this.layerDefs.hasOwnProperty(r)&&this.layerDefs[r]&&(a.push(r),a.push(":"),a.push(this.layerDefs[r]),a.push(";"));a.length>0&&(s.LAYERDEFS=a.join(""))}return this.getFullRequestString(s)},setLayerFilter:function(e,t){this.layerDefs||(this.layerDefs={}),t?this.layerDefs[e]=t:delete this.layerDefs[e]},clearLayerFilter:function(e){e?delete this.layerDefs[e]:delete this.layerDefs},mergeNewParams:function(e){var t=[OpenLayers.Util.upperCaseObject(e)];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,t)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"}),OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:!1,px:null,timerId:null,mousemove:function(e){return this.passesTolerance(e.xy)&&(this.clearTimer(),this.callback("move",[e]),this.px=e.xy,e=OpenLayers.Util.extend({},e),this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,e),this.delay)),!this.stopMove},mouseout:function(e){return OpenLayers.Util.mouseLeft(e,this.map.viewPortDiv)&&(this.clearTimer(),this.callback("move",[e])),!0},passesTolerance:function(e){var t=!0;return this.pixelTolerance&&this.px&&Math.sqrt(Math.pow(this.px.x-e.x,2)+Math.pow(this.px.y-e.y,2))<this.pixelTolerance&&(t=!1),t},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null)},delayedCall:function(e){this.callback("pause",[e])},deactivate:function(){var e=!1;return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),e=!0),e},CLASS_NAME:"OpenLayers.Handler.Hover"}),OpenLayers.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,handlers:null,hoverResponse:null,filterType:OpenLayers.Filter.Spatial.BBOX,initialize:function(e){e.handlerOptions=e.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[e]),this.features={},this.handlers={},this.click&&(this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.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,pixelTolerance:2})))},activate:function(){if(!this.active)for(var e in this.handlers)this.handlers[e].activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active)for(var e in this.handlers)this.handlers[e].deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},selectClick:function(e){var t=this.pixelToBounds(e.xy);this.setModifiers(e),this.request(t,{single:this.single})},selectBox:function(e){var t;if(e instanceof OpenLayers.Bounds){var i=this.map.getLonLatFromPixel({x:e.left,y:e.bottom}),n=this.map.getLonLatFromPixel({x:e.right,y:e.top});t=new OpenLayers.Bounds(i.lon,i.lat,n.lon,n.lat)}else{if(this.click)return;t=this.pixelToBounds(e)}this.setModifiers(this.handlers.box.dragHandler.evt),this.request(t)},selectHover:function(e){var t=this.pixelToBounds(e.xy);this.request(t,{single:!0,hover:!0})},cancelHover:function(){this.hoverResponse&&(this.protocol.abort(this.hoverResponse),this.hoverResponse=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"))},request:function(e,t){t=t||{};var i=new OpenLayers.Filter.Spatial({type:this.filterType,value:e});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var n=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,e.getCenterLonLat(),t):this.select(i.features):t.hover?this.hoverSelect():(this.events.triggerEvent("clickout"),this.clickout&&this.unselectAll())),OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});1==t.hover&&(this.hoverResponse=n)},selectBestFeature:function(e,t,i){if(i=i||{},e.length){for(var n,s,r,a=new OpenLayers.Geometry.Point(t.lon,t.lat),o=Number.MAX_VALUE,l=0;l<e.length&&!((n=e[l]).geometry&&(r=a.distanceTo(n.geometry,{edge:!1}))<o&&(o=r,s=n,0==o));++l);1==i.hover?this.hoverSelect(s):this.select(s||e)}},setModifiers:function(e){this.modifiers={multiple:this.multiple||this.multipleKey&&e[this.multipleKey],toggle:this.toggle||this.toggleKey&&e[this.toggleKey]}},select:function(e){this.modifiers.multiple||this.modifiers.toggle||this.unselectAll(),OpenLayers.Util.isArray(e)||(e=[e]);var t=this.events.triggerEvent("beforefeaturesselected",{features:e});if(!1!==t){for(var i,n=[],s=0,r=e.length;s<r;++s)i=e[s],this.features[i.fid||i.id]?this.modifiers.toggle&&this.unselect(this.features[i.fid||i.id]):!1!==(t=this.events.triggerEvent("beforefeatureselected",{feature:i}))&&(this.features[i.fid||i.id]=i,n.push(i),this.events.triggerEvent("featureselected",{feature:i}));this.events.triggerEvent("featuresselected",{features:n})}},hoverSelect:function(e){var t=e?e.fid||e.id:null,i=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;i&&i!=t&&(this.events.triggerEvent("outfeature",{feature:this.hoverFeature}),this.hoverFeature=null),t&&t!=i&&(this.events.triggerEvent("hoverfeature",{feature:e}),this.hoverFeature=e)},unselect:function(e){delete this.features[e.fid||e.id],this.events.triggerEvent("featureunselected",{feature:e})},unselectAll:function(){for(var e in this.features)this.unselect(this.features[e])},setMap:function(e){for(var t in this.handlers)this.handlers[t].setMap(e);OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(e){var t=e.add(-this.clickTolerance/2,this.clickTolerance/2),i=e.add(this.clickTolerance/2,-this.clickTolerance/2),n=this.map.getLonLatFromPixel(t),s=this.map.getLonLatFromPixel(i);return new OpenLayers.Bounds(n.lon,n.lat,s.lon,s.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"}),OpenLayers.Format.QueryStringFilter=function(){function e(e){return e=e.replace(/%/g,"\\%"),e=e.replace(/\\\\\.(\*)?/g,function(e,t){return t?e:"\\\\_"}),e=e.replace(/\\\\\.\*/g,"\\\\%"),e=e.replace(/(\\)?\.(\*)?/g,function(e,t,i){return t||i?e:"_"}),e=e.replace(/(\\)?\.\*/g,function(e,t){return t?e:"%"}),e=e.replace(/\\\./g,"."),e=e.replace(/(\\)?\\\*/g,function(e,t){return t?e:"*"})}var t={};return t[OpenLayers.Filter.Comparison.EQUAL_TO]="eq",t[OpenLayers.Filter.Comparison.NOT_EQUAL_TO]="ne",t[OpenLayers.Filter.Comparison.LESS_THAN]="lt",t[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO]="lte",t[OpenLayers.Filter.Comparison.GREATER_THAN]="gt",t[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO]="gte",t[OpenLayers.Filter.Comparison.LIKE]="ilike",OpenLayers.Class(OpenLayers.Format,{wildcarded:!1,srsInBBOX:!1,write:function(i,n){n=n||{};var s=i.CLASS_NAME,r=s.substring(s.lastIndexOf(".")+1);switch(r){case"Spatial":switch(i.type){case OpenLayers.Filter.Spatial.BBOX:n.bbox=i.value.toArray(),this.srsInBBOX&&i.projection&&n.bbox.push(i.projection.getCode());break;case OpenLayers.Filter.Spatial.DWITHIN:n.tolerance=i.distance;case OpenLayers.Filter.Spatial.WITHIN:n.lon=i.value.x,n.lat=i.value.y;break;default:OpenLayers.Console.warn("Unknown spatial filter type "+i.type)}break;case"Comparison":var a=t[i.type];if(void 0!==a){var o=i.value;i.type==OpenLayers.Filter.Comparison.LIKE&&(o=e(o),this.wildcarded&&(o="%"+o+"%")),n[i.property+"__"+a]=o,n.queryable=n.queryable||[],n.queryable.push(i.property)}else OpenLayers.Console.warn("Unknown comparison filter type "+i.type);break;case"Logical":if(i.type===OpenLayers.Filter.Logical.AND)for(var l=0,h=i.filters.length;l<h;l++)n=this.write(i.filters[l],n);else OpenLayers.Console.warn("Unsupported logical filter type "+i.type);break;default:OpenLayers.Console.warn("Unknown filter type "+r)}return n},CLASS_NAME:"OpenLayers.Format.QueryStringFilter"})}(),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)},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)},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(e){var t;if(null!=e){if(null==this.lastXy||Math.abs(e.xy.x-this.lastXy.x)>this.granularity||Math.abs(e.xy.y-this.lastXy.y)>this.granularity)this.lastXy=e.xy;else if(t=this.map.getLonLatFromPixel(e.xy)){this.displayProjection&&t.transform(this.map.getProjectionObject(),this.displayProjection),this.lastXy=e.xy;var i=this.formatOutput(t);i!=this.element.innerHTML&&(this.element.innerHTML=i)}}else this.reset()},reset:function(e){null!=this.emptyString&&(this.element.innerHTML=this.emptyString)},formatOutput:function(e){var t=parseInt(this.numDigits);return this.prefix+e.lon.toFixed(t)+this.separator+e.lat.toFixed(t)+this.suffix},CLASS_NAME:"OpenLayers.Control.MousePosition"}),OpenLayers.Control.Geolocate=OpenLayers.Class(OpenLayers.Control,{geolocation:null,available:"geolocation"in navigator,bind:!0,watch:!1,geolocationOptions:null,destroy:function(){this.deactivate(),OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return this.available&&!this.geolocation&&(this.geolocation=navigator.geolocation),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):(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(e){var t=new OpenLayers.LonLat(e.coords.longitude,e.coords.latitude).transform(new OpenLayers.Projection("EPSG:4326"),this.map.getProjectionObject());this.bind&&this.map.setCenter(t),this.events.triggerEvent("locationupdated",{position:e,point:new OpenLayers.Geometry.Point(t.lon,t.lat)})},getCurrentLocation:function(){return!(!this.active||this.watch)&&(this.geolocation.getCurrentPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions),!0)},failure:function(e){this.events.triggerEvent("locationfailed",{error:e})},CLASS_NAME:"OpenLayers.Control.Geolocate"}),OpenLayers.Tile.UTFGrid=OpenLayers.Class(OpenLayers.Tile,{url:null,utfgridResolution:2,json:null,format:null,destroy:function(){this.clear(),OpenLayers.Tile.prototype.destroy.apply(this,arguments)},draw:function(){var e=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(e)if(this.isLoading?(this.abortLoading(),this.events.triggerEvent("reload")):(this.isLoading=!0,this.events.triggerEvent("loadstart")),this.url=this.layer.getURL(this.bounds),this.layer.useJSONP){var t=new OpenLayers.Protocol.Script({url:this.url,callback:function(e){this.isLoading=!1,this.events.triggerEvent("loadend"),this.json=e.data},scope:this});t.read(),this.request=t}else this.request=OpenLayers.Request.GET({url:this.url,callback:function(e){this.isLoading=!1,this.events.triggerEvent("loadend"),200===e.status&&this.parseData(e.responseText)},scope:this});else this.unload();return e},abortLoading:function(){this.request&&(this.request.abort(),delete this.request),this.isLoading=!1},getFeatureInfo:function(e,t){var i=null;if(this.json){var n=this.getFeatureId(e,t);null!==n&&(i={id:n,data:this.json.data[n]})}return i},getFeatureId:function(e,t){var i=null;if(this.json){var n=this.utfgridResolution,s=Math.floor(t/n),r=Math.floor(e/n),a=this.json.grid[s].charCodeAt(r),o=this.indexFromCharCode(a),l=this.json.keys;!isNaN(o)&&o in l&&(i=l[o])}return i},indexFromCharCode:function(e){return e>=93&&e--,e>=35&&e--,e-32},parseData:function(e){this.format||(this.format=new OpenLayers.Format.JSON),this.json=this.format.read(e)},clear:function(){this.json=null},CLASS_NAME:"OpenLayers.Tile.UTFGrid"}),OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,updateWithPOST:!1,deleteWithPOST:!1,wildcarded:!1,srsInBBOX:!1,initialize:function(e){if(e=e||{},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(e,i){return t.write(e,i)}}},destroy:function(){this.params=null,this.headers=null,OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(e){OpenLayers.Protocol.prototype.read.apply(this,arguments),(e=e||{}).params=OpenLayers.Util.applyDefaults(e.params,this.options.params),(e=OpenLayers.Util.applyDefaults(e,this.options)).filter&&this.filterToParams&&(e.params=this.filterToParams(e.filter,e.params));var t=void 0!==e.readWithPOST?e.readWithPOST:this.readWithPOST,i=new OpenLayers.Protocol.Response({requestType:"read"});if(t){var n=e.headers||{};n["Content-Type"]="application/x-www-form-urlencoded",i.priv=OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,i,e),data:OpenLayers.Util.getParameterString(e.params),headers:n})}else i.priv=OpenLayers.Request.GET({url:e.url,callback:this.createCallback(this.handleRead,i,e),params:e.params,headers:e.headers});return i},handleRead:function(e,t){this.handleResponse(e,t)},create:function(e,t){t=OpenLayers.Util.applyDefaults(t,this.options);var i=new OpenLayers.Protocol.Response({reqFeatures:e,requestType:"create"});return i.priv=OpenLayers.Request.POST({url:t.url,callback:this.createCallback(this.handleCreate,i,t),headers:t.headers,data:this.format.write(e)}),i},handleCreate:function(e,t){this.handleResponse(e,t)},update:function(e,t){var i=(t=t||{}).url||e.url||this.options.url+"/"+e.fid;t=OpenLayers.Util.applyDefaults(t,this.options);var n=new OpenLayers.Protocol.Response({reqFeatures:e,requestType:"update"}),s=this.updateWithPOST?"POST":"PUT";return n.priv=OpenLayers.Request[s]({url:i,callback:this.createCallback(this.handleUpdate,n,t),headers:t.headers,data:this.format.write(e)}),n},handleUpdate:function(e,t){this.handleResponse(e,t)},delete:function(e,t){var i=(t=t||{}).url||e.url||this.options.url+"/"+e.fid;t=OpenLayers.Util.applyDefaults(t,this.options);var n=new OpenLayers.Protocol.Response({reqFeatures:e,requestType:"delete"}),s=this.deleteWithPOST?"POST":"DELETE",r={url:i,callback:this.createCallback(this.handleDelete,n,t),headers:t.headers};return this.deleteWithPOST&&(r.data=this.format.write(e)),n.priv=OpenLayers.Request[s](r),n},handleDelete:function(e,t){this.handleResponse(e,t)},handleResponse:function(e,t){var i=e.priv;t.callback&&(i.status>=200&&i.status<300?("delete"!=e.requestType&&(e.features=this.parseFeatures(i)),e.code=OpenLayers.Protocol.Response.SUCCESS):e.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,e))},parseFeatures:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},commit:function(e,t){function i(e){for(var t=e.features?e.features.length:0,i=new Array(t),s=0;s<t;++s)i[s]=e.features[s].fid;f.insertIds=i,n.apply(this,[e])}function n(e){this.callUserCallback(e,t),d=d&&e.success(),++r>=c&&t.callback&&(f.code=d?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE,t.callback.apply(t.scope,[f]))}t=OpenLayers.Util.applyDefaults(t,this.options);var s=[],r=0,a={};a[OpenLayers.State.INSERT]=[],a[OpenLayers.State.UPDATE]=[],a[OpenLayers.State.DELETE]=[];for(var o,l,h=[],u=0,p=e.length;u<p;++u)(l=a[(o=e[u]).state])&&(l.push(o),h.push(o));var c=(a[OpenLayers.State.INSERT].length>0?1:0)+a[OpenLayers.State.UPDATE].length+a[OpenLayers.State.DELETE].length,d=!0,f=new OpenLayers.Protocol.Response({reqFeatures:h}),m=a[OpenLayers.State.INSERT];m.length>0&&s.push(this.create(m,OpenLayers.Util.applyDefaults({callback:i,scope:this},t.create)));for(u=(m=a[OpenLayers.State.UPDATE]).length-1;u>=0;--u)s.push(this.update(m[u],OpenLayers.Util.applyDefaults({callback:n,scope:this},t.update)));for(u=(m=a[OpenLayers.State.DELETE]).length-1;u>=0;--u)s.push(this.delete(m[u],OpenLayers.Util.applyDefaults({callback:n,scope:this},t.delete)));return s},abort:function(e){e&&e.priv.abort()},callUserCallback:function(e,t){var i=t[e.requestType];i&&i.callback&&i.callback.call(i.scope,e)},CLASS_NAME:"OpenLayers.Protocol.HTTP"}),OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:!1,resolution:null,activate:function(){var e=OpenLayers.Strategy.prototype.activate.call(this);return e&&this.layer.events.on({beforefeaturesadded:this.cacheFeatures,featuresremoved:this.clearCache,moveend:this.cluster,scope:this}),e},deactivate:function(){var e=OpenLayers.Strategy.prototype.deactivate.call(this);return e&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,featuresremoved:this.clearCache,moveend:this.cluster,scope:this})),e},cacheFeatures:function(e){var t=!0;return this.clustering||(this.clearCache(),this.features=e.features,this.cluster(),t=!1),t},clearCache:function(){this.clustering||(this.features=null)},cluster:function(e){if((!e||e.zoomChanged)&&this.features){var t=this.layer.map.getResolution();if(t!=this.resolution||!this.clustersExist()){this.resolution=t;for(var i,n,s,r=[],a=0;a<this.features.length;++a)if((i=this.features[a]).geometry){n=!1;for(var o=r.length-1;o>=0;--o)if(s=r[o],this.shouldCluster(s,i)){this.addToCluster(s,i),n=!0;break}n||r.push(this.createCluster(this.features[a]))}if(this.clustering=!0,this.layer.removeAllFeatures(),this.clustering=!1,r.length>0){if(this.threshold>1){var l=r.slice();r=[];for(var h,a=0,u=l.length;a<u;++a)(h=l[a]).attributes.count<this.threshold?Array.prototype.push.apply(r,h.cluster):r.push(h)}this.clustering=!0,this.layer.addFeatures(r),this.clustering=!1}this.clusters=r}}},clustersExist:function(){var e=!1;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){e=!0;for(var t=0;t<this.clusters.length;++t)if(this.clusters[t]!=this.layer.features[t]){e=!1;break}}return e},shouldCluster:function(e,t){var i=e.geometry.getBounds().getCenterLonLat(),n=t.geometry.getBounds().getCenterLonLat();return Math.sqrt(Math.pow(i.lon-n.lon,2)+Math.pow(i.lat-n.lat,2))/this.resolution<=this.distance},addToCluster:function(e,t){e.cluster.push(t),e.attributes.count+=1},createCluster:function(e){var t=e.geometry.getBounds().getCenterLonLat(),i=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(t.lon,t.lat),{count:1});return i.cluster=[e],i},CLASS_NAME:"OpenLayers.Strategy.Cluster"}),OpenLayers.Strategy.Filter=OpenLayers.Class(OpenLayers.Strategy,{filter:null,cache:null,caching:!1,activate:function(){var e=OpenLayers.Strategy.prototype.activate.apply(this,arguments);return e&&(this.cache=[],this.layer.events.on({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this})),e},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(e){if(!this.caching&&this.filter){var t=e.features;e.features=[];for(var i,n=0,s=t.length;n<s;++n)i=t[n],this.filter.evaluate(i)?e.features.push(i):this.cache.push(i)}},handleRemove:function(e){this.caching||(this.cache=[])},setFilter:function(e){this.filter=e;var t=this.cache;if(this.cache=[],this.handleAdd({features:this.layer.features}),this.cache.length>0&&(this.caching=!0,this.layer.removeFeatures(this.cache.slice()),this.caching=!1),t.length>0){var i={features:t};this.handleAdd(i),i.features.length>0&&(this.caching=!0,this.layer.addFeatures(i.features),this.caching=!1)}},CLASS_NAME:"OpenLayers.Strategy.Filter"}),OpenLayers.Protocol.SOS=function(e){e=OpenLayers.Util.applyDefaults(e,OpenLayers.Protocol.SOS.DEFAULTS);var t=OpenLayers.Protocol.SOS["v"+e.version.replace(/\./g,"_")];if(!t)throw"Unsupported SOS version: "+e.version;return new t(e)},OpenLayers.Protocol.SOS.DEFAULTS={version:"1.0.0"},OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g},namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},readers:{xsd:{schema:function(e,t){var i,n,s=[],r={},a={complexTypes:s,customTypes:r};this.readChildNodes(e,a);var o,l,h=e.attributes;for(i=0,n=h.length;i<n;++i)0===(l=(o=h[i]).name).indexOf("xmlns")?this.setNamespace(l.split(":")[1]||"",o.value):t[l]=o.value;t.featureTypes=s,t.targetPrefix=this.namespaceAlias[t.targetNamespace];var u,p;for(i=0,n=s.length;i<n;++i)p=r[(u=s[i]).typeName],r[u.typeName]&&(u.typeName=p.name)},complexType:function(e,t){var i={typeName:e.getAttribute("name")};this.readChildNodes(e,i),t.complexTypes.push(i)},complexContent:function(e,t){this.readChildNodes(e,t)},extension:function(e,t){this.readChildNodes(e,t)},sequence:function(e,t){var i={elements:[]};this.readChildNodes(e,i),t.properties=i.elements},element:function(e,t){var i;if(t.elements){for(var n,s={},r=e.attributes,a=0,o=r.length;a<o;++a)s[(n=r[a]).name]=n.value;(i=s.type)||(i={},this.readChildNodes(e,i),s.restriction=i,s.type=i.base);var l=i.base||i;s.localType=l.split(":").pop(),t.elements.push(s),this.readChildNodes(e,s)}if(t.complexTypes){var h=(i=e.getAttribute("type")).split(":").pop();t.customTypes[h]={name:e.getAttribute("name"),type:i}}},annotation:function(e,t){t.annotation={},this.readChildNodes(e,t.annotation)},appinfo:function(e,t){t.appinfo||(t.appinfo=[]),t.appinfo.push(this.getChildValue(e))},documentation:function(e,t){t.documentation||(t.documentation=[]);var i=this.getChildValue(e);t.documentation.push({lang:e.getAttribute("xml:lang"),textContent:i.replace(this.regExes.trimSpace,"")})},simpleType:function(e,t){this.readChildNodes(e,t)},restriction:function(e,t){t.base=e.getAttribute("base"),this.readRestriction(e,t)}}},readRestriction:function(e,t){for(var i,n,s,r=e.childNodes,a=0,o=r.length;a<o;++a)1==(i=r[a]).nodeType&&(n=i.nodeName.split(":").pop(),s=i.getAttribute("value"),t[n]?("string"==typeof t[n]&&(t[n]=[t[n]]),t[n].push(s)):t[n]=s)},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};if("ExceptionReport"===e.nodeName.split(":").pop()){var i=new OpenLayers.Format.OGCExceptionReport;t.error=i.read(e)}else this.readNode(e,t);return t},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"}),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(e){var t=this.getElementsByTagNameNS(e,this.georssns,"point"),i=this.getElementsByTagNameNS(e,this.geons,"lat"),n=this.getElementsByTagNameNS(e,this.geons,"long"),s=this.getElementsByTagNameNS(e,this.georssns,"line"),r=this.getElementsByTagNameNS(e,this.georssns,"polygon"),a=this.getElementsByTagNameNS(e,this.georssns,"where"),o=this.getElementsByTagNameNS(e,this.georssns,"box");if(t.length>0||i.length>0&&n.length>0){var l;t.length>0?2!=(l=OpenLayers.String.trim(t[0].firstChild.nodeValue).split(/\s+/)).length&&(l=OpenLayers.String.trim(t[0].firstChild.nodeValue).split(/\s*,\s*/)):l=[parseFloat(i[0].firstChild.nodeValue),parseFloat(n[0].firstChild.nodeValue)];var h=new OpenLayers.Geometry.Point(l[1],l[0])}else if(s.length>0){for(var u=[],p=0,c=(d=OpenLayers.String.trim(this.getChildValue(s[0])).split(/\s+/)).length;p<c;p+=2)t=new OpenLayers.Geometry.Point(d[p+1],d[p]),u.push(t);h=new OpenLayers.Geometry.LineString(u)}else if(r.length>0){for(var u=[],p=0,c=(d=OpenLayers.String.trim(this.getChildValue(r[0])).split(/\s+/)).length;p<c;p+=2)t=new OpenLayers.Geometry.Point(d[p+1],d[p]),u.push(t);h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(u)])}else if(a.length>0)this.gmlParser||(this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})),h=this.gmlParser.parseFeature(a[0]).geometry;else if(o.length>0){var d=OpenLayers.String.trim(o[0].firstChild.nodeValue).split(/\s+/),u=[];d.length>3&&(t=new OpenLayers.Geometry.Point(d[1],d[0]),u.push(t),t=new OpenLayers.Geometry.Point(d[1],d[2]),u.push(t),t=new OpenLayers.Geometry.Point(d[3],d[2]),u.push(t),t=new OpenLayers.Geometry.Point(d[3],d[0]),u.push(t),t=new OpenLayers.Geometry.Point(d[1],d[0]),u.push(t)),h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(u)])}return h&&this.internalProjection&&this.externalProjection&&h.transform(this.externalProjection,this.internalProjection),h},createFeatureFromItem:function(e){var t=this.createGeometryFromItem(e),i=this._getChildValue(e,"*","title",this.featureTitle),n=this._getChildValue(e,"*","description",this._getChildValue(e,"*","content",this._getChildValue(e,"*","summary",this.featureDescription))),s=this._getChildValue(e,"*","link");if(!s)try{s=this.getElementsByTagNameNS(e,"*","link")[0].getAttribute("href")}catch(e){s=null}var r=this._getChildValue(e,"*","id",null),a={title:i,description:n,link:s},o=new OpenLayers.Feature.Vector(t,a);return o.fid=r,o},_getChildValue:function(e,t,i,n){var s=this.getElementsByTagNameNS(e,t,i);return s&&s[0]&&s[0].firstChild&&s[0].firstChild.nodeValue?this.getChildValue(s[0]):void 0==n?"":n},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var t=null;0==(t=this.getElementsByTagNameNS(e,"*","item")).length&&(t=this.getElementsByTagNameNS(e,"*","entry"));for(var i=t.length,n=new Array(i),s=0;s<i;s++)n[s]=this.createFeatureFromItem(t[s]);return n},write:function(e){var t;if(OpenLayers.Util.isArray(e)){t=this.createElementNS(this.rssns,"rss");for(var i=0,n=e.length;i<n;i++)t.appendChild(this.createFeatureXML(e[i]))}else t=this.createFeatureXML(e);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(e){var t=this.buildGeometryNode(e.geometry),i=this.createElementNS(this.rssns,"item"),n=this.createElementNS(this.rssns,"title");n.appendChild(this.createTextNode(e.attributes.title?e.attributes.title:""));var s=this.createElementNS(this.rssns,"description");if(s.appendChild(this.createTextNode(e.attributes.description?e.attributes.description:"")),i.appendChild(n),i.appendChild(s),e.attributes.link){var r=this.createElementNS(this.rssns,"link");r.appendChild(this.createTextNode(e.attributes.link)),i.appendChild(r)}for(var a in e.attributes)if("link"!=a&&"title"!=a&&"description"!=a){var o=this.createTextNode(e.attributes[a]),l=a;-1!=a.search(":")&&(l=a.split(":")[1]);var h=this.createElementNS(this.featureNS,"feature:"+l);h.appendChild(o),i.appendChild(h)}return i.appendChild(t),i},buildGeometryNode:function(e){this.internalProjection&&this.externalProjection&&(e=e.clone()).transform(this.internalProjection,this.externalProjection);var t;if("OpenLayers.Geometry.Polygon"==e.CLASS_NAME)(t=this.createElementNS(this.georssns,"georss:polygon")).appendChild(this.buildCoordinatesNode(e.components[0]));else if("OpenLayers.Geometry.LineString"==e.CLASS_NAME)(t=this.createElementNS(this.georssns,"georss:line")).appendChild(this.buildCoordinatesNode(e));else{if("OpenLayers.Geometry.Point"!=e.CLASS_NAME)throw"Couldn't parse "+e.CLASS_NAME;(t=this.createElementNS(this.georssns,"georss:point")).appendChild(this.buildCoordinatesNode(e))}return t},buildCoordinatesNode:function(e){var t=null;e.components&&(t=e.components);var i;if(t){for(var n=t.length,s=new Array(n),r=0;r<n;r++)s[r]=t[r].y+" "+t[r].x;i=s.join(" ")}else i=e.y+" "+e.x;return this.createTextNode(i)},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(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e])},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t},readers:{wps:{Capabilities:function(e,t){this.readChildNodes(e,t)},ProcessOfferings:function(e,t){t.processOfferings={},this.readChildNodes(e,t.processOfferings)},Process:function(e,t){var i={processVersion:this.getAttributeNS(e,this.namespaces.wps,"processVersion")};this.readChildNodes(e,i),t[i.identifier]=i},Languages:function(e,t){t.languages=[],this.readChildNodes(e,t.languages)},Default:function(e,t){var i={isDefault:!0};this.readChildNodes(e,i),t.push(i)},Supported:function(e,t){var i={};this.readChildNodes(e,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,pinchOrigin:null,currentCenter:null,autoActivate:!0,preserveCenter:!1,initialize:function(e){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)},pinchStart:function(e,t){var i=this.preserveCenter?this.map.getPixelFromLonLat(this.map.getCenter()):e.xy;this.pinchOrigin=i,this.currentCenter=i},pinchMove:function(e,t){var i=t.scale,n=this.map.layerContainerOriginPx,s=this.pinchOrigin,r=this.preserveCenter?this.map.getPixelFromLonLat(this.map.getCenter()):e.xy,a=Math.round(n.x+r.x-s.x+(i-1)*(n.x-s.x)),o=Math.round(n.y+r.y-s.y+(i-1)*(n.y-s.y));this.map.applyTransform(a,o,i),this.currentCenter=r},pinchDone:function(e,t,i){this.map.applyTransform();var n=this.map.getZoomForResolution(this.map.getResolution()/i.scale,!0);if(n!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){var s=this.map.getResolutionForZoom(n),r=this.map.getLonLatFromPixel(this.pinchOrigin),a=this.currentCenter,o=this.map.getSize();r.lon+=s*(o.w/2-a.x),r.lat-=s*(o.h/2-a.y),this.map.div.clientWidth=this.map.div.clientWidth,this.map.setCenter(r,n)}},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(e){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)},deactivate:function(){return!!OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.dragPan.deactivate(),this.handlers.click.deactivate(),this.pinchZoom.deactivate(),!0)},draw:function(){var e={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,e,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(e){e.lastTouches&&2==e.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(e){this.map.zoomTo(this.map.zoom+1,e.xy)},CLASS_NAME:"OpenLayers.Control.TouchNavigation"}),OpenLayers.Console.warn("OpenLayers.Rico is deprecated"),OpenLayers.Rico=OpenLayers.Rico||{},OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(e,t,i){this.rgb={r:e,g:t,b:i}},setRed:function(e){this.rgb.r=e},setGreen:function(e){this.rgb.g=e},setBlue:function(e){this.rgb.b=e},setHue:function(e){var t=this.asHSB();t.h=e,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setSaturation:function(e){var t=this.asHSB();t.s=e,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},setBrightness:function(e){var t=this.asHSB();t.b=e,this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,t.b)},darken:function(e){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.max(t.b-e,0))},brighten:function(e){var t=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(t.h,t.s,Math.min(t.b+e,1))},blend:function(e){this.rgb.r=Math.floor((this.rgb.r+e.rgb.r)/2),this.rgb.g=Math.floor((this.rgb.g+e.rgb.g)/2),this.rgb.b=Math.floor((this.rgb.b+e.rgb.b)/2)},isBright:function(){this.asHSB();return this.asHSB().b>.5},isDark:function(){return!this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}}),OpenLayers.Rico.Color.createFromHex=function(e){if(4==e.length)for(var t=e,e="#",i=1;i<4;i++)e+=t.charAt(i)+t.charAt(i);0==e.indexOf("#")&&(e=e.substring(1));var n=e.substring(0,2),s=e.substring(2,4),r=e.substring(4,6);return new OpenLayers.Rico.Color(parseInt(n,16),parseInt(s,16),parseInt(r,16))},OpenLayers.Rico.Color.createColorFromBackground=function(e){var t=OpenLayers.Element.getStyle(OpenLayers.Util.getElement(e),"backgroundColor");if("transparent"==t&&e.parentNode)return OpenLayers.Rico.Color.createColorFromBackground(e.parentNode);if(null==t)return new OpenLayers.Rico.Color(255,255,255);if(0==t.indexOf("rgb(")){var i=t.substring(4,t.length-1).split(",");return new OpenLayers.Rico.Color(parseInt(i[0]),parseInt(i[1]),parseInt(i[2]))}return 0==t.indexOf("#")?OpenLayers.Rico.Color.createFromHex(t):new OpenLayers.Rico.Color(255,255,255)},OpenLayers.Rico.Color.HSBtoRGB=function(e,t,i){var n=0,s=0,r=0;if(0==t)s=n=parseInt(255*i+.5),r=n;else{var a=6*(e-Math.floor(e)),o=a-Math.floor(a),l=i*(1-t),h=i*(1-t*o),u=i*(1-t*(1-o));switch(parseInt(a)){case 0:n=255*i+.5,s=255*u+.5,r=255*l+.5;break;case 1:n=255*h+.5,s=255*i+.5,r=255*l+.5;break;case 2:n=255*l+.5,s=255*i+.5,r=255*u+.5;break;case 3:n=255*l+.5,s=255*h+.5,r=255*i+.5;break;case 4:n=255*u+.5,s=255*l+.5,r=255*i+.5;break;case 5:n=255*i+.5,s=255*l+.5,r=255*h+.5}}return{r:parseInt(n),g:parseInt(s),b:parseInt(r)}},OpenLayers.Rico.Color.RGBtoHSB=function(e,t,i){var n,s,r,a=e>t?e:t;i>a&&(a=i);var o=e<t?e:t;if(i<o&&(o=i),r=a/255,0==(s=0!=a?(a-o)/a:0))n=0;else{var l=(a-e)/(a-o),h=(a-t)/(a-o),u=(a-i)/(a-o);n=e==a?u-h:t==a?2+l-u:4+h-l,(n/=6)<0&&(n+=1)}return{h:n,s:s,b:r}},OpenLayers.Style2=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,initialize:function(e){OpenLayers.Util.extend(this,e),this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var e=0,t=this.rules.length;e<t;e++)this.rules[e].destroy();delete this.rules},clone:function(){var e=OpenLayers.Util.extend({},this);if(this.rules){e.rules=[];for(var t=0,i=this.rules.length;t<i;++t)e.rules.push(this.rules[t].clone())}return new OpenLayers.Style2(e)},CLASS_NAME:"OpenLayers.Style2"}),OpenLayers.Format.WFS=OpenLayers.Class(OpenLayers.Format.GML,{layer:null,wfsns:"http://www.opengis.net/wfs",ogcns:"http://www.opengis.net/ogc",initialize:function(e,t){OpenLayers.Format.GML.prototype.initialize.apply(this,[e]),this.layer=t,this.layer.featureNS&&(this.featureNS=this.layer.featureNS),this.layer.options.geometry_column&&(this.geometryName=this.layer.options.geometry_column),this.layer.options.typename&&(this.featureName=this.layer.options.typename)},write:function(e){var t=this.createElementNS(this.wfsns,"wfs:Transaction");t.setAttribute("version","1.0.0"),t.setAttribute("service","WFS");for(var i=0;i<e.length;i++)switch(e[i].state){case OpenLayers.State.INSERT:t.appendChild(this.insert(e[i]));break;case OpenLayers.State.UPDATE:t.appendChild(this.update(e[i]));break;case OpenLayers.State.DELETE:t.appendChild(this.remove(e[i]))}return OpenLayers.Format.XML.prototype.write.apply(this,[t])},createFeatureXML:function(e){var t=this.buildGeometryNode(e.geometry),i=this.createElementNS(this.featureNS,"feature:"+this.geometryName);i.appendChild(t);var n=this.createElementNS(this.featureNS,"feature:"+this.featureName);n.appendChild(i);for(var s in e.attributes){var r=this.createTextNode(e.attributes[s]),a=s;-1!=s.search(":")&&(a=s.split(":")[1]);var o=this.createElementNS(this.featureNS,"feature:"+a);o.appendChild(r),n.appendChild(o)}return n},insert:function(e){var t=this.createElementNS(this.wfsns,"wfs:Insert");return t.appendChild(this.createFeatureXML(e)),t},update:function(e){e.fid||OpenLayers.Console.userError(OpenLayers.i18n("noFID"));var t=this.createElementNS(this.wfsns,"wfs:Update");t.setAttribute("typeName",this.featurePrefix+":"+this.featureName),t.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var i=this.createElementNS(this.wfsns,"wfs:Property"),n=this.createElementNS(this.wfsns,"wfs:Name"),s=this.createTextNode(this.geometryName);n.appendChild(s),i.appendChild(n);var r=this.createElementNS(this.wfsns,"wfs:Value"),a=this.buildGeometryNode(e.geometry);e.layer&&a.setAttribute("srsName",e.layer.projection.getCode()),r.appendChild(a),i.appendChild(r),t.appendChild(i);for(var o in e.attributes)i=this.createElementNS(this.wfsns,"wfs:Property"),(n=this.createElementNS(this.wfsns,"wfs:Name")).appendChild(this.createTextNode(o)),i.appendChild(n),(r=this.createElementNS(this.wfsns,"wfs:Value")).appendChild(this.createTextNode(e.attributes[o])),i.appendChild(r),t.appendChild(i);var l=this.createElementNS(this.ogcns,"ogc:Filter"),h=this.createElementNS(this.ogcns,"ogc:FeatureId");return h.setAttribute("fid",e.fid),l.appendChild(h),t.appendChild(l),t},remove:function(e){if(!e.fid)return OpenLayers.Console.userError(OpenLayers.i18n("noFID")),!1;var t=this.createElementNS(this.wfsns,"wfs:Delete");t.setAttribute("typeName",this.featurePrefix+":"+this.featureName),t.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var i=this.createElementNS(this.ogcns,"ogc:Filter"),n=this.createElementNS(this.ogcns,"ogc:FeatureId");return n.setAttribute("fid",e.fid),i.appendChild(n),t.appendChild(i),t},destroy:function(){this.layer=null},CLASS_NAME:"OpenLayers.Format.WFS"}),OpenLayers.Format.SLD.v1_0_0_GeoServer=OpenLayers.Class(OpenLayers.Format.SLD.v1_0_0,{version:"1.0.0",profile:"GeoServer",readers:OpenLayers.Util.applyDefaults({sld:OpenLayers.Util.applyDefaults({Priority:function(e,t){var i=this.readers.ogc._expression.call(this,e);i&&(t.priority=i)},VendorOption:function(e,t){t.vendorOptions||(t.vendorOptions={}),t.vendorOptions[e.getAttribute("name")]=this.getChildValue(e)},TextSymbolizer:function(e,t){OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld.TextSymbolizer.apply(this,arguments);var i=this.multipleSymbolizers?t.symbolizers[t.symbolizers.length-1]:t.symbolizer.Text;void 0===i.graphic&&(i.graphic=!1)}},OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.readers),writers:OpenLayers.Util.applyDefaults({sld:OpenLayers.Util.applyDefaults({Priority:function(e){return this.writers.sld._OGCExpression.call(this,"sld:Priority",e)},VendorOption:function(e){return this.createElementNSPlus("sld:VendorOption",{attributes:{name:e.name},value:e.value})},TextSymbolizer:function(e){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.TextSymbolizer.apply(this,arguments);return!1!==e.graphic&&(e.externalGraphic||e.graphicName)&&this.writeNode("Graphic",e,t),"priority"in e&&this.writeNode("Priority",e.priority,t),this.addVendorOptions(t,e)},PointSymbolizer:function(e){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PointSymbolizer.apply(this,arguments);return this.addVendorOptions(t,e)},LineSymbolizer:function(e){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.LineSymbolizer.apply(this,arguments);return this.addVendorOptions(t,e)},PolygonSymbolizer:function(e){var t=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PolygonSymbolizer.apply(this,arguments);return this.addVendorOptions(t,e)}},OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.writers),addVendorOptions:function(e,t){if(t.vendorOptions)for(var i in t.vendorOptions)this.writeNode("VendorOption",{name:i,value:t.vendorOptions[i]},e);return e},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0_GeoServer"}),OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{drawMarker:function(e){var t=this.map.getLayerPxFromLonLat({lon:e.bounds.left,lat:e.bounds.top}),i=this.map.getLayerPxFromLonLat({lon:e.bounds.right,lat:e.bounds.bottom});if(null==i||null==t)e.display(!1);else{var n=e.draw(t,{w:Math.max(1,i.x-t.x),h:Math.max(1,i.y-t.y)});e.drawn||(this.div.appendChild(n),e.drawn=!0)}},removeMarker:function(e){OpenLayers.Util.removeItem(this.markers,e),null!=e.div&&e.div.parentNode==this.div&&this.div.removeChild(e.div)},CLASS_NAME:"OpenLayers.Layer.Boxes"}),OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{readers:{wfs:OpenLayers.Util.applyDefaults({Service:function(e,t){t.service={},this.readChildNodes(e,t.service)},Fees:function(e,t){var i=this.getChildValue(e);i&&"none"!=i.toLowerCase()&&(t.fees=i)},AccessConstraints:function(e,t){var i=this.getChildValue(e);i&&"none"!=i.toLowerCase()&&(t.accessConstraints=i)},OnlineResource:function(e,t){var i=this.getChildValue(e);i&&"none"!=i.toLowerCase()&&(t.onlineResource=i)},Keywords:function(e,t){var i=this.getChildValue(e);i&&"none"!=i.toLowerCase()&&(t.keywords=i.split(", "))},Capability:function(e,t){t.capability={},this.readChildNodes(e,t.capability)},Request:function(e,t){t.request={},this.readChildNodes(e,t.request)},GetFeature:function(e,t){t.getfeature={href:{},formats:[]},this.readChildNodes(e,t.getfeature)},ResultFormat:function(e,t){for(var i,n=e.childNodes,s=0;s<n.length;s++)1==(i=n[s]).nodeType&&t.formats.push(i.nodeName)},DCPType:function(e,t){this.readChildNodes(e,t)},HTTP:function(e,t){this.readChildNodes(e,t.href)},Get:function(e,t){t.get=e.getAttribute("onlineResource")},Post:function(e,t){t.post=e.getAttribute("onlineResource")},SRS:function(e,t){var i=this.getChildValue(e);i&&(t.srs=i)}},OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs)},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"}),OpenLayers.Format.WMSCapabilities.v1_3=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMS_Capabilities:function(e,t){this.readChildNodes(e,t)},LayerLimit:function(e,t){t.layerLimit=parseInt(this.getChildValue(e))},MaxWidth:function(e,t){t.maxWidth=parseInt(this.getChildValue(e))},MaxHeight:function(e,t){t.maxHeight=parseInt(this.getChildValue(e))},BoundingBox:function(e,t){var i=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[e,t]);i.srs=e.getAttribute("CRS"),t.bbox[i.srs]=i},CRS:function(e,t){this.readers.wms.SRS.apply(this,[e,t])},EX_GeographicBoundingBox:function(e,t){t.llbbox=[],this.readChildNodes(e,t.llbbox)},westBoundLongitude:function(e,t){t[0]=this.getChildValue(e)},eastBoundLongitude:function(e,t){t[2]=this.getChildValue(e)},southBoundLatitude:function(e,t){t[1]=this.getChildValue(e)},northBoundLatitude:function(e,t){t[3]=this.getChildValue(e)},MinScaleDenominator:function(e,t){t.maxScale=parseFloat(this.getChildValue(e)).toPrecision(16)},MaxScaleDenominator:function(e,t){t.minScale=parseFloat(this.getChildValue(e)).toPrecision(16)},Dimension:function(e,t){var i={name:e.getAttribute("name").toLowerCase(),units:e.getAttribute("units"),unitsymbol:e.getAttribute("unitSymbol"),nearestVal:"1"===e.getAttribute("nearestValue"),multipleVal:"1"===e.getAttribute("multipleValues"),default:e.getAttribute("default")||"",current:"1"===e.getAttribute("current"),values:this.getChildValue(e).split(",")};t.dimensions[i.name]=i},Keyword:function(e,t){var i={value:this.getChildValue(e),vocabulary:e.getAttribute("vocabulary")};t.keywords&&t.keywords.push(i)}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms),sld:{UserDefinedSymbolization:function(e,t){this.readers.wms.UserDefinedSymbolization.apply(this,[e,t]),t.userSymbols.inlineFeature=1==parseInt(e.getAttribute("InlineFeature")),t.userSymbols.remoteWCS=1==parseInt(e.getAttribute("RemoteWCS"))},DescribeLayer:function(e,t){this.readers.wms.DescribeLayer.apply(this,[e,t])},GetLegendGraphic:function(e,t){this.readers.wms.GetLegendGraphic.apply(this,[e,t])}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3"}),OpenLayers.Layer.Zoomify=OpenLayers.Class(OpenLayers.Layer.Grid,{size:null,isBaseLayer:!0,standardTileSize:256,tileOriginCorner:"tl",numberOfTiers:0,tileCountUpToTier:null,tierSizeInTiles:null,tierImageSize:null,initialize:function(e,t,i,n){this.initializeZoomify(i),OpenLayers.Layer.Grid.prototype.initialize.apply(this,[e,t,i,{},n])},initializeZoomify:function(e){var t=e.clone();this.size=e.clone();var i=new OpenLayers.Size(Math.ceil(t.w/this.standardTileSize),Math.ceil(t.h/this.standardTileSize));for(this.tierSizeInTiles=[i],this.tierImageSize=[t];t.w>this.standardTileSize||t.h>this.standardTileSize;)t=new OpenLayers.Size(Math.floor(t.w/2),Math.floor(t.h/2)),i=new OpenLayers.Size(Math.ceil(t.w/this.standardTileSize),Math.ceil(t.h/this.standardTileSize)),this.tierSizeInTiles.push(i),this.tierImageSize.push(t);this.tierSizeInTiles.reverse(),this.tierImageSize.reverse(),this.numberOfTiers=this.tierSizeInTiles.length;var n=[1];this.tileCountUpToTier=[0];for(var s=1;s<this.numberOfTiers;s++)n.unshift(Math.pow(2,s)),this.tileCountUpToTier.push(this.tierSizeInTiles[s-1].w*this.tierSizeInTiles[s-1].h+this.tileCountUpToTier[s-1]);this.serverResolutions||(this.serverResolutions=n)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments),this.tileCountUpToTier.length=0,this.tierSizeInTiles.length=0,this.tierImageSize.length=0},clone:function(e){return null==e&&(e=new OpenLayers.Layer.Zoomify(this.name,this.url,this.size,this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){e=this.adjustBounds(e);var t=this.getServerResolution(),i=Math.round((e.left-this.tileOrigin.lon)/(t*this.tileSize.w)),n=Math.round((this.tileOrigin.lat-e.top)/(t*this.tileSize.h)),s=this.getZoomForResolution(t),r=i+n*this.tierSizeInTiles[s].w+this.tileCountUpToTier[s],a="TileGroup"+Math.floor(r/256)+"/"+s+"-"+i+"-"+n+".jpg",o=this.url;return OpenLayers.Util.isArray(o)&&(o=this.selectUrl(a,o)),o+a},getImageSize:function(){if(arguments.length>0){var e=this.adjustBounds(arguments[0]),t=this.getServerResolution(),i=Math.round((e.left-this.tileOrigin.lon)/(t*this.tileSize.w)),n=Math.round((this.tileOrigin.lat-e.top)/(t*this.tileSize.h)),s=this.getZoomForResolution(t),r=this.standardTileSize,a=this.standardTileSize;if(i==this.tierSizeInTiles[s].w-1)r=this.tierImageSize[s].w%this.standardTileSize;if(n==this.tierSizeInTiles[s].h-1)a=this.tierImageSize[s].h%this.standardTileSize;return new OpenLayers.Size(r,a)}return this.tileSize},setMap:function(e){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments),this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.top)},CLASS_NAME:"OpenLayers.Layer.Zoomify"}),OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(e,t,i,n){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments),this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS),null!=n&&null!=n.isBaseLayer||(this.isBaseLayer="true"!=this.params.transparent&&1!=this.params.transparent)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getURL:function(e){var t=[(e=this.adjustBounds(e)).left,e.bottom,e.right,e.top],i=this.getImageSize();return this.getFullRequestString({mapext:t,imgext:t,map_size:[i.w,i.h],imgx:i.w/2,imgy:i.h/2,imgxy:[i.w,i.h]})},getFullRequestString:function(e,t){var i=null==t?this.url:t,n=OpenLayers.Util.extend({},this.params);n=OpenLayers.Util.extend(n,e);var s=OpenLayers.Util.getParameterString(n);OpenLayers.Util.isArray(i)&&(i=this.selectUrl(s,i));var r=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(i));for(var a in n)a.toUpperCase()in r&&delete n[a];var o=i;if(""!=(s=(s=OpenLayers.Util.getParameterString(n)).replace(/,/g,"+"))){var l=i.charAt(i.length-1);"&"==l||"?"==l?o+=s:-1==i.indexOf("?")?o+="?"+s:o+="&"+s}return o},CLASS_NAME:"OpenLayers.Layer.MapServer"}),OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(e){if(this.supported()){if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);for(var t=document.createStyleSheet(),i=["shape","rect","oval","fill","stroke","imagedata","group","textbox"],n=0,s=i.length;n<s;n++)t.addRule("olv\\:"+i[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(e,t){var i=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),n=this.getResolution(),s=e.left/n|0,r=e.top/n-this.size.h|0;t||!this.offset?(this.offset={x:s,y:r},s=0,r=0):(s-=this.offset.x,r-=this.offset.y);var a=s-this.xOffset+" "+r;this.root.coordorigin=a;for(var o,l=[this.root,this.vectorRoot,this.textRoot],h=0,u=l.length;h<u;++h){o=l[h];var p=this.size.w+" "+this.size.h;o.coordsize=p}return this.root.style.flip="y",i},setSize:function(e){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);for(var t,i=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],n=this.size.w+"px",s=this.size.h+"px",r=0,a=i.length;r<a;++r)(t=i[r]).style.width=n,t.style.height=s},getNodeType:function(e,t){var i=null;switch(e.CLASS_NAME){case"OpenLayers.Geometry.Point":i=t.externalGraphic?"olv:rect":this.isComplexSymbol(t.graphicName)?"olv:shape":"olv:oval";break;case"OpenLayers.Geometry.Rectangle":i="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":i="olv:shape"}return i},setStyle:function(e,t,i,n){t=t||e._style,i=i||e._options;var s=t.fillColor,r=t.title||t.graphicTitle;if(r&&(e.title=r),"OpenLayers.Geometry.Point"===e._geometryClass)if(t.externalGraphic){i.isFilled=!0;var a=t.graphicWidth||t.graphicHeight,o=t.graphicHeight||t.graphicWidth;a=a||2*t.pointRadius,o=o||2*t.pointRadius;var l=this.getResolution(),h=void 0!=t.graphicXOffset?t.graphicXOffset:-.5*a,u=void 0!=t.graphicYOffset?t.graphicYOffset:-.5*o;e.style.left=((n.x-this.featureDx)/l-this.offset.x+h|0)+"px",e.style.top=(n.y/l-this.offset.y-(u+o)|0)+"px",e.style.width=a+"px",e.style.height=o+"px",e.style.flip="y",s="none",i.isStroked=!1}else if(this.isComplexSymbol(t.graphicName)){var p=this.importSymbol(t.graphicName);e.path=p.path,e.coordorigin=p.left+","+p.bottom;var c=p.size;e.coordsize=c+","+c,this.drawCircle(e,n,t.pointRadius),e.style.flip="y"}else this.drawCircle(e,n,t.pointRadius);i.isFilled?e.fillcolor=s:e.filled="false";var d=e.getElementsByTagName("fill"),f=0==d.length?null:d[0];i.isFilled?(f||(f=this.createNode("olv:fill",e.id+"_fill")),f.opacity=t.fillOpacity,"OpenLayers.Geometry.Point"===e._geometryClass&&t.externalGraphic&&(t.graphicOpacity&&(f.opacity=t.graphicOpacity),f.src=t.externalGraphic,f.type="frame",t.graphicWidth&&t.graphicHeight||(f.aspect="atmost")),f.parentNode!=e&&e.appendChild(f)):f&&e.removeChild(f);var m=t.rotation;void 0===m&&void 0===e._rotation||(e._rotation=m,t.externalGraphic?(this.graphicRotate(e,h,u,t),f.opacity=0):"OpenLayers.Geometry.Point"===e._geometryClass&&(e.style.rotation=m||0));var y=e.getElementsByTagName("stroke"),g=0==y.length?null:y[0];return i.isStroked?(g||(g=this.createNode("olv:stroke",e.id+"_stroke"),e.appendChild(g)),g.on=!0,g.color=t.strokeColor,g.weight=t.strokeWidth+"px",g.opacity=t.strokeOpacity,g.endcap="butt"==t.strokeLinecap?"flat":t.strokeLinecap||"round",t.strokeDashstyle&&(g.dashstyle=this.dashStyle(t))):(e.stroked=!1,g&&(g.on=!1)),"inherit"!=t.cursor&&null!=t.cursor&&(e.style.cursor=t.cursor),e},graphicRotate:function(e,t,i,n){var s,r,a=(n=n||e._style).rotation||0;if(!n.graphicWidth||!n.graphicHeight){var o=new Image;return o.onreadystatechange=OpenLayers.Function.bind(function(){"complete"!=o.readyState&&"interactive"!=o.readyState||(s=o.width/o.height,r=Math.max(2*n.pointRadius,n.graphicWidth||0,n.graphicHeight||0),t*=s,n.graphicWidth=r*s,n.graphicHeight=r,this.graphicRotate(e,t,i,n))},this),void(o.src=n.externalGraphic)}r=Math.max(n.graphicWidth,n.graphicHeight),s=n.graphicWidth/n.graphicHeight;var l=Math.round(n.graphicWidth||r*s),h=Math.round(n.graphicHeight||r);e.style.width=l+"px",e.style.height=h+"px";var u=document.getElementById(e.id+"_image");u||(u=this.createNode("olv:imagedata",e.id+"_image"),e.appendChild(u)),u.style.width=l+"px",u.style.height=h+"px",u.src=n.externalGraphic,u.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var p=a*Math.PI/180,c=Math.sin(p),d=Math.cos(p),f="progid:DXImageTransform.Microsoft.Matrix(M11="+d+",M12="+-c+",M21="+c+",M22="+d+",SizingMethod='auto expand')\n",m=n.graphicOpacity||n.fillOpacity;m&&1!=m&&(f+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+m+")\n"),e.style.filter=f;var y=new OpenLayers.Geometry.Point(-t,-i),g=new OpenLayers.Bounds(0,0,l,h).toGeometry();g.rotate(n.rotation,y);var v=g.getBounds();e.style.left=Math.round(parseInt(e.style.left)+v.left)+"px",e.style.top=Math.round(parseInt(e.style.top)-v.bottom)+"px"},postDraw:function(e){e.style.visibility="visible";var t=e._style.fillColor,i=e._style.strokeColor;"none"==t&&e.fillcolor!=t&&(e.fillcolor=t),"none"==i&&e.strokecolor!=i&&(e.strokecolor=i)},setNodeDimension:function(e,t){var i=t.getBounds();if(i){var n=this.getResolution(),s=new OpenLayers.Bounds((i.left-this.featureDx)/n-this.offset.x|0,i.bottom/n-this.offset.y|0,(i.right-this.featureDx)/n-this.offset.x|0,i.top/n-this.offset.y|0);e.style.left=s.left+"px",e.style.top=s.top+"px",e.style.width=s.getWidth()+"px",e.style.height=s.getHeight()+"px",e.coordorigin=s.left+" "+s.top,e.coordsize=s.getWidth()+" "+s.getHeight()}},dashStyle:function(e){var t=e.strokeDashstyle;switch(t){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return t;default:var i=t.split(/[ ,]/);return 2==i.length?1*i[0]>=2*i[1]?"longdash":1==i[0]||1==i[1]?"dot":"dash":4==i.length?1*i[0]>=2*i[1]?"longdashdot":"dashdot":"solid"}},createNode:function(e,t){var i=document.createElement(e);return t&&(i.id=t),i.unselectable="on",i.onselectstart=OpenLayers.Function.False,i},nodeTypeCompare:function(e,t){var i=t,n=i.indexOf(":");-1!=n&&(i=i.substr(n+1));var s=e.nodeName;return-1!=(n=s.indexOf(":"))&&(s=s.substr(n+1)),i==s},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(e){return this.nodeFactory(this.container.id+e,"olv:group")},drawPoint:function(e,t){return this.drawCircle(e,t,1)},drawCircle:function(e,t,i){if(!isNaN(t.x)&&!isNaN(t.y)){var n=this.getResolution();e.style.left=((t.x-this.featureDx)/n-this.offset.x|0)-i+"px",e.style.top=(t.y/n-this.offset.y|0)-i+"px";var s=2*i;return e.style.width=s+"px",e.style.height=s+"px",e}return!1},drawLineString:function(e,t){return this.drawLine(e,t,!1)},drawLinearRing:function(e,t){return this.drawLine(e,t,!0)},drawLine:function(e,t,i){this.setNodeDimension(e,t);for(var n,s,r,a=this.getResolution(),o=t.components.length,l=new Array(o),h=0;h<o;h++)s=((n=t.components[h]).x-this.featureDx)/a-this.offset.x|0,r=n.y/a-this.offset.y|0,l[h]=" "+s+","+r+" l ";var u=i?" x e":" e";return e.path="m"+l.join("")+u,e},drawPolygon:function(e,t){this.setNodeDimension(e,t);var i,n,s,r,a,o,l,h,u,p,c=this.getResolution(),d=[];for(i=0,n=t.components.length;i<n;i++){for(d.push("m"),r=0===i,a=null,o=null,l=0,h=(s=t.components[i].components).length;l<h;l++)p=" "+(((u=s[l]).x-this.featureDx)/c-this.offset.x|0)+","+(u.y/c-this.offset.y|0),d.push(p),0==l&&d.push(" l"),r||(a?a!=p&&(o?o!=p&&(r=!0):o=p):a=p);d.push(r?" x ":" ")}return d.push("e"),e.path=d.join(""),e},drawRectangle:function(e,t){var i=this.getResolution();return e.style.left=((t.x-this.featureDx)/i-this.offset.x|0)+"px",e.style.top=(t.y/i-this.offset.y|0)+"px",e.style.width=(t.width/i|0)+"px",e.style.height=(t.height/i|0)+"px",e},drawText:function(e,t,i){var n=this.nodeFactory(e+this.LABEL_ID_SUFFIX,"olv:rect"),s=this.nodeFactory(e+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox"),r=this.getResolution();n.style.left=((i.x-this.featureDx)/r-this.offset.x|0)+"px",n.style.top=(i.y/r-this.offset.y|0)+"px",n.style.flip="y",s.innerText=t.label,"inherit"!=t.cursor&&null!=t.cursor&&(s.style.cursor=t.cursor),t.fontColor&&(s.style.color=t.fontColor),t.fontOpacity&&(s.style.filter="alpha(opacity="+100*t.fontOpacity+")"),t.fontFamily&&(s.style.fontFamily=t.fontFamily),t.fontSize&&(s.style.fontSize=t.fontSize),t.fontWeight&&(s.style.fontWeight=t.fontWeight),t.fontStyle&&(s.style.fontStyle=t.fontStyle),!0===t.labelSelect&&(n._featureId=e,s._featureId=e,s._geometry=i,s._geometryClass=i.CLASS_NAME),s.style.whiteSpace="nowrap",s.inset="1px,0px,0px,0px",n.parentNode||(n.appendChild(s),this.textRoot.appendChild(n));var a=t.labelAlign||"cm";1==a.length&&(a+="m");var o=s.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[a.substr(0,1)],l=s.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[a.substr(1,1)];n.style.left=parseInt(n.style.left)-o-1+"px",n.style.top=parseInt(n.style.top)+l+"px"},moveRoot:function(e){var t=this.map.getLayer(e.container.id);t instanceof OpenLayers.Layer.Vector.RootContainer&&(t=this.map.getLayer(this.container.id)),t&&t.renderer.clear(),OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments),t&&t.redraw()},importSymbol:function(e){var t=this.container.id+"-"+e,i=this.symbolCache[t];if(i)return i;var n=OpenLayers.Renderer.symbol[e];if(!n)throw new Error(e+" is not a valid symbol name");for(var s=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),r=["m"],a=0;a<n.length;a+=2){var o=n[a],l=n[a+1];s.left=Math.min(s.left,o),s.bottom=Math.min(s.bottom,l),s.right=Math.max(s.right,o),s.top=Math.max(s.top,l),r.push(o),r.push(l),0==a&&r.push("l")}r.push("x e");var h=r.join(" "),u=(s.getWidth()-s.getHeight())/2;return u>0?(s.bottom=s.bottom-u,s.top=s.top+u):(s.left=s.left+u,s.right=s.right-u),i={path:h,size:s.getWidth(),left:s.left,bottom:s.bottom},this.symbolCache[t]=i,i},CLASS_NAME:"OpenLayers.Renderer.VML"}),OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:.5,r:1,t:0,m:.5,b:1},OpenLayers.Control.CacheRead=OpenLayers.Class(OpenLayers.Control,{fetchEvent:"tileloadstart",layers:null,autoActivate:!0,setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);var t,i=this.layers||e.layers;for(t=i.length-1;t>=0;--t)this.addLayer({layer:i[t]});this.layers||e.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})},addLayer:function(e){e.layer.events.register(this.fetchEvent,this,this.fetch)},removeLayer:function(e){e.layer.events.unregister(this.fetchEvent,this,this.fetch)},fetch:function(e){if(this.active&&window.localStorage&&e.tile instanceof OpenLayers.Tile.Image){var t=e.tile,i=t.url;!t.layer.crossOriginKeyword&&OpenLayers.ProxyHost&&0===i.indexOf(OpenLayers.ProxyHost)&&(i=OpenLayers.Control.CacheWrite.urlMap[i]);var n=window.localStorage.getItem("olCache_"+i);n&&(t.url=n,"tileerror"===e.type&&t.setImgSrc(n))}},destroy:function(){if(this.layers||this.map){var e,t=this.layers||this.map.layers;for(e=t.length-1;e>=0;--e)this.removeLayer({layer:t[e]})}this.map&&this.map.events.un({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.CacheRead"}),OpenLayers.Protocol.WFS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_0_0"}),OpenLayers.Format.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Format.XML,{layerIdentifier:"_layer",featureIdentifier:"_feature",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},gmlFormat:null,read:function(e){var t;"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e]));var i=e.documentElement;if(i){var n=this["read_"+i.nodeName];t=n?n.call(this,i):new OpenLayers.Format.GML(this.options?this.options:{}).read(e)}else t=e;return t},read_msGMLOutput:function(e){var t=[],i=this.getSiblingNodesByTagCriteria(e,this.layerIdentifier);if(i)for(var n=0,s=i.length;n<s;++n){var r=i[n],a=r.nodeName;r.prefix&&(a=a.split(":")[1]);var a=a.replace(this.layerIdentifier,""),o=this.getSiblingNodesByTagCriteria(r,this.featureIdentifier);if(o)for(var l=0;l<o.length;l++){var h=o[l],u=this.parseGeometry(h),p=this.parseAttributes(h),c=new OpenLayers.Feature.Vector(u.geometry,p,null);c.bounds=u.bounds,c.type=a,t.push(c)}}return t},read_FeatureInfoResponse:function(e){for(var t=[],i=this.getElementsByTagNameNS(e,"*","FIELDS"),n=0,s=i.length;n<s;n++){var r,a=i[n],o={},l=a.attributes.length;if(l>0)for(r=0;r<l;r++){var h=a.attributes[r];o[h.nodeName]=h.nodeValue}else{var u=a.childNodes;for(r=0,l=u.length;r<l;++r){var p=u[r];3!=p.nodeType&&(o[p.getAttribute("name")]=p.getAttribute("value"))}}t.push(new OpenLayers.Feature.Vector(null,o,null))}return t},getSiblingNodesByTagCriteria:function(e,t){var i,n,s,r,a,o=[];if(e&&e.hasChildNodes()){s=(i=e.childNodes).length;for(var l=0;l<s;l++){for(a=i[l];a&&1!=a.nodeType;)a=a.nextSibling,l++;(n=a?a.nodeName:"").length>0&&n.indexOf(t)>-1?o.push(a):(r=this.getSiblingNodesByTagCriteria(a,t)).length>0&&(0==o.length?o=r:o.push(r))}}return o},parseAttributes:function(e){var t={};if(1==e.nodeType)for(var i=e.childNodes,n=i.length,s=0;s<n;++s){var r=i[s];if(1==r.nodeType){var a=r.childNodes,o=r.prefix?r.nodeName.split(":")[1]:r.nodeName;if(0==a.length)t[o]=null;else if(1==a.length){var l=a[0];if(3==l.nodeType||4==l.nodeType){var h=l.nodeValue.replace(this.regExes.trimSpace,"");t[o]=h}}}}return t},parseGeometry:function(e){this.gmlFormat||(this.gmlFormat=new OpenLayers.Format.GML);var t,i=this.gmlFormat.parseFeature(e),n=null;return i&&(t=i.geometry&&i.geometry.clone(),n=i.bounds&&i.bounds.clone(),i.destroy()),{geometry:t,bounds:n}},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,handler:null,hoverRequest:null,pending:0,initialize:function(e){if(e=e||{},e.handlerOptions=e.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[e]),this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(e.formatOptions)),!0===this.drillDown&&(this.hover=!1),this.hover)this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}));else{var t={};t[this.clickCallback]=this.getInfoForClick,this.handler=new OpenLayers.Handler.Click(this,t,this.handlerOptions.click||{})}},getInfoForClick:function(e){this.request(e.xy,{})},getInfoForHover:function(e){this.request(e.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(--this.pending<=0&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0),this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var e,t=this.layers||this.map.layers,i=[],n=t.length-1;n>=0&&(!((e=t[n])instanceof OpenLayers.Layer.WMTS&&e.requestEncoding===this.requestEncoding)||this.queryVisible&&!e.getVisibility()||(i.push(e),this.drillDown&&!this.hover));--n);return i},buildRequestOptions:function(e,t){var i=this.map.getLonLatFromPixel(t),n=e.getURL(new OpenLayers.Bounds(i.lon,i.lat,i.lon,i.lat)),s=OpenLayers.Util.getParameters(n),r=e.getTileInfo(i);return OpenLayers.Util.extend(s,{service:"WMTS",version:e.version,request:"GetFeatureInfo",infoFormat:this.infoFormat,i:r.i,j:r.j}),OpenLayers.Util.applyDefaults(s,this.vendorParams),{url:OpenLayers.Util.isArray(e.url)?e.url[0]:e.url,params:OpenLayers.Util.upperCaseObject(s),callback:function(i){this.handleResponse(t,i,e)},scope:this}},request:function(e,t){t=t||{};var i=this.findLayers();if(i.length>0){for(var n,s=0,r=i.length;s<r;s++)if(n=i[s],!1!==this.events.triggerEvent("beforegetfeatureinfo",{xy:e,layer:n})){++this.pending;var a=this.buildRequestOptions(n,e),o=OpenLayers.Request.GET(a);!0===t.hover&&(this.hoverRequest=o)}this.pending>0&&OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(e,t,i){if(--this.pending<=0&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0),t.status&&(t.status<200||t.status>=300))this.events.triggerEvent("exception",{xy:e,request:t,layer:i});else{var n=t.responseXML;n&&n.documentElement||(n=t.responseText);var s,r;try{s=this.format.read(n)}catch(n){r=!0,this.events.triggerEvent("exception",{xy:e,request:t,error:n,layer:i})}r||this.events.triggerEvent("getfeatureinfo",{text:t.responseText,features:s,request:t,xy:e,layer:i})}},CLASS_NAME:"OpenLayers.Control.WMTSGetFeatureInfo"}),OpenLayers.Protocol.CSW.v2_0_2=OpenLayers.Class(OpenLayers.Protocol,{formatOptions:null,initialize:function(e){OpenLayers.Protocol.prototype.initialize.apply(this,[e]),e.format||(this.format=new OpenLayers.Format.CSWGetRecords.v2_0_2(OpenLayers.Util.extend({},this.formatOptions)))},destroy:function(){this.options&&!this.options.format&&this.format.destroy(),this.format=null,OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(e){e=OpenLayers.Util.extend({},e),OpenLayers.Util.applyDefaults(e,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.format.write(e.params||e);return t.priv=OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),params:e.params,headers:e.headers,data:i}),t},handleRead:function(e,t){if(t.callback){var i=e.priv;i.status>=200&&i.status<300?(e.data=this.parseData(i),e.code=OpenLayers.Protocol.Response.SUCCESS):e.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,e)}},parseData:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},CLASS_NAME:"OpenLayers.Protocol.CSW.v2_0_2"}),OpenLayers.Format.WCSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1,{namespaces:{wcs:"http://www.opengis.net/wcs/1.1",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows/1.1"},errorProperty:"operationsMetadata",readers:{wcs:OpenLayers.Util.applyDefaults({Capabilities:function(e,t){this.readChildNodes(e,t)},Contents:function(e,t){t.contentMetadata=[],this.readChildNodes(e,t.contentMetadata)},CoverageSummary:function(e,t){var i={};this.readChildNodes(e,i),t.push(i)},Identifier:function(e,t){t.identifier=this.getChildValue(e)},Title:function(e,t){t.title=this.getChildValue(e)},Abstract:function(e,t){t.abstract=this.getChildValue(e)},SupportedCRS:function(e,t){var i=this.getChildValue(e);i&&(t.supportedCRS||(t.supportedCRS=[]),t.supportedCRS.push(i))},SupportedFormat:function(e,t){var i=this.getChildValue(e);i&&(t.supportedFormat||(t.supportedFormat=[]),t.supportedFormat.push(i))}},OpenLayers.Format.WCSCapabilities.v1.prototype.readers.wcs),ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1_1_0"}),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(e){(e=e||{}).layerName=e.layerName||OpenLayers.i18n("Graticule"),OpenLayers.Control.prototype.initialize.apply(this,[e]),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 e=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:e}),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)},deactivate:function(){return!!OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.map.events.unregister("moveend",this,this.update),this.map.removeLayer(this.gratLayer),!0)},update:function(){var e=this.map.getExtent();if(e){this.gratLayer.destroyFeatures();var t=new OpenLayers.Projection("EPSG:4326"),i=this.map.getProjectionObject(),n=this.map.getResolution();i.proj&&"longlat"==i.proj.projName&&(this.numPoints=1);var s=this.map.getCenter(),r=new OpenLayers.Pixel(s.lon,s.lat);OpenLayers.Projection.transform(r,i,t);var a=this.targetSize*n;a*=a;for(var o,l=0;l<this.intervals.length;++l){var h=(o=this.intervals[l])/2,u=r.offset({x:-h,y:-h}),p=r.offset({x:h,y:h});if(OpenLayers.Projection.transform(u,t,i),OpenLayers.Projection.transform(p,t,i),(u.x-p.x)*(u.x-p.x)+(u.y-p.y)*(u.y-p.y)<=a)break}r.x=Math.floor(r.x/o)*o,r.y=Math.floor(r.y/o)*o;var c,d=0,f=[r.clone()],m=r.clone();do{m=m.offset({x:0,y:o}),c=OpenLayers.Projection.transform(m.clone(),t,i),f.unshift(m)}while(e.containsPixel(c)&&++d<1e3);m=r.clone();do{m=m.offset({x:0,y:-o}),c=OpenLayers.Projection.transform(m.clone(),t,i),f.push(m)}while(e.containsPixel(c)&&++d<1e3);d=0;var y=[r.clone()];m=r.clone();do{m=m.offset({x:-o,y:0}),c=OpenLayers.Projection.transform(m.clone(),t,i),y.unshift(m)}while(e.containsPixel(c)&&++d<1e3);m=r.clone();do{m=m.offset({x:o,y:0}),c=OpenLayers.Projection.transform(m.clone(),t,i),y.push(m)}while(e.containsPixel(c)&&++d<1e3);for(var g=[],l=0;l<y.length;++l){for(var v=y[l].x,L=[],O=null,b=Math.min(f[0].y,90),w=Math.max(f[f.length-1].y,-90),S=(b-w)/this.numPoints,C=w,x=0;x<=this.numPoints;++x)(M=new OpenLayers.Geometry.Point(v,C)).transform(t,i),L.push(M),C+=S,M.y>=e.bottom&&!O&&(O=M);if(this.labelled){var _=new OpenLayers.Geometry.Point(O.x,e.bottom),E={value:v,label:this.labelled?OpenLayers.Util.getFormattedLonLat(v,"lon",this.labelFormat):"",labelAlign:"cb",xOffset:0,yOffset:2};this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(_,E))}T=new OpenLayers.Geometry.LineString(L);g.push(new OpenLayers.Feature.Vector(T))}for(x=0;x<f.length;++x)if(!((C=f[x].y)<-90||C>90)){for(var L=[],N=y[0].x,P=(y[y.length-1].x-N)/this.numPoints,v=N,O=null,l=0;l<=this.numPoints;++l){var M=new OpenLayers.Geometry.Point(v,C);M.transform(t,i),L.push(M),v+=P,M.x<e.right&&(O=M)}if(this.labelled){var _=new OpenLayers.Geometry.Point(e.right,O.y),E={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(_,E))}var T=new OpenLayers.Geometry.LineString(L);g.push(new OpenLayers.Feature.Vector(T))}this.gratLayer.addFeatures(g)}},CLASS_NAME:"OpenLayers.Control.Graticule"}),OpenLayers.Console.warn("OpenLayers.Rico is deprecated"),OpenLayers.Rico=OpenLayers.Rico||{},OpenLayers.Rico.Corner={round:function(e,t){e=OpenLayers.Util.getElement(e),this._setOptions(t);var i=this.options.color;"fromElement"==this.options.color&&(i=this._background(e));var n=this.options.bgColor;"fromParent"==this.options.bgColor&&(n=this._background(e.offsetParent)),this._roundCornersImpl(e,i,n)},changeColor:function(e,t){e.style.backgroundColor=t;for(var i=e.parentNode.getElementsByTagName("span"),n=0;n<i.length;n++)i[n].style.backgroundColor=t},changeOpacity:function(e,t){var i=t,n="alpha(opacity="+100*t+")";e.style.opacity=i,e.style.filter=n;for(var s=e.parentNode.getElementsByTagName("span"),r=0;r<s.length;r++)s[r].style.opacity=i,s[r].style.filter=n},reRound:function(e,t){var i=e.parentNode.childNodes[0],n=e.parentNode.childNodes[2];e.parentNode.removeChild(i),e.parentNode.removeChild(n),this.round(e.parentNode,t)},_roundCornersImpl:function(e,t,i){this.options.border&&this._renderBorder(e,i),this._isTopRounded()&&this._roundTopCorners(e,t,i),this._isBottomRounded()&&this._roundBottomCorners(e,t,i)},_renderBorder:function(e,t){var i="1px solid "+this._borderColor(t),n="style='"+("border-left: "+i)+";"+("border-right: "+i)+"'";e.innerHTML="<div "+n+">"+e.innerHTML+"</div>"},_roundTopCorners:function(e,t,i){for(var n=this._createCorner(i),s=0;s<this.options.numSlices;s++)n.appendChild(this._createCornerSlice(t,i,s,"top"));e.style.paddingTop=0,e.insertBefore(n,e.firstChild)},_roundBottomCorners:function(e,t,i){for(var n=this._createCorner(i),s=this.options.numSlices-1;s>=0;s--)n.appendChild(this._createCornerSlice(t,i,s,"bottom"));e.style.paddingBottom=0,e.appendChild(n)},_createCorner:function(e){var t=document.createElement("div");return t.style.backgroundColor=this._isTransparent()?"transparent":e,t},_createCornerSlice:function(e,t,i,n){var s=document.createElement("span"),r=s.style;r.backgroundColor=e,r.display="block",r.height="1px",r.overflow="hidden",r.fontSize="1px";var a=this._borderColor(e,t);return this.options.border&&0==i?(r.borderTopStyle="solid",r.borderTopWidth="1px",r.borderLeftWidth="0px",r.borderRightWidth="0px",r.borderBottomWidth="0px",r.height="0px",r.borderColor=a):a&&(r.borderColor=a,r.borderStyle="solid",r.borderWidth="0px 1px"),this.options.compact||i!=this.options.numSlices-1||(r.height="2px"),this._setMargin(s,i,n),this._setBorder(s,i,n),s},_setOptions:function(e){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:!0,border:!1,compact:!1},OpenLayers.Util.extend(this.options,e||{}),this.options.numSlices=this.options.compact?2:4,this._isTransparent()&&(this.options.blend=!1)},_whichSideTop:function(){return this._hasString(this.options.corners,"all","top")?"":this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0?"":this.options.corners.indexOf("tl")>=0?"left":this.options.corners.indexOf("tr")>=0?"right":""},_whichSideBottom:function(){return this._hasString(this.options.corners,"all","bottom")?"":this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0?"":this.options.corners.indexOf("bl")>=0?"left":this.options.corners.indexOf("br")>=0?"right":""},_borderColor:function(e,t){return"transparent"==e?t:this.options.border?this.options.border:this.options.blend?this._blend(t,e):""},_setMargin:function(e,t,i){var n=this._marginSize(t),s="top"==i?this._whichSideTop():this._whichSideBottom();"left"==s?(e.style.marginLeft=n+"px",e.style.marginRight="0px"):"right"==s?(e.style.marginRight=n+"px",e.style.marginLeft="0px"):(e.style.marginLeft=n+"px",e.style.marginRight=n+"px")},_setBorder:function(e,t,i){var n=this._borderSize(t),s="top"==i?this._whichSideTop():this._whichSideBottom();"left"==s?(e.style.borderLeftWidth=n+"px",e.style.borderRightWidth="0px"):"right"==s?(e.style.borderRightWidth=n+"px",e.style.borderLeftWidth="0px"):(e.style.borderLeftWidth=n+"px",e.style.borderRightWidth=n+"px"),0!=this.options.border&&(e.style.borderLeftWidth=n+"px",e.style.borderRightWidth=n+"px")},_marginSize:function(e){if(this._isTransparent())return 0;var t=[5,3,2,1],i=[3,2,1,0],n=[2,1],s=[1,0];return this.options.compact&&this.options.blend?s[e]:this.options.compact?n[e]:this.options.blend?i[e]:t[e]},_borderSize:function(e){var t=[5,3,2,1],i=[2,1,1,1],n=[1,0],s=[0,2,0,0];return this.options.compact&&(this.options.blend||this._isTransparent())?1:this.options.compact?n[e]:this.options.blend?i[e]:this.options.border?s[e]:this._isTransparent()?t[e]:0},_hasString:function(e){for(var t=1;t<arguments.length;t++)if(e.indexOf(arguments[t])>=0)return!0;return!1},_blend:function(e,t){var i=OpenLayers.Rico.Color.createFromHex(e);return i.blend(OpenLayers.Rico.Color.createFromHex(t)),i},_background:function(e){try{return OpenLayers.Rico.Color.createColorFromBackground(e).asHex()}catch(e){return"#ffffff"}},_isTransparent:function(){return"transparent"==this.options.color},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(e){return 1==e.childNodes.length&&3==e.childNodes[0].nodeType}},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(e){OpenLayers.Control.prototype.initialize.apply(this,[e]),this.registry=OpenLayers.Util.extend({moveend:this.getState},this.registry);var t={trigger:OpenLayers.Function.bind(this.previousTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(t,this.previousOptions),this.previous=new OpenLayers.Control.Button(t);var i={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(i,this.nextOptions),this.next=new OpenLayers.Control.Button(i),this.clear()},onPreviousChange:function(e,t){e&&!this.previous.active?this.previous.activate():!e&&this.previous.active&&this.previous.deactivate()},onNextChange:function(e,t){e&&!this.next.active?this.next.activate():!e&&this.next.active&&this.next.deactivate()},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this),this.previous.destroy(),this.next.destroy(),this.deactivate();for(var e in this)this[e]=null},setMap:function(e){this.map=e,this.next.setMap(e),this.previous.setMap(e)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments),this.next.draw(),this.previous.draw()},previousTrigger:function(){var e=this.previousStack.shift(),t=this.previousStack.shift();return void 0!=t?(this.nextStack.unshift(e),this.previousStack.unshift(t),this.restoring=!0,this.restore(t),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)):this.previousStack.unshift(e),t},nextTrigger:function(){var e=this.nextStack.shift();return void 0!=e&&(this.previousStack.unshift(e),this.restoring=!0,this.restore(e),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)),e},clear:function(){this.previousStack=[],this.previous.deactivate(),this.nextStack=[],this.next.deactivate()},getState:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution(),projection:this.map.getProjectionObject(),units:this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units}},restore:function(e){var t,i;if(this.map.getProjectionObject()==e.projection)i=this.map.getZoomForResolution(e.resolution),t=e.center;else{(t=e.center.clone()).transform(e.projection,this.map.getProjectionObject());var n=e.units,s=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,r=n&&s?OpenLayers.INCHES_PER_UNIT[n]/OpenLayers.INCHES_PER_UNIT[s]:1;i=this.map.getZoomForResolution(r*e.resolution)}this.map.setCenter(t,i)},setListeners:function(){this.listeners={};for(var e in this.registry)this.listeners[e]=OpenLayers.Function.bind(function(){if(!this.restoring){var t=this.registry[e].apply(this,arguments);this.previousStack.unshift(t),this.previousStack.length>1&&this.onPreviousChange(this.previousStack[1],this.previousStack.length-1),this.previousStack.length>this.limit+1&&this.previousStack.pop(),this.nextStack.length>0&&(this.nextStack=[],this.onNextChange(null,0))}return!0},this)},activate:function(){var e=!1;if(this.map&&OpenLayers.Control.prototype.activate.apply(this)){null==this.listeners&&this.setListeners();for(var t in this.listeners)this.map.events.register(t,this,this.listeners[t]);e=!0,0==this.previousStack.length&&this.initStack()}return e},initStack:function(){this.map.getCenter()&&this.listeners.moveend()},deactivate:function(){var e=!1;if(this.map&&OpenLayers.Control.prototype.deactivate.apply(this)){for(var t in this.listeners)this.map.events.unregister(t,this,this.listeners[t]);this.clearOnDeactivate&&this.clear(),e=!0}return e},CLASS_NAME:"OpenLayers.Control.NavigationHistory"}),OpenLayers.Layer.UTFGrid=OpenLayers.Class(OpenLayers.Layer.XYZ,{isBaseLayer:!1,projection:new OpenLayers.Projection("EPSG:900913"),useJSONP:!1,tileClass:OpenLayers.Tile.UTFGrid,initialize:function(e){OpenLayers.Layer.Grid.prototype.initialize.apply(this,[e.name,e.url,{},e]),this.tileOptions=OpenLayers.Util.extend({utfgridResolution:this.utfgridResolution},this.tileOptions)},createBackBuffer:function(){},clone:function(e){return null==e&&(e=new OpenLayers.Layer.UTFGrid(this.getOptions())),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getFeatureInfo:function(e){var t=null,i=this.getTileData(e);return i&&i.tile&&(t=i.tile.getFeatureInfo(i.i,i.j)),t},getFeatureId:function(e){var t=null,i=this.getTileData(e);return i.tile&&(t=i.tile.getFeatureId(i.i,i.j)),t},CLASS_NAME:"OpenLayers.Layer.UTFGrid"}),OpenLayers.TileManager=OpenLayers.Class({cacheSize:256,tilesPerFrame:2,frameDelay:16,moveDelay:100,zoomDelay:200,maps:null,tileQueueId:null,tileQueue:null,tileCache:null,tileCacheIndex:null,initialize:function(e){OpenLayers.Util.extend(this,e),this.maps=[],this.tileQueueId={},this.tileQueue={},this.tileCache={},this.tileCacheIndex=[]},addMap:function(e){if(!this._destroyed&&OpenLayers.Layer.Grid){this.maps.push(e),this.tileQueue[e.id]=[];for(var t=0,i=e.layers.length;t<i;++t)this.addLayer({layer:e.layers[t]});e.events.on({move:this.move,zoomend:this.zoomEnd,changelayer:this.changeLayer,addlayer:this.addLayer,preremovelayer:this.removeLayer,scope:this})}},removeMap:function(e){if(!this._destroyed&&OpenLayers.Layer.Grid){if(window.clearTimeout(this.tileQueueId[e.id]),e.layers)for(var t=0,i=e.layers.length;t<i;++t)this.removeLayer({layer:e.layers[t]});e.events&&e.events.un({move:this.move,zoomend:this.zoomEnd,changelayer:this.changeLayer,addlayer:this.addLayer,preremovelayer:this.removeLayer,scope:this}),delete this.tileQueue[e.id],delete this.tileQueueId[e.id],OpenLayers.Util.removeItem(this.maps,e)}},move:function(e){this.updateTimeout(e.object,this.moveDelay,!0)},zoomEnd:function(e){this.updateTimeout(e.object,this.zoomDelay)},changeLayer:function(e){"visibility"!==e.property&&"params"!==e.property||this.updateTimeout(e.object,0)},addLayer:function(e){var t=e.layer;if(t instanceof OpenLayers.Layer.Grid){t.events.on({addtile:this.addTile,retile:this.clearTileQueue,scope:this});var i,n,s;for(i=t.grid.length-1;i>=0;--i)for(n=t.grid[i].length-1;n>=0;--n)s=t.grid[i][n],this.addTile({tile:s}),s.url&&!s.imgDiv&&this.manageTileCache({object:s})}},removeLayer:function(e){var t=e.layer;if(t instanceof OpenLayers.Layer.Grid&&(this.clearTileQueue({object:t}),t.events&&t.events.un({addtile:this.addTile,retile:this.clearTileQueue,scope:this}),t.grid)){var i,n,s;for(i=t.grid.length-1;i>=0;--i)for(n=t.grid[i].length-1;n>=0;--n)s=t.grid[i][n],this.unloadTile({object:s})}},updateTimeout:function(e,t,i){window.clearTimeout(this.tileQueueId[e.id]);var n=this.tileQueue[e.id];i&&!n.length||(this.tileQueueId[e.id]=window.setTimeout(OpenLayers.Function.bind(function(){this.drawTilesFromQueue(e),n.length&&this.updateTimeout(e,this.frameDelay)},this),t))},addTile:function(e){e.tile instanceof OpenLayers.Tile.Image?e.tile.events.on({beforedraw:this.queueTileDraw,beforeload:this.manageTileCache,loadend:this.addToCache,unload:this.unloadTile,scope:this}):this.removeLayer({layer:e.tile.layer})},unloadTile:function(e){var t=e.object;t.events.un({beforedraw:this.queueTileDraw,beforeload:this.manageTileCache,loadend:this.addToCache,unload:this.unloadTile,scope:this}),OpenLayers.Util.removeItem(this.tileQueue[t.layer.map.id],t)},queueTileDraw:function(e){var t=e.object,i=!1,n=t.layer,s=n.getURL(t.bounds),r=this.tileCache[s];if(r&&"olTileImage"!==r.className&&(delete this.tileCache[s],OpenLayers.Util.removeItem(this.tileCacheIndex,s),r=null),n.url&&(n.async||!r)){var a=this.tileQueue[n.map.id];~OpenLayers.Util.indexOf(a,t)||a.push(t),i=!0}return!i},drawTilesFromQueue:function(e){for(var t=this.tileQueue[e.id],i=this.tilesPerFrame,n=e.zoomTween&&e.zoomTween.playing;!n&&t.length&&i;)t.shift().draw(!0),--i},manageTileCache:function(e){var t=e.object,i=this.tileCache[t.url];i&&(i.parentNode&&OpenLayers.Element.hasClass(i.parentNode,"olBackBuffer")&&(i.parentNode.removeChild(i),i.id=null),i.parentNode||(i.style.visibility="hidden",i.style.opacity=0,t.setImage(i),OpenLayers.Util.removeItem(this.tileCacheIndex,t.url),this.tileCacheIndex.push(t.url)))},addToCache:function(e){var t=e.object;this.tileCache[t.url]||OpenLayers.Element.hasClass(t.imgDiv,"olImageLoadError")||(this.tileCacheIndex.length>=this.cacheSize&&(delete this.tileCache[this.tileCacheIndex[0]],this.tileCacheIndex.shift()),this.tileCache[t.url]=t.imgDiv,this.tileCacheIndex.push(t.url))},clearTileQueue:function(e){for(var t=e.object,i=this.tileQueue[t.map.id],n=i.length-1;n>=0;--n)i[n].layer===t&&i.splice(n,1)},destroy:function(){for(var e=this.maps.length-1;e>=0;--e)this.removeMap(this.maps[e]);this.maps=null,this.tileQueue=null,this.tileQueueId=null,this.tileCache=null,this.tileCacheIndex=null,this._destroyed=!0}}),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(e,t,i){if(OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments),this.resolutions&&(this.serverResolutions=this.resolutions,this.maxExtent=this.getMaxExtentForResolution(this.resolutions[0])),this.layerInfo){var n=this.layerInfo,s=new OpenLayers.Bounds(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax);if(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);var r=new OpenLayers.Geometry.Point(s.left,s.top),a=new OpenLayers.Geometry.Point(s.right,s.bottom);this.useScales?this.scales=[]:this.resolutions=[],this.lods=[];for(var o in n.tileInfo.lods)if(n.tileInfo.lods.hasOwnProperty(o)){var l=n.tileInfo.lods[o];this.useScales?this.scales.push(l.scale):this.resolutions.push(l.resolution);var h=this.getContainingTileCoords(r,l.resolution);l.startTileCol=h.x,l.startTileRow=h.y;var u=this.getContainingTileCoords(a,l.resolution);l.endTileCol=u.x,l.endTileRow=u.y,this.lods.push(l)}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(e,t){return new OpenLayers.Pixel(Math.max(Math.floor((e.x-this.tileOrigin.lon)/(this.tileSize.w*t)),0),Math.max(Math.floor((this.tileOrigin.lat-e.y)/(this.tileSize.h*t)),0))},calculateMaxExtentWithLOD:function(e){var t=e.endTileCol-e.startTileCol+1,i=e.endTileRow-e.startTileRow+1,n=this.tileOrigin.lon+e.startTileCol*this.tileSize.w*e.resolution,s=n+t*this.tileSize.w*e.resolution,r=this.tileOrigin.lat-e.startTileRow*this.tileSize.h*e.resolution,a=r-i*this.tileSize.h*e.resolution;return new OpenLayers.Bounds(n,a,s,r)},calculateMaxExtentWithExtent:function(e,t){var i=new OpenLayers.Geometry.Point(e.left,e.top),n=new OpenLayers.Geometry.Point(e.right,e.bottom),s=this.getContainingTileCoords(i,t),r=this.getContainingTileCoords(n,t),a={resolution:t,startTileCol:s.x,startTileRow:s.y,endTileCol:r.x,endTileRow:r.y};return this.calculateMaxExtentWithLOD(a)},getUpperLeftTileCoord:function(e){var t=new OpenLayers.Geometry.Point(this.maxExtent.left,this.maxExtent.top);return this.getContainingTileCoords(t,e)},getLowerRightTileCoord:function(e){var t=new OpenLayers.Geometry.Point(this.maxExtent.right,this.maxExtent.bottom);return this.getContainingTileCoords(t,e)},getMaxExtentForResolution:function(e){var t=this.getUpperLeftTileCoord(e),i=this.getLowerRightTileCoord(e),n=i.x-t.x+1,s=i.y-t.y+1,r=this.tileOrigin.lon+t.x*this.tileSize.w*e,a=r+n*this.tileSize.w*e,o=this.tileOrigin.lat-t.y*this.tileSize.h*e,l=o-s*this.tileSize.h*e;return new OpenLayers.Bounds(r,l,a,o)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.ArcGISCache(this.name,this.url,this.options)),OpenLayers.Layer.XYZ.prototype.clone.apply(this,[e])},initGriddedTiles:function(e){delete this._tileOrigin,OpenLayers.Layer.XYZ.prototype.initGriddedTiles.apply(this,arguments)},getMaxExtent:function(){var e=this.map.getResolution();return this.maxExtent=this.getMaxExtentForResolution(e)},getTileOrigin:function(){if(!this._tileOrigin){var e=this.getMaxExtent();this._tileOrigin=new OpenLayers.LonLat(e.left,e.bottom)}return this._tileOrigin},getURL:function(e){var t=this.getResolution(),i=this.tileOrigin.lon+t*this.tileSize.w/2,n=this.tileOrigin.lat-t*this.tileSize.h/2,s=e.getCenterLonLat(),r=(s.lon,s.lat,Math.round(Math.abs((s.lon-i)/(t*this.tileSize.w)))),a=Math.round(Math.abs((n-s.lat)/(t*this.tileSize.h))),o=this.map.getZoom();if(this.lods){var l=this.lods[this.map.getZoom()];if(r<l.startTileCol||r>l.endTileCol||a<l.startTileRow||a>l.endTileRow)return null}else{var h=this.getUpperLeftTileCoord(t),u=this.getLowerRightTileCoord(t);if(r<h.x||r>=u.x||a<h.y||a>=u.y)return null}var p=this.url,c=""+r+a+o;return OpenLayers.Util.isArray(p)&&(p=this.selectUrl(c,p)),this.useArcGISServer?p+="/tile/${z}/${y}/${x}":(r="C"+OpenLayers.Number.zeroPad(r,8,16),a="R"+OpenLayers.Number.zeroPad(a,8,16),o="L"+OpenLayers.Number.zeroPad(o,2,10),p=p+"/${z}/${y}/${x}."+this.type),p=OpenLayers.String.format(p,{x:r,y:a,z:o}),OpenLayers.Util.urlAppend(p,OpenLayers.Util.getParameterString(this.params))},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,handler:null,hoverRequest:null,initialize:function(e){if(e=e||{},e.handlerOptions=e.handlerOptions||{},OpenLayers.Control.prototype.initialize.apply(this,[e]),this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(e.formatOptions)),!0===this.drillDown&&(this.hover=!1),this.hover)this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250}));else{var t={};t[this.clickCallback]=this.getInfoForClick,this.handler=new OpenLayers.Handler.Click(this,t,this.handlerOptions.click||{})}},getInfoForClick:function(e){this.events.triggerEvent("beforegetfeatureinfo",{xy:e.xy}),OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait"),this.request(e.xy,{})},getInfoForHover:function(e){this.events.triggerEvent("beforegetfeatureinfo",{xy:e.xy}),this.request(e.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var e,t,i=this.layers||this.map.layers,n=[],s=i.length-1;s>=0;--s)(e=i[s])instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||e.getVisibility())&&(t=OpenLayers.Util.isArray(e.url)?e.url[0]:e.url,!1!==this.drillDown||this.url||(this.url=t),(!0===this.drillDown||this.urlMatches(t))&&n.push(e));return n},urlMatches:function(e){var t=OpenLayers.Util.isEquivalentUrl(this.url,e);if(!t&&this.layerUrls)for(var i=0,n=this.layerUrls.length;i<n;++i)if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[i],e)){t=!0;break}return t},buildWMSOptions:function(e,t,i,n){for(var s=[],r=[],a=0,o=t.length;a<o;a++)null!=t[a].params.LAYERS&&(s=s.concat(t[a].params.LAYERS),r=r.concat(this.getStyleNames(t[a])));var l=t[0],h=this.map.getProjection(),u=l.projection;u&&u.equals(this.map.getProjectionObject())&&(h=u.getCode());var p=OpenLayers.Util.extend({service:"WMS",version:l.params.VERSION,request:"GetFeatureInfo",exceptions:l.params.EXCEPTIONS,bbox:this.map.getExtent().toBBOX(null,l.reverseAxisOrder()),feature_count:this.maxFeatures,height:this.map.getSize().h,width:this.map.getSize().w,format:n,info_format:l.params.INFO_FORMAT||this.infoFormat},parseFloat(l.params.VERSION)>=1.3?{crs:h,i:parseInt(i.x),j:parseInt(i.y)}:{srs:h,x:parseInt(i.x),y:parseInt(i.y)});return 0!=s.length&&(p=OpenLayers.Util.extend({layers:s,query_layers:s,styles:r},p)),OpenLayers.Util.applyDefaults(p,this.vendorParams),{url:e,params:OpenLayers.Util.upperCaseObject(p),callback:function(t){this.handleResponse(i,t,e)},scope:this}},getStyleNames:function(e){return e.params.STYLES?e.params.STYLES:OpenLayers.Util.isArray(e.params.LAYERS)?new Array(e.params.LAYERS.length):e.params.LAYERS.replace(/[^,]/g,"")},request:function(e,t){if(0==(l=this.findLayers()).length)return this.events.triggerEvent("nogetfeatureinfo"),void OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait");if(t=t||{},!1===this.drillDown){var i=this.buildWMSOptions(this.url,l,e,l[0].params.FORMAT),n=OpenLayers.Request.GET(i);!0===t.hover&&(this.hoverRequest=n)}else{this._requestCount=0,this._numRequests=0,this.features=[];for(var s={},r=0,a=l.length;r<a;r++){var o=l[r];(h=OpenLayers.Util.isArray(o.url)?o.url[0]:o.url)in s?s[h].push(o):(this._numRequests++,s[h]=[o])}var l;for(var h in s){l=s[h];i=this.buildWMSOptions(h,l,e,l[0].params.FORMAT);OpenLayers.Request.GET(i)}}},triggerGetFeatureInfo:function(e,t,i){this.events.triggerEvent("getfeatureinfo",{text:e.responseText,features:i,request:e,xy:t}),OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},handleResponse:function(e,t,i){var n=t.responseXML;n&&n.documentElement||(n=t.responseText);var s=this.format.read(n);!1===this.drillDown?this.triggerGetFeatureInfo(t,e,s):(this._requestCount++,"object"===this.output?this._features=(this._features||[]).concat({url:i,features:s}):this._features=(this._features||[]).concat(s),this._requestCount===this._numRequests&&(this.triggerGetFeatureInfo(t,e,this._features.concat()),delete this._features,delete this._requestCount,delete this._numRequests))},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"}),OpenLayers.Format.WMSCapabilities.v1_3_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_3,{version:"1.3.0",CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3_0"}),OpenLayers.Format.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(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={features:[]};this.readNode(e,t);for(var i=[],n=0,s=t.features.length;n<s;n++){var r=t.features[n];this.internalProjection&&this.externalProjection&&r.components[0]&&r.components[0].transform(this.externalProjection,this.internalProjection);var a=new OpenLayers.Feature.Vector(r.components[0],r.attributes);i.push(a)}return i},readers:{sa:{SamplingPoint:function(e,t){if(!t.attributes){var i={attributes:{}};t.features.push(i),t=i}t.attributes.id=this.getAttributeNS(e,this.namespaces.gml,"id"),this.readChildNodes(e,t)},position:function(e,t){this.readChildNodes(e,t)}},gml:OpenLayers.Util.applyDefaults({FeatureCollection:function(e,t){this.readChildNodes(e,t)},featureMember:function(e,t){var i={attributes:{}};t.features.push(i),this.readChildNodes(e,i)},name:function(e,t){t.attributes.name=this.getChildValue(e)},pos:function(e,t){this.externalProjection||(this.externalProjection=new OpenLayers.Projection(e.getAttribute("srsName"))),OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[e,t])}},OpenLayers.Format.GML.v3.prototype.readers.gml)},writers:{sos:{GetFeatureOfInterest:function(e){for(var t=this.createElementNSPlus("GetFeatureOfInterest",{attributes:{version:this.VERSION,service:"SOS","xsi:schemaLocation":this.schemaLocation}}),i=0,n=e.fois.length;i<n;i++)this.writeNode("FeatureOfInterestId",{foi:e.fois[i]},t);return t},FeatureOfInterestId:function(e){return this.createElementNSPlus("FeatureOfInterestId",{value:e.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(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={measurements:[],observations:[]};return this.readNode(e,t),t},write:function(e){var t=this.writeNode("sos:GetObservation",e);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(e,t){t.id=this.getAttributeNS(e,this.namespaces.gml,"id"),this.readChildNodes(e,t)},member:function(e,t){this.readChildNodes(e,t)},Measurement:function(e,t){var i={};t.measurements.push(i),this.readChildNodes(e,i)},Observation:function(e,t){var i={};t.observations.push(i),this.readChildNodes(e,i)},samplingTime:function(e,t){var i={};t.samplingTime=i,this.readChildNodes(e,i)},observedProperty:function(e,t){t.observedProperty=this.getAttributeNS(e,this.namespaces.xlink,"href"),this.readChildNodes(e,t)},procedure:function(e,t){t.procedure=this.getAttributeNS(e,this.namespaces.xlink,"href"),this.readChildNodes(e,t)},featureOfInterest:function(e,t){var i={features:[]};t.fois=[],t.fois.push(i),this.readChildNodes(e,i);for(var n=[],s=0,r=i.features.length;s<r;s++){var a=i.features[s];n.push(new OpenLayers.Feature.Vector(a.components[0],a.attributes))}i.features=n},result:function(e,t){var i={};t.result=i,""!==this.getChildValue(e)?(i.value=this.getChildValue(e),i.uom=e.getAttribute("uom")):this.readChildNodes(e,i)}},sa:OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.sa,gml:OpenLayers.Util.applyDefaults({TimeInstant:function(e,t){var i={};t.timeInstant=i,this.readChildNodes(e,i)},timePosition:function(e,t){t.timePosition=this.getChildValue(e)}},OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.gml)},writers:{sos:{GetObservation:function(e){var t=this.createElementNSPlus("GetObservation",{attributes:{version:this.VERSION,service:"SOS"}});this.writeNode("offering",e,t),e.eventTime&&this.writeNode("eventTime",e,t);for(var i in e.procedures)this.writeNode("procedure",e.procedures[i],t);for(var n in e.observedProperties)this.writeNode("observedProperty",e.observedProperties[n],t);return e.foi&&this.writeNode("featureOfInterest",e.foi,t),this.writeNode("responseFormat",e,t),e.resultModel&&this.writeNode("resultModel",e,t),e.responseMode&&this.writeNode("responseMode",e,t),t},featureOfInterest:function(e){var t=this.createElementNSPlus("featureOfInterest");return this.writeNode("ObjectID",e.objectId,t),t},ObjectID:function(e){return this.createElementNSPlus("ObjectID",{value:e})},responseFormat:function(e){return this.createElementNSPlus("responseFormat",{value:e.responseFormat})},procedure:function(e){return this.createElementNSPlus("procedure",{value:e})},offering:function(e){return this.createElementNSPlus("offering",{value:e.offering})},observedProperty:function(e){return this.createElementNSPlus("observedProperty",{value:e})},eventTime:function(e){var t=this.createElementNSPlus("eventTime");return"latest"===e.eventTime&&this.writeNode("ogc:TM_Equals",e,t),t},resultModel:function(e){return this.createElementNSPlus("resultModel",{value:e.resultModel})},responseMode:function(e){return this.createElementNSPlus("responseMode",{value:e.responseMode})}},ogc:{TM_Equals:function(e){var t=this.createElementNSPlus("ogc:TM_Equals");return this.writeNode("ogc:PropertyName",{property:"urn:ogc:data:time:iso8601"},t),"latest"===e.eventTime&&this.writeNode("gml:TimeInstant",{value:"latest"},t),t},PropertyName:function(e){return this.createElementNSPlus("ogc:PropertyName",{value:e.property})}},gml:{TimeInstant:function(e){var t=this.createElementNSPlus("gml:TimeInstant");return this.writeNode("gml:timePosition",e,t),t},timePosition:function(e){return this.createElementNSPlus("gml:timePosition",{value:e.value})}}},CLASS_NAME:"OpenLayers.Format.SOSGetObservation"}),OpenLayers.Control.UTFGrid=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,layers:null,defaultHandlerOptions:{delay:300,pixelTolerance:4,stopMove:!1,single:!0,double:!1,stopSingle:!1,stopDouble:!1},handlerMode:"click",setHandler:function(e){this.handlerMode=e,this.resetHandler()},resetHandler:function(){return this.handler&&(this.handler.deactivate(),this.handler.destroy(),this.handler=null),"hover"==this.handlerMode?this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.reset},this.handlerOptions):"click"==this.handlerMode?this.handler=new OpenLayers.Handler.Click(this,{click:this.handleEvent},this.handlerOptions):"move"==this.handlerMode&&(this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.handleEvent},this.handlerOptions)),!!this.handler},initialize:function(e){(e=e||{}).handlerOptions=e.handlerOptions||this.defaultHandlerOptions,OpenLayers.Control.prototype.initialize.apply(this,[e]),this.resetHandler()},handleEvent:function(e){if(null!=e){var t=this.map.getLonLatFromPixel(e.xy);if(t){var i=this.findLayers();if(i.length>0){for(var n,s={},r=0,a=i.length;r<a;r++)n=i[r],s[OpenLayers.Util.indexOf(this.map.layers,n)]=n.getFeatureInfo(t);this.callback(s,t,e.xy)}}}else this.reset()},callback:function(e){},reset:function(e){this.callback(null)},findLayers:function(){for(var e,t=this.layers||this.map.layers,i=[],n=t.length-1;n>=0;--n)(e=t[n])instanceof OpenLayers.Layer.UTFGrid&&i.push(e);return i},CLASS_NAME:"OpenLayers.Control.UTFGrid"}),OpenLayers.Format.CQL=function(){function e(e,t){return t instanceof RegExp?t.exec(e):t(e)}function t(t,i){var n,s,a=i.length;for(n=0;n<a;n++){s=i[n];var o=e(t,r[s]);if(o){var l=o[0];return{type:s,text:l,remainder:t.substr(l.length).replace(/^\s*/,"")}}}var h="ERROR: In parsing: ["+t+"], expected one of: ";for(n=0;n<a;n++)h+="\n "+(s=i[n])+": "+r[s];throw new Error(h)}function i(e){var i,n=[],s=["NOT","GEOMETRY","SPATIAL","PROPERTY","LPAREN"];do{if(i=t(e,s),e=i.remainder,s=a[i.type],"END"!=i.type&&!s)throw new Error("No follows list for "+i.type);n.push(i)}while("END"!=i.type);return n}function n(e){function t(){var e=n.pop();switch(e.type){case"LOGICAL":var i=t(),s=t();return new OpenLayers.Filter.Logical({filters:[s,i],type:h[e.text.toUpperCase()]});case"NOT":var r=t();return new OpenLayers.Filter.Logical({filters:[r],type:OpenLayers.Filter.Logical.NOT});case"BETWEEN":var a,l;return n.pop(),l=t(),a=t(),p=t(),new OpenLayers.Filter.Comparison({property:p,lowerBoundary:a,upperBoundary:l,type:OpenLayers.Filter.Comparison.BETWEEN});case"COMPARISON":var u=t(),p=t();return new OpenLayers.Filter.Comparison({property:p,value:u,type:o[e.text.toUpperCase()]});case"IS_NULL":p=t();return new OpenLayers.Filter.Comparison({property:p,type:o[e.text.toUpperCase()]});case"VALUE":var c=e.text.match(/^'(.*)'$/);return c?c[1].replace(/''/g,"'"):Number(e.text);case"SPATIAL":switch(e.text.toUpperCase()){case"BBOX":var d=t(),f=t(),m=t(),y=t(),g=t();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:g,value:OpenLayers.Bounds.fromArray([y,m,f,d])});case"INTERSECTS":var u=t(),p=t();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:p,value:u});case"WITHIN":var u=t(),p=t();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.WITHIN,property:p,value:u});case"CONTAINS":var u=t(),p=t();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.CONTAINS,property:p,value:u});case"DWITHIN":var v=t(),u=t(),p=t();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,value:u,property:p,distance:Number(v)})}case"GEOMETRY":return OpenLayers.Geometry.fromWKT(e.text);default:return e.text}}for(var i=[],n=[];e.length;){var s=e.shift();switch(s.type){case"PROPERTY":case"GEOMETRY":case"VALUE":n.push(s);break;case"COMPARISON":case"BETWEEN":case"IS_NULL":case"LOGICAL":for(var r=p[s.type];i.length>0&&p[i[i.length-1].type]<=r;)n.push(i.pop());i.push(s);break;case"SPATIAL":case"NOT":case"LPAREN":i.push(s);break;case"RPAREN":for(;i.length>0&&"LPAREN"!=i[i.length-1].type;)n.push(i.pop());i.pop(),i.length>0&&"SPATIAL"==i[i.length-1].type&&n.push(i.pop());case"COMMA":case"END":break;default:throw new Error("Unknown token type "+s.type)}}for(;i.length>0;)n.push(i.pop());var a=t();if(n.length>0){for(var l="Remaining tokens after building AST: \n",u=n.length-1;u>=0;u--)l+=n[u].type+": "+n[u].text+"\n";throw new Error(l)}return a}var s,r={PROPERTY:/^[_a-zA-Z]\w*/,COMPARISON:/^(=|<>|<=|<|>=|>|LIKE)/i,IS_NULL:/^IS NULL/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('([^']|'')*'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/,RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(e){var t=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(e);if(t){var i=e.length,n=e.indexOf("(",t[0].length);if(n>-1)for(var s=1;n<i&&s>0;)switch(n++,e.charAt(n)){case"(":s++;break;case")":s--}return[e.substr(0,n+1)]}},END:/^$/},a={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON","BETWEEN","COMMA","IS_NULL"],BETWEEN:["VALUE"],IS_NULL:["END"],COMPARISON:["VALUE"],COMMA:["GEOMETRY","VALUE","PROPERTY"],VALUE:["LOGICAL","COMMA","RPAREN","END"],SPATIAL:["LPAREN"],LOGICAL:["NOT","VALUE","SPATIAL","PROPERTY","LPAREN"],NOT:["PROPERTY","LPAREN"],GEOMETRY:["COMMA","RPAREN"]},o={"=":OpenLayers.Filter.Comparison.EQUAL_TO,"<>":OpenLayers.Filter.Comparison.NOT_EQUAL_TO,"<":OpenLayers.Filter.Comparison.LESS_THAN,"<=":OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,">":OpenLayers.Filter.Comparison.GREATER_THAN,">=":OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,LIKE:OpenLayers.Filter.Comparison.LIKE,BETWEEN:OpenLayers.Filter.Comparison.BETWEEN,"IS NULL":OpenLayers.Filter.Comparison.IS_NULL},l={},h={AND:OpenLayers.Filter.Logical.AND,OR:OpenLayers.Filter.Logical.OR},u={},p={RPAREN:3,LOGICAL:2,COMPARISON:1};for(s in o)o.hasOwnProperty(s)&&(l[o[s]]=s);for(s in h)h.hasOwnProperty(s)&&(u[h[s]]=s);return OpenLayers.Class(OpenLayers.Format,{read:function(e){var t=n(i(e));return this.keepData&&(this.data=t),t},write:function(e){if(e instanceof OpenLayers.Geometry)return e.toString();switch(e.CLASS_NAME){case"OpenLayers.Filter.Spatial":switch(e.type){case OpenLayers.Filter.Spatial.BBOX:return"BBOX("+e.property+","+e.value.toBBOX()+")";case OpenLayers.Filter.Spatial.DWITHIN:return"DWITHIN("+e.property+", "+this.write(e.value)+", "+e.distance+")";case OpenLayers.Filter.Spatial.WITHIN:return"WITHIN("+e.property+", "+this.write(e.value)+")";case OpenLayers.Filter.Spatial.INTERSECTS:return"INTERSECTS("+e.property+", "+this.write(e.value)+")";case OpenLayers.Filter.Spatial.CONTAINS:return"CONTAINS("+e.property+", "+this.write(e.value)+")";default:throw new Error("Unknown spatial filter type: "+e.type)}case"OpenLayers.Filter.Logical":if(e.type==OpenLayers.Filter.Logical.NOT)return"NOT ("+this.write(e.filters[0])+")";for(var t="(",i=!0,n=0;n<e.filters.length;n++)i?i=!1:t+=") "+u[e.type]+" (",t+=this.write(e.filters[n]);return t+")";case"OpenLayers.Filter.Comparison":return e.type==OpenLayers.Filter.Comparison.BETWEEN?e.property+" BETWEEN "+this.write(e.lowerBoundary)+" AND "+this.write(e.upperBoundary):null!==e.value?e.property+" "+l[e.type]+" "+this.write(e.value):e.property+" "+l[e.type];case void 0:if("string"==typeof e)return"'"+e.replace(/'/g,"''")+"'";if("number"==typeof e)return String(e);default:throw new Error("Can't encode: "+e.CLASS_NAME+" "+e)}},CLASS_NAME:"OpenLayers.Format.CQL"})}(),OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{layer:null,source:null,sourceOptions:null,tolerance:null,edge:!0,deferDelete:!1,mutual:!0,targetFilter:null,sourceFilter:null,handler:null,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,[e]),this.options=e||{},this.options.source&&this.setSource(this.options.source)},setSource:function(e){this.active?(this.deactivate(),this.handler&&(this.handler.destroy(),delete this.handler),this.source=e,this.activate()):this.source=e},activate:function(){var e=OpenLayers.Control.prototype.activate.call(this);return e&&(this.source?this.source.events&&this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this}):(this.handler||(this.handler=new OpenLayers.Handler.Path(this,{done:function(e){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(e)})}},{layerOptions:this.sourceOptions})),this.handler.activate())),e},deactivate:function(){var e=OpenLayers.Control.prototype.deactivate.call(this);return e&&this.source&&this.source.events&&this.source.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this}),e},onSketchComplete:function(e){return this.feature=null,!this.considerSplit(e.feature)},afterFeatureModified:function(e){e.modified&&"function"==typeof e.feature.geometry.split&&(this.feature=e.feature,this.considerSplit(e.feature))},removeByGeometry:function(e,t){for(var i=0,n=e.length;i<n;++i)if(e[i].geometry===t){e.splice(i,1);break}},isEligible:function(e){return!!e.geometry&&(e.state!==OpenLayers.State.DELETE&&"function"==typeof e.geometry.split&&this.feature!==e&&(!this.targetFilter||this.targetFilter.evaluate(e.attributes)))},considerSplit:function(e){var t=!1,i=!1;if(!this.sourceFilter||this.sourceFilter.evaluate(e.attributes)){for(var n,s,r,a,o,l,h=this.layer&&this.layer.features||[],u=[],p=[],c=this.layer===this.source&&this.mutual,d={edge:this.edge,tolerance:this.tolerance,mutual:c},f=[e.geometry],m=0,y=h.length;m<y;++m)if(r=h[m],this.isEligible(r)){a=[r.geometry];for(var g=0;g<f.length;++g){o=f[g];for(var v=0;v<a.length;++v)n=a[v],o.getBounds().intersectsBounds(n.getBounds())&&(s=o.split(n,d))&&!1!==this.events.triggerEvent("beforesplit",{source:e,target:r})&&(c&&((l=s[0]).length>1&&(l.unshift(g,1),Array.prototype.splice.apply(f,l),g+=l.length-3),s=s[1]),s.length>1&&(s.unshift(v,1),Array.prototype.splice.apply(a,s),v+=s.length-3))}a&&a.length>1&&(this.geomsToFeatures(r,a),this.events.triggerEvent("split",{original:r,features:a}),Array.prototype.push.apply(u,a),p.push(r),i=!0)}if(f&&f.length>1&&(this.geomsToFeatures(e,f),this.events.triggerEvent("split",{original:e,features:f}),Array.prototype.push.apply(u,f),p.push(e),t=!0),t||i){if(this.deferDelete){for(var L,O=[],m=0,y=p.length;m<y;++m)(L=p[m]).state===OpenLayers.State.INSERT?O.push(L):(L.state=OpenLayers.State.DELETE,this.layer.drawFeature(L));this.layer.destroyFeatures(O,{silent:!0});for(var m=0,y=u.length;m<y;++m)u[m].state=OpenLayers.State.INSERT}else this.layer.destroyFeatures(p,{silent:!0});this.layer.addFeatures(u,{silent:!0}),this.events.triggerEvent("aftersplit",{source:e,features:u})}}return t},geomsToFeatures:function(e,t){var i=e.clone();delete i.geometry;for(var n,s=0,r=t.length;s<r;++s)(n=i.clone()).geometry=t[s],n.state=OpenLayers.State.INSERT,t[s]=n},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,serverResolutions:null,formatSuffixMap:{"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"},matrix:null,initialize:function(e){var t={url:!0,layer:!0,style:!0,matrixSet:!0};for(var i in t)if(!(i in e))throw new Error("Missing property '"+i+"' in layer configuration.");e.params=OpenLayers.Util.upperCaseObject(e.params);var n=[e.name,e.url,e.params,e];if(OpenLayers.Layer.Grid.prototype.initialize.apply(this,n),this.formatSuffix||(this.formatSuffix=this.formatSuffixMap[this.format]||this.format.split("/").pop()),this.matrixIds){var s=this.matrixIds.length;if(s&&"string"==typeof this.matrixIds[0]){var r=this.matrixIds;this.matrixIds=new Array(s);for(var a=0;a<s;++a)this.matrixIds[a]={identifier:r[a]}}}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments)},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(e,t,i){return!t&&this.matrix||this.updateMatrixProperties(),OpenLayers.Layer.Grid.prototype.moveTo.apply(this,arguments)},clone:function(e){return null==e&&(e=new OpenLayers.Layer.WMTS(this.options)),e=OpenLayers.Layer.Grid.prototype.clone.apply(this,[e])},getIdentifier:function(){return this.getServerZoom()},getMatrix:function(){var e;if(this.matrixIds&&0!==this.matrixIds.length)if("scaleDenominator"in this.matrixIds[0])for(var t,i=OpenLayers.METERS_PER_INCH*OpenLayers.INCHES_PER_UNIT[this.units]*this.getServerResolution()/28e-5,n=Number.POSITIVE_INFINITY,s=0,r=this.matrixIds.length;s<r;++s)(t=Math.abs(1-this.matrixIds[s].scaleDenominator/i))<n&&(n=t,e=this.matrixIds[s]);else e=this.matrixIds[this.getIdentifier()];else e={identifier:this.getIdentifier()};return e},getTileInfo:function(e){var t=this.getServerResolution(),i=(e.lon-this.tileOrigin.lon)/(t*this.tileSize.w),n=(this.tileOrigin.lat-e.lat)/(t*this.tileSize.h),s=Math.floor(i),r=Math.floor(n);return{col:s,row:r,i:Math.floor((i-s)*this.tileSize.w),j:Math.floor((n-r)*this.tileSize.h)}},getURL:function(e){e=this.adjustBounds(e);var t="";if(!this.tileFullExtent||this.tileFullExtent.intersectsBounds(e)){var i,n=e.getCenterLonLat(),s=this.getTileInfo(n),r=(this.matrix.identifier,this.dimensions);if(t=OpenLayers.Util.isArray(this.url)?this.selectUrl([this.version,this.style,this.matrixSet,this.matrix.identifier,s.row,s.col].join(","),this.url):this.url,"REST"===this.requestEncoding.toUpperCase())if(i=this.params,-1!==t.indexOf("{")){var a=t.replace(/\{/g,"${"),o={style:this.style,Style:this.style,TileMatrixSet:this.matrixSet,TileMatrix:this.matrix.identifier,TileRow:s.row,TileCol:s.col};if(r){var l;for(u=r.length-1;u>=0;--u)o[l=r[u]]=i[l.toUpperCase()]}t=OpenLayers.String.format(a,o)}else{var h=this.version+"/"+this.layer+"/"+this.style+"/";if(r)for(var u=0;u<r.length;u++)i[r[u]]&&(h=h+i[r[u]]+"/");h=h+this.matrixSet+"/"+this.matrix.identifier+"/"+s.row+"/"+s.col+"."+this.formatSuffix,t.match(/\/$/)||(t+="/"),t+=h}else"KVP"===this.requestEncoding.toUpperCase()&&(i={SERVICE:"WMTS",REQUEST:"GetTile",VERSION:this.version,LAYER:this.layer,STYLE:this.style,TILEMATRIXSET:this.matrixSet,TILEMATRIX:this.matrix.identifier,TILEROW:s.row,TILECOL:s.col,FORMAT:this.format},t=OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,[i]))}return t},mergeNewParams:function(e){if("KVP"===this.requestEncoding.toUpperCase())return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,[OpenLayers.Util.upperCaseObject(e)])},CLASS_NAME:"OpenLayers.Layer.WMTS"}),OpenLayers.Protocol.SOS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol,{fois:null,formatOptions:null,initialize:function(e){OpenLayers.Protocol.prototype.initialize.apply(this,[e]),e.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(e){e=OpenLayers.Util.extend({},e),OpenLayers.Util.applyDefaults(e,this.options||{});var t=new OpenLayers.Protocol.Response({requestType:"read"}),i=this.format,n=OpenLayers.Format.XML.prototype.write.apply(i,[i.writeNode("sos:GetFeatureOfInterest",{fois:this.fois})]);return t.priv=OpenLayers.Request.POST({url:e.url,callback:this.createCallback(this.handleRead,t,e),data:n}),t},handleRead:function(e,t){if(t.callback){var i=e.priv;i.status>=200&&i.status<300?(e.features=this.parseFeatures(i),e.code=OpenLayers.Protocol.Response.SUCCESS):e.code=OpenLayers.Protocol.Response.FAILURE,t.callback.call(t.scope,e)}},parseFeatures:function(e){var t=e.responseXML;return t&&t.documentElement||(t=e.responseText),!t||t.length<=0?null:this.format.read(t)},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(e,t,i,n){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments),this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||this.DEFAULT_FORMAT]},getURL:function(e){e=this.adjustBounds(e);var t=this.map.getResolution(),i=Math.round(1e4*this.map.getScale())/1e4,n=Math.round(e.left/t),s=-Math.round(e.top/t),r=Math.floor(n/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w,a=Math.floor(s/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h,o=["/",this.params.map,"/",i,"/",this.params.g.replace(/\s/g,"_"),"/def/t",a,"/l",r,"/t",s,"l",n,".",this.extension],l=this.url;return OpenLayers.Util.isArray(l)&&(l=this.selectUrl(o.join(""),l)),l+o.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"}),OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.1.0",initialize:function(e){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",readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(e,t){t.srs[this.getChildValue(e)]=!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",readers:{wms:OpenLayers.Util.applyDefaults({VendorSpecificCapabilities:function(e,t){t.vendorSpecific={tileSets:[]},this.readChildNodes(e,t.vendorSpecific)},TileSet:function(e,t){var i={srs:{},bbox:{},resolutions:[]};this.readChildNodes(e,i),t.tileSets.push(i)},Resolutions:function(e,t){for(var i=this.getChildValue(e).split(" "),n=0,s=i.length;n<s;n++)""!=i[n]&&t.resolutions.push(parseFloat(i[n]))},Width:function(e,t){t.width=parseInt(this.getChildValue(e))},Height:function(e,t){t.height=parseInt(this.getChildValue(e))},Layers:function(e,t){t.layers=this.getChildValue(e)},Styles:function(e,t){t.styles=this.getChildValue(e)}},OpenLayers.Format.WMSCapabilities.v1_1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC"}),OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:!0,initialize:function(e){OpenLayers.Control.prototype.initialize.apply(this,arguments),this.layerStates=[]},destroy:function(){this.clearLayersArray("base"),this.clearLayersArray("data"),this.map.events.un({buttonclick:this.onButtonClick,addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this}),this.events.unregister("buttonclick",this,this.onButtonClick),OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments),this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this}),this.outsideViewport?(this.events.attachToElement(this.div),this.events.register("buttonclick",this,this.onButtonClick)):this.map.events.register("buttonclick",this,this.onButtonClick)},draw:function(){return OpenLayers.Control.prototype.draw.apply(this),this.loadContents(),this.outsideViewport||this.minimizeControl(),this.redraw(),this.div},onButtonClick:function(e){var t=e.buttonElement;t===this.minimizeDiv?this.minimizeControl():t===this.maximizeDiv?this.maximizeControl():t._layerSwitcher===this.id&&(t.for&&(t=document.getElementById(t.for)),t.disabled||("radio"==t.type?(t.checked=!0,this.map.setBaseLayer(this.map.getLayer(t._layer))):(t.checked=!t.checked,this.updateMap())))},clearLayersArray:function(e){this[e+"LayersDiv"].innerHTML="",this[e+"Layers"]=[]},checkRedraw:function(){if(!this.layerStates.length||this.map.layers.length!=this.layerStates.length)return!0;for(var e=0,t=this.layerStates.length;e<t;e++){var i=this.layerStates[e],n=this.map.layers[e];if(i.name!=n.name||i.inRange!=n.inRange||i.id!=n.id||i.visibility!=n.visibility)return!0}return!1},redraw:function(){if(!this.checkRedraw())return this.div;this.clearLayersArray("base"),this.clearLayersArray("data");var e=!1,t=!1,i=this.map.layers.length;this.layerStates=new Array(i);for(r=0;r<i;r++){var n=this.map.layers[r];this.layerStates[r]={name:n.name,visibility:n.visibility,inRange:n.inRange,id:n.id}}var s=this.map.layers.slice();this.ascending||s.reverse();for(var r=0,i=s.length;r<i;r++){var a=(n=s[r]).isBaseLayer;if(n.displayInLayerSwitcher){a?t=!0:e=!0;var o=a?n==this.map.baseLayer:n.getVisibility(),l=document.createElement("input"),h=OpenLayers.Util.createUniqueID(this.id+"_input_");l.id=h,l.name=a?this.id+"_baseLayers":n.name,l.type=a?"radio":"checkbox",l.value=n.name,l.checked=o,l.defaultChecked=o,l.className="olButton",l._layer=n.id,l._layerSwitcher=this.id,a||n.inRange||(l.disabled=!0);var u=document.createElement("label");u.for=l.id,OpenLayers.Element.addClass(u,"labelSpan olButton"),u._layer=n.id,u._layerSwitcher=this.id,a||n.inRange||(u.style.color="gray"),u.innerHTML=n.name,u.style.verticalAlign=a?"bottom":"baseline";var p=document.createElement("br");(a?this.baseLayers:this.dataLayers).push({layer:n,inputElem:l,labelSpan:u});var c=a?this.baseLayersDiv:this.dataLayersDiv;c.appendChild(l),c.appendChild(u),c.appendChild(p)}}return this.dataLbl.style.display=e?"":"none",this.baseLbl.style.display=t?"":"none",this.div},updateMap:function(){for(var e=0,t=this.baseLayers.length;e<t;e++)(i=this.baseLayers[e]).inputElem.checked&&this.map.setBaseLayer(i.layer,!1);for(var e=0,t=this.dataLayers.length;e<t;e++){var i=this.dataLayers[e];i.layer.setVisibility(i.inputElem.checked)}},maximizeControl:function(e){this.div.style.width="",this.div.style.height="",this.showControls(!1),null!=e&&OpenLayers.Event.stop(e)},minimizeControl:function(e){this.div.style.width="0px",this.div.style.height="0px",this.showControls(!0),null!=e&&OpenLayers.Event.stop(e)},showControls:function(e){this.maximizeDiv.style.display=e?"":"none",this.minimizeDiv.style.display=e?"none":"",this.layersDiv.style.display=e?"none":""},loadContents:function(){this.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);e=OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,null,e,"absolute"),OpenLayers.Element.addClass(this.maximizeDiv,"maximizeDiv olButton"),this.maximizeDiv.style.display="none",this.div.appendChild(this.maximizeDiv);var e=OpenLayers.Util.getImageLocation("layer-switcher-minimize.png");this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,null,e,"absolute"),OpenLayers.Element.addClass(this.minimizeDiv,"minimizeDiv olButton"),this.minimizeDiv.style.display="none",this.div.appendChild(this.minimizeDiv)},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"}),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(e){return"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),this.parseFeatures(e)},write:function(e){var t;if(OpenLayers.Util.isArray(e)){(t=this.createElementNSPlus("atom:feed")).appendChild(this.createElementNSPlus("atom:title",{value:this.feedTitle}));for(var i=0,n=e.length;i<n;i++)t.appendChild(this.buildEntryNode(e[i]))}else t=this.buildEntryNode(e);return OpenLayers.Format.XML.prototype.write.apply(this,[t])},buildContentNode:function(e){var t=this.createElementNSPlus("atom:content",{attributes:{type:e.type||null}});if(e.src)t.setAttribute("src",e.src);else if("text"==e.type||null==e.type)t.appendChild(this.createTextNode(e.value));else if("html"==e.type){if("string"!=typeof e.value)throw"HTML content must be in form of an escaped string";t.appendChild(this.createTextNode(e.value))}else"xhtml"==e.type?t.appendChild(e.value):"xhtml"==e.type||e.type.match(/(\+|\/)xml$/)?t.appendChild(e.value):t.appendChild(this.createTextNode(e.value));return t},buildEntryNode:function(e){var t=e.attributes,i=t.atom||{},n=this.createElementNSPlus("atom:entry");if(i.authors)for(var s=OpenLayers.Util.isArray(i.authors)?i.authors:[i.authors],r=0,a=s.length;r<a;r++)n.appendChild(this.buildPersonConstructNode("author",s[r]));if(i.categories)for(var o,l=OpenLayers.Util.isArray(i.categories)?i.categories:[i.categories],r=0,a=l.length;r<a;r++)o=l[r],n.appendChild(this.createElementNSPlus("atom:category",{attributes:{term:o.term,scheme:o.scheme||null,label:o.label||null}}));if(i.content&&n.appendChild(this.buildContentNode(i.content)),i.contributors)for(var h=OpenLayers.Util.isArray(i.contributors)?i.contributors:[i.contributors],r=0,a=h.length;r<a;r++)n.appendChild(this.buildPersonConstructNode("contributor",h[r]));if(e.fid&&n.appendChild(this.createElementNSPlus("atom:id",{value:e.fid})),i.links)for(var u,p=OpenLayers.Util.isArray(i.links)?i.links:[i.links],r=0,a=p.length;r<a;r++)u=p[r],n.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}}));if(i.published&&n.appendChild(this.createElementNSPlus("atom:published",{value:i.published})),i.rights&&n.appendChild(this.createElementNSPlus("atom:rights",{value:i.rights})),(i.summary||t.description)&&n.appendChild(this.createElementNSPlus("atom:summary",{value:i.summary||t.description})),n.appendChild(this.createElementNSPlus("atom:title",{value:i.title||t.title||this.defaultEntryTitle})),i.updated&&n.appendChild(this.createElementNSPlus("atom:updated",{value:i.updated})),e.geometry){var c=this.createElementNSPlus("georss:where");c.appendChild(this.buildGeometryNode(e.geometry)),n.appendChild(c)}return n},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(e){return this.gmlParser||this.initGmlParser(),this.gmlParser.writeNode("feature:_geometry",e).firstChild},buildPersonConstructNode:function(e,t){var i=["uri","email"],n=this.createElementNSPlus("atom:"+e);n.appendChild(this.createElementNSPlus("atom:name",{value:t.name}));for(var s=0,r=i.length;s<r;s++)t[i[s]]&&n.appendChild(this.createElementNSPlus("atom:"+i[s],{value:t[i[s]]}));return n},getFirstChildValue:function(e,t,i,n){var s=this.getElementsByTagNameNS(e,t,i);return s&&s.length>0?this.getChildValue(s[0],n):n},parseFeature:function(e){var t={},i=null,n=null,s=null,r=this.namespaces.atom;this.parsePersonConstructs(e,"author",t),(n=this.getElementsByTagNameNS(e,r,"category")).length>0&&(t.categories=[]);for(var a=0,o=n.length;a<o;a++)(i={}).term=n[a].getAttribute("term"),(s=n[a].getAttribute("scheme"))&&(i.scheme=s),(s=n[a].getAttribute("label"))&&(i.label=s),t.categories.push(i);(n=this.getElementsByTagNameNS(e,r,"content")).length>0&&(i={},(s=n[0].getAttribute("type"))&&(i.type=s),(s=n[0].getAttribute("src"))?i.src=s:("text"==i.type||"html"==i.type||null==i.type?i.value=this.getFirstChildValue(e,r,"content",null):"xhtml"==i.type||i.type.match(/(\+|\/)xml$/)?i.value=this.getChildEl(n[0]):i.value=this.getFirstChildValue(e,r,"content",null),t.content=i)),this.parsePersonConstructs(e,"contributor",t),t.id=this.getFirstChildValue(e,r,"id",null),(n=this.getElementsByTagNameNS(e,r,"link")).length>0&&(t.links=new Array(n.length));for(var l=["rel","type","hreflang","title","length"],a=0,o=n.length;a<o;a++){(i={}).href=n[a].getAttribute("href");for(var h=0,u=l.length;h<u;h++)(s=n[a].getAttribute(l[h]))&&(i[l[h]]=s);t.links[a]=i}(i=this.getFirstChildValue(e,r,"published",null))&&(t.published=i),(i=this.getFirstChildValue(e,r,"rights",null))&&(t.rights=i),(i=this.getFirstChildValue(e,r,"summary",null))&&(t.summary=i),t.title=this.getFirstChildValue(e,r,"title",null),t.updated=this.getFirstChildValue(e,r,"updated",null);var p={title:t.title,description:t.summary,atom:t},c=this.parseLocations(e)[0],d=new OpenLayers.Feature.Vector(c,p);return d.fid=t.id,d},parseFeatures:function(e){var t=[],i=this.getElementsByTagNameNS(e,this.namespaces.atom,"entry");0==i.length&&(i=[e]);for(var n=0,s=i.length;n<s;n++)t.push(this.parseFeature(i[n]));return t},parseLocations:function(e){var t=this.namespaces.georss,i={components:[]},n=this.getElementsByTagNameNS(e,t,"where");if(n&&n.length>0){this.gmlParser||this.initGmlParser();for(var s=0,r=n.length;s<r;s++)this.gmlParser.readChildNodes(n[s],i)}var a=i.components,o=this.getElementsByTagNameNS(e,t,"point");if(o&&o.length>0)for(var s=0,r=o.length;s<r;s++){var l=OpenLayers.String.trim(o[s].firstChild.nodeValue).split(/\s+/);2!=l.length&&(l=OpenLayers.String.trim(o[s].firstChild.nodeValue).split(/\s*,\s*/)),a.push(new OpenLayers.Geometry.Point(l[1],l[0]))}var h=this.getElementsByTagNameNS(e,t,"line");if(h&&h.length>0)for(var s=0,r=h.length;s<r;s++){m=[];for(var u=0,p=(d=OpenLayers.String.trim(h[s].firstChild.nodeValue).split(/\s+/)).length;u<p;u+=2)f=new OpenLayers.Geometry.Point(d[u+1],d[u]),m.push(f);a.push(new OpenLayers.Geometry.LineString(m))}var c=this.getElementsByTagNameNS(e,t,"polygon");if(c&&c.length>0)for(var d,f,m,s=0,r=c.length;s<r;s++){m=[];for(var u=0,p=(d=OpenLayers.String.trim(c[s].firstChild.nodeValue).split(/\s+/)).length;u<p;u+=2)f=new OpenLayers.Geometry.Point(d[u+1],d[u]),m.push(f);a.push(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(m)]))}if(this.internalProjection&&this.externalProjection)for(var s=0,r=a.length;s<r;s++)a[s]&&a[s].transform(this.externalProjection,this.internalProjection);return a},parsePersonConstructs:function(e,t,i){for(var n=[],s=this.namespaces.atom,r=this.getElementsByTagNameNS(e,s,t),a=["uri","email"],o=0,l=r.length;o<l;o++){var h={};h.name=this.getFirstChildValue(r[o],s,"name",null);for(var u=0,p=a.length;u<p;u++){var c=this.getFirstChildValue(r[o],s,a[u],null);c&&(h[a[u]]=c)}n.push(h)}n.length>0&&(i[t+"s"]=n)},CLASS_NAME:"OpenLayers.Format.Atom"}),OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,slideFactor:75,observeElement:null,draw:function(){var e=this.observeElement||document;this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress},{observeElement:e})},defaultKeyPress:function(e){var t,i=!0,n=OpenLayers.Event.element(e);if(!n||"INPUT"!=n.tagName&&"TEXTAREA"!=n.tagName&&"SELECT"!=n.tagName){switch(e.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33: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();break;default:i=!1}i&&OpenLayers.Event.stop(e)}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"}),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(e){OpenLayers.Format.XML.prototype.initialize.apply(this,[e]),this.options=e;var t=OpenLayers.Util.extend({},OpenLayers.Format.WMTSCapabilities.prototype.yx);this.yx=OpenLayers.Util.extend(t,this.yx)},read:function(e){"string"==typeof e&&(e=OpenLayers.Format.XML.prototype.read.apply(this,[e])),e&&9==e.nodeType&&(e=e.documentElement);var t={};return this.readNode(e,t),t.version=this.version,t},readers:{wmts:{Capabilities:function(e,t){this.readChildNodes(e,t)},Contents:function(e,t){t.contents={},t.contents.layers=[],t.contents.tileMatrixSets={},this.readChildNodes(e,t.contents)},Layer:function(e,t){var i={styles:[],formats:[],dimensions:[],tileMatrixSetLinks:[]};i.layers=[],this.readChildNodes(e,i),t.layers.push(i)},Style:function(e,t){var i={};i.isDefault="true"===e.getAttribute("isDefault"),this.readChildNodes(e,i),t.styles.push(i)},Format:function(e,t){t.formats.push(this.getChildValue(e))},TileMatrixSetLink:function(e,t){var i={};this.readChildNodes(e,i),t.tileMatrixSetLinks.push(i)},TileMatrixSet:function(e,t){if(t.layers){var i={matrixIds:[]};this.readChildNodes(e,i),t.tileMatrixSets[i.identifier]=i}else t.tileMatrixSet=this.getChildValue(e)},TileMatrix:function(e,t){var i={supportedCRS:t.supportedCRS};this.readChildNodes(e,i),t.matrixIds.push(i)},ScaleDenominator:function(e,t){t.scaleDenominator=parseFloat(this.getChildValue(e))},TopLeftCorner:function(e,t){var i,n=this.getChildValue(e).split(" ");if(t.supportedCRS){var s=t.supportedCRS.replace(/urn:ogc:def:crs:(\w+):.+:(\w+)$/,"urn:ogc:def:crs:$1::$2");i=!!this.yx[s]}t.topLeftCorner=i?new OpenLayers.LonLat(n[1],n[0]):new OpenLayers.LonLat(n[0],n[1])},TileWidth:function(e,t){t.tileWidth=parseInt(this.getChildValue(e))},TileHeight:function(e,t){t.tileHeight=parseInt(this.getChildValue(e))},MatrixWidth:function(e,t){t.matrixWidth=parseInt(this.getChildValue(e))},MatrixHeight:function(e,t){t.matrixHeight=parseInt(this.getChildValue(e))},ResourceURL:function(e,t){t.resourceUrl=t.resourceUrl||{};var i=e.getAttribute("resourceType");t.resourceUrls||(t.resourceUrls=[]);var n=t.resourceUrl[i]={format:e.getAttribute("format"),template:e.getAttribute("template"),resourceType:i};t.resourceUrls.push(n)},WSDL:function(e,t){t.wsdl={},t.wsdl.href=e.getAttribute("xlink:href")},ServiceMetadataURL:function(e,t){t.serviceMetadataUrl={},t.serviceMetadataUrl.href=e.getAttribute("xlink:href")},LegendURL:function(e,t){t.legend={},t.legend.href=e.getAttribute("xlink:href"),t.legend.format=e.getAttribute("format")},Dimension:function(e,t){var i={values:[]};this.readChildNodes(e,i),t.dimensions.push(i)},Default:function(e,t){t.default=this.getChildValue(e)},Value:function(e,t){t.values.push(this.getChildValue(e))}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities.v1_0_0"}),function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function i(e){var t=!!e&&"length"in e&&e.length,i=se.type(e);return"function"!==i&&!se.isWindow(e)&&("array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e)}function n(e,t,i){if(se.isFunction(t))return se.grep(e,function(e,n){return!!t.call(e,n,e)!==i});if(t.nodeType)return se.grep(e,function(e){return e===t!==i});if("string"==typeof t){if(fe.test(t))return se.filter(t,e,i);t=se.filter(t,e)}return se.grep(e,function(e){return J.call(t,e)>-1!==i})}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function r(e){var t={};return se.each(e.match(Le)||[],function(e,i){t[i]=!0}),t}function a(){Z.removeEventListener("DOMContentLoaded",a),e.removeEventListener("load",a),se.ready()}function o(){this.expando=se.expando+o.uid++}function l(e,t,i){var n;if(void 0===i&&1===e.nodeType)if(n="data-"+t.replace(_e,"-$&").toLowerCase(),"string"==typeof(i=e.getAttribute(n))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:xe.test(i)?se.parseJSON(i):i)}catch(e){}Ce.set(e,t,i)}else i=void 0;return i}function h(e,t,i,n){var s,r=1,a=20,o=n?function(){return n.cur()}:function(){return se.css(e,t,"")},l=o(),h=i&&i[3]||(se.cssNumber[t]?"":"px"),u=(se.cssNumber[t]||"px"!==h&&+l)&&Ne.exec(se.css(e,t));if(u&&u[3]!==h){h=h||u[3],i=i||[],u=+l||1;do{u/=r=r||".5",se.style(e,t,u+h)}while(r!==(r=o()/l)&&1!==r&&--a)}return i&&(u=+u||+l||0,s=i[1]?u+(i[1]+1)*i[2]:+i[2],n&&(n.unit=h,n.start=u,n.end=s)),s}function u(e,t){var i=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&se.nodeName(e,t)?se.merge([e],i):i}function p(e,t){for(var i=0,n=e.length;i<n;i++)Se.set(e[i],"globalEval",!t||Se.get(t[i],"globalEval"))}function c(e,t,i,n,s){for(var r,a,o,l,h,c,d=t.createDocumentFragment(),f=[],m=0,y=e.length;m<y;m++)if((r=e[m])||0===r)if("object"===se.type(r))se.merge(f,r.nodeType?[r]:r);else if(De.test(r)){for(a=a||d.appendChild(t.createElement("div")),o=(ke.exec(r)||["",""])[1].toLowerCase(),l=Fe[o]||Fe._default,a.innerHTML=l[1]+se.htmlPrefilter(r)+l[2],c=l[0];c--;)a=a.lastChild;se.merge(f,a.childNodes),(a=d.firstChild).textContent=""}else f.push(t.createTextNode(r));for(d.textContent="",m=0;r=f[m++];)if(n&&se.inArray(r,n)>-1)s&&s.push(r);else if(h=se.contains(r.ownerDocument,r),a=u(d.appendChild(r),"script"),h&&p(a),i)for(c=0;r=a[c++];)Ae.test(r.type||"")&&i.push(r);return d}function d(){return!0}function f(){return!1}function m(){try{return Z.activeElement}catch(e){}}function y(e,t,i,n,s,r){var a,o;if("object"==typeof t){"string"!=typeof i&&(n=n||i,i=void 0);for(o in t)y(e,o,i,n,t[o],r);return e}if(null==n&&null==s?(s=i,n=i=void 0):null==s&&("string"==typeof i?(s=n,n=void 0):(s=n,n=i,i=void 0)),!1===s)s=f;else if(!s)return e;return 1===r&&(a=s,(s=function(e){return se().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=se.guid++)),e.each(function(){se.event.add(this,t,s,n,i)})}function g(e,t){return se.nodeName(e,"table")&&se.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function v(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function L(e){var t=He.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function O(e,t){var i,n,s,r,a,o,l,h;if(1===t.nodeType){if(Se.hasData(e)&&(r=Se.access(e),a=Se.set(t,r),h=r.events)){delete a.handle,a.events={};for(s in h)for(i=0,n=h[s].length;i<n;i++)se.event.add(t,s,h[s][i])}Ce.hasData(e)&&(o=Ce.access(e),l=se.extend({},o),Ce.set(t,l))}}function b(e,t){var i=t.nodeName.toLowerCase();"input"===i&&Te.test(e.type)?t.checked=e.checked:"input"!==i&&"textarea"!==i||(t.defaultValue=e.defaultValue)}function w(e,t,i,n){t=K.apply([],t);var s,r,a,o,l,h,p=0,d=e.length,f=d-1,m=t[0],y=se.isFunction(m);if(y||d>1&&"string"==typeof m&&!ne.checkClone&&Ge.test(m))return e.each(function(s){var r=e.eq(s);y&&(t[0]=m.call(this,s,r.html())),w(r,t,i,n)});if(d&&(s=c(t,e[0].ownerDocument,!1,e,n),r=s.firstChild,1===s.childNodes.length&&(s=r),r||n)){for(o=(a=se.map(u(s,"script"),v)).length;p<d;p++)l=s,p!==f&&(l=se.clone(l,!0,!0),o&&se.merge(a,u(l,"script"))),i.call(e[p],l,p);if(o)for(h=a[a.length-1].ownerDocument,se.map(a,L),p=0;p<o;p++)l=a[p],Ae.test(l.type||"")&&!Se.access(l,"globalEval")&&se.contains(h,l)&&(l.src?se._evalUrl&&se._evalUrl(l.src):se.globalEval(l.textContent.replace(je,"")))}return e}function S(e,t,i){for(var n,s=t?se.filter(t,e):e,r=0;null!=(n=s[r]);r++)i||1!==n.nodeType||se.cleanData(u(n)),n.parentNode&&(i&&se.contains(n.ownerDocument,n)&&p(u(n,"script")),n.parentNode.removeChild(n));return e}function C(e,t){var i=se(t.createElement(e)).appendTo(t.body),n=se.css(i[0],"display");return i.detach(),n}function x(e){var t=Z,i=Ve[e];return i||("none"!==(i=C(e,t))&&i||((t=(We=(We||se("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),i=C(e,t),We.detach()),Ve[e]=i),i}function _(e,t,i){var n,s,r,a,o=e.style;return i=i||Xe(e),""!==(a=i?i.getPropertyValue(t)||i[t]:void 0)&&void 0!==a||se.contains(e.ownerDocument,e)||(a=se.style(e,t)),i&&!ne.pixelMarginRight()&&Ye.test(a)&&qe.test(t)&&(n=o.width,s=o.minWidth,r=o.maxWidth,o.minWidth=o.maxWidth=o.width=a,a=i.width,o.width=n,o.minWidth=s,o.maxWidth=r),void 0!==a?a+"":a}function E(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function N(e){if(e in tt)return e;for(var t=e[0].toUpperCase()+e.slice(1),i=et.length;i--;)if((e=et[i]+t)in tt)return e}function P(e,t,i){var n=Ne.exec(t);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):t}function M(e,t,i,n,s){for(var r=i===(n?"border":"content")?4:"width"===t?1:0,a=0;r<4;r+=2)"margin"===i&&(a+=se.css(e,i+Pe[r],!0,s)),n?("content"===i&&(a-=se.css(e,"padding"+Pe[r],!0,s)),"margin"!==i&&(a-=se.css(e,"border"+Pe[r]+"Width",!0,s))):(a+=se.css(e,"padding"+Pe[r],!0,s),"padding"!==i&&(a+=se.css(e,"border"+Pe[r]+"Width",!0,s)));return a}function T(e,t,i){var n=!0,s="width"===t?e.offsetWidth:e.offsetHeight,r=Xe(e),a="border-box"===se.css(e,"boxSizing",!1,r);if(s<=0||null==s){if(((s=_(e,t,r))<0||null==s)&&(s=e.style[t]),Ye.test(s))return s;n=a&&(ne.boxSizingReliable()||s===e.style[t]),s=parseFloat(s)||0}return s+M(e,t,i||(a?"border":"content"),n,r)+"px"}function k(e,t){for(var i,n,s,r=[],a=0,o=e.length;a<o;a++)(n=e[a]).style&&(r[a]=Se.get(n,"olddisplay"),i=n.style.display,t?(r[a]||"none"!==i||(n.style.display=""),""===n.style.display&&Me(n)&&(r[a]=Se.access(n,"olddisplay",x(n.nodeName)))):(s=Me(n),"none"===i&&s||Se.set(n,"olddisplay",s?i:se.css(n,"display"))));for(a=0;a<o;a++)(n=e[a]).style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?r[a]||"":"none"));return e}function A(e,t,i,n,s){return new A.prototype.init(e,t,i,n,s)}function F(){return e.setTimeout(function(){it=void 0}),it=se.now()}function D(e,t){var i,n=0,s={height:e};for(t=t?1:0;n<4;n+=2-t)s["margin"+(i=Pe[n])]=s["padding"+i]=e;return t&&(s.opacity=s.width=e),s}function I(e,t,i){for(var n,s=(U.tweeners[t]||[]).concat(U.tweeners["*"]),r=0,a=s.length;r<a;r++)if(n=s[r].call(i,t,e))return n}function R(e,t,i){var n,s,r,a,o,l,h,u=this,p={},c=e.style,d=e.nodeType&&Me(e),f=Se.get(e,"fxshow");i.queue||(null==(o=se._queueHooks(e,"fx")).unqueued&&(o.unqueued=0,l=o.empty.fire,o.empty.fire=function(){o.unqueued||l()}),o.unqueued++,u.always(function(){u.always(function(){o.unqueued--,se.queue(e,"fx").length||o.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(i.overflow=[c.overflow,c.overflowX,c.overflowY],"inline"===("none"===(h=se.css(e,"display"))?Se.get(e,"olddisplay")||x(e.nodeName):h)&&"none"===se.css(e,"float")&&(c.display="inline-block")),i.overflow&&(c.overflow="hidden",u.always(function(){c.overflow=i.overflow[0],c.overflowX=i.overflow[1],c.overflowY=i.overflow[2]}));for(n in t)if(s=t[n],st.exec(s)){if(delete t[n],r=r||"toggle"===s,s===(d?"hide":"show")){if("show"!==s||!f||void 0===f[n])continue;d=!0}p[n]=f&&f[n]||se.style(e,n)}else h=void 0;if(se.isEmptyObject(p))"inline"===("none"===h?x(e.nodeName):h)&&(c.display=h);else{f?"hidden"in f&&(d=f.hidden):f=Se.access(e,"fxshow",{}),r&&(f.hidden=!d),d?se(e).show():u.done(function(){se(e).hide()}),u.done(function(){var t;Se.remove(e,"fxshow");for(t in p)se.style(e,t,p[t])});for(n in p)a=I(d?f[n]:0,n,u),n in f||(f[n]=a.start,d&&(a.end=a.start,a.start="width"===n||"height"===n?1:0))}}function z(e,t){var i,n,s,r,a;for(i in e)if(n=se.camelCase(i),s=t[n],r=e[i],se.isArray(r)&&(s=r[1],r=e[i]=r[0]),i!==n&&(e[n]=r,delete e[i]),(a=se.cssHooks[n])&&"expand"in a){r=a.expand(r),delete e[n];for(i in r)i in e||(e[i]=r[i],t[i]=s)}else t[n]=s}function U(e,t,i){var n,s,r=0,a=U.prefilters.length,o=se.Deferred().always(function(){delete l.elem}),l=function(){if(s)return!1;for(var t=it||F(),i=Math.max(0,h.startTime+h.duration-t),n=1-(i/h.duration||0),r=0,a=h.tweens.length;r<a;r++)h.tweens[r].run(n);return o.notifyWith(e,[h,n,i]),n<1&&a?i:(o.resolveWith(e,[h]),!1)},h=o.promise({elem:e,props:se.extend({},t),opts:se.extend(!0,{specialEasing:{},easing:se.easing._default},i),originalProperties:t,originalOptions:i,startTime:it||F(),duration:i.duration,tweens:[],createTween:function(t,i){var n=se.Tween(e,h.opts,t,i,h.opts.specialEasing[t]||h.opts.easing);return h.tweens.push(n),n},stop:function(t){var i=0,n=t?h.tweens.length:0;if(s)return this;for(s=!0;i<n;i++)h.tweens[i].run(1);return t?(o.notifyWith(e,[h,1,0]),o.resolveWith(e,[h,t])):o.rejectWith(e,[h,t]),this}}),u=h.props;for(z(u,h.opts.specialEasing);r<a;r++)if(n=U.prefilters[r].call(h,e,u,h.opts))return se.isFunction(n.stop)&&(se._queueHooks(h.elem,h.opts.queue).stop=se.proxy(n.stop,n)),n;return se.map(u,I,h),se.isFunction(h.opts.start)&&h.opts.start.call(e,h),se.fx.timer(se.extend(l,{elem:e,anim:h,queue:h.opts.queue})),h.progress(h.opts.progress).done(h.opts.done,h.opts.complete).fail(h.opts.fail).always(h.opts.always)}function B(e){return e.getAttribute&&e.getAttribute("class")||""}function G(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,s=0,r=t.toLowerCase().match(Le)||[];if(se.isFunction(i))for(;n=r[s++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function H(e,t,i,n){function s(o){var l;return r[o]=!0,se.each(e[o]||[],function(e,o){var h=o(t,i,n);return"string"!=typeof h||a||r[h]?a?!(l=h):void 0:(t.dataTypes.unshift(h),s(h),!1)}),l}var r={},a=e===Ct;return s(t.dataTypes[0])||!r["*"]&&s("*")}function j(e,t){var i,n,s=se.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((s[i]?e:n||(n={}))[i]=t[i]);return n&&se.extend(!0,e,n),e}function W(e,t,i){for(var n,s,r,a,o=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(s in o)if(o[s]&&o[s].test(n)){l.unshift(s);break}if(l[0]in i)r=l[0];else{for(s in i){if(!l[0]||e.converters[s+" "+l[0]]){r=s;break}a||(a=s)}r=r||a}if(r)return r!==l[0]&&l.unshift(r),i[r]}function V(e,t,i,n){var s,r,a,o,l,h={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)h[a.toLowerCase()]=e.converters[a];for(r=u.shift();r;)if(e.responseFields[r]&&(i[e.responseFields[r]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=r,r=u.shift())if("*"===r)r=l;else if("*"!==l&&l!==r){if(!(a=h[l+" "+r]||h["* "+r]))for(s in h)if((o=s.split(" "))[1]===r&&(a=h[l+" "+o[0]]||h["* "+o[0]])){!0===a?a=h[s]:!0!==h[s]&&(r=o[0],u.unshift(o[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+r}}}return{state:"success",data:t}}function q(e,t,i,n){var s;if(se.isArray(t))se.each(t,function(t,s){i||Nt.test(e)?n(e,s):q(e+"["+("object"==typeof s&&null!=s?t:"")+"]",s,i,n)});else if(i||"object"!==se.type(t))n(e,t);else for(s in t)q(e+"["+s+"]",t[s],i,n)}function Y(e){return se.isWindow(e)?e:9===e.nodeType&&e.defaultView}var X=[],Z=e.document,$=X.slice,K=X.concat,Q=X.push,J=X.indexOf,ee={},te=ee.toString,ie=ee.hasOwnProperty,ne={},se=function(e,t){return new se.fn.init(e,t)},re=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ae=/^-ms-/,oe=/-([\da-z])/gi,le=function(e,t){return t.toUpperCase()};se.fn=se.prototype={jquery:"2.2.4",constructor:se,selector:"",length:0,toArray:function(){return $.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:$.call(this)},pushStack:function(e){var t=se.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return se.each(this,e)},map:function(e){return this.pushStack(se.map(this,function(t,i){return e.call(t,i,t)}))},slice:function(){return this.pushStack($.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i<t?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:Q,sort:X.sort,splice:X.splice},se.extend=se.fn.extend=function(){var e,t,i,n,s,r,a=arguments[0]||{},o=1,l=arguments.length,h=!1;for("boolean"==typeof a&&(h=a,a=arguments[o]||{},o++),"object"==typeof a||se.isFunction(a)||(a={}),o===l&&(a=this,o--);o<l;o++)if(null!=(e=arguments[o]))for(t in e)i=a[t],a!==(n=e[t])&&(h&&n&&(se.isPlainObject(n)||(s=se.isArray(n)))?(s?(s=!1,r=i&&se.isArray(i)?i:[]):r=i&&se.isPlainObject(i)?i:{},a[t]=se.extend(h,r,n)):void 0!==n&&(a[t]=n));return a},se.extend({expando:"jQuery"+("2.2.4"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===se.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=e&&e.toString();return!se.isArray(e)&&t-parseFloat(t)+1>=0},isPlainObject:function(e){var t;if("object"!==se.type(e)||e.nodeType||se.isWindow(e))return!1;if(e.constructor&&!ie.call(e,"constructor")&&!ie.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||ie.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ee[te.call(e)]||"object":typeof e},globalEval:function(e){var t,i=eval;(e=se.trim(e))&&(1===e.indexOf("use strict")?((t=Z.createElement("script")).text=e,Z.head.appendChild(t).parentNode.removeChild(t)):i(e))},camelCase:function(e){return e.replace(ae,"ms-").replace(oe,le)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,s=0;if(i(e))for(n=e.length;s<n&&!1!==t.call(e[s],s,e[s]);s++);else for(s in e)if(!1===t.call(e[s],s,e[s]))break;return e},trim:function(e){return null==e?"":(e+"").replace(re,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(i(Object(e))?se.merge(n,"string"==typeof e?[e]:e):Q.call(n,e)),n},inArray:function(e,t,i){return null==t?-1:J.call(t,e,i)},merge:function(e,t){for(var i=+t.length,n=0,s=e.length;n<i;n++)e[s++]=t[n];return e.length=s,e},grep:function(e,t,i){for(var n=[],s=0,r=e.length,a=!i;s<r;s++)!t(e[s],s)!==a&&n.push(e[s]);return n},map:function(e,t,n){var s,r,a=0,o=[];if(i(e))for(s=e.length;a<s;a++)null!=(r=t(e[a],a,n))&&o.push(r);else for(a in e)null!=(r=t(e[a],a,n))&&o.push(r);return K.apply([],o)},guid:1,proxy:function(e,t){var i,n,s;if("string"==typeof t&&(i=e[t],t=e,e=i),se.isFunction(e))return n=$.call(arguments,2),s=function(){return e.apply(t||this,n.concat($.call(arguments)))},s.guid=e.guid=e.guid||se.guid++,s},now:Date.now,support:ne}),"function"==typeof Symbol&&(se.fn[Symbol.iterator]=X[Symbol.iterator]),se.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){ee["[object "+t+"]"]=t.toLowerCase()});var he=function(e){function t(e,t,i,n){var s,r,a,o,h,p,c,d,f=t&&t.ownerDocument,m=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==m&&9!==m&&11!==m)return i;if(!n&&((t?t.ownerDocument||t:z)!==M&&P(t),t=t||M,k)){if(11!==m&&(p=me.exec(e)))if(s=p[1]){if(9===m){if(!(a=t.getElementById(s)))return i;if(a.id===s)return i.push(a),i}else if(f&&(a=f.getElementById(s))&&I(t,a)&&a.id===s)return i.push(a),i}else{if(p[2])return $.apply(i,t.getElementsByTagName(e)),i;if((s=p[3])&&L.getElementsByClassName&&t.getElementsByClassName)return $.apply(i,t.getElementsByClassName(s)),i}if(L.qsa&&!j[e+" "]&&(!A||!A.test(e))){if(1!==m)f=t,d=e;else if("object"!==t.nodeName.toLowerCase()){for((o=t.getAttribute("id"))?o=o.replace(ge,"\\$&"):t.setAttribute("id",o=R),r=(c=S(e)).length,h=ue.test(o)?"#"+o:"[id='"+o+"']";r--;)c[r]=h+" "+u(c[r]);d=c.join(","),f=ye.test(e)&&l(t.parentNode)||t}if(d)try{return $.apply(i,f.querySelectorAll(d)),i}catch(e){}finally{o===R&&t.removeAttribute("id")}}}return x(e.replace(re,"$1"),t,i,n)}function i(){function e(i,n){return t.push(i+" ")>O.cacheLength&&delete e[t.shift()],e[i+" "]=n}var t=[];return e}function n(e){return e[R]=!0,e}function s(e){var t=M.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function r(e,t){for(var i=e.split("|"),n=i.length;n--;)O.attrHandle[i[n]]=t}function a(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||V)-(~e.sourceIndex||V);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function o(e){return n(function(t){return t=+t,n(function(i,n){for(var s,r=e([],i.length,t),a=r.length;a--;)i[s=r[a]]&&(i[s]=!(n[s]=i[s]))})})}function l(e){return e&&void 0!==e.getElementsByTagName&&e}function h(){}function u(e){for(var t=0,i=e.length,n="";t<i;t++)n+=e[t].value;return n}function p(e,t,i){var n=t.dir,s=i&&"parentNode"===n,r=B++;return t.first?function(t,i,r){for(;t=t[n];)if(1===t.nodeType||s)return e(t,i,r)}:function(t,i,a){var o,l,h,u=[U,r];if(a){for(;t=t[n];)if((1===t.nodeType||s)&&e(t,i,a))return!0}else for(;t=t[n];)if(1===t.nodeType||s){if(h=t[R]||(t[R]={}),l=h[t.uniqueID]||(h[t.uniqueID]={}),(o=l[n])&&o[0]===U&&o[1]===r)return u[2]=o[2];if(l[n]=u,u[2]=e(t,i,a))return!0}}}function c(e){return e.length>1?function(t,i,n){for(var s=e.length;s--;)if(!e[s](t,i,n))return!1;return!0}:e[0]}function d(e,i,n){for(var s=0,r=i.length;s<r;s++)t(e,i[s],n);return n}function f(e,t,i,n,s){for(var r,a=[],o=0,l=e.length,h=null!=t;o<l;o++)(r=e[o])&&(i&&!i(r,n,s)||(a.push(r),h&&t.push(o)));return a}function m(e,t,i,s,r,a){return s&&!s[R]&&(s=m(s)),r&&!r[R]&&(r=m(r,a)),n(function(n,a,o,l){var h,u,p,c=[],m=[],y=a.length,g=n||d(t||"*",o.nodeType?[o]:o,[]),v=!e||!n&&t?g:f(g,c,e,o,l),L=i?r||(n?e:y||s)?[]:a:v;if(i&&i(v,L,o,l),s)for(h=f(L,m),s(h,[],o,l),u=h.length;u--;)(p=h[u])&&(L[m[u]]=!(v[m[u]]=p));if(n){if(r||e){if(r){for(h=[],u=L.length;u--;)(p=L[u])&&h.push(v[u]=p);r(null,L=[],h,l)}for(u=L.length;u--;)(p=L[u])&&(h=r?Q(n,p):c[u])>-1&&(n[h]=!(a[h]=p))}}else L=f(L===a?L.splice(y,L.length):L),r?r(null,a,L,l):$.apply(a,L)})}function y(e){for(var t,i,n,s=e.length,r=O.relative[e[0].type],a=r||O.relative[" "],o=r?1:0,l=p(function(e){return e===t},a,!0),h=p(function(e){return Q(t,e)>-1},a,!0),d=[function(e,i,n){var s=!r&&(n||i!==_)||((t=i).nodeType?l(e,i,n):h(e,i,n));return t=null,s}];o<s;o++)if(i=O.relative[e[o].type])d=[p(c(d),i)];else{if((i=O.filter[e[o].type].apply(null,e[o].matches))[R]){for(n=++o;n<s&&!O.relative[e[n].type];n++);return m(o>1&&c(d),o>1&&u(e.slice(0,o-1).concat({value:" "===e[o-2].type?"*":""})).replace(re,"$1"),i,o<n&&y(e.slice(o,n)),n<s&&y(e=e.slice(n)),n<s&&u(e))}d.push(i)}return c(d)}function g(e,i){var s=i.length>0,r=e.length>0,a=function(n,a,o,l,h){var u,p,c,d=0,m="0",y=n&&[],g=[],v=_,L=n||r&&O.find.TAG("*",h),b=U+=null==v?1:Math.random()||.1,w=L.length;for(h&&(_=a===M||a||h);m!==w&&null!=(u=L[m]);m++){if(r&&u){for(p=0,a||u.ownerDocument===M||(P(u),o=!k);c=e[p++];)if(c(u,a||M,o)){l.push(u);break}h&&(U=b)}s&&((u=!c&&u)&&d--,n&&y.push(u))}if(d+=m,s&&m!==d){for(p=0;c=i[p++];)c(y,g,a,o);if(n){if(d>0)for(;m--;)y[m]||g[m]||(g[m]=X.call(l));g=f(g)}$.apply(l,g),h&&!n&&g.length>0&&d+i.length>1&&t.uniqueSort(l)}return h&&(U=b,_=v),y};return s?n(a):a}var v,L,O,b,w,S,C,x,_,E,N,P,M,T,k,A,F,D,I,R="sizzle"+1*new Date,z=e.document,U=0,B=0,G=i(),H=i(),j=i(),W=function(e,t){return e===t&&(N=!0),0},V=1<<31,q={}.hasOwnProperty,Y=[],X=Y.pop,Z=Y.push,$=Y.push,K=Y.slice,Q=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ee="[\\x20\\t\\r\\n\\f]",te="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie="\\["+ee+"*("+te+")(?:"+ee+"*([*^$|!~]?=)"+ee+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+te+"))|)"+ee+"*\\]",ne=":("+te+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ie+")*)|.*)\\)|)",se=new RegExp(ee+"+","g"),re=new RegExp("^"+ee+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ee+"+$","g"),ae=new RegExp("^"+ee+"*,"+ee+"*"),oe=new RegExp("^"+ee+"*([>+~]|"+ee+")"+ee+"*"),le=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),he=new RegExp(ne),ue=new RegExp("^"+te+"$"),pe={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+ne),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},ce=/^(?:input|select|textarea|button)$/i,de=/^h\d$/i,fe=/^[^{]+\{\s*\[native \w/,me=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,ge=/'|\\/g,ve=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),Le=function(e,t,i){var n="0x"+t-65536;return n!==n||i?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},Oe=function(){P()};try{$.apply(Y=K.call(z.childNodes),z.childNodes),Y[z.childNodes.length].nodeType}catch(e){$={apply:Y.length?function(e,t){Z.apply(e,K.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}L=t.support={},w=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},P=t.setDocument=function(e){var t,i,n=e?e.ownerDocument||e:z;return n!==M&&9===n.nodeType&&n.documentElement?(M=n,T=M.documentElement,k=!w(M),(i=M.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",Oe,!1):i.attachEvent&&i.attachEvent("onunload",Oe)),L.attributes=s(function(e){return e.className="i",!e.getAttribute("className")}),L.getElementsByTagName=s(function(e){return e.appendChild(M.createComment("")),!e.getElementsByTagName("*").length}),L.getElementsByClassName=fe.test(M.getElementsByClassName),L.getById=s(function(e){return T.appendChild(e).id=R,!M.getElementsByName||!M.getElementsByName(R).length}),L.getById?(O.find.ID=function(e,t){if(void 0!==t.getElementById&&k){var i=t.getElementById(e);return i?[i]:[]}},O.filter.ID=function(e){var t=e.replace(ve,Le);return function(e){return e.getAttribute("id")===t}}):(delete O.find.ID,O.filter.ID=function(e){var t=e.replace(ve,Le);return function(e){var i=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}}),O.find.TAG=L.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):L.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,n=[],s=0,r=t.getElementsByTagName(e);if("*"===e){for(;i=r[s++];)1===i.nodeType&&n.push(i);return n}return r},O.find.CLASS=L.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&k)return t.getElementsByClassName(e)},F=[],A=[],(L.qsa=fe.test(M.querySelectorAll))&&(s(function(e){T.appendChild(e).innerHTML="<a id='"+R+"'></a><select id='"+R+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&A.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||A.push("\\["+ee+"*(?:value|"+J+")"),e.querySelectorAll("[id~="+R+"-]").length||A.push("~="),e.querySelectorAll(":checked").length||A.push(":checked"),e.querySelectorAll("a#"+R+"+*").length||A.push(".#.+[+~]")}),s(function(e){var t=M.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&A.push("name"+ee+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||A.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),A.push(",.*:")})),(L.matchesSelector=fe.test(D=T.matches||T.webkitMatchesSelector||T.mozMatchesSelector||T.oMatchesSelector||T.msMatchesSelector))&&s(function(e){L.disconnectedMatch=D.call(e,"div"),D.call(e,"[s!='']:x"),F.push("!=",ne)}),A=A.length&&new RegExp(A.join("|")),F=F.length&&new RegExp(F.join("|")),t=fe.test(T.compareDocumentPosition),I=t||fe.test(T.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=t?function(e,t){if(e===t)return N=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!L.sortDetached&&t.compareDocumentPosition(e)===i?e===M||e.ownerDocument===z&&I(z,e)?-1:t===M||t.ownerDocument===z&&I(z,t)?1:E?Q(E,e)-Q(E,t):0:4&i?-1:1)}:function(e,t){if(e===t)return N=!0,0;var i,n=0,s=e.parentNode,r=t.parentNode,o=[e],l=[t];if(!s||!r)return e===M?-1:t===M?1:s?-1:r?1:E?Q(E,e)-Q(E,t):0;if(s===r)return a(e,t);for(i=e;i=i.parentNode;)o.unshift(i);for(i=t;i=i.parentNode;)l.unshift(i);for(;o[n]===l[n];)n++;return n?a(o[n],l[n]):o[n]===z?-1:l[n]===z?1:0},M):M},t.matches=function(e,i){return t(e,null,null,i)},t.matchesSelector=function(e,i){if((e.ownerDocument||e)!==M&&P(e),i=i.replace(le,"='$1']"),L.matchesSelector&&k&&!j[i+" "]&&(!F||!F.test(i))&&(!A||!A.test(i)))try{var n=D.call(e,i);if(n||L.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return t(i,M,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==M&&P(e),I(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==M&&P(e);var i=O.attrHandle[t.toLowerCase()],n=i&&q.call(O.attrHandle,t.toLowerCase())?i(e,t,!k):void 0;return void 0!==n?n:L.attributes||!k?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,i=[],n=0,s=0;if(N=!L.detectDuplicates,E=!L.sortStable&&e.slice(0),e.sort(W),N){for(;t=e[s++];)t===e[s]&&(n=i.push(s));for(;n--;)e.splice(i[n],1)}return E=null,e},b=t.getText=function(e){var t,i="",n=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=b(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[n++];)i+=b(t);return i},(O=t.selectors={cacheLength:50,createPseudo:n,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ve,Le),e[3]=(e[3]||e[4]||e[5]||"").replace(ve,Le),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&he.test(i)&&(t=S(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ve,Le).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=G[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&G(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,i,n){return function(s){var r=t.attr(s,e);return null==r?"!="===i:!i||(r+="","="===i?r===n:"!="===i?r!==n:"^="===i?n&&0===r.indexOf(n):"*="===i?n&&r.indexOf(n)>-1:"$="===i?n&&r.slice(-n.length)===n:"~="===i?(" "+r.replace(se," ")+" ").indexOf(n)>-1:"|="===i&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,i,n,s){var r="nth"!==e.slice(0,3),a="last"!==e.slice(-4),o="of-type"===t;return 1===n&&0===s?function(e){return!!e.parentNode}:function(t,i,l){var h,u,p,c,d,f,m=r!==a?"nextSibling":"previousSibling",y=t.parentNode,g=o&&t.nodeName.toLowerCase(),v=!l&&!o,L=!1;if(y){if(r){for(;m;){for(c=t;c=c[m];)if(o?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?y.firstChild:y.lastChild],a&&v){for(L=(d=(h=(u=(p=(c=y)[R]||(c[R]={}))[c.uniqueID]||(p[c.uniqueID]={}))[e]||[])[0]===U&&h[1])&&h[2],c=d&&y.childNodes[d];c=++d&&c&&c[m]||(L=d=0)||f.pop();)if(1===c.nodeType&&++L&&c===t){u[e]=[U,d,L];break}}else if(v&&(L=d=(h=(u=(p=(c=t)[R]||(c[R]={}))[c.uniqueID]||(p[c.uniqueID]={}))[e]||[])[0]===U&&h[1]),!1===L)for(;(c=++d&&c&&c[m]||(L=d=0)||f.pop())&&((o?c.nodeName.toLowerCase()!==g:1!==c.nodeType)||!++L||(v&&((u=(p=c[R]||(c[R]={}))[c.uniqueID]||(p[c.uniqueID]={}))[e]=[U,L]),c!==t)););return(L-=s)===n||L%n==0&&L/n>=0}}},PSEUDO:function(e,i){var s,r=O.pseudos[e]||O.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return r[R]?r(i):r.length>1?(s=[e,e,"",i],O.setFilters.hasOwnProperty(e.toLowerCase())?n(function(e,t){for(var n,s=r(e,i),a=s.length;a--;)e[n=Q(e,s[a])]=!(t[n]=s[a])}):function(e){return r(e,0,s)}):r}},pseudos:{not:n(function(e){var t=[],i=[],s=C(e.replace(re,"$1"));return s[R]?n(function(e,t,i,n){for(var r,a=s(e,null,n,[]),o=e.length;o--;)(r=a[o])&&(e[o]=!(t[o]=r))}):function(e,n,r){return t[0]=e,s(t,null,r,i),t[0]=null,!i.pop()}}),has:n(function(e){return function(i){return t(e,i).length>0}}),contains:n(function(e){return e=e.replace(ve,Le),function(t){return(t.textContent||t.innerText||b(t)).indexOf(e)>-1}}),lang:n(function(e){return ue.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ve,Le).toLowerCase(),function(t){var i;do{if(i=k?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===T},focus:function(e){return e===M.activeElement&&(!M.hasFocus||M.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!O.pseudos.empty(e)},header:function(e){return de.test(e.nodeName)},input:function(e){return ce.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:o(function(){return[0]}),last:o(function(e,t){return[t-1]}),eq:o(function(e,t,i){return[i<0?i+t:i]}),even:o(function(e,t){for(var i=0;i<t;i+=2)e.push(i);return e}),odd:o(function(e,t){for(var i=1;i<t;i+=2)e.push(i);return e}),lt:o(function(e,t,i){for(var n=i<0?i+t:i;--n>=0;)e.push(n);return e}),gt:o(function(e,t,i){for(var n=i<0?i+t:i;++n<t;)e.push(n);return e})}}).pseudos.nth=O.pseudos.eq;for(v in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})O.pseudos[v]=function(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}(v);for(v in{submit:!0,reset:!0})O.pseudos[v]=function(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}(v);return h.prototype=O.filters=O.pseudos,O.setFilters=new h,S=t.tokenize=function(e,i){var n,s,r,a,o,l,h,u=H[e+" "];if(u)return i?0:u.slice(0);for(o=e,l=[],h=O.preFilter;o;){n&&!(s=ae.exec(o))||(s&&(o=o.slice(s[0].length)||o),l.push(r=[])),n=!1,(s=oe.exec(o))&&(n=s.shift(),r.push({value:n,type:s[0].replace(re," ")}),o=o.slice(n.length));for(a in O.filter)!(s=pe[a].exec(o))||h[a]&&!(s=h[a](s))||(n=s.shift(),r.push({value:n,type:a,matches:s}),o=o.slice(n.length));if(!n)break}return i?o.length:o?t.error(e):H(e,l).slice(0)},C=t.compile=function(e,t){var i,n=[],s=[],r=j[e+" "];if(!r){for(t||(t=S(e)),i=t.length;i--;)(r=y(t[i]))[R]?n.push(r):s.push(r);(r=j(e,g(s,n))).selector=e}return r},x=t.select=function(e,t,i,n){var s,r,a,o,h,p="function"==typeof e&&e,c=!n&&S(e=p.selector||e);if(i=i||[],1===c.length){if((r=c[0]=c[0].slice(0)).length>2&&"ID"===(a=r[0]).type&&L.getById&&9===t.nodeType&&k&&O.relative[r[1].type]){if(!(t=(O.find.ID(a.matches[0].replace(ve,Le),t)||[])[0]))return i;p&&(t=t.parentNode),e=e.slice(r.shift().value.length)}for(s=pe.needsContext.test(e)?0:r.length;s--&&(a=r[s],!O.relative[o=a.type]);)if((h=O.find[o])&&(n=h(a.matches[0].replace(ve,Le),ye.test(r[0].type)&&l(t.parentNode)||t))){if(r.splice(s,1),!(e=n.length&&u(r)))return $.apply(i,n),i;break}}return(p||C(e,c))(n,t,!k,i,!t||ye.test(e)&&l(t.parentNode)||t),i},L.sortStable=R.split("").sort(W).join("")===R,L.detectDuplicates=!!N,P(),L.sortDetached=s(function(e){return 1&e.compareDocumentPosition(M.createElement("div"))}),s(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||r("type|href|height|width",function(e,t,i){if(!i)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),L.attributes&&s(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||r("value",function(e,t,i){if(!i&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),s(function(e){return null==e.getAttribute("disabled")})||r(J,function(e,t,i){var n;if(!i)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),t}(e);se.find=he,se.expr=he.selectors,se.expr[":"]=se.expr.pseudos,se.uniqueSort=se.unique=he.uniqueSort,se.text=he.getText,se.isXMLDoc=he.isXML,se.contains=he.contains;var ue=function(e,t,i){for(var n=[],s=void 0!==i;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(s&&se(e).is(i))break;n.push(e)}return n},pe=function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i},ce=se.expr.match.needsContext,de=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,fe=/^.[^:#\[\.,]*$/;se.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?se.find.matchesSelector(n,e)?[n]:[]:se.find.matches(e,se.grep(t,function(e){return 1===e.nodeType}))},se.fn.extend({find:function(e){var t,i=this.length,n=[],s=this;if("string"!=typeof e)return this.pushStack(se(e).filter(function(){for(t=0;t<i;t++)if(se.contains(s[t],this))return!0}));for(t=0;t<i;t++)se.find(e,s[t],n);return n=this.pushStack(i>1?se.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(n(this,e||[],!1))},not:function(e){return this.pushStack(n(this,e||[],!0))},is:function(e){return!!n(this,"string"==typeof e&&ce.test(e)?se(e):e||[],!1).length}});var me,ye=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(se.fn.init=function(e,t,i){var n,s;if(!e)return this;if(i=i||me,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:ye.exec(e))||!n[1]&&t)return!t||t.jquery?(t||i).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof se?t[0]:t,se.merge(this,se.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:Z,!0)),de.test(n[1])&&se.isPlainObject(t))for(n in t)se.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(s=Z.getElementById(n[2]))&&s.parentNode&&(this.length=1,this[0]=s),this.context=Z,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):se.isFunction(e)?void 0!==i.ready?i.ready(e):e(se):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),se.makeArray(e,this))}).prototype=se.fn,me=se(Z);var ge=/^(?:parents|prev(?:Until|All))/,ve={children:!0,contents:!0,next:!0,prev:!0};se.fn.extend({has:function(e){var t=se(e,this),i=t.length;return this.filter(function(){for(var e=0;e<i;e++)if(se.contains(this,t[e]))return!0})},closest:function(e,t){for(var i,n=0,s=this.length,r=[],a=ce.test(e)||"string"!=typeof e?se(e,t||this.context):0;n<s;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&se.find.matchesSelector(i,e))){r.push(i);break}return this.pushStack(r.length>1?se.uniqueSort(r):r)},index:function(e){return e?"string"==typeof e?J.call(se(e),this[0]):J.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(se.uniqueSort(se.merge(this.get(),se(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),se.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ue(e,"parentNode")},parentsUntil:function(e,t,i){return ue(e,"parentNode",i)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return ue(e,"nextSibling")},prevAll:function(e){return ue(e,"previousSibling")},nextUntil:function(e,t,i){return ue(e,"nextSibling",i)},prevUntil:function(e,t,i){return ue(e,"previousSibling",i)},siblings:function(e){return pe((e.parentNode||{}).firstChild,e)},children:function(e){return pe(e.firstChild)},contents:function(e){return e.contentDocument||se.merge([],e.childNodes)}},function(e,t){se.fn[e]=function(i,n){var s=se.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(s=se.filter(n,s)),this.length>1&&(ve[e]||se.uniqueSort(s),ge.test(e)&&s.reverse()),this.pushStack(s)}});var Le=/\S+/g;se.Callbacks=function(e){e="string"==typeof e?r(e):se.extend({},e);var t,i,n,s,a=[],o=[],l=-1,h=function(){for(s=e.once,n=t=!0;o.length;l=-1)for(i=o.shift();++l<a.length;)!1===a[l].apply(i[0],i[1])&&e.stopOnFalse&&(l=a.length,i=!1);e.memory||(i=!1),t=!1,s&&(a=i?[]:"")},u={add:function(){return a&&(i&&!t&&(l=a.length-1,o.push(i)),function t(i){se.each(i,function(i,n){se.isFunction(n)?e.unique&&u.has(n)||a.push(n):n&&n.length&&"string"!==se.type(n)&&t(n)})}(arguments),i&&!t&&h()),this},remove:function(){return se.each(arguments,function(e,t){for(var i;(i=se.inArray(t,a,i))>-1;)a.splice(i,1),i<=l&&l--}),this},has:function(e){return e?se.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return s=o=[],a=i="",this},disabled:function(){return!a},lock:function(){return s=o=[],i||(a=i=""),this},locked:function(){return!!s},fireWith:function(e,i){return s||(i=[e,(i=i||[]).slice?i.slice():i],o.push(i),t||h()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},se.extend({Deferred:function(e){var t=[["resolve","done",se.Callbacks("once memory"),"resolved"],["reject","fail",se.Callbacks("once memory"),"rejected"],["notify","progress",se.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return se.Deferred(function(i){se.each(t,function(t,r){var a=se.isFunction(e[t])&&e[t];s[r[1]](function(){var e=a&&a.apply(this,arguments);e&&se.isFunction(e.promise)?e.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[r[0]+"With"](this===n?i.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?se.extend(e,n):n}},s={};return n.pipe=n.then,se.each(t,function(e,r){var a=r[2],o=r[3];n[r[1]]=a.add,o&&a.add(function(){i=o},t[1^e][2].disable,t[2][2].lock),s[r[0]]=function(){return s[r[0]+"With"](this===s?n:this,arguments),this},s[r[0]+"With"]=a.fireWith}),n.promise(s),e&&e.call(s,s),s},when:function(e){var t,i,n,s=0,r=$.call(arguments),a=r.length,o=1!==a||e&&se.isFunction(e.promise)?a:0,l=1===o?e:se.Deferred(),h=function(e,i,n){return function(s){i[e]=this,n[e]=arguments.length>1?$.call(arguments):s,n===t?l.notifyWith(i,n):--o||l.resolveWith(i,n)}};if(a>1)for(t=new Array(a),i=new Array(a),n=new Array(a);s<a;s++)r[s]&&se.isFunction(r[s].promise)?r[s].promise().progress(h(s,i,t)).done(h(s,n,r)).fail(l.reject):--o;return o||l.resolveWith(n,r),l.promise()}});var Oe;se.fn.ready=function(e){return se.ready.promise().done(e),this},se.extend({isReady:!1,readyWait:1,holdReady:function(e){e?se.readyWait++:se.ready(!0)},ready:function(e){(!0===e?--se.readyWait:se.isReady)||(se.isReady=!0,!0!==e&&--se.readyWait>0||(Oe.resolveWith(Z,[se]),se.fn.triggerHandler&&(se(Z).triggerHandler("ready"),se(Z).off("ready"))))}}),se.ready.promise=function(t){return Oe||(Oe=se.Deferred(),"complete"===Z.readyState||"loading"!==Z.readyState&&!Z.documentElement.doScroll?e.setTimeout(se.ready):(Z.addEventListener("DOMContentLoaded",a),e.addEventListener("load",a))),Oe.promise(t)},se.ready.promise();var be=function(e,t,i,n,s,r,a){var o=0,l=e.length,h=null==i;if("object"===se.type(i)){s=!0;for(o in i)be(e,t,o,i[o],!0,r,a)}else if(void 0!==n&&(s=!0,se.isFunction(n)||(a=!0),h&&(a?(t.call(e,n),t=null):(h=t,t=function(e,t,i){return h.call(se(e),i)})),t))for(;o<l;o++)t(e[o],i,a?n:n.call(e[o],o,t(e[o],i)));return s?e:h?t.call(e):l?t(e[0],i):r},we=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};o.uid=1,o.prototype={register:function(e,t){var i=t||{};return e.nodeType?e[this.expando]=i:Object.defineProperty(e,this.expando,{value:i,writable:!0,configurable:!0}),e[this.expando]},cache:function(e){if(!we(e))return{};var t=e[this.expando];return t||(t={},we(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,i){var n,s=this.cache(e);if("string"==typeof t)s[t]=i;else for(n in t)s[n]=t[n];return s},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][t]},access:function(e,t,i){var n;return void 0===t||t&&"string"==typeof t&&void 0===i?(n=this.get(e,t),void 0!==n?n:this.get(e,se.camelCase(t))):(this.set(e,t,i),void 0!==i?i:t)},remove:function(e,t){var i,n,s,r=e[this.expando];if(void 0!==r){if(void 0===t)this.register(e);else{se.isArray(t)?n=t.concat(t.map(se.camelCase)):(s=se.camelCase(t),n=t in r?[t,s]:(n=s)in r?[n]:n.match(Le)||[]),i=n.length;for(;i--;)delete r[n[i]]}(void 0===t||se.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!se.isEmptyObject(t)}};var Se=new o,Ce=new o,xe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,_e=/[A-Z]/g;se.extend({hasData:function(e){return Ce.hasData(e)||Se.hasData(e)},data:function(e,t,i){return Ce.access(e,t,i)},removeData:function(e,t){Ce.remove(e,t)},_data:function(e,t,i){return Se.access(e,t,i)},_removeData:function(e,t){Se.remove(e,t)}}),se.fn.extend({data:function(e,t){var i,n,s,r=this[0],a=r&&r.attributes;if(void 0===e){if(this.length&&(s=Ce.get(r),1===r.nodeType&&!Se.get(r,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&0===(n=a[i].name).indexOf("data-")&&(n=se.camelCase(n.slice(5)),l(r,n,s[n]));Se.set(r,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){Ce.set(this,e)}):be(this,function(t){var i,n;if(r&&void 0===t){if(void 0!==(i=Ce.get(r,e)||Ce.get(r,e.replace(_e,"-$&").toLowerCase())))return i;if(n=se.camelCase(e),void 0!==(i=Ce.get(r,n)))return i;if(void 0!==(i=l(r,n,void 0)))return i}else n=se.camelCase(e),this.each(function(){var i=Ce.get(this,n);Ce.set(this,n,t),e.indexOf("-")>-1&&void 0!==i&&Ce.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Ce.remove(this,e)})}}),se.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=Se.get(e,t),i&&(!n||se.isArray(i)?n=Se.access(e,t,se.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=se.queue(e,t),n=i.length,s=i.shift(),r=se._queueHooks(e,t),a=function(){se.dequeue(e,t)};"inprogress"===s&&(s=i.shift(),n--),s&&("fx"===t&&i.unshift("inprogress"),delete r.stop,s.call(e,a,r)),!n&&r&&r.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return Se.get(e,i)||Se.access(e,i,{empty:se.Callbacks("once memory").add(function(){Se.remove(e,[t+"queue",i])})})}}),se.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length<i?se.queue(this[0],e):void 0===t?this:this.each(function(){var i=se.queue(this,e,t);se._queueHooks(this,e),"fx"===e&&"inprogress"!==i[0]&&se.dequeue(this,e)})},dequeue:function(e){return this.each(function(){se.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,s=se.Deferred(),r=this,a=this.length,o=function(){--n||s.resolveWith(r,[r])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(i=Se.get(r[a],e+"queueHooks"))&&i.empty&&(n++,i.empty.add(o));return o(),s.promise(t)}});var Ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ne=new RegExp("^(?:([+-])=|)("+Ee+")([a-z%]*)$","i"),Pe=["Top","Right","Bottom","Left"],Me=function(e,t){return e=t||e,"none"===se.css(e,"display")||!se.contains(e.ownerDocument,e)},Te=/^(?:checkbox|radio)$/i,ke=/<([\w:-]+)/,Ae=/^$|\/(?:java|ecma)script/i,Fe={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Fe.optgroup=Fe.option,Fe.tbody=Fe.tfoot=Fe.colgroup=Fe.caption=Fe.thead,Fe.th=Fe.td;var De=/<|&#?\w+;/;!function(){var e=Z.createDocumentFragment().appendChild(Z.createElement("div")),t=Z.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),ne.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",ne.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Ie=/^key/,Re=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ze=/^([^.]*)(?:\.(.+)|)/;se.event={global:{},add:function(e,t,i,n,s){var r,a,o,l,h,u,p,c,d,f,m,y=Se.get(e);if(y)for(i.handler&&(i=(r=i).handler,s=r.selector),i.guid||(i.guid=se.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(t){return void 0!==se&&se.event.triggered!==t.type?se.event.dispatch.apply(e,arguments):void 0}),h=(t=(t||"").match(Le)||[""]).length;h--;)d=m=(o=ze.exec(t[h])||[])[1],f=(o[2]||"").split(".").sort(),d&&(p=se.event.special[d]||{},d=(s?p.delegateType:p.bindType)||d,p=se.event.special[d]||{},u=se.extend({type:d,origType:m,data:n,handler:i,guid:i.guid,selector:s,needsContext:s&&se.expr.match.needsContext.test(s),namespace:f.join(".")},r),(c=l[d])||((c=l[d]=[]).delegateCount=0,p.setup&&!1!==p.setup.call(e,n,f,a)||e.addEventListener&&e.addEventListener(d,a)),p.add&&(p.add.call(e,u),u.handler.guid||(u.handler.guid=i.guid)),s?c.splice(c.delegateCount++,0,u):c.push(u),se.event.global[d]=!0)},remove:function(e,t,i,n,s){var r,a,o,l,h,u,p,c,d,f,m,y=Se.hasData(e)&&Se.get(e);if(y&&(l=y.events)){for(h=(t=(t||"").match(Le)||[""]).length;h--;)if(o=ze.exec(t[h])||[],d=m=o[1],f=(o[2]||"").split(".").sort(),d){for(p=se.event.special[d]||{},c=l[d=(n?p.delegateType:p.bindType)||d]||[],o=o[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=r=c.length;r--;)u=c[r],!s&&m!==u.origType||i&&i.guid!==u.guid||o&&!o.test(u.namespace)||n&&n!==u.selector&&("**"!==n||!u.selector)||(c.splice(r,1),u.selector&&c.delegateCount--,p.remove&&p.remove.call(e,u));a&&!c.length&&(p.teardown&&!1!==p.teardown.call(e,f,y.handle)||se.removeEvent(e,d,y.handle),delete l[d])}else for(d in l)se.event.remove(e,d+t[h],i,n,!0);se.isEmptyObject(l)&&Se.remove(e,"handle events")}},dispatch:function(e){e=se.event.fix(e);var t,i,n,s,r,a=[],o=$.call(arguments),l=(Se.get(this,"events")||{})[e.type]||[],h=se.event.special[e.type]||{};if(o[0]=e,e.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,e)){for(a=se.event.handlers.call(this,e,l),t=0;(s=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=s.elem,i=0;(r=s.handlers[i++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(r.namespace)||(e.handleObj=r,e.data=r.data,void 0!==(n=((se.event.special[r.origType]||{}).handle||r.handler).apply(s.elem,o))&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,e),e.result}},handlers:function(e,t){var i,n,s,r,a=[],o=t.delegateCount,l=e.target;if(o&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(n=[],i=0;i<o;i++)void 0===n[s=(r=t[i]).selector+" "]&&(n[s]=r.needsContext?se(s,this).index(l)>-1:se.find(s,this,null,[l]).length),n[s]&&n.push(r);n.length&&a.push({elem:l,handlers:n})}return o<t.length&&a.push({elem:this,handlers:t.slice(o)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var i,n,s,r=t.button;return null==e.pageX&&null!=t.clientX&&(n=(i=e.target.ownerDocument||Z).documentElement,s=i.body,e.pageX=t.clientX+(n&&n.scrollLeft||s&&s.scrollLeft||0)-(n&&n.clientLeft||s&&s.clientLeft||0),e.pageY=t.clientY+(n&&n.scrollTop||s&&s.scrollTop||0)-(n&&n.clientTop||s&&s.clientTop||0)),e.which||void 0===r||(e.which=1&r?1:2&r?3:4&r?2:0),e}},fix:function(e){if(e[se.expando])return e;var t,i,n,s=e.type,r=e,a=this.fixHooks[s];for(a||(this.fixHooks[s]=a=Re.test(s)?this.mouseHooks:Ie.test(s)?this.keyHooks:{}),n=a.props?this.props.concat(a.props):this.props,e=new se.Event(r),t=n.length;t--;)e[i=n[t]]=r[i];return e.target||(e.target=Z),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,r):e},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==m()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===m()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&se.nodeName(this,"input"))return this.click(),!1},_default:function(e){return se.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},se.removeEvent=function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i)},se.Event=function(e,t){if(!(this instanceof se.Event))return new se.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?d:f):this.type=e,t&&se.extend(this,t),this.timeStamp=e&&e.timeStamp||se.now(),this[se.expando]=!0},se.Event.prototype={constructor:se.Event,isDefaultPrevented:f,isPropagationStopped:f,isImmediatePropagationStopped:f,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=d,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=d,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=d,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},se.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){se.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=this,s=e.relatedTarget,r=e.handleObj;return s&&(s===n||se.contains(n,s))||(e.type=r.origType,i=r.handler.apply(this,arguments),e.type=t),i}}}),se.fn.extend({on:function(e,t,i,n){return y(this,e,t,i,n)},one:function(e,t,i,n){return y(this,e,t,i,n,1)},off:function(e,t,i){var n,s;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,se(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(s in e)this.off(s,t,e[s]);return this}return!1!==t&&"function"!=typeof t||(i=t,t=void 0),!1===i&&(i=f),this.each(function(){se.event.remove(this,e,i,t)})}});var Ue=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,Be=/<script|<style|<link/i,Ge=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^true\/(.*)/,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;se.extend({htmlPrefilter:function(e){return e.replace(Ue,"<$1></$2>")},clone:function(e,t,i){var n,s,r,a,o=e.cloneNode(!0),l=se.contains(e.ownerDocument,e);if(!(ne.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||se.isXMLDoc(e)))for(a=u(o),n=0,s=(r=u(e)).length;n<s;n++)b(r[n],a[n]);if(t)if(i)for(r=r||u(e),a=a||u(o),n=0,s=r.length;n<s;n++)O(r[n],a[n]);else O(e,o);return(a=u(o,"script")).length>0&&p(a,!l&&u(e,"script")),o},cleanData:function(e){for(var t,i,n,s=se.event.special,r=0;void 0!==(i=e[r]);r++)if(we(i)){if(t=i[Se.expando]){if(t.events)for(n in t.events)s[n]?se.event.remove(i,n):se.removeEvent(i,n,t.handle);i[Se.expando]=void 0}i[Ce.expando]&&(i[Ce.expando]=void 0)}}}),se.fn.extend({domManip:w,detach:function(e){return S(this,e,!0)},remove:function(e){return S(this,e)},text:function(e){return be(this,function(e){return void 0===e?se.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return w(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||g(this,e).appendChild(e)})},prepend:function(){return w(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=g(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return w(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return w(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(se.cleanData(u(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return se.clone(this,e,t)})},html:function(e){return be(this,function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Be.test(e)&&!Fe[(ke.exec(e)||["",""])[1].toLowerCase()]){e=se.htmlPrefilter(e);try{for(;i<n;i++)1===(t=this[i]||{}).nodeType&&(se.cleanData(u(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return w(this,arguments,function(t){var i=this.parentNode;se.inArray(this,e)<0&&(se.cleanData(u(this)),i&&i.replaceChild(t,this))},e)}}),se.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){se.fn[e]=function(e){for(var i,n=[],s=se(e),r=s.length-1,a=0;a<=r;a++)i=a===r?this:this.clone(!0),se(s[a])[t](i),Q.apply(n,i.get());return this.pushStack(n)}});var We,Ve={HTML:"block",BODY:"block"},qe=/^margin/,Ye=new RegExp("^("+Ee+")(?!px)[a-z%]+$","i"),Xe=function(t){var i=t.ownerDocument.defaultView;return i&&i.opener||(i=e),i.getComputedStyle(t)},Ze=function(e,t,i,n){var s,r,a={};for(r in t)a[r]=e.style[r],e.style[r]=t[r];s=i.apply(e,n||[]);for(r in t)e.style[r]=a[r];return s},$e=Z.documentElement;!function(){function t(){o.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",o.innerHTML="",$e.appendChild(a);var t=e.getComputedStyle(o);i="1%"!==t.top,r="2px"===t.marginLeft,n="4px"===t.width,o.style.marginRight="50%",s="4px"===t.marginRight,$e.removeChild(a)}var i,n,s,r,a=Z.createElement("div"),o=Z.createElement("div");o.style&&(o.style.backgroundClip="content-box",o.cloneNode(!0).style.backgroundClip="",ne.clearCloneStyle="content-box"===o.style.backgroundClip,a.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.appendChild(o),se.extend(ne,{pixelPosition:function(){return t(),i},boxSizingReliable:function(){return null==n&&t(),n},pixelMarginRight:function(){return null==n&&t(),s},reliableMarginLeft:function(){return null==n&&t(),r},reliableMarginRight:function(){var t,i=o.appendChild(Z.createElement("div"));return i.style.cssText=o.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",o.style.width="1px",$e.appendChild(a),t=!parseFloat(e.getComputedStyle(i).marginRight),$e.removeChild(a),o.removeChild(i),t}}))}();var Ke=/^(none|table(?!-c[ea]).+)/,Qe={position:"absolute",visibility:"hidden",display:"block"},Je={letterSpacing:"0",fontWeight:"400"},et=["Webkit","O","Moz","ms"],tt=Z.createElement("div").style;se.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=_(e,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var s,r,a,o=se.camelCase(t),l=e.style;if(t=se.cssProps[o]||(se.cssProps[o]=N(o)||o),a=se.cssHooks[t]||se.cssHooks[o],void 0===i)return a&&"get"in a&&void 0!==(s=a.get(e,!1,n))?s:l[t];"string"===(r=typeof i)&&(s=Ne.exec(i))&&s[1]&&(i=h(e,t,s),r="number"),null!=i&&i===i&&("number"===r&&(i+=s&&s[3]||(se.cssNumber[o]?"":"px")),ne.clearCloneStyle||""!==i||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(i=a.set(e,i,n))||(l[t]=i))}},css:function(e,t,i,n){var s,r,a,o=se.camelCase(t);return t=se.cssProps[o]||(se.cssProps[o]=N(o)||o),(a=se.cssHooks[t]||se.cssHooks[o])&&"get"in a&&(s=a.get(e,!0,i)),void 0===s&&(s=_(e,t,n)),"normal"===s&&t in Je&&(s=Je[t]),""===i||i?(r=parseFloat(s),!0===i||isFinite(r)?r||0:s):s}}),se.each(["height","width"],function(e,t){se.cssHooks[t]={get:function(e,i,n){if(i)return Ke.test(se.css(e,"display"))&&0===e.offsetWidth?Ze(e,Qe,function(){return T(e,t,n)}):T(e,t,n)},set:function(e,i,n){var s,r=n&&Xe(e),a=n&&M(e,t,n,"border-box"===se.css(e,"boxSizing",!1,r),r);return a&&(s=Ne.exec(i))&&"px"!==(s[3]||"px")&&(e.style[t]=i,i=se.css(e,t)),P(e,i,a)}}}),se.cssHooks.marginLeft=E(ne.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_(e,"marginLeft"))||e.getBoundingClientRect().left-Ze(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),se.cssHooks.marginRight=E(ne.reliableMarginRight,function(e,t){if(t)return Ze(e,{display:"inline-block"},_,[e,"marginRight"])}),se.each({margin:"",padding:"",border:"Width"},function(e,t){se.cssHooks[e+t]={expand:function(i){for(var n=0,s={},r="string"==typeof i?i.split(" "):[i];n<4;n++)s[e+Pe[n]+t]=r[n]||r[n-2]||r[0];return s}},qe.test(e)||(se.cssHooks[e+t].set=P)}),se.fn.extend({css:function(e,t){return be(this,function(e,t,i){var n,s,r={},a=0;if(se.isArray(t)){for(n=Xe(e),s=t.length;a<s;a++)r[t[a]]=se.css(e,t[a],!1,n);return r}return void 0!==i?se.style(e,t,i):se.css(e,t)},e,t,arguments.length>1)},show:function(){return k(this,!0)},hide:function(){return k(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Me(this)?se(this).show():se(this).hide()})}}),se.Tween=A,A.prototype={constructor:A,init:function(e,t,i,n,s,r){this.elem=e,this.prop=i,this.easing=s||se.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=r||(se.cssNumber[i]?"":"px")},cur:function(){var e=A.propHooks[this.prop];return e&&e.get?e.get(this):A.propHooks._default.get(this)},run:function(e){var t,i=A.propHooks[this.prop];return this.options.duration?this.pos=t=se.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):A.propHooks._default.set(this),this}},A.prototype.init.prototype=A.prototype,A.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=se.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){se.fx.step[e.prop]?se.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[se.cssProps[e.prop]]&&!se.cssHooks[e.prop]?e.elem[e.prop]=e.now:se.style(e.elem,e.prop,e.now+e.unit)}}},A.propHooks.scrollTop=A.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},se.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},se.fx=A.prototype.init,se.fx.step={};var it,nt,st=/^(?:toggle|show|hide)$/,rt=/queueHooks$/;se.Animation=se.extend(U,{tweeners:{"*":[function(e,t){var i=this.createTween(e,t);return h(i.elem,e,Ne.exec(t),i),i}]},tweener:function(e,t){se.isFunction(e)?(t=e,e=["*"]):e=e.match(Le);for(var i,n=0,s=e.length;n<s;n++)i=e[n],U.tweeners[i]=U.tweeners[i]||[],U.tweeners[i].unshift(t)},prefilters:[R],prefilter:function(e,t){t?U.prefilters.unshift(e):U.prefilters.push(e)}}),se.speed=function(e,t,i){var n=e&&"object"==typeof e?se.extend({},e):{complete:i||!i&&t||se.isFunction(e)&&e,duration:e,easing:i&&t||t&&!se.isFunction(t)&&t};return n.duration=se.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in se.fx.speeds?se.fx.speeds[n.duration]:se.fx.speeds._default,null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){se.isFunction(n.old)&&n.old.call(this),n.queue&&se.dequeue(this,n.queue)},n},se.fn.extend({fadeTo:function(e,t,i,n){return this.filter(Me).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var s=se.isEmptyObject(e),r=se.speed(t,i,n),a=function(){var t=U(this,se.extend({},e),r);(s||Se.get(this,"finish"))&&t.stop(!0)};return a.finish=a,s||!1===r.queue?this.each(a):this.queue(r.queue,a)},stop:function(e,t,i){var n=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,s=null!=e&&e+"queueHooks",r=se.timers,a=Se.get(this);if(s)a[s]&&a[s].stop&&n(a[s]);else for(s in a)a[s]&&a[s].stop&&rt.test(s)&&n(a[s]);for(s=r.length;s--;)r[s].elem!==this||null!=e&&r[s].queue!==e||(r[s].anim.stop(i),t=!1,r.splice(s,1));!t&&i||se.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,i=Se.get(this),n=i[e+"queue"],s=i[e+"queueHooks"],r=se.timers,a=n?n.length:0;for(i.finish=!0,se.queue(this,e,[]),s&&s.stop&&s.stop.call(this,!0),t=r.length;t--;)r[t].elem===this&&r[t].queue===e&&(r[t].anim.stop(!0),r.splice(t,1));for(t=0;t<a;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish})}}),se.each(["toggle","show","hide"],function(e,t){var i=se.fn[t];se.fn[t]=function(e,n,s){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(D(t,!0),e,n,s)}}),se.each({slideDown:D("show"),slideUp:D("hide"),slideToggle:D("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){se.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}}),se.timers=[],se.fx.tick=function(){var e,t=0,i=se.timers;for(it=se.now();t<i.length;t++)(e=i[t])()||i[t]!==e||i.splice(t--,1);i.length||se.fx.stop(),it=void 0},se.fx.timer=function(e){se.timers.push(e),e()?se.fx.start():se.timers.pop()},se.fx.interval=13,se.fx.start=function(){nt||(nt=e.setInterval(se.fx.tick,se.fx.interval))},se.fx.stop=function(){e.clearInterval(nt),nt=null},se.fx.speeds={slow:600,fast:200,_default:400},se.fn.delay=function(t,i){return t=se.fx?se.fx.speeds[t]||t:t,i=i||"fx",this.queue(i,function(i,n){var s=e.setTimeout(i,t);n.stop=function(){e.clearTimeout(s)}})},function(){var e=Z.createElement("input"),t=Z.createElement("select"),i=t.appendChild(Z.createElement("option"));e.type="checkbox",ne.checkOn=""!==e.value,ne.optSelected=i.selected,t.disabled=!0,ne.optDisabled=!i.disabled,(e=Z.createElement("input")).value="t",e.type="radio",ne.radioValue="t"===e.value}();var at,ot=se.expr.attrHandle;se.fn.extend({attr:function(e,t){return be(this,se.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){se.removeAttr(this,e)})}}),se.extend({attr:function(e,t,i){var n,s,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return void 0===e.getAttribute?se.prop(e,t,i):(1===r&&se.isXMLDoc(e)||(t=t.toLowerCase(),s=se.attrHooks[t]||(se.expr.match.bool.test(t)?at:void 0)),void 0!==i?null===i?void se.removeAttr(e,t):s&&"set"in s&&void 0!==(n=s.set(e,i,t))?n:(e.setAttribute(t,i+""),i):s&&"get"in s&&null!==(n=s.get(e,t))?n:(n=se.find.attr(e,t),null==n?void 0:n))},attrHooks:{type:{set:function(e,t){if(!ne.radioValue&&"radio"===t&&se.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},removeAttr:function(e,t){var i,n,s=0,r=t&&t.match(Le);if(r&&1===e.nodeType)for(;i=r[s++];)n=se.propFix[i]||i,se.expr.match.bool.test(i)&&(e[n]=!1),e.removeAttribute(i)}}),at={set:function(e,t,i){return!1===t?se.removeAttr(e,i):e.setAttribute(i,i),i}},se.each(se.expr.match.bool.source.match(/\w+/g),function(e,t){var i=ot[t]||se.find.attr;ot[t]=function(e,t,n){var s,r;return n||(r=ot[t],ot[t]=s,s=null!=i(e,t,n)?t.toLowerCase():null,ot[t]=r),s}});var lt=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;se.fn.extend({prop:function(e,t){return be(this,se.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[se.propFix[e]||e]})}}),se.extend({prop:function(e,t,i){var n,s,r=e.nodeType;if(3!==r&&8!==r&&2!==r)return 1===r&&se.isXMLDoc(e)||(t=se.propFix[t]||t,s=se.propHooks[t]),void 0!==i?s&&"set"in s&&void 0!==(n=s.set(e,i,t))?n:e[t]=i:s&&"get"in s&&null!==(n=s.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=se.find.attr(e,"tabindex");return t?parseInt(t,10):lt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ne.optSelected||(se.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),se.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){se.propFix[this.toLowerCase()]=this});var ut=/[\t\r\n\f]/g;se.fn.extend({addClass:function(e){var t,i,n,s,r,a,o,l=0;if(se.isFunction(e))return this.each(function(t){se(this).addClass(e.call(this,t,B(this)))});if("string"==typeof e&&e)for(t=e.match(Le)||[];i=this[l++];)if(s=B(i),n=1===i.nodeType&&(" "+s+" ").replace(ut," ")){for(a=0;r=t[a++];)n.indexOf(" "+r+" ")<0&&(n+=r+" ");s!==(o=se.trim(n))&&i.setAttribute("class",o)}return this},removeClass:function(e){var t,i,n,s,r,a,o,l=0;if(se.isFunction(e))return this.each(function(t){se(this).removeClass(e.call(this,t,B(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Le)||[];i=this[l++];)if(s=B(i),n=1===i.nodeType&&(" "+s+" ").replace(ut," ")){for(a=0;r=t[a++];)for(;n.indexOf(" "+r+" ")>-1;)n=n.replace(" "+r+" "," ");s!==(o=se.trim(n))&&i.setAttribute("class",o)}return this},toggleClass:function(e,t){var i=typeof e;return"boolean"==typeof t&&"string"===i?t?this.addClass(e):this.removeClass(e):se.isFunction(e)?this.each(function(i){se(this).toggleClass(e.call(this,i,B(this),t),t)}):this.each(function(){var t,n,s,r;if("string"===i)for(n=0,s=se(this),r=e.match(Le)||[];t=r[n++];)s.hasClass(t)?s.removeClass(t):s.addClass(t);else void 0!==e&&"boolean"!==i||((t=B(this))&&Se.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Se.get(this,"__className__")||""))})},hasClass:function(e){var t,i,n=0;for(t=" "+e+" ";i=this[n++];)if(1===i.nodeType&&(" "+B(i)+" ").replace(ut," ").indexOf(t)>-1)return!0;return!1}});var pt=/\r/g,ct=/[\x20\t\r\n\f]+/g;se.fn.extend({val:function(e){var t,i,n,s=this[0];{if(arguments.length)return n=se.isFunction(e),this.each(function(i){var s;1===this.nodeType&&(null==(s=n?e.call(this,i,se(this).val()):e)?s="":"number"==typeof s?s+="":se.isArray(s)&&(s=se.map(s,function(e){return null==e?"":e+""})),(t=se.valHooks[this.type]||se.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,s,"value")||(this.value=s))});if(s)return(t=se.valHooks[s.type]||se.valHooks[s.nodeName.toLowerCase()])&&"get"in t&&void 0!==(i=t.get(s,"value"))?i:(i=s.value,"string"==typeof i?i.replace(pt,""):null==i?"":i)}}}),se.extend({valHooks:{option:{get:function(e){var t=se.find.attr(e,"value");return null!=t?t:se.trim(se.text(e)).replace(ct," ")}},select:{get:function(e){for(var t,i,n=e.options,s=e.selectedIndex,r="select-one"===e.type||s<0,a=r?null:[],o=r?s+1:n.length,l=s<0?o:r?s:0;l<o;l++)if(((i=n[l]).selected||l===s)&&(ne.optDisabled?!i.disabled:null===i.getAttribute("disabled"))&&(!i.parentNode.disabled||!se.nodeName(i.parentNode,"optgroup"))){if(t=se(i).val(),r)return t;a.push(t)}return a},set:function(e,t){for(var i,n,s=e.options,r=se.makeArray(t),a=s.length;a--;)((n=s[a]).selected=se.inArray(se.valHooks.option.get(n),r)>-1)&&(i=!0);return i||(e.selectedIndex=-1),r}}}}),se.each(["radio","checkbox"],function(){se.valHooks[this]={set:function(e,t){if(se.isArray(t))return e.checked=se.inArray(se(e).val(),t)>-1}},ne.checkOn||(se.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var dt=/^(?:focusinfocus|focusoutblur)$/;se.extend(se.event,{trigger:function(t,i,n,s){var r,a,o,l,h,u,p,c=[n||Z],d=ie.call(t,"type")?t.type:t,f=ie.call(t,"namespace")?t.namespace.split("."):[];if(a=o=n=n||Z,3!==n.nodeType&&8!==n.nodeType&&!dt.test(d+se.event.triggered)&&(d.indexOf(".")>-1&&(d=(f=d.split(".")).shift(),f.sort()),h=d.indexOf(":")<0&&"on"+d,t=t[se.expando]?t:new se.Event(d,"object"==typeof t&&t),t.isTrigger=s?2:3,t.namespace=f.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),i=null==i?[t]:se.makeArray(i,[t]),p=se.event.special[d]||{},s||!p.trigger||!1!==p.trigger.apply(n,i))){if(!s&&!p.noBubble&&!se.isWindow(n)){for(l=p.delegateType||d,dt.test(l+d)||(a=a.parentNode);a;a=a.parentNode)c.push(a),o=a;o===(n.ownerDocument||Z)&&c.push(o.defaultView||o.parentWindow||e)}for(r=0;(a=c[r++])&&!t.isPropagationStopped();)t.type=r>1?l:p.bindType||d,(u=(Se.get(a,"events")||{})[t.type]&&Se.get(a,"handle"))&&u.apply(a,i),(u=h&&a[h])&&u.apply&&we(a)&&(t.result=u.apply(a,i),!1===t.result&&t.preventDefault());return t.type=d,s||t.isDefaultPrevented()||p._default&&!1!==p._default.apply(c.pop(),i)||!we(n)||h&&se.isFunction(n[d])&&!se.isWindow(n)&&((o=n[h])&&(n[h]=null),se.event.triggered=d,n[d](),se.event.triggered=void 0,o&&(n[h]=o)),t.result}},simulate:function(e,t,i){var n=se.extend(new se.Event,i,{type:e,isSimulated:!0});se.event.trigger(n,null,t)}}),se.fn.extend({trigger:function(e,t){return this.each(function(){se.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];if(i)return se.event.trigger(e,t,i,!0)}}),se.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){se.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}}),se.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ne.focusin="onfocusin"in e,ne.focusin||se.each({focus:"focusin",blur:"focusout"},function(e,t){var i=function(e){se.event.simulate(t,e.target,se.event.fix(e))};se.event.special[t]={setup:function(){var n=this.ownerDocument||this,s=Se.access(n,t);s||n.addEventListener(e,i,!0),Se.access(n,t,(s||0)+1)},teardown:function(){var n=this.ownerDocument||this,s=Se.access(n,t)-1;s?Se.access(n,t,s):(n.removeEventListener(e,i,!0),Se.remove(n,t))}}});var ft=e.location,mt=se.now(),yt=/\?/;se.parseJSON=function(e){return JSON.parse(e+"")},se.parseXML=function(t){var i;if(!t||"string"!=typeof t)return null;try{i=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){i=void 0}return i&&!i.getElementsByTagName("parsererror").length||se.error("Invalid XML: "+t),i};var gt=/#.*$/,vt=/([?&])_=[^&]*/,Lt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,bt=/^(?:GET|HEAD)$/,wt=/^\/\//,St={},Ct={},xt="*/".concat("*"),_t=Z.createElement("a");_t.href=ft.href,se.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ft.href,type:"GET",isLocal:Ot.test(ft.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":xt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":se.parseJSON,"text xml":se.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?j(j(e,se.ajaxSettings),t):j(se.ajaxSettings,e)},ajaxPrefilter:G(St),ajaxTransport:G(Ct),ajax:function(t,i){function n(t,i,n,o){var h,p,v,L,b,S=i;2!==O&&(O=2,l&&e.clearTimeout(l),s=void 0,a=o||"",w.readyState=t>0?4:0,h=t>=200&&t<300||304===t,n&&(L=W(c,w,n)),L=V(c,L,w,h),h?(c.ifModified&&((b=w.getResponseHeader("Last-Modified"))&&(se.lastModified[r]=b),(b=w.getResponseHeader("etag"))&&(se.etag[r]=b)),204===t||"HEAD"===c.type?S="nocontent":304===t?S="notmodified":(S=L.state,p=L.data,h=!(v=L.error))):(v=S,!t&&S||(S="error",t<0&&(t=0))),w.status=t,w.statusText=(i||S)+"",h?m.resolveWith(d,[p,S,w]):m.rejectWith(d,[w,S,v]),w.statusCode(g),g=void 0,u&&f.trigger(h?"ajaxSuccess":"ajaxError",[w,c,h?p:v]),y.fireWith(d,[w,S]),u&&(f.trigger("ajaxComplete",[w,c]),--se.active||se.event.trigger("ajaxStop")))}"object"==typeof t&&(i=t,t=void 0),i=i||{};var s,r,a,o,l,h,u,p,c=se.ajaxSetup({},i),d=c.context||c,f=c.context&&(d.nodeType||d.jquery)?se(d):se.event,m=se.Deferred(),y=se.Callbacks("once memory"),g=c.statusCode||{},v={},L={},O=0,b="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===O){if(!o)for(o={};t=Lt.exec(a);)o[t[1].toLowerCase()]=t[2];t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===O?a:null},setRequestHeader:function(e,t){var i=e.toLowerCase();return O||(e=L[i]=L[i]||e,v[e]=t),this},overrideMimeType:function(e){return O||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(O<2)for(t in e)g[t]=[g[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||b;return s&&s.abort(t),n(0,t),this}};if(m.promise(w).complete=y.add,w.success=w.done,w.error=w.fail,c.url=((t||c.url||ft.href)+"").replace(gt,"").replace(wt,ft.protocol+"//"),c.type=i.method||i.type||c.method||c.type,c.dataTypes=se.trim(c.dataType||"*").toLowerCase().match(Le)||[""],null==c.crossDomain){h=Z.createElement("a");try{h.href=c.url,h.href=h.href,c.crossDomain=_t.protocol+"//"+_t.host!=h.protocol+"//"+h.host}catch(e){c.crossDomain=!0}}if(c.data&&c.processData&&"string"!=typeof c.data&&(c.data=se.param(c.data,c.traditional)),H(St,c,i,w),2===O)return w;(u=se.event&&c.global)&&0==se.active++&&se.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!bt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(yt.test(r)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=vt.test(r)?r.replace(vt,"$1_="+mt++):r+(yt.test(r)?"&":"?")+"_="+mt++)),c.ifModified&&(se.lastModified[r]&&w.setRequestHeader("If-Modified-Since",se.lastModified[r]),se.etag[r]&&w.setRequestHeader("If-None-Match",se.etag[r])),(c.data&&c.hasContent&&!1!==c.contentType||i.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+xt+"; q=0.01":""):c.accepts["*"]);for(p in c.headers)w.setRequestHeader(p,c.headers[p]);if(c.beforeSend&&(!1===c.beforeSend.call(d,w,c)||2===O))return w.abort();b="abort";for(p in{success:1,error:1,complete:1})w[p](c[p]);if(s=H(Ct,c,i,w)){if(w.readyState=1,u&&f.trigger("ajaxSend",[w,c]),2===O)return w;c.async&&c.timeout>0&&(l=e.setTimeout(function(){w.abort("timeout")},c.timeout));try{O=1,s.send(v,n)}catch(e){if(!(O<2))throw e;n(-1,e)}}else n(-1,"No Transport");return w},getJSON:function(e,t,i){return se.get(e,t,i,"json")},getScript:function(e,t){return se.get(e,void 0,t,"script")}}),se.each(["get","post"],function(e,t){se[t]=function(e,i,n,s){return se.isFunction(i)&&(s=s||n,n=i,i=void 0),se.ajax(se.extend({url:e,type:t,dataType:s,data:i,success:n},se.isPlainObject(e)&&e))}}),se._evalUrl=function(e){return se.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},se.fn.extend({wrapAll:function(e){var t;return se.isFunction(e)?this.each(function(t){se(this).wrapAll(e.call(this,t))}):(this[0]&&(t=se(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return se.isFunction(e)?this.each(function(t){se(this).wrapInner(e.call(this,t))}):this.each(function(){var t=se(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=se.isFunction(e);return this.each(function(i){se(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(){return this.parent().each(function(){se.nodeName(this,"body")||se(this).replaceWith(this.childNodes)}).end()}}),se.expr.filters.hidden=function(e){return!se.expr.filters.visible(e)},se.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var Et=/%20/g,Nt=/\[\]$/,Pt=/\r?\n/g,Mt=/^(?:submit|button|image|reset|file)$/i,Tt=/^(?:input|select|textarea|keygen)/i;se.param=function(e,t){var i,n=[],s=function(e,t){t=se.isFunction(t)?t():null==t?"":t,n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=se.ajaxSettings&&se.ajaxSettings.traditional),se.isArray(e)||e.jquery&&!se.isPlainObject(e))se.each(e,function(){s(this.name,this.value)});else for(i in e)q(i,e[i],t,s);return n.join("&").replace(Et,"+")},se.fn.extend({serialize:function(){return se.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=se.prop(this,"elements");return e?se.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!se(this).is(":disabled")&&Tt.test(this.nodeName)&&!Mt.test(e)&&(this.checked||!Te.test(e))}).map(function(e,t){var i=se(this).val();return null==i?null:se.isArray(i)?se.map(i,function(e){return{name:t.name,value:e.replace(Pt,"\r\n")}}):{name:t.name,value:i.replace(Pt,"\r\n")}}).get()}}),se.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var kt={0:200,1223:204},At=se.ajaxSettings.xhr();ne.cors=!!At&&"withCredentials"in At,ne.ajax=At=!!At,se.ajaxTransport(function(t){var i,n;if(ne.cors||At&&!t.crossDomain)return{send:function(s,r){var a,o=t.xhr();if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)o[a]=t.xhrFields[a];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest");for(a in s)o.setRequestHeader(a,s[a]);i=function(e){return function(){i&&(i=n=o.onload=o.onerror=o.onabort=o.onreadystatechange=null,"abort"===e?o.abort():"error"===e?"number"!=typeof o.status?r(0,"error"):r(o.status,o.statusText):r(kt[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=i(),n=o.onerror=i("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&e.setTimeout(function(){i&&n()})},i=i("abort");try{o.send(t.hasContent&&t.data||null)}catch(e){if(i)throw e}},abort:function(){i&&i()}}}),se.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return se.globalEval(e),e}}}),se.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),se.ajaxTransport("script",function(e){if(e.crossDomain){var t,i;return{send:function(n,s){t=se("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",i=function(e){t.remove(),i=null,e&&s("error"===e.type?404:200,e.type)}),Z.head.appendChild(t[0])},abort:function(){i&&i()}}}});var Ft=[],Dt=/(=)\?(?=&|$)|\?\?/;se.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ft.pop()||se.expando+"_"+mt++;return this[e]=!0,e}}),se.ajaxPrefilter("json jsonp",function(t,i,n){var s,r,a,o=!1!==t.jsonp&&(Dt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dt.test(t.data)&&"data");if(o||"jsonp"===t.dataTypes[0])return s=t.jsonpCallback=se.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,o?t[o]=t[o].replace(Dt,"$1"+s):!1!==t.jsonp&&(t.url+=(yt.test(t.url)?"&":"?")+t.jsonp+"="+s),t.converters["script json"]=function(){return a||se.error(s+" was not called"),a[0]},t.dataTypes[0]="json",r=e[s],e[s]=function(){a=arguments},n.always(function(){void 0===r?se(e).removeProp(s):e[s]=r,t[s]&&(t.jsonpCallback=i.jsonpCallback,Ft.push(s)),a&&se.isFunction(r)&&r(a[0]),a=r=void 0}),"script"}),se.parseHTML=function(e,t,i){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(i=t,t=!1),t=t||Z;var n=de.exec(e),s=!i&&[];return n?[t.createElement(n[1])]:(n=c([e],t,s),s&&s.length&&se(s).remove(),se.merge([],n.childNodes))};var It=se.fn.load;se.fn.load=function(e,t,i){if("string"!=typeof e&&It)return It.apply(this,arguments);var n,s,r,a=this,o=e.indexOf(" ");return o>-1&&(n=se.trim(e.slice(o)),e=e.slice(0,o)),se.isFunction(t)?(i=t,t=void 0):t&&"object"==typeof t&&(s="POST"),a.length>0&&se.ajax({url:e,type:s||"GET",dataType:"html",data:t}).done(function(e){r=arguments,a.html(n?se("<div>").append(se.parseHTML(e)).find(n):e)}).always(i&&function(e,t){a.each(function(){i.apply(this,r||[e.responseText,t,e])})}),this},se.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){se.fn[t]=function(e){return this.on(t,e)}}),se.expr.filters.animated=function(e){return se.grep(se.timers,function(t){return e===t.elem}).length},se.offset={setOffset:function(e,t,i){var n,s,r,a,o,l,h=se.css(e,"position"),u=se(e),p={};"static"===h&&(e.style.position="relative"),o=u.offset(),r=se.css(e,"top"),l=se.css(e,"left"),("absolute"===h||"fixed"===h)&&(r+l).indexOf("auto")>-1?(a=(n=u.position()).top,s=n.left):(a=parseFloat(r)||0,s=parseFloat(l)||0),se.isFunction(t)&&(t=t.call(e,i,se.extend({},o))),null!=t.top&&(p.top=t.top-o.top+a),null!=t.left&&(p.left=t.left-o.left+s),"using"in t?t.using.call(e,p):u.css(p)}},se.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){se.offset.setOffset(this,e,t)});var t,i,n=this[0],s={top:0,left:0},r=n&&n.ownerDocument;if(r)return t=r.documentElement,se.contains(t,n)?(s=n.getBoundingClientRect(),i=Y(r),{top:s.top+i.pageYOffset-t.clientTop,left:s.left+i.pageXOffset-t.clientLeft}):s},position:function(){if(this[0]){var e,t,i=this[0],n={top:0,left:0};return"fixed"===se.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),se.nodeName(e[0],"html")||(n=e.offset()),n.top+=se.css(e[0],"borderTopWidth",!0),n.left+=se.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-se.css(i,"marginTop",!0),left:t.left-n.left-se.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===se.css(e,"position");)e=e.offsetParent;return e||$e})}}),se.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var i="pageYOffset"===t;se.fn[e]=function(n){return be(this,function(e,n,s){var r=Y(e);if(void 0===s)return r?r[t]:e[n];r?r.scrollTo(i?r.pageXOffset:s,i?s:r.pageYOffset):e[n]=s},e,n,arguments.length)}}),se.each(["top","left"],function(e,t){se.cssHooks[t]=E(ne.pixelPosition,function(e,i){if(i)return i=_(e,t),Ye.test(i)?se(e).position()[t]+"px":i})}),se.each({Height:"height",Width:"width"},function(e,t){se.each({padding:"inner"+e,content:t,"":"outer"+e},function(i,n){se.fn[n]=function(n,s){var r=arguments.length&&(i||"boolean"!=typeof n),a=i||(!0===n||!0===s?"margin":"border");return be(this,function(t,i,n){var s;return se.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===n?se.css(t,i,a):se.style(t,i,n,a)},t,r?n:void 0,r,null)}})}),se.fn.extend({bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)},size:function(){return this.length}}),se.fn.andSelf=se.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return se});var Rt=e.jQuery,zt=e.$;return se.noConflict=function(t){return e.$===se&&(e.$=zt),t&&e.jQuery===se&&(e.jQuery=Rt),se},t||(e.jQuery=e.$=se),se}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(e){function t(e){for(var t=e.css("visibility");"inherit"===t;)t=(e=e.parent()).css("visibility");return"hidden"!==t}function i(e){for(var t,i;e.length&&e[0]!==document;){if(("absolute"===(t=e.css("position"))||"relative"===t||"fixed"===t)&&(i=parseInt(e.css("zIndex"),10),!isNaN(i)&&0!==i))return i;e=e.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=s(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",i,function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,r)}function r(){e.datepicker._isDisabledDatepicker(d.inline?d.dpDiv.parent()[0]:d.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function a(t,i){e.extend(t,i);for(var n in i)null==i[n]&&(t[n]=i[n]);return t}function o(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{};e.ui.version="1.12.1";var l=0,h=Array.prototype.slice;e.cleanData=function(t){return function(i){var n,s,r;for(r=0;null!=(s=i[r]);r++)try{(n=e._data(s,"events"))&&n.remove&&e(s).triggerHandler("remove")}catch(e){}t(i)}}(e.cleanData),e.widget=function(t,i,n){var s,r,a,o={},l=t.split(".")[0],h=l+"-"+(t=t.split(".")[1]);return n||(n=i,i=e.Widget),e.isArray(n)&&(n=e.extend.apply(null,[{}].concat(n))),e.expr[":"][h.toLowerCase()]=function(t){return!!e.data(t,h)},e[l]=e[l]||{},s=e[l][t],r=e[l][t]=function(e,t){if(!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},e.extend(r,s,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),a=new i,a.options=e.widget.extend({},a.options),e.each(n,function(t,n){e.isFunction(n)?o[t]=function(){function e(){return i.prototype[t].apply(this,arguments)}function s(e){return i.prototype[t].apply(this,e)}return function(){var t,i=this._super,r=this._superApply;return this._super=e,this._superApply=s,t=n.apply(this,arguments),this._super=i,this._superApply=r,t}}():o[t]=n}),r.prototype=e.widget.extend(a,{widgetEventPrefix:s?a.widgetEventPrefix||t:t},o,{constructor:r,namespace:l,widgetName:t,widgetFullName:h}),s?(e.each(s._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,r,i._proto)}),delete s._childConstructors):i._childConstructors.push(r),e.widget.bridge(t,r),r},e.widget.extend=function(t){for(var i,n,s=h.call(arguments,1),r=0,a=s.length;r<a;r++)for(i in s[r])n=s[r][i],s[r].hasOwnProperty(i)&&void 0!==n&&(e.isPlainObject(n)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],n):e.widget.extend({},n):t[i]=n);return t},e.widget.bridge=function(t,i){var n=i.prototype.widgetFullName||t;e.fn[t]=function(s){var r="string"==typeof s,a=h.call(arguments,1),o=this;return r?this.length||"instance"!==s?this.each(function(){var i,r=e.data(this,n);return"instance"===s?(o=r,!1):r?e.isFunction(r[s])&&"_"!==s.charAt(0)?(i=r[s].apply(r,a),i!==r&&void 0!==i?(o=i&&i.jquery?o.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+s+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+s+"'")}):o=void 0:(a.length&&(s=e.widget.extend.apply(null,[s].concat(a))),this.each(function(){var t=e.data(this,n);t?(t.option(s||{}),t._init&&t._init()):e.data(this,n,new i(s,this))})),o}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,i){t._removeClass(i,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,s,r,a=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(a={},n=t.split("."),t=n.shift(),n.length){for(s=a[t]=e.widget.extend({},this.options[t]),r=0;r<n.length-1;r++)s[n[r]]=s[n[r]]||{},s=s[n[r]];if(t=n.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];a[t]=i}return this._setOptions(a),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var i,n,s;for(i in t)s=this.classesElementLookup[i],t[i]!==this.options.classes[i]&&s&&s.length&&(n=e(s.get()),this._removeClass(s,i),n.addClass(this._classes({element:n,keys:i,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){function i(i,r){var a,o;for(o=0;o<i.length;o++)a=s.classesElementLookup[i[o]]||e(),a=e(t.add?e.unique(a.get().concat(t.element.get())):a.not(t.element).get()),s.classesElementLookup[i[o]]=a,n.push(i[o]),r&&t.classes[i[o]]&&n.push(t.classes[i[o]])}var n=[],s=this;return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&i(t.keys.match(/\S+/g)||[],!0),t.extra&&i(t.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(t){var i=this;e.each(i.classesElementLookup,function(n,s){-1!==e.inArray(t.target,s)&&(i.classesElementLookup[n]=e(s.not(t.target).get()))})},_removeClass:function(e,t,i){return this._toggleClass(e,t,i,!1)},_addClass:function(e,t,i){return this._toggleClass(e,t,i,!0)},_toggleClass:function(e,t,i,n){n="boolean"==typeof n?n:i;var s="string"==typeof e||null===e,r={extra:s?t:i,keys:s?e:t,element:s?this.element:e,add:n};return r.element.toggleClass(this._classes(r),n),this},_on:function(t,i,n){var s,r=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=s=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),e.each(n,function(n,a){function o(){if(t||!0!==r.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof a?r[a]:a).apply(r,arguments)}"string"!=typeof a&&(o.guid=a.guid=a.guid||o.guid||e.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+r.eventNamespace,u=l[2];u?s.on(h,u,o):i.on(h,o)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(i).off(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,i,n){var s,r,a=this.options[t];if(n=n||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],r=i.originalEvent)for(s in r)s in i||(i[s]=r[s]);return this.element.trigger(i,n),!(e.isFunction(a)&&!1===a.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,s,r){"string"==typeof s&&(s={effect:s});var a,o=s?!0===s||"number"==typeof s?i:s.effect||i:t;"number"==typeof(s=s||{})&&(s={duration:s}),a=!e.isEmptyObject(s),s.complete=r,s.delay&&n.delay(s.delay),a&&e.effects&&e.effects.effect[o]?n[t](s):o!==t&&n[o]?n[o](s.duration,s.easing,r):n.queue(function(i){e(this)[t](),r&&r.call(n[0]),i()})}});e.widget;!function(){function t(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function i(t,i){return parseInt(e.css(t,i),10)||0}function n(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}var s,r=Math.max,a=Math.abs,o=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,u=/^\w+/,p=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,i,n=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=n.children()[0];return e("body").append(n),t=r.offsetWidth,n.css("overflow","scroll"),i=r.offsetWidth,t===i&&(i=n[0].clientWidth),n.remove(),s=t-i},getScrollInfo:function(t){var i=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),n=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),s="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=e.isWindow(i[0]),s=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:s,offset:!n&&!s?e(t).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},e.fn.position=function(s){if(!s||!s.of)return c.apply(this,arguments);s=e.extend({},s);var p,d,f,m,y,g,v=e(s.of),L=e.position.getWithinInfo(s.within),O=e.position.getScrollInfo(L),b=(s.collision||"flip").split(" "),w={};return g=n(v),v[0].preventDefault&&(s.at="left top"),d=g.width,f=g.height,m=g.offset,y=e.extend({},m),e.each(["my","at"],function(){var e,t,i=(s[this]||"").split(" ");1===i.length&&(i=o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",e=h.exec(i[0]),t=h.exec(i[1]),w[this]=[e?e[0]:0,t?t[0]:0],s[this]=[u.exec(i[0])[0],u.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===s.at[0]?y.left+=d:"center"===s.at[0]&&(y.left+=d/2),"bottom"===s.at[1]?y.top+=f:"center"===s.at[1]&&(y.top+=f/2),p=t(w.at,d,f),y.left+=p[0],y.top+=p[1],this.each(function(){var n,o,l=e(this),h=l.outerWidth(),u=l.outerHeight(),c=i(this,"marginLeft"),g=i(this,"marginTop"),S=h+c+i(this,"marginRight")+O.width,C=u+g+i(this,"marginBottom")+O.height,x=e.extend({},y),_=t(w.my,l.outerWidth(),l.outerHeight());"right"===s.my[0]?x.left-=h:"center"===s.my[0]&&(x.left-=h/2),"bottom"===s.my[1]?x.top-=u:"center"===s.my[1]&&(x.top-=u/2),x.left+=_[0],x.top+=_[1],n={marginLeft:c,marginTop:g},e.each(["left","top"],function(t,i){e.ui.position[b[t]]&&e.ui.position[b[t]][i](x,{targetWidth:d,targetHeight:f,elemWidth:h,elemHeight:u,collisionPosition:n,collisionWidth:S,collisionHeight:C,offset:[p[0]+_[0],p[1]+_[1]],my:s.my,at:s.at,within:L,elem:l})}),s.using&&(o=function(e){var t=m.left-x.left,i=t+d-h,n=m.top-x.top,o=n+f-u,p={target:{element:v,left:m.left,top:m.top,width:d,height:f},element:{element:l,left:x.left,top:x.top,width:h,height:u},horizontal:i<0?"left":t>0?"right":"center",vertical:o<0?"top":n>0?"bottom":"middle"};d<h&&a(t+i)<d&&(p.horizontal="center"),f<u&&a(n+o)<f&&(p.vertical="middle"),r(a(t),a(i))>r(a(n),a(o))?p.important="horizontal":p.important="vertical",s.using.call(this,e,p)}),l.offset(e.extend(x,{using:o}))})},e.ui.position={fit:{left:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollLeft:n.offset.left,a=n.width,o=e.left-t.collisionPosition.marginLeft,l=s-o,h=o+t.collisionWidth-a-s;t.collisionWidth>a?l>0&&h<=0?(i=e.left+l+t.collisionWidth-a-s,e.left+=l-i):e.left=h>0&&l<=0?s:l>h?s+a-t.collisionWidth:s:l>0?e.left+=l:h>0?e.left-=h:e.left=r(e.left-o,e.left)},top:function(e,t){var i,n=t.within,s=n.isWindow?n.scrollTop:n.offset.top,a=t.within.height,o=e.top-t.collisionPosition.marginTop,l=s-o,h=o+t.collisionHeight-a-s;t.collisionHeight>a?l>0&&h<=0?(i=e.top+l+t.collisionHeight-a-s,e.top+=l-i):e.top=h>0&&l<=0?s:l>h?s+a-t.collisionHeight:s:l>0?e.top+=l:h>0?e.top-=h:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var i,n,s=t.within,r=s.offset.left+s.scrollLeft,o=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,h=e.left-t.collisionPosition.marginLeft,u=h-l,p=h+t.collisionWidth-o-l,c="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,d="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];u<0?((i=e.left+c+d+f+t.collisionWidth-o-r)<0||i<a(u))&&(e.left+=c+d+f):p>0&&((n=e.left-t.collisionPosition.marginLeft+c+d+f-l)>0||a(n)<p)&&(e.left+=c+d+f)},top:function(e,t){var i,n,s=t.within,r=s.offset.top+s.scrollTop,o=s.height,l=s.isWindow?s.scrollTop:s.offset.top,h=e.top-t.collisionPosition.marginTop,u=h-l,p=h+t.collisionHeight-o-l,c="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,d="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,f=-2*t.offset[1];u<0?((n=e.top+c+d+f+t.collisionHeight-o-r)<0||n<a(u))&&(e.top+=c+d+f):p>0&&((i=e.top-t.collisionPosition.marginTop+c+d+f-l)>0||a(i)<p)&&(e.top+=c+d+f)}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}();e.ui.position,e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])}}),e.fn.extend({disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});e.ui.focusable=function(i,n){var s,r,a,o,l,h=i.nodeName.toLowerCase();return"area"===h?(s=i.parentNode,r=s.name,!(!i.href||!r||"map"!==s.nodeName.toLowerCase())&&((a=e("img[usemap='#"+r+"']")).length>0&&a.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(h)?(o=!i.disabled)&&(l=e(i).closest("fieldset")[0])&&(o=!l.disabled):o="a"===h?i.href||n:n,o&&e(i).is(":visible")&&t(e(i)))},e.extend(e.expr[":"],{focusable:function(t){return e.ui.focusable(t,null!=e.attr(t,"tabindex"))}});e.ui.focusable,e.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):e(this[0].form)},e.ui.formResetMixin={_formResetHandler:function(){var t=e(this);setTimeout(function(){var i=t.data("ui-form-reset-instances");e.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var e=this.form.data("ui-form-reset-instances")||[];e.length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e)}},_unbindFormResetHandler:function(){if(this.form.length){var t=this.form.data("ui-form-reset-instances");t.splice(e.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}};"1.7"===e.fn.jquery.substring(0,3)&&(e.each(["Width","Height"],function(t,i){function n(t,i,n,r){return e.each(s,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),r&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var s="Width"===i?["Left","Right"]:["Top","Bottom"],r=i.toLowerCase(),a={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?a["inner"+i].call(this):this.each(function(){e(this).css(r,n(this,t)+"px")})},e.fn["outer"+i]=function(t,s){return"number"!=typeof t?a["outer"+i].call(this,t):this.each(function(){e(this).css(r,n(this,t,!0,s)+"px")})}}),e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))});e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.ui.escapeSelector=function(){var e=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(t){return t.replace(e,"\\$1")}}(),e.fn.labels=function(){var t,i,n,s,r;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(s=this.eq(0).parents("label"),(n=this.attr("id"))&&(r=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),i="label[for='"+e.ui.escapeSelector(n)+"']",s=s.add(r.find(i).addBack(i))),this.pushStack(s))},e.fn.scrollParent=function(t){var i=this.css("position"),n="absolute"===i,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var t=e(this);return(!n||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&r.length?r:e(this[0].ownerDocument||document)},e.extend(e.expr[":"],{tabbable:function(t){var i=e.attr(t,"tabindex"),n=null!=i;return(!n||i>=0)&&e.ui.focusable(t,n)}}),e.fn.extend({uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var u=!1;e(document).on("mouseup",function(){u=!1});e.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(i){if(!0===e.data(i.target,t.widgetName+".preventClickEvent"))return e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!u){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,n=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&e(t.target).closest(this.options.cancel).length;return!(n&&!s&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),u=!0,!0))}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,u=!1,t.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.ui.plugin={add:function(t,i,n){var s,r=e.ui[t].prototype;for(s in n)r.plugins[s]=r.plugins[s]||[],r.plugins[s].push([i,n[s]])},call:function(e,t,i,n){var s,r=e.plugins[t];if(r&&(n||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(s=0;s<r.length;s++)e.options[r[s][0]]&&r[s][1].apply(e.element,i)}},e.ui.safeActiveElement=function(e){var t;try{t=e.activeElement}catch(i){t=e.body}return t||(t=e.body),t.nodeName||(t=e.body),t},e.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&e(t).trigger("blur")};e.widget("ui.draggable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var i=this.options;return!(this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=e.ui.safeActiveElement(this.document[0]);e(t.target).closest(i).length||e.ui.safeBlur(i)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(!1===this._trigger("drag",t,n))return this._mouseUp(new e.Event("mouseup",t)),!1;this.position=n.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,n=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",t)&&i._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new e.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!e(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper),s=n?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n&&s[0]===this.element[0]&&this._setPositionRelative(),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n,s=this.options,r=this.document[0];this.relativeContainer=null,s.containment?"window"!==s.containment?"document"!==s.containment?s.containment.constructor!==Array?("parent"===s.containment&&(s.containment=this.helper[0].parentNode),(n=(i=e(s.containment))[0])&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i)):this.containment=s.containment:this.containment=[0,0,e(r).width()-this.helperProportions.width-this.margins.left,(e(r).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||r.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,n=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,n,s,r,a=this.options,o=this._isRootNode(this.scrollParent[0]),l=e.pageX,h=e.pageY;return o&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(n=this.relativeContainer.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,e.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),e.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),e.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(s=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?s-this.offset.click.top>=i[1]||s-this.offset.click.top>i[3]?s:s-this.offset.click.top>=i[1]?s-a.grid[1]:s+a.grid[1]:s,r=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?r-this.offset.click.left>=i[0]||r-this.offset.click.left>i[2]?r:r-this.offset.click.left>=i[0]?r-a.grid[0]:r+a.grid[0]:r),"y"===a.axis&&(l=this.originalPageX),"x"===a.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:o?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:o?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,i,n){return n=n||this._uiHash(),e.ui.plugin.call(this,t,[i,n,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),n.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,n){var s=e.extend({},i,{item:n.element});n.sortables=[],e(n.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(n.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,s))})},stop:function(t,i,n){var s=e.extend({},i,{item:n.element});n.cancelHelperRemoval=!1,e.each(n.sortables,function(){var e=this;e.isOver?(e.isOver=0,n.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,s))})},drag:function(t,i,n){e.each(n.sortables,function(){var s=!1,r=this;r.positionAbs=n.positionAbs,r.helperProportions=n.helperProportions,r.offset.click=n.offset.click,r._intersectsWith(r.containerCache)&&(s=!0,e.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==r&&this._intersectsWith(this.containerCache)&&e.contains(r.element[0],this.element[0])&&(s=!1),s})),s?(r.isOver||(r.isOver=1,n._parent=i.helper.parent(),r.currentItem=i.helper.appendTo(r.element).data("ui-sortable-item",!0),r.options._helper=r.options.helper,r.options.helper=function(){return i.helper[0]},t.target=r.currentItem[0],r._mouseCapture(t,!0),r._mouseStart(t,!0,!0),r.offset.click.top=n.offset.click.top,r.offset.click.left=n.offset.click.left,r.offset.parent.left-=n.offset.parent.left-r.offset.parent.left,r.offset.parent.top-=n.offset.parent.top-r.offset.parent.top,n._trigger("toSortable",t),n.dropped=r.element,e.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,r.fromOutside=n),r.currentItem&&(r._mouseDrag(t),i.position=r.position)):r.isOver&&(r.isOver=0,r.cancelHelperRemoval=!0,r.options._revert=r.options.revert,r.options.revert=!1,r._trigger("out",t,r._uiHash(r)),r._mouseStop(t,!0),r.options.revert=r.options._revert,r.options.helper=r.options._helper,r.placeholder&&r.placeholder.remove(),i.helper.appendTo(n._parent),n._refreshOffsets(t),i.position=n._generatePosition(t,!0),n._trigger("fromSortable",t),n.dropped=!1,e.each(n.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,n){var s=e("body"),r=n.options;s.css("cursor")&&(r._cursor=s.css("cursor")),s.css("cursor",r.cursor)},stop:function(t,i,n){var s=n.options;s._cursor&&e("body").css("cursor",s._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,n){var s=e(i.helper),r=n.options;s.css("opacity")&&(r._opacity=s.css("opacity")),s.css("opacity",r.opacity)},stop:function(t,i,n){var s=n.options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,n){var s=n.options,r=!1,a=n.scrollParentNotHidden[0],o=n.document[0];a!==o&&"HTML"!==a.tagName?(s.axis&&"x"===s.axis||(n.overflowOffset.top+a.offsetHeight-t.pageY<s.scrollSensitivity?a.scrollTop=r=a.scrollTop+s.scrollSpeed:t.pageY-n.overflowOffset.top<s.scrollSensitivity&&(a.scrollTop=r=a.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(n.overflowOffset.left+a.offsetWidth-t.pageX<s.scrollSensitivity?a.scrollLeft=r=a.scrollLeft+s.scrollSpeed:t.pageX-n.overflowOffset.left<s.scrollSensitivity&&(a.scrollLeft=r=a.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-e(o).scrollTop()<s.scrollSensitivity?r=e(o).scrollTop(e(o).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(o).scrollTop())<s.scrollSensitivity&&(r=e(o).scrollTop(e(o).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-e(o).scrollLeft()<s.scrollSensitivity?r=e(o).scrollLeft(e(o).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(o).scrollLeft())<s.scrollSensitivity&&(r=e(o).scrollLeft(e(o).scrollLeft()+s.scrollSpeed)))),!1!==r&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(n,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,i,n){var s=n.options;n.snapElements=[],e(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=e(this),i=t.offset();this!==n.element[0]&&n.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:i.top,left:i.left})})},drag:function(t,i,n){var s,r,a,o,l,h,u,p,c,d,f=n.options,m=f.snapTolerance,y=i.offset.left,g=y+n.helperProportions.width,v=i.offset.top,L=v+n.helperProportions.height;for(c=n.snapElements.length-1;c>=0;c--)h=(l=n.snapElements[c].left-n.margins.left)+n.snapElements[c].width,p=(u=n.snapElements[c].top-n.margins.top)+n.snapElements[c].height,g<l-m||y>h+m||L<u-m||v>p+m||!e.contains(n.snapElements[c].item.ownerDocument,n.snapElements[c].item)?(n.snapElements[c].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,t,e.extend(n._uiHash(),{snapItem:n.snapElements[c].item})),n.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(s=Math.abs(u-L)<=m,r=Math.abs(p-v)<=m,a=Math.abs(l-g)<=m,o=Math.abs(h-y)<=m,s&&(i.position.top=n._convertPositionTo("relative",{top:u-n.helperProportions.height,left:0}).top),r&&(i.position.top=n._convertPositionTo("relative",{top:p,left:0}).top),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l-n.helperProportions.width}).left),o&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h}).left)),d=s||r||a||o,"outer"!==f.snapMode&&(s=Math.abs(u-v)<=m,r=Math.abs(p-L)<=m,a=Math.abs(l-y)<=m,o=Math.abs(h-g)<=m,s&&(i.position.top=n._convertPositionTo("relative",{top:u,left:0}).top),r&&(i.position.top=n._convertPositionTo("relative",{top:p-n.helperProportions.height,left:0}).top),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l}).left),o&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h-n.helperProportions.width}).left)),!n.snapElements[c].snapping&&(s||r||a||o||d)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,t,e.extend(n._uiHash(),{snapItem:n.snapElements[c].item})),n.snapElements[c].snapping=s||r||a||o||d)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,n){var s,r=n.options,a=e.makeArray(e(r.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});a.length&&(s=parseInt(e(a[0]).css("zIndex"),10)||0,e(a).each(function(t){e(this).css("zIndex",s+t)}),this.css("zIndex",s+a.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,n){var s=e(i.helper),r=n.options;s.css("zIndex")&&(r._zIndex=s.css("zIndex")),s.css("zIndex",r.zIndex)},stop:function(t,i,n){var s=n.options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}});e.ui.draggable;e.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,i=this.options,n=i.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions=function(){if(!arguments.length)return t||(t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});t=arguments[0]},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;t<e.length;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,i){if("accept"===t)this.accept=e.isFunction(i)?i:function(e){return e.is(i)};else if("scope"===t){var n=e.ui.ddmanager.droppables[this.options.scope];this._splice(n),this._addToManager(i)}this._super(t,i)},_activate:function(t){var i=e.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var n=i||e.ui.ddmanager.current,s=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=e(this).droppable("instance");if(i.options.greedy&&!i.options.disabled&&i.options.scope===n.options.scope&&i.accept.call(i.element[0],n.currentItem||n.element)&&p(n,e.extend(i,{offset:i.element.offset()}),i.options.tolerance,t))return s=!0,!1}),!s&&(!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(n)),this.element)))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var p=e.ui.intersect=function(){function e(e,t,i){return e>=t&&e<t+i}return function(t,i,n,s){if(!i.offset)return!1;var r=(t.positionAbs||t.position.absolute).left+t.margins.left,a=(t.positionAbs||t.position.absolute).top+t.margins.top,o=r+t.helperProportions.width,l=a+t.helperProportions.height,h=i.offset.left,u=i.offset.top,p=h+i.proportions().width,c=u+i.proportions().height;switch(n){case"fit":return h<=r&&o<=p&&u<=a&&l<=c;case"intersect":return h<r+t.helperProportions.width/2&&o-t.helperProportions.width/2<p&&u<a+t.helperProportions.height/2&&l-t.helperProportions.height/2<c;case"pointer":return e(s.pageY,u,i.proportions().height)&&e(s.pageX,h,i.proportions().width);case"touch":return(a>=u&&a<=c||l>=u&&l<=c||a<u&&l>c)&&(r>=h&&r<=p||o>=h&&o<=p||r<h&&o>p);default:return!1}}}();e.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,i){var n,s,r=e.ui.ddmanager.droppables[t.options.scope]||[],a=i?i.type:null,o=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<r.length;n++)if(!(r[n].options.disabled||t&&!r[n].accept.call(r[n].element[0],t.currentItem||t.element))){for(s=0;s<o.length;s++)if(o[s]===r[n].element[0]){r[n].proportions().height=0;continue e}r[n].visible="none"!==r[n].element.css("display"),r[n].visible&&("mousedown"===a&&r[n]._activate.call(r[n],i),r[n].offset=r[n].element.offset(),r[n].proportions({width:r[n].element[0].offsetWidth,height:r[n].element[0].offsetHeight}))}},drop:function(t,i){var n=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&p(t,this,this.options.tolerance,i)&&(n=this._drop.call(this,i)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),n},dragStart:function(t,i){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,s,r,a=p(t,this,this.options.tolerance,i),o=!a&&this.isover?"isout":a&&!this.isover?"isover":null;o&&(this.options.greedy&&(s=this.options.scope,(r=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===s})).length&&((n=e(r[0]).droppable("instance")).greedyChild="isover"===o)),n&&"isover"===o&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[o]=!0,this["isout"===o?"isover":"isout"]=!1,this["isover"===o?"_over":"_out"].call(this,i),n&&"isout"===o&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}},!1!==e.uiBackCompat&&e.widget("ui.droppable",e.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});e.ui.droppable;e.widget("ui.resizable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseFloat(e)||0},_isNumber:function(e){return!isNaN(parseFloat(e))},_hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[n]>0||(t[n]=1,s=t[n]>0,t[n]=0,s)},_create:function(){var t,i=this.options,n=this;this._addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),i.autoHide&&e(this.element).on("mouseenter",function(){i.disabled||(n._removeClass("ui-resizable-autohide"),n._handles.show())}).on("mouseleave",function(){i.disabled||n.resizing||(n._addClass("ui-resizable-autohide"),n._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(e,t){switch(this._super(e,t),e){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var t,i,n,s,r,a=this.options,o=this;if(this.handles=a.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i<n.length;i++)s="ui-resizable-"+(t=e.trim(n[i])),r=e("<div>"),this._addClass(r,"ui-resizable-handle "+s),r.css({zIndex:a.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(r);this._renderAxis=function(t){var i,n,s,r;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=e(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(n=e(this.handles[i],this.element),r=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),s=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(s,r),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){o.resizing||(this.className&&(r=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=r&&r[1]?r[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var i,n,s=!1;for(i in this.handles)((n=e(this.handles[i])[0])===t.target||e.contains(n,t.target))&&(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var i,n,s,r=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),n=this._num(this.helper.css("top")),r.containment&&(i+=e(r.containment).scrollLeft()||0,n+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:n},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof r.aspectRatio?r.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,n,s=this.originalMousePosition,r=this.axis,a=t.pageX-s.left||0,o=t.pageY-s.top||0,l=this._change[r];return this._updatePrevProperties(),!!l&&(i=l.apply(this,[t,a,o]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),n=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1)},_mouseStop:function(t){this.resizing=!1;var i,n,s,r,a,o,l,h=this.options,u=this;return this._helper&&(s=(n=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,r=n?0:u.sizeDiff.width,a={width:u.helper.width()-r,height:u.helper.height()-s},o=parseFloat(u.element.css("left"))+(u.position.left-u.originalPosition.left)||null,l=parseFloat(u.element.css("top"))+(u.position.top-u.originalPosition.top)||null,h.animate||this.element.css(e.extend(a,{top:l,left:o})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!h.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,i,n,s,r,a=this.options;r={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||e)&&(t=r.minHeight*this.aspectRatio,n=r.minWidth/this.aspectRatio,i=r.maxHeight*this.aspectRatio,s=r.maxWidth/this.aspectRatio,t>r.minWidth&&(r.minWidth=t),n>r.minHeight&&(r.minHeight=n),i<r.maxWidth&&(r.maxWidth=i),s<r.maxHeight&&(r.maxHeight=s)),this._vBoundaries=r},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,n=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,n=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,s=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,r=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,a=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,o=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return r&&(e.width=t.minWidth),a&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),s&&(e.height=t.maxHeight),r&&h&&(e.left=o-t.minWidth),n&&h&&(e.left=o-t.maxWidth),a&&u&&(e.top=l-t.minHeight),s&&u&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,i=[],n=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],s=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];t<4;t++)i[t]=parseFloat(n[t])||0,i[t]+=parseFloat(s[t])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,i=this.helper||this.element;t<this._proportionallyResizeElements.length;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize;return{left:this.originalPosition.left+t,width:i.width-t}},n:function(e,t,i){var n=this.originalSize;return{top:this.originalPosition.top+i,height:n.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},sw:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,n]))},ne:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},nw:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,n]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).resizable("instance"),n=i.options,s=i._proportionallyResizeElements,r=s.length&&/textarea/i.test(s[0].nodeName),a=r&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,o=r?0:i.sizeDiff.width,l={width:i.size.width-o,height:i.size.height-a},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,u=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(l,u&&h?{top:u,left:h}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,i,n,s,r,a,o,l=e(this).resizable("instance"),h=l.options,u=l.element,p=h.containment,c=p instanceof e?p.get(0):/parent/.test(p)?u.parent().get(0):p;c&&(l.containerElement=e(c),/document/.test(p)||p===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(c),i=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){i[e]=l._num(t.css("padding"+n))}),l.containerOffset=t.offset(),l.containerPosition=t.position(),l.containerSize={height:t.innerHeight()-i[3],width:t.innerWidth()-i[1]},n=l.containerOffset,s=l.containerSize.height,r=l.containerSize.width,a=l._hasScroll(c,"left")?c.scrollWidth:r,o=l._hasScroll(c)?c.scrollHeight:s,l.parentData={element:c,left:n.left,top:n.top,width:a,height:o}))},resize:function(t){var i,n,s,r,a=e(this).resizable("instance"),o=a.options,l=a.containerOffset,h=a.position,u=a._aspectRatio||t.shiftKey,p={top:0,left:0},c=a.containerElement,d=!0;c[0]!==document&&/static/.test(c.css("position"))&&(p=l),h.left<(a._helper?l.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-l.left:a.position.left-p.left),u&&(a.size.height=a.size.width/a.aspectRatio,d=!1),a.position.left=o.helper?l.left:0),h.top<(a._helper?l.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-l.top:a.position.top),u&&(a.size.width=a.size.height*a.aspectRatio,d=!1),a.position.top=a._helper?l.top:0),s=a.containerElement.get(0)===a.element.parent().get(0),r=/relative|absolute/.test(a.containerElement.css("position")),s&&r?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-p.left:a.offset.left-l.left)),n=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-p.top:a.offset.top-l.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,u&&(a.size.height=a.size.width/a.aspectRatio,d=!1)),n+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-n,u&&(a.size.width=a.size.height*a.aspectRatio,d=!1)),d||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),i=t.options,n=t.containerOffset,s=t.containerPosition,r=t.containerElement,a=e(t.helper),o=a.offset(),l=a.outerWidth()-t.sizeDiff.width,h=a.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(r.css("position"))&&e(this).css({left:o.left-s.left-n.left,width:l,height:h}),t._helper&&!i.animate&&/static/.test(r.css("position"))&&e(this).css({left:o.left-s.left-n.left,width:l,height:h})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance").options;e(t.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var n=e(this).resizable("instance"),s=n.options,r=n.originalSize,a=n.originalPosition,o={height:n.size.height-r.height||0,width:n.size.width-r.width||0,top:n.position.top-a.top||0,left:n.position.left-a.left||0};e(s.alsoResize).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),s={},r=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(e,t){var i=(n[t]||0)+(o[t]||0);i&&i>=0&&(s[t]=i||null)}),t.css(s)})},stop:function(){e(this).removeData("ui-resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),i=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==e.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,i=e(this).resizable("instance"),n=i.options,s=i.size,r=i.originalSize,a=i.originalPosition,o=i.axis,l="number"==typeof n.grid?[n.grid,n.grid]:n.grid,h=l[0]||1,u=l[1]||1,p=Math.round((s.width-r.width)/h)*h,c=Math.round((s.height-r.height)/u)*u,d=r.width+p,f=r.height+c,m=n.maxWidth&&n.maxWidth<d,y=n.maxHeight&&n.maxHeight<f,g=n.minWidth&&n.minWidth>d,v=n.minHeight&&n.minHeight>f;n.grid=l,g&&(d+=h),v&&(f+=u),m&&(d-=h),y&&(f-=u),/^(se|s|e)$/.test(o)?(i.size.width=d,i.size.height=f):/^(ne)$/.test(o)?(i.size.width=d,i.size.height=f,i.position.top=a.top-c):/^(sw)$/.test(o)?(i.size.width=d,i.size.height=f,i.position.left=a.left-p):((f-u<=0||d-h<=0)&&(t=i._getPaddingPlusBorderDimensions(this)),f-u>0?(i.size.height=f,i.position.top=a.top-c):(f=u-t.height,i.size.height=f,i.position.top=a.top+r.height-f),d-h>0?(i.size.width=d,i.position.left=a.left-p):(d=h-t.width,i.size.width=d,i.position.left=a.left+r.width-d))}});e.ui.resizable,e.widget("ui.selectable",e.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t.elementPos=e(t.element[0]).offset(),t.selectees=e(t.options.filter,t.element[0]),t._addClass(t.selectees,"ui-selectee"),t.selectees.each(function(){var i=e(this),n=i.offset(),s={left:n.left-t.elementPos.left,top:n.top-t.elementPos.top};e.data(this,"selectable-item",{element:this,$element:i,left:s.left,top:s.top,right:s.left+i.outerWidth(),bottom:s.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=e("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(t){var i=this,n=this.options;this.opos=[t.pageX,t.pageY],this.elementPos=e(this.element[0]).offset(),this.options.disabled||(this.selectees=e(n.filter,this.element[0]),this._trigger("start",t),e(n.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=e.data(this,"selectable-item");n.startselected=!0,t.metaKey||t.ctrlKey||(i._removeClass(n.$element,"ui-selected"),n.selected=!1,i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",t,{unselecting:n.element}))}),e(t.target).parents().addBack().each(function(){var n,s=e.data(this,"selectable-item");if(s)return n=!t.metaKey&&!t.ctrlKey||!s.$element.hasClass("ui-selected"),i._removeClass(s.$element,n?"ui-unselecting":"ui-selected")._addClass(s.$element,n?"ui-selecting":"ui-unselecting"),s.unselecting=!n,s.selecting=n,s.selected=n,n?i._trigger("selecting",t,{selecting:s.element}):i._trigger("unselecting",t,{unselecting:s.element}),!1}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,n=this,s=this.options,r=this.opos[0],a=this.opos[1],o=t.pageX,l=t.pageY;return r>o&&(i=o,o=r,r=i),a>l&&(i=l,l=a,a=i),this.helper.css({left:r,top:a,width:o-r,height:l-a}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),h=!1,u={};i&&i.element!==n.element[0]&&(u.left=i.left+n.elementPos.left,u.right=i.right+n.elementPos.left,u.top=i.top+n.elementPos.top,u.bottom=i.bottom+n.elementPos.top,"touch"===s.tolerance?h=!(u.left>o||u.right<r||u.top>l||u.bottom<a):"fit"===s.tolerance&&(h=u.left>r&&u.right<o&&u.top>a&&u.bottom<l),h?(i.selected&&(n._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(n._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(n._addClass(i.$element,"ui-selecting"),i.selecting=!0,n._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,n._addClass(i.$element,"ui-selected"),i.selected=!0):(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),n._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(n._removeClass(i.$element,"ui-selected"),i.selected=!1,n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");i._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1,n.startselected=!1,i._trigger("unselected",t,{unselected:n.element})}),e(".ui-selecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");i._removeClass(n.$element,"ui-selecting")._addClass(n.$element,"ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,i._trigger("selected",t,{selected:n.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,i){return e>=t&&e<t+i},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),e.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,i){var n=null,s=!1,r=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")===r)return n=e(this),!1}),e.data(t.target,r.widgetName+"-item")===r&&(n=e(t.target)),!!n&&(!(this.options.handle&&!i&&(e(this.options.handle,n).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=n,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,i,n){var s,r,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(r=this.document.find("body"),this.storedCursor=r.css("cursor"),r.css("cursor",a.cursor),this.storedStylesheet=e("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(r)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!a.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,n,s,r,a=this.options,o=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=o=this.scrollParent[0].scrollTop+a.scrollSpeed:t.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=o=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=o=this.scrollParent[0].scrollLeft+a.scrollSpeed:t.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=o=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(t.pageY-this.document.scrollTop()<a.scrollSensitivity?o=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<a.scrollSensitivity&&(o=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),t.pageX-this.document.scrollLeft()<a.scrollSensitivity?o=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(o=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),!1!==o&&e.ui.ddmanager&&!a.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=this.items[i],s=n.item[0],(r=this._intersectsWithPointer(n))&&n.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===r?"next":"prev"]()[0]===s||e.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],s))){if(this.direction=1===r?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(t,n),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var n=this,s=this.placeholder.offset(),r=this.options.axis,a={};r&&"x"!==r||(a.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),r&&"y"!==r||(a.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){n._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new e.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&n.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!n.length&&t.key&&n.push(t.key+"="),n.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},i.each(function(){n.push(e(t.item||this).attr(t.attribute||"id")||"")}),n},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,n=this.positionAbs.top,s=n+this.helperProportions.height,r=e.left,a=r+e.width,o=e.top,l=o+e.height,h=this.offset.click.top,u=this.offset.click.left,p="x"===this.options.axis||n+h>o&&n+h<l,c="y"===this.options.axis||t+u>r&&t+u<a,d=p&&c;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?d:r<t+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&o<n+this.helperProportions.height/2&&s-this.helperProportions.height/2<l},_intersectsWithPointer:function(e){var t,i,n="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),s="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width);return!(!n||!s)&&(t=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===t?2:1:t&&("down"===t?2:1))},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),n=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?"right"===s&&i||"left"===s&&!i:n&&("down"===n&&t||"up"===n&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function i(){o.push(this)}var n,s,r,a,o=[],l=[],h=this._connectWith();if(h&&t)for(n=h.length-1;n>=0;n--)for(s=(r=e(h[n],this.document[0])).length-1;s>=0;s--)(a=e.data(r[s],this.widgetFullName))&&a!==this&&!a.options.disabled&&l.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=l.length-1;n>=0;n--)l[n][0].each(i);return e(o)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;i<t.length;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,n,s,r,a,o,l,h,u=this.items,p=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready)for(i=c.length-1;i>=0;i--)for(n=(s=e(c[i],this.document[0])).length-1;n>=0;n--)(r=e.data(s[n],this.widgetFullName))&&r!==this&&!r.options.disabled&&(p.push([e.isFunction(r.options.items)?r.options.items.call(r.element[0],t,{item:this.currentItem}):e(r.options.items,r.element),r]),this.containers.push(r));for(i=p.length-1;i>=0;i--)for(a=p[i][1],n=0,h=(o=p[i][0]).length;n<h;n++)(l=e(o[n])).data(this.widgetName+"-item",a),u.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,n,s,r;for(i=this.items.length-1;i>=0;i--)(n=this.items[i]).instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?e(this.options.toleranceElement,n.item):n.item,t||(n.width=s.outerWidth(),n.height=s.outerHeight()),r=s.offset(),n.left=r.left,n.top=r.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)r=this.containers[i].element.offset(),this.containers[i].containerCache.left=r.left,this.containers[i].containerCache.top=r.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){var i,n=(t=t||this).options;n.placeholder&&n.placeholder.constructor!==String||(i=n.placeholder,n.placeholder={element:function(){var n=t.currentItem[0].nodeName.toLowerCase(),s=e("<"+n+">",t.document[0]);return t._addClass(s,"ui-sortable-placeholder",i||t.currentItem[0].className)._removeClass(s,"ui-sortable-helper"),"tbody"===n?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(s)):"tr"===n?t._createTrPlaceholder(t.currentItem,s):"img"===n&&s.attr("src",t.currentItem.attr("src")),i||s.css("visibility","hidden"),s},update:function(e,s){i&&!n.forcePlaceholderSize||(s.height()||s.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),s.width()||s.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,i){var n=this;t.children().each(function(){e("<td>&#160;</td>",n.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(t){var i,n,s,r,a,o,l,h,u,p,c=null,d=null;for(i=this.containers.length-1;i>=0;i--)if(!e.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(c&&e.contains(this.containers[i].element[0],c.element[0]))continue;c=this.containers[i],d=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0);if(c)if(1===this.containers.length)this.containers[d].containerCache.over||(this.containers[d]._trigger("over",t,this._uiHash(this)),this.containers[d].containerCache.over=1);else{for(s=1e4,r=null,a=(u=c.floating||this._isFloating(this.currentItem))?"left":"top",o=u?"width":"height",p=u?"pageX":"pageY",n=this.items.length-1;n>=0;n--)e.contains(this.containers[d].element[0],this.items[n].item[0])&&this.items[n].item[0]!==this.currentItem[0]&&(l=this.items[n].item.offset()[a],h=!1,t[p]-l>this.items[n][o]/2&&(h=!0),Math.abs(t[p]-l)<s&&(s=Math.abs(t[p]-l),r=this.items[n],this.direction=h?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[d])return void(this.currentContainer.containerCache.over||(this.containers[d]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1));r?this._rearrange(t,r,null,!0):this._rearrange(t,null,this.containers[d].element,!0),this._trigger("change",t,this._uiHash()),this.containers[d]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[d],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",t,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),n[0].style.width&&!i.forceHelperSize||n.width(this.currentItem.width()),n[0].style.height&&!i.forceHelperSize||n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n,s=this.options;"parent"===s.containment&&(s.containment=this.helper[0].parentNode),"document"!==s.containment&&"window"!==s.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===s.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===s.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(s.containment)||(t=e(s.containment)[0],i=e(s.containment).offset(),n="hidden"!==e(t).css("overflow"),this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(n?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(n?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var n="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(s[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:s.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:s.scrollLeft())*n}},_generatePosition:function(t){var i,n,s=this.options,r=t.pageX,a=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(r=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(r=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),s.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-s.grid[1]:i+s.grid[1]:i,n=this.originalPageX+Math.round((r-this.originalPageX)/s.grid[0])*s.grid[0],r=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-s.grid[0]:n+s.grid[0]:n)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:o.scrollTop()),left:r-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:o.scrollLeft())}},_rearrange:function(e,t,i,n){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var s=this.counter;this._delay(function(){s===this.counter&&this.refreshPositions(!n)})},_clear:function(e,t){function i(e,t,i){return function(n){i._trigger(e,n,t._uiHash(t))}}this.reverting=!1;var n,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&s.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||s.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(s.push(function(e){this._trigger("remove",e,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)t||s.push(i("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(s.push(i("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(n=0;n<s.length;n++)s[n].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===e.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}}),e.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t,i,n=this.options.icons;n&&(t=e("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+n.header),t.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,n.header)._addClass(i,null,n.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"!==e?("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons())):this._activate(t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,n=this.headers.length,s=this.headers.index(t.target),r=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:r=this.headers[(s+1)%n];break;case i.LEFT:case i.UP:r=this.headers[(s-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:r=this.headers[0];break;case i.END:r=this.headers[n-1]}r&&(e(t.target).attr("tabIndex",-1),e(r).attr("tabIndex",0),e(r).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=e()):!1===t.active?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,i=this.options,n=i.heightStyle,s=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=e(this),i=t.uniqueId().attr("id"),n=t.next(),s=n.uniqueId().attr("id");t.attr("aria-controls",s),n.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===n?(t=s.height(),this.element.siblings(":visible").each(function(){var i=e(this),n=i.css("position");"absolute"!==n&&"fixed"!==n&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===n&&(t=0,this.headers.next().each(function(){var i=e(this).is(":visible");i||e(this).show(),t=Math.max(t,e(this).css("height","").height()),i||e(this).hide()}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i,n,s=this.options,r=this.active,a=e(t.currentTarget),o=a[0]===r[0],l=o&&s.collapsible,h=l?e():a.next(),u={oldHeader:r,oldPanel:r.next(),newHeader:l?e():a,newPanel:h};t.preventDefault(),o&&!s.collapsible||!1===this._trigger("beforeActivate",t,u)||(s.active=!l&&this.headers.index(a),this.active=o?e():a,this._toggle(u),this._removeClass(r,"ui-accordion-header-active","ui-state-active"),s.icons&&(i=r.children(".ui-accordion-header-icon"),this._removeClass(i,null,s.icons.activeHeader)._addClass(i,null,s.icons.header)),o||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),s.icons&&(n=a.children(".ui-accordion-header-icon"),this._removeClass(n,null,s.icons.header)._addClass(n,null,s.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,n=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,t):(n.hide(),i.show(),this._toggleComplete(t)),n.attr({"aria-hidden":"true"}),n.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&n.length?n.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,i){var n,s,r,a=this,o=0,l=e.css("box-sizing"),h=e.length&&(!t.length||e.index()<t.index()),u=this.options.animate||{},p=h&&u.down||u,c=function(){a._toggleComplete(i)};return"number"==typeof p&&(r=p),"string"==typeof p&&(s=p),s=s||p.easing||u.easing,r=r||p.duration||u.duration,t.length?e.length?(n=e.show().outerHeight(),t.animate(this.hideProps,{duration:r,easing:s,step:function(e,t){t.now=Math.round(e)}}),void e.hide().animate(this.showProps,{duration:r,easing:s,complete:c,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?"content-box"===l&&(o+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(n-t.outerHeight()-o),o=0)}})):t.animate(this.hideProps,r,s,c):e.animate(this.showProps,r,s,c)},_toggleComplete:function(e){var t=e.oldPanel,i=t.prev();this._removeClass(t,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var i=e(t.target),n=e(e.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&n.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var i=e(t.target).closest(".ui-menu-item"),n=e(t.currentTarget);i[0]===n[0]&&(this._removeClass(n.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,n))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){!e.contains(this.element[0],e.ui.safeActiveElement(this.document[0]))&&this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=e(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var i,n,s,r,a=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:a=!1,n=this.previousFilter||"",r=!1,s=t.keyCode>=96&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),s===n?r=!0:s=n+s,i=this._filterMenuItems(s),(i=r&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i).length||(s=String.fromCharCode(t.keyCode),i=this._filterMenuItems(s)),i.length?(this.focus(t,i),this.previousFilter=s,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&t.preventDefault()},_activate:function(e){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,i,n,s,r=this,a=this.options.icons.submenu,o=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),i=o.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),i=t.prev(),n=e("<span>").data("ui-menu-submenu-caret",!0);r._addClass(n,"ui-menu-icon","ui-icon "+a),i.attr("aria-haspopup","true").prepend(n),t.attr("aria-labelledby",i.attr("id"))}),this._addClass(i,"ui-menu","ui-widget ui-widget-content ui-front"),(t=o.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=e(this);r._isDivider(t)&&r._addClass(t,"ui-menu-divider","ui-widget-content")}),s=(n=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(s,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){if("icons"===e){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,t.submenu)}this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",String(e)),this._toggleClass(null,"ui-state-disabled",!!e)},focus:function(e,t){var i,n,s;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),n=this.active.children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",n.attr("id")),s=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=t.children(".ui-menu")).length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,n,s,r,a,o;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,s=t.offset().top-this.activeMenu.offset().top-i-n,r=this.activeMenu.scrollTop(),a=this.activeMenu.height(),o=t.outerHeight(),s<0?this.activeMenu.scrollTop(r+s):s+o>a&&this.activeMenu.scrollTop(r+s-a+o))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",e,{item:this.active}),this.active=null)},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var n=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(t),this._removeClass(n.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=n},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var n;this.active&&(n="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),n&&n.length&&this.active||(n=this.activeMenu.find(this.options.items)[t]()),this.focus(i,n)},nextPage:function(t){var i,n,s;this.active?this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(i=e(this)).offset().top-n-s<0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var i,n,s;this.active?this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return(i=e(this)).offset().top-n+s>0}),this.focus(t,i)):this.focus(t,this.activeMenu.find(this.options.items).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)},_filterMenuItems:function(t){var i=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),n=new RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return n.test(e.trim(e(this).children(".ui-menu-item-wrapper").text()))})}});e.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,i,n,s=this.element[0].nodeName.toLowerCase(),r="textarea"===s,a="input"===s;this.isMultiLine=r||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[r||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(s){if(this.element.prop("readOnly"))return t=!0,n=!0,void(i=!0);t=!1,n=!1,i=!1;var r=e.ui.keyCode;switch(s.keyCode){case r.PAGE_UP:t=!0,this._move("previousPage",s);break;case r.PAGE_DOWN:t=!0,this._move("nextPage",s);break;case r.UP:t=!0,this._keyEvent("previous",s);break;case r.DOWN:t=!0,this._keyEvent("next",s);break;case r.ENTER:this.menu.active&&(t=!0,s.preventDefault(),this.menu.select(s));break;case r.TAB:this.menu.active&&this.menu.select(s);break;case r.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(s),s.preventDefault());break;default:i=!0,this._searchTimeout(s)}},keypress:function(n){if(t)return t=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||n.preventDefault());if(!i){var s=e.ui.keyCode;switch(n.keyCode){case s.PAGE_UP:this._move("previousPage",n);break;case s.PAGE_DOWN:this._move("nextPage",n);break;case s.UP:this._keyEvent("previous",n);break;case s.DOWN:this._keyEvent("next",n)}}},input:function(e){if(n)return n=!1,void e.preventDefault();this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(e),this._change(e))}}),this._initSource(),this.menu=e("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==e.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,i){var n,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});s=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(n=i.item.attr("aria-label")||s.value)&&e.trim(n).length&&(this.liveRegion.children().hide(),e("<div>").text(n).appendTo(this.liveRegion))},menuselect:function(t,i){var n=i.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==e.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=n})),!1!==this._trigger("select",t,{item:n})&&this._value(n.value),this.term=this._value(),this.close(t),this.selectedItem=n}}),this.liveRegion=e("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var i=this.menu.element[0];return t.target===this.element[0]||t.target===i||e.contains(i,t.target)},_closeOnClickOutside:function(e){this._isEventTargetInWidget(e)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,n=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,n){n(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,s){n.xhr&&n.xhr.abort(),n.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){s(e)},error:function(){s([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),i=this.menu.element.is(":visible"),n=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;t&&(!t||i||n)||(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):!1!==this._trigger("search",t)?this._search(e):void 0},_search:function(e){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),--this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var n=this;e.each(i,function(e,i){n._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<div>").text(i.label)).appendTo(t)},_move:function(e,t){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[e](t);this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())},_isContentEditable:function(e){if(!e.length)return!1;var t=e.prop("contentEditable");return"inherit"===t?this._isContentEditable(e.parent()):"true"===t}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var n=new RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return n.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(i).appendTo(this.liveRegion))}});e.ui.autocomplete;var c=/ui-corner-([a-z]){2,6}/g;e.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var t=this,i=[];e.each(this.options.items,function(n,s){var r,a={};if(s)return"controlgroupLabel"===n?((r=t.element.find(s)).each(function(){var t=e(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),t._addClass(r,null,"ui-widget ui-widget-content ui-state-default"),void(i=i.concat(r.get()))):void(e.fn[n]&&(a=t["_"+n+"Options"]?t["_"+n+"Options"]("middle"):{classes:{}},t.element.find(s).each(function(){var s=e(this),r=s[n]("instance"),o=e.widget.extend({},a);if("button"!==n||!s.parent(".ui-spinner").length){r||(r=s[n]()[n]("instance")),r&&(o.classes=t._resolveClassesValues(o.classes,r)),s[n](o);var l=s[n]("widget");e.data(l[0],"ui-controlgroup-data",r||s[n]("instance")),i.push(l[0])}})))}),this.childWidgets=e(e.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(t){this.childWidgets.each(function(){var i=e(this).data("ui-controlgroup-data");i&&i[t]&&i[t]()})},_updateCornerClass:function(e,t){var i=this._buildSimpleOptions(t,"label").classes.label;this._removeClass(e,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(e,null,i)},_buildSimpleOptions:function(e,t){var i="vertical"===this.options.direction,n={classes:{}};return n.classes[t]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[e],n},_spinnerOptions:function(e){var t=this._buildSimpleOptions(e,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(e){return this._buildSimpleOptions(e,"ui-button")},_checkboxradioOptions:function(e){return this._buildSimpleOptions(e,"ui-checkboxradio-label")},_selectmenuOptions:function(e){var t="vertical"===this.options.direction;return{width:!!t&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(t?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(t?"top":"left")},last:{"ui-selectmenu-button-open":t?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(t?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[e]}},_resolveClassesValues:function(t,i){var n={};return e.each(t,function(s){var r=i.options.classes[s]||"";r=e.trim(r.replace(c,"")),n[s]=(r+" "+t[s]).replace(/\s+/g," ")}),n},_setOption:function(e,t){"direction"===e&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(e,t),"disabled"!==e?this.refresh():this._callChildMethod(t?"disable":"enable")},refresh:function(){var t,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),t=this.childWidgets,this.options.onlyVisible&&(t=t.filter(":visible")),t.length&&(e.each(["first","last"],function(e,n){var s=t[n]().data("ui-controlgroup-data");if(s&&i["_"+s.widgetName+"Options"]){var r=i["_"+s.widgetName+"Options"](1===t.length?"only":n);r.classes=i._resolveClassesValues(r.classes,s),s.element[s.widgetName](r)}else i._updateCornerClass(t[n](),n)}),this._callChildMethod("refresh"))}});e.widget("ui.checkboxradio",[e.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,i,n=this,s=this._super()||{};return this._readType(),i=this.element.labels(),this.label=e(i[i.length-1]),this.label.length||e.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){n.originalLabel+=3===this.nodeType?e(this).text():this.outerHTML}),this.originalLabel&&(s.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(s.disabled=t),s},_create:function(){var e=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),e&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||e.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,i="input[name='"+e.ui.escapeSelector(t)+"']";return t?(this.form.length?e(this.form[0].elements).filter(i):e(i).filter(function(){return 0===e(this).form().length})).not(this.element):e([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=e(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(e,t){if("label"!==e||t){if(this._super(e,t),"disabled"===e)return this._toggleClass(this.label,null,"ui-state-disabled",t),void(this.element[0].disabled=t);this.refresh()}},_updateIcon:function(t){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=e("<span>"),this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var e=this.label.contents().not(this.element[0]);this.icon&&(e=e.not(this.icon[0])),this.iconSpace&&(e=e.not(this.iconSpace[0])),e.remove(),this.label.append(this.options.label)},refresh:function(){var e=this.element[0].checked,t=this.element[0].disabled;this._updateIcon(e),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),null!==this.options.label&&this._updateLabel(),t!==this.options.disabled&&this._setOptions({disabled:t})}}]);e.ui.checkboxradio;e.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var e,t=this._super()||{};return this.isInput=this.element.is("input"),null!=(e=this.element[0].disabled)&&(t.disabled=e),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(t.label=this.originalLabel),t},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===e.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,i){var n="iconPosition"!==t,s=n?this.options.iconPosition:i,r="top"===s||"bottom"===s;this.icon?n&&this._removeClass(this.icon,null,this.options.icon):(this.icon=e("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),n&&this._addClass(this.icon,null,i),this._attachIcon(s),r?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(e){this.icon[/^(?:end|bottom)/.test(e)?"before":"after"](this.iconSpace)},_attachIcon:function(e){this.element[/^(?:end|bottom)/.test(e)?"append":"prepend"](this.icon)},_setOptions:function(e){var t=void 0===e.showLabel?this.options.showLabel:e.showLabel,i=void 0===e.icon?this.options.icon:e.icon;t||i||(e.showLabel=!0),this._super(e)},_setOption:function(e,t){"icon"===e&&(t?this._updateIcon(e,t):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===e&&this._updateIcon(e,t),"showLabel"===e&&(this._toggleClass("ui-button-icon-only",null,!t),this._updateTooltip()),"label"===e&&(this.isInput?this.element.val(t):(this.element.html(t),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(e,t),"disabled"===e&&(this._toggleClass(null,"ui-state-disabled",t),this.element[0].disabled=t,t&&this.element.blur())},refresh:function(){var e=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOptions({disabled:e}),this._updateTooltip()}}),!1!==e.uiBackCompat&&(e.widget("ui.button",e.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(e,t){"text"!==e?("showLabel"===e&&(this.options.text=t),"icon"===e&&(this.options.icons.primary=t),"icons"===e&&(t.primary?(this._super("icon",t.primary),this._super("iconPosition","beginning")):t.secondary&&(this._super("icon",t.secondary),this._super("iconPosition","end"))),this._superApply(arguments)):this._super("showLabel",t)}}),e.fn.button=function(t){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?t.apply(this,arguments):(e.ui.checkboxradio||e.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(e.fn.button),e.fn.buttonset=function(){return e.ui.controlgroup||e.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});e.ui.button;e.extend(e.ui,{datepicker:{version:"1.12.1"}});var d;e.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return a(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var n,s,r;s="div"===(n=t.nodeName.toLowerCase())||"span"===n,t.id||(this.uuid+=1,t.id="dp"+this.uuid),(r=this._newInst(e(t),s)).settings=e.extend({},i||{}),"input"===n?this._connectDatepicker(t,r):s&&this._inlineDatepicker(t,r)},_newInst:function(t,i){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var n=e(t);i.append=e([]),i.trigger=e([]),n.hasClass(this.markerClassName)||(this._attachments(n,i),n.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),e.data(t,"datepicker",i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var n,s,r,a=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=e("<span class='"+this._appendClass+"'>"+a+"</span>"),t[o?"before":"after"](i.append)),t.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),"focus"!==(n=this._get(i,"showOn"))&&"both"!==n||t.on("focus",this._showDatepicker),"button"!==n&&"both"!==n||(s=this._get(i,"buttonText"),r=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:r,alt:s,title:s}):e("<button type='button'></button>").addClass(this._triggerClass).html(r?e("<img/>").attr({src:r,alt:s,title:s}):s)),t[o?"before":"after"](i.trigger),i.trigger.on("click",function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,n,s,r=new Date(2009,11,20),a=this._get(e,"dateFormat");a.match(/[DM]/)&&(t=function(e){for(i=0,n=0,s=0;s<e.length;s++)e[s].length>i&&(i=e[s].length,n=s);return n},r.setMonth(t(this._get(e,a.match(/MM/)?"monthNames":"monthNamesShort"))),r.setDate(t(this._get(e,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-r.getDay())),e.input.attr("size",this._formatDate(e,r).length)}},_inlineDatepicker:function(t,i){var n=e(t);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(i.dpDiv),e.data(t,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,n,s,r){var o,l,h,u,p,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+o+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),e("body").append(this._dialogInput),(c=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},e.data(this._dialogInput[0],"datepicker",c)),a(c.settings,s||{}),i=i&&i.constructor===Date?this._formatDate(c,i):i,this._dialogInput.val(i),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,this._pos||(l=document.documentElement.clientWidth,h=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,p=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,h/2-150+p]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var i,n=e(t),s=e.data(t,"datepicker");n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===i?(s.append.remove(),s.trigger.remove(),n.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==i&&"span"!==i||n.removeClass(this.markerClassName).empty(),d===s&&(d=null))},_enableDatepicker:function(t){var i,n,s=e(t),r=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&("input"===(i=t.nodeName.toLowerCase())?(t.disabled=!1,r.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==i&&"span"!==i||((n=s.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,n,s=e(t),r=e.data(t,"datepicker");s.hasClass(this.markerClassName)&&("input"===(i=t.nodeName.toLowerCase())?(t.disabled=!0,r.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==i&&"span"!==i||((n=s.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(e){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,n){var s,r,o,l,h=this._getInst(t);if(2===arguments.length&&"string"==typeof i)return"defaults"===i?e.extend({},e.datepicker._defaults):h?"all"===i?e.extend({},h.settings):this._get(h,i):null;s=i||{},"string"==typeof i&&((s={})[i]=n),h&&(this._curInst===h&&this._hideDatepicker(),r=this._getDateDatepicker(t,!0),o=this._getMinMaxDate(h,"min"),l=this._getMinMaxDate(h,"max"),a(h.settings,s),null!==o&&void 0!==s.dateFormat&&void 0===s.minDate&&(h.settings.minDate=this._formatDate(h,o)),null!==l&&void 0!==s.dateFormat&&void 0===s.maxDate&&(h.settings.maxDate=this._formatDate(h,l)),"disabled"in s&&(s.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),h),this._autoSize(h),this._setDate(h,r),this._updateAlternate(h),this._updateDatepicker(h))},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,n,s,r=e.datepicker._getInst(t.target),a=!0,o=r.dpDiv.is(".ui-datepicker-rtl");if(r._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),a=!1;break;case 13:return(s=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",r.dpDiv))[0]&&e.datepicker._selectDay(t.target,r.selectedMonth,r.selectedYear,s[0]),i=e.datepicker._get(r,"onSelect"),i?(n=e.datepicker._formatDate(r),i.apply(r.input?r.input[0]:null,[n,r])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(r,"stepBigMonths"):-e.datepicker._get(r,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(r,"stepBigMonths"):+e.datepicker._get(r,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),a=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),a=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?1:-1,"D"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(r,"stepBigMonths"):-e.datepicker._get(r,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),a=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,o?-1:1,"D"),a=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(r,"stepBigMonths"):+e.datepicker._get(r,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),a=t.ctrlKey||t.metaKey;break;default:a=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):a=!1;a&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,n,s=e.datepicker._getInst(t.target);if(e.datepicker._get(s,"constrainInput"))return i=e.datepicker._possibleChars(e.datepicker._get(s,"dateFormat")),n=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||n<" "||!i||i.indexOf(n)>-1},_doKeyUp:function(t){var i=e.datepicker._getInst(t.target);if(i.input.val()!==i.lastVal)try{e.datepicker.parseDate(e.datepicker._get(i,"dateFormat"),i.input?i.input.val():null,e.datepicker._getFormatConfig(i))&&(e.datepicker._setDateFromField(i),e.datepicker._updateAlternate(i),e.datepicker._updateDatepicker(i))}catch(e){}return!0},_showDatepicker:function(t){if("input"!==(t=t.target||t).nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var n,s,r,o,l,h,u;n=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==n&&(e.datepicker._curInst.dpDiv.stop(!0,!0),n&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),!1!==(r=(s=e.datepicker._get(n,"beforeShow"))?s.apply(t,[t,n]):{})&&(a(n.settings,r),n.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(n),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return!(o|="fixed"===e(this).css("position"))}),l={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(n),l=e.datepicker._checkOffset(n,l,o),n.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:l.left+"px",top:l.top+"px"}),n.inline||(h=e.datepicker._get(n,"showAnim"),u=e.datepicker._get(n,"duration"),n.dpDiv.css("z-index",i(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[h]?n.dpDiv.show(h,e.datepicker._get(n,"showOptions"),u):n.dpDiv[h||"show"](h?u:null),e.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),e.datepicker._curInst=n))}},_updateDatepicker:function(t){this.maxRows=4,d=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var i,n=this._getNumberOfMonths(t),s=n[1],a=t.dpDiv.find("."+this._dayOverClass+" a");a.length>0&&r.apply(a.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&t.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),t.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,n){var s=t.dpDiv.outerWidth(),r=t.dpDiv.outerHeight(),a=t.input?t.input.outerWidth():0,o=t.input?t.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:e(document).scrollLeft()),h=document.documentElement.clientHeight+(n?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?s-a:0,i.left-=n&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=n&&i.top===t.input.offset().top+o?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>l&&l>s?Math.abs(i.left+s-l):0),i.top-=Math.min(i.top,i.top+r>h&&h>r?Math.abs(r+o):0),i},_findPos:function(t){for(var i,n=this._getInst(t),s=this._get(n,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[s?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,n,s,r,a=this._curInst;!a||t&&a!==e.data(t,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),n=this._get(a,"duration"),s=function(){e.datepicker._tidyDialog(a)},e.effects&&(e.effects.effect[i]||e.effects[i])?a.dpDiv.hide(i,e.datepicker._get(a,"showOptions"),n,s):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,s),i||s(),this._datepickerShowing=!1,(r=this._get(a,"onClose"))&&r.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),n=e.datepicker._getInst(i[0]);(i[0].id===e.datepicker._mainDivId||0!==i.parents("#"+e.datepicker._mainDivId).length||i.hasClass(e.datepicker.markerClassName)||i.closest("."+e.datepicker._triggerClass).length||!e.datepicker._datepickerShowing||e.datepicker._inDialog&&e.blockUI)&&(!i.hasClass(e.datepicker.markerClassName)||e.datepicker._curInst===n)||e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,n){var s=e(t),r=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(r,i+("M"===n?this._get(r,"showCurrentAtPos"):0),n),this._updateDatepicker(r))},_gotoToday:function(t){var i,n=e(t),s=this._getInst(n[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(n)},_selectMonthYear:function(t,i,n){var s=e(t),r=this._getInst(s[0]);r["selected"+("M"===n?"Month":"Year")]=r["draw"+("M"===n?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(r),this._adjustDate(s)},_selectDay:function(t,i,n,s){var r,a=e(t);e(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||((r=this._getInst(a[0])).selectedDay=r.currentDay=e("a",s).html(),r.selectedMonth=r.currentMonth=i,r.selectedYear=r.currentYear=n,this._selectDate(t,this._formatDate(r,r.currentDay,r.currentMonth,r.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var n,s=e(t),r=this._getInst(s[0]);i=null!=i?i:this._formatDate(r),r.input&&r.input.val(i),this._updateAlternate(r),(n=this._get(r,"onSelect"))?n.apply(r.input?r.input[0]:null,[i,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],"object"!=typeof r.input[0]&&r.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var i,n,s,r=this._get(t,"altField");r&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),n=this._getDate(t),s=this.formatDate(i,n,this._getFormatConfig(t)),e(r).val(s))},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,n){if(null==t||null==i)throw"Invalid arguments";if(""===(i="object"==typeof i?i.toString():i+""))return null;var s,r,a,o,l=0,h=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),p=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,c=(n?n.dayNames:null)||this._defaults.dayNames,d=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,f=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,y=-1,g=-1,v=-1,L=!1,O=function(e){var i=s+1<t.length&&t.charAt(s+1)===e;return i&&s++,i},b=function(e){var t=O(e),n="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,s="y"===e?n:1,r=new RegExp("^\\d{"+s+","+n+"}"),a=i.substring(l).match(r);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},w=function(t,n,s){var r=-1,a=e.map(O(t)?s:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(a,function(e,t){var n=t[1];if(i.substr(l,n.length).toLowerCase()===n.toLowerCase())return r=t[0],l+=n.length,!1}),-1!==r)return r+1;throw"Unknown name at position "+l},S=function(){if(i.charAt(l)!==t.charAt(s))throw"Unexpected literal at position "+l;l++};for(s=0;s<t.length;s++)if(L)"'"!==t.charAt(s)||O("'")?S():L=!1;else switch(t.charAt(s)){case"d":g=b("d");break;case"D":w("D",p,c);break;case"o":v=b("o");break;case"m":y=b("m");break;case"M":y=w("M",d,f);break;case"y":m=b("y");break;case"@":m=(o=new Date(b("@"))).getFullYear(),y=o.getMonth()+1,g=o.getDate();break;case"!":m=(o=new Date((b("!")-this._ticksTo1970)/1e4)).getFullYear(),y=o.getMonth()+1,g=o.getDate();break;case"'":O("'")?S():L=!0;break;default:S()}if(l<i.length&&(a=i.substr(l),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===m?m=(new Date).getFullYear():m<100&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(m<=u?0:-100)),v>-1)for(y=1,g=v;;){if(r=this._getDaysInMonth(m,y-1),g<=r)break;y++,g-=r}if((o=this._daylightSavingAdjust(new Date(m,y-1,g))).getFullYear()!==m||o.getMonth()+1!==y||o.getDate()!==g)throw"Invalid date";return o},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";var n,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,r=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,l=function(t){var i=n+1<e.length&&e.charAt(n+1)===t;return i&&n++,i},h=function(e,t,i){var n=""+t;if(l(e))for(;n.length<i;)n="0"+n;return n},u=function(e,t,i,n){return l(e)?n[t]:i[t]},p="",c=!1;if(t)for(n=0;n<e.length;n++)if(c)"'"!==e.charAt(n)||l("'")?p+=e.charAt(n):c=!1;else switch(e.charAt(n)){case"d":p+=h("d",t.getDate(),2);break;case"D":p+=u("D",t.getDay(),s,r);break;case"o":p+=h("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":p+=h("m",t.getMonth()+1,2);break;case"M":p+=u("M",t.getMonth(),a,o);break;case"y":p+=l("y")?t.getFullYear():(t.getFullYear()%100<10?"0":"")+t.getFullYear()%100;break;case"@":p+=t.getTime();break;case"!":p+=1e4*t.getTime()+this._ticksTo1970;break;case"'":l("'")?p+="'":c=!0;break;default:p+=e.charAt(n)}return p},_possibleChars:function(e){var t,i="",n=!1,s=function(i){var n=t+1<e.length&&e.charAt(t+1)===i;return n&&t++,n};for(t=0;t<e.length;t++)if(n)"'"!==e.charAt(t)||s("'")?i+=e.charAt(t):n=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":n=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),n=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),r=s,a=this._getFormatConfig(e);try{r=this.parseDate(i,n,a)||s}catch(e){n=t?"":n}e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),e.currentDay=n?r.getDate():0,e.currentMonth=n?r.getMonth():0,e.currentYear=n?r.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,n){var s=null==i||""===i?n:"string"==typeof i?function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(e){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,s=n.getFullYear(),r=n.getMonth(),a=n.getDate(),o=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=o.exec(i);l;){switch(l[2]||"d"){case"d":case"D":a+=parseInt(l[1],10);break;case"w":case"W":a+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),a=Math.min(a,e.datepicker._getDaysInMonth(s,r));break;case"y":case"Y":s+=parseInt(l[1],10),a=Math.min(a,e.datepicker._getDaysInMonth(s,r))}l=o.exec(i)}return new Date(s,r,a)}(i):"number"==typeof i?isNaN(i)?n:function(e){var t=new Date;return t.setDate(t.getDate()+e),t}(i):new Date(i.getTime());return(s=s&&"Invalid Date"===s.toString()?n:s)&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var n=!t,s=e.selectedMonth,r=e.selectedYear,a=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=a.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=a.getMonth(),e.drawYear=e.selectedYear=e.currentYear=a.getFullYear(),s===e.selectedMonth&&r===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(n?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),n="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(n,-i,"M")},next:function(){e.datepicker._adjustDate(n,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(n)},selectDay:function(){return e.datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(n,this,"Y"),!1}};e(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,n,s,r,a,o,l,h,u,p,c,d,f,m,y,g,v,L,O,b,w,S,C,x,_,E,N,P,M,T,k,A,F,D,I,R,z,U,B=new Date,G=this._daylightSavingAdjust(new Date(B.getFullYear(),B.getMonth(),B.getDate())),H=this._get(e,"isRTL"),j=this._get(e,"showButtonPanel"),W=this._get(e,"hideIfNoPrevNext"),V=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),Y=this._get(e,"showCurrentAtPos"),X=this._get(e,"stepMonths"),Z=1!==q[0]||1!==q[1],$=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),K=this._getMinMaxDate(e,"min"),Q=this._getMinMaxDate(e,"max"),J=e.drawMonth-Y,ee=e.drawYear;if(J<0&&(J+=12,ee--),Q)for(t=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-q[0]*q[1]+1,Q.getDate())),t=K&&t<K?K:t;this._daylightSavingAdjust(new Date(ee,J,1))>t;)--J<0&&(J=11,ee--);for(e.drawMonth=J,e.drawYear=ee,i=this._get(e,"prevText"),i=V?this.formatDate(i,this._daylightSavingAdjust(new Date(ee,J-X,1)),this._getFormatConfig(e)):i,n=this._canAdjustMonth(e,-1,ee,J)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"e":"w")+"'>"+i+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"e":"w")+"'>"+i+"</span></a>",s=this._get(e,"nextText"),s=V?this.formatDate(s,this._daylightSavingAdjust(new Date(ee,J+X,1)),this._getFormatConfig(e)):s,r=this._canAdjustMonth(e,1,ee,J)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"w":"e")+"'>"+s+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(H?"w":"e")+"'>"+s+"</span></a>",a=this._get(e,"currentText"),o=this._get(e,"gotoCurrent")&&e.currentDay?$:G,a=V?this.formatDate(a,o,this._getFormatConfig(e)):a,l=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",h=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(H?l:"")+(this._isInRange(e,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(H?"":l)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,p=this._get(e,"showWeek"),c=this._get(e,"dayNames"),d=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),y=this._get(e,"beforeShowDay"),g=this._get(e,"showOtherMonths"),v=this._get(e,"selectOtherMonths"),L=this._getDefaultDate(e),O="",w=0;w<q[0];w++){for(S="",this.maxRows=4,C=0;C<q[1];C++){if(x=this._daylightSavingAdjust(new Date(ee,J,e.selectedDay)),_=" ui-corner-all",E="",Z){if(E+="<div class='ui-datepicker-group",q[1]>1)switch(C){case 0:E+=" ui-datepicker-group-first",_=" ui-corner-"+(H?"right":"left");break;case q[1]-1:E+=" ui-datepicker-group-last",_=" ui-corner-"+(H?"left":"right");break;default:E+=" ui-datepicker-group-middle",_=""}E+="'>"}for(E+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+_+"'>"+(/all|left/.test(_)&&0===w?H?r:n:"")+(/all|right/.test(_)&&0===w?H?n:r:"")+this._generateMonthYearHeader(e,J,ee,K,Q,w>0||C>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead><tr>",N=p?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",b=0;b<7;b++)P=(b+u)%7,N+="<th scope='col'"+((b+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+c[P]+"'>"+d[P]+"</span></th>";for(E+=N+"</tr></thead><tbody>",M=this._getDaysInMonth(ee,J),ee===e.selectedYear&&J===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,M)),T=(this._getFirstDayOfMonth(ee,J)-u+7)%7,k=Math.ceil((T+M)/7),A=Z&&this.maxRows>k?this.maxRows:k,this.maxRows=A,F=this._daylightSavingAdjust(new Date(ee,J,1-T)),D=0;D<A;D++){for(E+="<tr>",I=p?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(F)+"</td>":"",b=0;b<7;b++)R=y?y.apply(e.input?e.input[0]:null,[F]):[!0,""],U=(z=F.getMonth()!==J)&&!v||!R[0]||K&&F<K||Q&&F>Q,I+="<td class='"+((b+u+6)%7>=5?" ui-datepicker-week-end":"")+(z?" ui-datepicker-other-month":"")+(F.getTime()===x.getTime()&&J===e.selectedMonth&&e._keyEvent||L.getTime()===F.getTime()&&L.getTime()===x.getTime()?" "+this._dayOverClass:"")+(U?" "+this._unselectableClass+" ui-state-disabled":"")+(z&&!g?"":" "+R[1]+(F.getTime()===$.getTime()?" "+this._currentClass:"")+(F.getTime()===G.getTime()?" ui-datepicker-today":""))+"'"+(z&&!g||!R[2]?"":" title='"+R[2].replace(/'/g,"&#39;")+"'")+(U?"":" data-handler='selectDay' data-event='click' data-month='"+F.getMonth()+"' data-year='"+F.getFullYear()+"'")+">"+(z&&!g?"&#xa0;":U?"<span class='ui-state-default'>"+F.getDate()+"</span>":"<a class='ui-state-default"+(F.getTime()===G.getTime()?" ui-state-highlight":"")+(F.getTime()===$.getTime()?" ui-state-active":"")+(z?" ui-priority-secondary":"")+"' href='#'>"+F.getDate()+"</a>")+"</td>",F.setDate(F.getDate()+1),F=this._daylightSavingAdjust(F);E+=I+"</tr>"}++J>11&&(J=0,ee++),S+=E+="</tbody></table>"+(Z?"</div>"+(q[0]>0&&C===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}O+=S}return O+=h,e._keyEvent=!1,O},_generateMonthYearHeader:function(e,t,i,n,s,r,a,o){var l,h,u,p,c,d,f,m,y=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),v=this._get(e,"showMonthAfterYear"),L="<div class='ui-datepicker-title'>",O="";if(r||!y)O+="<span class='ui-datepicker-month'>"+a[t]+"</span>";else{for(l=n&&n.getFullYear()===i,h=s&&s.getFullYear()===i,O+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;u<12;u++)(!l||u>=n.getMonth())&&(!h||u<=s.getMonth())&&(O+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+o[u]+"</option>");O+="</select>"}if(v||(L+=O+(!r&&y&&g?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",r||!g)L+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(p=this._get(e,"yearRange").split(":"),c=(new Date).getFullYear(),f=(d=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?c+parseInt(e,10):parseInt(e,10);return isNaN(t)?c:t})(p[0]),m=Math.max(f,d(p[1]||"")),f=n?Math.max(f,n.getFullYear()):f,m=s?Math.min(m,s.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";f<=m;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",L+=e.yearshtml,e.yearshtml=null}return L+=this._get(e,"yearSuffix"),v&&(L+=(!r&&y&&g?"":"&#xa0;")+O),L+="</div>"},_adjustInstDate:function(e,t,i){var n=e.selectedYear+("Y"===i?t:0),s=e.selectedMonth+("M"===i?t:0),r=Math.min(e.selectedDay,this._getDaysInMonth(n,s))+("D"===i?t:0),a=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(n,s,r)));e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),s=i&&t<i?i:t;return n&&s>n?n:s},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,n){var s=this._getNumberOfMonths(e),r=this._daylightSavingAdjust(new Date(i,n+(t<0?t:s[0]*s[1]),1));return t<0&&r.setDate(this._getDaysInMonth(r.getFullYear(),r.getMonth())),this._isInRange(e,r)},_isInRange:function(e,t){var i,n,s=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),a=null,o=null,l=this._get(e,"yearRange");return l&&(i=l.split(":"),n=(new Date).getFullYear(),a=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=n),i[1].match(/[+\-].*/)&&(o+=n)),(!s||t.getTime()>=s.getTime())&&(!r||t.getTime()<=r.getTime())&&(!a||t.getFullYear()>=a)&&(!o||t.getFullYear()<=o)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,n){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var s=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(n,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),s,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).on("mousedown",e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new n,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.12.1";e.datepicker;e.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;i<0&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(e=t.parent.children().eq(t.index)).length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||e.ui.safeBlur(e.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,i){var n=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),r=Math.max.apply(null,s);return r>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",r+1),n=!0),n&&!i&&this._trigger("focus",t),n},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=e(e.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).trigger("focus")},_keepFocus:function(t){function i(){var t=e.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||e.contains(this.uiDialog[0],t)||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),n=i.filter(":first"),s=i.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==n[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){n.trigger("focus")}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:e("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title?e.text(this.options.title):e.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(e.each(i,function(i,n){var s,r;n=e.isFunction(n)?{click:n,text:i}:n,n=e.extend({type:"button"},n),s=n.click,r={icon:n.icon,iconPosition:n.iconPosition,showLabel:n.showLabel,icons:n.icons,text:n.text},delete n.click,delete n.icon,delete n.iconPosition,delete n.showLabel,delete n.icons,"boolean"==typeof n.text&&delete n.text,e("<button></button>",n).button(r).appendTo(t.uiButtonSet).on("click",function(){s.apply(t.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,s){i._addClass(e(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",n,t(s))},drag:function(e,n){i._trigger("drag",e,t(n))},stop:function(s,r){var a=r.offset.left-i.document.scrollLeft(),o=r.offset.top-i.document.scrollTop();n.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(o>=0?"+":"")+o,of:i.window},i._removeClass(e(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,t(r))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,n=this.options,s=n.resizable,r=this.uiDialog.css("position"),a="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:a,start:function(n,s){i._addClass(e(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",n,t(s))},resize:function(e,n){i._trigger("resize",e,t(n))},stop:function(s,r){var a=i.uiDialog.offset(),o=a.left-i.document.scrollLeft(),l=a.top-i.document.scrollTop();n.height=i.uiDialog.height(),n.width=i.uiDialog.width(),n.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" top"+(l>=0?"+":"")+l,of:i.window},i._removeClass(e(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,t(r))}}).css("position",r)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),i=e.inArray(this,t);-1!==i&&t.splice(i,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var i=this,n=!1,s={};e.each(t,function(e,t){i._setOption(e,t),e in i.sizeRelatedOptions&&(n=!0),e in i.resizableRelatedOptions&&(s[e]=t)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,i){var n,s,r=this.uiDialog;"disabled"!==t&&(this._super(t,i),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:e("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&((n=r.is(":data(ui-draggable)"))&&!i&&r.draggable("destroy"),!n&&i&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((s=r.is(":data(ui-resizable)"))&&!i&&r.resizable("destroy"),s&&"string"==typeof i&&r.resizable("option","handles",i),s||!1===i||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),t=Math.max(0,n.minHeight-e),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-e):"none","auto"===n.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!e(t.target).closest(".ui-dialog").length||!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!1!==e.uiBackCompat&&e.widget("ui.dialog",e.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(e,t){"dialogClass"===e&&this.uiDialog.removeClass(this.options.dialogClass).addClass(t),this._superApply(arguments)}});e.ui.dialog,e.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=e("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(e){if(void 0===e)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=!1===e,"number"!=typeof e&&(e=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectmenu",[e.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=e()},_drawButton:function(){var t,i=this,n=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=e("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(n).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(e,i){e.preventDefault(),t._setSelection(),t._select(i.item.data("ui-selectmenu-item"),e)},focus:function(e,i){var n=i.item.data("ui-selectmenu-item");null!=t.focusIndex&&n.index!==t.focusIndex&&(t._trigger("focus",e,{item:n}),t.isOpen||t._select(n,e)),t.focusIndex=n.index,t.button.attr("aria-activedescendant",t.menuItems.eq(n.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var e,t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e)))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var i=e("<span>");return this._setText(i,t.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(t,i){var n=this,s="";e.each(i,function(i,r){var a;r.optgroup!==s&&(a=e("<li>",{text:r.optgroup}),n._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(r.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(t),s=r.optgroup),n._renderItemData(t,r)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,i){var n=e("<li>"),s=e("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(n,null,"ui-state-disabled"),this._setText(s,i.label),n.append(s).appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var i,n,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),(n="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](s).eq(-1):i[e+"All"](s).eq(0)).length&&this.menuInstance.focus(t,n)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?((e=window.getSelection()).removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+e.ui.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection()).rangeCount&&(this.range=e.getRangeAt(0)):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var i=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),i=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),i=!1}i&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex).parent("li");t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(e)),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){if("icons"===e){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,t.button)}this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"width"===e&&this._resizeButton()},_setOptionDisabled:function(e){this._super(e),this.menuInstance.option("disabled",e),this.button.attr("aria-disabled",e),this._toggleClass(this.button,null,"ui-state-disabled",e),this.element.prop("disabled",e),e?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;!1!==e?(null===e&&(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var e=this._super();return e.disabled=this.element.prop("disabled"),e},_parseOptions:function(t){var i=this,n=[];t.each(function(t,s){n.push(i._parseOption(e(s),t))}),this.items=n},_parseOption:function(e,t){var i=e.parent("optgroup");return{element:e,index:t,value:e.val(),label:e.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||e.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),e.widget("ui.slider",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,n=this.options,s=this.element.find(".ui-slider-handle"),r=[];for(i=n.values&&n.values.length||1,s.length>i&&(s.slice(i).remove(),s=s.slice(0,i)),t=s.length;t<i;t++)r.push("<span tabindex='0'></span>");this.handles=s.add(e(r.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=e("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var i,n,s,r,a,o,l,h=this,u=this.options;return!u.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(i),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(n-h.values(t));(s>i||s===i&&(t===h._lastChangedValue||h.values(t)===u.min))&&(s=i,r=e(this),a=t)}),!1!==this._start(t,a)&&(this._mouseSliding=!0,this._handleIndex=a,this._addClass(r,null,"ui-state-active"),r.trigger("focus"),o=r.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-o.left-r.width()/2,top:t.pageY-o.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,a,n),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,n,s,r;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),(n=i/t)>1&&(n=1),n<0&&(n=0),"vertical"===this.orientation&&(n=1-n),s=this._valueMax()-this._valueMin(),r=this._valueMin()+n*s,this._trimAlignValue(r)},_uiHash:function(e,t,i){var n={handle:this.handles[e],handleIndex:e,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(n.value=void 0!==t?t:this.values(e),n.values=i||this.values()),n},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,i){var n,s=this.value(),r=this.values();this._hasMultipleValues()&&(n=this.values(t?0:1),s=this.values(t),2===this.options.values.length&&!0===this.options.range&&(i=0===t?Math.min(n,i):Math.max(n,i)),r[t]=i),i!==s&&!1!==this._trigger("slide",e,this._uiHash(t,i,r))&&(this._hasMultipleValues()?this.values(t,i):this.value(i))},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",e,this._uiHash(t)))},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,i){var n,s,r;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this._hasMultipleValues()?this._values(t):this.value();for(n=this.options.values,s=arguments[0],r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(s[r]),this._change(null,r);this._refreshValue()},_setOption:function(t,i){var n,s=0;switch("range"===t&&!0===this.options.range&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(s=this.options.values.length),this._super(t,i),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),n=s-1;n>=0;n--)this._change(null,n);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(e){this._super(e),this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,n;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(i=this.options.values.slice(),n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(i[n]);return i}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,n=e-i;return 2*Math.abs(i)>=t&&(n+=i>0?t:-t),parseFloat(n.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step;(e=Math.round((e-t)/i)*i+t)>this.options.max&&(e-=i),this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),i=t.indexOf(".");return-1===i?0:t.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){"vertical"===e&&this.range.css({width:"",left:""}),"horizontal"===e&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var t,i,n,s,r,a=this.options.range,o=this.options,l=this,h=!this._animateOff&&o.animate,u={};this._hasMultipleValues()?this.handles.each(function(n){i=(l.values(n)-l._valueMin())/(l._valueMax()-l._valueMin())*100,u["horizontal"===l.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[h?"animate":"css"](u,o.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===n&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},o.animate),1===n&&l.range[h?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:o.animate})):(0===n&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},o.animate),1===n&&l.range[h?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:o.animate}))),t=i}):(n=this.value(),s=this._valueMin(),r=this._valueMax(),i=r!==s?(n-s)/(r-s)*100:0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,o.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},o.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},o.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},o.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},o.animate))},_handleEvents:{keydown:function(t){var i,n,s,r=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(e(t.target),null,"ui-state-active"),!1===this._start(t,r)))return}switch(s=this.options.step,i=n=this._hasMultipleValues()?this.values(r):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;n=this._trimAlignValue(i+s);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;n=this._trimAlignValue(i-s)}this._slide(t,r,n)},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),this._removeClass(e(t.target),null,"ui-state-active"))}}});e.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t=this._super(),i=this.element;return e.each(["min","max","step"],function(e,n){var s=i.attr(n);null!=s&&s.length&&(t[n]=s)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e))},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){this.element[0]===e.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===e.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(e(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var i=this.options,n=e.ui.keyCode;switch(t.keyCode){case n.UP:return this._repeat(null,1,t),!0;case n.DOWN:return this._repeat(null,-1,t),!0;case n.PAGE_UP:return this._repeat(null,i.page,t),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_start:function(e){return!(!this.spinning&&!1===this._trigger("start",e))&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",t,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,n=this.options;return t=null!==n.min?n.min:0,i=e-t,i=Math.round(i/n.step)*n.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==n.max&&e>n.max?n.max:null!==n.min&&e<n.min?n.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){var i,n,s;if("culture"===e||"numberFormat"===e)return i=this._parse(this.element.val()),this.options[e]=t,void this.element.val(this._format(i));"max"!==e&&"min"!==e&&"step"!==e||"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(n=this.buttons.first().find(".ui-icon"),this._removeClass(n,null,this.options.icons.up),this._addClass(n,null,t.up),s=this.buttons.last().find(".ui-icon"),this._removeClass(s,null,this.options.icons.down),this._addClass(s,null,t.down)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!e),this.element.prop("disabled",!!e),this.buttons.button(e?"disable":"enable")},_setOptions:o(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null!==e&&e===this._adjustValue(e)},_value:function(e,t){var i;""!==e&&null!==(i=this._parse(e))&&(t||(i=this._adjustValue(i)),e=this._format(i)),this.element.val(e),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:o(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:o(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:o(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:o(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());o(this._value).call(this,e)},widget:function(){return this.uiSpinner}}),!1!==e.uiBackCompat&&e.widget("ui.spinner",e.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});e.ui.spinner;e.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,n;i=t.href.replace(e,""),n=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(e){}try{n=decodeURIComponent(n)}catch(e){}return t.hash.length>1&&i===n}}(),_create:function(){var t=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(i.active):this.active=e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===t&&(n&&this.tabs.each(function(i,s){if(e(s).attr("aria-controls")===n)return t=i,!1}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==t&&-1!==t||(t=!!this.tabs.length&&0)),!1!==t&&-1===(t=this.tabs.index(this.tabs.eq(t)))&&(t=!i&&0),!i&&!1===t&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(e.ui.safeActiveElement(this.document[0])).closest("li"),n=this.tabs.index(i),s=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:n++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:s=!1,n--;break;case e.ui.keyCode.END:n=this.anchors.length-1;break;case e.ui.keyCode.HOME:n=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n);case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n!==this.options.active&&n);default:return}t.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,s),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){for(var n=this.tabs.length-1;-1!==e.inArray(function(){return t>n&&(t=0),t<0&&(t=n),t}(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).trigger("focus"),e},_setOption:function(e,t){"active"!==e?(this._super(e,t),"collapsible"===e&&(this._toggleClass("ui-tabs-collapsible",null,t),t||!1!==this.options.active||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t)):this._activate(t)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,n=this.anchors,s=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=e(),this.anchors.each(function(i,n){var s,r,a,o=e(n).uniqueId().attr("id"),l=e(n).closest("li"),h=l.attr("aria-controls");t._isLocal(n)?(a=(s=n.hash).substring(1),r=t.element.find(t._sanitizeSelector(s))):(s="#"+(a=l.attr("aria-controls")||e({}).uniqueId()[0].id),(r=t.element.find(s)).length||(r=t._createPanel(a)).insertAfter(t.panels[i-1]||t.tablist),r.attr("aria-live","polite")),r.length&&(t.panels=t.panels.add(r)),h&&l.data("ui-tabs-aria-controls",h),l.attr({"aria-controls":a,"aria-labelledby":o}),r.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(n.not(this.anchors)),this._off(s.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var i,n,s;for(e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),s=0;n=this.tabs[s];s++)i=e(n),!0===t||-1!==e.inArray(s,t)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,n=this.element.parent();"fill"===t?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,n=this.active,s=e(t.currentTarget).closest("li"),r=s[0]===n[0],a=r&&i.collapsible,o=a?e():this._getPanelForTab(s),l=n.length?this._getPanelForTab(n):e(),h={oldTab:n,oldPanel:l,newTab:a?e():s,newPanel:o};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||r&&!i.collapsible||!1===this._trigger("beforeActivate",t,h)||(i.active=!a&&this.tabs.index(s),this.active=r?e():s,this.xhr&&this.xhr.abort(),l.length||o.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),o.length&&this.load(this.tabs.index(s),t),this._toggle(t,h))},_toggle:function(t,i){function n(){r.running=!1,r._trigger("activate",t,i)}function s(){r._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&r.options.show?r._show(a,r.options.show,n):(a.show(),n())}var r=this,a=i.newPanel,o=i.oldPanel;this.running=!0,o.length&&this.options.hide?this._hide(o,this.options.hide,function(){r._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),s()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),o.hide(),s()),o.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&o.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,n=this._findActive(t);n[0]!==this.active[0]&&(n.length||(n=this.active),i=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return!1===t?e():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+e.ui.escapeSelector(t)+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;!1!==i&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setOptionDisabled(i))},disable:function(t){var i=this.options.disabled;if(!0!==i){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setOptionDisabled(i)}},load:function(t,i){t=this._getIndex(t);var n=this,s=this.tabs.eq(t),r=s.find(".ui-tabs-anchor"),a=this._getPanelForTab(s),o={tab:s,panel:a},l=function(e,t){"abort"===t&&n.panels.stop(!1,!0),n._removeClass(s,"ui-tabs-loading"),a.removeAttr("aria-busy"),e===n.xhr&&delete n.xhr};this._isLocal(r[0])||(this.xhr=e.ajax(this._ajaxSettings(r,i,o)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(s,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(e,t,s){setTimeout(function(){a.html(e),n._trigger("load",i,o),l(s,t)},1)}).fail(function(e,t){setTimeout(function(){l(e,t)},1)})))},_ajaxSettings:function(t,i,n){var s=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,r){return s._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:r},n))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),!1!==e.uiBackCompat&&e.widget("ui.tabs",e.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});e.ui.tabs;e.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var n=(t.attr("aria-describedby")||"").split(/\s+/);n.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(n.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),n=(t.attr("aria-describedby")||"").split(/\s+/),s=e.inArray(i,n);-1!==s&&n.splice(s,1),t.removeData("ui-tooltip-id"),(n=e.trim(n.join(" ")))?t.attr("aria-describedby",n):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=e([])},_setOption:function(t,i){var n=this;this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){n._updateContent(t.element)})},_setOptionDisabled:function(e){this[e?"_disable":"_enable"]()},_disable:function(){var t=this;e.each(this.tooltips,function(i,n){var s=e.Event("blur");s.target=s.currentTarget=n.element[0],t.close(s,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=e(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=e([])},open:function(t){var i=this,n=e(t?t.target:this.element).closest(this.options.items);n.length&&!n.data("ui-tooltip-id")&&(n.attr("title")&&n.data("ui-tooltip-title",n.attr("title")),n.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&n.parents().each(function(){var t,n=e(this);n.data("ui-tooltip-open")&&((t=e.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),n.attr("title")&&(n.uniqueId(),i.parents[this.id]={element:this,title:n.attr("title")},n.attr("title",""))}),this._registerCloseHandlers(t,n),this._updateContent(n,t))},_updateContent:function(e,t){var i,n=this.options.content,s=this,r=t?t.type:null;if("string"==typeof n||n.nodeType||n.jquery)return this._open(t,e,n);(i=n.call(e[0],function(i){s._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=r),this._open(t,e,i))})}))&&this._open(t,e,i)},_open:function(t,i,n){function s(e){h.of=e,a.is(":hidden")||a.position(h)}var r,a,o,l,h=e.extend({},this.options.position);n&&((r=this._find(i))?r.tooltip.find(".ui-tooltip-content").html(n):(i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),r=this._tooltip(i),a=r.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.liveRegion.children().hide(),(l=e("<div>").html(a.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),l.removeAttr("id").find("[id]").removeAttr("id"),l.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:s}),s(t)):a.position(e.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){a.is(":visible")&&(s(h.of),clearInterval(o))},e.fx.interval)),this._trigger("open",t,{tooltip:a})))},_registerCloseHandlers:function(t,i){var n={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=i[0],this.close(n,!0)}}};i[0]!==this.element[0]&&(n.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(n.mouseleave="close"),t&&"focusin"!==t.type||(n.focusout="close"),this._on(!0,i,n)},close:function(t){var i,n=this,s=e(t?t.currentTarget:this.element),r=this._find(s);r?(i=r.tooltip,r.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),r.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){n._removeTooltip(e(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete n.parents[t]}),r.closing=!0,this._trigger("close",t,{tooltip:i}),r.hiding||(r.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var i=e("<div>").attr("role","tooltip"),n=e("<div>").appendTo(i),s=i.uniqueId().attr("id");return this._addClass(n,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:i}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_appendTo:function(e){var t=e.closest(".ui-front, dialog");return t.length||(t=this.document[0].body),t},_destroy:function(){var t=this;e.each(this.tooltips,function(i,n){var s=e.Event("blur"),r=n.element;s.target=s.currentTarget=r[0],t.close(s,!0),e("#"+i).remove(),r.data("ui-tooltip-title")&&(r.attr("title")||r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==e.uiBackCompat&&e.widget("ui.tooltip",e.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var e=this._superApply(arguments);return this.options.tooltipClass&&e.tooltip.addClass(this.options.tooltipClass),e}});e.ui.tooltip;var f="ui-effects-animated",m=e;e.effects={effect:{}},function(e,t){function i(e,t,i){var n=u[t.type]||{};return null==e?i||!t.def?null:t.def:(e=n.floor?~~e:parseFloat(e),isNaN(e)?t.def:n.mod?(e+n.mod)%n.mod:0>e?0:n.max<e?n.max:e)}function n(t){var i=l(),n=i._rgba=[];return t=t.toLowerCase(),d(o,function(e,s){var r,a=s.re.exec(t),o=a&&s.parse(a),l=s.space||"rgba";if(o)return r=i[l](o),i[h[l].cache]=r[h[l].cache],n=i._rgba=r._rgba,!1}),n.length?("0,0,0,0"===n.join()&&e.extend(n,r.transparent),i):r[t]}function s(e,t,i){return i=(i+1)%1,6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}var r,a=/^([\-+])=\s*(\d+\.?\d*)/,o=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,n,s){return new e.Color.fn.parse(t,i,n,s)},h={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},p=l.support={},c=e("<p>")[0],d=e.each;c.style.cssText="background-color:rgba(1,1,1,.5)",p.rgba=c.style.backgroundColor.indexOf("rgba")>-1,d(h,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(t,s,a,o){if(void 0===t)return this._rgba=[null,null,null,null],this;(t.jquery||t.nodeType)&&(t=e(t).css(s),s=void 0);var u=this,p=e.type(t),c=this._rgba=[];return void 0!==s&&(t=[t,s,a,o],p="array"),"string"===p?this.parse(n(t)||r._default):"array"===p?(d(h.rgba.props,function(e,n){c[n.idx]=i(t[n.idx],n)}),this):"object"===p?(t instanceof l?d(h,function(e,i){t[i.cache]&&(u[i.cache]=t[i.cache].slice())}):d(h,function(n,s){var r=s.cache;d(s.props,function(e,n){if(!u[r]&&s.to){if("alpha"===e||null==t[e])return;u[r]=s.to(u._rgba)}u[r][n.idx]=i(t[e],n,!0)}),u[r]&&e.inArray(null,u[r].slice(0,3))<0&&(u[r][3]=1,s.from&&(u._rgba=s.from(u[r])))}),this):void 0},is:function(e){var t=l(e),i=!0,n=this;return d(h,function(e,s){var r,a=t[s.cache];return a&&(r=n[s.cache]||s.to&&s.to(n._rgba)||[],d(s.props,function(e,t){if(null!=a[t.idx])return i=a[t.idx]===r[t.idx]})),i}),i},_space:function(){var e=[],t=this;return d(h,function(i,n){t[n.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var n=l(e),s=n._space(),r=h[s],a=0===this.alpha()?l("transparent"):this,o=a[r.cache]||r.to(a._rgba),p=o.slice();return n=n[r.cache],d(r.props,function(e,s){var r=s.idx,a=o[r],l=n[r],h=u[s.type]||{};null!==l&&(null===a?p[r]=l:(h.mod&&(l-a>h.mod/2?a+=h.mod:a-l>h.mod/2&&(a-=h.mod)),p[r]=i((l-a)*t+a,s)))}),this[s](p)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),s=l(t)._rgba;return l(e.map(i,function(e,t){return(1-n)*s[t]+n*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&t<3&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),n=i.pop();return t&&i.push(~~(255*n)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,h.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,n=e[0]/255,s=e[1]/255,r=e[2]/255,a=e[3],o=Math.max(n,s,r),l=Math.min(n,s,r),h=o-l,u=o+l,p=.5*u;return t=l===o?0:n===o?60*(s-r)/h+360:s===o?60*(r-n)/h+120:60*(n-s)/h+240,i=0===h?0:p<=.5?h/u:h/(2-u),[Math.round(t)%360,i,p,null==a?1:a]},h.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],n=e[2],r=e[3],a=n<=.5?n*(1+i):n+i-n*i,o=2*n-a;return[Math.round(255*s(o,a,t+1/3)),Math.round(255*s(o,a,t)),Math.round(255*s(o,a,t-1/3)),r]},d(h,function(t,n){var s=n.props,r=n.cache,o=n.to,h=n.from;l.fn[t]=function(t){if(o&&!this[r]&&(this[r]=o(this._rgba)),void 0===t)return this[r].slice();var n,a=e.type(t),u="array"===a||"object"===a?t:arguments,p=this[r].slice();return d(s,function(e,t){var n=u["object"===a?e:t.idx];null==n&&(n=p[t.idx]),p[t.idx]=i(n,t)}),h?(n=l(h(p)),n[r]=p,n):l(p)},d(s,function(i,n){l.fn[i]||(l.fn[i]=function(s){var r,o=e.type(s),l="alpha"===i?this._hsla?"hsla":"rgba":t,h=this[l](),u=h[n.idx];return"undefined"===o?u:("function"===o&&(s=s.call(this,u),o=e.type(s)),null==s&&n.empty?this:("string"===o&&(r=a.exec(s))&&(s=u+parseFloat(r[2])*("+"===r[1]?1:-1)),h[n.idx]=s,this[l](h)))})})}),l.hook=function(t){var i=t.split(" ");d(i,function(t,i){e.cssHooks[i]={set:function(t,s){var r,a,o="";if("transparent"!==s&&("string"!==e.type(s)||(r=n(s)))){if(s=l(r||s),!p.rgba&&1!==s._rgba[3]){for(a="backgroundColor"===i?t.parentNode:t;(""===o||"transparent"===o)&&a&&a.style;)try{o=e.css(a,"backgroundColor"),a=a.parentNode}catch(e){}s=s.blend(o&&"transparent"!==o?o:"_default")}s=s.toRgbaString()}try{t.style[i]=s}catch(e){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),e.cssHooks.borderColor={expand:function(e){var t={};return d(["Top","Right","Bottom","Left"],function(i,n){t["border"+n+"Color"]=e}),t}},r=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(m),function(){function t(t){var i,n,s=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,r={};if(s&&s.length&&s[0]&&s[s[0]])for(n=s.length;n--;)"string"==typeof s[i=s[n]]&&(r[e.camelCase(i)]=s[i]);else for(i in s)"string"==typeof s[i]&&(r[i]=s[i]);return r}function i(t,i){var n,r,a={};for(n in i)r=i[n],t[n]!==r&&(s[n]||!e.fx.step[n]&&isNaN(parseFloat(r))||(a[n]=r));return a}var n=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(m.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(s,r,a,o){var l=e.speed(r,a,o);return this.queue(function(){var r,a=e(this),o=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){return{el:e(this),start:t(this)}}),(r=function(){e.each(n,function(e,t){s[t]&&a[t+"Class"](s[t])})})(),h=h.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",o),h=h.map(function(){var t=this,i=e.Deferred(),n=e.extend({},l,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,n),i.promise()}),e.when.apply(e,h.get()).done(function(){r(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),l.complete.call(a[0])})})},e.fn.extend({addClass:function(t){return function(i,n,s,r){return n?e.effects.animateClass.call(this,{add:i},n,s,r):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,n,s,r){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},n,s,r):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,n,s,r,a){return"boolean"==typeof n||void 0===n?s?e.effects.animateClass.call(this,n?{add:i}:{remove:i},s,r,a):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},n,s,r)}}(e.fn.toggleClass),switchClass:function(t,i,n,s,r){return e.effects.animateClass.call(this,{add:i,remove:t},n,s,r)}})}(),function(){function t(t,i,n,s){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(s=i,n=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(s=n,n=i,i={}),e.isFunction(n)&&(s=n,n=null),i&&e.extend(t,i),n=n||i.duration,t.duration=e.fx.off?0:"number"==typeof n?n:n in e.fx.speeds?e.fx.speeds[n]:e.fx.speeds._default,t.complete=s||i.complete,t}function i(t){return!(t&&"number"!=typeof t&&!e.fx.speeds[t])||("string"==typeof t&&!e.effects.effect[t]||(!!e.isFunction(t)||"object"==typeof t&&!t.effect))}function n(e,t){var i=t.outerWidth(),n=t.outerHeight(),s=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(e)||["",0,i,n,0];return{top:parseFloat(s[1])||0,right:"auto"===s[2]?i:parseFloat(s[2]),bottom:"auto"===s[3]?n:parseFloat(s[3]),left:parseFloat(s[4])||0}}e.expr&&e.expr.filters&&e.expr.filters.animated&&(e.expr.filters.animated=function(t){return function(i){return!!e(i).data(f)||t(i)}}(e.expr.filters.animated)),!1!==e.uiBackCompat&&e.extend(e.effects,{save:function(e,t){for(var i=0,n=t.length;i<n;i++)null!==t[i]&&e.data("ui-effects-"+t[i],e[0].style[t[i]])},restore:function(e,t){for(var i,n=0,s=t.length;n<s;n++)null!==t[n]&&(i=e.data("ui-effects-"+t[n]),e.css(t[n],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),float:t.css("float")},n=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),s={width:t.width(),height:t.height()},r=document.activeElement;try{r.id}catch(e){r=document.body}return t.wrap(n),(t[0]===r||e.contains(t[0],r))&&e(r).trigger("focus"),n=t.parent(),"static"===t.css("position")?(n.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,n){i[n]=t.css(n),isNaN(parseInt(i[n],10))&&(i[n]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(s),n.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).trigger("focus")),t}}),e.extend(e.effects,{version:"1.12.1",define:function(t,i,n){return n||(n=i,i="effect"),e.effects.effect[t]=n,e.effects.effect[t].mode=i,n},scaledDimensions:function(e,t,i){if(0===t)return{height:0,width:0,outerHeight:0,outerWidth:0};var n="horizontal"!==i?(t||100)/100:1,s="vertical"!==i?(t||100)/100:1;return{height:e.height()*s,width:e.width()*n,outerHeight:e.outerHeight()*s,outerWidth:e.outerWidth()*n}},clipToBox:function(e){return{width:e.clip.right-e.clip.left,height:e.clip.bottom-e.clip.top,left:e.clip.left,top:e.clip.top}},unshift:function(e,t,i){var n=e.queue();t>1&&n.splice.apply(n,[1,0].concat(n.splice(t,i))),e.dequeue()},saveStyle:function(e){e.data("ui-effects-style",e[0].style.cssText)},restoreStyle:function(e){e[0].style.cssText=e.data("ui-effects-style")||"",e.removeData("ui-effects-style")},mode:function(e,t){var i=e.is(":hidden");return"toggle"===t&&(t=i?"show":"hide"),(i?"hide"===t:"show"===t)&&(t="none"),t},getBaseline:function(e,t){var i,n;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=e[1]/t.width}return{x:n,y:i}},createPlaceholder:function(t){var i,n=t.css("position"),s=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",i=e("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data("ui-effects-placeholder",i)),t.css({position:n,left:s.left,top:s.top}),i},removePlaceholder:function(e){var t="ui-effects-placeholder",i=e.data(t);i&&(i.remove(),e.removeData(t))},cleanUp:function(t){e.effects.restoreStyle(t),e.effects.removePlaceholder(t)},setTransition:function(t,i,n,s){return s=s||{},e.each(i,function(e,i){var r=t.cssUnit(i);r[0]>0&&(s[i]=r[0]*n+r[1])}),s}}),e.fn.extend({effect:function(){function i(t){function i(){o.removeData(f),e.effects.cleanUp(o),"hide"===n.mode&&o.hide(),a()}function a(){e.isFunction(l)&&l.call(o[0]),e.isFunction(t)&&t()}var o=e(this);n.mode=u.shift(),!1===e.uiBackCompat||r?"none"===n.mode?(o[h](),a()):s.call(o[0],n,i):(o.is(":hidden")?"hide"===h:"show"===h)?(o[h](),a()):s.call(o[0],n,a)}var n=t.apply(this,arguments),s=e.effects.effect[n.effect],r=s.mode,a=n.queue,o=a||"fx",l=n.complete,h=n.mode,u=[],p=function(t){var i=e(this),n=e.effects.mode(i,h)||r;i.data(f,!0),u.push(n),r&&("show"===n||n===r&&"hide"===n)&&i.show(),r&&"none"===n||e.effects.saveStyle(i),e.isFunction(t)&&t()};return e.fx.off||!s?h?this[h](n.duration,l):this.each(function(){l&&l.call(this)}):!1===a?this.each(p).each(i):this.queue(o,p).queue(o,i)},show:function(e){return function(n){if(i(n))return e.apply(this,arguments);var s=t.apply(this,arguments);return s.mode="show",this.effect.call(this,s)}}(e.fn.show),hide:function(e){return function(n){if(i(n))return e.apply(this,arguments);var s=t.apply(this,arguments);return s.mode="hide",this.effect.call(this,s)}}(e.fn.hide),toggle:function(e){return function(n){if(i(n)||"boolean"==typeof n)return e.apply(this,arguments);var s=t.apply(this,arguments);return s.mode="toggle",this.effect.call(this,s)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),n=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(n=[parseFloat(i),t])}),n},cssClip:function(e){return e?this.css("clip","rect("+e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px)"):n(this.css("clip"),this)},transfer:function(t,i){var n=e(this),s=e(t.to),r="fixed"===s.css("position"),a=e("body"),o=r?a.scrollTop():0,l=r?a.scrollLeft():0,h=s.offset(),u={top:h.top-o,left:h.left-l,height:s.innerHeight(),width:s.innerWidth()},p=n.offset(),c=e("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(t.className).css({top:p.top-o,left:p.left-l,height:n.innerHeight(),width:n.innerWidth(),position:r?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){c.remove(),e.isFunction(i)&&i()})}}),e.fx.step.clip=function(t){t.clipInit||(t.start=e(t.elem).cssClip(),"string"==typeof t.end&&(t.end=n(t.end,t.elem)),t.clipInit=!0),e(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})}}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;e<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?i(2*e)/2:1-i(-2*e+2)/2}})}();e.effects,e.effects.define("blind","hide",function(t,i){var n={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=e(this),r=t.direction||"up",a=s.cssClip(),o={clip:e.extend({},a)},l=e.effects.createPlaceholder(s);o.clip[n[r][0]]=o.clip[n[r][1]],"show"===t.mode&&(s.cssClip(o.clip),l&&l.css(e.effects.clipToBox(o)),o.clip=a),l&&l.animate(e.effects.clipToBox(o),t.duration,t.easing),s.animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("bounce",function(t,i){var n,s,r,a=e(this),o=t.mode,l="hide"===o,h="show"===o,u=t.direction||"up",p=t.distance,c=t.times||5,d=2*c+(h||l?1:0),f=t.duration/d,m=t.easing,y="up"===u||"down"===u?"top":"left",g="up"===u||"left"===u,v=0,L=a.queue().length;for(e.effects.createPlaceholder(a),r=a.css(y),p||(p=a["top"===y?"outerHeight":"outerWidth"]()/3),h&&((s={opacity:1})[y]=r,a.css("opacity",0).css(y,g?2*-p:2*p).animate(s,f,m)),l&&(p/=Math.pow(2,c-1)),(s={})[y]=r;v<c;v++)(n={})[y]=(g?"-=":"+=")+p,a.animate(n,f,m).animate(s,f,m),p=l?2*p:p/2;l&&((n={opacity:0})[y]=(g?"-=":"+=")+p,a.animate(n,f,m)),a.queue(i),e.effects.unshift(a,L,d+1)}),e.effects.define("clip","hide",function(t,i){var n,s={},r=e(this),a=t.direction||"vertical",o="both"===a,l=o||"horizontal"===a,h=o||"vertical"===a;n=r.cssClip(),s.clip={top:h?(n.bottom-n.top)/2:n.top,right:l?(n.right-n.left)/2:n.right,bottom:h?(n.bottom-n.top)/2:n.bottom,left:l?(n.right-n.left)/2:n.left},e.effects.createPlaceholder(r),"show"===t.mode&&(r.cssClip(s.clip),s.clip=n),r.animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("drop","hide",function(t,i){var n,s=e(this),r="show"===t.mode,a=t.direction||"left",o="up"===a||"down"===a?"top":"left",l="up"===a||"left"===a?"-=":"+=",h="+="===l?"-=":"+=",u={opacity:0};e.effects.createPlaceholder(s),n=t.distance||s["top"===o?"outerHeight":"outerWidth"](!0)/2,u[o]=l+n,r&&(s.css(u),u[o]=h+n,u.opacity=1),s.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("explode","hide",function(t,i){function n(){v.push(this),v.length===p*c&&s()}function s(){d.css({visibility:"visible"}),e(v).remove(),i()}var r,a,o,l,h,u,p=t.pieces?Math.round(Math.sqrt(t.pieces)):3,c=p,d=e(this),f="show"===t.mode,m=d.show().css("visibility","hidden").offset(),y=Math.ceil(d.outerWidth()/c),g=Math.ceil(d.outerHeight()/p),v=[];for(r=0;r<p;r++)for(l=m.top+r*g,u=r-(p-1)/2,a=0;a<c;a++)o=m.left+a*y,h=a-(c-1)/2,d.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*y,top:-r*g}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:y,height:g,left:o+(f?h*y:0),top:l+(f?u*g:0),opacity:f?0:1}).animate({left:o+(f?0:h*y),top:l+(f?0:u*g),opacity:f?1:0},t.duration||500,t.easing,n)}),e.effects.define("fade","toggle",function(t,i){var n="show"===t.mode;e(this).css("opacity",n?0:1).animate({opacity:n?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("fold","hide",function(t,i){var n=e(this),s=t.mode,r="show"===s,a="hide"===s,o=t.size||15,l=/([0-9]+)%/.exec(o),h=!!t.horizFirst?["right","bottom"]:["bottom","right"],u=t.duration/2,p=e.effects.createPlaceholder(n),c=n.cssClip(),d={clip:e.extend({},c)},f={clip:e.extend({},c)},m=[c[h[0]],c[h[1]]],y=n.queue().length;l&&(o=parseInt(l[1],10)/100*m[a?0:1]),d.clip[h[0]]=o,f.clip[h[0]]=o,f.clip[h[1]]=0,r&&(n.cssClip(f.clip),p&&p.css(e.effects.clipToBox(f)),f.clip=c),n.queue(function(i){p&&p.animate(e.effects.clipToBox(d),u,t.easing).animate(e.effects.clipToBox(f),u,t.easing),i()}).animate(d,u,t.easing).animate(f,u,t.easing).queue(i),e.effects.unshift(n,y,4)}),e.effects.define("highlight","show",function(t,i){var n=e(this),s={backgroundColor:n.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),e.effects.saveStyle(n),n.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:i})}),e.effects.define("size",function(t,i){var n,s,r,a=e(this),o=["fontSize"],l=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],u=t.mode,p="effect"!==u,c=t.scale||"both",d=t.origin||["middle","center"],f=a.css("position"),m=a.position(),y=e.effects.scaledDimensions(a),g=t.from||y,v=t.to||e.effects.scaledDimensions(a,0);e.effects.createPlaceholder(a),"show"===u&&(r=g,g=v,v=r),s={from:{y:g.height/y.height,x:g.width/y.width},to:{y:v.height/y.height,x:v.width/y.width}},"box"!==c&&"both"!==c||(s.from.y!==s.to.y&&(g=e.effects.setTransition(a,l,s.from.y,g),v=e.effects.setTransition(a,l,s.to.y,v)),s.from.x!==s.to.x&&(g=e.effects.setTransition(a,h,s.from.x,g),v=e.effects.setTransition(a,h,s.to.x,v))),"content"!==c&&"both"!==c||s.from.y!==s.to.y&&(g=e.effects.setTransition(a,o,s.from.y,g),v=e.effects.setTransition(a,o,s.to.y,v)),d&&(n=e.effects.getBaseline(d,y),g.top=(y.outerHeight-g.outerHeight)*n.y+m.top,g.left=(y.outerWidth-g.outerWidth)*n.x+m.left,v.top=(y.outerHeight-v.outerHeight)*n.y+m.top,v.left=(y.outerWidth-v.outerWidth)*n.x+m.left),a.css(g),"content"!==c&&"both"!==c||(l=l.concat(["marginTop","marginBottom"]).concat(o),h=h.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=e(this),n=e.effects.scaledDimensions(i),r={height:n.height*s.from.y,width:n.width*s.from.x,outerHeight:n.outerHeight*s.from.y,outerWidth:n.outerWidth*s.from.x},a={height:n.height*s.to.y,width:n.width*s.to.x,outerHeight:n.height*s.to.y,outerWidth:n.width*s.to.x};s.from.y!==s.to.y&&(r=e.effects.setTransition(i,l,s.from.y,r),a=e.effects.setTransition(i,l,s.to.y,a)),s.from.x!==s.to.x&&(r=e.effects.setTransition(i,h,s.from.x,r),a=e.effects.setTransition(i,h,s.to.x,a)),p&&e.effects.saveStyle(i),i.css(r),i.animate(a,t.duration,t.easing,function(){p&&e.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){var t=a.offset();0===v.opacity&&a.css("opacity",g.opacity),p||(a.css("position","static"===f?"relative":f).offset(t),e.effects.saveStyle(a)),i()}})}),e.effects.define("scale",function(t,i){var n=e(this),s=t.mode,r=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"effect"!==s?0:100),a=e.extend(!0,{from:e.effects.scaledDimensions(n),to:e.effects.scaledDimensions(n,r,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(a.from.opacity=1,a.to.opacity=0),e.effects.effect.size.call(this,a,i)}),e.effects.define("puff","hide",function(t,i){var n=e.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});e.effects.effect.scale.call(this,n,i)}),e.effects.define("pulsate","show",function(t,i){var n=e(this),s=t.mode,r="show"===s,a="hide"===s,o=r||a,l=2*(t.times||5)+(o?1:0),h=t.duration/l,u=0,p=1,c=n.queue().length;for(!r&&n.is(":visible")||(n.css("opacity",0).show(),u=1);p<l;p++)n.animate({opacity:u},h,t.easing),u=1-u;n.animate({opacity:u},h,t.easing),n.queue(i),e.effects.unshift(n,c,l+1)}),e.effects.define("shake",function(t,i){var n=1,s=e(this),r=t.direction||"left",a=t.distance||20,o=t.times||3,l=2*o+1,h=Math.round(t.duration/l),u="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,c={},d={},f={},m=s.queue().length;for(e.effects.createPlaceholder(s),c[u]=(p?"-=":"+=")+a,d[u]=(p?"+=":"-=")+2*a,f[u]=(p?"-=":"+=")+2*a,s.animate(c,h,t.easing);n<o;n++)s.animate(d,h,t.easing).animate(f,h,t.easing);s.animate(d,h,t.easing).animate(c,h/2,t.easing).queue(i),e.effects.unshift(s,m,l+1)}),e.effects.define("slide","show",function(t,i){var n,s,r=e(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},o=t.mode,l=t.direction||"left",h="up"===l||"down"===l?"top":"left",u="up"===l||"left"===l,p=t.distance||r["top"===h?"outerHeight":"outerWidth"](!0),c={};e.effects.createPlaceholder(r),n=r.cssClip(),s=r.position()[h],c[h]=(u?-1:1)*p+s,c.clip=r.cssClip(),c.clip[a[l][1]]=c.clip[a[l][0]],"show"===o&&(r.cssClip(c.clip),r.css(h,c[h]),c.clip=n,c[h]=s),r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:i})});!1!==e.uiBackCompat&&e.effects.define("transfer",function(t,i){e(this).transfer(t,i)})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widgets/menu"],e):e(jQuery)}(function(e){"use strict";var t="onselectstart"in document.createElement("div"),i=e.ui.menu.version.match(/^(\d)\.(\d+)/),n={major:parseInt(i[1],10),minor:parseInt(i[2],10)},s=n.major<2&&n.minor<=10,r=n.major<2&&n.minor<=11;e.widget("moogle.contextmenu",{version:"@VERSION",options:{addClass:"ui-contextmenu",closeOnWindowBlur:!0,autoFocus:!1,autoTrigger:!0,delegate:null,hide:{effect:"fadeOut",duration:"fast"},ignoreParentSelect:!0,menu:null,position:null,preventContextMenuForPopup:!1,preventSelect:!1,show:{effect:"slideDown",duration:"fast"},taphold:!1,uiMenuOptions:{},beforeOpen:e.noop,blur:e.noop,close:e.noop,create:e.noop,createMenu:e.noop,focus:e.noop,open:e.noop,select:e.noop},_create:function(){var i,n,s,r=this.options;if(this.$headStyle=null,this.$menu=null,this.menuIsTemp=!1,this.currentTarget=null,this.extraData={},this.previousFocus=null,null==r.delegate&&e.error("ui-contextmenu: Missing required option `delegate`."),r.preventSelect){s=(e(this.element).is(document)?e("body"):this.element).uniqueId().attr("id"),i="#"+s+" "+r.delegate+" { -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }",this.$headStyle=e("<style class='moogle-contextmenu-style' />").prop("type","text/css").appendTo("head");try{this.$headStyle.html(i)}catch(e){this.$headStyle[0].styleSheet.cssText=i}t&&this.element.on("selectstart"+this.eventNamespace,r.delegate,function(e){e.preventDefault()})}this._createUiMenu(r.menu),n="contextmenu"+this.eventNamespace,r.taphold&&(n+=" taphold"+this.eventNamespace),this.element.on(n,r.delegate,e.proxy(this._openMenu,this))},_destroy:function(){this.element.off(this.eventNamespace),this._createUiMenu(null),this.$headStyle&&(this.$headStyle.remove(),this.$headStyle=null)},_createUiMenu:function(t){var i,n,s=this.options;this.isOpen()&&(i=this.currentTarget,n=this.extraData,this._closeMenu(!0),this.currentTarget=i,this.extraData=n),this.menuIsTemp?this.$menu.remove():this.$menu&&this.$menu.menu("destroy").removeClass(this.options.addClass).hide(),this.$menu=null,this.menuIsTemp=!1,t&&(e.isArray(t)?(this.$menu=e.moogle.contextmenu.createMenuMarkup(t),this.menuIsTemp=!0):this.$menu="string"==typeof t?e(t):t,this.$menu.hide().addClass(s.addClass).menu(e.extend(!0,{},s.uiMenuOptions,{items:"> :not(.ui-widget-header)",blur:e.proxy(s.blur,this),create:e.proxy(s.createMenu,this),focus:e.proxy(s.focus,this),select:e.proxy(function(t,i){var n,r=e.moogle.contextmenu.isMenu(i.item),a=i.item.data("actionHandler");i.cmd=i.item.attr("data-command"),i.target=e(this.currentTarget),i.extraData=this.extraData,r&&s.ignoreParentSelect||(n=this._trigger.call(this,"select",t,i),a&&(n=a.call(this,t,i)),!1!==n&&this._closeMenu.call(this),t.preventDefault())},this)})))},_openMenu:function(t,i){var n,s,r,a=this.options,o=a.position,l=this,h=!!t.isTrigger;if(a.autoTrigger||h){if(t.preventDefault(),this.currentTarget=t.target,this.extraData=t._extraData||{},r={menu:this.$menu,target:e(this.currentTarget),extraData:this.extraData,originalEvent:t,result:null},!i){if(n=this._trigger("beforeOpen",t,r),s=r.result&&e.isFunction(r.result.promise)?r.result:null,r.result=null,!1===n)return this.currentTarget=null,!1;if(s)return s.done(function(){l._openMenu(t,!0)}),this.currentTarget=null,!1;r.menu=this.$menu}e(document).on("keydown"+this.eventNamespace,function(t){t.which===e.ui.keyCode.ESCAPE&&l._closeMenu()}).on("mousedown"+this.eventNamespace+" touchstart"+this.eventNamespace,function(t){e(t.target).closest(".ui-menu-item").length||l._closeMenu()}),e(window).on("blur"+this.eventNamespace,function(e){a.closeOnWindowBlur&&l._closeMenu()}),e.isFunction(o)&&(o=o(t,r)),o=e.extend({my:"left top",at:"left bottom",of:void 0===t.pageX?t.target:t,collision:"fit"},o),this._updateEntries(this.$menu),this.$menu.show().css({position:"absolute",left:0,top:0}).position(o).hide(),a.preventContextMenuForPopup&&this.$menu.on("contextmenu"+this.eventNamespace,function(e){e.preventDefault()}),this._show(this.$menu,a.show,function(){var i;a.autoFocus&&(l.previousFocus=e(t.target),i=l.$menu.children("li.ui-menu-item").not(".ui-state-disabled").first(),l.$menu.menu("focus",null,i).focus()),l._trigger.call(l,"open",t,r)})}},_closeMenu:function(t){var i=this,n=!t&&this.options.hide,s={menu:this.$menu,target:e(this.currentTarget),extraData:this.extraData};e(document).off("mousedown"+this.eventNamespace).off("touchstart"+this.eventNamespace).off("keydown"+this.eventNamespace),e(window).off("blur"+this.eventNamespace),i.currentTarget=null,i.extraData={},this.$menu?(this.$menu.off("contextmenu"+this.eventNamespace),this._hide(this.$menu,n,function(){i.previousFocus&&(i.previousFocus.focus(),i.previousFocus=null),i._trigger("close",null,s)})):i._trigger("close",null,s)},_setOption:function(t,i){switch(t){case"menu":this.replaceMenu(i)}e.Widget.prototype._setOption.apply(this,arguments)},_getMenuEntry:function(e){return this.$menu.find("li[data-command="+e+"]")},close:function(){this.isOpen()&&this._closeMenu()},_updateEntries:function(){var t=this,i={menu:this.$menu,target:e(this.currentTarget),extraData:this.extraData};e.each(this.$menu.find(".ui-menu-item"),function(n,s){var r=e(s),a=r.data("disabledHandler"),o=a?a({type:"disabled"},i):null;i.item=r,i.cmd=r.attr("data-command"),null!=o&&(t.enableEntry(i.cmd,!o),t.showEntry(i.cmd,"hide"!==o)),null!=(o=(a=r.data("titleHandler"))?a({type:"title"},i):null)&&t.setEntry(i.cmd,""+o),null!=(o=(a=r.data("tooltipHandler"))?a({type:"tooltip"},i):null)&&r.attr("title",""+o)})},enableEntry:function(e,t){this._getMenuEntry(e).toggleClass("ui-state-disabled",!1===t)},getMenu:function(){return this.$menu},isOpen:function(){return!!this.$menu&&!!this.currentTarget},open:function(t,i){i=i||{};var n=t&&t.type&&t.target,s=n?t:{},r=n?t.target:t,a=jQuery.Event("contextmenu",{target:e(r).get(0),pageX:s.pageX,pageY:s.pageY,originalEvent:n?t:void 0,_extraData:i});return this.element.trigger(a)},replaceMenu:function(e){this._createUiMenu(e)},setEntry:function(t,i){var n,s=this._getMenuEntry(t);"string"==typeof i?e.moogle.contextmenu.updateTitle(s,i):(s.empty(),i.cmd=i.cmd||t,e.moogle.contextmenu.createEntryMarkup(i,s),e.isArray(i.children)&&(n=e("<ul/>").appendTo(s),e.moogle.contextmenu.createMenuMarkup(i.children,n)),s.removeClass("ui-menu-item"),this.getMenu().menu("refresh"))},showEntry:function(e,t){this._getMenuEntry(e).toggle(!1!==t)}}),e.extend(e.moogle.contextmenu,{createEntryMarkup:function(t,i){var n=null;i.attr("data-command",t.cmd),/[^\-\u2014\u2013\s]/.test(t.title)?(s?(n=e("<a/>",{html:""+t.title,href:"#"}).appendTo(i),t.uiIcon&&n.append(e("<span class='ui-icon' />").addClass(t.uiIcon))):r?(i.html(""+t.title),t.uiIcon&&i.append(e("<span class='ui-icon' />").addClass(t.uiIcon))):(n=e("<div/>",{html:""+t.title}).appendTo(i),t.uiIcon&&n.append(e("<span class='ui-icon' />").addClass(t.uiIcon))),e.each(["action","disabled","title","tooltip"],function(n,s){e.isFunction(t[s])&&i.data(s+"Handler",t[s])}),!0===t.disabled&&i.addClass("ui-state-disabled"),t.isHeader&&i.addClass("ui-widget-header"),t.addClass&&i.addClass(t.addClass),e.isPlainObject(t.data)&&i.data(t.data),"string"==typeof t.tooltip&&i.attr("title",t.tooltip)):i.text(t.title)},createMenuMarkup:function(t,i){var n,s,r,a;for(null==i&&(i=e("<ul class='ui-helper-hidden' />").appendTo("body")),n=0;n<t.length;n++)s=t[n],a=e("<li/>").appendTo(i),e.moogle.contextmenu.createEntryMarkup(s,a),e.isArray(s.children)&&(r=e("<ul/>").appendTo(a),e.moogle.contextmenu.createMenuMarkup(s.children,r));return i},isMenu:function(e){return s?e.has(">a[aria-haspopup='true']").length>0:r?e.is("[aria-haspopup='true']"):e.has(">div[aria-haspopup='true']").length>0},replaceFirstTextNodeChild:function(e,t){var i=e.find(">span.ui-icon,>ul.ui-menu").detach();e.empty().html(t).append(i)},updateTitle:function(t,i){s?e.moogle.contextmenu.replaceFirstTextNodeChild(e("a",t),i):r?e.moogle.contextmenu.replaceFirstTextNodeChild(t,i):e.moogle.contextmenu.replaceFirstTextNodeChild(e("div",t),i)}})}),function(){var e="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this,t=e._,i=Array.prototype,n=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,r=i.push,a=i.slice,o=n.toString,l=n.hasOwnProperty,h=Array.isArray,u=Object.keys,p=Object.create,c=function(){},d=function(e){return e instanceof d?e:this instanceof d?void(this._wrapped=e):new d(e)};"undefined"==typeof exports||exports.nodeType?e._=d:("undefined"!=typeof module&&!module.nodeType&&module.exports&&(exports=module.exports=d),exports._=d),d.VERSION="1.8.3";var f,m=function(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 3:return function(i,n,s){return e.call(t,i,n,s)};case 4:return function(i,n,s,r){return e.call(t,i,n,s,r)}}return function(){return e.apply(t,arguments)}},y=function(e,t,i){return d.iteratee!==f?d.iteratee(e,t):null==e?d.identity:d.isFunction(e)?m(e,t,i):d.isObject(e)?d.matcher(e):d.property(e)};d.iteratee=f=function(e,t){return y(e,t,1/0)};var g=function(e,t){return t=null==t?e.length-1:+t,function(){for(var i=Math.max(arguments.length-t,0),n=Array(i),s=0;s<i;s++)n[s]=arguments[s+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var r=Array(t+1);for(s=0;s<t;s++)r[s]=arguments[s];return r[t]=n,e.apply(this,r)}},v=function(e){if(!d.isObject(e))return{};if(p)return p(e);c.prototype=e;var t=new c;return c.prototype=null,t},L=function(e){return function(t){return null==t?void 0:t[e]}},O=Math.pow(2,53)-1,b=L("length"),w=function(e){var t=b(e);return"number"==typeof t&&t>=0&&t<=O};d.each=d.forEach=function(e,t,i){t=m(t,i);var n,s;if(w(e))for(n=0,s=e.length;n<s;n++)t(e[n],n,e);else{var r=d.keys(e);for(n=0,s=r.length;n<s;n++)t(e[r[n]],r[n],e)}return e},d.map=d.collect=function(e,t,i){t=y(t,i);for(var n=!w(e)&&d.keys(e),s=(n||e).length,r=Array(s),a=0;a<s;a++){var o=n?n[a]:a;r[a]=t(e[o],o,e)}return r};var S=function(e){var t=function(t,i,n,s){var r=!w(t)&&d.keys(t),a=(r||t).length,o=e>0?0:a-1;for(s||(n=t[r?r[o]:o],o+=e);o>=0&&o<a;o+=e){var l=r?r[o]:o;n=i(n,t[l],l,t)}return n};return function(e,i,n,s){var r=arguments.length>=3;return t(e,m(i,s,4),n,r)}};d.reduce=d.foldl=d.inject=S(1),d.reduceRight=d.foldr=S(-1),d.find=d.detect=function(e,t,i){var n=(w(e)?d.findIndex:d.findKey)(e,t,i);if(void 0!==n&&-1!==n)return e[n]},d.filter=d.select=function(e,t,i){var n=[];return t=y(t,i),d.each(e,function(e,i,s){t(e,i,s)&&n.push(e)}),n},d.reject=function(e,t,i){return d.filter(e,d.negate(y(t)),i)},d.every=d.all=function(e,t,i){t=y(t,i);for(var n=!w(e)&&d.keys(e),s=(n||e).length,r=0;r<s;r++){var a=n?n[r]:r;if(!t(e[a],a,e))return!1}return!0},d.some=d.any=function(e,t,i){t=y(t,i);for(var n=!w(e)&&d.keys(e),s=(n||e).length,r=0;r<s;r++){var a=n?n[r]:r;if(t(e[a],a,e))return!0}return!1},d.contains=d.includes=d.include=function(e,t,i,n){return w(e)||(e=d.values(e)),("number"!=typeof i||n)&&(i=0),d.indexOf(e,t,i)>=0},d.invoke=g(function(e,t,i){var n=d.isFunction(t);return d.map(e,function(e){var s=n?t:e[t];return null==s?s:s.apply(e,i)})}),d.pluck=function(e,t){return d.map(e,d.property(t))},d.where=function(e,t){return d.filter(e,d.matcher(t))},d.findWhere=function(e,t){return d.find(e,d.matcher(t))},d.max=function(e,t,i){var n,s,r=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=w(e)?e:d.values(e)).length;o<l;o++)null!=(n=e[o])&&n>r&&(r=n);else t=y(t,i),d.each(e,function(e,i,n){((s=t(e,i,n))>a||s===-1/0&&r===-1/0)&&(r=e,a=s)});return r},d.min=function(e,t,i){var n,s,r=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var o=0,l=(e=w(e)?e:d.values(e)).length;o<l;o++)null!=(n=e[o])&&n<r&&(r=n);else t=y(t,i),d.each(e,function(e,i,n){((s=t(e,i,n))<a||s===1/0&&r===1/0)&&(r=e,a=s)});return r},d.shuffle=function(e){return d.sample(e,1/0)},d.sample=function(e,t,i){if(null==t||i)return w(e)||(e=d.values(e)),e[d.random(e.length-1)];var n=w(e)?d.clone(e):d.values(e),s=b(n);t=Math.max(Math.min(t,s),0);for(var r=s-1,a=0;a<t;a++){var o=d.random(a,r),l=n[a];n[a]=n[o],n[o]=l}return n.slice(0,t)},d.sortBy=function(e,t,i){var n=0;return t=y(t,i),d.pluck(d.map(e,function(e,i,s){return{value:e,index:n++,criteria:t(e,i,s)}}).sort(function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(i<n||void 0===n)return-1}return e.index-t.index}),"value")};var C=function(e,t){return function(i,n,s){var r=t?[[],[]]:{};return n=y(n,s),d.each(i,function(t,s){var a=n(t,s,i);e(r,t,a)}),r}};d.groupBy=C(function(e,t,i){d.has(e,i)?e[i].push(t):e[i]=[t]}),d.indexBy=C(function(e,t,i){e[i]=t}),d.countBy=C(function(e,t,i){d.has(e,i)?e[i]++:e[i]=1});var x=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;d.toArray=function(e){return e?d.isArray(e)?a.call(e):d.isString(e)?e.match(x):w(e)?d.map(e,d.identity):d.values(e):[]},d.size=function(e){return null==e?0:w(e)?e.length:d.keys(e).length},d.partition=C(function(e,t,i){e[i?0:1].push(t)},!0),d.first=d.head=d.take=function(e,t,i){if(!(null==e||e.length<1))return null==t||i?e[0]:d.initial(e,e.length-t)},d.initial=function(e,t,i){return a.call(e,0,Math.max(0,e.length-(null==t||i?1:t)))},d.last=function(e,t,i){if(!(null==e||e.length<1))return null==t||i?e[e.length-1]:d.rest(e,Math.max(0,e.length-t))},d.rest=d.tail=d.drop=function(e,t,i){return a.call(e,null==t||i?1:t)},d.compact=function(e){return d.filter(e,Boolean)};var _=function(e,t,i,n){for(var s=(n=n||[]).length,r=0,a=b(e);r<a;r++){var o=e[r];if(w(o)&&(d.isArray(o)||d.isArguments(o)))if(t)for(var l=0,h=o.length;l<h;)n[s++]=o[l++];else _(o,t,i,n),s=n.length;else i||(n[s++]=o)}return n};d.flatten=function(e,t){return _(e,t,!1)},d.without=g(function(e,t){return d.difference(e,t)}),d.uniq=d.unique=function(e,t,i,n){d.isBoolean(t)||(n=i,i=t,t=!1),null!=i&&(i=y(i,n));for(var s=[],r=[],a=0,o=b(e);a<o;a++){var l=e[a],h=i?i(l,a,e):l;t?(a&&r===h||s.push(l),r=h):i?d.contains(r,h)||(r.push(h),s.push(l)):d.contains(s,l)||s.push(l)}return s},d.union=g(function(e){return d.uniq(_(e,!0,!0))}),d.intersection=function(e){for(var t=[],i=arguments.length,n=0,s=b(e);n<s;n++){var r=e[n];if(!d.contains(t,r)){var a;for(a=1;a<i&&d.contains(arguments[a],r);a++);a===i&&t.push(r)}}return t},d.difference=g(function(e,t){return t=_(t,!0,!0),d.filter(e,function(e){return!d.contains(t,e)})}),d.unzip=function(e){for(var t=e&&d.max(e,b).length||0,i=Array(t),n=0;n<t;n++)i[n]=d.pluck(e,n);return i},d.zip=g(d.unzip),d.object=function(e,t){for(var i={},n=0,s=b(e);n<s;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i};var E=function(e){return function(t,i,n){i=y(i,n);for(var s=b(t),r=e>0?0:s-1;r>=0&&r<s;r+=e)if(i(t[r],r,t))return r;return-1}};d.findIndex=E(1),d.findLastIndex=E(-1),d.sortedIndex=function(e,t,i,n){for(var s=(i=y(i,n,1))(t),r=0,a=b(e);r<a;){var o=Math.floor((r+a)/2);i(e[o])<s?r=o+1:a=o}return r};var N=function(e,t,i){return function(n,s,r){var o=0,l=b(n);if("number"==typeof r)e>0?o=r>=0?r:Math.max(r+l,o):l=r>=0?Math.min(r+1,l):r+l+1;else if(i&&r&&l)return r=i(n,s),n[r]===s?r:-1;if(s!==s)return r=t(a.call(n,o,l),d.isNaN),r>=0?r+o:-1;for(r=e>0?o:l-1;r>=0&&r<l;r+=e)if(n[r]===s)return r;return-1}};d.indexOf=N(1,d.findIndex,d.sortedIndex),d.lastIndexOf=N(-1,d.findLastIndex),d.range=function(e,t,i){null==t&&(t=e||0,e=0),i||(i=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/i),0),s=Array(n),r=0;r<n;r++,e+=i)s[r]=e;return s},d.chunk=function(e,t){if(null==t||t<1)return[];for(var i=[],n=0,s=e.length;n<s;)i.push(a.call(e,n,n+=t));return i};var P=function(e,t,i,n,s){if(!(n instanceof t))return e.apply(i,s);var r=v(e.prototype),a=e.apply(r,s);return d.isObject(a)?a:r};d.bind=g(function(e,t,i){if(!d.isFunction(e))throw new TypeError("Bind must be called on a function");var n=g(function(s){return P(e,n,t,this,i.concat(s))});return n}),d.partial=g(function(e,t){var i=d.partial.placeholder,n=function(){for(var s=0,r=t.length,a=Array(r),o=0;o<r;o++)a[o]=t[o]===i?arguments[s++]:t[o];for(;s<arguments.length;)a.push(arguments[s++]);return P(e,n,this,this,a)};return n}),d.partial.placeholder=d,d.bindAll=g(function(e,t){var i=(t=_(t,!1,!1)).length;if(i<1)throw new Error("bindAll must be passed function names");for(;i--;){var n=t[i];e[n]=d.bind(e[n],e)}}),d.memoize=function(e,t){var i=function(n){var s=i.cache,r=""+(t?t.apply(this,arguments):n);return d.has(s,r)||(s[r]=e.apply(this,arguments)),s[r]};return i.cache={},i},d.delay=g(function(e,t,i){return setTimeout(function(){return e.apply(null,i)},t)}),d.defer=d.partial(d.delay,d,1),d.throttle=function(e,t,i){var n,s,r,a,o=0;i||(i={});var l=function(){o=!1===i.leading?0:d.now(),n=null,a=e.apply(s,r),n||(s=r=null)},h=function(){var h=d.now();o||!1!==i.leading||(o=h);var u=t-(h-o);return s=this,r=arguments,u<=0||u>t?(n&&(clearTimeout(n),n=null),o=h,a=e.apply(s,r),n||(s=r=null)):n||!1===i.trailing||(n=setTimeout(l,u)),a};return h.cancel=function(){clearTimeout(n),o=0,n=s=r=null},h},d.debounce=function(e,t,i){var n,s,r=function(t,i){n=null,i&&(s=e.apply(t,i))},a=g(function(a){if(n&&clearTimeout(n),i){var o=!n;n=setTimeout(r,t),o&&(s=e.apply(this,a))}else n=d.delay(r,t,this,a);return s});return a.cancel=function(){clearTimeout(n),n=null},a},d.wrap=function(e,t){return d.partial(t,e)},d.negate=function(e){return function(){return!e.apply(this,arguments)}},d.compose=function(){var e=arguments,t=e.length-1;return function(){for(var i=t,n=e[t].apply(this,arguments);i--;)n=e[i].call(this,n);return n}},d.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},d.before=function(e,t){var i;return function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=null),i}},d.once=d.partial(d.before,2),d.restArgs=g;var M=!{toString:null}.propertyIsEnumerable("toString"),T=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],k=function(e,t){var i=T.length,s=e.constructor,r=d.isFunction(s)&&s.prototype||n,a="constructor";for(d.has(e,a)&&!d.contains(t,a)&&t.push(a);i--;)(a=T[i])in e&&e[a]!==r[a]&&!d.contains(t,a)&&t.push(a)};d.keys=function(e){if(!d.isObject(e))return[];if(u)return u(e);var t=[];for(var i in e)d.has(e,i)&&t.push(i);return M&&k(e,t),t},d.allKeys=function(e){if(!d.isObject(e))return[];var t=[];for(var i in e)t.push(i);return M&&k(e,t),t},d.values=function(e){for(var t=d.keys(e),i=t.length,n=Array(i),s=0;s<i;s++)n[s]=e[t[s]];return n},d.mapObject=function(e,t,i){t=y(t,i);for(var n=d.keys(e),s=n.length,r={},a=0;a<s;a++){var o=n[a];r[o]=t(e[o],o,e)}return r},d.pairs=function(e){for(var t=d.keys(e),i=t.length,n=Array(i),s=0;s<i;s++)n[s]=[t[s],e[t[s]]];return n},d.invert=function(e){for(var t={},i=d.keys(e),n=0,s=i.length;n<s;n++)t[e[i[n]]]=i[n];return t},d.functions=d.methods=function(e){var t=[];for(var i in e)d.isFunction(e[i])&&t.push(i);return t.sort()};var A=function(e,t){return function(i){var n=arguments.length;if(t&&(i=Object(i)),n<2||null==i)return i;for(var s=1;s<n;s++)for(var r=arguments[s],a=e(r),o=a.length,l=0;l<o;l++){var h=a[l];t&&void 0!==i[h]||(i[h]=r[h])}return i}};d.extend=A(d.allKeys),d.extendOwn=d.assign=A(d.keys),d.findKey=function(e,t,i){t=y(t,i);for(var n,s=d.keys(e),r=0,a=s.length;r<a;r++)if(n=s[r],t(e[n],n,e))return n};var F=function(e,t,i){return t in i};d.pick=g(function(e,t){var i={},n=t[0];if(null==e)return i;d.isFunction(n)?(t.length>1&&(n=m(n,t[1])),t=d.allKeys(e)):(n=F,t=_(t,!1,!1),e=Object(e));for(var s=0,r=t.length;s<r;s++){var a=t[s],o=e[a];n(o,a,e)&&(i[a]=o)}return i}),d.omit=g(function(e,t){var i,n=t[0];return d.isFunction(n)?(n=d.negate(n),t.length>1&&(i=t[1])):(t=d.map(_(t,!1,!1),String),n=function(e,i){return!d.contains(t,i)}),d.pick(e,n,i)}),d.defaults=A(d.allKeys,!0),d.create=function(e,t){var i=v(e);return t&&d.extendOwn(i,t),i},d.clone=function(e){return d.isObject(e)?d.isArray(e)?e.slice():d.extend({},e):e},d.tap=function(e,t){return t(e),e},d.isMatch=function(e,t){var i=d.keys(t),n=i.length;if(null==e)return!n;for(var s=Object(e),r=0;r<n;r++){var a=i[r];if(t[a]!==s[a]||!(a in s))return!1}return!0};var D,I;D=function(e,t,i,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;if(e!==e)return t!==t;var s=typeof e;return("function"===s||"object"===s||"object"==typeof t)&&I(e,t,i,n)},I=function(e,t,i,n){e instanceof d&&(e=e._wrapped),t instanceof d&&(t=t._wrapped);var r=o.call(e);if(r!==o.call(t))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return s.valueOf.call(e)===s.valueOf.call(t)}var a="[object Array]"===r;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,h=t.constructor;if(l!==h&&!(d.isFunction(l)&&l instanceof l&&d.isFunction(h)&&h instanceof h)&&"constructor"in e&&"constructor"in t)return!1}i=i||[],n=n||[];for(var u=i.length;u--;)if(i[u]===e)return n[u]===t;if(i.push(e),n.push(t),a){if((u=e.length)!==t.length)return!1;for(;u--;)if(!D(e[u],t[u],i,n))return!1}else{var p,c=d.keys(e);if(u=c.length,d.keys(t).length!==u)return!1;for(;u--;)if(p=c[u],!d.has(t,p)||!D(e[p],t[p],i,n))return!1}return i.pop(),n.pop(),!0},d.isEqual=function(e,t){return D(e,t)},d.isEmpty=function(e){return null==e||(w(e)&&(d.isArray(e)||d.isString(e)||d.isArguments(e))?0===e.length:0===d.keys(e).length)},d.isElement=function(e){return!(!e||1!==e.nodeType)},d.isArray=h||function(e){return"[object Array]"===o.call(e)},d.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},d.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(e){d["is"+e]=function(t){return o.call(t)==="[object "+e+"]"}}),d.isArguments(arguments)||(d.isArguments=function(e){return d.has(e,"callee")});var R=e.document&&e.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof R&&(d.isFunction=function(e){return"function"==typeof e||!1}),d.isFinite=function(e){return!d.isSymbol(e)&&isFinite(e)&&!isNaN(parseFloat(e))},d.isNaN=function(e){return d.isNumber(e)&&isNaN(e)},d.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===o.call(e)},d.isNull=function(e){return null===e},d.isUndefined=function(e){return void 0===e},d.has=function(e,t){return null!=e&&l.call(e,t)},d.noConflict=function(){return e._=t,this},d.identity=function(e){return e},d.constant=function(e){return function(){return e}},d.noop=function(){},d.property=L,d.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},d.matcher=d.matches=function(e){return e=d.extendOwn({},e),function(t){return d.isMatch(t,e)}},d.times=function(e,t,i){var n=Array(Math.max(0,e));t=m(t,i,1);for(var s=0;s<e;s++)n[s]=t(s);return n},d.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},d.now=Date.now||function(){return(new Date).getTime()};var z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},U=d.invert(z),B=function(e){var t=function(t){return e[t]},i="(?:"+d.keys(e).join("|")+")",n=RegExp(i),s=RegExp(i,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(s,t):e}};d.escape=B(z),d.unescape=B(U),d.result=function(e,t,i){var n=null==e?void 0:e[t];return void 0===n&&(n=i),d.isFunction(n)?n.call(e):n};var G=0;d.uniqueId=function(e){var t=++G+"";return e?e+t:t},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,j={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,V=function(e){return"\\"+j[e]};d.template=function(e,t,i){!t&&i&&(t=i),t=d.defaults({},t,d.templateSettings);var n=RegExp([(t.escape||H).source,(t.interpolate||H).source,(t.evaluate||H).source].join("|")+"|$","g"),s=0,r="__p+='";e.replace(n,function(t,i,n,a,o){return r+=e.slice(s,o).replace(W,V),s=o+t.length,i?r+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?r+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(r+="';\n"+a+"\n__p+='"),t}),r+="';\n",t.variable||(r="with(obj||{}){\n"+r+"}\n"),r="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+r+"return __p;\n";var a;try{a=new Function(t.variable||"obj","_",r)}catch(e){throw e.source=r,e}var o=function(e){return a.call(this,e,d)},l=t.variable||"obj";return o.source="function("+l+"){\n"+r+"}",o},d.chain=function(e){var t=d(e);return t._chain=!0,t};var q=function(e,t){return e._chain?d(t).chain():t};d.mixin=function(e){return d.each(d.functions(e),function(t){var i=d[t]=e[t];d.prototype[t]=function(){var e=[this._wrapped];return r.apply(e,arguments),q(this,i.apply(d,e))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=i[e];d.prototype[e]=function(){var i=this._wrapped;return t.apply(i,arguments),"shift"!==e&&"splice"!==e||0!==i.length||delete i[0],q(this,i)}}),d.each(["concat","join","slice"],function(e){var t=i[e];d.prototype[e]=function(){return q(this,t.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return String(this._wrapped)},"function"==typeof define&&define.amd&&define("underscore",[],function(){return d})}(),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function e(){return rn.apply(null,arguments)}function t(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function n(e,t){var i,n=[];for(i=0;i<e.length;++i)n.push(t(e[i],i));return n}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e,t){for(var i in t)s(t,i)&&(e[i]=t[i]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function a(e,t,i,n){return Fe(e,t,i,n,!0).utc()}function o(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function l(e){return null==e._pf&&(e._pf=o()),e._pf}function h(e){if(null==e._isValid){var t=l(e),i=an.call(t.parsedDateParts,function(e){return null!=e});e._isValid=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&i),e._strict&&(e._isValid=e._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return e._isValid}function u(e){var t=a(NaN);return null!=e?r(l(t),e):l(t).userInvalidated=!0,t}function p(e){return void 0===e}function c(e,t){var i,n,s;if(p(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),p(t._i)||(e._i=t._i),p(t._f)||(e._f=t._f),p(t._l)||(e._l=t._l),p(t._strict)||(e._strict=t._strict),p(t._tzm)||(e._tzm=t._tzm),p(t._isUTC)||(e._isUTC=t._isUTC),p(t._offset)||(e._offset=t._offset),p(t._pf)||(e._pf=l(t)),p(t._locale)||(e._locale=t._locale),on.length>0)for(i in on)p(s=t[n=on[i]])||(e[n]=s);return e}function d(t){c(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),!1===ln&&(ln=!0,e.updateOffset(this),ln=!1)}function f(e){return e instanceof d||null!=e&&null!=e._isAMomentObject}function m(e){return e<0?Math.ceil(e):Math.floor(e)}function y(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=m(t)),i}function g(e,t,i){var n,s=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(n=0;n<s;n++)(i&&e[n]!==t[n]||!i&&y(e[n])!==y(t[n]))&&a++;return a+r}function v(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function L(t,i){var n=!0;return r(function(){return null!=e.deprecationHandler&&e.deprecationHandler(null,t),n&&(v(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),i.apply(this,arguments)},i)}function O(t,i){null!=e.deprecationHandler&&e.deprecationHandler(t,i),hn[t]||(v(i),hn[t]=!0)}function b(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function S(e){var t,i;for(i in e)b(t=e[i])?this[i]=t:this["_"+i]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function C(e,t){var i,n=r({},e);for(i in t)s(t,i)&&(w(e[i])&&w(t[i])?(n[i]={},r(n[i],e[i]),r(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);return n}function x(e){null!=e&&this.set(e)}function _(e){return e?e.toLowerCase().replace("_","-"):e}function E(e){for(var t,i,n,s,r=0;r<e.length;){for(t=(s=_(e[r]).split("-")).length,i=(i=_(e[r+1]))?i.split("-"):null;t>0;){if(n=N(s.slice(0,t).join("-")))return n;if(i&&i.length>=t&&g(s,i,!0)>=t-1)break;t--}r++}return null}function N(e){var t=null;if(!dn[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=pn._abbr,require("./locale/"+e),P(t)}catch(e){}return dn[e]}function P(e,t){var i;return e&&(i=p(t)?k(e):M(e,t))&&(pn=i),pn._abbr}function M(e,t){return null!==t?(t.abbr=e,null!=dn[e]?(O("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),t=C(dn[e]._config,t)):null!=t.parentLocale&&(null!=dn[t.parentLocale]?t=C(dn[t.parentLocale]._config,t):O("parentLocaleUndefined","specified parentLocale is not defined yet")),dn[e]=new x(t),P(e),dn[e]):(delete dn[e],null)}function T(e,t){if(null!=t){var i;null!=dn[e]&&(t=C(dn[e]._config,t)),(i=new x(t)).parentLocale=dn[e],dn[e]=i,P(e)}else null!=dn[e]&&(null!=dn[e].parentLocale?dn[e]=dn[e].parentLocale:null!=dn[e]&&delete dn[e]);return dn[e]}function k(e){var i;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return pn;if(!t(e)){if(i=N(e))return i;e=[e]}return E(e)}function A(){return un(dn)}function F(e,t){var i=e.toLowerCase();fn[i]=fn[i+"s"]=fn[t]=e}function D(e){return"string"==typeof e?fn[e]||fn[e.toLowerCase()]:void 0}function I(e){var t,i,n={};for(i in e)s(e,i)&&(t=D(i))&&(n[t]=e[i]);return n}function R(t,i){return function(n){return null!=n?(U(this,t,n),e.updateOffset(this,i),this):z(this,t)}}function z(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function U(e,t,i){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](i)}function B(e,t){var i;if("object"==typeof e)for(i in e)this.set(i,e[i]);else if(e=D(e),b(this[e]))return this[e](t);return this}function G(e,t,i){var n=""+Math.abs(e),s=t-n.length;return(e>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}function H(e,t,i,n){var s=n;"string"==typeof n&&(s=function(){return this[n]()}),e&&(vn[e]=s),t&&(vn[t[0]]=function(){return G(s.apply(this,arguments),t[1],t[2])}),i&&(vn[i]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function j(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function W(e){var t,i,n=e.match(mn);for(t=0,i=n.length;t<i;t++)vn[n[t]]?n[t]=vn[n[t]]:n[t]=j(n[t]);return function(t){var s,r="";for(s=0;s<i;s++)r+=n[s]instanceof Function?n[s].call(t,e):n[s];return r}}function V(e,t){return e.isValid()?(t=q(t,e.localeData()),gn[t]=gn[t]||W(t),gn[t](e)):e.localeData().invalidDate()}function q(e,t){function i(e){return t.longDateFormat(e)||e}var n=5;for(yn.lastIndex=0;n>=0&&yn.test(e);)e=e.replace(yn,i),yn.lastIndex=0,n-=1;return e}function Y(e,t,i){In[e]=b(t)?t:function(e,n){return e&&i?i:t}}function X(e,t){return s(In,e)?In[e](t._strict,t._locale):new RegExp(Z(e))}function Z(e){return $(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,s){return t||i||n||s}))}function $(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function K(e,t){var i,n=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(n=function(e,i){i[t]=y(e)}),i=0;i<e.length;i++)Rn[e[i]]=n}function Q(e,t){K(e,function(e,i,n,s){n._w=n._w||{},t(e,n._w,n,s)})}function J(e,t,i){null!=t&&s(Rn,e)&&Rn[e](t,i._a,i,e)}function ee(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function te(e,i){return t(this._months)?this._months[e.month()]:this._months[Yn.test(i)?"format":"standalone"][e.month()]}function ie(e,i){return t(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yn.test(i)?"format":"standalone"][e.month()]}function ne(e,t,i){var n,s,r,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=a([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return i?"MMM"===t?(s=cn.call(this._shortMonthsParse,o),-1!==s?s:null):(s=cn.call(this._longMonthsParse,o),-1!==s?s:null):"MMM"===t?-1!==(s=cn.call(this._shortMonthsParse,o))?s:(s=cn.call(this._longMonthsParse,o),-1!==s?s:null):-1!==(s=cn.call(this._longMonthsParse,o))?s:(s=cn.call(this._shortMonthsParse,o),-1!==s?s:null)}function se(e,t,i){var n,s,r;if(this._monthsParseExact)return ne.call(this,e,t,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(s=a([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(r="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}}function re(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=y(t);else if("number"!=typeof(t=e.localeData().monthsParse(t)))return e;return i=Math.min(e.date(),ee(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function ae(t){return null!=t?(re(this,t),e.updateOffset(this,!0),this):z(this,"Month")}function oe(){return ee(this.year(),this.month())}function le(e){return this._monthsParseExact?(s(this,"_monthsRegex")||ue.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function he(e){return this._monthsParseExact?(s(this,"_monthsRegex")||ue.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function ue(){function e(e,t){return t.length-e.length}var t,i,n=[],s=[],r=[];for(t=0;t<12;t++)i=a([2e3,t]),n.push(this.monthsShort(i,"")),s.push(this.months(i,"")),r.push(this.months(i,"")),r.push(this.monthsShort(i,""));for(n.sort(e),s.sort(e),r.sort(e),t=0;t<12;t++)n[t]=$(n[t]),s[t]=$(s[t]),r[t]=$(r[t]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function pe(e){var t,i=e._a;return i&&-2===l(e).overflow&&(t=i[Un]<0||i[Un]>11?Un:i[Bn]<1||i[Bn]>ee(i[zn],i[Un])?Bn:i[Gn]<0||i[Gn]>24||24===i[Gn]&&(0!==i[Hn]||0!==i[jn]||0!==i[Wn])?Gn:i[Hn]<0||i[Hn]>59?Hn:i[jn]<0||i[jn]>59?jn:i[Wn]<0||i[Wn]>999?Wn:-1,l(e)._overflowDayOfYear&&(t<zn||t>Bn)&&(t=Bn),l(e)._overflowWeeks&&-1===t&&(t=Vn),l(e)._overflowWeekday&&-1===t&&(t=qn),l(e).overflow=t),e}function ce(e){var t,i,n,s,r,a,o=e._i,h=Qn.exec(o)||Jn.exec(o);if(h){for(l(e).iso=!0,t=0,i=ts.length;t<i;t++)if(ts[t][1].exec(h[1])){s=ts[t][0],n=!1!==ts[t][2];break}if(null==s)return void(e._isValid=!1);if(h[3]){for(t=0,i=is.length;t<i;t++)if(is[t][1].exec(h[3])){r=(h[2]||" ")+is[t][0];break}if(null==r)return void(e._isValid=!1)}if(!n&&null!=r)return void(e._isValid=!1);if(h[4]){if(!es.exec(h[4]))return void(e._isValid=!1);a="Z"}e._f=s+(r||"")+(a||""),Ee(e)}else e._isValid=!1}function de(t){var i=ns.exec(t._i);null===i?(ce(t),!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t))):t._d=new Date(+i[1])}function fe(e,t,i,n,s,r,a){var o=new Date(e,t,i,n,s,r,a);return e<100&&e>=0&&isFinite(o.getFullYear())&&o.setFullYear(e),o}function me(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function ye(e){return ge(e)?366:365}function ge(e){return e%4==0&&e%100!=0||e%400==0}function ve(){return ge(this.year())}function Le(e,t,i){var n=7+t-i;return-((7+me(e,0,n).getUTCDay()-t)%7)+n-1}function Oe(e,t,i,n,s){var r,a,o=1+7*(t-1)+(7+i-n)%7+Le(e,n,s);return o<=0?a=ye(r=e-1)+o:o>ye(e)?(r=e+1,a=o-ye(e)):(r=e,a=o),{year:r,dayOfYear:a}}function be(e,t,i){var n,s,r=Le(e.year(),t,i),a=Math.floor((e.dayOfYear()-r-1)/7)+1;return a<1?n=a+we(s=e.year()-1,t,i):a>we(e.year(),t,i)?(n=a-we(e.year(),t,i),s=e.year()+1):(s=e.year(),n=a),{week:n,year:s}}function we(e,t,i){var n=Le(e,t,i),s=Le(e+1,t,i);return(ye(e)-n+s)/7}function Se(e,t,i){return null!=e?e:null!=t?t:i}function Ce(t){var i=new Date(e.now());return t._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function xe(e){var t,i,n,s,r=[];if(!e._d){for(n=Ce(e),e._w&&null==e._a[Bn]&&null==e._a[Un]&&_e(e),e._dayOfYear&&(s=Se(e._a[zn],n[zn]),e._dayOfYear>ye(s)&&(l(e)._overflowDayOfYear=!0),i=me(s,0,e._dayOfYear),e._a[Un]=i.getUTCMonth(),e._a[Bn]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=n[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Gn]&&0===e._a[Hn]&&0===e._a[jn]&&0===e._a[Wn]&&(e._nextDay=!0,e._a[Gn]=0),e._d=(e._useUTC?me:fe).apply(null,r),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Gn]=24)}}function _e(e){var t,i,n,s,r,a,o,h;null!=(t=e._w).GG||null!=t.W||null!=t.E?(r=1,a=4,i=Se(t.GG,e._a[zn],be(De(),1,4).year),n=Se(t.W,1),((s=Se(t.E,1))<1||s>7)&&(h=!0)):(r=e._locale._week.dow,a=e._locale._week.doy,i=Se(t.gg,e._a[zn],be(De(),r,a).year),n=Se(t.w,1),null!=t.d?((s=t.d)<0||s>6)&&(h=!0):null!=t.e?(s=t.e+r,(t.e<0||t.e>6)&&(h=!0)):s=r),n<1||n>we(i,r,a)?l(e)._overflowWeeks=!0:null!=h?l(e)._overflowWeekday=!0:(o=Oe(i,n,s,r,a),e._a[zn]=o.year,e._dayOfYear=o.dayOfYear)}function Ee(t){if(t._f!==e.ISO_8601){t._a=[],l(t).empty=!0;var i,n,s,r,a,o=""+t._i,h=o.length,u=0;for(s=q(t._f,t._locale).match(mn)||[],i=0;i<s.length;i++)r=s[i],(n=(o.match(X(r,t))||[])[0])&&((a=o.substr(0,o.indexOf(n))).length>0&&l(t).unusedInput.push(a),o=o.slice(o.indexOf(n)+n.length),u+=n.length),vn[r]?(n?l(t).empty=!1:l(t).unusedTokens.push(r),J(r,n,t)):t._strict&&!n&&l(t).unusedTokens.push(r);l(t).charsLeftOver=h-u,o.length>0&&l(t).unusedInput.push(o),!0===l(t).bigHour&&t._a[Gn]<=12&&t._a[Gn]>0&&(l(t).bigHour=void 0),l(t).parsedDateParts=t._a.slice(0),l(t).meridiem=t._meridiem,t._a[Gn]=Ne(t._locale,t._a[Gn],t._meridiem),xe(t),pe(t)}else ce(t)}function Ne(e,t,i){var n;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?((n=e.isPM(i))&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function Pe(e){var t,i,n,s,a;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(s=0;s<e._f.length;s++)a=0,t=c({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[s],Ee(t),h(t)&&(a+=l(t).charsLeftOver,a+=10*l(t).unusedTokens.length,l(t).score=a,(null==n||a<n)&&(n=a,i=t));r(e,i||t)}function Me(e){if(!e._d){var t=I(e._i);e._a=n([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),xe(e)}}function Te(e){var t=new d(pe(ke(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function ke(e){var n=e._i,s=e._f;return e._locale=e._locale||k(e._l),null===n||void 0===s&&""===n?u({nullInput:!0}):("string"==typeof n&&(e._i=n=e._locale.preparse(n)),f(n)?new d(pe(n)):(t(s)?Pe(e):s?Ee(e):i(n)?e._d=n:Ae(e),h(e)||(e._d=null),e))}function Ae(s){var r=s._i;void 0===r?s._d=new Date(e.now()):i(r)?s._d=new Date(r.valueOf()):"string"==typeof r?de(s):t(r)?(s._a=n(r.slice(0),function(e){return parseInt(e,10)}),xe(s)):"object"==typeof r?Me(s):"number"==typeof r?s._d=new Date(r):e.createFromInputFallback(s)}function Fe(e,t,i,n,s){var r={};return"boolean"==typeof i&&(n=i,i=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=s,r._l=i,r._i=e,r._f=t,r._strict=n,Te(r)}function De(e,t,i,n){return Fe(e,t,i,n,!1)}function Ie(e,i){var n,s;if(1===i.length&&t(i[0])&&(i=i[0]),!i.length)return De();for(n=i[0],s=1;s<i.length;++s)i[s].isValid()&&!i[s][e](n)||(n=i[s]);return n}function Re(){return Ie("isBefore",[].slice.call(arguments,0))}function ze(){return Ie("isAfter",[].slice.call(arguments,0))}function Ue(e){var t=I(e),i=t.year||0,n=t.quarter||0,s=t.month||0,r=t.week||0,a=t.day||0,o=t.hour||0,l=t.minute||0,h=t.second||0,u=t.millisecond||0;this._milliseconds=+u+1e3*h+6e4*l+1e3*o*60*60,this._days=+a+7*r,this._months=+s+3*n+12*i,this._data={},this._locale=k(),this._bubble()}function Be(e){return e instanceof Ue}function Ge(e,t){H(e,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+G(~~(e/60),2)+t+G(~~e%60,2)})}function He(e,t){var i=(t||"").match(e)||[],n=((i[i.length-1]||[])+"").match(ls)||["-",0,0],s=60*n[1]+y(n[2]);return"+"===n[0]?s:-s}function je(t,n){var s,r;return n._isUTC?(s=n.clone(),r=(f(t)||i(t)?t.valueOf():De(t).valueOf())-s.valueOf(),s._d.setTime(s._d.valueOf()+r),e.updateOffset(s,!1),s):De(t).local()}function We(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Ve(t,i){var n,s=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=He(An,t):Math.abs(t)<16&&(t*=60),!this._isUTC&&i&&(n=We(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),s!==t&&(!i||this._changeInProgress?lt(this,it(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?s:We(this):null!=t?this:NaN}function qe(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ye(e){return this.utcOffset(0,e)}function Xe(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(We(this),"m")),this}function Ze(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(He(kn,this._i)),this}function $e(e){return!!this.isValid()&&(e=e?De(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function Ke(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Qe(){if(!p(this._isDSTShifted))return this._isDSTShifted;var e={};if(c(e,this),(e=ke(e))._a){var t=e._isUTC?a(e._a):De(e._a);this._isDSTShifted=this.isValid()&&g(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Je(){return!!this.isValid()&&!this._isUTC}function et(){return!!this.isValid()&&this._isUTC}function tt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function it(e,t){var i,n,r,a=e,o=null;return Be(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(a={},t?a[t]=e:a.milliseconds=e):(o=hs.exec(e))?(i="-"===o[1]?-1:1,a={y:0,d:y(o[Bn])*i,h:y(o[Gn])*i,m:y(o[Hn])*i,s:y(o[jn])*i,ms:y(o[Wn])*i}):(o=us.exec(e))?(i="-"===o[1]?-1:1,a={y:nt(o[2],i),M:nt(o[3],i),w:nt(o[4],i),d:nt(o[5],i),h:nt(o[6],i),m:nt(o[7],i),s:nt(o[8],i)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(r=rt(De(a.from),De(a.to)),(a={}).ms=r.milliseconds,a.M=r.months),n=new Ue(a),Be(e)&&s(e,"_locale")&&(n._locale=e._locale),n}function nt(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function st(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function rt(e,t){var i;return e.isValid()&&t.isValid()?(t=je(t,e),e.isBefore(t)?i=st(e,t):((i=st(t,e)).milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function at(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function ot(e,t){return function(i,n){var s,r;return null===n||isNaN(+n)||(O(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),r=i,i=n,n=r),i="string"==typeof i?+i:i,s=it(i,n),lt(this,s,e),this}}function lt(t,i,n,s){var r=i._milliseconds,a=at(i._days),o=at(i._months);t.isValid()&&(s=null==s||s,r&&t._d.setTime(t._d.valueOf()+r*n),a&&U(t,"Date",z(t,"Date")+a*n),o&&re(t,z(t,"Month")+o*n),s&&e.updateOffset(t,a||o))}function ht(e,t){var i=e||De(),n=je(i,this).startOf("day"),s=this.diff(n,"days",!0),r=s<-6?"sameElse":s<-1?"lastWeek":s<0?"lastDay":s<1?"sameDay":s<2?"nextDay":s<7?"nextWeek":"sameElse",a=t&&(b(t[r])?t[r]():t[r]);return this.format(a||this.localeData().calendar(r,this,De(i)))}function ut(){return new d(this)}function pt(e,t){var i=f(e)?e:De(e);return!(!this.isValid()||!i.isValid())&&(t=D(p(t)?"millisecond":t),"millisecond"===t?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(t).valueOf())}function ct(e,t){var i=f(e)?e:De(e);return!(!this.isValid()||!i.isValid())&&(t=D(p(t)?"millisecond":t),"millisecond"===t?this.valueOf()<i.valueOf():this.clone().endOf(t).valueOf()<i.valueOf())}function dt(e,t,i,n){return n=n||"()",("("===n[0]?this.isAfter(e,i):!this.isBefore(e,i))&&(")"===n[1]?this.isBefore(t,i):!this.isAfter(t,i))}function ft(e,t){var i,n=f(e)?e:De(e);return!(!this.isValid()||!n.isValid())&&(t=D(t||"millisecond"),"millisecond"===t?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(t).valueOf()<=i&&i<=this.clone().endOf(t).valueOf()))}function mt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function yt(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function gt(e,t,i){var n,s,r,a;return this.isValid()&&(n=je(e,this)).isValid()?(s=6e4*(n.utcOffset()-this.utcOffset()),t=D(t),"year"===t||"month"===t||"quarter"===t?(a=vt(this,n),"quarter"===t?a/=3:"year"===t&&(a/=12)):(r=this-n,a="second"===t?r/1e3:"minute"===t?r/6e4:"hour"===t?r/36e5:"day"===t?(r-s)/864e5:"week"===t?(r-s)/6048e5:r),i?a:m(a)):NaN}function vt(e,t){var i,n=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(n,"months");return i=t-s<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(n+1,"months")-s),-(n+i)||0}function Lt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ot(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?b(Date.prototype.toISOString)?this.toDate().toISOString():V(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):V(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function bt(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var i=V(this,t);return this.localeData().postformat(i)}function wt(e,t){return this.isValid()&&(f(e)&&e.isValid()||De(e).isValid())?it({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function St(e){return this.from(De(),e)}function Ct(e,t){return this.isValid()&&(f(e)&&e.isValid()||De(e).isValid())?it({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function xt(e){return this.to(De(),e)}function _t(e){var t;return void 0===e?this._locale._abbr:(null!=(t=k(e))&&(this._locale=t),this)}function Et(){return this._locale}function Nt(e){switch(e=D(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Pt(e){return void 0===(e=D(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function Mt(){return this._d.valueOf()-6e4*(this._offset||0)}function Tt(){return Math.floor(this.valueOf()/1e3)}function kt(){return this._offset?new Date(this.valueOf()):this._d}function At(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ft(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Dt(){return this.isValid()?this.toISOString():null}function It(){return h(this)}function Rt(){return r({},l(this))}function zt(){return l(this).overflow}function Ut(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Bt(e,t){H(0,[e,e.length],0,t)}function Gt(e){return Vt.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Ht(e){return Vt.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function jt(){return we(this.year(),1,4)}function Wt(){var e=this.localeData()._week;return we(this.year(),e.dow,e.doy)}function Vt(e,t,i,n,s){var r;return null==e?be(this,n,s).year:(r=we(e,n,s),t>r&&(t=r),qt.call(this,e,t,i,n,s))}function qt(e,t,i,n,s){var r=Oe(e,t,i,n,s),a=me(r.year,0,r.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Yt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Xt(e){return be(e,this._week.dow,this._week.doy).week}function Zt(){return this._week.dow}function $t(){return this._week.doy}function Kt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Qt(e){var t=be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Jt(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function ei(e,i){return t(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(i)?"format":"standalone"][e.day()]}function ti(e){return this._weekdaysShort[e.day()]}function ii(e){return this._weekdaysMin[e.day()]}function ni(e,t,i){var n,s,r,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=a([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return i?"dddd"===t?(s=cn.call(this._weekdaysParse,o),-1!==s?s:null):"ddd"===t?(s=cn.call(this._shortWeekdaysParse,o),-1!==s?s:null):(s=cn.call(this._minWeekdaysParse,o),-1!==s?s:null):"dddd"===t?-1!==(s=cn.call(this._weekdaysParse,o))?s:-1!==(s=cn.call(this._shortWeekdaysParse,o))?s:(s=cn.call(this._minWeekdaysParse,o),-1!==s?s:null):"ddd"===t?-1!==(s=cn.call(this._shortWeekdaysParse,o))?s:-1!==(s=cn.call(this._weekdaysParse,o))?s:(s=cn.call(this._minWeekdaysParse,o),-1!==s?s:null):-1!==(s=cn.call(this._minWeekdaysParse,o))?s:-1!==(s=cn.call(this._weekdaysParse,o))?s:(s=cn.call(this._shortWeekdaysParse,o),-1!==s?s:null)}function si(e,t,i){var n,s,r;if(this._weekdaysParseExact)return ni.call(this,e,t,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=a([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(i&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(i&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!i&&this._weekdaysParse[n].test(e))return n}}function ri(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Jt(e,this.localeData()),this.add(e-t,"d")):t}function ai(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function oi(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function li(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||pi.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex}function hi(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||pi.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function ui(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||pi.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function pi(){function e(e,t){return t.length-e.length}var t,i,n,s,r,o=[],l=[],h=[],u=[];for(t=0;t<7;t++)i=a([2e3,1]).day(t),n=this.weekdaysMin(i,""),s=this.weekdaysShort(i,""),r=this.weekdays(i,""),o.push(n),l.push(s),h.push(r),u.push(n),u.push(s),u.push(r);for(o.sort(e),l.sort(e),h.sort(e),u.sort(e),t=0;t<7;t++)l[t]=$(l[t]),h[t]=$(h[t]),u[t]=$(u[t]);this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ci(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function di(){return this.hours()%12||12}function fi(){return this.hours()||24}function mi(e,t){H(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function yi(e,t){return t._meridiemParse}function gi(e){return"p"===(e+"").toLowerCase().charAt(0)}function vi(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function Li(e,t){t[Wn]=y(1e3*("0."+e))}function Oi(){return this._isUTC?"UTC":""}function bi(){return this._isUTC?"Coordinated Universal Time":""}function wi(e){return De(1e3*e)}function Si(){return De.apply(null,arguments).parseZone()}function Ci(e,t,i){var n=this._calendar[e];return b(n)?n.call(t,i):n}function xi(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function _i(){return this._invalidDate}function Ei(e){return this._ordinal.replace("%d",e)}function Ni(e){return e}function Pi(e,t,i,n){var s=this._relativeTime[i];return b(s)?s(e,t,i,n):s.replace(/%d/i,e)}function Mi(e,t){var i=this._relativeTime[e>0?"future":"past"];return b(i)?i(t):i.replace(/%s/i,t)}function Ti(e,t,i,n){var s=k(),r=a().set(n,t);return s[i](r,e)}function ki(e,t,i){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Ti(e,t,i,"month");var n,s=[];for(n=0;n<12;n++)s[n]=Ti(e,n,i,"month");return s}function Ai(e,t,i,n){"boolean"==typeof e?("number"==typeof t&&(i=t,t=void 0),t=t||""):(i=t=e,e=!1,"number"==typeof t&&(i=t,t=void 0),t=t||"");var s=k(),r=e?s._week.dow:0;if(null!=i)return Ti(t,(i+r)%7,n,"day");var a,o=[];for(a=0;a<7;a++)o[a]=Ti(t,(a+r)%7,n,"day");return o}function Fi(e,t){return ki(e,t,"months")}function Di(e,t){return ki(e,t,"monthsShort")}function Ii(e,t,i){return Ai(e,t,i,"weekdays")}function Ri(e,t,i){return Ai(e,t,i,"weekdaysShort")}function zi(e,t,i){return Ai(e,t,i,"weekdaysMin")}function Ui(){var e=this._data;return this._milliseconds=Ds(this._milliseconds),this._days=Ds(this._days),this._months=Ds(this._months),e.milliseconds=Ds(e.milliseconds),e.seconds=Ds(e.seconds),e.minutes=Ds(e.minutes),e.hours=Ds(e.hours),e.months=Ds(e.months),e.years=Ds(e.years),this}function Bi(e,t,i,n){var s=it(t,i);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function Gi(e,t){return Bi(this,e,t,1)}function Hi(e,t){return Bi(this,e,t,-1)}function ji(e){return e<0?Math.floor(e):Math.ceil(e)}function Wi(){var e,t,i,n,s,r=this._milliseconds,a=this._days,o=this._months,l=this._data;return r>=0&&a>=0&&o>=0||r<=0&&a<=0&&o<=0||(r+=864e5*ji(qi(o)+a),a=0,o=0),l.milliseconds=r%1e3,e=m(r/1e3),l.seconds=e%60,t=m(e/60),l.minutes=t%60,i=m(t/60),l.hours=i%24,a+=m(i/24),s=m(Vi(a)),o+=s,a-=ji(qi(s)),n=m(o/12),o%=12,l.days=a,l.months=o,l.years=n,this}function Vi(e){return 4800*e/146097}function qi(e){return 146097*e/4800}function Yi(e){var t,i,n=this._milliseconds;if("month"===(e=D(e))||"year"===e)return t=this._days+n/864e5,i=this._months+Vi(t),"month"===e?i:i/12;switch(t=this._days+Math.round(qi(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function Xi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)}function Zi(e){return function(){return this.as(e)}}function $i(e){return e=D(e),this[e+"s"]()}function Ki(e){return function(){return this._data[e]}}function Qi(){return m(this.days()/7)}function Ji(e,t,i,n,s){return s.relativeTime(t||1,!!i,e,n)}function en(e,t,i){var n=it(e).abs(),s=Ks(n.as("s")),r=Ks(n.as("m")),a=Ks(n.as("h")),o=Ks(n.as("d")),l=Ks(n.as("M")),h=Ks(n.as("y")),u=s<Qs.s&&["s",s]||r<=1&&["m"]||r<Qs.m&&["mm",r]||a<=1&&["h"]||a<Qs.h&&["hh",a]||o<=1&&["d"]||o<Qs.d&&["dd",o]||l<=1&&["M"]||l<Qs.M&&["MM",l]||h<=1&&["y"]||["yy",h];return u[2]=t,u[3]=+e>0,u[4]=i,Ji.apply(null,u)}function tn(e,t){return void 0!==Qs[e]&&(void 0===t?Qs[e]:(Qs[e]=t,!0))}function nn(e){var t=this.localeData(),i=en(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function sn(){var e,t,i,n=Js(this._milliseconds)/1e3,s=Js(this._days),r=Js(this._months);t=m((e=m(n/60))/60),n%=60,e%=60;var a=i=m(r/12),o=r%=12,l=s,h=t,u=e,p=n,c=this.asSeconds();return c?(c<0?"-":"")+"P"+(a?a+"Y":"")+(o?o+"M":"")+(l?l+"D":"")+(h||u||p?"T":"")+(h?h+"H":"")+(u?u+"M":"")+(p?p+"S":""):"P0D"}var rn,an;an=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),i=t.length>>>0,n=0;n<i;n++)if(n in t&&e.call(this,t[n],n,t))return!0;return!1};var on=e.momentProperties=[],ln=!1,hn={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var un;un=Object.keys?Object.keys:function(e){var t,i=[];for(t in e)s(e,t)&&i.push(t);return i};var pn,cn,dn={},fn={},mn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,yn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,gn={},vn={},Ln=/\d/,On=/\d\d/,bn=/\d{3}/,wn=/\d{4}/,Sn=/[+-]?\d{6}/,Cn=/\d\d?/,xn=/\d\d\d\d?/,_n=/\d\d\d\d\d\d?/,En=/\d{1,3}/,Nn=/\d{1,4}/,Pn=/[+-]?\d{1,6}/,Mn=/\d+/,Tn=/[+-]?\d+/,kn=/Z|[+-]\d\d:?\d\d/gi,An=/Z|[+-]\d\d(?::?\d\d)?/gi,Fn=/[+-]?\d+(\.\d{1,3})?/,Dn=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,In={},Rn={},zn=0,Un=1,Bn=2,Gn=3,Hn=4,jn=5,Wn=6,Vn=7,qn=8;cn=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},H("M",["MM",2],"Mo",function(){return this.month()+1}),H("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),H("MMMM",0,0,function(e){return this.localeData().months(this,e)}),F("month","M"),Y("M",Cn),Y("MM",Cn,On),Y("MMM",function(e,t){return t.monthsShortRegex(e)}),Y("MMMM",function(e,t){return t.monthsRegex(e)}),K(["M","MM"],function(e,t){t[Un]=y(e)-1}),K(["MMM","MMMM"],function(e,t,i,n){var s=i._locale.monthsParse(e,n,i._strict);null!=s?t[Un]=s:l(i).invalidMonth=e});var Yn=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Xn="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Zn="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),$n=Dn,Kn=Dn,Qn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Jn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,es=/Z|[+-]\d\d(?::?\d\d)?/,ts=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],is=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ns=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=L("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),H("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),H(0,["YY",2],0,function(){return this.year()%100}),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),F("year","y"),Y("Y",Tn),Y("YY",Cn,On),Y("YYYY",Nn,wn),Y("YYYYY",Pn,Sn),Y("YYYYYY",Pn,Sn),K(["YYYYY","YYYYYY"],zn),K("YYYY",function(t,i){i[zn]=2===t.length?e.parseTwoDigitYear(t):y(t)}),K("YY",function(t,i){i[zn]=e.parseTwoDigitYear(t)}),K("Y",function(e,t){t[zn]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return y(e)+(y(e)>68?1900:2e3)};var ss=R("FullYear",!0);e.ISO_8601=function(){};var rs=L("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:u()}),as=L("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=De.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:u()}),os=function(){return Date.now?Date.now():+new Date};Ge("Z",":"),Ge("ZZ",""),Y("Z",An),Y("ZZ",An),K(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=He(An,e)});var ls=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var hs=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,us=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;it.fn=Ue.prototype;var ps=ot(1,"add"),cs=ot(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ds=L("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});H(0,["gg",2],0,function(){return this.weekYear()%100}),H(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Bt("gggg","weekYear"),Bt("ggggg","weekYear"),Bt("GGGG","isoWeekYear"),Bt("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),Y("G",Tn),Y("g",Tn),Y("GG",Cn,On),Y("gg",Cn,On),Y("GGGG",Nn,wn),Y("gggg",Nn,wn),Y("GGGGG",Pn,Sn),Y("ggggg",Pn,Sn),Q(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=y(e)}),Q(["gg","GG"],function(t,i,n,s){i[s]=e.parseTwoDigitYear(t)}),H("Q",0,"Qo","quarter"),F("quarter","Q"),Y("Q",Ln),K("Q",function(e,t){t[Un]=3*(y(e)-1)}),H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),Y("w",Cn),Y("ww",Cn,On),Y("W",Cn),Y("WW",Cn,On),Q(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=y(e)});var fs={dow:0,doy:6};H("D",["DD",2],"Do","date"),F("date","D"),Y("D",Cn),Y("DD",Cn,On),Y("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),K(["D","DD"],Bn),K("Do",function(e,t){t[Bn]=y(e.match(Cn)[0],10)});var ms=R("Date",!0);H("d",0,"do","day"),H("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),H("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),H("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),Y("d",Cn),Y("e",Cn),Y("E",Cn),Y("dd",function(e,t){return t.weekdaysMinRegex(e)}),Y("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Y("dddd",function(e,t){return t.weekdaysRegex(e)}),Q(["dd","ddd","dddd"],function(e,t,i,n){var s=i._locale.weekdaysParse(e,n,i._strict);null!=s?t.d=s:l(i).invalidWeekday=e}),Q(["d","e","E"],function(e,t,i,n){t[n]=y(e)});var ys="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),gs="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),vs="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ls=Dn,Os=Dn,bs=Dn;H("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),Y("DDD",En),Y("DDDD",bn),K(["DDD","DDDD"],function(e,t,i){i._dayOfYear=y(e)}),H("H",["HH",2],0,"hour"),H("h",["hh",2],0,di),H("k",["kk",2],0,fi),H("hmm",0,0,function(){return""+di.apply(this)+G(this.minutes(),2)}),H("hmmss",0,0,function(){return""+di.apply(this)+G(this.minutes(),2)+G(this.seconds(),2)}),H("Hmm",0,0,function(){return""+this.hours()+G(this.minutes(),2)}),H("Hmmss",0,0,function(){return""+this.hours()+G(this.minutes(),2)+G(this.seconds(),2)}),mi("a",!0),mi("A",!1),F("hour","h"),Y("a",yi),Y("A",yi),Y("H",Cn),Y("h",Cn),Y("HH",Cn,On),Y("hh",Cn,On),Y("hmm",xn),Y("hmmss",_n),Y("Hmm",xn),Y("Hmmss",_n),K(["H","HH"],Gn),K(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),K(["h","hh"],function(e,t,i){t[Gn]=y(e),l(i).bigHour=!0}),K("hmm",function(e,t,i){var n=e.length-2;t[Gn]=y(e.substr(0,n)),t[Hn]=y(e.substr(n)),l(i).bigHour=!0}),K("hmmss",function(e,t,i){var n=e.length-4,s=e.length-2;t[Gn]=y(e.substr(0,n)),t[Hn]=y(e.substr(n,2)),t[jn]=y(e.substr(s)),l(i).bigHour=!0}),K("Hmm",function(e,t,i){var n=e.length-2;t[Gn]=y(e.substr(0,n)),t[Hn]=y(e.substr(n))}),K("Hmmss",function(e,t,i){var n=e.length-4,s=e.length-2;t[Gn]=y(e.substr(0,n)),t[Hn]=y(e.substr(n,2)),t[jn]=y(e.substr(s))});var ws=/[ap]\.?m?\.?/i,Ss=R("Hours",!0);H("m",["mm",2],0,"minute"),F("minute","m"),Y("m",Cn),Y("mm",Cn,On),K(["m","mm"],Hn);var Cs=R("Minutes",!1);H("s",["ss",2],0,"second"),F("second","s"),Y("s",Cn),Y("ss",Cn,On),K(["s","ss"],jn);var xs=R("Seconds",!1);H("S",0,0,function(){return~~(this.millisecond()/100)}),H(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,function(){return 10*this.millisecond()}),H(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),H(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),H(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),H(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),H(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),Y("S",En,Ln),Y("SS",En,On),Y("SSS",En,bn);var _s;for(_s="SSSS";_s.length<=9;_s+="S")Y(_s,Mn);for(_s="S";_s.length<=9;_s+="S")K(_s,Li);var Es=R("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var Ns=d.prototype;Ns.add=ps,Ns.calendar=ht,Ns.clone=ut,Ns.diff=gt,Ns.endOf=Pt,Ns.format=bt,Ns.from=wt,Ns.fromNow=St,Ns.to=Ct,Ns.toNow=xt,Ns.get=B,Ns.invalidAt=zt,Ns.isAfter=pt,Ns.isBefore=ct,Ns.isBetween=dt,Ns.isSame=ft,Ns.isSameOrAfter=mt,Ns.isSameOrBefore=yt,Ns.isValid=It,Ns.lang=ds,Ns.locale=_t,Ns.localeData=Et,Ns.max=as,Ns.min=rs,Ns.parsingFlags=Rt,Ns.set=B,Ns.startOf=Nt,Ns.subtract=cs,Ns.toArray=At,Ns.toObject=Ft,Ns.toDate=kt,Ns.toISOString=Ot,Ns.toJSON=Dt,Ns.toString=Lt,Ns.unix=Tt,Ns.valueOf=Mt,Ns.creationData=Ut,Ns.year=ss,Ns.isLeapYear=ve,Ns.weekYear=Gt,Ns.isoWeekYear=Ht,Ns.quarter=Ns.quarters=Yt,Ns.month=ae,Ns.daysInMonth=oe,Ns.week=Ns.weeks=Kt,Ns.isoWeek=Ns.isoWeeks=Qt,Ns.weeksInYear=Wt,Ns.isoWeeksInYear=jt,Ns.date=ms,Ns.day=Ns.days=ri,Ns.weekday=ai,Ns.isoWeekday=oi,Ns.dayOfYear=ci,Ns.hour=Ns.hours=Ss,Ns.minute=Ns.minutes=Cs,Ns.second=Ns.seconds=xs,Ns.millisecond=Ns.milliseconds=Es,Ns.utcOffset=Ve,Ns.utc=Ye,Ns.local=Xe,Ns.parseZone=Ze,Ns.hasAlignedHourOffset=$e,Ns.isDST=Ke,Ns.isDSTShifted=Qe,Ns.isLocal=Je,Ns.isUtcOffset=et,Ns.isUtc=tt,Ns.isUTC=tt,Ns.zoneAbbr=Oi,Ns.zoneName=bi,Ns.dates=L("dates accessor is deprecated. Use date instead.",ms),Ns.months=L("months accessor is deprecated. Use month instead",ae),Ns.years=L("years accessor is deprecated. Use year instead",ss),Ns.zone=L("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",qe);var Ps=Ns,Ms={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ts={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ks=/\d{1,2}/,As={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Fs=x.prototype;Fs._calendar=Ms,Fs.calendar=Ci,Fs._longDateFormat=Ts,Fs.longDateFormat=xi,Fs._invalidDate="Invalid date",Fs.invalidDate=_i,Fs._ordinal="%d",Fs.ordinal=Ei,Fs._ordinalParse=ks,Fs.preparse=Ni,Fs.postformat=Ni,Fs._relativeTime=As,Fs.relativeTime=Pi,Fs.pastFuture=Mi,Fs.set=S,Fs.months=te,Fs._months=Xn,Fs.monthsShort=ie,Fs._monthsShort=Zn,Fs.monthsParse=se,Fs._monthsRegex=Kn,Fs.monthsRegex=he,Fs._monthsShortRegex=$n,Fs.monthsShortRegex=le,Fs.week=Xt,Fs._week=fs,Fs.firstDayOfYear=$t,Fs.firstDayOfWeek=Zt,Fs.weekdays=ei,Fs._weekdays=ys,Fs.weekdaysMin=ii,Fs._weekdaysMin=vs,Fs.weekdaysShort=ti,Fs._weekdaysShort=gs,Fs.weekdaysParse=si,Fs._weekdaysRegex=Ls,Fs.weekdaysRegex=li,Fs._weekdaysShortRegex=Os,Fs.weekdaysShortRegex=hi,Fs._weekdaysMinRegex=bs,Fs.weekdaysMinRegex=ui,Fs.isPM=gi,Fs._meridiemParse=ws,Fs.meridiem=vi,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===y(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=L("moment.lang is deprecated. Use moment.locale instead.",P),e.langData=L("moment.langData is deprecated. Use moment.localeData instead.",k);var Ds=Math.abs,Is=Zi("ms"),Rs=Zi("s"),zs=Zi("m"),Us=Zi("h"),Bs=Zi("d"),Gs=Zi("w"),Hs=Zi("M"),js=Zi("y"),Ws=Ki("milliseconds"),Vs=Ki("seconds"),qs=Ki("minutes"),Ys=Ki("hours"),Xs=Ki("days"),Zs=Ki("months"),$s=Ki("years"),Ks=Math.round,Qs={s:45,m:45,h:22,d:26,M:11},Js=Math.abs,er=Ue.prototype;return er.abs=Ui,er.add=Gi,er.subtract=Hi,er.as=Yi,er.asMilliseconds=Is,er.asSeconds=Rs,er.asMinutes=zs,er.asHours=Us,er.asDays=Bs,er.asWeeks=Gs,er.asMonths=Hs,er.asYears=js,er.valueOf=Xi,er._bubble=Wi,er.get=$i,er.milliseconds=Ws,er.seconds=Vs,er.minutes=qs,er.hours=Ys,er.days=Xs,er.weeks=Qi,er.months=Zs,er.years=$s,er.humanize=nn,er.toISOString=sn,er.toString=sn,er.toJSON=sn,er.locale=_t,er.localeData=Et,er.toIsoString=L("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",sn),er.lang=ds,H("X",0,0,"unix"),H("x",0,0,"valueOf"),Y("x",Tn),Y("X",Fn),K("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),K("x",function(e,t,i){i._d=new Date(y(e))}),e.version="2.13.0",function(e){rn=e}(De),e.fn=Ps,e.min=Re,e.max=ze,e.now=os,e.utc=a,e.unix=wi,e.months=Fi,e.isDate=i,e.locale=P,e.invalid=u,e.duration=it,e.isMoment=f,e.weekdays=Ii,e.parseZone=Si,e.localeData=k,e.isDuration=Be,e.monthsShort=Di,e.weekdaysMin=zi,e.defineLocale=M,e.updateLocale=T,e.locales=A,e.weekdaysShort=Ri,e.normalizeUnits=D,e.relativeTimeThreshold=tn,e.prototype=Ps,e}),function(e){var t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(i,n,s){t.Backbone=e(t,s,i,n)});else if("undefined"!=typeof exports){var i,n=require("underscore");try{i=require("jquery")}catch(e){}e(t,exports,n,i)}else t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}(function(e,t,i,n){var s=e.Backbone,r=Array.prototype.slice;t.VERSION="1.3.3",t.$=n,t.noConflict=function(){return e.Backbone=s,this},t.emulateHTTP=!1,t.emulateJSON=!1;var a=function(e,t,n){switch(e){case 1:return function(){return i[t](this[n])};case 2:return function(e){return i[t](this[n],e)};case 3:return function(e,s){return i[t](this[n],l(e,this),s)};case 4:return function(e,s,r){return i[t](this[n],l(e,this),s,r)};default:return function(){var e=r.call(arguments);return e.unshift(this[n]),i[t].apply(i,e)}}},o=function(e,t,n){i.each(t,function(t,s){i[s]&&(e.prototype[s]=a(t,s,n))})},l=function(e,t){return i.isFunction(e)?e:i.isObject(e)&&!t._isModel(e)?h(e):i.isString(e)?function(t){return t.get(e)}:e},h=function(e){var t=i.matches(e);return function(e){return t(e.attributes)}},u=t.Events={},p=/\s+/,c=function(e,t,n,s,r){var a,o=0;if(n&&"object"==typeof n){void 0!==s&&"context"in r&&void 0===r.context&&(r.context=s);for(a=i.keys(n);o<a.length;o++)t=c(e,t,a[o],n[a[o]],r)}else if(n&&p.test(n))for(a=n.split(p);o<a.length;o++)t=e(t,a[o],s,r);else t=e(t,n,s,r);return t};u.on=function(e,t,i){return d(this,e,t,i)};var d=function(e,t,i,n,s){return e._events=c(f,e._events||{},t,i,{context:n,ctx:e,listening:s}),s&&((e._listeners||(e._listeners={}))[s.id]=s),e};u.listenTo=function(e,t,n){if(!e)return this;var s=e._listenId||(e._listenId=i.uniqueId("l")),r=this._listeningTo||(this._listeningTo={}),a=r[s];if(!a){var o=this._listenId||(this._listenId=i.uniqueId("l"));a=r[s]={obj:e,objId:s,id:o,listeningTo:r,count:0}}return d(e,t,n,this,a),this};var f=function(e,t,i,n){if(i){var s=e[t]||(e[t]=[]),r=n.context,a=n.ctx,o=n.listening;o&&o.count++,s.push({callback:i,context:r,ctx:r||a,listening:o})}return e};u.off=function(e,t,i){return this._events?(this._events=c(m,this._events,e,t,{context:i,listeners:this._listeners}),this):this},u.stopListening=function(e,t,n){var s=this._listeningTo;if(!s)return this;for(var r=e?[e._listenId]:i.keys(s),a=0;a<r.length;a++){var o=s[r[a]];if(!o)break;o.obj.off(t,n,this)}return this};var m=function(e,t,n,s){if(e){var r,a=0,o=s.context,l=s.listeners;if(t||n||o){for(var h=t?[t]:i.keys(e);a<h.length;a++){var u=e[t=h[a]];if(!u)break;for(var p=[],c=0;c<u.length;c++){var d=u[c];n&&n!==d.callback&&n!==d.callback._callback||o&&o!==d.context?p.push(d):(r=d.listening)&&0==--r.count&&(delete l[r.id],delete r.listeningTo[r.objId])}p.length?e[t]=p:delete e[t]}return e}for(var f=i.keys(l);a<f.length;a++)delete l[(r=l[f[a]]).id],delete r.listeningTo[r.objId]}};u.once=function(e,t,n){var s=c(y,{},e,t,i.bind(this.off,this));return"string"==typeof e&&null==n&&(t=void 0),this.on(s,t,n)},u.listenToOnce=function(e,t,n){var s=c(y,{},t,n,i.bind(this.stopListening,this,e));return this.listenTo(e,s)};var y=function(e,t,n,s){if(n){var r=e[t]=i.once(function(){s(t,r),n.apply(this,arguments)});r._callback=n}return e};u.trigger=function(e){if(!this._events)return this;for(var t=Math.max(0,arguments.length-1),i=Array(t),n=0;n<t;n++)i[n]=arguments[n+1];return c(g,this._events,e,void 0,i),this};var g=function(e,t,i,n){if(e){var s=e[t],r=e.all;s&&r&&(r=r.slice()),s&&v(s,n),r&&v(r,[t].concat(n))}return e},v=function(e,t){var i,n=-1,s=e.length,r=t[0],a=t[1],o=t[2];switch(t.length){case 0:for(;++n<s;)(i=e[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=e[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=e[n]).callback.call(i.ctx,r,a);return;case 3:for(;++n<s;)(i=e[n]).callback.call(i.ctx,r,a,o);return;default:for(;++n<s;)(i=e[n]).callback.apply(i.ctx,t);return}};u.bind=u.on,u.unbind=u.off,i.extend(t,u);var L=t.Model=function(e,t){var n=e||{};t||(t={}),this.cid=i.uniqueId(this.cidPrefix),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(n=this.parse(n,t)||{});var s=i.result(this,"defaults");n=i.defaults(i.extend({},s,n),s),this.set(n,t),this.changed={},this.initialize.apply(this,arguments)};i.extend(L.prototype,u,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(e){return i.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return i.escape(this.get(e))},has:function(e){return null!=this.get(e)},matches:function(e){return!!i.iteratee(e,this)(this.attributes)},set:function(e,t,n){if(null==e)return this;var s;if("object"==typeof e?(s=e,n=t):(s={})[e]=t,n||(n={}),!this._validate(s,n))return!1;var r=n.unset,a=n.silent,o=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=i.clone(this.attributes),this.changed={});var h=this.attributes,u=this.changed,p=this._previousAttributes;for(var c in s)t=s[c],i.isEqual(h[c],t)||o.push(c),i.isEqual(p[c],t)?delete u[c]:u[c]=t,r?delete h[c]:h[c]=t;if(this.idAttribute in s&&(this.id=this.get(this.idAttribute)),!a){o.length&&(this._pending=n);for(var d=0;d<o.length;d++)this.trigger("change:"+o[d],this,h[o[d]],n)}if(l)return this;if(!a)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,i.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var n in this.attributes)t[n]=void 0;return this.set(t,i.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!i.isEmpty(this.changed):i.has(this.changed,e)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&i.clone(this.changed);var t=this._changing?this._previousAttributes:this.attributes,n={};for(var s in e){var r=e[s];i.isEqual(t[s],r)||(n[s]=r)}return!!i.size(n)&&n},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(e){var t=this,n=(e=i.extend({parse:!0},e)).success;return e.success=function(i){var s=e.parse?t.parse(i,e):i;if(!t.set(s,e))return!1;n&&n.call(e.context,t,i,e),t.trigger("sync",t,i,e)},U(this,e),this.sync("read",this,e)},save:function(e,t,n){var s;null==e||"object"==typeof e?(s=e,n=t):(s={})[e]=t;var r=(n=i.extend({validate:!0,parse:!0},n)).wait;if(s&&!r){if(!this.set(s,n))return!1}else if(!this._validate(s,n))return!1;var a=this,o=n.success,l=this.attributes;n.success=function(e){a.attributes=l;var t=n.parse?a.parse(e,n):e;if(r&&(t=i.extend({},s,t)),t&&!a.set(t,n))return!1;o&&o.call(n.context,a,e,n),a.trigger("sync",a,e,n)},U(this,n),s&&r&&(this.attributes=i.extend({},l,s));var h=this.isNew()?"create":n.patch?"patch":"update";"patch"!==h||n.attrs||(n.attrs=s);var u=this.sync(h,this,n);return this.attributes=l,u},destroy:function(e){var t=this,n=(e=e?i.clone(e):{}).success,s=e.wait,r=function(){t.stopListening(),t.trigger("destroy",t,t.collection,e)};e.success=function(i){s&&r(),n&&n.call(e.context,t,i,e),t.isNew()||t.trigger("sync",t,i,e)};var a=!1;return this.isNew()?i.defer(e.success):(U(this,e),a=this.sync("delete",this,e)),s||r(),a},url:function(){var e=i.result(this,"urlRoot")||i.result(this.collection,"url")||z();if(this.isNew())return e;var t=this.get(this.idAttribute);return e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},i.extend({},e,{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=i.extend({},this.attributes,e);var n=this.validationError=this.validate(e,t)||null;return!n||(this.trigger("invalid",this,n,i.extend(t,{validationError:n})),!1)}}),o(L,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes");var O=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,i.extend({silent:!0},t))},b={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},S=function(e,t,i){i=Math.min(Math.max(i,0),e.length);var n,s=Array(e.length-i),r=t.length;for(n=0;n<s.length;n++)s[n]=e[n+i];for(n=0;n<r;n++)e[n+i]=t[n];for(n=0;n<s.length;n++)e[n+r+i]=s[n]};i.extend(O.prototype,u,{model:L,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,i.extend({merge:!1},t,w))},remove:function(e,t){t=i.extend({},t);var n=!i.isArray(e);e=n?[e]:e.slice();var s=this._removeModels(e,t);return!t.silent&&s.length&&(t.changes={added:[],merged:[],removed:s},this.trigger("update",this,t)),n?s[0]:s},set:function(e,t){if(null!=e){(t=i.extend({},b,t)).parse&&!this._isModel(e)&&(e=this.parse(e,t)||[]);var n=!i.isArray(e);e=n?[e]:e.slice();var s=t.at;null!=s&&(s=+s),s>this.length&&(s=this.length),s<0&&(s+=this.length+1);var r,a,o=[],l=[],h=[],u=[],p={},c=t.add,d=t.merge,f=t.remove,m=!1,y=this.comparator&&null==s&&!1!==t.sort,g=i.isString(this.comparator)?this.comparator:null;for(a=0;a<e.length;a++){r=e[a];var v=this.get(r);if(v){if(d&&r!==v){var L=this._isModel(r)?r.attributes:r;t.parse&&(L=v.parse(L,t)),v.set(L,t),h.push(v),y&&!m&&(m=v.hasChanged(g))}p[v.cid]||(p[v.cid]=!0,o.push(v)),e[a]=v}else c&&(r=e[a]=this._prepareModel(r,t))&&(l.push(r),this._addReference(r,t),p[r.cid]=!0,o.push(r))}if(f){for(a=0;a<this.length;a++)p[(r=this.models[a]).cid]||u.push(r);u.length&&this._removeModels(u,t)}var O=!1,w=!y&&c&&f;if(o.length&&w?(O=this.length!==o.length||i.some(this.models,function(e,t){return e!==o[t]}),this.models.length=0,S(this.models,o,0),this.length=this.models.length):l.length&&(y&&(m=!0),S(this.models,l,null==s?this.length:s),this.length=this.models.length),m&&this.sort({silent:!0}),!t.silent){for(a=0;a<l.length;a++)null!=s&&(t.index=s+a),(r=l[a]).trigger("add",r,this,t);(m||O)&&this.trigger("sort",this,t),(l.length||u.length||h.length)&&(t.changes={added:l,removed:u,merged:h},this.trigger("update",this,t))}return n?e[0]:e}},reset:function(e,t){t=t?i.clone(t):{};for(var n=0;n<this.models.length;n++)this._removeReference(this.models[n],t);return t.previousModels=this.models,this._reset(),e=this.add(e,i.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,i.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e)},unshift:function(e,t){return this.add(e,i.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e)},slice:function(){return r.apply(this.models,arguments)},get:function(e){if(null!=e)return this._byId[e]||this._byId[this.modelId(e.attributes||e)]||e.cid&&this._byId[e.cid]},has:function(e){return null!=this.get(e)},at:function(e){return e<0&&(e+=this.length),this.models[e]},where:function(e,t){return this[t?"find":"filter"](e)},findWhere:function(e){return this.where(e,!0)},sort:function(e){var t=this.comparator;if(!t)throw new Error("Cannot sort a set without a comparator");e||(e={});var n=t.length;return i.isFunction(t)&&(t=i.bind(t,this)),1===n||i.isString(t)?this.models=this.sortBy(t):this.models.sort(t),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return this.map(e+"")},fetch:function(e){var t=(e=i.extend({parse:!0},e)).success,n=this;return e.success=function(i){var s=e.reset?"reset":"set";n[s](i,e),t&&t.call(e.context,n,i,e),n.trigger("sync",n,i,e)},U(this,e),this.sync("read",this,e)},create:function(e,t){var n=(t=t?i.clone(t):{}).wait;if(!(e=this._prepareModel(e,t)))return!1;n||this.add(e,t);var s=this,r=t.success;return t.success=function(e,t,i){n&&s.add(e,i),r&&r.call(i.context,e,t,i)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(e){return e[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(this._isModel(e))return e.collection||(e.collection=this),e;(t=t?i.clone(t):{}).collection=this;var n=new this.model(e,t);return n.validationError?(this.trigger("invalid",this,n.validationError,t),!1):n},_removeModels:function(e,t){for(var i=[],n=0;n<e.length;n++){var s=this.get(e[n]);if(s){var r=this.indexOf(s);this.models.splice(r,1),this.length--,delete this._byId[s.cid];var a=this.modelId(s.attributes);null!=a&&delete this._byId[a],t.silent||(t.index=r,s.trigger("remove",s,this,t)),i.push(s),this._removeReference(s,t)}}return i},_isModel:function(e){return e instanceof L},_addReference:function(e,t){this._byId[e.cid]=e;var i=this.modelId(e.attributes);null!=i&&(this._byId[i]=e),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){delete this._byId[e.cid];var i=this.modelId(e.attributes);null!=i&&delete this._byId[i],this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,i,n){if(t){if(("add"===e||"remove"===e)&&i!==this)return;if("destroy"===e&&this.remove(t,n),"change"===e){var s=this.modelId(t.previousAttributes()),r=this.modelId(t.attributes);s!==r&&(null!=s&&delete this._byId[s],null!=r&&(this._byId[r]=t))}}this.trigger.apply(this,arguments)}}),o(O,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models");var C=t.View=function(e){this.cid=i.uniqueId("view"),i.extend(this,i.pick(e,_)),this._ensureElement(),this.initialize.apply(this,arguments)},x=/^(\S+)\s*(.*)$/,_=["model","collection","el","id","attributes","className","tagName","events"];i.extend(C.prototype,u,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0]},delegateEvents:function(e){if(e||(e=i.result(this,"events")),!e)return this;this.undelegateEvents();for(var t in e){var n=e[t];if(i.isFunction(n)||(n=this[n]),n){var s=t.match(x);this.delegate(s[1],s[2],i.bind(n,this))}}return this},delegate:function(e,t,i){return this.$el.on(e+".delegateEvents"+this.cid,t,i),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(e,t,i){return this.$el.off(e+".delegateEvents"+this.cid,t,i),this},_createElement:function(e){return document.createElement(e)},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"));else{var e=i.extend({},i.result(this,"attributes"));this.id&&(e.id=i.result(this,"id")),this.className&&(e.class=i.result(this,"className")),this.setElement(this._createElement(i.result(this,"tagName"))),this._setAttributes(e)}},_setAttributes:function(e){this.$el.attr(e)}}),t.sync=function(e,n,s){var r=E[e];i.defaults(s||(s={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var a={type:r,dataType:"json"};if(s.url||(a.url=i.result(n,"url")||z()),null!=s.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(a.contentType="application/json",a.data=JSON.stringify(s.attrs||n.toJSON(s))),s.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),s.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",s.emulateJSON&&(a.data._method=r);var o=s.beforeSend;s.beforeSend=function(e){if(e.setRequestHeader("X-HTTP-Method-Override",r),o)return o.apply(this,arguments)}}"GET"===a.type||s.emulateJSON||(a.processData=!1);var l=s.error;s.error=function(e,t,i){s.textStatus=t,s.errorThrown=i,l&&l.call(s.context,e,t,i)};var h=s.xhr=t.ajax(i.extend(a,s));return n.trigger("request",n,h,s),h};var E={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var N=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},P=/\((.*?)\)/g,M=/(\(\?)?:\w+/g,T=/\*\w+/g,k=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(N.prototype,u,{initialize:function(){},route:function(e,n,s){i.isRegExp(e)||(e=this._routeToRegExp(e)),i.isFunction(n)&&(s=n,n=""),s||(s=this[n]);var r=this;return t.history.route(e,function(i){var a=r._extractParameters(e,i);!1!==r.execute(s,a,n)&&(r.trigger.apply(r,["route:"+n].concat(a)),r.trigger("route",n,a),t.history.trigger("route",r,n,a))}),this},execute:function(e,t,i){e&&e.apply(this,t)},navigate:function(e,i){return t.history.navigate(e,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var e,t=i.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(k,"\\$&").replace(P,"(?:$1)?").replace(M,function(e,t){return t?e:"([^/?]+)"}).replace(T,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var n=e.exec(t).slice(1);return i.map(n,function(e,t){return t===n.length-1?e||null:e?decodeURIComponent(e):null})}});var A=t.History=function(){this.handlers=[],this.checkUrl=i.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},F=/^[#\/]|\s+$/g,D=/^\/+|\/+$/g,I=/#.*$/;A.started=!1,i.extend(A.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(e){return decodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){var e=this.location.href.replace(/#.*/,"").match(/\?.+/);return e?e[0]:""},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var e=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){return null==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(F,"")},start:function(e){if(A.started)throw new Error("Backbone.history has already been started");if(A.started=!0,this.options=i.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(D,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var t=this.root.slice(0,-1)||"/";return this.location.replace(t+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var n=document.body,s=n.insertBefore(this.iframe,n.firstChild).contentWindow;s.document.open(),s.document.close(),s.location.hash="#"+this.fragment}var r=window.addEventListener||function(e,t){return attachEvent("on"+e,t)};if(this._usePushState?r("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?r("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var e=window.removeEventListener||function(e,t){return detachEvent("on"+e,t)};this._usePushState?e("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&e("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),A.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();if(t===this.fragment&&this.iframe&&(t=this.getHash(this.iframe.contentWindow)),t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return!!this.matchRoot()&&(e=this.fragment=this.getFragment(e),i.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))},navigate:function(e,t){if(!A.started)return!1;t&&!0!==t||(t={trigger:!!t}),e=this.getFragment(e||"");var i=this.root;""!==e&&"?"!==e.charAt(0)||(i=i.slice(0,-1)||"/");var n=i+e;if(e=this.decodeFragment(e.replace(I,"")),this.fragment!==e){if(this.fragment=e,this._usePushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);if(this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getHash(this.iframe.contentWindow)){var s=this.iframe.contentWindow;t.replace||(s.document.open(),s.document.close()),this._updateHash(s.location,e,t.replace)}}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,i){if(i){var n=e.href.replace(/(javascript:|#).*$/,"");e.replace(n+"#"+t)}else e.hash="#"+t}}),t.history=new A;var R=function(e,t){var n,s=this;return n=e&&i.has(e,"constructor")?e.constructor:function(){return s.apply(this,arguments)},i.extend(n,s,t),n.prototype=i.create(s.prototype,e),n.prototype.constructor=n,n.__super__=s.prototype,n};L.extend=O.extend=N.extend=C.extend=A.extend=R;var z=function(){throw new Error('A "url" property or function must be specified')},U=function(e,t){var i=t.error;t.error=function(n){i&&i.call(t.context,e,n,t),e.trigger("error",e,n,t)}};return t});var Utils;Utils=function(){function e(){}var t,i,n,s,r;return e.getPointGroupsStr=function(e){var t,i,n;return n=/((-?\d{1,3}\.\d{2,},){2})/g,i=0,function(){var s;for(s=[];t=n.exec(e);)s.push(e.slice(i,+((i=t.index)-2)+1||9e9));return s}().slice(1).concat([e.slice(i)])},r=function(e){var t;return t=moment(e,"YYYY-MM-DD HH:mm:ss").toDate(),isNaN(t)?(e.trim().length>1&&console.warning("Error: Received an invalid date: '"+e+"'"),new Date):new Date(t)},n=function(e){var t;return!!function(){try{return JSON.parse(null!=e?e.toLowerCase():void 0)}catch(i){return t=i,console.warning("Error: Received an invalid boolean: '"+e+"' Error = "+t)}}()},t=function(e){return e},i=function(e,t){return null==t&&(t=5),parseFloat(parseFloat(e).toFixed(t))},s=function(e,t){var i;switch(null!=(i=""+e)?i.toLowerCase():void 0){case"true":return t;case"false":return 0;default:return Number.parseInt(e,10)}},e.parsePoints=function(a){var o,l;return o=e.getPointGroupsStr(a.join()).map(function(e){return e.split(",")}),l=["latitude","longitude","time","id","speed","altitude","address","icon","hasVoice","hasText","isInCall"],o.map(function(e,a){return e.length!==l.length&&"function"==typeof console.warning&&console.warning("Error: Wrong number of point arguments "+e.length+" != "+l.length+", "+e+" "),(new DataSetPoint).merge(l.reduce(function(o,l,h){return o[l]=function(){switch(l){case"latitude":case"longitude":case"altitude":return i(+e[h]);case"id":return e[h]&&e[h].length>0?e[h]:"#"+(a+1);case"time":return r(e[h]);case"isInCall":return n(e[h]);case"hasText":return s(e[h],10);case"hasVoice":return s(e[h],3);case"icon":return t(e[h]);default:return e[h]}}(),o},{}))})},e.getLocalIP=function(e){var t,i;if(t=window.webkitRTCPeerConnection||window.mozRTCPeerConnection,console.warning(t),t)return(i=new t({iceServers:[]})).createDataChannel("",{reliable:!1}),i.onicecandidate=function(t){var i;if(null!=t.candidate&&(i=t.candidate.candidate.split(" "),"function"==typeof console.warning&&console.warning("ICE candidate: "+i),"tcp"===i[2]))return"function"==typeof e?e({priority:+i[3],ip:i[4]}):void 0},i.createOffer(function(e){return i.setLocalDescription(e)})},e}(),null!=this&&(this.Utils=Utils),Backbone.sync=function(e,t,i,n){i()},_.mixin({indexOfElement:function(e,t){return e.reduce(function(e,i,n){return e<0&&t(i)?n:e},-1)}});var MapProperties=Backbone.Model.extend({defaults:{dimmensions:[300,300],bounds:[],lastUpdated:new Date,isReset:!1,isVisible:!1,mapType:"terrain",openedMarker:"",center:[44.423361,26.093608],zoom:20,console:!1,traffic:!1,polygonToGet:{name:""},polyPointCallback:function(e){},getPolygonCallback:function(e){}}}),DataSet=Backbone.Model.extend({defaults:{id:null,points:[],isVisible:!1,isAutosize:!1,lastUpdated:new Date,isShowLabels:!0},initialize:function(){console.log("initializing dataset "+this.get("id"))},updatePoints:function(e){var t=this;e.forEach(function(e){var i=_(t.get("points")).indexOfElement(function(t){return t.id==e.id});i>=0&&t.get("points").splice(i,1),e.dataset=t.get("id"),t.get("points").push(e);var n="heading_positions"===e.dataset?50:datasetLimit;t.get("points").length>n&&t.get("points").shift()}),this.set("lastUpdated",new Date)},removePoint:function(e){var t=_.findIndex(this.get("points"),{id:e});-1!=t&&(this.get("points").splice(t,1),this.set("lastUpdated",new Date))}}),Polyline=DataSet.extend({defaults:{color:"blue",thickness:.4,isPolyline:!0}}),Polygon=DataSet.extend({defaults:{isNew:!1,isEditing:!1,isPolyline:!1},initialize:function(){this.set("isPolyline",!1)}}),PolygonCollection=Backbone.Collection.extend({model:Polygon}),DataSetCollection=Backbone.Collection.extend({model:DataSet}),InfoWindowModel=Backbone.Model.extend({defaults:{id:"info point",latitude:23.4332,longitude:-32.234,time:new Date,name:"abcs",speed:"23kph",altitude:"3 m",address:"bld. Marasesti, Bucuresti, sector 4",hasStreetView:!1,hasVoice:0,hasText:0,isInCall:!1},mergePoint:function(e){console.log("InfoWindowModel: Merge point "+e.id+" with incall="+e.isInCall),Object.keys(e).forEach(function(t){this.set(t,e[t])},this)}}),InfoWindowView=Backbone.View.extend({elId:"#info",events:{"mousedown .name img":"computePttState","mouseup .name img":"computePttState","dragend .name img":"computePttState","keypress input":"onKeyPress"},pttState:"neutral",setPttState:function(e){"ask-ptt"==e&&this.ptt(!0),"call-done"==e&&this.ptt(!1);var t={neutral:"r_ptt.png","ask-ptt":"r_ptt_over.png","in-call":"r_ptt_over.png","call-failed":"r_ptt_end.png","call-done":"r_ptt_hang.png",called:"r_ptt_incoming.png"}[e];this.$el.find(".name img[alt='PTT']").attr("src","radio/"+t),this.animatePTT(["in-call","called"].indexOf(e)>-1),this.pttState=e},ptt:function(e){var t=e?"on":"off";this.options.fastCommandCallback&&this.options.fastCommandCallback("ptt",this.model.get("id"),t)},onKeyPress:function(e){return 13===e.keyCode?(this.options.fastCommandCallback&&this.options.fastCommandCallback("text",this.model.get("id"),e.target.value),e.target.value="",!1):(!(this.$el.find("form input").val().length>=this.model.get("hasText"))||e.keyCode in[46,8,39,37])&&void 0},isOpened:function(){return this.$el.is(":visible")},initialize:function(e){var t=this;this.$el.html($(this.elId).html()),this.$el.addClass("info"),this.options=e,this.model.isOpened=this.isOpened.bind(this),this.model.on("change",this.update,this),this.model.on("change:id",function(){return t.$el.find("form input")[0].value=""},this),this.$el.hide();var i=this;setInterval(function(){i.isOpened()?i.updateBubbleTime():i.setPttState("neutral")},1e3)},animatePTT:function(e){var t=this.$el.find(".name .ptt-anim");e?(this.animatePTT.interval&&clearInterval(this.animatePTT.interval),this.animatePTT.interval=setInterval(function(){var e=/_(\d{2})/.exec(t.attr("src"))[1],i=((e=(e=parseInt(e))>12?1:e+1)>9?"":"0")+e;t.attr("src","radio/white_r_radial_spectrum_"+i+".png")},200)):(this.animatePTT.interval&&clearInterval(this.animatePTT.interval),t.attr("src","radio/r_radial_spectrum_00.png"))},updateBubbleTime:function(){var e=this.model,t=moment(e.get("time")),i=t.fromNow()+"&nbsp;&nbsp;&nbsp;["+t.format("HH:mm:ss")+"]";this.$el.find("#time span").html(i)},update:function(){var e=Object.keys(this.model.changedAttributes()),t=e.length&&e[0];this.$el.show();var i=this.model,n="["+i.get("latitude")+","+i.get("longitude")+"]";this.$el.find("#name").text(i.get("id").toUpperCase()),this.$el.find(".position").text(n);var s=i.get("speed")&&i.get("speed").match(/\d+|\w+/g).join(" ");this.updateBubbleTime(),this.$el.find("#speed span").text(s);var r=i.get("altitude")+"",a=this.$el.find("#altitude");r.length&&"0"!==r?a.find("span").text(r):a.hide();var o=this.$el.find("#address");0==i.get("address").length&&(i.attributes.address=n),o.find("a").remove();var l="images/i_street.jpg";i.get("hasStreetView")?(o.find("span").text(""),o.find("span").append($("<a/>",{href:"javascript:google.maps.openStreetView()",text:i.get("address")}))):(o.find("span").text(i.get("address")),l="images/i_street_d.jpg"),o.find("img").attr("src",l),[{".name img[alt='PTT']":"hasVoice"},{form:"hasText"}].forEach(function(e){var t=Object.keys(e)[0],i=this.model.get(e[t])?"show":"hide";this.$el.find(t)[i]()},this),"isInCall"===t&&0!==this.$el.find(".name img[alt='PTT']").length&&this.computePttState()},computePttState:function(e){var t=this.setPttState.bind(this),i=e&&e.type||"none";if("neutral"==this.pttState&&t(this.model.get("isInCall")?"called":"neutral"),"called"==this.pttState&&!this.model.get("isInCall")||("in-call"==this.pttState||"ask-ptt"==this.pttState)&&("mouseup"==i||"dragend"==i))return t("call-done"),this.computePttState.askPttTimeout&&clearTimeout(this.computePttState.askPttTimeout),void(this.computePttState.callDoneTimeout=setTimeout(function(){t("neutral")},2e3));var n=function(){t("call-failed"),setTimeout(function(){t("neutral")},2e3)};return"neutral"==this.pttState&&"mousedown"==i?(t("ask-ptt"),void(this.computePttState.askPttTimeout=setTimeout(function(){n()},1e3*this.model.get("hasVoice")))):"ask-ptt"==this.pttState?(this.computePttState.askPttTimeout&&clearTimeout(this.computePttState.askPttTimeout),void(this.model.get("isInCall")?t("in-call"):n())):"call-done"==this.pttState&&this.model.get("isInCall")?(this.computePttState.callDoneTimeout&&clearTimeout(this.computePttState.callDoneTimeout),void t("called")):void 0}}),datasetLimit=300,DEBUG=-1!=location.href.indexOf("localhost"),mapProvider=-1==location.href.toLowerCase().indexOf("map=osm")?"google":"osm";window.onerror=log;var nearestCallback=null,SfmbMaps=function(){return"google"==mapProvider?SfmbMapsGoogle:SfmbMapsOL}();getHrefParam("listen");var Parser=function(e,t,i){return{parseCommand:function(e){if(e){var t=e.split(",");if(t&&t.length>0){var i=t.shift().toLowerCase();if(!this[i]){var n="WARNING: method ["+i+"] is not defined in Parser.";throw console.error(n),new Error(n)}this[i].apply(this,t)}}},_parsePointsPoly:function(e){var t=[];if(e.length%2!=0)return console.error("Wrong number of args when parsing poly points:"+e),null;for(var i=0;i<e.length;i+=2)t.push(new DataSetPoint(e[i],e[i+1]));return t},_parsePoints:function(e){return Utils.parsePoints(e)},_getDataset:function(t){return this._getModel(e,t)},_getPolygon:function(e){return this._getModel(i,e)},_getModel:function(e,t){var i=e.where({id:t});return i.length>0?i[0]:null},setdataset:function(t){var i=this._parsePoints([].slice.call(arguments,1));if(i){var n=new DataSet({id:t,points:i.map(function(e){return e.dataset=t,e})});return e.get(t)&&this.removedataset(t),e.add(n),n}return null},updatedataset:function(t){var i=this._parsePoints([].slice.call(arguments,1));if(i){var n=e.where({id:t});if(1==n.length)n[0].updatePoints(i);else{console.error("can't find dataset in updateDataset : "+t+"."),console.log("Creating a new dataset "+t+".");var s=this.setdataset.apply(this,arguments);s&&s.set("lastUpdated",new Date)}}},putonmap2:function(e,t){var i=this._getDataset(t);if(i){var e="true"===e,n=new Date;e==i.get("isAutosize")&&1==i.get("isVisible")||(n=i.get("lastUpdated")),i.set({isAutosize:e,isVisible:!0,lastUpdated:n})}},putonmap:function(e){var i=this;"true"==e&&(e="once"),t.set({lastUpdated:new Date});for(var n=arguments.length,s=Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];var a=s.map(function(e){return i._getDataset(e)}).filter(function(e){return!!e});if(a.length)if(a.forEach(function(e){return e&&e.set({isVisible:!0})}),"once"==e){var o=a.reduce(function(e,t){return e.push.apply(e,_toConsumableArray(t.get("points"))),e},[]).map(function(e){return _.pick(e,"latitude","longitude")});t.set({bounds:o})}else{var l="always"===e,h=a[0];h&&h.set({isAutosize:l})}else sendExecTimeSince("set-bounds")},clearfrommap:function(e){var t=this._getDataset(e);t&&t.set({isVisible:!1})},removedataset:function(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];"#all"===i[0]?e.filter(function(e){return e&&"LandView"!=e.get("id")}).forEach(function(t){return e.remove(t)}):(i.forEach(function(t){var i=e.get(t);i?e.remove(i):sendExecTimeSince("remove",new Date)}),console.log("after remove there are datasets: "+e.length))},deletefromdataset:function(e){for(var t=this._getDataset(e),i=arguments.length,n=Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];t&&n.forEach(function(e){return t.removePoint(e)})},centerzoom:function(e,i,n){t.set({center:[e,i],zoom:n})},reset:function(){t.set("isReset",new Date),e.reset()},resize:function(e,i){t.set("dimmensions",[i,e])},openinfo:function(e){"null"!==e&&t.set("openedMarker",e)},putlabels:function(e){var t=this._getDataset(e);t&&(t.attributes.lastUpdated=new Date,t.set("isShowLabels",!0))},removelabels:function(e){var t=this._getDataset(e);t&&(t.attributes.lastUpdated=new Date,t.set("isShowLabels",!1))},setmaptype:function(e){t.set("mapType",e)},setpolygon:function(e,t,n,s,r,a){var o=this._parsePointsPoly([].slice.call(arguments,6));if(o){var l=new Polygon({id:e,color:t,opacity:n,borderColor:s,borderOpacity:r,borderWidth:a,points:o});i.add(l),console.log("Added a polygon. No of polygons:"+i.length)}},newpolygon:function(e,t,n,s,r,a){var o=new Polygon({id:e,color:t,opacity:n,borderColor:s,borderOpacity:r,borderWidth:a,isNew:!0});i.add(o)},getpolygon:function(e){t.set("polygonToGet",{name:e,date:new Date})},deletepolygon:function(e){if("ALL"!=e){var t=this._getPolygon(e);t&&i.remove(t)}else i.reset()},starteditpolygon:function(e){var t=this._getPolygon(e);t&&t.set("isEditing",!0)},endeditpolygon:function(e){var t=this._getPolygon(e);t&&t.set("isEditing",!1)},poly:function(t,i,n,s){var r=e.get(s);r&&(r.set("color",i),r.set("thickness",n),r.set("isPolyline",!0))},getmaptype:function(){},clearresponse:function(){["response_string","click_string"].forEach(function(e){document.getElementById(e).innerHTML=""})},showconsole:function(e){t.set("console",JSON.parse(e.toLowerCase()))},setlegacyicons:function(e){t.set("legacyicons",e)},setcall:function(t,i){e.forEach(function(e){var n=_.clone(e.get("points"),!0),s=_.find(n,{id:t});void 0!==s&&(s.isInCall=JSON.parse(i.toLowerCase()),e.updatePoints([s]))})},updatepolygonstyle:function(e,t,i,n,s,r){var a=this._getPolygon(e);a&&(a.set("color",t),a.set("opacity",i),a.set("borderColor",n),a.set("borderOpacity",s),a.set("borderWidth",r))},setdatasetlimit:function(e){datasetLimit=e},nearest:function(e,t,i,n){for(var s=arguments.length,r=Array(s>4?s-4:0),a=4;a<s;a++)r[a-4]=arguments[a];var o=this._parsePoints(r);console.log("Got "+o.length+" nearest points......"),nearestCallback&&nearestCallback(e,t,i,n,o)}}},globalSets=null,debugServer="10.120.1.120:9000",commandsCache=[];console.warning=log,localIP=null;var listenId=getHrefParam("listen");if(console.log("listen id = "+listenId),listenId){var ws=new WebSocket("ws://"+debugServer+":9000");ws.onopen=function(e){console.log("connected to debug-server web socket"),ws.send(JSON.stringify({listen:listenId}))},ws.onerror=function(e){console.log("Error"+e)},ws.onmessage=function(e){console.log("received from socket ========>"+e.data),GWTcallback(e.data)}}else DEBUG||$.ajax({url:"http://"+debugServer+"/api/status",success:function(e){log("start seeding to"+debugServer),startSeeding()}});